From 6bec5daf842a76a8b62410955e3ce464863094f2 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 11 Nov 2017 23:26:14 +0800 Subject: [PATCH 01/95] update luci ipsec vpn firewall rules --- package/lean/luci-app-ipsec-vpnd/Makefile | 2 +- package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package/lean/luci-app-ipsec-vpnd/Makefile b/package/lean/luci-app-ipsec-vpnd/Makefile index a145e3329..1bf6299b6 100644 --- a/package/lean/luci-app-ipsec-vpnd/Makefile +++ b/package/lean/luci-app-ipsec-vpnd/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for IPSec VPN Server (IKEv1 with PSK and Xauth) LUCI_DEPENDS:=+strongswan-minimal +strongswan-mod-xauth-generic LUCI_PKGARCH:=all PKG_VERSION:=2.0 -PKG_RELEASE:=5 +PKG_RELEASE:=6 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include b/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include index 84129f643..d887c623d 100755 --- a/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include +++ b/package/lean/luci-app-ipsec-vpnd/root/etc/ipsec.include @@ -1,3 +1,8 @@ +iptables -D FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT 2>/dev/null +iptables -D OUTPUT -m policy --dir out --pol ipsec --proto esp -j ACCEPT 2>/dev/null + iptables -I FORWARD -m policy --dir in --pol ipsec --proto esp -j ACCEPT iptables -I FORWARD -m policy --dir out --pol ipsec --proto esp -j ACCEPT iptables -I INPUT -m policy --dir in --pol ipsec --proto esp -j ACCEPT From e04efc21acf91acde6814a11bae61304ec56f1f0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 11 Nov 2017 23:37:17 +0800 Subject: [PATCH 02/95] fix mvebu now using kernel 4.4 --- target/linux/mvebu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index a07aa7cf2..e319a8f82 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -14,7 +14,7 @@ CPU_TYPE:=cortex-a9 CPU_SUBTYPE:=vfpv3 MAINTAINER:=Imre Kaloz -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.4 include $(INCLUDE_DIR)/target.mk From 698ab19b771dbfa36f4da6f90fff5d084ce8e889 Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Mon, 13 Nov 2017 11:16:24 +0800 Subject: [PATCH 03/95] add 941n v7 --- target/linux/ar71xx/base-files/etc/board.d/01_leds | 1 + target/linux/ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/etc/diag.sh | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 +++ target/linux/ar71xx/base-files/lib/upgrade/platform.sh | 1 + target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt | 10 ++++++++++ target/linux/ar71xx/files/arch/mips/ath79/Makefile | 1 + target/linux/ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/tp-link.mk | 9 +++++++++ 11 files changed, 30 insertions(+) diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 27e6c8a03..4d5eb2db2 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -699,6 +699,7 @@ tl-wa901nd) ;; tl-wa901nd-v2|\ tl-wr941nd|\ +tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index a75f5fe29..0c40f162c 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -430,6 +430,7 @@ ar71xx_setup_interfaces() ;; archer-c7-v4|\ tl-wdr4300|\ + tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index f4ad435ea..2d511e64d 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -414,6 +414,7 @@ get_status_led() { tl-wr842n-v2|\ tl-wr842n-v3|\ tl-wr941nd|\ + tl-wr941n-v7|\ tl-wr941nd-v5) status_led="tp-link:green:system" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index f89c0098e..45f0f8676 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1196,6 +1196,9 @@ ar71xx_board_detect() { *"TL-WR941N/ND v6") name="tl-wr941nd-v6" ;; + *"TL-WR941N v7") + name="tl-wr941n-v7" + ;; *"TL-WR941ND") name="tl-wr941nd" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 3d6d9ed57..d9f96525b 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -454,6 +454,7 @@ platform_check_image() { tl-wr902ac-v1|\ tl-wr941nd-v5|\ tl-wr941nd-v6|\ + tl-wr941n-v7|\ tl-wr940n-v4|\ tl-wr941nd) local magic_ver="0100" diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 1f4d9f4c3..f67eaf3a8 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -217,6 +217,7 @@ CONFIG_ATH79_MACH_TL_WR902AC_V1=y CONFIG_ATH79_MACH_TL_WR940N_V4=y CONFIG_ATH79_MACH_TL_WR941ND=y CONFIG_ATH79_MACH_TL_WR941ND_V6=y +CONFIG_ATH79_MACH_TL_WR941N_V7=y CONFIG_ATH79_MACH_TL_WR942N_V1=y CONFIG_ATH79_MACH_TUBE2H=y CONFIG_ATH79_MACH_UBNT=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 84b2a0b72..7915e2344 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -215,6 +215,7 @@ CONFIG_ATH79_MACH_TL_WR902AC_V1=y CONFIG_ATH79_MACH_TL_WR940N_V4=y CONFIG_ATH79_MACH_TL_WR941ND=y CONFIG_ATH79_MACH_TL_WR941ND_V6=y +CONFIG_ATH79_MACH_TL_WR941N_V7=y CONFIG_ATH79_MACH_TL_WR942N_V1=y CONFIG_ATH79_MACH_TUBE2H=y CONFIG_ATH79_MACH_UBNT=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 5cb4f7ed3..330146389 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1,3 +1,13 @@ +config ATH79_MACH_TL_WR941N_V7 + bool "TP-LINK TL-WR941N v7 support" + select SOC_QCA955X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_A60 bool "OpenMesh A40/A60 board support" select SOC_QCA955X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 7d12282ba..43e32a3cd 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -223,6 +223,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o obj-$(CONFIG_ATH79_MACH_TL_WR902AC_V1) += mach-tl-wr902ac-v1.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o +obj-$(CONFIG_ATH79_MACH_TL_WR941N_V7) += mach-tl-wr941n-v7.o obj-$(CONFIG_ATH79_MACH_TL_WR940N_V4) += mach-tl-wr940n-v4.o obj-$(CONFIG_ATH79_MACH_TL_WR942N_V1) += mach-tl-wr942n-v1.o obj-$(CONFIG_ATH79_MACH_TUBE2H) += mach-tube2h.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 01472b679..8cacc2ae9 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -271,6 +271,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ + ATH79_MACH_TL_WR941N_V7, /* TP-LINK TL-WR941N v7 */ ATH79_MACH_TL_WR940N_V4, /* TP-LINK TL-WR940N v4 */ ATH79_MACH_TL_WR942N_V1, /* TP-LINK TL-WR942N v1 */ ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index 4e81251d0..c7426c7ec 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -1119,3 +1119,12 @@ define Device/tl-wr942n-v1 SUPPORTED_DEVICES := tl-wr942n-v1 endef TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1 + +define Device/tl-wr941n-v7 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK WR941N v7 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410007 +endef +TARGET_DEVICES += tl-wr941n-v7 From 9893339684445b7870c67f3b4b72654cd589235d Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Mon, 13 Nov 2017 12:10:53 +0800 Subject: [PATCH 04/95] add+ 941n v7 --- .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c new file mode 100644 index 000000000..8afdb4723 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c @@ -0,0 +1,279 @@ +/* + * TP-LINK TL-WR941N v7 board support + * + * Copyright (C) 2012 Gabor Juhos + * Copyright (C) 2014 Weijie Gao + * + * 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 +#include +#include +#include +#include +#include +#include + +#include + +#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" + +#define WR941NV7_GPIO_LED_WLAN 12 +#define WR941NV7_GPIO_LED_SYSTEM 19 +#define WR941NV7_GPIO_LED_QSS 15 + +#define WR941NV7_GPIO_BTN_RESET 16 + +#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ +#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) + +#define ATH_MII_MGMT_CMD 0x24 +#define ATH_MGMT_CMD_READ 0x1 + +#define ATH_MII_MGMT_ADDRESS 0x28 +#define ATH_ADDR_SHIFT 8 + +#define ATH_MII_MGMT_CTRL 0x2c +#define ATH_MII_MGMT_STATUS 0x30 + +#define ATH_MII_MGMT_IND 0x34 +#define ATH_MGMT_IND_BUSY (1 << 0) +#define ATH_MGMT_IND_INVALID (1 << 2) + +static const char *wr941nv7_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data wr941nv7_flash_data = { + .part_probes = wr941nv7_part_probes, +}; + +static struct gpio_led wr941nv7_leds_gpio[] __initdata = { + { + .name = "tp-link:green:qss", + .gpio = WR941NV7_GPIO_LED_QSS, + .active_low = 1, + }, + { + .name = "tp-link:green:system", + .gpio = WR941NV7_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "tp-link:green:wlan", + .gpio = WR941NV7_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, + .gpio = WR941NV7_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info wr941nv7_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = NULL, + }, +}; + +static unsigned long __init ath_gmac_reg_rd(unsigned long reg) +{ + void __iomem *base; + unsigned long t; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + t = __raw_readl(base + reg); + + iounmap(base); + + return t; +} + +static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) +{ + void __iomem *base; + unsigned long t = value; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + __raw_writel(t, base + reg); + + iounmap(base); +} + +static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; + volatile int rddata; + unsigned short ii = 0xFFFF; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); +} + +static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; + volatile int rddata; + unsigned short ii = 0xffff; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + + return val; +} + +static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) +{ + unsigned int addr_temp; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = (s27_addr) >> 2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + + reg_address = (((addr_temp << 1) & 0x1e) | 0x1); + data = (s27_write_data >> 16) & 0xffff; + phy_reg_write(phy_address, reg_address, data); + + reg_address = ((addr_temp << 1) & 0x1e); + data = s27_write_data & 0xffff; + phy_reg_write(phy_address, reg_address, data); +} + +static unsigned int __init athrs27_reg_read(unsigned int s27_addr) +{ + unsigned int addr_temp; + unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = s27_addr >>2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + reg_address = ((addr_temp << 1) & 0x1e); + s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); + + reg_address = reg_address | 0x1; + s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); + s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; + + return (s27_rd_csr); +} + +static void __init ar8236_reset(void) +{ + unsigned short i = 60; + + athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); + while (i--) + { + mdelay(100); + if (!(athrs27_reg_read(0x0) & 0x80000000)) + break; + } +} + +static void __init wr941nv7_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); + + ath79_register_m25p80(&wr941nv7_flash_data); + ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), + wr941nv7_leds_gpio); + ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, + ARRAY_SIZE(wr941nv7_gpio_keys), + wr941nv7_gpio_keys); + + ath79_register_wmac(art, mac); + + ar8236_reset(); + + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | + QCA955X_ETH_CFG_MII_GE0_SLAVE); + + mdiobus_register_board_info(wr941nv7_mdio0_info, + ARRAY_SIZE(wr941nv7_mdio0_info)); + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + + /* GMAC0 is connected to an AR8236 switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", + "TP-LINK TL-WR941N v7", + wr941nv7_setup); From d228ba0d1fba9eda6266025752415f215f05b1f2 Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Mon, 13 Nov 2017 13:06:14 +0800 Subject: [PATCH 05/95] add tl-wdr6500 v6 --- .../ar71xx/base-files/etc/board.d/01_leds | 1 + .../ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/etc/diag.sh | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 6 ++++ .../ar71xx/base-files/lib/upgrade/platform.sh | 3 ++ target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../files/arch/mips/ath79/Kconfig.openwrt | 31 +++++++++++++------ .../ar71xx/files/arch/mips/ath79/Makefile | 1 + .../ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/tp-link.mk | 12 +++++++ 11 files changed, 49 insertions(+), 10 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 4d5eb2db2..58b8cf205 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -722,6 +722,7 @@ tl-wdr4900-v2) ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt" ;; tl-wdr6500-v2|\ +tl-wdr6500-v6|\ tl-wr741nd) ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 0c40f162c..abbcbdf9b 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -311,6 +311,7 @@ ar71xx_setup_interfaces() r6100|\ smart-300|\ tl-wdr6500-v2|\ + tl-wdr6500-v6|\ tl-wr940n-v4|\ tl-wr941nd-v6|\ wnr1000-v2|\ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 2d511e64d..040286830 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -440,6 +440,7 @@ get_status_led() { tl-wr2543n) status_led="tp-link:green:wps" ;; + tl-wdr6500-v6|\ tl-wdr6500-v2) status_led="tp-link:white:system" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 45f0f8676..0186ba7b9 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -318,6 +318,9 @@ tplink_board_detect() { "65000002") model="TP-Link TL-WDR6500" ;; + "65000006") + model="TP-Link TL-WDR6500" + ;; "721000"*) model="TP-Link TL-WA7210N" ;; @@ -1112,6 +1115,9 @@ ar71xx_board_detect() { *"TL-WDR6500 v2") name="tl-wdr6500-v2" ;; + *"TL-WDR6500 v6") + name="tl-wdr6500-v6" + ;; *"TL-WPA8630") name="tl-wpa8630" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index d9f96525b..a59b3e4f8 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -427,6 +427,7 @@ platform_check_image() { tl-wdr4300|\ tl-wdr4900-v2|\ tl-wdr6500-v2|\ + tl-wdr6500-v6|\ tl-wpa8630|\ tl-wr1041n-v2|\ tl-wr1043nd-v2|\ @@ -460,6 +461,8 @@ platform_check_image() { local magic_ver="0100" case "$board" in + tl-wdr6500-v6|\ + tl-wdr3320-v2|\ tl-wdr6500-v2) magic_ver="0200" ;; diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 70d19d6c7..cd9861109 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -196,6 +196,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y CONFIG_ATH79_MACH_TL_WDR3500=y CONFIG_ATH79_MACH_TL_WDR4300=y CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WDR6500_V6=y CONFIG_ATH79_MACH_TL_WPA8630=y CONFIG_ATH79_MACH_TL_WR1041N_V2=y CONFIG_ATH79_MACH_TL_WR1043ND=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 9b1a5775b..b5359e3e8 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -194,6 +194,7 @@ CONFIG_ATH79_MACH_TL_WDR3320_V2=y CONFIG_ATH79_MACH_TL_WDR3500=y CONFIG_ATH79_MACH_TL_WDR4300=y CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WDR6500_V6=y CONFIG_ATH79_MACH_TL_WPA8630=y CONFIG_ATH79_MACH_TL_WR1041N_V2=y CONFIG_ATH79_MACH_TL_WR1043ND=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 330146389..724422313 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1,13 +1,3 @@ -config ATH79_MACH_TL_WR941N_V7 - bool "TP-LINK TL-WR941N v7 support" - select SOC_QCA955X - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - select ATH79_DEV_WMAC - config ATH79_MACH_A60 bool "OpenMesh A40/A60 board support" select SOC_QCA955X @@ -1635,6 +1625,17 @@ config ATH79_MACH_TL_WDR6500_V2 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WDR6500_V6 + bool "TP-LINK TL-WDR6500 v6 board support" + select SOC_QCA956X + 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_USB + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR703N bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support" select SOC_AR933X @@ -1768,6 +1769,16 @@ config ATH79_MACH_TL_WR941ND_V6 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR941N_V7 + bool "TP-LINK TL-WR941N v7 support" + select SOC_QCA955X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR940N_V4 bool "TP-LINK TL-WR940N v4 support" select SOC_QCA956X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 43e32a3cd..cd75f059f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -203,6 +203,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WDR3320_V2) += mach-tl-wdr3320-v2.o obj-$(CONFIG_ATH79_MACH_TL_WDR3500) += mach-tl-wdr3500.o obj-$(CONFIG_ATH79_MACH_TL_WDR4300) += mach-tl-wdr4300.o obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v2.o +obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v6.o obj-$(CONFIG_ATH79_MACH_TL_WPA8630) += mach-tl-wpa8630.o obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 8cacc2ae9..982bde48a 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -243,6 +243,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WDR4300, /* TP-LINK TL-WDR4300 */ ATH79_MACH_TL_WDR4900_V2, /* TP-LINK TL-WDR4900 v2 */ ATH79_MACH_TL_WDR6500_V2, /* TP-LINK TL-WDR6500 v2 */ + ATH79_MACH_TL_WDR6500_V6, /* TP-LINK TL-WDR6500 v6 */ ATH79_MACH_TL_WPA8630, /* TP-Link TL-WPA8630 */ ATH79_MACH_TL_WR1041N_V2, /* TP-LINK TL-WR1041N v2 */ ATH79_MACH_TL_WR1043ND, /* TP-LINK TL-WR1043ND */ diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index ea1b26209..3dff3a7a1 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -1129,3 +1129,15 @@ define Device/tl-wr941n-v7 endef TARGET_DEVICES += tl-wr941n-v7 +define Device/tl-wdr6500-v6 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR6500 v6 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | mktplinkfw-combined + BOARDNAME := TL-WDR6500-v6 + DEVICE_PROFILE := TLWDR6500V6 + TPLINK_HWID := 0x65000006 + TPLINK_HEADER_VERSION := 2 +endef +TARGET_DEVICES += tl-wdr6500-v6 From b535b060c1d4984304f1a48ecbfa8a0e6d292b0a Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Mon, 13 Nov 2017 21:23:57 +0800 Subject: [PATCH 06/95] add+ tl-wdr6500 v6 --- .../ar71xx/files/arch/mips/ath79/Makefile | 2 +- .../arch/mips/ath79/mach-tl-wdr6500-v6.c | 113 ++++++++++++++++++ 2 files changed, 114 insertions(+), 1 deletion(-) create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index cd75f059f..04cb4faa0 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -203,7 +203,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WDR3320_V2) += mach-tl-wdr3320-v2.o obj-$(CONFIG_ATH79_MACH_TL_WDR3500) += mach-tl-wdr3500.o obj-$(CONFIG_ATH79_MACH_TL_WDR4300) += mach-tl-wdr4300.o obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v2.o -obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v6.o +obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V6) += mach-tl-wdr6500-v6.o obj-$(CONFIG_ATH79_MACH_TL_WPA8630) += mach-tl-wpa8630.o obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c new file mode 100755 index 000000000..8e5bcea4c --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c @@ -0,0 +1,113 @@ +/* + * TP-LINK TL-WDR6500 v6 + * + */ +#include +#include +#include +#include +#include +#include "common.h" +#include "dev-eth.h" +#include "dev-ap9x-pci.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" +#include "pci.h" +#define TL_WDR6500_V6_GPIO_LED_SYS 21 +#define TL_WDR6500_V6_GPIO_LED_WAN 18 +#define TL_WDR6500_V6_GPIO_LED_LAN1 17 +#define TL_WDR6500_V6_GPIO_LED_LAN2 16 +#define TL_WDR6500_V6_GPIO_LED_LAN3 15 +#define TL_WDR6500_V6_GPIO_LED_LAN4 14 +#define TL_WDR6500_V6_GPIO_BTN_RESET 1 +#define TL_WDR6500_V6_KEYS_POLL_INTERVAL 20 /* msecs */ +#define TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WDR6500_V6_KEYS_POLL_INTERVAL) +#define TL_WDR6500_V6_WMAC_CALDATA_OFFSET 0x1000 +#define TL_WDR6500_V6_PCIE_CALDATA_OFFSET 0x5000 +static const char *tl_wdr6500_v6_part_probes[] = { + "tp-link-64k", + NULL, +}; +static struct flash_platform_data tl_wdr6500_v6_flash_data = { + .part_probes = tl_wdr6500_v6_part_probes, +}; +static struct gpio_led tl_wdr6500_v6_leds_gpio[] __initdata = { + { + .name = "tp-link:green:lan1", + .gpio = TL_WDR6500_V6_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "tp-link:green:lan2", + .gpio = TL_WDR6500_V6_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "tp-link:green:lan3", + .gpio = TL_WDR6500_V6_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "tp-link:green:lan4", + .gpio = TL_WDR6500_V6_GPIO_LED_LAN4, + .active_low = 1, + }, { + .name = "tp-link:green:wan", + .gpio = TL_WDR6500_V6_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "tp-link:white:system", + .gpio = TL_WDR6500_V6_GPIO_LED_SYS, + .active_low = 0, + }, +}; +static struct gpio_keys_button tl_wdr6500_v6_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WDR6500_V6_GPIO_BTN_RESET, + .active_low = 1, + } +}; +static void __init tl_ap151_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f00fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff0000); + u8 tmpmac[ETH_ALEN]; + ath79_register_usb(); + ath79_register_m25p80(&tl_wdr6500_v6_flash_data); + ath79_setup_ar933x_phy4_switch(false, false); + ath79_register_mdio(1, 0x0); + /* WAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = BIT(4); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + /* LAN */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.speed = SPEED_1000; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + ath79_init_mac(tmpmac, mac, -1); + ath79_register_wmac(ee + TL_WDR6500_V6_WMAC_CALDATA_OFFSET, tmpmac); + ath79_register_pci(); + ath79_register_usb(); +} +static void __init tl_wdr6500_v6_setup(void) +{ + tl_ap151_setup(); + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr6500_v6_leds_gpio), + tl_wdr6500_v6_leds_gpio); + ath79_register_gpio_keys_polled(1, TL_WDR6500_V6_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wdr6500_v6_gpio_keys), + tl_wdr6500_v6_gpio_keys); +} +MIPS_MACHINE(ATH79_MACH_TL_WDR6500_V6, "TL-WDR6500-v6", "TP-LINK TL-WDR6500 v6", + tl_wdr6500_v6_setup); From 2fc7c3ef538ab35ae16afad722fe083498c8964d Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Tue, 14 Nov 2017 03:48:39 +0800 Subject: [PATCH 07/95] add tl-wr842 v9 and tl-wr882 v1 --- .../ar71xx/base-files/etc/board.d/01_leds | 9 ++ .../ar71xx/base-files/etc/board.d/02_network | 2 + target/linux/ar71xx/base-files/etc/diag.sh | 4 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 6 + .../ar71xx/base-files/lib/upgrade/platform.sh | 2 + target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../files/arch/mips/ath79/Kconfig.openwrt | 10 ++ .../ar71xx/files/arch/mips/ath79/Makefile | 1 + .../files/arch/mips/ath79/mach-tl-wr841n-v9.c | 104 +++++++++++++++++- .../ar71xx/files/arch/mips/ath79/machtypes.h | 2 + target/linux/ar71xx/image/tp-link.mk | 19 ++++ 12 files changed, 159 insertions(+), 2 deletions(-) diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 58b8cf205..4b845404f 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -745,6 +745,7 @@ tl-wpa8630) tl-wr740n-v6|\ tl-wr841n-v9|\ tl-wr841n-v11|\ +tl-wr842n-v9|\ tl-wr842n-v3) ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" @@ -754,6 +755,7 @@ tl-wr842n-v3) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" case "$board" in + tl-wr842n-v9|\ tl-wr842n-v3) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" ;; @@ -813,6 +815,13 @@ tl-wr2543n) ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt" ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ;; +tl-wr882n-v1) + ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" + ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + ;; tube2h) ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0" ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index abbcbdf9b..397fcb06f 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -49,6 +49,8 @@ ar71xx_setup_interfaces() tl-wr841n-v11|\ tl-wr841n-v9|\ tl-wr842n-v3|\ + tl-wr842n-v9|\ + tl-wr882n-v1|\ whr-g301n|\ whr-hp-g300n|\ whr-hp-gn|\ diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 040286830..1bfc07b4a 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -413,6 +413,7 @@ get_status_led() { tl-wa830re-v2|\ tl-wr842n-v2|\ tl-wr842n-v3|\ + tl-wr842n-v9|\ tl-wr941nd|\ tl-wr941n-v7|\ tl-wr941nd-v5) @@ -437,6 +438,9 @@ get_status_led() { tl-wr841n-v9) status_led="tp-link:green:qss" ;; + tl-wr882n-v1) + status_led="tp-link:white:status" + ;; tl-wr2543n) status_led="tp-link:green:wps" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 0186ba7b9..9b5c5fbff 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -1190,6 +1190,12 @@ ar71xx_board_detect() { *"TL-WR842N/ND v3") name="tl-wr842n-v3" ;; + *"TL-WR842N/ND v9") + name="tl-wr842n-v9" + ;; + *"TL-WR882N v1") + name="tl-wr882n-v1" + ;; *"TL-WR902AC v1") name="tl-wr902ac-v1" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index a59b3e4f8..632b61cba 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -452,6 +452,8 @@ platform_check_image() { tl-wr841n-v9|\ tl-wr842n-v2|\ tl-wr842n-v3|\ + tl-wr842n-v9|\ + tl-wr882n-v1|\ tl-wr902ac-v1|\ tl-wr941nd-v5|\ tl-wr941nd-v6|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index cd9861109..fd77853f8 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -214,6 +214,7 @@ CONFIG_ATH79_MACH_TL_WR840N_V2=y CONFIG_ATH79_MACH_TL_WR841N_V1=y CONFIG_ATH79_MACH_TL_WR841N_V8=y CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR882N_V1=y CONFIG_ATH79_MACH_TL_WR902AC_V1=y CONFIG_ATH79_MACH_TL_WR940N_V4=y CONFIG_ATH79_MACH_TL_WR941ND=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index b5359e3e8..c07be1dc9 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -212,6 +212,7 @@ CONFIG_ATH79_MACH_TL_WR840N_V2=y CONFIG_ATH79_MACH_TL_WR841N_V1=y CONFIG_ATH79_MACH_TL_WR841N_V8=y CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR882N_V1=y CONFIG_ATH79_MACH_TL_WR902AC_V1=y CONFIG_ATH79_MACH_TL_WR940N_V4=y CONFIG_ATH79_MACH_TL_WR941ND=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 724422313..be94fd0c8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -1739,6 +1739,16 @@ config ATH79_MACH_TL_WR841N_V9 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR882N_V1 + bool "TP-LINK TL-WR882N v1 support" + select SOC_QCA956X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + select ATH79_DEV_USB + config ATH79_MACH_TL_WR902AC_V1 bool "TP-LINK TL-WR902AC v1 support" select SOC_QCA953X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 04cb4faa0..8ba3e8c6b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -221,6 +221,7 @@ obj-$(CONFIG_ATH79_MACH_TL_WR840N_V2) += mach-tl-wr841n-v9.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1) += mach-tl-wr841n.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o +obj-$(CONFIG_ATH79_MACH_TL_WR882N_V1) += mach-tl-wr882n-v1.o obj-$(CONFIG_ATH79_MACH_TL_WR902AC_V1) += mach-tl-wr902ac-v1.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c index 304d8ff6e..318c0ce4c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c @@ -73,6 +73,17 @@ #define TL_WR842NV3_GPIO_BTN_RESET 1 #define TL_WR842NV3_GPIO_BTN_WIFI 0 +#define TL_WR842NV9_GPIO_LED_WLAN 12 +#define TL_WR842NV9_GPIO_LED_QSS 3 +#define TL_WR842NV9_GPIO_LED_WAN 11 +#define TL_WR842NV9_GPIO_LED_LAN1 16 +#define TL_WR842NV9_GPIO_LED_LAN2 15 +#define TL_WR842NV9_GPIO_LED_LAN3 14 +#define TL_WR842NV9_GPIO_LED_LAN4 4 +#define TL_WR842NV9_GPIO_LED_SYSTEM 13 +#define TL_WR842NV9_GPIO_BTN_RESET 17 +#define TL_WR842NV9_GPIO_BTN_WIFI 0 + #define TL_WR740NV6_GPIO_LED_SYSTEM 1 #define TL_WR740NV6_GPIO_LED_QSS 3 #define TL_WR740NV6_GPIO_LED_WAN_ORANGE 2 @@ -343,15 +354,59 @@ static struct gpio_keys_button tl_wr740n_v6_gpio_keys[] __initdata = { } }; +static struct gpio_led tl_wr842n_v9_leds_gpio[] __initdata = { + { + .name = "tp-link:green:lan1", + .gpio = TL_WR842NV9_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "tp-link:green:lan2", + .gpio = TL_WR842NV9_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "tp-link:green:lan3", + .gpio = TL_WR842NV9_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "tp-link:green:lan4", + .gpio = TL_WR842NV9_GPIO_LED_LAN4, + .active_low = 1, + }, { + .name = "tp-link:green:system", + .gpio = TL_WR842NV9_GPIO_LED_SYSTEM, + .active_low = 1, + }, { + .name = "tp-link:green:wan", + .gpio = TL_WR842NV9_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "tp-link:green:wlan", + .gpio = TL_WR842NV9_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button tl_wr842n_v9_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = TL_WR841NV9_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WR842NV9_GPIO_BTN_RESET, + .active_low = 1, + } +}; + static void __init tl_ap143_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); u8 tmpmac[ETH_ALEN]; + ath79_register_usb(); ath79_register_m25p80(&tl_wr841n_v9_flash_data); - ath79_setup_ar933x_phy4_switch(false, false); + /*ath79_setup_ar933x_phy4_switch(false, false);*/ ath79_register_mdio(0, 0x0); @@ -435,7 +490,6 @@ static void __init tl_wr842n_v3_setup(void) ARRAY_SIZE(tl_wr842n_v3_gpio_keys), tl_wr842n_v3_gpio_keys); - ath79_register_usb(); } MIPS_MACHINE(ATH79_MACH_TL_WR842N_V3, "TL-WR842N-v3", "TP-LINK TL-WR842N/ND v3", @@ -455,3 +509,49 @@ static void __init tl_wr740n_v6_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WR740N_V6, "TL-WR740N-v6", "TP-LINK TL-WR740N/ND v6", tl_wr740n_v6_setup); + +static void __init tl_wr842n_v9_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + u8 tmpmac[ETH_ALEN]; + ath79_register_usb(); + ath79_register_m25p80(&tl_wr841n_v9_flash_data); + + /*ath79_setup_ar933x_phy4_switch(false, false);*/ + + ath79_register_mdio(0, 0x0); + ath79_register_mdio(1, 0x0); + /* add by zcc */ + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); + /* LAN */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.speed = SPEED_1000; + ath79_switch_data.phy_poll_mask |= BIT(0); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + + ath79_init_mac(tmpmac, mac, 0); + ath79_register_wmac(ee, tmpmac); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr842n_v9_leds_gpio), + tl_wr842n_v9_leds_gpio); + + ath79_register_gpio_keys_polled(1, TL_WR841NV9_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr842n_v9_gpio_keys), + tl_wr842n_v9_gpio_keys); + +} + +MIPS_MACHINE(ATH79_MACH_TL_WR842N_V9, "TL-WR842N-v9", "TP-LINK TL-WR842N/ND v9", + tl_wr842n_v9_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 982bde48a..6016a72c1 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -268,6 +268,8 @@ enum ath79_mach_type { ATH79_MACH_TL_WR841N_V9, /* TP-LINK TL-WR841N/ND v9 */ ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ ATH79_MACH_TL_WR842N_V3, /* TP-LINK TL-WR842N/ND v3 */ + ATH79_MACH_TL_WR842N_V9, /* TP-LINK TL-WR842N/ND v9 */ + ATH79_MACH_TL_WR882N_V1, /* TP-LINK TL-WR882N v1 */ ATH79_MACH_TL_WR902AC_V1, /* TP-LINK TL-WR902AC v1 */ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index 3dff3a7a1..abfa4ec4a 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -1141,3 +1141,22 @@ define Device/tl-wdr6500-v6 TPLINK_HEADER_VERSION := 2 endef TARGET_DEVICES += tl-wdr6500-v6 + +define Device/tl-wr842n-v9 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v9 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR842N-v9 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x08420009 +endef +TARGET_DEVICES += tl-wr842n-v9 + +define Device/tl-wr882n-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR882N v1 + BOARDNAME := TL-WR882N-v1 + DEVICE_PROFILE := TLWR882 + TPLINK_HWID := 0x08820001 +endef +TARGET_DEVICES += tl-wr882n-v1 From 1de9ee7e73d3bf538fc49c2290fdfb67ade6166d Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Tue, 14 Nov 2017 03:53:38 +0800 Subject: [PATCH 08/95] add tl-wr842 v9 and tl-wr882 v1 --- .../files/arch/mips/ath79/mach-tl-wr882n-v1.c | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c new file mode 100644 index 000000000..abde05cbd --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c @@ -0,0 +1,126 @@ +/* + * TP-LINK TL-WR882N v1 + * + * Copyright (C) Weijie Gao + * + * 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 +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define TL_WR882NV1_GPIO_LED_WAN 2 +#define TL_WR882NV1_GPIO_LED_LAN1 4 +#define TL_WR882NV1_GPIO_LED_LAN2 5 +#define TL_WR882NV1_GPIO_LED_LAN3 6 +#define TL_WR882NV1_GPIO_LED_LAN4 7 +#define TL_WR882NV1_GPIO_LED_SYS 18 + +#define TL_WR882NV1_GPIO_BTN_RESET 1 + +#define TL_WR882NV1_KEYS_POLL_INTERVAL 20 /* msecs */ +#define TL_WR882NV1_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR882NV1_KEYS_POLL_INTERVAL) + +static const char *tl_wr882n_v1_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data tl_wr882n_v1_flash_data = { + .part_probes = tl_wr882n_v1_part_probes, +}; + +static struct gpio_led tl_wr882n_v1_leds_gpio[] __initdata = { + { + .name = "tp-link:green:lan1", + .gpio = TL_WR882NV1_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "tp-link:green:lan2", + .gpio = TL_WR882NV1_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "tp-link:green:lan3", + .gpio = TL_WR882NV1_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "tp-link:green:lan4", + .gpio = TL_WR882NV1_GPIO_LED_LAN4, + .active_low = 1, + }, { + .name = "tp-link:green:wan", + .gpio = TL_WR882NV1_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "tp-link:white:status", + .gpio = TL_WR882NV1_GPIO_LED_SYS, + .active_low = 1, + }, +}; + +static struct gpio_keys_button tl_wr882n_v1_gpio_keys[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = TL_WR882NV1_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WR882NV1_GPIO_BTN_RESET, + .active_low = 1, + } +}; + + +static void __init tl_cus249_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + + ath79_register_m25p80(&tl_wr882n_v1_flash_data); + + ath79_register_mdio(0, 0x0); + + /* LAN */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.speed = SPEED_1000; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = BIT(4); + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + + ath79_register_wmac(ee, mac); +} + +static void __init tl_wr882n_v1_setup(void) +{ + tl_cus249_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr882n_v1_leds_gpio), + tl_wr882n_v1_leds_gpio); + + ath79_register_gpio_keys_polled(1, TL_WR882NV1_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr882n_v1_gpio_keys), + tl_wr882n_v1_gpio_keys); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR882N_V1, "TL-WR882N-v1", "TP-LINK TL-WR882N v1", + tl_wr882n_v1_setup); From 95a7137bf8343f39552d010d5293e32d0efeedae Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Fri, 17 Nov 2017 03:23:24 +0800 Subject: [PATCH 09/95] add sgr-w500-n85b-v2 --- .../ar71xx/base-files/etc/board.d/01_leds | 3 + .../ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/etc/diag.sh | 3 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 3 + .../ar71xx/base-files/lib/upgrade/platform.sh | 1 + target/linux/ar71xx/config-4.4 | 1 + target/linux/ar71xx/config-4.9 | 1 + .../files/arch/mips/ath79/Kconfig.openwrt | 11 + .../ar71xx/files/arch/mips/ath79/Makefile | 1 + .../arch/mips/ath79/mach-sgr-w500-n85b-v2.c | 134 +++++++++ .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 ------------------ .../ar71xx/files/arch/mips/ath79/machtypes.h | 1 + target/linux/ar71xx/image/legacy-devices.mk | 6 + target/linux/ar71xx/image/legacy.mk | 1 + 14 files changed, 167 insertions(+), 279 deletions(-) create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 4b845404f..61665fed9 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -565,6 +565,9 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; +sgr-w500-n85b-v2) + ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan2g" "phy0tpt" + ;; smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 397fcb06f..24501990f 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -132,6 +132,7 @@ ar71xx_setup_interfaces() unifiac-lite|\ wi2a-ac200i|\ wndap360|\ + sgr-w500-n85b-v2 |\ wp543) ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 1bfc07b4a..2ac3aea0a 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -350,6 +350,9 @@ get_status_led() { rw2458n) status_led="$board:green:d3" ;; + sgr-w500-n85b-v2) + status_led="grentech:green:status" + ;; smart-300) status_led="nc-link:green:system" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 9b5c5fbff..3819b96b8 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -992,6 +992,9 @@ ar71xx_board_detect() { *"SC450") name="sc450" ;; + "GRENTECH SGR-W500-N85b v2.0") + name="sgr-w500-n85b-v2" + ;; *"SMART-300") name="smart-300" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 632b61cba..a41f3b709 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -328,6 +328,7 @@ platform_check_image() { hornet-ub|\ mr12|\ mr16|\ + sgr-w500-n85b-v2|\ zbt-we1526|\ zcn-1523h-2|\ zcn-1523h-5) diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index fd77853f8..1cf7677f9 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -168,6 +168,7 @@ CONFIG_ATH79_MACH_RW2458N=y CONFIG_ATH79_MACH_SC1750=y CONFIG_ATH79_MACH_SC300M=y CONFIG_ATH79_MACH_SC450=y +CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y CONFIG_ATH79_MACH_SMART_300=y CONFIG_ATH79_MACH_SOM9331=y CONFIG_ATH79_MACH_SR3200=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index c07be1dc9..2f963c730 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -166,6 +166,7 @@ CONFIG_ATH79_MACH_RW2458N=y CONFIG_ATH79_MACH_SC1750=y CONFIG_ATH79_MACH_SC300M=y CONFIG_ATH79_MACH_SC450=y +CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y CONFIG_ATH79_MACH_SMART_300=y CONFIG_ATH79_MACH_SOM9331=y CONFIG_ATH79_MACH_SR3200=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index be94fd0c8..f0203c2a9 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -2171,3 +2171,14 @@ config ATH79_MACH_FRITZ300E select ATH79_DEV_GPIO_BUTTONS select ATH79_DEV_LEDS_GPIO select ATH79_DEV_M25P80 + +config ATH79_MACH_SGR_W500_N85B_V2 + bool "GRENTECH SGR-W500-N85b v2.0 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_M25P80 + select ATH79_DEV_WMAC + select ATH79_DEV_USB diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 8ba3e8c6b..6af6e8071 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -175,6 +175,7 @@ obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o obj-$(CONFIG_ATH79_MACH_SC450) += mach-sc450.o +obj-$(CONFIG_ATH79_MACH_SGR_W500_N85B_V2) += mach-sgr-w500-n85b-v2.o obj-$(CONFIG_ATH79_MACH_SMART_300) += mach-smart-300.o obj-$(CONFIG_ATH79_MACH_SOM9331) += mach-som9331.o obj-$(CONFIG_ATH79_MACH_SR3200) += mach-sr3200.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c new file mode 100755 index 000000000..d2749e483 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c @@ -0,0 +1,134 @@ +/* + * GRENTECH SGR-W500-N85b v2.0 board support + * + * Copyright (c) 2017 Weijie Gao + * + * 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 +#include +#include +#include +#include + +#include + +#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-wmac.h" +#include "machtypes.h" + +#define GRENTECH_GPIO_LED_STATUS 21 +#define GRENTECH_GPIO_LED_WLAN2G 20 + +#define GRENTECH_GPIO_BUTTON_RESET 3 + +#define GRENTECH_GPIO_RTL8211E_RESET_L 11 + +#define GRENTECH_GPIO_EXTERNAL_LNA0 18 +#define GRENTECH_GPIO_EXTERNAL_LNA1 19 + +#define GRENTECH_KEYS_POLL_INTERVAL 20 /* msecs */ +#define GRENTECH_KEYS_DEBOUNCE_INTERVAL (3 * GRENTECH_KEYS_POLL_INTERVAL) + +#define GRENTECH_MAC_OFFSET 0 +#define GRENTECH_WMAC_CALDATA_OFFSET 0x1000 +#define GRENTECH_PCIE_CALDATA_OFFSET 0x5000 + +static struct gpio_led grentech_leds_gpio[] __initdata = { + { + .name = "grentech:green:status", + .gpio = GRENTECH_GPIO_LED_STATUS, + .active_low = 1, + }, + { + .name = "grentech:green:wlan2g", + .gpio = GRENTECH_GPIO_LED_WLAN2G, + .active_low = 1, + } +}; + +static struct gpio_keys_button grentech_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = GRENTECH_KEYS_DEBOUNCE_INTERVAL, + .gpio = GRENTECH_GPIO_BUTTON_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info grentech_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 1, + }, +}; + +static void __init grentech_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + u8 tmpmac[ETH_ALEN]; + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(grentech_leds_gpio), + grentech_leds_gpio); + ath79_register_gpio_keys_polled(-1, GRENTECH_KEYS_POLL_INTERVAL, + ARRAY_SIZE(grentech_gpio_keys), + grentech_gpio_keys); + + gpio_request_one(GRENTECH_GPIO_RTL8211E_RESET_L, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "RTL8211E reset pin"); + + ath79_wmac_set_ext_lna_gpio(0, GRENTECH_GPIO_EXTERNAL_LNA0); + ath79_wmac_set_ext_lna_gpio(1, GRENTECH_GPIO_EXTERNAL_LNA1); + + ath79_init_mac(tmpmac, art + GRENTECH_MAC_OFFSET, 1); + ath79_register_wmac(art + GRENTECH_WMAC_CALDATA_OFFSET, tmpmac); + + /* AR9382 */ + ath79_init_mac(tmpmac, art + GRENTECH_MAC_OFFSET, 2); + ap9x_pci_setup_wmac_led_pin(0, 6); + ap91_pci_init(art + GRENTECH_PCIE_CALDATA_OFFSET, tmpmac); + + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0); + + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, art + GRENTECH_MAC_OFFSET, 0); + + mdiobus_register_board_info(grentech_mdio0_info, + ARRAY_SIZE(grentech_mdio0_info)); + + /* GMAC0 is connected to a RTL8211E Gigabit PHY */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(1); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_pll_data.pll_1000 = 0x46000000; + ath79_eth0_pll_data.pll_100 = 0x0101; + ath79_eth0_pll_data.pll_10 = 0x1313; + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_SGR_W500_N85B_V2, "SGRW500N85BV2", "GRENTECH SGR-W500-N85b v2.0", + grentech_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c deleted file mode 100644 index 8afdb4723..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * TP-LINK TL-WR941N v7 board support - * - * Copyright (C) 2012 Gabor Juhos - * Copyright (C) 2014 Weijie Gao - * - * 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 -#include -#include -#include -#include -#include -#include - -#include - -#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" - -#define WR941NV7_GPIO_LED_WLAN 12 -#define WR941NV7_GPIO_LED_SYSTEM 19 -#define WR941NV7_GPIO_LED_QSS 15 - -#define WR941NV7_GPIO_BTN_RESET 16 - -#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ -#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) - -#define ATH_MII_MGMT_CMD 0x24 -#define ATH_MGMT_CMD_READ 0x1 - -#define ATH_MII_MGMT_ADDRESS 0x28 -#define ATH_ADDR_SHIFT 8 - -#define ATH_MII_MGMT_CTRL 0x2c -#define ATH_MII_MGMT_STATUS 0x30 - -#define ATH_MII_MGMT_IND 0x34 -#define ATH_MGMT_IND_BUSY (1 << 0) -#define ATH_MGMT_IND_INVALID (1 << 2) - -static const char *wr941nv7_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data wr941nv7_flash_data = { - .part_probes = wr941nv7_part_probes, -}; - -static struct gpio_led wr941nv7_leds_gpio[] __initdata = { - { - .name = "tp-link:green:qss", - .gpio = WR941NV7_GPIO_LED_QSS, - .active_low = 1, - }, - { - .name = "tp-link:green:system", - .gpio = WR941NV7_GPIO_LED_SYSTEM, - .active_low = 1, - }, - { - .name = "tp-link:green:wlan", - .gpio = WR941NV7_GPIO_LED_WLAN, - .active_low = 1, - }, -}; - -static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, - .gpio = WR941NV7_GPIO_BTN_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info wr941nv7_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 0, - .platform_data = NULL, - }, -}; - -static unsigned long __init ath_gmac_reg_rd(unsigned long reg) -{ - void __iomem *base; - unsigned long t; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - t = __raw_readl(base + reg); - - iounmap(base); - - return t; -} - -static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) -{ - void __iomem *base; - unsigned long t = value; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - __raw_writel(t, base + reg); - - iounmap(base); -} - -static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; - volatile int rddata; - unsigned short ii = 0xFFFF; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); -} - -static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; - volatile int rddata; - unsigned short ii = 0xffff; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - - return val; -} - -static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) -{ - unsigned int addr_temp; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = (s27_addr) >> 2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - - reg_address = (((addr_temp << 1) & 0x1e) | 0x1); - data = (s27_write_data >> 16) & 0xffff; - phy_reg_write(phy_address, reg_address, data); - - reg_address = ((addr_temp << 1) & 0x1e); - data = s27_write_data & 0xffff; - phy_reg_write(phy_address, reg_address, data); -} - -static unsigned int __init athrs27_reg_read(unsigned int s27_addr) -{ - unsigned int addr_temp; - unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = s27_addr >>2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - reg_address = ((addr_temp << 1) & 0x1e); - s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); - - reg_address = reg_address | 0x1; - s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); - s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; - - return (s27_rd_csr); -} - -static void __init ar8236_reset(void) -{ - unsigned short i = 60; - - athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); - while (i--) - { - mdelay(100); - if (!(athrs27_reg_read(0x0) & 0x80000000)) - break; - } -} - -static void __init wr941nv7_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); - - ath79_register_m25p80(&wr941nv7_flash_data); - ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), - wr941nv7_leds_gpio); - ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, - ARRAY_SIZE(wr941nv7_gpio_keys), - wr941nv7_gpio_keys); - - ath79_register_wmac(art, mac); - - ar8236_reset(); - - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | - QCA955X_ETH_CFG_MII_GE0_SLAVE); - - mdiobus_register_board_info(wr941nv7_mdio0_info, - ARRAY_SIZE(wr941nv7_mdio0_info)); - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - - /* GMAC0 is connected to an AR8236 switch */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.phy_mask = BIT(0); - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_register_eth(0); - - ath79_register_usb(); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", - "TP-LINK TL-WR941N v7", - wr941nv7_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 6016a72c1..8d9b6b080 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -203,6 +203,7 @@ enum ath79_mach_type { ATH79_MACH_SC1750, /* Abicom SC1750 */ ATH79_MACH_SC300M, /* Abicom SC300M */ ATH79_MACH_SC450, /* Abicom SC450 */ + ATH79_MACH_SGR_W500_N85B_V2, /* GRENTECH SGR-W500-N85B v2 */ ATH79_MACH_SMART_300, /* NC-LINK SMART-300 */ ATH79_MACH_SOM9331, /* OpenEmbed SOM9331 */ ATH79_MACH_SR3200, /* YunCore SR3200 */ diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk index e418282dd..5c37229e7 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/legacy-devices.mk @@ -589,3 +589,9 @@ define LegacyDevice/NBG_460N_550N_550NH DEVICE_PACKAGES := kmod-rtc-pcf8563 endef LEGACY_DEVICES += NBG_460N_550N_550NH + +define LegacyDevice/SGRW500N85BV2 + DEVICE_TITLE := GRENTECH SGR-W500-N85b v2.0 board + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage +endef +LEGACY_DEVICES += SGRW500N85BV2 diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 701116be4..f358b63e7 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -1004,6 +1004,7 @@ $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout))) $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N)) +$(eval $(call SingleProfile,AthLzma,64k,SGRW500N85BV2,sgr-w500-n85b-v2,SGRW500N85BV2,ttyS0,115200,$$(ap147_mtdlayout),RKuImage)) endif # ifeq ($(SUBTARGET),generic) From 0965e86c0d8ea84c14d9f046466db294ad85b115 Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Fri, 17 Nov 2017 03:32:18 +0800 Subject: [PATCH 10/95] add sgr-w500-n85b-v2 --- .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 ++++++++++++++++++ 1 file changed, 279 insertions(+) create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c new file mode 100755 index 000000000..8afdb4723 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c @@ -0,0 +1,279 @@ +/* + * TP-LINK TL-WR941N v7 board support + * + * Copyright (C) 2012 Gabor Juhos + * Copyright (C) 2014 Weijie Gao + * + * 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 +#include +#include +#include +#include +#include +#include + +#include + +#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" + +#define WR941NV7_GPIO_LED_WLAN 12 +#define WR941NV7_GPIO_LED_SYSTEM 19 +#define WR941NV7_GPIO_LED_QSS 15 + +#define WR941NV7_GPIO_BTN_RESET 16 + +#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ +#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) + +#define ATH_MII_MGMT_CMD 0x24 +#define ATH_MGMT_CMD_READ 0x1 + +#define ATH_MII_MGMT_ADDRESS 0x28 +#define ATH_ADDR_SHIFT 8 + +#define ATH_MII_MGMT_CTRL 0x2c +#define ATH_MII_MGMT_STATUS 0x30 + +#define ATH_MII_MGMT_IND 0x34 +#define ATH_MGMT_IND_BUSY (1 << 0) +#define ATH_MGMT_IND_INVALID (1 << 2) + +static const char *wr941nv7_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data wr941nv7_flash_data = { + .part_probes = wr941nv7_part_probes, +}; + +static struct gpio_led wr941nv7_leds_gpio[] __initdata = { + { + .name = "tp-link:green:qss", + .gpio = WR941NV7_GPIO_LED_QSS, + .active_low = 1, + }, + { + .name = "tp-link:green:system", + .gpio = WR941NV7_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "tp-link:green:wlan", + .gpio = WR941NV7_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, + .gpio = WR941NV7_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info wr941nv7_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = NULL, + }, +}; + +static unsigned long __init ath_gmac_reg_rd(unsigned long reg) +{ + void __iomem *base; + unsigned long t; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + t = __raw_readl(base + reg); + + iounmap(base); + + return t; +} + +static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) +{ + void __iomem *base; + unsigned long t = value; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + __raw_writel(t, base + reg); + + iounmap(base); +} + +static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; + volatile int rddata; + unsigned short ii = 0xFFFF; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); +} + +static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; + volatile int rddata; + unsigned short ii = 0xffff; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + + return val; +} + +static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) +{ + unsigned int addr_temp; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = (s27_addr) >> 2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + + reg_address = (((addr_temp << 1) & 0x1e) | 0x1); + data = (s27_write_data >> 16) & 0xffff; + phy_reg_write(phy_address, reg_address, data); + + reg_address = ((addr_temp << 1) & 0x1e); + data = s27_write_data & 0xffff; + phy_reg_write(phy_address, reg_address, data); +} + +static unsigned int __init athrs27_reg_read(unsigned int s27_addr) +{ + unsigned int addr_temp; + unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = s27_addr >>2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + reg_address = ((addr_temp << 1) & 0x1e); + s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); + + reg_address = reg_address | 0x1; + s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); + s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; + + return (s27_rd_csr); +} + +static void __init ar8236_reset(void) +{ + unsigned short i = 60; + + athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); + while (i--) + { + mdelay(100); + if (!(athrs27_reg_read(0x0) & 0x80000000)) + break; + } +} + +static void __init wr941nv7_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); + + ath79_register_m25p80(&wr941nv7_flash_data); + ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), + wr941nv7_leds_gpio); + ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, + ARRAY_SIZE(wr941nv7_gpio_keys), + wr941nv7_gpio_keys); + + ath79_register_wmac(art, mac); + + ar8236_reset(); + + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | + QCA955X_ETH_CFG_MII_GE0_SLAVE); + + mdiobus_register_board_info(wr941nv7_mdio0_info, + ARRAY_SIZE(wr941nv7_mdio0_info)); + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + + /* GMAC0 is connected to an AR8236 switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", + "TP-LINK TL-WR941N v7", + wr941nv7_setup); From a13e5efc6d406879e86c8de28b7a9ea3fa00ec7c Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Fri, 17 Nov 2017 15:41:17 +0800 Subject: [PATCH 11/95] add wr2041n v1 and wr2041n v2 --- target/linux/ar71xx/image/tp-link.mk | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index abfa4ec4a..1e0ef1b21 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -1102,6 +1102,14 @@ define Device/tl-wr941nd-v6-cn TPLINK_HWID := 0x09410006 endef +define Device/tl-wr2041nd-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR2041N/ND v1 + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWR2041 + TPLINK_HWID := 0x20410001 +endef + define Device/tl-wr942n-v1 DEVICE_TITLE := TP-LINK TL-WR942N v1 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport @@ -1118,7 +1126,7 @@ define Device/tl-wr942n-v1 SUPPORTED_DEVICES := tl-wr942n-v1 endef -TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1 +TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1 tl-wr2041nd-v1 define Device/tl-wr941n-v7 $(Device/tplink-8mlzma) @@ -1160,3 +1168,12 @@ define Device/tl-wr882n-v1 TPLINK_HWID := 0x08820001 endef TARGET_DEVICES += tl-wr882n-v1 + +define Device/tl-wr2041nd-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR2041N/ND v2 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR2041 + TPLINK_HWID := 0x20410002 +endef +TARGET_DEVICES += tl-wr2041nd-v2 From f9c0dcfaad64da3aca1dde32f6b477176c375c9d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:09:36 +0800 Subject: [PATCH 12/95] update kernel 4.9 to 4.9.63 --- include/kernel-version.mk | 4 +- target/linux/ar7/config-3.18 | 1 - target/linux/ar7/{config-4.1 => config-4.9} | 44 +- .../linux/ar7/files/drivers/char/ar7_gpio.c | 158 - ...re-the-port-type-s-FCR-value-is-used.patch | 48 + .../ar7/patches-3.18/120-gpio_chrdev.patch | 28 - .../ar7/patches-3.18/500-serial_kludge.patch | 28 - .../ar7/patches-3.18/950-cpmac_titan.patch | 10 +- .../patches-4.1/001-mips-ar7-fix-serial.patch | 23 - .../ar7/patches-4.1/120-gpio_chrdev.patch | 28 - .../ar7/patches-4.1/500-serial_kludge.patch | 28 - ...re-the-port-type-s-FCR-value-is-used.patch | 48 + .../100-fix-highmem-offset.patch | 0 ...R7-allow-NULL-clock-for-clk_get_rate.patch | 0 .../110-flash.patch | 2 +- .../160-vlynq_try_remote_first.patch | 0 .../200-free-mem-below-kernel-offset.patch | 0 .../300-add-ac49x-platform.patch | 6 +- .../310-ac49x-prom-support.patch | 0 .../320-ac49x-mtd-partitions.patch | 4 +- .../920-ar7part.patch | 10 +- .../925-actiontec_leds.patch | 6 +- .../950-cpmac_titan.patch | 14 +- ...50-gpio-nxp-74hc153-gpio-chip-driver.patch | 2 +- .../452-gpio-add-gpio-latch-driver.patch | 2 +- .../950-0031-Add-dwc_otg-driver.patch | 2 +- ...tsq-add-shortcut-in-tcp_tasklet_func.patch | 2 +- ...-a-shortcut-in-tcp_small_queue_check.patch | 2 +- ...ove-tsq_flags-close-to-sk_wmem_alloc.patch | 6 +- ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 85 + ...90-net-generalize-napi_complete_done.patch | 6 +- .../hack-4.9/214-spidev_h_portability.patch | 2 +- .../661-use_fq_codel_by_default.patch | 2 +- .../702-phy_add_aneg_done_function.patch | 2 +- ...710-phy-add-mdio_register_board_info.patch | 2 +- ...ort-limiting-4K-sectors-support-base.patch | 56 + .../616-net_optimize_xfrm_calls.patch | 2 +- .../pending-4.9/630-packet_socket_type.patch | 16 +- .../pending-4.9/701-phy_extension.patch | 2 +- ...detach-callback-to-struct-phy_driver.patch | 2 +- ...-cpu-operating-points-for-cpufreq-su.patch | 6 +- ...018-qcom-ipq4019-turn-on-DMA-for-i2c.patch | 2 +- ...4019-use-correct-clock-for-i2c-bus-0.patch | 2 +- ...0020-qcom-ipq4019-enable-DMA-for-spi.patch | 2 +- .../0022-dts-ipq4019-support-ARMv7-PMU.patch | 2 +- .../0065-arm-override-compiler-flags.patch | 2 +- .../0069-arm-boot-add-dts-files.patch | 7 +- ...pq4019-add-remaining-pin-definitions.patch | 516 - ...-support-to-configure-ipq40xx-GPIO_P.patch | 149 - .../140-qcom-ipq4019-fix-i2c_0-node.patch | 28 - .../141-qcom-ipq4019-add-second-i2c.patch | 46 - ...use-v2-of-the-kpss-bringup-mechanism.patch | 10 +- ...-USB-nodes-to-ipq4019-SoC-device-tre.patch | 2 +- ...-both-IPQ4019-wifi-block-definitions.patch | 170 +- ...9-add-pseudo-random-number-generator.patch | 2 +- ...11-dts-ARM-qcom-ipq4019-add-scm-node.patch | 25 - .../312-firmware-qcom-scm-fuse-access.patch | 98 - .../701-dts-ipq4019-add-mdio-node.patch | 2 +- ...702-dts-ipq4019-add-PHY-switch-nodes.patch | 2 +- ...ts-ipq4019-add-ethernet-essedma-node.patch | 6 +- ...712-net-essedma-disable-default-vlan.patch | 69 - ...19-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch | 71 +- ...ctrl-Updated-various-Pin-definitions.patch | 1328 ++ ...support-to-configure-ipq40xx-GPIO_PU.patch | 236 + ...q4019-add-nand-and-qpic-bam-dma-node.patch | 70 +- ...-2-dts-ipq4019-Fix-pinctrl-node-name.patch | 44 + ...-Move-xo-and-timer-nodes-to-SoC-dtsi.patch | 78 + ...pq4019-ap-dk04-fix-pinctrl-node-name.patch | 11 + ...19-ap-dk04-remove-xo-and-timer-nodes.patch | 27 + ...4019-ap-dk01-add-tcsr-config-to-dtsi.patch | 42 + ...19-ap-dk01-add-network-nodes-to-dtsi.patch | 32 + ...-dk01-remove-spi-chip-node-from-dtsi.patch | 17 + ...864-06-dts-ipq4019-fix-max-cpu-speed.patch | 13 + ...9-ap-dk01.1-c1-add-spi-and-ram-nodes.patch | 115 + ...9-ap-dk01.1-c1-add-compatible-string.patch | 10 + .../0026-NET-multi-phy-support.patch | 2 +- target/linux/layerscape/README | 151 + target/linux/layerscape/armv8_32b/config-4.9 | 98 +- .../armv8_32b/profiles/00-default.mk | 18 - target/linux/layerscape/armv8_64b/config-4.9 | 88 +- .../armv8_64b/profiles/00-default.mk | 18 - .../linux/layerscape/base-files/etc/rc.local | 4 - target/linux/layerscape/image/Makefile | 90 +- target/linux/layerscape/modules.mk | 5 +- .../201-config-support-layerscape.patch | 15 +- .../202-core-linux-support-layerscape.patch | 508 + .../301-arch-support-layerscape.patch | 10 +- .../302-dts-support-layercape.patch | 254 +- ...elect-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch | 23 + .../401-mtd-spi-nor-support-layerscape.patch | 110 +- .../601-net-support-layerscape.patch | 2365 ---- .../701-sdk_dpaa-support-layerscape.patch | 334 +- .../702-pci-support-layerscape.patch | 20 +- .../703-phy-support-layerscape.patch | 2 +- .../704-fsl-mc-layerscape-support.patch | 37 +- ...706-fsl-dpaa-use-4-9-ndo-get-stats64.patch | 112 + .../706-fsl_ppfe-support-layercape.patch | 10548 ++++++++++++++++ .../804-crypto-support-layerscape.patch | 151 +- .../805-dma-support-layerscape.patch | 608 +- .../806-flextimer-support-layerscape.patch | 99 +- .../810-iommu-support-layerscape.patch | 365 +- .../817-usb-support-layerscape.patch | 20 +- ...t-dsa-add-Mediatek-tag-RX-TX-handler.patch | 2 +- .../120-net-mvneta-add-BQL-support.patch | 16 +- .../300-mvneta-tx-queue-workaround.patch | 4 +- ...-a-hook-for-link-up-link-down-events.patch | 2 +- ...move-phy-MMD-accessors-to-phy-core.c.patch | 4 +- ..._-read-write-_mmd-generic-MMD-access.patch | 2 +- ...dd-802.3-clause-45-support-to-phylib.patch | 4 +- ...t-PHY-speed-and-duplex-string-genera.patch | 2 +- ..._lookup_setting-and-guts-of-phy_supp.patch | 2 +- ...5-phylink-add-phylink-infrastructure.patch | 4 +- .../419-net-mvneta-convert-to-phylink.patch | 52 +- ...le-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch | 8 +- ...22-net-mvneta-add-nway_reset-support.patch | 4 +- ...add-flow-control-support-via-phylink.patch | 10 +- ...ble-flow-control-for-PHY-connections.patch | 2 +- ...e-flow-control-for-fixed-connections.patch | 4 +- .../427-phylink-add-EEE-support.patch | 2 +- .../428-net-mvneta-add-EEE-support.patch | 22 +- ...ta-add-module-EEPROM-reading-support.patch | 4 +- .../ramips/base-files/etc/board.d/01_leds | 31 +- .../ramips/base-files/etc/board.d/02_network | 13 +- target/linux/ramips/base-files/etc/diag.sh | 15 +- .../lib/preinit/07_set_preinit_iface_ramips | 9 +- target/linux/ramips/base-files/lib/ramips.sh | 22 +- .../ramips/base-files/lib/upgrade/platform.sh | 7 + target/linux/ramips/dts/ArcherC20.dts | 187 + target/linux/ramips/dts/ArcherC50.dts | 7 +- target/linux/ramips/dts/D240.dts | 17 +- target/linux/ramips/dts/DCH-M225.dts | 18 +- target/linux/ramips/dts/DIR-615-H1.dts | 12 +- target/linux/ramips/dts/DIR-620-D1.dts | 12 +- target/linux/ramips/dts/DUZUN-DM06.dts | 16 +- target/linux/ramips/dts/EW1200.dts | 2 +- target/linux/ramips/dts/HC5X61.dtsi | 7 +- target/linux/ramips/dts/K2P.dts | 2 +- target/linux/ramips/dts/MIR3G.dts | 74 +- target/linux/ramips/dts/MIWIFI-MINI.dts | 7 +- target/linux/ramips/dts/PSG1218A.dts | 10 +- .../ramips/dts/RT5350F-OLINUXINO-EVB.dts | 71 +- target/linux/ramips/dts/RT5350F-OLINUXINO.dts | 71 +- .../linux/ramips/dts/RT5350F-OLINUXINO.dtsi | 94 + target/linux/ramips/dts/TL-WR840NV5.dts | 111 + target/linux/ramips/dts/U25AWF-H1.dts | 106 + target/linux/ramips/dts/U7621-06-256M-16M.dts | 86 + target/linux/ramips/dts/U7621-06.dtsi | 117 + target/linux/ramips/dts/U7628-01-128M-16M.dts | 83 + target/linux/ramips/dts/U7628-01.dtsi | 132 + target/linux/ramips/dts/VOCORE2.dtsi | 2 +- target/linux/ramips/dts/WE1026-5G-16M.dts | 76 + target/linux/ramips/dts/WE1026-5G.dtsi | 124 + target/linux/ramips/dts/WHR-300HP2.dts | 7 +- target/linux/ramips/dts/WIZFI630A.dts | 35 +- target/linux/ramips/dts/WL-351.dts | 6 +- target/linux/ramips/dts/WT3020-8M.dts | 8 + target/linux/ramips/dts/WT3020.dtsi | 9 - target/linux/ramips/dts/Y1.dtsi | 7 +- target/linux/ramips/dts/YOUKU-YK1.dts | 3 +- target/linux/ramips/dts/ZBT-APE522II.dts | 7 +- target/linux/ramips/dts/ZBT-WE3526.dts | 117 + target/linux/ramips/dts/ZBT-WG2626.dts | 2 +- target/linux/ramips/dts/ZBT-WG3526.dtsi | 2 +- target/linux/ramips/dts/ZBT-WR8305RT.dts | 7 +- target/linux/ramips/dts/mt7620a.dtsi | 14 + target/linux/ramips/dts/mt7620n.dtsi | 7 + target/linux/ramips/dts/mt7621.dtsi | 2 +- target/linux/ramips/dts/mt7628an.dtsi | 20 +- target/linux/ramips/dts/rt3050.dtsi | 7 + target/linux/ramips/dts/rt3352.dtsi | 14 + .../drivers/net/ethernet/mtk/mt7530.c | 8 +- .../drivers/net/ethernet/mtk/mtk_eth_soc.c | 4 +- target/linux/ramips/image/mt7620.mk | 70 +- target/linux/ramips/image/mt7621.mk | 21 +- target/linux/ramips/image/mt76x8.mk | 42 +- target/linux/ramips/mt7620/config-4.9 | 3 +- target/linux/ramips/mt7621/config-4.9 | 6 +- .../0034-NET-multi-phy-support.patch | 2 +- .../0039-mtd-add-mt7621-nand-support.patch | 5 +- .../ramips/patches-4.9/0040-nand-hack.patch | 2 +- ...d-spi-nor-add-w25q256-3b-mode-switch.patch | 214 + ...54-mtd-add-chunked-read-io-to-m25p80.patch | 19 +- ..._CMDEFTGT_MEM-according-to-datasheet.patch | 12 - .../0102-MIPS-ralink-Fix-MT7628-pinmux.patch | 33 + ...-ralink-Fix-typo-in-mt7628-pinmux-function | 31 + target/linux/ramips/rt305x/config-4.9 | 1 + target/linux/ramips/rt3883/config-4.9 | 1 + .../patches-4.9/0052-stmmac-form-4-12.patch | 464 +- target/linux/uml/Makefile | 2 +- ...-setjmp-symbol-clashes-with-libpthre.patch | 130 + ...-building-and-running-on-older-hosts.patch | 99 + ...-check-for-PTRACE_GETRESET-SETREGSET.patch | 29 + ...ix-check-for-_xstate-for-older-hosts.patch | 46 + .../uml/patches-4.9/101-mconsole-exec.patch | 211 + .../patches-4.9/102-pseudo-random-mac.patch | 131 + .../patches-4.9/100-fix_cs5535_clockevt.patch | 2 +- 196 files changed, 18501 insertions(+), 5032 deletions(-) rename target/linux/ar7/{config-4.1 => config-4.9} (83%) delete mode 100644 target/linux/ar7/files/drivers/char/ar7_gpio.c create mode 100644 target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch delete mode 100644 target/linux/ar7/patches-3.18/120-gpio_chrdev.patch delete mode 100644 target/linux/ar7/patches-3.18/500-serial_kludge.patch delete mode 100644 target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch delete mode 100644 target/linux/ar7/patches-4.1/120-gpio_chrdev.patch delete mode 100644 target/linux/ar7/patches-4.1/500-serial_kludge.patch create mode 100644 target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch rename target/linux/ar7/{patches-4.1 => patches-4.9}/100-fix-highmem-offset.patch (100%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch (100%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/110-flash.patch (92%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/160-vlynq_try_remote_first.patch (100%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/200-free-mem-below-kernel-offset.patch (100%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/300-add-ac49x-platform.patch (93%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/310-ac49x-prom-support.patch (100%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/320-ac49x-mtd-partitions.patch (91%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/920-ar7part.patch (93%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/925-actiontec_leds.patch (90%) rename target/linux/ar7/{patches-4.1 => patches-4.9}/950-cpmac_titan.patch (80%) create mode 100644 target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch create mode 100644 target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch delete mode 100644 target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch delete mode 100644 target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch delete mode 100644 target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch delete mode 100644 target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch delete mode 100644 target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch delete mode 100644 target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch delete mode 100644 target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch create mode 100644 target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch create mode 100644 target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch create mode 100644 target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch create mode 100644 target/linux/layerscape/README delete mode 100644 target/linux/layerscape/armv8_32b/profiles/00-default.mk delete mode 100644 target/linux/layerscape/armv8_64b/profiles/00-default.mk delete mode 100644 target/linux/layerscape/base-files/etc/rc.local create mode 100644 target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch create mode 100644 target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch delete mode 100644 target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch create mode 100644 target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch create mode 100644 target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch create mode 100644 target/linux/ramips/dts/ArcherC20.dts create mode 100644 target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi create mode 100644 target/linux/ramips/dts/TL-WR840NV5.dts create mode 100644 target/linux/ramips/dts/U25AWF-H1.dts create mode 100644 target/linux/ramips/dts/U7621-06-256M-16M.dts create mode 100644 target/linux/ramips/dts/U7621-06.dtsi create mode 100644 target/linux/ramips/dts/U7628-01-128M-16M.dts create mode 100644 target/linux/ramips/dts/U7628-01.dtsi create mode 100644 target/linux/ramips/dts/WE1026-5G-16M.dts create mode 100644 target/linux/ramips/dts/WE1026-5G.dtsi create mode 100644 target/linux/ramips/dts/ZBT-WE3526.dts create mode 100644 target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch delete mode 100644 target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch create mode 100644 target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch create mode 100644 target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function create mode 100644 target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch create mode 100644 target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch create mode 100644 target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch create mode 100644 target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch create mode 100644 target/linux/uml/patches-4.9/101-mconsole-exec.patch create mode 100644 target/linux/uml/patches-4.9/102-pseudo-random-mac.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index fdf4ac775..8848439c9 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,11 +4,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .93 -LINUX_VERSION-4.9 = .61 +LINUX_VERSION-4.9 = .63 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 -LINUX_KERNEL_HASH-4.9.61 = e0239675728ef0c3697d4b651a1d1a1dd7b2920ed2c5f05a23a23d4aa726d19e +LINUX_KERNEL_HASH-4.9.63 = 21c9386f33fd3453ca67f7478b4c1ba34067645ef6d391871029cbd7f5df2ea3 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/ar7/config-3.18 b/target/linux/ar7/config-3.18 index 21c86db65..a91d45e8d 100644 --- a/target/linux/ar7/config-3.18 +++ b/target/linux/ar7/config-3.18 @@ -1,6 +1,5 @@ CONFIG_ADM6996_PHY=y CONFIG_AR7=y -CONFIG_AR7_GPIO=y CONFIG_AR7_TI=y # CONFIG_AR7_TYPE_AC49X is not set CONFIG_AR7_TYPE_TI=y diff --git a/target/linux/ar7/config-4.1 b/target/linux/ar7/config-4.9 similarity index 83% rename from target/linux/ar7/config-4.1 rename to target/linux/ar7/config-4.9 index 7463d5b75..95a5375ba 100644 --- a/target/linux/ar7/config-4.1 +++ b/target/linux/ar7/config-4.9 @@ -1,22 +1,21 @@ CONFIG_ADM6996_PHY=y CONFIG_AR7=y -CONFIG_AR7_GPIO=y CONFIG_AR7_TI=y # CONFIG_AR7_TYPE_AC49X is not set CONFIG_AR7_TYPE_TI=y CONFIG_AR7_WDT=y CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set # CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y +CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_BOOT_ELF32=y CONFIG_CEVT_R4K=y @@ -37,6 +36,8 @@ CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y CONFIG_EARLY_PRINTK=y @@ -46,12 +47,14 @@ CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_PCI_IOMAP=y CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y +CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -63,7 +66,7 @@ CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CONTEXT_TRACKING=y @@ -71,7 +74,6 @@ CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -79,36 +81,36 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HW_RANDOM=y CONFIG_HZ_PERIODIC=y CONFIG_INITRAMFS_SOURCE="" CONFIG_IP17XX_PHY=y -CONFIG_IRQ_CPU=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_KALLSYMS=y CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y -# CONFIG_LZ4_COMPRESS is not set -# CONFIG_LZ4_DECOMPRESS is not set CONFIG_MDIO_BOARDINFO=y CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_CLOCK_VSYSCALL=y +# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -120,18 +122,21 @@ CONFIG_MVSWITCH_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NO_EXCEPT_FILL=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set -CONFIG_PAGEFLAGS_EXTENDED=y +# CONFIG_OF is not set +CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y -# CONFIG_RCU_EXPEDITE_BOOT is not set # CONFIG_RCU_STALL_COMMON is not set -CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set +# CONFIG_SERIAL_8250_FSL is not set CONFIG_SRCU=y CONFIG_SWAP_IO_SPACE=y CONFIG_SWCONFIG=y +CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_SYS_HAS_CPU_MIPS32_R1=y CONFIG_SYS_HAS_EARLY_PRINTK=y @@ -144,4 +149,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT_UART16550=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_VLYNQ=y # CONFIG_VLYNQ_DEBUG is not set -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/ar7/files/drivers/char/ar7_gpio.c b/target/linux/ar7/files/drivers/char/ar7_gpio.c deleted file mode 100644 index 71310fa75..000000000 --- a/target/linux/ar7/files/drivers/char/ar7_gpio.c +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2007 Nicolas Thill - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define DRVNAME "ar7_gpio" -#define LONGNAME "TI AR7 GPIOs Driver" - -MODULE_AUTHOR("Nicolas Thill "); -MODULE_DESCRIPTION(LONGNAME); -MODULE_LICENSE("GPL"); - -static int ar7_gpio_major; - -static ssize_t ar7_gpio_write(struct file *file, const char __user *buf, - size_t len, loff_t *ppos) -{ - int pin = iminor(file->f_path.dentry->d_inode); - size_t i; - - for (i = 0; i < len; ++i) { - char c; - if (get_user(c, buf + i)) - return -EFAULT; - switch (c) { - case '0': - gpio_set_value(pin, 0); - break; - case '1': - gpio_set_value(pin, 1); - break; - case 'd': - case 'D': - ar7_gpio_disable(pin); - break; - case 'e': - case 'E': - ar7_gpio_enable(pin); - break; - case 'i': - case 'I': - case '<': - gpio_direction_input(pin); - break; - case 'o': - case 'O': - case '>': - gpio_direction_output(pin, 0); - break; - default: - return -EINVAL; - } - } - - return len; -} - -static ssize_t ar7_gpio_read(struct file *file, char __user *buf, - size_t len, loff_t *ppos) -{ - int pin = iminor(file->f_path.dentry->d_inode); - int value; - - value = gpio_get_value(pin); - if (put_user(value ? '1' : '0', buf)) - return -EFAULT; - - return 1; -} - -static int ar7_gpio_open(struct inode *inode, struct file *file) -{ - int m = iminor(inode); - - if (m >= (ar7_is_titan() ? TITAN_GPIO_MAX : AR7_GPIO_MAX)) - return -EINVAL; - - return nonseekable_open(inode, file); -} - -static int ar7_gpio_release(struct inode *inode, struct file *file) -{ - return 0; -} - -static const struct file_operations ar7_gpio_fops = { - .owner = THIS_MODULE, - .write = ar7_gpio_write, - .read = ar7_gpio_read, - .open = ar7_gpio_open, - .release = ar7_gpio_release, - .llseek = no_llseek, -}; - -static struct platform_device *ar7_gpio_device; - -static int __init ar7_gpio_char_init(void) -{ - int rc; - - ar7_gpio_device = platform_device_alloc(DRVNAME, -1); - if (!ar7_gpio_device) - return -ENOMEM; - - rc = platform_device_add(ar7_gpio_device); - if (rc < 0) - goto out_put; - - rc = register_chrdev(ar7_gpio_major, DRVNAME, &ar7_gpio_fops); - if (rc < 0) - goto out_put; - - ar7_gpio_major = rc; - - rc = 0; - - goto out; - -out_put: - platform_device_put(ar7_gpio_device); -out: - return rc; -} - -static void __exit ar7_gpio_char_exit(void) -{ - unregister_chrdev(ar7_gpio_major, DRVNAME); - platform_device_unregister(ar7_gpio_device); -} - -module_init(ar7_gpio_char_init); -module_exit(ar7_gpio_char_exit); diff --git a/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch new file mode 100644 index 000000000..f6a875486 --- /dev/null +++ b/target/linux/ar7/patches-3.18/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch @@ -0,0 +1,48 @@ +From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 29 Oct 2017 15:50:42 +0100 +Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used + +Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt +trigger I/F of FIFO buffers"), the port's default FCR value isn't used +in serial8250_do_set_termios anymore, but copied over once in +serial8250_config_port and then modified as needed. + +Unfortunately, serial8250_config_port will never be called if the port +is shared between kernel and userspace, and the port's flag doesn't have +UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. + +This causes garbled output from userspace: + +[ 5.220000] random: procd urandom read with 49 bits of entropy available +ers + [kee + +Fix this by forcing it to be configured on boot, resulting in the +expected output: + +[ 5.250000] random: procd urandom read with 50 bits of entropy available +Press the [f] key and hit [enter] to enter failsafe mode +Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level + +Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers") +Signed-off-by: Jonas Gorski +--- +I'm not sure if this is just AR7's issue, or if this points to a general +issue for UARTs used as kernel console and login console with the "fixed" +commit. + + arch/mips/ar7/platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -581,7 +581,7 @@ static int __init ar7_register_uarts(voi + uart_port.type = PORT_AR7; + uart_port.uartclk = clk_get_rate(bus_clk) / 2; + uart_port.iotype = UPIO_MEM32; +- uart_port.flags = UPF_FIXED_TYPE; ++ uart_port.flags = UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; + uart_port.regshift = 2; + + uart_port.line = 0; diff --git a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch b/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch deleted file mode 100644 index beb0052ca..000000000 --- a/target/linux/ar7/patches-3.18/120-gpio_chrdev.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -452,6 +452,15 @@ config MWAVE - To compile this driver as a module, choose M here: the - module will be called mwave. - -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random/ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o diff --git a/target/linux/ar7/patches-3.18/500-serial_kludge.patch b/target/linux/ar7/patches-3.18/500-serial_kludge.patch deleted file mode 100644 index fc725309a..000000000 --- a/target/linux/ar7/patches-3.18/500-serial_kludge.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -329,6 +329,13 @@ static const struct serial8250_config ua - .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10, - .flags = UART_CAP_FIFO | UART_CAP_AFE, - }, -+ [PORT_AR7] = { -+ .name = "TI-AR7", -+ .fifo_size = 16, -+ .tx_loadsz = 16, -+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, -+ .flags = UART_CAP_FIFO | UART_CAP_AFE, -+ }, - }; - - /* Uart divisor latch read */ -@@ -3168,7 +3175,11 @@ static void serial8250_console_putchar(s - { - struct uart_8250_port *up = up_to_u8250p(port); - -+#ifdef CONFIG_AR7 -+ wait_for_xmitr(up, BOTH_EMPTY); -+#else - wait_for_xmitr(up, UART_LSR_THRE); -+#endif - serial_port_out(port, UART_TX, ch); - } - diff --git a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch index f1d432cc4..3cabae067 100644 --- a/target/linux/ar7/patches-3.18/950-cpmac_titan.patch +++ b/target/linux/ar7/patches-3.18/950-cpmac_titan.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c -@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d +@@ -1147,6 +1147,8 @@ static int cpmac_probe(struct platform_d goto out; } @@ -9,7 +9,7 @@ dev->irq = platform_get_irq_byname(pdev, "irq"); dev->netdev_ops = &cpmac_netdev_ops; -@@ -1227,7 +1229,7 @@ int cpmac_init(void) +@@ -1228,7 +1230,7 @@ int cpmac_init(void) cpmac_mii->reset = cpmac_mdio_reset; cpmac_mii->irq = mii_irqs; @@ -18,8 +18,8 @@ if (!cpmac_mii->priv) { pr_err("Can't ioremap mdio registers\n"); -@@ -1238,10 +1240,16 @@ int cpmac_init(void) - #warning FIXME: unhardcode gpio&reset bits +@@ -1239,10 +1241,16 @@ int cpmac_init(void) + /* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable(26); ar7_gpio_disable(27); - ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); @@ -37,7 +37,7 @@ cpmac_mii->reset(cpmac_mii); for (i = 0; i < 300; i++) { -@@ -1258,7 +1266,11 @@ int cpmac_init(void) +@@ -1259,7 +1267,11 @@ int cpmac_init(void) mask = 0; } diff --git a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch b/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch deleted file mode 100644 index 1aded9246..000000000 --- a/target/linux/ar7/patches-4.1/001-mips-ar7-fix-serial.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 443ab715a40881d6c9ba11b027ba154bac904cb0 Mon Sep 17 00:00:00 2001 -From: Oswald Buddenhagen -Date: Sat, 10 May 2014 23:19:08 +0200 -Subject: [PATCH] MIPS/AR7: ensure that serial ports are properly set up - -without UPF_FIXED_TYPE, the data from the PORT_AR7 uart_config entry is -never copied, resulting in a dead port. - -Signed-off-by: Oswald Buddenhagen ---- - arch/mips/ar7/platform.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/arch/mips/ar7/platform.c -+++ b/arch/mips/ar7/platform.c -@@ -577,6 +577,7 @@ static int __init ar7_register_uarts(voi - uart_port.type = PORT_AR7; - uart_port.uartclk = clk_get_rate(bus_clk) / 2; - uart_port.iotype = UPIO_MEM32; -+ uart_port.flags = UPF_FIXED_TYPE; - uart_port.regshift = 2; - - uart_port.line = 0; diff --git a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch b/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch deleted file mode 100644 index 1468ca321..000000000 --- a/target/linux/ar7/patches-4.1/120-gpio_chrdev.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/char/Kconfig -+++ b/drivers/char/Kconfig -@@ -461,6 +461,15 @@ config MWAVE - To compile this driver as a module, choose M here: the - module will be called mwave. - -+config AR7_GPIO -+ tristate "TI AR7 GPIO Support" -+ depends on AR7 -+ help -+ Give userspace access to the GPIO pins on the Texas Instruments AR7 -+ processors. -+ -+ If compiled as a module, it will be called ar7_gpio. -+ - config SCx200_GPIO - tristate "NatSemi SCx200 GPIO Support" - depends on SCx200 ---- a/drivers/char/Makefile -+++ b/drivers/char/Makefile -@@ -42,6 +42,7 @@ obj-$(CONFIG_HW_RANDOM) += hw_random/ - obj-$(CONFIG_PPDEV) += ppdev.o - obj-$(CONFIG_NWBUTTON) += nwbutton.o - obj-$(CONFIG_NWFLASH) += nwflash.o -+obj-$(CONFIG_AR7_GPIO) += ar7_gpio.o - obj-$(CONFIG_SCx200_GPIO) += scx200_gpio.o - obj-$(CONFIG_PC8736x_GPIO) += pc8736x_gpio.o - obj-$(CONFIG_NSC_GPIO) += nsc_gpio.o diff --git a/target/linux/ar7/patches-4.1/500-serial_kludge.patch b/target/linux/ar7/patches-4.1/500-serial_kludge.patch deleted file mode 100644 index c7bb29707..000000000 --- a/target/linux/ar7/patches-4.1/500-serial_kludge.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/drivers/tty/serial/8250/8250_core.c -+++ b/drivers/tty/serial/8250/8250_core.c -@@ -347,6 +347,13 @@ configured less than Maximum supported f - .rxtrig_bytes = {1, 4, 8, 14}, - .flags = UART_CAP_FIFO, - }, -+ [PORT_AR7] = { -+ .name = "TI-AR7", -+ .fifo_size = 16, -+ .tx_loadsz = 16, -+ .fcr = UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_00, -+ .flags = UART_CAP_FIFO | UART_CAP_AFE, -+ }, - }; - - /* Uart divisor latch read */ -@@ -3342,7 +3349,11 @@ static void serial8250_console_putchar(s - { - struct uart_8250_port *up = up_to_u8250p(port); - -+#ifdef CONFIG_AR7 -+ wait_for_xmitr(up, BOTH_EMPTY); -+#else - wait_for_xmitr(up, UART_LSR_THRE); -+#endif - serial_port_out(port, UART_TX, ch); - } - diff --git a/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch new file mode 100644 index 000000000..cc1a541a3 --- /dev/null +++ b/target/linux/ar7/patches-4.9/002-MIPS-AR7-ensure-the-port-type-s-FCR-value-is-used.patch @@ -0,0 +1,48 @@ +From ee6c9d41de084b2cefd90e5e0c9f30a35f6d3967 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 29 Oct 2017 15:50:42 +0100 +Subject: [PATCH RFC 3/3] MIPS: AR7: ensure the port type's FCR value is used + +Since commit aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt +trigger I/F of FIFO buffers"), the port's default FCR value isn't used +in serial8250_do_set_termios anymore, but copied over once in +serial8250_config_port and then modified as needed. + +Unfortunately, serial8250_config_port will never be called if the port +is shared between kernel and userspace, and the port's flag doesn't have +UPF_BOOT_AUTOCONF, which would trigger a serial8250_config_port as well. + +This causes garbled output from userspace: + +[ 5.220000] random: procd urandom read with 49 bits of entropy available +ers + [kee + +Fix this by forcing it to be configured on boot, resulting in the +expected output: + +[ 5.250000] random: procd urandom read with 50 bits of entropy available +Press the [f] key and hit [enter] to enter failsafe mode +Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level + +Fixes: aef9a7bd9b67 ("serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers") +Signed-off-by: Jonas Gorski +--- +I'm not sure if this is just AR7's issue, or if this points to a general +issue for UARTs used as kernel console and login console with the "fixed" +commit. + + arch/mips/ar7/platform.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ar7/platform.c ++++ b/arch/mips/ar7/platform.c +@@ -576,7 +576,7 @@ static int __init ar7_register_uarts(voi + uart_port.type = PORT_AR7; + uart_port.uartclk = clk_get_rate(bus_clk) / 2; + uart_port.iotype = UPIO_MEM32; +- uart_port.flags = UPF_FIXED_TYPE; ++ uart_port.flags = UPF_FIXED_TYPE | UPF_BOOT_AUTOCONF; + uart_port.regshift = 2; + + uart_port.line = 0; diff --git a/target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch b/target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch similarity index 100% rename from target/linux/ar7/patches-4.1/100-fix-highmem-offset.patch rename to target/linux/ar7/patches-4.9/100-fix-highmem-offset.patch diff --git a/target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch similarity index 100% rename from target/linux/ar7/patches-4.1/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch rename to target/linux/ar7/patches-4.9/101-MIPS-AR7-allow-NULL-clock-for-clk_get_rate.patch diff --git a/target/linux/ar7/patches-4.1/110-flash.patch b/target/linux/ar7/patches-4.9/110-flash.patch similarity index 92% rename from target/linux/ar7/patches-4.1/110-flash.patch rename to target/linux/ar7/patches-4.9/110-flash.patch index e4aeffd3e..f5713bd03 100644 --- a/target/linux/ar7/patches-4.1/110-flash.patch +++ b/target/linux/ar7/patches-4.9/110-flash.patch @@ -11,7 +11,7 @@ obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -199,7 +199,7 @@ static struct resource physmap_flash_res +@@ -198,7 +198,7 @@ static struct resource physmap_flash_res .name = "mem", .flags = IORESOURCE_MEM, .start = 0x10000000, diff --git a/target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch b/target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch similarity index 100% rename from target/linux/ar7/patches-4.1/160-vlynq_try_remote_first.patch rename to target/linux/ar7/patches-4.9/160-vlynq_try_remote_first.patch diff --git a/target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch b/target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch similarity index 100% rename from target/linux/ar7/patches-4.1/200-free-mem-below-kernel-offset.patch rename to target/linux/ar7/patches-4.9/200-free-mem-below-kernel-offset.patch diff --git a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch similarity index 93% rename from target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch rename to target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch index 2e5528e72..c17ae69aa 100644 --- a/target/linux/ar7/patches-4.1/300-add-ac49x-platform.patch +++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch @@ -13,7 +13,7 @@ +load-$(CONFIG_AR7_AC49X) += 0xffffffff945ca000 --- a/arch/mips/ar7/setup.c +++ b/arch/mips/ar7/setup.c -@@ -69,6 +69,10 @@ const char *get_system_type(void) +@@ -68,6 +68,10 @@ const char *get_system_type(void) return "TI AR7 (TNETV1056)"; case TITAN_CHIP_1060: return "TI AR7 (TNETV1060)"; @@ -37,7 +37,7 @@ #define AR7_IRQ_UART0 15 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -99,7 +99,7 @@ config AR7 +@@ -160,7 +160,7 @@ config AR7 select HAVE_CLK help Support for the Texas Instruments AR7 System-on-a-Chip @@ -46,7 +46,7 @@ config ATH25 bool "Atheros AR231x/AR531x SoC support" -@@ -925,6 +925,7 @@ config MIPS_PARAVIRT +@@ -1002,6 +1002,7 @@ config MIPS_PARAVIRT endchoice source "arch/mips/alchemy/Kconfig" diff --git a/target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch b/target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch similarity index 100% rename from target/linux/ar7/patches-4.1/310-ac49x-prom-support.patch rename to target/linux/ar7/patches-4.9/310-ac49x-prom-support.patch diff --git a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch similarity index 91% rename from target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch rename to target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch index 23304931e..fafa8c77e 100644 --- a/target/linux/ar7/patches-4.1/320-ac49x-mtd-partitions.patch +++ b/target/linux/ar7/patches-4.9/320-ac49x-mtd-partitions.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig -@@ -159,6 +159,11 @@ config MTD_OF_PARTS +@@ -154,6 +154,11 @@ config MTD_OF_PARTS the partition map from the children of the flash node, as described in Documentation/devicetree/bindings/mtd/partition.txt. @@ -24,7 +24,7 @@ obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -202,7 +202,7 @@ static struct resource physmap_flash_res +@@ -201,7 +201,7 @@ static struct resource physmap_flash_res .end = 0x11ffffff, }; diff --git a/target/linux/ar7/patches-4.1/920-ar7part.patch b/target/linux/ar7/patches-4.9/920-ar7part.patch similarity index 93% rename from target/linux/ar7/patches-4.1/920-ar7part.patch rename to target/linux/ar7/patches-4.9/920-ar7part.patch index 9948858d0..e520af208 100644 --- a/target/linux/ar7/patches-4.1/920-ar7part.patch +++ b/target/linux/ar7/patches-4.9/920-ar7part.patch @@ -20,11 +20,11 @@ }; +int create_titan_partitions(struct mtd_info *master, -+ struct mtd_partition **pparts, ++ const struct mtd_partition **pparts, + struct mtd_part_parser_data *data); + static int create_mtd_partitions(struct mtd_info *master, - struct mtd_partition **pparts, + const struct mtd_partition **pparts, struct mtd_part_parser_data *data) { struct ar7_bin_rec header; @@ -107,11 +107,13 @@ root_offset += master->erasesize - 1; --- a/drivers/mtd/titanpart.c +++ b/drivers/mtd/titanpart.c -@@ -149,7 +149,7 @@ static void titan_add_partition(char * e +@@ -148,8 +148,8 @@ static void titan_add_partition(char * e + } int create_titan_partitions(struct mtd_info *master, - struct mtd_partition **pparts, +- struct mtd_partition **pparts, - unsigned long origin) ++ const struct mtd_partition **pparts, + struct mtd_part_parser_data *data) { struct nsp_img_hdr_head hdr; diff --git a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch similarity index 90% rename from target/linux/ar7/patches-4.1/925-actiontec_leds.patch rename to target/linux/ar7/patches-4.9/925-actiontec_leds.patch index 1346a210f..804dbf5c3 100644 --- a/target/linux/ar7/patches-4.1/925-actiontec_leds.patch +++ b/target/linux/ar7/patches-4.9/925-actiontec_leds.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c -@@ -461,31 +461,22 @@ static struct gpio_led fb_fon_leds[] = { +@@ -460,31 +460,22 @@ static struct gpio_led fb_fon_leds[] = { }, }; @@ -35,7 +35,7 @@ .default_trigger = "default-on", }, { -@@ -493,6 +484,44 @@ static struct gpio_led gt701_leds[] = { +@@ -492,6 +483,44 @@ static struct gpio_led gt701_leds[] = { .gpio = 10, .active_low = 1, }, @@ -80,7 +80,7 @@ }; static struct gpio_led_platform_data ar7_led_data; -@@ -536,9 +565,9 @@ static void __init detect_leds(void) +@@ -535,9 +564,9 @@ static void __init detect_leds(void) } else if (strstr(prid, "CYWM") || strstr(prid, "CYWL")) { ar7_led_data.num_leds = ARRAY_SIZE(titan_leds); ar7_led_data.leds = titan_leds; diff --git a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch similarity index 80% rename from target/linux/ar7/patches-4.1/950-cpmac_titan.patch rename to target/linux/ar7/patches-4.9/950-cpmac_titan.patch index f1d432cc4..158b689c9 100644 --- a/target/linux/ar7/patches-4.1/950-cpmac_titan.patch +++ b/target/linux/ar7/patches-4.9/950-cpmac_titan.patch @@ -1,7 +1,7 @@ --- a/drivers/net/ethernet/ti/cpmac.c +++ b/drivers/net/ethernet/ti/cpmac.c -@@ -1146,6 +1146,8 @@ static int cpmac_probe(struct platform_d - goto out; +@@ -1124,6 +1124,8 @@ static int cpmac_probe(struct platform_d + goto fail; } + ar7_device_reset(pdata->reset_bit); @@ -9,17 +9,17 @@ dev->irq = platform_get_irq_byname(pdev, "irq"); dev->netdev_ops = &cpmac_netdev_ops; -@@ -1227,7 +1229,7 @@ int cpmac_init(void) +@@ -1203,7 +1205,7 @@ int cpmac_init(void) + cpmac_mii->write = cpmac_mdio_write; cpmac_mii->reset = cpmac_mdio_reset; - cpmac_mii->irq = mii_irqs; - cpmac_mii->priv = ioremap(AR7_REGS_MDIO, 256); + cpmac_mii->priv = ioremap(ar7_is_titan() ? TITAN_REGS_MDIO : AR7_REGS_MDIO, 256); if (!cpmac_mii->priv) { pr_err("Can't ioremap mdio registers\n"); -@@ -1238,10 +1240,16 @@ int cpmac_init(void) - #warning FIXME: unhardcode gpio&reset bits +@@ -1214,10 +1216,16 @@ int cpmac_init(void) + /* FIXME: unhardcode gpio&reset bits */ ar7_gpio_disable(26); ar7_gpio_disable(27); - ar7_device_reset(AR7_RESET_BIT_CPMAC_LO); @@ -37,7 +37,7 @@ cpmac_mii->reset(cpmac_mii); for (i = 0; i < 300; i++) { -@@ -1258,7 +1266,11 @@ int cpmac_init(void) +@@ -1234,7 +1242,11 @@ int cpmac_init(void) mask = 0; } diff --git a/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch b/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch index 41cf75a55..7ffdc769e 100644 --- a/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch +++ b/target/linux/ar71xx/patches-4.9/450-gpio-nxp-74hc153-gpio-chip-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -1211,4 +1211,12 @@ config GPIO_VIPERBOARD +@@ -1213,4 +1213,12 @@ config GPIO_VIPERBOARD endmenu diff --git a/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch b/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch index 5ddf6de92..a56226f09 100644 --- a/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch +++ b/target/linux/ar71xx/patches-4.9/452-gpio-add-gpio-latch-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig -@@ -1218,4 +1218,9 @@ config GPIO_NXP_74HC153 +@@ -1220,4 +1220,9 @@ config GPIO_NXP_74HC153 Platform driver for NXP 74HC153 Dual 4-input Multiplexer. This provides a GPIO interface supporting input mode only. diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index 1932e3024..c3862fc07 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5042,7 +5042,7 @@ static void port_event(struct usb_hub *h +@@ -5045,7 +5045,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch index d3db74252..249a2ce27 100644 --- a/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch +++ b/target/linux/generic/backport-4.9/024-3-tcp-tsq-add-shortcut-in-tcp_tasklet_func.patch @@ -60,7 +60,7 @@ Signed-off-by: David S. Miller nval = cmpxchg(&tp->tsq_flags, oval, nval); if (nval != oval) continue; -@@ -2182,6 +2182,8 @@ static bool tcp_write_xmit(struct sock * +@@ -2183,6 +2183,8 @@ static bool tcp_write_xmit(struct sock * unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) break; diff --git a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch index 925d2dcea..463b95534 100644 --- a/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch +++ b/target/linux/generic/backport-4.9/024-5-tcp-tsq-add-a-shortcut-in-tcp_small_queue_check.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -2087,6 +2087,15 @@ static bool tcp_small_queue_check(struct +@@ -2088,6 +2088,15 @@ static bool tcp_small_queue_check(struct limit <<= factor; if (atomic_read(&sk->sk_wmem_alloc) > limit) { diff --git a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch index 6604a20fc..8f4c5b2a0 100644 --- a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch +++ b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch @@ -114,7 +114,7 @@ Signed-off-by: David S. Miller if (nval != oval) continue; -@@ -2096,7 +2096,7 @@ static bool tcp_small_queue_check(struct +@@ -2097,7 +2097,7 @@ static bool tcp_small_queue_check(struct skb->prev == sk->sk_write_queue.next) return false; @@ -123,7 +123,7 @@ Signed-off-by: David S. Miller /* It is possible TX completion already happened * before we set TSQ_THROTTLED, so we must * test again the condition. -@@ -2194,8 +2194,8 @@ static bool tcp_write_xmit(struct sock * +@@ -2195,8 +2195,8 @@ static bool tcp_write_xmit(struct sock * unlikely(tso_fragment(sk, skb, limit, mss_now, gfp))) break; @@ -134,7 +134,7 @@ Signed-off-by: David S. Miller if (tcp_small_queue_check(sk, skb, 0)) break; -@@ -3508,8 +3508,6 @@ void tcp_send_ack(struct sock *sk) +@@ -3509,8 +3509,6 @@ void tcp_send_ack(struct sock *sk) /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 diff --git a/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch new file mode 100644 index 000000000..d92ce0747 --- /dev/null +++ b/target/linux/generic/backport-4.9/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -0,0 +1,85 @@ +From: Eric Dumazet +Date: Sat, 11 Nov 2017 15:54:12 -0800 +Subject: [PATCH] tcp: allow drivers to tweak TSQ logic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I had many reports that TSQ logic breaks wifi aggregation. + +Current logic is to allow up to 1 ms of bytes to be queued into qdisc +and drivers queues. + +But Wifi aggregation needs a bigger budget to allow bigger rates to +be discovered by various TCP Congestion Controls algorithms. + +This patch adds an extra socket field, allowing wifi drivers to select +another log scale to derive TCP Small Queue credit from current pacing +rate. + +Initial value is 10, meaning that this patch does not change current +behavior. + +We expect wifi drivers to set this field to smaller values (tests have +been done with values from 6 to 9) + +They would have to use following template : + +if (skb->sk && skb->sk->sk_pacing_shift != MY_PACING_SHIFT) + skb->sk->sk_pacing_shift = MY_PACING_SHIFT; + +Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041 +Signed-off-by: Eric Dumazet +Cc: Johannes Berg +Cc: Toke Høiland-Jørgensen +Cc: Kir Kolyshkin +--- +--- a/include/net/sock.h ++++ b/include/net/sock.h +@@ -260,6 +260,7 @@ struct sock_common { + * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) + * @sk_gso_max_size: Maximum GSO segment size to build + * @sk_gso_max_segs: Maximum number of GSO segments ++ * @sk_pacing_shift: scaling factor for TCP Small Queues + * @sk_lingertime: %SO_LINGER l_linger setting + * @sk_backlog: always used with the per-socket spinlock held + * @sk_callback_lock: used with the callbacks in the end of this struct +@@ -421,6 +422,8 @@ struct sock { + kmemcheck_bitfield_end(flags); + + u16 sk_gso_max_segs; ++#define sk_pacing_shift sk_pacing_shift /* for backport checks */ ++ u8 sk_pacing_shift; + unsigned long sk_lingertime; + struct proto *sk_prot_creator; + rwlock_t sk_callback_lock; +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -2475,6 +2475,7 @@ void sock_init_data(struct socket *sock, + + sk->sk_max_pacing_rate = ~0U; + sk->sk_pacing_rate = ~0U; ++ sk->sk_pacing_shift = 10; + sk->sk_incoming_cpu = -1; + /* + * Before updating sk_refcnt, we must commit prior changes to memory +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -1581,7 +1581,7 @@ u32 tcp_tso_autosize(const struct sock * + { + u32 bytes, segs; + +- bytes = min(sk->sk_pacing_rate >> 10, ++ bytes = min(sk->sk_pacing_rate >> sk->sk_pacing_shift, + sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); + + /* Goal is to send at least one packet per ms, +@@ -2084,7 +2084,7 @@ static bool tcp_small_queue_check(struct + { + unsigned int limit; + +- limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); ++ limit = max(2 * skb->truesize, sk->sk_pacing_rate >> sk->sk_pacing_shift); + limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes); + limit <<= factor; + diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index d7b7b4897..d234651fd 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -399,7 +399,7 @@ Signed-off-by: David S. Miller /* bnx2x_has_rx_work() reads the status block, --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c -@@ -1768,7 +1768,7 @@ static int bnxt_poll_nitroa0(struct napi +@@ -1774,7 +1774,7 @@ static int bnxt_poll_nitroa0(struct napi } if (!bnxt_has_work(bp, cpr) && rx_pkts < budget) { @@ -803,7 +803,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2696,11 +2696,9 @@ static int mvneta_poll(struct napi_struc +@@ -2697,11 +2697,9 @@ static int mvneta_poll(struct napi_struc rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]); } @@ -1346,7 +1346,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c -@@ -2800,7 +2800,7 @@ static int ath10k_pci_napi_poll(struct n +@@ -2804,7 +2804,7 @@ static int ath10k_pci_napi_poll(struct n done = ath10k_htt_txrx_compl_task(ar, budget); if (done < budget) { diff --git a/target/linux/generic/hack-4.9/214-spidev_h_portability.patch b/target/linux/generic/hack-4.9/214-spidev_h_portability.patch index 23914d633..ad4706c82 100644 --- a/target/linux/generic/hack-4.9/214-spidev_h_portability.patch +++ b/target/linux/generic/hack-4.9/214-spidev_h_portability.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/include/uapi/linux/spi/spidev.h +++ b/include/uapi/linux/spi/spidev.h -@@ -111,7 +111,7 @@ struct spi_ioc_transfer { +@@ -112,7 +112,7 @@ struct spi_ioc_transfer { /* not all platforms use or _IOC_TYPECHECK() ... */ #define SPI_MSGSIZE(N) \ diff --git a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch index 4e7b4ad1d..18a98b3aa 100644 --- a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau device, it has to decide which ones to send first, which ones to --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c -@@ -1976,7 +1976,7 @@ static int __init pktsched_init(void) +@@ -1978,7 +1978,7 @@ static int __init pktsched_init(void) return err; } diff --git a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch index cf798bc20..8a2b51a4f 100644 --- a/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/hack-4.9/702-phy_add_aneg_done_function.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -499,6 +499,12 @@ struct phy_driver { +@@ -495,6 +495,12 @@ struct phy_driver { /* Determines the negotiated speed and duplex */ int (*read_status)(struct phy_device *phydev); diff --git a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch index 838c73789..55607bc6e 100644 --- a/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/hack-4.9/710-phy-add-mdio_register_board_info.patch @@ -50,7 +50,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -863,6 +863,23 @@ void mdio_bus_exit(void); +@@ -859,6 +859,23 @@ void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch new file mode 100644 index 000000000..1c5b9c3b2 --- /dev/null +++ b/target/linux/generic/pending-4.9/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -0,0 +1,56 @@ +From: Felix Fietkau +Date: Sat, 4 Nov 2017 07:40:23 +0100 +Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on + flash size + +Some devices need 4K sectors to be able to deal with small flash chips. +For instance, w25x05 is 64 KiB in size, and without 4K sectors, the +entire chip is just one erase block. +On bigger flash chip sizes, using 4K sectors can significantly slow down +many operations, including using a writable filesystem. There are several +platforms where it makes sense to use a single kernel on both kinds of +devices. + +To support this properly, allow configuring an upper flash chip size +limit for 4K sectors support. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/mtd/spi-nor/Kconfig ++++ b/drivers/mtd/spi-nor/Kconfig +@@ -29,6 +29,17 @@ config MTD_SPI_NOR_USE_4K_SECTORS + Please note that some tools/drivers/filesystems may not work with + 4096 B erase size (e.g. UBIFS requires 15 KiB as a minimum). + ++config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT ++ int "Maximum flash chip size to use 4K sectors on (in KiB)" ++ depends on MTD_SPI_NOR_USE_4K_SECTORS ++ default "4096" ++ help ++ There are many flash chips that support 4K sectors, but are so large ++ that using them significantly slows down writing large amounts of ++ data or using a writable filesystem. ++ Any flash chip larger than the size specified in this option will ++ not use 4K sectors. ++ + config SPI_ATMEL_QUADSPI + tristate "Atmel Quad SPI Controller" + depends on ARCH_AT91 || (ARM && COMPILE_TEST) +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1640,10 +1640,12 @@ int spi_nor_scan(struct spi_nor *nor, co + + #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS + /* prefer "small sector" erase if possible */ +- if (info->flags & SECT_4K) { ++ if ((info->flags & SECT_4K) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K; + mtd->erasesize = 4096; +- } else if (info->flags & SECT_4K_PMC) { ++ } else if ((info->flags & SECT_4K_PMC) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K_PMC; + mtd->erasesize = 4096; + } else diff --git a/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch b/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch index e627fa0ca..a147f5f94 100644 --- a/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch +++ b/target/linux/generic/pending-4.9/616-net_optimize_xfrm_calls.patch @@ -8,7 +8,7 @@ Signed-off-by: Felix Fietkau --- a/net/netfilter/nf_nat_core.c +++ b/net/netfilter/nf_nat_core.c -@@ -95,6 +95,9 @@ int nf_xfrm_me_harder(struct net *net, s +@@ -93,6 +93,9 @@ int nf_xfrm_me_harder(struct net *net, s struct dst_entry *dst; int err; diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index dea2e2ce7..e943a47a8 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1778,6 +1778,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1780,6 +1780,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1785,6 +1786,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1787,6 +1788,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1797,7 +1799,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1799,7 +1801,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2035,12 +2037,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2037,12 +2039,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2166,12 +2168,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2168,12 +2170,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3250,6 +3252,7 @@ static int packet_create(struct net *net +@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3836,6 +3839,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3888,6 +3901,13 @@ static int packet_getsockopt(struct sock +@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.9/701-phy_extension.patch b/target/linux/generic/pending-4.9/701-phy_extension.patch index 2b9e42405..b480b1d78 100644 --- a/target/linux/generic/pending-4.9/701-phy_extension.patch +++ b/target/linux/generic/pending-4.9/701-phy_extension.patch @@ -62,7 +62,7 @@ Signed-off-by: John Crispin * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -820,6 +820,7 @@ int phy_ethtool_ksettings_get(struct phy +@@ -816,6 +816,7 @@ int phy_ethtool_ksettings_get(struct phy struct ethtool_link_ksettings *cmd); int phy_ethtool_ksettings_set(struct phy_device *phydev, const struct ethtool_link_ksettings *cmd); diff --git a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch index c64c3bea3..7cc39dcb8 100644 --- a/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.9/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -23,7 +23,7 @@ Signed-off-by: Gabor Juhos phy_suspend(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -511,6 +511,12 @@ struct phy_driver { +@@ -507,6 +507,12 @@ struct phy_driver { */ int (*did_interrupt)(struct phy_device *phydev); diff --git a/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch b/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch index 5aeb93cdc..7cbd6a455 100644 --- a/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch +++ b/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch @@ -45,7 +45,7 @@ Signed-off-by: Matthew McClintock }; cpu@3 { -@@ -81,6 +76,33 @@ +@@ -81,6 +76,29 @@ reg = <0x3>; clocks = <&gcc GCC_APPS_CLK_SRC>; clock-frequency = <0>; @@ -71,10 +71,6 @@ Signed-off-by: Matthew McClintock + }; + opp@666000000 { + opp-hz = /bits/ 64 <666000000>; -+ clock-latency-ns = <256000>; -+ }; -+ opp@717000000 { -+ opp-hz = /bits/ 64 <717000000>; + clock-latency-ns = <256000>; }; }; diff --git a/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch b/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch index a580610b2..42bb4a6e3 100644 --- a/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch +++ b/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -183,6 +183,8 @@ +@@ -179,6 +179,8 @@ clock-names = "iface", "core"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch b/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch index 64878e2c0..54ee571cb 100644 --- a/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch +++ b/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch @@ -17,7 +17,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -179,7 +179,7 @@ +@@ -175,7 +175,7 @@ reg = <0x78b7000 0x6000>; interrupts = ; clocks = <&gcc GCC_BLSP1_AHB_CLK>, diff --git a/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch b/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch index b5a533502..c1fa5c729 100644 --- a/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch +++ b/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -171,6 +171,8 @@ +@@ -167,6 +167,8 @@ clock-names = "core", "iface"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch b/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch index 2acfdcf29..c427d66ef 100644 --- a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch +++ b/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch @@ -13,7 +13,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -112,6 +112,12 @@ +@@ -108,6 +108,12 @@ IRQ_TYPE_LEVEL_HIGH)>; }; diff --git a/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch b/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch index dd40f1371..e5af7ffa2 100644 --- a/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch +++ b/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin # testing for a specific architecture or later rather impossible. arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m -arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) -+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 -mtune=cortex-a15 ++arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) # Only override the compiler option if ARMv6. The ARMv6K extensions are # always available in ARMv7 diff --git a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch index ea9e67278..bab280878 100644 --- a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch @@ -5,19 +5,18 @@ Subject: [PATCH 69/69] arm: boot: add dts files Signed-off-by: John Crispin --- - arch/arm/boot/dts/Makefile | 9 ++++++++ - 1 file changed, 9 insertions(+) + arch/arm/boot/dts/Makefile | 8 ++++++++ + 1 file changed, 8 insertions(+) --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -618,7 +618,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -618,7 +618,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8084-mtp.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \ + qcom-ipq4019-fritz4040.dtb \ + qcom-ipq4019-nbg6617.dtb \ + qcom-ipq4019-rt-ac58u.dtb \ -+ qcom-ipq4019-rt-acrh17.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-d7800.dtb \ diff --git a/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch b/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch deleted file mode 100644 index f3ffc2e2c..000000000 --- a/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch +++ /dev/null @@ -1,516 +0,0 @@ -From 941e3869bdeddb2bebcc52ebfd57efe014887bc6 Mon Sep 17 00:00:00 2001 -Message-Id: <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> -In-Reply-To: -References: -From: Ram Chandra Jangir -Date: Wed, 10 May 2017 12:51:51 +0200 -Subject: [PATCH v3 2/3] pinctrl: qcom: ipq4019: add most remaining pin - definitions -To: linux-gpio@vger.kernel.org, - devicetree@vger.kernel.org -Cc: Linus Walleij , - Rob Herring , - Mark Rutland - -This patch adds multiple pinctrl functions and mappings -for SDIO, NAND, I2S, WIFI, PCIE, LEDs, etc... that have -been missing from the current minimal version. - -This patch has been updated from the original version -that was posted by Ram Chandra Jangir on the LEDE-DEV ML: -. A short -summary of the changes are documented in the device-tree -patch of this series: -"dt-bindings: pinctrl: add most other IPQ4019 pin functions and groups" - -Cc: Bjorn Andersson -Cc: John Crispin -Signed-off-by: Ram Chandra Jangir -Signed-off-by: Christian Lamparter ---- - drivers/pinctrl/qcom/pinctrl-ipq4019.c | 431 ++++++++++++++++++++++++++------- - 1 file changed, 346 insertions(+), 85 deletions(-) - -diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -index 743d1f458205..9e7f23d29cda 100644 ---- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -@@ -277,12 +277,49 @@ DECLARE_QCA_GPIO_PINS(99); - - enum ipq4019_functions { - qca_mux_gpio, -- qca_mux_blsp_uart1, -+ qca_mux_aud_pin, -+ qca_mux_audio_pwm, - qca_mux_blsp_i2c0, - qca_mux_blsp_i2c1, -- qca_mux_blsp_uart0, -- qca_mux_blsp_spi1, - qca_mux_blsp_spi0, -+ qca_mux_blsp_spi1, -+ qca_mux_blsp_uart0, -+ qca_mux_blsp_uart1, -+ qca_mux_chip_rst, -+ qca_mux_i2s_rx, -+ qca_mux_i2s_spdif_in, -+ qca_mux_i2s_spdif_out, -+ qca_mux_i2s_td, -+ qca_mux_i2s_tx, -+ qca_mux_jtag, -+ qca_mux_led0, -+ qca_mux_led1, -+ qca_mux_led2, -+ qca_mux_led3, -+ qca_mux_led4, -+ qca_mux_led5, -+ qca_mux_led6, -+ qca_mux_led7, -+ qca_mux_led8, -+ qca_mux_led9, -+ qca_mux_led10, -+ qca_mux_led11, -+ qca_mux_mdc, -+ qca_mux_mdio, -+ qca_mux_pcie, -+ qca_mux_pmu, -+ qca_mux_prng_rosc, -+ qca_mux_qpic, -+ qca_mux_rgmii, -+ qca_mux_rmii, -+ qca_mux_sdio, -+ qca_mux_smart0, -+ qca_mux_smart1, -+ qca_mux_smart2, -+ qca_mux_smart3, -+ qca_mux_tm, -+ qca_mux_wifi0, -+ qca_mux_wifi1, - qca_mux_NA, - }; - -@@ -303,108 +340,331 @@ static const char * const gpio_groups[] = { - "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", - "gpio99", - }; -- --static const char * const blsp_uart1_groups[] = { -- "gpio8", "gpio9", "gpio10", "gpio11", -+static const char * const aud_pin_groups[] = { -+ "gpio48", "gpio49", "gpio50", "gpio51", -+}; -+static const char * const audio_pwm_groups[] = { -+ "gpio30", "gpio31", "gpio32", "gpio33", "gpio64", "gpio65", "gpio66", -+ "gpio67", - }; - static const char * const blsp_i2c0_groups[] = { - "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59", - }; --static const char * const blsp_spi0_groups[] = { -- "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", -- "gpio54", "gpio55", "gpio56", "gpio57", --}; - static const char * const blsp_i2c1_groups[] = { - "gpio12", "gpio13", "gpio34", "gpio35", - }; --static const char * const blsp_uart0_groups[] = { -- "gpio16", "gpio17", "gpio60", "gpio61", -+static const char * const blsp_spi0_groups[] = { -+ "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", "gpio54", "gpio55", -+ "gpio56", "gpio57", - }; - static const char * const blsp_spi1_groups[] = { - "gpio44", "gpio45", "gpio46", "gpio47", - }; -+static const char * const blsp_uart0_groups[] = { -+ "gpio16", "gpio17", "gpio60", "gpio61", -+}; -+static const char * const blsp_uart1_groups[] = { -+ "gpio8", "gpio9", "gpio10", "gpio11", -+}; -+static const char * const chip_rst_groups[] = { -+ "gpio62", -+}; -+static const char * const i2s_rx_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio20", "gpio21", "gpio22", "gpio23", -+ "gpio58", "gpio60", "gpio61", "gpio63", -+}; -+static const char * const i2s_spdif_in_groups[] = { -+ "gpio34", "gpio59", "gpio63", -+}; -+static const char * const i2s_spdif_out_groups[] = { -+ "gpio35", "gpio62", "gpio63", -+}; -+static const char * const i2s_td_groups[] = { -+ "gpio27", "gpio28", "gpio29", "gpio54", "gpio55", "gpio56", "gpio63", -+}; -+static const char * const i2s_tx_groups[] = { -+ "gpio24", "gpio25", "gpio26", "gpio52", "gpio53", "gpio57", "gpio60", -+ "gpio61", -+}; -+static const char * const jtag_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", -+}; -+static const char * const led0_groups[] = { -+ "gpio16", "gpio36", "gpio60", -+}; -+static const char * const led1_groups[] = { -+ "gpio17", "gpio37", "gpio61", -+}; -+static const char * const led2_groups[] = { -+ "gpio36", "gpio38", "gpio58", -+}; -+static const char * const led3_groups[] = { -+ "gpio39", -+}; -+static const char * const led4_groups[] = { -+ "gpio40", -+}; -+static const char * const led5_groups[] = { -+ "gpio44", -+}; -+static const char * const led6_groups[] = { -+ "gpio45", -+}; -+static const char * const led7_groups[] = { -+ "gpio46", -+}; -+static const char * const led8_groups[] = { -+ "gpio47", -+}; -+static const char * const led9_groups[] = { -+ "gpio48", -+}; -+static const char * const led10_groups[] = { -+ "gpio49", -+}; -+static const char * const led11_groups[] = { -+ "gpio50", -+}; -+static const char * const mdc_groups[] = { -+ "gpio7", "gpio52", -+}; -+static const char * const mdio_groups[] = { -+ "gpio6", "gpio53", -+}; -+static const char * const pcie_groups[] = { -+ "gpio39", "gpio52", -+}; -+static const char * const pmu_groups[] = { -+ "gpio54", "gpio55", -+}; -+static const char * const prng_rosc_groups[] = { -+ "gpio53", -+}; -+static const char * const qpic_groups[] = { -+ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", -+ "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65", -+ "gpio66", "gpio67", "gpio68", "gpio69", -+}; -+static const char * const rgmii_groups[] = { -+ "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", -+ "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", -+}; -+static const char * const rmii_groups[] = { -+ "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", -+ "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", -+ "gpio50", "gpio51", -+}; -+static const char * const sdio_groups[] = { -+ "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", -+ "gpio30", "gpio31", "gpio32", -+}; -+static const char * const smart0_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio5", "gpio44", "gpio45", "gpio46", -+ "gpio47", -+}; -+static const char * const smart1_groups[] = { -+ "gpio8", "gpio9", "gpio16", "gpio17", "gpio58", "gpio59", "gpio60", -+ "gpio61", -+}; -+static const char * const smart2_groups[] = { -+ "gpio40", "gpio41", "gpio48", "gpio49", -+}; -+static const char * const smart3_groups[] = { -+ "gpio58", "gpio59", "gpio60", "gpio61", -+}; -+static const char * const tm_groups[] = { -+ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", -+ "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", -+}; -+static const char * const wifi0_groups[] = { -+ "gpio37", "gpio40", "gpio41", "gpio42", "gpio50", "gpio51", "gpio52", -+ "gpio53", "gpio56", "gpio57", "gpio58", "gpio98", -+}; -+static const char * const wifi1_groups[] = { -+ "gpio37", "gpio40", "gpio41", "gpio43", "gpio50", "gpio51", "gpio52", -+ "gpio53", "gpio56", "gpio57", "gpio58", "gpio98", -+}; - - static const struct msm_function ipq4019_functions[] = { -- FUNCTION(gpio), -- FUNCTION(blsp_uart1), -+ FUNCTION(aud_pin), -+ FUNCTION(audio_pwm), - FUNCTION(blsp_i2c0), - FUNCTION(blsp_i2c1), -- FUNCTION(blsp_uart0), -- FUNCTION(blsp_spi1), - FUNCTION(blsp_spi0), -+ FUNCTION(blsp_spi1), -+ FUNCTION(blsp_uart0), -+ FUNCTION(blsp_uart1), -+ FUNCTION(chip_rst), -+ FUNCTION(gpio), -+ FUNCTION(i2s_rx), -+ FUNCTION(i2s_spdif_in), -+ FUNCTION(i2s_spdif_out), -+ FUNCTION(i2s_td), -+ FUNCTION(i2s_tx), -+ FUNCTION(jtag), -+ FUNCTION(led0), -+ FUNCTION(led1), -+ FUNCTION(led2), -+ FUNCTION(led3), -+ FUNCTION(led4), -+ FUNCTION(led5), -+ FUNCTION(led6), -+ FUNCTION(led7), -+ FUNCTION(led8), -+ FUNCTION(led9), -+ FUNCTION(led10), -+ FUNCTION(led11), -+ FUNCTION(mdc), -+ FUNCTION(mdio), -+ FUNCTION(pcie), -+ FUNCTION(pmu), -+ FUNCTION(prng_rosc), -+ FUNCTION(qpic), -+ FUNCTION(rgmii), -+ FUNCTION(rmii), -+ FUNCTION(sdio), -+ FUNCTION(smart0), -+ FUNCTION(smart1), -+ FUNCTION(smart2), -+ FUNCTION(smart3), -+ FUNCTION(tm), -+ FUNCTION(wifi0), -+ FUNCTION(wifi1), - }; - - static const struct msm_pingroup ipq4019_groups[] = { -- PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(8, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(9, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(16, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(17, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(0, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(1, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(2, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(3, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(4, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(5, jtag, smart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(6, mdio, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(7, mdc, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(8, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(9, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(16, blsp_uart0, led0, smart1, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(17, blsp_uart0, led1, smart1, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), - PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(20, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(21, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(22, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(23, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(24, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(25, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(27, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(28, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(29, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(34, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(35, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(44, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(45, NA, blsp_spi1, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(46, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(47, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(54, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(55, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(56, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(57, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(58, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(59, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(60, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(61, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(20, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(21, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(22, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(23, sdio, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(24, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(25, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(26, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(27, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(28, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(29, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(30, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(31, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(32, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(33, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(34, blsp_i2c1, i2s_spdif_in, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(35, blsp_i2c1, i2s_spdif_out, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(36, rmii, led2, led0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(37, rmii, wifi0, wifi1, led1, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(38, rmii, led2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(39, rmii, pcie, led3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(40, rmii, wifi0, wifi1, smart2, led4, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(41, rmii, wifi0, wifi1, smart2, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(42, rmii, wifi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(43, rmii, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(44, rmii, blsp_spi1, smart0, led5, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(45, rmii, blsp_spi1, blsp_spi0, smart0, led6, NA, NA, NA, NA, -+ NA, NA, NA, NA, NA), -+ PINGROUP(46, rmii, blsp_spi1, smart0, led7, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(47, rmii, blsp_spi1, smart0, led8, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(48, rmii, aud_pin, smart2, led9, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(49, rmii, aud_pin, smart2, led10, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(50, rmii, aud_pin, wifi0, wifi1, led11, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(51, rmii, aud_pin, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(52, qpic, mdc, pcie, i2s_tx, NA, NA, NA, tm, wifi0, wifi1, NA, -+ NA, NA, NA), -+ PINGROUP(53, qpic, mdio, i2s_tx, prng_rosc, NA, tm, wifi0, wifi1, NA, -+ NA, NA, NA, NA, NA), -+ PINGROUP(54, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA, -+ NA, NA, NA), -+ PINGROUP(55, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA, -+ NA, NA, NA), -+ PINGROUP(56, qpic, blsp_spi0, i2s_td, NA, NA, tm, wifi0, wifi1, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(57, qpic, blsp_spi0, i2s_tx, NA, NA, tm, wifi0, wifi1, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(58, qpic, led2, blsp_i2c0, smart3, smart1, i2s_rx, NA, NA, tm, -+ wifi0, wifi1, NA, NA, NA), -+ PINGROUP(59, qpic, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA, NA, NA, -+ NA, NA, tm, NA, NA, NA), -+ PINGROUP(60, qpic, blsp_uart0, smart1, smart3, led0, i2s_tx, i2s_rx, -+ NA, NA, NA, NA, NA, tm, NA), -+ PINGROUP(61, qpic, blsp_uart0, smart1, smart3, led1, i2s_tx, i2s_rx, -+ NA, NA, NA, NA, NA, tm, NA), -+ PINGROUP(62, qpic, chip_rst, NA, NA, i2s_spdif_out, NA, NA, NA, NA, NA, -+ tm, NA, NA, NA), -+ PINGROUP(63, qpic, NA, NA, NA, i2s_td, i2s_rx, i2s_spdif_out, -+ i2s_spdif_in, NA, NA, NA, NA, tm, NA), -+ PINGROUP(64, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(65, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(66, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(67, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(68, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(69, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -@@ -433,7 +693,8 @@ static const struct msm_pingroup ipq4019_groups[] = { - PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(98, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), - PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - }; - --- -2.13.2 - diff --git a/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch b/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch deleted file mode 100644 index f05ea750b..000000000 --- a/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 895bbe5061fe2a6825503f57263a4eff9bb78a3c Mon Sep 17 00:00:00 2001 -Message-Id: <895bbe5061fe2a6825503f57263a4eff9bb78a3c.1500038134.git.chunkeey@googlemail.com> -In-Reply-To: <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> -References: - <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> -From: Ram Chandra Jangir -Date: Sun, 4 Jun 2017 21:38:21 +0200 -Subject: [PATCH v3 3/3] pinctrl: msm: add support to configure ipq40xx - GPIO_PULL bits -To: linux-gpio@vger.kernel.org, - devicetree@vger.kernel.org -Cc: Linus Walleij , - Rob Herring , - Mark Rutland - -GPIO_PULL bits configurations in TLMM_GPIO_CFG register -differs for IPQ40xx from rest of the other qcom SoCs. -As it does not support the keeper state and therefore can't -support bias-bus-hold property. - -This patch adds a pull_no_keeper setting which configures the -msm_gpio_pull bits for ipq40xx. This is required to fix the -proper configurations of gpio-pull bits for nand pins mux. - -IPQ40xx SoC: -2'b10: Internal pull up enable. -2'b11: Unsupport - -For other SoC's: -2'b10: Keeper -2'b11: Pull-Up - -Note: Due to pull_no_keeper length, all kerneldoc entries -in the msm_pinctrl_soc_data struct had to be realigned. - -Reviewed-by: Bjorn Andersson -Signed-off-by: Ram Chandra Jangir -Signed-off-by: Christian Lamparter ---- - drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++------ - drivers/pinctrl/qcom/pinctrl-msm.h | 16 +++++++++------- - 3 files changed, 29 insertions(+), 13 deletions(-) - -diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -index 9e7f23d29cda..1979b14b6fc3 100644 ---- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -@@ -706,6 +706,7 @@ static const struct msm_pinctrl_soc_data ipq4019_pinctrl = { - .groups = ipq4019_groups, - .ngroups = ARRAY_SIZE(ipq4019_groups), - .ngpios = 100, -+ .pull_no_keeper = true, - }; - - static int ipq4019_pinctrl_probe(struct platform_device *pdev) -diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c -index 273badd92561..e5e27d79f5ef 100644 ---- a/drivers/pinctrl/qcom/pinctrl-msm.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm.c -@@ -202,10 +202,11 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, - return 0; - } - --#define MSM_NO_PULL 0 --#define MSM_PULL_DOWN 1 --#define MSM_KEEPER 2 --#define MSM_PULL_UP 3 -+#define MSM_NO_PULL 0 -+#define MSM_PULL_DOWN 1 -+#define MSM_KEEPER 2 -+#define MSM_PULL_UP_NO_KEEPER 2 -+#define MSM_PULL_UP 3 - - static unsigned msm_regval_to_drive(u32 val) - { -@@ -243,10 +244,16 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, - arg = arg == MSM_PULL_DOWN; - break; - case PIN_CONFIG_BIAS_BUS_HOLD: -+ if (pctrl->soc->pull_no_keeper) -+ return -ENOTSUPP; -+ - arg = arg == MSM_KEEPER; - break; - case PIN_CONFIG_BIAS_PULL_UP: -- arg = arg == MSM_PULL_UP; -+ if (pctrl->soc->pull_no_keeper) -+ arg = arg == MSM_PULL_UP_NO_KEEPER; -+ else -+ arg = arg == MSM_PULL_UP; - break; - case PIN_CONFIG_DRIVE_STRENGTH: - arg = msm_regval_to_drive(arg); -@@ -309,10 +316,16 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, - arg = MSM_PULL_DOWN; - break; - case PIN_CONFIG_BIAS_BUS_HOLD: -+ if (pctrl->soc->pull_no_keeper) -+ return -ENOTSUPP; -+ - arg = MSM_KEEPER; - break; - case PIN_CONFIG_BIAS_PULL_UP: -- arg = MSM_PULL_UP; -+ if (pctrl->soc->pull_no_keeper) -+ arg = MSM_PULL_UP_NO_KEEPER; -+ else -+ arg = MSM_PULL_UP; - break; - case PIN_CONFIG_DRIVE_STRENGTH: - /* Check for invalid values */ -diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinctrl-msm.h -index 54fdd04ce9d5..9b9feea540ff 100644 ---- a/drivers/pinctrl/qcom/pinctrl-msm.h -+++ b/drivers/pinctrl/qcom/pinctrl-msm.h -@@ -99,13 +99,14 @@ struct msm_pingroup { - - /** - * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration -- * @pins: An array describing all pins the pin controller affects. -- * @npins: The number of entries in @pins. -- * @functions: An array describing all mux functions the SoC supports. -- * @nfunctions: The number of entries in @functions. -- * @groups: An array describing all pin groups the pin SoC supports. -- * @ngroups: The numbmer of entries in @groups. -- * @ngpio: The number of pingroups the driver should expose as GPIOs. -+ * @pins: An array describing all pins the pin controller affects. -+ * @npins: The number of entries in @pins. -+ * @functions: An array describing all mux functions the SoC supports. -+ * @nfunctions: The number of entries in @functions. -+ * @groups: An array describing all pin groups the pin SoC supports. -+ * @ngroups: The numbmer of entries in @groups. -+ * @ngpio: The number of pingroups the driver should expose as GPIOs. -+ * @pull_no_keeper: The SoC does not support keeper bias. - */ - struct msm_pinctrl_soc_data { - const struct pinctrl_pin_desc *pins; -@@ -115,6 +116,7 @@ struct msm_pinctrl_soc_data { - const struct msm_pingroup *groups; - unsigned ngroups; - unsigned ngpios; -+ bool pull_no_keeper; - }; - - int msm_pinctrl_probe(struct platform_device *pdev, --- -2.13.2 - diff --git a/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch b/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch deleted file mode 100644 index 041d8961d..000000000 --- a/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 830a63791185f4daaecb8d1102c4ee3c9210c03c Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Mon, 1 May 2017 13:42:41 +0200 -Subject: [PATCH 1/2] qcom: ipq4019: fix i2c_0 node - -This patch fixes two typos in the i2c_0 node for the ipq4019. -The register size is just 0x600. The core clock is -GCC_BLSP1_QUP1_I2C_APPS_CLK. GCC_BLSP1_QUP2_I2C_APPS_CLK is -used by the second i2c. - -Fixes: e76b4284b520ba3 ("qcom: ipq4019: add i2c node to ipq4019 SoC and DK01 device tree") - -Signed-off-by: Christian Lamparter ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -184,7 +184,7 @@ - - i2c_0: i2c@78b7000 { - compatible = "qcom,i2c-qup-v2.2.1"; -- reg = <0x78b7000 0x6000>; -+ reg = <0x78b7000 0x600>; - interrupts = ; - clocks = <&gcc GCC_BLSP1_AHB_CLK>, - <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>; diff --git a/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch b/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch deleted file mode 100644 index 5f98cc909..000000000 --- a/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5110346bcc17b037edd5b0193f31ad046e6242db Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Mon, 1 May 2017 13:53:07 +0200 -Subject: [PATCH 2/2] qcom: ipq4019: add second i2c - -This patch adds the second i2c block to the IPQ4019 platform. -The second i2c has been successfully tested on the -Cisco Meraki MR33. - -Cc: Chris Blake -Cc: Matthew McClintock -Signed-off-by: Christian Lamparter ---- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 14 ++++++++++++++ - 1 file changed, 14 insertions(+) - ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -26,6 +26,7 @@ - aliases { - spi0 = &spi_0; - i2c0 = &i2c_0; -+ i2c1 = &i2c_1; - }; - - cpus { -@@ -196,6 +197,19 @@ - status = "disabled"; - }; - -+ i2c_1: i2c@78b8000 { -+ compatible = "qcom,i2c-qup-v2.2.1"; -+ reg = <0x78b8000 0x600>; -+ interrupts = ; -+ clocks = <&gcc GCC_BLSP1_AHB_CLK>, -+ <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>; -+ clock-names = "iface", "core"; -+ dmas = <&blsp_dma 11>, <&blsp_dma 10>; -+ dma-names = "rx", "tx"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ status = "disabled"; -+ }; - - cryptobam: dma@8e04000 { - compatible = "qcom,bam-v1.7.0"; diff --git a/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch b/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch index d34f5d1f9..560eee7d2 100644 --- a/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch +++ b/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch @@ -17,7 +17,7 @@ Changes: --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -35,19 +35,27 @@ +@@ -34,19 +34,27 @@ cpu@0 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -47,7 +47,7 @@ Changes: qcom,acc = <&acc1>; qcom,saw = <&saw1>; reg = <0x1>; -@@ -59,7 +67,8 @@ +@@ -58,7 +66,8 @@ cpu@2 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -57,7 +57,7 @@ Changes: qcom,acc = <&acc2>; qcom,saw = <&saw2>; reg = <0x2>; -@@ -71,7 +80,8 @@ +@@ -70,7 +79,8 @@ cpu@3 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -67,7 +67,7 @@ Changes: qcom,acc = <&acc3>; qcom,saw = <&saw3>; reg = <0x3>; -@@ -236,22 +246,22 @@ +@@ -218,22 +228,22 @@ }; acc0: clock-controller@b088000 { @@ -94,7 +94,7 @@ Changes: reg = <0x0b0b8000 0x1000>, <0xb008000 0x1000>; }; -@@ -279,6 +289,12 @@ +@@ -261,6 +271,12 @@ regulator; }; diff --git a/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch b/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch index 22ea75299..b780d7881 100644 --- a/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch +++ b/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch @@ -51,7 +51,7 @@ Changes: }; --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -331,5 +331,76 @@ +@@ -313,5 +313,76 @@ compatible = "qcom,pshold"; reg = <0x4ab000 0x4>; }; diff --git a/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch b/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch index 4b2f6c8dd..ad7ce1673 100644 --- a/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch +++ b/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch @@ -1,100 +1,57 @@ -From 45e183ad169db4e233ce8337cf8b735545151f0e Mon Sep 17 00:00:00 2001 +From 6091a49b0b06bf838fed80498c4f5f40d0fbd447 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 19 Nov 2016 01:22:46 +0100 -Subject: [PATCH] arm: dts: qcom: add both IPQ4019 wifi blocks +Subject: [PATCH] dts: ipq4019: add both IPQ4019 wifi block definitions -This patch adds and enables the device-tree definitions for -both qcom,ipq4019-wifi blocks for the IPQ4019. +The IPQ4019 has two ath10k blocks on the AHB. Both wifi's +are already supported by ath10k. -Support for these have been added into the ath10k driver since: -280e762e9c72 ("ath10k: enable ipq4019 device probe in ahb module") - -The binding documentation was added in commit: -a47aaa69de88 ("dt: bindings: add new dt entry for pre calibration in qcom, ath10k.txt") - -This has been tested on an ASUS RT-AC58U (IPQ4019), -an AVM Fritz!Box 4040 (IPQ4018), a Compex WPJ428(IPQ4028) -and a Meraki MR33 (IPQ4029). - -| a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff [...] -| a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1 -| a000000.wifi: firmware ver 10.4-3.4-00082 api 5 features no-p2p,mfp,[...] -| a000000.wifi: board_file api 2 bmi_id 0:16 crc32 5773b188 -| a000000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file [...] -... -| a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000 -| a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1 -| a800000.wifi: firmware ver 10.4-3.4-00082 api 5 features no-p2p, [...] -| a800000.wifi: board_file api 2 bmi_id 0:17 crc32 5773b188 -| a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file [...] - -Signed-off-by: Christian Lamparter +Signed-off-by: Christian Lamparter --- - arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 8 +++ - arch/arm/boot/dts/qcom-ipq4019.dtsi | 84 +++++++++++++++++++++++++++ - 2 files changed, 92 insertions(+) + arch/arm/boot/dts/qcom-ipq4019.dtsi | 84 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 84 insertions(+) -diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -index c25d8f5c669d..cfa0c9970d5b 100644 ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -112,5 +112,13 @@ - watchdog@b017000 { - status = "ok"; - }; -+ -+ wifi@a000000 { -+ status = "ok"; -+ }; -+ -+ wifi@a800000 { -+ status = "ok"; -+ }; - }; - }; -diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi -index d1a56331ce96..1ddcc96b510c 100644 --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -291,5 +291,89 @@ - compatible = "qcom,pshold"; - reg = <0x4ab000 0x4>; +@@ -384,5 +384,89 @@ + dr_mode = "host"; + }; }; + + wifi0: wifi@a000000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa000000 0x200000>; -+ resets = <&gcc WIFI0_CPU_INIT_RESET>, -+ <&gcc WIFI0_RADIO_SRIF_RESET>, -+ <&gcc WIFI0_RADIO_WARM_RESET>, -+ <&gcc WIFI0_RADIO_COLD_RESET>, -+ <&gcc WIFI0_CORE_WARM_RESET>, -+ <&gcc WIFI0_CORE_COLD_RESET>; ++ resets = <&gcc WIFI0_CPU_INIT_RESET ++ &gcc WIFI0_RADIO_SRIF_RESET ++ &gcc WIFI0_RADIO_WARM_RESET ++ &gcc WIFI0_RADIO_COLD_RESET ++ &gcc WIFI0_CORE_WARM_RESET ++ &gcc WIFI0_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; -+ clocks = <&gcc GCC_WCSS2G_CLK>, -+ <&gcc GCC_WCSS2G_REF_CLK>, -+ <&gcc GCC_WCSS2G_RTC_CLK>; ++ clocks = <&gcc GCC_WCSS2G_CLK ++ &gcc GCC_WCSS2G_REF_CLK ++ &gcc GCC_WCSS2G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; ++ interrupts = <0 32 IRQ_TYPE_EDGE_RISING ++ 0 33 IRQ_TYPE_EDGE_RISING ++ 0 34 IRQ_TYPE_EDGE_RISING ++ 0 35 IRQ_TYPE_EDGE_RISING ++ 0 36 IRQ_TYPE_EDGE_RISING ++ 0 37 IRQ_TYPE_EDGE_RISING ++ 0 38 IRQ_TYPE_EDGE_RISING ++ 0 39 IRQ_TYPE_EDGE_RISING ++ 0 40 IRQ_TYPE_EDGE_RISING ++ 0 41 IRQ_TYPE_EDGE_RISING ++ 0 42 IRQ_TYPE_EDGE_RISING ++ 0 43 IRQ_TYPE_EDGE_RISING ++ 0 44 IRQ_TYPE_EDGE_RISING ++ 0 45 IRQ_TYPE_EDGE_RISING ++ 0 46 IRQ_TYPE_EDGE_RISING ++ 0 47 IRQ_TYPE_EDGE_RISING ++ 0 168 IRQ_TYPE_NONE>; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", @@ -106,37 +63,37 @@ index d1a56331ce96..1ddcc96b510c 100644 + wifi1: wifi@a800000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa800000 0x200000>; -+ resets = <&gcc WIFI1_CPU_INIT_RESET>, -+ <&gcc WIFI1_RADIO_SRIF_RESET>, -+ <&gcc WIFI1_RADIO_WARM_RESET>, -+ <&gcc WIFI1_RADIO_COLD_RESET>, -+ <&gcc WIFI1_CORE_WARM_RESET>, -+ <&gcc WIFI1_CORE_COLD_RESET>; ++ resets = <&gcc WIFI1_CPU_INIT_RESET ++ &gcc WIFI1_RADIO_SRIF_RESET ++ &gcc WIFI1_RADIO_WARM_RESET ++ &gcc WIFI1_RADIO_COLD_RESET ++ &gcc WIFI1_CORE_WARM_RESET ++ &gcc WIFI1_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; -+ clocks = <&gcc GCC_WCSS5G_CLK>, -+ <&gcc GCC_WCSS5G_REF_CLK>, -+ <&gcc GCC_WCSS5G_RTC_CLK>; ++ clocks = <&gcc GCC_WCSS5G_CLK ++ &gcc GCC_WCSS5G_REF_CLK ++ &gcc GCC_WCSS5G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; -+ interrupts = , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ , -+ ; ++ interrupts = <0 48 IRQ_TYPE_EDGE_RISING ++ 0 49 IRQ_TYPE_EDGE_RISING ++ 0 50 IRQ_TYPE_EDGE_RISING ++ 0 51 IRQ_TYPE_EDGE_RISING ++ 0 52 IRQ_TYPE_EDGE_RISING ++ 0 53 IRQ_TYPE_EDGE_RISING ++ 0 54 IRQ_TYPE_EDGE_RISING ++ 0 55 IRQ_TYPE_EDGE_RISING ++ 0 56 IRQ_TYPE_EDGE_RISING ++ 0 57 IRQ_TYPE_EDGE_RISING ++ 0 58 IRQ_TYPE_EDGE_RISING ++ 0 59 IRQ_TYPE_EDGE_RISING ++ 0 60 IRQ_TYPE_EDGE_RISING ++ 0 61 IRQ_TYPE_EDGE_RISING ++ 0 62 IRQ_TYPE_EDGE_RISING ++ 0 63 IRQ_TYPE_EDGE_RISING ++ 0 169 IRQ_TYPE_NONE>; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", @@ -146,6 +103,3 @@ index d1a56331ce96..1ddcc96b510c 100644 + }; }; }; --- -2.13.3 - diff --git a/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch b/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch index f53f78073..8323ff0fa 100644 --- a/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch +++ b/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch @@ -13,7 +13,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -295,6 +295,13 @@ +@@ -277,6 +277,13 @@ regulator; }; diff --git a/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch b/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch deleted file mode 100644 index 7ac157058..000000000 --- a/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Christian Lamparter -Date: Mon, 20 Mar 2017 18:08:03 +0100 -Subject: [PATCH] dts: ARM: qcom-ipq4019: add scm node - -This patch adds the device-tree node necessary for communicating -with Qualcomm's TrustZone/Secure Execution Environment -implementation. - -Signed-off-by: Christian Lamparter ---- ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -137,6 +137,12 @@ - }; - }; - -+ firmware { -+ scm { -+ compatible = "qcom,scm-ipq4019", "qcom,scm-ipq40xx"; -+ }; -+ }; -+ - soc { - #address-cells = <1>; - #size-cells = <1>; diff --git a/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch b/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch deleted file mode 100644 index df6ecfac7..000000000 --- a/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch +++ /dev/null @@ -1,98 +0,0 @@ ---- a/drivers/firmware/qcom_scm-32.c -+++ b/drivers/firmware/qcom_scm-32.c -@@ -578,3 +578,33 @@ int __qcom_scm_pinmux_write(u32 svc_id, - - return ret; - } -+ -+int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val) -+{ -+ __le32 *otp_value; -+ dma_addr_t in; -+ int ret; -+ -+ otp_value = kzalloc(PAGE_ALIGN(sizeof(*otp_value)), GFP_KERNEL); -+ if (!otp_value) -+ return -ENOMEM; -+ -+ in = dma_map_single(dev, otp_value, sizeof(in), DMA_FROM_DEVICE); -+ -+ ret = dma_mapping_error(dev, in); -+ if (ret != 0) { -+ kfree(otp_value); -+ pr_err("DMA Mapping Error %d\n", ret); -+ return ret; -+ } -+ -+ ret = qcom_scm_call(dev, QCOM_SCM_SVC_FUSE, address, -+ &in, sizeof(in), NULL, 0); -+ -+ dma_unmap_single(dev, in, sizeof(in), DMA_FROM_DEVICE); -+ -+ *val = le32_to_cpu(*otp_value); -+ kfree(otp_value); -+ -+ return ret; -+} ---- a/drivers/firmware/qcom_scm.c -+++ b/drivers/firmware/qcom_scm.c -@@ -165,6 +165,25 @@ int qcom_scm_hdcp_req(struct qcom_scm_hd - EXPORT_SYMBOL(qcom_scm_hdcp_req); - - /** -+ * qcom_scm_fuse() - Reads a value from the OTP -+ * @address: address -+ * -+ * Returns the value of the OTP at the specified address. -+ */ -+int qcom_scm_fuse(u32 address, u32 *val) -+{ -+ int ret = qcom_scm_clk_enable(); -+ -+ if (ret) -+ return ret; -+ -+ ret = __qcom_scm_fuse(__scm->dev, address, val); -+ qcom_scm_clk_disable(); -+ return ret; -+} -+EXPORT_SYMBOL(qcom_scm_fuse); -+ -+/** - * qcom_scm_pas_supported() - Check if the peripheral authentication service is - * available for the given peripherial - * @peripheral: peripheral id ---- a/drivers/firmware/qcom_scm.h -+++ b/drivers/firmware/qcom_scm.h -@@ -63,6 +63,9 @@ extern int __qcom_scm_pas_mss_reset(str - s32 __qcom_scm_pinmux_read(u32 svc_id, u32 cmd_id, u32 arg1); - s32 __qcom_scm_pinmux_write(u32 svc_id, u32 cmd_id, u32 arg1, u32 arg2); - -+#define QCOM_SCM_SVC_FUSE 0x8 -+extern int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val); -+ - /* common error codes */ - #define QCOM_SCM_V2_EBUSY -12 - #define QCOM_SCM_ENOMEM -5 ---- a/include/linux/qcom_scm.h -+++ b/include/linux/qcom_scm.h -@@ -48,4 +48,7 @@ extern u32 qcom_scm_get_version(void); - - extern s32 qcom_scm_pinmux_read(u32 arg1); - extern s32 qcom_scm_pinmux_write(u32 arg1, u32 arg2); -+ -+extern int qcom_scm_fuse(u32 address, u32 *val); -+ - #endif ---- a/drivers/firmware/qcom_scm-64.c -+++ b/drivers/firmware/qcom_scm-64.c -@@ -374,3 +374,9 @@ int __qcom_scm_pinmux_write(u32 svc_id, - { - return -ENOTSUPP; - } -+ -+int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val) -+{ -+ *val = -1; -+ return -ENOTSUPP; -+} diff --git a/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch b/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch index 546eb3769..d19be2716 100644 --- a/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch +++ b/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch @@ -15,7 +15,7 @@ so the info might change. --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -345,6 +345,34 @@ +@@ -321,6 +321,34 @@ reg = <0x4ab000 0x4>; }; diff --git a/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch b/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch index ee8f459e4..b1b18b46d 100644 --- a/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch +++ b/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -373,6 +373,29 @@ +@@ -349,6 +349,29 @@ }; }; diff --git a/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch b/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch index afd680d64..ad3c9fc30 100644 --- a/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch +++ b/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch @@ -16,16 +16,16 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -27,6 +27,8 @@ +@@ -26,6 +26,8 @@ + aliases { spi0 = &spi_0; i2c0 = &i2c_0; - i2c1 = &i2c_1; + ethernet0 = &gmac0; + ethernet1 = &gmac1; }; cpus { -@@ -396,6 +398,64 @@ +@@ -372,6 +374,64 @@ status = "disabled"; }; diff --git a/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch b/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch deleted file mode 100644 index 2a1cade85..000000000 --- a/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch +++ /dev/null @@ -1,69 +0,0 @@ -From: Christian Lamparter -Subject: [PATCH] net: essedma: disable default vlan tagging -Date: Tue, 21 Mar 13:59:02 CET 2017 +0100 - -The essedma driver has its own unique take on VLAN management -and its configuration. In the original SDK, each VLAN is -assigned one virtual ethernet netdev. - -However, this is non-standard. So, this patch does away -with the default_vlan_tag property the driver is using -and therefore forces the user to use the kernel's vlan -feature. - -This patch also removes the "qcom,poll_required = <1>;" from -the essedma node. - -Signed-off-by: Christian Lamparter ---- ---- a/drivers/net/ethernet/qualcomm/essedma/edma.c -+++ b/drivers/net/ethernet/qualcomm/essedma/edma.c -@@ -715,13 +715,11 @@ static void edma_rx_complete(struct edma - edma_receive_checksum(rd, skb); - - /* Process VLAN HW acceleration indication provided by HW */ -- if (unlikely(adapter->default_vlan_tag != rd->rrd4)) { -- vlan = rd->rrd4; -- if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) -- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); -- else if (rd->rrd1 & EDMA_RRD_SVLAN) -- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); -- } -+ vlan = rd->rrd4; -+ if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) -+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); -+ else if (rd->rrd1 & EDMA_RRD_SVLAN) -+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); - - /* Update rx statistics */ - adapter->stats.rx_packets++; -@@ -1390,8 +1388,6 @@ netdev_tx_t edma_xmit(struct sk_buff *sk - /* Check and mark VLAN tag offload */ - if (skb_vlan_tag_present(skb)) - flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_FLAG; -- else if (adapter->default_vlan_tag) -- flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_DEFAULT_FLAG; - - /* Check and mark checksum offload */ - if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -404,8 +404,7 @@ - qcom,page-mode = <0>; - qcom,rx_head_buf_size = <1540>; - qcom,mdio_supported; -- qcom,poll_required = <1>; -- qcom,num_gmac = <2>; -+ qcom,num_gmac = <1>; - interrupts = <0 65 IRQ_TYPE_EDGE_RISING - 0 66 IRQ_TYPE_EDGE_RISING - 0 67 IRQ_TYPE_EDGE_RISING -@@ -443,7 +442,7 @@ - - gmac0: gmac0 { - local-mac-address = [00 00 00 00 00 00]; -- vlan_tag = <1 0x1f>; -+ vlan_tag = <1 0x3f>; - }; - - gmac1: gmac1 { diff --git a/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch b/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch index 2aa0448f8..3636c5ca0 100644 --- a/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch +++ b/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch @@ -291,7 +291,7 @@ Changed: +MODULE_DESCRIPTION("USB3 QCA BALDUR HSPHY driver"); --- /dev/null +++ b/drivers/usb/phy/phy-qca-uniphy.c -@@ -0,0 +1,202 @@ +@@ -0,0 +1,135 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any @@ -318,18 +318,6 @@ Changed: +#include +#include +#include -+#include -+ -+#define USB_CALIBRATION_CMD 0x10 -+#define USB3PHY_SPARE_1 0x7FC -+#define RX_LOS_1 0x7C8 -+#define MISC_SOURCE_REG 0x21c -+#define CDR_CONTROL_REG_1 0x80 -+#define PCS_INTERNAL_CONTROL14 0x364 -+#define MMD1_REG_REG_MASK (0x7F << 8) -+#define OTP_MASK (0x7F << 5) -+#define MMD1_REG_AUTOLOAD_MASK (0x1 << 7) -+#define SPARE_1_BIT14_MASK (0x1 << 14) + +struct qca_uni_ss_phy { + struct usb_phy phy; @@ -350,60 +338,6 @@ Changed: + reset_control_assert(phy->por_rst); +} + -+int qca_uni_ss_phy_usb_los_calibration(void __iomem *base) -+{ -+ int err; -+ uint32_t data, otp_val = 0; -+ -+ /* Get OTP value */ -+ err = qcom_scm_fuse(USB_CALIBRATION_CMD, &otp_val); -+ if (err < 0 || !(otp_val & OTP_MASK)) { -+ pr_err("USB Calibration Failed with error %d %d\n", err, otp_val); -+ return 0; -+ } -+ -+ pr_info("Raw USB3 Calibration value %x\n", otp_val); -+ -+ /* -+ * Read the USB3PHY_SPARE_1 register and -+ * set bit 14 to 0 -+ */ -+ data = readl_relaxed(base + USB3PHY_SPARE_1); -+ data = data & (~SPARE_1_BIT14_MASK); -+ writel(data, base + USB3PHY_SPARE_1); -+ udelay(100); -+ -+ /* -+ * Get bit 11:5 value, add with 0x14 and set to the -+ * register USB3PHY_RX_LOS_1 bit MMD1_REG_REG -+ */ -+ data = readl_relaxed(base + RX_LOS_1); -+ otp_val = ((otp_val & OTP_MASK) >> 5) + 0x14; -+ otp_val = otp_val << 8; -+ data = data & (~MMD1_REG_REG_MASK); -+ data = data | otp_val; -+ writel(data, base + RX_LOS_1); -+ udelay(100); -+ -+ /* -+ * Set bit MMD1_REG_AUTOLOAD_SEL_RX_LOS_THRES in -+ * USB3PHY_RX_LOS_1 to 1 -+ */ -+ data = readl_relaxed(base + RX_LOS_1); -+ data = data | MMD1_REG_AUTOLOAD_MASK; -+ writel(data, base + RX_LOS_1); -+ udelay(100); -+ -+ writel(0x4000, base + PCS_INTERNAL_CONTROL14); -+ udelay(100); -+ writel(0xaa0a, base + MISC_SOURCE_REG); -+ udelay(100); -+ writel(0x0202, base + CDR_CONTROL_REG_1); -+ udelay(100); -+ -+ return 0; -+} -+ +static int qca_uni_ss_phy_init(struct usb_phy *x) +{ + struct qca_uni_ss_phy *phy = phy_to_dw_phy(x); @@ -416,8 +350,7 @@ Changed: + /* deassert SS PHY POR reset */ + reset_control_deassert(phy->por_rst); + -+ /* USB LOS Calibration */ -+ return qca_uni_ss_phy_usb_los_calibration(phy->base); ++ return 0; +} + +static int qca_uni_ss_get_resources(struct platform_device *pdev, diff --git a/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch new file mode 100644 index 000000000..d0a6a26a5 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch @@ -0,0 +1,1328 @@ +From fc6cf61517b8b4ab4678659936fc7572f699d6e7 Mon Sep 17 00:00:00 2001 +From: Ram Chandra Jangir +Date: Tue, 28 Mar 2017 14:00:00 +0530 +Subject: [PATCH] ipq4019: pinctrl: Updated various Pin definitions + +Populate default values for various GPIO functions + +Signed-off-by: Ram Chandra Jangir +--- + drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1189 +++++++++++++++++++++++++++++--- + 1 file changed, 1111 insertions(+), 78 deletions(-) + +--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c ++++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +@@ -276,16 +276,531 @@ DECLARE_QCA_GPIO_PINS(99); + + + enum ipq4019_functions { ++ qca_mux_rmii0_refclk, ++ qca_mux_wifi0_rfsilient0, ++ qca_mux_wifi1_rfsilient0, ++ qca_mux_smart2, ++ qca_mux_led4, ++ qca_mux_wifi0_cal, ++ qca_mux_wifi1_cal, ++ qca_mux_wifi_wci0, ++ qca_mux_rmii0_dv, ++ qca_mux_wifi_wci1, ++ qca_mux_rmii1_refclk, ++ qca_mux_blsp_spi1, ++ qca_mux_led5, ++ qca_mux_rmii10, ++ qca_mux_led6, ++ qca_mux_rmii11, ++ qca_mux_led7, ++ qca_mux_rmii1_dv, ++ qca_mux_led8, ++ qca_mux_rmii1_tx, ++ qca_mux_aud_pin, ++ qca_mux_led9, ++ qca_mux_rmii1_rx, ++ qca_mux_led10, ++ qca_mux_wifi0_rfsilient1, ++ qca_mux_wifi1_rfsilient1, ++ qca_mux_led11, ++ qca_mux_boot7, ++ qca_mux_qpic_pad, ++ qca_mux_pcie_clk, ++ qca_mux_tm_clk0, ++ qca_mux_wifi00, ++ qca_mux_wifi10, ++ qca_mux_mdio1, ++ qca_mux_prng_rosc, ++ qca_mux_dbg_out, ++ qca_mux_tm0, ++ qca_mux_wifi01, ++ qca_mux_wifi11, ++ qca_mux_atest_char3, ++ qca_mux_pmu0, ++ qca_mux_boot8, ++ qca_mux_tm1, ++ qca_mux_atest_char2, ++ qca_mux_pmu1, ++ qca_mux_boot9, ++ qca_mux_tm2, ++ qca_mux_atest_char1, ++ qca_mux_tm_ack, ++ qca_mux_wifi03, ++ qca_mux_wifi13, ++ qca_mux_qpic_pad4, ++ qca_mux_atest_char0, ++ qca_mux_tm3, ++ qca_mux_wifi02, ++ qca_mux_wifi12, ++ qca_mux_qpic_pad5, ++ qca_mux_smart3, ++ qca_mux_wcss0_dbg14, ++ qca_mux_tm4, ++ qca_mux_wifi04, ++ qca_mux_wifi14, ++ qca_mux_qpic_pad6, ++ qca_mux_wcss0_dbg15, ++ qca_mux_qdss_tracectl_a, ++ qca_mux_boot18, ++ qca_mux_tm5, ++ qca_mux_qpic_pad7, ++ qca_mux_atest_char, ++ qca_mux_wcss0_dbg4, ++ qca_mux_qdss_traceclk_a, ++ qca_mux_boot19, ++ qca_mux_tm6, ++ qca_mux_wcss0_dbg5, ++ qca_mux_qdss_cti_trig_out_a0, ++ qca_mux_boot14, ++ qca_mux_tm7, ++ qca_mux_chip_rst, ++ qca_mux_wcss0_dbg6, ++ qca_mux_qdss_cti_trig_out_b0, ++ qca_mux_boot11, ++ qca_mux_tm8, ++ qca_mux_wcss0_dbg7, ++ qca_mux_wcss1_dbg7, ++ qca_mux_boot20, ++ qca_mux_tm9, ++ qca_mux_qpic_pad1, ++ qca_mux_wcss0_dbg8, ++ qca_mux_wcss1_dbg8, ++ qca_mux_qpic_pad2, ++ qca_mux_wcss0_dbg9, ++ qca_mux_wcss1_dbg9, ++ qca_mux_qpic_pad3, ++ qca_mux_wcss0_dbg10, ++ qca_mux_wcss1_dbg10, ++ qca_mux_qpic_pad0, ++ qca_mux_wcss0_dbg11, ++ qca_mux_wcss1_dbg11, ++ qca_mux_qpic_pad8, ++ qca_mux_wcss0_dbg12, ++ qca_mux_wcss1_dbg12, ++ qca_mux_wifi034, ++ qca_mux_wifi134, ++ qca_mux_jtag_tdi, + qca_mux_gpio, ++ qca_mux_i2s_rx_bclk, ++ qca_mux_jtag_tck, ++ qca_mux_i2s_rx_fsync, ++ qca_mux_jtag_tms, ++ qca_mux_i2s_rxd, ++ qca_mux_smart0, ++ qca_mux_jtag_tdo, ++ qca_mux_jtag_rst, ++ qca_mux_jtag_trst, ++ qca_mux_mdio0, ++ qca_mux_wcss0_dbg18, ++ qca_mux_wcss1_dbg18, ++ qca_mux_qdss_tracedata_a, ++ qca_mux_mdc, ++ qca_mux_wcss0_dbg19, ++ qca_mux_wcss1_dbg19, + qca_mux_blsp_uart1, ++ qca_mux_wifi0_uart, ++ qca_mux_wifi1_uart, ++ qca_mux_smart1, ++ qca_mux_wcss0_dbg20, ++ qca_mux_wcss1_dbg20, ++ qca_mux_wifi0_uart0, ++ qca_mux_wifi1_uart0, ++ qca_mux_wcss0_dbg21, ++ qca_mux_wcss1_dbg21, + qca_mux_blsp_i2c0, ++ qca_mux_wcss0_dbg22, ++ qca_mux_wcss1_dbg22, ++ qca_mux_wcss0_dbg23, ++ qca_mux_wcss1_dbg23, ++ qca_mux_blsp_spi0, + qca_mux_blsp_i2c1, ++ qca_mux_wcss0_dbg24, ++ qca_mux_wcss1_dbg24, ++ qca_mux_wcss0_dbg25, ++ qca_mux_wcss1_dbg25, ++ qca_mux_wcss0_dbg26, ++ qca_mux_wcss1_dbg26, ++ qca_mux_wcss0_dbg, ++ qca_mux_wcss1_dbg, + qca_mux_blsp_uart0, +- qca_mux_blsp_spi1, +- qca_mux_blsp_spi0, ++ qca_mux_led0, ++ qca_mux_wcss0_dbg28, ++ qca_mux_wcss1_dbg28, ++ qca_mux_led1, ++ qca_mux_wcss0_dbg29, ++ qca_mux_wcss1_dbg29, ++ qca_mux_wifi0_uart1, ++ qca_mux_wifi1_uart1, ++ qca_mux_wcss0_dbg30, ++ qca_mux_wcss1_dbg30, ++ qca_mux_wcss0_dbg31, ++ qca_mux_wcss1_dbg31, ++ qca_mux_i2s_rx_mclk, ++ qca_mux_wcss0_dbg16, ++ qca_mux_wcss1_dbg16, ++ qca_mux_wcss0_dbg17, ++ qca_mux_wcss1_dbg17, ++ qca_mux_rgmii0, ++ qca_mux_sdio0, ++ qca_mux_rgmii1, ++ qca_mux_sdio1, ++ qca_mux_rgmii2, ++ qca_mux_i2s_tx_mclk, ++ qca_mux_sdio2, ++ qca_mux_rgmii3, ++ qca_mux_i2s_tx_bclk, ++ qca_mux_sdio3, ++ qca_mux_rgmii_rx, ++ qca_mux_i2s_tx_fsync, ++ qca_mux_sdio_clk, ++ qca_mux_rgmii_txc, ++ qca_mux_i2s_td1, ++ qca_mux_sdio_cmd, ++ qca_mux_i2s_td2, ++ qca_mux_sdio4, ++ qca_mux_i2s_td3, ++ qca_mux_sdio5, ++ qca_mux_audio_pwm0, ++ qca_mux_sdio6, ++ qca_mux_audio_pwm1, ++ qca_mux_wcss0_dbg27, ++ qca_mux_wcss1_dbg27, ++ qca_mux_sdio7, ++ qca_mux_rgmii_rxc, ++ qca_mux_audio_pwm2, ++ qca_mux_rgmii_tx, ++ qca_mux_audio_pwm3, ++ qca_mux_boot2, ++ qca_mux_i2s_spdif_in, ++ qca_mux_i2s_spdif_out, ++ qca_mux_rmii00, ++ qca_mux_led2, ++ qca_mux_rmii01, ++ qca_mux_wifi0_wci, ++ qca_mux_wifi1_wci, ++ qca_mux_boot4, ++ qca_mux_rmii0_tx, ++ qca_mux_boot5, ++ qca_mux_rmii0_rx, ++ qca_mux_pcie_clk1, ++ qca_mux_led3, ++ qca_mux_sdio_cd, + qca_mux_NA, + }; + ++static const char * const rmii0_refclk_groups[] = { ++ "gpio40", ++}; ++static const char * const wifi0_rfsilient0_groups[] = { ++ "gpio40", ++}; ++static const char * const wifi1_rfsilient0_groups[] = { ++ "gpio40", ++}; ++static const char * const smart2_groups[] = { ++ "gpio40", "gpio41", "gpio48", "gpio49", ++}; ++static const char * const led4_groups[] = { ++ "gpio40", ++}; ++static const char * const wifi0_cal_groups[] = { ++ "gpio41", "gpio51", ++}; ++static const char * const wifi1_cal_groups[] = { ++ "gpio41", "gpio51", ++}; ++static const char * const wifi_wci0_groups[] = { ++ "gpio42", ++}; ++static const char * const rmii0_dv_groups[] = { ++ "gpio43", ++}; ++static const char * const wifi_wci1_groups[] = { ++ "gpio43", ++}; ++static const char * const rmii1_refclk_groups[] = { ++ "gpio44", ++}; ++static const char * const blsp_spi1_groups[] = { ++ "gpio44", "gpio45", "gpio46", "gpio47", ++}; ++static const char * const led5_groups[] = { ++ "gpio44", ++}; ++static const char * const rmii10_groups[] = { ++ "gpio45", "gpio50", ++}; ++static const char * const led6_groups[] = { ++ "gpio45", ++}; ++static const char * const rmii11_groups[] = { ++ "gpio46", "gpio51", ++}; ++static const char * const led7_groups[] = { ++ "gpio46", ++}; ++static const char * const rmii1_dv_groups[] = { ++ "gpio47", ++}; ++static const char * const led8_groups[] = { ++ "gpio47", ++}; ++static const char * const rmii1_tx_groups[] = { ++ "gpio48", ++}; ++static const char * const aud_pin_groups[] = { ++ "gpio48", "gpio49", "gpio50", "gpio51", ++}; ++static const char * const led9_groups[] = { ++ "gpio48", ++}; ++static const char * const rmii1_rx_groups[] = { ++ "gpio49", ++}; ++static const char * const led10_groups[] = { ++ "gpio49", ++}; ++static const char * const wifi0_rfsilient1_groups[] = { ++ "gpio50", ++}; ++static const char * const wifi1_rfsilient1_groups[] = { ++ "gpio50", ++}; ++static const char * const led11_groups[] = { ++ "gpio50", ++}; ++static const char * const boot7_groups[] = { ++ "gpio51", ++}; ++static const char * const qpic_pad_groups[] = { ++ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio61", "gpio62", ++ "gpio63", "gpio69", ++}; ++static const char * const pcie_clk_groups[] = { ++ "gpio52", ++}; ++static const char * const tm_clk0_groups[] = { ++ "gpio52", ++}; ++static const char * const wifi00_groups[] = { ++ "gpio52", ++}; ++static const char * const wifi10_groups[] = { ++ "gpio52", ++}; ++static const char * const mdio1_groups[] = { ++ "gpio53", ++}; ++static const char * const prng_rosc_groups[] = { ++ "gpio53", ++}; ++static const char * const dbg_out_groups[] = { ++ "gpio53", ++}; ++static const char * const tm0_groups[] = { ++ "gpio53", ++}; ++static const char * const wifi01_groups[] = { ++ "gpio53", ++}; ++static const char * const wifi11_groups[] = { ++ "gpio53", ++}; ++static const char * const atest_char3_groups[] = { ++ "gpio54", ++}; ++static const char * const pmu0_groups[] = { ++ "gpio54", ++}; ++static const char * const boot8_groups[] = { ++ "gpio54", ++}; ++static const char * const tm1_groups[] = { ++ "gpio54", ++}; ++static const char * const atest_char2_groups[] = { ++ "gpio55", ++}; ++static const char * const pmu1_groups[] = { ++ "gpio55", ++}; ++static const char * const boot9_groups[] = { ++ "gpio55", ++}; ++static const char * const tm2_groups[] = { ++ "gpio55", ++}; ++static const char * const atest_char1_groups[] = { ++ "gpio56", ++}; ++static const char * const tm_ack_groups[] = { ++ "gpio56", ++}; ++static const char * const wifi03_groups[] = { ++ "gpio56", ++}; ++static const char * const wifi13_groups[] = { ++ "gpio56", ++}; ++static const char * const qpic_pad4_groups[] = { ++ "gpio57", ++}; ++static const char * const atest_char0_groups[] = { ++ "gpio57", ++}; ++static const char * const tm3_groups[] = { ++ "gpio57", ++}; ++static const char * const wifi02_groups[] = { ++ "gpio57", ++}; ++static const char * const wifi12_groups[] = { ++ "gpio57", ++}; ++static const char * const qpic_pad5_groups[] = { ++ "gpio58", ++}; ++static const char * const smart3_groups[] = { ++ "gpio58", "gpio59", "gpio60", "gpio61", ++}; ++static const char * const wcss0_dbg14_groups[] = { ++ "gpio58", ++}; ++static const char * const tm4_groups[] = { ++ "gpio58", ++}; ++static const char * const wifi04_groups[] = { ++ "gpio58", ++}; ++static const char * const wifi14_groups[] = { ++ "gpio58", ++}; ++static const char * const qpic_pad6_groups[] = { ++ "gpio59", ++}; ++static const char * const wcss0_dbg15_groups[] = { ++ "gpio59", ++}; ++static const char * const qdss_tracectl_a_groups[] = { ++ "gpio59", ++}; ++static const char * const boot18_groups[] = { ++ "gpio59", ++}; ++static const char * const tm5_groups[] = { ++ "gpio59", ++}; ++static const char * const qpic_pad7_groups[] = { ++ "gpio60", ++}; ++static const char * const atest_char_groups[] = { ++ "gpio60", ++}; ++static const char * const wcss0_dbg4_groups[] = { ++ "gpio60", ++}; ++static const char * const qdss_traceclk_a_groups[] = { ++ "gpio60", ++}; ++static const char * const boot19_groups[] = { ++ "gpio60", ++}; ++static const char * const tm6_groups[] = { ++ "gpio60", ++}; ++static const char * const wcss0_dbg5_groups[] = { ++ "gpio61", ++}; ++static const char * const qdss_cti_trig_out_a0_groups[] = { ++ "gpio61", ++}; ++static const char * const boot14_groups[] = { ++ "gpio61", ++}; ++static const char * const tm7_groups[] = { ++ "gpio61", ++}; ++static const char * const chip_rst_groups[] = { ++ "gpio62", ++}; ++static const char * const wcss0_dbg6_groups[] = { ++ "gpio62", ++}; ++static const char * const qdss_cti_trig_out_b0_groups[] = { ++ "gpio62", ++}; ++static const char * const boot11_groups[] = { ++ "gpio62", ++}; ++static const char * const tm8_groups[] = { ++ "gpio62", ++}; ++static const char * const wcss0_dbg7_groups[] = { ++ "gpio63", ++}; ++static const char * const wcss1_dbg7_groups[] = { ++ "gpio63", ++}; ++static const char * const boot20_groups[] = { ++ "gpio63", ++}; ++static const char * const tm9_groups[] = { ++ "gpio63", ++}; ++static const char * const qpic_pad1_groups[] = { ++ "gpio64", ++}; ++static const char * const wcss0_dbg8_groups[] = { ++ "gpio64", ++}; ++static const char * const wcss1_dbg8_groups[] = { ++ "gpio64", ++}; ++static const char * const qpic_pad2_groups[] = { ++ "gpio65", ++}; ++static const char * const wcss0_dbg9_groups[] = { ++ "gpio65", ++}; ++static const char * const wcss1_dbg9_groups[] = { ++ "gpio65", ++}; ++static const char * const qpic_pad3_groups[] = { ++ "gpio66", ++}; ++static const char * const wcss0_dbg10_groups[] = { ++ "gpio66", ++}; ++static const char * const wcss1_dbg10_groups[] = { ++ "gpio66", ++}; ++static const char * const qpic_pad0_groups[] = { ++ "gpio67", ++}; ++static const char * const wcss0_dbg11_groups[] = { ++ "gpio67", ++}; ++static const char * const wcss1_dbg11_groups[] = { ++ "gpio67", ++}; ++static const char * const qpic_pad8_groups[] = { ++ "gpio68", ++}; ++static const char * const wcss0_dbg12_groups[] = { ++ "gpio68", ++}; ++static const char * const wcss1_dbg12_groups[] = { ++ "gpio68", ++}; ++static const char * const wifi034_groups[] = { ++ "gpio98", ++}; ++static const char * const wifi134_groups[] = { ++ "gpio98", ++}; ++static const char * const jtag_tdi_groups[] = { ++ "gpio0", ++}; + static const char * const gpio_groups[] = { + "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", + "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", +@@ -303,13 +818,103 @@ static const char * const gpio_groups[] + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", + "gpio99", + }; +- ++static const char * const i2s_rx_bclk_groups[] = { ++ "gpio0", "gpio21", "gpio60", ++}; ++static const char * const jtag_tck_groups[] = { ++ "gpio1", ++}; ++static const char * const i2s_rx_fsync_groups[] = { ++ "gpio1", "gpio22", "gpio61", ++}; ++static const char * const jtag_tms_groups[] = { ++ "gpio2", ++}; ++static const char * const i2s_rxd_groups[] = { ++ "gpio2", "gpio23", "gpio63", ++}; ++static const char * const smart0_groups[] = { ++ "gpio0", "gpio1", "gpio2", "gpio5", "gpio44", "gpio45", "gpio46", ++ "gpio47", ++}; ++static const char * const jtag_tdo_groups[] = { ++ "gpio3", ++}; ++static const char * const jtag_rst_groups[] = { ++ "gpio4", ++}; ++static const char * const jtag_trst_groups[] = { ++ "gpio5", ++}; ++static const char * const mdio0_groups[] = { ++ "gpio6", ++}; ++static const char * const wcss0_dbg18_groups[] = { ++ "gpio6", "gpio22", "gpio39", ++}; ++static const char * const wcss1_dbg18_groups[] = { ++ "gpio6", "gpio22", "gpio39", ++}; ++static const char * const qdss_tracedata_a_groups[] = { ++ "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio16", ++ "gpio17", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", ++ "gpio43", ++}; ++static const char * const mdc_groups[] = { ++ "gpio7", "gpio52", ++}; ++static const char * const wcss0_dbg19_groups[] = { ++ "gpio7", "gpio23", "gpio40", ++}; ++static const char * const wcss1_dbg19_groups[] = { ++ "gpio7", "gpio23", "gpio40", ++}; + static const char * const blsp_uart1_groups[] = { + "gpio8", "gpio9", "gpio10", "gpio11", + }; ++static const char * const wifi0_uart_groups[] = { ++ "gpio8", "gpio9", "gpio11", "gpio19", "gpio62", ++}; ++static const char * const wifi1_uart_groups[] = { ++ "gpio8", "gpio11", "gpio19", "gpio62", "gpio63", ++}; ++static const char * const smart1_groups[] = { ++ "gpio8", "gpio9", "gpio16", "gpio17", "gpio58", "gpio59", "gpio60", ++ "gpio61", ++}; ++static const char * const wcss0_dbg20_groups[] = { ++ "gpio8", "gpio24", "gpio41", ++}; ++static const char * const wcss1_dbg20_groups[] = { ++ "gpio8", "gpio24", "gpio41", ++}; ++static const char * const wifi0_uart0_groups[] = { ++ "gpio9", "gpio10", ++}; ++static const char * const wifi1_uart0_groups[] = { ++ "gpio9", "gpio10", ++}; ++static const char * const wcss0_dbg21_groups[] = { ++ "gpio9", "gpio25", "gpio42", ++}; ++static const char * const wcss1_dbg21_groups[] = { ++ "gpio9", "gpio25", "gpio42", ++}; + static const char * const blsp_i2c0_groups[] = { + "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59", + }; ++static const char * const wcss0_dbg22_groups[] = { ++ "gpio10", "gpio26", "gpio43", ++}; ++static const char * const wcss1_dbg22_groups[] = { ++ "gpio10", "gpio26", "gpio43", ++}; ++static const char * const wcss0_dbg23_groups[] = { ++ "gpio11", "gpio27", "gpio44", ++}; ++static const char * const wcss1_dbg23_groups[] = { ++ "gpio11", "gpio27", "gpio44", ++}; + static const char * const blsp_spi0_groups[] = { + "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", + "gpio54", "gpio55", "gpio56", "gpio57", +@@ -317,94 +922,582 @@ static const char * const blsp_spi0_grou + static const char * const blsp_i2c1_groups[] = { + "gpio12", "gpio13", "gpio34", "gpio35", + }; ++static const char * const wcss0_dbg24_groups[] = { ++ "gpio12", "gpio28", "gpio45", ++}; ++static const char * const wcss1_dbg24_groups[] = { ++ "gpio12", "gpio28", "gpio45", ++}; ++static const char * const wcss0_dbg25_groups[] = { ++ "gpio13", "gpio29", "gpio46", ++}; ++static const char * const wcss1_dbg25_groups[] = { ++ "gpio13", "gpio29", "gpio46", ++}; ++static const char * const wcss0_dbg26_groups[] = { ++ "gpio14", "gpio30", "gpio47", ++}; ++static const char * const wcss1_dbg26_groups[] = { ++ "gpio14", "gpio30", "gpio47", ++}; ++static const char * const wcss0_dbg_groups[] = { ++ "gpio15", "gpio69", ++}; ++static const char * const wcss1_dbg_groups[] = { ++ "gpio15", ++}; + static const char * const blsp_uart0_groups[] = { + "gpio16", "gpio17", "gpio60", "gpio61", + }; +-static const char * const blsp_spi1_groups[] = { +- "gpio44", "gpio45", "gpio46", "gpio47", ++static const char * const led0_groups[] = { ++ "gpio16", "gpio36", "gpio60", ++}; ++static const char * const wcss0_dbg28_groups[] = { ++ "gpio16", "gpio32", "gpio49", ++}; ++static const char * const wcss1_dbg28_groups[] = { ++ "gpio16", "gpio32", "gpio49", ++}; ++static const char * const led1_groups[] = { ++ "gpio17", "gpio37", "gpio61", ++}; ++static const char * const wcss0_dbg29_groups[] = { ++ "gpio17", "gpio33", "gpio50", ++}; ++static const char * const wcss1_dbg29_groups[] = { ++ "gpio17", "gpio33", "gpio50", ++}; ++static const char * const wifi0_uart1_groups[] = { ++ "gpio18", "gpio63", ++}; ++static const char * const wifi1_uart1_groups[] = { ++ "gpio18", "gpio63", ++}; ++static const char * const wcss0_dbg30_groups[] = { ++ "gpio18", "gpio34", "gpio51", ++}; ++static const char * const wcss1_dbg30_groups[] = { ++ "gpio18", "gpio34", "gpio51", ++}; ++static const char * const wcss0_dbg31_groups[] = { ++ "gpio19", "gpio35", "gpio52", ++}; ++static const char * const wcss1_dbg31_groups[] = { ++ "gpio19", "gpio35", ++}; ++static const char * const i2s_rx_mclk_groups[] = { ++ "gpio20", "gpio58", ++}; ++static const char * const wcss0_dbg16_groups[] = { ++ "gpio20", "gpio37", ++}; ++static const char * const wcss1_dbg16_groups[] = { ++ "gpio20", "gpio37", ++}; ++static const char * const wcss0_dbg17_groups[] = { ++ "gpio21", "gpio38", ++}; ++static const char * const wcss1_dbg17_groups[] = { ++ "gpio21", "gpio38", ++}; ++static const char * const rgmii0_groups[] = { ++ "gpio22", "gpio28", ++}; ++static const char * const sdio0_groups[] = { ++ "gpio23", ++}; ++static const char * const rgmii1_groups[] = { ++ "gpio23", "gpio29", ++}; ++static const char * const sdio1_groups[] = { ++ "gpio24", ++}; ++static const char * const rgmii2_groups[] = { ++ "gpio24", "gpio30", ++}; ++static const char * const i2s_tx_mclk_groups[] = { ++ "gpio24", "gpio52", ++}; ++static const char * const sdio2_groups[] = { ++ "gpio25", ++}; ++static const char * const rgmii3_groups[] = { ++ "gpio25", "gpio31", ++}; ++static const char * const i2s_tx_bclk_groups[] = { ++ "gpio25", "gpio53", "gpio60", ++}; ++static const char * const sdio3_groups[] = { ++ "gpio26", ++}; ++static const char * const rgmii_rx_groups[] = { ++ "gpio26", ++}; ++static const char * const i2s_tx_fsync_groups[] = { ++ "gpio26", "gpio57", "gpio61", ++}; ++static const char * const sdio_clk_groups[] = { ++ "gpio27", ++}; ++static const char * const rgmii_txc_groups[] = { ++ "gpio27", ++}; ++static const char * const i2s_td1_groups[] = { ++ "gpio27", "gpio54", "gpio63", ++}; ++static const char * const sdio_cmd_groups[] = { ++ "gpio28", ++}; ++static const char * const i2s_td2_groups[] = { ++ "gpio28", "gpio55", ++}; ++static const char * const sdio4_groups[] = { ++ "gpio29", ++}; ++static const char * const i2s_td3_groups[] = { ++ "gpio29", "gpio56", ++}; ++static const char * const sdio5_groups[] = { ++ "gpio30", ++}; ++static const char * const audio_pwm0_groups[] = { ++ "gpio30", "gpio64", ++}; ++static const char * const sdio6_groups[] = { ++ "gpio31", ++}; ++static const char * const audio_pwm1_groups[] = { ++ "gpio31", "gpio65", ++}; ++static const char * const wcss0_dbg27_groups[] = { ++ "gpio31", "gpio48", ++}; ++static const char * const wcss1_dbg27_groups[] = { ++ "gpio31", "gpio48", ++}; ++static const char * const sdio7_groups[] = { ++ "gpio32", ++}; ++static const char * const rgmii_rxc_groups[] = { ++ "gpio32", ++}; ++static const char * const audio_pwm2_groups[] = { ++ "gpio32", "gpio66", ++}; ++static const char * const rgmii_tx_groups[] = { ++ "gpio33", ++}; ++static const char * const audio_pwm3_groups[] = { ++ "gpio33", "gpio67", ++}; ++static const char * const boot2_groups[] = { ++ "gpio33", ++}; ++static const char * const i2s_spdif_in_groups[] = { ++ "gpio34", "gpio59", "gpio63", ++}; ++static const char * const i2s_spdif_out_groups[] = { ++ "gpio35", "gpio62", "gpio63", ++}; ++static const char * const rmii00_groups[] = { ++ "gpio36", "gpio41", ++}; ++static const char * const led2_groups[] = { ++ "gpio36", "gpio38", "gpio58", ++}; ++static const char * const rmii01_groups[] = { ++ "gpio37", "gpio42", ++}; ++static const char * const wifi0_wci_groups[] = { ++ "gpio37", ++}; ++static const char * const wifi1_wci_groups[] = { ++ "gpio37", ++}; ++static const char * const boot4_groups[] = { ++ "gpio37", ++}; ++static const char * const rmii0_tx_groups[] = { ++ "gpio38", ++}; ++static const char * const boot5_groups[] = { ++ "gpio38", ++}; ++static const char * const rmii0_rx_groups[] = { ++ "gpio39", ++}; ++static const char * const pcie_clk1_groups[] = { ++ "gpio39", ++}; ++static const char * const led3_groups[] = { ++ "gpio39", ++}; ++static const char * const sdio_cd_groups[] = { ++ "gpio22", + }; + + static const struct msm_function ipq4019_functions[] = { ++ FUNCTION(rmii0_refclk), ++ FUNCTION(wifi0_rfsilient0), ++ FUNCTION(wifi1_rfsilient0), ++ FUNCTION(smart2), ++ FUNCTION(led4), ++ FUNCTION(wifi0_cal), ++ FUNCTION(wifi1_cal), ++ FUNCTION(wifi_wci0), ++ FUNCTION(rmii0_dv), ++ FUNCTION(wifi_wci1), ++ FUNCTION(rmii1_refclk), ++ FUNCTION(blsp_spi1), ++ FUNCTION(led5), ++ FUNCTION(rmii10), ++ FUNCTION(led6), ++ FUNCTION(rmii11), ++ FUNCTION(led7), ++ FUNCTION(rmii1_dv), ++ FUNCTION(led8), ++ FUNCTION(rmii1_tx), ++ FUNCTION(aud_pin), ++ FUNCTION(led9), ++ FUNCTION(rmii1_rx), ++ FUNCTION(led10), ++ FUNCTION(wifi0_rfsilient1), ++ FUNCTION(wifi1_rfsilient1), ++ FUNCTION(led11), ++ FUNCTION(boot7), ++ FUNCTION(qpic_pad), ++ FUNCTION(pcie_clk), ++ FUNCTION(tm_clk0), ++ FUNCTION(wifi00), ++ FUNCTION(wifi10), ++ FUNCTION(mdio1), ++ FUNCTION(prng_rosc), ++ FUNCTION(dbg_out), ++ FUNCTION(tm0), ++ FUNCTION(wifi01), ++ FUNCTION(wifi11), ++ FUNCTION(atest_char3), ++ FUNCTION(pmu0), ++ FUNCTION(boot8), ++ FUNCTION(tm1), ++ FUNCTION(atest_char2), ++ FUNCTION(pmu1), ++ FUNCTION(boot9), ++ FUNCTION(tm2), ++ FUNCTION(atest_char1), ++ FUNCTION(tm_ack), ++ FUNCTION(wifi03), ++ FUNCTION(wifi13), ++ FUNCTION(qpic_pad4), ++ FUNCTION(atest_char0), ++ FUNCTION(tm3), ++ FUNCTION(wifi02), ++ FUNCTION(wifi12), ++ FUNCTION(qpic_pad5), ++ FUNCTION(smart3), ++ FUNCTION(wcss0_dbg14), ++ FUNCTION(tm4), ++ FUNCTION(wifi04), ++ FUNCTION(wifi14), ++ FUNCTION(qpic_pad6), ++ FUNCTION(wcss0_dbg15), ++ FUNCTION(qdss_tracectl_a), ++ FUNCTION(boot18), ++ FUNCTION(tm5), ++ FUNCTION(qpic_pad7), ++ FUNCTION(atest_char), ++ FUNCTION(wcss0_dbg4), ++ FUNCTION(qdss_traceclk_a), ++ FUNCTION(boot19), ++ FUNCTION(tm6), ++ FUNCTION(wcss0_dbg5), ++ FUNCTION(qdss_cti_trig_out_a0), ++ FUNCTION(boot14), ++ FUNCTION(tm7), ++ FUNCTION(chip_rst), ++ FUNCTION(wcss0_dbg6), ++ FUNCTION(qdss_cti_trig_out_b0), ++ FUNCTION(boot11), ++ FUNCTION(tm8), ++ FUNCTION(wcss0_dbg7), ++ FUNCTION(wcss1_dbg7), ++ FUNCTION(boot20), ++ FUNCTION(tm9), ++ FUNCTION(qpic_pad1), ++ FUNCTION(wcss0_dbg8), ++ FUNCTION(wcss1_dbg8), ++ FUNCTION(qpic_pad2), ++ FUNCTION(wcss0_dbg9), ++ FUNCTION(wcss1_dbg9), ++ FUNCTION(qpic_pad3), ++ FUNCTION(wcss0_dbg10), ++ FUNCTION(wcss1_dbg10), ++ FUNCTION(qpic_pad0), ++ FUNCTION(wcss0_dbg11), ++ FUNCTION(wcss1_dbg11), ++ FUNCTION(qpic_pad8), ++ FUNCTION(wcss0_dbg12), ++ FUNCTION(wcss1_dbg12), ++ FUNCTION(wifi034), ++ FUNCTION(wifi134), ++ FUNCTION(jtag_tdi), + FUNCTION(gpio), ++ FUNCTION(i2s_rx_bclk), ++ FUNCTION(jtag_tck), ++ FUNCTION(i2s_rx_fsync), ++ FUNCTION(jtag_tms), ++ FUNCTION(i2s_rxd), ++ FUNCTION(smart0), ++ FUNCTION(jtag_tdo), ++ FUNCTION(jtag_rst), ++ FUNCTION(jtag_trst), ++ FUNCTION(mdio0), ++ FUNCTION(wcss0_dbg18), ++ FUNCTION(wcss1_dbg18), ++ FUNCTION(qdss_tracedata_a), ++ FUNCTION(mdc), ++ FUNCTION(wcss0_dbg19), ++ FUNCTION(wcss1_dbg19), + FUNCTION(blsp_uart1), ++ FUNCTION(wifi0_uart), ++ FUNCTION(wifi1_uart), ++ FUNCTION(smart1), ++ FUNCTION(wcss0_dbg20), ++ FUNCTION(wcss1_dbg20), ++ FUNCTION(wifi0_uart0), ++ FUNCTION(wifi1_uart0), ++ FUNCTION(wcss0_dbg21), ++ FUNCTION(wcss1_dbg21), + FUNCTION(blsp_i2c0), ++ FUNCTION(wcss0_dbg22), ++ FUNCTION(wcss1_dbg22), ++ FUNCTION(wcss0_dbg23), ++ FUNCTION(wcss1_dbg23), ++ FUNCTION(blsp_spi0), + FUNCTION(blsp_i2c1), ++ FUNCTION(wcss0_dbg24), ++ FUNCTION(wcss1_dbg24), ++ FUNCTION(wcss0_dbg25), ++ FUNCTION(wcss1_dbg25), ++ FUNCTION(wcss0_dbg26), ++ FUNCTION(wcss1_dbg26), ++ FUNCTION(wcss0_dbg), ++ FUNCTION(wcss1_dbg), + FUNCTION(blsp_uart0), +- FUNCTION(blsp_spi1), +- FUNCTION(blsp_spi0), ++ FUNCTION(led0), ++ FUNCTION(wcss0_dbg28), ++ FUNCTION(wcss1_dbg28), ++ FUNCTION(led1), ++ FUNCTION(wcss0_dbg29), ++ FUNCTION(wcss1_dbg29), ++ FUNCTION(wifi0_uart1), ++ FUNCTION(wifi1_uart1), ++ FUNCTION(wcss0_dbg30), ++ FUNCTION(wcss1_dbg30), ++ FUNCTION(wcss0_dbg31), ++ FUNCTION(wcss1_dbg31), ++ FUNCTION(i2s_rx_mclk), ++ FUNCTION(wcss0_dbg16), ++ FUNCTION(wcss1_dbg16), ++ FUNCTION(wcss0_dbg17), ++ FUNCTION(wcss1_dbg17), ++ FUNCTION(rgmii0), ++ FUNCTION(sdio0), ++ FUNCTION(rgmii1), ++ FUNCTION(sdio1), ++ FUNCTION(rgmii2), ++ FUNCTION(i2s_tx_mclk), ++ FUNCTION(sdio2), ++ FUNCTION(rgmii3), ++ FUNCTION(i2s_tx_bclk), ++ FUNCTION(sdio3), ++ FUNCTION(rgmii_rx), ++ FUNCTION(i2s_tx_fsync), ++ FUNCTION(sdio_clk), ++ FUNCTION(rgmii_txc), ++ FUNCTION(i2s_td1), ++ FUNCTION(sdio_cmd), ++ FUNCTION(i2s_td2), ++ FUNCTION(sdio4), ++ FUNCTION(i2s_td3), ++ FUNCTION(sdio5), ++ FUNCTION(audio_pwm0), ++ FUNCTION(sdio6), ++ FUNCTION(audio_pwm1), ++ FUNCTION(wcss0_dbg27), ++ FUNCTION(wcss1_dbg27), ++ FUNCTION(sdio7), ++ FUNCTION(rgmii_rxc), ++ FUNCTION(audio_pwm2), ++ FUNCTION(rgmii_tx), ++ FUNCTION(audio_pwm3), ++ FUNCTION(boot2), ++ FUNCTION(i2s_spdif_in), ++ FUNCTION(i2s_spdif_out), ++ FUNCTION(rmii00), ++ FUNCTION(led2), ++ FUNCTION(rmii01), ++ FUNCTION(wifi0_wci), ++ FUNCTION(wifi1_wci), ++ FUNCTION(boot4), ++ FUNCTION(rmii0_tx), ++ FUNCTION(boot5), ++ FUNCTION(rmii0_rx), ++ FUNCTION(pcie_clk1), ++ FUNCTION(led3), ++ FUNCTION(sdio_cd), + }; + + static const struct msm_pingroup ipq4019_groups[] = { +- PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(8, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(9, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(16, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(17, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(20, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(21, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(22, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(23, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(24, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(25, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(27, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(28, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(29, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(34, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(35, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(44, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(45, NA, blsp_spi1, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(46, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(47, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(54, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(55, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(56, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(57, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(58, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(59, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(60, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(61, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(0, jtag_tdi, smart0, i2s_rx_bclk, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(1, jtag_tck, smart0, i2s_rx_fsync, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(2, jtag_tms, smart0, i2s_rxd, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(3, jtag_tdo, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(4, jtag_rst, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(5, jtag_trst, smart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(6, mdio0, NA, wcss0_dbg18, wcss1_dbg18, NA, qdss_tracedata_a, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(7, mdc, NA, wcss0_dbg19, wcss1_dbg19, NA, qdss_tracedata_a, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(8, blsp_uart1, wifi0_uart, wifi1_uart, smart1, NA, ++ wcss0_dbg20, wcss1_dbg20, NA, qdss_tracedata_a, NA, NA, NA, ++ NA, NA), ++ PINGROUP(9, blsp_uart1, wifi0_uart0, wifi1_uart0, smart1, wifi0_uart, ++ NA, wcss0_dbg21, wcss1_dbg21, NA, qdss_tracedata_a, NA, NA, ++ NA, NA), ++ PINGROUP(10, blsp_uart1, wifi0_uart0, wifi1_uart0, blsp_i2c0, NA, ++ wcss0_dbg22, wcss1_dbg22, NA, qdss_tracedata_a, NA, NA, NA, ++ NA, NA), ++ PINGROUP(11, blsp_uart1, wifi0_uart, wifi1_uart, blsp_i2c0, NA, ++ wcss0_dbg23, wcss1_dbg23, NA, qdss_tracedata_a, NA, NA, NA, ++ NA, NA), ++ PINGROUP(12, blsp_spi0, blsp_i2c1, NA, wcss0_dbg24, wcss1_dbg24, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(13, blsp_spi0, blsp_i2c1, NA, wcss0_dbg25, wcss1_dbg25, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(14, blsp_spi0, NA, wcss0_dbg26, wcss1_dbg26, NA, NA, NA, NA, ++ NA, NA, NA, NA, NA, NA), ++ PINGROUP(15, blsp_spi0, NA, wcss0_dbg, wcss1_dbg, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA, NA), ++ PINGROUP(16, blsp_uart0, led0, smart1, NA, wcss0_dbg28, wcss1_dbg28, ++ NA, qdss_tracedata_a, NA, NA, NA, NA, NA, NA), ++ PINGROUP(17, blsp_uart0, led1, smart1, NA, wcss0_dbg29, wcss1_dbg29, ++ NA, qdss_tracedata_a, NA, NA, NA, NA, NA, NA), ++ PINGROUP(18, wifi0_uart1, wifi1_uart1, NA, wcss0_dbg30, wcss1_dbg30, ++ NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(19, wifi0_uart, wifi1_uart, NA, wcss0_dbg31, wcss1_dbg31, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(20, blsp_i2c0, i2s_rx_mclk, NA, wcss0_dbg16, wcss1_dbg16, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(21, blsp_i2c0, i2s_rx_bclk, NA, wcss0_dbg17, wcss1_dbg17, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(22, rgmii0, i2s_rx_fsync, NA, wcss0_dbg18, wcss1_dbg18, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(23, sdio0, rgmii1, i2s_rxd, NA, wcss0_dbg19, wcss1_dbg19, NA, ++ NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(24, sdio1, rgmii2, i2s_tx_mclk, NA, wcss0_dbg20, wcss1_dbg20, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(25, sdio2, rgmii3, i2s_tx_bclk, NA, wcss0_dbg21, wcss1_dbg21, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(26, sdio3, rgmii_rx, i2s_tx_fsync, NA, wcss0_dbg22, ++ wcss1_dbg22, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(27, sdio_clk, rgmii_txc, i2s_td1, NA, wcss0_dbg23, ++ wcss1_dbg23, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(28, sdio_cmd, rgmii0, i2s_td2, NA, wcss0_dbg24, wcss1_dbg24, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(29, sdio4, rgmii1, i2s_td3, NA, wcss0_dbg25, wcss1_dbg25, NA, ++ NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(30, sdio5, rgmii2, audio_pwm0, NA, wcss0_dbg26, wcss1_dbg26, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(31, sdio6, rgmii3, audio_pwm1, NA, wcss0_dbg27, wcss1_dbg27, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(32, sdio7, rgmii_rxc, audio_pwm2, NA, wcss0_dbg28, ++ wcss1_dbg28, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(33, rgmii_tx, audio_pwm3, NA, wcss0_dbg29, wcss1_dbg29, NA, ++ boot2, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(34, blsp_i2c1, i2s_spdif_in, NA, wcss0_dbg30, wcss1_dbg30, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(35, blsp_i2c1, i2s_spdif_out, NA, wcss0_dbg31, wcss1_dbg31, ++ NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(36, rmii00, led2, led0, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(37, rmii01, wifi0_wci, wifi1_wci, led1, NA, NA, wcss0_dbg16, ++ wcss1_dbg16, NA, qdss_tracedata_a, boot4, NA, NA, NA), ++ PINGROUP(38, rmii0_tx, led2, NA, NA, wcss0_dbg17, wcss1_dbg17, NA, ++ qdss_tracedata_a, boot5, NA, NA, NA, NA, NA), ++ PINGROUP(39, rmii0_rx, pcie_clk1, led3, NA, NA, wcss0_dbg18, ++ wcss1_dbg18, NA, NA, qdss_tracedata_a, NA, NA, NA, NA), ++ PINGROUP(40, rmii0_refclk, wifi0_rfsilient0, wifi1_rfsilient0, smart2, ++ led4, NA, NA, wcss0_dbg19, wcss1_dbg19, NA, NA, ++ qdss_tracedata_a, NA, NA), ++ PINGROUP(41, rmii00, wifi0_cal, wifi1_cal, smart2, NA, NA, wcss0_dbg20, ++ wcss1_dbg20, NA, NA, qdss_tracedata_a, NA, NA, NA), ++ PINGROUP(42, rmii01, wifi_wci0, NA, NA, wcss0_dbg21, wcss1_dbg21, NA, ++ NA, qdss_tracedata_a, NA, NA, NA, NA, NA), ++ PINGROUP(43, rmii0_dv, wifi_wci1, NA, NA, wcss0_dbg22, wcss1_dbg22, NA, ++ NA, qdss_tracedata_a, NA, NA, NA, NA, NA), ++ PINGROUP(44, rmii1_refclk, blsp_spi1, smart0, led5, NA, NA, ++ wcss0_dbg23, wcss1_dbg23, NA, NA, NA, NA, NA, NA), ++ PINGROUP(45, rmii10, blsp_spi1, blsp_spi0, smart0, led6, NA, NA, ++ wcss0_dbg24, wcss1_dbg24, NA, NA, NA, NA, NA), ++ PINGROUP(46, rmii11, blsp_spi1, smart0, led7, NA, NA, wcss0_dbg25, ++ wcss1_dbg25, NA, NA, NA, NA, NA, NA), ++ PINGROUP(47, rmii1_dv, blsp_spi1, smart0, led8, NA, NA, wcss0_dbg26, ++ wcss1_dbg26, NA, NA, NA, NA, NA, NA), ++ PINGROUP(48, rmii1_tx, aud_pin, smart2, led9, NA, NA, wcss0_dbg27, ++ wcss1_dbg27, NA, NA, NA, NA, NA, NA), ++ PINGROUP(49, rmii1_rx, aud_pin, smart2, led10, NA, NA, wcss0_dbg28, ++ wcss1_dbg28, NA, NA, NA, NA, NA, NA), ++ PINGROUP(50, rmii10, aud_pin, wifi0_rfsilient1, wifi1_rfsilient1, ++ led11, NA, NA, wcss0_dbg29, wcss1_dbg29, NA, NA, NA, NA, NA), ++ PINGROUP(51, rmii11, aud_pin, wifi0_cal, wifi1_cal, NA, NA, ++ wcss0_dbg30, wcss1_dbg30, NA, boot7, NA, NA, NA, NA), ++ PINGROUP(52, qpic_pad, mdc, pcie_clk, i2s_tx_mclk, NA, NA, wcss0_dbg31, ++ tm_clk0, wifi00, wifi10, NA, NA, NA, NA), ++ PINGROUP(53, qpic_pad, mdio1, i2s_tx_bclk, prng_rosc, dbg_out, tm0, ++ wifi01, wifi11, NA, NA, NA, NA, NA, NA), ++ PINGROUP(54, qpic_pad, blsp_spi0, i2s_td1, atest_char3, pmu0, NA, NA, ++ boot8, tm1, NA, NA, NA, NA, NA), ++ PINGROUP(55, qpic_pad, blsp_spi0, i2s_td2, atest_char2, pmu1, NA, NA, ++ boot9, tm2, NA, NA, NA, NA, NA), ++ PINGROUP(56, qpic_pad, blsp_spi0, i2s_td3, atest_char1, NA, tm_ack, ++ wifi03, wifi13, NA, NA, NA, NA, NA, NA), ++ PINGROUP(57, qpic_pad4, blsp_spi0, i2s_tx_fsync, atest_char0, NA, tm3, ++ wifi02, wifi12, NA, NA, NA, NA, NA, NA), ++ PINGROUP(58, qpic_pad5, led2, blsp_i2c0, smart3, smart1, i2s_rx_mclk, ++ NA, wcss0_dbg14, tm4, wifi04, wifi14, NA, NA, NA), ++ PINGROUP(59, qpic_pad6, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA, ++ NA, wcss0_dbg15, qdss_tracectl_a, boot18, tm5, NA, NA, NA), ++ PINGROUP(60, qpic_pad7, blsp_uart0, smart1, smart3, led0, i2s_tx_bclk, ++ i2s_rx_bclk, atest_char, NA, wcss0_dbg4, qdss_traceclk_a, ++ boot19, tm6, NA), ++ PINGROUP(61, qpic_pad, blsp_uart0, smart1, smart3, led1, i2s_tx_fsync, ++ i2s_rx_fsync, NA, NA, wcss0_dbg5, qdss_cti_trig_out_a0, ++ boot14, tm7, NA), ++ PINGROUP(62, qpic_pad, chip_rst, wifi0_uart, wifi1_uart, i2s_spdif_out, ++ NA, NA, wcss0_dbg6, qdss_cti_trig_out_b0, boot11, tm8, NA, NA, ++ NA), ++ PINGROUP(63, qpic_pad, wifi0_uart1, wifi1_uart1, wifi1_uart, i2s_td1, ++ i2s_rxd, i2s_spdif_out, i2s_spdif_in, NA, wcss0_dbg7, ++ wcss1_dbg7, boot20, tm9, NA), ++ PINGROUP(64, qpic_pad1, audio_pwm0, NA, wcss0_dbg8, wcss1_dbg8, NA, NA, ++ NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(65, qpic_pad2, audio_pwm1, NA, wcss0_dbg9, wcss1_dbg9, NA, NA, ++ NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(66, qpic_pad3, audio_pwm2, NA, wcss0_dbg10, wcss1_dbg10, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(67, qpic_pad0, audio_pwm3, NA, wcss0_dbg11, wcss1_dbg11, NA, ++ NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(68, qpic_pad8, NA, wcss0_dbg12, wcss1_dbg12, NA, NA, NA, NA, ++ NA, NA, NA, NA, NA, NA), ++ PINGROUP(69, qpic_pad, NA, wcss0_dbg, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), + PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +@@ -433,7 +1526,8 @@ static const struct msm_pingroup ipq4019 + PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(98, wifi034, wifi134, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), + PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + }; + +@@ -460,6 +1554,7 @@ static const struct of_device_id ipq4019 + static struct platform_driver ipq4019_pinctrl_driver = { + .driver = { + .name = "ipq4019-pinctrl", ++ .owner = THIS_MODULE, + .of_match_table = ipq4019_pinctrl_of_match, + }, + .probe = ipq4019_pinctrl_probe, diff --git a/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch b/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch new file mode 100644 index 000000000..07cf01b26 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch @@ -0,0 +1,236 @@ +From e77af7de404eb464f7da9e0daeb8b362cc66a7ba Mon Sep 17 00:00:00 2001 +From: Ram Chandra Jangir +Date: Tue, 9 May 2017 11:45:00 +0530 +Subject: [PATCH] msm: pinctrl: Add support to configure ipq40xx GPIO_PULL bits + +GPIO_PULL bits configurations in TLMM_GPIO_CFG register +differs for IPQ40xx from rest of the other qcom SoC's. +This change add support to configure the msm_gpio_pull +bits for ipq40xx, It is required to fix the proper +configurations of gpio-pull bits for nand pins mux. + +IPQ40xx SoC: +2'b10: Internal pull up enable. +2'b11: Unsupport + +For other SoC's: +2'b10: Keeper +2'b11: Pull-Up + +Signed-off-by: Ram Chandra Jangir +--- + drivers/pinctrl/qcom/pinctrl-apq8064.c | 1 + + drivers/pinctrl/qcom/pinctrl-apq8084.c | 1 + + drivers/pinctrl/qcom/pinctrl-ipq4019.c | 8 ++++++++ + drivers/pinctrl/qcom/pinctrl-ipq8064.c | 1 + + drivers/pinctrl/qcom/pinctrl-mdm9615.c | 1 + + drivers/pinctrl/qcom/pinctrl-msm.c | 21 ++++++++------------- + drivers/pinctrl/qcom/pinctrl-msm.h | 19 +++++++++++++++++++ + drivers/pinctrl/qcom/pinctrl-msm8660.c | 1 + + drivers/pinctrl/qcom/pinctrl-msm8916.c | 1 + + drivers/pinctrl/qcom/pinctrl-msm8960.c | 1 + + drivers/pinctrl/qcom/pinctrl-msm8x74.c | 1 + + 11 files changed, 43 insertions(+), 13 deletions(-) + +--- a/drivers/pinctrl/qcom/pinctrl-apq8064.c ++++ b/drivers/pinctrl/qcom/pinctrl-apq8064.c +@@ -597,6 +597,7 @@ static const struct msm_pinctrl_soc_data + .groups = apq8064_groups, + .ngroups = ARRAY_SIZE(apq8064_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int apq8064_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-apq8084.c ++++ b/drivers/pinctrl/qcom/pinctrl-apq8084.c +@@ -1206,6 +1206,7 @@ static const struct msm_pinctrl_soc_data + .groups = apq8084_groups, + .ngroups = ARRAY_SIZE(apq8084_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int apq8084_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c ++++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +@@ -1531,6 +1531,13 @@ static const struct msm_pingroup ipq4019 + PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + }; + ++static const struct msm_pinctrl_gpio_pull ipq4019_gpio_pull = { ++ .no_pull = 0, ++ .pull_down = 1, ++ .keeper = 0, ++ .pull_up = 2, ++}; ++ + static const struct msm_pinctrl_soc_data ipq4019_pinctrl = { + .pins = ipq4019_pins, + .npins = ARRAY_SIZE(ipq4019_pins), +@@ -1539,6 +1546,7 @@ static const struct msm_pinctrl_soc_data + .groups = ipq4019_groups, + .ngroups = ARRAY_SIZE(ipq4019_groups), + .ngpios = 100, ++ .gpio_pull = &ipq4019_gpio_pull, + }; + + static int ipq4019_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-ipq8064.c ++++ b/drivers/pinctrl/qcom/pinctrl-ipq8064.c +@@ -630,6 +630,7 @@ static const struct msm_pinctrl_soc_data + .groups = ipq8064_groups, + .ngroups = ARRAY_SIZE(ipq8064_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int ipq8064_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-mdm9615.c ++++ b/drivers/pinctrl/qcom/pinctrl-mdm9615.c +@@ -444,6 +444,7 @@ static const struct msm_pinctrl_soc_data + .groups = mdm9615_groups, + .ngroups = ARRAY_SIZE(mdm9615_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int mdm9615_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-msm.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm.c +@@ -203,11 +203,6 @@ static int msm_config_reg(struct msm_pin + return 0; + } + +-#define MSM_NO_PULL 0 +-#define MSM_PULL_DOWN 1 +-#define MSM_KEEPER 2 +-#define MSM_PULL_UP 3 +- + static unsigned msm_regval_to_drive(u32 val) + { + return (val + 1) * 2; +@@ -238,16 +233,16 @@ static int msm_config_group_get(struct p + /* Convert register value to pinconf value */ + switch (param) { + case PIN_CONFIG_BIAS_DISABLE: +- arg = arg == MSM_NO_PULL; ++ arg = arg == pctrl->soc->gpio_pull->no_pull; + break; + case PIN_CONFIG_BIAS_PULL_DOWN: +- arg = arg == MSM_PULL_DOWN; ++ arg = arg == pctrl->soc->gpio_pull->pull_down; + break; + case PIN_CONFIG_BIAS_BUS_HOLD: +- arg = arg == MSM_KEEPER; ++ arg = arg == pctrl->soc->gpio_pull->keeper; + break; + case PIN_CONFIG_BIAS_PULL_UP: +- arg = arg == MSM_PULL_UP; ++ arg = arg == pctrl->soc->gpio_pull->pull_up; + break; + case PIN_CONFIG_DRIVE_STRENGTH: + arg = msm_regval_to_drive(arg); +@@ -304,16 +299,16 @@ static int msm_config_group_set(struct p + /* Convert pinconf values to register values */ + switch (param) { + case PIN_CONFIG_BIAS_DISABLE: +- arg = MSM_NO_PULL; ++ arg = pctrl->soc->gpio_pull->no_pull; + break; + case PIN_CONFIG_BIAS_PULL_DOWN: +- arg = MSM_PULL_DOWN; ++ arg = pctrl->soc->gpio_pull->pull_down; + break; + case PIN_CONFIG_BIAS_BUS_HOLD: +- arg = MSM_KEEPER; ++ arg = pctrl->soc->gpio_pull->keeper; + break; + case PIN_CONFIG_BIAS_PULL_UP: +- arg = MSM_PULL_UP; ++ arg = pctrl->soc->gpio_pull->pull_up; + break; + case PIN_CONFIG_DRIVE_STRENGTH: + /* Check for invalid values */ +--- a/drivers/pinctrl/qcom/pinctrl-msm.h ++++ b/drivers/pinctrl/qcom/pinctrl-msm.h +@@ -98,6 +98,16 @@ struct msm_pingroup { + }; + + /** ++ * struct msm_pinctrl_gpio_pull - pinctrl pull value bit field descriptor ++ */ ++struct msm_pinctrl_gpio_pull { ++ unsigned no_pull; ++ unsigned pull_down; ++ unsigned keeper; ++ unsigned pull_up; ++}; ++ ++/** + * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration + * @pins: An array describing all pins the pin controller affects. + * @npins: The number of entries in @pins. +@@ -106,6 +116,7 @@ struct msm_pingroup { + * @groups: An array describing all pin groups the pin SoC supports. + * @ngroups: The numbmer of entries in @groups. + * @ngpio: The number of pingroups the driver should expose as GPIOs. ++ * @gpio_pull_val: The pull value bit field descriptor. + */ + struct msm_pinctrl_soc_data { + const struct pinctrl_pin_desc *pins; +@@ -115,6 +126,14 @@ struct msm_pinctrl_soc_data { + const struct msm_pingroup *groups; + unsigned ngroups; + unsigned ngpios; ++ const struct msm_pinctrl_gpio_pull *gpio_pull; ++}; ++ ++static const struct msm_pinctrl_gpio_pull msm_gpio_pull = { ++ .no_pull = 0, ++ .pull_down = 1, ++ .keeper = 2, ++ .pull_up = 3, + }; + + int msm_pinctrl_probe(struct platform_device *pdev, +--- a/drivers/pinctrl/qcom/pinctrl-msm8660.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm8660.c +@@ -979,6 +979,7 @@ static const struct msm_pinctrl_soc_data + .groups = msm8660_groups, + .ngroups = ARRAY_SIZE(msm8660_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int msm8660_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-msm8916.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm8916.c +@@ -967,6 +967,7 @@ static const struct msm_pinctrl_soc_data + .groups = msm8916_groups, + .ngroups = ARRAY_SIZE(msm8916_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int msm8916_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-msm8960.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm8960.c +@@ -1244,6 +1244,7 @@ static const struct msm_pinctrl_soc_data + .groups = msm8960_groups, + .ngroups = ARRAY_SIZE(msm8960_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int msm8960_pinctrl_probe(struct platform_device *pdev) +--- a/drivers/pinctrl/qcom/pinctrl-msm8x74.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm8x74.c +@@ -1069,6 +1069,7 @@ static const struct msm_pinctrl_soc_data + .groups = msm8x74_groups, + .ngroups = ARRAY_SIZE(msm8x74_groups), + .ngpios = NUM_GPIO_PINGROUPS, ++ .gpio_pull = &msm_gpio_pull, + }; + + static int msm8x74_pinctrl_probe(struct platform_device *pdev) diff --git a/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch index 9ea46c9d4..62153b3cd 100644 --- a/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch +++ b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch @@ -15,17 +15,78 @@ Signed-off-by: Ram Chandra Jangir --- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -@@ -88,6 +88,26 @@ +@@ -88,6 +88,86 @@ bias-disable; }; }; + + nand_pins: nand_pins { + ++ mux_1 { ++ pins = "gpio52", "gpio53", "gpio54", ++ "gpio55", "gpio56", "gpio61", ++ "gpio62", "gpio63", "gpio69"; ++ function = "qpic_pad"; ++ bias-disable; ++ }; ++ ++ mux_2 { ++ pins = "gpio67"; ++ function = "qpic_pad0"; ++ bias-disable; ++ }; ++ ++ mux_3 { ++ pins = "gpio64"; ++ function = "qpic_pad1"; ++ bias-disable; ++ }; ++ ++ mux_4 { ++ pins = "gpio65"; ++ function = "qpic_pad2"; ++ bias-disable; ++ }; ++ ++ mux_5 { ++ pins = "gpio66"; ++ function = "qpic_pad3"; ++ bias-disable; ++ }; ++ ++ mux_6 { ++ pins = "gpio57"; ++ function = "qpic_pad4"; ++ bias-disable; ++ }; ++ ++ mux_7 { ++ pins = "gpio58"; ++ function = "qpic_pad5"; ++ bias-disable; ++ }; ++ ++ mux_8 { ++ pins = "gpio59"; ++ function = "qpic_pad6"; ++ bias-disable; ++ }; ++ ++ mux_9 { ++ pins = "gpio60"; ++ function = "qpic_pad7"; ++ bias-disable; ++ }; ++ ++ mux_10 { ++ pins = "gpio68"; ++ function = "qpic_pad8"; ++ bias-disable; ++ }; ++ + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; -+ function = "qpic"; + bias-pull-up; + }; + @@ -35,14 +96,13 @@ Signed-off-by: Ram Chandra Jangir + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio68", "gpio69"; -+ function = "qpic"; + bias-pull-down; + }; + }; }; blsp_dma: dma@7884000 { -@@ -159,5 +179,15 @@ +@@ -159,5 +239,15 @@ watchdog@b017000 { status = "ok"; }; @@ -60,7 +120,7 @@ Signed-off-by: Ram Chandra Jangir }; --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -609,5 +609,43 @@ +@@ -586,5 +586,43 @@ "legacy"; status = "disabled"; }; diff --git a/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch b/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch new file mode 100644 index 000000000..220503bda --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch @@ -0,0 +1,44 @@ +From patchwork Mon Jul 3 07:47:12 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v3,1/2] dts: ipq4019: Fix pinctrl node name +From: Varadarajan Narayanan +X-Patchwork-Id: 9822099 +Message-Id: <1499068033-24000-2-git-send-email-varada@codeaurora.org> +To: andy.gross@linaro.org, david.brown@linaro.org, robh+dt@kernel.org, + mark.rutland@arm.com, linux@armlinux.org.uk, + linux-arm-msm@vger.kernel.org, + linux-soc@vger.kernel.org, devicetree@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org +Cc: Varadarajan Narayanan +Date: Mon, 3 Jul 2017 13:17:12 +0530 + +Signed-off-by: Varadarajan Narayanan +--- + arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 2 +- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -40,7 +40,7 @@ + clock-frequency = <48000000>; + }; + +- pinctrl@0x01000000 { ++ pinctrl@1000000 { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -155,7 +155,7 @@ + reg = <0x1800000 0x60000>; + }; + +- tlmm: pinctrl@0x01000000 { ++ tlmm: pinctrl@1000000 { + compatible = "qcom,ipq4019-pinctrl"; + reg = <0x01000000 0x300000>; + gpio-controller; diff --git a/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch new file mode 100644 index 000000000..da3b2c694 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch @@ -0,0 +1,78 @@ +From patchwork Mon Jul 3 07:47:13 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [v3,2/2] dts: ipq4019: Move xo and timer nodes to SoC dtsi +From: Varadarajan Narayanan +X-Patchwork-Id: 9822107 +Message-Id: <1499068033-24000-3-git-send-email-varada@codeaurora.org> +To: andy.gross@linaro.org, david.brown@linaro.org, robh+dt@kernel.org, + mark.rutland@arm.com, linux@armlinux.org.uk, + linux-arm-msm@vger.kernel.org, + linux-soc@vger.kernel.org, devicetree@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org +Cc: Varadarajan Narayanan +Date: Mon, 3 Jul 2017 13:17:13 +0530 + +The node for xo and timer belong to the SoC DTS file. +Else, new board DT files may not inherit these nodes. + +Signed-off-by: Varadarajan Narayanan +--- + arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 19 ------------------- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 15 +++++++++++++++ + 2 files changed, 15 insertions(+), 19 deletions(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -20,26 +20,7 @@ + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; + compatible = "qcom,ipq4019"; + +- clocks { +- xo: xo { +- compatible = "fixed-clock"; +- clock-frequency = <48000000>; +- #clock-cells = <0>; +- }; +- }; +- + soc { +- +- +- timer { +- compatible = "arm,armv7-timer"; +- interrupts = <1 2 0xf08>, +- <1 3 0xf08>, +- <1 4 0xf08>, +- <1 1 0xf08>; +- clock-frequency = <48000000>; +- }; +- + pinctrl@1000000 { + serial_pins: serial_pinmux { + mux { +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -132,6 +132,21 @@ + clock-frequency = <32768>; + #clock-cells = <0>; + }; ++ ++ xo: xo { ++ compatible = "fixed-clock"; ++ clock-frequency = <48000000>; ++ #clock-cells = <0>; ++ }; ++ }; ++ ++ timer { ++ compatible = "arm,armv7-timer"; ++ interrupts = <1 2 0xf08>, ++ <1 3 0xf08>, ++ <1 4 0xf08>, ++ <1 1 0xf08>; ++ clock-frequency = <48000000>; + }; + + soc { diff --git a/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch b/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch new file mode 100644 index 000000000..f2de6d618 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi +@@ -38,7 +38,7 @@ + clock-frequency = <48000000>; + }; + +- pinctrl@0x01000000 { ++ pinctrl@1000000 { + serial_0_pins: serial_pinmux { + mux { + pins = "gpio16", "gpio17"; diff --git a/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch b/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch new file mode 100644 index 000000000..dcbdb8d77 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch @@ -0,0 +1,27 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi +@@ -20,24 +20,7 @@ + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK04.1"; + compatible = "qcom,ipq4019"; + +- clocks { +- xo: xo { +- compatible = "fixed-clock"; +- clock-frequency = <48000000>; +- #clock-cells = <0>; +- }; +- }; +- + soc { +- timer { +- compatible = "arm,armv7-timer"; +- interrupts = <1 2 0xf08>, +- <1 3 0xf08>, +- <1 4 0xf08>, +- <1 1 0xf08>; +- clock-frequency = <48000000>; +- }; +- + pinctrl@1000000 { + serial_0_pins: serial_pinmux { + mux { diff --git a/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch new file mode 100644 index 000000000..9d11dc022 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch @@ -0,0 +1,42 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -15,12 +15,39 @@ + */ + + #include "qcom-ipq4019.dtsi" ++#include + + / { + model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; + compatible = "qcom,ipq4019"; + + soc { ++ tcsr@194b000 { ++ /* select hostmode */ ++ compatible = "qcom,tcsr"; ++ reg = <0x194b000 0x100>; ++ qcom,usb-hsphy-mode-select = ; ++ status = "ok"; ++ }; ++ ++ ess_tcsr@1953000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1953000 0x1000>; ++ qcom,ess-interface-select = ; ++ }; ++ ++ tcsr@1949000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1949000 0x100>; ++ qcom,wifi_glb_cfg = ; ++ }; ++ ++ tcsr@1957000 { ++ compatible = "qcom,tcsr"; ++ reg = <0x1957000 0x100>; ++ qcom,wifi_noc_memtype_m0_m2 = ; ++ }; ++ + pinctrl@1000000 { + serial_pins: serial_pinmux { + mux { diff --git a/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch new file mode 100644 index 000000000..02a102e37 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch @@ -0,0 +1,32 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -136,5 +136,29 @@ + usb2: usb2@60f8800 { + status = "ok"; + }; ++ ++ mdio@90000 { ++ status = "okay"; ++ }; ++ ++ ess-switch@c000000 { ++ status = "okay"; ++ }; ++ ++ ess-psgmii@98000 { ++ status = "okay"; ++ }; ++ ++ edma@c080000 { ++ status = "okay"; ++ }; ++ ++ wifi@a000000 { ++ status = "okay"; ++ }; ++ ++ wifi@a800000 { ++ status = "okay"; ++ }; + }; + }; diff --git a/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch new file mode 100644 index 000000000..0d4b80b30 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch @@ -0,0 +1,17 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -89,14 +89,6 @@ + pinctrl-names = "default"; + status = "ok"; + cs-gpios = <&tlmm 54 0>; +- +- mx25l25635e@0 { +- #address-cells = <1>; +- #size-cells = <1>; +- reg = <0>; +- compatible = "mx25l25635e"; +- spi-max-frequency = <24000000>; +- }; + }; + + serial@78af000 { diff --git a/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch b/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch new file mode 100644 index 000000000..33f7f04f3 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch @@ -0,0 +1,13 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -108,8 +108,8 @@ + opp-hz = /bits/ 64 <500000000>; + clock-latency-ns = <256000>; + }; +- opp@666000000 { +- opp-hz = /bits/ 64 <666000000>; ++ opp@716800000 { ++ opp-hz = /bits/ 64 <716800000>; + clock-latency-ns = <256000>; + }; + }; diff --git a/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch b/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch new file mode 100644 index 000000000..e9d262069 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch @@ -0,0 +1,115 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts +@@ -19,4 +19,112 @@ + / { + model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1"; + ++ memory { ++ device_type = "memory"; ++ reg = <0x80000000 0x10000000>; ++ }; ++ ++ reserved-memory { ++ #address-cells = <0x1>; ++ #size-cells = <0x1>; ++ ranges; ++ ++ apps_bl@87000000 { ++ reg = <0x87000000 0x400000>; ++ no-map; ++ }; ++ ++ sbl@87400000 { ++ reg = <0x87400000 0x100000>; ++ no-map; ++ }; ++ ++ cnss_debug@87500000 { ++ reg = <0x87500000 0x600000>; ++ no-map; ++ }; ++ ++ cpu_context_dump@87b00000 { ++ reg = <0x87b00000 0x080000>; ++ no-map; ++ }; ++ ++ tz_apps@87b80000 { ++ reg = <0x87b80000 0x280000>; ++ no-map; ++ }; ++ ++ smem@87e00000 { ++ reg = <0x87e00000 0x080000>; ++ no-map; ++ }; ++ ++ tz@87e80000 { ++ reg = <0x87e80000 0x180000>; ++ no-map; ++ }; ++ }; ++}; ++ ++&spi_0 { ++ mx25l25635f@0 { ++ compatible = "mx25l25635f", "jedec,spi-nor"; ++ #address-cells = <1>; ++ #size-cells = <1>; ++ reg = <0>; ++ spi-max-frequency = <24000000>; ++ ++ SBL1@0 { ++ label = "SBL1"; ++ reg = <0x0 0x40000>; ++ read-only; ++ }; ++ MIBIB@40000 { ++ label = "MIBIB"; ++ reg = <0x40000 0x20000>; ++ read-only; ++ }; ++ QSEE@60000 { ++ label = "QSEE"; ++ reg = <0x60000 0x60000>; ++ read-only; ++ }; ++ CDT@c0000 { ++ label = "CDT"; ++ reg = <0xc0000 0x10000>; ++ read-only; ++ }; ++ DDRPARAMS@d0000 { ++ label = "DDRPARAMS"; ++ reg = <0xd0000 0x10000>; ++ read-only; ++ }; ++ APPSBLENV@e0000 { ++ label = "APPSBLENV"; ++ reg = <0xe0000 0x10000>; ++ read-only; ++ }; ++ APPSBL@f0000 { ++ label = "APPSBL"; ++ reg = <0xf0000 0x80000>; ++ read-only; ++ }; ++ ART@170000 { ++ label = "ART"; ++ reg = <0x170000 0x10000>; ++ read-only; ++ }; ++ kernel@180000 { ++ label = "kernel"; ++ reg = <0x180000 0x400000>; ++ }; ++ rootfs@580000 { ++ label = "rootfs"; ++ reg = <0x580000 0x1600000>; ++ }; ++ firmware@180000 { ++ label = "firmware"; ++ reg = <0x180000 0x1a00000>; ++ }; ++ }; + }; diff --git a/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch b/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch new file mode 100644 index 000000000..2d4ff3104 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts +@@ -18,6 +18,7 @@ + + / { + model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1"; ++ compatible = "qcom,ap-dk01.1-c1", "qcom,ap-dk01.2-c1", "qcom,ipq4019"; + + memory { + device_type = "memory"; diff --git a/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch b/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch index 9e71051d3..6046d6cde 100644 --- a/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch +++ b/target/linux/lantiq/patches-4.9/0026-NET-multi-phy-support.patch @@ -43,7 +43,7 @@ Signed-off-by: John Crispin } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -373,6 +373,7 @@ struct phy_device { +@@ -369,6 +369,7 @@ struct phy_device { bool is_pseudo_fixed_link; bool has_fixups; bool suspended; diff --git a/target/linux/layerscape/README b/target/linux/layerscape/README new file mode 100644 index 000000000..eaeee32e8 --- /dev/null +++ b/target/linux/layerscape/README @@ -0,0 +1,151 @@ + +Layerscape Quick Start + +1. Layerscape target support +---------------------------- +* ARMv8 64-bit + LS1012ARDB LS1012AFRDM LS1043ARDB LS1046ARDB LS1088ARDB LS2088ARDB + +* ARMv8 32-bit + LS1012ARDB LS1012AFRDM LS1043ARDB LS1046ARDB + + +2. Build +-------- + +2.1 make menuconfig +------------------- +* For single device + + Target System: "NXP Layerscape". + Subtarget: "ARMv8 64-bit based boards" or "ARMv8 32-bit based boards" + Target Profile: (select device you want to build) + + For example, build firmware for 64-bit ls1043ardb. + +---------------------------------------------+ + | Target System (NXP Layerscape) ---> | + |---------------------------------------------| + | Subtarget (ARMv8 64-bit based boards) ---> | + |---------------------------------------------| + | Target Profile (ls1043ardb-armv8_64b) ---> | + +---------------------------------------------+ + +* For multiple devices + + Target System: "NXP Layerscape". + Subtarget: "ARMv8 64-bit based boards" or "ARMv8 32-bit based boards" + Target Profile: "Multiple devices" + Target Devices: (select devices you want to build) + + For example, build firmware for all 64-bit devices. + Target Devices ---> + +-----------------------------------------------------------------+ + | [*] Enable all profiles by default | + |-----------------------------------------------------------------| + | [ ] Use a per-device root filesystem that adds profile packages | + |-----------------------------------------------------------------| + | [*] ls1012afrdm-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1012ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1043ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1046ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls1088ardb-armv8_64b ---- | + |-----------------------------------------------------------------| + | [*] ls2088ardb-armv8_64b ---- | + +-----------------------------------------------------------------+ + + Note: per-device root filesystem hasn't been supported for now. + +2.2 make (or make -j) +------------------------ + +2.3 Final firmware +------------------ +Final firmware would be in bin/targets/layerscape//, and +named as lede-layerscape---squashfs-firmware.bin. + + +3. Program firmware to NOR/QSPI flash +------------------------------------- +* LS1043ARDB (NOR flash) + + Start up from bank0, and program firmware to bank4 with below commands. + Switch to bank4 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => protect off all + => erase 64000000 +$filesize + => cp.b a0000000 64000000 $filesize + => cpld reset altbank + +* LS2088ARDB (NOR flash) + + Start up from bank0, and program firmware to bank4 with below commands. + Switch to bank4 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => protect off all + => erase 584000000 +$filesize + => cp.b a0000000 584000000 $filesize + => qix altbank + +* LS1012ARDB (QSPI flash) + + Start up from bank1, and program firmware to bank2 with below commands. + Switch to bank2 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => i2c mw 0x24 0x7 0xfc;i2c mw 0x24 0x3 0xf5 + => sf probe 0:0 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => reset + +* LS1012AFRDM (QSPI flash) + + LS1012AFRDM board only has one bank. Start up board, and program firmware + with below commands. Reset to start up LEDE. + + => tftp 96000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:0 + => sf erase 0 +$filesize + => sf write 96000000 0 $filesize + => reset + +* LS1046ARDB (QSPI flash) + + Start up from bank1, and program firmware to bank2 with below commands. + Switch to bank2 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:1 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => cpld reset altbank + +* LS1088ARDB (QSPI flash) + + Start up from bank0, and program firmware to bank1 with below commands. + Switch to bank1 to start up LEDE. + + => tftp a0000000 lede-layerscape---squashfs-firmware.bin + => sf probe 0:1 + => sf erase 0 +$filesize + => sf write a0000000 0 $filesize + => qix altbank + + Note: old version u-boot of ls1088ardb may use below commands to switch to + bank1 instead of 'qix altbank'. + => i2c mw 66 50 20;i2c mw 66 10 20;i2c mw 66 10 21 + + +4. Other references and sources +------------------------------- +- NXP LSDK site: https://lsdk.github.io/ + +- NXP LSDK github: https://github.com/qoriq-open-source + +- LEDE documentation: https://lede-project.org/docs/start diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index f0687f380..9e5b33b88 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -2,7 +2,6 @@ CONFIG_ABX500_CORE=y CONFIG_AD525X_DPOT=y CONFIG_AD525X_DPOT_I2C=y # CONFIG_AD525X_DPOT_SPI is not set -CONFIG_ADVISE_SYSCALLS=y CONFIG_AHCI_IMX=y CONFIG_AHCI_QORIQ=y CONFIG_AK8975=y @@ -11,6 +10,7 @@ CONFIG_APDS9802ALS=y CONFIG_AQUANTIA_PHY=y # CONFIG_ARCH_AXXIA is not set CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_HAS_BANDGAP=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y @@ -254,7 +254,6 @@ CONFIG_CROSS_MEMORY_ATTACH=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y # CONFIG_CRYPTO_AES_ARM_CE is not set -# CONFIG_CRYPTO_ARC4 is not set CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRC32C=y @@ -304,7 +303,6 @@ CONFIG_DEBUG_RODATA=y # CONFIG_DEBUG_USER is not set CONFIG_DECOMPRESS_BZIP2=y CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y @@ -450,6 +448,9 @@ CONFIG_FSL_EDMA=y CONFIG_FSL_FM_MAX_FRAME_SIZE=1522 CONFIG_FSL_FM_RX_EXTRA_HEADROOM=64 CONFIG_FSL_GUTS=y +CONFIG_FSL_IFC=y +CONFIG_FSL_PPFE=y +CONFIG_FSL_PPFE_UTIL_DISABLED=y CONFIG_FSL_PQ_MDIO=y # CONFIG_FSL_QDMA is not set CONFIG_FSL_QMAN_CI_SCHED_CFG_BMAN_W=2 @@ -524,7 +525,6 @@ CONFIG_GPIO_TPS6586X=y CONFIG_GPIO_TPS65910=y CONFIG_GPIO_TWL4030=y CONFIG_GPIO_XILINX=y -CONFIG_GRACE_PERIOD=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y CONFIG_HAS_DMA=y @@ -669,11 +669,6 @@ CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_IO_PGTABLE_LPAE is not set CONFIG_IOMMU_SUPPORT=y CONFIG_IOSCHED_CFQ=y -CONFIG_IP6_NF_FILTER=y -CONFIG_IP6_NF_IPTABLES=y -CONFIG_IP6_NF_NAT=y -CONFIG_IP6_NF_TARGET_MASQUERADE=y -# CONFIG_IP6_NF_TARGET_NPT is not set CONFIG_IPC_NS=y CONFIG_IPV6=y CONFIG_IPV6_MULTIPLE_TABLES=y @@ -683,39 +678,10 @@ CONFIG_IPV6_SIT=y # CONFIG_IPV6_SUBTREES is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_MROUTE is not set -CONFIG_IP_NF_FILTER=y -CONFIG_IP_NF_IPTABLES=y -CONFIG_IP_NF_MANGLE=y -CONFIG_IP_NF_NAT=y -CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_DHCP=y CONFIG_IP_PNP_RARP=y -CONFIG_IP_VS=y -# CONFIG_IP_VS_DEBUG is not set -# CONFIG_IP_VS_DH is not set -# CONFIG_IP_VS_FO is not set -# CONFIG_IP_VS_IPV6 is not set -# CONFIG_IP_VS_LBLC is not set -# CONFIG_IP_VS_LBLCR is not set -# CONFIG_IP_VS_LC is not set -# CONFIG_IP_VS_NFCT is not set -# CONFIG_IP_VS_NQ is not set -# CONFIG_IP_VS_OVF is not set -# CONFIG_IP_VS_PROTO_AH is not set -# CONFIG_IP_VS_PROTO_AH_ESP is not set -# CONFIG_IP_VS_PROTO_ESP is not set -# CONFIG_IP_VS_PROTO_SCTP is not set -# CONFIG_IP_VS_PROTO_TCP is not set -# CONFIG_IP_VS_PROTO_UDP is not set -# CONFIG_IP_VS_RR is not set -# CONFIG_IP_VS_SED is not set -# CONFIG_IP_VS_SH is not set -CONFIG_IP_VS_SH_TAB_BITS=8 -CONFIG_IP_VS_TAB_BITS=12 -# CONFIG_IP_VS_WLC is not set -# CONFIG_IP_VS_WRR is not set CONFIG_IRQCHIP=y CONFIG_IRQ_CROSSBAR=y CONFIG_IRQ_DOMAIN=y @@ -726,7 +692,6 @@ CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_ISL29003=y CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set CONFIG_KALLSYMS=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_XZ is not set @@ -759,14 +724,14 @@ CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LIBFDT=y CONFIG_LOCALVERSION_AUTO=y -CONFIG_LOCKD=y CONFIG_LOCKUP_DETECTOR=y CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LOGO=y CONFIG_LOGO_LINUX_CLUT224=y CONFIG_LOGO_LINUX_MONO=y CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZ4_DECOMPRESS=y +CONFIG_LS_SCFG_MSI=y +# CONFIG_LS_SOC_DRIVERS is not set CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y @@ -878,8 +843,10 @@ CONFIG_MTD_NAND_BRCMNAND=y CONFIG_MTD_NAND_DENALI=y CONFIG_MTD_NAND_DENALI_DT=y CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SST25L=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 @@ -896,49 +863,11 @@ CONFIG_NAMESPACES=y CONFIG_NATIONAL_PHY=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEON=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y -CONFIG_NETFILTER_XT_MATCH_COMMENT=y -CONFIG_NETFILTER_XT_MATCH_CONNTRACK=y -CONFIG_NETFILTER_XT_MATCH_IPVS=y -CONFIG_NETFILTER_XT_NAT=y -CONFIG_NETFILTER_XT_TARGET_CHECKSUM=y -CONFIG_NETLINK_DIAG=y # CONFIG_NET_CLS_CGROUP is not set CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_INGRESS=y CONFIG_NET_IP_TUNNEL=y -CONFIG_NET_KEY=y CONFIG_NET_NS=y -CONFIG_NET_PACKET_ENGINE=y CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_SWITCHDEV=y -# CONFIG_NET_VENDOR_AURORA is not set -CONFIG_NFS_ACL_SUPPORT=y -CONFIG_NFS_FS=y -CONFIG_NFS_USE_KERNEL_DNS=y -# CONFIG_NFS_USE_LEGACY_DNS is not set -CONFIG_NFS_V2=y -CONFIG_NFS_V3_ACL=y -CONFIG_NFS_V4=y -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_IPV4=y -CONFIG_NF_CONNTRACK_IPV6=y -CONFIG_NF_CONNTRACK_MARK=y -# CONFIG_NF_CONNTRACK_RTCACHE is not set -CONFIG_NF_DEFRAG_IPV4=y -CONFIG_NF_DEFRAG_IPV6=y -# CONFIG_NF_LOG_IPV6 is not set -CONFIG_NF_NAT=y -CONFIG_NF_NAT_IPV4=y -CONFIG_NF_NAT_IPV6=y -CONFIG_NF_NAT_MASQUERADE_IPV4=y -CONFIG_NF_NAT_MASQUERADE_IPV6=y -CONFIG_NF_NAT_NEEDED=y -# CONFIG_NF_NAT_REDIRECT is not set CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y @@ -964,7 +893,6 @@ CONFIG_OF_NET=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y CONFIG_OF_RESERVED_MEM=y -CONFIG_OID_REGISTRY=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y # CONFIG_OMAP2PLUS_MBOX is not set @@ -994,7 +922,6 @@ CONFIG_OUTER_CACHE_SYNC=y CONFIG_PACKET_DIAG=y CONFIG_PAGE_COUNTER=y CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PALMAS_GPADC is not set # CONFIG_PANIC_ON_OOPS is not set CONFIG_PANIC_ON_OOPS_VALUE=0 CONFIG_PANIC_TIMEOUT=0 @@ -1009,6 +936,7 @@ CONFIG_PCIEASPM_DEFAULT=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_DW=y CONFIG_PCIE_PME=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PCI_DOMAINS=y CONFIG_PCI_DOMAINS_GENERIC=y # CONFIG_PCI_DRA7XX is not set @@ -1094,7 +1022,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_STALL_COMMON=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y CONFIG_RD_LZMA=y CONFIG_RD_LZO=y CONFIG_RD_XZ=y @@ -1147,7 +1074,6 @@ CONFIG_REGULATOR_TWL4030=y CONFIG_REGULATOR_VEXPRESS=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y -CONFIG_ROOT_NFS=y CONFIG_RPS=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_AS3722=y @@ -1245,7 +1171,7 @@ CONFIG_SOC_HAS_REALTIME_COUNTER=y # CONFIG_SOC_IMX6SX is not set # CONFIG_SOC_IMX6UL is not set # CONFIG_SOC_IMX7D is not set -# CONFIG_SOC_LS1021A is not set +CONFIG_SOC_LS1021A=y CONFIG_SOC_OMAP3430=y CONFIG_SOC_OMAP5=y CONFIG_SOC_TI81XX=y @@ -1254,7 +1180,6 @@ CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y CONFIG_SPI_CADENCE=y -# CONFIG_SPI_CADENCE_QUADSPI is not set CONFIG_SPI_FSL_QUADSPI=y # CONFIG_SPI_IMX is not set CONFIG_SPI_MASTER=y @@ -1278,8 +1203,6 @@ CONFIG_STMPE_I2C=y # CONFIG_STMPE_SPI is not set CONFIG_STMP_DEVICE=y # CONFIG_STRIP_ASM_SYMS is not set -CONFIG_SUNRPC=y -CONFIG_SUNRPC_GSS=y CONFIG_SUSPEND=y CONFIG_SUSPEND_FREEZER=y CONFIG_SWIOTLB=y @@ -1347,7 +1270,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y CONFIG_USB_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3_OMAP=y CONFIG_USB_DWC3_PCI=y -# CONFIG_USB_EHCI_FSL is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y # CONFIG_USB_EHCI_MXC is not set diff --git a/target/linux/layerscape/armv8_32b/profiles/00-default.mk b/target/linux/layerscape/armv8_32b/profiles/00-default.mk deleted file mode 100644 index fc1231dc7..000000000 --- a/target/linux/layerscape/armv8_32b/profiles/00-default.mk +++ /dev/null @@ -1,18 +0,0 @@ -define Profile/Default - NAME:=Default Profile - PRIORITY:=1 -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef - -DEFAULT_PACKAGES+= \ - rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ - fman-layerscape-ls1043ardb \ - rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ - fman-layerscape-ls1046ardb \ - rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ - kmod-ppfe ppfe-ls1012ardb - -$(eval $(call Profile,Default)) diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 91a89a25b..9e0c8e032 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -23,7 +23,6 @@ CONFIG_ACPI_REDUCED_HARDWARE_ONLY=y CONFIG_ACPI_SPCR_TABLE=y CONFIG_ACPI_TABLE_UPGRADE=y CONFIG_ACPI_THERMAL=y -CONFIG_ADVISE_SYSCALLS=y CONFIG_AHCI_CEVA=y CONFIG_AHCI_QORIQ=y CONFIG_AHCI_XGENE=y @@ -107,6 +106,7 @@ CONFIG_ARM_SP805_WATCHDOG=y CONFIG_ARM_TIMER_SP804=y CONFIG_ASN1=y CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_ASYNC_CORE=y CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y CONFIG_ATA=y CONFIG_ATA_ACPI=y @@ -145,11 +145,6 @@ CONFIG_BOOTPARAM_SOFTLOCKUP_PANIC_VALUE=0 CONFIG_BOUNCE=y CONFIG_BPF_JIT=y # CONFIG_BPF_SYSCALL is not set -CONFIG_BRIDGE_EBT_DNAT=y -CONFIG_BRIDGE_EBT_SNAT=y -CONFIG_BRIDGE_EBT_T_NAT=y -CONFIG_BRIDGE_NETFILTER=y -CONFIG_BRIDGE_NF_EBTABLES=y CONFIG_BRIDGE_VLAN_FILTERING=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y @@ -259,7 +254,6 @@ CONFIG_CRYPTO_AES_ARM64_CE_CCM=y CONFIG_CRYPTO_AKCIPHER=y CONFIG_CRYPTO_AKCIPHER2=y CONFIG_CRYPTO_ANSI_CPRNG=y -# CONFIG_CRYPTO_ARC4 is not set CONFIG_CRYPTO_AUTHENC=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CRC32C=y @@ -274,12 +268,13 @@ CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC=y CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_QI=y # CONFIG_CRYPTO_DEV_FSL_CAAM_DEBUG is not set +CONFIG_CRYPTO_DEV_FSL_CAAM_DMA=y # CONFIG_CRYPTO_DEV_FSL_CAAM_INTC is not set CONFIG_CRYPTO_DEV_FSL_CAAM_JR=y CONFIG_CRYPTO_DEV_FSL_CAAM_PKC_API=y CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE=9 CONFIG_CRYPTO_DEV_FSL_CAAM_RNG_API=y -# CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM is not set +CONFIG_CRYPTO_DEV_FSL_DPAA2_CAAM=y CONFIG_CRYPTO_DRBG=y CONFIG_CRYPTO_DRBG_HMAC=y CONFIG_CRYPTO_DRBG_MENU=y @@ -318,7 +313,6 @@ CONFIG_DEBUG_RODATA=y CONFIG_DEBUG_SET_MODULE_RONX=y CONFIG_DECOMPRESS_BZIP2=y CONFIG_DECOMPRESS_GZIP=y -CONFIG_DECOMPRESS_LZ4=y CONFIG_DECOMPRESS_LZMA=y CONFIG_DECOMPRESS_LZO=y CONFIG_DECOMPRESS_XZ=y @@ -461,6 +455,8 @@ CONFIG_FSL_LS2_CONSOLE=y CONFIG_FSL_MC_BUS=y CONFIG_FSL_MC_DPIO=y CONFIG_FSL_MC_RESTOOL=y +CONFIG_FSL_PPFE=y +CONFIG_FSL_PPFE_UTIL_DISABLED=y # CONFIG_FSL_QBMAN_DEBUG is not set # CONFIG_FSL_QDMA is not set CONFIG_FSL_QMAN_CI_SCHED_CFG_BMAN_W=2 @@ -691,11 +687,6 @@ CONFIG_IPV6=y CONFIG_IPV6_SIT=y # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_MROUTE is not set -CONFIG_IP_NF_FILTER=y -CONFIG_IP_NF_IPTABLES=y -CONFIG_IP_NF_MANGLE=y -CONFIG_IP_NF_NAT=y -CONFIG_IP_NF_TARGET_MASQUERADE=y CONFIG_IP_PNP=y CONFIG_IP_PNP_BOOTP=y CONFIG_IP_PNP_DHCP=y @@ -708,7 +699,6 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_JBD2=y -# CONFIG_JFFS2_FS is not set CONFIG_JUMP_LABEL=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y @@ -748,7 +738,6 @@ CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LS_SCFG_MSI=y CONFIG_LS_SOC_DRIVERS=y -CONFIG_LZ4_DECOMPRESS=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y @@ -837,6 +826,7 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_FSL_IFC=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SST25L=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_MV_XOR_V2=y @@ -845,76 +835,12 @@ CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_MULTIPLE_NODES=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y -CONFIG_NETFILTER=y -CONFIG_NETFILTER_ADVANCED=y -CONFIG_NETFILTER_INGRESS=y -CONFIG_NETFILTER_NETLINK=y -CONFIG_NETFILTER_XTABLES=y -CONFIG_NETFILTER_XT_CONNMARK=y -CONFIG_NETFILTER_XT_MATCH_COMMENT=y -CONFIG_NETFILTER_XT_NAT=y -CONFIG_NETFILTER_XT_TARGET_CONNMARK=y # CONFIG_NETLABEL is not set -CONFIG_NETLINK_DIAG=y -# CONFIG_NETWORK_FILESYSTEMS is not set -CONFIG_NET_9P=y -# CONFIG_NET_9P_DEBUG is not set -CONFIG_NET_9P_VIRTIO=y # CONFIG_NET_CLS_CGROUP is not set CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_INGRESS=y CONFIG_NET_IP_TUNNEL=y -CONFIG_NET_KEY=y CONFIG_NET_NS=y -CONFIG_NET_PACKET_ENGINE=y CONFIG_NET_PTP_CLASSIFY=y -# CONFIG_NET_VENDOR_AURORA is not set -# CONFIG_NET_VENDOR_STMICRO is not set -# CONFIG_NFT_CHAIN_NAT_IPV4 is not set -# CONFIG_NFT_CHAIN_ROUTE_IPV4 is not set -CONFIG_NFT_COMPAT=y -# CONFIG_NFT_COUNTER is not set -CONFIG_NFT_CT=y -# CONFIG_NFT_EXTHDR is not set -# CONFIG_NFT_HASH is not set -# CONFIG_NFT_LIMIT is not set -# CONFIG_NFT_LOG is not set -CONFIG_NFT_MASQ=y -# CONFIG_NFT_MASQ_IPV4 is not set -# CONFIG_NFT_META is not set -CONFIG_NFT_NAT=y -# CONFIG_NFT_NUMGEN is not set -# CONFIG_NFT_QUOTA is not set -# CONFIG_NFT_REDIR is not set -# CONFIG_NFT_REJECT is not set -# CONFIG_NFT_REJECT_IPV4 is not set -# CONFIG_NFT_SET_HASH is not set -# CONFIG_NFT_SET_RBTREE is not set -CONFIG_NF_CONNTRACK=y -CONFIG_NF_CONNTRACK_EVENTS=y -CONFIG_NF_CONNTRACK_IPV4=y -CONFIG_NF_CONNTRACK_IPV6=y -CONFIG_NF_CONNTRACK_MARK=y -# CONFIG_NF_CONNTRACK_RTCACHE is not set -CONFIG_NF_DEFRAG_IPV4=y -CONFIG_NF_DEFRAG_IPV6=y -# CONFIG_NF_LOG_BRIDGE is not set -CONFIG_NF_LOG_COMMON=y -CONFIG_NF_LOG_IPV6=y -CONFIG_NF_NAT=y -CONFIG_NF_NAT_IPV4=y -CONFIG_NF_NAT_IPV6=y -CONFIG_NF_NAT_MASQUERADE_IPV4=y -CONFIG_NF_NAT_MASQUERADE_IPV6=y -CONFIG_NF_NAT_NEEDED=y -# CONFIG_NF_NAT_REDIRECT is not set -CONFIG_NF_REJECT_IPV6=y -CONFIG_NF_TABLES=y -# CONFIG_NF_TABLES_ARP is not set -CONFIG_NF_TABLES_BRIDGE=y -# CONFIG_NF_TABLES_INET is not set -CONFIG_NF_TABLES_IPV4=y -# CONFIG_NF_TABLES_IPV6 is not set CONFIG_NLS=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y @@ -1046,7 +972,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_RCU_STALL_COMMON=y CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_RD_LZ4=y CONFIG_RD_LZMA=y CONFIG_RD_LZO=y CONFIG_RD_XZ=y @@ -1240,7 +1165,6 @@ CONFIG_USB_DWC3_DUAL_ROLE=y # CONFIG_USB_DWC3_HOST is not set CONFIG_USB_DWC3_OF_SIMPLE=y CONFIG_USB_DWC3_PCI=y -# CONFIG_USB_EHCI_FSL is not set CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_PCI=y diff --git a/target/linux/layerscape/armv8_64b/profiles/00-default.mk b/target/linux/layerscape/armv8_64b/profiles/00-default.mk deleted file mode 100644 index fc1231dc7..000000000 --- a/target/linux/layerscape/armv8_64b/profiles/00-default.mk +++ /dev/null @@ -1,18 +0,0 @@ -define Profile/Default - NAME:=Default Profile - PRIORITY:=1 -endef - -define Profile/Default/Description - Default package set compatible with most boards. -endef - -DEFAULT_PACKAGES+= \ - rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ - fman-layerscape-ls1043ardb \ - rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ - fman-layerscape-ls1046ardb \ - rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ - kmod-ppfe ppfe-ls1012ardb - -$(eval $(call Profile,Default)) diff --git a/target/linux/layerscape/base-files/etc/rc.local b/target/linux/layerscape/base-files/etc/rc.local deleted file mode 100644 index 297c3a83d..000000000 --- a/target/linux/layerscape/base-files/etc/rc.local +++ /dev/null @@ -1,4 +0,0 @@ -# Put your custom commands here that should be executed once -# the system init finished. By default this file does nothing. -modprobe pfe.ko -exit 0 diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile index 5577b1623..88bf8d7b4 100644 --- a/target/linux/layerscape/image/Makefile +++ b/target/linux/layerscape/image/Makefile @@ -16,10 +16,30 @@ define Build/append-ls-uboot dd if=$(STAGING_DIR_IMAGE)/$(1)-$(SUBTARGET)-uboot.bin >> $@ endef +define Build/append-ls-ppa + dd if=$(STAGING_DIR_IMAGE)/$(1)-ppa.itb >> $@ +endef + define Build/append-ls-fman dd if=$(STAGING_DIR_IMAGE)/$(1)-fman.bin >> $@ endef +define Build/append-ls-mc + dd if=$(STAGING_DIR_IMAGE)/$(1)-mc.itb >> $@ +endef + +define Build/append-ls-ppfe + dd if=$(STAGING_DIR_IMAGE)/pfe.itb >> $@ +endef + +define Build/append-ls-dpl + dd if=$(STAGING_DIR_IMAGE)/$(1)-dpl.dtb >> $@ +endef + +define Build/append-ls-dpc + dd if=$(STAGING_DIR_IMAGE)/$(1)-dpc.dtb >> $@ +endef + define Build/append-ls-dtb $(call Image/BuildDTB,$(DTS_DIR)/$(1).dts,$(DTS_DIR)/$(1).dtb) dd if=$(DTS_DIR)/$(1).dtb >> $@ @@ -51,10 +71,12 @@ endef define Device/ls1043ardb DEVICE_TITLE := ls1043ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb fman-layerscape-ls1043ardb + DEVICE_PACKAGES += rcw-layerscape-ls1043ardb uboot-layerscape-$(SUBTARGET)-ls1043ardb \ + fman-layerscape-ls1043ardb layerscape-ppa-ls1043ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1043a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ @@ -64,47 +86,83 @@ TARGET_DEVICES += ls1043ardb define Device/ls1046ardb DEVICE_TITLE := ls1046ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb fman-layerscape-ls1046ardb + DEVICE_PACKAGES += rcw-layerscape-ls1046ardb uboot-layerscape-$(SUBTARGET)-ls1046ardb \ + fman-layerscape-ls1046ardb layerscape-ppa-ls1046ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1046a-rdb-sdk IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 9M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 9M | \ append-ls-fman $(1) | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ls-rootfs-ext4 $(1) 22M | check-size 67108865 + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1046ardb define Device/ls1012ardb DEVICE_TITLE := ls1012ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb kmod-ppfe ppfe-ls1012ardb + DEVICE_PACKAGES += rcw-layerscape-ls1012ardb uboot-layerscape-$(SUBTARGET)-ls1012ardb \ + kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-rdb IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ - append-ls-uboot $(1) | pad-to 15M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-ppfe | pad-to 15M | \ append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ append-kernel | pad-to 32M | \ - append-ls-rootfs-ext4 $(1) 23M | check-size 67108865 + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1012ardb +define Device/ls1012afrdm + DEVICE_TITLE := ls1012afrdm-$(SUBTARGET) + DEVICE_PACKAGES += rcw-layerscape-ls1012afrdm uboot-layerscape-$(SUBTARGET)-ls1012afrdm \ + kmod-ppfe layerscape-ppfe layerscape-ppa-ls1012afrdm + DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1012a-frdm + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-ppfe | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 +endef +TARGET_DEVICES += ls1012afrdm + ifeq ($(SUBTARGET),armv8_64b) define Device/ls1088ardb DEVICE_TITLE := ls1088ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb mc-binary-ls1088ardb + DEVICE_PACKAGES += rcw-layerscape-ls1088ardb uboot-layerscape-$(SUBTARGET)-ls1088ardb \ + layerscape-mc-ls1088ardb layerscape-dpl-ls1088ardb restool \ + layerscape-ppa-ls1088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls1088a-rdb - IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \ - append-kernel | pad-to 17M | \ - append-ls-rootfs-ext4 $(1) 17M | check-size 51380225 + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-mc $(1) | pad-to 13M | \ + append-ls-dpl $(1) | pad-to 14M | \ + append-ls-dpc $(1) | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-ls-rootfs-ext4 $(1) 30M | check-size 67108865 endef TARGET_DEVICES += ls1088ardb define Device/ls2088ardb DEVICE_TITLE := ls2088ardb-$(SUBTARGET) - DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb mc-binary-ls2088ardb + DEVICE_PACKAGES += rcw-layerscape-ls2088ardb uboot-layerscape-$(SUBTARGET)-ls2088ardb \ + layerscape-mc-ls2088ardb layerscape-dpl-ls2088ardb restool \ + layerscape-ppa-ls2088ardb DEVICE_DTS = ../../../arm64/boot/dts/freescale/fsl-ls2088a-rdb - IMAGE/firmware.bin = append-ls-dtb $$(DEVICE_DTS) | pad-to 1M | \ - append-kernel | pad-to 17M | \ - append-rootfs | pad-rootfs | check-size 51380225 + IMAGE/firmware.bin = append-ls-rcw $(1) | pad-to 1M | \ + append-ls-uboot $(1) | pad-to 4M | \ + append-ls-ppa $(1) | pad-to 10M | \ + append-ls-mc $(1) | pad-to 13M | \ + append-ls-dpl $(1) | pad-to 14M | \ + append-ls-dpc $(1) | pad-to 15M | \ + append-ls-dtb $$(DEVICE_DTS) | pad-to 16M | \ + append-kernel | pad-to 32M | \ + append-rootfs | pad-rootfs | check-size 67108865 endef TARGET_DEVICES += ls2088ardb endif diff --git a/target/linux/layerscape/modules.mk b/target/linux/layerscape/modules.mk index 0b34f96b3..7a368a0d2 100644 --- a/target/linux/layerscape/modules.mk +++ b/target/linux/layerscape/modules.mk @@ -8,9 +8,10 @@ define KernelPackage/ppfe SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Freescale PPFE Driver support - KCONFIG:=CONFIG_FSL_PPFE + DEPENDS:=@TARGET_layerscape + KCONFIG:=CONFIG_FSL_PPFE CONFIG_FSL_PPFE_UTIL_DISABLED FILES:=$(LINUX_DIR)/drivers/staging/fsl_ppfe/pfe.ko - AUTOLOAD:=$(call AutoLoad,35,ppfe) + AUTOLOAD:=$(call AutoLoad,35,pfe) endef define KernelPackage/ppfe/description diff --git a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch index 939880fd1..333a9d121 100644 --- a/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/201-config-support-layerscape.patch @@ -1,4 +1,4 @@ -From 11edf9c88acea13d1a02901289060263b4027a77 Mon Sep 17 00:00:00 2001 +From 7992b4384d94c5e1bad998ca3a9a5781caac8e62 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 09:52:26 +0800 Subject: [PATCH] config: support layerscape @@ -30,11 +30,11 @@ Signed-off-by: Yangbo Lu drivers/soc/fsl/layerscape/Kconfig | 10 +++ drivers/soc/fsl/layerscape/Makefile | 1 + drivers/soc/fsl/rcpm.c | 154 ++++++++++++++++++++++++++++++++ - drivers/staging/Kconfig | 4 + - drivers/staging/Makefile | 2 + + drivers/staging/Kconfig | 6 ++ + drivers/staging/Makefile | 3 + drivers/staging/fsl-dpaa2/Kconfig | 41 +++++++++ drivers/staging/fsl-dpaa2/Makefile | 9 ++ - 18 files changed, 309 insertions(+), 4 deletions(-) + 18 files changed, 312 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/fsl/Kconfig create mode 100644 drivers/soc/fsl/Kconfig.arm create mode 100644 drivers/soc/fsl/layerscape/Kconfig @@ -407,16 +407,18 @@ Signed-off-by: Yangbo Lu source "drivers/staging/wilc1000/Kconfig" source "drivers/staging/most/Kconfig" -@@ -106,4 +108,6 @@ source "drivers/staging/greybus/Kconfig" +@@ -106,4 +108,8 @@ source "drivers/staging/greybus/Kconfig" source "drivers/staging/vc04_services/Kconfig" +source "drivers/staging/fsl_qbman/Kconfig" ++ ++source "drivers/staging/fsl_ppfe/Kconfig" + endif # STAGING --- a/drivers/staging/Makefile +++ b/drivers/staging/Makefile -@@ -36,9 +36,11 @@ obj-$(CONFIG_UNISYSSPAR) += unisys/ +@@ -36,9 +36,12 @@ obj-$(CONFIG_UNISYSSPAR) += unisys/ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/ obj-$(CONFIG_FB_TFT) += fbtft/ obj-$(CONFIG_FSL_MC_BUS) += fsl-mc/ @@ -428,6 +430,7 @@ Signed-off-by: Yangbo Lu obj-$(CONFIG_GREYBUS) += greybus/ obj-$(CONFIG_BCM2708_VCHIQ) += vc04_services/ +obj-$(CONFIG_FSL_SDK_DPA) += fsl_qbman/ ++obj-$(CONFIG_FSL_PPFE) += fsl_ppfe/ --- /dev/null +++ b/drivers/staging/fsl-dpaa2/Kconfig @@ -0,0 +1,41 @@ diff --git a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch new file mode 100644 index 000000000..45b3c7ae6 --- /dev/null +++ b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch @@ -0,0 +1,508 @@ +From c37953457a7ebeb0d97ae8574b3d41274fcd9119 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Wed, 1 Nov 2017 16:22:33 +0800 +Subject: [PATCH] core-linux: support layerscape + +This is a integrated patch for layerscape core-linux support. + +Signed-off-by: Madalin Bucur +Signed-off-by: Zhao Qiang +Signed-off-by: Camelia Groza +Signed-off-by: Madalin Bucur +Signed-off-by: Zhang Ying-22455 +Signed-off-by: Ramneek Mehresh +Signed-off-by: Jarod Wilson +Signed-off-by: Nikhil Badola +Signed-off-by: stephen hemminger +Signed-off-by: Arnd Bergmann +Signed-off-by: Yangbo Lu +--- + drivers/base/devres.c | 66 ++++++++++++++++++++++++++++ + drivers/base/soc.c | 66 ++++++++++++++++++++++++++++ + include/linux/device.h | 19 ++++++++ + include/linux/fsl/svr.h | 97 +++++++++++++++++++++++++++++++++++++++++ + include/linux/fsl_devices.h | 3 ++ + include/linux/netdev_features.h | 2 + + include/linux/netdevice.h | 4 ++ + include/linux/skbuff.h | 2 + + include/linux/sys_soc.h | 3 ++ + include/uapi/linux/if_ether.h | 1 + + net/core/dev.c | 13 +++++- + net/core/skbuff.c | 29 +++++++++++- + net/sched/sch_generic.c | 7 +++ + 13 files changed, 309 insertions(+), 3 deletions(-) + create mode 100644 include/linux/fsl/svr.h + +--- a/drivers/base/devres.c ++++ b/drivers/base/devres.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "base.h" + +@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, + &devres)); + } + EXPORT_SYMBOL_GPL(devm_free_pages); ++ ++static void devm_percpu_release(struct device *dev, void *pdata) ++{ ++ void __percpu *p; ++ ++ p = *(void __percpu **)pdata; ++ free_percpu(p); ++} ++ ++static int devm_percpu_match(struct device *dev, void *data, void *p) ++{ ++ struct devres *devr = container_of(data, struct devres, data); ++ ++ return *(void **)devr->data == p; ++} ++ ++/** ++ * __devm_alloc_percpu - Resource-managed alloc_percpu ++ * @dev: Device to allocate per-cpu memory for ++ * @size: Size of per-cpu memory to allocate ++ * @align: Alignment of per-cpu memory to allocate ++ * ++ * Managed alloc_percpu. Per-cpu memory allocated with this function is ++ * automatically freed on driver detach. ++ * ++ * RETURNS: ++ * Pointer to allocated memory on success, NULL on failure. ++ */ ++void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, ++ size_t align) ++{ ++ void *p; ++ void __percpu *pcpu; ++ ++ pcpu = __alloc_percpu(size, align); ++ if (!pcpu) ++ return NULL; ++ ++ p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL); ++ if (!p) { ++ free_percpu(pcpu); ++ return NULL; ++ } ++ ++ *(void __percpu **)p = pcpu; ++ ++ devres_add(dev, p); ++ ++ return pcpu; ++} ++EXPORT_SYMBOL_GPL(__devm_alloc_percpu); ++ ++/** ++ * devm_free_percpu - Resource-managed free_percpu ++ * @dev: Device this memory belongs to ++ * @pdata: Per-cpu memory to free ++ * ++ * Free memory allocated with devm_alloc_percpu(). ++ */ ++void devm_free_percpu(struct device *dev, void __percpu *pdata) ++{ ++ WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match, ++ (void *)pdata)); ++} ++EXPORT_SYMBOL_GPL(devm_free_percpu); +--- a/drivers/base/soc.c ++++ b/drivers/base/soc.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + static DEFINE_IDA(soc_ida); + +@@ -159,3 +160,68 @@ static int __init soc_bus_register(void) + return bus_register(&soc_bus_type); + } + core_initcall(soc_bus_register); ++ ++static int soc_device_match_one(struct device *dev, void *arg) ++{ ++ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); ++ const struct soc_device_attribute *match = arg; ++ ++ if (match->machine && ++ !glob_match(match->machine, soc_dev->attr->machine)) ++ return 0; ++ ++ if (match->family && ++ !glob_match(match->family, soc_dev->attr->family)) ++ return 0; ++ ++ if (match->revision && ++ !glob_match(match->revision, soc_dev->attr->revision)) ++ return 0; ++ ++ if (match->soc_id && ++ !glob_match(match->soc_id, soc_dev->attr->soc_id)) ++ return 0; ++ ++ return 1; ++} ++ ++/* ++ * soc_device_match - identify the SoC in the machine ++ * @matches: zero-terminated array of possible matches ++ * ++ * returns the first matching entry of the argument array, or NULL ++ * if none of them match. ++ * ++ * This function is meant as a helper in place of of_match_node() ++ * in cases where either no device tree is available or the information ++ * in a device node is insufficient to identify a particular variant ++ * by its compatible strings or other properties. For new devices, ++ * the DT binding should always provide unique compatible strings ++ * that allow the use of of_match_node() instead. ++ * ++ * The calling function can use the .data entry of the ++ * soc_device_attribute to pass a structure or function pointer for ++ * each entry. ++ */ ++const struct soc_device_attribute *soc_device_match( ++ const struct soc_device_attribute *matches) ++{ ++ int ret = 0; ++ ++ if (!matches) ++ return NULL; ++ ++ while (!ret) { ++ if (!(matches->machine || matches->family || ++ matches->revision || matches->soc_id)) ++ break; ++ ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches, ++ soc_device_match_one); ++ if (!ret) ++ matches++; ++ else ++ return matches; ++ } ++ return NULL; ++} ++EXPORT_SYMBOL_GPL(soc_device_match); +--- a/include/linux/device.h ++++ b/include/linux/device.h +@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru + int devm_add_action(struct device *dev, void (*action)(void *), void *data); + void devm_remove_action(struct device *dev, void (*action)(void *), void *data); + ++/** ++ * devm_alloc_percpu - Resource-managed alloc_percpu ++ * @dev: Device to allocate per-cpu memory for ++ * @type: Type to allocate per-cpu memory for ++ * ++ * Managed alloc_percpu. Per-cpu memory allocated with this function is ++ * automatically freed on driver detach. ++ * ++ * RETURNS: ++ * Pointer to allocated memory on success, NULL on failure. ++ */ ++#define devm_alloc_percpu(dev, type) \ ++ ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \ ++ __alignof__(type))) ++ ++void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, ++ size_t align); ++void devm_free_percpu(struct device *dev, void __percpu *pdata); ++ + static inline int devm_add_action_or_reset(struct device *dev, + void (*action)(void *), void *data) + { +--- /dev/null ++++ b/include/linux/fsl/svr.h +@@ -0,0 +1,97 @@ ++/* ++ * MPC85xx cpu type detection ++ * ++ * Copyright 2011-2012 Freescale Semiconductor, Inc. ++ * ++ * This is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ */ ++ ++#ifndef FSL_SVR_H ++#define FSL_SVR_H ++ ++#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */ ++#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/ ++#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/ ++ ++/* Some parts define SVR[0:23] as the SOC version */ ++#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */ ++ ++#define SVR_8533 0x803400 ++#define SVR_8535 0x803701 ++#define SVR_8536 0x803700 ++#define SVR_8540 0x803000 ++#define SVR_8541 0x807200 ++#define SVR_8543 0x803200 ++#define SVR_8544 0x803401 ++#define SVR_8545 0x803102 ++#define SVR_8547 0x803101 ++#define SVR_8548 0x803100 ++#define SVR_8555 0x807100 ++#define SVR_8560 0x807000 ++#define SVR_8567 0x807501 ++#define SVR_8568 0x807500 ++#define SVR_8569 0x808000 ++#define SVR_8572 0x80E000 ++#define SVR_P1010 0x80F100 ++#define SVR_P1011 0x80E500 ++#define SVR_P1012 0x80E501 ++#define SVR_P1013 0x80E700 ++#define SVR_P1014 0x80F101 ++#define SVR_P1017 0x80F700 ++#define SVR_P1020 0x80E400 ++#define SVR_P1021 0x80E401 ++#define SVR_P1022 0x80E600 ++#define SVR_P1023 0x80F600 ++#define SVR_P1024 0x80E402 ++#define SVR_P1025 0x80E403 ++#define SVR_P2010 0x80E300 ++#define SVR_P2020 0x80E200 ++#define SVR_P2040 0x821000 ++#define SVR_P2041 0x821001 ++#define SVR_P3041 0x821103 ++#define SVR_P4040 0x820100 ++#define SVR_P4080 0x820000 ++#define SVR_P5010 0x822100 ++#define SVR_P5020 0x822000 ++#define SVR_P5021 0X820500 ++#define SVR_P5040 0x820400 ++#define SVR_T4240 0x824000 ++#define SVR_T4120 0x824001 ++#define SVR_T4160 0x824100 ++#define SVR_T4080 0x824102 ++#define SVR_C291 0x850000 ++#define SVR_C292 0x850020 ++#define SVR_C293 0x850030 ++#define SVR_B4860 0X868000 ++#define SVR_G4860 0x868001 ++#define SVR_G4060 0x868003 ++#define SVR_B4440 0x868100 ++#define SVR_G4440 0x868101 ++#define SVR_B4420 0x868102 ++#define SVR_B4220 0x868103 ++#define SVR_T1040 0x852000 ++#define SVR_T1041 0x852001 ++#define SVR_T1042 0x852002 ++#define SVR_T1020 0x852100 ++#define SVR_T1021 0x852101 ++#define SVR_T1022 0x852102 ++#define SVR_T1023 0x854100 ++#define SVR_T1024 0x854000 ++#define SVR_T2080 0x853000 ++#define SVR_T2081 0x853100 ++ ++#define SVR_8610 0x80A000 ++#define SVR_8641 0x809000 ++#define SVR_8641D 0x809001 ++ ++#define SVR_9130 0x860001 ++#define SVR_9131 0x860000 ++#define SVR_9132 0x861000 ++#define SVR_9232 0x861400 ++ ++#define SVR_Unknown 0xFFFFFF ++ ++#endif +--- a/include/linux/fsl_devices.h ++++ b/include/linux/fsl_devices.h +@@ -99,7 +99,10 @@ struct fsl_usb2_platform_data { + unsigned suspended:1; + unsigned already_suspended:1; + unsigned has_fsl_erratum_a007792:1; ++ unsigned has_fsl_erratum_14:1; + unsigned has_fsl_erratum_a005275:1; ++ unsigned has_fsl_erratum_a006918:1; ++ unsigned has_fsl_erratum_a005697:1; + unsigned check_phy_clk_valid:1; + + /* register save area for suspend/resume */ +--- a/include/linux/netdev_features.h ++++ b/include/linux/netdev_features.h +@@ -74,6 +74,7 @@ enum { + NETIF_F_BUSY_POLL_BIT, /* Busy poll */ + + NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */ ++ NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */ + + /* + * Add your fresh new feature above and remember to update +@@ -136,6 +137,7 @@ enum { + #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) + #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) + #define NETIF_F_HW_TC __NETIF_F(HW_TC) ++#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ) + + #define for_each_netdev_feature(mask_addr, bit) \ + for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1509,6 +1509,8 @@ enum netdev_priv_flags { + * @if_port: Selectable AUI, TP, ... + * @dma: DMA channel + * @mtu: Interface MTU value ++ * @min_mtu: Interface Minimum MTU value ++ * @max_mtu: Interface Maximum MTU value + * @type: Interface hardware type + * @hard_header_len: Maximum hardware header length. + * @min_header_len: Minimum hardware header length +@@ -1735,6 +1737,8 @@ struct net_device { + unsigned char dma; + + unsigned int mtu; ++ unsigned int min_mtu; ++ unsigned int max_mtu; + unsigned short type; + unsigned short hard_header_len; + unsigned short min_header_len; +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb); + void kfree_skb_list(struct sk_buff *segs); + void skb_tx_error(struct sk_buff *skb); + void consume_skb(struct sk_buff *skb); ++void skb_recycle(struct sk_buff *skb); + void __kfree_skb(struct sk_buff *skb); + extern struct kmem_cache *skbuff_head_cache; + +@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc + } + int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); + int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); ++void copy_skb_header(struct sk_buff *new, const struct sk_buff *old); + int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); + __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, + int len, __wsum csum); +--- a/include/linux/sys_soc.h ++++ b/include/linux/sys_soc.h +@@ -13,6 +13,7 @@ struct soc_device_attribute { + const char *family; + const char *revision; + const char *soc_id; ++ const void *data; + }; + + /** +@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de + */ + struct device *soc_device_to_device(struct soc_device *soc); + ++const struct soc_device_attribute *soc_device_match( ++ const struct soc_device_attribute *matches); + #endif /* __SOC_BUS_H */ +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -35,6 +35,7 @@ + #define ETH_DATA_LEN 1500 /* Max. octets in payload */ + #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ + #define ETH_FCS_LEN 4 /* Octets in the FCS */ ++#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ + + /* + * These are the defined Ethernet Protocol ID's. +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev, + if (new_mtu == dev->mtu) + return 0; + +- /* MTU must be positive. */ +- if (new_mtu < 0) ++ /* MTU must be positive, and in range */ ++ if (new_mtu < 0 || new_mtu < dev->min_mtu) { ++ net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n", ++ dev->name, new_mtu, dev->min_mtu); + return -EINVAL; ++ } ++ ++ if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) { ++ net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n", ++ dev->name, new_mtu, dev->min_mtu); ++ return -EINVAL; ++ } + + if (!netif_device_present(dev)) + return -ENODEV; +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk + } + EXPORT_SYMBOL(napi_consume_skb); + ++/** ++ * skb_recycle - clean up an skb for reuse ++ * @skb: buffer ++ * ++ * Recycles the skb to be reused as a receive buffer. This ++ * function does any necessary reference count dropping, and ++ * cleans up the skbuff as if it just came from __alloc_skb(). ++ */ ++void skb_recycle(struct sk_buff *skb) ++{ ++ struct skb_shared_info *shinfo; ++ u8 head_frag = skb->head_frag; ++ ++ skb_release_head_state(skb); ++ ++ shinfo = skb_shinfo(skb); ++ memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); ++ atomic_set(&shinfo->dataref, 1); ++ ++ memset(skb, 0, offsetof(struct sk_buff, tail)); ++ skb->data = skb->head + NET_SKB_PAD; ++ skb->head_frag = head_frag; ++ skb_reset_tail_pointer(skb); ++} ++EXPORT_SYMBOL(skb_recycle); ++ + /* Make sure a field is enclosed inside headers_start/headers_end section */ + #define CHECK_SKB_FIELD(field) \ + BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ +@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st + skb->inner_mac_header += off; + } + +-static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) ++void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) + { + __copy_skb_header(new, old); + +@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu + skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs; + skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type; + } ++EXPORT_SYMBOL(copy_skb_header); + + static inline int skb_alloc_rx_flag(const struct sk_buff *skb) + { +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a + txq->trans_timeout++; + break; + } ++ ++ /* Devices with HW_ACCEL_MQ have multiple txqs ++ * but update only the first one's transmission ++ * timestamp so avoid checking the rest. ++ */ ++ if (dev->features & NETIF_F_HW_ACCEL_MQ) ++ break; + } + + if (some_queue_timedout) { diff --git a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch index 3a2e9c64b..66860a0bb 100644 --- a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch @@ -1,4 +1,4 @@ -From 7edaf7ed8fbd5fb50950a4fc8067a9c14557d010 Mon Sep 17 00:00:00 2001 +From 739029f49bd9181b821298f9d27b29ce2d292967 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:03:52 +0800 Subject: [PATCH] arch: support layerscape @@ -34,8 +34,8 @@ Signed-off-by: Yangbo Lu arch/arm64/include/asm/pgtable-prot.h | 1 + arch/arm64/include/asm/pgtable.h | 5 +++ arch/arm64/kernel/pci.c | 62 +++++++++++++++++++++++++++++++++++ - arch/arm64/mm/dma-mapping.c | 6 ++++ - 15 files changed, 197 insertions(+), 3 deletions(-) + arch/arm64/mm/dma-mapping.c | 23 ++++++++++--- + 15 files changed, 209 insertions(+), 8 deletions(-) --- a/arch/arm/include/asm/delay.h +++ b/arch/arm/include/asm/delay.h @@ -410,7 +410,7 @@ Signed-off-by: Yangbo Lu static int swiotlb __ro_after_init; -@@ -918,6 +919,10 @@ static int __init __iommu_dma_init(void) +@@ -925,6 +926,10 @@ static int __init __iommu_dma_init(void) if (!ret) ret = register_iommu_dma_ops_notifier(&pci_bus_type); #endif @@ -421,7 +421,7 @@ Signed-off-by: Yangbo Lu return ret; } arch_initcall(__iommu_dma_init); -@@ -971,3 +976,4 @@ void arch_setup_dma_ops(struct device *d +@@ -978,3 +983,4 @@ void arch_setup_dma_ops(struct device *d dev->archdata.dma_coherent = coherent; __iommu_setup_dma_ops(dev, dma_base, size, iommu); } diff --git a/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch b/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch index a7a3a48e6..7dae7d6ac 100644 --- a/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch +++ b/target/linux/layerscape/patches-4.9/302-dts-support-layercape.patch @@ -1,4 +1,4 @@ -From 2b2e3b9a0d2abf276b40843f75d97b623e4ee109 Mon Sep 17 00:00:00 2001 +From bfa4a794f91162cfeccfa4d59121cde9a84e32a3 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:02:10 +0800 Subject: [PATCH] dts: support layercape @@ -45,10 +45,10 @@ Signed-off-by: Yangbo Lu arch/arm/boot/dts/sun8i-a23-a33.dtsi | 2 +- arch/arm/boot/dts/sun9i-a80.dtsi | 2 +- arch/arm64/boot/dts/freescale/Makefile | 16 + - arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 134 +++ - arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 155 ++++ - arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 91 +++ - arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 517 ++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts | 177 ++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts | 198 +++++ + arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts | 134 +++ + arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi | 594 ++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi | 45 + .../boot/dts/freescale/fsl-ls1043a-qds-sdk.dts | 69 ++ arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts | 171 +++- @@ -65,7 +65,7 @@ Signed-off-by: Yangbo Lu arch/arm64/boot/dts/freescale/fsl-ls1046a.dtsi | 793 ++++++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts | 173 ++++ arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts | 236 ++++++ - arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 816 ++++++++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi | 818 ++++++++++++++++++ arch/arm64/boot/dts/freescale/fsl-ls2080a-qds.dts | 191 ++--- arch/arm64/boot/dts/freescale/fsl-ls2080a-rdb.dts | 169 ++-- arch/arm64/boot/dts/freescale/fsl-ls2080a-simu.dts | 9 +- @@ -76,7 +76,7 @@ Signed-off-by: Yangbo Lu arch/arm64/boot/dts/freescale/fsl-ls2088a.dtsi | 195 +++++ arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi | 198 +++++ arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi | 161 ++++ - arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 910 +++++++++++++++++++++ + arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 912 +++++++++++++++++++++ .../boot/dts/freescale/qoriq-bman1-portals.dtsi | 81 ++ arch/arm64/boot/dts/freescale/qoriq-dpaa-eth.dtsi | 66 ++ .../boot/dts/freescale/qoriq-fman3-0-10g-0.dtsi | 43 + @@ -93,7 +93,7 @@ Signed-off-by: Yangbo Lu arch/powerpc/boot/dts/fsl/qoriq-bman1-portals.dtsi | 10 + arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi | 4 +- arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi | 4 +- - 66 files changed, 7778 insertions(+), 1021 deletions(-) + 66 files changed, 7988 insertions(+), 1021 deletions(-) create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts create mode 100644 arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts @@ -484,7 +484,7 @@ Signed-off-by: Yangbo Lu }; + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1021a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -740,7 +740,7 @@ Signed-off-by: Yangbo Lu subdir-y := $(dts-dirs) --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts -@@ -0,0 +1,134 @@ +@@ -0,0 +1,177 @@ +/* + * Device Tree file for Freescale LS1012A Freedom Board. + * @@ -792,6 +792,11 @@ Signed-off-by: Yangbo Lu + model = "LS1012A Freedom Board"; + compatible = "fsl,ls1012a-frdm", "fsl,ls1012a"; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; @@ -868,6 +873,44 @@ Signed-off-by: Yangbo Lu + }; +}; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ +&sai2 { + status = "okay"; +}; @@ -877,7 +920,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts -@@ -0,0 +1,155 @@ +@@ -0,0 +1,198 @@ +/* + * Device Tree file for Freescale LS1012A QDS Board. + * @@ -929,6 +972,11 @@ Signed-off-by: Yangbo Lu + model = "LS1012A QDS Board"; + compatible = "fsl,ls1012a-qds", "fsl,ls1012a"; + ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; ++ + sys_mclk: clock-mclk { + compatible = "fixed-clock"; + #clock-cells = <0>; @@ -1018,6 +1066,44 @@ Signed-off-by: Yangbo Lu + }; +}; + ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x1>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x2>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x1>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x3>; ++ phy-mode = "sgmii-2500"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; ++ +&sai2 { + status = "okay"; +}; @@ -1035,7 +1121,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a-rdb.dts -@@ -0,0 +1,91 @@ +@@ -0,0 +1,134 @@ +/* + * Device Tree file for Freescale LS1012A RDB Board. + * @@ -1086,6 +1172,11 @@ Signed-off-by: Yangbo Lu +/ { + model = "LS1012A RDB Board"; + compatible = "fsl,ls1012a-rdb", "fsl,ls1012a"; ++ ++ aliases { ++ ethernet0 = &pfe_mac0; ++ ethernet1 = &pfe_mac1; ++ }; +}; + +&duart0 { @@ -1127,9 +1218,47 @@ Signed-off-by: Yangbo Lu + mmc-hs200-1_8v; + status = "okay"; +}; ++ ++&pfe { ++ status = "okay"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ ethernet@0 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x0>; /* GEM_ID */ ++ fsl,gemac-bus-id = <0x0>; /* BUS_ID */ ++ fsl,gemac-phy-id = <0x2>; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "sgmii"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x1>; /* enabled/disabled */ ++ }; ++ }; ++ ++ ethernet@1 { ++ compatible = "fsl,pfe-gemac-port"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ reg = <0x1>; /* GEM_ID */ ++ fsl,gemac-bus-id = < 0x1 >; /* BUS_ID */ ++ fsl,gemac-phy-id = < 0x1 >; /* PHY_ID */ ++ fsl,mdio-mux-val = <0x0>; ++ phy-mode = "rgmii-txid"; ++ fsl,pfe-phy-if-flags = <0x0>; ++ ++ mdio@0 { ++ reg = <0x0>; /* enabled/disabled */ ++ }; ++ }; ++}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1012a.dtsi -@@ -0,0 +1,517 @@ +@@ -0,0 +1,594 @@ +/* + * Device Tree Include file for Freescale Layerscape-1012A family SoC. + * @@ -1322,6 +1451,12 @@ Signed-off-by: Yangbo Lu + interrupts = ; + }; + ++ caam-dma { ++ compatible = "fsl,sec-v5.4-dma", ++ "fsl,sec-v5.0-dma", ++ "fsl,sec-v4.0-dma"; ++ }; ++ + rtic@60000 { + compatible = "fsl,sec-v5.4-rtic", + "fsl,sec-v5.0-rtic", @@ -1485,8 +1620,14 @@ Signed-off-by: Yangbo Lu + status = "disabled"; + }; + ++ rcpm: rcpm@1ee2000 { ++ compatible = "fsl,ls1012a-rcpm", "fsl,qoriq-rcpm-2.1"; ++ reg = <0x0 0x1ee2000 0x0 0x1000>; ++ fsl,#rcpm-wakeup-cells = <1>; ++ }; ++ + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1012a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -1645,6 +1786,71 @@ Signed-off-by: Yangbo Lu + dma-coherent; + status = "disabled"; + }; ++ ++ msi: msi-controller1@1572000 { ++ compatible = "fsl,ls1012a-msi"; ++ reg = <0x0 0x1572000 0x0 0x8>; ++ msi-controller; ++ interrupts = <0 126 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++ ++ pcie@3400000 { ++ compatible = "fsl,ls1012a-pcie", "snps,dw-pcie"; ++ reg = <0x00 0x03400000 0x0 0x00100000 /* controller registers */ ++ 0x40 0x00000000 0x0 0x00002000>; /* configuration space */ ++ reg-names = "regs", "config"; ++ interrupts = <0 118 0x4>, /* AER interrupt */ ++ <0 117 0x4>; /* PME interrupt */ ++ interrupt-names = "aer", "pme"; ++ #address-cells = <3>; ++ #size-cells = <2>; ++ device_type = "pci"; ++ num-lanes = <4>; ++ bus-range = <0x0 0xff>; ++ ranges = <0x81000000 0x0 0x00000000 0x40 0x00010000 0x0 0x00010000 /* downstream I/O */ ++ 0x82000000 0x0 0x40000000 0x40 0x40000000 0x0 0x40000000>; /* non-prefetchable memory */ ++ msi-parent = <&msi>; ++ #interrupt-cells = <1>; ++ interrupt-map-mask = <0 0 0 7>; ++ interrupt-map = <0000 0 0 1 &gic 0 110 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 2 &gic 0 111 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 3 &gic 0 112 IRQ_TYPE_LEVEL_HIGH>, ++ <0000 0 0 4 &gic 0 113 IRQ_TYPE_LEVEL_HIGH>; ++ }; ++ }; ++ ++ reserved-memory { ++ #address-cells = <2>; ++ #size-cells = <2>; ++ ranges; ++ ++ pfe_reserved: packetbuffer@83400000 { ++ reg = <0 0x83400000 0 0xc00000>; ++ }; ++ }; ++ ++ pfe: pfe@04000000 { ++ compatible = "fsl,pfe"; ++ reg = <0x0 0x04000000 0x0 0xc00000>, /* AXI 16M */ ++ <0x0 0x83400000 0x0 0xc00000>; /* PFE DDR 12M */ ++ reg-names = "pfe", "pfe-ddr"; ++ fsl,pfe-num-interfaces = <0x2>; ++ interrupts = <0 172 0x4>, /* HIF interrupt */ ++ <0 173 0x4>, /*HIF_NOCPY interrupt */ ++ <0 174 0x4>; /* WoL interrupt */ ++ interrupt-names = "pfe_hif", "pfe_hif_nocpy", "pfe_wol"; ++ memory-region = <&pfe_reserved>; ++ fsl,pfe-scfg = <&scfg 0>; ++ fsl,rcpm-wakeup = <&rcpm 0xf0000020>; ++ clocks = <&clockgen 4 0>; ++ clock-names = "pfe"; ++ ++ status = "okay"; ++ pfe_mac0: ethernet@0 { ++ }; ++ ++ pfe_mac1: ethernet@1 { ++ }; + }; +}; --- /dev/null @@ -2646,7 +2852,7 @@ Signed-off-by: Yangbo Lu }; + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1043a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -4326,7 +4532,7 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@29d0000 { -+ compatible = "fsl,ftm-alarm"; ++ compatible = "fsl,ls1046a-ftm"; + reg = <0x0 0x29d0000 0x0 0x10000>, + <0x0 0x1ee2140 0x0 0x4>; + reg-names = "ftm", "FlexTimer1"; @@ -4962,7 +5168,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls1088a.dtsi -@@ -0,0 +1,816 @@ +@@ -0,0 +1,818 @@ +/* + * Device Tree Include file for NXP Layerscape-1088A family SoC. + * @@ -5475,9 +5681,11 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@2800000 { -+ compatible = "fsl,ftm-alarm"; -+ reg = <0x0 0x2800000 0x0 0x10000>; ++ compatible = "fsl,ls1088a-ftm"; ++ reg = <0x0 0x2800000 0x0 0x10000>, ++ <0x0 0x1e34050 0x0 0x4>; + interrupts = <0 44 4>; ++ reg-names = "ftm", "FlexTimer1"; + }; + + i2c0: i2c@2000000 { @@ -8124,7 +8332,7 @@ Signed-off-by: Yangbo Lu +}; --- /dev/null +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi -@@ -0,0 +1,910 @@ +@@ -0,0 +1,912 @@ +/* + * Device Tree Include file for Freescale Layerscape-2080A family SoC. + * @@ -9015,9 +9223,11 @@ Signed-off-by: Yangbo Lu + }; + + ftm0: ftm0@2800000 { -+ compatible = "fsl,ftm-alarm"; -+ reg = <0x0 0x2800000 0x0 0x10000>; ++ compatible = "fsl,ls208xa-ftm"; ++ reg = <0x0 0x2800000 0x0 0x10000>, ++ <0x0 0x1e34050 0x0 0x4>; + interrupts = <0 44 4>; ++ reg-names = "ftm", "FlexTimer1"; + }; + }; + diff --git a/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch b/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch new file mode 100644 index 000000000..097c4320f --- /dev/null +++ b/target/linux/layerscape/patches-4.9/303-arm-imx-select-ARCH_DMA_ADDR_T_64BIT-for-LPAE.patch @@ -0,0 +1,23 @@ +From c079739fa1101dcf7a1e40a195e019065e327d15 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 20 Oct 2017 16:45:17 +0800 +Subject: [PATCH] arm: imx: select ARCH_DMA_ADDR_T_64BIT for LPAE + +Selected ARCH_DMA_ADDR_T_64BIT for LPAE since +hardware could support it. + +Signed-off-by: Yangbo Lu +--- + arch/arm/mach-imx/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/arch/arm/mach-imx/Kconfig ++++ b/arch/arm/mach-imx/Kconfig +@@ -1,6 +1,7 @@ + menuconfig ARCH_MXC + bool "Freescale i.MX family" + depends on ARCH_MULTI_V4_V5 || ARCH_MULTI_V6_V7 || ARM_SINGLE_ARMV7M ++ select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE + select ARCH_SUPPORTS_BIG_ENDIAN + select CLKSRC_IMX_GPT + select GENERIC_IRQ_CHIP diff --git a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch index 445a6fa02..362777317 100644 --- a/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/401-mtd-spi-nor-support-layerscape.patch @@ -1,4 +1,4 @@ -From 120fa458ffe2250ea58578ccfc85e674005463dc Mon Sep 17 00:00:00 2001 +From a3757157751a8a5302ee5e11faf828dc5db02018 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 10:53:50 +0800 Subject: [PATCH] mtd: spi-nor: support layerscape @@ -18,10 +18,10 @@ Signed-off-by: Ash Benz Signed-off-by: Yangbo Lu --- drivers/mtd/mtdchar.c | 2 +- - drivers/mtd/spi-nor/fsl-quadspi.c | 356 +++++++++++++++++++++++++++++++------- - drivers/mtd/spi-nor/spi-nor.c | 136 +++++++++++++-- + drivers/mtd/spi-nor/fsl-quadspi.c | 327 +++++++++++++++++++++++++++++++------- + drivers/mtd/spi-nor/spi-nor.c | 136 ++++++++++++++-- include/linux/mtd/spi-nor.h | 14 +- - 4 files changed, 432 insertions(+), 76 deletions(-) + 4 files changed, 409 insertions(+), 70 deletions(-) --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c @@ -209,13 +209,15 @@ Signed-off-by: Yangbo Lu fsl_qspi_unlock_lut(q); -@@ -382,25 +449,51 @@ static void fsl_qspi_init_lut(struct fsl +@@ -382,24 +449,50 @@ static void fsl_qspi_init_lut(struct fsl for (i = 0; i < QUADSPI_LUT_NUM; i++) qspi_writel(q, 0, base + QUADSPI_LUT_BASE + i * 4); - /* Quad Read */ - lut_base = SEQID_QUAD_READ * 4; -- ++ /* Read */ ++ lut_base = SEQID_READ * 4; + - if (q->nor_size <= SZ_16M) { - cmd = SPINOR_OP_READ_1_1_4; - addrlen = ADDR24BIT; @@ -226,9 +228,7 @@ Signed-off-by: Yangbo Lu - addrlen = ADDR32BIT; - dummy = 8; - } -+ /* Read */ -+ lut_base = SEQID_READ * 4; - +- - qspi_writel(q, LUT0(CMD, PAD1, cmd) | LUT1(ADDR, PAD1, addrlen), + if (nor->flash_read == SPI_NOR_FAST) { + qspi_writel(q, LUT0(CMD, PAD1, read_op) | @@ -242,10 +242,11 @@ Signed-off-by: Yangbo Lu + read_op = 0xEC; + qspi_writel(q, + LUT0(CMD, PAD1, read_op) | LUT1(ADDR, PAD4, addrlen), -+ base + QUADSPI_LUT(lut_base)); + base + QUADSPI_LUT(lut_base)); +- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo), + qspi_writel(q, + LUT0(MODE, PAD4, 0xff) | LUT1(DUMMY, PAD4, read_dm), -+ base + QUADSPI_LUT(lut_base + 1)); + base + QUADSPI_LUT(lut_base + 1)); + qspi_writel(q, + LUT0(FSL_READ, PAD4, rxfifo), + base + QUADSPI_LUT(lut_base + 2)); @@ -261,21 +262,19 @@ Signed-off-by: Yangbo Lu + /* read mode : 1-4-4, such as Spansion s25fl128s. */ + qspi_writel(q, LUT0(CMD, PAD1, read_op) + | LUT1(ADDR_DDR, PAD4, addrlen), - base + QUADSPI_LUT(lut_base)); -- qspi_writel(q, LUT0(DUMMY, PAD1, dummy) | LUT1(FSL_READ, PAD4, rxfifo), ++ base + QUADSPI_LUT(lut_base)); + + qspi_writel(q, LUT0(MODE_DDR, PAD4, 0xff) + | LUT1(DUMMY, PAD1, read_dm), - base + QUADSPI_LUT(lut_base + 1)); - ++ base + QUADSPI_LUT(lut_base + 1)); ++ + qspi_writel(q, LUT0(FSL_READ_DDR, PAD4, rxfifo) + | LUT1(JMP_ON_CS, PAD1, 0), + base + QUADSPI_LUT(lut_base + 2)); + } -+ + /* Write enable */ lut_base = SEQID_WREN * 4; - qspi_writel(q, LUT0(CMD, PAD1, SPINOR_OP_WREN), @@ -409,16 +502,8 @@ static void fsl_qspi_init_lut(struct fsl /* Page Program */ lut_base = SEQID_PP * 4; @@ -501,50 +500,7 @@ Signed-off-by: Yangbo Lu } /* -@@ -681,19 +860,36 @@ static void fsl_qspi_init_abh_read(struc - { - void __iomem *base = q->iobase; - int seqid; -+ const struct fsl_qspi_devtype_data *devtype_data = q->devtype_data; - - /* AHB configuration for access buffer 0/1/2 .*/ - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF0CR); - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF1CR); - qspi_writel(q, QUADSPI_BUFXCR_INVALID_MSTRID, base + QUADSPI_BUF2CR); -+ - /* -- * Set ADATSZ with the maximum AHB buffer size to improve the -- * read performance. -+ * Errata: A-009282: QuadSPI data prefetch may result in incorrect data -+ * Workaround: Keep the read data size to 64 bits (8 bytes). -+ * This disables the prefetch on the AHB buffer and -+ * prevents this issue from occurring. - */ -- qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -- ((q->devtype_data->ahb_buf_size / 8) -- << QUADSPI_BUF3CR_ADATSZ_SHIFT), -- base + QUADSPI_BUF3CR); -+ if (devtype_data->devtype == FSL_QUADSPI_LS2080A || -+ devtype_data->devtype == FSL_QUADSPI_LS1021A) { -+ -+ qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -+ (1 << QUADSPI_BUF3CR_ADATSZ_SHIFT), -+ base + QUADSPI_BUF3CR); -+ -+ } else { -+ /* -+ * Set ADATSZ with the maximum AHB buffer size to improve the -+ * read performance. -+ */ -+ qspi_writel(q, QUADSPI_BUF3CR_ALLMST_MASK | -+ ((q->devtype_data->ahb_buf_size / 8) -+ << QUADSPI_BUF3CR_ADATSZ_SHIFT), -+ base + QUADSPI_BUF3CR); -+ } - - /* We only use the buffer3 */ - qspi_writel(q, 0, base + QUADSPI_BUF0IND); -@@ -704,6 +900,11 @@ static void fsl_qspi_init_abh_read(struc +@@ -704,6 +883,11 @@ static void fsl_qspi_init_abh_read(struc seqid = fsl_qspi_get_seqid(q, q->nor[0].read_opcode); qspi_writel(q, seqid << QUADSPI_BFGENCR_SEQID_SHIFT, q->iobase + QUADSPI_BFGENCR); @@ -556,7 +512,7 @@ Signed-off-by: Yangbo Lu } /* This function was used to prepare and enable QSPI clock */ -@@ -822,6 +1023,7 @@ static const struct of_device_id fsl_qsp +@@ -822,6 +1006,7 @@ static const struct of_device_id fsl_qsp { .compatible = "fsl,imx7d-qspi", .data = (void *)&imx7d_data, }, { .compatible = "fsl,imx6ul-qspi", .data = (void *)&imx6ul_data, }, { .compatible = "fsl,ls1021a-qspi", .data = (void *)&ls1021a_data, }, @@ -564,21 +520,21 @@ Signed-off-by: Yangbo Lu { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, fsl_qspi_dt_ids); -@@ -835,8 +1037,12 @@ static int fsl_qspi_read_reg(struct spi_ +@@ -835,8 +1020,12 @@ static int fsl_qspi_read_reg(struct spi_ { int ret; struct fsl_qspi *q = nor->priv; + u32 to = 0; -+ -+ if (opcode == SPINOR_OP_SPANSION_RDAR) -+ u8tou32(&to, nor->cmd_buf, 4); - ret = fsl_qspi_runcmd(q, opcode, 0, len); ++ if (opcode == SPINOR_OP_SPANSION_RDAR) ++ u8tou32(&to, nor->cmd_buf, 4); ++ + ret = fsl_qspi_runcmd(q, opcode, to, len); if (ret) return ret; -@@ -848,9 +1054,13 @@ static int fsl_qspi_write_reg(struct spi +@@ -848,9 +1037,13 @@ static int fsl_qspi_write_reg(struct spi { struct fsl_qspi *q = nor->priv; int ret; @@ -593,7 +549,7 @@ Signed-off-by: Yangbo Lu if (ret) return ret; -@@ -859,7 +1069,7 @@ static int fsl_qspi_write_reg(struct spi +@@ -859,7 +1052,7 @@ static int fsl_qspi_write_reg(struct spi } else if (len > 0) { ret = fsl_qspi_nor_write(q, nor, opcode, 0, @@ -602,7 +558,7 @@ Signed-off-by: Yangbo Lu if (ret > 0) return 0; } else { -@@ -875,7 +1085,7 @@ static ssize_t fsl_qspi_write(struct spi +@@ -875,7 +1068,7 @@ static ssize_t fsl_qspi_write(struct spi { struct fsl_qspi *q = nor->priv; ssize_t ret = fsl_qspi_nor_write(q, nor, nor->program_opcode, to, @@ -611,7 +567,7 @@ Signed-off-by: Yangbo Lu /* invalid the data in the AHB buffer. */ fsl_qspi_invalid(q); -@@ -922,7 +1132,7 @@ static ssize_t fsl_qspi_read(struct spi_ +@@ -922,7 +1115,7 @@ static ssize_t fsl_qspi_read(struct spi_ len); /* Read out the data directly from the AHB buffer.*/ @@ -620,7 +576,7 @@ Signed-off-by: Yangbo Lu len); return len; -@@ -980,6 +1190,8 @@ static int fsl_qspi_probe(struct platfor +@@ -980,6 +1173,8 @@ static int fsl_qspi_probe(struct platfor struct spi_nor *nor; struct mtd_info *mtd; int ret, i = 0; @@ -629,7 +585,7 @@ Signed-off-by: Yangbo Lu q = devm_kzalloc(dev, sizeof(*q), GFP_KERNEL); if (!q) -@@ -1027,6 +1239,12 @@ static int fsl_qspi_probe(struct platfor +@@ -1027,6 +1222,12 @@ static int fsl_qspi_probe(struct platfor goto clk_failed; } @@ -642,7 +598,7 @@ Signed-off-by: Yangbo Lu /* find the irq */ ret = platform_get_irq(pdev, 0); if (ret < 0) { -@@ -1050,6 +1268,7 @@ static int fsl_qspi_probe(struct platfor +@@ -1050,6 +1251,7 @@ static int fsl_qspi_probe(struct platfor mutex_init(&q->lock); @@ -650,7 +606,7 @@ Signed-off-by: Yangbo Lu /* iterate the subnodes. */ for_each_available_child_of_node(dev->of_node, np) { /* skip the holes */ -@@ -1076,18 +1295,25 @@ static int fsl_qspi_probe(struct platfor +@@ -1076,18 +1278,25 @@ static int fsl_qspi_probe(struct platfor ret = of_property_read_u32(np, "spi-max-frequency", &q->clk_rate); if (ret < 0) @@ -680,7 +636,7 @@ Signed-off-by: Yangbo Lu /* Set the correct NOR size now. */ if (q->nor_size == 0) { -@@ -1110,8 +1336,12 @@ static int fsl_qspi_probe(struct platfor +@@ -1110,8 +1319,12 @@ static int fsl_qspi_probe(struct platfor nor->page_size = q->devtype_data->txfifo; i++; @@ -935,7 +891,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS /* prefer "small sector" erase if possible */ -@@ -1676,9 +1783,15 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1678,9 +1785,15 @@ int spi_nor_scan(struct spi_nor *nor, co /* Some devices cannot do fast-read, no matter what DT tells us */ if (info->flags & SPI_NOR_NO_FR) nor->flash_read = SPI_NOR_NORMAL; @@ -954,7 +910,7 @@ Signed-off-by: Yangbo Lu ret = set_quad_mode(nor, info); if (ret) { dev_err(dev, "quad mode not supported\n"); -@@ -1691,6 +1804,9 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1693,6 +1806,9 @@ int spi_nor_scan(struct spi_nor *nor, co /* Default commands */ switch (nor->flash_read) { diff --git a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch b/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch deleted file mode 100644 index 9db40dc2f..000000000 --- a/target/linux/layerscape/patches-4.9/601-net-support-layerscape.patch +++ /dev/null @@ -1,2365 +0,0 @@ -From 2ed7bff3d1f2fa6c5f6eff0b2bd98deaa3dc18b0 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 25 Sep 2017 10:57:14 +0800 -Subject: [PATCH] net: support layerscape - -This is a integrated patch for layerscape net support. - -Signed-off-by: Madalin Bucur -Signed-off-by: Zhao Qiang -Signed-off-by: Camelia Groza -Signed-off-by: Madalin Bucur -Signed-off-by: Zhang Ying-22455 -Signed-off-by: Ramneek Mehresh -Signed-off-by: Jarod Wilson -Signed-off-by: Nikhil Badola -Signed-off-by: stephen hemminger -Signed-off-by: Arnd Bergmann -Signed-off-by: Yangbo Lu ---- - drivers/base/devres.c | 66 +++++++++++++++ - drivers/base/soc.c | 66 +++++++++++++++ - drivers/net/bonding/bond_main.c | 10 +-- - drivers/net/dummy.c | 5 +- - drivers/net/ethernet/amazon/ena/ena_netdev.c | 10 +-- - drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 6 +- - drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 4 +- - drivers/net/ethernet/atheros/alx/main.c | 6 +- - drivers/net/ethernet/broadcom/b44.c | 5 +- - drivers/net/ethernet/broadcom/bnx2.c | 5 +- - drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 +- - drivers/net/ethernet/broadcom/tg3.c | 8 +- - drivers/net/ethernet/brocade/bna/bnad.c | 6 +- - drivers/net/ethernet/calxeda/xgmac.c | 5 +- - drivers/net/ethernet/cavium/thunder/nicvf_main.c | 5 +- - drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 7 +- - drivers/net/ethernet/cisco/enic/enic_main.c | 8 +- - drivers/net/ethernet/ec_bhf.c | 4 +- - drivers/net/ethernet/emulex/benet/be_main.c | 5 +- - drivers/net/ethernet/hisilicon/hns/hns_enet.c | 6 +- - drivers/net/ethernet/ibm/ehea/ehea_main.c | 5 +- - drivers/net/ethernet/intel/e1000e/e1000.h | 4 +- - drivers/net/ethernet/intel/e1000e/netdev.c | 5 +- - drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 6 +- - drivers/net/ethernet/intel/i40e/i40e.h | 5 +- - drivers/net/ethernet/intel/i40e/i40e_main.c | 18 ++-- - drivers/net/ethernet/intel/igb/igb_main.c | 10 +-- - drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 7 +- - drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 6 +- - drivers/net/ethernet/marvell/mvneta.c | 4 +- - drivers/net/ethernet/marvell/mvpp2.c | 4 +- - drivers/net/ethernet/marvell/sky2.c | 6 +- - drivers/net/ethernet/mediatek/mtk_eth_soc.c | 6 +- - drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 4 +- - drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 3 +- - drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 4 +- - drivers/net/ethernet/mellanox/mlxsw/switchx2.c | 3 +- - drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 9 +- - drivers/net/ethernet/neterion/vxge/vxge-main.c | 4 +- - .../net/ethernet/netronome/nfp/nfp_net_common.c | 6 +- - drivers/net/ethernet/nvidia/forcedeth.c | 4 +- - .../net/ethernet/qlogic/netxen/netxen_nic_main.c | 10 +-- - drivers/net/ethernet/qlogic/qede/qede_main.c | 7 +- - drivers/net/ethernet/qualcomm/emac/emac.c | 6 +- - drivers/net/ethernet/realtek/8139too.c | 9 +- - drivers/net/ethernet/realtek/r8169.c | 4 +- - drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 8 +- - drivers/net/ethernet/sfc/efx.c | 6 +- - drivers/net/ethernet/sun/niu.c | 6 +- - drivers/net/ethernet/synopsys/dwc_eth_qos.c | 4 +- - drivers/net/ethernet/tile/tilepro.c | 4 +- - drivers/net/ethernet/via/via-rhine.c | 8 +- - drivers/net/fjes/fjes_main.c | 7 +- - drivers/net/hyperv/netvsc_drv.c | 6 +- - drivers/net/ifb.c | 6 +- - drivers/net/ipvlan/ipvlan_main.c | 5 +- - drivers/net/loopback.c | 5 +- - drivers/net/macsec.c | 8 +- - drivers/net/macvlan.c | 5 +- - drivers/net/nlmon.c | 4 +- - drivers/net/ppp/ppp_generic.c | 4 +- - drivers/net/slip/slip.c | 3 +- - drivers/net/team/team.c | 3 +- - drivers/net/tun.c | 3 +- - drivers/net/veth.c | 6 +- - drivers/net/virtio_net.c | 6 +- - drivers/net/vmxnet3/vmxnet3_ethtool.c | 4 +- - drivers/net/vmxnet3/vmxnet3_int.h | 4 +- - drivers/net/vrf.c | 5 +- - drivers/net/xen-netfront.c | 6 +- - drivers/staging/netlogic/xlr_net.c | 10 +-- - include/linux/device.h | 19 +++++ - include/linux/fsl/svr.h | 97 ++++++++++++++++++++++ - include/linux/fsl_devices.h | 3 + - include/linux/netdev_features.h | 2 + - include/linux/netdevice.h | 12 ++- - include/linux/skbuff.h | 2 + - include/linux/sys_soc.h | 3 + - include/net/ip_tunnels.h | 4 +- - include/uapi/linux/if_ether.h | 1 + - net/8021q/vlan_dev.c | 5 +- - net/bridge/br_device.c | 6 +- - net/core/dev.c | 13 ++- - net/core/skbuff.c | 29 ++++++- - net/ipv4/ip_tunnel_core.c | 6 +- - net/l2tp/l2tp_eth.c | 6 +- - net/mac80211/iface.c | 4 +- - net/openvswitch/vport-internal_dev.c | 4 +- - net/sched/sch_generic.c | 7 ++ - net/sched/sch_teql.c | 5 +- - 90 files changed, 468 insertions(+), 298 deletions(-) - create mode 100644 include/linux/fsl/svr.h - ---- a/drivers/base/devres.c -+++ b/drivers/base/devres.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include "base.h" - -@@ -985,3 +986,68 @@ void devm_free_pages(struct device *dev, - &devres)); - } - EXPORT_SYMBOL_GPL(devm_free_pages); -+ -+static void devm_percpu_release(struct device *dev, void *pdata) -+{ -+ void __percpu *p; -+ -+ p = *(void __percpu **)pdata; -+ free_percpu(p); -+} -+ -+static int devm_percpu_match(struct device *dev, void *data, void *p) -+{ -+ struct devres *devr = container_of(data, struct devres, data); -+ -+ return *(void **)devr->data == p; -+} -+ -+/** -+ * __devm_alloc_percpu - Resource-managed alloc_percpu -+ * @dev: Device to allocate per-cpu memory for -+ * @size: Size of per-cpu memory to allocate -+ * @align: Alignment of per-cpu memory to allocate -+ * -+ * Managed alloc_percpu. Per-cpu memory allocated with this function is -+ * automatically freed on driver detach. -+ * -+ * RETURNS: -+ * Pointer to allocated memory on success, NULL on failure. -+ */ -+void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, -+ size_t align) -+{ -+ void *p; -+ void __percpu *pcpu; -+ -+ pcpu = __alloc_percpu(size, align); -+ if (!pcpu) -+ return NULL; -+ -+ p = devres_alloc(devm_percpu_release, sizeof(void *), GFP_KERNEL); -+ if (!p) { -+ free_percpu(pcpu); -+ return NULL; -+ } -+ -+ *(void __percpu **)p = pcpu; -+ -+ devres_add(dev, p); -+ -+ return pcpu; -+} -+EXPORT_SYMBOL_GPL(__devm_alloc_percpu); -+ -+/** -+ * devm_free_percpu - Resource-managed free_percpu -+ * @dev: Device this memory belongs to -+ * @pdata: Per-cpu memory to free -+ * -+ * Free memory allocated with devm_alloc_percpu(). -+ */ -+void devm_free_percpu(struct device *dev, void __percpu *pdata) -+{ -+ WARN_ON(devres_destroy(dev, devm_percpu_release, devm_percpu_match, -+ (void *)pdata)); -+} -+EXPORT_SYMBOL_GPL(devm_free_percpu); ---- a/drivers/base/soc.c -+++ b/drivers/base/soc.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - static DEFINE_IDA(soc_ida); - -@@ -159,3 +160,68 @@ static int __init soc_bus_register(void) - return bus_register(&soc_bus_type); - } - core_initcall(soc_bus_register); -+ -+static int soc_device_match_one(struct device *dev, void *arg) -+{ -+ struct soc_device *soc_dev = container_of(dev, struct soc_device, dev); -+ const struct soc_device_attribute *match = arg; -+ -+ if (match->machine && -+ !glob_match(match->machine, soc_dev->attr->machine)) -+ return 0; -+ -+ if (match->family && -+ !glob_match(match->family, soc_dev->attr->family)) -+ return 0; -+ -+ if (match->revision && -+ !glob_match(match->revision, soc_dev->attr->revision)) -+ return 0; -+ -+ if (match->soc_id && -+ !glob_match(match->soc_id, soc_dev->attr->soc_id)) -+ return 0; -+ -+ return 1; -+} -+ -+/* -+ * soc_device_match - identify the SoC in the machine -+ * @matches: zero-terminated array of possible matches -+ * -+ * returns the first matching entry of the argument array, or NULL -+ * if none of them match. -+ * -+ * This function is meant as a helper in place of of_match_node() -+ * in cases where either no device tree is available or the information -+ * in a device node is insufficient to identify a particular variant -+ * by its compatible strings or other properties. For new devices, -+ * the DT binding should always provide unique compatible strings -+ * that allow the use of of_match_node() instead. -+ * -+ * The calling function can use the .data entry of the -+ * soc_device_attribute to pass a structure or function pointer for -+ * each entry. -+ */ -+const struct soc_device_attribute *soc_device_match( -+ const struct soc_device_attribute *matches) -+{ -+ int ret = 0; -+ -+ if (!matches) -+ return NULL; -+ -+ while (!ret) { -+ if (!(matches->machine || matches->family || -+ matches->revision || matches->soc_id)) -+ break; -+ ret = bus_for_each_dev(&soc_bus_type, NULL, (void *)matches, -+ soc_device_match_one); -+ if (!ret) -+ matches++; -+ else -+ return matches; -+ } -+ return NULL; -+} -+EXPORT_SYMBOL_GPL(soc_device_match); ---- a/drivers/net/bonding/bond_main.c -+++ b/drivers/net/bonding/bond_main.c -@@ -211,8 +211,8 @@ static int lacp_fast; - - static int bond_init(struct net_device *bond_dev); - static void bond_uninit(struct net_device *bond_dev); --static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, -- struct rtnl_link_stats64 *stats); -+static void bond_get_stats(struct net_device *bond_dev, -+ struct rtnl_link_stats64 *stats); - static void bond_slave_arr_handler(struct work_struct *work); - static bool bond_time_in_interval(struct bonding *bond, unsigned long last_act, - int mod); -@@ -3336,8 +3336,8 @@ static void bond_fold_stats(struct rtnl_ - } - } - --static struct rtnl_link_stats64 *bond_get_stats(struct net_device *bond_dev, -- struct rtnl_link_stats64 *stats) -+static void bond_get_stats(struct net_device *bond_dev, -+ struct rtnl_link_stats64 *stats) - { - struct bonding *bond = netdev_priv(bond_dev); - struct rtnl_link_stats64 temp; -@@ -3361,8 +3361,6 @@ static struct rtnl_link_stats64 *bond_ge - - memcpy(&bond->bond_stats, stats, sizeof(*stats)); - spin_unlock(&bond->stats_lock); -- -- return stats; - } - - static int bond_do_ioctl(struct net_device *bond_dev, struct ifreq *ifr, int cmd) ---- a/drivers/net/dummy.c -+++ b/drivers/net/dummy.c -@@ -54,8 +54,8 @@ struct pcpu_dstats { - struct u64_stats_sync syncp; - }; - --static struct rtnl_link_stats64 *dummy_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void dummy_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - int i; - -@@ -73,7 +73,6 @@ static struct rtnl_link_stats64 *dummy_g - stats->tx_bytes += tbytes; - stats->tx_packets += tpackets; - } -- return stats; - } - - static netdev_tx_t dummy_xmit(struct sk_buff *skb, struct net_device *dev) ---- a/drivers/net/ethernet/amazon/ena/ena_netdev.c -+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c -@@ -2172,19 +2172,19 @@ err: - ena_com_delete_debug_area(adapter->ena_dev); - } - --static struct rtnl_link_stats64 *ena_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void ena_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ena_adapter *adapter = netdev_priv(netdev); - struct ena_admin_basic_stats ena_stats; - int rc; - - if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags)) -- return NULL; -+ return; - - rc = ena_com_get_dev_basic_stats(adapter->ena_dev, &ena_stats); - if (rc) -- return NULL; -+ return; - - stats->tx_bytes = ((u64)ena_stats.tx_bytes_high << 32) | - ena_stats.tx_bytes_low; -@@ -2211,8 +2211,6 @@ static struct rtnl_link_stats64 *ena_get - - stats->rx_errors = 0; - stats->tx_errors = 0; -- -- return stats; - } - - static const struct net_device_ops ena_netdev_ops = { ---- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -+++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c -@@ -1542,8 +1542,8 @@ static void xgbe_tx_timeout(struct net_d - schedule_work(&pdata->restart_work); - } - --static struct rtnl_link_stats64 *xgbe_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *s) -+static void xgbe_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *s) - { - struct xgbe_prv_data *pdata = netdev_priv(netdev); - struct xgbe_mmc_stats *pstats = &pdata->mmc_stats; -@@ -1569,8 +1569,6 @@ static struct rtnl_link_stats64 *xgbe_ge - s->tx_dropped = netdev->stats.tx_dropped; - - DBGPR("<--%s\n", __func__); -- -- return s; - } - - static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, ---- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c -@@ -1199,7 +1199,7 @@ err: - return ret; - } - --static struct rtnl_link_stats64 *xgene_enet_get_stats64( -+static void xgene_enet_get_stats64( - struct net_device *ndev, - struct rtnl_link_stats64 *storage) - { -@@ -1230,8 +1230,6 @@ static struct rtnl_link_stats64 *xgene_e - } - } - memcpy(storage, stats, sizeof(struct rtnl_link_stats64)); -- -- return storage; - } - - static int xgene_enet_set_mac_address(struct net_device *ndev, void *addr) ---- a/drivers/net/ethernet/atheros/alx/main.c -+++ b/drivers/net/ethernet/atheros/alx/main.c -@@ -1424,8 +1424,8 @@ static void alx_poll_controller(struct n - } - #endif - --static struct rtnl_link_stats64 *alx_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *net_stats) -+static void alx_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *net_stats) - { - struct alx_priv *alx = netdev_priv(dev); - struct alx_hw_stats *hw_stats = &alx->hw.stats; -@@ -1469,8 +1469,6 @@ static struct rtnl_link_stats64 *alx_get - net_stats->rx_packets = hw_stats->rx_ok + net_stats->rx_errors; - - spin_unlock(&alx->stats_lock); -- -- return net_stats; - } - - static const struct net_device_ops alx_netdev_ops = { ---- a/drivers/net/ethernet/broadcom/b44.c -+++ b/drivers/net/ethernet/broadcom/b44.c -@@ -1677,8 +1677,8 @@ static int b44_close(struct net_device * - return 0; - } - --static struct rtnl_link_stats64 *b44_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *nstat) -+static void b44_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *nstat) - { - struct b44 *bp = netdev_priv(dev); - struct b44_hw_stats *hwstat = &bp->hw_stats; -@@ -1721,7 +1721,6 @@ static struct rtnl_link_stats64 *b44_get - #endif - } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start)); - -- return nstat; - } - - static int __b44_load_mcast(struct b44 *bp, struct net_device *dev) ---- a/drivers/net/ethernet/broadcom/bnx2.c -+++ b/drivers/net/ethernet/broadcom/bnx2.c -@@ -6828,13 +6828,13 @@ bnx2_save_stats(struct bnx2 *bp) - (unsigned long) (bp->stats_blk->ctr + \ - bp->temp_stats_blk->ctr) - --static struct rtnl_link_stats64 * -+static void - bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats) - { - struct bnx2 *bp = netdev_priv(dev); - - if (bp->stats_blk == NULL) -- return net_stats; -+ return; - - net_stats->rx_packets = - GET_64BIT_NET_STATS(stat_IfHCInUcastPkts) + -@@ -6898,7 +6898,6 @@ bnx2_get_stats64(struct net_device *dev, - GET_32BIT_NET_STATS(stat_IfInMBUFDiscards) + - GET_32BIT_NET_STATS(stat_FwRxDrop); - -- return net_stats; - } - - /* All ethtool functions called with rtnl_lock */ ---- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c -+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c -@@ -5664,7 +5664,7 @@ static int bnxt_ioctl(struct net_device - return -EOPNOTSUPP; - } - --static struct rtnl_link_stats64 * -+static void - bnxt_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - u32 i; -@@ -5673,7 +5673,7 @@ bnxt_get_stats64(struct net_device *dev, - memset(stats, 0, sizeof(struct rtnl_link_stats64)); - - if (!bp->bnapi) -- return stats; -+ return; - - /* TODO check if we need to synchronize with bnxt_close path */ - for (i = 0; i < bp->cp_nr_rings; i++) { -@@ -5720,8 +5720,6 @@ bnxt_get_stats64(struct net_device *dev, - stats->tx_fifo_errors = le64_to_cpu(tx->tx_fifo_underruns); - stats->tx_errors = le64_to_cpu(tx->tx_err); - } -- -- return stats; - } - - static bool bnxt_mc_list_updated(struct bnxt *bp, u32 *rx_mask) ---- a/drivers/net/ethernet/broadcom/tg3.c -+++ b/drivers/net/ethernet/broadcom/tg3.c -@@ -14145,8 +14145,8 @@ static const struct ethtool_ops tg3_etht - .set_link_ksettings = tg3_set_link_ksettings, - }; - --static struct rtnl_link_stats64 *tg3_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void tg3_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct tg3 *tp = netdev_priv(dev); - -@@ -14154,13 +14154,11 @@ static struct rtnl_link_stats64 *tg3_get - if (!tp->hw_stats) { - *stats = tp->net_stats_prev; - spin_unlock_bh(&tp->lock); -- return stats; -+ return; - } - - tg3_get_nstats(tp, stats); - spin_unlock_bh(&tp->lock); -- -- return stats; - } - - static void tg3_set_rx_mode(struct net_device *dev) ---- a/drivers/net/ethernet/brocade/bna/bnad.c -+++ b/drivers/net/ethernet/brocade/bna/bnad.c -@@ -3111,7 +3111,7 @@ bnad_start_xmit(struct sk_buff *skb, str - * Used spin_lock to synchronize reading of stats structures, which - * is written by BNA under the same lock. - */ --static struct rtnl_link_stats64 * -+static void - bnad_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) - { - struct bnad *bnad = netdev_priv(netdev); -@@ -3123,8 +3123,6 @@ bnad_get_stats64(struct net_device *netd - bnad_netdev_hwstats_fill(bnad, stats); - - spin_unlock_irqrestore(&bnad->bna_lock, flags); -- -- return stats; - } - - static void -@@ -3430,7 +3428,7 @@ static const struct net_device_ops bnad_ - .ndo_open = bnad_open, - .ndo_stop = bnad_stop, - .ndo_start_xmit = bnad_start_xmit, -- .ndo_get_stats64 = bnad_get_stats64, -+ .ndo_get_stats64 = bnad_get_stats64, - .ndo_set_rx_mode = bnad_set_rx_mode, - .ndo_validate_addr = eth_validate_addr, - .ndo_set_mac_address = bnad_set_mac_address, ---- a/drivers/net/ethernet/calxeda/xgmac.c -+++ b/drivers/net/ethernet/calxeda/xgmac.c -@@ -1460,9 +1460,9 @@ static void xgmac_poll_controller(struct - } - #endif - --static struct rtnl_link_stats64 * -+static void - xgmac_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *storage) -+ struct rtnl_link_stats64 *storage) - { - struct xgmac_priv *priv = netdev_priv(dev); - void __iomem *base = priv->base; -@@ -1490,7 +1490,6 @@ xgmac_get_stats64(struct net_device *dev - - writel(0, base + XGMAC_MMC_CTRL); - spin_unlock_bh(&priv->stats_lock); -- return storage; - } - - static int xgmac_set_mac_address(struct net_device *dev, void *p) ---- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c -+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c -@@ -1423,8 +1423,8 @@ void nicvf_update_stats(struct nicvf *ni - nicvf_update_sq_stats(nic, qidx); - } - --static struct rtnl_link_stats64 *nicvf_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void nicvf_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct nicvf *nic = netdev_priv(netdev); - struct nicvf_hw_stats *hw_stats = &nic->hw_stats; -@@ -1440,7 +1440,6 @@ static struct rtnl_link_stats64 *nicvf_g - stats->tx_packets = hw_stats->tx_frames; - stats->tx_dropped = hw_stats->tx_drops; - -- return stats; - } - - static void nicvf_tx_timeout(struct net_device *dev) ---- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c -@@ -2383,8 +2383,8 @@ int cxgb4_remove_server_filter(const str - } - EXPORT_SYMBOL(cxgb4_remove_server_filter); - --static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *ns) -+static void cxgb_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *ns) - { - struct port_stats stats; - struct port_info *p = netdev_priv(dev); -@@ -2397,7 +2397,7 @@ static struct rtnl_link_stats64 *cxgb_ge - spin_lock(&adapter->stats_lock); - if (!netif_device_present(dev)) { - spin_unlock(&adapter->stats_lock); -- return ns; -+ return; - } - t4_get_port_stats_offset(adapter, p->tx_chan, &stats, - &p->stats_base); -@@ -2431,7 +2431,6 @@ static struct rtnl_link_stats64 *cxgb_ge - ns->tx_errors = stats.tx_error_frames; - ns->rx_errors = stats.rx_symbol_err + stats.rx_fcs_err + - ns->rx_length_errors + stats.rx_len_err + ns->rx_fifo_errors; -- return ns; - } - - static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd) ---- a/drivers/net/ethernet/cisco/enic/enic_main.c -+++ b/drivers/net/ethernet/cisco/enic/enic_main.c -@@ -680,8 +680,8 @@ static netdev_tx_t enic_hard_start_xmit( - } - - /* dev_base_lock rwlock held, nominally process context */ --static struct rtnl_link_stats64 *enic_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *net_stats) -+static void enic_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *net_stats) - { - struct enic *enic = netdev_priv(netdev); - struct vnic_stats *stats; -@@ -693,7 +693,7 @@ static struct rtnl_link_stats64 *enic_ge - * recorded stats. - */ - if (err == -ENOMEM) -- return net_stats; -+ return; - - net_stats->tx_packets = stats->tx.tx_frames_ok; - net_stats->tx_bytes = stats->tx.tx_bytes_ok; -@@ -707,8 +707,6 @@ static struct rtnl_link_stats64 *enic_ge - net_stats->rx_over_errors = enic->rq_truncated_pkts; - net_stats->rx_crc_errors = enic->rq_bad_fcs; - net_stats->rx_dropped = stats->rx.rx_no_bufs + stats->rx.rx_drop; -- -- return net_stats; - } - - static int enic_mc_sync(struct net_device *netdev, const u8 *mc_addr) ---- a/drivers/net/ethernet/ec_bhf.c -+++ b/drivers/net/ethernet/ec_bhf.c -@@ -458,7 +458,7 @@ static int ec_bhf_stop(struct net_device - return 0; - } - --static struct rtnl_link_stats64 * -+static void - ec_bhf_get_stats(struct net_device *net_dev, - struct rtnl_link_stats64 *stats) - { -@@ -473,8 +473,6 @@ ec_bhf_get_stats(struct net_device *net_ - - stats->tx_bytes = priv->stat_tx_bytes; - stats->rx_bytes = priv->stat_rx_bytes; -- -- return stats; - } - - static const struct net_device_ops ec_bhf_netdev_ops = { ---- a/drivers/net/ethernet/emulex/benet/be_main.c -+++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -646,8 +646,8 @@ void be_parse_stats(struct be_adapter *a - } - } - --static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void be_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct be_adapter *adapter = netdev_priv(netdev); - struct be_drv_stats *drvs = &adapter->drv_stats; -@@ -711,7 +711,6 @@ static struct rtnl_link_stats64 *be_get_ - stats->rx_fifo_errors = drvs->rxpp_fifo_overflow_drop + - drvs->rx_input_fifo_overflow_drop + - drvs->rx_drops_no_pbuf; -- return stats; - } - - void be_link_status_update(struct be_adapter *adapter, u8 link_status) ---- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c -+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c -@@ -1536,8 +1536,8 @@ void hns_nic_set_rx_mode(struct net_devi - hns_set_multicast_list(ndev); - } - --struct rtnl_link_stats64 *hns_nic_get_stats64(struct net_device *ndev, -- struct rtnl_link_stats64 *stats) -+static void hns_nic_get_stats64(struct net_device *ndev, -+ struct rtnl_link_stats64 *stats) - { - int idx = 0; - u64 tx_bytes = 0; -@@ -1579,8 +1579,6 @@ struct rtnl_link_stats64 *hns_nic_get_st - stats->tx_window_errors = ndev->stats.tx_window_errors; - stats->rx_compressed = ndev->stats.rx_compressed; - stats->tx_compressed = ndev->stats.tx_compressed; -- -- return stats; - } - - static u16 ---- a/drivers/net/ethernet/ibm/ehea/ehea_main.c -+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c -@@ -328,8 +328,8 @@ out: - spin_unlock_irqrestore(&ehea_bcmc_regs.lock, flags); - } - --static struct rtnl_link_stats64 *ehea_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void ehea_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct ehea_port *port = netdev_priv(dev); - u64 rx_packets = 0, tx_packets = 0, rx_bytes = 0, tx_bytes = 0; -@@ -352,7 +352,6 @@ static struct rtnl_link_stats64 *ehea_ge - - stats->multicast = port->stats.multicast; - stats->rx_errors = port->stats.rx_errors; -- return stats; - } - - static void ehea_update_stats(struct work_struct *work) ---- a/drivers/net/ethernet/intel/e1000e/e1000.h -+++ b/drivers/net/ethernet/intel/e1000e/e1000.h -@@ -493,8 +493,8 @@ int e1000e_setup_rx_resources(struct e10 - int e1000e_setup_tx_resources(struct e1000_ring *ring); - void e1000e_free_rx_resources(struct e1000_ring *ring); - void e1000e_free_tx_resources(struct e1000_ring *ring); --struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats); -+void e1000e_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats); - void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); - void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); - void e1000e_get_hw_control(struct e1000_adapter *adapter); ---- a/drivers/net/ethernet/intel/e1000e/netdev.c -+++ b/drivers/net/ethernet/intel/e1000e/netdev.c -@@ -5939,8 +5939,8 @@ static void e1000_reset_task(struct work - * - * Returns the address of the device statistics structure. - **/ --struct rtnl_link_stats64 *e1000e_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+void e1000e_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct e1000_adapter *adapter = netdev_priv(netdev); - -@@ -5977,7 +5977,6 @@ struct rtnl_link_stats64 *e1000e_get_sta - /* Tx Dropped needs to be maintained elsewhere */ - - spin_unlock(&adapter->stats64_lock); -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c -+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c -@@ -1128,8 +1128,8 @@ void fm10k_reset_rx_state(struct fm10k_i - * Returns 64bit statistics, for use in the ndo_get_stats64 callback. This - * function replaces fm10k_get_stats for kernels which support it. - */ --static struct rtnl_link_stats64 *fm10k_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void fm10k_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct fm10k_intfc *interface = netdev_priv(netdev); - struct fm10k_ring *ring; -@@ -1174,8 +1174,6 @@ static struct rtnl_link_stats64 *fm10k_g - - /* following stats updated by fm10k_service_task() */ - stats->rx_missed_errors = netdev->stats.rx_missed_errors; -- -- return stats; - } - - int fm10k_setup_tc(struct net_device *dev, u8 tc) ---- a/drivers/net/ethernet/intel/i40e/i40e.h -+++ b/drivers/net/ethernet/intel/i40e/i40e.h -@@ -797,9 +797,8 @@ static inline void i40e_irq_dynamic_enab - void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf); - void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf, bool clearpba); - #ifdef I40E_FCOE --struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *storage); -+void i40e_get_netdev_stats_struct(struct net_device *netdev, -+ struct rtnl_link_stats64 *storage); - int i40e_set_mac(struct net_device *netdev, void *p); - void i40e_set_rx_mode(struct net_device *netdev); - #endif ---- a/drivers/net/ethernet/intel/i40e/i40e_main.c -+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c -@@ -408,15 +408,11 @@ struct rtnl_link_stats64 *i40e_get_vsi_s - * Returns the address of the device statistics structure. - * The statistics are actually updated from the service task. - **/ --#ifdef I40E_FCOE --struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *stats) --#else --static struct rtnl_link_stats64 *i40e_get_netdev_stats_struct( -- struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+#ifndef I40E_FCOE -+static - #endif -+void i40e_get_netdev_stats_struct(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct i40e_netdev_priv *np = netdev_priv(netdev); - struct i40e_ring *tx_ring, *rx_ring; -@@ -425,10 +421,10 @@ static struct rtnl_link_stats64 *i40e_ge - int i; - - if (test_bit(__I40E_DOWN, &vsi->state)) -- return stats; -+ return; - - if (!vsi->tx_rings) -- return stats; -+ return; - - rcu_read_lock(); - for (i = 0; i < vsi->num_queue_pairs; i++) { -@@ -468,8 +464,6 @@ static struct rtnl_link_stats64 *i40e_ge - stats->rx_dropped = vsi_stats->rx_dropped; - stats->rx_crc_errors = vsi_stats->rx_crc_errors; - stats->rx_length_errors = vsi_stats->rx_length_errors; -- -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/igb/igb_main.c -+++ b/drivers/net/ethernet/intel/igb/igb_main.c -@@ -137,8 +137,8 @@ static void igb_update_phy_info(unsigned - static void igb_watchdog(unsigned long); - static void igb_watchdog_task(struct work_struct *); - static netdev_tx_t igb_xmit_frame(struct sk_buff *skb, struct net_device *); --static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void igb_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int igb_change_mtu(struct net_device *, int); - static int igb_set_mac(struct net_device *, void *); - static void igb_set_uta(struct igb_adapter *adapter, bool set); -@@ -5386,8 +5386,8 @@ static void igb_reset_task(struct work_s - * @netdev: network interface device structure - * @stats: rtnl_link_stats64 pointer - **/ --static struct rtnl_link_stats64 *igb_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void igb_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct igb_adapter *adapter = netdev_priv(netdev); - -@@ -5395,8 +5395,6 @@ static struct rtnl_link_stats64 *igb_get - igb_update_stats(adapter, &adapter->stats64); - memcpy(stats, &adapter->stats64, sizeof(*stats)); - spin_unlock(&adapter->stats64_lock); -- -- return stats; - } - - /** ---- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c -+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c -@@ -8085,8 +8085,9 @@ static void ixgbe_netpoll(struct net_dev - } - - #endif --static struct rtnl_link_stats64 *ixgbe_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+ -+static void ixgbe_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ixgbe_adapter *adapter = netdev_priv(netdev); - int i; -@@ -8124,13 +8125,13 @@ static struct rtnl_link_stats64 *ixgbe_g - } - } - rcu_read_unlock(); -+ - /* following stats updated by ixgbe_watchdog_task() */ - stats->multicast = netdev->stats.multicast; - stats->rx_errors = netdev->stats.rx_errors; - stats->rx_length_errors = netdev->stats.rx_length_errors; - stats->rx_crc_errors = netdev->stats.rx_crc_errors; - stats->rx_missed_errors = netdev->stats.rx_missed_errors; -- return stats; - } - - #ifdef CONFIG_IXGBE_DCB ---- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c -@@ -3880,8 +3880,8 @@ static void ixgbevf_shutdown(struct pci_ - ixgbevf_suspend(pdev, PMSG_SUSPEND); - } - --static struct rtnl_link_stats64 *ixgbevf_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void ixgbevf_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct ixgbevf_adapter *adapter = netdev_priv(netdev); - unsigned int start; -@@ -3914,8 +3914,6 @@ static struct rtnl_link_stats64 *ixgbevf - stats->tx_bytes += bytes; - stats->tx_packets += packets; - } -- -- return stats; - } - - #define IXGBEVF_MAX_MAC_HDR_LEN 127 ---- a/drivers/net/ethernet/marvell/mvneta.c -+++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -636,7 +636,7 @@ static void mvneta_mib_counters_clear(st - } - - /* Get System Network Statistics */ --static struct rtnl_link_stats64 * -+static void - mvneta_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -670,8 +670,6 @@ mvneta_get_stats64(struct net_device *de - stats->rx_dropped = dev->stats.rx_dropped; - - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - /* Rx descriptors helper methods */ ---- a/drivers/net/ethernet/marvell/mvpp2.c -+++ b/drivers/net/ethernet/marvell/mvpp2.c -@@ -5761,7 +5761,7 @@ error: - return err; - } - --static struct rtnl_link_stats64 * -+static void - mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mvpp2_port *port = netdev_priv(dev); -@@ -5793,8 +5793,6 @@ mvpp2_get_stats64(struct net_device *dev - stats->rx_errors = dev->stats.rx_errors; - stats->rx_dropped = dev->stats.rx_dropped; - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ---- a/drivers/net/ethernet/marvell/sky2.c -+++ b/drivers/net/ethernet/marvell/sky2.c -@@ -3898,8 +3898,8 @@ static void sky2_set_multicast(struct ne - gma_write16(hw, port, GM_RX_CTRL, reg); - } - --static struct rtnl_link_stats64 *sky2_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void sky2_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct sky2_port *sky2 = netdev_priv(dev); - struct sky2_hw *hw = sky2->hw; -@@ -3939,8 +3939,6 @@ static struct rtnl_link_stats64 *sky2_ge - stats->rx_dropped = dev->stats.rx_dropped; - stats->rx_fifo_errors = dev->stats.rx_fifo_errors; - stats->tx_fifo_errors = dev->stats.tx_fifo_errors; -- -- return stats; - } - - /* Can have one global because blinking is controlled by ---- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c -+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c -@@ -462,8 +462,8 @@ static void mtk_stats_update(struct mtk_ - } - } - --static struct rtnl_link_stats64 *mtk_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *storage) -+static void mtk_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *storage) - { - struct mtk_mac *mac = netdev_priv(dev); - struct mtk_hw_stats *hw_stats = mac->hw_stats; -@@ -494,8 +494,6 @@ static struct rtnl_link_stats64 *mtk_get - storage->tx_errors = dev->stats.tx_errors; - storage->rx_dropped = dev->stats.rx_dropped; - storage->tx_dropped = dev->stats.tx_dropped; -- -- return storage; - } - - static inline int mtk_max_frag_size(int mtu) ---- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c -+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c -@@ -1316,7 +1316,7 @@ static void mlx4_en_tx_timeout(struct ne - } - - --static struct rtnl_link_stats64 * -+static void - mlx4_en_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mlx4_en_priv *priv = netdev_priv(dev); -@@ -1324,8 +1324,6 @@ mlx4_en_get_stats64(struct net_device *d - spin_lock_bh(&priv->stats_lock); - netdev_stats_to_stats64(stats, &dev->stats); - spin_unlock_bh(&priv->stats_lock); -- -- return stats; - } - - static void mlx4_en_set_default_moderation(struct mlx4_en_priv *priv) ---- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c -@@ -2647,7 +2647,7 @@ mqprio: - return mlx5e_setup_tc(dev, tc->tc); - } - --struct rtnl_link_stats64 * -+static void - mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct mlx5e_priv *priv = netdev_priv(dev); -@@ -2681,7 +2681,6 @@ mlx5e_get_stats(struct net_device *dev, - stats->multicast = - VPORT_COUNTER_GET(vstats, received_eth_multicast.packets); - -- return stats; - } - - static void mlx5e_set_rx_mode(struct net_device *dev) ---- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c -@@ -949,15 +949,13 @@ out: - /* Return the stats from a cache that is updated periodically, - * as this function might get called in an atomic context. - */ --static struct rtnl_link_stats64 * -+static void - mlxsw_sp_port_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { - struct mlxsw_sp_port *mlxsw_sp_port = netdev_priv(dev); - - memcpy(stats, mlxsw_sp_port->hw_stats.cache, sizeof(*stats)); -- -- return stats; - } - - int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin, ---- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c -+++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c -@@ -351,7 +351,7 @@ static int mlxsw_sx_port_change_mtu(stru - return 0; - } - --static struct rtnl_link_stats64 * -+static void - mlxsw_sx_port_get_stats64(struct net_device *dev, - struct rtnl_link_stats64 *stats) - { -@@ -380,7 +380,6 @@ mlxsw_sx_port_get_stats64(struct net_dev - tx_dropped += p->tx_dropped; - } - stats->tx_dropped = tx_dropped; -- return stats; - } - - static const struct net_device_ops mlxsw_sx_port_netdev_ops = { ---- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c -+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c -@@ -378,8 +378,8 @@ static inline void put_be32(__be32 val, - __raw_writel((__force __u32) val, (__force void __iomem *)p); - } - --static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void myri10ge_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - - static void set_fw_name(struct myri10ge_priv *mgp, char *name, bool allocated) - { -@@ -3119,8 +3119,8 @@ drop: - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *myri10ge_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void myri10ge_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - const struct myri10ge_priv *mgp = netdev_priv(dev); - const struct myri10ge_slice_netstats *slice_stats; -@@ -3135,7 +3135,6 @@ static struct rtnl_link_stats64 *myri10g - stats->rx_dropped += slice_stats->rx_dropped; - stats->tx_dropped += slice_stats->tx_dropped; - } -- return stats; - } - - static void myri10ge_set_multicast_list(struct net_device *dev) ---- a/drivers/net/ethernet/neterion/vxge/vxge-main.c -+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c -@@ -3116,7 +3116,7 @@ static int vxge_change_mtu(struct net_de - * @stats: pointer to struct rtnl_link_stats64 - * - */ --static struct rtnl_link_stats64 * -+static void - vxge_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats) - { - struct vxgedev *vdev = netdev_priv(dev); -@@ -3155,8 +3155,6 @@ vxge_get_stats64(struct net_device *dev, - net_stats->tx_bytes += bytes; - net_stats->tx_errors += txstats->tx_errors; - } -- -- return net_stats; - } - - static enum vxge_hw_status vxge_timestamp_config(struct __vxge_hw_device *devh) ---- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c -+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c -@@ -2400,8 +2400,8 @@ int nfp_net_set_ring_size(struct nfp_net - return err; - } - --static struct rtnl_link_stats64 *nfp_net_stat64(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void nfp_net_stat64(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct nfp_net *nn = netdev_priv(netdev); - int r; -@@ -2431,8 +2431,6 @@ static struct rtnl_link_stats64 *nfp_net - stats->tx_bytes += data[1]; - stats->tx_errors += data[2]; - } -- -- return stats; - } - - static bool nfp_net_ebpf_capable(struct nfp_net *nn) ---- a/drivers/net/ethernet/nvidia/forcedeth.c -+++ b/drivers/net/ethernet/nvidia/forcedeth.c -@@ -1733,7 +1733,7 @@ static void nv_update_stats(struct net_d - * Called with read_lock(&dev_base_lock) held for read - - * only synchronized against unregister_netdevice. - */ --static struct rtnl_link_stats64* -+static void - nv_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *storage) - __acquires(&netdev_priv(dev)->hwstats_lock) - __releases(&netdev_priv(dev)->hwstats_lock) -@@ -1793,8 +1793,6 @@ nv_get_stats64(struct net_device *dev, s - - spin_unlock_bh(&np->hwstats_lock); - } -- -- return storage; - } - - /* ---- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c -@@ -90,8 +90,8 @@ static irqreturn_t netxen_msix_intr(int - - static void netxen_free_ip_list(struct netxen_adapter *, bool); - static void netxen_restore_indev_addr(struct net_device *dev, unsigned long); --static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void netxen_nic_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int netxen_nic_set_mac(struct net_device *netdev, void *p); - - /* PCI Device ID Table */ -@@ -2295,8 +2295,8 @@ request_reset: - clear_bit(__NX_RESETTING, &adapter->state); - } - --static struct rtnl_link_stats64 *netxen_nic_get_stats(struct net_device *netdev, -- struct rtnl_link_stats64 *stats) -+static void netxen_nic_get_stats(struct net_device *netdev, -+ struct rtnl_link_stats64 *stats) - { - struct netxen_adapter *adapter = netdev_priv(netdev); - -@@ -2306,8 +2306,6 @@ static struct rtnl_link_stats64 *netxen_ - stats->tx_bytes = adapter->stats.txbytes; - stats->rx_dropped = adapter->stats.rxdropped; - stats->tx_dropped = adapter->stats.txdropped; -- -- return stats; - } - - static irqreturn_t netxen_intr(int irq, void *data) ---- a/drivers/net/ethernet/qlogic/qede/qede_main.c -+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c -@@ -1803,9 +1803,8 @@ void qede_fill_by_demand_stats(struct qe - edev->stats.tx_mac_ctrl_frames = stats.tx_mac_ctrl_frames; - } - --static --struct rtnl_link_stats64 *qede_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void qede_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct qede_dev *edev = netdev_priv(dev); - -@@ -1835,8 +1834,6 @@ struct rtnl_link_stats64 *qede_get_stats - stats->collisions = edev->stats.tx_total_collisions; - stats->rx_crc_errors = edev->stats.rx_crc_errors; - stats->rx_frame_errors = edev->stats.rx_align_errors; -- -- return stats; - } - - #ifdef CONFIG_QED_SRIOV ---- a/drivers/net/ethernet/qualcomm/emac/emac.c -+++ b/drivers/net/ethernet/qualcomm/emac/emac.c -@@ -319,8 +319,8 @@ static int emac_ioctl(struct net_device - } - - /* Provide network statistics info for the interface */ --static struct rtnl_link_stats64 *emac_get_stats64(struct net_device *netdev, -- struct rtnl_link_stats64 *net_stats) -+static void emac_get_stats64(struct net_device *netdev, -+ struct rtnl_link_stats64 *net_stats) - { - struct emac_adapter *adpt = netdev_priv(netdev); - unsigned int addr = REG_MAC_RX_STATUS_BIN; -@@ -384,8 +384,6 @@ static struct rtnl_link_stats64 *emac_ge - net_stats->tx_window_errors = stats->tx_late_col; - - spin_unlock(&stats->lock); -- -- return net_stats; - } - - static const struct net_device_ops emac_netdev_ops = { ---- a/drivers/net/ethernet/realtek/8139too.c -+++ b/drivers/net/ethernet/realtek/8139too.c -@@ -653,9 +653,8 @@ static int rtl8139_poll(struct napi_stru - static irqreturn_t rtl8139_interrupt (int irq, void *dev_instance); - static int rtl8139_close (struct net_device *dev); - static int netdev_ioctl (struct net_device *dev, struct ifreq *rq, int cmd); --static struct rtnl_link_stats64 *rtl8139_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 -- *stats); -+static void rtl8139_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static void rtl8139_set_rx_mode (struct net_device *dev); - static void __set_rx_mode (struct net_device *dev); - static void rtl8139_hw_start (struct net_device *dev); -@@ -2521,7 +2520,7 @@ static int netdev_ioctl(struct net_devic - } - - --static struct rtnl_link_stats64 * -+static void - rtl8139_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rtl8139_private *tp = netdev_priv(dev); -@@ -2549,8 +2548,6 @@ rtl8139_get_stats64(struct net_device *d - stats->tx_packets = tp->tx_stats.packets; - stats->tx_bytes = tp->tx_stats.bytes; - } while (u64_stats_fetch_retry_irq(&tp->tx_stats.syncp, start)); -- -- return stats; - } - - /* Set or clear the multicast filter for this adaptor. ---- a/drivers/net/ethernet/realtek/r8169.c -+++ b/drivers/net/ethernet/realtek/r8169.c -@@ -7751,7 +7751,7 @@ err_pm_runtime_put: - goto out; - } - --static struct rtnl_link_stats64 * -+static void - rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rtl8169_private *tp = netdev_priv(dev); -@@ -7805,8 +7805,6 @@ rtl8169_get_stats64(struct net_device *d - le16_to_cpu(tp->tc_offset.tx_aborted); - - pm_runtime_put_noidle(&pdev->dev); -- -- return stats; - } - - static void rtl8169_net_suspend(struct net_device *dev) ---- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c -+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c -@@ -1721,11 +1721,9 @@ static inline u64 sxgbe_get_stat64(void - * This function is a driver entry point whenever ifconfig command gets - * executed to see device statistics. Statistics are number of - * bytes sent or received, errors occurred etc. -- * Return value: -- * This function returns various statistical information of device. - */ --static struct rtnl_link_stats64 *sxgbe_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void sxgbe_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct sxgbe_priv_data *priv = netdev_priv(dev); - void __iomem *ioaddr = priv->ioaddr; -@@ -1776,8 +1774,6 @@ static struct rtnl_link_stats64 *sxgbe_g - SXGBE_MMC_TXUFLWHI_GBCNT_REG); - writel(0, ioaddr + SXGBE_MMC_CTL_REG); - spin_unlock(&priv->stats_lock); -- -- return stats; - } - - /* sxgbe_set_features - entry point to set offload features of the device. ---- a/drivers/net/ethernet/sfc/efx.c -+++ b/drivers/net/ethernet/sfc/efx.c -@@ -2232,16 +2232,14 @@ int efx_net_stop(struct net_device *net_ - } - - /* Context: process, dev_base_lock or RTNL held, non-blocking. */ --static struct rtnl_link_stats64 *efx_net_stats(struct net_device *net_dev, -- struct rtnl_link_stats64 *stats) -+static void efx_net_stats(struct net_device *net_dev, -+ struct rtnl_link_stats64 *stats) - { - struct efx_nic *efx = netdev_priv(net_dev); - - spin_lock_bh(&efx->stats_lock); - efx->type->update_stats(efx, NULL, stats); - spin_unlock_bh(&efx->stats_lock); -- -- return stats; - } - - /* Context: netif_tx_lock held, BHs disabled. */ ---- a/drivers/net/ethernet/sun/niu.c -+++ b/drivers/net/ethernet/sun/niu.c -@@ -6294,8 +6294,8 @@ no_rings: - stats->tx_errors = errors; - } - --static struct rtnl_link_stats64 *niu_get_stats(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void niu_get_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct niu *np = netdev_priv(dev); - -@@ -6303,8 +6303,6 @@ static struct rtnl_link_stats64 *niu_get - niu_get_rx_stats(np, stats); - niu_get_tx_stats(np, stats); - } -- -- return stats; - } - - static void niu_load_hash_xmac(struct niu *np, u16 *hash) ---- a/drivers/net/ethernet/synopsys/dwc_eth_qos.c -+++ b/drivers/net/ethernet/synopsys/dwc_eth_qos.c -@@ -2490,7 +2490,7 @@ static void dwceqos_read_mmc_counters(st - dwceqos_read(lp, DWC_MMC_RXPACKETCOUNT_GB); - } - --static struct rtnl_link_stats64* -+static void - dwceqos_get_stats64(struct net_device *ndev, struct rtnl_link_stats64 *s) - { - unsigned long flags; -@@ -2522,8 +2522,6 @@ dwceqos_get_stats64(struct net_device *n - else - s->tx_errors = hwstats->txunderflowerror + - hwstats->txcarriererror; -- -- return s; - } - - static void ---- a/drivers/net/ethernet/tile/tilepro.c -+++ b/drivers/net/ethernet/tile/tilepro.c -@@ -2047,8 +2047,8 @@ static int tile_net_ioctl(struct net_dev - * - * Returns the address of the device statistics structure. - */ --static struct rtnl_link_stats64 *tile_net_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void tile_net_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct tile_net_priv *priv = netdev_priv(dev); - u64 rx_packets = 0, tx_packets = 0; ---- a/drivers/net/ethernet/via/via-rhine.c -+++ b/drivers/net/ethernet/via/via-rhine.c -@@ -513,8 +513,8 @@ static irqreturn_t rhine_interrupt(int i - static void rhine_tx(struct net_device *dev); - static int rhine_rx(struct net_device *dev, int limit); - static void rhine_set_rx_mode(struct net_device *dev); --static struct rtnl_link_stats64 *rhine_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats); -+static void rhine_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); - static const struct ethtool_ops netdev_ethtool_ops; - static int rhine_close(struct net_device *dev); -@@ -2222,7 +2222,7 @@ out_unlock: - mutex_unlock(&rp->task_lock); - } - --static struct rtnl_link_stats64 * -+static void - rhine_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct rhine_private *rp = netdev_priv(dev); -@@ -2245,8 +2245,6 @@ rhine_get_stats64(struct net_device *dev - stats->tx_packets = rp->tx_stats.packets; - stats->tx_bytes = rp->tx_stats.bytes; - } while (u64_stats_fetch_retry_irq(&rp->tx_stats.syncp, start)); -- -- return stats; - } - - static void rhine_set_rx_mode(struct net_device *dev) ---- a/drivers/net/fjes/fjes_main.c -+++ b/drivers/net/fjes/fjes_main.c -@@ -56,8 +56,7 @@ static void fjes_raise_intr_rxdata_task( - static void fjes_tx_stall_task(struct work_struct *); - static void fjes_force_close_task(struct work_struct *); - static irqreturn_t fjes_intr(int, void*); --static struct rtnl_link_stats64 * --fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); -+static void fjes_get_stats64(struct net_device *, struct rtnl_link_stats64 *); - static int fjes_change_mtu(struct net_device *, int); - static int fjes_vlan_rx_add_vid(struct net_device *, __be16 proto, u16); - static int fjes_vlan_rx_kill_vid(struct net_device *, __be16 proto, u16); -@@ -762,14 +761,12 @@ static void fjes_tx_retry(struct net_dev - netif_tx_wake_queue(queue); - } - --static struct rtnl_link_stats64 * -+static void - fjes_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats) - { - struct fjes_adapter *adapter = netdev_priv(netdev); - - memcpy(stats, &adapter->stats64, sizeof(struct rtnl_link_stats64)); -- -- return stats; - } - - static int fjes_change_mtu(struct net_device *netdev, int new_mtu) ---- a/drivers/net/hyperv/netvsc_drv.c -+++ b/drivers/net/hyperv/netvsc_drv.c -@@ -918,8 +918,8 @@ out: - return ret; - } - --static struct rtnl_link_stats64 *netvsc_get_stats64(struct net_device *net, -- struct rtnl_link_stats64 *t) -+static void netvsc_get_stats64(struct net_device *net, -+ struct rtnl_link_stats64 *t) - { - struct net_device_context *ndev_ctx = netdev_priv(net); - int cpu; -@@ -957,8 +957,6 @@ static struct rtnl_link_stats64 *netvsc_ - - t->rx_dropped = net->stats.rx_dropped; - t->rx_errors = net->stats.rx_errors; -- -- return t; - } - - static int netvsc_set_mac_addr(struct net_device *ndev, void *p) ---- a/drivers/net/ifb.c -+++ b/drivers/net/ifb.c -@@ -129,8 +129,8 @@ resched: - - } - --static struct rtnl_link_stats64 *ifb_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void ifb_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct ifb_dev_private *dp = netdev_priv(dev); - struct ifb_q_private *txp = dp->tx_private; -@@ -157,8 +157,6 @@ static struct rtnl_link_stats64 *ifb_sta - } - stats->rx_dropped = dev->stats.rx_dropped; - stats->tx_dropped = dev->stats.tx_dropped; -- -- return stats; - } - - static int ifb_dev_init(struct net_device *dev) ---- a/drivers/net/ipvlan/ipvlan_main.c -+++ b/drivers/net/ipvlan/ipvlan_main.c -@@ -296,8 +296,8 @@ static void ipvlan_set_multicast_mac_fil - dev_mc_sync(ipvlan->phy_dev, dev); - } - --static struct rtnl_link_stats64 *ipvlan_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *s) -+static void ipvlan_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *s) - { - struct ipvl_dev *ipvlan = netdev_priv(dev); - -@@ -334,7 +334,6 @@ static struct rtnl_link_stats64 *ipvlan_ - s->rx_dropped = rx_errs; - s->tx_dropped = tx_drps; - } -- return s; - } - - static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) ---- a/drivers/net/loopback.c -+++ b/drivers/net/loopback.c -@@ -97,8 +97,8 @@ static netdev_tx_t loopback_xmit(struct - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *loopback_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void loopback_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - u64 bytes = 0; - u64 packets = 0; -@@ -122,7 +122,6 @@ static struct rtnl_link_stats64 *loopbac - stats->tx_packets = packets; - stats->rx_bytes = bytes; - stats->tx_bytes = bytes; -- return stats; - } - - static u32 always_on(struct net_device *dev) ---- a/drivers/net/macsec.c -+++ b/drivers/net/macsec.c -@@ -2899,13 +2899,13 @@ static int macsec_change_mtu(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *macsec_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *s) -+static void macsec_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *s) - { - int cpu; - - if (!dev->tstats) -- return s; -+ return; - - for_each_possible_cpu(cpu) { - struct pcpu_sw_netstats *stats; -@@ -2929,8 +2929,6 @@ static struct rtnl_link_stats64 *macsec_ - - s->rx_dropped = dev->stats.rx_dropped; - s->tx_dropped = dev->stats.tx_dropped; -- -- return s; - } - - static int macsec_get_iflink(const struct net_device *dev) ---- a/drivers/net/macvlan.c -+++ b/drivers/net/macvlan.c -@@ -857,8 +857,8 @@ static void macvlan_uninit(struct net_de - macvlan_port_destroy(port->dev); - } - --static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void macvlan_dev_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct macvlan_dev *vlan = netdev_priv(dev); - -@@ -895,7 +895,6 @@ static struct rtnl_link_stats64 *macvlan - stats->rx_dropped = rx_errors; - stats->tx_dropped = tx_dropped; - } -- return stats; - } - - static int macvlan_vlan_rx_add_vid(struct net_device *dev, ---- a/drivers/net/nlmon.c -+++ b/drivers/net/nlmon.c -@@ -76,7 +76,7 @@ static int nlmon_close(struct net_device - return netlink_remove_tap(&nlmon->nt); - } - --static struct rtnl_link_stats64 * -+static void - nlmon_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -104,8 +104,6 @@ nlmon_get_stats64(struct net_device *dev - - stats->rx_bytes = bytes; - stats->tx_bytes = 0; -- -- return stats; - } - - static u32 always_on(struct net_device *dev) ---- a/drivers/net/ppp/ppp_generic.c -+++ b/drivers/net/ppp/ppp_generic.c -@@ -1312,7 +1312,7 @@ ppp_net_ioctl(struct net_device *dev, st - return err; - } - --static struct rtnl_link_stats64* -+static void - ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64) - { - struct ppp *ppp = netdev_priv(dev); -@@ -1332,8 +1332,6 @@ ppp_get_stats64(struct net_device *dev, - stats64->rx_dropped = dev->stats.rx_dropped; - stats64->tx_dropped = dev->stats.tx_dropped; - stats64->rx_length_errors = dev->stats.rx_length_errors; -- -- return stats64; - } - - static int ppp_dev_init(struct net_device *dev) ---- a/drivers/net/slip/slip.c -+++ b/drivers/net/slip/slip.c -@@ -571,7 +571,7 @@ static int sl_change_mtu(struct net_devi - - /* Netdevice get statistics request */ - --static struct rtnl_link_stats64 * -+static void - sl_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct net_device_stats *devstats = &dev->stats; -@@ -602,7 +602,6 @@ sl_get_stats64(struct net_device *dev, s - stats->collisions += comp->sls_o_misses; - } - #endif -- return stats; - } - - /* Netdevice register callback */ ---- a/drivers/net/team/team.c -+++ b/drivers/net/team/team.c -@@ -1798,7 +1798,7 @@ unwind: - return err; - } - --static struct rtnl_link_stats64 * -+static void - team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - struct team *team = netdev_priv(dev); -@@ -1835,7 +1835,6 @@ team_get_stats64(struct net_device *dev, - stats->rx_dropped = rx_dropped; - stats->tx_dropped = tx_dropped; - stats->rx_nohandler = rx_nohandler; -- return stats; - } - - static int team_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) ---- a/drivers/net/tun.c -+++ b/drivers/net/tun.c -@@ -983,7 +983,7 @@ static void tun_set_headroom(struct net_ - tun->align = new_hr; - } - --static struct rtnl_link_stats64 * -+static void - tun_net_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - u32 rx_dropped = 0, tx_dropped = 0, rx_frame_errors = 0; -@@ -1017,7 +1017,6 @@ tun_net_get_stats64(struct net_device *d - stats->rx_dropped = rx_dropped; - stats->rx_frame_errors = rx_frame_errors; - stats->tx_dropped = tx_dropped; -- return stats; - } - - static const struct net_device_ops tun_netdev_ops = { ---- a/drivers/net/veth.c -+++ b/drivers/net/veth.c -@@ -161,8 +161,8 @@ static u64 veth_stats_one(struct pcpu_vs - return atomic64_read(&priv->dropped); - } - --static struct rtnl_link_stats64 *veth_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void veth_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct veth_priv *priv = netdev_priv(dev); - struct net_device *peer; -@@ -180,8 +180,6 @@ static struct rtnl_link_stats64 *veth_ge - tot->rx_packets = one.packets; - } - rcu_read_unlock(); -- -- return tot; - } - - /* fake multicast ability */ ---- a/drivers/net/virtio_net.c -+++ b/drivers/net/virtio_net.c -@@ -1017,8 +1017,8 @@ out: - return ret; - } - --static struct rtnl_link_stats64 *virtnet_stats(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void virtnet_stats(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct virtnet_info *vi = netdev_priv(dev); - int cpu; -@@ -1051,8 +1051,6 @@ static struct rtnl_link_stats64 *virtnet - tot->rx_dropped = dev->stats.rx_dropped; - tot->rx_length_errors = dev->stats.rx_length_errors; - tot->rx_frame_errors = dev->stats.rx_frame_errors; -- -- return tot; - } - - #ifdef CONFIG_NET_POLL_CONTROLLER ---- a/drivers/net/vmxnet3/vmxnet3_ethtool.c -+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c -@@ -113,7 +113,7 @@ vmxnet3_global_stats[] = { - }; - - --struct rtnl_link_stats64 * -+void - vmxnet3_get_stats64(struct net_device *netdev, - struct rtnl_link_stats64 *stats) - { -@@ -160,8 +160,6 @@ vmxnet3_get_stats64(struct net_device *n - stats->rx_dropped += drvRxStats->drop_total; - stats->multicast += devRxStats->mcastPktsRxOK; - } -- -- return stats; - } - - static int ---- a/drivers/net/vmxnet3/vmxnet3_int.h -+++ b/drivers/net/vmxnet3/vmxnet3_int.h -@@ -466,8 +466,8 @@ vmxnet3_create_queues(struct vmxnet3_ada - - void vmxnet3_set_ethtool_ops(struct net_device *netdev); - --struct rtnl_link_stats64 * --vmxnet3_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats); -+void vmxnet3_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats); - - extern char vmxnet3_driver_name[]; - #endif ---- a/drivers/net/vrf.c -+++ b/drivers/net/vrf.c -@@ -79,8 +79,8 @@ static void vrf_tx_error(struct net_devi - kfree_skb(skb); - } - --static struct rtnl_link_stats64 *vrf_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void vrf_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - int i; - -@@ -104,7 +104,6 @@ static struct rtnl_link_stats64 *vrf_get - stats->rx_bytes += rbytes; - stats->rx_packets += rpkts; - } -- return stats; - } - - /* Local traffic destined to local address. Reinsert the packet to rx ---- a/drivers/net/xen-netfront.c -+++ b/drivers/net/xen-netfront.c -@@ -1081,8 +1081,8 @@ static int xennet_change_mtu(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *xennet_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+static void xennet_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - struct netfront_info *np = netdev_priv(dev); - int cpu; -@@ -1113,8 +1113,6 @@ static struct rtnl_link_stats64 *xennet_ - - tot->rx_errors = dev->stats.rx_errors; - tot->tx_dropped = dev->stats.tx_dropped; -- -- return tot; - } - - static void xennet_release_tx_bufs(struct netfront_queue *queue) ---- a/drivers/staging/netlogic/xlr_net.c -+++ b/drivers/staging/netlogic/xlr_net.c -@@ -395,14 +395,6 @@ static void xlr_stats(struct net_device - TX_DROP_FRAME_COUNTER); - } - --static struct rtnl_link_stats64 *xlr_get_stats64(struct net_device *ndev, -- struct rtnl_link_stats64 *stats -- ) --{ -- xlr_stats(ndev, stats); -- return stats; --} -- - static const struct net_device_ops xlr_netdev_ops = { - .ndo_open = xlr_net_open, - .ndo_stop = xlr_net_stop, -@@ -410,7 +402,7 @@ static const struct net_device_ops xlr_n - .ndo_select_queue = xlr_net_select_queue, - .ndo_set_mac_address = xlr_net_set_mac_addr, - .ndo_set_rx_mode = xlr_set_rx_mode, -- .ndo_get_stats64 = xlr_get_stats64, -+ .ndo_get_stats64 = xlr_stats, - }; - - /* ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -688,6 +688,25 @@ void __iomem *devm_ioremap_resource(stru - int devm_add_action(struct device *dev, void (*action)(void *), void *data); - void devm_remove_action(struct device *dev, void (*action)(void *), void *data); - -+/** -+ * devm_alloc_percpu - Resource-managed alloc_percpu -+ * @dev: Device to allocate per-cpu memory for -+ * @type: Type to allocate per-cpu memory for -+ * -+ * Managed alloc_percpu. Per-cpu memory allocated with this function is -+ * automatically freed on driver detach. -+ * -+ * RETURNS: -+ * Pointer to allocated memory on success, NULL on failure. -+ */ -+#define devm_alloc_percpu(dev, type) \ -+ ((typeof(type) __percpu *)__devm_alloc_percpu((dev), sizeof(type), \ -+ __alignof__(type))) -+ -+void __percpu *__devm_alloc_percpu(struct device *dev, size_t size, -+ size_t align); -+void devm_free_percpu(struct device *dev, void __percpu *pdata); -+ - static inline int devm_add_action_or_reset(struct device *dev, - void (*action)(void *), void *data) - { ---- /dev/null -+++ b/include/linux/fsl/svr.h -@@ -0,0 +1,97 @@ -+/* -+ * MPC85xx cpu type detection -+ * -+ * Copyright 2011-2012 Freescale Semiconductor, Inc. -+ * -+ * This is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ */ -+ -+#ifndef FSL_SVR_H -+#define FSL_SVR_H -+ -+#define SVR_REV(svr) ((svr) & 0xFF) /* SOC design resision */ -+#define SVR_MAJ(svr) (((svr) >> 4) & 0xF) /* Major revision field*/ -+#define SVR_MIN(svr) (((svr) >> 0) & 0xF) /* Minor revision field*/ -+ -+/* Some parts define SVR[0:23] as the SOC version */ -+#define SVR_SOC_VER(svr) (((svr) >> 8) & 0xFFF7FF) /* SOC Version fields */ -+ -+#define SVR_8533 0x803400 -+#define SVR_8535 0x803701 -+#define SVR_8536 0x803700 -+#define SVR_8540 0x803000 -+#define SVR_8541 0x807200 -+#define SVR_8543 0x803200 -+#define SVR_8544 0x803401 -+#define SVR_8545 0x803102 -+#define SVR_8547 0x803101 -+#define SVR_8548 0x803100 -+#define SVR_8555 0x807100 -+#define SVR_8560 0x807000 -+#define SVR_8567 0x807501 -+#define SVR_8568 0x807500 -+#define SVR_8569 0x808000 -+#define SVR_8572 0x80E000 -+#define SVR_P1010 0x80F100 -+#define SVR_P1011 0x80E500 -+#define SVR_P1012 0x80E501 -+#define SVR_P1013 0x80E700 -+#define SVR_P1014 0x80F101 -+#define SVR_P1017 0x80F700 -+#define SVR_P1020 0x80E400 -+#define SVR_P1021 0x80E401 -+#define SVR_P1022 0x80E600 -+#define SVR_P1023 0x80F600 -+#define SVR_P1024 0x80E402 -+#define SVR_P1025 0x80E403 -+#define SVR_P2010 0x80E300 -+#define SVR_P2020 0x80E200 -+#define SVR_P2040 0x821000 -+#define SVR_P2041 0x821001 -+#define SVR_P3041 0x821103 -+#define SVR_P4040 0x820100 -+#define SVR_P4080 0x820000 -+#define SVR_P5010 0x822100 -+#define SVR_P5020 0x822000 -+#define SVR_P5021 0X820500 -+#define SVR_P5040 0x820400 -+#define SVR_T4240 0x824000 -+#define SVR_T4120 0x824001 -+#define SVR_T4160 0x824100 -+#define SVR_T4080 0x824102 -+#define SVR_C291 0x850000 -+#define SVR_C292 0x850020 -+#define SVR_C293 0x850030 -+#define SVR_B4860 0X868000 -+#define SVR_G4860 0x868001 -+#define SVR_G4060 0x868003 -+#define SVR_B4440 0x868100 -+#define SVR_G4440 0x868101 -+#define SVR_B4420 0x868102 -+#define SVR_B4220 0x868103 -+#define SVR_T1040 0x852000 -+#define SVR_T1041 0x852001 -+#define SVR_T1042 0x852002 -+#define SVR_T1020 0x852100 -+#define SVR_T1021 0x852101 -+#define SVR_T1022 0x852102 -+#define SVR_T1023 0x854100 -+#define SVR_T1024 0x854000 -+#define SVR_T2080 0x853000 -+#define SVR_T2081 0x853100 -+ -+#define SVR_8610 0x80A000 -+#define SVR_8641 0x809000 -+#define SVR_8641D 0x809001 -+ -+#define SVR_9130 0x860001 -+#define SVR_9131 0x860000 -+#define SVR_9132 0x861000 -+#define SVR_9232 0x861400 -+ -+#define SVR_Unknown 0xFFFFFF -+ -+#endif ---- a/include/linux/fsl_devices.h -+++ b/include/linux/fsl_devices.h -@@ -99,7 +99,10 @@ struct fsl_usb2_platform_data { - unsigned suspended:1; - unsigned already_suspended:1; - unsigned has_fsl_erratum_a007792:1; -+ unsigned has_fsl_erratum_14:1; - unsigned has_fsl_erratum_a005275:1; -+ unsigned has_fsl_erratum_a006918:1; -+ unsigned has_fsl_erratum_a005697:1; - unsigned check_phy_clk_valid:1; - - /* register save area for suspend/resume */ ---- a/include/linux/netdev_features.h -+++ b/include/linux/netdev_features.h -@@ -74,6 +74,7 @@ enum { - NETIF_F_BUSY_POLL_BIT, /* Busy poll */ - - NETIF_F_HW_TC_BIT, /* Offload TC infrastructure */ -+ NETIF_F_HW_ACCEL_MQ_BIT, /* Hardware-accelerated multiqueue */ - - /* - * Add your fresh new feature above and remember to update -@@ -136,6 +137,7 @@ enum { - #define NETIF_F_HW_L2FW_DOFFLOAD __NETIF_F(HW_L2FW_DOFFLOAD) - #define NETIF_F_BUSY_POLL __NETIF_F(BUSY_POLL) - #define NETIF_F_HW_TC __NETIF_F(HW_TC) -+#define NETIF_F_HW_ACCEL_MQ __NETIF_F(HW_ACCEL_MQ) - - #define for_each_netdev_feature(mask_addr, bit) \ - for_each_set_bit(bit, (unsigned long *)mask_addr, NETDEV_FEATURE_COUNT) ---- a/include/linux/netdevice.h -+++ b/include/linux/netdevice.h -@@ -916,8 +916,8 @@ struct netdev_xdp { - * Callback used when the transmitter has not made any progress - * for dev->watchdog ticks. - * -- * struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, -- * struct rtnl_link_stats64 *storage); -+ * void (*ndo_get_stats64)(struct net_device *dev, -+ * struct rtnl_link_stats64 *storage); - * struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); - * Called when a user wants to get the network device usage - * statistics. Drivers must do one of the following: -@@ -1165,8 +1165,8 @@ struct net_device_ops { - struct neigh_parms *); - void (*ndo_tx_timeout) (struct net_device *dev); - -- struct rtnl_link_stats64* (*ndo_get_stats64)(struct net_device *dev, -- struct rtnl_link_stats64 *storage); -+ void (*ndo_get_stats64)(struct net_device *dev, -+ struct rtnl_link_stats64 *storage); - bool (*ndo_has_offload_stats)(int attr_id); - int (*ndo_get_offload_stats)(int attr_id, - const struct net_device *dev, -@@ -1509,6 +1509,8 @@ enum netdev_priv_flags { - * @if_port: Selectable AUI, TP, ... - * @dma: DMA channel - * @mtu: Interface MTU value -+ * @min_mtu: Interface Minimum MTU value -+ * @max_mtu: Interface Maximum MTU value - * @type: Interface hardware type - * @hard_header_len: Maximum hardware header length. - * @min_header_len: Minimum hardware header length -@@ -1735,6 +1737,8 @@ struct net_device { - unsigned char dma; - - unsigned int mtu; -+ unsigned int min_mtu; -+ unsigned int max_mtu; - unsigned short type; - unsigned short hard_header_len; - unsigned short min_header_len; ---- a/include/linux/skbuff.h -+++ b/include/linux/skbuff.h -@@ -903,6 +903,7 @@ void kfree_skb(struct sk_buff *skb); - void kfree_skb_list(struct sk_buff *segs); - void skb_tx_error(struct sk_buff *skb); - void consume_skb(struct sk_buff *skb); -+void skb_recycle(struct sk_buff *skb); - void __kfree_skb(struct sk_buff *skb); - extern struct kmem_cache *skbuff_head_cache; - -@@ -3057,6 +3058,7 @@ static inline void skb_free_datagram_loc - } - int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, unsigned int flags); - int skb_copy_bits(const struct sk_buff *skb, int offset, void *to, int len); -+void copy_skb_header(struct sk_buff *new, const struct sk_buff *old); - int skb_store_bits(struct sk_buff *skb, int offset, const void *from, int len); - __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, int offset, u8 *to, - int len, __wsum csum); ---- a/include/linux/sys_soc.h -+++ b/include/linux/sys_soc.h -@@ -13,6 +13,7 @@ struct soc_device_attribute { - const char *family; - const char *revision; - const char *soc_id; -+ const void *data; - }; - - /** -@@ -34,4 +35,6 @@ void soc_device_unregister(struct soc_de - */ - struct device *soc_device_to_device(struct soc_device *soc); - -+const struct soc_device_attribute *soc_device_match( -+ const struct soc_device_attribute *matches); - #endif /* __SOC_BUS_H */ ---- a/include/net/ip_tunnels.h -+++ b/include/net/ip_tunnels.h -@@ -261,8 +261,8 @@ int ip_tunnel_ioctl(struct net_device *d - int __ip_tunnel_change_mtu(struct net_device *dev, int new_mtu, bool strict); - int ip_tunnel_change_mtu(struct net_device *dev, int new_mtu); - --struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot); -+void ip_tunnel_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot); - struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn, - int link, __be16 flags, - __be32 remote, __be32 local, ---- a/include/uapi/linux/if_ether.h -+++ b/include/uapi/linux/if_ether.h -@@ -35,6 +35,7 @@ - #define ETH_DATA_LEN 1500 /* Max. octets in payload */ - #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ - #define ETH_FCS_LEN 4 /* Octets in the FCS */ -+#define ETH_MIN_MTU 68 /* Min IPv4 MTU per RFC791 */ - - /* - * These are the defined Ethernet Protocol ID's. ---- a/net/8021q/vlan_dev.c -+++ b/net/8021q/vlan_dev.c -@@ -671,7 +671,8 @@ static int vlan_ethtool_get_ts_info(stru - return 0; - } - --static struct rtnl_link_stats64 *vlan_dev_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) -+static void vlan_dev_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct vlan_pcpu_stats *p; - u32 rx_errors = 0, tx_dropped = 0; -@@ -702,8 +703,6 @@ static struct rtnl_link_stats64 *vlan_de - } - stats->rx_errors = rx_errors; - stats->tx_dropped = tx_dropped; -- -- return stats; - } - - #ifdef CONFIG_NET_POLL_CONTROLLER ---- a/net/bridge/br_device.c -+++ b/net/bridge/br_device.c -@@ -156,8 +156,8 @@ static int br_dev_stop(struct net_device - return 0; - } - --static struct rtnl_link_stats64 *br_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void br_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct net_bridge *br = netdev_priv(dev); - struct pcpu_sw_netstats tmp, sum = { 0 }; -@@ -181,8 +181,6 @@ static struct rtnl_link_stats64 *br_get_ - stats->tx_packets = sum.tx_packets; - stats->rx_bytes = sum.rx_bytes; - stats->rx_packets = sum.rx_packets; -- -- return stats; - } - - static int br_change_mtu(struct net_device *dev, int new_mtu) ---- a/net/core/dev.c -+++ b/net/core/dev.c -@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev, - if (new_mtu == dev->mtu) - return 0; - -- /* MTU must be positive. */ -- if (new_mtu < 0) -+ /* MTU must be positive, and in range */ -+ if (new_mtu < 0 || new_mtu < dev->min_mtu) { -+ net_err_ratelimited("%s: Invalid MTU %d requested, hw min %d\n", -+ dev->name, new_mtu, dev->min_mtu); - return -EINVAL; -+ } -+ -+ if (dev->max_mtu > 0 && new_mtu > dev->max_mtu) { -+ net_err_ratelimited("%s: Invalid MTU %d requested, hw max %d\n", -+ dev->name, new_mtu, dev->min_mtu); -+ return -EINVAL; -+ } - - if (!netif_device_present(dev)) - return -ENODEV; ---- a/net/core/skbuff.c -+++ b/net/core/skbuff.c -@@ -842,6 +842,32 @@ void napi_consume_skb(struct sk_buff *sk - } - EXPORT_SYMBOL(napi_consume_skb); - -+/** -+ * skb_recycle - clean up an skb for reuse -+ * @skb: buffer -+ * -+ * Recycles the skb to be reused as a receive buffer. This -+ * function does any necessary reference count dropping, and -+ * cleans up the skbuff as if it just came from __alloc_skb(). -+ */ -+void skb_recycle(struct sk_buff *skb) -+{ -+ struct skb_shared_info *shinfo; -+ u8 head_frag = skb->head_frag; -+ -+ skb_release_head_state(skb); -+ -+ shinfo = skb_shinfo(skb); -+ memset(shinfo, 0, offsetof(struct skb_shared_info, dataref)); -+ atomic_set(&shinfo->dataref, 1); -+ -+ memset(skb, 0, offsetof(struct sk_buff, tail)); -+ skb->data = skb->head + NET_SKB_PAD; -+ skb->head_frag = head_frag; -+ skb_reset_tail_pointer(skb); -+} -+EXPORT_SYMBOL(skb_recycle); -+ - /* Make sure a field is enclosed inside headers_start/headers_end section */ - #define CHECK_SKB_FIELD(field) \ - BUILD_BUG_ON(offsetof(struct sk_buff, field) < \ -@@ -1073,7 +1099,7 @@ static void skb_headers_offset_update(st - skb->inner_mac_header += off; - } - --static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) -+void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) - { - __copy_skb_header(new, old); - -@@ -1081,6 +1107,7 @@ static void copy_skb_header(struct sk_bu - skb_shinfo(new)->gso_segs = skb_shinfo(old)->gso_segs; - skb_shinfo(new)->gso_type = skb_shinfo(old)->gso_type; - } -+EXPORT_SYMBOL(copy_skb_header); - - static inline int skb_alloc_rx_flag(const struct sk_buff *skb) - { ---- a/net/ipv4/ip_tunnel_core.c -+++ b/net/ipv4/ip_tunnel_core.c -@@ -188,8 +188,8 @@ int iptunnel_handle_offloads(struct sk_b - EXPORT_SYMBOL_GPL(iptunnel_handle_offloads); - - /* Often modified stats are per cpu, other are shared (netdev->stats) */ --struct rtnl_link_stats64 *ip_tunnel_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *tot) -+void ip_tunnel_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *tot) - { - int i; - -@@ -214,8 +214,6 @@ struct rtnl_link_stats64 *ip_tunnel_get_ - tot->rx_bytes += rx_bytes; - tot->tx_bytes += tx_bytes; - } -- -- return tot; - } - EXPORT_SYMBOL_GPL(ip_tunnel_get_stats64); - ---- a/net/l2tp/l2tp_eth.c -+++ b/net/l2tp/l2tp_eth.c -@@ -106,8 +106,8 @@ static int l2tp_eth_dev_xmit(struct sk_b - return NETDEV_TX_OK; - } - --static struct rtnl_link_stats64 *l2tp_eth_get_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void l2tp_eth_get_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct l2tp_eth *priv = netdev_priv(dev); - -@@ -117,10 +117,8 @@ static struct rtnl_link_stats64 *l2tp_et - stats->rx_bytes = atomic_long_read(&priv->rx_bytes); - stats->rx_packets = atomic_long_read(&priv->rx_packets); - stats->rx_errors = atomic_long_read(&priv->rx_errors); -- return stats; - } - -- - static const struct net_device_ops l2tp_eth_netdev_ops = { - .ndo_init = l2tp_eth_dev_init, - .ndo_uninit = l2tp_eth_dev_uninit, ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1146,7 +1146,7 @@ static u16 ieee80211_netdev_select_queue - return ieee80211_select_queue(IEEE80211_DEV_TO_SUB_IF(dev), skb); - } - --static struct rtnl_link_stats64 * -+static void - ieee80211_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -1171,8 +1171,6 @@ ieee80211_get_stats64(struct net_device - stats->rx_bytes += rx_bytes; - stats->tx_bytes += tx_bytes; - } -- -- return stats; - } - - static const struct net_device_ops ieee80211_dataif_ops = { ---- a/net/openvswitch/vport-internal_dev.c -+++ b/net/openvswitch/vport-internal_dev.c -@@ -106,7 +106,7 @@ static void internal_dev_destructor(stru - free_netdev(dev); - } - --static struct rtnl_link_stats64 * -+static void - internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats) - { - int i; -@@ -134,8 +134,6 @@ internal_get_stats(struct net_device *de - stats->tx_bytes += local_stats.tx_bytes; - stats->tx_packets += local_stats.tx_packets; - } -- -- return stats; - } - - static void internal_set_rx_headroom(struct net_device *dev, int new_hr) ---- a/net/sched/sch_generic.c -+++ b/net/sched/sch_generic.c -@@ -309,6 +309,13 @@ static void dev_watchdog(unsigned long a - txq->trans_timeout++; - break; - } -+ -+ /* Devices with HW_ACCEL_MQ have multiple txqs -+ * but update only the first one's transmission -+ * timestamp so avoid checking the rest. -+ */ -+ if (dev->features & NETIF_F_HW_ACCEL_MQ) -+ break; - } - - if (some_queue_timedout) { ---- a/net/sched/sch_teql.c -+++ b/net/sched/sch_teql.c -@@ -401,8 +401,8 @@ static int teql_master_close(struct net_ - return 0; - } - --static struct rtnl_link_stats64 *teql_master_stats64(struct net_device *dev, -- struct rtnl_link_stats64 *stats) -+static void teql_master_stats64(struct net_device *dev, -+ struct rtnl_link_stats64 *stats) - { - struct teql_master *m = netdev_priv(dev); - -@@ -410,7 +410,6 @@ static struct rtnl_link_stats64 *teql_ma - stats->tx_bytes = m->tx_bytes; - stats->tx_errors = m->tx_errors; - stats->tx_dropped = m->tx_dropped; -- return stats; - } - - static int teql_master_mtu(struct net_device *dev, int new_mtu) diff --git a/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch b/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch index 56c07c5e6..4ebcdc73a 100644 --- a/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/701-sdk_dpaa-support-layerscape.patch @@ -1,4 +1,4 @@ -From 6fe4518adbbbab0404958db4aa95673d60174881 Mon Sep 17 00:00:00 2001 +From 3cd36deb674720ab34eabb9783648ed743e52121 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 11:58:03 +0800 Subject: [PATCH] sdk_dpaa: support layerscape @@ -18,15 +18,15 @@ Signed-off-by: Yangbo Lu .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.c | 180 + .../net/ethernet/freescale/sdk_dpaa/dpaa_debugfs.h | 43 + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.c | 1213 ++++ - drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 698 ++ + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 687 ++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.c | 205 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_base.h | 49 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.c | 1992 +++++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_ceetm.h | 237 + - .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 1811 +++++ + .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 1820 +++++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_common.h | 225 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_proxy.c | 381 + - .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 1179 +++ + .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c | 1168 +++ .../ethernet/freescale/sdk_dpaa/dpaa_eth_sysfs.c | 278 + .../ethernet/freescale/sdk_dpaa/dpaa_eth_trace.h | 144 + .../net/ethernet/freescale/sdk_dpaa/dpaa_ethtool.c | 544 ++ @@ -41,24 +41,24 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/Peripherals/FM/HC/Makefile | 15 + .../freescale/sdk_fman/Peripherals/FM/HC/hc.c | 1232 ++++ .../freescale/sdk_fman/Peripherals/FM/MAC/Makefile | 28 + - .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c | 1464 ++++ + .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c | 1465 ++++ .../freescale/sdk_fman/Peripherals/FM/MAC/dtsec.h | 228 + .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.c | 97 + .../sdk_fman/Peripherals/FM/MAC/dtsec_mii_acc.h | 42 + - .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c | 658 ++ - .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h | 225 + + .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c | 674 ++ + .../freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h | 226 + .../sdk_fman/Peripherals/FM/MAC/fman_crc32.c | 119 + .../sdk_fman/Peripherals/FM/MAC/fman_crc32.h | 43 + .../sdk_fman/Peripherals/FM/MAC/fman_dtsec.c | 845 +++ .../Peripherals/FM/MAC/fman_dtsec_mii_acc.c | 163 + - .../sdk_fman/Peripherals/FM/MAC/fman_memac.c | 511 ++ + .../sdk_fman/Peripherals/FM/MAC/fman_memac.c | 532 ++ .../Peripherals/FM/MAC/fman_memac_mii_acc.c | 213 + .../sdk_fman/Peripherals/FM/MAC/fman_tgec.c | 367 + - .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c | 1096 +++ + .../freescale/sdk_fman/Peripherals/FM/MAC/memac.c | 1153 +++ .../freescale/sdk_fman/Peripherals/FM/MAC/memac.h | 110 + .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.c | 78 + .../sdk_fman/Peripherals/FM/MAC/memac_mii_acc.h | 73 + - .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c | 975 +++ + .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.c | 1017 +++ .../freescale/sdk_fman/Peripherals/FM/MAC/tgec.h | 151 + .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.c | 139 + .../sdk_fman/Peripherals/FM/MAC/tgec_mii_acc.h | 80 + @@ -124,7 +124,7 @@ Signed-off-by: Yangbo Lu .../sdk_fman/inc/Peripherals/crc_mac_addr_ext.h | 364 + .../freescale/sdk_fman/inc/Peripherals/dpaa_ext.h | 210 + .../freescale/sdk_fman/inc/Peripherals/fm_ext.h | 1731 +++++ - .../sdk_fman/inc/Peripherals/fm_mac_ext.h | 859 +++ + .../sdk_fman/inc/Peripherals/fm_mac_ext.h | 887 +++ .../sdk_fman/inc/Peripherals/fm_macsec_ext.h | 1271 ++++ .../sdk_fman/inc/Peripherals/fm_muram_ext.h | 170 + .../sdk_fman/inc/Peripherals/fm_pcd_ext.h | 3974 ++++++++++ @@ -154,7 +154,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/inc/flib/fsl_fman_dtsec.h | 1096 +++ .../sdk_fman/inc/flib/fsl_fman_dtsec_mii_acc.h | 107 + .../freescale/sdk_fman/inc/flib/fsl_fman_kg.h | 514 ++ - .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h | 427 ++ + .../freescale/sdk_fman/inc/flib/fsl_fman_memac.h | 434 ++ .../sdk_fman/inc/flib/fsl_fman_memac_mii_acc.h | 78 + .../freescale/sdk_fman/inc/flib/fsl_fman_port.h | 593 ++ .../freescale/sdk_fman/inc/flib/fsl_fman_prs.h | 102 + @@ -195,7 +195,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/src/inc/system/sys_io_ext.h | 46 + .../freescale/sdk_fman/src/inc/types_linux.h | 208 + .../sdk_fman/src/inc/wrapper/fsl_fman_test.h | 84 + - .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h | 128 + + .../sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h | 130 + .../sdk_fman/src/inc/wrapper/lnxwrp_fm_ext.h | 163 + .../sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h | 921 +++ .../ethernet/freescale/sdk_fman/src/inc/xx/xx.h | 50 + @@ -206,7 +206,7 @@ Signed-off-by: Yangbo Lu .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.c | 2908 ++++++++ .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.h | 294 + .../sdk_fman/src/wrapper/lnxwrp_fm_port.c | 1480 ++++ - .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c | 4813 +++++++++++++ + .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c | 4854 +++++++++++++ .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c | 1297 ++++ .../sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.h | 755 ++ .../sdk_fman/src/wrapper/lnxwrp_resources.h | 121 + @@ -262,13 +262,13 @@ Signed-off-by: Yangbo Lu include/uapi/linux/fmd/Peripherals/Kbuild | 4 + include/uapi/linux/fmd/Peripherals/fm_ioctls.h | 628 ++ include/uapi/linux/fmd/Peripherals/fm_pcd_ioctls.h | 3084 ++++++++ - .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h | 948 +++ + .../uapi/linux/fmd/Peripherals/fm_port_ioctls.h | 973 +++ .../uapi/linux/fmd/Peripherals/fm_test_ioctls.h | 208 + include/uapi/linux/fmd/integrations/Kbuild | 1 + .../linux/fmd/integrations/integration_ioctls.h | 56 + include/uapi/linux/fmd/ioctls.h | 96 + include/uapi/linux/fmd/net_ioctls.h | 430 ++ - 257 files changed, 152931 insertions(+) + 257 files changed, 153159 insertions(+) create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Kconfig create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/Makefile create mode 100644 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_1588.c @@ -2923,7 +2923,7 @@ Signed-off-by: Yangbo Lu +module_exit(dpa_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h -@@ -0,0 +1,698 @@ +@@ -0,0 +1,687 @@ +/* Copyright 2008-2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -3440,17 +3440,6 @@ Signed-off-by: Yangbo Lu + return fd->offset; +} + -+/* Verifies if the skb length is below the interface MTU */ -+static inline int dpa_check_rx_mtu(struct sk_buff *skb, int mtu) -+{ -+ if (unlikely(skb->len > mtu)) -+ if ((skb->protocol != htons(ETH_P_8021Q)) -+ || (skb->len > mtu + 4)) -+ return -1; -+ -+ return 0; -+} -+ +static inline uint16_t dpa_get_headroom(struct dpa_buffer_layout_s *bl) +{ + uint16_t headroom; @@ -6119,7 +6108,7 @@ Signed-off-by: Yangbo Lu +#endif --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c -@@ -0,0 +1,1811 @@ +@@ -0,0 +1,1820 @@ +/* Copyright 2008-2013 Freescale Semiconductor, Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -6385,7 +6374,16 @@ Signed-off-by: Yangbo Lu + +int dpa_change_mtu(struct net_device *net_dev, int new_mtu) +{ -+ const int max_mtu = dpa_get_max_mtu(); ++ int max_mtu = dpa_get_max_mtu(); ++ ++#ifndef CONFIG_PPC ++ /* Due to the A010022 FMan errata, we can not use contig frames larger ++ * than 4K, nor S/G frames. We need to prevent the user from setting a ++ * large MTU. ++ */ ++ if (unlikely(dpaa_errata_a010022)) ++ max_mtu = DPA_BP_RAW_SIZE; ++#endif + + /* Make sure we don't exceed the Ethernet controller's MAXFRM */ + if (new_mtu < 68 || new_mtu > max_mtu) { @@ -8545,7 +8543,7 @@ Signed-off-by: Yangbo Lu +module_exit(dpa_proxy_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c -@@ -0,0 +1,1179 @@ +@@ -0,0 +1,1168 @@ +/* Copyright 2012 Freescale Semiconductor Inc. + * + * Redistribution and use in source and binary forms, with or without @@ -9164,13 +9162,6 @@ Signed-off-by: Yangbo Lu + (*count_ptr)--; + skb->protocol = eth_type_trans(skb, net_dev); + -+ /* IP Reassembled frames are allowed to be larger than MTU */ -+ if (unlikely(dpa_check_rx_mtu(skb, net_dev->mtu) && -+ !(fd_status & FM_FD_IPR))) { -+ percpu_stats->rx_dropped++; -+ goto drop_bad_frame; -+ } -+ + skb_len = skb->len; + +#ifdef CONFIG_FSL_DPAA_DBG_LOOP @@ -9203,10 +9194,6 @@ Signed-off-by: Yangbo Lu +packet_dropped: + return; + -+drop_bad_frame: -+ dev_kfree_skb(skb); -+ return; -+ +_release_frame: + dpa_fd_release(net_dev, fd); +} @@ -14903,7 +14890,7 @@ Signed-off-by: Yangbo Lu + --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/dtsec.c -@@ -0,0 +1,1464 @@ +@@ -0,0 +1,1465 @@ +/* + * Copyright 2008-2013 Freescale Semiconductor Inc. + * @@ -16295,6 +16282,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = DtsecResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = DtsecGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = NULL; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = DtsecModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = DtsecAddHashMacAddress; @@ -16746,7 +16734,7 @@ Signed-off-by: Yangbo Lu +#endif /* __DTSEC_MII_ACC_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.c -@@ -0,0 +1,658 @@ +@@ -0,0 +1,674 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -17210,6 +17198,22 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac; ++ ++ SANITY_CHECK_RETURN_ERROR(p_FmMacControllerDriver, E_INVALID_HANDLE); ++ ++ memset(p_FrameSizeCounters, 0, sizeof(t_FmMacFrameSizeCounters)); ++ ++ if (p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters) ++ return p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters(h_FmMac, p_FrameSizeCounters, type); ++ ++ RETURN_ERROR(MINOR, E_NOT_SUPPORTED, NO_MSG); ++} ++ ++/* ......................................................................... */ ++ +t_Error FM_MAC_ModifyMacAddr (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr) +{ + t_FmMacControllerDriver *p_FmMacControllerDriver = (t_FmMacControllerDriver *)h_FmMac; @@ -17407,7 +17411,7 @@ Signed-off-by: Yangbo Lu +#endif /* (defined(DEBUG_ERRORS) && ... */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fm_mac.h -@@ -0,0 +1,225 @@ +@@ -0,0 +1,226 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -17516,6 +17520,7 @@ Signed-off-by: Yangbo Lu + + t_Error (*f_FM_MAC_ResetCounters) (t_Handle h_FmMac); + t_Error (*f_FM_MAC_GetStatistics) (t_Handle h_FmMac, t_FmMacStatistics *p_Statistics); ++ t_Error (*f_FM_MAC_GetFrameSizeCounters) (t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type); + + t_Error (*f_FM_MAC_ModifyMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr); + t_Error (*f_FM_MAC_AddHashMacAddr) (t_Handle h_FmMac, t_EnetAddr *p_EnetAddr); @@ -18817,7 +18822,7 @@ Signed-off-by: Yangbo Lu + --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/fman_memac.c -@@ -0,0 +1,511 @@ +@@ -0,0 +1,532 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -19180,24 +19185,45 @@ Signed-off-by: Yangbo Lu + case E_MEMAC_COUNTER_R64: + ret_val = GET_MEMAC_CNTR_64(r64); + break; ++ case E_MEMAC_COUNTER_T64: ++ ret_val = GET_MEMAC_CNTR_64(t64); ++ break; + case E_MEMAC_COUNTER_R127: + ret_val = GET_MEMAC_CNTR_64(r127); + break; ++ case E_MEMAC_COUNTER_T127: ++ ret_val = GET_MEMAC_CNTR_64(t127); ++ break; + case E_MEMAC_COUNTER_R255: + ret_val = GET_MEMAC_CNTR_64(r255); + break; ++ case E_MEMAC_COUNTER_T255: ++ ret_val = GET_MEMAC_CNTR_64(t255); ++ break; + case E_MEMAC_COUNTER_R511: + ret_val = GET_MEMAC_CNTR_64(r511); + break; ++ case E_MEMAC_COUNTER_T511: ++ ret_val = GET_MEMAC_CNTR_64(t511); ++ break; + case E_MEMAC_COUNTER_R1023: + ret_val = GET_MEMAC_CNTR_64(r1023); + break; ++ case E_MEMAC_COUNTER_T1023: ++ ret_val = GET_MEMAC_CNTR_64(t1023); ++ break; + case E_MEMAC_COUNTER_R1518: + ret_val = GET_MEMAC_CNTR_64(r1518); + break; ++ case E_MEMAC_COUNTER_T1518: ++ ret_val = GET_MEMAC_CNTR_64(t1518); ++ break; + case E_MEMAC_COUNTER_R1519X: + ret_val = GET_MEMAC_CNTR_64(r1519x); + break; ++ case E_MEMAC_COUNTER_T1519X: ++ ret_val = GET_MEMAC_CNTR_64(t1519x); ++ break; + case E_MEMAC_COUNTER_RFRG: + ret_val = GET_MEMAC_CNTR_64(rfrg); + break; @@ -19917,7 +19943,7 @@ Signed-off-by: Yangbo Lu +} --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/memac.c -@@ -0,0 +1,1096 @@ +@@ -0,0 +1,1153 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -20513,6 +20539,62 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++static t_Error MemacGetFrameSizeCounters(t_Handle h_Memac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_Memac *p_Memac = (t_Memac *)h_Memac; ++ ++ SANITY_CHECK_RETURN_ERROR(p_Memac, E_NULL_POINTER); ++ SANITY_CHECK_RETURN_ERROR(!p_Memac->p_MemacDriverParam, E_INVALID_STATE); ++ SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER); ++ ++ switch (type) ++ { ++ case e_COMM_MODE_NONE: ++ break; ++ ++ case e_COMM_MODE_RX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X); ++ break; ++ ++ case e_COMM_MODE_TX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X); ++ break; ++ ++ case e_COMM_MODE_RX_AND_TX: ++ p_FrameSizeCounters->count_pkts_64 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R64) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R127) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R255) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R511) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1023) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1518) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_R1519X) ++ + fman_memac_get_counter(p_Memac->p_MemMap, E_MEMAC_COUNTER_T1519X); ++ break; ++ } ++ ++ return E_OK; ++} ++ ++/* ......................................................................... */ ++ +static t_Error MemacModifyMacAddress (t_Handle h_Memac, t_EnetAddr *p_EnetAddr) +{ + t_Memac *p_Memac = (t_Memac *)h_Memac; @@ -20945,6 +21027,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = MemacResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = MemacGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = MemacGetFrameSizeCounters; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = MemacModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = MemacAddHashMacAddress; @@ -21286,7 +21369,7 @@ Signed-off-by: Yangbo Lu +#endif /* __MEMAC_MII_ACC_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/MAC/tgec.c -@@ -0,0 +1,975 @@ +@@ -0,0 +1,1017 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -21727,6 +21810,47 @@ Signed-off-by: Yangbo Lu + +/* ......................................................................... */ + ++static t_Error TgecGetFrameSizeCounters(t_Handle h_Tgec, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type) ++{ ++ t_Tgec *p_Tgec = (t_Tgec *)h_Tgec; ++ struct tgec_regs *p_TgecMemMap; ++ ++ SANITY_CHECK_RETURN_ERROR(p_Tgec, E_NULL_POINTER); ++ SANITY_CHECK_RETURN_ERROR(!p_Tgec->p_TgecDriverParam, E_INVALID_STATE); ++ SANITY_CHECK_RETURN_ERROR(p_FrameSizeCounters, E_NULL_POINTER); ++ ++ p_TgecMemMap = p_Tgec->p_MemMap; ++ ++ switch (type) ++ { ++ case e_COMM_MODE_NONE: ++ break; ++ ++ case e_COMM_MODE_RX: ++ p_FrameSizeCounters->count_pkts_64 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R64); ++ p_FrameSizeCounters->count_pkts_65_to_127 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R127); ++ p_FrameSizeCounters->count_pkts_128_to_255 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R255); ++ p_FrameSizeCounters->count_pkts_256_to_511 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R511); ++ p_FrameSizeCounters->count_pkts_512_to_1023 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1023); ++ p_FrameSizeCounters->count_pkts_1024_to_1518 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1518); ++ p_FrameSizeCounters->count_pkts_1519_to_1522 = fman_tgec_get_counter(p_TgecMemMap, E_TGEC_COUNTER_R1519X); ++ break; ++ ++ case e_COMM_MODE_TX: ++ //Tx counters not supported ++ break; ++ ++ case e_COMM_MODE_RX_AND_TX: ++ //Tx counters not supported ++ break; ++ } ++ ++ return E_OK; ++} ++ ++ ++/* ......................................................................... */ ++ +static t_Error TgecEnable1588TimeStamp(t_Handle h_Tgec) +{ + t_Tgec *p_Tgec = (t_Tgec *)h_Tgec; @@ -22194,6 +22318,7 @@ Signed-off-by: Yangbo Lu + + p_FmMacControllerDriver->f_FM_MAC_ResetCounters = TgecResetCounters; + p_FmMacControllerDriver->f_FM_MAC_GetStatistics = TgecGetStatistics; ++ p_FmMacControllerDriver->f_FM_MAC_GetFrameSizeCounters = TgecGetFrameSizeCounters; + + p_FmMacControllerDriver->f_FM_MAC_ModifyMacAddr = TgecModifyMacAddress; + p_FmMacControllerDriver->f_FM_MAC_AddHashMacAddr = TgecAddHashMacAddress; @@ -77953,7 +78078,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FM_EXT */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/Peripherals/fm_mac_ext.h -@@ -0,0 +1,859 @@ +@@ -0,0 +1,887 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -78153,6 +78278,19 @@ Signed-off-by: Yangbo Lu + - Other */ +} t_FmMacStatistics; + ++/**************************************************************************//** ++ @Description FM MAC Frame Size Counters ++*//***************************************************************************/ ++typedef struct t_FmMacFrameSizeCounters { ++ ++ uint64_t count_pkts_64; /**< 64 byte frame counter */ ++ uint64_t count_pkts_65_to_127; /**< 65 to 127 byte frame counter */ ++ uint64_t count_pkts_128_to_255; /**< 128 to 255 byte frame counter */ ++ uint64_t count_pkts_256_to_511; /**< 256 to 511 byte frame counter */ ++ uint64_t count_pkts_512_to_1023; /**< 512 to 1023 byte frame counter */ ++ uint64_t count_pkts_1024_to_1518; /**< 1024 to 1518 byte frame counter */ ++ uint64_t count_pkts_1519_to_1522; /**< 1519 to 1522 byte good frame count */ ++} t_FmMacFrameSizeCounters; + +/**************************************************************************//** + @Group FM_mac_init_grp FM MAC Initialization Unit @@ -78610,6 +78748,21 @@ Signed-off-by: Yangbo Lu +t_Error FM_MAC_GetStatistics(t_Handle h_FmMac, t_FmMacStatistics *p_Statistics); + +/**************************************************************************//** ++ @Function FM_MAC_GetFrameSizeCounters ++ ++ @Description get MAC statistics counters for different frame size ++ ++ @Param[in] h_FmMac - A handle to a FM MAC Module. ++ @Param[in] p_FrameSizeCounters - Structure with counters ++ @Param[in] type - Type of counters to be read ++ ++ @Return E_OK on success; Error code otherwise. ++ ++ @Cautions Allowed only following FM_Init(). ++*//***************************************************************************/ ++t_Error FM_MAC_GetFrameSizeCounters(t_Handle h_FmMac, t_FmMacFrameSizeCounters *p_FrameSizeCounters, e_CommMode type); ++ ++/**************************************************************************//** + @Function FM_MAC_ModifyMacAddr + + @Description Replace the main MAC Address @@ -94578,7 +94731,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FSL_FMAN_KG_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/inc/flib/fsl_fman_memac.h -@@ -0,0 +1,427 @@ +@@ -0,0 +1,434 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -94727,12 +94880,19 @@ Signed-off-by: Yangbo Lu + +enum memac_counters { + E_MEMAC_COUNTER_R64, ++ E_MEMAC_COUNTER_T64, + E_MEMAC_COUNTER_R127, ++ E_MEMAC_COUNTER_T127, + E_MEMAC_COUNTER_R255, ++ E_MEMAC_COUNTER_T255, + E_MEMAC_COUNTER_R511, ++ E_MEMAC_COUNTER_T511, + E_MEMAC_COUNTER_R1023, ++ E_MEMAC_COUNTER_T1023, + E_MEMAC_COUNTER_R1518, ++ E_MEMAC_COUNTER_T1518, + E_MEMAC_COUNTER_R1519X, ++ E_MEMAC_COUNTER_T1519X, + E_MEMAC_COUNTER_RFRG, + E_MEMAC_COUNTER_RJBR, + E_MEMAC_COUNTER_RDRP, @@ -103346,7 +103506,7 @@ Signed-off-by: Yangbo Lu +#endif /* __FSL_FMAN_TEST_H */ --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_exp_sym.h -@@ -0,0 +1,128 @@ +@@ -0,0 +1,130 @@ +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc. + * All rights reserved. + * @@ -103472,6 +103632,8 @@ Signed-off-by: Yangbo Lu +/* FMAN MAC exported routines */ +EXPORT_SYMBOL(FM_MAC_GetStatistics); + ++EXPORT_SYMBOL(FM_MAC_GetFrameSizeCounters); ++ +EXPORT_SYMBOL(FM_GetSpecialOperationCoding); + +#endif /* __LNXWRP_EXP_SYM_H */ @@ -111188,7 +111350,7 @@ Signed-off-by: Yangbo Lu +module_exit(fm_port_unload); --- /dev/null +++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm.c -@@ -0,0 +1,4813 @@ +@@ -0,0 +1,4854 @@ +/* + * Copyright 2008-2012 Freescale Semiconductor Inc. + * @@ -115799,6 +115961,47 @@ Signed-off-by: Yangbo Lu + break; + } + ++ case FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS: ++ { ++ t_LnxWrpFmDev *p_LnxWrpFmDev = ++ (t_LnxWrpFmDev *)p_LnxWrpFmPortDev->h_LnxWrpFmDev; ++ ioc_fm_port_mac_frame_size_counters_t param; ++ t_FmMacFrameSizeCounters frameSizeCounters; ++ int mac_id = p_LnxWrpFmPortDev->id; ++ ++ if (!p_LnxWrpFmDev) ++ RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!")); ++ ++ if (&p_LnxWrpFmDev->txPorts[mac_id] != p_LnxWrpFmPortDev && ++ &p_LnxWrpFmDev->rxPorts[mac_id] != p_LnxWrpFmPortDev) ++ mac_id += FM_MAX_NUM_OF_1G_MACS; /* 10G port */ ++ ++ if (!p_LnxWrpFmDev->macs[mac_id].h_Dev) ++ RETURN_ERROR(MINOR, E_NOT_AVAILABLE, ("Port not initialized or other error!")); ++ ++ if (copy_from_user(¶m, (ioc_fm_port_mac_frame_size_counters_t *)arg, ++ sizeof(ioc_fm_port_mac_frame_size_counters_t))) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ if (FM_MAC_GetFrameSizeCounters(p_LnxWrpFmDev->macs[mac_id].h_Dev, ++ &frameSizeCounters, param.type)) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ param.count_pkts_64 = frameSizeCounters.count_pkts_64; ++ param.count_pkts_65_to_127 = frameSizeCounters.count_pkts_65_to_127; ++ param.count_pkts_128_to_255 = frameSizeCounters.count_pkts_128_to_255; ++ param.count_pkts_256_to_511 = frameSizeCounters.count_pkts_256_to_511; ++ param.count_pkts_512_to_1023 = frameSizeCounters.count_pkts_512_to_1023; ++ param.count_pkts_1024_to_1518 = frameSizeCounters.count_pkts_1024_to_1518; ++ param.count_pkts_1519_to_1522 = frameSizeCounters.count_pkts_1519_to_1522; ++ ++ if (copy_to_user((ioc_fm_port_mac_frame_size_counters_t *)arg, ¶m, ++ sizeof(ioc_fm_port_mac_frame_size_counters_t))) ++ RETURN_ERROR(MINOR, E_WRITE_FAILED, NO_MSG); ++ ++ break; ++ } ++ + case FM_PORT_IOC_GET_BMI_COUNTERS: + { + t_LnxWrpFmDev *p_LnxWrpFmDev = @@ -152474,7 +152677,7 @@ Signed-off-by: Yangbo Lu +/** @} */ /* end of lnx_ioctl_FM_grp group */ --- /dev/null +++ b/include/uapi/linux/fmd/Peripherals/fm_port_ioctls.h -@@ -0,0 +1,948 @@ +@@ -0,0 +1,973 @@ +/* Copyright (c) 2008-2012 Freescale Semiconductor, Inc. + * All rights reserved. + * @@ -153416,6 +153619,31 @@ Signed-off-by: Yangbo Lu + +#define FM_PORT_IOC_GET_BMI_COUNTERS _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(42), ioc_fm_port_bmi_stats_t) + ++typedef struct ioc_fm_port_mac_frame_size_counters_t { ++ ++ e_CommMode type; ++ uint64_t count_pkts_64; /**< 64 byte frame counter */ ++ uint64_t count_pkts_65_to_127; /**< 65 to 127 byte frame counter */ ++ uint64_t count_pkts_128_to_255; /**< 128 to 255 byte frame counter */ ++ uint64_t count_pkts_256_to_511; /**< 256 to 511 byte frame counter */ ++ uint64_t count_pkts_512_to_1023; /**< 512 to 1023 byte frame counter */ ++ uint64_t count_pkts_1024_to_1518; /**< 1024 to 1518 byte frame counter */ ++ uint64_t count_pkts_1519_to_1522; /**< 1519 to 1522 byte good frame count */ ++} ioc_fm_port_mac_frame_size_counters_t; ++ ++/**************************************************************************//** ++ @Function FM_MAC_GetFrameSizeCounters ++ ++ @Description get MAC statistics counters for different frame size ++ ++ @Param[out] ioc_fm_port_mac_frame_size_counters_t A structure holding the counters ++ ++ @Return E_OK on success; Error code otherwise. ++ ++ @Cautions Allowed only following FM_Init(). ++*//***************************************************************************/ ++#define FM_PORT_IOC_GET_MAC_FRAME_SIZE_COUNTERS _IOR(FM_IOC_TYPE_BASE, FM_PORT_IOC_NUM(43), ioc_fm_port_mac_frame_size_counters_t) ++ + +/** @} */ /* end of lnx_ioctl_FM_PORT_pcd_runtime_control_grp group */ +/** @} */ /* end of lnx_ioctl_FM_PORT_runtime_control_grp group */ diff --git a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch index 4e3b139b4..65243518a 100644 --- a/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/702-pci-support-layerscape.patch @@ -1,4 +1,4 @@ -From c4813da334b0c31e9c55eea015f1e898e84ff45b Mon Sep 17 00:00:00 2001 +From 9e6e0a53b29190dbd86a39304b59c3028f5b36c2 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 11:04:10 +0800 Subject: [PATCH] pci: support layerscape @@ -15,17 +15,17 @@ Signed-off-by: Mingkai Hu Signed-off-by: Christoph Hellwig Signed-off-by: Yangbo Lu --- - drivers/irqchip/irq-ls-scfg-msi.c | 256 +++++++-- + drivers/irqchip/irq-ls-scfg-msi.c | 257 +++++++-- drivers/pci/host/Makefile | 2 +- drivers/pci/host/pci-layerscape-ep-debugfs.c | 758 +++++++++++++++++++++++++++ drivers/pci/host/pci-layerscape-ep.c | 309 +++++++++++ drivers/pci/host/pci-layerscape-ep.h | 115 ++++ - drivers/pci/host/pci-layerscape.c | 37 +- + drivers/pci/host/pci-layerscape.c | 38 +- drivers/pci/host/pcie-designware.c | 6 + drivers/pci/host/pcie-designware.h | 1 + drivers/pci/pcie/portdrv_core.c | 181 +++---- include/linux/pci.h | 1 + - 10 files changed, 1518 insertions(+), 148 deletions(-) + 10 files changed, 1520 insertions(+), 148 deletions(-) create mode 100644 drivers/pci/host/pci-layerscape-ep-debugfs.c create mode 100644 drivers/pci/host/pci-layerscape-ep.c create mode 100644 drivers/pci/host/pci-layerscape-ep.h @@ -198,7 +198,7 @@ Signed-off-by: Yangbo Lu &ls_scfg_msi_domain_ops, msi_data); if (!msi_data->parent) { -@@ -164,16 +230,117 @@ static int ls_scfg_msi_domains_init(stru +@@ -164,16 +230,118 @@ static int ls_scfg_msi_domains_init(stru return 0; } @@ -288,6 +288,7 @@ Signed-off-by: Yangbo Lu + { .compatible = "fsl,1s1021a-msi", .data = &ls1021_msi_cfg}, + { .compatible = "fsl,1s1043a-msi", .data = &ls1021_msi_cfg}, + ++ { .compatible = "fsl,ls1012a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1021a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1043a-msi", .data = &ls1021_msi_cfg }, + { .compatible = "fsl,ls1043a-v1.1-msi", .data = &ls1043_v1_1_msi_cfg }, @@ -317,7 +318,7 @@ Signed-off-by: Yangbo Lu res = platform_get_resource(pdev, IORESOURCE_MEM, 0); msi_data->regs = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(msi_data->regs)) { -@@ -182,23 +349,48 @@ static int ls_scfg_msi_probe(struct plat +@@ -182,23 +350,48 @@ static int ls_scfg_msi_probe(struct plat } msi_data->msiir_addr = res->start; @@ -376,7 +377,7 @@ Signed-off-by: Yangbo Lu platform_set_drvdata(pdev, msi_data); return 0; -@@ -207,8 +399,10 @@ static int ls_scfg_msi_probe(struct plat +@@ -207,8 +400,10 @@ static int ls_scfg_msi_probe(struct plat static int ls_scfg_msi_remove(struct platform_device *pdev) { struct ls_scfg_msi *msi_data = platform_get_drvdata(pdev); @@ -388,7 +389,7 @@ Signed-off-by: Yangbo Lu irq_domain_remove(msi_data->msi_domain); irq_domain_remove(msi_data->parent); -@@ -218,12 +412,6 @@ static int ls_scfg_msi_remove(struct pla +@@ -218,12 +413,6 @@ static int ls_scfg_msi_remove(struct pla return 0; } @@ -1656,7 +1657,7 @@ Signed-off-by: Yangbo Lu } static int ls_pcie_msi_host_init(struct pcie_port *pp, -@@ -196,20 +209,38 @@ static struct ls_pcie_drvdata ls1021_drv +@@ -196,20 +209,39 @@ static struct ls_pcie_drvdata ls1021_drv static struct ls_pcie_drvdata ls1043_drvdata = { .lut_offset = 0x10000, .ltssm_shift = 24, @@ -1686,6 +1687,7 @@ Signed-off-by: Yangbo Lu }; static const struct of_device_id ls_pcie_of_match[] = { ++ { .compatible = "fsl,ls1012a-pcie", .data = &ls1046_drvdata }, { .compatible = "fsl,ls1021a-pcie", .data = &ls1021_drvdata }, { .compatible = "fsl,ls1043a-pcie", .data = &ls1043_drvdata }, + { .compatible = "fsl,ls1046a-pcie", .data = &ls1046_drvdata }, diff --git a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch index 312faf2c5..81c473c4d 100644 --- a/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/703-phy-support-layerscape.patch @@ -1741,7 +1741,7 @@ Signed-off-by: Yangbo Lu PHY_INTERFACE_MODE_MAX, } phy_interface_t; -@@ -784,6 +785,9 @@ int phy_stop_interrupts(struct phy_devic +@@ -780,6 +781,9 @@ int phy_stop_interrupts(struct phy_devic static inline int phy_read_status(struct phy_device *phydev) { diff --git a/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch b/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch index 2927c7e66..a35e59310 100644 --- a/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch +++ b/target/linux/layerscape/patches-4.9/704-fsl-mc-layerscape-support.patch @@ -1,4 +1,4 @@ -From 464b4d9b8282e0f1e5040e4914505f91ce4d3750 Mon Sep 17 00:00:00 2001 +From afb7254de9f03c3efaf4e306dcf5f88e1873fc6b Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:06:25 +0800 Subject: [PATCH] fsl-mc: layerscape support @@ -29,7 +29,7 @@ Signed-off-by: Yangbo Lu .../{include/dpcon-cmd.h => bus/dpio/dpio-cmd.h} | 73 +- drivers/staging/fsl-mc/bus/dpio/dpio-driver.c | 296 ++++++ drivers/staging/fsl-mc/bus/dpio/dpio-driver.txt | 135 +++ - drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 689 +++++++++++++ + drivers/staging/fsl-mc/bus/dpio/dpio-service.c | 693 +++++++++++++ drivers/staging/fsl-mc/bus/dpio/dpio.c | 224 +++++ drivers/staging/fsl-mc/bus/dpio/dpio.h | 109 ++ drivers/staging/fsl-mc/bus/dpio/qbman-portal.c | 1049 ++++++++++++++++++++ @@ -68,7 +68,7 @@ Signed-off-by: Yangbo Lu drivers/staging/fsl-mc/include/mc-cmd.h | 44 +- drivers/staging/fsl-mc/include/mc-sys.h | 3 +- drivers/staging/fsl-mc/include/mc.h | 17 +- - 49 files changed, 7380 insertions(+), 2612 deletions(-) + 49 files changed, 7384 insertions(+), 2612 deletions(-) create mode 100644 drivers/staging/fsl-mc/bus/dpbp-cmd.h create mode 100644 drivers/staging/fsl-mc/bus/dpcon-cmd.h create mode 100644 drivers/staging/fsl-mc/bus/dpcon.c @@ -1772,7 +1772,7 @@ Signed-off-by: Yangbo Lu + Dequeue result struct and parsing APIs are defined in dpaa2-global.h. --- /dev/null +++ b/drivers/staging/fsl-mc/bus/dpio/dpio-service.c -@@ -0,0 +1,689 @@ +@@ -0,0 +1,693 @@ +/* + * Copyright 2014-2016 Freescale Semiconductor Inc. + * Copyright 2016 NXP @@ -1852,14 +1852,14 @@ Signed-off-by: Yangbo Lu + if (d) + return d; + -+ if (unlikely(cpu >= num_possible_cpus())) ++ if (unlikely(cpu >= (int)num_possible_cpus())) + return NULL; + + /* + * If cpu == -1, choose the current cpu, with no guarantees about + * potentially being migrated away. + */ -+ if (unlikely(cpu < 0)) ++ if (cpu < 0) + cpu = smp_processor_id(); + + /* If a specific cpu was requested, pick it up immediately */ @@ -1871,6 +1871,10 @@ Signed-off-by: Yangbo Lu + if (d) + return d; + ++ d = service_select_by_cpu(d, -1); ++ if (d) ++ return d; ++ + spin_lock(&dpio_list_lock); + d = list_entry(dpio_list.next, struct dpaa2_io, node); + list_del(&d->node); @@ -1897,7 +1901,7 @@ Signed-off-by: Yangbo Lu + return NULL; + + /* check if CPU is out of range (-1 means any cpu) */ -+ if (desc->cpu >= num_possible_cpus()) { ++ if (desc->cpu >= (int)num_possible_cpus()) { + kfree(obj); + return NULL; + } @@ -8354,14 +8358,6 @@ Signed-off-by: Yangbo Lu * Author: German Rivera * * This file is licensed under the terms of the GNU General Public -@@ -17,6 +17,7 @@ - #include - #include - #include "../include/mc-bus.h" -+#include "fsl-mc-private.h" - - /* - * Generate a unique ID identifying the interrupt (only used within the MSI --- a/drivers/staging/fsl-mc/bus/fsl-mc-private.h +++ b/drivers/staging/fsl-mc/bus/fsl-mc-private.h @@ -10,13 +10,15 @@ @@ -8393,11 +8389,8 @@ Signed-off-by: Yangbo Lu * Author: German Rivera * * This file is licensed under the terms of the GNU General Public -@@ -17,9 +17,10 @@ - #include - #include - #include "../include/mc-bus.h" -+#include "fsl-mc-private.h" +@@ -20,7 +20,7 @@ + #include "fsl-mc-private.h" static struct irq_chip its_msi_irq_chip = { - .name = "fsl-mc-bus-msi", @@ -8405,7 +8398,7 @@ Signed-off-by: Yangbo Lu .irq_mask = irq_chip_mask_parent, .irq_unmask = irq_chip_unmask_parent, .irq_eoi = irq_chip_eoi_parent, -@@ -51,7 +52,7 @@ static int its_fsl_mc_msi_prepare(struct +@@ -52,7 +52,7 @@ static int its_fsl_mc_msi_prepare(struct return msi_info->ops->msi_prepare(msi_domain->parent, dev, nvec, info); } @@ -8414,7 +8407,7 @@ Signed-off-by: Yangbo Lu .msi_prepare = its_fsl_mc_msi_prepare, }; -@@ -94,8 +95,8 @@ int __init its_fsl_mc_msi_init(void) +@@ -95,8 +95,8 @@ int __init its_fsl_mc_msi_init(void) continue; } diff --git a/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch b/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch new file mode 100644 index 000000000..4fa29b290 --- /dev/null +++ b/target/linux/layerscape/patches-4.9/706-fsl-dpaa-use-4-9-ndo-get-stats64.patch @@ -0,0 +1,112 @@ +From: Mathew McBride +Date: Tue, 24 Oct 2017 11:30:00 +1100 +Subject: [PATCH] dpaa: backport use of 4.9 ndo_get_stats64 + +This patch changes the declarations of ndo_get_stats64 handlers +to the previous struct rtnl_link_stats64 * return type instead of +the mainline void return. + +Suggested-by: Adrien Gallouët +Signed-off-by: Mathew McBride + +--- + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c | 5 +++-- + drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h | 4 ++-- + drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c | 3 ++- + drivers/staging/fsl-dpaa2/ethsw/switch.c | 4 ++-- + drivers/staging/fsl-dpaa2/evb/evb.c | 4 ++-- + 5 files changed, 11 insertions(+), 9 deletions(-) + +--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c ++++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c +@@ -1296,7 +1296,7 @@ static int dpaa2_eth_set_addr(struct net + /** Fill in counters maintained by the GPP driver. These may be different from + * the hardware counters obtained by ethtool. + */ +-static void dpaa2_eth_get_stats(struct net_device *net_dev, ++static struct rtnl_link_stats64 *dpaa2_eth_get_stats(struct net_device *net_dev, + struct rtnl_link_stats64 *stats) + { + struct dpaa2_eth_priv *priv = netdev_priv(net_dev); +@@ -1312,6 +1312,7 @@ static void dpaa2_eth_get_stats(struct n + for (j = 0; j < num; j++) + netstats[j] += cpustats[j]; + } ++ return stats; + } + + static int dpaa2_eth_change_mtu(struct net_device *net_dev, int mtu) +--- a/drivers/staging/fsl-dpaa2/ethsw/switch.c ++++ b/drivers/staging/fsl-dpaa2/ethsw/switch.c +@@ -1094,7 +1094,7 @@ static int ethsw_port_fdb_del(struct ndm + return 0; + } + +-void ethsw_port_get_stats(struct net_device *netdev, ++struct rtnl_link_stats64 *ethsw_port_get_stats(struct net_device *netdev, + struct rtnl_link_stats64 *storage) + { + struct ethsw_port_priv *port_priv = netdev_priv(netdev); +@@ -1154,7 +1154,7 @@ void ethsw_port_get_stats(struct net_dev + if (err) + goto error; + +- return; ++ return storage; + + error: + netdev_err(netdev, "dpsw_if_get_counter err %d\n", err); +--- a/drivers/staging/fsl-dpaa2/evb/evb.c ++++ b/drivers/staging/fsl-dpaa2/evb/evb.c +@@ -765,7 +765,7 @@ static int evb_dellink(struct net_device + return 0; + } + +-void evb_port_get_stats(struct net_device *netdev, ++struct rtnl_link_stats64 *evb_port_get_stats(struct net_device *netdev, + struct rtnl_link_stats64 *storage) + { + struct evb_port_priv *port_priv = netdev_priv(netdev); +@@ -842,7 +842,7 @@ void evb_port_get_stats(struct net_devic + if (unlikely(err)) + goto error; + +- return; ++ return storage; + + error: + netdev_err(netdev, "dpdmux_if_get_counter err %d\n", err); +--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c ++++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.c +@@ -239,8 +239,8 @@ EXPORT_SYMBOL(dpa_timeout); + * Calculates the statistics for the given device by adding the statistics + * collected by each CPU. + */ +-void __cold +-dpa_get_stats64(struct net_device *net_dev, ++struct rtnl_link_stats64 __cold ++*dpa_get_stats64(struct net_device *net_dev, + struct rtnl_link_stats64 *stats) + { + struct dpa_priv_s *priv = netdev_priv(net_dev); +@@ -258,6 +258,7 @@ dpa_get_stats64(struct net_device *net_d + for (j = 0; j < numstats; j++) + netstats[j] += cpustats[j]; + } ++ return stats; + } + EXPORT_SYMBOL(dpa_get_stats64); + +--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h ++++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_common.h +@@ -140,8 +140,8 @@ int dpa_netdev_init(struct net_device *n + int __cold dpa_start(struct net_device *net_dev); + int __cold dpa_stop(struct net_device *net_dev); + void __cold dpa_timeout(struct net_device *net_dev); +-void __cold +-dpa_get_stats64(struct net_device *net_dev, ++struct rtnl_link_stats64 __cold ++*dpa_get_stats64(struct net_device *net_dev, + struct rtnl_link_stats64 *stats); + int dpa_change_mtu(struct net_device *net_dev, int new_mtu); + int dpa_ndo_init(struct net_device *net_dev); diff --git a/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch b/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch new file mode 100644 index 000000000..4104272ef --- /dev/null +++ b/target/linux/layerscape/patches-4.9/706-fsl_ppfe-support-layercape.patch @@ -0,0 +1,10548 @@ +From 8b7935a883d42187716fe486c83352f24d01ddcd Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 19 Oct 2017 12:48:19 +0800 +Subject: [PATCH] fsl_ppfe: support layercape + +This is a integrated patch for layerscape pfe support. + +Calvin Johnson +Signed-off-by: Yangbo Lu +--- + drivers/staging/fsl_ppfe/Kconfig | 20 + + drivers/staging/fsl_ppfe/Makefile | 19 + + drivers/staging/fsl_ppfe/TODO | 2 + + drivers/staging/fsl_ppfe/include/pfe/cbus.h | 78 + + drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h | 55 + + .../staging/fsl_ppfe/include/pfe/cbus/class_csr.h | 289 +++ + .../staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h | 242 ++ + drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h | 86 + + drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h | 100 + + .../staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h | 50 + + .../staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h | 168 ++ + .../staging/fsl_ppfe/include/pfe/cbus/util_csr.h | 61 + + drivers/staging/fsl_ppfe/include/pfe/pfe.h | 372 +++ + drivers/staging/fsl_ppfe/pfe_ctrl.c | 238 ++ + drivers/staging/fsl_ppfe/pfe_ctrl.h | 112 + + drivers/staging/fsl_ppfe/pfe_debugfs.c | 111 + + drivers/staging/fsl_ppfe/pfe_debugfs.h | 25 + + drivers/staging/fsl_ppfe/pfe_eth.c | 2434 ++++++++++++++++++++ + drivers/staging/fsl_ppfe/pfe_eth.h | 184 ++ + drivers/staging/fsl_ppfe/pfe_firmware.c | 314 +++ + drivers/staging/fsl_ppfe/pfe_firmware.h | 32 + + drivers/staging/fsl_ppfe/pfe_hal.c | 1516 ++++++++++++ + drivers/staging/fsl_ppfe/pfe_hif.c | 1072 +++++++++ + drivers/staging/fsl_ppfe/pfe_hif.h | 211 ++ + drivers/staging/fsl_ppfe/pfe_hif_lib.c | 601 +++++ + drivers/staging/fsl_ppfe/pfe_hif_lib.h | 239 ++ + drivers/staging/fsl_ppfe/pfe_hw.c | 176 ++ + drivers/staging/fsl_ppfe/pfe_hw.h | 27 + + drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c | 394 ++++ + drivers/staging/fsl_ppfe/pfe_mod.c | 141 ++ + drivers/staging/fsl_ppfe/pfe_mod.h | 112 + + drivers/staging/fsl_ppfe/pfe_perfmon.h | 38 + + drivers/staging/fsl_ppfe/pfe_sysfs.c | 818 +++++++ + drivers/staging/fsl_ppfe/pfe_sysfs.h | 29 + + 34 files changed, 10366 insertions(+) + create mode 100644 drivers/staging/fsl_ppfe/Kconfig + create mode 100644 drivers/staging/fsl_ppfe/Makefile + create mode 100644 drivers/staging/fsl_ppfe/TODO + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h + create mode 100644 drivers/staging/fsl_ppfe/include/pfe/pfe.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_ctrl.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_debugfs.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_eth.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_firmware.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hal.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hif_lib.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_hw.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_mod.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_perfmon.h + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.c + create mode 100644 drivers/staging/fsl_ppfe/pfe_sysfs.h + +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Kconfig +@@ -0,0 +1,20 @@ ++# ++# Freescale Programmable Packet Forwarding Engine driver ++# ++config FSL_PPFE ++ bool "Freescale PPFE Driver" ++ default n ++ ---help--- ++ Freescale LS1012A SoC has a Programmable Packet Forwarding Engine. ++ It provides two high performance ethernet interfaces. ++ This driver initializes, programs and controls the PPFE. ++ Use this driver to enable network connectivity on LS1012A platforms. ++ ++if FSL_PPFE ++ ++config FSL_PPFE_UTIL_DISABLED ++ bool "Disable PPFE UTIL Processor Engine" ++ ---help--- ++ UTIL PE has to be enabled only if required. ++ ++endif # FSL_PPFE +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/Makefile +@@ -0,0 +1,19 @@ ++# ++# Makefile for Freesecale PPFE driver ++# ++ ++ccflags-y += -I$(src)/include -I$(src) ++ ++obj-m += pfe.o ++ ++pfe-y += pfe_mod.o \ ++ pfe_hw.o \ ++ pfe_firmware.o \ ++ pfe_ctrl.o \ ++ pfe_hif.o \ ++ pfe_hif_lib.o\ ++ pfe_eth.o \ ++ pfe_sysfs.o \ ++ pfe_debugfs.o \ ++ pfe_ls1012a_platform.o \ ++ pfe_hal.o +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/TODO +@@ -0,0 +1,2 @@ ++TODO: ++ - provide pfe pe monitoring support +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus.h +@@ -0,0 +1,78 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _CBUS_H_ ++#define _CBUS_H_ ++ ++#define EMAC1_BASE_ADDR (CBUS_BASE_ADDR + 0x200000) ++#define EGPI1_BASE_ADDR (CBUS_BASE_ADDR + 0x210000) ++#define EMAC2_BASE_ADDR (CBUS_BASE_ADDR + 0x220000) ++#define EGPI2_BASE_ADDR (CBUS_BASE_ADDR + 0x230000) ++#define BMU1_BASE_ADDR (CBUS_BASE_ADDR + 0x240000) ++#define BMU2_BASE_ADDR (CBUS_BASE_ADDR + 0x250000) ++#define ARB_BASE_ADDR (CBUS_BASE_ADDR + 0x260000) ++#define DDR_CONFIG_BASE_ADDR (CBUS_BASE_ADDR + 0x270000) ++#define HIF_BASE_ADDR (CBUS_BASE_ADDR + 0x280000) ++#define HGPI_BASE_ADDR (CBUS_BASE_ADDR + 0x290000) ++#define LMEM_BASE_ADDR (CBUS_BASE_ADDR + 0x300000) ++#define LMEM_SIZE 0x10000 ++#define LMEM_END (LMEM_BASE_ADDR + LMEM_SIZE) ++#define TMU_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x310000) ++#define CLASS_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x320000) ++#define HIF_NOCPY_BASE_ADDR (CBUS_BASE_ADDR + 0x350000) ++#define UTIL_CSR_BASE_ADDR (CBUS_BASE_ADDR + 0x360000) ++#define CBUS_GPT_BASE_ADDR (CBUS_BASE_ADDR + 0x370000) ++ ++/* ++ * defgroup XXX_MEM_ACCESS_ADDR PE memory access through CSR ++ * XXX_MEM_ACCESS_ADDR register bit definitions. ++ */ ++#define PE_MEM_ACCESS_WRITE BIT(31) /* Internal Memory Write. */ ++#define PE_MEM_ACCESS_IMEM BIT(15) ++#define PE_MEM_ACCESS_DMEM BIT(16) ++ ++/* Byte Enables of the Internal memory access. These are interpred in BE */ ++#define PE_MEM_ACCESS_BYTE_ENABLE(offset, size) \ ++ ({ typeof(size) size_ = (size); \ ++ (((BIT(size_) - 1) << (4 - (offset) - (size_))) & 0xf) << 24; }) ++ ++#include "cbus/emac_mtip.h" ++#include "cbus/gpi.h" ++#include "cbus/bmu.h" ++#include "cbus/hif.h" ++#include "cbus/tmu_csr.h" ++#include "cbus/class_csr.h" ++#include "cbus/hif_nocpy.h" ++#include "cbus/util_csr.h" ++ ++/* PFE cores states */ ++#define CORE_DISABLE 0x00000000 ++#define CORE_ENABLE 0x00000001 ++#define CORE_SW_RESET 0x00000002 ++ ++/* LMEM defines */ ++#define LMEM_HDR_SIZE 0x0010 ++#define LMEM_BUF_SIZE_LN2 0x7 ++#define LMEM_BUF_SIZE BIT(LMEM_BUF_SIZE_LN2) ++ ++/* DDR defines */ ++#define DDR_HDR_SIZE 0x0100 ++#define DDR_BUF_SIZE_LN2 0xb ++#define DDR_BUF_SIZE BIT(DDR_BUF_SIZE_LN2) ++ ++#endif /* _CBUS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/bmu.h +@@ -0,0 +1,55 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _BMU_H_ ++#define _BMU_H_ ++ ++#define BMU_VERSION 0x000 ++#define BMU_CTRL 0x004 ++#define BMU_UCAST_CONFIG 0x008 ++#define BMU_UCAST_BASE_ADDR 0x00c ++#define BMU_BUF_SIZE 0x010 ++#define BMU_BUF_CNT 0x014 ++#define BMU_THRES 0x018 ++#define BMU_INT_SRC 0x020 ++#define BMU_INT_ENABLE 0x024 ++#define BMU_ALLOC_CTRL 0x030 ++#define BMU_FREE_CTRL 0x034 ++#define BMU_FREE_ERR_ADDR 0x038 ++#define BMU_CURR_BUF_CNT 0x03c ++#define BMU_MCAST_CNT 0x040 ++#define BMU_MCAST_ALLOC_CTRL 0x044 ++#define BMU_REM_BUF_CNT 0x048 ++#define BMU_LOW_WATERMARK 0x050 ++#define BMU_HIGH_WATERMARK 0x054 ++#define BMU_INT_MEM_ACCESS 0x100 ++ ++struct BMU_CFG { ++ unsigned long baseaddr; ++ u32 count; ++ u32 size; ++ u32 low_watermark; ++ u32 high_watermark; ++}; ++ ++#define BMU1_BUF_SIZE LMEM_BUF_SIZE_LN2 ++#define BMU2_BUF_SIZE DDR_BUF_SIZE_LN2 ++ ++#define BMU2_MCAST_ALLOC_CTRL (BMU2_BASE_ADDR + BMU_MCAST_ALLOC_CTRL) ++ ++#endif /* _BMU_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/class_csr.h +@@ -0,0 +1,289 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _CLASS_CSR_H_ ++#define _CLASS_CSR_H_ ++ ++/* @file class_csr.h. ++ * class_csr - block containing all the classifier control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define CLASS_VERSION (CLASS_CSR_BASE_ADDR + 0x000) ++#define CLASS_TX_CTRL (CLASS_CSR_BASE_ADDR + 0x004) ++#define CLASS_INQ_PKTPTR (CLASS_CSR_BASE_ADDR + 0x010) ++ ++/* (ddr_hdr_size[24:16], lmem_hdr_size[5:0]) */ ++#define CLASS_HDR_SIZE (CLASS_CSR_BASE_ADDR + 0x014) ++ ++/* LMEM header size for the Classifier block.\ Data in the LMEM ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_LMEM(off) ((off) & 0x3f) ++ ++/* DDR header size for the Classifier block.\ Data in the DDR ++ * is written from this offset. ++ */ ++#define CLASS_HDR_SIZE_DDR(off) (((off) & 0x1ff) << 16) ++ ++#define CLASS_PE0_QB_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x020) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on QB side. */ ++#define CLASS_PE0_QB_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x024) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on QB side. */ ++#define CLASS_PE0_RO_DM_ADDR0 (CLASS_CSR_BASE_ADDR + 0x060) ++ ++/* DMEM address of first [15:0] and second [31:16] buffers on RO side. */ ++#define CLASS_PE0_RO_DM_ADDR1 (CLASS_CSR_BASE_ADDR + 0x064) ++ ++/* DMEM address of third [15:0] and fourth [31:16] buffers on RO side. */ ++ ++/* @name Class PE memory access. Allows external PE's and HOST to ++ * read/write PMEM/DMEM memory ranges for each classifier PE. ++ */ ++/* {sr_pe_mem_cmd[31], csr_pe_mem_wren[27:24], csr_pe_mem_addr[23:0]}, ++ * See \ref XXX_MEM_ACCESS_ADDR for details. ++ */ ++#define CLASS_MEM_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x100) ++ ++/* Internal Memory Access Write Data [31:0] */ ++#define CLASS_MEM_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x104) ++ ++/* Internal Memory Access Read Data [31:0] */ ++#define CLASS_MEM_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x108) ++#define CLASS_TM_INQ_ADDR (CLASS_CSR_BASE_ADDR + 0x114) ++#define CLASS_PE_STATUS (CLASS_CSR_BASE_ADDR + 0x118) ++ ++#define CLASS_PHY1_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x11c) ++#define CLASS_PHY1_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x120) ++#define CLASS_PHY1_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x124) ++#define CLASS_PHY1_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x128) ++#define CLASS_PHY1_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x12c) ++#define CLASS_PHY1_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x130) ++#define CLASS_PHY1_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x134) ++#define CLASS_PHY1_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x138) ++#define CLASS_PHY1_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x13c) ++#define CLASS_PHY1_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x140) ++#define CLASS_PHY2_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x144) ++#define CLASS_PHY2_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x148) ++#define CLASS_PHY2_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x14c) ++#define CLASS_PHY2_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x150) ++#define CLASS_PHY2_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x154) ++#define CLASS_PHY2_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x158) ++#define CLASS_PHY2_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x15c) ++#define CLASS_PHY2_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x160) ++#define CLASS_PHY2_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x164) ++#define CLASS_PHY2_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x168) ++#define CLASS_PHY3_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x16c) ++#define CLASS_PHY3_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x170) ++#define CLASS_PHY3_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x174) ++#define CLASS_PHY3_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x178) ++#define CLASS_PHY3_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x17c) ++#define CLASS_PHY3_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x180) ++#define CLASS_PHY3_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x184) ++#define CLASS_PHY3_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x188) ++#define CLASS_PHY3_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x18c) ++#define CLASS_PHY3_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x190) ++#define CLASS_PHY1_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x194) ++#define CLASS_PHY1_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x198) ++#define CLASS_PHY1_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x19c) ++#define CLASS_PHY1_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a0) ++#define CLASS_PHY2_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a4) ++#define CLASS_PHY2_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1a8) ++#define CLASS_PHY2_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1ac) ++#define CLASS_PHY2_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b0) ++#define CLASS_PHY3_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b4) ++#define CLASS_PHY3_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1b8) ++#define CLASS_PHY3_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1bc) ++#define CLASS_PHY3_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c0) ++#define CLASS_PHY4_ICMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c4) ++#define CLASS_PHY4_IGMP_PKTS (CLASS_CSR_BASE_ADDR + 0x1c8) ++#define CLASS_PHY4_TCP_PKTS (CLASS_CSR_BASE_ADDR + 0x1cc) ++#define CLASS_PHY4_UDP_PKTS (CLASS_CSR_BASE_ADDR + 0x1d0) ++#define CLASS_PHY4_RX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d4) ++#define CLASS_PHY4_TX_PKTS (CLASS_CSR_BASE_ADDR + 0x1d8) ++#define CLASS_PHY4_LP_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1dc) ++#define CLASS_PHY4_INTF_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e0) ++#define CLASS_PHY4_INTF_MATCH_PKTS (CLASS_CSR_BASE_ADDR + 0x1e4) ++#define CLASS_PHY4_L3_FAIL_PKTS (CLASS_CSR_BASE_ADDR + 0x1e8) ++#define CLASS_PHY4_V4_PKTS (CLASS_CSR_BASE_ADDR + 0x1ec) ++#define CLASS_PHY4_V6_PKTS (CLASS_CSR_BASE_ADDR + 0x1f0) ++#define CLASS_PHY4_CHKSUM_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f4) ++#define CLASS_PHY4_TTL_ERR_PKTS (CLASS_CSR_BASE_ADDR + 0x1f8) ++ ++#define CLASS_PE_SYS_CLK_RATIO (CLASS_CSR_BASE_ADDR + 0x200) ++#define CLASS_AFULL_THRES (CLASS_CSR_BASE_ADDR + 0x204) ++#define CLASS_GAP_BETWEEN_READS (CLASS_CSR_BASE_ADDR + 0x208) ++#define CLASS_MAX_BUF_CNT (CLASS_CSR_BASE_ADDR + 0x20c) ++#define CLASS_TSQ_FIFO_THRES (CLASS_CSR_BASE_ADDR + 0x210) ++#define CLASS_TSQ_MAX_CNT (CLASS_CSR_BASE_ADDR + 0x214) ++#define CLASS_IRAM_DATA_0 (CLASS_CSR_BASE_ADDR + 0x218) ++#define CLASS_IRAM_DATA_1 (CLASS_CSR_BASE_ADDR + 0x21c) ++#define CLASS_IRAM_DATA_2 (CLASS_CSR_BASE_ADDR + 0x220) ++#define CLASS_IRAM_DATA_3 (CLASS_CSR_BASE_ADDR + 0x224) ++ ++#define CLASS_BUS_ACCESS_ADDR (CLASS_CSR_BASE_ADDR + 0x228) ++ ++#define CLASS_BUS_ACCESS_WDATA (CLASS_CSR_BASE_ADDR + 0x22c) ++#define CLASS_BUS_ACCESS_RDATA (CLASS_CSR_BASE_ADDR + 0x230) ++ ++/* (route_entry_size[9:0], route_hash_size[23:16] ++ * (this is actually ln2(size))) ++ */ ++#define CLASS_ROUTE_HASH_ENTRY_SIZE (CLASS_CSR_BASE_ADDR + 0x234) ++ ++#define CLASS_ROUTE_ENTRY_SIZE(size) ((size) & 0x1ff) ++#define CLASS_ROUTE_HASH_SIZE(hash_bits) (((hash_bits) & 0xff) << 16) ++ ++#define CLASS_ROUTE_TABLE_BASE (CLASS_CSR_BASE_ADDR + 0x238) ++ ++#define CLASS_ROUTE_MULTI (CLASS_CSR_BASE_ADDR + 0x23c) ++#define CLASS_SMEM_OFFSET (CLASS_CSR_BASE_ADDR + 0x240) ++#define CLASS_LMEM_BUF_SIZE (CLASS_CSR_BASE_ADDR + 0x244) ++#define CLASS_VLAN_ID (CLASS_CSR_BASE_ADDR + 0x248) ++#define CLASS_BMU1_BUF_FREE (CLASS_CSR_BASE_ADDR + 0x24c) ++#define CLASS_USE_TMU_INQ (CLASS_CSR_BASE_ADDR + 0x250) ++#define CLASS_VLAN_ID1 (CLASS_CSR_BASE_ADDR + 0x254) ++ ++#define CLASS_BUS_ACCESS_BASE (CLASS_CSR_BASE_ADDR + 0x258) ++#define CLASS_BUS_ACCESS_BASE_MASK (0xFF000000) ++/* bit 31:24 of PE peripheral address are stored in CLASS_BUS_ACCESS_BASE */ ++ ++#define CLASS_HIF_PARSE (CLASS_CSR_BASE_ADDR + 0x25c) ++ ++#define CLASS_HOST_PE0_GP (CLASS_CSR_BASE_ADDR + 0x260) ++#define CLASS_PE0_GP (CLASS_CSR_BASE_ADDR + 0x264) ++#define CLASS_HOST_PE1_GP (CLASS_CSR_BASE_ADDR + 0x268) ++#define CLASS_PE1_GP (CLASS_CSR_BASE_ADDR + 0x26c) ++#define CLASS_HOST_PE2_GP (CLASS_CSR_BASE_ADDR + 0x270) ++#define CLASS_PE2_GP (CLASS_CSR_BASE_ADDR + 0x274) ++#define CLASS_HOST_PE3_GP (CLASS_CSR_BASE_ADDR + 0x278) ++#define CLASS_PE3_GP (CLASS_CSR_BASE_ADDR + 0x27c) ++#define CLASS_HOST_PE4_GP (CLASS_CSR_BASE_ADDR + 0x280) ++#define CLASS_PE4_GP (CLASS_CSR_BASE_ADDR + 0x284) ++#define CLASS_HOST_PE5_GP (CLASS_CSR_BASE_ADDR + 0x288) ++#define CLASS_PE5_GP (CLASS_CSR_BASE_ADDR + 0x28c) ++ ++#define CLASS_PE_INT_SRC (CLASS_CSR_BASE_ADDR + 0x290) ++#define CLASS_PE_INT_ENABLE (CLASS_CSR_BASE_ADDR + 0x294) ++ ++#define CLASS_TPID0_TPID1 (CLASS_CSR_BASE_ADDR + 0x298) ++#define CLASS_TPID2 (CLASS_CSR_BASE_ADDR + 0x29c) ++ ++#define CLASS_L4_CHKSUM_ADDR (CLASS_CSR_BASE_ADDR + 0x2a0) ++ ++#define CLASS_PE0_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a4) ++#define CLASS_PE1_DEBUG (CLASS_CSR_BASE_ADDR + 0x2a8) ++#define CLASS_PE2_DEBUG (CLASS_CSR_BASE_ADDR + 0x2ac) ++#define CLASS_PE3_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b0) ++#define CLASS_PE4_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b4) ++#define CLASS_PE5_DEBUG (CLASS_CSR_BASE_ADDR + 0x2b8) ++ ++#define CLASS_STATE (CLASS_CSR_BASE_ADDR + 0x2bc) ++ ++/* CLASS defines */ ++#define CLASS_PBUF_SIZE 0x100 /* Fixed by hardware */ ++#define CLASS_PBUF_HEADER_OFFSET 0x80 /* Can be configured */ ++ ++/* Can be configured */ ++#define CLASS_PBUF0_BASE_ADDR 0x000 ++/* Can be configured */ ++#define CLASS_PBUF1_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF2_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + CLASS_PBUF_SIZE) ++/* Can be configured */ ++#define CLASS_PBUF3_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + CLASS_PBUF_SIZE) ++ ++#define CLASS_PBUF0_HEADER_BASE_ADDR (CLASS_PBUF0_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF1_HEADER_BASE_ADDR (CLASS_PBUF1_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF2_HEADER_BASE_ADDR (CLASS_PBUF2_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++#define CLASS_PBUF3_HEADER_BASE_ADDR (CLASS_PBUF3_BASE_ADDR + \ ++ CLASS_PBUF_HEADER_OFFSET) ++ ++#define CLASS_PE0_RO_DM_ADDR0_VAL ((CLASS_PBUF1_BASE_ADDR << 16) | \ ++ CLASS_PBUF0_BASE_ADDR) ++#define CLASS_PE0_RO_DM_ADDR1_VAL ((CLASS_PBUF3_BASE_ADDR << 16) | \ ++ CLASS_PBUF2_BASE_ADDR) ++ ++#define CLASS_PE0_QB_DM_ADDR0_VAL ((CLASS_PBUF1_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF0_HEADER_BASE_ADDR) ++#define CLASS_PE0_QB_DM_ADDR1_VAL ((CLASS_PBUF3_HEADER_BASE_ADDR << 16) |\ ++ CLASS_PBUF2_HEADER_BASE_ADDR) ++ ++#define CLASS_ROUTE_SIZE 128 ++#define CLASS_MAX_ROUTE_SIZE 256 ++#define CLASS_ROUTE_HASH_BITS 20 ++#define CLASS_ROUTE_HASH_MASK (BIT(CLASS_ROUTE_HASH_BITS) - 1) ++ ++/* Can be configured */ ++#define CLASS_ROUTE0_BASE_ADDR 0x400 ++/* Can be configured */ ++#define CLASS_ROUTE1_BASE_ADDR (CLASS_ROUTE0_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE2_BASE_ADDR (CLASS_ROUTE1_BASE_ADDR + CLASS_ROUTE_SIZE) ++/* Can be configured */ ++#define CLASS_ROUTE3_BASE_ADDR (CLASS_ROUTE2_BASE_ADDR + CLASS_ROUTE_SIZE) ++ ++#define CLASS_SA_SIZE 128 ++#define CLASS_IPSEC_SA0_BASE_ADDR 0x600 ++/* not used */ ++#define CLASS_IPSEC_SA1_BASE_ADDR (CLASS_IPSEC_SA0_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA2_BASE_ADDR (CLASS_IPSEC_SA1_BASE_ADDR + CLASS_SA_SIZE) ++/* not used */ ++#define CLASS_IPSEC_SA3_BASE_ADDR (CLASS_IPSEC_SA2_BASE_ADDR + CLASS_SA_SIZE) ++ ++/* generic purpose free dmem buffer, last portion of 2K dmem pbuf */ ++#define CLASS_GP_DMEM_BUF_SIZE (2048 - (CLASS_PBUF_SIZE * 4) - \ ++ (CLASS_ROUTE_SIZE * 4) - (CLASS_SA_SIZE)) ++#define CLASS_GP_DMEM_BUF ((void *)(CLASS_IPSEC_SA0_BASE_ADDR + \ ++ CLASS_SA_SIZE)) ++ ++#define TWO_LEVEL_ROUTE BIT(0) ++#define PHYNO_IN_HASH BIT(1) ++#define HW_ROUTE_FETCH BIT(3) ++#define HW_BRIDGE_FETCH BIT(5) ++#define IP_ALIGNED BIT(6) ++#define ARC_HIT_CHECK_EN BIT(7) ++#define CLASS_TOE BIT(11) ++#define HASH_NORMAL (0 << 12) ++#define HASH_CRC_PORT BIT(12) ++#define HASH_CRC_IP (2 << 12) ++#define HASH_CRC_PORT_IP (3 << 12) ++#define QB2BUS_LE BIT(15) ++ ++#define TCP_CHKSUM_DROP BIT(0) ++#define UDP_CHKSUM_DROP BIT(1) ++#define IPV4_CHKSUM_DROP BIT(9) ++ ++/*CLASS_HIF_PARSE bits*/ ++#define HIF_PKT_CLASS_EN BIT(0) ++#define HIF_PKT_OFFSET(ofst) (((ofst) & 0xF) << 1) ++ ++struct class_cfg { ++ u32 toe_mode; ++ unsigned long route_table_baseaddr; ++ u32 route_table_hash_bits; ++ u32 pe_sys_clk_ratio; ++ u32 resume; ++}; ++ ++#endif /* _CLASS_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/emac_mtip.h +@@ -0,0 +1,242 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _EMAC_H_ ++#define _EMAC_H_ ++ ++#include ++ ++#define EMAC_IEVENT_REG 0x004 ++#define EMAC_IMASK_REG 0x008 ++#define EMAC_R_DES_ACTIVE_REG 0x010 ++#define EMAC_X_DES_ACTIVE_REG 0x014 ++#define EMAC_ECNTRL_REG 0x024 ++#define EMAC_MII_DATA_REG 0x040 ++#define EMAC_MII_CTRL_REG 0x044 ++#define EMAC_MIB_CTRL_STS_REG 0x064 ++#define EMAC_RCNTRL_REG 0x084 ++#define EMAC_TCNTRL_REG 0x0C4 ++#define EMAC_PHY_ADDR_LOW 0x0E4 ++#define EMAC_PHY_ADDR_HIGH 0x0E8 ++#define EMAC_GAUR 0x120 ++#define EMAC_GALR 0x124 ++#define EMAC_TFWR_STR_FWD 0x144 ++#define EMAC_RX_SECTION_FULL 0x190 ++#define EMAC_RX_SECTION_EMPTY 0x194 ++#define EMAC_TX_SECTION_EMPTY 0x1A0 ++#define EMAC_TRUNC_FL 0x1B0 ++ ++#define RMON_T_DROP 0x200 /* Count of frames not cntd correctly */ ++#define RMON_T_PACKETS 0x204 /* RMON TX packet count */ ++#define RMON_T_BC_PKT 0x208 /* RMON TX broadcast pkts */ ++#define RMON_T_MC_PKT 0x20c /* RMON TX multicast pkts */ ++#define RMON_T_CRC_ALIGN 0x210 /* RMON TX pkts with CRC align err */ ++#define RMON_T_UNDERSIZE 0x214 /* RMON TX pkts < 64 bytes, good CRC */ ++#define RMON_T_OVERSIZE 0x218 /* RMON TX pkts > MAX_FL bytes good CRC */ ++#define RMON_T_FRAG 0x21c /* RMON TX pkts < 64 bytes, bad CRC */ ++#define RMON_T_JAB 0x220 /* RMON TX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_T_COL 0x224 /* RMON TX collision count */ ++#define RMON_T_P64 0x228 /* RMON TX 64 byte pkts */ ++#define RMON_T_P65TO127 0x22c /* RMON TX 65 to 127 byte pkts */ ++#define RMON_T_P128TO255 0x230 /* RMON TX 128 to 255 byte pkts */ ++#define RMON_T_P256TO511 0x234 /* RMON TX 256 to 511 byte pkts */ ++#define RMON_T_P512TO1023 0x238 /* RMON TX 512 to 1023 byte pkts */ ++#define RMON_T_P1024TO2047 0x23c /* RMON TX 1024 to 2047 byte pkts */ ++#define RMON_T_P_GTE2048 0x240 /* RMON TX pkts > 2048 bytes */ ++#define RMON_T_OCTETS 0x244 /* RMON TX octets */ ++#define IEEE_T_DROP 0x248 /* Count of frames not counted crtly */ ++#define IEEE_T_FRAME_OK 0x24c /* Frames tx'd OK */ ++#define IEEE_T_1COL 0x250 /* Frames tx'd with single collision */ ++#define IEEE_T_MCOL 0x254 /* Frames tx'd with multiple collision */ ++#define IEEE_T_DEF 0x258 /* Frames tx'd after deferral delay */ ++#define IEEE_T_LCOL 0x25c /* Frames tx'd with late collision */ ++#define IEEE_T_EXCOL 0x260 /* Frames tx'd with excesv collisions */ ++#define IEEE_T_MACERR 0x264 /* Frames tx'd with TX FIFO underrun */ ++#define IEEE_T_CSERR 0x268 /* Frames tx'd with carrier sense err */ ++#define IEEE_T_SQE 0x26c /* Frames tx'd with SQE err */ ++#define IEEE_T_FDXFC 0x270 /* Flow control pause frames tx'd */ ++#define IEEE_T_OCTETS_OK 0x274 /* Octet count for frames tx'd w/o err */ ++#define RMON_R_PACKETS 0x284 /* RMON RX packet count */ ++#define RMON_R_BC_PKT 0x288 /* RMON RX broadcast pkts */ ++#define RMON_R_MC_PKT 0x28c /* RMON RX multicast pkts */ ++#define RMON_R_CRC_ALIGN 0x290 /* RMON RX pkts with CRC alignment err */ ++#define RMON_R_UNDERSIZE 0x294 /* RMON RX pkts < 64 bytes, good CRC */ ++#define RMON_R_OVERSIZE 0x298 /* RMON RX pkts > MAX_FL bytes good CRC */ ++#define RMON_R_FRAG 0x29c /* RMON RX pkts < 64 bytes, bad CRC */ ++#define RMON_R_JAB 0x2a0 /* RMON RX pkts > MAX_FL bytes, bad CRC */ ++#define RMON_R_RESVD_O 0x2a4 /* Reserved */ ++#define RMON_R_P64 0x2a8 /* RMON RX 64 byte pkts */ ++#define RMON_R_P65TO127 0x2ac /* RMON RX 65 to 127 byte pkts */ ++#define RMON_R_P128TO255 0x2b0 /* RMON RX 128 to 255 byte pkts */ ++#define RMON_R_P256TO511 0x2b4 /* RMON RX 256 to 511 byte pkts */ ++#define RMON_R_P512TO1023 0x2b8 /* RMON RX 512 to 1023 byte pkts */ ++#define RMON_R_P1024TO2047 0x2bc /* RMON RX 1024 to 2047 byte pkts */ ++#define RMON_R_P_GTE2048 0x2c0 /* RMON RX pkts > 2048 bytes */ ++#define RMON_R_OCTETS 0x2c4 /* RMON RX octets */ ++#define IEEE_R_DROP 0x2c8 /* Count frames not counted correctly */ ++#define IEEE_R_FRAME_OK 0x2cc /* Frames rx'd OK */ ++#define IEEE_R_CRC 0x2d0 /* Frames rx'd with CRC err */ ++#define IEEE_R_ALIGN 0x2d4 /* Frames rx'd with alignment err */ ++#define IEEE_R_MACERR 0x2d8 /* Receive FIFO overflow count */ ++#define IEEE_R_FDXFC 0x2dc /* Flow control pause frames rx'd */ ++#define IEEE_R_OCTETS_OK 0x2e0 /* Octet cnt for frames rx'd w/o err */ ++ ++#define EMAC_SMAC_0_0 0x500 /*Supplemental MAC Address 0 (RW).*/ ++#define EMAC_SMAC_0_1 0x504 /*Supplemental MAC Address 0 (RW).*/ ++ ++/* GEMAC definitions and settings */ ++ ++#define EMAC_PORT_0 0 ++#define EMAC_PORT_1 1 ++ ++/* GEMAC Bit definitions */ ++#define EMAC_IEVENT_HBERR 0x80000000 ++#define EMAC_IEVENT_BABR 0x40000000 ++#define EMAC_IEVENT_BABT 0x20000000 ++#define EMAC_IEVENT_GRA 0x10000000 ++#define EMAC_IEVENT_TXF 0x08000000 ++#define EMAC_IEVENT_TXB 0x04000000 ++#define EMAC_IEVENT_RXF 0x02000000 ++#define EMAC_IEVENT_RXB 0x01000000 ++#define EMAC_IEVENT_MII 0x00800000 ++#define EMAC_IEVENT_EBERR 0x00400000 ++#define EMAC_IEVENT_LC 0x00200000 ++#define EMAC_IEVENT_RL 0x00100000 ++#define EMAC_IEVENT_UN 0x00080000 ++ ++#define EMAC_IMASK_HBERR 0x80000000 ++#define EMAC_IMASK_BABR 0x40000000 ++#define EMAC_IMASKT_BABT 0x20000000 ++#define EMAC_IMASK_GRA 0x10000000 ++#define EMAC_IMASKT_TXF 0x08000000 ++#define EMAC_IMASK_TXB 0x04000000 ++#define EMAC_IMASKT_RXF 0x02000000 ++#define EMAC_IMASK_RXB 0x01000000 ++#define EMAC_IMASK_MII 0x00800000 ++#define EMAC_IMASK_EBERR 0x00400000 ++#define EMAC_IMASK_LC 0x00200000 ++#define EMAC_IMASKT_RL 0x00100000 ++#define EMAC_IMASK_UN 0x00080000 ++ ++#define EMAC_RCNTRL_MAX_FL_SHIFT 16 ++#define EMAC_RCNTRL_LOOP 0x00000001 ++#define EMAC_RCNTRL_DRT 0x00000002 ++#define EMAC_RCNTRL_MII_MODE 0x00000004 ++#define EMAC_RCNTRL_PROM 0x00000008 ++#define EMAC_RCNTRL_BC_REJ 0x00000010 ++#define EMAC_RCNTRL_FCE 0x00000020 ++#define EMAC_RCNTRL_RGMII 0x00000040 ++#define EMAC_RCNTRL_SGMII 0x00000080 ++#define EMAC_RCNTRL_RMII 0x00000100 ++#define EMAC_RCNTRL_RMII_10T 0x00000200 ++#define EMAC_RCNTRL_CRC_FWD 0x00004000 ++ ++#define EMAC_TCNTRL_GTS 0x00000001 ++#define EMAC_TCNTRL_HBC 0x00000002 ++#define EMAC_TCNTRL_FDEN 0x00000004 ++#define EMAC_TCNTRL_TFC_PAUSE 0x00000008 ++#define EMAC_TCNTRL_RFC_PAUSE 0x00000010 ++ ++#define EMAC_ECNTRL_RESET 0x00000001 /* reset the EMAC */ ++#define EMAC_ECNTRL_ETHER_EN 0x00000002 /* enable the EMAC */ ++#define EMAC_ECNTRL_MAGIC_ENA 0x00000004 ++#define EMAC_ECNTRL_SLEEP 0x00000008 ++#define EMAC_ECNTRL_SPEED 0x00000020 ++#define EMAC_ECNTRL_DBSWAP 0x00000100 ++ ++#define EMAC_X_WMRK_STRFWD 0x00000100 ++ ++#define EMAC_X_DES_ACTIVE_TDAR 0x01000000 ++#define EMAC_R_DES_ACTIVE_RDAR 0x01000000 ++ ++#define EMAC_RX_SECTION_EMPTY_V 0x00010006 ++/* ++ * The possible operating speeds of the MAC, currently supporting 10, 100 and ++ * 1000Mb modes. ++ */ ++enum mac_speed {SPEED_10M, SPEED_100M, SPEED_1000M, SPEED_1000M_PCS}; ++ ++/* MII-related definitios */ ++#define EMAC_MII_DATA_ST 0x40000000 /* Start of frame delimiter */ ++#define EMAC_MII_DATA_OP_RD 0x20000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_CL45_RD 0x30000000 /* Perform a read operation */ ++#define EMAC_MII_DATA_OP_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_OP_CL45_WR 0x10000000 /* Perform a write operation */ ++#define EMAC_MII_DATA_PA_MSK 0x0f800000 /* PHY Address field mask */ ++#define EMAC_MII_DATA_RA_MSK 0x007c0000 /* PHY Register field mask */ ++#define EMAC_MII_DATA_TA 0x00020000 /* Turnaround */ ++#define EMAC_MII_DATA_DATAMSK 0x0000ffff /* PHY data field */ ++ ++#define EMAC_MII_DATA_RA_SHIFT 18 /* MII Register address bits */ ++#define EMAC_MII_DATA_RA_MASK 0x1F /* MII Register address mask */ ++#define EMAC_MII_DATA_PA_SHIFT 23 /* MII PHY address bits */ ++#define EMAC_MII_DATA_PA_MASK 0x1F /* MII PHY address mask */ ++ ++#define EMAC_MII_DATA_RA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_RA_SHIFT) ++#define EMAC_MII_DATA_PA(v) (((v) & EMAC_MII_DATA_RA_MASK) << \ ++ EMAC_MII_DATA_PA_SHIFT) ++#define EMAC_MII_DATA(v) ((v) & 0xffff) ++ ++#define EMAC_MII_SPEED_SHIFT 1 ++#define EMAC_HOLDTIME_SHIFT 8 ++#define EMAC_HOLDTIME_MASK 0x7 ++#define EMAC_HOLDTIME(v) (((v) & EMAC_HOLDTIME_MASK) << \ ++ EMAC_HOLDTIME_SHIFT) ++ ++/* ++ * The Address organisation for the MAC device. All addresses are split into ++ * two 32-bit register fields. The first one (bottom) is the lower 32-bits of ++ * the address and the other field are the high order bits - this may be 16-bits ++ * in the case of MAC addresses, or 32-bits for the hash address. ++ * In terms of memory storage, the first item (bottom) is assumed to be at a ++ * lower address location than 'top'. i.e. top should be at address location of ++ * 'bottom' + 4 bytes. ++ */ ++struct pfe_mac_addr { ++ u32 bottom; /* Lower 32-bits of address. */ ++ u32 top; /* Upper 32-bits of address. */ ++}; ++ ++/* ++ * The following is the organisation of the address filters section of the MAC ++ * registers. The Cadence MAC contains four possible specific address match ++ * addresses, if an incoming frame corresponds to any one of these four ++ * addresses then the frame will be copied to memory. ++ * It is not necessary for all four of the address match registers to be ++ * programmed, this is application dependent. ++ */ ++struct spec_addr { ++ struct pfe_mac_addr one; /* Specific address register 1. */ ++ struct pfe_mac_addr two; /* Specific address register 2. */ ++ struct pfe_mac_addr three; /* Specific address register 3. */ ++ struct pfe_mac_addr four; /* Specific address register 4. */ ++}; ++ ++struct gemac_cfg { ++ u32 mode; ++ u32 speed; ++ u32 duplex; ++}; ++ ++/* EMAC Hash size */ ++#define EMAC_HASH_REG_BITS 64 ++ ++#define EMAC_SPEC_ADDR_MAX 4 ++ ++#endif /* _EMAC_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/gpi.h +@@ -0,0 +1,86 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _GPI_H_ ++#define _GPI_H_ ++ ++#define GPI_VERSION 0x00 ++#define GPI_CTRL 0x04 ++#define GPI_RX_CONFIG 0x08 ++#define GPI_HDR_SIZE 0x0c ++#define GPI_BUF_SIZE 0x10 ++#define GPI_LMEM_ALLOC_ADDR 0x14 ++#define GPI_LMEM_FREE_ADDR 0x18 ++#define GPI_DDR_ALLOC_ADDR 0x1c ++#define GPI_DDR_FREE_ADDR 0x20 ++#define GPI_CLASS_ADDR 0x24 ++#define GPI_DRX_FIFO 0x28 ++#define GPI_TRX_FIFO 0x2c ++#define GPI_INQ_PKTPTR 0x30 ++#define GPI_DDR_DATA_OFFSET 0x34 ++#define GPI_LMEM_DATA_OFFSET 0x38 ++#define GPI_TMLF_TX 0x4c ++#define GPI_DTX_ASEQ 0x50 ++#define GPI_FIFO_STATUS 0x54 ++#define GPI_FIFO_DEBUG 0x58 ++#define GPI_TX_PAUSE_TIME 0x5c ++#define GPI_LMEM_SEC_BUF_DATA_OFFSET 0x60 ++#define GPI_DDR_SEC_BUF_DATA_OFFSET 0x64 ++#define GPI_TOE_CHKSUM_EN 0x68 ++#define GPI_OVERRUN_DROPCNT 0x6c ++#define GPI_CSR_MTIP_PAUSE_REG 0x74 ++#define GPI_CSR_MTIP_PAUSE_QUANTUM 0x78 ++#define GPI_CSR_RX_CNT 0x7c ++#define GPI_CSR_TX_CNT 0x80 ++#define GPI_CSR_DEBUG1 0x84 ++#define GPI_CSR_DEBUG2 0x88 ++ ++struct gpi_cfg { ++ u32 lmem_rtry_cnt; ++ u32 tmlf_txthres; ++ u32 aseq_len; ++ u32 mtip_pause_reg; ++}; ++ ++/* GPI commons defines */ ++#define GPI_LMEM_BUF_EN 0x1 ++#define GPI_DDR_BUF_EN 0x1 ++ ++/* EGPI 1 defines */ ++#define EGPI1_LMEM_RTRY_CNT 0x40 ++#define EGPI1_TMLF_TXTHRES 0xBC ++#define EGPI1_ASEQ_LEN 0x50 ++ ++/* EGPI 2 defines */ ++#define EGPI2_LMEM_RTRY_CNT 0x40 ++#define EGPI2_TMLF_TXTHRES 0xBC ++#define EGPI2_ASEQ_LEN 0x40 ++ ++/* EGPI 3 defines */ ++#define EGPI3_LMEM_RTRY_CNT 0x40 ++#define EGPI3_TMLF_TXTHRES 0xBC ++#define EGPI3_ASEQ_LEN 0x40 ++ ++/* HGPI defines */ ++#define HGPI_LMEM_RTRY_CNT 0x40 ++#define HGPI_TMLF_TXTHRES 0xBC ++#define HGPI_ASEQ_LEN 0x40 ++ ++#define EGPI_PAUSE_TIME 0x000007D0 ++#define EGPI_PAUSE_ENABLE 0x40000000 ++#endif /* _GPI_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif.h +@@ -0,0 +1,100 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _HIF_H_ ++#define _HIF_H_ ++ ++/* @file hif.h. ++ * hif - PFE hif block control and status register. ++ * Mapped on CBUS and accessible from all PE's and ARM. ++ */ ++#define HIF_VERSION (HIF_BASE_ADDR + 0x00) ++#define HIF_TX_CTRL (HIF_BASE_ADDR + 0x04) ++#define HIF_TX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x08) ++#define HIF_TX_ALLOC (HIF_BASE_ADDR + 0x0c) ++#define HIF_TX_BDP_ADDR (HIF_BASE_ADDR + 0x10) ++#define HIF_TX_STATUS (HIF_BASE_ADDR + 0x14) ++#define HIF_RX_CTRL (HIF_BASE_ADDR + 0x20) ++#define HIF_RX_BDP_ADDR (HIF_BASE_ADDR + 0x24) ++#define HIF_RX_STATUS (HIF_BASE_ADDR + 0x30) ++#define HIF_INT_SRC (HIF_BASE_ADDR + 0x34) ++#define HIF_INT_ENABLE (HIF_BASE_ADDR + 0x38) ++#define HIF_POLL_CTRL (HIF_BASE_ADDR + 0x3c) ++#define HIF_RX_CURR_BD_ADDR (HIF_BASE_ADDR + 0x40) ++#define HIF_RX_ALLOC (HIF_BASE_ADDR + 0x44) ++#define HIF_TX_DMA_STATUS (HIF_BASE_ADDR + 0x48) ++#define HIF_RX_DMA_STATUS (HIF_BASE_ADDR + 0x4c) ++#define HIF_INT_COAL (HIF_BASE_ADDR + 0x50) ++ ++/* HIF_INT_SRC/ HIF_INT_ENABLE control bits */ ++#define HIF_INT BIT(0) ++#define HIF_RXBD_INT BIT(1) ++#define HIF_RXPKT_INT BIT(2) ++#define HIF_TXBD_INT BIT(3) ++#define HIF_TXPKT_INT BIT(4) ++ ++/* HIF_TX_CTRL bits */ ++#define HIF_CTRL_DMA_EN BIT(0) ++#define HIF_CTRL_BDP_POLL_CTRL_EN BIT(1) ++#define HIF_CTRL_BDP_CH_START_WSTB BIT(2) ++ ++/* HIF_RX_STATUS bits */ ++#define BDP_CSR_RX_DMA_ACTV BIT(16) ++ ++/* HIF_INT_ENABLE bits */ ++#define HIF_INT_EN BIT(0) ++#define HIF_RXBD_INT_EN BIT(1) ++#define HIF_RXPKT_INT_EN BIT(2) ++#define HIF_TXBD_INT_EN BIT(3) ++#define HIF_TXPKT_INT_EN BIT(4) ++ ++/* HIF_POLL_CTRL bits*/ ++#define HIF_RX_POLL_CTRL_CYCLE 0x0400 ++#define HIF_TX_POLL_CTRL_CYCLE 0x0400 ++ ++/* HIF_INT_COAL bits*/ ++#define HIF_INT_COAL_ENABLE BIT(31) ++ ++/* Buffer descriptor control bits */ ++#define BD_CTRL_BUFLEN_MASK 0x3fff ++#define BD_BUF_LEN(x) ((x) & BD_CTRL_BUFLEN_MASK) ++#define BD_CTRL_CBD_INT_EN BIT(16) ++#define BD_CTRL_PKT_INT_EN BIT(17) ++#define BD_CTRL_LIFM BIT(18) ++#define BD_CTRL_LAST_BD BIT(19) ++#define BD_CTRL_DIR BIT(20) ++#define BD_CTRL_LMEM_CPY BIT(21) /* Valid only for HIF_NOCPY */ ++#define BD_CTRL_PKT_XFER BIT(24) ++#define BD_CTRL_DESC_EN BIT(31) ++#define BD_CTRL_PARSE_DISABLE BIT(25) ++#define BD_CTRL_BRFETCH_DISABLE BIT(26) ++#define BD_CTRL_RTFETCH_DISABLE BIT(27) ++ ++/* Buffer descriptor status bits*/ ++#define BD_STATUS_CONN_ID(x) ((x) & 0xffff) ++#define BD_STATUS_DIR_PROC_ID BIT(16) ++#define BD_STATUS_CONN_ID_EN BIT(17) ++#define BD_STATUS_PE2PROC_ID(x) (((x) & 7) << 18) ++#define BD_STATUS_LE_DATA BIT(21) ++#define BD_STATUS_CHKSUM_EN BIT(22) ++ ++/* HIF Buffer descriptor status bits */ ++#define DIR_PROC_ID BIT(16) ++#define PROC_ID(id) ((id) << 18) ++ ++#endif /* _HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/hif_nocpy.h +@@ -0,0 +1,50 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _HIF_NOCPY_H_ ++#define _HIF_NOCPY_H_ ++ ++#define HIF_NOCPY_VERSION (HIF_NOCPY_BASE_ADDR + 0x00) ++#define HIF_NOCPY_TX_CTRL (HIF_NOCPY_BASE_ADDR + 0x04) ++#define HIF_NOCPY_TX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x08) ++#define HIF_NOCPY_TX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x0c) ++#define HIF_NOCPY_TX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x10) ++#define HIF_NOCPY_TX_STATUS (HIF_NOCPY_BASE_ADDR + 0x14) ++#define HIF_NOCPY_RX_CTRL (HIF_NOCPY_BASE_ADDR + 0x20) ++#define HIF_NOCPY_RX_BDP_ADDR (HIF_NOCPY_BASE_ADDR + 0x24) ++#define HIF_NOCPY_RX_STATUS (HIF_NOCPY_BASE_ADDR + 0x30) ++#define HIF_NOCPY_INT_SRC (HIF_NOCPY_BASE_ADDR + 0x34) ++#define HIF_NOCPY_INT_ENABLE (HIF_NOCPY_BASE_ADDR + 0x38) ++#define HIF_NOCPY_POLL_CTRL (HIF_NOCPY_BASE_ADDR + 0x3c) ++#define HIF_NOCPY_RX_CURR_BD_ADDR (HIF_NOCPY_BASE_ADDR + 0x40) ++#define HIF_NOCPY_RX_ALLOC (HIF_NOCPY_BASE_ADDR + 0x44) ++#define HIF_NOCPY_TX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x48) ++#define HIF_NOCPY_RX_DMA_STATUS (HIF_NOCPY_BASE_ADDR + 0x4c) ++#define HIF_NOCPY_RX_INQ0_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x50) ++#define HIF_NOCPY_RX_INQ1_PKTPTR (HIF_NOCPY_BASE_ADDR + 0x54) ++#define HIF_NOCPY_TX_PORT_NO (HIF_NOCPY_BASE_ADDR + 0x60) ++#define HIF_NOCPY_LMEM_ALLOC_ADDR (HIF_NOCPY_BASE_ADDR + 0x64) ++#define HIF_NOCPY_CLASS_ADDR (HIF_NOCPY_BASE_ADDR + 0x68) ++#define HIF_NOCPY_TMU_PORT0_ADDR (HIF_NOCPY_BASE_ADDR + 0x70) ++#define HIF_NOCPY_TMU_PORT1_ADDR (HIF_NOCPY_BASE_ADDR + 0x74) ++#define HIF_NOCPY_TMU_PORT2_ADDR (HIF_NOCPY_BASE_ADDR + 0x7c) ++#define HIF_NOCPY_TMU_PORT3_ADDR (HIF_NOCPY_BASE_ADDR + 0x80) ++#define HIF_NOCPY_TMU_PORT4_ADDR (HIF_NOCPY_BASE_ADDR + 0x84) ++#define HIF_NOCPY_INT_COAL (HIF_NOCPY_BASE_ADDR + 0x90) ++ ++#endif /* _HIF_NOCPY_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/tmu_csr.h +@@ -0,0 +1,168 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _TMU_CSR_H_ ++#define _TMU_CSR_H_ ++ ++#define TMU_VERSION (TMU_CSR_BASE_ADDR + 0x000) ++#define TMU_INQ_WATERMARK (TMU_CSR_BASE_ADDR + 0x004) ++#define TMU_PHY_INQ_PKTPTR (TMU_CSR_BASE_ADDR + 0x008) ++#define TMU_PHY_INQ_PKTINFO (TMU_CSR_BASE_ADDR + 0x00c) ++#define TMU_PHY_INQ_FIFO_CNT (TMU_CSR_BASE_ADDR + 0x010) ++#define TMU_SYS_GENERIC_CONTROL (TMU_CSR_BASE_ADDR + 0x014) ++#define TMU_SYS_GENERIC_STATUS (TMU_CSR_BASE_ADDR + 0x018) ++#define TMU_SYS_GEN_CON0 (TMU_CSR_BASE_ADDR + 0x01c) ++#define TMU_SYS_GEN_CON1 (TMU_CSR_BASE_ADDR + 0x020) ++#define TMU_SYS_GEN_CON2 (TMU_CSR_BASE_ADDR + 0x024) ++#define TMU_SYS_GEN_CON3 (TMU_CSR_BASE_ADDR + 0x028) ++#define TMU_SYS_GEN_CON4 (TMU_CSR_BASE_ADDR + 0x02c) ++#define TMU_TEQ_DISABLE_DROPCHK (TMU_CSR_BASE_ADDR + 0x030) ++#define TMU_TEQ_CTRL (TMU_CSR_BASE_ADDR + 0x034) ++#define TMU_TEQ_QCFG (TMU_CSR_BASE_ADDR + 0x038) ++#define TMU_TEQ_DROP_STAT (TMU_CSR_BASE_ADDR + 0x03c) ++#define TMU_TEQ_QAVG (TMU_CSR_BASE_ADDR + 0x040) ++#define TMU_TEQ_WREG_PROB (TMU_CSR_BASE_ADDR + 0x044) ++#define TMU_TEQ_TRANS_STAT (TMU_CSR_BASE_ADDR + 0x048) ++#define TMU_TEQ_HW_PROB_CFG0 (TMU_CSR_BASE_ADDR + 0x04c) ++#define TMU_TEQ_HW_PROB_CFG1 (TMU_CSR_BASE_ADDR + 0x050) ++#define TMU_TEQ_HW_PROB_CFG2 (TMU_CSR_BASE_ADDR + 0x054) ++#define TMU_TEQ_HW_PROB_CFG3 (TMU_CSR_BASE_ADDR + 0x058) ++#define TMU_TEQ_HW_PROB_CFG4 (TMU_CSR_BASE_ADDR + 0x05c) ++#define TMU_TEQ_HW_PROB_CFG5 (TMU_CSR_BASE_ADDR + 0x060) ++#define TMU_TEQ_HW_PROB_CFG6 (TMU_CSR_BASE_ADDR + 0x064) ++#define TMU_TEQ_HW_PROB_CFG7 (TMU_CSR_BASE_ADDR + 0x068) ++#define TMU_TEQ_HW_PROB_CFG8 (TMU_CSR_BASE_ADDR + 0x06c) ++#define TMU_TEQ_HW_PROB_CFG9 (TMU_CSR_BASE_ADDR + 0x070) ++#define TMU_TEQ_HW_PROB_CFG10 (TMU_CSR_BASE_ADDR + 0x074) ++#define TMU_TEQ_HW_PROB_CFG11 (TMU_CSR_BASE_ADDR + 0x078) ++#define TMU_TEQ_HW_PROB_CFG12 (TMU_CSR_BASE_ADDR + 0x07c) ++#define TMU_TEQ_HW_PROB_CFG13 (TMU_CSR_BASE_ADDR + 0x080) ++#define TMU_TEQ_HW_PROB_CFG14 (TMU_CSR_BASE_ADDR + 0x084) ++#define TMU_TEQ_HW_PROB_CFG15 (TMU_CSR_BASE_ADDR + 0x088) ++#define TMU_TEQ_HW_PROB_CFG16 (TMU_CSR_BASE_ADDR + 0x08c) ++#define TMU_TEQ_HW_PROB_CFG17 (TMU_CSR_BASE_ADDR + 0x090) ++#define TMU_TEQ_HW_PROB_CFG18 (TMU_CSR_BASE_ADDR + 0x094) ++#define TMU_TEQ_HW_PROB_CFG19 (TMU_CSR_BASE_ADDR + 0x098) ++#define TMU_TEQ_HW_PROB_CFG20 (TMU_CSR_BASE_ADDR + 0x09c) ++#define TMU_TEQ_HW_PROB_CFG21 (TMU_CSR_BASE_ADDR + 0x0a0) ++#define TMU_TEQ_HW_PROB_CFG22 (TMU_CSR_BASE_ADDR + 0x0a4) ++#define TMU_TEQ_HW_PROB_CFG23 (TMU_CSR_BASE_ADDR + 0x0a8) ++#define TMU_TEQ_HW_PROB_CFG24 (TMU_CSR_BASE_ADDR + 0x0ac) ++#define TMU_TEQ_HW_PROB_CFG25 (TMU_CSR_BASE_ADDR + 0x0b0) ++#define TMU_TDQ_IIFG_CFG (TMU_CSR_BASE_ADDR + 0x0b4) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY0 ++ */ ++#define TMU_TDQ0_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x0b8) ++ ++#define TMU_LLM_CTRL (TMU_CSR_BASE_ADDR + 0x0bc) ++#define TMU_LLM_BASE_ADDR (TMU_CSR_BASE_ADDR + 0x0c0) ++#define TMU_LLM_QUE_LEN (TMU_CSR_BASE_ADDR + 0x0c4) ++#define TMU_LLM_QUE_HEADPTR (TMU_CSR_BASE_ADDR + 0x0c8) ++#define TMU_LLM_QUE_TAILPTR (TMU_CSR_BASE_ADDR + 0x0cc) ++#define TMU_LLM_QUE_DROPCNT (TMU_CSR_BASE_ADDR + 0x0d0) ++#define TMU_INT_EN (TMU_CSR_BASE_ADDR + 0x0d4) ++#define TMU_INT_SRC (TMU_CSR_BASE_ADDR + 0x0d8) ++#define TMU_INQ_STAT (TMU_CSR_BASE_ADDR + 0x0dc) ++#define TMU_CTRL (TMU_CSR_BASE_ADDR + 0x0e0) ++ ++/* [31] Mem Access Command. 0 = Internal Memory Read, 1 = Internal memory ++ * Write [27:24] Byte Enables of the Internal memory access [23:0] Address of ++ * the internal memory. This address is used to access both the PM and DM of ++ * all the PE's ++ */ ++#define TMU_MEM_ACCESS_ADDR (TMU_CSR_BASE_ADDR + 0x0e4) ++ ++/* Internal Memory Access Write Data */ ++#define TMU_MEM_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x0e8) ++/* Internal Memory Access Read Data. The commands are blocked ++ * at the mem_access only ++ */ ++#define TMU_MEM_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x0ec) ++ ++/* [31:0] PHY0 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY0_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f0) ++/* [31:0] PHY1 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY1_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f4) ++/* [31:0] PHY2 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY2_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0f8) ++/* [31:0] PHY3 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY3_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x0fc) ++#define TMU_BMU_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x100) ++#define TMU_TX_CTRL (TMU_CSR_BASE_ADDR + 0x104) ++ ++#define TMU_BUS_ACCESS_WDATA (TMU_CSR_BASE_ADDR + 0x108) ++#define TMU_BUS_ACCESS (TMU_CSR_BASE_ADDR + 0x10c) ++#define TMU_BUS_ACCESS_RDATA (TMU_CSR_BASE_ADDR + 0x110) ++ ++#define TMU_PE_SYS_CLK_RATIO (TMU_CSR_BASE_ADDR + 0x114) ++#define TMU_PE_STATUS (TMU_CSR_BASE_ADDR + 0x118) ++#define TMU_TEQ_MAX_THRESHOLD (TMU_CSR_BASE_ADDR + 0x11c) ++/* [31:0] PHY4 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY4_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x134) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY1 ++ */ ++#define TMU_TDQ1_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x138) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY2 ++ */ ++#define TMU_TDQ2_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x13c) ++/* [9:0] Scheduler Enable for each of the scheduler in the TDQ. ++ * This is a global Enable for all schedulers in PHY3 ++ */ ++#define TMU_TDQ3_SCH_CTRL (TMU_CSR_BASE_ADDR + 0x140) ++#define TMU_BMU_BUF_SIZE (TMU_CSR_BASE_ADDR + 0x144) ++/* [31:0] PHY5 in queue address (must be initialized with one of the ++ * xxx_INQ_PKTPTR cbus addresses) ++ */ ++#define TMU_PHY5_INQ_ADDR (TMU_CSR_BASE_ADDR + 0x148) ++ ++#define SW_RESET BIT(0) /* Global software reset */ ++#define INQ_RESET BIT(2) ++#define TEQ_RESET BIT(3) ++#define TDQ_RESET BIT(4) ++#define PE_RESET BIT(5) ++#define MEM_INIT BIT(6) ++#define MEM_INIT_DONE BIT(7) ++#define LLM_INIT BIT(8) ++#define LLM_INIT_DONE BIT(9) ++#define ECC_MEM_INIT_DONE BIT(10) ++ ++struct tmu_cfg { ++ u32 pe_sys_clk_ratio; ++ unsigned long llm_base_addr; ++ u32 llm_queue_len; ++}; ++ ++/* Not HW related for pfe_ctrl / pfe common defines */ ++#define DEFAULT_MAX_QDEPTH 80 ++#define DEFAULT_Q0_QDEPTH 511 /*We keep one large queue for host tx qos */ ++#define DEFAULT_TMU3_QDEPTH 127 ++ ++#endif /* _TMU_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/cbus/util_csr.h +@@ -0,0 +1,61 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _UTIL_CSR_H_ ++#define _UTIL_CSR_H_ ++ ++#define UTIL_VERSION (UTIL_CSR_BASE_ADDR + 0x000) ++#define UTIL_TX_CTRL (UTIL_CSR_BASE_ADDR + 0x004) ++#define UTIL_INQ_PKTPTR (UTIL_CSR_BASE_ADDR + 0x010) ++ ++#define UTIL_HDR_SIZE (UTIL_CSR_BASE_ADDR + 0x014) ++ ++#define UTIL_PE0_QB_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x020) ++#define UTIL_PE0_QB_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x024) ++#define UTIL_PE0_RO_DM_ADDR0 (UTIL_CSR_BASE_ADDR + 0x060) ++#define UTIL_PE0_RO_DM_ADDR1 (UTIL_CSR_BASE_ADDR + 0x064) ++ ++#define UTIL_MEM_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x100) ++#define UTIL_MEM_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x104) ++#define UTIL_MEM_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x108) ++ ++#define UTIL_TM_INQ_ADDR (UTIL_CSR_BASE_ADDR + 0x114) ++#define UTIL_PE_STATUS (UTIL_CSR_BASE_ADDR + 0x118) ++ ++#define UTIL_PE_SYS_CLK_RATIO (UTIL_CSR_BASE_ADDR + 0x200) ++#define UTIL_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x204) ++#define UTIL_GAP_BETWEEN_READS (UTIL_CSR_BASE_ADDR + 0x208) ++#define UTIL_MAX_BUF_CNT (UTIL_CSR_BASE_ADDR + 0x20c) ++#define UTIL_TSQ_FIFO_THRES (UTIL_CSR_BASE_ADDR + 0x210) ++#define UTIL_TSQ_MAX_CNT (UTIL_CSR_BASE_ADDR + 0x214) ++#define UTIL_IRAM_DATA_0 (UTIL_CSR_BASE_ADDR + 0x218) ++#define UTIL_IRAM_DATA_1 (UTIL_CSR_BASE_ADDR + 0x21c) ++#define UTIL_IRAM_DATA_2 (UTIL_CSR_BASE_ADDR + 0x220) ++#define UTIL_IRAM_DATA_3 (UTIL_CSR_BASE_ADDR + 0x224) ++ ++#define UTIL_BUS_ACCESS_ADDR (UTIL_CSR_BASE_ADDR + 0x228) ++#define UTIL_BUS_ACCESS_WDATA (UTIL_CSR_BASE_ADDR + 0x22c) ++#define UTIL_BUS_ACCESS_RDATA (UTIL_CSR_BASE_ADDR + 0x230) ++ ++#define UTIL_INQ_AFULL_THRES (UTIL_CSR_BASE_ADDR + 0x234) ++ ++struct util_cfg { ++ u32 pe_sys_clk_ratio; ++}; ++ ++#endif /* _UTIL_CSR_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/include/pfe/pfe.h +@@ -0,0 +1,372 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_H_ ++#define _PFE_H_ ++ ++#include "cbus.h" ++ ++#define CLASS_DMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define CLASS_IMEM_BASE_ADDR(i) (0x00000000 | ((i) << 20)) ++#define CLASS_DMEM_SIZE 0x00002000 ++#define CLASS_IMEM_SIZE 0x00008000 ++ ++#define TMU_DMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++/* ++ * Only valid for mem access register interface ++ */ ++#define TMU_IMEM_BASE_ADDR(i) (0x00000000 + ((i) << 20)) ++#define TMU_DMEM_SIZE 0x00000800 ++#define TMU_IMEM_SIZE 0x00002000 ++ ++#define UTIL_DMEM_BASE_ADDR 0x00000000 ++#define UTIL_DMEM_SIZE 0x00002000 ++ ++#define PE_LMEM_BASE_ADDR 0xc3010000 ++#define PE_LMEM_SIZE 0x8000 ++#define PE_LMEM_END (PE_LMEM_BASE_ADDR + PE_LMEM_SIZE) ++ ++#define DMEM_BASE_ADDR 0x00000000 ++#define DMEM_SIZE 0x2000 /* TMU has less... */ ++#define DMEM_END (DMEM_BASE_ADDR + DMEM_SIZE) ++ ++#define PMEM_BASE_ADDR 0x00010000 ++#define PMEM_SIZE 0x8000 /* TMU has less... */ ++#define PMEM_END (PMEM_BASE_ADDR + PMEM_SIZE) ++ ++/* These check memory ranges from PE point of view/memory map */ ++#define IS_DMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= DMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= DMEM_END); }) ++ ++#define IS_PMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= PMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= PMEM_END); }) ++ ++#define IS_PE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ PE_LMEM_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + \ ++ (len)) <= PE_LMEM_END); }) ++ ++#define IS_PFE_LMEM(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR)) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ CBUS_VIRT_TO_PFE(LMEM_END)); }) ++ ++#define __IS_PHYS_DDR(addr, len) \ ++ ({ typeof(addr) addr_ = (addr); \ ++ ((unsigned long)(addr_) >= \ ++ DDR_PHYS_BASE_ADDR) && \ ++ (((unsigned long)(addr_) + (len)) <= \ ++ DDR_PHYS_END); }) ++ ++#define IS_PHYS_DDR(addr, len) __IS_PHYS_DDR(DDR_PFE_TO_PHYS(addr), len) ++ ++/* ++ * If using a run-time virtual address for the cbus base address use this code ++ */ ++extern void *cbus_base_addr; ++extern void *ddr_base_addr; ++extern unsigned long ddr_phys_base_addr; ++extern unsigned int ddr_size; ++ ++#define CBUS_BASE_ADDR cbus_base_addr ++#define DDR_PHYS_BASE_ADDR ddr_phys_base_addr ++#define DDR_BASE_ADDR ddr_base_addr ++#define DDR_SIZE ddr_size ++ ++#define DDR_PHYS_END (DDR_PHYS_BASE_ADDR + DDR_SIZE) ++ ++#define LS1012A_PFE_RESET_WA /* ++ * PFE doesn't have global reset and re-init ++ * should takecare few things to make PFE ++ * functional after reset ++ */ ++#define PFE_CBUS_PHYS_BASE_ADDR 0xc0000000 /* CBUS physical base address ++ * as seen by PE's. ++ */ ++/* CBUS physical base address as seen by PE's. */ ++#define PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE 0xc0000000 ++ ++#define DDR_PHYS_TO_PFE(p) (((unsigned long int)(p)) & 0x7FFFFFFF) ++#define DDR_PFE_TO_PHYS(p) (((unsigned long int)(p)) | 0x80000000) ++#define CBUS_PHYS_TO_PFE(p) (((p) - PFE_CBUS_PHYS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR_FROM_PFE) ++/* Translates to PFE address map */ ++ ++#define DDR_PHYS_TO_VIRT(p) (((p) - DDR_PHYS_BASE_ADDR) + DDR_BASE_ADDR) ++#define DDR_VIRT_TO_PHYS(v) (((v) - DDR_BASE_ADDR) + DDR_PHYS_BASE_ADDR) ++#define DDR_VIRT_TO_PFE(p) (DDR_PHYS_TO_PFE(DDR_VIRT_TO_PHYS(p))) ++ ++#define CBUS_VIRT_TO_PFE(v) (((v) - CBUS_BASE_ADDR) + \ ++ PFE_CBUS_PHYS_BASE_ADDR) ++#define CBUS_PFE_TO_VIRT(p) (((unsigned long int)(p) - \ ++ PFE_CBUS_PHYS_BASE_ADDR) + CBUS_BASE_ADDR) ++ ++/* The below part of the code is used in QOS control driver from host */ ++#define TMU_APB_BASE_ADDR 0xc1000000 /* TMU base address seen by ++ * pe's ++ */ ++ ++enum { ++ CLASS0_ID = 0, ++ CLASS1_ID, ++ CLASS2_ID, ++ CLASS3_ID, ++ CLASS4_ID, ++ CLASS5_ID, ++ TMU0_ID, ++ TMU1_ID, ++ TMU2_ID, ++ TMU3_ID, ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ UTIL_ID, ++#endif ++ MAX_PE ++}; ++ ++#define CLASS_MASK (BIT(CLASS0_ID) | BIT(CLASS1_ID) |\ ++ BIT(CLASS2_ID) | BIT(CLASS3_ID) |\ ++ BIT(CLASS4_ID) | BIT(CLASS5_ID)) ++#define CLASS_MAX_ID CLASS5_ID ++ ++#define TMU_MASK (BIT(TMU0_ID) | BIT(TMU1_ID) |\ ++ BIT(TMU3_ID)) ++ ++#define TMU_MAX_ID TMU3_ID ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++#define UTIL_MASK BIT(UTIL_ID) ++#endif ++ ++struct pe_status { ++ u32 cpu_state; ++ u32 activity_counter; ++ u32 rx; ++ union { ++ u32 tx; ++ u32 tmu_qstatus; ++ }; ++ u32 drop; ++#if defined(CFG_PE_DEBUG) ++ u32 debug_indicator; ++ u32 debug[16]; ++#endif ++} __aligned(16); ++ ++struct pe_sync_mailbox { ++ u32 stop; ++ u32 stopped; ++}; ++ ++/* Drop counter definitions */ ++ ++#define CLASS_NUM_DROP_COUNTERS 13 ++#define UTIL_NUM_DROP_COUNTERS 8 ++ ++/* PE information. ++ * Structure containing PE's specific information. It is used to create ++ * generic C functions common to all PE's. ++ * Before using the library functions this structure needs to be initialized ++ * with the different registers virtual addresses ++ * (according to the ARM MMU mmaping). The default initialization supports a ++ * virtual == physical mapping. ++ */ ++struct pe_info { ++ u32 dmem_base_addr; /* PE's dmem base address */ ++ u32 pmem_base_addr; /* PE's pmem base address */ ++ u32 pmem_size; /* PE's pmem size */ ++ ++ void *mem_access_wdata; /* PE's _MEM_ACCESS_WDATA register ++ * address ++ */ ++ void *mem_access_addr; /* PE's _MEM_ACCESS_ADDR register ++ * address ++ */ ++ void *mem_access_rdata; /* PE's _MEM_ACCESS_RDATA register ++ * address ++ */ ++}; ++ ++void pe_lmem_read(u32 *dst, u32 len, u32 offset); ++void pe_lmem_write(u32 *src, u32 len, u32 offset); ++ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len); ++ ++u32 pe_pmem_read(int id, u32 addr, u8 size); ++ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size); ++u32 pe_dmem_read(int id, u32 addr, u8 size); ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len); ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len); ++void class_bus_write(u32 val, u32 addr, u8 size); ++u32 class_bus_read(u32 addr, u8 size); ++ ++#define class_bus_readl(addr) class_bus_read(addr, 4) ++#define class_bus_readw(addr) class_bus_read(addr, 2) ++#define class_bus_readb(addr) class_bus_read(addr, 1) ++ ++#define class_bus_writel(val, addr) class_bus_write(val, addr, 4) ++#define class_bus_writew(val, addr) class_bus_write(val, addr, 2) ++#define class_bus_writeb(val, addr) class_bus_write(val, addr, 1) ++ ++#define pe_dmem_readl(id, addr) pe_dmem_read(id, addr, 4) ++#define pe_dmem_readw(id, addr) pe_dmem_read(id, addr, 2) ++#define pe_dmem_readb(id, addr) pe_dmem_read(id, addr, 1) ++ ++#define pe_dmem_writel(id, val, addr) pe_dmem_write(id, val, addr, 4) ++#define pe_dmem_writew(id, val, addr) pe_dmem_write(id, val, addr, 2) ++#define pe_dmem_writeb(id, val, addr) pe_dmem_write(id, val, addr, 1) ++ ++/*int pe_load_elf_section(int id, const void *data, elf32_shdr *shdr); */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev); ++ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int ddr_size); ++void bmu_init(void *base, struct BMU_CFG *cfg); ++void bmu_reset(void *base); ++void bmu_enable(void *base); ++void bmu_disable(void *base); ++void bmu_set_config(void *base, struct BMU_CFG *cfg); ++ ++/* ++ * An enumerated type for loopback values. This can be one of three values, no ++ * loopback -normal operation, local loopback with internal loopback module of ++ * MAC or PHY loopback which is through the external PHY. ++ */ ++#ifndef __MAC_LOOP_ENUM__ ++#define __MAC_LOOP_ENUM__ ++enum mac_loop {LB_NONE, LB_EXT, LB_LOCAL}; ++#endif ++ ++void gemac_init(void *base, void *config); ++void gemac_disable_rx_checksum_offload(void *base); ++void gemac_enable_rx_checksum_offload(void *base); ++void gemac_set_mdc_div(void *base, int mdc_div); ++void gemac_set_speed(void *base, enum mac_speed gem_speed); ++void gemac_set_duplex(void *base, int duplex); ++void gemac_set_mode(void *base, int mode); ++void gemac_enable(void *base); ++void gemac_tx_disable(void *base); ++void gemac_tx_enable(void *base); ++void gemac_disable(void *base); ++void gemac_reset(void *base); ++void gemac_set_address(void *base, struct spec_addr *addr); ++struct spec_addr gemac_get_address(void *base); ++void gemac_set_loop(void *base, enum mac_loop gem_loop); ++void gemac_set_laddr1(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr2(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr3(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddr4(void *base, struct pfe_mac_addr *address); ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index); ++void gemac_clear_laddr1(void *base); ++void gemac_clear_laddr2(void *base); ++void gemac_clear_laddr3(void *base); ++void gemac_clear_laddr4(void *base); ++void gemac_clear_laddrN(void *base, unsigned int entry_index); ++struct pfe_mac_addr gemac_get_hash(void *base); ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash); ++struct pfe_mac_addr gem_get_laddr1(void *base); ++struct pfe_mac_addr gem_get_laddr2(void *base); ++struct pfe_mac_addr gem_get_laddr3(void *base); ++struct pfe_mac_addr gem_get_laddr4(void *base); ++struct pfe_mac_addr gem_get_laddrN(void *base, unsigned int entry_index); ++void gemac_set_config(void *base, struct gemac_cfg *cfg); ++void gemac_allow_broadcast(void *base); ++void gemac_no_broadcast(void *base); ++void gemac_enable_1536_rx(void *base); ++void gemac_disable_1536_rx(void *base); ++void gemac_enable_rx_jmb(void *base); ++void gemac_disable_rx_jmb(void *base); ++void gemac_enable_stacked_vlan(void *base); ++void gemac_disable_stacked_vlan(void *base); ++void gemac_enable_pause_rx(void *base); ++void gemac_disable_pause_rx(void *base); ++void gemac_enable_copy_all(void *base); ++void gemac_disable_copy_all(void *base); ++void gemac_set_bus_width(void *base, int width); ++void gemac_set_wol(void *base, u32 wol_conf); ++ ++void gpi_init(void *base, struct gpi_cfg *cfg); ++void gpi_reset(void *base); ++void gpi_enable(void *base); ++void gpi_disable(void *base); ++void gpi_set_config(void *base, struct gpi_cfg *cfg); ++ ++void class_init(struct class_cfg *cfg); ++void class_reset(void); ++void class_enable(void); ++void class_disable(void); ++void class_set_config(struct class_cfg *cfg); ++ ++void tmu_reset(void); ++void tmu_init(struct tmu_cfg *cfg); ++void tmu_enable(u32 pe_mask); ++void tmu_disable(u32 pe_mask); ++u32 tmu_qstatus(u32 if_id); ++u32 tmu_pkts_processed(u32 if_id); ++ ++void util_init(struct util_cfg *cfg); ++void util_reset(void); ++void util_enable(void); ++void util_disable(void); ++ ++void hif_init(void); ++void hif_tx_enable(void); ++void hif_tx_disable(void); ++void hif_rx_enable(void); ++void hif_rx_disable(void); ++ ++/* Get Chip Revision level ++ * ++ */ ++static inline unsigned int CHIP_REVISION(void) ++{ ++ /*For LS1012A return always 1 */ ++ return 1; ++} ++ ++/* Start HIF rx DMA ++ * ++ */ ++static inline void hif_rx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_RX_CTRL); ++} ++ ++/* Start HIF tx DMA ++ * ++ */ ++static inline void hif_tx_dma_start(void) ++{ ++ writel(HIF_CTRL_DMA_EN | HIF_CTRL_BDP_CH_START_WSTB, HIF_TX_CTRL); ++} ++ ++#endif /* _PFE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.c +@@ -0,0 +1,238 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_ctrl.h" ++ ++#define TIMEOUT_MS 1000 ++ ++int relax(unsigned long end) ++{ ++ if (time_after(jiffies, end)) { ++ if (time_after(jiffies, end + (TIMEOUT_MS * HZ) / 1000)) ++ return -1; ++ ++ if (need_resched()) ++ schedule(); ++ } ++ ++ return 0; ++} ++ ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl) ++{ ++ int id; ++ ++ mutex_lock(&ctrl->mutex); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) ++ pe_dmem_write(id, cpu_to_be32(0x1), CLASS_DM_RESUME, 4); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ pe_dmem_write(id, cpu_to_be32(0x1), TMU_DM_RESUME, 4); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_dmem_write(UTIL_ID, cpu_to_be32(0x1), UTIL_DM_RESUME, 4); ++#endif ++ mutex_unlock(&ctrl->mutex); ++} ++ ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl) ++{ ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ mutex_lock(&ctrl->mutex); ++ pe_start(&pfe->ctrl, pe_mask); ++ mutex_unlock(&ctrl->mutex); ++} ++ ++/* PE sync stop. ++ * Stops packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to stop ++ * ++ */ ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ ++ pe_mask &= 0x2FF; /*Exclude Util + TMU2 */ ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x1), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned ++ long)&mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ return -EIO; ++} ++ ++/* PE start. ++ * Starts packet processing for a list of PE's (specified using a bitmask). ++ * The caller must hold ctrl->mutex. ++ * ++ * @param ctrl Control context ++ * @param pe_mask Mask of PE id's to start ++ * ++ */ ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask) ++{ ++ struct pe_sync_mailbox *mbox; ++ int i; ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x0), (unsigned ++ long)&mbox->stop, 4); ++ } ++} ++ ++/* This function will ensure all PEs are put in to idle state */ ++int pe_reset_all(struct pfe_ctrl *ctrl) ++{ ++ struct pe_sync_mailbox *mbox; ++ int pe_stopped = 0; ++ unsigned long end = jiffies + 2; ++ int i; ++ int pe_mask = CLASS_MASK | TMU_MASK; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe_mask |= UTIL_MASK; ++#endif ++ ++ for (i = 0; i < MAX_PE; i++) ++ if (pe_mask & (1 << i)) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ pe_dmem_write(i, cpu_to_be32(0x2), (unsigned ++ long)&mbox->stop, 4); ++ } ++ ++ while (pe_stopped != pe_mask) { ++ for (i = 0; i < MAX_PE; i++) ++ if ((pe_mask & (1 << i)) && !(pe_stopped & (1 << i))) { ++ mbox = (void *)ctrl->sync_mailbox_baseaddr[i]; ++ ++ if (pe_dmem_read(i, (unsigned long) ++ &mbox->stopped, 4) & ++ cpu_to_be32(0x1)) ++ pe_stopped |= (1 << i); ++ } ++ ++ if (relax(end) < 0) ++ goto err; ++ } ++ ++ return 0; ++ ++err: ++ pr_err("%s: timeout, %x %x\n", __func__, pe_mask, pe_stopped); ++ return -EIO; ++} ++ ++int pfe_ctrl_init(struct pfe *pfe) ++{ ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ int id; ++ ++ pr_info("%s\n", __func__); ++ ++ mutex_init(&ctrl->mutex); ++ spin_lock_init(&ctrl->lock); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ ctrl->sync_mailbox_baseaddr[id] = CLASS_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = CLASS_DM_MSG_MBOX; ++ } ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ ctrl->sync_mailbox_baseaddr[id] = TMU_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[id] = TMU_DM_MSG_MBOX; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ctrl->sync_mailbox_baseaddr[UTIL_ID] = UTIL_DM_SYNC_MBOX; ++ ctrl->msg_mailbox_baseaddr[UTIL_ID] = UTIL_DM_MSG_MBOX; ++#endif ++ ++ ctrl->hash_array_baseaddr = pfe->ddr_baseaddr + ROUTE_TABLE_BASEADDR; ++ ctrl->hash_array_phys_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR; ++ ++ ctrl->dev = pfe->dev; ++ ++ pr_info("%s finished\n", __func__); ++ ++ return 0; ++} ++ ++void pfe_ctrl_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ctrl.h +@@ -0,0 +1,112 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_CTRL_H_ ++#define _PFE_CTRL_H_ ++ ++#include ++ ++#include "pfe_mod.h" ++#include "pfe/pfe.h" ++ ++#define DMA_BUF_SIZE_128 0x80 /* enough for 1 conntracks */ ++#define DMA_BUF_SIZE_256 0x100 ++/* enough for 2 conntracks, 1 bridge entry or 1 multicast entry */ ++#define DMA_BUF_SIZE_512 0x200 ++/* 512bytes dma allocated buffers used by rtp relay feature */ ++#define DMA_BUF_MIN_ALIGNMENT 8 ++#define DMA_BUF_BOUNDARY (4 * 1024) ++/* bursts can not cross 4k boundary */ ++ ++#define CMD_TX_ENABLE 0x0501 ++#define CMD_TX_DISABLE 0x0502 ++ ++#define CMD_RX_LRO 0x0011 ++#define CMD_PKTCAP_ENABLE 0x0d01 ++#define CMD_QM_EXPT_RATE 0x020c ++ ++#define CLASS_DM_SH_STATIC (0x800) ++#define CLASS_DM_CPU_TICKS (CLASS_DM_SH_STATIC) ++#define CLASS_DM_SYNC_MBOX (0x808) ++#define CLASS_DM_MSG_MBOX (0x810) ++#define CLASS_DM_DROP_CNTR (0x820) ++#define CLASS_DM_RESUME (0x854) ++#define CLASS_DM_PESTATUS (0x860) ++ ++#define TMU_DM_SH_STATIC (0x80) ++#define TMU_DM_CPU_TICKS (TMU_DM_SH_STATIC) ++#define TMU_DM_SYNC_MBOX (0x88) ++#define TMU_DM_MSG_MBOX (0x90) ++#define TMU_DM_RESUME (0xA0) ++#define TMU_DM_PESTATUS (0xB0) ++#define TMU_DM_CONTEXT (0x300) ++#define TMU_DM_TX_TRANS (0x480) ++ ++#define UTIL_DM_SH_STATIC (0x0) ++#define UTIL_DM_CPU_TICKS (UTIL_DM_SH_STATIC) ++#define UTIL_DM_SYNC_MBOX (0x8) ++#define UTIL_DM_MSG_MBOX (0x10) ++#define UTIL_DM_DROP_CNTR (0x20) ++#define UTIL_DM_RESUME (0x40) ++#define UTIL_DM_PESTATUS (0x50) ++ ++struct pfe_ctrl { ++ struct mutex mutex; /* to serialize pfe control access */ ++ spinlock_t lock; ++ ++ void *dma_pool; ++ void *dma_pool_512; ++ void *dma_pool_128; ++ ++ struct device *dev; ++ ++ void *hash_array_baseaddr; /* ++ * Virtual base address of ++ * the conntrack hash array ++ */ ++ unsigned long hash_array_phys_baseaddr; /* ++ * Physical base address of ++ * the conntrack hash array ++ */ ++ ++ int (*event_cb)(u16, u16, u16*); ++ ++ unsigned long sync_mailbox_baseaddr[MAX_PE]; /* ++ * Sync mailbox PFE ++ * internal address, ++ * initialized ++ * when parsing elf images ++ */ ++ unsigned long msg_mailbox_baseaddr[MAX_PE]; /* ++ * Msg mailbox PFE internal ++ * address, initialized ++ * when parsing elf images ++ */ ++ unsigned int sys_clk; /* AXI clock value, in KHz */ ++}; ++ ++int pfe_ctrl_init(struct pfe *pfe); ++void pfe_ctrl_exit(struct pfe *pfe); ++int pe_sync_stop(struct pfe_ctrl *ctrl, int pe_mask); ++void pe_start(struct pfe_ctrl *ctrl, int pe_mask); ++int pe_reset_all(struct pfe_ctrl *ctrl); ++void pfe_ctrl_suspend(struct pfe_ctrl *ctrl); ++void pfe_ctrl_resume(struct pfe_ctrl *ctrl); ++int relax(unsigned long end); ++ ++#endif /* _PFE_CTRL_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.c +@@ -0,0 +1,111 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++static int dmem_show(struct seq_file *s, void *unused) ++{ ++ u32 dmem_addr, val; ++ int id = (long int)s->private; ++ int i; ++ ++ for (dmem_addr = 0; dmem_addr < CLASS_DMEM_SIZE; dmem_addr += 8 * 4) { ++ seq_printf(s, "%04x:", dmem_addr); ++ ++ for (i = 0; i < 8; i++) { ++ val = pe_dmem_read(id, dmem_addr + i * 4, 4); ++ seq_printf(s, " %02x %02x %02x %02x", val & 0xff, ++ (val >> 8) & 0xff, (val >> 16) & 0xff, ++ (val >> 24) & 0xff); ++ } ++ ++ seq_puts(s, "\n"); ++ } ++ ++ return 0; ++} ++ ++static int dmem_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, dmem_show, inode->i_private); ++} ++ ++static const struct file_operations dmem_fops = { ++ .open = dmem_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ ++int pfe_debugfs_init(struct pfe *pfe) ++{ ++ struct dentry *d; ++ ++ pr_info("%s\n", __func__); ++ ++ pfe->dentry = debugfs_create_dir("pfe", NULL); ++ if (IS_ERR_OR_NULL(pfe->dentry)) ++ goto err_dir; ++ ++ d = debugfs_create_file("pe0_dmem", 0444, pfe->dentry, (void *)0, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe1_dmem", 0444, pfe->dentry, (void *)1, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe2_dmem", 0444, pfe->dentry, (void *)2, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe3_dmem", 0444, pfe->dentry, (void *)3, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe4_dmem", 0444, pfe->dentry, (void *)4, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ d = debugfs_create_file("pe5_dmem", 0444, pfe->dentry, (void *)5, ++ &dmem_fops); ++ if (IS_ERR_OR_NULL(d)) ++ goto err_pe; ++ ++ return 0; ++ ++err_pe: ++ debugfs_remove_recursive(pfe->dentry); ++ ++err_dir: ++ return -1; ++} ++ ++void pfe_debugfs_exit(struct pfe *pfe) ++{ ++ debugfs_remove_recursive(pfe->dentry); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_debugfs.h +@@ -0,0 +1,25 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_DEBUGFS_H_ ++#define _PFE_DEBUGFS_H_ ++ ++int pfe_debugfs_init(struct pfe *pfe); ++void pfe_debugfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_DEBUGFS_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.c +@@ -0,0 +1,2434 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++/* @pfe_eth.c. ++ * Ethernet driver for to handle exception path for PFE. ++ * - uses HIF functions to send/receive packets. ++ * - uses ctrl function to start/stop interfaces. ++ * - uses direct register accesses to control phy operation. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#if defined(CONFIG_NF_CONNTRACK_MARK) ++#include ++#endif ++ ++#include "pfe_mod.h" ++#include "pfe_eth.h" ++ ++static void *cbus_emac_base[3]; ++static void *cbus_gpi_base[3]; ++ ++/* Forward Declaration */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv); ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc); ++ ++unsigned int gemac_regs[] = { ++ 0x0004, /* Interrupt event */ ++ 0x0008, /* Interrupt mask */ ++ 0x0024, /* Ethernet control */ ++ 0x0064, /* MIB Control/Status */ ++ 0x0084, /* Receive control/status */ ++ 0x00C4, /* Transmit control */ ++ 0x00E4, /* Physical address low */ ++ 0x00E8, /* Physical address high */ ++ 0x0144, /* Transmit FIFO Watermark and Store and Forward Control*/ ++ 0x0190, /* Receive FIFO Section Full Threshold */ ++ 0x01A0, /* Transmit FIFO Section Empty Threshold */ ++ 0x01B0, /* Frame Truncation Length */ ++}; ++ ++/********************************************************************/ ++/* SYSFS INTERFACE */ ++/********************************************************************/ ++ ++#ifdef PFE_ETH_NAPI_STATS ++/* ++ * pfe_eth_show_napi_stats ++ */ ++static ssize_t pfe_eth_show_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ priv->napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ priv->napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ priv->napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ priv->napi_counters[NAPI_DESC_COUNT]); ++ ++ return len; ++} ++ ++/* ++ * pfe_eth_set_napi_stats ++ */ ++static ssize_t pfe_eth_set_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ++ memset(priv->napi_counters, 0, sizeof(priv->napi_counters)); ++ ++ return count; ++} ++#endif ++#ifdef PFE_ETH_TX_STATS ++/* pfe_eth_show_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_show_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ len += sprintf(buf + len, "TX queues stats:\n"); ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ len += sprintf(buf + len, "\n"); ++ __netif_tx_lock_bh(tx_queue); ++ ++ hif_tx_lock(&pfe->hif); ++ len += sprintf(buf + len, ++ "Queue %2d : credits = %10d\n" ++ , i, hif_lib_tx_credit_avail(pfe, priv->id, i)); ++ len += sprintf(buf + len, ++ " tx packets = %10d\n" ++ , pfe->tmu_credit.tx_packets[priv->id][i]); ++ hif_tx_unlock(&pfe->hif); ++ ++ /* Don't output additionnal stats if queue never used */ ++ if (!pfe->tmu_credit.tx_packets[priv->id][i]) ++ goto skip; ++ ++ len += sprintf(buf + len, ++ " clean_fail = %10d\n" ++ , priv->clean_fail[i]); ++ len += sprintf(buf + len, ++ " stop_queue = %10d\n" ++ , priv->stop_queue_total[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif = %10d\n" ++ , priv->stop_queue_hif[i]); ++ len += sprintf(buf + len, ++ " stop_queue_hif_client = %10d\n" ++ , priv->stop_queue_hif_client[i]); ++ len += sprintf(buf + len, ++ " stop_queue_credit = %10d\n" ++ , priv->stop_queue_credit[i]); ++skip: ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ return len; ++} ++ ++/* pfe_eth_set_tx_stats ++ * ++ */ ++static ssize_t pfe_eth_set_tx_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ priv->clean_fail[i] = 0; ++ priv->stop_queue_total[i] = 0; ++ priv->stop_queue_hif[i] = 0; ++ priv->stop_queue_hif_client[i] = 0; ++ priv->stop_queue_credit[i] = 0; ++ __netif_tx_unlock_bh(tx_queue); ++ } ++ ++ return count; ++} ++#endif ++/* pfe_eth_show_txavail ++ * ++ */ ++static ssize_t pfe_eth_show_txavail(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ ssize_t len = 0; ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ i); ++ ++ __netif_tx_lock_bh(tx_queue); ++ ++ len += sprintf(buf + len, "%d", ++ hif_lib_tx_avail(&priv->client, i)); ++ ++ __netif_tx_unlock_bh(tx_queue); ++ ++ if (i == (emac_txq_cnt - 1)) ++ len += sprintf(buf + len, "\n"); ++ else ++ len += sprintf(buf + len, " "); ++ } ++ ++ return len; ++} ++ ++/* pfe_eth_show_default_priority ++ * ++ */ ++static ssize_t pfe_eth_show_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ int rc; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ rc = sprintf(buf, "%d\n", priv->default_priority); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return rc; ++} ++ ++/* pfe_eth_set_default_priority ++ * ++ */ ++ ++static ssize_t pfe_eth_set_default_priority(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(to_net_dev(dev)); ++ unsigned long flags; ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ priv->default_priority = kstrtoul(buf, 0, 0); ++ spin_unlock_irqrestore(&priv->lock, flags); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(txavail, 0444, pfe_eth_show_txavail, NULL); ++static DEVICE_ATTR(default_priority, 0644, pfe_eth_show_default_priority, ++ pfe_eth_set_default_priority); ++ ++#ifdef PFE_ETH_NAPI_STATS ++static DEVICE_ATTR(napi_stats, 0644, pfe_eth_show_napi_stats, ++ pfe_eth_set_napi_stats); ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++static DEVICE_ATTR(tx_stats, 0644, pfe_eth_show_tx_stats, ++ pfe_eth_set_tx_stats); ++#endif ++ ++/* ++ * pfe_eth_sysfs_init ++ * ++ */ ++static int pfe_eth_sysfs_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int err; ++ ++ /* Initialize the default values */ ++ ++ /* ++ * By default, packets without conntrack will use this default high ++ * priority queue ++ */ ++ priv->default_priority = 15; ++ ++ /* Create our sysfs files */ ++ err = device_create_file(&ndev->dev, &dev_attr_default_priority); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_priority; ++ } ++ ++ err = device_create_file(&ndev->dev, &dev_attr_txavail); ++ if (err) { ++ netdev_err(ndev, ++ "failed to create default_priority sysfs files\n"); ++ goto err_txavail; ++ } ++ ++#ifdef PFE_ETH_NAPI_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_napi_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create napi stats sysfs files\n"); ++ goto err_napi; ++ } ++#endif ++ ++#ifdef PFE_ETH_TX_STATS ++ err = device_create_file(&ndev->dev, &dev_attr_tx_stats); ++ if (err) { ++ netdev_err(ndev, "failed to create tx stats sysfs files\n"); ++ goto err_tx; ++ } ++#endif ++ ++ return 0; ++ ++#ifdef PFE_ETH_TX_STATS ++err_tx: ++#endif ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++ ++err_napi: ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ ++err_txavail: ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++ ++err_priority: ++ return -1; ++} ++ ++/* pfe_eth_sysfs_exit ++ * ++ */ ++void pfe_eth_sysfs_exit(struct net_device *ndev) ++{ ++#ifdef PFE_ETH_TX_STATS ++ device_remove_file(&ndev->dev, &dev_attr_tx_stats); ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ device_remove_file(&ndev->dev, &dev_attr_napi_stats); ++#endif ++ device_remove_file(&ndev->dev, &dev_attr_txavail); ++ device_remove_file(&ndev->dev, &dev_attr_default_priority); ++} ++ ++/*************************************************************************/ ++/* ETHTOOL INTERCAE */ ++/*************************************************************************/ ++ ++/*MTIP GEMAC */ ++static const struct fec_stat { ++ char name[ETH_GSTRING_LEN]; ++ u16 offset; ++} fec_stats[] = { ++ /* RMON TX */ ++ { "tx_dropped", RMON_T_DROP }, ++ { "tx_packets", RMON_T_PACKETS }, ++ { "tx_broadcast", RMON_T_BC_PKT }, ++ { "tx_multicast", RMON_T_MC_PKT }, ++ { "tx_crc_errors", RMON_T_CRC_ALIGN }, ++ { "tx_undersize", RMON_T_UNDERSIZE }, ++ { "tx_oversize", RMON_T_OVERSIZE }, ++ { "tx_fragment", RMON_T_FRAG }, ++ { "tx_jabber", RMON_T_JAB }, ++ { "tx_collision", RMON_T_COL }, ++ { "tx_64byte", RMON_T_P64 }, ++ { "tx_65to127byte", RMON_T_P65TO127 }, ++ { "tx_128to255byte", RMON_T_P128TO255 }, ++ { "tx_256to511byte", RMON_T_P256TO511 }, ++ { "tx_512to1023byte", RMON_T_P512TO1023 }, ++ { "tx_1024to2047byte", RMON_T_P1024TO2047 }, ++ { "tx_GTE2048byte", RMON_T_P_GTE2048 }, ++ { "tx_octets", RMON_T_OCTETS }, ++ ++ /* IEEE TX */ ++ { "IEEE_tx_drop", IEEE_T_DROP }, ++ { "IEEE_tx_frame_ok", IEEE_T_FRAME_OK }, ++ { "IEEE_tx_1col", IEEE_T_1COL }, ++ { "IEEE_tx_mcol", IEEE_T_MCOL }, ++ { "IEEE_tx_def", IEEE_T_DEF }, ++ { "IEEE_tx_lcol", IEEE_T_LCOL }, ++ { "IEEE_tx_excol", IEEE_T_EXCOL }, ++ { "IEEE_tx_macerr", IEEE_T_MACERR }, ++ { "IEEE_tx_cserr", IEEE_T_CSERR }, ++ { "IEEE_tx_sqe", IEEE_T_SQE }, ++ { "IEEE_tx_fdxfc", IEEE_T_FDXFC }, ++ { "IEEE_tx_octets_ok", IEEE_T_OCTETS_OK }, ++ ++ /* RMON RX */ ++ { "rx_packets", RMON_R_PACKETS }, ++ { "rx_broadcast", RMON_R_BC_PKT }, ++ { "rx_multicast", RMON_R_MC_PKT }, ++ { "rx_crc_errors", RMON_R_CRC_ALIGN }, ++ { "rx_undersize", RMON_R_UNDERSIZE }, ++ { "rx_oversize", RMON_R_OVERSIZE }, ++ { "rx_fragment", RMON_R_FRAG }, ++ { "rx_jabber", RMON_R_JAB }, ++ { "rx_64byte", RMON_R_P64 }, ++ { "rx_65to127byte", RMON_R_P65TO127 }, ++ { "rx_128to255byte", RMON_R_P128TO255 }, ++ { "rx_256to511byte", RMON_R_P256TO511 }, ++ { "rx_512to1023byte", RMON_R_P512TO1023 }, ++ { "rx_1024to2047byte", RMON_R_P1024TO2047 }, ++ { "rx_GTE2048byte", RMON_R_P_GTE2048 }, ++ { "rx_octets", RMON_R_OCTETS }, ++ ++ /* IEEE RX */ ++ { "IEEE_rx_drop", IEEE_R_DROP }, ++ { "IEEE_rx_frame_ok", IEEE_R_FRAME_OK }, ++ { "IEEE_rx_crc", IEEE_R_CRC }, ++ { "IEEE_rx_align", IEEE_R_ALIGN }, ++ { "IEEE_rx_macerr", IEEE_R_MACERR }, ++ { "IEEE_rx_fdxfc", IEEE_R_FDXFC }, ++ { "IEEE_rx_octets_ok", IEEE_R_OCTETS_OK }, ++}; ++ ++static void pfe_eth_fill_stats(struct net_device *ndev, struct ethtool_stats ++ *stats, u64 *data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i; ++ ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) ++ data[i] = readl(priv->EMAC_baseaddr + fec_stats[i].offset); ++} ++ ++static void pfe_eth_gstrings(struct net_device *netdev, ++ u32 stringset, u8 *data) ++{ ++ int i; ++ ++ switch (stringset) { ++ case ETH_SS_STATS: ++ for (i = 0; i < ARRAY_SIZE(fec_stats); i++) ++ memcpy(data + i * ETH_GSTRING_LEN, ++ fec_stats[i].name, ETH_GSTRING_LEN); ++ break; ++ } ++} ++ ++static int pfe_eth_stats_count(struct net_device *ndev, int sset) ++{ ++ switch (sset) { ++ case ETH_SS_STATS: ++ return ARRAY_SIZE(fec_stats); ++ default: ++ return -EOPNOTSUPP; ++ } ++} ++ ++/* ++ * pfe_eth_gemac_reglen - Return the length of the register structure. ++ * ++ */ ++static int pfe_eth_gemac_reglen(struct net_device *ndev) ++{ ++ pr_info("%s()\n", __func__); ++ return (sizeof(gemac_regs) / sizeof(u32)); ++} ++ ++/* ++ * pfe_eth_gemac_get_regs - Return the gemac register structure. ++ * ++ */ ++static void pfe_eth_gemac_get_regs(struct net_device *ndev, struct ethtool_regs ++ *regs, void *regbuf) ++{ ++ int i; ++ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ u32 *buf = (u32 *)regbuf; ++ ++ pr_info("%s()\n", __func__); ++ for (i = 0; i < sizeof(gemac_regs) / sizeof(u32); i++) ++ buf[i] = readl(priv->EMAC_baseaddr + gemac_regs[i]); ++} ++ ++/* ++ * pfe_eth_set_wol - Set the magic packet option, in WoL register. ++ * ++ */ ++static int pfe_eth_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (wol->wolopts & ~WAKE_MAGIC) ++ return -EOPNOTSUPP; ++ ++ /* for MTIP we store wol->wolopts */ ++ priv->wol = wol->wolopts; ++ ++ device_set_wakeup_enable(&ndev->dev, wol->wolopts & WAKE_MAGIC); ++ ++ return 0; ++} ++ ++/* ++ * ++ * pfe_eth_get_wol - Get the WoL options. ++ * ++ */ ++static void pfe_eth_get_wol(struct net_device *ndev, struct ethtool_wolinfo ++ *wol) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ wol->supported = WAKE_MAGIC; ++ wol->wolopts = 0; ++ ++ if (priv->wol & WAKE_MAGIC) ++ wol->wolopts = WAKE_MAGIC; ++ ++ memset(&wol->sopass, 0, sizeof(wol->sopass)); ++} ++ ++/* ++ * pfe_eth_get_drvinfo - Fills in the drvinfo structure with some basic info ++ * ++ */ ++static void pfe_eth_get_drvinfo(struct net_device *ndev, struct ethtool_drvinfo ++ *drvinfo) ++{ ++ strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver)); ++ strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version)); ++ strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); ++ strlcpy(drvinfo->bus_info, "N/A", sizeof(drvinfo->bus_info)); ++} ++ ++/* ++ * pfe_eth_set_settings - Used to send commands to PHY. ++ * ++ */ ++static int pfe_eth_set_settings(struct net_device *ndev, ++ const struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ return phy_ethtool_ksettings_set(phydev, cmd); ++} ++ ++/* ++ * pfe_eth_getsettings - Return the current settings in the ethtool_cmd ++ * structure. ++ * ++ */ ++static int pfe_eth_get_settings(struct net_device *ndev, ++ struct ethtool_link_ksettings *cmd) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev = priv->phydev; ++ ++ if (!phydev) ++ return -ENODEV; ++ ++ return phy_ethtool_ksettings_get(phydev, cmd); ++} ++ ++/* ++ * pfe_eth_get_msglevel - Gets the debug message mask. ++ * ++ */ ++static uint32_t pfe_eth_get_msglevel(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return priv->msg_enable; ++} ++ ++/* ++ * pfe_eth_set_msglevel - Sets the debug message mask. ++ * ++ */ ++static void pfe_eth_set_msglevel(struct net_device *ndev, uint32_t data) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ priv->msg_enable = data; ++} ++ ++#define HIF_RX_COAL_MAX_CLKS (~(1 << 31)) ++#define HIF_RX_COAL_CLKS_PER_USEC (pfe->ctrl.sys_clk / 1000) ++#define HIF_RX_COAL_MAX_USECS (HIF_RX_COAL_MAX_CLKS / \ ++ HIF_RX_COAL_CLKS_PER_USEC) ++ ++/* ++ * pfe_eth_set_coalesce - Sets rx interrupt coalescing timer. ++ * ++ */ ++static int pfe_eth_set_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec) ++{ ++ if (ec->rx_coalesce_usecs > HIF_RX_COAL_MAX_USECS) ++ return -EINVAL; ++ ++ if (!ec->rx_coalesce_usecs) { ++ writel(0, HIF_INT_COAL); ++ return 0; ++ } ++ ++ writel((ec->rx_coalesce_usecs * HIF_RX_COAL_CLKS_PER_USEC) | ++ HIF_INT_COAL_ENABLE, HIF_INT_COAL); ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_coalesce - Gets rx interrupt coalescing timer value. ++ * ++ */ ++static int pfe_eth_get_coalesce(struct net_device *ndev, ++ struct ethtool_coalesce *ec) ++{ ++ int reg_val = readl(HIF_INT_COAL); ++ ++ if (reg_val & HIF_INT_COAL_ENABLE) ++ ec->rx_coalesce_usecs = (reg_val & HIF_RX_COAL_MAX_CLKS) / ++ HIF_RX_COAL_CLKS_PER_USEC; ++ else ++ ec->rx_coalesce_usecs = 0; ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_set_pauseparam - Sets pause parameters ++ * ++ */ ++static int pfe_eth_set_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (epause->tx_pause != epause->rx_pause) { ++ netdev_info(ndev, ++ "hardware only support enable/disable both tx and rx\n"); ++ return -EINVAL; ++ } ++ ++ priv->pause_flag = 0; ++ priv->pause_flag |= epause->rx_pause ? PFE_PAUSE_FLAG_ENABLE : 0; ++ priv->pause_flag |= epause->autoneg ? PFE_PAUSE_FLAG_AUTONEG : 0; ++ ++ if (epause->rx_pause || epause->autoneg) { ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) | ++ EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ priv->phydev->supported |= ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause; ++ priv->phydev->advertising |= ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause; ++ } ++ } else { ++ gemac_disable_pause_rx(priv->EMAC_baseaddr); ++ writel((readl(priv->GPI_baseaddr + GPI_TX_PAUSE_TIME) & ++ ~EGPI_PAUSE_ENABLE), ++ priv->GPI_baseaddr + GPI_TX_PAUSE_TIME); ++ if (priv->phydev) { ++ priv->phydev->supported &= ~(ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause); ++ priv->phydev->advertising &= ~(ADVERTISED_Pause | ++ ADVERTISED_Asym_Pause); ++ } ++ } ++ ++ return 0; ++} ++ ++/* ++ * pfe_eth_get_pauseparam - Gets pause parameters ++ * ++ */ ++static void pfe_eth_get_pauseparam(struct net_device *ndev, ++ struct ethtool_pauseparam *epause) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ epause->autoneg = (priv->pause_flag & PFE_PAUSE_FLAG_AUTONEG) != 0; ++ epause->tx_pause = (priv->pause_flag & PFE_PAUSE_FLAG_ENABLE) != 0; ++ epause->rx_pause = epause->tx_pause; ++} ++ ++/* ++ * pfe_eth_get_hash ++ */ ++#define PFE_HASH_BITS 6 /* #bits in hash */ ++#define CRC32_POLY 0xEDB88320 ++ ++static int pfe_eth_get_hash(u8 *addr) ++{ ++ unsigned int i, bit, data, crc, hash; ++ ++ /* calculate crc32 value of mac address */ ++ crc = 0xffffffff; ++ ++ for (i = 0; i < 6; i++) { ++ data = addr[i]; ++ for (bit = 0; bit < 8; bit++, data >>= 1) { ++ crc = (crc >> 1) ^ ++ (((crc ^ data) & 1) ? CRC32_POLY : 0); ++ } ++ } ++ ++ /* ++ * only upper 6 bits (PFE_HASH_BITS) are used ++ * which point to specific bit in the hash registers ++ */ ++ hash = (crc >> (32 - PFE_HASH_BITS)) & 0x3f; ++ ++ return hash; ++} ++ ++const struct ethtool_ops pfe_ethtool_ops = { ++ .get_drvinfo = pfe_eth_get_drvinfo, ++ .get_regs_len = pfe_eth_gemac_reglen, ++ .get_regs = pfe_eth_gemac_get_regs, ++ .get_link = ethtool_op_get_link, ++ .get_wol = pfe_eth_get_wol, ++ .set_wol = pfe_eth_set_wol, ++ .set_pauseparam = pfe_eth_set_pauseparam, ++ .get_pauseparam = pfe_eth_get_pauseparam, ++ .get_strings = pfe_eth_gstrings, ++ .get_sset_count = pfe_eth_stats_count, ++ .get_ethtool_stats = pfe_eth_fill_stats, ++ .get_msglevel = pfe_eth_get_msglevel, ++ .set_msglevel = pfe_eth_set_msglevel, ++ .set_coalesce = pfe_eth_set_coalesce, ++ .get_coalesce = pfe_eth_get_coalesce, ++ .get_link_ksettings = pfe_eth_get_settings, ++ .set_link_ksettings = pfe_eth_set_settings, ++}; ++ ++/* pfe_eth_mdio_reset ++ */ ++int pfe_eth_mdio_reset(struct mii_bus *bus) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ u32 phy_speed; ++ ++ netif_info(priv, hw, priv->ndev, "%s\n", __func__); ++ ++ mutex_lock(&bus->mdio_lock); ++ ++ /* ++ * Set MII speed to 2.5 MHz (= clk_get_rate() / 2 * phy_speed) ++ * ++ * The formula for FEC MDC is 'ref_freq / (MII_SPEED x 2)' while ++ * for ENET-MAC is 'ref_freq / ((MII_SPEED + 1) x 2)'. ++ */ ++ phy_speed = (DIV_ROUND_UP((pfe->ctrl.sys_clk * 1000), 4000000) ++ << EMAC_MII_SPEED_SHIFT); ++ phy_speed |= EMAC_HOLDTIME(0x5); ++ __raw_writel(phy_speed, priv->PHY_baseaddr + EMAC_MII_CTRL_REG); ++ ++ mutex_unlock(&bus->mdio_lock); ++ ++ return 0; ++} ++ ++/* pfe_eth_gemac_phy_timeout ++ * ++ */ ++static int pfe_eth_gemac_phy_timeout(struct pfe_eth_priv_s *priv, int timeout) ++{ ++ while (!(__raw_readl(priv->PHY_baseaddr + EMAC_IEVENT_REG) & ++ EMAC_IEVENT_MII)) { ++ if (timeout-- <= 0) ++ return -1; ++ usleep_range(10, 20); ++ } ++ __raw_writel(EMAC_IEVENT_MII, priv->PHY_baseaddr + EMAC_IEVENT_REG); ++ return 0; ++} ++ ++static int pfe_eth_mdio_mux(u8 muxval) ++{ ++ struct i2c_adapter *a; ++ struct i2c_msg msg; ++ unsigned char buf[2]; ++ int ret; ++ ++ a = i2c_get_adapter(0); ++ if (!a) ++ return -ENODEV; ++ ++ /* set bit 1 (the second bit) of chip at 0x09, register 0x13 */ ++ buf[0] = 0x54; /* reg number */ ++ buf[1] = (muxval << 6) | 0x3; /* data */ ++ msg.addr = 0x66; ++ msg.buf = buf; ++ msg.len = 2; ++ msg.flags = 0; ++ ret = i2c_transfer(a, &msg, 1); ++ i2c_put_adapter(a); ++ if (ret != 1) ++ return -ENODEV; ++ return 0; ++} ++ ++static int pfe_eth_mdio_write_addr(struct mii_bus *bus, int mii_id, ++ int dev_addr, int regnum) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ ++ __raw_writel(EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(dev_addr) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(regnum), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO address write timeout\n", ++ __func__); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++static int pfe_eth_mdio_write(struct mii_bus *bus, int mii_id, int regnum, ++ u16 value) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } else { ++ /* start a write op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_WR | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA | EMAC_MII_DATA(value), ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO write timeout\n", ++ __func__); ++ return -1; ++ } ++ netif_info(priv, hw, priv->ndev, "%s: phy %x reg %x val %x\n", __func__, ++ mii_id, regnum, value); ++ ++ return 0; ++} ++ ++static int pfe_eth_mdio_read(struct mii_bus *bus, int mii_id, int regnum) ++{ ++ struct pfe_eth_priv_s *priv = (struct pfe_eth_priv_s *)bus->priv; ++ u16 value = 0; ++ ++ /*To access external PHYs on QDS board mux needs to be configured*/ ++ if ((mii_id) && (pfe->mdio_muxval[mii_id])) ++ pfe_eth_mdio_mux(pfe->mdio_muxval[mii_id]); ++ ++ if (regnum & MII_ADDR_C45) { ++ pfe_eth_mdio_write_addr(bus, mii_id, (regnum >> 16) & 0x1f, ++ regnum & 0xffff); ++ __raw_writel(EMAC_MII_DATA_OP_CL45_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA((regnum >> 16) & 0x1f) | ++ EMAC_MII_DATA_TA, ++ priv->PHY_baseaddr + EMAC_MII_DATA_REG); ++ } else { ++ /* start a read op */ ++ __raw_writel(EMAC_MII_DATA_ST | EMAC_MII_DATA_OP_RD | ++ EMAC_MII_DATA_PA(mii_id) | ++ EMAC_MII_DATA_RA(regnum) | ++ EMAC_MII_DATA_TA, priv->PHY_baseaddr + ++ EMAC_MII_DATA_REG); ++ } ++ ++ if (pfe_eth_gemac_phy_timeout(priv, EMAC_MDIO_TIMEOUT)) { ++ netdev_err(priv->ndev, "%s: phy MDIO read timeout\n", __func__); ++ return -1; ++ } ++ ++ value = EMAC_MII_DATA(__raw_readl(priv->PHY_baseaddr + ++ EMAC_MII_DATA_REG)); ++ netif_info(priv, hw, priv->ndev, "%s: phy %x reg %x val %x\n", __func__, ++ mii_id, regnum, value); ++ return value; ++} ++ ++static int pfe_eth_mdio_init(struct pfe_eth_priv_s *priv, ++ struct ls1012a_mdio_platform_data *minfo) ++{ ++ struct mii_bus *bus; ++ int rc; ++ ++ netif_info(priv, drv, priv->ndev, "%s\n", __func__); ++ pr_info("%s\n", __func__); ++ ++ bus = mdiobus_alloc(); ++ if (!bus) { ++ netdev_err(priv->ndev, "mdiobus_alloc() failed\n"); ++ rc = -ENOMEM; ++ goto err0; ++ } ++ ++ bus->name = "ls1012a MDIO Bus"; ++ bus->read = &pfe_eth_mdio_read; ++ bus->write = &pfe_eth_mdio_write; ++ bus->reset = &pfe_eth_mdio_reset; ++ snprintf(bus->id, MII_BUS_ID_SIZE, "ls1012a-%x", priv->id); ++ bus->priv = priv; ++ ++ bus->phy_mask = minfo->phy_mask; ++ priv->mdc_div = minfo->mdc_div; ++ ++ if (!priv->mdc_div) ++ priv->mdc_div = 64; ++ ++ bus->irq[0] = minfo->irq[0]; ++ ++ bus->parent = priv->pfe->dev; ++ ++ netif_info(priv, drv, priv->ndev, "%s: mdc_div: %d, phy_mask: %x\n", ++ __func__, priv->mdc_div, bus->phy_mask); ++ rc = mdiobus_register(bus); ++ if (rc) { ++ netdev_err(priv->ndev, "mdiobus_register(%s) failed\n", ++ bus->name); ++ goto err1; ++ } ++ ++ priv->mii_bus = bus; ++ pfe_eth_mdio_reset(bus); ++ ++ return 0; ++ ++err1: ++ mdiobus_free(bus); ++err0: ++ return rc; ++} ++ ++/* pfe_eth_mdio_exit ++ */ ++static void pfe_eth_mdio_exit(struct mii_bus *bus) ++{ ++ if (!bus) ++ return; ++ ++ netif_info((struct pfe_eth_priv_s *)bus->priv, drv, ((struct ++ pfe_eth_priv_s *)(bus->priv))->ndev, "%s\n", __func__); ++ ++ mdiobus_unregister(bus); ++ mdiobus_free(bus); ++} ++ ++/* pfe_get_phydev_speed ++ */ ++static int pfe_get_phydev_speed(struct phy_device *phydev) ++{ ++ switch (phydev->speed) { ++ case 10: ++ return SPEED_10M; ++ case 100: ++ return SPEED_100M; ++ case 1000: ++ default: ++ return SPEED_1000M; ++ } ++} ++ ++/* pfe_set_rgmii_speed ++ */ ++#define RGMIIPCR 0x434 ++/* RGMIIPCR bit definitions*/ ++#define SCFG_RGMIIPCR_EN_AUTO (0x00000008) ++#define SCFG_RGMIIPCR_SETSP_1000M (0x00000004) ++#define SCFG_RGMIIPCR_SETSP_100M (0x00000000) ++#define SCFG_RGMIIPCR_SETSP_10M (0x00000002) ++#define SCFG_RGMIIPCR_SETFD (0x00000001) ++ ++static void pfe_set_rgmii_speed(struct phy_device *phydev) ++{ ++ u32 rgmii_pcr; ++ ++ regmap_read(pfe->scfg, RGMIIPCR, &rgmii_pcr); ++ rgmii_pcr &= ~(SCFG_RGMIIPCR_SETSP_1000M | SCFG_RGMIIPCR_SETSP_10M); ++ ++ switch (phydev->speed) { ++ case 10: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_10M; ++ break; ++ case 1000: ++ rgmii_pcr |= SCFG_RGMIIPCR_SETSP_1000M; ++ break; ++ case 100: ++ default: ++ /* Default is 100M */ ++ break; ++ } ++ regmap_write(pfe->scfg, RGMIIPCR, rgmii_pcr); ++} ++ ++/* pfe_get_phydev_duplex ++ */ ++static int pfe_get_phydev_duplex(struct phy_device *phydev) ++{ ++ /*return (phydev->duplex == DUPLEX_HALF) ? DUP_HALF:DUP_FULL ; */ ++ return DUPLEX_FULL; ++} ++ ++/* pfe_eth_adjust_link ++ */ ++static void pfe_eth_adjust_link(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ unsigned long flags; ++ struct phy_device *phydev = priv->phydev; ++ int new_state = 0; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ spin_lock_irqsave(&priv->lock, flags); ++ ++ if (phydev->link) { ++ /* ++ * Now we make sure that we can be in full duplex mode. ++ * If not, we operate in half-duplex mode. ++ */ ++ if (phydev->duplex != priv->oldduplex) { ++ new_state = 1; ++ gemac_set_duplex(priv->EMAC_baseaddr, ++ pfe_get_phydev_duplex(phydev)); ++ priv->oldduplex = phydev->duplex; ++ } ++ ++ if (phydev->speed != priv->oldspeed) { ++ new_state = 1; ++ gemac_set_speed(priv->EMAC_baseaddr, ++ pfe_get_phydev_speed(phydev)); ++ if (priv->einfo->mii_config == PHY_INTERFACE_MODE_RGMII_TXID) ++ pfe_set_rgmii_speed(phydev); ++ priv->oldspeed = phydev->speed; ++ } ++ ++ if (!priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 1; ++ } ++ ++ } else if (priv->oldlink) { ++ new_state = 1; ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ } ++ ++ if (new_state && netif_msg_link(priv)) ++ phy_print_status(phydev); ++ ++ spin_unlock_irqrestore(&priv->lock, flags); ++} ++ ++/* pfe_phy_exit ++ */ ++static void pfe_phy_exit(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ phy_disconnect(priv->phydev); ++ priv->phydev = NULL; ++} ++ ++/* pfe_eth_stop ++ */ ++static void pfe_eth_stop(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (wake) { ++ gemac_tx_disable(priv->EMAC_baseaddr); ++ } else { ++ gemac_disable(priv->EMAC_baseaddr); ++ gpi_disable(priv->GPI_baseaddr); ++ ++ if (priv->phydev) ++ phy_stop(priv->phydev); ++ } ++} ++ ++/* pfe_eth_start ++ */ ++static int pfe_eth_start(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, drv, priv->ndev, "%s\n", __func__); ++ ++ if (priv->phydev) ++ phy_start(priv->phydev); ++ ++ gpi_enable(priv->GPI_baseaddr); ++ gemac_enable(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* ++ * Configure on chip serdes through mdio ++ */ ++static void ls1012a_configure_serdes(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = pfe->eth.eth_priv[0]; ++ int sgmii_2500 = 0; ++ struct mii_bus *bus = priv->mii_bus; ++ ++ if (priv->einfo->mii_config == PHY_INTERFACE_MODE_SGMII_2500) ++ sgmii_2500 = 1; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ /* PCS configuration done with corresponding GEMAC */ ++ ++ pfe_eth_mdio_read(bus, 0, 0); ++ pfe_eth_mdio_read(bus, 0, 1); ++ ++ /*These settings taken from validtion team */ ++ pfe_eth_mdio_write(bus, 0, 0x0, 0x8000); ++ if (sgmii_2500) { ++ pfe_eth_mdio_write(bus, 0, 0x14, 0x9); ++ pfe_eth_mdio_write(bus, 0, 0x4, 0x4001); ++ pfe_eth_mdio_write(bus, 0, 0x12, 0xa120); ++ pfe_eth_mdio_write(bus, 0, 0x13, 0x7); ++ } else { ++ pfe_eth_mdio_write(bus, 0, 0x14, 0xb); ++ pfe_eth_mdio_write(bus, 0, 0x4, 0x1a1); ++ pfe_eth_mdio_write(bus, 0, 0x12, 0x400); ++ pfe_eth_mdio_write(bus, 0, 0x13, 0x0); ++ } ++ ++ pfe_eth_mdio_write(bus, 0, 0x0, 0x1140); ++} ++ ++/* ++ * pfe_phy_init ++ * ++ */ ++static int pfe_phy_init(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct phy_device *phydev; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ char bus_id[MII_BUS_ID_SIZE]; ++ phy_interface_t interface; ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ ++ snprintf(bus_id, MII_BUS_ID_SIZE, "ls1012a-%d", 0); ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, ++ priv->einfo->phy_id); ++ ++ netif_info(priv, drv, ndev, "%s: %s\n", __func__, phy_id); ++ interface = priv->einfo->mii_config; ++ if ((interface == PHY_INTERFACE_MODE_SGMII) || ++ (interface == PHY_INTERFACE_MODE_SGMII_2500)) { ++ /*Configure SGMII PCS */ ++ if (pfe->scfg) { ++ /*Config MDIO from serdes */ ++ regmap_write(pfe->scfg, 0x484, 0x00000000); ++ } ++ ls1012a_configure_serdes(ndev); ++ } ++ ++ if (pfe->scfg) { ++ /*Config MDIO from PAD */ ++ regmap_write(pfe->scfg, 0x484, 0x80000000); ++ } ++ ++ priv->oldlink = 0; ++ priv->oldspeed = 0; ++ priv->oldduplex = -1; ++ pr_info("%s interface %x\n", __func__, interface); ++ phydev = phy_connect(ndev, phy_id, &pfe_eth_adjust_link, interface); ++ ++ if (IS_ERR(phydev)) { ++ netdev_err(ndev, "phy_connect() failed\n"); ++ return PTR_ERR(phydev); ++ } ++ ++ priv->phydev = phydev; ++ phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++/* pfe_gemac_init ++ */ ++static int pfe_gemac_init(struct pfe_eth_priv_s *priv) ++{ ++ struct gemac_cfg cfg; ++ ++ netif_info(priv, ifup, priv->ndev, "%s\n", __func__); ++ ++ cfg.speed = SPEED_1000M; ++ cfg.duplex = DUPLEX_FULL; ++ ++ gemac_set_config(priv->EMAC_baseaddr, &cfg); ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ gemac_enable_1536_rx(priv->EMAC_baseaddr); ++ gemac_enable_rx_jmb(priv->EMAC_baseaddr); ++ gemac_enable_stacked_vlan(priv->EMAC_baseaddr); ++ gemac_enable_pause_rx(priv->EMAC_baseaddr); ++ gemac_set_bus_width(priv->EMAC_baseaddr, 64); ++ ++ /*GEM will perform checksum verifications*/ ++ if (priv->ndev->features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ ++ return 0; ++} ++ ++/* pfe_eth_event_handler ++ */ ++static int pfe_eth_event_handler(void *data, int event, int qno) ++{ ++ struct pfe_eth_priv_s *priv = data; ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ ++ if (qno == 0) { ++ if (napi_schedule_prep(&priv->high_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule high prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ ++ __napi_schedule(&priv->high_napi); ++ } ++ } else if (qno == 1) { ++ if (napi_schedule_prep(&priv->low_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule low prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->low_napi); ++ } ++ } else if (qno == 2) { ++ if (napi_schedule_prep(&priv->lro_napi)) { ++ netif_info(priv, intr, priv->ndev, ++ "%s: schedule lro prio poll\n" ++ , __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&priv->lro_napi); ++ } ++ } ++ ++ break; ++ ++ case EVENT_TXDONE_IND: ++ pfe_eth_flush_tx(priv); ++ hif_lib_event_handler_start(&priv->client, EVENT_TXDONE_IND, 0); ++ break; ++ case EVENT_HIGH_RX_WM: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* pfe_eth_open ++ */ ++static int pfe_eth_open(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct hif_client_s *client; ++ int rc; ++ ++ netif_info(priv, ifup, ndev, "%s\n", __func__); ++ ++ /* Register client driver with HIF */ ++ client = &priv->client; ++ memset(client, 0, sizeof(*client)); ++ client->id = PFE_CL_GEM0 + priv->id; ++ client->tx_qn = emac_txq_cnt; ++ client->rx_qn = EMAC_RXQ_CNT; ++ client->priv = priv; ++ client->pfe = priv->pfe; ++ client->event_handler = pfe_eth_event_handler; ++ ++ client->tx_qsize = EMAC_TXQ_DEPTH; ++ client->rx_qsize = EMAC_RXQ_DEPTH; ++ ++ rc = hif_lib_client_register(client); ++ if (rc) { ++ netdev_err(ndev, "%s: hif_lib_client_register(%d) failed\n", ++ __func__, client->id); ++ goto err0; ++ } ++ ++ netif_info(priv, drv, ndev, "%s: registered client: %p\n", __func__, ++ client); ++ ++ pfe_gemac_init(priv); ++ ++ if (!is_valid_ether_addr(ndev->dev_addr)) { ++ netdev_err(ndev, "%s: invalid MAC address\n", __func__); ++ rc = -EADDRNOTAVAIL; ++ goto err1; ++ } ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ napi_enable(&priv->high_napi); ++ napi_enable(&priv->low_napi); ++ napi_enable(&priv->lro_napi); ++ ++ rc = pfe_eth_start(priv); ++ ++ netif_tx_wake_all_queues(ndev); ++ ++ return rc; ++ ++err1: ++ hif_lib_client_unregister(&priv->client); ++ ++err0: ++ return rc; ++} ++ ++/* ++ * pfe_eth_shutdown ++ */ ++int pfe_eth_shutdown(struct net_device *ndev, int wake) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int i, qstatus; ++ unsigned long next_poll = jiffies + 1, end = jiffies + ++ (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ int tx_pkts, prv_tx_pkts; ++ ++ netif_info(priv, ifdown, ndev, "%s\n", __func__); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ hrtimer_cancel(&priv->fast_tx_timeout[i].timer); ++ ++ netif_tx_stop_all_queues(ndev); ++ ++ do { ++ tx_pkts = 0; ++ pfe_eth_flush_tx(priv); ++ ++ for (i = 0; i < emac_txq_cnt; i++) ++ tx_pkts += hif_lib_tx_pending(&priv->client, i); ++ ++ if (tx_pkts) { ++ /*Don't wait forever, break if we cross max timeout */ ++ if (time_after(jiffies, end)) { ++ pr_err( ++ "(%s)Tx is not complete after %dmsec\n", ++ ndev->name, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ ++ pr_info("%s : (%s) Waiting for tx packets to free. Pending tx pkts = %d.\n" ++ , __func__, ndev->name, tx_pkts); ++ if (need_resched()) ++ schedule(); ++ } ++ ++ } while (tx_pkts); ++ ++ end = jiffies + (TX_POLL_TIMEOUT_MS * HZ) / 1000; ++ ++ prv_tx_pkts = tmu_pkts_processed(priv->id); ++ /* ++ * Wait till TMU transmits all pending packets ++ * poll tmu_qstatus and pkts processed by TMU for every 10ms ++ * Consider TMU is busy, If we see TMU qeueu pending or any packets ++ * processed by TMU ++ */ ++ while (1) { ++ if (time_after(jiffies, next_poll)) { ++ tx_pkts = tmu_pkts_processed(priv->id); ++ qstatus = tmu_qstatus(priv->id) & 0x7ffff; ++ ++ if (!qstatus && (tx_pkts == prv_tx_pkts)) ++ break; ++ /* Don't wait forever, break if we cross max ++ * timeout(TX_POLL_TIMEOUT_MS) ++ */ ++ if (time_after(jiffies, end)) { ++ pr_err("TMU%d is busy after %dmsec\n", ++ priv->id, TX_POLL_TIMEOUT_MS); ++ break; ++ } ++ prv_tx_pkts = tx_pkts; ++ next_poll++; ++ } ++ if (need_resched()) ++ schedule(); ++ } ++ /* Wait for some more time to complete transmitting packet if any */ ++ next_poll = jiffies + 1; ++ while (1) { ++ if (time_after(jiffies, next_poll)) ++ break; ++ if (need_resched()) ++ schedule(); ++ } ++ ++ pfe_eth_stop(ndev, wake); ++ ++ napi_disable(&priv->lro_napi); ++ napi_disable(&priv->low_napi); ++ napi_disable(&priv->high_napi); ++ ++ hif_lib_client_unregister(&priv->client); ++ ++ return 0; ++} ++ ++/* pfe_eth_close ++ * ++ */ ++static int pfe_eth_close(struct net_device *ndev) ++{ ++ pfe_eth_shutdown(ndev, 0); ++ ++ return 0; ++} ++ ++/* pfe_eth_suspend ++ * ++ * return value : 1 if netdevice is configured to wakeup system ++ * 0 otherwise ++ */ ++int pfe_eth_suspend(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int retval = 0; ++ ++ if (priv->wol) { ++ gemac_set_wol(priv->EMAC_baseaddr, priv->wol); ++ retval = 1; ++ } ++ pfe_eth_shutdown(ndev, priv->wol); ++ ++ return retval; ++} ++ ++/* pfe_eth_resume ++ * ++ */ ++int pfe_eth_resume(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ if (priv->wol) ++ gemac_set_wol(priv->EMAC_baseaddr, 0); ++ gemac_tx_enable(priv->EMAC_baseaddr); ++ ++ return pfe_eth_open(ndev); ++} ++ ++/* pfe_eth_get_queuenum ++ */ ++static int pfe_eth_get_queuenum(struct pfe_eth_priv_s *priv, struct sk_buff ++ *skb) ++{ ++ int queuenum = 0; ++ unsigned long flags; ++ ++ /* Get the Fast Path queue number */ ++ /* ++ * Use conntrack mark (if conntrack exists), then packet mark (if any), ++ * then fallback to default ++ */ ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ if (skb->nfct) { ++ enum ip_conntrack_info cinfo; ++ struct nf_conn *ct; ++ ++ ct = nf_ct_get(skb, &cinfo); ++ ++ if (ct) { ++ u32 connmark; ++ ++ connmark = ct->mark; ++ ++ if ((connmark & 0x80000000) && priv->id != 0) ++ connmark >>= 16; ++ ++ queuenum = connmark & EMAC_QUEUENUM_MASK; ++ } ++ } else {/* continued after #endif ... */ ++#endif ++ if (skb->mark) { ++ queuenum = skb->mark & EMAC_QUEUENUM_MASK; ++ } else { ++ spin_lock_irqsave(&priv->lock, flags); ++ queuenum = priv->default_priority & EMAC_QUEUENUM_MASK; ++ spin_unlock_irqrestore(&priv->lock, flags); ++ } ++#if defined(CONFIG_IP_NF_CONNTRACK_MARK) || defined(CONFIG_NF_CONNTRACK_MARK) ++ } ++#endif ++ return queuenum; ++} ++ ++/* pfe_eth_might_stop_tx ++ * ++ */ ++static int pfe_eth_might_stop_tx(struct pfe_eth_priv_s *priv, int queuenum, ++ struct netdev_queue *tx_queue, ++ unsigned int n_desc, ++ unsigned int n_segs) ++{ ++ ktime_t kt; ++ ++ if (unlikely((__hif_tx_avail(&pfe->hif) < n_desc) || ++ (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) || ++ (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < n_segs))) { ++#ifdef PFE_ETH_TX_STATS ++ if (__hif_tx_avail(&pfe->hif) < n_desc) { ++ priv->stop_queue_hif[queuenum]++; ++ } else if (hif_lib_tx_avail(&priv->client, queuenum) < n_desc) { ++ priv->stop_queue_hif_client[queuenum]++; ++ } else if (hif_lib_tx_credit_avail(pfe, priv->id, queuenum) < ++ n_segs) { ++ priv->stop_queue_credit[queuenum]++; ++ } ++ priv->stop_queue_total[queuenum]++; ++#endif ++ netif_tx_stop_queue(tx_queue); ++ ++ kt = ktime_set(0, LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS * ++ NSEC_PER_MSEC); ++ hrtimer_start(&priv->fast_tx_timeout[queuenum].timer, kt, ++ HRTIMER_MODE_REL); ++ return -1; ++ } else { ++ return 0; ++ } ++} ++ ++#define SA_MAX_OP 2 ++/* pfe_hif_send_packet ++ * ++ * At this level if TX fails we drop the packet ++ */ ++static void pfe_hif_send_packet(struct sk_buff *skb, struct pfe_eth_priv_s ++ *priv, int queuenum) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ unsigned int nr_frags; ++ u32 ctrl = 0; ++ ++ netif_info(priv, tx_queued, priv->ndev, "%s\n", __func__); ++ ++ if (skb_is_gso(skb)) { ++ priv->stats.tx_dropped++; ++ return; ++ } ++ ++ if (skb->ip_summed == CHECKSUM_PARTIAL) ++ ctrl = HIF_CTRL_TX_CHECKSUM; ++ ++ nr_frags = sh->nr_frags; ++ ++ if (nr_frags) { ++ skb_frag_t *f; ++ int i; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb_headlen(skb), ctrl, HIF_FIRST_BUFFER, ++ skb); ++ ++ for (i = 0; i < nr_frags - 1; i++) { ++ f = &sh->frags[i]; ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), ++ skb_frag_size(f), ++ 0x0, 0x0, skb); ++ } ++ ++ f = &sh->frags[i]; ++ ++ __hif_lib_xmit_pkt(&priv->client, queuenum, ++ skb_frag_address(f), skb_frag_size(f), ++ 0x0, HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p nr_frags:%d len:%d\n", ++ __func__, skb, nr_frags, skb->len); ++ } else { ++ __hif_lib_xmit_pkt(&priv->client, queuenum, skb->data, ++ skb->len, ctrl, HIF_FIRST_BUFFER | ++ HIF_LAST_BUFFER | HIF_DATA_VALID, ++ skb); ++ netif_info(priv, tx_queued, priv->ndev, ++ "%s: pkt sent successfully skb:%p len:%d\n", ++ __func__, skb, skb->len); ++ } ++ hif_tx_dma_start(); ++ priv->stats.tx_packets++; ++ priv->stats.tx_bytes += skb->len; ++ hif_lib_tx_credit_use(pfe, priv->id, queuenum, 1); ++} ++ ++/* pfe_eth_flush_txQ ++ */ ++static void pfe_eth_flush_txQ(struct pfe_eth_priv_s *priv, int tx_q_num, int ++ from_tx, int n_desc) ++{ ++ struct sk_buff *skb; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ unsigned int flags; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ if (!from_tx) ++ __netif_tx_lock_bh(tx_queue); ++ ++ /* Clean HIF and client queue */ ++ while ((skb = hif_lib_tx_get_next_complete(&priv->client, ++ tx_q_num, &flags, ++ HIF_TX_DESC_NT))) { ++ if (flags & HIF_DATA_VALID) ++ dev_kfree_skb_any(skb); ++ } ++ if (!from_tx) ++ __netif_tx_unlock_bh(tx_queue); ++} ++ ++/* pfe_eth_flush_tx ++ */ ++static void pfe_eth_flush_tx(struct pfe_eth_priv_s *priv) ++{ ++ int ii; ++ ++ netif_info(priv, tx_done, priv->ndev, "%s\n", __func__); ++ ++ for (ii = 0; ii < emac_txq_cnt; ii++) ++ pfe_eth_flush_txQ(priv, ii, 0, 0); ++} ++ ++void pfe_tx_get_req_desc(struct sk_buff *skb, unsigned int *n_desc, unsigned int ++ *n_segs) ++{ ++ struct skb_shared_info *sh = skb_shinfo(skb); ++ ++ /* Scattered data */ ++ if (sh->nr_frags) { ++ *n_desc = sh->nr_frags + 1; ++ *n_segs = 1; ++ /* Regular case */ ++ } else { ++ *n_desc = 1; ++ *n_segs = 1; ++ } ++} ++ ++/* pfe_eth_send_packet ++ */ ++static int pfe_eth_send_packet(struct sk_buff *skb, struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int tx_q_num = skb_get_queue_mapping(skb); ++ int n_desc, n_segs; ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ tx_q_num); ++ ++ netif_info(priv, tx_queued, ndev, "%s\n", __func__); ++ ++ if ((!skb_is_gso(skb)) && (skb_headroom(skb) < (PFE_PKT_HEADER_SZ + ++ sizeof(unsigned long)))) { ++ netif_warn(priv, tx_err, priv->ndev, "%s: copying skb\n", ++ __func__); ++ ++ if (pskb_expand_head(skb, (PFE_PKT_HEADER_SZ + sizeof(unsigned ++ long)), 0, GFP_ATOMIC)) { ++ /* No need to re-transmit, no way to recover*/ ++ kfree_skb(skb); ++ priv->stats.tx_dropped++; ++ return NETDEV_TX_OK; ++ } ++ } ++ ++ pfe_tx_get_req_desc(skb, &n_desc, &n_segs); ++ ++ hif_tx_lock(&pfe->hif); ++ if (unlikely(pfe_eth_might_stop_tx(priv, tx_q_num, tx_queue, n_desc, ++ n_segs))) { ++#ifdef PFE_ETH_TX_STATS ++ if (priv->was_stopped[tx_q_num]) { ++ priv->clean_fail[tx_q_num]++; ++ priv->was_stopped[tx_q_num] = 0; ++ } ++#endif ++ hif_tx_unlock(&pfe->hif); ++ return NETDEV_TX_BUSY; ++ } ++ ++ pfe_hif_send_packet(skb, priv, tx_q_num); ++ ++ hif_tx_unlock(&pfe->hif); ++ ++ tx_queue->trans_start = jiffies; ++ ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[tx_q_num] = 0; ++#endif ++ ++ return NETDEV_TX_OK; ++} ++ ++/* pfe_eth_select_queue ++ * ++ */ ++static u16 pfe_eth_select_queue(struct net_device *ndev, struct sk_buff *skb, ++ void *accel_priv, ++ select_queue_fallback_t fallback) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ return pfe_eth_get_queuenum(priv, skb); ++} ++ ++/* pfe_eth_get_stats ++ */ ++static struct net_device_stats *pfe_eth_get_stats(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ return &priv->stats; ++} ++ ++/* pfe_eth_set_mac_address ++ */ ++static int pfe_eth_set_mac_address(struct net_device *ndev, void *addr) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct sockaddr *sa = addr; ++ ++ netif_info(priv, drv, ndev, "%s\n", __func__); ++ ++ if (!is_valid_ether_addr(sa->sa_data)) ++ return -EADDRNOTAVAIL; ++ ++ memcpy(ndev->dev_addr, sa->sa_data, ETH_ALEN); ++ ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ (struct pfe_mac_addr *)ndev->dev_addr, 1); ++ ++ return 0; ++} ++ ++/* pfe_eth_enet_addr_byte_mac ++ */ ++int pfe_eth_enet_addr_byte_mac(u8 *enet_byte_addr, ++ struct pfe_mac_addr *enet_addr) ++{ ++ if (!enet_byte_addr || !enet_addr) { ++ return -1; ++ ++ } else { ++ enet_addr->bottom = enet_byte_addr[0] | ++ (enet_byte_addr[1] << 8) | ++ (enet_byte_addr[2] << 16) | ++ (enet_byte_addr[3] << 24); ++ enet_addr->top = enet_byte_addr[4] | ++ (enet_byte_addr[5] << 8); ++ return 0; ++ } ++} ++ ++/* pfe_eth_set_multi ++ */ ++static void pfe_eth_set_multi(struct net_device *ndev) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ struct pfe_mac_addr hash_addr; /* hash register structure */ ++ /* specific mac address register structure */ ++ struct pfe_mac_addr spec_addr; ++ int result; /* index into hash register to set.. */ ++ int uc_count = 0; ++ struct netdev_hw_addr *ha; ++ ++ if (ndev->flags & IFF_PROMISC) { ++ netif_info(priv, drv, ndev, "entering promiscuous mode\n"); ++ ++ priv->promisc = 1; ++ gemac_enable_copy_all(priv->EMAC_baseaddr); ++ } else { ++ priv->promisc = 0; ++ gemac_disable_copy_all(priv->EMAC_baseaddr); ++ } ++ ++ /* Enable broadcast frame reception if required. */ ++ if (ndev->flags & IFF_BROADCAST) { ++ gemac_allow_broadcast(priv->EMAC_baseaddr); ++ } else { ++ netif_info(priv, drv, ndev, ++ "disabling broadcast frame reception\n"); ++ ++ gemac_no_broadcast(priv->EMAC_baseaddr); ++ } ++ ++ if (ndev->flags & IFF_ALLMULTI) { ++ /* Set the hash to rx all multicast frames */ ++ hash_addr.bottom = 0xFFFFFFFF; ++ hash_addr.top = 0xFFFFFFFF; ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ netdev_for_each_uc_addr(ha, ndev) { ++ if (uc_count >= MAX_UC_SPEC_ADDR_REG) ++ break; ++ pfe_eth_enet_addr_byte_mac(ha->addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, &spec_addr, ++ uc_count + 2); ++ uc_count++; ++ } ++ } else if ((netdev_mc_count(ndev) > 0) || (netdev_uc_count(ndev))) { ++ u8 *addr; ++ ++ hash_addr.bottom = 0; ++ hash_addr.top = 0; ++ ++ netdev_for_each_mc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ netif_info(priv, drv, ndev, ++ "adding multicast address %X:%X:%X:%X:%X:%X to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ ++ if (result < EMAC_HASH_REG_BITS) { ++ if (result < 32) ++ hash_addr.bottom |= (1 << result); ++ else ++ hash_addr.top |= (1 << (result - 32)); ++ } else { ++ break; ++ } ++ } ++ ++ uc_count = -1; ++ netdev_for_each_uc_addr(ha, ndev) { ++ addr = ha->addr; ++ ++ if (++uc_count < MAX_UC_SPEC_ADDR_REG) { ++ netdev_info(ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem filter\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ pfe_eth_enet_addr_byte_mac(addr, &spec_addr); ++ gemac_set_laddrN(priv->EMAC_baseaddr, ++ &spec_addr, uc_count + 2); ++ } else { ++ netif_info(priv, drv, ndev, ++ "adding unicast address %02x:%02x:%02x:%02x:%02x:%02x to gem hash\n", ++ addr[0], addr[1], addr[2], ++ addr[3], addr[4], addr[5]); ++ ++ result = pfe_eth_get_hash(addr); ++ if (result >= EMAC_HASH_REG_BITS) { ++ break; ++ ++ } else { ++ if (result < 32) ++ hash_addr.bottom |= (1 << ++ result); ++ else ++ hash_addr.top |= (1 << ++ (result - 32)); ++ } ++ } ++ } ++ ++ gemac_set_hash(priv->EMAC_baseaddr, &hash_addr); ++ } ++ ++ if (!(netdev_uc_count(ndev) >= MAX_UC_SPEC_ADDR_REG)) { ++ /* ++ * Check if there are any specific address HW registers that ++ * need to be flushed ++ */ ++ for (uc_count = netdev_uc_count(ndev); uc_count < ++ MAX_UC_SPEC_ADDR_REG; uc_count++) ++ gemac_clear_laddrN(priv->EMAC_baseaddr, uc_count + 2); ++ } ++ ++ if (ndev->flags & IFF_LOOPBACK) ++ gemac_set_loop(priv->EMAC_baseaddr, LB_LOCAL); ++} ++ ++/* pfe_eth_set_features ++ */ ++static int pfe_eth_set_features(struct net_device *ndev, netdev_features_t ++ features) ++{ ++ struct pfe_eth_priv_s *priv = netdev_priv(ndev); ++ int rc = 0; ++ ++ if (features & NETIF_F_RXCSUM) ++ gemac_enable_rx_checksum_offload(priv->EMAC_baseaddr); ++ else ++ gemac_disable_rx_checksum_offload(priv->EMAC_baseaddr); ++ return rc; ++} ++ ++/* pfe_eth_fast_tx_timeout ++ */ ++static enum hrtimer_restart pfe_eth_fast_tx_timeout(struct hrtimer *timer) ++{ ++ struct pfe_eth_fast_timer *fast_tx_timeout = container_of(timer, struct ++ pfe_eth_fast_timer, ++ timer); ++ struct pfe_eth_priv_s *priv = container_of(fast_tx_timeout->base, ++ struct pfe_eth_priv_s, ++ fast_tx_timeout); ++ struct netdev_queue *tx_queue = netdev_get_tx_queue(priv->ndev, ++ fast_tx_timeout->queuenum); ++ ++ if (netif_tx_queue_stopped(tx_queue)) { ++#ifdef PFE_ETH_TX_STATS ++ priv->was_stopped[fast_tx_timeout->queuenum] = 1; ++#endif ++ netif_tx_wake_queue(tx_queue); ++ } ++ ++ return HRTIMER_NORESTART; ++} ++ ++/* pfe_eth_fast_tx_timeout_init ++ */ ++static void pfe_eth_fast_tx_timeout_init(struct pfe_eth_priv_s *priv) ++{ ++ int i; ++ ++ for (i = 0; i < emac_txq_cnt; i++) { ++ priv->fast_tx_timeout[i].queuenum = i; ++ hrtimer_init(&priv->fast_tx_timeout[i].timer, CLOCK_MONOTONIC, ++ HRTIMER_MODE_REL); ++ priv->fast_tx_timeout[i].timer.function = ++ pfe_eth_fast_tx_timeout; ++ priv->fast_tx_timeout[i].base = priv->fast_tx_timeout; ++ } ++} ++ ++static struct sk_buff *pfe_eth_rx_skb(struct net_device *ndev, ++ struct pfe_eth_priv_s *priv, ++ unsigned int qno) ++{ ++ void *buf_addr; ++ unsigned int rx_ctrl; ++ unsigned int desc_ctrl = 0; ++ struct hif_ipsec_hdr *ipsec_hdr = NULL; ++ struct sk_buff *skb; ++ struct sk_buff *skb_frag, *skb_frag_last = NULL; ++ int length = 0, offset; ++ ++ skb = priv->skb_inflight[qno]; ++ ++ if (skb) { ++ skb_frag_last = skb_shinfo(skb)->frag_list; ++ if (skb_frag_last) { ++ while (skb_frag_last->next) ++ skb_frag_last = skb_frag_last->next; ++ } ++ } ++ ++ while (!(desc_ctrl & CL_DESC_LAST)) { ++ buf_addr = hif_lib_receive_pkt(&priv->client, qno, &length, ++ &offset, &rx_ctrl, &desc_ctrl, ++ (void **)&ipsec_hdr); ++ if (!buf_addr) ++ goto incomplete; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ ++ /* First frag */ ++ if (desc_ctrl & CL_DESC_FIRST) { ++ skb = build_skb(buf_addr, 0); ++ if (unlikely(!skb)) ++ goto pkt_drop; ++ ++ skb_reserve(skb, offset); ++ skb_put(skb, length); ++ skb->dev = ndev; ++ ++ if ((ndev->features & NETIF_F_RXCSUM) && (rx_ctrl & ++ HIF_CTRL_RX_CHECKSUMMED)) ++ skb->ip_summed = CHECKSUM_UNNECESSARY; ++ else ++ skb_checksum_none_assert(skb); ++ ++ } else { ++ /* Next frags */ ++ if (unlikely(!skb)) { ++ pr_err("%s: NULL skb_inflight\n", ++ __func__); ++ goto pkt_drop; ++ } ++ ++ skb_frag = build_skb(buf_addr, 0); ++ ++ if (unlikely(!skb_frag)) { ++ kfree(buf_addr); ++ goto pkt_drop; ++ } ++ ++ skb_reserve(skb_frag, offset); ++ skb_put(skb_frag, length); ++ ++ skb_frag->dev = ndev; ++ ++ if (skb_shinfo(skb)->frag_list) ++ skb_frag_last->next = skb_frag; ++ else ++ skb_shinfo(skb)->frag_list = skb_frag; ++ ++ skb->truesize += skb_frag->truesize; ++ skb->data_len += length; ++ skb->len += length; ++ skb_frag_last = skb_frag; ++ } ++ } ++ ++ priv->skb_inflight[qno] = NULL; ++ return skb; ++ ++incomplete: ++ priv->skb_inflight[qno] = skb; ++ return NULL; ++ ++pkt_drop: ++ priv->skb_inflight[qno] = NULL; ++ ++ if (skb) ++ kfree_skb(skb); ++ else ++ kfree(buf_addr); ++ ++ priv->stats.rx_errors++; ++ ++ return NULL; ++} ++ ++/* pfe_eth_poll ++ */ ++static int pfe_eth_poll(struct pfe_eth_priv_s *priv, struct napi_struct *napi, ++ unsigned int qno, int budget) ++{ ++ struct net_device *ndev = priv->ndev; ++ struct sk_buff *skb; ++ int work_done = 0; ++ unsigned int len; ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ do { ++ skb = pfe_eth_rx_skb(ndev, priv, qno); ++ ++ if (!skb) ++ break; ++ ++ len = skb->len; ++ ++ /* Packet will be processed */ ++ skb->protocol = eth_type_trans(skb, ndev); ++ ++ netif_receive_skb(skb); ++ ++ priv->stats.rx_packets++; ++ priv->stats.rx_bytes += len; ++ ++ work_done++; ++ ++#ifdef PFE_ETH_NAPI_STATS ++ priv->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ ++ } while (work_done < budget); ++ ++ /* ++ * If no Rx receive nor cleanup work was done, exit polling mode. ++ * No more netif_running(dev) check is required here , as this is ++ * checked in net/core/dev.c (2.6.33.5 kernel specific). ++ */ ++ if (work_done < budget) { ++ napi_complete(napi); ++ ++ hif_lib_event_handler_start(&priv->client, EVENT_RX_PKT_IND, ++ qno); ++ } ++#ifdef PFE_ETH_NAPI_STATS ++ else ++ priv->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_eth_lro_poll ++ */ ++static int pfe_eth_lro_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ lro_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 2, budget); ++} ++ ++/* pfe_eth_low_poll ++ */ ++static int pfe_eth_low_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ low_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 1, budget); ++} ++ ++/* pfe_eth_high_poll ++ */ ++static int pfe_eth_high_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_eth_priv_s *priv = container_of(napi, struct pfe_eth_priv_s, ++ high_napi); ++ ++ netif_info(priv, intr, priv->ndev, "%s\n", __func__); ++ ++ return pfe_eth_poll(priv, napi, 0, budget); ++} ++ ++static const struct net_device_ops pfe_netdev_ops = { ++ .ndo_open = pfe_eth_open, ++ .ndo_stop = pfe_eth_close, ++ .ndo_start_xmit = pfe_eth_send_packet, ++ .ndo_select_queue = pfe_eth_select_queue, ++ .ndo_get_stats = pfe_eth_get_stats, ++ .ndo_set_mac_address = pfe_eth_set_mac_address, ++ .ndo_set_rx_mode = pfe_eth_set_multi, ++ .ndo_set_features = pfe_eth_set_features, ++ .ndo_validate_addr = eth_validate_addr, ++}; ++ ++/* pfe_eth_init_one ++ */ ++static int pfe_eth_init_one(struct pfe *pfe, int id) ++{ ++ struct net_device *ndev = NULL; ++ struct pfe_eth_priv_s *priv = NULL; ++ struct ls1012a_eth_platform_data *einfo; ++ struct ls1012a_mdio_platform_data *minfo; ++ struct ls1012a_pfe_platform_data *pfe_info; ++ int err; ++ ++ /* Extract pltform data */ ++ pfe_info = (struct ls1012a_pfe_platform_data *) ++ pfe->dev->platform_data; ++ if (!pfe_info) { ++ pr_err( ++ "%s: pfe missing additional platform data\n" ++ , __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ einfo = (struct ls1012a_eth_platform_data *) ++ pfe_info->ls1012a_eth_pdata; ++ ++ /* einfo never be NULL, but no harm in having this check */ ++ if (!einfo) { ++ pr_err( ++ "%s: pfe missing additional gemacs platform data\n" ++ , __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ minfo = (struct ls1012a_mdio_platform_data *) ++ pfe_info->ls1012a_mdio_pdata; ++ ++ /* einfo never be NULL, but no harm in having this check */ ++ if (!minfo) { ++ pr_err( ++ "%s: pfe missing additional mdios platform data\n", ++ __func__); ++ err = -ENODEV; ++ goto err0; ++ } ++ ++ /* Create an ethernet device instance */ ++ ndev = alloc_etherdev_mq(sizeof(*priv), emac_txq_cnt); ++ ++ if (!ndev) { ++ pr_err("%s: gemac %d device allocation failed\n", ++ __func__, einfo[id].gem_id); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ priv = netdev_priv(ndev); ++ priv->ndev = ndev; ++ priv->id = einfo[id].gem_id; ++ priv->pfe = pfe; ++ ++ SET_NETDEV_DEV(priv->ndev, priv->pfe->dev); ++ ++ pfe->eth.eth_priv[id] = priv; ++ ++ /* Set the info in the priv to the current info */ ++ priv->einfo = &einfo[id]; ++ priv->EMAC_baseaddr = cbus_emac_base[id]; ++ priv->PHY_baseaddr = cbus_emac_base[0]; ++ priv->GPI_baseaddr = cbus_gpi_base[id]; ++ ++#define HIF_GEMAC_TMUQ_BASE 6 ++ priv->low_tmu_q = HIF_GEMAC_TMUQ_BASE + (id * 2); ++ priv->high_tmu_q = priv->low_tmu_q + 1; ++ ++ spin_lock_init(&priv->lock); ++ ++ pfe_eth_fast_tx_timeout_init(priv); ++ ++ /* Copy the station address into the dev structure, */ ++ memcpy(ndev->dev_addr, einfo[id].mac_addr, ETH_ALEN); ++ ++ /* Initialize mdio */ ++ if (minfo[id].enabled) { ++ err = pfe_eth_mdio_init(priv, &minfo[id]); ++ if (err) { ++ netdev_err(ndev, "%s: pfe_eth_mdio_init() failed\n", ++ __func__); ++ goto err2; ++ } ++ } ++ ++ ndev->mtu = 1500; ++ ++ /* Set MTU limits */ ++ ndev->min_mtu = ETH_MIN_MTU; ++ ndev->max_mtu = JUMBO_FRAME_SIZE; ++ ++ /* supported features */ ++ ndev->hw_features = NETIF_F_SG; ++ ++ /*Enable after checksum offload is validated */ ++ ndev->hw_features = NETIF_F_RXCSUM | NETIF_F_IP_CSUM | ++ NETIF_F_IPV6_CSUM | NETIF_F_SG; ++ ++ /* enabled by default */ ++ ndev->features = ndev->hw_features; ++ ++ priv->usr_features = ndev->features; ++ ++ ndev->netdev_ops = &pfe_netdev_ops; ++ ++ ndev->ethtool_ops = &pfe_ethtool_ops; ++ ++ /* Enable basic messages by default */ ++ priv->msg_enable = NETIF_MSG_IFUP | NETIF_MSG_IFDOWN | NETIF_MSG_LINK | ++ NETIF_MSG_PROBE; ++ ++ netif_napi_add(ndev, &priv->low_napi, pfe_eth_low_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ netif_napi_add(ndev, &priv->high_napi, pfe_eth_high_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ netif_napi_add(ndev, &priv->lro_napi, pfe_eth_lro_poll, ++ HIF_RX_POLL_WEIGHT - 16); ++ ++ err = register_netdev(ndev); ++ ++ if (err) { ++ netdev_err(ndev, "register_netdev() failed\n"); ++ goto err3; ++ } ++ device_init_wakeup(&ndev->dev, WAKE_MAGIC); ++ ++ if (!(priv->einfo->phy_flags & GEMAC_NO_PHY)) { ++ err = pfe_phy_init(ndev); ++ if (err) { ++ netdev_err(ndev, "%s: pfe_phy_init() failed\n", ++ __func__); ++ goto err4; ++ } ++ } ++ ++ netif_carrier_on(ndev); ++ ++ /* Create all the sysfs files */ ++ if (pfe_eth_sysfs_init(ndev)) ++ goto err4; ++ ++ netif_info(priv, probe, ndev, "%s: created interface, baseaddr: %p\n", ++ __func__, priv->EMAC_baseaddr); ++ ++ return 0; ++err4: ++ unregister_netdev(ndev); ++err3: ++ pfe_eth_mdio_exit(priv->mii_bus); ++err2: ++ free_netdev(priv->ndev); ++err0: ++ return err; ++} ++ ++/* pfe_eth_init ++ */ ++int pfe_eth_init(struct pfe *pfe) ++{ ++ int ii = 0; ++ int err; ++ ++ pr_info("%s\n", __func__); ++ ++ cbus_emac_base[0] = EMAC1_BASE_ADDR; ++ cbus_emac_base[1] = EMAC2_BASE_ADDR; ++ ++ cbus_gpi_base[0] = EGPI1_BASE_ADDR; ++ cbus_gpi_base[1] = EGPI2_BASE_ADDR; ++ ++ for (ii = 0; ii < NUM_GEMAC_SUPPORT; ii++) { ++ err = pfe_eth_init_one(pfe, ii); ++ if (err) ++ goto err0; ++ } ++ ++ return 0; ++ ++err0: ++ while (ii--) ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++ ++ /* Register three network devices in the kernel */ ++ return err; ++} ++ ++/* pfe_eth_exit_one ++ */ ++static void pfe_eth_exit_one(struct pfe_eth_priv_s *priv) ++{ ++ netif_info(priv, probe, priv->ndev, "%s\n", __func__); ++ ++ pfe_eth_sysfs_exit(priv->ndev); ++ ++ unregister_netdev(priv->ndev); ++ ++ if (!(priv->einfo->phy_flags & GEMAC_NO_PHY)) ++ pfe_phy_exit(priv->ndev); ++ ++ if (priv->mii_bus) ++ pfe_eth_mdio_exit(priv->mii_bus); ++ ++ free_netdev(priv->ndev); ++} ++ ++/* pfe_eth_exit ++ */ ++void pfe_eth_exit(struct pfe *pfe) ++{ ++ int ii; ++ ++ pr_info("%s\n", __func__); ++ ++ for (ii = NUM_GEMAC_SUPPORT - 1; ii >= 0; ii--) ++ pfe_eth_exit_one(pfe->eth.eth_priv[ii]); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_eth.h +@@ -0,0 +1,184 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_ETH_H_ ++#define _PFE_ETH_H_ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define PFE_ETH_NAPI_STATS ++#define PFE_ETH_TX_STATS ++ ++#define PFE_ETH_FRAGS_MAX (65536 / HIF_RX_PKT_MIN_SIZE) ++#define LRO_LEN_COUNT_MAX 32 ++#define LRO_NB_COUNT_MAX 32 ++ ++#define PFE_PAUSE_FLAG_ENABLE 1 ++#define PFE_PAUSE_FLAG_AUTONEG 2 ++ ++/* GEMAC configured by SW */ ++/* GEMAC configured by phy lines (not for MII/GMII) */ ++ ++#define GEMAC_SW_FULL_DUPLEX BIT(9) ++#define GEMAC_SW_SPEED_10M (0 << 12) ++#define GEMAC_SW_SPEED_100M BIT(12) ++#define GEMAC_SW_SPEED_1G (2 << 12) ++ ++#define GEMAC_NO_PHY BIT(0) ++ ++struct ls1012a_eth_platform_data { ++ /* device specific information */ ++ u32 device_flags; ++ char name[16]; ++ ++ /* board specific information */ ++ u32 mii_config; ++ u32 phy_flags; ++ u32 gem_id; ++ u32 bus_id; ++ u32 phy_id; ++ u32 mdio_muxval; ++ u8 mac_addr[ETH_ALEN]; ++}; ++ ++struct ls1012a_mdio_platform_data { ++ int enabled; ++ int irq[32]; ++ u32 phy_mask; ++ int mdc_div; ++}; ++ ++struct ls1012a_pfe_platform_data { ++ struct ls1012a_eth_platform_data ls1012a_eth_pdata[3]; ++ struct ls1012a_mdio_platform_data ls1012a_mdio_pdata[3]; ++}; ++ ++#define NUM_GEMAC_SUPPORT 2 ++#define DRV_NAME "pfe-eth" ++#define DRV_VERSION "1.0" ++ ++#define LS1012A_TX_FAST_RECOVERY_TIMEOUT_MS 3 ++#define TX_POLL_TIMEOUT_MS 1000 ++ ++#define EMAC_TXQ_CNT 16 ++#define EMAC_TXQ_DEPTH (HIF_TX_DESC_NT) ++ ++#define JUMBO_FRAME_SIZE 10258 ++/* ++ * Client Tx queue threshold, for txQ flush condition. ++ * It must be smaller than the queue size (in case we ever change it in the ++ * future). ++ */ ++#define HIF_CL_TX_FLUSH_MARK 32 ++ ++/* ++ * Max number of TX resources (HIF descriptors or skbs) that will be released ++ * in a single go during batch recycling. ++ * Should be lower than the flush mark so the SW can provide the HW with a ++ * continuous stream of packets instead of bursts. ++ */ ++#define TX_FREE_MAX_COUNT 16 ++#define EMAC_RXQ_CNT 3 ++#define EMAC_RXQ_DEPTH HIF_RX_DESC_NT ++/* make sure clients can receive a full burst of packets */ ++#define EMAC_RMON_TXBYTES_POS 0x00 ++#define EMAC_RMON_RXBYTES_POS 0x14 ++ ++#define EMAC_QUEUENUM_MASK (emac_txq_cnt - 1) ++#define EMAC_MDIO_TIMEOUT 1000 ++#define MAX_UC_SPEC_ADDR_REG 31 ++ ++struct pfe_eth_fast_timer { ++ int queuenum; ++ struct hrtimer timer; ++ void *base; ++}; ++ ++struct pfe_eth_priv_s { ++ struct pfe *pfe; ++ struct hif_client_s client; ++ struct napi_struct lro_napi; ++ struct napi_struct low_napi; ++ struct napi_struct high_napi; ++ int low_tmu_q; ++ int high_tmu_q; ++ struct net_device_stats stats; ++ struct net_device *ndev; ++ int id; ++ int promisc; ++ unsigned int msg_enable; ++ unsigned int usr_features; ++ ++ spinlock_t lock; /* protect member variables */ ++ unsigned int event_status; ++ int irq; ++ void *EMAC_baseaddr; ++ /* This points to the EMAC base from where we access PHY */ ++ void *PHY_baseaddr; ++ void *GPI_baseaddr; ++ /* PHY stuff */ ++ struct phy_device *phydev; ++ int oldspeed; ++ int oldduplex; ++ int oldlink; ++ /* mdio info */ ++ int mdc_div; ++ struct mii_bus *mii_bus; ++ struct clk *gemtx_clk; ++ int wol; ++ int pause_flag; ++ ++ int default_priority; ++ struct pfe_eth_fast_timer fast_tx_timeout[EMAC_TXQ_CNT]; ++ ++ struct ls1012a_eth_platform_data *einfo; ++ struct sk_buff *skb_inflight[EMAC_RXQ_CNT + 6]; ++ ++#ifdef PFE_ETH_TX_STATS ++ unsigned int stop_queue_total[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_hif_client[EMAC_TXQ_CNT]; ++ unsigned int stop_queue_credit[EMAC_TXQ_CNT]; ++ unsigned int clean_fail[EMAC_TXQ_CNT]; ++ unsigned int was_stopped[EMAC_TXQ_CNT]; ++#endif ++ ++#ifdef PFE_ETH_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ unsigned int frags_inflight[EMAC_RXQ_CNT + 6]; ++}; ++ ++struct pfe_eth { ++ struct pfe_eth_priv_s *eth_priv[3]; ++}; ++ ++int pfe_eth_init(struct pfe *pfe); ++void pfe_eth_exit(struct pfe *pfe); ++int pfe_eth_suspend(struct net_device *dev); ++int pfe_eth_resume(struct net_device *dev); ++int pfe_eth_mdio_reset(struct mii_bus *bus); ++ ++#endif /* _PFE_ETH_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.c +@@ -0,0 +1,314 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++/* ++ * @file ++ * Contains all the functions to handle parsing and loading of PE firmware ++ * files. ++ */ ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_firmware.h" ++#include "pfe/pfe.h" ++ ++static struct elf32_shdr *get_elf_section_header(const struct firmware *fw, ++ const char *section) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw->data; ++ struct elf32_shdr *shdr; ++ struct elf32_shdr *shdr_shstr; ++ Elf32_Off e_shoff = be32_to_cpu(elf_hdr->e_shoff); ++ Elf32_Half e_shentsize = be16_to_cpu(elf_hdr->e_shentsize); ++ Elf32_Half e_shnum = be16_to_cpu(elf_hdr->e_shnum); ++ Elf32_Half e_shstrndx = be16_to_cpu(elf_hdr->e_shstrndx); ++ Elf32_Off shstr_offset; ++ Elf32_Word sh_name; ++ const char *name; ++ int i; ++ ++ /* Section header strings */ ++ shdr_shstr = (struct elf32_shdr *)(fw->data + e_shoff + e_shstrndx * ++ e_shentsize); ++ shstr_offset = be32_to_cpu(shdr_shstr->sh_offset); ++ ++ for (i = 0; i < e_shnum; i++) { ++ shdr = (struct elf32_shdr *)(fw->data + e_shoff ++ + i * e_shentsize); ++ ++ sh_name = be32_to_cpu(shdr->sh_name); ++ ++ name = (const char *)(fw->data + shstr_offset + sh_name); ++ ++ if (!strcmp(name, section)) ++ return shdr; ++ } ++ ++ pr_err("%s: didn't find section %s\n", __func__, section); ++ ++ return NULL; ++} ++ ++#if defined(CFG_DIAGS) ++static int pfe_get_diags_info(const struct firmware *fw, struct pfe_diags_info ++ *diags_info) ++{ ++ struct elf32_shdr *shdr; ++ unsigned long offset, size; ++ ++ shdr = get_elf_section_header(fw, ".pfe_diags_str"); ++ if (shdr) { ++ offset = be32_to_cpu(shdr->sh_offset); ++ size = be32_to_cpu(shdr->sh_size); ++ diags_info->diags_str_base = be32_to_cpu(shdr->sh_addr); ++ diags_info->diags_str_size = size; ++ diags_info->diags_str_array = kmalloc(size, GFP_KERNEL); ++ memcpy(diags_info->diags_str_array, fw->data + offset, size); ++ ++ return 0; ++ } else { ++ return -1; ++ } ++} ++#endif ++ ++static void pfe_check_version_info(const struct firmware *fw) ++{ ++ /*static char *version = NULL;*/ ++ static char *version; ++ ++ struct elf32_shdr *shdr = get_elf_section_header(fw, ".version"); ++ ++ if (shdr) { ++ if (!version) { ++ /* ++ * this is the first fw we load, use its version ++ * string as reference (whatever it is) ++ */ ++ version = (char *)(fw->data + ++ be32_to_cpu(shdr->sh_offset)); ++ ++ pr_info("PFE binary version: %s\n", version); ++ } else { ++ /* ++ * already have loaded at least one firmware, check ++ * sequence can start now ++ */ ++ if (strcmp(version, (char *)(fw->data + ++ be32_to_cpu(shdr->sh_offset)))) { ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++ } ++ } else { ++ /* ++ * version cannot be verified, a potential issue that should ++ * be reported ++ */ ++ pr_info( ++ "WARNING: PFE firmware binaries from incompatible version\n"); ++ } ++} ++ ++/* PFE elf firmware loader. ++ * Loads an elf firmware image into a list of PE's (specified using a bitmask) ++ * ++ * @param pe_mask Mask of PE id's to load firmware to ++ * @param fw Pointer to the firmware image ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_load_elf(int pe_mask, const struct firmware *fw, struct pfe *pfe) ++{ ++ struct elf32_hdr *elf_hdr = (struct elf32_hdr *)fw->data; ++ Elf32_Half sections = be16_to_cpu(elf_hdr->e_shnum); ++ struct elf32_shdr *shdr = (struct elf32_shdr *)(fw->data + ++ be32_to_cpu(elf_hdr->e_shoff)); ++ int id, section; ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Some sanity checks */ ++ if (strncmp(&elf_hdr->e_ident[EI_MAG0], ELFMAG, SELFMAG)) { ++ pr_err("%s: incorrect elf magic number\n", __func__); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_CLASS] != ELFCLASS32) { ++ pr_err("%s: incorrect elf class(%x)\n", __func__, ++ elf_hdr->e_ident[EI_CLASS]); ++ return -EINVAL; ++ } ++ ++ if (elf_hdr->e_ident[EI_DATA] != ELFDATA2MSB) { ++ pr_err("%s: incorrect elf data(%x)\n", __func__, ++ elf_hdr->e_ident[EI_DATA]); ++ return -EINVAL; ++ } ++ ++ if (be16_to_cpu(elf_hdr->e_type) != ET_EXEC) { ++ pr_err("%s: incorrect elf file type(%x)\n", __func__, ++ be16_to_cpu(elf_hdr->e_type)); ++ return -EINVAL; ++ } ++ ++ for (section = 0; section < sections; section++, shdr++) { ++ if (!(be32_to_cpu(shdr->sh_flags) & (SHF_WRITE | SHF_ALLOC | ++ SHF_EXECINSTR))) ++ continue; ++ ++ for (id = 0; id < MAX_PE; id++) ++ if (pe_mask & (1 << id)) { ++ rc = pe_load_elf_section(id, fw->data, shdr, ++ pfe->dev); ++ if (rc < 0) ++ goto err; ++ } ++ } ++ ++ pfe_check_version_info(fw); ++ ++ return 0; ++ ++err: ++ return rc; ++} ++ ++/* PFE firmware initialization. ++ * Loads different firmware files from filesystem. ++ * Initializes PE IMEM/DMEM and UTIL-PE DDR ++ * Initializes control path symbol addresses (by looking them up in the elf ++ * firmware files ++ * Takes PE's out of reset ++ * ++ * @return 0 on success, a negative value on error ++ * ++ */ ++int pfe_firmware_init(struct pfe *pfe) ++{ ++ const struct firmware *class_fw, *tmu_fw; ++ int rc = 0; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ const char *util_fw_name; ++ const struct firmware *util_fw; ++#endif ++ ++ pr_info("%s\n", __func__); ++ ++ if (request_firmware(&class_fw, CLASS_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ CLASS_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err0; ++ } ++ ++ if (request_firmware(&tmu_fw, TMU_FIRMWARE_FILENAME, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ TMU_FIRMWARE_FILENAME); ++ rc = -ETIMEDOUT; ++ goto err1; ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_fw_name = UTIL_FIRMWARE_FILENAME; ++ ++ if (request_firmware(&util_fw, util_fw_name, pfe->dev)) { ++ pr_err("%s: request firmware %s failed\n", __func__, ++ util_fw_name); ++ rc = -ETIMEDOUT; ++ goto err2; ++ } ++#endif ++ rc = pfe_load_elf(CLASS_MASK, class_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: class firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(class_fw, &pfe->diags.class_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for class PEs\n"); ++ rc = 0; ++ } ++#endif ++ ++ rc = pfe_load_elf(TMU_MASK, tmu_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: tmu firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ rc = pfe_load_elf(UTIL_MASK, util_fw, pfe); ++ if (rc < 0) { ++ pr_err("%s: util firmware load failed\n", __func__); ++ goto err3; ++ } ++ ++#if defined(CFG_DIAGS) ++ rc = pfe_get_diags_info(util_fw, &pfe->diags.util_diags_info); ++ if (rc < 0) { ++ pr_warn( ++ "PFE diags won't be available for util PE\n"); ++ rc = 0; ++ } ++#endif ++ ++ util_enable(); ++#endif ++ ++ tmu_enable(0xf); ++ class_enable(); ++ ++err3: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ release_firmware(util_fw); ++ ++err2: ++#endif ++ release_firmware(tmu_fw); ++ ++err1: ++ release_firmware(class_fw); ++ ++err0: ++ return rc; ++} ++ ++/* PFE firmware cleanup ++ * Puts PE's in reset ++ * ++ * ++ */ ++void pfe_firmware_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ if (pe_reset_all(&pfe->ctrl) != 0) ++ pr_err("Error: Failed to stop PEs, PFE reload may not work correctly\n"); ++ ++ class_disable(); ++ tmu_disable(0xf); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_disable(); ++#endif ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_firmware.h +@@ -0,0 +1,32 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_FIRMWARE_H_ ++#define _PFE_FIRMWARE_H_ ++ ++#define CLASS_FIRMWARE_FILENAME "ppfe_class_ls1012a.elf" ++#define TMU_FIRMWARE_FILENAME "ppfe_tmu_ls1012a.elf" ++ ++#define PFE_FW_CHECK_PASS 0 ++#define PFE_FW_CHECK_FAIL 1 ++#define NUM_PFE_FW 3 ++ ++int pfe_firmware_init(struct pfe *pfe); ++void pfe_firmware_exit(struct pfe *pfe); ++ ++#endif /* _PFE_FIRMWARE_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hal.c +@@ -0,0 +1,1516 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe/pfe.h" ++ ++void *cbus_base_addr; ++void *ddr_base_addr; ++unsigned long ddr_phys_base_addr; ++unsigned int ddr_size; ++ ++static struct pe_info pe[MAX_PE]; ++ ++/* Initializes the PFE library. ++ * Must be called before using any of the library functions. ++ * ++ * @param[in] cbus_base CBUS virtual base address (as mapped in ++ * the host CPU address space) ++ * @param[in] ddr_base PFE DDR range virtual base address (as ++ * mapped in the host CPU address space) ++ * @param[in] ddr_phys_base PFE DDR range physical base address (as ++ * mapped in platform) ++ * @param[in] size PFE DDR range size (as defined by the host ++ * software) ++ */ ++void pfe_lib_init(void *cbus_base, void *ddr_base, unsigned long ddr_phys_base, ++ unsigned int size) ++{ ++ cbus_base_addr = cbus_base; ++ ddr_base_addr = ddr_base; ++ ddr_phys_base_addr = ddr_phys_base; ++ ddr_size = size; ++ ++ pe[CLASS0_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(0); ++ pe[CLASS0_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS0_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS0_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS0_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS1_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(1); ++ pe[CLASS1_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS1_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS1_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS1_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS2_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(2); ++ pe[CLASS2_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS2_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS2_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS2_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS3_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(3); ++ pe[CLASS3_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS3_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS3_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS3_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS4_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(4); ++ pe[CLASS4_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS4_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS4_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS4_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[CLASS5_ID].dmem_base_addr = CLASS_DMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_base_addr = CLASS_IMEM_BASE_ADDR(5); ++ pe[CLASS5_ID].pmem_size = CLASS_IMEM_SIZE; ++ pe[CLASS5_ID].mem_access_wdata = CLASS_MEM_ACCESS_WDATA; ++ pe[CLASS5_ID].mem_access_addr = CLASS_MEM_ACCESS_ADDR; ++ pe[CLASS5_ID].mem_access_rdata = CLASS_MEM_ACCESS_RDATA; ++ ++ pe[TMU0_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(0); ++ pe[TMU0_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU0_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU0_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU0_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU1_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(1); ++ pe[TMU1_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU1_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU1_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU1_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++ pe[TMU3_ID].dmem_base_addr = TMU_DMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_base_addr = TMU_IMEM_BASE_ADDR(3); ++ pe[TMU3_ID].pmem_size = TMU_IMEM_SIZE; ++ pe[TMU3_ID].mem_access_wdata = TMU_MEM_ACCESS_WDATA; ++ pe[TMU3_ID].mem_access_addr = TMU_MEM_ACCESS_ADDR; ++ pe[TMU3_ID].mem_access_rdata = TMU_MEM_ACCESS_RDATA; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pe[UTIL_ID].dmem_base_addr = UTIL_DMEM_BASE_ADDR; ++ pe[UTIL_ID].mem_access_wdata = UTIL_MEM_ACCESS_WDATA; ++ pe[UTIL_ID].mem_access_addr = UTIL_MEM_ACCESS_ADDR; ++ pe[UTIL_ID].mem_access_rdata = UTIL_MEM_ACCESS_RDATA; ++#endif ++} ++ ++/* Writes a buffer to PE internal memory from the host ++ * through indirect access registers. ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] mem_access_addr DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_mem_memcpy_to32(int id, u32 mem_access_addr, const void *src, unsigned ++int len) ++{ ++ u32 offset = 0, val, addr; ++ unsigned int len32 = len >> 2; ++ int i; ++ ++ addr = mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, 4); ++ ++ for (i = 0; i < len32; i++, offset += 4, src += 4) { ++ val = *(u32 *)src; ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr + offset, pe[id].mem_access_addr); ++ } ++ ++ len = (len & 0x3); ++ if (len) { ++ val = 0; ++ ++ addr = (mem_access_addr | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_BYTE_ENABLE(0, len)) + offset; ++ ++ for (i = 0; i < len; i++, src++) ++ val |= (*(u8 *)src) << (8 * i); ++ ++ writel(cpu_to_be32(val), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++ } ++} ++ ++/* Writes a buffer to PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst DMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_dmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].dmem_base_addr | dst | ++ PE_MEM_ACCESS_DMEM, src, len); ++} ++ ++/* Writes a buffer to PE internal program memory (PMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] src Buffer source address ++ * @param[in] dst PMEM destination address (must be 32bit ++ * aligned) ++ * @param[in] len Number of bytes to copy ++ */ ++void pe_pmem_memcpy_to32(int id, u32 dst, const void *src, unsigned int len) ++{ ++ pe_mem_memcpy_to32(id, pe[id].pmem_base_addr | (dst & (pe[id].pmem_size ++ - 1)) | PE_MEM_ACCESS_IMEM, src, len); ++} ++ ++/* Reads PE internal program memory (IMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., TMU3_ID) ++ * @param[in] addr PMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_pmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].pmem_base_addr | ((addr & ~0x3) & (pe[id].pmem_size - 1)) ++ | PE_MEM_ACCESS_IMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM write address (must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (maximum 4, must not ++ * cross 32bit boundaries) ++ */ ++void pe_dmem_write(int id, u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_WRITE | ++ PE_MEM_ACCESS_DMEM | PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ /* Indirect access interface is byte swapping data being written */ ++ writel(cpu_to_be32(val << (offset << 3)), pe[id].mem_access_wdata); ++ writel(addr, pe[id].mem_access_addr); ++} ++ ++/* Reads PE internal data memory (DMEM) from the host ++ * through indirect access registers. ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] addr DMEM read address (must be aligned on size) ++ * @param[in] size Number of bytes to read (maximum 4, must not ++ * cross 32bit boundaries) ++ * @return the data read (in PE endianness, i.e BE). ++ */ ++u32 pe_dmem_read(int id, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ addr = pe[id].dmem_base_addr | (addr & ~0x3) | PE_MEM_ACCESS_DMEM | ++ PE_MEM_ACCESS_BYTE_ENABLE(offset, size); ++ ++ writel(addr, pe[id].mem_access_addr); ++ ++ /* Indirect access interface is byte swapping data being read */ ++ val = be32_to_cpu(readl(pe[id].mem_access_rdata)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* This function is used to write to CLASS internal bus peripherals (ccu, ++ * pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] val value to write ++ * @param[in] addr Address to write to (must be aligned on size) ++ * @param[in] size Number of bytes to write (1, 2 or 4) ++ * ++ */ ++void class_bus_write(u32 val, u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | PE_MEM_ACCESS_WRITE | ++ (size << 24); ++ ++ writel(cpu_to_be32(val << (offset << 3)), CLASS_BUS_ACCESS_WDATA); ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++} ++ ++/* Reads from CLASS internal bus peripherals (ccu, pe-lem) from the host ++ * through indirect access registers. ++ * @param[in] addr Address to read from (must be aligned on size) ++ * @param[in] size Number of bytes to read (1, 2 or 4) ++ * @return the read data ++ * ++ */ ++u32 class_bus_read(u32 addr, u8 size) ++{ ++ u32 offset = addr & 0x3; ++ u32 mask = 0xffffffff >> ((4 - size) << 3); ++ u32 val; ++ ++ writel((addr & CLASS_BUS_ACCESS_BASE_MASK), CLASS_BUS_ACCESS_BASE); ++ ++ addr = (addr & ~CLASS_BUS_ACCESS_BASE_MASK) | (size << 24); ++ ++ writel(addr, CLASS_BUS_ACCESS_ADDR); ++ val = be32_to_cpu(readl(CLASS_BUS_ACCESS_RDATA)); ++ ++ return (val >> (offset << 3)) & mask; ++} ++ ++/* Writes data to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] src Buffer source address ++ * @param[in] len Number of bytes to copy ++ */ ++void class_pe_lmem_memcpy_to32(u32 dst, const void *src, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ for (i = 0; i < len32; i++, src += 4, dst += 4) ++ class_bus_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(*(u8 *)src, dst, 1); ++ src++; ++ dst++; ++ } ++} ++ ++/* Writes value to the cluster memory (PE_LMEM) ++ * @param[in] dst PE LMEM destination address (must be 32bit aligned) ++ * @param[in] val Value to write ++ * @param[in] len Number of bytes to write ++ */ ++void class_pe_lmem_memset(u32 dst, int val, unsigned int len) ++{ ++ u32 len32 = len >> 2; ++ int i; ++ ++ val = val | (val << 8) | (val << 16) | (val << 24); ++ ++ for (i = 0; i < len32; i++, dst += 4) ++ class_bus_write(val, dst, 4); ++ ++ if (len & 0x2) { ++ class_bus_write(val, dst, 2); ++ dst += 2; ++ } ++ ++ if (len & 0x1) { ++ class_bus_write(val, dst, 1); ++ dst++; ++ } ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ ++/* Writes UTIL program memory (DDR) from the host. ++ * ++ * @param[in] addr Address to write (virtual, must be aligned on size) ++ * @param[in] val Value to write (in PE endianness, i.e BE) ++ * @param[in] size Number of bytes to write (2 or 4) ++ */ ++static void util_pmem_write(u32 val, void *addr, u8 size) ++{ ++ void *addr64 = (void *)((unsigned long)addr & ~0x7); ++ unsigned long off = 8 - ((unsigned long)addr & 0x7) - size; ++ ++ /* ++ * IMEM should be loaded as a 64bit swapped value in a 64bit aligned ++ * location ++ */ ++ if (size == 4) ++ writel(be32_to_cpu(val), addr64 + off); ++ else ++ writew(be16_to_cpu((u16)val), addr64 + off); ++} ++ ++/* Writes a buffer to UTIL program memory (DDR) from the host. ++ * ++ * @param[in] dst Address to write (virtual, must be at least 16bit ++ * aligned) ++ * @param[in] src Buffer to write (in PE endianness, i.e BE, must have ++ * same alignment as dst) ++ * @param[in] len Number of bytes to write (must be at least 16bit ++ * aligned) ++ */ ++static void util_pmem_memcpy(void *dst, const void *src, unsigned int len) ++{ ++ unsigned int len32; ++ int i; ++ ++ if ((unsigned long)src & 0x2) { ++ util_pmem_write(*(u16 *)src, dst, 2); ++ src += 2; ++ dst += 2; ++ len -= 2; ++ } ++ ++ len32 = len >> 2; ++ ++ for (i = 0; i < len32; i++, dst += 4, src += 4) ++ util_pmem_write(*(u32 *)src, dst, 4); ++ ++ if (len & 0x2) ++ util_pmem_write(*(u16 *)src, dst, len & 0x2); ++} ++#endif ++ ++/* Loads an elf section into pmem ++ * Code needs to be at least 16bit aligned and only PROGBITS sections are ++ * supported ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ..., ++ * TMU3_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (id == UTIL_ID) { ++ pr_err("%s: unsupported pmem section for UTIL\n", ++ __func__); ++ return -EINVAL; ++ } ++#endif ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err("%s: load address(%x) is not 16bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err("%s: load size(%x) is not 16bit aligned\n", ++ __func__, size); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_pmem_memcpy_to32(id, addr, data + offset, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into dmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_dmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 size32 = size >> 2; ++ int i; ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ pe_dmem_memcpy_to32(id, addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ for (i = 0; i < size32; i++, addr += 4) ++ pe_dmem_write(id, 0, addr, 4); ++ ++ if (size & 0x3) ++ pe_dmem_write(id, 0, addr, size & 0x3); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into DDR ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_ddr_section(int id, const void *data, ++ struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ u32 flags = be32_to_cpu(shdr->sh_flags); ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ if (flags & SHF_EXECINSTR) { ++ if (id <= CLASS_MAX_ID) { ++ /* DO the loading only once in DDR */ ++ if (id == CLASS0_ID) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) rcvd\n", ++ __func__, addr, ++ (unsigned long)data + offset); ++ if (((unsigned long)(data + offset) ++ & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ } else if (id == UTIL_ID) { ++ if (((unsigned long)(data + offset) & 0x3) ++ != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n" ++ , __func__, addr, ++ (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x1) { ++ pr_err( ++ "%s: load address(%x) is not 16bit aligned\n" ++ , __func__, addr); ++ return -EINVAL; ++ } ++ ++ if (size & 0x1) { ++ pr_err( ++ "%s: load length(%x) is not 16bit aligned\n" ++ , __func__, size); ++ return -EINVAL; ++ } ++ ++ util_pmem_memcpy(DDR_PHYS_TO_VIRT( ++ DDR_PFE_TO_PHYS(addr)), ++ data + offset, size); ++ } ++#endif ++ } else { ++ pr_err( ++ "%s: unsupported ddr section type(%x) for PE(%d)\n" ++ , __func__, type, id); ++ return -EINVAL; ++ } ++ ++ } else { ++ memcpy(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), data ++ + offset, size); ++ } ++ ++ break; ++ ++ case SHT_NOBITS: ++ memset(DDR_PHYS_TO_VIRT(DDR_PFE_TO_PHYS(addr)), 0, size); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into pe lmem ++ * Data needs to be at least 32bit aligned, NOBITS sections are correctly ++ * initialized to 0 ++ * ++ * @param[in] id PE identification (CLASS0_ID,..., CLASS5_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++static int pe_load_pe_lmem_section(int id, const void *data, ++ struct elf32_shdr *shdr) ++{ ++ u32 offset = be32_to_cpu(shdr->sh_offset); ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ u32 type = be32_to_cpu(shdr->sh_type); ++ ++ if (id > CLASS_MAX_ID) { ++ pr_err( ++ "%s: unsupported pe-lmem section type(%x) for PE(%d)\n", ++ __func__, type, id); ++ return -EINVAL; ++ } ++ ++ if (((unsigned long)(data + offset) & 0x3) != (addr & 0x3)) { ++ pr_err( ++ "%s: load address(%x) and elf file address(%lx) don't have the same alignment\n", ++ __func__, addr, (unsigned long)data + offset); ++ ++ return -EINVAL; ++ } ++ ++ if (addr & 0x3) { ++ pr_err("%s: load address(%x) is not 32bit aligned\n", ++ __func__, addr); ++ return -EINVAL; ++ } ++ ++ switch (type) { ++ case SHT_PROGBITS: ++ class_pe_lmem_memcpy_to32(addr, data + offset, size); ++ break; ++ ++ case SHT_NOBITS: ++ class_pe_lmem_memset(addr, 0, size); ++ break; ++ ++ default: ++ pr_err("%s: unsupported section type(%x)\n", __func__, ++ type); ++ return -EINVAL; ++ } ++ ++ return 0; ++} ++ ++/* Loads an elf section into a PE ++ * For now only supports loading a section to dmem (all PE's), pmem (class and ++ * tmu PE's), ++ * DDDR (util PE code) ++ * ++ * @param[in] id PE identification (CLASS0_ID, ..., TMU0_ID, ++ * ..., UTIL_ID) ++ * @param[in] data pointer to the elf firmware ++ * @param[in] shdr pointer to the elf section header ++ * ++ */ ++int pe_load_elf_section(int id, const void *data, struct elf32_shdr *shdr, ++ struct device *dev) { ++ u32 addr = be32_to_cpu(shdr->sh_addr); ++ u32 size = be32_to_cpu(shdr->sh_size); ++ ++ if (IS_DMEM(addr, size)) ++ return pe_load_dmem_section(id, data, shdr); ++ else if (IS_PMEM(addr, size)) ++ return pe_load_pmem_section(id, data, shdr); ++ else if (IS_PFE_LMEM(addr, size)) ++ return 0; ++ else if (IS_PHYS_DDR(addr, size)) ++ return pe_load_ddr_section(id, data, shdr, dev); ++ else if (IS_PE_LMEM(addr, size)) ++ return pe_load_pe_lmem_section(id, data, shdr); ++ ++ pr_err("%s: unsupported memory range(%x)\n", __func__, ++ addr); ++ return 0; ++} ++ ++/**************************** BMU ***************************/ ++ ++/* Initializes a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_init(void *base, struct BMU_CFG *cfg) ++{ ++ bmu_disable(base); ++ ++ bmu_set_config(base, cfg); ++ ++ bmu_reset(base); ++} ++ ++/* Resets a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + BMU_CTRL); ++ ++ /* Wait for self clear */ ++ while (readl(base + BMU_CTRL) & CORE_SW_RESET) ++ ; ++} ++ ++/* Enabled a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + BMU_CTRL); ++} ++ ++/* Disables a BMU block. ++ * @param[in] base BMU block base address ++ */ ++void bmu_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + BMU_CTRL); ++} ++ ++/* Sets the configuration of a BMU block. ++ * @param[in] base BMU block base address ++ * @param[in] cfg BMU configuration ++ */ ++void bmu_set_config(void *base, struct BMU_CFG *cfg) ++{ ++ writel(cfg->baseaddr, base + BMU_UCAST_BASE_ADDR); ++ writel(cfg->count & 0xffff, base + BMU_UCAST_CONFIG); ++ writel(cfg->size & 0xffff, base + BMU_BUF_SIZE); ++ ++ /* Interrupts are never used */ ++ writel(cfg->low_watermark, base + BMU_LOW_WATERMARK); ++ writel(cfg->high_watermark, base + BMU_HIGH_WATERMARK); ++ writel(0x0, base + BMU_INT_ENABLE); ++} ++ ++/**************************** MTIP GEMAC ***************************/ ++ ++/* Enable Rx Checksum Engine. With this enabled, Frame with bad IP, ++ * TCP or UDP checksums are discarded ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_enable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* Disable Rx Checksum Engine. ++ * ++ * @param[in] base GEMAC base address. ++ */ ++void gemac_disable_rx_checksum_offload(void *base) ++{ ++ /*Do not find configuration to do this */ ++} ++ ++/* GEMAC set speed. ++ * @param[in] base GEMAC base address ++ * @param[in] speed GEMAC speed (10, 100 or 1000 Mbps) ++ */ ++void gemac_set_speed(void *base, enum mac_speed gem_speed) ++{ ++ u32 ecr = readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_SPEED; ++ u32 rcr = readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_RMII_10T; ++ ++ switch (gem_speed) { ++ case SPEED_10M: ++ rcr |= EMAC_RCNTRL_RMII_10T; ++ break; ++ ++ case SPEED_1000M: ++ ecr |= EMAC_ECNTRL_SPEED; ++ break; ++ ++ case SPEED_100M: ++ default: ++ /*It is in 100M mode */ ++ break; ++ } ++ writel(ecr, (base + EMAC_ECNTRL_REG)); ++ writel(rcr, (base + EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC set duplex. ++ * @param[in] base GEMAC base address ++ * @param[in] duplex GEMAC duplex mode (Full, Half) ++ */ ++void gemac_set_duplex(void *base, int duplex) ++{ ++ if (duplex == DUPLEX_HALF) { ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } else{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_FDEN, base ++ + EMAC_TCNTRL_REG); ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_DRT, (base ++ + EMAC_RCNTRL_REG)); ++ } ++} ++ ++/* GEMAC set mode. ++ * @param[in] base GEMAC base address ++ * @param[in] mode GEMAC operation mode (MII, RMII, RGMII, SGMII) ++ */ ++void gemac_set_mode(void *base, int mode) ++{ ++ u32 val = readl(base + EMAC_RCNTRL_REG); ++ ++ /*Remove loopbank*/ ++ val &= ~EMAC_RCNTRL_LOOP; ++ ++ /*Enable flow control and MII mode*/ ++ val |= (EMAC_RCNTRL_FCE | EMAC_RCNTRL_MII_MODE); ++ ++ writel(val, base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) | EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable(void *base) ++{ ++ writel(readl(base + EMAC_ECNTRL_REG) & ~EMAC_ECNTRL_ETHER_EN, base + ++ EMAC_ECNTRL_REG); ++} ++ ++/* GEMAC TX disable function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_tx_disable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) | EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++void gemac_tx_enable(void *base) ++{ ++ writel(readl(base + EMAC_TCNTRL_REG) & ~EMAC_TCNTRL_GTS, base + ++ EMAC_TCNTRL_REG); ++} ++ ++/* Sets the hash register of the MAC. ++ * This register is used for matching unicast and multicast frames. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] hash 64-bit hash to be configured. ++ */ ++void gemac_set_hash(void *base, struct pfe_mac_addr *hash) ++{ ++ writel(hash->bottom, base + EMAC_GALR); ++ writel(hash->top, base + EMAC_GAUR); ++} ++ ++void gemac_set_laddrN(void *base, struct pfe_mac_addr *address, ++ unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(htonl(address->bottom), base + EMAC_PHY_ADDR_LOW); ++ writel((htonl(address->top) | 0x8808), base + ++ EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(htonl(address->bottom), base + ((entry_index - 1) * 8) ++ + EMAC_SMAC_0_0); ++ writel((htonl(address->top) | 0x8808), base + ((entry_index - ++ 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++void gemac_clear_laddrN(void *base, unsigned int entry_index) ++{ ++ if ((entry_index < 1) || (entry_index > EMAC_SPEC_ADDR_MAX)) ++ return; ++ ++ entry_index = entry_index - 1; ++ if (entry_index < 1) { ++ writel(0, base + EMAC_PHY_ADDR_LOW); ++ writel(0, base + EMAC_PHY_ADDR_HIGH); ++ } else { ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_0); ++ writel(0, base + ((entry_index - 1) * 8) + EMAC_SMAC_0_1); ++ } ++} ++ ++/* Set the loopback mode of the MAC. This can be either no loopback for ++ * normal operation, local loopback through MAC internal loopback module or PHY ++ * loopback for external loopback through a PHY. This asserts the external ++ * loop pin. ++ * ++ * @param[in] base GEMAC base address. ++ * @param[in] gem_loop Loopback mode to be enabled. LB_LOCAL - MAC ++ * Loopback, ++ * LB_EXT - PHY Loopback. ++ */ ++void gemac_set_loop(void *base, enum mac_loop gem_loop) ++{ ++ pr_info("%s()\n", __func__); ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_LOOP, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC do not allow frames ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_copy_all(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_PROM, (base + ++ EMAC_RCNTRL_REG)); ++} ++ ++/* GEMAC allow broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_allow_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC no broadcast function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_no_broadcast(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_BC_REJ, base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable 1536 rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_1536_rx(void *base) ++{ ++ /* Set 1536 as Maximum frame length */ ++ writel(readl(base + EMAC_RCNTRL_REG) | (1536 << 16), base + ++ EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable jumbo function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_rx_jmb(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | (JUMBO_FRAME_SIZE << 16), base ++ + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable stacked vlan function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_stacked_vlan(void *base) ++{ ++ /* MTIP doesn't support stacked vlan */ ++} ++ ++/* GEMAC enable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) | EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC disable pause rx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_rx(void *base) ++{ ++ writel(readl(base + EMAC_RCNTRL_REG) & ~EMAC_RCNTRL_FCE, ++ base + EMAC_RCNTRL_REG); ++} ++ ++/* GEMAC enable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_enable_pause_tx(void *base) ++{ ++ writel(EMAC_RX_SECTION_EMPTY_V, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC disable pause tx function. ++ * @param[in] base GEMAC base address ++ */ ++void gemac_disable_pause_tx(void *base) ++{ ++ writel(0x0, base + EMAC_RX_SECTION_EMPTY); ++} ++ ++/* GEMAC wol configuration ++ * @param[in] base GEMAC base address ++ * @param[in] wol_conf WoL register configuration ++ */ ++void gemac_set_wol(void *base, u32 wol_conf) ++{ ++ u32 val = readl(base + EMAC_ECNTRL_REG); ++ ++ if (wol_conf) ++ val |= (EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ else ++ val &= ~(EMAC_ECNTRL_MAGIC_ENA | EMAC_ECNTRL_SLEEP); ++ writel(val, base + EMAC_ECNTRL_REG); ++} ++ ++/* Sets Gemac bus width to 64bit ++ * @param[in] base GEMAC base address ++ * @param[in] width gemac bus width to be set possible values are 32/64/128 ++ */ ++void gemac_set_bus_width(void *base, int width) ++{ ++} ++ ++/* Sets Gemac configuration. ++ * @param[in] base GEMAC base address ++ * @param[in] cfg GEMAC configuration ++ */ ++void gemac_set_config(void *base, struct gemac_cfg *cfg) ++{ ++ /*GEMAC config taken from VLSI */ ++ writel(0x00000004, base + EMAC_TFWR_STR_FWD); ++ writel(0x00000005, base + EMAC_RX_SECTION_FULL); ++ writel(0x00003fff, base + EMAC_TRUNC_FL); ++ writel(0x00000030, base + EMAC_TX_SECTION_EMPTY); ++ writel(0x00000000, base + EMAC_MIB_CTRL_STS_REG); ++ ++ gemac_set_mode(base, cfg->mode); ++ ++ gemac_set_speed(base, cfg->speed); ++ ++ gemac_set_duplex(base, cfg->duplex); ++} ++ ++/**************************** GPI ***************************/ ++ ++/* Initializes a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_init(void *base, struct gpi_cfg *cfg) ++{ ++ gpi_reset(base); ++ ++ gpi_disable(base); ++ ++ gpi_set_config(base, cfg); ++} ++ ++/* Resets a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_reset(void *base) ++{ ++ writel(CORE_SW_RESET, base + GPI_CTRL); ++} ++ ++/* Enables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_enable(void *base) ++{ ++ writel(CORE_ENABLE, base + GPI_CTRL); ++} ++ ++/* Disables a GPI block. ++ * @param[in] base GPI base address ++ */ ++void gpi_disable(void *base) ++{ ++ writel(CORE_DISABLE, base + GPI_CTRL); ++} ++ ++/* Sets the configuration of a GPI block. ++ * @param[in] base GPI base address ++ * @param[in] cfg GPI configuration ++ */ ++void gpi_set_config(void *base, struct gpi_cfg *cfg) ++{ ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_LMEM_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU1_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_LMEM_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_ALLOC_CTRL), base ++ + GPI_DDR_ALLOC_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), base ++ + GPI_DDR_FREE_ADDR); ++ writel(CBUS_VIRT_TO_PFE(CLASS_INQ_PKTPTR), base + GPI_CLASS_ADDR); ++ writel(DDR_HDR_SIZE, base + GPI_DDR_DATA_OFFSET); ++ writel(LMEM_HDR_SIZE, base + GPI_LMEM_DATA_OFFSET); ++ writel(0, base + GPI_LMEM_SEC_BUF_DATA_OFFSET); ++ writel(0, base + GPI_DDR_SEC_BUF_DATA_OFFSET); ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, base + GPI_HDR_SIZE); ++ writel((DDR_BUF_SIZE << 16) | LMEM_BUF_SIZE, base + GPI_BUF_SIZE); ++ ++ writel(((cfg->lmem_rtry_cnt << 16) | (GPI_DDR_BUF_EN << 1) | ++ GPI_LMEM_BUF_EN), base + GPI_RX_CONFIG); ++ writel(cfg->tmlf_txthres, base + GPI_TMLF_TX); ++ writel(cfg->aseq_len, base + GPI_DTX_ASEQ); ++ writel(1, base + GPI_TOE_CHKSUM_EN); ++ ++ if (cfg->mtip_pause_reg) { ++ writel(cfg->mtip_pause_reg, base + GPI_CSR_MTIP_PAUSE_REG); ++ writel(EGPI_PAUSE_TIME, base + GPI_TX_PAUSE_TIME); ++ } ++} ++ ++/**************************** CLASSIFIER ***************************/ ++ ++/* Initializes CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_init(struct class_cfg *cfg) ++{ ++ class_reset(); ++ ++ class_disable(); ++ ++ class_set_config(cfg); ++} ++ ++/* Resets CLASSIFIER block. ++ * ++ */ ++void class_reset(void) ++{ ++ writel(CORE_SW_RESET, CLASS_TX_CTRL); ++} ++ ++/* Enables all CLASS-PE's cores. ++ * ++ */ ++void class_enable(void) ++{ ++ writel(CORE_ENABLE, CLASS_TX_CTRL); ++} ++ ++/* Disables all CLASS-PE's cores. ++ * ++ */ ++void class_disable(void) ++{ ++ writel(CORE_DISABLE, CLASS_TX_CTRL); ++} ++ ++/* ++ * Sets the configuration of the CLASSIFIER block. ++ * @param[in] cfg CLASSIFIER configuration ++ */ ++void class_set_config(struct class_cfg *cfg) ++{ ++ u32 val; ++ ++ /* Initialize route table */ ++ if (!cfg->resume) ++ memset(DDR_PHYS_TO_VIRT(cfg->route_table_baseaddr), 0, (1 << ++ cfg->route_table_hash_bits) * CLASS_ROUTE_SIZE); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, CLASS_PE_SYS_CLK_RATIO); ++#endif ++ ++ writel((DDR_HDR_SIZE << 16) | LMEM_HDR_SIZE, CLASS_HDR_SIZE); ++ writel(LMEM_BUF_SIZE, CLASS_LMEM_BUF_SIZE); ++ writel(CLASS_ROUTE_ENTRY_SIZE(CLASS_ROUTE_SIZE) | ++ CLASS_ROUTE_HASH_SIZE(cfg->route_table_hash_bits), ++ CLASS_ROUTE_HASH_ENTRY_SIZE); ++ writel(HIF_PKT_CLASS_EN | HIF_PKT_OFFSET(sizeof(struct hif_hdr)), ++ CLASS_HIF_PARSE); ++ ++ val = HASH_CRC_PORT_IP | QB2BUS_LE; ++ ++#if defined(CONFIG_IP_ALIGNED) ++ val |= IP_ALIGNED; ++#endif ++ ++ /* ++ * Class PE packet steering will only work if TOE mode, bridge fetch or ++ * route fetch are enabled (see class/qb_fet.v). Route fetch would ++ * trigger additional memory copies (likely from DDR because of hash ++ * table size, which cannot be reduced because PE software still ++ * relies on hash value computed in HW), so when not in TOE mode we ++ * simply enable HW bridge fetch even though we don't use it. ++ */ ++ if (cfg->toe_mode) ++ val |= CLASS_TOE; ++ else ++ val |= HW_BRIDGE_FETCH; ++ ++ writel(val, CLASS_ROUTE_MULTI); ++ ++ writel(DDR_PHYS_TO_PFE(cfg->route_table_baseaddr), ++ CLASS_ROUTE_TABLE_BASE); ++ writel(CLASS_PE0_RO_DM_ADDR0_VAL, CLASS_PE0_RO_DM_ADDR0); ++ writel(CLASS_PE0_RO_DM_ADDR1_VAL, CLASS_PE0_RO_DM_ADDR1); ++ writel(CLASS_PE0_QB_DM_ADDR0_VAL, CLASS_PE0_QB_DM_ADDR0); ++ writel(CLASS_PE0_QB_DM_ADDR1_VAL, CLASS_PE0_QB_DM_ADDR1); ++ writel(CBUS_VIRT_TO_PFE(TMU_PHY_INQ_PKTPTR), CLASS_TM_INQ_ADDR); ++ ++ writel(23, CLASS_AFULL_THRES); ++ writel(23, CLASS_TSQ_FIFO_THRES); ++ ++ writel(24, CLASS_MAX_BUF_CNT); ++ writel(24, CLASS_TSQ_MAX_CNT); ++} ++ ++/**************************** TMU ***************************/ ++ ++void tmu_reset(void) ++{ ++ writel(SW_RESET, TMU_CTRL); ++} ++ ++/* Initializes TMU block. ++ * @param[in] cfg TMU configuration ++ */ ++void tmu_init(struct tmu_cfg *cfg) ++{ ++ int q, phyno; ++ ++ tmu_disable(0xF); ++ mdelay(10); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* keep in soft reset */ ++ writel(SW_RESET, TMU_CTRL); ++#endif ++ writel(0x3, TMU_SYS_GENERIC_CONTROL); ++ writel(750, TMU_INQ_WATERMARK); ++ writel(CBUS_VIRT_TO_PFE(EGPI1_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY0_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(EGPI2_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY1_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HGPI_BASE_ADDR + ++ GPI_INQ_PKTPTR), TMU_PHY3_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(HIF_NOCPY_RX_INQ0_PKTPTR), TMU_PHY4_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(UTIL_INQ_PKTPTR), TMU_PHY5_INQ_ADDR); ++ writel(CBUS_VIRT_TO_PFE(BMU2_BASE_ADDR + BMU_FREE_CTRL), ++ TMU_BMU_INQ_ADDR); ++ ++ writel(0x3FF, TMU_TDQ0_SCH_CTRL); /* ++ * enabling all 10 ++ * schedulers [9:0] of each TDQ ++ */ ++ writel(0x3FF, TMU_TDQ1_SCH_CTRL); ++ writel(0x3FF, TMU_TDQ3_SCH_CTRL); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(cfg->pe_sys_clk_ratio, TMU_PE_SYS_CLK_RATIO); ++#endif ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ writel(DDR_PHYS_TO_PFE(cfg->llm_base_addr), TMU_LLM_BASE_ADDR); ++ /* Extra packet pointers will be stored from this address onwards */ ++ ++ writel(cfg->llm_queue_len, TMU_LLM_QUE_LEN); ++ writel(5, TMU_TDQ_IIFG_CFG); ++ writel(DDR_BUF_SIZE, TMU_BMU_BUF_SIZE); ++ ++ writel(0x0, TMU_CTRL); ++ ++ /* MEM init */ ++ pr_info("%s: mem init\n", __func__); ++ writel(MEM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & MEM_INIT_DONE)) ++ ; ++ ++ /* LLM init */ ++ pr_info("%s: lmem init\n", __func__); ++ writel(LLM_INIT, TMU_CTRL); ++ ++ while (!(readl(TMU_CTRL) & LLM_INIT_DONE)) ++ ; ++#endif ++ /* set up each queue for tail drop */ ++ for (phyno = 0; phyno < 4; phyno++) { ++ if (phyno == 2) ++ continue; ++ for (q = 0; q < 16; q++) { ++ u32 qdepth; ++ ++ writel((phyno << 8) | q, TMU_TEQ_CTRL); ++ writel(1 << 22, TMU_TEQ_QCFG); /*Enable tail drop */ ++ ++ if (phyno == 3) ++ qdepth = DEFAULT_TMU3_QDEPTH; ++ else ++ qdepth = (q == 0) ? DEFAULT_Q0_QDEPTH : ++ DEFAULT_MAX_QDEPTH; ++ ++ /* LOG: 68855 */ ++ /* ++ * The following is a workaround for the reordered ++ * packet and BMU2 buffer leakage issue. ++ */ ++ if (CHIP_REVISION() == 0) ++ qdepth = 31; ++ ++ writel(qdepth << 18, TMU_TEQ_HW_PROB_CFG2); ++ writel(qdepth >> 14, TMU_TEQ_HW_PROB_CFG3); ++ } ++ } ++ ++#ifdef CFG_LRO ++ /* Set TMU-3 queue 5 (LRO) in no-drop mode */ ++ writel((3 << 8) | TMU_QUEUE_LRO, TMU_TEQ_CTRL); ++ writel(0, TMU_TEQ_QCFG); ++#endif ++ ++ writel(0x05, TMU_TEQ_DISABLE_DROPCHK); ++ ++ writel(0x0, TMU_CTRL); ++} ++ ++/* Enables TMU-PE cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_enable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) | (pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* Disables TMU cores. ++ * @param[in] pe_mask TMU PE mask ++ */ ++void tmu_disable(u32 pe_mask) ++{ ++ writel(readl(TMU_TX_CTRL) & ~(pe_mask & 0xF), TMU_TX_CTRL); ++} ++ ++/* This will return the tmu queue status ++ * @param[in] if_id gem interface id or TMU index ++ * @return returns the bit mask of busy queues, zero means all ++ * queues are empty ++ */ ++u32 tmu_qstatus(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, tmu_qstatus), 4)); ++} ++ ++u32 tmu_pkts_processed(u32 if_id) ++{ ++ return cpu_to_be32(pe_dmem_read(TMU0_ID + if_id, TMU_DM_PESTATUS + ++ offsetof(struct pe_status, rx), 4)); ++} ++ ++/**************************** UTIL ***************************/ ++ ++/* Resets UTIL block. ++ */ ++void util_reset(void) ++{ ++ writel(CORE_SW_RESET, UTIL_TX_CTRL); ++} ++ ++/* Initializes UTIL block. ++ * @param[in] cfg UTIL configuration ++ */ ++void util_init(struct util_cfg *cfg) ++{ ++ writel(cfg->pe_sys_clk_ratio, UTIL_PE_SYS_CLK_RATIO); ++} ++ ++/* Enables UTIL-PE core. ++ * ++ */ ++void util_enable(void) ++{ ++ writel(CORE_ENABLE, UTIL_TX_CTRL); ++} ++ ++/* Disables UTIL-PE core. ++ * ++ */ ++void util_disable(void) ++{ ++ writel(CORE_DISABLE, UTIL_TX_CTRL); ++} ++ ++/**************************** HIF ***************************/ ++/* Initializes HIF copy block. ++ * ++ */ ++void hif_init(void) ++{ ++ /*Initialize HIF registers*/ ++ writel((HIF_RX_POLL_CTRL_CYCLE << 16) | HIF_TX_POLL_CTRL_CYCLE, ++ HIF_POLL_CTRL); ++} ++ ++/* Enable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_enable(void) ++{ ++ writel(HIF_CTRL_DMA_EN, HIF_TX_CTRL); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_TXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif tx DMA and interrupt ++ * ++ */ ++void hif_tx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_TX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_TXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} ++ ++/* Enable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_enable(void) ++{ ++ hif_rx_dma_start(); ++ writel((readl(HIF_INT_ENABLE) | HIF_INT_EN | HIF_RXPKT_INT_EN), ++ HIF_INT_ENABLE); ++} ++ ++/* Disable hif rx DMA and interrupt ++ * ++ */ ++void hif_rx_disable(void) ++{ ++ u32 hif_int; ++ ++ writel(0, HIF_RX_CTRL); ++ ++ hif_int = readl(HIF_INT_ENABLE); ++ hif_int &= HIF_RXPKT_INT_EN; ++ writel(hif_int, HIF_INT_ENABLE); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.c +@@ -0,0 +1,1072 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define HIF_INT_MASK (HIF_INT | HIF_RXPKT_INT | HIF_TXPKT_INT) ++ ++unsigned char napi_first_batch; ++ ++static void pfe_tx_do_cleanup(unsigned long data); ++ ++static int pfe_hif_alloc_descr(struct pfe_hif *hif) ++{ ++ void *addr; ++ dma_addr_t dma_addr; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ addr = dma_alloc_coherent(pfe->dev, ++ HIF_RX_DESC_NT * sizeof(struct hif_desc) + ++ HIF_TX_DESC_NT * sizeof(struct hif_desc), ++ &dma_addr, GFP_KERNEL); ++ ++ if (!addr) { ++ pr_err("%s: Could not allocate buffer descriptors!\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err0; ++ } ++ ++ hif->descr_baseaddr_p = dma_addr; ++ hif->descr_baseaddr_v = addr; ++ hif->rx_ring_size = HIF_RX_DESC_NT; ++ hif->tx_ring_size = HIF_TX_DESC_NT; ++ ++ return 0; ++ ++err0: ++ return err; ++} ++ ++#if defined(LS1012A_PFE_RESET_WA) ++static void pfe_hif_disable_rx_desc(struct pfe_hif *hif) ++{ ++ int ii; ++ struct hif_desc *desc = hif->rx_base; ++ ++ /*Mark all descriptors as LAST_BD */ ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ desc->ctrl |= BD_CTRL_LAST_BD; ++ desc++; ++ } ++} ++ ++struct class_rx_hdr_t { ++ u32 next_ptr; /* ptr to the start of the first DDR buffer */ ++ u16 length; /* total packet length */ ++ u16 phyno; /* input physical port number */ ++ u32 status; /* gemac status bits */ ++ u32 status2; /* reserved for software usage */ ++}; ++ ++/* STATUS_BAD_FRAME_ERR is set for all errors (including checksums if enabled) ++ * except overflow ++ */ ++#define STATUS_BAD_FRAME_ERR BIT(16) ++#define STATUS_LENGTH_ERR BIT(17) ++#define STATUS_CRC_ERR BIT(18) ++#define STATUS_TOO_SHORT_ERR BIT(19) ++#define STATUS_TOO_LONG_ERR BIT(20) ++#define STATUS_CODE_ERR BIT(21) ++#define STATUS_MC_HASH_MATCH BIT(22) ++#define STATUS_CUMULATIVE_ARC_HIT BIT(23) ++#define STATUS_UNICAST_HASH_MATCH BIT(24) ++#define STATUS_IP_CHECKSUM_CORRECT BIT(25) ++#define STATUS_TCP_CHECKSUM_CORRECT BIT(26) ++#define STATUS_UDP_CHECKSUM_CORRECT BIT(27) ++#define STATUS_OVERFLOW_ERR BIT(28) /* GPI error */ ++#define MIN_PKT_SIZE 64 ++ ++static inline void copy_to_lmem(u32 *dst, u32 *src, int len) ++{ ++ int i; ++ ++ for (i = 0; i < len; i += sizeof(u32)) { ++ *dst = htonl(*src); ++ dst++; src++; ++ } ++} ++ ++static void send_dummy_pkt_to_hif(void) ++{ ++ void *lmem_ptr, *ddr_ptr, *lmem_virt_addr; ++ u32 physaddr; ++ struct class_rx_hdr_t local_hdr; ++ static u32 dummy_pkt[] = { ++ 0x33221100, 0x2b785544, 0xd73093cb, 0x01000608, ++ 0x04060008, 0x2b780200, 0xd73093cb, 0x0a01a8c0, ++ 0x33221100, 0xa8c05544, 0x00000301, 0x00000000, ++ 0x00000000, 0x00000000, 0x00000000, 0xbe86c51f }; ++ ++ ddr_ptr = (void *)((u64)readl(BMU2_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!ddr_ptr) ++ return; ++ ++ lmem_ptr = (void *)((u64)readl(BMU1_BASE_ADDR + BMU_ALLOC_CTRL)); ++ if (!lmem_ptr) ++ return; ++ ++ pr_info("Sending a dummy pkt to HIF %p %p\n", ddr_ptr, lmem_ptr); ++ physaddr = (u32)DDR_VIRT_TO_PFE(ddr_ptr); ++ ++ lmem_virt_addr = (void *)CBUS_PFE_TO_VIRT((unsigned long int)lmem_ptr); ++ ++ local_hdr.phyno = htons(0); /* RX_PHY_0 */ ++ local_hdr.length = htons(MIN_PKT_SIZE); ++ ++ local_hdr.next_ptr = htonl((u32)physaddr); ++ /*Mark checksum is correct */ ++ local_hdr.status = htonl((STATUS_IP_CHECKSUM_CORRECT | ++ STATUS_UDP_CHECKSUM_CORRECT | ++ STATUS_TCP_CHECKSUM_CORRECT | ++ STATUS_UNICAST_HASH_MATCH | ++ STATUS_CUMULATIVE_ARC_HIT)); ++ copy_to_lmem((u32 *)lmem_virt_addr, (u32 *)&local_hdr, ++ sizeof(local_hdr)); ++ ++ copy_to_lmem((u32 *)(lmem_virt_addr + LMEM_HDR_SIZE), (u32 *)dummy_pkt, ++ 0x40); ++ ++ writel((unsigned long int)lmem_ptr, CLASS_INQ_PKTPTR); ++} ++ ++void pfe_hif_rx_idle(struct pfe_hif *hif) ++{ ++ int hif_stop_loop = 10; ++ u32 rx_status; ++ ++ pfe_hif_disable_rx_desc(hif); ++ pr_info("Bringing hif to idle state..."); ++ writel(0, HIF_INT_ENABLE); ++ /*If HIF Rx BDP is busy send a dummy packet */ ++ do { ++ rx_status = readl(HIF_RX_STATUS); ++ if (rx_status & BDP_CSR_RX_DMA_ACTV) ++ send_dummy_pkt_to_hif(); ++ ++ usleep_range(100, 150); ++ } while (--hif_stop_loop); ++ ++ if (readl(HIF_RX_STATUS) & BDP_CSR_RX_DMA_ACTV) ++ pr_info("Failed\n"); ++ else ++ pr_info("Done\n"); ++} ++#endif ++ ++static void pfe_hif_free_descr(struct pfe_hif *hif) ++{ ++ pr_info("%s\n", __func__); ++ ++ dma_free_coherent(pfe->dev, ++ hif->rx_ring_size * sizeof(struct hif_desc) + ++ hif->tx_ring_size * sizeof(struct hif_desc), ++ hif->descr_baseaddr_v, hif->descr_baseaddr_p); ++} ++ ++void pfe_hif_desc_dump(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ unsigned long desc_p; ++ int ii = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ desc = hif->rx_base; ++ desc_p = (u32)((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Rx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->rx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++ ++ desc = hif->tx_base; ++ desc_p = ((u64)desc - (u64)hif->descr_baseaddr_v + ++ hif->descr_baseaddr_p); ++ ++ pr_info("HIF Tx desc base %p physical %x\n", desc, (u32)desc_p); ++ for (ii = 0; ii < hif->tx_ring_size; ii++) { ++ pr_info("status: %08x, ctrl: %08x, data: %08x, next: %x\n", ++ readl(&desc->status), readl(&desc->ctrl), ++ readl(&desc->data), readl(&desc->next)); ++ desc++; ++ } ++} ++ ++/* pfe_hif_release_buffers */ ++static void pfe_hif_release_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc; ++ int i = 0; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ ++ pr_info("%s\n", __func__); ++ ++ /*Free Rx buffers */ ++ desc = hif->rx_base; ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ if (readl(&desc->data)) { ++ if ((i < hif->shm->rx_buf_pool_cnt) && ++ (!hif->shm->rx_buf_pool[i])) { ++ /* ++ * dma_unmap_single(hif->dev, desc->data, ++ * hif->rx_buf_len[i], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, ++ DDR_PFE_TO_PHYS( ++ readl(&desc->data)), ++ hif->rx_buf_len[i], ++ DMA_FROM_DEVICE); ++ hif->shm->rx_buf_pool[i] = hif->rx_buf_addr[i]; ++ } else { ++ pr_err("%s: buffer pool already full\n" ++ , __func__); ++ } ++ } ++ ++ writel(0, &desc->data); ++ writel(0, &desc->status); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++} ++ ++/* ++ * pfe_hif_init_buffers ++ * This function initializes the HIF Rx/Tx ring descriptors and ++ * initialize Rx queue with buffers. ++ */ ++static int pfe_hif_init_buffers(struct pfe_hif *hif) ++{ ++ struct hif_desc *desc, *first_desc_p; ++ u32 data; ++ int i = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ /* Check enough Rx buffers available in the shared memory */ ++ if (hif->shm->rx_buf_pool_cnt < hif->rx_ring_size) ++ return -ENOMEM; ++ ++ hif->rx_base = hif->descr_baseaddr_v; ++ memset(hif->rx_base, 0, hif->rx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize Rx descriptors */ ++ desc = hif->rx_base; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p; ++ ++ for (i = 0; i < hif->rx_ring_size; i++) { ++ /* Initialize Rx buffers from the shared memory */ ++ ++ data = (u32)dma_map_single(hif->dev, hif->shm->rx_buf_pool[i], ++ pfe_pkt_size, DMA_FROM_DEVICE); ++ hif->rx_buf_addr[i] = hif->shm->rx_buf_pool[i]; ++ hif->rx_buf_len[i] = pfe_pkt_size; ++ hif->shm->rx_buf_pool[i] = NULL; ++ ++ if (likely(dma_mapping_error(hif->dev, data) == 0)) { ++ writel(DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ pr_err("%s : low on mem\n", __func__); ++ ++ goto err; ++ } ++ ++ writel(0, &desc->status); ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM ++ | BD_CTRL_DIR | BD_CTRL_DESC_EN ++ | BD_BUF_LEN(pfe_pkt_size)), &desc->ctrl); ++ ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one*/ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ ++ hif->rxtoclean_index = 0; ++ ++ /*Initialize Rx buffer descriptor ring base address */ ++ writel(DDR_PHYS_TO_PFE(hif->descr_baseaddr_p), HIF_RX_BDP_ADDR); ++ ++ hif->tx_base = hif->rx_base + hif->rx_ring_size; ++ first_desc_p = (struct hif_desc *)hif->descr_baseaddr_p + ++ hif->rx_ring_size; ++ memset(hif->tx_base, 0, hif->tx_ring_size * sizeof(struct hif_desc)); ++ ++ /*Initialize tx descriptors */ ++ desc = hif->tx_base; ++ ++ for (i = 0; i < hif->tx_ring_size; i++) { ++ /* Chain descriptors */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p + i + 1), &desc->next); ++ writel(0, &desc->ctrl); ++ desc++; ++ } ++ ++ /* Overwrite last descriptor to chain it to first one */ ++ desc--; ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), &desc->next); ++ hif->txavail = hif->tx_ring_size; ++ hif->txtosend = 0; ++ hif->txtoclean = 0; ++ hif->txtoflush = 0; ++ ++ /*Initialize Tx buffer descriptor ring base address */ ++ writel((u32)DDR_PHYS_TO_PFE(first_desc_p), HIF_TX_BDP_ADDR); ++ ++ return 0; ++ ++err: ++ pfe_hif_release_buffers(hif); ++ return -ENOMEM; ++} ++ ++/* ++ * pfe_hif_client_register ++ * ++ * This function used to register a client driver with the HIF driver. ++ * ++ * Return value: ++ * 0 - on Successful registration ++ */ ++static int pfe_hif_client_register(struct pfe_hif *hif, u32 client_id, ++ struct hif_client_shm *client_shm) ++{ ++ struct hif_client *client = &hif->client[client_id]; ++ u32 i, cnt; ++ struct rx_queue_desc *rx_qbase; ++ struct tx_queue_desc *tx_qbase; ++ struct hif_rx_queue *rx_queue; ++ struct hif_tx_queue *tx_queue; ++ int err = 0; ++ ++ pr_info("%s\n", __func__); ++ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d already registered\n", ++ __func__, client_id); ++ err = -1; ++ goto unlock; ++ } ++ ++ memset(client, 0, sizeof(struct hif_client)); ++ ++ /* Initialize client Rx queues baseaddr, size */ ++ ++ cnt = CLIENT_CTRL_RX_Q_CNT(client_shm->ctrl); ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->rx_qn = cnt; ++ rx_qbase = (struct rx_queue_desc *)client_shm->rx_qbase; ++ for (i = 0; i < cnt; i++) { ++ rx_queue = &client->rx_q[i]; ++ rx_queue->base = rx_qbase + i * client_shm->rx_qsize; ++ rx_queue->size = client_shm->rx_qsize; ++ rx_queue->write_idx = 0; ++ } ++ ++ /* Initialize client Tx queues baseaddr, size */ ++ cnt = CLIENT_CTRL_TX_Q_CNT(client_shm->ctrl); ++ ++ /* Check if client is requesting for more queues than supported */ ++ if (cnt > HIF_CLIENT_QUEUES_MAX) ++ cnt = HIF_CLIENT_QUEUES_MAX; ++ ++ client->tx_qn = cnt; ++ tx_qbase = (struct tx_queue_desc *)client_shm->tx_qbase; ++ for (i = 0; i < cnt; i++) { ++ tx_queue = &client->tx_q[i]; ++ tx_queue->base = tx_qbase + i * client_shm->tx_qsize; ++ tx_queue->size = client_shm->tx_qsize; ++ tx_queue->ack_idx = 0; ++ } ++ ++ set_bit(client_id, &hif->shm->g_client_status[0]); ++ ++unlock: ++ spin_unlock_bh(&hif->tx_lock); ++ ++ return err; ++} ++ ++/* ++ * pfe_hif_client_unregister ++ * ++ * This function used to unregister a client from the HIF driver. ++ * ++ */ ++static void pfe_hif_client_unregister(struct pfe_hif *hif, u32 client_id) ++{ ++ pr_info("%s\n", __func__); ++ ++ /* ++ * Mark client as no longer available (which prevents further packet ++ * receive for this client) ++ */ ++ spin_lock_bh(&hif->tx_lock); ++ ++ if (!test_bit(client_id, &hif->shm->g_client_status[0])) { ++ pr_err("%s: client %d not registered\n", __func__, ++ client_id); ++ ++ spin_unlock_bh(&hif->tx_lock); ++ return; ++ } ++ ++ clear_bit(client_id, &hif->shm->g_client_status[0]); ++ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++/* ++ * client_put_rxpacket- ++ * This functions puts the Rx pkt in the given client Rx queue. ++ * It actually swap the Rx pkt in the client Rx descriptor buffer ++ * and returns the free buffer from it. ++ * ++ * If the function returns NULL means client Rx queue is full and ++ * packet couldn't send to client queue. ++ */ ++static void *client_put_rxpacket(struct hif_rx_queue *queue, void *pkt, u32 len, ++ u32 flags, u32 client_ctrl, u32 *rem_len) ++{ ++ void *free_pkt = NULL; ++ struct rx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ if (page_mode) { ++ int rem_page_size = PAGE_SIZE - ++ PRESENT_OFST_IN_PAGE(pkt); ++ int cur_pkt_size = ROUND_MIN_RX_SIZE(len + ++ pfe_pkt_headroom); ++ *rem_len = (rem_page_size - cur_pkt_size); ++ if (*rem_len) { ++ free_pkt = pkt + cur_pkt_size; ++ get_page(virt_to_page(free_pkt)); ++ } else { ++ free_pkt = (void ++ *)__get_free_page(GFP_ATOMIC | GFP_DMA_PFE); ++ *rem_len = pfe_pkt_size; ++ } ++ } else { ++ free_pkt = kmalloc(PFE_BUF_SIZE, GFP_ATOMIC | ++ GFP_DMA_PFE); ++ *rem_len = PFE_BUF_SIZE - pfe_pkt_headroom; ++ } ++ ++ if (free_pkt) { ++ desc->data = pkt; ++ desc->client_ctrl = client_ctrl; ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ writel(CL_DESC_BUF_LEN(len) | flags, &desc->ctrl); ++ queue->write_idx = (queue->write_idx + 1) ++ & (queue->size - 1); ++ ++ free_pkt += pfe_pkt_headroom; ++ } ++ } ++ ++ return free_pkt; ++} ++ ++/* ++ * pfe_hif_rx_process- ++ * This function does pfe hif rx queue processing. ++ * Dequeue packet from Rx queue and send it to corresponding client queue ++ */ ++static int pfe_hif_rx_process(struct pfe_hif *hif, int budget) ++{ ++ struct hif_desc *desc; ++ struct hif_hdr *pkt_hdr; ++ struct __hif_hdr hif_hdr; ++ void *free_buf; ++ int rtc, len, rx_processed = 0; ++ struct __hif_desc local_desc; ++ int flags; ++ unsigned int desc_p; ++ unsigned int buf_size = 0; ++ ++ spin_lock_bh(&hif->lock); ++ ++ rtc = hif->rxtoclean_index; ++ ++ while (rx_processed < budget) { ++ desc = hif->rx_base + rtc; ++ ++ __memcpy12(&local_desc, desc); ++ ++ /* ACK pending Rx interrupt */ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) { ++ writel(HIF_INT | HIF_RXPKT_INT, HIF_INT_SRC); ++ ++ if (rx_processed == 0) { ++ if (napi_first_batch == 1) { ++ desc_p = hif->descr_baseaddr_p + ++ ((unsigned long int)(desc) - ++ (unsigned long ++ int)hif->descr_baseaddr_v); ++ napi_first_batch = 0; ++ } ++ } ++ ++ __memcpy12(&local_desc, desc); ++ ++ if (local_desc.ctrl & BD_CTRL_DESC_EN) ++ break; ++ } ++ ++ napi_first_batch = 0; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_DESC_COUNT]++; ++#endif ++ len = BD_BUF_LEN(local_desc.ctrl); ++ /* ++ * dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ * hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, DDR_PFE_TO_PHYS(local_desc.data), ++ hif->rx_buf_len[rtc], DMA_FROM_DEVICE); ++ ++ pkt_hdr = (struct hif_hdr *)hif->rx_buf_addr[rtc]; ++ ++ /* Track last HIF header received */ ++ if (!hif->started) { ++ hif->started = 1; ++ ++ __memcpy8(&hif_hdr, pkt_hdr); ++ ++ hif->qno = hif_hdr.hdr.q_num; ++ hif->client_id = hif_hdr.hdr.client_id; ++ hif->client_ctrl = (hif_hdr.hdr.client_ctrl1 << 16) | ++ hif_hdr.hdr.client_ctrl; ++ flags = CL_DESC_FIRST; ++ ++ } else { ++ flags = 0; ++ } ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) ++ flags |= CL_DESC_LAST; ++ ++ /* Check for valid client id and still registered */ ++ if ((hif->client_id >= HIF_CLIENTS_MAX) || ++ !(test_bit(hif->client_id, ++ &hif->shm->g_client_status[0]))) { ++ printk_ratelimited("%s: packet with invalid client id %d q_num %d\n", ++ __func__, ++ hif->client_id, ++ hif->qno); ++ ++ free_buf = pkt_hdr; ++ ++ goto pkt_drop; ++ } ++ ++ /* Check to valid queue number */ ++ if (hif->client[hif->client_id].rx_qn <= hif->qno) { ++ pr_info("%s: packet with invalid queue: %d\n" ++ , __func__, hif->qno); ++ hif->qno = 0; ++ } ++ ++ free_buf = ++ client_put_rxpacket(&hif->client[hif->client_id].rx_q[hif->qno], ++ (void *)pkt_hdr, len, flags, ++ hif->client_ctrl, &buf_size); ++ ++ hif_lib_indicate_client(hif->client_id, EVENT_RX_PKT_IND, ++ hif->qno); ++ ++ if (unlikely(!free_buf)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_CLIENT_FULL_COUNT]++; ++#endif ++ /* ++ * If we want to keep in polling mode to retry later, ++ * we need to tell napi that we consumed ++ * the full budget or we will hit a livelock scenario. ++ * The core code keeps this napi instance ++ * at the head of the list and none of the other ++ * instances get to run ++ */ ++ rx_processed = budget; ++ ++ if (flags & CL_DESC_FIRST) ++ hif->started = 0; ++ ++ break; ++ } ++ ++pkt_drop: ++ /*Fill free buffer in the descriptor */ ++ hif->rx_buf_addr[rtc] = free_buf; ++ hif->rx_buf_len[rtc] = min(pfe_pkt_size, buf_size); ++ writel((DDR_PHYS_TO_PFE ++ ((u32)dma_map_single(hif->dev, ++ free_buf, hif->rx_buf_len[rtc], DMA_FROM_DEVICE))), ++ &desc->data); ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ writel((BD_CTRL_PKT_INT_EN | BD_CTRL_LIFM | BD_CTRL_DIR | ++ BD_CTRL_DESC_EN | BD_BUF_LEN(hif->rx_buf_len[rtc])), ++ &desc->ctrl); ++ ++ rtc = (rtc + 1) & (hif->rx_ring_size - 1); ++ ++ if (local_desc.ctrl & BD_CTRL_LIFM) { ++ if (!(hif->client_ctrl & HIF_CTRL_RX_CONTINUED)) { ++ rx_processed++; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_PACKET_COUNT]++; ++#endif ++ } ++ hif->started = 0; ++ } ++ } ++ ++ hif->rxtoclean_index = rtc; ++ spin_unlock_bh(&hif->lock); ++ ++ /* we made some progress, re-start rx dma in case it stopped */ ++ hif_rx_dma_start(); ++ ++ return rx_processed; ++} ++ ++/* ++ * client_ack_txpacket- ++ * This function ack the Tx packet in the give client Tx queue by resetting ++ * ownership bit in the descriptor. ++ */ ++static int client_ack_txpacket(struct pfe_hif *hif, unsigned int client_id, ++ unsigned int q_no) ++{ ++ struct hif_tx_queue *queue = &hif->client[client_id].tx_q[q_no]; ++ struct tx_queue_desc *desc = queue->base + queue->ack_idx; ++ ++ if (readl(&desc->ctrl) & CL_DESC_OWN) { ++ writel((readl(&desc->ctrl) & ~CL_DESC_OWN), &desc->ctrl); ++ queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1); ++ ++ return 0; ++ ++ } else { ++ /*This should not happen */ ++ pr_err("%s: %d %d %d %d %d %p %d\n", __func__, ++ hif->txtosend, hif->txtoclean, hif->txavail, ++ client_id, q_no, queue, queue->ack_idx); ++ WARN(1, "%s: doesn't own this descriptor", __func__); ++ return 1; ++ } ++} ++ ++void __hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ int ttc, tx_avl; ++ int pkts_done[HIF_CLIENTS_MAX] = {0, 0}; ++ ++ ttc = hif->txtoclean; ++ tx_avl = hif->txavail; ++ ++ while ((tx_avl < hif->tx_ring_size) && count--) { ++ desc = hif->tx_base + ttc; ++ ++ if (readl(&desc->ctrl) & BD_CTRL_DESC_EN) ++ break; ++ ++ desc_sw = &hif->tx_sw_queue[ttc]; ++ ++ if (desc_sw->data) { ++ /* ++ * dmap_unmap_single(hif->dev, desc_sw->data, ++ * desc_sw->len, DMA_TO_DEVICE); ++ */ ++ dma_unmap_single(hif->dev, desc_sw->data, ++ desc_sw->len, DMA_TO_DEVICE); ++ } ++ ++ if (desc_sw->client_id > HIF_CLIENTS_MAX) ++ pr_err("Invalid cl id %d\n", desc_sw->client_id); ++ ++ pkts_done[desc_sw->client_id]++; ++ ++ client_ack_txpacket(hif, desc_sw->client_id, desc_sw->q_no); ++ ++ ttc = (ttc + 1) & (hif->tx_ring_size - 1); ++ tx_avl++; ++ } ++ ++ if (pkts_done[0]) ++ hif_lib_indicate_client(0, EVENT_TXDONE_IND, 0); ++ if (pkts_done[1]) ++ hif_lib_indicate_client(1, EVENT_TXDONE_IND, 0); ++ ++ hif->txtoclean = ttc; ++ hif->txavail = tx_avl; ++ ++ if (!count) { ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } else { ++ /*Enable Tx done interrupt */ ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_TXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++} ++ ++static void pfe_tx_do_cleanup(unsigned long data) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)data; ++ ++ writel(HIF_INT | HIF_TXPKT_INT, HIF_INT_SRC); ++ ++ hif_tx_done_process(hif, 64); ++} ++ ++/* ++ * __hif_xmit_pkt - ++ * This function puts one packet in the HIF Tx queue ++ */ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags) ++{ ++ struct hif_desc *desc; ++ struct hif_desc_sw *desc_sw; ++ ++ desc = hif->tx_base + hif->txtosend; ++ desc_sw = &hif->tx_sw_queue[hif->txtosend]; ++ ++ desc_sw->len = len; ++ desc_sw->client_id = client_id; ++ desc_sw->q_no = q_no; ++ desc_sw->flags = flags; ++ ++ if (flags & HIF_DONT_DMA_MAP) { ++ desc_sw->data = 0; ++ writel((u32)DDR_PHYS_TO_PFE(data), &desc->data); ++ } else { ++ desc_sw->data = dma_map_single(hif->dev, data, len, ++ DMA_TO_DEVICE); ++ writel((u32)DDR_PHYS_TO_PFE(desc_sw->data), &desc->data); ++ } ++ ++ hif->txtosend = (hif->txtosend + 1) & (hif->tx_ring_size - 1); ++ hif->txavail--; ++ ++ if ((!((flags & HIF_DATA_VALID) && (flags & ++ HIF_LAST_BUFFER)))) ++ goto skip_tx; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ wmb(); ++ ++ do { ++ desc_sw = &hif->tx_sw_queue[hif->txtoflush]; ++ desc = hif->tx_base + hif->txtoflush; ++ ++ if (desc_sw->flags & HIF_LAST_BUFFER) { ++ writel((BD_CTRL_LIFM | ++ BD_CTRL_BRFETCH_DISABLE | BD_CTRL_RTFETCH_DISABLE ++ | BD_CTRL_PARSE_DISABLE | BD_CTRL_DESC_EN | ++ BD_CTRL_PKT_INT_EN | BD_BUF_LEN(desc_sw->len)), ++ &desc->ctrl); ++ } else { ++ writel((BD_CTRL_DESC_EN | ++ BD_BUF_LEN(desc_sw->len)), &desc->ctrl); ++ } ++ hif->txtoflush = (hif->txtoflush + 1) & (hif->tx_ring_size - 1); ++ } ++ while (hif->txtoflush != hif->txtosend) ++ ; ++ ++skip_tx: ++ return; ++} ++ ++static irqreturn_t wol_isr(int irq, void *dev_id) ++{ ++ pr_info("WoL\n"); ++ gemac_set_wol(EMAC1_BASE_ADDR, 0); ++ gemac_set_wol(EMAC2_BASE_ADDR, 0); ++ return IRQ_HANDLED; ++} ++ ++/* ++ * hif_isr- ++ * This ISR routine processes Rx/Tx done interrupts from the HIF hardware block ++ */ ++static irqreturn_t hif_isr(int irq, void *dev_id) ++{ ++ struct pfe_hif *hif = (struct pfe_hif *)dev_id; ++ int int_status; ++ int int_enable_mask; ++ ++ /*Read hif interrupt source register */ ++ int_status = readl_relaxed(HIF_INT_SRC); ++ int_enable_mask = readl_relaxed(HIF_INT_ENABLE); ++ ++ if ((int_status & HIF_INT) == 0) ++ return IRQ_NONE; ++ ++ int_status &= ~(HIF_INT); ++ ++ if (int_status & HIF_RXPKT_INT) { ++ int_status &= ~(HIF_RXPKT_INT); ++ int_enable_mask &= ~(HIF_RXPKT_INT); ++ ++ napi_first_batch = 1; ++ ++ if (napi_schedule_prep(&hif->napi)) { ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_SCHED_COUNT]++; ++#endif ++ __napi_schedule(&hif->napi); ++ } ++ } ++ ++ if (int_status & HIF_TXPKT_INT) { ++ int_status &= ~(HIF_TXPKT_INT); ++ int_enable_mask &= ~(HIF_TXPKT_INT); ++ /*Schedule tx cleanup tassklet */ ++ tasklet_schedule(&hif->tx_cleanup_tasklet); ++ } ++ ++ /*Disable interrupts, they will be enabled after they are serviced */ ++ writel_relaxed(int_enable_mask, HIF_INT_ENABLE); ++ ++ if (int_status) { ++ pr_info("%s : Invalid interrupt : %d\n", __func__, ++ int_status); ++ writel(int_status, HIF_INT_SRC); ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int data2) ++{ ++ unsigned int client_id = data1; ++ ++ if (client_id >= HIF_CLIENTS_MAX) { ++ pr_err("%s: client id %d out of bounds\n", __func__, ++ client_id); ++ return; ++ } ++ ++ switch (req) { ++ case REQUEST_CL_REGISTER: ++ /* Request for register a client */ ++ pr_info("%s: register client_id %d\n", ++ __func__, client_id); ++ pfe_hif_client_register(hif, client_id, (struct ++ hif_client_shm *)&hif->shm->client[client_id]); ++ break; ++ ++ case REQUEST_CL_UNREGISTER: ++ pr_info("%s: unregister client_id %d\n", ++ __func__, client_id); ++ ++ /* Request for unregister a client */ ++ pfe_hif_client_unregister(hif, client_id); ++ ++ break; ++ ++ default: ++ pr_err("%s: unsupported request %d\n", ++ __func__, req); ++ break; ++ } ++ ++ /* ++ * Process client Tx queues ++ * Currently we don't have checking for tx pending ++ */ ++} ++ ++/* ++ * pfe_hif_rx_poll ++ * This function is NAPI poll function to process HIF Rx queue. ++ */ ++static int pfe_hif_rx_poll(struct napi_struct *napi, int budget) ++{ ++ struct pfe_hif *hif = container_of(napi, struct pfe_hif, napi); ++ int work_done; ++ ++#ifdef HIF_NAPI_STATS ++ hif->napi_counters[NAPI_POLL_COUNT]++; ++#endif ++ ++ work_done = pfe_hif_rx_process(hif, budget); ++ ++ if (work_done < budget) { ++ napi_complete(napi); ++ writel(readl_relaxed(HIF_INT_ENABLE) | HIF_RXPKT_INT, ++ HIF_INT_ENABLE); ++ } ++#ifdef HIF_NAPI_STATS ++ else ++ hif->napi_counters[NAPI_FULL_BUDGET_COUNT]++; ++#endif ++ ++ return work_done; ++} ++ ++/* ++ * pfe_hif_init ++ * This function initializes the baseaddresses and irq, etc. ++ */ ++int pfe_hif_init(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ int err; ++ ++ pr_info("%s\n", __func__); ++ ++ hif->dev = pfe->dev; ++ hif->irq = pfe->hif_irq; ++ ++ err = pfe_hif_alloc_descr(hif); ++ if (err) ++ goto err0; ++ ++ if (pfe_hif_init_buffers(hif)) { ++ pr_err("%s: Could not initialize buffer descriptors\n" ++ , __func__); ++ err = -ENOMEM; ++ goto err1; ++ } ++ ++ /* Initialize NAPI for Rx processing */ ++ init_dummy_netdev(&hif->dummy_dev); ++ netif_napi_add(&hif->dummy_dev, &hif->napi, pfe_hif_rx_poll, ++ HIF_RX_POLL_WEIGHT); ++ napi_enable(&hif->napi); ++ ++ spin_lock_init(&hif->tx_lock); ++ spin_lock_init(&hif->lock); ++ ++ hif_init(); ++ hif_rx_enable(); ++ hif_tx_enable(); ++ ++ /* Disable tx done interrupt */ ++ writel(HIF_INT_MASK, HIF_INT_ENABLE); ++ ++ gpi_enable(HGPI_BASE_ADDR); ++ ++ err = request_irq(hif->irq, hif_isr, 0, "pfe_hif", hif); ++ if (err) { ++ pr_err("%s: failed to get the hif IRQ = %d\n", ++ __func__, hif->irq); ++ goto err1; ++ } ++ ++ err = request_irq(pfe->wol_irq, wol_isr, 0, "pfe_wol", pfe); ++ if (err) { ++ pr_err("%s: failed to get the wol IRQ = %d\n", ++ __func__, pfe->wol_irq); ++ goto err1; ++ } ++ ++ tasklet_init(&hif->tx_cleanup_tasklet, ++ (void(*)(unsigned long))pfe_tx_do_cleanup, ++ (unsigned long)hif); ++ ++ return 0; ++err1: ++ pfe_hif_free_descr(hif); ++err0: ++ return err; ++} ++ ++/* pfe_hif_exit- */ ++void pfe_hif_exit(struct pfe *pfe) ++{ ++ struct pfe_hif *hif = &pfe->hif; ++ ++ pr_info("%s\n", __func__); ++ ++ tasklet_kill(&hif->tx_cleanup_tasklet); ++ ++ spin_lock_bh(&hif->lock); ++ hif->shm->g_client_status[0] = 0; ++ /* Make sure all clients are disabled*/ ++ hif->shm->g_client_status[1] = 0; ++ ++ spin_unlock_bh(&hif->lock); ++ ++ /*Disable Rx/Tx */ ++ gpi_disable(HGPI_BASE_ADDR); ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ napi_disable(&hif->napi); ++ netif_napi_del(&hif->napi); ++ ++ free_irq(pfe->wol_irq, pfe); ++ free_irq(hif->irq, hif); ++ ++ pfe_hif_release_buffers(hif); ++ pfe_hif_free_descr(hif); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif.h +@@ -0,0 +1,211 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_HIF_H_ ++#define _PFE_HIF_H_ ++ ++#include ++ ++#define HIF_NAPI_STATS ++ ++#define HIF_CLIENT_QUEUES_MAX 16 ++#define HIF_RX_POLL_WEIGHT 64 ++ ++#define HIF_RX_PKT_MIN_SIZE 0x800 /* 2KB */ ++#define HIF_RX_PKT_MIN_SIZE_MASK ~(HIF_RX_PKT_MIN_SIZE - 1) ++#define ROUND_MIN_RX_SIZE(_sz) (((_sz) + (HIF_RX_PKT_MIN_SIZE - 1)) \ ++ & HIF_RX_PKT_MIN_SIZE_MASK) ++#define PRESENT_OFST_IN_PAGE(_buf) (((unsigned long int)(_buf) & (PAGE_SIZE \ ++ - 1)) & HIF_RX_PKT_MIN_SIZE_MASK) ++ ++enum { ++ NAPI_SCHED_COUNT = 0, ++ NAPI_POLL_COUNT, ++ NAPI_PACKET_COUNT, ++ NAPI_DESC_COUNT, ++ NAPI_FULL_BUDGET_COUNT, ++ NAPI_CLIENT_FULL_COUNT, ++ NAPI_MAX_COUNT ++}; ++ ++/* ++ * HIF_TX_DESC_NT value should be always greter than 4, ++ * Otherwise HIF_TX_POLL_MARK will become zero. ++ */ ++#define HIF_RX_DESC_NT 256 ++#define HIF_TX_DESC_NT 2048 ++ ++#define HIF_FIRST_BUFFER BIT(0) ++#define HIF_LAST_BUFFER BIT(1) ++#define HIF_DONT_DMA_MAP BIT(2) ++#define HIF_DATA_VALID BIT(3) ++#define HIF_TSO BIT(4) ++ ++enum { ++ PFE_CL_GEM0 = 0, ++ PFE_CL_GEM1, ++ HIF_CLIENTS_MAX ++}; ++ ++/*structure to store client queue info */ ++struct hif_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 write_idx; ++}; ++ ++struct hif_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 ack_idx; ++}; ++ ++/*Structure to store the client info */ ++struct hif_client { ++ int rx_qn; ++ struct hif_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int tx_qn; ++ struct hif_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++}; ++ ++/*HIF hardware buffer descriptor */ ++struct hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++ u32 next; ++}; ++ ++struct __hif_desc { ++ u32 ctrl; ++ u32 status; ++ u32 data; ++}; ++ ++struct hif_desc_sw { ++ dma_addr_t data; ++ u16 len; ++ u8 client_id; ++ u8 q_no; ++ u16 flags; ++}; ++ ++struct hif_hdr { ++ u8 client_id; ++ u8 q_num; ++ u16 client_ctrl; ++ u16 client_ctrl1; ++}; ++ ++struct __hif_hdr { ++ union { ++ struct hif_hdr hdr; ++ u32 word[2]; ++ }; ++}; ++ ++struct hif_ipsec_hdr { ++ u16 sa_handle[2]; ++} __packed; ++ ++/* HIF_CTRL_TX... defines */ ++#define HIF_CTRL_TX_CHECKSUM BIT(2) ++ ++/* HIF_CTRL_RX... defines */ ++#define HIF_CTRL_RX_OFFSET_OFST (24) ++#define HIF_CTRL_RX_CHECKSUMMED BIT(2) ++#define HIF_CTRL_RX_CONTINUED BIT(1) ++ ++struct pfe_hif { ++ /* To store registered clients in hif layer */ ++ struct hif_client client[HIF_CLIENTS_MAX]; ++ struct hif_shm *shm; ++ int irq; ++ ++ void *descr_baseaddr_v; ++ unsigned long descr_baseaddr_p; ++ ++ struct hif_desc *rx_base; ++ u32 rx_ring_size; ++ u32 rxtoclean_index; ++ void *rx_buf_addr[HIF_RX_DESC_NT]; ++ int rx_buf_len[HIF_RX_DESC_NT]; ++ unsigned int qno; ++ unsigned int client_id; ++ unsigned int client_ctrl; ++ unsigned int started; ++ ++ struct hif_desc *tx_base; ++ u32 tx_ring_size; ++ u32 txtosend; ++ u32 txtoclean; ++ u32 txavail; ++ u32 txtoflush; ++ struct hif_desc_sw tx_sw_queue[HIF_TX_DESC_NT]; ++ ++/* tx_lock synchronizes hif packet tx as well as pfe_hif structure access */ ++ spinlock_t tx_lock; ++/* lock synchronizes hif rx queue processing */ ++ spinlock_t lock; ++ struct net_device dummy_dev; ++ struct napi_struct napi; ++ struct device *dev; ++ ++#ifdef HIF_NAPI_STATS ++ unsigned int napi_counters[NAPI_MAX_COUNT]; ++#endif ++ struct tasklet_struct tx_cleanup_tasklet; ++}; ++ ++void __hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int ++ q_no, void *data, u32 len, unsigned int flags); ++int hif_xmit_pkt(struct pfe_hif *hif, unsigned int client_id, unsigned int q_no, ++ void *data, unsigned int len); ++void __hif_tx_done_process(struct pfe_hif *hif, int count); ++void hif_process_client_req(struct pfe_hif *hif, int req, int data1, int ++ data2); ++int pfe_hif_init(struct pfe *pfe); ++void pfe_hif_exit(struct pfe *pfe); ++void pfe_hif_rx_idle(struct pfe_hif *hif); ++static inline void hif_tx_done_process(struct pfe_hif *hif, int count) ++{ ++ spin_lock_bh(&hif->tx_lock); ++ __hif_tx_done_process(hif, count); ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_lock(struct pfe_hif *hif) ++{ ++ spin_lock_bh(&hif->tx_lock); ++} ++ ++static inline void hif_tx_unlock(struct pfe_hif *hif) ++{ ++ spin_unlock_bh(&hif->tx_lock); ++} ++ ++static inline int __hif_tx_avail(struct pfe_hif *hif) ++{ ++ return hif->txavail; ++} ++ ++#define __memcpy8(dst, src) memcpy(dst, src, 8) ++#define __memcpy12(dst, src) memcpy(dst, src, 12) ++#define __memcpy(dst, src, len) memcpy(dst, src, len) ++ ++#endif /* _PFE_HIF_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c +@@ -0,0 +1,601 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++ ++unsigned int lro_mode; ++unsigned int page_mode; ++unsigned int tx_qos; ++unsigned int pfe_pkt_size; ++unsigned int pfe_pkt_headroom; ++unsigned int emac_txq_cnt; ++ ++/* ++ * @pfe_hal_lib.c. ++ * Common functions used by HIF client drivers ++ */ ++ ++/*HIF shared memory Global variable */ ++struct hif_shm ghif_shm; ++ ++/* Cleanup the HIF shared memory, release HIF rx_buffer_pool. ++ * This function should be called after pfe_hif_exit ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ */ ++static void pfe_hif_shm_clean(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ pkt = hif_shm->rx_buf_pool[i]; ++ if (pkt) { ++ hif_shm->rx_buf_pool[i] = NULL; ++ pkt -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ put_page(virt_to_page(pkt)); ++ else ++ kfree(pkt); ++ } ++ } ++} ++ ++/* Initialize shared memory used between HIF driver and clients, ++ * allocate rx_buffer_pool required for HIF Rx descriptors. ++ * This function should be called before initializing HIF driver. ++ * ++ * @param[in] hif_shm Shared memory address location in DDR ++ * @rerurn 0 - on succes, <0 on fail to initialize ++ */ ++static int pfe_hif_shm_init(struct hif_shm *hif_shm) ++{ ++ int i; ++ void *pkt; ++ ++ memset(hif_shm, 0, sizeof(struct hif_shm)); ++ hif_shm->rx_buf_pool_cnt = HIF_RX_DESC_NT; ++ ++ for (i = 0; i < hif_shm->rx_buf_pool_cnt; i++) { ++ if (page_mode) { ++ pkt = (void *)__get_free_page(GFP_KERNEL | ++ GFP_DMA_PFE); ++ } else { ++ pkt = kmalloc(PFE_BUF_SIZE, GFP_KERNEL | GFP_DMA_PFE); ++ } ++ ++ if (pkt) ++ hif_shm->rx_buf_pool[i] = pkt + pfe_pkt_headroom; ++ else ++ goto err0; ++ } ++ ++ return 0; ++ ++err0: ++ pr_err("%s Low memory\n", __func__); ++ pfe_hif_shm_clean(hif_shm); ++ return -ENOMEM; ++} ++ ++/*This function sends indication to HIF driver ++ * ++ * @param[in] hif hif context ++ */ ++static void hif_lib_indicate_hif(struct pfe_hif *hif, int req, int data1, int ++ data2) ++{ ++ hif_process_client_req(hif, req, data1, data2); ++} ++ ++void hif_lib_indicate_client(int client_id, int event_type, int qno) ++{ ++ struct hif_client_s *client = pfe->hif_client[client_id]; ++ ++ if (!client || (event_type >= HIF_EVENT_MAX) || (qno >= ++ HIF_CLIENT_QUEUES_MAX)) ++ return; ++ ++ if (!test_and_set_bit(qno, &client->queue_mask[event_type])) ++ client->event_handler(client->priv, event_type, qno); ++} ++ ++/*This function releases Rx queue descriptors memory and pre-filled buffers ++ * ++ * @param[in] client hif_client context ++ */ ++static void hif_lib_client_release_rx_buffers(struct hif_client_s *client) ++{ ++ struct rx_queue_desc *desc; ++ int qno, ii; ++ void *buf; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ desc = client->rx_q[qno].base; ++ ++ for (ii = 0; ii < client->rx_q[qno].size; ii++) { ++ buf = (void *)desc->data; ++ if (buf) { ++ buf -= pfe_pkt_headroom; ++ ++ if (page_mode) ++ free_page((unsigned long)buf); ++ else ++ kfree(buf); ++ ++ desc->ctrl = 0; ++ } ++ ++ desc++; ++ } ++ } ++ ++ kfree(client->rx_qbase); ++} ++ ++/*This function allocates memory for the rxq descriptors and pre-fill rx queues ++ * with buffers. ++ * @param[in] client client context ++ * @param[in] q_size size of the rxQ, all queues are of same size ++ */ ++static int hif_lib_client_init_rx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct rx_queue_desc *desc; ++ struct hif_client_rx_queue *queue; ++ int ii, qno; ++ ++ /*Allocate memory for the client queues */ ++ client->rx_qbase = kzalloc(client->rx_qn * q_size * sizeof(struct ++ rx_queue_desc), GFP_KERNEL); ++ if (!client->rx_qbase) ++ goto err; ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ ++ queue->base = client->rx_qbase + qno * q_size * sizeof(struct ++ rx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ ++ pr_debug("rx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ for (qno = 0; qno < client->rx_qn; qno++) { ++ queue = &client->rx_q[qno]; ++ desc = queue->base; ++ ++ for (ii = 0; ii < queue->size; ii++) { ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | ++ CL_DESC_OWN; ++ desc++; ++ } ++ } ++ ++ return 0; ++ ++err: ++ return 1; ++} ++ ++ ++static void hif_lib_client_cleanup_tx_queue(struct hif_client_tx_queue *queue) ++{ ++ pr_debug("%s\n", __func__); ++ ++ /* ++ * Check if there are any pending packets. Client must flush the tx ++ * queues before unregistering, by calling by calling ++ * hif_lib_tx_get_next_complete() ++ * ++ * Hif no longer calls since we are no longer registered ++ */ ++ if (queue->tx_pending) ++ pr_err("%s: pending transmit packets\n", __func__); ++} ++ ++static void hif_lib_client_release_tx_buffers(struct hif_client_s *client) ++{ ++ int qno; ++ ++ pr_debug("%s\n", __func__); ++ ++ for (qno = 0; qno < client->tx_qn; qno++) ++ hif_lib_client_cleanup_tx_queue(&client->tx_q[qno]); ++ ++ kfree(client->tx_qbase); ++} ++ ++static int hif_lib_client_init_tx_buffers(struct hif_client_s *client, int ++ q_size) ++{ ++ struct hif_client_tx_queue *queue; ++ int qno; ++ ++ client->tx_qbase = kzalloc(client->tx_qn * q_size * sizeof(struct ++ tx_queue_desc), GFP_KERNEL); ++ if (!client->tx_qbase) ++ return 1; ++ ++ for (qno = 0; qno < client->tx_qn; qno++) { ++ queue = &client->tx_q[qno]; ++ ++ queue->base = client->tx_qbase + qno * q_size * sizeof(struct ++ tx_queue_desc); ++ queue->size = q_size; ++ queue->read_idx = 0; ++ queue->write_idx = 0; ++ queue->tx_pending = 0; ++ queue->nocpy_flag = 0; ++ queue->prev_tmu_tx_pkts = 0; ++ queue->done_tmu_tx_pkts = 0; ++ ++ pr_debug("tx queue: %d, base: %p, size: %d\n", qno, ++ queue->base, queue->size); ++ } ++ ++ return 0; ++} ++ ++static int hif_lib_event_dummy(void *priv, int event_type, int qno) ++{ ++ return 0; ++} ++ ++int hif_lib_client_register(struct hif_client_s *client) ++{ ++ struct hif_shm *hif_shm; ++ struct hif_client_shm *client_shm; ++ int err, i; ++ /* int loop_cnt = 0; */ ++ ++ pr_debug("%s\n", __func__); ++ ++ /*Allocate memory before spin_lock*/ ++ if (hif_lib_client_init_rx_buffers(client, client->rx_qsize)) { ++ err = -ENOMEM; ++ goto err_rx; ++ } ++ ++ if (hif_lib_client_init_tx_buffers(client, client->tx_qsize)) { ++ err = -ENOMEM; ++ goto err_tx; ++ } ++ ++ spin_lock_bh(&pfe->hif.lock); ++ if (!(client->pfe) || (client->id >= HIF_CLIENTS_MAX) || ++ (pfe->hif_client[client->id])) { ++ err = -EINVAL; ++ goto err; ++ } ++ ++ hif_shm = client->pfe->hif.shm; ++ ++ if (!client->event_handler) ++ client->event_handler = hif_lib_event_dummy; ++ ++ /*Initialize client specific shared memory */ ++ client_shm = (struct hif_client_shm *)&hif_shm->client[client->id]; ++ client_shm->rx_qbase = (unsigned long int)client->rx_qbase; ++ client_shm->rx_qsize = client->rx_qsize; ++ client_shm->tx_qbase = (unsigned long int)client->tx_qbase; ++ client_shm->tx_qsize = client->tx_qsize; ++ client_shm->ctrl = (client->tx_qn << CLIENT_CTRL_TX_Q_CNT_OFST) | ++ (client->rx_qn << CLIENT_CTRL_RX_Q_CNT_OFST); ++ /* spin_lock_init(&client->rx_lock); */ ++ ++ for (i = 0; i < HIF_EVENT_MAX; i++) { ++ client->queue_mask[i] = 0; /* ++ * By default all events are ++ * unmasked ++ */ ++ } ++ ++ /*Indicate to HIF driver*/ ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_REGISTER, client->id, 0); ++ ++ pr_debug("%s: client: %p, client_id: %d, tx_qsize: %d, rx_qsize: %d\n", ++ __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ client->cpu_id = -1; ++ ++ pfe->hif_client[client->id] = client; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++ ++err: ++ spin_unlock_bh(&pfe->hif.lock); ++ hif_lib_client_release_tx_buffers(client); ++ ++err_tx: ++ hif_lib_client_release_rx_buffers(client); ++ ++err_rx: ++ return err; ++} ++ ++int hif_lib_client_unregister(struct hif_client_s *client) ++{ ++ struct pfe *pfe = client->pfe; ++ u32 client_id = client->id; ++ ++ pr_info( ++ "%s : client: %p, client_id: %d, txQ_depth: %d, rxQ_depth: %d\n" ++ , __func__, client, client->id, client->tx_qsize, ++ client->rx_qsize); ++ ++ spin_lock_bh(&pfe->hif.lock); ++ hif_lib_indicate_hif(&pfe->hif, REQUEST_CL_UNREGISTER, client->id, 0); ++ ++ hif_lib_client_release_tx_buffers(client); ++ hif_lib_client_release_rx_buffers(client); ++ pfe->hif_client[client_id] = NULL; ++ spin_unlock_bh(&pfe->hif.lock); ++ ++ return 0; ++} ++ ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, ++ int qno) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ if ((event >= HIF_EVENT_MAX) || (qno >= HIF_CLIENT_QUEUES_MAX)) { ++ pr_debug("%s: Unsupported event : %d queue number : %d\n", ++ __func__, event, qno); ++ return -1; ++ } ++ ++ test_and_clear_bit(qno, &client->queue_mask[event]); ++ ++ switch (event) { ++ case EVENT_RX_PKT_IND: ++ if (!(desc->ctrl & CL_DESC_OWN)) ++ hif_lib_indicate_client(client->id, ++ EVENT_RX_PKT_IND, qno); ++ break; ++ ++ case EVENT_HIGH_RX_WM: ++ case EVENT_TXDONE_IND: ++ default: ++ break; ++ } ++ ++ return 0; ++} ++ ++/* ++ * This function gets one packet from the specified client queue ++ * It also refill the rx buffer ++ */ ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data) ++{ ++ struct hif_client_rx_queue *queue = &client->rx_q[qno]; ++ struct rx_queue_desc *desc; ++ void *pkt = NULL; ++ ++ /* ++ * Following lock is to protect rx queue access from, ++ * hif_lib_event_handler_start. ++ * In general below lock is not required, because hif_lib_xmit_pkt and ++ * hif_lib_event_handler_start are called from napi poll and which is ++ * not re-entrant. But if some client use in different way this lock is ++ * required. ++ */ ++ /*spin_lock_irqsave(&client->rx_lock, flags); */ ++ desc = queue->base + queue->read_idx; ++ if (!(desc->ctrl & CL_DESC_OWN)) { ++ pkt = desc->data - pfe_pkt_headroom; ++ ++ *rx_ctrl = desc->client_ctrl; ++ *desc_ctrl = desc->ctrl; ++ ++ if (desc->ctrl & CL_DESC_FIRST) { ++ u16 size = *rx_ctrl >> HIF_CTRL_RX_OFFSET_OFST; ++ ++ if (size) { ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ - size; ++ *ofst = pfe_pkt_headroom + PFE_PKT_HEADER_SZ ++ + size; ++ *priv_data = desc->data + PFE_PKT_HEADER_SZ; ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl) - ++ PFE_PKT_HEADER_SZ; ++ *ofst = pfe_pkt_headroom + PFE_PKT_HEADER_SZ; ++ *priv_data = NULL; ++ } ++ ++ } else { ++ *len = CL_DESC_BUF_LEN(desc->ctrl); ++ *ofst = pfe_pkt_headroom; ++ } ++ ++ /* ++ * Needed so we don't free a buffer/page ++ * twice on module_exit ++ */ ++ desc->data = NULL; ++ ++ /* ++ * Ensure everything else is written to DDR before ++ * writing bd->ctrl ++ */ ++ smp_wmb(); ++ ++ desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | CL_DESC_OWN; ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ } ++ ++ /*spin_unlock_irqrestore(&client->rx_lock, flags); */ ++ return pkt; ++} ++ ++static inline void hif_hdr_write(struct hif_hdr *pkt_hdr, unsigned int ++ client_id, unsigned int qno, ++ u32 client_ctrl) ++{ ++ /* Optimize the write since the destinaton may be non-cacheable */ ++ if (!((unsigned long)pkt_hdr & 0x3)) { ++ ((u32 *)pkt_hdr)[0] = (client_ctrl << 16) | (qno << 8) | ++ client_id; ++ } else { ++ ((u16 *)pkt_hdr)[0] = (qno << 8) | (client_id & 0xFF); ++ ((u16 *)pkt_hdr)[1] = (client_ctrl & 0xFFFF); ++ } ++} ++ ++/*This function puts the given packet in the specific client queue */ ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->write_idx; ++ ++ /* First buffer */ ++ if (flags & HIF_FIRST_BUFFER) { ++ data -= sizeof(struct hif_hdr); ++ len += sizeof(struct hif_hdr); ++ ++ hif_hdr_write(data, client->id, qno, client_ctrl); ++ } ++ ++ desc->data = client_data; ++ desc->ctrl = CL_DESC_OWN | CL_DESC_FLAGS(flags); ++ ++ __hif_xmit_pkt(&pfe->hif, client->id, qno, data, len, flags); ++ ++ queue->write_idx = (queue->write_idx + 1) & (queue->size - 1); ++ queue->tx_pending++; ++ queue->jiffies_last_packet = jiffies; ++} ++ ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ struct tx_queue_desc *desc = queue->base + queue->read_idx; ++ ++ pr_debug("%s: qno : %d rd_indx: %d pending:%d\n", __func__, qno, ++ queue->read_idx, queue->tx_pending); ++ ++ if (!queue->tx_pending) ++ return NULL; ++ ++ if (queue->nocpy_flag && !queue->done_tmu_tx_pkts) { ++ u32 tmu_tx_pkts = be32_to_cpu(pe_dmem_read(TMU0_ID + ++ client->id, TMU_DM_TX_TRANS, 4)); ++ ++ if (queue->prev_tmu_tx_pkts > tmu_tx_pkts) ++ queue->done_tmu_tx_pkts = UINT_MAX - ++ queue->prev_tmu_tx_pkts + tmu_tx_pkts; ++ else ++ queue->done_tmu_tx_pkts = tmu_tx_pkts - ++ queue->prev_tmu_tx_pkts; ++ ++ queue->prev_tmu_tx_pkts = tmu_tx_pkts; ++ ++ if (!queue->done_tmu_tx_pkts) ++ return NULL; ++ } ++ ++ if (desc->ctrl & CL_DESC_OWN) ++ return NULL; ++ ++ queue->read_idx = (queue->read_idx + 1) & (queue->size - 1); ++ queue->tx_pending--; ++ ++ *flags = CL_DESC_GET_FLAGS(desc->ctrl); ++ ++ if (queue->done_tmu_tx_pkts && (*flags & HIF_LAST_BUFFER)) ++ queue->done_tmu_tx_pkts--; ++ ++ return desc->data; ++} ++ ++static void hif_lib_tmu_credit_init(struct pfe *pfe) ++{ ++ int i, q; ++ ++ for (i = 0; i < NUM_GEMAC_SUPPORT; i++) ++ for (q = 0; q < emac_txq_cnt; q++) { ++ pfe->tmu_credit.tx_credit_max[i][q] = (q == 0) ? ++ DEFAULT_Q0_QDEPTH : DEFAULT_MAX_QDEPTH; ++ pfe->tmu_credit.tx_credit[i][q] = ++ pfe->tmu_credit.tx_credit_max[i][q]; ++ } ++} ++ ++int pfe_hif_lib_init(struct pfe *pfe) ++{ ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ if (lro_mode) { ++ page_mode = 1; ++ pfe_pkt_size = min(PAGE_SIZE, MAX_PFE_PKT_SIZE); ++ pfe_pkt_headroom = 0; ++ } else { ++ page_mode = 0; ++ pfe_pkt_size = PFE_PKT_SIZE; ++ pfe_pkt_headroom = PFE_PKT_HEADROOM; ++ } ++ ++ if (tx_qos) ++ emac_txq_cnt = EMAC_TXQ_CNT / 2; ++ else ++ emac_txq_cnt = EMAC_TXQ_CNT; ++ ++ hif_lib_tmu_credit_init(pfe); ++ pfe->hif.shm = &ghif_shm; ++ rc = pfe_hif_shm_init(pfe->hif.shm); ++ ++ return rc; ++} ++ ++void pfe_hif_lib_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ pfe_hif_shm_clean(pfe->hif.shm); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.h +@@ -0,0 +1,239 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_HIF_LIB_H_ ++#define _PFE_HIF_LIB_H_ ++ ++#include "pfe_hif.h" ++ ++#define HIF_CL_REQ_TIMEOUT 10 ++#define GFP_DMA_PFE 0 ++ ++enum { ++ REQUEST_CL_REGISTER = 0, ++ REQUEST_CL_UNREGISTER, ++ HIF_REQUEST_MAX ++}; ++ ++enum { ++ /* Event to indicate that client rx queue is reached water mark level */ ++ EVENT_HIGH_RX_WM = 0, ++ /* Event to indicate that, packet received for client */ ++ EVENT_RX_PKT_IND, ++ /* Event to indicate that, packet tx done for client */ ++ EVENT_TXDONE_IND, ++ HIF_EVENT_MAX ++}; ++ ++/*structure to store client queue info */ ++ ++/*structure to store client queue info */ ++struct hif_client_rx_queue { ++ struct rx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++}; ++ ++struct hif_client_tx_queue { ++ struct tx_queue_desc *base; ++ u32 size; ++ u32 read_idx; ++ u32 write_idx; ++ u32 tx_pending; ++ unsigned long jiffies_last_packet; ++ u32 nocpy_flag; ++ u32 prev_tmu_tx_pkts; ++ u32 done_tmu_tx_pkts; ++}; ++ ++struct hif_client_s { ++ int id; ++ int tx_qn; ++ int rx_qn; ++ void *rx_qbase; ++ void *tx_qbase; ++ int tx_qsize; ++ int rx_qsize; ++ int cpu_id; ++ struct hif_client_tx_queue tx_q[HIF_CLIENT_QUEUES_MAX]; ++ struct hif_client_rx_queue rx_q[HIF_CLIENT_QUEUES_MAX]; ++ int (*event_handler)(void *priv, int event, int data); ++ unsigned long queue_mask[HIF_EVENT_MAX]; ++ struct pfe *pfe; ++ void *priv; ++}; ++ ++/* ++ * Client specific shared memory ++ * It contains number of Rx/Tx queues, base addresses and queue sizes ++ */ ++struct hif_client_shm { ++ u32 ctrl; /*0-7: number of Rx queues, 8-15: number of tx queues */ ++ unsigned long rx_qbase; /*Rx queue base address */ ++ u32 rx_qsize; /*each Rx queue size, all Rx queues are of same size */ ++ unsigned long tx_qbase; /* Tx queue base address */ ++ u32 tx_qsize; /*each Tx queue size, all Tx queues are of same size */ ++}; ++ ++/*Client shared memory ctrl bit description */ ++#define CLIENT_CTRL_RX_Q_CNT_OFST 0 ++#define CLIENT_CTRL_TX_Q_CNT_OFST 8 ++#define CLIENT_CTRL_RX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_RX_Q_CNT_OFST) \ ++ & 0xFF) ++#define CLIENT_CTRL_TX_Q_CNT(ctrl) (((ctrl) >> CLIENT_CTRL_TX_Q_CNT_OFST) \ ++ & 0xFF) ++ ++/* ++ * Shared memory used to communicate between HIF driver and host/client drivers ++ * Before starting the hif driver rx_buf_pool ans rx_buf_pool_cnt should be ++ * initialized with host buffers and buffers count in the pool. ++ * rx_buf_pool_cnt should be >= HIF_RX_DESC_NT. ++ * ++ */ ++struct hif_shm { ++ u32 rx_buf_pool_cnt; /*Number of rx buffers available*/ ++ /*Rx buffers required to initialize HIF rx descriptors */ ++ void *rx_buf_pool[HIF_RX_DESC_NT]; ++ unsigned long g_client_status[2]; /*Global client status bit mask */ ++ /* Client specific shared memory */ ++ struct hif_client_shm client[HIF_CLIENTS_MAX]; ++}; ++ ++#define CL_DESC_OWN BIT(31) ++/* This sets owner ship to HIF driver */ ++#define CL_DESC_LAST BIT(30) ++/* This indicates last packet for multi buffers handling */ ++#define CL_DESC_FIRST BIT(29) ++/* This indicates first packet for multi buffers handling */ ++ ++#define CL_DESC_BUF_LEN(x) ((x) & 0xFFFF) ++#define CL_DESC_FLAGS(x) (((x) & 0xF) << 16) ++#define CL_DESC_GET_FLAGS(x) (((x) >> 16) & 0xF) ++ ++struct rx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++ u32 client_ctrl; ++}; ++ ++struct tx_queue_desc { ++ void *data; ++ u32 ctrl; /*0-15bit len, 16-20bit flags, 31bit owner*/ ++}; ++ ++/* HIF Rx is not working properly for 2-byte aligned buffers and ++ * ip_header should be 4byte aligned for better iperformance. ++ * "ip_header = 64 + 6(hif_header) + 14 (MAC Header)" will be 4byte aligned. ++ */ ++#define PFE_PKT_HEADER_SZ sizeof(struct hif_hdr) ++/* must be big enough for headroom, pkt size and skb shared info */ ++#define PFE_BUF_SIZE 2048 ++#define PFE_PKT_HEADROOM 128 ++ ++#define SKB_SHARED_INFO_SIZE (sizeof(struct skb_shared_info)) ++#define PFE_PKT_SIZE (PFE_BUF_SIZE - PFE_PKT_HEADROOM \ ++ - SKB_SHARED_INFO_SIZE) ++#define MAX_L2_HDR_SIZE 14 /* Not correct for VLAN/PPPoE */ ++#define MAX_L3_HDR_SIZE 20 /* Not correct for IPv6 */ ++#define MAX_L4_HDR_SIZE 60 /* TCP with maximum options */ ++#define MAX_HDR_SIZE (MAX_L2_HDR_SIZE + MAX_L3_HDR_SIZE \ ++ + MAX_L4_HDR_SIZE) ++/* Used in page mode to clamp packet size to the maximum supported by the hif ++ *hw interface (<16KiB) ++ */ ++#define MAX_PFE_PKT_SIZE 16380UL ++ ++extern unsigned int pfe_pkt_size; ++extern unsigned int pfe_pkt_headroom; ++extern unsigned int page_mode; ++extern unsigned int lro_mode; ++extern unsigned int tx_qos; ++extern unsigned int emac_txq_cnt; ++ ++int pfe_hif_lib_init(struct pfe *pfe); ++void pfe_hif_lib_exit(struct pfe *pfe); ++int hif_lib_client_register(struct hif_client_s *client); ++int hif_lib_client_unregister(struct hif_client_s *client); ++void __hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void ++ *data, unsigned int len, u32 client_ctrl, ++ unsigned int flags, void *client_data); ++int hif_lib_xmit_pkt(struct hif_client_s *client, unsigned int qno, void *data, ++ unsigned int len, u32 client_ctrl, void *client_data); ++void hif_lib_indicate_client(int cl_id, int event, int data); ++int hif_lib_event_handler_start(struct hif_client_s *client, int event, int ++ data); ++int hif_lib_tmu_queue_start(struct hif_client_s *client, int qno); ++int hif_lib_tmu_queue_stop(struct hif_client_s *client, int qno); ++void *hif_lib_tx_get_next_complete(struct hif_client_s *client, int qno, ++ unsigned int *flags, int count); ++void *hif_lib_receive_pkt(struct hif_client_s *client, int qno, int *len, int ++ *ofst, unsigned int *rx_ctrl, ++ unsigned int *desc_ctrl, void **priv_data); ++void hif_lib_set_rx_cpu_affinity(struct hif_client_s *client, int cpu_id); ++void hif_lib_set_tx_queue_nocpy(struct hif_client_s *client, int qno, int ++ enable); ++static inline int hif_lib_tx_avail(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return (queue->size - queue->tx_pending); ++} ++ ++static inline int hif_lib_get_tx_wr_index(struct hif_client_s *client, unsigned ++ int qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->write_idx; ++} ++ ++static inline int hif_lib_tx_pending(struct hif_client_s *client, unsigned int ++ qno) ++{ ++ struct hif_client_tx_queue *queue = &client->tx_q[qno]; ++ ++ return queue->tx_pending; ++} ++ ++#define hif_lib_tx_credit_avail(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit[id][qno]) ++ ++#define hif_lib_tx_credit_max(pfe, id, qno) \ ++ ((pfe)->tmu_credit.tx_credit_max[id][qno]) ++ ++/* ++ * Test comment ++ */ ++#define hif_lib_tx_credit_use(pfe, id, qno, credit) \ ++ ({ typeof(pfe) pfe_ = pfe; \ ++ typeof(id) id_ = id; \ ++ typeof(qno) qno_ = qno_; \ ++ typeof(credit) credit_ = credit; \ ++ do { \ ++ if (tx_qos) { \ ++ (pfe_)->tmu_credit.tx_credit[id_][qno_]\ ++ -= credit_; \ ++ (pfe_)->tmu_credit.tx_packets[id_][qno_]\ ++ += credit_; \ ++ } \ ++ } while (0); \ ++ }) ++ ++#endif /* _PFE_HIF_LIB_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.c +@@ -0,0 +1,176 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include "pfe_mod.h" ++#include "pfe_hw.h" ++ ++/* Functions to handle most of pfe hw register initialization */ ++int pfe_hw_init(struct pfe *pfe, int resume) ++{ ++ struct class_cfg class_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .route_table_baseaddr = pfe->ddr_phys_baseaddr + ++ ROUTE_TABLE_BASEADDR, ++ .route_table_hash_bits = ROUTE_TABLE_HASH_BITS, ++ }; ++ ++ struct tmu_cfg tmu_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ .llm_base_addr = pfe->ddr_phys_baseaddr + TMU_LLM_BASEADDR, ++ .llm_queue_len = TMU_LLM_QUEUE_LEN, ++ }; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ struct util_cfg util_cfg = { ++ .pe_sys_clk_ratio = PE_SYS_CLK_RATIO, ++ }; ++#endif ++ ++ struct BMU_CFG bmu1_cfg = { ++ .baseaddr = CBUS_VIRT_TO_PFE(LMEM_BASE_ADDR + ++ BMU1_LMEM_BASEADDR), ++ .count = BMU1_BUF_COUNT, ++ .size = BMU1_BUF_SIZE, ++ .low_watermark = 10, ++ .high_watermark = 15, ++ }; ++ ++ struct BMU_CFG bmu2_cfg = { ++ .baseaddr = DDR_PHYS_TO_PFE(pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR), ++ .count = BMU2_BUF_COUNT, ++ .size = BMU2_BUF_SIZE, ++ .low_watermark = 250, ++ .high_watermark = 253, ++ }; ++ ++ struct gpi_cfg egpi1_cfg = { ++ .lmem_rtry_cnt = EGPI1_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI1_TMLF_TXTHRES, ++ .aseq_len = EGPI1_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC1_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg egpi2_cfg = { ++ .lmem_rtry_cnt = EGPI2_LMEM_RTRY_CNT, ++ .tmlf_txthres = EGPI2_TMLF_TXTHRES, ++ .aseq_len = EGPI2_ASEQ_LEN, ++ .mtip_pause_reg = CBUS_VIRT_TO_PFE(EMAC2_BASE_ADDR + ++ EMAC_TCNTRL_REG), ++ }; ++ ++ struct gpi_cfg hgpi_cfg = { ++ .lmem_rtry_cnt = HGPI_LMEM_RTRY_CNT, ++ .tmlf_txthres = HGPI_TMLF_TXTHRES, ++ .aseq_len = HGPI_ASEQ_LEN, ++ .mtip_pause_reg = 0, ++ }; ++ ++ pr_info("%s\n", __func__); ++ ++#if !defined(LS1012A_PFE_RESET_WA) ++ /* LS1012A needs this to make PE work correctly */ ++ writel(0x3, CLASS_PE_SYS_CLK_RATIO); ++ writel(0x3, TMU_PE_SYS_CLK_RATIO); ++ writel(0x3, UTIL_PE_SYS_CLK_RATIO); ++ usleep_range(10, 20); ++#endif ++ ++ pr_info("CLASS version: %x\n", readl(CLASS_VERSION)); ++ pr_info("TMU version: %x\n", readl(TMU_VERSION)); ++ ++ pr_info("BMU1 version: %x\n", readl(BMU1_BASE_ADDR + ++ BMU_VERSION)); ++ pr_info("BMU2 version: %x\n", readl(BMU2_BASE_ADDR + ++ BMU_VERSION)); ++ ++ pr_info("EGPI1 version: %x\n", readl(EGPI1_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("EGPI2 version: %x\n", readl(EGPI2_BASE_ADDR + ++ GPI_VERSION)); ++ pr_info("HGPI version: %x\n", readl(HGPI_BASE_ADDR + ++ GPI_VERSION)); ++ ++ pr_info("HIF version: %x\n", readl(HIF_VERSION)); ++ pr_info("HIF NOPCY version: %x\n", readl(HIF_NOCPY_VERSION)); ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ pr_info("UTIL version: %x\n", readl(UTIL_VERSION)); ++#endif ++ while (!(readl(TMU_CTRL) & ECC_MEM_INIT_DONE)) ++ ; ++ ++ hif_rx_disable(); ++ hif_tx_disable(); ++ ++ bmu_init(BMU1_BASE_ADDR, &bmu1_cfg); ++ ++ pr_info("bmu_init(1) done\n"); ++ ++ bmu_init(BMU2_BASE_ADDR, &bmu2_cfg); ++ ++ pr_info("bmu_init(2) done\n"); ++ ++ class_cfg.resume = resume ? 1 : 0; ++ ++ class_init(&class_cfg); ++ ++ pr_info("class_init() done\n"); ++ ++ tmu_init(&tmu_cfg); ++ ++ pr_info("tmu_init() done\n"); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_init(&util_cfg); ++ ++ pr_info("util_init() done\n"); ++#endif ++ gpi_init(EGPI1_BASE_ADDR, &egpi1_cfg); ++ ++ pr_info("gpi_init(1) done\n"); ++ ++ gpi_init(EGPI2_BASE_ADDR, &egpi2_cfg); ++ ++ pr_info("gpi_init(2) done\n"); ++ ++ gpi_init(HGPI_BASE_ADDR, &hgpi_cfg); ++ ++ pr_info("gpi_init(hif) done\n"); ++ ++ bmu_enable(BMU1_BASE_ADDR); ++ ++ pr_info("bmu_enable(1) done\n"); ++ ++ bmu_enable(BMU2_BASE_ADDR); ++ ++ pr_info("bmu_enable(2) done\n"); ++ ++ return 0; ++} ++ ++void pfe_hw_exit(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ bmu_disable(BMU1_BASE_ADDR); ++ bmu_reset(BMU1_BASE_ADDR); ++ ++ bmu_disable(BMU2_BASE_ADDR); ++ bmu_reset(BMU2_BASE_ADDR); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_hw.h +@@ -0,0 +1,27 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_HW_H_ ++#define _PFE_HW_H_ ++ ++#define PE_SYS_CLK_RATIO 1 /* SYS/AXI = 250MHz, HFE = 500MHz */ ++ ++int pfe_hw_init(struct pfe *pfe, int resume); ++void pfe_hw_exit(struct pfe *pfe); ++ ++#endif /* _PFE_HW_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_ls1012a_platform.c +@@ -0,0 +1,394 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++struct ls1012a_pfe_platform_data pfe_platform_data; ++ ++static int pfe_get_gemac_if_proprties(struct device_node *parent, int port, int ++ if_cnt, ++ struct ls1012a_pfe_platform_data ++ *pdata) ++{ ++ struct device_node *gem = NULL, *phy = NULL; ++ int size; ++ int ii = 0, phy_id = 0; ++ const u32 *addr; ++ const void *mac_addr; ++ ++ for (ii = 0; ii < if_cnt; ii++) { ++ gem = of_get_next_child(parent, gem); ++ if (!gem) ++ goto err; ++ addr = of_get_property(gem, "reg", &size); ++ if (addr && (be32_to_cpup(addr) == port)) ++ break; ++ } ++ ++ if (ii >= if_cnt) { ++ pr_err("%s:%d Failed to find interface = %d\n", ++ __func__, __LINE__, if_cnt); ++ goto err; ++ } ++ ++ pdata->ls1012a_eth_pdata[port].gem_id = port; ++ ++ mac_addr = of_get_mac_address(gem); ++ ++ if (mac_addr) { ++ memcpy(pdata->ls1012a_eth_pdata[port].mac_addr, mac_addr, ++ ETH_ALEN); ++ } ++ ++ pdata->ls1012a_eth_pdata[port].mii_config = of_get_phy_mode(gem); ++ ++ if ((pdata->ls1012a_eth_pdata[port].mii_config) < 0) ++ pr_err("%s:%d Incorrect Phy mode....\n", __func__, ++ __LINE__); ++ ++ addr = of_get_property(gem, "fsl,gemac-bus-id", &size); ++ if (!addr) ++ pr_err("%s:%d Invalid gemac-bus-id....\n", __func__, ++ __LINE__); ++ else ++ pdata->ls1012a_eth_pdata[port].bus_id = be32_to_cpup(addr); ++ ++ addr = of_get_property(gem, "fsl,gemac-phy-id", &size); ++ if (!addr) { ++ pr_err("%s:%d Invalid gemac-phy-id....\n", __func__, ++ __LINE__); ++ } else { ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].phy_id = phy_id; ++ pdata->ls1012a_mdio_pdata[0].phy_mask &= ~(1 << phy_id); ++ } ++ ++ addr = of_get_property(gem, "fsl,mdio-mux-val", &size); ++ if (!addr) ++ pr_err("%s: Invalid mdio-mux-val....\n", __func__); ++ else ++ phy_id = be32_to_cpup(addr); ++ pdata->ls1012a_eth_pdata[port].mdio_muxval = phy_id; ++ ++ if (pdata->ls1012a_eth_pdata[port].phy_id < 32) ++ pfe->mdio_muxval[pdata->ls1012a_eth_pdata[port].phy_id] = ++ pdata->ls1012a_eth_pdata[port].mdio_muxval; ++ ++ addr = of_get_property(gem, "fsl,pfe-phy-if-flags", &size); ++ if (!addr) ++ pr_err("%s:%d Invalid pfe-phy-if-flags....\n", ++ __func__, __LINE__); ++ else ++ pdata->ls1012a_eth_pdata[port].phy_flags = be32_to_cpup(addr); ++ ++ /* If PHY is enabled, read mdio properties */ ++ if (pdata->ls1012a_eth_pdata[port].phy_flags & GEMAC_NO_PHY) ++ goto done; ++ ++ phy = of_get_next_child(gem, NULL); ++ ++ addr = of_get_property(phy, "reg", &size); ++ ++ if (!addr) ++ pr_err("%s:%d Invalid phy enable flag....\n", ++ __func__, __LINE__); ++ else ++ pdata->ls1012a_mdio_pdata[port].enabled = be32_to_cpup(addr); ++ ++ pdata->ls1012a_mdio_pdata[port].irq[0] = PHY_POLL; ++ ++done: ++ ++ return 0; ++ ++err: ++ return -1; ++} ++ ++/* ++ * ++ * pfe_platform_probe - ++ * ++ * ++ */ ++static int pfe_platform_probe(struct platform_device *pdev) ++{ ++ struct resource res; ++ int ii, rc, interface_count = 0, size = 0; ++ const u32 *prop; ++ struct device_node *np; ++ struct clk *pfe_clk; ++ ++ np = pdev->dev.of_node; ++ ++ if (!np) { ++ pr_err("Invalid device node\n"); ++ return -EINVAL; ++ } ++ ++ pfe = kzalloc(sizeof(*pfe), GFP_KERNEL); ++ if (!pfe) { ++ rc = -ENOMEM; ++ goto err_alloc; ++ } ++ ++ platform_set_drvdata(pdev, pfe); ++ ++ dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); ++ ++ if (of_address_to_resource(np, 1, &res)) { ++ rc = -ENOMEM; ++ pr_err("failed to get ddr resource\n"); ++ goto err_ddr; ++ } ++ ++ pfe->ddr_phys_baseaddr = res.start; ++ pfe->ddr_size = resource_size(&res); ++ ++ pfe->ddr_baseaddr = phys_to_virt(res.start); ++ if (!pfe->ddr_baseaddr) { ++ pr_err("ioremap() ddr failed\n"); ++ rc = -ENOMEM; ++ goto err_ddr; ++ } ++ ++ pfe->scfg = ++ syscon_regmap_lookup_by_phandle(pdev->dev.of_node, ++ "fsl,pfe-scfg"); ++ if (IS_ERR(pfe->scfg)) { ++ dev_err(&pdev->dev, "No syscfg phandle specified\n"); ++ return PTR_ERR(pfe->scfg); ++ } ++ ++ pfe->cbus_baseaddr = of_iomap(np, 0); ++ if (!pfe->cbus_baseaddr) { ++ rc = -ENOMEM; ++ pr_err("failed to get axi resource\n"); ++ goto err_axi; ++ } ++ ++ pfe->hif_irq = platform_get_irq(pdev, 0); ++ if (pfe->hif_irq < 0) { ++ pr_err("platform_get_irq for hif failed\n"); ++ rc = pfe->hif_irq; ++ goto err_hif_irq; ++ } ++ ++ pfe->wol_irq = platform_get_irq(pdev, 2); ++ if (pfe->wol_irq < 0) { ++ pr_err("platform_get_irq for WoL failed\n"); ++ rc = pfe->wol_irq; ++ goto err_hif_irq; ++ } ++ ++ /* Read interface count */ ++ prop = of_get_property(np, "fsl,pfe-num-interfaces", &size); ++ if (!prop) { ++ pr_err("Failed to read number of interfaces\n"); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ interface_count = be32_to_cpup(prop); ++ if (interface_count <= 0) { ++ pr_err("No ethernet interface count : %d\n", ++ interface_count); ++ rc = -ENXIO; ++ goto err_prop; ++ } ++ ++ pfe_platform_data.ls1012a_mdio_pdata[0].phy_mask = 0xffffffff; ++ ++ for (ii = 0; ii < interface_count; ii++) { ++ pfe_get_gemac_if_proprties(np, ii, interface_count, ++ &pfe_platform_data); ++ } ++ ++ pfe->dev = &pdev->dev; ++ ++ pfe->dev->platform_data = &pfe_platform_data; ++ ++ /* declare WoL capabilities */ ++ device_init_wakeup(&pdev->dev, true); ++ ++ /* find the clocks */ ++ pfe_clk = devm_clk_get(pfe->dev, "pfe"); ++ if (IS_ERR(pfe_clk)) ++ return PTR_ERR(pfe_clk); ++ ++ /* PFE clock is (platform clock / 2) */ ++ /* save sys_clk value as KHz */ ++ pfe->ctrl.sys_clk = clk_get_rate(pfe_clk) / (2 * 1000); ++ ++ rc = pfe_probe(pfe); ++ if (rc < 0) ++ goto err_probe; ++ ++ return 0; ++ ++err_probe: ++err_prop: ++err_hif_irq: ++ iounmap(pfe->cbus_baseaddr); ++ ++err_axi: ++ iounmap(pfe->ddr_baseaddr); ++ ++err_ddr: ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++err_alloc: ++ return rc; ++} ++ ++/* ++ * pfe_platform_remove - ++ */ ++static int pfe_platform_remove(struct platform_device *pdev) ++{ ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ int rc; ++ ++ pr_info("%s\n", __func__); ++ ++ rc = pfe_remove(pfe); ++ ++ iounmap(pfe->cbus_baseaddr); ++ iounmap(pfe->ddr_baseaddr); ++ ++ platform_set_drvdata(pdev, NULL); ++ ++ kfree(pfe); ++ ++ return rc; ++} ++ ++#ifdef CONFIG_PM ++#ifdef CONFIG_PM_SLEEP ++int pfe_platform_suspend(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ pfe->wake = 0; ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ netif_device_detach(netdev); ++ ++ if (netif_running(netdev)) ++ if (pfe_eth_suspend(netdev)) ++ pfe->wake = 1; ++ } ++ ++ /* Shutdown PFE only if we're not waking up the system */ ++ if (!pfe->wake) { ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_ctrl_suspend(&pfe->ctrl); ++ pfe_firmware_exit(pfe); ++ ++ pfe_hif_exit(pfe); ++ pfe_hif_lib_exit(pfe); ++ ++ pfe_hw_exit(pfe); ++ } ++ ++ return 0; ++} ++ ++static int pfe_platform_resume(struct device *dev) ++{ ++ struct pfe *pfe = platform_get_drvdata(to_platform_device(dev)); ++ struct net_device *netdev; ++ int i; ++ ++ if (!pfe->wake) { ++ pfe_hw_init(pfe, 1); ++ pfe_hif_lib_init(pfe); ++ pfe_hif_init(pfe); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ util_enable(); ++#endif ++ tmu_enable(0xf); ++ class_enable(); ++ pfe_ctrl_resume(&pfe->ctrl); ++ } ++ ++ for (i = 0; i < (NUM_GEMAC_SUPPORT); i++) { ++ netdev = pfe->eth.eth_priv[i]->ndev; ++ ++ if (pfe->eth.eth_priv[i]->mii_bus) ++ pfe_eth_mdio_reset(pfe->eth.eth_priv[i]->mii_bus); ++ ++ if (netif_running(netdev)) ++ pfe_eth_resume(netdev); ++ ++ netif_device_attach(netdev); ++ } ++ return 0; ++} ++#else ++#define pfe_platform_suspend NULL ++#define pfe_platform_resume NULL ++#endif ++ ++static const struct dev_pm_ops pfe_platform_pm_ops = { ++ SET_SYSTEM_SLEEP_PM_OPS(pfe_platform_suspend, pfe_platform_resume) ++}; ++#endif ++ ++static const struct of_device_id pfe_match[] = { ++ { ++ .compatible = "fsl,pfe", ++ }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, pfe_match); ++ ++static struct platform_driver pfe_platform_driver = { ++ .probe = pfe_platform_probe, ++ .remove = pfe_platform_remove, ++ .driver = { ++ .name = "pfe", ++ .of_match_table = pfe_match, ++#ifdef CONFIG_PM ++ .pm = &pfe_platform_pm_ops, ++#endif ++ }, ++}; ++ ++module_platform_driver(pfe_platform_driver); ++MODULE_LICENSE("GPL"); ++MODULE_DESCRIPTION("PFE Ethernet driver"); ++MODULE_AUTHOR("NXP DNCPE"); +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.c +@@ -0,0 +1,141 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include "pfe_mod.h" ++ ++struct pfe *pfe; ++ ++/* ++ * pfe_probe - ++ */ ++int pfe_probe(struct pfe *pfe) ++{ ++ int rc; ++ ++ if (pfe->ddr_size < DDR_MAX_SIZE) { ++ pr_err("%s: required DDR memory (%x) above platform ddr memory (%x)\n", ++ __func__, (unsigned int)DDR_MAX_SIZE, pfe->ddr_size); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ if (((int)(pfe->ddr_phys_baseaddr + BMU2_DDR_BASEADDR) & ++ (8 * SZ_1M - 1)) != 0) { ++ pr_err("%s: BMU2 base address (0x%x) must be aligned on 8MB boundary\n", ++ __func__, (int)pfe->ddr_phys_baseaddr + ++ BMU2_DDR_BASEADDR); ++ rc = -ENOMEM; ++ goto err_hw; ++ } ++ ++ pr_info("cbus_baseaddr: %lx, ddr_baseaddr: %lx, ddr_phys_baseaddr: %lx, ddr_size: %x\n", ++ (unsigned long)pfe->cbus_baseaddr, ++ (unsigned long)pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ pfe_lib_init(pfe->cbus_baseaddr, pfe->ddr_baseaddr, ++ pfe->ddr_phys_baseaddr, pfe->ddr_size); ++ ++ rc = pfe_hw_init(pfe, 0); ++ if (rc < 0) ++ goto err_hw; ++ ++ rc = pfe_hif_lib_init(pfe); ++ if (rc < 0) ++ goto err_hif_lib; ++ ++ rc = pfe_hif_init(pfe); ++ if (rc < 0) ++ goto err_hif; ++ ++ rc = pfe_firmware_init(pfe); ++ if (rc < 0) ++ goto err_firmware; ++ ++ rc = pfe_ctrl_init(pfe); ++ if (rc < 0) ++ goto err_ctrl; ++ ++ rc = pfe_eth_init(pfe); ++ if (rc < 0) ++ goto err_eth; ++ ++ rc = pfe_sysfs_init(pfe); ++ if (rc < 0) ++ goto err_sysfs; ++ ++ rc = pfe_debugfs_init(pfe); ++ if (rc < 0) ++ goto err_debugfs; ++ ++ return 0; ++ ++err_debugfs: ++ pfe_sysfs_exit(pfe); ++ ++err_sysfs: ++ pfe_eth_exit(pfe); ++ ++err_eth: ++ pfe_ctrl_exit(pfe); ++ ++err_ctrl: ++ pfe_firmware_exit(pfe); ++ ++err_firmware: ++ pfe_hif_exit(pfe); ++ ++err_hif: ++ pfe_hif_lib_exit(pfe); ++ ++err_hif_lib: ++ pfe_hw_exit(pfe); ++ ++err_hw: ++ return rc; ++} ++ ++/* ++ * pfe_remove - ++ */ ++int pfe_remove(struct pfe *pfe) ++{ ++ pr_info("%s\n", __func__); ++ ++ pfe_debugfs_exit(pfe); ++ ++ pfe_sysfs_exit(pfe); ++ ++ pfe_eth_exit(pfe); ++ ++ pfe_ctrl_exit(pfe); ++ ++#if defined(LS1012A_PFE_RESET_WA) ++ pfe_hif_rx_idle(&pfe->hif); ++#endif ++ pfe_firmware_exit(pfe); ++ ++ pfe_hif_exit(pfe); ++ ++ pfe_hif_lib_exit(pfe); ++ ++ pfe_hw_exit(pfe); ++ ++ return 0; ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_mod.h +@@ -0,0 +1,112 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_MOD_H_ ++#define _PFE_MOD_H_ ++ ++#include ++#include ++ ++struct pfe; ++ ++#include "pfe_hw.h" ++#include "pfe_firmware.h" ++#include "pfe_ctrl.h" ++#include "pfe_hif.h" ++#include "pfe_hif_lib.h" ++#include "pfe_eth.h" ++#include "pfe_sysfs.h" ++#include "pfe_perfmon.h" ++#include "pfe_debugfs.h" ++ ++#define PHYID_MAX_VAL 32 ++ ++struct pfe_tmu_credit { ++ /* Number of allowed TX packet in-flight, matches TMU queue size */ ++ unsigned int tx_credit[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_credit_max[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++ unsigned int tx_packets[NUM_GEMAC_SUPPORT][EMAC_TXQ_CNT]; ++}; ++ ++struct pfe { ++ struct regmap *scfg; ++ unsigned long ddr_phys_baseaddr; ++ void *ddr_baseaddr; ++ unsigned int ddr_size; ++ void *cbus_baseaddr; ++ void *apb_baseaddr; ++ unsigned long iram_phys_baseaddr; ++ void *iram_baseaddr; ++ unsigned long ipsec_phys_baseaddr; ++ void *ipsec_baseaddr; ++ int hif_irq; ++ int wol_irq; ++ int hif_client_irq; ++ struct device *dev; ++ struct dentry *dentry; ++ struct pfe_ctrl ctrl; ++ struct pfe_hif hif; ++ struct pfe_eth eth; ++ struct hif_client_s *hif_client[HIF_CLIENTS_MAX]; ++#if defined(CFG_DIAGS) ++ struct pfe_diags diags; ++#endif ++ struct pfe_tmu_credit tmu_credit; ++ struct pfe_cpumon cpumon; ++ struct pfe_memmon memmon; ++ int wake; ++ int mdio_muxval[PHYID_MAX_VAL]; ++ struct clk *hfe_clock; ++}; ++ ++extern struct pfe *pfe; ++ ++int pfe_probe(struct pfe *pfe); ++int pfe_remove(struct pfe *pfe); ++ ++/* DDR Mapping in reserved memory*/ ++#define ROUTE_TABLE_BASEADDR 0 ++#define ROUTE_TABLE_HASH_BITS 15 /* 32K entries */ ++#define ROUTE_TABLE_SIZE ((1 << ROUTE_TABLE_HASH_BITS) \ ++ * CLASS_ROUTE_SIZE) ++#define BMU2_DDR_BASEADDR (ROUTE_TABLE_BASEADDR + ROUTE_TABLE_SIZE) ++#define BMU2_BUF_COUNT (4096 - 256) ++/* This is to get a total DDR size of 12MiB */ ++#define BMU2_DDR_SIZE (DDR_BUF_SIZE * BMU2_BUF_COUNT) ++#define UTIL_CODE_BASEADDR (BMU2_DDR_BASEADDR + BMU2_DDR_SIZE) ++#define UTIL_CODE_SIZE (128 * SZ_1K) ++#define UTIL_DDR_DATA_BASEADDR (UTIL_CODE_BASEADDR + UTIL_CODE_SIZE) ++#define UTIL_DDR_DATA_SIZE (64 * SZ_1K) ++#define CLASS_DDR_DATA_BASEADDR (UTIL_DDR_DATA_BASEADDR + UTIL_DDR_DATA_SIZE) ++#define CLASS_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_DDR_DATA_BASEADDR (CLASS_DDR_DATA_BASEADDR + CLASS_DDR_DATA_SIZE) ++#define TMU_DDR_DATA_SIZE (32 * SZ_1K) ++#define TMU_LLM_BASEADDR (TMU_DDR_DATA_BASEADDR + TMU_DDR_DATA_SIZE) ++#define TMU_LLM_QUEUE_LEN (8 * 512) ++/* Must be power of two and at least 16 * 8 = 128 bytes */ ++#define TMU_LLM_SIZE (4 * 16 * TMU_LLM_QUEUE_LEN) ++/* (4 TMU's x 16 queues x queue_len) */ ++ ++#define DDR_MAX_SIZE (TMU_LLM_BASEADDR + TMU_LLM_SIZE) ++ ++/* LMEM Mapping */ ++#define BMU1_LMEM_BASEADDR 0 ++#define BMU1_BUF_COUNT 256 ++#define BMU1_LMEM_SIZE (LMEM_BUF_SIZE * BMU1_BUF_COUNT) ++ ++#endif /* _PFE_MOD_H */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_perfmon.h +@@ -0,0 +1,38 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_PERFMON_H_ ++#define _PFE_PERFMON_H_ ++ ++#include "pfe/pfe.h" ++ ++#define CT_CPUMON_INTERVAL (1 * TIMER_TICKS_PER_SEC) ++ ++struct pfe_cpumon { ++ u32 cpu_usage_pct[MAX_PE]; ++ u32 class_usage_pct; ++}; ++ ++struct pfe_memmon { ++ u32 kernel_memory_allocated; ++}; ++ ++int pfe_perfmon_init(struct pfe *pfe); ++void pfe_perfmon_exit(struct pfe *pfe); ++ ++#endif /* _PFE_PERFMON_H_ */ +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.c +@@ -0,0 +1,818 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include ++#include ++ ++#include "pfe_mod.h" ++ ++#define PE_EXCEPTION_DUMP_ADDRESS 0x1fa8 ++#define NUM_QUEUES 16 ++ ++static char register_name[20][5] = { ++ "EPC", "ECAS", "EID", "ED", ++ "r0", "r1", "r2", "r3", ++ "r4", "r5", "r6", "r7", ++ "r8", "r9", "r10", "r11", ++ "r12", "r13", "r14", "r15", ++}; ++ ++static char exception_name[14][20] = { ++ "Reset", ++ "HardwareFailure", ++ "NMI", ++ "InstBreakpoint", ++ "DataBreakpoint", ++ "Unsupported", ++ "PrivilegeViolation", ++ "InstBusError", ++ "DataBusError", ++ "AlignmentError", ++ "ArithmeticError", ++ "SystemCall", ++ "MemoryManagement", ++ "Interrupt", ++}; ++ ++static unsigned long class_do_clear; ++static unsigned long tmu_do_clear; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static unsigned long util_do_clear; ++#endif ++ ++static ssize_t display_pe_status(char *buf, int id, u32 dmem_addr, unsigned long ++ do_clear) ++{ ++ ssize_t len = 0; ++ u32 val; ++ char statebuf[5]; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ u32 debug_indicator; ++ u32 debug[20]; ++ ++ *(u32 *)statebuf = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ ++ statebuf[4] = '\0'; ++ len += sprintf(buf + len, "state=%4s ", statebuf); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "ctr=%08x ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ len += sprintf(buf + len, "rx=%u ", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (id >= TMU0_ID && id <= TMU_MAX_ID) ++ len += sprintf(buf + len, "qstatus=%x", cpu_to_be32(val)); ++ else ++ len += sprintf(buf + len, "tx=%u", cpu_to_be32(val)); ++ ++ val = pe_dmem_read(id, dmem_addr, 4); ++ if (do_clear && val) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ dmem_addr += 4; ++ if (val) ++ len += sprintf(buf + len, " drop=%u", cpu_to_be32(val)); ++ ++ len += sprintf(buf + len, " load=%d%%", cpumon->cpu_usage_pct[id]); ++ ++ len += sprintf(buf + len, "\n"); ++ ++ debug_indicator = pe_dmem_read(id, dmem_addr, 4); ++ dmem_addr += 4; ++ if (!strncmp((char *)&debug_indicator, "DBUG", 4)) { ++ int j, last = 0; ++ ++ for (j = 0; j < 16; j++) { ++ debug[j] = pe_dmem_read(id, dmem_addr, 4); ++ if (debug[j]) { ++ if (do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ last = j + 1; ++ } ++ dmem_addr += 4; ++ } ++ for (j = 0; j < last; j++) { ++ len += sprintf(buf + len, "%08x%s", ++ cpu_to_be32(debug[j]), ++ (j & 0x7) == 0x7 || j == last - 1 ? "\n" : " "); ++ } ++ } ++ ++ if (!strncmp(statebuf, "DEAD", 4)) { ++ u32 i, dump = PE_EXCEPTION_DUMP_ADDRESS; ++ ++ len += sprintf(buf + len, "Exception details:\n"); ++ for (i = 0; i < 20; i++) { ++ debug[i] = pe_dmem_read(id, dump, 4); ++ dump += 4; ++ if (i == 2) ++ len += sprintf(buf + len, "%4s = %08x (=%s) ", ++ register_name[i], cpu_to_be32(debug[i]), ++ exception_name[min((u32) ++ cpu_to_be32(debug[i]), (u32)13)]); ++ else ++ len += sprintf(buf + len, "%4s = %08x%s", ++ register_name[i], cpu_to_be32(debug[i]), ++ (i & 0x3) == 0x3 || i == 19 ? "\n" : " "); ++ } ++ } ++ ++ return len; ++} ++ ++static ssize_t class_phy_stats(char *buf, int phy) ++{ ++ ssize_t len = 0; ++ int off1 = phy * 0x28; ++ int off2 = phy * 0x10; ++ ++ if (phy == 3) ++ off1 = CLASS_PHY4_RX_PKTS - CLASS_PHY1_RX_PKTS; ++ ++ len += sprintf(buf + len, "phy: %d\n", phy); ++ len += sprintf(buf + len, ++ " rx: %10u, tx: %10u, intf: %10u, ipv4: %10u, ipv6: %10u\n", ++ readl(CLASS_PHY1_RX_PKTS + off1), ++ readl(CLASS_PHY1_TX_PKTS + off1), ++ readl(CLASS_PHY1_INTF_MATCH_PKTS + off1), ++ readl(CLASS_PHY1_V4_PKTS + off1), ++ readl(CLASS_PHY1_V6_PKTS + off1)); ++ ++ len += sprintf(buf + len, ++ " icmp: %10u, igmp: %10u, tcp: %10u, udp: %10u\n", ++ readl(CLASS_PHY1_ICMP_PKTS + off2), ++ readl(CLASS_PHY1_IGMP_PKTS + off2), ++ readl(CLASS_PHY1_TCP_PKTS + off2), ++ readl(CLASS_PHY1_UDP_PKTS + off2)); ++ ++ len += sprintf(buf + len, " err\n"); ++ len += sprintf(buf + len, ++ " lp: %10u, intf: %10u, l3: %10u, chcksum: %10u, ttl: %10u\n", ++ readl(CLASS_PHY1_LP_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_INTF_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_L3_FAIL_PKTS + off1), ++ readl(CLASS_PHY1_CHKSUM_ERR_PKTS + off1), ++ readl(CLASS_PHY1_TTL_ERR_PKTS + off1)); ++ ++ return len; ++} ++ ++/* qm_read_drop_stat ++ * This function is used to read the drop statistics from the TMU ++ * hw drop counter. Since the hw counter is always cleared afer ++ * reading, this function maintains the previous drop count, and ++ * adds the new value to it. That value can be retrieved by ++ * passing a pointer to it with the total_drops arg. ++ * ++ * @param tmu TMU number (0 - 3) ++ * @param queue queue number (0 - 15) ++ * @param total_drops pointer to location to store total drops (or NULL) ++ * @param do_reset if TRUE, clear total drops after updating ++ */ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset) ++{ ++ static u32 qtotal[TMU_MAX_ID + 1][NUM_QUEUES]; ++ u32 val; ++ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ val = readl(TMU_TEQ_DROP_STAT); ++ qtotal[tmu][queue] += val; ++ if (total_drops) ++ *total_drops = qtotal[tmu][queue]; ++ if (do_reset) ++ qtotal[tmu][queue] = 0; ++ return val; ++} ++ ++static ssize_t tmu_queue_stats(char *buf, int tmu, int queue) ++{ ++ ssize_t len = 0; ++ u32 drops; ++ ++ len += sprintf(buf + len, "%d-%02d, ", tmu, queue); ++ ++ drops = qm_read_drop_stat(tmu, queue, NULL, 0); ++ ++ /* Select queue */ ++ writel((tmu << 8) | queue, TMU_TEQ_CTRL); ++ writel((tmu << 8) | queue, TMU_LLM_CTRL); ++ ++ len += sprintf(buf + len, ++ "(teq) drop: %10u, tx: %10u (llm) head: %08x, tail: %08x, drop: %10u\n", ++ drops, readl(TMU_TEQ_TRANS_STAT), ++ readl(TMU_LLM_QUE_HEADPTR), readl(TMU_LLM_QUE_TAILPTR), ++ readl(TMU_LLM_QUE_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t tmu_queues(char *buf, int tmu) ++{ ++ ssize_t len = 0; ++ int queue; ++ ++ for (queue = 0; queue < 16; queue++) ++ len += tmu_queue_stats(buf + len, tmu, queue); ++ ++ return len; ++} ++ ++static ssize_t block_version(char *buf, void *addr) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ val = readl(addr); ++ len += sprintf(buf + len, "revision: %x, version: %x, id: %x\n", ++ (val >> 24) & 0xff, (val >> 16) & 0xff, val & 0xffff); ++ ++ return len; ++} ++ ++static ssize_t bmu(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "%s: %d\n ", __func__, id); ++ ++ len += block_version(buf + len, base + BMU_VERSION); ++ ++ len += sprintf(buf + len, " buf size: %x\n", (1 << readl(base + ++ BMU_BUF_SIZE))); ++ len += sprintf(buf + len, " buf count: %x\n", readl(base + ++ BMU_BUF_CNT)); ++ len += sprintf(buf + len, " buf rem: %x\n", readl(base + ++ BMU_REM_BUF_CNT)); ++ len += sprintf(buf + len, " buf curr: %x\n", readl(base + ++ BMU_CURR_BUF_CNT)); ++ len += sprintf(buf + len, " free err: %x\n", readl(base + ++ BMU_FREE_ERR_ADDR)); ++ ++ return len; ++} ++ ++static ssize_t gpi(char *buf, int id, void *base) ++{ ++ ssize_t len = 0; ++ u32 val; ++ ++ len += sprintf(buf + len, "%s%d:\n ", __func__, id); ++ len += block_version(buf + len, base + GPI_VERSION); ++ ++ len += sprintf(buf + len, " tx under stick: %x\n", readl(base + ++ GPI_FIFO_STATUS)); ++ val = readl(base + GPI_FIFO_DEBUG); ++ len += sprintf(buf + len, " tx pkts: %x\n", (val >> 23) & ++ 0x3f); ++ len += sprintf(buf + len, " rx pkts: %x\n", (val >> 18) & ++ 0x3f); ++ len += sprintf(buf + len, " tx bytes: %x\n", (val >> 9) & ++ 0x1ff); ++ len += sprintf(buf + len, " rx bytes: %x\n", (val >> 0) & ++ 0x1ff); ++ len += sprintf(buf + len, " overrun: %x\n", readl(base + ++ GPI_OVERRUN_DROPCNT)); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_class(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ class_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_class(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ struct pfe_cpumon *cpumon = &pfe->cpumon; ++ ++ len += block_version(buf + len, CLASS_VERSION); ++ ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ len += sprintf(buf + len, "%d: ", id - CLASS0_ID); ++ ++ val = readl(CLASS_PE0_DEBUG + id * 4); ++ len += sprintf(buf + len, "pc=1%04x ", val & 0xffff); ++ ++ len += display_pe_status(buf + len, id, CLASS_DM_PESTATUS, ++ class_do_clear); ++ } ++ len += sprintf(buf + len, "aggregate load=%d%%\n\n", ++ cpumon->class_usage_pct); ++ ++ len += sprintf(buf + len, "pe status: 0x%x\n", ++ readl(CLASS_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: 0x%x afull thres: 0x%x\n", ++ readl(CLASS_MAX_BUF_CNT), readl(CLASS_AFULL_THRES)); ++ len += sprintf(buf + len, "tsq max cnt: 0x%x tsq fifo thres: 0x%x\n", ++ readl(CLASS_TSQ_MAX_CNT), readl(CLASS_TSQ_FIFO_THRES)); ++ len += sprintf(buf + len, "state: 0x%x\n", readl(CLASS_STATE)); ++ ++ len += class_phy_stats(buf + len, 0); ++ len += class_phy_stats(buf + len, 1); ++ len += class_phy_stats(buf + len, 2); ++ len += class_phy_stats(buf + len, 3); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_tmu(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ tmu_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_tmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id; ++ u32 val; ++ ++ len += block_version(buf + len, TMU_VERSION); ++ ++ for (id = TMU0_ID; id <= TMU_MAX_ID; id++) { ++ if (id == TMU2_ID) ++ continue; ++ len += sprintf(buf + len, "%d: ", id - TMU0_ID); ++ ++ len += display_pe_status(buf + len, id, TMU_DM_PESTATUS, ++ tmu_do_clear); ++ } ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(TMU_PE_STATUS)); ++ len += sprintf(buf + len, "inq fifo cnt: %x\n", ++ readl(TMU_PHY_INQ_FIFO_CNT)); ++ val = readl(TMU_INQ_STAT); ++ len += sprintf(buf + len, "inq wr ptr: %x\n", val & 0x3ff); ++ len += sprintf(buf + len, "inq rd ptr: %x\n", val >> 10); ++ ++ return len; ++} ++ ++static unsigned long drops_do_clear; ++static u32 class_drop_counter[CLASS_NUM_DROP_COUNTERS]; ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static u32 util_drop_counter[UTIL_NUM_DROP_COUNTERS]; ++#endif ++ ++char *class_drop_description[CLASS_NUM_DROP_COUNTERS] = { ++ "ICC", ++ "Host Pkt Error", ++ "Rx Error", ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "EXPT IPsec Error", ++ "Reassembly", ++ "Fragmenter", ++ "NAT-T", ++ "Socket", ++ "Multicast", ++ "NAT-PT", ++ "Tx Disabled", ++}; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++char *util_drop_description[UTIL_NUM_DROP_COUNTERS] = { ++ "IPsec Outbound", ++ "IPsec Inbound", ++ "IPsec Rate Limiter", ++ "Fragmenter", ++ "Socket", ++ "Tx Disabled", ++ "Rx Error", ++}; ++#endif ++ ++static ssize_t pfe_set_drops(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ drops_do_clear = kstrtoul(buf, 0, 0); ++ return count; ++} ++ ++static u32 tmu_drops[4][16]; ++static ssize_t pfe_show_drops(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ int id, dropnum; ++ int tmu, queue; ++ u32 val; ++ u32 dmem_addr; ++ int num_class_drops = 0, num_tmu_drops = 0, num_util_drops = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ memset(class_drop_counter, 0, sizeof(class_drop_counter)); ++ for (id = CLASS0_ID; id <= CLASS_MAX_ID; id++) { ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << id)); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ dmem_addr = CLASS_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(id, dmem_addr, 4)); ++ class_drop_counter[dropnum] += val; ++ num_class_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(id, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << id)); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (drops_do_clear) ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ dmem_addr = UTIL_DM_DROP_CNTR; ++ val = be32_to_cpu(pe_dmem_read(UTIL_ID, dmem_addr, 4)); ++ util_drop_counter[dropnum] = val; ++ num_util_drops += val; ++ if (drops_do_clear) ++ pe_dmem_write(UTIL_ID, 0, dmem_addr, 4); ++ } ++ if (drops_do_clear) ++ pe_start(ctrl, (1 << UTIL_ID)); ++#endif ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ qm_read_drop_stat(tmu, queue, &tmu_drops[tmu][queue], ++ drops_do_clear); ++ num_tmu_drops += tmu_drops[tmu][queue]; ++ } ++ } ++ ++ if (num_class_drops == 0 && num_util_drops == 0 && num_tmu_drops == 0) ++ len += sprintf(buf + len, "No PE drops\n\n"); ++ ++ if (num_class_drops > 0) { ++ len += sprintf(buf + len, "Class PE drops --\n"); ++ for (dropnum = 0; dropnum < CLASS_NUM_DROP_COUNTERS; ++ dropnum++) { ++ if (class_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ class_drop_description[dropnum], ++ class_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (num_util_drops > 0) { ++ len += sprintf(buf + len, "Util PE drops --\n"); ++ for (dropnum = 0; dropnum < UTIL_NUM_DROP_COUNTERS; dropnum++) { ++ if (util_drop_counter[dropnum] > 0) ++ len += sprintf(buf + len, " %s: %d\n", ++ util_drop_description[dropnum], ++ util_drop_counter[dropnum]); ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++#endif ++ if (num_tmu_drops > 0) { ++ len += sprintf(buf + len, "TMU drops --\n"); ++ for (tmu = 0; tmu < 4; tmu++) { ++ for (queue = 0; queue < 16; queue++) { ++ if (tmu_drops[tmu][queue] > 0) ++ len += sprintf(buf + len, ++ " TMU%d-Q%d: %d\n" ++ , tmu, queue, tmu_drops[tmu][queue]); ++ } ++ } ++ len += sprintf(buf + len, "\n"); ++ } ++ ++ return len; ++} ++ ++static ssize_t pfe_show_tmu0_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 0); ++} ++ ++static ssize_t pfe_show_tmu1_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 1); ++} ++ ++static ssize_t pfe_show_tmu2_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 2); ++} ++ ++static ssize_t pfe_show_tmu3_queues(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ return tmu_queues(buf, 3); ++} ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static ssize_t pfe_set_util(struct device *dev, struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ util_do_clear = kstrtoul(buf, NULL, 0); ++ return count; ++} ++ ++static ssize_t pfe_show_util(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_ctrl *ctrl = &pfe->ctrl; ++ ++ len += block_version(buf + len, UTIL_VERSION); ++ ++ pe_sync_stop(ctrl, (1 << UTIL_ID)); ++ len += display_pe_status(buf + len, UTIL_ID, UTIL_DM_PESTATUS, ++ util_do_clear); ++ pe_start(ctrl, (1 << UTIL_ID)); ++ ++ len += sprintf(buf + len, "pe status: %x\n", readl(UTIL_PE_STATUS)); ++ len += sprintf(buf + len, "max buf cnt: %x\n", ++ readl(UTIL_MAX_BUF_CNT)); ++ len += sprintf(buf + len, "tsq max cnt: %x\n", ++ readl(UTIL_TSQ_MAX_CNT)); ++ ++ return len; ++} ++#endif ++ ++static ssize_t pfe_show_bmu(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += bmu(buf + len, 1, BMU1_BASE_ADDR); ++ len += bmu(buf + len, 2, BMU2_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_hif(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "hif:\n "); ++ len += block_version(buf + len, HIF_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_RX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, "hif nocopy:\n "); ++ len += block_version(buf + len, HIF_NOCPY_VERSION); ++ ++ len += sprintf(buf + len, " tx curr bd: %x\n", ++ readl(HIF_NOCPY_TX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " tx status: %x\n", ++ readl(HIF_NOCPY_TX_STATUS)); ++ len += sprintf(buf + len, " tx dma status: %x\n", ++ readl(HIF_NOCPY_TX_DMA_STATUS)); ++ ++ len += sprintf(buf + len, " rx curr bd: %x\n", ++ readl(HIF_NOCPY_RX_CURR_BD_ADDR)); ++ len += sprintf(buf + len, " rx status: %x\n", ++ readl(HIF_NOCPY_RX_STATUS)); ++ len += sprintf(buf + len, " rx dma status: %x\n", ++ readl(HIF_NOCPY_RX_DMA_STATUS)); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_gpi(struct device *dev, struct device_attribute *attr, ++ char *buf) ++{ ++ ssize_t len = 0; ++ ++ len += gpi(buf + len, 0, EGPI1_BASE_ADDR); ++ len += gpi(buf + len, 1, EGPI2_BASE_ADDR); ++ len += gpi(buf + len, 3, HGPI_BASE_ADDR); ++ ++ return len; ++} ++ ++static ssize_t pfe_show_pfemem(struct device *dev, struct device_attribute ++ *attr, char *buf) ++{ ++ ssize_t len = 0; ++ struct pfe_memmon *memmon = &pfe->memmon; ++ ++ len += sprintf(buf + len, "Kernel Memory: %d Bytes (%d KB)\n", ++ memmon->kernel_memory_allocated, ++ (memmon->kernel_memory_allocated + 1023) / 1024); ++ ++ return len; ++} ++ ++#ifdef HIF_NAPI_STATS ++static ssize_t pfe_show_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ char *buf) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ssize_t len = 0; ++ ++ len += sprintf(buf + len, "sched: %u\n", ++ pfe->hif.napi_counters[NAPI_SCHED_COUNT]); ++ len += sprintf(buf + len, "poll: %u\n", ++ pfe->hif.napi_counters[NAPI_POLL_COUNT]); ++ len += sprintf(buf + len, "packet: %u\n", ++ pfe->hif.napi_counters[NAPI_PACKET_COUNT]); ++ len += sprintf(buf + len, "budget: %u\n", ++ pfe->hif.napi_counters[NAPI_FULL_BUDGET_COUNT]); ++ len += sprintf(buf + len, "desc: %u\n", ++ pfe->hif.napi_counters[NAPI_DESC_COUNT]); ++ len += sprintf(buf + len, "full: %u\n", ++ pfe->hif.napi_counters[NAPI_CLIENT_FULL_COUNT]); ++ ++ return len; ++} ++ ++static ssize_t pfe_set_hif_napi_stats(struct device *dev, ++ struct device_attribute *attr, ++ const char *buf, size_t count) ++{ ++ struct platform_device *pdev = to_platform_device(dev); ++ struct pfe *pfe = platform_get_drvdata(pdev); ++ ++ memset(pfe->hif.napi_counters, 0, sizeof(pfe->hif.napi_counters)); ++ ++ return count; ++} ++ ++static DEVICE_ATTR(hif_napi_stats, 0644, pfe_show_hif_napi_stats, ++ pfe_set_hif_napi_stats); ++#endif ++ ++static DEVICE_ATTR(class, 0644, pfe_show_class, pfe_set_class); ++static DEVICE_ATTR(tmu, 0644, pfe_show_tmu, pfe_set_tmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++static DEVICE_ATTR(util, 0644, pfe_show_util, pfe_set_util); ++#endif ++static DEVICE_ATTR(bmu, 0444, pfe_show_bmu, NULL); ++static DEVICE_ATTR(hif, 0444, pfe_show_hif, NULL); ++static DEVICE_ATTR(gpi, 0444, pfe_show_gpi, NULL); ++static DEVICE_ATTR(drops, 0644, pfe_show_drops, pfe_set_drops); ++static DEVICE_ATTR(tmu0_queues, 0444, pfe_show_tmu0_queues, NULL); ++static DEVICE_ATTR(tmu1_queues, 0444, pfe_show_tmu1_queues, NULL); ++static DEVICE_ATTR(tmu2_queues, 0444, pfe_show_tmu2_queues, NULL); ++static DEVICE_ATTR(tmu3_queues, 0444, pfe_show_tmu3_queues, NULL); ++static DEVICE_ATTR(pfemem, 0444, pfe_show_pfemem, NULL); ++ ++int pfe_sysfs_init(struct pfe *pfe) ++{ ++ if (device_create_file(pfe->dev, &dev_attr_class)) ++ goto err_class; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu)) ++ goto err_tmu; ++ ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ if (device_create_file(pfe->dev, &dev_attr_util)) ++ goto err_util; ++#endif ++ ++ if (device_create_file(pfe->dev, &dev_attr_bmu)) ++ goto err_bmu; ++ ++ if (device_create_file(pfe->dev, &dev_attr_hif)) ++ goto err_hif; ++ ++ if (device_create_file(pfe->dev, &dev_attr_gpi)) ++ goto err_gpi; ++ ++ if (device_create_file(pfe->dev, &dev_attr_drops)) ++ goto err_drops; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu0_queues)) ++ goto err_tmu0_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu1_queues)) ++ goto err_tmu1_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu2_queues)) ++ goto err_tmu2_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_tmu3_queues)) ++ goto err_tmu3_queues; ++ ++ if (device_create_file(pfe->dev, &dev_attr_pfemem)) ++ goto err_pfemem; ++ ++#ifdef HIF_NAPI_STATS ++ if (device_create_file(pfe->dev, &dev_attr_hif_napi_stats)) ++ goto err_hif_napi_stats; ++#endif ++ ++ return 0; ++ ++#ifdef HIF_NAPI_STATS ++err_hif_napi_stats: ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++#endif ++ ++err_pfemem: ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ ++err_tmu3_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ ++err_tmu2_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ ++err_tmu1_queues: ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ ++err_tmu0_queues: ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ ++err_drops: ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ ++err_gpi: ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ ++err_hif: ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++ ++err_bmu: ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++ ++err_util: ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ ++err_tmu: ++ device_remove_file(pfe->dev, &dev_attr_class); ++ ++err_class: ++ return -1; ++} ++ ++void pfe_sysfs_exit(struct pfe *pfe) ++{ ++#ifdef HIF_NAPI_STATS ++ device_remove_file(pfe->dev, &dev_attr_hif_napi_stats); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_pfemem); ++ device_remove_file(pfe->dev, &dev_attr_tmu3_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu2_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu1_queues); ++ device_remove_file(pfe->dev, &dev_attr_tmu0_queues); ++ device_remove_file(pfe->dev, &dev_attr_drops); ++ device_remove_file(pfe->dev, &dev_attr_gpi); ++ device_remove_file(pfe->dev, &dev_attr_hif); ++ device_remove_file(pfe->dev, &dev_attr_bmu); ++#if !defined(CONFIG_FSL_PPFE_UTIL_DISABLED) ++ device_remove_file(pfe->dev, &dev_attr_util); ++#endif ++ device_remove_file(pfe->dev, &dev_attr_tmu); ++ device_remove_file(pfe->dev, &dev_attr_class); ++} +--- /dev/null ++++ b/drivers/staging/fsl_ppfe/pfe_sysfs.h +@@ -0,0 +1,29 @@ ++/* ++ * Copyright 2015-2016 Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#ifndef _PFE_SYSFS_H_ ++#define _PFE_SYSFS_H_ ++ ++#include ++ ++u32 qm_read_drop_stat(u32 tmu, u32 queue, u32 *total_drops, int do_reset); ++ ++int pfe_sysfs_init(struct pfe *pfe); ++void pfe_sysfs_exit(struct pfe *pfe); ++ ++#endif /* _PFE_SYSFS_H_ */ diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 79103a273..f6a7bca7c 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -1,4 +1,4 @@ -From 0a5b97d1f524c1769b4059e3c7123b52755f7121 Mon Sep 17 00:00:00 2001 +From 9c9579d76ccd6e738ab98c9b4c73c168912cdb8a Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 15:02:01 +0800 Subject: [PATCH] crypto: support layerscape @@ -54,7 +54,7 @@ Signed-off-by: Yangbo Lu drivers/crypto/caam/compat.h | 1 + drivers/crypto/caam/ctrl.c | 356 +- drivers/crypto/caam/ctrl.h | 2 + - drivers/crypto/caam/desc.h | 52 +- + drivers/crypto/caam/desc.h | 55 +- drivers/crypto/caam/desc_constr.h | 139 +- drivers/crypto/caam/dpseci.c | 859 ++++ drivers/crypto/caam/dpseci.h | 395 ++ @@ -62,7 +62,8 @@ Signed-off-by: Yangbo Lu drivers/crypto/caam/error.c | 127 +- drivers/crypto/caam/error.h | 10 +- drivers/crypto/caam/intern.h | 31 +- - drivers/crypto/caam/jr.c | 55 +- + drivers/crypto/caam/jr.c | 97 +- + drivers/crypto/caam/jr.h | 2 + drivers/crypto/caam/key_gen.c | 32 +- drivers/crypto/caam/key_gen.h | 36 +- drivers/crypto/caam/pdb.h | 62 + @@ -83,7 +84,7 @@ Signed-off-by: Yangbo Lu include/uapi/linux/cryptouser.h | 5 + scripts/spelling.txt | 3 + sound/soc/amd/acp-pcm-dma.c | 2 +- - 54 files changed, 17263 insertions(+), 3955 deletions(-) + 55 files changed, 17310 insertions(+), 3955 deletions(-) create mode 100644 crypto/acompress.c create mode 100644 crypto/scompress.c create mode 100644 crypto/tls.c @@ -15259,9 +15260,9 @@ Signed-off-by: Yangbo Lu +} + +/* -+ * qi_cache_alloc - Allocate buffers from CAAM-QI cache ++ * qi_cache_zalloc - Allocate buffers from CAAM-QI cache + * -+ * Allocate data on the hotpath. Instead of using kmalloc, one can use the ++ * Allocate data on the hotpath. Instead of using kzalloc, one can use the + * services of the CAAM QI memory cache (backed by kmem_cache). The buffers + * will have a size of CAAM_QI_MEMCACHE_SIZE, which should be sufficient for + * hosting 16 SG entries. @@ -15270,15 +15271,15 @@ Signed-off-by: Yangbo Lu + * + * Returns a pointer to a retrieved buffer on success or NULL on failure. + */ -+static inline void *qi_cache_alloc(gfp_t flags) ++static inline void *qi_cache_zalloc(gfp_t flags) +{ -+ return kmem_cache_alloc(qi_cache, flags); ++ return kmem_cache_zalloc(qi_cache, flags); +} + +/* + * qi_cache_free - Frees buffers allocated from CAAM-QI cache + * -+ * @obj - buffer previously allocated by qi_cache_alloc ++ * @obj - buffer previously allocated by qi_cache_zalloc + * + * No checking is being done, the call is a passthrough call to + * kmem_cache_free(...) @@ -15690,7 +15691,7 @@ Signed-off-by: Yangbo Lu + enum optype op_type = encrypt ? ENCRYPT : DECRYPT; + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + return ERR_PTR(-ENOMEM); @@ -15895,7 +15896,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + return ERR_PTR(-ENOMEM); @@ -16761,7 +16762,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (unlikely(!edesc)) { + dev_err(dev, "could not allocate extended descriptor\n"); + caam_unmap(dev, req->src, req->dst, src_nents, dst_nents, @@ -16916,7 +16917,7 @@ Signed-off-by: Yangbo Lu + } + + /* allocate space for base edesc and link tables */ -+ edesc = qi_cache_alloc(GFP_DMA | flags); ++ edesc = qi_cache_zalloc(GFP_DMA | flags); + if (!edesc) { + dev_err(dev, "could not allocate extended descriptor\n"); + caam_unmap(dev, req->src, req->dst, src_nents, dst_nents, @@ -22122,7 +22123,15 @@ Signed-off-by: Yangbo Lu #define LDST_SRCDST_WORD_ALTDS_CLASS1 (0x0f << LDST_SRCDST_SHIFT) #define LDST_SRCDST_WORD_PKHA_A_SZ (0x10 << LDST_SRCDST_SHIFT) #define LDST_SRCDST_WORD_PKHA_B_SZ (0x11 << LDST_SRCDST_SHIFT) -@@ -400,7 +395,7 @@ struct sec4_sg_entry { +@@ -360,6 +355,7 @@ struct sec4_sg_entry { + #define FIFOLD_TYPE_PK_N (0x08 << FIFOLD_TYPE_SHIFT) + #define FIFOLD_TYPE_PK_A (0x0c << FIFOLD_TYPE_SHIFT) + #define FIFOLD_TYPE_PK_B (0x0d << FIFOLD_TYPE_SHIFT) ++#define FIFOLD_TYPE_IFIFO (0x0f << FIFOLD_TYPE_SHIFT) + + /* Other types. Need to OR in last/flush bits as desired */ + #define FIFOLD_TYPE_MSG_MASK (0x38 << FIFOLD_TYPE_SHIFT) +@@ -400,7 +396,7 @@ struct sec4_sg_entry { #define FIFOST_TYPE_PKHA_N (0x08 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_A (0x0c << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_B (0x0d << FIFOST_TYPE_SHIFT) @@ -22131,7 +22140,15 @@ Signed-off-by: Yangbo Lu #define FIFOST_TYPE_AF_SBOX_TKEK (0x21 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_E_JKEK (0x22 << FIFOST_TYPE_SHIFT) #define FIFOST_TYPE_PKHA_E_TKEK (0x23 << FIFOST_TYPE_SHIFT) -@@ -1107,8 +1102,8 @@ struct sec4_sg_entry { +@@ -413,6 +409,7 @@ struct sec4_sg_entry { + #define FIFOST_TYPE_MESSAGE_DATA (0x30 << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_RNGSTORE (0x34 << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_RNGFIFO (0x35 << FIFOST_TYPE_SHIFT) ++#define FIFOST_TYPE_METADATA (0x3e << FIFOST_TYPE_SHIFT) + #define FIFOST_TYPE_SKIP (0x3f << FIFOST_TYPE_SHIFT) + + /* +@@ -1107,8 +1104,8 @@ struct sec4_sg_entry { /* For non-protocol/alg-only op commands */ #define OP_ALG_TYPE_SHIFT 24 #define OP_ALG_TYPE_MASK (0x7 << OP_ALG_TYPE_SHIFT) @@ -22142,7 +22159,7 @@ Signed-off-by: Yangbo Lu #define OP_ALG_ALGSEL_SHIFT 16 #define OP_ALG_ALGSEL_MASK (0xff << OP_ALG_ALGSEL_SHIFT) -@@ -1249,7 +1244,7 @@ struct sec4_sg_entry { +@@ -1249,7 +1246,7 @@ struct sec4_sg_entry { #define OP_ALG_PKMODE_MOD_PRIMALITY 0x00f /* PKHA mode copy-memory functions */ @@ -22151,7 +22168,7 @@ Signed-off-by: Yangbo Lu #define OP_ALG_PKMODE_SRC_REG_MASK (7 << OP_ALG_PKMODE_SRC_REG_SHIFT) #define OP_ALG_PKMODE_DST_REG_SHIFT 10 #define OP_ALG_PKMODE_DST_REG_MASK (7 << OP_ALG_PKMODE_DST_REG_SHIFT) -@@ -1445,7 +1440,7 @@ struct sec4_sg_entry { +@@ -1445,10 +1442,11 @@ struct sec4_sg_entry { #define MATH_SRC1_REG2 (0x02 << MATH_SRC1_SHIFT) #define MATH_SRC1_REG3 (0x03 << MATH_SRC1_SHIFT) #define MATH_SRC1_IMM (0x04 << MATH_SRC1_SHIFT) @@ -22160,7 +22177,11 @@ Signed-off-by: Yangbo Lu #define MATH_SRC1_INFIFO (0x0a << MATH_SRC1_SHIFT) #define MATH_SRC1_OUTFIFO (0x0b << MATH_SRC1_SHIFT) #define MATH_SRC1_ONE (0x0c << MATH_SRC1_SHIFT) -@@ -1629,4 +1624,31 @@ struct sec4_sg_entry { ++#define MATH_SRC1_ZERO (0x0f << MATH_SRC1_SHIFT) + + /* Destination selectors */ + #define MATH_DEST_SHIFT 8 +@@ -1629,4 +1627,31 @@ struct sec4_sg_entry { /* Frame Descriptor Command for Replacement Job Descriptor */ #define FD_CMD_REPLACE_JOB_DESC 0x20000000 @@ -24327,7 +24348,22 @@ Signed-off-by: Yangbo Lu #include "regs.h" #include "jr.h" #include "desc.h" -@@ -73,6 +74,8 @@ static int caam_jr_shutdown(struct devic +@@ -22,6 +23,14 @@ struct jr_driver_data { + + static struct jr_driver_data driver_data; + ++static int jr_driver_probed; ++ ++int caam_jr_driver_probed(void) ++{ ++ return jr_driver_probed; ++} ++EXPORT_SYMBOL(caam_jr_driver_probed); ++ + static int caam_reset_hw_jr(struct device *dev) + { + struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); +@@ -73,6 +82,8 @@ static int caam_jr_shutdown(struct devic ret = caam_reset_hw_jr(dev); @@ -24336,7 +24372,16 @@ Signed-off-by: Yangbo Lu /* Release interrupt */ free_irq(jrp->irq, dev); -@@ -128,7 +131,7 @@ static irqreturn_t caam_jr_interrupt(int +@@ -116,6 +127,8 @@ static int caam_jr_remove(struct platfor + dev_err(jrdev, "Failed to shut down job ring\n"); + irq_dispose_mapping(jrpriv->irq); + ++ jr_driver_probed--; ++ + return ret; + } + +@@ -128,7 +141,7 @@ static irqreturn_t caam_jr_interrupt(int /* * Check the output ring for ready responses, kick @@ -24345,7 +24390,7 @@ Signed-off-by: Yangbo Lu */ irqstate = rd_reg32(&jrp->rregs->jrintstatus); if (!irqstate) -@@ -150,13 +153,18 @@ static irqreturn_t caam_jr_interrupt(int +@@ -150,13 +163,18 @@ static irqreturn_t caam_jr_interrupt(int /* Have valid interrupt at this point, just ACK and trigger */ wr_reg32(&jrp->rregs->jrintstatus, irqstate); @@ -24367,7 +24412,7 @@ Signed-off-by: Yangbo Lu struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg); u32 *userdesc, userstatus; -@@ -230,8 +238,6 @@ static irqreturn_t caam_jr_threadirq(int +@@ -230,8 +248,6 @@ static irqreturn_t caam_jr_threadirq(int /* reenable / unmask IRQs */ clrsetbits_32(&jrp->rregs->rconfig_lo, JRCFG_IMSK, 0); @@ -24376,7 +24421,44 @@ Signed-off-by: Yangbo Lu } /** -@@ -389,10 +395,11 @@ static int caam_jr_init(struct device *d +@@ -275,6 +291,36 @@ struct device *caam_jr_alloc(void) + EXPORT_SYMBOL(caam_jr_alloc); + + /** ++ * caam_jridx_alloc() - Alloc a specific job ring based on its index. ++ * ++ * returns : pointer to the newly allocated physical ++ * JobR dev can be written to if successful. ++ **/ ++struct device *caam_jridx_alloc(int idx) ++{ ++ struct caam_drv_private_jr *jrpriv; ++ struct device *dev = ERR_PTR(-ENODEV); ++ ++ spin_lock(&driver_data.jr_alloc_lock); ++ ++ if (list_empty(&driver_data.jr_list)) ++ goto end; ++ ++ list_for_each_entry(jrpriv, &driver_data.jr_list, list_node) { ++ if (jrpriv->ridx == idx) { ++ atomic_inc(&jrpriv->tfm_count); ++ dev = jrpriv->dev; ++ break; ++ } ++ } ++ ++end: ++ spin_unlock(&driver_data.jr_alloc_lock); ++ return dev; ++} ++EXPORT_SYMBOL(caam_jridx_alloc); ++ ++/** + * caam_jr_free() - Free the Job Ring + * @rdev - points to the dev that identifies the Job ring to + * be released. +@@ -389,10 +435,11 @@ static int caam_jr_init(struct device *d jrp = dev_get_drvdata(dev); @@ -24391,7 +24473,7 @@ Signed-off-by: Yangbo Lu if (error) { dev_err(dev, "can't connect JobR %d interrupt (%d)\n", jrp->ridx, jrp->irq); -@@ -454,6 +461,7 @@ out_free_inpring: +@@ -454,6 +501,7 @@ out_free_inpring: out_free_irq: free_irq(jrp->irq, dev); out_kill_deq: @@ -24399,7 +24481,7 @@ Signed-off-by: Yangbo Lu return error; } -@@ -489,15 +497,28 @@ static int caam_jr_probe(struct platform +@@ -489,15 +537,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -24435,7 +24517,12 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -520,7 +541,7 @@ static int caam_jr_probe(struct platform +@@ -517,10 +578,12 @@ static int caam_jr_probe(struct platform + + atomic_set(&jrpriv->tfm_count, 0); + ++ jr_driver_probed++; ++ return 0; } @@ -24444,6 +24531,18 @@ Signed-off-by: Yangbo Lu { .compatible = "fsl,sec-v4.0-job-ring", }, +--- a/drivers/crypto/caam/jr.h ++++ b/drivers/crypto/caam/jr.h +@@ -8,7 +8,9 @@ + #define JR_H + + /* Prototypes for backend-level services exposed to APIs */ ++int caam_jr_driver_probed(void); + struct device *caam_jr_alloc(void); ++struct device *caam_jridx_alloc(int idx); + void caam_jr_free(struct device *rdev); + int caam_jr_enqueue(struct device *dev, u32 *desc, + void (*cbk)(struct device *dev, u32 *desc, u32 status, --- a/drivers/crypto/caam/key_gen.c +++ b/drivers/crypto/caam/key_gen.c @@ -41,15 +41,29 @@ Split key generation-------------------- diff --git a/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch b/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch index 703aeed3e..94f0a3444 100644 --- a/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/805-dma-support-layerscape.patch @@ -1,4 +1,4 @@ -From 659603c5f6cbc3d39922d4374df25ae4627d0e88 Mon Sep 17 00:00:00 2001 +From 854c1f0e9574e9b25a55b439608c71e013b34a56 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:12:20 +0800 Subject: [PATCH] dma: support layerscape @@ -8,8 +8,9 @@ This is a integrated patch for layerscape dma support. Signed-off-by: jiaheng.fan Signed-off-by: Yangbo Lu --- - drivers/dma/Kconfig | 14 + - drivers/dma/Makefile | 2 + + drivers/dma/Kconfig | 31 + + drivers/dma/Makefile | 3 + + drivers/dma/caam_dma.c | 563 +++++++++++++++ drivers/dma/dpaa2-qdma/Kconfig | 8 + drivers/dma/dpaa2-qdma/Makefile | 8 + drivers/dma/dpaa2-qdma/dpaa2-qdma.c | 986 +++++++++++++++++++++++++ @@ -18,7 +19,8 @@ Signed-off-by: Yangbo Lu drivers/dma/dpaa2-qdma/fsl_dpdmai.h | 521 ++++++++++++++ drivers/dma/dpaa2-qdma/fsl_dpdmai_cmd.h | 222 ++++++ drivers/dma/fsl-qdma.c | 1201 +++++++++++++++++++++++++++++++ - 10 files changed, 3678 insertions(+) + 11 files changed, 4259 insertions(+) + create mode 100644 drivers/dma/caam_dma.c create mode 100644 drivers/dma/dpaa2-qdma/Kconfig create mode 100644 drivers/dma/dpaa2-qdma/Makefile create mode 100644 drivers/dma/dpaa2-qdma/dpaa2-qdma.c @@ -51,6 +53,30 @@ Signed-off-by: Yangbo Lu config FSL_RAID tristate "Freescale RAID engine Support" depends on FSL_SOC && !ASYNC_TX_ENABLE_CHANNEL_SWITCH +@@ -564,6 +578,23 @@ config ZX_DMA + help + Support the DMA engine for ZTE ZX296702 platform devices. + ++config CRYPTO_DEV_FSL_CAAM_DMA ++ tristate "CAAM DMA engine support" ++ depends on CRYPTO_DEV_FSL_CAAM_JR ++ default y ++ select DMA_ENGINE ++ select ASYNC_CORE ++ select ASYNC_TX_ENABLE_CHANNEL_SWITCH ++ help ++ Selecting this will offload the DMA operations for users of ++ the scatter gather memcopy API to the CAAM via job rings. The ++ CAAM is a hardware module that provides hardware acceleration to ++ cryptographic operations. It has a built-in DMA controller that can ++ be programmed to read/write cryptographic data. This module defines ++ a DMA driver that uses the DMA capabilities of the CAAM. ++ ++ To compile this as a module, choose M here: the module ++ will be called caam_dma. + + # driver files + source "drivers/dma/bestcomm/Kconfig" --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile @@ -29,6 +29,8 @@ obj-$(CONFIG_DW_DMAC_CORE) += dw/ @@ -62,6 +88,580 @@ Signed-off-by: Yangbo Lu obj-$(CONFIG_FSL_RAID) += fsl_raid.o obj-$(CONFIG_HSU_DMA) += hsu/ obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o +@@ -67,6 +69,7 @@ obj-$(CONFIG_TI_DMA_CROSSBAR) += ti-dma- + obj-$(CONFIG_TI_EDMA) += edma.o + obj-$(CONFIG_XGENE_DMA) += xgene-dma.o + obj-$(CONFIG_ZX_DMA) += zx296702_dma.o ++obj-$(CONFIG_CRYPTO_DEV_FSL_CAAM_DMA) += caam_dma.o + + obj-y += qcom/ + obj-y += xilinx/ +--- /dev/null ++++ b/drivers/dma/caam_dma.c +@@ -0,0 +1,563 @@ ++/* ++ * caam support for SG DMA ++ * ++ * Copyright 2016 Freescale Semiconductor, Inc ++ * Copyright 2017 NXP ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include "dmaengine.h" ++ ++#include "../crypto/caam/regs.h" ++#include "../crypto/caam/jr.h" ++#include "../crypto/caam/error.h" ++#include "../crypto/caam/intern.h" ++#include "../crypto/caam/desc_constr.h" ++#include "../crypto/caam/sg_sw_sec4.h" ++ ++#define DESC_DMA_MEMCPY_LEN ((CAAM_DESC_BYTES_MAX - DESC_JOB_IO_LEN) / \ ++ CAAM_CMD_SZ) ++ ++/* This is max chunk size of a DMA transfer. If a buffer is larger than this ++ * value it is internally broken into chunks of max CAAM_DMA_CHUNK_SIZE bytes ++ * and for each chunk a DMA transfer request is issued. ++ * This value is the largest number on 16 bits that is a multiple of 256 bytes ++ * (the largest configurable CAAM DMA burst size). ++ */ ++#define CAAM_DMA_CHUNK_SIZE 65280 ++ ++struct caam_dma_sh_desc { ++ u32 desc[DESC_DMA_MEMCPY_LEN] ____cacheline_aligned; ++ dma_addr_t desc_dma; ++}; ++ ++/* caam dma extended descriptor */ ++struct caam_dma_edesc { ++ struct dma_async_tx_descriptor async_tx; ++ struct list_head node; ++ struct caam_dma_ctx *ctx; ++ dma_addr_t src_dma; ++ dma_addr_t dst_dma; ++ unsigned int src_len; ++ unsigned int dst_len; ++ struct sec4_sg_entry *sec4_sg; ++ u32 jd[] ____cacheline_aligned; ++}; ++ ++/* ++ * caam_dma_ctx - per jr/channel context ++ * @chan: dma channel used by async_tx API ++ * @node: list_head used to attach to the global dma_ctx_list ++ * @jrdev: Job Ring device ++ * @submit_q: queue of pending (submitted, but not enqueued) jobs ++ * @done_not_acked: jobs that have been completed by jr, but maybe not acked ++ * @edesc_lock: protects extended descriptor ++ */ ++struct caam_dma_ctx { ++ struct dma_chan chan; ++ struct list_head node; ++ struct device *jrdev; ++ struct list_head submit_q; ++ struct list_head done_not_acked; ++ spinlock_t edesc_lock; ++}; ++ ++static struct dma_device *dma_dev; ++static struct caam_dma_sh_desc *dma_sh_desc; ++static LIST_HEAD(dma_ctx_list); ++ ++static dma_cookie_t caam_dma_tx_submit(struct dma_async_tx_descriptor *tx) ++{ ++ struct caam_dma_edesc *edesc = NULL; ++ struct caam_dma_ctx *ctx = NULL; ++ dma_cookie_t cookie; ++ ++ edesc = container_of(tx, struct caam_dma_edesc, async_tx); ++ ctx = container_of(tx->chan, struct caam_dma_ctx, chan); ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ ++ cookie = dma_cookie_assign(tx); ++ list_add_tail(&edesc->node, &ctx->submit_q); ++ ++ spin_unlock_bh(&ctx->edesc_lock); ++ ++ return cookie; ++} ++ ++static unsigned int caam_dma_sg_dma_len(struct scatterlist *sg, ++ unsigned int nents) ++{ ++ unsigned int len; ++ ++ for (len = 0; sg && nents; sg = sg_next(sg), nents--) ++ len += sg_dma_len(sg); ++ ++ return len; ++} ++ ++static struct caam_dma_edesc * ++caam_dma_sg_edesc_alloc(struct dma_chan *chan, ++ struct scatterlist *dst_sg, unsigned int dst_nents, ++ struct scatterlist *src_sg, unsigned int src_nents, ++ unsigned long flags) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct device *jrdev = ctx->jrdev; ++ struct caam_dma_edesc *edesc; ++ struct sec4_sg_entry *sec4_sg; ++ dma_addr_t sec4_sg_dma_src; ++ unsigned int sec4_sg_bytes; ++ ++ if (!dst_sg || !src_sg || !dst_nents || !src_nents) ++ return NULL; ++ ++ sec4_sg_bytes = (src_nents + dst_nents) * sizeof(*sec4_sg); ++ ++ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN + sec4_sg_bytes, ++ GFP_DMA | GFP_NOWAIT); ++ if (!edesc) ++ return ERR_PTR(-ENOMEM); ++ ++ edesc->src_len = caam_dma_sg_dma_len(src_sg, src_nents); ++ edesc->dst_len = caam_dma_sg_dma_len(dst_sg, dst_nents); ++ if (edesc->src_len != edesc->dst_len) { ++ dev_err(jrdev, "%s: src(%u) and dst(%u) len mismatch.\n", ++ __func__, edesc->src_len, edesc->dst_len); ++ kfree(edesc); ++ return ERR_PTR(-EINVAL); ++ } ++ ++ dma_async_tx_descriptor_init(&edesc->async_tx, chan); ++ edesc->async_tx.tx_submit = caam_dma_tx_submit; ++ edesc->async_tx.flags = flags; ++ edesc->async_tx.cookie = -EBUSY; ++ ++ /* Prepare SEC SGs */ ++ edesc->sec4_sg = (void *)edesc + offsetof(struct caam_dma_edesc, jd) + ++ DESC_JOB_IO_LEN; ++ ++ sec4_sg = edesc->sec4_sg; ++ sg_to_sec4_sg_last(src_sg, src_nents, sec4_sg, 0); ++ ++ sec4_sg += src_nents; ++ sg_to_sec4_sg_last(dst_sg, dst_nents, sec4_sg, 0); ++ ++ sec4_sg_dma_src = dma_map_single(jrdev, edesc->sec4_sg, sec4_sg_bytes, ++ DMA_TO_DEVICE); ++ if (dma_mapping_error(jrdev, sec4_sg_dma_src)) { ++ dev_err(jrdev, "error mapping segments to device\n"); ++ kfree(edesc); ++ return ERR_PTR(-ENOMEM); ++ } ++ ++ edesc->src_dma = sec4_sg_dma_src; ++ edesc->dst_dma = sec4_sg_dma_src + src_nents * sizeof(*sec4_sg); ++ edesc->ctx = ctx; ++ ++ return edesc; ++} ++ ++static void caam_jr_chan_free_edesc(struct caam_dma_edesc *edesc) ++{ ++ struct caam_dma_ctx *ctx = edesc->ctx; ++ struct caam_dma_edesc *_edesc = NULL; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ ++ list_add_tail(&edesc->node, &ctx->done_not_acked); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->done_not_acked, node) { ++ if (async_tx_test_ack(&edesc->async_tx)) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ } ++ ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static void caam_dma_done(struct device *dev, u32 *hwdesc, u32 err, ++ void *context) ++{ ++ struct caam_dma_edesc *edesc = context; ++ struct caam_dma_ctx *ctx = edesc->ctx; ++ dma_async_tx_callback callback; ++ void *callback_param; ++ ++ if (err) ++ caam_jr_strstatus(ctx->jrdev, err); ++ ++ dma_run_dependencies(&edesc->async_tx); ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ dma_cookie_complete(&edesc->async_tx); ++ spin_unlock_bh(&ctx->edesc_lock); ++ ++ callback = edesc->async_tx.callback; ++ callback_param = edesc->async_tx.callback_param; ++ ++ dma_descriptor_unmap(&edesc->async_tx); ++ ++ caam_jr_chan_free_edesc(edesc); ++ ++ if (callback) ++ callback(callback_param); ++} ++ ++static void caam_dma_sg_init_job_desc(struct caam_dma_edesc *edesc) ++{ ++ u32 *jd = edesc->jd; ++ u32 *sh_desc = dma_sh_desc->desc; ++ dma_addr_t desc_dma = dma_sh_desc->desc_dma; ++ ++ /* init the job descriptor */ ++ init_job_desc_shared(jd, desc_dma, desc_len(sh_desc), HDR_REVERSE); ++ ++ /* set SEQIN PTR */ ++ append_seq_in_ptr(jd, edesc->src_dma, edesc->src_len, LDST_SGF); ++ ++ /* set SEQOUT PTR */ ++ append_seq_out_ptr(jd, edesc->dst_dma, edesc->dst_len, LDST_SGF); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma desc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, jd, desc_bytes(jd), 1); ++#endif ++} ++ ++/* This function can be called from an interrupt context */ ++static struct dma_async_tx_descriptor * ++caam_dma_prep_sg(struct dma_chan *chan, struct scatterlist *dst_sg, ++ unsigned int dst_nents, struct scatterlist *src_sg, ++ unsigned int src_nents, unsigned long flags) ++{ ++ struct caam_dma_edesc *edesc; ++ ++ /* allocate extended descriptor */ ++ edesc = caam_dma_sg_edesc_alloc(chan, dst_sg, dst_nents, src_sg, ++ src_nents, flags); ++ if (IS_ERR_OR_NULL(edesc)) ++ return ERR_CAST(edesc); ++ ++ /* Initialize job descriptor */ ++ caam_dma_sg_init_job_desc(edesc); ++ ++ return &edesc->async_tx; ++} ++ ++static void caam_dma_memcpy_init_job_desc(struct caam_dma_edesc *edesc) ++{ ++ u32 *jd = edesc->jd; ++ u32 *sh_desc = dma_sh_desc->desc; ++ dma_addr_t desc_dma = dma_sh_desc->desc_dma; ++ ++ /* init the job descriptor */ ++ init_job_desc_shared(jd, desc_dma, desc_len(sh_desc), HDR_REVERSE); ++ ++ /* set SEQIN PTR */ ++ append_seq_in_ptr(jd, edesc->src_dma, edesc->src_len, 0); ++ ++ /* set SEQOUT PTR */ ++ append_seq_out_ptr(jd, edesc->dst_dma, edesc->dst_len, 0); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma desc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, jd, desc_bytes(jd), 1); ++#endif ++} ++ ++static struct dma_async_tx_descriptor * ++caam_dma_prep_memcpy(struct dma_chan *chan, dma_addr_t dst, dma_addr_t src, ++ size_t len, unsigned long flags) ++{ ++ struct caam_dma_edesc *edesc; ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ ++ edesc = kzalloc(sizeof(*edesc) + DESC_JOB_IO_LEN, GFP_DMA | GFP_NOWAIT); ++ if (!edesc) ++ return ERR_PTR(-ENOMEM); ++ ++ dma_async_tx_descriptor_init(&edesc->async_tx, chan); ++ edesc->async_tx.tx_submit = caam_dma_tx_submit; ++ edesc->async_tx.flags = flags; ++ edesc->async_tx.cookie = -EBUSY; ++ ++ edesc->src_dma = src; ++ edesc->src_len = len; ++ edesc->dst_dma = dst; ++ edesc->dst_len = len; ++ edesc->ctx = ctx; ++ ++ caam_dma_memcpy_init_job_desc(edesc); ++ ++ return &edesc->async_tx; ++} ++ ++/* This function can be called in an interrupt context */ ++static void caam_dma_issue_pending(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct caam_dma_edesc *edesc, *_edesc; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->submit_q, node) { ++ if (caam_jr_enqueue(ctx->jrdev, edesc->jd, ++ caam_dma_done, edesc) < 0) ++ break; ++ list_del(&edesc->node); ++ } ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static void caam_dma_free_chan_resources(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ struct caam_dma_edesc *edesc, *_edesc; ++ ++ spin_lock_bh(&ctx->edesc_lock); ++ list_for_each_entry_safe(edesc, _edesc, &ctx->submit_q, node) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ list_for_each_entry_safe(edesc, _edesc, &ctx->done_not_acked, node) { ++ list_del(&edesc->node); ++ kfree(edesc); ++ } ++ spin_unlock_bh(&ctx->edesc_lock); ++} ++ ++static int caam_dma_jr_chan_bind(void) ++{ ++ struct device *jrdev; ++ struct caam_dma_ctx *ctx; ++ int bonds = 0; ++ int i; ++ ++ for (i = 0; i < caam_jr_driver_probed(); i++) { ++ jrdev = caam_jridx_alloc(i); ++ if (IS_ERR(jrdev)) { ++ pr_err("job ring device %d allocation failed\n", i); ++ continue; ++ } ++ ++ ctx = kzalloc(sizeof(*ctx), GFP_KERNEL); ++ if (!ctx) { ++ caam_jr_free(jrdev); ++ continue; ++ } ++ ++ ctx->chan.device = dma_dev; ++ ctx->chan.private = ctx; ++ ++ ctx->jrdev = jrdev; ++ ++ INIT_LIST_HEAD(&ctx->submit_q); ++ INIT_LIST_HEAD(&ctx->done_not_acked); ++ INIT_LIST_HEAD(&ctx->node); ++ spin_lock_init(&ctx->edesc_lock); ++ ++ dma_cookie_init(&ctx->chan); ++ ++ /* add the context of this channel to the context list */ ++ list_add_tail(&ctx->node, &dma_ctx_list); ++ ++ /* add this channel to the device chan list */ ++ list_add_tail(&ctx->chan.device_node, &dma_dev->channels); ++ ++ bonds++; ++ } ++ ++ return bonds; ++} ++ ++static inline void caam_jr_dma_free(struct dma_chan *chan) ++{ ++ struct caam_dma_ctx *ctx = container_of(chan, struct caam_dma_ctx, ++ chan); ++ ++ list_del(&ctx->node); ++ list_del(&chan->device_node); ++ caam_jr_free(ctx->jrdev); ++ kfree(ctx); ++} ++ ++static void set_caam_dma_desc(u32 *desc) ++{ ++ u32 *jmp_cmd; ++ ++ /* dma shared descriptor */ ++ init_sh_desc(desc, HDR_SHARE_NEVER | (1 << HDR_START_IDX_SHIFT)); ++ ++ /* REG1 = CAAM_DMA_CHUNK_SIZE */ ++ append_math_add_imm_u32(desc, REG1, ZERO, IMM, CAAM_DMA_CHUNK_SIZE); ++ ++ /* REG0 = SEQINLEN - CAAM_DMA_CHUNK_SIZE */ ++ append_math_sub_imm_u32(desc, REG0, SEQINLEN, IMM, CAAM_DMA_CHUNK_SIZE); ++ ++ /* if (REG0 > 0) ++ * jmp to LABEL1 ++ */ ++ jmp_cmd = append_jump(desc, JUMP_TEST_INVALL | JUMP_COND_MATH_N | ++ JUMP_COND_MATH_Z); ++ ++ /* REG1 = SEQINLEN */ ++ append_math_sub(desc, REG1, SEQINLEN, ZERO, CAAM_CMD_SZ); ++ ++ /* LABEL1 */ ++ set_jump_tgt_here(desc, jmp_cmd); ++ ++ /* VARSEQINLEN = REG1 */ ++ append_math_add(desc, VARSEQINLEN, REG1, ZERO, CAAM_CMD_SZ); ++ ++ /* VARSEQOUTLEN = REG1 */ ++ append_math_add(desc, VARSEQOUTLEN, REG1, ZERO, CAAM_CMD_SZ); ++ ++ /* do FIFO STORE */ ++ append_seq_fifo_store(desc, 0, FIFOST_TYPE_METADATA | LDST_VLF); ++ ++ /* do FIFO LOAD */ ++ append_seq_fifo_load(desc, 0, FIFOLD_CLASS_CLASS1 | ++ FIFOLD_TYPE_IFIFO | LDST_VLF); ++ ++ /* if (REG0 > 0) ++ * jmp 0xF8 (after shared desc header) ++ */ ++ append_jump(desc, JUMP_TEST_INVALL | JUMP_COND_MATH_N | ++ JUMP_COND_MATH_Z | 0xF8); ++ ++#ifdef DEBUG ++ print_hex_dump(KERN_ERR, "caam dma shdesc@" __stringify(__LINE__) ": ", ++ DUMP_PREFIX_ADDRESS, 16, 4, desc, desc_bytes(desc), 1); ++#endif ++} ++ ++static int __init caam_dma_probe(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct device *ctrldev = dev->parent; ++ struct dma_chan *chan, *_chan; ++ u32 *sh_desc; ++ int err = -ENOMEM; ++ int bonds; ++ ++ if (!caam_jr_driver_probed()) { ++ dev_info(dev, "Defer probing after JR driver probing\n"); ++ return -EPROBE_DEFER; ++ } ++ ++ dma_dev = kzalloc(sizeof(*dma_dev), GFP_KERNEL); ++ if (!dma_dev) ++ return -ENOMEM; ++ ++ dma_sh_desc = kzalloc(sizeof(*dma_sh_desc), GFP_KERNEL | GFP_DMA); ++ if (!dma_sh_desc) ++ goto desc_err; ++ ++ sh_desc = dma_sh_desc->desc; ++ set_caam_dma_desc(sh_desc); ++ dma_sh_desc->desc_dma = dma_map_single(ctrldev, sh_desc, ++ desc_bytes(sh_desc), ++ DMA_TO_DEVICE); ++ if (dma_mapping_error(ctrldev, dma_sh_desc->desc_dma)) { ++ dev_err(dev, "unable to map dma descriptor\n"); ++ goto map_err; ++ } ++ ++ INIT_LIST_HEAD(&dma_dev->channels); ++ ++ bonds = caam_dma_jr_chan_bind(); ++ if (!bonds) { ++ err = -ENODEV; ++ goto jr_bind_err; ++ } ++ ++ dma_dev->dev = dev; ++ dma_dev->residue_granularity = DMA_RESIDUE_GRANULARITY_DESCRIPTOR; ++ dma_cap_set(DMA_SG, dma_dev->cap_mask); ++ dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask); ++ dma_cap_set(DMA_PRIVATE, dma_dev->cap_mask); ++ dma_dev->device_tx_status = dma_cookie_status; ++ dma_dev->device_issue_pending = caam_dma_issue_pending; ++ dma_dev->device_prep_dma_sg = caam_dma_prep_sg; ++ dma_dev->device_prep_dma_memcpy = caam_dma_prep_memcpy; ++ dma_dev->device_free_chan_resources = caam_dma_free_chan_resources; ++ ++ err = dma_async_device_register(dma_dev); ++ if (err) { ++ dev_err(dev, "Failed to register CAAM DMA engine\n"); ++ goto jr_bind_err; ++ } ++ ++ dev_info(dev, "caam dma support with %d job rings\n", bonds); ++ ++ return err; ++ ++jr_bind_err: ++ list_for_each_entry_safe(chan, _chan, &dma_dev->channels, device_node) ++ caam_jr_dma_free(chan); ++ ++ dma_unmap_single(ctrldev, dma_sh_desc->desc_dma, desc_bytes(sh_desc), ++ DMA_TO_DEVICE); ++map_err: ++ kfree(dma_sh_desc); ++desc_err: ++ kfree(dma_dev); ++ return err; ++} ++ ++static int caam_dma_remove(struct platform_device *pdev) ++{ ++ struct device *dev = &pdev->dev; ++ struct device *ctrldev = dev->parent; ++ struct caam_dma_ctx *ctx, *_ctx; ++ ++ dma_async_device_unregister(dma_dev); ++ ++ list_for_each_entry_safe(ctx, _ctx, &dma_ctx_list, node) { ++ list_del(&ctx->node); ++ caam_jr_free(ctx->jrdev); ++ kfree(ctx); ++ } ++ ++ dma_unmap_single(ctrldev, dma_sh_desc->desc_dma, ++ desc_bytes(dma_sh_desc->desc), DMA_TO_DEVICE); ++ ++ kfree(dma_sh_desc); ++ kfree(dma_dev); ++ ++ dev_info(dev, "caam dma support disabled\n"); ++ return 0; ++} ++ ++static const struct of_device_id caam_dma_match[] = { ++ { .compatible = "fsl,sec-v5.4-dma", }, ++ { .compatible = "fsl,sec-v5.0-dma", }, ++ { .compatible = "fsl,sec-v4.0-dma", }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, caam_dma_match); ++ ++static struct platform_driver caam_dma_driver = { ++ .driver = { ++ .name = "caam-dma", ++ .of_match_table = caam_dma_match, ++ }, ++ .probe = caam_dma_probe, ++ .remove = caam_dma_remove, ++}; ++module_platform_driver(caam_dma_driver); ++ ++MODULE_LICENSE("Dual BSD/GPL"); ++MODULE_DESCRIPTION("NXP CAAM support for SG DMA"); ++MODULE_AUTHOR("NXP Semiconductors"); --- /dev/null +++ b/drivers/dma/dpaa2-qdma/Kconfig @@ -0,0 +1,8 @@ diff --git a/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch b/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch index 711fde77d..7ead7b6ec 100644 --- a/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/806-flextimer-support-layerscape.patch @@ -1,4 +1,4 @@ -From a5b3155b532289af793c26251cb087b4a24d5c15 Mon Sep 17 00:00:00 2001 +From 76cd2ef6b69b67c09480a3248f7b910897f0bb2f Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Mon, 25 Sep 2017 12:13:12 +0800 Subject: [PATCH] flextimer: support layerscape @@ -10,8 +10,8 @@ Signed-off-by: Meng Yi Signed-off-by: Yangbo Lu --- drivers/clocksource/fsl_ftm_timer.c | 8 +- - drivers/soc/fsl/layerscape/ftm_alarm.c | 286 +++++++++++++++++++++++++++++++++ - 2 files changed, 290 insertions(+), 4 deletions(-) + drivers/soc/fsl/layerscape/ftm_alarm.c | 367 +++++++++++++++++++++++++++++++++ + 2 files changed, 371 insertions(+), 4 deletions(-) create mode 100644 drivers/soc/fsl/layerscape/ftm_alarm.c --- a/drivers/clocksource/fsl_ftm_timer.c @@ -34,7 +34,7 @@ Signed-off-by: Yangbo Lu static inline void ftm_irq_enable(void __iomem *base) --- /dev/null +++ b/drivers/soc/fsl/layerscape/ftm_alarm.c -@@ -0,0 +1,286 @@ +@@ -0,0 +1,367 @@ +/* + * Freescale FlexTimer Module (FTM) Alarm driver. + * @@ -53,6 +53,10 @@ Signed-off-by: Yangbo Lu +#include +#include +#include ++#include ++#include ++#include ++#include + +#define FTM_SC 0x00 +#define FTM_SC_CLK_SHIFT 3 @@ -77,6 +81,57 @@ Signed-off-by: Yangbo Lu +static u32 alarm_freq; +static bool big_endian; + ++enum pmu_endian_type { ++ BIG_ENDIAN, ++ LITTLE_ENDIAN, ++}; ++ ++struct rcpm_cfg { ++ enum pmu_endian_type big_endian; /* Big/Little endian of PMU module */ ++ u32 flextimer_set_bit; /* FlexTimer1 is not powerdown during device LPM20 */ ++}; ++ ++static struct rcpm_cfg ls1012a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1021a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1043a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1046a_rcpm_cfg = { ++ .big_endian = BIG_ENDIAN, ++ .flextimer_set_bit = 0x20000, ++}; ++ ++static struct rcpm_cfg ls1088a_rcpm_cfg = { ++ .big_endian = LITTLE_ENDIAN, ++ .flextimer_set_bit = 0x4000, ++}; ++ ++static struct rcpm_cfg ls208xa_rcpm_cfg = { ++ .big_endian = LITTLE_ENDIAN, ++ .flextimer_set_bit = 0x4000, ++}; ++ ++static const struct of_device_id ippdexpcr_of_match[] = { ++ { .compatible = "fsl,ls1012a-ftm", .data = &ls1012a_rcpm_cfg}, ++ { .compatible = "fsl,ls1021a-ftm", .data = &ls1021a_rcpm_cfg}, ++ { .compatible = "fsl,ls1043a-ftm", .data = &ls1043a_rcpm_cfg}, ++ { .compatible = "fsl,ls1046a-ftm", .data = &ls1046a_rcpm_cfg}, ++ { .compatible = "fsl,ls1088a-ftm", .data = &ls1088a_rcpm_cfg}, ++ { .compatible = "fsl,ls208xa-ftm", .data = &ls208xa_rcpm_cfg}, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, ippdexpcr_of_match); ++ +static inline u32 ftm_readl(void __iomem *addr) +{ + if (big_endian) @@ -251,7 +306,10 @@ Signed-off-by: Yangbo Lu + struct resource *r; + int irq; + int ret; -+ u32 ippdexpcr; ++ struct rcpm_cfg *rcpm_cfg; ++ u32 ippdexpcr, flextimer; ++ const struct of_device_id *of_id; ++ enum pmu_endian_type endian; + + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!r) @@ -261,14 +319,32 @@ Signed-off-by: Yangbo Lu + if (IS_ERR(ftm1_base)) + return PTR_ERR(ftm1_base); + ++ of_id = of_match_node(ippdexpcr_of_match, np); ++ if (!of_id) ++ return -ENODEV; ++ ++ rcpm_cfg = devm_kzalloc(&pdev->dev, sizeof(*rcpm_cfg), GFP_KERNEL); ++ if (!rcpm_cfg) ++ return -ENOMEM; ++ ++ rcpm_cfg = (struct rcpm_cfg*)of_id->data; ++ endian = rcpm_cfg->big_endian; ++ flextimer = rcpm_cfg->flextimer_set_bit; ++ + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "FlexTimer1"); + if (r) { + rcpm_ftm_addr = devm_ioremap_resource(&pdev->dev, r); + if (IS_ERR(rcpm_ftm_addr)) + return PTR_ERR(rcpm_ftm_addr); -+ ippdexpcr = ioread32be(rcpm_ftm_addr); -+ ippdexpcr |= 0x20000; -+ iowrite32be(ippdexpcr, rcpm_ftm_addr); ++ if (endian == BIG_ENDIAN) ++ ippdexpcr = ioread32be(rcpm_ftm_addr); ++ else ++ ippdexpcr = ioread32(rcpm_ftm_addr); ++ ippdexpcr |= flextimer; ++ if (endian == BIG_ENDIAN) ++ iowrite32be(ippdexpcr, rcpm_ftm_addr); ++ else ++ iowrite32(ippdexpcr, rcpm_ftm_addr); + } + + irq = irq_of_parse_and_map(np, 0); @@ -302,7 +378,12 @@ Signed-off-by: Yangbo Lu +} + +static const struct of_device_id ftm_alarm_match[] = { -+ { .compatible = "fsl,ftm-alarm", }, ++ { .compatible = "fsl,ls1012a-ftm", }, ++ { .compatible = "fsl,ls1021a-ftm", }, ++ { .compatible = "fsl,ls1043a-ftm", }, ++ { .compatible = "fsl,ls1046a-ftm", }, ++ { .compatible = "fsl,ls1088a-ftm", }, ++ { .compatible = "fsl,ls208xa-ftm", }, + { .compatible = "fsl,ftm-timer", }, + { }, +}; diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index ec8917361..657a38fec 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -1,4 +1,4 @@ -From f1874c71c855bd8ca8478a622053276f2c61eeca Mon Sep 17 00:00:00 2001 +From 152f316e7829f6aeb3a36009e7e5ec0f1d97d770 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 10:33:26 +0800 Subject: [PATCH] iommu: support layerscape @@ -12,16 +12,16 @@ Signed-off-by: Sunil Goutham Signed-off-by: Yangbo Lu --- drivers/iommu/amd_iommu.c | 56 ++++++---- - drivers/iommu/arm-smmu-v3.c | 35 ++++++- - drivers/iommu/arm-smmu.c | 74 ++++++++++--- + drivers/iommu/arm-smmu-v3.c | 117 ++++++++++++++------- + drivers/iommu/arm-smmu.c | 100 +++++++++++++++--- drivers/iommu/dma-iommu.c | 242 ++++++++++++++++++++++++++++++++++++------- drivers/iommu/intel-iommu.c | 92 ++++++++++++---- - drivers/iommu/iommu.c | 191 ++++++++++++++++++++++++++++++++-- + drivers/iommu/iommu.c | 219 ++++++++++++++++++++++++++++++++++++--- drivers/iommu/mtk_iommu.c | 2 + drivers/iommu/mtk_iommu_v1.c | 2 + include/linux/dma-iommu.h | 11 ++ include/linux/iommu.h | 55 +++++++--- - 10 files changed, 645 insertions(+), 115 deletions(-) + 10 files changed, 739 insertions(+), 157 deletions(-) --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -143,7 +143,78 @@ Signed-off-by: Yangbo Lu static bool disable_bypass; module_param_named(disable_bypass, disable_bypass, bool, S_IRUGO); MODULE_PARM_DESC(disable_bypass, -@@ -1370,8 +1373,6 @@ static bool arm_smmu_capable(enum iommu_ +@@ -552,9 +555,14 @@ struct arm_smmu_s2_cfg { + }; + + struct arm_smmu_strtab_ent { +- bool valid; +- +- bool bypass; /* Overrides s1/s2 config */ ++ /* ++ * An STE is "assigned" if the master emitting the corresponding SID ++ * is attached to a domain. The behaviour of an unassigned STE is ++ * determined by the disable_bypass parameter, whereas an assigned ++ * STE behaves according to s1_cfg/s2_cfg, which themselves are ++ * configured according to the domain type. ++ */ ++ bool assigned; + struct arm_smmu_s1_cfg *s1_cfg; + struct arm_smmu_s2_cfg *s2_cfg; + }; +@@ -627,6 +635,7 @@ enum arm_smmu_domain_stage { + ARM_SMMU_DOMAIN_S1 = 0, + ARM_SMMU_DOMAIN_S2, + ARM_SMMU_DOMAIN_NESTED, ++ ARM_SMMU_DOMAIN_BYPASS, + }; + + struct arm_smmu_domain { +@@ -1000,9 +1009,9 @@ static void arm_smmu_write_strtab_ent(st + * This is hideously complicated, but we only really care about + * three cases at the moment: + * +- * 1. Invalid (all zero) -> bypass (init) +- * 2. Bypass -> translation (attach) +- * 3. Translation -> bypass (detach) ++ * 1. Invalid (all zero) -> bypass/fault (init) ++ * 2. Bypass/fault -> translation/bypass (attach) ++ * 3. Translation/bypass -> bypass/fault (detach) + * + * Given that we can't update the STE atomically and the SMMU + * doesn't read the thing in a defined order, that leaves us +@@ -1041,11 +1050,15 @@ static void arm_smmu_write_strtab_ent(st + } + + /* Nuke the existing STE_0 value, as we're going to rewrite it */ +- val = ste->valid ? STRTAB_STE_0_V : 0; ++ val = STRTAB_STE_0_V; ++ ++ /* Bypass/fault */ ++ if (!ste->assigned || !(ste->s1_cfg || ste->s2_cfg)) { ++ if (!ste->assigned && disable_bypass) ++ val |= STRTAB_STE_0_CFG_ABORT; ++ else ++ val |= STRTAB_STE_0_CFG_BYPASS; + +- if (ste->bypass) { +- val |= disable_bypass ? STRTAB_STE_0_CFG_ABORT +- : STRTAB_STE_0_CFG_BYPASS; + dst[0] = cpu_to_le64(val); + dst[1] = cpu_to_le64(STRTAB_STE_1_SHCFG_INCOMING + << STRTAB_STE_1_SHCFG_SHIFT); +@@ -1108,10 +1121,7 @@ static void arm_smmu_write_strtab_ent(st + static void arm_smmu_init_bypass_stes(u64 *strtab, unsigned int nent) + { + unsigned int i; +- struct arm_smmu_strtab_ent ste = { +- .valid = true, +- .bypass = true, +- }; ++ struct arm_smmu_strtab_ent ste = { .assigned = false }; + + for (i = 0; i < nent; ++i) { + arm_smmu_write_strtab_ent(NULL, -1, strtab, &ste); +@@ -1364,8 +1374,6 @@ static bool arm_smmu_capable(enum iommu_ switch (cap) { case IOMMU_CAP_CACHE_COHERENCY: return true; @@ -152,7 +223,96 @@ Signed-off-by: Yangbo Lu case IOMMU_CAP_NOEXEC: return true; default: -@@ -1709,6 +1710,9 @@ arm_smmu_iova_to_phys(struct iommu_domai +@@ -1377,7 +1385,9 @@ static struct iommu_domain *arm_smmu_dom + { + struct arm_smmu_domain *smmu_domain; + +- if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA) ++ if (type != IOMMU_DOMAIN_UNMANAGED && ++ type != IOMMU_DOMAIN_DMA && ++ type != IOMMU_DOMAIN_IDENTITY) + return NULL; + + /* +@@ -1508,6 +1518,11 @@ static int arm_smmu_domain_finalise(stru + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + struct arm_smmu_device *smmu = smmu_domain->smmu; + ++ if (domain->type == IOMMU_DOMAIN_IDENTITY) { ++ smmu_domain->stage = ARM_SMMU_DOMAIN_BYPASS; ++ return 0; ++ } ++ + /* Restrict the stage to what we can actually support */ + if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1)) + smmu_domain->stage = ARM_SMMU_DOMAIN_S2; +@@ -1578,7 +1593,7 @@ static __le64 *arm_smmu_get_step_for_sid + return step; + } + +-static int arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) ++static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) + { + int i; + struct arm_smmu_master_data *master = fwspec->iommu_priv; +@@ -1590,17 +1605,14 @@ static int arm_smmu_install_ste_for_dev( + + arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste); + } +- +- return 0; + } + + static void arm_smmu_detach_dev(struct device *dev) + { + struct arm_smmu_master_data *master = dev->iommu_fwspec->iommu_priv; + +- master->ste.bypass = true; +- if (arm_smmu_install_ste_for_dev(dev->iommu_fwspec) < 0) +- dev_warn(dev, "failed to install bypass STE\n"); ++ master->ste.assigned = false; ++ arm_smmu_install_ste_for_dev(dev->iommu_fwspec); + } + + static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) +@@ -1619,7 +1631,7 @@ static int arm_smmu_attach_dev(struct io + ste = &master->ste; + + /* Already attached to a different domain? */ +- if (!ste->bypass) ++ if (ste->assigned) + arm_smmu_detach_dev(dev); + + mutex_lock(&smmu_domain->init_mutex); +@@ -1640,10 +1652,12 @@ static int arm_smmu_attach_dev(struct io + goto out_unlock; + } + +- ste->bypass = false; +- ste->valid = true; ++ ste->assigned = true; + +- if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { ++ if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) { ++ ste->s1_cfg = NULL; ++ ste->s2_cfg = NULL; ++ } else if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { + ste->s1_cfg = &smmu_domain->s1_cfg; + ste->s2_cfg = NULL; + arm_smmu_write_ctx_desc(smmu, ste->s1_cfg); +@@ -1652,10 +1666,7 @@ static int arm_smmu_attach_dev(struct io + ste->s2_cfg = &smmu_domain->s2_cfg; + } + +- ret = arm_smmu_install_ste_for_dev(dev->iommu_fwspec); +- if (ret < 0) +- ste->valid = false; +- ++ arm_smmu_install_ste_for_dev(dev->iommu_fwspec); + out_unlock: + mutex_unlock(&smmu_domain->init_mutex); + return ret; +@@ -1703,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domai struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; @@ -162,7 +322,36 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1880,6 +1884,31 @@ static int arm_smmu_of_xlate(struct devi +@@ -1801,7 +1815,7 @@ static void arm_smmu_remove_device(struc + return; + + master = fwspec->iommu_priv; +- if (master && master->ste.valid) ++ if (master && master->ste.assigned) + arm_smmu_detach_dev(dev); + iommu_group_remove_device(dev); + kfree(master); +@@ -1830,6 +1844,9 @@ static int arm_smmu_domain_get_attr(stru + { + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + switch (attr) { + case DOMAIN_ATTR_NESTING: + *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); +@@ -1845,6 +1862,9 @@ static int arm_smmu_domain_set_attr(stru + int ret = 0; + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + mutex_lock(&smmu_domain->init_mutex); + + switch (attr) { +@@ -1874,6 +1894,31 @@ static int arm_smmu_of_xlate(struct devi return iommu_fwspec_add_ids(dev, args->args, 1); } @@ -194,7 +383,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1895,6 +1924,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1889,6 +1934,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, @@ -231,7 +420,65 @@ Signed-off-by: Yangbo Lu static int force_stage; module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, -@@ -1343,6 +1348,9 @@ static phys_addr_t arm_smmu_iova_to_phys +@@ -401,6 +406,7 @@ enum arm_smmu_domain_stage { + ARM_SMMU_DOMAIN_S1 = 0, + ARM_SMMU_DOMAIN_S2, + ARM_SMMU_DOMAIN_NESTED, ++ ARM_SMMU_DOMAIN_BYPASS, + }; + + struct arm_smmu_domain { +@@ -821,6 +827,12 @@ static int arm_smmu_init_domain_context( + if (smmu_domain->smmu) + goto out_unlock; + ++ if (domain->type == IOMMU_DOMAIN_IDENTITY) { ++ smmu_domain->stage = ARM_SMMU_DOMAIN_BYPASS; ++ smmu_domain->smmu = smmu; ++ goto out_unlock; ++ } ++ + /* + * Mapping the requested stage onto what we support is surprisingly + * complicated, mainly because the spec allows S1+S2 SMMUs without +@@ -981,7 +993,7 @@ static void arm_smmu_destroy_domain_cont + void __iomem *cb_base; + int irq; + +- if (!smmu) ++ if (!smmu || domain->type == IOMMU_DOMAIN_IDENTITY) + return; + + /* +@@ -1004,7 +1016,9 @@ static struct iommu_domain *arm_smmu_dom + { + struct arm_smmu_domain *smmu_domain; + +- if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_DMA) ++ if (type != IOMMU_DOMAIN_UNMANAGED && ++ type != IOMMU_DOMAIN_DMA && ++ type != IOMMU_DOMAIN_IDENTITY) + return NULL; + /* + * Allocate the domain and initialise some of its data structures. +@@ -1202,10 +1216,15 @@ static int arm_smmu_domain_add_master(st + { + struct arm_smmu_device *smmu = smmu_domain->smmu; + struct arm_smmu_s2cr *s2cr = smmu->s2crs; +- enum arm_smmu_s2cr_type type = S2CR_TYPE_TRANS; + u8 cbndx = smmu_domain->cfg.cbndx; ++ enum arm_smmu_s2cr_type type; + int i, idx; + ++ if (smmu_domain->stage == ARM_SMMU_DOMAIN_BYPASS) ++ type = S2CR_TYPE_BYPASS; ++ else ++ type = S2CR_TYPE_TRANS; ++ + for_each_cfg_sme(fwspec, i, idx) { + if (type == s2cr[idx].type && cbndx == s2cr[idx].cbndx) + continue; +@@ -1343,6 +1362,9 @@ static phys_addr_t arm_smmu_iova_to_phys struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops= smmu_domain->pgtbl_ops; @@ -241,7 +488,7 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1368,8 +1376,6 @@ static bool arm_smmu_capable(enum iommu_ +@@ -1368,8 +1390,6 @@ static bool arm_smmu_capable(enum iommu_ * requests. */ return true; @@ -250,7 +497,7 @@ Signed-off-by: Yangbo Lu case IOMMU_CAP_NOEXEC: return true; default: -@@ -1478,10 +1484,12 @@ static struct iommu_group *arm_smmu_devi +@@ -1478,10 +1498,12 @@ static struct iommu_group *arm_smmu_devi } if (group) @@ -264,7 +511,27 @@ Signed-off-by: Yangbo Lu else group = generic_device_group(dev); -@@ -1534,17 +1542,44 @@ out_unlock: +@@ -1493,6 +1515,9 @@ static int arm_smmu_domain_get_attr(stru + { + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + switch (attr) { + case DOMAIN_ATTR_NESTING: + *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); +@@ -1508,6 +1533,9 @@ static int arm_smmu_domain_set_attr(stru + int ret = 0; + struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); + ++ if (domain->type != IOMMU_DOMAIN_UNMANAGED) ++ return -EINVAL; ++ + mutex_lock(&smmu_domain->init_mutex); + + switch (attr) { +@@ -1534,17 +1562,44 @@ out_unlock: static int arm_smmu_of_xlate(struct device *dev, struct of_phandle_args *args) { @@ -310,7 +577,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1560,6 +1595,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1560,6 +1615,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, @@ -319,7 +586,7 @@ Signed-off-by: Yangbo Lu .pgsize_bitmap = -1UL, /* Restricted during device attach */ }; -@@ -1581,16 +1618,22 @@ static void arm_smmu_device_reset(struct +@@ -1581,16 +1638,22 @@ static void arm_smmu_device_reset(struct for (i = 0; i < smmu->num_mapping_groups; ++i) arm_smmu_write_sme(smmu, i); @@ -351,7 +618,7 @@ Signed-off-by: Yangbo Lu writel_relaxed(reg, gr0_base + ARM_SMMU_GR0_sACR); } -@@ -2024,6 +2067,11 @@ static int arm_smmu_device_dt_probe(stru +@@ -2024,6 +2087,11 @@ static int arm_smmu_device_dt_probe(stru bus_set_iommu(&pci_bus_type, &arm_smmu_ops); } #endif @@ -865,7 +1132,15 @@ Signed-off-by: Yangbo Lu static void quirk_iommu_g4x_gfx(struct pci_dev *dev) --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c -@@ -68,6 +68,13 @@ struct iommu_group_attribute { +@@ -36,6 +36,7 @@ + + static struct kset *iommu_group_kset; + static DEFINE_IDA(iommu_group_ida); ++static unsigned int iommu_def_domain_type = IOMMU_DOMAIN_DMA; + + struct iommu_callback_data { + const struct iommu_ops *ops; +@@ -68,6 +69,13 @@ struct iommu_group_attribute { const char *buf, size_t count); }; @@ -879,7 +1154,26 @@ Signed-off-by: Yangbo Lu #define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \ struct iommu_group_attribute iommu_group_attr_##_name = \ __ATTR(_name, _mode, _show, _store) -@@ -133,8 +140,131 @@ static ssize_t iommu_group_show_name(str +@@ -86,6 +94,18 @@ static int __iommu_attach_group(struct i + static void __iommu_detach_group(struct iommu_domain *domain, + struct iommu_group *group); + ++static int __init iommu_set_def_domain_type(char *str) ++{ ++ bool pt; ++ ++ if (!str || strtobool(str, &pt)) ++ return -EINVAL; ++ ++ iommu_def_domain_type = pt ? IOMMU_DOMAIN_IDENTITY : IOMMU_DOMAIN_DMA; ++ return 0; ++} ++early_param("iommu.passthrough", iommu_set_def_domain_type); ++ + static ssize_t iommu_group_attr_show(struct kobject *kobj, + struct attribute *__attr, char *buf) + { +@@ -133,8 +153,131 @@ static ssize_t iommu_group_show_name(str return sprintf(buf, "%s\n", group->name); } @@ -1011,7 +1305,7 @@ Signed-off-by: Yangbo Lu static void iommu_group_release(struct kobject *kobj) { struct iommu_group *group = to_iommu_group(kobj); -@@ -212,6 +342,11 @@ struct iommu_group *iommu_group_alloc(vo +@@ -212,6 +355,11 @@ struct iommu_group *iommu_group_alloc(vo */ kobject_put(&group->kobj); @@ -1023,7 +1317,7 @@ Signed-off-by: Yangbo Lu pr_debug("Allocated group %d\n", group->id); return group; -@@ -318,7 +453,7 @@ static int iommu_group_create_direct_map +@@ -318,7 +466,7 @@ static int iommu_group_create_direct_map struct device *dev) { struct iommu_domain *domain = group->default_domain; @@ -1032,7 +1326,7 @@ Signed-off-by: Yangbo Lu struct list_head mappings; unsigned long pg_size; int ret = 0; -@@ -331,18 +466,21 @@ static int iommu_group_create_direct_map +@@ -331,18 +479,21 @@ static int iommu_group_create_direct_map pg_size = 1UL << __ffs(domain->pgsize_bitmap); INIT_LIST_HEAD(&mappings); @@ -1057,7 +1351,7 @@ Signed-off-by: Yangbo Lu for (addr = start; addr < end; addr += pg_size) { phys_addr_t phys_addr; -@@ -358,7 +496,7 @@ static int iommu_group_create_direct_map +@@ -358,7 +509,7 @@ static int iommu_group_create_direct_map } out: @@ -1066,7 +1360,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -563,6 +701,19 @@ struct iommu_group *iommu_group_get(stru +@@ -563,6 +714,19 @@ struct iommu_group *iommu_group_get(stru EXPORT_SYMBOL_GPL(iommu_group_get); /** @@ -1086,7 +1380,30 @@ Signed-off-by: Yangbo Lu * iommu_group_put - Decrement group reference * @group: the group to use * -@@ -1557,20 +1708,38 @@ int iommu_domain_set_attr(struct iommu_d +@@ -845,10 +1009,19 @@ struct iommu_group *iommu_group_get_for_ + * IOMMU driver. + */ + if (!group->default_domain) { +- group->default_domain = __iommu_domain_alloc(dev->bus, +- IOMMU_DOMAIN_DMA); ++ struct iommu_domain *dom; ++ ++ dom = __iommu_domain_alloc(dev->bus, iommu_def_domain_type); ++ if (!dom && iommu_def_domain_type != IOMMU_DOMAIN_DMA) { ++ dev_warn(dev, ++ "failed to allocate default IOMMU domain of type %u; falling back to IOMMU_DOMAIN_DMA", ++ iommu_def_domain_type); ++ dom = __iommu_domain_alloc(dev->bus, IOMMU_DOMAIN_DMA); ++ } ++ ++ group->default_domain = dom; + if (!group->domain) +- group->domain = group->default_domain; ++ group->domain = dom; + } + + ret = iommu_group_add_device(group, dev); +@@ -1557,20 +1730,38 @@ int iommu_domain_set_attr(struct iommu_d } EXPORT_SYMBOL_GPL(iommu_domain_set_attr); diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index 147b03ae2..eccac7400 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -1,4 +1,4 @@ -From f8daa8e984213554008e73cd155530dceec5a109 Mon Sep 17 00:00:00 2001 +From b14460ee524a34d3b94b44032b52155c4cd708e5 Mon Sep 17 00:00:00 2001 From: Yangbo Lu Date: Wed, 27 Sep 2017 10:34:07 +0800 Subject: [PATCH] usb: support layerscape @@ -15,6 +15,7 @@ Signed-off-by: Suresh Gupta Signed-off-by: Zhao Chenhui Signed-off-by: Yangbo Lu --- + drivers/net/usb/r8152.c | 4 + drivers/usb/common/common.c | 50 ++++++ drivers/usb/core/hub.c | 8 + drivers/usb/dwc3/core.c | 235 ++++++++++++++++++++++++++- @@ -32,8 +33,21 @@ Signed-off-by: Yangbo Lu drivers/usb/phy/phy-fsl-usb.h | 8 + include/linux/usb.h | 1 + include/linux/usb/of.h | 2 + - 17 files changed, 726 insertions(+), 73 deletions(-) + 18 files changed, 730 insertions(+), 73 deletions(-) +--- a/drivers/net/usb/r8152.c ++++ b/drivers/net/usb/r8152.c +@@ -1812,6 +1812,10 @@ static int rx_bottom(struct r8152 *tp, i + unsigned int pkt_len; + struct sk_buff *skb; + ++ /* limite the skb numbers for rx_queue */ ++ if (unlikely(skb_queue_len(&tp->rx_queue) >= 1000)) ++ break; ++ + pkt_len = le32_to_cpu(rx_desc->opts1) & RX_LEN_MASK; + if (pkt_len < ETH_ZLEN) + break; --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -105,6 +105,56 @@ static const char *const usb_dr_modes[] @@ -95,7 +109,7 @@ Signed-off-by: Yangbo Lu int ret; --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -4412,6 +4412,14 @@ hub_port_init(struct usb_hub *hub, struc +@@ -4415,6 +4415,14 @@ hub_port_init(struct usb_hub *hub, struc else speed = usb_speed_string(udev->speed); diff --git a/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch b/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch index 2ba1cb80d..ef545e3db 100644 --- a/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch +++ b/target/linux/mediatek/patches-4.9/0028-net-next-dsa-add-Mediatek-tag-RX-TX-handler.patch @@ -34,7 +34,7 @@ Reviewed-by: Florian Fainelli --- a/net/dsa/Kconfig +++ b/net/dsa/Kconfig -@@ -41,4 +41,6 @@ config NET_DSA_TAG_TRAILER +@@ -42,4 +42,6 @@ config NET_DSA_TAG_TRAILER config NET_DSA_TAG_QCA bool diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch index 5fedc8e8a..dba8f27b3 100644 --- a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch +++ b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1719,8 +1719,10 @@ static struct mvneta_tx_queue *mvneta_tx +@@ -1720,8 +1720,10 @@ static struct mvneta_tx_queue *mvneta_tx /* Free tx queue skbuffs */ static void mvneta_txq_bufs_free(struct mvneta_port *pp, @@ -12,7 +12,7 @@ int i; for (i = 0; i < num; i++) { -@@ -1728,6 +1730,11 @@ static void mvneta_txq_bufs_free(struct +@@ -1729,6 +1731,11 @@ static void mvneta_txq_bufs_free(struct txq->txq_get_index; struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; @@ -24,7 +24,7 @@ mvneta_txq_inc_get(txq); if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) -@@ -1738,6 +1745,8 @@ static void mvneta_txq_bufs_free(struct +@@ -1739,6 +1746,8 @@ static void mvneta_txq_bufs_free(struct continue; dev_kfree_skb_any(skb); } @@ -33,7 +33,7 @@ } /* Handle end of transmission */ -@@ -1751,7 +1760,7 @@ static void mvneta_txq_done(struct mvnet +@@ -1752,7 +1761,7 @@ static void mvneta_txq_done(struct mvnet if (!tx_done) return; @@ -42,7 +42,7 @@ txq->count -= tx_done; -@@ -2358,6 +2367,8 @@ out: +@@ -2359,6 +2368,8 @@ out: struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); @@ -51,7 +51,7 @@ txq->count += frags; mvneta_txq_pend_desc_add(pp, txq, frags); -@@ -2382,9 +2393,10 @@ static void mvneta_txq_done_force(struct +@@ -2383,9 +2394,10 @@ static void mvneta_txq_done_force(struct struct mvneta_tx_queue *txq) { @@ -63,7 +63,7 @@ /* reset txq */ txq->count = 0; -@@ -2880,6 +2892,8 @@ static int mvneta_txq_init(struct mvneta +@@ -2881,6 +2893,8 @@ static int mvneta_txq_init(struct mvneta static void mvneta_txq_deinit(struct mvneta_port *pp, struct mvneta_tx_queue *txq) { @@ -72,7 +72,7 @@ kfree(txq->tx_skb); if (txq->tso_hdrs) -@@ -2891,6 +2905,8 @@ static void mvneta_txq_deinit(struct mvn +@@ -2892,6 +2906,8 @@ static void mvneta_txq_deinit(struct mvn txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->descs, txq->descs_phys); diff --git a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch index 2582a4199..2601d92fc 100644 --- a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3833,6 +3833,16 @@ static int mvneta_ethtool_get_rxfh(struc +@@ -3834,6 +3834,16 @@ static int mvneta_ethtool_get_rxfh(struc return 0; } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3843,6 +3853,7 @@ static const struct net_device_ops mvnet +@@ -3844,6 +3854,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch index da4d24b7d..cac2e6ea6 100644 --- a/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch +++ b/target/linux/mvebu/patches-4.9/400-phy-provide-a-hook-for-link-up-link-down-events.patch @@ -167,7 +167,7 @@ Signed-off-by: Russell King --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -429,6 +429,7 @@ struct phy_device { +@@ -425,6 +425,7 @@ struct phy_device { u8 mdix; diff --git a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch index 360108fcc..20ed3119d 100644 --- a/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch +++ b/target/linux/mvebu/patches-4.9/401-net-phy-move-phy-MMD-accessors-to-phy-core.c.patch @@ -256,7 +256,7 @@ Signed-off-by: Russell King +EXPORT_SYMBOL(phy_write_mmd); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -630,14 +630,7 @@ struct phy_fixup { +@@ -626,14 +626,7 @@ struct phy_fixup { * * Same rules as for phy_read(); */ @@ -272,7 +272,7 @@ Signed-off-by: Russell King /** * phy_read_mmd_indirect - reads data from the MMD registers -@@ -731,16 +724,7 @@ static inline bool phy_is_pseudo_fixed_l +@@ -727,16 +720,7 @@ static inline bool phy_is_pseudo_fixed_l * * Same rules as for phy_write(); */ diff --git a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch b/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch index fcb274d55..33d467794 100644 --- a/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch +++ b/target/linux/mvebu/patches-4.9/402-net-phy-make-phy_-read-write-_mmd-generic-MMD-access.patch @@ -64,7 +64,7 @@ Signed-off-by: Russell King EXPORT_SYMBOL(phy_write_mmd); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -573,6 +573,30 @@ struct phy_driver { +@@ -569,6 +569,30 @@ struct phy_driver { */ void (*link_change_notify)(struct phy_device *dev); diff --git a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch index ae4bb846f..0715a6a8a 100644 --- a/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch +++ b/target/linux/mvebu/patches-4.9/407-net-phy-add-802.3-clause-45-support-to-phylib.patch @@ -295,7 +295,7 @@ Signed-off-by: Russell King } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -810,6 +810,8 @@ static inline const char *phydev_name(co +@@ -806,6 +806,8 @@ static inline const char *phydev_name(co void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) __printf(2, 3); void phy_attached_info(struct phy_device *phydev); @@ -304,7 +304,7 @@ Signed-off-by: Russell King int genphy_config_init(struct phy_device *phydev); int genphy_setup_forced(struct phy_device *phydev); int genphy_restart_aneg(struct phy_device *phydev); -@@ -824,6 +826,16 @@ static inline int genphy_no_soft_reset(s +@@ -820,6 +822,16 @@ static inline int genphy_no_soft_reset(s { return 0; } diff --git a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch b/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch index f4da7e92e..2f0039b11 100644 --- a/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch +++ b/target/linux/mvebu/patches-4.9/411-net-phy-split-out-PHY-speed-and-duplex-string-genera.patch @@ -91,7 +91,7 @@ Signed-off-by: Russell King { --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -645,6 +645,9 @@ struct phy_fixup { +@@ -641,6 +641,9 @@ struct phy_fixup { int (*run)(struct phy_device *phydev); }; diff --git a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch b/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch index 051a9ed68..8ead41cd6 100644 --- a/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch +++ b/target/linux/mvebu/patches-4.9/412-net-phy-move-phy_lookup_setting-and-guts-of-phy_supp.patch @@ -305,7 +305,7 @@ Signed-off-by: Russell King { --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -648,6 +648,21 @@ struct phy_fixup { +@@ -644,6 +644,21 @@ struct phy_fixup { const char *phy_speed_to_str(int speed); const char *phy_duplex_to_str(unsigned int duplex); diff --git a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch index 59e8aa81b..cf9b2061c 100644 --- a/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch +++ b/target/linux/mvebu/patches-4.9/415-phylink-add-phylink-infrastructure.patch @@ -999,7 +999,7 @@ Signed-off-by: Russell King +MODULE_LICENSE("GPL"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -153,6 +153,7 @@ static inline const char *phy_modes(phy_ +@@ -149,6 +149,7 @@ static inline const char *phy_modes(phy_ #define MII_ADDR_C45 (1<<30) struct device; @@ -1007,7 +1007,7 @@ Signed-off-by: Russell King struct sk_buff; /* -@@ -425,6 +426,7 @@ struct phy_device { +@@ -421,6 +422,7 @@ struct phy_device { struct mutex lock; diff --git a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch index bc8d5fdac..8084a17af 100644 --- a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch @@ -21,15 +21,15 @@ Signed-off-by: Russell King Marvell ARMADA XP, ARMADA 370 and ARMADA 38x SoC family. --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -28,6 +28,7 @@ - #include +@@ -29,6 +29,7 @@ #include #include + #include +#include #include #include #include -@@ -188,6 +189,7 @@ +@@ -189,6 +190,7 @@ #define MVNETA_GMAC_CTRL_0 0x2c00 #define MVNETA_GMAC_MAX_RX_SIZE_SHIFT 2 #define MVNETA_GMAC_MAX_RX_SIZE_MASK 0x7ffc @@ -37,7 +37,7 @@ Signed-off-by: Russell King #define MVNETA_GMAC0_PORT_ENABLE BIT(0) #define MVNETA_GMAC_CTRL_2 0x2c08 #define MVNETA_GMAC2_INBAND_AN_ENABLE BIT(0) -@@ -203,13 +205,19 @@ +@@ -204,13 +206,19 @@ #define MVNETA_GMAC_TX_FLOW_CTRL_ENABLE BIT(5) #define MVNETA_GMAC_RX_FLOW_CTRL_ACTIVE BIT(6) #define MVNETA_GMAC_TX_FLOW_CTRL_ACTIVE BIT(7) @@ -57,7 +57,7 @@ Signed-off-by: Russell King #define MVNETA_GMAC_AN_FLOW_CTRL_EN BIT(11) #define MVNETA_GMAC_CONFIG_FULL_DUPLEX BIT(12) #define MVNETA_GMAC_AN_DUPLEX_EN BIT(13) -@@ -399,14 +407,9 @@ struct mvneta_port { +@@ -400,14 +408,9 @@ struct mvneta_port { u16 tx_ring_size; u16 rx_ring_size; @@ -74,7 +74,7 @@ Signed-off-by: Russell King struct mvneta_bm *bm_priv; struct mvneta_bm_pool *pool_long; -@@ -1240,44 +1243,6 @@ static void mvneta_set_other_mcast_table +@@ -1241,44 +1244,6 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -119,7 +119,7 @@ Signed-off-by: Russell King static void mvneta_percpu_unmask_interrupt(void *arg) { struct mvneta_port *pp = arg; -@@ -1425,7 +1390,6 @@ static void mvneta_defaults_set(struct m +@@ -1426,7 +1391,6 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -127,7 +127,7 @@ Signed-off-by: Russell King mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2630,26 +2594,11 @@ static irqreturn_t mvneta_isr(int irq, v +@@ -2631,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v return IRQ_HANDLED; } @@ -156,7 +156,7 @@ Signed-off-by: Russell King } /* NAPI handler -@@ -2665,7 +2614,6 @@ static int mvneta_poll(struct napi_struc +@@ -2666,7 +2615,6 @@ static int mvneta_poll(struct napi_struc u32 cause_rx_tx; int rx_queue; struct mvneta_port *pp = netdev_priv(napi->dev); @@ -164,7 +164,7 @@ Signed-off-by: Russell King struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); if (!netif_running(pp->dev)) { -@@ -2679,12 +2627,11 @@ static int mvneta_poll(struct napi_struc +@@ -2680,12 +2628,11 @@ static int mvneta_poll(struct napi_struc u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE); mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); @@ -182,7 +182,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2980,7 +2927,6 @@ static int mvneta_setup_txqs(struct mvne +@@ -2981,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne static void mvneta_start_dev(struct mvneta_port *pp) { int cpu; @@ -190,7 +190,7 @@ Signed-off-by: Russell King mvneta_max_rx_size_set(pp, pp->pkt_size); mvneta_txq_max_tx_size_set(pp, pp->pkt_size); -@@ -3003,16 +2949,15 @@ static void mvneta_start_dev(struct mvne +@@ -3004,16 +2950,15 @@ static void mvneta_start_dev(struct mvne MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); @@ -209,7 +209,7 @@ Signed-off-by: Russell King for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3182,99 +3127,210 @@ static int mvneta_set_mac_addr(struct ne +@@ -3183,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -490,7 +490,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3532,10 +3588,9 @@ static int mvneta_stop(struct net_device +@@ -3533,10 +3589,9 @@ static int mvneta_stop(struct net_device static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -503,7 +503,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3546,44 +3601,18 @@ mvneta_ethtool_set_link_ksettings(struct +@@ -3547,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct const struct ethtool_link_ksettings *cmd) { struct mvneta_port *pp = netdev_priv(ndev); @@ -557,7 +557,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3691,26 +3720,28 @@ static void mvneta_ethtool_update_stats( +@@ -3692,26 +3721,28 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -591,7 +591,7 @@ Signed-off-by: Russell King } } -@@ -3870,7 +3901,7 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3871,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool .get_rxnfc = mvneta_ethtool_get_rxnfc, .get_rxfh = mvneta_ethtool_get_rxfh, .set_rxfh = mvneta_ethtool_set_rxfh, @@ -600,7 +600,7 @@ Signed-off-by: Russell King .set_link_ksettings = mvneta_ethtool_set_link_ksettings, }; -@@ -3997,14 +4028,13 @@ static int mvneta_probe(struct platform_ +@@ -3998,14 +4029,13 @@ static int mvneta_probe(struct platform_ const struct mbus_dram_target_info *dram_target_info; struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -616,7 +616,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -4020,31 +4050,11 @@ static int mvneta_probe(struct platform_ +@@ -4021,31 +4051,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -649,7 +649,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4055,12 +4065,7 @@ static int mvneta_probe(struct platform_ +@@ -4056,12 +4066,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -663,7 +663,7 @@ Signed-off-by: Russell King pp->rxq_def = rxq_def; -@@ -4071,7 +4076,7 @@ static int mvneta_probe(struct platform_ +@@ -4072,7 +4077,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -672,7 +672,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4179,6 +4184,14 @@ static int mvneta_probe(struct platform_ +@@ -4180,6 +4185,14 @@ static int mvneta_probe(struct platform_ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; @@ -687,7 +687,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4190,14 +4203,6 @@ static int mvneta_probe(struct platform_ +@@ -4191,14 +4204,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -702,7 +702,7 @@ Signed-off-by: Russell King return 0; err_netdev: -@@ -4208,16 +4213,14 @@ err_netdev: +@@ -4209,16 +4214,14 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -721,7 +721,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4229,7 +4232,6 @@ err_free_netdev: +@@ -4230,7 +4233,6 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -729,7 +729,7 @@ Signed-off-by: Russell King struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); -@@ -4237,10 +4239,8 @@ static int mvneta_remove(struct platform +@@ -4238,10 +4240,8 @@ static int mvneta_remove(struct platform clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index 255872026..6d35b5005 100644 --- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2629,9 +2629,11 @@ static int mvneta_poll(struct napi_struc +@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -26,7 +26,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2946,8 +2948,7 @@ static void mvneta_start_dev(struct mvne +@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -36,7 +36,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3438,8 +3439,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -46,7 +46,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3480,8 +3480,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch index 9a604eb03..20c23ba2a 100644 --- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch +++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3614,6 +3614,13 @@ mvneta_ethtool_get_link_ksettings(struct +@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct return phylink_ethtool_ksettings_get(pp->phylink, cmd); } @@ -25,7 +25,7 @@ Signed-off-by: Russell King /* Set interrupt coalescing for ethtools */ static int mvneta_ethtool_set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) -@@ -3887,6 +3894,7 @@ static const struct net_device_ops mvnet +@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet }; const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch index f10b57c99..3f778953e 100644 --- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch +++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3178,6 +3178,12 @@ static int mvneta_mac_link_state(struct +@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); @@ -24,7 +24,7 @@ Signed-off-by: Russell King return 1; } -@@ -3220,6 +3226,8 @@ static void mvneta_mac_config(struct net +@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net if (phylink_test(state->advertising, Pause)) new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL; @@ -33,7 +33,7 @@ Signed-off-by: Russell King switch (mode) { case MLO_AN_SGMII: -@@ -3244,7 +3252,7 @@ static void mvneta_mac_config(struct net +@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net /* The MAC only supports FD mode */ MVNETA_GMAC_CONFIG_FULL_DUPLEX; @@ -42,7 +42,7 @@ Signed-off-by: Russell King new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN; break; -@@ -3710,6 +3718,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -65,7 +65,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3901,6 +3925,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool .get_drvinfo = mvneta_ethtool_get_drvinfo, .get_ringparam = mvneta_ethtool_get_ringparam, .set_ringparam = mvneta_ethtool_set_ringparam, diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch index 29d45f921..f2d14afda 100644 --- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch +++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3152,10 +3152,11 @@ static void mvneta_validate_support(stru +@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Full); diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch index 60f549cc8..bac74ca4e 100644 --- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch +++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3142,6 +3142,8 @@ static void mvneta_validate_support(stru +@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru phylink_set(mask, BNC); phylink_set(mask, Backplane); @@ -20,7 +20,7 @@ Signed-off-by: Russell King /* Half-duplex at speeds higher than 100Mbit is unsupported */ phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); -@@ -3154,9 +3156,6 @@ static void mvneta_validate_support(stru +@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru phylink_set(mask, 100baseT_Full); } diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch index 767830419..bc7e5eeeb 100644 --- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3304,7 +3304,8 @@ static void mvneta_mac_link_down(struct +@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct } } diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch index e1e11ee29..3a20a06be 100644 --- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch @@ -13,7 +13,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -243,6 +243,12 @@ +@@ -244,6 +244,12 @@ #define MVNETA_TXQ_TOKEN_SIZE_REG(q) (0x3e40 + ((q) << 2)) #define MVNETA_TXQ_TOKEN_SIZE_MAX 0x7fffffff @@ -26,7 +26,7 @@ Signed-off-by: Russell King #define MVNETA_CAUSE_TXQ_SENT_DESC_ALL_MASK 0xff /* Descriptor ring Macros */ -@@ -316,6 +322,11 @@ +@@ -317,6 +323,11 @@ #define MVNETA_RX_GET_BM_POOL_ID(rxd) \ (((rxd)->status & MVNETA_RXD_BM_POOL_MASK) >> MVNETA_RXD_BM_POOL_SHIFT) @@ -38,7 +38,7 @@ Signed-off-by: Russell King struct mvneta_statistic { unsigned short offset; unsigned short type; -@@ -324,6 +335,7 @@ struct mvneta_statistic { +@@ -325,6 +336,7 @@ struct mvneta_statistic { #define T_REG_32 32 #define T_REG_64 64 @@ -46,7 +46,7 @@ Signed-off-by: Russell King static const struct mvneta_statistic mvneta_statistics[] = { { 0x3000, T_REG_64, "good_octets_received", }, -@@ -358,6 +370,7 @@ static const struct mvneta_statistic mvn +@@ -359,6 +371,7 @@ static const struct mvneta_statistic mvn { 0x304c, T_REG_32, "broadcast_frames_sent", }, { 0x3054, T_REG_32, "fc_sent", }, { 0x300c, T_REG_32, "internal_mac_transmit_err", }, @@ -54,7 +54,7 @@ Signed-off-by: Russell King }; struct mvneta_pcpu_stats { -@@ -416,6 +429,10 @@ struct mvneta_port { +@@ -417,6 +430,10 @@ struct mvneta_port { struct mvneta_bm_pool *pool_short; int bm_win_id; @@ -65,7 +65,7 @@ Signed-off-by: Russell King u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; u32 indir[MVNETA_RSS_LU_TABLE_SIZE]; -@@ -3289,6 +3306,18 @@ static void mvneta_mac_config(struct net +@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an); } @@ -84,7 +84,7 @@ Signed-off-by: Russell King static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) { struct mvneta_port *pp = netdev_priv(ndev); -@@ -3302,6 +3331,9 @@ static void mvneta_mac_link_down(struct +@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct val |= MVNETA_GMAC_FORCE_LINK_DOWN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); } @@ -94,7 +94,7 @@ Signed-off-by: Russell King } static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode, -@@ -3318,6 +3350,11 @@ static void mvneta_mac_link_up(struct ne +@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne } mvneta_port_up(pp); @@ -106,7 +106,7 @@ Signed-off-by: Russell King } static const struct phylink_mac_ops mvneta_phylink_ops = { -@@ -3770,6 +3807,13 @@ static void mvneta_ethtool_update_stats( +@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats( high = readl_relaxed(base + s->offset + 4); val = (u64)high << 32 | low; break; @@ -120,7 +120,7 @@ Signed-off-by: Russell King } pp->ethtool_stats[i] += val; -@@ -3905,6 +3949,47 @@ static u16 mvneta_select_queue(struct ne +@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne } @@ -168,7 +168,7 @@ Signed-off-by: Russell King static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3937,6 +4022,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch index 1f35a18b9..834bbe9a3 100644 --- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch @@ -7,7 +7,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3949,6 +3949,22 @@ static u16 mvneta_select_queue(struct ne +@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne } @@ -30,7 +30,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4022,6 +4038,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 83e1a9400..74e405e42 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -86,6 +86,12 @@ c108) ucidef_set_led_netdev "lan" "lan" "$board:green:lan" "eth0" ucidef_set_led_netdev "modem" "modem" "$board:green:modem" "wwan0" ;; +c20) + ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01" + set_usb_led "$board:blue:usb" + ucidef_set_led_netdev "wlan2g" "wlan2g" "$board:blue:wlan2g" "wlan0" + ;; c20i) ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e" ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01" @@ -247,8 +253,9 @@ miniembplug) set_usb_led "$board:green:mobile" ;; mir3g) - ucidef_set_led_netdev "eth" "Ethernet" "$board:red:wan" "eth0" - set_usb_led "$board:blue:usb" + ucidef_set_led_switch "wan-amber" "WAN (amber)" "$board:amber:wan" "switch0" "0x02" "0x08" + ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$board:amber:lan1" "switch0" "0x08" "0x08" + ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$board:amber:lan2" "switch0" "0x04" "0x08" ;; miwifi-mini) ucidef_set_led_default "power" "power" "$board:red:status" "1" @@ -361,6 +368,19 @@ tl-wr841n-v13) ucidef_set_led_switch "lan4" "lan4" "$board:green:lan4" "switch0" "0x10" ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" ;; +u25awf-h1) + set_wifi_led "u25awf:red:wifi" + ucidef_set_led_netdev "eth" "eth" "u25awf:green:lan" "eth0" + ;; +u7628-01-128M-16M) + ucidef_set_led_switch "lan1" "lan1" "u7628-01:green:lan1" "switch0" "0x2" + ucidef_set_led_switch "lan2" "lan2" "u7628-01:green:lan2" "switch0" "0x4" + ucidef_set_led_switch "lan3" "lan3" "u7628-01:green:lan3" "switch0" "0x8" + ucidef_set_led_switch "lan4" "lan4" "u7628-01:green:lan4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "u7628-01:green:wan" "switch0" "0x01" + set_usb_led "u7628-01:green:usb" + set_wifi_led "u7628-01:green:wlan" + ;; vocore-8M|\ vocore-16M) ucidef_set_led_netdev "eth" "ETH" "vocore:orange:eth" "eth0" @@ -379,6 +399,11 @@ w502u) wcr-150gn) set_usb_led "$board:amber:user" ;; +we1026-5g-16m) + ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" + set_wifi_led "we1026-5g:green:wifi" + set_usb_led "we1026-5g:green:usb" "1-1.1" + ;; whr-1166d|\ whr-300hp2|\ whr-600d) @@ -445,9 +470,9 @@ zte-q7) set_wifi_led "$board:blue:status" ;; youku-yk1) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" set_wifi_led "$board:blue:air" set_usb_led "$board:blue:usb" + ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x10" ;; esac diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 9284b1812..6ad64e672 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -102,6 +102,7 @@ ramips_setup_interfaces() r6220|\ sap-g3200u3|\ sk-wb8|\ + u7621-06-256M-16M|\ vr500|\ wf-2881|\ witi|\ @@ -113,6 +114,7 @@ ramips_setup_interfaces() youku-yk1|\ zbt-ape522ii|\ zbt-we1326|\ + zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -124,7 +126,7 @@ ramips_setup_interfaces() ;; mir3g) ucidef_add_switch "switch0" \ - "1:wan" "2:lan:2" "3:lan:1" "6@eth0" + "2:lan:2" "3:lan:1" "1:wan" "6t@eth0" ;; psg1218b) ucidef_add_switch "switch0" \ @@ -171,7 +173,9 @@ ramips_setup_interfaces() rb750gr3|\ rt-n14u|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13|\ + u7628-01-128M-16M|\ ubnt-erx|\ ubnt-erx-sfp|\ ur-326n4g|\ @@ -184,6 +188,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6@eth0" ;; + c20|\ c50) ucidef_add_switch "switch0" \ "1:lan:3" "2:lan:4" "3:lan:1" "4:lan:2" "0:wan" "6@eth0" @@ -236,6 +241,7 @@ ramips_setup_interfaces() mzk-ex750np|\ na930|\ pbr-d1|\ + u25awf-h1|\ wli-tx4-ag300n|\ wmdr-143n|\ wmr-300|\ @@ -323,7 +329,8 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "3:lan" "4:wan" "6@eth0" ;; - wcr-150gn) + wcr-150gn|\ + we1026-5g-16m) ucidef_add_switch "switch0" \ "0:lan" "6t@eth0" ;; @@ -427,7 +434,7 @@ ramips_setup_macs() wan_mac=$(macaddr_add "$lan_mac" 1) ;; mir3g) - lan_mac=$(mtd_get_mac_binary Factory e006) + lan_mac=$(mtd_get_mac_binary Factory 0xe006) ;; miwifi-mini) wan_mac=$(cat /sys/class/net/eth0/address) diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 75171673b..50cc44058 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -24,6 +24,7 @@ get_status_led() { ex2700|\ ex3700|\ fonera20n|\ + hg255d|\ kn|\ kn_rc|\ kn_rf|\ @@ -36,6 +37,7 @@ get_status_led() { pwh2004|\ r6220|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13|\ vr500|\ wnce2001|\ @@ -118,6 +120,7 @@ get_status_led() { w502u) status_led="$board:blue:wps" ;; + c20|\ d240|\ dap-1350|\ na930|\ @@ -132,7 +135,8 @@ get_status_led() { wl-330n3g|\ wli-tx4-ag300n|\ y1|\ - y1s) + y1s|\ + youku-yk1) status_led="$board:blue:power" ;; db-wrt01|\ @@ -236,6 +240,15 @@ get_status_led() { sap-g3200u3) status_led="$board:green:usb" ;; + u25awf-h1) + status_led="u25awf:red:wifi" + ;; + u7621-06-256M-16M) + status_led="u7621-06:green:status" + ;; + u7628-01-128M-16M) + status_led="u7628-01:green:power" + ;; v22rw-2x2) status_led="$board:green:security" ;; diff --git a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips index 452b1b203..5048dacb4 100644 --- a/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips +++ b/target/linux/ramips/base-files/lib/preinit/07_set_preinit_iface_ramips @@ -6,17 +6,22 @@ . /lib/ramips.sh ramips_set_preinit_iface() { - RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620)"` + RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350|MT7628|MT7688|MT7620|MT7621)"` if [ -n "${RT3X5X}" ]; then # The ethernet switch driver enables VLAN by default, but # failsafe uses eth0, making the device unreachable: # https://dev.openwrt.org/ticket/18768 - ralink_switchdev=rt305x case "${RT3X5X}" in *MT7620*) ralink_switchdev=mt7620 ;; + *MT7621*) + ralink_switchdev=mt7530 + ;; + *) + ralink_switchdev=rt305x + ;; esac swconfig dev $ralink_switchdev set reset 1 swconfig dev $ralink_switchdev set enable_vlan 0 diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 174e29e43..76ca3d130 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -88,6 +88,9 @@ ramips_board_detect() { *"C108") name="c108" ;; + *"C20") + name="c20" + ;; *"C20i") name="c20i" ;; @@ -499,9 +502,21 @@ ramips_board_detect() { *"TL-WR840N v4") name="tl-wr840n-v4" ;; + *"TL-WR840N v5") + name="tl-wr840n-v5" + ;; *"TL-WR841N v13") name="tl-wr841n-v13" ;; + *"U25AWF-H1") + name="u25awf-h1" + ;; + *"U7621-06 (256M RAM/16M flash)") + name="u7621-06-256M-16M" + ;; + *"U7628-01 (128M RAM/16M flash)") + name="u7628-01-128M-16M" + ;; *"UBNT-ERX") name="ubnt-erx" ;; @@ -553,6 +568,9 @@ ramips_board_detect() { *"WCR-150GN") name="wcr-150gn" ;; + *"WE1026-5G (16M)") + name="we1026-5g-16m" + ;; *"WF-2881") name="wf-2881" ;; @@ -719,7 +737,9 @@ ramips_board_detect() { name="youku-yk1" ;; *) - name="generic" + name="$(strings /proc/device-tree/compatible | head -1)" + name="${name##*,}" + name="${name:-generic}" ;; esac diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 5cfca52ab..0d5b6bb4f 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -144,6 +144,9 @@ platform_check_image() { tew-714tru|\ timecloud|\ tiny-ac|\ + u25awf-h1|\ + u7621-06-256M-16M|\ + u7628-01-128M-16M|\ ur-326n4g|\ ur-336un|\ v22rw-2x2|\ @@ -193,11 +196,13 @@ platform_check_image() { x8|\ y1|\ y1s|\ + we1026-5g-16m|\ zbt-ape522ii|\ zbt-cpe102|\ zbt-wa05|\ zbt-we1326|\ zbt-we2026|\ + zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -229,10 +234,12 @@ platform_check_image() { } return 0 ;; + c20|\ c20i|\ c50|\ mr200|\ tl-wr840n-v4|\ + tl-wr840n-v5|\ tl-wr841n-v13) [ "$magic" != "03000000" ] && { echo "Invalid image type." diff --git a/target/linux/ramips/dts/ArcherC20.dts b/target/linux/ramips/dts/ArcherC20.dts new file mode 100644 index 000000000..f0281c37c --- /dev/null +++ b/target/linux/ramips/dts/ArcherC20.dts @@ -0,0 +1,187 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "tplink,c20", "ralink,mt7620a-soc"; + model = "TP-Link Archer C20"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + lan { + label = "c20:blue:lan"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + }; + + power { + label = "c20:blue:power"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + default-state = "keep"; + }; + + usb { + label = "c20:blue:usb"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "c20:blue:wan"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + wan_orange { + label = "c20:orange:wan"; + gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>; + }; + + wlan5g { + label = "c20:blue:wlan5g"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "c20:blue:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "c20:blue:wps"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + linux,code = ; + }; }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x20000 0x7a0000>; + }; + + partition@7c0000 { + label = "config"; + reg = <0x7c0000 0x10000>; + read-only; + }; + + rom: partition@7d0000 { + label = "rom"; + reg = <0x7d0000 0x10000>; + read-only; + }; + + partition@7e0000 { + label = "romfile"; + reg = <0x7e0000 0x10000>; + read-only; + }; + + radio: partition@7f0000 { + label = "radio"; + reg = <0x7f0000 0x10000>; + read-only; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk", "wdt"; + ralink,function = "gpio"; + }; + }; +}; + +ðernet { + pinctrl-names = "default"; + mtd-mac-address = <&rom 0xf100>; + mediatek,portmap = "wllll"; + }; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&wmac { + ralink,mtd-eeprom = <&radio 0>; + mtd-mac-address = <&rom 0xf100>; + mtd-mac-address-increment = <(-2)>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; +}; + +&pcie { + status = "okay"; + + pcie-bridge { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&radio 32768>; + ieee80211-freq-limit = <5000000 6000000>; + mtd-mac-address = <&rom 0xf100>; + mtd-mac-address-increment = <(-1)>; + }; + }; +}; diff --git a/target/linux/ramips/dts/ArcherC50.dts b/target/linux/ramips/dts/ArcherC50.dts index e8729232b..88bd3272d 100644 --- a/target/linux/ramips/dts/ArcherC50.dts +++ b/target/linux/ramips/dts/ArcherC50.dts @@ -142,11 +142,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "ephy", "spi refclk", "mdio", "wdt", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -172,6 +167,8 @@ ralink,mtd-eeprom = <&radio 0>; mtd-mac-address = <&rom 0xf100>; mtd-mac-address-increment = <(-2)>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { diff --git a/target/linux/ramips/dts/D240.dts b/target/linux/ramips/dts/D240.dts index 4f3da8d31..392e92d46 100644 --- a/target/linux/ramips/dts/D240.dts +++ b/target/linux/ramips/dts/D240.dts @@ -52,9 +52,16 @@ power_mpcie2 { gpio-export,name = "power_mpcie2"; - gpio-export,output = ; - gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + gpio-export,output = <1>; + gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>; }; + + power_mpcie1 { + gpio-export,name = "power_mpcie1"; + gpio-export,output = <1>; + gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + }; + }; gpio-leds { @@ -94,6 +101,10 @@ status = "okay"; }; +&gpio2 { + status = "okay"; +}; + &gpio3 { status = "okay"; }; @@ -157,7 +168,7 @@ &pinctrl { state_default: pinctrl0 { default { - ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa"; + ralink,group = "i2c", "uartf", "wled", "spi refclk", "pa", "nd_sd"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/DCH-M225.dts b/target/linux/ramips/dts/DCH-M225.dts index 867335e95..1aea90805 100644 --- a/target/linux/ramips/dts/DCH-M225.dts +++ b/target/linux/ramips/dts/DCH-M225.dts @@ -90,7 +90,7 @@ #sound-dai-cells = <0>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&gpio_i2s_pins>, <&wm8960_mclk_pins>; + pinctrl-0 = <&mdio_refclk_pins>; }; &spi0 { @@ -158,16 +158,9 @@ ralink,function = "gpio"; }; - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; - - wm8960_mclk_pins: wm8960_mclk { - wm8960_mclk { - ralink,group = "mdio"; - ralink,function = "refclk"; - }; + gpio_i2s { + ralink,group = "uartf"; + ralink,function = "gpio i2s"; }; }; }; @@ -182,5 +175,6 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; - diff --git a/target/linux/ramips/dts/DIR-615-H1.dts b/target/linux/ramips/dts/DIR-615-H1.dts index 9e8b86ed7..7d410f1dd 100644 --- a/target/linux/ramips/dts/DIR-615-H1.dts +++ b/target/linux/ramips/dts/DIR-615-H1.dts @@ -99,21 +99,13 @@ ralink,group = "i2c", "jtag", "uartf"; ralink,function = "gpio"; }; - - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; - - mdio { - ralink,group = "mdio"; - ralink,function = "mdio"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x28>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins &mdio_pins>; }; &esw { diff --git a/target/linux/ramips/dts/DIR-620-D1.dts b/target/linux/ramips/dts/DIR-620-D1.dts index baf17e733..2def8aae4 100644 --- a/target/linux/ramips/dts/DIR-620-D1.dts +++ b/target/linux/ramips/dts/DIR-620-D1.dts @@ -78,21 +78,13 @@ ralink,group = "i2c", "jtag", "uartf"; ralink,function = "gpio"; }; - - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; - - mdio { - ralink,group = "mdio"; - ralink,function = "mdio"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins &mdio_pins>; }; &esw { diff --git a/target/linux/ramips/dts/DUZUN-DM06.dts b/target/linux/ramips/dts/DUZUN-DM06.dts index 97625d875..b8261a591 100644 --- a/target/linux/ramips/dts/DUZUN-DM06.dts +++ b/target/linux/ramips/dts/DUZUN-DM06.dts @@ -63,20 +63,6 @@ ralink,function = "gpio"; }; }; - - i2s_pins: i2s { - i2s { - ralink,group = "i2s"; - ralink,function = "i2s"; - }; - }; - - wm8960_mclk_pins: wm8960_mclk { - wm8960_mclk { - ralink,group = "refclk"; - ralink,function = "reclk"; - }; - }; }; &gpio1 { @@ -108,7 +94,7 @@ #sound-dai-cells = <0>; status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&i2s_pins>, <&wm8960_mclk_pins>; + pinctrl-0 = <&i2s_pins>, <&refclk_pins>; }; &sdhci { diff --git a/target/linux/ramips/dts/EW1200.dts b/target/linux/ramips/dts/EW1200.dts index e6b96fa2b..84c4f72cb 100644 --- a/target/linux/ramips/dts/EW1200.dts +++ b/target/linux/ramips/dts/EW1200.dts @@ -121,7 +121,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/HC5X61.dtsi b/target/linux/ramips/dts/HC5X61.dtsi index 1a5927dfd..f0b59ecf1 100644 --- a/target/linux/ramips/dts/HC5X61.dtsi +++ b/target/linux/ramips/dts/HC5X61.dtsi @@ -122,6 +122,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -134,10 +136,5 @@ ralink,group = "uartf", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/K2P.dts b/target/linux/ramips/dts/K2P.dts index 4089ce64f..db4dc2987 100644 --- a/target/linux/ramips/dts/K2P.dts +++ b/target/linux/ramips/dts/K2P.dts @@ -106,7 +106,7 @@ }; ðernet { - mtd-mac-address = <&factory 0xe000>; + mtd-mac-address = <&factory 0xe006>; }; &pinctrl { diff --git a/target/linux/ramips/dts/MIR3G.dts b/target/linux/ramips/dts/MIR3G.dts index 0cdb6d57f..efe98b0e1 100644 --- a/target/linux/ramips/dts/MIR3G.dts +++ b/target/linux/ramips/dts/MIR3G.dts @@ -21,20 +21,36 @@ gpio-leds { compatible = "gpio-leds"; - wan { - label = "mir3g:red:wan"; + status_red { + label = "mir3g:red:status"; gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; }; - usb { - label = "mir3g:blue:usb"; + status_blue { + label = "mir3g:blue:status"; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; - status { + status_yellow { label = "mir3g:yellow:status"; gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; }; + + wan_amber { + label = "mir3g:amber:wan"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + lan1_amber { + label = "mir3g:amber:lan1"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + lan2_amber { + label = "mir3g:amber:lan2"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + }; gpio-keys-polled { @@ -45,10 +61,21 @@ reset { label = "reset"; - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; linux,code = ; }; }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + usbpower { + gpio-export,name = "usbpower"; + gpio-export,output = <1>; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; }; &nand { @@ -63,7 +90,6 @@ partition@80000 { label = "Config"; reg = <0x80000 0x40000>; - read-only; }; partition@c0000 { @@ -81,13 +107,11 @@ partition@140000 { label = "crash"; reg = <0x140000 0x40000>; - read-only; }; partition@180000 { label = "crash_syslog"; reg = <0x180000 0x40000>; - read-only; }; partition@1c0000 { @@ -96,15 +120,22 @@ read-only; }; - /* - * kernel0 partition should be erased, so - * u-boot in failsafe routine switches - * to next one looking for kernel image. - * To remind about this fact rename kernel0 - * into kernel_erase. + /* uboot expects to find kernels at 0x200000 & 0x600000 + * referred to as system 1 & system 2 respectively. + * a kernel is considered suitable for handing control over + * if its linux magic number exists & uImage CRC are correct. + * If either of those conditions fail, a matching sys'n'_fail flag + * is set in uboot env & a restart performed in the hope that the + * alternate kernel is okay. + * if neither kernel checksums ok and both are marked failed, system 2 + * is booted anyway. + * + * Note uboot's tftp flash install writes the transferred + * image to both kernel partitions. */ + partition@200000 { - label = "kernel_erase"; + label = "kernel_stock"; reg = <0x200000 0x400000>; }; @@ -114,12 +145,13 @@ }; /* ubi partition is the result of squashing - * next consequent stock partitions: - * - rootfs0 (rootfs partition for stock kernel0), - * - rootfs1 (rootfs partition for stock failsafe kernel1), + * next consecutive stock partitions: + * - rootfs0 (rootfs partition for stock kernel0), + * - rootfs1 (rootfs partition for stock failsafe kernel1), * - overlay (used as ubi overlay in stock fw) * resulting 117,5MiB space for packages. */ + partition@a00000 { label = "ubi"; reg = <0xa00000 0x7580000>; @@ -136,7 +168,7 @@ mediatek,mtd-eeprom = <&factory 0x0000>; ieee80211-freq-limit = <2400000 2500000>; }; - }; + }; pcie1 { wifi@14c3,7662 { @@ -156,7 +188,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "jtag", "uart3", "wdt"; + ralink,group = "jtag", "uart2", "uart3", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/MIWIFI-MINI.dts b/target/linux/ramips/dts/MIWIFI-MINI.dts index 9da5673d4..3da39c529 100644 --- a/target/linux/ramips/dts/MIWIFI-MINI.dts +++ b/target/linux/ramips/dts/MIWIFI-MINI.dts @@ -125,6 +125,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -146,10 +148,5 @@ ralink,group = "i2c", "rgmii1"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/PSG1218A.dts b/target/linux/ramips/dts/PSG1218A.dts index c63af5803..d76abc39f 100644 --- a/target/linux/ramips/dts/PSG1218A.dts +++ b/target/linux/ramips/dts/PSG1218A.dts @@ -31,11 +31,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -45,3 +40,8 @@ mtd-mac-address = <&factory 0x28>; mediatek,portmap = "llllw"; }; + +&wmac { + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; +}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts index 7811ee20d..5c7b3c7c4 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO-EVB.dts @@ -1,6 +1,6 @@ /dts-v1/; -#include "rt5350.dtsi" +#include "RT5350F-OLINUXINO.dtsi" #include @@ -30,72 +30,3 @@ }; }; }; - -&spi0 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; -}; - -ðernet { - mtd-mac-address = <&factory 0x4>; -}; - -&esw { - mediatek,portmap = <0x2f>; - mediatek,led_polarity = <0x17>; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts index 6ee3daeaa..2e0dcb155 100644 --- a/target/linux/ramips/dts/RT5350F-OLINUXINO.dts +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dts @@ -1,77 +1,8 @@ /dts-v1/; -#include "rt5350.dtsi" +#include "RT5350F-OLINUXINO.dtsi" / { compatible = "olimex,rt5350f-olinuxino", "ralink,rt5350-soc"; model = "Olimex RT5350F-OLinuXino"; }; - -&spi0 { - status = "okay"; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <1>; - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <10000000>; - - partition@0 { - label = "u-boot"; - reg = <0x0 0x30000>; - read-only; - }; - - partition@30000 { - label = "u-boot-env"; - reg = <0x30000 0x10000>; - read-only; - }; - - factory: partition@40000 { - label = "factory"; - reg = <0x40000 0x10000>; - read-only; - }; - - partition@50000 { - label = "firmware"; - reg = <0x50000 0x7b0000>; - }; - }; -}; - -&gpio1 { - status = "okay"; -}; - -&pinctrl { - state_default: pinctrl0 { - gpio { - ralink,group = "jtag", "rgmii", "mdio", "uartf"; - ralink,function = "gpio"; - }; - }; -}; - -ðernet { - mtd-mac-address = <&factory 0x4>; -}; - -&esw { - mediatek,portmap = <0x2f>; - mediatek,led_polarity = <0x17>; -}; - -&wmac { - ralink,mtd-eeprom = <&factory 0>; -}; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; diff --git a/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi new file mode 100644 index 000000000..629dab893 --- /dev/null +++ b/target/linux/ramips/dts/RT5350F-OLINUXINO.dtsi @@ -0,0 +1,94 @@ +#include "rt5350.dtsi" + +/ { + compatible = "olimex,rt5350f-olinuxino", "ralink,rt5350-soc"; + + aliases { + serial0 = &uartlite; + serial1 = &uart; + }; +}; + + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "rgmii", "mdio"; + ralink,function = "gpio"; + }; + uartf_gpio { + ralink,group = "uartf"; + ralink,function = "gpio uartf"; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&esw { + mediatek,portmap = <0x2f>; + mediatek,led_polarity = <0x17>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; + ralink,led-polarity = <1>; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&i2c { + status = "okay"; +}; + +&uart { + status = "okay"; +}; + diff --git a/target/linux/ramips/dts/TL-WR840NV5.dts b/target/linux/ramips/dts/TL-WR840NV5.dts new file mode 100644 index 000000000..340f2bbd8 --- /dev/null +++ b/target/linux/ramips/dts/TL-WR840NV5.dts @@ -0,0 +1,111 @@ +/dts-v1/; + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-wr840n-v5", "mediatek,mt7628an-soc"; + model = "TP-Link TL-WR840N v5"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x4000000>; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + /* LED used is dual-color,dual lead LED */ + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "tl-wr840n-v5:green:power"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + orange { + label = "tl-wr840n-v5:orange:power"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "boot"; + reg = <0x0 0x20000>; + read-only; + }; + + partition@20000 { + label = "firmware"; + reg = <0x20000 0x3c0000>; + }; + + partition@3e0000 { + label = "config"; + reg = <0x3e0000 0x10000>; + read-only; + }; + + factory: partition@3f0000 { + label = "factory"; + reg = <0x3f0000 0x10000>; + read-only; + }; + }; +}; + +&ehci { + status = "disabled"; +}; + +&ohci { + status = "disabled"; +}; + +&wmac { + status = "okay"; + mtd-mac-address = <&factory 0xf100>; + mediatek,mtd-eeprom = <&factory 0x10000>; +}; + +ðernet { + mtd-mac-address = <&factory 0xf100>; + mediatek,portmap = "wllll"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "p0led_an", "p2led_an", "perst"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U25AWF-H1.dts b/target/linux/ramips/dts/U25AWF-H1.dts new file mode 100644 index 000000000..8021b0f79 --- /dev/null +++ b/target/linux/ramips/dts/U25AWF-H1.dts @@ -0,0 +1,106 @@ +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/{ + compatible = "kimax,u25awf-h1","ralink,mt7620a-soc"; + model = "Kimax U25AWF-H1"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wifi { + label = "u25awf:red:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "u25awf:green:lan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "uartf", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7621-06-256M-16M.dts b/target/linux/ramips/dts/U7621-06-256M-16M.dts new file mode 100644 index 000000000..1bf03fdf5 --- /dev/null +++ b/target/linux/ramips/dts/U7621-06-256M-16M.dts @@ -0,0 +1,86 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "U7621-06.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7621-06-256m-16m", "unielec,u7621-06", "mediatek,mt7621-soc"; + model = "UniElec U7621-06 (256M RAM/16M flash)"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x10000000>; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <14000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7621-06.dtsi b/target/linux/ramips/dts/U7621-06.dtsi new file mode 100644 index 000000000..0502904bd --- /dev/null +++ b/target/linux/ramips/dts/U7621-06.dtsi @@ -0,0 +1,117 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7621-06", "mediatek,mt7621-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + modem_reset { + gpio-export,name = "modem_reset"; + gpio-export,output = <1>; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + status { + label = "u7621-06:green:status"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + led4 { + label = "u7621-06:green:led4"; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + + led5 { + label = "u7621-06:green:led5"; + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&sdhci { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&sdhci_pins>; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; + mediatek,portmap = "llllw"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "jtag", "uart2", "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7628-01-128M-16M.dts b/target/linux/ramips/dts/U7628-01-128M-16M.dts new file mode 100644 index 000000000..4b3345da3 --- /dev/null +++ b/target/linux/ramips/dts/U7628-01-128M-16M.dts @@ -0,0 +1,83 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "U7628-01.dtsi" + +/ { + compatible = "unielec,u7628-01-128m-16m", "unielec,u7628-01", "mediatek,mt7628an-soc"; + model = "UniElec U7628-01 (128M RAM/16M flash)"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <12000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/U7628-01.dtsi b/target/linux/ramips/dts/U7628-01.dtsi new file mode 100644 index 000000000..34226a4a4 --- /dev/null +++ b/target/linux/ramips/dts/U7628-01.dtsi @@ -0,0 +1,132 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * Copyright(c) 2017 Piotr Dymacz . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7628an.dtsi" + +#include +#include + +/ { + compatible = "unielec,u7628-01", "mediatek,mt7628an-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power { + label = "u7628-01:green:power"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "u7628-01:green:wlan"; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "u7628-01:green:wan"; + gpios = <&gpio1 11 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "u7628-01:green:lan1"; + gpios = <&gpio1 10 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "u7628-01:green:lan2"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "u7628-01:green:lan3"; + gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "u7628-01:green:lan4"; + gpios = <&gpio1 7 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "u7628-01:green:usb"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&gpio1 { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + status = "okay"; + ralink,mtd-eeprom = <&factory 0x0>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "gpio", "p0led_an", "p1led_an", "p2led_an", "p3led_an", "p4led_an", "refclk", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/VOCORE2.dtsi b/target/linux/ramips/dts/VOCORE2.dtsi index dc1bd17b0..f7aec8e1f 100644 --- a/target/linux/ramips/dts/VOCORE2.dtsi +++ b/target/linux/ramips/dts/VOCORE2.dtsi @@ -12,7 +12,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wled_an", "perst", "wdt"; + ralink,group = "wled_an", "refclk", "wdt"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/WE1026-5G-16M.dts b/target/linux/ramips/dts/WE1026-5G-16M.dts new file mode 100644 index 000000000..e01e86423 --- /dev/null +++ b/target/linux/ramips/dts/WE1026-5G-16M.dts @@ -0,0 +1,76 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "WE1026-5G.dtsi" + +/ { + compatible = "zbtlink,we1026-5g-16m", "ralink,mt7620a-soc"; + model = "ZBT WE1026-5G (16M)"; +}; + +&spi0 { + status = "okay"; + + en25q128@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/WE1026-5G.dtsi b/target/linux/ramips/dts/WE1026-5G.dtsi new file mode 100644 index 000000000..c357e1eee --- /dev/null +++ b/target/linux/ramips/dts/WE1026-5G.dtsi @@ -0,0 +1,124 @@ +/* + * BSD LICENSE + * + * Copyright(c) 2017 Kristian Evensen . + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Broadcom Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,we1026-5g", "ralink,mt7620a-soc"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + lan { + label = "we1026-5g:green:lan"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "we1026-5g:green:usb"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "we1026-5g:green:wifi"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&sdhci { + status = "okay"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c", "uartf", "spi refclk", "ephy", "wled"; + ralink,function = "gpio"; + }; + }; +}; + +&pcie { + status = "okay"; + pcie-bridge { + wifi@14c3,7662 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; + }; +}; diff --git a/target/linux/ramips/dts/WHR-300HP2.dts b/target/linux/ramips/dts/WHR-300HP2.dts index f74a0b84b..d405686d7 100644 --- a/target/linux/ramips/dts/WHR-300HP2.dts +++ b/target/linux/ramips/dts/WHR-300HP2.dts @@ -127,11 +127,6 @@ ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; @@ -147,4 +142,6 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts index 882086bcc..86ed19730 100644 --- a/target/linux/ramips/dts/WIZFI630A.dts +++ b/target/linux/ramips/dts/WIZFI630A.dts @@ -118,28 +118,9 @@ }; &uart { - compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; - reg = <0x500 0x100>; - resets = <&rstctrl 12>; - reset-names = "uart"; - interrupt-parent = <&intc>; - interrupts = <5>; - reg-shift = <2>; + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&uartf_pins>; - status = "okay"; -}; - -&uartlite { - compatible = "ralink,mt7620a-uart", "ralink,rt2880-uart", "ns16550a"; - reg = <0xc00 0x100>; - resets = <&rstctrl 19>; - reset-names = "uartl"; - interrupt-parent = <&intc>; - interrupts = <12>; - reg-shift = <2>; - pinctrl-names = "default"; - pinctrl-0 = <&uartlite_pins>; }; &pinctrl { @@ -149,20 +130,6 @@ ralink,function = "gpio"; }; }; - - uartf_gpio_pins: uartf_gpio { - uartf_gpio { - ralink,group = "uartf"; - ralink,function = "uartf"; - }; - }; - - uartlite_pins: uartlite { - uart { - ralink,group = "uartlite"; - ralink,function = "uartlite"; - }; - }; }; ðernet { diff --git a/target/linux/ramips/dts/WL-351.dts b/target/linux/ramips/dts/WL-351.dts index e620f10d8..0dd596cfe 100644 --- a/target/linux/ramips/dts/WL-351.dts +++ b/target/linux/ramips/dts/WL-351.dts @@ -92,15 +92,13 @@ ralink,group = "spi", "i2c", "jtag", "mdio", "uartf"; ralink,function = "gpio"; }; - rgmii { - ralink,group = "rgmii"; - ralink,function = "rgmii"; - }; }; }; ðernet { mtd-mac-address = <&factory 0x4>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; }; &esw { diff --git a/target/linux/ramips/dts/WT3020-8M.dts b/target/linux/ramips/dts/WT3020-8M.dts index 05ade7c5a..b2397d2cd 100644 --- a/target/linux/ramips/dts/WT3020-8M.dts +++ b/target/linux/ramips/dts/WT3020-8M.dts @@ -7,6 +7,14 @@ model = "Nexx WT3020 (8M)"; }; +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + &spi0 { status = "okay"; diff --git a/target/linux/ramips/dts/WT3020.dtsi b/target/linux/ramips/dts/WT3020.dtsi index 6bea6cc1f..91720e32c 100644 --- a/target/linux/ramips/dts/WT3020.dtsi +++ b/target/linux/ramips/dts/WT3020.dtsi @@ -37,15 +37,6 @@ status = "okay"; }; - -&ehci { - status = "okay"; -}; - -&ohci { - status = "okay"; -}; - ðernet { mtd-mac-address = <&factory 0x4>; mediatek,portmap = "wllll"; diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi index 022b67949..cc126f04a 100644 --- a/target/linux/ramips/dts/Y1.dtsi +++ b/target/linux/ramips/dts/Y1.dtsi @@ -94,6 +94,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pinctrl { @@ -102,10 +104,5 @@ ralink,group = "uartf", "wled", "nd_sd"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/YOUKU-YK1.dts b/target/linux/ramips/dts/YOUKU-YK1.dts index d4e3c905b..8a0e0819e 100644 --- a/target/linux/ramips/dts/YOUKU-YK1.dts +++ b/target/linux/ramips/dts/YOUKU-YK1.dts @@ -96,7 +96,7 @@ &pinctrl { state_default: pinctrl0 { default { - ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "ephy", "wled", "nd_sd"; + ralink,group = "i2c", "rgmii1", "ephy", "wled"; ralink,function = "gpio"; }; }; @@ -104,7 +104,6 @@ ðernet { pinctrl-names = "default"; - pinctrl-0 = <&ephy_pins>; mtd-mac-address = <&factory 0x4>; mediatek,portmap = "llllw"; }; diff --git a/target/linux/ramips/dts/ZBT-APE522II.dts b/target/linux/ramips/dts/ZBT-APE522II.dts index 45fef667c..05d053f22 100644 --- a/target/linux/ramips/dts/ZBT-APE522II.dts +++ b/target/linux/ramips/dts/ZBT-APE522II.dts @@ -115,6 +115,8 @@ &wmac { ralink,mtd-eeprom = <&factory 0>; + pinctrl-names = "default"; + pinctrl-0 = <&pa_pins>; }; &pcie { @@ -136,10 +138,5 @@ ralink,group = "wled", "i2c", "uartf", "wdt"; ralink,function = "gpio"; }; - - pa { - ralink,group = "pa"; - ralink,function = "pa"; - }; }; }; diff --git a/target/linux/ramips/dts/ZBT-WE3526.dts b/target/linux/ramips/dts/ZBT-WE3526.dts new file mode 100644 index 000000000..dc7896f13 --- /dev/null +++ b/target/linux/ramips/dts/ZBT-WE3526.dts @@ -0,0 +1,117 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zbtlink,zbt-we3526", "mediatek,mt7621-soc"; + model = "ZBT-WE3526"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + palmbus: palmbus@1E000000 { + i2c@900 { + status = "okay"; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + firmware: partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&pcie { + status = "okay"; + + pcie0 { + wifi@14c3,7662 { + compatible = "pci14c3,7662"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + }; + }; + }; + + pcie1 { + wifi@14c3,7603 { + compatible = "pci14c3,7603"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "wdt"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/ZBT-WG2626.dts b/target/linux/ramips/dts/ZBT-WG2626.dts index a55fd09e6..79f2859bb 100644 --- a/target/linux/ramips/dts/ZBT-WG2626.dts +++ b/target/linux/ramips/dts/ZBT-WG2626.dts @@ -116,7 +116,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/ZBT-WG3526.dtsi b/target/linux/ramips/dts/ZBT-WG3526.dtsi index ccd5ab1e0..104a51f8d 100644 --- a/target/linux/ramips/dts/ZBT-WG3526.dtsi +++ b/target/linux/ramips/dts/ZBT-WG3526.dtsi @@ -111,7 +111,7 @@ &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "wdt", "rgmii2", "wdt rst", "jtag", "mdio"; + ralink,group = "wdt", "rgmii2", "jtag", "mdio"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/ZBT-WR8305RT.dts b/target/linux/ramips/dts/ZBT-WR8305RT.dts index 11911b9f0..52cac80a7 100644 --- a/target/linux/ramips/dts/ZBT-WR8305RT.dts +++ b/target/linux/ramips/dts/ZBT-WR8305RT.dts @@ -94,6 +94,8 @@ }; ðernet { + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; mtd-mac-address = <&factory 0x4>; mediatek,portmap = "llllw"; }; @@ -104,11 +106,6 @@ &pinctrl { state_default: pinctrl0 { - ephy { - ralink,group = "ephy"; - ralink,function = "ephy"; - }; - default { ralink,group = "i2c", "uartf", "spi refclk", "wled"; ralink,function = "gpio"; diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index 96966b464..882cf8810 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -365,6 +365,13 @@ }; }; + mdio_refclk_pins: mdio_refclk { + mdio_refclk { + ralink,group = "mdio"; + ralink,function = "refclk"; + }; + }; + ephy_pins: ephy { ephy { ralink,group = "ephy"; @@ -399,6 +406,13 @@ ralink,function = "pcie rst"; }; }; + + pa_pins: pa { + pa { + ralink,group = "pa"; + ralink,function = "pa"; + }; + }; }; rstctrl: rstctrl { diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi index f1593acd9..5d3c1e3fa 100644 --- a/target/linux/ramips/dts/mt7620n.dtsi +++ b/target/linux/ramips/dts/mt7620n.dtsi @@ -228,6 +228,13 @@ state_default: pinctrl0 { }; + ephy_pins: ephy { + ephy { + ralink,group = "ephy"; + ralink,function = "ephy"; + }; + }; + spi_pins: spi { spi { ralink,group = "spi"; diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi index 766251899..d68ddf3bc 100644 --- a/target/linux/ramips/dts/mt7621.dtsi +++ b/target/linux/ramips/dts/mt7621.dtsi @@ -58,7 +58,7 @@ }; wdt: wdt@100 { - compatible = "mtk,mt7621-wdt"; + compatible = "mediatek,mt7621-wdt"; reg = <0x100 0x100>; }; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index b64a87a49..b572f2ae4 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -38,7 +38,7 @@ }; watchdog: watchdog@120 { - compatible = "ralink,mt7628an-wdt", "mtk,mt7621-wdt"; + compatible = "ralink,mt7628an-wdt", "mediatek,mt7621-wdt"; reg = <0x120 0x10>; resets = <&rstctrl 8>; @@ -298,6 +298,13 @@ }; }; + i2s_pins: i2s { + i2s { + ralink,group = "i2s"; + ralink,function = "i2s"; + }; + }; + uart0_pins: uartlite { uartlite { ralink,group = "uart0"; @@ -340,12 +347,19 @@ }; }; - pcm_i2s_pins: i2s { - i2s { + pcm_i2s_pins: pcm_i2s { + pcm_i2s { ralink,group = "i2s"; ralink,function = "pcm"; }; }; + + refclk_pins: refclk { + refclk { + ralink,group = "refclk"; + ralink,function = "refclk"; + }; + }; }; rstctrl: rstctrl { diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi index 23da1c43e..5c69d282a 100644 --- a/target/linux/ramips/dts/rt3050.dtsi +++ b/target/linux/ramips/dts/rt3050.dtsi @@ -260,6 +260,13 @@ }; }; + rgmii_pins: rgmii { + rgmii { + ralink,group = "rgmii"; + ralink,function = "rgmii"; + }; + }; + uartlite_pins: uartlite { uart { ralink,group = "uartlite"; diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi index a617281b7..5612458f1 100644 --- a/target/linux/ramips/dts/rt3352.dtsi +++ b/target/linux/ramips/dts/rt3352.dtsi @@ -262,6 +262,20 @@ }; }; + mdio_pins: mdio { + mdio { + ralink,group = "mdio"; + ralink,function = "mdio"; + }; + }; + + rgmii_pins: rgmii { + rgmii { + ralink,group = "rgmii"; + ralink,function = "rgmii"; + }; + }; + spi_pins: spi { spi { ralink,group = "spi"; diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c index 74b4a7103..439d8c266 100644 --- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c +++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mt7530.c @@ -220,6 +220,12 @@ struct mt7530_mapping { .members = { 0, 0x7e, 0x41 }, .etags = { 0, 0x40, 0x40 }, .vids = { 0, 1, 2 }, + }, { + .name = "lwlll", + .pvids = { 1, 2, 1, 1, 1, 1, 1 }, + .members = { 0, 0x7d, 0x42 }, + .etags = { 0, 0x40, 0x40 }, + .vids = { 0, 1, 2 }, }, }; @@ -922,7 +928,7 @@ mt7530_probe(struct device *dev, void __iomem *base, struct mii_bus *bus, int vl /* magic vodoo */ if (!IS_ENABLED(CONFIG_SOC_MT7621) && bus && mt7530_r32(mt7530, REG_HWTRAP) != 0x1117edf) { - dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); + dev_info(dev, "fixing up MHWTRAP register - bootloader probably played with it\n"); mt7530_w32(mt7530, REG_HWTRAP, 0x1117edf); } dev_info(dev, "loaded %s driver\n", swdev->name); diff --git a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c index 5f4afade0..a9d2f385a 100644 --- a/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c +++ b/target/linux/ramips/files-4.9/drivers/net/ethernet/mtk/mtk_eth_soc.c @@ -1003,7 +1003,7 @@ static int fe_poll(struct napi_struct *napi, int budget) goto poll_again; } - napi_complete(napi); + napi_complete_done(napi, rx_done); fe_int_enable(tx_intr | rx_intr); } else { rx_done = budget; @@ -1536,7 +1536,7 @@ static int fe_probe(struct platform_device *pdev) priv->rx_ring.rx_ring_size = NUM_DMA_DESC; INIT_WORK(&priv->pending_work, fe_pending_work); - napi_weight = 32; + napi_weight = 16; if (priv->flags & FE_FLAG_NAPI_WEIGHT) { napi_weight *= 4; priv->tx_ring.tx_ring_size *= 4; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index f201c9d40..7dd26fe27 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -2,7 +2,7 @@ # MT7620A Profiles # -DEVICE_VARS += TPLINK_BOARD_ID +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION define Build/elecom-header cp $@ $(KDIR)/v_0.0.0.bin @@ -10,7 +10,9 @@ define Build/elecom-header mkhash md5 $(KDIR)/v_0.0.0.bin && \ echo 458 \ ) | mkhash md5 > $(KDIR)/v_0.0.0.md5 - $(STAGING_DIR_HOST)/bin/tar -cf $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 + $(STAGING_DIR_HOST)/bin/tar -c \ + $(if $(SOURCE_DATE_EPOCH),--mtime=@$(SOURCE_DATE_EPOCH)) \ + -f $@ -C $(KDIR) v_0.0.0.bin v_0.0.0.md5 endef define Build/zyimage @@ -26,17 +28,35 @@ endef TARGET_DEVICES += ai-br100 define Device/Archer + TPLINK_HWREVADD := 0 + TPLINK_HVERSION := 3 KERNEL := $(KERNEL_DTB) - KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header - IMAGE/factory.bin := tplink-v2-image - IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGE/factory.bin := tplink-v2-image -e + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata endef +define Device/ArcherC20 + $(Device/Archer) + DTS := ArcherC20 + SUPPORTED_DEVICES := c20 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 0x44 + TPLINK_HWREVADD := 0x1 + IMAGES += factory.bin + DEVICE_TITLE := TP-Link ArcherC20 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += ArcherC20 + define Device/ArcherC20i $(Device/Archer) DTS := ArcherC20i SUPPORTED_DEVICES := c20i - TPLINK_BOARD_ID := ArcherC20i + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc2000001 + TPLINK_HWREV := 58 IMAGES += factory.bin DEVICE_TITLE := TP-Link ArcherC20i endef @@ -46,10 +66,12 @@ define Device/ArcherC50v1 $(Device/Archer) DTS := ArcherC50 SUPPORTED_DEVICES := c50 - TPLINK_BOARD_ID := ArcherC50 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0xc7500001 + TPLINK_HWREV := 69 IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := tplink-v2-image -w 0 - IMAGE/factory-eu.bin := tplink-v2-image -w 2 + IMAGE/factory-us.bin := tplink-v2-image -e -w 0 + IMAGE/factory-eu.bin := tplink-v2-image -e -w 2 DEVICE_TITLE := TP-Link ArcherC50v1 endef TARGET_DEVICES += ArcherC50v1 @@ -58,7 +80,9 @@ define Device/ArcherMR200 $(Device/Archer) DTS := ArcherMR200 SUPPORTED_DEVICES := mr200 - TPLINK_BOARD_ID := ArcherMR200 + TPLINK_FLASHLAYOUT := 8MLmtk + TPLINK_HWID := 0xd7500001 + TPLINK_HWREV := 0x4a DEVICE_PACKAGES := kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem DEVICE_TITLE := TP-Link ArcherMR200 endef @@ -81,7 +105,9 @@ TARGET_DEVICES += cf-wr800n define Device/cs-qr10 DTS := CS-QR10 DEVICE_TITLE := Planex CS-QR10 - DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-i2c-core kmod-i2c-ralink kmod-sound-core kmod-sound-mtk kmod-sdhci-mt7620 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci \ + kmod-sound-core kmod-sound-mt7620 \ + kmod-i2c-ralink kmod-sdhci-mt7620 endef TARGET_DEVICES += cs-qr10 @@ -115,7 +141,7 @@ define Device/dch-m225 seama-seal -m "signature=wapn22_dlink.2013gui_dap1320b" | \ check-size $$$$(IMAGE_SIZE) DEVICE_TITLE := D-Link DCH-M225 - DEVICE_PACKAGES := kmod-mt76 + DEVICE_PACKAGES := kmod-mt76 kmod-sound-core kmod-sound-mt7620 kmod-i2c-ralink endef TARGET_DEVICES += dch-m225 @@ -171,6 +197,13 @@ define Device/gl-mt300a endef TARGET_DEVICES += gl-mt300a +define Device/u25awf-h1 + DTS := U25AWF-H1 + IMAGE_SIZE := 16064k + DEVICE_TITLE := Kimax U25AWF-H1 +endef +TARGET_DEVICES += u25awf-h1 + define Device/gl-mt300n DTS := GL-MT300N IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -456,6 +489,7 @@ define Device/wt3020-8M IMAGE/factory.bin := $$(sysupgrade_bin) | check-size $$$$(IMAGE_SIZE) | \ poray-header -B WT3020 -F 8M DEVICE_TITLE := Nexx WT3020 (8MB) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef TARGET_DEVICES += wt3020-8M @@ -475,11 +509,21 @@ TARGET_DEVICES += y1s define Device/youku-yk1 DTS := YOUKU-YK1 - IMAGE_SIZE := $(ralink_default_fw_size_16M) + IMAGE_SIZE := $(ralink_default_fw_size_32M) DEVICE_TITLE := YOUKU YK1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 kmod-usb-ledtrig-usbport endef TARGET_DEVICES += youku-yk1 +define Device/we1026-5g-16m + DTS := WE1026-5G-16M + IMAGE_SIZE := 16777216 + SUPPORTED_DEVICES += we1026-5g-16m + DEVICE_TITLE := Zbtlink ZBT-WE1026-5G (16M) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-mt76 kmod-sdhci-mt7620 +endef +TARGET_DEVICES += we1026-5g-16m + define Device/zbt-ape522ii DTS := ZBT-APE522II DEVICE_TITLE := Zbtlink ZBT-APE522II diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 779616292..82d0eeae6 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -121,7 +121,7 @@ define Device/mir3g SUPPORTED_DEVICES += R3G DEVICE_PACKAGES := \ kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini \ - kmod-softdog + uboot-envtools endef TARGET_DEVICES += mir3g @@ -225,6 +225,14 @@ define Device/timecloud endef TARGET_DEVICES += timecloud +define Device/u7621-06-256M-16M + DTS := U7621-06-256M-16M + IMAGE_SIZE := 16064k + DEVICE_TITLE := UniElec U7621-06 (256M RAM/16M flash) + DEVICE_PACKAGES := kmod-ata-core kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 +endef +TARGET_DEVICES += u7621-06-256M-16M + define Device/ubnt-erx DTS := UBNT-ERX FILESYSTEMS := squashfs @@ -321,6 +329,17 @@ define Device/zbt-we1326 endef TARGET_DEVICES += zbt-we1326 +define Device/zbt-we3526 + DTS := ZBT-WE3526 + IMAGE_SIZE := $(ralink_default_fw_size_16M) + SUPPORTED_DEVICES += zbt-we3526 + DEVICE_TITLE := ZBT WE3526 + DEVICE_PACKAGES := \ + kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ + kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini +endef +TARGET_DEVICES += zbt-we3526 + define Device/zbt-wg2626 DTS := ZBT-WG2626 IMAGE_SIZE := $(ralink_default_fw_size_16M) diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index f4b3171a0..0e9b8fc7e 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -2,7 +2,7 @@ # MT76x8 Profiles # -DEVICE_VARS += TPLINK_BOARD_ID +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION define Device/duzun-dm06 DTS := DUZUN-DM06 @@ -85,12 +85,32 @@ define Device/tl-wr840n-v4 DTS := TL-WR840NV4 IMAGE_SIZE := 7808k DEVICE_TITLE := TP-Link TL-WR840N v4 - TPLINK_BOARD_ID := TL-WR840NV4 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x08400004 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x4 + TPLINK_HVERSION := 3 KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e IMAGES += tftp-recovery.bin - IMAGE/factory.bin := tplink-v2-image + IMAGE/factory.bin := tplink-v2-image -e IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) - IMAGE/sysupgrade.bin := tplink-v2-image -s | append-metadata | \ + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ + check-size $$$$(IMAGE_SIZE) +endef + +define Device/tl-wr840n-v5 + DTS := TL-WR840NV5 + IMAGE_SIZE := 3840k + DEVICE_TITLE := TP-Link TL-WR840N v5 + TPLINK_FLASHLAYOUT := 4Mmtk + TPLINK_HWID := 0x08400005 + TPLINK_HWREV := 0x1 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ check-size $$$$(IMAGE_SIZE) endef @@ -98,9 +118,19 @@ define Device/tl-wr841n-v13 $(Device/tl-wr840n-v4) DTS := TL-WR841NV13 DEVICE_TITLE := TP-Link TL-WR841N v13 - TPLINK_BOARD_ID := TL-WR841NV13 + TPLINK_HWID := 0x08410013 + TPLINK_HWREV := 0x268 + TPLINK_HWREVADD := 0x13 endef -TARGET_DEVICES += tl-wr840n-v4 tl-wr841n-v13 +TARGET_DEVICES += tl-wr840n-v4 tl-wr840n-v5 tl-wr841n-v13 + +define Device/u7628-01-128M-16M + DTS := U7628-01-128M-16M + IMAGE_SIZE := 16064k + DEVICE_TITLE := UniElec U7628-01 (128M RAM/16M flash) + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += u7628-01-128M-16M define Device/vocore2 DTS := VOCORE2 diff --git a/target/linux/ramips/mt7620/config-4.9 b/target/linux/ramips/mt7620/config-4.9 index 52c05185e..4f8c68629 100644 --- a/target/linux/ramips/mt7620/config-4.9 +++ b/target/linux/ramips/mt7620/config-4.9 @@ -126,7 +126,6 @@ CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER is not set CONFIG_MIPS_CMDLINE_FROM_DTB=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 # CONFIG_MIPS_MACHINE is not set @@ -138,9 +137,11 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD_CFI_INTELEXT is not set CONFIG_MTD_CMDLINE_PARTS=y CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND_MT7620=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_TPLINK_FW=y diff --git a/target/linux/ramips/mt7621/config-4.9 b/target/linux/ramips/mt7621/config-4.9 index ce8ba450c..f9765edaf 100644 --- a/target/linux/ramips/mt7621/config-4.9 +++ b/target/linux/ramips/mt7621/config-4.9 @@ -5,7 +5,6 @@ CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set CONFIG_ARCH_HAS_RESET_CONTROLLER=y # CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_HAS_TICK_BROADCAST=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y @@ -65,7 +64,6 @@ CONFIG_EARLY_PRINTK=y CONFIG_FIXED_PHY=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y @@ -151,7 +149,6 @@ CONFIG_MIPS_CPS=y # CONFIG_MIPS_CPS_NS16550 is not set CONFIG_MIPS_CPU_SCACHE=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y CONFIG_MIPS_GIC=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 @@ -255,8 +252,8 @@ CONFIG_SPI_MASTER=y CONFIG_SPI_MT7621=y # CONFIG_SPI_RT2880 is not set CONFIG_SRCU=y -CONFIG_SWCONFIG=y CONFIG_SWCONFIG_LEDS=y +CONFIG_SWCONFIG=y CONFIG_SWPHY=y CONFIG_SYNC_R4K=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -283,7 +280,6 @@ CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_WATCHDOG_CORE=y CONFIG_WEAK_ORDERING=y -CONFIG_WEAK_REORDERING_BEYOND_LLSC=y CONFIG_XPS=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch b/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch index c19c3cd35..4d7f59028 100644 --- a/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch +++ b/target/linux/ramips/patches-4.9/0034-NET-multi-phy-support.patch @@ -43,7 +43,7 @@ Signed-off-by: John Crispin } --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -373,6 +373,7 @@ struct phy_device { +@@ -369,6 +369,7 @@ struct phy_device { bool is_pseudo_fixed_link; bool has_fixups; bool suspended; diff --git a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch index f3fc9767a..f5b1d8234 100644 --- a/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch +++ b/target/linux/ramips/patches-4.9/0039-mtd-add-mt7621-nand-support.patch @@ -3379,7 +3379,7 @@ Signed-off-by: John Crispin + data |= ((0x2<<18) |(0x2<<16)); + DRV_WriteReg32(RALINK_SYSCTL_BASE+0x60, data); + -+ hw = &mt7621_nand_hw, ++ hw = &mt7621_nand_hw; + BUG_ON(!hw); + /* Allocate memory for the device structure (and zero it) */ + host = kzalloc(sizeof(struct mtk_nand_host), GFP_KERNEL); @@ -4302,7 +4302,7 @@ Signed-off-by: John Crispin +#endif /* __NAND_DEF_H__ */ --- /dev/null +++ b/drivers/mtd/nand/nand_device_list.h -@@ -0,0 +1,55 @@ +@@ -0,0 +1,56 @@ +/* Copyright Statement: + * + * This software/firmware and related documentation ("MediaTek Software") are @@ -4345,6 +4345,7 @@ Signed-off-by: John Crispin + {0x20BC, 0x105554, 5, 16, 512, 128, 2048, 64, 0x1123, "EHD013151MA_5", 0}, + {0xECBC, 0x005554, 5, 16, 512, 128, 2048, 64, 0x1123, "K524G2GACB_A0", 0}, + {0x2CBC, 0x905556, 5, 16, 512, 128, 2048, 64, 0x21044333, "MT29C4G96MAZA", 0}, ++ {0x2CDA, 0x909506, 5, 8, 256, 128, 2048, 64, 0x30C77fff, "MT29F2G08ABAE", 0}, + {0xADBC, 0x905554, 5, 16, 512, 128, 2048, 64, 0x10801011, "H9DA4GH4JJAMC", 0}, + {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0}, + {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0}, diff --git a/target/linux/ramips/patches-4.9/0040-nand-hack.patch b/target/linux/ramips/patches-4.9/0040-nand-hack.patch index 64a325300..fe2b12d2c 100644 --- a/target/linux/ramips/patches-4.9/0040-nand-hack.patch +++ b/target/linux/ramips/patches-4.9/0040-nand-hack.patch @@ -41,7 +41,7 @@ } --- a/drivers/mtd/nand/nand_device_list.h +++ b/drivers/mtd/nand/nand_device_list.h -@@ -43,6 +43,8 @@ static const flashdev_info gen_FlashTabl +@@ -44,6 +44,8 @@ static const flashdev_info gen_FlashTabl {0xADBC, 0x905554, 5, 16, 512, 128, 2048, 64, 0x10801011, "H9DA4GH4JJAMC", 0}, {0x01F1, 0x801D01, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "S34ML01G100TF", 0}, {0x92F1, 0x8095FF, 4, 8, 128, 128, 2048, 64, 0x30C77fff, "F59L1G81A", 0}, diff --git a/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch new file mode 100644 index 000000000..9d45ad010 --- /dev/null +++ b/target/linux/ramips/patches-4.9/0053-mtd-spi-nor-add-w25q256-3b-mode-switch.patch @@ -0,0 +1,214 @@ +mtd: spi-nor: add support for switching between 3-byte and 4-byte addressing on w25q256 flash + +On some devices the flash chip needs to be in 3-byte addressing mode during +reboot, otherwise the boot loader will fail to start. +This mode however does not allow regular reads/writes onto the upper 16M +half. W25Q256 has separate read commands for reading from >16M, however +it does not have any separate write commands. +This patch changes the code to leave the chip in 3-byte mode most of the +time and only switch during erase/write cycles that go to >16M +addresses. + +Signed-off-by: Felix Fietkau +--- +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -85,6 +85,10 @@ struct flash_info { + * Use dedicated 4byte address op codes + * to support memory size above 128Mib. + */ ++#define SPI_NOR_4B_READ_OP BIT(12) /* ++ * Like SPI_NOR_4B_OPCODES, but for read ++ * op code only. ++ */ + }; + + #define JEDEC_MFR(info) ((info)->id[0]) +@@ -250,6 +254,15 @@ static inline u8 spi_nor_convert_3to4_er + ARRAY_SIZE(spi_nor_3to4_erase)); + } + ++static void spi_nor_set_4byte_read(struct spi_nor *nor, ++ const struct flash_info *info) ++{ ++ nor->addr_width = 3; ++ nor->ext_addr = 0; ++ nor->read_opcode = spi_nor_convert_3to4_read(nor->read_opcode); ++ nor->flags |= SNOR_F_4B_EXT_ADDR; ++} ++ + static void spi_nor_set_4byte_opcodes(struct spi_nor *nor, + const struct flash_info *info) + { +@@ -467,6 +480,36 @@ static int spi_nor_erase_sector(struct s + return nor->write_reg(nor, nor->erase_opcode, buf, nor->addr_width); + } + ++static int spi_nor_check_ext_addr(struct spi_nor *nor, u32 addr) ++{ ++ bool ext_addr; ++ int ret; ++ u8 cmd; ++ ++ if (!(nor->flags & SNOR_F_4B_EXT_ADDR)) ++ return 0; ++ ++ ext_addr = !!(addr & 0xff000000); ++ if (nor->ext_addr == ext_addr) ++ return 0; ++ ++ cmd = ext_addr ? SPINOR_OP_EN4B : SPINOR_OP_EX4B; ++ write_enable(nor); ++ ret = nor->write_reg(nor, cmd, NULL, 0); ++ if (ret) ++ return ret; ++ ++ cmd = 0; ++ ret = nor->write_reg(nor, SPINOR_OP_WREAR, &cmd, 1); ++ if (ret) ++ return ret; ++ ++ nor->addr_width = 3 + ext_addr; ++ nor->ext_addr = ext_addr; ++ write_disable(nor); ++ return 0; ++} ++ + /* + * Erase an address range on the nor chip. The address range may extend + * one or more erase sectors. Return an error is there is a problem erasing. +@@ -492,6 +535,10 @@ static int spi_nor_erase(struct mtd_info + if (ret) + return ret; + ++ ret = spi_nor_check_ext_addr(nor, addr + len); ++ if (ret) ++ return ret; ++ + /* whole-chip erase? */ + if (len == mtd->size && !(nor->flags & SNOR_F_NO_OP_CHIP_ERASE)) { + unsigned long timeout; +@@ -542,6 +589,7 @@ static int spi_nor_erase(struct mtd_info + write_disable(nor); + + erase_err: ++ spi_nor_check_ext_addr(nor, 0); + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_ERASE); + + instr->state = ret ? MTD_ERASE_FAILED : MTD_ERASE_DONE; +@@ -834,7 +882,9 @@ static int spi_nor_lock(struct mtd_info + if (ret) + return ret; + ++ spi_nor_check_ext_addr(nor, ofs + len); + ret = nor->flash_lock(nor, ofs, len); ++ spi_nor_check_ext_addr(nor, 0); + + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_UNLOCK); + return ret; +@@ -849,7 +899,9 @@ static int spi_nor_unlock(struct mtd_inf + if (ret) + return ret; + ++ spi_nor_check_ext_addr(nor, ofs + len); + ret = nor->flash_unlock(nor, ofs, len); ++ spi_nor_check_ext_addr(nor, 0); + + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_LOCK); + return ret; +@@ -1151,7 +1203,7 @@ static const struct flash_info spi_nor_i + { "w25q80", INFO(0xef5014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q80bl", INFO(0xef4014, 0, 64 * 1024, 16, SECT_4K) }, + { "w25q128", INFO(0xef4018, 0, 64 * 1024, 256, SECT_4K) }, +- { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K) }, ++ { "w25q256", INFO(0xef4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_4B_READ_OP) }, + + /* Catalyst / On Semiconductor -- non-JEDEC */ + { "cat25c11", CAT25_INFO( 16, 8, 16, 1, SPI_NOR_NO_ERASE | SPI_NOR_NO_FR) }, +@@ -1205,6 +1257,9 @@ static int spi_nor_read(struct mtd_info + if (ret) + return ret; + ++ if (nor->flags & SNOR_F_4B_EXT_ADDR) ++ nor->addr_width = 4; ++ + while (len) { + loff_t addr = from; + +@@ -1229,6 +1284,18 @@ static int spi_nor_read(struct mtd_info + ret = 0; + + read_err: ++ if (nor->flags & SNOR_F_4B_EXT_ADDR) { ++ u8 val = 0; ++ ++ if ((from + len) & 0xff000000) { ++ write_enable(nor); ++ nor->write_reg(nor, SPINOR_OP_WREAR, &val, 1); ++ write_disable(nor); ++ } ++ ++ nor->addr_width = 3; ++ } ++ + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_READ); + return ret; + } +@@ -1330,6 +1397,10 @@ static int spi_nor_write(struct mtd_info + if (ret) + return ret; + ++ ret = spi_nor_check_ext_addr(nor, to + len); ++ if (ret < 0) ++ return ret; ++ + for (i = 0; i < len; ) { + ssize_t written; + loff_t addr = to + i; +@@ -1377,6 +1448,7 @@ static int spi_nor_write(struct mtd_info + } + + write_err: ++ spi_nor_check_ext_addr(nor, 0); + spi_nor_unlock_and_unprep(nor, SPI_NOR_OPS_WRITE); + return ret; + } +@@ -1717,8 +1789,10 @@ int spi_nor_scan(struct spi_nor *nor, co + else if (mtd->size > 0x1000000) { + /* enable 4-byte addressing if the device exceeds 16MiB */ + nor->addr_width = 4; +- if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || +- info->flags & SPI_NOR_4B_OPCODES) ++ if (info->flags & SPI_NOR_4B_READ_OP) ++ spi_nor_set_4byte_read(nor, info); ++ else if (JEDEC_MFR(info) == SNOR_MFR_SPANSION || ++ info->flags & SPI_NOR_4B_OPCODES) + spi_nor_set_4byte_opcodes(nor, info); + else + set_4byte(nor, info, 1); +--- a/include/linux/mtd/spi-nor.h ++++ b/include/linux/mtd/spi-nor.h +@@ -90,6 +90,7 @@ + /* Used for Macronix and Winbond flashes. */ + #define SPINOR_OP_EN4B 0xb7 /* Enter 4-byte mode */ + #define SPINOR_OP_EX4B 0xe9 /* Exit 4-byte mode */ ++#define SPINOR_OP_WREAR 0xc5 /* Write extended address register */ + + /* Used for Spansion flashes only. */ + #define SPINOR_OP_BRWR 0x17 /* Bank register write */ +@@ -141,6 +142,7 @@ enum spi_nor_option_flags { + SNOR_F_NO_OP_CHIP_ERASE = BIT(2), + SNOR_F_S3AN_ADDR_DEFAULT = BIT(3), + SNOR_F_READY_XSR_RDY = BIT(4), ++ SNOR_F_4B_EXT_ADDR = BIT(5), + }; + + /** +@@ -188,6 +190,7 @@ struct spi_nor { + enum read_mode flash_read; + bool sst_write_second; + u32 flags; ++ u8 ext_addr; + u8 cmd_buf[SPI_NOR_MAX_CMD_SIZE]; + + int (*prepare)(struct spi_nor *nor, enum spi_nor_ops ops); diff --git a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch index 40994fb8d..0a429d2bc 100644 --- a/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch +++ b/target/linux/ramips/patches-4.9/0054-mtd-add-chunked-read-io-to-m25p80.patch @@ -1,6 +1,6 @@ --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -1381,6 +1381,66 @@ write_err: +@@ -1453,6 +1453,67 @@ write_err: return ret; } @@ -8,6 +8,7 @@ + size_t *_retlen, const u_char *_buf) +{ + struct spi_nor *nor = mtd_to_spi_nor(mtd); ++ u32 addr_width = nor->addr_width + !!(nor->flags & SNOR_F_4B_EXT_ADDR); + int chunk_size; + int retlen = 0; + int ret; @@ -16,8 +17,8 @@ + if (!chunk_size) + chunk_size = _len; + -+ if (nor->addr_width > 3) -+ chunk_size -= nor->addr_width - 3; ++ if (addr_width > 3) ++ chunk_size -= addr_width - 3; + + while (retlen < _len) { + size_t len = min_t(int, chunk_size, _len - retlen); @@ -67,7 +68,7 @@ static int macronix_quad_enable(struct spi_nor *nor) { int ret, val; -@@ -1630,10 +1690,12 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1702,10 +1763,12 @@ int spi_nor_scan(struct spi_nor *nor, co } /* sst nor chips use AAI word program */ @@ -82,7 +83,7 @@ if (info->flags & USE_FSR) nor->flags |= SNOR_F_USE_FSR; -@@ -1663,11 +1725,20 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -1737,11 +1800,20 @@ int spi_nor_scan(struct spi_nor *nor, co mtd->writebufsize = nor->page_size; if (np) { @@ -105,15 +106,15 @@ nor->flash_read = SPI_NOR_FAST; --- a/include/linux/mtd/spi-nor.h +++ b/include/linux/mtd/spi-nor.h -@@ -141,6 +141,7 @@ enum spi_nor_option_flags { - SNOR_F_NO_OP_CHIP_ERASE = BIT(2), +@@ -143,6 +143,7 @@ enum spi_nor_option_flags { SNOR_F_S3AN_ADDR_DEFAULT = BIT(3), SNOR_F_READY_XSR_RDY = BIT(4), -+ SNOR_F_SST = BIT(5), + SNOR_F_4B_EXT_ADDR = BIT(5), ++ SNOR_F_SST = BIT(6), }; /** -@@ -180,6 +181,7 @@ struct spi_nor { +@@ -182,6 +183,7 @@ struct spi_nor { struct mutex lock; struct device *dev; u32 page_size; diff --git a/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch b/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch deleted file mode 100644 index d950c4757..000000000 --- a/target/linux/ramips/patches-4.9/0063-set-CM_GCR_BASE_CMDEFTGT_MEM-according-to-datasheet.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/arch/mips/include/asm/mips-cm.h -+++ b/arch/mips/include/asm/mips-cm.h -@@ -239,8 +239,7 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) - #define CM_GCR_BASE_GCRBASE_MSK (_ULCAST_(0x1ffff) << 15) - #define CM_GCR_BASE_CMDEFTGT_SHF 0 - #define CM_GCR_BASE_CMDEFTGT_MSK (_ULCAST_(0x3) << 0) --#define CM_GCR_BASE_CMDEFTGT_DISABLED 0 --#define CM_GCR_BASE_CMDEFTGT_MEM 1 -+#define CM_GCR_BASE_CMDEFTGT_MEM 0 - #define CM_GCR_BASE_CMDEFTGT_IOCU0 2 - #define CM_GCR_BASE_CMDEFTGT_IOCU1 3 - diff --git a/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch b/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch new file mode 100644 index 000000000..f2d1ab170 --- /dev/null +++ b/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch @@ -0,0 +1,33 @@ +From 8ef4b43cd3794d63052d85898e42424fd3b14d24 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Thu, 11 May 2017 08:11:14 +0200 +Subject: [PATCH 1/2] MIPS: ralink: Fix MT7628 pinmux + +According to the datasheet the REFCLK pin is shared with GPIO#37 and +the PERST pin is shared with GPIO#36. + +Fixes: 53263a1c6852 ("MIPS: ralink: add mt7628an support") +Signed-off-by: Mathias Kresin +Acked-by: John Crispin +Cc: Ralf Baechle +Cc: linux-mips@linux-mips.org +Cc: # 3.19+ +Patchwork: https://patchwork.linux-mips.org/patch/16046/ +Signed-off-by: James Hogan +--- + arch/mips/ralink/mt7620.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -141,8 +141,8 @@ static struct rt2880_pmx_func i2c_grp_mt + FUNC("i2c", 0, 4, 2), + }; + +-static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) }; +-static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) }; ++static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 37, 1) }; ++static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; + static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; + static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; + diff --git a/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function b/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function new file mode 100644 index 000000000..9c77840f2 --- /dev/null +++ b/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function @@ -0,0 +1,31 @@ +From 05a67cc258e75ac9758e6f13d26337b8be51162a Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Thu, 11 May 2017 08:11:15 +0200 +Subject: [PATCH 2/2] MIPS: ralink: Fix typo in mt7628 pinmux function + +There is a typo inside the pinmux setup code. The function is called +refclk and not reclk. + +Fixes: 53263a1c6852 ("MIPS: ralink: add mt7628an support") +Signed-off-by: Mathias Kresin +Acked-by: John Crispin +Cc: Ralf Baechle +Cc: linux-mips@linux-mips.org +Cc: # 3.19+ +Patchwork: https://patchwork.linux-mips.org/patch/16047/ +Signed-off-by: James Hogan +--- + arch/mips/ralink/mt7620.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/ralink/mt7620.c ++++ b/arch/mips/ralink/mt7620.c +@@ -141,7 +141,7 @@ static struct rt2880_pmx_func i2c_grp_mt + FUNC("i2c", 0, 4, 2), + }; + +-static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 37, 1) }; ++static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("refclk", 0, 37, 1) }; + static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; + static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; + static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; diff --git a/target/linux/ramips/rt305x/config-4.9 b/target/linux/ramips/rt305x/config-4.9 index d7b53038d..ae843f372 100644 --- a/target/linux/ramips/rt305x/config-4.9 +++ b/target/linux/ramips/rt305x/config-4.9 @@ -134,6 +134,7 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y diff --git a/target/linux/ramips/rt3883/config-4.9 b/target/linux/ramips/rt3883/config-4.9 index 3e6b73f80..3b116e560 100644 --- a/target/linux/ramips/rt3883/config-4.9 +++ b/target/linux/ramips/rt3883/config-4.9 @@ -134,6 +134,7 @@ CONFIG_MTD_M25P80=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_SPLIT_FIRMWARE=y CONFIG_MTD_SPLIT_SEAMA_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index 285e4d276..a5cdec552 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -2887,7 +2887,7 @@ + + /* Display RX ring */ + priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); - } ++ } +} + +static void stmmac_display_tx_rings(struct stmmac_priv *priv) @@ -2906,15 +2906,15 @@ + head_tx = (void *)tx_q->dma_etx; + else + head_tx = (void *)tx_q->dma_tx; ++ ++ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); + } ++} - /* Display Rx ring */ - priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); - /* Display Tx ring */ - priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); -+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); -+ } -+} -+ +static void stmmac_display_rings(struct stmmac_priv *priv) +{ + /* Display RX ring */ @@ -3131,7 +3131,7 @@ if (priv->hw->mode->set_16kib_bfsize) bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); -@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne +@@ -1018,257 +1228,516 @@ static int init_dma_desc_rings(struct ne priv->dma_buf_sz = bfsize; @@ -3163,7 +3163,10 @@ + p = &((rx_q->dma_erx + i)->basic); + else + p = rx_q->dma_rx + i; -+ + +- ret = stmmac_init_rx_buffers(priv, p, i, flags); +- if (ret) +- goto err_init_rx_buffers; + ret = stmmac_init_rx_buffers(priv, p, i, flags, + queue); + if (ret) @@ -3173,18 +3176,15 @@ + rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data, + (unsigned int)rx_q->rx_skbuff_dma[i]); + } - -- ret = stmmac_init_rx_buffers(priv, p, i, flags); -- if (ret) -- goto err_init_rx_buffers; ++ + rx_q->cur_rx = 0; + rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); ++ ++ stmmac_clear_rx_descriptors(priv, queue); - netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", - priv->rx_skbuff[i], priv->rx_skbuff[i]->data, - (unsigned int)priv->rx_skbuff_dma[i]); -+ stmmac_clear_rx_descriptors(priv, queue); -+ + /* Setup the chained descriptor addresses */ + if (priv->mode == STMMAC_CHAIN_MODE) { + if (priv->extend_desc) @@ -3277,8 +3277,13 @@ + priv->hw->mode->init(tx_q->dma_tx, + tx_q->dma_tx_phy, + DMA_TX_SIZE, 0); -+ } -+ + } + +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- priv->tx_skbuff_dma[i].len = 0; +- priv->tx_skbuff_dma[i].last_segment = false; +- priv->tx_skbuff[i] = NULL; + for (i = 0; i < DMA_TX_SIZE; i++) { + struct dma_desc *p; + if (priv->extend_desc) @@ -3300,13 +3305,8 @@ + tx_q->tx_skbuff_dma[i].len = 0; + tx_q->tx_skbuff_dma[i].last_segment = false; + tx_q->tx_skbuff[i] = NULL; - } - -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- priv->tx_skbuff_dma[i].len = 0; -- priv->tx_skbuff_dma[i].last_segment = false; -- priv->tx_skbuff[i] = NULL; ++ } ++ + tx_q->dirty_tx = 0; + tx_q->cur_tx = 0; + @@ -3387,17 +3387,10 @@ - priv->tx_skbuff_dma[i].buf, - priv->tx_skbuff_dma[i].len, - DMA_TO_DEVICE); -- } + for (i = 0; i < DMA_TX_SIZE; i++) + stmmac_free_tx_buffer(priv, queue, i); +} - -- if (priv->tx_skbuff[i]) { -- dev_kfree_skb_any(priv->tx_skbuff[i]); -- priv->tx_skbuff[i] = NULL; -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- } ++ +/** + * free_dma_rx_desc_resources - free RX dma desc resources + * @priv: private structure @@ -3426,11 +3419,10 @@ + + kfree(rx_q->rx_skbuff_dma); + kfree(rx_q->rx_skbuff); - } - } - - /** -- * alloc_dma_desc_resources - alloc TX/RX resources. ++ } ++} ++ ++/** + * free_dma_tx_desc_resources - free TX dma desc resources + * @priv: private structure + */ @@ -3463,90 +3455,36 @@ + +/** + * alloc_dma_rx_desc_resources - alloc RX resources. - * @priv: private structure - * Description: according to which descriptor can be used (extend or basic) - * this function allocates the resources for TX and RX paths. In case of - * reception, for example, it pre-allocated the RX socket buffer in order to - * allow zero-copy mechanism. - */ --static int alloc_dma_desc_resources(struct stmmac_priv *priv) ++ * @priv: private structure ++ * Description: according to which descriptor can be used (extend or basic) ++ * this function allocates the resources for TX and RX paths. In case of ++ * reception, for example, it pre-allocated the RX socket buffer in order to ++ * allow zero-copy mechanism. ++ */ +static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) - { ++{ + u32 rx_count = priv->plat->rx_queues_to_use; - int ret = -ENOMEM; ++ int ret = -ENOMEM; + u32 queue; - -- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), -- GFP_KERNEL); -- if (!priv->rx_skbuff_dma) -- return -ENOMEM; ++ + /* RX queues buffers and DMA */ + for (queue = 0; queue < rx_count; queue++) { + struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; - -- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->rx_skbuff) -- goto err_rx_skbuff; -- -- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, -- sizeof(*priv->tx_skbuff_dma), -- GFP_KERNEL); -- if (!priv->tx_skbuff_dma) -- goto err_tx_skbuff_dma; -- -- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->tx_skbuff) -- goto err_tx_skbuff; -- -- if (priv->extend_desc) { -- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_erx) -- goto err_dma; ++ + rx_q->queue_index = queue; + rx_q->priv_data = priv; - -- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_tx_phy, ++ + rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, + sizeof(dma_addr_t), - GFP_KERNEL); -- if (!priv->dma_etx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_erx, priv->dma_rx_phy); -- goto err_dma; -- } -- } else { -- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_rx) -- goto err_dma; ++ GFP_KERNEL); + if (!rx_q->rx_skbuff_dma) + return -ENOMEM; - -- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_tx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- priv->dma_rx, priv->dma_rx_phy); ++ + rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE, + sizeof(struct sk_buff *), + GFP_KERNEL); + if (!rx_q->rx_skbuff) - goto err_dma; ++ goto err_dma; + + if (priv->extend_desc) { + rx_q->dma_erx = dma_zalloc_coherent(priv->device, @@ -3567,19 +3505,12 @@ + GFP_KERNEL); + if (!rx_q->dma_rx) + goto err_dma; - } - } - - return 0; - - err_dma: -- kfree(priv->tx_skbuff); --err_tx_skbuff: -- kfree(priv->tx_skbuff_dma); --err_tx_skbuff_dma: -- kfree(priv->rx_skbuff); --err_rx_skbuff: -- kfree(priv->rx_skbuff_dma); ++ } ++ } ++ ++ return 0; ++ ++err_dma: + free_dma_rx_desc_resources(priv); + + return ret; @@ -3636,7 +3567,7 @@ + GFP_KERNEL); + if (!tx_q->dma_tx) + goto err_dma_buffers; -+ } + } + } + + return 0; @@ -3644,9 +3575,9 @@ +err_dma_buffers: + free_dma_tx_desc_resources(priv); + - return ret; - } - ++ return ret; ++} ++ +/** + * alloc_dma_desc_resources - alloc TX/RX resources. + * @priv: private structure @@ -3672,7 +3603,176 @@ + * free_dma_desc_resources - free dma desc resources + * @priv: private structure + */ - static void free_dma_desc_resources(struct stmmac_priv *priv) ++static void free_dma_desc_resources(struct stmmac_priv *priv) ++{ ++ /* Release the DMA RX socket buffers */ ++ free_dma_rx_desc_resources(priv); ++ ++ /* Release the DMA TX socket buffers */ ++ free_dma_tx_desc_resources(priv); ++} ++ ++/** ++ * stmmac_mac_enable_rx_queues - Enable MAC rx queues ++ * @priv: driver private structure ++ * Description: It is used for enabling the rx queues in the MAC ++ */ ++static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) ++{ ++ u32 rx_queues_count = priv->plat->rx_queues_to_use; ++ int queue; ++ u8 mode; + +- if (priv->tx_skbuff[i]) { +- dev_kfree_skb_any(priv->tx_skbuff[i]); +- priv->tx_skbuff[i] = NULL; +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- } ++ for (queue = 0; queue < rx_queues_count; queue++) { ++ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; ++ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); + } + } + + /** +- * alloc_dma_desc_resources - alloc TX/RX resources. +- * @priv: private structure +- * Description: according to which descriptor can be used (extend or basic) +- * this function allocates the resources for TX and RX paths. In case of +- * reception, for example, it pre-allocated the RX socket buffer in order to +- * allow zero-copy mechanism. ++ * stmmac_start_rx_dma - start RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This starts a RX DMA channel + */ +-static int alloc_dma_desc_resources(struct stmmac_priv *priv) ++static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) + { +- int ret = -ENOMEM; +- +- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), +- GFP_KERNEL); +- if (!priv->rx_skbuff_dma) +- return -ENOMEM; +- +- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->rx_skbuff) +- goto err_rx_skbuff; +- +- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, +- sizeof(*priv->tx_skbuff_dma), +- GFP_KERNEL); +- if (!priv->tx_skbuff_dma) +- goto err_tx_skbuff_dma; +- +- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->tx_skbuff) +- goto err_tx_skbuff; +- +- if (priv->extend_desc) { +- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_erx) +- goto err_dma; +- +- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_tx_phy, +- GFP_KERNEL); +- if (!priv->dma_etx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_extended_desc), +- priv->dma_erx, priv->dma_rx_phy); +- goto err_dma; +- } +- } else { +- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_rx) +- goto err_dma; ++ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); ++ priv->hw->dma->start_rx(priv->ioaddr, chan); ++} + +- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_tx_phy, +- GFP_KERNEL); +- if (!priv->dma_tx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- priv->dma_rx, priv->dma_rx_phy); +- goto err_dma; +- } +- } ++/** ++ * stmmac_start_tx_dma - start TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This starts a TX DMA channel ++ */ ++static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); ++ priv->hw->dma->start_tx(priv->ioaddr, chan); ++} + +- return 0; ++/** ++ * stmmac_stop_rx_dma - stop RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This stops a RX DMA channel ++ */ ++static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_rx(priv->ioaddr, chan); ++} + +-err_dma: +- kfree(priv->tx_skbuff); +-err_tx_skbuff: +- kfree(priv->tx_skbuff_dma); +-err_tx_skbuff_dma: +- kfree(priv->rx_skbuff); +-err_rx_skbuff: +- kfree(priv->rx_skbuff_dma); +- return ret; ++/** ++ * stmmac_stop_tx_dma - stop TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This stops a TX DMA channel ++ */ ++static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_tx(priv->ioaddr, chan); + } + +-static void free_dma_desc_resources(struct stmmac_priv *priv) ++/** ++ * stmmac_start_all_dma - start all RX and TX DMA channels ++ * @priv: driver private structure ++ * Description: ++ * This starts all the RX and TX DMA channels ++ */ ++static void stmmac_start_all_dma(struct stmmac_priv *priv) { - /* Release the DMA TX/RX socket buffers */ - dma_free_rx_skbufs(priv); @@ -3698,99 +3798,6 @@ - kfree(priv->rx_skbuff); - kfree(priv->tx_skbuff_dma); - kfree(priv->tx_skbuff); -+ /* Release the DMA RX socket buffers */ -+ free_dma_rx_desc_resources(priv); -+ -+ /* Release the DMA TX socket buffers */ -+ free_dma_tx_desc_resources(priv); - } - - /** -@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru - */ - static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) - { -- int rx_count = priv->dma_cap.number_rx_queues; -- int queue = 0; -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ int queue; -+ u8 mode; - -- /* If GMAC does not have multiple queues, then this is not necessary*/ -- if (rx_count == 1) -- return; -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; -+ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); -+ } -+} - -- /** -- * If the core is synthesized with multiple rx queues / multiple -- * dma channels, then rx queues will be disabled by default. -- * For now only rx queue 0 is enabled. -- */ -- priv->hw->mac->rx_queue_enable(priv->hw, queue); -+/** -+ * stmmac_start_rx_dma - start RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This starts a RX DMA channel -+ */ -+static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); -+ priv->hw->dma->start_rx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_start_tx_dma - start TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This starts a TX DMA channel -+ */ -+static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); -+ priv->hw->dma->start_tx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_stop_rx_dma - stop RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This stops a RX DMA channel -+ */ -+static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_rx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_stop_tx_dma - stop TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This stops a TX DMA channel -+ */ -+static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_tx(priv->ioaddr, chan); -+} -+ -+/** -+ * stmmac_start_all_dma - start all RX and TX DMA channels -+ * @priv: driver private structure -+ * Description: -+ * This starts all the RX and TX DMA channels -+ */ -+static void stmmac_start_all_dma(struct stmmac_priv *priv) -+{ + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; @@ -3800,23 +3807,38 @@ + + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_start_tx_dma(priv, chan); -+} -+ -+/** + } + + /** +- * stmmac_mac_enable_rx_queues - Enable MAC rx queues +- * @priv: driver private structure +- * Description: It is used for enabling the rx queues in the MAC + * stmmac_stop_all_dma - stop all RX and TX DMA channels + * @priv: driver private structure + * Description: + * This stops the RX and TX DMA channels -+ */ + */ +-static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) +static void stmmac_stop_all_dma(struct stmmac_priv *priv) -+{ + { +- int rx_count = priv->dma_cap.number_rx_queues; +- int queue = 0; + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; -+ + +- /* If GMAC does not have multiple queues, then this is not necessary*/ +- if (rx_count == 1) +- return; + for (chan = 0; chan < rx_channels_count; chan++) + stmmac_stop_rx_dma(priv, chan); -+ + +- /** +- * If the core is synthesized with multiple rx queues / multiple +- * dma channels, then rx queues will be disabled by default. +- * For now only rx queue 0 is enabled. +- */ +- priv->hw->mac->rx_queue_enable(priv->hw, queue); + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_stop_tx_dma(priv, chan); } diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile index 6967e403c..0b4603292 100644 --- a/target/linux/uml/Makefile +++ b/target/linux/uml/Makefile @@ -22,7 +22,7 @@ BOARDNAME:=User Mode Linux FEATURES:=squashfs ext4 audio source-only MAINTAINER:=Florian Fainelli -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch new file mode 100644 index 000000000..02149eea7 --- /dev/null +++ b/target/linux/uml/patches-4.9/000-um-Avoid-longjmp-setjmp-symbol-clashes-with-libpthre.patch @@ -0,0 +1,130 @@ +From f44f1e7da7c8e3f4575d5d61c4df978496903fcc Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 23 May 2017 17:32:31 -0700 +Subject: [PATCH] um: Avoid longjmp/setjmp symbol clashes with libpthread.a + +[ Upstream commit f44f1e7da7c8e3f4575d5d61c4df978496903fcc ] + +Building a statically linked UML kernel on a Centos 6.9 host resulted in +the following linking failure (GCC 4.4, glibc-2.12): + +/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): +In function `siglongjmp': +(.text+0x8490): multiple definition of `longjmp' +arch/x86/um/built-in.o:/local/users/fainelli/openwrt/trunk/build_dir/target-x86_64_musl/linux-uml/linux-4.4.69/arch/x86/um/setjmp_64.S:44: +first defined here +/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/libpthread.a(libpthread.o): +In function `sem_open': +(.text+0x77cd): warning: the use of `mktemp' is dangerous, better use +`mkstemp' +collect2: ld returned 1 exit status +make[4]: *** [vmlinux] Error 1 + +Adopt a solution similar to the one done for vmap where we define +longjmp/setjmp to be kernel_longjmp/setjmp. In the process, make sure we +do rename the functions in arch/x86/um/setjmp_*.S accordingly. + +Fixes: a7df4716d195 ("um: link with -lpthread") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/um/Makefile | 4 ++++ + arch/x86/um/setjmp_32.S | 16 ++++++++-------- + arch/x86/um/setjmp_64.S | 16 ++++++++-------- + 3 files changed, 20 insertions(+), 16 deletions(-) + +--- a/arch/um/Makefile ++++ b/arch/um/Makefile +@@ -59,10 +59,14 @@ KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_D + # Same things for in6addr_loopback and mktime - found in libc. For these two we + # only get link-time error, luckily. + # ++# -Dlongjmp=kernel_longjmp prevents anything from referencing the libpthread.a ++# embedded copy of longjmp, same thing for setjmp. ++# + # These apply to USER_CFLAGS to. + + KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \ + $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ ++ -Dlongjmp=kernel_longjmp -Dsetjmp=kernel_setjmp \ + -Din6addr_loopback=kernel_in6addr_loopback \ + -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr + +--- a/arch/x86/um/setjmp_32.S ++++ b/arch/x86/um/setjmp_32.S +@@ -16,9 +16,9 @@ + + .text + .align 4 +- .globl setjmp +- .type setjmp, @function +-setjmp: ++ .globl kernel_setjmp ++ .type kernel_setjmp, @function ++kernel_setjmp: + #ifdef _REGPARM + movl %eax,%edx + #else +@@ -35,13 +35,13 @@ setjmp: + movl %ecx,20(%edx) # Return address + ret + +- .size setjmp,.-setjmp ++ .size kernel_setjmp,.-kernel_setjmp + + .text + .align 4 +- .globl longjmp +- .type longjmp, @function +-longjmp: ++ .globl kernel_longjmp ++ .type kernel_longjmp, @function ++kernel_longjmp: + #ifdef _REGPARM + xchgl %eax,%edx + #else +@@ -55,4 +55,4 @@ longjmp: + movl 16(%edx),%edi + jmp *20(%edx) + +- .size longjmp,.-longjmp ++ .size kernel_longjmp,.-kernel_longjmp +--- a/arch/x86/um/setjmp_64.S ++++ b/arch/x86/um/setjmp_64.S +@@ -18,9 +18,9 @@ + + .text + .align 4 +- .globl setjmp +- .type setjmp, @function +-setjmp: ++ .globl kernel_setjmp ++ .type kernel_setjmp, @function ++kernel_setjmp: + pop %rsi # Return address, and adjust the stack + xorl %eax,%eax # Return value + movq %rbx,(%rdi) +@@ -34,13 +34,13 @@ setjmp: + movq %rsi,56(%rdi) # Return address + ret + +- .size setjmp,.-setjmp ++ .size kernel_setjmp,.-kernel_setjmp + + .text + .align 4 +- .globl longjmp +- .type longjmp, @function +-longjmp: ++ .globl kernel_longjmp ++ .type kernel_longjmp, @function ++kernel_longjmp: + movl %esi,%eax # Return value (int) + movq (%rdi),%rbx + movq 8(%rdi),%rsp +@@ -51,4 +51,4 @@ longjmp: + movq 48(%rdi),%r15 + jmp *56(%rdi) + +- .size longjmp,.-longjmp ++ .size kernel_longjmp,.-kernel_longjmp diff --git a/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch new file mode 100644 index 000000000..501cca82f --- /dev/null +++ b/target/linux/uml/patches-4.9/001-um-Allow-building-and-running-on-older-hosts.patch @@ -0,0 +1,99 @@ +From 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 25 May 2017 11:36:26 -0700 +Subject: [PATCH] um: Allow building and running on older hosts + +[ Upstream commit 0a987645672ebde7844a9c0732a5a25f3d4bb6c6 ] + +Commit a78ff1112263 ("um: add extended processor state save/restore +support") and b6024b21fec8 ("um: extend fpstate to _xstate to support +YMM registers") forced the use of the x86 FP _xstate and +PTRACE_GETREGSET/SETREGSET. On older hosts, we would neither be able to +build UML nor run it anymore with these two commits applied because we +don't have definitions for struct _xstate nor these two ptrace requests. + +We can determine at build time which fp context structure to check +against, just like we can keep using the old i387 fp save/restore if +PTRACE_GETRESET/SETREGSET are not defined. + +Fixes: a78ff1112263 ("um: add extended processor state save/restore support") +Fixes: b6024b21fec8 ("um: extend fpstate to _xstate to support YMM registers") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/os-Linux/registers.c | 12 ++++++++---- + arch/x86/um/user-offsets.c | 4 ++++ + 2 files changed, 12 insertions(+), 4 deletions(-) + +--- a/arch/x86/um/os-Linux/registers.c ++++ b/arch/x86/um/os-Linux/registers.c +@@ -26,6 +26,7 @@ int save_i387_registers(int pid, unsigne + + int save_fp_registers(int pid, unsigned long *fp_regs) + { ++#ifdef PTRACE_GETREGSET + struct iovec iov; + + if (have_xstate_support) { +@@ -34,9 +35,9 @@ int save_fp_registers(int pid, unsigned + if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) < 0) + return -errno; + return 0; +- } else { ++ } else ++#endif + return save_i387_registers(pid, fp_regs); +- } + } + + int restore_i387_registers(int pid, unsigned long *fp_regs) +@@ -48,6 +49,7 @@ int restore_i387_registers(int pid, unsi + + int restore_fp_registers(int pid, unsigned long *fp_regs) + { ++#ifdef PTRACE_SETREGSET + struct iovec iov; + + if (have_xstate_support) { +@@ -56,9 +58,9 @@ int restore_fp_registers(int pid, unsign + if (ptrace(PTRACE_SETREGSET, pid, NT_X86_XSTATE, &iov) < 0) + return -errno; + return 0; +- } else { ++ } else ++#endif + return restore_i387_registers(pid, fp_regs); +- } + } + + #ifdef __i386__ +@@ -122,6 +124,7 @@ int put_fp_registers(int pid, unsigned l + + void arch_init_registers(int pid) + { ++#ifdef PTRACE_GETREGSET + struct _xstate fp_regs; + struct iovec iov; + +@@ -129,6 +132,7 @@ void arch_init_registers(int pid) + iov.iov_len = sizeof(struct _xstate); + if (ptrace(PTRACE_GETREGSET, pid, NT_X86_XSTATE, &iov) == 0) + have_xstate_support = 1; ++#endif + } + #endif + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -50,7 +50,11 @@ void foo(void) + DEFINE(HOST_GS, GS); + DEFINE(HOST_ORIG_AX, ORIG_EAX); + #else ++#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) + DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); ++#else ++ DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); ++#endif + DEFINE_LONGS(HOST_BX, RBX); + DEFINE_LONGS(HOST_CX, RCX); + DEFINE_LONGS(HOST_DI, RDI); diff --git a/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch new file mode 100644 index 000000000..79beb823c --- /dev/null +++ b/target/linux/uml/patches-4.9/002-um-Correctly-check-for-PTRACE_GETRESET-SETREGSET.patch @@ -0,0 +1,29 @@ +From 61e8d462457f202bf0c6393133425ad387825e22 Mon Sep 17 00:00:00 2001 +From: Richard Weinberger +Date: Thu, 6 Jul 2017 09:35:27 +0200 +Subject: [PATCH] um: Correctly check for PTRACE_GETRESET/SETREGSET + +[ Upstream commit 61e8d462457f202bf0c6393133425ad387825e22 ] + +When checking for PTRACE_GETRESET/SETREGSET, make sure that +the correct header file is included. We need linux/ptrace.h +which contains all ptrace UAPI related defines. +Otherwise #if defined(PTRACE_GETRESET) is always false. + +Cc: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/user-offsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -5,7 +5,7 @@ + #include + #include + #define __FRAME_OFFSETS +-#include ++#include + #include + + #ifdef __i386__ diff --git a/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch new file mode 100644 index 000000000..b31ca4191 --- /dev/null +++ b/target/linux/uml/patches-4.9/003-um-Fix-check-for-_xstate-for-older-hosts.patch @@ -0,0 +1,46 @@ +From 2fb44600fe784449404c6639de26af8361999ec7 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Tue, 18 Jul 2017 16:43:47 -0700 +Subject: [PATCH] um: Fix check for _xstate for older hosts + +Commit 0a987645672e ("um: Allow building and running on older +hosts") attempted to check for PTRACE_{GET,SET}REGSET under the premise +that these ptrace(2) parameters were directly linked with the presence +of the _xstate structure. + +After Richard's commit 61e8d462457f ("um: Correctly check for +PTRACE_GETRESET/SETREGSET") which properly included linux/ptrace.h +instead of asm/ptrace.h, we could get into the original build failure +that I reported: + +arch/x86/um/user-offsets.c: In function 'foo': +arch/x86/um/user-offsets.c:54: error: invalid application of 'sizeof' to +incomplete type 'struct _xstate' + +On this particular host, we do have PTRACE_GETREGSET and +PTRACE_SETREGSET defined in linux/ptrace.h, but not the structure +_xstate that should be pulled from the following include chain: signal.h +-> bits/sigcontext.h. + +Correctly fix this by checking for FP_XSTATE_MAGIC1 which is the correct +way to see if struct _xstate is available or not on the host. + +Fixes: 61e8d462457f ("um: Correctly check for PTRACE_GETRESET/SETREGSET") +Fixes: 0a987645672e ("um: Allow building and running on older hosts") +Signed-off-by: Florian Fainelli +Signed-off-by: Richard Weinberger +--- + arch/x86/um/user-offsets.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/um/user-offsets.c ++++ b/arch/x86/um/user-offsets.c +@@ -50,7 +50,7 @@ void foo(void) + DEFINE(HOST_GS, GS); + DEFINE(HOST_ORIG_AX, ORIG_EAX); + #else +-#if defined(PTRACE_GETREGSET) && defined(PTRACE_SETREGSET) ++#ifdef FP_XSTATE_MAGIC1 + DEFINE(HOST_FP_SIZE, sizeof(struct _xstate) / sizeof(unsigned long)); + #else + DEFINE(HOST_FP_SIZE, sizeof(struct _fpstate) / sizeof(unsigned long)); diff --git a/target/linux/uml/patches-4.9/101-mconsole-exec.patch b/target/linux/uml/patches-4.9/101-mconsole-exec.patch new file mode 100644 index 000000000..6682338f3 --- /dev/null +++ b/target/linux/uml/patches-4.9/101-mconsole-exec.patch @@ -0,0 +1,211 @@ +# +# Minimalist mconsole exec patch +# +# 3.10 version (with bit more synchronous behavior) by fingon at iki dot fi +# Adaptation to kernel 3.3.8 made by David Fernández (david at dit.upm.es) for +# Starting point: mconsole-exec-2.6.30.patch for kernel 2.6.30 +# Author of original patch: Paolo Giarrusso, aka Blaisorblade +# (http://www.user-mode-linux.org/~blaisorblade) +# +# Known misfeatures: +# +# - If output is too long, blocks (and breaks horribly) +# (this misfeature from 3.10 patches, when minimalizing the patch; +# workaround: redirect to a shared filesystem if long output is expected) +# +# - Nothing useful is done with stdin +# +--- a/arch/um/drivers/mconsole.h ++++ b/arch/um/drivers/mconsole.h +@@ -85,6 +85,7 @@ extern void mconsole_cad(struct mc_reque + extern void mconsole_stop(struct mc_request *req); + extern void mconsole_go(struct mc_request *req); + extern void mconsole_log(struct mc_request *req); ++extern void mconsole_exec(struct mc_request *req); + extern void mconsole_proc(struct mc_request *req); + extern void mconsole_stack(struct mc_request *req); + +--- a/arch/um/drivers/mconsole_kern.c ++++ b/arch/um/drivers/mconsole_kern.c +@@ -4,6 +4,7 @@ + * Licensed under the GPL + */ + ++#include "linux/kmod.h" + #include + #include + #include +@@ -24,6 +25,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -121,6 +123,59 @@ void mconsole_log(struct mc_request *req + mconsole_reply(req, "", 0, 0); + } + ++void mconsole_exec(struct mc_request *req) ++{ ++ struct subprocess_info *sub_info; ++ int res, len; ++ struct file *out; ++ char buf[MCONSOLE_MAX_DATA]; ++ ++ char *envp[] = { ++ "HOME=/", "TERM=linux", ++ "PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", ++ NULL ++ }; ++ char *argv[] = { ++ "/bin/sh", "-c", ++ req->request.data + strlen("exec "), ++ NULL ++ }; ++ ++ sub_info = call_usermodehelper_setup("/bin/sh", argv, envp, GFP_ATOMIC, NULL, NULL, NULL); ++ if (sub_info == NULL) { ++ mconsole_reply(req, "call_usermodehelper_setup failed", 1, 0); ++ return; ++ } ++ res = call_usermodehelper_stdoutpipe(sub_info, &out); ++ if (res < 0) { ++ kfree(sub_info); ++ mconsole_reply(req, "call_usermodehelper_stdoutpipe failed", 1, 0); ++ return; ++ } ++ ++ res = call_usermodehelper_exec(sub_info, UMH_WAIT_PROC); ++ if (res < 0) { ++ kfree(sub_info); ++ mconsole_reply(req, "call_usermodehelper_exec failed", 1, 0); ++ return; ++ } ++ ++ for (;;) { ++ len = out->f_op->read(out, buf, sizeof(buf), &out->f_pos); ++ if (len < 0) { ++ mconsole_reply(req, "reading output failed", 1, 0); ++ break; ++ } ++ if (len == 0) ++ break; ++ mconsole_reply_len(req, buf, len, 0, 1); ++ } ++ fput(out); ++ ++ mconsole_reply_len(req, NULL, 0, 0, 0); ++} ++ ++ + void mconsole_proc(struct mc_request *req) + { + struct vfsmount *mnt = task_active_pid_ns(current)->proc_mnt; +@@ -187,6 +242,7 @@ void mconsole_proc(struct mc_request *re + stop - pause the UML; it will do nothing until it receives a 'go' \n\ + go - continue the UML after a 'stop' \n\ + log - make UML enter into the kernel log\n\ ++ exec - pass to /bin/sh -c synchronously\n\ + proc - returns the contents of the UML's /proc/\n\ + stack - returns the stack of the specified pid\n\ + " +--- a/arch/um/drivers/mconsole_user.c ++++ b/arch/um/drivers/mconsole_user.c +@@ -30,6 +30,7 @@ static struct mconsole_command commands[ + { "stop", mconsole_stop, MCONSOLE_PROC }, + { "go", mconsole_go, MCONSOLE_INTR }, + { "log", mconsole_log, MCONSOLE_INTR }, ++ { "exec", mconsole_exec, MCONSOLE_PROC }, + { "proc", mconsole_proc, MCONSOLE_PROC }, + { "stack", mconsole_stack, MCONSOLE_INTR }, + }; +--- a/arch/um/os-Linux/file.c ++++ b/arch/um/os-Linux/file.c +@@ -554,6 +554,8 @@ int os_create_unix_socket(const char *fi + + addr.sun_family = AF_UNIX; + ++ if (len > sizeof(addr.sun_path)) ++ len = sizeof(addr.sun_path); + snprintf(addr.sun_path, len, "%s", file); + + err = bind(sock, (struct sockaddr *) &addr, sizeof(addr)); +--- a/include/linux/kmod.h ++++ b/include/linux/kmod.h +@@ -62,6 +62,7 @@ struct subprocess_info { + int wait; + int retval; + int (*init)(struct subprocess_info *info, struct cred *new); ++ struct file *stdout; + void (*cleanup)(struct subprocess_info *info); + void *data; + }; +@@ -102,4 +103,6 @@ extern int usermodehelper_read_trylock(v + extern long usermodehelper_read_lock_wait(long timeout); + extern void usermodehelper_read_unlock(void); + ++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, struct file **filp); ++ + #endif /* __LINUX_KMOD_H__ */ +--- a/kernel/kmod.c ++++ b/kernel/kmod.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -222,6 +223,28 @@ static int call_usermodehelper_exec_asyn + flush_signal_handlers(current, 1); + spin_unlock_irq(¤t->sighand->siglock); + ++ /* Install output when needed */ ++ if (sub_info->stdout) { ++ struct files_struct *f = current->files; ++ struct fdtable *fdt; ++ ++ sys_close(1); ++ sys_close(2); ++ get_file(sub_info->stdout); ++ fd_install(1, sub_info->stdout); ++ fd_install(2, sub_info->stdout); ++ spin_lock(&f->file_lock); ++ fdt = files_fdtable(f); ++ __set_bit(1, fdt->open_fds); ++ __clear_bit(1, fdt->close_on_exec); ++ __set_bit(2, fdt->open_fds); ++ __clear_bit(2, fdt->close_on_exec); ++ spin_unlock(&f->file_lock); ++ ++ /* disallow core files */ ++ current->signal->rlim[RLIMIT_CORE] = (struct rlimit){0, 0}; ++ } ++ + /* + * Our parent (unbound workqueue) runs with elevated scheduling + * priority. Avoid propagating that into the userspace child. +@@ -540,6 +563,20 @@ struct subprocess_info *call_usermodehel + } + EXPORT_SYMBOL(call_usermodehelper_setup); + ++int call_usermodehelper_stdoutpipe(struct subprocess_info *sub_info, ++ struct file **filp) ++{ ++ struct file *f[2]; ++ ++ if (create_pipe_files(f, 0)<0) ++ return PTR_ERR(f); ++ sub_info->stdout = f[1]; ++ *filp = f[0]; ++ return 0; ++} ++EXPORT_SYMBOL(call_usermodehelper_stdoutpipe); ++ ++ + /** + * call_usermodehelper_exec - start a usermode application + * @sub_info: information about the subprocessa diff --git a/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch new file mode 100644 index 000000000..a31d75ff3 --- /dev/null +++ b/target/linux/uml/patches-4.9/102-pseudo-random-mac.patch @@ -0,0 +1,131 @@ +=============================================================================== + +This patch makes MAC addresses of network interfaces predictable. In +particular, it adds a small routine that computes MAC addresses of based on +a SHA1 hash of the virtual machine name and interface ID. + +TECHNICAL INFORMATION: + +Applies to vanilla kernel 3.9.4. + +=============================================================================== +--- a/arch/um/Kconfig.net ++++ b/arch/um/Kconfig.net +@@ -21,6 +21,19 @@ config UML_NET + enable at least one of the following transport options to actually + make use of UML networking. + ++config UML_NET_RANDOM_MAC ++ bool "Use random MAC addresses for network interfaces" ++ default n ++ depends on UML_NET ++ help ++ Virtual network devices inside a User-Mode Linux instance must be ++ assigned a MAC (Ethernet) address. If none is specified on the UML ++ command line, one must be automatically computed. If this option is ++ enabled, a randomly generated address is used. Otherwise, if this ++ option is disabled, the address is generated from a SHA1 hash of ++ the umid of the UML instance and the interface name. The latter choice ++ is useful to make MAC addresses predictable. ++ + config UML_NET_ETHERTAP + bool "Ethertap transport" + depends on UML_NET +--- a/arch/um/drivers/net_kern.c ++++ b/arch/um/drivers/net_kern.c +@@ -25,6 +25,14 @@ + #include + #include + ++#include ++#include ++#include ++#include ++#include ++#include ++#include "os.h" ++ + #define DRIVER_NAME "uml-netdev" + + static DEFINE_SPINLOCK(opened_lock); +@@ -295,11 +303,53 @@ static void uml_net_user_timer_expire(un + #endif + } + ++#ifndef CONFIG_UML_NET_RANDOM_MAC ++ ++/* Compute a SHA1 hash of the UML instance's id and ++ * * an interface name. */ ++static int compute_hash(const char *umid, const char *ifname, char *hash) ++{ ++ struct ahash_request *desc; ++ struct crypto_ahash *tfm; ++ struct scatterlist sg; ++ char vmif[1024]; ++ int ret; ++ ++ strcpy (vmif, umid); ++ strcat (vmif, ifname); ++ ++ tfm = crypto_alloc_ahash("sha1", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(tfm)) ++ return -ENOMEM; ++ ++ desc = ahash_request_alloc(tfm, GFP_KERNEL); ++ if (!desc) { ++ ret = -ENOMEM; ++ goto out; ++ } ++ ++ crypto_ahash_clear_flags(tfm, ~0); ++ ++ sg_init_table(&sg, 1); ++ sg_set_buf(&sg, vmif, strlen(vmif)); ++ ++ ahash_request_set_crypt(desc, &sg, hash, strlen(vmif)); ++ ++ ret = crypto_ahash_digest(desc); ++out: ++ crypto_free_ahash(tfm); ++ ++ return ret; ++} ++ ++#endif ++ + static void setup_etheraddr(struct net_device *dev, char *str) + { + unsigned char *addr = dev->dev_addr; + char *end; + int i; ++ u8 hash[SHA1_DIGEST_SIZE]; + + if (str == NULL) + goto random; +@@ -340,9 +390,26 @@ static void setup_etheraddr(struct net_d + return; + + random: ++#ifdef CONFIG_UML_NET_RANDOM_MAC + printk(KERN_INFO + "Choosing a random ethernet address for device %s\n", dev->name); + eth_hw_addr_random(dev); ++#else ++ printk(KERN_INFO ++ "Computing a digest to use as ethernet address for device %s\n", dev->name); ++ if (compute_hash(get_umid(), dev->name, hash) < 0) { ++ printk(KERN_WARNING ++ "Could not compute digest to use as ethernet address for device %s. " ++ "Using random address instead.\n", dev->name); ++ random_ether_addr(addr); ++ } ++ else { ++ for (i=0; i < 6; i++) ++ addr[i] = (hash[i] + hash[i+6]) % 0x100; ++ } ++ addr [0] &= 0xfe; /* clear multicast bit */ ++ addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ ++#endif + } + + static DEFINE_SPINLOCK(devices_lock); diff --git a/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch index c49ddca7d..c3a7fce9c 100644 --- a/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch +++ b/target/linux/x86/patches-4.9/100-fix_cs5535_clockevt.patch @@ -1,6 +1,6 @@ --- a/drivers/clocksource/cs5535-clockevt.c +++ b/drivers/clocksource/cs5535-clockevt.c -@@ -129,7 +129,8 @@ static irqreturn_t mfgpt_tick(int irq, v +@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); From e037260d78abf47e0840c2e90a52e47e1604d567 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:14:14 +0800 Subject: [PATCH 13/95] enable hyper-v support in x86 32bit kernel --- target/linux/x86/generic/config-default | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index fa430cfc0..f6cd62fc6 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -53,6 +53,7 @@ CONFIG_BLK_DEV_SR=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_CLKDEV_LOOKUP=y CONFIG_COMMON_CLK=y +CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_RMAP=y @@ -113,6 +114,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y +CONFIG_FB_HYPERV=y # CONFIG_FB_I810 is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y @@ -155,7 +157,17 @@ CONFIG_HAVE_KVM_MSI=y CONFIG_HDMI=y CONFIG_HIBERNATE_CALLBACKS=y CONFIG_HID_BATTERY_STRENGTH=y +CONFIG_HID_GENERIC=y +CONFIG_HID_HYPERV_MOUSE=y CONFIG_HOTPLUG_CPU=y +CONFIG_HOTPLUG_PCI=y +CONFIG_HOTPLUG_PCI_ACPI=y +# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set +# CONFIG_HOTPLUG_PCI_COMPAQ is not set +# CONFIG_HOTPLUG_PCI_CPCI is not set +# CONFIG_HOTPLUG_PCI_IBM is not set +CONFIG_HOTPLUG_PCI_PCIE=y +# CONFIG_HOTPLUG_PCI_SHPC is not set CONFIG_HPET=y CONFIG_HPET_MMAP=y # CONFIG_HP_ACCEL is not set @@ -165,7 +177,13 @@ CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y CONFIG_HW_RANDOM_VIRTIO=y +CONFIG_HYPERV=y CONFIG_HYPERVISOR_GUEST=y +CONFIG_HYPERV_BALLOON=y +CONFIG_HYPERV_KEYBOARD=y +CONFIG_HYPERV_NET=y +CONFIG_HYPERV_STORAGE=y +CONFIG_HYPERV_UTILS=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y CONFIG_I2C_BOARDINFO=y @@ -275,6 +293,7 @@ CONFIG_PNPACPI=y # CONFIG_PNPBIOS is not set CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_PREEMPT_NOTIFIERS=y +CONFIG_PROC_EVENTS=y # CONFIG_PVPANIC is not set CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y From 3db72b5dfcf8ffd9cede5c92e67b2deb6a33e055 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:16:00 +0800 Subject: [PATCH 14/95] add VT-d Hyper-V PCI pass through kernel support --- target/linux/x86/64/config-default | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 1a3f9150c..92b27d36a 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -249,7 +249,7 @@ CONFIG_PATA_VIA=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_PME=y -# CONFIG_PCI_HYPERV is not set +CONFIG_PCI_HYPERV=y # CONFIG_PCI_MMCONFIG is not set CONFIG_PCI_XEN=y CONFIG_PGTABLE_LEVELS=4 From a173b5925d153002ac9ba56ef4dae8263ea996b9 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:17:32 +0800 Subject: [PATCH 15/95] kernel: add NFS4 client support --- package/kernel/linux/modules/crypto.mk | 11 ++++ package/kernel/linux/modules/fs.mk | 74 ++++++++++++++++++++------ 2 files changed, 68 insertions(+), 17 deletions(-) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index efcdeafa9..fc2739811 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -363,6 +363,17 @@ endef $(eval $(call KernelPackage,crypto-ecb)) +define KernelPackage/crypto-cts + TITLE:=Cipher Text Stealing CryptoAPI module + DEPENDS:=+kmod-crypto-manager + KCONFIG:=CONFIG_CRYPTO_CTS + FILES:=$(LINUX_DIR)/crypto/cts.ko + AUTOLOAD:=$(call AutoLoad,09,cts) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-cts)) + define KernelPackage/crypto-hmac TITLE:=HMAC digest CryptoAPI module diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 610d1b58a..3db633a8b 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -317,24 +317,54 @@ $(eval $(call KernelPackage,fs-msdos)) define KernelPackage/fs-nfs SUBMENU:=$(FS_MENU) - TITLE:=NFS filesystem support + TITLE:=NFS filesystem client support DEPENDS:=+kmod-fs-nfs-common +kmod-dnsresolver KCONFIG:= \ CONFIG_NFS_FS \ CONFIG_NFS_USE_LEGACY_DNS=n \ CONFIG_NFS_USE_NEW_IDMAPPER=n FILES:= \ - $(LINUX_DIR)/fs/nfs/nfs.ko \ - $(LINUX_DIR)/fs/nfs/nfsv3.ko - AUTOLOAD:=$(call AutoLoad,40,nfs nfsv3) + $(LINUX_DIR)/fs/nfs/nfs.ko + AUTOLOAD:=$(call AutoLoad,40,nfs) endef define KernelPackage/fs-nfs/description - Kernel module for NFS support + Kernel module for NFS client support endef $(eval $(call KernelPackage,fs-nfs)) +define KernelPackage/fs-nfs-v3 + SUBMENU:=$(FS_MENU) + TITLE:=NFS3 filesystem client support + DEPENDS:=+kmod-fs-nfs + FILES:= \ + $(LINUX_DIR)/fs/nfs/nfsv3.ko + AUTOLOAD:=$(call AutoLoad,41,nfsv3) +endef + +define KernelPackage/fs-nfs-v3/description + Kernel module for NFS v3 client support +endef + +$(eval $(call KernelPackage,fs-nfs-v3)) + +define KernelPackage/fs-nfs-v4 + SUBMENU:=$(FS_MENU) + TITLE:=NFS4 filesystem client support + DEPENDS:=+kmod-fs-nfs + KCONFIG:= \ + CONFIG_NFS_V4=y + FILES:= \ + $(LINUX_DIR)/fs/nfs/nfsv4.ko + AUTOLOAD:=$(call AutoLoad,41,nfsv4) +endef + +define KernelPackage/fs-nfs-v4/description + Kernel module for NFS v4 support +endef + +$(eval $(call KernelPackage,fs-nfs-v4)) define KernelPackage/fs-nfs-common SUBMENU:=$(FS_MENU) @@ -353,23 +383,33 @@ endef $(eval $(call KernelPackage,fs-nfs-common)) -define KernelPackage/fs-nfs-common-v4 +define KernelPackage/fs-nfs-common-rpcsec SUBMENU:=$(FS_MENU) - TITLE:=Common NFS V4 filesystem modules - KCONFIG+=\ - CONFIG_SUNRPC_GSS\ - CONFIG_NFS_V4=y\ - CONFIG_NFSD_V4=y - DEPENDS:= @BROKEN - FILES+=$(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko - AUTOLOAD=$(call AutoLoad,30,auth_rpcgss) + TITLE:=NFS Secure RPC + DEPENDS:= \ + +kmod-fs-nfs-common \ + +kmod-crypto-des \ + +kmod-crypto-cbc \ + +kmod-crypto-cts \ + +kmod-crypto-md5 \ + +kmod-crypto-sha1 \ + +kmod-crypto-hmac \ + +kmod-crypto-ecb + KCONFIG:= \ + CONFIG_SUNRPC_GSS \ + CONFIG_RPCSEC_GSS_KRB5 + FILES:= \ + $(LINUX_DIR)/lib/oid_registry.ko \ + $(LINUX_DIR)/net/sunrpc/auth_gss/auth_rpcgss.ko \ + $(LINUX_DIR)/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko + AUTOLOAD:=$(call AutoLoad,31,oid_registry auth_rpcgss rpcsec_gss_krb5) endef -define KernelPackage/fs-nfs-common-v4/description - Kernel modules for NFS V4 & NFSD V4 kernel support +define KernelPackage/fs-nfs-common-rpcsec/description + Kernel modules for NFS Secure RPC endef -$(eval $(call KernelPackage,fs-nfs-common-v4)) +$(eval $(call KernelPackage,fs-nfs-common-rpcsec)) define KernelPackage/fs-nfsd From 87cd9fd85e2ec170e6c1123b63f03d1fd1038422 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:19:39 +0800 Subject: [PATCH 16/95] kernel: i2c-piix4: fix dependency on TARGET_x86 --- package/kernel/linux/modules/i2c.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index 7e85ef3d9..1bb881cb0 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -127,7 +127,7 @@ I2C_PIIX4_MODULES:= \ define KernelPackage/i2c-piix4 $(call i2c_defaults,$(I2C_PIIX4_MODULES),59) TITLE:=Intel PIIX4 and compatible I2C interfaces - DEPENDS:=@PCI_SUPPORT @(x86||x86_64) kmod-i2c-core + DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core endef define KernelPackage/i2c-piix4/description From 3f3959edd347e205b79ab606958e62e86e5433ee Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:22:01 +0800 Subject: [PATCH 17/95] kernel: e100: take e100 firmware from linux-firmware repository --- package/firmware/linux-firmware/intel.mk | 9 +++++++++ package/kernel/linux/modules/netdevices.mk | 9 +-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package/firmware/linux-firmware/intel.mk b/package/firmware/linux-firmware/intel.mk index 0330335bf..8cdbb4824 100644 --- a/package/firmware/linux-firmware/intel.mk +++ b/package/firmware/linux-firmware/intel.mk @@ -153,3 +153,12 @@ define Package/iwlwifi-firmware-iwl8265/install $(INSTALL_DATA) $(PKG_BUILD_DIR)/iwlwifi-8265-27.ucode $(1)/lib/firmware endef $(eval $(call BuildPackage,iwlwifi-firmware-iwl8265)) + +Package/e100-firmware = $(call Package/firmware-default,Intel e100) +define Package/e100-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/e100 + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101m_ucode.bin $(1)/lib/firmware/e100/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d101s_ucode.bin $(1)/lib/firmware/e100/ + $(INSTALL_DATA) $(PKG_BUILD_DIR)/e100/d102e_ucode.bin $(1)/lib/firmware/e100/ +endef +$(eval $(call BuildPackage,e100-firmware)) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 4af06c610..0af4f96c2 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -450,7 +450,7 @@ $(eval $(call KernelPackage,ne2k-pci)) define KernelPackage/e100 SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Intel(R) PRO/100+ cards kernel support - DEPENDS:=@PCI_SUPPORT +kmod-mii + DEPENDS:=@PCI_SUPPORT +kmod-mii +e100-firmware KCONFIG:=CONFIG_E100 FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e100.ko AUTOLOAD:=$(call AutoProbe,e100) @@ -460,13 +460,6 @@ define KernelPackage/e100/description Kernel modules for Intel(R) PRO/100+ Ethernet adapters endef -define KernelPackage/e100/install - $(INSTALL_DIR) $(1)/lib/firmware/e100 - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d101m_ucode.bin $(1)/lib/firmware/e100/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d101s_ucode.bin $(1)/lib/firmware/e100/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/e100/d102e_ucode.bin $(1)/lib/firmware/e100/ -endef - $(eval $(call KernelPackage,e100)) From 7d42e8220a7196f1136d0e309d59c98991577c75 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:24:06 +0800 Subject: [PATCH 18/95] kernel: bump 4.9 to 4.9.65 --- include/kernel-version.mk | 4 +- ...ove-tsq_flags-close-to-sk_wmem_alloc.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...013-owrt-hack-fix-mt7688-cache-issue.patch | 4 +- .../patches-4.9/0052-stmmac-form-4-12.patch | 464 +++++++++--------- 5 files changed, 227 insertions(+), 249 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 8848439c9..55010add2 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,11 +4,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .93 -LINUX_VERSION-4.9 = .63 +LINUX_VERSION-4.9 = .65 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 -LINUX_KERNEL_HASH-4.9.63 = 21c9386f33fd3453ca67f7478b4c1ba34067645ef6d391871029cbd7f5df2ea3 +LINUX_KERNEL_HASH-4.9.65 = 24ba70877549a3cf25dc5f12efd260d3e957bce64c087de98baf8968ee514895 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch index 8f4c5b2a0..0acd00817 100644 --- a/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch +++ b/target/linux/generic/backport-4.9/024-8-tcp-tsq-move-tsq_flags-close-to-sk_wmem_alloc.patch @@ -134,7 +134,7 @@ Signed-off-by: David S. Miller if (tcp_small_queue_check(sk, skb, 0)) break; -@@ -3509,8 +3509,6 @@ void tcp_send_ack(struct sock *sk) +@@ -3504,8 +3504,6 @@ void tcp_send_ack(struct sock *sk) /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. * SKB_TRUESIZE(max(1 .. 66, MAX_TCP_HEADER)) is unfortunately ~784 diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 8168a885b..826496b41 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5921,7 +5921,7 @@ static void __ref alloc_node_mem_map(str +@@ -5930,7 +5930,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch b/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch index 860280158..0a3ef365f 100644 --- a/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch +++ b/target/linux/ramips/patches-4.9/0013-owrt-hack-fix-mt7688-cache-issue.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -774,7 +774,6 @@ static void __init arch_mem_init(char ** +@@ -846,7 +846,6 @@ static void __init arch_mem_init(char ** crashk_res.end - crashk_res.start + 1, BOOTMEM_DEFAULT); #endif @@ -18,7 +18,7 @@ Signed-off-by: John Crispin sparse_init(); plat_swiotlb_setup(); -@@ -890,6 +889,7 @@ void __init setup_arch(char **cmdline_p) +@@ -962,6 +961,7 @@ void __init setup_arch(char **cmdline_p) cpu_cache_init(); paging_init(); diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index a5cdec552..285e4d276 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -2887,7 +2887,7 @@ + + /* Display RX ring */ + priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); -+ } + } +} + +static void stmmac_display_tx_rings(struct stmmac_priv *priv) @@ -2906,15 +2906,15 @@ + head_tx = (void *)tx_q->dma_etx; + else + head_tx = (void *)tx_q->dma_tx; -+ -+ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); - } -+} - /* Display Rx ring */ - priv->hw->desc->display_ring(head_rx, DMA_RX_SIZE, true); - /* Display Tx ring */ - priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); ++ priv->hw->desc->display_ring(head_tx, DMA_TX_SIZE, false); ++ } ++} ++ +static void stmmac_display_rings(struct stmmac_priv *priv) +{ + /* Display RX ring */ @@ -3131,7 +3131,7 @@ if (priv->hw->mode->set_16kib_bfsize) bfsize = priv->hw->mode->set_16kib_bfsize(dev->mtu); -@@ -1018,257 +1228,516 @@ static int init_dma_desc_rings(struct ne +@@ -1018,235 +1228,409 @@ static int init_dma_desc_rings(struct ne priv->dma_buf_sz = bfsize; @@ -3163,10 +3163,7 @@ + p = &((rx_q->dma_erx + i)->basic); + else + p = rx_q->dma_rx + i; - -- ret = stmmac_init_rx_buffers(priv, p, i, flags); -- if (ret) -- goto err_init_rx_buffers; ++ + ret = stmmac_init_rx_buffers(priv, p, i, flags, + queue); + if (ret) @@ -3176,15 +3173,18 @@ + rx_q->rx_skbuff[i], rx_q->rx_skbuff[i]->data, + (unsigned int)rx_q->rx_skbuff_dma[i]); + } -+ + +- ret = stmmac_init_rx_buffers(priv, p, i, flags); +- if (ret) +- goto err_init_rx_buffers; + rx_q->cur_rx = 0; + rx_q->dirty_rx = (unsigned int)(i - DMA_RX_SIZE); -+ -+ stmmac_clear_rx_descriptors(priv, queue); - netif_dbg(priv, probe, priv->dev, "[%p]\t[%p]\t[%x]\n", - priv->rx_skbuff[i], priv->rx_skbuff[i]->data, - (unsigned int)priv->rx_skbuff_dma[i]); ++ stmmac_clear_rx_descriptors(priv, queue); ++ + /* Setup the chained descriptor addresses */ + if (priv->mode == STMMAC_CHAIN_MODE) { + if (priv->extend_desc) @@ -3277,13 +3277,8 @@ + priv->hw->mode->init(tx_q->dma_tx, + tx_q->dma_tx_phy, + DMA_TX_SIZE, 0); - } - -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- priv->tx_skbuff_dma[i].len = 0; -- priv->tx_skbuff_dma[i].last_segment = false; -- priv->tx_skbuff[i] = NULL; ++ } ++ + for (i = 0; i < DMA_TX_SIZE; i++) { + struct dma_desc *p; + if (priv->extend_desc) @@ -3305,8 +3300,13 @@ + tx_q->tx_skbuff_dma[i].len = 0; + tx_q->tx_skbuff_dma[i].last_segment = false; + tx_q->tx_skbuff[i] = NULL; -+ } -+ + } + +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- priv->tx_skbuff_dma[i].len = 0; +- priv->tx_skbuff_dma[i].last_segment = false; +- priv->tx_skbuff[i] = NULL; + tx_q->dirty_tx = 0; + tx_q->cur_tx = 0; + @@ -3387,10 +3387,17 @@ - priv->tx_skbuff_dma[i].buf, - priv->tx_skbuff_dma[i].len, - DMA_TO_DEVICE); +- } + for (i = 0; i < DMA_TX_SIZE; i++) + stmmac_free_tx_buffer(priv, queue, i); +} -+ + +- if (priv->tx_skbuff[i]) { +- dev_kfree_skb_any(priv->tx_skbuff[i]); +- priv->tx_skbuff[i] = NULL; +- priv->tx_skbuff_dma[i].buf = 0; +- priv->tx_skbuff_dma[i].map_as_page = false; +- } +/** + * free_dma_rx_desc_resources - free RX dma desc resources + * @priv: private structure @@ -3419,10 +3426,11 @@ + + kfree(rx_q->rx_skbuff_dma); + kfree(rx_q->rx_skbuff); -+ } -+} -+ -+/** + } + } + + /** +- * alloc_dma_desc_resources - alloc TX/RX resources. + * free_dma_tx_desc_resources - free TX dma desc resources + * @priv: private structure + */ @@ -3455,36 +3463,90 @@ + +/** + * alloc_dma_rx_desc_resources - alloc RX resources. -+ * @priv: private structure -+ * Description: according to which descriptor can be used (extend or basic) -+ * this function allocates the resources for TX and RX paths. In case of -+ * reception, for example, it pre-allocated the RX socket buffer in order to -+ * allow zero-copy mechanism. -+ */ + * @priv: private structure + * Description: according to which descriptor can be used (extend or basic) + * this function allocates the resources for TX and RX paths. In case of + * reception, for example, it pre-allocated the RX socket buffer in order to + * allow zero-copy mechanism. + */ +-static int alloc_dma_desc_resources(struct stmmac_priv *priv) +static int alloc_dma_rx_desc_resources(struct stmmac_priv *priv) -+{ + { + u32 rx_count = priv->plat->rx_queues_to_use; -+ int ret = -ENOMEM; + int ret = -ENOMEM; + u32 queue; -+ + +- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), +- GFP_KERNEL); +- if (!priv->rx_skbuff_dma) +- return -ENOMEM; + /* RX queues buffers and DMA */ + for (queue = 0; queue < rx_count; queue++) { + struct stmmac_rx_queue *rx_q = &priv->rx_queue[queue]; -+ + +- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->rx_skbuff) +- goto err_rx_skbuff; +- +- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, +- sizeof(*priv->tx_skbuff_dma), +- GFP_KERNEL); +- if (!priv->tx_skbuff_dma) +- goto err_tx_skbuff_dma; +- +- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), +- GFP_KERNEL); +- if (!priv->tx_skbuff) +- goto err_tx_skbuff; +- +- if (priv->extend_desc) { +- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_erx) +- goto err_dma; + rx_q->queue_index = queue; + rx_q->priv_data = priv; -+ + +- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct +- dma_extended_desc), +- &priv->dma_tx_phy, + rx_q->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, + sizeof(dma_addr_t), -+ GFP_KERNEL); + GFP_KERNEL); +- if (!priv->dma_etx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_extended_desc), +- priv->dma_erx, priv->dma_rx_phy); +- goto err_dma; +- } +- } else { +- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_rx_phy, +- GFP_KERNEL); +- if (!priv->dma_rx) +- goto err_dma; + if (!rx_q->rx_skbuff_dma) + return -ENOMEM; -+ + +- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * +- sizeof(struct dma_desc), +- &priv->dma_tx_phy, +- GFP_KERNEL); +- if (!priv->dma_tx) { +- dma_free_coherent(priv->device, DMA_RX_SIZE * +- sizeof(struct dma_desc), +- priv->dma_rx, priv->dma_rx_phy); + rx_q->rx_skbuff = kmalloc_array(DMA_RX_SIZE, + sizeof(struct sk_buff *), + GFP_KERNEL); + if (!rx_q->rx_skbuff) -+ goto err_dma; + goto err_dma; + + if (priv->extend_desc) { + rx_q->dma_erx = dma_zalloc_coherent(priv->device, @@ -3505,12 +3567,19 @@ + GFP_KERNEL); + if (!rx_q->dma_rx) + goto err_dma; -+ } -+ } -+ -+ return 0; -+ -+err_dma: + } + } + + return 0; + + err_dma: +- kfree(priv->tx_skbuff); +-err_tx_skbuff: +- kfree(priv->tx_skbuff_dma); +-err_tx_skbuff_dma: +- kfree(priv->rx_skbuff); +-err_rx_skbuff: +- kfree(priv->rx_skbuff_dma); + free_dma_rx_desc_resources(priv); + + return ret; @@ -3567,7 +3636,7 @@ + GFP_KERNEL); + if (!tx_q->dma_tx) + goto err_dma_buffers; - } ++ } + } + + return 0; @@ -3575,9 +3644,9 @@ +err_dma_buffers: + free_dma_tx_desc_resources(priv); + -+ return ret; -+} -+ + return ret; + } + +/** + * alloc_dma_desc_resources - alloc TX/RX resources. + * @priv: private structure @@ -3603,176 +3672,7 @@ + * free_dma_desc_resources - free dma desc resources + * @priv: private structure + */ -+static void free_dma_desc_resources(struct stmmac_priv *priv) -+{ -+ /* Release the DMA RX socket buffers */ -+ free_dma_rx_desc_resources(priv); -+ -+ /* Release the DMA TX socket buffers */ -+ free_dma_tx_desc_resources(priv); -+} -+ -+/** -+ * stmmac_mac_enable_rx_queues - Enable MAC rx queues -+ * @priv: driver private structure -+ * Description: It is used for enabling the rx queues in the MAC -+ */ -+static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) -+{ -+ u32 rx_queues_count = priv->plat->rx_queues_to_use; -+ int queue; -+ u8 mode; - -- if (priv->tx_skbuff[i]) { -- dev_kfree_skb_any(priv->tx_skbuff[i]); -- priv->tx_skbuff[i] = NULL; -- priv->tx_skbuff_dma[i].buf = 0; -- priv->tx_skbuff_dma[i].map_as_page = false; -- } -+ for (queue = 0; queue < rx_queues_count; queue++) { -+ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; -+ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); - } - } - - /** -- * alloc_dma_desc_resources - alloc TX/RX resources. -- * @priv: private structure -- * Description: according to which descriptor can be used (extend or basic) -- * this function allocates the resources for TX and RX paths. In case of -- * reception, for example, it pre-allocated the RX socket buffer in order to -- * allow zero-copy mechanism. -+ * stmmac_start_rx_dma - start RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This starts a RX DMA channel - */ --static int alloc_dma_desc_resources(struct stmmac_priv *priv) -+static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) - { -- int ret = -ENOMEM; -- -- priv->rx_skbuff_dma = kmalloc_array(DMA_RX_SIZE, sizeof(dma_addr_t), -- GFP_KERNEL); -- if (!priv->rx_skbuff_dma) -- return -ENOMEM; -- -- priv->rx_skbuff = kmalloc_array(DMA_RX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->rx_skbuff) -- goto err_rx_skbuff; -- -- priv->tx_skbuff_dma = kmalloc_array(DMA_TX_SIZE, -- sizeof(*priv->tx_skbuff_dma), -- GFP_KERNEL); -- if (!priv->tx_skbuff_dma) -- goto err_tx_skbuff_dma; -- -- priv->tx_skbuff = kmalloc_array(DMA_TX_SIZE, sizeof(struct sk_buff *), -- GFP_KERNEL); -- if (!priv->tx_skbuff) -- goto err_tx_skbuff; -- -- if (priv->extend_desc) { -- priv->dma_erx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_erx) -- goto err_dma; -- -- priv->dma_etx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct -- dma_extended_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_etx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_extended_desc), -- priv->dma_erx, priv->dma_rx_phy); -- goto err_dma; -- } -- } else { -- priv->dma_rx = dma_zalloc_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_rx_phy, -- GFP_KERNEL); -- if (!priv->dma_rx) -- goto err_dma; -+ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); -+ priv->hw->dma->start_rx(priv->ioaddr, chan); -+} - -- priv->dma_tx = dma_zalloc_coherent(priv->device, DMA_TX_SIZE * -- sizeof(struct dma_desc), -- &priv->dma_tx_phy, -- GFP_KERNEL); -- if (!priv->dma_tx) { -- dma_free_coherent(priv->device, DMA_RX_SIZE * -- sizeof(struct dma_desc), -- priv->dma_rx, priv->dma_rx_phy); -- goto err_dma; -- } -- } -+/** -+ * stmmac_start_tx_dma - start TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This starts a TX DMA channel -+ */ -+static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); -+ priv->hw->dma->start_tx(priv->ioaddr, chan); -+} - -- return 0; -+/** -+ * stmmac_stop_rx_dma - stop RX DMA channel -+ * @priv: driver private structure -+ * @chan: RX channel index -+ * Description: -+ * This stops a RX DMA channel -+ */ -+static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_rx(priv->ioaddr, chan); -+} - --err_dma: -- kfree(priv->tx_skbuff); --err_tx_skbuff: -- kfree(priv->tx_skbuff_dma); --err_tx_skbuff_dma: -- kfree(priv->rx_skbuff); --err_rx_skbuff: -- kfree(priv->rx_skbuff_dma); -- return ret; -+/** -+ * stmmac_stop_tx_dma - stop TX DMA channel -+ * @priv: driver private structure -+ * @chan: TX channel index -+ * Description: -+ * This stops a TX DMA channel -+ */ -+static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) -+{ -+ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); -+ priv->hw->dma->stop_tx(priv->ioaddr, chan); - } - --static void free_dma_desc_resources(struct stmmac_priv *priv) -+/** -+ * stmmac_start_all_dma - start all RX and TX DMA channels -+ * @priv: driver private structure -+ * Description: -+ * This starts all the RX and TX DMA channels -+ */ -+static void stmmac_start_all_dma(struct stmmac_priv *priv) + static void free_dma_desc_resources(struct stmmac_priv *priv) { - /* Release the DMA TX/RX socket buffers */ - dma_free_rx_skbufs(priv); @@ -3798,6 +3698,99 @@ - kfree(priv->rx_skbuff); - kfree(priv->tx_skbuff_dma); - kfree(priv->tx_skbuff); ++ /* Release the DMA RX socket buffers */ ++ free_dma_rx_desc_resources(priv); ++ ++ /* Release the DMA TX socket buffers */ ++ free_dma_tx_desc_resources(priv); + } + + /** +@@ -1256,19 +1640,104 @@ static void free_dma_desc_resources(stru + */ + static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) + { +- int rx_count = priv->dma_cap.number_rx_queues; +- int queue = 0; ++ u32 rx_queues_count = priv->plat->rx_queues_to_use; ++ int queue; ++ u8 mode; + +- /* If GMAC does not have multiple queues, then this is not necessary*/ +- if (rx_count == 1) +- return; ++ for (queue = 0; queue < rx_queues_count; queue++) { ++ mode = priv->plat->rx_queues_cfg[queue].mode_to_use; ++ priv->hw->mac->rx_queue_enable(priv->hw, mode, queue); ++ } ++} + +- /** +- * If the core is synthesized with multiple rx queues / multiple +- * dma channels, then rx queues will be disabled by default. +- * For now only rx queue 0 is enabled. +- */ +- priv->hw->mac->rx_queue_enable(priv->hw, queue); ++/** ++ * stmmac_start_rx_dma - start RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This starts a RX DMA channel ++ */ ++static void stmmac_start_rx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA RX processes started in channel %d\n", chan); ++ priv->hw->dma->start_rx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_start_tx_dma - start TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This starts a TX DMA channel ++ */ ++static void stmmac_start_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes started in channel %d\n", chan); ++ priv->hw->dma->start_tx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_stop_rx_dma - stop RX DMA channel ++ * @priv: driver private structure ++ * @chan: RX channel index ++ * Description: ++ * This stops a RX DMA channel ++ */ ++static void stmmac_stop_rx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA RX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_rx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_stop_tx_dma - stop TX DMA channel ++ * @priv: driver private structure ++ * @chan: TX channel index ++ * Description: ++ * This stops a TX DMA channel ++ */ ++static void stmmac_stop_tx_dma(struct stmmac_priv *priv, u32 chan) ++{ ++ netdev_dbg(priv->dev, "DMA TX processes stopped in channel %d\n", chan); ++ priv->hw->dma->stop_tx(priv->ioaddr, chan); ++} ++ ++/** ++ * stmmac_start_all_dma - start all RX and TX DMA channels ++ * @priv: driver private structure ++ * Description: ++ * This starts all the RX and TX DMA channels ++ */ ++static void stmmac_start_all_dma(struct stmmac_priv *priv) ++{ + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; @@ -3807,38 +3800,23 @@ + + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_start_tx_dma(priv, chan); - } - - /** -- * stmmac_mac_enable_rx_queues - Enable MAC rx queues -- * @priv: driver private structure -- * Description: It is used for enabling the rx queues in the MAC ++} ++ ++/** + * stmmac_stop_all_dma - stop all RX and TX DMA channels + * @priv: driver private structure + * Description: + * This stops the RX and TX DMA channels - */ --static void stmmac_mac_enable_rx_queues(struct stmmac_priv *priv) ++ */ +static void stmmac_stop_all_dma(struct stmmac_priv *priv) - { -- int rx_count = priv->dma_cap.number_rx_queues; -- int queue = 0; ++{ + u32 rx_channels_count = priv->plat->rx_queues_to_use; + u32 tx_channels_count = priv->plat->tx_queues_to_use; + u32 chan = 0; - -- /* If GMAC does not have multiple queues, then this is not necessary*/ -- if (rx_count == 1) -- return; ++ + for (chan = 0; chan < rx_channels_count; chan++) + stmmac_stop_rx_dma(priv, chan); - -- /** -- * If the core is synthesized with multiple rx queues / multiple -- * dma channels, then rx queues will be disabled by default. -- * For now only rx queue 0 is enabled. -- */ -- priv->hw->mac->rx_queue_enable(priv->hw, queue); ++ + for (chan = 0; chan < tx_channels_count; chan++) + stmmac_stop_tx_dma(priv, chan); } From d596ad539c9b81164192755e7ebfb121911dd430 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:26:17 +0800 Subject: [PATCH 19/95] kernel: Update kernel 4.4 to 4.4.100 --- include/kernel-version.mk | 4 ++-- .../patches-4.4/910-unaligned_access_hacks.patch | 6 +++--- .../gemini/patches-4.4/150-gemini-pata.patch | 2 +- ...-the-appended-dtb-address-in-a-variable.patch | 2 +- .../pending-4.4/214-spidev_h_portability.patch | 2 +- .../pending-4.4/630-packet_socket_type.patch | 16 ++++++++-------- .../generic/pending-4.4/701-phy_extension.patch | 2 +- .../702-phy_add_aneg_done_function.patch | 2 +- ...dd-detach-callback-to-struct-phy_driver.patch | 2 +- .../710-phy-add-mdio_register_board_info.patch | 2 +- .../generic/pending-4.4/902-debloat_proc.patch | 2 +- ...ide-a-hook-for-link-up-link-down-events.patch | 2 +- ...phy-export-phy_speed_to_str-for-phylink.patch | 2 +- .../130-phylink-add-phylink-infrastructure.patch | 4 ++-- .../linux/oxnas/patches-4.4/500-oxnas-sata.patch | 2 +- 15 files changed, 26 insertions(+), 26 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 55010add2..8fb560ec4 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,11 +3,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .93 +LINUX_VERSION-4.4 = .100 LINUX_VERSION-4.9 = .65 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.93 = ed349314f16e78a6571b5f8884f6452782aef6c26b81bcc7ccdac44ecd917c36 +LINUX_KERNEL_HASH-4.4.100 = 9936cd99c4bd35f6bc6962c9acdd1fa2ac8999e07a9be6a94a03b5492f1bd14f LINUX_KERNEL_HASH-4.9.65 = 24ba70877549a3cf25dc5f12efd260d3e957bce64c087de98baf8968ee514895 ifdef KERNEL_PATCHVER diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch index 5bedf5dc9..8789b644a 100644 --- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch @@ -276,7 +276,7 @@ t = ip6gre_tunnel_lookup(skb->dev, &ipv6h->daddr, &ipv6h->saddr, key, greh->protocol); -@@ -479,11 +479,11 @@ static int ip6gre_rcv(struct sk_buff *sk +@@ -482,11 +482,11 @@ static int ip6gre_rcv(struct sk_buff *sk offset += 4; } if (flags&GRE_KEY) { @@ -290,7 +290,7 @@ offset += 4; } } -@@ -745,7 +745,7 @@ static netdev_tx_t ip6gre_xmit2(struct s +@@ -748,7 +748,7 @@ static netdev_tx_t ip6gre_xmit2(struct s if (tunnel->parms.o_flags&GRE_SEQ) { ++tunnel->o_seqno; @@ -299,7 +299,7 @@ ptr--; } if (tunnel->parms.o_flags&GRE_KEY) { -@@ -841,7 +841,7 @@ static inline int ip6gre_xmit_ipv6(struc +@@ -844,7 +844,7 @@ static inline int ip6gre_xmit_ipv6(struc dsfield = ipv6_get_dsfield(ipv6h); if (t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS) diff --git a/target/linux/gemini/patches-4.4/150-gemini-pata.patch b/target/linux/gemini/patches-4.4/150-gemini-pata.patch index 3da05c519..1054be08b 100644 --- a/target/linux/gemini/patches-4.4/150-gemini-pata.patch +++ b/target/linux/gemini/patches-4.4/150-gemini-pata.patch @@ -123,7 +123,7 @@ .length = SZ_512K, --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig -@@ -564,6 +564,16 @@ config PATA_EP93XX +@@ -567,6 +567,16 @@ config PATA_EP93XX If unsure, say N. diff --git a/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch index 764c1cb83..d868d210a 100644 --- a/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch +++ b/target/linux/generic/pending-4.4/093-MIPS-store-the-appended-dtb-address-in-a-variable.patch @@ -119,7 +119,7 @@ Signed-off-by: Ralf Baechle /* Set the SP after an empty pt_regs. */ --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c -@@ -814,6 +814,10 @@ void __init setup_arch(char **cmdline_p) +@@ -886,6 +886,10 @@ void __init setup_arch(char **cmdline_p) unsigned long kernelsp[NR_CPUS]; unsigned long fw_arg0, fw_arg1, fw_arg2, fw_arg3; diff --git a/target/linux/generic/pending-4.4/214-spidev_h_portability.patch b/target/linux/generic/pending-4.4/214-spidev_h_portability.patch index dbee09054..39fa32ffa 100644 --- a/target/linux/generic/pending-4.4/214-spidev_h_portability.patch +++ b/target/linux/generic/pending-4.4/214-spidev_h_portability.patch @@ -1,6 +1,6 @@ --- a/include/uapi/linux/spi/spidev.h +++ b/include/uapi/linux/spi/spidev.h -@@ -111,7 +111,7 @@ struct spi_ioc_transfer { +@@ -112,7 +112,7 @@ struct spi_ioc_transfer { /* not all platforms use or _IOC_TYPECHECK() ... */ #define SPI_MSGSIZE(N) \ diff --git a/target/linux/generic/pending-4.4/630-packet_socket_type.patch b/target/linux/generic/pending-4.4/630-packet_socket_type.patch index 8c6b7a37b..a427165f4 100644 --- a/target/linux/generic/pending-4.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.4/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1776,6 +1776,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1784,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1783,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1791,6 +1792,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1795,7 +1797,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1803,7 +1805,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -1998,12 +2000,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2006,12 +2008,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2123,12 +2125,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2131,12 +2133,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3115,6 +3117,7 @@ static int packet_create(struct net *net +@@ -3127,6 +3129,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3744,6 +3747,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3756,6 +3759,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3796,6 +3809,13 @@ static int packet_getsockopt(struct sock +@@ -3809,6 +3822,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-4.4/701-phy_extension.patch b/target/linux/generic/pending-4.4/701-phy_extension.patch index a1c48b7a3..6cb3fdfd4 100644 --- a/target/linux/generic/pending-4.4/701-phy_extension.patch +++ b/target/linux/generic/pending-4.4/701-phy_extension.patch @@ -53,7 +53,7 @@ * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -800,6 +800,7 @@ void phy_start_machine(struct phy_device +@@ -796,6 +796,7 @@ void phy_start_machine(struct phy_device void phy_stop_machine(struct phy_device *phydev); int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); diff --git a/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch index 39ac22f1a..f20f48f40 100644 --- a/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/pending-4.4/702-phy_add_aneg_done_function.patch @@ -1,6 +1,6 @@ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -501,6 +501,12 @@ struct phy_driver { +@@ -497,6 +497,12 @@ struct phy_driver { /* Determines the negotiated speed and duplex */ int (*read_status)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch index 5babfdf5e..4ef3b781f 100644 --- a/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch +++ b/target/linux/generic/pending-4.4/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -12,7 +12,7 @@ phy_suspend(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -519,6 +519,12 @@ struct phy_driver { +@@ -515,6 +515,12 @@ struct phy_driver { */ int (*did_interrupt)(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch index bd15df238..4886dd0e3 100644 --- a/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/pending-4.4/710-phy-add-mdio_register_board_info.patch @@ -46,7 +46,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -839,6 +839,23 @@ void mdio_bus_exit(void); +@@ -835,6 +835,23 @@ void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 98e78183d..1ef9f9800 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -173,7 +173,7 @@ goto err; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -3042,6 +3042,8 @@ static __net_initdata struct pernet_oper +@@ -3044,6 +3044,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch index a27e6baec..0a0157be9 100644 --- a/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch +++ b/target/linux/mvebu/patches-4.4/125-phy-provide-a-hook-for-link-up-link-down-events.patch @@ -173,7 +173,7 @@ Signed-off-by: Russell King --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -433,6 +433,7 @@ struct phy_device { +@@ -429,6 +429,7 @@ struct phy_device { u8 mdix; diff --git a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch index 1b79259da..c43607029 100644 --- a/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch +++ b/target/linux/mvebu/patches-4.4/128-phy-export-phy_speed_to_str-for-phylink.patch @@ -34,7 +34,7 @@ Signed-off-by: Russell King case PHY_##_state: \ --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -816,6 +816,7 @@ int phy_ethtool_gset(struct phy_device * +@@ -812,6 +812,7 @@ int phy_ethtool_gset(struct phy_device * int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); int phy_start_interrupts(struct phy_device *phydev); diff --git a/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch index 0d340c827..141ea07d2 100644 --- a/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch +++ b/target/linux/mvebu/patches-4.4/130-phylink-add-phylink-infrastructure.patch @@ -914,7 +914,7 @@ Signed-off-by: Russell King +MODULE_LICENSE("GPL"); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -147,6 +147,7 @@ static inline const char *phy_modes(phy_ +@@ -143,6 +143,7 @@ static inline const char *phy_modes(phy_ #define MII_ADDR_C45 (1<<30) struct device; @@ -922,7 +922,7 @@ Signed-off-by: Russell King struct sk_buff; /* -@@ -429,6 +430,7 @@ struct phy_device { +@@ -425,6 +426,7 @@ struct phy_device { struct mutex lock; diff --git a/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch b/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch index 3891dc1bc..b833b635a 100644 --- a/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch +++ b/target/linux/oxnas/patches-4.4/500-oxnas-sata.patch @@ -1,6 +1,6 @@ --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig -@@ -429,6 +429,13 @@ config SATA_VITESSE +@@ -432,6 +432,13 @@ config SATA_VITESSE If unsure, say N. From 6dd668a3fdad0eb018a0809e903a041b08dc0573 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:29:12 +0800 Subject: [PATCH 20/95] update mwlwifi driver to upstream to fix 2.4Ghz issues --- package/kernel/mwlwifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index cdb0f4f64..6c8a5d836 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_VERSION:=10.3.4.0-20170810 +PKG_VERSION:=10.3.4.0-20171011 PKG_RELEASE=1 PKG_LICENSE:=ISC @@ -16,8 +16,8 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=9a6db695f17c0c9ec5d4602afc9c36290c3bdea1 -PKG_MIRROR_HASH:=b04781a0b06385c7c316dc3b91203aa41e8fcb511a3c5e4e9cba5c40156a49bd +PKG_SOURCE_VERSION:=e119077b68d64e368cb9cc46bd364308db4289dc +PKG_MIRROR_HASH:=6b450f91941de1787a41e1cf162764e9b8e9ff9cdf7f80743afc5081ef435c81 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 From 91862bc5f949d52cabbe23b3866f343819931482 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:30:37 +0800 Subject: [PATCH 21/95] mvebu switch to kernel 4.9 --- target/linux/mvebu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/mvebu/Makefile b/target/linux/mvebu/Makefile index e319a8f82..a07aa7cf2 100644 --- a/target/linux/mvebu/Makefile +++ b/target/linux/mvebu/Makefile @@ -14,7 +14,7 @@ CPU_TYPE:=cortex-a9 CPU_SUBTYPE:=vfpv3 MAINTAINER:=Imre Kaloz -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk From 003f0cd040efd8939c0ac99c8db34ef9fe8b791d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 26 Nov 2017 14:32:21 +0800 Subject: [PATCH 22/95] unselect luci-app-nlbwmon by default --- include/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index b18031f8d..6fb5a31bc 100644 --- a/include/target.mk +++ b/include/target.mk @@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd luci-app-sfe \ -luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-nlbwmon +luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets From 0759aaa96d5adb9f68bd730e9e02a7485500547f Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Tue, 28 Nov 2017 04:53:01 +0800 Subject: [PATCH 23/95] add mw316 v1, sgr w500 ebi fit v3,comba ap2600i,comba ap2600ifm. --- .../ar71xx/base-files/etc/board.d/01_leds | 19 +++ .../ar71xx/base-files/etc/board.d/02_network | 10 +- target/linux/ar71xx/base-files/etc/diag.sh | 10 ++ target/linux/ar71xx/base-files/lib/ar71xx.sh | 15 ++ .../ar71xx/base-files/lib/upgrade/platform.sh | 4 + target/linux/ar71xx/config-4.4 | 4 + target/linux/ar71xx/config-4.9 | 4 + .../files/arch/mips/ath79/Kconfig.openwrt | 37 +++++ .../ar71xx/files/arch/mips/ath79/Makefile | 4 + .../arch/mips/ath79/mach-maselink-ap2600i.c | 137 ++++++++++++++++ .../arch/mips/ath79/mach-maselink-ap2600ifm.c | 147 ++++++++++++++++++ .../files/arch/mips/ath79/mach-mw316r-v1.c | 143 +++++++++++++++++ .../mips/ath79/mach-sgr-w500-ebi-fit-v3.c | 116 ++++++++++++++ .../ar71xx/files/arch/mips/ath79/machtypes.h | 4 + target/linux/ar71xx/image/generic.mk | 9 ++ target/linux/ar71xx/image/legacy-devices.mk | 22 ++- target/linux/ar71xx/image/legacy.mk | 4 + 17 files changed, 686 insertions(+), 3 deletions(-) create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 61665fed9..a811d8faf 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -420,6 +420,14 @@ hornet-ub-x2) ucidef_set_led_wlan "wlan" "WLAN" "alfa:blue:wlan" "phy0tpt" ucidef_set_led_usbdev "usb" "USB" "alfa:blue:usb" "1-1" ;; +maselink-ap2600i) + ucidef_set_led_netdev "wan" "WAN" "ap2600i:green:run" "eth0" + ucidef_set_led_wlan "wlan" "WLAN" "ap2600i:green:wlan" "phy0tpt" + ;; +maselink-ap2600ifm) + ucidef_set_led_wlan "wlan1" "WLAN1" "ap2600ifm:green:rf1" "phy0tpt" + ucidef_set_led_wlan "wlan2" "WLAN2" "ap2600ifm:green:rf2" "phy1tpt" + ;; mc-mac1200r) ucidef_set_led_wlan "wlan2g" "WLAN2G" "mercury:green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt" @@ -463,6 +471,13 @@ mr900v2) ucidef_set_led_default "status-red" "Status (red)" "mr900:red:wifi" "0" ucidef_set_led_default "status-green" "Status (green)" "mr900:green:wifi" "0" ;; +mw316r-v1) + ucidef_set_led_netdev "wan" "WAN" "mercury:green:wan" "eth0" + ucidef_set_led_switch "lan1" "LAN1" "mercury:green:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "mercury:green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "mercury:green:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "mercury:green:lan4" "switch0" "0x10" + ;; mynet-n600) ucidef_set_led_netdev "wan" "WAN" "wd:blue:internet" "eth1" ucidef_set_led_switch "lan1" "LAN1" "wd:green:lan1" "switch0" "0x02" @@ -565,6 +580,10 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; +sgr-w500-ebi-fit-v3) + ucidef_set_led_netdev "wan" "WAN" "grentech:green:wan" "eth0" + ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan" "phy0tpt" + ;; sgr-w500-n85b-v2) ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan2g" "phy0tpt" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 24501990f..7d47173ff 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -132,7 +132,10 @@ ar71xx_setup_interfaces() unifiac-lite|\ wi2a-ac200i|\ wndap360|\ - sgr-w500-n85b-v2 |\ + sgr-w500-n85b-v2|\ + sgr-w500-ebi-fit-v3|\ + maselink-ap2600i|\ + maselink-ap2600ifm|\ wp543) ucidef_set_interface_lan "eth0" ;; @@ -163,6 +166,11 @@ ar71xx_setup_interfaces() wrtnode2q) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; + mw316r-v1) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" + ;; rb-750-r2|\ rb-750p-pbr2|\ rb-750up-r2) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 2ac3aea0a..d64493c5a 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -230,6 +230,13 @@ get_status_led() { ls-sr71) status_led="ubnt:green:d22" ;; + maselink-ap2600i) + status_led="ap2600i:green:power" + ;; + maselink-ap2600ifm) + status_led="ap2600ifm:green:power" + ;; + mw316r-v1|\ mc-mac1200r) status_led="mercury:green:system" ;; @@ -353,6 +360,9 @@ get_status_led() { sgr-w500-n85b-v2) status_led="grentech:green:status" ;; + sgr-w500-ebi-fit-v3) + status_led="grentech:green:status" + ;; smart-300) status_led="nc-link:green:system" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 3819b96b8..e6e698789 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,6 +263,9 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; ++ "031600"*) + model="Mercury MW316R" + ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -720,6 +723,15 @@ ar71xx_board_detect() { *"MAC1200R") name="mc-mac1200r" ;; + *"MW316R v1") + name="mw316r-v1" + ;; + *"MASELink AP2600-I") + name="maselink-ap2600i" + ;; + *"MASELink AP2600-IFM") + name="maselink-ap2600ifm" + ;; *"MiniBox V1.0") name="minibox-v1" ;; @@ -995,6 +1007,9 @@ ar71xx_board_detect() { "GRENTECH SGR-W500-N85b v2.0") name="sgr-w500-n85b-v2" ;; + "GRENTECH SGR-W500-EBI(FIT) v3.0") + name="sgr-w500-ebi-fit-v3" + ;; *"SMART-300") name="smart-300" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index a41f3b709..cb428a264 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -326,9 +326,12 @@ platform_check_image() { dw33d|\ f9k1115v2|\ hornet-ub|\ + maselink-ap2600i|\ + maselink-ap2600ifm|\ mr12|\ mr16|\ sgr-w500-n85b-v2|\ + sgr-w500-ebi-fit-v3|\ zbt-we1526|\ zcn-1523h-2|\ zcn-1523h-5) @@ -387,6 +390,7 @@ platform_check_image() { el-mini|\ gl-inet|\ mc-mac1200r|\ + mw316r-v1|\ minibox-v1|\ omy-g1|\ omy-x1|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 1cf7677f9..824e84720 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -128,6 +128,9 @@ CONFIG_ATH79_MACH_JWAP003=y CONFIG_ATH79_MACH_JWAP230=y CONFIG_ATH79_MACH_LIMA=y CONFIG_ATH79_MACH_MC_MAC1200R=y +CONFIG_ATH79_MACH_MW316R_V1=y +CONFIG_ATH79_MACH_MASELINK_AP2600I=y +CONFIG_ATH79_MACH_MASELINK_AP2600IFM=y CONFIG_ATH79_MACH_MR12=y CONFIG_ATH79_MACH_MR16=y CONFIG_ATH79_MACH_MR1750=y @@ -169,6 +172,7 @@ CONFIG_ATH79_MACH_SC1750=y CONFIG_ATH79_MACH_SC300M=y CONFIG_ATH79_MACH_SC450=y CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y +CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3=y CONFIG_ATH79_MACH_SMART_300=y CONFIG_ATH79_MACH_SOM9331=y CONFIG_ATH79_MACH_SR3200=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 2f963c730..ff0b63c3e 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -126,6 +126,9 @@ CONFIG_ATH79_MACH_JWAP003=y CONFIG_ATH79_MACH_JWAP230=y CONFIG_ATH79_MACH_LIMA=y CONFIG_ATH79_MACH_MC_MAC1200R=y +CONFIG_ATH79_MACH_MW316R_V1=y +CONFIG_ATH79_MACH_MASELINK_AP2600I=y +CONFIG_ATH79_MACH_MASELINK_AP2600IFM=y CONFIG_ATH79_MACH_MR12=y CONFIG_ATH79_MACH_MR16=y CONFIG_ATH79_MACH_MR1750=y @@ -167,6 +170,7 @@ CONFIG_ATH79_MACH_SC1750=y CONFIG_ATH79_MACH_SC300M=y CONFIG_ATH79_MACH_SC450=y CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y +CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3=y CONFIG_ATH79_MACH_SMART_300=y CONFIG_ATH79_MACH_SOM9331=y CONFIG_ATH79_MACH_SR3200=y diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index f0203c2a9..318d19dcf 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -2182,3 +2182,40 @@ config ATH79_MACH_SGR_W500_N85B_V2 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC select ATH79_DEV_USB + +config ATH79_MACH_MASELINK_AP2600I + bool "Comba MASELink AP2600-I support" + select SOC_AR934X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + select ATH79_DEV_USB + +config ATH79_MACH_MASELINK_AP2600IFM + bool "Comba MASELink AP2600-IFM support" + select SOC_AR71XX + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + +config ATH79_MACH_SGR_W500_EBI_FIT_V3 + bool "GRENTECH SGR-W500-EBI(FIT) v3.0 support" + select SOC_AR71XX + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + +config ATH79_MACH_MW316R_V1 + bool "Mercury MW316R v1 support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 6af6e8071..a273b235c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -134,6 +134,9 @@ obj-$(CONFIG_ATH79_MACH_JWAP003) += mach-jwap003.o obj-$(CONFIG_ATH79_MACH_JWAP230) += mach-jwap230.o obj-$(CONFIG_ATH79_MACH_LIMA) += mach-lima.o obj-$(CONFIG_ATH79_MACH_MC_MAC1200R) += mach-mc-mac1200r.o +obj-$(CONFIG_ATH79_MACH_MW316R_V1) += mach-mw316r-v1.o +obj-$(CONFIG_ATH79_MACH_MASELINK_AP2600I) += mach-maselink-ap2600i.o +obj-$(CONFIG_ATH79_MACH_MASELINK_AP2600IFM) += mach-maselink-ap2600ifm.o obj-$(CONFIG_ATH79_MACH_MR12) += mach-mr12.o obj-$(CONFIG_ATH79_MACH_MR16) += mach-mr16.o obj-$(CONFIG_ATH79_MACH_MR1750) += mach-mr1750.o @@ -176,6 +179,7 @@ obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o obj-$(CONFIG_ATH79_MACH_SC450) += mach-sc450.o obj-$(CONFIG_ATH79_MACH_SGR_W500_N85B_V2) += mach-sgr-w500-n85b-v2.o +obj-$(CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3) += mach-sgr-w500-ebi-fit-v3.o obj-$(CONFIG_ATH79_MACH_SMART_300) += mach-smart-300.o obj-$(CONFIG_ATH79_MACH_SOM9331) += mach-som9331.o obj-$(CONFIG_ATH79_MACH_SR3200) += mach-sr3200.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c new file mode 100644 index 000000000..ad16b3daa --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c @@ -0,0 +1,137 @@ +/* + * Comba MASELink AP2600-I board support + * + * Copyright (c) 2016 Weijie Gao + * + * 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 +#include +#include +#include +#include + +#include + +#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-nfc.h" +#include "dev-spi.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define AP2600I_GPIO_LED_POWER_RED 11 +#define AP2600I_GPIO_LED_POWER_GREEN 12 +#define AP2600I_GPIO_LED_RUN 13 +#define AP2600I_GPIO_LED_WLAN 14 + +#define AP2600I_GPIO_BUTTON_RESET 15 + +#define AP2600I_KEYS_POLL_INTERVAL 20 /* msecs */ +#define AP2600I_KEYS_DEBOUNCE_INTERVAL (3 * AP2600I_KEYS_POLL_INTERVAL) + +#define AP2600I_MAC0_OFFSET 0 +#define AP2600I_WMAC_CALDATA_OFFSET 0x1000 +#define AP2600I_PCIE_CALDATA_OFFSET 0x5000 + +static struct gpio_led ap2600i_leds_gpio[] __initdata = { + { + .name = "ap2600i:red:power", + .gpio = AP2600I_GPIO_LED_POWER_RED, + .active_low = 1, + }, + { + .name = "ap2600i:green:power", + .gpio = AP2600I_GPIO_LED_POWER_GREEN, + .active_low = 1, + }, + { + .name = "ap2600i:green:run", + .gpio = AP2600I_GPIO_LED_RUN, + .active_low = 1, + }, + { + .name = "ap2600i:green:wlan", + .gpio = AP2600I_GPIO_LED_WLAN, + .active_low = 1, + } +}; + +static struct gpio_keys_button ap2600i_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = AP2600I_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP2600I_GPIO_BUTTON_RESET, + .active_low = 1, + }, +}; + +static struct at803x_platform_data ap2600i_ar8035_data = { + .enable_rgmii_rx_delay = 1, + .fixup_rgmii_tx_delay = 1, +}; + +static struct mdio_board_info ap2600i_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 4, + .platform_data = &ap2600i_ar8035_data, + }, +}; + +static void __init ap2600i_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ap2600i_leds_gpio), + ap2600i_leds_gpio); + ath79_register_gpio_keys_polled(-1, AP2600I_KEYS_POLL_INTERVAL, + ARRAY_SIZE(ap2600i_gpio_keys), + ap2600i_gpio_keys); + + ath79_register_wmac(art + AP2600I_WMAC_CALDATA_OFFSET, NULL); + ap91_pci_init(art + AP2600I_PCIE_CALDATA_OFFSET, NULL); + + ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | + AR934X_ETH_CFG_SW_ONLY_MODE); + + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, art + AP2600I_MAC0_OFFSET, 0); + + mdiobus_register_board_info(ap2600i_mdio0_info, + ARRAY_SIZE(ap2600i_mdio0_info)); + + /* GMAC0 is connected to an AR8035 Gigabit PHY */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_pll_data.pll_1000 = 0x0e000000; + ath79_eth0_pll_data.pll_100 = 0x0101; + ath79_eth0_pll_data.pll_10 = 0x1313; + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_MASELINK_AP2600I, "AP2600I", "Comba MASELink AP2600-I", + ap2600i_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c new file mode 100644 index 000000000..cffc64138 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c @@ -0,0 +1,147 @@ +/* + * Comba MASELink AP2600-IFM board support + * + * Copyright (c) 2017 Weijie Gao + * + * 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 +#include +#include + +#include +#include + +#include "pci.h" +#include "common.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 "machtypes.h" +#include "nvram.h" + +#define AP2600IFM_GPIO_LED_RF1 2 +#define AP2600IFM_GPIO_LED_RF1_TOP 7 +#define AP2600IFM_GPIO_LED_RF2 4 +#define AP2600IFM_GPIO_LED_RF2_TOP 5 +#define AP2600IFM_GPIO_LED_D24 0 +#define AP2600IFM_GPIO_LED_D24_TOP 3 + +#define AP2600IFM_GPIO_BUTTON_RESET 8 + +#define AP2600IFM_KEYS_POLL_INTERVAL 20 /* msecs */ +#define AP2600IFM_KEYS_DEBOUNCE_INTERVAL (3 * AP2600IFM_KEYS_POLL_INTERVAL) + +#define AP2600IFM_NVRAM_ADDR 0x1f040004 +#define AP2600IFM_NVRAM_SIZE 0x3fffc + +static struct gpio_led ap2600ifm_leds_gpio[] __initdata = { + { + .name = "ap2600ifm:green:rf1", + .gpio = AP2600IFM_GPIO_LED_RF1, + .active_low = 1, + }, + { + .name = "ap2600ifm:green:rf1top", + .gpio = AP2600IFM_GPIO_LED_RF1_TOP, + .active_low = 1, + }, + { + .name = "ap2600ifm:green:rf2", + .gpio = AP2600IFM_GPIO_LED_RF2, + .active_low = 1, + }, + { + .name = "ap2600ifm:green:rf2top", + .gpio = AP2600IFM_GPIO_LED_RF2_TOP, + .active_low = 1, + }, + { + .name = "ap2600ifm:green:d24", + .gpio = AP2600IFM_GPIO_LED_D24, + .active_low = 1, + }, + { + .name = "ap2600ifm:green:d24top", + .gpio = AP2600IFM_GPIO_LED_D24_TOP, + .active_low = 1, + } +}; + +static struct gpio_keys_button ap2600ifm_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = AP2600IFM_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP2600IFM_GPIO_BUTTON_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info ap2600ifm_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 20, + }, +}; + +static void ap2600ifm_get_mac(const char *name, char *mac) +{ + u8 *nvram = (u8 *) KSEG1ADDR(AP2600IFM_NVRAM_ADDR); + int err; + + err = ath79_nvram_parse_mac_addr(nvram, AP2600IFM_NVRAM_SIZE, + name, mac); + if (err) + pr_err("%s not found in environment variables\n", name); +} + +static void __init ap2600ifm_setup(void) +{ + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ap2600ifm_leds_gpio), + ap2600ifm_leds_gpio); + ath79_register_gpio_keys_polled(-1, AP2600IFM_KEYS_POLL_INTERVAL, + ARRAY_SIZE(ap2600ifm_gpio_keys), + ap2600ifm_gpio_keys); + + ath79_register_pci(); + + ath79_register_mdio(0, 0); + + mdiobus_register_board_info(ap2600ifm_mdio0_info, + ARRAY_SIZE(ap2600ifm_mdio0_info)); + + ap2600ifm_get_mac("macaddr=", ath79_eth0_data.mac_addr); + + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(20); + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_pll_data.pll_1000 = 0x00110000; + ath79_eth0_pll_data.pll_100 = 0x0001099; + ath79_eth0_pll_data.pll_10 = 0x00991099; + + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_MASELINK_AP2600IFM, "AP2600IFM", "Comba MASELink AP2600-IFM", + ap2600ifm_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c new file mode 100644 index 000000000..9b9e23faf --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c @@ -0,0 +1,143 @@ +/* + * Mercury MW316R v1 + * + * Copyright (C) 2014 Matthias Schiffer + * Copyright (C) 2017 Weijie Gao + * + * 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 +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "dev-usb.h" +#include "machtypes.h" + +#define MW316RV1_GPIO_LED_SYS 13 +#define MW316RV1_GPIO_LED_WAN 4 +#define MW316RV1_GPIO_LED_LAN1 11 +#define MW316RV1_GPIO_LED_LAN2 14 +#define MW316RV1_GPIO_LED_LAN3 15 +#define MW316RV1_GPIO_LED_LAN4 16 +#define MW316RV1_GPIO_LED_TURBO 17 + +#define MW316RV1_GPIO_BTN_RESET 12 +#define MW316RV1_GPIO_BTN_TURBO 1 + +#define MW316RV1_KEYS_POLL_INTERVAL 20 /* msecs */ +#define MW316RV1_KEYS_DEBOUNCE_INTERVAL (3 * MW316RV1_KEYS_POLL_INTERVAL) + +static const char *mw316r_v1_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data mw316r_v1_flash_data = { + .part_probes = mw316r_v1_part_probes, +}; + +static struct gpio_led mw316r_v1_leds_gpio[] __initdata = { + { + .name = "mercury:green:wan", + .gpio = MW316RV1_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "mercury:green:lan1", + .gpio = MW316RV1_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "mercury:green:lan2", + .gpio = MW316RV1_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "mercury:green:lan3", + .gpio = MW316RV1_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "mercury:green:lan4", + .gpio = MW316RV1_GPIO_LED_LAN4, + .active_low = 1, + }, { + .name = "mercury:green:system", + .gpio = MW316RV1_GPIO_LED_SYS, + .active_low = 1, + }, { + .name = "mercury:green:turbo", + .gpio = MW316RV1_GPIO_LED_TURBO, + .active_low = 1, + }, +}; + +static struct gpio_keys_button mw316r_v1_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = MW316RV1_KEYS_DEBOUNCE_INTERVAL, + .gpio = MW316RV1_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "turbo", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = MW316RV1_KEYS_DEBOUNCE_INTERVAL, + .gpio = MW316RV1_GPIO_BTN_TURBO, + .active_low = 1, + } +}; + + +static void __init mw316r_v1_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + u8 tmpmac[ETH_ALEN]; + + ath79_register_m25p80(&mw316r_v1_flash_data); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(mw316r_v1_leds_gpio), + mw316r_v1_leds_gpio); + + ath79_register_gpio_keys_polled(1, MW316RV1_KEYS_POLL_INTERVAL, + ARRAY_SIZE(mw316r_v1_gpio_keys), + mw316r_v1_gpio_keys); + + ath79_setup_ar933x_phy4_switch(false, false); + + ath79_register_mdio(0, 0x0); + + /* WAN */ + ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + ath79_register_eth(0); + + /* LAN */ + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); + ath79_register_eth(1); + + ath79_init_mac(tmpmac, mac, 1); + ath79_register_wmac(ee, tmpmac); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_MW316R_V1, "MW316R-v1", "Mercury MW316R v1", + mw316r_v1_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c new file mode 100644 index 000000000..742da3ba3 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c @@ -0,0 +1,116 @@ +/* + * GRENTECH SGR-W500-EBI(FIT) v3.0 board support + * + * Copyright (c) 2017 Weijie Gao + * + * 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 +#include +#include + +#include +#include + +#include "pci.h" +#include "common.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 "machtypes.h" + +#define GRENTECH_GPIO_LED_STATUS 5 +#define GRENTECH_GPIO_LED_WAN 4 +#define GRENTECH_GPIO_LED_WLAN 3 + +#define GRENTECH_GPIO_BUTTON_RESET 8 + +#define GRENTECH_KEYS_POLL_INTERVAL 20 /* msecs */ +#define GRENTECH_KEYS_DEBOUNCE_INTERVAL (3 * GRENTECH_KEYS_POLL_INTERVAL) + +static struct gpio_led grentech_leds_gpio[] __initdata = { + { + .name = "grentech:green:status", + .gpio = GRENTECH_GPIO_LED_STATUS, + .active_low = 1, + }, + { + .name = "grentech:green:wan", + .gpio = GRENTECH_GPIO_LED_WAN, + .active_low = 0, + }, + { + .name = "grentech:green:wlan", + .gpio = GRENTECH_GPIO_LED_WLAN, + .active_low = 0, + } +}; + +static struct gpio_keys_button grentech_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = GRENTECH_KEYS_DEBOUNCE_INTERVAL, + .gpio = GRENTECH_GPIO_BUTTON_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info grentech_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 1, + }, +}; + +static void __init grentech_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(grentech_leds_gpio), + grentech_leds_gpio); + ath79_register_gpio_keys_polled(-1, GRENTECH_KEYS_POLL_INTERVAL, + ARRAY_SIZE(grentech_gpio_keys), + grentech_gpio_keys); + + ath79_register_pci(); + + ath79_register_mdio(0, 0); + + mdiobus_register_board_info(grentech_mdio0_info, + ARRAY_SIZE(grentech_mdio0_info)); + + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); + + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; + ath79_eth0_data.phy_mask = BIT(1); + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_pll_data.pll_1000 = 0x00110000; + ath79_eth0_pll_data.pll_100 = 0x0001099; + ath79_eth0_pll_data.pll_10 = 0x00991099; + + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_SGR_W500_EBI_FIT_V3, "SGRW500EBIFITV3", "GRENTECH SGR-W500-EBI(FIT) v3.0", + grentech_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 8d9b6b080..cc6227737 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -127,6 +127,9 @@ enum ath79_mach_type { ATH79_MACH_JWAP230, /* jjPlus JWAP230 */ ATH79_MACH_LIMA, /* 8devices Lima */ ATH79_MACH_MC_MAC1200R, /* MERCURY MAC1200R */ + ATH79_MACH_MW316R_V1, /* Mercury MW316R v1 */ + ATH79_MACH_MASELINK_AP2600I, /* Comba MASELink AP2600-I */ + ATH79_MACH_MASELINK_AP2600IFM, /* Comba MASELink AP2600-IFM */ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ @@ -204,6 +207,7 @@ enum ath79_mach_type { ATH79_MACH_SC300M, /* Abicom SC300M */ ATH79_MACH_SC450, /* Abicom SC450 */ ATH79_MACH_SGR_W500_N85B_V2, /* GRENTECH SGR-W500-N85B v2 */ + ATH79_MACH_SGR_W500_EBI_FIT_V3, /* GRENTECH SGR-W500-EBI(FIT) v3.0 */ ATH79_MACH_SMART_300, /* NC-LINK SMART-300 */ ATH79_MACH_SOM9331, /* OpenEmbed SOM9331 */ ATH79_MACH_SR3200, /* YunCore SR3200 */ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 3c5fcc3f3..1d64ef45e 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -597,6 +597,15 @@ define Device/mc-mac1200r endef TARGET_DEVICES += mc-mac1200r +define Device/mw316r-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := Mercury MW316R v1 + BOARDNAME := MW316R-v1 + DEVICE_PROFILE := MW316R + TPLINK_HWID := 0x03160001 +endef +TARGET_DEVICES += mw316r-v1 + define Device/minibox-v1 $(Device/tplink-16mlzma) DEVICE_TITLE := Gainstrong MiniBox V1.0 diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/legacy-devices.mk index 5c37229e7..d6bc505eb 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/legacy-devices.mk @@ -591,7 +591,25 @@ endef LEGACY_DEVICES += NBG_460N_550N_550NH define LegacyDevice/SGRW500N85BV2 - DEVICE_TITLE := GRENTECH SGR-W500-N85b v2.0 board - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage + DEVICE_TITLE := GRENTECH SGR-W500-N85b v2.0 board + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage endef LEGACY_DEVICES += SGRW500N85BV2 + +define LegacyDevice/SGRW500EBIFITV3 + DEVICE_TITLE := GRENTECH SGR-W500-EBI(FIT) v3.0 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage +endef +LEGACY_DEVICES += SGRW500EBIFITV3 + +define LegacyDevice/AP2600I + DEVICE_TITLE := Comba MASELink AP2600-I board + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage +endef +LEGACY_DEVICES += AP2600I + +define LegacyDevice/AP2600IFM + DEVICE_TITLE := Comba MASELink AP2600-IFM board + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage +endef +LEGACY_DEVICES += AP2600IFM diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index f358b63e7..3069d4a30 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -275,6 +275,7 @@ wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(ca 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_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi) +ap2600ifm_256kblk_mtdlayout=mtdparts=spi0.0:256k(breed)ro,256k(breed-env)ro,1536k(kernel),14336k(rootfs),15872k@0x80000(firmware) define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(VMLINUX).elf @@ -1005,6 +1006,9 @@ $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,tt $(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N)) $(eval $(call SingleProfile,AthLzma,64k,SGRW500N85BV2,sgr-w500-n85b-v2,SGRW500N85BV2,ttyS0,115200,$$(ap147_mtdlayout),RKuImage)) +$(eval $(call SingleProfile,AthLzma,64k,SGRW500EBIFITV3,sgr-w500-ebi-fit-v3,SGRW500EBIFITV3,ttyS0,115200,$$(ap96_mtdlayout),RKuImage)) +$(eval $(call SingleProfile,AthLzma,64k,AP2600I,maselink-ap2600i,AP2600I,ttyS0,115200,$$(ap147_mtdlayout),RKuImage)) +$(eval $(call SingleProfile,AthLzma,256k,AP2600IFM,maselink-ap2600ifm,AP2600IFM,ttyS0,115200,$$(ap2600ifm_256kblk_mtdlayout) ahbskip=1,KRuImage)) endif # ifeq ($(SUBTARGET),generic) From f3ede8db8a9c512450305a5d59cebeeb0bcf2590 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 28 Nov 2017 22:59:15 +0800 Subject: [PATCH 24/95] fix RT-ACRH17 dts support --- .../ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch index bab280878..7124ff065 100644 --- a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch @@ -10,13 +10,14 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -618,7 +618,18 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -618,7 +618,19 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8084-mtp.dtb \ qcom-ipq4019-ap.dk01.1-c1.dtb \ qcom-ipq4019-ap.dk04.1-c1.dtb \ + qcom-ipq4019-fritz4040.dtb \ + qcom-ipq4019-nbg6617.dtb \ + qcom-ipq4019-rt-ac58u.dtb \ ++ qcom-ipq4019-rt-acrh17.dtb \ qcom-ipq8064-ap148.dtb \ + qcom-ipq8064-c2600.dtb \ + qcom-ipq8064-d7800.dtb \ From 98760ec8713915c6040ca998eaa594c811128cb2 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 29 Nov 2017 21:17:19 +0800 Subject: [PATCH 25/95] fix AC58U can't working --- ...-cpu-operating-points-for-cpufreq-su.patch | 6 +- ...018-qcom-ipq4019-turn-on-DMA-for-i2c.patch | 2 +- ...4019-use-correct-clock-for-i2c-bus-0.patch | 2 +- ...0020-qcom-ipq4019-enable-DMA-for-spi.patch | 2 +- .../0022-dts-ipq4019-support-ARMv7-PMU.patch | 2 +- .../0065-arm-override-compiler-flags.patch | 2 +- .../0069-arm-boot-add-dts-files.patch | 4 +- ...pq4019-add-remaining-pin-definitions.patch | 516 +++++++ ...-support-to-configure-ipq40xx-GPIO_P.patch | 149 ++ .../140-qcom-ipq4019-fix-i2c_0-node.patch | 28 + .../141-qcom-ipq4019-add-second-i2c.patch | 46 + ...use-v2-of-the-kpss-bringup-mechanism.patch | 10 +- ...-USB-nodes-to-ipq4019-SoC-device-tre.patch | 2 +- ...-both-IPQ4019-wifi-block-definitions.patch | 170 ++- ...9-add-pseudo-random-number-generator.patch | 2 +- ...11-dts-ARM-qcom-ipq4019-add-scm-node.patch | 25 + .../312-firmware-qcom-scm-fuse-access.patch | 98 ++ .../701-dts-ipq4019-add-mdio-node.patch | 2 +- ...702-dts-ipq4019-add-PHY-switch-nodes.patch | 2 +- ...ts-ipq4019-add-ethernet-essedma-node.patch | 6 +- ...712-net-essedma-disable-default-vlan.patch | 69 + ...19-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch | 71 +- ...ctrl-Updated-various-Pin-definitions.patch | 1328 ----------------- ...support-to-configure-ipq40xx-GPIO_PU.patch | 236 --- ...q4019-add-nand-and-qpic-bam-dma-node.patch | 70 +- ...-2-dts-ipq4019-Fix-pinctrl-node-name.patch | 44 - ...-Move-xo-and-timer-nodes-to-SoC-dtsi.patch | 78 - ...pq4019-ap-dk04-fix-pinctrl-node-name.patch | 11 - ...19-ap-dk04-remove-xo-and-timer-nodes.patch | 27 - ...4019-ap-dk01-add-tcsr-config-to-dtsi.patch | 42 - ...19-ap-dk01-add-network-nodes-to-dtsi.patch | 32 - ...-dk01-remove-spi-chip-node-from-dtsi.patch | 17 - ...864-06-dts-ipq4019-fix-max-cpu-speed.patch | 13 - ...9-ap-dk01.1-c1-add-spi-and-ram-nodes.patch | 115 -- ...9-ap-dk01.1-c1-add-compatible-string.patch | 10 - 35 files changed, 1137 insertions(+), 2102 deletions(-) create mode 100644 target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch create mode 100644 target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch create mode 100644 target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch create mode 100644 target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch create mode 100644 target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch create mode 100644 target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch create mode 100644 target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch delete mode 100644 target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch delete mode 100644 target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch delete mode 100644 target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch diff --git a/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch b/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch index 7cbd6a455..5aeb93cdc 100644 --- a/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch +++ b/target/linux/ipq806x/patches-4.9/0017-qcom-ipq4019-add-cpu-operating-points-for-cpufreq-su.patch @@ -45,7 +45,7 @@ Signed-off-by: Matthew McClintock }; cpu@3 { -@@ -81,6 +76,29 @@ +@@ -81,6 +76,33 @@ reg = <0x3>; clocks = <&gcc GCC_APPS_CLK_SRC>; clock-frequency = <0>; @@ -71,6 +71,10 @@ Signed-off-by: Matthew McClintock + }; + opp@666000000 { + opp-hz = /bits/ 64 <666000000>; ++ clock-latency-ns = <256000>; ++ }; ++ opp@717000000 { ++ opp-hz = /bits/ 64 <717000000>; + clock-latency-ns = <256000>; }; }; diff --git a/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch b/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch index 42bb4a6e3..a580610b2 100644 --- a/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch +++ b/target/linux/ipq806x/patches-4.9/0018-qcom-ipq4019-turn-on-DMA-for-i2c.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -179,6 +179,8 @@ +@@ -183,6 +183,8 @@ clock-names = "iface", "core"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch b/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch index 54ee571cb..64878e2c0 100644 --- a/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch +++ b/target/linux/ipq806x/patches-4.9/0019-qcom-ipq4019-use-correct-clock-for-i2c-bus-0.patch @@ -17,7 +17,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -175,7 +175,7 @@ +@@ -179,7 +179,7 @@ reg = <0x78b7000 0x6000>; interrupts = ; clocks = <&gcc GCC_BLSP1_AHB_CLK>, diff --git a/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch b/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch index c1fa5c729..b5a533502 100644 --- a/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch +++ b/target/linux/ipq806x/patches-4.9/0020-qcom-ipq4019-enable-DMA-for-spi.patch @@ -12,7 +12,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -167,6 +167,8 @@ +@@ -171,6 +171,8 @@ clock-names = "core", "iface"; #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch b/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch index c427d66ef..2acfdcf29 100644 --- a/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch +++ b/target/linux/ipq806x/patches-4.9/0022-dts-ipq4019-support-ARMv7-PMU.patch @@ -13,7 +13,7 @@ Signed-off-by: Matthew McClintock --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -108,6 +108,12 @@ +@@ -112,6 +112,12 @@ IRQ_TYPE_LEVEL_HIGH)>; }; diff --git a/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch b/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch index e5af7ffa2..dd40f1371 100644 --- a/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch +++ b/target/linux/ipq806x/patches-4.9/0065-arm-override-compiler-flags.patch @@ -15,7 +15,7 @@ Signed-off-by: John Crispin # testing for a specific architecture or later rather impossible. arch-$(CONFIG_CPU_32v7M) =-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m -arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a) -+arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 ++arch-$(CONFIG_CPU_32v7) =-D__LINUX_ARM_ARCH__=7 -mcpu=cortex-a15 -mtune=cortex-a15 arch-$(CONFIG_CPU_32v6) =-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) # Only override the compiler option if ARMv6. The ARMv6K extensions are # always available in ARMv7 diff --git a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch index 7124ff065..ea9e67278 100644 --- a/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch +++ b/target/linux/ipq806x/patches-4.9/0069-arm-boot-add-dts-files.patch @@ -5,8 +5,8 @@ Subject: [PATCH 69/69] arm: boot: add dts files Signed-off-by: John Crispin --- - arch/arm/boot/dts/Makefile | 8 ++++++++ - 1 file changed, 8 insertions(+) + arch/arm/boot/dts/Makefile | 9 ++++++++ + 1 file changed, 9 insertions(+) --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile diff --git a/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch b/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch new file mode 100644 index 000000000..f3ffc2e2c --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/131-pinctrl-qcom-ipq4019-add-remaining-pin-definitions.patch @@ -0,0 +1,516 @@ +From 941e3869bdeddb2bebcc52ebfd57efe014887bc6 Mon Sep 17 00:00:00 2001 +Message-Id: <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> +In-Reply-To: +References: +From: Ram Chandra Jangir +Date: Wed, 10 May 2017 12:51:51 +0200 +Subject: [PATCH v3 2/3] pinctrl: qcom: ipq4019: add most remaining pin + definitions +To: linux-gpio@vger.kernel.org, + devicetree@vger.kernel.org +Cc: Linus Walleij , + Rob Herring , + Mark Rutland + +This patch adds multiple pinctrl functions and mappings +for SDIO, NAND, I2S, WIFI, PCIE, LEDs, etc... that have +been missing from the current minimal version. + +This patch has been updated from the original version +that was posted by Ram Chandra Jangir on the LEDE-DEV ML: +. A short +summary of the changes are documented in the device-tree +patch of this series: +"dt-bindings: pinctrl: add most other IPQ4019 pin functions and groups" + +Cc: Bjorn Andersson +Cc: John Crispin +Signed-off-by: Ram Chandra Jangir +Signed-off-by: Christian Lamparter +--- + drivers/pinctrl/qcom/pinctrl-ipq4019.c | 431 ++++++++++++++++++++++++++------- + 1 file changed, 346 insertions(+), 85 deletions(-) + +diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +index 743d1f458205..9e7f23d29cda 100644 +--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c ++++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +@@ -277,12 +277,49 @@ DECLARE_QCA_GPIO_PINS(99); + + enum ipq4019_functions { + qca_mux_gpio, +- qca_mux_blsp_uart1, ++ qca_mux_aud_pin, ++ qca_mux_audio_pwm, + qca_mux_blsp_i2c0, + qca_mux_blsp_i2c1, +- qca_mux_blsp_uart0, +- qca_mux_blsp_spi1, + qca_mux_blsp_spi0, ++ qca_mux_blsp_spi1, ++ qca_mux_blsp_uart0, ++ qca_mux_blsp_uart1, ++ qca_mux_chip_rst, ++ qca_mux_i2s_rx, ++ qca_mux_i2s_spdif_in, ++ qca_mux_i2s_spdif_out, ++ qca_mux_i2s_td, ++ qca_mux_i2s_tx, ++ qca_mux_jtag, ++ qca_mux_led0, ++ qca_mux_led1, ++ qca_mux_led2, ++ qca_mux_led3, ++ qca_mux_led4, ++ qca_mux_led5, ++ qca_mux_led6, ++ qca_mux_led7, ++ qca_mux_led8, ++ qca_mux_led9, ++ qca_mux_led10, ++ qca_mux_led11, ++ qca_mux_mdc, ++ qca_mux_mdio, ++ qca_mux_pcie, ++ qca_mux_pmu, ++ qca_mux_prng_rosc, ++ qca_mux_qpic, ++ qca_mux_rgmii, ++ qca_mux_rmii, ++ qca_mux_sdio, ++ qca_mux_smart0, ++ qca_mux_smart1, ++ qca_mux_smart2, ++ qca_mux_smart3, ++ qca_mux_tm, ++ qca_mux_wifi0, ++ qca_mux_wifi1, + qca_mux_NA, + }; + +@@ -303,108 +340,331 @@ static const char * const gpio_groups[] = { + "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", + "gpio99", + }; +- +-static const char * const blsp_uart1_groups[] = { +- "gpio8", "gpio9", "gpio10", "gpio11", ++static const char * const aud_pin_groups[] = { ++ "gpio48", "gpio49", "gpio50", "gpio51", ++}; ++static const char * const audio_pwm_groups[] = { ++ "gpio30", "gpio31", "gpio32", "gpio33", "gpio64", "gpio65", "gpio66", ++ "gpio67", + }; + static const char * const blsp_i2c0_groups[] = { + "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59", + }; +-static const char * const blsp_spi0_groups[] = { +- "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", +- "gpio54", "gpio55", "gpio56", "gpio57", +-}; + static const char * const blsp_i2c1_groups[] = { + "gpio12", "gpio13", "gpio34", "gpio35", + }; +-static const char * const blsp_uart0_groups[] = { +- "gpio16", "gpio17", "gpio60", "gpio61", ++static const char * const blsp_spi0_groups[] = { ++ "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", "gpio54", "gpio55", ++ "gpio56", "gpio57", + }; + static const char * const blsp_spi1_groups[] = { + "gpio44", "gpio45", "gpio46", "gpio47", + }; ++static const char * const blsp_uart0_groups[] = { ++ "gpio16", "gpio17", "gpio60", "gpio61", ++}; ++static const char * const blsp_uart1_groups[] = { ++ "gpio8", "gpio9", "gpio10", "gpio11", ++}; ++static const char * const chip_rst_groups[] = { ++ "gpio62", ++}; ++static const char * const i2s_rx_groups[] = { ++ "gpio0", "gpio1", "gpio2", "gpio20", "gpio21", "gpio22", "gpio23", ++ "gpio58", "gpio60", "gpio61", "gpio63", ++}; ++static const char * const i2s_spdif_in_groups[] = { ++ "gpio34", "gpio59", "gpio63", ++}; ++static const char * const i2s_spdif_out_groups[] = { ++ "gpio35", "gpio62", "gpio63", ++}; ++static const char * const i2s_td_groups[] = { ++ "gpio27", "gpio28", "gpio29", "gpio54", "gpio55", "gpio56", "gpio63", ++}; ++static const char * const i2s_tx_groups[] = { ++ "gpio24", "gpio25", "gpio26", "gpio52", "gpio53", "gpio57", "gpio60", ++ "gpio61", ++}; ++static const char * const jtag_groups[] = { ++ "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", ++}; ++static const char * const led0_groups[] = { ++ "gpio16", "gpio36", "gpio60", ++}; ++static const char * const led1_groups[] = { ++ "gpio17", "gpio37", "gpio61", ++}; ++static const char * const led2_groups[] = { ++ "gpio36", "gpio38", "gpio58", ++}; ++static const char * const led3_groups[] = { ++ "gpio39", ++}; ++static const char * const led4_groups[] = { ++ "gpio40", ++}; ++static const char * const led5_groups[] = { ++ "gpio44", ++}; ++static const char * const led6_groups[] = { ++ "gpio45", ++}; ++static const char * const led7_groups[] = { ++ "gpio46", ++}; ++static const char * const led8_groups[] = { ++ "gpio47", ++}; ++static const char * const led9_groups[] = { ++ "gpio48", ++}; ++static const char * const led10_groups[] = { ++ "gpio49", ++}; ++static const char * const led11_groups[] = { ++ "gpio50", ++}; ++static const char * const mdc_groups[] = { ++ "gpio7", "gpio52", ++}; ++static const char * const mdio_groups[] = { ++ "gpio6", "gpio53", ++}; ++static const char * const pcie_groups[] = { ++ "gpio39", "gpio52", ++}; ++static const char * const pmu_groups[] = { ++ "gpio54", "gpio55", ++}; ++static const char * const prng_rosc_groups[] = { ++ "gpio53", ++}; ++static const char * const qpic_groups[] = { ++ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", ++ "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", "gpio64", "gpio65", ++ "gpio66", "gpio67", "gpio68", "gpio69", ++}; ++static const char * const rgmii_groups[] = { ++ "gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", ++ "gpio29", "gpio30", "gpio31", "gpio32", "gpio33", ++}; ++static const char * const rmii_groups[] = { ++ "gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", ++ "gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49", ++ "gpio50", "gpio51", ++}; ++static const char * const sdio_groups[] = { ++ "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28", "gpio29", ++ "gpio30", "gpio31", "gpio32", ++}; ++static const char * const smart0_groups[] = { ++ "gpio0", "gpio1", "gpio2", "gpio5", "gpio44", "gpio45", "gpio46", ++ "gpio47", ++}; ++static const char * const smart1_groups[] = { ++ "gpio8", "gpio9", "gpio16", "gpio17", "gpio58", "gpio59", "gpio60", ++ "gpio61", ++}; ++static const char * const smart2_groups[] = { ++ "gpio40", "gpio41", "gpio48", "gpio49", ++}; ++static const char * const smart3_groups[] = { ++ "gpio58", "gpio59", "gpio60", "gpio61", ++}; ++static const char * const tm_groups[] = { ++ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio57", "gpio58", ++ "gpio59", "gpio60", "gpio61", "gpio62", "gpio63", ++}; ++static const char * const wifi0_groups[] = { ++ "gpio37", "gpio40", "gpio41", "gpio42", "gpio50", "gpio51", "gpio52", ++ "gpio53", "gpio56", "gpio57", "gpio58", "gpio98", ++}; ++static const char * const wifi1_groups[] = { ++ "gpio37", "gpio40", "gpio41", "gpio43", "gpio50", "gpio51", "gpio52", ++ "gpio53", "gpio56", "gpio57", "gpio58", "gpio98", ++}; + + static const struct msm_function ipq4019_functions[] = { +- FUNCTION(gpio), +- FUNCTION(blsp_uart1), ++ FUNCTION(aud_pin), ++ FUNCTION(audio_pwm), + FUNCTION(blsp_i2c0), + FUNCTION(blsp_i2c1), +- FUNCTION(blsp_uart0), +- FUNCTION(blsp_spi1), + FUNCTION(blsp_spi0), ++ FUNCTION(blsp_spi1), ++ FUNCTION(blsp_uart0), ++ FUNCTION(blsp_uart1), ++ FUNCTION(chip_rst), ++ FUNCTION(gpio), ++ FUNCTION(i2s_rx), ++ FUNCTION(i2s_spdif_in), ++ FUNCTION(i2s_spdif_out), ++ FUNCTION(i2s_td), ++ FUNCTION(i2s_tx), ++ FUNCTION(jtag), ++ FUNCTION(led0), ++ FUNCTION(led1), ++ FUNCTION(led2), ++ FUNCTION(led3), ++ FUNCTION(led4), ++ FUNCTION(led5), ++ FUNCTION(led6), ++ FUNCTION(led7), ++ FUNCTION(led8), ++ FUNCTION(led9), ++ FUNCTION(led10), ++ FUNCTION(led11), ++ FUNCTION(mdc), ++ FUNCTION(mdio), ++ FUNCTION(pcie), ++ FUNCTION(pmu), ++ FUNCTION(prng_rosc), ++ FUNCTION(qpic), ++ FUNCTION(rgmii), ++ FUNCTION(rmii), ++ FUNCTION(sdio), ++ FUNCTION(smart0), ++ FUNCTION(smart1), ++ FUNCTION(smart2), ++ FUNCTION(smart3), ++ FUNCTION(tm), ++ FUNCTION(wifi0), ++ FUNCTION(wifi1), + }; + + static const struct msm_pingroup ipq4019_groups[] = { +- PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(8, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(9, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(16, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(17, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(0, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(1, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(2, jtag, smart0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(3, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(4, jtag, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(5, jtag, smart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(6, mdio, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(7, mdc, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(8, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(9, blsp_uart1, NA, NA, smart1, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(16, blsp_uart0, led0, smart1, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(17, blsp_uart0, led1, smart1, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), + PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(20, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(21, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(22, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(23, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(24, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(25, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(27, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(28, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(29, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(34, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(35, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(44, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(45, NA, blsp_spi1, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(46, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(47, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(54, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(55, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(56, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(57, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(58, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(59, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(60, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(61, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(20, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(21, blsp_i2c0, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(22, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(23, sdio, rgmii, i2s_rx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(24, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(25, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(26, sdio, rgmii, i2s_tx, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(27, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(28, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(29, sdio, rgmii, i2s_td, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(30, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(31, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(32, sdio, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(33, rgmii, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(34, blsp_i2c1, i2s_spdif_in, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(35, blsp_i2c1, i2s_spdif_out, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(36, rmii, led2, led0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(37, rmii, wifi0, wifi1, led1, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(38, rmii, led2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(39, rmii, pcie, led3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(40, rmii, wifi0, wifi1, smart2, led4, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(41, rmii, wifi0, wifi1, smart2, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(42, rmii, wifi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(43, rmii, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), ++ PINGROUP(44, rmii, blsp_spi1, smart0, led5, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(45, rmii, blsp_spi1, blsp_spi0, smart0, led6, NA, NA, NA, NA, ++ NA, NA, NA, NA, NA), ++ PINGROUP(46, rmii, blsp_spi1, smart0, led7, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(47, rmii, blsp_spi1, smart0, led8, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(48, rmii, aud_pin, smart2, led9, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(49, rmii, aud_pin, smart2, led10, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(50, rmii, aud_pin, wifi0, wifi1, led11, NA, NA, NA, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(51, rmii, aud_pin, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA, NA), ++ PINGROUP(52, qpic, mdc, pcie, i2s_tx, NA, NA, NA, tm, wifi0, wifi1, NA, ++ NA, NA, NA), ++ PINGROUP(53, qpic, mdio, i2s_tx, prng_rosc, NA, tm, wifi0, wifi1, NA, ++ NA, NA, NA, NA, NA), ++ PINGROUP(54, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA, ++ NA, NA, NA), ++ PINGROUP(55, qpic, blsp_spi0, i2s_td, NA, pmu, NA, NA, NA, tm, NA, NA, ++ NA, NA, NA), ++ PINGROUP(56, qpic, blsp_spi0, i2s_td, NA, NA, tm, wifi0, wifi1, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(57, qpic, blsp_spi0, i2s_tx, NA, NA, tm, wifi0, wifi1, NA, NA, ++ NA, NA, NA, NA), ++ PINGROUP(58, qpic, led2, blsp_i2c0, smart3, smart1, i2s_rx, NA, NA, tm, ++ wifi0, wifi1, NA, NA, NA), ++ PINGROUP(59, qpic, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA, NA, NA, ++ NA, NA, tm, NA, NA, NA), ++ PINGROUP(60, qpic, blsp_uart0, smart1, smart3, led0, i2s_tx, i2s_rx, ++ NA, NA, NA, NA, NA, tm, NA), ++ PINGROUP(61, qpic, blsp_uart0, smart1, smart3, led1, i2s_tx, i2s_rx, ++ NA, NA, NA, NA, NA, tm, NA), ++ PINGROUP(62, qpic, chip_rst, NA, NA, i2s_spdif_out, NA, NA, NA, NA, NA, ++ tm, NA, NA, NA), ++ PINGROUP(63, qpic, NA, NA, NA, i2s_td, i2s_rx, i2s_spdif_out, ++ i2s_spdif_in, NA, NA, NA, NA, tm, NA), ++ PINGROUP(64, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(65, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(66, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(67, qpic, audio_pwm, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA, NA), ++ PINGROUP(68, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(69, qpic, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +@@ -433,7 +693,8 @@ static const struct msm_pingroup ipq4019_groups[] = { + PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), +- PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), ++ PINGROUP(98, wifi0, wifi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, ++ NA), + PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), + }; + +-- +2.13.2 + diff --git a/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch b/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch new file mode 100644 index 000000000..f05ea750b --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/132-pinctrl-qcom-add-support-to-configure-ipq40xx-GPIO_P.patch @@ -0,0 +1,149 @@ +From 895bbe5061fe2a6825503f57263a4eff9bb78a3c Mon Sep 17 00:00:00 2001 +Message-Id: <895bbe5061fe2a6825503f57263a4eff9bb78a3c.1500038134.git.chunkeey@googlemail.com> +In-Reply-To: <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> +References: + <941e3869bdeddb2bebcc52ebfd57efe014887bc6.1500038134.git.chunkeey@googlemail.com> +From: Ram Chandra Jangir +Date: Sun, 4 Jun 2017 21:38:21 +0200 +Subject: [PATCH v3 3/3] pinctrl: msm: add support to configure ipq40xx + GPIO_PULL bits +To: linux-gpio@vger.kernel.org, + devicetree@vger.kernel.org +Cc: Linus Walleij , + Rob Herring , + Mark Rutland + +GPIO_PULL bits configurations in TLMM_GPIO_CFG register +differs for IPQ40xx from rest of the other qcom SoCs. +As it does not support the keeper state and therefore can't +support bias-bus-hold property. + +This patch adds a pull_no_keeper setting which configures the +msm_gpio_pull bits for ipq40xx. This is required to fix the +proper configurations of gpio-pull bits for nand pins mux. + +IPQ40xx SoC: +2'b10: Internal pull up enable. +2'b11: Unsupport + +For other SoC's: +2'b10: Keeper +2'b11: Pull-Up + +Note: Due to pull_no_keeper length, all kerneldoc entries +in the msm_pinctrl_soc_data struct had to be realigned. + +Reviewed-by: Bjorn Andersson +Signed-off-by: Ram Chandra Jangir +Signed-off-by: Christian Lamparter +--- + drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1 + + drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++------ + drivers/pinctrl/qcom/pinctrl-msm.h | 16 +++++++++------- + 3 files changed, 29 insertions(+), 13 deletions(-) + +diff --git a/drivers/pinctrl/qcom/pinctrl-ipq4019.c b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +index 9e7f23d29cda..1979b14b6fc3 100644 +--- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c ++++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c +@@ -706,6 +706,7 @@ static const struct msm_pinctrl_soc_data ipq4019_pinctrl = { + .groups = ipq4019_groups, + .ngroups = ARRAY_SIZE(ipq4019_groups), + .ngpios = 100, ++ .pull_no_keeper = true, + }; + + static int ipq4019_pinctrl_probe(struct platform_device *pdev) +diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c +index 273badd92561..e5e27d79f5ef 100644 +--- a/drivers/pinctrl/qcom/pinctrl-msm.c ++++ b/drivers/pinctrl/qcom/pinctrl-msm.c +@@ -202,10 +202,11 @@ static int msm_config_reg(struct msm_pinctrl *pctrl, + return 0; + } + +-#define MSM_NO_PULL 0 +-#define MSM_PULL_DOWN 1 +-#define MSM_KEEPER 2 +-#define MSM_PULL_UP 3 ++#define MSM_NO_PULL 0 ++#define MSM_PULL_DOWN 1 ++#define MSM_KEEPER 2 ++#define MSM_PULL_UP_NO_KEEPER 2 ++#define MSM_PULL_UP 3 + + static unsigned msm_regval_to_drive(u32 val) + { +@@ -243,10 +244,16 @@ static int msm_config_group_get(struct pinctrl_dev *pctldev, + arg = arg == MSM_PULL_DOWN; + break; + case PIN_CONFIG_BIAS_BUS_HOLD: ++ if (pctrl->soc->pull_no_keeper) ++ return -ENOTSUPP; ++ + arg = arg == MSM_KEEPER; + break; + case PIN_CONFIG_BIAS_PULL_UP: +- arg = arg == MSM_PULL_UP; ++ if (pctrl->soc->pull_no_keeper) ++ arg = arg == MSM_PULL_UP_NO_KEEPER; ++ else ++ arg = arg == MSM_PULL_UP; + break; + case PIN_CONFIG_DRIVE_STRENGTH: + arg = msm_regval_to_drive(arg); +@@ -309,10 +316,16 @@ static int msm_config_group_set(struct pinctrl_dev *pctldev, + arg = MSM_PULL_DOWN; + break; + case PIN_CONFIG_BIAS_BUS_HOLD: ++ if (pctrl->soc->pull_no_keeper) ++ return -ENOTSUPP; ++ + arg = MSM_KEEPER; + break; + case PIN_CONFIG_BIAS_PULL_UP: +- arg = MSM_PULL_UP; ++ if (pctrl->soc->pull_no_keeper) ++ arg = MSM_PULL_UP_NO_KEEPER; ++ else ++ arg = MSM_PULL_UP; + break; + case PIN_CONFIG_DRIVE_STRENGTH: + /* Check for invalid values */ +diff --git a/drivers/pinctrl/qcom/pinctrl-msm.h b/drivers/pinctrl/qcom/pinctrl-msm.h +index 54fdd04ce9d5..9b9feea540ff 100644 +--- a/drivers/pinctrl/qcom/pinctrl-msm.h ++++ b/drivers/pinctrl/qcom/pinctrl-msm.h +@@ -99,13 +99,14 @@ struct msm_pingroup { + + /** + * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration +- * @pins: An array describing all pins the pin controller affects. +- * @npins: The number of entries in @pins. +- * @functions: An array describing all mux functions the SoC supports. +- * @nfunctions: The number of entries in @functions. +- * @groups: An array describing all pin groups the pin SoC supports. +- * @ngroups: The numbmer of entries in @groups. +- * @ngpio: The number of pingroups the driver should expose as GPIOs. ++ * @pins: An array describing all pins the pin controller affects. ++ * @npins: The number of entries in @pins. ++ * @functions: An array describing all mux functions the SoC supports. ++ * @nfunctions: The number of entries in @functions. ++ * @groups: An array describing all pin groups the pin SoC supports. ++ * @ngroups: The numbmer of entries in @groups. ++ * @ngpio: The number of pingroups the driver should expose as GPIOs. ++ * @pull_no_keeper: The SoC does not support keeper bias. + */ + struct msm_pinctrl_soc_data { + const struct pinctrl_pin_desc *pins; +@@ -115,6 +116,7 @@ struct msm_pinctrl_soc_data { + const struct msm_pingroup *groups; + unsigned ngroups; + unsigned ngpios; ++ bool pull_no_keeper; + }; + + int msm_pinctrl_probe(struct platform_device *pdev, +-- +2.13.2 + diff --git a/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch b/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch new file mode 100644 index 000000000..041d8961d --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/140-qcom-ipq4019-fix-i2c_0-node.patch @@ -0,0 +1,28 @@ +From 830a63791185f4daaecb8d1102c4ee3c9210c03c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Mon, 1 May 2017 13:42:41 +0200 +Subject: [PATCH 1/2] qcom: ipq4019: fix i2c_0 node + +This patch fixes two typos in the i2c_0 node for the ipq4019. +The register size is just 0x600. The core clock is +GCC_BLSP1_QUP1_I2C_APPS_CLK. GCC_BLSP1_QUP2_I2C_APPS_CLK is +used by the second i2c. + +Fixes: e76b4284b520ba3 ("qcom: ipq4019: add i2c node to ipq4019 SoC and DK01 device tree") + +Signed-off-by: Christian Lamparter +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -184,7 +184,7 @@ + + i2c_0: i2c@78b7000 { + compatible = "qcom,i2c-qup-v2.2.1"; +- reg = <0x78b7000 0x6000>; ++ reg = <0x78b7000 0x600>; + interrupts = ; + clocks = <&gcc GCC_BLSP1_AHB_CLK>, + <&gcc GCC_BLSP1_QUP1_I2C_APPS_CLK>; diff --git a/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch b/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch new file mode 100644 index 000000000..5f98cc909 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/141-qcom-ipq4019-add-second-i2c.patch @@ -0,0 +1,46 @@ +From 5110346bcc17b037edd5b0193f31ad046e6242db Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Mon, 1 May 2017 13:53:07 +0200 +Subject: [PATCH 2/2] qcom: ipq4019: add second i2c + +This patch adds the second i2c block to the IPQ4019 platform. +The second i2c has been successfully tested on the +Cisco Meraki MR33. + +Cc: Chris Blake +Cc: Matthew McClintock +Signed-off-by: Christian Lamparter +--- + arch/arm/boot/dts/qcom-ipq4019.dtsi | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -26,6 +26,7 @@ + aliases { + spi0 = &spi_0; + i2c0 = &i2c_0; ++ i2c1 = &i2c_1; + }; + + cpus { +@@ -196,6 +197,19 @@ + status = "disabled"; + }; + ++ i2c_1: i2c@78b8000 { ++ compatible = "qcom,i2c-qup-v2.2.1"; ++ reg = <0x78b8000 0x600>; ++ interrupts = ; ++ clocks = <&gcc GCC_BLSP1_AHB_CLK>, ++ <&gcc GCC_BLSP1_QUP2_I2C_APPS_CLK>; ++ clock-names = "iface", "core"; ++ dmas = <&blsp_dma 11>, <&blsp_dma 10>; ++ dma-names = "rx", "tx"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ status = "disabled"; ++ }; + + cryptobam: dma@8e04000 { + compatible = "qcom,bam-v1.7.0"; diff --git a/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch b/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch index 560eee7d2..d34f5d1f9 100644 --- a/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch +++ b/target/linux/ipq806x/patches-4.9/305-qcom-ipq4019-use-v2-of-the-kpss-bringup-mechanism.patch @@ -17,7 +17,7 @@ Changes: --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -34,19 +34,27 @@ +@@ -35,19 +35,27 @@ cpu@0 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -47,7 +47,7 @@ Changes: qcom,acc = <&acc1>; qcom,saw = <&saw1>; reg = <0x1>; -@@ -58,7 +66,8 @@ +@@ -59,7 +67,8 @@ cpu@2 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -57,7 +57,7 @@ Changes: qcom,acc = <&acc2>; qcom,saw = <&saw2>; reg = <0x2>; -@@ -70,7 +79,8 @@ +@@ -71,7 +80,8 @@ cpu@3 { device_type = "cpu"; compatible = "arm,cortex-a7"; @@ -67,7 +67,7 @@ Changes: qcom,acc = <&acc3>; qcom,saw = <&saw3>; reg = <0x3>; -@@ -218,22 +228,22 @@ +@@ -236,22 +246,22 @@ }; acc0: clock-controller@b088000 { @@ -94,7 +94,7 @@ Changes: reg = <0x0b0b8000 0x1000>, <0xb008000 0x1000>; }; -@@ -261,6 +271,12 @@ +@@ -279,6 +289,12 @@ regulator; }; diff --git a/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch b/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch index b780d7881..22ea75299 100644 --- a/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch +++ b/target/linux/ipq806x/patches-4.9/306-qcom-ipq4019-add-USB-nodes-to-ipq4019-SoC-device-tre.patch @@ -51,7 +51,7 @@ Changes: }; --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -313,5 +313,76 @@ +@@ -331,5 +331,76 @@ compatible = "qcom,pshold"; reg = <0x4ab000 0x4>; }; diff --git a/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch b/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch index ad7ce1673..4b2f6c8dd 100644 --- a/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch +++ b/target/linux/ipq806x/patches-4.9/308-dts-ipq4019-add-both-IPQ4019-wifi-block-definitions.patch @@ -1,57 +1,100 @@ -From 6091a49b0b06bf838fed80498c4f5f40d0fbd447 Mon Sep 17 00:00:00 2001 +From 45e183ad169db4e233ce8337cf8b735545151f0e Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Sat, 19 Nov 2016 01:22:46 +0100 -Subject: [PATCH] dts: ipq4019: add both IPQ4019 wifi block definitions +Subject: [PATCH] arm: dts: qcom: add both IPQ4019 wifi blocks -The IPQ4019 has two ath10k blocks on the AHB. Both wifi's -are already supported by ath10k. +This patch adds and enables the device-tree definitions for +both qcom,ipq4019-wifi blocks for the IPQ4019. -Signed-off-by: Christian Lamparter +Support for these have been added into the ath10k driver since: +280e762e9c72 ("ath10k: enable ipq4019 device probe in ahb module") + +The binding documentation was added in commit: +a47aaa69de88 ("dt: bindings: add new dt entry for pre calibration in qcom, ath10k.txt") + +This has been tested on an ASUS RT-AC58U (IPQ4019), +an AVM Fritz!Box 4040 (IPQ4018), a Compex WPJ428(IPQ4028) +and a Meraki MR33 (IPQ4029). + +| a000000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff [...] +| a000000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1 +| a000000.wifi: firmware ver 10.4-3.4-00082 api 5 features no-p2p,mfp,[...] +| a000000.wifi: board_file api 2 bmi_id 0:16 crc32 5773b188 +| a000000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file [...] +... +| a800000.wifi: qca4019 hw1.0 target 0x01000000 chip_id 0x003b00ff sub 0000:0000 +| a800000.wifi: kconfig debug 0 debugfs 1 tracing 0 dfs 1 testmode 1 +| a800000.wifi: firmware ver 10.4-3.4-00082 api 5 features no-p2p, [...] +| a800000.wifi: board_file api 2 bmi_id 0:17 crc32 5773b188 +| a800000.wifi: htt-ver 2.2 wmi-op 6 htt-op 4 cal pre-cal-file [...] + +Signed-off-by: Christian Lamparter --- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 84 +++++++++++++++++++++++++++++++++++++ - 1 file changed, 84 insertions(+) + arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 8 +++ + arch/arm/boot/dts/qcom-ipq4019.dtsi | 84 +++++++++++++++++++++++++++ + 2 files changed, 92 insertions(+) +diff --git a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +index c25d8f5c669d..cfa0c9970d5b 100644 +--- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi +@@ -112,5 +112,13 @@ + watchdog@b017000 { + status = "ok"; + }; ++ ++ wifi@a000000 { ++ status = "ok"; ++ }; ++ ++ wifi@a800000 { ++ status = "ok"; ++ }; + }; + }; +diff --git a/arch/arm/boot/dts/qcom-ipq4019.dtsi b/arch/arm/boot/dts/qcom-ipq4019.dtsi +index d1a56331ce96..1ddcc96b510c 100644 --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -384,5 +384,89 @@ - dr_mode = "host"; - }; +@@ -291,5 +291,89 @@ + compatible = "qcom,pshold"; + reg = <0x4ab000 0x4>; }; + + wifi0: wifi@a000000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa000000 0x200000>; -+ resets = <&gcc WIFI0_CPU_INIT_RESET -+ &gcc WIFI0_RADIO_SRIF_RESET -+ &gcc WIFI0_RADIO_WARM_RESET -+ &gcc WIFI0_RADIO_COLD_RESET -+ &gcc WIFI0_CORE_WARM_RESET -+ &gcc WIFI0_CORE_COLD_RESET>; ++ resets = <&gcc WIFI0_CPU_INIT_RESET>, ++ <&gcc WIFI0_RADIO_SRIF_RESET>, ++ <&gcc WIFI0_RADIO_WARM_RESET>, ++ <&gcc WIFI0_RADIO_COLD_RESET>, ++ <&gcc WIFI0_CORE_WARM_RESET>, ++ <&gcc WIFI0_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; -+ clocks = <&gcc GCC_WCSS2G_CLK -+ &gcc GCC_WCSS2G_REF_CLK -+ &gcc GCC_WCSS2G_RTC_CLK>; ++ clocks = <&gcc GCC_WCSS2G_CLK>, ++ <&gcc GCC_WCSS2G_REF_CLK>, ++ <&gcc GCC_WCSS2G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; -+ interrupts = <0 32 IRQ_TYPE_EDGE_RISING -+ 0 33 IRQ_TYPE_EDGE_RISING -+ 0 34 IRQ_TYPE_EDGE_RISING -+ 0 35 IRQ_TYPE_EDGE_RISING -+ 0 36 IRQ_TYPE_EDGE_RISING -+ 0 37 IRQ_TYPE_EDGE_RISING -+ 0 38 IRQ_TYPE_EDGE_RISING -+ 0 39 IRQ_TYPE_EDGE_RISING -+ 0 40 IRQ_TYPE_EDGE_RISING -+ 0 41 IRQ_TYPE_EDGE_RISING -+ 0 42 IRQ_TYPE_EDGE_RISING -+ 0 43 IRQ_TYPE_EDGE_RISING -+ 0 44 IRQ_TYPE_EDGE_RISING -+ 0 45 IRQ_TYPE_EDGE_RISING -+ 0 46 IRQ_TYPE_EDGE_RISING -+ 0 47 IRQ_TYPE_EDGE_RISING -+ 0 168 IRQ_TYPE_NONE>; ++ interrupts = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", @@ -63,37 +106,37 @@ Signed-off-by: Christian Lamparter + wifi1: wifi@a800000 { + compatible = "qcom,ipq4019-wifi"; + reg = <0xa800000 0x200000>; -+ resets = <&gcc WIFI1_CPU_INIT_RESET -+ &gcc WIFI1_RADIO_SRIF_RESET -+ &gcc WIFI1_RADIO_WARM_RESET -+ &gcc WIFI1_RADIO_COLD_RESET -+ &gcc WIFI1_CORE_WARM_RESET -+ &gcc WIFI1_CORE_COLD_RESET>; ++ resets = <&gcc WIFI1_CPU_INIT_RESET>, ++ <&gcc WIFI1_RADIO_SRIF_RESET>, ++ <&gcc WIFI1_RADIO_WARM_RESET>, ++ <&gcc WIFI1_RADIO_COLD_RESET>, ++ <&gcc WIFI1_CORE_WARM_RESET>, ++ <&gcc WIFI1_CORE_COLD_RESET>; + reset-names = "wifi_cpu_init", "wifi_radio_srif", + "wifi_radio_warm", "wifi_radio_cold", + "wifi_core_warm", "wifi_core_cold"; -+ clocks = <&gcc GCC_WCSS5G_CLK -+ &gcc GCC_WCSS5G_REF_CLK -+ &gcc GCC_WCSS5G_RTC_CLK>; ++ clocks = <&gcc GCC_WCSS5G_CLK>, ++ <&gcc GCC_WCSS5G_REF_CLK>, ++ <&gcc GCC_WCSS5G_RTC_CLK>; + clock-names = "wifi_wcss_cmd", "wifi_wcss_ref", + "wifi_wcss_rtc"; -+ interrupts = <0 48 IRQ_TYPE_EDGE_RISING -+ 0 49 IRQ_TYPE_EDGE_RISING -+ 0 50 IRQ_TYPE_EDGE_RISING -+ 0 51 IRQ_TYPE_EDGE_RISING -+ 0 52 IRQ_TYPE_EDGE_RISING -+ 0 53 IRQ_TYPE_EDGE_RISING -+ 0 54 IRQ_TYPE_EDGE_RISING -+ 0 55 IRQ_TYPE_EDGE_RISING -+ 0 56 IRQ_TYPE_EDGE_RISING -+ 0 57 IRQ_TYPE_EDGE_RISING -+ 0 58 IRQ_TYPE_EDGE_RISING -+ 0 59 IRQ_TYPE_EDGE_RISING -+ 0 60 IRQ_TYPE_EDGE_RISING -+ 0 61 IRQ_TYPE_EDGE_RISING -+ 0 62 IRQ_TYPE_EDGE_RISING -+ 0 63 IRQ_TYPE_EDGE_RISING -+ 0 169 IRQ_TYPE_NONE>; ++ interrupts = , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ , ++ ; + interrupt-names = "msi0", "msi1", "msi2", "msi3", + "msi4", "msi5", "msi6", "msi7", + "msi8", "msi9", "msi10", "msi11", @@ -103,3 +146,6 @@ Signed-off-by: Christian Lamparter + }; }; }; +-- +2.13.3 + diff --git a/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch b/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch index 8323ff0fa..f53f78073 100644 --- a/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch +++ b/target/linux/ipq806x/patches-4.9/309-dts-ipq4019-add-pseudo-random-number-generator.patch @@ -13,7 +13,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -277,6 +277,13 @@ +@@ -295,6 +295,13 @@ regulator; }; diff --git a/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch b/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch new file mode 100644 index 000000000..7ac157058 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/311-dts-ARM-qcom-ipq4019-add-scm-node.patch @@ -0,0 +1,25 @@ +From: Christian Lamparter +Date: Mon, 20 Mar 2017 18:08:03 +0100 +Subject: [PATCH] dts: ARM: qcom-ipq4019: add scm node + +This patch adds the device-tree node necessary for communicating +with Qualcomm's TrustZone/Secure Execution Environment +implementation. + +Signed-off-by: Christian Lamparter +--- +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -137,6 +137,12 @@ + }; + }; + ++ firmware { ++ scm { ++ compatible = "qcom,scm-ipq4019", "qcom,scm-ipq40xx"; ++ }; ++ }; ++ + soc { + #address-cells = <1>; + #size-cells = <1>; diff --git a/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch b/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch new file mode 100644 index 000000000..df6ecfac7 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/312-firmware-qcom-scm-fuse-access.patch @@ -0,0 +1,98 @@ +--- a/drivers/firmware/qcom_scm-32.c ++++ b/drivers/firmware/qcom_scm-32.c +@@ -578,3 +578,33 @@ int __qcom_scm_pinmux_write(u32 svc_id, + + return ret; + } ++ ++int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val) ++{ ++ __le32 *otp_value; ++ dma_addr_t in; ++ int ret; ++ ++ otp_value = kzalloc(PAGE_ALIGN(sizeof(*otp_value)), GFP_KERNEL); ++ if (!otp_value) ++ return -ENOMEM; ++ ++ in = dma_map_single(dev, otp_value, sizeof(in), DMA_FROM_DEVICE); ++ ++ ret = dma_mapping_error(dev, in); ++ if (ret != 0) { ++ kfree(otp_value); ++ pr_err("DMA Mapping Error %d\n", ret); ++ return ret; ++ } ++ ++ ret = qcom_scm_call(dev, QCOM_SCM_SVC_FUSE, address, ++ &in, sizeof(in), NULL, 0); ++ ++ dma_unmap_single(dev, in, sizeof(in), DMA_FROM_DEVICE); ++ ++ *val = le32_to_cpu(*otp_value); ++ kfree(otp_value); ++ ++ return ret; ++} +--- a/drivers/firmware/qcom_scm.c ++++ b/drivers/firmware/qcom_scm.c +@@ -165,6 +165,25 @@ int qcom_scm_hdcp_req(struct qcom_scm_hd + EXPORT_SYMBOL(qcom_scm_hdcp_req); + + /** ++ * qcom_scm_fuse() - Reads a value from the OTP ++ * @address: address ++ * ++ * Returns the value of the OTP at the specified address. ++ */ ++int qcom_scm_fuse(u32 address, u32 *val) ++{ ++ int ret = qcom_scm_clk_enable(); ++ ++ if (ret) ++ return ret; ++ ++ ret = __qcom_scm_fuse(__scm->dev, address, val); ++ qcom_scm_clk_disable(); ++ return ret; ++} ++EXPORT_SYMBOL(qcom_scm_fuse); ++ ++/** + * qcom_scm_pas_supported() - Check if the peripheral authentication service is + * available for the given peripherial + * @peripheral: peripheral id +--- a/drivers/firmware/qcom_scm.h ++++ b/drivers/firmware/qcom_scm.h +@@ -63,6 +63,9 @@ extern int __qcom_scm_pas_mss_reset(str + s32 __qcom_scm_pinmux_read(u32 svc_id, u32 cmd_id, u32 arg1); + s32 __qcom_scm_pinmux_write(u32 svc_id, u32 cmd_id, u32 arg1, u32 arg2); + ++#define QCOM_SCM_SVC_FUSE 0x8 ++extern int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val); ++ + /* common error codes */ + #define QCOM_SCM_V2_EBUSY -12 + #define QCOM_SCM_ENOMEM -5 +--- a/include/linux/qcom_scm.h ++++ b/include/linux/qcom_scm.h +@@ -48,4 +48,7 @@ extern u32 qcom_scm_get_version(void); + + extern s32 qcom_scm_pinmux_read(u32 arg1); + extern s32 qcom_scm_pinmux_write(u32 arg1, u32 arg2); ++ ++extern int qcom_scm_fuse(u32 address, u32 *val); ++ + #endif +--- a/drivers/firmware/qcom_scm-64.c ++++ b/drivers/firmware/qcom_scm-64.c +@@ -374,3 +374,9 @@ int __qcom_scm_pinmux_write(u32 svc_id, + { + return -ENOTSUPP; + } ++ ++int __qcom_scm_fuse(struct device *dev, u32 address, u32 *val) ++{ ++ *val = -1; ++ return -ENOTSUPP; ++} diff --git a/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch b/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch index d19be2716..546eb3769 100644 --- a/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch +++ b/target/linux/ipq806x/patches-4.9/701-dts-ipq4019-add-mdio-node.patch @@ -15,7 +15,7 @@ so the info might change. --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -321,6 +321,34 @@ +@@ -345,6 +345,34 @@ reg = <0x4ab000 0x4>; }; diff --git a/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch b/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch index b1b18b46d..ee8f459e4 100644 --- a/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch +++ b/target/linux/ipq806x/patches-4.9/702-dts-ipq4019-add-PHY-switch-nodes.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -349,6 +349,29 @@ +@@ -373,6 +373,29 @@ }; }; diff --git a/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch b/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch index ad3c9fc30..afd680d64 100644 --- a/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch +++ b/target/linux/ipq806x/patches-4.9/711-dts-ipq4019-add-ethernet-essedma-node.patch @@ -16,16 +16,16 @@ Signed-off-by: Christian Lamparter --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -26,6 +26,8 @@ - aliases { +@@ -27,6 +27,8 @@ spi0 = &spi_0; i2c0 = &i2c_0; + i2c1 = &i2c_1; + ethernet0 = &gmac0; + ethernet1 = &gmac1; }; cpus { -@@ -372,6 +374,64 @@ +@@ -396,6 +398,64 @@ status = "disabled"; }; diff --git a/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch b/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch new file mode 100644 index 000000000..2a1cade85 --- /dev/null +++ b/target/linux/ipq806x/patches-4.9/712-net-essedma-disable-default-vlan.patch @@ -0,0 +1,69 @@ +From: Christian Lamparter +Subject: [PATCH] net: essedma: disable default vlan tagging +Date: Tue, 21 Mar 13:59:02 CET 2017 +0100 + +The essedma driver has its own unique take on VLAN management +and its configuration. In the original SDK, each VLAN is +assigned one virtual ethernet netdev. + +However, this is non-standard. So, this patch does away +with the default_vlan_tag property the driver is using +and therefore forces the user to use the kernel's vlan +feature. + +This patch also removes the "qcom,poll_required = <1>;" from +the essedma node. + +Signed-off-by: Christian Lamparter +--- +--- a/drivers/net/ethernet/qualcomm/essedma/edma.c ++++ b/drivers/net/ethernet/qualcomm/essedma/edma.c +@@ -715,13 +715,11 @@ static void edma_rx_complete(struct edma + edma_receive_checksum(rd, skb); + + /* Process VLAN HW acceleration indication provided by HW */ +- if (unlikely(adapter->default_vlan_tag != rd->rrd4)) { +- vlan = rd->rrd4; +- if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) +- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); +- else if (rd->rrd1 & EDMA_RRD_SVLAN) +- __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); +- } ++ vlan = rd->rrd4; ++ if (likely(rd->rrd7 & EDMA_RRD_CVLAN)) ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan); ++ else if (rd->rrd1 & EDMA_RRD_SVLAN) ++ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021AD), vlan); + + /* Update rx statistics */ + adapter->stats.rx_packets++; +@@ -1390,8 +1388,6 @@ netdev_tx_t edma_xmit(struct sk_buff *sk + /* Check and mark VLAN tag offload */ + if (skb_vlan_tag_present(skb)) + flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_FLAG; +- else if (adapter->default_vlan_tag) +- flags_transmit |= EDMA_VLAN_TX_TAG_INSERT_DEFAULT_FLAG; + + /* Check and mark checksum offload */ + if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) +--- a/arch/arm/boot/dts/qcom-ipq4019.dtsi ++++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi +@@ -404,8 +404,7 @@ + qcom,page-mode = <0>; + qcom,rx_head_buf_size = <1540>; + qcom,mdio_supported; +- qcom,poll_required = <1>; +- qcom,num_gmac = <2>; ++ qcom,num_gmac = <1>; + interrupts = <0 65 IRQ_TYPE_EDGE_RISING + 0 66 IRQ_TYPE_EDGE_RISING + 0 67 IRQ_TYPE_EDGE_RISING +@@ -443,7 +442,7 @@ + + gmac0: gmac0 { + local-mac-address = [00 00 00 00 00 00]; +- vlan_tag = <1 0x1f>; ++ vlan_tag = <1 0x3f>; + }; + + gmac1: gmac1 { diff --git a/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch b/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch index 3636c5ca0..2aa0448f8 100644 --- a/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch +++ b/target/linux/ipq806x/patches-4.9/820-qcom-ipq4019-Add-IPQ4019-USB-HS-SS-PHY-drivers.patch @@ -291,7 +291,7 @@ Changed: +MODULE_DESCRIPTION("USB3 QCA BALDUR HSPHY driver"); --- /dev/null +++ b/drivers/usb/phy/phy-qca-uniphy.c -@@ -0,0 +1,135 @@ +@@ -0,0 +1,202 @@ +/* Copyright (c) 2015, The Linux Foundation. All rights reserved. + * + * Permission to use, copy, modify, and/or distribute this software for any @@ -318,6 +318,18 @@ Changed: +#include +#include +#include ++#include ++ ++#define USB_CALIBRATION_CMD 0x10 ++#define USB3PHY_SPARE_1 0x7FC ++#define RX_LOS_1 0x7C8 ++#define MISC_SOURCE_REG 0x21c ++#define CDR_CONTROL_REG_1 0x80 ++#define PCS_INTERNAL_CONTROL14 0x364 ++#define MMD1_REG_REG_MASK (0x7F << 8) ++#define OTP_MASK (0x7F << 5) ++#define MMD1_REG_AUTOLOAD_MASK (0x1 << 7) ++#define SPARE_1_BIT14_MASK (0x1 << 14) + +struct qca_uni_ss_phy { + struct usb_phy phy; @@ -338,6 +350,60 @@ Changed: + reset_control_assert(phy->por_rst); +} + ++int qca_uni_ss_phy_usb_los_calibration(void __iomem *base) ++{ ++ int err; ++ uint32_t data, otp_val = 0; ++ ++ /* Get OTP value */ ++ err = qcom_scm_fuse(USB_CALIBRATION_CMD, &otp_val); ++ if (err < 0 || !(otp_val & OTP_MASK)) { ++ pr_err("USB Calibration Failed with error %d %d\n", err, otp_val); ++ return 0; ++ } ++ ++ pr_info("Raw USB3 Calibration value %x\n", otp_val); ++ ++ /* ++ * Read the USB3PHY_SPARE_1 register and ++ * set bit 14 to 0 ++ */ ++ data = readl_relaxed(base + USB3PHY_SPARE_1); ++ data = data & (~SPARE_1_BIT14_MASK); ++ writel(data, base + USB3PHY_SPARE_1); ++ udelay(100); ++ ++ /* ++ * Get bit 11:5 value, add with 0x14 and set to the ++ * register USB3PHY_RX_LOS_1 bit MMD1_REG_REG ++ */ ++ data = readl_relaxed(base + RX_LOS_1); ++ otp_val = ((otp_val & OTP_MASK) >> 5) + 0x14; ++ otp_val = otp_val << 8; ++ data = data & (~MMD1_REG_REG_MASK); ++ data = data | otp_val; ++ writel(data, base + RX_LOS_1); ++ udelay(100); ++ ++ /* ++ * Set bit MMD1_REG_AUTOLOAD_SEL_RX_LOS_THRES in ++ * USB3PHY_RX_LOS_1 to 1 ++ */ ++ data = readl_relaxed(base + RX_LOS_1); ++ data = data | MMD1_REG_AUTOLOAD_MASK; ++ writel(data, base + RX_LOS_1); ++ udelay(100); ++ ++ writel(0x4000, base + PCS_INTERNAL_CONTROL14); ++ udelay(100); ++ writel(0xaa0a, base + MISC_SOURCE_REG); ++ udelay(100); ++ writel(0x0202, base + CDR_CONTROL_REG_1); ++ udelay(100); ++ ++ return 0; ++} ++ +static int qca_uni_ss_phy_init(struct usb_phy *x) +{ + struct qca_uni_ss_phy *phy = phy_to_dw_phy(x); @@ -350,7 +416,8 @@ Changed: + /* deassert SS PHY POR reset */ + reset_control_deassert(phy->por_rst); + -+ return 0; ++ /* USB LOS Calibration */ ++ return qca_uni_ss_phy_usb_los_calibration(phy->base); +} + +static int qca_uni_ss_get_resources(struct platform_device *pdev, diff --git a/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch b/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch deleted file mode 100644 index d0a6a26a5..000000000 --- a/target/linux/ipq806x/patches-4.9/852-ipq4019-pinctrl-Updated-various-Pin-definitions.patch +++ /dev/null @@ -1,1328 +0,0 @@ -From fc6cf61517b8b4ab4678659936fc7572f699d6e7 Mon Sep 17 00:00:00 2001 -From: Ram Chandra Jangir -Date: Tue, 28 Mar 2017 14:00:00 +0530 -Subject: [PATCH] ipq4019: pinctrl: Updated various Pin definitions - -Populate default values for various GPIO functions - -Signed-off-by: Ram Chandra Jangir ---- - drivers/pinctrl/qcom/pinctrl-ipq4019.c | 1189 +++++++++++++++++++++++++++++--- - 1 file changed, 1111 insertions(+), 78 deletions(-) - ---- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -@@ -276,16 +276,531 @@ DECLARE_QCA_GPIO_PINS(99); - - - enum ipq4019_functions { -+ qca_mux_rmii0_refclk, -+ qca_mux_wifi0_rfsilient0, -+ qca_mux_wifi1_rfsilient0, -+ qca_mux_smart2, -+ qca_mux_led4, -+ qca_mux_wifi0_cal, -+ qca_mux_wifi1_cal, -+ qca_mux_wifi_wci0, -+ qca_mux_rmii0_dv, -+ qca_mux_wifi_wci1, -+ qca_mux_rmii1_refclk, -+ qca_mux_blsp_spi1, -+ qca_mux_led5, -+ qca_mux_rmii10, -+ qca_mux_led6, -+ qca_mux_rmii11, -+ qca_mux_led7, -+ qca_mux_rmii1_dv, -+ qca_mux_led8, -+ qca_mux_rmii1_tx, -+ qca_mux_aud_pin, -+ qca_mux_led9, -+ qca_mux_rmii1_rx, -+ qca_mux_led10, -+ qca_mux_wifi0_rfsilient1, -+ qca_mux_wifi1_rfsilient1, -+ qca_mux_led11, -+ qca_mux_boot7, -+ qca_mux_qpic_pad, -+ qca_mux_pcie_clk, -+ qca_mux_tm_clk0, -+ qca_mux_wifi00, -+ qca_mux_wifi10, -+ qca_mux_mdio1, -+ qca_mux_prng_rosc, -+ qca_mux_dbg_out, -+ qca_mux_tm0, -+ qca_mux_wifi01, -+ qca_mux_wifi11, -+ qca_mux_atest_char3, -+ qca_mux_pmu0, -+ qca_mux_boot8, -+ qca_mux_tm1, -+ qca_mux_atest_char2, -+ qca_mux_pmu1, -+ qca_mux_boot9, -+ qca_mux_tm2, -+ qca_mux_atest_char1, -+ qca_mux_tm_ack, -+ qca_mux_wifi03, -+ qca_mux_wifi13, -+ qca_mux_qpic_pad4, -+ qca_mux_atest_char0, -+ qca_mux_tm3, -+ qca_mux_wifi02, -+ qca_mux_wifi12, -+ qca_mux_qpic_pad5, -+ qca_mux_smart3, -+ qca_mux_wcss0_dbg14, -+ qca_mux_tm4, -+ qca_mux_wifi04, -+ qca_mux_wifi14, -+ qca_mux_qpic_pad6, -+ qca_mux_wcss0_dbg15, -+ qca_mux_qdss_tracectl_a, -+ qca_mux_boot18, -+ qca_mux_tm5, -+ qca_mux_qpic_pad7, -+ qca_mux_atest_char, -+ qca_mux_wcss0_dbg4, -+ qca_mux_qdss_traceclk_a, -+ qca_mux_boot19, -+ qca_mux_tm6, -+ qca_mux_wcss0_dbg5, -+ qca_mux_qdss_cti_trig_out_a0, -+ qca_mux_boot14, -+ qca_mux_tm7, -+ qca_mux_chip_rst, -+ qca_mux_wcss0_dbg6, -+ qca_mux_qdss_cti_trig_out_b0, -+ qca_mux_boot11, -+ qca_mux_tm8, -+ qca_mux_wcss0_dbg7, -+ qca_mux_wcss1_dbg7, -+ qca_mux_boot20, -+ qca_mux_tm9, -+ qca_mux_qpic_pad1, -+ qca_mux_wcss0_dbg8, -+ qca_mux_wcss1_dbg8, -+ qca_mux_qpic_pad2, -+ qca_mux_wcss0_dbg9, -+ qca_mux_wcss1_dbg9, -+ qca_mux_qpic_pad3, -+ qca_mux_wcss0_dbg10, -+ qca_mux_wcss1_dbg10, -+ qca_mux_qpic_pad0, -+ qca_mux_wcss0_dbg11, -+ qca_mux_wcss1_dbg11, -+ qca_mux_qpic_pad8, -+ qca_mux_wcss0_dbg12, -+ qca_mux_wcss1_dbg12, -+ qca_mux_wifi034, -+ qca_mux_wifi134, -+ qca_mux_jtag_tdi, - qca_mux_gpio, -+ qca_mux_i2s_rx_bclk, -+ qca_mux_jtag_tck, -+ qca_mux_i2s_rx_fsync, -+ qca_mux_jtag_tms, -+ qca_mux_i2s_rxd, -+ qca_mux_smart0, -+ qca_mux_jtag_tdo, -+ qca_mux_jtag_rst, -+ qca_mux_jtag_trst, -+ qca_mux_mdio0, -+ qca_mux_wcss0_dbg18, -+ qca_mux_wcss1_dbg18, -+ qca_mux_qdss_tracedata_a, -+ qca_mux_mdc, -+ qca_mux_wcss0_dbg19, -+ qca_mux_wcss1_dbg19, - qca_mux_blsp_uart1, -+ qca_mux_wifi0_uart, -+ qca_mux_wifi1_uart, -+ qca_mux_smart1, -+ qca_mux_wcss0_dbg20, -+ qca_mux_wcss1_dbg20, -+ qca_mux_wifi0_uart0, -+ qca_mux_wifi1_uart0, -+ qca_mux_wcss0_dbg21, -+ qca_mux_wcss1_dbg21, - qca_mux_blsp_i2c0, -+ qca_mux_wcss0_dbg22, -+ qca_mux_wcss1_dbg22, -+ qca_mux_wcss0_dbg23, -+ qca_mux_wcss1_dbg23, -+ qca_mux_blsp_spi0, - qca_mux_blsp_i2c1, -+ qca_mux_wcss0_dbg24, -+ qca_mux_wcss1_dbg24, -+ qca_mux_wcss0_dbg25, -+ qca_mux_wcss1_dbg25, -+ qca_mux_wcss0_dbg26, -+ qca_mux_wcss1_dbg26, -+ qca_mux_wcss0_dbg, -+ qca_mux_wcss1_dbg, - qca_mux_blsp_uart0, -- qca_mux_blsp_spi1, -- qca_mux_blsp_spi0, -+ qca_mux_led0, -+ qca_mux_wcss0_dbg28, -+ qca_mux_wcss1_dbg28, -+ qca_mux_led1, -+ qca_mux_wcss0_dbg29, -+ qca_mux_wcss1_dbg29, -+ qca_mux_wifi0_uart1, -+ qca_mux_wifi1_uart1, -+ qca_mux_wcss0_dbg30, -+ qca_mux_wcss1_dbg30, -+ qca_mux_wcss0_dbg31, -+ qca_mux_wcss1_dbg31, -+ qca_mux_i2s_rx_mclk, -+ qca_mux_wcss0_dbg16, -+ qca_mux_wcss1_dbg16, -+ qca_mux_wcss0_dbg17, -+ qca_mux_wcss1_dbg17, -+ qca_mux_rgmii0, -+ qca_mux_sdio0, -+ qca_mux_rgmii1, -+ qca_mux_sdio1, -+ qca_mux_rgmii2, -+ qca_mux_i2s_tx_mclk, -+ qca_mux_sdio2, -+ qca_mux_rgmii3, -+ qca_mux_i2s_tx_bclk, -+ qca_mux_sdio3, -+ qca_mux_rgmii_rx, -+ qca_mux_i2s_tx_fsync, -+ qca_mux_sdio_clk, -+ qca_mux_rgmii_txc, -+ qca_mux_i2s_td1, -+ qca_mux_sdio_cmd, -+ qca_mux_i2s_td2, -+ qca_mux_sdio4, -+ qca_mux_i2s_td3, -+ qca_mux_sdio5, -+ qca_mux_audio_pwm0, -+ qca_mux_sdio6, -+ qca_mux_audio_pwm1, -+ qca_mux_wcss0_dbg27, -+ qca_mux_wcss1_dbg27, -+ qca_mux_sdio7, -+ qca_mux_rgmii_rxc, -+ qca_mux_audio_pwm2, -+ qca_mux_rgmii_tx, -+ qca_mux_audio_pwm3, -+ qca_mux_boot2, -+ qca_mux_i2s_spdif_in, -+ qca_mux_i2s_spdif_out, -+ qca_mux_rmii00, -+ qca_mux_led2, -+ qca_mux_rmii01, -+ qca_mux_wifi0_wci, -+ qca_mux_wifi1_wci, -+ qca_mux_boot4, -+ qca_mux_rmii0_tx, -+ qca_mux_boot5, -+ qca_mux_rmii0_rx, -+ qca_mux_pcie_clk1, -+ qca_mux_led3, -+ qca_mux_sdio_cd, - qca_mux_NA, - }; - -+static const char * const rmii0_refclk_groups[] = { -+ "gpio40", -+}; -+static const char * const wifi0_rfsilient0_groups[] = { -+ "gpio40", -+}; -+static const char * const wifi1_rfsilient0_groups[] = { -+ "gpio40", -+}; -+static const char * const smart2_groups[] = { -+ "gpio40", "gpio41", "gpio48", "gpio49", -+}; -+static const char * const led4_groups[] = { -+ "gpio40", -+}; -+static const char * const wifi0_cal_groups[] = { -+ "gpio41", "gpio51", -+}; -+static const char * const wifi1_cal_groups[] = { -+ "gpio41", "gpio51", -+}; -+static const char * const wifi_wci0_groups[] = { -+ "gpio42", -+}; -+static const char * const rmii0_dv_groups[] = { -+ "gpio43", -+}; -+static const char * const wifi_wci1_groups[] = { -+ "gpio43", -+}; -+static const char * const rmii1_refclk_groups[] = { -+ "gpio44", -+}; -+static const char * const blsp_spi1_groups[] = { -+ "gpio44", "gpio45", "gpio46", "gpio47", -+}; -+static const char * const led5_groups[] = { -+ "gpio44", -+}; -+static const char * const rmii10_groups[] = { -+ "gpio45", "gpio50", -+}; -+static const char * const led6_groups[] = { -+ "gpio45", -+}; -+static const char * const rmii11_groups[] = { -+ "gpio46", "gpio51", -+}; -+static const char * const led7_groups[] = { -+ "gpio46", -+}; -+static const char * const rmii1_dv_groups[] = { -+ "gpio47", -+}; -+static const char * const led8_groups[] = { -+ "gpio47", -+}; -+static const char * const rmii1_tx_groups[] = { -+ "gpio48", -+}; -+static const char * const aud_pin_groups[] = { -+ "gpio48", "gpio49", "gpio50", "gpio51", -+}; -+static const char * const led9_groups[] = { -+ "gpio48", -+}; -+static const char * const rmii1_rx_groups[] = { -+ "gpio49", -+}; -+static const char * const led10_groups[] = { -+ "gpio49", -+}; -+static const char * const wifi0_rfsilient1_groups[] = { -+ "gpio50", -+}; -+static const char * const wifi1_rfsilient1_groups[] = { -+ "gpio50", -+}; -+static const char * const led11_groups[] = { -+ "gpio50", -+}; -+static const char * const boot7_groups[] = { -+ "gpio51", -+}; -+static const char * const qpic_pad_groups[] = { -+ "gpio52", "gpio53", "gpio54", "gpio55", "gpio56", "gpio61", "gpio62", -+ "gpio63", "gpio69", -+}; -+static const char * const pcie_clk_groups[] = { -+ "gpio52", -+}; -+static const char * const tm_clk0_groups[] = { -+ "gpio52", -+}; -+static const char * const wifi00_groups[] = { -+ "gpio52", -+}; -+static const char * const wifi10_groups[] = { -+ "gpio52", -+}; -+static const char * const mdio1_groups[] = { -+ "gpio53", -+}; -+static const char * const prng_rosc_groups[] = { -+ "gpio53", -+}; -+static const char * const dbg_out_groups[] = { -+ "gpio53", -+}; -+static const char * const tm0_groups[] = { -+ "gpio53", -+}; -+static const char * const wifi01_groups[] = { -+ "gpio53", -+}; -+static const char * const wifi11_groups[] = { -+ "gpio53", -+}; -+static const char * const atest_char3_groups[] = { -+ "gpio54", -+}; -+static const char * const pmu0_groups[] = { -+ "gpio54", -+}; -+static const char * const boot8_groups[] = { -+ "gpio54", -+}; -+static const char * const tm1_groups[] = { -+ "gpio54", -+}; -+static const char * const atest_char2_groups[] = { -+ "gpio55", -+}; -+static const char * const pmu1_groups[] = { -+ "gpio55", -+}; -+static const char * const boot9_groups[] = { -+ "gpio55", -+}; -+static const char * const tm2_groups[] = { -+ "gpio55", -+}; -+static const char * const atest_char1_groups[] = { -+ "gpio56", -+}; -+static const char * const tm_ack_groups[] = { -+ "gpio56", -+}; -+static const char * const wifi03_groups[] = { -+ "gpio56", -+}; -+static const char * const wifi13_groups[] = { -+ "gpio56", -+}; -+static const char * const qpic_pad4_groups[] = { -+ "gpio57", -+}; -+static const char * const atest_char0_groups[] = { -+ "gpio57", -+}; -+static const char * const tm3_groups[] = { -+ "gpio57", -+}; -+static const char * const wifi02_groups[] = { -+ "gpio57", -+}; -+static const char * const wifi12_groups[] = { -+ "gpio57", -+}; -+static const char * const qpic_pad5_groups[] = { -+ "gpio58", -+}; -+static const char * const smart3_groups[] = { -+ "gpio58", "gpio59", "gpio60", "gpio61", -+}; -+static const char * const wcss0_dbg14_groups[] = { -+ "gpio58", -+}; -+static const char * const tm4_groups[] = { -+ "gpio58", -+}; -+static const char * const wifi04_groups[] = { -+ "gpio58", -+}; -+static const char * const wifi14_groups[] = { -+ "gpio58", -+}; -+static const char * const qpic_pad6_groups[] = { -+ "gpio59", -+}; -+static const char * const wcss0_dbg15_groups[] = { -+ "gpio59", -+}; -+static const char * const qdss_tracectl_a_groups[] = { -+ "gpio59", -+}; -+static const char * const boot18_groups[] = { -+ "gpio59", -+}; -+static const char * const tm5_groups[] = { -+ "gpio59", -+}; -+static const char * const qpic_pad7_groups[] = { -+ "gpio60", -+}; -+static const char * const atest_char_groups[] = { -+ "gpio60", -+}; -+static const char * const wcss0_dbg4_groups[] = { -+ "gpio60", -+}; -+static const char * const qdss_traceclk_a_groups[] = { -+ "gpio60", -+}; -+static const char * const boot19_groups[] = { -+ "gpio60", -+}; -+static const char * const tm6_groups[] = { -+ "gpio60", -+}; -+static const char * const wcss0_dbg5_groups[] = { -+ "gpio61", -+}; -+static const char * const qdss_cti_trig_out_a0_groups[] = { -+ "gpio61", -+}; -+static const char * const boot14_groups[] = { -+ "gpio61", -+}; -+static const char * const tm7_groups[] = { -+ "gpio61", -+}; -+static const char * const chip_rst_groups[] = { -+ "gpio62", -+}; -+static const char * const wcss0_dbg6_groups[] = { -+ "gpio62", -+}; -+static const char * const qdss_cti_trig_out_b0_groups[] = { -+ "gpio62", -+}; -+static const char * const boot11_groups[] = { -+ "gpio62", -+}; -+static const char * const tm8_groups[] = { -+ "gpio62", -+}; -+static const char * const wcss0_dbg7_groups[] = { -+ "gpio63", -+}; -+static const char * const wcss1_dbg7_groups[] = { -+ "gpio63", -+}; -+static const char * const boot20_groups[] = { -+ "gpio63", -+}; -+static const char * const tm9_groups[] = { -+ "gpio63", -+}; -+static const char * const qpic_pad1_groups[] = { -+ "gpio64", -+}; -+static const char * const wcss0_dbg8_groups[] = { -+ "gpio64", -+}; -+static const char * const wcss1_dbg8_groups[] = { -+ "gpio64", -+}; -+static const char * const qpic_pad2_groups[] = { -+ "gpio65", -+}; -+static const char * const wcss0_dbg9_groups[] = { -+ "gpio65", -+}; -+static const char * const wcss1_dbg9_groups[] = { -+ "gpio65", -+}; -+static const char * const qpic_pad3_groups[] = { -+ "gpio66", -+}; -+static const char * const wcss0_dbg10_groups[] = { -+ "gpio66", -+}; -+static const char * const wcss1_dbg10_groups[] = { -+ "gpio66", -+}; -+static const char * const qpic_pad0_groups[] = { -+ "gpio67", -+}; -+static const char * const wcss0_dbg11_groups[] = { -+ "gpio67", -+}; -+static const char * const wcss1_dbg11_groups[] = { -+ "gpio67", -+}; -+static const char * const qpic_pad8_groups[] = { -+ "gpio68", -+}; -+static const char * const wcss0_dbg12_groups[] = { -+ "gpio68", -+}; -+static const char * const wcss1_dbg12_groups[] = { -+ "gpio68", -+}; -+static const char * const wifi034_groups[] = { -+ "gpio98", -+}; -+static const char * const wifi134_groups[] = { -+ "gpio98", -+}; -+static const char * const jtag_tdi_groups[] = { -+ "gpio0", -+}; - static const char * const gpio_groups[] = { - "gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", - "gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14", -@@ -303,13 +818,103 @@ static const char * const gpio_groups[] - "gpio92", "gpio93", "gpio94", "gpio95", "gpio96", "gpio97", "gpio98", - "gpio99", - }; -- -+static const char * const i2s_rx_bclk_groups[] = { -+ "gpio0", "gpio21", "gpio60", -+}; -+static const char * const jtag_tck_groups[] = { -+ "gpio1", -+}; -+static const char * const i2s_rx_fsync_groups[] = { -+ "gpio1", "gpio22", "gpio61", -+}; -+static const char * const jtag_tms_groups[] = { -+ "gpio2", -+}; -+static const char * const i2s_rxd_groups[] = { -+ "gpio2", "gpio23", "gpio63", -+}; -+static const char * const smart0_groups[] = { -+ "gpio0", "gpio1", "gpio2", "gpio5", "gpio44", "gpio45", "gpio46", -+ "gpio47", -+}; -+static const char * const jtag_tdo_groups[] = { -+ "gpio3", -+}; -+static const char * const jtag_rst_groups[] = { -+ "gpio4", -+}; -+static const char * const jtag_trst_groups[] = { -+ "gpio5", -+}; -+static const char * const mdio0_groups[] = { -+ "gpio6", -+}; -+static const char * const wcss0_dbg18_groups[] = { -+ "gpio6", "gpio22", "gpio39", -+}; -+static const char * const wcss1_dbg18_groups[] = { -+ "gpio6", "gpio22", "gpio39", -+}; -+static const char * const qdss_tracedata_a_groups[] = { -+ "gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11", "gpio16", -+ "gpio17", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42", -+ "gpio43", -+}; -+static const char * const mdc_groups[] = { -+ "gpio7", "gpio52", -+}; -+static const char * const wcss0_dbg19_groups[] = { -+ "gpio7", "gpio23", "gpio40", -+}; -+static const char * const wcss1_dbg19_groups[] = { -+ "gpio7", "gpio23", "gpio40", -+}; - static const char * const blsp_uart1_groups[] = { - "gpio8", "gpio9", "gpio10", "gpio11", - }; -+static const char * const wifi0_uart_groups[] = { -+ "gpio8", "gpio9", "gpio11", "gpio19", "gpio62", -+}; -+static const char * const wifi1_uart_groups[] = { -+ "gpio8", "gpio11", "gpio19", "gpio62", "gpio63", -+}; -+static const char * const smart1_groups[] = { -+ "gpio8", "gpio9", "gpio16", "gpio17", "gpio58", "gpio59", "gpio60", -+ "gpio61", -+}; -+static const char * const wcss0_dbg20_groups[] = { -+ "gpio8", "gpio24", "gpio41", -+}; -+static const char * const wcss1_dbg20_groups[] = { -+ "gpio8", "gpio24", "gpio41", -+}; -+static const char * const wifi0_uart0_groups[] = { -+ "gpio9", "gpio10", -+}; -+static const char * const wifi1_uart0_groups[] = { -+ "gpio9", "gpio10", -+}; -+static const char * const wcss0_dbg21_groups[] = { -+ "gpio9", "gpio25", "gpio42", -+}; -+static const char * const wcss1_dbg21_groups[] = { -+ "gpio9", "gpio25", "gpio42", -+}; - static const char * const blsp_i2c0_groups[] = { - "gpio10", "gpio11", "gpio20", "gpio21", "gpio58", "gpio59", - }; -+static const char * const wcss0_dbg22_groups[] = { -+ "gpio10", "gpio26", "gpio43", -+}; -+static const char * const wcss1_dbg22_groups[] = { -+ "gpio10", "gpio26", "gpio43", -+}; -+static const char * const wcss0_dbg23_groups[] = { -+ "gpio11", "gpio27", "gpio44", -+}; -+static const char * const wcss1_dbg23_groups[] = { -+ "gpio11", "gpio27", "gpio44", -+}; - static const char * const blsp_spi0_groups[] = { - "gpio12", "gpio13", "gpio14", "gpio15", "gpio45", - "gpio54", "gpio55", "gpio56", "gpio57", -@@ -317,94 +922,582 @@ static const char * const blsp_spi0_grou - static const char * const blsp_i2c1_groups[] = { - "gpio12", "gpio13", "gpio34", "gpio35", - }; -+static const char * const wcss0_dbg24_groups[] = { -+ "gpio12", "gpio28", "gpio45", -+}; -+static const char * const wcss1_dbg24_groups[] = { -+ "gpio12", "gpio28", "gpio45", -+}; -+static const char * const wcss0_dbg25_groups[] = { -+ "gpio13", "gpio29", "gpio46", -+}; -+static const char * const wcss1_dbg25_groups[] = { -+ "gpio13", "gpio29", "gpio46", -+}; -+static const char * const wcss0_dbg26_groups[] = { -+ "gpio14", "gpio30", "gpio47", -+}; -+static const char * const wcss1_dbg26_groups[] = { -+ "gpio14", "gpio30", "gpio47", -+}; -+static const char * const wcss0_dbg_groups[] = { -+ "gpio15", "gpio69", -+}; -+static const char * const wcss1_dbg_groups[] = { -+ "gpio15", -+}; - static const char * const blsp_uart0_groups[] = { - "gpio16", "gpio17", "gpio60", "gpio61", - }; --static const char * const blsp_spi1_groups[] = { -- "gpio44", "gpio45", "gpio46", "gpio47", -+static const char * const led0_groups[] = { -+ "gpio16", "gpio36", "gpio60", -+}; -+static const char * const wcss0_dbg28_groups[] = { -+ "gpio16", "gpio32", "gpio49", -+}; -+static const char * const wcss1_dbg28_groups[] = { -+ "gpio16", "gpio32", "gpio49", -+}; -+static const char * const led1_groups[] = { -+ "gpio17", "gpio37", "gpio61", -+}; -+static const char * const wcss0_dbg29_groups[] = { -+ "gpio17", "gpio33", "gpio50", -+}; -+static const char * const wcss1_dbg29_groups[] = { -+ "gpio17", "gpio33", "gpio50", -+}; -+static const char * const wifi0_uart1_groups[] = { -+ "gpio18", "gpio63", -+}; -+static const char * const wifi1_uart1_groups[] = { -+ "gpio18", "gpio63", -+}; -+static const char * const wcss0_dbg30_groups[] = { -+ "gpio18", "gpio34", "gpio51", -+}; -+static const char * const wcss1_dbg30_groups[] = { -+ "gpio18", "gpio34", "gpio51", -+}; -+static const char * const wcss0_dbg31_groups[] = { -+ "gpio19", "gpio35", "gpio52", -+}; -+static const char * const wcss1_dbg31_groups[] = { -+ "gpio19", "gpio35", -+}; -+static const char * const i2s_rx_mclk_groups[] = { -+ "gpio20", "gpio58", -+}; -+static const char * const wcss0_dbg16_groups[] = { -+ "gpio20", "gpio37", -+}; -+static const char * const wcss1_dbg16_groups[] = { -+ "gpio20", "gpio37", -+}; -+static const char * const wcss0_dbg17_groups[] = { -+ "gpio21", "gpio38", -+}; -+static const char * const wcss1_dbg17_groups[] = { -+ "gpio21", "gpio38", -+}; -+static const char * const rgmii0_groups[] = { -+ "gpio22", "gpio28", -+}; -+static const char * const sdio0_groups[] = { -+ "gpio23", -+}; -+static const char * const rgmii1_groups[] = { -+ "gpio23", "gpio29", -+}; -+static const char * const sdio1_groups[] = { -+ "gpio24", -+}; -+static const char * const rgmii2_groups[] = { -+ "gpio24", "gpio30", -+}; -+static const char * const i2s_tx_mclk_groups[] = { -+ "gpio24", "gpio52", -+}; -+static const char * const sdio2_groups[] = { -+ "gpio25", -+}; -+static const char * const rgmii3_groups[] = { -+ "gpio25", "gpio31", -+}; -+static const char * const i2s_tx_bclk_groups[] = { -+ "gpio25", "gpio53", "gpio60", -+}; -+static const char * const sdio3_groups[] = { -+ "gpio26", -+}; -+static const char * const rgmii_rx_groups[] = { -+ "gpio26", -+}; -+static const char * const i2s_tx_fsync_groups[] = { -+ "gpio26", "gpio57", "gpio61", -+}; -+static const char * const sdio_clk_groups[] = { -+ "gpio27", -+}; -+static const char * const rgmii_txc_groups[] = { -+ "gpio27", -+}; -+static const char * const i2s_td1_groups[] = { -+ "gpio27", "gpio54", "gpio63", -+}; -+static const char * const sdio_cmd_groups[] = { -+ "gpio28", -+}; -+static const char * const i2s_td2_groups[] = { -+ "gpio28", "gpio55", -+}; -+static const char * const sdio4_groups[] = { -+ "gpio29", -+}; -+static const char * const i2s_td3_groups[] = { -+ "gpio29", "gpio56", -+}; -+static const char * const sdio5_groups[] = { -+ "gpio30", -+}; -+static const char * const audio_pwm0_groups[] = { -+ "gpio30", "gpio64", -+}; -+static const char * const sdio6_groups[] = { -+ "gpio31", -+}; -+static const char * const audio_pwm1_groups[] = { -+ "gpio31", "gpio65", -+}; -+static const char * const wcss0_dbg27_groups[] = { -+ "gpio31", "gpio48", -+}; -+static const char * const wcss1_dbg27_groups[] = { -+ "gpio31", "gpio48", -+}; -+static const char * const sdio7_groups[] = { -+ "gpio32", -+}; -+static const char * const rgmii_rxc_groups[] = { -+ "gpio32", -+}; -+static const char * const audio_pwm2_groups[] = { -+ "gpio32", "gpio66", -+}; -+static const char * const rgmii_tx_groups[] = { -+ "gpio33", -+}; -+static const char * const audio_pwm3_groups[] = { -+ "gpio33", "gpio67", -+}; -+static const char * const boot2_groups[] = { -+ "gpio33", -+}; -+static const char * const i2s_spdif_in_groups[] = { -+ "gpio34", "gpio59", "gpio63", -+}; -+static const char * const i2s_spdif_out_groups[] = { -+ "gpio35", "gpio62", "gpio63", -+}; -+static const char * const rmii00_groups[] = { -+ "gpio36", "gpio41", -+}; -+static const char * const led2_groups[] = { -+ "gpio36", "gpio38", "gpio58", -+}; -+static const char * const rmii01_groups[] = { -+ "gpio37", "gpio42", -+}; -+static const char * const wifi0_wci_groups[] = { -+ "gpio37", -+}; -+static const char * const wifi1_wci_groups[] = { -+ "gpio37", -+}; -+static const char * const boot4_groups[] = { -+ "gpio37", -+}; -+static const char * const rmii0_tx_groups[] = { -+ "gpio38", -+}; -+static const char * const boot5_groups[] = { -+ "gpio38", -+}; -+static const char * const rmii0_rx_groups[] = { -+ "gpio39", -+}; -+static const char * const pcie_clk1_groups[] = { -+ "gpio39", -+}; -+static const char * const led3_groups[] = { -+ "gpio39", -+}; -+static const char * const sdio_cd_groups[] = { -+ "gpio22", - }; - - static const struct msm_function ipq4019_functions[] = { -+ FUNCTION(rmii0_refclk), -+ FUNCTION(wifi0_rfsilient0), -+ FUNCTION(wifi1_rfsilient0), -+ FUNCTION(smart2), -+ FUNCTION(led4), -+ FUNCTION(wifi0_cal), -+ FUNCTION(wifi1_cal), -+ FUNCTION(wifi_wci0), -+ FUNCTION(rmii0_dv), -+ FUNCTION(wifi_wci1), -+ FUNCTION(rmii1_refclk), -+ FUNCTION(blsp_spi1), -+ FUNCTION(led5), -+ FUNCTION(rmii10), -+ FUNCTION(led6), -+ FUNCTION(rmii11), -+ FUNCTION(led7), -+ FUNCTION(rmii1_dv), -+ FUNCTION(led8), -+ FUNCTION(rmii1_tx), -+ FUNCTION(aud_pin), -+ FUNCTION(led9), -+ FUNCTION(rmii1_rx), -+ FUNCTION(led10), -+ FUNCTION(wifi0_rfsilient1), -+ FUNCTION(wifi1_rfsilient1), -+ FUNCTION(led11), -+ FUNCTION(boot7), -+ FUNCTION(qpic_pad), -+ FUNCTION(pcie_clk), -+ FUNCTION(tm_clk0), -+ FUNCTION(wifi00), -+ FUNCTION(wifi10), -+ FUNCTION(mdio1), -+ FUNCTION(prng_rosc), -+ FUNCTION(dbg_out), -+ FUNCTION(tm0), -+ FUNCTION(wifi01), -+ FUNCTION(wifi11), -+ FUNCTION(atest_char3), -+ FUNCTION(pmu0), -+ FUNCTION(boot8), -+ FUNCTION(tm1), -+ FUNCTION(atest_char2), -+ FUNCTION(pmu1), -+ FUNCTION(boot9), -+ FUNCTION(tm2), -+ FUNCTION(atest_char1), -+ FUNCTION(tm_ack), -+ FUNCTION(wifi03), -+ FUNCTION(wifi13), -+ FUNCTION(qpic_pad4), -+ FUNCTION(atest_char0), -+ FUNCTION(tm3), -+ FUNCTION(wifi02), -+ FUNCTION(wifi12), -+ FUNCTION(qpic_pad5), -+ FUNCTION(smart3), -+ FUNCTION(wcss0_dbg14), -+ FUNCTION(tm4), -+ FUNCTION(wifi04), -+ FUNCTION(wifi14), -+ FUNCTION(qpic_pad6), -+ FUNCTION(wcss0_dbg15), -+ FUNCTION(qdss_tracectl_a), -+ FUNCTION(boot18), -+ FUNCTION(tm5), -+ FUNCTION(qpic_pad7), -+ FUNCTION(atest_char), -+ FUNCTION(wcss0_dbg4), -+ FUNCTION(qdss_traceclk_a), -+ FUNCTION(boot19), -+ FUNCTION(tm6), -+ FUNCTION(wcss0_dbg5), -+ FUNCTION(qdss_cti_trig_out_a0), -+ FUNCTION(boot14), -+ FUNCTION(tm7), -+ FUNCTION(chip_rst), -+ FUNCTION(wcss0_dbg6), -+ FUNCTION(qdss_cti_trig_out_b0), -+ FUNCTION(boot11), -+ FUNCTION(tm8), -+ FUNCTION(wcss0_dbg7), -+ FUNCTION(wcss1_dbg7), -+ FUNCTION(boot20), -+ FUNCTION(tm9), -+ FUNCTION(qpic_pad1), -+ FUNCTION(wcss0_dbg8), -+ FUNCTION(wcss1_dbg8), -+ FUNCTION(qpic_pad2), -+ FUNCTION(wcss0_dbg9), -+ FUNCTION(wcss1_dbg9), -+ FUNCTION(qpic_pad3), -+ FUNCTION(wcss0_dbg10), -+ FUNCTION(wcss1_dbg10), -+ FUNCTION(qpic_pad0), -+ FUNCTION(wcss0_dbg11), -+ FUNCTION(wcss1_dbg11), -+ FUNCTION(qpic_pad8), -+ FUNCTION(wcss0_dbg12), -+ FUNCTION(wcss1_dbg12), -+ FUNCTION(wifi034), -+ FUNCTION(wifi134), -+ FUNCTION(jtag_tdi), - FUNCTION(gpio), -+ FUNCTION(i2s_rx_bclk), -+ FUNCTION(jtag_tck), -+ FUNCTION(i2s_rx_fsync), -+ FUNCTION(jtag_tms), -+ FUNCTION(i2s_rxd), -+ FUNCTION(smart0), -+ FUNCTION(jtag_tdo), -+ FUNCTION(jtag_rst), -+ FUNCTION(jtag_trst), -+ FUNCTION(mdio0), -+ FUNCTION(wcss0_dbg18), -+ FUNCTION(wcss1_dbg18), -+ FUNCTION(qdss_tracedata_a), -+ FUNCTION(mdc), -+ FUNCTION(wcss0_dbg19), -+ FUNCTION(wcss1_dbg19), - FUNCTION(blsp_uart1), -+ FUNCTION(wifi0_uart), -+ FUNCTION(wifi1_uart), -+ FUNCTION(smart1), -+ FUNCTION(wcss0_dbg20), -+ FUNCTION(wcss1_dbg20), -+ FUNCTION(wifi0_uart0), -+ FUNCTION(wifi1_uart0), -+ FUNCTION(wcss0_dbg21), -+ FUNCTION(wcss1_dbg21), - FUNCTION(blsp_i2c0), -+ FUNCTION(wcss0_dbg22), -+ FUNCTION(wcss1_dbg22), -+ FUNCTION(wcss0_dbg23), -+ FUNCTION(wcss1_dbg23), -+ FUNCTION(blsp_spi0), - FUNCTION(blsp_i2c1), -+ FUNCTION(wcss0_dbg24), -+ FUNCTION(wcss1_dbg24), -+ FUNCTION(wcss0_dbg25), -+ FUNCTION(wcss1_dbg25), -+ FUNCTION(wcss0_dbg26), -+ FUNCTION(wcss1_dbg26), -+ FUNCTION(wcss0_dbg), -+ FUNCTION(wcss1_dbg), - FUNCTION(blsp_uart0), -- FUNCTION(blsp_spi1), -- FUNCTION(blsp_spi0), -+ FUNCTION(led0), -+ FUNCTION(wcss0_dbg28), -+ FUNCTION(wcss1_dbg28), -+ FUNCTION(led1), -+ FUNCTION(wcss0_dbg29), -+ FUNCTION(wcss1_dbg29), -+ FUNCTION(wifi0_uart1), -+ FUNCTION(wifi1_uart1), -+ FUNCTION(wcss0_dbg30), -+ FUNCTION(wcss1_dbg30), -+ FUNCTION(wcss0_dbg31), -+ FUNCTION(wcss1_dbg31), -+ FUNCTION(i2s_rx_mclk), -+ FUNCTION(wcss0_dbg16), -+ FUNCTION(wcss1_dbg16), -+ FUNCTION(wcss0_dbg17), -+ FUNCTION(wcss1_dbg17), -+ FUNCTION(rgmii0), -+ FUNCTION(sdio0), -+ FUNCTION(rgmii1), -+ FUNCTION(sdio1), -+ FUNCTION(rgmii2), -+ FUNCTION(i2s_tx_mclk), -+ FUNCTION(sdio2), -+ FUNCTION(rgmii3), -+ FUNCTION(i2s_tx_bclk), -+ FUNCTION(sdio3), -+ FUNCTION(rgmii_rx), -+ FUNCTION(i2s_tx_fsync), -+ FUNCTION(sdio_clk), -+ FUNCTION(rgmii_txc), -+ FUNCTION(i2s_td1), -+ FUNCTION(sdio_cmd), -+ FUNCTION(i2s_td2), -+ FUNCTION(sdio4), -+ FUNCTION(i2s_td3), -+ FUNCTION(sdio5), -+ FUNCTION(audio_pwm0), -+ FUNCTION(sdio6), -+ FUNCTION(audio_pwm1), -+ FUNCTION(wcss0_dbg27), -+ FUNCTION(wcss1_dbg27), -+ FUNCTION(sdio7), -+ FUNCTION(rgmii_rxc), -+ FUNCTION(audio_pwm2), -+ FUNCTION(rgmii_tx), -+ FUNCTION(audio_pwm3), -+ FUNCTION(boot2), -+ FUNCTION(i2s_spdif_in), -+ FUNCTION(i2s_spdif_out), -+ FUNCTION(rmii00), -+ FUNCTION(led2), -+ FUNCTION(rmii01), -+ FUNCTION(wifi0_wci), -+ FUNCTION(wifi1_wci), -+ FUNCTION(boot4), -+ FUNCTION(rmii0_tx), -+ FUNCTION(boot5), -+ FUNCTION(rmii0_rx), -+ FUNCTION(pcie_clk1), -+ FUNCTION(led3), -+ FUNCTION(sdio_cd), - }; - - static const struct msm_pingroup ipq4019_groups[] = { -- PINGROUP(0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(2, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(3, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(4, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(5, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(6, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(7, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(8, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(9, blsp_uart1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(10, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(11, blsp_uart1, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(12, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(13, blsp_spi0, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(14, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(15, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(16, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(17, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(18, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(19, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(20, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(21, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(22, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(23, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(24, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(25, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(26, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(27, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(28, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(29, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(30, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(31, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(32, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(33, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(34, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(35, blsp_i2c1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(36, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(37, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(38, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(39, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(40, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(41, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(42, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(43, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(44, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(45, NA, blsp_spi1, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(46, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(47, NA, blsp_spi1, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(48, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(49, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(50, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(51, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(52, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(53, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(54, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(55, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(56, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(57, NA, blsp_spi0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(58, NA, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(59, NA, blsp_i2c0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(60, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(61, NA, blsp_uart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(62, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(63, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(64, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(65, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(66, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(67, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(68, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(69, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(0, jtag_tdi, smart0, i2s_rx_bclk, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(1, jtag_tck, smart0, i2s_rx_fsync, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA), -+ PINGROUP(2, jtag_tms, smart0, i2s_rxd, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), -+ PINGROUP(3, jtag_tdo, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(4, jtag_rst, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA), -+ PINGROUP(5, jtag_trst, smart0, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(6, mdio0, NA, wcss0_dbg18, wcss1_dbg18, NA, qdss_tracedata_a, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(7, mdc, NA, wcss0_dbg19, wcss1_dbg19, NA, qdss_tracedata_a, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(8, blsp_uart1, wifi0_uart, wifi1_uart, smart1, NA, -+ wcss0_dbg20, wcss1_dbg20, NA, qdss_tracedata_a, NA, NA, NA, -+ NA, NA), -+ PINGROUP(9, blsp_uart1, wifi0_uart0, wifi1_uart0, smart1, wifi0_uart, -+ NA, wcss0_dbg21, wcss1_dbg21, NA, qdss_tracedata_a, NA, NA, -+ NA, NA), -+ PINGROUP(10, blsp_uart1, wifi0_uart0, wifi1_uart0, blsp_i2c0, NA, -+ wcss0_dbg22, wcss1_dbg22, NA, qdss_tracedata_a, NA, NA, NA, -+ NA, NA), -+ PINGROUP(11, blsp_uart1, wifi0_uart, wifi1_uart, blsp_i2c0, NA, -+ wcss0_dbg23, wcss1_dbg23, NA, qdss_tracedata_a, NA, NA, NA, -+ NA, NA), -+ PINGROUP(12, blsp_spi0, blsp_i2c1, NA, wcss0_dbg24, wcss1_dbg24, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(13, blsp_spi0, blsp_i2c1, NA, wcss0_dbg25, wcss1_dbg25, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(14, blsp_spi0, NA, wcss0_dbg26, wcss1_dbg26, NA, NA, NA, NA, -+ NA, NA, NA, NA, NA, NA), -+ PINGROUP(15, blsp_spi0, NA, wcss0_dbg, wcss1_dbg, NA, NA, NA, NA, NA, -+ NA, NA, NA, NA, NA), -+ PINGROUP(16, blsp_uart0, led0, smart1, NA, wcss0_dbg28, wcss1_dbg28, -+ NA, qdss_tracedata_a, NA, NA, NA, NA, NA, NA), -+ PINGROUP(17, blsp_uart0, led1, smart1, NA, wcss0_dbg29, wcss1_dbg29, -+ NA, qdss_tracedata_a, NA, NA, NA, NA, NA, NA), -+ PINGROUP(18, wifi0_uart1, wifi1_uart1, NA, wcss0_dbg30, wcss1_dbg30, -+ NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(19, wifi0_uart, wifi1_uart, NA, wcss0_dbg31, wcss1_dbg31, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(20, blsp_i2c0, i2s_rx_mclk, NA, wcss0_dbg16, wcss1_dbg16, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(21, blsp_i2c0, i2s_rx_bclk, NA, wcss0_dbg17, wcss1_dbg17, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(22, rgmii0, i2s_rx_fsync, NA, wcss0_dbg18, wcss1_dbg18, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(23, sdio0, rgmii1, i2s_rxd, NA, wcss0_dbg19, wcss1_dbg19, NA, -+ NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(24, sdio1, rgmii2, i2s_tx_mclk, NA, wcss0_dbg20, wcss1_dbg20, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(25, sdio2, rgmii3, i2s_tx_bclk, NA, wcss0_dbg21, wcss1_dbg21, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(26, sdio3, rgmii_rx, i2s_tx_fsync, NA, wcss0_dbg22, -+ wcss1_dbg22, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(27, sdio_clk, rgmii_txc, i2s_td1, NA, wcss0_dbg23, -+ wcss1_dbg23, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(28, sdio_cmd, rgmii0, i2s_td2, NA, wcss0_dbg24, wcss1_dbg24, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(29, sdio4, rgmii1, i2s_td3, NA, wcss0_dbg25, wcss1_dbg25, NA, -+ NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(30, sdio5, rgmii2, audio_pwm0, NA, wcss0_dbg26, wcss1_dbg26, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(31, sdio6, rgmii3, audio_pwm1, NA, wcss0_dbg27, wcss1_dbg27, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(32, sdio7, rgmii_rxc, audio_pwm2, NA, wcss0_dbg28, -+ wcss1_dbg28, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(33, rgmii_tx, audio_pwm3, NA, wcss0_dbg29, wcss1_dbg29, NA, -+ boot2, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(34, blsp_i2c1, i2s_spdif_in, NA, wcss0_dbg30, wcss1_dbg30, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(35, blsp_i2c1, i2s_spdif_out, NA, wcss0_dbg31, wcss1_dbg31, -+ NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(36, rmii00, led2, led0, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), -+ PINGROUP(37, rmii01, wifi0_wci, wifi1_wci, led1, NA, NA, wcss0_dbg16, -+ wcss1_dbg16, NA, qdss_tracedata_a, boot4, NA, NA, NA), -+ PINGROUP(38, rmii0_tx, led2, NA, NA, wcss0_dbg17, wcss1_dbg17, NA, -+ qdss_tracedata_a, boot5, NA, NA, NA, NA, NA), -+ PINGROUP(39, rmii0_rx, pcie_clk1, led3, NA, NA, wcss0_dbg18, -+ wcss1_dbg18, NA, NA, qdss_tracedata_a, NA, NA, NA, NA), -+ PINGROUP(40, rmii0_refclk, wifi0_rfsilient0, wifi1_rfsilient0, smart2, -+ led4, NA, NA, wcss0_dbg19, wcss1_dbg19, NA, NA, -+ qdss_tracedata_a, NA, NA), -+ PINGROUP(41, rmii00, wifi0_cal, wifi1_cal, smart2, NA, NA, wcss0_dbg20, -+ wcss1_dbg20, NA, NA, qdss_tracedata_a, NA, NA, NA), -+ PINGROUP(42, rmii01, wifi_wci0, NA, NA, wcss0_dbg21, wcss1_dbg21, NA, -+ NA, qdss_tracedata_a, NA, NA, NA, NA, NA), -+ PINGROUP(43, rmii0_dv, wifi_wci1, NA, NA, wcss0_dbg22, wcss1_dbg22, NA, -+ NA, qdss_tracedata_a, NA, NA, NA, NA, NA), -+ PINGROUP(44, rmii1_refclk, blsp_spi1, smart0, led5, NA, NA, -+ wcss0_dbg23, wcss1_dbg23, NA, NA, NA, NA, NA, NA), -+ PINGROUP(45, rmii10, blsp_spi1, blsp_spi0, smart0, led6, NA, NA, -+ wcss0_dbg24, wcss1_dbg24, NA, NA, NA, NA, NA), -+ PINGROUP(46, rmii11, blsp_spi1, smart0, led7, NA, NA, wcss0_dbg25, -+ wcss1_dbg25, NA, NA, NA, NA, NA, NA), -+ PINGROUP(47, rmii1_dv, blsp_spi1, smart0, led8, NA, NA, wcss0_dbg26, -+ wcss1_dbg26, NA, NA, NA, NA, NA, NA), -+ PINGROUP(48, rmii1_tx, aud_pin, smart2, led9, NA, NA, wcss0_dbg27, -+ wcss1_dbg27, NA, NA, NA, NA, NA, NA), -+ PINGROUP(49, rmii1_rx, aud_pin, smart2, led10, NA, NA, wcss0_dbg28, -+ wcss1_dbg28, NA, NA, NA, NA, NA, NA), -+ PINGROUP(50, rmii10, aud_pin, wifi0_rfsilient1, wifi1_rfsilient1, -+ led11, NA, NA, wcss0_dbg29, wcss1_dbg29, NA, NA, NA, NA, NA), -+ PINGROUP(51, rmii11, aud_pin, wifi0_cal, wifi1_cal, NA, NA, -+ wcss0_dbg30, wcss1_dbg30, NA, boot7, NA, NA, NA, NA), -+ PINGROUP(52, qpic_pad, mdc, pcie_clk, i2s_tx_mclk, NA, NA, wcss0_dbg31, -+ tm_clk0, wifi00, wifi10, NA, NA, NA, NA), -+ PINGROUP(53, qpic_pad, mdio1, i2s_tx_bclk, prng_rosc, dbg_out, tm0, -+ wifi01, wifi11, NA, NA, NA, NA, NA, NA), -+ PINGROUP(54, qpic_pad, blsp_spi0, i2s_td1, atest_char3, pmu0, NA, NA, -+ boot8, tm1, NA, NA, NA, NA, NA), -+ PINGROUP(55, qpic_pad, blsp_spi0, i2s_td2, atest_char2, pmu1, NA, NA, -+ boot9, tm2, NA, NA, NA, NA, NA), -+ PINGROUP(56, qpic_pad, blsp_spi0, i2s_td3, atest_char1, NA, tm_ack, -+ wifi03, wifi13, NA, NA, NA, NA, NA, NA), -+ PINGROUP(57, qpic_pad4, blsp_spi0, i2s_tx_fsync, atest_char0, NA, tm3, -+ wifi02, wifi12, NA, NA, NA, NA, NA, NA), -+ PINGROUP(58, qpic_pad5, led2, blsp_i2c0, smart3, smart1, i2s_rx_mclk, -+ NA, wcss0_dbg14, tm4, wifi04, wifi14, NA, NA, NA), -+ PINGROUP(59, qpic_pad6, blsp_i2c0, smart3, smart1, i2s_spdif_in, NA, -+ NA, wcss0_dbg15, qdss_tracectl_a, boot18, tm5, NA, NA, NA), -+ PINGROUP(60, qpic_pad7, blsp_uart0, smart1, smart3, led0, i2s_tx_bclk, -+ i2s_rx_bclk, atest_char, NA, wcss0_dbg4, qdss_traceclk_a, -+ boot19, tm6, NA), -+ PINGROUP(61, qpic_pad, blsp_uart0, smart1, smart3, led1, i2s_tx_fsync, -+ i2s_rx_fsync, NA, NA, wcss0_dbg5, qdss_cti_trig_out_a0, -+ boot14, tm7, NA), -+ PINGROUP(62, qpic_pad, chip_rst, wifi0_uart, wifi1_uart, i2s_spdif_out, -+ NA, NA, wcss0_dbg6, qdss_cti_trig_out_b0, boot11, tm8, NA, NA, -+ NA), -+ PINGROUP(63, qpic_pad, wifi0_uart1, wifi1_uart1, wifi1_uart, i2s_td1, -+ i2s_rxd, i2s_spdif_out, i2s_spdif_in, NA, wcss0_dbg7, -+ wcss1_dbg7, boot20, tm9, NA), -+ PINGROUP(64, qpic_pad1, audio_pwm0, NA, wcss0_dbg8, wcss1_dbg8, NA, NA, -+ NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(65, qpic_pad2, audio_pwm1, NA, wcss0_dbg9, wcss1_dbg9, NA, NA, -+ NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(66, qpic_pad3, audio_pwm2, NA, wcss0_dbg10, wcss1_dbg10, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(67, qpic_pad0, audio_pwm3, NA, wcss0_dbg11, wcss1_dbg11, NA, -+ NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(68, qpic_pad8, NA, wcss0_dbg12, wcss1_dbg12, NA, NA, NA, NA, -+ NA, NA, NA, NA, NA, NA), -+ PINGROUP(69, qpic_pad, NA, wcss0_dbg, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA, NA), - PINGROUP(70, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(71, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(72, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -@@ -433,7 +1526,8 @@ static const struct msm_pingroup ipq4019 - PINGROUP(95, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(96, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - PINGROUP(97, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -- PINGROUP(98, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), -+ PINGROUP(98, wifi034, wifi134, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, -+ NA, NA), - PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - }; - -@@ -460,6 +1554,7 @@ static const struct of_device_id ipq4019 - static struct platform_driver ipq4019_pinctrl_driver = { - .driver = { - .name = "ipq4019-pinctrl", -+ .owner = THIS_MODULE, - .of_match_table = ipq4019_pinctrl_of_match, - }, - .probe = ipq4019_pinctrl_probe, diff --git a/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch b/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch deleted file mode 100644 index 07cf01b26..000000000 --- a/target/linux/ipq806x/patches-4.9/859-msm-pinctrl-Add-support-to-configure-ipq40xx-GPIO_PU.patch +++ /dev/null @@ -1,236 +0,0 @@ -From e77af7de404eb464f7da9e0daeb8b362cc66a7ba Mon Sep 17 00:00:00 2001 -From: Ram Chandra Jangir -Date: Tue, 9 May 2017 11:45:00 +0530 -Subject: [PATCH] msm: pinctrl: Add support to configure ipq40xx GPIO_PULL bits - -GPIO_PULL bits configurations in TLMM_GPIO_CFG register -differs for IPQ40xx from rest of the other qcom SoC's. -This change add support to configure the msm_gpio_pull -bits for ipq40xx, It is required to fix the proper -configurations of gpio-pull bits for nand pins mux. - -IPQ40xx SoC: -2'b10: Internal pull up enable. -2'b11: Unsupport - -For other SoC's: -2'b10: Keeper -2'b11: Pull-Up - -Signed-off-by: Ram Chandra Jangir ---- - drivers/pinctrl/qcom/pinctrl-apq8064.c | 1 + - drivers/pinctrl/qcom/pinctrl-apq8084.c | 1 + - drivers/pinctrl/qcom/pinctrl-ipq4019.c | 8 ++++++++ - drivers/pinctrl/qcom/pinctrl-ipq8064.c | 1 + - drivers/pinctrl/qcom/pinctrl-mdm9615.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm.c | 21 ++++++++------------- - drivers/pinctrl/qcom/pinctrl-msm.h | 19 +++++++++++++++++++ - drivers/pinctrl/qcom/pinctrl-msm8660.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm8916.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm8960.c | 1 + - drivers/pinctrl/qcom/pinctrl-msm8x74.c | 1 + - 11 files changed, 43 insertions(+), 13 deletions(-) - ---- a/drivers/pinctrl/qcom/pinctrl-apq8064.c -+++ b/drivers/pinctrl/qcom/pinctrl-apq8064.c -@@ -597,6 +597,7 @@ static const struct msm_pinctrl_soc_data - .groups = apq8064_groups, - .ngroups = ARRAY_SIZE(apq8064_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int apq8064_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-apq8084.c -+++ b/drivers/pinctrl/qcom/pinctrl-apq8084.c -@@ -1206,6 +1206,7 @@ static const struct msm_pinctrl_soc_data - .groups = apq8084_groups, - .ngroups = ARRAY_SIZE(apq8084_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int apq8084_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-ipq4019.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq4019.c -@@ -1531,6 +1531,13 @@ static const struct msm_pingroup ipq4019 - PINGROUP(99, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA), - }; - -+static const struct msm_pinctrl_gpio_pull ipq4019_gpio_pull = { -+ .no_pull = 0, -+ .pull_down = 1, -+ .keeper = 0, -+ .pull_up = 2, -+}; -+ - static const struct msm_pinctrl_soc_data ipq4019_pinctrl = { - .pins = ipq4019_pins, - .npins = ARRAY_SIZE(ipq4019_pins), -@@ -1539,6 +1546,7 @@ static const struct msm_pinctrl_soc_data - .groups = ipq4019_groups, - .ngroups = ARRAY_SIZE(ipq4019_groups), - .ngpios = 100, -+ .gpio_pull = &ipq4019_gpio_pull, - }; - - static int ipq4019_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-ipq8064.c -+++ b/drivers/pinctrl/qcom/pinctrl-ipq8064.c -@@ -630,6 +630,7 @@ static const struct msm_pinctrl_soc_data - .groups = ipq8064_groups, - .ngroups = ARRAY_SIZE(ipq8064_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int ipq8064_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-mdm9615.c -+++ b/drivers/pinctrl/qcom/pinctrl-mdm9615.c -@@ -444,6 +444,7 @@ static const struct msm_pinctrl_soc_data - .groups = mdm9615_groups, - .ngroups = ARRAY_SIZE(mdm9615_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int mdm9615_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-msm.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm.c -@@ -203,11 +203,6 @@ static int msm_config_reg(struct msm_pin - return 0; - } - --#define MSM_NO_PULL 0 --#define MSM_PULL_DOWN 1 --#define MSM_KEEPER 2 --#define MSM_PULL_UP 3 -- - static unsigned msm_regval_to_drive(u32 val) - { - return (val + 1) * 2; -@@ -238,16 +233,16 @@ static int msm_config_group_get(struct p - /* Convert register value to pinconf value */ - switch (param) { - case PIN_CONFIG_BIAS_DISABLE: -- arg = arg == MSM_NO_PULL; -+ arg = arg == pctrl->soc->gpio_pull->no_pull; - break; - case PIN_CONFIG_BIAS_PULL_DOWN: -- arg = arg == MSM_PULL_DOWN; -+ arg = arg == pctrl->soc->gpio_pull->pull_down; - break; - case PIN_CONFIG_BIAS_BUS_HOLD: -- arg = arg == MSM_KEEPER; -+ arg = arg == pctrl->soc->gpio_pull->keeper; - break; - case PIN_CONFIG_BIAS_PULL_UP: -- arg = arg == MSM_PULL_UP; -+ arg = arg == pctrl->soc->gpio_pull->pull_up; - break; - case PIN_CONFIG_DRIVE_STRENGTH: - arg = msm_regval_to_drive(arg); -@@ -304,16 +299,16 @@ static int msm_config_group_set(struct p - /* Convert pinconf values to register values */ - switch (param) { - case PIN_CONFIG_BIAS_DISABLE: -- arg = MSM_NO_PULL; -+ arg = pctrl->soc->gpio_pull->no_pull; - break; - case PIN_CONFIG_BIAS_PULL_DOWN: -- arg = MSM_PULL_DOWN; -+ arg = pctrl->soc->gpio_pull->pull_down; - break; - case PIN_CONFIG_BIAS_BUS_HOLD: -- arg = MSM_KEEPER; -+ arg = pctrl->soc->gpio_pull->keeper; - break; - case PIN_CONFIG_BIAS_PULL_UP: -- arg = MSM_PULL_UP; -+ arg = pctrl->soc->gpio_pull->pull_up; - break; - case PIN_CONFIG_DRIVE_STRENGTH: - /* Check for invalid values */ ---- a/drivers/pinctrl/qcom/pinctrl-msm.h -+++ b/drivers/pinctrl/qcom/pinctrl-msm.h -@@ -98,6 +98,16 @@ struct msm_pingroup { - }; - - /** -+ * struct msm_pinctrl_gpio_pull - pinctrl pull value bit field descriptor -+ */ -+struct msm_pinctrl_gpio_pull { -+ unsigned no_pull; -+ unsigned pull_down; -+ unsigned keeper; -+ unsigned pull_up; -+}; -+ -+/** - * struct msm_pinctrl_soc_data - Qualcomm pin controller driver configuration - * @pins: An array describing all pins the pin controller affects. - * @npins: The number of entries in @pins. -@@ -106,6 +116,7 @@ struct msm_pingroup { - * @groups: An array describing all pin groups the pin SoC supports. - * @ngroups: The numbmer of entries in @groups. - * @ngpio: The number of pingroups the driver should expose as GPIOs. -+ * @gpio_pull_val: The pull value bit field descriptor. - */ - struct msm_pinctrl_soc_data { - const struct pinctrl_pin_desc *pins; -@@ -115,6 +126,14 @@ struct msm_pinctrl_soc_data { - const struct msm_pingroup *groups; - unsigned ngroups; - unsigned ngpios; -+ const struct msm_pinctrl_gpio_pull *gpio_pull; -+}; -+ -+static const struct msm_pinctrl_gpio_pull msm_gpio_pull = { -+ .no_pull = 0, -+ .pull_down = 1, -+ .keeper = 2, -+ .pull_up = 3, - }; - - int msm_pinctrl_probe(struct platform_device *pdev, ---- a/drivers/pinctrl/qcom/pinctrl-msm8660.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm8660.c -@@ -979,6 +979,7 @@ static const struct msm_pinctrl_soc_data - .groups = msm8660_groups, - .ngroups = ARRAY_SIZE(msm8660_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int msm8660_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-msm8916.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm8916.c -@@ -967,6 +967,7 @@ static const struct msm_pinctrl_soc_data - .groups = msm8916_groups, - .ngroups = ARRAY_SIZE(msm8916_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int msm8916_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-msm8960.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm8960.c -@@ -1244,6 +1244,7 @@ static const struct msm_pinctrl_soc_data - .groups = msm8960_groups, - .ngroups = ARRAY_SIZE(msm8960_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int msm8960_pinctrl_probe(struct platform_device *pdev) ---- a/drivers/pinctrl/qcom/pinctrl-msm8x74.c -+++ b/drivers/pinctrl/qcom/pinctrl-msm8x74.c -@@ -1069,6 +1069,7 @@ static const struct msm_pinctrl_soc_data - .groups = msm8x74_groups, - .ngroups = ARRAY_SIZE(msm8x74_groups), - .ngpios = NUM_GPIO_PINGROUPS, -+ .gpio_pull = &msm_gpio_pull, - }; - - static int msm8x74_pinctrl_probe(struct platform_device *pdev) diff --git a/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch index 62153b3cd..9ea46c9d4 100644 --- a/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch +++ b/target/linux/ipq806x/patches-4.9/863-dts-ipq4019-add-nand-and-qpic-bam-dma-node.patch @@ -15,78 +15,17 @@ Signed-off-by: Ram Chandra Jangir --- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -@@ -88,6 +88,86 @@ +@@ -88,6 +88,26 @@ bias-disable; }; }; + + nand_pins: nand_pins { + -+ mux_1 { -+ pins = "gpio52", "gpio53", "gpio54", -+ "gpio55", "gpio56", "gpio61", -+ "gpio62", "gpio63", "gpio69"; -+ function = "qpic_pad"; -+ bias-disable; -+ }; -+ -+ mux_2 { -+ pins = "gpio67"; -+ function = "qpic_pad0"; -+ bias-disable; -+ }; -+ -+ mux_3 { -+ pins = "gpio64"; -+ function = "qpic_pad1"; -+ bias-disable; -+ }; -+ -+ mux_4 { -+ pins = "gpio65"; -+ function = "qpic_pad2"; -+ bias-disable; -+ }; -+ -+ mux_5 { -+ pins = "gpio66"; -+ function = "qpic_pad3"; -+ bias-disable; -+ }; -+ -+ mux_6 { -+ pins = "gpio57"; -+ function = "qpic_pad4"; -+ bias-disable; -+ }; -+ -+ mux_7 { -+ pins = "gpio58"; -+ function = "qpic_pad5"; -+ bias-disable; -+ }; -+ -+ mux_8 { -+ pins = "gpio59"; -+ function = "qpic_pad6"; -+ bias-disable; -+ }; -+ -+ mux_9 { -+ pins = "gpio60"; -+ function = "qpic_pad7"; -+ bias-disable; -+ }; -+ -+ mux_10 { -+ pins = "gpio68"; -+ function = "qpic_pad8"; -+ bias-disable; -+ }; -+ + pullups { + pins = "gpio52", "gpio53", "gpio58", + "gpio59"; ++ function = "qpic"; + bias-pull-up; + }; + @@ -96,13 +35,14 @@ Signed-off-by: Ram Chandra Jangir + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio68", "gpio69"; ++ function = "qpic"; + bias-pull-down; + }; + }; }; blsp_dma: dma@7884000 { -@@ -159,5 +239,15 @@ +@@ -159,5 +179,15 @@ watchdog@b017000 { status = "ok"; }; @@ -120,7 +60,7 @@ Signed-off-by: Ram Chandra Jangir }; --- a/arch/arm/boot/dts/qcom-ipq4019.dtsi +++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -586,5 +586,43 @@ +@@ -609,5 +609,43 @@ "legacy"; status = "disabled"; }; diff --git a/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch b/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch deleted file mode 100644 index 220503bda..000000000 --- a/target/linux/ipq806x/patches-4.9/864-00-v3-1-2-dts-ipq4019-Fix-pinctrl-node-name.patch +++ /dev/null @@ -1,44 +0,0 @@ -From patchwork Mon Jul 3 07:47:12 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [v3,1/2] dts: ipq4019: Fix pinctrl node name -From: Varadarajan Narayanan -X-Patchwork-Id: 9822099 -Message-Id: <1499068033-24000-2-git-send-email-varada@codeaurora.org> -To: andy.gross@linaro.org, david.brown@linaro.org, robh+dt@kernel.org, - mark.rutland@arm.com, linux@armlinux.org.uk, - linux-arm-msm@vger.kernel.org, - linux-soc@vger.kernel.org, devicetree@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org -Cc: Varadarajan Narayanan -Date: Mon, 3 Jul 2017 13:17:12 +0530 - -Signed-off-by: Varadarajan Narayanan ---- - arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 2 +- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -40,7 +40,7 @@ - clock-frequency = <48000000>; - }; - -- pinctrl@0x01000000 { -+ pinctrl@1000000 { - serial_pins: serial_pinmux { - mux { - pins = "gpio60", "gpio61"; ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -155,7 +155,7 @@ - reg = <0x1800000 0x60000>; - }; - -- tlmm: pinctrl@0x01000000 { -+ tlmm: pinctrl@1000000 { - compatible = "qcom,ipq4019-pinctrl"; - reg = <0x01000000 0x300000>; - gpio-controller; diff --git a/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch deleted file mode 100644 index da3b2c694..000000000 --- a/target/linux/ipq806x/patches-4.9/864-00-v3-2-2-dts-ipq4019-Move-xo-and-timer-nodes-to-SoC-dtsi.patch +++ /dev/null @@ -1,78 +0,0 @@ -From patchwork Mon Jul 3 07:47:13 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [v3,2/2] dts: ipq4019: Move xo and timer nodes to SoC dtsi -From: Varadarajan Narayanan -X-Patchwork-Id: 9822107 -Message-Id: <1499068033-24000-3-git-send-email-varada@codeaurora.org> -To: andy.gross@linaro.org, david.brown@linaro.org, robh+dt@kernel.org, - mark.rutland@arm.com, linux@armlinux.org.uk, - linux-arm-msm@vger.kernel.org, - linux-soc@vger.kernel.org, devicetree@vger.kernel.org, - linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org -Cc: Varadarajan Narayanan -Date: Mon, 3 Jul 2017 13:17:13 +0530 - -The node for xo and timer belong to the SoC DTS file. -Else, new board DT files may not inherit these nodes. - -Signed-off-by: Varadarajan Narayanan ---- - arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi | 19 ------------------- - arch/arm/boot/dts/qcom-ipq4019.dtsi | 15 +++++++++++++++ - 2 files changed, 15 insertions(+), 19 deletions(-) - ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -20,26 +20,7 @@ - model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; - compatible = "qcom,ipq4019"; - -- clocks { -- xo: xo { -- compatible = "fixed-clock"; -- clock-frequency = <48000000>; -- #clock-cells = <0>; -- }; -- }; -- - soc { -- -- -- timer { -- compatible = "arm,armv7-timer"; -- interrupts = <1 2 0xf08>, -- <1 3 0xf08>, -- <1 4 0xf08>, -- <1 1 0xf08>; -- clock-frequency = <48000000>; -- }; -- - pinctrl@1000000 { - serial_pins: serial_pinmux { - mux { ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -132,6 +132,21 @@ - clock-frequency = <32768>; - #clock-cells = <0>; - }; -+ -+ xo: xo { -+ compatible = "fixed-clock"; -+ clock-frequency = <48000000>; -+ #clock-cells = <0>; -+ }; -+ }; -+ -+ timer { -+ compatible = "arm,armv7-timer"; -+ interrupts = <1 2 0xf08>, -+ <1 3 0xf08>, -+ <1 4 0xf08>, -+ <1 1 0xf08>; -+ clock-frequency = <48000000>; - }; - - soc { diff --git a/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch b/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch deleted file mode 100644 index f2de6d618..000000000 --- a/target/linux/ipq806x/patches-4.9/864-01-dts-ipq4019-ap-dk04-fix-pinctrl-node-name.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -@@ -38,7 +38,7 @@ - clock-frequency = <48000000>; - }; - -- pinctrl@0x01000000 { -+ pinctrl@1000000 { - serial_0_pins: serial_pinmux { - mux { - pins = "gpio16", "gpio17"; diff --git a/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch b/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch deleted file mode 100644 index dcbdb8d77..000000000 --- a/target/linux/ipq806x/patches-4.9/864-02-dts-ipq4019-ap-dk04-remove-xo-and-timer-nodes.patch +++ /dev/null @@ -1,27 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1.dtsi -@@ -20,24 +20,7 @@ - model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK04.1"; - compatible = "qcom,ipq4019"; - -- clocks { -- xo: xo { -- compatible = "fixed-clock"; -- clock-frequency = <48000000>; -- #clock-cells = <0>; -- }; -- }; -- - soc { -- timer { -- compatible = "arm,armv7-timer"; -- interrupts = <1 2 0xf08>, -- <1 3 0xf08>, -- <1 4 0xf08>, -- <1 1 0xf08>; -- clock-frequency = <48000000>; -- }; -- - pinctrl@1000000 { - serial_0_pins: serial_pinmux { - mux { diff --git a/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch deleted file mode 100644 index 9d11dc022..000000000 --- a/target/linux/ipq806x/patches-4.9/864-03-dts-ipq4019-ap-dk01-add-tcsr-config-to-dtsi.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -15,12 +15,39 @@ - */ - - #include "qcom-ipq4019.dtsi" -+#include - - / { - model = "Qualcomm Technologies, Inc. IPQ4019/AP-DK01.1"; - compatible = "qcom,ipq4019"; - - soc { -+ tcsr@194b000 { -+ /* select hostmode */ -+ compatible = "qcom,tcsr"; -+ reg = <0x194b000 0x100>; -+ qcom,usb-hsphy-mode-select = ; -+ status = "ok"; -+ }; -+ -+ ess_tcsr@1953000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1953000 0x1000>; -+ qcom,ess-interface-select = ; -+ }; -+ -+ tcsr@1949000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1949000 0x100>; -+ qcom,wifi_glb_cfg = ; -+ }; -+ -+ tcsr@1957000 { -+ compatible = "qcom,tcsr"; -+ reg = <0x1957000 0x100>; -+ qcom,wifi_noc_memtype_m0_m2 = ; -+ }; -+ - pinctrl@1000000 { - serial_pins: serial_pinmux { - mux { diff --git a/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch deleted file mode 100644 index 02a102e37..000000000 --- a/target/linux/ipq806x/patches-4.9/864-04-dts-ipq4019-ap-dk01-add-network-nodes-to-dtsi.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -136,5 +136,29 @@ - usb2: usb2@60f8800 { - status = "ok"; - }; -+ -+ mdio@90000 { -+ status = "okay"; -+ }; -+ -+ ess-switch@c000000 { -+ status = "okay"; -+ }; -+ -+ ess-psgmii@98000 { -+ status = "okay"; -+ }; -+ -+ edma@c080000 { -+ status = "okay"; -+ }; -+ -+ wifi@a000000 { -+ status = "okay"; -+ }; -+ -+ wifi@a800000 { -+ status = "okay"; -+ }; - }; - }; diff --git a/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch b/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch deleted file mode 100644 index 0d4b80b30..000000000 --- a/target/linux/ipq806x/patches-4.9/864-05-dts-ipq4019-ap-dk01-remove-spi-chip-node-from-dtsi.patch +++ /dev/null @@ -1,17 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1.dtsi -@@ -89,14 +89,6 @@ - pinctrl-names = "default"; - status = "ok"; - cs-gpios = <&tlmm 54 0>; -- -- mx25l25635e@0 { -- #address-cells = <1>; -- #size-cells = <1>; -- reg = <0>; -- compatible = "mx25l25635e"; -- spi-max-frequency = <24000000>; -- }; - }; - - serial@78af000 { diff --git a/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch b/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch deleted file mode 100644 index 33f7f04f3..000000000 --- a/target/linux/ipq806x/patches-4.9/864-06-dts-ipq4019-fix-max-cpu-speed.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019.dtsi -+++ b/arch/arm/boot/dts/qcom-ipq4019.dtsi -@@ -108,8 +108,8 @@ - opp-hz = /bits/ 64 <500000000>; - clock-latency-ns = <256000>; - }; -- opp@666000000 { -- opp-hz = /bits/ 64 <666000000>; -+ opp@716800000 { -+ opp-hz = /bits/ 64 <716800000>; - clock-latency-ns = <256000>; - }; - }; diff --git a/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch b/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch deleted file mode 100644 index e9d262069..000000000 --- a/target/linux/ipq806x/patches-4.9/864-07-dts-ipq4019-ap-dk01.1-c1-add-spi-and-ram-nodes.patch +++ /dev/null @@ -1,115 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts -@@ -19,4 +19,112 @@ - / { - model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1"; - -+ memory { -+ device_type = "memory"; -+ reg = <0x80000000 0x10000000>; -+ }; -+ -+ reserved-memory { -+ #address-cells = <0x1>; -+ #size-cells = <0x1>; -+ ranges; -+ -+ apps_bl@87000000 { -+ reg = <0x87000000 0x400000>; -+ no-map; -+ }; -+ -+ sbl@87400000 { -+ reg = <0x87400000 0x100000>; -+ no-map; -+ }; -+ -+ cnss_debug@87500000 { -+ reg = <0x87500000 0x600000>; -+ no-map; -+ }; -+ -+ cpu_context_dump@87b00000 { -+ reg = <0x87b00000 0x080000>; -+ no-map; -+ }; -+ -+ tz_apps@87b80000 { -+ reg = <0x87b80000 0x280000>; -+ no-map; -+ }; -+ -+ smem@87e00000 { -+ reg = <0x87e00000 0x080000>; -+ no-map; -+ }; -+ -+ tz@87e80000 { -+ reg = <0x87e80000 0x180000>; -+ no-map; -+ }; -+ }; -+}; -+ -+&spi_0 { -+ mx25l25635f@0 { -+ compatible = "mx25l25635f", "jedec,spi-nor"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ reg = <0>; -+ spi-max-frequency = <24000000>; -+ -+ SBL1@0 { -+ label = "SBL1"; -+ reg = <0x0 0x40000>; -+ read-only; -+ }; -+ MIBIB@40000 { -+ label = "MIBIB"; -+ reg = <0x40000 0x20000>; -+ read-only; -+ }; -+ QSEE@60000 { -+ label = "QSEE"; -+ reg = <0x60000 0x60000>; -+ read-only; -+ }; -+ CDT@c0000 { -+ label = "CDT"; -+ reg = <0xc0000 0x10000>; -+ read-only; -+ }; -+ DDRPARAMS@d0000 { -+ label = "DDRPARAMS"; -+ reg = <0xd0000 0x10000>; -+ read-only; -+ }; -+ APPSBLENV@e0000 { -+ label = "APPSBLENV"; -+ reg = <0xe0000 0x10000>; -+ read-only; -+ }; -+ APPSBL@f0000 { -+ label = "APPSBL"; -+ reg = <0xf0000 0x80000>; -+ read-only; -+ }; -+ ART@170000 { -+ label = "ART"; -+ reg = <0x170000 0x10000>; -+ read-only; -+ }; -+ kernel@180000 { -+ label = "kernel"; -+ reg = <0x180000 0x400000>; -+ }; -+ rootfs@580000 { -+ label = "rootfs"; -+ reg = <0x580000 0x1600000>; -+ }; -+ firmware@180000 { -+ label = "firmware"; -+ reg = <0x180000 0x1a00000>; -+ }; -+ }; - }; diff --git a/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch b/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch deleted file mode 100644 index 2d4ff3104..000000000 --- a/target/linux/ipq806x/patches-4.9/864-08-dts-ipq4019-ap-dk01.1-c1-add-compatible-string.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts -+++ b/arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dts -@@ -18,6 +18,7 @@ - - / { - model = "Qualcomm Technologies, Inc. IPQ40xx/AP-DK01.1-C1"; -+ compatible = "qcom,ap-dk01.1-c1", "qcom,ap-dk01.2-c1", "qcom,ipq4019"; - - memory { - device_type = "memory"; From 194dbffcf629dcd8b26ea25f98825471392392d8 Mon Sep 17 00:00:00 2001 From: imbrolla <2664456645@qq.com> Date: Thu, 30 Nov 2017 03:28:52 +0800 Subject: [PATCH 26/95] fix tl wr2041n v1 tl wr2041n v2 tl wr941n v7 --- target/linux/ar71xx/base-files/lib/ar71xx.sh | 11 +++++- target/linux/ar71xx/image/tp-link.mk | 41 +++++++++----------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index e6e698789..1c252ac27 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,9 +263,12 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; -+ "031600"*) + "031600"*) model="Mercury MW316R" ;; + "204100"*) + model="TP-Link TL-WR2041N" + ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -1151,6 +1154,12 @@ ar71xx_board_detect() { *"TL-WR1043ND v4") name="tl-wr1043nd-v4" ;; + *"TL-WR2041N v1") + name="tl-wr2041n-v1" + ;; + *"TL-WR2041N v2") + name="tl-wr2041n-v2" + ;; *"TL-WR2543N"*) name="tl-wr2543n" ;; diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index 1e0ef1b21..203d9a2af 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -1102,14 +1102,30 @@ define Device/tl-wr941nd-v6-cn TPLINK_HWID := 0x09410006 endef -define Device/tl-wr2041nd-v1 +define Device/tl-wr941n-v7 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v7 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410007 +endef + +define Device/tl-wr2041n-v1 $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N/ND v1 + DEVICE_TITLE := TP-LINK TL-WR2041N v1 BOARDNAME := TL-WDR3500 DEVICE_PROFILE := TLWR2041 TPLINK_HWID := 0x20410001 endef +define Device/tl-wr2041n-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR2041N v2 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR2041 + TPLINK_HWID := 0x20410002 +endef + define Device/tl-wr942n-v1 DEVICE_TITLE := TP-LINK TL-WR942N v1 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport @@ -1125,17 +1141,7 @@ define Device/tl-wr942n-v1 MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),13120k(rootfs),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro,14464k@0x20000(firmware) SUPPORTED_DEVICES := tl-wr942n-v1 endef - -TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr942n-v1 tl-wr2041nd-v1 - -define Device/tl-wr941n-v7 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK WR941N v7 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410007 -endef -TARGET_DEVICES += tl-wr941n-v7 +TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr941n-v7 tl-wr942n-v1 tl-wr2041n-v1 tl-wr2041n-v2 define Device/tl-wdr6500-v6 $(Device/tplink-8mlzma) @@ -1168,12 +1174,3 @@ define Device/tl-wr882n-v1 TPLINK_HWID := 0x08820001 endef TARGET_DEVICES += tl-wr882n-v1 - -define Device/tl-wr2041nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N/ND v2 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410002 -endef -TARGET_DEVICES += tl-wr2041nd-v2 From b0e95a6af77f41ecdd9a7d4139375a28e2ecbec3 Mon Sep 17 00:00:00 2001 From: WouldChar Date: Fri, 1 Dec 2017 22:53:22 +0800 Subject: [PATCH 27/95] Rework for tl-wdr6500 v6 * offical firmware mac addr: 0x1b80d offical firmware art data addr: 0x1c000, 0x1d000 if you are the first time to flash lede firmware, please copy 64kb mac and art data to the end of flash erase 0x9f7f0000 +0x10000 cp.b 0x80060000 0x9f01b000 0x10000 cp.b 0x9f7f0000 0x80060000 0x10000 new mac addr: 0x7f080d new art data addr: 0x7f1000, 0x7f2000 --- .../etc/hotplug.d/firmware/11-ath10k-caldata | 5 +++ .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 ++ .../arch/mips/ath79/mach-tl-wdr6500-v6.c | 41 +++++++++++++++---- target/linux/ar71xx/image/tp-link.mk | 27 ++++++------ 4 files changed, 55 insertions(+), 21 deletions(-) mode change 100755 => 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 66796593c..757c231f0 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -144,6 +144,11 @@ case "$FIRMWARE" in archer-c58-v1) ath10kcal_extract "art" 20480 12064 ;; + tl-wdr6500-v6) + ath10kcal_extract "art" 8192 12064 + ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ + /lib/firmware/ath10k/QCA9888/hw2.0/board.bin + ;; esac ;; *) diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 77c835f2f..1db791d0c 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -15,6 +15,9 @@ case "$board" in archer-c58-v1) echo $(macaddr_add $(mtd_get_mac_binary mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress ;; + tl-wdr6500-v6) + echo $(macaddr_add $(mtd_get_mac_binary art 2061) $(($PHYNBR - 2)) ) > /sys${DEVPATH}/macaddress + ;; *) ;; esac diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c old mode 100755 new mode 100644 index 8e5bcea4c..c4178d9dc --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c @@ -1,12 +1,20 @@ /* * TP-LINK TL-WDR6500 v6 * + * Copyright (C) 2015 Weijie Gao + * + * 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 #include #include + #include #include + #include "common.h" #include "dev-eth.h" #include "dev-ap9x-pci.h" @@ -17,24 +25,31 @@ #include "dev-wmac.h" #include "machtypes.h" #include "pci.h" + #define TL_WDR6500_V6_GPIO_LED_SYS 21 #define TL_WDR6500_V6_GPIO_LED_WAN 18 #define TL_WDR6500_V6_GPIO_LED_LAN1 17 #define TL_WDR6500_V6_GPIO_LED_LAN2 16 #define TL_WDR6500_V6_GPIO_LED_LAN3 15 #define TL_WDR6500_V6_GPIO_LED_LAN4 14 + #define TL_WDR6500_V6_GPIO_BTN_RESET 1 + #define TL_WDR6500_V6_KEYS_POLL_INTERVAL 20 /* msecs */ #define TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WDR6500_V6_KEYS_POLL_INTERVAL) + #define TL_WDR6500_V6_WMAC_CALDATA_OFFSET 0x1000 -#define TL_WDR6500_V6_PCIE_CALDATA_OFFSET 0x5000 +#define TL_WDR6500_V6_PCIE_CALDATA_OFFSET 0x2000 + static const char *tl_wdr6500_v6_part_probes[] = { "tp-link-64k", NULL, }; + static struct flash_platform_data tl_wdr6500_v6_flash_data = { .part_probes = tl_wdr6500_v6_part_probes, }; + static struct gpio_led tl_wdr6500_v6_leds_gpio[] __initdata = { { .name = "tp-link:green:lan1", @@ -62,6 +77,7 @@ static struct gpio_led tl_wdr6500_v6_leds_gpio[] __initdata = { .active_low = 0, }, }; + static struct gpio_keys_button tl_wdr6500_v6_gpio_keys[] __initdata = { { .desc = "Reset button", @@ -72,15 +88,20 @@ static struct gpio_keys_button tl_wdr6500_v6_gpio_keys[] __initdata = { .active_low = 1, } }; + + static void __init tl_ap151_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0x1f00fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff0000); + u8 *mac = (u8 *) KSEG1ADDR(0x1fff080d); + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); u8 tmpmac[ETH_ALEN]; - ath79_register_usb(); + ath79_register_m25p80(&tl_wdr6500_v6_flash_data); + ath79_setup_ar933x_phy4_switch(false, false); + ath79_register_mdio(1, 0x0); + /* WAN */ ath79_switch_data.phy4_mii_en = 1; ath79_switch_data.phy_poll_mask = BIT(4); @@ -89,25 +110,31 @@ static void __init tl_ap151_setup(void) ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); ath79_register_eth(0); + /* LAN */ ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ath79_eth1_data.duplex = DUPLEX_FULL; ath79_eth1_data.speed = SPEED_1000; ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); ath79_register_eth(1); + ath79_init_mac(tmpmac, mac, -1); - ath79_register_wmac(ee + TL_WDR6500_V6_WMAC_CALDATA_OFFSET, tmpmac); - ath79_register_pci(); - ath79_register_usb(); + ath79_register_wmac(art + TL_WDR6500_V6_WMAC_CALDATA_OFFSET, tmpmac); + + ap91_pci_init(art + TL_WDR6500_V6_PCIE_CALDATA_OFFSET, NULL); } + static void __init tl_wdr6500_v6_setup(void) { tl_ap151_setup(); + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr6500_v6_leds_gpio), tl_wdr6500_v6_leds_gpio); + ath79_register_gpio_keys_polled(1, TL_WDR6500_V6_KEYS_POLL_INTERVAL, ARRAY_SIZE(tl_wdr6500_v6_gpio_keys), tl_wdr6500_v6_gpio_keys); } + MIPS_MACHINE(ATH79_MACH_TL_WDR6500_V6, "TL-WDR6500-v6", "TP-LINK TL-WDR6500 v6", tl_wdr6500_v6_setup); diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index 1e0ef1b21..e50027685 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -643,12 +643,24 @@ define Device/tl-wdr6500-v2 TPLINK_HEADER_VERSION := 2 endef +define Device/tl-wdr6500-v6 +$(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR6500 v6 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 + KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header + BOARDNAME = TL-WDR6500-v6 + DEVICE_PROFILE = TLWDR6500V6 + TPLINK_HWID := 0x65000006 + TPLINK_HEADER_VERSION := 2 +endef + define Device/mw4530r-v1 $(Device/tl-wdr4300-v1) DEVICE_TITLE := Mercury MW4530R v1 TPLINK_HWID := 0x45300001 endef -TARGET_DEVICES += tl-wdr3320-v2 tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 tl-wdr4900-v2 tl-wdr6500-v2 mw4530r-v1 +TARGET_DEVICES += tl-wdr3320-v2 tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 tl-wdr4900-v2 tl-wdr6500-v2 tl-wdr6500-v6 mw4530r-v1 define Device/tl-wpa8630-v1 $(Device/tplink-8mlzma) @@ -1137,19 +1149,6 @@ define Device/tl-wr941n-v7 endef TARGET_DEVICES += tl-wr941n-v7 -define Device/tl-wdr6500-v6 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR6500 v6 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | mktplinkfw-combined - BOARDNAME := TL-WDR6500-v6 - DEVICE_PROFILE := TLWDR6500V6 - TPLINK_HWID := 0x65000006 - TPLINK_HEADER_VERSION := 2 -endef -TARGET_DEVICES += tl-wdr6500-v6 - define Device/tl-wr842n-v9 $(Device/tplink-8mlzma) DEVICE_TITLE := TP-LINK TL-WR842N/ND v9 From bc31350b37a35c7839ada5bce630e83bf7a3b01c Mon Sep 17 00:00:00 2001 From: binext <33397660+binext@users.noreply.github.com> Date: Thu, 7 Dec 2017 18:08:43 +0800 Subject: [PATCH 28/95] fix the aliddns that can't add * or @ add urlencode for $aliddns_name,fix the aliddns that can't add universal parse * or primary domain name @ the current_ip use "query_recordid" instead of "nslookup" --- package/lean/luci-app-aliddns/root/usr/sbin/aliddns | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns index 3c5c5a258..ac0e9672b 100755 --- a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns +++ b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns @@ -14,7 +14,8 @@ ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cu check_aliddns() { #ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null` -current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null` +#current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null` +current_ip=`query_recordid | sed 's/.*,"Value":"\([0-9\.]*\)",.*/\1/'` echo "$DATE 当å‰è·¯ç”±IP: ${ip}" >> /var/log/aliddns.log echo "$DATE 远程解æžIP: ${current_ip}" >> /var/log/aliddns.log if [ "$ip" = "$current_ip" ] @@ -55,15 +56,15 @@ get_recordid() { } query_recordid() { - send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$aliddns_name.$aliddns_domain&Timestamp=$timestamp" + send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$(urlencode "$aliddns_name").$aliddns_domain&Timestamp=$timestamp" } update_record() { - send_request "UpdateDomainRecord" "RR=$aliddns_name&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" + send_request "UpdateDomainRecord" "RR=$(urlencode "$aliddns_name")&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" } add_record() { - send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$aliddns_name&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" + send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$(urlencode "$aliddns_name")&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" } go_record() { @@ -123,4 +124,4 @@ if [ "$aliddns_enable" != "1" ]; then go_record add_aliddns_cru fi - \ No newline at end of file + From 243541a0d359a7e7f678e862eed0a92504ff65ec Mon Sep 17 00:00:00 2001 From: binext <33397660+binext@users.noreply.github.com> Date: Fri, 8 Dec 2017 11:06:15 +0800 Subject: [PATCH 29/95] fix the aliddns that can't add * or @ add urlencode for $aliddns_name,fix the aliddns that can't add universal parse * or primary domain name @ the current_ip use "query_recordid" instead of "nslookup" and add query_result to replicate "query_recordid" --- package/lean/luci-app-aliddns/root/usr/sbin/aliddns | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns index ac0e9672b..7de6d904b 100755 --- a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns +++ b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns @@ -15,7 +15,7 @@ ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cu check_aliddns() { #ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null` #current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null` -current_ip=`query_recordid | sed 's/.*,"Value":"\([0-9\.]*\)",.*/\1/'` +current_ip=`echo $query_result | sed 's/.*,"Value":"\([0-9\.]*\)",.*/\1/'` echo "$DATE 当å‰è·¯ç”±IP: ${ip}" >> /var/log/aliddns.log echo "$DATE 远程解æžIP: ${current_ip}" >> /var/log/aliddns.log if [ "$ip" = "$current_ip" ] @@ -70,7 +70,7 @@ add_record() { go_record() { if [ "$aliddns_record_id" = "" ] then - aliddns_record_id=`query_recordid | get_recordid` + aliddns_record_id=`echo $query_result | get_recordid` fi if [ "$aliddns_record_id" = "" ] then @@ -120,6 +120,7 @@ if [ "$aliddns_enable" != "1" ]; then echo "$DATE : aliddns没有开å¯ï¼" >> /var/log/aliddns.log else clean_log + query_result=$(query_recordid) check_aliddns go_record add_aliddns_cru From 72c6b996b02ae1792fca31f9f4ef9b0246a8dcf1 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 16:36:23 +0800 Subject: [PATCH 30/95] dnsmasq: fix dhcp-host entries with empty macs --- package/network/services/dnsmasq/files/dnsmasq.init | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 3d3d83334..9bbffe679 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -277,7 +277,7 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" - local hosttag nametime addrs duids + local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -305,7 +305,6 @@ dhcp_host_add() { if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap # many MAC are possible to track a laptop ON/OFF dock - macs="" for m in $mac; do append macs "$m" ","; done fi @@ -326,7 +325,6 @@ dhcp_host_add() { hex_to_hostid hostid "$hostid" fi - tags="" if [ -n "$tag" ]; then for t in $tag; do append tags "$t" ",set:"; done fi From 7185e1ceb22ed9ec2170b9aa2e325fa62ed954ed Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 16:57:14 +0800 Subject: [PATCH 31/95] merge: change branding for LEDE to OpenWrt --- Config.in | 2 +- Makefile | 2 +- include/image-commands.mk | 6 +++--- include/image.mk | 2 +- include/prereq-build.mk | 2 +- include/version.mk | 16 ++++------------ package/base-files/Makefile | 2 +- package/base-files/files/bin/config_generate | 10 +++++----- package/base-files/files/etc/banner | 18 ++++++++---------- package/base-files/files/etc/init.d/system | 2 +- .../files/lib/preinit/10_indicate_preinit | 2 +- package/base-files/image-config.in | 8 ++++---- .../broadcom-wl/files/lib/wifi/broadcom.sh | 2 +- .../kernel/mac80211/files/lib/wifi/mac80211.sh | 2 +- .../network/services/hostapd/files/hostapd.sh | 4 ++-- .../network/services/lldpd/files/lldpd.config | 2 +- .../network/services/lldpd/files/lldpd.init | 2 +- .../services/samba36/files/samba.config | 4 ++-- .../network/services/samba36/files/samba.init | 6 +++--- .../services/uhttpd/files/uhttpd.config | 2 +- .../network/services/uhttpd/files/uhttpd.init | 2 +- package/network/utils/iproute2/Makefile | 2 +- package/utils/busybox/Config-defaults.in | 4 ++-- .../utils/busybox/config/networking/Config.in | 12 ++++++------ .../patches/230-add_nslookup_lede.patch | 16 ++++++++-------- package/utils/ct-bugcheck/src/bugcheck.sh | 2 +- scripts/checkpatch.pl | 2 +- scripts/config/mconf.c | 2 +- scripts/qemustart | 12 ++++++------ target/imagebuilder/Config.in | 2 +- target/imagebuilder/files/repositories.conf | 2 +- target/linux/apm821xx/image/Makefile | 2 +- target/linux/ar71xx/image/generic.mk | 4 ++-- target/linux/ar71xx/image/legacy.mk | 4 ++-- target/linux/ar71xx/image/tp-link.mk | 2 +- target/linux/armvirt/README | 16 ++++++++-------- target/linux/brcm63xx/image/bcm63xx.mk | 6 +++--- target/linux/lantiq/image/Makefile | 2 +- target/linux/mcs814x/image/Makefile | 2 +- target/linux/mvebu/image/cfbase-boot.script | 4 ++-- target/linux/mvebu/image/cfpro-boot.script | 4 ++-- .../omap24xx/base-files/etc/config/wireless | 2 +- target/linux/uml/README | 5 +++-- target/linux/x86/image/grub-iso.cfg | 2 +- target/linux/x86/image/grub.cfg | 4 ++-- target/sdk/Config.in | 4 ++-- target/sdk/files/README.SDK | 4 ++-- target/toolchain/Config.in | 6 +++--- target/toolchain/files/README.TOOLCHAIN | 2 +- toolchain/gcc/common.mk | 2 +- 50 files changed, 111 insertions(+), 120 deletions(-) diff --git a/Config.in b/Config.in index ddbc4e2ea..d30c04839 100644 --- a/Config.in +++ b/Config.in @@ -4,7 +4,7 @@ # See /LICENSE for more information. # -mainmenu "LEDE Configuration" +mainmenu "OpenWrt Configuration" config MODULES option modules diff --git a/Makefile b/Makefile index 09db75c55..0a1f96a97 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ export TOPDIR LC_ALL LANG TZ empty:= space:= $(empty) $(empty) -$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the LEDE directory must not include any spaces)) +$(if $(findstring $(space),$(TOPDIR)),$(error ERROR: The path to the OpenWrt directory must not include any spaces)) world: diff --git a/include/image-commands.mk b/include/image-commands.mk index 2aac8fb15..970bdc9b3 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -7,7 +7,7 @@ define Build/uImage mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION))' -d $@ $@.new + -n '$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION))' -d $@ $@.new mv $@.new $@ endef @@ -60,7 +60,7 @@ endef define Build/netgear-dni $(STAGING_DIR_HOST)/bin/mkdniimg \ - -B $(NETGEAR_BOARD_ID) -v LEDE.$(REVISION) \ + -B $(NETGEAR_BOARD_ID) -v OpenWrt.$(REVISION) \ $(if $(NETGEAR_HW_ID),-H $(NETGEAR_HW_ID)) \ -r "$(1)" \ -i $@ -o $@.new @@ -83,7 +83,7 @@ define Build/append-uImage-fakeroot-hdr rm -f $@.fakeroot $(STAGING_DIR_HOST)/bin/mkimage \ -A $(LINUX_KARCH) -O linux -T filesystem -C none \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE fakeroot' \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt fakeroot' \ -s \ $@.fakeroot cat $@.fakeroot >> $@ diff --git a/include/image.mk b/include/image.mk index fc6bf06e9..a1c378156 100644 --- a/include/image.mk +++ b/include/image.mk @@ -136,7 +136,7 @@ endef define Image/BuildKernel/MkuImage mkimage -A $(ARCH) -O linux -T kernel -C $(1) -a $(2) -e $(3) \ - -n '$(call toupper,$(ARCH)) LEDE Linux-$(LINUX_VERSION)' -d $(4) $(5) + -n '$(call toupper,$(ARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $(4) $(5) endef define Image/BuildKernel/MkFIT diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 7d96921a9..0fab32601 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -18,7 +18,7 @@ $(eval $(call TestHostCommand,working-make, \ $(MAKE) -v | grep -E 'Make (3\.8[1-9]|3\.9[0-9]|[4-9]\.)')) $(eval $(call TestHostCommand,case-sensitive-fs, \ - LEDE can only be built on a case-sensitive filesystem, \ + OpenWrt can only be built on a case-sensitive filesystem, \ rm -f $(TMP_DIR)/test.*; touch $(TMP_DIR)/test.fs; \ test ! -f $(TMP_DIR)/test.FS)) diff --git a/include/version.mk b/include/version.mk index 857bb2333..880721afe 100644 --- a/include/version.mk +++ b/include/version.mk @@ -10,13 +10,10 @@ # REVISION:=x # SOURCE_DATE_EPOCH:=x -RELEASE:=Reboot - PKG_CONFIG_DEPENDS += \ CONFIG_VERSION_BUG_URL \ CONFIG_VERSION_NUMBER \ CONFIG_VERSION_CODE \ - CONFIG_VERSION_NICK \ CONFIG_VERSION_REPO \ CONFIG_VERSION_DIST \ CONFIG_VERSION_MANUFACTURER \ @@ -36,18 +33,15 @@ VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),SNAPSHOT) VERSION_CODE:=$(call qstrip_escape,$(CONFIG_VERSION_CODE)) VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) -VERSION_NICK:=$(call qstrip_escape,$(CONFIG_VERSION_NICK)) -VERSION_NICK:=$(if $(VERSION_NICK),$(VERSION_NICK),$(RELEASE)) - VERSION_REPO:=$(call qstrip_escape,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/releases/17.01.4) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),http://downloads.lede-project.org/snapshots) VERSION_DIST:=$(call qstrip_escape,$(CONFIG_VERSION_DIST)) -VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),LEDE) +VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) VERSION_DIST_SANITIZED:=$(call sanitize,$(VERSION_DIST)) VERSION_MANUFACTURER:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER)) -VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),LEDE) +VERSION_MANUFACTURER:=$(if $(VERSION_MANUFACTURER),$(VERSION_MANUFACTURER),OpenWrt) VERSION_MANUFACTURER_URL:=$(call qstrip_escape,$(CONFIG_VERSION_MANUFACTURER_URL)) VERSION_MANUFACTURER_URL:=$(if $(VERSION_MANUFACTURER_URL),$(VERSION_MANUFACTURER_URL),http://lede-project.org/) @@ -93,8 +87,6 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \ -e 's,%v,\L$(subst $(space),_,$(VERSION_NUMBER)),g' \ -e 's,%C,$(VERSION_CODE),g' \ -e 's,%c,\L$(subst $(space),_,$(VERSION_CODE)),g' \ - -e 's,%N,$(VERSION_NICK),g' \ - -e 's,%n,\L$(subst $(space),_,$(VERSION_NICK)),g' \ -e 's,%D,$(VERSION_DIST),g' \ -e 's,%d,\L$(subst $(space),_,$(VERSION_DIST)),g' \ -e 's,%R,$(REVISION),g' \ @@ -109,4 +101,4 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \ -e 's,%P,$(VERSION_PRODUCT),g' \ -e 's,%h,$(VERSION_HWREV),g' -VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED)) +VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED)) \ No newline at end of file diff --git a/package/base-files/Makefile b/package/base-files/Makefile index d92069ec7..99690300b 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -34,7 +34,7 @@ define Package/base-files SECTION:=base CATEGORY:=Base system DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool - TITLE:=Base filesystem for Lede + TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)-$(REVISION) endef diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index 6230b0892..e181c9649 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -226,7 +226,7 @@ generate_static_system() { uci -q batch <<-EOF delete system.@system[0] add system system - set system.@system[-1].hostname='LEDE' + set system.@system[-1].hostname='OpenWrt' set system.@system[-1].timezone='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='64' @@ -236,10 +236,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.lede.pool.ntp.org' - add_list system.ntp.server='1.lede.pool.ntp.org' - add_list system.ntp.server='2.lede.pool.ntp.org' - add_list system.ntp.server='3.lede.pool.ntp.org' + add_list system.ntp.server='0.openwrt.pool.ntp.org' + add_list system.ntp.server='1.openwrt.pool.ntp.org' + add_list system.ntp.server='2.openwrt.pool.ntp.org' + add_list system.ntp.server='3.openwrt.pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/etc/banner b/package/base-files/files/etc/banner index 4ec646a93..f3af3c014 100644 --- a/package/base-files/files/etc/banner +++ b/package/base-files/files/etc/banner @@ -1,10 +1,8 @@ - _________ - / /\ _ ___ ___ ___ - / LE / \ | | | __| \| __| - / DE / \ | |__| _|| |) | _| - /________/ LE \ |____|___|___/|___| lede-project.org - \ \ DE / - \ LE \ / ----------------------------------------------------------- - \ DE \ / %N (%V, %C) - \________\/ ----------------------------------------------------------- - + _______ ________ __ + | |.-----.-----.-----.| | | |.----.| |_ + | - || _ | -__| || | | || _|| _| + |_______|| __|_____|__|__||________||__| |____| + |__| W I R E L E S S F R E E D O M + ----------------------------------------------------- + %D %V, %C + ----------------------------------------------------- diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 8c5f67729..531aa8cbc 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -7,7 +7,7 @@ USE_PROCD=1 validate_system_section() { uci_validate_section system system "${1}" \ - 'hostname:string:lede' \ + 'hostname:string:OpenWrt' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ 'timezone:string:UTC' \ diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 5442a749b..c3ec7bfdf 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -113,7 +113,7 @@ preinit_ip() { preinit_config_board fi - preinit_net_echo "Doing Lede Preinit\n" + preinit_net_echo "Doing OpenWrt Preinit\n" } preinit_ip_deconfig() { diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 87d2ac6c5..88ec50a8e 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -158,7 +158,7 @@ if VERSIONOPT config VERSION_DIST string prompt "Release distribution" - default "LEDE" + default "OpenWrt" help This is the name of the release distribution. If unspecified, it defaults to OpenWrt. @@ -201,13 +201,13 @@ if VERSIONOPT %c .. Configured release revision code or value of %R, lowercase %N .. Release name, uppercase %n .. Release name, lowercase - %D .. Distribution name or "Lede", uppercase - %d .. Distribution name or "lede", lowercase + %D .. Distribution name or "OpenWrt", uppercase + %d .. Distribution name or "openwrt", lowercase %T .. Target name %S .. Target/Subtarget name %A .. Package architecture %t .. Build taint flags, e.g. "no-all busybox" - %M .. Manufacturer name or "Lede" + %M .. Manufacturer name or "OpenWrt" %P .. Product name or "Generic" %h .. Hardware revision or "v0" diff --git a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh index 2780fa167..3643f6b1c 100644 --- a/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh +++ b/package/kernel/broadcom-wl/files/lib/wifi/broadcom.sh @@ -469,7 +469,7 @@ detect_broadcom() { set wireless.default_wl${i}.device=wl${i} set wireless.default_wl${i}.network=lan set wireless.default_wl${i}.mode=ap - set wireless.default_wl${i}.ssid=Lede${i#0} + set wireless.default_wl${i}.ssid=OpenWrt${i#0} set wireless.default_wl${i}.encryption=none EOF uci -q commit wireless diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 467392f75..22a00a592 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -122,7 +122,7 @@ detect_mac80211() { set wireless.default_radio${devidx}.device=radio${devidx} set wireless.default_radio${devidx}.network=lan set wireless.default_radio${devidx}.mode=ap - set wireless.default_radio${devidx}.ssid=LEDE + set wireless.default_radio${devidx}.ssid=OpenWrt set wireless.default_radio${devidx}.encryption=none EOF uci -q commit wireless diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 16925d58a..6b2d73370 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -356,8 +356,8 @@ hostapd_set_bss_options() { [ -n "$wps_possible" -a -n "$config_methods" ] && { set_default ext_registrar 0 set_default wps_device_type "6-0050F204-1" - set_default wps_device_name "Lede AP" - set_default wps_manufacturer "www.lede-project.org" + set_default wps_device_name "OpenWrt AP" + set_default wps_manufacturer "www.openwrt.org" set_default wps_independent 1 wps_state=2 diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config index d2b3d1545..36b43c89d 100644 --- a/package/network/services/lldpd/files/lldpd.config +++ b/package/network/services/lldpd/files/lldpd.config @@ -10,7 +10,7 @@ config lldpd config option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" # if empty, the distribution description is sent - #option lldp_description "Lede System" + #option lldp_description "OpenWrt System" # interfaces to listen on list interface "loopback" diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 39bce989b..c3d9ba050 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -16,7 +16,7 @@ find_release_info() [ -z "$PRETTY_NAME" ] && [ -s /etc/openwrt_version ] && \ PRETTY_NAME="$(cat /etc/openwrt_version)" - echo "${PRETTY_NAME:-Unknown Lede release} @ $(cat /proc/sys/kernel/hostname)" + echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)" } write_lldpd_conf() diff --git a/package/network/services/samba36/files/samba.config b/package/network/services/samba36/files/samba.config index b34a8dcaa..c79db0d32 100644 --- a/package/network/services/samba36/files/samba.config +++ b/package/network/services/samba36/files/samba.config @@ -1,6 +1,6 @@ config samba - option 'name' 'Lede' + option 'name' 'OpenWrt' option 'workgroup' 'WORKGROUP' - option 'description' 'Lede' + option 'description' 'OpenWrt' option 'homes' '1' diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index 28b0064df..ae0e0e230 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -23,9 +23,9 @@ smb_header() { local name workgroup description charset local hostname="$(uci_get system.@system[0].hostname)" - config_get name $1 name "${hostname:-Lede}" - config_get workgroup $1 workgroup "${hostname:-Lede}" - config_get description $1 description "Samba on ${hostname:-Lede}" + config_get name $1 name "${hostname:-OpenWrt}" + config_get workgroup $1 workgroup "${hostname:-OpenWrt}" + config_get description $1 description "Samba on ${hostname:-OpenWrt}" config_get charset $1 charset "UTF-8" mkdir -p /var/etc diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index 563c079a1..a7d769e18 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -83,7 +83,7 @@ config uhttpd main option tcp_keepalive 1 # Basic auth realm, defaults to local hostname -# option realm Lede +# option realm OpenWrt # Configuration file in busybox httpd format # option config /etc/httpd.conf diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 6b8be1c7e..47270bcc1 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -52,7 +52,7 @@ generate_keys() { [ -n "$GENKEY_CMD" ] && { $GENKEY_CMD \ -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \ - -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/O="${commonname:-Lede}$UNIQUEID"/CN="${commonname:-Lede}" + -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}" sync mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}" mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}" diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 364c1b22a..260bdac77 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -89,7 +89,7 @@ define Build/Configure $(PKG_BUILD_DIR)/Makefile $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile - echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-lede\";" \ + echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \ > $(PKG_BUILD_DIR)/include/SNAPSHOT.h endef diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 79059e506..2a8d9dd39 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -2332,10 +2332,10 @@ config BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG config BUSYBOX_DEFAULT_NSLOOKUP bool default n -config BUSYBOX_DEFAULT_NSLOOKUP_LEDE +config BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT bool default y -config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS bool default n config BUSYBOX_DEFAULT_NTPD diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index 14875d5e6..2d2a1c4a9 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -700,17 +700,17 @@ config BUSYBOX_CONFIG_NSLOOKUP default BUSYBOX_DEFAULT_NSLOOKUP help nslookup is a tool to query Internet name servers. -config BUSYBOX_CONFIG_NSLOOKUP_LEDE +config BUSYBOX_CONFIG_NSLOOKUP_OPENWRT bool "nslookup_lede" depends on !BUSYBOX_CONFIG_NSLOOKUP - default BUSYBOX_DEFAULT_NSLOOKUP_LEDE + default BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT help - nslookup is a tool to query Internet name servers (LEDE flavor). + nslookup is a tool to query Internet name servers (OpenWrt flavor). -config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_NSLOOKUP_LEDE && BUSYBOX_CONFIG_LONG_OPTS + default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_NSLOOKUP_OPENWRT && BUSYBOX_CONFIG_LONG_OPTS help Support long options for the nslookup applet. config BUSYBOX_CONFIG_NTPD diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch index e394dfb9b..14c0e87b3 100644 --- a/package/utils/busybox/patches/230-add_nslookup_lede.patch +++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch @@ -53,23 +53,23 @@ Signed-off-by: Jo-Philipp Wich + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + -+//config:config NSLOOKUP_LEDE -+//config: bool "nslookup_lede" ++//config:config NSLOOKUP_OPENWRT ++//config: bool "nslookup_openwrt" +//config: depends on !NSLOOKUP +//config: default y +//config: help +//config: nslookup is a tool to query Internet name servers (LEDE flavor). +//config: -+//config:config FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++//config:config FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y -+//config: depends on NSLOOKUP_LEDE && LONG_OPTS ++//config: depends on NSLOOKUP_OPENWRT && LONG_OPTS +//config: help +//config: Support long options for the nslookup applet. + -+//applet:IF_NSLOOKUP_LEDE(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) ++//applet:IF_NSLOOKUP_OPENWRT(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) + -+//kbuild:lib-$(CONFIG_NSLOOKUP_LEDE) += nslookup_lede.o ++//kbuild:lib-$(CONFIG_NSLOOKUP_OPENWRT) += nslookup_lede.o + +//usage:#define nslookup_lede_trivial_usage +//usage: "[HOST] [SERVER]" @@ -753,7 +753,7 @@ Signed-off-by: Jo-Philipp Wich +} + + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +static const char nslookup_longopts[] ALIGN1 = + "type\0" Required_argument "q" + "querytype\0" Required_argument "q" @@ -778,7 +778,7 @@ Signed-off-by: Jo-Philipp Wich + unsigned int types = 0; + HEADER *header; + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + applet_long_options = nslookup_longopts; +#endif + diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 85f70c5e7..389e10ccf 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -11,7 +11,7 @@ FOUND_BUG=0 bugcheck_generic() { - echo "LEDE crashlog report" > $CRASHDIR/info.txt + echo "OpenWrt crashlog report" > $CRASHDIR/info.txt date >> $CRASHDIR/info.txt echo >> $CRASHDIR/info.txt echo "uname" >> $CRASHDIR/info.txt diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 05fd772c9..5224ea49c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -174,7 +174,7 @@ if ($tree) { } if (!defined $root) { - print "Must be run from the top-level dir. of a LEDE tree\n"; + print "Must be run from the top-level dir. of a OpenWrt tree\n"; exit(2); } } diff --git a/scripts/config/mconf.c b/scripts/config/mconf.c index c366e21fb..540fa911e 100644 --- a/scripts/config/mconf.c +++ b/scripts/config/mconf.c @@ -25,7 +25,7 @@ static const char mconf_readme[] = N_( "Overview\n" "--------\n" -"Some LEDE features may be built directly into the image.\n" +"Some OpenWrt features may be built directly into the image.\n" "Some may be made into installable ipkg packages. Some features\n" "may be completely removed altogether.\n" "\n" diff --git a/scripts/qemustart b/scripts/qemustart index 5cadd7d6a..6c2254e3a 100755 --- a/scripts/qemustart +++ b/scripts/qemustart @@ -107,8 +107,8 @@ Examples $SELF malta le64 $SELF malta be-glibc $SELF armvirt 32 \\ - --kernel bin/targets/armvirt/32/lede-armvirt-32-zImage \\ - --rootfs bin/targets/armvirt/32/lede-armvirt-32-root.ext4 + --kernel bin/targets/armvirt/32/openwrt-armvirt-32-zImage \\ + --rootfs bin/targets/armvirt/32/openwrt-armvirt-32-root.ext4 EOF } @@ -158,12 +158,12 @@ start_qemu_armvirt() { 32) qemu_exe="qemu-system-arm" cpu="cortex-a15" - [ -n "$kernel" ] || kernel="$o_bindir/lede-$o_target-${o_subtarget%-*}-zImage-initramfs" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-zImage-initramfs" ;; 64) qemu_exe="qemu-system-aarch64" cpu="cortex-a57" - [ -n "$kernel" ] || kernel="$o_bindir/lede-$o_target-${o_subtarget%-*}-Image-initramfs" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-Image-initramfs" ;; *) __errmsg "target $o_target: unknown subtarget $o_subtarget" @@ -199,7 +199,7 @@ start_qemu_malta() { [ "$(echo "$o_subtarget" | grep -o '^..')" = "le" ] && isel="el" qemu_exe="qemu-system-mips$is64$isel" - [ -n "$kernel" ] || kernel="$o_bindir/lede-malta-${o_subtarget%-*}-vmlinux-initramfs.elf" + [ -n "$kernel" ] || kernel="$o_bindir/openwrt-malta-${o_subtarget%-*}-vmlinux-initramfs.elf" # NOTE: order of wan, lan -device arguments matters as it will affect which # one will be actually used as the wan, lan network interface inside the @@ -216,7 +216,7 @@ start_qemu_x86() { local qemu_exe [ -n "$rootfs" ] || { - rootfs="$o_bindir/lede-$o_target-${o_subtarget%-*}-combined-ext4.img" + rootfs="$o_bindir/openwrt-$o_target-${o_subtarget%-*}-combined-ext4.img" if [ ! -f "$rootfs" -a -s "$rootfs.gz" ]; then gunzip "$rootfs.gz" fi diff --git a/target/imagebuilder/Config.in b/target/imagebuilder/Config.in index 49bb741f7..c1a5212f6 100644 --- a/target/imagebuilder/Config.in +++ b/target/imagebuilder/Config.in @@ -1,5 +1,5 @@ config IB - bool "Build the LEDE Image Builder" + bool "Build the OpenWrt Image Builder" depends on !EXTERNAL_TOOLCHAIN default BUILDBOT help diff --git a/target/imagebuilder/files/repositories.conf b/target/imagebuilder/files/repositories.conf index 93ed97b29..8f1f27fe5 100644 --- a/target/imagebuilder/files/repositories.conf +++ b/target/imagebuilder/files/repositories.conf @@ -1,4 +1,4 @@ ## Place your custom repositories here, they must match the architecture and version. # src/gz %n %U -# src custom file:///usr/src/lede/bin/%T/packages +# src custom file:///usr/src/openwrt/bin/%T/packages diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index 6ed183c37..ee85292d5 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -116,7 +116,7 @@ define Build/create-uImage-dtb # flat_dt target expect FIT image - which WNDR4700's uboot doesn't support -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) \ -O linux -T kernel -C none \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' \ -d $(IMAGE_KERNEL).dtb $@.new @mv $@.new $@ endef diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 1d64ef45e..3c0d99440 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -12,7 +12,7 @@ define Build/mkwrggimg $(STAGING_DIR_HOST)/bin/mkwrggimg -b \ -i $@ -o $@.imghdr -d /dev/mtdblock/1 \ -m $(BOARDNAME) -s $(DAP_SIGNATURE) \ - -v LEDE -B $(REVISION) + -v OpenWrt -B $(REVISION) mv $@.imghdr $@ endef @@ -66,7 +66,7 @@ define Build/uImageHiWiFi mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new + -n 'tw150v1 $(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new @mv $@.new $@ endef diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 3069d4a30..d83db22a4 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -486,11 +486,11 @@ define Image/Build/Belkin $(eval rootsize=$(call mtdpartsize,rootfs,$(4))) $(call Sysupgrade/RKuImage,$(1),$(2),$(kernsize),$(rootsize)) if [ -e "$(call sysupname,$(1),$(2))" ]; then \ - edimax_fw_header -m $(5) -v "$(shell echo -n LEDE$(REVISION) | cut -c -13)" \ + edimax_fw_header -m $(5) -v "$(shell echo -n OpenWrt$(REVISION) | cut -c -13)" \ -n "uImage" \ -i $(KDIR_TMP)/vmlinux-$(2).uImage \ -o $(KDIR_TMP)/$(2)-uImage; \ - edimax_fw_header -m $(5) -v "$(shell echo -n LEDE$(REVISION) | cut -c -13)" \ + edimax_fw_header -m $(5) -v "$(shell echo -n OpenWrt$(REVISION) | cut -c -13)" \ -n "rootfs" \ -i $(KDIR)/root.$(1) \ -o $(KDIR_TMP)/$(2)-rootfs; \ diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk index ece4c7db9..bf4f31b76 100644 --- a/target/linux/ar71xx/image/tp-link.mk +++ b/target/linux/ar71xx/image/tp-link.mk @@ -39,7 +39,7 @@ define Build/uImageArcher mkimage -A $(LINUX_KARCH) \ -O linux -T kernel \ -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(call toupper,$(LINUX_KARCH)) LEDE Linux-$(LINUX_VERSION)' -d $@ $@.new + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new @mv $@.new $@ endef diff --git a/target/linux/armvirt/README b/target/linux/armvirt/README index fba71a62f..ae0d2ada6 100644 --- a/target/linux/armvirt/README +++ b/target/linux/armvirt/README @@ -4,18 +4,18 @@ QEMU ARM virt machine. Run with qemu-system-arm # boot with initramfs embedded in - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage-initramfs + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage-initramfs # boot with accel=kvm qemu-system-arm -nographic -M virt,accel=kvm -cpu host -m 64 -kernel - lede-armvirt-32-zImage-initramfs + openwrt-armvirt-32-zImage-initramfs # boot with a separate rootfs - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage \ - -drive file=lede-armvirt-32-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait' + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \ + -drive file=openwrt-armvirt-32-root.ext4,format=raw,if=virtio -append 'root=/dev/vda rootwait' # boot with local dir as rootfs - qemu-system-arm -nographic -M virt -m 64 -kernel lede-armvirt-32-zImage \ + qemu-system-arm -nographic -M virt -m 64 -kernel openwrt-armvirt-32-zImage \ -fsdev local,id=rootdev,path=root-armvirt/,security_model=none \ -device virtio-9p-pci,fsdev=rootdev,mount_tag=/dev/root \ -append 'rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p' @@ -23,10 +23,10 @@ Run with qemu-system-arm Run with kvmtool # start a named machine - lkvm run -k lede-armvirt-32-zImage -i lede-armvirt-32-rootfs.cpio --name armvirt0 + lkvm run -k openwrt-armvirt-32-zImage -i openwrt-armvirt-32-rootfs.cpio --name armvirt0 # start with virtio-9p rootfs - lkvm run -k lede-armvirt-32-zImage -d root-armvirt/ + lkvm run -k openwrt-armvirt-32-zImage -d root-armvirt/ # stop "armvirt0" lkvm stop --name armvirt0 @@ -37,4 +37,4 @@ Run with kvmtool The multi-platform ARMv8 target can be used with QEMU: qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \ - -kernel lede-armvirt-64-Image-initramfs \ + -kernel openwrt-armvirt-64-Image-initramfs \ diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk index 6ad15a25e..4e90eb050 100644 --- a/target/linux/brcm63xx/image/bcm63xx.mk +++ b/target/linux/brcm63xx/image/bcm63xx.mk @@ -978,7 +978,7 @@ define Device/NEUFBOX4-SER DEVICE_DTS := nb4-ser-r0 CFE_BOARD_ID := 96358VW CFE_CHIP_ID := 6358 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef @@ -990,7 +990,7 @@ define Device/NEUFBOX4-FXC DEVICE_DTS := nb4-fxc-r1 CFE_BOARD_ID := 96358VW CFE_CHIP_ID := 6358 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef @@ -1002,7 +1002,7 @@ define Device/NEUFBOX6 DEVICE_DTS := nb6-ser-r0 CFE_BOARD_ID := NB6-SER-r0 CFE_CHIP_ID := 6362 - CFE_EXTRAS += --rsa-signature "LEDE-$(firstword $(subst -,$(space),$(REVISION)))" + CFE_EXTRAS += --rsa-signature "OpenWrt-$(firstword $(subst -,$(space),$(REVISION)))" DEVICE_PACKAGES := \ $(B43_PACKAGES) $(USB2_PACKAGES) endef diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 9326c62d4..f6795ee61 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -39,7 +39,7 @@ endef define Build/fullimage mkimage -A mips -O linux -C lzma -T filesystem -a 0x00 \ - -e 0x00 -n 'LEDE RootFS' \ + -e 0x00 -n 'OpenWrt RootFS' \ -d $(IMAGE_ROOTFS) $(IMAGE_ROOTFS).new cat $(IMAGE_KERNEL) $(IMAGE_ROOTFS).new > $@.tmp diff --git a/target/linux/mcs814x/image/Makefile b/target/linux/mcs814x/image/Makefile index 7be7f8cd9..3afd660c1 100644 --- a/target/linux/mcs814x/image/Makefile +++ b/target/linux/mcs814x/image/Makefile @@ -20,7 +20,7 @@ UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage define Image/Build/MkuImage mkimage -A arm -O linux -T kernel -a $(LOADADDR) -C none -e $(LOADADDR) \ - -n 'ARM LEDE Linux-$(LINUX_VERSION)' -d $(1) $(2); + -n 'ARM OpenWrt Linux-$(LINUX_VERSION)' -d $(1) $(2); endef define Image/Build/DTB diff --git a/target/linux/mvebu/image/cfbase-boot.script b/target/linux/mvebu/image/cfbase-boot.script index 5f9bcd70b..89fa1dc57 100644 --- a/target/linux/mvebu/image/cfbase-boot.script +++ b/target/linux/mvebu/image/cfbase-boot.script @@ -9,8 +9,8 @@ setenv fdtfile armada-388-clearfog-base.dtb # generate bootargs for rootfs on MMC if test "${devtype}" = "mmc"; then - setexpr lede_rootpart ${distro_bootpart} + 1 - setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${lede_rootpart} rootfstype=auto rootwait + setexpr openwrt_rootpart ${distro_bootpart} + 1 + setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait fi # here one could add logic for other rootfs device types such as scsi and usb diff --git a/target/linux/mvebu/image/cfpro-boot.script b/target/linux/mvebu/image/cfpro-boot.script index e1523f8fb..1588c1546 100644 --- a/target/linux/mvebu/image/cfpro-boot.script +++ b/target/linux/mvebu/image/cfpro-boot.script @@ -5,8 +5,8 @@ # generate bootargs for rootfs on MMC if test "${devtype}" = "mmc"; then - setexpr lede_rootpart ${distro_bootpart} + 1 - setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${lede_rootpart} rootfstype=auto rootwait + setexpr openwrt_rootpart ${distro_bootpart} + 1 + setenv bootargs ${bootargs} root=/dev/mmcblk${devnum}p${openwrt_rootpart} rootfstype=auto rootwait fi # here one could add logic for other rootfs device types such as scsi and usb diff --git a/target/linux/omap24xx/base-files/etc/config/wireless b/target/linux/omap24xx/base-files/etc/config/wireless index f61721e51..b640ce6c2 100644 --- a/target/linux/omap24xx/base-files/etc/config/wireless +++ b/target/linux/omap24xx/base-files/etc/config/wireless @@ -15,6 +15,6 @@ config wifi-iface option powersave 1 option network lan option mode sta - option ssid LEDE + option ssid OpenWrt # option encryption psk2 # option key "foobar" diff --git a/target/linux/uml/README b/target/linux/uml/README index d7cba1de9..aa7bad91a 100644 --- a/target/linux/uml/README +++ b/target/linux/uml/README @@ -1,4 +1,4 @@ -LEDE inside a user mode linux. Why would we even want this many ask? +OpenWrt inside a user mode linux. Why would we even want this many ask? There are potentially a lot of reasons, one obvious one to me, it allows folks to 'kick the tires' without actually flashing up any hardware. It's @@ -17,7 +17,8 @@ build it all In your bin directory you will find a kernel and an ext4 root file system when it's finished. Just run it like this:- -bin/targets/uml/generic/lede-uml-vmlinux ubd0=bin/targets/uml/generic/lede-uml-ext4.img +bin/targets/uml/generic/lede-uml-vmlinux +ubd0=bin/targets/uml/generic/openwrt-uml-ext4.img The uml will start, and eventually the serial console of the uml will be at your console prompt. If you would like it in xterms, substitute con=xterm and con0=xterm. diff --git a/target/linux/x86/image/grub-iso.cfg b/target/linux/x86/image/grub-iso.cfg index 32ee687c6..3d47a95a4 100644 --- a/target/linux/x86/image/grub-iso.cfg +++ b/target/linux/x86/image/grub-iso.cfg @@ -5,6 +5,6 @@ set default="0" set timeout="@TIMEOUT@" set root='(cd)' -menuentry "LEDE" { +menuentry "OpenWrt" { linux /boot/vmlinuz @CMDLINE@ noinitrd } diff --git a/target/linux/x86/image/grub.cfg b/target/linux/x86/image/grub.cfg index acca036a2..9ec6b2d39 100644 --- a/target/linux/x86/image/grub.cfg +++ b/target/linux/x86/image/grub.cfg @@ -5,9 +5,9 @@ set default="0" set timeout="@TIMEOUT@" set root='(@ROOT@)' -menuentry "LEDE" { +menuentry "OpenWrt" { linux /boot/vmlinuz @CMDLINE@ noinitrd } -menuentry "LEDE (failsafe)" { +menuentry "OpenWrt (failsafe)" { linux /boot/vmlinuz failsafe=true @CMDLINE@ noinitrd } diff --git a/target/sdk/Config.in b/target/sdk/Config.in index 095759d06..0c8a61d24 100644 --- a/target/sdk/Config.in +++ b/target/sdk/Config.in @@ -1,10 +1,10 @@ config SDK - bool "Build the LEDE SDK" + bool "Build the OpenWrt SDK" depends on !EXTERNAL_TOOLCHAIN default BUILDBOT help This is essentially a stripped-down version of the buildroot with a precompiled toolchain. It can be used to develop and - test packages for LEDE before including them in the buildroot + test packages for OpenWrt before including them in the buildroot diff --git a/target/sdk/files/README.SDK b/target/sdk/files/README.SDK index 6f04f94d2..6699dffcf 100644 --- a/target/sdk/files/README.SDK +++ b/target/sdk/files/README.SDK @@ -1,7 +1,7 @@ -This is the LEDE SDK. It contains a stripped-down version of +This is the OpenWrt SDK. It contains a stripped-down version of the buildroot. You can use it to test/develop packages without having to compile your own toolchain or any of the libraries -included with LEDE. +included with OpenWrt. To use it, just put your buildroot-compatible package directory (including its dependencies) in the subdir 'package/' and run diff --git a/target/toolchain/Config.in b/target/toolchain/Config.in index e377c20a1..5a6ecefeb 100644 --- a/target/toolchain/Config.in +++ b/target/toolchain/Config.in @@ -1,8 +1,8 @@ config MAKE_TOOLCHAIN - bool "Package the LEDE-based Toolchain" + bool "Package the OpenWrt-based Toolchain" depends on !EXTERNAL_TOOLCHAIN help Package the created toolchain as a tarball under the bin/ directory as - LEDE-Toolchain-$(BOARD)-for-$(ARCH)$(ARCH_SUFFIX)-gcc-$(GCCV)$(DIR_SUFFIX). + OpenWrt-Toolchain-$(BOARD)-for-$(ARCH)$(ARCH_SUFFIX)-gcc-$(GCCV)$(DIR_SUFFIX). For example, a toolchain for the MIPS architecture might be named - LEDE-Toolchain-malta-for-mipsel_mips32-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2. + OpenWrt-Toolchain-malta-for-mipsel_mips32-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2. diff --git a/target/toolchain/files/README.TOOLCHAIN b/target/toolchain/files/README.TOOLCHAIN index 86b0189d3..7c0586b20 100644 --- a/target/toolchain/files/README.TOOLCHAIN +++ b/target/toolchain/files/README.TOOLCHAIN @@ -1,2 +1,2 @@ -This is the LEDE SDK. It contains just the toolchain created +This is the OpenWrt SDK. It contains just the toolchain created by buildroot. diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index ec4d9fcc9..abf69bfdc 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -53,7 +53,7 @@ endif PATCH_DIR=../patches/$(GCC_VERSION) BUGURL=http://www.lede-project.org/bugs/ -PKGVERSION=LEDE GCC $(PKG_VERSION) $(REVISION) +PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION) HOST_BUILD_PARALLEL:=1 From 0150df166a8243aa181a3b726bf2132a9d03da25 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:09:23 +0800 Subject: [PATCH 32/95] kernel: bump 4.9 to 4.9.67 --- include/kernel-version.mk | 4 +- .../432-spi-rb4xx-spi-driver.patch | 2 +- .../433-spi-rb4xx-cpld-driver.patch | 2 +- .../patches-4.9/435-spi-vsc7385_driver.patch | 2 +- ...-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch | 2 +- .../hack-4.9/904-debloat_dma_buf.patch | 2 +- ...ng-comment-related-to-link-detection.patch | 43 +++++++++++++++++++ ...ng-with-source-address-failed-policy.patch | 8 ++-- ...19-report-accurate-fixed-clock-rates.patch | 2 +- ...dd-support-for-Lantiq-SSC-SPI-contro.patch | 2 +- .../301-arch-support-layerscape.patch | 2 +- .../815-spi-support-layerscape.patch | 10 ----- ...ength-of-ID-before-reading-bits-per-.patch | 2 +- .../ramips/patches-4.9/0040-nand-hack.patch | 4 +- ...SPI-ralink-add-Ralink-SoC-spi-driver.patch | 2 +- .../0043-spi-add-mt7621-support.patch | 2 +- .../ramips/patches-4.9/0099-pci-mt7620.patch | 9 ---- .../0102-MIPS-ralink-Fix-MT7628-pinmux.patch | 33 -------------- ...-ralink-Fix-typo-in-mt7628-pinmux-function | 31 ------------- .../0901-spansion_nand_id_fix.patch | 4 +- 20 files changed, 64 insertions(+), 104 deletions(-) create mode 100644 target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch delete mode 100644 target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch delete mode 100644 target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 8fb560ec4..f1fb66a36 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,11 +4,11 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .100 -LINUX_VERSION-4.9 = .65 +LINUX_VERSION-4.9 = .67 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.100 = 9936cd99c4bd35f6bc6962c9acdd1fa2ac8999e07a9be6a94a03b5492f1bd14f -LINUX_KERNEL_HASH-4.9.65 = 24ba70877549a3cf25dc5f12efd260d3e957bce64c087de98baf8968ee514895 +LINUX_KERNEL_HASH-4.9.67 = 7fbaa7dcc17877dfa0c96fb9a7d2f4ffed20ceeb13cbbeb18d77213c6cf75f7d ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch index e896d0bdf..5428d3d1c 100644 --- a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch +++ b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -533,6 +533,12 @@ config SPI_QUP +@@ -534,6 +534,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch index c44acab32..b1cd6a545 100644 --- a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch +++ b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -761,6 +761,13 @@ config SPI_TLE62X0 +@@ -762,6 +762,13 @@ config SPI_TLE62X0 sysfs interface, with each line presented as a kind of GPIO exposing both switch control and diagnostic feedback. diff --git a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch index f9f1f7a1e..fe6acde70 100644 --- a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch +++ b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -768,6 +768,11 @@ config SPI_RB4XX_CPLD +@@ -769,6 +769,11 @@ config SPI_RB4XX_CPLD SPI driver for the Xilinx CPLD chip present on the MikroTik RB4xx boards. diff --git a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch index 3e28b7e3c..15c59ce95 100644 --- a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch +++ b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch @@ -1,6 +1,6 @@ --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c -@@ -2003,7 +2003,8 @@ static void pcie_write_mrrs(struct pci_d +@@ -2014,7 +2014,8 @@ static void pcie_write_mrrs(struct pci_d /* In the "safe" case, do not configure the MRRS. There appear to be * issues with setting MRRS to 0 on a number of devices. */ diff --git a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch index b9a5c1dca..4f432c356 100644 --- a/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch +++ b/target/linux/generic/hack-4.9/904-debloat_dma_buf.patch @@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2171,6 +2171,7 @@ int wake_up_state(struct task_struct *p, +@@ -2170,6 +2170,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch new file mode 100644 index 000000000..f980bb080 --- /dev/null +++ b/target/linux/generic/pending-4.9/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch @@ -0,0 +1,43 @@ +From patchwork Fri Jul 21 18:36:24 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/5] e1000e: Fix wrong comment related to link detection +From: Benjamin Poirier +X-Patchwork-Id: 9857489 +Message-Id: <20170721183627.13373-2-bpoirier@suse.com> +To: Jeff Kirsher +Cc: Lennart Sorensen , + intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Date: Fri, 21 Jul 2017 11:36:24 -0700 + +Reading e1000e_check_for_copper_link() shows that get_link_status is set to +false after link has been detected. Therefore, it stays TRUE until then. + +Signed-off-by: Benjamin Poirier +Tested-by: Aaron Brown +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5066,7 +5066,7 @@ static bool e1000e_has_link(struct e1000 + + /* get_link_status is set on LSC (link status) interrupt or + * Rx sequence error interrupt. get_link_status will stay +- * false until the check_for_link establishes link ++ * true until the check_for_link establishes link + * for copper adapters ONLY + */ + switch (hw->phy.media_type) { +@@ -5084,7 +5084,7 @@ static bool e1000e_has_link(struct e1000 + break; + case e1000_media_type_internal_serdes: + ret_val = hw->mac.ops.check_for_link(hw); +- link_active = adapter->hw.mac.serdes_has_link; ++ link_active = hw->mac.serdes_has_link; + break; + default: + case e1000_media_type_unknown: diff --git a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 3b09bffa1..e9c247fad 100644 --- a/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.9/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3714,6 +3753,17 @@ static int __net_init ip6_route_net_init +@@ -3718,6 +3757,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -218,7 +218,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3732,6 +3782,8 @@ out: +@@ -3736,6 +3786,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -227,7 +227,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3749,6 +3801,7 @@ static void __net_exit ip6_route_net_exi +@@ -3753,6 +3805,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3822,6 +3875,9 @@ void __init ip6_route_init_special_entri +@@ -3826,6 +3879,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch b/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch index 6f7665390..be9c4eb1b 100644 --- a/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch +++ b/target/linux/ipq806x/patches-4.9/0016-clk-ipq4019-report-accurate-fixed-clock-rates.patch @@ -13,7 +13,7 @@ Signed-off-by: Matthew McClintock --- a/drivers/clk/qcom/gcc-ipq4019.c +++ b/drivers/clk/qcom/gcc-ipq4019.c -@@ -1317,12 +1317,12 @@ static int gcc_ipq4019_probe(struct plat +@@ -1327,12 +1327,12 @@ static int gcc_ipq4019_probe(struct plat { struct device *dev = &pdev->dev; diff --git a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch index da48ae3a1..64597cec8 100644 --- a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch +++ b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch @@ -65,7 +65,7 @@ Signed-off-by: Mark Brown +}; --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -403,6 +403,14 @@ config SPI_NUC900 +@@ -404,6 +404,14 @@ config SPI_NUC900 help SPI driver for Nuvoton NUC900 series ARM SoCs diff --git a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch index 66860a0bb..7216933b7 100644 --- a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch @@ -310,7 +310,7 @@ Signed-off-by: Yangbo Lu #define PROT_SECT_NORMAL (PROT_SECT_DEFAULT | PMD_SECT_PXN | PMD_SECT_UXN | PMD_ATTRINDX(MT_NORMAL)) --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h -@@ -356,6 +356,11 @@ static inline int pmd_protnone(pmd_t pmd +@@ -370,6 +370,11 @@ static inline int pmd_protnone(pmd_t pmd __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRnE) | PTE_PXN | PTE_UXN) #define pgprot_writecombine(prot) \ __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) diff --git a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch index b9c531651..761680913 100644 --- a/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/815-spi-support-layerscape.patch @@ -15,16 +15,6 @@ Signed-off-by: Yangbo Lu drivers/spi/spi-fsl-dspi.c | 309 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 305 insertions(+), 5 deletions(-) ---- a/drivers/spi/Kconfig -+++ b/drivers/spi/Kconfig -@@ -365,6 +365,7 @@ config SPI_FSL_SPI - config SPI_FSL_DSPI - tristate "Freescale DSPI controller" - select REGMAP_MMIO -+ depends on HAS_DMA - depends on SOC_VF610 || SOC_LS1021A || ARCH_LAYERSCAPE || COMPILE_TEST - help - This enables support for the Freescale DSPI controller in master --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -15,6 +15,8 @@ diff --git a/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch b/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch index 69d96932b..f360613f9 100644 --- a/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch +++ b/target/linux/pistachio/patches-4.9/411-mtd-nand-Check-length-of-ID-before-reading-bits-per-.patch @@ -21,7 +21,7 @@ Signed-off-by: Ezequiel Garcia --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -4040,7 +4040,8 @@ static bool find_full_id_nand(struct mtd +@@ -4043,7 +4043,8 @@ static bool find_full_id_nand(struct mtd mtd->erasesize = type->erasesize; mtd->oobsize = type->oobsize; diff --git a/target/linux/ramips/patches-4.9/0040-nand-hack.patch b/target/linux/ramips/patches-4.9/0040-nand-hack.patch index fe2b12d2c..e0bd5f602 100644 --- a/target/linux/ramips/patches-4.9/0040-nand-hack.patch +++ b/target/linux/ramips/patches-4.9/0040-nand-hack.patch @@ -18,7 +18,7 @@ if (ret < 0) { if (use_bufpoi) /* Invalidate page cache */ -@@ -3203,8 +3207,11 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -3206,8 +3210,11 @@ int nand_erase_nand(struct mtd_info *mtd (page + pages_per_block)) chip->pagebuf = -1; @@ -31,7 +31,7 @@ /* * See if operation failed and additional status checks are * available -@@ -4398,6 +4405,7 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -4401,6 +4408,7 @@ int nand_scan_ident(struct mtd_info *mtd * cmdfunc() both expect cmd_ctrl() to be populated, * so we need to check that that's the case */ diff --git a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 0288b9755..3150dd838 100644 --- a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -16,7 +16,7 @@ Acked-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -533,6 +533,12 @@ config SPI_QUP +@@ -534,6 +534,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch index 339dc5a87..984f4ada9 100644 --- a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -539,6 +539,12 @@ config SPI_RT2880 +@@ -540,6 +540,12 @@ config SPI_RT2880 help This selects a driver for the Ralink RT288x/RT305x SPI Controller. diff --git a/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch b/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch index f532f30db..997fb6a2b 100644 --- a/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch +++ b/target/linux/ramips/patches-4.9/0099-pci-mt7620.patch @@ -8,12 +8,3 @@ #define PPLL_DRV 0xa0 #define PDRV_SW_SET (1<<31) -@@ -121,7 +120,7 @@ static int wait_pciephy_busy(void) - else - break; - if (retry++ > WAITRETRY_MAX) { -- printk(KERN_WARN "PCIE-PHY retry failed.\n"); -+ pr_warn("PCIE-PHY retry failed.\n"); - return -1; - } - } diff --git a/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch b/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch deleted file mode 100644 index f2d1ab170..000000000 --- a/target/linux/ramips/patches-4.9/0102-MIPS-ralink-Fix-MT7628-pinmux.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8ef4b43cd3794d63052d85898e42424fd3b14d24 Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 11 May 2017 08:11:14 +0200 -Subject: [PATCH 1/2] MIPS: ralink: Fix MT7628 pinmux - -According to the datasheet the REFCLK pin is shared with GPIO#37 and -the PERST pin is shared with GPIO#36. - -Fixes: 53263a1c6852 ("MIPS: ralink: add mt7628an support") -Signed-off-by: Mathias Kresin -Acked-by: John Crispin -Cc: Ralf Baechle -Cc: linux-mips@linux-mips.org -Cc: # 3.19+ -Patchwork: https://patchwork.linux-mips.org/patch/16046/ -Signed-off-by: James Hogan ---- - arch/mips/ralink/mt7620.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/arch/mips/ralink/mt7620.c -+++ b/arch/mips/ralink/mt7620.c -@@ -141,8 +141,8 @@ static struct rt2880_pmx_func i2c_grp_mt - FUNC("i2c", 0, 4, 2), - }; - --static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 36, 1) }; --static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 37, 1) }; -+static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 37, 1) }; -+static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; - static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; - static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; - diff --git a/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function b/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function deleted file mode 100644 index 9c77840f2..000000000 --- a/target/linux/ramips/patches-4.9/0103-MIPS-ralink-Fix-typo-in-mt7628-pinmux-function +++ /dev/null @@ -1,31 +0,0 @@ -From 05a67cc258e75ac9758e6f13d26337b8be51162a Mon Sep 17 00:00:00 2001 -From: Mathias Kresin -Date: Thu, 11 May 2017 08:11:15 +0200 -Subject: [PATCH 2/2] MIPS: ralink: Fix typo in mt7628 pinmux function - -There is a typo inside the pinmux setup code. The function is called -refclk and not reclk. - -Fixes: 53263a1c6852 ("MIPS: ralink: add mt7628an support") -Signed-off-by: Mathias Kresin -Acked-by: John Crispin -Cc: Ralf Baechle -Cc: linux-mips@linux-mips.org -Cc: # 3.19+ -Patchwork: https://patchwork.linux-mips.org/patch/16047/ -Signed-off-by: James Hogan ---- - arch/mips/ralink/mt7620.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/mips/ralink/mt7620.c -+++ b/arch/mips/ralink/mt7620.c -@@ -141,7 +141,7 @@ static struct rt2880_pmx_func i2c_grp_mt - FUNC("i2c", 0, 4, 2), - }; - --static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("reclk", 0, 37, 1) }; -+static struct rt2880_pmx_func refclk_grp_mt7628[] = { FUNC("refclk", 0, 37, 1) }; - static struct rt2880_pmx_func perst_grp_mt7628[] = { FUNC("perst", 0, 36, 1) }; - static struct rt2880_pmx_func wdt_grp_mt7628[] = { FUNC("wdt", 0, 38, 1) }; - static struct rt2880_pmx_func spi_grp_mt7628[] = { FUNC("spi", 0, 7, 4) }; diff --git a/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch b/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch index 4edc7416a..daaa0aca6 100644 --- a/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch +++ b/target/linux/ramips/patches-4.9/0901-spansion_nand_id_fix.patch @@ -13,7 +13,7 @@ Signed-off-by: Nikolay Martynov --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3850,6 +3850,7 @@ static void nand_decode_ext_id(struct mt +@@ -3853,6 +3853,7 @@ static void nand_decode_ext_id(struct mt /* * Field definitions are in the following datasheets: * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) @@ -21,7 +21,7 @@ Signed-off-by: Nikolay Martynov * New Samsung (6 byte ID): Samsung K9GAG08U0F (p.44) * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22) * -@@ -3947,6 +3948,19 @@ static void nand_decode_ext_id(struct mt +@@ -3950,6 +3951,19 @@ static void nand_decode_ext_id(struct mt *busw = (extid & 0x01) ? NAND_BUSWIDTH_16 : 0; /* From 9e5e9c5c843581942f8f0bab5be4d0871a9893de Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:11:36 +0800 Subject: [PATCH 33/95] change feeds from LEDE to OpenWrt --- include/feeds.mk | 6 +++--- package/base-files/files/etc/openwrt_release | 3 +-- package/base-files/image-config.in | 2 -- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/feeds.mk b/include/feeds.mk index f89687a27..b85438301 100644 --- a/include/feeds.mk +++ b/include/feeds.mk @@ -41,10 +41,10 @@ endef # 1: destination file define FeedSourcesAppend ( \ - echo "src/gz %n_core %U/targets/%S/packages"; \ + echo "src/gz %d_core %U/targets/%S/packages"; \ $(strip $(if $(CONFIG_PER_FEED_REPO), \ - $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %n_$(feed) %U/packages/%A/$(feed)";) \ + $(foreach feed,base $(FEEDS_ENABLED),echo "src/gz %d_$(feed) %U/packages/%A/$(feed)";) \ $(if $(CONFIG_PER_FEED_REPO_ADD_DISABLED), \ - $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %n_$(feed) %U/packages/%A/$(feed)";)))) \ + $(foreach feed,$(FEEDS_DISABLED),echo "$(if $(CONFIG_PER_FEED_REPO_ADD_COMMENTED),# )src/gz %d_$(feed) %U/packages/%A/$(feed)";)))) \ ) >> $(1) endef diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release index da86208f7..d03400ca0 100644 --- a/package/base-files/files/etc/openwrt_release +++ b/package/base-files/files/etc/openwrt_release @@ -1,8 +1,7 @@ DISTRIB_ID='%D' DISTRIB_RELEASE='%V' DISTRIB_REVISION='%R' -DISTRIB_CODENAME='%n' DISTRIB_TARGET='%S' DISTRIB_ARCH='%A' -DISTRIB_DESCRIPTION='%D %N %V %C' +DISTRIB_DESCRIPTION='%D %V %C' DISTRIB_TAINTS='%t' diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 88ec50a8e..45ca1306f 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -199,8 +199,6 @@ if VERSIONOPT %v .. Configured release version number or "snapshot", lowercase %C .. Configured release revision code or value of %R, uppercase %c .. Configured release revision code or value of %R, lowercase - %N .. Release name, uppercase - %n .. Release name, lowercase %D .. Distribution name or "OpenWrt", uppercase %d .. Distribution name or "openwrt", lowercase %T .. Target name From d324aa0b1a7e6a162da4ba126fe51151740c66fc Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:15:28 +0800 Subject: [PATCH 34/95] update MTK MT76 drivers --- package/kernel/mt76/Makefile | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 3428ea1f7..6d96ff264 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-10-12 -PKG_SOURCE_VERSION:=37654d704772512065cd28b007342758c2a0f14a -PKG_MIRROR_HASH:=487ca40ed4e1ffe015dabc76c0a84782602d84f5b08c9c86cc6c892cb499623b +PKG_SOURCE_DATE:=2017-12-08 +PKG_SOURCE_VERSION:=e50465605266118060df1b86eb7641c65fd29c65 +PKG_MIRROR_HASH:=3d7d3aa29c1e8dabe8f2c0a14480140f60ddc73681510aadbf07c5a1e5efac6e PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 @@ -39,7 +39,6 @@ define KernelPackage/mt76-core TITLE:=MediaTek MT76xx wireless driver FILES:=\ $(PKG_BUILD_DIR)/mt76.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 mt76) endef define KernelPackage/mt76x2 @@ -48,7 +47,7 @@ define KernelPackage/mt76x2 DEPENDS+=+kmod-mt76-core FILES:=\ $(PKG_BUILD_DIR)/mt76x2e.ko - AUTOLOAD:=$(call AutoLoad,51,mt76x2e) + AUTOLOAD:=$(call AutoProbe,mt76x2e) endef define KernelPackage/mt7603 @@ -57,7 +56,7 @@ define KernelPackage/mt7603 DEPENDS+=+kmod-mt76-core FILES:=\ $(PKG_BUILD_DIR)/mt7603e.ko - AUTOLOAD:=$(call AutoLoad,51,mt7603e) + AUTOLOAD:=$(call AutoProbe,mt7603e) endef NOSTDINC_FLAGS = \ @@ -75,8 +74,7 @@ endif define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules From f76ceb0290b3979a1df54fb647c17b8233346985 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:17:56 +0800 Subject: [PATCH 35/95] update version to OpenWrt R7.5 --- package/lean/default-settings/Makefile | 2 +- package/lean/default-settings/files/zzz-default-settings | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 4cfd87bd3..c34bfa4dd 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=26 +PKG_RELEASE:=27 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index e9c1b06df..96a56c050 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -3,7 +3,7 @@ uci set luci.main.lang=zh_cn uci commit luci -uci set system.@system[0].hostname=LEDE +uci set system.@system[0].hostname=OpenWrt uci set system.@system[0].timezone=CST-8 uci set system.@system[0].zonename=Asia/Shanghai uci commit system @@ -47,9 +47,9 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.4.4 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release -echo "DISTRIB_DESCRIPTION='LEDE 17.01.4'" >> /etc/openwrt_release +echo "DISTRIB_DESCRIPTION='OpenWrt 17.01.4'" >> /etc/openwrt_release exit 0 From 341062400544cfcce1f2b8065bde5cda9e2ac20d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:30:21 +0800 Subject: [PATCH 36/95] update README --- README | Bin 4474 -> 4584 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/README b/README index 890204f61e6993825cb0611b135055905551d297..b0fefad1d9c249c545443353bbfcd06b4b48d495 100644 GIT binary patch delta 300 zcmeyR^g?-p3$H&z0YfT79z!@o5ktvDZ%b5xjosqRs3MbBGHarWY`)3d$jE5AIhu7o zW4$qh9z#!GOV(!5ByyFc<+@Ah`uW zOX~kkS?Zgtz>vXE0)zz&#SB&q`aqb)PzZEXA(%`CT9peFvuB8BC}${Rumu}t#9+># f#*hu2@H=ihQ&YF*f$sOaWMk`BhF0> delta 199 zcmaE%{7Y$q3%d`4D}xJz>%>4y7<1!vac1@$hE#?WhSbTsnKfbT%^#T?85vDB7qiZ1 z-28z3A6tDeLn%WZLoq`JLne?;Wl&_`V&G(mWXK1K7cnR>K+OiSoPlDwKnPNw$xy;j z309c_WR)-!Fjz6@17SHB>M=mAX3z!76an>R0ZmQ@s?!6qix|>@I=LA9fb5dZPx+Xc E0ew*`F8}}l From d4cf54550241330f01a13e1f8a99cfd6bbfa6c99 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 12 Dec 2017 17:32:46 +0800 Subject: [PATCH 37/95] update README --- README | Bin 4584 -> 4570 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/README b/README index b0fefad1d9c249c545443353bbfcd06b4b48d495..67e86acf72892f6e0a204dfb965554dd29352760 100644 GIT binary patch delta 28 kcmaE%d`o%5I%f79hE#?WhSbf6nO8D1=`d{0W3S=@0F$B#3IG5A delta 42 ycmcbm{6cxdI%ZLSh609EhCGIFh9ZU%20ey!hD?T%&0CpQGBfe~-<-f+#RUKqFARbJ From 3a5a84dda8d0ee0aada29c4fa623b1e3eba8df6c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 19 Dec 2017 13:03:45 +0800 Subject: [PATCH 38/95] kernel: tune e1000e module parameters --- .gitignore | 3 ++- package/kernel/linux/modules/netdevices.mk | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6df333992..0908c0fd1 100644 --- a/.gitignore +++ b/.gitignore @@ -24,4 +24,5 @@ key-build* *# .emacs.desktop* TAGS*~ -git-src \ No newline at end of file +git-src +.git-credentials \ No newline at end of file diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 0af4f96c2..a3ff005eb 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -488,6 +488,9 @@ define KernelPackage/e1000e KCONFIG:=CONFIG_E1000E FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/e1000e/e1000e.ko AUTOLOAD:=$(call AutoProbe,e1000e) + MODPARAMS.e1000e:= \ + IntMode=1 \ + InterruptThrottleRate=4,4,4,4,4,4,4,4 endef define KernelPackage/e1000e/description From a0abc238363622cfc310421ea11b342b8a786c39 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 19 Dec 2017 13:06:11 +0800 Subject: [PATCH 39/95] kernel: Add kernel 4.14 support --- include/kernel-version.mk | 2 + ...dcode-path-to-awk-in-scripts-ld-vers.patch | 30 + .../011-kbuild-export-SUBARCH.patch | 23 + .../020-backport_netfilter_rtcache.patch | 558 ++ ...tcp-allow-drivers-to-tweak-TSQ-logic.patch | 85 + ...-master-mode-for-BCM54210E-and-B5021.patch | 50 + ...-support-new-device-flag-for-setting.patch | 54 + target/linux/generic/config-4.14 | 5591 +++++++++++++++++ .../files/drivers/net/phy/b53/b53_common.c | 1 + .../generic/files/drivers/net/phy/rtl8306.c | 3 + .../generic/files/drivers/net/phy/swconfig.c | 36 +- .../hack-4.14/202-reduce_module_size.patch | 24 + .../generic/hack-4.14/204-module_strip.patch | 205 + .../hack-4.14/207-disable-modorder.patch | 44 + .../210-darwin_scripts_include.patch | 3065 +++++++++ .../211-host_tools_portability.patch | 40 + .../hack-4.14/212-byteshift_portability.patch | 65 + .../hack-4.14/214-spidev_h_portability.patch | 24 + .../generic/hack-4.14/220-gc_sections.patch | 258 + .../hack-4.14/221-module_exports.patch | 101 + .../hack-4.14/230-openwrt_lzma_options.patch | 71 + .../hack-4.14/250-netfilter_depends.patch | 27 + .../generic/hack-4.14/251-sound_kconfig.patch | 197 + .../hack-4.14/259-regmap_dynamic.patch | 109 + .../260-crypto_test_dependencies.patch | 60 + .../generic/hack-4.14/280-rfkill-stubs.patch | 84 + .../301-mips_image_cmdline_hack.patch | 38 + .../321-powerpc_crtsavres_prereq.patch | 38 + .../generic/hack-4.14/531-debloat_lzma.patch | 1040 +++ .../640-bridge-only-accept-EAP-locally.patch | 32 + .../hack-4.14/641-bridge_port_isolate.patch | 76 + .../hack-4.14/651-wireless_mesh_header.patch | 24 + .../hack-4.14/660-fq_codel_defaults.patch | 27 + .../661-use_fq_codel_by_default.patch | 94 + .../hack-4.14/662-remove_pfifo_fast.patch | 159 + .../700-swconfig_switch_drivers.patch | 128 + .../702-phy_add_aneg_done_function.patch | 27 + .../generic/hack-4.14/721-phy_packets.patch | 176 + .../hack-4.14/773-bgmac-add-srab-switch.patch | 98 + .../hack-4.14/835-misc-owl_loader.patch | 52 + .../hack-4.14/901-debloat_sock_diag.patch | 136 + .../generic/hack-4.14/902-debloat_proc.patch | 405 ++ .../hack-4.14/904-debloat_dma_buf.patch | 64 + .../hack-4.14/910-kobject_uevent.patch | 32 + .../911-kobject_add_broadcast_uevent.patch | 76 + ...ays-create-console-node-in-initramfs.patch | 40 + .../generic/hack-4.14/930-crashlog.patch | 338 + ...fix-cache-flushing-for-highmem-pages.patch | 30 + .../pending-4.14/110-ehci_hcd_ignore_oc.patch | 79 + ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 82 + ...0-add-linux-spidev-compatible-si3210.patch | 18 + ..._value_cansleep-for-setting-chipsele.patch | 20 + ...ame2-and-add-RENAME_WHITEOUT-support.patch | 62 + ...41-jffs2-add-RENAME_EXCHANGE-support.patch | 73 + ...ge_allow_receiption_on_disabled_port.patch | 43 + ...-generic-parsing-of-linux-part-probe.patch | 161 + ...et-phy-at803x-add-support-for-AT8032.patch | 70 + ...ng-comment-related-to-link-detection.patch | 43 + .../pending-4.14/201-extra_optimization.patch | 32 + .../203-kallsyms_uncompressed.patch | 119 + .../205-backtrace_module_info.patch | 45 + .../pending-4.14/206-mips-disable-vdso.patch | 23 + ...e-filenames-from-deps_initramfs-list.patch | 46 + ...able_wilink_platform_without_drivers.patch | 20 + ...libc-specific-inclusion-of-sysinfo.h.patch | 32 + ...bc-compat.h-do-not-rely-on-__GLIBC__.patch | 105 + ...prevent-redefinition-of-struct-ethhd.patch | 65 + .../300-mips_expose_boot_raw.patch | 40 + .../302-mips_no_branch_likely.patch | 22 + .../pending-4.14/304-mips_disable_fpu.patch | 137 + .../pending-4.14/305-mips_module_reloc.patch | 366 ++ .../306-mips_mem_functions_performance.patch | 106 + .../307-mips_highmem_offset.patch | 19 + .../pending-4.14/308-mips32r2_tune.patch | 22 + .../310-arm_module_unresolved_weak_sym.patch | 22 + ...t-command-line-parameters-from-users.patch | 272 + .../332-arc-add-OWRTDTB-section.patch | 80 + ...able-unaligned-access-in-kernel-mode.patch | 24 + ...IPS-mm-remove-mips_dma_mapping_error.patch | 32 + ...ove-no-op-dma_map_ops-where-possible.patch | 140 + .../400-mtd-add-rootfs-split-support.patch | 123 + ...for-different-partition-parser-types.patch | 110 + ...arsers-for-rootfs-and-firmware-split.patch | 81 + .../403-mtd-hook-mtdsplit-to-Kbuild.patch | 32 + .../404-mtd-add-more-helper-functions.patch | 94 + .../411-mtd-partial_eraseblock_write.patch | 154 + .../412-mtd-partial_eraseblock_unlock.patch | 40 + .../pending-4.14/420-mtd-redboot_space.patch | 41 + ...30-mtd-add-myloader-partition-parser.patch | 47 + ...check-for-bad-blocks-when-calculatin.patch | 67 + ...bcm47xxpart-detect-T_Meter-partition.patch | 37 + .../pending-4.14/440-block2mtd_init.patch | 116 + .../pending-4.14/441-block2mtd_probe.patch | 47 + ...mtd-cfi_cmdset_0002-no-erase_suspend.patch | 25 + ...et_0002-add-buffer-write-cmd-timeout.patch | 17 + ...25p80-mx-disable-software-protection.patch | 18 + ...ort-limiting-4K-sectors-support-base.patch | 56 + .../476-mtd-spi-nor-add-eon-en25q128.patch | 18 + .../477-mtd-add-spi-nor-add-mx25u3235f.patch | 18 + .../480-mtd-set-rootfs-to-be-root-dev.patch | 38 + ...mtd-device-named-ubi-or-data-on-boot.patch | 73 + ...to-create-ubiblock-device-for-rootfs.patch | 66 + ...ting-ubi0-rootfs-in-init-do_mounts.c.patch | 51 + ...ROOT_DEV-to-ubiblock-rootfs-if-unset.patch | 34 + .../494-mtd-ubi-add-EOF-marker-support.patch | 60 + .../530-jffs2_make_lzma_available.patch | 5180 +++++++++++++++ .../pending-4.14/532-jffs2_eofdetect.patch | 65 + ...fs-fix-default-compression-selection.patch | 37 + .../600-netfilter_conntrack_flush.patch | 95 + ...etfilter_match_bypass_default_checks.patch | 110 + ...netfilter_match_bypass_default_table.patch | 111 + ...netfilter_match_reduce_memory_access.patch | 22 + ...-netfilter_optional_tcp_window_check.patch | 44 + .../616-net_optimize_xfrm_calls.patch | 20 + .../pending-4.14/630-packet_socket_type.patch | 138 + .../pending-4.14/650-pppoe_header_pad.patch | 29 + .../pending-4.14/655-increase_skb_pad.patch | 20 + ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 500 ++ ...ng-with-source-address-failed-policy.patch | 247 + ...nes-for-_POLICY_FAILED-until-all-cod.patch | 50 + ...T-skip-GRO-for-foreign-MAC-addresses.patch | 145 + .../681-NET-add-of_get_mac_address_mtd.patch | 127 + .../pending-4.14/701-phy_extension.patch | 95 + ...detach-callback-to-struct-phy_driver.patch | 38 + ...-at803x-allow-to-configure-via-pdata.patch | 142 + ...net-phy-at803x-fix-at8033-sgmii-mode.patch | 54 + .../810-pci_disable_common_quirks.patch | 60 + .../811-pci_disable_usb_common_quirks.patch | 113 + ...ove-annoying-warning-about-bogus-URB.patch | 76 + .../pending-4.14/831-ledtrig_netdev.patch | 74 + .../pending-4.14/834-ledtrig-libata.patch | 149 + .../pending-4.14/920-mangle_bootargs.patch | 71 + 132 files changed, 25624 insertions(+), 8 deletions(-) create mode 100644 target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch create mode 100644 target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch create mode 100644 target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch create mode 100644 target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch create mode 100644 target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch create mode 100644 target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch create mode 100644 target/linux/generic/config-4.14 create mode 100644 target/linux/generic/hack-4.14/202-reduce_module_size.patch create mode 100644 target/linux/generic/hack-4.14/204-module_strip.patch create mode 100644 target/linux/generic/hack-4.14/207-disable-modorder.patch create mode 100644 target/linux/generic/hack-4.14/210-darwin_scripts_include.patch create mode 100644 target/linux/generic/hack-4.14/211-host_tools_portability.patch create mode 100644 target/linux/generic/hack-4.14/212-byteshift_portability.patch create mode 100644 target/linux/generic/hack-4.14/214-spidev_h_portability.patch create mode 100644 target/linux/generic/hack-4.14/220-gc_sections.patch create mode 100644 target/linux/generic/hack-4.14/221-module_exports.patch create mode 100644 target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch create mode 100644 target/linux/generic/hack-4.14/250-netfilter_depends.patch create mode 100644 target/linux/generic/hack-4.14/251-sound_kconfig.patch create mode 100644 target/linux/generic/hack-4.14/259-regmap_dynamic.patch create mode 100644 target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch create mode 100644 target/linux/generic/hack-4.14/280-rfkill-stubs.patch create mode 100644 target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch create mode 100644 target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch create mode 100644 target/linux/generic/hack-4.14/531-debloat_lzma.patch create mode 100644 target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch create mode 100644 target/linux/generic/hack-4.14/641-bridge_port_isolate.patch create mode 100644 target/linux/generic/hack-4.14/651-wireless_mesh_header.patch create mode 100644 target/linux/generic/hack-4.14/660-fq_codel_defaults.patch create mode 100644 target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch create mode 100644 target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch create mode 100644 target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch create mode 100644 target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch create mode 100644 target/linux/generic/hack-4.14/721-phy_packets.patch create mode 100644 target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch create mode 100644 target/linux/generic/hack-4.14/835-misc-owl_loader.patch create mode 100644 target/linux/generic/hack-4.14/901-debloat_sock_diag.patch create mode 100644 target/linux/generic/hack-4.14/902-debloat_proc.patch create mode 100644 target/linux/generic/hack-4.14/904-debloat_dma_buf.patch create mode 100644 target/linux/generic/hack-4.14/910-kobject_uevent.patch create mode 100644 target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch create mode 100644 target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch create mode 100644 target/linux/generic/hack-4.14/930-crashlog.patch create mode 100644 target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch create mode 100644 target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch create mode 100644 target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch create mode 100644 target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch create mode 100644 target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch create mode 100644 target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch create mode 100644 target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch create mode 100644 target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch create mode 100644 target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch create mode 100644 target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch create mode 100644 target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch create mode 100644 target/linux/generic/pending-4.14/201-extra_optimization.patch create mode 100644 target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch create mode 100644 target/linux/generic/pending-4.14/205-backtrace_module_info.patch create mode 100644 target/linux/generic/pending-4.14/206-mips-disable-vdso.patch create mode 100644 target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch create mode 100644 target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch create mode 100644 target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch create mode 100644 target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch create mode 100644 target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch create mode 100644 target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch create mode 100644 target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch create mode 100644 target/linux/generic/pending-4.14/304-mips_disable_fpu.patch create mode 100644 target/linux/generic/pending-4.14/305-mips_module_reloc.patch create mode 100644 target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch create mode 100644 target/linux/generic/pending-4.14/307-mips_highmem_offset.patch create mode 100644 target/linux/generic/pending-4.14/308-mips32r2_tune.patch create mode 100644 target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch create mode 100644 target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch create mode 100644 target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch create mode 100644 target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch create mode 100644 target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch create mode 100644 target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch create mode 100644 target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch create mode 100644 target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch create mode 100644 target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch create mode 100644 target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch create mode 100644 target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch create mode 100644 target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch create mode 100644 target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch create mode 100644 target/linux/generic/pending-4.14/420-mtd-redboot_space.patch create mode 100644 target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch create mode 100644 target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch create mode 100644 target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch create mode 100644 target/linux/generic/pending-4.14/440-block2mtd_init.patch create mode 100644 target/linux/generic/pending-4.14/441-block2mtd_probe.patch create mode 100644 target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch create mode 100644 target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch create mode 100644 target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch create mode 100644 target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch create mode 100644 target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch create mode 100644 target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch create mode 100644 target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch create mode 100644 target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch create mode 100644 target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch create mode 100644 target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch create mode 100644 target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch create mode 100644 target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch create mode 100644 target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch create mode 100644 target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch create mode 100644 target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch create mode 100644 target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch create mode 100644 target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch create mode 100644 target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch create mode 100644 target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch create mode 100644 target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch create mode 100644 target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch create mode 100644 target/linux/generic/pending-4.14/630-packet_socket_type.patch create mode 100644 target/linux/generic/pending-4.14/650-pppoe_header_pad.patch create mode 100644 target/linux/generic/pending-4.14/655-increase_skb_pad.patch create mode 100644 target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch create mode 100644 target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch create mode 100644 target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch create mode 100644 target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch create mode 100644 target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch create mode 100644 target/linux/generic/pending-4.14/701-phy_extension.patch create mode 100644 target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch create mode 100644 target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch create mode 100644 target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch create mode 100644 target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch create mode 100644 target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch create mode 100644 target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch create mode 100644 target/linux/generic/pending-4.14/831-ledtrig_netdev.patch create mode 100644 target/linux/generic/pending-4.14/834-ledtrig-libata.patch create mode 100644 target/linux/generic/pending-4.14/920-mangle_bootargs.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index f1fb66a36..208baf75a 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -5,10 +5,12 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .100 LINUX_VERSION-4.9 = .67 +LINUX_VERSION-4.14 = .6 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.100 = 9936cd99c4bd35f6bc6962c9acdd1fa2ac8999e07a9be6a94a03b5492f1bd14f LINUX_KERNEL_HASH-4.9.67 = 7fbaa7dcc17877dfa0c96fb9a7d2f4ffed20ceeb13cbbeb18d77213c6cf75f7d +LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch b/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch new file mode 100644 index 000000000..7ac4f9d24 --- /dev/null +++ b/target/linux/generic/backport-4.14/010-Kbuild-don-t-hardcode-path-to-awk-in-scripts-ld-vers.patch @@ -0,0 +1,30 @@ +From 13b1ecc3401653a355798eb1dee10cc1608202f4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Mon, 18 Jan 2016 12:27:49 +0100 +Subject: [PATCH 33/34] Kbuild: don't hardcode path to awk in + scripts/ld-version.sh + +On some systems /usr/bin/awk does not exist, or is broken. Find it via +$PATH instead. + +Signed-off-by: Felix Fietkau +--- + scripts/ld-version.sh | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/scripts/ld-version.sh ++++ b/scripts/ld-version.sh +@@ -1,6 +1,7 @@ +-#!/usr/bin/awk -f ++#!/bin/sh + # SPDX-License-Identifier: GPL-2.0 + # extract linker version number from stdin and turn into single number ++exec awk ' + { + gsub(".*\\)", ""); + gsub(".*version ", ""); +@@ -9,3 +10,4 @@ + print a[1]*100000000 + a[2]*1000000 + a[3]*10000; + exit + } ++' diff --git a/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch new file mode 100644 index 000000000..896658672 --- /dev/null +++ b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch @@ -0,0 +1,23 @@ +From 173019b66dcc9d68ad9333aa744dad1e369b5aa8 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 9 Jul 2017 00:26:53 +0200 +Subject: [PATCH 34/34] kernel: add compile fix for linux 4.9 on x86 + +Signed-off-by: Felix Fietkau +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -415,8 +415,8 @@ KERNELRELEASE = $(shell cat include/conf + KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) + + export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION +-export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC +-export CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES ++export ARCH SRCARCH SUBARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD ++export CC CPP AR NM STRIP OBJCOPY OBJDUMP HOSTLDFLAGS HOST_LOADLIBES + export MAKE AWK GENKSYMS INSTALLKERNEL PERL PYTHON UTS_MACHINE + export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS + diff --git a/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch new file mode 100644 index 000000000..8a6fba430 --- /dev/null +++ b/target/linux/generic/backport-4.14/020-backport_netfilter_rtcache.patch @@ -0,0 +1,558 @@ +From 1bb0c3ec899827cfa4668bb63a08713a40744d21 Mon Sep 17 00:00:00 2001 +From: Florian Westphal +Date: Sun, 9 Jul 2017 08:58:30 +0200 +Subject: [PATCH] netfilter: conntrack: cache route for forwarded connections + +... to avoid per-packet FIB lookup if possible. + +The cached dst is re-used provided the input interface +is the same as that of the previous packet in the same direction. + +If not, the cached dst is invalidated. + +For ipv6 we also need to store sernum, else dst_check doesn't work, +pointed out by Eric Dumazet. + +This should speed up forwarding when conntrack is already in use +anyway, especially when using reverse path filtering -- active RPF +enforces two FIB lookups for each packet. + +Before the routing cache removal this didn't matter since RPF was performed +only when route cache didn't yield a result; but without route cache it +comes at higher price. + +Julian Anastasov suggested to add NETDEV_UNREGISTER handler to +avoid holding on to dsts of 'frozen' conntracks. + +Signed-off-by: Florian Westphal +--- + include/net/netfilter/nf_conntrack_extend.h | 4 + + include/net/netfilter/nf_conntrack_rtcache.h | 34 +++ + net/netfilter/Kconfig | 12 + + net/netfilter/Makefile | 3 + + net/netfilter/nf_conntrack_rtcache.c | 428 +++++++++++++++++++++++++++ + 5 files changed, 481 insertions(+) + create mode 100644 include/net/netfilter/nf_conntrack_rtcache.h + create mode 100644 net/netfilter/nf_conntrack_rtcache.c + +--- a/include/net/netfilter/nf_conntrack_extend.h ++++ b/include/net/netfilter/nf_conntrack_extend.h +@@ -28,6 +28,9 @@ enum nf_ct_ext_id { + #if IS_ENABLED(CONFIG_NETFILTER_SYNPROXY) + NF_CT_EXT_SYNPROXY, + #endif ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE) ++ NF_CT_EXT_RTCACHE, ++#endif + NF_CT_EXT_NUM, + }; + +@@ -40,6 +43,7 @@ enum nf_ct_ext_id { + #define NF_CT_EXT_TIMEOUT_TYPE struct nf_conn_timeout + #define NF_CT_EXT_LABELS_TYPE struct nf_conn_labels + #define NF_CT_EXT_SYNPROXY_TYPE struct nf_conn_synproxy ++#define NF_CT_EXT_RTCACHE_TYPE struct nf_conn_rtcache + + /* Extensions: optional stuff which isn't permanently in struct. */ + struct nf_ct_ext { +--- /dev/null ++++ b/include/net/netfilter/nf_conntrack_rtcache.h +@@ -0,0 +1,34 @@ ++#include ++#include ++#include ++ ++struct dst_entry; ++ ++struct nf_conn_dst_cache { ++ struct dst_entry *dst; ++ int iif; ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ u32 cookie; ++#endif ++ ++}; ++ ++struct nf_conn_rtcache { ++ struct nf_conn_dst_cache cached_dst[IP_CT_DIR_MAX]; ++}; ++ ++static inline ++struct nf_conn_rtcache *nf_ct_rtcache_find(const struct nf_conn *ct) ++{ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_RTCACHE) ++ return nf_ct_ext_find(ct, NF_CT_EXT_RTCACHE); ++#else ++ return NULL; ++#endif ++} ++ ++static inline int nf_conn_rtcache_iif_get(const struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ return rtc->cached_dst[dir].iif; ++} +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -118,6 +118,18 @@ config NF_CONNTRACK_EVENTS + + If unsure, say `N'. + ++config NF_CONNTRACK_RTCACHE ++ tristate "Cache route entries in conntrack objects" ++ depends on NETFILTER_ADVANCED ++ depends on NF_CONNTRACK ++ help ++ If this option is enabled, the connection tracking code will ++ cache routing information for each connection that is being ++ forwarded, at a cost of 32 bytes per conntrack object. ++ ++ To compile it as a module, choose M here. If unsure, say N. ++ The module will be called nf_conntrack_rtcache. ++ + config NF_CONNTRACK_TIMEOUT + bool 'Connection tracking timeout' + depends on NETFILTER_ADVANCED +--- a/net/netfilter/Makefile ++++ b/net/netfilter/Makefile +@@ -19,6 +19,9 @@ obj-$(CONFIG_NETFILTER_NETLINK_LOG) += n + # connection tracking + obj-$(CONFIG_NF_CONNTRACK) += nf_conntrack.o + ++# optional conntrack route cache extension ++obj-$(CONFIG_NF_CONNTRACK_RTCACHE) += nf_conntrack_rtcache.o ++ + obj-$(CONFIG_NF_CT_PROTO_GRE) += nf_conntrack_proto_gre.o + + # netlink interface for nf_conntrack +--- /dev/null ++++ b/net/netfilter/nf_conntrack_rtcache.c +@@ -0,0 +1,428 @@ ++/* route cache for netfilter. ++ * ++ * (C) 2014 Red Hat GmbH ++ * ++ * 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. ++ */ ++ ++#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include ++#include ++#include ++#include ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++#include ++#endif ++ ++static void __nf_conn_rtcache_destroy(struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ struct dst_entry *dst = rtc->cached_dst[dir].dst; ++ ++ dst_release(dst); ++} ++ ++static void nf_conn_rtcache_destroy(struct nf_conn *ct) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ ++ if (!rtc) ++ return; ++ ++ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_ORIGINAL); ++ __nf_conn_rtcache_destroy(rtc, IP_CT_DIR_REPLY); ++} ++ ++static void nf_ct_rtcache_ext_add(struct nf_conn *ct) ++{ ++ struct nf_conn_rtcache *rtc; ++ ++ rtc = nf_ct_ext_add(ct, NF_CT_EXT_RTCACHE, GFP_ATOMIC); ++ if (rtc) { ++ rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif = -1; ++ rtc->cached_dst[IP_CT_DIR_ORIGINAL].dst = NULL; ++ rtc->cached_dst[IP_CT_DIR_REPLY].iif = -1; ++ rtc->cached_dst[IP_CT_DIR_REPLY].dst = NULL; ++ } ++} ++ ++static struct nf_conn_rtcache *nf_ct_rtcache_find_usable(struct nf_conn *ct) ++{ ++ return nf_ct_rtcache_find(ct); ++} ++ ++static struct dst_entry * ++nf_conn_rtcache_dst_get(const struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ return rtc->cached_dst[dir].dst; ++} ++ ++static u32 nf_rtcache_get_cookie(int pf, const struct dst_entry *dst) ++{ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ if (pf == NFPROTO_IPV6) { ++ const struct rt6_info *rt = (const struct rt6_info *)dst; ++ ++ if (rt->rt6i_node) ++ return (u32)rt->rt6i_node->fn_sernum; ++ } ++#endif ++ return 0; ++} ++ ++static void nf_conn_rtcache_dst_set(int pf, ++ struct nf_conn_rtcache *rtc, ++ struct dst_entry *dst, ++ enum ip_conntrack_dir dir, int iif) ++{ ++ if (rtc->cached_dst[dir].iif != iif) ++ rtc->cached_dst[dir].iif = iif; ++ ++ if (rtc->cached_dst[dir].dst != dst) { ++ struct dst_entry *old; ++ ++ dst_hold(dst); ++ ++ old = xchg(&rtc->cached_dst[dir].dst, dst); ++ dst_release(old); ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ if (pf == NFPROTO_IPV6) ++ rtc->cached_dst[dir].cookie = ++ nf_rtcache_get_cookie(pf, dst); ++#endif ++ } ++} ++ ++static void nf_conn_rtcache_dst_obsolete(struct nf_conn_rtcache *rtc, ++ enum ip_conntrack_dir dir) ++{ ++ struct dst_entry *old; ++ ++ pr_debug("Invalidate iif %d for dir %d on cache %p\n", ++ rtc->cached_dst[dir].iif, dir, rtc); ++ ++ old = xchg(&rtc->cached_dst[dir].dst, NULL); ++ dst_release(old); ++ rtc->cached_dst[dir].iif = -1; ++} ++ ++static unsigned int nf_rtcache_in(u_int8_t pf, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ struct nf_conn_rtcache *rtc; ++ enum ip_conntrack_info ctinfo; ++ enum ip_conntrack_dir dir; ++ struct dst_entry *dst; ++ struct nf_conn *ct; ++ int iif; ++ u32 cookie; ++ ++ if (skb_dst(skb) || skb->sk) ++ return NF_ACCEPT; ++ ++ ct = nf_ct_get(skb, &ctinfo); ++ if (!ct) ++ return NF_ACCEPT; ++ ++ rtc = nf_ct_rtcache_find_usable(ct); ++ if (!rtc) ++ return NF_ACCEPT; ++ ++ /* if iif changes, don't use cache and let ip stack ++ * do route lookup. ++ * ++ * If rp_filter is enabled it might toss skb, so ++ * we don't want to avoid these checks. ++ */ ++ dir = CTINFO2DIR(ctinfo); ++ iif = nf_conn_rtcache_iif_get(rtc, dir); ++ if (state->in->ifindex != iif) { ++ pr_debug("ct %p, iif %d, cached iif %d, skip cached entry\n", ++ ct, iif, state->in->ifindex); ++ return NF_ACCEPT; ++ } ++ dst = nf_conn_rtcache_dst_get(rtc, dir); ++ if (dst == NULL) ++ return NF_ACCEPT; ++ ++ cookie = nf_rtcache_get_cookie(pf, dst); ++ ++ dst = dst_check(dst, cookie); ++ pr_debug("obtained dst %p for skb %p, cookie %d\n", dst, skb, cookie); ++ if (likely(dst)) ++ skb_dst_set_noref(skb, dst); ++ else ++ nf_conn_rtcache_dst_obsolete(rtc, dir); ++ ++ return NF_ACCEPT; ++} ++ ++static unsigned int nf_rtcache_forward(u_int8_t pf, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ struct nf_conn_rtcache *rtc; ++ enum ip_conntrack_info ctinfo; ++ enum ip_conntrack_dir dir; ++ struct nf_conn *ct; ++ struct dst_entry *dst = skb_dst(skb); ++ int iif; ++ ++ ct = nf_ct_get(skb, &ctinfo); ++ if (!ct) ++ return NF_ACCEPT; ++ ++ if (dst && dst_xfrm(dst)) ++ return NF_ACCEPT; ++ ++ if (!nf_ct_is_confirmed(ct)) { ++ if (WARN_ON(nf_ct_rtcache_find(ct))) ++ return NF_ACCEPT; ++ nf_ct_rtcache_ext_add(ct); ++ return NF_ACCEPT; ++ } ++ ++ rtc = nf_ct_rtcache_find_usable(ct); ++ if (!rtc) ++ return NF_ACCEPT; ++ ++ dir = CTINFO2DIR(ctinfo); ++ iif = nf_conn_rtcache_iif_get(rtc, dir); ++ pr_debug("ct %p, skb %p, dir %d, iif %d, cached iif %d\n", ++ ct, skb, dir, iif, state->in->ifindex); ++ if (likely(state->in->ifindex == iif)) ++ return NF_ACCEPT; ++ ++ nf_conn_rtcache_dst_set(pf, rtc, skb_dst(skb), dir, state->in->ifindex); ++ return NF_ACCEPT; ++} ++ ++static unsigned int nf_rtcache_in4(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_in(NFPROTO_IPV4, skb, state); ++} ++ ++static unsigned int nf_rtcache_forward4(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_forward(NFPROTO_IPV4, skb, state); ++} ++ ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++static unsigned int nf_rtcache_in6(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_in(NFPROTO_IPV6, skb, state); ++} ++ ++static unsigned int nf_rtcache_forward6(void *priv, ++ struct sk_buff *skb, ++ const struct nf_hook_state *state) ++{ ++ return nf_rtcache_forward(NFPROTO_IPV6, skb, state); ++} ++#endif ++ ++static int nf_rtcache_dst_remove(struct nf_conn *ct, void *data) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ struct net_device *dev = data; ++ ++ if (!rtc) ++ return 0; ++ ++ if (dev->ifindex == rtc->cached_dst[IP_CT_DIR_ORIGINAL].iif || ++ dev->ifindex == rtc->cached_dst[IP_CT_DIR_REPLY].iif) { ++ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_ORIGINAL); ++ nf_conn_rtcache_dst_obsolete(rtc, IP_CT_DIR_REPLY); ++ } ++ ++ return 0; ++} ++ ++static int nf_rtcache_netdev_event(struct notifier_block *this, ++ unsigned long event, void *ptr) ++{ ++ struct net_device *dev = netdev_notifier_info_to_dev(ptr); ++ struct net *net = dev_net(dev); ++ ++ if (event == NETDEV_DOWN) ++ nf_ct_iterate_cleanup_net(net, nf_rtcache_dst_remove, dev, 0, 0); ++ ++ return NOTIFY_DONE; ++} ++ ++static struct notifier_block nf_rtcache_notifier = { ++ .notifier_call = nf_rtcache_netdev_event, ++}; ++ ++static struct nf_hook_ops rtcache_ops[] = { ++ { ++ .hook = nf_rtcache_in4, ++ .pf = NFPROTO_IPV4, ++ .hooknum = NF_INET_PRE_ROUTING, ++ .priority = NF_IP_PRI_LAST, ++ }, ++ { ++ .hook = nf_rtcache_forward4, ++ .pf = NFPROTO_IPV4, ++ .hooknum = NF_INET_FORWARD, ++ .priority = NF_IP_PRI_LAST, ++ }, ++#if IS_ENABLED(CONFIG_NF_CONNTRACK_IPV6) ++ { ++ .hook = nf_rtcache_in6, ++ .pf = NFPROTO_IPV6, ++ .hooknum = NF_INET_PRE_ROUTING, ++ .priority = NF_IP_PRI_LAST, ++ }, ++ { ++ .hook = nf_rtcache_forward6, ++ .pf = NFPROTO_IPV6, ++ .hooknum = NF_INET_FORWARD, ++ .priority = NF_IP_PRI_LAST, ++ }, ++#endif ++}; ++ ++static struct nf_ct_ext_type rtcache_extend __read_mostly = { ++ .len = sizeof(struct nf_conn_rtcache), ++ .align = __alignof__(struct nf_conn_rtcache), ++ .id = NF_CT_EXT_RTCACHE, ++ .destroy = nf_conn_rtcache_destroy, ++}; ++ ++static void __net_exit rtcache_net_exit(struct net *net) ++{ ++ /* remove hooks so no new connections get rtcache extension */ ++ nf_unregister_net_hooks(net, rtcache_ops, ARRAY_SIZE(rtcache_ops)); ++} ++ ++static struct pernet_operations rtcache_ops_net_ops = { ++ .exit = rtcache_net_exit, ++}; ++ ++static int __init nf_conntrack_rtcache_init(void) ++{ ++ int ret = nf_ct_extend_register(&rtcache_extend); ++ ++ if (ret < 0) { ++ pr_err("nf_conntrack_rtcache: Unable to register extension\n"); ++ return ret; ++ } ++ ++ ret = register_pernet_subsys(&rtcache_ops_net_ops); ++ if (ret) { ++ nf_ct_extend_unregister(&rtcache_extend); ++ return ret; ++ } ++ ++ ret = nf_register_net_hooks(&init_net, rtcache_ops, ++ ARRAY_SIZE(rtcache_ops)); ++ if (ret < 0) { ++ nf_ct_extend_unregister(&rtcache_extend); ++ unregister_pernet_subsys(&rtcache_ops_net_ops); ++ return ret; ++ } ++ ++ ret = register_netdevice_notifier(&nf_rtcache_notifier); ++ if (ret) { ++ nf_unregister_net_hooks(&init_net, rtcache_ops, ++ ARRAY_SIZE(rtcache_ops)); ++ nf_ct_extend_unregister(&rtcache_extend); ++ unregister_pernet_subsys(&rtcache_ops_net_ops); ++ } ++ ++ return ret; ++} ++ ++static int nf_rtcache_ext_remove(struct nf_conn *ct, void *data) ++{ ++ struct nf_conn_rtcache *rtc = nf_ct_rtcache_find(ct); ++ ++ return rtc != NULL; ++} ++ ++static bool __exit nf_conntrack_rtcache_wait_for_dying(struct net *net) ++{ ++ bool wait = false; ++ int cpu; ++ ++ for_each_possible_cpu(cpu) { ++ struct nf_conntrack_tuple_hash *h; ++ struct hlist_nulls_node *n; ++ struct nf_conn *ct; ++ struct ct_pcpu *pcpu = per_cpu_ptr(net->ct.pcpu_lists, cpu); ++ ++ rcu_read_lock(); ++ spin_lock_bh(&pcpu->lock); ++ ++ hlist_nulls_for_each_entry(h, n, &pcpu->dying, hnnode) { ++ ct = nf_ct_tuplehash_to_ctrack(h); ++ if (nf_ct_rtcache_find(ct) != NULL) { ++ wait = true; ++ break; ++ } ++ } ++ spin_unlock_bh(&pcpu->lock); ++ rcu_read_unlock(); ++ } ++ ++ return wait; ++} ++ ++static void __exit nf_conntrack_rtcache_fini(void) ++{ ++ struct net *net; ++ int count = 0; ++ ++ synchronize_net(); ++ ++ unregister_netdevice_notifier(&nf_rtcache_notifier); ++ ++ rtnl_lock(); ++ ++ /* zap all conntracks with rtcache extension */ ++ for_each_net(net) ++ nf_ct_iterate_cleanup_net(net, nf_rtcache_ext_remove, NULL, 0, 0); ++ ++ for_each_net(net) { ++ /* .. and make sure they're gone from dying list, too */ ++ while (nf_conntrack_rtcache_wait_for_dying(net)) { ++ msleep(200); ++ WARN_ONCE(++count > 25, "Waiting for all rtcache conntracks to go away\n"); ++ } ++ } ++ ++ rtnl_unlock(); ++ synchronize_net(); ++ nf_ct_extend_unregister(&rtcache_extend); ++} ++module_init(nf_conntrack_rtcache_init); ++module_exit(nf_conntrack_rtcache_fini); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Florian Westphal "); ++MODULE_DESCRIPTION("Conntrack route cache extension"); diff --git a/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch new file mode 100644 index 000000000..0c57f2e33 --- /dev/null +++ b/target/linux/generic/backport-4.14/025-tcp-allow-drivers-to-tweak-TSQ-logic.patch @@ -0,0 +1,85 @@ +From: Eric Dumazet +Date: Sat, 11 Nov 2017 15:54:12 -0800 +Subject: [PATCH] tcp: allow drivers to tweak TSQ logic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +I had many reports that TSQ logic breaks wifi aggregation. + +Current logic is to allow up to 1 ms of bytes to be queued into qdisc +and drivers queues. + +But Wifi aggregation needs a bigger budget to allow bigger rates to +be discovered by various TCP Congestion Controls algorithms. + +This patch adds an extra socket field, allowing wifi drivers to select +another log scale to derive TCP Small Queue credit from current pacing +rate. + +Initial value is 10, meaning that this patch does not change current +behavior. + +We expect wifi drivers to set this field to smaller values (tests have +been done with values from 6 to 9) + +They would have to use following template : + +if (skb->sk && skb->sk->sk_pacing_shift != MY_PACING_SHIFT) + skb->sk->sk_pacing_shift = MY_PACING_SHIFT; + +Ref: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1670041 +Signed-off-by: Eric Dumazet +Cc: Johannes Berg +Cc: Toke Høiland-Jørgensen +Cc: Kir Kolyshkin +--- +--- a/include/net/sock.h ++++ b/include/net/sock.h +@@ -267,6 +267,7 @@ struct sock_common { + * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) + * @sk_gso_max_size: Maximum GSO segment size to build + * @sk_gso_max_segs: Maximum number of GSO segments ++ * @sk_pacing_shift: scaling factor for TCP Small Queues + * @sk_lingertime: %SO_LINGER l_linger setting + * @sk_backlog: always used with the per-socket spinlock held + * @sk_callback_lock: used with the callbacks in the end of this struct +@@ -448,6 +449,8 @@ struct sock { + kmemcheck_bitfield_end(flags); + + u16 sk_gso_max_segs; ++#define sk_pacing_shift sk_pacing_shift /* for backport checks */ ++ u8 sk_pacing_shift; + unsigned long sk_lingertime; + struct proto *sk_prot_creator; + rwlock_t sk_callback_lock; +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -2744,6 +2744,7 @@ void sock_init_data(struct socket *sock, + + sk->sk_max_pacing_rate = ~0U; + sk->sk_pacing_rate = ~0U; ++ sk->sk_pacing_shift = 10; + sk->sk_incoming_cpu = -1; + /* + * Before updating sk_refcnt, we must commit prior changes to memory +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -1671,7 +1671,7 @@ u32 tcp_tso_autosize(const struct sock * + { + u32 bytes, segs; + +- bytes = min(sk->sk_pacing_rate >> 10, ++ bytes = min(sk->sk_pacing_rate >> sk->sk_pacing_shift, + sk->sk_gso_max_size - 1 - MAX_TCP_HEADER); + + /* Goal is to send at least one packet per ms, +@@ -2145,7 +2145,7 @@ static bool tcp_small_queue_check(struct + { + unsigned int limit; + +- limit = max(2 * skb->truesize, sk->sk_pacing_rate >> 10); ++ limit = max(2 * skb->truesize, sk->sk_pacing_rate >> sk->sk_pacing_shift); + limit = min_t(u32, limit, sysctl_tcp_limit_output_bytes); + limit <<= factor; + diff --git a/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch b/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch new file mode 100644 index 000000000..db239e0a0 --- /dev/null +++ b/target/linux/generic/backport-4.14/071-v4.15-0001-net-bgmac-enable-master-mode-for-BCM54210E-and-B5021.patch @@ -0,0 +1,50 @@ +From 12acd136913ccdf394eeb2bc8686ff5505368119 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 12 Oct 2017 10:21:26 +0200 +Subject: [PATCH] net: bgmac: enable master mode for BCM54210E and B50212E PHYs +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +There are 4 very similar PHYs: +0x600d84a1: BCM54210E (rev B0) +0x600d84a2: BCM54210E (rev B1) +0x600d84a5: B50212E (rev B0) +0x600d84a6: B50212E (rev B1) +that need setting master mode manually. It's because they run in slave +mode by default with Automatic Slave/Master configuration disabled which +can lead to unreliable connection with massive ping loss. + +So far it was reported for a board with BCM47189 SoC and B50212E B1 PHY +connected to the bgmac supported ethernet device. Telling PHY driver to +setup PHY properly solves this issue. + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Signed-off-by: David S. Miller +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -184,13 +184,19 @@ static int bgmac_probe(struct bcma_devic + + if (!bgmac_is_bcm4707_family(core) && + !(ci->id == BCMA_CHIP_ID_BCM53573 && core->core_unit == 1)) { ++ struct phy_device *phydev; ++ + mii_bus = bcma_mdio_mii_register(bgmac); + if (IS_ERR(mii_bus)) { + err = PTR_ERR(mii_bus); + goto err; + } +- + bgmac->mii_bus = mii_bus; ++ ++ phydev = mdiobus_get_phy(bgmac->mii_bus, bgmac->phyaddr); ++ if (ci->id == BCMA_CHIP_ID_BCM53573 && phydev && ++ (phydev->drv->phy_id & phydev->drv->phy_id_mask) == PHY_ID_BCM54210E) ++ phydev->dev_flags |= PHY_BRCM_EN_MASTER_MODE; + } + + if (core->bus->hosttype == BCMA_HOSTTYPE_PCI) { diff --git a/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch b/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch new file mode 100644 index 000000000..a22d27265 --- /dev/null +++ b/target/linux/generic/backport-4.14/076-v4.15-0001-net-phy-broadcom-support-new-device-flag-for-setting.patch @@ -0,0 +1,54 @@ +From 2355a6546a053b1c16ebefd6ce1f0cccc00e1da5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 12 Oct 2017 10:21:25 +0200 +Subject: [PATCH] net: phy: broadcom: support new device flag for setting + master mode +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Some of Broadcom's PHYs run by default in slave mode with Automatic +Slave/Master configuration disabled. It stops them from working properly +with some devices. + +So far it has been verified for BCM54210E and BCM50212E which don't +work well with Intel's I217-LM and I218-LM: +http://ark.intel.com/products/60019/Intel-Ethernet-Connection-I217-LM +http://ark.intel.com/products/71307/Intel-Ethernet-Connection-I218-LM +I was told there is massive ping loss. + +This commit adds support for a new flag which can be set by an ethernet +driver to fixup PHY setup. + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Signed-off-by: David S. Miller +--- + drivers/net/phy/broadcom.c | 6 ++++++ + include/linux/brcmphy.h | 1 + + 2 files changed, 7 insertions(+) + +--- a/drivers/net/phy/broadcom.c ++++ b/drivers/net/phy/broadcom.c +@@ -43,6 +43,12 @@ static int bcm54210e_config_init(struct + val &= ~BCM54810_SHD_CLK_CTL_GTXCLK_EN; + bcm_phy_write_shadow(phydev, BCM54810_SHD_CLK_CTL, val); + ++ if (phydev->dev_flags & PHY_BRCM_EN_MASTER_MODE) { ++ val = phy_read(phydev, MII_CTRL1000); ++ val |= CTL1000_AS_MASTER | CTL1000_ENABLE_MASTER; ++ phy_write(phydev, MII_CTRL1000, val); ++ } ++ + return 0; + } + +--- a/include/linux/brcmphy.h ++++ b/include/linux/brcmphy.h +@@ -64,6 +64,7 @@ + #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 + #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 + #define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 ++#define PHY_BRCM_EN_MASTER_MODE 0x00010000 + + /* Broadcom BCM7xxx specific workarounds */ + #define PHY_BRCM_7XXX_REV(x) (((x) >> 8) & 0xff) diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 new file mode 100644 index 000000000..060f64341 --- /dev/null +++ b/target/linux/generic/config-4.14 @@ -0,0 +1,5591 @@ +CONFIG_32BIT=y +# CONFIG_6LOWPAN is not set +# CONFIG_6LOWPAN_DEBUGFS is not set +# CONFIG_6PACK is not set +# CONFIG_8139CP is not set +# CONFIG_8139TOO is not set +# CONFIG_9P_FS is not set +# CONFIG_AB3100_CORE is not set +# CONFIG_AB8500_CORE is not set +# CONFIG_ABP060MG is not set +# CONFIG_ABX500_CORE is not set +# CONFIG_ACCESSIBILITY is not set +# CONFIG_ACENIC is not set +# CONFIG_ACERHDF is not set +# CONFIG_ACORN_PARTITION is not set +# CONFIG_ACPI_ALS is not set +# CONFIG_ACPI_APEI is not set +# CONFIG_ACPI_BUTTON is not set +# CONFIG_ACPI_CONFIGFS is not set +# CONFIG_ACPI_CUSTOM_METHOD is not set +# CONFIG_ACPI_EXTLOG is not set +# CONFIG_ACPI_HED is not set +# CONFIG_ACPI_NFIT is not set +# CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set +# CONFIG_ACPI_TABLE_UPGRADE is not set +# CONFIG_ACPI_VIDEO is not set +# CONFIG_AD2S1200 is not set +# CONFIG_AD2S1210 is not set +# CONFIG_AD2S90 is not set +# CONFIG_AD5064 is not set +# CONFIG_AD525X_DPOT is not set +# CONFIG_AD5360 is not set +# CONFIG_AD5380 is not set +# CONFIG_AD5421 is not set +# CONFIG_AD5446 is not set +# CONFIG_AD5449 is not set +# CONFIG_AD5504 is not set +# CONFIG_AD5592R is not set +# CONFIG_AD5593R is not set +# CONFIG_AD5624R_SPI is not set +# CONFIG_AD5686 is not set +# CONFIG_AD5755 is not set +# CONFIG_AD5761 is not set +# CONFIG_AD5764 is not set +# CONFIG_AD5791 is not set +# CONFIG_AD5933 is not set +# CONFIG_AD7150 is not set +# CONFIG_AD7152 is not set +# CONFIG_AD7192 is not set +# CONFIG_AD7266 is not set +# CONFIG_AD7280 is not set +# CONFIG_AD7291 is not set +# CONFIG_AD7298 is not set +# CONFIG_AD7303 is not set +# CONFIG_AD7476 is not set +# CONFIG_AD7606 is not set +# CONFIG_AD7746 is not set +# CONFIG_AD7766 is not set +# CONFIG_AD7780 is not set +# CONFIG_AD7791 is not set +# CONFIG_AD7793 is not set +# CONFIG_AD7816 is not set +# CONFIG_AD7887 is not set +# CONFIG_AD7923 is not set +# CONFIG_AD799X is not set +# CONFIG_AD8366 is not set +# CONFIG_AD8801 is not set +# CONFIG_AD9523 is not set +# CONFIG_AD9832 is not set +# CONFIG_AD9834 is not set +# CONFIG_ADAPTEC_STARFIRE is not set +# CONFIG_ADE7753 is not set +# CONFIG_ADE7754 is not set +# CONFIG_ADE7758 is not set +# CONFIG_ADE7759 is not set +# CONFIG_ADE7854 is not set +# CONFIG_ADF4350 is not set +# CONFIG_ADFS_FS is not set +# CONFIG_ADIS16060 is not set +# CONFIG_ADIS16080 is not set +# CONFIG_ADIS16130 is not set +# CONFIG_ADIS16136 is not set +# CONFIG_ADIS16201 is not set +# CONFIG_ADIS16203 is not set +# CONFIG_ADIS16204 is not set +# CONFIG_ADIS16209 is not set +# CONFIG_ADIS16220 is not set +# CONFIG_ADIS16240 is not set +# CONFIG_ADIS16260 is not set +# CONFIG_ADIS16400 is not set +# CONFIG_ADIS16480 is not set +# CONFIG_ADJD_S311 is not set +# CONFIG_ADM6996_PHY is not set +# CONFIG_ADM8211 is not set +# CONFIG_ADT7316 is not set +CONFIG_ADVISE_SYSCALLS=y +# CONFIG_ADXL345_I2C is not set +# CONFIG_ADXL345_SPI is not set +# CONFIG_ADXRS450 is not set +CONFIG_AEABI=y +# CONFIG_AFE4403 is not set +# CONFIG_AFE4404 is not set +# CONFIG_AFFS_FS is not set +# CONFIG_AFS_FS is not set +# CONFIG_AF_KCM is not set +# CONFIG_AF_RXRPC is not set +# CONFIG_AF_RXRPC_INJECT_LOSS is not set +# CONFIG_AF_RXRPC_IPV6 is not set +# CONFIG_AGP is not set +# CONFIG_AHCI_CEVA is not set +# CONFIG_AHCI_IMX is not set +# CONFIG_AHCI_MVEBU is not set +# CONFIG_AHCI_QORIQ is not set +CONFIG_AIO=y +# CONFIG_AIRO is not set +# CONFIG_AIRO_CS is not set +# CONFIG_AIX_PARTITION is not set +# CONFIG_AK09911 is not set +# CONFIG_AK8974 is not set +# CONFIG_AK8975 is not set +# CONFIG_AL3320A is not set +# CONFIG_ALIM7101_WDT is not set +CONFIG_ALLOW_DEV_COREDUMP=y +# CONFIG_ALTERA_MBOX is not set +# CONFIG_ALTERA_MSGDMA is not set +# CONFIG_ALTERA_STAPL is not set +# CONFIG_ALTERA_TSE is not set +# CONFIG_ALX is not set +# CONFIG_AM2315 is not set +# CONFIG_AM335X_PHY_USB is not set +# CONFIG_AMBA_PL08X is not set +# CONFIG_AMD8111_ETH is not set +# CONFIG_AMD_MEM_ENCRYPT is not set +# CONFIG_AMD_PHY is not set +# CONFIG_AMD_XGBE is not set +# CONFIG_AMD_XGBE_HAVE_ECC is not set +# CONFIG_AMIGA_PARTITION is not set +# CONFIG_AMILO_RFKILL is not set +# CONFIG_ANDROID is not set +CONFIG_ANON_INODES=y +# CONFIG_APDS9300 is not set +# CONFIG_APDS9802ALS is not set +# CONFIG_APDS9960 is not set +# CONFIG_APM8018X is not set +# CONFIG_APM_EMULATION is not set +# CONFIG_APPLE_GMUX is not set +# CONFIG_APPLE_PROPERTIES is not set +# CONFIG_APPLICOM is not set +# CONFIG_AQUANTIA_PHY is not set +# CONFIG_AQTION is not set +# CONFIG_AR5523 is not set +# CONFIG_AR7 is not set +# CONFIG_AR8216_PHY is not set +# CONFIG_AR8216_PHY_LEDS is not set +# CONFIG_ARCH_ACTIONS is not set +# CONFIG_ARCH_ALPINE is not set +# CONFIG_ARCH_ARTPEC is not set +# CONFIG_ARCH_ASPEED is not set +# CONFIG_ARCH_AT91 is not set +# CONFIG_ARCH_BCM is not set +# CONFIG_ARCH_BCM2835 is not set +# CONFIG_ARCH_BCM_21664 is not set +# CONFIG_ARCH_BCM_23550 is not set +# CONFIG_ARCH_BCM_281XX is not set +# CONFIG_ARCH_BCM_5301X is not set +# CONFIG_ARCH_BCM_53573 is not set +# CONFIG_ARCH_BCM_63XX is not set +# CONFIG_ARCH_BCM_CYGNUS is not set +# CONFIG_ARCH_BCM_IPROC is not set +# CONFIG_ARCH_BCM_NSP is not set +# CONFIG_ARCH_BERLIN is not set +# CONFIG_ARCH_BRCMSTB is not set +# CONFIG_ARCH_CLPS711X is not set +# CONFIG_ARCH_CNS3XXX is not set +# CONFIG_ARCH_DAVINCI is not set +# CONFIG_ARCH_DIGICOLOR is not set +# CONFIG_ARCH_DMA_ADDR_T_64BIT is not set +# CONFIG_ARCH_DOVE is not set +# CONFIG_ARCH_EBSA110 is not set +# CONFIG_ARCH_EP93XX is not set +# CONFIG_ARCH_EXYNOS is not set +CONFIG_ARCH_FLATMEM_ENABLE=y +# CONFIG_ARCH_FOOTBRIDGE is not set +# CONFIG_ARCH_GEMINI is not set +CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y +# CONFIG_ARCH_HAS_ILOG2_U32 is not set +# CONFIG_ARCH_HAS_ILOG2_U64 is not set +CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y +# CONFIG_ARCH_HI3xxx is not set +# CONFIG_ARCH_HIGHBANK is not set +# CONFIG_ARCH_HISI is not set +# CONFIG_ARCH_INTEGRATOR is not set +# CONFIG_ARCH_IOP13XX is not set +# CONFIG_ARCH_IOP32X is not set +# CONFIG_ARCH_IOP33X is not set +# CONFIG_ARCH_IXP4XX is not set +# CONFIG_ARCH_KEYSTONE is not set +# CONFIG_ARCH_KS8695 is not set +# CONFIG_ARCH_LAYERSCAPE is not set +# CONFIG_ARCH_LG1K is not set +# CONFIG_ARCH_LPC32XX is not set +# CONFIG_ARCH_MEDIATEK is not set +# CONFIG_ARCH_MESON is not set +CONFIG_ARCH_MMAP_RND_BITS=8 +CONFIG_ARCH_MMAP_RND_BITS_MAX=16 +CONFIG_ARCH_MMAP_RND_BITS_MIN=8 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 +# CONFIG_ARCH_MMP is not set +# CONFIG_ARCH_MULTIPLATFORM is not set +# CONFIG_ARCH_MULTI_V6 is not set +# CONFIG_ARCH_MULTI_V7 is not set +# CONFIG_ARCH_MV78XX0 is not set +# CONFIG_ARCH_MVEBU is not set +# CONFIG_ARCH_MXC is not set +# CONFIG_ARCH_MXS is not set +# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set +# CONFIG_ARCH_NETX is not set +# CONFIG_ARCH_NOMADIK is not set +# CONFIG_ARCH_NSPIRE is not set +# CONFIG_ARCH_OMAP is not set +# CONFIG_ARCH_OMAP1 is not set +# CONFIG_ARCH_OMAP2 is not set +# CONFIG_ARCH_OMAP2PLUS is not set +# CONFIG_ARCH_OMAP3 is not set +# CONFIG_ARCH_OMAP4 is not set +# CONFIG_ARCH_ORION5X is not set +# CONFIG_ARCH_OXNAS is not set +# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set +# CONFIG_ARCH_PICOXCELL is not set +# CONFIG_ARCH_PRIMA2 is not set +# CONFIG_ARCH_PXA is not set +# CONFIG_ARCH_QCOM is not set +# CONFIG_ARCH_REALVIEW is not set +# CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_RENESAS is not set +# CONFIG_ARCH_ROCKCHIP is not set +# CONFIG_ARCH_RPC is not set +# CONFIG_ARCH_S3C24XX is not set +# CONFIG_ARCH_S3C64XX is not set +# CONFIG_ARCH_S5PV210 is not set +# CONFIG_ARCH_SA1100 is not set +# CONFIG_ARCH_SEATTLE is not set +# CONFIG_ARCH_SHMOBILE is not set +# CONFIG_ARCH_SHMOBILE_MULTI is not set +# CONFIG_ARCH_SIRF is not set +# CONFIG_ARCH_SOCFPGA is not set +# CONFIG_ARCH_SPRD is not set +# CONFIG_ARCH_STI is not set +# CONFIG_ARCH_STRATIX10 is not set +# CONFIG_ARCH_SUNXI is not set +# CONFIG_ARCH_TANGO is not set +# CONFIG_ARCH_TEGRA is not set +# CONFIG_ARCH_THUNDER is not set +# CONFIG_ARCH_THUNDER2 is not set +# CONFIG_ARCH_U300 is not set +# CONFIG_ARCH_U8500 is not set +# CONFIG_ARCH_UNIPHIER is not set +# CONFIG_ARCH_VERSATILE is not set +# CONFIG_ARCH_VEXPRESS is not set +# CONFIG_ARCH_VIRT is not set +# CONFIG_ARCH_VT8500 is not set +# CONFIG_ARCH_VULCAN is not set +# CONFIG_ARCH_W90X900 is not set +# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set +# CONFIG_ARCH_WM8505 is not set +# CONFIG_ARCH_WM8750 is not set +# CONFIG_ARCH_WM8850 is not set +# CONFIG_ARCH_XGENE is not set +# CONFIG_ARCH_ZX is not set +# CONFIG_ARCH_ZYNQ is not set +# CONFIG_ARCH_ZYNQMP is not set +# CONFIG_ARCNET is not set +# CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_826319 is not set +# CONFIG_ARM64_ERRATUM_827319 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_832075 is not set +# CONFIG_ARM64_ERRATUM_834220 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set +# CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_858921 is not set +# CONFIG_ARM64_RELOC_TEST is not set +# CONFIG_ARM_APPENDED_DTB is not set +# CONFIG_ARM_ARCH_TIMER is not set +# CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set +# CONFIG_ARM_CCI is not set +# CONFIG_ARM_CCI400_PMU is not set +# CONFIG_ARM_CCI5xx_PMU is not set +# CONFIG_ARM_CCN is not set +# CONFIG_ARM_CPUIDLE is not set +CONFIG_ARM_CPU_TOPOLOGY=y +# CONFIG_ARM_CRYPTO is not set +CONFIG_ARM_DMA_MEM_BUFFERABLE=y +# CONFIG_ARM_ERRATA_326103 is not set +# CONFIG_ARM_ERRATA_364296 is not set +# CONFIG_ARM_ERRATA_411920 is not set +# CONFIG_ARM_ERRATA_430973 is not set +# CONFIG_ARM_ERRATA_458693 is not set +# CONFIG_ARM_ERRATA_460075 is not set +# CONFIG_ARM_ERRATA_643719 is not set +# CONFIG_ARM_ERRATA_720789 is not set +# CONFIG_ARM_ERRATA_742230 is not set +# CONFIG_ARM_ERRATA_742231 is not set +# CONFIG_ARM_ERRATA_743622 is not set +# CONFIG_ARM_ERRATA_751472 is not set +# CONFIG_ARM_ERRATA_754322 is not set +# CONFIG_ARM_ERRATA_754327 is not set +# CONFIG_ARM_ERRATA_764369 is not set +# CONFIG_ARM_ERRATA_773022 is not set +# CONFIG_ARM_ERRATA_775420 is not set +# CONFIG_ARM_ERRATA_798181 is not set +# CONFIG_ARM_ERRATA_818325_852422 is not set +# CONFIG_ARM_ERRATA_821420 is not set +# CONFIG_ARM_ERRATA_825619 is not set +# CONFIG_ARM_ERRATA_852421 is not set +# CONFIG_ARM_ERRATA_852423 is not set +CONFIG_ARM_GIC_MAX_NR=1 +# CONFIG_ARM_KERNMEM_PERMS is not set +# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set +# CONFIG_ARM_KPROBES_TEST is not set +# CONFIG_ARM_MHU is not set +# CONFIG_ARM_MODULE_PLTS is not set +# CONFIG_ARM_PATCH_PHYS_VIRT is not set +# CONFIG_ARM_PSCI is not set +# CONFIG_ARM_PTDUMP is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_ARM_SCPI_PROTOCOL is not set +# CONFIG_ARM_TIMER_SP804 is not set +# CONFIG_ARM_UNWIND is not set +# CONFIG_ARM_VIRT_EXT is not set +# CONFIG_AS3935 is not set +# CONFIG_ASM9260_TIMER is not set +# CONFIG_ASUS_LAPTOP is not set +# CONFIG_ASUS_WIRELESS is not set +# CONFIG_ASYMMETRIC_KEY_TYPE is not set +# CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE is not set +# CONFIG_ASYNC_RAID6_TEST is not set +# CONFIG_ASYNC_TX_DMA is not set +# CONFIG_AT76C50X_USB is not set +# CONFIG_AT803X_PHY is not set +# CONFIG_AT91_SAMA5D2_ADC is not set +# CONFIG_ATA is not set +# CONFIG_ATAGS is not set +CONFIG_ATAGS_PROC=y +# CONFIG_ATALK is not set +# CONFIG_ATARI_PARTITION is not set +# CONFIG_ATA_ACPI is not set +CONFIG_ATA_BMDMA=y +# CONFIG_ATA_GENERIC is not set +# CONFIG_ATA_NONSTANDARD is not set +# CONFIG_ATA_OVER_ETH is not set +# CONFIG_ATA_PIIX is not set +CONFIG_ATA_SFF=y +# CONFIG_ATA_VERBOSE_ERROR is not set +# CONFIG_ATH10K is not set +# CONFIG_ATH25 is not set +# CONFIG_ATH5K is not set +# CONFIG_ATH6KL is not set +# CONFIG_ATH79 is not set +# CONFIG_ATH9K is not set +# CONFIG_ATH9K_HTC is not set +# CONFIG_ATH_DEBUG is not set +# CONFIG_ATL1 is not set +# CONFIG_ATL1C is not set +# CONFIG_ATL1E is not set +# CONFIG_ATL2 is not set +# CONFIG_ATLAS_PH_SENSOR is not set +# CONFIG_ATM is not set +# CONFIG_ATMEL is not set +# CONFIG_ATMEL_PIT is not set +# CONFIG_ATMEL_SSC is not set +# CONFIG_ATM_AMBASSADOR is not set +# CONFIG_ATM_BR2684 is not set +CONFIG_ATM_BR2684_IPFILTER=y +# CONFIG_ATM_CLIP is not set +CONFIG_ATM_CLIP_NO_ICMP=y +# CONFIG_ATM_DRIVERS is not set +# CONFIG_ATM_DUMMY is not set +# CONFIG_ATM_ENI is not set +# CONFIG_ATM_FIRESTREAM is not set +# CONFIG_ATM_FORE200E is not set +# CONFIG_ATM_HE is not set +# CONFIG_ATM_HORIZON is not set +# CONFIG_ATM_IA is not set +# CONFIG_ATM_IDT77252 is not set +# CONFIG_ATM_LANAI is not set +# CONFIG_ATM_LANE is not set +# CONFIG_ATM_MPOA is not set +# CONFIG_ATM_NICSTAR is not set +# CONFIG_ATM_SOLOS is not set +# CONFIG_ATM_TCP is not set +# CONFIG_ATM_ZATM is not set +# CONFIG_ATOMIC64_SELFTEST is not set +# CONFIG_ATP is not set +# CONFIG_AUDIT is not set +# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set +# CONFIG_AURORA_NB8800 is not set +# CONFIG_AUTOFS4_FS is not set +# CONFIG_AUTO_ZRELADDR is not set +# CONFIG_AUXDISPLAY is not set +# CONFIG_AX25 is not set +# CONFIG_AX25_DAMA_SLAVE is not set +# CONFIG_AX88796 is not set +# CONFIG_AXP20X_ADC is not set +# CONFIG_AXP20X_POWER is not set +# CONFIG_AXP288_ADC is not set +# CONFIG_AXP288_FUEL_GAUGE is not set +# CONFIG_B43 is not set +# CONFIG_B43LEGACY is not set +# CONFIG_B44 is not set +# CONFIG_B53 is not set +# CONFIG_BACKLIGHT_ADP8860 is not set +# CONFIG_BACKLIGHT_ADP8870 is not set +# CONFIG_BACKLIGHT_APPLE is not set +# CONFIG_BACKLIGHT_ARCXCNN is not set +# CONFIG_BACKLIGHT_BD6107 is not set +# CONFIG_BACKLIGHT_GENERIC is not set +# CONFIG_BACKLIGHT_GPIO is not set +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set +# CONFIG_BACKLIGHT_LM3630A is not set +# CONFIG_BACKLIGHT_LM3639 is not set +# CONFIG_BACKLIGHT_LP855X is not set +# CONFIG_BACKLIGHT_LV5207LP is not set +# CONFIG_BACKLIGHT_PANDORA is not set +# CONFIG_BACKLIGHT_PM8941_WLED is not set +# CONFIG_BACKLIGHT_RPI is not set +# CONFIG_BACKLIGHT_SAHARA is not set +# CONFIG_BACKTRACE_SELF_TEST is not set +CONFIG_BASE_FULL=y +CONFIG_BASE_SMALL=0 +# CONFIG_BATMAN_ADV is not set +# CONFIG_BATTERY_BQ27XXX is not set +# CONFIG_BATTERY_DS2760 is not set +# CONFIG_BATTERY_DS2780 is not set +# CONFIG_BATTERY_DS2781 is not set +# CONFIG_BATTERY_DS2782 is not set +# CONFIG_BATTERY_GAUGE_LTC2941 is not set +# CONFIG_BATTERY_GOLDFISH is not set +# CONFIG_BATTERY_LEGO_EV3 is not set +# CONFIG_BATTERY_MAX17040 is not set +# CONFIG_BATTERY_MAX17042 is not set +# CONFIG_BATTERY_MAX1721X is not set +# CONFIG_BATTERY_SBS is not set +# CONFIG_BAYCOM_EPP is not set +# CONFIG_BAYCOM_PAR is not set +# CONFIG_BAYCOM_SER_FDX is not set +# CONFIG_BAYCOM_SER_HDX is not set +# CONFIG_BCACHE is not set +# CONFIG_BCM47XX is not set +# CONFIG_BCM63XX is not set +# CONFIG_BCM63XX_PHY is not set +# CONFIG_BCM7038_WDT is not set +# CONFIG_BCM7XXX_PHY is not set +# CONFIG_BCM87XX_PHY is not set +# CONFIG_BCMA is not set +# CONFIG_BCMA_DRIVER_GPIO is not set +CONFIG_BCMA_POSSIBLE=y +# CONFIG_BCMGENET is not set +# CONFIG_BCM_IPROC_ADC is not set +# CONFIG_BCM_KONA_USB2_PHY is not set +# CONFIG_BDI_SWITCH is not set +# CONFIG_BE2ISCSI is not set +# CONFIG_BE2NET is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BFS_FS is not set +# CONFIG_BGMAC is not set +# CONFIG_BH1750 is not set +# CONFIG_BH1780 is not set +# CONFIG_BIG_KEYS is not set +# CONFIG_BIG_LITTLE is not set +# CONFIG_BINARY_PRINTF is not set +# CONFIG_BINFMT_AOUT is not set +CONFIG_BINFMT_ELF=y +# CONFIG_BINFMT_FLAT is not set +# CONFIG_BINFMT_MISC is not set +CONFIG_BINFMT_SCRIPT=y +CONFIG_BITREVERSE=y +# CONFIG_BLK_CMDLINE_PARSER is not set +# CONFIG_BLK_CPQ_CISS_DA is not set +# CONFIG_BLK_CPQ_DA is not set +# CONFIG_BLK_DEBUG_FS is not set +CONFIG_BLK_DEV=y +# CONFIG_BLK_DEV_3W_XXXX_RAID is not set +# CONFIG_BLK_DEV_4DRIVES is not set +# CONFIG_BLK_DEV_AEC62XX is not set +# CONFIG_BLK_DEV_ALI14XX is not set +# CONFIG_BLK_DEV_ALI15X3 is not set +# CONFIG_BLK_DEV_AMD74XX is not set +# CONFIG_BLK_DEV_ATIIXP is not set +# CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_BSGLIB is not set +# CONFIG_BLK_DEV_CMD640 is not set +# CONFIG_BLK_DEV_CMD64X is not set +# CONFIG_BLK_DEV_COW_COMMON is not set +# CONFIG_BLK_DEV_CRYPTOLOOP is not set +# CONFIG_BLK_DEV_CS5520 is not set +# CONFIG_BLK_DEV_CS5530 is not set +# CONFIG_BLK_DEV_CS5535 is not set +# CONFIG_BLK_DEV_CS5536 is not set +# CONFIG_BLK_DEV_CY82C693 is not set +# CONFIG_BLK_DEV_DAC960 is not set +# CONFIG_BLK_DEV_DELKIN is not set +# CONFIG_BLK_DEV_DRBD is not set +# CONFIG_BLK_DEV_DTC2278 is not set +# CONFIG_BLK_DEV_FD is not set +# CONFIG_BLK_DEV_GENERIC is not set +# CONFIG_BLK_DEV_HD is not set +# CONFIG_BLK_DEV_HPT366 is not set +# CONFIG_BLK_DEV_HT6560B is not set +# CONFIG_BLK_DEV_IDEACPI is not set +# CONFIG_BLK_DEV_IDECD is not set +# CONFIG_BLK_DEV_IDECS is not set +# CONFIG_BLK_DEV_IDEPCI is not set +# CONFIG_BLK_DEV_IDEPNP is not set +# CONFIG_BLK_DEV_IDETAPE is not set +# CONFIG_BLK_DEV_IDE_AU1XXX is not set +# CONFIG_BLK_DEV_IDE_SATA is not set +CONFIG_BLK_DEV_INITRD=y +# CONFIG_BLK_DEV_INTEGRITY is not set +# CONFIG_BLK_DEV_IO_TRACE is not set +# CONFIG_BLK_DEV_IT8172 is not set +# CONFIG_BLK_DEV_IT8213 is not set +# CONFIG_BLK_DEV_IT821X is not set +# CONFIG_BLK_DEV_JMICRON is not set +# CONFIG_BLK_DEV_LOOP is not set +CONFIG_BLK_DEV_LOOP_MIN_COUNT=8 +# CONFIG_BLK_DEV_NBD is not set +# CONFIG_BLK_DEV_NS87415 is not set +# CONFIG_BLK_DEV_NULL_BLK is not set +# CONFIG_BLK_DEV_NVME is not set +# CONFIG_BLK_DEV_OFFBOARD is not set +# CONFIG_BLK_DEV_OPTI621 is not set +# CONFIG_BLK_DEV_PCIESSD_MTIP32XX is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set +# CONFIG_BLK_DEV_PIIX is not set +# CONFIG_BLK_DEV_PLATFORM is not set +# CONFIG_BLK_DEV_PMEM is not set +# CONFIG_BLK_DEV_QD65XX is not set +# CONFIG_BLK_DEV_RAM is not set +# CONFIG_BLK_DEV_RBD is not set +# CONFIG_BLK_DEV_RSXX is not set +# CONFIG_BLK_DEV_RZ1000 is not set +# CONFIG_BLK_DEV_SC1200 is not set +# CONFIG_BLK_DEV_SD is not set +# CONFIG_BLK_DEV_SIIMAGE is not set +# CONFIG_BLK_DEV_SIS5513 is not set +# CONFIG_BLK_DEV_SKD is not set +# CONFIG_BLK_DEV_SL82C105 is not set +# CONFIG_BLK_DEV_SLC90E66 is not set +# CONFIG_BLK_DEV_SR is not set +# CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SX8 is not set +# CONFIG_BLK_DEV_TC86C001 is not set +# CONFIG_BLK_DEV_THROTTLING is not set +# CONFIG_BLK_DEV_TRIFLEX is not set +# CONFIG_BLK_DEV_TRM290 is not set +# CONFIG_BLK_DEV_UMC8672 is not set +# CONFIG_BLK_DEV_UMEM is not set +# CONFIG_BLK_DEV_VIA82CXXX is not set +# CONFIG_BLK_DEV_ZONED is not set +# CONFIG_BLK_SED_OPAL is not set +# CONFIG_BLK_WBT is not set +CONFIG_BLOCK=y +# CONFIG_BMA180 is not set +# CONFIG_BMA220 is not set +# CONFIG_BMC150_ACCEL is not set +# CONFIG_BMC150_MAGN is not set +# CONFIG_BMC150_MAGN_I2C is not set +# CONFIG_BMC150_MAGN_SPI is not set +# CONFIG_BMG160 is not set +# CONFIG_BMI160_I2C is not set +# CONFIG_BMI160_SPI is not set +# CONFIG_BMIPS_GENERIC is not set +# CONFIG_BMP085 is not set +# CONFIG_BMP085_I2C is not set +# CONFIG_BMP085_SPI is not set +# CONFIG_BMP280 is not set +# CONFIG_BNA is not set +# CONFIG_BNX2 is not set +# CONFIG_BNX2X is not set +# CONFIG_BNXT is not set +# CONFIG_BONDING is not set +# CONFIG_BOOKE_WDT is not set +CONFIG_BOOKE_WDT_DEFAULT_TIMEOUT=3 +# CONFIG_BOOT_PRINTK_DELAY is not set +CONFIG_BOOT_RAW=y +CONFIG_BPF=y +# CONFIG_BPF_JIT is not set +# CONFIG_BPF_STREAM_PARSER is not set +CONFIG_BPF_SYSCALL=y +# CONFIG_BPQETHER is not set +CONFIG_BQL=y +CONFIG_BRANCH_PROFILE_NONE=y +# CONFIG_BRCMFMAC is not set +# CONFIG_BRCMSMAC is not set +# CONFIG_BRCMSTB_GISB_ARB is not set +CONFIG_BRIDGE=y +# CONFIG_BRIDGE_EBT_802_3 is not set +# CONFIG_BRIDGE_EBT_AMONG is not set +# CONFIG_BRIDGE_EBT_ARP is not set +# CONFIG_BRIDGE_EBT_ARPREPLY is not set +# CONFIG_BRIDGE_EBT_BROUTE is not set +# CONFIG_BRIDGE_EBT_DNAT is not set +# CONFIG_BRIDGE_EBT_IP is not set +# CONFIG_BRIDGE_EBT_IP6 is not set +# CONFIG_BRIDGE_EBT_LIMIT is not set +# CONFIG_BRIDGE_EBT_LOG is not set +# CONFIG_BRIDGE_EBT_MARK is not set +# CONFIG_BRIDGE_EBT_MARK_T is not set +# CONFIG_BRIDGE_EBT_NFLOG is not set +# CONFIG_BRIDGE_EBT_PKTTYPE is not set +# CONFIG_BRIDGE_EBT_REDIRECT is not set +# CONFIG_BRIDGE_EBT_SNAT is not set +# CONFIG_BRIDGE_EBT_STP is not set +# CONFIG_BRIDGE_EBT_T_FILTER is not set +# CONFIG_BRIDGE_EBT_T_NAT is not set +# CONFIG_BRIDGE_EBT_VLAN is not set +CONFIG_BRIDGE_IGMP_SNOOPING=y +# CONFIG_BRIDGE_NETFILTER is not set +# CONFIG_BRIDGE_NF_EBTABLES is not set +# CONFIG_BRIDGE_VLAN_FILTERING is not set +# CONFIG_BROADCOM_PHY is not set +CONFIG_BROKEN_ON_SMP=y +# CONFIG_BSD_DISKLABEL is not set +# CONFIG_BSD_PROCESS_ACCT is not set +# CONFIG_BSD_PROCESS_ACCT_V3 is not set +# CONFIG_BT is not set +# CONFIG_BTRFS_ASSERT is not set +# CONFIG_BTRFS_DEBUG is not set +# CONFIG_BTRFS_FS is not set +# CONFIG_BTRFS_FS_POSIX_ACL is not set +# CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not set +# CONFIG_BT_ATH3K is not set +# CONFIG_BT_BNEP is not set +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +# CONFIG_BT_BREDR is not set +# CONFIG_BT_CMTP is not set +# CONFIG_BT_HCIBCM203X is not set +# CONFIG_BT_HCIBFUSB is not set +# CONFIG_BT_HCIBLUECARD is not set +# CONFIG_BT_HCIBPA10X is not set +# CONFIG_BT_HCIBT3C is not set +# CONFIG_BT_HCIBTSDIO is not set +# CONFIG_BT_HCIBTUART is not set +# CONFIG_BT_HCIBTUSB is not set +# CONFIG_BT_HCIBTUSB_RTL is not set +# CONFIG_BT_HCIDTL1 is not set +# CONFIG_BT_HCIUART is not set +# CONFIG_BT_HCIUART_3WIRE is not set +# CONFIG_BT_HCIUART_AG6XX is not set +# CONFIG_BT_HCIUART_ATH3K is not set +CONFIG_BT_HCIUART_BCSP=y +CONFIG_BT_HCIUART_H4=y +# CONFIG_BT_HCIUART_LL is not set +# CONFIG_BT_HCIUART_MRVL is not set +# CONFIG_BT_HCIUART_QCA is not set +# CONFIG_BT_HCIVHCI is not set +# CONFIG_BT_HIDP is not set +# CONFIG_BT_HS is not set +# CONFIG_BT_LE is not set +# CONFIG_BT_LEDS is not set +# CONFIG_BT_MRVL is not set +# CONFIG_BT_RFCOMM is not set +CONFIG_BT_RFCOMM_TTY=y +# CONFIG_BT_SELFTEST is not set +CONFIG_BUG=y +# CONFIG_BUG_ON_DATA_CORRUPTION is not set +CONFIG_BUILDTIME_EXTABLE_SORT=y +# CONFIG_BUILD_BIN2C is not set +# CONFIG_C2PORT is not set +CONFIG_CACHE_L2X0_PMU=y +# CONFIG_CADENCE_WATCHDOG is not set +# CONFIG_CAIF is not set +# CONFIG_CAN is not set +# CONFIG_CAN_BCM is not set +# CONFIG_CAN_DEBUG_DEVICES is not set +# CONFIG_CAN_DEV is not set +# CONFIG_CAN_GS_USB is not set +# CONFIG_CAN_GW is not set +# CONFIG_CAN_HI311X is not set +# CONFIG_CAN_IFI_CANFD is not set +# CONFIG_CAN_MCBA_USB is not set +# CONFIG_CAN_M_CAN is not set +# CONFIG_CAN_PEAK_PCIEFD is not set +# CONFIG_CAN_RAW is not set +# CONFIG_CAN_RCAR is not set +# CONFIG_CAN_RCAR_CANFD is not set +# CONFIG_CAN_SLCAN is not set +# CONFIG_CAN_SUN4I is not set +# CONFIG_CAN_VCAN is not set +# CONFIG_CAN_VXCAN is not set +# CONFIG_CAPI_AVM is not set +# CONFIG_CAPI_EICON is not set +# CONFIG_CAPI_TRACE is not set +CONFIG_CARDBUS=y +# CONFIG_CARDMAN_4000 is not set +# CONFIG_CARDMAN_4040 is not set +# CONFIG_CARL9170 is not set +# CONFIG_CASSINI is not set +# CONFIG_CAVIUM_ERRATUM_22375 is not set +# CONFIG_CAVIUM_ERRATUM_23144 is not set +# CONFIG_CAVIUM_ERRATUM_23154 is not set +# CONFIG_CAVIUM_ERRATUM_27456 is not set +# CONFIG_CAVIUM_ERRATUM_30115 is not set +# CONFIG_CAVIUM_OCTEON_SOC is not set +# CONFIG_CB710_CORE is not set +# CONFIG_CC10001_ADC is not set +# CONFIG_CCS811 is not set +# CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE is not set +CONFIG_CC_OPTIMIZE_FOR_SIZE=y +# CONFIG_CC_STACKPROTECTOR is not set +CONFIG_CC_STACKPROTECTOR_NONE=y +# CONFIG_CC_STACKPROTECTOR_REGULAR is not set +# CONFIG_CC_STACKPROTECTOR_STRONG is not set +# CONFIG_CDROM_PKTCDVD is not set +# CONFIG_CEPH_FS is not set +# CONFIG_CEPH_LIB is not set +# CONFIG_CFG80211 is not set +# CONFIG_CFG80211_CERTIFICATION_ONUS is not set +# CONFIG_CGROUPS is not set +# CONFIG_CGROUP_DEBUG is not set +# CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CHARGER_BQ2415X is not set +# CONFIG_CHARGER_BQ24190 is not set +# CONFIG_CHARGER_BQ24257 is not set +# CONFIG_CHARGER_BQ24735 is not set +# CONFIG_CHARGER_BQ25890 is not set +# CONFIG_CHARGER_DETECTOR_MAX14656 is not set +# CONFIG_CHARGER_GPIO is not set +# CONFIG_CHARGER_ISP1704 is not set +# CONFIG_CHARGER_LP8727 is not set +# CONFIG_CHARGER_LTC3651 is not set +# CONFIG_CHARGER_MANAGER is not set +# CONFIG_CHARGER_MAX8903 is not set +# CONFIG_CHARGER_RT9455 is not set +# CONFIG_CHARGER_SBS is not set +# CONFIG_CHARGER_SMB347 is not set +# CONFIG_CHARGER_TWL4030 is not set +# CONFIG_CHECKPOINT_RESTORE is not set +# CONFIG_CHELSIO_T1 is not set +# CONFIG_CHELSIO_T3 is not set +# CONFIG_CHELSIO_T4 is not set +# CONFIG_CHELSIO_T4VF is not set +# CONFIG_CHROME_PLATFORMS is not set +# CONFIG_CHR_DEV_OSST is not set +# CONFIG_CHR_DEV_SCH is not set +# CONFIG_CHR_DEV_SG is not set +# CONFIG_CHR_DEV_ST is not set +# CONFIG_CICADA_PHY is not set +# CONFIG_CIFS is not set +# CONFIG_CIFS_ACL is not set +# CONFIG_CIFS_DEBUG is not set +# CONFIG_CIFS_DEBUG2 is not set +# CONFIG_CIFS_FSCACHE is not set +# CONFIG_CIFS_NFSD_EXPORT is not set +CONFIG_CIFS_POSIX=y +# CONFIG_CIFS_SMB2 is not set +CONFIG_CIFS_STATS=y +# CONFIG_CIFS_STATS2 is not set +# CONFIG_CIFS_WEAK_PW_HASH is not set +# CONFIG_CIFS_XATTR is not set +# CONFIG_CIO_DAC is not set +# CONFIG_CLEANCACHE is not set +# CONFIG_CLKSRC_VERSATILE is not set +# CONFIG_CLK_HSDK is not set +# CONFIG_CLK_QORIQ is not set +# CONFIG_CLOCK_THERMAL is not set +CONFIG_CLS_U32_MARK=y +# CONFIG_CLS_U32_PERF is not set +# CONFIG_CM32181 is not set +# CONFIG_CM3232 is not set +# CONFIG_CM3323 is not set +# CONFIG_CM3605 is not set +# CONFIG_CM36651 is not set +# CONFIG_CMA is not set +CONFIG_CMDLINE="" +# CONFIG_CMDLINE_BOOL is not set +# CONFIG_CMDLINE_EXTEND is not set +# CONFIG_CMDLINE_FORCE is not set +# CONFIG_CMDLINE_FROM_BOOTLOADER is not set +# CONFIG_CMDLINE_PARTITION is not set +# CONFIG_CNIC is not set +# CONFIG_CODA_FS is not set +# CONFIG_CODE_PATCHING_SELFTEST is not set +# CONFIG_COMEDI is not set +# CONFIG_COMMON_CLK_CDCE706 is not set +# CONFIG_COMMON_CLK_CDCE925 is not set +# CONFIG_COMMON_CLK_CS2000_CP is not set +# CONFIG_COMMON_CLK_IPROC is not set +# CONFIG_COMMON_CLK_NXP is not set +# CONFIG_COMMON_CLK_PIC32 is not set +# CONFIG_COMMON_CLK_PWM is not set +# CONFIG_COMMON_CLK_PXA is not set +# CONFIG_COMMON_CLK_QCOM is not set +# CONFIG_COMMON_CLK_SI514 is not set +# CONFIG_COMMON_CLK_SI5351 is not set +# CONFIG_COMMON_CLK_SI570 is not set +# CONFIG_COMMON_CLK_VC5 is not set +# CONFIG_COMMON_CLK_XLNX_CLKWZRD is not set +# CONFIG_COMPACTION is not set +# CONFIG_COMPAL_LAPTOP is not set +# CONFIG_COMPAT_BRK is not set +# CONFIG_COMPILE_TEST is not set +# CONFIG_CONFIGFS_FS is not set +# CONFIG_CONNECTOR is not set +CONFIG_CONSTRUCTORS=y +# CONFIG_CONTEXT_SWITCH_TRACER is not set +# CONFIG_COPS is not set +# CONFIG_CORDIC is not set +# CONFIG_COREDUMP is not set +# CONFIG_CORESIGHT is not set +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set +# CONFIG_CORTINA_PHY is not set +# CONFIG_CPA_DEBUG is not set +# CONFIG_CPU_DCACHE_DISABLE is not set +# CONFIG_CPU_FREQ is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL is not set +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set +# CONFIG_CPU_FREQ_GOV_SCHEDUTIL is not set +# CONFIG_CPU_FREQ_STAT_DETAILS is not set +# CONFIG_CPU_IDLE is not set +# CONFIG_CPU_IDLE_GOV_MENU is not set +# CONFIG_CPU_IDLE_MULTIPLE_DRIVERS is not set +# CONFIG_CPU_NO_EFFICIENT_FFS is not set +CONFIG_CPU_SW_DOMAIN_PAN=y +# CONFIG_CRAMFS is not set +CONFIG_CRASHLOG=y +# CONFIG_CRASH_DUMP is not set +# CONFIG_CRC16 is not set +CONFIG_CRC32=y +# CONFIG_CRC32_BIT is not set +CONFIG_CRC32_SARWATE=y +# CONFIG_CRC32_SELFTEST is not set +# CONFIG_CRC32_SLICEBY4 is not set +# CONFIG_CRC32_SLICEBY8 is not set +# CONFIG_CRC4 is not set +# CONFIG_CRC7 is not set +# CONFIG_CRC8 is not set +# CONFIG_CRC_CCITT is not set +# CONFIG_CRC_ITU_T is not set +# CONFIG_CRC_T10DIF is not set +CONFIG_CROSS_COMPILE="" +# CONFIG_CROSS_MEMORY_ATTACH is not set +CONFIG_CRYPTO=y +# CONFIG_CRYPTO_842 is not set +# CONFIG_CRYPTO_AEAD is not set +CONFIG_CRYPTO_AES=y +# CONFIG_CRYPTO_AES_586 is not set +# CONFIG_CRYPTO_AES_ARM is not set +# CONFIG_CRYPTO_AES_ARM_BS is not set +# CONFIG_CRYPTO_AES_NI_INTEL is not set +# CONFIG_CRYPTO_AES_TI is not set +CONFIG_CRYPTO_ALGAPI=y +CONFIG_CRYPTO_ALGAPI2=y +# CONFIG_CRYPTO_ANSI_CPRNG is not set +# CONFIG_CRYPTO_ANUBIS is not set +CONFIG_CRYPTO_ARC4=y +# CONFIG_CRYPTO_AUTHENC is not set +CONFIG_CRYPTO_BLKCIPHER=y +CONFIG_CRYPTO_BLKCIPHER2=y +# CONFIG_CRYPTO_BLOWFISH is not set +# CONFIG_CRYPTO_CAMELLIA is not set +# CONFIG_CRYPTO_CAST5 is not set +# CONFIG_CRYPTO_CAST6 is not set +# CONFIG_CRYPTO_CBC is not set +# CONFIG_CRYPTO_CCM is not set +# CONFIG_CRYPTO_CHACHA20 is not set +# CONFIG_CRYPTO_CHACHA20POLY1305 is not set +# CONFIG_CRYPTO_CMAC is not set +# CONFIG_CRYPTO_CRC32 is not set +# CONFIG_CRYPTO_CRC32C is not set +# CONFIG_CRYPTO_CRC32C_INTEL is not set +# CONFIG_CRYPTO_CRCT10DIF is not set +# CONFIG_CRYPTO_CRYPTD is not set +# CONFIG_CRYPTO_CTR is not set +# CONFIG_CRYPTO_CTS is not set +# CONFIG_CRYPTO_DEFLATE is not set +# CONFIG_CRYPTO_DES is not set +# CONFIG_CRYPTO_DEV_ATMEL_AES is not set +# CONFIG_CRYPTO_DEV_ATMEL_SHA is not set +# CONFIG_CRYPTO_DEV_ATMEL_TDES is not set +# CONFIG_CRYPTO_DEV_CCP is not set +# CONFIG_CRYPTO_DEV_CCREE is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM is not set +# CONFIG_CRYPTO_DEV_FSL_CAAM_CRYPTO_API_DESC is not set +# CONFIG_CRYPTO_DEV_HIFN_795X is not set +# CONFIG_CRYPTO_DEV_IMGTEC_HASH is not set +# CONFIG_CRYPTO_DEV_MARVELL_CESA is not set +# CONFIG_CRYPTO_DEV_MV_CESA is not set +# CONFIG_CRYPTO_DEV_MXS_DCP is not set +# CONFIG_CRYPTO_DEV_NITROX_CNN55XX is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXX is not set +# CONFIG_CRYPTO_DEV_QAT_C3XXXVF is not set +# CONFIG_CRYPTO_DEV_QAT_C62X is not set +# CONFIG_CRYPTO_DEV_QAT_C62XVF is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCC is not set +# CONFIG_CRYPTO_DEV_QAT_DH895xCCVF is not set +# CONFIG_CRYPTO_DEV_QCE is not set +# CONFIG_CRYPTO_DEV_SAHARA is not set +# CONFIG_CRYPTO_DEV_TALITOS is not set +# CONFIG_CRYPTO_DEV_VIRTIO is not set +# CONFIG_CRYPTO_DH is not set +# CONFIG_CRYPTO_DRBG_CTR is not set +# CONFIG_CRYPTO_DRBG_HASH is not set +# CONFIG_CRYPTO_DRBG_MENU is not set +# CONFIG_CRYPTO_ECB is not set +# CONFIG_CRYPTO_ECDH is not set +# CONFIG_CRYPTO_ECHAINIV is not set +# CONFIG_CRYPTO_FCRYPT is not set +# CONFIG_CRYPTO_FIPS is not set +# CONFIG_CRYPTO_GCM is not set +# CONFIG_CRYPTO_GF128MUL is not set +# CONFIG_CRYPTO_GHASH is not set +# CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set +# CONFIG_CRYPTO_HASH is not set +# CONFIG_CRYPTO_HMAC is not set +# CONFIG_CRYPTO_HW is not set +# CONFIG_CRYPTO_JITTERENTROPY is not set +# CONFIG_CRYPTO_KEYWRAP is not set +# CONFIG_CRYPTO_KHAZAD is not set +# CONFIG_CRYPTO_LRW is not set +# CONFIG_CRYPTO_LZ4 is not set +# CONFIG_CRYPTO_LZ4HC is not set +# CONFIG_CRYPTO_LZO is not set +# CONFIG_CRYPTO_MANAGER is not set +# CONFIG_CRYPTO_MANAGER2 is not set +CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y +# CONFIG_CRYPTO_MCRYPTD is not set +# CONFIG_CRYPTO_MD4 is not set +# CONFIG_CRYPTO_MD5 is not set +# CONFIG_CRYPTO_MICHAEL_MIC is not set +# CONFIG_CRYPTO_NULL is not set +# CONFIG_CRYPTO_PCBC is not set +# CONFIG_CRYPTO_PCOMP is not set +# CONFIG_CRYPTO_PCOMP2 is not set +CONFIG_CRYPTO_PCRYPT=y +# CONFIG_CRYPTO_POLY1305 is not set +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set +# CONFIG_CRYPTO_RNG is not set +# CONFIG_CRYPTO_RSA is not set +# CONFIG_CRYPTO_SALSA20 is not set +# CONFIG_CRYPTO_SALSA20_586 is not set +# CONFIG_CRYPTO_SEED is not set +# CONFIG_CRYPTO_SEQIV is not set +# CONFIG_CRYPTO_SERPENT is not set +# CONFIG_CRYPTO_SHA1 is not set +# CONFIG_CRYPTO_SHA1_ARM is not set +# CONFIG_CRYPTO_SHA256 is not set +# CONFIG_CRYPTO_SHA3 is not set +# CONFIG_CRYPTO_SHA512 is not set +# CONFIG_CRYPTO_TEA is not set +# CONFIG_CRYPTO_TEST is not set +# CONFIG_CRYPTO_TGR192 is not set +# CONFIG_CRYPTO_TWOFISH is not set +# CONFIG_CRYPTO_TWOFISH_586 is not set +# CONFIG_CRYPTO_TWOFISH_COMMON is not set +# CONFIG_CRYPTO_USER is not set +# CONFIG_CRYPTO_USER_API_AEAD is not set +# CONFIG_CRYPTO_USER_API_HASH is not set +# CONFIG_CRYPTO_USER_API_RNG is not set +# CONFIG_CRYPTO_USER_API_SKCIPHER is not set +# CONFIG_CRYPTO_VMAC is not set +# CONFIG_CRYPTO_WP512 is not set +# CONFIG_CRYPTO_XCBC is not set +# CONFIG_CRYPTO_XTS is not set +# CONFIG_CRYPTO_ZLIB is not set +# CONFIG_CS5535_MFGPT is not set +# CONFIG_CS89x0 is not set +# CONFIG_CUSE is not set +# CONFIG_CW1200 is not set +# CONFIG_CXL_AFU_DRIVER_OPS is not set +# CONFIG_CXL_BASE is not set +# CONFIG_CXL_EEH is not set +# CONFIG_CXL_KERNEL_API is not set +# CONFIG_CXL_LIB is not set +# CONFIG_CYPRESS_FIRMWARE is not set +# CONFIG_DA280 is not set +# CONFIG_DA311 is not set +# CONFIG_DAVICOM_PHY is not set +# CONFIG_DAX is not set +# CONFIG_DCB is not set +# CONFIG_DDR is not set +# CONFIG_DEBUG_ATOMIC_SLEEP is not set +# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set +# CONFIG_DEBUG_BUGVERBOSE is not set +# CONFIG_DEBUG_CREDENTIALS is not set +# CONFIG_DEBUG_DEVRES is not set +# CONFIG_DEBUG_DRIVER is not set +# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set +CONFIG_DEBUG_FS=y +# CONFIG_DEBUG_GPIO is not set +# CONFIG_DEBUG_HIGHMEM is not set +# CONFIG_DEBUG_ICEDCC is not set +# CONFIG_DEBUG_INFO is not set +# CONFIG_DEBUG_INFO_DWARF4 is not set +CONFIG_DEBUG_INFO_REDUCED=y +# CONFIG_DEBUG_INFO_SPLIT is not set +CONFIG_DEBUG_KERNEL=y +# CONFIG_DEBUG_KMEMLEAK is not set +# CONFIG_DEBUG_KOBJECT is not set +# CONFIG_DEBUG_KOBJECT_RELEASE is not set +# CONFIG_DEBUG_LIST is not set +# CONFIG_DEBUG_LL is not set +# CONFIG_DEBUG_LL_UART_8250 is not set +# CONFIG_DEBUG_LL_UART_PL01X is not set +# CONFIG_DEBUG_LOCKDEP is not set +# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set +# CONFIG_DEBUG_LOCK_ALLOC is not set +# CONFIG_DEBUG_MEMORY_INIT is not set +# CONFIG_DEBUG_MUTEXES is not set +# CONFIG_DEBUG_NOTIFIERS is not set +# CONFIG_DEBUG_NX_TEST is not set +# CONFIG_DEBUG_OBJECTS is not set +# CONFIG_DEBUG_PAGEALLOC is not set +# CONFIG_DEBUG_PAGE_REF is not set +# CONFIG_DEBUG_PERF_USE_VMALLOC is not set +# CONFIG_DEBUG_PER_CPU_MAPS is not set +# CONFIG_DEBUG_PINCTRL is not set +# CONFIG_DEBUG_PI_LIST is not set +# CONFIG_DEBUG_PREEMPT is not set +# CONFIG_DEBUG_RODATA is not set +# CONFIG_DEBUG_RODATA_TEST is not set +# CONFIG_DEBUG_RT_MUTEXES is not set +# CONFIG_DEBUG_SECTION_MISMATCH is not set +# CONFIG_DEBUG_SEMIHOSTING is not set +# CONFIG_DEBUG_SET_MODULE_RONX is not set +# CONFIG_DEBUG_SG is not set +# CONFIG_DEBUG_SHIRQ is not set +# CONFIG_DEBUG_SLAB is not set +# CONFIG_DEBUG_SPINLOCK is not set +# CONFIG_DEBUG_STACKOVERFLOW is not set +# CONFIG_DEBUG_STACK_USAGE is not set +# CONFIG_DEBUG_STRICT_USER_COPY_CHECKS is not set +# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set +# CONFIG_DEBUG_TIMEKEEPING is not set +# CONFIG_DEBUG_UART_8250_PALMCHIP is not set +# CONFIG_DEBUG_UART_BCM63XX is not set +# CONFIG_DEBUG_VIRTUAL is not set +# CONFIG_DEBUG_VM is not set +# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set +# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set +# CONFIG_DEBUG_WX is not set +# CONFIG_DEBUG_ZBOOT is not set +# CONFIG_DECNET is not set +CONFIG_DEFAULT_CUBIC=y +CONFIG_DEFAULT_DEADLINE=y +CONFIG_DEFAULT_HOSTNAME="(none)" +CONFIG_DEFAULT_IOSCHED="deadline" +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 +# CONFIG_DEFAULT_NOOP is not set +# CONFIG_DEFAULT_RENO is not set +CONFIG_DEFAULT_SECURITY="" +CONFIG_DEFAULT_SECURITY_DAC=y +CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" +# CONFIG_DELL_LAPTOP is not set +# CONFIG_DELL_RBTN is not set +# CONFIG_DELL_SMO8800 is not set +# CONFIG_DEPRECATED_PARAM_STRUCT is not set +# CONFIG_DETECT_HUNG_TASK is not set +# CONFIG_DEVKMEM is not set +# CONFIG_DEVMEM is not set +CONFIG_DEVPORT=y +# CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set +# CONFIG_DEVTMPFS is not set +# CONFIG_DEVTMPFS_MOUNT is not set +# CONFIG_DGAP is not set +# CONFIG_DGNC is not set +# CONFIG_DHT11 is not set +# CONFIG_DISCONTIGMEM_MANUAL is not set +# CONFIG_DISPLAY_CONNECTOR_ANALOG_TV is not set +# CONFIG_DISPLAY_CONNECTOR_DVI is not set +# CONFIG_DISPLAY_CONNECTOR_HDMI is not set +# CONFIG_DISPLAY_ENCODER_TFP410 is not set +# CONFIG_DISPLAY_ENCODER_TPD12S015 is not set +# CONFIG_DISPLAY_PANEL_DPI is not set +# CONFIG_DISPLAY_PANEL_LGPHILIPS_LB035Q02 is not set +# CONFIG_DISPLAY_PANEL_TPO_TD028TTEC1 is not set +# CONFIG_DISPLAY_PANEL_TPO_TD043MTEA1 is not set +# CONFIG_DL2K is not set +# CONFIG_DLM is not set +# CONFIG_DM9000 is not set +# CONFIG_DMADEVICES is not set +# CONFIG_DMADEVICES_DEBUG is not set +# CONFIG_DMARD06 is not set +# CONFIG_DMARD09 is not set +# CONFIG_DMARD10 is not set +# CONFIG_DMASCC is not set +# CONFIG_DMATEST is not set +# CONFIG_DMA_API_DEBUG is not set +# CONFIG_DMA_ENGINE is not set +# CONFIG_DMA_FENCE_TRACE is not set +# CONFIG_DMA_SHARED_BUFFER is not set +# CONFIG_DM_CACHE is not set +# CONFIG_DM_DEBUG is not set +# CONFIG_DM_DELAY is not set +# CONFIG_DM_ERA is not set +# CONFIG_DM_FLAKEY is not set +# CONFIG_DM_INTEGRITY is not set +# CONFIG_DM_LOG_USERSPACE is not set +# CONFIG_DM_LOG_WRITES is not set +# CONFIG_DM_MQ_DEFAULT is not set +# CONFIG_DM_MULTIPATH is not set +# CONFIG_DM_RAID is not set +# CONFIG_DM_SWITCH is not set +# CONFIG_DM_THIN_PROVISIONING is not set +# CONFIG_DM_UEVENT is not set +# CONFIG_DM_VERITY is not set +# CONFIG_DM_ZERO is not set +# CONFIG_DNET is not set +# CONFIG_DNOTIFY is not set +# CONFIG_DNS_RESOLVER is not set +CONFIG_DOUBLEFAULT=y +# CONFIG_DP83848_PHY is not set +# CONFIG_DP83867_PHY is not set +# CONFIG_DPOT_DAC is not set +CONFIG_DQL=y +# CONFIG_DRAGONRISE_FF is not set +# CONFIG_DRM is not set +# CONFIG_DRM_AMDGPU is not set +# CONFIG_DRM_ANALOGIX_ANX78XX is not set +# CONFIG_DRM_ARCPGU is not set +# CONFIG_DRM_ARMADA is not set +# CONFIG_DRM_AST is not set +# CONFIG_DRM_BOCHS is not set +# CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_DP_AUX_CHARDEV is not set +# CONFIG_DRM_DUMB_VGA_DAC is not set +# CONFIG_DRM_ETNAVIV is not set +# CONFIG_DRM_EXYNOS is not set +# CONFIG_DRM_FBDEV_EMULATION is not set +# CONFIG_DRM_FSL_DCU is not set +# CONFIG_DRM_HDLCD is not set +# CONFIG_DRM_HISI_KIRIN is not set +# CONFIG_DRM_HISI_HIBMC is not set +# CONFIG_DRM_I2C_ADV7511 is not set +# CONFIG_DRM_I2C_CH7006 is not set +# CONFIG_DRM_I2C_NXP_TDA998X is not set +# CONFIG_DRM_I2C_SIL164 is not set +# CONFIG_DRM_LEGACY is not set +# CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_MALI_DISPLAY is not set +# CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_NOUVEAU is not set +# CONFIG_DRM_NXP_PTN3460 is not set +# CONFIG_DRM_OMAP is not set +# CONFIG_DRM_PANEL_JDI_LT070ME05000 is not set +# CONFIG_DRM_PANEL_LG_LG4573 is not set +# CONFIG_DRM_PANEL_PANASONIC_VVX10F034N00 is not set +# CONFIG_DRM_PANEL_RASPBERRYPI_TOUCHSCREEN is not set +# CONFIG_DRM_PANEL_SAMSUNG_LD9040 is not set +# CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0 is not set +# CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set +# CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set +# CONFIG_DRM_PARADE_PS8622 is not set +# CONFIG_DRM_QXL is not set +# CONFIG_DRM_RADEON is not set +# CONFIG_DRM_SII902X is not set +# CONFIG_DRM_STI is not set +# CONFIG_DRM_TILCDC is not set +# CONFIG_DRM_TINYDRM is not set +# CONFIG_DRM_TOSHIBA_TC358767 is not set +# CONFIG_DRM_UDL is not set +# CONFIG_DRM_VBOXVIDEO is not set +# CONFIG_DRM_VGEM is not set +# CONFIG_DS1682 is not set +# CONFIG_DS1803 is not set +# CONFIG_DST_CACHE is not set +# CONFIG_DTLK is not set +# CONFIG_DUMMY is not set +CONFIG_DUMMY_CONSOLE_COLUMNS=80 +CONFIG_DUMMY_CONSOLE_ROWS=25 +# CONFIG_DUMMY_IRQ is not set +# CONFIG_DVB_AU8522_V4L is not set +# CONFIG_DVB_CORE is not set +# CONFIG_DVB_DUMMY_FE is not set +# CONFIG_DVB_TUNER_DIB0070 is not set +# CONFIG_DVB_TUNER_DIB0090 is not set +# CONFIG_DWC_XLGMAC is not set +# CONFIG_DWMAC_IPQ806X is not set +# CONFIG_DWMAC_LPC18XX is not set +# CONFIG_DWMAC_MESON is not set +# CONFIG_DWMAC_ROCKCHIP is not set +# CONFIG_DWMAC_SOCFPGA is not set +# CONFIG_DWMAC_STI is not set +# CONFIG_DW_DMAC is not set +# CONFIG_DW_DMAC_PCI is not set +# CONFIG_DW_WATCHDOG is not set +# CONFIG_DYNAMIC_DEBUG is not set +# CONFIG_E100 is not set +# CONFIG_E1000 is not set +# CONFIG_E1000E is not set +# CONFIG_E1000E_HWTS is not set +# CONFIG_EARLY_PRINTK_8250 is not set +# CONFIG_EARLY_PRINTK_USB_XDBC is not set +# CONFIG_ECHO is not set +# CONFIG_ECRYPT_FS is not set +# CONFIG_EDAC is not set +# CONFIG_EEEPC_LAPTOP is not set +# CONFIG_EEPROM_93CX6 is not set +# CONFIG_EEPROM_93XX46 is not set +# CONFIG_EEPROM_AT24 is not set +# CONFIG_EEPROM_AT25 is not set +# CONFIG_EEPROM_DIGSY_MTC_CFG is not set +# CONFIG_EEPROM_IDT_89HPESX is not set +# CONFIG_EEPROM_LEGACY is not set +# CONFIG_EEPROM_MAX6875 is not set +# CONFIG_EFI is not set +CONFIG_EFI_PARTITION=y +# CONFIG_EFS_FS is not set +CONFIG_ELFCORE=y +# CONFIG_ELF_CORE is not set +# CONFIG_EMAC_ROCKCHIP is not set +CONFIG_EMBEDDED=y +# CONFIG_EM_TIMER_STI is not set +# CONFIG_ENABLE_MUST_CHECK is not set +CONFIG_ENABLE_WARN_DEPRECATED=y +# CONFIG_ENA_ETHERNET is not set +# CONFIG_ENC28J60 is not set +# CONFIG_ENCLOSURE_SERVICES is not set +# CONFIG_ENCRYPTED_KEYS is not set +# CONFIG_ENCX24J600 is not set +# CONFIG_ENIC is not set +# CONFIG_ENVELOPE_DETECTOR is not set +# CONFIG_EPAPR_PARAVIRT is not set +# CONFIG_EPIC100 is not set +CONFIG_EPOLL=y +# CONFIG_EQUALIZER is not set +# CONFIG_ET131X is not set +CONFIG_ETHERNET=y +# CONFIG_ETHOC is not set +CONFIG_EVENTFD=y +CONFIG_EXPERT=y +# CONFIG_EXPORTFS is not set +# CONFIG_EXPORTFS_BLOCK_OPS is not set +# CONFIG_EXT2_FS is not set +# CONFIG_EXT2_FS_XATTR is not set +# CONFIG_EXT3_FS is not set +# CONFIG_EXT4_DEBUG is not set +# CONFIG_EXT4_ENCRYPTION is not set +# CONFIG_EXT4_FS is not set +# CONFIG_EXT4_FS_POSIX_ACL is not set +# CONFIG_EXT4_FS_SECURITY is not set +CONFIG_EXT4_USE_FOR_EXT2=y +# CONFIG_EXTCON is not set +# CONFIG_EXTCON_ADC_JACK is not set +# CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_INTEL_INT3496 is not set +# CONFIG_EXTCON_QCOM_SPMI_MISC is not set +# CONFIG_EXTCON_RT8973A is not set +# CONFIG_EXTCON_SM5502 is not set +# CONFIG_EXTCON_USB_GPIO is not set +# CONFIG_EXTCON_MAX3355 is not set +CONFIG_EXTRA_FIRMWARE="" +CONFIG_EXTRA_TARGETS="" +# CONFIG_EXYNOS_ADC is not set +# CONFIG_EXYNOS_VIDEO is not set +# CONFIG_EZCHIP_NPS_MANAGEMENT_ENET is not set +# CONFIG_EZX_PCAP is not set +# CONFIG_F2FS_FAULT_INJECTION is not set +# CONFIG_F2FS_FS is not set +# CONFIG_F2FS_FS_ENCRYPTION is not set +# CONFIG_F2FS_FS_POSIX_ACL is not set +# CONFIG_F2FS_IO_TRACE is not set +# CONFIG_FAIR_GROUP_SCHED is not set +# CONFIG_FANOTIFY is not set +CONFIG_FAT_DEFAULT_CODEPAGE=437 +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" +# CONFIG_FAT_DEFAULT_UTF8 is not set +# CONFIG_FAT_FS is not set +# CONFIG_FAULT_INJECTION is not set +# CONFIG_FB is not set +# CONFIG_FB_3DFX is not set +# CONFIG_FB_ARC is not set +# CONFIG_FB_ARK is not set +# CONFIG_FB_ARMCLCD is not set +# CONFIG_FB_ASILIANT is not set +# CONFIG_FB_ATY is not set +# CONFIG_FB_ATY128 is not set +# CONFIG_FB_AUO_K190X is not set +# CONFIG_FB_BACKLIGHT is not set +# CONFIG_FB_BIG_ENDIAN is not set +# CONFIG_FB_BOOT_VESA_SUPPORT is not set +# CONFIG_FB_BOTH_ENDIAN is not set +# CONFIG_FB_BROADSHEET is not set +# CONFIG_FB_CARMINE is not set +# CONFIG_FB_CFB_COPYAREA is not set +# CONFIG_FB_CFB_FILLRECT is not set +# CONFIG_FB_CFB_IMAGEBLIT is not set +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set +# CONFIG_FB_CIRRUS is not set +# CONFIG_FB_CYBER2000 is not set +# CONFIG_FB_DA8XX is not set +# CONFIG_FB_DDC is not set +# CONFIG_FB_FOREIGN_ENDIAN is not set +# CONFIG_FB_GEODE is not set +# CONFIG_FB_GOLDFISH is not set +# CONFIG_FB_HGA is not set +# CONFIG_FB_I740 is not set +# CONFIG_FB_IBM_GXT4500 is not set +# CONFIG_FB_IMSTT is not set +# CONFIG_FB_IMX is not set +# CONFIG_FB_KYRO is not set +# CONFIG_FB_LE80578 is not set +# CONFIG_FB_LITTLE_ENDIAN is not set +# CONFIG_FB_MACMODES is not set +# CONFIG_FB_MATROX is not set +# CONFIG_FB_MB862XX is not set +# CONFIG_FB_METRONOME is not set +# CONFIG_FB_MODE_HELPERS is not set +# CONFIG_FB_MXS is not set +# CONFIG_FB_N411 is not set +# CONFIG_FB_NEOMAGIC is not set +CONFIG_FB_NOTIFY=y +# CONFIG_FB_NVIDIA is not set +# CONFIG_FB_OF is not set +# CONFIG_FB_OMAP2 is not set +# CONFIG_FB_OPENCORES is not set +# CONFIG_FB_PM2 is not set +# CONFIG_FB_PM3 is not set +# CONFIG_FB_PS3 is not set +# CONFIG_FB_PXA is not set +# CONFIG_FB_RADEON is not set +# CONFIG_FB_RIVA is not set +# CONFIG_FB_S1D13XXX is not set +# CONFIG_FB_S3 is not set +# CONFIG_FB_SAVAGE is not set +# CONFIG_FB_SIMPLE is not set +# CONFIG_FB_SIS is not set +# CONFIG_FB_SM712 is not set +# CONFIG_FB_SM750 is not set +# CONFIG_FB_SMSCUFX is not set +# CONFIG_FB_SSD1307 is not set +# CONFIG_FB_SVGALIB is not set +# CONFIG_FB_SYS_COPYAREA is not set +# CONFIG_FB_SYS_FILLRECT is not set +# CONFIG_FB_SYS_FOPS is not set +# CONFIG_FB_SYS_IMAGEBLIT is not set +# CONFIG_FB_TFT is not set +# CONFIG_FB_TILEBLITTING is not set +# CONFIG_FB_TMIO is not set +# CONFIG_FB_TRIDENT is not set +# CONFIG_FB_UDL is not set +# CONFIG_FB_UVESA is not set +# CONFIG_FB_VGA16 is not set +# CONFIG_FB_VIA is not set +# CONFIG_FB_VIRTUAL is not set +# CONFIG_FB_VOODOO1 is not set +# CONFIG_FB_VT8623 is not set +# CONFIG_FB_XGI is not set +# CONFIG_FCOE is not set +# CONFIG_FCOE_FNIC is not set +# CONFIG_FDDI is not set +# CONFIG_FEALNX is not set +# CONFIG_FENCE_TRACE is not set +# CONFIG_FHANDLE is not set +CONFIG_FIB_RULES=y +CONFIG_FILE_LOCKING=y +# CONFIG_FIREWIRE is not set +# CONFIG_FIREWIRE_NOSY is not set +# CONFIG_FIREWIRE_SERIAL is not set +# CONFIG_FIRMWARE_EDID is not set +# CONFIG_FIRMWARE_IN_KERNEL is not set +# CONFIG_FIRMWARE_MEMMAP is not set +# CONFIG_FIXED_PHY is not set +CONFIG_FLATMEM=y +CONFIG_FLATMEM_MANUAL=y +CONFIG_FLAT_NODE_MEM_MAP=y +# CONFIG_FM10K is not set +# CONFIG_FMC is not set +# CONFIG_FORCEDETH is not set +CONFIG_FORCE_MAX_ZONEORDER=11 +CONFIG_FORTIFY_SOURCE=y +# CONFIG_FPGA is not set +# CONFIG_FRAMEBUFFER_CONSOLE is not set +# CONFIG_FRAME_POINTER is not set +CONFIG_FRAME_WARN=1024 +# CONFIG_FREEZER is not set +# CONFIG_FRONTSWAP is not set +# CONFIG_FSCACHE is not set +# CONFIG_FSI is not set +# CONFIG_FSL_EDMA is not set +# CONFIG_FSL_ERRATUM_A008585 is not set +# CONFIG_FSL_MC_BUS is not set +# CONFIG_FSL_PQ_MDIO is not set +# CONFIG_FSL_XGMAC_MDIO is not set +CONFIG_FSNOTIFY=y +# CONFIG_FS_DAX is not set +# CONFIG_FS_ENCRYPTION is not set +# CONFIG_FS_POSIX_ACL is not set +# CONFIG_FTGMAC100 is not set +# CONFIG_FTL is not set +# CONFIG_FTMAC100 is not set +# CONFIG_FTRACE is not set +# CONFIG_FTRACE_STARTUP_TEST is not set +# CONFIG_FTR_FIXUP_SELFTEST is not set +# CONFIG_FUJITSU_ES is not set +# CONFIG_FUJITSU_LAPTOP is not set +# CONFIG_FUJITSU_TABLET is not set +# CONFIG_FUNCTION_TRACER is not set +# CONFIG_FUSE_FS is not set +# CONFIG_FUSION is not set +# CONFIG_FUSION_FC is not set +# CONFIG_FUSION_SAS is not set +# CONFIG_FUSION_SPI is not set +CONFIG_FUTEX=y +# CONFIG_FW_CFG_SYSFS is not set +CONFIG_FW_LOADER=y +CONFIG_FW_LOADER_USER_HELPER=y +CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y +CONFIG_GACT_PROB=y +# CONFIG_GADGET_UAC1 is not set +# CONFIG_GAMEPORT is not set +# CONFIG_GATEWORKS_GW16083 is not set +# CONFIG_GCC_PLUGINS is not set +# CONFIG_GCOV is not set +# CONFIG_GCOV_KERNEL is not set +# CONFIG_GDB_SCRIPTS is not set +# CONFIG_GENERIC_ADC_BATTERY is not set +# CONFIG_GENERIC_ADC_THERMAL is not set +CONFIG_GENERIC_CALIBRATE_DELAY=y +# CONFIG_GENERIC_CPU_DEVICES is not set +CONFIG_GENERIC_HWEIGHT=y +# CONFIG_GENERIC_IRQ_DEBUGFS is not set +CONFIG_GENERIC_IRQ_PROBE=y +CONFIG_GENERIC_NET_UTILS=y +# CONFIG_GENERIC_PHY is not set +# CONFIG_GENEVE is not set +# CONFIG_GENWQE is not set +# CONFIG_GFS2_FS is not set +# CONFIG_GIGASET_CAPI is not set +# CONFIG_GIGASET_DEBUG is not set +# CONFIG_GIGASET_DUMMYLL is not set +# CONFIG_GLOB_SELFTEST is not set +# CONFIG_GOLDFISH is not set +# CONFIG_GOOGLE_FIRMWARE is not set +# CONFIG_GP2AP020A00F is not set +# CONFIG_GPIOLIB is not set +# CONFIG_GPIO_74X164 is not set +# CONFIG_GPIO_74XX_MMIO is not set +# CONFIG_GPIO_ADNP is not set +# CONFIG_GPIO_ADP5588 is not set +# CONFIG_GPIO_ALTERA is not set +# CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_BCM_KONA is not set +# CONFIG_GPIO_BT8XX is not set +# CONFIG_GPIO_CS5535 is not set +# CONFIG_GPIO_DWAPB is not set +# CONFIG_GPIO_EM is not set +# CONFIG_GPIO_EXAR is not set +# CONFIG_GPIO_F7188X is not set +# CONFIG_GPIO_FTGPIO010 is not set +# CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_GPIO_MM is not set +# CONFIG_GPIO_GRGPIO is not set +# CONFIG_GPIO_ICH is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set +# CONFIG_GPIO_MAX7300 is not set +# CONFIG_GPIO_MAX7301 is not set +# CONFIG_GPIO_MAX732X is not set +# CONFIG_GPIO_MC33880 is not set +# CONFIG_GPIO_MCP23S08 is not set +# CONFIG_GPIO_ML_IOH is not set +# CONFIG_GPIO_MOCKUP is not set +# CONFIG_GPIO_MPC8XXX is not set +# CONFIG_GPIO_PCA953X is not set +# CONFIG_GPIO_PCF857X is not set +# CONFIG_GPIO_PCH is not set +# CONFIG_GPIO_PCI_IDIO_16 is not set +# CONFIG_GPIO_PISOSR is not set +# CONFIG_GPIO_PL061 is not set +# CONFIG_GPIO_RCAR is not set +# CONFIG_GPIO_RDC321X is not set +# CONFIG_GPIO_SCH is not set +# CONFIG_GPIO_SCH311X is not set +# CONFIG_GPIO_SX150X is not set +# CONFIG_GPIO_SYSCON is not set +# CONFIG_GPIO_SYSFS is not set +# CONFIG_GPIO_TPIC2810 is not set +# CONFIG_GPIO_TS4900 is not set +# CONFIG_GPIO_TS5500 is not set +# CONFIG_GPIO_VX855 is not set +# CONFIG_GPIO_WATCHDOG is not set +# CONFIG_GPIO_WS16C48 is not set +# CONFIG_GPIO_XGENE is not set +# CONFIG_GPIO_XILINX is not set +# CONFIG_GPIO_XRA1403 is not set +# CONFIG_GPIO_ZEVIO is not set +# CONFIG_GPIO_ZX is not set +# CONFIG_GREENASIA_FF is not set +# CONFIG_GREYBUS is not set +# CONFIG_GS_FPGABOOT is not set +# CONFIG_GTP is not set +# CONFIG_HAMACHI is not set +# CONFIG_HAMRADIO is not set +# CONFIG_HAPPYMEAL is not set +# CONFIG_HARDENED_USERCOPY is not set +# CONFIG_HARDLOCKUP_DETECTOR is not set +# CONFIG_HAVE_AOUT is not set +CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y +# CONFIG_HAVE_ARCH_HASH is not set +CONFIG_HAVE_ARCH_MMAP_RND_BITS=y +# CONFIG_HAVE_ARCH_VMAP_STACK is not set +CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES=y +# CONFIG_HAVE_ARM_ARCH_TIMER is not set +CONFIG_HAVE_EXIT_THREAD=y +CONFIG_HAVE_GCC_PLUGINS=y +CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y +CONFIG_HAVE_KERNEL_BZIP2=y +CONFIG_HAVE_KERNEL_CAT=y +CONFIG_HAVE_KERNEL_GZIP=y +CONFIG_HAVE_KERNEL_LZ4=y +CONFIG_HAVE_KERNEL_LZMA=y +CONFIG_HAVE_KERNEL_LZO=y +CONFIG_HAVE_KERNEL_XZ=y +CONFIG_HAVE_KPROBES=y +CONFIG_HAVE_KRETPROBES=y +CONFIG_HAVE_NMI=y +# CONFIG_HCALL_STATS is not set +# CONFIG_HDC100X is not set +# CONFIG_HDLC is not set +# CONFIG_HDLC_CISCO is not set +# CONFIG_HDLC_FR is not set +# CONFIG_HDLC_PPP is not set +# CONFIG_HDLC_RAW is not set +# CONFIG_HDLC_RAW_ETH is not set +# CONFIG_HDMI_LPE_AUDIO is not set +# CONFIG_HDQ_MASTER_OMAP is not set +# CONFIG_HEADERS_CHECK is not set +# CONFIG_HERMES is not set +# CONFIG_HFSPLUS_FS is not set +# CONFIG_HFSPLUS_FS_POSIX_ACL is not set +# CONFIG_HFS_FS is not set +# CONFIG_HFS_FS_POSIX_ACL is not set +# CONFIG_HI8435 is not set +# CONFIG_HIBERNATION is not set +# CONFIG_HID is not set +# CONFIG_HIDRAW is not set +# CONFIG_HID_A4TECH is not set +# CONFIG_HID_ACCUTOUCH is not set +# CONFIG_HID_ACRUX is not set +# CONFIG_HID_ACRUX_FF is not set +# CONFIG_HID_ALPS is not set +# CONFIG_HID_APPLE is not set +# CONFIG_HID_APPLEIR is not set +# CONFIG_HID_ASUS is not set +# CONFIG_HID_AUREAL is not set +# CONFIG_HID_BATTERY_STRENGTH is not set +# CONFIG_HID_BELKIN is not set +# CONFIG_HID_BETOP_FF is not set +# CONFIG_HID_CHERRY is not set +# CONFIG_HID_CHICONY is not set +# CONFIG_HID_CMEDIA is not set +# CONFIG_HID_CORSAIR is not set +# CONFIG_HID_CP2112 is not set +# CONFIG_HID_CYPRESS is not set +# CONFIG_HID_DRAGONRISE is not set +# CONFIG_HID_ELECOM is not set +# CONFIG_HID_ELO is not set +# CONFIG_HID_EMS_FF is not set +# CONFIG_HID_EZKEY is not set +# CONFIG_HID_GEMBIRD is not set +# CONFIG_HID_GENERIC is not set +# CONFIG_HID_GFRM is not set +# CONFIG_HID_GREENASIA is not set +# CONFIG_HID_GT683R is not set +# CONFIG_HID_GYRATION is not set +# CONFIG_HID_HOLTEK is not set +# CONFIG_HID_ICADE is not set +# CONFIG_HID_ITE is not set +# CONFIG_HID_KENSINGTON is not set +# CONFIG_HID_KEYTOUCH is not set +# CONFIG_HID_KYE is not set +# CONFIG_HID_LCPOWER is not set +# CONFIG_HID_LED is not set +# CONFIG_HID_LENOVO is not set +# CONFIG_HID_LOGITECH is not set +# CONFIG_HID_LOGITECH_DJ is not set +# CONFIG_HID_LOGITECH_HIDPP is not set +# CONFIG_HID_MAGICMOUSE is not set +# CONFIG_HID_MAYFLASH is not set +# CONFIG_HID_MICROSOFT is not set +# CONFIG_HID_MONTEREY is not set +# CONFIG_HID_MULTITOUCH is not set +# CONFIG_HID_NTI is not set +# CONFIG_HID_NTRIG is not set +# CONFIG_HID_ORTEK is not set +# CONFIG_HID_PANTHERLORD is not set +# CONFIG_HID_PENMOUNT is not set +# CONFIG_HID_PETALYNX is not set +# CONFIG_HID_PICOLCD is not set +# CONFIG_HID_PID is not set +# CONFIG_HID_PLANTRONICS is not set +# CONFIG_HID_PRIMAX is not set +# CONFIG_HID_PRODIKEYS is not set +# CONFIG_HID_RETRODE is not set +# CONFIG_HID_RMI is not set +# CONFIG_HID_ROCCAT is not set +# CONFIG_HID_SAITEK is not set +# CONFIG_HID_SAMSUNG is not set +# CONFIG_HID_SENSOR_HUB is not set +# CONFIG_HID_SMARTJOYPLUS is not set +# CONFIG_HID_SONY is not set +# CONFIG_HID_SPEEDLINK is not set +# CONFIG_HID_STEELSERIES is not set +# CONFIG_HID_SUNPLUS is not set +# CONFIG_HID_THINGM is not set +# CONFIG_HID_THRUSTMASTER is not set +# CONFIG_HID_TIVO is not set +# CONFIG_HID_TOPSEED is not set +# CONFIG_HID_TWINHAN is not set +# CONFIG_HID_UCLOGIC is not set +# CONFIG_HID_UDRAW_PS3 is not set +# CONFIG_HID_WACOM is not set +# CONFIG_HID_WALTOP is not set +# CONFIG_HID_WIIMOTE is not set +# CONFIG_HID_XINMO is not set +# CONFIG_HID_ZEROPLUS is not set +# CONFIG_HID_ZYDACRON is not set +# CONFIG_HIGHMEM is not set +CONFIG_HIGH_RES_TIMERS=y +# CONFIG_HINIC is not set +# CONFIG_HIP04_ETH is not set +# CONFIG_HIPPI is not set +# CONFIG_HISI_FEMAC is not set +# CONFIG_HISILICON_ERRATUM_161010101 is not set +# CONFIG_HIX5HD2_GMAC is not set +# CONFIG_HMC6352 is not set +# CONFIG_HNS is not set +# CONFIG_HNS_DSAF is not set +# CONFIG_HNS_ENET is not set +# CONFIG_HOSTAP is not set +# CONFIG_HOSTAP_CS is not set +# CONFIG_HOSTAP_PCI is not set +# CONFIG_HOSTAP_PLX is not set +# CONFIG_HOTPLUG_CPU is not set +# CONFIG_HOTPLUG_PCI is not set +# CONFIG_HP03 is not set +# CONFIG_HP100 is not set +# CONFIG_HP206C is not set +CONFIG_HPET_MMAP_DEFAULT=y +# CONFIG_HPFS_FS is not set +# CONFIG_HP_ILO is not set +# CONFIG_HP_WIRELESS is not set +# CONFIG_HSI is not set +# CONFIG_HSR is not set +# CONFIG_HTC_EGPIO is not set +# CONFIG_HTC_I2CPLD is not set +# CONFIG_HTC_PASIC3 is not set +# CONFIG_HTU21 is not set +# CONFIG_HTS221 is not set +# CONFIG_HUGETLB_PAGE is not set +# CONFIG_HVC_DCC is not set +# CONFIG_HVC_UDBG is not set +# CONFIG_HWLAT_TRACER is not set +# CONFIG_HWMON is not set +# CONFIG_HWMON_DEBUG_CHIP is not set +# CONFIG_HWMON_VID is not set +# CONFIG_HWSPINLOCK is not set +# CONFIG_HWSPINLOCK_OMAP is not set +CONFIG_HW_PERF_EVENTS=y +# CONFIG_HW_RANDOM is not set +# CONFIG_HW_RANDOM_AMD is not set +# CONFIG_HW_RANDOM_ATMEL is not set +# CONFIG_HW_RANDOM_EXYNOS is not set +# CONFIG_HW_RANDOM_GEODE is not set +# CONFIG_HW_RANDOM_INTEL is not set +# CONFIG_HW_RANDOM_IPROC_RNG200 is not set +# CONFIG_HW_RANDOM_OMAP3_ROM is not set +# CONFIG_HW_RANDOM_PPC4XX is not set +# CONFIG_HW_RANDOM_TIMERIOMEM is not set +# CONFIG_HW_RANDOM_TPM is not set +# CONFIG_HW_RANDOM_VIA is not set +# CONFIG_HW_RANDOM_VIRTIO is not set +# CONFIG_HX711 is not set +# CONFIG_HYPERV is not set +# CONFIG_HYPERV_TSCPAGE is not set +# CONFIG_HYSDN is not set +CONFIG_HZ=100 +CONFIG_HZ_100=y +# CONFIG_HZ_1000 is not set +# CONFIG_HZ_1024 is not set +# CONFIG_HZ_128 is not set +# CONFIG_HZ_200 is not set +# CONFIG_HZ_24 is not set +# CONFIG_HZ_250 is not set +# CONFIG_HZ_256 is not set +# CONFIG_HZ_300 is not set +# CONFIG_HZ_48 is not set +# CONFIG_HZ_500 is not set +# CONFIG_HZ_PERIODIC is not set +# CONFIG_I2C is not set +# CONFIG_I2C_ALGOBIT is not set +# CONFIG_I2C_ALGOPCA is not set +# CONFIG_I2C_ALGOPCF is not set +# CONFIG_I2C_ALI1535 is not set +# CONFIG_I2C_ALI1563 is not set +# CONFIG_I2C_ALI15X3 is not set +# CONFIG_I2C_AMD756 is not set +# CONFIG_I2C_AMD8111 is not set +# CONFIG_I2C_ARB_GPIO_CHALLENGE is not set +# CONFIG_I2C_AU1550 is not set +# CONFIG_I2C_BCM2835 is not set +# CONFIG_I2C_BCM_IPROC is not set +# CONFIG_I2C_CADENCE is not set +# CONFIG_I2C_CBUS_GPIO is not set +# CONFIG_I2C_CHARDEV is not set +# CONFIG_I2C_COMPAT is not set +# CONFIG_I2C_DEBUG_ALGO is not set +# CONFIG_I2C_DEBUG_BUS is not set +# CONFIG_I2C_DEBUG_CORE is not set +# CONFIG_I2C_DEMUX_PINCTRL is not set +# CONFIG_I2C_DESIGNWARE_PCI is not set +# CONFIG_I2C_DESIGNWARE_PLATFORM is not set +# CONFIG_I2C_DIOLAN_U2C is not set +# CONFIG_I2C_EG20T is not set +# CONFIG_I2C_ELEKTOR is not set +# CONFIG_I2C_EMEV2 is not set +# CONFIG_I2C_GPIO is not set +# CONFIG_I2C_HELPER_AUTO is not set +# CONFIG_I2C_HID is not set +# CONFIG_I2C_I801 is not set +# CONFIG_I2C_IBM_IIC is not set +# CONFIG_I2C_IMG is not set +# CONFIG_I2C_ISCH is not set +# CONFIG_I2C_ISMT is not set +# CONFIG_I2C_MLXCPLD is not set +# CONFIG_I2C_MPC is not set +# CONFIG_I2C_MUX is not set +# CONFIG_I2C_MUX_GPIO is not set +# CONFIG_I2C_MUX_GPMUX is not set +# CONFIG_I2C_MUX_LTC4306 is not set +# CONFIG_I2C_MUX_MLXCPLD is not set +# CONFIG_I2C_MUX_PCA9541 is not set +# CONFIG_I2C_MUX_PCA954x is not set +# CONFIG_I2C_MUX_PINCTRL is not set +# CONFIG_I2C_MUX_REG is not set +# CONFIG_I2C_MV64XXX is not set +# CONFIG_I2C_NFORCE2 is not set +# CONFIG_I2C_NOMADIK is not set +# CONFIG_I2C_OCORES is not set +# CONFIG_I2C_OCTEON is not set +# CONFIG_I2C_PARPORT is not set +# CONFIG_I2C_PARPORT_LIGHT is not set +# CONFIG_I2C_PCA_ISA is not set +# CONFIG_I2C_PCA_PLATFORM is not set +# CONFIG_I2C_PIIX4 is not set +# CONFIG_I2C_PXA_PCI is not set +# CONFIG_I2C_RCAR is not set +# CONFIG_I2C_RK3X is not set +# CONFIG_I2C_ROBOTFUZZ_OSIF is not set +# CONFIG_I2C_SCMI is not set +# CONFIG_I2C_SH_MOBILE is not set +# CONFIG_I2C_SIMTEC is not set +# CONFIG_I2C_SIS5595 is not set +# CONFIG_I2C_SIS630 is not set +# CONFIG_I2C_SIS96X is not set +# CONFIG_I2C_SLAVE is not set +# CONFIG_I2C_SMBUS is not set +# CONFIG_I2C_STUB is not set +# CONFIG_I2C_TAOS_EVM is not set +# CONFIG_I2C_THUNDERX is not set +# CONFIG_I2C_TINY_USB is not set +# CONFIG_I2C_VERSATILE is not set +# CONFIG_I2C_VIA is not set +# CONFIG_I2C_VIAPRO is not set +# CONFIG_I2C_XILINX is not set +# CONFIG_I40E is not set +# CONFIG_I40EVF is not set +# CONFIG_I6300ESB_WDT is not set +# CONFIG_I82092 is not set +# CONFIG_I82365 is not set +# CONFIG_IAQCORE is not set +# CONFIG_IBM_ASM is not set +# CONFIG_IBM_EMAC_DEBUG is not set +# CONFIG_IBM_EMAC_EMAC4 is not set +# CONFIG_IBM_EMAC_MAL_CLR_ICINTSTAT is not set +# CONFIG_IBM_EMAC_MAL_COMMON_ERR is not set +# CONFIG_IBM_EMAC_NO_FLOW_CTRL is not set +# CONFIG_IBM_EMAC_RGMII is not set +# CONFIG_IBM_EMAC_TAH is not set +# CONFIG_IBM_EMAC_ZMII is not set +# CONFIG_ICPLUS_PHY is not set +# CONFIG_ICS932S401 is not set +# CONFIG_IDE is not set +# CONFIG_IDEAPAD_LAPTOP is not set +# CONFIG_IDE_GD is not set +# CONFIG_IDE_PROC_FS is not set +# CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDLE_PAGE_TRACKING is not set +# CONFIG_IEEE802154 is not set +# CONFIG_IEEE802154_ADF7242 is not set +# CONFIG_IEEE802154_ATUSB is not set +# CONFIG_IEEE802154_CA8210 is not set +# CONFIG_IFB is not set +# CONFIG_IGB is not set +# CONFIG_IGBVF is not set +# CONFIG_IIO is not set +# CONFIG_IIO_BUFFER_CB is not set +# CONFIG_IIO_CONFIGFS is not set +CONFIG_IIO_CONSUMERS_PER_TRIGGER=2 +# CONFIG_IIO_INTERRUPT_TRIGGER is not set +# CONFIG_IIO_MUX is not set +# CONFIG_IIO_PERIODIC_RTC_TRIGGER is not set +# CONFIG_IIO_SIMPLE_DUMMY is not set +# CONFIG_IIO_SSP_SENSORHUB is not set +# CONFIG_IIO_ST_ACCEL_3AXIS is not set +# CONFIG_IIO_ST_GYRO_3AXIS is not set +# CONFIG_IIO_ST_LSM6DSX is not set +# CONFIG_IIO_ST_MAGN_3AXIS is not set +# CONFIG_IIO_ST_PRESS is not set +# CONFIG_IIO_SW_DEVICE is not set +# CONFIG_IIO_SW_TRIGGER is not set +# CONFIG_IIO_SYSFS_TRIGGER is not set +# CONFIG_IKCONFIG is not set +# CONFIG_IKCONFIG_PROC is not set +# CONFIG_IMAGE_CMDLINE_HACK is not set +# CONFIG_IMGPDC_WDT is not set +# CONFIG_IMG_MDC_DMA is not set +# CONFIG_IMX7D_ADC is not set +# CONFIG_IMX_IPUV3_CORE is not set +# CONFIG_IMX_THERMAL is not set +# CONFIG_INA2XX_ADC is not set +CONFIG_INET=y +# CONFIG_INET6_AH is not set +# CONFIG_INET6_ESP is not set +# CONFIG_INET6_IPCOMP is not set +# CONFIG_INET6_TUNNEL is not set +# CONFIG_INET6_XFRM_MODE_BEET is not set +# CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION is not set +# CONFIG_INET6_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET6_XFRM_MODE_TUNNEL is not set +# CONFIG_INET6_XFRM_TUNNEL is not set +# CONFIG_INET_AH is not set +# CONFIG_INET_DIAG is not set +# CONFIG_INET_ESP is not set +# CONFIG_INET_IPCOMP is not set +# CONFIG_INET_LRO is not set +# CONFIG_INET_TCP_DIAG is not set +# CONFIG_INET_TUNNEL is not set +# CONFIG_INET_UDP_DIAG is not set +# CONFIG_INET_XFRM_MODE_BEET is not set +# CONFIG_INET_XFRM_MODE_TRANSPORT is not set +# CONFIG_INET_XFRM_MODE_TUNNEL is not set +# CONFIG_INET_XFRM_TUNNEL is not set +# CONFIG_INFINIBAND is not set +# CONFIG_INFTL is not set +CONFIG_INIT_ENV_ARG_LIMIT=32 +# CONFIG_INLINE_READ_LOCK is not set +# CONFIG_INLINE_READ_LOCK_BH is not set +# CONFIG_INLINE_READ_LOCK_IRQ is not set +# CONFIG_INLINE_READ_LOCK_IRQSAVE is not set +# CONFIG_INLINE_READ_TRYLOCK is not set +CONFIG_INLINE_READ_UNLOCK=y +# CONFIG_INLINE_READ_UNLOCK_BH is not set +CONFIG_INLINE_READ_UNLOCK_IRQ=y +# CONFIG_INLINE_READ_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_SPIN_LOCK is not set +# CONFIG_INLINE_SPIN_LOCK_BH is not set +# CONFIG_INLINE_SPIN_LOCK_IRQ is not set +# CONFIG_INLINE_SPIN_LOCK_IRQSAVE is not set +# CONFIG_INLINE_SPIN_TRYLOCK is not set +# CONFIG_INLINE_SPIN_TRYLOCK_BH is not set +# CONFIG_INLINE_SPIN_UNLOCK_BH is not set +CONFIG_INLINE_SPIN_UNLOCK_IRQ=y +# CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE is not set +# CONFIG_INLINE_WRITE_LOCK is not set +# CONFIG_INLINE_WRITE_LOCK_BH is not set +# CONFIG_INLINE_WRITE_LOCK_IRQ is not set +# CONFIG_INLINE_WRITE_LOCK_IRQSAVE is not set +# CONFIG_INLINE_WRITE_TRYLOCK is not set +CONFIG_INLINE_WRITE_UNLOCK=y +# CONFIG_INLINE_WRITE_UNLOCK_BH is not set +CONFIG_INLINE_WRITE_UNLOCK_IRQ=y +# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set +CONFIG_INOTIFY_USER=y +# CONFIG_INPUT is not set +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_APANEL is not set +# CONFIG_INPUT_ATI_REMOTE2 is not set +# CONFIG_INPUT_ATLAS_BTNS is not set +# CONFIG_INPUT_ATMEL_CAPTOUCH is not set +# CONFIG_INPUT_BMA150 is not set +# CONFIG_INPUT_CM109 is not set +# CONFIG_INPUT_CMA3000 is not set +# CONFIG_INPUT_DRV260X_HAPTICS is not set +# CONFIG_INPUT_DRV2665_HAPTICS is not set +# CONFIG_INPUT_DRV2667_HAPTICS is not set +# CONFIG_INPUT_E3X0_BUTTON is not set +# CONFIG_INPUT_EVBUG is not set +# CONFIG_INPUT_EVDEV is not set +# CONFIG_INPUT_FF_MEMLESS is not set +# CONFIG_INPUT_GP2A is not set +# CONFIG_INPUT_GPIO_BEEPER is not set +# CONFIG_INPUT_GPIO_DECODER is not set +# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set +# CONFIG_INPUT_GPIO_TILT_POLLED is not set +# CONFIG_INPUT_IDEAPAD_SLIDEBAR is not set +# CONFIG_INPUT_IMS_PCU is not set +# CONFIG_INPUT_JOYDEV is not set +# CONFIG_INPUT_JOYSTICK is not set +# CONFIG_INPUT_KEYBOARD is not set +# CONFIG_INPUT_KEYSPAN_REMOTE is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_LEDS is not set +# CONFIG_INPUT_MATRIXKMAP is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_MOUSE is not set +# CONFIG_INPUT_MOUSEDEV is not set +# CONFIG_INPUT_MPU3050 is not set +# CONFIG_INPUT_PALMAS_PWRBUTTON is not set +# CONFIG_INPUT_PCF8574 is not set +# CONFIG_INPUT_PCSPKR is not set +# CONFIG_INPUT_POLLDEV is not set +# CONFIG_INPUT_POWERMATE is not set +# CONFIG_INPUT_PWM_BEEPER is not set +# CONFIG_INPUT_PWM_VIBRA is not set +# CONFIG_INPUT_REGULATOR_HAPTIC is not set +# CONFIG_INPUT_SOC_BUTTON_ARRAY is not set +# CONFIG_INPUT_SPARSEKMAP is not set +# CONFIG_INPUT_TABLET is not set +# CONFIG_INPUT_TOUCHSCREEN is not set +# CONFIG_INPUT_TPS65218_PWRBUTTON is not set +# CONFIG_INPUT_TWL4030_PWRBUTTON is not set +# CONFIG_INPUT_TWL4030_VIBRA is not set +# CONFIG_INPUT_TWL6040_VIBRA is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_WISTRON_BTNS is not set +# CONFIG_INPUT_YEALINK is not set +# CONFIG_INT340X_THERMAL is not set +# CONFIG_INTEL_CHT_INT33FE is not set +# CONFIG_INTEL_HID_EVENT is not set +# CONFIG_INTEL_IDLE is not set +# CONFIG_INTEL_IDMA64 is not set +# CONFIG_INTEL_IOATDMA is not set +# CONFIG_INTEL_ISH_HID is not set +# CONFIG_INTEL_MEI is not set +# CONFIG_INTEL_MEI_ME is not set +# CONFIG_INTEL_MEI_TXE is not set +# CONFIG_INTEL_MIC_CARD is not set +# CONFIG_INTEL_MIC_HOST is not set +# CONFIG_INTEL_MID_PTI is not set +# CONFIG_INTEL_OAKTRAIL is not set +# CONFIG_INTEL_PMC_CORE is not set +# CONFIG_INTEL_PUNIT_IPC is not set +# CONFIG_INTEL_RST is not set +# CONFIG_INTEL_SMARTCONNECT is not set +# CONFIG_INTEL_SOC_PMIC is not set +# CONFIG_INTEL_TH is not set +# CONFIG_INTEL_VBTN is not set +# CONFIG_INTEL_XWAY_PHY is not set +# CONFIG_INTERVAL_TREE_TEST is not set +# CONFIG_INV_MPU6050_I2C is not set +# CONFIG_INV_MPU6050_IIO is not set +# CONFIG_INV_MPU6050_SPI is not set +# CONFIG_IOMMU_SUPPORT is not set +# CONFIG_IOSCHED_BFQ is not set +# CONFIG_IOSCHED_CFQ is not set +CONFIG_IOSCHED_DEADLINE=y +CONFIG_IOSCHED_NOOP=y +CONFIG_IO_STRICT_DEVMEM=y +# CONFIG_IP17XX_PHY is not set +# CONFIG_IP6_NF_FILTER is not set +# CONFIG_IP6_NF_IPTABLES is not set +# CONFIG_IP6_NF_MANGLE is not set +# CONFIG_IP6_NF_MATCH_AH is not set +# CONFIG_IP6_NF_MATCH_EUI64 is not set +# CONFIG_IP6_NF_MATCH_FRAG is not set +# CONFIG_IP6_NF_MATCH_HL is not set +# CONFIG_IP6_NF_MATCH_IPV6HEADER is not set +# CONFIG_IP6_NF_MATCH_MH is not set +# CONFIG_IP6_NF_MATCH_OPTS is not set +# CONFIG_IP6_NF_MATCH_RPFILTER is not set +# CONFIG_IP6_NF_MATCH_RT is not set +# CONFIG_IP6_NF_NAT is not set +# CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set +# CONFIG_IP6_NF_TARGET_HL is not set +# CONFIG_IP6_NF_TARGET_REJECT is not set +# CONFIG_IP6_NF_TARGET_SYNPROXY is not set +# CONFIG_IPACK_BUS is not set +# CONFIG_IPC_NS is not set +# CONFIG_IPMI_HANDLER is not set +# CONFIG_IPV6 is not set +# CONFIG_IPV6_FOU is not set +# CONFIG_IPV6_FOU_TUNNEL is not set +# CONFIG_IPV6_ILA is not set +# CONFIG_IPV6_MIP6 is not set +# CONFIG_IPV6_MROUTE is not set +# CONFIG_IPV6_MROUTE_MULTIPLE_TABLES is not set +# CONFIG_IPV6_MULTIPLE_TABLES is not set +CONFIG_IPV6_NDISC_NODETYPE=y +# CONFIG_IPV6_OPTIMISTIC_DAD is not set +# CONFIG_IPV6_ROUTER_PREF is not set +# CONFIG_IPV6_ROUTE_INFO is not set +# CONFIG_IPV6_SEG6_HMAC is not set +# CONFIG_IPV6_SEG6_LWTUNNEL is not set +# CONFIG_IPV6_SIT is not set +# CONFIG_IPV6_SIT_6RD is not set +# CONFIG_IPV6_TUNNEL is not set +# CONFIG_IPV6_VTI is not set +# CONFIG_IPVLAN is not set +# CONFIG_IPW2100 is not set +# CONFIG_IPW2100_DEBUG is not set +CONFIG_IPW2100_MONITOR=y +# CONFIG_IPW2200 is not set +# CONFIG_IPW2200_DEBUG is not set +CONFIG_IPW2200_MONITOR=y +# CONFIG_IPW2200_PROMISCUOUS is not set +# CONFIG_IPW2200_QOS is not set +# CONFIG_IPW2200_RADIOTAP is not set +# CONFIG_IPWIRELESS is not set +# CONFIG_IPX is not set +CONFIG_IP_ADVANCED_ROUTER=y +# CONFIG_IP_DCCP is not set +# CONFIG_IP_FIB_TRIE_STATS is not set +CONFIG_IP_MROUTE=y +CONFIG_IP_MROUTE_MULTIPLE_TABLES=y +CONFIG_IP_MULTICAST=y +CONFIG_IP_MULTIPLE_TABLES=y +# CONFIG_IP_NF_ARPFILTER is not set +# CONFIG_IP_NF_ARPTABLES is not set +# CONFIG_IP_NF_ARP_MANGLE is not set +# CONFIG_IP_NF_FILTER is not set +# CONFIG_IP_NF_IPTABLES is not set +# CONFIG_IP_NF_MANGLE is not set +# CONFIG_IP_NF_MATCH_AH is not set +# CONFIG_IP_NF_MATCH_ECN is not set +# CONFIG_IP_NF_MATCH_RPFILTER is not set +# CONFIG_IP_NF_MATCH_TTL is not set +# CONFIG_IP_NF_RAW is not set +# CONFIG_IP_NF_SECURITY is not set +# CONFIG_IP_NF_TARGET_CLUSTERIP is not set +# CONFIG_IP_NF_TARGET_ECN is not set +# CONFIG_IP_NF_TARGET_MASQUERADE is not set +# CONFIG_IP_NF_TARGET_NETMAP is not set +# CONFIG_IP_NF_TARGET_REDIRECT is not set +# CONFIG_IP_NF_TARGET_REJECT is not set +# CONFIG_IP_NF_TARGET_SYNPROXY is not set +# CONFIG_IP_NF_TARGET_TTL is not set +# CONFIG_IP_PIMSM_V1 is not set +# CONFIG_IP_PIMSM_V2 is not set +# CONFIG_IP_PNP is not set +CONFIG_IP_ROUTE_MULTIPATH=y +CONFIG_IP_ROUTE_VERBOSE=y +# CONFIG_IP_SCTP is not set +# CONFIG_IP_SET is not set +# CONFIG_IP_SET_HASH_IPMAC is not set +# CONFIG_IP_VS is not set +# CONFIG_IRDA is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_IRQ_ALL_CPUS is not set +# CONFIG_IRQ_DOMAIN_DEBUG is not set +# CONFIG_IRQ_POLL is not set +# CONFIG_IRQ_TIME_ACCOUNTING is not set +# CONFIG_IR_GPIO_CIR is not set +# CONFIG_IR_HIX5HD2 is not set +# CONFIG_IR_IGORPLUGUSB is not set +# CONFIG_IR_IGUANA is not set +# CONFIG_IR_IMG is not set +# CONFIG_IR_IMON is not set +# CONFIG_IR_JVC_DECODER is not set +# CONFIG_IR_LIRC_CODEC is not set +# CONFIG_IR_MCEUSB is not set +# CONFIG_IR_NEC_DECODER is not set +# CONFIG_IR_RC5_DECODER is not set +# CONFIG_IR_RC6_DECODER is not set +# CONFIG_IR_REDRAT3 is not set +# CONFIG_IR_SONY_DECODER is not set +# CONFIG_IR_STREAMZAP is not set +# CONFIG_IR_TTUSBIR is not set +# CONFIG_ISA_BUS is not set +# CONFIG_ISA_BUS_API is not set +# CONFIG_ISCSI_BOOT_SYSFS is not set +# CONFIG_ISCSI_TCP is not set +CONFIG_ISDN=y +# CONFIG_ISDN_AUDIO is not set +# CONFIG_ISDN_CAPI is not set +# CONFIG_ISDN_CAPI_CAPIDRV is not set +# CONFIG_ISDN_DIVERSION is not set +# CONFIG_ISDN_DRV_ACT2000 is not set +# CONFIG_ISDN_DRV_GIGASET is not set +# CONFIG_ISDN_DRV_HISAX is not set +# CONFIG_ISDN_DRV_ICN is not set +# CONFIG_ISDN_DRV_LOOP is not set +# CONFIG_ISDN_DRV_PCBIT is not set +# CONFIG_ISDN_DRV_SC is not set +# CONFIG_ISDN_I4L is not set +# CONFIG_ISL29003 is not set +# CONFIG_ISL29020 is not set +# CONFIG_ISL29125 is not set +# CONFIG_ISO9660_FS is not set +# CONFIG_ISS4xx is not set +# CONFIG_ITG3200 is not set +# CONFIG_IWL3945 is not set +# CONFIG_IWLWIFI is not set +# CONFIG_IXGB is not set +# CONFIG_IXGBE is not set +# CONFIG_IXGBEVF is not set +# CONFIG_JBD2_DEBUG is not set +# CONFIG_JFFS2_CMODE_FAVOURLZO is not set +# CONFIG_JFFS2_CMODE_NONE is not set +CONFIG_JFFS2_CMODE_PRIORITY=y +# CONFIG_JFFS2_CMODE_SIZE is not set +CONFIG_JFFS2_COMPRESSION_OPTIONS=y +CONFIG_JFFS2_FS=y +CONFIG_JFFS2_FS_DEBUG=0 +# CONFIG_JFFS2_FS_POSIX_ACL is not set +# CONFIG_JFFS2_FS_SECURITY is not set +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set +CONFIG_JFFS2_FS_WRITEBUFFER=y +CONFIG_JFFS2_FS_XATTR=y +CONFIG_JFFS2_LZMA=y +# CONFIG_JFFS2_LZO is not set +CONFIG_JFFS2_RTIME=y +# CONFIG_JFFS2_RUBIN is not set +CONFIG_JFFS2_SUMMARY=y +# CONFIG_JFFS2_ZLIB is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_POSIX_ACL is not set +# CONFIG_JFS_SECURITY is not set +# CONFIG_JFS_STATISTICS is not set +# CONFIG_JME is not set +CONFIG_JOLIET=y +# CONFIG_JSA1212 is not set +# CONFIG_JUMP_LABEL is not set +# CONFIG_KALLSYMS is not set +# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set +# CONFIG_KALLSYMS_ALL is not set +CONFIG_KALLSYMS_BASE_RELATIVE=y +# CONFIG_KALLSYMS_UNCOMPRESSED is not set +# CONFIG_KARMA_PARTITION is not set +# CONFIG_KCOV is not set +# CONFIG_KERNEL_BZIP2 is not set +# CONFIG_KERNEL_CAT is not set +# CONFIG_KERNEL_GZIP is not set +# CONFIG_KERNEL_LZ4 is not set +# CONFIG_KERNEL_LZMA is not set +# CONFIG_KERNEL_LZO is not set +CONFIG_KERNEL_MODE_NEON=y +CONFIG_KERNEL_XZ=y +CONFIG_KERNFS=y +# CONFIG_KEXEC is not set +# CONFIG_KEYBOARD_ADC is not set +# CONFIG_KEYBOARD_ADP5588 is not set +# CONFIG_KEYBOARD_ADP5589 is not set +# CONFIG_KEYBOARD_ATKBD is not set +# CONFIG_KEYBOARD_BCM is not set +# CONFIG_KEYBOARD_CAP11XX is not set +# CONFIG_KEYBOARD_DLINK_DIR685 is not set +# CONFIG_KEYBOARD_GPIO is not set +# CONFIG_KEYBOARD_GPIO_POLLED is not set +# CONFIG_KEYBOARD_LKKBD is not set +# CONFIG_KEYBOARD_LM8323 is not set +# CONFIG_KEYBOARD_LM8333 is not set +# CONFIG_KEYBOARD_MATRIX is not set +# CONFIG_KEYBOARD_MAX7359 is not set +# CONFIG_KEYBOARD_MCS is not set +# CONFIG_KEYBOARD_MPR121 is not set +# CONFIG_KEYBOARD_NEWTON is not set +# CONFIG_KEYBOARD_OMAP4 is not set +# CONFIG_KEYBOARD_OPENCORES is not set +# CONFIG_KEYBOARD_PXA27x is not set +# CONFIG_KEYBOARD_QT1070 is not set +# CONFIG_KEYBOARD_QT2160 is not set +# CONFIG_KEYBOARD_SAMSUNG is not set +# CONFIG_KEYBOARD_SH_KEYSC is not set +# CONFIG_KEYBOARD_SNVS_PWRKEY is not set +# CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_SUNKBD is not set +# CONFIG_KEYBOARD_TCA6416 is not set +# CONFIG_KEYBOARD_TCA8418 is not set +# CONFIG_KEYBOARD_TM2_TOUCHKEY is not set +# CONFIG_KEYBOARD_TWL4030 is not set +# CONFIG_KEYBOARD_XTKBD is not set +# CONFIG_KEYS is not set +# CONFIG_KEY_DH_OPERATIONS is not set +# CONFIG_KGDB is not set +# CONFIG_KMEMCHECK is not set +# CONFIG_KMX61 is not set +# CONFIG_KPROBES is not set +# CONFIG_KPROBES_SANITY_TEST is not set +# CONFIG_KS7010 is not set +# CONFIG_KS8842 is not set +# CONFIG_KS8851 is not set +# CONFIG_KS8851_MLL is not set +# CONFIG_KSM is not set +# CONFIG_KSZ884X_PCI is not set +CONFIG_KUSER_HELPERS=y +# CONFIG_KVM_AMD is not set +# CONFIG_KVM_GUEST is not set +# CONFIG_KVM_INTEL is not set +# CONFIG_KXCJK1013 is not set +# CONFIG_KXSD9 is not set +# CONFIG_L2TP is not set +# CONFIG_L2TP_ETH is not set +# CONFIG_L2TP_IP is not set +# CONFIG_L2TP_V3 is not set +# CONFIG_LANMEDIA is not set +# CONFIG_LANTIQ is not set +# CONFIG_LAPB is not set +# CONFIG_LASAT is not set +# CONFIG_LATENCYTOP is not set +# CONFIG_LATTICE_ECP3_CONFIG is not set +CONFIG_LBDAF=y +# CONFIG_LCD_AMS369FG06 is not set +# CONFIG_LCD_HX8357 is not set +# CONFIG_LCD_ILI922X is not set +# CONFIG_LCD_ILI9320 is not set +# CONFIG_LCD_L4F00242T03 is not set +# CONFIG_LCD_LD9040 is not set +# CONFIG_LCD_LMS283GF05 is not set +# CONFIG_LCD_LMS501KF03 is not set +# CONFIG_LCD_LTV350QV is not set +# CONFIG_LCD_S6E63M0 is not set +# CONFIG_LCD_TDO24M is not set +# CONFIG_LCD_VGG2432A4 is not set +# CONFIG_LDM_PARTITION is not set +CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y +# CONFIG_LED_TRIGGER_PHY is not set +# CONFIG_LEDS_BCM6328 is not set +# CONFIG_LEDS_BCM6358 is not set +# CONFIG_LEDS_BD2802 is not set +# CONFIG_LEDS_BLINKM is not set +CONFIG_LEDS_BRIGHTNESS_HW_CHANGED=y +CONFIG_LEDS_CLASS=y +# CONFIG_LEDS_CLASS_FLASH is not set +# CONFIG_LEDS_DAC124S085 is not set +# CONFIG_LEDS_GPIO is not set +# CONFIG_LEDS_INTEL_SS4200 is not set +# CONFIG_LEDS_IS31FL319X is not set +# CONFIG_LEDS_IS31FL32XX is not set +# CONFIG_LEDS_LM3530 is not set +# CONFIG_LEDS_LM355x is not set +# CONFIG_LEDS_LM3642 is not set +# CONFIG_LEDS_LP3944 is not set +# CONFIG_LEDS_LP3952 is not set +# CONFIG_LEDS_LP5521 is not set +# CONFIG_LEDS_LP5523 is not set +# CONFIG_LEDS_LP5562 is not set +# CONFIG_LEDS_LP8501 is not set +# CONFIG_LEDS_LP8860 is not set +# CONFIG_LEDS_LT3593 is not set +# CONFIG_LEDS_MLXCPLD is not set +# CONFIG_LEDS_NIC78BX is not set +# CONFIG_LEDS_NS2 is not set +# CONFIG_LEDS_OT200 is not set +# CONFIG_LEDS_PCA9532 is not set +# CONFIG_LEDS_PCA955X is not set +# CONFIG_LEDS_PCA963X is not set +# CONFIG_LEDS_PWM is not set +# CONFIG_LEDS_REGULATOR is not set +# CONFIG_LEDS_SYSCON is not set +# CONFIG_LEDS_TCA6507 is not set +# CONFIG_LEDS_TLC591XX is not set +CONFIG_LEDS_TRIGGERS=y +# CONFIG_LEDS_TRIGGER_BACKLIGHT is not set +# CONFIG_LEDS_TRIGGER_CAMERA is not set +# CONFIG_LEDS_TRIGGER_CPU is not set +CONFIG_LEDS_TRIGGER_DEFAULT_ON=y +# CONFIG_LEDS_TRIGGER_DISK is not set +# CONFIG_LEDS_TRIGGER_GPIO is not set +# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set +# CONFIG_LEDS_TRIGGER_IDE_DISK is not set +# CONFIG_LEDS_TRIGGER_MTD is not set +CONFIG_LEDS_TRIGGER_NETDEV=y +# CONFIG_LEDS_TRIGGER_ONESHOT is not set +# CONFIG_LEDS_TRIGGER_PANIC is not set +CONFIG_LEDS_TRIGGER_TIMER=y +# CONFIG_LEDS_TRIGGER_TRANSIENT is not set +# CONFIG_LEDS_USER is not set +# CONFIG_LEGACY_PTYS is not set +# CONFIG_LGUEST is not set +# CONFIG_LIB80211 is not set +# CONFIG_LIB80211_CRYPT_CCMP is not set +# CONFIG_LIB80211_CRYPT_TKIP is not set +# CONFIG_LIB80211_CRYPT_WEP is not set +# CONFIG_LIB80211_DEBUG is not set +# CONFIG_LIBCRC32C is not set +# CONFIG_LIBERTAS is not set +# CONFIG_LIBERTAS_THINFIRM is not set +# CONFIG_LIBERTAS_USB is not set +# CONFIG_LIBFC is not set +# CONFIG_LIBFCOE is not set +# CONFIG_LIBIPW_DEBUG is not set +# CONFIG_LIBNVDIMM is not set +# CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_LIQUIDIO is not set +# CONFIG_LIQUIDIO_VF is not set +# CONFIG_LIRC_STAGING is not set +# CONFIG_LIS3L02DQ is not set +# CONFIG_LKDTM is not set +CONFIG_LLC=y +# CONFIG_LLC2 is not set +# CONFIG_LMP91000 is not set +# CONFIG_LNET is not set +CONFIG_LOCALVERSION="" +# CONFIG_LOCALVERSION_AUTO is not set +# CONFIG_LOCKD is not set +CONFIG_LOCKDEP_SUPPORT=y +CONFIG_LOCKD_V4=y +# CONFIG_LOCKUP_DETECTOR is not set +# CONFIG_LOCK_STAT is not set +# CONFIG_LOCK_TORTURE_TEST is not set +# CONFIG_LOGFS is not set +# CONFIG_LOGIG940_FF is not set +# CONFIG_LOGIRUMBLEPAD2_FF is not set +# CONFIG_LOGITECH_FF is not set +# CONFIG_LOGIWHEELS_FF is not set +# CONFIG_LOGO is not set +CONFIG_LOG_BUF_SHIFT=17 +CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 +# CONFIG_LOONGSON_MC146818 is not set +# CONFIG_LPC_ICH is not set +# CONFIG_LPC_SCH is not set +# CONFIG_LP_CONSOLE is not set +# CONFIG_LSI_ET1011C_PHY is not set +# CONFIG_LTC2471 is not set +# CONFIG_LTC2485 is not set +# CONFIG_LTC2497 is not set +# CONFIG_LTC2632 is not set +# CONFIG_LTE_GDM724X is not set +# CONFIG_LTPC is not set +# CONFIG_LTR501 is not set +# CONFIG_LUSTRE_FS is not set +# CONFIG_LWTUNNEL is not set +# CONFIG_LXT_PHY is not set +# CONFIG_LZ4HC_COMPRESS is not set +# CONFIG_LZ4_COMPRESS is not set +# CONFIG_LZ4_DECOMPRESS is not set +CONFIG_LZMA_COMPRESS=y +CONFIG_LZMA_DECOMPRESS=y +# CONFIG_LZO_COMPRESS is not set +# CONFIG_LZO_DECOMPRESS is not set +# CONFIG_M62332 is not set +# CONFIG_MAC80211 is not set +# CONFIG_MAC80211_MESSAGE_TRACING is not set +CONFIG_MAC80211_STA_HASH_MAX_SIZE=0 +# CONFIG_MACB is not set +# CONFIG_MACH_ASM9260 is not set +# CONFIG_MACH_DECSTATION is not set +# CONFIG_MACH_INGENIC is not set +# CONFIG_MACH_JAZZ is not set +# CONFIG_MACH_JZ4740 is not set +# CONFIG_MACH_LOONGSON32 is not set +# CONFIG_MACH_LOONGSON64 is not set +# CONFIG_MACH_PIC32 is not set +# CONFIG_MACH_PISTACHIO is not set +# CONFIG_MACH_TX39XX is not set +# CONFIG_MACH_TX49XX is not set +# CONFIG_MACH_VR41XX is not set +# CONFIG_MACH_XILFPGA is not set +# CONFIG_MACINTOSH_DRIVERS is not set +# CONFIG_MACSEC is not set +# CONFIG_MACVLAN is not set +# CONFIG_MACVTAP is not set +# CONFIG_MAC_EMUMOUSEBTN is not set +# CONFIG_MAC_PARTITION is not set +# CONFIG_MAG3110 is not set +# CONFIG_MAGIC_SYSRQ is not set +CONFIG_MAGIC_SYSRQ_DEFAULT_ENABLE=0x1 +# CONFIG_MAGIC_SYSRQ_SERIAL is not set +# CONFIG_MAILBOX is not set +# CONFIG_MANDATORY_FILE_LOCKING is not set +# CONFIG_MANGLE_BOOTARGS is not set +# CONFIG_MARVELL_10G_PHY is not set +# CONFIG_MARVELL_PHY is not set +# CONFIG_MAX1027 is not set +# CONFIG_MAX11100 is not set +# CONFIG_MAX1118 is not set +# CONFIG_MAX1363 is not set +# CONFIG_MAX30100 is not set +# CONFIG_MAX30102 is not set +# CONFIG_MAX44000 is not set +# CONFIG_MAX517 is not set +# CONFIG_MAX5481 is not set +# CONFIG_MAX5487 is not set +# CONFIG_MAX5821 is not set +# CONFIG_MAX63XX_WATCHDOG is not set +# CONFIG_MAX9611 is not set +# CONFIG_MAXIM_THERMOCOUPLE is not set +CONFIG_MAY_USE_DEVLINK=y +# CONFIG_MC3230 is not set +# CONFIG_MCB is not set +# CONFIG_MCP320X is not set +# CONFIG_MCP3422 is not set +# CONFIG_MCP4131 is not set +# CONFIG_MCP4531 is not set +# CONFIG_MCP4725 is not set +# CONFIG_MCP4922 is not set +# CONFIG_MCPM is not set +# CONFIG_MD is not set +# CONFIG_MDIO_DEVICE is not set +# CONFIG_MDIO_BCM_UNIMAC is not set +# CONFIG_MDIO_BITBANG is not set +# CONFIG_MDIO_BUS_MUX_GPIO is not set +# CONFIG_MDIO_BUS_MUX_MMIOREG is not set +# CONFIG_MDIO_HISI_FEMAC is not set +# CONFIG_MDIO_OCTEON is not set +# CONFIG_MDIO_THUNDER is not set +# CONFIG_MD_FAULTY is not set +# CONFIG_MEDIA_ANALOG_TV_SUPPORT is not set +# CONFIG_MEDIA_ATTACH is not set +# CONFIG_MEDIA_CAMERA_SUPPORT is not set +# CONFIG_MEDIA_CEC_SUPPORT is not set +# CONFIG_MEDIA_CONTROLLER is not set +# CONFIG_MEDIA_DIGITAL_TV_SUPPORT is not set +# CONFIG_MEDIA_PCI_SUPPORT is not set +# CONFIG_MEDIA_RADIO_SUPPORT is not set +# CONFIG_MEDIA_RC_SUPPORT is not set +# CONFIG_MEDIA_SDR_SUPPORT is not set +# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set +# CONFIG_MEDIA_SUPPORT is not set +# CONFIG_MEDIA_USB_SUPPORT is not set +# CONFIG_MEGARAID_LEGACY is not set +# CONFIG_MEGARAID_NEWGEN is not set +# CONFIG_MEGARAID_SAS is not set +CONFIG_MEMBARRIER=y +# CONFIG_MEMORY is not set +# CONFIG_MEMORY_FAILURE is not set +# CONFIG_MEMSTICK is not set +# CONFIG_MEMTEST is not set +# CONFIG_MEN_A21_WDT is not set +# CONFIG_MESON_SM is not set +CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4 +# CONFIG_MFD_88PM800 is not set +# CONFIG_MFD_88PM805 is not set +# CONFIG_MFD_88PM860X is not set +# CONFIG_MFD_AAT2870_CORE is not set +# CONFIG_MFD_ACT8945A is not set +# CONFIG_MFD_ARIZONA_I2C is not set +# CONFIG_MFD_ARIZONA_SPI is not set +# CONFIG_MFD_AS3711 is not set +# CONFIG_MFD_AS3722 is not set +# CONFIG_MFD_ASIC3 is not set +# CONFIG_MFD_ATMEL_FLEXCOM is not set +# CONFIG_MFD_ATMEL_HLCDC is not set +# CONFIG_MFD_AXP20X is not set +# CONFIG_MFD_AXP20X_I2C is not set +# CONFIG_MFD_BCM590XX is not set +# CONFIG_MFD_BD9571MWV is not set +# CONFIG_MFD_CORE is not set +# CONFIG_MFD_CPCAP is not set +# CONFIG_MFD_CROS_EC is not set +# CONFIG_MFD_CS5535 is not set +# CONFIG_MFD_DA9052_I2C is not set +# CONFIG_MFD_DA9052_SPI is not set +# CONFIG_MFD_DA9055 is not set +# CONFIG_MFD_DA9062 is not set +# CONFIG_MFD_DA9063 is not set +# CONFIG_MFD_DA9150 is not set +# CONFIG_MFD_DLN2 is not set +# CONFIG_MFD_EXYNOS_LPASS is not set +# CONFIG_MFD_HI6421_PMIC is not set +# CONFIG_MFD_INTEL_QUARK_I2C_GPIO is not set +# CONFIG_MFD_JANZ_CMODIO is not set +# CONFIG_MFD_KEMPLD is not set +# CONFIG_MFD_LM3533 is not set +# CONFIG_MFD_LP3943 is not set +# CONFIG_MFD_LP8788 is not set +# CONFIG_MFD_MAX14577 is not set +# CONFIG_MFD_MAX77620 is not set +# CONFIG_MFD_MAX77686 is not set +# CONFIG_MFD_MAX77693 is not set +# CONFIG_MFD_MAX77843 is not set +# CONFIG_MFD_MAX8907 is not set +# CONFIG_MFD_MAX8925 is not set +# CONFIG_MFD_MAX8997 is not set +# CONFIG_MFD_MAX8998 is not set +# CONFIG_MFD_MC13XXX is not set +# CONFIG_MFD_MC13XXX_I2C is not set +# CONFIG_MFD_MC13XXX_SPI is not set +# CONFIG_MFD_MENF21BMC is not set +# CONFIG_MFD_MT6397 is not set +# CONFIG_MFD_OMAP_USB_HOST is not set +# CONFIG_MFD_PALMAS is not set +# CONFIG_MFD_PCF50633 is not set +# CONFIG_MFD_PM8921_CORE is not set +# CONFIG_MFD_PM8XXX is not set +# CONFIG_MFD_RC5T583 is not set +# CONFIG_MFD_RDC321X is not set +# CONFIG_MFD_RETU is not set +# CONFIG_MFD_RK808 is not set +# CONFIG_MFD_RN5T618 is not set +# CONFIG_MFD_RT5033 is not set +# CONFIG_MFD_RTSX_PCI is not set +# CONFIG_MFD_RTSX_USB is not set +# CONFIG_MFD_SEC_CORE is not set +# CONFIG_MFD_SI476X_CORE is not set +# CONFIG_MFD_SKY81452 is not set +# CONFIG_MFD_SM501 is not set +# CONFIG_MFD_SMSC is not set +# CONFIG_MFD_STMPE is not set +# CONFIG_MFD_SYSCON is not set +# CONFIG_MFD_T7L66XB is not set +# CONFIG_MFD_TC3589X is not set +# CONFIG_MFD_TC6387XB is not set +# CONFIG_MFD_TC6393XB is not set +# CONFIG_MFD_TIMBERDALE is not set +# CONFIG_MFD_TI_AM335X_TSCADC is not set +# CONFIG_MFD_TI_LMU is not set +# CONFIG_MFD_TI_LP873X is not set +# CONFIG_MFD_TI_LP87565 is not set +# CONFIG_MFD_TMIO is not set +# CONFIG_MFD_TPS65086 is not set +# CONFIG_MFD_TPS65090 is not set +# CONFIG_MFD_TPS65217 is not set +# CONFIG_MFD_TPS65218 is not set +# CONFIG_MFD_TPS6586X is not set +# CONFIG_MFD_TPS65910 is not set +# CONFIG_MFD_TPS65912 is not set +# CONFIG_MFD_TPS65912_I2C is not set +# CONFIG_MFD_TPS65912_SPI is not set +# CONFIG_MFD_TPS68470 is not set +# CONFIG_MFD_TPS80031 is not set +# CONFIG_MFD_VIPERBOARD is not set +# CONFIG_MFD_VX855 is not set +# CONFIG_MFD_WL1273_CORE is not set +# CONFIG_MFD_WM831X is not set +# CONFIG_MFD_WM831X_I2C is not set +# CONFIG_MFD_WM831X_SPI is not set +# CONFIG_MFD_WM8350_I2C is not set +# CONFIG_MFD_WM8400 is not set +# CONFIG_MFD_WM8994 is not set +# CONFIG_MG_DISK is not set +# CONFIG_MICREL_KS8995MA is not set +# CONFIG_MICREL_PHY is not set +# CONFIG_MICROCHIP_KSZ is not set +# CONFIG_MICROCHIP_PHY is not set +# CONFIG_MICROSEMI_PHY is not set +# CONFIG_MIGRATION is not set +CONFIG_MII=y +# CONFIG_MIKROTIK_RB532 is not set +# CONFIG_MINIX_FS is not set +# CONFIG_MINIX_FS_NATIVE_ENDIAN is not set +# CONFIG_MINIX_SUBPARTITION is not set +# CONFIG_MIPS_ALCHEMY is not set +# CONFIG_MIPS_CDMM is not set +# CONFIG_MIPS_COBALT is not set +# CONFIG_MIPS_FPU_EMULATOR is not set +# CONFIG_MIPS_GENERIC is not set +# CONFIG_MIPS_MALTA is not set +# CONFIG_MIPS_O32_FP64_SUPPORT is not set +# CONFIG_MIPS_PARAVIRT is not set +# CONFIG_MIPS_PLATFORM_DEVICES is not set +# CONFIG_MIPS_SEAD3 is not set +CONFIG_MISC_FILESYSTEMS=y +# CONFIG_MISDN is not set +# CONFIG_MISDN_AVMFRITZ is not set +# CONFIG_MISDN_HFCPCI is not set +# CONFIG_MISDN_HFCUSB is not set +# CONFIG_MISDN_INFINEON is not set +# CONFIG_MISDN_NETJET is not set +# CONFIG_MISDN_SPEEDFAX is not set +# CONFIG_MISDN_W6692 is not set +# CONFIG_MKISS is not set +# CONFIG_MLX4_CORE is not set +# CONFIG_MLX4_EN is not set +# CONFIG_MLX5_CORE is not set +# CONFIG_MLX90614 is not set +# CONFIG_MLXFW is not set +# CONFIG_MLXSW_CORE is not set +# CONFIG_MLX_CPLD_PLATFORM is not set +# CONFIG_MLX_PLATFORM is not set +# CONFIG_MMA7455_I2C is not set +# CONFIG_MMA7455_SPI is not set +# CONFIG_MMA7660 is not set +# CONFIG_MMA8452 is not set +# CONFIG_MMA9551 is not set +# CONFIG_MMA9553 is not set +# CONFIG_MMC is not set +# CONFIG_MMC35240 is not set +# CONFIG_MMC_ARMMMCI is not set +# CONFIG_MMC_AU1X is not set +# CONFIG_MMC_BLOCK is not set +CONFIG_MMC_BLOCK_BOUNCE=y +CONFIG_MMC_BLOCK_MINORS=8 +# CONFIG_MMC_CB710 is not set +# CONFIG_MMC_DEBUG is not set +# CONFIG_MMC_DW is not set +# CONFIG_MMC_MTK is not set +# CONFIG_MMC_MVSDIO is not set +# CONFIG_MMC_S3C is not set +# CONFIG_MMC_SDHCI is not set +# CONFIG_MMC_SDHCI_ACPI is not set +# CONFIG_MMC_SDHCI_BCM_KONA is not set +# CONFIG_MMC_SDHCI_CADENCE is not set +# CONFIG_MMC_SDHCI_F_SDH30 is not set +# CONFIG_MMC_SDHCI_IPROC is not set +# CONFIG_MMC_SDHCI_MSM is not set +# CONFIG_MMC_SDHCI_OF_ARASAN is not set +# CONFIG_MMC_SDHCI_OF_AT91 is not set +# CONFIG_MMC_SDHCI_OF_ESDHC is not set +# CONFIG_MMC_SDHCI_OF_HLWD is not set +# CONFIG_MMC_SDHCI_PXAV2 is not set +# CONFIG_MMC_SDHCI_PXAV3 is not set +# CONFIG_MMC_SDHCI_XENON is not set +# CONFIG_MMC_SDRICOH_CS is not set +# CONFIG_MMC_SPI is not set +# CONFIG_MMC_TEST is not set +# CONFIG_MMC_TOSHIBA_PCI is not set +# CONFIG_MMC_USDHI6ROL0 is not set +# CONFIG_MMC_USHC is not set +# CONFIG_MMC_VIA_SDMMC is not set +# CONFIG_MMC_VUB300 is not set +# CONFIG_MMIOTRACE is not set +CONFIG_MMU=y +CONFIG_MODULES=y +# CONFIG_MODULE_COMPRESS is not set +# CONFIG_MODULE_FORCE_LOAD is not set +# CONFIG_MODULE_FORCE_UNLOAD is not set +# CONFIG_MODULE_SIG is not set +# CONFIG_MODULE_SRCVERSION_ALL is not set +CONFIG_MODULE_STRIPPED=y +CONFIG_MODULE_UNLOAD=y +# CONFIG_MODVERSIONS is not set +# CONFIG_MOST is not set +# CONFIG_MOUSE_APPLETOUCH is not set +# CONFIG_MOUSE_ELAN_I2C is not set +# CONFIG_MOUSE_GPIO is not set +# CONFIG_MOUSE_INPORT is not set +# CONFIG_MOUSE_LOGIBM is not set +# CONFIG_MOUSE_PC110PAD is not set +# CONFIG_MOUSE_PS2_FOCALTECH is not set +# CONFIG_MOUSE_PS2_SENTELIC is not set +# CONFIG_MOUSE_SYNAPTICS_I2C is not set +# CONFIG_MOUSE_SYNAPTICS_USB is not set +# CONFIG_MPL115 is not set +# CONFIG_MPL115_I2C is not set +# CONFIG_MPL115_SPI is not set +# CONFIG_MPL3115 is not set +# CONFIG_MPLS is not set +# CONFIG_MPU3050_I2C is not set +# CONFIG_MQ_IOSCHED_DEADLINE is not set +# CONFIG_MQ_IOSCHED_KYBER is not set +# CONFIG_MS5611 is not set +# CONFIG_MS5637 is not set +# CONFIG_MSDOS_FS is not set +CONFIG_MSDOS_PARTITION=y +# CONFIG_MSI_BITMAP_SELFTEST is not set +# CONFIG_MSI_LAPTOP is not set +CONFIG_MTD=y +# CONFIG_MTD_ABSENT is not set +# CONFIG_MTD_AFS_PARTS is not set +# CONFIG_MTD_AR7_PARTS is not set +CONFIG_MTD_BLKDEVS=y +CONFIG_MTD_BLOCK=y +# CONFIG_MTD_BLOCK2MTD is not set +CONFIG_MTD_CFI=y +# CONFIG_MTD_CFI_ADV_OPTIONS is not set +CONFIG_MTD_CFI_AMDSTD=y +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set +CONFIG_MTD_CFI_I1=y +CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CFI_I4 is not set +# CONFIG_MTD_CFI_I8 is not set +CONFIG_MTD_CFI_INTELEXT=y +# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set +CONFIG_MTD_CFI_NOSWAP=y +# CONFIG_MTD_CFI_STAA is not set +CONFIG_MTD_CFI_UTIL=y +# CONFIG_MTD_CMDLINE_PARTS is not set +CONFIG_MTD_COMPLEX_MAPPINGS=y +# CONFIG_MTD_DATAFLASH is not set +# CONFIG_MTD_DOCG3 is not set +CONFIG_MTD_GEN_PROBE=y +# CONFIG_MTD_GPIO_ADDR is not set +# CONFIG_MTD_INTEL_VR_NOR is not set +# CONFIG_MTD_JEDECPROBE is not set +# CONFIG_MTD_LATCH_ADDR is not set +# CONFIG_MTD_LPDDR is not set +# CONFIG_MTD_LPDDR2_NVM is not set +# CONFIG_MTD_M25P80 is not set +CONFIG_MTD_MAP_BANK_WIDTH_1=y +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set +CONFIG_MTD_MAP_BANK_WIDTH_2=y +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set +CONFIG_MTD_MAP_BANK_WIDTH_4=y +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set +# CONFIG_MTD_MCHP23K256 is not set +# CONFIG_MTD_MT81xx_NOR is not set +# CONFIG_MTD_MTDRAM is not set +# CONFIG_MTD_MYLOADER_PARTS is not set +# CONFIG_MTD_NAND is not set +# CONFIG_MTD_NAND_AMS_DELTA is not set +# CONFIG_MTD_NAND_AR934X is not set +# CONFIG_MTD_NAND_AR934X_HW_ECC is not set +# CONFIG_MTD_NAND_ATMEL is not set +# CONFIG_MTD_NAND_AU1550 is not set +# CONFIG_MTD_NAND_BCH is not set +# CONFIG_MTD_NAND_BF5XX is not set +# CONFIG_MTD_NAND_BRCMNAND is not set +# CONFIG_MTD_NAND_CAFE is not set +# CONFIG_MTD_NAND_CM_X270 is not set +# CONFIG_MTD_NAND_CS553X is not set +# CONFIG_MTD_NAND_DAVINCI is not set +# CONFIG_MTD_NAND_DENALI is not set +# CONFIG_MTD_NAND_DENALI_DT is not set +# CONFIG_MTD_NAND_DENALI_PCI is not set +CONFIG_MTD_NAND_DENALI_SCRATCH_REG_ADDR=0xff108018 +# CONFIG_MTD_NAND_DISKONCHIP is not set +# CONFIG_MTD_NAND_DOCG4 is not set +# CONFIG_MTD_NAND_ECC is not set +# CONFIG_MTD_NAND_ECC_BCH is not set +# CONFIG_MTD_NAND_ECC_SMC is not set +# CONFIG_MTD_NAND_FSL_ELBC is not set +# CONFIG_MTD_NAND_FSL_IFC is not set +# CONFIG_MTD_NAND_FSL_UPM is not set +# CONFIG_MTD_NAND_FSMC is not set +# CONFIG_MTD_NAND_GPIO is not set +# CONFIG_MTD_NAND_GPMI_NAND is not set +# CONFIG_MTD_NAND_HISI504 is not set +CONFIG_MTD_NAND_IDS=y +# CONFIG_MTD_NAND_JZ4740 is not set +# CONFIG_MTD_NAND_MPC5121_NFC is not set +# CONFIG_MTD_NAND_MTK is not set +# CONFIG_MTD_NAND_MXC is not set +# CONFIG_MTD_NAND_NANDSIM is not set +# CONFIG_MTD_NAND_NDFC is not set +# CONFIG_MTD_NAND_NUC900 is not set +# CONFIG_MTD_NAND_OMAP2 is not set +# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set +# CONFIG_MTD_NAND_ORION is not set +# CONFIG_MTD_NAND_PASEMI is not set +# CONFIG_MTD_NAND_PLATFORM is not set +# CONFIG_MTD_NAND_PXA3xx is not set +# CONFIG_MTD_NAND_RB4XX is not set +# CONFIG_MTD_NAND_RB750 is not set +# CONFIG_MTD_NAND_RICOH is not set +# CONFIG_MTD_NAND_S3C2410 is not set +# CONFIG_MTD_NAND_SHARPSL is not set +# CONFIG_MTD_NAND_SH_FLCTL is not set +# CONFIG_MTD_NAND_SOCRATES is not set +# CONFIG_MTD_NAND_TMIO is not set +# CONFIG_MTD_NAND_TXX9NDFMC is not set +CONFIG_MTD_OF_PARTS=y +# CONFIG_MTD_ONENAND is not set +# CONFIG_MTD_OOPS is not set +# CONFIG_MTD_OTP is not set +# CONFIG_MTD_PARTITIONED_MASTER is not set +# CONFIG_MTD_PCI is not set +# CONFIG_MTD_PCMCIA is not set +# CONFIG_MTD_PHRAM is not set +# CONFIG_MTD_PHYSMAP is not set +# CONFIG_MTD_PHYSMAP_COMPAT is not set +CONFIG_MTD_PHYSMAP_OF=y +# CONFIG_MTD_PHYSMAP_OF_GEMINI is not set +# CONFIG_MTD_PHYSMAP_OF_VERSATILE is not set +# CONFIG_MTD_PLATRAM is not set +# CONFIG_MTD_PMC551 is not set +# CONFIG_MTD_RAM is not set +CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK=-1 +# CONFIG_MTD_REDBOOT_PARTS is not set +# CONFIG_MTD_REDBOOT_PARTS_READONLY is not set +# CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED is not set +# CONFIG_MTD_ROM is not set +CONFIG_MTD_ROOTFS_ROOT_DEV=y +# CONFIG_MTD_SLRAM is not set +# CONFIG_MTD_SM_COMMON is not set +# CONFIG_MTD_SPINAND_MT29F is not set +# CONFIG_MTD_SPI_NOR is not set +# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 +CONFIG_MTD_SPLIT=y +# CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set +# CONFIG_MTD_SPLIT_EVA_FW is not set +# CONFIG_MTD_SPLIT_FIRMWARE is not set +CONFIG_MTD_SPLIT_FIRMWARE_NAME="firmware" +# CONFIG_MTD_SPLIT_FIT_FW is not set +# CONFIG_MTD_SPLIT_LZMA_FW is not set +# CONFIG_MTD_SPLIT_MINOR_FW is not set +# CONFIG_MTD_SPLIT_SEAMA_FW is not set +CONFIG_MTD_SPLIT_SQUASHFS_ROOT=y +CONFIG_MTD_SPLIT_SUPPORT=y +# CONFIG_MTD_SPLIT_TPLINK_FW is not set +# CONFIG_MTD_SPLIT_TRX_FW is not set +# CONFIG_MTD_SPLIT_UIMAGE_FW is not set +# CONFIG_MTD_SPLIT_WRGG_FW is not set +# CONFIG_MTD_SST25L is not set +# CONFIG_MTD_SWAP is not set +# CONFIG_MTD_TESTS is not set +# CONFIG_MTD_UBI is not set +# CONFIG_MTD_UIMAGE_SPLIT is not set +CONFIG_MULTIUSER=y +# CONFIG_MUTEX_SPIN_ON_OWNER is not set +# CONFIG_MV643XX_ETH is not set +# CONFIG_MVMDIO is not set +# CONFIG_MVNETA_BM is not set +# CONFIG_MVSW61XX_PHY is not set +# CONFIG_MVSWITCH_PHY is not set +# CONFIG_MV_XOR_V2 is not set +# CONFIG_MWAVE is not set +# CONFIG_MWL8K is not set +# CONFIG_MXC4005 is not set +# CONFIG_MXC6255 is not set +# CONFIG_MYRI10GE is not set +# CONFIG_NAMESPACES is not set +# CONFIG_NATIONAL_PHY is not set +# CONFIG_NATSEMI is not set +# CONFIG_NAU7802 is not set +# CONFIG_NBPFAXI_DMA is not set +# CONFIG_NCP_FS is not set +# CONFIG_NE2000 is not set +# CONFIG_NE2K_PCI is not set +# CONFIG_NEC_MARKEINS is not set +CONFIG_NET=y +# CONFIG_NETCONSOLE is not set +CONFIG_NETDEVICES=y +# CONFIG_NETFILTER is not set +# CONFIG_NETFILTER_ADVANCED is not set +# CONFIG_NETFILTER_DEBUG is not set +# CONFIG_NETFILTER_INGRESS is not set +# CONFIG_NETFILTER_NETLINK is not set +# CONFIG_NETFILTER_NETLINK_ACCT is not set +# CONFIG_NETFILTER_NETLINK_GLUE_CT is not set +# CONFIG_NETFILTER_NETLINK_LOG is not set +# CONFIG_NETFILTER_NETLINK_QUEUE is not set +# CONFIG_NETFILTER_XTABLES is not set +# CONFIG_NETFILTER_XT_CONNMARK is not set +# CONFIG_NETFILTER_XT_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_ADDRTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_BPF is not set +# CONFIG_NETFILTER_XT_MATCH_CGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_CLUSTER is not set +# CONFIG_NETFILTER_XT_MATCH_COMMENT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNBYTES is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLABEL is not set +# CONFIG_NETFILTER_XT_MATCH_CONNLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_CONNMARK is not set +# CONFIG_NETFILTER_XT_MATCH_CONNTRACK is not set +# CONFIG_NETFILTER_XT_MATCH_CPU is not set +# CONFIG_NETFILTER_XT_MATCH_DCCP is not set +# CONFIG_NETFILTER_XT_MATCH_DEVGROUP is not set +# CONFIG_NETFILTER_XT_MATCH_DSCP is not set +# CONFIG_NETFILTER_XT_MATCH_ECN is not set +# CONFIG_NETFILTER_XT_MATCH_ESP is not set +# CONFIG_NETFILTER_XT_MATCH_HASHLIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_HELPER is not set +# CONFIG_NETFILTER_XT_MATCH_HL is not set +# CONFIG_NETFILTER_XT_MATCH_IPCOMP is not set +# CONFIG_NETFILTER_XT_MATCH_IPRANGE is not set +# CONFIG_NETFILTER_XT_MATCH_L2TP is not set +# CONFIG_NETFILTER_XT_MATCH_LENGTH is not set +# CONFIG_NETFILTER_XT_MATCH_LIMIT is not set +# CONFIG_NETFILTER_XT_MATCH_MAC is not set +# CONFIG_NETFILTER_XT_MATCH_MARK is not set +# CONFIG_NETFILTER_XT_MATCH_MULTIPORT is not set +# CONFIG_NETFILTER_XT_MATCH_NFACCT is not set +# CONFIG_NETFILTER_XT_MATCH_OSF is not set +# CONFIG_NETFILTER_XT_MATCH_OWNER is not set +# CONFIG_NETFILTER_XT_MATCH_PHYSDEV is not set +# CONFIG_NETFILTER_XT_MATCH_PKTTYPE is not set +# CONFIG_NETFILTER_XT_MATCH_POLICY is not set +# CONFIG_NETFILTER_XT_MATCH_QUOTA is not set +# CONFIG_NETFILTER_XT_MATCH_RATEEST is not set +# CONFIG_NETFILTER_XT_MATCH_REALM is not set +# CONFIG_NETFILTER_XT_MATCH_RECENT is not set +# CONFIG_NETFILTER_XT_MATCH_SCTP is not set +# CONFIG_NETFILTER_XT_MATCH_SOCKET is not set +# CONFIG_NETFILTER_XT_MATCH_STATE is not set +# CONFIG_NETFILTER_XT_MATCH_STATISTIC is not set +# CONFIG_NETFILTER_XT_MATCH_STRING is not set +# CONFIG_NETFILTER_XT_MATCH_TCPMSS is not set +# CONFIG_NETFILTER_XT_MATCH_TIME is not set +# CONFIG_NETFILTER_XT_MATCH_U32 is not set +# CONFIG_NETFILTER_XT_TARGET_AUDIT is not set +# CONFIG_NETFILTER_XT_TARGET_CHECKSUM is not set +# CONFIG_NETFILTER_XT_TARGET_CLASSIFY is not set +# CONFIG_NETFILTER_XT_TARGET_CONNMARK is not set +# CONFIG_NETFILTER_XT_TARGET_CT is not set +# CONFIG_NETFILTER_XT_TARGET_DSCP is not set +# CONFIG_NETFILTER_XT_TARGET_HL is not set +# CONFIG_NETFILTER_XT_TARGET_HMARK is not set +# CONFIG_NETFILTER_XT_TARGET_IDLETIMER is not set +# CONFIG_NETFILTER_XT_TARGET_LED is not set +# CONFIG_NETFILTER_XT_TARGET_LOG is not set +# CONFIG_NETFILTER_XT_TARGET_MARK is not set +# CONFIG_NETFILTER_XT_TARGET_NETMAP is not set +# CONFIG_NETFILTER_XT_TARGET_NFLOG is not set +# CONFIG_NETFILTER_XT_TARGET_NFQUEUE is not set +# CONFIG_NETFILTER_XT_TARGET_NOTRACK is not set +# CONFIG_NETFILTER_XT_TARGET_RATEEST is not set +# CONFIG_NETFILTER_XT_TARGET_REDIRECT is not set +# CONFIG_NETFILTER_XT_TARGET_TCPMSS is not set +# CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP is not set +# CONFIG_NETFILTER_XT_TARGET_TEE is not set +# CONFIG_NETFILTER_XT_TARGET_TPROXY is not set +# CONFIG_NETFILTER_XT_TARGET_TRACE is not set +# CONFIG_NETLINK_DIAG is not set +# CONFIG_NETLINK_MMAP is not set +# CONFIG_NETPOLL is not set +# CONFIG_NETROM is not set +CONFIG_NETWORK_FILESYSTEMS=y +# CONFIG_NETWORK_PHY_TIMESTAMPING is not set +# CONFIG_NETWORK_SECMARK is not set +# CONFIG_NETXEN_NIC is not set +# CONFIG_NET_9P is not set +# CONFIG_NET_ACT_BPF is not set +# CONFIG_NET_ACT_CSUM is not set +# CONFIG_NET_ACT_GACT is not set +# CONFIG_NET_ACT_IFE is not set +# CONFIG_NET_ACT_IPT is not set +# CONFIG_NET_ACT_MIRRED is not set +# CONFIG_NET_ACT_NAT is not set +# CONFIG_NET_ACT_PEDIT is not set +# CONFIG_NET_ACT_POLICE is not set +# CONFIG_NET_ACT_SAMPLE is not set +# CONFIG_NET_ACT_SIMP is not set +# CONFIG_NET_ACT_SKBEDIT is not set +# CONFIG_NET_ACT_SKBMOD is not set +# CONFIG_NET_ACT_TUNNEL_KEY is not set +# CONFIG_NET_ACT_VLAN is not set +CONFIG_NET_CADENCE=y +# CONFIG_NET_CALXEDA_XGMAC is not set +CONFIG_NET_CLS=y +# CONFIG_NET_CLS_ACT is not set +# CONFIG_NET_CLS_BASIC is not set +# CONFIG_NET_CLS_BPF is not set +# CONFIG_NET_CLS_FLOW is not set +# CONFIG_NET_CLS_FLOWER is not set +# CONFIG_NET_CLS_FW is not set +CONFIG_NET_CLS_IND=y +# CONFIG_NET_CLS_MATCHALL is not set +# CONFIG_NET_CLS_ROUTE4 is not set +# CONFIG_NET_CLS_RSVP is not set +# CONFIG_NET_CLS_RSVP6 is not set +# CONFIG_NET_CLS_TCINDEX is not set +# CONFIG_NET_CLS_U32 is not set +CONFIG_NET_CORE=y +# CONFIG_NET_DEVLINK is not set +# CONFIG_NET_DROP_MONITOR is not set +# CONFIG_NET_DSA is not set +# CONFIG_NET_DSA_BCM_SF2 is not set +# CONFIG_NET_DSA_LOOP is not set +# CONFIG_NET_DSA_MT7530 is not set +# CONFIG_NET_DSA_MV88E6060 is not set +# CONFIG_NET_DSA_MV88E6123_61_65 is not set +# CONFIG_NET_DSA_MV88E6131 is not set +# CONFIG_NET_DSA_MV88E6171 is not set +# CONFIG_NET_DSA_MV88E6352 is not set +# CONFIG_NET_DSA_MV88E6XXX is not set +# CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set +# CONFIG_NET_DSA_QCA8K is not set +# CONFIG_NET_DSA_SMSC_LAN9303_MDIO is not set +# CONFIG_NET_DSA_TAG_DSA is not set +# CONFIG_NET_DSA_TAG_EDSA is not set +# CONFIG_NET_EMATCH is not set +# CONFIG_NET_EMATCH_CANID is not set +# CONFIG_NET_EMATCH_CMP is not set +# CONFIG_NET_EMATCH_META is not set +# CONFIG_NET_EMATCH_NBYTE is not set +CONFIG_NET_EMATCH_STACK=32 +# CONFIG_NET_EMATCH_TEXT is not set +# CONFIG_NET_EMATCH_U32 is not set +# CONFIG_NET_FC is not set +# CONFIG_NET_FOU is not set +# CONFIG_NET_FOU_IP_TUNNELS is not set +# CONFIG_NET_IFE is not set +# CONFIG_NET_IPGRE is not set +CONFIG_NET_IPGRE_BROADCAST=y +# CONFIG_NET_IPGRE_DEMUX is not set +# CONFIG_NET_IPIP is not set +# CONFIG_NET_IPVTI is not set +# CONFIG_NET_IP_TUNNEL is not set +# CONFIG_NET_KEY is not set +# CONFIG_NET_KEY_MIGRATE is not set +# CONFIG_NET_L3_MASTER_DEV is not set +# CONFIG_NET_MPLS_GSO is not set +# CONFIG_NET_NCSI is not set +# CONFIG_NET_NSH is not set +# CONFIG_NET_PACKET_ENGINE is not set +# CONFIG_NET_PKTGEN is not set +# CONFIG_NET_POLL_CONTROLLER is not set +# CONFIG_NET_PTP_CLASSIFY is not set +CONFIG_NET_RX_BUSY_POLL=y +# CONFIG_NET_SB1000 is not set +CONFIG_NET_SCHED=y +# CONFIG_NET_SCH_ATM is not set +# CONFIG_NET_SCH_CBQ is not set +# CONFIG_NET_SCH_CHOKE is not set +# CONFIG_NET_SCH_CODEL is not set +# CONFIG_NET_SCH_DEFAULT is not set +# CONFIG_NET_SCH_DRR is not set +# CONFIG_NET_SCH_DSMARK is not set +CONFIG_NET_SCH_FIFO=y +# CONFIG_NET_SCH_FQ is not set +CONFIG_NET_SCH_FQ_CODEL=y +# CONFIG_NET_SCH_GRED is not set +# CONFIG_NET_SCH_HFSC is not set +# CONFIG_NET_SCH_HHF is not set +# CONFIG_NET_SCH_HTB is not set +# CONFIG_NET_SCH_INGRESS is not set +# CONFIG_NET_SCH_MQPRIO is not set +# CONFIG_NET_SCH_MULTIQ is not set +# CONFIG_NET_SCH_NETEM is not set +# CONFIG_NET_SCH_PIE is not set +# CONFIG_NET_SCH_PLUG is not set +# CONFIG_NET_SCH_PRIO is not set +# CONFIG_NET_SCH_QFQ is not set +# CONFIG_NET_SCH_RED is not set +# CONFIG_NET_SCH_SFB is not set +# CONFIG_NET_SCH_SFQ is not set +# CONFIG_NET_SCH_TBF is not set +# CONFIG_NET_SCH_TEQL is not set +# CONFIG_NET_SCTPPROBE is not set +# CONFIG_NET_SWITCHDEV is not set +# CONFIG_NET_TCPPROBE is not set +# CONFIG_NET_TEAM is not set +# CONFIG_NET_TULIP is not set +# CONFIG_NET_UDP_TUNNEL is not set +CONFIG_NET_VENDOR_3COM=y +CONFIG_NET_VENDOR_8390=y +CONFIG_NET_VENDOR_ADAPTEC=y +CONFIG_NET_VENDOR_AGERE=y +CONFIG_NET_VENDOR_ALACRITECH=y +CONFIG_NET_VENDOR_ALTEON=y +CONFIG_NET_VENDOR_AMAZON=y +CONFIG_NET_VENDOR_AMD=y +CONFIG_NET_VENDOR_AQUANTIA=y +CONFIG_NET_VENDOR_ARC=y +CONFIG_NET_VENDOR_ATHEROS=y +CONFIG_NET_VENDOR_AURORA=y +CONFIG_NET_VENDOR_BROADCOM=y +CONFIG_NET_VENDOR_BROCADE=y +CONFIG_NET_VENDOR_CAVIUM=y +CONFIG_NET_VENDOR_CHELSIO=y +CONFIG_NET_VENDOR_CIRRUS=y +CONFIG_NET_VENDOR_CISCO=y +CONFIG_NET_VENDOR_DEC=y +CONFIG_NET_VENDOR_DLINK=y +CONFIG_NET_VENDOR_EMULEX=y +CONFIG_NET_VENDOR_EXAR=y +CONFIG_NET_VENDOR_EZCHIP=y +CONFIG_NET_VENDOR_FARADAY=y +CONFIG_NET_VENDOR_FREESCALE=y +CONFIG_NET_VENDOR_FUJITSU=y +CONFIG_NET_VENDOR_HISILICON=y +CONFIG_NET_VENDOR_HP=y +CONFIG_NET_VENDOR_HUAWEI=y +CONFIG_NET_VENDOR_I825XX=y +CONFIG_NET_VENDOR_IBM=y +CONFIG_NET_VENDOR_INTEL=y +CONFIG_NET_VENDOR_MARVELL=y +CONFIG_NET_VENDOR_MELLANOX=y +CONFIG_NET_VENDOR_MICREL=y +CONFIG_NET_VENDOR_MICROCHIP=y +CONFIG_NET_VENDOR_MYRI=y +CONFIG_NET_VENDOR_NATSEMI=y +CONFIG_NET_VENDOR_NETRONOME=y +CONFIG_NET_VENDOR_NVIDIA=y +CONFIG_NET_VENDOR_OKI=y +CONFIG_NET_VENDOR_QLOGIC=y +CONFIG_NET_VENDOR_QUALCOMM=y +CONFIG_NET_VENDOR_RDC=y +CONFIG_NET_VENDOR_REALTEK=y +CONFIG_NET_VENDOR_RENESAS=y +CONFIG_NET_VENDOR_ROCKER=y +CONFIG_NET_VENDOR_SAMSUNG=y +CONFIG_NET_VENDOR_SEEQ=y +CONFIG_NET_VENDOR_SILAN=y +CONFIG_NET_VENDOR_SIS=y +CONFIG_NET_VENDOR_SMSC=y +CONFIG_NET_VENDOR_SOLARFLARE=y +CONFIG_NET_VENDOR_STMICRO=y +CONFIG_NET_VENDOR_SUN=y +CONFIG_NET_VENDOR_SYNOPSYS=y +CONFIG_NET_VENDOR_TEHUTI=y +CONFIG_NET_VENDOR_TI=y +CONFIG_NET_VENDOR_TOSHIBA=y +CONFIG_NET_VENDOR_VIA=y +CONFIG_NET_VENDOR_WIZNET=y +CONFIG_NET_VENDOR_XILINX=y +CONFIG_NET_VENDOR_XIRCOM=y +# CONFIG_NET_VRF is not set +# CONFIG_NET_XGENE is not set +CONFIG_NEW_LEDS=y +# CONFIG_NFC is not set +# CONFIG_NFP is not set +# CONFIG_NFSD is not set +# CONFIG_NFSD_V2_ACL is not set +CONFIG_NFSD_V3=y +# CONFIG_NFSD_V3_ACL is not set +# CONFIG_NFSD_V4 is not set +# CONFIG_NFS_ACL_SUPPORT is not set +CONFIG_NFS_COMMON=y +# CONFIG_NFS_FS is not set +# CONFIG_NFS_FSCACHE is not set +# CONFIG_NFS_SWAP is not set +# CONFIG_NFS_V2 is not set +CONFIG_NFS_V3=y +# CONFIG_NFS_V3_ACL is not set +# CONFIG_NFS_V4 is not set +# CONFIG_NFS_V4_1 is not set +# CONFIG_NFTL is not set +# CONFIG_NFT_BRIDGE_META is not set +# CONFIG_NFT_BRIDGE_REJECT is not set +# CONFIG_NFT_DUP_IPV4 is not set +# CONFIG_NFT_DUP_IPV6 is not set +# CONFIG_NFT_FIB_IPV4 is not set +# CONFIG_NFT_FIB_IPV6 is not set +# CONFIG_NFT_OBJREF is not set +# CONFIG_NFT_RT is not set +# CONFIG_NFT_SET_BITMAP is not set +# CONFIG_NF_CONNTRACK is not set +# CONFIG_NF_CONNTRACK_AMANDA is not set +# CONFIG_NF_CONNTRACK_EVENTS is not set +# CONFIG_NF_CONNTRACK_FTP is not set +# CONFIG_NF_CONNTRACK_H323 is not set +# CONFIG_NF_CONNTRACK_IPV4 is not set +# CONFIG_NF_CONNTRACK_IPV6 is not set +# CONFIG_NF_CONNTRACK_IRC is not set +# CONFIG_NF_CONNTRACK_MARK is not set +# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set +# CONFIG_NF_CONNTRACK_PPTP is not set +CONFIG_NF_CONNTRACK_PROCFS=y +# CONFIG_NF_CONNTRACK_PROC_COMPAT is not set +# CONFIG_NF_CONNTRACK_SANE is not set +# CONFIG_NF_CONNTRACK_SIP is not set +# CONFIG_NF_CONNTRACK_SNMP is not set +# CONFIG_NF_CONNTRACK_TFTP is not set +# CONFIG_NF_CONNTRACK_TIMEOUT is not set +# CONFIG_NF_CONNTRACK_TIMESTAMP is not set +# CONFIG_NF_CONNTRACK_ZONES is not set +# CONFIG_NF_CT_NETLINK is not set +# CONFIG_NF_CT_NETLINK_TIMEOUT is not set +# CONFIG_NF_CT_PROTO_DCCP is not set +# CONFIG_NF_CT_PROTO_GRE is not set +# CONFIG_NF_CT_PROTO_SCTP is not set +# CONFIG_NF_CT_PROTO_UDPLITE is not set +# CONFIG_NF_DEFRAG_IPV4 is not set +# CONFIG_NF_DUP_IPV4 is not set +# CONFIG_NF_DUP_IPV6 is not set +# CONFIG_NF_LOG_ARP is not set +# CONFIG_NF_LOG_IPV4 is not set +# CONFIG_NF_LOG_NETDEV is not set +# CONFIG_NF_NAT is not set +# CONFIG_NF_NAT_AMANDA is not set +# CONFIG_NF_NAT_FTP is not set +# CONFIG_NF_NAT_H323 is not set +# CONFIG_NF_NAT_IPV6 is not set +# CONFIG_NF_NAT_IRC is not set +# CONFIG_NF_NAT_MASQUERADE_IPV4 is not set +# CONFIG_NF_NAT_MASQUERADE_IPV6 is not set +# CONFIG_NF_NAT_NEEDED is not set +# CONFIG_NF_NAT_PPTP is not set +# CONFIG_NF_NAT_PROTO_GRE is not set +# CONFIG_NF_NAT_SIP is not set +# CONFIG_NF_NAT_SNMP_BASIC is not set +# CONFIG_NF_NAT_TFTP is not set +# CONFIG_NF_REJECT_IPV4 is not set +# CONFIG_NF_REJECT_IPV6 is not set +# CONFIG_NF_SOCKET_IPV4 is not set +# CONFIG_NF_SOCKET_IPV6 is not set +# CONFIG_NF_TABLES is not set +# CONFIG_NF_TABLES_NETDEV is not set +# CONFIG_NI65 is not set +# CONFIG_NI903X_WDT is not set +# CONFIG_NIC7018_WDT is not set +# CONFIG_NILFS2_FS is not set +# CONFIG_NIU is not set +CONFIG_NLATTR=y +# CONFIG_NLMON is not set +# CONFIG_NLM_XLP_BOARD is not set +# CONFIG_NLM_XLR_BOARD is not set +# CONFIG_NLS is not set +# CONFIG_NLS_ASCII is not set +# CONFIG_NLS_CODEPAGE_1250 is not set +# CONFIG_NLS_CODEPAGE_1251 is not set +# CONFIG_NLS_CODEPAGE_437 is not set +# CONFIG_NLS_CODEPAGE_737 is not set +# CONFIG_NLS_CODEPAGE_775 is not set +# CONFIG_NLS_CODEPAGE_850 is not set +# CONFIG_NLS_CODEPAGE_852 is not set +# CONFIG_NLS_CODEPAGE_855 is not set +# CONFIG_NLS_CODEPAGE_857 is not set +# CONFIG_NLS_CODEPAGE_860 is not set +# CONFIG_NLS_CODEPAGE_861 is not set +# CONFIG_NLS_CODEPAGE_862 is not set +# CONFIG_NLS_CODEPAGE_863 is not set +# CONFIG_NLS_CODEPAGE_864 is not set +# CONFIG_NLS_CODEPAGE_865 is not set +# CONFIG_NLS_CODEPAGE_866 is not set +# CONFIG_NLS_CODEPAGE_869 is not set +# CONFIG_NLS_CODEPAGE_874 is not set +# CONFIG_NLS_CODEPAGE_932 is not set +# CONFIG_NLS_CODEPAGE_936 is not set +# CONFIG_NLS_CODEPAGE_949 is not set +# CONFIG_NLS_CODEPAGE_950 is not set +CONFIG_NLS_DEFAULT="iso8859-1" +# CONFIG_NLS_ISO8859_1 is not set +# CONFIG_NLS_ISO8859_13 is not set +# CONFIG_NLS_ISO8859_14 is not set +# CONFIG_NLS_ISO8859_15 is not set +# CONFIG_NLS_ISO8859_2 is not set +# CONFIG_NLS_ISO8859_3 is not set +# CONFIG_NLS_ISO8859_4 is not set +# CONFIG_NLS_ISO8859_5 is not set +# CONFIG_NLS_ISO8859_6 is not set +# CONFIG_NLS_ISO8859_7 is not set +# CONFIG_NLS_ISO8859_8 is not set +# CONFIG_NLS_ISO8859_9 is not set +# CONFIG_NLS_KOI8_R is not set +# CONFIG_NLS_KOI8_U is not set +# CONFIG_NLS_MAC_CELTIC is not set +# CONFIG_NLS_MAC_CENTEURO is not set +# CONFIG_NLS_MAC_CROATIAN is not set +# CONFIG_NLS_MAC_CYRILLIC is not set +# CONFIG_NLS_MAC_GAELIC is not set +# CONFIG_NLS_MAC_GREEK is not set +# CONFIG_NLS_MAC_ICELAND is not set +# CONFIG_NLS_MAC_INUIT is not set +# CONFIG_NLS_MAC_ROMAN is not set +# CONFIG_NLS_MAC_ROMANIAN is not set +# CONFIG_NLS_MAC_TURKISH is not set +# CONFIG_NLS_UTF8 is not set +CONFIG_NMI_LOG_BUF_SHIFT=13 +# CONFIG_NOP_USB_XCEIV is not set +# CONFIG_NORTEL_HERMES is not set +# CONFIG_NOTIFIER_ERROR_INJECTION is not set +# CONFIG_NOZOMI is not set +# CONFIG_NO_BOOTMEM is not set +# CONFIG_NO_HZ is not set +# CONFIG_NO_HZ_FULL is not set +# CONFIG_NO_HZ_IDLE is not set +# CONFIG_NS83820 is not set +# CONFIG_NTB is not set +# CONFIG_NTFS_DEBUG is not set +# CONFIG_NTFS_FS is not set +# CONFIG_NTFS_RW is not set +# CONFIG_NTP_PPS is not set +# CONFIG_NVM is not set +# CONFIG_NVMEM is not set +# CONFIG_NVMEM_IMX_OCOTP is not set +# CONFIG_NVME_FC is not set +# CONFIG_NVME_TARGET is not set +# CONFIG_NVRAM is not set +# CONFIG_NV_TCO is not set +# CONFIG_NXP_STB220 is not set +# CONFIG_NXP_STB225 is not set +# CONFIG_N_GSM is not set +# CONFIG_OABI_COMPAT is not set +# CONFIG_OBS600 is not set +# CONFIG_OCFS2_FS is not set +# CONFIG_OF_OVERLAY is not set +# CONFIG_OF_UNITTEST is not set +# CONFIG_OMAP2_DSS_DEBUG is not set +# CONFIG_OMAP2_DSS_DEBUGFS is not set +# CONFIG_OMAP2_DSS_SDI is not set +# CONFIG_OMAP_OCP2SCP is not set +# CONFIG_OMAP_USB2 is not set +# CONFIG_OMFS_FS is not set +# CONFIG_OPENVSWITCH is not set +# CONFIG_OPROFILE is not set +# CONFIG_OPROFILE_EVENT_MULTIPLEX is not set +# CONFIG_OPT3001 is not set +# CONFIG_ORANGEFS_FS is not set +# CONFIG_ORION_WATCHDOG is not set +# CONFIG_OSF_PARTITION is not set +CONFIG_OVERLAY_FS=y +# CONFIG_OVERLAY_FS_INDEX is not set +# CONFIG_OVERLAY_FS_REDIRECT_DIR is not set +# CONFIG_OWL_LOADER is not set +# CONFIG_P54_COMMON is not set +# CONFIG_PA12203001 is not set +CONFIG_PACKET=y +# CONFIG_PACKET_DIAG is not set +# CONFIG_PAGE_EXTENSION is not set +# CONFIG_PAGE_OWNER is not set +# CONFIG_PAGE_POISONING is not set +# CONFIG_PAGE_SIZE_16KB is not set +# CONFIG_PAGE_SIZE_32KB is not set +CONFIG_PAGE_SIZE_4KB=y +# CONFIG_PAGE_SIZE_64KB is not set +# CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PALMAS_GPADC is not set +# CONFIG_PANASONIC_LAPTOP is not set +# CONFIG_PANEL is not set +CONFIG_PANIC_ON_OOPS=y +CONFIG_PANIC_ON_OOPS_VALUE=1 +CONFIG_PANIC_TIMEOUT=1 +# CONFIG_PANTHERLORD_FF is not set +# CONFIG_PARAVIRT is not set +# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set +# CONFIG_PARPORT is not set +# CONFIG_PARPORT_1284 is not set +# CONFIG_PARPORT_AX88796 is not set +# CONFIG_PARPORT_GSC is not set +# CONFIG_PARPORT_PC is not set +CONFIG_PARTITION_ADVANCED=y +# CONFIG_PATA_ALI is not set +# CONFIG_PATA_AMD is not set +# CONFIG_PATA_ARASAN_CF is not set +# CONFIG_PATA_ARTOP is not set +# CONFIG_PATA_ATIIXP is not set +# CONFIG_PATA_ATP867X is not set +# CONFIG_PATA_CMD640_PCI is not set +# CONFIG_PATA_CMD64X is not set +# CONFIG_PATA_CS5520 is not set +# CONFIG_PATA_CS5530 is not set +# CONFIG_PATA_CS5535 is not set +# CONFIG_PATA_CS5536 is not set +# CONFIG_PATA_CYPRESS is not set +# CONFIG_PATA_EFAR is not set +# CONFIG_PATA_HPT366 is not set +# CONFIG_PATA_HPT37X is not set +# CONFIG_PATA_HPT3X2N is not set +# CONFIG_PATA_HPT3X3 is not set +# CONFIG_PATA_IMX is not set +# CONFIG_PATA_ISAPNP is not set +# CONFIG_PATA_IT8213 is not set +# CONFIG_PATA_IT821X is not set +# CONFIG_PATA_JMICRON is not set +# CONFIG_PATA_LEGACY is not set +# CONFIG_PATA_MARVELL is not set +# CONFIG_PATA_MPIIX is not set +# CONFIG_PATA_NETCELL is not set +# CONFIG_PATA_NINJA32 is not set +# CONFIG_PATA_NS87410 is not set +# CONFIG_PATA_NS87415 is not set +# CONFIG_PATA_OCTEON_CF is not set +# CONFIG_PATA_OF_PLATFORM is not set +# CONFIG_PATA_OLDPIIX is not set +# CONFIG_PATA_OPTI is not set +# CONFIG_PATA_OPTIDMA is not set +# CONFIG_PATA_PCMCIA is not set +# CONFIG_PATA_PDC2027X is not set +# CONFIG_PATA_PDC_OLD is not set +# CONFIG_PATA_PLATFORM is not set +# CONFIG_PATA_QDI is not set +# CONFIG_PATA_RADISYS is not set +# CONFIG_PATA_RDC is not set +# CONFIG_PATA_RZ1000 is not set +# CONFIG_PATA_SC1200 is not set +# CONFIG_PATA_SCH is not set +# CONFIG_PATA_SERVERWORKS is not set +# CONFIG_PATA_SIL680 is not set +# CONFIG_PATA_SIS is not set +# CONFIG_PATA_TOSHIBA is not set +# CONFIG_PATA_TRIFLEX is not set +# CONFIG_PATA_VIA is not set +# CONFIG_PATA_WINBOND is not set +# CONFIG_PATA_WINBOND_VLB is not set +# CONFIG_PC104 is not set +# CONFIG_PC300TOO is not set +# CONFIG_PCCARD is not set +# CONFIG_PCH_DMA is not set +# CONFIG_PCH_GBE is not set +# CONFIG_PCH_PHUB is not set +# CONFIG_PCI is not set +# CONFIG_PCI200SYN is not set +# CONFIG_PCIEAER_INJECT is not set +# CONFIG_PCIEASPM is not set +# CONFIG_PCIEPORTBUS is not set +# CONFIG_PCIE_ALTERA is not set +# CONFIG_PCIE_ARMADA_8K is not set +# CONFIG_PCIE_DPC is not set +# CONFIG_PCIE_DW_PLAT is not set +# CONFIG_PCIE_ECRC is not set +# CONFIG_PCIE_IPROC is not set +# CONFIG_PCIE_PTM is not set +# CONFIG_PCIPCWATCHDOG is not set +# CONFIG_PCI_ATMEL is not set +# CONFIG_PCI_CNB20LE_QUIRK is not set +# CONFIG_PCI_DEBUG is not set +# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set +# CONFIG_PCI_ENDPOINT is not set +# CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_PCI_HERMES is not set +# CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_IOV is not set +# CONFIG_PCI_LAYERSCAPE is not set +# CONFIG_PCI_MSI is not set +# CONFIG_PCI_PASID is not set +# CONFIG_PCI_PRI is not set +CONFIG_PCI_QUIRKS=y +# CONFIG_PCI_REALLOC_ENABLE_AUTO is not set +# CONFIG_PCI_STUB is not set +# CONFIG_PCI_SW_SWITCHTEC is not set +CONFIG_PCI_SYSCALL=y +# CONFIG_PCMCIA is not set +# CONFIG_PCMCIA_3C574 is not set +# CONFIG_PCMCIA_3C589 is not set +# CONFIG_PCMCIA_AHA152X is not set +# CONFIG_PCMCIA_ATMEL is not set +# CONFIG_PCMCIA_AXNET is not set +# CONFIG_PCMCIA_DEBUG is not set +# CONFIG_PCMCIA_FDOMAIN is not set +# CONFIG_PCMCIA_FMVJ18X is not set +# CONFIG_PCMCIA_HERMES is not set +# CONFIG_PCMCIA_LOAD_CIS is not set +# CONFIG_PCMCIA_NINJA_SCSI is not set +# CONFIG_PCMCIA_NMCLAN is not set +# CONFIG_PCMCIA_PCNET is not set +# CONFIG_PCMCIA_QLOGIC is not set +# CONFIG_PCMCIA_RAYCS is not set +# CONFIG_PCMCIA_SMC91C92 is not set +# CONFIG_PCMCIA_SPECTRUM is not set +# CONFIG_PCMCIA_SYM53C500 is not set +# CONFIG_PCMCIA_WL3501 is not set +# CONFIG_PCMCIA_XIRC2PS is not set +# CONFIG_PCMCIA_XIRCOM is not set +# CONFIG_PCNET32 is not set +# CONFIG_PCSPKR_PLATFORM is not set +# CONFIG_PD6729 is not set +# CONFIG_PDA_POWER is not set +# CONFIG_PDC_ADMA is not set +# CONFIG_PERCPU_STATS is not set +# CONFIG_PERCPU_TEST is not set +# CONFIG_PERF_EVENTS is not set +# CONFIG_PERF_EVENTS_AMD_POWER is not set +# CONFIG_PERSISTENT_KEYRINGS is not set +# CONFIG_PHANTOM is not set +# CONFIG_PHONET is not set +# CONFIG_PHYLIB is not set +# CONFIG_PHYS_ADDR_T_64BIT is not set +# CONFIG_PHY_CPCAP_USB is not set +# CONFIG_PHY_EXYNOS_DP_VIDEO is not set +# CONFIG_PHY_EXYNOS_MIPI_VIDEO is not set +# CONFIG_PHY_PXA_28NM_HSIC is not set +# CONFIG_PHY_PXA_28NM_USB2 is not set +# CONFIG_PHY_QCOM_DWC3 is not set +# CONFIG_PHY_SAMSUNG_USB2 is not set +# CONFIG_PI433 is not set +# CONFIG_PID_IN_CONTEXTIDR is not set +# CONFIG_PID_NS is not set +CONFIG_PINCONF=y +# CONFIG_PINCTRL is not set +# CONFIG_PINCTRL_AMD is not set +# CONFIG_PINCTRL_EXYNOS is not set +# CONFIG_PINCTRL_EXYNOS5440 is not set +# CONFIG_PINCTRL_MCP23S08 is not set +# CONFIG_PINCTRL_MSM8X74 is not set +CONFIG_PINCTRL_SINGLE=y +# CONFIG_PINCTRL_SX150X is not set +CONFIG_PINMUX=y +# CONFIG_PKCS7_MESSAGE_PARSER is not set +# CONFIG_PL320_MBOX is not set +# CONFIG_PL330_DMA is not set +# CONFIG_PLATFORM_MHU is not set +# CONFIG_PLAT_SPEAR is not set +# CONFIG_PLIP is not set +# CONFIG_PLX_HERMES is not set +# CONFIG_PM is not set +# CONFIG_PMBUS is not set +# CONFIG_PMC_MSP is not set +# CONFIG_PMIC_ADP5520 is not set +# CONFIG_PMIC_DA903X is not set +# CONFIG_PM_AUTOSLEEP is not set +# CONFIG_PM_DEVFREQ is not set +# CONFIG_PM_WAKELOCKS is not set +# CONFIG_POSIX_MQUEUE is not set +CONFIG_POSIX_TIMERS=y +# CONFIG_POWERCAP is not set +# CONFIG_POWER_AVS is not set +# CONFIG_POWER_RESET is not set +# CONFIG_POWER_RESET_BRCMKONA is not set +# CONFIG_POWER_RESET_BRCMSTB is not set +# CONFIG_POWER_RESET_GPIO is not set +# CONFIG_POWER_RESET_GPIO_RESTART is not set +# CONFIG_POWER_RESET_LTC2952 is not set +# CONFIG_POWER_RESET_PIIX4_POWEROFF is not set +# CONFIG_POWER_RESET_RESTART is not set +# CONFIG_POWER_RESET_SYSCON is not set +# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set +# CONFIG_POWER_RESET_VERSATILE is not set +# CONFIG_POWER_RESET_XGENE is not set +# CONFIG_POWER_SUPPLY is not set +# CONFIG_POWER_SUPPLY_DEBUG is not set +# CONFIG_PPC4xx_GPIO is not set +# CONFIG_PPC_16K_PAGES is not set +# CONFIG_PPC_256K_PAGES is not set +CONFIG_PPC_4K_PAGES=y +# CONFIG_PPC_64K_PAGES is not set +# CONFIG_PPC_DISABLE_WERROR is not set +# CONFIG_PPC_EMULATED_STATS is not set +# CONFIG_PPC_EPAPR_HV_BYTECHAN is not set +# CONFIG_PPP is not set +# CONFIG_PPPOATM is not set +# CONFIG_PPPOE is not set +# CONFIG_PPPOL2TP is not set +# CONFIG_PPP_ASYNC is not set +# CONFIG_PPP_BSDCOMP is not set +# CONFIG_PPP_DEFLATE is not set +CONFIG_PPP_FILTER=y +# CONFIG_PPP_MPPE is not set +CONFIG_PPP_MULTILINK=y +# CONFIG_PPP_SYNC_TTY is not set +# CONFIG_PPS is not set +# CONFIG_PPS_CLIENT_GPIO is not set +# CONFIG_PPS_CLIENT_KTIMER is not set +# CONFIG_PPS_CLIENT_LDISC is not set +# CONFIG_PPS_CLIENT_PARPORT is not set +# CONFIG_PPS_DEBUG is not set +# CONFIG_PPTP is not set +# CONFIG_PREEMPT is not set +CONFIG_PREEMPT_NONE=y +# CONFIG_PREEMPT_TRACER is not set +# CONFIG_PREEMPT_VOLUNTARY is not set +CONFIG_PREVENT_FIRMWARE_BUILD=y +CONFIG_PRINTK=y +CONFIG_PRINTK_NMI=y +# CONFIG_PRINTK_TIME is not set +CONFIG_PRINT_STACK_DEPTH=64 +# CONFIG_PRISM2_USB is not set +# CONFIG_PRISM54 is not set +# CONFIG_PROC_CHILDREN is not set +CONFIG_PROC_FS=y +# CONFIG_PROC_KCORE is not set +# CONFIG_PROC_PAGE_MONITOR is not set +CONFIG_PROC_STRIPPED=y +CONFIG_PROC_SYSCTL=y +# CONFIG_PROFILE_ALL_BRANCHES is not set +# CONFIG_PROFILE_ANNOTATED_BRANCHES is not set +# CONFIG_PROFILING is not set +# CONFIG_PROVE_LOCKING is not set +# CONFIG_PROVE_RCU is not set +# CONFIG_PROVE_RCU_REPEATEDLY is not set +# CONFIG_PSAMPLE is not set +# CONFIG_PSB6970_PHY is not set +# CONFIG_PSTORE is not set +# CONFIG_PTP_1588_CLOCK is not set +# CONFIG_PTP_1588_CLOCK_IXP46X is not set +# CONFIG_PTP_1588_CLOCK_KVM is not set +# CONFIG_PTP_1588_CLOCK_PCH is not set +# CONFIG_PUBLIC_KEY_ALGO_RSA is not set +# CONFIG_PWM is not set +# CONFIG_PWM_FSL_FTM is not set +# CONFIG_PWM_PCA9685 is not set +CONFIG_PWRSEQ_EMMC=y +# CONFIG_PWRSEQ_SD8787 is not set +CONFIG_PWRSEQ_SIMPLE=y +# CONFIG_QCA7000 is not set +# CONFIG_QCA7000_SPI is not set +# CONFIG_QCOM_EMAC is not set +# CONFIG_QCOM_FALKOR_ERRATUM_1003 is not set +# CONFIG_QCOM_FALKOR_ERRATUM_1009 is not set +# CONFIG_QCOM_HIDMA is not set +# CONFIG_QCOM_HIDMA_MGMT is not set +# CONFIG_QCOM_QDF2400_ERRATUM_0065 is not set +# CONFIG_QCOM_SPMI_IADC is not set +# CONFIG_QCOM_SPMI_TEMP_ALARM is not set +# CONFIG_QCOM_SPMI_VADC is not set +# CONFIG_QED is not set +# CONFIG_QLA3XXX is not set +# CONFIG_QLCNIC is not set +# CONFIG_QLGE is not set +# CONFIG_QNX4FS_FS is not set +# CONFIG_QNX6FS_FS is not set +# CONFIG_QORIQ_CPUFREQ is not set +# CONFIG_QORIQ_THERMAL is not set +# CONFIG_QSEMI_PHY is not set +# CONFIG_QUEUED_LOCK_STAT is not set +# CONFIG_QUOTA is not set +# CONFIG_QUOTACTL is not set +# CONFIG_QUOTA_DEBUG is not set +# CONFIG_R3964 is not set +# CONFIG_R6040 is not set +# CONFIG_R8169 is not set +# CONFIG_R8188EU is not set +# CONFIG_R8712U is not set +# CONFIG_R8723AU is not set +# CONFIG_RADIO_ADAPTERS is not set +# CONFIG_RADIO_AZTECH is not set +# CONFIG_RADIO_CADET is not set +# CONFIG_RADIO_GEMTEK is not set +# CONFIG_RADIO_MAXIRADIO is not set +# CONFIG_RADIO_RTRACK is not set +# CONFIG_RADIO_RTRACK2 is not set +# CONFIG_RADIO_SF16FMI is not set +# CONFIG_RADIO_SF16FMR2 is not set +# CONFIG_RADIO_TERRATEC is not set +# CONFIG_RADIO_TRUST is not set +# CONFIG_RADIO_TYPHOON is not set +# CONFIG_RADIO_ZOLTRIX is not set +# CONFIG_RAID_ATTRS is not set +# CONFIG_RALINK is not set +# CONFIG_RANDOM32_SELFTEST is not set +# CONFIG_RAPIDIO is not set +# CONFIG_RAS is not set +# CONFIG_RAW_DRIVER is not set +# CONFIG_RBTREE_TEST is not set +CONFIG_RCU_CPU_STALL_TIMEOUT=60 +# CONFIG_RCU_EQS_DEBUG is not set +# CONFIG_RCU_EXPEDITE_BOOT is not set +CONFIG_RCU_EXPERT=y +CONFIG_RCU_FANOUT=32 +CONFIG_RCU_FANOUT_LEAF=16 +# CONFIG_RCU_FAST_NO_HZ is not set +CONFIG_RCU_KTHREAD_PRIO=0 +# CONFIG_RCU_NOCB_CPU is not set +# CONFIG_RCU_PERF_TEST is not set +# CONFIG_RCU_TORTURE_TEST is not set +CONFIG_RCU_TORTURE_TEST_SLOW_INIT_DELAY=3 +# CONFIG_RCU_TRACE is not set +# CONFIG_RC_ATI_REMOTE is not set +# CONFIG_RC_CORE is not set +# CONFIG_RC_DECODERS is not set +# CONFIG_RC_LOOPBACK is not set +# CONFIG_RC_MAP is not set +# CONFIG_RDS is not set +# CONFIG_RD_BZIP2 is not set +# CONFIG_RD_GZIP is not set +# CONFIG_RD_LZ4 is not set +# CONFIG_RD_LZMA is not set +# CONFIG_RD_LZO is not set +# CONFIG_RD_XZ is not set +# CONFIG_READABLE_ASM is not set +# CONFIG_REALTEK_PHY is not set +# CONFIG_REDWOOD is not set +# CONFIG_REFCOUNT_FULL is not set +# CONFIG_REGMAP is not set +# CONFIG_REGMAP_I2C is not set +# CONFIG_REGMAP_MMIO is not set +# CONFIG_REGMAP_SPI is not set +# CONFIG_REGULATOR is not set +# CONFIG_REGULATOR_ACT8865 is not set +# CONFIG_REGULATOR_AD5398 is not set +# CONFIG_REGULATOR_ANATOP is not set +# CONFIG_REGULATOR_DA9210 is not set +# CONFIG_REGULATOR_DA9211 is not set +# CONFIG_REGULATOR_DEBUG is not set +# CONFIG_REGULATOR_FAN53555 is not set +# CONFIG_REGULATOR_FIXED_VOLTAGE is not set +# CONFIG_REGULATOR_GPIO is not set +# CONFIG_REGULATOR_ISL6271A is not set +# CONFIG_REGULATOR_ISL9305 is not set +# CONFIG_REGULATOR_LP3971 is not set +# CONFIG_REGULATOR_LP3972 is not set +# CONFIG_REGULATOR_LP872X is not set +# CONFIG_REGULATOR_LP8755 is not set +# CONFIG_REGULATOR_LTC3589 is not set +# CONFIG_REGULATOR_LTC3676 is not set +# CONFIG_REGULATOR_MAX1586 is not set +# CONFIG_REGULATOR_MAX8649 is not set +# CONFIG_REGULATOR_MAX8660 is not set +# CONFIG_REGULATOR_MAX8952 is not set +# CONFIG_REGULATOR_MAX8973 is not set +# CONFIG_REGULATOR_MT6311 is not set +# CONFIG_REGULATOR_PFUZE100 is not set +# CONFIG_REGULATOR_PV88060 is not set +# CONFIG_REGULATOR_PV88080 is not set +# CONFIG_REGULATOR_PV88090 is not set +# CONFIG_REGULATOR_PWM is not set +# CONFIG_REGULATOR_TI_ABB is not set +# CONFIG_REGULATOR_TPS51632 is not set +# CONFIG_REGULATOR_TPS62360 is not set +# CONFIG_REGULATOR_TPS65023 is not set +# CONFIG_REGULATOR_TPS6507X is not set +# CONFIG_REGULATOR_TPS65132 is not set +# CONFIG_REGULATOR_TPS6524X is not set +# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set +# CONFIG_REGULATOR_VCTRL is not set +# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set +# CONFIG_REISERFS_CHECK is not set +# CONFIG_REISERFS_FS is not set +# CONFIG_REISERFS_FS_POSIX_ACL is not set +# CONFIG_REISERFS_FS_SECURITY is not set +# CONFIG_REISERFS_FS_XATTR is not set +# CONFIG_REISERFS_PROC_INFO is not set +# CONFIG_RELAY is not set +# CONFIG_RELOCATABLE is not set +# CONFIG_REMOTEPROC is not set +# CONFIG_RESET_ATH79 is not set +# CONFIG_RESET_BERLIN is not set +# CONFIG_RESET_CONTROLLER is not set +# CONFIG_RESET_IMX7 is not set +# CONFIG_RESET_LANTIQ is not set +# CONFIG_RESET_LPC18XX is not set +# CONFIG_RESET_MESON is not set +# CONFIG_RESET_PISTACHIO is not set +# CONFIG_RESET_SOCFPGA is not set +# CONFIG_RESET_STM32 is not set +# CONFIG_RESET_SUNXI is not set +# CONFIG_RESET_TEGRA_BPMP is not set +# CONFIG_RESET_TI_SYSCON is not set +# CONFIG_RESET_ZYNQ is not set +# CONFIG_RFD_FTL is not set +CONFIG_RFKILL=y +# CONFIG_RFKILL_FULL is not set +# CONFIG_RFKILL_GPIO is not set +# CONFIG_RFKILL_INPUT is not set +# CONFIG_RFKILL_LEDS is not set +# CONFIG_RFKILL_REGULATOR is not set +# CONFIG_RING_BUFFER_BENCHMARK is not set +# CONFIG_RING_BUFFER_STARTUP_TEST is not set +# CONFIG_RMI4_CORE is not set +# CONFIG_RMNET is not set +# CONFIG_ROCKCHIP_PHY is not set +# CONFIG_ROCKER is not set +# CONFIG_ROMFS_FS is not set +# CONFIG_ROSE is not set +# CONFIG_RPCSEC_GSS_KRB5 is not set +# CONFIG_RPMSG_QCOM_GLINK_RPM is not set +# CONFIG_RPR0521 is not set +# CONFIG_RT2X00 is not set +# CONFIG_RTC_CLASS is not set +# CONFIG_RTC_DEBUG is not set +# CONFIG_RTC_DRV_ABB5ZES3 is not set +# CONFIG_RTC_DRV_ABX80X is not set +# CONFIG_RTC_DRV_ARMADA38X is not set +# CONFIG_RTC_DRV_AU1XXX is not set +# CONFIG_RTC_DRV_BQ32K is not set +# CONFIG_RTC_DRV_BQ4802 is not set +CONFIG_RTC_DRV_CMOS=y +# CONFIG_RTC_DRV_DS1286 is not set +# CONFIG_RTC_DRV_DS1302 is not set +# CONFIG_RTC_DRV_DS1305 is not set +# CONFIG_RTC_DRV_DS1307 is not set +# CONFIG_RTC_DRV_DS1307_CENTURY is not set +# CONFIG_RTC_DRV_DS1307_HWMON is not set +# CONFIG_RTC_DRV_DS1343 is not set +# CONFIG_RTC_DRV_DS1347 is not set +# CONFIG_RTC_DRV_DS1374 is not set +# CONFIG_RTC_DRV_DS1390 is not set +# CONFIG_RTC_DRV_DS1511 is not set +# CONFIG_RTC_DRV_DS1553 is not set +# CONFIG_RTC_DRV_DS1672 is not set +# CONFIG_RTC_DRV_DS1685_FAMILY is not set +# CONFIG_RTC_DRV_DS1742 is not set +# CONFIG_RTC_DRV_DS2404 is not set +# CONFIG_RTC_DRV_DS3232 is not set +# CONFIG_RTC_DRV_DS3234 is not set +# CONFIG_RTC_DRV_EM3027 is not set +# CONFIG_RTC_DRV_EP93XX is not set +# CONFIG_RTC_DRV_FM3130 is not set +# CONFIG_RTC_DRV_FTRTC010 is not set +# CONFIG_RTC_DRV_GENERIC is not set +# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set +# CONFIG_RTC_DRV_HYM8563 is not set +# CONFIG_RTC_DRV_ISL12022 is not set +# CONFIG_RTC_DRV_ISL12057 is not set +# CONFIG_RTC_DRV_ISL1208 is not set +# CONFIG_RTC_DRV_M41T80 is not set +# CONFIG_RTC_DRV_M41T93 is not set +# CONFIG_RTC_DRV_M41T94 is not set +# CONFIG_RTC_DRV_M48T35 is not set +# CONFIG_RTC_DRV_M48T59 is not set +# CONFIG_RTC_DRV_M48T86 is not set +# CONFIG_RTC_DRV_MAX6900 is not set +# CONFIG_RTC_DRV_MAX6902 is not set +# CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_MCP795 is not set +# CONFIG_RTC_DRV_MOXART is not set +# CONFIG_RTC_DRV_MPC5121 is not set +# CONFIG_RTC_DRV_MSM6242 is not set +# CONFIG_RTC_DRV_OMAP is not set +# CONFIG_RTC_DRV_PCF2123 is not set +# CONFIG_RTC_DRV_PCF2127 is not set +# CONFIG_RTC_DRV_PCF85063 is not set +# CONFIG_RTC_DRV_PCF8523 is not set +# CONFIG_RTC_DRV_PCF8563 is not set +# CONFIG_RTC_DRV_PCF8583 is not set +# CONFIG_RTC_DRV_PL030 is not set +# CONFIG_RTC_DRV_PL031 is not set +# CONFIG_RTC_DRV_PS3 is not set +# CONFIG_RTC_DRV_PT7C4338 is not set +# CONFIG_RTC_DRV_R7301 is not set +# CONFIG_RTC_DRV_R9701 is not set +# CONFIG_RTC_DRV_RP5C01 is not set +# CONFIG_RTC_DRV_RS5C348 is not set +# CONFIG_RTC_DRV_RS5C372 is not set +# CONFIG_RTC_DRV_RTC7301 is not set +# CONFIG_RTC_DRV_RV3029C2 is not set +# CONFIG_RTC_DRV_RV8803 is not set +# CONFIG_RTC_DRV_RX4581 is not set +# CONFIG_RTC_DRV_RX6110 is not set +# CONFIG_RTC_DRV_RX8010 is not set +# CONFIG_RTC_DRV_RX8025 is not set +# CONFIG_RTC_DRV_RX8581 is not set +# CONFIG_RTC_DRV_S35390A is not set +# CONFIG_RTC_DRV_SNVS is not set +# CONFIG_RTC_DRV_STK17TA8 is not set +# CONFIG_RTC_DRV_SUN6I is not set +# CONFIG_RTC_DRV_TEST is not set +# CONFIG_RTC_DRV_V3020 is not set +# CONFIG_RTC_DRV_X1205 is not set +# CONFIG_RTC_DRV_XGENE is not set +# CONFIG_RTC_DRV_ZYNQMP is not set +CONFIG_RTC_HCTOSYS=y +CONFIG_RTC_HCTOSYS_DEVICE="rtc0" +CONFIG_RTC_INTF_DEV=y +# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set +CONFIG_RTC_INTF_PROC=y +CONFIG_RTC_INTF_SYSFS=y +CONFIG_RTC_LIB=y +# CONFIG_RTC_NVMEM is not set +CONFIG_RTC_SYSTOHC=y +CONFIG_RTC_SYSTOHC_DEVICE="rtc0" +# CONFIG_RTL8180 is not set +# CONFIG_RTL8187 is not set +# CONFIG_RTL8192E is not set +# CONFIG_RTL8192U is not set +# CONFIG_RTL8306_PHY is not set +# CONFIG_RTL8366RB_PHY is not set +# CONFIG_RTL8366S_PHY is not set +# CONFIG_RTL8366_SMI is not set +# CONFIG_RTL8366_SMI_DEBUG_FS is not set +# CONFIG_RTL8367B_PHY is not set +# CONFIG_RTL8367_PHY is not set +# CONFIG_RTLLIB is not set +# CONFIG_RTL_CARDS is not set +# CONFIG_RTS5208 is not set +CONFIG_RT_MUTEXES=y +# CONFIG_RUNTIME_DEBUG is not set +CONFIG_RWSEM_GENERIC_SPINLOCK=y +CONFIG_RXKAD=y +# CONFIG_S2IO is not set +# CONFIG_SAMPLES is not set +# CONFIG_SAMSUNG_LAPTOP is not set +# CONFIG_SATA_ACARD_AHCI is not set +# CONFIG_SATA_AHCI is not set +# CONFIG_SATA_AHCI_PLATFORM is not set +# CONFIG_SATA_DWC is not set +# CONFIG_SATA_FSL is not set +# CONFIG_SATA_HIGHBANK is not set +# CONFIG_SATA_INIC162X is not set +# CONFIG_SATA_MV is not set +# CONFIG_SATA_NV is not set +# CONFIG_SATA_PMP is not set +# CONFIG_SATA_PROMISE is not set +# CONFIG_SATA_QSTOR is not set +# CONFIG_SATA_RCAR is not set +# CONFIG_SATA_SIL is not set +# CONFIG_SATA_SIL24 is not set +# CONFIG_SATA_SIS is not set +# CONFIG_SATA_SVW is not set +# CONFIG_SATA_SX4 is not set +# CONFIG_SATA_ULI is not set +# CONFIG_SATA_VIA is not set +# CONFIG_SATA_VITESSE is not set +# CONFIG_SBC_FITPC2_WATCHDOG is not set +CONFIG_SBITMAP=y +# CONFIG_SC92031 is not set +# CONFIG_SCA3000 is not set +# CONFIG_SCACHE_DEBUGFS is not set +# CONFIG_SCC is not set +# CONFIG_SCHEDSTATS is not set +# CONFIG_SCHED_AUTOGROUP is not set +# CONFIG_SCHED_DEBUG is not set +CONFIG_SCHED_HRTICK=y +# CONFIG_SCHED_MC is not set +CONFIG_SCHED_OMIT_FRAME_POINTER=y +# CONFIG_SCHED_SMT is not set +# CONFIG_SCHED_STACK_END_CHECK is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_SCR24X is not set +# CONFIG_SCSI is not set +# CONFIG_SCSI_3W_9XXX is not set +# CONFIG_SCSI_3W_SAS is not set +# CONFIG_SCSI_7000FASST is not set +# CONFIG_SCSI_AACRAID is not set +# CONFIG_SCSI_ACARD is not set +# CONFIG_SCSI_ADVANSYS is not set +# CONFIG_SCSI_AHA152X is not set +# CONFIG_SCSI_AHA1542 is not set +# CONFIG_SCSI_AIC79XX is not set +# CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC94XX is not set +# CONFIG_SCSI_AM53C974 is not set +# CONFIG_SCSI_ARCMSR is not set +# CONFIG_SCSI_BFA_FC is not set +# CONFIG_SCSI_BNX2X_FCOE is not set +# CONFIG_SCSI_BNX2_ISCSI is not set +# CONFIG_SCSI_BUSLOGIC is not set +# CONFIG_SCSI_CHELSIO_FCOE is not set +# CONFIG_SCSI_CONSTANTS is not set +# CONFIG_SCSI_CXGB3_ISCSI is not set +# CONFIG_SCSI_CXGB4_ISCSI is not set +# CONFIG_SCSI_DC395x is not set +# CONFIG_SCSI_DEBUG is not set +# CONFIG_SCSI_DH is not set +CONFIG_SCSI_DMA=y +# CONFIG_SCSI_DMX3191D is not set +# CONFIG_SCSI_DPT_I2O is not set +# CONFIG_SCSI_DTC3280 is not set +# CONFIG_SCSI_EATA is not set +# CONFIG_SCSI_ESAS2R is not set +# CONFIG_SCSI_FC_ATTRS is not set +# CONFIG_SCSI_FUTURE_DOMAIN is not set +# CONFIG_SCSI_GDTH is not set +# CONFIG_SCSI_GENERIC_NCR5380 is not set +# CONFIG_SCSI_GENERIC_NCR5380_MMIO is not set +# CONFIG_SCSI_HISI_SAS is not set +# CONFIG_SCSI_HPSA is not set +# CONFIG_SCSI_HPTIOP is not set +# CONFIG_SCSI_IN2000 is not set +# CONFIG_SCSI_INIA100 is not set +# CONFIG_SCSI_INITIO is not set +# CONFIG_SCSI_IPR is not set +# CONFIG_SCSI_IPS is not set +# CONFIG_SCSI_ISCI is not set +# CONFIG_SCSI_ISCSI_ATTRS is not set +# CONFIG_SCSI_LOGGING is not set +CONFIG_SCSI_LOWLEVEL=y +# CONFIG_SCSI_LOWLEVEL_PCMCIA is not set +# CONFIG_SCSI_LPFC is not set +CONFIG_SCSI_MOD=y +# CONFIG_SCSI_MPT2SAS is not set +# CONFIG_SCSI_MPT3SAS is not set +# CONFIG_SCSI_MQ_DEFAULT is not set +# CONFIG_SCSI_MVSAS is not set +# CONFIG_SCSI_MVSAS_DEBUG is not set +# CONFIG_SCSI_MVUMI is not set +# CONFIG_SCSI_NCR53C406A is not set +# CONFIG_SCSI_NETLINK is not set +# CONFIG_SCSI_NSP32 is not set +# CONFIG_SCSI_OSD_INITIATOR is not set +# CONFIG_SCSI_PAS16 is not set +# CONFIG_SCSI_PM8001 is not set +# CONFIG_SCSI_PMCRAID is not set +CONFIG_SCSI_PROC_FS=y +# CONFIG_SCSI_QLA_FC is not set +# CONFIG_SCSI_QLA_ISCSI is not set +# CONFIG_SCSI_QLOGIC_1280 is not set +# CONFIG_SCSI_QLOGIC_FAS is not set +# CONFIG_SCSI_SAS_ATTRS is not set +# CONFIG_SCSI_SAS_LIBSAS is not set +# CONFIG_SCSI_SCAN_ASYNC is not set +# CONFIG_SCSI_SMARTPQI is not set +# CONFIG_SCSI_SNIC is not set +# CONFIG_SCSI_SPI_ATTRS is not set +# CONFIG_SCSI_SRP_ATTRS is not set +# CONFIG_SCSI_STEX is not set +# CONFIG_SCSI_SYM53C416 is not set +# CONFIG_SCSI_SYM53C8XX_2 is not set +# CONFIG_SCSI_T128 is not set +# CONFIG_SCSI_U14_34F is not set +# CONFIG_SCSI_UFSHCD is not set +# CONFIG_SCSI_ULTRASTOR is not set +# CONFIG_SCSI_VIRTIO is not set +# CONFIG_SCSI_WD719X is not set +# CONFIG_SCx200_ACB is not set +# CONFIG_SDIO_UART is not set +# CONFIG_SECCOMP is not set +CONFIG_SECTION_MISMATCH_WARN_ONLY=y +# CONFIG_SECURITY is not set +# CONFIG_SECURITYFS is not set +# CONFIG_SECURITY_DMESG_RESTRICT is not set +CONFIG_SELECT_MEMORY_MODEL=y +# CONFIG_SENSORS_ABITUGURU is not set +# CONFIG_SENSORS_ABITUGURU3 is not set +# CONFIG_SENSORS_ACPI_POWER is not set +# CONFIG_SENSORS_AD7314 is not set +# CONFIG_SENSORS_AD7414 is not set +# CONFIG_SENSORS_AD7418 is not set +# CONFIG_SENSORS_ADC128D818 is not set +# CONFIG_SENSORS_ADCXX is not set +# CONFIG_SENSORS_ADM1021 is not set +# CONFIG_SENSORS_ADM1025 is not set +# CONFIG_SENSORS_ADM1026 is not set +# CONFIG_SENSORS_ADM1029 is not set +# CONFIG_SENSORS_ADM1031 is not set +# CONFIG_SENSORS_ADM9240 is not set +# CONFIG_SENSORS_ADS1015 is not set +# CONFIG_SENSORS_ADS7828 is not set +# CONFIG_SENSORS_ADS7871 is not set +# CONFIG_SENSORS_ADT7310 is not set +# CONFIG_SENSORS_ADT7410 is not set +# CONFIG_SENSORS_ADT7411 is not set +# CONFIG_SENSORS_ADT7462 is not set +# CONFIG_SENSORS_ADT7470 is not set +# CONFIG_SENSORS_ADT7475 is not set +# CONFIG_SENSORS_AMC6821 is not set +# CONFIG_SENSORS_APDS990X is not set +# CONFIG_SENSORS_APPLESMC is not set +# CONFIG_SENSORS_ASB100 is not set +# CONFIG_SENSORS_ASPEED is not set +# CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_ATK0110 is not set +# CONFIG_SENSORS_ATXP1 is not set +# CONFIG_SENSORS_BH1770 is not set +# CONFIG_SENSORS_BH1780 is not set +# CONFIG_SENSORS_CORETEMP is not set +# CONFIG_SENSORS_DELL_SMM is not set +# CONFIG_SENSORS_DME1737 is not set +# CONFIG_SENSORS_DS1621 is not set +# CONFIG_SENSORS_DS620 is not set +# CONFIG_SENSORS_EMC1403 is not set +# CONFIG_SENSORS_EMC2103 is not set +# CONFIG_SENSORS_EMC6W201 is not set +# CONFIG_SENSORS_F71805F is not set +# CONFIG_SENSORS_F71882FG is not set +# CONFIG_SENSORS_F75375S is not set +# CONFIG_SENSORS_FAM15H_POWER is not set +# CONFIG_SENSORS_FSCHMD is not set +# CONFIG_SENSORS_FTSTEUTATES is not set +# CONFIG_SENSORS_G760A is not set +# CONFIG_SENSORS_G762 is not set +# CONFIG_SENSORS_GL518SM is not set +# CONFIG_SENSORS_GL520SM is not set +# CONFIG_SENSORS_GPIO_FAN is not set +# CONFIG_SENSORS_GSC is not set +# CONFIG_SENSORS_HDAPS is not set +# CONFIG_SENSORS_HIH6130 is not set +# CONFIG_SENSORS_HMC5843 is not set +# CONFIG_SENSORS_HMC5843_I2C is not set +# CONFIG_SENSORS_HMC5843_SPI is not set +# CONFIG_SENSORS_HTU21 is not set +# CONFIG_SENSORS_I5500 is not set +# CONFIG_SENSORS_I5K_AMB is not set +# CONFIG_SENSORS_IIO_HWMON is not set +# CONFIG_SENSORS_INA209 is not set +# CONFIG_SENSORS_INA2XX is not set +# CONFIG_SENSORS_INA3221 is not set +# CONFIG_SENSORS_ISL29018 is not set +# CONFIG_SENSORS_ISL29028 is not set +# CONFIG_SENSORS_IT87 is not set +# CONFIG_SENSORS_JC42 is not set +# CONFIG_SENSORS_K10TEMP is not set +# CONFIG_SENSORS_K8TEMP is not set +# CONFIG_SENSORS_LINEAGE is not set +# CONFIG_SENSORS_LIS3LV02D is not set +# CONFIG_SENSORS_LIS3_I2C is not set +# CONFIG_SENSORS_LIS3_SPI is not set +# CONFIG_SENSORS_LM63 is not set +# CONFIG_SENSORS_LM70 is not set +# CONFIG_SENSORS_LM73 is not set +# CONFIG_SENSORS_LM75 is not set +# CONFIG_SENSORS_LM77 is not set +# CONFIG_SENSORS_LM78 is not set +# CONFIG_SENSORS_LM80 is not set +# CONFIG_SENSORS_LM83 is not set +# CONFIG_SENSORS_LM85 is not set +# CONFIG_SENSORS_LM87 is not set +# CONFIG_SENSORS_LM90 is not set +# CONFIG_SENSORS_LM92 is not set +# CONFIG_SENSORS_LM93 is not set +# CONFIG_SENSORS_LM95234 is not set +# CONFIG_SENSORS_LM95241 is not set +# CONFIG_SENSORS_LM95245 is not set +# CONFIG_SENSORS_LTC2945 is not set +# CONFIG_SENSORS_LTC2990 is not set +# CONFIG_SENSORS_LTC4151 is not set +# CONFIG_SENSORS_LTC4215 is not set +# CONFIG_SENSORS_LTC4222 is not set +# CONFIG_SENSORS_LTC4245 is not set +# CONFIG_SENSORS_LTC4260 is not set +# CONFIG_SENSORS_LTC4261 is not set +# CONFIG_SENSORS_MAX1111 is not set +# CONFIG_SENSORS_MAX16065 is not set +# CONFIG_SENSORS_MAX1619 is not set +# CONFIG_SENSORS_MAX1668 is not set +# CONFIG_SENSORS_MAX197 is not set +# CONFIG_SENSORS_MAX31722 is not set +# CONFIG_SENSORS_MAX31790 is not set +# CONFIG_SENSORS_MAX6639 is not set +# CONFIG_SENSORS_MAX6642 is not set +# CONFIG_SENSORS_MAX6650 is not set +# CONFIG_SENSORS_MAX6697 is not set +# CONFIG_SENSORS_MCP3021 is not set +# CONFIG_SENSORS_NCT6683 is not set +# CONFIG_SENSORS_NCT6775 is not set +# CONFIG_SENSORS_NCT7802 is not set +# CONFIG_SENSORS_NCT7904 is not set +# CONFIG_SENSORS_NSA320 is not set +# CONFIG_SENSORS_NTC_THERMISTOR is not set +# CONFIG_SENSORS_PC87360 is not set +# CONFIG_SENSORS_PC87427 is not set +# CONFIG_SENSORS_PCF8591 is not set +# CONFIG_SENSORS_POWR1220 is not set +# CONFIG_SENSORS_PWM_FAN is not set +# CONFIG_SENSORS_SCH5627 is not set +# CONFIG_SENSORS_SCH5636 is not set +# CONFIG_SENSORS_SCH56XX_COMMON is not set +# CONFIG_SENSORS_SHT15 is not set +# CONFIG_SENSORS_SHT21 is not set +# CONFIG_SENSORS_SHT3x is not set +# CONFIG_SENSORS_SHTC1 is not set +# CONFIG_SENSORS_SIS5595 is not set +# CONFIG_SENSORS_SMM665 is not set +# CONFIG_SENSORS_SMSC47B397 is not set +# CONFIG_SENSORS_SMSC47M1 is not set +# CONFIG_SENSORS_SMSC47M192 is not set +# CONFIG_SENSORS_STTS751 is not set +# CONFIG_SENSORS_TC654 is not set +# CONFIG_SENSORS_TC74 is not set +# CONFIG_SENSORS_THMC50 is not set +# CONFIG_SENSORS_TMP102 is not set +# CONFIG_SENSORS_TMP103 is not set +# CONFIG_SENSORS_TMP108 is not set +# CONFIG_SENSORS_TMP401 is not set +# CONFIG_SENSORS_TMP421 is not set +# CONFIG_SENSORS_TSL2550 is not set +# CONFIG_SENSORS_TSL2563 is not set +# CONFIG_SENSORS_VEXPRESS is not set +# CONFIG_SENSORS_VIA686A is not set +# CONFIG_SENSORS_VIA_CPUTEMP is not set +# CONFIG_SENSORS_VT1211 is not set +# CONFIG_SENSORS_VT8231 is not set +# CONFIG_SENSORS_W83627EHF is not set +# CONFIG_SENSORS_W83627HF is not set +# CONFIG_SENSORS_W83781D is not set +# CONFIG_SENSORS_W83791D is not set +# CONFIG_SENSORS_W83792D is not set +# CONFIG_SENSORS_W83793 is not set +# CONFIG_SENSORS_W83795 is not set +# CONFIG_SENSORS_W83L785TS is not set +# CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_XGENE is not set +CONFIG_SERIAL_8250=y +# CONFIG_SERIAL_8250_ACCENT is not set +# CONFIG_SERIAL_8250_ASPEED_VUART is not set +# CONFIG_SERIAL_8250_BOCA is not set +CONFIG_SERIAL_8250_CONSOLE=y +# CONFIG_SERIAL_8250_CS is not set +# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set +# CONFIG_SERIAL_8250_DETECT_IRQ is not set +CONFIG_SERIAL_8250_DMA=y +# CONFIG_SERIAL_8250_DW is not set +# CONFIG_SERIAL_8250_EM is not set +# CONFIG_SERIAL_8250_EXAR is not set +# CONFIG_SERIAL_8250_EXAR_ST16C554 is not set +# CONFIG_SERIAL_8250_EXTENDED is not set +# CONFIG_SERIAL_8250_FINTEK is not set +# CONFIG_SERIAL_8250_FOURPORT is not set +# CONFIG_SERIAL_8250_HUB6 is not set +# CONFIG_SERIAL_8250_INGENIC is not set +# CONFIG_SERIAL_8250_LPSS is not set +# CONFIG_SERIAL_8250_MANY_PORTS is not set +# CONFIG_SERIAL_8250_MID is not set +# CONFIG_SERIAL_8250_MOXA is not set +CONFIG_SERIAL_8250_NR_UARTS=2 +# CONFIG_SERIAL_8250_PCI is not set +# CONFIG_SERIAL_8250_RSA is not set +# CONFIG_SERIAL_8250_RT288X is not set +CONFIG_SERIAL_8250_RUNTIME_UARTS=2 +# CONFIG_SERIAL_ALTERA_JTAGUART is not set +# CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_AMBA_PL010 is not set +# CONFIG_SERIAL_ARC is not set +# CONFIG_SERIAL_BCM63XX is not set +# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set +CONFIG_SERIAL_CORE=y +CONFIG_SERIAL_CORE_CONSOLE=y +# CONFIG_SERIAL_DEV_BUS is not set +CONFIG_SERIAL_EARLYCON=y +# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set +# CONFIG_SERIAL_FSL_LPUART is not set +# CONFIG_SERIAL_GRLIB_GAISLER_APBUART is not set +# CONFIG_SERIAL_IFX6X60 is not set +# CONFIG_SERIAL_JSM is not set +# CONFIG_SERIAL_MAX3100 is not set +# CONFIG_SERIAL_MAX310X is not set +# CONFIG_SERIAL_NONSTANDARD is not set +# CONFIG_SERIAL_OF_PLATFORM is not set +# CONFIG_SERIAL_OF_PLATFORM_NWPSERIAL is not set +# CONFIG_SERIAL_PCH_UART is not set +# CONFIG_SERIAL_RP2 is not set +# CONFIG_SERIAL_SC16IS7XX is not set +# CONFIG_SERIAL_SCCNXP is not set +# CONFIG_SERIAL_SH_SCI is not set +# CONFIG_SERIAL_STM32 is not set +# CONFIG_SERIAL_ST_ASC is not set +# CONFIG_SERIAL_TIMBERDALE is not set +# CONFIG_SERIAL_UARTLITE is not set +# CONFIG_SERIAL_XILINX_PS_UART is not set +# CONFIG_SERIO is not set +# CONFIG_SERIO_ALTERA_PS2 is not set +# CONFIG_SERIO_AMBAKMI is not set +# CONFIG_SERIO_APBPS2 is not set +# CONFIG_SERIO_ARC_PS2 is not set +# CONFIG_SERIO_CT82C710 is not set +# CONFIG_SERIO_GPIO_PS2 is not set +# CONFIG_SERIO_I8042 is not set +# CONFIG_SERIO_LIBPS2 is not set +# CONFIG_SERIO_PARKBD is not set +# CONFIG_SERIO_PCIPS2 is not set +# CONFIG_SERIO_PS2MULT is not set +# CONFIG_SERIO_RAW is not set +# CONFIG_SERIO_SERPORT is not set +# CONFIG_SERIO_SUN4I_PS2 is not set +# CONFIG_SFC is not set +# CONFIG_SFC_FALCON is not set +# CONFIG_SFI is not set +# CONFIG_SGETMASK_SYSCALL is not set +# CONFIG_SGI_IOC4 is not set +# CONFIG_SGI_IP22 is not set +# CONFIG_SGI_IP27 is not set +# CONFIG_SGI_IP28 is not set +# CONFIG_SGI_IP32 is not set +# CONFIG_SGI_PARTITION is not set +# CONFIG_SG_POOL is not set +# CONFIG_SG_SPLIT is not set +CONFIG_SHMEM=y +# CONFIG_SH_ETH is not set +# CONFIG_SH_TIMER_CMT is not set +# CONFIG_SH_TIMER_MTU2 is not set +# CONFIG_SH_TIMER_TMU is not set +# CONFIG_SI1145 is not set +# CONFIG_SI7005 is not set +# CONFIG_SI7020 is not set +# CONFIG_SIBYTE_BIGSUR is not set +# CONFIG_SIBYTE_CARMEL is not set +# CONFIG_SIBYTE_CRHINE is not set +# CONFIG_SIBYTE_CRHONE is not set +# CONFIG_SIBYTE_LITTLESUR is not set +# CONFIG_SIBYTE_RHONE is not set +# CONFIG_SIBYTE_SENTOSA is not set +# CONFIG_SIBYTE_SWARM is not set +CONFIG_SIGNALFD=y +# CONFIG_SIGNED_PE_FILE_VERIFICATION is not set +# CONFIG_SIMPLE_GPIO is not set +# CONFIG_SIMPLE_PM_BUS is not set +# CONFIG_SIS190 is not set +# CONFIG_SIS900 is not set +# CONFIG_SKGE is not set +# CONFIG_SKY2 is not set +# CONFIG_SKY2_DEBUG is not set +# CONFIG_SLAB is not set +CONFIG_SLABINFO=y +# CONFIG_SLAB_FREELIST_HARDENED is not set +# CONFIG_SLAB_FREELIST_RANDOM is not set +CONFIG_SLAB_MERGE_DEFAULT=y +# CONFIG_SLHC is not set +# CONFIG_SLICOSS is not set +# CONFIG_SLIP is not set +# CONFIG_SLOB is not set +CONFIG_SLUB=y +CONFIG_SLUB_CPU_PARTIAL=y +# CONFIG_SLUB_DEBUG is not set +# CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_STATS is not set +# CONFIG_SMARTJOYPLUS_FF is not set +# CONFIG_SMC911X is not set +# CONFIG_SMC9194 is not set +# CONFIG_SMC91X is not set +# CONFIG_SMP is not set +# CONFIG_SMSC911X is not set +# CONFIG_SMSC9420 is not set +# CONFIG_SMSC_PHY is not set +# CONFIG_SM_FTL is not set +# CONFIG_SND is not set +# CONFIG_SND_AC97_POWER_SAVE is not set +# CONFIG_SND_AD1816A is not set +# CONFIG_SND_AD1848 is not set +# CONFIG_SND_AD1889 is not set +# CONFIG_SND_ADLIB is not set +# CONFIG_SND_ALI5451 is not set +# CONFIG_SND_ALOOP is not set +# CONFIG_SND_ALS100 is not set +# CONFIG_SND_ALS300 is not set +# CONFIG_SND_ALS4000 is not set +# CONFIG_SND_ARM is not set +# CONFIG_SND_ASIHPI is not set +# CONFIG_SND_ATIIXP is not set +# CONFIG_SND_ATIIXP_MODEM is not set +# CONFIG_SND_ATMEL_AC97C is not set +# CONFIG_SND_ATMEL_SOC is not set +# CONFIG_SND_AU8810 is not set +# CONFIG_SND_AU8820 is not set +# CONFIG_SND_AU8830 is not set +# CONFIG_SND_AUDIO_GRAPH_CARD is not set +# CONFIG_SND_AUDIO_GRAPH_SCU_CARD is not set +# CONFIG_SND_AW2 is not set +# CONFIG_SND_AZT2320 is not set +# CONFIG_SND_AZT3328 is not set +# CONFIG_SND_BCD2000 is not set +# CONFIG_SND_BT87X is not set +# CONFIG_SND_CA0106 is not set +# CONFIG_SND_CMI8330 is not set +# CONFIG_SND_CMIPCI is not set +# CONFIG_SND_CS4231 is not set +# CONFIG_SND_CS4236 is not set +# CONFIG_SND_CS4281 is not set +# CONFIG_SND_CS46XX is not set +# CONFIG_SND_CS5530 is not set +# CONFIG_SND_CS5535AUDIO is not set +# CONFIG_SND_CTXFI is not set +# CONFIG_SND_DARLA20 is not set +# CONFIG_SND_DARLA24 is not set +# CONFIG_SND_DEBUG is not set +# CONFIG_SND_DESIGNWARE_I2S is not set +CONFIG_SND_DRIVERS=y +# CONFIG_SND_DUMMY is not set +# CONFIG_SND_DYNAMIC_MINORS is not set +# CONFIG_SND_ECHO3G is not set +# CONFIG_SND_EDMA_SOC is not set +# CONFIG_SND_EMU10K1 is not set +# CONFIG_SND_EMU10K1X is not set +# CONFIG_SND_EMU10K1_SEQ is not set +# CONFIG_SND_ENS1370 is not set +# CONFIG_SND_ENS1371 is not set +# CONFIG_SND_ES1688 is not set +# CONFIG_SND_ES18XX is not set +# CONFIG_SND_ES1938 is not set +# CONFIG_SND_ES1968 is not set +# CONFIG_SND_FIREWIRE is not set +# CONFIG_SND_FM801 is not set +# CONFIG_SND_GINA20 is not set +# CONFIG_SND_GINA24 is not set +# CONFIG_SND_GUSCLASSIC is not set +# CONFIG_SND_GUSEXTREME is not set +# CONFIG_SND_GUSMAX is not set +# CONFIG_SND_HDA_INTEL is not set +CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0 +CONFIG_SND_HDA_PREALLOC_SIZE=64 +# CONFIG_SND_HDSP is not set +# CONFIG_SND_HDSPM is not set +# CONFIG_SND_HRTIMER is not set +# CONFIG_SND_HWDEP is not set +# CONFIG_SND_I2S_HI6210_I2S is not set +# CONFIG_SND_ICE1712 is not set +# CONFIG_SND_ICE1724 is not set +# CONFIG_SND_INDIGO is not set +# CONFIG_SND_INDIGODJ is not set +# CONFIG_SND_INDIGODJX is not set +# CONFIG_SND_INDIGOIO is not set +# CONFIG_SND_INDIGOIOX is not set +# CONFIG_SND_INTEL8X0 is not set +# CONFIG_SND_INTEL8X0M is not set +# CONFIG_SND_INTERWAVE is not set +# CONFIG_SND_INTERWAVE_STB is not set +# CONFIG_SND_ISA is not set +# CONFIG_SND_KIRKWOOD_SOC is not set +# CONFIG_SND_KORG1212 is not set +# CONFIG_SND_LAYLA20 is not set +# CONFIG_SND_LAYLA24 is not set +# CONFIG_SND_LOLA is not set +# CONFIG_SND_LX6464ES is not set +# CONFIG_SND_MAESTRO3 is not set +# CONFIG_SND_MIA is not set +# CONFIG_SND_MIPS is not set +# CONFIG_SND_MIRO is not set +# CONFIG_SND_MIXART is not set +# CONFIG_SND_MIXER_OSS is not set +# CONFIG_SND_MONA is not set +# CONFIG_SND_MPC52xx_SOC_EFIKA is not set +# CONFIG_SND_MPU401 is not set +# CONFIG_SND_MTPAV is not set +# CONFIG_SND_MTS64 is not set +# CONFIG_SND_MXS_SOC is not set +# CONFIG_SND_NM256 is not set +# CONFIG_SND_OPL3SA2 is not set +# CONFIG_SND_OPL3_LIB_SEQ is not set +# CONFIG_SND_OPL4_LIB_SEQ is not set +# CONFIG_SND_OPTI92X_AD1848 is not set +# CONFIG_SND_OPTI92X_CS4231 is not set +# CONFIG_SND_OPTI93X is not set +CONFIG_SND_OSSEMUL=y +# CONFIG_SND_OXYGEN is not set +CONFIG_SND_PCI=y +# CONFIG_SND_PCM is not set +# CONFIG_SND_PCMCIA is not set +# CONFIG_SND_PCM_OSS is not set +CONFIG_SND_PCM_OSS_PLUGINS=y +# CONFIG_SND_PCM_TIMER is not set +# CONFIG_SND_PCM_XRUN_DEBUG is not set +# CONFIG_SND_PCXHR is not set +# CONFIG_SND_PDAUDIOCF is not set +# CONFIG_SND_PORTMAN2X4 is not set +# CONFIG_SND_POWERPC_SOC is not set +# CONFIG_SND_PPC is not set +CONFIG_SND_PROC_FS=y +# CONFIG_SND_RAWMIDI is not set +# CONFIG_SND_RAWMIDI_SEQ is not set +# CONFIG_SND_RIPTIDE is not set +# CONFIG_SND_RME32 is not set +# CONFIG_SND_RME96 is not set +# CONFIG_SND_RME9652 is not set +# CONFIG_SND_RTCTIMER is not set +# CONFIG_SND_SB16 is not set +# CONFIG_SND_SB8 is not set +# CONFIG_SND_SBAWE is not set +# CONFIG_SND_SBAWE_SEQ is not set +# CONFIG_SND_SE6X is not set +# CONFIG_SND_SEQUENCER is not set +# CONFIG_SND_SERIAL_U16550 is not set +# CONFIG_SND_SIMPLE_CARD is not set +# CONFIG_SND_SIMPLE_SCU_CARD is not set +# CONFIG_SND_SIS7019 is not set +# CONFIG_SND_SOC is not set +# CONFIG_SND_SOC_AC97_CODEC is not set +# CONFIG_SND_SOC_ADAU1701 is not set +# CONFIG_SND_SOC_ADAU1761_I2C is not set +# CONFIG_SND_SOC_ADAU1761_SPI is not set +# CONFIG_SND_SOC_ADAU7002 is not set +# CONFIG_SND_SOC_AK4104 is not set +# CONFIG_SND_SOC_AK4554 is not set +# CONFIG_SND_SOC_AK4613 is not set +# CONFIG_SND_SOC_AK4642 is not set +# CONFIG_SND_SOC_AK5386 is not set +# CONFIG_SND_SOC_ALC5623 is not set +# CONFIG_SND_SOC_AMD_ACP is not set +# CONFIG_SND_SOC_AU1XAUDIO is not set +# CONFIG_SND_SOC_AU1XPSC is not set +# CONFIG_SND_SOC_BT_SCO is not set +# CONFIG_SND_SOC_CS35L32 is not set +# CONFIG_SND_SOC_CS35L33 is not set +# CONFIG_SND_SOC_CS35L34 is not set +# CONFIG_SND_SOC_CS35L35 is not set +# CONFIG_SND_SOC_CS4265 is not set +# CONFIG_SND_SOC_CS4270 is not set +# CONFIG_SND_SOC_CS4271 is not set +# CONFIG_SND_SOC_CS4271_I2C is not set +# CONFIG_SND_SOC_CS4271_SPI is not set +# CONFIG_SND_SOC_CS42L42 is not set +# CONFIG_SND_SOC_CS42L51_I2C is not set +# CONFIG_SND_SOC_CS42L52 is not set +# CONFIG_SND_SOC_CS42L56 is not set +# CONFIG_SND_SOC_CS42L73 is not set +# CONFIG_SND_SOC_CS42XX8_I2C is not set +# CONFIG_SND_SOC_CS4349 is not set +# CONFIG_SND_SOC_CS43130 is not set +# CONFIG_SND_SOC_CS53L30 is not set +# CONFIG_SND_SOC_DIO2125 is not set +# CONFIG_SND_SOC_ES7134 is not set +# CONFIG_SND_SOC_ES8316 is not set +# CONFIG_SND_SOC_ES8328 is not set +# CONFIG_SND_SOC_ES8328_I2C is not set +# CONFIG_SND_SOC_ES8328_SPI is not set +# CONFIG_SND_SOC_EUKREA_TLV320 is not set +# CONFIG_SND_SOC_FSL_ASOC_CARD is not set +# CONFIG_SND_SOC_FSL_ASRC is not set +# CONFIG_SND_SOC_FSL_ESAI is not set +# CONFIG_SND_SOC_FSL_SAI is not set +# CONFIG_SND_SOC_FSL_SPDIF is not set +# CONFIG_SND_SOC_FSL_SSI is not set +# CONFIG_SND_SOC_GTM601 is not set +# CONFIG_SND_SOC_IMG is not set +# CONFIG_SND_SOC_IMX_AUDMUX is not set +# CONFIG_SND_SOC_IMX_ES8328 is not set +# CONFIG_SND_SOC_IMX_SPDIF is not set +# CONFIG_SND_SOC_IMX_WM8962 is not set +# CONFIG_SND_SOC_INNO_RK3036 is not set +# CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set +# CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_KBL_RT5663_RT5514_MAX98927_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_MAX98357A_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_NAU88L25_SSM4567_MACH is not set +# CONFIG_SND_SOC_INTEL_SKL_RT286_MACH is not set +# CONFIG_SND_SOC_INTEL_SST is not set +# CONFIG_SND_SOC_MAX98504 is not set +# CONFIG_SND_SOC_MAX9860 is not set +# CONFIG_SND_SOC_MAX98927 is not set +# CONFIG_SND_SOC_MEDIATEK is not set +# CONFIG_SND_SOC_MPC5200_AC97 is not set +# CONFIG_SND_SOC_MPC5200_I2S is not set +# CONFIG_SND_SOC_MSM8916_WCD_DIGITAL is not set +# CONFIG_SND_SOC_MT2701 is not set +# CONFIG_SND_SOC_MT8173 is not set +# CONFIG_SND_SOC_NAU8540 is not set +# CONFIG_SND_SOC_NAU8810 is not set +# CONFIG_SND_SOC_NAU8824 is not set +# CONFIG_SND_SOC_PCM1681 is not set +# CONFIG_SND_SOC_PCM1792A is not set +# CONFIG_SND_SOC_PCM179X_I2C is not set +# CONFIG_SND_SOC_PCM179X_SPI is not set +# CONFIG_SND_SOC_PCM3168A_I2C is not set +# CONFIG_SND_SOC_PCM3168A_SPI is not set +# CONFIG_SND_SOC_PCM512x_I2C is not set +# CONFIG_SND_SOC_PCM512x_SPI is not set +# CONFIG_SND_SOC_QCOM is not set +# CONFIG_SND_SOC_RT5616 is not set +# CONFIG_SND_SOC_RT5631 is not set +# CONFIG_SND_SOC_RT5677_SPI is not set +# CONFIG_SND_SOC_SGTL5000 is not set +# CONFIG_SND_SOC_SIRF_AUDIO_CODEC is not set +# CONFIG_SND_SOC_SPDIF is not set +# CONFIG_SND_SOC_SSM2602_I2C is not set +# CONFIG_SND_SOC_SSM2602_SPI is not set +# CONFIG_SND_SOC_SSM4567 is not set +# CONFIG_SND_SOC_STA32X is not set +# CONFIG_SND_SOC_STA350 is not set +# CONFIG_SND_SOC_STI_SAS is not set +# CONFIG_SND_SOC_TAS2552 is not set +# CONFIG_SND_SOC_TAS5086 is not set +# CONFIG_SND_SOC_TAS571X is not set +# CONFIG_SND_SOC_TAS5720 is not set +# CONFIG_SND_SOC_TFA9879 is not set +# CONFIG_SND_SOC_TLV320AIC23_I2C is not set +# CONFIG_SND_SOC_TLV320AIC23_SPI is not set +# CONFIG_SND_SOC_TLV320AIC31XX is not set +# CONFIG_SND_SOC_TLV320AIC3X is not set +# CONFIG_SND_SOC_TPA6130A2 is not set +# CONFIG_SND_SOC_TS3A227E is not set +# CONFIG_SND_SOC_WM8510 is not set +# CONFIG_SND_SOC_WM8523 is not set +# CONFIG_SND_SOC_WM8524 is not set +# CONFIG_SND_SOC_WM8580 is not set +# CONFIG_SND_SOC_WM8711 is not set +# CONFIG_SND_SOC_WM8728 is not set +# CONFIG_SND_SOC_WM8731 is not set +# CONFIG_SND_SOC_WM8737 is not set +# CONFIG_SND_SOC_WM8741 is not set +# CONFIG_SND_SOC_WM8750 is not set +# CONFIG_SND_SOC_WM8753 is not set +# CONFIG_SND_SOC_WM8770 is not set +# CONFIG_SND_SOC_WM8776 is not set +# CONFIG_SND_SOC_WM8804_I2C is not set +# CONFIG_SND_SOC_WM8804_SPI is not set +# CONFIG_SND_SOC_WM8903 is not set +# CONFIG_SND_SOC_WM8960 is not set +# CONFIG_SND_SOC_WM8962 is not set +# CONFIG_SND_SOC_WM8974 is not set +# CONFIG_SND_SOC_WM8978 is not set +# CONFIG_SND_SOC_WM8985 is not set +# CONFIG_SND_SOC_XTFPGA_I2S is not set +# CONFIG_SND_SOC_ZX_AUD96P22 is not set +# CONFIG_SND_SONICVIBES is not set +# CONFIG_SND_SPI is not set +# CONFIG_SND_SSCAPE is not set +# CONFIG_SND_SUN4I_CODEC is not set +# CONFIG_SND_SUPPORT_OLD_API is not set +# CONFIG_SND_TIMER is not set +# CONFIG_SND_TRIDENT is not set +CONFIG_SND_USB=y +# CONFIG_SND_USB_6FIRE is not set +# CONFIG_SND_USB_AUDIO is not set +# CONFIG_SND_USB_CAIAQ is not set +# CONFIG_SND_USB_HIFACE is not set +# CONFIG_SND_USB_POD is not set +# CONFIG_SND_USB_PODHD is not set +# CONFIG_SND_USB_TONEPORT is not set +# CONFIG_SND_USB_UA101 is not set +# CONFIG_SND_USB_US122L is not set +# CONFIG_SND_USB_USX2Y is not set +# CONFIG_SND_USB_VARIAX is not set +# CONFIG_SND_VERBOSE_PRINTK is not set +CONFIG_SND_VERBOSE_PROCFS=y +# CONFIG_SND_VIA82XX is not set +# CONFIG_SND_VIA82XX_MODEM is not set +# CONFIG_SND_VIRTUOSO is not set +# CONFIG_SND_VX222 is not set +# CONFIG_SND_VXPOCKET is not set +# CONFIG_SND_WAVEFRONT is not set +CONFIG_SND_X86=y +# CONFIG_SND_YMFPCI is not set +# CONFIG_SNI_RM is not set +# CONFIG_SOCK_CGROUP_DATA is not set +# CONFIG_SOC_AM33XX is not set +# CONFIG_SOC_AM43XX is not set +# CONFIG_SOC_BRCMSTB is not set +# CONFIG_SOC_CAMERA is not set +# CONFIG_SOC_DRA7XX is not set +# CONFIG_SOC_HAS_OMAP2_SDRC is not set +# CONFIG_SOC_OMAP5 is not set +# CONFIG_SOC_TI is not set +# CONFIG_SOFT_WATCHDOG is not set +# CONFIG_SOFTLOCKUP_DETECTOR is not set +# CONFIG_SOLARIS_X86_PARTITION is not set +# CONFIG_SONYPI is not set +# CONFIG_SONY_LAPTOP is not set +# CONFIG_SOUND is not set +# CONFIG_SOUND_OSS_CORE is not set +# CONFIG_SOUND_PRIME is not set +# CONFIG_SP5100_TCO is not set +# CONFIG_SPARSEMEM_MANUAL is not set +# CONFIG_SPARSEMEM_STATIC is not set +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set +# CONFIG_SPARSE_IRQ is not set +# CONFIG_SPARSE_RCU_POINTER is not set +# CONFIG_SPEAKUP is not set +# CONFIG_SPI is not set +# CONFIG_SPINLOCK_TEST is not set +# CONFIG_SPI_ALTERA is not set +# CONFIG_SPI_AU1550 is not set +# CONFIG_SPI_AXI_SPI_ENGINE is not set +# CONFIG_SPI_BCM2835 is not set +# CONFIG_SPI_BCM_QSPI is not set +# CONFIG_SPI_BITBANG is not set +# CONFIG_SPI_BUTTERFLY is not set +# CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set +# CONFIG_SPI_DEBUG is not set +# CONFIG_SPI_DESIGNWARE is not set +# CONFIG_SPI_FSL_DSPI is not set +# CONFIG_SPI_FSL_ESPI is not set +# CONFIG_SPI_FSL_SPI is not set +# CONFIG_SPI_GPIO is not set +# CONFIG_SPI_GPIO_OLD is not set +# CONFIG_SPI_IMG_SPFI is not set +# CONFIG_SPI_LM70_LLP is not set +# CONFIG_SPI_LOOPBACK_TEST is not set +# CONFIG_SPI_MASTER is not set +# CONFIG_SPI_MPC52xx is not set +# CONFIG_SPI_MPC52xx_PSC is not set +# CONFIG_SPI_OCTEON is not set +# CONFIG_SPI_OC_TINY is not set +# CONFIG_SPI_ORION is not set +# CONFIG_SPI_PL022 is not set +# CONFIG_SPI_PPC4xx is not set +# CONFIG_SPI_PXA2XX is not set +# CONFIG_SPI_PXA2XX_PCI is not set +# CONFIG_SPI_ROCKCHIP is not set +# CONFIG_SPI_SC18IS602 is not set +# CONFIG_SPI_SLAVE is not set +# CONFIG_SPI_SPIDEV is not set +# CONFIG_SPI_THUNDERX is not set +# CONFIG_SPI_TI_QSPI is not set +# CONFIG_SPI_TLE62X0 is not set +# CONFIG_SPI_TOPCLIFF_PCH is not set +# CONFIG_SPI_XCOMM is not set +# CONFIG_SPI_XILINX is not set +# CONFIG_SPI_XWAY is not set +# CONFIG_SPI_ZYNQMP_GQSPI is not set +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_SPMI is not set +CONFIG_SQUASHFS=y +# CONFIG_SQUASHFS_4K_DEVBLK_SIZE is not set +# CONFIG_SQUASHFS_DECOMP_MULTI is not set +CONFIG_SQUASHFS_DECOMP_MULTI_PERCPU=y +# CONFIG_SQUASHFS_DECOMP_SINGLE is not set +# CONFIG_SQUASHFS_EMBEDDED is not set +# CONFIG_SQUASHFS_FILE_CACHE is not set +CONFIG_SQUASHFS_FILE_DIRECT=y +CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 +# CONFIG_SQUASHFS_LZ4 is not set +# CONFIG_SQUASHFS_LZO is not set +# CONFIG_SQUASHFS_XATTR is not set +CONFIG_SQUASHFS_XZ=y +# CONFIG_SQUASHFS_ZLIB is not set +# CONFIG_SQUASHFS_ZSTD is not set +# CONFIG_SRAM is not set +# CONFIG_SRF04 is not set +# CONFIG_SRF08 is not set +# CONFIG_SSB is not set +# CONFIG_SSB_DEBUG is not set +# CONFIG_SSB_DRIVER_GPIO is not set +# CONFIG_SSB_HOST_SOC is not set +# CONFIG_SSB_PCMCIAHOST is not set +CONFIG_SSB_POSSIBLE=y +# CONFIG_SSB_SDIOHOST is not set +# CONFIG_SSB_SILENT is not set +# CONFIG_SSFDC is not set +# CONFIG_STACKTRACE is not set +CONFIG_STACKTRACE_SUPPORT=y +# CONFIG_STACK_TRACER is not set +# CONFIG_STACK_VALIDATION is not set +CONFIG_STAGING=y +# CONFIG_STAGING_BOARD is not set +# CONFIG_STAGING_MEDIA is not set +CONFIG_STANDALONE=y +# CONFIG_STATIC_KEYS_SELFTEST is not set +# CONFIG_STATIC_USERMODEHELPER is not set +CONFIG_STDBINUTILS=y +# CONFIG_STE10XP is not set +# CONFIG_STE_MODEM_RPROC is not set +# CONFIG_STK3310 is not set +# CONFIG_STK8312 is not set +# CONFIG_STK8BA50 is not set +# CONFIG_STM is not set +# CONFIG_STMMAC_ETH is not set +# CONFIG_STMMAC_PCI is not set +# CONFIG_STMMAC_PLATFORM is not set +# CONFIG_STM_DUMMY is not set +# CONFIG_STM_SOURCE_CONSOLE is not set +CONFIG_STP=y +# CONFIG_STREAM_PARSER is not set +# CONFIG_STRICT_DEVMEM is not set +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_STRICT_MODULE_RWX=y +# CONFIG_STRING_SELFTEST is not set +CONFIG_STRIP_ASM_SYMS=y +# CONFIG_STX104 is not set +# CONFIG_SUN4I_GPADC is not set +# CONFIG_SUNDANCE is not set +# CONFIG_SUNGEM is not set +# CONFIG_SUNRPC is not set +# CONFIG_SUNRPC_DEBUG is not set +# CONFIG_SUNRPC_GSS is not set +# CONFIG_SUNXI_SRAM is not set +# CONFIG_SUN_PARTITION is not set +# CONFIG_SURFACE_3_BUTTON is not set +# CONFIG_SUSPEND is not set +# CONFIG_SUSPEND_SKIP_SYNC is not set +CONFIG_SWAP=y +# CONFIG_SWCONFIG is not set +# CONFIG_SWCONFIG_B53 is not set +# CONFIG_SWCONFIG_B53_SPI_DRIVER is not set +# CONFIG_SWCONFIG_LEDS is not set +# CONFIG_SX9500 is not set +# CONFIG_SXGBE_ETH is not set +# CONFIG_SYNCLINK_CS is not set +# CONFIG_SYNC_FILE is not set +# CONFIG_SYNOPSYS_DWC_ETH_QOS is not set +CONFIG_SYN_COOKIES=y +# CONFIG_SYSCON_REBOOT_MODE is not set +CONFIG_SYSCTL=y +# CONFIG_SYSCTL_SYSCALL is not set +CONFIG_SYSFS=y +# CONFIG_SYSFS_DEPRECATED is not set +# CONFIG_SYSFS_DEPRECATED_V2 is not set +# CONFIG_SYSFS_SYSCALL is not set +# CONFIG_SYSTEMPORT is not set +# CONFIG_SYSTEM_BLACKLIST_KEYRING is not set +# CONFIG_SYSTEM_DATA_VERIFICATION is not set +# CONFIG_SYSTEM_TRUSTED_KEYRING is not set +CONFIG_SYSTEM_TRUSTED_KEYS="" +# CONFIG_SYSV68_PARTITION is not set +CONFIG_SYSVIPC=y +CONFIG_SYSVIPC_SYSCTL=y +# CONFIG_SYSV_FS is not set +# CONFIG_SYS_HYPERVISOR is not set +# CONFIG_T5403 is not set +# CONFIG_TARGET_CORE is not set +# CONFIG_TASKSTATS is not set +# CONFIG_TASKS_RCU is not set +# CONFIG_TASK_XACCT is not set +# CONFIG_TC35815 is not set +# CONFIG_TCG_ATMEL is not set +# CONFIG_TCG_CRB is not set +# CONFIG_TCG_INFINEON is not set +# CONFIG_TCG_NSC is not set +# CONFIG_TCG_ST33_I2C is not set +# CONFIG_TCG_TIS is not set +# CONFIG_TCG_TIS_I2C_ATMEL is not set +# CONFIG_TCG_TIS_I2C_INFINEON is not set +# CONFIG_TCG_TIS_I2C_NUVOTON is not set +# CONFIG_TCG_TIS_SPI is not set +# CONFIG_TCG_TIS_ST33ZP24_I2C is not set +# CONFIG_TCG_TIS_ST33ZP24_SPI is not set +# CONFIG_TCG_TPM is not set +# CONFIG_TCG_VTPM_PROXY is not set +# CONFIG_TCG_XEN is not set +# CONFIG_TCIC is not set +CONFIG_TCP_CONG_ADVANCED=y +# CONFIG_TCP_CONG_BBR is not set +# CONFIG_TCP_CONG_BIC is not set +# CONFIG_TCP_CONG_CDG is not set +CONFIG_TCP_CONG_CUBIC=y +# CONFIG_TCP_CONG_DCTCP is not set +# CONFIG_TCP_CONG_HSTCP is not set +# CONFIG_TCP_CONG_HTCP is not set +# CONFIG_TCP_CONG_HYBLA is not set +# CONFIG_TCP_CONG_ILLINOIS is not set +# CONFIG_TCP_CONG_LP is not set +# CONFIG_TCP_CONG_NV is not set +# CONFIG_TCP_CONG_SCALABLE is not set +# CONFIG_TCP_CONG_VEGAS is not set +# CONFIG_TCP_CONG_VENO is not set +# CONFIG_TCP_CONG_WESTWOOD is not set +# CONFIG_TCP_CONG_YEAH is not set +# CONFIG_TCP_MD5SIG is not set +# CONFIG_TCS3414 is not set +# CONFIG_TCS3472 is not set +# CONFIG_TEGRA_AHB is not set +# CONFIG_TEGRA_HOST1X is not set +# CONFIG_TEHUTI is not set +# CONFIG_TERANETICS_PHY is not set +# CONFIG_TEST_ASYNC_DRIVER_PROBE is not set +# CONFIG_TEST_BITMAP is not set +# CONFIG_TEST_BPF is not set +# CONFIG_TEST_FIRMWARE is not set +# CONFIG_TEST_HASH is not set +# CONFIG_TEST_HEXDUMP is not set +# CONFIG_TEST_KMOD is not set +# CONFIG_TEST_KSTRTOX is not set +# CONFIG_TEST_LIST_SORT is not set +# CONFIG_TEST_LKM is not set +# CONFIG_TEST_POWER is not set +# CONFIG_TEST_PRINTF is not set +# CONFIG_TEST_RHASHTABLE is not set +# CONFIG_TEST_SORT is not set +# CONFIG_TEST_STATIC_KEYS is not set +# CONFIG_TEST_STRING_HELPERS is not set +# CONFIG_TEST_SYSCTL is not set +# CONFIG_TEST_UDELAY is not set +# CONFIG_TEST_USER_COPY is not set +# CONFIG_TEST_UUID is not set +CONFIG_TEXTSEARCH=y +# CONFIG_TEXTSEARCH_BM is not set +# CONFIG_TEXTSEARCH_FSM is not set +# CONFIG_TEXTSEARCH_KMP is not set +# CONFIG_THERMAL is not set +# CONFIG_THERMAL_DEFAULT_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_DEFAULT_GOV_POWER_ALLOCATOR is not set +# CONFIG_THERMAL_DEFAULT_GOV_USER_SPACE is not set +# CONFIG_THERMAL_EMULATION is not set +# CONFIG_THERMAL_GOV_BANG_BANG is not set +# CONFIG_THERMAL_GOV_FAIR_SHARE is not set +# CONFIG_THERMAL_GOV_POWER_ALLOCATOR is not set +# CONFIG_THERMAL_GOV_USER_SPACE is not set +# CONFIG_THERMAL_HWMON is not set +# CONFIG_THERMAL_WRITABLE_TRIPS is not set +# CONFIG_THINKPAD_ACPI is not set +# CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_THUNDER_NIC_VF is not set +# CONFIG_THUNDERBOLT is not set +# CONFIG_TICK_CPU_ACCOUNTING is not set +CONFIG_TICK_ONESHOT=y +# CONFIG_TIFM_CORE is not set +# CONFIG_TIGON3 is not set +# CONFIG_TIMB_DMA is not set +CONFIG_TIMERFD=y +# CONFIG_TIMER_STATS is not set +CONFIG_TINY_RCU=y +# CONFIG_TIPC is not set +# CONFIG_TI_ADC081C is not set +# CONFIG_TI_ADC0832 is not set +# CONFIG_TI_ADC084S021 is not set +# CONFIG_TI_ADC108S102 is not set +# CONFIG_TI_ADC12138 is not set +# CONFIG_TI_ADC128S052 is not set +# CONFIG_TI_ADC161S626 is not set +# CONFIG_TI_ADS1015 is not set +# CONFIG_TI_ADS7950 is not set +# CONFIG_TI_ADS8688 is not set +# CONFIG_TI_AM335X_ADC is not set +# CONFIG_TI_CPSW is not set +# CONFIG_TI_CPSW_ALE is not set +# CONFIG_TI_CPTS is not set +# CONFIG_TI_DAC7512 is not set +# CONFIG_TI_DAVINCI_CPDMA is not set +# CONFIG_TI_DAVINCI_MDIO is not set +# CONFIG_TI_ST is not set +# CONFIG_TI_SYSCON_RESET is not set +# CONFIG_TI_TLC4541 is not set +# CONFIG_TLAN is not set +# CONFIG_TLS is not set +# CONFIG_TMD_HERMES is not set +# CONFIG_TMP006 is not set +# CONFIG_TMP007 is not set +CONFIG_TMPFS=y +# CONFIG_TMPFS_POSIX_ACL is not set +CONFIG_TMPFS_XATTR=y +# CONFIG_TOPSTAR_LAPTOP is not set +# CONFIG_TORTURE_TEST is not set +# CONFIG_TOSHIBA_HAPS is not set +# CONFIG_TOUCHSCREEN_AD7877 is not set +# CONFIG_TOUCHSCREEN_AD7879 is not set +# CONFIG_TOUCHSCREEN_AD7879_I2C is not set +# CONFIG_TOUCHSCREEN_AD7879_SPI is not set +# CONFIG_TOUCHSCREEN_ADS7846 is not set +# CONFIG_TOUCHSCREEN_AR1021_I2C is not set +# CONFIG_TOUCHSCREEN_ATMEL_MXT is not set +# CONFIG_TOUCHSCREEN_AUO_PIXCIR is not set +# CONFIG_TOUCHSCREEN_BU21013 is not set +# CONFIG_TOUCHSCREEN_CHIPONE_ICN8318 is not set +# CONFIG_TOUCHSCREEN_CY8CTMG110 is not set +# CONFIG_TOUCHSCREEN_CYTTSP4_CORE is not set +# CONFIG_TOUCHSCREEN_CYTTSP_CORE is not set +# CONFIG_TOUCHSCREEN_DYNAPRO is not set +# CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set +# CONFIG_TOUCHSCREEN_EETI is not set +# CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set +# CONFIG_TOUCHSCREEN_ELAN is not set +# CONFIG_TOUCHSCREEN_ELO is not set +# CONFIG_TOUCHSCREEN_FT6236 is not set +# CONFIG_TOUCHSCREEN_FUJITSU is not set +# CONFIG_TOUCHSCREEN_GOODIX is not set +# CONFIG_TOUCHSCREEN_GUNZE is not set +# CONFIG_TOUCHSCREEN_HAMPSHIRE is not set +# CONFIG_TOUCHSCREEN_ILI210X is not set +# CONFIG_TOUCHSCREEN_IMX6UL_TSC is not set +# CONFIG_TOUCHSCREEN_INEXIO is not set +# CONFIG_TOUCHSCREEN_MAX11801 is not set +# CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set +# CONFIG_TOUCHSCREEN_MK712 is not set +# CONFIG_TOUCHSCREEN_MMS114 is not set +# CONFIG_TOUCHSCREEN_MTOUCH is not set +# CONFIG_TOUCHSCREEN_PENMOUNT is not set +# CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set +# CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set +# CONFIG_TOUCHSCREEN_S3C2410 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set +# CONFIG_TOUCHSCREEN_ST1232 is not set +# CONFIG_TOUCHSCREEN_STMFTS is not set +# CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set +# CONFIG_TOUCHSCREEN_SX8654 is not set +# CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set +# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set +# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set +# CONFIG_TOUCHSCREEN_TOUCHWIN is not set +# CONFIG_TOUCHSCREEN_TPS6507X is not set +# CONFIG_TOUCHSCREEN_TSC2004 is not set +# CONFIG_TOUCHSCREEN_TSC2005 is not set +# CONFIG_TOUCHSCREEN_TSC2007 is not set +# CONFIG_TOUCHSCREEN_TSC_SERIO is not set +# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set +# CONFIG_TOUCHSCREEN_W90X900 is not set +# CONFIG_TOUCHSCREEN_WACOM_I2C is not set +# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set +# CONFIG_TOUCHSCREEN_WDT87XX_I2C is not set +# CONFIG_TOUCHSCREEN_WM97XX is not set +# CONFIG_TOUCHSCREEN_ZET6223 is not set +# CONFIG_TOUCHSCREEN_ZFORCE is not set +# CONFIG_TPL0102 is not set +# CONFIG_TPS6105X is not set +# CONFIG_TPS65010 is not set +# CONFIG_TPS6507X is not set +# CONFIG_TRACEPOINT_BENCHMARK is not set +# CONFIG_TRACER_SNAPSHOT is not set +# CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP is not set +# CONFIG_TRACE_BRANCH_PROFILING is not set +# CONFIG_TRACE_ENUM_MAP_FILE is not set +CONFIG_TRACE_IRQFLAGS_SUPPORT=y +# CONFIG_TRACE_SINK is not set +# CONFIG_TRACING_EVENTS_GPIO is not set +CONFIG_TRACING_SUPPORT=y +CONFIG_TRAD_SIGNALS=y +# CONFIG_TRANSPARENT_HUGEPAGE is not set +# CONFIG_TREE_RCU is not set +# CONFIG_TREE_RCU_TRACE is not set +# CONFIG_TRIM_UNUSED_KSYMS is not set +# CONFIG_TRUSTED_KEYS is not set +# CONFIG_TSL2583 is not set +# CONFIG_TSL2x7x is not set +# CONFIG_TSL4531 is not set +# CONFIG_TSYS01 is not set +# CONFIG_TSYS02D is not set +# CONFIG_TTPCI_EEPROM is not set +CONFIG_TTY=y +# CONFIG_TTY_PRINTK is not set +# CONFIG_TUN is not set +# CONFIG_TUN_VNET_CROSS_LE is not set +# CONFIG_TWL4030_CORE is not set +# CONFIG_TWL4030_MADC is not set +# CONFIG_TWL6030_GPADC is not set +# CONFIG_TWL6040_CORE is not set +# CONFIG_TYPEC_TCPM is not set +# CONFIG_TYPEC_UCSI is not set +# CONFIG_TYPHOON is not set +# CONFIG_UACCESS_WITH_MEMCPY is not set +# CONFIG_UBIFS_ATIME_SUPPORT is not set +# CONFIG_UBIFS_FS_ENCRYPTION is not set +# CONFIG_UBIFS_FS_SECURITY is not set +# CONFIG_UBSAN is not set +# CONFIG_UCB1400_CORE is not set +# CONFIG_UCSI is not set +# CONFIG_UDF_FS is not set +CONFIG_UDF_NLS=y +CONFIG_UEVENT_HELPER=y +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" +# CONFIG_UFS_FS is not set +# CONFIG_UHID is not set +CONFIG_UID16=y +# CONFIG_UIO is not set +# CONFIG_ULTRA is not set +# CONFIG_ULTRIX_PARTITION is not set +CONFIG_UNIX=y +CONFIG_UNIX98_PTYS=y +# CONFIG_UNIXWARE_DISKLABEL is not set +# CONFIG_UNIX_DIAG is not set +# CONFIG_UNUSED_SYMBOLS is not set +# CONFIG_UPROBES is not set +# CONFIG_UPROBE_EVENT is not set +# CONFIG_US5182D is not set +# CONFIG_USB is not set +# CONFIG_USBIP_CORE is not set +CONFIG_USBIP_VHCI_HC_PORTS=8 +CONFIG_USBIP_VHCI_NR_HCS=1 +# CONFIG_USBIP_VUDC is not set +# CONFIG_USBPCWATCHDOG is not set +# CONFIG_USB_ACM is not set +# CONFIG_USB_ADUTUX is not set +CONFIG_USB_ALI_M5632=y +# CONFIG_USB_AMD5536UDC is not set +CONFIG_USB_AN2720=y +# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set +# CONFIG_USB_APPLEDISPLAY is not set +CONFIG_USB_ARCH_HAS_HCD=y +CONFIG_USB_ARMLINUX=y +# CONFIG_USB_ATM is not set +# CONFIG_USB_BDC_UDC is not set +CONFIG_USB_BELKIN=y +# CONFIG_USB_C67X00_HCD is not set +# CONFIG_USB_CATC is not set +# CONFIG_USB_CDC_COMPOSITE is not set +# CONFIG_USB_CHAOSKEY is not set +# CONFIG_USB_CHIPIDEA is not set +# CONFIG_USB_CONFIGFS is not set +# CONFIG_USB_CXACRU is not set +# CONFIG_USB_CYPRESS_CY7C63 is not set +# CONFIG_USB_CYTHERM is not set +CONFIG_USB_DEFAULT_PERSIST=y +# CONFIG_USB_DSBR is not set +# CONFIG_USB_DUMMY_HCD is not set +# CONFIG_USB_DWC2 is not set +# CONFIG_USB_DWC2_DEBUG is not set +# CONFIG_USB_DWC2_DUAL_ROLE is not set +# CONFIG_USB_DWC2_HOST is not set +# CONFIG_USB_DWC2_PERIPHERAL is not set +# CONFIG_USB_DWC3 is not set +# CONFIG_USB_DWC3_EXYNOS is not set +# CONFIG_USB_DWC3_KEYSTONE is not set +# CONFIG_USB_DWC3_OF_SIMPLE is not set +# CONFIG_USB_DWC3_PCI is not set +# CONFIG_USB_DWC3_QCOM is not set +# CONFIG_USB_DYNAMIC_MINORS is not set +# CONFIG_USB_EG20T is not set +# CONFIG_USB_EHCI_ATH79 is not set +# CONFIG_USB_EHCI_HCD_AT91 is not set +# CONFIG_USB_EHCI_HCD_OMAP is not set +# CONFIG_USB_EHCI_HCD_PPC_OF is not set +# CONFIG_USB_EHCI_MSM is not set +# CONFIG_USB_EHCI_MV is not set +CONFIG_USB_EHCI_ROOT_HUB_TT=y +CONFIG_USB_EHCI_TT_NEWSCHED=y +# CONFIG_USB_EHSET_TEST_FIXTURE is not set +# CONFIG_USB_EMI26 is not set +# CONFIG_USB_EMI62 is not set +# CONFIG_USB_EPSON2888 is not set +# CONFIG_USB_EZUSB_FX2 is not set +# CONFIG_USB_FOTG210_HCD is not set +# CONFIG_USB_FOTG210_UDC is not set +# CONFIG_USB_FSL_USB2 is not set +# CONFIG_USB_FTDI_ELAN is not set +# CONFIG_USB_FUNCTIONFS is not set +# CONFIG_USB_FUSB300 is not set +# CONFIG_USB_GADGET is not set +# CONFIG_USB_GADGETFS is not set +# CONFIG_USB_GADGET_DEBUG is not set +# CONFIG_USB_GADGET_DEBUG_FILES is not set +# CONFIG_USB_GADGET_DEBUG_FS is not set +CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2 +CONFIG_USB_GADGET_VBUS_DRAW=2 +# CONFIG_USB_GADGET_XILINX is not set +# CONFIG_USB_GL860 is not set +# CONFIG_USB_GOKU is not set +# CONFIG_USB_GPIO_VBUS is not set +# CONFIG_USB_GR_UDC is not set +# CONFIG_USB_GSPCA is not set +# CONFIG_USB_GSPCA_BENQ is not set +# CONFIG_USB_GSPCA_CONEX is not set +# CONFIG_USB_GSPCA_CPIA1 is not set +# CONFIG_USB_GSPCA_DTCS033 is not set +# CONFIG_USB_GSPCA_ETOMS is not set +# CONFIG_USB_GSPCA_FINEPIX is not set +# CONFIG_USB_GSPCA_JEILINJ is not set +# CONFIG_USB_GSPCA_JL2005BCD is not set +# CONFIG_USB_GSPCA_KINECT is not set +# CONFIG_USB_GSPCA_KONICA is not set +# CONFIG_USB_GSPCA_MARS is not set +# CONFIG_USB_GSPCA_MR97310A is not set +# CONFIG_USB_GSPCA_NW80X is not set +# CONFIG_USB_GSPCA_OV519 is not set +# CONFIG_USB_GSPCA_OV534 is not set +# CONFIG_USB_GSPCA_OV534_9 is not set +# CONFIG_USB_GSPCA_PAC207 is not set +# CONFIG_USB_GSPCA_PAC7302 is not set +# CONFIG_USB_GSPCA_PAC7311 is not set +# CONFIG_USB_GSPCA_SE401 is not set +# CONFIG_USB_GSPCA_SN9C2028 is not set +# CONFIG_USB_GSPCA_SN9C20X is not set +# CONFIG_USB_GSPCA_SONIXB is not set +# CONFIG_USB_GSPCA_SONIXJ is not set +# CONFIG_USB_GSPCA_SPCA1528 is not set +# CONFIG_USB_GSPCA_SPCA500 is not set +# CONFIG_USB_GSPCA_SPCA501 is not set +# CONFIG_USB_GSPCA_SPCA505 is not set +# CONFIG_USB_GSPCA_SPCA506 is not set +# CONFIG_USB_GSPCA_SPCA508 is not set +# CONFIG_USB_GSPCA_SPCA561 is not set +# CONFIG_USB_GSPCA_SQ905 is not set +# CONFIG_USB_GSPCA_SQ905C is not set +# CONFIG_USB_GSPCA_SQ930X is not set +# CONFIG_USB_GSPCA_STK014 is not set +# CONFIG_USB_GSPCA_STK1135 is not set +# CONFIG_USB_GSPCA_STV0680 is not set +# CONFIG_USB_GSPCA_SUNPLUS is not set +# CONFIG_USB_GSPCA_T613 is not set +# CONFIG_USB_GSPCA_TOPRO is not set +# CONFIG_USB_GSPCA_TOUPTEK is not set +# CONFIG_USB_GSPCA_TV8532 is not set +# CONFIG_USB_GSPCA_VC032X is not set +# CONFIG_USB_GSPCA_VICAM is not set +# CONFIG_USB_GSPCA_XIRLINK_CIT is not set +# CONFIG_USB_GSPCA_ZC3XX is not set +# CONFIG_USB_G_ACM_MS is not set +# CONFIG_USB_G_DBGP is not set +# CONFIG_USB_G_HID is not set +# CONFIG_USB_G_MULTI is not set +# CONFIG_USB_G_NCM is not set +# CONFIG_USB_G_NOKIA is not set +# CONFIG_USB_G_PRINTER is not set +# CONFIG_USB_G_SERIAL is not set +# CONFIG_USB_G_WEBCAM is not set +# CONFIG_USB_HCD_TEST_MODE is not set +# CONFIG_USB_HID is not set +# CONFIG_USB_HIDDEV is not set +# CONFIG_USB_HSIC_USB3503 is not set +# CONFIG_USB_HSIC_USB4604 is not set +# CONFIG_USB_HSO is not set +# CONFIG_USB_HUB_USB251XB is not set +# CONFIG_USB_HWA_HCD is not set +# CONFIG_USB_IDMOUSE is not set +# CONFIG_USB_IOWARRIOR is not set +# CONFIG_USB_IPHETH is not set +# CONFIG_USB_ISIGHTFW is not set +# CONFIG_USB_ISP116X_HCD is not set +# CONFIG_USB_ISP1301 is not set +# CONFIG_USB_ISP1362_HCD is not set +# CONFIG_USB_ISP1760 is not set +# CONFIG_USB_ISP1760_HCD is not set +# CONFIG_USB_KAWETH is not set +# CONFIG_USB_KBD is not set +# CONFIG_USB_KC2190 is not set +# CONFIG_USB_LAN78XX is not set +# CONFIG_USB_LCD is not set +# CONFIG_USB_LD is not set +# CONFIG_USB_LED is not set +# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set +# CONFIG_USB_LED_TRIG is not set +# CONFIG_USB_LEGOTOWER is not set +# CONFIG_USB_LINK_LAYER_TEST is not set +# CONFIG_USB_M5602 is not set +# CONFIG_USB_M66592 is not set +# CONFIG_USB_MASS_STORAGE is not set +# CONFIG_USB_MAX3421_HCD is not set +# CONFIG_USB_MDC800 is not set +# CONFIG_USB_MICROTEK is not set +# CONFIG_USB_MIDI_GADGET is not set +# CONFIG_USB_MON is not set +# CONFIG_USB_MOUSE is not set +# CONFIG_USB_MSM_OTG is not set +# CONFIG_USB_MUSB_HDRC is not set +# CONFIG_USB_MV_U3D is not set +# CONFIG_USB_MV_UDC is not set +# CONFIG_USB_MXS_PHY is not set +# CONFIG_USB_NET2272 is not set +# CONFIG_USB_NET2280 is not set +# CONFIG_USB_NET_AX88179_178A is not set +# CONFIG_USB_NET_AX8817X is not set +# CONFIG_USB_NET_CDCETHER is not set +# CONFIG_USB_NET_CDC_EEM is not set +# CONFIG_USB_NET_CDC_MBIM is not set +# CONFIG_USB_NET_CDC_NCM is not set +# CONFIG_USB_NET_CDC_SUBSET is not set +# CONFIG_USB_NET_CH9200 is not set +# CONFIG_USB_NET_CX82310_ETH is not set +# CONFIG_USB_NET_DM9601 is not set +# CONFIG_USB_NET_DRIVERS is not set +# CONFIG_USB_NET_GL620A is not set +# CONFIG_USB_NET_HUAWEI_CDC_NCM is not set +# CONFIG_USB_NET_INT51X1 is not set +# CONFIG_USB_NET_KALMIA is not set +# CONFIG_USB_NET_MCS7830 is not set +# CONFIG_USB_NET_NET1080 is not set +# CONFIG_USB_NET_PLUSB is not set +# CONFIG_USB_NET_QMI_WWAN is not set +# CONFIG_USB_NET_RNDIS_HOST is not set +# CONFIG_USB_NET_RNDIS_WLAN is not set +# CONFIG_USB_NET_SMSC75XX is not set +# CONFIG_USB_NET_SMSC95XX is not set +# CONFIG_USB_NET_SR9700 is not set +# CONFIG_USB_NET_SR9800 is not set +# CONFIG_USB_NET_ZAURUS is not set +# CONFIG_USB_OHCI_HCD is not set +# CONFIG_USB_OHCI_HCD_PCI is not set +# CONFIG_USB_OHCI_HCD_PPC_OF is not set +# CONFIG_USB_OHCI_HCD_PPC_OF_BE is not set +# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set +# CONFIG_USB_OHCI_HCD_SSB is not set +CONFIG_USB_OHCI_LITTLE_ENDIAN=y +# CONFIG_USB_OTG is not set +# CONFIG_USB_OTG_BLACKLIST_HUB is not set +# CONFIG_USB_OTG_FSM is not set +# CONFIG_USB_OTG_WHITELIST is not set +# CONFIG_USB_OXU210HP_HCD is not set +# CONFIG_USB_PCI is not set +# CONFIG_USB_PEGASUS is not set +# CONFIG_USB_PHY is not set +# CONFIG_USB_PRINTER is not set +# CONFIG_USB_PWC_INPUT_EVDEV is not set +# CONFIG_USB_PXA27X is not set +# CONFIG_USB_R8A66597 is not set +# CONFIG_USB_R8A66597_HCD is not set +# CONFIG_USB_RCAR_PHY is not set +# CONFIG_USB_RENESAS_USBHS is not set +# CONFIG_USB_RIO500 is not set +# CONFIG_USB_RTL8150 is not set +# CONFIG_USB_RTL8152 is not set +# CONFIG_USB_S2255 is not set +# CONFIG_USB_SERIAL is not set +# CONFIG_USB_SERIAL_AIRCABLE is not set +# CONFIG_USB_SERIAL_ARK3116 is not set +# CONFIG_USB_SERIAL_BELKIN is not set +# CONFIG_USB_SERIAL_CH341 is not set +# CONFIG_USB_SERIAL_CP210X is not set +# CONFIG_USB_SERIAL_CYBERJACK is not set +# CONFIG_USB_SERIAL_CYPRESS_M8 is not set +# CONFIG_USB_SERIAL_DEBUG is not set +# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT is not set +# CONFIG_USB_SERIAL_EDGEPORT_TI is not set +# CONFIG_USB_SERIAL_EMPEG is not set +# CONFIG_USB_SERIAL_F81232 is not set +# CONFIG_USB_SERIAL_F8153X is not set +# CONFIG_USB_SERIAL_FTDI_SIO is not set +# CONFIG_USB_SERIAL_GARMIN is not set +CONFIG_USB_SERIAL_GENERIC=y +# CONFIG_USB_SERIAL_IPAQ is not set +# CONFIG_USB_SERIAL_IPW is not set +# CONFIG_USB_SERIAL_IR is not set +# CONFIG_USB_SERIAL_IUU is not set +# CONFIG_USB_SERIAL_KEYSPAN is not set +CONFIG_USB_SERIAL_KEYSPAN_MPR=y +# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set +CONFIG_USB_SERIAL_KEYSPAN_USA18X=y +CONFIG_USB_SERIAL_KEYSPAN_USA19=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y +CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y +CONFIG_USB_SERIAL_KEYSPAN_USA19W=y +CONFIG_USB_SERIAL_KEYSPAN_USA28=y +CONFIG_USB_SERIAL_KEYSPAN_USA28X=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y +CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y +CONFIG_USB_SERIAL_KEYSPAN_USA49W=y +CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y +# CONFIG_USB_SERIAL_KLSI is not set +# CONFIG_USB_SERIAL_KOBIL_SCT is not set +# CONFIG_USB_SERIAL_MCT_U232 is not set +# CONFIG_USB_SERIAL_METRO is not set +# CONFIG_USB_SERIAL_MOS7715_PARPORT is not set +# CONFIG_USB_SERIAL_MOS7720 is not set +# CONFIG_USB_SERIAL_MOS7840 is not set +# CONFIG_USB_SERIAL_MXUPORT is not set +# CONFIG_USB_SERIAL_NAVMAN is not set +# CONFIG_USB_SERIAL_OMNINET is not set +# CONFIG_USB_SERIAL_OPTICON is not set +# CONFIG_USB_SERIAL_OPTION is not set +# CONFIG_USB_SERIAL_OTI6858 is not set +# CONFIG_USB_SERIAL_PL2303 is not set +# CONFIG_USB_SERIAL_QCAUX is not set +# CONFIG_USB_SERIAL_QT2 is not set +# CONFIG_USB_SERIAL_QUALCOMM is not set +# CONFIG_USB_SERIAL_SAFE is not set +CONFIG_USB_SERIAL_SAFE_PADDED=y +# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set +# CONFIG_USB_SERIAL_SIMPLE is not set +# CONFIG_USB_SERIAL_SPCP8X5 is not set +# CONFIG_USB_SERIAL_SSU100 is not set +# CONFIG_USB_SERIAL_SYMBOL is not set +# CONFIG_USB_SERIAL_TI is not set +# CONFIG_USB_SERIAL_UPD78F0730 is not set +# CONFIG_USB_SERIAL_VISOR is not set +# CONFIG_USB_SERIAL_WHITEHEAT is not set +# CONFIG_USB_SERIAL_WISHBONE is not set +# CONFIG_USB_SERIAL_XIRCOM is not set +# CONFIG_USB_SERIAL_XSENS_MT is not set +# CONFIG_USB_SEVSEG is not set +# CONFIG_USB_SIERRA_NET is not set +# CONFIG_USB_SISUSBVGA is not set +# CONFIG_USB_SL811_HCD is not set +# CONFIG_USB_SNP_UDC_PLAT is not set +# CONFIG_USB_SPEEDTOUCH is not set +# CONFIG_USB_STKWEBCAM is not set +# CONFIG_USB_STORAGE is not set +# CONFIG_USB_STORAGE_ALAUDA is not set +# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set +# CONFIG_USB_STORAGE_DATAFAB is not set +# CONFIG_USB_STORAGE_DEBUG is not set +# CONFIG_USB_STORAGE_ENE_UB6250 is not set +# CONFIG_USB_STORAGE_FREECOM is not set +# CONFIG_USB_STORAGE_ISD200 is not set +# CONFIG_USB_STORAGE_JUMPSHOT is not set +# CONFIG_USB_STORAGE_KARMA is not set +# CONFIG_USB_STORAGE_ONETOUCH is not set +# CONFIG_USB_STORAGE_REALTEK is not set +# CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set +# CONFIG_USB_STORAGE_USBAT is not set +# CONFIG_USB_STV06XX is not set +# CONFIG_USB_SUPPORT is not set +# CONFIG_USB_SWITCH_FSA9480 is not set +# CONFIG_USB_TEST is not set +# CONFIG_USB_TMC is not set +# CONFIG_USB_TRANCEVIBRATOR is not set +# CONFIG_USB_UAS is not set +# CONFIG_USB_UEAGLEATM is not set +# CONFIG_USB_ULPI is not set +# CONFIG_USB_ULPI_BUS is not set +# CONFIG_USB_USBNET is not set +# CONFIG_USB_USS720 is not set +# CONFIG_USB_VIDEO_CLASS is not set +CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV=y +# CONFIG_USB_VL600 is not set +# CONFIG_USB_WDM is not set +# CONFIG_USB_WHCI_HCD is not set +# CONFIG_USB_WUSB is not set +# CONFIG_USB_WUSB_CBAF is not set +# CONFIG_USB_XHCI_HCD is not set +# CONFIG_USB_XUSBATM is not set +# CONFIG_USB_YUREX is not set +# CONFIG_USB_ZD1201 is not set +# CONFIG_USB_ZERO is not set +# CONFIG_USB_ZR364XX is not set +# CONFIG_USELIB is not set +# CONFIG_USERFAULTFD is not set +# CONFIG_USE_OF is not set +# CONFIG_UTS_NS is not set +# CONFIG_UWB is not set +# CONFIG_U_SERIAL_CONSOLE is not set +# CONFIG_V4L_MEM2MEM_DRIVERS is not set +# CONFIG_V4L_TEST_DRIVERS is not set +# CONFIG_VCNL4000 is not set +# CONFIG_VDSO is not set +# CONFIG_VEML6070 is not set +# CONFIG_VETH is not set +# CONFIG_VEXPRESS_CONFIG is not set +# CONFIG_VF610_ADC is not set +# CONFIG_VF610_DAC is not set +# CONFIG_VFAT_FS is not set +# CONFIG_VGASTATE is not set +# CONFIG_VGA_ARB is not set +# CONFIG_VGA_SWITCHEROO is not set +# CONFIG_VHOST_CROSS_ENDIAN_LEGACY is not set +# CONFIG_VHOST_NET is not set +# CONFIG_VHOST_VSOCK is not set +# CONFIG_VIA_RHINE is not set +# CONFIG_VIA_VELOCITY is not set +# CONFIG_VIDEO_ADV7170 is not set +# CONFIG_VIDEO_ADV7175 is not set +# CONFIG_VIDEO_ADV7180 is not set +# CONFIG_VIDEO_ADV7183 is not set +# CONFIG_VIDEO_ADV7343 is not set +# CONFIG_VIDEO_ADV7393 is not set +# CONFIG_VIDEO_ADV_DEBUG is not set +# CONFIG_VIDEO_AK881X is not set +# CONFIG_VIDEO_BT819 is not set +# CONFIG_VIDEO_BT848 is not set +# CONFIG_VIDEO_BT856 is not set +# CONFIG_VIDEO_BT866 is not set +# CONFIG_VIDEO_CAFE_CCIC is not set +# CONFIG_VIDEO_CS3308 is not set +# CONFIG_VIDEO_CS5345 is not set +# CONFIG_VIDEO_CS53L32A is not set +# CONFIG_VIDEO_CX231XX is not set +# CONFIG_VIDEO_CX2341X is not set +# CONFIG_VIDEO_CX25840 is not set +# CONFIG_VIDEO_CX88 is not set +# CONFIG_VIDEO_DEV is not set +# CONFIG_VIDEO_DM6446_CCDC is not set +# CONFIG_VIDEO_DT3155 is not set +# CONFIG_VIDEO_EM28XX is not set +# CONFIG_VIDEO_FIXED_MINOR_RANGES is not set +# CONFIG_VIDEO_GO7007 is not set +# CONFIG_VIDEO_HDPVR is not set +# CONFIG_VIDEO_HEXIUM_GEMINI is not set +# CONFIG_VIDEO_HEXIUM_ORION is not set +# CONFIG_VIDEO_IR_I2C is not set +# CONFIG_VIDEO_IVTV is not set +# CONFIG_VIDEO_KS0127 is not set +# CONFIG_VIDEO_M52790 is not set +# CONFIG_VIDEO_ML86V7667 is not set +# CONFIG_VIDEO_MSP3400 is not set +# CONFIG_VIDEO_MT9M111 is not set +# CONFIG_VIDEO_MT9V011 is not set +# CONFIG_VIDEO_MXB is not set +# CONFIG_VIDEO_NOON010PC30 is not set +# CONFIG_VIDEO_OMAP2_VOUT is not set +# CONFIG_VIDEO_OV2640 is not set +# CONFIG_VIDEO_OV2659 is not set +# CONFIG_VIDEO_OV6650 is not set +# CONFIG_VIDEO_OV7640 is not set +# CONFIG_VIDEO_OV7670 is not set +# CONFIG_VIDEO_PVRUSB2 is not set +# CONFIG_VIDEO_SAA6588 is not set +# CONFIG_VIDEO_SAA6752HS is not set +# CONFIG_VIDEO_SAA7110 is not set +# CONFIG_VIDEO_SAA711X is not set +# CONFIG_VIDEO_SAA7127 is not set +# CONFIG_VIDEO_SAA7134 is not set +# CONFIG_VIDEO_SAA717X is not set +# CONFIG_VIDEO_SAA7185 is not set +# CONFIG_VIDEO_SH_MOBILE_CEU is not set +# CONFIG_VIDEO_SONY_BTF_MPX is not set +# CONFIG_VIDEO_SR030PC30 is not set +# CONFIG_VIDEO_TDA7432 is not set +# CONFIG_VIDEO_TDA9840 is not set +# CONFIG_VIDEO_TEA6415C is not set +# CONFIG_VIDEO_TEA6420 is not set +# CONFIG_VIDEO_THS7303 is not set +# CONFIG_VIDEO_THS8200 is not set +# CONFIG_VIDEO_TIMBERDALE is not set +# CONFIG_VIDEO_TLV320AIC23B is not set +# CONFIG_VIDEO_TM6000 is not set +# CONFIG_VIDEO_TVAUDIO is not set +# CONFIG_VIDEO_TVP514X is not set +# CONFIG_VIDEO_TVP5150 is not set +# CONFIG_VIDEO_TVP7002 is not set +# CONFIG_VIDEO_TW2804 is not set +# CONFIG_VIDEO_TW9903 is not set +# CONFIG_VIDEO_TW9906 is not set +# CONFIG_VIDEO_UDA1342 is not set +# CONFIG_VIDEO_UPD64031A is not set +# CONFIG_VIDEO_UPD64083 is not set +# CONFIG_VIDEO_USBTV is not set +# CONFIG_VIDEO_USBVISION is not set +# CONFIG_VIDEO_V4L2 is not set +# CONFIG_VIDEO_VP27SMPX is not set +# CONFIG_VIDEO_VPX3220 is not set +# CONFIG_VIDEO_VS6624 is not set +# CONFIG_VIDEO_WM8739 is not set +# CONFIG_VIDEO_WM8775 is not set +# CONFIG_VIDEO_ZORAN is not set +# CONFIG_VIRTIO_BALLOON is not set +# CONFIG_VIRTIO_BLK_SCSI is not set +# CONFIG_VIRTIO_INPUT is not set +# CONFIG_VIRTIO_MMIO is not set +# CONFIG_VIRTIO_PCI is not set +# CONFIG_VIRTUALIZATION is not set +# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set +# CONFIG_VIRT_DRIVERS is not set +CONFIG_VIRT_TO_BUS=y +# CONFIG_VITESSE_PHY is not set +# CONFIG_VL6180 is not set +CONFIG_VLAN_8021Q=y +# CONFIG_VLAN_8021Q_GVRP is not set +# CONFIG_VLAN_8021Q_MVRP is not set +# CONFIG_VME_BUS is not set +# CONFIG_VMSPLIT_1G is not set +# CONFIG_VMSPLIT_2G is not set +# CONFIG_VMSPLIT_2G_OPT is not set +CONFIG_VMSPLIT_3G=y +# CONFIG_VMSPLIT_3G_OPT is not set +# CONFIG_VMWARE_PVSCSI is not set +# CONFIG_VMXNET3 is not set +# CONFIG_VM_EVENT_COUNTERS is not set +# CONFIG_VOP_BUS is not set +# CONFIG_VORTEX is not set +# CONFIG_VSOCKETS is not set +# CONFIG_VT is not set +# CONFIG_VT6655 is not set +# CONFIG_VT6656 is not set +# CONFIG_VXFS_FS is not set +# CONFIG_VXGE is not set +# CONFIG_VXLAN is not set +# CONFIG_VZ89X is not set +# CONFIG_W1 is not set +# CONFIG_W1_CON is not set +# CONFIG_W1_MASTER_DS1WM is not set +# CONFIG_W1_MASTER_DS2482 is not set +# CONFIG_W1_MASTER_DS2490 is not set +# CONFIG_W1_MASTER_GPIO is not set +# CONFIG_W1_MASTER_MATROX is not set +# CONFIG_W1_SLAVE_BQ27000 is not set +# CONFIG_W1_SLAVE_DS2405 is not set +# CONFIG_W1_SLAVE_DS2406 is not set +# CONFIG_W1_SLAVE_DS2408 is not set +# CONFIG_W1_SLAVE_DS2413 is not set +# CONFIG_W1_SLAVE_DS2423 is not set +# CONFIG_W1_SLAVE_DS2431 is not set +# CONFIG_W1_SLAVE_DS2433 is not set +# CONFIG_W1_SLAVE_DS2438 is not set +# CONFIG_W1_SLAVE_DS2760 is not set +# CONFIG_W1_SLAVE_DS2780 is not set +# CONFIG_W1_SLAVE_DS2781 is not set +# CONFIG_W1_SLAVE_DS2805 is not set +# CONFIG_W1_SLAVE_DS28E04 is not set +# CONFIG_W1_SLAVE_SMEM is not set +# CONFIG_W1_SLAVE_THERM is not set +# CONFIG_W83627HF_WDT is not set +# CONFIG_W83877F_WDT is not set +# CONFIG_W83977F_WDT is not set +# CONFIG_WAN is not set +# CONFIG_WANXL is not set +# CONFIG_WARN_ALL_UNSEEDED_RANDOM is not set +CONFIG_WATCHDOG=y +# CONFIG_WATCHDOG_CORE is not set +CONFIG_WATCHDOG_HANDLE_BOOT_ENABLED=y +# CONFIG_WATCHDOG_NOWAYOUT is not set +# CONFIG_WATCHDOG_PRETIMEOUT_GOV is not set +# CONFIG_WATCHDOG_SYSFS is not set +# CONFIG_WD80x3 is not set +# CONFIG_WDAT_WDT is not set +# CONFIG_WDTPCI is not set +CONFIG_WEXT_CORE=y +CONFIG_WEXT_PRIV=y +CONFIG_WEXT_PROC=y +CONFIG_WEXT_SPY=y +CONFIG_WILINK_PLATFORM_DATA=y +# CONFIG_WIMAX is not set +# CONFIG_WIMAX_GDM72XX is not set +CONFIG_WIRELESS=y +CONFIG_WIRELESS_EXT=y +# CONFIG_WIRELESS_WDS is not set +# CONFIG_WIZNET_W5100 is not set +# CONFIG_WIZNET_W5300 is not set +# CONFIG_WL1251 is not set +# CONFIG_WL12XX is not set +# CONFIG_WL18XX is not set +CONFIG_WLAN=y +# CONFIG_WLAN_VENDOR_ADMTEK is not set +# CONFIG_WLAN_VENDOR_ATH is not set +# CONFIG_WLAN_VENDOR_ATMEL is not set +# CONFIG_WLAN_VENDOR_BROADCOM is not set +# CONFIG_WLAN_VENDOR_CISCO is not set +# CONFIG_WLAN_VENDOR_INTEL is not set +# CONFIG_WLAN_VENDOR_INTERSIL is not set +# CONFIG_WLAN_VENDOR_MARVELL is not set +# CONFIG_WLAN_VENDOR_MEDIATEK is not set +# CONFIG_WLAN_VENDOR_QUANTENNA is not set +# CONFIG_WLAN_VENDOR_RALINK is not set +# CONFIG_WLAN_VENDOR_REALTEK is not set +# CONFIG_WLAN_VENDOR_RSI is not set +# CONFIG_WLAN_VENDOR_ST is not set +# CONFIG_WLAN_VENDOR_TI is not set +# CONFIG_WLAN_VENDOR_ZYDAS is not set +# CONFIG_WLCORE is not set +# CONFIG_WL_MEDIATEK is not set +CONFIG_WL_TI=y +CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y +# CONFIG_WQ_WATCHDOG is not set +# CONFIG_WW_MUTEX_SELFTEST is not set +# CONFIG_X25 is not set +# CONFIG_X509_CERTIFICATE_PARSER is not set +# CONFIG_X86_DEBUG_STATIC_CPU_HAS is not set +# CONFIG_X86_PKG_TEMP_THERMAL is not set +CONFIG_X86_SYSFB=y +# CONFIG_XEN is not set +CONFIG_XFRM=y +# CONFIG_XFRM_IPCOMP is not set +# CONFIG_XFRM_MIGRATE is not set +# CONFIG_XFRM_STATISTICS is not set +# CONFIG_XFRM_SUB_POLICY is not set +# CONFIG_XFRM_USER is not set +# CONFIG_XFS_DEBUG is not set +# CONFIG_XFS_FS is not set +# CONFIG_XFS_POSIX_ACL is not set +# CONFIG_XFS_QUOTA is not set +# CONFIG_XFS_RT is not set +# CONFIG_XFS_WARN is not set +# CONFIG_XILINX_AXI_EMAC is not set +# CONFIG_XILINX_DMA is not set +# CONFIG_XILINX_EMACLITE is not set +# CONFIG_XILINX_GMII2RGMII is not set +# CONFIG_XILINX_LL_TEMAC is not set +# CONFIG_XILINX_WATCHDOG is not set +# CONFIG_XILINX_ZYNQMP_DMA is not set +# CONFIG_XILLYBUS is not set +# CONFIG_XIP_KERNEL is not set +# CONFIG_XMON is not set +CONFIG_XZ_DEC=y +# CONFIG_XZ_DEC_ARM is not set +# CONFIG_XZ_DEC_ARMTHUMB is not set +# CONFIG_XZ_DEC_BCJ is not set +# CONFIG_XZ_DEC_IA64 is not set +# CONFIG_XZ_DEC_POWERPC is not set +# CONFIG_XZ_DEC_SPARC is not set +# CONFIG_XZ_DEC_TEST is not set +# CONFIG_XZ_DEC_X86 is not set +# CONFIG_YAM is not set +# CONFIG_YELLOWFIN is not set +# CONFIG_YENTA is not set +# CONFIG_YENTA_O2 is not set +# CONFIG_YENTA_RICOH is not set +# CONFIG_YENTA_TI is not set +# CONFIG_YENTA_TOSHIBA is not set +# CONFIG_ZBUD is not set +# CONFIG_ZD1211RW is not set +# CONFIG_ZD1211RW_DEBUG is not set +# CONFIG_ZEROPLUS_FF is not set +# CONFIG_ZIIRAVE_WATCHDOG is not set +# CONFIG_ZISOFS is not set +# CONFIG_ZLIB_DEFLATE is not set +# CONFIG_ZLIB_INFLATE is not set +CONFIG_ZONE_DMA=y +# CONFIG_ZPA2326 is not set +# CONFIG_ZPOOL is not set +# CONFIG_ZRAM is not set +# CONFIG_ZSMALLOC is not set +# CONFIG_ZX_TDM is not set diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c index 4b88d1f8f..670588c84 100644 --- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c +++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include diff --git a/target/linux/generic/files/drivers/net/phy/rtl8306.c b/target/linux/generic/files/drivers/net/phy/rtl8306.c index 7bbac4061..6d09c1063 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8306.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8306.c @@ -25,6 +25,7 @@ #include #include #include +#include //#define DEBUG 1 @@ -1032,7 +1033,9 @@ rtl8306_read_status(struct phy_device *pdev) static struct phy_driver rtl8306_driver = { .name = "Realtek RTL8306S", +#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,13,0)) .flags = PHY_HAS_MAGICANEG, +#endif .phy_id = RTL8306_MAGIC, .phy_id_mask = 0xffffffff, .features = PHY_BASIC_FEATURES, diff --git a/target/linux/generic/files/drivers/net/phy/swconfig.c b/target/linux/generic/files/drivers/net/phy/swconfig.c index f6f26e43a..78569a930 100644 --- a/target/linux/generic/files/drivers/net/phy/swconfig.c +++ b/target/linux/generic/files/drivers/net/phy/swconfig.c @@ -269,13 +269,7 @@ static void swconfig_defaults_init(struct switch_dev *dev) } -static struct genl_family switch_fam = { - .id = GENL_ID_GENERATE, - .name = "switch", - .hdrsize = 0, - .version = 1, - .maxattr = SWITCH_ATTR_MAX, -}; +static struct genl_family switch_fam; static const struct nla_policy switch_policy[SWITCH_ATTR_MAX+1] = { [SWITCH_ATTR_ID] = { .type = NLA_U32 }, @@ -597,8 +591,13 @@ swconfig_parse_ports(struct sk_buff *msg, struct nlattr *head, port = &val->value.ports[val->len]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0) if (nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, nla, port_policy)) +#else + if (nla_parse_nested(tb, SWITCH_PORT_ATTR_MAX, nla, + port_policy, NULL)) +#endif return -EINVAL; if (!tb[SWITCH_PORT_ID]) @@ -619,7 +618,11 @@ swconfig_parse_link(struct sk_buff *msg, struct nlattr *nla, { struct nlattr *tb[SWITCH_LINK_ATTR_MAX + 1]; +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0) if (nla_parse_nested(tb, SWITCH_LINK_ATTR_MAX, nla, link_policy)) +#else + if (nla_parse_nested(tb, SWITCH_LINK_ATTR_MAX, nla, link_policy, NULL)) +#endif return -EINVAL; link->duplex = !!tb[SWITCH_LINK_FLAG_DUPLEX]; @@ -1051,6 +1054,19 @@ static struct genl_ops swconfig_ops[] = { } }; +static struct genl_family switch_fam = { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) + .id = GENL_ID_GENERATE, +#endif + .name = "switch", + .hdrsize = 0, + .version = 1, + .maxattr = SWITCH_ATTR_MAX, + .module = THIS_MODULE, + .ops = swconfig_ops, + .n_ops = ARRAY_SIZE(swconfig_ops), +}; + #ifdef CONFIG_OF void of_switch_load_portmap(struct switch_dev *dev) @@ -1222,8 +1238,12 @@ static int __init swconfig_init(void) { INIT_LIST_HEAD(&swdevs); - + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0) return genl_register_family_with_ops(&switch_fam, swconfig_ops); +#else + return genl_register_family(&switch_fam); +#endif } static void __exit diff --git a/target/linux/generic/hack-4.14/202-reduce_module_size.patch b/target/linux/generic/hack-4.14/202-reduce_module_size.patch new file mode 100644 index 000000000..f85424d0c --- /dev/null +++ b/target/linux/generic/hack-4.14/202-reduce_module_size.patch @@ -0,0 +1,24 @@ +From fd66884da2f96d2a7ea73f58b1b86251b959a913 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:56:19 +0200 +Subject: kernel: strip unnecessary symbol table information from kernel modules + +reduces default squashfs size on ar71xx by about 4k + +lede-commit: 058d331a39077f159ca8922f1f422a1346d6aa67 +Signed-off-by: Felix Fietkau +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/Makefile ++++ b/Makefile +@@ -408,7 +408,7 @@ KBUILD_CFLAGS_KERNEL := + KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) + KBUILD_AFLAGS_MODULE := -DMODULE + KBUILD_CFLAGS_MODULE := -DMODULE +-KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds ++KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + + # Read KERNELRELEASE from include/config/kernel.release (if it exists) + KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch new file mode 100644 index 000000000..2141cfef9 --- /dev/null +++ b/target/linux/generic/hack-4.14/204-module_strip.patch @@ -0,0 +1,205 @@ +From a779a482fb9b9f8fcdf8b2519c789b4b9bb5dd05 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:56:48 +0200 +Subject: build: add a hack for removing non-essential module info + +Signed-off-by: Felix Fietkau +--- + include/linux/module.h | 13 ++++++++----- + include/linux/moduleparam.h | 15 ++++++++++++--- + init/Kconfig | 7 +++++++ + kernel/module.c | 5 ++++- + scripts/mod/modpost.c | 12 ++++++++++++ + 5 files changed, 43 insertions(+), 9 deletions(-) + +--- a/include/linux/module.h ++++ b/include/linux/module.h +@@ -158,6 +158,7 @@ extern void cleanup_module(void); + + /* Generic info of form tag = "info" */ + #define MODULE_INFO(tag, info) __MODULE_INFO(tag, tag, info) ++#define MODULE_INFO_STRIP(tag, info) __MODULE_INFO_STRIP(tag, tag, info) + + /* For userspace: you can also call me... */ + #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) +@@ -201,12 +202,12 @@ extern void cleanup_module(void); + * Author(s), use "Name " or just "Name", for multiple + * authors use multiple MODULE_AUTHOR() statements/lines. + */ +-#define MODULE_AUTHOR(_author) MODULE_INFO(author, _author) ++#define MODULE_AUTHOR(_author) MODULE_INFO_STRIP(author, _author) + + /* What your module does. */ +-#define MODULE_DESCRIPTION(_description) MODULE_INFO(description, _description) ++#define MODULE_DESCRIPTION(_description) MODULE_INFO_STRIP(description, _description) + +-#ifdef MODULE ++#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) + /* Creates an alias so file2alias.c can find device table. */ + #define MODULE_DEVICE_TABLE(type, name) \ + extern typeof(name) __mod_##type##__##name##_device_table \ +@@ -233,7 +234,9 @@ extern typeof(name) __mod_##type##__##na + */ + + #if defined(MODULE) || !defined(CONFIG_SYSFS) +-#define MODULE_VERSION(_version) MODULE_INFO(version, _version) ++#define MODULE_VERSION(_version) MODULE_INFO_STRIP(version, _version) ++#elif defined(CONFIG_MODULE_STRIPPED) ++#define MODULE_VERSION(_version) __MODULE_INFO_DISABLED(version) + #else + #define MODULE_VERSION(_version) \ + static struct module_version_attribute ___modver_attr = { \ +@@ -255,7 +258,7 @@ extern typeof(name) __mod_##type##__##na + /* Optional firmware file (or files) needed by the module + * format is simply firmware file name. Multiple firmware + * files require multiple MODULE_FIRMWARE() specifiers */ +-#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware) ++#define MODULE_FIRMWARE(_firmware) MODULE_INFO_STRIP(firmware, _firmware) + + struct notifier_block; + +--- a/include/linux/moduleparam.h ++++ b/include/linux/moduleparam.h +@@ -17,6 +17,16 @@ + /* Chosen so that structs with an unsigned long line up. */ + #define MAX_PARAM_PREFIX_LEN (64 - sizeof(unsigned long)) + ++/* This struct is here for syntactic coherency, it is not used */ ++#define __MODULE_INFO_DISABLED(name) \ ++ struct __UNIQUE_ID(name) {} ++ ++#ifdef CONFIG_MODULE_STRIPPED ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO_DISABLED(name) ++#else ++#define __MODULE_INFO_STRIP(tag, name, info) __MODULE_INFO(tag, name, info) ++#endif ++ + #ifdef MODULE + #define __MODULE_INFO(tag, name, info) \ + static const char __UNIQUE_ID(name)[] \ +@@ -24,8 +34,7 @@ static const char __UNIQUE_ID(name)[] + = __stringify(tag) "=" info + #else /* !MODULE */ + /* This struct is here for syntactic coherency, it is not used */ +-#define __MODULE_INFO(tag, name, info) \ +- struct __UNIQUE_ID(name) {} ++#define __MODULE_INFO(tag, name, info) __MODULE_INFO_DISABLED(name) + #endif + #define __MODULE_PARM_TYPE(name, _type) \ + __MODULE_INFO(parmtype, name##type, #name ":" _type) +@@ -33,7 +42,7 @@ static const char __UNIQUE_ID(name)[] + /* One for each parameter, describing how to use it. Some files do + multiple of these per line, so can't just use MODULE_INFO. */ + #define MODULE_PARM_DESC(_parm, desc) \ +- __MODULE_INFO(parm, _parm, #_parm ":" desc) ++ __MODULE_INFO_STRIP(parm, _parm, #_parm ":" desc) + + struct kernel_param; + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1896,6 +1896,13 @@ config TRIM_UNUSED_KSYMS + + If unsure, or if you need to build out-of-tree modules, say N. + ++config MODULE_STRIPPED ++ bool "Reduce module size" ++ depends on MODULES ++ help ++ Remove module parameter descriptions, author info, version, aliases, ++ device tables, etc. ++ + endif # MODULES + + config MODULES_TREE_LOOKUP +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -2997,9 +2997,11 @@ static struct module *setup_load_info(st + + static int check_modinfo(struct module *mod, struct load_info *info, int flags) + { +- const char *modmagic = get_modinfo(info, "vermagic"); + int err; + ++#ifndef CONFIG_MODULE_STRIPPED ++ const char *modmagic = get_modinfo(info, "vermagic"); ++ + if (flags & MODULE_INIT_IGNORE_VERMAGIC) + modmagic = NULL; + +@@ -3020,6 +3022,7 @@ static int check_modinfo(struct module * + mod->name); + add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK); + } ++#endif + + if (get_modinfo(info, "staging")) { + add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK); +--- a/scripts/mod/modpost.c ++++ b/scripts/mod/modpost.c +@@ -1982,7 +1982,9 @@ static void read_symbols(char *modname) + symname = remove_dot(info.strtab + sym->st_name); + + handle_modversions(mod, &info, sym, symname); ++#ifndef CONFIG_MODULE_STRIPPED + handle_moddevtable(mod, &info, sym, symname); ++#endif + } + if (!is_vmlinux(modname) || + (is_vmlinux(modname) && vmlinux_section_warnings)) +@@ -2143,8 +2145,10 @@ static void add_header(struct buffer *b, + buf_printf(b, "#include \n"); + buf_printf(b, "#include \n"); + buf_printf(b, "\n"); ++#ifndef CONFIG_MODULE_STRIPPED + buf_printf(b, "MODULE_INFO(vermagic, VERMAGIC_STRING);\n"); + buf_printf(b, "MODULE_INFO(name, KBUILD_MODNAME);\n"); ++#endif + buf_printf(b, "\n"); + buf_printf(b, "__visible struct module __this_module\n"); + buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); +@@ -2161,16 +2165,20 @@ static void add_header(struct buffer *b, + + static void add_intree_flag(struct buffer *b, int is_intree) + { ++#ifndef CONFIG_MODULE_STRIPPED + if (is_intree) + buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n"); ++#endif + } + + static void add_staging_flag(struct buffer *b, const char *name) + { ++#ifndef CONFIG_MODULE_STRIPPED + static const char *staging_dir = "drivers/staging"; + + if (strncmp(staging_dir, name, strlen(staging_dir)) == 0) + buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n"); ++#endif + } + + /** +@@ -2269,11 +2277,13 @@ static void add_depends(struct buffer *b + + static void add_srcversion(struct buffer *b, struct module *mod) + { ++#ifndef CONFIG_MODULE_STRIPPED + if (mod->srcversion[0]) { + buf_printf(b, "\n"); + buf_printf(b, "MODULE_INFO(srcversion, \"%s\");\n", + mod->srcversion); + } ++#endif + } + + static void write_if_changed(struct buffer *b, const char *fname) +@@ -2509,7 +2519,9 @@ int main(int argc, char **argv) + add_staging_flag(&buf, mod->name); + err |= add_versions(&buf, mod); + add_depends(&buf, mod, modules); ++#ifndef CONFIG_MODULE_STRIPPED + add_moddevtable(&buf, mod); ++#endif + add_srcversion(&buf, mod); + + sprintf(fname, "%s.mod.c", mod->name); diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch new file mode 100644 index 000000000..a9e90dae8 --- /dev/null +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -0,0 +1,44 @@ +From c9ef4ab0f54356ee9f91d9676ea0ec123840ddc7 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 16:57:33 +0200 +Subject: kernel: do not build modules.order + +It is not needed for anything on the system and skipping this saves some +build time, especially in cases where there is nothing to do. + +lede-commit: afc1675833a7bf5df094f59f7250369520646d04 +Signed-off-by: Felix Fietkau +--- + Makefile | 2 -- + scripts/Makefile.build | 2 +- + 2 files changed, 1 insertion(+), 3 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1208,7 +1208,6 @@ all: modules + + PHONY += modules + modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin +- $(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order + @$(kecho) ' Building modules, stage 2.'; + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost + +@@ -1237,7 +1236,6 @@ _modinst_: + rm -f $(MODLIB)/build ; \ + ln -s $(CURDIR) $(MODLIB)/build ; \ + fi +- @cp -f $(objtree)/modules.order $(MODLIB)/ + @cp -f $(objtree)/modules.builtin $(MODLIB)/ + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modinst + +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -94,7 +94,7 @@ modorder-target := $(obj)/modules.order + # We keep a list of all modules in $(MODVERDIR) + + __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \ +- $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \ ++ $(if $(KBUILD_MODULES),$(obj-m)) \ + $(subdir-ym) $(always) + @: + diff --git a/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch b/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch new file mode 100644 index 000000000..95c7ea423 --- /dev/null +++ b/target/linux/generic/hack-4.14/210-darwin_scripts_include.patch @@ -0,0 +1,3065 @@ +From db7c30dcd9a0391bf13b62c9f91e144d762ef43a Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Fri, 7 Jul 2017 17:00:49 +0200 +Subject: Add an OSX specific patch to make the kernel be compiled + +lede-commit: 3fc2a24f0422b2f55f9ed43f116db3111f700526 +Signed-off-by: Florian Fainelli +--- + scripts/kconfig/Makefile | 3 + + scripts/mod/elf.h | 3007 ++++++++++++++++++++++++++++++++++++++++++++ + scripts/mod/mk_elfconfig.c | 4 + + scripts/mod/modpost.h | 4 + + 4 files changed, 3018 insertions(+) + create mode 100644 scripts/mod/elf.h + +--- a/scripts/kconfig/Makefile ++++ b/scripts/kconfig/Makefile +@@ -164,6 +164,9 @@ check-lxdialog := $(srctree)/$(src)/lxd + # we really need to do so. (Do not call gcc as part of make mrproper) + HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \ + -DLOCALE ++ifeq ($(shell uname -s),Darwin) ++HOST_LOADLIBES += -lncurses ++endif + + # =========================================================================== + # Shared Makefile for the various kconfig executables: +--- /dev/null ++++ b/scripts/mod/elf.h +@@ -0,0 +1,3007 @@ ++/* This file defines standard ELF types, structures, and macros. ++ Copyright (C) 1995-2012 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, see ++ . */ ++ ++#ifndef _ELF_H ++#define _ELF_H 1 ++ ++/* Standard ELF types. */ ++ ++#include ++ ++/* Type for a 16-bit quantity. */ ++typedef uint16_t Elf32_Half; ++typedef uint16_t Elf64_Half; ++ ++/* Types for signed and unsigned 32-bit quantities. */ ++typedef uint32_t Elf32_Word; ++typedef int32_t Elf32_Sword; ++typedef uint32_t Elf64_Word; ++typedef int32_t Elf64_Sword; ++ ++/* Types for signed and unsigned 64-bit quantities. */ ++typedef uint64_t Elf32_Xword; ++typedef int64_t Elf32_Sxword; ++typedef uint64_t Elf64_Xword; ++typedef int64_t Elf64_Sxword; ++ ++/* Type of addresses. */ ++typedef uint32_t Elf32_Addr; ++typedef uint64_t Elf64_Addr; ++ ++/* Type of file offsets. */ ++typedef uint32_t Elf32_Off; ++typedef uint64_t Elf64_Off; ++ ++/* Type for section indices, which are 16-bit quantities. */ ++typedef uint16_t Elf32_Section; ++typedef uint16_t Elf64_Section; ++ ++/* Type for version symbol information. */ ++typedef Elf32_Half Elf32_Versym; ++typedef Elf64_Half Elf64_Versym; ++ ++ ++/* The ELF file header. This appears at the start of every ELF file. */ ++ ++#define EI_NIDENT (16) ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf32_Half e_type; /* Object file type */ ++ Elf32_Half e_machine; /* Architecture */ ++ Elf32_Word e_version; /* Object file version */ ++ Elf32_Addr e_entry; /* Entry point virtual address */ ++ Elf32_Off e_phoff; /* Program header table file offset */ ++ Elf32_Off e_shoff; /* Section header table file offset */ ++ Elf32_Word e_flags; /* Processor-specific flags */ ++ Elf32_Half e_ehsize; /* ELF header size in bytes */ ++ Elf32_Half e_phentsize; /* Program header table entry size */ ++ Elf32_Half e_phnum; /* Program header table entry count */ ++ Elf32_Half e_shentsize; /* Section header table entry size */ ++ Elf32_Half e_shnum; /* Section header table entry count */ ++ Elf32_Half e_shstrndx; /* Section header string table index */ ++} Elf32_Ehdr; ++ ++typedef struct ++{ ++ unsigned char e_ident[EI_NIDENT]; /* Magic number and other info */ ++ Elf64_Half e_type; /* Object file type */ ++ Elf64_Half e_machine; /* Architecture */ ++ Elf64_Word e_version; /* Object file version */ ++ Elf64_Addr e_entry; /* Entry point virtual address */ ++ Elf64_Off e_phoff; /* Program header table file offset */ ++ Elf64_Off e_shoff; /* Section header table file offset */ ++ Elf64_Word e_flags; /* Processor-specific flags */ ++ Elf64_Half e_ehsize; /* ELF header size in bytes */ ++ Elf64_Half e_phentsize; /* Program header table entry size */ ++ Elf64_Half e_phnum; /* Program header table entry count */ ++ Elf64_Half e_shentsize; /* Section header table entry size */ ++ Elf64_Half e_shnum; /* Section header table entry count */ ++ Elf64_Half e_shstrndx; /* Section header string table index */ ++} Elf64_Ehdr; ++ ++/* Fields in the e_ident array. The EI_* macros are indices into the ++ array. The macros under each EI_* macro are the values the byte ++ may have. */ ++ ++#define EI_MAG0 0 /* File identification byte 0 index */ ++#define ELFMAG0 0x7f /* Magic number byte 0 */ ++ ++#define EI_MAG1 1 /* File identification byte 1 index */ ++#define ELFMAG1 'E' /* Magic number byte 1 */ ++ ++#define EI_MAG2 2 /* File identification byte 2 index */ ++#define ELFMAG2 'L' /* Magic number byte 2 */ ++ ++#define EI_MAG3 3 /* File identification byte 3 index */ ++#define ELFMAG3 'F' /* Magic number byte 3 */ ++ ++/* Conglomeration of the identification bytes, for easy testing as a word. */ ++#define ELFMAG "\177ELF" ++#define SELFMAG 4 ++ ++#define EI_CLASS 4 /* File class byte index */ ++#define ELFCLASSNONE 0 /* Invalid class */ ++#define ELFCLASS32 1 /* 32-bit objects */ ++#define ELFCLASS64 2 /* 64-bit objects */ ++#define ELFCLASSNUM 3 ++ ++#define EI_DATA 5 /* Data encoding byte index */ ++#define ELFDATANONE 0 /* Invalid data encoding */ ++#define ELFDATA2LSB 1 /* 2's complement, little endian */ ++#define ELFDATA2MSB 2 /* 2's complement, big endian */ ++#define ELFDATANUM 3 ++ ++#define EI_VERSION 6 /* File version byte index */ ++ /* Value must be EV_CURRENT */ ++ ++#define EI_OSABI 7 /* OS ABI identification */ ++#define ELFOSABI_NONE 0 /* UNIX System V ABI */ ++#define ELFOSABI_SYSV 0 /* Alias. */ ++#define ELFOSABI_HPUX 1 /* HP-UX */ ++#define ELFOSABI_NETBSD 2 /* NetBSD. */ ++#define ELFOSABI_GNU 3 /* Object uses GNU ELF extensions. */ ++#define ELFOSABI_LINUX ELFOSABI_GNU /* Compatibility alias. */ ++#define ELFOSABI_SOLARIS 6 /* Sun Solaris. */ ++#define ELFOSABI_AIX 7 /* IBM AIX. */ ++#define ELFOSABI_IRIX 8 /* SGI Irix. */ ++#define ELFOSABI_FREEBSD 9 /* FreeBSD. */ ++#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX. */ ++#define ELFOSABI_MODESTO 11 /* Novell Modesto. */ ++#define ELFOSABI_OPENBSD 12 /* OpenBSD. */ ++#define ELFOSABI_ARM_AEABI 64 /* ARM EABI */ ++#define ELFOSABI_ARM 97 /* ARM */ ++#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */ ++ ++#define EI_ABIVERSION 8 /* ABI version */ ++ ++#define EI_PAD 9 /* Byte index of padding bytes */ ++ ++/* Legal values for e_type (object file type). */ ++ ++#define ET_NONE 0 /* No file type */ ++#define ET_REL 1 /* Relocatable file */ ++#define ET_EXEC 2 /* Executable file */ ++#define ET_DYN 3 /* Shared object file */ ++#define ET_CORE 4 /* Core file */ ++#define ET_NUM 5 /* Number of defined types */ ++#define ET_LOOS 0xfe00 /* OS-specific range start */ ++#define ET_HIOS 0xfeff /* OS-specific range end */ ++#define ET_LOPROC 0xff00 /* Processor-specific range start */ ++#define ET_HIPROC 0xffff /* Processor-specific range end */ ++ ++/* Legal values for e_machine (architecture). */ ++ ++#define EM_NONE 0 /* No machine */ ++#define EM_M32 1 /* AT&T WE 32100 */ ++#define EM_SPARC 2 /* SUN SPARC */ ++#define EM_386 3 /* Intel 80386 */ ++#define EM_68K 4 /* Motorola m68k family */ ++#define EM_88K 5 /* Motorola m88k family */ ++#define EM_860 7 /* Intel 80860 */ ++#define EM_MIPS 8 /* MIPS R3000 big-endian */ ++#define EM_S370 9 /* IBM System/370 */ ++#define EM_MIPS_RS3_LE 10 /* MIPS R3000 little-endian */ ++ ++#define EM_PARISC 15 /* HPPA */ ++#define EM_VPP500 17 /* Fujitsu VPP500 */ ++#define EM_SPARC32PLUS 18 /* Sun's "v8plus" */ ++#define EM_960 19 /* Intel 80960 */ ++#define EM_PPC 20 /* PowerPC */ ++#define EM_PPC64 21 /* PowerPC 64-bit */ ++#define EM_S390 22 /* IBM S390 */ ++ ++#define EM_V800 36 /* NEC V800 series */ ++#define EM_FR20 37 /* Fujitsu FR20 */ ++#define EM_RH32 38 /* TRW RH-32 */ ++#define EM_RCE 39 /* Motorola RCE */ ++#define EM_ARM 40 /* ARM */ ++#define EM_FAKE_ALPHA 41 /* Digital Alpha */ ++#define EM_SH 42 /* Hitachi SH */ ++#define EM_SPARCV9 43 /* SPARC v9 64-bit */ ++#define EM_TRICORE 44 /* Siemens Tricore */ ++#define EM_ARC 45 /* Argonaut RISC Core */ ++#define EM_H8_300 46 /* Hitachi H8/300 */ ++#define EM_H8_300H 47 /* Hitachi H8/300H */ ++#define EM_H8S 48 /* Hitachi H8S */ ++#define EM_H8_500 49 /* Hitachi H8/500 */ ++#define EM_IA_64 50 /* Intel Merced */ ++#define EM_MIPS_X 51 /* Stanford MIPS-X */ ++#define EM_COLDFIRE 52 /* Motorola Coldfire */ ++#define EM_68HC12 53 /* Motorola M68HC12 */ ++#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ ++#define EM_PCP 55 /* Siemens PCP */ ++#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ ++#define EM_NDR1 57 /* Denso NDR1 microprocessor */ ++#define EM_STARCORE 58 /* Motorola Start*Core processor */ ++#define EM_ME16 59 /* Toyota ME16 processor */ ++#define EM_ST100 60 /* STMicroelectronic ST100 processor */ ++#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ ++#define EM_X86_64 62 /* AMD x86-64 architecture */ ++#define EM_PDSP 63 /* Sony DSP Processor */ ++ ++#define EM_FX66 66 /* Siemens FX66 microcontroller */ ++#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ ++#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ ++#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ ++#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ ++#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ ++#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ ++#define EM_SVX 73 /* Silicon Graphics SVx */ ++#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ ++#define EM_VAX 75 /* Digital VAX */ ++#define EM_CRIS 76 /* Axis Communications 32-bit embedded processor */ ++#define EM_JAVELIN 77 /* Infineon Technologies 32-bit embedded processor */ ++#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ ++#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ ++#define EM_MMIX 80 /* Donald Knuth's educational 64-bit processor */ ++#define EM_HUANY 81 /* Harvard University machine-independent object files */ ++#define EM_PRISM 82 /* SiTera Prism */ ++#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ ++#define EM_FR30 84 /* Fujitsu FR30 */ ++#define EM_D10V 85 /* Mitsubishi D10V */ ++#define EM_D30V 86 /* Mitsubishi D30V */ ++#define EM_V850 87 /* NEC v850 */ ++#define EM_M32R 88 /* Mitsubishi M32R */ ++#define EM_MN10300 89 /* Matsushita MN10300 */ ++#define EM_MN10200 90 /* Matsushita MN10200 */ ++#define EM_PJ 91 /* picoJava */ ++#define EM_OPENRISC 92 /* OpenRISC 32-bit embedded processor */ ++#define EM_ARC_A5 93 /* ARC Cores Tangent-A5 */ ++#define EM_XTENSA 94 /* Tensilica Xtensa Architecture */ ++#define EM_TILEPRO 188 /* Tilera TILEPro */ ++#define EM_TILEGX 191 /* Tilera TILE-Gx */ ++#define EM_NUM 192 ++ ++/* If it is necessary to assign new unofficial EM_* values, please ++ pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the ++ chances of collision with official or non-GNU unofficial values. */ ++ ++#define EM_ALPHA 0x9026 ++ ++/* Legal values for e_version (version). */ ++ ++#define EV_NONE 0 /* Invalid ELF version */ ++#define EV_CURRENT 1 /* Current version */ ++#define EV_NUM 2 ++ ++/* Section header. */ ++ ++typedef struct ++{ ++ Elf32_Word sh_name; /* Section name (string tbl index) */ ++ Elf32_Word sh_type; /* Section type */ ++ Elf32_Word sh_flags; /* Section flags */ ++ Elf32_Addr sh_addr; /* Section virtual addr at execution */ ++ Elf32_Off sh_offset; /* Section file offset */ ++ Elf32_Word sh_size; /* Section size in bytes */ ++ Elf32_Word sh_link; /* Link to another section */ ++ Elf32_Word sh_info; /* Additional section information */ ++ Elf32_Word sh_addralign; /* Section alignment */ ++ Elf32_Word sh_entsize; /* Entry size if section holds table */ ++} Elf32_Shdr; ++ ++typedef struct ++{ ++ Elf64_Word sh_name; /* Section name (string tbl index) */ ++ Elf64_Word sh_type; /* Section type */ ++ Elf64_Xword sh_flags; /* Section flags */ ++ Elf64_Addr sh_addr; /* Section virtual addr at execution */ ++ Elf64_Off sh_offset; /* Section file offset */ ++ Elf64_Xword sh_size; /* Section size in bytes */ ++ Elf64_Word sh_link; /* Link to another section */ ++ Elf64_Word sh_info; /* Additional section information */ ++ Elf64_Xword sh_addralign; /* Section alignment */ ++ Elf64_Xword sh_entsize; /* Entry size if section holds table */ ++} Elf64_Shdr; ++ ++/* Special section indices. */ ++ ++#define SHN_UNDEF 0 /* Undefined section */ ++#define SHN_LORESERVE 0xff00 /* Start of reserved indices */ ++#define SHN_LOPROC 0xff00 /* Start of processor-specific */ ++#define SHN_BEFORE 0xff00 /* Order section before all others ++ (Solaris). */ ++#define SHN_AFTER 0xff01 /* Order section after all others ++ (Solaris). */ ++#define SHN_HIPROC 0xff1f /* End of processor-specific */ ++#define SHN_LOOS 0xff20 /* Start of OS-specific */ ++#define SHN_HIOS 0xff3f /* End of OS-specific */ ++#define SHN_ABS 0xfff1 /* Associated symbol is absolute */ ++#define SHN_COMMON 0xfff2 /* Associated symbol is common */ ++#define SHN_XINDEX 0xffff /* Index is in extra table. */ ++#define SHN_HIRESERVE 0xffff /* End of reserved indices */ ++ ++/* Legal values for sh_type (section type). */ ++ ++#define SHT_NULL 0 /* Section header table entry unused */ ++#define SHT_PROGBITS 1 /* Program data */ ++#define SHT_SYMTAB 2 /* Symbol table */ ++#define SHT_STRTAB 3 /* String table */ ++#define SHT_RELA 4 /* Relocation entries with addends */ ++#define SHT_HASH 5 /* Symbol hash table */ ++#define SHT_DYNAMIC 6 /* Dynamic linking information */ ++#define SHT_NOTE 7 /* Notes */ ++#define SHT_NOBITS 8 /* Program space with no data (bss) */ ++#define SHT_REL 9 /* Relocation entries, no addends */ ++#define SHT_SHLIB 10 /* Reserved */ ++#define SHT_DYNSYM 11 /* Dynamic linker symbol table */ ++#define SHT_INIT_ARRAY 14 /* Array of constructors */ ++#define SHT_FINI_ARRAY 15 /* Array of destructors */ ++#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ ++#define SHT_GROUP 17 /* Section group */ ++#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ ++#define SHT_NUM 19 /* Number of defined types. */ ++#define SHT_LOOS 0x60000000 /* Start OS-specific. */ ++#define SHT_GNU_ATTRIBUTES 0x6ffffff5 /* Object attributes. */ ++#define SHT_GNU_HASH 0x6ffffff6 /* GNU-style hash table. */ ++#define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ ++#define SHT_CHECKSUM 0x6ffffff8 /* Checksum for DSO content. */ ++#define SHT_LOSUNW 0x6ffffffa /* Sun-specific low bound. */ ++#define SHT_SUNW_move 0x6ffffffa ++#define SHT_SUNW_COMDAT 0x6ffffffb ++#define SHT_SUNW_syminfo 0x6ffffffc ++#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */ ++#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */ ++#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */ ++#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */ ++#define SHT_HIOS 0x6fffffff /* End OS-specific type */ ++#define SHT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define SHT_HIPROC 0x7fffffff /* End of processor-specific */ ++#define SHT_LOUSER 0x80000000 /* Start of application-specific */ ++#define SHT_HIUSER 0x8fffffff /* End of application-specific */ ++ ++/* Legal values for sh_flags (section flags). */ ++ ++#define SHF_WRITE (1 << 0) /* Writable */ ++#define SHF_ALLOC (1 << 1) /* Occupies memory during execution */ ++#define SHF_EXECINSTR (1 << 2) /* Executable */ ++#define SHF_MERGE (1 << 4) /* Might be merged */ ++#define SHF_STRINGS (1 << 5) /* Contains nul-terminated strings */ ++#define SHF_INFO_LINK (1 << 6) /* `sh_info' contains SHT index */ ++#define SHF_LINK_ORDER (1 << 7) /* Preserve order after combining */ ++#define SHF_OS_NONCONFORMING (1 << 8) /* Non-standard OS specific handling ++ required */ ++#define SHF_GROUP (1 << 9) /* Section is member of a group. */ ++#define SHF_TLS (1 << 10) /* Section hold thread-local data. */ ++#define SHF_MASKOS 0x0ff00000 /* OS-specific. */ ++#define SHF_MASKPROC 0xf0000000 /* Processor-specific */ ++#define SHF_ORDERED (1 << 30) /* Special ordering requirement ++ (Solaris). */ ++#define SHF_EXCLUDE (1 << 31) /* Section is excluded unless ++ referenced or allocated (Solaris).*/ ++ ++/* Section group handling. */ ++#define GRP_COMDAT 0x1 /* Mark group as COMDAT. */ ++ ++/* Symbol table entry. */ ++ ++typedef struct ++{ ++ Elf32_Word st_name; /* Symbol name (string tbl index) */ ++ Elf32_Addr st_value; /* Symbol value */ ++ Elf32_Word st_size; /* Symbol size */ ++ unsigned char st_info; /* Symbol type and binding */ ++ unsigned char st_other; /* Symbol visibility */ ++ Elf32_Section st_shndx; /* Section index */ ++} Elf32_Sym; ++ ++typedef struct ++{ ++ Elf64_Word st_name; /* Symbol name (string tbl index) */ ++ unsigned char st_info; /* Symbol type and binding */ ++ unsigned char st_other; /* Symbol visibility */ ++ Elf64_Section st_shndx; /* Section index */ ++ Elf64_Addr st_value; /* Symbol value */ ++ Elf64_Xword st_size; /* Symbol size */ ++} Elf64_Sym; ++ ++/* The syminfo section if available contains additional information about ++ every dynamic symbol. */ ++ ++typedef struct ++{ ++ Elf32_Half si_boundto; /* Direct bindings, symbol bound to */ ++ Elf32_Half si_flags; /* Per symbol flags */ ++} Elf32_Syminfo; ++ ++typedef struct ++{ ++ Elf64_Half si_boundto; /* Direct bindings, symbol bound to */ ++ Elf64_Half si_flags; /* Per symbol flags */ ++} Elf64_Syminfo; ++ ++/* Possible values for si_boundto. */ ++#define SYMINFO_BT_SELF 0xffff /* Symbol bound to self */ ++#define SYMINFO_BT_PARENT 0xfffe /* Symbol bound to parent */ ++#define SYMINFO_BT_LOWRESERVE 0xff00 /* Beginning of reserved entries */ ++ ++/* Possible bitmasks for si_flags. */ ++#define SYMINFO_FLG_DIRECT 0x0001 /* Direct bound symbol */ ++#define SYMINFO_FLG_PASSTHRU 0x0002 /* Pass-thru symbol for translator */ ++#define SYMINFO_FLG_COPY 0x0004 /* Symbol is a copy-reloc */ ++#define SYMINFO_FLG_LAZYLOAD 0x0008 /* Symbol bound to object to be lazy ++ loaded */ ++/* Syminfo version values. */ ++#define SYMINFO_NONE 0 ++#define SYMINFO_CURRENT 1 ++#define SYMINFO_NUM 2 ++ ++ ++/* How to extract and insert information held in the st_info field. */ ++ ++#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4) ++#define ELF32_ST_TYPE(val) ((val) & 0xf) ++#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf)) ++ ++/* Both Elf32_Sym and Elf64_Sym use the same one-byte st_info field. */ ++#define ELF64_ST_BIND(val) ELF32_ST_BIND (val) ++#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val) ++#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type)) ++ ++/* Legal values for ST_BIND subfield of st_info (symbol binding). */ ++ ++#define STB_LOCAL 0 /* Local symbol */ ++#define STB_GLOBAL 1 /* Global symbol */ ++#define STB_WEAK 2 /* Weak symbol */ ++#define STB_NUM 3 /* Number of defined types. */ ++#define STB_LOOS 10 /* Start of OS-specific */ ++#define STB_GNU_UNIQUE 10 /* Unique symbol. */ ++#define STB_HIOS 12 /* End of OS-specific */ ++#define STB_LOPROC 13 /* Start of processor-specific */ ++#define STB_HIPROC 15 /* End of processor-specific */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_NOTYPE 0 /* Symbol type is unspecified */ ++#define STT_OBJECT 1 /* Symbol is a data object */ ++#define STT_FUNC 2 /* Symbol is a code object */ ++#define STT_SECTION 3 /* Symbol associated with a section */ ++#define STT_FILE 4 /* Symbol's name is file name */ ++#define STT_COMMON 5 /* Symbol is a common data object */ ++#define STT_TLS 6 /* Symbol is thread-local data object*/ ++#define STT_NUM 7 /* Number of defined types. */ ++#define STT_LOOS 10 /* Start of OS-specific */ ++#define STT_GNU_IFUNC 10 /* Symbol is indirect code object */ ++#define STT_HIOS 12 /* End of OS-specific */ ++#define STT_LOPROC 13 /* Start of processor-specific */ ++#define STT_HIPROC 15 /* End of processor-specific */ ++ ++ ++/* Symbol table indices are found in the hash buckets and chain table ++ of a symbol hash table section. This special index value indicates ++ the end of a chain, meaning no further symbols are found in that bucket. */ ++ ++#define STN_UNDEF 0 /* End of a chain. */ ++ ++ ++/* How to extract and insert information held in the st_other field. */ ++ ++#define ELF32_ST_VISIBILITY(o) ((o) & 0x03) ++ ++/* For ELF64 the definitions are the same. */ ++#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o) ++ ++/* Symbol visibility specification encoded in the st_other field. */ ++#define STV_DEFAULT 0 /* Default symbol visibility rules */ ++#define STV_INTERNAL 1 /* Processor specific hidden class */ ++#define STV_HIDDEN 2 /* Sym unavailable in other modules */ ++#define STV_PROTECTED 3 /* Not preemptible, not exported */ ++ ++ ++/* Relocation table entry without addend (in section of type SHT_REL). */ ++ ++typedef struct ++{ ++ Elf32_Addr r_offset; /* Address */ ++ Elf32_Word r_info; /* Relocation type and symbol index */ ++} Elf32_Rel; ++ ++/* I have seen two different definitions of the Elf64_Rel and ++ Elf64_Rela structures, so we'll leave them out until Novell (or ++ whoever) gets their act together. */ ++/* The following, at least, is used on Sparc v9, MIPS, and Alpha. */ ++ ++typedef struct ++{ ++ Elf64_Addr r_offset; /* Address */ ++ Elf64_Xword r_info; /* Relocation type and symbol index */ ++} Elf64_Rel; ++ ++/* Relocation table entry with addend (in section of type SHT_RELA). */ ++ ++typedef struct ++{ ++ Elf32_Addr r_offset; /* Address */ ++ Elf32_Word r_info; /* Relocation type and symbol index */ ++ Elf32_Sword r_addend; /* Addend */ ++} Elf32_Rela; ++ ++typedef struct ++{ ++ Elf64_Addr r_offset; /* Address */ ++ Elf64_Xword r_info; /* Relocation type and symbol index */ ++ Elf64_Sxword r_addend; /* Addend */ ++} Elf64_Rela; ++ ++/* How to extract and insert information held in the r_info field. */ ++ ++#define ELF32_R_SYM(val) ((val) >> 8) ++#define ELF32_R_TYPE(val) ((val) & 0xff) ++#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff)) ++ ++#define ELF64_R_SYM(i) ((i) >> 32) ++#define ELF64_R_TYPE(i) ((i) & 0xffffffff) ++#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) ++ ++/* Program segment header. */ ++ ++typedef struct ++{ ++ Elf32_Word p_type; /* Segment type */ ++ Elf32_Off p_offset; /* Segment file offset */ ++ Elf32_Addr p_vaddr; /* Segment virtual address */ ++ Elf32_Addr p_paddr; /* Segment physical address */ ++ Elf32_Word p_filesz; /* Segment size in file */ ++ Elf32_Word p_memsz; /* Segment size in memory */ ++ Elf32_Word p_flags; /* Segment flags */ ++ Elf32_Word p_align; /* Segment alignment */ ++} Elf32_Phdr; ++ ++typedef struct ++{ ++ Elf64_Word p_type; /* Segment type */ ++ Elf64_Word p_flags; /* Segment flags */ ++ Elf64_Off p_offset; /* Segment file offset */ ++ Elf64_Addr p_vaddr; /* Segment virtual address */ ++ Elf64_Addr p_paddr; /* Segment physical address */ ++ Elf64_Xword p_filesz; /* Segment size in file */ ++ Elf64_Xword p_memsz; /* Segment size in memory */ ++ Elf64_Xword p_align; /* Segment alignment */ ++} Elf64_Phdr; ++ ++/* Special value for e_phnum. This indicates that the real number of ++ program headers is too large to fit into e_phnum. Instead the real ++ value is in the field sh_info of section 0. */ ++ ++#define PN_XNUM 0xffff ++ ++/* Legal values for p_type (segment type). */ ++ ++#define PT_NULL 0 /* Program header table entry unused */ ++#define PT_LOAD 1 /* Loadable program segment */ ++#define PT_DYNAMIC 2 /* Dynamic linking information */ ++#define PT_INTERP 3 /* Program interpreter */ ++#define PT_NOTE 4 /* Auxiliary information */ ++#define PT_SHLIB 5 /* Reserved */ ++#define PT_PHDR 6 /* Entry for header table itself */ ++#define PT_TLS 7 /* Thread-local storage segment */ ++#define PT_NUM 8 /* Number of defined types */ ++#define PT_LOOS 0x60000000 /* Start of OS-specific */ ++#define PT_GNU_EH_FRAME 0x6474e550 /* GCC .eh_frame_hdr segment */ ++#define PT_GNU_STACK 0x6474e551 /* Indicates stack executability */ ++#define PT_GNU_RELRO 0x6474e552 /* Read-only after relocation */ ++#define PT_LOSUNW 0x6ffffffa ++#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */ ++#define PT_SUNWSTACK 0x6ffffffb /* Stack segment */ ++#define PT_HISUNW 0x6fffffff ++#define PT_HIOS 0x6fffffff /* End of OS-specific */ ++#define PT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define PT_HIPROC 0x7fffffff /* End of processor-specific */ ++ ++/* Legal values for p_flags (segment flags). */ ++ ++#define PF_X (1 << 0) /* Segment is executable */ ++#define PF_W (1 << 1) /* Segment is writable */ ++#define PF_R (1 << 2) /* Segment is readable */ ++#define PF_MASKOS 0x0ff00000 /* OS-specific */ ++#define PF_MASKPROC 0xf0000000 /* Processor-specific */ ++ ++/* Legal values for note segment descriptor types for core files. */ ++ ++#define NT_PRSTATUS 1 /* Contains copy of prstatus struct */ ++#define NT_FPREGSET 2 /* Contains copy of fpregset struct */ ++#define NT_PRPSINFO 3 /* Contains copy of prpsinfo struct */ ++#define NT_PRXREG 4 /* Contains copy of prxregset struct */ ++#define NT_TASKSTRUCT 4 /* Contains copy of task structure */ ++#define NT_PLATFORM 5 /* String from sysinfo(SI_PLATFORM) */ ++#define NT_AUXV 6 /* Contains copy of auxv array */ ++#define NT_GWINDOWS 7 /* Contains copy of gwindows struct */ ++#define NT_ASRS 8 /* Contains copy of asrset struct */ ++#define NT_PSTATUS 10 /* Contains copy of pstatus struct */ ++#define NT_PSINFO 13 /* Contains copy of psinfo struct */ ++#define NT_PRCRED 14 /* Contains copy of prcred struct */ ++#define NT_UTSNAME 15 /* Contains copy of utsname struct */ ++#define NT_LWPSTATUS 16 /* Contains copy of lwpstatus struct */ ++#define NT_LWPSINFO 17 /* Contains copy of lwpinfo struct */ ++#define NT_PRFPXREG 20 /* Contains copy of fprxregset struct */ ++#define NT_PRXFPREG 0x46e62b7f /* Contains copy of user_fxsr_struct */ ++#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ ++#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ ++#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ ++#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ ++#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ ++#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ ++ ++/* Legal values for the note segment descriptor types for object files. */ ++ ++#define NT_VERSION 1 /* Contains a version string. */ ++ ++ ++/* Dynamic section entry. */ ++ ++typedef struct ++{ ++ Elf32_Sword d_tag; /* Dynamic entry type */ ++ union ++ { ++ Elf32_Word d_val; /* Integer value */ ++ Elf32_Addr d_ptr; /* Address value */ ++ } d_un; ++} Elf32_Dyn; ++ ++typedef struct ++{ ++ Elf64_Sxword d_tag; /* Dynamic entry type */ ++ union ++ { ++ Elf64_Xword d_val; /* Integer value */ ++ Elf64_Addr d_ptr; /* Address value */ ++ } d_un; ++} Elf64_Dyn; ++ ++/* Legal values for d_tag (dynamic entry type). */ ++ ++#define DT_NULL 0 /* Marks end of dynamic section */ ++#define DT_NEEDED 1 /* Name of needed library */ ++#define DT_PLTRELSZ 2 /* Size in bytes of PLT relocs */ ++#define DT_PLTGOT 3 /* Processor defined value */ ++#define DT_HASH 4 /* Address of symbol hash table */ ++#define DT_STRTAB 5 /* Address of string table */ ++#define DT_SYMTAB 6 /* Address of symbol table */ ++#define DT_RELA 7 /* Address of Rela relocs */ ++#define DT_RELASZ 8 /* Total size of Rela relocs */ ++#define DT_RELAENT 9 /* Size of one Rela reloc */ ++#define DT_STRSZ 10 /* Size of string table */ ++#define DT_SYMENT 11 /* Size of one symbol table entry */ ++#define DT_INIT 12 /* Address of init function */ ++#define DT_FINI 13 /* Address of termination function */ ++#define DT_SONAME 14 /* Name of shared object */ ++#define DT_RPATH 15 /* Library search path (deprecated) */ ++#define DT_SYMBOLIC 16 /* Start symbol search here */ ++#define DT_REL 17 /* Address of Rel relocs */ ++#define DT_RELSZ 18 /* Total size of Rel relocs */ ++#define DT_RELENT 19 /* Size of one Rel reloc */ ++#define DT_PLTREL 20 /* Type of reloc in PLT */ ++#define DT_DEBUG 21 /* For debugging; unspecified */ ++#define DT_TEXTREL 22 /* Reloc might modify .text */ ++#define DT_JMPREL 23 /* Address of PLT relocs */ ++#define DT_BIND_NOW 24 /* Process relocations of object */ ++#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */ ++#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */ ++#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */ ++#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */ ++#define DT_RUNPATH 29 /* Library search path */ ++#define DT_FLAGS 30 /* Flags for the object being loaded */ ++#define DT_ENCODING 32 /* Start of encoded range */ ++#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ ++#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ ++#define DT_NUM 34 /* Number used */ ++#define DT_LOOS 0x6000000d /* Start of OS-specific */ ++#define DT_HIOS 0x6ffff000 /* End of OS-specific */ ++#define DT_LOPROC 0x70000000 /* Start of processor-specific */ ++#define DT_HIPROC 0x7fffffff /* End of processor-specific */ ++#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */ ++ ++/* DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the ++ Dyn.d_un.d_val field of the Elf*_Dyn structure. This follows Sun's ++ approach. */ ++#define DT_VALRNGLO 0x6ffffd00 ++#define DT_GNU_PRELINKED 0x6ffffdf5 /* Prelinking timestamp */ ++#define DT_GNU_CONFLICTSZ 0x6ffffdf6 /* Size of conflict section */ ++#define DT_GNU_LIBLISTSZ 0x6ffffdf7 /* Size of library list */ ++#define DT_CHECKSUM 0x6ffffdf8 ++#define DT_PLTPADSZ 0x6ffffdf9 ++#define DT_MOVEENT 0x6ffffdfa ++#define DT_MOVESZ 0x6ffffdfb ++#define DT_FEATURE_1 0x6ffffdfc /* Feature selection (DTF_*). */ ++#define DT_POSFLAG_1 0x6ffffdfd /* Flags for DT_* entries, effecting ++ the following DT_* entry. */ ++#define DT_SYMINSZ 0x6ffffdfe /* Size of syminfo table (in bytes) */ ++#define DT_SYMINENT 0x6ffffdff /* Entry size of syminfo */ ++#define DT_VALRNGHI 0x6ffffdff ++#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag)) /* Reverse order! */ ++#define DT_VALNUM 12 ++ ++/* DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the ++ Dyn.d_un.d_ptr field of the Elf*_Dyn structure. ++ ++ If any adjustment is made to the ELF object after it has been ++ built these entries will need to be adjusted. */ ++#define DT_ADDRRNGLO 0x6ffffe00 ++#define DT_GNU_HASH 0x6ffffef5 /* GNU-style hash table. */ ++#define DT_TLSDESC_PLT 0x6ffffef6 ++#define DT_TLSDESC_GOT 0x6ffffef7 ++#define DT_GNU_CONFLICT 0x6ffffef8 /* Start of conflict section */ ++#define DT_GNU_LIBLIST 0x6ffffef9 /* Library list */ ++#define DT_CONFIG 0x6ffffefa /* Configuration information. */ ++#define DT_DEPAUDIT 0x6ffffefb /* Dependency auditing. */ ++#define DT_AUDIT 0x6ffffefc /* Object auditing. */ ++#define DT_PLTPAD 0x6ffffefd /* PLT padding. */ ++#define DT_MOVETAB 0x6ffffefe /* Move table. */ ++#define DT_SYMINFO 0x6ffffeff /* Syminfo table. */ ++#define DT_ADDRRNGHI 0x6ffffeff ++#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag)) /* Reverse order! */ ++#define DT_ADDRNUM 11 ++ ++/* The versioning entry types. The next are defined as part of the ++ GNU extension. */ ++#define DT_VERSYM 0x6ffffff0 ++ ++#define DT_RELACOUNT 0x6ffffff9 ++#define DT_RELCOUNT 0x6ffffffa ++ ++/* These were chosen by Sun. */ ++#define DT_FLAGS_1 0x6ffffffb /* State flags, see DF_1_* below. */ ++#define DT_VERDEF 0x6ffffffc /* Address of version definition ++ table */ ++#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */ ++#define DT_VERNEED 0x6ffffffe /* Address of table with needed ++ versions */ ++#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */ ++#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ ++#define DT_VERSIONTAGNUM 16 ++ ++/* Sun added these machine-independent extensions in the "processor-specific" ++ range. Be compatible. */ ++#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */ ++#define DT_FILTER 0x7fffffff /* Shared object to get values from */ ++#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1) ++#define DT_EXTRANUM 3 ++ ++/* Values of `d_un.d_val' in the DT_FLAGS entry. */ ++#define DF_ORIGIN 0x00000001 /* Object may use DF_ORIGIN */ ++#define DF_SYMBOLIC 0x00000002 /* Symbol resolutions starts here */ ++#define DF_TEXTREL 0x00000004 /* Object contains text relocations */ ++#define DF_BIND_NOW 0x00000008 /* No lazy binding for this object */ ++#define DF_STATIC_TLS 0x00000010 /* Module uses the static TLS model */ ++ ++/* State flags selectable in the `d_un.d_val' element of the DT_FLAGS_1 ++ entry in the dynamic section. */ ++#define DF_1_NOW 0x00000001 /* Set RTLD_NOW for this object. */ ++#define DF_1_GLOBAL 0x00000002 /* Set RTLD_GLOBAL for this object. */ ++#define DF_1_GROUP 0x00000004 /* Set RTLD_GROUP for this object. */ ++#define DF_1_NODELETE 0x00000008 /* Set RTLD_NODELETE for this object.*/ ++#define DF_1_LOADFLTR 0x00000010 /* Trigger filtee loading at runtime.*/ ++#define DF_1_INITFIRST 0x00000020 /* Set RTLD_INITFIRST for this object*/ ++#define DF_1_NOOPEN 0x00000040 /* Set RTLD_NOOPEN for this object. */ ++#define DF_1_ORIGIN 0x00000080 /* $ORIGIN must be handled. */ ++#define DF_1_DIRECT 0x00000100 /* Direct binding enabled. */ ++#define DF_1_TRANS 0x00000200 ++#define DF_1_INTERPOSE 0x00000400 /* Object is used to interpose. */ ++#define DF_1_NODEFLIB 0x00000800 /* Ignore default lib search path. */ ++#define DF_1_NODUMP 0x00001000 /* Object can't be dldump'ed. */ ++#define DF_1_CONFALT 0x00002000 /* Configuration alternative created.*/ ++#define DF_1_ENDFILTEE 0x00004000 /* Filtee terminates filters search. */ ++#define DF_1_DISPRELDNE 0x00008000 /* Disp reloc applied at build time. */ ++#define DF_1_DISPRELPND 0x00010000 /* Disp reloc applied at run-time. */ ++ ++/* Flags for the feature selection in DT_FEATURE_1. */ ++#define DTF_1_PARINIT 0x00000001 ++#define DTF_1_CONFEXP 0x00000002 ++ ++/* Flags in the DT_POSFLAG_1 entry effecting only the next DT_* entry. */ ++#define DF_P1_LAZYLOAD 0x00000001 /* Lazyload following object. */ ++#define DF_P1_GROUPPERM 0x00000002 /* Symbols from next object are not ++ generally available. */ ++ ++/* Version definition sections. */ ++ ++typedef struct ++{ ++ Elf32_Half vd_version; /* Version revision */ ++ Elf32_Half vd_flags; /* Version information */ ++ Elf32_Half vd_ndx; /* Version Index */ ++ Elf32_Half vd_cnt; /* Number of associated aux entries */ ++ Elf32_Word vd_hash; /* Version name hash value */ ++ Elf32_Word vd_aux; /* Offset in bytes to verdaux array */ ++ Elf32_Word vd_next; /* Offset in bytes to next verdef ++ entry */ ++} Elf32_Verdef; ++ ++typedef struct ++{ ++ Elf64_Half vd_version; /* Version revision */ ++ Elf64_Half vd_flags; /* Version information */ ++ Elf64_Half vd_ndx; /* Version Index */ ++ Elf64_Half vd_cnt; /* Number of associated aux entries */ ++ Elf64_Word vd_hash; /* Version name hash value */ ++ Elf64_Word vd_aux; /* Offset in bytes to verdaux array */ ++ Elf64_Word vd_next; /* Offset in bytes to next verdef ++ entry */ ++} Elf64_Verdef; ++ ++ ++/* Legal values for vd_version (version revision). */ ++#define VER_DEF_NONE 0 /* No version */ ++#define VER_DEF_CURRENT 1 /* Current version */ ++#define VER_DEF_NUM 2 /* Given version number */ ++ ++/* Legal values for vd_flags (version information flags). */ ++#define VER_FLG_BASE 0x1 /* Version definition of file itself */ ++#define VER_FLG_WEAK 0x2 /* Weak version identifier */ ++ ++/* Versym symbol index values. */ ++#define VER_NDX_LOCAL 0 /* Symbol is local. */ ++#define VER_NDX_GLOBAL 1 /* Symbol is global. */ ++#define VER_NDX_LORESERVE 0xff00 /* Beginning of reserved entries. */ ++#define VER_NDX_ELIMINATE 0xff01 /* Symbol is to be eliminated. */ ++ ++/* Auxialiary version information. */ ++ ++typedef struct ++{ ++ Elf32_Word vda_name; /* Version or dependency names */ ++ Elf32_Word vda_next; /* Offset in bytes to next verdaux ++ entry */ ++} Elf32_Verdaux; ++ ++typedef struct ++{ ++ Elf64_Word vda_name; /* Version or dependency names */ ++ Elf64_Word vda_next; /* Offset in bytes to next verdaux ++ entry */ ++} Elf64_Verdaux; ++ ++ ++/* Version dependency section. */ ++ ++typedef struct ++{ ++ Elf32_Half vn_version; /* Version of structure */ ++ Elf32_Half vn_cnt; /* Number of associated aux entries */ ++ Elf32_Word vn_file; /* Offset of filename for this ++ dependency */ ++ Elf32_Word vn_aux; /* Offset in bytes to vernaux array */ ++ Elf32_Word vn_next; /* Offset in bytes to next verneed ++ entry */ ++} Elf32_Verneed; ++ ++typedef struct ++{ ++ Elf64_Half vn_version; /* Version of structure */ ++ Elf64_Half vn_cnt; /* Number of associated aux entries */ ++ Elf64_Word vn_file; /* Offset of filename for this ++ dependency */ ++ Elf64_Word vn_aux; /* Offset in bytes to vernaux array */ ++ Elf64_Word vn_next; /* Offset in bytes to next verneed ++ entry */ ++} Elf64_Verneed; ++ ++ ++/* Legal values for vn_version (version revision). */ ++#define VER_NEED_NONE 0 /* No version */ ++#define VER_NEED_CURRENT 1 /* Current version */ ++#define VER_NEED_NUM 2 /* Given version number */ ++ ++/* Auxiliary needed version information. */ ++ ++typedef struct ++{ ++ Elf32_Word vna_hash; /* Hash value of dependency name */ ++ Elf32_Half vna_flags; /* Dependency specific information */ ++ Elf32_Half vna_other; /* Unused */ ++ Elf32_Word vna_name; /* Dependency name string offset */ ++ Elf32_Word vna_next; /* Offset in bytes to next vernaux ++ entry */ ++} Elf32_Vernaux; ++ ++typedef struct ++{ ++ Elf64_Word vna_hash; /* Hash value of dependency name */ ++ Elf64_Half vna_flags; /* Dependency specific information */ ++ Elf64_Half vna_other; /* Unused */ ++ Elf64_Word vna_name; /* Dependency name string offset */ ++ Elf64_Word vna_next; /* Offset in bytes to next vernaux ++ entry */ ++} Elf64_Vernaux; ++ ++ ++/* Legal values for vna_flags. */ ++#define VER_FLG_WEAK 0x2 /* Weak version identifier */ ++ ++ ++/* Auxiliary vector. */ ++ ++/* This vector is normally only used by the program interpreter. The ++ usual definition in an ABI supplement uses the name auxv_t. The ++ vector is not usually defined in a standard file, but it ++ can't hurt. We rename it to avoid conflicts. The sizes of these ++ types are an arrangement between the exec server and the program ++ interpreter, so we don't fully specify them here. */ ++ ++typedef struct ++{ ++ uint32_t a_type; /* Entry type */ ++ union ++ { ++ uint32_t a_val; /* Integer value */ ++ /* We use to have pointer elements added here. We cannot do that, ++ though, since it does not work when using 32-bit definitions ++ on 64-bit platforms and vice versa. */ ++ } a_un; ++} Elf32_auxv_t; ++ ++typedef struct ++{ ++ uint64_t a_type; /* Entry type */ ++ union ++ { ++ uint64_t a_val; /* Integer value */ ++ /* We use to have pointer elements added here. We cannot do that, ++ though, since it does not work when using 32-bit definitions ++ on 64-bit platforms and vice versa. */ ++ } a_un; ++} Elf64_auxv_t; ++ ++/* Legal values for a_type (entry type). */ ++ ++#define AT_NULL 0 /* End of vector */ ++#define AT_IGNORE 1 /* Entry should be ignored */ ++#define AT_EXECFD 2 /* File descriptor of program */ ++#define AT_PHDR 3 /* Program headers for program */ ++#define AT_PHENT 4 /* Size of program header entry */ ++#define AT_PHNUM 5 /* Number of program headers */ ++#define AT_PAGESZ 6 /* System page size */ ++#define AT_BASE 7 /* Base address of interpreter */ ++#define AT_FLAGS 8 /* Flags */ ++#define AT_ENTRY 9 /* Entry point of program */ ++#define AT_NOTELF 10 /* Program is not ELF */ ++#define AT_UID 11 /* Real uid */ ++#define AT_EUID 12 /* Effective uid */ ++#define AT_GID 13 /* Real gid */ ++#define AT_EGID 14 /* Effective gid */ ++#define AT_CLKTCK 17 /* Frequency of times() */ ++ ++/* Some more special a_type values describing the hardware. */ ++#define AT_PLATFORM 15 /* String identifying platform. */ ++#define AT_HWCAP 16 /* Machine dependent hints about ++ processor capabilities. */ ++ ++/* This entry gives some information about the FPU initialization ++ performed by the kernel. */ ++#define AT_FPUCW 18 /* Used FPU control word. */ ++ ++/* Cache block sizes. */ ++#define AT_DCACHEBSIZE 19 /* Data cache block size. */ ++#define AT_ICACHEBSIZE 20 /* Instruction cache block size. */ ++#define AT_UCACHEBSIZE 21 /* Unified cache block size. */ ++ ++/* A special ignored value for PPC, used by the kernel to control the ++ interpretation of the AUXV. Must be > 16. */ ++#define AT_IGNOREPPC 22 /* Entry should be ignored. */ ++ ++#define AT_SECURE 23 /* Boolean, was exec setuid-like? */ ++ ++#define AT_BASE_PLATFORM 24 /* String identifying real platforms.*/ ++ ++#define AT_RANDOM 25 /* Address of 16 random bytes. */ ++ ++#define AT_EXECFN 31 /* Filename of executable. */ ++ ++/* Pointer to the global system page used for system calls and other ++ nice things. */ ++#define AT_SYSINFO 32 ++#define AT_SYSINFO_EHDR 33 ++ ++/* Shapes of the caches. Bits 0-3 contains associativity; bits 4-7 contains ++ log2 of line size; mask those to get cache size. */ ++#define AT_L1I_CACHESHAPE 34 ++#define AT_L1D_CACHESHAPE 35 ++#define AT_L2_CACHESHAPE 36 ++#define AT_L3_CACHESHAPE 37 ++ ++/* Note section contents. Each entry in the note section begins with ++ a header of a fixed form. */ ++ ++typedef struct ++{ ++ Elf32_Word n_namesz; /* Length of the note's name. */ ++ Elf32_Word n_descsz; /* Length of the note's descriptor. */ ++ Elf32_Word n_type; /* Type of the note. */ ++} Elf32_Nhdr; ++ ++typedef struct ++{ ++ Elf64_Word n_namesz; /* Length of the note's name. */ ++ Elf64_Word n_descsz; /* Length of the note's descriptor. */ ++ Elf64_Word n_type; /* Type of the note. */ ++} Elf64_Nhdr; ++ ++/* Known names of notes. */ ++ ++/* Solaris entries in the note section have this name. */ ++#define ELF_NOTE_SOLARIS "SUNW Solaris" ++ ++/* Note entries for GNU systems have this name. */ ++#define ELF_NOTE_GNU "GNU" ++ ++ ++/* Defined types of notes for Solaris. */ ++ ++/* Value of descriptor (one word) is desired pagesize for the binary. */ ++#define ELF_NOTE_PAGESIZE_HINT 1 ++ ++ ++/* Defined note types for GNU systems. */ ++ ++/* ABI information. The descriptor consists of words: ++ word 0: OS descriptor ++ word 1: major version of the ABI ++ word 2: minor version of the ABI ++ word 3: subminor version of the ABI ++*/ ++#define NT_GNU_ABI_TAG 1 ++#define ELF_NOTE_ABI NT_GNU_ABI_TAG /* Old name. */ ++ ++/* Known OSes. These values can appear in word 0 of an ++ NT_GNU_ABI_TAG note section entry. */ ++#define ELF_NOTE_OS_LINUX 0 ++#define ELF_NOTE_OS_GNU 1 ++#define ELF_NOTE_OS_SOLARIS2 2 ++#define ELF_NOTE_OS_FREEBSD 3 ++ ++/* Synthetic hwcap information. The descriptor begins with two words: ++ word 0: number of entries ++ word 1: bitmask of enabled entries ++ Then follow variable-length entries, one byte followed by a ++ '\0'-terminated hwcap name string. The byte gives the bit ++ number to test if enabled, (1U << bit) & bitmask. */ ++#define NT_GNU_HWCAP 2 ++ ++/* Build ID bits as generated by ld --build-id. ++ The descriptor consists of any nonzero number of bytes. */ ++#define NT_GNU_BUILD_ID 3 ++ ++/* Version note generated by GNU gold containing a version string. */ ++#define NT_GNU_GOLD_VERSION 4 ++ ++ ++/* Move records. */ ++typedef struct ++{ ++ Elf32_Xword m_value; /* Symbol value. */ ++ Elf32_Word m_info; /* Size and index. */ ++ Elf32_Word m_poffset; /* Symbol offset. */ ++ Elf32_Half m_repeat; /* Repeat count. */ ++ Elf32_Half m_stride; /* Stride info. */ ++} Elf32_Move; ++ ++typedef struct ++{ ++ Elf64_Xword m_value; /* Symbol value. */ ++ Elf64_Xword m_info; /* Size and index. */ ++ Elf64_Xword m_poffset; /* Symbol offset. */ ++ Elf64_Half m_repeat; /* Repeat count. */ ++ Elf64_Half m_stride; /* Stride info. */ ++} Elf64_Move; ++ ++/* Macro to construct move records. */ ++#define ELF32_M_SYM(info) ((info) >> 8) ++#define ELF32_M_SIZE(info) ((unsigned char) (info)) ++#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size)) ++ ++#define ELF64_M_SYM(info) ELF32_M_SYM (info) ++#define ELF64_M_SIZE(info) ELF32_M_SIZE (info) ++#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size) ++ ++ ++/* Motorola 68k specific definitions. */ ++ ++/* Values for Elf32_Ehdr.e_flags. */ ++#define EF_CPU32 0x00810000 ++ ++/* m68k relocs. */ ++ ++#define R_68K_NONE 0 /* No reloc */ ++#define R_68K_32 1 /* Direct 32 bit */ ++#define R_68K_16 2 /* Direct 16 bit */ ++#define R_68K_8 3 /* Direct 8 bit */ ++#define R_68K_PC32 4 /* PC relative 32 bit */ ++#define R_68K_PC16 5 /* PC relative 16 bit */ ++#define R_68K_PC8 6 /* PC relative 8 bit */ ++#define R_68K_GOT32 7 /* 32 bit PC relative GOT entry */ ++#define R_68K_GOT16 8 /* 16 bit PC relative GOT entry */ ++#define R_68K_GOT8 9 /* 8 bit PC relative GOT entry */ ++#define R_68K_GOT32O 10 /* 32 bit GOT offset */ ++#define R_68K_GOT16O 11 /* 16 bit GOT offset */ ++#define R_68K_GOT8O 12 /* 8 bit GOT offset */ ++#define R_68K_PLT32 13 /* 32 bit PC relative PLT address */ ++#define R_68K_PLT16 14 /* 16 bit PC relative PLT address */ ++#define R_68K_PLT8 15 /* 8 bit PC relative PLT address */ ++#define R_68K_PLT32O 16 /* 32 bit PLT offset */ ++#define R_68K_PLT16O 17 /* 16 bit PLT offset */ ++#define R_68K_PLT8O 18 /* 8 bit PLT offset */ ++#define R_68K_COPY 19 /* Copy symbol at runtime */ ++#define R_68K_GLOB_DAT 20 /* Create GOT entry */ ++#define R_68K_JMP_SLOT 21 /* Create PLT entry */ ++#define R_68K_RELATIVE 22 /* Adjust by program base */ ++#define R_68K_TLS_GD32 25 /* 32 bit GOT offset for GD */ ++#define R_68K_TLS_GD16 26 /* 16 bit GOT offset for GD */ ++#define R_68K_TLS_GD8 27 /* 8 bit GOT offset for GD */ ++#define R_68K_TLS_LDM32 28 /* 32 bit GOT offset for LDM */ ++#define R_68K_TLS_LDM16 29 /* 16 bit GOT offset for LDM */ ++#define R_68K_TLS_LDM8 30 /* 8 bit GOT offset for LDM */ ++#define R_68K_TLS_LDO32 31 /* 32 bit module-relative offset */ ++#define R_68K_TLS_LDO16 32 /* 16 bit module-relative offset */ ++#define R_68K_TLS_LDO8 33 /* 8 bit module-relative offset */ ++#define R_68K_TLS_IE32 34 /* 32 bit GOT offset for IE */ ++#define R_68K_TLS_IE16 35 /* 16 bit GOT offset for IE */ ++#define R_68K_TLS_IE8 36 /* 8 bit GOT offset for IE */ ++#define R_68K_TLS_LE32 37 /* 32 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_LE16 38 /* 16 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_LE8 39 /* 8 bit offset relative to ++ static TLS block */ ++#define R_68K_TLS_DTPMOD32 40 /* 32 bit module number */ ++#define R_68K_TLS_DTPREL32 41 /* 32 bit module-relative offset */ ++#define R_68K_TLS_TPREL32 42 /* 32 bit TP-relative offset */ ++/* Keep this the last entry. */ ++#define R_68K_NUM 43 ++ ++/* Intel 80386 specific definitions. */ ++ ++/* i386 relocs. */ ++ ++#define R_386_NONE 0 /* No reloc */ ++#define R_386_32 1 /* Direct 32 bit */ ++#define R_386_PC32 2 /* PC relative 32 bit */ ++#define R_386_GOT32 3 /* 32 bit GOT entry */ ++#define R_386_PLT32 4 /* 32 bit PLT address */ ++#define R_386_COPY 5 /* Copy symbol at runtime */ ++#define R_386_GLOB_DAT 6 /* Create GOT entry */ ++#define R_386_JMP_SLOT 7 /* Create PLT entry */ ++#define R_386_RELATIVE 8 /* Adjust by program base */ ++#define R_386_GOTOFF 9 /* 32 bit offset to GOT */ ++#define R_386_GOTPC 10 /* 32 bit PC relative offset to GOT */ ++#define R_386_32PLT 11 ++#define R_386_TLS_TPOFF 14 /* Offset in static TLS block */ ++#define R_386_TLS_IE 15 /* Address of GOT entry for static TLS ++ block offset */ ++#define R_386_TLS_GOTIE 16 /* GOT entry for static TLS block ++ offset */ ++#define R_386_TLS_LE 17 /* Offset relative to static TLS ++ block */ ++#define R_386_TLS_GD 18 /* Direct 32 bit for GNU version of ++ general dynamic thread local data */ ++#define R_386_TLS_LDM 19 /* Direct 32 bit for GNU version of ++ local dynamic thread local data ++ in LE code */ ++#define R_386_16 20 ++#define R_386_PC16 21 ++#define R_386_8 22 ++#define R_386_PC8 23 ++#define R_386_TLS_GD_32 24 /* Direct 32 bit for general dynamic ++ thread local data */ ++#define R_386_TLS_GD_PUSH 25 /* Tag for pushl in GD TLS code */ ++#define R_386_TLS_GD_CALL 26 /* Relocation for call to ++ __tls_get_addr() */ ++#define R_386_TLS_GD_POP 27 /* Tag for popl in GD TLS code */ ++#define R_386_TLS_LDM_32 28 /* Direct 32 bit for local dynamic ++ thread local data in LE code */ ++#define R_386_TLS_LDM_PUSH 29 /* Tag for pushl in LDM TLS code */ ++#define R_386_TLS_LDM_CALL 30 /* Relocation for call to ++ __tls_get_addr() in LDM code */ ++#define R_386_TLS_LDM_POP 31 /* Tag for popl in LDM TLS code */ ++#define R_386_TLS_LDO_32 32 /* Offset relative to TLS block */ ++#define R_386_TLS_IE_32 33 /* GOT entry for negated static TLS ++ block offset */ ++#define R_386_TLS_LE_32 34 /* Negated offset relative to static ++ TLS block */ ++#define R_386_TLS_DTPMOD32 35 /* ID of module containing symbol */ ++#define R_386_TLS_DTPOFF32 36 /* Offset in TLS block */ ++#define R_386_TLS_TPOFF32 37 /* Negated offset in static TLS block */ ++/* 38? */ ++#define R_386_TLS_GOTDESC 39 /* GOT offset for TLS descriptor. */ ++#define R_386_TLS_DESC_CALL 40 /* Marker of call through TLS ++ descriptor for ++ relaxation. */ ++#define R_386_TLS_DESC 41 /* TLS descriptor containing ++ pointer to code and to ++ argument, returning the TLS ++ offset for the symbol. */ ++#define R_386_IRELATIVE 42 /* Adjust indirectly by program base */ ++/* Keep this the last entry. */ ++#define R_386_NUM 43 ++ ++/* SUN SPARC specific definitions. */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_SPARC_REGISTER 13 /* Global register reserved to app. */ ++ ++/* Values for Elf64_Ehdr.e_flags. */ ++ ++#define EF_SPARCV9_MM 3 ++#define EF_SPARCV9_TSO 0 ++#define EF_SPARCV9_PSO 1 ++#define EF_SPARCV9_RMO 2 ++#define EF_SPARC_LEDATA 0x800000 /* little endian data */ ++#define EF_SPARC_EXT_MASK 0xFFFF00 ++#define EF_SPARC_32PLUS 0x000100 /* generic V8+ features */ ++#define EF_SPARC_SUN_US1 0x000200 /* Sun UltraSPARC1 extensions */ ++#define EF_SPARC_HAL_R1 0x000400 /* HAL R1 extensions */ ++#define EF_SPARC_SUN_US3 0x000800 /* Sun UltraSPARCIII extensions */ ++ ++/* SPARC relocs. */ ++ ++#define R_SPARC_NONE 0 /* No reloc */ ++#define R_SPARC_8 1 /* Direct 8 bit */ ++#define R_SPARC_16 2 /* Direct 16 bit */ ++#define R_SPARC_32 3 /* Direct 32 bit */ ++#define R_SPARC_DISP8 4 /* PC relative 8 bit */ ++#define R_SPARC_DISP16 5 /* PC relative 16 bit */ ++#define R_SPARC_DISP32 6 /* PC relative 32 bit */ ++#define R_SPARC_WDISP30 7 /* PC relative 30 bit shifted */ ++#define R_SPARC_WDISP22 8 /* PC relative 22 bit shifted */ ++#define R_SPARC_HI22 9 /* High 22 bit */ ++#define R_SPARC_22 10 /* Direct 22 bit */ ++#define R_SPARC_13 11 /* Direct 13 bit */ ++#define R_SPARC_LO10 12 /* Truncated 10 bit */ ++#define R_SPARC_GOT10 13 /* Truncated 10 bit GOT entry */ ++#define R_SPARC_GOT13 14 /* 13 bit GOT entry */ ++#define R_SPARC_GOT22 15 /* 22 bit GOT entry shifted */ ++#define R_SPARC_PC10 16 /* PC relative 10 bit truncated */ ++#define R_SPARC_PC22 17 /* PC relative 22 bit shifted */ ++#define R_SPARC_WPLT30 18 /* 30 bit PC relative PLT address */ ++#define R_SPARC_COPY 19 /* Copy symbol at runtime */ ++#define R_SPARC_GLOB_DAT 20 /* Create GOT entry */ ++#define R_SPARC_JMP_SLOT 21 /* Create PLT entry */ ++#define R_SPARC_RELATIVE 22 /* Adjust by program base */ ++#define R_SPARC_UA32 23 /* Direct 32 bit unaligned */ ++ ++/* Additional Sparc64 relocs. */ ++ ++#define R_SPARC_PLT32 24 /* Direct 32 bit ref to PLT entry */ ++#define R_SPARC_HIPLT22 25 /* High 22 bit PLT entry */ ++#define R_SPARC_LOPLT10 26 /* Truncated 10 bit PLT entry */ ++#define R_SPARC_PCPLT32 27 /* PC rel 32 bit ref to PLT entry */ ++#define R_SPARC_PCPLT22 28 /* PC rel high 22 bit PLT entry */ ++#define R_SPARC_PCPLT10 29 /* PC rel trunc 10 bit PLT entry */ ++#define R_SPARC_10 30 /* Direct 10 bit */ ++#define R_SPARC_11 31 /* Direct 11 bit */ ++#define R_SPARC_64 32 /* Direct 64 bit */ ++#define R_SPARC_OLO10 33 /* 10bit with secondary 13bit addend */ ++#define R_SPARC_HH22 34 /* Top 22 bits of direct 64 bit */ ++#define R_SPARC_HM10 35 /* High middle 10 bits of ... */ ++#define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ ++#define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ ++#define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ ++#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ ++#define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ ++#define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ ++#define R_SPARC_GLOB_JMP 42 /* was part of v9 ABI but was removed */ ++#define R_SPARC_7 43 /* Direct 7 bit */ ++#define R_SPARC_5 44 /* Direct 5 bit */ ++#define R_SPARC_6 45 /* Direct 6 bit */ ++#define R_SPARC_DISP64 46 /* PC relative 64 bit */ ++#define R_SPARC_PLT64 47 /* Direct 64 bit ref to PLT entry */ ++#define R_SPARC_HIX22 48 /* High 22 bit complemented */ ++#define R_SPARC_LOX10 49 /* Truncated 11 bit complemented */ ++#define R_SPARC_H44 50 /* Direct high 12 of 44 bit */ ++#define R_SPARC_M44 51 /* Direct mid 22 of 44 bit */ ++#define R_SPARC_L44 52 /* Direct low 10 of 44 bit */ ++#define R_SPARC_REGISTER 53 /* Global register usage */ ++#define R_SPARC_UA64 54 /* Direct 64 bit unaligned */ ++#define R_SPARC_UA16 55 /* Direct 16 bit unaligned */ ++#define R_SPARC_TLS_GD_HI22 56 ++#define R_SPARC_TLS_GD_LO10 57 ++#define R_SPARC_TLS_GD_ADD 58 ++#define R_SPARC_TLS_GD_CALL 59 ++#define R_SPARC_TLS_LDM_HI22 60 ++#define R_SPARC_TLS_LDM_LO10 61 ++#define R_SPARC_TLS_LDM_ADD 62 ++#define R_SPARC_TLS_LDM_CALL 63 ++#define R_SPARC_TLS_LDO_HIX22 64 ++#define R_SPARC_TLS_LDO_LOX10 65 ++#define R_SPARC_TLS_LDO_ADD 66 ++#define R_SPARC_TLS_IE_HI22 67 ++#define R_SPARC_TLS_IE_LO10 68 ++#define R_SPARC_TLS_IE_LD 69 ++#define R_SPARC_TLS_IE_LDX 70 ++#define R_SPARC_TLS_IE_ADD 71 ++#define R_SPARC_TLS_LE_HIX22 72 ++#define R_SPARC_TLS_LE_LOX10 73 ++#define R_SPARC_TLS_DTPMOD32 74 ++#define R_SPARC_TLS_DTPMOD64 75 ++#define R_SPARC_TLS_DTPOFF32 76 ++#define R_SPARC_TLS_DTPOFF64 77 ++#define R_SPARC_TLS_TPOFF32 78 ++#define R_SPARC_TLS_TPOFF64 79 ++#define R_SPARC_GOTDATA_HIX22 80 ++#define R_SPARC_GOTDATA_LOX10 81 ++#define R_SPARC_GOTDATA_OP_HIX22 82 ++#define R_SPARC_GOTDATA_OP_LOX10 83 ++#define R_SPARC_GOTDATA_OP 84 ++#define R_SPARC_H34 85 ++#define R_SPARC_SIZE32 86 ++#define R_SPARC_SIZE64 87 ++#define R_SPARC_WDISP10 88 ++#define R_SPARC_JMP_IREL 248 ++#define R_SPARC_IRELATIVE 249 ++#define R_SPARC_GNU_VTINHERIT 250 ++#define R_SPARC_GNU_VTENTRY 251 ++#define R_SPARC_REV32 252 ++/* Keep this the last entry. */ ++#define R_SPARC_NUM 253 ++ ++/* For Sparc64, legal values for d_tag of Elf64_Dyn. */ ++ ++#define DT_SPARC_REGISTER 0x70000001 ++#define DT_SPARC_NUM 2 ++ ++/* MIPS R3000 specific definitions. */ ++ ++/* Legal values for e_flags field of Elf32_Ehdr. */ ++ ++#define EF_MIPS_NOREORDER 1 /* A .noreorder directive was used */ ++#define EF_MIPS_PIC 2 /* Contains PIC code */ ++#define EF_MIPS_CPIC 4 /* Uses PIC calling sequence */ ++#define EF_MIPS_XGOT 8 ++#define EF_MIPS_64BIT_WHIRL 16 ++#define EF_MIPS_ABI2 32 ++#define EF_MIPS_ABI_ON32 64 ++#define EF_MIPS_ARCH 0xf0000000 /* MIPS architecture level */ ++ ++/* Legal values for MIPS architecture level. */ ++ ++#define EF_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ ++#define EF_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ ++#define EF_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ ++#define EF_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ ++#define EF_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ ++#define EF_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ ++#define EF_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ ++ ++/* The following are non-official names and should not be used. */ ++ ++#define E_MIPS_ARCH_1 0x00000000 /* -mips1 code. */ ++#define E_MIPS_ARCH_2 0x10000000 /* -mips2 code. */ ++#define E_MIPS_ARCH_3 0x20000000 /* -mips3 code. */ ++#define E_MIPS_ARCH_4 0x30000000 /* -mips4 code. */ ++#define E_MIPS_ARCH_5 0x40000000 /* -mips5 code. */ ++#define E_MIPS_ARCH_32 0x60000000 /* MIPS32 code. */ ++#define E_MIPS_ARCH_64 0x70000000 /* MIPS64 code. */ ++ ++/* Special section indices. */ ++ ++#define SHN_MIPS_ACOMMON 0xff00 /* Allocated common symbols */ ++#define SHN_MIPS_TEXT 0xff01 /* Allocated test symbols. */ ++#define SHN_MIPS_DATA 0xff02 /* Allocated data symbols. */ ++#define SHN_MIPS_SCOMMON 0xff03 /* Small common symbols */ ++#define SHN_MIPS_SUNDEFINED 0xff04 /* Small undefined symbols */ ++ ++/* Legal values for sh_type field of Elf32_Shdr. */ ++ ++#define SHT_MIPS_LIBLIST 0x70000000 /* Shared objects used in link */ ++#define SHT_MIPS_MSYM 0x70000001 ++#define SHT_MIPS_CONFLICT 0x70000002 /* Conflicting symbols */ ++#define SHT_MIPS_GPTAB 0x70000003 /* Global data area sizes */ ++#define SHT_MIPS_UCODE 0x70000004 /* Reserved for SGI/MIPS compilers */ ++#define SHT_MIPS_DEBUG 0x70000005 /* MIPS ECOFF debugging information*/ ++#define SHT_MIPS_REGINFO 0x70000006 /* Register usage information */ ++#define SHT_MIPS_PACKAGE 0x70000007 ++#define SHT_MIPS_PACKSYM 0x70000008 ++#define SHT_MIPS_RELD 0x70000009 ++#define SHT_MIPS_IFACE 0x7000000b ++#define SHT_MIPS_CONTENT 0x7000000c ++#define SHT_MIPS_OPTIONS 0x7000000d /* Miscellaneous options. */ ++#define SHT_MIPS_SHDR 0x70000010 ++#define SHT_MIPS_FDESC 0x70000011 ++#define SHT_MIPS_EXTSYM 0x70000012 ++#define SHT_MIPS_DENSE 0x70000013 ++#define SHT_MIPS_PDESC 0x70000014 ++#define SHT_MIPS_LOCSYM 0x70000015 ++#define SHT_MIPS_AUXSYM 0x70000016 ++#define SHT_MIPS_OPTSYM 0x70000017 ++#define SHT_MIPS_LOCSTR 0x70000018 ++#define SHT_MIPS_LINE 0x70000019 ++#define SHT_MIPS_RFDESC 0x7000001a ++#define SHT_MIPS_DELTASYM 0x7000001b ++#define SHT_MIPS_DELTAINST 0x7000001c ++#define SHT_MIPS_DELTACLASS 0x7000001d ++#define SHT_MIPS_DWARF 0x7000001e /* DWARF debugging information. */ ++#define SHT_MIPS_DELTADECL 0x7000001f ++#define SHT_MIPS_SYMBOL_LIB 0x70000020 ++#define SHT_MIPS_EVENTS 0x70000021 /* Event section. */ ++#define SHT_MIPS_TRANSLATE 0x70000022 ++#define SHT_MIPS_PIXIE 0x70000023 ++#define SHT_MIPS_XLATE 0x70000024 ++#define SHT_MIPS_XLATE_DEBUG 0x70000025 ++#define SHT_MIPS_WHIRL 0x70000026 ++#define SHT_MIPS_EH_REGION 0x70000027 ++#define SHT_MIPS_XLATE_OLD 0x70000028 ++#define SHT_MIPS_PDR_EXCEPTION 0x70000029 ++ ++/* Legal values for sh_flags field of Elf32_Shdr. */ ++ ++#define SHF_MIPS_GPREL 0x10000000 /* Must be part of global data area */ ++#define SHF_MIPS_MERGE 0x20000000 ++#define SHF_MIPS_ADDR 0x40000000 ++#define SHF_MIPS_STRINGS 0x80000000 ++#define SHF_MIPS_NOSTRIP 0x08000000 ++#define SHF_MIPS_LOCAL 0x04000000 ++#define SHF_MIPS_NAMES 0x02000000 ++#define SHF_MIPS_NODUPE 0x01000000 ++ ++ ++/* Symbol tables. */ ++ ++/* MIPS specific values for `st_other'. */ ++#define STO_MIPS_DEFAULT 0x0 ++#define STO_MIPS_INTERNAL 0x1 ++#define STO_MIPS_HIDDEN 0x2 ++#define STO_MIPS_PROTECTED 0x3 ++#define STO_MIPS_PLT 0x8 ++#define STO_MIPS_SC_ALIGN_UNUSED 0xff ++ ++/* MIPS specific values for `st_info'. */ ++#define STB_MIPS_SPLIT_COMMON 13 ++ ++/* Entries found in sections of type SHT_MIPS_GPTAB. */ ++ ++typedef union ++{ ++ struct ++ { ++ Elf32_Word gt_current_g_value; /* -G value used for compilation */ ++ Elf32_Word gt_unused; /* Not used */ ++ } gt_header; /* First entry in section */ ++ struct ++ { ++ Elf32_Word gt_g_value; /* If this value were used for -G */ ++ Elf32_Word gt_bytes; /* This many bytes would be used */ ++ } gt_entry; /* Subsequent entries in section */ ++} Elf32_gptab; ++ ++/* Entry found in sections of type SHT_MIPS_REGINFO. */ ++ ++typedef struct ++{ ++ Elf32_Word ri_gprmask; /* General registers used */ ++ Elf32_Word ri_cprmask[4]; /* Coprocessor registers used */ ++ Elf32_Sword ri_gp_value; /* $gp register value */ ++} Elf32_RegInfo; ++ ++/* Entries found in sections of type SHT_MIPS_OPTIONS. */ ++ ++typedef struct ++{ ++ unsigned char kind; /* Determines interpretation of the ++ variable part of descriptor. */ ++ unsigned char size; /* Size of descriptor, including header. */ ++ Elf32_Section section; /* Section header index of section affected, ++ 0 for global options. */ ++ Elf32_Word info; /* Kind-specific information. */ ++} Elf_Options; ++ ++/* Values for `kind' field in Elf_Options. */ ++ ++#define ODK_NULL 0 /* Undefined. */ ++#define ODK_REGINFO 1 /* Register usage information. */ ++#define ODK_EXCEPTIONS 2 /* Exception processing options. */ ++#define ODK_PAD 3 /* Section padding options. */ ++#define ODK_HWPATCH 4 /* Hardware workarounds performed */ ++#define ODK_FILL 5 /* record the fill value used by the linker. */ ++#define ODK_TAGS 6 /* reserve space for desktop tools to write. */ ++#define ODK_HWAND 7 /* HW workarounds. 'AND' bits when merging. */ ++#define ODK_HWOR 8 /* HW workarounds. 'OR' bits when merging. */ ++ ++/* Values for `info' in Elf_Options for ODK_EXCEPTIONS entries. */ ++ ++#define OEX_FPU_MIN 0x1f /* FPE's which MUST be enabled. */ ++#define OEX_FPU_MAX 0x1f00 /* FPE's which MAY be enabled. */ ++#define OEX_PAGE0 0x10000 /* page zero must be mapped. */ ++#define OEX_SMM 0x20000 /* Force sequential memory mode? */ ++#define OEX_FPDBUG 0x40000 /* Force floating point debug mode? */ ++#define OEX_PRECISEFP OEX_FPDBUG ++#define OEX_DISMISS 0x80000 /* Dismiss invalid address faults? */ ++ ++#define OEX_FPU_INVAL 0x10 ++#define OEX_FPU_DIV0 0x08 ++#define OEX_FPU_OFLO 0x04 ++#define OEX_FPU_UFLO 0x02 ++#define OEX_FPU_INEX 0x01 ++ ++/* Masks for `info' in Elf_Options for an ODK_HWPATCH entry. */ ++ ++#define OHW_R4KEOP 0x1 /* R4000 end-of-page patch. */ ++#define OHW_R8KPFETCH 0x2 /* may need R8000 prefetch patch. */ ++#define OHW_R5KEOP 0x4 /* R5000 end-of-page patch. */ ++#define OHW_R5KCVTL 0x8 /* R5000 cvt.[ds].l bug. clean=1. */ ++ ++#define OPAD_PREFIX 0x1 ++#define OPAD_POSTFIX 0x2 ++#define OPAD_SYMBOL 0x4 ++ ++/* Entry found in `.options' section. */ ++ ++typedef struct ++{ ++ Elf32_Word hwp_flags1; /* Extra flags. */ ++ Elf32_Word hwp_flags2; /* Extra flags. */ ++} Elf_Options_Hw; ++ ++/* Masks for `info' in ElfOptions for ODK_HWAND and ODK_HWOR entries. */ ++ ++#define OHWA0_R4KEOP_CHECKED 0x00000001 ++#define OHWA1_R4KEOP_CLEAN 0x00000002 ++ ++/* MIPS relocs. */ ++ ++#define R_MIPS_NONE 0 /* No reloc */ ++#define R_MIPS_16 1 /* Direct 16 bit */ ++#define R_MIPS_32 2 /* Direct 32 bit */ ++#define R_MIPS_REL32 3 /* PC relative 32 bit */ ++#define R_MIPS_26 4 /* Direct 26 bit shifted */ ++#define R_MIPS_HI16 5 /* High 16 bit */ ++#define R_MIPS_LO16 6 /* Low 16 bit */ ++#define R_MIPS_GPREL16 7 /* GP relative 16 bit */ ++#define R_MIPS_LITERAL 8 /* 16 bit literal entry */ ++#define R_MIPS_GOT16 9 /* 16 bit GOT entry */ ++#define R_MIPS_PC16 10 /* PC relative 16 bit */ ++#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */ ++#define R_MIPS_GPREL32 12 /* GP relative 32 bit */ ++ ++#define R_MIPS_SHIFT5 16 ++#define R_MIPS_SHIFT6 17 ++#define R_MIPS_64 18 ++#define R_MIPS_GOT_DISP 19 ++#define R_MIPS_GOT_PAGE 20 ++#define R_MIPS_GOT_OFST 21 ++#define R_MIPS_GOT_HI16 22 ++#define R_MIPS_GOT_LO16 23 ++#define R_MIPS_SUB 24 ++#define R_MIPS_INSERT_A 25 ++#define R_MIPS_INSERT_B 26 ++#define R_MIPS_DELETE 27 ++#define R_MIPS_HIGHER 28 ++#define R_MIPS_HIGHEST 29 ++#define R_MIPS_CALL_HI16 30 ++#define R_MIPS_CALL_LO16 31 ++#define R_MIPS_SCN_DISP 32 ++#define R_MIPS_REL16 33 ++#define R_MIPS_ADD_IMMEDIATE 34 ++#define R_MIPS_PJUMP 35 ++#define R_MIPS_RELGOT 36 ++#define R_MIPS_JALR 37 ++#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ ++#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ ++#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ ++#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ ++#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ ++#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ ++#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ ++#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ ++#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ ++#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ ++#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ ++#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ ++#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ ++#define R_MIPS_GLOB_DAT 51 ++#define R_MIPS_COPY 126 ++#define R_MIPS_JUMP_SLOT 127 ++/* Keep this the last entry. */ ++#define R_MIPS_NUM 128 ++ ++/* Legal values for p_type field of Elf32_Phdr. */ ++ ++#define PT_MIPS_REGINFO 0x70000000 /* Register usage information */ ++#define PT_MIPS_RTPROC 0x70000001 /* Runtime procedure table. */ ++#define PT_MIPS_OPTIONS 0x70000002 ++ ++/* Special program header types. */ ++ ++#define PF_MIPS_LOCAL 0x10000000 ++ ++/* Legal values for d_tag field of Elf32_Dyn. */ ++ ++#define DT_MIPS_RLD_VERSION 0x70000001 /* Runtime linker interface version */ ++#define DT_MIPS_TIME_STAMP 0x70000002 /* Timestamp */ ++#define DT_MIPS_ICHECKSUM 0x70000003 /* Checksum */ ++#define DT_MIPS_IVERSION 0x70000004 /* Version string (string tbl index) */ ++#define DT_MIPS_FLAGS 0x70000005 /* Flags */ ++#define DT_MIPS_BASE_ADDRESS 0x70000006 /* Base address */ ++#define DT_MIPS_MSYM 0x70000007 ++#define DT_MIPS_CONFLICT 0x70000008 /* Address of CONFLICT section */ ++#define DT_MIPS_LIBLIST 0x70000009 /* Address of LIBLIST section */ ++#define DT_MIPS_LOCAL_GOTNO 0x7000000a /* Number of local GOT entries */ ++#define DT_MIPS_CONFLICTNO 0x7000000b /* Number of CONFLICT entries */ ++#define DT_MIPS_LIBLISTNO 0x70000010 /* Number of LIBLIST entries */ ++#define DT_MIPS_SYMTABNO 0x70000011 /* Number of DYNSYM entries */ ++#define DT_MIPS_UNREFEXTNO 0x70000012 /* First external DYNSYM */ ++#define DT_MIPS_GOTSYM 0x70000013 /* First GOT entry in DYNSYM */ ++#define DT_MIPS_HIPAGENO 0x70000014 /* Number of GOT page table entries */ ++#define DT_MIPS_RLD_MAP 0x70000016 /* Address of run time loader map. */ ++#define DT_MIPS_DELTA_CLASS 0x70000017 /* Delta C++ class definition. */ ++#define DT_MIPS_DELTA_CLASS_NO 0x70000018 /* Number of entries in ++ DT_MIPS_DELTA_CLASS. */ ++#define DT_MIPS_DELTA_INSTANCE 0x70000019 /* Delta C++ class instances. */ ++#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a /* Number of entries in ++ DT_MIPS_DELTA_INSTANCE. */ ++#define DT_MIPS_DELTA_RELOC 0x7000001b /* Delta relocations. */ ++#define DT_MIPS_DELTA_RELOC_NO 0x7000001c /* Number of entries in ++ DT_MIPS_DELTA_RELOC. */ ++#define DT_MIPS_DELTA_SYM 0x7000001d /* Delta symbols that Delta ++ relocations refer to. */ ++#define DT_MIPS_DELTA_SYM_NO 0x7000001e /* Number of entries in ++ DT_MIPS_DELTA_SYM. */ ++#define DT_MIPS_DELTA_CLASSSYM 0x70000020 /* Delta symbols that hold the ++ class declaration. */ ++#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021 /* Number of entries in ++ DT_MIPS_DELTA_CLASSSYM. */ ++#define DT_MIPS_CXX_FLAGS 0x70000022 /* Flags indicating for C++ flavor. */ ++#define DT_MIPS_PIXIE_INIT 0x70000023 ++#define DT_MIPS_SYMBOL_LIB 0x70000024 ++#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025 ++#define DT_MIPS_LOCAL_GOTIDX 0x70000026 ++#define DT_MIPS_HIDDEN_GOTIDX 0x70000027 ++#define DT_MIPS_PROTECTED_GOTIDX 0x70000028 ++#define DT_MIPS_OPTIONS 0x70000029 /* Address of .options. */ ++#define DT_MIPS_INTERFACE 0x7000002a /* Address of .interface. */ ++#define DT_MIPS_DYNSTR_ALIGN 0x7000002b ++#define DT_MIPS_INTERFACE_SIZE 0x7000002c /* Size of the .interface section. */ ++#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d /* Address of rld_text_rsolve ++ function stored in GOT. */ ++#define DT_MIPS_PERF_SUFFIX 0x7000002e /* Default suffix of dso to be added ++ by rld on dlopen() calls. */ ++#define DT_MIPS_COMPACT_SIZE 0x7000002f /* (O32)Size of compact rel section. */ ++#define DT_MIPS_GP_VALUE 0x70000030 /* GP value for aux GOTs. */ ++#define DT_MIPS_AUX_DYNAMIC 0x70000031 /* Address of aux .dynamic. */ ++/* The address of .got.plt in an executable using the new non-PIC ABI. */ ++#define DT_MIPS_PLTGOT 0x70000032 ++/* The base of the PLT in an executable using the new non-PIC ABI if that ++ PLT is writable. For a non-writable PLT, this is omitted or has a zero ++ value. */ ++#define DT_MIPS_RWPLT 0x70000034 ++#define DT_MIPS_NUM 0x35 ++ ++/* Legal values for DT_MIPS_FLAGS Elf32_Dyn entry. */ ++ ++#define RHF_NONE 0 /* No flags */ ++#define RHF_QUICKSTART (1 << 0) /* Use quickstart */ ++#define RHF_NOTPOT (1 << 1) /* Hash size not power of 2 */ ++#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2) /* Ignore LD_LIBRARY_PATH */ ++#define RHF_NO_MOVE (1 << 3) ++#define RHF_SGI_ONLY (1 << 4) ++#define RHF_GUARANTEE_INIT (1 << 5) ++#define RHF_DELTA_C_PLUS_PLUS (1 << 6) ++#define RHF_GUARANTEE_START_INIT (1 << 7) ++#define RHF_PIXIE (1 << 8) ++#define RHF_DEFAULT_DELAY_LOAD (1 << 9) ++#define RHF_REQUICKSTART (1 << 10) ++#define RHF_REQUICKSTARTED (1 << 11) ++#define RHF_CORD (1 << 12) ++#define RHF_NO_UNRES_UNDEF (1 << 13) ++#define RHF_RLD_ORDER_SAFE (1 << 14) ++ ++/* Entries found in sections of type SHT_MIPS_LIBLIST. */ ++ ++typedef struct ++{ ++ Elf32_Word l_name; /* Name (string table index) */ ++ Elf32_Word l_time_stamp; /* Timestamp */ ++ Elf32_Word l_checksum; /* Checksum */ ++ Elf32_Word l_version; /* Interface version */ ++ Elf32_Word l_flags; /* Flags */ ++} Elf32_Lib; ++ ++typedef struct ++{ ++ Elf64_Word l_name; /* Name (string table index) */ ++ Elf64_Word l_time_stamp; /* Timestamp */ ++ Elf64_Word l_checksum; /* Checksum */ ++ Elf64_Word l_version; /* Interface version */ ++ Elf64_Word l_flags; /* Flags */ ++} Elf64_Lib; ++ ++ ++/* Legal values for l_flags. */ ++ ++#define LL_NONE 0 ++#define LL_EXACT_MATCH (1 << 0) /* Require exact match */ ++#define LL_IGNORE_INT_VER (1 << 1) /* Ignore interface version */ ++#define LL_REQUIRE_MINOR (1 << 2) ++#define LL_EXPORTS (1 << 3) ++#define LL_DELAY_LOAD (1 << 4) ++#define LL_DELTA (1 << 5) ++ ++/* Entries found in sections of type SHT_MIPS_CONFLICT. */ ++ ++typedef Elf32_Addr Elf32_Conflict; ++ ++ ++/* HPPA specific definitions. */ ++ ++/* Legal values for e_flags field of Elf32_Ehdr. */ ++ ++#define EF_PARISC_TRAPNIL 0x00010000 /* Trap nil pointer dereference. */ ++#define EF_PARISC_EXT 0x00020000 /* Program uses arch. extensions. */ ++#define EF_PARISC_LSB 0x00040000 /* Program expects little endian. */ ++#define EF_PARISC_WIDE 0x00080000 /* Program expects wide mode. */ ++#define EF_PARISC_NO_KABP 0x00100000 /* No kernel assisted branch ++ prediction. */ ++#define EF_PARISC_LAZYSWAP 0x00400000 /* Allow lazy swapping. */ ++#define EF_PARISC_ARCH 0x0000ffff /* Architecture version. */ ++ ++/* Defined values for `e_flags & EF_PARISC_ARCH' are: */ ++ ++#define EFA_PARISC_1_0 0x020b /* PA-RISC 1.0 big-endian. */ ++#define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ ++#define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ ++ ++/* Additional section indeces. */ ++ ++#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared ++ symbols in ANSI C. */ ++#define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ ++ ++/* Legal values for sh_type field of Elf32_Shdr. */ ++ ++#define SHT_PARISC_EXT 0x70000000 /* Contains product specific ext. */ ++#define SHT_PARISC_UNWIND 0x70000001 /* Unwind information. */ ++#define SHT_PARISC_DOC 0x70000002 /* Debug info for optimized code. */ ++ ++/* Legal values for sh_flags field of Elf32_Shdr. */ ++ ++#define SHF_PARISC_SHORT 0x20000000 /* Section with short addressing. */ ++#define SHF_PARISC_HUGE 0x40000000 /* Section far from gp. */ ++#define SHF_PARISC_SBP 0x80000000 /* Static branch prediction code. */ ++ ++/* Legal values for ST_TYPE subfield of st_info (symbol type). */ ++ ++#define STT_PARISC_MILLICODE 13 /* Millicode function entry point. */ ++ ++#define STT_HP_OPAQUE (STT_LOOS + 0x1) ++#define STT_HP_STUB (STT_LOOS + 0x2) ++ ++/* HPPA relocs. */ ++ ++#define R_PARISC_NONE 0 /* No reloc. */ ++#define R_PARISC_DIR32 1 /* Direct 32-bit reference. */ ++#define R_PARISC_DIR21L 2 /* Left 21 bits of eff. address. */ ++#define R_PARISC_DIR17R 3 /* Right 17 bits of eff. address. */ ++#define R_PARISC_DIR17F 4 /* 17 bits of eff. address. */ ++#define R_PARISC_DIR14R 6 /* Right 14 bits of eff. address. */ ++#define R_PARISC_PCREL32 9 /* 32-bit rel. address. */ ++#define R_PARISC_PCREL21L 10 /* Left 21 bits of rel. address. */ ++#define R_PARISC_PCREL17R 11 /* Right 17 bits of rel. address. */ ++#define R_PARISC_PCREL17F 12 /* 17 bits of rel. address. */ ++#define R_PARISC_PCREL14R 14 /* Right 14 bits of rel. address. */ ++#define R_PARISC_DPREL21L 18 /* Left 21 bits of rel. address. */ ++#define R_PARISC_DPREL14R 22 /* Right 14 bits of rel. address. */ ++#define R_PARISC_GPREL21L 26 /* GP-relative, left 21 bits. */ ++#define R_PARISC_GPREL14R 30 /* GP-relative, right 14 bits. */ ++#define R_PARISC_LTOFF21L 34 /* LT-relative, left 21 bits. */ ++#define R_PARISC_LTOFF14R 38 /* LT-relative, right 14 bits. */ ++#define R_PARISC_SECREL32 41 /* 32 bits section rel. address. */ ++#define R_PARISC_SEGBASE 48 /* No relocation, set segment base. */ ++#define R_PARISC_SEGREL32 49 /* 32 bits segment rel. address. */ ++#define R_PARISC_PLTOFF21L 50 /* PLT rel. address, left 21 bits. */ ++#define R_PARISC_PLTOFF14R 54 /* PLT rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR32 57 /* 32 bits LT-rel. function pointer. */ ++#define R_PARISC_LTOFF_FPTR21L 58 /* LT-rel. fct ptr, left 21 bits. */ ++#define R_PARISC_LTOFF_FPTR14R 62 /* LT-rel. fct ptr, right 14 bits. */ ++#define R_PARISC_FPTR64 64 /* 64 bits function address. */ ++#define R_PARISC_PLABEL32 65 /* 32 bits function address. */ ++#define R_PARISC_PLABEL21L 66 /* Left 21 bits of fdesc address. */ ++#define R_PARISC_PLABEL14R 70 /* Right 14 bits of fdesc address. */ ++#define R_PARISC_PCREL64 72 /* 64 bits PC-rel. address. */ ++#define R_PARISC_PCREL22F 74 /* 22 bits PC-rel. address. */ ++#define R_PARISC_PCREL14WR 75 /* PC-rel. address, right 14 bits. */ ++#define R_PARISC_PCREL14DR 76 /* PC rel. address, right 14 bits. */ ++#define R_PARISC_PCREL16F 77 /* 16 bits PC-rel. address. */ ++#define R_PARISC_PCREL16WF 78 /* 16 bits PC-rel. address. */ ++#define R_PARISC_PCREL16DF 79 /* 16 bits PC-rel. address. */ ++#define R_PARISC_DIR64 80 /* 64 bits of eff. address. */ ++#define R_PARISC_DIR14WR 83 /* 14 bits of eff. address. */ ++#define R_PARISC_DIR14DR 84 /* 14 bits of eff. address. */ ++#define R_PARISC_DIR16F 85 /* 16 bits of eff. address. */ ++#define R_PARISC_DIR16WF 86 /* 16 bits of eff. address. */ ++#define R_PARISC_DIR16DF 87 /* 16 bits of eff. address. */ ++#define R_PARISC_GPREL64 88 /* 64 bits of GP-rel. address. */ ++#define R_PARISC_GPREL14WR 91 /* GP-rel. address, right 14 bits. */ ++#define R_PARISC_GPREL14DR 92 /* GP-rel. address, right 14 bits. */ ++#define R_PARISC_GPREL16F 93 /* 16 bits GP-rel. address. */ ++#define R_PARISC_GPREL16WF 94 /* 16 bits GP-rel. address. */ ++#define R_PARISC_GPREL16DF 95 /* 16 bits GP-rel. address. */ ++#define R_PARISC_LTOFF64 96 /* 64 bits LT-rel. address. */ ++#define R_PARISC_LTOFF14WR 99 /* LT-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF14DR 100 /* LT-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF16F 101 /* 16 bits LT-rel. address. */ ++#define R_PARISC_LTOFF16WF 102 /* 16 bits LT-rel. address. */ ++#define R_PARISC_LTOFF16DF 103 /* 16 bits LT-rel. address. */ ++#define R_PARISC_SECREL64 104 /* 64 bits section rel. address. */ ++#define R_PARISC_SEGREL64 112 /* 64 bits segment rel. address. */ ++#define R_PARISC_PLTOFF14WR 115 /* PLT-rel. address, right 14 bits. */ ++#define R_PARISC_PLTOFF14DR 116 /* PLT-rel. address, right 14 bits. */ ++#define R_PARISC_PLTOFF16F 117 /* 16 bits LT-rel. address. */ ++#define R_PARISC_PLTOFF16WF 118 /* 16 bits PLT-rel. address. */ ++#define R_PARISC_PLTOFF16DF 119 /* 16 bits PLT-rel. address. */ ++#define R_PARISC_LTOFF_FPTR64 120 /* 64 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR14WR 123 /* LT-rel. fct. ptr., right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR14DR 124 /* LT-rel. fct. ptr., right 14 bits. */ ++#define R_PARISC_LTOFF_FPTR16F 125 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR16WF 126 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LTOFF_FPTR16DF 127 /* 16 bits LT-rel. function ptr. */ ++#define R_PARISC_LORESERVE 128 ++#define R_PARISC_COPY 128 /* Copy relocation. */ ++#define R_PARISC_IPLT 129 /* Dynamic reloc, imported PLT */ ++#define R_PARISC_EPLT 130 /* Dynamic reloc, exported PLT */ ++#define R_PARISC_TPREL32 153 /* 32 bits TP-rel. address. */ ++#define R_PARISC_TPREL21L 154 /* TP-rel. address, left 21 bits. */ ++#define R_PARISC_TPREL14R 158 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_LTOFF_TP21L 162 /* LT-TP-rel. address, left 21 bits. */ ++#define R_PARISC_LTOFF_TP14R 166 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP14F 167 /* 14 bits LT-TP-rel. address. */ ++#define R_PARISC_TPREL64 216 /* 64 bits TP-rel. address. */ ++#define R_PARISC_TPREL14WR 219 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_TPREL14DR 220 /* TP-rel. address, right 14 bits. */ ++#define R_PARISC_TPREL16F 221 /* 16 bits TP-rel. address. */ ++#define R_PARISC_TPREL16WF 222 /* 16 bits TP-rel. address. */ ++#define R_PARISC_TPREL16DF 223 /* 16 bits TP-rel. address. */ ++#define R_PARISC_LTOFF_TP64 224 /* 64 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP14WR 227 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP14DR 228 /* LT-TP-rel. address, right 14 bits.*/ ++#define R_PARISC_LTOFF_TP16F 229 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP16WF 230 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ ++#define R_PARISC_GNU_VTENTRY 232 ++#define R_PARISC_GNU_VTINHERIT 233 ++#define R_PARISC_TLS_GD21L 234 /* GD 21-bit left. */ ++#define R_PARISC_TLS_GD14R 235 /* GD 14-bit right. */ ++#define R_PARISC_TLS_GDCALL 236 /* GD call to __t_g_a. */ ++#define R_PARISC_TLS_LDM21L 237 /* LD module 21-bit left. */ ++#define R_PARISC_TLS_LDM14R 238 /* LD module 14-bit right. */ ++#define R_PARISC_TLS_LDMCALL 239 /* LD module call to __t_g_a. */ ++#define R_PARISC_TLS_LDO21L 240 /* LD offset 21-bit left. */ ++#define R_PARISC_TLS_LDO14R 241 /* LD offset 14-bit right. */ ++#define R_PARISC_TLS_DTPMOD32 242 /* DTP module 32-bit. */ ++#define R_PARISC_TLS_DTPMOD64 243 /* DTP module 64-bit. */ ++#define R_PARISC_TLS_DTPOFF32 244 /* DTP offset 32-bit. */ ++#define R_PARISC_TLS_DTPOFF64 245 /* DTP offset 32-bit. */ ++#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L ++#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R ++#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L ++#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R ++#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32 ++#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64 ++#define R_PARISC_HIRESERVE 255 ++ ++/* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ ++ ++#define PT_HP_TLS (PT_LOOS + 0x0) ++#define PT_HP_CORE_NONE (PT_LOOS + 0x1) ++#define PT_HP_CORE_VERSION (PT_LOOS + 0x2) ++#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3) ++#define PT_HP_CORE_COMM (PT_LOOS + 0x4) ++#define PT_HP_CORE_PROC (PT_LOOS + 0x5) ++#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6) ++#define PT_HP_CORE_STACK (PT_LOOS + 0x7) ++#define PT_HP_CORE_SHM (PT_LOOS + 0x8) ++#define PT_HP_CORE_MMF (PT_LOOS + 0x9) ++#define PT_HP_PARALLEL (PT_LOOS + 0x10) ++#define PT_HP_FASTBIND (PT_LOOS + 0x11) ++#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12) ++#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13) ++#define PT_HP_STACK (PT_LOOS + 0x14) ++ ++#define PT_PARISC_ARCHEXT 0x70000000 ++#define PT_PARISC_UNWIND 0x70000001 ++ ++/* Legal values for p_flags field of Elf32_Phdr/Elf64_Phdr. */ ++ ++#define PF_PARISC_SBP 0x08000000 ++ ++#define PF_HP_PAGE_SIZE 0x00100000 ++#define PF_HP_FAR_SHARED 0x00200000 ++#define PF_HP_NEAR_SHARED 0x00400000 ++#define PF_HP_CODE 0x01000000 ++#define PF_HP_MODIFY 0x02000000 ++#define PF_HP_LAZYSWAP 0x04000000 ++#define PF_HP_SBP 0x08000000 ++ ++ ++/* Alpha specific definitions. */ ++ ++/* Legal values for e_flags field of Elf64_Ehdr. */ ++ ++#define EF_ALPHA_32BIT 1 /* All addresses must be < 2GB. */ ++#define EF_ALPHA_CANRELAX 2 /* Relocations for relaxing exist. */ ++ ++/* Legal values for sh_type field of Elf64_Shdr. */ ++ ++/* These two are primerily concerned with ECOFF debugging info. */ ++#define SHT_ALPHA_DEBUG 0x70000001 ++#define SHT_ALPHA_REGINFO 0x70000002 ++ ++/* Legal values for sh_flags field of Elf64_Shdr. */ ++ ++#define SHF_ALPHA_GPREL 0x10000000 ++ ++/* Legal values for st_other field of Elf64_Sym. */ ++#define STO_ALPHA_NOPV 0x80 /* No PV required. */ ++#define STO_ALPHA_STD_GPLOAD 0x88 /* PV only used for initial ldgp. */ ++ ++/* Alpha relocs. */ ++ ++#define R_ALPHA_NONE 0 /* No reloc */ ++#define R_ALPHA_REFLONG 1 /* Direct 32 bit */ ++#define R_ALPHA_REFQUAD 2 /* Direct 64 bit */ ++#define R_ALPHA_GPREL32 3 /* GP relative 32 bit */ ++#define R_ALPHA_LITERAL 4 /* GP relative 16 bit w/optimization */ ++#define R_ALPHA_LITUSE 5 /* Optimization hint for LITERAL */ ++#define R_ALPHA_GPDISP 6 /* Add displacement to GP */ ++#define R_ALPHA_BRADDR 7 /* PC+4 relative 23 bit shifted */ ++#define R_ALPHA_HINT 8 /* PC+4 relative 16 bit shifted */ ++#define R_ALPHA_SREL16 9 /* PC relative 16 bit */ ++#define R_ALPHA_SREL32 10 /* PC relative 32 bit */ ++#define R_ALPHA_SREL64 11 /* PC relative 64 bit */ ++#define R_ALPHA_GPRELHIGH 17 /* GP relative 32 bit, high 16 bits */ ++#define R_ALPHA_GPRELLOW 18 /* GP relative 32 bit, low 16 bits */ ++#define R_ALPHA_GPREL16 19 /* GP relative 16 bit */ ++#define R_ALPHA_COPY 24 /* Copy symbol at runtime */ ++#define R_ALPHA_GLOB_DAT 25 /* Create GOT entry */ ++#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */ ++#define R_ALPHA_RELATIVE 27 /* Adjust by program base */ ++#define R_ALPHA_TLS_GD_HI 28 ++#define R_ALPHA_TLSGD 29 ++#define R_ALPHA_TLS_LDM 30 ++#define R_ALPHA_DTPMOD64 31 ++#define R_ALPHA_GOTDTPREL 32 ++#define R_ALPHA_DTPREL64 33 ++#define R_ALPHA_DTPRELHI 34 ++#define R_ALPHA_DTPRELLO 35 ++#define R_ALPHA_DTPREL16 36 ++#define R_ALPHA_GOTTPREL 37 ++#define R_ALPHA_TPREL64 38 ++#define R_ALPHA_TPRELHI 39 ++#define R_ALPHA_TPRELLO 40 ++#define R_ALPHA_TPREL16 41 ++/* Keep this the last entry. */ ++#define R_ALPHA_NUM 46 ++ ++/* Magic values of the LITUSE relocation addend. */ ++#define LITUSE_ALPHA_ADDR 0 ++#define LITUSE_ALPHA_BASE 1 ++#define LITUSE_ALPHA_BYTOFF 2 ++#define LITUSE_ALPHA_JSR 3 ++#define LITUSE_ALPHA_TLS_GD 4 ++#define LITUSE_ALPHA_TLS_LDM 5 ++ ++/* Legal values for d_tag of Elf64_Dyn. */ ++#define DT_ALPHA_PLTRO (DT_LOPROC + 0) ++#define DT_ALPHA_NUM 1 ++ ++/* PowerPC specific declarations */ ++ ++/* Values for Elf32/64_Ehdr.e_flags. */ ++#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ ++ ++/* Cygnus local bits below */ ++#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ ++#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib ++ flag */ ++ ++/* PowerPC relocations defined by the ABIs */ ++#define R_PPC_NONE 0 ++#define R_PPC_ADDR32 1 /* 32bit absolute address */ ++#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ ++#define R_PPC_ADDR16 3 /* 16bit absolute address */ ++#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ ++#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ ++#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ ++#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ ++#define R_PPC_ADDR14_BRTAKEN 8 ++#define R_PPC_ADDR14_BRNTAKEN 9 ++#define R_PPC_REL24 10 /* PC relative 26 bit */ ++#define R_PPC_REL14 11 /* PC relative 16 bit */ ++#define R_PPC_REL14_BRTAKEN 12 ++#define R_PPC_REL14_BRNTAKEN 13 ++#define R_PPC_GOT16 14 ++#define R_PPC_GOT16_LO 15 ++#define R_PPC_GOT16_HI 16 ++#define R_PPC_GOT16_HA 17 ++#define R_PPC_PLTREL24 18 ++#define R_PPC_COPY 19 ++#define R_PPC_GLOB_DAT 20 ++#define R_PPC_JMP_SLOT 21 ++#define R_PPC_RELATIVE 22 ++#define R_PPC_LOCAL24PC 23 ++#define R_PPC_UADDR32 24 ++#define R_PPC_UADDR16 25 ++#define R_PPC_REL32 26 ++#define R_PPC_PLT32 27 ++#define R_PPC_PLTREL32 28 ++#define R_PPC_PLT16_LO 29 ++#define R_PPC_PLT16_HI 30 ++#define R_PPC_PLT16_HA 31 ++#define R_PPC_SDAREL16 32 ++#define R_PPC_SECTOFF 33 ++#define R_PPC_SECTOFF_LO 34 ++#define R_PPC_SECTOFF_HI 35 ++#define R_PPC_SECTOFF_HA 36 ++ ++/* PowerPC relocations defined for the TLS access ABI. */ ++#define R_PPC_TLS 67 /* none (sym+add)@tls */ ++#define R_PPC_DTPMOD32 68 /* word32 (sym+add)@dtpmod */ ++#define R_PPC_TPREL16 69 /* half16* (sym+add)@tprel */ ++#define R_PPC_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ ++#define R_PPC_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ ++#define R_PPC_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ ++#define R_PPC_TPREL32 73 /* word32 (sym+add)@tprel */ ++#define R_PPC_DTPREL16 74 /* half16* (sym+add)@dtprel */ ++#define R_PPC_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ ++#define R_PPC_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ ++#define R_PPC_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ ++#define R_PPC_DTPREL32 78 /* word32 (sym+add)@dtprel */ ++#define R_PPC_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ ++#define R_PPC_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ ++#define R_PPC_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ ++#define R_PPC_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ ++#define R_PPC_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ ++#define R_PPC_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ ++#define R_PPC_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ ++#define R_PPC_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ ++#define R_PPC_GOT_TPREL16 87 /* half16* (sym+add)@got@tprel */ ++#define R_PPC_GOT_TPREL16_LO 88 /* half16 (sym+add)@got@tprel@l */ ++#define R_PPC_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ ++#define R_PPC_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ ++#define R_PPC_GOT_DTPREL16 91 /* half16* (sym+add)@got@dtprel */ ++#define R_PPC_GOT_DTPREL16_LO 92 /* half16* (sym+add)@got@dtprel@l */ ++#define R_PPC_GOT_DTPREL16_HI 93 /* half16* (sym+add)@got@dtprel@h */ ++#define R_PPC_GOT_DTPREL16_HA 94 /* half16* (sym+add)@got@dtprel@ha */ ++ ++/* The remaining relocs are from the Embedded ELF ABI, and are not ++ in the SVR4 ELF ABI. */ ++#define R_PPC_EMB_NADDR32 101 ++#define R_PPC_EMB_NADDR16 102 ++#define R_PPC_EMB_NADDR16_LO 103 ++#define R_PPC_EMB_NADDR16_HI 104 ++#define R_PPC_EMB_NADDR16_HA 105 ++#define R_PPC_EMB_SDAI16 106 ++#define R_PPC_EMB_SDA2I16 107 ++#define R_PPC_EMB_SDA2REL 108 ++#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ ++#define R_PPC_EMB_MRKREF 110 ++#define R_PPC_EMB_RELSEC16 111 ++#define R_PPC_EMB_RELST_LO 112 ++#define R_PPC_EMB_RELST_HI 113 ++#define R_PPC_EMB_RELST_HA 114 ++#define R_PPC_EMB_BIT_FLD 115 ++#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ ++ ++/* Diab tool relocations. */ ++#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ ++#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ ++#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ ++#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ ++#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ ++#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ ++ ++/* GNU extension to support local ifunc. */ ++#define R_PPC_IRELATIVE 248 ++ ++/* GNU relocs used in PIC code sequences. */ ++#define R_PPC_REL16 249 /* half16 (sym+add-.) */ ++#define R_PPC_REL16_LO 250 /* half16 (sym+add-.)@l */ ++#define R_PPC_REL16_HI 251 /* half16 (sym+add-.)@h */ ++#define R_PPC_REL16_HA 252 /* half16 (sym+add-.)@ha */ ++ ++/* This is a phony reloc to handle any old fashioned TOC16 references ++ that may still be in object files. */ ++#define R_PPC_TOC16 255 ++ ++/* PowerPC specific values for the Dyn d_tag field. */ ++#define DT_PPC_GOT (DT_LOPROC + 0) ++#define DT_PPC_NUM 1 ++ ++/* PowerPC64 relocations defined by the ABIs */ ++#define R_PPC64_NONE R_PPC_NONE ++#define R_PPC64_ADDR32 R_PPC_ADDR32 /* 32bit absolute address */ ++#define R_PPC64_ADDR24 R_PPC_ADDR24 /* 26bit address, word aligned */ ++#define R_PPC64_ADDR16 R_PPC_ADDR16 /* 16bit absolute address */ ++#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO /* lower 16bits of address */ ++#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI /* high 16bits of address. */ ++#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA /* adjusted high 16bits. */ ++#define R_PPC64_ADDR14 R_PPC_ADDR14 /* 16bit address, word aligned */ ++#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN ++#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN ++#define R_PPC64_REL24 R_PPC_REL24 /* PC-rel. 26 bit, word aligned */ ++#define R_PPC64_REL14 R_PPC_REL14 /* PC relative 16 bit */ ++#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN ++#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN ++#define R_PPC64_GOT16 R_PPC_GOT16 ++#define R_PPC64_GOT16_LO R_PPC_GOT16_LO ++#define R_PPC64_GOT16_HI R_PPC_GOT16_HI ++#define R_PPC64_GOT16_HA R_PPC_GOT16_HA ++ ++#define R_PPC64_COPY R_PPC_COPY ++#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT ++#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT ++#define R_PPC64_RELATIVE R_PPC_RELATIVE ++ ++#define R_PPC64_UADDR32 R_PPC_UADDR32 ++#define R_PPC64_UADDR16 R_PPC_UADDR16 ++#define R_PPC64_REL32 R_PPC_REL32 ++#define R_PPC64_PLT32 R_PPC_PLT32 ++#define R_PPC64_PLTREL32 R_PPC_PLTREL32 ++#define R_PPC64_PLT16_LO R_PPC_PLT16_LO ++#define R_PPC64_PLT16_HI R_PPC_PLT16_HI ++#define R_PPC64_PLT16_HA R_PPC_PLT16_HA ++ ++#define R_PPC64_SECTOFF R_PPC_SECTOFF ++#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO ++#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI ++#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA ++#define R_PPC64_ADDR30 37 /* word30 (S + A - P) >> 2 */ ++#define R_PPC64_ADDR64 38 /* doubleword64 S + A */ ++#define R_PPC64_ADDR16_HIGHER 39 /* half16 #higher(S + A) */ ++#define R_PPC64_ADDR16_HIGHERA 40 /* half16 #highera(S + A) */ ++#define R_PPC64_ADDR16_HIGHEST 41 /* half16 #highest(S + A) */ ++#define R_PPC64_ADDR16_HIGHESTA 42 /* half16 #highesta(S + A) */ ++#define R_PPC64_UADDR64 43 /* doubleword64 S + A */ ++#define R_PPC64_REL64 44 /* doubleword64 S + A - P */ ++#define R_PPC64_PLT64 45 /* doubleword64 L + A */ ++#define R_PPC64_PLTREL64 46 /* doubleword64 L + A - P */ ++#define R_PPC64_TOC16 47 /* half16* S + A - .TOC */ ++#define R_PPC64_TOC16_LO 48 /* half16 #lo(S + A - .TOC.) */ ++#define R_PPC64_TOC16_HI 49 /* half16 #hi(S + A - .TOC.) */ ++#define R_PPC64_TOC16_HA 50 /* half16 #ha(S + A - .TOC.) */ ++#define R_PPC64_TOC 51 /* doubleword64 .TOC */ ++#define R_PPC64_PLTGOT16 52 /* half16* M + A */ ++#define R_PPC64_PLTGOT16_LO 53 /* half16 #lo(M + A) */ ++#define R_PPC64_PLTGOT16_HI 54 /* half16 #hi(M + A) */ ++#define R_PPC64_PLTGOT16_HA 55 /* half16 #ha(M + A) */ ++ ++#define R_PPC64_ADDR16_DS 56 /* half16ds* (S + A) >> 2 */ ++#define R_PPC64_ADDR16_LO_DS 57 /* half16ds #lo(S + A) >> 2 */ ++#define R_PPC64_GOT16_DS 58 /* half16ds* (G + A) >> 2 */ ++#define R_PPC64_GOT16_LO_DS 59 /* half16ds #lo(G + A) >> 2 */ ++#define R_PPC64_PLT16_LO_DS 60 /* half16ds #lo(L + A) >> 2 */ ++#define R_PPC64_SECTOFF_DS 61 /* half16ds* (R + A) >> 2 */ ++#define R_PPC64_SECTOFF_LO_DS 62 /* half16ds #lo(R + A) >> 2 */ ++#define R_PPC64_TOC16_DS 63 /* half16ds* (S + A - .TOC.) >> 2 */ ++#define R_PPC64_TOC16_LO_DS 64 /* half16ds #lo(S + A - .TOC.) >> 2 */ ++#define R_PPC64_PLTGOT16_DS 65 /* half16ds* (M + A) >> 2 */ ++#define R_PPC64_PLTGOT16_LO_DS 66 /* half16ds #lo(M + A) >> 2 */ ++ ++/* PowerPC64 relocations defined for the TLS access ABI. */ ++#define R_PPC64_TLS 67 /* none (sym+add)@tls */ ++#define R_PPC64_DTPMOD64 68 /* doubleword64 (sym+add)@dtpmod */ ++#define R_PPC64_TPREL16 69 /* half16* (sym+add)@tprel */ ++#define R_PPC64_TPREL16_LO 70 /* half16 (sym+add)@tprel@l */ ++#define R_PPC64_TPREL16_HI 71 /* half16 (sym+add)@tprel@h */ ++#define R_PPC64_TPREL16_HA 72 /* half16 (sym+add)@tprel@ha */ ++#define R_PPC64_TPREL64 73 /* doubleword64 (sym+add)@tprel */ ++#define R_PPC64_DTPREL16 74 /* half16* (sym+add)@dtprel */ ++#define R_PPC64_DTPREL16_LO 75 /* half16 (sym+add)@dtprel@l */ ++#define R_PPC64_DTPREL16_HI 76 /* half16 (sym+add)@dtprel@h */ ++#define R_PPC64_DTPREL16_HA 77 /* half16 (sym+add)@dtprel@ha */ ++#define R_PPC64_DTPREL64 78 /* doubleword64 (sym+add)@dtprel */ ++#define R_PPC64_GOT_TLSGD16 79 /* half16* (sym+add)@got@tlsgd */ ++#define R_PPC64_GOT_TLSGD16_LO 80 /* half16 (sym+add)@got@tlsgd@l */ ++#define R_PPC64_GOT_TLSGD16_HI 81 /* half16 (sym+add)@got@tlsgd@h */ ++#define R_PPC64_GOT_TLSGD16_HA 82 /* half16 (sym+add)@got@tlsgd@ha */ ++#define R_PPC64_GOT_TLSLD16 83 /* half16* (sym+add)@got@tlsld */ ++#define R_PPC64_GOT_TLSLD16_LO 84 /* half16 (sym+add)@got@tlsld@l */ ++#define R_PPC64_GOT_TLSLD16_HI 85 /* half16 (sym+add)@got@tlsld@h */ ++#define R_PPC64_GOT_TLSLD16_HA 86 /* half16 (sym+add)@got@tlsld@ha */ ++#define R_PPC64_GOT_TPREL16_DS 87 /* half16ds* (sym+add)@got@tprel */ ++#define R_PPC64_GOT_TPREL16_LO_DS 88 /* half16ds (sym+add)@got@tprel@l */ ++#define R_PPC64_GOT_TPREL16_HI 89 /* half16 (sym+add)@got@tprel@h */ ++#define R_PPC64_GOT_TPREL16_HA 90 /* half16 (sym+add)@got@tprel@ha */ ++#define R_PPC64_GOT_DTPREL16_DS 91 /* half16ds* (sym+add)@got@dtprel */ ++#define R_PPC64_GOT_DTPREL16_LO_DS 92 /* half16ds (sym+add)@got@dtprel@l */ ++#define R_PPC64_GOT_DTPREL16_HI 93 /* half16 (sym+add)@got@dtprel@h */ ++#define R_PPC64_GOT_DTPREL16_HA 94 /* half16 (sym+add)@got@dtprel@ha */ ++#define R_PPC64_TPREL16_DS 95 /* half16ds* (sym+add)@tprel */ ++#define R_PPC64_TPREL16_LO_DS 96 /* half16ds (sym+add)@tprel@l */ ++#define R_PPC64_TPREL16_HIGHER 97 /* half16 (sym+add)@tprel@higher */ ++#define R_PPC64_TPREL16_HIGHERA 98 /* half16 (sym+add)@tprel@highera */ ++#define R_PPC64_TPREL16_HIGHEST 99 /* half16 (sym+add)@tprel@highest */ ++#define R_PPC64_TPREL16_HIGHESTA 100 /* half16 (sym+add)@tprel@highesta */ ++#define R_PPC64_DTPREL16_DS 101 /* half16ds* (sym+add)@dtprel */ ++#define R_PPC64_DTPREL16_LO_DS 102 /* half16ds (sym+add)@dtprel@l */ ++#define R_PPC64_DTPREL16_HIGHER 103 /* half16 (sym+add)@dtprel@higher */ ++#define R_PPC64_DTPREL16_HIGHERA 104 /* half16 (sym+add)@dtprel@highera */ ++#define R_PPC64_DTPREL16_HIGHEST 105 /* half16 (sym+add)@dtprel@highest */ ++#define R_PPC64_DTPREL16_HIGHESTA 106 /* half16 (sym+add)@dtprel@highesta */ ++ ++/* GNU extension to support local ifunc. */ ++#define R_PPC64_JMP_IREL 247 ++#define R_PPC64_IRELATIVE 248 ++#define R_PPC64_REL16 249 /* half16 (sym+add-.) */ ++#define R_PPC64_REL16_LO 250 /* half16 (sym+add-.)@l */ ++#define R_PPC64_REL16_HI 251 /* half16 (sym+add-.)@h */ ++#define R_PPC64_REL16_HA 252 /* half16 (sym+add-.)@ha */ ++ ++/* PowerPC64 specific values for the Dyn d_tag field. */ ++#define DT_PPC64_GLINK (DT_LOPROC + 0) ++#define DT_PPC64_OPD (DT_LOPROC + 1) ++#define DT_PPC64_OPDSZ (DT_LOPROC + 2) ++#define DT_PPC64_NUM 3 ++ ++ ++/* ARM specific declarations */ ++ ++/* Processor specific flags for the ELF header e_flags field. */ ++#define EF_ARM_RELEXEC 0x01 ++#define EF_ARM_HASENTRY 0x02 ++#define EF_ARM_INTERWORK 0x04 ++#define EF_ARM_APCS_26 0x08 ++#define EF_ARM_APCS_FLOAT 0x10 ++#define EF_ARM_PIC 0x20 ++#define EF_ARM_ALIGN8 0x40 /* 8-bit structure alignment is in use */ ++#define EF_ARM_NEW_ABI 0x80 ++#define EF_ARM_OLD_ABI 0x100 ++#define EF_ARM_SOFT_FLOAT 0x200 ++#define EF_ARM_VFP_FLOAT 0x400 ++#define EF_ARM_MAVERICK_FLOAT 0x800 ++ ++ ++/* Other constants defined in the ARM ELF spec. version B-01. */ ++/* NB. These conflict with values defined above. */ ++#define EF_ARM_SYMSARESORTED 0x04 ++#define EF_ARM_DYNSYMSUSESEGIDX 0x08 ++#define EF_ARM_MAPSYMSFIRST 0x10 ++#define EF_ARM_EABIMASK 0XFF000000 ++ ++/* Constants defined in AAELF. */ ++#define EF_ARM_BE8 0x00800000 ++#define EF_ARM_LE8 0x00400000 ++ ++#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK) ++#define EF_ARM_EABI_UNKNOWN 0x00000000 ++#define EF_ARM_EABI_VER1 0x01000000 ++#define EF_ARM_EABI_VER2 0x02000000 ++#define EF_ARM_EABI_VER3 0x03000000 ++#define EF_ARM_EABI_VER4 0x04000000 ++#define EF_ARM_EABI_VER5 0x05000000 ++ ++/* Additional symbol types for Thumb. */ ++#define STT_ARM_TFUNC STT_LOPROC /* A Thumb function. */ ++#define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */ ++ ++/* ARM-specific values for sh_flags */ ++#define SHF_ARM_ENTRYSECT 0x10000000 /* Section contains an entry point */ ++#define SHF_ARM_COMDEF 0x80000000 /* Section may be multiply defined ++ in the input to a link step. */ ++ ++/* ARM-specific program header flags */ ++#define PF_ARM_SB 0x10000000 /* Segment contains the location ++ addressed by the static base. */ ++#define PF_ARM_PI 0x20000000 /* Position-independent segment. */ ++#define PF_ARM_ABS 0x40000000 /* Absolute segment. */ ++ ++/* Processor specific values for the Phdr p_type field. */ ++#define PT_ARM_EXIDX (PT_LOPROC + 1) /* ARM unwind segment. */ ++ ++/* Processor specific values for the Shdr sh_type field. */ ++#define SHT_ARM_EXIDX (SHT_LOPROC + 1) /* ARM unwind section. */ ++#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2) /* Preemption details. */ ++#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3) /* ARM attributes section. */ ++ ++ ++/* ARM relocs. */ ++ ++#define R_ARM_NONE 0 /* No reloc */ ++#define R_ARM_PC24 1 /* PC relative 26 bit branch */ ++#define R_ARM_ABS32 2 /* Direct 32 bit */ ++#define R_ARM_REL32 3 /* PC relative 32 bit */ ++#define R_ARM_PC13 4 ++#define R_ARM_ABS16 5 /* Direct 16 bit */ ++#define R_ARM_ABS12 6 /* Direct 12 bit */ ++#define R_ARM_THM_ABS5 7 ++#define R_ARM_ABS8 8 /* Direct 8 bit */ ++#define R_ARM_SBREL32 9 ++#define R_ARM_THM_PC22 10 ++#define R_ARM_THM_PC8 11 ++#define R_ARM_AMP_VCALL9 12 ++#define R_ARM_SWI24 13 /* Obsolete static relocation. */ ++#define R_ARM_TLS_DESC 13 /* Dynamic relocation. */ ++#define R_ARM_THM_SWI8 14 ++#define R_ARM_XPC25 15 ++#define R_ARM_THM_XPC22 16 ++#define R_ARM_TLS_DTPMOD32 17 /* ID of module containing symbol */ ++#define R_ARM_TLS_DTPOFF32 18 /* Offset in TLS block */ ++#define R_ARM_TLS_TPOFF32 19 /* Offset in static TLS block */ ++#define R_ARM_COPY 20 /* Copy symbol at runtime */ ++#define R_ARM_GLOB_DAT 21 /* Create GOT entry */ ++#define R_ARM_JUMP_SLOT 22 /* Create PLT entry */ ++#define R_ARM_RELATIVE 23 /* Adjust by program base */ ++#define R_ARM_GOTOFF 24 /* 32 bit offset to GOT */ ++#define R_ARM_GOTPC 25 /* 32 bit PC relative offset to GOT */ ++#define R_ARM_GOT32 26 /* 32 bit GOT entry */ ++#define R_ARM_PLT32 27 /* 32 bit PLT address */ ++#define R_ARM_ALU_PCREL_7_0 32 ++#define R_ARM_ALU_PCREL_15_8 33 ++#define R_ARM_ALU_PCREL_23_15 34 ++#define R_ARM_LDR_SBREL_11_0 35 ++#define R_ARM_ALU_SBREL_19_12 36 ++#define R_ARM_ALU_SBREL_27_20 37 ++#define R_ARM_TLS_GOTDESC 90 ++#define R_ARM_TLS_CALL 91 ++#define R_ARM_TLS_DESCSEQ 92 ++#define R_ARM_THM_TLS_CALL 93 ++#define R_ARM_GNU_VTENTRY 100 ++#define R_ARM_GNU_VTINHERIT 101 ++#define R_ARM_THM_PC11 102 /* thumb unconditional branch */ ++#define R_ARM_THM_PC9 103 /* thumb conditional branch */ ++#define R_ARM_TLS_GD32 104 /* PC-rel 32 bit for global dynamic ++ thread local data */ ++#define R_ARM_TLS_LDM32 105 /* PC-rel 32 bit for local dynamic ++ thread local data */ ++#define R_ARM_TLS_LDO32 106 /* 32 bit offset relative to TLS ++ block */ ++#define R_ARM_TLS_IE32 107 /* PC-rel 32 bit for GOT entry of ++ static TLS block offset */ ++#define R_ARM_TLS_LE32 108 /* 32 bit offset relative to static ++ TLS block */ ++#define R_ARM_THM_TLS_DESCSEQ 129 ++#define R_ARM_IRELATIVE 160 ++#define R_ARM_RXPC25 249 ++#define R_ARM_RSBREL32 250 ++#define R_ARM_THM_RPC22 251 ++#define R_ARM_RREL32 252 ++#define R_ARM_RABS22 253 ++#define R_ARM_RPC24 254 ++#define R_ARM_RBASE 255 ++/* Keep this the last entry. */ ++#define R_ARM_NUM 256 ++ ++/* IA-64 specific declarations. */ ++ ++/* Processor specific flags for the Ehdr e_flags field. */ ++#define EF_IA_64_MASKOS 0x0000000f /* os-specific flags */ ++#define EF_IA_64_ABI64 0x00000010 /* 64-bit ABI */ ++#define EF_IA_64_ARCH 0xff000000 /* arch. version mask */ ++ ++/* Processor specific values for the Phdr p_type field. */ ++#define PT_IA_64_ARCHEXT (PT_LOPROC + 0) /* arch extension bits */ ++#define PT_IA_64_UNWIND (PT_LOPROC + 1) /* ia64 unwind bits */ ++#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12) ++#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13) ++#define PT_IA_64_HP_STACK (PT_LOOS + 0x14) ++ ++/* Processor specific flags for the Phdr p_flags field. */ ++#define PF_IA_64_NORECOV 0x80000000 /* spec insns w/o recovery */ ++ ++/* Processor specific values for the Shdr sh_type field. */ ++#define SHT_IA_64_EXT (SHT_LOPROC + 0) /* extension bits */ ++#define SHT_IA_64_UNWIND (SHT_LOPROC + 1) /* unwind bits */ ++ ++/* Processor specific flags for the Shdr sh_flags field. */ ++#define SHF_IA_64_SHORT 0x10000000 /* section near gp */ ++#define SHF_IA_64_NORECOV 0x20000000 /* spec insns w/o recovery */ ++ ++/* Processor specific values for the Dyn d_tag field. */ ++#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0) ++#define DT_IA_64_NUM 1 ++ ++/* IA-64 relocations. */ ++#define R_IA64_NONE 0x00 /* none */ ++#define R_IA64_IMM14 0x21 /* symbol + addend, add imm14 */ ++#define R_IA64_IMM22 0x22 /* symbol + addend, add imm22 */ ++#define R_IA64_IMM64 0x23 /* symbol + addend, mov imm64 */ ++#define R_IA64_DIR32MSB 0x24 /* symbol + addend, data4 MSB */ ++#define R_IA64_DIR32LSB 0x25 /* symbol + addend, data4 LSB */ ++#define R_IA64_DIR64MSB 0x26 /* symbol + addend, data8 MSB */ ++#define R_IA64_DIR64LSB 0x27 /* symbol + addend, data8 LSB */ ++#define R_IA64_GPREL22 0x2a /* @gprel(sym + add), add imm22 */ ++#define R_IA64_GPREL64I 0x2b /* @gprel(sym + add), mov imm64 */ ++#define R_IA64_GPREL32MSB 0x2c /* @gprel(sym + add), data4 MSB */ ++#define R_IA64_GPREL32LSB 0x2d /* @gprel(sym + add), data4 LSB */ ++#define R_IA64_GPREL64MSB 0x2e /* @gprel(sym + add), data8 MSB */ ++#define R_IA64_GPREL64LSB 0x2f /* @gprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF22 0x32 /* @ltoff(sym + add), add imm22 */ ++#define R_IA64_LTOFF64I 0x33 /* @ltoff(sym + add), mov imm64 */ ++#define R_IA64_PLTOFF22 0x3a /* @pltoff(sym + add), add imm22 */ ++#define R_IA64_PLTOFF64I 0x3b /* @pltoff(sym + add), mov imm64 */ ++#define R_IA64_PLTOFF64MSB 0x3e /* @pltoff(sym + add), data8 MSB */ ++#define R_IA64_PLTOFF64LSB 0x3f /* @pltoff(sym + add), data8 LSB */ ++#define R_IA64_FPTR64I 0x43 /* @fptr(sym + add), mov imm64 */ ++#define R_IA64_FPTR32MSB 0x44 /* @fptr(sym + add), data4 MSB */ ++#define R_IA64_FPTR32LSB 0x45 /* @fptr(sym + add), data4 LSB */ ++#define R_IA64_FPTR64MSB 0x46 /* @fptr(sym + add), data8 MSB */ ++#define R_IA64_FPTR64LSB 0x47 /* @fptr(sym + add), data8 LSB */ ++#define R_IA64_PCREL60B 0x48 /* @pcrel(sym + add), brl */ ++#define R_IA64_PCREL21B 0x49 /* @pcrel(sym + add), ptb, call */ ++#define R_IA64_PCREL21M 0x4a /* @pcrel(sym + add), chk.s */ ++#define R_IA64_PCREL21F 0x4b /* @pcrel(sym + add), fchkf */ ++#define R_IA64_PCREL32MSB 0x4c /* @pcrel(sym + add), data4 MSB */ ++#define R_IA64_PCREL32LSB 0x4d /* @pcrel(sym + add), data4 LSB */ ++#define R_IA64_PCREL64MSB 0x4e /* @pcrel(sym + add), data8 MSB */ ++#define R_IA64_PCREL64LSB 0x4f /* @pcrel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_FPTR22 0x52 /* @ltoff(@fptr(s+a)), imm22 */ ++#define R_IA64_LTOFF_FPTR64I 0x53 /* @ltoff(@fptr(s+a)), imm64 */ ++#define R_IA64_LTOFF_FPTR32MSB 0x54 /* @ltoff(@fptr(s+a)), data4 MSB */ ++#define R_IA64_LTOFF_FPTR32LSB 0x55 /* @ltoff(@fptr(s+a)), data4 LSB */ ++#define R_IA64_LTOFF_FPTR64MSB 0x56 /* @ltoff(@fptr(s+a)), data8 MSB */ ++#define R_IA64_LTOFF_FPTR64LSB 0x57 /* @ltoff(@fptr(s+a)), data8 LSB */ ++#define R_IA64_SEGREL32MSB 0x5c /* @segrel(sym + add), data4 MSB */ ++#define R_IA64_SEGREL32LSB 0x5d /* @segrel(sym + add), data4 LSB */ ++#define R_IA64_SEGREL64MSB 0x5e /* @segrel(sym + add), data8 MSB */ ++#define R_IA64_SEGREL64LSB 0x5f /* @segrel(sym + add), data8 LSB */ ++#define R_IA64_SECREL32MSB 0x64 /* @secrel(sym + add), data4 MSB */ ++#define R_IA64_SECREL32LSB 0x65 /* @secrel(sym + add), data4 LSB */ ++#define R_IA64_SECREL64MSB 0x66 /* @secrel(sym + add), data8 MSB */ ++#define R_IA64_SECREL64LSB 0x67 /* @secrel(sym + add), data8 LSB */ ++#define R_IA64_REL32MSB 0x6c /* data 4 + REL */ ++#define R_IA64_REL32LSB 0x6d /* data 4 + REL */ ++#define R_IA64_REL64MSB 0x6e /* data 8 + REL */ ++#define R_IA64_REL64LSB 0x6f /* data 8 + REL */ ++#define R_IA64_LTV32MSB 0x74 /* symbol + addend, data4 MSB */ ++#define R_IA64_LTV32LSB 0x75 /* symbol + addend, data4 LSB */ ++#define R_IA64_LTV64MSB 0x76 /* symbol + addend, data8 MSB */ ++#define R_IA64_LTV64LSB 0x77 /* symbol + addend, data8 LSB */ ++#define R_IA64_PCREL21BI 0x79 /* @pcrel(sym + add), 21bit inst */ ++#define R_IA64_PCREL22 0x7a /* @pcrel(sym + add), 22bit inst */ ++#define R_IA64_PCREL64I 0x7b /* @pcrel(sym + add), 64bit inst */ ++#define R_IA64_IPLTMSB 0x80 /* dynamic reloc, imported PLT, MSB */ ++#define R_IA64_IPLTLSB 0x81 /* dynamic reloc, imported PLT, LSB */ ++#define R_IA64_COPY 0x84 /* copy relocation */ ++#define R_IA64_SUB 0x85 /* Addend and symbol difference */ ++#define R_IA64_LTOFF22X 0x86 /* LTOFF22, relaxable. */ ++#define R_IA64_LDXMOV 0x87 /* Use of LTOFF22X. */ ++#define R_IA64_TPREL14 0x91 /* @tprel(sym + add), imm14 */ ++#define R_IA64_TPREL22 0x92 /* @tprel(sym + add), imm22 */ ++#define R_IA64_TPREL64I 0x93 /* @tprel(sym + add), imm64 */ ++#define R_IA64_TPREL64MSB 0x96 /* @tprel(sym + add), data8 MSB */ ++#define R_IA64_TPREL64LSB 0x97 /* @tprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_TPREL22 0x9a /* @ltoff(@tprel(s+a)), imm2 */ ++#define R_IA64_DTPMOD64MSB 0xa6 /* @dtpmod(sym + add), data8 MSB */ ++#define R_IA64_DTPMOD64LSB 0xa7 /* @dtpmod(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_DTPMOD22 0xaa /* @ltoff(@dtpmod(sym + add)), imm22 */ ++#define R_IA64_DTPREL14 0xb1 /* @dtprel(sym + add), imm14 */ ++#define R_IA64_DTPREL22 0xb2 /* @dtprel(sym + add), imm22 */ ++#define R_IA64_DTPREL64I 0xb3 /* @dtprel(sym + add), imm64 */ ++#define R_IA64_DTPREL32MSB 0xb4 /* @dtprel(sym + add), data4 MSB */ ++#define R_IA64_DTPREL32LSB 0xb5 /* @dtprel(sym + add), data4 LSB */ ++#define R_IA64_DTPREL64MSB 0xb6 /* @dtprel(sym + add), data8 MSB */ ++#define R_IA64_DTPREL64LSB 0xb7 /* @dtprel(sym + add), data8 LSB */ ++#define R_IA64_LTOFF_DTPREL22 0xba /* @ltoff(@dtprel(s+a)), imm22 */ ++ ++/* SH specific declarations */ ++ ++/* Processor specific flags for the ELF header e_flags field. */ ++#define EF_SH_MACH_MASK 0x1f ++#define EF_SH_UNKNOWN 0x0 ++#define EF_SH1 0x1 ++#define EF_SH2 0x2 ++#define EF_SH3 0x3 ++#define EF_SH_DSP 0x4 ++#define EF_SH3_DSP 0x5 ++#define EF_SH4AL_DSP 0x6 ++#define EF_SH3E 0x8 ++#define EF_SH4 0x9 ++#define EF_SH2E 0xb ++#define EF_SH4A 0xc ++#define EF_SH2A 0xd ++#define EF_SH4_NOFPU 0x10 ++#define EF_SH4A_NOFPU 0x11 ++#define EF_SH4_NOMMU_NOFPU 0x12 ++#define EF_SH2A_NOFPU 0x13 ++#define EF_SH3_NOMMU 0x14 ++#define EF_SH2A_SH4_NOFPU 0x15 ++#define EF_SH2A_SH3_NOFPU 0x16 ++#define EF_SH2A_SH4 0x17 ++#define EF_SH2A_SH3E 0x18 ++ ++/* SH relocs. */ ++#define R_SH_NONE 0 ++#define R_SH_DIR32 1 ++#define R_SH_REL32 2 ++#define R_SH_DIR8WPN 3 ++#define R_SH_IND12W 4 ++#define R_SH_DIR8WPL 5 ++#define R_SH_DIR8WPZ 6 ++#define R_SH_DIR8BP 7 ++#define R_SH_DIR8W 8 ++#define R_SH_DIR8L 9 ++#define R_SH_SWITCH16 25 ++#define R_SH_SWITCH32 26 ++#define R_SH_USES 27 ++#define R_SH_COUNT 28 ++#define R_SH_ALIGN 29 ++#define R_SH_CODE 30 ++#define R_SH_DATA 31 ++#define R_SH_LABEL 32 ++#define R_SH_SWITCH8 33 ++#define R_SH_GNU_VTINHERIT 34 ++#define R_SH_GNU_VTENTRY 35 ++#define R_SH_TLS_GD_32 144 ++#define R_SH_TLS_LD_32 145 ++#define R_SH_TLS_LDO_32 146 ++#define R_SH_TLS_IE_32 147 ++#define R_SH_TLS_LE_32 148 ++#define R_SH_TLS_DTPMOD32 149 ++#define R_SH_TLS_DTPOFF32 150 ++#define R_SH_TLS_TPOFF32 151 ++#define R_SH_GOT32 160 ++#define R_SH_PLT32 161 ++#define R_SH_COPY 162 ++#define R_SH_GLOB_DAT 163 ++#define R_SH_JMP_SLOT 164 ++#define R_SH_RELATIVE 165 ++#define R_SH_GOTOFF 166 ++#define R_SH_GOTPC 167 ++/* Keep this the last entry. */ ++#define R_SH_NUM 256 ++ ++/* S/390 specific definitions. */ ++ ++/* Valid values for the e_flags field. */ ++ ++#define EF_S390_HIGH_GPRS 0x00000001 /* High GPRs kernel facility needed. */ ++ ++/* Additional s390 relocs */ ++ ++#define R_390_NONE 0 /* No reloc. */ ++#define R_390_8 1 /* Direct 8 bit. */ ++#define R_390_12 2 /* Direct 12 bit. */ ++#define R_390_16 3 /* Direct 16 bit. */ ++#define R_390_32 4 /* Direct 32 bit. */ ++#define R_390_PC32 5 /* PC relative 32 bit. */ ++#define R_390_GOT12 6 /* 12 bit GOT offset. */ ++#define R_390_GOT32 7 /* 32 bit GOT offset. */ ++#define R_390_PLT32 8 /* 32 bit PC relative PLT address. */ ++#define R_390_COPY 9 /* Copy symbol at runtime. */ ++#define R_390_GLOB_DAT 10 /* Create GOT entry. */ ++#define R_390_JMP_SLOT 11 /* Create PLT entry. */ ++#define R_390_RELATIVE 12 /* Adjust by program base. */ ++#define R_390_GOTOFF32 13 /* 32 bit offset to GOT. */ ++#define R_390_GOTPC 14 /* 32 bit PC relative offset to GOT. */ ++#define R_390_GOT16 15 /* 16 bit GOT offset. */ ++#define R_390_PC16 16 /* PC relative 16 bit. */ ++#define R_390_PC16DBL 17 /* PC relative 16 bit shifted by 1. */ ++#define R_390_PLT16DBL 18 /* 16 bit PC rel. PLT shifted by 1. */ ++#define R_390_PC32DBL 19 /* PC relative 32 bit shifted by 1. */ ++#define R_390_PLT32DBL 20 /* 32 bit PC rel. PLT shifted by 1. */ ++#define R_390_GOTPCDBL 21 /* 32 bit PC rel. GOT shifted by 1. */ ++#define R_390_64 22 /* Direct 64 bit. */ ++#define R_390_PC64 23 /* PC relative 64 bit. */ ++#define R_390_GOT64 24 /* 64 bit GOT offset. */ ++#define R_390_PLT64 25 /* 64 bit PC relative PLT address. */ ++#define R_390_GOTENT 26 /* 32 bit PC rel. to GOT entry >> 1. */ ++#define R_390_GOTOFF16 27 /* 16 bit offset to GOT. */ ++#define R_390_GOTOFF64 28 /* 64 bit offset to GOT. */ ++#define R_390_GOTPLT12 29 /* 12 bit offset to jump slot. */ ++#define R_390_GOTPLT16 30 /* 16 bit offset to jump slot. */ ++#define R_390_GOTPLT32 31 /* 32 bit offset to jump slot. */ ++#define R_390_GOTPLT64 32 /* 64 bit offset to jump slot. */ ++#define R_390_GOTPLTENT 33 /* 32 bit rel. offset to jump slot. */ ++#define R_390_PLTOFF16 34 /* 16 bit offset from GOT to PLT. */ ++#define R_390_PLTOFF32 35 /* 32 bit offset from GOT to PLT. */ ++#define R_390_PLTOFF64 36 /* 16 bit offset from GOT to PLT. */ ++#define R_390_TLS_LOAD 37 /* Tag for load insn in TLS code. */ ++#define R_390_TLS_GDCALL 38 /* Tag for function call in general ++ dynamic TLS code. */ ++#define R_390_TLS_LDCALL 39 /* Tag for function call in local ++ dynamic TLS code. */ ++#define R_390_TLS_GD32 40 /* Direct 32 bit for general dynamic ++ thread local data. */ ++#define R_390_TLS_GD64 41 /* Direct 64 bit for general dynamic ++ thread local data. */ ++#define R_390_TLS_GOTIE12 42 /* 12 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_GOTIE32 43 /* 32 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_GOTIE64 44 /* 64 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_TLS_LDM32 45 /* Direct 32 bit for local dynamic ++ thread local data in LE code. */ ++#define R_390_TLS_LDM64 46 /* Direct 64 bit for local dynamic ++ thread local data in LE code. */ ++#define R_390_TLS_IE32 47 /* 32 bit address of GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_IE64 48 /* 64 bit address of GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_IEENT 49 /* 32 bit rel. offset to GOT entry for ++ negated static TLS block offset. */ ++#define R_390_TLS_LE32 50 /* 32 bit negated offset relative to ++ static TLS block. */ ++#define R_390_TLS_LE64 51 /* 64 bit negated offset relative to ++ static TLS block. */ ++#define R_390_TLS_LDO32 52 /* 32 bit offset relative to TLS ++ block. */ ++#define R_390_TLS_LDO64 53 /* 64 bit offset relative to TLS ++ block. */ ++#define R_390_TLS_DTPMOD 54 /* ID of module containing symbol. */ ++#define R_390_TLS_DTPOFF 55 /* Offset in TLS block. */ ++#define R_390_TLS_TPOFF 56 /* Negated offset in static TLS ++ block. */ ++#define R_390_20 57 /* Direct 20 bit. */ ++#define R_390_GOT20 58 /* 20 bit GOT offset. */ ++#define R_390_GOTPLT20 59 /* 20 bit offset to jump slot. */ ++#define R_390_TLS_GOTIE20 60 /* 20 bit GOT offset for static TLS ++ block offset. */ ++#define R_390_IRELATIVE 61 /* STT_GNU_IFUNC relocation. */ ++/* Keep this the last entry. */ ++#define R_390_NUM 62 ++ ++ ++/* CRIS relocations. */ ++#define R_CRIS_NONE 0 ++#define R_CRIS_8 1 ++#define R_CRIS_16 2 ++#define R_CRIS_32 3 ++#define R_CRIS_8_PCREL 4 ++#define R_CRIS_16_PCREL 5 ++#define R_CRIS_32_PCREL 6 ++#define R_CRIS_GNU_VTINHERIT 7 ++#define R_CRIS_GNU_VTENTRY 8 ++#define R_CRIS_COPY 9 ++#define R_CRIS_GLOB_DAT 10 ++#define R_CRIS_JUMP_SLOT 11 ++#define R_CRIS_RELATIVE 12 ++#define R_CRIS_16_GOT 13 ++#define R_CRIS_32_GOT 14 ++#define R_CRIS_16_GOTPLT 15 ++#define R_CRIS_32_GOTPLT 16 ++#define R_CRIS_32_GOTREL 17 ++#define R_CRIS_32_PLT_GOTREL 18 ++#define R_CRIS_32_PLT_PCREL 19 ++ ++#define R_CRIS_NUM 20 ++ ++ ++/* AMD x86-64 relocations. */ ++#define R_X86_64_NONE 0 /* No reloc */ ++#define R_X86_64_64 1 /* Direct 64 bit */ ++#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ ++#define R_X86_64_GOT32 3 /* 32 bit GOT entry */ ++#define R_X86_64_PLT32 4 /* 32 bit PLT address */ ++#define R_X86_64_COPY 5 /* Copy symbol at runtime */ ++#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ ++#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ ++#define R_X86_64_RELATIVE 8 /* Adjust by program base */ ++#define R_X86_64_GOTPCREL 9 /* 32 bit signed PC relative ++ offset to GOT */ ++#define R_X86_64_32 10 /* Direct 32 bit zero extended */ ++#define R_X86_64_32S 11 /* Direct 32 bit sign extended */ ++#define R_X86_64_16 12 /* Direct 16 bit zero extended */ ++#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ ++#define R_X86_64_8 14 /* Direct 8 bit sign extended */ ++#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ ++#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */ ++#define R_X86_64_DTPOFF64 17 /* Offset in module's TLS block */ ++#define R_X86_64_TPOFF64 18 /* Offset in initial TLS block */ ++#define R_X86_64_TLSGD 19 /* 32 bit signed PC relative offset ++ to two GOT entries for GD symbol */ ++#define R_X86_64_TLSLD 20 /* 32 bit signed PC relative offset ++ to two GOT entries for LD symbol */ ++#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */ ++#define R_X86_64_GOTTPOFF 22 /* 32 bit signed PC relative offset ++ to GOT entry for IE symbol */ ++#define R_X86_64_TPOFF32 23 /* Offset in initial TLS block */ ++#define R_X86_64_PC64 24 /* PC relative 64 bit */ ++#define R_X86_64_GOTOFF64 25 /* 64 bit offset to GOT */ ++#define R_X86_64_GOTPC32 26 /* 32 bit signed pc relative ++ offset to GOT */ ++#define R_X86_64_GOT64 27 /* 64-bit GOT entry offset */ ++#define R_X86_64_GOTPCREL64 28 /* 64-bit PC relative offset ++ to GOT entry */ ++#define R_X86_64_GOTPC64 29 /* 64-bit PC relative offset to GOT */ ++#define R_X86_64_GOTPLT64 30 /* like GOT64, says PLT entry needed */ ++#define R_X86_64_PLTOFF64 31 /* 64-bit GOT relative offset ++ to PLT entry */ ++#define R_X86_64_SIZE32 32 /* Size of symbol plus 32-bit addend */ ++#define R_X86_64_SIZE64 33 /* Size of symbol plus 64-bit addend */ ++#define R_X86_64_GOTPC32_TLSDESC 34 /* GOT offset for TLS descriptor. */ ++#define R_X86_64_TLSDESC_CALL 35 /* Marker for call through TLS ++ descriptor. */ ++#define R_X86_64_TLSDESC 36 /* TLS descriptor. */ ++#define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */ ++#define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */ ++ ++#define R_X86_64_NUM 39 ++ ++ ++/* AM33 relocations. */ ++#define R_MN10300_NONE 0 /* No reloc. */ ++#define R_MN10300_32 1 /* Direct 32 bit. */ ++#define R_MN10300_16 2 /* Direct 16 bit. */ ++#define R_MN10300_8 3 /* Direct 8 bit. */ ++#define R_MN10300_PCREL32 4 /* PC-relative 32-bit. */ ++#define R_MN10300_PCREL16 5 /* PC-relative 16-bit signed. */ ++#define R_MN10300_PCREL8 6 /* PC-relative 8-bit signed. */ ++#define R_MN10300_GNU_VTINHERIT 7 /* Ancient C++ vtable garbage... */ ++#define R_MN10300_GNU_VTENTRY 8 /* ... collection annotation. */ ++#define R_MN10300_24 9 /* Direct 24 bit. */ ++#define R_MN10300_GOTPC32 10 /* 32-bit PCrel offset to GOT. */ ++#define R_MN10300_GOTPC16 11 /* 16-bit PCrel offset to GOT. */ ++#define R_MN10300_GOTOFF32 12 /* 32-bit offset from GOT. */ ++#define R_MN10300_GOTOFF24 13 /* 24-bit offset from GOT. */ ++#define R_MN10300_GOTOFF16 14 /* 16-bit offset from GOT. */ ++#define R_MN10300_PLT32 15 /* 32-bit PCrel to PLT entry. */ ++#define R_MN10300_PLT16 16 /* 16-bit PCrel to PLT entry. */ ++#define R_MN10300_GOT32 17 /* 32-bit offset to GOT entry. */ ++#define R_MN10300_GOT24 18 /* 24-bit offset to GOT entry. */ ++#define R_MN10300_GOT16 19 /* 16-bit offset to GOT entry. */ ++#define R_MN10300_COPY 20 /* Copy symbol at runtime. */ ++#define R_MN10300_GLOB_DAT 21 /* Create GOT entry. */ ++#define R_MN10300_JMP_SLOT 22 /* Create PLT entry. */ ++#define R_MN10300_RELATIVE 23 /* Adjust by program base. */ ++ ++#define R_MN10300_NUM 24 ++ ++ ++/* M32R relocs. */ ++#define R_M32R_NONE 0 /* No reloc. */ ++#define R_M32R_16 1 /* Direct 16 bit. */ ++#define R_M32R_32 2 /* Direct 32 bit. */ ++#define R_M32R_24 3 /* Direct 24 bit. */ ++#define R_M32R_10_PCREL 4 /* PC relative 10 bit shifted. */ ++#define R_M32R_18_PCREL 5 /* PC relative 18 bit shifted. */ ++#define R_M32R_26_PCREL 6 /* PC relative 26 bit shifted. */ ++#define R_M32R_HI16_ULO 7 /* High 16 bit with unsigned low. */ ++#define R_M32R_HI16_SLO 8 /* High 16 bit with signed low. */ ++#define R_M32R_LO16 9 /* Low 16 bit. */ ++#define R_M32R_SDA16 10 /* 16 bit offset in SDA. */ ++#define R_M32R_GNU_VTINHERIT 11 ++#define R_M32R_GNU_VTENTRY 12 ++/* M32R relocs use SHT_RELA. */ ++#define R_M32R_16_RELA 33 /* Direct 16 bit. */ ++#define R_M32R_32_RELA 34 /* Direct 32 bit. */ ++#define R_M32R_24_RELA 35 /* Direct 24 bit. */ ++#define R_M32R_10_PCREL_RELA 36 /* PC relative 10 bit shifted. */ ++#define R_M32R_18_PCREL_RELA 37 /* PC relative 18 bit shifted. */ ++#define R_M32R_26_PCREL_RELA 38 /* PC relative 26 bit shifted. */ ++#define R_M32R_HI16_ULO_RELA 39 /* High 16 bit with unsigned low */ ++#define R_M32R_HI16_SLO_RELA 40 /* High 16 bit with signed low */ ++#define R_M32R_LO16_RELA 41 /* Low 16 bit */ ++#define R_M32R_SDA16_RELA 42 /* 16 bit offset in SDA */ ++#define R_M32R_RELA_GNU_VTINHERIT 43 ++#define R_M32R_RELA_GNU_VTENTRY 44 ++#define R_M32R_REL32 45 /* PC relative 32 bit. */ ++ ++#define R_M32R_GOT24 48 /* 24 bit GOT entry */ ++#define R_M32R_26_PLTREL 49 /* 26 bit PC relative to PLT shifted */ ++#define R_M32R_COPY 50 /* Copy symbol at runtime */ ++#define R_M32R_GLOB_DAT 51 /* Create GOT entry */ ++#define R_M32R_JMP_SLOT 52 /* Create PLT entry */ ++#define R_M32R_RELATIVE 53 /* Adjust by program base */ ++#define R_M32R_GOTOFF 54 /* 24 bit offset to GOT */ ++#define R_M32R_GOTPC24 55 /* 24 bit PC relative offset to GOT */ ++#define R_M32R_GOT16_HI_ULO 56 /* High 16 bit GOT entry with unsigned ++ low */ ++#define R_M32R_GOT16_HI_SLO 57 /* High 16 bit GOT entry with signed ++ low */ ++#define R_M32R_GOT16_LO 58 /* Low 16 bit GOT entry */ ++#define R_M32R_GOTPC_HI_ULO 59 /* High 16 bit PC relative offset to ++ GOT with unsigned low */ ++#define R_M32R_GOTPC_HI_SLO 60 /* High 16 bit PC relative offset to ++ GOT with signed low */ ++#define R_M32R_GOTPC_LO 61 /* Low 16 bit PC relative offset to ++ GOT */ ++#define R_M32R_GOTOFF_HI_ULO 62 /* High 16 bit offset to GOT ++ with unsigned low */ ++#define R_M32R_GOTOFF_HI_SLO 63 /* High 16 bit offset to GOT ++ with signed low */ ++#define R_M32R_GOTOFF_LO 64 /* Low 16 bit offset to GOT */ ++#define R_M32R_NUM 256 /* Keep this the last entry. */ ++ ++ ++/* TILEPro relocations. */ ++#define R_TILEPRO_NONE 0 /* No reloc */ ++#define R_TILEPRO_32 1 /* Direct 32 bit */ ++#define R_TILEPRO_16 2 /* Direct 16 bit */ ++#define R_TILEPRO_8 3 /* Direct 8 bit */ ++#define R_TILEPRO_32_PCREL 4 /* PC relative 32 bit */ ++#define R_TILEPRO_16_PCREL 5 /* PC relative 16 bit */ ++#define R_TILEPRO_8_PCREL 6 /* PC relative 8 bit */ ++#define R_TILEPRO_LO16 7 /* Low 16 bit */ ++#define R_TILEPRO_HI16 8 /* High 16 bit */ ++#define R_TILEPRO_HA16 9 /* High 16 bit, adjusted */ ++#define R_TILEPRO_COPY 10 /* Copy relocation */ ++#define R_TILEPRO_GLOB_DAT 11 /* Create GOT entry */ ++#define R_TILEPRO_JMP_SLOT 12 /* Create PLT entry */ ++#define R_TILEPRO_RELATIVE 13 /* Adjust by program base */ ++#define R_TILEPRO_BROFF_X1 14 /* X1 pipe branch offset */ ++#define R_TILEPRO_JOFFLONG_X1 15 /* X1 pipe jump offset */ ++#define R_TILEPRO_JOFFLONG_X1_PLT 16 /* X1 pipe jump offset to PLT */ ++#define R_TILEPRO_IMM8_X0 17 /* X0 pipe 8-bit */ ++#define R_TILEPRO_IMM8_Y0 18 /* Y0 pipe 8-bit */ ++#define R_TILEPRO_IMM8_X1 19 /* X1 pipe 8-bit */ ++#define R_TILEPRO_IMM8_Y1 20 /* Y1 pipe 8-bit */ ++#define R_TILEPRO_MT_IMM15_X1 21 /* X1 pipe mtspr */ ++#define R_TILEPRO_MF_IMM15_X1 22 /* X1 pipe mfspr */ ++#define R_TILEPRO_IMM16_X0 23 /* X0 pipe 16-bit */ ++#define R_TILEPRO_IMM16_X1 24 /* X1 pipe 16-bit */ ++#define R_TILEPRO_IMM16_X0_LO 25 /* X0 pipe low 16-bit */ ++#define R_TILEPRO_IMM16_X1_LO 26 /* X1 pipe low 16-bit */ ++#define R_TILEPRO_IMM16_X0_HI 27 /* X0 pipe high 16-bit */ ++#define R_TILEPRO_IMM16_X1_HI 28 /* X1 pipe high 16-bit */ ++#define R_TILEPRO_IMM16_X0_HA 29 /* X0 pipe high 16-bit, adjusted */ ++#define R_TILEPRO_IMM16_X1_HA 30 /* X1 pipe high 16-bit, adjusted */ ++#define R_TILEPRO_IMM16_X0_PCREL 31 /* X0 pipe PC relative 16 bit */ ++#define R_TILEPRO_IMM16_X1_PCREL 32 /* X1 pipe PC relative 16 bit */ ++#define R_TILEPRO_IMM16_X0_LO_PCREL 33 /* X0 pipe PC relative low 16 bit */ ++#define R_TILEPRO_IMM16_X1_LO_PCREL 34 /* X1 pipe PC relative low 16 bit */ ++#define R_TILEPRO_IMM16_X0_HI_PCREL 35 /* X0 pipe PC relative high 16 bit */ ++#define R_TILEPRO_IMM16_X1_HI_PCREL 36 /* X1 pipe PC relative high 16 bit */ ++#define R_TILEPRO_IMM16_X0_HA_PCREL 37 /* X0 pipe PC relative ha() 16 bit */ ++#define R_TILEPRO_IMM16_X1_HA_PCREL 38 /* X1 pipe PC relative ha() 16 bit */ ++#define R_TILEPRO_IMM16_X0_GOT 39 /* X0 pipe 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT 40 /* X1 pipe 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_LO 41 /* X0 pipe low 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_LO 42 /* X1 pipe low 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_HI 43 /* X0 pipe high 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_HI 44 /* X1 pipe high 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X0_GOT_HA 45 /* X0 pipe ha() 16-bit GOT offset */ ++#define R_TILEPRO_IMM16_X1_GOT_HA 46 /* X1 pipe ha() 16-bit GOT offset */ ++#define R_TILEPRO_MMSTART_X0 47 /* X0 pipe mm "start" */ ++#define R_TILEPRO_MMEND_X0 48 /* X0 pipe mm "end" */ ++#define R_TILEPRO_MMSTART_X1 49 /* X1 pipe mm "start" */ ++#define R_TILEPRO_MMEND_X1 50 /* X1 pipe mm "end" */ ++#define R_TILEPRO_SHAMT_X0 51 /* X0 pipe shift amount */ ++#define R_TILEPRO_SHAMT_X1 52 /* X1 pipe shift amount */ ++#define R_TILEPRO_SHAMT_Y0 53 /* Y0 pipe shift amount */ ++#define R_TILEPRO_SHAMT_Y1 54 /* Y1 pipe shift amount */ ++#define R_TILEPRO_DEST_IMM8_X1 55 /* X1 pipe destination 8-bit */ ++/* Relocs 56-59 are currently not defined. */ ++#define R_TILEPRO_TLS_GD_CALL 60 /* "jal" for TLS GD */ ++#define R_TILEPRO_IMM8_X0_TLS_GD_ADD 61 /* X0 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_X1_TLS_GD_ADD 62 /* X1 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_Y0_TLS_GD_ADD 63 /* Y0 pipe "addi" for TLS GD */ ++#define R_TILEPRO_IMM8_Y1_TLS_GD_ADD 64 /* Y1 pipe "addi" for TLS GD */ ++#define R_TILEPRO_TLS_IE_LOAD 65 /* "lw_tls" for TLS IE */ ++#define R_TILEPRO_IMM16_X0_TLS_GD 66 /* X0 pipe 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD 67 /* X1 pipe 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_LO 68 /* X0 pipe low 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_LO 69 /* X1 pipe low 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_HI 70 /* X0 pipe high 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_HI 71 /* X1 pipe high 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_GD_HA 72 /* X0 pipe ha() 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X1_TLS_GD_HA 73 /* X1 pipe ha() 16-bit TLS GD offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE 74 /* X0 pipe 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE 75 /* X1 pipe 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_LO 76 /* X0 pipe low 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_LO 77 /* X1 pipe low 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_HI 78 /* X0 pipe high 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_HI 79 /* X1 pipe high 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_IE_HA 80 /* X0 pipe ha() 16-bit TLS IE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_IE_HA 81 /* X1 pipe ha() 16-bit TLS IE offset */ ++#define R_TILEPRO_TLS_DTPMOD32 82 /* ID of module containing symbol */ ++#define R_TILEPRO_TLS_DTPOFF32 83 /* Offset in TLS block */ ++#define R_TILEPRO_TLS_TPOFF32 84 /* Offset in static TLS block */ ++#define R_TILEPRO_IMM16_X0_TLS_LE 85 /* X0 pipe 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE 86 /* X1 pipe 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_LO 87 /* X0 pipe low 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_LO 88 /* X1 pipe low 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_HI 89 /* X0 pipe high 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_HI 90 /* X1 pipe high 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X0_TLS_LE_HA 91 /* X0 pipe ha() 16-bit TLS LE offset */ ++#define R_TILEPRO_IMM16_X1_TLS_LE_HA 92 /* X1 pipe ha() 16-bit TLS LE offset */ ++ ++#define R_TILEPRO_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ ++#define R_TILEPRO_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ ++ ++#define R_TILEPRO_NUM 130 ++ ++ ++/* TILE-Gx relocations. */ ++#define R_TILEGX_NONE 0 /* No reloc */ ++#define R_TILEGX_64 1 /* Direct 64 bit */ ++#define R_TILEGX_32 2 /* Direct 32 bit */ ++#define R_TILEGX_16 3 /* Direct 16 bit */ ++#define R_TILEGX_8 4 /* Direct 8 bit */ ++#define R_TILEGX_64_PCREL 5 /* PC relative 64 bit */ ++#define R_TILEGX_32_PCREL 6 /* PC relative 32 bit */ ++#define R_TILEGX_16_PCREL 7 /* PC relative 16 bit */ ++#define R_TILEGX_8_PCREL 8 /* PC relative 8 bit */ ++#define R_TILEGX_HW0 9 /* hword 0 16-bit */ ++#define R_TILEGX_HW1 10 /* hword 1 16-bit */ ++#define R_TILEGX_HW2 11 /* hword 2 16-bit */ ++#define R_TILEGX_HW3 12 /* hword 3 16-bit */ ++#define R_TILEGX_HW0_LAST 13 /* last hword 0 16-bit */ ++#define R_TILEGX_HW1_LAST 14 /* last hword 1 16-bit */ ++#define R_TILEGX_HW2_LAST 15 /* last hword 2 16-bit */ ++#define R_TILEGX_COPY 16 /* Copy relocation */ ++#define R_TILEGX_GLOB_DAT 17 /* Create GOT entry */ ++#define R_TILEGX_JMP_SLOT 18 /* Create PLT entry */ ++#define R_TILEGX_RELATIVE 19 /* Adjust by program base */ ++#define R_TILEGX_BROFF_X1 20 /* X1 pipe branch offset */ ++#define R_TILEGX_JUMPOFF_X1 21 /* X1 pipe jump offset */ ++#define R_TILEGX_JUMPOFF_X1_PLT 22 /* X1 pipe jump offset to PLT */ ++#define R_TILEGX_IMM8_X0 23 /* X0 pipe 8-bit */ ++#define R_TILEGX_IMM8_Y0 24 /* Y0 pipe 8-bit */ ++#define R_TILEGX_IMM8_X1 25 /* X1 pipe 8-bit */ ++#define R_TILEGX_IMM8_Y1 26 /* Y1 pipe 8-bit */ ++#define R_TILEGX_DEST_IMM8_X1 27 /* X1 pipe destination 8-bit */ ++#define R_TILEGX_MT_IMM14_X1 28 /* X1 pipe mtspr */ ++#define R_TILEGX_MF_IMM14_X1 29 /* X1 pipe mfspr */ ++#define R_TILEGX_MMSTART_X0 30 /* X0 pipe mm "start" */ ++#define R_TILEGX_MMEND_X0 31 /* X0 pipe mm "end" */ ++#define R_TILEGX_SHAMT_X0 32 /* X0 pipe shift amount */ ++#define R_TILEGX_SHAMT_X1 33 /* X1 pipe shift amount */ ++#define R_TILEGX_SHAMT_Y0 34 /* Y0 pipe shift amount */ ++#define R_TILEGX_SHAMT_Y1 35 /* Y1 pipe shift amount */ ++#define R_TILEGX_IMM16_X0_HW0 36 /* X0 pipe hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0 37 /* X1 pipe hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1 38 /* X0 pipe hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1 39 /* X1 pipe hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2 40 /* X0 pipe hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2 41 /* X1 pipe hword 2 */ ++#define R_TILEGX_IMM16_X0_HW3 42 /* X0 pipe hword 3 */ ++#define R_TILEGX_IMM16_X1_HW3 43 /* X1 pipe hword 3 */ ++#define R_TILEGX_IMM16_X0_HW0_LAST 44 /* X0 pipe last hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_LAST 45 /* X1 pipe last hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_LAST 46 /* X0 pipe last hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_LAST 47 /* X1 pipe last hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_LAST 48 /* X0 pipe last hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_LAST 49 /* X1 pipe last hword 2 */ ++#define R_TILEGX_IMM16_X0_HW0_PCREL 50 /* X0 pipe PC relative hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_PCREL 51 /* X1 pipe PC relative hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_PCREL 52 /* X0 pipe PC relative hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_PCREL 53 /* X1 pipe PC relative hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_PCREL 54 /* X0 pipe PC relative hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_PCREL 55 /* X1 pipe PC relative hword 2 */ ++#define R_TILEGX_IMM16_X0_HW3_PCREL 56 /* X0 pipe PC relative hword 3 */ ++#define R_TILEGX_IMM16_X1_HW3_PCREL 57 /* X1 pipe PC relative hword 3 */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_PCREL 58 /* X0 pipe PC-rel last hword 0 */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_PCREL 59 /* X1 pipe PC-rel last hword 0 */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_PCREL 60 /* X0 pipe PC-rel last hword 1 */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_PCREL 61 /* X1 pipe PC-rel last hword 1 */ ++#define R_TILEGX_IMM16_X0_HW2_LAST_PCREL 62 /* X0 pipe PC-rel last hword 2 */ ++#define R_TILEGX_IMM16_X1_HW2_LAST_PCREL 63 /* X1 pipe PC-rel last hword 2 */ ++#define R_TILEGX_IMM16_X0_HW0_GOT 64 /* X0 pipe hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW0_GOT 65 /* X1 pipe hword 0 GOT offset */ ++/* Relocs 66-71 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_GOT 72 /* X0 pipe last hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_GOT 73 /* X1 pipe last hword 0 GOT offset */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_GOT 74 /* X0 pipe last hword 1 GOT offset */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_GOT 75 /* X1 pipe last hword 1 GOT offset */ ++/* Relocs 76-77 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_GD 78 /* X0 pipe hword 0 TLS GD offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_GD 79 /* X1 pipe hword 0 TLS GD offset */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_LE 80 /* X0 pipe hword 0 TLS LE offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_LE 81 /* X1 pipe hword 0 TLS LE offset */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_LE 82 /* X0 pipe last hword 0 LE off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_LE 83 /* X1 pipe last hword 0 LE off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_LE 84 /* X0 pipe last hword 1 LE off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_LE 85 /* X1 pipe last hword 1 LE off */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_GD 86 /* X0 pipe last hword 0 GD off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_GD 87 /* X1 pipe last hword 0 GD off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_GD 88 /* X0 pipe last hword 1 GD off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_GD 89 /* X1 pipe last hword 1 GD off */ ++/* Relocs 90-91 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_TLS_IE 92 /* X0 pipe hword 0 TLS IE offset */ ++#define R_TILEGX_IMM16_X1_HW0_TLS_IE 93 /* X1 pipe hword 0 TLS IE offset */ ++/* Relocs 94-99 are currently not defined. */ ++#define R_TILEGX_IMM16_X0_HW0_LAST_TLS_IE 100 /* X0 pipe last hword 0 IE off */ ++#define R_TILEGX_IMM16_X1_HW0_LAST_TLS_IE 101 /* X1 pipe last hword 0 IE off */ ++#define R_TILEGX_IMM16_X0_HW1_LAST_TLS_IE 102 /* X0 pipe last hword 1 IE off */ ++#define R_TILEGX_IMM16_X1_HW1_LAST_TLS_IE 103 /* X1 pipe last hword 1 IE off */ ++/* Relocs 104-105 are currently not defined. */ ++#define R_TILEGX_TLS_DTPMOD64 106 /* 64-bit ID of symbol's module */ ++#define R_TILEGX_TLS_DTPOFF64 107 /* 64-bit offset in TLS block */ ++#define R_TILEGX_TLS_TPOFF64 108 /* 64-bit offset in static TLS block */ ++#define R_TILEGX_TLS_DTPMOD32 109 /* 32-bit ID of symbol's module */ ++#define R_TILEGX_TLS_DTPOFF32 110 /* 32-bit offset in TLS block */ ++#define R_TILEGX_TLS_TPOFF32 111 /* 32-bit offset in static TLS block */ ++#define R_TILEGX_TLS_GD_CALL 112 /* "jal" for TLS GD */ ++#define R_TILEGX_IMM8_X0_TLS_GD_ADD 113 /* X0 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_X1_TLS_GD_ADD 114 /* X1 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_Y0_TLS_GD_ADD 115 /* Y0 pipe "addi" for TLS GD */ ++#define R_TILEGX_IMM8_Y1_TLS_GD_ADD 116 /* Y1 pipe "addi" for TLS GD */ ++#define R_TILEGX_TLS_IE_LOAD 117 /* "ld_tls" for TLS IE */ ++#define R_TILEGX_IMM8_X0_TLS_ADD 118 /* X0 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_X1_TLS_ADD 119 /* X1 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_Y0_TLS_ADD 120 /* Y0 pipe "addi" for TLS GD/IE */ ++#define R_TILEGX_IMM8_Y1_TLS_ADD 121 /* Y1 pipe "addi" for TLS GD/IE */ ++ ++#define R_TILEGX_GNU_VTINHERIT 128 /* GNU C++ vtable hierarchy */ ++#define R_TILEGX_GNU_VTENTRY 129 /* GNU C++ vtable member usage */ ++ ++#define R_TILEGX_NUM 130 ++ ++#endif /* elf.h */ +--- a/scripts/mod/mk_elfconfig.c ++++ b/scripts/mod/mk_elfconfig.c +@@ -2,7 +2,11 @@ + #include + #include + #include ++#ifndef __APPLE__ + #include ++#else ++#include "elf.h" ++#endif + + int + main(int argc, char **argv) +--- a/scripts/mod/modpost.h ++++ b/scripts/mod/modpost.h +@@ -8,7 +8,11 @@ + #include + #include + #include ++#if !(defined(__APPLE__) || defined(__CYGWIN__)) + #include ++#else ++#include "elf.h" ++#endif + + #include "elfconfig.h" + diff --git a/target/linux/generic/hack-4.14/211-host_tools_portability.patch b/target/linux/generic/hack-4.14/211-host_tools_portability.patch new file mode 100644 index 000000000..1434f1c4d --- /dev/null +++ b/target/linux/generic/hack-4.14/211-host_tools_portability.patch @@ -0,0 +1,40 @@ +From 7f698012384ccb1ed10cc758acfd085096fdb307 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:02:03 +0200 +Subject: kernel: fix linux 4.9 host tools portability issues + +Signed-off-by: Felix Fietkau +--- + tools/build/Build.include | 2 +- + tools/perf/pmu-events/jevents.c | 1 + + tools/perf/pmu-events/json.c | 1 - + 3 files changed, 2 insertions(+), 2 deletions(-) + +--- a/tools/build/Build.include ++++ b/tools/build/Build.include +@@ -97,4 +97,4 @@ cxx_flags = -Wp,-MD,$(depfile) -Wp,-MT,$ + ### + ## HOSTCC C flags + +-host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) ++host_c_flags = -MD -MF $(depfile) -Wp -MT $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) +--- a/tools/perf/pmu-events/jevents.c ++++ b/tools/perf/pmu-events/jevents.c +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/tools/perf/pmu-events/json.c ++++ b/tools/perf/pmu-events/json.c +@@ -38,7 +38,6 @@ + #include + #include "jsmn.h" + #include "json.h" +-#include + + + static char *mapfile(const char *fn, size_t *size) diff --git a/target/linux/generic/hack-4.14/212-byteshift_portability.patch b/target/linux/generic/hack-4.14/212-byteshift_portability.patch new file mode 100644 index 000000000..1a5ac8798 --- /dev/null +++ b/target/linux/generic/hack-4.14/212-byteshift_portability.patch @@ -0,0 +1,65 @@ +From 48232d3d931c95953ce2ddfe7da7bb164aef6a73 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:03:16 +0200 +Subject: linux-3.6: fix portability of some includes files in tools/ used on the host + +lede-commit: 6040b1d29ab1f047c5e49b748abcb6a3196add28 +Signed-off-by: Felix Fietkau +--- + tools/include/tools/be_byteshift.h | 4 ++++ + tools/include/tools/le_byteshift.h | 4 ++++ + tools/include/tools/linux_types.h | 22 ++++++++++++++++++++++ + 3 files changed, 30 insertions(+) + create mode 100644 tools/include/tools/linux_types.h + +--- a/tools/include/tools/be_byteshift.h ++++ b/tools/include/tools/be_byteshift.h +@@ -2,6 +2,10 @@ + #ifndef _TOOLS_BE_BYTESHIFT_H + #define _TOOLS_BE_BYTESHIFT_H + ++#ifndef __linux__ ++#include "linux_types.h" ++#endif ++ + #include + + static inline uint16_t __get_unaligned_be16(const uint8_t *p) +--- a/tools/include/tools/le_byteshift.h ++++ b/tools/include/tools/le_byteshift.h +@@ -2,6 +2,10 @@ + #ifndef _TOOLS_LE_BYTESHIFT_H + #define _TOOLS_LE_BYTESHIFT_H + ++#ifndef __linux__ ++#include "linux_types.h" ++#endif ++ + #include + + static inline uint16_t __get_unaligned_le16(const uint8_t *p) +--- /dev/null ++++ b/tools/include/tools/linux_types.h +@@ -0,0 +1,22 @@ ++#ifndef __LINUX_TYPES_H ++#define __LINUX_TYPES_H ++ ++#include ++ ++typedef uint8_t __u8; ++typedef uint8_t __be8; ++typedef uint8_t __le8; ++ ++typedef uint16_t __u16; ++typedef uint16_t __be16; ++typedef uint16_t __le16; ++ ++typedef uint32_t __u32; ++typedef uint32_t __be32; ++typedef uint32_t __le32; ++ ++typedef uint64_t __u64; ++typedef uint64_t __be64; ++typedef uint64_t __le64; ++ ++#endif diff --git a/target/linux/generic/hack-4.14/214-spidev_h_portability.patch b/target/linux/generic/hack-4.14/214-spidev_h_portability.patch new file mode 100644 index 000000000..093f600c8 --- /dev/null +++ b/target/linux/generic/hack-4.14/214-spidev_h_portability.patch @@ -0,0 +1,24 @@ +From be9be95ff10e16a5b4ad36f903978d0cc5747024 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:04:08 +0200 +Subject: kernel: fix linux/spi/spidev.h portability issues with musl + +Felix will try to get this define included into musl + +lede-commit: 795e7cf60de19e7a076a46874fab7bb88b43bbff +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/spi/spidev.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/uapi/linux/spi/spidev.h ++++ b/include/uapi/linux/spi/spidev.h +@@ -113,7 +113,7 @@ struct spi_ioc_transfer { + + /* not all platforms use or _IOC_TYPECHECK() ... */ + #define SPI_MSGSIZE(N) \ +- ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << _IOC_SIZEBITS)) \ ++ ((((N)*(sizeof (struct spi_ioc_transfer))) < (1 << 13)) \ + ? ((N)*(sizeof (struct spi_ioc_transfer))) : 0) + #define SPI_IOC_MESSAGE(N) _IOW(SPI_IOC_MAGIC, 0, char[SPI_MSGSIZE(N)]) + diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch new file mode 100644 index 000000000..4463e2313 --- /dev/null +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -0,0 +1,258 @@ +From e3d8676f5722b7622685581e06e8f53e6138e3ab Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 23:42:36 +0200 +Subject: use -ffunction-sections, -fdata-sections and --gc-sections + +In combination with kernel symbol export stripping this significantly reduces +the kernel image size. Used on both ARM and MIPS architectures. + +Signed-off-by: Felix Fietkau +Signed-off-by: Jonas Gorski +Signed-off-by: Gabor Juhos +--- + Makefile | 10 +++---- + arch/arm/Kconfig | 1 + + arch/arm/boot/compressed/Makefile | 1 + + arch/arm/kernel/vmlinux.lds.S | 26 ++++++++-------- + arch/mips/Kconfig | 1 + + arch/mips/kernel/vmlinux.lds.S | 4 +-- + include/asm-generic/vmlinux.lds.h | 63 ++++++++++++++++++++------------------- + 7 files changed, 55 insertions(+), 51 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -410,6 +410,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE + KBUILD_CFLAGS_MODULE := -DMODULE + KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + ++ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION ++KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) ++KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,) ++endif ++ + # Read KERNELRELEASE from include/config/kernel.release (if it exists) + KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) + KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) +@@ -783,11 +788,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH + KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) + endif + +-ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +-KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,) +-KBUILD_CFLAGS += $(call cc-option,-fdata-sections,) +-endif +- + # arch Makefile may override CC so keep this after arch Makefile is included + NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include) + CHECKFLAGS += $(NOSTDINC_FLAGS) +--- a/arch/arm/Kconfig ++++ b/arch/arm/Kconfig +@@ -91,6 +91,7 @@ config ARM + select HAVE_UID16 + select HAVE_VIRT_CPU_ACCOUNTING_GEN + select IRQ_FORCED_THREADING ++ select LD_DEAD_CODE_DATA_ELIMINATION + select MODULES_USE_ELF_REL + select NO_BOOTMEM + select OF_EARLY_FLATTREE if OF +--- a/arch/arm/boot/compressed/Makefile ++++ b/arch/arm/boot/compressed/Makefile +@@ -103,6 +103,7 @@ ifeq ($(CONFIG_FUNCTION_TRACER),y) + ORIG_CFLAGS := $(KBUILD_CFLAGS) + KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) + endif ++KBUILD_CFLAGS_KERNEL := $(patsubst -f%-sections,,$(KBUILD_CFLAGS_KERNEL)) + + # -fstack-protector-strong triggers protection checks in this code, + # but it is being used too early to link to meaningful stack_chk logic. +--- a/arch/arm/kernel/vmlinux.lds.S ++++ b/arch/arm/kernel/vmlinux.lds.S +@@ -18,7 +18,7 @@ + #define PROC_INFO \ + . = ALIGN(4); \ + VMLINUX_SYMBOL(__proc_info_begin) = .; \ +- *(.proc.info.init) \ ++ KEEP(*(.proc.info.init)) \ + VMLINUX_SYMBOL(__proc_info_end) = .; + + #define HYPERVISOR_TEXT \ +@@ -29,11 +29,11 @@ + #define IDMAP_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__idmap_text_start) = .; \ +- *(.idmap.text) \ ++ KEEP(*(.idmap.text)) \ + VMLINUX_SYMBOL(__idmap_text_end) = .; \ + . = ALIGN(PAGE_SIZE); \ + VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ +- *(.hyp.idmap.text) \ ++ KEEP(*(.hyp.idmap.text)) \ + VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; + + #ifdef CONFIG_HOTPLUG_CPU +@@ -106,7 +106,7 @@ SECTIONS + _stext = .; /* Text and read-only data */ + IDMAP_TEXT + __exception_text_start = .; +- *(.exception.text) ++ KEEP(*(.exception.text)) + __exception_text_end = .; + IRQENTRY_TEXT + SOFTIRQENTRY_TEXT +@@ -135,7 +135,7 @@ SECTIONS + __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { + __start___ex_table = .; + #ifdef CONFIG_MMU +- *(__ex_table) ++ KEEP(*(__ex_table)) + #endif + __stop___ex_table = .; + } +@@ -147,12 +147,12 @@ SECTIONS + . = ALIGN(8); + .ARM.unwind_idx : { + __start_unwind_idx = .; +- *(.ARM.exidx*) ++ KEEP(*(.ARM.exidx*)) + __stop_unwind_idx = .; + } + .ARM.unwind_tab : { + __start_unwind_tab = .; +- *(.ARM.extab*) ++ KEEP(*(.ARM.extab*)) + __stop_unwind_tab = .; + } + #endif +@@ -172,14 +172,14 @@ SECTIONS + */ + __vectors_start = .; + .vectors 0xffff0000 : AT(__vectors_start) { +- *(.vectors) ++ KEEP(*(.vectors)) + } + . = __vectors_start + SIZEOF(.vectors); + __vectors_end = .; + + __stubs_start = .; + .stubs ADDR(.vectors) + 0x1000 : AT(__stubs_start) { +- *(.stubs) ++ KEEP(*(.stubs)) + } + . = __stubs_start + SIZEOF(.stubs); + __stubs_end = .; +@@ -195,24 +195,24 @@ SECTIONS + } + .init.arch.info : { + __arch_info_begin = .; +- *(.arch.info.init) ++ KEEP(*(.arch.info.init)) + __arch_info_end = .; + } + .init.tagtable : { + __tagtable_begin = .; +- *(.taglist.init) ++ KEEP(*(.taglist.init)) + __tagtable_end = .; + } + #ifdef CONFIG_SMP_ON_UP + .init.smpalt : { + __smpalt_begin = .; +- *(.alt.smp.init) ++ KEEP(*(.alt.smp.init)) + __smpalt_end = .; + } + #endif + .init.pv_table : { + __pv_table_begin = .; +- *(.pv_table) ++ KEEP(*(.pv_table)) + __pv_table_end = .; + } + .init.data : { +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -39,6 +39,7 @@ config MIPS + select HAVE_CBPF_JIT if (!64BIT && !CPU_MICROMIPS) + select HAVE_EBPF_JIT if (64BIT && !CPU_MICROMIPS) + select HAVE_CC_STACKPROTECTOR ++ select LD_DEAD_CODE_DATA_ELIMINATION + select HAVE_CONTEXT_TRACKING + select HAVE_COPY_THREAD_TLS + select HAVE_C_RECORDMCOUNT +--- a/arch/mips/kernel/vmlinux.lds.S ++++ b/arch/mips/kernel/vmlinux.lds.S +@@ -72,7 +72,7 @@ SECTIONS + /* Exception table for data bus errors */ + __dbe_table : { + __start___dbe_table = .; +- *(__dbe_table) ++ KEEP(*(__dbe_table)) + __stop___dbe_table = .; + } + +@@ -123,7 +123,7 @@ SECTIONS + . = ALIGN(4); + .mips.machines.init : AT(ADDR(.mips.machines.init) - LOAD_OFFSET) { + __mips_machines_start = .; +- *(.mips.machines.init) ++ KEEP(*(.mips.machines.init)) + __mips_machines_end = .; + } + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -105,7 +105,7 @@ + #ifdef CONFIG_FTRACE_MCOUNT_RECORD + #define MCOUNT_REC() . = ALIGN(8); \ + VMLINUX_SYMBOL(__start_mcount_loc) = .; \ +- *(__mcount_loc) \ ++ KEEP(*(__mcount_loc)) \ + VMLINUX_SYMBOL(__stop_mcount_loc) = .; + #else + #define MCOUNT_REC() +@@ -113,7 +113,7 @@ + + #ifdef CONFIG_TRACE_BRANCH_PROFILING + #define LIKELY_PROFILE() VMLINUX_SYMBOL(__start_annotated_branch_profile) = .; \ +- *(_ftrace_annotated_branch) \ ++ KEEP(*(_ftrace_annotated_branch)) \ + VMLINUX_SYMBOL(__stop_annotated_branch_profile) = .; + #else + #define LIKELY_PROFILE() +@@ -121,7 +121,7 @@ + + #ifdef CONFIG_PROFILE_ALL_BRANCHES + #define BRANCH_PROFILE() VMLINUX_SYMBOL(__start_branch_profile) = .; \ +- *(_ftrace_branch) \ ++ KEEP(*(_ftrace_branch)) \ + VMLINUX_SYMBOL(__stop_branch_profile) = .; + #else + #define BRANCH_PROFILE() +@@ -237,7 +237,8 @@ + LIKELY_PROFILE() \ + BRANCH_PROFILE() \ + TRACE_PRINTKS() \ +- TRACEPOINT_STR() ++ TRACEPOINT_STR() \ ++ *(.data.[a-zA-Z_]*) + + /* + * Data section helpers +@@ -496,7 +497,7 @@ + #define ENTRY_TEXT \ + ALIGN_FUNCTION(); \ + VMLINUX_SYMBOL(__entry_text_start) = .; \ +- *(.entry.text) \ ++ KEEP(*(.entry.text)) \ + VMLINUX_SYMBOL(__entry_text_end) = .; + + #define IRQENTRY_TEXT \ +@@ -603,7 +604,7 @@ + . = ALIGN(sbss_align); \ + .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ + *(.dynsbss) \ +- *(.sbss) \ ++ *(.sbss .sbss.*) \ + *(.scommon) \ + } + diff --git a/target/linux/generic/hack-4.14/221-module_exports.patch b/target/linux/generic/hack-4.14/221-module_exports.patch new file mode 100644 index 000000000..9fafc9fae --- /dev/null +++ b/target/linux/generic/hack-4.14/221-module_exports.patch @@ -0,0 +1,101 @@ +From b14784e7883390c20ed3ff904892255404a5914b Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:05:53 +0200 +Subject: add an optional config option for stripping all unnecessary symbol exports from the kernel image + +lede-commit: bb5a40c64b7c4f4848509fa0a6625055fc9e66cc +Signed-off-by: Felix Fietkau +--- + include/asm-generic/vmlinux.lds.h | 18 +++++++++++++++--- + include/linux/export.h | 9 ++++++++- + scripts/Makefile.build | 2 +- + 3 files changed, 24 insertions(+), 5 deletions(-) + +--- a/include/asm-generic/vmlinux.lds.h ++++ b/include/asm-generic/vmlinux.lds.h +@@ -54,6 +54,16 @@ + #define LOAD_OFFSET 0 + #endif + ++#ifndef SYMTAB_KEEP ++#define SYMTAB_KEEP KEEP(*(SORT(___ksymtab+*))) ++#define SYMTAB_KEEP_GPL KEEP(*(SORT(___ksymtab_gpl+*))) ++#endif ++ ++#ifndef SYMTAB_DISCARD ++#define SYMTAB_DISCARD ++#define SYMTAB_DISCARD_GPL ++#endif ++ + #include + + /* Align . to a 8 byte boundary equals to maximum function alignment. */ +@@ -341,14 +351,14 @@ + /* Kernel symbol table: Normal symbols */ \ + __ksymtab : AT(ADDR(__ksymtab) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___ksymtab) = .; \ +- KEEP(*(SORT(___ksymtab+*))) \ ++ SYMTAB_KEEP \ + VMLINUX_SYMBOL(__stop___ksymtab) = .; \ + } \ + \ + /* Kernel symbol table: GPL-only symbols */ \ + __ksymtab_gpl : AT(ADDR(__ksymtab_gpl) - LOAD_OFFSET) { \ + VMLINUX_SYMBOL(__start___ksymtab_gpl) = .; \ +- KEEP(*(SORT(___ksymtab_gpl+*))) \ ++ SYMTAB_KEEP_GPL \ + VMLINUX_SYMBOL(__stop___ksymtab_gpl) = .; \ + } \ + \ +@@ -410,7 +420,7 @@ + \ + /* Kernel symbol table: strings */ \ + __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) { \ +- *(__ksymtab_strings) \ ++ *(__ksymtab_strings+*) \ + } \ + \ + /* __*init sections */ \ +@@ -793,6 +803,8 @@ + EXIT_TEXT \ + EXIT_DATA \ + EXIT_CALL \ ++ SYMTAB_DISCARD \ ++ SYMTAB_DISCARD_GPL \ + *(.discard) \ + *(.discard.*) \ + } +--- a/include/linux/export.h ++++ b/include/linux/export.h +@@ -60,12 +60,19 @@ extern struct module __this_module; + #define __CRC_SYMBOL(sym, sec) + #endif + ++#ifdef MODULE ++#define __EXPORT_SUFFIX(sym) ++#else ++#define __EXPORT_SUFFIX(sym) "+" #sym ++#endif ++ + /* For every exported symbol, place a struct in the __ksymtab section */ + #define ___EXPORT_SYMBOL(sym, sec) \ + extern typeof(sym) sym; \ + __CRC_SYMBOL(sym, sec) \ + static const char __kstrtab_##sym[] \ +- __attribute__((section("__ksymtab_strings"), aligned(1))) \ ++ __attribute__((section("__ksymtab_strings" \ ++ __EXPORT_SUFFIX(sym)), aligned(1))) \ + = VMLINUX_SYMBOL_STR(sym); \ + static const struct kernel_symbol __ksymtab_##sym \ + __used \ +--- a/scripts/Makefile.build ++++ b/scripts/Makefile.build +@@ -420,7 +420,7 @@ targets += $(extra-y) $(MAKECMDGOALS) $( + # Linker scripts preprocessor (.lds.S -> .lds) + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds_S = LDS $@ +- cmd_cpp_lds_S = $(CPP) $(cpp_flags) -P -U$(ARCH) \ ++ cmd_cpp_lds_S = $(CPP) $(EXTRA_LDSFLAGS) $(cpp_flags) -P -U$(ARCH) \ + -D__ASSEMBLY__ -DLINKER_SCRIPT -o $@ $< + + $(obj)/%.lds: $(src)/%.lds.S FORCE diff --git a/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch b/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch new file mode 100644 index 000000000..3ae578c27 --- /dev/null +++ b/target/linux/generic/hack-4.14/230-openwrt_lzma_options.patch @@ -0,0 +1,71 @@ +From b3d00b452467f621317953d9e4c6f9ae8dcfd271 Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Fri, 7 Jul 2017 17:06:55 +0200 +Subject: use the openwrt lzma options for now + +lede-commit: 548de949f392049420a6a1feeef118b30ab8ea8c +Signed-off-by: Imre Kaloz +--- + lib/decompress.c | 1 + + scripts/Makefile.lib | 2 +- + scripts/gen_initramfs_list.sh | 10 +++++----- + 3 files changed, 7 insertions(+), 6 deletions(-) + +--- a/lib/decompress.c ++++ b/lib/decompress.c +@@ -49,6 +49,7 @@ static const struct compress_format comp + { {0x1f, 0x9e}, "gzip", gunzip }, + { {0x42, 0x5a}, "bzip2", bunzip2 }, + { {0x5d, 0x00}, "lzma", unlzma }, ++ { {0x6d, 0x00}, "lzma-openwrt", unlzma }, + { {0xfd, 0x37}, "xz", unxz }, + { {0x89, 0x4c}, "lzo", unlzo }, + { {0x02, 0x21}, "lz4", unlz4 }, +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) + + quiet_cmd_lzma = LZMA $@ + cmd_lzma = (cat $(filter-out FORCE,$^) | \ +- lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ + (rm -f $@ ; false) + + quiet_cmd_lzo = LZO $@ +--- a/scripts/gen_initramfs_list.sh ++++ b/scripts/gen_initramfs_list.sh +@@ -229,7 +229,7 @@ cpio_list= + output="/dev/stdout" + output_file="" + is_cpio_compressed= +-compr="gzip -n -9 -f" ++compr="gzip -n -9 -f -" + + arg="$1" + case "$arg" in +@@ -245,13 +245,13 @@ case "$arg" in + output=${cpio_list} + echo "$output_file" | grep -q "\.gz$" \ + && [ -x "`which gzip 2> /dev/null`" ] \ +- && compr="gzip -n -9 -f" ++ && compr="gzip -n -9 -f -" + echo "$output_file" | grep -q "\.bz2$" \ + && [ -x "`which bzip2 2> /dev/null`" ] \ +- && compr="bzip2 -9 -f" ++ && compr="bzip2 -9 -f -" + echo "$output_file" | grep -q "\.lzma$" \ + && [ -x "`which lzma 2> /dev/null`" ] \ +- && compr="lzma -9 -f" ++ && compr="lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so" + echo "$output_file" | grep -q "\.xz$" \ + && [ -x "`which xz 2> /dev/null`" ] \ + && compr="xz --check=crc32 --lzma2=dict=1MiB" +@@ -320,7 +320,7 @@ if [ ! -z ${output_file} ]; then + if [ "${is_cpio_compressed}" = "compressed" ]; then + cat ${cpio_tfile} > ${output_file} + else +- (cat ${cpio_tfile} | ${compr} - > ${output_file}) \ ++ (cat ${cpio_tfile} | ${compr} > ${output_file}) \ + || (rm -f ${output_file} ; false) + fi + [ -z ${cpio_file} ] && rm ${cpio_tfile} diff --git a/target/linux/generic/hack-4.14/250-netfilter_depends.patch b/target/linux/generic/hack-4.14/250-netfilter_depends.patch new file mode 100644 index 000000000..17068f7da --- /dev/null +++ b/target/linux/generic/hack-4.14/250-netfilter_depends.patch @@ -0,0 +1,27 @@ +From: Felix Fietkau +Subject: hack: net: remove bogus netfilter dependencies + +lede-commit: 589d2a377dee27d206fc3725325309cf649e4df6 +Signed-off-by: Felix Fietkau +--- + net/netfilter/Kconfig | 2 -- + 1 file changed, 2 deletions(-) + +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -223,7 +223,6 @@ config NF_CONNTRACK_FTP + + config NF_CONNTRACK_H323 + tristate "H.323 protocol support" +- depends on IPV6 || IPV6=n + depends on NETFILTER_ADVANCED + help + H.323 is a VoIP signalling protocol from ITU-T. As one of the most +@@ -1012,7 +1011,6 @@ config NETFILTER_XT_TARGET_SECMARK + + config NETFILTER_XT_TARGET_TCPMSS + tristate '"TCPMSS" target support' +- depends on IPV6 || IPV6=n + default m if NETFILTER_ADVANCED=n + ---help--- + This option adds a `TCPMSS' target, which allows you to alter the diff --git a/target/linux/generic/hack-4.14/251-sound_kconfig.patch b/target/linux/generic/hack-4.14/251-sound_kconfig.patch new file mode 100644 index 000000000..e1e48ce5f --- /dev/null +++ b/target/linux/generic/hack-4.14/251-sound_kconfig.patch @@ -0,0 +1,197 @@ +From da3c50704f14132f4adf80d48e9a4cd5d46e54c9 Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:09:21 +0200 +Subject: kconfig: owrt specifc dependencies + +Signed-off-by: John Crispin +--- + crypto/Kconfig | 10 +++++----- + drivers/bcma/Kconfig | 1 + + drivers/ssb/Kconfig | 3 ++- + lib/Kconfig | 8 ++++---- + net/netfilter/Kconfig | 2 +- + net/wireless/Kconfig | 17 ++++++++++------- + sound/core/Kconfig | 4 ++-- + 7 files changed, 25 insertions(+), 20 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -33,7 +33,7 @@ config CRYPTO_FIPS + this is. + + config CRYPTO_ALGAPI +- tristate ++ tristate "ALGAPI" + select CRYPTO_ALGAPI2 + help + This option provides the API for cryptographic algorithms. +@@ -42,7 +42,7 @@ config CRYPTO_ALGAPI2 + tristate + + config CRYPTO_AEAD +- tristate ++ tristate "AEAD" + select CRYPTO_AEAD2 + select CRYPTO_ALGAPI + +@@ -53,7 +53,7 @@ config CRYPTO_AEAD2 + select CRYPTO_RNG2 + + config CRYPTO_BLKCIPHER +- tristate ++ tristate "BLKCIPHER" + select CRYPTO_BLKCIPHER2 + select CRYPTO_ALGAPI + +@@ -64,7 +64,7 @@ config CRYPTO_BLKCIPHER2 + select CRYPTO_WORKQUEUE + + config CRYPTO_HASH +- tristate ++ tristate "HASH" + select CRYPTO_HASH2 + select CRYPTO_ALGAPI + +@@ -73,7 +73,7 @@ config CRYPTO_HASH2 + select CRYPTO_ALGAPI2 + + config CRYPTO_RNG +- tristate ++ tristate "RNG" + select CRYPTO_RNG2 + select CRYPTO_ALGAPI + +--- a/drivers/bcma/Kconfig ++++ b/drivers/bcma/Kconfig +@@ -15,6 +15,7 @@ menuconfig BCMA + config BCMA_BLOCKIO + bool + depends on BCMA ++ default y + + config BCMA_HOST_PCI_POSSIBLE + bool +--- a/drivers/ssb/Kconfig ++++ b/drivers/ssb/Kconfig +@@ -29,6 +29,7 @@ config SSB_SPROM + config SSB_BLOCKIO + bool + depends on SSB ++ default y + + config SSB_PCIHOST_POSSIBLE + bool +@@ -49,7 +50,7 @@ config SSB_PCIHOST + config SSB_B43_PCI_BRIDGE + bool + depends on SSB_PCIHOST +- default n ++ default y + + config SSB_PCMCIAHOST_POSSIBLE + bool +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -358,16 +358,16 @@ config BCH_CONST_T + # Textsearch support is select'ed if needed + # + config TEXTSEARCH +- bool ++ boolean "Textsearch support" + + config TEXTSEARCH_KMP +- tristate ++ tristate "Textsearch KMP" + + config TEXTSEARCH_BM +- tristate ++ tristate "Textsearch BM" + + config TEXTSEARCH_FSM +- tristate ++ tristate "Textsearch FSM" + + config BTREE + bool +--- a/net/netfilter/Kconfig ++++ b/net/netfilter/Kconfig +@@ -10,7 +10,7 @@ config NETFILTER_INGRESS + infrastructure. + + config NETFILTER_NETLINK +- tristate ++ tristate "Netfilter NFNETLINK interface" + + config NETFILTER_NETLINK_ACCT + tristate "Netfilter NFACCT over NFNETLINK interface" +--- a/net/wireless/Kconfig ++++ b/net/wireless/Kconfig +@@ -1,5 +1,5 @@ + config WIRELESS_EXT +- bool ++ bool "Wireless extensions" + + config WEXT_CORE + def_bool y +@@ -11,10 +11,10 @@ config WEXT_PROC + depends on WEXT_CORE + + config WEXT_SPY +- bool ++ bool "WEXT_SPY" + + config WEXT_PRIV +- bool ++ bool "WEXT_PRIV" + + config CFG80211 + tristate "cfg80211 - wireless configuration API" +@@ -188,7 +188,7 @@ config CFG80211_WEXT_EXPORT + wext compatibility symbols to be exported. + + config LIB80211 +- tristate ++ tristate "LIB80211" + default n + help + This options enables a library of common routines used +@@ -197,13 +197,16 @@ config LIB80211 + Drivers should select this themselves if needed. + + config LIB80211_CRYPT_WEP +- tristate ++ tristate "LIB80211_CRYPT_WEP" ++ select LIB80211 + + config LIB80211_CRYPT_CCMP +- tristate ++ tristate "LIB80211_CRYPT_CCMP" ++ select LIB80211 + + config LIB80211_CRYPT_TKIP +- tristate ++ tristate "LIB80211_CRYPT_TKIP" ++ select LIB80211 + + config LIB80211_DEBUG + bool "lib80211 debugging messages" +--- a/sound/core/Kconfig ++++ b/sound/core/Kconfig +@@ -16,7 +16,7 @@ config SND_DMAENGINE_PCM + tristate + + config SND_HWDEP +- tristate ++ tristate "Sound hardware support" + + config SND_SEQ_DEVICE + tristate +@@ -26,7 +26,7 @@ config SND_RAWMIDI + select SND_SEQ_DEVICE if SND_SEQUENCER != n + + config SND_COMPRESS_OFFLOAD +- tristate ++ tristate "Compression offloading support" + + config SND_JACK + bool diff --git a/target/linux/generic/hack-4.14/259-regmap_dynamic.patch b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch new file mode 100644 index 000000000..1c6e78df3 --- /dev/null +++ b/target/linux/generic/hack-4.14/259-regmap_dynamic.patch @@ -0,0 +1,109 @@ +From 811d9e2268a62b830cfe93cd8bc929afcb8b198b Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 21:12:38 +0200 +Subject: kernel: move regmap bloat out of the kernel image if it is only being used in modules + +lede-commit: 96f39119815028073583e4fca3a9c5fe9141e998 +Signed-off-by: Felix Fietkau +--- + drivers/base/regmap/Kconfig | 15 ++++++++++----- + drivers/base/regmap/Makefile | 12 ++++++++---- + drivers/base/regmap/regmap.c | 3 +++ + include/linux/regmap.h | 2 +- + 4 files changed, 22 insertions(+), 10 deletions(-) + +--- a/drivers/base/regmap/Kconfig ++++ b/drivers/base/regmap/Kconfig +@@ -4,9 +4,8 @@ + # subsystems should select the appropriate symbols. + + config REGMAP +- default y if (REGMAP_I2C || REGMAP_SPI || REGMAP_SPMI || REGMAP_W1 || REGMAP_AC97 || REGMAP_MMIO || REGMAP_IRQ) + select IRQ_DOMAIN if REGMAP_IRQ +- bool ++ tristate "Regmap" + + config REGCACHE_COMPRESSED + select LZO_COMPRESS +@@ -17,23 +16,30 @@ config REGMAP_AC97 + tristate + + config REGMAP_I2C +- tristate ++ tristate "Regmap I2C" ++ select REGMAP + depends on I2C + + config REGMAP_SPI +- tristate ++ tristate "Regmap SPI" ++ select REGMAP ++ depends on SPI_MASTER + depends on SPI + + config REGMAP_SPMI ++ select REGMAP + tristate + depends on SPMI + + config REGMAP_W1 ++ select REGMAP + tristate + depends on W1 + + config REGMAP_MMIO +- tristate ++ tristate "Regmap MMIO" ++ select REGMAP + + config REGMAP_IRQ ++ select REGMAP + bool +--- a/drivers/base/regmap/Makefile ++++ b/drivers/base/regmap/Makefile +@@ -2,10 +2,14 @@ + # For include/trace/define_trace.h to include trace.h + CFLAGS_regmap.o := -I$(src) + +-obj-$(CONFIG_REGMAP) += regmap.o regcache.o +-obj-$(CONFIG_REGMAP) += regcache-rbtree.o regcache-flat.o +-obj-$(CONFIG_REGCACHE_COMPRESSED) += regcache-lzo.o +-obj-$(CONFIG_DEBUG_FS) += regmap-debugfs.o ++regmap-core-objs = regmap.o regcache.o regcache-rbtree.o regcache-flat.o ++ifdef CONFIG_DEBUG_FS ++regmap-core-objs += regmap-debugfs.o ++endif ++ifdef CONFIG_REGCACHE_COMPRESSED ++regmap-core-objs += regcache-lzo.o ++endif ++obj-$(CONFIG_REGMAP) += regmap-core.o + obj-$(CONFIG_REGMAP_AC97) += regmap-ac97.o + obj-$(CONFIG_REGMAP_I2C) += regmap-i2c.o + obj-$(CONFIG_REGMAP_SPI) += regmap-spi.o +--- a/drivers/base/regmap/regmap.c ++++ b/drivers/base/regmap/regmap.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -2926,3 +2927,5 @@ static int __init regmap_initcall(void) + return 0; + } + postcore_initcall(regmap_initcall); ++ ++MODULE_LICENSE("GPL"); +--- a/include/linux/regmap.h ++++ b/include/linux/regmap.h +@@ -139,7 +139,7 @@ struct reg_sequence { + pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ + }) + +-#ifdef CONFIG_REGMAP ++#if IS_ENABLED(CONFIG_REGMAP) + + enum regmap_endian { + /* Unspecified -> 0 -> Backwards compatible default */ diff --git a/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch b/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch new file mode 100644 index 000000000..8523fc537 --- /dev/null +++ b/target/linux/generic/hack-4.14/260-crypto_test_dependencies.patch @@ -0,0 +1,60 @@ +From fd1799b0bf5efa46dd3e6dfbbf3955564807e508 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:12:51 +0200 +Subject: kernel: prevent cryptomgr from pulling in useless extra dependencies for tests that are not run + +Reduces kernel size after LZMA by about 5k on MIPS + +lede-commit: 044c316167e076479a344c59905e5b435b84a77f +Signed-off-by: Felix Fietkau +--- + crypto/Kconfig | 13 ++++++------- + crypto/algboss.c | 4 ++++ + 2 files changed, 10 insertions(+), 7 deletions(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -143,13 +143,13 @@ config CRYPTO_MANAGER + cbc(aes). + + config CRYPTO_MANAGER2 +- def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y) +- select CRYPTO_AEAD2 +- select CRYPTO_HASH2 +- select CRYPTO_BLKCIPHER2 +- select CRYPTO_AKCIPHER2 +- select CRYPTO_KPP2 +- select CRYPTO_ACOMP2 ++ def_tristate CRYPTO_MANAGER || (CRYPTO_MANAGER!=n && CRYPTO_ALGAPI=y && !CRYPTO_MANAGER_DISABLE_TESTS) ++ select CRYPTO_AEAD2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_HASH2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_BLKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_AKCIPHER2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_KPP2 if !CRYPTO_MANAGER_DISABLE_TESTS ++ select CRYPTO_ACOMP2 if !CRYPTO_MANAGER_DISABLE_TESTS + + config CRYPTO_USER + tristate "Userspace cryptographic algorithm configuration" +@@ -162,7 +162,6 @@ config CRYPTO_USER + config CRYPTO_MANAGER_DISABLE_TESTS + bool "Disable run-time self tests" + default y +- depends on CRYPTO_MANAGER2 + help + Disable run-time self tests that normally take place at + algorithm registration. +--- a/crypto/algboss.c ++++ b/crypto/algboss.c +@@ -248,8 +248,12 @@ static int cryptomgr_schedule_test(struc + type = alg->cra_flags; + + /* Do not test internal algorithms. */ ++#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS ++ type |= CRYPTO_ALG_TESTED; ++#else + if (type & CRYPTO_ALG_INTERNAL) + type |= CRYPTO_ALG_TESTED; ++#endif + + param->type = type; + diff --git a/target/linux/generic/hack-4.14/280-rfkill-stubs.patch b/target/linux/generic/hack-4.14/280-rfkill-stubs.patch new file mode 100644 index 000000000..85d01a6d1 --- /dev/null +++ b/target/linux/generic/hack-4.14/280-rfkill-stubs.patch @@ -0,0 +1,84 @@ +From 236c1acdfef5958010ac9814a9872e0a46fd78ee Mon Sep 17 00:00:00 2001 +From: John Crispin +Date: Fri, 7 Jul 2017 17:13:44 +0200 +Subject: rfkill: add fake rfkill support + +allow building of modules depending on RFKILL even if RFKILL is not enabled. + +Signed-off-by: John Crispin +--- + include/linux/rfkill.h | 2 +- + net/Makefile | 2 +- + net/rfkill/Kconfig | 14 +++++++++----- + net/rfkill/Makefile | 2 +- + 4 files changed, 12 insertions(+), 8 deletions(-) + +--- a/include/linux/rfkill.h ++++ b/include/linux/rfkill.h +@@ -64,7 +64,7 @@ struct rfkill_ops { + int (*set_block)(void *data, bool blocked); + }; + +-#if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) ++#if defined(CONFIG_RFKILL_FULL) || defined(CONFIG_RFKILL_FULL_MODULE) + /** + * rfkill_alloc - allocate rfkill structure + * @name: name of the struct -- the string is not copied internally +--- a/net/Makefile ++++ b/net/Makefile +@@ -53,7 +53,7 @@ obj-$(CONFIG_TIPC) += tipc/ + obj-$(CONFIG_NETLABEL) += netlabel/ + obj-$(CONFIG_IUCV) += iucv/ + obj-$(CONFIG_SMC) += smc/ +-obj-$(CONFIG_RFKILL) += rfkill/ ++obj-$(CONFIG_RFKILL_FULL) += rfkill/ + obj-$(CONFIG_NET_9P) += 9p/ + obj-$(CONFIG_CAIF) += caif/ + ifneq ($(CONFIG_DCB),) +--- a/net/rfkill/Kconfig ++++ b/net/rfkill/Kconfig +@@ -1,7 +1,11 @@ + # + # RF switch subsystem configuration + # +-menuconfig RFKILL ++config RFKILL ++ bool ++ default y ++ ++menuconfig RFKILL_FULL + tristate "RF switch subsystem support" + help + Say Y here if you want to have control over RF switches +@@ -13,19 +17,19 @@ menuconfig RFKILL + # LED trigger support + config RFKILL_LEDS + bool +- depends on RFKILL ++ depends on RFKILL_FULL + depends on LEDS_TRIGGERS = y || RFKILL = LEDS_TRIGGERS + default y + + config RFKILL_INPUT + bool "RF switch input support" if EXPERT +- depends on RFKILL ++ depends on RFKILL_FULL + depends on INPUT = y || RFKILL = INPUT + default y if !EXPERT + + config RFKILL_GPIO + tristate "GPIO RFKILL driver" +- depends on RFKILL ++ depends on RFKILL_FULL + depends on GPIOLIB || COMPILE_TEST + default n + help +--- a/net/rfkill/Makefile ++++ b/net/rfkill/Makefile +@@ -4,5 +4,5 @@ + + rfkill-y += core.o + rfkill-$(CONFIG_RFKILL_INPUT) += input.o +-obj-$(CONFIG_RFKILL) += rfkill.o ++obj-$(CONFIG_RFKILL_FULL) += rfkill.o + obj-$(CONFIG_RFKILL_GPIO) += rfkill-gpio.o diff --git a/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch new file mode 100644 index 000000000..01caff5b8 --- /dev/null +++ b/target/linux/generic/hack-4.14/301-mips_image_cmdline_hack.patch @@ -0,0 +1,38 @@ +From: John Crispin +Subject: hack: kernel: add generic image_cmdline hack to MIPS targets + +lede-commit: d59f5b3a987a48508257a0ddbaeadc7909f9f976 +Signed-off-by: Gabor Juhos +--- + arch/mips/Kconfig | 4 ++++ + arch/mips/kernel/head.S | 6 ++++++ + 2 files changed, 10 insertions(+) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -1157,6 +1157,10 @@ config SYNC_R4K + config MIPS_MACHINE + def_bool n + ++config IMAGE_CMDLINE_HACK ++ bool "OpenWrt specific image command line hack" ++ default n ++ + config NO_IOPORT_MAP + def_bool n + +--- a/arch/mips/kernel/head.S ++++ b/arch/mips/kernel/head.S +@@ -79,6 +79,12 @@ FEXPORT(__kernel_entry) + j kernel_entry + #endif + ++#ifdef CONFIG_IMAGE_CMDLINE_HACK ++ .ascii "CMDLINE:" ++EXPORT(__image_cmdline) ++ .fill 0x400 ++#endif /* CONFIG_IMAGE_CMDLINE_HACK */ ++ + __REF + + NESTED(kernel_entry, 16, sp) # kernel entry point diff --git a/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch b/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch new file mode 100644 index 000000000..3f81b2e05 --- /dev/null +++ b/target/linux/generic/hack-4.14/321-powerpc_crtsavres_prereq.patch @@ -0,0 +1,38 @@ +From 107c0964cb8db7ca28ac5199426414fdab3c274d Mon Sep 17 00:00:00 2001 +From: "Alexandros C. Couloumbis" +Date: Fri, 7 Jul 2017 17:14:51 +0200 +Subject: hack: arch: powerpc: drop register save/restore library from modules + +Upstream GCC uses a libgcc function for saving/restoring registers. This +makes the code bigger, and upstream kernels need to carry that function +for every single kernel module. Our GCC is patched to avoid those +references, so we can drop the extra bloat for modules. + +lede-commit: e8e1084654f50904e6bf77b70b2de3f137d7b3ec +Signed-off-by: Alexandros C. Couloumbis +--- + arch/powerpc/Makefile | 1 - + 1 file changed, 1 deletion(-) + +--- a/arch/powerpc/Makefile ++++ b/arch/powerpc/Makefile +@@ -59,19 +59,6 @@ machine-$(CONFIG_PPC64) += 64 + machine-$(CONFIG_CPU_LITTLE_ENDIAN) += le + UTS_MACHINE := $(subst $(space),,$(machine-y)) + +-# XXX This needs to be before we override LD below +-ifdef CONFIG_PPC32 +-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +-else +-ifeq ($(call ld-ifversion, -ge, 225000000, y),y) +-# Have the linker provide sfpr if possible. +-# There is a corresponding test in arch/powerpc/lib/Makefile +-KBUILD_LDFLAGS_MODULE += --save-restore-funcs +-else +-KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +-endif +-endif +- + ifeq ($(CONFIG_CPU_LITTLE_ENDIAN),y) + override LD += -EL + LDEMULATION := lppc diff --git a/target/linux/generic/hack-4.14/531-debloat_lzma.patch b/target/linux/generic/hack-4.14/531-debloat_lzma.patch new file mode 100644 index 000000000..2e453cc2f --- /dev/null +++ b/target/linux/generic/hack-4.14/531-debloat_lzma.patch @@ -0,0 +1,1040 @@ +From 3fd297761ac246c54d7723c57fca95c112b99465 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 15 Jul 2017 21:15:44 +0200 +Subject: lzma: de-bloat the lzma library used by jffs2 + +lede-commit: 3fd1dd08fbcbb78b34efefd32c3032e5c99108d6 +Signed-off-by: Felix Fietkau +--- + include/linux/lzma/LzFind.h | 17 --- + include/linux/lzma/LzmaDec.h | 101 --------------- + include/linux/lzma/LzmaEnc.h | 20 --- + lib/lzma/LzFind.c | 287 ++++--------------------------------------- + lib/lzma/LzmaDec.c | 86 +------------ + lib/lzma/LzmaEnc.c | 172 ++------------------------ + 6 files changed, 42 insertions(+), 641 deletions(-) + +--- a/include/linux/lzma/LzFind.h ++++ b/include/linux/lzma/LzFind.h +@@ -55,11 +55,6 @@ typedef struct _CMatchFinder + + #define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +-int MatchFinder_NeedMove(CMatchFinder *p); +-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +-void MatchFinder_MoveBlock(CMatchFinder *p); +-void MatchFinder_ReadIfRequired(CMatchFinder *p); +- + void MatchFinder_Construct(CMatchFinder *p); + + /* Conditions: +@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc); + void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); +-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); +-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); +- +-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, +- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, +- UInt32 *distances, UInt32 maxLen); + + /* + Conditions: +@@ -102,12 +91,6 @@ typedef struct _IMatchFinder + + void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +-void MatchFinder_Init(CMatchFinder *p); +-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +- + #ifdef __cplusplus + } + #endif +--- a/include/linux/lzma/LzmaDec.h ++++ b/include/linux/lzma/LzmaDec.h +@@ -31,14 +31,6 @@ typedef struct _CLzmaProps + UInt32 dicSize; + } CLzmaProps; + +-/* LzmaProps_Decode - decodes properties +-Returns: +- SZ_OK +- SZ_ERROR_UNSUPPORTED - Unsupported properties +-*/ +- +-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); +- + + /* ---------- LZMA Decoder state ---------- */ + +@@ -70,8 +62,6 @@ typedef struct + + #define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } + +-void LzmaDec_Init(CLzmaDec *p); +- + /* There are two types of LZMA streams: + 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. + 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ +@@ -108,97 +98,6 @@ typedef enum + + /* ELzmaStatus is used only as output value for function call */ + +- +-/* ---------- Interfaces ---------- */ +- +-/* There are 3 levels of interfaces: +- 1) Dictionary Interface +- 2) Buffer Interface +- 3) One Call Interface +- You can select any of these interfaces, but don't mix functions from different +- groups for same object. */ +- +- +-/* There are two variants to allocate state for Dictionary Interface: +- 1) LzmaDec_Allocate / LzmaDec_Free +- 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs +- You can use variant 2, if you set dictionary buffer manually. +- For Buffer Interface you must always use variant 1. +- +-LzmaDec_Allocate* can return: +- SZ_OK +- SZ_ERROR_MEM - Memory allocation error +- SZ_ERROR_UNSUPPORTED - Unsupported properties +-*/ +- +-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); +-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); +- +-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); +-void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); +- +-/* ---------- Dictionary Interface ---------- */ +- +-/* You can use it, if you want to eliminate the overhead for data copying from +- dictionary to some other external buffer. +- You must work with CLzmaDec variables directly in this interface. +- +- STEPS: +- LzmaDec_Constr() +- LzmaDec_Allocate() +- for (each new stream) +- { +- LzmaDec_Init() +- while (it needs more decompression) +- { +- LzmaDec_DecodeToDic() +- use data from CLzmaDec::dic and update CLzmaDec::dicPos +- } +- } +- LzmaDec_Free() +-*/ +- +-/* LzmaDec_DecodeToDic +- +- The decoding to internal dictionary buffer (CLzmaDec::dic). +- You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! +- +-finishMode: +- It has meaning only if the decoding reaches output limit (dicLimit). +- LZMA_FINISH_ANY - Decode just dicLimit bytes. +- LZMA_FINISH_END - Stream must be finished after dicLimit. +- +-Returns: +- SZ_OK +- status: +- LZMA_STATUS_FINISHED_WITH_MARK +- LZMA_STATUS_NOT_FINISHED +- LZMA_STATUS_NEEDS_MORE_INPUT +- LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK +- SZ_ERROR_DATA - Data error +-*/ +- +-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, +- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); +- +- +-/* ---------- Buffer Interface ---------- */ +- +-/* It's zlib-like interface. +- See LzmaDec_DecodeToDic description for information about STEPS and return results, +- but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need +- to work with CLzmaDec variables manually. +- +-finishMode: +- It has meaning only if the decoding reaches output limit (*destLen). +- LZMA_FINISH_ANY - Decode just destLen bytes. +- LZMA_FINISH_END - Stream must be finished after (*destLen). +-*/ +- +-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, +- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); +- +- + /* ---------- One Call Interface ---------- */ + + /* LzmaDecode +--- a/include/linux/lzma/LzmaEnc.h ++++ b/include/linux/lzma/LzmaEnc.h +@@ -31,9 +31,6 @@ typedef struct _CLzmaEncProps + } CLzmaEncProps; + + void LzmaEncProps_Init(CLzmaEncProps *p); +-void LzmaEncProps_Normalize(CLzmaEncProps *p); +-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); +- + + /* ---------- CLzmaEncHandle Interface ---------- */ + +@@ -53,26 +50,9 @@ CLzmaEncHandle LzmaEnc_Create(ISzAlloc * + void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); + SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); + SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +-SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +-/* ---------- One Call Interface ---------- */ +- +-/* LzmaEncode +-Return code: +- SZ_OK - OK +- SZ_ERROR_MEM - Memory allocation error +- SZ_ERROR_PARAM - Incorrect paramater +- SZ_ERROR_OUTPUT_EOF - output buffer overflow +- SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +-*/ +- +-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, +- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); +- + #ifdef __cplusplus + } + #endif +--- a/lib/lzma/LzFind.c ++++ b/lib/lzma/LzFind.c +@@ -14,9 +14,15 @@ + + #define kStartMaxLen 3 + ++#if 0 ++#define DIRECT_INPUT p->directInput ++#else ++#define DIRECT_INPUT 1 ++#endif ++ + static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) + { +- if (!p->directInput) ++ if (!DIRECT_INPUT) + { + alloc->Free(alloc, p->bufferBase); + p->bufferBase = 0; +@@ -28,7 +34,7 @@ static void LzInWindow_Free(CMatchFinder + static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) + { + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; +- if (p->directInput) ++ if (DIRECT_INPUT) + { + p->blockSize = blockSize; + return 1; +@@ -42,12 +48,12 @@ static int LzInWindow_Create(CMatchFinde + return (p->bufferBase != 0); + } + +-Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +-Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++static Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } ++static Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + +-UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++static UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +-void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) ++static void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) + { + p->posLimit -= subValue; + p->pos -= subValue; +@@ -58,7 +64,7 @@ static void MatchFinder_ReadBlock(CMatch + { + if (p->streamEndWasReached || p->result != SZ_OK) + return; +- if (p->directInput) ++ if (DIRECT_INPUT) + { + UInt32 curSize = 0xFFFFFFFF - p->streamPos; + if (curSize > p->directInputRem) +@@ -89,7 +95,7 @@ static void MatchFinder_ReadBlock(CMatch + } + } + +-void MatchFinder_MoveBlock(CMatchFinder *p) ++static void MatchFinder_MoveBlock(CMatchFinder *p) + { + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, +@@ -97,22 +103,14 @@ void MatchFinder_MoveBlock(CMatchFinder + p->buffer = p->bufferBase + p->keepSizeBefore; + } + +-int MatchFinder_NeedMove(CMatchFinder *p) ++static int MatchFinder_NeedMove(CMatchFinder *p) + { +- if (p->directInput) ++ if (DIRECT_INPUT) + return 0; + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); + } + +-void MatchFinder_ReadIfRequired(CMatchFinder *p) +-{ +- if (p->streamEndWasReached) +- return; +- if (p->keepSizeAfter >= p->streamPos - p->pos) +- MatchFinder_ReadBlock(p); +-} +- + static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) + { + if (MatchFinder_NeedMove(p)) +@@ -268,7 +266,7 @@ static void MatchFinder_SetLimits(CMatch + p->posLimit = p->pos + limit; + } + +-void MatchFinder_Init(CMatchFinder *p) ++static void MatchFinder_Init(CMatchFinder *p) + { + UInt32 i; + for (i = 0; i < p->hashSizeSum; i++) +@@ -287,7 +285,7 @@ static UInt32 MatchFinder_GetSubValue(CM + return (p->pos - p->historySize - 1) & kNormalizeMask; + } + +-void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) ++static void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) + { + UInt32 i; + for (i = 0; i < numItems; i++) +@@ -319,38 +317,7 @@ static void MatchFinder_CheckLimits(CMat + MatchFinder_SetLimits(p); + } + +-static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, +- UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, +- UInt32 *distances, UInt32 maxLen) +-{ +- son[_cyclicBufferPos] = curMatch; +- for (;;) +- { +- UInt32 delta = pos - curMatch; +- if (cutValue-- == 0 || delta >= _cyclicBufferSize) +- return distances; +- { +- const Byte *pb = cur - delta; +- curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; +- if (pb[maxLen] == cur[maxLen] && *pb == *cur) +- { +- UInt32 len = 0; +- while (++len != lenLimit) +- if (pb[len] != cur[len]) +- break; +- if (maxLen < len) +- { +- *distances++ = maxLen = len; +- *distances++ = delta - 1; +- if (len == lenLimit) +- return distances; +- } +- } +- } +- } +-} +- +-UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++static UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) + { +@@ -460,10 +427,10 @@ static void SkipMatchesSpec(UInt32 lenLi + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +-#define MOVE_POS_RET MOVE_POS return offset; +- + static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + ++#define MOVE_POS_RET MatchFinder_MovePos(p); return offset; ++ + #define GET_MATCHES_HEADER2(minLen, ret_op) \ + UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ + lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ +@@ -479,62 +446,7 @@ static void MatchFinder_MovePos(CMatchFi + distances + offset, maxLen) - distances); MOVE_POS_RET; + + #define SKIP_FOOTER \ +- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; +- +-static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(2) +- HASH2_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = 0; +- GET_MATCHES_FOOTER(offset, 1) +-} +- +-UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = 0; +- GET_MATCHES_FOOTER(offset, 2) +-} +- +-static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 hash2Value, delta2, maxLen, offset; +- GET_MATCHES_HEADER(3) +- +- HASH3_CALC; +- +- delta2 = p->pos - p->hash[hash2Value]; +- curMatch = p->hash[kFix3HashSize + hashValue]; +- +- p->hash[hash2Value] = +- p->hash[kFix3HashSize + hashValue] = p->pos; +- +- +- maxLen = 2; +- offset = 0; +- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) +- { +- for (; maxLen != lenLimit; maxLen++) +- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) +- break; +- distances[0] = maxLen; +- distances[1] = delta2 - 1; +- offset = 2; +- if (maxLen == lenLimit) +- { +- SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); +- MOVE_POS_RET; +- } +- } +- GET_MATCHES_FOOTER(offset, maxLen) +-} ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MatchFinder_MovePos(p); + + static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) + { +@@ -583,108 +495,6 @@ static UInt32 Bt4_MatchFinder_GetMatches + GET_MATCHES_FOOTER(offset, maxLen) + } + +-static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; +- GET_MATCHES_HEADER(4) +- +- HASH4_CALC; +- +- delta2 = p->pos - p->hash[ hash2Value]; +- delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; +- curMatch = p->hash[kFix4HashSize + hashValue]; +- +- p->hash[ hash2Value] = +- p->hash[kFix3HashSize + hash3Value] = +- p->hash[kFix4HashSize + hashValue] = p->pos; +- +- maxLen = 1; +- offset = 0; +- if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) +- { +- distances[0] = maxLen = 2; +- distances[1] = delta2 - 1; +- offset = 2; +- } +- if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) +- { +- maxLen = 3; +- distances[offset + 1] = delta3 - 1; +- offset += 2; +- delta2 = delta3; +- } +- if (offset != 0) +- { +- for (; maxLen != lenLimit; maxLen++) +- if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) +- break; +- distances[offset - 2] = maxLen; +- if (maxLen == lenLimit) +- { +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS_RET; +- } +- } +- if (maxLen < 3) +- maxLen = 3; +- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), +- distances + offset, maxLen) - (distances)); +- MOVE_POS_RET +-} +- +-UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +-{ +- UInt32 offset; +- GET_MATCHES_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), +- distances, 2) - (distances)); +- MOVE_POS_RET +-} +- +-static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(2) +- HASH2_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- +-void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- +-static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- UInt32 hash2Value; +- SKIP_HEADER(3) +- HASH3_CALC; +- curMatch = p->hash[kFix3HashSize + hashValue]; +- p->hash[hash2Value] = +- p->hash[kFix3HashSize + hashValue] = p->pos; +- SKIP_FOOTER +- } +- while (--num != 0); +-} +- + static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) + { + do +@@ -701,61 +511,12 @@ static void Bt4_MatchFinder_Skip(CMatchF + while (--num != 0); + } + +-static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- UInt32 hash2Value, hash3Value; +- SKIP_HEADER(4) +- HASH4_CALC; +- curMatch = p->hash[kFix4HashSize + hashValue]; +- p->hash[ hash2Value] = +- p->hash[kFix3HashSize + hash3Value] = +- p->hash[kFix4HashSize + hashValue] = p->pos; +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS +- } +- while (--num != 0); +-} +- +-void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +-{ +- do +- { +- SKIP_HEADER(3) +- HASH_ZIP_CALC; +- curMatch = p->hash[hashValue]; +- p->hash[hashValue] = p->pos; +- p->son[p->cyclicBufferPos] = curMatch; +- MOVE_POS +- } +- while (--num != 0); +-} +- + void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) + { + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; +- if (!p->btMode) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; +- } +- else if (p->numHashBytes == 2) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; +- } +- else if (p->numHashBytes == 3) +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; +- } +- else +- { +- vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; +- vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; +- } ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } +--- a/lib/lzma/LzmaDec.c ++++ b/lib/lzma/LzmaDec.c +@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p, + p->needFlush = 0; + } + +-void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++static void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) + { + p->needFlush = 1; + p->remainLen = 0; +@@ -698,7 +698,7 @@ void LzmaDec_InitDicAndState(CLzmaDec *p + p->needInitState = 1; + } + +-void LzmaDec_Init(CLzmaDec *p) ++static void LzmaDec_Init(CLzmaDec *p) + { + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +@@ -716,7 +716,7 @@ static void LzmaDec_InitStateReal(CLzmaD + p->needInitState = 0; + } + +-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++static SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) + { + SizeT inSize = *srcLen; +@@ -837,65 +837,13 @@ SRes LzmaDec_DecodeToDic(CLzmaDec *p, Si + return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; + } + +-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +-{ +- SizeT outSize = *destLen; +- SizeT inSize = *srcLen; +- *srcLen = *destLen = 0; +- for (;;) +- { +- SizeT inSizeCur = inSize, outSizeCur, dicPos; +- ELzmaFinishMode curFinishMode; +- SRes res; +- if (p->dicPos == p->dicBufSize) +- p->dicPos = 0; +- dicPos = p->dicPos; +- if (outSize > p->dicBufSize - dicPos) +- { +- outSizeCur = p->dicBufSize; +- curFinishMode = LZMA_FINISH_ANY; +- } +- else +- { +- outSizeCur = dicPos + outSize; +- curFinishMode = finishMode; +- } +- +- res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); +- src += inSizeCur; +- inSize -= inSizeCur; +- *srcLen += inSizeCur; +- outSizeCur = p->dicPos - dicPos; +- memcpy(dest, p->dic + dicPos, outSizeCur); +- dest += outSizeCur; +- outSize -= outSizeCur; +- *destLen += outSizeCur; +- if (res != 0) +- return res; +- if (outSizeCur == 0 || outSize == 0) +- return SZ_OK; +- } +-} +- +-void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) ++static void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) + { + alloc->Free(alloc, p->probs); + p->probs = 0; + } + +-static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) +-{ +- alloc->Free(alloc, p->dic); +- p->dic = 0; +-} +- +-void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) +-{ +- LzmaDec_FreeProbs(p, alloc); +- LzmaDec_FreeDict(p, alloc); +-} +- +-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) ++static SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) + { + UInt32 dicSize; + Byte d; +@@ -935,7 +883,7 @@ static SRes LzmaDec_AllocateProbs2(CLzma + return SZ_OK; + } + +-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++static SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) + { + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); +@@ -943,28 +891,6 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p, + p->prop = propNew; + return SZ_OK; + } +- +-SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +-{ +- CLzmaProps propNew; +- SizeT dicBufSize; +- RINOK(LzmaProps_Decode(&propNew, props, propsSize)); +- RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); +- dicBufSize = propNew.dicSize; +- if (p->dic == 0 || dicBufSize != p->dicBufSize) +- { +- LzmaDec_FreeDict(p, alloc); +- p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); +- if (p->dic == 0) +- { +- LzmaDec_FreeProbs(p, alloc); +- return SZ_ERROR_MEM; +- } +- } +- p->dicBufSize = dicBufSize; +- p->prop = propNew; +- return SZ_OK; +-} + + SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, +--- a/lib/lzma/LzmaEnc.c ++++ b/lib/lzma/LzmaEnc.c +@@ -53,7 +53,7 @@ void LzmaEncProps_Init(CLzmaEncProps *p) + p->writeEndMark = 0; + } + +-void LzmaEncProps_Normalize(CLzmaEncProps *p) ++static void LzmaEncProps_Normalize(CLzmaEncProps *p) + { + int level = p->level; + if (level < 0) level = 5; +@@ -76,7 +76,7 @@ void LzmaEncProps_Normalize(CLzmaEncProp + #endif + } + +-UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) ++static UInt32 __maybe_unused LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) + { + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); +@@ -93,7 +93,7 @@ UInt32 LzmaEncProps_GetDictSize(const CL + + #define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } + +-UInt32 GetPosSlot1(UInt32 pos) ++static UInt32 GetPosSlot1(UInt32 pos) + { + UInt32 res; + BSR2_RET(pos, res); +@@ -107,7 +107,7 @@ UInt32 GetPosSlot1(UInt32 pos) + #define kNumLogBits (9 + (int)sizeof(size_t) / 2) + #define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +-void LzmaEnc_FastPosInit(Byte *g_FastPos) ++static void LzmaEnc_FastPosInit(Byte *g_FastPos) + { + int c = 2, slotFast; + g_FastPos[0] = 0; +@@ -339,58 +339,6 @@ typedef struct + CSaveState saveState; + } CLzmaEnc; + +-void LzmaEnc_SaveState(CLzmaEncHandle pp) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- CSaveState *dest = &p->saveState; +- int i; +- dest->lenEnc = p->lenEnc; +- dest->repLenEnc = p->repLenEnc; +- dest->state = p->state; +- +- for (i = 0; i < kNumStates; i++) +- { +- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); +- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); +- } +- for (i = 0; i < kNumLenToPosStates; i++) +- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); +- memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); +- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); +- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); +- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); +- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); +- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); +- memcpy(dest->reps, p->reps, sizeof(p->reps)); +- memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +-} +- +-void LzmaEnc_RestoreState(CLzmaEncHandle pp) +-{ +- CLzmaEnc *dest = (CLzmaEnc *)pp; +- const CSaveState *p = &dest->saveState; +- int i; +- dest->lenEnc = p->lenEnc; +- dest->repLenEnc = p->repLenEnc; +- dest->state = p->state; +- +- for (i = 0; i < kNumStates; i++) +- { +- memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); +- memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); +- } +- for (i = 0; i < kNumLenToPosStates; i++) +- memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); +- memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); +- memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); +- memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); +- memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); +- memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); +- memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); +- memcpy(dest->reps, p->reps, sizeof(p->reps)); +- memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); +-} +- + SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -600,7 +548,7 @@ static void LitEnc_EncodeMatched(CRangeE + while (symbol < 0x10000); + } + +-void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++static void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) + { + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) +@@ -1676,7 +1624,7 @@ static void FillDistancesPrices(CLzmaEnc + p->matchPriceCount = 0; + } + +-void LzmaEnc_Construct(CLzmaEnc *p) ++static void LzmaEnc_Construct(CLzmaEnc *p) + { + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); +@@ -1709,7 +1657,7 @@ CLzmaEncHandle LzmaEnc_Create(ISzAlloc * + return p; + } + +-void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++static void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) + { + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); +@@ -1717,7 +1665,7 @@ void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAl + p->saveState.litProbs = 0; + } + +-void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++static void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) + { + #ifndef _7ZIP_ST + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); +@@ -1947,7 +1895,7 @@ static SRes LzmaEnc_Alloc(CLzmaEnc *p, U + return SZ_OK; + } + +-void LzmaEnc_Init(CLzmaEnc *p) ++static void LzmaEnc_Init(CLzmaEnc *p) + { + UInt32 i; + p->state = 0; +@@ -2005,7 +1953,7 @@ void LzmaEnc_Init(CLzmaEnc *p) + p->lpMask = (1 << p->lp) - 1; + } + +-void LzmaEnc_InitPrices(CLzmaEnc *p) ++static void LzmaEnc_InitPrices(CLzmaEnc *p) + { + if (!p->fastMode) + { +@@ -2037,26 +1985,6 @@ static SRes LzmaEnc_AllocAndInit(CLzmaEn + return SZ_OK; + } + +-static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- p->matchFinderBase.stream = inStream; +- p->needInit = 1; +- p->rc.outStream = outStream; +- return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +-} +- +-SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, +- ISeqInStream *inStream, UInt32 keepWindowSize, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- p->matchFinderBase.stream = inStream; +- p->needInit = 1; +- return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +-} +- + static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) + { + p->matchFinderBase.directInput = 1; +@@ -2064,7 +1992,7 @@ static void LzmaEnc_SetInputBuf(CLzmaEnc + p->matchFinderBase.directInputRem = srcLen; + } + +-SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++static SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2074,7 +2002,7 @@ SRes LzmaEnc_MemPrepare(CLzmaEncHandle p + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); + } + +-void LzmaEnc_Finish(CLzmaEncHandle pp) ++static void LzmaEnc_Finish(CLzmaEncHandle pp) + { + #ifndef _7ZIP_ST + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2107,53 +2035,6 @@ static size_t MyWrite(void *pp, const vo + return size; + } + +- +-UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +-{ +- const CLzmaEnc *p = (CLzmaEnc *)pp; +- return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +-} +- +-const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +-{ +- const CLzmaEnc *p = (CLzmaEnc *)pp; +- return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +-} +- +-SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, +- Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +-{ +- CLzmaEnc *p = (CLzmaEnc *)pp; +- UInt64 nowPos64; +- SRes res; +- CSeqOutStreamBuf outStream; +- +- outStream.funcTable.Write = MyWrite; +- outStream.data = dest; +- outStream.rem = *destLen; +- outStream.overflow = False; +- +- p->writeEndMark = False; +- p->finished = False; +- p->result = SZ_OK; +- +- if (reInit) +- LzmaEnc_Init(p); +- LzmaEnc_InitPrices(p); +- nowPos64 = p->nowPos64; +- RangeEnc_Init(&p->rc); +- p->rc.outStream = &outStream.funcTable; +- +- res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); +- +- *unpackSize = (UInt32)(p->nowPos64 - nowPos64); +- *destLen -= outStream.rem; +- if (outStream.overflow) +- return SZ_ERROR_OUTPUT_EOF; +- +- return res; +-} +- + static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) + { + SRes res = SZ_OK; +@@ -2184,13 +2065,6 @@ static SRes LzmaEnc_Encode2(CLzmaEnc *p, + return res; + } + +-SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, +- ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); +- return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); +-} +- + SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) + { + CLzmaEnc *p = (CLzmaEnc *)pp; +@@ -2247,25 +2121,3 @@ SRes LzmaEnc_MemEncode(CLzmaEncHandle pp + return SZ_ERROR_OUTPUT_EOF; + return res; + } +- +-SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, +- const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, +- ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +-{ +- CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); +- SRes res; +- if (p == 0) +- return SZ_ERROR_MEM; +- +- res = LzmaEnc_SetProps(p, props); +- if (res == SZ_OK) +- { +- res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); +- if (res == SZ_OK) +- res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, +- writeEndMark, progress, alloc, allocBig); +- } +- +- LzmaEnc_Destroy(p, alloc, allocBig); +- return res; +-} diff --git a/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch new file mode 100644 index 000000000..83c9cf739 --- /dev/null +++ b/target/linux/generic/hack-4.14/640-bridge-only-accept-EAP-locally.patch @@ -0,0 +1,32 @@ +From c6905cfdeb31a5c049db3da434b10fa0d3e83569 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:18:54 +0200 +Subject: bridge: only accept EAP locally + +When bridging, do not forward EAP frames to other ports, only deliver +them locally, regardless of the state. + +Signed-off-by: Felix Fietkau +--- + net/bridge/br_input.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -166,11 +166,14 @@ int br_handle_frame_finish(struct net *n + } + } + ++ BR_INPUT_SKB_CB(skb)->brdev = br->dev; ++ ++ if (skb->protocol == htons(ETH_P_PAE)) ++ return br_pass_frame_up(skb); ++ + if (p->state == BR_STATE_LEARNING) + goto drop; + +- BR_INPUT_SKB_CB(skb)->brdev = br->dev; +- + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); + diff --git a/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch new file mode 100644 index 000000000..ab9f47657 --- /dev/null +++ b/target/linux/generic/hack-4.14/641-bridge_port_isolate.patch @@ -0,0 +1,76 @@ +From e988390850731aa1697ed09d47b0932fac1af175 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:20:03 +0200 +Subject: bridge: port isolate + +Isolating individual bridge ports + +Signed-off-by: Felix Fietkau +--- + include/linux/if_bridge.h | 1 + + net/bridge/br_forward.c | 5 +++++ + net/bridge/br_input.c | 3 +++ + net/bridge/br_sysfs_if.c | 2 ++ + 4 files changed, 11 insertions(+) + +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -49,6 +49,7 @@ struct br_ip_list { + #define BR_MULTICAST_TO_UNICAST BIT(12) + #define BR_VLAN_TUNNEL BIT(13) + #define BR_BCAST_FLOOD BIT(14) ++#define BR_ISOLATE_MODE BIT(15) + + #define BR_DEFAULT_AGEING_TIME (300 * HZ) + +--- a/net/bridge/br_forward.c ++++ b/net/bridge/br_forward.c +@@ -141,6 +141,9 @@ static int deliver_clone(const struct ne + void br_forward(const struct net_bridge_port *to, + struct sk_buff *skb, bool local_rcv, bool local_orig) + { ++ if (to->flags & BR_ISOLATE_MODE) ++ to = NULL; ++ + if (to && should_deliver(to, skb)) { + if (local_rcv) + deliver_clone(to, skb, local_orig); +@@ -183,6 +186,8 @@ void br_flood(struct net_bridge *br, str + struct net_bridge_port *p; + + list_for_each_entry_rcu(p, &br->port_list, list) { ++ if (!local_orig && (p->flags & BR_ISOLATE_MODE)) ++ continue; + /* Do not flood unicast traffic to ports that turn it off, nor + * other traffic if flood off, except for traffic we originate + */ +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -177,6 +177,9 @@ int br_handle_frame_finish(struct net *n + if (IS_ENABLED(CONFIG_INET) && skb->protocol == htons(ETH_P_ARP)) + br_do_proxy_arp(skb, br, vid, p); + ++ if (p->flags & BR_ISOLATE_MODE) ++ return br_pass_frame_up(skb); ++ + switch (pkt_type) { + case BR_PKT_MULTICAST: + mdst = br_mdb_get(br, skb, vid); +--- a/net/bridge/br_sysfs_if.c ++++ b/net/bridge/br_sysfs_if.c +@@ -174,6 +174,7 @@ BRPORT_ATTR_FLAG(proxyarp, BR_PROXYARP); + BRPORT_ATTR_FLAG(proxyarp_wifi, BR_PROXYARP_WIFI); + BRPORT_ATTR_FLAG(multicast_flood, BR_MCAST_FLOOD); + BRPORT_ATTR_FLAG(broadcast_flood, BR_BCAST_FLOOD); ++BRPORT_ATTR_FLAG(isolate_mode, BR_ISOLATE_MODE); + + #ifdef CONFIG_BRIDGE_IGMP_SNOOPING + static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) +@@ -223,6 +224,7 @@ static const struct brport_attribute *br + &brport_attr_proxyarp_wifi, + &brport_attr_multicast_flood, + &brport_attr_broadcast_flood, ++ &brport_attr_isolate_mode, + NULL + }; + diff --git a/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch b/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch new file mode 100644 index 000000000..f545d8ebb --- /dev/null +++ b/target/linux/generic/hack-4.14/651-wireless_mesh_header.patch @@ -0,0 +1,24 @@ +From 6d3bc769657b0ee7c7506dad9911111c4226a7ea Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Fri, 7 Jul 2017 17:21:05 +0200 +Subject: mac80211: increase wireless mesh header size + +lede-commit 3d4466cfd8f75f717efdb1f96fdde3c70d865fc1 +Signed-off-by: Imre Kaloz +--- + include/linux/netdevice.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -138,8 +138,8 @@ static inline bool dev_xmit_complete(int + + #if defined(CONFIG_HYPERV_NET) + # define LL_MAX_HEADER 128 +-#elif defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) +-# if defined(CONFIG_MAC80211_MESH) ++#elif defined(CONFIG_WLAN) || IS_ENABLED(CONFIG_AX25) || 1 ++# if defined(CONFIG_MAC80211_MESH) || 1 + # define LL_MAX_HEADER 128 + # else + # define LL_MAX_HEADER 96 diff --git a/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch b/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch new file mode 100644 index 000000000..3e27351fa --- /dev/null +++ b/target/linux/generic/hack-4.14/660-fq_codel_defaults.patch @@ -0,0 +1,27 @@ +From a6ccb238939b25851474a279b20367fd24a0e816 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:21:53 +0200 +Subject: hack: net: fq_codel: tune defaults for small devices + +Assume that x86_64 devices always have a big memory and do not need this +optimization compared to devices with only 32 MB or 64 MB RAM. + +Signed-off-by: Felix Fietkau +--- + net/sched/sch_fq_codel.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/sched/sch_fq_codel.c ++++ b/net/sched/sch_fq_codel.c +@@ -465,7 +465,11 @@ static int fq_codel_init(struct Qdisc *s + + sch->limit = 10*1024; + q->flows_cnt = 1024; ++#ifdef CONFIG_X86_64 + q->memory_limit = 32 << 20; /* 32 MBytes */ ++#else ++ q->memory_limit = 4 << 20; /* 4 MBytes */ ++#endif + q->drop_batch_size = 64; + q->quantum = psched_mtu(qdisc_dev(sch)); + INIT_LIST_HEAD(&q->new_flows); diff --git a/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch new file mode 100644 index 000000000..ae911db87 --- /dev/null +++ b/target/linux/generic/hack-4.14/661-use_fq_codel_by_default.patch @@ -0,0 +1,94 @@ +From 1d418f7e88035ed7a94073f6354246c66e9193e9 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:22:58 +0200 +Subject: fq_codel: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast + +Signed-off-by: Felix Fietkau +--- + include/net/sch_generic.h | 3 ++- + net/sched/Kconfig | 3 ++- + net/sched/sch_api.c | 2 +- + net/sched/sch_fq_codel.c | 3 ++- + net/sched/sch_generic.c | 4 ++-- + 5 files changed, 9 insertions(+), 6 deletions(-) + +--- a/include/net/sch_generic.h ++++ b/include/net/sch_generic.h +@@ -369,12 +369,13 @@ extern struct Qdisc_ops noop_qdisc_ops; + extern struct Qdisc_ops pfifo_fast_ops; + extern struct Qdisc_ops mq_qdisc_ops; + extern struct Qdisc_ops noqueue_qdisc_ops; ++extern struct Qdisc_ops fq_codel_qdisc_ops; + extern const struct Qdisc_ops *default_qdisc_ops; + static inline const struct Qdisc_ops * + get_default_qdisc_ops(const struct net_device *dev, int ntx) + { + return ntx < dev->real_num_tx_queues ? +- default_qdisc_ops : &pfifo_fast_ops; ++ default_qdisc_ops : &fq_codel_qdisc_ops; + } + + struct Qdisc_class_common { +--- a/net/sched/Kconfig ++++ b/net/sched/Kconfig +@@ -3,8 +3,9 @@ + # + + menuconfig NET_SCHED +- bool "QoS and/or fair queueing" ++ def_bool y + select NET_SCH_FIFO ++ select NET_SCH_FQ_CODEL + ---help--- + When the kernel has several packets to send out over a network + device, it has to decide which ones to send first, which ones to +--- a/net/sched/sch_api.c ++++ b/net/sched/sch_api.c +@@ -2014,7 +2014,7 @@ static int __init pktsched_init(void) + return err; + } + +- register_qdisc(&pfifo_fast_ops); ++ register_qdisc(&fq_codel_qdisc_ops); + register_qdisc(&pfifo_qdisc_ops); + register_qdisc(&bfifo_qdisc_ops); + register_qdisc(&pfifo_head_drop_qdisc_ops); +--- a/net/sched/sch_fq_codel.c ++++ b/net/sched/sch_fq_codel.c +@@ -694,7 +694,7 @@ static const struct Qdisc_class_ops fq_c + .walk = fq_codel_walk, + }; + +-static struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = { ++struct Qdisc_ops fq_codel_qdisc_ops __read_mostly = { + .cl_ops = &fq_codel_class_ops, + .id = "fq_codel", + .priv_size = sizeof(struct fq_codel_sched_data), +@@ -709,6 +709,7 @@ static struct Qdisc_ops fq_codel_qdisc_o + .dump_stats = fq_codel_dump_stats, + .owner = THIS_MODULE, + }; ++EXPORT_SYMBOL(fq_codel_qdisc_ops); + + static int __init fq_codel_module_init(void) + { +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -32,7 +32,7 @@ + #include + + /* Qdisc to use by default */ +-const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops; ++const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops; + EXPORT_SYMBOL(default_qdisc_ops); + + /* Main transmission queue. */ +@@ -764,7 +764,7 @@ static void attach_one_default_qdisc(str + void *_unused) + { + struct Qdisc *qdisc; +- const struct Qdisc_ops *ops = default_qdisc_ops; ++ const struct Qdisc_ops *ops = &fq_codel_qdisc_ops; + + if (dev->priv_flags & IFF_NO_QUEUE) + ops = &noqueue_qdisc_ops; diff --git a/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch b/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch new file mode 100644 index 000000000..7b6e38da2 --- /dev/null +++ b/target/linux/generic/hack-4.14/662-remove_pfifo_fast.patch @@ -0,0 +1,159 @@ +From b531d492d5ef1cf9dba0f4888eb5fd8624a6d762 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:23:42 +0200 +Subject: net: sched: switch default qdisc from pfifo_fast to fq_codel and remove pfifo_fast + +Signed-off-by: Felix Fietkau +--- + net/sched/sch_generic.c | 140 ------------------------------------------------ + 1 file changed, 140 deletions(-) + +--- a/net/sched/sch_generic.c ++++ b/net/sched/sch_generic.c +@@ -453,146 +453,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea + .owner = THIS_MODULE, + }; + +-static const u8 prio2band[TC_PRIO_MAX + 1] = { +- 1, 2, 2, 2, 1, 2, 0, 0 , 1, 1, 1, 1, 1, 1, 1, 1 +-}; +- +-/* 3-band FIFO queue: old style, but should be a bit faster than +- generic prio+fifo combination. +- */ +- +-#define PFIFO_FAST_BANDS 3 +- +-/* +- * Private data for a pfifo_fast scheduler containing: +- * - queues for the three band +- * - bitmap indicating which of the bands contain skbs +- */ +-struct pfifo_fast_priv { +- u32 bitmap; +- struct qdisc_skb_head q[PFIFO_FAST_BANDS]; +-}; +- +-/* +- * Convert a bitmap to the first band number where an skb is queued, where: +- * bitmap=0 means there are no skbs on any band. +- * bitmap=1 means there is an skb on band 0. +- * bitmap=7 means there are skbs on all 3 bands, etc. +- */ +-static const int bitmap2band[] = {-1, 0, 1, 0, 2, 0, 1, 0}; +- +-static inline struct qdisc_skb_head *band2list(struct pfifo_fast_priv *priv, +- int band) +-{ +- return priv->q + band; +-} +- +-static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc, +- struct sk_buff **to_free) +-{ +- if (qdisc->q.qlen < qdisc_dev(qdisc)->tx_queue_len) { +- int band = prio2band[skb->priority & TC_PRIO_MAX]; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- struct qdisc_skb_head *list = band2list(priv, band); +- +- priv->bitmap |= (1 << band); +- qdisc->q.qlen++; +- return __qdisc_enqueue_tail(skb, qdisc, list); +- } +- +- return qdisc_drop(skb, qdisc, to_free); +-} +- +-static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) +-{ +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- int band = bitmap2band[priv->bitmap]; +- +- if (likely(band >= 0)) { +- struct qdisc_skb_head *qh = band2list(priv, band); +- struct sk_buff *skb = __qdisc_dequeue_head(qh); +- +- if (likely(skb != NULL)) { +- qdisc_qstats_backlog_dec(qdisc, skb); +- qdisc_bstats_update(qdisc, skb); +- } +- +- qdisc->q.qlen--; +- if (qh->qlen == 0) +- priv->bitmap &= ~(1 << band); +- +- return skb; +- } +- +- return NULL; +-} +- +-static struct sk_buff *pfifo_fast_peek(struct Qdisc *qdisc) +-{ +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- int band = bitmap2band[priv->bitmap]; +- +- if (band >= 0) { +- struct qdisc_skb_head *qh = band2list(priv, band); +- +- return qh->head; +- } +- +- return NULL; +-} +- +-static void pfifo_fast_reset(struct Qdisc *qdisc) +-{ +- int prio; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- +- for (prio = 0; prio < PFIFO_FAST_BANDS; prio++) +- __qdisc_reset_queue(band2list(priv, prio)); +- +- priv->bitmap = 0; +- qdisc->qstats.backlog = 0; +- qdisc->q.qlen = 0; +-} +- +-static int pfifo_fast_dump(struct Qdisc *qdisc, struct sk_buff *skb) +-{ +- struct tc_prio_qopt opt = { .bands = PFIFO_FAST_BANDS }; +- +- memcpy(&opt.priomap, prio2band, TC_PRIO_MAX + 1); +- if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt)) +- goto nla_put_failure; +- return skb->len; +- +-nla_put_failure: +- return -1; +-} +- +-static int pfifo_fast_init(struct Qdisc *qdisc, struct nlattr *opt) +-{ +- int prio; +- struct pfifo_fast_priv *priv = qdisc_priv(qdisc); +- +- for (prio = 0; prio < PFIFO_FAST_BANDS; prio++) +- qdisc_skb_head_init(band2list(priv, prio)); +- +- /* Can by-pass the queue discipline */ +- qdisc->flags |= TCQ_F_CAN_BYPASS; +- return 0; +-} +- +-struct Qdisc_ops pfifo_fast_ops __read_mostly = { +- .id = "pfifo_fast", +- .priv_size = sizeof(struct pfifo_fast_priv), +- .enqueue = pfifo_fast_enqueue, +- .dequeue = pfifo_fast_dequeue, +- .peek = pfifo_fast_peek, +- .init = pfifo_fast_init, +- .reset = pfifo_fast_reset, +- .dump = pfifo_fast_dump, +- .owner = THIS_MODULE, +-}; +-EXPORT_SYMBOL(pfifo_fast_ops); +- + static struct lock_class_key qdisc_tx_busylock; + static struct lock_class_key qdisc_running_key; + diff --git a/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch b/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch new file mode 100644 index 000000000..0ec197fbb --- /dev/null +++ b/target/linux/generic/hack-4.14/700-swconfig_switch_drivers.patch @@ -0,0 +1,128 @@ +From 36e516290611e613aa92996cb4339561452695b4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:24:23 +0200 +Subject: net: swconfig: adds openwrt switch layer + +Signed-off-by: Felix Fietkau +--- + drivers/net/phy/Kconfig | 83 +++++++++++++++++++++++++++++++++++++++++++++++ + drivers/net/phy/Makefile | 15 +++++++++ + include/uapi/linux/Kbuild | 1 + + 3 files changed, 99 insertions(+) + +--- a/drivers/net/phy/Kconfig ++++ b/drivers/net/phy/Kconfig +@@ -198,6 +198,89 @@ config LED_TRIGGER_PHY + Mbps or Gbps + + ++comment "Switch configuration API + drivers" ++ ++config SWCONFIG ++ tristate "Switch configuration API" ++ ---help--- ++ Switch configuration API using netlink. This allows ++ you to configure the VLAN features of certain switches. ++ ++config SWCONFIG_LEDS ++ bool "Switch LED trigger support" ++ depends on (SWCONFIG && LEDS_TRIGGERS) ++ ++config ADM6996_PHY ++ tristate "Driver for ADM6996 switches" ++ select SWCONFIG ++ ---help--- ++ Currently supports the ADM6996FC and ADM6996M switches. ++ Support for FC is very limited. ++ ++config AR8216_PHY ++ tristate "Driver for Atheros AR8216 switches" ++ select ETHERNET_PACKET_MANGLE ++ select SWCONFIG ++ ++config AR8216_PHY_LEDS ++ bool "Atheros AR8216 switch LED support" ++ depends on (AR8216_PHY && LEDS_CLASS) ++ ++source "drivers/net/phy/b53/Kconfig" ++ ++config IP17XX_PHY ++ tristate "Driver for IC+ IP17xx switches" ++ select SWCONFIG ++ ++config MVSWITCH_PHY ++ tristate "Driver for Marvell 88E6060 switches" ++ select ETHERNET_PACKET_MANGLE ++ ++config MVSW61XX_PHY ++ tristate "Driver for Marvell 88E6171/6172 switches" ++ select SWCONFIG ++ ++config PSB6970_PHY ++ tristate "Lantiq XWAY Tantos (PSB6970) Ethernet switch" ++ select SWCONFIG ++ select ETHERNET_PACKET_MANGLE ++ ++config RTL8306_PHY ++ tristate "Driver for Realtek RTL8306S switches" ++ select SWCONFIG ++ ++config RTL8366_SMI ++ tristate "Driver for the RTL8366 SMI interface" ++ depends on GPIOLIB ++ ---help--- ++ This module implements the SMI interface protocol which is used ++ by some RTL8366 ethernet switch devices via the generic GPIO API. ++ ++if RTL8366_SMI ++ ++config RTL8366_SMI_DEBUG_FS ++ bool "RTL8366 SMI interface debugfs support" ++ depends on DEBUG_FS ++ default n ++ ++config RTL8366S_PHY ++ tristate "Driver for the Realtek RTL8366S switch" ++ select SWCONFIG ++ ++config RTL8366RB_PHY ++ tristate "Driver for the Realtek RTL8366RB switch" ++ select SWCONFIG ++ ++config RTL8367_PHY ++ tristate "Driver for the Realtek RTL8367R/M switches" ++ select SWCONFIG ++ ++config RTL8367B_PHY ++ tristate "Driver fot the Realtek RTL8367R-VB switch" ++ select SWCONFIG ++ ++endif # RTL8366_SMI ++ + comment "MII PHY device drivers" + + config SFP +--- a/drivers/net/phy/Makefile ++++ b/drivers/net/phy/Makefile +@@ -22,6 +22,21 @@ libphy-$(CONFIG_LED_TRIGGER_PHY) += phy_ + obj-$(CONFIG_PHYLINK) += phylink.o + obj-$(CONFIG_PHYLIB) += libphy.o + ++obj-$(CONFIG_SWCONFIG) += swconfig.o ++obj-$(CONFIG_ADM6996_PHY) += adm6996.o ++obj-$(CONFIG_AR8216_PHY) += ar8216.o ar8327.o ++obj-$(CONFIG_SWCONFIG_B53) += b53/ ++obj-$(CONFIG_IP17XX_PHY) += ip17xx.o ++obj-$(CONFIG_MVSWITCH_PHY) += mvswitch.o ++obj-$(CONFIG_MVSW61XX_PHY) += mvsw61xx.o ++obj-$(CONFIG_PSB6970_PHY) += psb6970.o ++obj-$(CONFIG_RTL8306_PHY) += rtl8306.o ++obj-$(CONFIG_RTL8366_SMI) += rtl8366_smi.o ++obj-$(CONFIG_RTL8366S_PHY) += rtl8366s.o ++obj-$(CONFIG_RTL8366RB_PHY) += rtl8366rb.o ++obj-$(CONFIG_RTL8367_PHY) += rtl8367.o ++obj-$(CONFIG_RTL8367B_PHY) += rtl8367b.o ++ + obj-$(CONFIG_MDIO_BCM_IPROC) += mdio-bcm-iproc.o + obj-$(CONFIG_MDIO_BCM_UNIMAC) += mdio-bcm-unimac.o + obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o diff --git a/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch new file mode 100644 index 000000000..9c249ca4c --- /dev/null +++ b/target/linux/generic/hack-4.14/702-phy_add_aneg_done_function.patch @@ -0,0 +1,27 @@ +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -547,6 +547,12 @@ struct phy_driver { + /* Determines the negotiated speed and duplex */ + int (*read_status)(struct phy_device *phydev); + ++ /* ++ * Update the value in phydev->link to reflect the ++ * current link value ++ */ ++ int (*update_link)(struct phy_device *phydev); ++ + /* Clears any pending interrupts */ + int (*ack_interrupt)(struct phy_device *phydev); + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1437,6 +1437,9 @@ int genphy_update_link(struct phy_device + { + int status; + ++ if (phydev->drv && phydev->drv->update_link) ++ return phydev->drv->update_link(phydev); ++ + /* Do a fake read */ + status = phy_read(phydev, MII_BMSR); + if (status < 0) diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch new file mode 100644 index 000000000..f6ac7147f --- /dev/null +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -0,0 +1,176 @@ +From ffe387740bbe88dd88bbe04d6375902708003d6e Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 7 Jul 2017 17:25:00 +0200 +Subject: net: add packet mangeling patch + +Signed-off-by: Felix Fietkau +--- + include/linux/netdevice.h | 11 +++++++++++ + include/linux/skbuff.h | 14 ++++---------- + net/Kconfig | 6 ++++++ + net/core/dev.c | 18 ++++++++++++++---- + net/core/skbuff.c | 17 +++++++++++++++++ + net/ethernet/eth.c | 6 ++++++ + 6 files changed, 58 insertions(+), 14 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1386,6 +1386,7 @@ enum netdev_priv_flags { + IFF_RXFH_CONFIGURED = 1<<25, + IFF_PHONY_HEADROOM = 1<<26, + IFF_MACSEC = 1<<27, ++ IFF_NO_IP_ALIGN = 1<<28, + }; + + #define IFF_802_1Q_VLAN IFF_802_1Q_VLAN +@@ -1415,6 +1416,7 @@ enum netdev_priv_flags { + #define IFF_TEAM IFF_TEAM + #define IFF_RXFH_CONFIGURED IFF_RXFH_CONFIGURED + #define IFF_MACSEC IFF_MACSEC ++#define IFF_NO_IP_ALIGN IFF_NO_IP_ALIGN + + /** + * struct net_device - The DEVICE structure. +@@ -1701,6 +1703,11 @@ struct net_device { + const struct xfrmdev_ops *xfrmdev_ops; + #endif + ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ void (*eth_mangle_rx)(struct net_device *dev, struct sk_buff *skb); ++ struct sk_buff *(*eth_mangle_tx)(struct net_device *dev, struct sk_buff *skb); ++#endif ++ + const struct header_ops *header_ops; + + unsigned int flags; +@@ -1770,6 +1777,10 @@ struct net_device { + struct mpls_dev __rcu *mpls_ptr; + #endif + ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ void *phy_ptr; /* PHY device specific data */ ++#endif ++ + /* + * Cache lines mostly used on receive path (including eth_type_trans()) + */ +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -2492,6 +2492,10 @@ static inline int pskb_trim(struct sk_bu + return (len < skb->len) ? __pskb_trim(skb, len) : 0; + } + ++extern struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, ++ unsigned int length, gfp_t gfp); ++ ++ + /** + * pskb_trim_unique - remove end from a paged unique (not cloned) buffer + * @skb: buffer to alter +@@ -2622,16 +2626,6 @@ static inline struct sk_buff *dev_alloc_ + } + + +-static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, +- unsigned int length, gfp_t gfp) +-{ +- struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); +- +- if (NET_IP_ALIGN && skb) +- skb_reserve(skb, NET_IP_ALIGN); +- return skb; +-} +- + static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, + unsigned int length) + { +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -25,6 +25,12 @@ menuconfig NET + + if NET + ++config ETHERNET_PACKET_MANGLE ++ bool ++ help ++ This option can be selected by phy drivers that need to mangle ++ packets going in or out of an ethernet device. ++ + config WANT_COMPAT_NETLINK_MESSAGES + bool + help +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -2974,10 +2974,20 @@ static int xmit_one(struct sk_buff *skb, + if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) + dev_queue_xmit_nit(skb, dev); + +- len = skb->len; +- trace_net_dev_start_xmit(skb, dev); +- rc = netdev_start_xmit(skb, dev, txq, more); +- trace_net_dev_xmit(skb, rc, dev, len); ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (!dev->eth_mangle_tx || ++ (skb = dev->eth_mangle_tx(dev, skb)) != NULL) ++#else ++ if (1) ++#endif ++ { ++ len = skb->len; ++ trace_net_dev_start_xmit(skb, dev); ++ rc = netdev_start_xmit(skb, dev, txq, more); ++ trace_net_dev_xmit(skb, rc, dev, len); ++ } else { ++ rc = NETDEV_TX_OK; ++ } + + return rc; + } +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -64,6 +64,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -503,6 +504,22 @@ skb_fail: + } + EXPORT_SYMBOL(__napi_alloc_skb); + ++struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev, ++ unsigned int length, gfp_t gfp) ++{ ++ struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp); ++ ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (dev && (dev->priv_flags & IFF_NO_IP_ALIGN)) ++ return skb; ++#endif ++ ++ if (NET_IP_ALIGN && skb) ++ skb_reserve(skb, NET_IP_ALIGN); ++ return skb; ++} ++EXPORT_SYMBOL(__netdev_alloc_skb_ip_align); ++ + void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, int off, + int size, unsigned int truesize) + { +--- a/net/ethernet/eth.c ++++ b/net/ethernet/eth.c +@@ -172,6 +172,12 @@ __be16 eth_type_trans(struct sk_buff *sk + const struct ethhdr *eth; + + skb->dev = dev; ++ ++#ifdef CONFIG_ETHERNET_PACKET_MANGLE ++ if (dev->eth_mangle_rx) ++ dev->eth_mangle_rx(dev, skb); ++#endif ++ + skb_reset_mac_header(skb); + + eth = (struct ethhdr *)skb->data; diff --git a/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch b/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch new file mode 100644 index 000000000..a6ba81fb0 --- /dev/null +++ b/target/linux/generic/hack-4.14/773-bgmac-add-srab-switch.patch @@ -0,0 +1,98 @@ +From 3cb240533ab787899dc7f17aa7d6c5b4810e2e58 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Fri, 7 Jul 2017 17:26:01 +0200 +Subject: bcm53xx: bgmac: use srab switch driver + +use the srab switch driver on these SoCs. + +Signed-off-by: Hauke Mehrtens +--- + drivers/net/ethernet/broadcom/bgmac-bcma.c | 1 + + drivers/net/ethernet/broadcom/bgmac.c | 24 ++++++++++++++++++++++++ + drivers/net/ethernet/broadcom/bgmac.h | 4 ++++ + 3 files changed, 29 insertions(+) + +--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c ++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c +@@ -268,6 +268,7 @@ static int bgmac_probe(struct bcma_devic + bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; + bgmac->feature_flags |= BGMAC_FEAT_NO_RESET; + bgmac->feature_flags |= BGMAC_FEAT_FORCE_SPEED_2500; ++ bgmac->feature_flags |= BGMAC_FEAT_SRAB; + break; + default: + bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST; +--- a/drivers/net/ethernet/broadcom/bgmac.c ++++ b/drivers/net/ethernet/broadcom/bgmac.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1409,6 +1410,17 @@ static const struct ethtool_ops bgmac_et + .set_link_ksettings = phy_ethtool_set_link_ksettings, + }; + ++static struct b53_platform_data bgmac_b53_pdata = { ++}; ++ ++static struct platform_device bgmac_b53_dev = { ++ .name = "b53-srab-switch", ++ .id = -1, ++ .dev = { ++ .platform_data = &bgmac_b53_pdata, ++ }, ++}; ++ + /************************************************** + * MII + **************************************************/ +@@ -1538,6 +1550,14 @@ int bgmac_enet_probe(struct bgmac *bgmac + net_dev->hw_features = net_dev->features; + net_dev->vlan_features = net_dev->features; + ++ if ((bgmac->feature_flags & BGMAC_FEAT_SRAB) && !bgmac_b53_pdata.regs) { ++ bgmac_b53_pdata.regs = ioremap_nocache(0x18007000, 0x1000); ++ ++ err = platform_device_register(&bgmac_b53_dev); ++ if (!err) ++ bgmac->b53_device = &bgmac_b53_dev; ++ } ++ + err = register_netdev(bgmac->net_dev); + if (err) { + dev_err(bgmac->dev, "Cannot register net device\n"); +@@ -1560,6 +1580,10 @@ EXPORT_SYMBOL_GPL(bgmac_enet_probe); + + void bgmac_enet_remove(struct bgmac *bgmac) + { ++ if (bgmac->b53_device) ++ platform_device_unregister(&bgmac_b53_dev); ++ bgmac->b53_device = NULL; ++ + unregister_netdev(bgmac->net_dev); + phy_disconnect(bgmac->net_dev->phydev); + netif_napi_del(&bgmac->napi); +--- a/drivers/net/ethernet/broadcom/bgmac.h ++++ b/drivers/net/ethernet/broadcom/bgmac.h +@@ -427,6 +427,7 @@ + #define BGMAC_FEAT_CC4_IF_SW_TYPE_RGMII BIT(18) + #define BGMAC_FEAT_CC7_IF_TYPE_RGMII BIT(19) + #define BGMAC_FEAT_IDM_MASK BIT(20) ++#define BGMAC_FEAT_SRAB BIT(21) + + struct bgmac_slot_info { + union { +@@ -532,6 +533,9 @@ struct bgmac { + void (*cmn_maskset32)(struct bgmac *bgmac, u16 offset, u32 mask, + u32 set); + int (*phy_connect)(struct bgmac *bgmac); ++ ++ /* platform device for associated switch */ ++ struct platform_device *b53_device; + }; + + struct bgmac *bgmac_alloc(struct device *dev); diff --git a/target/linux/generic/hack-4.14/835-misc-owl_loader.patch b/target/linux/generic/hack-4.14/835-misc-owl_loader.patch new file mode 100644 index 000000000..bf7f7d5cb --- /dev/null +++ b/target/linux/generic/hack-4.14/835-misc-owl_loader.patch @@ -0,0 +1,52 @@ +From dd36f935973d91644449bd9749f6062a2bed821b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 7 Jul 2017 17:26:46 +0200 +Subject: misc: owl-loader for delayed Atheros ath9k fixup + +Some devices (like the Cisco Meraki Z1 Cloud Managed Teleworker Gateway) +need to be able to initialize the PCIe wifi device. Normally, this is done +during the early stages of booting linux, because the necessary init code +is read from the memory mapped SPI and passed to pci_enable_ath9k_fixup. +However,this isn't possible for devices which have the init code for the +Atheros chip stored on NAND in an UBI volume. Hence, this module can be +used to initialze the chip when the user-space is ready to extract the +init code. + +Signed-off-by: Martin Blumenstingl +Signed-off-by: Christian Lamparter +--- + drivers/misc/Kconfig | 12 ++++++++++++ + drivers/misc/Makefile | 1 + + 2 files changed, 13 insertions(+) + +--- a/drivers/misc/Kconfig ++++ b/drivers/misc/Kconfig +@@ -151,6 +151,18 @@ config SGI_IOC4 + If you have an SGI Altix with an IOC4-based card say Y. + Otherwise say N. + ++config OWL_LOADER ++ tristate "Owl loader for initializing Atheros PCI(e) Wifi chips" ++ depends on PCI ++ ---help--- ++ This kernel module helps to initialize certain Qualcomm ++ Atheros' PCI(e) Wifi chips, which have the init data ++ (which contains the PCI device ID for example) stored ++ together with the calibration data in the file system. ++ ++ This is necessary for devices like the Cisco Meraki Z1, say M. ++ Otherwise say N. ++ + config TIFM_CORE + tristate "TI Flash Media interface support" + depends on PCI +--- a/drivers/misc/Makefile ++++ b/drivers/misc/Makefile +@@ -13,6 +13,7 @@ obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib + obj-$(CONFIG_DUMMY_IRQ) += dummy-irq.o + obj-$(CONFIG_ICS932S401) += ics932s401.o + obj-$(CONFIG_LKDTM) += lkdtm.o ++obj-$(CONFIG_OWL_LOADER) += owl-loader.o + obj-$(CONFIG_TIFM_CORE) += tifm_core.o + obj-$(CONFIG_TIFM_7XX1) += tifm_7xx1.o + obj-$(CONFIG_PHANTOM) += phantom.o diff --git a/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch new file mode 100644 index 000000000..d854865d6 --- /dev/null +++ b/target/linux/generic/hack-4.14/901-debloat_sock_diag.patch @@ -0,0 +1,136 @@ +From 3b6115d6b57a263bdc8c9b1df273bd4a7955eead Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:16:31 +0200 +Subject: debloat: add some debloat patches, strip down procfs and make O_DIRECT support optional, saves ~15K after lzma on MIPS + +Signed-off-by: Felix Fietkau +--- + net/Kconfig | 3 +++ + net/core/Makefile | 3 ++- + net/core/sock.c | 2 ++ + net/ipv4/Kconfig | 1 + + net/netlink/Kconfig | 1 + + net/packet/Kconfig | 1 + + net/unix/Kconfig | 1 + + 7 files changed, 11 insertions(+), 1 deletion(-) + +--- a/net/Kconfig ++++ b/net/Kconfig +@@ -97,6 +97,9 @@ source "net/netlabel/Kconfig" + + endif # if INET + ++config SOCK_DIAG ++ bool ++ + config NETWORK_SECMARK + bool "Security Marking" + help +--- a/net/core/Makefile ++++ b/net/core/Makefile +@@ -10,9 +10,10 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core. + + obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \ + neighbour.o rtnetlink.o utils.o link_watch.o filter.o \ +- sock_diag.o dev_ioctl.o tso.o sock_reuseport.o \ ++ dev_ioctl.o tso.o sock_reuseport.o \ + fib_notifier.o + ++obj-$(CONFIG_SOCK_DIAG) += sock_diag.o + obj-y += net-sysfs.o + obj-$(CONFIG_PROC_FS) += net-procfs.o + obj-$(CONFIG_NET_PKTGEN) += pktgen.o +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -528,6 +528,18 @@ discard_and_relse: + } + EXPORT_SYMBOL(__sk_receive_skb); + ++u64 sock_gen_cookie(struct sock *sk) ++{ ++ while (1) { ++ u64 res = atomic64_read(&sk->sk_cookie); ++ ++ if (res) ++ return res; ++ res = atomic64_inc_return(&sock_net(sk)->cookie_gen); ++ atomic64_cmpxchg(&sk->sk_cookie, 0, res); ++ } ++} ++ + struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie) + { + struct dst_entry *dst = __sk_dst_get(sk); +@@ -1597,9 +1609,11 @@ void sk_destruct(struct sock *sk) + + static void __sk_free(struct sock *sk) + { ++#ifdef CONFIG_SOCK_DIAG + if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt)) + sock_diag_broadcast_destroy(sk); + else ++#endif + sk_destruct(sk); + } + +--- a/net/core/sock_diag.c ++++ b/net/core/sock_diag.c +@@ -19,18 +19,6 @@ static int (*inet_rcv_compat)(struct sk_ + static DEFINE_MUTEX(sock_diag_table_mutex); + static struct workqueue_struct *broadcast_wq; + +-u64 sock_gen_cookie(struct sock *sk) +-{ +- while (1) { +- u64 res = atomic64_read(&sk->sk_cookie); +- +- if (res) +- return res; +- res = atomic64_inc_return(&sock_net(sk)->cookie_gen); +- atomic64_cmpxchg(&sk->sk_cookie, 0, res); +- } +-} +- + int sock_diag_check_cookie(struct sock *sk, const __u32 *cookie) + { + u64 res; +--- a/net/ipv4/Kconfig ++++ b/net/ipv4/Kconfig +@@ -420,6 +420,7 @@ config INET_XFRM_MODE_BEET + + config INET_DIAG + tristate "INET: socket monitoring interface" ++ select SOCK_DIAG + default y + ---help--- + Support for INET (TCP, DCCP, etc) socket monitoring interface used by +--- a/net/netlink/Kconfig ++++ b/net/netlink/Kconfig +@@ -4,6 +4,7 @@ + + config NETLINK_DIAG + tristate "NETLINK: socket monitoring interface" ++ select SOCK_DIAG + default n + ---help--- + Support for NETLINK socket monitoring interface used by the ss tool. +--- a/net/packet/Kconfig ++++ b/net/packet/Kconfig +@@ -18,6 +18,7 @@ config PACKET + config PACKET_DIAG + tristate "Packet: sockets monitoring interface" + depends on PACKET ++ select SOCK_DIAG + default n + ---help--- + Support for PF_PACKET sockets monitoring interface used by the ss tool. +--- a/net/unix/Kconfig ++++ b/net/unix/Kconfig +@@ -22,6 +22,7 @@ config UNIX + config UNIX_DIAG + tristate "UNIX: socket monitoring interface" + depends on UNIX ++ select SOCK_DIAG + default n + ---help--- + Support for UNIX socket monitoring interface used by the ss tool. diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch new file mode 100644 index 000000000..a624cb1c4 --- /dev/null +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -0,0 +1,405 @@ +From 9e3f1d0805b2d919904dd9a4ff0d956314cc3cba Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:20:09 +0200 +Subject: debloat: procfs + +Signed-off-by: Felix Fietkau +--- + fs/locks.c | 2 ++ + fs/proc/Kconfig | 5 +++++ + fs/proc/consoles.c | 3 +++ + fs/proc/proc_tty.c | 11 ++++++++++- + include/net/snmp.h | 18 +++++++++++++++++- + ipc/msg.c | 3 +++ + ipc/sem.c | 2 ++ + ipc/shm.c | 2 ++ + ipc/util.c | 3 +++ + kernel/exec_domain.c | 2 ++ + kernel/irq/proc.c | 9 +++++++++ + kernel/time/timer_list.c | 2 ++ + mm/vmalloc.c | 2 ++ + mm/vmstat.c | 8 +++++--- + net/8021q/vlanproc.c | 6 ++++++ + net/core/net-procfs.c | 18 ++++++++++++------ + net/core/sock.c | 2 ++ + net/ipv4/fib_trie.c | 18 ++++++++++++------ + net/ipv4/proc.c | 3 +++ + net/ipv4/route.c | 3 +++ + 20 files changed, 105 insertions(+), 17 deletions(-) + +--- a/fs/locks.c ++++ b/fs/locks.c +@@ -2805,6 +2805,8 @@ static const struct file_operations proc + + static int __init proc_locks_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("locks", 0, NULL, &proc_locks_operations); + return 0; + } +--- a/fs/proc/Kconfig ++++ b/fs/proc/Kconfig +@@ -81,3 +81,8 @@ config PROC_CHILDREN + + Say Y if you are running any user-space software which takes benefit from + this interface. For example, rkt is such a piece of software. ++ ++config PROC_STRIPPED ++ default n ++ depends on EXPERT ++ bool "Strip non-essential /proc functionality to reduce code size" +--- a/fs/proc/consoles.c ++++ b/fs/proc/consoles.c +@@ -106,6 +106,9 @@ static const struct file_operations proc + + static int __init proc_consoles_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + proc_create("consoles", 0, NULL, &proc_consoles_operations); + return 0; + } +--- a/fs/proc/proc_tty.c ++++ b/fs/proc/proc_tty.c +@@ -144,7 +144,10 @@ static const struct file_operations proc + void proc_tty_register_driver(struct tty_driver *driver) + { + struct proc_dir_entry *ent; +- ++ ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (!driver->driver_name || driver->proc_entry || + !driver->ops->proc_fops) + return; +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t + { + struct proc_dir_entry *ent; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + ent = driver->proc_entry; + if (!ent) + return; +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t + */ + void __init proc_tty_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (!proc_mkdir("tty", NULL)) + return; + proc_mkdir("tty/ldisc", NULL); /* Preserved: it's userspace visible */ +--- a/include/net/snmp.h ++++ b/include/net/snmp.h +@@ -123,6 +123,21 @@ struct linux_xfrm_mib { + #define DECLARE_SNMP_STAT(type, name) \ + extern __typeof__(type) __percpu *name + ++#ifdef CONFIG_PROC_STRIPPED ++#define __SNMP_STATS_DUMMY(mib) \ ++ do { (void) mib->mibs[0]; } while(0) ++ ++#define __SNMP_INC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_INC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define SNMP_DEC_STATS(mib, field) __SNMP_STATS_DUMMY(mib) ++#define __SNMP_ADD_STATS(mib, field, addend) __SNMP_STATS_DUMMY(mib) ++#define SNMP_ADD_STATS(mib, field, addend) __SNMP_STATS_DUMMY(mib) ++#define SNMP_UPD_PO_STATS(mib, basefield, addend) __SNMP_STATS_DUMMY(mib) ++#define __SNMP_UPD_PO_STATS(mib, basefield, addend) __SNMP_STATS_DUMMY(mib) ++ ++#else ++ + #define __SNMP_INC_STATS(mib, field) \ + __this_cpu_inc(mib->mibs[field]) + +@@ -153,8 +168,9 @@ struct linux_xfrm_mib { + __this_cpu_add(ptr[basefield##OCTETS], addend); \ + } while (0) + ++#endif + +-#if BITS_PER_LONG==32 ++#if (BITS_PER_LONG==32) && !defined(CONFIG_PROC_STRIPPED) + + #define __SNMP_ADD_STATS64(mib, field, addend) \ + do { \ +--- a/ipc/msg.c ++++ b/ipc/msg.c +@@ -1208,6 +1208,9 @@ int __init msg_init(void) + { + const int err = msg_init_ns(&init_ipc_ns); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return err; ++ + ipc_init_proc_interface("sysvipc/msg", + " key msqid perms cbytes qnum lspid lrpid uid gid cuid cgid stime rtime ctime\n", + IPC_MSG_IDS, sysvipc_msg_proc_show); +--- a/ipc/sem.c ++++ b/ipc/sem.c +@@ -207,6 +207,8 @@ int __init sem_init(void) + { + const int err = sem_init_ns(&init_ipc_ns); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return err; + ipc_init_proc_interface("sysvipc/sem", + " key semid perms nsems uid gid cuid cgid otime ctime\n", + IPC_SEM_IDS, sysvipc_sem_proc_show); +--- a/ipc/shm.c ++++ b/ipc/shm.c +@@ -122,6 +122,8 @@ pure_initcall(ipc_ns_init); + + void __init shm_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; + ipc_init_proc_interface("sysvipc/shm", + #if BITS_PER_LONG <= 32 + " key shmid perms size cpid lpid nattch uid gid cuid cgid atime dtime ctime rss swap\n", +--- a/ipc/util.c ++++ b/ipc/util.c +@@ -141,6 +141,9 @@ void __init ipc_init_proc_interface(cons + struct proc_dir_entry *pde; + struct ipc_proc_iface *iface; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + iface = kmalloc(sizeof(*iface), GFP_KERNEL); + if (!iface) + return; +--- a/kernel/exec_domain.c ++++ b/kernel/exec_domain.c +@@ -42,6 +42,8 @@ static const struct file_operations exec + + static int __init proc_execdomains_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("execdomains", 0, NULL, &execdomains_proc_fops); + return 0; + } +--- a/kernel/irq/proc.c ++++ b/kernel/irq/proc.c +@@ -396,6 +396,9 @@ void register_irq_proc(unsigned int irq, + void __maybe_unused *irqp = (void *)(unsigned long) irq; + char name [MAX_NAMELEN]; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) + return; + +@@ -449,6 +452,9 @@ void unregister_irq_proc(unsigned int ir + { + char name [MAX_NAMELEN]; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + if (!root_irq_dir || !desc->dir) + return; + #ifdef CONFIG_SMP +@@ -487,6 +493,9 @@ void init_irq_proc(void) + unsigned int irq; + struct irq_desc *desc; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED) && !IS_ENABLED(CONFIG_SMP)) ++ return; ++ + /* create /proc/irq */ + root_irq_dir = proc_mkdir("irq", NULL); + if (!root_irq_dir) +--- a/kernel/time/timer_list.c ++++ b/kernel/time/timer_list.c +@@ -389,6 +389,8 @@ static int __init init_timer_list_procfs + { + struct proc_dir_entry *pe; + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + pe = proc_create("timer_list", 0444, NULL, &timer_list_fops); + if (!pe) + return -ENOMEM; +--- a/mm/vmalloc.c ++++ b/mm/vmalloc.c +@@ -2765,6 +2765,8 @@ static const struct file_operations proc + + static int __init proc_vmalloc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); + return 0; + } +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -1944,10 +1944,12 @@ void __init init_mm_internals(void) + start_shepherd_timer(); + #endif + #ifdef CONFIG_PROC_FS +- proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations); +- proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ proc_create("buddyinfo", 0444, NULL, &buddyinfo_file_operations); ++ proc_create("pagetypeinfo", 0444, NULL, &pagetypeinfo_file_operations); ++ proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations); ++ } + proc_create("vmstat", 0444, NULL, &vmstat_file_operations); +- proc_create("zoneinfo", 0444, NULL, &zoneinfo_file_operations); + #endif + } + +--- a/net/8021q/vlanproc.c ++++ b/net/8021q/vlanproc.c +@@ -127,6 +127,9 @@ void vlan_proc_cleanup(struct net *net) + { + struct vlan_net *vn = net_generic(net, vlan_net_id); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return; ++ + if (vn->proc_vlan_conf) + remove_proc_entry(name_conf, vn->proc_vlan_dir); + +@@ -146,6 +149,9 @@ int __net_init vlan_proc_init(struct net + { + struct vlan_net *vn = net_generic(net, vlan_net_id); + ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + vn->proc_vlan_dir = proc_net_mkdir(net, name_root, net->proc_net); + if (!vn->proc_vlan_dir) + goto err; +--- a/net/core/net-procfs.c ++++ b/net/core/net-procfs.c +@@ -320,10 +320,12 @@ static int __net_init dev_proc_net_init( + + if (!proc_create("dev", S_IRUGO, net->proc_net, &dev_seq_fops)) + goto out; +- if (!proc_create("softnet_stat", S_IRUGO, net->proc_net, ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("softnet_stat", S_IRUGO, net->proc_net, + &softnet_seq_fops)) + goto out_dev; +- if (!proc_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops)) ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("ptype", S_IRUGO, net->proc_net, &ptype_seq_fops)) + goto out_softnet; + + if (wext_proc_init(net)) +@@ -332,9 +334,11 @@ static int __net_init dev_proc_net_init( + out: + return rc; + out_ptype: +- remove_proc_entry("ptype", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("ptype", net->proc_net); + out_softnet: +- remove_proc_entry("softnet_stat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("softnet_stat", net->proc_net); + out_dev: + remove_proc_entry("dev", net->proc_net); + goto out; +@@ -344,8 +348,10 @@ static void __net_exit dev_proc_net_exit + { + wext_proc_exit(net); + +- remove_proc_entry("ptype", net->proc_net); +- remove_proc_entry("softnet_stat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ remove_proc_entry("ptype", net->proc_net); ++ remove_proc_entry("softnet_stat", net->proc_net); ++ } + remove_proc_entry("dev", net->proc_net); + } + +--- a/net/core/sock.c ++++ b/net/core/sock.c +@@ -3383,6 +3383,8 @@ static __net_initdata struct pernet_oper + + static int __init proto_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; + return register_pernet_subsys(&proto_net_ops); + } + +--- a/net/ipv4/fib_trie.c ++++ b/net/ipv4/fib_trie.c +@@ -2731,10 +2731,12 @@ static const struct file_operations fib_ + + int __net_init fib_proc_init(struct net *net) + { +- if (!proc_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops)) ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("fib_trie", S_IRUGO, net->proc_net, &fib_trie_fops)) + goto out1; + +- if (!proc_create("fib_triestat", S_IRUGO, net->proc_net, ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED) && ++ !proc_create("fib_triestat", S_IRUGO, net->proc_net, + &fib_triestat_fops)) + goto out2; + +@@ -2744,17 +2746,21 @@ int __net_init fib_proc_init(struct net + return 0; + + out3: +- remove_proc_entry("fib_triestat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("fib_triestat", net->proc_net); + out2: +- remove_proc_entry("fib_trie", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ remove_proc_entry("fib_trie", net->proc_net); + out1: + return -ENOMEM; + } + + void __net_exit fib_proc_exit(struct net *net) + { +- remove_proc_entry("fib_trie", net->proc_net); +- remove_proc_entry("fib_triestat", net->proc_net); ++ if (!IS_ENABLED(CONFIG_PROC_STRIPPED)) { ++ remove_proc_entry("fib_trie", net->proc_net); ++ remove_proc_entry("fib_triestat", net->proc_net); ++ } + remove_proc_entry("route", net->proc_net); + } + +--- a/net/ipv4/proc.c ++++ b/net/ipv4/proc.c +@@ -557,6 +557,9 @@ static __net_initdata struct pernet_oper + + int __init ip_misc_proc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + return register_pernet_subsys(&ip_proc_ops); + } + +--- a/net/ipv4/route.c ++++ b/net/ipv4/route.c +@@ -424,6 +424,9 @@ static struct pernet_operations ip_rt_pr + + static int __init ip_rt_proc_init(void) + { ++ if (IS_ENABLED(CONFIG_PROC_STRIPPED)) ++ return 0; ++ + return register_pernet_subsys(&ip_rt_proc_ops); + } + diff --git a/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch new file mode 100644 index 000000000..8f1a3bca8 --- /dev/null +++ b/target/linux/generic/hack-4.14/904-debloat_dma_buf.patch @@ -0,0 +1,64 @@ +From e3692cb2fcd5ba1244512a0f43b8118f65f1c375 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:20:43 +0200 +Subject: debloat: dmabuf + +Signed-off-by: Felix Fietkau +--- + drivers/base/Kconfig | 2 +- + drivers/dma-buf/Makefile | 10 +++++++--- + drivers/dma-buf/dma-buf.c | 4 +++- + kernel/sched/core.c | 1 + + 4 files changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/base/Kconfig ++++ b/drivers/base/Kconfig +@@ -243,7 +243,7 @@ config SOC_BUS + source "drivers/base/regmap/Kconfig" + + config DMA_SHARED_BUFFER +- bool ++ tristate + default n + select ANON_INODES + help +--- a/drivers/dma-buf/Makefile ++++ b/drivers/dma-buf/Makefile +@@ -1,3 +1,7 @@ +-obj-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o +-obj-$(CONFIG_SYNC_FILE) += sync_file.o +-obj-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o ++obj-$(CONFIG_DMA_SHARED_BUFFER) := dma-shared-buffer.o ++ ++dma-buf-objs-y := dma-buf.o dma-fence.o dma-fence-array.o reservation.o seqno-fence.o ++dma-buf-objs-$(CONFIG_SYNC_FILE) += sync_file.o ++dma-buf-objs-$(CONFIG_SW_SYNC) += sw_sync.o sync_debug.o ++ ++dma-shared-buffer-objs := $(dma-buf-objs-y) +--- a/drivers/dma-buf/dma-buf.c ++++ b/drivers/dma-buf/dma-buf.c +@@ -34,6 +34,7 @@ + #include + #include + #include ++#include + + #include + +@@ -1205,4 +1206,5 @@ static void __exit dma_buf_deinit(void) + { + dma_buf_uninit_debugfs(); + } +-__exitcall(dma_buf_deinit); ++module_exit(dma_buf_deinit); ++MODULE_LICENSE("GPL"); +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -2146,6 +2146,7 @@ int wake_up_state(struct task_struct *p, + { + return try_to_wake_up(p, state, 0); + } ++EXPORT_SYMBOL_GPL(wake_up_state); + + /* + * Perform scheduler related setup for a newly forked process p. diff --git a/target/linux/generic/hack-4.14/910-kobject_uevent.patch b/target/linux/generic/hack-4.14/910-kobject_uevent.patch new file mode 100644 index 000000000..113fbb54b --- /dev/null +++ b/target/linux/generic/hack-4.14/910-kobject_uevent.patch @@ -0,0 +1,32 @@ +From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 16 Jul 2017 16:56:10 +0200 +Subject: lib: add uevent_next_seqnum() + +Signed-off-by: Felix Fietkau +--- + include/linux/kobject.h | 5 +++++ + lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +--- a/lib/kobject_uevent.c ++++ b/lib/kobject_uevent.c +@@ -176,6 +176,18 @@ out: + return r; + } + ++u64 uevent_next_seqnum(void) ++{ ++ u64 seq; ++ ++ mutex_lock(&uevent_sock_mutex); ++ seq = ++uevent_seqnum; ++ mutex_unlock(&uevent_sock_mutex); ++ ++ return seq; ++} ++EXPORT_SYMBOL_GPL(uevent_next_seqnum); ++ + /** + * kobject_synth_uevent - send synthetic uevent with arguments + * diff --git a/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch new file mode 100644 index 000000000..abacfc390 --- /dev/null +++ b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch @@ -0,0 +1,76 @@ +From 0d37e6edc09c99e683dd91ca0e83bbc0df8477b3 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sun, 16 Jul 2017 16:56:10 +0200 +Subject: lib: add uevent_next_seqnum() + +Signed-off-by: Felix Fietkau +--- + include/linux/kobject.h | 5 +++++ + lib/kobject_uevent.c | 37 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 42 insertions(+) + +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -32,6 +32,8 @@ + #define UEVENT_NUM_ENVP 32 /* number of env pointers */ + #define UEVENT_BUFFER_SIZE 2048 /* buffer for the variables */ + ++struct sk_buff; ++ + #ifdef CONFIG_UEVENT_HELPER + /* path to the userspace helper executed on an event */ + extern char uevent_helper[]; +@@ -224,4 +226,7 @@ int kobject_synth_uevent(struct kobject + __printf(2, 3) + int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...); + ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation); ++ + #endif /* _KOBJECT_H_ */ +--- a/lib/kobject_uevent.c ++++ b/lib/kobject_uevent.c +@@ -599,6 +599,43 @@ int add_uevent_var(struct kobj_uevent_en + EXPORT_SYMBOL_GPL(add_uevent_var); + + #if defined(CONFIG_NET) ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation) ++{ ++ struct uevent_sock *ue_sk; ++ int err = 0; ++ ++ /* send netlink message */ ++ mutex_lock(&uevent_sock_mutex); ++ list_for_each_entry(ue_sk, &uevent_sock_list, list) { ++ struct sock *uevent_sock = ue_sk->sk; ++ struct sk_buff *skb2; ++ ++ skb2 = skb_clone(skb, allocation); ++ if (!skb2) ++ break; ++ ++ err = netlink_broadcast(uevent_sock, skb2, pid, group, ++ allocation); ++ if (err) ++ break; ++ } ++ mutex_unlock(&uevent_sock_mutex); ++ ++ kfree_skb(skb); ++ return err; ++} ++#else ++int broadcast_uevent(struct sk_buff *skb, __u32 pid, __u32 group, ++ gfp_t allocation) ++{ ++ kfree_skb(skb); ++ return 0; ++} ++#endif ++EXPORT_SYMBOL_GPL(broadcast_uevent); ++ ++#if defined(CONFIG_NET) + static int uevent_net_init(struct net *net) + { + struct uevent_sock *ue_sk; diff --git a/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch b/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch new file mode 100644 index 000000000..6eeddcc3c --- /dev/null +++ b/target/linux/generic/hack-4.14/921-always-create-console-node-in-initramfs.patch @@ -0,0 +1,40 @@ +From 5d301596fdc72f6cb672f72eb3c66e7cddefb103 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:26:02 +0200 +Subject: initramfs: always create console node + +Signed-off-by: Felix Fietkau +--- + scripts/gen_initramfs_list.sh | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/scripts/gen_initramfs_list.sh ++++ b/scripts/gen_initramfs_list.sh +@@ -59,6 +59,18 @@ default_initramfs() { + EOF + } + ++list_openwrt_initramfs() { ++ : ++} ++ ++openwrt_initramfs() { ++ # make sure that /dev/console exists ++ cat <<-EOF >> ${output} ++ dir /dev 0755 0 0 ++ nod /dev/console 0600 0 0 c 5 1 ++ EOF ++} ++ + filetype() { + local argv1="$1" + +@@ -180,6 +192,8 @@ dir_filelist() { + if [ "$(echo "${dirlist}" | wc -l)" -gt 1 ]; then + ${dep_list}print_mtime "$1" + ++ ${dep_list}openwrt_initramfs ++ + echo "${dirlist}" | \ + while read x; do + ${dep_list}parse ${x} diff --git a/target/linux/generic/hack-4.14/930-crashlog.patch b/target/linux/generic/hack-4.14/930-crashlog.patch new file mode 100644 index 000000000..17ba18792 --- /dev/null +++ b/target/linux/generic/hack-4.14/930-crashlog.patch @@ -0,0 +1,338 @@ +From 6b1ab74a9917012d0c559edc4ed299d9228ac89f Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 8 Jul 2017 08:26:47 +0200 +Subject: kernel: add the new 'crashlog' feature + +this tries to store kernel oops/panic logs in a fixed location in RAM to +recover them available to user space using debugfs + +Signed-off-by: Felix Fietkau +--- + include/linux/crashlog.h | 17 ++++ + init/Kconfig | 4 + + kernel/Makefile | 1 + + kernel/crashlog.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++ + kernel/module.c | 3 + + mm/bootmem.c | 2 + + mm/memblock.c | 5 ++ + 7 files changed, 245 insertions(+) + create mode 100644 include/linux/crashlog.h + create mode 100644 kernel/crashlog.c + +--- /dev/null ++++ b/include/linux/crashlog.h +@@ -0,0 +1,17 @@ ++#ifndef __CRASHLOG_H ++#define __CRASHLOG_H ++ ++#ifdef CONFIG_CRASHLOG ++void crashlog_init_bootmem(struct bootmem_data *bdata); ++void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size); ++#else ++static inline void crashlog_init_bootmem(struct bootmem_data *bdata) ++{ ++} ++ ++static inline void crashlog_init_memblock(phys_addr_t addr, phys_addr_t size) ++{ ++} ++#endif ++ ++#endif +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1009,6 +1009,10 @@ config RELAY + + If unsure, say N. + ++config CRASHLOG ++ bool "Crash logging" ++ depends on (!NO_BOOTMEM || HAVE_MEMBLOCK) ++ + config BLK_DEV_INITRD + bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" + depends on BROKEN || !FRV +--- a/kernel/Makefile ++++ b/kernel/Makefile +@@ -112,6 +112,7 @@ obj-$(CONFIG_CONTEXT_TRACKING) += contex + obj-$(CONFIG_TORTURE_TEST) += torture.o + + obj-$(CONFIG_HAS_IOMEM) += memremap.o ++obj-$(CONFIG_CRASHLOG) += crashlog.o + + $(obj)/configs.o: $(obj)/config_data.h + +--- /dev/null ++++ b/kernel/crashlog.c +@@ -0,0 +1,213 @@ ++/* ++ * Crash information logger ++ * Copyright (C) 2010 Felix Fietkau ++ * ++ * Based on ramoops.c ++ * Copyright (C) 2010 Marco Stornelli ++ * ++ * 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. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ++ * 02110-1301 USA ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define CRASHLOG_PAGES 4 ++#define CRASHLOG_SIZE (CRASHLOG_PAGES * PAGE_SIZE) ++#define CRASHLOG_MAGIC 0xa1eedead ++ ++/* ++ * Start the log at 1M before the end of RAM, as some boot loaders like ++ * to use the end of the RAM for stack usage and other things ++ * If this fails, fall back to using the last part. ++ */ ++#define CRASHLOG_OFFSET (1024 * 1024) ++ ++struct crashlog_data { ++ u32 magic; ++ u32 len; ++ u8 data[]; ++}; ++ ++static struct debugfs_blob_wrapper crashlog_blob; ++static unsigned long crashlog_addr = 0; ++static struct crashlog_data *crashlog_buf; ++static struct kmsg_dumper dump; ++static bool first = true; ++ ++extern struct list_head *crashlog_modules; ++ ++static bool crashlog_set_addr(phys_addr_t addr, phys_addr_t size) ++{ ++ /* Limit to lower 64 MB to avoid highmem */ ++ phys_addr_t limit = 64 * 1024 * 1024; ++ ++ if (crashlog_addr) ++ return false; ++ ++ if (addr > limit) ++ return false; ++ ++ if (addr + size > limit) ++ size = limit - addr; ++ ++ crashlog_addr = addr; ++ ++ if (addr + size > CRASHLOG_OFFSET) ++ crashlog_addr += size - CRASHLOG_OFFSET; ++ ++ return true; ++} ++ ++#ifndef CONFIG_NO_BOOTMEM ++void __init crashlog_init_bootmem(bootmem_data_t *bdata) ++{ ++ phys_addr_t start, end; ++ ++ start = PFN_PHYS(bdata->node_low_pfn); ++ end = PFN_PHYS(bdata->node_min_pfn); ++ if (!crashlog_set_addr(start, end - start)) ++ return; ++ ++ if (reserve_bootmem(crashlog_addr, CRASHLOG_SIZE, BOOTMEM_EXCLUSIVE) < 0) { ++ printk("Crashlog failed to allocate RAM at address 0x%lx\n", ++ crashlog_addr); ++ crashlog_addr = 0; ++ } ++} ++#endif ++ ++#ifdef CONFIG_HAVE_MEMBLOCK ++void __init_memblock crashlog_init_memblock(phys_addr_t addr, phys_addr_t size) ++{ ++ if (!crashlog_set_addr(addr, size)) ++ return; ++ ++ if (memblock_reserve(crashlog_addr, CRASHLOG_SIZE)) { ++ printk("Crashlog failed to allocate RAM at address 0x%lx\n", ++ crashlog_addr); ++ crashlog_addr = 0; ++ } ++} ++#endif ++ ++static void __init crashlog_copy(void) ++{ ++ if (crashlog_buf->magic != CRASHLOG_MAGIC) ++ return; ++ ++ if (!crashlog_buf->len || crashlog_buf->len > ++ CRASHLOG_SIZE - sizeof(*crashlog_buf)) ++ return; ++ ++ crashlog_blob.size = crashlog_buf->len; ++ crashlog_blob.data = kmemdup(crashlog_buf->data, ++ crashlog_buf->len, GFP_KERNEL); ++ ++ debugfs_create_blob("crashlog", 0700, NULL, &crashlog_blob); ++} ++ ++static int get_maxlen(void) ++{ ++ return CRASHLOG_SIZE - sizeof(*crashlog_buf) - crashlog_buf->len; ++} ++ ++static void crashlog_printf(const char *fmt, ...) ++{ ++ va_list args; ++ int len = get_maxlen(); ++ ++ if (!len) ++ return; ++ ++ va_start(args, fmt); ++ crashlog_buf->len += vscnprintf( ++ &crashlog_buf->data[crashlog_buf->len], ++ len, fmt, args); ++ va_end(args); ++} ++ ++static void crashlog_do_dump(struct kmsg_dumper *dumper, ++ enum kmsg_dump_reason reason) ++{ ++ struct timeval tv; ++ struct module *m; ++ char *buf; ++ size_t len; ++ ++ if (!first) ++ crashlog_printf("\n===================================\n"); ++ ++ do_gettimeofday(&tv); ++ crashlog_printf("Time: %lu.%lu\n", ++ (long)tv.tv_sec, (long)tv.tv_usec); ++ ++ if (first) { ++ crashlog_printf("Modules:"); ++ list_for_each_entry(m, crashlog_modules, list) { ++ crashlog_printf("\t%s@%p+%x", m->name, ++ m->core_layout.base, m->core_layout.size, ++ m->init_layout.base, m->init_layout.size); ++ } ++ crashlog_printf("\n"); ++ first = false; ++ } ++ ++ buf = (char *)&crashlog_buf->data[crashlog_buf->len]; ++ ++ kmsg_dump_get_buffer(dumper, true, buf, get_maxlen(), &len); ++ ++ crashlog_buf->len += len; ++} ++ ++ ++int __init crashlog_init_fs(void) ++{ ++ struct page *pages[CRASHLOG_PAGES]; ++ pgprot_t prot; ++ int i; ++ ++ if (!crashlog_addr) { ++ printk("No memory allocated for crashlog\n"); ++ return -ENOMEM; ++ } ++ ++ printk("Crashlog allocated RAM at address 0x%lx\n", (unsigned long) crashlog_addr); ++ for (i = 0; i < CRASHLOG_PAGES; i++) ++ pages[i] = pfn_to_page((crashlog_addr >> PAGE_SHIFT) + i); ++ ++ prot = pgprot_writecombine(PAGE_KERNEL); ++ crashlog_buf = vmap(pages, CRASHLOG_PAGES, VM_MAP, prot); ++ ++ crashlog_copy(); ++ ++ crashlog_buf->magic = CRASHLOG_MAGIC; ++ crashlog_buf->len = 0; ++ ++ dump.max_reason = KMSG_DUMP_OOPS; ++ dump.dump = crashlog_do_dump; ++ kmsg_dump_register(&dump); ++ ++ return 0; ++} ++module_init(crashlog_init_fs); +--- a/kernel/module.c ++++ b/kernel/module.c +@@ -256,6 +256,9 @@ static void mod_update_bounds(struct mod + #ifdef CONFIG_KGDB_KDB + struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ + #endif /* CONFIG_KGDB_KDB */ ++#ifdef CONFIG_CRASHLOG ++struct list_head *crashlog_modules = &modules; ++#endif + + static void module_assert_mutex(void) + { +--- a/mm/bootmem.c ++++ b/mm/bootmem.c +@@ -15,6 +15,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -175,6 +176,7 @@ static unsigned long __init free_all_boo + if (!bdata->node_bootmem_map) + return 0; + ++ crashlog_init_bootmem(bdata); + map = bdata->node_bootmem_map; + start = bdata->node_min_pfn; + end = bdata->node_low_pfn; +--- a/mm/memblock.c ++++ b/mm/memblock.c +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -483,6 +484,8 @@ static void __init_memblock memblock_ins + memblock_set_region_node(rgn, nid); + type->cnt++; + type->total_size += size; ++ if (type == &memblock.memory) ++ crashlog_init_memblock(base, size); + } + + /** +@@ -522,6 +525,8 @@ int __init_memblock memblock_add_range(s + type->regions[0].flags = flags; + memblock_set_region_node(&type->regions[0], nid); + type->total_size = size; ++ if (type == &memblock.memory) ++ crashlog_init_memblock(base, size); + return 0; + } + repeat: diff --git a/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch b/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch new file mode 100644 index 000000000..b1c65f7cd --- /dev/null +++ b/target/linux/generic/pending-4.14/100-MIPS-fix-cache-flushing-for-highmem-pages.patch @@ -0,0 +1,30 @@ +From: Felix Fietkau +Subject: MIPS: fix cache flushing for highmem pages + +Most cache flush ops were no-op for highmem pages. This led to nasty +segfaults and (in the case of page_address(page) == NULL) kernel +crashes. + +Fix this by always flushing highmem pages using kmap/kunmap_atomic +around the actual cache flush. This might be a bit inefficient, but at +least it's stable. + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/cache.c ++++ b/arch/mips/mm/cache.c +@@ -116,6 +116,13 @@ void __flush_anon_page(struct page *page + { + unsigned long addr = (unsigned long) page_address(page); + ++ if (PageHighMem(page)) { ++ addr = (unsigned long)kmap_atomic(page); ++ flush_data_cache_page(addr); ++ __kunmap_atomic((void *)addr); ++ return; ++ } ++ + if (pages_do_alias(addr, vmaddr)) { + if (page_mapcount(page) && !Page_dcache_dirty(page)) { + void *kaddr; diff --git a/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch b/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch new file mode 100644 index 000000000..b45b1c079 --- /dev/null +++ b/target/linux/generic/pending-4.14/110-ehci_hcd_ignore_oc.patch @@ -0,0 +1,79 @@ +From: Florian Fainelli +Subject: USB: EHCI: add ignore_oc flag to disable overcurrent checking + +This patch adds an ignore_oc flag which can be set by EHCI controller +not supporting or wanting to disable overcurrent checking. The EHCI +platform data in include/linux/usb/ehci_pdriver.h is also augmented to +take advantage of this new flag. + +Signed-off-by: Florian Fainelli +--- + drivers/usb/host/ehci-hcd.c | 2 +- + drivers/usb/host/ehci-hub.c | 4 ++-- + drivers/usb/host/ehci-platform.c | 1 + + drivers/usb/host/ehci.h | 1 + + include/linux/usb/ehci_pdriver.h | 1 + + 5 files changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -651,7 +651,7 @@ static int ehci_run (struct usb_hcd *hcd + "USB %x.%x started, EHCI %x.%02x%s\n", + ((ehci->sbrn & 0xf0)>>4), (ehci->sbrn & 0x0f), + temp >> 8, temp & 0xff, +- ignore_oc ? ", overcurrent ignored" : ""); ++ (ignore_oc || ehci->ignore_oc) ? ", overcurrent ignored" : ""); + + ehci_writel(ehci, INTR_MASK, + &ehci->regs->intr_enable); /* Turn On Interrupts */ +--- a/drivers/usb/host/ehci-hub.c ++++ b/drivers/usb/host/ehci-hub.c +@@ -646,7 +646,7 @@ ehci_hub_status_data (struct usb_hcd *hc + * always set, seem to clear PORT_OCC and PORT_CSC when writing to + * PORT_POWER; that's surprising, but maybe within-spec. + */ +- if (!ignore_oc) ++ if (!ignore_oc && !ehci->ignore_oc) + mask = PORT_CSC | PORT_PEC | PORT_OCC; + else + mask = PORT_CSC | PORT_PEC; +@@ -1016,7 +1016,7 @@ int ehci_hub_control( + if (temp & PORT_PEC) + status |= USB_PORT_STAT_C_ENABLE << 16; + +- if ((temp & PORT_OCC) && !ignore_oc){ ++ if ((temp & PORT_OCC) && (!ignore_oc && !ehci->ignore_oc)){ + status |= USB_PORT_STAT_C_OVERCURRENT << 16; + + /* +--- a/drivers/usb/host/ehci-platform.c ++++ b/drivers/usb/host/ehci-platform.c +@@ -263,6 +263,8 @@ static int ehci_platform_probe(struct pl + hcd->has_tt = 1; + if (pdata->reset_on_resume) + priv->reset_on_resume = true; ++ if (pdata->ignore_oc) ++ ehci->ignore_oc = 1; + + #ifndef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO + if (ehci->big_endian_mmio) { +--- a/drivers/usb/host/ehci.h ++++ b/drivers/usb/host/ehci.h +@@ -231,6 +231,7 @@ struct ehci_hcd { /* one per controlle + unsigned frame_index_bug:1; /* MosChip (AKA NetMos) */ + unsigned need_oc_pp_cycle:1; /* MPC834X port power */ + unsigned imx28_write_fix:1; /* For Freescale i.MX28 */ ++ unsigned ignore_oc:1; + + /* required for usb32 quirk */ + #define OHCI_CTRL_HCFS (3 << 6) +--- a/include/linux/usb/ehci_pdriver.h ++++ b/include/linux/usb/ehci_pdriver.h +@@ -49,6 +49,7 @@ struct usb_ehci_pdata { + unsigned no_io_watchdog:1; + unsigned reset_on_resume:1; + unsigned dma_mask_64:1; ++ unsigned ignore_oc:1; + + /* Turn on all power and clocks */ + int (*power_on)(struct platform_device *pdev); diff --git a/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch new file mode 100644 index 000000000..fbf998138 --- /dev/null +++ b/target/linux/generic/pending-4.14/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -0,0 +1,82 @@ +From: Tobias Wolf +Subject: mm: Fix alloc_node_mem_map with ARCH_PFN_OFFSET calculation + +An rt288x (ralink) based router (Belkin F5D8235 v1) does not boot with any +kernel beyond version 4.3 resulting in: + +BUG: Bad page state in process swapper pfn:086ac + +bisect resulted in: + +a1c34a3bf00af2cede839879502e12dc68491ad5 is the first bad commit +commit a1c34a3bf00af2cede839879502e12dc68491ad5 +Author: Laura Abbott +Date: Thu Nov 5 18:48:46 2015 -0800 + + mm: Don't offset memmap for flatmem + + Srinivas Kandagatla reported bad page messages when trying to remove the + bottom 2MB on an ARM based IFC6410 board + + BUG: Bad page state in process swapper pfn:fffa8 + page:ef7fb500 count:0 mapcount:0 mapping: (null) index:0x0 + flags: 0x96640253(locked|error|dirty|active|arch_1|reclaim|mlocked) + page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set + bad because of flags: + flags: 0x200041(locked|active|mlocked) + Modules linked in: + CPU: 0 PID: 0 Comm: swapper Not tainted 3.19.0-rc3-00007-g412f9ba-dirty +#816 + Hardware name: Qualcomm (Flattened Device Tree) + unwind_backtrace + show_stack + dump_stack + bad_page + free_pages_prepare + free_hot_cold_page + __free_pages + free_highmem_page + mem_init + start_kernel + Disabling lock debugging due to kernel taint + [...] +:040000 040000 2de013c372345fd471cd58f0553c9b38b0ef1cc4 +0a8156f848733dfa21e16c196dfb6c0a76290709 M mm + +This fix for ARM does not account ARCH_PFN_OFFSET for mem_map as later used by +page_to_pfn anymore. + +The following output was generated with two hacked in printk statements: + +printk("before %p vs. %p or %p\n", mem_map, mem_map - offset, mem_map - +(pgdat->node_start_pfn - ARCH_PFN_OFFSET)); + if (page_to_pfn(mem_map) != pgdat->node_start_pfn) + mem_map -= offset + (pgdat->node_start_pfn - ARCH_PFN_OFFSET); +printk("after %p\n", mem_map); + +Output: + +[ 0.000000] before 8861b280 vs. 8861b280 or 8851b280 +[ 0.000000] after 8851b280 + +As seen in the first line mem_map with subtraction of offset does not equal the +mem_map after subtraction of ARCH_PFN_OFFSET. + +After adding the offset of ARCH_PFN_OFFSET as well to mem_map as the +previously calculated offset is zero for the named platform it is able to boot +4.4 and 4.9-rc7 again. + +Signed-off-by: Tobias Wolf +--- + +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -6170,7 +6170,7 @@ static void __ref alloc_node_mem_map(str + mem_map = NODE_DATA(0)->node_mem_map; + #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) + if (page_to_pfn(mem_map) != pgdat->node_start_pfn) +- mem_map -= offset; ++ mem_map -= offset + (pgdat->node_start_pfn - ARCH_PFN_OFFSET); + #endif /* CONFIG_HAVE_MEMBLOCK_NODE_MAP */ + } + #endif diff --git a/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch b/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch new file mode 100644 index 000000000..b00fb8ee2 --- /dev/null +++ b/target/linux/generic/pending-4.14/130-add-linux-spidev-compatible-si3210.patch @@ -0,0 +1,18 @@ +From: Giuseppe Lippolis +Subject: Add the linux,spidev compatible in spidev Several device in ramips have this binding in the dts + +Signed-off-by: Giuseppe Lippolis +--- + drivers/spi/spidev.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/spi/spidev.c ++++ b/drivers/spi/spidev.c +@@ -669,6 +669,7 @@ static const struct of_device_id spidev_ + { .compatible = "lineartechnology,ltc2488" }, + { .compatible = "ge,achc" }, + { .compatible = "semtech,sx1301" }, ++ { .compatible = "siliconlabs,si3210" }, + {}, + }; + MODULE_DEVICE_TABLE(of, spidev_dt_ids); diff --git a/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch b/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch new file mode 100644 index 000000000..9603385ae --- /dev/null +++ b/target/linux/generic/pending-4.14/131-spi-use-gpio_set_value_cansleep-for-setting-chipsele.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: spi: use gpio_set_value_cansleep for setting chipselect GPIO + +Sleeping is safe inside spi_transfer_one_message, and some GPIO chips +need to sleep for setting values + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/spi/spi.c ++++ b/drivers/spi/spi.c +@@ -729,7 +729,7 @@ static void spi_set_cs(struct spi_device + enable = !enable; + + if (gpio_is_valid(spi->cs_gpio)) { +- gpio_set_value(spi->cs_gpio, !enable); ++ gpio_set_value_cansleep(spi->cs_gpio, !enable); + /* Some SPI masters need both GPIO CS & slave_select */ + if ((spi->controller->flags & SPI_MASTER_GPIO_SS) && + spi->controller->set_cs) diff --git a/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch b/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch new file mode 100644 index 000000000..b9bb3f71f --- /dev/null +++ b/target/linux/generic/pending-4.14/140-jffs2-use-.rename2-and-add-RENAME_WHITEOUT-support.patch @@ -0,0 +1,62 @@ +From: Felix Fietkau +Subject: jffs2: use .rename2 and add RENAME_WHITEOUT support + +It is required for renames on overlayfs + +Signed-off-by: Felix Fietkau +--- + +--- a/fs/jffs2/dir.c ++++ b/fs/jffs2/dir.c +@@ -756,6 +756,24 @@ static int jffs2_mknod (struct inode *di + return ret; + } + ++static int jffs2_whiteout (struct inode *old_dir, struct dentry *old_dentry) ++{ ++ struct dentry *wh; ++ int err; ++ ++ wh = d_alloc(old_dentry->d_parent, &old_dentry->d_name); ++ if (!wh) ++ return -ENOMEM; ++ ++ err = jffs2_mknod(old_dir, wh, S_IFCHR | WHITEOUT_MODE, ++ WHITEOUT_DEV); ++ if (err) ++ return err; ++ ++ d_rehash(wh); ++ return 0; ++} ++ + static int jffs2_rename (struct inode *old_dir_i, struct dentry *old_dentry, + struct inode *new_dir_i, struct dentry *new_dentry, + unsigned int flags) +@@ -766,7 +784,7 @@ static int jffs2_rename (struct inode *o + uint8_t type; + uint32_t now; + +- if (flags & ~RENAME_NOREPLACE) ++ if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT)) + return -EINVAL; + + /* The VFS will check for us and prevent trying to rename a +@@ -832,9 +850,14 @@ static int jffs2_rename (struct inode *o + if (d_is_dir(old_dentry) && !victim_f) + inc_nlink(new_dir_i); + +- /* Unlink the original */ +- ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), +- old_dentry->d_name.name, old_dentry->d_name.len, NULL, now); ++ if (flags & RENAME_WHITEOUT) ++ /* Replace with whiteout */ ++ ret = jffs2_whiteout(old_dir_i, old_dentry); ++ else ++ /* Unlink the original */ ++ ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), ++ old_dentry->d_name.name, ++ old_dentry->d_name.len, NULL, now); + + /* We don't touch inode->i_nlink */ + diff --git a/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch b/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch new file mode 100644 index 000000000..4b30bc7cd --- /dev/null +++ b/target/linux/generic/pending-4.14/141-jffs2-add-RENAME_EXCHANGE-support.patch @@ -0,0 +1,73 @@ +From: Felix Fietkau +Subject: jffs2: add RENAME_EXCHANGE support + +Signed-off-by: Felix Fietkau +--- + +--- a/fs/jffs2/dir.c ++++ b/fs/jffs2/dir.c +@@ -781,18 +781,31 @@ static int jffs2_rename (struct inode *o + int ret; + struct jffs2_sb_info *c = JFFS2_SB_INFO(old_dir_i->i_sb); + struct jffs2_inode_info *victim_f = NULL; ++ struct inode *fst_inode = d_inode(old_dentry); ++ struct inode *snd_inode = d_inode(new_dentry); + uint8_t type; + uint32_t now; + +- if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT)) ++ if (flags & ~(RENAME_NOREPLACE|RENAME_WHITEOUT|RENAME_EXCHANGE)) + return -EINVAL; + ++ if ((flags & RENAME_EXCHANGE) && (old_dir_i != new_dir_i)) { ++ if (S_ISDIR(fst_inode->i_mode) && !S_ISDIR(snd_inode->i_mode)) { ++ inc_nlink(new_dir_i); ++ drop_nlink(old_dir_i); ++ } ++ else if (!S_ISDIR(fst_inode->i_mode) && S_ISDIR(snd_inode->i_mode)) { ++ drop_nlink(new_dir_i); ++ inc_nlink(old_dir_i); ++ } ++ } ++ + /* The VFS will check for us and prevent trying to rename a + * file over a directory and vice versa, but if it's a directory, + * the VFS can't check whether the victim is empty. The filesystem + * needs to do that for itself. + */ +- if (d_really_is_positive(new_dentry)) { ++ if (d_really_is_positive(new_dentry) && !(flags & RENAME_EXCHANGE)) { + victim_f = JFFS2_INODE_INFO(d_inode(new_dentry)); + if (d_is_dir(new_dentry)) { + struct jffs2_full_dirent *fd; +@@ -827,7 +840,7 @@ static int jffs2_rename (struct inode *o + if (ret) + return ret; + +- if (victim_f) { ++ if (victim_f && !(flags & RENAME_EXCHANGE)) { + /* There was a victim. Kill it off nicely */ + if (d_is_dir(new_dentry)) + clear_nlink(d_inode(new_dentry)); +@@ -853,6 +866,12 @@ static int jffs2_rename (struct inode *o + if (flags & RENAME_WHITEOUT) + /* Replace with whiteout */ + ret = jffs2_whiteout(old_dir_i, old_dentry); ++ else if (flags & RENAME_EXCHANGE) ++ /* Replace the original */ ++ ret = jffs2_do_link(c, JFFS2_INODE_INFO(old_dir_i), ++ d_inode(new_dentry)->i_ino, type, ++ old_dentry->d_name.name, old_dentry->d_name.len, ++ now); + else + /* Unlink the original */ + ret = jffs2_do_unlink(c, JFFS2_INODE_INFO(old_dir_i), +@@ -884,7 +903,7 @@ static int jffs2_rename (struct inode *o + return ret; + } + +- if (d_is_dir(old_dentry)) ++ if (d_is_dir(old_dentry) && !(flags & RENAME_EXCHANGE)) + drop_nlink(old_dir_i); + + new_dir_i->i_mtime = new_dir_i->i_ctime = old_dir_i->i_mtime = old_dir_i->i_ctime = ITIME(now); diff --git a/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch new file mode 100644 index 000000000..03267310a --- /dev/null +++ b/target/linux/generic/pending-4.14/150-bridge_allow_receiption_on_disabled_port.patch @@ -0,0 +1,43 @@ +From: Stephen Hemminger +Subject: bridge: allow receiption on disabled port + +When an ethernet device is enslaved to a bridge, and the bridge STP +detects loss of carrier (or operational state down), then normally +packet receiption is blocked. + +This breaks control applications like WPA which maybe expecting to +receive packets to negotiate to bring link up. The bridge needs to +block forwarding packets from these disabled ports, but there is no +hard requirement to not allow local packet delivery. + +Signed-off-by: Stephen Hemminger +Signed-off-by: Felix Fietkau + +--- a/net/bridge/br_input.c ++++ b/net/bridge/br_input.c +@@ -238,7 +238,8 @@ static int br_handle_local_finish(struct + { + struct net_bridge_port *p = br_port_get_rcu(skb->dev); + +- __br_handle_local_finish(skb); ++ if (p->state != BR_STATE_DISABLED) ++ __br_handle_local_finish(skb); + + BR_INPUT_SKB_CB(skb)->brdev = p->br->dev; + br_pass_frame_up(skb); +@@ -326,6 +327,15 @@ rx_handler_result_t br_handle_frame(stru + + forward: + switch (p->state) { ++ case BR_STATE_DISABLED: ++ if (ether_addr_equal(p->br->dev->dev_addr, dest)) ++ skb->pkt_type = PACKET_HOST; ++ ++ NF_HOOK(NFPROTO_BRIDGE, NF_BR_PRE_ROUTING, ++ dev_net(skb->dev), NULL, skb, skb->dev, NULL, ++ br_handle_local_finish); ++ break; ++ + case BR_STATE_FORWARDING: + rhook = rcu_dereference(br_should_route_hook); + if (rhook) { diff --git a/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch new file mode 100644 index 000000000..2706f13dc --- /dev/null +++ b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -0,0 +1,161 @@ +From: Hauke Mehrtens +Subject: mtd: part: add generic parsing of linux,part-probe + +This moves the linux,part-probe device tree parsing code from +physmap_of.c to mtdpart.c. Now all drivers can use this feature by just +providing a reference to their device tree node in struct +mtd_part_parser_data. + +Signed-off-by: Hauke Mehrtens +--- + Documentation/devicetree/bindings/mtd/nand.txt | 16 +++++++++ + drivers/mtd/maps/physmap_of.c | 46 +------------------------- + drivers/mtd/mtdpart.c | 45 +++++++++++++++++++++++++ + 3 files changed, 62 insertions(+), 45 deletions(-) + +--- a/Documentation/devicetree/bindings/mtd/nand.txt ++++ b/Documentation/devicetree/bindings/mtd/nand.txt +@@ -44,6 +44,22 @@ Optional NAND chip properties: + used by the upper layers, and you want to make your NAND + as reliable as possible. + ++- linux,part-probe: list of name as strings of the partition parser ++ which should be used to parse the partition table. ++ They will be tried in the specified ordering and ++ the next one will be used if the previous one ++ failed. ++ ++ Example: linux,part-probe = "cmdlinepart", "ofpart"; ++ ++ This is also the default value, which will be used ++ if this attribute is not specified. It could be ++ that the flash driver in use overwrote the default ++ value and uses some other default. ++ ++ Possible values are: bcm47xxpart, afs, ar7part, ++ ofoldpart, ofpart, bcm63xxpart, RedBoot, cmdlinepart ++ + The ECC strength and ECC step size properties define the correction capability + of a controller. Together, they say a controller can correct "{strength} bit + errors per {size} bytes". +--- a/drivers/mtd/maps/physmap_of_core.c ++++ b/drivers/mtd/maps/physmap_of_core.c +@@ -114,37 +114,9 @@ static struct mtd_info *obsolete_probe(s + static const char * const part_probe_types_def[] = { + "cmdlinepart", "RedBoot", "ofpart", "ofoldpart", NULL }; + +-static const char * const *of_get_probes(struct device_node *dp) +-{ +- const char **res; +- int count; +- +- count = of_property_count_strings(dp, "linux,part-probe"); +- if (count < 0) +- return part_probe_types_def; +- +- res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL); +- if (!res) +- return NULL; +- +- count = of_property_read_string_array(dp, "linux,part-probe", res, +- count); +- if (count < 0) +- return NULL; +- +- return res; +-} +- +-static void of_free_probes(const char * const *probes) +-{ +- if (probes != part_probe_types_def) +- kfree(probes); +-} +- + static const struct of_device_id of_flash_match[]; + static int of_flash_probe(struct platform_device *dev) + { +- const char * const *part_probe_types; + const struct of_device_id *match; + struct device_node *dp = dev->dev.of_node; + struct resource res; +@@ -310,14 +282,8 @@ static int of_flash_probe(struct platfor + + info->cmtd->dev.parent = &dev->dev; + mtd_set_of_node(info->cmtd, dp); +- part_probe_types = of_get_probes(dp); +- if (!part_probe_types) { +- err = -ENOMEM; +- goto err_out; +- } +- mtd_device_parse_register(info->cmtd, part_probe_types, NULL, ++ mtd_device_parse_register(info->cmtd, part_probe_types_def, NULL, + NULL, 0); +- of_free_probes(part_probe_types); + + kfree(mtd_list); + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + + #include "mtdcore.h" +@@ -863,6 +864,32 @@ void deregister_mtd_parser(struct mtd_pa + EXPORT_SYMBOL_GPL(deregister_mtd_parser); + + /* ++ * Parses the linux,part-probe device tree property. ++ * When a non null value is returned it has to be freed with kfree() by ++ * the caller. ++ */ ++static const char * const *of_get_probes(struct device_node *dp) ++{ ++ const char **res; ++ int count; ++ ++ count = of_property_count_strings(dp, "linux,part-probe"); ++ if (count < 0) ++ return NULL; ++ ++ res = kzalloc((count + 1) * sizeof(*res), GFP_KERNEL); ++ if (!res) ++ return NULL; ++ ++ count = of_property_read_string_array(dp, "linux,part-probe", res, ++ count); ++ if (count < 0) ++ return NULL; ++ ++ return res; ++} ++ ++/* + * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you + * are changing this array! + */ +@@ -920,6 +947,13 @@ int parse_mtd_partitions(struct mtd_info + { + struct mtd_part_parser *parser; + int ret, err = 0; ++ const char *const *types_of = NULL; ++ ++ if (mtd_get_of_node(master)) { ++ types_of = of_get_probes(mtd_get_of_node(master)); ++ if (types_of != NULL) ++ types = types_of; ++ } + + if (!types) + types = default_mtd_part_types; +@@ -945,6 +979,7 @@ int parse_mtd_partitions(struct mtd_info + if (ret < 0 && !err) + err = ret; + } ++ kfree(types_of); + return err; + } + diff --git a/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch b/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch new file mode 100644 index 000000000..3b1a41a23 --- /dev/null +++ b/target/linux/generic/pending-4.14/180-net-phy-at803x-add-support-for-AT8032.patch @@ -0,0 +1,70 @@ +From: Felix Fietkau +Subject: net: phy: at803x: add support for AT8032 + +Like AT8030, this PHY needs the GPIO reset workaround + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -62,6 +62,7 @@ + + #define ATH8030_PHY_ID 0x004dd076 + #define ATH8031_PHY_ID 0x004dd074 ++#define ATH8032_PHY_ID 0x004dd023 + #define ATH8035_PHY_ID 0x004dd072 + #define AT803X_PHY_ID_MASK 0xffffffef + +@@ -260,7 +261,8 @@ static int at803x_probe(struct phy_devic + if (!priv) + return -ENOMEM; + +- if (phydev->drv->phy_id != ATH8030_PHY_ID) ++ if (phydev->drv->phy_id != ATH8030_PHY_ID && ++ phydev->drv->phy_id != ATH8032_PHY_ID) + goto does_not_require_reset_workaround; + + gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); +@@ -336,7 +338,7 @@ static void at803x_link_change_notify(st + struct at803x_priv *priv = phydev->priv; + + /* +- * Conduct a hardware reset for AT8030 every time a link loss is ++ * Conduct a hardware reset for AT8030/2 every time a link loss is + * signalled. This is necessary to circumvent a hardware bug that + * occurs when the cable is unplugged while TX packets are pending + * in the FIFO. In such cases, the FIFO enters an error mode it +@@ -448,6 +450,24 @@ static struct phy_driver at803x_driver[] + .aneg_done = at803x_aneg_done, + .ack_interrupt = &at803x_ack_interrupt, + .config_intr = &at803x_config_intr, ++}, { ++ /* ATHEROS 8032 */ ++ .phy_id = ATH8032_PHY_ID, ++ .name = "Atheros 8032 ethernet", ++ .phy_id_mask = 0xffffffef, ++ .probe = at803x_probe, ++ .config_init = at803x_config_init, ++ .link_change_notify = at803x_link_change_notify, ++ .set_wol = at803x_set_wol, ++ .get_wol = at803x_get_wol, ++ .suspend = at803x_suspend, ++ .resume = at803x_resume, ++ .features = PHY_BASIC_FEATURES, ++ .flags = PHY_HAS_INTERRUPT, ++ .config_aneg = genphy_config_aneg, ++ .read_status = genphy_read_status, ++ .ack_interrupt = at803x_ack_interrupt, ++ .config_intr = at803x_config_intr, + } }; + + module_phy_driver(at803x_driver); +@@ -455,6 +475,7 @@ module_phy_driver(at803x_driver); + static struct mdio_device_id __maybe_unused atheros_tbl[] = { + { ATH8030_PHY_ID, AT803X_PHY_ID_MASK }, + { ATH8031_PHY_ID, AT803X_PHY_ID_MASK }, ++ { ATH8032_PHY_ID, AT803X_PHY_ID_MASK }, + { ATH8035_PHY_ID, AT803X_PHY_ID_MASK }, + { } + }; diff --git a/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch b/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch new file mode 100644 index 000000000..d8aea32b5 --- /dev/null +++ b/target/linux/generic/pending-4.14/190-2-5-e1000e-Fix-wrong-comment-related-to-link-detection.patch @@ -0,0 +1,43 @@ +From patchwork Fri Jul 21 18:36:24 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [2/5] e1000e: Fix wrong comment related to link detection +From: Benjamin Poirier +X-Patchwork-Id: 9857489 +Message-Id: <20170721183627.13373-2-bpoirier@suse.com> +To: Jeff Kirsher +Cc: Lennart Sorensen , + intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, + linux-kernel@vger.kernel.org +Date: Fri, 21 Jul 2017 11:36:24 -0700 + +Reading e1000e_check_for_copper_link() shows that get_link_status is set to +false after link has been detected. Therefore, it stays TRUE until then. + +Signed-off-by: Benjamin Poirier +Tested-by: Aaron Brown +--- + drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/intel/e1000e/netdev.c ++++ b/drivers/net/ethernet/intel/e1000e/netdev.c +@@ -5096,7 +5096,7 @@ static bool e1000e_has_link(struct e1000 + + /* get_link_status is set on LSC (link status) interrupt or + * Rx sequence error interrupt. get_link_status will stay +- * false until the check_for_link establishes link ++ * true until the check_for_link establishes link + * for copper adapters ONLY + */ + switch (hw->phy.media_type) { +@@ -5114,7 +5114,7 @@ static bool e1000e_has_link(struct e1000 + break; + case e1000_media_type_internal_serdes: + ret_val = hw->mac.ops.check_for_link(hw); +- link_active = adapter->hw.mac.serdes_has_link; ++ link_active = hw->mac.serdes_has_link; + break; + default: + case e1000_media_type_unknown: diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch new file mode 100644 index 000000000..71883755c --- /dev/null +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Subject: Upgrade to Linux 2.6.19 + +- Includes large parts of the patch from #1021 by dpalffy +- Includes RB532 NAND driver changes by n0-1 + +[john@phrozen.org: feix will add this to his upstream queue] + +lede-commit: bff468813f78f81e36ebb2a3f4354de7365e640f +Signed-off-by: Felix Fietkau +--- + Makefile | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -637,12 +637,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni + + ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE + KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) +-KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) ++KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + else + ifdef CONFIG_PROFILE_ALL_BRANCHES +-KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) ++KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION) + else +-KBUILD_CFLAGS += -O2 ++KBUILD_CFLAGS += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION) + endif + endif + diff --git a/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch new file mode 100644 index 000000000..fa68f307d --- /dev/null +++ b/target/linux/generic/pending-4.14/203-kallsyms_uncompressed.patch @@ -0,0 +1,119 @@ +From: Felix Fietkau +Subject: kernel: add a config option for keeping the kallsyms table uncompressed, saving ~9kb kernel size after lzma on ar71xx + +[john@phrozen.org: added to my upstream queue 30.12.2016] +lede-commit: e0e3509b5ce2ccf93d4d67ea907613f5f7ec2eed +Signed-off-by: Felix Fietkau +--- + init/Kconfig | 11 +++++++++++ + kernel/kallsyms.c | 8 ++++++++ + scripts/kallsyms.c | 12 ++++++++++++ + scripts/link-vmlinux.sh | 4 ++++ + 4 files changed, 35 insertions(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1081,6 +1081,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW + the unaligned access emulation. + see arch/parisc/kernel/unaligned.c for reference + ++config KALLSYMS_UNCOMPRESSED ++ bool "Keep kallsyms uncompressed" ++ depends on KALLSYMS ++ help ++ Normally kallsyms contains compressed symbols (using a token table), ++ reducing the uncompressed kernel image size. Keeping the symbol table ++ uncompressed significantly improves the size of this part in compressed ++ kernel images. ++ ++ Say N unless you need compressed kernel images to be small. ++ + config HAVE_PCSPKR_PLATFORM + bool + +--- a/kernel/kallsyms.c ++++ b/kernel/kallsyms.c +@@ -108,6 +108,11 @@ static unsigned int kallsyms_expand_symb + * For every byte on the compressed symbol data, copy the table + * entry for that byte. + */ ++#ifdef CONFIG_KALLSYMS_UNCOMPRESSED ++ memcpy(result, data + 1, len - 1); ++ result += len - 1; ++ len = 0; ++#endif + while (len) { + tptr = &kallsyms_token_table[kallsyms_token_index[*data]]; + data++; +@@ -140,6 +145,9 @@ tail: + */ + static char kallsyms_get_symbol_type(unsigned int off) + { ++#ifdef CONFIG_KALLSYMS_UNCOMPRESSED ++ return kallsyms_names[off + 1]; ++#endif + /* + * Get just the first code, look it up in the token table, + * and return the first char from this token. +--- a/scripts/kallsyms.c ++++ b/scripts/kallsyms.c +@@ -61,6 +61,7 @@ static struct addr_range percpu_range = + static struct sym_entry *table; + static unsigned int table_size, table_cnt; + static int all_symbols = 0; ++static int uncompressed = 0; + static int absolute_percpu = 0; + static char symbol_prefix_char = '\0'; + static int base_relative = 0; +@@ -457,6 +458,9 @@ static void write_src(void) + + free(markers); + ++ if (uncompressed) ++ return; ++ + output_label("kallsyms_token_table"); + off = 0; + for (i = 0; i < 256; i++) { +@@ -515,6 +519,9 @@ static void *find_token(unsigned char *s + { + int i; + ++ if (uncompressed) ++ return NULL; ++ + for (i = 0; i < len - 1; i++) { + if (str[i] == token[0] && str[i+1] == token[1]) + return &str[i]; +@@ -587,6 +594,9 @@ static void optimize_result(void) + { + int i, best; + ++ if (uncompressed) ++ return; ++ + /* using the '\0' symbol last allows compress_symbols to use standard + * fast string functions */ + for (i = 255; i >= 0; i--) { +@@ -775,6 +785,8 @@ int main(int argc, char **argv) + symbol_prefix_char = *p; + } else if (strcmp(argv[i], "--base-relative") == 0) + base_relative = 1; ++ else if (strcmp(argv[i], "--uncompressed") == 0) ++ uncompressed = 1; + else + usage(); + } +--- a/scripts/link-vmlinux.sh ++++ b/scripts/link-vmlinux.sh +@@ -164,6 +164,10 @@ kallsyms() + kallsymopt="${kallsymopt} --base-relative" + fi + ++ if [ -n "${CONFIG_KALLSYMS_UNCOMPRESSED}" ]; then ++ kallsymopt="${kallsymopt} --uncompressed" ++ fi ++ + local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \ + ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS}" + diff --git a/target/linux/generic/pending-4.14/205-backtrace_module_info.patch b/target/linux/generic/pending-4.14/205-backtrace_module_info.patch new file mode 100644 index 000000000..4040f9102 --- /dev/null +++ b/target/linux/generic/pending-4.14/205-backtrace_module_info.patch @@ -0,0 +1,45 @@ +From: Felix Fietkau +Subject: kernel: when KALLSYMS is disabled, print module address + size for matching backtrace entries + +[john@phrozen.org: felix will add this to his upstream queue] + +lede-commit 53827cdc824556cda910b23ce5030c363b8f1461 +Signed-off-by: Felix Fietkau +--- + lib/vsprintf.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +--- a/lib/vsprintf.c ++++ b/lib/vsprintf.c +@@ -670,8 +670,10 @@ char *symbol_string(char *buf, char *end + struct printf_spec spec, const char *fmt) + { + unsigned long value; +-#ifdef CONFIG_KALLSYMS + char sym[KSYM_SYMBOL_LEN]; ++#ifndef CONFIG_KALLSYMS ++ struct module *mod; ++ int len; + #endif + + if (fmt[1] == 'R') +@@ -685,11 +687,16 @@ char *symbol_string(char *buf, char *end + sprint_symbol(sym, value); + else + sprint_symbol_no_offset(sym, value); +- +- return string(buf, end, sym, spec); + #else +- return special_hex_number(buf, end, value, sizeof(void *)); ++ len = snprintf(sym, sizeof(sym), "0x%lx", value); ++ ++ mod = __module_address(value); ++ if (mod) ++ snprintf(sym + len, sizeof(sym) - len, " [%s@%p+0x%x]", ++ mod->name, mod->core_layout.base, ++ mod->core_layout.size); + #endif ++ return string(buf, end, sym, spec); + } + + static noinline_for_stack diff --git a/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch b/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch new file mode 100644 index 000000000..f3c58dcd3 --- /dev/null +++ b/target/linux/generic/pending-4.14/206-mips-disable-vdso.patch @@ -0,0 +1,23 @@ +From: Felix Fietkau +Subject: kernel: disable MIPS VDSO by default until the cache issues have been resolved + +lede-commit: 1185e645a773c86aa88cf04d0e2911dc62eb43f5 +Signed-off-by: Felix Fietkau +--- + arch/mips/vdso/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/mips/vdso/Makefile ++++ b/arch/mips/vdso/Makefile +@@ -30,9 +30,9 @@ aflags-vdso := $(ccflags-vdso) \ + ifndef CONFIG_CPU_MIPSR6 + ifeq ($(call ld-ifversion, -lt, 225000000, y),y) + $(warning MIPS VDSO requires binutils >= 2.25) +- obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) +- ccflags-vdso += -DDISABLE_MIPS_VDSO + endif ++ obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y)) ++ ccflags-vdso += -DDISABLE_MIPS_VDSO + endif + + # VDSO linker flags. diff --git a/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch b/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch new file mode 100644 index 000000000..f440305c9 --- /dev/null +++ b/target/linux/generic/pending-4.14/240-remove-unsane-filenames-from-deps_initramfs-list.patch @@ -0,0 +1,46 @@ +From: Gabor Juhos +Subject: usr: sanitize deps_initramfs list + +If any filename in the intramfs dependency +list contains a colon, that causes a kernel +build error like this: + +/devel/openwrt/build_dir/linux-ar71xx_generic/linux-3.6.6/usr/Makefile:58: *** multiple target patterns. Stop. +make[5]: *** [usr] Error 2 + +Fix it by removing such filenames from the +deps_initramfs list. + +Signed-off-by: Gabor Juhos +--- + usr/Makefile | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/usr/Makefile ++++ b/usr/Makefile +@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y) + include $(obj)/$(datafile_d_y) + endif + ++deps_initramfs_sane := $(foreach v,$(deps_initramfs),$(if $(findstring :,$(v)),,$(v))) ++ + quiet_cmd_initfs = GEN $@ + cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) + + targets := $(datafile_y) + + # do not try to update files included in initramfs +-$(deps_initramfs): ; ++$(deps_initramfs_sane): ; + +-$(deps_initramfs): klibcdirs ++$(deps_initramfs_sane): klibcdirs + # We rebuild initramfs_data.cpio if: + # 1) Any included file is newer then initramfs_data.cpio + # 2) There are changes in which files are included (added or deleted) + # 3) If gen_init_cpio are newer than initramfs_data.cpio + # 4) arguments to gen_initramfs.sh changes +-$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs ++$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs_sane) klibcdirs + $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y) + $(call if_changed,initfs) diff --git a/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch b/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch new file mode 100644 index 000000000..9955ab3c0 --- /dev/null +++ b/target/linux/generic/pending-4.14/261-enable_wilink_platform_without_drivers.patch @@ -0,0 +1,20 @@ +From: Imre Kaloz +Subject: [PATCH] hack: net: wireless: make the wl12xx glue code available with + compat-wireless, too + +Signed-off-by: Imre Kaloz +--- + drivers/net/wireless/ti/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/wireless/ti/Kconfig ++++ b/drivers/net/wireless/ti/Kconfig +@@ -19,7 +19,7 @@ source "drivers/net/wireless/ti/wlcore/K + + config WILINK_PLATFORM_DATA + bool "TI WiLink platform data" +- depends on WLCORE_SDIO || WL1251_SDIO ++ depends on WLCORE_SDIO || WL1251_SDIO || ARCH_OMAP2PLUS + default y + ---help--- + Small platform data bit needed to pass data to the sdio modules. diff --git a/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch new file mode 100644 index 000000000..9ec8daf88 --- /dev/null +++ b/target/linux/generic/pending-4.14/270-uapi-kernel.h-glibc-specific-inclusion-of-sysinfo.h.patch @@ -0,0 +1,32 @@ +From: David Heidelberger +Subject: uapi/kernel.h: glibc specific inclusion of sysinfo.h + +including sysinfo.h from kernel.h makes no sense whatsoever, +but removing it breaks glibc's userspace header, +which includes kernel.h instead of sysinfo.h from their sys/sysinfo.h. +this seems to be a historical mistake. +on musl, including any header that uses kernel.h directly or indirectly +plus sys/sysinfo.h will produce a compile error due to redefinition of +struct sysinfo from sys/sysinfo.h. +so for now, only include it on glibc or when including from kernel +in order not to break their headers. + +Signed-off-by: John Spencer +Signed-off-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/kernel.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/uapi/linux/kernel.h ++++ b/include/uapi/linux/kernel.h +@@ -2,7 +2,9 @@ + #ifndef _UAPI_LINUX_KERNEL_H + #define _UAPI_LINUX_KERNEL_H + ++#if defined(__KERNEL__) || defined( __GLIBC__) + #include ++#endif + + /* + * 'kernel.h' contains some often-used function prototypes etc diff --git a/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch new file mode 100644 index 000000000..9ae148da4 --- /dev/null +++ b/target/linux/generic/pending-4.14/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -0,0 +1,105 @@ +From: David Heidelberger +Subject: uapi/libc-compat.h: do not rely on __GLIBC__ + +Musl provides the same structs as glibc, but does not provide a define to +allow its detection. Since the absence of __GLIBC__ also can mean that it +is included from the kernel, change the __GLIBC__ detection to +!__KERNEL__, which should always be true when included from userspace. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/libc-compat.h | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -49,13 +49,13 @@ + #ifndef _UAPI_LIBC_COMPAT_H + #define _UAPI_LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We have included libc headers... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc net/if.h header. */ +-#if defined(_NET_IF_H) && defined(__USE_MISC) ++/* Coordinate with libc net/if.h header. */ ++#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + + #define __UAPI_DEF_IF_IFCONF 0 +@@ -66,7 +66,11 @@ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO ++#ifdef __GLIBC__ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 ++#else ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 ++#endif + #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ + + #else /* _NET_IF_H */ +@@ -86,10 +90,10 @@ + + #endif /* _NET_IF_H */ + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + #define __UAPI_DEF_IN_ADDR 0 + #define __UAPI_DEF_IN_IPPROTO 0 +@@ -103,7 +107,7 @@ + * if the glibc code didn't define them. This guard matches + * the guard in glibc/inet/netinet/in.h which defines the + * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) ++#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 + #else + #define __UAPI_DEF_IN6_ADDR_ALT 1 +@@ -118,7 +122,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that the libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -128,7 +132,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and the libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -169,7 +173,7 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ + + /* Definitions for if.h */ + #define __UAPI_DEF_IF_IFCONF 1 +@@ -209,6 +213,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* __KERNEL__ */ + + #endif /* _UAPI_LIBC_COMPAT_H */ diff --git a/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch new file mode 100644 index 000000000..1dca07328 --- /dev/null +++ b/target/linux/generic/pending-4.14/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -0,0 +1,65 @@ +From: David Heidelberger +Subject: uapi/if_ether.h: prevent redefinition of struct ethhdr + +Musl provides its own ethhdr struct definition. Add a guard to prevent +its definition of the appropriate musl header has already been included. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/if_ether.h | 3 +++ + include/uapi/linux/libc-compat.h | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,6 +23,7 @@ + #define _UAPI_LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -149,11 +150,13 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + + #endif /* _UAPI_LINUX_IF_ETHER_H */ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -90,6 +90,14 @@ + + #endif /* _NET_IF_H */ + ++/* musl defines the ethhdr struct itself in its netinet/if_ether.h. ++ * Glibc just includes the kernel header and uses a different guard. */ ++#if defined(_NETINET_IF_ETHER_H) ++#define __UAPI_DEF_ETHHDR 0 ++#else ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + /* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +@@ -185,6 +193,9 @@ + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 + ++/* Definitions for if_ether.h */ ++#define __UAPI_DEF_ETHHDR 1 ++ + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 diff --git a/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch new file mode 100644 index 000000000..9419e9916 --- /dev/null +++ b/target/linux/generic/pending-4.14/300-mips_expose_boot_raw.patch @@ -0,0 +1,40 @@ +From: Mark Miller +Subject: mips: expose CONFIG_BOOT_RAW + +This exposes the CONFIG_BOOT_RAW symbol in Kconfig. This is needed on +certain Broadcom chipsets running CFE in order to load the kernel. + +Signed-off-by: Mark Miller +Acked-by: Rob Landley +--- +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -1066,9 +1066,6 @@ config FW_ARC + config ARCH_MAY_HAVE_PC_FDC + bool + +-config BOOT_RAW +- bool +- + config CEVT_BCM1480 + bool + +@@ -2966,6 +2963,18 @@ choice + bool "Extend builtin kernel arguments with bootloader arguments" + endchoice + ++config BOOT_RAW ++ bool "Enable the kernel to be executed from the load address" ++ default n ++ help ++ Allow the kernel to be executed from the load address for ++ bootloaders which cannot read the ELF format. This places ++ a jump to start_kernel at the load address. ++ ++ If unsure, say N. ++ ++ ++ + endmenu + + config LOCKDEP_SUPPORT diff --git a/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch b/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch new file mode 100644 index 000000000..0e4600237 --- /dev/null +++ b/target/linux/generic/pending-4.14/302-mips_no_branch_likely.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: mips: use -mno-branch-likely for kernel and userspace + +saves ~11k kernel size after lzma and ~12k squashfs size in the + +lede-commit: 41a039f46450ffae9483d6216422098669da2900 +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -90,7 +90,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin + # machines may also. Since BFD is incredibly buggy with respect to + # crossformat linking we rely on the elf2ecoff tool for format conversion. + # +-cflags-y += -G 0 -mno-abicalls -fno-pic -pipe ++cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely + cflags-y += -msoft-float + LDFLAGS_vmlinux += -G 0 -static -n -nostdlib + KBUILD_AFLAGS_MODULE += -mlong-calls diff --git a/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch new file mode 100644 index 000000000..bee62b266 --- /dev/null +++ b/target/linux/generic/pending-4.14/304-mips_disable_fpu.patch @@ -0,0 +1,137 @@ +From: Manuel Lauss +Subject: [RFC PATCH v4 2/2] MIPS: make FPU emulator optional + +This small patch makes the MIPS FPU emulator optional. The kernel +kills float-users on systems without a hardware FPU by sending a SIGILL. + +Disabling the emulator shrinks vmlinux by about 54kBytes (32bit, +optimizing for size). + +Signed-off-by: Manuel Lauss +--- +v4: rediffed because of patch 1/2, should now work with micromips as well +v3: updated patch description with size savings. +v2: incorporated changes suggested by Jonas Gorski + force the fpu emulator on for micromips: relocating the parts + of the mmips code in the emulator to other areas would be a + much larger change; I went the cheap route instead with this. + + arch/mips/Kbuild | 2 +- + arch/mips/Kconfig | 14 ++++++++++++++ + arch/mips/include/asm/fpu.h | 5 +++-- + arch/mips/include/asm/fpu_emulator.h | 15 +++++++++++++++ + 4 files changed, 33 insertions(+), 3 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -2890,6 +2890,20 @@ config MIPS_O32_FP64_SUPPORT + + If unsure, say N. + ++config MIPS_FPU_EMULATOR ++ bool "MIPS FPU Emulator" ++ default y ++ help ++ This option lets you disable the built-in MIPS FPU (Coprocessor 1) ++ emulator, which handles floating-point instructions on processors ++ without a hardware FPU. It is generally a good idea to keep the ++ emulator built-in, unless you are perfectly sure you have a ++ complete soft-float environment. With the emulator disabled, all ++ users of float operations will be killed with an illegal instr- ++ uction exception. ++ ++ Say Y, please. ++ + config USE_OF + bool + select OF +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -319,7 +319,7 @@ OBJCOPYFLAGS += --remove-section=.regin + head-y := arch/mips/kernel/head.o + + libs-y += arch/mips/lib/ +-libs-y += arch/mips/math-emu/ ++libs-$(CONFIG_MIPS_FPU_EMULATOR) += arch/mips/math-emu/ + + # See arch/mips/Kbuild for content of core part of the kernel + core-y += arch/mips/ +--- a/arch/mips/include/asm/fpu.h ++++ b/arch/mips/include/asm/fpu.h +@@ -230,8 +230,10 @@ static inline int init_fpu(void) + /* Restore FRE */ + write_c0_config5(config5); + enable_fpu_hazard(); +- } else ++ } else if (IS_ENABLED(CONFIG_MIPS_FPU_EMULATOR)) + fpu_emulator_init_fpu(); ++ else ++ ret = SIGILL; + + return ret; + } +--- a/arch/mips/include/asm/fpu_emulator.h ++++ b/arch/mips/include/asm/fpu_emulator.h +@@ -30,6 +30,7 @@ + #include + #include + ++#ifdef CONFIG_MIPS_FPU_EMULATOR + #ifdef CONFIG_DEBUG_FS + + struct mips_fpu_emulator_stats { +@@ -179,6 +180,16 @@ do { \ + extern int fpu_emulator_cop1Handler(struct pt_regs *xcp, + struct mips_fpu_struct *ctx, int has_fpu, + void __user **fault_addr); ++#else /* no CONFIG_MIPS_FPU_EMULATOR */ ++static inline int fpu_emulator_cop1Handler(struct pt_regs *xcp, ++ struct mips_fpu_struct *ctx, int has_fpu, ++ void __user **fault_addr) ++{ ++ *fault_addr = NULL; ++ return SIGILL; /* we don't speak MIPS FPU */ ++} ++#endif /* CONFIG_MIPS_FPU_EMULATOR */ ++ + void force_fcr31_sig(unsigned long fcr31, void __user *fault_addr, + struct task_struct *tsk); + int process_fpemu_return(int sig, void __user *fault_addr, +--- a/arch/mips/include/asm/dsemul.h ++++ b/arch/mips/include/asm/dsemul.h +@@ -41,6 +41,7 @@ struct task_struct; + extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir, + unsigned long branch_pc, unsigned long cont_pc); + ++#ifdef CONFIG_MIPS_FPU_EMULATOR + /** + * do_dsemulret() - Return from a delay slot 'emulation' frame + * @xcp: User thread register context. +@@ -88,5 +89,27 @@ extern bool dsemul_thread_rollback(struc + * before @mm is freed in order to avoid memory leaks. + */ + extern void dsemul_mm_cleanup(struct mm_struct *mm); ++#else ++static inline bool do_dsemulret(struct pt_regs *xcp) ++{ ++ return false; ++} ++ ++static inline bool dsemul_thread_cleanup(struct task_struct *tsk) ++{ ++ return false; ++} ++ ++static inline bool dsemul_thread_rollback(struct pt_regs *regs) ++{ ++ return false; ++} ++ ++static inline void dsemul_mm_cleanup(struct mm_struct *mm) ++{ ++ ++} ++ ++#endif + + #endif /* __MIPS_ASM_DSEMUL_H__ */ diff --git a/target/linux/generic/pending-4.14/305-mips_module_reloc.patch b/target/linux/generic/pending-4.14/305-mips_module_reloc.patch new file mode 100644 index 000000000..253b50f62 --- /dev/null +++ b/target/linux/generic/pending-4.14/305-mips_module_reloc.patch @@ -0,0 +1,366 @@ +From: Felix Fietkau +Subject: mips: replace -mlong-calls with -mno-long-calls to make function calls faster in kernel modules to achieve this, try to + +lede-commit: 3b3d64743ba2a874df9d70cd19e242205b0a788c +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 5 + + arch/mips/include/asm/module.h | 5 + + arch/mips/kernel/module.c | 279 ++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 284 insertions(+), 5 deletions(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -93,8 +93,13 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin + cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely + cflags-y += -msoft-float + LDFLAGS_vmlinux += -G 0 -static -n -nostdlib ++ifdef CONFIG_64BIT + KBUILD_AFLAGS_MODULE += -mlong-calls + KBUILD_CFLAGS_MODULE += -mlong-calls ++else ++KBUILD_AFLAGS_MODULE += -mno-long-calls ++KBUILD_CFLAGS_MODULE += -mno-long-calls ++endif + + ifeq ($(CONFIG_RELOCATABLE),y) + LDFLAGS_vmlinux += --emit-relocs +--- a/arch/mips/include/asm/module.h ++++ b/arch/mips/include/asm/module.h +@@ -12,6 +12,11 @@ struct mod_arch_specific { + const struct exception_table_entry *dbe_start; + const struct exception_table_entry *dbe_end; + struct mips_hi16 *r_mips_hi16_list; ++ ++ void *phys_plt_tbl; ++ void *virt_plt_tbl; ++ unsigned int phys_plt_offset; ++ unsigned int virt_plt_offset; + }; + + typedef uint8_t Elf64_Byte; /* Type for a 8-bit quantity. */ +--- a/arch/mips/kernel/module.c ++++ b/arch/mips/kernel/module.c +@@ -44,14 +44,221 @@ struct mips_hi16 { + static LIST_HEAD(dbe_list); + static DEFINE_SPINLOCK(dbe_lock); + +-#ifdef MODULE_START ++/* ++ * Get the potential max trampolines size required of the init and ++ * non-init sections. Only used if we cannot find enough contiguous ++ * physically mapped memory to put the module into. ++ */ ++static unsigned int ++get_plt_size(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, ++ const char *secstrings, unsigned int symindex, bool is_init) ++{ ++ unsigned long ret = 0; ++ unsigned int i, j; ++ Elf_Sym *syms; ++ ++ /* Everything marked ALLOC (this includes the exported symbols) */ ++ for (i = 1; i < hdr->e_shnum; ++i) { ++ unsigned int info = sechdrs[i].sh_info; ++ ++ if (sechdrs[i].sh_type != SHT_REL ++ && sechdrs[i].sh_type != SHT_RELA) ++ continue; ++ ++ /* Not a valid relocation section? */ ++ if (info >= hdr->e_shnum) ++ continue; ++ ++ /* Don't bother with non-allocated sections */ ++ if (!(sechdrs[info].sh_flags & SHF_ALLOC)) ++ continue; ++ ++ /* If it's called *.init*, and we're not init, we're ++ not interested */ ++ if ((strstr(secstrings + sechdrs[i].sh_name, ".init") != 0) ++ != is_init) ++ continue; ++ ++ syms = (Elf_Sym *) sechdrs[symindex].sh_addr; ++ if (sechdrs[i].sh_type == SHT_REL) { ++ Elf_Mips_Rel *rel = (void *) sechdrs[i].sh_addr; ++ unsigned int size = sechdrs[i].sh_size / sizeof(*rel); ++ ++ for (j = 0; j < size; ++j) { ++ Elf_Sym *sym; ++ ++ if (ELF_MIPS_R_TYPE(rel[j]) != R_MIPS_26) ++ continue; ++ ++ sym = syms + ELF_MIPS_R_SYM(rel[j]); ++ if (!is_init && sym->st_shndx != SHN_UNDEF) ++ continue; ++ ++ ret += 4 * sizeof(int); ++ } ++ } else { ++ Elf_Mips_Rela *rela = (void *) sechdrs[i].sh_addr; ++ unsigned int size = sechdrs[i].sh_size / sizeof(*rela); ++ ++ for (j = 0; j < size; ++j) { ++ Elf_Sym *sym; ++ ++ if (ELF_MIPS_R_TYPE(rela[j]) != R_MIPS_26) ++ continue; ++ ++ sym = syms + ELF_MIPS_R_SYM(rela[j]); ++ if (!is_init && sym->st_shndx != SHN_UNDEF) ++ continue; ++ ++ ret += 4 * sizeof(int); ++ } ++ } ++ } ++ ++ return ret; ++} ++ ++#ifndef MODULE_START ++static void *alloc_phys(unsigned long size) ++{ ++ unsigned order; ++ struct page *page; ++ struct page *p; ++ ++ size = PAGE_ALIGN(size); ++ order = get_order(size); ++ ++ page = alloc_pages(GFP_KERNEL | __GFP_NORETRY | __GFP_NOWARN | ++ __GFP_THISNODE, order); ++ if (!page) ++ return NULL; ++ ++ split_page(page, order); ++ ++ /* mark all pages except for the last one */ ++ for (p = page; p + 1 < page + (size >> PAGE_SHIFT); ++p) ++ set_bit(PG_owner_priv_1, &p->flags); ++ ++ for (p = page + (size >> PAGE_SHIFT); p < page + (1 << order); ++p) ++ __free_page(p); ++ ++ return page_address(page); ++} ++#endif ++ ++static void free_phys(void *ptr) ++{ ++ struct page *page; ++ bool free; ++ ++ page = virt_to_page(ptr); ++ do { ++ free = test_and_clear_bit(PG_owner_priv_1, &page->flags); ++ __free_page(page); ++ page++; ++ } while (free); ++} ++ ++ + void *module_alloc(unsigned long size) + { ++#ifdef MODULE_START + return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END, + GFP_KERNEL, PAGE_KERNEL, 0, NUMA_NO_NODE, + __builtin_return_address(0)); ++#else ++ void *ptr; ++ ++ if (size == 0) ++ return NULL; ++ ++ ptr = alloc_phys(size); ++ ++ /* If we failed to allocate physically contiguous memory, ++ * fall back to regular vmalloc. The module loader code will ++ * create jump tables to handle long jumps */ ++ if (!ptr) ++ return vmalloc(size); ++ ++ return ptr; ++#endif + } ++ ++static inline bool is_phys_addr(void *ptr) ++{ ++#ifdef CONFIG_64BIT ++ return (KSEGX((unsigned long)ptr) == CKSEG0); ++#else ++ return (KSEGX(ptr) == KSEG0); + #endif ++} ++ ++/* Free memory returned from module_alloc */ ++void module_memfree(void *module_region) ++{ ++ if (is_phys_addr(module_region)) ++ free_phys(module_region); ++ else ++ vfree(module_region); ++} ++ ++static void *__module_alloc(int size, bool phys) ++{ ++ void *ptr; ++ ++ if (phys) ++ ptr = kmalloc(size, GFP_KERNEL); ++ else ++ ptr = vmalloc(size); ++ return ptr; ++} ++ ++static void __module_free(void *ptr) ++{ ++ if (is_phys_addr(ptr)) ++ kfree(ptr); ++ else ++ vfree(ptr); ++} ++ ++int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, ++ char *secstrings, struct module *mod) ++{ ++ unsigned int symindex = 0; ++ unsigned int core_size, init_size; ++ int i; ++ ++ mod->arch.phys_plt_offset = 0; ++ mod->arch.virt_plt_offset = 0; ++ mod->arch.phys_plt_tbl = NULL; ++ mod->arch.virt_plt_tbl = NULL; ++ ++ if (IS_ENABLED(CONFIG_64BIT)) ++ return 0; ++ ++ for (i = 1; i < hdr->e_shnum; i++) ++ if (sechdrs[i].sh_type == SHT_SYMTAB) ++ symindex = i; ++ ++ core_size = get_plt_size(hdr, sechdrs, secstrings, symindex, false); ++ init_size = get_plt_size(hdr, sechdrs, secstrings, symindex, true); ++ ++ if ((core_size + init_size) == 0) ++ return 0; ++ ++ mod->arch.phys_plt_tbl = __module_alloc(core_size + init_size, 1); ++ if (!mod->arch.phys_plt_tbl) ++ return -ENOMEM; ++ ++ mod->arch.virt_plt_tbl = __module_alloc(core_size + init_size, 0); ++ if (!mod->arch.virt_plt_tbl) { ++ __module_free(mod->arch.phys_plt_tbl); ++ mod->arch.phys_plt_tbl = NULL; ++ return -ENOMEM; ++ } ++ ++ return 0; ++} + + static int apply_r_mips_none(struct module *me, u32 *location, + u32 base, Elf_Addr v, bool rela) +@@ -67,9 +274,40 @@ static int apply_r_mips_32(struct module + return 0; + } + ++static Elf_Addr add_plt_entry_to(unsigned *plt_offset, ++ void *start, Elf_Addr v) ++{ ++ unsigned *tramp = start + *plt_offset; ++ *plt_offset += 4 * sizeof(int); ++ ++ /* adjust carry for addiu */ ++ if (v & 0x00008000) ++ v += 0x10000; ++ ++ tramp[0] = 0x3c190000 | (v >> 16); /* lui t9, hi16 */ ++ tramp[1] = 0x27390000 | (v & 0xffff); /* addiu t9, t9, lo16 */ ++ tramp[2] = 0x03200008; /* jr t9 */ ++ tramp[3] = 0x00000000; /* nop */ ++ ++ return (Elf_Addr) tramp; ++} ++ ++static Elf_Addr add_plt_entry(struct module *me, void *location, Elf_Addr v) ++{ ++ if (is_phys_addr(location)) ++ return add_plt_entry_to(&me->arch.phys_plt_offset, ++ me->arch.phys_plt_tbl, v); ++ else ++ return add_plt_entry_to(&me->arch.virt_plt_offset, ++ me->arch.virt_plt_tbl, v); ++ ++} ++ + static int apply_r_mips_26(struct module *me, u32 *location, + u32 base, Elf_Addr v, bool rela) + { ++ u32 ofs = base & 0x03ffffff; ++ + if (v % 4) { + pr_err("module %s: dangerous R_MIPS_26 relocation\n", + me->name); +@@ -77,13 +315,17 @@ static int apply_r_mips_26(struct module + } + + if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) { +- pr_err("module %s: relocation overflow\n", +- me->name); +- return -ENOEXEC; ++ v = add_plt_entry(me, location, v + (ofs << 2)); ++ if (!v) { ++ pr_err("module %s: relocation overflow\n", ++ me->name); ++ return -ENOEXEC; ++ } ++ ofs = 0; + } + + *location = (*location & ~0x03ffffff) | +- ((base + (v >> 2)) & 0x03ffffff); ++ ((ofs + (v >> 2)) & 0x03ffffff); + + return 0; + } +@@ -459,9 +701,36 @@ int module_finalize(const Elf_Ehdr *hdr, + list_add(&me->arch.dbe_list, &dbe_list); + spin_unlock_irq(&dbe_lock); + } ++ ++ /* Get rid of the fixup trampoline if we're running the module ++ * from physically mapped address space */ ++ if (me->arch.phys_plt_offset == 0) { ++ __module_free(me->arch.phys_plt_tbl); ++ me->arch.phys_plt_tbl = NULL; ++ } ++ if (me->arch.virt_plt_offset == 0) { ++ __module_free(me->arch.virt_plt_tbl); ++ me->arch.virt_plt_tbl = NULL; ++ } ++ + return 0; + } + ++void module_arch_freeing_init(struct module *mod) ++{ ++ if (mod->state == MODULE_STATE_LIVE) ++ return; ++ ++ if (mod->arch.phys_plt_tbl) { ++ __module_free(mod->arch.phys_plt_tbl); ++ mod->arch.phys_plt_tbl = NULL; ++ } ++ if (mod->arch.virt_plt_tbl) { ++ __module_free(mod->arch.virt_plt_tbl); ++ mod->arch.virt_plt_tbl = NULL; ++ } ++} ++ + void module_arch_cleanup(struct module *mod) + { + spin_lock_irq(&dbe_lock); diff --git a/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch b/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch new file mode 100644 index 000000000..e73cfd61b --- /dev/null +++ b/target/linux/generic/pending-4.14/306-mips_mem_functions_performance.patch @@ -0,0 +1,106 @@ +From: Felix Fietkau +Subject: [PATCH] mips: allow the compiler to optimize memset, memcmp, memcpy for better performance and (in some instances) smaller code + +lede-commit: 07e59c7bc7f375f792ec9734be42fe4fa391a8bb +Signed-off-by: Felix Fietkau +--- + arch/mips/boot/compressed/Makefile | 3 ++- + arch/mips/include/asm/string.h | 38 ++++++++++++++++++++++++++++++++++++++ + arch/mips/lib/Makefile | 2 +- + arch/mips/lib/memcmp.c | 22 ++++++++++++++++++++++ + 4 files changed, 63 insertions(+), 2 deletions(-) + create mode 100644 arch/mips/lib/memcmp.c + +--- a/arch/mips/boot/compressed/Makefile ++++ b/arch/mips/boot/compressed/Makefile +@@ -23,7 +23,8 @@ KBUILD_CFLAGS := $(filter-out -pg, $(KBU + KBUILD_CFLAGS := $(filter-out -fstack-protector, $(KBUILD_CFLAGS)) + + KBUILD_CFLAGS := $(KBUILD_CFLAGS) -D__KERNEL__ \ +- -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" ++ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) -D"VMLINUX_LOAD_ADDRESS_ULL=$(VMLINUX_LOAD_ADDRESS)ull" \ ++ -D__ZBOOT__ + + KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ + -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ +--- a/arch/mips/include/asm/string.h ++++ b/arch/mips/include/asm/string.h +@@ -140,4 +140,42 @@ extern void *memcpy(void *__to, __const_ + #define __HAVE_ARCH_MEMMOVE + extern void *memmove(void *__dest, __const__ void *__src, size_t __n); + ++#ifndef __ZBOOT__ ++#define memset(__s, __c, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memset((__s), (__c), __len); \ ++ else \ ++ __ret = __builtin_memset((__s), (__c), __len); \ ++ __ret; \ ++}) ++ ++#define memcpy(dst, src, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memcpy((dst), (src), __len); \ ++ else \ ++ __ret = __builtin_memcpy((dst), (src), __len); \ ++ __ret; \ ++}) ++ ++#define memmove(dst, src, len) \ ++({ \ ++ size_t __len = (len); \ ++ void *__ret; \ ++ if (__builtin_constant_p(len) && __len >= 64) \ ++ __ret = memmove((dst), (src), __len); \ ++ else \ ++ __ret = __builtin_memmove((dst), (src), __len); \ ++ __ret; \ ++}) ++ ++#define __HAVE_ARCH_MEMCMP ++#define memcmp(src1, src2, len) __builtin_memcmp((src1), (src2), (len)) ++#endif ++ + #endif /* _ASM_STRING_H */ +--- a/arch/mips/lib/Makefile ++++ b/arch/mips/lib/Makefile +@@ -5,7 +5,7 @@ + + lib-y += bitops.o csum_partial.o delay.o memcpy.o memset.o \ + mips-atomic.o strncpy_user.o \ +- strnlen_user.o uncached.o ++ strnlen_user.o uncached.o memcmp.o + + obj-y += iomap.o iomap_copy.o + obj-$(CONFIG_PCI) += iomap-pci.o +--- /dev/null ++++ b/arch/mips/lib/memcmp.c +@@ -0,0 +1,22 @@ ++/* ++ * copied from linux/lib/string.c ++ * ++ * Copyright (C) 1991, 1992 Linus Torvalds ++ */ ++ ++#include ++#include ++ ++#undef memcmp ++int memcmp(const void *cs, const void *ct, size_t count) ++{ ++ const unsigned char *su1, *su2; ++ int res = 0; ++ ++ for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) ++ if ((res = *su1 - *su2) != 0) ++ break; ++ return res; ++} ++EXPORT_SYMBOL(memcmp); ++ diff --git a/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch b/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch new file mode 100644 index 000000000..0529b0c5c --- /dev/null +++ b/target/linux/generic/pending-4.14/307-mips_highmem_offset.patch @@ -0,0 +1,19 @@ +From: Felix Fietkau +Subject: kernel: adjust mips highmem offset to avoid the need for -mlong-calls on systems with >256M RAM + +Signed-off-by: Felix Fietkau +--- + arch/mips/include/asm/mach-generic/spaces.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/include/asm/mach-generic/spaces.h ++++ b/arch/mips/include/asm/mach-generic/spaces.h +@@ -46,7 +46,7 @@ + * Memory above this physical address will be considered highmem. + */ + #ifndef HIGHMEM_START +-#define HIGHMEM_START _AC(0x20000000, UL) ++#define HIGHMEM_START _AC(0x10000000, UL) + #endif + + #endif /* CONFIG_32BIT */ diff --git a/target/linux/generic/pending-4.14/308-mips32r2_tune.patch b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch new file mode 100644 index 000000000..7f98616d7 --- /dev/null +++ b/target/linux/generic/pending-4.14/308-mips32r2_tune.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: kernel: add -mtune=34kc to MIPS CFLAGS when building for mips32r2 + +This provides a good tradeoff across at least 24Kc-74Kc, while also +producing smaller code. + +Signed-off-by: Felix Fietkau +--- + arch/mips/Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -162,7 +162,7 @@ cflags-$(CONFIG_CPU_R4X00) += -march=r46 + cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R1) += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32 -Wa,--trap +-cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ ++cflags-$(CONFIG_CPU_MIPS32_R2) += $(call cc-option,-march=mips32r2 -mtune=34kc,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \ + -Wa,-mips32r2 -Wa,--trap + cflags-$(CONFIG_CPU_MIPS32_R6) += -march=mips32r6 -Wa,--trap -modd-spreg + cflags-$(CONFIG_CPU_MIPS64_R1) += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \ diff --git a/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch b/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch new file mode 100644 index 000000000..bc9f0a4c4 --- /dev/null +++ b/target/linux/generic/pending-4.14/310-arm_module_unresolved_weak_sym.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: fix errors in unresolved weak symbols on arm + +lede-commit: 570699d4838a907c3ef9f2819bf19eb72997b32f +Signed-off-by: Felix Fietkau +--- + arch/arm/kernel/module.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/arm/kernel/module.c ++++ b/arch/arm/kernel/module.c +@@ -95,6 +95,10 @@ apply_relocate(Elf32_Shdr *sechdrs, cons + return -ENOEXEC; + } + ++ if ((IS_ERR_VALUE(sym->st_value) || !sym->st_value) && ++ ELF_ST_BIND(sym->st_info) == STB_WEAK) ++ continue; ++ + loc = dstsec->sh_addr + rel->r_offset; + + switch (ELF32_R_TYPE(rel->r_info)) { diff --git a/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch new file mode 100644 index 000000000..5cdcc2b24 --- /dev/null +++ b/target/linux/generic/pending-4.14/330-MIPS-kexec-Accept-command-line-parameters-from-users.patch @@ -0,0 +1,272 @@ +From: Yousong Zhou +Subject: MIPS: kexec: Accept command line parameters from userspace. + +Signed-off-by: Yousong Zhou +--- + arch/mips/kernel/machine_kexec.c | 153 +++++++++++++++++++++++++++++++----- + arch/mips/kernel/machine_kexec.h | 20 +++++ + arch/mips/kernel/relocate_kernel.S | 21 +++-- + 3 files changed, 167 insertions(+), 27 deletions(-) + create mode 100644 arch/mips/kernel/machine_kexec.h + +--- a/arch/mips/kernel/machine_kexec.c ++++ b/arch/mips/kernel/machine_kexec.c +@@ -10,14 +10,11 @@ + #include + #include + ++#include + #include + #include +- +-extern const unsigned char relocate_new_kernel[]; +-extern const size_t relocate_new_kernel_size; +- +-extern unsigned long kexec_start_address; +-extern unsigned long kexec_indirection_page; ++#include ++#include "machine_kexec.h" + + int (*_machine_kexec_prepare)(struct kimage *) = NULL; + void (*_machine_kexec_shutdown)(void) = NULL; +@@ -28,6 +25,99 @@ atomic_t kexec_ready_to_reboot = ATOMIC_ + void (*_crash_smp_send_stop)(void) = NULL; + #endif + ++static void machine_kexec_print_args(void) ++{ ++ unsigned long argc = (int)kexec_args[0]; ++ int i; ++ ++ pr_info("kexec_args[0] (argc): %lu\n", argc); ++ pr_info("kexec_args[1] (argv): %p\n", (void *)kexec_args[1]); ++ pr_info("kexec_args[2] (env ): %p\n", (void *)kexec_args[2]); ++ pr_info("kexec_args[3] (desc): %p\n", (void *)kexec_args[3]); ++ ++ for (i = 0; i < argc; i++) { ++ pr_info("kexec_argv[%d] = %p, %s\n", ++ i, kexec_argv[i], kexec_argv[i]); ++ } ++} ++ ++static void machine_kexec_init_argv(struct kimage *image) ++{ ++ void __user *buf = NULL; ++ size_t bufsz; ++ size_t size; ++ int i; ++ ++ bufsz = 0; ++ for (i = 0; i < image->nr_segments; i++) { ++ struct kexec_segment *seg; ++ ++ seg = &image->segment[i]; ++ if (seg->bufsz < 6) ++ continue; ++ ++ if (strncmp((char *) seg->buf, "kexec ", 6)) ++ continue; ++ ++ buf = seg->buf; ++ bufsz = seg->bufsz; ++ break; ++ } ++ ++ if (!buf) ++ return; ++ ++ size = KEXEC_COMMAND_LINE_SIZE; ++ size = min(size, bufsz); ++ if (size < bufsz) ++ pr_warn("kexec command line truncated to %zd bytes\n", size); ++ ++ /* Copy to kernel space */ ++ copy_from_user(kexec_argv_buf, buf, size); ++ kexec_argv_buf[size - 1] = 0; ++} ++ ++static void machine_kexec_parse_argv(struct kimage *image) ++{ ++ char *reboot_code_buffer; ++ int reloc_delta; ++ char *ptr; ++ int argc; ++ int i; ++ ++ ptr = kexec_argv_buf; ++ argc = 0; ++ ++ /* ++ * convert command line string to array of parameters ++ * (as bootloader does). ++ */ ++ while (ptr && *ptr && (KEXEC_MAX_ARGC > argc)) { ++ if (*ptr == ' ') { ++ *ptr++ = '\0'; ++ continue; ++ } ++ ++ kexec_argv[argc++] = ptr; ++ ptr = strchr(ptr, ' '); ++ } ++ ++ if (!argc) ++ return; ++ ++ kexec_args[0] = argc; ++ kexec_args[1] = (unsigned long)kexec_argv; ++ kexec_args[2] = 0; ++ kexec_args[3] = 0; ++ ++ reboot_code_buffer = page_address(image->control_code_page); ++ reloc_delta = reboot_code_buffer - (char *)kexec_relocate_new_kernel; ++ ++ kexec_args[1] += reloc_delta; ++ for (i = 0; i < argc; i++) ++ kexec_argv[i] += reloc_delta; ++} ++ + static void kexec_image_info(const struct kimage *kimage) + { + unsigned long i; +@@ -52,6 +142,18 @@ int + machine_kexec_prepare(struct kimage *kimage) + { + kexec_image_info(kimage); ++ /* ++ * Whenever arguments passed from kexec-tools, Init the arguments as ++ * the original ones to try avoiding booting failure. ++ */ ++ ++ kexec_args[0] = fw_arg0; ++ kexec_args[1] = fw_arg1; ++ kexec_args[2] = fw_arg2; ++ kexec_args[3] = fw_arg3; ++ ++ machine_kexec_init_argv(kimage); ++ machine_kexec_parse_argv(kimage); + + if (_machine_kexec_prepare) + return _machine_kexec_prepare(kimage); +@@ -89,10 +191,12 @@ machine_kexec(struct kimage *image) + unsigned long *ptr; + + reboot_code_buffer = +- (unsigned long)page_address(image->control_code_page); ++ (unsigned long)page_address(image->control_code_page); ++ pr_info("reboot_code_buffer = %p\n", (void *)reboot_code_buffer); + + kexec_start_address = + (unsigned long) phys_to_virt(image->start); ++ pr_info("kexec_start_address = %p\n", (void *)kexec_start_address); + + if (image->type == KEXEC_TYPE_DEFAULT) { + kexec_indirection_page = +@@ -100,9 +204,19 @@ machine_kexec(struct kimage *image) + } else { + kexec_indirection_page = (unsigned long)&image->head; + } ++ pr_info("kexec_indirection_page = %p\n", (void *)kexec_indirection_page); + +- memcpy((void*)reboot_code_buffer, relocate_new_kernel, +- relocate_new_kernel_size); ++ pr_info("Where is memcpy: %p\n", memcpy); ++ pr_info("kexec_relocate_new_kernel = %p, kexec_relocate_new_kernel_end = %p\n", ++ (void *)kexec_relocate_new_kernel, &kexec_relocate_new_kernel_end); ++ pr_info("Copy %lu bytes from %p to %p\n", KEXEC_RELOCATE_NEW_KERNEL_SIZE, ++ (void *)kexec_relocate_new_kernel, (void *)reboot_code_buffer); ++ memcpy((void*)reboot_code_buffer, kexec_relocate_new_kernel, ++ KEXEC_RELOCATE_NEW_KERNEL_SIZE); ++ ++ pr_info("Before _print_args().\n"); ++ machine_kexec_print_args(); ++ pr_info("Before eval loop.\n"); + + /* + * The generic kexec code builds a page list with physical +@@ -121,15 +235,16 @@ machine_kexec(struct kimage *image) + /* + * we do not want to be bothered. + */ ++ pr_info("Before irq_disable.\n"); + local_irq_disable(); + +- printk("Will call new kernel at %08lx\n", image->start); +- printk("Bye ...\n"); ++ pr_info("Will call new kernel at %08lx\n", image->start); ++ pr_info("Bye ...\n"); + __flush_cache_all(); + #ifdef CONFIG_SMP + /* All secondary cpus now may jump to kexec_wait cycle */ + relocated_kexec_smp_wait = reboot_code_buffer + +- (void *)(kexec_smp_wait - relocate_new_kernel); ++ (void *)(kexec_smp_wait - kexec_relocate_new_kernel); + smp_wmb(); + atomic_set(&kexec_ready_to_reboot, 1); + #endif +--- /dev/null ++++ b/arch/mips/kernel/machine_kexec.h +@@ -0,0 +1,20 @@ ++#ifndef _MACHINE_KEXEC_H ++#define _MACHINE_KEXEC_H ++ ++#ifndef __ASSEMBLY__ ++extern const unsigned char kexec_relocate_new_kernel[]; ++extern unsigned long kexec_relocate_new_kernel_end; ++extern unsigned long kexec_start_address; ++extern unsigned long kexec_indirection_page; ++ ++extern char kexec_argv_buf[]; ++extern char *kexec_argv[]; ++ ++#define KEXEC_RELOCATE_NEW_KERNEL_SIZE ((unsigned long)&kexec_relocate_new_kernel_end - (unsigned long)kexec_relocate_new_kernel) ++#endif /* !__ASSEMBLY__ */ ++ ++#define KEXEC_COMMAND_LINE_SIZE 256 ++#define KEXEC_ARGV_SIZE (KEXEC_COMMAND_LINE_SIZE / 16) ++#define KEXEC_MAX_ARGC (KEXEC_ARGV_SIZE / sizeof(long)) ++ ++#endif +--- a/arch/mips/kernel/relocate_kernel.S ++++ b/arch/mips/kernel/relocate_kernel.S +@@ -12,8 +12,9 @@ + #include + #include + #include ++#include "machine_kexec.h" + +-LEAF(relocate_new_kernel) ++LEAF(kexec_relocate_new_kernel) + PTR_L a0, arg0 + PTR_L a1, arg1 + PTR_L a2, arg2 +@@ -98,7 +99,7 @@ done: + #endif + /* jump to kexec_start_address */ + j s1 +- END(relocate_new_kernel) ++ END(kexec_relocate_new_kernel) + + #ifdef CONFIG_SMP + /* +@@ -184,9 +185,15 @@ kexec_indirection_page: + PTR 0 + .size kexec_indirection_page, PTRSIZE + +-relocate_new_kernel_end: ++kexec_argv_buf: ++ EXPORT(kexec_argv_buf) ++ .skip KEXEC_COMMAND_LINE_SIZE ++ .size kexec_argv_buf, KEXEC_COMMAND_LINE_SIZE ++ ++kexec_argv: ++ EXPORT(kexec_argv) ++ .skip KEXEC_ARGV_SIZE ++ .size kexec_argv, KEXEC_ARGV_SIZE + +-relocate_new_kernel_size: +- EXPORT(relocate_new_kernel_size) +- PTR relocate_new_kernel_end - relocate_new_kernel +- .size relocate_new_kernel_size, PTRSIZE ++kexec_relocate_new_kernel_end: ++ EXPORT(kexec_relocate_new_kernel_end) diff --git a/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch b/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch new file mode 100644 index 000000000..58f14b6ca --- /dev/null +++ b/target/linux/generic/pending-4.14/332-arc-add-OWRTDTB-section.patch @@ -0,0 +1,80 @@ +From: Alexey Brodkin +Subject: openwrt: arc - add OWRTDTB section + +This change allows OpenWRT to patch resulting kernel binary with +external .dtb. + +That allows us to re-use exactky the same vmlinux on different boards +given its ARC core configurations match (at least cache line sizes etc). + +""patch-dtb" searches for ASCII "OWRTDTB:" strign and copies external +.dtb right after it, keeping the string in place. + +Signed-off-by: Alexey Brodkin +--- + arch/arc/kernel/head.S | 10 ++++++++++ + arch/arc/kernel/setup.c | 4 +++- + arch/arc/kernel/vmlinux.lds.S | 13 +++++++++++++ + 3 files changed, 26 insertions(+), 1 deletion(-) + +--- a/arch/arc/kernel/head.S ++++ b/arch/arc/kernel/head.S +@@ -49,6 +49,16 @@ + 1: + .endm + ++; Here "patch-dtb" will embed external .dtb ++; Note "patch-dtb" searches for ASCII "OWRTDTB:" string ++; and pastes .dtb right after it, hense the string precedes ++; __image_dtb symbol. ++ .section .owrt, "aw",@progbits ++ .ascii "OWRTDTB:" ++ENTRY(__image_dtb) ++ .fill 0x4000 ++END(__image_dtb) ++ + .section .init.text, "ax",@progbits + + ;---------------------------------------------------------------- +--- a/arch/arc/kernel/setup.c ++++ b/arch/arc/kernel/setup.c +@@ -421,6 +421,8 @@ static inline int is_kernel(unsigned lon + return 0; + } + ++extern struct boot_param_header __image_dtb; ++ + void __init setup_arch(char **cmdline_p) + { + #ifdef CONFIG_ARC_UBOOT_SUPPORT +@@ -434,7 +436,7 @@ void __init setup_arch(char **cmdline_p) + #endif + { + /* No, so try the embedded one */ +- machine_desc = setup_machine_fdt(__dtb_start); ++ machine_desc = setup_machine_fdt(&__image_dtb); + if (!machine_desc) + panic("Embedded DT invalid\n"); + +--- a/arch/arc/kernel/vmlinux.lds.S ++++ b/arch/arc/kernel/vmlinux.lds.S +@@ -30,6 +30,19 @@ SECTIONS + + . = CONFIG_LINUX_LINK_BASE; + ++ /* ++ * In OpenWRT we want to patch built binary embedding .dtb of choice. ++ * This is implemented with "patch-dtb" utility which searches for ++ * "OWRTDTB:" string in first 16k of image and if it is found ++ * copies .dtb right after mentioned string. ++ * ++ * Note: "OWRTDTB:" won't be overwritten with .dtb, .dtb will follow it. ++ */ ++ .owrt : { ++ *(.owrt) ++ . = ALIGN(PAGE_SIZE); ++ } ++ + _int_vec_base_lds = .; + .vector : { + *(.vector) diff --git a/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch b/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch new file mode 100644 index 000000000..4e0265aef --- /dev/null +++ b/target/linux/generic/pending-4.14/333-arc-enable-unaligned-access-in-kernel-mode.patch @@ -0,0 +1,24 @@ +From: Alexey Brodkin +Subject: arc: enable unaligned access in kernel mode + +This enables misaligned access handling even in kernel mode. +Some wireless drivers (ath9k-htc and mt7601u) use misaligned accesses +here and there and to cope with that without fixing stuff in the drivers +we're just gracefully handling it on ARC. + +Signed-off-by: Alexey Brodkin +--- + arch/arc/kernel/unaligned.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arc/kernel/unaligned.c ++++ b/arch/arc/kernel/unaligned.c +@@ -206,7 +206,7 @@ int misaligned_fixup(unsigned long addre + char buf[TASK_COMM_LEN]; + + /* handle user mode only and only if enabled by sysadmin */ +- if (!user_mode(regs) || !unaligned_enabled) ++ if (!unaligned_enabled) + return 1; + + if (no_unaligned_warning) { diff --git a/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch b/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch new file mode 100644 index 000000000..8d6cada84 --- /dev/null +++ b/target/linux/generic/pending-4.14/340-MIPS-mm-remove-mips_dma_mapping_error.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:34:31 +0100 +Subject: [PATCH] MIPS: mm: remove mips_dma_mapping_error + +dma_mapping_error() already checks if ops->mapping_error is a null +pointer + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -373,11 +373,6 @@ static void mips_dma_sync_sg_for_device( + } + } + +-static int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) +-{ +- return 0; +-} +- + static int mips_dma_supported(struct device *dev, u64 mask) + { + return plat_dma_supported(dev, mask); +@@ -406,7 +401,6 @@ static const struct dma_map_ops mips_def + .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, + .sync_sg_for_device = mips_dma_sync_sg_for_device, +- .mapping_error = mips_dma_mapping_error, + .dma_supported = mips_dma_supported + }; + diff --git a/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch new file mode 100644 index 000000000..3cd87861a --- /dev/null +++ b/target/linux/generic/pending-4.14/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -0,0 +1,140 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:46:01 +0100 +Subject: [PATCH] MIPS: mm: remove no-op dma_map_ops where possible + +If no post-DMA flush is required, and the platform does not provide +plat_unmap_dma_mem(), there is no need to include unmap or sync_for_cpu +ops. + +With this patch they are compiled out to improve icache footprint +on devices that handle lots of DMA traffic (especially network routers). + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -220,6 +220,7 @@ config BMIPS_GENERIC + select BRCMSTB_L2_IRQ + select IRQ_MIPS_CPU + select DMA_NONCOHERENT ++ select DMA_UNMAP_POST_FLUSH + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_BIG_ENDIAN +@@ -345,6 +346,7 @@ config MACH_JAZZ + select CSRC_R4K + select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN + select GENERIC_ISA_DMA ++ select DMA_UNMAP_POST_FLUSH + select HAVE_PCSPKR_PLATFORM + select IRQ_MIPS_CPU + select I8253 +@@ -1127,6 +1129,9 @@ config DMA_NONCOHERENT + bool + select NEED_DMA_MAP_STATE + ++config DMA_UNMAP_POST_FLUSH ++ bool ++ + config NEED_DMA_MAP_STATE + bool + +@@ -1651,6 +1656,7 @@ config CPU_R10000 + select CPU_SUPPORTS_64BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + select CPU_SUPPORTS_HUGEPAGES ++ select DMA_UNMAP_POST_FLUSH + help + MIPS Technologies R10000-series processors. + +@@ -1899,9 +1905,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 + bool + + config SYS_HAS_CPU_MIPS32_R5 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS32_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS64_R1 +@@ -1911,6 +1919,7 @@ config SYS_HAS_CPU_MIPS64_R2 + bool + + config SYS_HAS_CPU_MIPS64_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_R3000 +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -267,8 +267,9 @@ static inline void __dma_sync(struct pag + } while (left); + } + +-static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, +- size_t size, enum dma_data_direction direction, unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction, unsigned long attrs) + { + if (cpu_needs_post_dma_flush(dev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) + __dma_sync(dma_addr_to_page(dev, dma_addr), +@@ -308,9 +309,10 @@ static dma_addr_t mips_dma_map_page(stru + return plat_map_dma_mem_page(dev, page) + offset; + } + +-static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, +- int nhwentries, enum dma_data_direction direction, +- unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, ++ int nhwentries, enum dma_data_direction direction, ++ unsigned long attrs) + { + int i; + struct scatterlist *sg; +@@ -325,8 +327,9 @@ static void mips_dma_unmap_sg(struct dev + } + } + +-static void mips_dma_sync_single_for_cpu(struct device *dev, +- dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, ++ size_t size, enum dma_data_direction direction) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_handle), +@@ -342,9 +345,9 @@ static void mips_dma_sync_single_for_dev + dma_handle & ~PAGE_MASK, size, direction); + } + +-static void mips_dma_sync_sg_for_cpu(struct device *dev, +- struct scatterlist *sglist, int nelems, +- enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, ++ int nelems, enum dma_data_direction direction) + { + int i; + struct scatterlist *sg; +@@ -394,12 +397,14 @@ static const struct dma_map_ops mips_def + .free = mips_dma_free_coherent, + .mmap = mips_dma_mmap, + .map_page = mips_dma_map_page, +- .unmap_page = mips_dma_unmap_page, + .map_sg = mips_dma_map_sg, ++#ifdef CONFIG_DMA_UNMAP_POST_FLUSH ++ .unmap_page = mips_dma_unmap_page, + .unmap_sg = mips_dma_unmap_sg, + .sync_single_for_cpu = mips_dma_sync_single_for_cpu, +- .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, ++#endif ++ .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_device = mips_dma_sync_sg_for_device, + .dma_supported = mips_dma_supported + }; diff --git a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch new file mode 100644 index 000000000..f0c852a69 --- /dev/null +++ b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch @@ -0,0 +1,123 @@ +From: Felix Fietkau +Subject: make rootfs split/detection more generic - patch can be moved to generic-2.6 after testing on other platforms + +lede-commit: 328e660b31f0937d52c5ae3d6e7029409918a9df +Signed-off-by: Felix Fietkau +--- + drivers/mtd/Kconfig | 17 +++++++++++++++++ + drivers/mtd/mtdpart.c | 35 +++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 3 files changed, 54 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -12,6 +12,23 @@ menuconfig MTD + + if MTD + ++menu "OpenWrt specific MTD options" ++ ++config MTD_ROOTFS_ROOT_DEV ++ bool "Automatically set 'rootfs' partition to be root filesystem" ++ default y ++ ++config MTD_SPLIT_FIRMWARE ++ bool "Automatically split firmware partition for kernel+rootfs" ++ default y ++ ++config MTD_SPLIT_FIRMWARE_NAME ++ string "Firmware partition name" ++ depends on MTD_SPLIT_FIRMWARE ++ default "firmware" ++ ++endmenu ++ + config MTD_TESTS + tristate "MTD tests support (DANGEROUS)" + depends on m +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -29,10 +29,12 @@ + #include + #include + #include ++#include + #include + #include + + #include "mtdcore.h" ++#include "mtdsplit/mtdsplit.h" + + /* Our partition linked list */ + static LIST_HEAD(mtd_partitions); +@@ -52,6 +54,8 @@ struct mtd_part { + struct list_head list; + }; + ++static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part); ++ + /* + * Given a pointer to the MTD object in the mtd_part structure, we can retrieve + * the pointer to that structure. +@@ -686,6 +690,7 @@ int mtd_add_partition(struct mtd_info *p + mutex_unlock(&mtd_partitions_mutex); + + add_mtd_device(&new->mtd); ++ mtd_partition_split(parent, new); + + mtd_add_partition_attrs(new); + +@@ -764,6 +769,35 @@ int mtd_del_partition(struct mtd_info *m + } + EXPORT_SYMBOL_GPL(mtd_del_partition); + ++#ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME ++#define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME ++#else ++#define SPLIT_FIRMWARE_NAME "unused" ++#endif ++ ++static void split_firmware(struct mtd_info *master, struct mtd_part *part) ++{ ++} ++ ++void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, ++ int offset, int size) ++{ ++} ++ ++static void mtd_partition_split(struct mtd_info *master, struct mtd_part *part) ++{ ++ static int rootfs_found = 0; ++ ++ if (rootfs_found) ++ return; ++ ++ if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && ++ IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) ++ split_firmware(master, part); ++ ++ arch_split_mtd_part(master, part->mtd.name, part->offset, ++ part->mtd.size); ++} + /* + * This function, given a master MTD object and a partition table, creates + * and registers slave MTD objects which are bound to the master according to +@@ -795,6 +829,7 @@ int add_mtd_partitions(struct mtd_info * + mutex_unlock(&mtd_partitions_mutex); + + add_mtd_device(&slave->mtd); ++ mtd_partition_split(master, slave); + mtd_add_partition_attrs(slave); + if (parts[i].types) + mtd_parse_part(slave, parts[i].types); +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -109,5 +109,7 @@ int mtd_add_partition(struct mtd_info *m + long long offset, long long length); + int mtd_del_partition(struct mtd_info *master, int partno); + uint64_t mtd_get_device_size(const struct mtd_info *mtd); ++extern void __weak arch_split_mtd_part(struct mtd_info *master, ++ const char *name, int offset, int size); + + #endif diff --git a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch new file mode 100644 index 000000000..77ee85a8c --- /dev/null +++ b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch @@ -0,0 +1,110 @@ +From: Gabor Juhos +Subject: mtd: add support for different partition parser types + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 56 ++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 11 ++++++++ + 2 files changed, 67 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -1034,6 +1034,62 @@ void mtd_part_parser_cleanup(struct mtd_ + } + } + ++static struct mtd_part_parser * ++get_partition_parser_by_type(enum mtd_parser_type type, ++ struct mtd_part_parser *start) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ p = list_prepare_entry(start, &part_parsers, list); ++ if (start) ++ mtd_part_parser_put(start); ++ ++ list_for_each_entry_continue(p, &part_parsers, list) { ++ if (p->type == type && try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++int parse_mtd_partitions_by_type(struct mtd_info *master, ++ enum mtd_parser_type type, ++ const struct mtd_partition **pparts, ++ struct mtd_part_parser_data *data) ++{ ++ struct mtd_part_parser *prev = NULL; ++ int ret = 0; ++ ++ while (1) { ++ struct mtd_part_parser *parser; ++ ++ parser = get_partition_parser_by_type(type, prev); ++ if (!parser) ++ break; ++ ++ ret = (*parser->parse_fn)(master, pparts, data); ++ ++ if (ret > 0) { ++ mtd_part_parser_put(parser); ++ printk(KERN_NOTICE ++ "%d %s partitions found on MTD device %s\n", ++ ret, parser->name, master->name); ++ break; ++ } ++ ++ prev = parser; ++ } ++ ++ return ret; ++} ++EXPORT_SYMBOL_GPL(parse_mtd_partitions_by_type); ++ + int mtd_is_partition(const struct mtd_info *mtd) + { + struct mtd_part *part; +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -68,11 +68,14 @@ struct mtd_part_parser_data { + unsigned long origin; + }; + +- + /* + * Functions dealing with the various ways of partitioning the space + */ + ++enum mtd_parser_type { ++ MTD_PARSER_TYPE_DEVICE = 0, ++}; ++ + struct mtd_part_parser { + struct list_head list; + struct module *owner; +@@ -80,6 +83,7 @@ struct mtd_part_parser { + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); ++ enum mtd_parser_type type; + }; + + /* Container for passing around a set of parsed partitions */ +@@ -112,4 +116,9 @@ uint64_t mtd_get_device_size(const struc + extern void __weak arch_split_mtd_part(struct mtd_info *master, + const char *name, int offset, int size); + ++int parse_mtd_partitions_by_type(struct mtd_info *master, ++ enum mtd_parser_type type, ++ const struct mtd_partition **pparts, ++ struct mtd_part_parser_data *data); ++ + #endif diff --git a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch new file mode 100644 index 000000000..dff9c3166 --- /dev/null +++ b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -0,0 +1,81 @@ +From: Gabor Juhos +Subject: kernel/3.10: allow to use partition parsers for rootfs and firmware split + +lede-commit: 3b71cd94bc9517bc25267dccb393b07d4b54564e +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 37 +++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 2 files changed, 39 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -769,6 +769,36 @@ int mtd_del_partition(struct mtd_info *m + } + EXPORT_SYMBOL_GPL(mtd_del_partition); + ++static int ++run_parsers_by_type(struct mtd_part *slave, enum mtd_parser_type type) ++{ ++ struct mtd_partition *parts; ++ int nr_parts; ++ int i; ++ ++ nr_parts = parse_mtd_partitions_by_type(&slave->mtd, type, (const struct mtd_partition **)&parts, ++ NULL); ++ if (nr_parts <= 0) ++ return nr_parts; ++ ++ if (WARN_ON(!parts)) ++ return 0; ++ ++ for (i = 0; i < nr_parts; i++) { ++ /* adjust partition offsets */ ++ parts[i].offset += slave->offset; ++ ++ mtd_add_partition(slave->parent, ++ parts[i].name, ++ parts[i].offset, ++ parts[i].size); ++ } ++ ++ kfree(parts); ++ ++ return nr_parts; ++} ++ + #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME + #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME + #else +@@ -777,6 +807,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); + + static void split_firmware(struct mtd_info *master, struct mtd_part *part) + { ++ run_parsers_by_type(part, MTD_PARSER_TYPE_FIRMWARE); + } + + void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, +@@ -791,6 +822,12 @@ static void mtd_partition_split(struct m + if (rootfs_found) + return; + ++ if (!strcmp(part->mtd.name, "rootfs")) { ++ run_parsers_by_type(part, MTD_PARSER_TYPE_ROOTFS); ++ ++ rootfs_found = 1; ++ } ++ + if (!strcmp(part->mtd.name, SPLIT_FIRMWARE_NAME) && + IS_ENABLED(CONFIG_MTD_SPLIT_FIRMWARE)) + split_firmware(master, part); +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -74,6 +74,8 @@ struct mtd_part_parser_data { + + enum mtd_parser_type { + MTD_PARSER_TYPE_DEVICE = 0, ++ MTD_PARSER_TYPE_ROOTFS, ++ MTD_PARSER_TYPE_FIRMWARE, + }; + + struct mtd_part_parser { diff --git a/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch b/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch new file mode 100644 index 000000000..89c202bc0 --- /dev/null +++ b/target/linux/generic/pending-4.14/403-mtd-hook-mtdsplit-to-Kbuild.patch @@ -0,0 +1,32 @@ +From: Gabor Juhos +Subject: [PATCH] kernel/3.10: move squashfs check from rootfs split code into a separate file + +lede-commit: d89bea92b31b4e157a0fa438e75370f089f73427 +Signed-off-by: Gabor Juhos +--- + drivers/mtd/Kconfig | 2 ++ + drivers/mtd/Makefile | 2 ++ + 2 files changed, 4 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -27,6 +27,8 @@ config MTD_SPLIT_FIRMWARE_NAME + depends on MTD_SPLIT_FIRMWARE + default "firmware" + ++source "drivers/mtd/mtdsplit/Kconfig" ++ + endmenu + + config MTD_TESTS +--- a/drivers/mtd/Makefile ++++ b/drivers/mtd/Makefile +@@ -7,6 +7,8 @@ + obj-$(CONFIG_MTD) += mtd.o + mtd-y := mtdcore.o mtdsuper.o mtdconcat.o mtdpart.o mtdchar.o + ++obj-$(CONFIG_MTD_SPLIT) += mtdsplit/ ++ + obj-$(CONFIG_MTD_OF_PARTS) += ofpart.o + obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o + obj-$(CONFIG_MTD_CMDLINE_PARTS) += cmdlinepart.o diff --git a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch new file mode 100644 index 000000000..97bd7730c --- /dev/null +++ b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch @@ -0,0 +1,94 @@ +From: Gabor Juhos +Subject: kernel/3.10: add separate rootfs partition parser + +lede-commit: daec7ad7688415156e2730e401503d09bd3acf91 +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdpart.c | 29 +++++++++++++++++++++++++++++ + include/linux/mtd/mtd.h | 18 ++++++++++++++++++ + include/linux/mtd/partitions.h | 2 ++ + 3 files changed, 49 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -799,6 +799,17 @@ run_parsers_by_type(struct mtd_part *sla + return nr_parts; + } + ++static inline unsigned long ++mtd_pad_erasesize(struct mtd_info *mtd, int offset, int len) ++{ ++ unsigned long mask = mtd->erasesize - 1; ++ ++ len += offset & mask; ++ len = (len + mask) & ~mask; ++ len -= offset & mask; ++ return len; ++} ++ + #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME + #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME + #else +@@ -1144,6 +1155,24 @@ int mtd_is_partition(const struct mtd_in + } + EXPORT_SYMBOL_GPL(mtd_is_partition); + ++struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd) ++{ ++ if (!mtd_is_partition(mtd)) ++ return (struct mtd_info *)mtd; ++ ++ return mtd_to_part(mtd)->parent; ++} ++EXPORT_SYMBOL_GPL(mtdpart_get_master); ++ ++uint64_t mtdpart_get_offset(const struct mtd_info *mtd) ++{ ++ if (!mtd_is_partition(mtd)) ++ return 0; ++ ++ return mtd_to_part(mtd)->offset; ++} ++EXPORT_SYMBOL_GPL(mtdpart_get_offset); ++ + /* Returns the size of the entire flash chip */ + uint64_t mtd_get_device_size(const struct mtd_info *mtd) + { +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -493,6 +493,24 @@ static inline uint32_t mtd_mod_by_eb(uin + return do_div(sz, mtd->erasesize); + } + ++static inline uint64_t mtd_roundup_to_eb(uint64_t sz, struct mtd_info *mtd) ++{ ++ if (mtd_mod_by_eb(sz, mtd) == 0) ++ return sz; ++ ++ /* Round up to next erase block */ ++ return (mtd_div_by_eb(sz, mtd) + 1) * mtd->erasesize; ++} ++ ++static inline uint64_t mtd_rounddown_to_eb(uint64_t sz, struct mtd_info *mtd) ++{ ++ if (mtd_mod_by_eb(sz, mtd) == 0) ++ return sz; ++ ++ /* Round down to the start of the current erase block */ ++ return (mtd_div_by_eb(sz, mtd)) * mtd->erasesize; ++} ++ + static inline uint32_t mtd_div_by_ws(uint64_t sz, struct mtd_info *mtd) + { + if (mtd->writesize_shift) +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -114,6 +114,8 @@ int mtd_is_partition(const struct mtd_in + int mtd_add_partition(struct mtd_info *master, const char *name, + long long offset, long long length); + int mtd_del_partition(struct mtd_info *master, int partno); ++struct mtd_info *mtdpart_get_master(const struct mtd_info *mtd); ++uint64_t mtdpart_get_offset(const struct mtd_info *mtd); + uint64_t mtd_get_device_size(const struct mtd_info *mtd); + extern void __weak arch_split_mtd_part(struct mtd_info *master, + const char *name, int offset, int size); diff --git a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch new file mode 100644 index 000000000..096d6a4e7 --- /dev/null +++ b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch @@ -0,0 +1,154 @@ +From: Felix Fietkau +Subject: mtd: implement write support for partitions covering only a part of an eraseblock (buffer data that would otherwise be erased) + +lede-commit: 87a8e8ac1067f58ba831c4aae443f3655c31cd80 +Signed-off-by: Felix Fietkau +--- + drivers/mtd/mtdpart.c | 90 ++++++++++++++++++++++++++++++++++++++++++++----- + include/linux/mtd/mtd.h | 4 +++ + 2 files changed, 85 insertions(+), 9 deletions(-) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -36,6 +36,8 @@ + #include "mtdcore.h" + #include "mtdsplit/mtdsplit.h" + ++#define MTD_ERASE_PARTIAL 0x8000 /* partition only covers parts of an erase block */ ++ + /* Our partition linked list */ + static LIST_HEAD(mtd_partitions); + static DEFINE_MUTEX(mtd_partitions_mutex); +@@ -241,13 +243,61 @@ static int part_erase(struct mtd_info *m + struct mtd_part *part = mtd_to_part(mtd); + int ret; + ++ ++ instr->partial_start = false; ++ if (mtd->flags & MTD_ERASE_PARTIAL) { ++ size_t readlen = 0; ++ u64 mtd_ofs; ++ ++ instr->erase_buf = kmalloc(part->parent->erasesize, GFP_ATOMIC); ++ if (!instr->erase_buf) ++ return -ENOMEM; ++ ++ mtd_ofs = part->offset + instr->addr; ++ instr->erase_buf_ofs = do_div(mtd_ofs, part->parent->erasesize); ++ ++ if (instr->erase_buf_ofs > 0) { ++ instr->addr -= instr->erase_buf_ofs; ++ ret = mtd_read(part->parent, ++ instr->addr + part->offset, ++ part->parent->erasesize, ++ &readlen, instr->erase_buf); ++ ++ instr->len += instr->erase_buf_ofs; ++ instr->partial_start = true; ++ } else { ++ mtd_ofs = part->offset + part->mtd.size; ++ instr->erase_buf_ofs = part->parent->erasesize - ++ do_div(mtd_ofs, part->parent->erasesize); ++ ++ if (instr->erase_buf_ofs > 0) { ++ instr->len += instr->erase_buf_ofs; ++ ret = mtd_read(part->parent, ++ part->offset + instr->addr + ++ instr->len - part->parent->erasesize, ++ part->parent->erasesize, &readlen, ++ instr->erase_buf); ++ } else { ++ ret = 0; ++ } ++ } ++ if (ret < 0) { ++ kfree(instr->erase_buf); ++ return ret; ++ } ++ ++ } ++ + instr->addr += part->offset; + ret = part->parent->_erase(part->parent, instr); + if (ret) { + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) + instr->fail_addr -= part->offset; + instr->addr -= part->offset; ++ if (mtd->flags & MTD_ERASE_PARTIAL) ++ kfree(instr->erase_buf); + } ++ + return ret; + } + +@@ -255,6 +305,25 @@ void mtd_erase_callback(struct erase_inf + { + if (instr->mtd->_erase == part_erase) { + struct mtd_part *part = mtd_to_part(instr->mtd); ++ size_t wrlen = 0; ++ ++ if (instr->mtd->flags & MTD_ERASE_PARTIAL) { ++ if (instr->partial_start) { ++ part->parent->_write(part->parent, ++ instr->addr, instr->erase_buf_ofs, ++ &wrlen, instr->erase_buf); ++ instr->addr += instr->erase_buf_ofs; ++ } else { ++ instr->len -= instr->erase_buf_ofs; ++ part->parent->_write(part->parent, ++ instr->addr + instr->len, ++ instr->erase_buf_ofs, &wrlen, ++ instr->erase_buf + ++ part->parent->erasesize - ++ instr->erase_buf_ofs); ++ } ++ kfree(instr->erase_buf); ++ } + + if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) + instr->fail_addr -= part->offset; +@@ -598,19 +667,22 @@ static struct mtd_part *allocate_partiti + remainder = do_div(tmp, wr_alignment); + if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { + /* Doesn't start on a boundary of major erase size */ +- /* FIXME: Let it be writable if it is on a boundary of +- * _minor_ erase size though */ +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk(KERN_WARNING"mtd: partition \"%s\" doesn't start on an erase/write block boundary -- force read-only\n", +- part->name); ++ slave->mtd.flags |= MTD_ERASE_PARTIAL; ++ if (((u32)slave->mtd.size) > parent->erasesize) ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ else ++ slave->mtd.erasesize = slave->mtd.size; + } + +- tmp = slave->mtd.size; ++ tmp = slave->offset + slave->mtd.size; + remainder = do_div(tmp, wr_alignment); + if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { +- slave->mtd.flags &= ~MTD_WRITEABLE; +- printk(KERN_WARNING"mtd: partition \"%s\" doesn't end on an erase/write block -- force read-only\n", +- part->name); ++ slave->mtd.flags |= MTD_ERASE_PARTIAL; ++ ++ if ((u32)slave->mtd.size > parent->erasesize) ++ slave->mtd.flags &= ~MTD_WRITEABLE; ++ else ++ slave->mtd.erasesize = slave->mtd.size; + } + + mtd_set_ooblayout(&slave->mtd, &part_ooblayout_ops); +--- a/include/linux/mtd/mtd.h ++++ b/include/linux/mtd/mtd.h +@@ -56,6 +56,10 @@ struct erase_info { + u_long priv; + u_char state; + struct erase_info *next; ++ ++ u8 *erase_buf; ++ u32 erase_buf_ofs; ++ bool partial_start; + }; + + struct mtd_erase_region_info { diff --git a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch new file mode 100644 index 000000000..fd6ffc6fa --- /dev/null +++ b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch @@ -0,0 +1,40 @@ +From: Tim Harvey +Subject: mtd: allow partial block unlock + +This allows sysupgrade for devices such as the Gateworks Avila/Cambria +product families based on the ixp4xx using the redboot bootloader with +combined FIS directory and RedBoot config partitions on larger FLASH +devices with larger eraseblocks. + +This second iteration of this patch addresses previous issues: +- whitespace breakage fixed +- unlock in all scenarios +- simplification and fix logic bug + +[john@phrozen.org: this should be moved to the ixp4xx folder] + +Signed-off-by: Tim Harvey +--- + drivers/mtd/mtdpart.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -343,7 +343,16 @@ static int part_lock(struct mtd_info *mt + static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) + { + struct mtd_part *part = mtd_to_part(mtd); +- return part->parent->_unlock(part->parent, ofs + part->offset, len); ++ ++ ofs += part->offset; ++ ++ if (mtd->flags & MTD_ERASE_PARTIAL) { ++ /* round up len to next erasesize and round down offset to prev block */ ++ len = (mtd_div_by_eb(len, part->parent) + 1) * part->parent->erasesize; ++ ofs &= ~(part->parent->erasesize - 1); ++ } ++ ++ return part->parent->_unlock(part->parent, ofs, len); + } + + static int part_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len) diff --git a/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch b/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch new file mode 100644 index 000000000..85fbe0512 --- /dev/null +++ b/target/linux/generic/pending-4.14/420-mtd-redboot_space.patch @@ -0,0 +1,41 @@ +From: Felix Fietkau +Subject: add patch for including unpartitioned space in the rootfs partition for redboot devices (if applicable) + +[john@phrozen.org: used by ixp and others] + +lede-commit: 394918851f84e4d00fa16eb900e7700e95091f00 +Signed-off-by: Felix Fietkau +--- + drivers/mtd/redboot.c | 19 +++++++++++++------ + 1 file changed, 13 insertions(+), 6 deletions(-) + +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -265,14 +265,21 @@ static int parse_redboot_partitions(stru + #endif + names += strlen(names)+1; + +-#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + if(fl->next && fl->img->flash_base + fl->img->size + master->erasesize <= fl->next->img->flash_base) { +- i++; +- parts[i].offset = parts[i-1].size + parts[i-1].offset; +- parts[i].size = fl->next->img->flash_base - parts[i].offset; +- parts[i].name = nullname; +- } ++ if (!strcmp(parts[i].name, "rootfs")) { ++ parts[i].size = fl->next->img->flash_base; ++ parts[i].size &= ~(master->erasesize - 1); ++ parts[i].size -= parts[i].offset; ++#ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED ++ nrparts--; ++ } else { ++ i++; ++ parts[i].offset = parts[i-1].size + parts[i-1].offset; ++ parts[i].size = fl->next->img->flash_base - parts[i].offset; ++ parts[i].name = nullname; + #endif ++ } ++ } + tmp_fl = fl; + fl = fl->next; + kfree(tmp_fl); diff --git a/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch new file mode 100644 index 000000000..889c45205 --- /dev/null +++ b/target/linux/generic/pending-4.14/430-mtd-add-myloader-partition-parser.patch @@ -0,0 +1,47 @@ +From: Florian Fainelli +Subject: Add myloader partition table parser + +[john@phozen.org: shoud be upstreamable] + +lede-commit: d8bf22859b51faa09d22c056fe221a45d2f7a3b8 +Signed-off-by: Florian Fainelli +--- + drivers/mtd/Kconfig | 16 ++++++++++++++++ + drivers/mtd/Makefile | 1 + + 2 files changed, 17 insertions(+) + +--- a/drivers/mtd/Kconfig ++++ b/drivers/mtd/Kconfig +@@ -178,6 +178,22 @@ menu "Partition parsers" + source "drivers/mtd/parsers/Kconfig" + endmenu + ++config MTD_MYLOADER_PARTS ++ tristate "MyLoader partition parsing" ++ depends on ADM5120 || ATH25 || ATH79 ++ ---help--- ++ MyLoader is a bootloader which allows the user to define partitions ++ in flash devices, by putting a table in the second erase block ++ on the device, similar to a partition table. This table gives the ++ offsets and lengths of the user defined partitions. ++ ++ If you need code which can detect and parse these tables, and ++ register MTD 'partitions' corresponding to each image detected, ++ enable this option. ++ ++ You will still need the parsing functions to be called by the driver ++ for your particular device. It won't happen automatically. ++ + comment "User Modules And Translation Layers" + + # +--- a/drivers/mtd/Makefile ++++ b/drivers/mtd/Makefile +@@ -16,6 +16,7 @@ obj-$(CONFIG_MTD_AFS_PARTS) += afs.o + obj-$(CONFIG_MTD_AR7_PARTS) += ar7part.o + obj-$(CONFIG_MTD_BCM63XX_PARTS) += bcm63xxpart.o + obj-$(CONFIG_MTD_BCM47XX_PARTS) += bcm47xxpart.o ++obj-$(CONFIG_MTD_MYLOADER_PARTS) += myloader.o + obj-y += parsers/ + + # 'Users' - code which presents functionality to userspace. diff --git a/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch b/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch new file mode 100644 index 000000000..9299e8867 --- /dev/null +++ b/target/linux/generic/pending-4.14/431-mtd-bcm47xxpart-check-for-bad-blocks-when-calculatin.patch @@ -0,0 +1,67 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: [PATCH] mtd: bcm47xxpart: check for bad blocks when calculating offsets + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +--- + +--- a/drivers/mtd/parsers/parser_trx.c ++++ b/drivers/mtd/parsers/parser_trx.c +@@ -29,6 +29,33 @@ struct trx_header { + uint32_t offset[3]; + } __packed; + ++/* ++ * Calculate real end offset (address) for a given amount of data. It checks ++ * all blocks skipping bad ones. ++ */ ++static size_t parser_trx_real_offset(struct mtd_info *mtd, size_t bytes) ++{ ++ size_t real_offset = 0; ++ ++ if (mtd_block_isbad(mtd, real_offset)) ++ pr_warn("Base offset shouldn't be at bad block"); ++ ++ while (bytes >= mtd->erasesize) { ++ bytes -= mtd->erasesize; ++ real_offset += mtd->erasesize; ++ while (mtd_block_isbad(mtd, real_offset)) { ++ real_offset += mtd->erasesize; ++ ++ if (real_offset >= mtd->size) ++ return real_offset - mtd->erasesize; ++ } ++ } ++ ++ real_offset += bytes; ++ ++ return real_offset; ++} ++ + static const char *parser_trx_data_part_name(struct mtd_info *master, + size_t offset) + { +@@ -83,21 +110,21 @@ static int parser_trx_parse(struct mtd_i + if (trx.offset[2]) { + part = &parts[curr_part++]; + part->name = "loader"; +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + + if (trx.offset[i]) { + part = &parts[curr_part++]; + part->name = "linux"; +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + + if (trx.offset[i]) { + part = &parts[curr_part++]; + part->name = parser_trx_data_part_name(mtd, trx.offset[i]); +- part->offset = trx.offset[i]; ++ part->offset = parser_trx_real_offset(mtd, trx.offset[i]); + i++; + } + diff --git a/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch b/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch new file mode 100644 index 000000000..a6d0828b9 --- /dev/null +++ b/target/linux/generic/pending-4.14/432-mtd-bcm47xxpart-detect-T_Meter-partition.patch @@ -0,0 +1,37 @@ +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Subject: mtd: bcm47xxpart: detect T_Meter partition + +It can be found on many Netgear devices. It consists of many 0x30 blocks +starting with 4D 54. + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +--- + drivers/mtd/bcm47xxpart.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/bcm47xxpart.c ++++ b/drivers/mtd/bcm47xxpart.c +@@ -39,6 +39,7 @@ + #define NVRAM_HEADER 0x48534C46 /* FLSH */ + #define POT_MAGIC1 0x54544f50 /* POTT */ + #define POT_MAGIC2 0x504f /* OP */ ++#define T_METER_MAGIC 0x4D540000 /* MT */ + #define ML_MAGIC1 0x39685a42 + #define ML_MAGIC2 0x26594131 + #define TRX_MAGIC 0x30524448 +@@ -182,6 +183,15 @@ static int bcm47xxpart_parse(struct mtd_ + MTD_WRITEABLE); + continue; + } ++ ++ /* T_Meter */ ++ if ((le32_to_cpu(buf[0x000 / 4]) & 0xFFFF0000) == T_METER_MAGIC && ++ (le32_to_cpu(buf[0x030 / 4]) & 0xFFFF0000) == T_METER_MAGIC && ++ (le32_to_cpu(buf[0x060 / 4]) & 0xFFFF0000) == T_METER_MAGIC) { ++ bcm47xxpart_add_part(&parts[curr_part++], "T_Meter", offset, ++ MTD_WRITEABLE); ++ continue; ++ } + + /* TRX */ + if (buf[0x000 / 4] == TRX_MAGIC) { diff --git a/target/linux/generic/pending-4.14/440-block2mtd_init.patch b/target/linux/generic/pending-4.14/440-block2mtd_init.patch new file mode 100644 index 000000000..883478873 --- /dev/null +++ b/target/linux/generic/pending-4.14/440-block2mtd_init.patch @@ -0,0 +1,116 @@ +From: Felix Fietkau +Subject: block2mtd + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/devices/block2mtd.c | 30 ++++++++++++++++++++---------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -219,7 +220,7 @@ static void block2mtd_free_device(struct + + + static struct block2mtd_dev *add_device(char *devname, int erase_size, +- int timeout) ++ const char *mtdname, int timeout) + { + #ifndef MODULE + int i; +@@ -227,6 +228,7 @@ static struct block2mtd_dev *add_device( + const fmode_t mode = FMODE_READ | FMODE_WRITE | FMODE_EXCL; + struct block_device *bdev = ERR_PTR(-ENODEV); + struct block2mtd_dev *dev; ++ struct mtd_partition *part; + char *name; + + if (!devname) +@@ -283,13 +285,16 @@ static struct block2mtd_dev *add_device( + + /* Setup the MTD structure */ + /* make the name contain the block device in */ +- name = kasprintf(GFP_KERNEL, "block2mtd: %s", devname); ++ if (!mtdname) ++ mtdname = devname; ++ name = kmalloc(strlen(mtdname) + 1, GFP_KERNEL); + if (!name) + goto err_destroy_mutex; + ++ strcpy(name, mtdname); + dev->mtd.name = name; + +- dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK; ++ dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK & ~(erase_size - 1); + dev->mtd.erasesize = erase_size; + dev->mtd.writesize = 1; + dev->mtd.writebufsize = PAGE_SIZE; +@@ -302,7 +307,11 @@ static struct block2mtd_dev *add_device( + dev->mtd.priv = dev; + dev->mtd.owner = THIS_MODULE; + +- if (mtd_device_register(&dev->mtd, NULL, 0)) { ++ part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL); ++ part->name = name; ++ part->offset = 0; ++ part->size = dev->mtd.size; ++ if (mtd_device_register(&dev->mtd, part, 1)) { + /* Device didn't get added, so free the entry */ + goto err_destroy_mutex; + } +@@ -310,8 +319,7 @@ static struct block2mtd_dev *add_device( + list_add(&dev->list, &blkmtd_device_list); + pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n", + dev->mtd.index, +- dev->mtd.name + strlen("block2mtd: "), +- dev->mtd.erasesize >> 10, dev->mtd.erasesize); ++ mtdname, dev->mtd.erasesize >> 10, dev->mtd.erasesize); + return dev; + + err_destroy_mutex: +@@ -384,7 +392,7 @@ static int block2mtd_setup2(const char * + /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */ + char buf[80 + 12 + 80 + 8]; + char *str = buf; +- char *token[2]; ++ char *token[3]; + char *name; + size_t erase_size = PAGE_SIZE; + unsigned long timeout = MTD_DEFAULT_TIMEOUT; +@@ -398,7 +406,7 @@ static int block2mtd_setup2(const char * + strcpy(str, val); + kill_final_newline(str); + +- for (i = 0; i < 2; i++) ++ for (i = 0; i < 3; i++) + token[i] = strsep(&str, ","); + + if (str) { +@@ -424,8 +432,10 @@ static int block2mtd_setup2(const char * + return 0; + } + } ++ if (token[2] && (strlen(token[2]) + 1 > 80)) ++ pr_err("mtd device name too long\n"); + +- add_device(name, erase_size, timeout); ++ add_device(name, erase_size, token[2], timeout); + + return 0; + } +@@ -459,7 +469,7 @@ static int block2mtd_setup(const char *v + + + module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200); +-MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,]\""); ++MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,]]\""); + + static int __init block2mtd_init(void) + { diff --git a/target/linux/generic/pending-4.14/441-block2mtd_probe.patch b/target/linux/generic/pending-4.14/441-block2mtd_probe.patch new file mode 100644 index 000000000..fee970ab6 --- /dev/null +++ b/target/linux/generic/pending-4.14/441-block2mtd_probe.patch @@ -0,0 +1,47 @@ +From: Felix Fietkau +Subject: block2mtd + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/devices/block2mtd.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/devices/block2mtd.c ++++ b/drivers/mtd/devices/block2mtd.c +@@ -392,7 +392,7 @@ static int block2mtd_setup2(const char * + /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */ + char buf[80 + 12 + 80 + 8]; + char *str = buf; +- char *token[3]; ++ char *token[4]; + char *name; + size_t erase_size = PAGE_SIZE; + unsigned long timeout = MTD_DEFAULT_TIMEOUT; +@@ -406,7 +406,7 @@ static int block2mtd_setup2(const char * + strcpy(str, val); + kill_final_newline(str); + +- for (i = 0; i < 3; i++) ++ for (i = 0; i < 4; i++) + token[i] = strsep(&str, ","); + + if (str) { +@@ -435,6 +435,9 @@ static int block2mtd_setup2(const char * + if (token[2] && (strlen(token[2]) + 1 > 80)) + pr_err("mtd device name too long\n"); + ++ if (token[3] && kstrtoul(token[3], 0, &timeout)) ++ pr_err("invalid timeout\n"); ++ + add_device(name, erase_size, token[2], timeout); + + return 0; +@@ -469,7 +472,7 @@ static int block2mtd_setup(const char *v + + + module_param_call(block2mtd, block2mtd_setup, NULL, NULL, 0200); +-MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,]]\""); ++MODULE_PARM_DESC(block2mtd, "Device to use. \"block2mtd=[,[,[,]]]\""); + + static int __init block2mtd_init(void) + { diff --git a/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch b/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch new file mode 100644 index 000000000..41f9d31cb --- /dev/null +++ b/target/linux/generic/pending-4.14/460-mtd-cfi_cmdset_0002-no-erase_suspend.patch @@ -0,0 +1,25 @@ +From: Felix Fietkau +Subject: kernel: disable cfi cmdset 0002 erase suspend + +on some platforms, erase suspend leads to data corruption and lockups when write +ops collide with erase ops. this has been observed on the buffalo wzr-hp-g300nh. +rather than play whack-a-mole with a hard to reproduce issue on a variety of devices, +simply disable erase suspend, as it will usually not produce any useful gain on +the small filesystems used on embedded hardware. + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/chips/cfi_cmdset_0002.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -811,7 +811,7 @@ static int get_chip(struct map_info *map + return 0; + + case FL_ERASING: +- if (!cfip || !(cfip->EraseSuspend & (0x1|0x2)) || ++ if (1 /* no suspend */ || !cfip || !(cfip->EraseSuspend & (0x1|0x2)) || + !(mode == FL_READY || mode == FL_POINT || + (mode == FL_WRITING && (cfip->EraseSuspend & 0x2)))) + goto sleep; diff --git a/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch b/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch new file mode 100644 index 000000000..f4ba5b72f --- /dev/null +++ b/target/linux/generic/pending-4.14/461-mtd-cfi_cmdset_0002-add-buffer-write-cmd-timeout.patch @@ -0,0 +1,17 @@ +From: George Kashperko +Subject: Issue map read after Write Buffer Load command to ensure chip is ready to receive data. + +Signed-off-by: George Kashperko +--- + drivers/mtd/chips/cfi_cmdset_0002.c | 1 + + 1 file changed, 1 insertion(+) +--- a/drivers/mtd/chips/cfi_cmdset_0002.c ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c +@@ -1832,6 +1832,7 @@ static int __xipram do_write_buffer(stru + + /* Write Buffer Load */ + map_write(map, CMD(0x25), cmd_adr); ++ (void) map_read(map, cmd_adr); + + chip->state = FL_WRITING_TO_BUFFER; + diff --git a/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch new file mode 100644 index 000000000..89d38ec30 --- /dev/null +++ b/target/linux/generic/pending-4.14/465-m25p80-mx-disable-software-protection.patch @@ -0,0 +1,18 @@ +From: Felix Fietkau +Subject: Disable software protection bits for Macronix flashes. + +Signed-off-by: Felix Fietkau +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2715,6 +2715,7 @@ int spi_nor_scan(struct spi_nor *nor, co + + if (JEDEC_MFR(info) == SNOR_MFR_ATMEL || + JEDEC_MFR(info) == SNOR_MFR_INTEL || ++ JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); diff --git a/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch new file mode 100644 index 000000000..10db289cc --- /dev/null +++ b/target/linux/generic/pending-4.14/470-mtd-spi-nor-support-limiting-4K-sectors-support-base.patch @@ -0,0 +1,56 @@ +From: Felix Fietkau +Date: Sat, 4 Nov 2017 07:40:23 +0100 +Subject: [PATCH] mtd: spi-nor: support limiting 4K sectors support based on + flash size + +Some devices need 4K sectors to be able to deal with small flash chips. +For instance, w25x05 is 64 KiB in size, and without 4K sectors, the +entire chip is just one erase block. +On bigger flash chip sizes, using 4K sectors can significantly slow down +many operations, including using a writable filesystem. There are several +platforms where it makes sense to use a single kernel on both kinds of +devices. + +To support this properly, allow configuring an upper flash chip size +limit for 4K sectors support. + +Signed-off-by: Felix Fietkau +--- + +--- a/drivers/mtd/spi-nor/Kconfig ++++ b/drivers/mtd/spi-nor/Kconfig +@@ -39,6 +39,17 @@ config SPI_ASPEED_SMC + and support for the SPI flash memory controller (SPI) for + the host firmware. The implementation only supports SPI NOR. + ++config MTD_SPI_NOR_USE_4K_SECTORS_LIMIT ++ int "Maximum flash chip size to use 4K sectors on (in KiB)" ++ depends on MTD_SPI_NOR_USE_4K_SECTORS ++ default "4096" ++ help ++ There are many flash chips that support 4K sectors, but are so large ++ that using them significantly slows down writing large amounts of ++ data or using a writable filesystem. ++ Any flash chip larger than the size specified in this option will ++ not use 4K sectors. ++ + config SPI_ATMEL_QUADSPI + tristate "Atmel Quad SPI Controller" + depends on ARCH_AT91 || (ARM && COMPILE_TEST) +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2562,10 +2562,12 @@ static int spi_nor_select_erase(struct s + + #ifdef CONFIG_MTD_SPI_NOR_USE_4K_SECTORS + /* prefer "small sector" erase if possible */ +- if (info->flags & SECT_4K) { ++ if ((info->flags & SECT_4K) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K; + mtd->erasesize = 4096; +- } else if (info->flags & SECT_4K_PMC) { ++ } else if ((info->flags & SECT_4K_PMC) && (mtd->size <= ++ CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT * 1024)) { + nor->erase_opcode = SPINOR_OP_BE_4K_PMC; + mtd->erasesize = 4096; + } else diff --git a/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch b/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch new file mode 100644 index 000000000..ac1fda515 --- /dev/null +++ b/target/linux/generic/pending-4.14/476-mtd-spi-nor-add-eon-en25q128.patch @@ -0,0 +1,18 @@ +From: Piotr Dymacz +Subject: kernel/mtd: add support for EON EN25Q128 + +Signed-off-by: Piotr Dymacz +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -954,6 +954,7 @@ static const struct flash_info spi_nor_i + { "en25q32b", INFO(0x1c3016, 0, 64 * 1024, 64, 0) }, + { "en25p64", INFO(0x1c2017, 0, 64 * 1024, 128, 0) }, + { "en25q64", INFO(0x1c3017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "en25q128", INFO(0x1c3018, 0, 64 * 1024, 256, SECT_4K) }, + { "en25qh128", INFO(0x1c7018, 0, 64 * 1024, 256, 0) }, + { "en25qh256", INFO(0x1c7019, 0, 64 * 1024, 512, 0) }, + { "en25s64", INFO(0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch new file mode 100644 index 000000000..191e01df7 --- /dev/null +++ b/target/linux/generic/pending-4.14/477-mtd-add-spi-nor-add-mx25u3235f.patch @@ -0,0 +1,18 @@ +From: André Valentin +Subject: linux/mtd: add id for mx25u3235f needed by ZyXEL NBG6817 + +Signed-off-by: André Valentin +--- + drivers/mtd/spi-nor/spi-nor.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1016,6 +1016,7 @@ static const struct flash_info spi_nor_i + { "mx25l3205d", INFO(0xc22016, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l3255e", INFO(0xc29e16, 0, 64 * 1024, 64, SECT_4K) }, + { "mx25l6405d", INFO(0xc22017, 0, 64 * 1024, 128, SECT_4K) }, ++ { "mx25u3235f", INFO(0xc22536, 0, 64 * 1024, 64, 0) }, + { "mx25u2033e", INFO(0xc22532, 0, 64 * 1024, 4, SECT_4K) }, + { "mx25u4035", INFO(0xc22533, 0, 64 * 1024, 8, SECT_4K) }, + { "mx25u8035", INFO(0xc22534, 0, 64 * 1024, 16, SECT_4K) }, diff --git a/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch b/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch new file mode 100644 index 000000000..6cddaf01b --- /dev/null +++ b/target/linux/generic/pending-4.14/480-mtd-set-rootfs-to-be-root-dev.patch @@ -0,0 +1,38 @@ +From: Gabor Juhos +Subject: kernel/3.1[02]: move MTD root device setup code to mtdcore + +The current code only allows to automatically set +root device on MTD partitions. Move the code to MTD +core to allow to use it with all MTD devices. + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/mtdcore.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/mtdcore.c ++++ b/drivers/mtd/mtdcore.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -578,6 +579,15 @@ int add_mtd_device(struct mtd_info *mtd) + of this try_ nonsense, and no bitching about it + either. :) */ + __module_get(THIS_MODULE); ++ ++ if (!strcmp(mtd->name, "rootfs") && ++ IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ ROOT_DEV == 0) { ++ pr_notice("mtd: device %d (%s) set to be root filesystem\n", ++ mtd->index, mtd->name); ++ ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, mtd->index); ++ } ++ + return 0; + + fail_added: diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch new file mode 100644 index 000000000..523a69c87 --- /dev/null +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -0,0 +1,73 @@ +From: Daniel Golle +Subject: ubi: auto-attach mtd device named "ubi" or "data" on boot + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/build.c | 36 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 36 insertions(+) + +--- a/drivers/mtd/ubi/build.c ++++ b/drivers/mtd/ubi/build.c +@@ -1157,6 +1157,49 @@ static struct mtd_info * __init open_mtd + return mtd; + } + ++/* ++ * This function tries attaching mtd partitions named either "ubi" or "data" ++ * during boot. ++ */ ++static void __init ubi_auto_attach(void) ++{ ++ int err; ++ struct mtd_info *mtd; ++ ++ /* try attaching mtd device named "ubi" or "data" */ ++ mtd = open_mtd_device("ubi"); ++ if (IS_ERR(mtd)) ++ mtd = open_mtd_device("data"); ++ ++ if (!IS_ERR(mtd)) { ++ size_t len; ++ char magic[4]; ++ ++ /* check for a valid ubi magic */ ++ err = mtd_read(mtd, 0, 4, &len, (void *) magic); ++ if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { ++ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ put_mtd_device(mtd); ++ return; ++ } ++ ++ /* auto-add only media types where UBI makes sense */ ++ if (mtd->type == MTD_NANDFLASH || ++ mtd->type == MTD_NORFLASH || ++ mtd->type == MTD_DATAFLASH || ++ mtd->type == MTD_MLCNANDFLASH) { ++ mutex_lock(&ubi_devices_mutex); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); ++ err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); ++ mutex_unlock(&ubi_devices_mutex); ++ if (err < 0) { ++ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ put_mtd_device(mtd); ++ } ++ } ++ } ++} ++ + static int __init ubi_init(void) + { + int err, i, k; +@@ -1240,6 +1283,12 @@ static int __init ubi_init(void) + } + } + ++ /* auto-attach mtd devices only if built-in to the kernel and no ubi.mtd ++ * parameter was given */ ++ if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ !ubi_is_module() && !mtd_devs) ++ ubi_auto_attach(); ++ + err = ubiblock_init(); + if (err) { + pr_err("UBI error: block: cannot initialize, error %d\n", err); diff --git a/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch b/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch new file mode 100644 index 000000000..f8dc1bcb2 --- /dev/null +++ b/target/linux/generic/pending-4.14/491-ubi-auto-create-ubiblock-device-for-rootfs.patch @@ -0,0 +1,66 @@ +From: Daniel Golle +Subject: ubi: auto-create ubiblock device for rootfs + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/block.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 42 insertions(+) + +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -625,6 +625,44 @@ static void __init ubiblock_create_from_ + } + } + ++#define UBIFS_NODE_MAGIC 0x06101831 ++static inline int ubi_vol_is_ubifs(struct ubi_volume_desc *desc) ++{ ++ int ret; ++ uint32_t magic_of, magic; ++ ret = ubi_read(desc, 0, (char *)&magic_of, 0, 4); ++ if (ret) ++ return 0; ++ magic = le32_to_cpu(magic_of); ++ return magic == UBIFS_NODE_MAGIC; ++} ++ ++static void __init ubiblock_create_auto_rootfs(void) ++{ ++ int ubi_num, ret, is_ubifs; ++ struct ubi_volume_desc *desc; ++ struct ubi_volume_info vi; ++ ++ for (ubi_num = 0; ubi_num < UBI_MAX_DEVICES; ubi_num++) { ++ desc = ubi_open_volume_nm(ubi_num, "rootfs", UBI_READONLY); ++ if (IS_ERR(desc)) ++ continue; ++ ++ ubi_get_volume_info(desc, &vi); ++ is_ubifs = ubi_vol_is_ubifs(desc); ++ ubi_close_volume(desc); ++ if (is_ubifs) ++ break; ++ ++ ret = ubiblock_create(&vi); ++ if (ret) ++ pr_err("UBI error: block: can't add '%s' volume, err=%d\n", ++ vi.name, ret); ++ /* always break if we get here */ ++ break; ++ } ++} ++ + static void ubiblock_remove_all(void) + { + struct ubiblock *next; +@@ -655,6 +693,10 @@ int __init ubiblock_init(void) + */ + ubiblock_create_from_param(); + ++ /* auto-attach "rootfs" volume if existing and non-ubifs */ ++ if (IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV)) ++ ubiblock_create_auto_rootfs(); ++ + /* + * Block devices are only created upon user requests, so we ignore + * existing volumes. diff --git a/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch b/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch new file mode 100644 index 000000000..69a35c25e --- /dev/null +++ b/target/linux/generic/pending-4.14/492-try-auto-mounting-ubi0-rootfs-in-init-do_mounts.c.patch @@ -0,0 +1,51 @@ +From: Daniel Golle +Subject: try auto-mounting ubi0:rootfs in init/do_mounts.c + +Signed-off-by: Daniel Golle +--- + init/do_mounts.c | 26 +++++++++++++++++++++++++- + 1 file changed, 25 insertions(+), 1 deletion(-) + +--- a/init/do_mounts.c ++++ b/init/do_mounts.c +@@ -438,7 +438,28 @@ retry: + out: + put_page(page); + } +- ++ ++static int __init mount_ubi_rootfs(void) ++{ ++ int flags = MS_SILENT; ++ int err, tried = 0; ++ ++ while (tried < 2) { ++ err = do_mount_root("ubi0:rootfs", "ubifs", flags, \ ++ root_mount_data); ++ switch (err) { ++ case -EACCES: ++ flags |= MS_RDONLY; ++ tried++; ++ break; ++ default: ++ return err; ++ } ++ } ++ ++ return -EINVAL; ++} ++ + #ifdef CONFIG_ROOT_NFS + + #define NFSROOT_TIMEOUT_MIN 5 +@@ -532,6 +553,10 @@ void __init mount_root(void) + change_floppy("root floppy"); + } + #endif ++#ifdef CONFIG_MTD_ROOTFS_ROOT_DEV ++ if (!mount_ubi_rootfs()) ++ return; ++#endif + #ifdef CONFIG_BLOCK + { + int err = create_dev("/dev/root", ROOT_DEV); diff --git a/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch b/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch new file mode 100644 index 000000000..06cd1b62a --- /dev/null +++ b/target/linux/generic/pending-4.14/493-ubi-set-ROOT_DEV-to-ubiblock-rootfs-if-unset.patch @@ -0,0 +1,34 @@ +From: Daniel Golle +Subject: ubi: set ROOT_DEV to ubiblock "rootfs" if unset + +Signed-off-by: Daniel Golle +--- + drivers/mtd/ubi/block.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/mtd/ubi/block.c ++++ b/drivers/mtd/ubi/block.c +@@ -50,6 +50,7 @@ + #include + #include + #include ++#include + + #include "ubi-media.h" + #include "ubi.h" +@@ -445,6 +446,15 @@ int ubiblock_create(struct ubi_volume_in + add_disk(dev->gd); + dev_info(disk_to_dev(dev->gd), "created from ubi%d:%d(%s)", + dev->ubi_num, dev->vol_id, vi->name); ++ ++ if (!strcmp(vi->name, "rootfs") && ++ IS_ENABLED(CONFIG_MTD_ROOTFS_ROOT_DEV) && ++ ROOT_DEV == 0) { ++ pr_notice("ubiblock: device ubiblock%d_%d (%s) set to be root filesystem\n", ++ dev->ubi_num, dev->vol_id, vi->name); ++ ROOT_DEV = MKDEV(gd->major, gd->first_minor); ++ } ++ + return 0; + + out_free_queue: diff --git a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch new file mode 100644 index 000000000..99cc0f6cd --- /dev/null +++ b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch @@ -0,0 +1,60 @@ +From: Gabor Juhos +Subject: mtd: add EOF marker support to the UBI layer + +Signed-off-by: Gabor Juhos +--- + drivers/mtd/ubi/attach.c | 25 ++++++++++++++++++++++--- + drivers/mtd/ubi/ubi.h | 1 + + 2 files changed, 23 insertions(+), 3 deletions(-) + +--- a/drivers/mtd/ubi/attach.c ++++ b/drivers/mtd/ubi/attach.c +@@ -939,6 +939,13 @@ static bool vol_ignored(int vol_id) + #endif + } + ++static bool ec_hdr_has_eof(struct ubi_ec_hdr *ech) ++{ ++ return ech->padding1[0] == 'E' && ++ ech->padding1[1] == 'O' && ++ ech->padding1[2] == 'F'; ++} ++ + /** + * scan_peb - scan and process UBI headers of a PEB. + * @ubi: UBI device description object +@@ -971,9 +978,21 @@ static int scan_peb(struct ubi_device *u + return 0; + } + +- err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); +- if (err < 0) +- return err; ++ if (!ai->eof_found) { ++ err = ubi_io_read_ec_hdr(ubi, pnum, ech, 0); ++ if (err < 0) ++ return err; ++ ++ if (ec_hdr_has_eof(ech)) { ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pnum); ++ ai->eof_found = true; ++ } ++ } ++ ++ if (ai->eof_found) ++ err = UBI_IO_FF_BITFLIPS; ++ + switch (err) { + case 0: + break; +--- a/drivers/mtd/ubi/ubi.h ++++ b/drivers/mtd/ubi/ubi.h +@@ -778,6 +778,7 @@ struct ubi_attach_info { + int mean_ec; + uint64_t ec_sum; + int ec_count; ++ bool eof_found; + struct kmem_cache *aeb_slab_cache; + struct ubi_ec_hdr *ech; + struct ubi_vid_io_buf *vidb; diff --git a/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch new file mode 100644 index 000000000..046e9d54d --- /dev/null +++ b/target/linux/generic/pending-4.14/530-jffs2_make_lzma_available.patch @@ -0,0 +1,5180 @@ +From: Alexandros C. Couloumbis +Subject: fs: add jffs2/lzma support (not activated by default yet) + +lede-commit: c2c88d315fa0e881f8b19da07b62859b915b11b2 +Signed-off-by: Alexandros C. Couloumbis +--- + fs/jffs2/Kconfig | 9 + + fs/jffs2/Makefile | 3 + + fs/jffs2/compr.c | 6 + + fs/jffs2/compr.h | 10 +- + fs/jffs2/compr_lzma.c | 128 +++ + fs/jffs2/super.c | 33 +- + include/linux/lzma.h | 62 ++ + include/linux/lzma/LzFind.h | 115 +++ + include/linux/lzma/LzHash.h | 54 + + include/linux/lzma/LzmaDec.h | 231 +++++ + include/linux/lzma/LzmaEnc.h | 80 ++ + include/linux/lzma/Types.h | 226 +++++ + include/uapi/linux/jffs2.h | 1 + + lib/Kconfig | 6 + + lib/Makefile | 12 + + lib/lzma/LzFind.c | 761 ++++++++++++++ + lib/lzma/LzmaDec.c | 999 +++++++++++++++++++ + lib/lzma/LzmaEnc.c | 2271 ++++++++++++++++++++++++++++++++++++++++++ + lib/lzma/Makefile | 7 + + 19 files changed, 5008 insertions(+), 6 deletions(-) + create mode 100644 fs/jffs2/compr_lzma.c + create mode 100644 include/linux/lzma.h + create mode 100644 include/linux/lzma/LzFind.h + create mode 100644 include/linux/lzma/LzHash.h + create mode 100644 include/linux/lzma/LzmaDec.h + create mode 100644 include/linux/lzma/LzmaEnc.h + create mode 100644 include/linux/lzma/Types.h + create mode 100644 lib/lzma/LzFind.c + create mode 100644 lib/lzma/LzmaDec.c + create mode 100644 lib/lzma/LzmaEnc.c + create mode 100644 lib/lzma/Makefile + +--- a/fs/jffs2/Kconfig ++++ b/fs/jffs2/Kconfig +@@ -139,6 +139,15 @@ config JFFS2_LZO + This feature was added in July, 2007. Say 'N' if you need + compatibility with older bootloaders or kernels. + ++config JFFS2_LZMA ++ bool "JFFS2 LZMA compression support" if JFFS2_COMPRESSION_OPTIONS ++ select LZMA_COMPRESS ++ select LZMA_DECOMPRESS ++ depends on JFFS2_FS ++ default n ++ help ++ JFFS2 wrapper to the LZMA C SDK ++ + config JFFS2_RTIME + bool "JFFS2 RTIME compression support" if JFFS2_COMPRESSION_OPTIONS + depends on JFFS2_FS +--- a/fs/jffs2/Makefile ++++ b/fs/jffs2/Makefile +@@ -19,4 +19,7 @@ jffs2-$(CONFIG_JFFS2_RUBIN) += compr_rub + jffs2-$(CONFIG_JFFS2_RTIME) += compr_rtime.o + jffs2-$(CONFIG_JFFS2_ZLIB) += compr_zlib.o + jffs2-$(CONFIG_JFFS2_LZO) += compr_lzo.o ++jffs2-$(CONFIG_JFFS2_LZMA) += compr_lzma.o + jffs2-$(CONFIG_JFFS2_SUMMARY) += summary.o ++ ++CFLAGS_compr_lzma.o += -Iinclude/linux -Ilib/lzma +--- a/fs/jffs2/compr.c ++++ b/fs/jffs2/compr.c +@@ -378,6 +378,9 @@ int __init jffs2_compressors_init(void) + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_init(); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_init(); ++#endif + /* Setting default compression mode */ + #ifdef CONFIG_JFFS2_CMODE_NONE + jffs2_compression_mode = JFFS2_COMPR_MODE_NONE; +@@ -401,6 +404,9 @@ int __init jffs2_compressors_init(void) + int jffs2_compressors_exit(void) + { + /* Unregistering compressors */ ++#ifdef CONFIG_JFFS2_LZMA ++ jffs2_lzma_exit(); ++#endif + #ifdef CONFIG_JFFS2_LZO + jffs2_lzo_exit(); + #endif +--- a/fs/jffs2/compr.h ++++ b/fs/jffs2/compr.h +@@ -29,9 +29,9 @@ + #define JFFS2_DYNRUBIN_PRIORITY 20 + #define JFFS2_LZARI_PRIORITY 30 + #define JFFS2_RTIME_PRIORITY 50 +-#define JFFS2_ZLIB_PRIORITY 60 +-#define JFFS2_LZO_PRIORITY 80 +- ++#define JFFS2_LZMA_PRIORITY 70 ++#define JFFS2_ZLIB_PRIORITY 80 ++#define JFFS2_LZO_PRIORITY 90 + + #define JFFS2_RUBINMIPS_DISABLED /* RUBINs will be used only */ + #define JFFS2_DYNRUBIN_DISABLED /* for decompression */ +@@ -101,5 +101,9 @@ void jffs2_zlib_exit(void); + int jffs2_lzo_init(void); + void jffs2_lzo_exit(void); + #endif ++#ifdef CONFIG_JFFS2_LZMA ++int jffs2_lzma_init(void); ++void jffs2_lzma_exit(void); ++#endif + + #endif /* __JFFS2_COMPR_H__ */ +--- /dev/null ++++ b/fs/jffs2/compr_lzma.c +@@ -0,0 +1,128 @@ ++/* ++ * JFFS2 -- Journalling Flash File System, Version 2. ++ * ++ * For licensing information, see the file 'LICENCE' in this directory. ++ * ++ * JFFS2 wrapper to the LZMA C SDK ++ * ++ */ ++ ++#include ++#include "compr.h" ++ ++#ifdef __KERNEL__ ++ static DEFINE_MUTEX(deflate_mutex); ++#endif ++ ++CLzmaEncHandle *p; ++Byte propsEncoded[LZMA_PROPS_SIZE]; ++SizeT propsSize = sizeof(propsEncoded); ++ ++STATIC void lzma_free_workspace(void) ++{ ++ LzmaEnc_Destroy(p, &lzma_alloc, &lzma_alloc); ++} ++ ++STATIC int INIT lzma_alloc_workspace(CLzmaEncProps *props) ++{ ++ if ((p = (CLzmaEncHandle *)LzmaEnc_Create(&lzma_alloc)) == NULL) ++ { ++ PRINT_ERROR("Failed to allocate lzma deflate workspace\n"); ++ return -ENOMEM; ++ } ++ ++ if (LzmaEnc_SetProps(p, props) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ if (LzmaEnc_WriteProperties(p, propsEncoded, &propsSize) != SZ_OK) ++ { ++ lzma_free_workspace(); ++ return -1; ++ } ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_compress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t *sourcelen, uint32_t *dstlen) ++{ ++ SizeT compress_size = (SizeT)(*dstlen); ++ int ret; ++ ++ #ifdef __KERNEL__ ++ mutex_lock(&deflate_mutex); ++ #endif ++ ++ ret = LzmaEnc_MemEncode(p, cpage_out, &compress_size, data_in, *sourcelen, ++ 0, NULL, &lzma_alloc, &lzma_alloc); ++ ++ #ifdef __KERNEL__ ++ mutex_unlock(&deflate_mutex); ++ #endif ++ ++ if (ret != SZ_OK) ++ return -1; ++ ++ *dstlen = (uint32_t)compress_size; ++ ++ return 0; ++} ++ ++STATIC int jffs2_lzma_decompress(unsigned char *data_in, unsigned char *cpage_out, ++ uint32_t srclen, uint32_t destlen) ++{ ++ int ret; ++ SizeT dl = (SizeT)destlen; ++ SizeT sl = (SizeT)srclen; ++ ELzmaStatus status; ++ ++ ret = LzmaDecode(cpage_out, &dl, data_in, &sl, propsEncoded, ++ propsSize, LZMA_FINISH_ANY, &status, &lzma_alloc); ++ ++ if (ret != SZ_OK || status == LZMA_STATUS_NOT_FINISHED || dl != (SizeT)destlen) ++ return -1; ++ ++ return 0; ++} ++ ++static struct jffs2_compressor jffs2_lzma_comp = { ++ .priority = JFFS2_LZMA_PRIORITY, ++ .name = "lzma", ++ .compr = JFFS2_COMPR_LZMA, ++ .compress = &jffs2_lzma_compress, ++ .decompress = &jffs2_lzma_decompress, ++ .disabled = 0, ++}; ++ ++int INIT jffs2_lzma_init(void) ++{ ++ int ret; ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ ++ props.dictSize = LZMA_BEST_DICT(0x2000); ++ props.level = LZMA_BEST_LEVEL; ++ props.lc = LZMA_BEST_LC; ++ props.lp = LZMA_BEST_LP; ++ props.pb = LZMA_BEST_PB; ++ props.fb = LZMA_BEST_FB; ++ ++ ret = lzma_alloc_workspace(&props); ++ if (ret < 0) ++ return ret; ++ ++ ret = jffs2_register_compressor(&jffs2_lzma_comp); ++ if (ret) ++ lzma_free_workspace(); ++ ++ return ret; ++} ++ ++void jffs2_lzma_exit(void) ++{ ++ jffs2_unregister_compressor(&jffs2_lzma_comp); ++ lzma_free_workspace(); ++} +--- a/fs/jffs2/super.c ++++ b/fs/jffs2/super.c +@@ -372,14 +372,41 @@ static int __init init_jffs2_fs(void) + BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68); + BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32); + +- pr_info("version 2.2." ++ pr_info("version 2.2" + #ifdef CONFIG_JFFS2_FS_WRITEBUFFER + " (NAND)" + #endif + #ifdef CONFIG_JFFS2_SUMMARY +- " (SUMMARY) " ++ " (SUMMARY)" + #endif +- " © 2001-2006 Red Hat, Inc.\n"); ++#ifdef CONFIG_JFFS2_ZLIB ++ " (ZLIB)" ++#endif ++#ifdef CONFIG_JFFS2_LZO ++ " (LZO)" ++#endif ++#ifdef CONFIG_JFFS2_LZMA ++ " (LZMA)" ++#endif ++#ifdef CONFIG_JFFS2_RTIME ++ " (RTIME)" ++#endif ++#ifdef CONFIG_JFFS2_RUBIN ++ " (RUBIN)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_NONE ++ " (CMODE_NONE)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_PRIORITY ++ " (CMODE_PRIORITY)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_SIZE ++ " (CMODE_SIZE)" ++#endif ++#ifdef CONFIG_JFFS2_CMODE_FAVOURLZO ++ " (CMODE_FAVOURLZO)" ++#endif ++ " (c) 2001-2006 Red Hat, Inc.\n"); + + jffs2_inode_cachep = kmem_cache_create("jffs2_i", + sizeof(struct jffs2_inode_info), +--- /dev/null ++++ b/include/linux/lzma.h +@@ -0,0 +1,62 @@ ++#ifndef __LZMA_H__ ++#define __LZMA_H__ ++ ++#ifdef __KERNEL__ ++ #include ++ #include ++ #include ++ #include ++ #include ++ #define LZMA_MALLOC vmalloc ++ #define LZMA_FREE vfree ++ #define PRINT_ERROR(msg) printk(KERN_WARNING #msg) ++ #define INIT __init ++ #define STATIC static ++#else ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #include ++ #ifndef PAGE_SIZE ++ extern int page_size; ++ #define PAGE_SIZE page_size ++ #endif ++ #define LZMA_MALLOC malloc ++ #define LZMA_FREE free ++ #define PRINT_ERROR(msg) fprintf(stderr, msg) ++ #define INIT ++ #define STATIC ++#endif ++ ++#include "lzma/LzmaDec.h" ++#include "lzma/LzmaEnc.h" ++ ++#define LZMA_BEST_LEVEL (9) ++#define LZMA_BEST_LC (0) ++#define LZMA_BEST_LP (0) ++#define LZMA_BEST_PB (0) ++#define LZMA_BEST_FB (273) ++ ++#define LZMA_BEST_DICT(n) (((int)((n) / 2)) * 2) ++ ++static void *p_lzma_malloc(void *p, size_t size) ++{ ++ if (size == 0) ++ return NULL; ++ ++ return LZMA_MALLOC(size); ++} ++ ++static void p_lzma_free(void *p, void *address) ++{ ++ if (address != NULL) ++ LZMA_FREE(address); ++} ++ ++static ISzAlloc lzma_alloc = {p_lzma_malloc, p_lzma_free}; ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzFind.h +@@ -0,0 +1,115 @@ ++/* LzFind.h -- Match finder for LZ algorithms ++2009-04-22 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZ_FIND_H ++#define __LZ_FIND_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++typedef UInt32 CLzRef; ++ ++typedef struct _CMatchFinder ++{ ++ Byte *buffer; ++ UInt32 pos; ++ UInt32 posLimit; ++ UInt32 streamPos; ++ UInt32 lenLimit; ++ ++ UInt32 cyclicBufferPos; ++ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ ++ ++ UInt32 matchMaxLen; ++ CLzRef *hash; ++ CLzRef *son; ++ UInt32 hashMask; ++ UInt32 cutValue; ++ ++ Byte *bufferBase; ++ ISeqInStream *stream; ++ int streamEndWasReached; ++ ++ UInt32 blockSize; ++ UInt32 keepSizeBefore; ++ UInt32 keepSizeAfter; ++ ++ UInt32 numHashBytes; ++ int directInput; ++ size_t directInputRem; ++ int btMode; ++ int bigHash; ++ UInt32 historySize; ++ UInt32 fixedHashSize; ++ UInt32 hashSizeSum; ++ UInt32 numSons; ++ SRes result; ++ UInt32 crc[256]; ++} CMatchFinder; ++ ++#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) ++#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) ++ ++#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) ++ ++int MatchFinder_NeedMove(CMatchFinder *p); ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); ++void MatchFinder_MoveBlock(CMatchFinder *p); ++void MatchFinder_ReadIfRequired(CMatchFinder *p); ++ ++void MatchFinder_Construct(CMatchFinder *p); ++ ++/* Conditions: ++ historySize <= 3 GB ++ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB ++*/ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc); ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, ++ UInt32 *distances, UInt32 maxLen); ++ ++/* ++Conditions: ++ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. ++ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function ++*/ ++ ++typedef void (*Mf_Init_Func)(void *object); ++typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); ++typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); ++typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); ++typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); ++typedef void (*Mf_Skip_Func)(void *object, UInt32); ++ ++typedef struct _IMatchFinder ++{ ++ Mf_Init_Func Init; ++ Mf_GetIndexByte_Func GetIndexByte; ++ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; ++ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; ++ Mf_GetMatches_Func GetMatches; ++ Mf_Skip_Func Skip; ++} IMatchFinder; ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); ++ ++void MatchFinder_Init(CMatchFinder *p); ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzHash.h +@@ -0,0 +1,54 @@ ++/* LzHash.h -- HASH functions for LZ algorithms ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZ_HASH_H ++#define __LZ_HASH_H ++ ++#define kHash2Size (1 << 10) ++#define kHash3Size (1 << 16) ++#define kHash4Size (1 << 20) ++ ++#define kFix3HashSize (kHash2Size) ++#define kFix4HashSize (kHash2Size + kHash3Size) ++#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) ++ ++#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); ++ ++#define HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } ++ ++#define HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } ++ ++#define HASH5_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ ++ hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ ++ hash4Value &= (kHash4Size - 1); } ++ ++/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ ++#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; ++ ++ ++#define MT_HASH2_CALC \ ++ hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); ++ ++#define MT_HASH3_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } ++ ++#define MT_HASH4_CALC { \ ++ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ ++ hash2Value = temp & (kHash2Size - 1); \ ++ hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ ++ hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaDec.h +@@ -0,0 +1,231 @@ ++/* LzmaDec.h -- LZMA Decoder ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZMA_DEC_H ++#define __LZMA_DEC_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* #define _LZMA_PROB32 */ ++/* _LZMA_PROB32 can increase the speed on some CPUs, ++ but memory usage for CLzmaDec::probs will be doubled in that case */ ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++ ++/* ---------- LZMA Properties ---------- */ ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaProps ++{ ++ unsigned lc, lp, pb; ++ UInt32 dicSize; ++} CLzmaProps; ++ ++/* LzmaProps_Decode - decodes properties ++Returns: ++ SZ_OK ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); ++ ++ ++/* ---------- LZMA Decoder state ---------- */ ++ ++/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. ++ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ ++ ++#define LZMA_REQUIRED_INPUT_MAX 20 ++ ++typedef struct ++{ ++ CLzmaProps prop; ++ CLzmaProb *probs; ++ Byte *dic; ++ const Byte *buf; ++ UInt32 range, code; ++ SizeT dicPos; ++ SizeT dicBufSize; ++ UInt32 processedPos; ++ UInt32 checkDicSize; ++ unsigned state; ++ UInt32 reps[4]; ++ unsigned remainLen; ++ int needFlush; ++ int needInitState; ++ UInt32 numProbs; ++ unsigned tempBufSize; ++ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; ++} CLzmaDec; ++ ++#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } ++ ++void LzmaDec_Init(CLzmaDec *p); ++ ++/* There are two types of LZMA streams: ++ 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. ++ 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ ++ ++typedef enum ++{ ++ LZMA_FINISH_ANY, /* finish at any point */ ++ LZMA_FINISH_END /* block must be finished at the end */ ++} ELzmaFinishMode; ++ ++/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! ++ ++ You must use LZMA_FINISH_END, when you know that current output buffer ++ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. ++ ++ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, ++ and output value of destLen will be less than output buffer size limit. ++ You can check status result also. ++ ++ You can use multiple checks to test data integrity after full decompression: ++ 1) Check Result and "status" variable. ++ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. ++ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. ++ You must use correct finish mode in that case. */ ++ ++typedef enum ++{ ++ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ ++ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ ++ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ ++ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ ++} ELzmaStatus; ++ ++/* ELzmaStatus is used only as output value for function call */ ++ ++ ++/* ---------- Interfaces ---------- */ ++ ++/* There are 3 levels of interfaces: ++ 1) Dictionary Interface ++ 2) Buffer Interface ++ 3) One Call Interface ++ You can select any of these interfaces, but don't mix functions from different ++ groups for same object. */ ++ ++ ++/* There are two variants to allocate state for Dictionary Interface: ++ 1) LzmaDec_Allocate / LzmaDec_Free ++ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs ++ You can use variant 2, if you set dictionary buffer manually. ++ For Buffer Interface you must always use variant 1. ++ ++LzmaDec_Allocate* can return: ++ SZ_OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++*/ ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); ++ ++SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); ++void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); ++ ++/* ---------- Dictionary Interface ---------- */ ++ ++/* You can use it, if you want to eliminate the overhead for data copying from ++ dictionary to some other external buffer. ++ You must work with CLzmaDec variables directly in this interface. ++ ++ STEPS: ++ LzmaDec_Constr() ++ LzmaDec_Allocate() ++ for (each new stream) ++ { ++ LzmaDec_Init() ++ while (it needs more decompression) ++ { ++ LzmaDec_DecodeToDic() ++ use data from CLzmaDec::dic and update CLzmaDec::dicPos ++ } ++ } ++ LzmaDec_Free() ++*/ ++ ++/* LzmaDec_DecodeToDic ++ ++ The decoding to internal dictionary buffer (CLzmaDec::dic). ++ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (dicLimit). ++ LZMA_FINISH_ANY - Decode just dicLimit bytes. ++ LZMA_FINISH_END - Stream must be finished after dicLimit. ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_NEEDS_MORE_INPUT ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++*/ ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- Buffer Interface ---------- */ ++ ++/* It's zlib-like interface. ++ See LzmaDec_DecodeToDic description for information about STEPS and return results, ++ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need ++ to work with CLzmaDec variables manually. ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++*/ ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, ++ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); ++ ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaDecode ++ ++finishMode: ++ It has meaning only if the decoding reaches output limit (*destLen). ++ LZMA_FINISH_ANY - Decode just destLen bytes. ++ LZMA_FINISH_END - Stream must be finished after (*destLen). ++ ++Returns: ++ SZ_OK ++ status: ++ LZMA_STATUS_FINISHED_WITH_MARK ++ LZMA_STATUS_NOT_FINISHED ++ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK ++ SZ_ERROR_DATA - Data error ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_UNSUPPORTED - Unsupported properties ++ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). ++*/ ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/LzmaEnc.h +@@ -0,0 +1,80 @@ ++/* LzmaEnc.h -- LZMA Encoder ++2009-02-07 : Igor Pavlov : Public domain */ ++ ++#ifndef __LZMA_ENC_H ++#define __LZMA_ENC_H ++ ++#include "Types.h" ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#define LZMA_PROPS_SIZE 5 ++ ++typedef struct _CLzmaEncProps ++{ ++ int level; /* 0 <= level <= 9 */ ++ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version ++ (1 << 12) <= dictSize <= (1 << 30) for 64-bit version ++ default = (1 << 24) */ ++ int lc; /* 0 <= lc <= 8, default = 3 */ ++ int lp; /* 0 <= lp <= 4, default = 0 */ ++ int pb; /* 0 <= pb <= 4, default = 2 */ ++ int algo; /* 0 - fast, 1 - normal, default = 1 */ ++ int fb; /* 5 <= fb <= 273, default = 32 */ ++ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ ++ int numHashBytes; /* 2, 3 or 4, default = 4 */ ++ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ ++ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ ++ int numThreads; /* 1 or 2, default = 2 */ ++} CLzmaEncProps; ++ ++void LzmaEncProps_Init(CLzmaEncProps *p); ++void LzmaEncProps_Normalize(CLzmaEncProps *p); ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); ++ ++ ++/* ---------- CLzmaEncHandle Interface ---------- */ ++ ++/* LzmaEnc_* functions can return the following exit codes: ++Returns: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater in props ++ SZ_ERROR_WRITE - Write callback error. ++ SZ_ERROR_PROGRESS - some break from progress callback ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++typedef void * CLzmaEncHandle; ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); ++SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++/* ---------- One Call Interface ---------- */ ++ ++/* LzmaEncode ++Return code: ++ SZ_OK - OK ++ SZ_ERROR_MEM - Memory allocation error ++ SZ_ERROR_PARAM - Incorrect paramater ++ SZ_ERROR_OUTPUT_EOF - output buffer overflow ++ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) ++*/ ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif +--- /dev/null ++++ b/include/linux/lzma/Types.h +@@ -0,0 +1,226 @@ ++/* Types.h -- Basic types ++2009-11-23 : Igor Pavlov : Public domain */ ++ ++#ifndef __7Z_TYPES_H ++#define __7Z_TYPES_H ++ ++#include ++ ++#ifdef _WIN32 ++#include ++#endif ++ ++#ifndef EXTERN_C_BEGIN ++#ifdef __cplusplus ++#define EXTERN_C_BEGIN extern "C" { ++#define EXTERN_C_END } ++#else ++#define EXTERN_C_BEGIN ++#define EXTERN_C_END ++#endif ++#endif ++ ++EXTERN_C_BEGIN ++ ++#define SZ_OK 0 ++ ++#define SZ_ERROR_DATA 1 ++#define SZ_ERROR_MEM 2 ++#define SZ_ERROR_CRC 3 ++#define SZ_ERROR_UNSUPPORTED 4 ++#define SZ_ERROR_PARAM 5 ++#define SZ_ERROR_INPUT_EOF 6 ++#define SZ_ERROR_OUTPUT_EOF 7 ++#define SZ_ERROR_READ 8 ++#define SZ_ERROR_WRITE 9 ++#define SZ_ERROR_PROGRESS 10 ++#define SZ_ERROR_FAIL 11 ++#define SZ_ERROR_THREAD 12 ++ ++#define SZ_ERROR_ARCHIVE 16 ++#define SZ_ERROR_NO_ARCHIVE 17 ++ ++typedef int SRes; ++ ++#ifdef _WIN32 ++typedef DWORD WRes; ++#else ++typedef int WRes; ++#endif ++ ++#ifndef RINOK ++#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } ++#endif ++ ++typedef unsigned char Byte; ++typedef short Int16; ++typedef unsigned short UInt16; ++ ++#ifdef _LZMA_UINT32_IS_ULONG ++typedef long Int32; ++typedef unsigned long UInt32; ++#else ++typedef int Int32; ++typedef unsigned int UInt32; ++#endif ++ ++#ifdef _SZ_NO_INT_64 ++ ++/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. ++ NOTES: Some code will work incorrectly in that case! */ ++ ++typedef long Int64; ++typedef unsigned long UInt64; ++ ++#else ++ ++#if defined(_MSC_VER) || defined(__BORLANDC__) ++typedef __int64 Int64; ++typedef unsigned __int64 UInt64; ++#else ++typedef long long int Int64; ++typedef unsigned long long int UInt64; ++#endif ++ ++#endif ++ ++#ifdef _LZMA_NO_SYSTEM_SIZE_T ++typedef UInt32 SizeT; ++#else ++typedef size_t SizeT; ++#endif ++ ++typedef int Bool; ++#define True 1 ++#define False 0 ++ ++ ++#ifdef _WIN32 ++#define MY_STD_CALL __stdcall ++#else ++#define MY_STD_CALL ++#endif ++ ++#ifdef _MSC_VER ++ ++#if _MSC_VER >= 1300 ++#define MY_NO_INLINE __declspec(noinline) ++#else ++#define MY_NO_INLINE ++#endif ++ ++#define MY_CDECL __cdecl ++#define MY_FAST_CALL __fastcall ++ ++#else ++ ++#define MY_CDECL ++#define MY_FAST_CALL ++ ++#endif ++ ++ ++/* The following interfaces use first parameter as pointer to structure */ ++ ++typedef struct ++{ ++ SRes (*Read)(void *p, void *buf, size_t *size); ++ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. ++ (output(*size) < input(*size)) is allowed */ ++} ISeqInStream; ++ ++/* it can return SZ_ERROR_INPUT_EOF */ ++SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); ++SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); ++SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); ++ ++typedef struct ++{ ++ size_t (*Write)(void *p, const void *buf, size_t size); ++ /* Returns: result - the number of actually written bytes. ++ (result < size) means error */ ++} ISeqOutStream; ++ ++typedef enum ++{ ++ SZ_SEEK_SET = 0, ++ SZ_SEEK_CUR = 1, ++ SZ_SEEK_END = 2 ++} ESzSeek; ++ ++typedef struct ++{ ++ SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ ++ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); ++} ISeekInStream; ++ ++typedef struct ++{ ++ SRes (*Look)(void *p, void **buf, size_t *size); ++ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. ++ (output(*size) > input(*size)) is not allowed ++ (output(*size) < input(*size)) is allowed */ ++ SRes (*Skip)(void *p, size_t offset); ++ /* offset must be <= output(*size) of Look */ ++ ++ SRes (*Read)(void *p, void *buf, size_t *size); ++ /* reads directly (without buffer). It's same as ISeqInStream::Read */ ++ SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); ++} ILookInStream; ++ ++SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); ++SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); ++ ++/* reads via ILookInStream::Read */ ++SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); ++SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); ++ ++#define LookToRead_BUF_SIZE (1 << 14) ++ ++typedef struct ++{ ++ ILookInStream s; ++ ISeekInStream *realStream; ++ size_t pos; ++ size_t size; ++ Byte buf[LookToRead_BUF_SIZE]; ++} CLookToRead; ++ ++void LookToRead_CreateVTable(CLookToRead *p, int lookahead); ++void LookToRead_Init(CLookToRead *p); ++ ++typedef struct ++{ ++ ISeqInStream s; ++ ILookInStream *realStream; ++} CSecToLook; ++ ++void SecToLook_CreateVTable(CSecToLook *p); ++ ++typedef struct ++{ ++ ISeqInStream s; ++ ILookInStream *realStream; ++} CSecToRead; ++ ++void SecToRead_CreateVTable(CSecToRead *p); ++ ++typedef struct ++{ ++ SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); ++ /* Returns: result. (result != SZ_OK) means break. ++ Value (UInt64)(Int64)-1 for size means unknown value. */ ++} ICompressProgress; ++ ++typedef struct ++{ ++ void *(*Alloc)(void *p, size_t size); ++ void (*Free)(void *p, void *address); /* address can be 0 */ ++} ISzAlloc; ++ ++#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) ++#define IAlloc_Free(p, a) (p)->Free((p), a) ++ ++EXTERN_C_END ++ ++#endif +--- a/include/uapi/linux/jffs2.h ++++ b/include/uapi/linux/jffs2.h +@@ -46,6 +46,7 @@ + #define JFFS2_COMPR_DYNRUBIN 0x05 + #define JFFS2_COMPR_ZLIB 0x06 + #define JFFS2_COMPR_LZO 0x07 ++#define JFFS2_COMPR_LZMA 0x08 + /* Compatibility flags. */ + #define JFFS2_COMPAT_MASK 0xc000 /* What do to if an unknown nodetype is found */ + #define JFFS2_NODE_ACCURATE 0x2000 +--- a/lib/Kconfig ++++ b/lib/Kconfig +@@ -259,6 +259,12 @@ config ZSTD_DECOMPRESS + + source "lib/xz/Kconfig" + ++config LZMA_COMPRESS ++ tristate ++ ++config LZMA_DECOMPRESS ++ tristate ++ + # + # These all provide a common interface (hence the apparent duplication with + # ZLIB_INFLATE; DECOMPRESS_GZIP is just a wrapper.) +--- a/lib/Makefile ++++ b/lib/Makefile +@@ -3,6 +3,16 @@ + # Makefile for some libs needed in the kernel. + # + ++ifdef CONFIG_JFFS2_ZLIB ++ CONFIG_ZLIB_INFLATE:=y ++ CONFIG_ZLIB_DEFLATE:=y ++endif ++ ++ifdef CONFIG_JFFS2_LZMA ++ CONFIG_LZMA_DECOMPRESS:=y ++ CONFIG_LZMA_COMPRESS:=y ++endif ++ + ifdef CONFIG_FUNCTION_TRACER + ORIG_CFLAGS := $(KBUILD_CFLAGS) + KBUILD_CFLAGS = $(subst $(CC_FLAGS_FTRACE),,$(ORIG_CFLAGS)) +@@ -122,6 +132,8 @@ obj-$(CONFIG_ZSTD_COMPRESS) += zstd/ + obj-$(CONFIG_ZSTD_DECOMPRESS) += zstd/ + obj-$(CONFIG_XZ_DEC) += xz/ + obj-$(CONFIG_RAID6_PQ) += raid6/ ++obj-$(CONFIG_LZMA_COMPRESS) += lzma/ ++obj-$(CONFIG_LZMA_DECOMPRESS) += lzma/ + + lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o + lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o +--- /dev/null ++++ b/lib/lzma/LzFind.c +@@ -0,0 +1,761 @@ ++/* LzFind.c -- Match finder for LZ algorithms ++2009-04-22 : Igor Pavlov : Public domain */ ++ ++#include ++ ++#include "LzFind.h" ++#include "LzHash.h" ++ ++#define kEmptyHashValue 0 ++#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) ++#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ ++#define kNormalizeMask (~(kNormalizeStepMin - 1)) ++#define kMaxHistorySize ((UInt32)3 << 30) ++ ++#define kStartMaxLen 3 ++ ++static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ if (!p->directInput) ++ { ++ alloc->Free(alloc, p->bufferBase); ++ p->bufferBase = 0; ++ } ++} ++ ++/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ ++ ++static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) ++{ ++ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; ++ if (p->directInput) ++ { ++ p->blockSize = blockSize; ++ return 1; ++ } ++ if (p->bufferBase == 0 || p->blockSize != blockSize) ++ { ++ LzInWindow_Free(p, alloc); ++ p->blockSize = blockSize; ++ p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); ++ } ++ return (p->bufferBase != 0); ++} ++ ++Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } ++Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } ++ ++UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } ++ ++void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) ++{ ++ p->posLimit -= subValue; ++ p->pos -= subValue; ++ p->streamPos -= subValue; ++} ++ ++static void MatchFinder_ReadBlock(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached || p->result != SZ_OK) ++ return; ++ if (p->directInput) ++ { ++ UInt32 curSize = 0xFFFFFFFF - p->streamPos; ++ if (curSize > p->directInputRem) ++ curSize = (UInt32)p->directInputRem; ++ p->directInputRem -= curSize; ++ p->streamPos += curSize; ++ if (p->directInputRem == 0) ++ p->streamEndWasReached = 1; ++ return; ++ } ++ for (;;) ++ { ++ Byte *dest = p->buffer + (p->streamPos - p->pos); ++ size_t size = (p->bufferBase + p->blockSize - dest); ++ if (size == 0) ++ return; ++ p->result = p->stream->Read(p->stream, dest, &size); ++ if (p->result != SZ_OK) ++ return; ++ if (size == 0) ++ { ++ p->streamEndWasReached = 1; ++ return; ++ } ++ p->streamPos += (UInt32)size; ++ if (p->streamPos - p->pos > p->keepSizeAfter) ++ return; ++ } ++} ++ ++void MatchFinder_MoveBlock(CMatchFinder *p) ++{ ++ memmove(p->bufferBase, ++ p->buffer - p->keepSizeBefore, ++ (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); ++ p->buffer = p->bufferBase + p->keepSizeBefore; ++} ++ ++int MatchFinder_NeedMove(CMatchFinder *p) ++{ ++ if (p->directInput) ++ return 0; ++ /* if (p->streamEndWasReached) return 0; */ ++ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); ++} ++ ++void MatchFinder_ReadIfRequired(CMatchFinder *p) ++{ ++ if (p->streamEndWasReached) ++ return; ++ if (p->keepSizeAfter >= p->streamPos - p->pos) ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) ++{ ++ if (MatchFinder_NeedMove(p)) ++ MatchFinder_MoveBlock(p); ++ MatchFinder_ReadBlock(p); ++} ++ ++static void MatchFinder_SetDefaultSettings(CMatchFinder *p) ++{ ++ p->cutValue = 32; ++ p->btMode = 1; ++ p->numHashBytes = 4; ++ p->bigHash = 0; ++} ++ ++#define kCrcPoly 0xEDB88320 ++ ++void MatchFinder_Construct(CMatchFinder *p) ++{ ++ UInt32 i; ++ p->bufferBase = 0; ++ p->directInput = 0; ++ p->hash = 0; ++ MatchFinder_SetDefaultSettings(p); ++ ++ for (i = 0; i < 256; i++) ++ { ++ UInt32 r = i; ++ int j; ++ for (j = 0; j < 8; j++) ++ r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); ++ p->crc[i] = r; ++ } ++} ++ ++static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->hash); ++ p->hash = 0; ++} ++ ++void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) ++{ ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ LzInWindow_Free(p, alloc); ++} ++ ++static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) ++{ ++ size_t sizeInBytes = (size_t)num * sizeof(CLzRef); ++ if (sizeInBytes / sizeof(CLzRef) != num) ++ return 0; ++ return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); ++} ++ ++int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, ++ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ++ ISzAlloc *alloc) ++{ ++ UInt32 sizeReserv; ++ if (historySize > kMaxHistorySize) ++ { ++ MatchFinder_Free(p, alloc); ++ return 0; ++ } ++ sizeReserv = historySize >> 1; ++ if (historySize > ((UInt32)2 << 30)) ++ sizeReserv = historySize >> 2; ++ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); ++ ++ p->keepSizeBefore = historySize + keepAddBufferBefore + 1; ++ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; ++ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ ++ if (LzInWindow_Create(p, sizeReserv, alloc)) ++ { ++ UInt32 newCyclicBufferSize = historySize + 1; ++ UInt32 hs; ++ p->matchMaxLen = matchMaxLen; ++ { ++ p->fixedHashSize = 0; ++ if (p->numHashBytes == 2) ++ hs = (1 << 16) - 1; ++ else ++ { ++ hs = historySize - 1; ++ hs |= (hs >> 1); ++ hs |= (hs >> 2); ++ hs |= (hs >> 4); ++ hs |= (hs >> 8); ++ hs >>= 1; ++ hs |= 0xFFFF; /* don't change it! It's required for Deflate */ ++ if (hs > (1 << 24)) ++ { ++ if (p->numHashBytes == 3) ++ hs = (1 << 24) - 1; ++ else ++ hs >>= 1; ++ } ++ } ++ p->hashMask = hs; ++ hs++; ++ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; ++ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; ++ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; ++ hs += p->fixedHashSize; ++ } ++ ++ { ++ UInt32 prevSize = p->hashSizeSum + p->numSons; ++ UInt32 newSize; ++ p->historySize = historySize; ++ p->hashSizeSum = hs; ++ p->cyclicBufferSize = newCyclicBufferSize; ++ p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); ++ newSize = p->hashSizeSum + p->numSons; ++ if (p->hash != 0 && prevSize == newSize) ++ return 1; ++ MatchFinder_FreeThisClassMemory(p, alloc); ++ p->hash = AllocRefs(newSize, alloc); ++ if (p->hash != 0) ++ { ++ p->son = p->hash + p->hashSizeSum; ++ return 1; ++ } ++ } ++ } ++ MatchFinder_Free(p, alloc); ++ return 0; ++} ++ ++static void MatchFinder_SetLimits(CMatchFinder *p) ++{ ++ UInt32 limit = kMaxValForNormalize - p->pos; ++ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; ++ if (limit2 < limit) ++ limit = limit2; ++ limit2 = p->streamPos - p->pos; ++ if (limit2 <= p->keepSizeAfter) ++ { ++ if (limit2 > 0) ++ limit2 = 1; ++ } ++ else ++ limit2 -= p->keepSizeAfter; ++ if (limit2 < limit) ++ limit = limit2; ++ { ++ UInt32 lenLimit = p->streamPos - p->pos; ++ if (lenLimit > p->matchMaxLen) ++ lenLimit = p->matchMaxLen; ++ p->lenLimit = lenLimit; ++ } ++ p->posLimit = p->pos + limit; ++} ++ ++void MatchFinder_Init(CMatchFinder *p) ++{ ++ UInt32 i; ++ for (i = 0; i < p->hashSizeSum; i++) ++ p->hash[i] = kEmptyHashValue; ++ p->cyclicBufferPos = 0; ++ p->buffer = p->bufferBase; ++ p->pos = p->streamPos = p->cyclicBufferSize; ++ p->result = SZ_OK; ++ p->streamEndWasReached = 0; ++ MatchFinder_ReadBlock(p); ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) ++{ ++ return (p->pos - p->historySize - 1) & kNormalizeMask; ++} ++ ++void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) ++{ ++ UInt32 i; ++ for (i = 0; i < numItems; i++) ++ { ++ UInt32 value = items[i]; ++ if (value <= subValue) ++ value = kEmptyHashValue; ++ else ++ value -= subValue; ++ items[i] = value; ++ } ++} ++ ++static void MatchFinder_Normalize(CMatchFinder *p) ++{ ++ UInt32 subValue = MatchFinder_GetSubValue(p); ++ MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); ++ MatchFinder_ReduceOffsets(p, subValue); ++} ++ ++static void MatchFinder_CheckLimits(CMatchFinder *p) ++{ ++ if (p->pos == kMaxValForNormalize) ++ MatchFinder_Normalize(p); ++ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) ++ MatchFinder_CheckAndMoveAndRead(p); ++ if (p->cyclicBufferPos == p->cyclicBufferSize) ++ p->cyclicBufferPos = 0; ++ MatchFinder_SetLimits(p); ++} ++ ++static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ son[_cyclicBufferPos] = curMatch; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ return distances; ++ { ++ const Byte *pb = cur - delta; ++ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; ++ if (pb[maxLen] == cur[maxLen] && *pb == *cur) ++ { ++ UInt32 len = 0; ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ return distances; ++ } ++ } ++ } ++ } ++} ++ ++UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, ++ UInt32 *distances, UInt32 maxLen) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return distances; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ if (++len != lenLimit && pb[len] == cur[len]) ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ if (maxLen < len) ++ { ++ *distances++ = maxLen = len; ++ *distances++ = delta - 1; ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return distances; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, ++ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) ++{ ++ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; ++ CLzRef *ptr1 = son + (_cyclicBufferPos << 1); ++ UInt32 len0 = 0, len1 = 0; ++ for (;;) ++ { ++ UInt32 delta = pos - curMatch; ++ if (cutValue-- == 0 || delta >= _cyclicBufferSize) ++ { ++ *ptr0 = *ptr1 = kEmptyHashValue; ++ return; ++ } ++ { ++ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); ++ const Byte *pb = cur - delta; ++ UInt32 len = (len0 < len1 ? len0 : len1); ++ if (pb[len] == cur[len]) ++ { ++ while (++len != lenLimit) ++ if (pb[len] != cur[len]) ++ break; ++ { ++ if (len == lenLimit) ++ { ++ *ptr1 = pair[0]; ++ *ptr0 = pair[1]; ++ return; ++ } ++ } ++ } ++ if (pb[len] < cur[len]) ++ { ++ *ptr1 = curMatch; ++ ptr1 = pair + 1; ++ curMatch = *ptr1; ++ len1 = len; ++ } ++ else ++ { ++ *ptr0 = curMatch; ++ ptr0 = pair; ++ curMatch = *ptr0; ++ len0 = len; ++ } ++ } ++ } ++} ++ ++#define MOVE_POS \ ++ ++p->cyclicBufferPos; \ ++ p->buffer++; \ ++ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); ++ ++#define MOVE_POS_RET MOVE_POS return offset; ++ ++static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } ++ ++#define GET_MATCHES_HEADER2(minLen, ret_op) \ ++ UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ ++ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ ++ cur = p->buffer; ++ ++#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) ++#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) ++ ++#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue ++ ++#define GET_MATCHES_FOOTER(offset, maxLen) \ ++ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ ++ distances + offset, maxLen) - distances); MOVE_POS_RET; ++ ++#define SKIP_FOOTER \ ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; ++ ++static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 1) ++} ++ ++UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = 0; ++ GET_MATCHES_FOOTER(offset, 2) ++} ++ ++static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, delta2, maxLen, offset; ++ GET_MATCHES_HEADER(3) ++ ++ HASH3_CALC; ++ ++ delta2 = p->pos - p->hash[hash2Value]; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ ++ ++ maxLen = 2; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[0] = maxLen; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ GET_MATCHES_FOOTER(offset, maxLen) ++} ++ ++static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; ++ GET_MATCHES_HEADER(4) ++ ++ HASH4_CALC; ++ ++ delta2 = p->pos - p->hash[ hash2Value]; ++ delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ ++ maxLen = 1; ++ offset = 0; ++ if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) ++ { ++ distances[0] = maxLen = 2; ++ distances[1] = delta2 - 1; ++ offset = 2; ++ } ++ if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) ++ { ++ maxLen = 3; ++ distances[offset + 1] = delta3 - 1; ++ offset += 2; ++ delta2 = delta3; ++ } ++ if (offset != 0) ++ { ++ for (; maxLen != lenLimit; maxLen++) ++ if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) ++ break; ++ distances[offset - 2] = maxLen; ++ if (maxLen == lenLimit) ++ { ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS_RET; ++ } ++ } ++ if (maxLen < 3) ++ maxLen = 3; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances + offset, maxLen) - (distances)); ++ MOVE_POS_RET ++} ++ ++UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) ++{ ++ UInt32 offset; ++ GET_MATCHES_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), ++ distances, 2) - (distances)); ++ MOVE_POS_RET ++} ++ ++static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(2) ++ HASH2_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value; ++ SKIP_HEADER(3) ++ HASH3_CALC; ++ curMatch = p->hash[kFix3HashSize + hashValue]; ++ p->hash[hash2Value] = ++ p->hash[kFix3HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = p->pos; ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ SKIP_FOOTER ++ } ++ while (--num != 0); ++} ++ ++static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ UInt32 hash2Value, hash3Value; ++ SKIP_HEADER(4) ++ HASH4_CALC; ++ curMatch = p->hash[kFix4HashSize + hashValue]; ++ p->hash[ hash2Value] = ++ p->hash[kFix3HashSize + hash3Value] = ++ p->hash[kFix4HashSize + hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) ++{ ++ do ++ { ++ SKIP_HEADER(3) ++ HASH_ZIP_CALC; ++ curMatch = p->hash[hashValue]; ++ p->hash[hashValue] = p->pos; ++ p->son[p->cyclicBufferPos] = curMatch; ++ MOVE_POS ++ } ++ while (--num != 0); ++} ++ ++void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) ++{ ++ vTable->Init = (Mf_Init_Func)MatchFinder_Init; ++ vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; ++ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; ++ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; ++ if (!p->btMode) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 2) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; ++ } ++ else if (p->numHashBytes == 3) ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; ++ } ++ else ++ { ++ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; ++ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; ++ } ++} +--- /dev/null ++++ b/lib/lzma/LzmaDec.c +@@ -0,0 +1,999 @@ ++/* LzmaDec.c -- LZMA Decoder ++2009-09-20 : Igor Pavlov : Public domain */ ++ ++#include "LzmaDec.h" ++ ++#include ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++ ++#define RC_INIT_SIZE 5 ++ ++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); ++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); ++#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ ++ { UPDATE_0(p); i = (i + i); A0; } else \ ++ { UPDATE_1(p); i = (i + i) + 1; A1; } ++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) ++ ++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } ++#define TREE_DECODE(probs, limit, i) \ ++ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } ++ ++/* #define _LZMA_SIZE_OPT */ ++ ++#ifdef _LZMA_SIZE_OPT ++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) ++#else ++#define TREE_6_DECODE(probs, i) \ ++ { i = 1; \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ TREE_GET_BIT(probs, i); \ ++ i -= 0x40; } ++#endif ++ ++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } ++ ++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) ++#define UPDATE_0_CHECK range = bound; ++#define UPDATE_1_CHECK range -= bound; code -= bound; ++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ ++ { UPDATE_0_CHECK; i = (i + i); A0; } else \ ++ { UPDATE_1_CHECK; i = (i + i) + 1; A1; } ++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) ++#define TREE_DECODE_CHECK(probs, limit, i) \ ++ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; } ++ ++ ++#define kNumPosBitsMax 4 ++#define kNumPosStatesMax (1 << kNumPosBitsMax) ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define LenChoice 0 ++#define LenChoice2 (LenChoice + 1) ++#define LenLow (LenChoice2 + 1) ++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) ++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) ++#define kNumLenProbs (LenHigh + kLenNumHighSymbols) ++ ++ ++#define kNumStates 12 ++#define kNumLitStates 7 ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#define kNumPosSlotBits 6 ++#define kNumLenToPosStates 4 ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++ ++#define kMatchMinLen 2 ++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define IsMatch 0 ++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) ++#define IsRepG0 (IsRep + kNumStates) ++#define IsRepG1 (IsRepG0 + kNumStates) ++#define IsRepG2 (IsRepG1 + kNumStates) ++#define IsRep0Long (IsRepG2 + kNumStates) ++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) ++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) ++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) ++#define LenCoder (Align + kAlignTableSize) ++#define RepLenCoder (LenCoder + kNumLenProbs) ++#define Literal (RepLenCoder + kNumLenProbs) ++ ++#define LZMA_BASE_SIZE 1846 ++#define LZMA_LIT_SIZE 768 ++ ++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) ++ ++#if Literal != LZMA_BASE_SIZE ++StopCompilingDueBUG ++#endif ++ ++#define LZMA_DIC_MIN (1 << 12) ++ ++/* First LZMA-symbol is always decoded. ++And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization ++Out: ++ Result: ++ SZ_OK - OK ++ SZ_ERROR_DATA - Error ++ p->remainLen: ++ < kMatchSpecLenStart : normal remain ++ = kMatchSpecLenStart : finished ++ = kMatchSpecLenStart + 1 : Flush marker ++ = kMatchSpecLenStart + 2 : State Init Marker ++*/ ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ CLzmaProb *probs = p->probs; ++ ++ unsigned state = p->state; ++ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; ++ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; ++ unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; ++ unsigned lc = p->prop.lc; ++ ++ Byte *dic = p->dic; ++ SizeT dicBufSize = p->dicBufSize; ++ SizeT dicPos = p->dicPos; ++ ++ UInt32 processedPos = p->processedPos; ++ UInt32 checkDicSize = p->checkDicSize; ++ unsigned len = 0; ++ ++ const Byte *buf = p->buf; ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ ++ do ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = processedPos & pbMask; ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ unsigned symbol; ++ UPDATE_0(prob); ++ prob = probs + Literal; ++ if (checkDicSize != 0 || processedPos != 0) ++ prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + ++ (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ state -= (state < 4) ? state : 3; ++ symbol = 1; ++ do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ state -= (state < 10) ? 3 : 6; ++ symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ dic[dicPos++] = (Byte)symbol; ++ processedPos++; ++ continue; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRep + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ state += kNumStates; ++ prob = probs + LenCoder; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ if (checkDicSize == 0 && processedPos == 0) ++ return SZ_ERROR_DATA; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ processedPos++; ++ state = state < kNumLitStates ? 9 : 11; ++ continue; ++ } ++ UPDATE_1(prob); ++ } ++ else ++ { ++ UInt32 distance; ++ UPDATE_1(prob); ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep1; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0(prob) ++ { ++ UPDATE_0(prob); ++ distance = rep2; ++ } ++ else ++ { ++ UPDATE_1(prob); ++ distance = rep3; ++ rep3 = rep2; ++ } ++ rep2 = rep1; ++ } ++ rep1 = rep0; ++ rep0 = distance; ++ } ++ state = state < kNumLitStates ? 8 : 11; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = (1 << kLenNumLowBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenChoice2; ++ IF_BIT_0(probLen) ++ { ++ UPDATE_0(probLen); ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = (1 << kLenNumMidBits); ++ } ++ else ++ { ++ UPDATE_1(probLen); ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = (1 << kLenNumHighBits); ++ } ++ } ++ TREE_DECODE(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state >= kNumStates) ++ { ++ UInt32 distance; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); ++ TREE_6_DECODE(prob, distance); ++ if (distance >= kStartPosModelIndex) ++ { ++ unsigned posSlot = (unsigned)distance; ++ int numDirectBits = (int)(((distance >> 1) - 1)); ++ distance = (2 | (distance & 1)); ++ if (posSlot < kEndPosModelIndex) ++ { ++ distance <<= numDirectBits; ++ prob = probs + SpecPos + distance - posSlot - 1; ++ { ++ UInt32 mask = 1; ++ unsigned i = 1; ++ do ++ { ++ GET_BIT2(prob + i, i, ; , distance |= mask); ++ mask <<= 1; ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE ++ range >>= 1; ++ ++ { ++ UInt32 t; ++ code -= range; ++ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ ++ distance = (distance << 1) + (t + 1); ++ code += range & t; ++ } ++ /* ++ distance <<= 1; ++ if (code >= range) ++ { ++ code -= range; ++ distance |= 1; ++ } ++ */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ distance <<= kNumAlignBits; ++ { ++ unsigned i = 1; ++ GET_BIT2(prob + i, i, ; , distance |= 1); ++ GET_BIT2(prob + i, i, ; , distance |= 2); ++ GET_BIT2(prob + i, i, ; , distance |= 4); ++ GET_BIT2(prob + i, i, ; , distance |= 8); ++ } ++ if (distance == (UInt32)0xFFFFFFFF) ++ { ++ len += kMatchSpecLenStart; ++ state -= kNumStates; ++ break; ++ } ++ } ++ } ++ rep3 = rep2; ++ rep2 = rep1; ++ rep1 = rep0; ++ rep0 = distance + 1; ++ if (checkDicSize == 0) ++ { ++ if (distance >= processedPos) ++ return SZ_ERROR_DATA; ++ } ++ else if (distance >= checkDicSize) ++ return SZ_ERROR_DATA; ++ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; ++ } ++ ++ len += kMatchMinLen; ++ ++ if (limit == dicPos) ++ return SZ_ERROR_DATA; ++ { ++ SizeT rem = limit - dicPos; ++ unsigned curLen = ((rem < len) ? (unsigned)rem : len); ++ SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); ++ ++ processedPos += curLen; ++ ++ len -= curLen; ++ if (pos + curLen <= dicBufSize) ++ { ++ Byte *dest = dic + dicPos; ++ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; ++ const Byte *lim = dest + curLen; ++ dicPos += curLen; ++ do ++ *(dest) = (Byte)*(dest + src); ++ while (++dest != lim); ++ } ++ else ++ { ++ do ++ { ++ dic[dicPos++] = dic[pos]; ++ if (++pos == dicBufSize) ++ pos = 0; ++ } ++ while (--curLen != 0); ++ } ++ } ++ } ++ } ++ while (dicPos < limit && buf < bufLimit); ++ NORMALIZE; ++ p->buf = buf; ++ p->range = range; ++ p->code = code; ++ p->remainLen = len; ++ p->dicPos = dicPos; ++ p->processedPos = processedPos; ++ p->reps[0] = rep0; ++ p->reps[1] = rep1; ++ p->reps[2] = rep2; ++ p->reps[3] = rep3; ++ p->state = state; ++ ++ return SZ_OK; ++} ++ ++static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) ++{ ++ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) ++ { ++ Byte *dic = p->dic; ++ SizeT dicPos = p->dicPos; ++ SizeT dicBufSize = p->dicBufSize; ++ unsigned len = p->remainLen; ++ UInt32 rep0 = p->reps[0]; ++ if (limit - dicPos < len) ++ len = (unsigned)(limit - dicPos); ++ ++ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) ++ p->checkDicSize = p->prop.dicSize; ++ ++ p->processedPos += len; ++ p->remainLen -= len; ++ while (len-- != 0) ++ { ++ dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; ++ dicPos++; ++ } ++ p->dicPos = dicPos; ++ } ++} ++ ++static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) ++{ ++ do ++ { ++ SizeT limit2 = limit; ++ if (p->checkDicSize == 0) ++ { ++ UInt32 rem = p->prop.dicSize - p->processedPos; ++ if (limit - p->dicPos > rem) ++ limit2 = p->dicPos + rem; ++ } ++ RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); ++ if (p->processedPos >= p->prop.dicSize) ++ p->checkDicSize = p->prop.dicSize; ++ LzmaDec_WriteRem(p, limit); ++ } ++ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); ++ ++ if (p->remainLen > kMatchSpecLenStart) ++ { ++ p->remainLen = kMatchSpecLenStart; ++ } ++ return 0; ++} ++ ++typedef enum ++{ ++ DUMMY_ERROR, /* unexpected end of input stream */ ++ DUMMY_LIT, ++ DUMMY_MATCH, ++ DUMMY_REP ++} ELzmaDummy; ++ ++static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) ++{ ++ UInt32 range = p->range; ++ UInt32 code = p->code; ++ const Byte *bufLimit = buf + inSize; ++ CLzmaProb *probs = p->probs; ++ unsigned state = p->state; ++ ELzmaDummy res; ++ ++ { ++ CLzmaProb *prob; ++ UInt32 bound; ++ unsigned ttt; ++ unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); ++ ++ prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK ++ ++ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ ++ ++ prob = probs + Literal; ++ if (p->checkDicSize != 0 || p->processedPos != 0) ++ prob += (LZMA_LIT_SIZE * ++ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + ++ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); ++ ++ if (state < kNumLitStates) ++ { ++ unsigned symbol = 1; ++ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); ++ } ++ else ++ { ++ unsigned matchByte = p->dic[p->dicPos - p->reps[0] + ++ ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; ++ unsigned offs = 0x100; ++ unsigned symbol = 1; ++ do ++ { ++ unsigned bit; ++ CLzmaProb *probLit; ++ matchByte <<= 1; ++ bit = (matchByte & offs); ++ probLit = prob + offs + bit + symbol; ++ GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) ++ } ++ while (symbol < 0x100); ++ } ++ res = DUMMY_LIT; ++ } ++ else ++ { ++ unsigned len; ++ UPDATE_1_CHECK; ++ ++ prob = probs + IsRep + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ state = 0; ++ prob = probs + LenCoder; ++ res = DUMMY_MATCH; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ res = DUMMY_REP; ++ prob = probs + IsRepG0 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ NORMALIZE_CHECK; ++ return DUMMY_REP; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG1 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ prob = probs + IsRepG2 + state; ++ IF_BIT_0_CHECK(prob) ++ { ++ UPDATE_0_CHECK; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ } ++ } ++ } ++ state = kNumStates; ++ prob = probs + RepLenCoder; ++ } ++ { ++ unsigned limit, offset; ++ CLzmaProb *probLen = prob + LenChoice; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenLow + (posState << kLenNumLowBits); ++ offset = 0; ++ limit = 1 << kLenNumLowBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenChoice2; ++ IF_BIT_0_CHECK(probLen) ++ { ++ UPDATE_0_CHECK; ++ probLen = prob + LenMid + (posState << kLenNumMidBits); ++ offset = kLenNumLowSymbols; ++ limit = 1 << kLenNumMidBits; ++ } ++ else ++ { ++ UPDATE_1_CHECK; ++ probLen = prob + LenHigh; ++ offset = kLenNumLowSymbols + kLenNumMidSymbols; ++ limit = 1 << kLenNumHighBits; ++ } ++ } ++ TREE_DECODE_CHECK(probLen, limit, len); ++ len += offset; ++ } ++ ++ if (state < 4) ++ { ++ unsigned posSlot; ++ prob = probs + PosSlot + ++ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << ++ kNumPosSlotBits); ++ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); ++ if (posSlot >= kStartPosModelIndex) ++ { ++ int numDirectBits = ((posSlot >> 1) - 1); ++ ++ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ ++ ++ if (posSlot < kEndPosModelIndex) ++ { ++ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; ++ } ++ else ++ { ++ numDirectBits -= kNumAlignBits; ++ do ++ { ++ NORMALIZE_CHECK ++ range >>= 1; ++ code -= range & (((code - range) >> 31) - 1); ++ /* if (code >= range) code -= range; */ ++ } ++ while (--numDirectBits != 0); ++ prob = probs + Align; ++ numDirectBits = kNumAlignBits; ++ } ++ { ++ unsigned i = 1; ++ do ++ { ++ GET_BIT_CHECK(prob + i, i); ++ } ++ while (--numDirectBits != 0); ++ } ++ } ++ } ++ } ++ } ++ NORMALIZE_CHECK; ++ return res; ++} ++ ++ ++static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) ++{ ++ p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); ++ p->range = 0xFFFFFFFF; ++ p->needFlush = 0; ++} ++ ++void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) ++{ ++ p->needFlush = 1; ++ p->remainLen = 0; ++ p->tempBufSize = 0; ++ ++ if (initDic) ++ { ++ p->processedPos = 0; ++ p->checkDicSize = 0; ++ p->needInitState = 1; ++ } ++ if (initState) ++ p->needInitState = 1; ++} ++ ++void LzmaDec_Init(CLzmaDec *p) ++{ ++ p->dicPos = 0; ++ LzmaDec_InitDicAndState(p, True, True); ++} ++ ++static void LzmaDec_InitStateReal(CLzmaDec *p) ++{ ++ UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); ++ UInt32 i; ++ CLzmaProb *probs = p->probs; ++ for (i = 0; i < numProbs; i++) ++ probs[i] = kBitModelTotal >> 1; ++ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; ++ p->state = 0; ++ p->needInitState = 0; ++} ++ ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, ++ ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT inSize = *srcLen; ++ (*srcLen) = 0; ++ LzmaDec_WriteRem(p, dicLimit); ++ ++ *status = LZMA_STATUS_NOT_SPECIFIED; ++ ++ while (p->remainLen != kMatchSpecLenStart) ++ { ++ int checkEndMarkNow; ++ ++ if (p->needFlush != 0) ++ { ++ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) ++ p->tempBuf[p->tempBufSize++] = *src++; ++ if (p->tempBufSize < RC_INIT_SIZE) ++ { ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (p->tempBuf[0] != 0) ++ return SZ_ERROR_DATA; ++ ++ LzmaDec_InitRc(p, p->tempBuf); ++ p->tempBufSize = 0; ++ } ++ ++ checkEndMarkNow = 0; ++ if (p->dicPos >= dicLimit) ++ { ++ if (p->remainLen == 0 && p->code == 0) ++ { ++ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; ++ return SZ_OK; ++ } ++ if (finishMode == LZMA_FINISH_ANY) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_OK; ++ } ++ if (p->remainLen != 0) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ checkEndMarkNow = 1; ++ } ++ ++ if (p->needInitState) ++ LzmaDec_InitStateReal(p); ++ ++ if (p->tempBufSize == 0) ++ { ++ SizeT processed; ++ const Byte *bufLimit; ++ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, src, inSize); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ memcpy(p->tempBuf, src, inSize); ++ p->tempBufSize = (unsigned)inSize; ++ (*srcLen) += inSize; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ bufLimit = src; ++ } ++ else ++ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; ++ p->buf = src; ++ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) ++ return SZ_ERROR_DATA; ++ processed = (SizeT)(p->buf - src); ++ (*srcLen) += processed; ++ src += processed; ++ inSize -= processed; ++ } ++ else ++ { ++ unsigned rem = p->tempBufSize, lookAhead = 0; ++ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) ++ p->tempBuf[rem++] = src[lookAhead++]; ++ p->tempBufSize = rem; ++ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) ++ { ++ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); ++ if (dummyRes == DUMMY_ERROR) ++ { ++ (*srcLen) += lookAhead; ++ *status = LZMA_STATUS_NEEDS_MORE_INPUT; ++ return SZ_OK; ++ } ++ if (checkEndMarkNow && dummyRes != DUMMY_MATCH) ++ { ++ *status = LZMA_STATUS_NOT_FINISHED; ++ return SZ_ERROR_DATA; ++ } ++ } ++ p->buf = p->tempBuf; ++ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) ++ return SZ_ERROR_DATA; ++ lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); ++ (*srcLen) += lookAhead; ++ src += lookAhead; ++ inSize -= lookAhead; ++ p->tempBufSize = 0; ++ } ++ } ++ if (p->code == 0) ++ *status = LZMA_STATUS_FINISHED_WITH_MARK; ++ return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; ++} ++ ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) ++{ ++ SizeT outSize = *destLen; ++ SizeT inSize = *srcLen; ++ *srcLen = *destLen = 0; ++ for (;;) ++ { ++ SizeT inSizeCur = inSize, outSizeCur, dicPos; ++ ELzmaFinishMode curFinishMode; ++ SRes res; ++ if (p->dicPos == p->dicBufSize) ++ p->dicPos = 0; ++ dicPos = p->dicPos; ++ if (outSize > p->dicBufSize - dicPos) ++ { ++ outSizeCur = p->dicBufSize; ++ curFinishMode = LZMA_FINISH_ANY; ++ } ++ else ++ { ++ outSizeCur = dicPos + outSize; ++ curFinishMode = finishMode; ++ } ++ ++ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); ++ src += inSizeCur; ++ inSize -= inSizeCur; ++ *srcLen += inSizeCur; ++ outSizeCur = p->dicPos - dicPos; ++ memcpy(dest, p->dic + dicPos, outSizeCur); ++ dest += outSizeCur; ++ outSize -= outSizeCur; ++ *destLen += outSizeCur; ++ if (res != 0) ++ return res; ++ if (outSizeCur == 0 || outSize == 0) ++ return SZ_OK; ++ } ++} ++ ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->probs); ++ p->probs = 0; ++} ++ ++static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->dic); ++ p->dic = 0; ++} ++ ++void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) ++{ ++ LzmaDec_FreeProbs(p, alloc); ++ LzmaDec_FreeDict(p, alloc); ++} ++ ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) ++{ ++ UInt32 dicSize; ++ Byte d; ++ ++ if (size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_UNSUPPORTED; ++ else ++ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); ++ ++ if (dicSize < LZMA_DIC_MIN) ++ dicSize = LZMA_DIC_MIN; ++ p->dicSize = dicSize; ++ ++ d = data[0]; ++ if (d >= (9 * 5 * 5)) ++ return SZ_ERROR_UNSUPPORTED; ++ ++ p->lc = d % 9; ++ d /= 9; ++ p->pb = d / 5; ++ p->lp = d % 5; ++ ++ return SZ_OK; ++} ++ ++static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) ++{ ++ UInt32 numProbs = LzmaProps_GetNumProbs(propNew); ++ if (p->probs == 0 || numProbs != p->numProbs) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); ++ p->numProbs = numProbs; ++ if (p->probs == 0) ++ return SZ_ERROR_MEM; ++ } ++ return SZ_OK; ++} ++ ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) ++{ ++ CLzmaProps propNew; ++ SizeT dicBufSize; ++ RINOK(LzmaProps_Decode(&propNew, props, propsSize)); ++ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); ++ dicBufSize = propNew.dicSize; ++ if (p->dic == 0 || dicBufSize != p->dicBufSize) ++ { ++ LzmaDec_FreeDict(p, alloc); ++ p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); ++ if (p->dic == 0) ++ { ++ LzmaDec_FreeProbs(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ } ++ p->dicBufSize = dicBufSize; ++ p->prop = propNew; ++ return SZ_OK; ++} ++ ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ++ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, ++ ELzmaStatus *status, ISzAlloc *alloc) ++{ ++ CLzmaDec p; ++ SRes res; ++ SizeT inSize = *srcLen; ++ SizeT outSize = *destLen; ++ *srcLen = *destLen = 0; ++ if (inSize < RC_INIT_SIZE) ++ return SZ_ERROR_INPUT_EOF; ++ ++ LzmaDec_Construct(&p); ++ res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); ++ if (res != 0) ++ return res; ++ p.dic = dest; ++ p.dicBufSize = outSize; ++ ++ LzmaDec_Init(&p); ++ ++ *srcLen = inSize; ++ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); ++ ++ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) ++ res = SZ_ERROR_INPUT_EOF; ++ ++ (*destLen) = p.dicPos; ++ LzmaDec_FreeProbs(&p, alloc); ++ return res; ++} +--- /dev/null ++++ b/lib/lzma/LzmaEnc.c +@@ -0,0 +1,2271 @@ ++/* LzmaEnc.c -- LZMA Encoder ++2009-11-24 : Igor Pavlov : Public domain */ ++ ++#include ++ ++/* #define SHOW_STAT */ ++/* #define SHOW_STAT2 */ ++ ++#if defined(SHOW_STAT) || defined(SHOW_STAT2) ++#include ++#endif ++ ++#include "LzmaEnc.h" ++ ++/* disable MT */ ++#define _7ZIP_ST ++ ++#include "LzFind.h" ++#ifndef _7ZIP_ST ++#include "LzFindMt.h" ++#endif ++ ++#ifdef SHOW_STAT ++static int ttt = 0; ++#endif ++ ++#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) ++ ++#define kBlockSize (9 << 10) ++#define kUnpackBlockSize (1 << 18) ++#define kMatchArraySize (1 << 21) ++#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) ++ ++#define kNumMaxDirectBits (31) ++ ++#define kNumTopBits 24 ++#define kTopValue ((UInt32)1 << kNumTopBits) ++ ++#define kNumBitModelTotalBits 11 ++#define kBitModelTotal (1 << kNumBitModelTotalBits) ++#define kNumMoveBits 5 ++#define kProbInitValue (kBitModelTotal >> 1) ++ ++#define kNumMoveReducingBits 4 ++#define kNumBitPriceShiftBits 4 ++#define kBitPrice (1 << kNumBitPriceShiftBits) ++ ++void LzmaEncProps_Init(CLzmaEncProps *p) ++{ ++ p->level = 5; ++ p->dictSize = p->mc = 0; ++ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; ++ p->writeEndMark = 0; ++} ++ ++void LzmaEncProps_Normalize(CLzmaEncProps *p) ++{ ++ int level = p->level; ++ if (level < 0) level = 5; ++ p->level = level; ++ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); ++ if (p->lc < 0) p->lc = 3; ++ if (p->lp < 0) p->lp = 0; ++ if (p->pb < 0) p->pb = 2; ++ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); ++ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); ++ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); ++ if (p->numHashBytes < 0) p->numHashBytes = 4; ++ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); ++ if (p->numThreads < 0) ++ p->numThreads = ++ #ifndef _7ZIP_ST ++ ((p->btMode && p->algo) ? 2 : 1); ++ #else ++ 1; ++ #endif ++} ++ ++UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) ++{ ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ return props.dictSize; ++} ++ ++/* #define LZMA_LOG_BSR */ ++/* Define it for Intel's CPU */ ++ ++ ++#ifdef LZMA_LOG_BSR ++ ++#define kDicLogSizeMaxCompress 30 ++ ++#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } ++ ++UInt32 GetPosSlot1(UInt32 pos) ++{ ++ UInt32 res; ++ BSR2_RET(pos, res); ++ return res; ++} ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } ++ ++#else ++ ++#define kNumLogBits (9 + (int)sizeof(size_t) / 2) ++#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) ++ ++void LzmaEnc_FastPosInit(Byte *g_FastPos) ++{ ++ int c = 2, slotFast; ++ g_FastPos[0] = 0; ++ g_FastPos[1] = 1; ++ ++ for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) ++ { ++ UInt32 k = (1 << ((slotFast >> 1) - 1)); ++ UInt32 j; ++ for (j = 0; j < k; j++, c++) ++ g_FastPos[c] = (Byte)slotFast; ++ } ++} ++ ++#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ ++ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ ++ res = p->g_FastPos[pos >> i] + (i * 2); } ++/* ++#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ ++ p->g_FastPos[pos >> 6] + 12 : \ ++ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } ++*/ ++ ++#define GetPosSlot1(pos) p->g_FastPos[pos] ++#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } ++#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } ++ ++#endif ++ ++ ++#define LZMA_NUM_REPS 4 ++ ++typedef unsigned CState; ++ ++typedef struct ++{ ++ UInt32 price; ++ ++ CState state; ++ int prev1IsChar; ++ int prev2; ++ ++ UInt32 posPrev2; ++ UInt32 backPrev2; ++ ++ UInt32 posPrev; ++ UInt32 backPrev; ++ UInt32 backs[LZMA_NUM_REPS]; ++} COptimal; ++ ++#define kNumOpts (1 << 12) ++ ++#define kNumLenToPosStates 4 ++#define kNumPosSlotBits 6 ++#define kDicLogSizeMin 0 ++#define kDicLogSizeMax 32 ++#define kDistTableSizeMax (kDicLogSizeMax * 2) ++ ++ ++#define kNumAlignBits 4 ++#define kAlignTableSize (1 << kNumAlignBits) ++#define kAlignMask (kAlignTableSize - 1) ++ ++#define kStartPosModelIndex 4 ++#define kEndPosModelIndex 14 ++#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) ++ ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) ++ ++#ifdef _LZMA_PROB32 ++#define CLzmaProb UInt32 ++#else ++#define CLzmaProb UInt16 ++#endif ++ ++#define LZMA_PB_MAX 4 ++#define LZMA_LC_MAX 8 ++#define LZMA_LP_MAX 4 ++ ++#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) ++ ++ ++#define kLenNumLowBits 3 ++#define kLenNumLowSymbols (1 << kLenNumLowBits) ++#define kLenNumMidBits 3 ++#define kLenNumMidSymbols (1 << kLenNumMidBits) ++#define kLenNumHighBits 8 ++#define kLenNumHighSymbols (1 << kLenNumHighBits) ++ ++#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) ++ ++#define LZMA_MATCH_LEN_MIN 2 ++#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) ++ ++#define kNumStates 12 ++ ++typedef struct ++{ ++ CLzmaProb choice; ++ CLzmaProb choice2; ++ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; ++ CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; ++ CLzmaProb high[kLenNumHighSymbols]; ++} CLenEnc; ++ ++typedef struct ++{ ++ CLenEnc p; ++ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; ++ UInt32 tableSize; ++ UInt32 counters[LZMA_NUM_PB_STATES_MAX]; ++} CLenPriceEnc; ++ ++typedef struct ++{ ++ UInt32 range; ++ Byte cache; ++ UInt64 low; ++ UInt64 cacheSize; ++ Byte *buf; ++ Byte *bufLim; ++ Byte *bufBase; ++ ISeqOutStream *outStream; ++ UInt64 processed; ++ SRes res; ++} CRangeEnc; ++ ++typedef struct ++{ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++} CSaveState; ++ ++typedef struct ++{ ++ IMatchFinder matchFinder; ++ void *matchFinderObj; ++ ++ #ifndef _7ZIP_ST ++ Bool mtMode; ++ CMatchFinderMt matchFinderMt; ++ #endif ++ ++ CMatchFinder matchFinderBase; ++ ++ #ifndef _7ZIP_ST ++ Byte pad[128]; ++ #endif ++ ++ UInt32 optimumEndIndex; ++ UInt32 optimumCurrentIndex; ++ ++ UInt32 longestMatchLength; ++ UInt32 numPairs; ++ UInt32 numAvail; ++ COptimal opt[kNumOpts]; ++ ++ #ifndef LZMA_LOG_BSR ++ Byte g_FastPos[1 << kNumLogBits]; ++ #endif ++ ++ UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; ++ UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; ++ UInt32 numFastBytes; ++ UInt32 additionalOffset; ++ UInt32 reps[LZMA_NUM_REPS]; ++ UInt32 state; ++ ++ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; ++ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; ++ UInt32 alignPrices[kAlignTableSize]; ++ UInt32 alignPriceCount; ++ ++ UInt32 distTableSize; ++ ++ unsigned lc, lp, pb; ++ unsigned lpMask, pbMask; ++ ++ CLzmaProb *litProbs; ++ ++ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ CLzmaProb isRep[kNumStates]; ++ CLzmaProb isRepG0[kNumStates]; ++ CLzmaProb isRepG1[kNumStates]; ++ CLzmaProb isRepG2[kNumStates]; ++ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; ++ ++ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; ++ CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; ++ CLzmaProb posAlignEncoder[1 << kNumAlignBits]; ++ ++ CLenPriceEnc lenEnc; ++ CLenPriceEnc repLenEnc; ++ ++ unsigned lclp; ++ ++ Bool fastMode; ++ ++ CRangeEnc rc; ++ ++ Bool writeEndMark; ++ UInt64 nowPos64; ++ UInt32 matchPriceCount; ++ Bool finished; ++ Bool multiThread; ++ ++ SRes result; ++ UInt32 dictSize; ++ UInt32 matchFinderCycles; ++ ++ int needInit; ++ ++ CSaveState saveState; ++} CLzmaEnc; ++ ++void LzmaEnc_SaveState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CSaveState *dest = &p->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); ++} ++ ++void LzmaEnc_RestoreState(CLzmaEncHandle pp) ++{ ++ CLzmaEnc *dest = (CLzmaEnc *)pp; ++ const CSaveState *p = &dest->saveState; ++ int i; ++ dest->lenEnc = p->lenEnc; ++ dest->repLenEnc = p->repLenEnc; ++ dest->state = p->state; ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); ++ memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); ++ } ++ for (i = 0; i < kNumLenToPosStates; i++) ++ memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); ++ memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); ++ memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); ++ memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); ++ memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); ++ memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); ++ memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); ++ memcpy(dest->reps, p->reps, sizeof(p->reps)); ++ memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); ++} ++ ++SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ CLzmaEncProps props = *props2; ++ LzmaEncProps_Normalize(&props); ++ ++ if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || ++ props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) ++ return SZ_ERROR_PARAM; ++ p->dictSize = props.dictSize; ++ p->matchFinderCycles = props.mc; ++ { ++ unsigned fb = props.fb; ++ if (fb < 5) ++ fb = 5; ++ if (fb > LZMA_MATCH_LEN_MAX) ++ fb = LZMA_MATCH_LEN_MAX; ++ p->numFastBytes = fb; ++ } ++ p->lc = props.lc; ++ p->lp = props.lp; ++ p->pb = props.pb; ++ p->fastMode = (props.algo == 0); ++ p->matchFinderBase.btMode = props.btMode; ++ { ++ UInt32 numHashBytes = 4; ++ if (props.btMode) ++ { ++ if (props.numHashBytes < 2) ++ numHashBytes = 2; ++ else if (props.numHashBytes < 4) ++ numHashBytes = props.numHashBytes; ++ } ++ p->matchFinderBase.numHashBytes = numHashBytes; ++ } ++ ++ p->matchFinderBase.cutValue = props.mc; ++ ++ p->writeEndMark = props.writeEndMark; ++ ++ #ifndef _7ZIP_ST ++ /* ++ if (newMultiThread != _multiThread) ++ { ++ ReleaseMatchFinder(); ++ _multiThread = newMultiThread; ++ } ++ */ ++ p->multiThread = (props.numThreads > 1); ++ #endif ++ ++ return SZ_OK; ++} ++ ++static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; ++static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; ++static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; ++static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; ++ ++#define IsCharState(s) ((s) < 7) ++ ++#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) ++ ++#define kInfinityPrice (1 << 30) ++ ++static void RangeEnc_Construct(CRangeEnc *p) ++{ ++ p->outStream = 0; ++ p->bufBase = 0; ++} ++ ++#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) ++ ++#define RC_BUF_SIZE (1 << 16) ++static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ if (p->bufBase == 0) ++ { ++ p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); ++ if (p->bufBase == 0) ++ return 0; ++ p->bufLim = p->bufBase + RC_BUF_SIZE; ++ } ++ return 1; ++} ++ ++static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->bufBase); ++ p->bufBase = 0; ++} ++ ++static void RangeEnc_Init(CRangeEnc *p) ++{ ++ /* Stream.Init(); */ ++ p->low = 0; ++ p->range = 0xFFFFFFFF; ++ p->cacheSize = 1; ++ p->cache = 0; ++ ++ p->buf = p->bufBase; ++ ++ p->processed = 0; ++ p->res = SZ_OK; ++} ++ ++static void RangeEnc_FlushStream(CRangeEnc *p) ++{ ++ size_t num; ++ if (p->res != SZ_OK) ++ return; ++ num = p->buf - p->bufBase; ++ if (num != p->outStream->Write(p->outStream, p->bufBase, num)) ++ p->res = SZ_ERROR_WRITE; ++ p->processed += num; ++ p->buf = p->bufBase; ++} ++ ++static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) ++{ ++ if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) ++ { ++ Byte temp = p->cache; ++ do ++ { ++ Byte *buf = p->buf; ++ *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); ++ p->buf = buf; ++ if (buf == p->bufLim) ++ RangeEnc_FlushStream(p); ++ temp = 0xFF; ++ } ++ while (--p->cacheSize != 0); ++ p->cache = (Byte)((UInt32)p->low >> 24); ++ } ++ p->cacheSize++; ++ p->low = (UInt32)p->low << 8; ++} ++ ++static void RangeEnc_FlushData(CRangeEnc *p) ++{ ++ int i; ++ for (i = 0; i < 5; i++) ++ RangeEnc_ShiftLow(p); ++} ++ ++static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) ++{ ++ do ++ { ++ p->range >>= 1; ++ p->low += p->range & (0 - ((value >> --numBits) & 1)); ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++ } ++ while (numBits != 0); ++} ++ ++static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) ++{ ++ UInt32 ttt = *prob; ++ UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; ++ if (symbol == 0) ++ { ++ p->range = newBound; ++ ttt += (kBitModelTotal - ttt) >> kNumMoveBits; ++ } ++ else ++ { ++ p->low += newBound; ++ p->range -= newBound; ++ ttt -= ttt >> kNumMoveBits; ++ } ++ *prob = (CLzmaProb)ttt; ++ if (p->range < kTopValue) ++ { ++ p->range <<= 8; ++ RangeEnc_ShiftLow(p); ++ } ++} ++ ++static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) ++{ ++ symbol |= 0x100; ++ do ++ { ++ RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++} ++ ++static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) ++{ ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++} ++ ++void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) ++{ ++ UInt32 i; ++ for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) ++ { ++ const int kCyclesBits = kNumBitPriceShiftBits; ++ UInt32 w = i; ++ UInt32 bitCount = 0; ++ int j; ++ for (j = 0; j < kCyclesBits; j++) ++ { ++ w = w * w; ++ bitCount <<= 1; ++ while (w >= ((UInt32)1 << 16)) ++ { ++ w >>= 1; ++ bitCount++; ++ } ++ } ++ ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); ++ } ++} ++ ++ ++#define GET_PRICE(prob, symbol) \ ++ p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICEa(prob, symbol) \ ++ ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; ++ ++#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] ++#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] ++ ++static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= 0x100; ++ do ++ { ++ price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); ++ symbol <<= 1; ++ } ++ while (symbol < 0x10000); ++ return price; ++} ++ ++static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 offs = 0x100; ++ symbol |= 0x100; ++ do ++ { ++ matchByte <<= 1; ++ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); ++ symbol <<= 1; ++ offs &= ~(matchByte ^ symbol); ++ } ++ while (symbol < 0x10000); ++ return price; ++} ++ ++ ++static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0;) ++ { ++ UInt32 bit; ++ i--; ++ bit = (symbol >> i) & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ } ++} ++ ++static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) ++{ ++ UInt32 m = 1; ++ int i; ++ for (i = 0; i < numBitLevels; i++) ++ { ++ UInt32 bit = symbol & 1; ++ RangeEnc_EncodeBit(rc, probs + m, bit); ++ m = (m << 1) | bit; ++ symbol >>= 1; ++ } ++} ++ ++static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ symbol |= (1 << numBitLevels); ++ while (symbol != 1) ++ { ++ price += GET_PRICEa(probs[symbol >> 1], symbol & 1); ++ symbol >>= 1; ++ } ++ return price; ++} ++ ++static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) ++{ ++ UInt32 price = 0; ++ UInt32 m = 1; ++ int i; ++ for (i = numBitLevels; i != 0; i--) ++ { ++ UInt32 bit = symbol & 1; ++ symbol >>= 1; ++ price += GET_PRICEa(probs[m], bit); ++ m = (m << 1) | bit; ++ } ++ return price; ++} ++ ++ ++static void LenEnc_Init(CLenEnc *p) ++{ ++ unsigned i; ++ p->choice = p->choice2 = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) ++ p->low[i] = kProbInitValue; ++ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) ++ p->mid[i] = kProbInitValue; ++ for (i = 0; i < kLenNumHighSymbols; i++) ++ p->high[i] = kProbInitValue; ++} ++ ++static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) ++{ ++ if (symbol < kLenNumLowSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 0); ++ RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice, 1); ++ if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 0); ++ RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); ++ } ++ else ++ { ++ RangeEnc_EncodeBit(rc, &p->choice2, 1); ++ RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); ++ } ++ } ++} ++ ++static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) ++{ ++ UInt32 a0 = GET_PRICE_0a(p->choice); ++ UInt32 a1 = GET_PRICE_1a(p->choice); ++ UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); ++ UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); ++ UInt32 i = 0; ++ for (i = 0; i < kLenNumLowSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); ++ } ++ for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) ++ { ++ if (i >= numSymbols) ++ return; ++ prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); ++ } ++ for (; i < numSymbols; i++) ++ prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); ++} ++ ++static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) ++{ ++ LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); ++ p->counters[posState] = p->tableSize; ++} ++ ++static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) ++{ ++ UInt32 posState; ++ for (posState = 0; posState < numPosStates; posState++) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) ++{ ++ LenEnc_Encode(&p->p, rc, symbol, posState); ++ if (updatePrice) ++ if (--p->counters[posState] == 0) ++ LenPriceEnc_UpdateTable(p, posState, ProbPrices); ++} ++ ++ ++ ++ ++static void MovePos(CLzmaEnc *p, UInt32 num) ++{ ++ #ifdef SHOW_STAT ++ ttt += num; ++ printf("\n MovePos %d", num); ++ #endif ++ if (num != 0) ++ { ++ p->additionalOffset += num; ++ p->matchFinder.Skip(p->matchFinderObj, num); ++ } ++} ++ ++static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) ++{ ++ UInt32 lenRes = 0, numPairs; ++ p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++ numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches); ++ #ifdef SHOW_STAT ++ printf("\n i = %d numPairs = %d ", ttt, numPairs / 2); ++ ttt++; ++ { ++ UInt32 i; ++ for (i = 0; i < numPairs; i += 2) ++ printf("%2d %6d | ", p->matches[i], p->matches[i + 1]); ++ } ++ #endif ++ if (numPairs > 0) ++ { ++ lenRes = p->matches[numPairs - 2]; ++ if (lenRes == p->numFastBytes) ++ { ++ const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ UInt32 distance = p->matches[numPairs - 1] + 1; ++ UInt32 numAvail = p->numAvail; ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ { ++ const Byte *pby2 = pby - distance; ++ for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); ++ } ++ } ++ } ++ p->additionalOffset++; ++ *numDistancePairsRes = numPairs; ++ return lenRes; ++} ++ ++ ++#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; ++#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; ++#define IsShortRep(p) ((p)->backPrev == 0) ++ ++static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) ++{ ++ return ++ GET_PRICE_0(p->isRepG0[state]) + ++ GET_PRICE_0(p->isRep0Long[state][posState]); ++} ++ ++static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) ++{ ++ UInt32 price; ++ if (repIndex == 0) ++ { ++ price = GET_PRICE_0(p->isRepG0[state]); ++ price += GET_PRICE_1(p->isRep0Long[state][posState]); ++ } ++ else ++ { ++ price = GET_PRICE_1(p->isRepG0[state]); ++ if (repIndex == 1) ++ price += GET_PRICE_0(p->isRepG1[state]); ++ else ++ { ++ price += GET_PRICE_1(p->isRepG1[state]); ++ price += GET_PRICE(p->isRepG2[state], repIndex - 2); ++ } ++ } ++ return price; ++} ++ ++static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) ++{ ++ return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + ++ GetPureRepPrice(p, repIndex, state, posState); ++} ++ ++static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) ++{ ++ UInt32 posMem = p->opt[cur].posPrev; ++ UInt32 backMem = p->opt[cur].backPrev; ++ p->optimumEndIndex = cur; ++ do ++ { ++ if (p->opt[cur].prev1IsChar) ++ { ++ MakeAsChar(&p->opt[posMem]) ++ p->opt[posMem].posPrev = posMem - 1; ++ if (p->opt[cur].prev2) ++ { ++ p->opt[posMem - 1].prev1IsChar = False; ++ p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; ++ p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; ++ } ++ } ++ { ++ UInt32 posPrev = posMem; ++ UInt32 backCur = backMem; ++ ++ backMem = p->opt[posPrev].backPrev; ++ posMem = p->opt[posPrev].posPrev; ++ ++ p->opt[posPrev].backPrev = backCur; ++ p->opt[posPrev].posPrev = cur; ++ cur = posPrev; ++ } ++ } ++ while (cur != 0); ++ *backRes = p->opt[0].backPrev; ++ p->optimumCurrentIndex = p->opt[0].posPrev; ++ return p->optimumCurrentIndex; ++} ++ ++#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) ++ ++static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) ++{ ++ UInt32 numAvail, mainLen, numPairs, repMaxIndex, i, posState, lenEnd, len, cur; ++ UInt32 matchPrice, repMatchPrice, normalMatchPrice; ++ UInt32 reps[LZMA_NUM_REPS], repLens[LZMA_NUM_REPS]; ++ UInt32 *matches; ++ const Byte *data; ++ Byte curByte, matchByte; ++ if (p->optimumEndIndex != p->optimumCurrentIndex) ++ { ++ const COptimal *opt = &p->opt[p->optimumCurrentIndex]; ++ UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; ++ *backRes = opt->backPrev; ++ p->optimumCurrentIndex = opt->posPrev; ++ return lenRes; ++ } ++ p->optimumCurrentIndex = p->optimumEndIndex = 0; ++ ++ if (p->additionalOffset == 0) ++ mainLen = ReadMatchDistances(p, &numPairs); ++ else ++ { ++ mainLen = p->longestMatchLength; ++ numPairs = p->numPairs; ++ } ++ ++ numAvail = p->numAvail; ++ if (numAvail < 2) ++ { ++ *backRes = (UInt32)(-1); ++ return 1; ++ } ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ repMaxIndex = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 lenTest; ++ const Byte *data2; ++ reps[i] = p->reps[i]; ++ data2 = data - (reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ { ++ repLens[i] = 0; ++ continue; ++ } ++ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); ++ repLens[i] = lenTest; ++ if (lenTest > repLens[repMaxIndex]) ++ repMaxIndex = i; ++ } ++ if (repLens[repMaxIndex] >= p->numFastBytes) ++ { ++ UInt32 lenRes; ++ *backRes = repMaxIndex; ++ lenRes = repLens[repMaxIndex]; ++ MovePos(p, lenRes - 1); ++ return lenRes; ++ } ++ ++ matches = p->matches; ++ if (mainLen >= p->numFastBytes) ++ { ++ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 1); ++ return mainLen; ++ } ++ curByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2) ++ { ++ *backRes = (UInt32)-1; ++ return 1; ++ } ++ ++ p->opt[0].state = (CState)p->state; ++ ++ posState = (position & p->pbMask); ++ ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + ++ (!IsCharState(p->state) ? ++ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, curByte, p->ProbPrices)); ++ } ++ ++ MakeAsChar(&p->opt[1]); ++ ++ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); ++ ++ if (matchByte == curByte) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); ++ if (shortRepPrice < p->opt[1].price) ++ { ++ p->opt[1].price = shortRepPrice; ++ MakeAsShortRep(&p->opt[1]); ++ } ++ } ++ lenEnd = ((mainLen >= repLens[repMaxIndex]) ? mainLen : repLens[repMaxIndex]); ++ ++ if (lenEnd < 2) ++ { ++ *backRes = p->opt[1].backPrev; ++ return 1; ++ } ++ ++ p->opt[1].posPrev = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ p->opt[0].backs[i] = reps[i]; ++ ++ len = lenEnd; ++ do ++ p->opt[len--].price = kInfinityPrice; ++ while (len >= 2); ++ ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 repLen = repLens[i]; ++ UInt32 price; ++ if (repLen < 2) ++ continue; ++ price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; ++ COptimal *opt = &p->opt[repLen]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = i; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--repLen >= 2); ++ } ++ ++ normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); ++ ++ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); ++ if (len <= mainLen) ++ { ++ UInt32 offs = 0; ++ while (len > matches[offs]) ++ offs += 2; ++ for (; ; len++) ++ { ++ COptimal *opt; ++ UInt32 distance = matches[offs + 1]; ++ ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(len); ++ if (distance < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][distance]; ++ else ++ { ++ UInt32 slot; ++ GetPosSlot2(distance, slot); ++ curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; ++ } ++ opt = &p->opt[len]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = 0; ++ opt->backPrev = distance + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ if (len == matches[offs]) ++ { ++ offs += 2; ++ if (offs == numPairs) ++ break; ++ } ++ } ++ } ++ ++ cur = 0; ++ ++ #ifdef SHOW_STAT2 ++ if (position >= 0) ++ { ++ unsigned i; ++ printf("\n pos = %4X", position); ++ for (i = cur; i <= lenEnd; i++) ++ printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); ++ } ++ #endif ++ ++ for (;;) ++ { ++ UInt32 numAvailFull, newLen, numPairs, posPrev, state, posState, startLen; ++ UInt32 curPrice, curAnd1Price, matchPrice, repMatchPrice; ++ Bool nextIsChar; ++ Byte curByte, matchByte; ++ const Byte *data; ++ COptimal *curOpt; ++ COptimal *nextOpt; ++ ++ cur++; ++ if (cur == lenEnd) ++ return Backward(p, backRes, cur); ++ ++ newLen = ReadMatchDistances(p, &numPairs); ++ if (newLen >= p->numFastBytes) ++ { ++ p->numPairs = numPairs; ++ p->longestMatchLength = newLen; ++ return Backward(p, backRes, cur); ++ } ++ position++; ++ curOpt = &p->opt[cur]; ++ posPrev = curOpt->posPrev; ++ if (curOpt->prev1IsChar) ++ { ++ posPrev--; ++ if (curOpt->prev2) ++ { ++ state = p->opt[curOpt->posPrev2].state; ++ if (curOpt->backPrev2 < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ state = kLiteralNextStates[state]; ++ } ++ else ++ state = p->opt[posPrev].state; ++ if (posPrev == cur - 1) ++ { ++ if (IsShortRep(curOpt)) ++ state = kShortRepNextStates[state]; ++ else ++ state = kLiteralNextStates[state]; ++ } ++ else ++ { ++ UInt32 pos; ++ const COptimal *prevOpt; ++ if (curOpt->prev1IsChar && curOpt->prev2) ++ { ++ posPrev = curOpt->posPrev2; ++ pos = curOpt->backPrev2; ++ state = kRepNextStates[state]; ++ } ++ else ++ { ++ pos = curOpt->backPrev; ++ if (pos < LZMA_NUM_REPS) ++ state = kRepNextStates[state]; ++ else ++ state = kMatchNextStates[state]; ++ } ++ prevOpt = &p->opt[posPrev]; ++ if (pos < LZMA_NUM_REPS) ++ { ++ UInt32 i; ++ reps[0] = prevOpt->backs[pos]; ++ for (i = 1; i <= pos; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ for (; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i]; ++ } ++ else ++ { ++ UInt32 i; ++ reps[0] = (pos - LZMA_NUM_REPS); ++ for (i = 1; i < LZMA_NUM_REPS; i++) ++ reps[i] = prevOpt->backs[i - 1]; ++ } ++ } ++ curOpt->state = (CState)state; ++ ++ curOpt->backs[0] = reps[0]; ++ curOpt->backs[1] = reps[1]; ++ curOpt->backs[2] = reps[2]; ++ curOpt->backs[3] = reps[3]; ++ ++ curPrice = curOpt->price; ++ nextIsChar = False; ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ curByte = *data; ++ matchByte = *(data - (reps[0] + 1)); ++ ++ posState = (position & p->pbMask); ++ ++ curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); ++ { ++ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); ++ curAnd1Price += ++ (!IsCharState(state) ? ++ LitEnc_GetPriceMatched(probs, curByte, matchByte, p->ProbPrices) : ++ LitEnc_GetPrice(probs, curByte, p->ProbPrices)); ++ } ++ ++ nextOpt = &p->opt[cur + 1]; ++ ++ if (curAnd1Price < nextOpt->price) ++ { ++ nextOpt->price = curAnd1Price; ++ nextOpt->posPrev = cur; ++ MakeAsChar(nextOpt); ++ nextIsChar = True; ++ } ++ ++ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); ++ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); ++ ++ if (matchByte == curByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) ++ { ++ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); ++ if (shortRepPrice <= nextOpt->price) ++ { ++ nextOpt->price = shortRepPrice; ++ nextOpt->posPrev = cur; ++ MakeAsShortRep(nextOpt); ++ nextIsChar = True; ++ } ++ } ++ numAvailFull = p->numAvail; ++ { ++ UInt32 temp = kNumOpts - 1 - cur; ++ if (temp < numAvailFull) ++ numAvailFull = temp; ++ } ++ ++ if (numAvailFull < 2) ++ continue; ++ numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes); ++ ++ if (!nextIsChar && matchByte != curByte) /* speed optimization */ ++ { ++ /* try Literal + rep0 */ ++ UInt32 temp; ++ UInt32 lenTest2; ++ const Byte *data2 = data - (reps[0] + 1); ++ UInt32 limit = p->numFastBytes + 1; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ ++ for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); ++ lenTest2 = temp - 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kLiteralNextStates[state]; ++ UInt32 posStateNext = (position + 1) & p->pbMask; ++ UInt32 nextRepMatchPrice = curAnd1Price + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = False; ++ } ++ } ++ } ++ } ++ ++ startLen = 2; /* speed optimization */ ++ { ++ UInt32 repIndex; ++ for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) ++ { ++ UInt32 lenTest; ++ UInt32 lenTestTemp; ++ UInt32 price; ++ const Byte *data2 = data - (reps[repIndex] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ for (lenTest = 2; lenTest < numAvail && data[lenTest] == data2[lenTest]; lenTest++); ++ while (lenEnd < cur + lenTest) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ lenTestTemp = lenTest; ++ price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); ++ do ++ { ++ UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; ++ COptimal *opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = repIndex; ++ opt->prev1IsChar = False; ++ } ++ } ++ while (--lenTest >= 2); ++ lenTest = lenTestTemp; ++ ++ if (repIndex == 0) ++ startLen = lenTest + 1; ++ ++ /* if (_maxMode) */ ++ { ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kRepNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = ++ price + p->repLenEnc.prices[posState][lenTest - 2] + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (position + lenTest + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = repIndex; ++ } ++ } ++ } ++ } ++ } ++ } ++ /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ ++ if (newLen > numAvail) ++ { ++ newLen = numAvail; ++ for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2); ++ matches[numPairs] = newLen; ++ numPairs += 2; ++ } ++ if (newLen >= startLen) ++ { ++ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); ++ UInt32 offs, curBack, posSlot; ++ UInt32 lenTest; ++ while (lenEnd < cur + newLen) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ ++ offs = 0; ++ while (startLen > matches[offs]) ++ offs += 2; ++ curBack = matches[offs + 1]; ++ GetPosSlot2(curBack, posSlot); ++ for (lenTest = /*2*/ startLen; ; lenTest++) ++ { ++ UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; ++ UInt32 lenToPosState = GetLenToPosState(lenTest); ++ COptimal *opt; ++ if (curBack < kNumFullDistances) ++ curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; ++ else ++ curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; ++ ++ opt = &p->opt[cur + lenTest]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur; ++ opt->backPrev = curBack + LZMA_NUM_REPS; ++ opt->prev1IsChar = False; ++ } ++ ++ if (/*_maxMode && */lenTest == matches[offs]) ++ { ++ /* Try Match + Literal + Rep0 */ ++ const Byte *data2 = data - (curBack + 1); ++ UInt32 lenTest2 = lenTest + 1; ++ UInt32 limit = lenTest2 + p->numFastBytes; ++ UInt32 nextRepMatchPrice; ++ if (limit > numAvailFull) ++ limit = numAvailFull; ++ for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); ++ lenTest2 -= lenTest + 1; ++ if (lenTest2 >= 2) ++ { ++ UInt32 state2 = kMatchNextStates[state]; ++ UInt32 posStateNext = (position + lenTest) & p->pbMask; ++ UInt32 curAndLenCharPrice = curAndLenPrice + ++ GET_PRICE_0(p->isMatch[state2][posStateNext]) + ++ LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), ++ data[lenTest], data2[lenTest], p->ProbPrices); ++ state2 = kLiteralNextStates[state2]; ++ posStateNext = (posStateNext + 1) & p->pbMask; ++ nextRepMatchPrice = curAndLenCharPrice + ++ GET_PRICE_1(p->isMatch[state2][posStateNext]) + ++ GET_PRICE_1(p->isRep[state2]); ++ ++ /* for (; lenTest2 >= 2; lenTest2--) */ ++ { ++ UInt32 offset = cur + lenTest + 1 + lenTest2; ++ UInt32 curAndLenPrice; ++ COptimal *opt; ++ while (lenEnd < offset) ++ p->opt[++lenEnd].price = kInfinityPrice; ++ curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); ++ opt = &p->opt[offset]; ++ if (curAndLenPrice < opt->price) ++ { ++ opt->price = curAndLenPrice; ++ opt->posPrev = cur + lenTest + 1; ++ opt->backPrev = 0; ++ opt->prev1IsChar = True; ++ opt->prev2 = True; ++ opt->posPrev2 = cur; ++ opt->backPrev2 = curBack + LZMA_NUM_REPS; ++ } ++ } ++ } ++ offs += 2; ++ if (offs == numPairs) ++ break; ++ curBack = matches[offs + 1]; ++ if (curBack >= kNumFullDistances) ++ GetPosSlot2(curBack, posSlot); ++ } ++ } ++ } ++ } ++} ++ ++#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) ++ ++static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) ++{ ++ UInt32 numAvail, mainLen, mainDist, numPairs, repIndex, repLen, i; ++ const Byte *data; ++ const UInt32 *matches; ++ ++ if (p->additionalOffset == 0) ++ mainLen = ReadMatchDistances(p, &numPairs); ++ else ++ { ++ mainLen = p->longestMatchLength; ++ numPairs = p->numPairs; ++ } ++ ++ numAvail = p->numAvail; ++ *backRes = (UInt32)-1; ++ if (numAvail < 2) ++ return 1; ++ if (numAvail > LZMA_MATCH_LEN_MAX) ++ numAvail = LZMA_MATCH_LEN_MAX; ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ ++ repLen = repIndex = 0; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 len; ++ const Byte *data2 = data - (p->reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ for (len = 2; len < numAvail && data[len] == data2[len]; len++); ++ if (len >= p->numFastBytes) ++ { ++ *backRes = i; ++ MovePos(p, len - 1); ++ return len; ++ } ++ if (len > repLen) ++ { ++ repIndex = i; ++ repLen = len; ++ } ++ } ++ ++ matches = p->matches; ++ if (mainLen >= p->numFastBytes) ++ { ++ *backRes = matches[numPairs - 1] + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 1); ++ return mainLen; ++ } ++ ++ mainDist = 0; /* for GCC */ ++ if (mainLen >= 2) ++ { ++ mainDist = matches[numPairs - 1]; ++ while (numPairs > 2 && mainLen == matches[numPairs - 4] + 1) ++ { ++ if (!ChangePair(matches[numPairs - 3], mainDist)) ++ break; ++ numPairs -= 2; ++ mainLen = matches[numPairs - 2]; ++ mainDist = matches[numPairs - 1]; ++ } ++ if (mainLen == 2 && mainDist >= 0x80) ++ mainLen = 1; ++ } ++ ++ if (repLen >= 2 && ( ++ (repLen + 1 >= mainLen) || ++ (repLen + 2 >= mainLen && mainDist >= (1 << 9)) || ++ (repLen + 3 >= mainLen && mainDist >= (1 << 15)))) ++ { ++ *backRes = repIndex; ++ MovePos(p, repLen - 1); ++ return repLen; ++ } ++ ++ if (mainLen < 2 || numAvail <= 2) ++ return 1; ++ ++ p->longestMatchLength = ReadMatchDistances(p, &p->numPairs); ++ if (p->longestMatchLength >= 2) ++ { ++ UInt32 newDistance = matches[p->numPairs - 1]; ++ if ((p->longestMatchLength >= mainLen && newDistance < mainDist) || ++ (p->longestMatchLength == mainLen + 1 && !ChangePair(mainDist, newDistance)) || ++ (p->longestMatchLength > mainLen + 1) || ++ (p->longestMatchLength + 1 >= mainLen && mainLen >= 3 && ChangePair(newDistance, mainDist))) ++ return 1; ++ } ++ ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; ++ for (i = 0; i < LZMA_NUM_REPS; i++) ++ { ++ UInt32 len, limit; ++ const Byte *data2 = data - (p->reps[i] + 1); ++ if (data[0] != data2[0] || data[1] != data2[1]) ++ continue; ++ limit = mainLen - 1; ++ for (len = 2; len < limit && data[len] == data2[len]; len++); ++ if (len >= limit) ++ return 1; ++ } ++ *backRes = mainDist + LZMA_NUM_REPS; ++ MovePos(p, mainLen - 2); ++ return mainLen; ++} ++ ++static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) ++{ ++ UInt32 len; ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ len = LZMA_MATCH_LEN_MIN; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); ++ RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); ++} ++ ++static SRes CheckErrors(CLzmaEnc *p) ++{ ++ if (p->result != SZ_OK) ++ return p->result; ++ if (p->rc.res != SZ_OK) ++ p->result = SZ_ERROR_WRITE; ++ if (p->matchFinderBase.result != SZ_OK) ++ p->result = SZ_ERROR_READ; ++ if (p->result != SZ_OK) ++ p->finished = True; ++ return p->result; ++} ++ ++static SRes Flush(CLzmaEnc *p, UInt32 nowPos) ++{ ++ /* ReleaseMFStream(); */ ++ p->finished = True; ++ if (p->writeEndMark) ++ WriteEndMarker(p, nowPos & p->pbMask); ++ RangeEnc_FlushData(&p->rc); ++ RangeEnc_FlushStream(&p->rc); ++ return CheckErrors(p); ++} ++ ++static void FillAlignPrices(CLzmaEnc *p) ++{ ++ UInt32 i; ++ for (i = 0; i < kAlignTableSize; i++) ++ p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); ++ p->alignPriceCount = 0; ++} ++ ++static void FillDistancesPrices(CLzmaEnc *p) ++{ ++ UInt32 tempPrices[kNumFullDistances]; ++ UInt32 i, lenToPosState; ++ for (i = kStartPosModelIndex; i < kNumFullDistances; i++) ++ { ++ UInt32 posSlot = GetPosSlot1(i); ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); ++ } ++ ++ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) ++ { ++ UInt32 posSlot; ++ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; ++ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; ++ for (posSlot = 0; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); ++ for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) ++ posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); ++ ++ { ++ UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; ++ UInt32 i; ++ for (i = 0; i < kStartPosModelIndex; i++) ++ distancesPrices[i] = posSlotPrices[i]; ++ for (; i < kNumFullDistances; i++) ++ distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; ++ } ++ } ++ p->matchPriceCount = 0; ++} ++ ++void LzmaEnc_Construct(CLzmaEnc *p) ++{ ++ RangeEnc_Construct(&p->rc); ++ MatchFinder_Construct(&p->matchFinderBase); ++ #ifndef _7ZIP_ST ++ MatchFinderMt_Construct(&p->matchFinderMt); ++ p->matchFinderMt.MatchFinder = &p->matchFinderBase; ++ #endif ++ ++ { ++ CLzmaEncProps props; ++ LzmaEncProps_Init(&props); ++ LzmaEnc_SetProps(p, &props); ++ } ++ ++ #ifndef LZMA_LOG_BSR ++ LzmaEnc_FastPosInit(p->g_FastPos); ++ #endif ++ ++ LzmaEnc_InitPriceTables(p->ProbPrices); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) ++{ ++ void *p; ++ p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); ++ if (p != 0) ++ LzmaEnc_Construct((CLzmaEnc *)p); ++ return p; ++} ++ ++void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) ++{ ++ alloc->Free(alloc, p->litProbs); ++ alloc->Free(alloc, p->saveState.litProbs); ++ p->litProbs = 0; ++ p->saveState.litProbs = 0; ++} ++ ++void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ #ifndef _7ZIP_ST ++ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); ++ #endif ++ MatchFinder_Free(&p->matchFinderBase, allocBig); ++ LzmaEnc_FreeLits(p, alloc); ++ RangeEnc_Free(&p->rc, alloc); ++} ++ ++void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); ++ alloc->Free(alloc, p); ++} ++ ++static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) ++{ ++ UInt32 nowPos32, startPos32; ++ if (p->needInit) ++ { ++ p->matchFinder.Init(p->matchFinderObj); ++ p->needInit = 0; ++ } ++ ++ if (p->finished) ++ return p->result; ++ RINOK(CheckErrors(p)); ++ ++ nowPos32 = (UInt32)p->nowPos64; ++ startPos32 = nowPos32; ++ ++ if (p->nowPos64 == 0) ++ { ++ UInt32 numPairs; ++ Byte curByte; ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ return Flush(p, nowPos32); ++ ReadMatchDistances(p, &numPairs); ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); ++ p->state = kLiteralNextStates[p->state]; ++ curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); ++ LitEnc_Encode(&p->rc, p->litProbs, curByte); ++ p->additionalOffset--; ++ nowPos32++; ++ } ++ ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) ++ for (;;) ++ { ++ UInt32 pos, len, posState; ++ ++ if (p->fastMode) ++ len = GetOptimumFast(p, &pos); ++ else ++ len = GetOptimum(p, nowPos32, &pos); ++ ++ #ifdef SHOW_STAT2 ++ printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); ++ #endif ++ ++ posState = nowPos32 & p->pbMask; ++ if (len == 1 && pos == (UInt32)-1) ++ { ++ Byte curByte; ++ CLzmaProb *probs; ++ const Byte *data; ++ ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); ++ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++ curByte = *data; ++ probs = LIT_PROBS(nowPos32, *(data - 1)); ++ if (IsCharState(p->state)) ++ LitEnc_Encode(&p->rc, probs, curByte); ++ else ++ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); ++ p->state = kLiteralNextStates[p->state]; ++ } ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); ++ if (pos < LZMA_NUM_REPS) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); ++ if (pos == 0) ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); ++ RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); ++ } ++ else ++ { ++ UInt32 distance = p->reps[pos]; ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); ++ if (pos == 1) ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); ++ else ++ { ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); ++ RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); ++ if (pos == 3) ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ } ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = distance; ++ } ++ if (len == 1) ++ p->state = kShortRepNextStates[p->state]; ++ else ++ { ++ LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ p->state = kRepNextStates[p->state]; ++ } ++ } ++ else ++ { ++ UInt32 posSlot; ++ RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); ++ p->state = kMatchNextStates[p->state]; ++ LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); ++ pos -= LZMA_NUM_REPS; ++ GetPosSlot(pos, posSlot); ++ RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); ++ ++ if (posSlot >= kStartPosModelIndex) ++ { ++ UInt32 footerBits = ((posSlot >> 1) - 1); ++ UInt32 base = ((2 | (posSlot & 1)) << footerBits); ++ UInt32 posReduced = pos - base; ++ ++ if (posSlot < kEndPosModelIndex) ++ RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); ++ else ++ { ++ RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); ++ RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); ++ p->alignPriceCount++; ++ } ++ } ++ p->reps[3] = p->reps[2]; ++ p->reps[2] = p->reps[1]; ++ p->reps[1] = p->reps[0]; ++ p->reps[0] = pos; ++ p->matchPriceCount++; ++ } ++ } ++ p->additionalOffset -= len; ++ nowPos32 += len; ++ if (p->additionalOffset == 0) ++ { ++ UInt32 processed; ++ if (!p->fastMode) ++ { ++ if (p->matchPriceCount >= (1 << 7)) ++ FillDistancesPrices(p); ++ if (p->alignPriceCount >= kAlignTableSize) ++ FillAlignPrices(p); ++ } ++ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) ++ break; ++ processed = nowPos32 - startPos32; ++ if (useLimits) ++ { ++ if (processed + kNumOpts + 300 >= maxUnpackSize || ++ RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) ++ break; ++ } ++ else if (processed >= (1 << 15)) ++ { ++ p->nowPos64 += nowPos32 - startPos32; ++ return CheckErrors(p); ++ } ++ } ++ } ++ p->nowPos64 += nowPos32 - startPos32; ++ return Flush(p, nowPos32); ++} ++ ++#define kBigHashDicLimit ((UInt32)1 << 24) ++ ++static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 beforeSize = kNumOpts; ++ Bool btMode; ++ if (!RangeEnc_Alloc(&p->rc, alloc)) ++ return SZ_ERROR_MEM; ++ btMode = (p->matchFinderBase.btMode != 0); ++ #ifndef _7ZIP_ST ++ p->mtMode = (p->multiThread && !p->fastMode && btMode); ++ #endif ++ ++ { ++ unsigned lclp = p->lc + p->lp; ++ if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); ++ if (p->litProbs == 0 || p->saveState.litProbs == 0) ++ { ++ LzmaEnc_FreeLits(p, alloc); ++ return SZ_ERROR_MEM; ++ } ++ p->lclp = lclp; ++ } ++ } ++ ++ p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); ++ ++ if (beforeSize + p->dictSize < keepWindowSize) ++ beforeSize = keepWindowSize - p->dictSize; ++ ++ #ifndef _7ZIP_ST ++ if (p->mtMode) ++ { ++ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); ++ p->matchFinderObj = &p->matchFinderMt; ++ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); ++ } ++ else ++ #endif ++ { ++ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) ++ return SZ_ERROR_MEM; ++ p->matchFinderObj = &p->matchFinderBase; ++ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); ++ } ++ return SZ_OK; ++} ++ ++void LzmaEnc_Init(CLzmaEnc *p) ++{ ++ UInt32 i; ++ p->state = 0; ++ for (i = 0 ; i < LZMA_NUM_REPS; i++) ++ p->reps[i] = 0; ++ ++ RangeEnc_Init(&p->rc); ++ ++ ++ for (i = 0; i < kNumStates; i++) ++ { ++ UInt32 j; ++ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) ++ { ++ p->isMatch[i][j] = kProbInitValue; ++ p->isRep0Long[i][j] = kProbInitValue; ++ } ++ p->isRep[i] = kProbInitValue; ++ p->isRepG0[i] = kProbInitValue; ++ p->isRepG1[i] = kProbInitValue; ++ p->isRepG2[i] = kProbInitValue; ++ } ++ ++ { ++ UInt32 num = 0x300 << (p->lp + p->lc); ++ for (i = 0; i < num; i++) ++ p->litProbs[i] = kProbInitValue; ++ } ++ ++ { ++ for (i = 0; i < kNumLenToPosStates; i++) ++ { ++ CLzmaProb *probs = p->posSlotEncoder[i]; ++ UInt32 j; ++ for (j = 0; j < (1 << kNumPosSlotBits); j++) ++ probs[j] = kProbInitValue; ++ } ++ } ++ { ++ for (i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) ++ p->posEncoders[i] = kProbInitValue; ++ } ++ ++ LenEnc_Init(&p->lenEnc.p); ++ LenEnc_Init(&p->repLenEnc.p); ++ ++ for (i = 0; i < (1 << kNumAlignBits); i++) ++ p->posAlignEncoder[i] = kProbInitValue; ++ ++ p->optimumEndIndex = 0; ++ p->optimumCurrentIndex = 0; ++ p->additionalOffset = 0; ++ ++ p->pbMask = (1 << p->pb) - 1; ++ p->lpMask = (1 << p->lp) - 1; ++} ++ ++void LzmaEnc_InitPrices(CLzmaEnc *p) ++{ ++ if (!p->fastMode) ++ { ++ FillDistancesPrices(p); ++ FillAlignPrices(p); ++ } ++ ++ p->lenEnc.tableSize = ++ p->repLenEnc.tableSize = ++ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; ++ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); ++ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); ++} ++ ++static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ UInt32 i; ++ for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) ++ if (p->dictSize <= ((UInt32)1 << i)) ++ break; ++ p->distTableSize = i * 2; ++ ++ p->finished = False; ++ p->result = SZ_OK; ++ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ p->nowPos64 = 0; ++ return SZ_OK; ++} ++ ++static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->matchFinderBase.stream = inStream; ++ p->needInit = 1; ++ p->rc.outStream = outStream; ++ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); ++} ++ ++SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ++ ISeqInStream *inStream, UInt32 keepWindowSize, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ p->matchFinderBase.stream = inStream; ++ p->needInit = 1; ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) ++{ ++ p->matchFinderBase.directInput = 1; ++ p->matchFinderBase.bufferBase = (Byte *)src; ++ p->matchFinderBase.directInputRem = srcLen; ++} ++ ++SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, ++ UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ p->needInit = 1; ++ ++ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); ++} ++ ++void LzmaEnc_Finish(CLzmaEncHandle pp) ++{ ++ #ifndef _7ZIP_ST ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ if (p->mtMode) ++ MatchFinderMt_ReleaseStream(&p->matchFinderMt); ++ #else ++ pp = pp; ++ #endif ++} ++ ++typedef struct ++{ ++ ISeqOutStream funcTable; ++ Byte *data; ++ SizeT rem; ++ Bool overflow; ++} CSeqOutStreamBuf; ++ ++static size_t MyWrite(void *pp, const void *data, size_t size) ++{ ++ CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; ++ if (p->rem < size) ++ { ++ size = p->rem; ++ p->overflow = True; ++ } ++ memcpy(p->data, data, size); ++ p->rem -= size; ++ p->data += size; ++ return size; ++} ++ ++ ++UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); ++} ++ ++const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) ++{ ++ const CLzmaEnc *p = (CLzmaEnc *)pp; ++ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; ++} ++ ++SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, ++ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ UInt64 nowPos64; ++ SRes res; ++ CSeqOutStreamBuf outStream; ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = False; ++ p->finished = False; ++ p->result = SZ_OK; ++ ++ if (reInit) ++ LzmaEnc_Init(p); ++ LzmaEnc_InitPrices(p); ++ nowPos64 = p->nowPos64; ++ RangeEnc_Init(&p->rc); ++ p->rc.outStream = &outStream.funcTable; ++ ++ res = LzmaEnc_CodeOneBlock(p, True, desiredPackSize, *unpackSize); ++ ++ *unpackSize = (UInt32)(p->nowPos64 - nowPos64); ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ ++ return res; ++} ++ ++static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress) ++{ ++ SRes res = SZ_OK; ++ ++ #ifndef _7ZIP_ST ++ Byte allocaDummy[0x300]; ++ int i = 0; ++ for (i = 0; i < 16; i++) ++ allocaDummy[i] = (Byte)i; ++ #endif ++ ++ for (;;) ++ { ++ res = LzmaEnc_CodeOneBlock(p, False, 0, 0); ++ if (res != SZ_OK || p->finished != 0) ++ break; ++ if (progress != 0) ++ { ++ res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); ++ if (res != SZ_OK) ++ { ++ res = SZ_ERROR_PROGRESS; ++ break; ++ } ++ } ++ } ++ LzmaEnc_Finish(p); ++ return res; ++} ++ ++SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, ++ ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig)); ++ return LzmaEnc_Encode2((CLzmaEnc *)pp, progress); ++} ++ ++SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ int i; ++ UInt32 dictSize = p->dictSize; ++ if (*size < LZMA_PROPS_SIZE) ++ return SZ_ERROR_PARAM; ++ *size = LZMA_PROPS_SIZE; ++ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); ++ ++ for (i = 11; i <= 30; i++) ++ { ++ if (dictSize <= ((UInt32)2 << i)) ++ { ++ dictSize = (2 << i); ++ break; ++ } ++ if (dictSize <= ((UInt32)3 << i)) ++ { ++ dictSize = (3 << i); ++ break; ++ } ++ } ++ ++ for (i = 0; i < 4; i++) ++ props[1 + i] = (Byte)(dictSize >> (8 * i)); ++ return SZ_OK; ++} ++ ++SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ SRes res; ++ CLzmaEnc *p = (CLzmaEnc *)pp; ++ ++ CSeqOutStreamBuf outStream; ++ ++ LzmaEnc_SetInputBuf(p, src, srcLen); ++ ++ outStream.funcTable.Write = MyWrite; ++ outStream.data = dest; ++ outStream.rem = *destLen; ++ outStream.overflow = False; ++ ++ p->writeEndMark = writeEndMark; ++ ++ p->rc.outStream = &outStream.funcTable; ++ res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig); ++ if (res == SZ_OK) ++ res = LzmaEnc_Encode2(p, progress); ++ ++ *destLen -= outStream.rem; ++ if (outStream.overflow) ++ return SZ_ERROR_OUTPUT_EOF; ++ return res; ++} ++ ++SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, ++ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, ++ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) ++{ ++ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); ++ SRes res; ++ if (p == 0) ++ return SZ_ERROR_MEM; ++ ++ res = LzmaEnc_SetProps(p, props); ++ if (res == SZ_OK) ++ { ++ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); ++ if (res == SZ_OK) ++ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, ++ writeEndMark, progress, alloc, allocBig); ++ } ++ ++ LzmaEnc_Destroy(p, alloc, allocBig); ++ return res; ++} +--- /dev/null ++++ b/lib/lzma/Makefile +@@ -0,0 +1,7 @@ ++lzma_compress-objs := LzFind.o LzmaEnc.o ++lzma_decompress-objs := LzmaDec.o ++ ++obj-$(CONFIG_LZMA_COMPRESS) += lzma_compress.o ++obj-$(CONFIG_LZMA_DECOMPRESS) += lzma_decompress.o ++ ++EXTRA_CFLAGS += -Iinclude/linux -Iinclude/linux/lzma -include types.h diff --git a/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch b/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch new file mode 100644 index 000000000..e9952c6d8 --- /dev/null +++ b/target/linux/generic/pending-4.14/532-jffs2_eofdetect.patch @@ -0,0 +1,65 @@ +From: Felix Fietkau +Subject: fs: jffs2: EOF marker + +Signed-off-by: Felix Fietkau +--- + fs/jffs2/build.c | 10 ++++++++++ + fs/jffs2/scan.c | 21 +++++++++++++++++++-- + 2 files changed, 29 insertions(+), 2 deletions(-) + +--- a/fs/jffs2/build.c ++++ b/fs/jffs2/build.c +@@ -117,6 +117,16 @@ static int jffs2_build_filesystem(struct + dbg_fsbuild("scanned flash completely\n"); + jffs2_dbg_dump_block_lists_nolock(c); + ++ if (c->flags & (1 << 7)) { ++ printk("%s(): unlocking the mtd device... ", __func__); ++ mtd_unlock(c->mtd, 0, c->mtd->size); ++ printk("done.\n"); ++ ++ printk("%s(): erasing all blocks after the end marker... ", __func__); ++ jffs2_erase_pending_blocks(c, -1); ++ printk("done.\n"); ++ } ++ + dbg_fsbuild("pass 1 starting\n"); + c->flags |= JFFS2_SB_FLAG_BUILDING; + /* Now scan the directory tree, increasing nlink according to every dirent found. */ +--- a/fs/jffs2/scan.c ++++ b/fs/jffs2/scan.c +@@ -148,8 +148,14 @@ int jffs2_scan_medium(struct jffs2_sb_in + /* reset summary info for next eraseblock scan */ + jffs2_sum_reset_collected(s); + +- ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset), +- buf_size, s); ++ if (c->flags & (1 << 7)) { ++ if (mtd_block_isbad(c->mtd, jeb->offset)) ++ ret = BLK_STATE_BADBLOCK; ++ else ++ ret = BLK_STATE_ALLFF; ++ } else ++ ret = jffs2_scan_eraseblock(c, jeb, buf_size?flashbuf:(flashbuf+jeb->offset), ++ buf_size, s); + + if (ret < 0) + goto out; +@@ -561,6 +567,17 @@ full_scan: + return err; + } + ++ if ((buf[0] == 0xde) && ++ (buf[1] == 0xad) && ++ (buf[2] == 0xc0) && ++ (buf[3] == 0xde)) { ++ /* end of filesystem. erase everything after this point */ ++ printk("%s(): End of filesystem marker found at 0x%x\n", __func__, jeb->offset); ++ c->flags |= (1 << 7); ++ ++ return BLK_STATE_ALLFF; ++ } ++ + /* We temporarily use 'ofs' as a pointer into the buffer/jeb */ + ofs = 0; + max_ofs = EMPTY_SCAN_SIZE(c->sector_size); diff --git a/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch b/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch new file mode 100644 index 000000000..4782fc9ed --- /dev/null +++ b/target/linux/generic/pending-4.14/551-ubifs-fix-default-compression-selection.patch @@ -0,0 +1,37 @@ +From: Gabor Juhos +Subject: fs: ubifs: fix default compression selection in ubifs + +Signed-off-by: Gabor Juhos +--- + fs/ubifs/sb.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +--- a/fs/ubifs/sb.c ++++ b/fs/ubifs/sb.c +@@ -63,6 +63,17 @@ + /* Default time granularity in nanoseconds */ + #define DEFAULT_TIME_GRAN 1000000000 + ++static int get_default_compressor(void) ++{ ++ if (ubifs_compr_present(UBIFS_COMPR_LZO)) ++ return UBIFS_COMPR_LZO; ++ ++ if (ubifs_compr_present(UBIFS_COMPR_ZLIB)) ++ return UBIFS_COMPR_ZLIB; ++ ++ return UBIFS_COMPR_NONE; ++} ++ + /** + * create_default_filesystem - format empty UBI volume. + * @c: UBIFS file-system description object +@@ -186,7 +197,7 @@ static int create_default_filesystem(str + if (c->mount_opts.override_compr) + sup->default_compr = cpu_to_le16(c->mount_opts.compr_type); + else +- sup->default_compr = cpu_to_le16(UBIFS_COMPR_LZO); ++ sup->default_compr = cpu_to_le16(get_default_compressor()); + + generate_random_uuid(sup->uuid); + diff --git a/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch b/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch new file mode 100644 index 000000000..f39ed62dc --- /dev/null +++ b/target/linux/generic/pending-4.14/600-netfilter_conntrack_flush.patch @@ -0,0 +1,95 @@ +From: Felix Fietkau +Subject: netfilter: add support for flushing conntrack via /proc + +lede-commit 8193bbe59a74d34d6a26d4a8cb857b1952905314 +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_conntrack_standalone.c | 59 ++++++++++++++++++++++++++++++++- + 1 file changed, 58 insertions(+), 1 deletion(-) + +--- a/net/netfilter/nf_conntrack_standalone.c ++++ b/net/netfilter/nf_conntrack_standalone.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + #ifdef CONFIG_SYSCTL + #include +@@ -377,10 +378,66 @@ static int ct_open(struct inode *inode, + sizeof(struct ct_iter_state)); + } + ++struct kill_request { ++ u16 family; ++ union nf_inet_addr addr; ++}; ++ ++static int kill_matching(struct nf_conn *i, void *data) ++{ ++ struct kill_request *kr = data; ++ struct nf_conntrack_tuple *t1 = &i->tuplehash[IP_CT_DIR_ORIGINAL].tuple; ++ struct nf_conntrack_tuple *t2 = &i->tuplehash[IP_CT_DIR_REPLY].tuple; ++ ++ if (!kr->family) ++ return 1; ++ ++ if (t1->src.l3num != kr->family) ++ return 0; ++ ++ return (nf_inet_addr_cmp(&kr->addr, &t1->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t1->dst.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->src.u3) || ++ nf_inet_addr_cmp(&kr->addr, &t2->dst.u3)); ++} ++ ++static ssize_t ct_file_write(struct file *file, const char __user *buf, ++ size_t count, loff_t *ppos) ++{ ++ struct seq_file *seq = file->private_data; ++ struct net *net = seq_file_net(seq); ++ struct kill_request kr = { }; ++ char req[INET6_ADDRSTRLEN] = { }; ++ ++ if (count == 0) ++ return 0; ++ ++ if (count >= INET6_ADDRSTRLEN) ++ count = INET6_ADDRSTRLEN - 1; ++ ++ if (copy_from_user(req, buf, count)) ++ return -EFAULT; ++ ++ if (strnchr(req, count, ':')) { ++ kr.family = AF_INET6; ++ if (!in6_pton(req, count, (void *)&kr.addr, '\n', NULL)) ++ return -EINVAL; ++ } else if (strnchr(req, count, '.')) { ++ kr.family = AF_INET; ++ if (!in4_pton(req, count, (void *)&kr.addr, '\n', NULL)) ++ return -EINVAL; ++ } ++ ++ nf_ct_iterate_cleanup_net(net, kill_matching, &kr, 0, 0); ++ ++ return count; ++} ++ + static const struct file_operations ct_file_ops = { + .owner = THIS_MODULE, + .open = ct_open, + .read = seq_read, ++ .write = ct_file_write, + .llseek = seq_lseek, + .release = seq_release_net, + }; +@@ -484,7 +541,7 @@ static int nf_conntrack_standalone_init_ + kuid_t root_uid; + kgid_t root_gid; + +- pde = proc_create("nf_conntrack", 0440, net->proc_net, &ct_file_ops); ++ pde = proc_create("nf_conntrack", 0660, net->proc_net, &ct_file_ops); + if (!pde) + goto out_nf_conntrack; + diff --git a/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch new file mode 100644 index 000000000..0a3c0f967 --- /dev/null +++ b/target/linux/generic/pending-4.14/610-netfilter_match_bypass_default_checks.patch @@ -0,0 +1,110 @@ +From: Felix Fietkau +Subject: kernel: add a new version of my netfilter speedup patches for linux 2.6.39 and 3.0 + +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/netfilter_ipv4/ip_tables.h | 1 + + net/ipv4/netfilter/ip_tables.c | 37 +++++++++++++++++++++++++++ + 2 files changed, 38 insertions(+) + +--- a/include/uapi/linux/netfilter_ipv4/ip_tables.h ++++ b/include/uapi/linux/netfilter_ipv4/ip_tables.h +@@ -89,6 +89,7 @@ struct ipt_ip { + #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ + #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ + #define IPT_F_MASK 0x03 /* All possible flag bits mask. */ ++#define IPT_F_NO_DEF_MATCH 0x80 /* Internal: no default match rules present */ + + /* Values for "inv" field in struct ipt_ip. */ + #define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -52,6 +52,9 @@ ip_packet_match(const struct iphdr *ip, + { + unsigned long ret; + ++ if (ipinfo->flags & IPT_F_NO_DEF_MATCH) ++ return true; ++ + if (NF_INVF(ipinfo, IPT_INV_SRCIP, + (ip->saddr & ipinfo->smsk.s_addr) != ipinfo->src.s_addr) || + NF_INVF(ipinfo, IPT_INV_DSTIP, +@@ -82,6 +85,29 @@ ip_packet_match(const struct iphdr *ip, + return true; + } + ++static void ++ip_checkdefault(struct ipt_ip *ip) ++{ ++ static const char iface_mask[IFNAMSIZ] = {}; ++ ++ if (ip->invflags || ip->flags & IPT_F_FRAG) ++ return; ++ ++ if (memcmp(ip->iniface_mask, iface_mask, IFNAMSIZ) != 0) ++ return; ++ ++ if (memcmp(ip->outiface_mask, iface_mask, IFNAMSIZ) != 0) ++ return; ++ ++ if (ip->smsk.s_addr || ip->dmsk.s_addr) ++ return; ++ ++ if (ip->proto) ++ return; ++ ++ ip->flags |= IPT_F_NO_DEF_MATCH; ++} ++ + static bool + ip_checkentry(const struct ipt_ip *ip) + { +@@ -532,6 +558,8 @@ find_check_entry(struct ipt_entry *e, st + struct xt_mtchk_param mtpar; + struct xt_entry_match *ematch; + ++ ip_checkdefault(&e->ip); ++ + if (!xt_percpu_counter_alloc(alloc_state, &e->counters)) + return -ENOMEM; + +@@ -812,6 +840,7 @@ copy_entries_to_user(unsigned int total_ + const struct xt_table_info *private = table->private; + int ret = 0; + const void *loc_cpu_entry; ++ u8 flags; + + counters = alloc_counters(table); + if (IS_ERR(counters)) +@@ -839,6 +868,14 @@ copy_entries_to_user(unsigned int total_ + goto free_counters; + } + ++ flags = e->ip.flags & IPT_F_MASK; ++ if (copy_to_user(userptr + off ++ + offsetof(struct ipt_entry, ip.flags), ++ &flags, sizeof(flags)) != 0) { ++ ret = -EFAULT; ++ goto free_counters; ++ } ++ + for (i = sizeof(struct ipt_entry); + i < e->target_offset; + i += m->u.match_size) { +@@ -1219,12 +1256,15 @@ compat_copy_entry_to_user(struct ipt_ent + compat_uint_t origsize; + const struct xt_entry_match *ematch; + int ret = 0; ++ u8 flags = e->ip.flags & IPT_F_MASK; + + origsize = *size; + ce = *dstptr; + if (copy_to_user(ce, e, sizeof(struct ipt_entry)) != 0 || + copy_to_user(&ce->counters, &counters[i], +- sizeof(counters[i])) != 0) ++ sizeof(counters[i])) != 0 || ++ copy_to_user(&ce->ip.flags, &flags, ++ sizeof(flags)) != 0) + return -EFAULT; + + *dstptr += sizeof(struct compat_ipt_entry); diff --git a/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch b/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch new file mode 100644 index 000000000..11f07e12b --- /dev/null +++ b/target/linux/generic/pending-4.14/611-netfilter_match_bypass_default_table.patch @@ -0,0 +1,111 @@ +From: Felix Fietkau +Subject: netfilter: match bypass default table + +Signed-off-by: Felix Fietkau +--- + net/ipv4/netfilter/ip_tables.c | 79 +++++++++++++++++++++++++++++++----------- + 1 file changed, 58 insertions(+), 21 deletions(-) + +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -248,6 +248,33 @@ struct ipt_entry *ipt_next_entry(const s + return (void *)entry + entry->next_offset; + } + ++static bool ++ipt_handle_default_rule(struct ipt_entry *e, unsigned int *verdict) ++{ ++ struct xt_entry_target *t; ++ struct xt_standard_target *st; ++ ++ if (e->target_offset != sizeof(struct ipt_entry)) ++ return false; ++ ++ if (!(e->ip.flags & IPT_F_NO_DEF_MATCH)) ++ return false; ++ ++ t = ipt_get_target(e); ++ if (t->u.kernel.target->target) ++ return false; ++ ++ st = (struct xt_standard_target *) t; ++ if (st->verdict == XT_RETURN) ++ return false; ++ ++ if (st->verdict >= 0) ++ return false; ++ ++ *verdict = (unsigned)(-st->verdict) - 1; ++ return true; ++} ++ + /* Returns one of the generic firewall policies, like NF_ACCEPT. */ + unsigned int + ipt_do_table(struct sk_buff *skb, +@@ -268,24 +295,8 @@ ipt_do_table(struct sk_buff *skb, + unsigned int addend; + + /* Initialization */ +- stackidx = 0; +- ip = ip_hdr(skb); +- indev = state->in ? state->in->name : nulldevname; +- outdev = state->out ? state->out->name : nulldevname; +- /* We handle fragments by dealing with the first fragment as +- * if it was a normal packet. All other fragments are treated +- * normally, except that they will NEVER match rules that ask +- * things we don't know, ie. tcp syn flag or ports). If the +- * rule is also a fragment-specific rule, non-fragments won't +- * match it. */ +- acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET; +- acpar.thoff = ip_hdrlen(skb); +- acpar.hotdrop = false; +- acpar.state = state; +- + WARN_ON(!(table->valid_hooks & (1 << hook))); + local_bh_disable(); +- addend = xt_write_recseq_begin(); + private = table->private; + cpu = smp_processor_id(); + /* +@@ -294,6 +305,23 @@ ipt_do_table(struct sk_buff *skb, + */ + smp_read_barrier_depends(); + table_base = private->entries; ++ ++ e = get_entry(table_base, private->hook_entry[hook]); ++ if (ipt_handle_default_rule(e, &verdict)) { ++ struct xt_counters *counter; ++ ++ counter = xt_get_this_cpu_counter(&e->counters); ++ ADD_COUNTER(*counter, skb->len, 1); ++ local_bh_enable(); ++ return verdict; ++ } ++ ++ stackidx = 0; ++ ip = ip_hdr(skb); ++ indev = state->in ? state->in->name : nulldevname; ++ outdev = state->out ? state->out->name : nulldevname; ++ ++ addend = xt_write_recseq_begin(); + jumpstack = (struct ipt_entry **)private->jumpstack[cpu]; + + /* Switch to alternate jumpstack if we're being invoked via TEE. +@@ -306,7 +334,16 @@ ipt_do_table(struct sk_buff *skb, + if (static_key_false(&xt_tee_enabled)) + jumpstack += private->stacksize * __this_cpu_read(nf_skb_duplicated); + +- e = get_entry(table_base, private->hook_entry[hook]); ++ /* We handle fragments by dealing with the first fragment as ++ * if it was a normal packet. All other fragments are treated ++ * normally, except that they will NEVER match rules that ask ++ * things we don't know, ie. tcp syn flag or ports). If the ++ * rule is also a fragment-specific rule, non-fragments won't ++ * match it. */ ++ acpar.fragoff = ntohs(ip->frag_off) & IP_OFFSET; ++ acpar.thoff = ip_hdrlen(skb); ++ acpar.hotdrop = false; ++ acpar.state = state; + + do { + const struct xt_entry_target *t; diff --git a/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch b/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch new file mode 100644 index 000000000..183c74c1c --- /dev/null +++ b/target/linux/generic/pending-4.14/612-netfilter_match_reduce_memory_access.patch @@ -0,0 +1,22 @@ +From: Felix Fietkau +Subject: netfilter: reduce match memory access + +Signed-off-by: Felix Fietkau +--- + net/ipv4/netfilter/ip_tables.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/net/ipv4/netfilter/ip_tables.c ++++ b/net/ipv4/netfilter/ip_tables.c +@@ -55,9 +55,9 @@ ip_packet_match(const struct iphdr *ip, + if (ipinfo->flags & IPT_F_NO_DEF_MATCH) + return true; + +- if (NF_INVF(ipinfo, IPT_INV_SRCIP, ++ if (NF_INVF(ipinfo, IPT_INV_SRCIP, ipinfo->smsk.s_addr && + (ip->saddr & ipinfo->smsk.s_addr) != ipinfo->src.s_addr) || +- NF_INVF(ipinfo, IPT_INV_DSTIP, ++ NF_INVF(ipinfo, IPT_INV_DSTIP, ipinfo->dmsk.s_addr && + (ip->daddr & ipinfo->dmsk.s_addr) != ipinfo->dst.s_addr)) + return false; + diff --git a/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch new file mode 100644 index 000000000..3ded90168 --- /dev/null +++ b/target/linux/generic/pending-4.14/613-netfilter_optional_tcp_window_check.patch @@ -0,0 +1,44 @@ +From: Felix Fietkau +Subject: netfilter: optional tcp window check + +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_conntrack_proto_tcp.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/net/netfilter/nf_conntrack_proto_tcp.c ++++ b/net/netfilter/nf_conntrack_proto_tcp.c +@@ -33,6 +33,9 @@ + #include + #include + ++/* Do not check the TCP window for incoming packets */ ++static int nf_ct_tcp_no_window_check __read_mostly = 1; ++ + /* "Be conservative in what you do, + be liberal in what you accept from others." + If it's non-zero, we mark only out of window RST segments as INVALID. */ +@@ -505,6 +508,9 @@ static bool tcp_in_window(const struct n + s32 receiver_offset; + bool res, in_recv_win; + ++ if (nf_ct_tcp_no_window_check) ++ return true; ++ + /* + * Get the required data from the packet. + */ +@@ -1486,6 +1492,13 @@ static struct ctl_table tcp_sysctl_table + .mode = 0644, + .proc_handler = proc_dointvec, + }, ++ { ++ .procname = "nf_conntrack_tcp_no_window_check", ++ .data = &nf_ct_tcp_no_window_check, ++ .maxlen = sizeof(unsigned int), ++ .mode = 0644, ++ .proc_handler = proc_dointvec, ++ }, + { } + }; + #endif /* CONFIG_SYSCTL */ diff --git a/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch b/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch new file mode 100644 index 000000000..c64694ea3 --- /dev/null +++ b/target/linux/generic/pending-4.14/616-net_optimize_xfrm_calls.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: kernel: add a small xfrm related performance optimization + +Signed-off-by: Felix Fietkau +--- + net/netfilter/nf_nat_core.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/net/netfilter/nf_nat_core.c ++++ b/net/netfilter/nf_nat_core.c +@@ -90,6 +90,9 @@ int nf_xfrm_me_harder(struct net *net, s + struct dst_entry *dst; + int err; + ++ if (skb->dev && !dev_net(skb->dev)->xfrm.policy_count[XFRM_POLICY_OUT]) ++ return 0; ++ + err = xfrm_decode_session(skb, &fl, family); + if (err < 0) + return err; diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch new file mode 100644 index 000000000..7a0f924b8 --- /dev/null +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -0,0 +1,138 @@ +From: Felix Fietkau +Subject: net: add an optimization for dealing with raw sockets + +lede-commit: 4898039703d7315f0f3431c860123338ec3be0f6 +Signed-off-by: Felix Fietkau +--- + include/uapi/linux/if_packet.h | 3 +++ + net/packet/af_packet.c | 34 +++++++++++++++++++++++++++------- + net/packet/internal.h | 1 + + 3 files changed, 31 insertions(+), 7 deletions(-) + +--- a/include/uapi/linux/if_packet.h ++++ b/include/uapi/linux/if_packet.h +@@ -32,6 +32,8 @@ struct sockaddr_ll { + #define PACKET_KERNEL 7 /* To kernel space */ + /* Unused, PACKET_FASTROUTE and PACKET_LOOPBACK are invisible to user space */ + #define PACKET_FASTROUTE 6 /* Fastrouted frame */ ++#define PACKET_MASK_ANY 0xffffffff /* mask for packet type bits */ ++ + + /* Packet socket options */ + +@@ -57,6 +59,7 @@ struct sockaddr_ll { + #define PACKET_QDISC_BYPASS 20 + #define PACKET_ROLLOVER_STATS 21 + #define PACKET_FANOUT_DATA 22 ++#define PACKET_RECV_TYPE 23 + + #define PACKET_FANOUT_HASH 0 + #define PACKET_FANOUT_LB 1 +--- a/net/packet/af_packet.c ++++ b/net/packet/af_packet.c +@@ -1829,6 +1829,7 @@ static int packet_rcv_spkt(struct sk_buf + { + struct sock *sk; + struct sockaddr_pkt *spkt; ++ struct packet_sock *po; + + /* + * When we registered the protocol we saved the socket in the data +@@ -1836,6 +1837,7 @@ static int packet_rcv_spkt(struct sk_buf + */ + + sk = pt->af_packet_priv; ++ po = pkt_sk(sk); + + /* + * Yank back the headers [hope the device set this +@@ -1848,7 +1850,7 @@ static int packet_rcv_spkt(struct sk_buf + * so that this procedure is noop. + */ + +- if (skb->pkt_type == PACKET_LOOPBACK) ++ if (!(po->pkt_type & (1 << skb->pkt_type))) + goto out; + + if (!net_eq(dev_net(dev), sock_net(sk))) +@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk + unsigned int snaplen, res; + bool is_drop_n_account = false; + +- if (skb->pkt_type == PACKET_LOOPBACK) +- goto drop; +- + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!(po->pkt_type & (1 << skb->pkt_type))) ++ goto drop; ++ + if (!net_eq(dev_net(dev), sock_net(sk))) + goto drop; + +@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s + BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); + BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); + +- if (skb->pkt_type == PACKET_LOOPBACK) +- goto drop; +- + sk = pt->af_packet_priv; + po = pkt_sk(sk); + ++ if (!(po->pkt_type & (1 << skb->pkt_type))) ++ goto drop; ++ + if (!net_eq(dev_net(dev), sock_net(sk))) + goto drop; + +@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net + mutex_init(&po->pg_vec_lock); + po->rollover = NULL; + po->prot_hook.func = packet_rcv; ++ po->pkt_type = PACKET_MASK_ANY & ~(1 << PACKET_LOOPBACK); + + if (sock->type == SOCK_PACKET) + po->prot_hook.func = packet_rcv_spkt; +@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i + po->xmit = val ? packet_direct_xmit : dev_queue_xmit; + return 0; + } ++ case PACKET_RECV_TYPE: ++ { ++ unsigned int val; ++ if (optlen != sizeof(val)) ++ return -EINVAL; ++ if (copy_from_user(&val, optval, sizeof(val))) ++ return -EFAULT; ++ po->pkt_type = val & ~BIT(PACKET_LOOPBACK); ++ return 0; ++ } + default: + return -ENOPROTOOPT; + } +@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock + case PACKET_VNET_HDR: + val = po->has_vnet_hdr; + break; ++ case PACKET_RECV_TYPE: ++ if (len > sizeof(unsigned int)) ++ len = sizeof(unsigned int); ++ val = po->pkt_type; ++ ++ data = &val; ++ break; + case PACKET_VERSION: + val = po->tp_version; + break; +--- a/net/packet/internal.h ++++ b/net/packet/internal.h +@@ -132,6 +132,7 @@ struct packet_sock { + struct net_device __rcu *cached_dev; + int (*xmit)(struct sk_buff *skb); + struct packet_type prot_hook ____cacheline_aligned_in_smp; ++ unsigned int pkt_type; + }; + + static struct packet_sock *pkt_sk(struct sock *sk) diff --git a/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch b/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch new file mode 100644 index 000000000..3115073b5 --- /dev/null +++ b/target/linux/generic/pending-4.14/650-pppoe_header_pad.patch @@ -0,0 +1,29 @@ +From: Felix Fietkau +Subject: pppoe: add extra padding for the header (useful for drivers that need headroom) + +lede-commit 6517a757ec711fc3354b857e273e2621042f3c7a +Signed-off-by: Felix Fietkau +--- + drivers/net/ppp/pppoe.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/net/ppp/pppoe.c ++++ b/drivers/net/ppp/pppoe.c +@@ -861,7 +861,7 @@ static int pppoe_sendmsg(struct socket * + goto end; + + +- skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32, ++ skb = sock_wmalloc(sk, total_len + dev->hard_header_len + 32 + NET_SKB_PAD, + 0, GFP_KERNEL); + if (!skb) { + error = -ENOMEM; +@@ -869,7 +869,7 @@ static int pppoe_sendmsg(struct socket * + } + + /* Reserve space for headers. */ +- skb_reserve(skb, dev->hard_header_len); ++ skb_reserve(skb, dev->hard_header_len + NET_SKB_PAD); + skb_reset_network_header(skb); + + skb->dev = dev; diff --git a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch new file mode 100644 index 000000000..4bc8a5e1c --- /dev/null +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -0,0 +1,20 @@ +From: Felix Fietkau +Subject: kernel: add a few patches for avoiding unnecessary skb reallocations - significantly improves ethernet<->wireless performance + +lede-commit: 6f89cffc9add6939d44a6b54cf9a5e77849aa7fd +Signed-off-by: Felix Fietkau +--- + include/linux/skbuff.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -2456,7 +2456,7 @@ static inline int pskb_network_may_pull( + * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) + */ + #ifndef NET_SKB_PAD +-#define NET_SKB_PAD max(32, L1_CACHE_BYTES) ++#define NET_SKB_PAD max(64, L1_CACHE_BYTES) + #endif + + int ___pskb_trim(struct sk_buff *skb, unsigned int len); diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch new file mode 100644 index 000000000..a114acda9 --- /dev/null +++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -0,0 +1,500 @@ +From: Steven Barth +Subject: Add support for MAP-E FMRs (mesh mode) + +MAP-E FMRs (draft-ietf-softwire-map-10) are rules for IPv4-communication +between MAP CEs (mesh mode) without the need to forward such data to a +border relay. This is similar to how 6rd works but for IPv4 over IPv6. + +Signed-off-by: Steven Barth +--- + include/net/ip6_tunnel.h | 13 ++ + include/uapi/linux/if_tunnel.h | 13 ++ + net/ipv6/ip6_tunnel.c | 276 +++++++++++++++++++++++++++++++++++++++-- + 3 files changed, 291 insertions(+), 11 deletions(-) + +--- a/include/net/ip6_tunnel.h ++++ b/include/net/ip6_tunnel.h +@@ -18,6 +18,18 @@ + /* determine capability on a per-packet basis */ + #define IP6_TNL_F_CAP_PER_PACKET 0x40000 + ++/* IPv6 tunnel FMR */ ++struct __ip6_tnl_fmr { ++ struct __ip6_tnl_fmr *next; /* next fmr in list */ ++ struct in6_addr ip6_prefix; ++ struct in_addr ip4_prefix; ++ ++ __u8 ip6_prefix_len; ++ __u8 ip4_prefix_len; ++ __u8 ea_len; ++ __u8 offset; ++}; ++ + struct __ip6_tnl_parm { + char name[IFNAMSIZ]; /* name of tunnel device */ + int link; /* ifindex of underlying L2 interface */ +@@ -29,6 +41,7 @@ struct __ip6_tnl_parm { + __u32 flags; /* tunnel flags */ + struct in6_addr laddr; /* local tunnel end-point address */ + struct in6_addr raddr; /* remote tunnel end-point address */ ++ struct __ip6_tnl_fmr *fmrs; /* FMRs */ + + __be16 i_flags; + __be16 o_flags; +--- a/include/uapi/linux/if_tunnel.h ++++ b/include/uapi/linux/if_tunnel.h +@@ -77,10 +77,23 @@ enum { + IFLA_IPTUN_ENCAP_DPORT, + IFLA_IPTUN_COLLECT_METADATA, + IFLA_IPTUN_FWMARK, ++ IFLA_IPTUN_FMRS, + __IFLA_IPTUN_MAX, + }; + #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) + ++enum { ++ IFLA_IPTUN_FMR_UNSPEC, ++ IFLA_IPTUN_FMR_IP6_PREFIX, ++ IFLA_IPTUN_FMR_IP4_PREFIX, ++ IFLA_IPTUN_FMR_IP6_PREFIX_LEN, ++ IFLA_IPTUN_FMR_IP4_PREFIX_LEN, ++ IFLA_IPTUN_FMR_EA_LEN, ++ IFLA_IPTUN_FMR_OFFSET, ++ __IFLA_IPTUN_FMR_MAX, ++}; ++#define IFLA_IPTUN_FMR_MAX (__IFLA_IPTUN_FMR_MAX - 1) ++ + enum tunnel_encap_types { + TUNNEL_ENCAP_NONE, + TUNNEL_ENCAP_FOU, +--- a/net/ipv6/ip6_tunnel.c ++++ b/net/ipv6/ip6_tunnel.c +@@ -16,6 +16,8 @@ + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * ++ * Changes: ++ * Steven Barth : MAP-E FMR support + */ + + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +@@ -72,9 +74,9 @@ static bool log_ecn_error = true; + module_param(log_ecn_error, bool, 0644); + MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); + +-static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2) ++static u32 HASH(const struct in6_addr *addr) + { +- u32 hash = ipv6_addr_hash(addr1) ^ ipv6_addr_hash(addr2); ++ u32 hash = ipv6_addr_hash(addr); + + return hash_32(hash, IP6_TUNNEL_HASH_SIZE_SHIFT); + } +@@ -141,20 +143,29 @@ static struct net_device_stats *ip6_get_ + static struct ip6_tnl * + ip6_tnl_lookup(struct net *net, const struct in6_addr *remote, const struct in6_addr *local) + { +- unsigned int hash = HASH(remote, local); ++ unsigned int hash = HASH(local); + struct ip6_tnl *t; + struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); + struct in6_addr any; ++ struct __ip6_tnl_fmr *fmr; + + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { +- if (ipv6_addr_equal(local, &t->parms.laddr) && +- ipv6_addr_equal(remote, &t->parms.raddr) && +- (t->dev->flags & IFF_UP)) ++ if (!ipv6_addr_equal(local, &t->parms.laddr) || ++ !(t->dev->flags & IFF_UP)) ++ continue; ++ ++ if (ipv6_addr_equal(remote, &t->parms.raddr)) + return t; ++ ++ for (fmr = t->parms.fmrs; fmr; fmr = fmr->next) { ++ if (ipv6_prefix_equal(remote, &fmr->ip6_prefix, ++ fmr->ip6_prefix_len)) ++ return t; ++ } + } + + memset(&any, 0, sizeof(any)); +- hash = HASH(&any, local); ++ hash = HASH(local); + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { + if (ipv6_addr_equal(local, &t->parms.laddr) && + ipv6_addr_any(&t->parms.raddr) && +@@ -162,7 +173,7 @@ ip6_tnl_lookup(struct net *net, const st + return t; + } + +- hash = HASH(remote, &any); ++ hash = HASH(&any); + for_each_ip6_tunnel_rcu(ip6n->tnls_r_l[hash]) { + if (ipv6_addr_equal(remote, &t->parms.raddr) && + ipv6_addr_any(&t->parms.laddr) && +@@ -202,7 +213,7 @@ ip6_tnl_bucket(struct ip6_tnl_net *ip6n, + + if (!ipv6_addr_any(remote) || !ipv6_addr_any(local)) { + prio = 1; +- h = HASH(remote, local); ++ h = HASH(local); + } + return &ip6n->tnls[prio][h]; + } +@@ -380,6 +391,12 @@ ip6_tnl_dev_uninit(struct net_device *de + struct net *net = t->net; + struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id); + ++ while (t->parms.fmrs) { ++ struct __ip6_tnl_fmr *next = t->parms.fmrs->next; ++ kfree(t->parms.fmrs); ++ t->parms.fmrs = next; ++ } ++ + if (dev == ip6n->fb_tnl_dev) + RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); + else +@@ -776,6 +793,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, + } + EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl); + ++/** ++ * ip4ip6_fmr_calc - calculate target / source IPv6-address based on FMR ++ * @dest: destination IPv6 address buffer ++ * @skb: received socket buffer ++ * @fmr: MAP FMR ++ * @xmit: Calculate for xmit or rcv ++ **/ ++static void ip4ip6_fmr_calc(struct in6_addr *dest, ++ const struct iphdr *iph, const uint8_t *end, ++ const struct __ip6_tnl_fmr *fmr, bool xmit) ++{ ++ int psidlen = fmr->ea_len - (32 - fmr->ip4_prefix_len); ++ u8 *portp = NULL; ++ bool use_dest_addr; ++ const struct iphdr *dsth = iph; ++ ++ if ((u8*)dsth >= end) ++ return; ++ ++ /* find significant IP header */ ++ if (iph->protocol == IPPROTO_ICMP) { ++ struct icmphdr *ih = (struct icmphdr*)(((u8*)dsth) + dsth->ihl * 4); ++ if (ih && ((u8*)&ih[1]) <= end && ( ++ ih->type == ICMP_DEST_UNREACH || ++ ih->type == ICMP_SOURCE_QUENCH || ++ ih->type == ICMP_TIME_EXCEEDED || ++ ih->type == ICMP_PARAMETERPROB || ++ ih->type == ICMP_REDIRECT)) ++ dsth = (const struct iphdr*)&ih[1]; ++ } ++ ++ /* in xmit-path use dest port by default and source port only if ++ this is an ICMP reply to something else; vice versa in rcv-path */ ++ use_dest_addr = (xmit && dsth == iph) || (!xmit && dsth != iph); ++ ++ /* get dst port */ ++ if (((u8*)&dsth[1]) <= end && ( ++ dsth->protocol == IPPROTO_UDP || ++ dsth->protocol == IPPROTO_TCP || ++ dsth->protocol == IPPROTO_SCTP || ++ dsth->protocol == IPPROTO_DCCP)) { ++ /* for UDP, TCP, SCTP and DCCP source and dest port ++ follow IPv4 header directly */ ++ portp = ((u8*)dsth) + dsth->ihl * 4; ++ ++ if (use_dest_addr) ++ portp += sizeof(u16); ++ } else if (iph->protocol == IPPROTO_ICMP) { ++ struct icmphdr *ih = (struct icmphdr*)(((u8*)dsth) + dsth->ihl * 4); ++ ++ /* use icmp identifier as port */ ++ if (((u8*)&ih) <= end && ( ++ (use_dest_addr && ( ++ ih->type == ICMP_ECHOREPLY || ++ ih->type == ICMP_TIMESTAMPREPLY || ++ ih->type == ICMP_INFO_REPLY || ++ ih->type == ICMP_ADDRESSREPLY)) || ++ (!use_dest_addr && ( ++ ih->type == ICMP_ECHO || ++ ih->type == ICMP_TIMESTAMP || ++ ih->type == ICMP_INFO_REQUEST || ++ ih->type == ICMP_ADDRESS) ++ ))) ++ portp = (u8*)&ih->un.echo.id; ++ } ++ ++ if ((portp && &portp[2] <= end) || psidlen == 0) { ++ int frombyte = fmr->ip6_prefix_len / 8; ++ int fromrem = fmr->ip6_prefix_len % 8; ++ int bytes = sizeof(struct in6_addr) - frombyte; ++ const u32 *addr = (use_dest_addr) ? &iph->daddr : &iph->saddr; ++ u64 eabits = ((u64)ntohl(*addr)) << (32 + fmr->ip4_prefix_len); ++ u64 t = 0; ++ ++ /* extract PSID from port and add it to eabits */ ++ u16 psidbits = 0; ++ if (psidlen > 0) { ++ psidbits = ((u16)portp[0]) << 8 | ((u16)portp[1]); ++ psidbits >>= 16 - psidlen - fmr->offset; ++ psidbits = (u16)(psidbits << (16 - psidlen)); ++ eabits |= ((u64)psidbits) << (48 - (fmr->ea_len - psidlen)); ++ } ++ ++ /* rewrite destination address */ ++ *dest = fmr->ip6_prefix; ++ memcpy(&dest->s6_addr[10], addr, sizeof(*addr)); ++ dest->s6_addr16[7] = htons(psidbits >> (16 - psidlen)); ++ ++ if (bytes > sizeof(u64)) ++ bytes = sizeof(u64); ++ ++ /* insert eabits */ ++ memcpy(&t, &dest->s6_addr[frombyte], bytes); ++ t = be64_to_cpu(t) & ~(((((u64)1) << fmr->ea_len) - 1) ++ << (64 - fmr->ea_len - fromrem)); ++ t = cpu_to_be64(t | (eabits >> fromrem)); ++ memcpy(&dest->s6_addr[frombyte], &t, bytes); ++ } ++} ++ ++ + static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb, + const struct tnl_ptk_info *tpi, + struct metadata_dst *tun_dst, +@@ -828,6 +946,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl + skb_reset_network_header(skb); + memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); + ++ if (tpi->proto == htons(ETH_P_IP) && ++ !ipv6_addr_equal(&ipv6h->saddr, &tunnel->parms.raddr)) { ++ /* Packet didn't come from BR, so lookup FMR */ ++ struct __ip6_tnl_fmr *fmr; ++ struct in6_addr expected = tunnel->parms.raddr; ++ for (fmr = tunnel->parms.fmrs; fmr; fmr = fmr->next) ++ if (ipv6_prefix_equal(&ipv6h->saddr, ++ &fmr->ip6_prefix, fmr->ip6_prefix_len)) ++ break; ++ ++ /* Check that IPv6 matches IPv4 source to prevent spoofing */ ++ if (fmr) ++ ip4ip6_fmr_calc(&expected, ip_hdr(skb), ++ skb_tail_pointer(skb), fmr, false); ++ ++ if (!ipv6_addr_equal(&ipv6h->saddr, &expected)) { ++ rcu_read_unlock(); ++ goto drop; ++ } ++ } ++ + __skb_tunnel_rx(skb, tunnel->dev, tunnel->net); + + err = dscp_ecn_decapsulate(tunnel, ipv6h, skb); +@@ -959,6 +1098,7 @@ static void init_tel_txopt(struct ipv6_t + opt->ops.opt_nflen = 8; + } + ++ + /** + * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own + * @t: the outgoing tunnel device +@@ -1295,6 +1435,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str + { + struct ip6_tnl *t = netdev_priv(dev); + struct ipv6hdr *ipv6h = ipv6_hdr(skb); ++ struct __ip6_tnl_fmr *fmr; + int encap_limit = -1; + __u16 offset; + struct flowi6 fl6; +@@ -1357,6 +1498,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str + + fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL); + ++ /* try to find matching FMR */ ++ for (fmr = t->parms.fmrs; fmr; fmr = fmr->next) { ++ unsigned mshift = 32 - fmr->ip4_prefix_len; ++ if (ntohl(fmr->ip4_prefix.s_addr) >> mshift == ++ ntohl(ip_hdr(skb)->daddr) >> mshift) ++ break; ++ } ++ ++ /* change dstaddr according to FMR */ ++ if (fmr) ++ ip4ip6_fmr_calc(&fl6.daddr, ip_hdr(skb), skb_tail_pointer(skb), fmr, true); ++ + if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) + return -1; + +@@ -1485,6 +1638,14 @@ ip6_tnl_change(struct ip6_tnl *t, const + t->parms.link = p->link; + t->parms.proto = p->proto; + t->parms.fwmark = p->fwmark; ++ ++ while (t->parms.fmrs) { ++ struct __ip6_tnl_fmr *next = t->parms.fmrs->next; ++ kfree(t->parms.fmrs); ++ t->parms.fmrs = next; ++ } ++ t->parms.fmrs = p->fmrs; ++ + dst_cache_reset(&t->dst_cache); + ip6_tnl_link_config(t); + return 0; +@@ -1523,6 +1684,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ + p->flowinfo = u->flowinfo; + p->link = u->link; + p->proto = u->proto; ++ p->fmrs = NULL; + memcpy(p->name, u->name, sizeof(u->name)); + } + +@@ -1904,6 +2066,15 @@ static int ip6_tnl_validate(struct nlatt + return 0; + } + ++static const struct nla_policy ip6_tnl_fmr_policy[IFLA_IPTUN_FMR_MAX + 1] = { ++ [IFLA_IPTUN_FMR_IP6_PREFIX] = { .len = sizeof(struct in6_addr) }, ++ [IFLA_IPTUN_FMR_IP4_PREFIX] = { .len = sizeof(struct in_addr) }, ++ [IFLA_IPTUN_FMR_IP6_PREFIX_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_IP4_PREFIX_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_EA_LEN] = { .type = NLA_U8 }, ++ [IFLA_IPTUN_FMR_OFFSET] = { .type = NLA_U8 } ++}; ++ + static void ip6_tnl_netlink_parms(struct nlattr *data[], + struct __ip6_tnl_parm *parms) + { +@@ -1941,6 +2112,46 @@ static void ip6_tnl_netlink_parms(struct + + if (data[IFLA_IPTUN_FWMARK]) + parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]); ++ ++ if (data[IFLA_IPTUN_FMRS]) { ++ unsigned rem; ++ struct nlattr *fmr; ++ nla_for_each_nested(fmr, data[IFLA_IPTUN_FMRS], rem) { ++ struct nlattr *fmrd[IFLA_IPTUN_FMR_MAX + 1], *c; ++ struct __ip6_tnl_fmr *nfmr; ++ ++ nla_parse_nested(fmrd, IFLA_IPTUN_FMR_MAX, ++ fmr, ip6_tnl_fmr_policy, NULL); ++ ++ if (!(nfmr = kzalloc(sizeof(*nfmr), GFP_KERNEL))) ++ continue; ++ ++ nfmr->offset = 6; ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP6_PREFIX])) ++ nla_memcpy(&nfmr->ip6_prefix, fmrd[IFLA_IPTUN_FMR_IP6_PREFIX], ++ sizeof(nfmr->ip6_prefix)); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP4_PREFIX])) ++ nla_memcpy(&nfmr->ip4_prefix, fmrd[IFLA_IPTUN_FMR_IP4_PREFIX], ++ sizeof(nfmr->ip4_prefix)); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP6_PREFIX_LEN])) ++ nfmr->ip6_prefix_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_IP4_PREFIX_LEN])) ++ nfmr->ip4_prefix_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_EA_LEN])) ++ nfmr->ea_len = nla_get_u8(c); ++ ++ if ((c = fmrd[IFLA_IPTUN_FMR_OFFSET])) ++ nfmr->offset = nla_get_u8(c); ++ ++ nfmr->next = parms->fmrs; ++ parms->fmrs = nfmr; ++ } ++ } + } + + static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[], +@@ -2052,6 +2263,12 @@ static void ip6_tnl_dellink(struct net_d + + static size_t ip6_tnl_get_size(const struct net_device *dev) + { ++ const struct ip6_tnl *t = netdev_priv(dev); ++ struct __ip6_tnl_fmr *c; ++ int fmrs = 0; ++ for (c = t->parms.fmrs; c; c = c->next) ++ ++fmrs; ++ + return + /* IFLA_IPTUN_LINK */ + nla_total_size(4) + +@@ -2081,6 +2298,24 @@ static size_t ip6_tnl_get_size(const str + nla_total_size(0) + + /* IFLA_IPTUN_FWMARK */ + nla_total_size(4) + ++ /* IFLA_IPTUN_FMRS */ ++ nla_total_size(0) + ++ ( ++ /* nest */ ++ nla_total_size(0) + ++ /* IFLA_IPTUN_FMR_IP6_PREFIX */ ++ nla_total_size(sizeof(struct in6_addr)) + ++ /* IFLA_IPTUN_FMR_IP4_PREFIX */ ++ nla_total_size(sizeof(struct in_addr)) + ++ /* IFLA_IPTUN_FMR_EA_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_IP6_PREFIX_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_IP4_PREFIX_LEN */ ++ nla_total_size(1) + ++ /* IFLA_IPTUN_FMR_OFFSET */ ++ nla_total_size(1) ++ ) * fmrs + + 0; + } + +@@ -2088,6 +2323,9 @@ static int ip6_tnl_fill_info(struct sk_b + { + struct ip6_tnl *tunnel = netdev_priv(dev); + struct __ip6_tnl_parm *parm = &tunnel->parms; ++ struct __ip6_tnl_fmr *c; ++ int fmrcnt = 0; ++ struct nlattr *fmrs; + + if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || + nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) || +@@ -2097,9 +2335,27 @@ static int ip6_tnl_fill_info(struct sk_b + nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || + nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || + nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) || +- nla_put_u32(skb, IFLA_IPTUN_FWMARK, parm->fwmark)) ++ nla_put_u32(skb, IFLA_IPTUN_FWMARK, parm->fwmark) || ++ !(fmrs = nla_nest_start(skb, IFLA_IPTUN_FMRS))) + goto nla_put_failure; + ++ for (c = parm->fmrs; c; c = c->next) { ++ struct nlattr *fmr = nla_nest_start(skb, ++fmrcnt); ++ if (!fmr || ++ nla_put(skb, IFLA_IPTUN_FMR_IP6_PREFIX, ++ sizeof(c->ip6_prefix), &c->ip6_prefix) || ++ nla_put(skb, IFLA_IPTUN_FMR_IP4_PREFIX, ++ sizeof(c->ip4_prefix), &c->ip4_prefix) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_IP6_PREFIX_LEN, c->ip6_prefix_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_IP4_PREFIX_LEN, c->ip4_prefix_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_EA_LEN, c->ea_len) || ++ nla_put_u8(skb, IFLA_IPTUN_FMR_OFFSET, c->offset)) ++ goto nla_put_failure; ++ ++ nla_nest_end(skb, fmr); ++ } ++ nla_nest_end(skb, fmrs); ++ + if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) || + nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) || + nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) || +@@ -2139,6 +2395,7 @@ static const struct nla_policy ip6_tnl_p + [IFLA_IPTUN_ENCAP_DPORT] = { .type = NLA_U16 }, + [IFLA_IPTUN_COLLECT_METADATA] = { .type = NLA_FLAG }, + [IFLA_IPTUN_FWMARK] = { .type = NLA_U32 }, ++ [IFLA_IPTUN_FMRS] = { .type = NLA_NESTED }, + }; + + static struct rtnl_link_ops ip6_link_ops __read_mostly = { diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch new file mode 100644 index 000000000..82b9ba535 --- /dev/null +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -0,0 +1,247 @@ +From: Jonas Gorski +Subject: ipv6: allow rejecting with "source address failed policy" + +RFC6204 L-14 requires rejecting traffic from invalid addresses with +ICMPv6 Destination Unreachable, Code 5 (Source address failed ingress/ +egress policy) on the LAN side, so add an appropriate rule for that. + +Signed-off-by: Jonas Gorski +--- + include/net/netns/ipv6.h | 1 + + include/uapi/linux/fib_rules.h | 4 +++ + include/uapi/linux/rtnetlink.h | 1 + + net/ipv4/fib_semantics.c | 4 +++ + net/ipv4/fib_trie.c | 1 + + net/ipv4/ipmr.c | 1 + + net/ipv6/fib6_rules.c | 4 +++ + net/ipv6/ip6mr.c | 2 ++ + net/ipv6/route.c | 58 +++++++++++++++++++++++++++++++++++++++++- + 9 files changed, 75 insertions(+), 1 deletion(-) + +--- a/include/net/netns/ipv6.h ++++ b/include/net/netns/ipv6.h +@@ -69,6 +69,7 @@ struct netns_ipv6 { + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + bool fib6_has_custom_rules; + struct rt6_info *ip6_prohibit_entry; ++ struct rt6_info *ip6_policy_failed_entry; + struct rt6_info *ip6_blk_hole_entry; + struct fib6_table *fib6_local_tbl; + struct fib_rules_ops *fib6_rules_ops; +--- a/include/uapi/linux/fib_rules.h ++++ b/include/uapi/linux/fib_rules.h +@@ -73,6 +73,10 @@ enum { + FR_ACT_BLACKHOLE, /* Drop without notification */ + FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ + FR_ACT_PROHIBIT, /* Drop with EACCES */ ++ FR_ACT_RES9, ++ FR_ACT_RES10, ++ FR_ACT_RES11, ++ FR_ACT_POLICY_FAILED, /* Drop with EACCES */ + __FR_ACT_MAX, + }; + +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -221,6 +221,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_POLICY_FAILED, /* Failed ingress/egress policy */ + __RTN_MAX + }; + +--- a/net/ipv4/fib_semantics.c ++++ b/net/ipv4/fib_semantics.c +@@ -139,6 +139,10 @@ const struct fib_prop fib_props[RTN_MAX + .error = -EINVAL, + .scope = RT_SCOPE_NOWHERE, + }, ++ [RTN_POLICY_FAILED] = { ++ .error = -EACCES, ++ .scope = RT_SCOPE_UNIVERSE, ++ }, + }; + + static void rt_fibinfo_free(struct rtable __rcu **rtp) +--- a/net/ipv4/fib_trie.c ++++ b/net/ipv4/fib_trie.c +@@ -2460,6 +2460,7 @@ static const char *const rtn_type_names[ + [RTN_THROW] = "THROW", + [RTN_NAT] = "NAT", + [RTN_XRESOLVE] = "XRESOLVE", ++ [RTN_POLICY_FAILED] = "POLICY_FAILED", + }; + + static inline const char *rtn_type(char *buf, size_t len, unsigned int t) +--- a/net/ipv4/ipmr.c ++++ b/net/ipv4/ipmr.c +@@ -161,6 +161,7 @@ static int ipmr_rule_action(struct fib_r + case FR_ACT_UNREACHABLE: + return -ENETUNREACH; + case FR_ACT_PROHIBIT: ++ case FR_ACT_POLICY_FAILED: + return -EACCES; + case FR_ACT_BLACKHOLE: + default: +--- a/net/ipv6/fib6_rules.c ++++ b/net/ipv6/fib6_rules.c +@@ -121,6 +121,10 @@ static int fib6_rule_action(struct fib_r + err = -EACCES; + rt = net->ipv6.ip6_prohibit_entry; + goto discard_pkt; ++ case FR_ACT_POLICY_FAILED: ++ err = -EACCES; ++ rt = net->ipv6.ip6_policy_failed_entry; ++ goto discard_pkt; + } + + tb_id = fib_rule_get_table(rule, arg); +--- a/net/ipv6/ip6mr.c ++++ b/net/ipv6/ip6mr.c +@@ -168,6 +168,8 @@ static int ip6mr_rule_action(struct fib_ + return -ENETUNREACH; + case FR_ACT_PROHIBIT: + return -EACCES; ++ case FR_ACT_POLICY_FAILED: ++ return -EACCES; + case FR_ACT_BLACKHOLE: + default: + return -EINVAL; +--- a/net/ipv6/route.c ++++ b/net/ipv6/route.c +@@ -91,6 +91,8 @@ static int ip6_pkt_discard(struct sk_bu + static int ip6_pkt_discard_out(struct net *net, struct sock *sk, struct sk_buff *skb); + static int ip6_pkt_prohibit(struct sk_buff *skb); + static int ip6_pkt_prohibit_out(struct net *net, struct sock *sk, struct sk_buff *skb); ++static int ip6_pkt_policy_failed(struct sk_buff *skb); ++static int ip6_pkt_policy_failed_out(struct net *net, struct sock *sk, struct sk_buff *skb); + static void ip6_link_failure(struct sk_buff *skb); + static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, + struct sk_buff *skb, u32 mtu); +@@ -321,6 +323,21 @@ static const struct rt6_info ip6_prohibi + .rt6i_ref = ATOMIC_INIT(1), + }; + ++static const struct rt6_info ip6_policy_failed_entry_template = { ++ .dst = { ++ .__refcnt = ATOMIC_INIT(1), ++ .__use = 1, ++ .obsolete = DST_OBSOLETE_FORCE_CHK, ++ .error = -EACCES, ++ .input = ip6_pkt_policy_failed, ++ .output = ip6_pkt_policy_failed_out, ++ }, ++ .rt6i_flags = (RTF_REJECT | RTF_NONEXTHOP), ++ .rt6i_protocol = RTPROT_KERNEL, ++ .rt6i_metric = ~(u32) 0, ++ .rt6i_ref = ATOMIC_INIT(1), ++}; ++ + static const struct rt6_info ip6_blk_hole_entry_template = { + .dst = { + .__refcnt = ATOMIC_INIT(1), +@@ -2037,6 +2054,11 @@ static struct rt6_info *ip6_route_info_c + rt->dst.output = ip6_pkt_prohibit_out; + rt->dst.input = ip6_pkt_prohibit; + break; ++ case RTN_POLICY_FAILED: ++ rt->dst.error = -EACCES; ++ rt->dst.output = ip6_pkt_policy_failed_out; ++ rt->dst.input = ip6_pkt_policy_failed; ++ break; + case RTN_THROW: + case RTN_UNREACHABLE: + default: +@@ -2762,6 +2784,17 @@ static int ip6_pkt_prohibit_out(struct n + return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); + } + ++static int ip6_pkt_policy_failed(struct sk_buff *skb) ++{ ++ return ip6_pkt_drop(skb, ICMPV6_POLICY_FAIL, IPSTATS_MIB_INNOROUTES); ++} ++ ++static int ip6_pkt_policy_failed_out(struct net *net, struct sock *sk, struct sk_buff *skb) ++{ ++ skb->dev = skb_dst(skb)->dev; ++ return ip6_pkt_drop(skb, ICMPV6_POLICY_FAIL, IPSTATS_MIB_OUTNOROUTES); ++} ++ + /* + * Allocate a dst for local (unicast / anycast) address. + */ +@@ -2996,7 +3029,8 @@ static int rtm_to_fib6_config(struct sk_ + if (rtm->rtm_type == RTN_UNREACHABLE || + rtm->rtm_type == RTN_BLACKHOLE || + rtm->rtm_type == RTN_PROHIBIT || +- rtm->rtm_type == RTN_THROW) ++ rtm->rtm_type == RTN_THROW || ++ rtm->rtm_type == RTN_POLICY_FAILED) + cfg->fc_flags |= RTF_REJECT; + + if (rtm->rtm_type == RTN_LOCAL) +@@ -3486,6 +3520,9 @@ static int rt6_fill_node(struct net *net + case -EACCES: + rtm->rtm_type = RTN_PROHIBIT; + break; ++ case -EPERM: ++ rtm->rtm_type = RTN_POLICY_FAILED; ++ break; + case -EAGAIN: + rtm->rtm_type = RTN_THROW; + break; +@@ -3801,6 +3838,8 @@ static int ip6_route_dev_notify(struct n + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + net->ipv6.ip6_prohibit_entry->dst.dev = dev; + net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); ++ net->ipv6.ip6_policy_failed_entry->dst.dev = dev; ++ net->ipv6.ip6_policy_failed_entry->rt6i_idev = in6_dev_get(dev); + net->ipv6.ip6_blk_hole_entry->dst.dev = dev; + net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); + #endif +@@ -4028,6 +4067,17 @@ static int __net_init ip6_route_net_init + net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; + dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, + ip6_template_metrics, true); ++ ++ net->ipv6.ip6_policy_failed_entry = ++ kmemdup(&ip6_policy_failed_entry_template, ++ sizeof(*net->ipv6.ip6_policy_failed_entry), GFP_KERNEL); ++ if (!net->ipv6.ip6_policy_failed_entry) ++ goto out_ip6_blk_hole_entry; ++ net->ipv6.ip6_policy_failed_entry->dst.path = ++ (struct dst_entry *)net->ipv6.ip6_policy_failed_entry; ++ net->ipv6.ip6_policy_failed_entry->dst.ops = &net->ipv6.ip6_dst_ops; ++ dst_init_metrics(&net->ipv6.ip6_policy_failed_entry->dst, ++ ip6_template_metrics, true); + #endif + + net->ipv6.sysctl.flush_delay = 0; +@@ -4046,6 +4096,8 @@ out: + return ret; + + #ifdef CONFIG_IPV6_MULTIPLE_TABLES ++out_ip6_blk_hole_entry: ++ kfree(net->ipv6.ip6_blk_hole_entry); + out_ip6_prohibit_entry: + kfree(net->ipv6.ip6_prohibit_entry); + out_ip6_null_entry: +@@ -4063,6 +4115,7 @@ static void __net_exit ip6_route_net_exi + #ifdef CONFIG_IPV6_MULTIPLE_TABLES + kfree(net->ipv6.ip6_prohibit_entry); + kfree(net->ipv6.ip6_blk_hole_entry); ++ kfree(net->ipv6.ip6_policy_failed_entry); + #endif + dst_entries_destroy(&net->ipv6.ip6_dst_ops); + } +@@ -4136,6 +4189,9 @@ void __init ip6_route_init_special_entri + init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); + init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; + init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); ++ init_net.ipv6.ip6_policy_failed_entry->dst.dev = init_net.loopback_dev; ++ init_net.ipv6.ip6_policy_failed_entry->rt6i_idev = ++ in6_dev_get(init_net.loopback_dev); + #endif + } + diff --git a/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch b/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch new file mode 100644 index 000000000..cfea527e3 --- /dev/null +++ b/target/linux/generic/pending-4.14/671-net-provide-defines-for-_POLICY_FAILED-until-all-cod.patch @@ -0,0 +1,50 @@ +From: Jonas Gorski +Subject: net: provide defines for _POLICY_FAILED until all code is updated + +Upstream introduced ICMPV6_POLICY_FAIL for code 5 of destination +unreachable, conflicting with our name. + +Add appropriate defines to allow our code to build with the new +name until we have updated our local patches for older kernels +and userspace packages. + +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/fib_rules.h | 2 ++ + include/uapi/linux/icmpv6.h | 2 ++ + include/uapi/linux/rtnetlink.h | 2 ++ + 3 files changed, 6 insertions(+) + +--- a/include/uapi/linux/fib_rules.h ++++ b/include/uapi/linux/fib_rules.h +@@ -80,6 +80,8 @@ enum { + __FR_ACT_MAX, + }; + ++#define FR_ACT_FAILED_POLICY FR_ACT_POLICY_FAILED ++ + #define FR_ACT_MAX (__FR_ACT_MAX - 1) + + #endif +--- a/include/uapi/linux/icmpv6.h ++++ b/include/uapi/linux/icmpv6.h +@@ -119,6 +119,8 @@ struct icmp6hdr { + #define ICMPV6_POLICY_FAIL 5 + #define ICMPV6_REJECT_ROUTE 6 + ++#define ICMPV6_FAILED_POLICY ICMPV6_POLICY_FAIL ++ + /* + * Codes for Time Exceeded + */ +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -225,6 +225,8 @@ enum { + __RTN_MAX + }; + ++#define RTN_FAILED_POLICY RTN_POLICY_FAILED ++ + #define RTN_MAX (__RTN_MAX - 1) + + diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch new file mode 100644 index 000000000..4467975b9 --- /dev/null +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -0,0 +1,145 @@ +From: Felix Fietkau +Subject: net: replace GRO optimization patch with a new one that supports VLANs/bridges with different MAC addresses + +Signed-off-by: Felix Fietkau +--- + include/linux/netdevice.h | 2 ++ + include/linux/skbuff.h | 3 ++- + net/core/dev.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ + net/ethernet/eth.c | 18 +++++++++++++++++- + 4 files changed, 69 insertions(+), 2 deletions(-) + +--- a/include/linux/netdevice.h ++++ b/include/linux/netdevice.h +@@ -1739,6 +1739,8 @@ struct net_device { + struct netdev_hw_addr_list mc; + struct netdev_hw_addr_list dev_addrs; + ++ unsigned char local_addr_mask[MAX_ADDR_LEN]; ++ + #ifdef CONFIG_SYSFS + struct kset *queues_kset; + #endif +--- a/include/linux/skbuff.h ++++ b/include/linux/skbuff.h +@@ -778,6 +778,7 @@ struct sk_buff { + __u8 tc_redirected:1; + __u8 tc_from_ingress:1; + #endif ++ __u8 gro_skip:1; + + #ifdef CONFIG_NET_SCHED + __u16 tc_index; /* traffic control index */ +--- a/net/core/dev.c ++++ b/net/core/dev.c +@@ -4756,6 +4756,9 @@ static enum gro_result dev_gro_receive(s + enum gro_result ret; + int grow; + ++ if (skb->gro_skip) ++ goto normal; ++ + if (netif_elide_gro(skb->dev)) + goto normal; + +@@ -6226,6 +6229,48 @@ static void __netdev_adjacent_dev_unlink + &upper_dev->adj_list.lower); + } + ++static void __netdev_addr_mask(unsigned char *mask, const unsigned char *addr, ++ struct net_device *dev) ++{ ++ int i; ++ ++ for (i = 0; i < dev->addr_len; i++) ++ mask[i] |= addr[i] ^ dev->dev_addr[i]; ++} ++ ++static void __netdev_upper_mask(unsigned char *mask, struct net_device *dev, ++ struct net_device *lower) ++{ ++ struct net_device *cur; ++ struct list_head *iter; ++ ++ netdev_for_each_upper_dev_rcu(dev, cur, iter) { ++ __netdev_addr_mask(mask, cur->dev_addr, lower); ++ __netdev_upper_mask(mask, cur, lower); ++ } ++} ++ ++static void __netdev_update_addr_mask(struct net_device *dev) ++{ ++ unsigned char mask[MAX_ADDR_LEN]; ++ struct net_device *cur; ++ struct list_head *iter; ++ ++ memset(mask, 0, sizeof(mask)); ++ __netdev_upper_mask(mask, dev, dev); ++ memcpy(dev->local_addr_mask, mask, dev->addr_len); ++ ++ netdev_for_each_lower_dev(dev, cur, iter) ++ __netdev_update_addr_mask(cur); ++} ++ ++static void netdev_update_addr_mask(struct net_device *dev) ++{ ++ rcu_read_lock(); ++ __netdev_update_addr_mask(dev); ++ rcu_read_unlock(); ++} ++ + static int __netdev_upper_dev_link(struct net_device *dev, + struct net_device *upper_dev, bool master, + void *upper_priv, void *upper_info) +@@ -6341,6 +6386,8 @@ void netdev_upper_dev_unlink(struct net_ + + __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); + ++ netdev_update_addr_mask(dev); ++ netdev_update_addr_mask(dev); + call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, + &changeupper_info.info); + } +@@ -6911,6 +6958,7 @@ int dev_set_mac_address(struct net_devic + if (err) + return err; + dev->addr_assign_type = NET_ADDR_SET; ++ netdev_update_addr_mask(dev); + call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); + add_device_randomness(dev->dev_addr, dev->addr_len); + return 0; +--- a/net/ethernet/eth.c ++++ b/net/ethernet/eth.c +@@ -144,6 +144,18 @@ u32 eth_get_headlen(void *data, unsigned + } + EXPORT_SYMBOL(eth_get_headlen); + ++static inline bool ++eth_check_local_mask(const void *addr1, const void *addr2, const void *mask) ++{ ++ const u16 *a1 = addr1; ++ const u16 *a2 = addr2; ++ const u16 *m = mask; ++ ++ return (((a1[0] ^ a2[0]) & ~m[0]) | ++ ((a1[1] ^ a2[1]) & ~m[1]) | ++ ((a1[2] ^ a2[2]) & ~m[2])); ++} ++ + /** + * eth_type_trans - determine the packet's protocol ID. + * @skb: received socket data +@@ -172,8 +184,12 @@ __be16 eth_type_trans(struct sk_buff *sk + skb->pkt_type = PACKET_MULTICAST; + } + else if (unlikely(!ether_addr_equal_64bits(eth->h_dest, +- dev->dev_addr))) ++ dev->dev_addr))) { + skb->pkt_type = PACKET_OTHERHOST; ++ if (eth_check_local_mask(eth->h_dest, dev->dev_addr, ++ dev->local_addr_mask)) ++ skb->gro_skip = 1; ++ } + + /* + * Some variants of DSA tagging don't have an ethertype field diff --git a/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch new file mode 100644 index 000000000..b29b5f11b --- /dev/null +++ b/target/linux/generic/pending-4.14/681-NET-add-of_get_mac_address_mtd.patch @@ -0,0 +1,127 @@ +From: John Crispin +Subject: NET: add mtd-mac-address support to of_get_mac_address() + +Many embedded devices have information such as mac addresses stored inside mtd +devices. This patch allows us to add a property inside a node describing a +network interface. The new property points at a mtd partition with an offset +where the mac address can be found. + +Signed-off-by: John Crispin +Signed-off-by: Felix Fietkau +--- + drivers/of/of_net.c | 37 +++++++++++++++++++++++++++++++++++++ + include/linux/of_net.h | 1 + + 2 files changed, 38 insertions(+) + +--- a/drivers/of/of_net.c ++++ b/drivers/of/of_net.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + /** + * of_get_phy_mode - Get phy mode for given device_node +@@ -38,7 +39,7 @@ int of_get_phy_mode(struct device_node * + } + EXPORT_SYMBOL_GPL(of_get_phy_mode); + +-static const void *of_get_mac_addr(struct device_node *np, const char *name) ++static void *of_get_mac_addr(struct device_node *np, const char *name) + { + struct property *pp = of_find_property(np, name, NULL); + +@@ -47,6 +48,73 @@ static const void *of_get_mac_addr(struc + return NULL; + } + ++static const void *of_get_mac_address_mtd(struct device_node *np) ++{ ++#ifdef CONFIG_MTD ++ struct device_node *mtd_np = NULL; ++ struct property *prop; ++ size_t retlen; ++ int size, ret; ++ struct mtd_info *mtd; ++ const char *part; ++ const __be32 *list; ++ phandle phandle; ++ u32 mac_inc = 0; ++ u8 mac[ETH_ALEN]; ++ void *addr; ++ ++ list = of_get_property(np, "mtd-mac-address", &size); ++ if (!list || (size != (2 * sizeof(*list)))) ++ return NULL; ++ ++ phandle = be32_to_cpup(list++); ++ if (phandle) ++ mtd_np = of_find_node_by_phandle(phandle); ++ ++ if (!mtd_np) ++ return NULL; ++ ++ part = of_get_property(mtd_np, "label", NULL); ++ if (!part) ++ part = mtd_np->name; ++ ++ mtd = get_mtd_device_nm(part); ++ if (IS_ERR(mtd)) ++ return NULL; ++ ++ ret = mtd_read(mtd, be32_to_cpup(list), 6, &retlen, mac); ++ put_mtd_device(mtd); ++ ++ if (!of_property_read_u32(np, "mtd-mac-address-increment", &mac_inc)) ++ mac[5] += mac_inc; ++ ++ if (!is_valid_ether_addr(mac)) ++ return NULL; ++ ++ addr = of_get_mac_addr(np, "mac-address"); ++ if (addr) { ++ memcpy(addr, mac, ETH_ALEN); ++ return addr; ++ } ++ ++ prop = kzalloc(sizeof(*prop), GFP_KERNEL); ++ if (!prop) ++ return NULL; ++ ++ prop->name = "mac-address"; ++ prop->length = ETH_ALEN; ++ prop->value = kmemdup(mac, ETH_ALEN, GFP_KERNEL); ++ if (!prop->value || of_add_property(np, prop)) ++ goto free; ++ ++ return prop->value; ++free: ++ kfree(prop->value); ++ kfree(prop); ++#endif ++ return NULL; ++} ++ + /** + * Search the device tree for the best MAC address to use. 'mac-address' is + * checked first, because that is supposed to contain to "most recent" MAC +@@ -64,11 +132,18 @@ static const void *of_get_mac_addr(struc + * addresses. Some older U-Boots only initialized 'local-mac-address'. In + * this case, the real MAC is in 'local-mac-address', and 'mac-address' exists + * but is all zeros. ++ * ++ * If a mtd-mac-address property exists, try to fetch the MAC address from the ++ * specified mtd device, and store it as a 'mac-address' property + */ + const void *of_get_mac_address(struct device_node *np) + { + const void *addr; + ++ addr = of_get_mac_address_mtd(np); ++ if (addr) ++ return addr; ++ + addr = of_get_mac_addr(np, "mac-address"); + if (addr) + return addr; diff --git a/target/linux/generic/pending-4.14/701-phy_extension.patch b/target/linux/generic/pending-4.14/701-phy_extension.patch new file mode 100644 index 000000000..1b380e24a --- /dev/null +++ b/target/linux/generic/pending-4.14/701-phy_extension.patch @@ -0,0 +1,95 @@ +From: John Crispin +Subject: net: phy: add phy_ethtool_ioctl() + +Signed-off-by: John Crispin +--- + drivers/net/phy/phy.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + include/linux/phy.h | 1 + + 2 files changed, 45 insertions(+) + +--- a/drivers/net/phy/phy.c ++++ b/drivers/net/phy/phy.c +@@ -382,6 +382,73 @@ void phy_ethtool_ksettings_get(struct ph + } + EXPORT_SYMBOL(phy_ethtool_ksettings_get); + ++static int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) ++{ ++ cmd->supported = phydev->supported; ++ ++ cmd->advertising = phydev->advertising; ++ cmd->lp_advertising = phydev->lp_advertising; ++ ++ ethtool_cmd_speed_set(cmd, phydev->speed); ++ cmd->duplex = phydev->duplex; ++ if (phydev->interface == PHY_INTERFACE_MODE_MOCA) ++ cmd->port = PORT_BNC; ++ else ++ cmd->port = PORT_MII; ++ cmd->phy_address = phydev->mdio.addr; ++ cmd->transceiver = phy_is_internal(phydev) ? ++ XCVR_INTERNAL : XCVR_EXTERNAL; ++ cmd->autoneg = phydev->autoneg; ++ cmd->eth_tp_mdix_ctrl = phydev->mdix_ctrl; ++ cmd->eth_tp_mdix = phydev->mdix; ++ ++ return 0; ++} ++ ++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr) ++{ ++ u32 cmd; ++ int tmp; ++ struct ethtool_cmd ecmd = { ETHTOOL_GSET }; ++ struct ethtool_value edata = { ETHTOOL_GLINK }; ++ ++ if (get_user(cmd, (u32 *) useraddr)) ++ return -EFAULT; ++ ++ switch (cmd) { ++ case ETHTOOL_GSET: ++ phy_ethtool_gset(phydev, &ecmd); ++ if (copy_to_user(useraddr, &ecmd, sizeof(ecmd))) ++ return -EFAULT; ++ return 0; ++ ++ case ETHTOOL_SSET: ++ if (copy_from_user(&ecmd, useraddr, sizeof(ecmd))) ++ return -EFAULT; ++ return phy_ethtool_sset(phydev, &ecmd); ++ ++ case ETHTOOL_NWAY_RST: ++ /* if autoneg is off, it's an error */ ++ tmp = phy_read(phydev, MII_BMCR); ++ if (tmp & BMCR_ANENABLE) { ++ tmp |= (BMCR_ANRESTART); ++ phy_write(phydev, MII_BMCR, tmp); ++ return 0; ++ } ++ return -EINVAL; ++ ++ case ETHTOOL_GLINK: ++ edata.data = (phy_read(phydev, ++ MII_BMSR) & BMSR_LSTATUS) ? 1 : 0; ++ if (copy_to_user(useraddr, &edata, sizeof(edata))) ++ return -EFAULT; ++ return 0; ++ } ++ ++ return -EOPNOTSUPP; ++} ++EXPORT_SYMBOL(phy_ethtool_ioctl); ++ + /** + * phy_mii_ioctl - generic PHY MII ioctl interface + * @phydev: the phy_device struct +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -905,6 +905,7 @@ void phy_ethtool_ksettings_get(struct ph + struct ethtool_link_ksettings *cmd); + int phy_ethtool_ksettings_set(struct phy_device *phydev, + const struct ethtool_link_ksettings *cmd); ++int phy_ethtool_ioctl(struct phy_device *phydev, void *useraddr); + int phy_mii_ioctl(struct phy_device *phydev, struct ifreq *ifr, int cmd); + int phy_start_interrupts(struct phy_device *phydev); + void phy_print_status(struct phy_device *phydev); diff --git a/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch new file mode 100644 index 000000000..3d5f8fc5e --- /dev/null +++ b/target/linux/generic/pending-4.14/703-phy-add-detach-callback-to-struct-phy_driver.patch @@ -0,0 +1,38 @@ +From: Gabor Juhos +Subject: generic: add detach callback to struct phy_driver + +lede-commit: fe61fc2d7d0b3fb348b502f68f98243b3ddf5867 + +Signed-off-by: Gabor Juhos +--- + drivers/net/phy/phy_device.c | 3 +++ + include/linux/phy.h | 6 ++++++ + 2 files changed, 9 insertions(+) + +--- a/drivers/net/phy/phy_device.c ++++ b/drivers/net/phy/phy_device.c +@@ -1095,6 +1095,9 @@ void phy_detach(struct phy_device *phyde + struct module *ndev_owner = dev->dev.parent->driver->owner; + struct mii_bus *bus; + ++ if (phydev->drv && phydev->drv->detach) ++ phydev->drv->detach(phydev); ++ + if (phydev->sysfs_links) { + sysfs_remove_link(&dev->dev.kobj, "phydev"); + sysfs_remove_link(&phydev->mdio.dev.kobj, "attached_dev"); +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -559,6 +559,12 @@ struct phy_driver { + */ + int (*did_interrupt)(struct phy_device *phydev); + ++ /* ++ * Called before an ethernet device is detached ++ * from the PHY. ++ */ ++ void (*detach)(struct phy_device *phydev); ++ + /* Clears up any memory if needed */ + void (*remove)(struct phy_device *phydev); + diff --git a/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch b/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch new file mode 100644 index 000000000..19dea170c --- /dev/null +++ b/target/linux/generic/pending-4.14/734-net-phy-at803x-allow-to-configure-via-pdata.patch @@ -0,0 +1,142 @@ +From: Gabor Juhos +Subject: net: phy: allow to configure AR803x PHYs via platform data + +Add a patch for the at803x phy driver, in order to be able +to configure some register settings via platform data. + +Signed-off-by: Gabor Juhos +--- + drivers/net/phy/at803x.c | 56 ++++++++++++++++++++++++++++++++ + include/linux/platform_data/phy-at803x.h | 11 +++++++ + 2 files changed, 67 insertions(+) + create mode 100644 include/linux/platform_data/phy-at803x.h + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -12,12 +12,14 @@ + */ + + #include ++#include + #include + #include + #include + #include + #include + #include ++#include + + #define AT803X_INTR_ENABLE 0x12 + #define AT803X_INTR_ENABLE_AUTONEG_ERR BIT(15) +@@ -45,6 +47,11 @@ + #define AT803X_REG_CHIP_CONFIG 0x1f + #define AT803X_BT_BX_REG_SEL 0x8000 + ++#define AT803X_PCS_SMART_EEE_CTRL3 0x805D ++#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_MASK 0x3 ++#define AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT 12 ++#define AT803X_SMART_EEE_CTRL3_LPI_EN BIT(8) ++ + #define AT803X_DEBUG_ADDR 0x1D + #define AT803X_DEBUG_DATA 0x1E + +@@ -73,6 +80,7 @@ MODULE_LICENSE("GPL"); + struct at803x_priv { + bool phy_reset:1; + struct gpio_desc *gpiod_reset; ++ int prev_speed; + }; + + struct at803x_context { +@@ -277,8 +285,16 @@ does_not_require_reset_workaround: + return 0; + } + ++static void at803x_disable_smarteee(struct phy_device *phydev) ++{ ++ phy_write_mmd(phydev, MDIO_MMD_PCS, AT803X_PCS_SMART_EEE_CTRL3, ++ 1 << AT803X_SMART_EEE_CTRL3_LPI_TX_DELAY_SEL_SHIFT); ++ phy_write_mmd(phydev, MDIO_MMD_AN, MDIO_AN_EEE_ADV, 0); ++} ++ + static int at803x_config_init(struct phy_device *phydev) + { ++ struct at803x_platform_data *pdata; + int ret; + + ret = genphy_config_init(phydev); +@@ -299,6 +315,26 @@ static int at803x_config_init(struct phy + return ret; + } + ++ pdata = dev_get_platdata(&phydev->mdio.dev); ++ if (pdata) { ++ if (pdata->disable_smarteee) ++ at803x_disable_smarteee(phydev); ++ ++ if (pdata->enable_rgmii_rx_delay) ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0, ++ AT803X_DEBUG_RX_CLK_DLY_EN); ++ else ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, ++ AT803X_DEBUG_RX_CLK_DLY_EN, 0); ++ ++ if (pdata->enable_rgmii_tx_delay) ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, ++ AT803X_DEBUG_TX_CLK_DLY_EN); ++ else ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ } ++ + return 0; + } + +@@ -336,6 +372,8 @@ static int at803x_config_intr(struct phy + static void at803x_link_change_notify(struct phy_device *phydev) + { + struct at803x_priv *priv = phydev->priv; ++ struct at803x_platform_data *pdata; ++ pdata = dev_get_platdata(&phydev->mdio.dev); + + /* + * Conduct a hardware reset for AT8030/2 every time a link loss is +@@ -364,6 +402,24 @@ static void at803x_link_change_notify(st + } else { + priv->phy_reset = false; + } ++ if (pdata && pdata->fixup_rgmii_tx_delay && ++ phydev->speed != priv->prev_speed) { ++ switch (phydev->speed) { ++ case SPEED_10: ++ case SPEED_100: ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0, ++ AT803X_DEBUG_TX_CLK_DLY_EN); ++ break; ++ case SPEED_1000: ++ at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, ++ AT803X_DEBUG_TX_CLK_DLY_EN, 0); ++ break; ++ default: ++ break; ++ } ++ ++ priv->prev_speed = phydev->speed; ++ } + } + + static int at803x_aneg_done(struct phy_device *phydev) +--- /dev/null ++++ b/include/linux/platform_data/phy-at803x.h +@@ -0,0 +1,11 @@ ++#ifndef _PHY_AT803X_PDATA_H ++#define _PHY_AT803X_PDATA_H ++ ++struct at803x_platform_data { ++ int disable_smarteee:1; ++ int enable_rgmii_tx_delay:1; ++ int enable_rgmii_rx_delay:1; ++ int fixup_rgmii_tx_delay:1; ++}; ++ ++#endif /* _PHY_AT803X_PDATA_H */ diff --git a/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch new file mode 100644 index 000000000..3c686623b --- /dev/null +++ b/target/linux/generic/pending-4.14/735-net-phy-at803x-fix-at8033-sgmii-mode.patch @@ -0,0 +1,54 @@ +From: Roman Yeryomin +Subject: kernel: add at803x fix for sgmii mode + +Some (possibly broken) bootloaders incorreclty initialize at8033 +phy. This patch enables sgmii autonegotiation mode. + +[john@phrozen.org: felix added this to his upstream queue] + +Signed-off-by: Roman Yeryomin +--- + drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +--- a/drivers/net/phy/at803x.c ++++ b/drivers/net/phy/at803x.c +@@ -55,6 +55,10 @@ + #define AT803X_DEBUG_ADDR 0x1D + #define AT803X_DEBUG_DATA 0x1E + ++#define AT803X_REG_CHIP_CONFIG 0x1f ++#define AT803X_BT_BX_REG_SEL 0x8000 ++#define AT803X_SGMII_ANEG_EN 0x1000 ++ + #define AT803X_MODE_CFG_MASK 0x0F + #define AT803X_MODE_CFG_SGMII 0x01 + +@@ -296,6 +300,27 @@ static int at803x_config_init(struct phy + { + struct at803x_platform_data *pdata; + int ret; ++ u32 v; ++ ++ if (phydev->drv->phy_id == ATH8031_PHY_ID && ++ phydev->interface == PHY_INTERFACE_MODE_SGMII) ++ { ++ v = phy_read(phydev, AT803X_REG_CHIP_CONFIG); ++ /* select SGMII/fiber page */ ++ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, ++ v & ~AT803X_BT_BX_REG_SEL); ++ if (ret) ++ return ret; ++ /* enable SGMII autonegotiation */ ++ ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN); ++ if (ret) ++ return ret; ++ /* select copper page */ ++ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, ++ v | AT803X_BT_BX_REG_SEL); ++ if (ret) ++ return ret; ++ } + + ret = genphy_config_init(phydev); + if (ret < 0) diff --git a/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch new file mode 100644 index 000000000..2a5bcc8ef --- /dev/null +++ b/target/linux/generic/pending-4.14/810-pci_disable_common_quirks.patch @@ -0,0 +1,60 @@ +From: Gabor Juhos +Subject: debloat: add kernel config option to disabling common PCI quirks + +Signed-off-by: Gabor Juhos +--- + drivers/pci/Kconfig | 6 ++++++ + drivers/pci/quirks.c | 6 ++++++ + 2 files changed, 12 insertions(+) + +--- a/drivers/pci/Kconfig ++++ b/drivers/pci/Kconfig +@@ -71,6 +71,12 @@ config XEN_PCIDEV_FRONTEND + The PCI device frontend driver allows the kernel to import arbitrary + PCI devices from a PCI backend to support PCI driver domains. + ++config PCI_DISABLE_COMMON_QUIRKS ++ bool "PCI disable common quirks" ++ depends on PCI ++ help ++ If you don't know what to do here, say N. ++ + config HT_IRQ + bool "Interrupts on hypertransport devices" + default y +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -43,6 +43,7 @@ static void quirk_mmio_always_on(struct + DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_BRIDGE_HOST, 8, quirk_mmio_always_on); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS + /* The Mellanox Tavor device gives false positive parity errors + * Mark this device with a broken_parity_status, to allow + * PCI scanning code to "skip" this now blacklisted device. +@@ -3077,6 +3078,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65f9, quirk_intel_mc_errata); + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x65fa, quirk_intel_mc_errata); + ++#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ + + /* + * Ivytown NTB BAR sizes are misreported by the hardware due to an erratum. To +@@ -3133,6 +3135,8 @@ static void fixup_debug_report(struct pc + } + } + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + /* + * Some BIOS implementations leave the Intel GPU interrupts enabled, + * even though no one is handling them (f.e. i915 driver is never loaded). +@@ -3167,6 +3171,8 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_IN + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq); + DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0152, disable_igfx_irq); + ++#endif /* !CONFIG_PCI_DISABLE_COMMON_QUIRKS */ ++ + /* + * PCI devices which are on Intel chips can skip the 10ms delay + * before entering D3 mode. diff --git a/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch new file mode 100644 index 000000000..005c25d04 --- /dev/null +++ b/target/linux/generic/pending-4.14/811-pci_disable_usb_common_quirks.patch @@ -0,0 +1,113 @@ +From: Felix Fietkau +Subject: debloat: disable common USB quirks + +Signed-off-by: Felix Fietkau +--- + drivers/usb/host/pci-quirks.c | 16 ++++++++++++++++ + drivers/usb/host/pci-quirks.h | 18 +++++++++++++++++- + include/linux/usb/hcd.h | 7 +++++++ + 3 files changed, 40 insertions(+), 1 deletion(-) + +--- a/drivers/usb/host/pci-quirks.c ++++ b/drivers/usb/host/pci-quirks.c +@@ -107,6 +107,8 @@ struct amd_chipset_type { + u8 rev; + }; + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + static struct amd_chipset_info { + struct pci_dev *nb_dev; + struct pci_dev *smbus_dev; +@@ -511,6 +513,10 @@ void usb_amd_dev_put(void) + } + EXPORT_SYMBOL_GPL(usb_amd_dev_put); + ++#endif /* CONFIG_PCI_DISABLE_COMMON_QUIRKS */ ++ ++#if IS_ENABLED(CONFIG_USB_UHCI_HCD) ++ + /* + * Make sure the controller is completely inactive, unable to + * generate interrupts or do DMA. +@@ -590,8 +596,17 @@ reset_needed: + uhci_reset_hc(pdev, base); + return 1; + } ++#else ++int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base) ++{ ++ return 0; ++} ++ ++#endif + EXPORT_SYMBOL_GPL(uhci_check_and_reset_hc); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS ++ + static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask) + { + u16 cmd; +@@ -1158,6 +1173,7 @@ static void quirk_usb_early_handoff(stru + } + DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, + PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff); ++#endif + + bool usb_xhci_needs_pci_reset(struct pci_dev *pdev) + { +--- a/drivers/usb/host/pci-quirks.h ++++ b/drivers/usb/host/pci-quirks.h +@@ -5,6 +5,9 @@ + #ifdef CONFIG_USB_PCI + void uhci_reset_hc(struct pci_dev *pdev, unsigned long base); + int uhci_check_and_reset_hc(struct pci_dev *pdev, unsigned long base); ++#endif /* CONFIG_USB_PCI */ ++ ++#if defined(CONFIG_USB_PCI) && !defined(CONFIG_PCI_DISABLE_COMMON_QUIRKS) + int usb_amd_find_chipset_info(void); + int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *pdev); + bool usb_amd_hang_symptom_quirk(void); +@@ -19,12 +22,25 @@ void sb800_prefetch(struct device *dev, + bool usb_xhci_needs_pci_reset(struct pci_dev *pdev); + #else + struct pci_dev; ++static inline int usb_amd_find_chipset_info(void) ++{ ++ return 0; ++} ++static inline bool usb_amd_hang_symptom_quirk(void) ++{ ++ return false; ++} ++static inline bool usb_amd_prefetch_quirk(void) ++{ ++ return false; ++} + static inline void usb_amd_quirk_pll_disable(void) {} + static inline void usb_amd_quirk_pll_enable(void) {} + static inline void usb_asmedia_modifyflowcontrol(struct pci_dev *pdev) {} + static inline void usb_amd_dev_put(void) {} + static inline void usb_disable_xhci_ports(struct pci_dev *xhci_pdev) {} + static inline void sb800_prefetch(struct device *dev, int on) {} ++static inline void usb_enable_intel_xhci_ports(struct pci_dev *xhci_pdev) {} + #endif /* CONFIG_USB_PCI */ + + #endif /* __LINUX_USB_PCI_QUIRKS_H */ +--- a/include/linux/usb/hcd.h ++++ b/include/linux/usb/hcd.h +@@ -465,7 +465,14 @@ extern int usb_hcd_pci_probe(struct pci_ + extern void usb_hcd_pci_remove(struct pci_dev *dev); + extern void usb_hcd_pci_shutdown(struct pci_dev *dev); + ++#ifndef CONFIG_PCI_DISABLE_COMMON_QUIRKS + extern int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev); ++#else ++static inline int usb_hcd_amd_remote_wakeup_quirk(struct pci_dev *dev) ++{ ++ return 0; ++} ++#endif + + #ifdef CONFIG_PM + extern const struct dev_pm_ops usb_hcd_pci_pm_ops; diff --git a/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch b/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch new file mode 100644 index 000000000..c14e67959 --- /dev/null +++ b/target/linux/generic/pending-4.14/821-usb-Remove-annoying-warning-about-bogus-URB.patch @@ -0,0 +1,76 @@ +From: Alexey Brodkin +Subject: usb: Remove annoying warning about bogus URB + +When ath9k-htc Wi-Fi dongle is used with generic OHCI controller +infinite stream of warnings appears in debug console like this: +-------------------------->8---------------------- +usb 1-1: new full-speed USB device number 2 using ohci-platform +usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested +usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: +51008 +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: + arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc2 ]--- +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: + arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc3 ]--- +------------[ cut here ]------------ +-------------------------->8---------------------- + +There're some discussions in mailing lists proposing to disable +that particular check alltogether and magically all seem to work +fine with muted warning. + +Anyways new thread on that regard could be found here: +http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html + +Let's see what comes out of that new discussion, hopefully patching +of generic USB stuff won't be required then. + +Signed-off-by: Alexey Brodkin +--- + drivers/usb/core/urb.c | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/usb/core/urb.c ++++ b/drivers/usb/core/urb.c +@@ -326,9 +326,6 @@ EXPORT_SYMBOL_GPL(usb_unanchor_urb); + */ + int usb_submit_urb(struct urb *urb, gfp_t mem_flags) + { +- static int pipetypes[4] = { +- PIPE_CONTROL, PIPE_ISOCHRONOUS, PIPE_BULK, PIPE_INTERRUPT +- }; + int xfertype, max; + struct usb_device *dev; + struct usb_host_endpoint *ep; +@@ -443,11 +440,6 @@ int usb_submit_urb(struct urb *urb, gfp_ + * cause problems in HCDs if they get it wrong. + */ + +- /* Check that the pipe's type matches the endpoint's type */ +- if (usb_pipetype(urb->pipe) != pipetypes[xfertype]) +- dev_WARN(&dev->dev, "BOGUS urb xfer, pipe %x != type %x\n", +- usb_pipetype(urb->pipe), pipetypes[xfertype]); +- + /* Check against a simple/standard policy */ + allowed = (URB_NO_TRANSFER_DMA_MAP | URB_NO_INTERRUPT | URB_DIR_MASK | + URB_FREE_BUFFER); diff --git a/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch b/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch new file mode 100644 index 000000000..a12e6dba9 --- /dev/null +++ b/target/linux/generic/pending-4.14/831-ledtrig_netdev.patch @@ -0,0 +1,74 @@ +From: Alexey Brodkin +Subject: usb: Remove annoying warning about bogus URB + +When ath9k-htc Wi-Fi dongle is used with generic OHCI controller +infinite stream of warnings appears in debug console like this: +-------------------------->8---------------------- +usb 1-1: new full-speed USB device number 2 using ohci-platform +usb 1-1: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested +usb 1-1: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: +51008 +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Not tainted +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: +arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc2 ]--- +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 19 at drivers/usb/core/urb.c:449 +usb_submit_urb+0x1b4/0x498() +usb 1-1: BOGUS urb xfer, pipe 1 != type 3 +Modules linked in: +CPU: 0 PID: 19 Comm: kworker/0:1 Tainted: G W +4.4.0-rc4-00017-g00e2d79-dirty #3 +Workqueue: events request_firmware_work_func + +Stack Trace: +arc_unwind_core.constprop.1+0xa4/0x110 +---[ end trace 649ef8c342817fc3 ]--- +------------[ cut here ]------------ +-------------------------->8---------------------- + +There're some discussions in mailing lists proposing to disable +that particular check alltogether and magically all seem to work +fine with muted warning. + +Anyways new thread on that regard could be found here: +http://lists.infradead.org/pipermail/linux-snps-arc/2016-July/001310.html + +Let's see what comes out of that new discussion, hopefully patching +of generic USB stuff won't be required then. + +Signed-off-by: Alexey Brodkin +--- + drivers/leds/Makefile | 1 + + drivers/leds/trigger/Kconfig | 7 +++++++ + 2 files changed, 8 insertions(+) + +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -82,3 +82,4 @@ obj-$(CONFIG_LEDS_USER) += uleds.o + + # LED Triggers + obj-$(CONFIG_LEDS_TRIGGERS) += trigger/ ++obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o +--- a/drivers/leds/trigger/Kconfig ++++ b/drivers/leds/trigger/Kconfig +@@ -126,4 +126,11 @@ config LEDS_TRIGGER_PANIC + a different trigger. + If unsure, say Y. + ++config LEDS_TRIGGER_NETDEV ++ tristate "LED Netdev Trigger" ++ depends on NET && LEDS_TRIGGERS ++ help ++ This allows LEDs to be controlled by network device activity. ++ If unsure, say Y. ++ + endif # LEDS_TRIGGERS diff --git a/target/linux/generic/pending-4.14/834-ledtrig-libata.patch b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch new file mode 100644 index 000000000..8597a936f --- /dev/null +++ b/target/linux/generic/pending-4.14/834-ledtrig-libata.patch @@ -0,0 +1,149 @@ +From: Daniel Golle +Subject: libata: add ledtrig support + +This adds a LED trigger for each ATA port indicating disk activity. + +As this is needed only on specific platforms (NAS SoCs and such), +these platforms should define ARCH_WANTS_LIBATA_LEDS if there +are boards with LED(s) intended to indicate ATA disk activity and +need the OS to take care of that. +In that way, if not selected, LED trigger support not will be +included in libata-core and both, codepaths and structures remain +untouched. + +Signed-off-by: Daniel Golle +--- + drivers/ata/Kconfig | 16 ++++++++++++++++ + drivers/ata/libata-core.c | 41 +++++++++++++++++++++++++++++++++++++++++ + include/linux/libata.h | 9 +++++++++ + 3 files changed, 66 insertions(+) + +--- a/drivers/ata/Kconfig ++++ b/drivers/ata/Kconfig +@@ -46,6 +46,22 @@ config ATA_VERBOSE_ERROR + + If unsure, say Y. + ++config ARCH_WANT_LIBATA_LEDS ++ bool ++ ++config ATA_LEDS ++ bool "support ATA port LED triggers" ++ depends on ARCH_WANT_LIBATA_LEDS ++ select NEW_LEDS ++ select LEDS_CLASS ++ select LEDS_TRIGGERS ++ default y ++ help ++ This option adds a LED trigger for each registered ATA port. ++ It is used to drive disk activity leds connected via GPIO. ++ ++ If unsure, say N. ++ + config ATA_ACPI + bool "ATA ACPI Support" + depends on ACPI +--- a/drivers/ata/libata-core.c ++++ b/drivers/ata/libata-core.c +@@ -731,6 +731,19 @@ u64 ata_tf_read_block(const struct ata_t + return block; + } + ++#ifdef CONFIG_ATA_LEDS ++#define LIBATA_BLINK_DELAY 20 /* ms */ ++static inline void ata_led_act(struct ata_port *ap) ++{ ++ unsigned long led_delay = LIBATA_BLINK_DELAY; ++ ++ if (unlikely(!ap->ledtrig)) ++ return; ++ ++ led_trigger_blink_oneshot(ap->ledtrig, &led_delay, &led_delay, 0); ++} ++#endif ++ + /** + * ata_build_rw_tf - Build ATA taskfile for given read/write request + * @tf: Target ATA taskfile +@@ -5089,6 +5102,9 @@ struct ata_queued_cmd *ata_qc_new_init(s + if (tag < 0) + return NULL; + } ++#ifdef CONFIG_ATA_LEDS ++ ata_led_act(ap); ++#endif + + qc = __ata_qc_from_tag(ap, tag); + qc->tag = tag; +@@ -5991,6 +6007,9 @@ struct ata_port *ata_port_alloc(struct a + ap->stats.unhandled_irq = 1; + ap->stats.idle_irq = 1; + #endif ++#ifdef CONFIG_ATA_LEDS ++ ap->ledtrig = kzalloc(sizeof(struct led_trigger), GFP_KERNEL); ++#endif + ata_sff_port_init(ap); + + return ap; +@@ -6012,6 +6031,12 @@ static void ata_host_release(struct devi + + kfree(ap->pmp_link); + kfree(ap->slave_link); ++#ifdef CONFIG_ATA_LEDS ++ if (ap->ledtrig) { ++ led_trigger_unregister(ap->ledtrig); ++ kfree(ap->ledtrig); ++ }; ++#endif + kfree(ap); + host->ports[i] = NULL; + } +@@ -6458,7 +6483,23 @@ int ata_host_register(struct ata_host *h + host->ports[i]->print_id = atomic_inc_return(&ata_print_id); + host->ports[i]->local_port_no = i + 1; + } ++#ifdef CONFIG_ATA_LEDS ++ for (i = 0; i < host->n_ports; i++) { ++ if (unlikely(!host->ports[i]->ledtrig)) ++ continue; + ++ snprintf(host->ports[i]->ledtrig_name, ++ sizeof(host->ports[i]->ledtrig_name), "ata%u", ++ host->ports[i]->print_id); ++ ++ host->ports[i]->ledtrig->name = host->ports[i]->ledtrig_name; ++ ++ if (led_trigger_register(host->ports[i]->ledtrig)) { ++ kfree(host->ports[i]->ledtrig); ++ host->ports[i]->ledtrig = NULL; ++ } ++ } ++#endif + /* Create associated sysfs transport objects */ + for (i = 0; i < host->n_ports; i++) { + rc = ata_tport_add(host->dev,host->ports[i]); +--- a/include/linux/libata.h ++++ b/include/linux/libata.h +@@ -38,6 +38,9 @@ + #include + #include + #include ++#ifdef CONFIG_ATA_LEDS ++#include ++#endif + + /* + * Define if arch has non-standard setup. This is a _PCI_ standard +@@ -889,6 +892,12 @@ struct ata_port { + #ifdef CONFIG_ATA_ACPI + struct ata_acpi_gtm __acpi_init_gtm; /* use ata_acpi_init_gtm() */ + #endif ++ ++#ifdef CONFIG_ATA_LEDS ++ struct led_trigger *ledtrig; ++ char ledtrig_name[8]; ++#endif ++ + /* owned by EH */ + u8 sector_buf[ATA_SECT_SIZE] ____cacheline_aligned; + }; diff --git a/target/linux/generic/pending-4.14/920-mangle_bootargs.patch b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch new file mode 100644 index 000000000..be89441d3 --- /dev/null +++ b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch @@ -0,0 +1,71 @@ +From: Imre Kaloz +Subject: init: add CONFIG_MANGLE_BOOTARGS and disable it by default + +Enabling this option renames the bootloader supplied root= +and rootfstype= variables, which might have to be know but +would break the automatisms OpenWrt uses. + +Signed-off-by: Imre Kaloz +--- + init/Kconfig | 9 +++++++++ + init/main.c | 24 ++++++++++++++++++++++++ + 2 files changed, 33 insertions(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1420,6 +1420,15 @@ config EMBEDDED + an embedded system so certain expert options are available + for configuration. + ++config MANGLE_BOOTARGS ++ bool "Rename offending bootargs" ++ depends on EXPERT ++ help ++ Sometimes the bootloader passed bogus root= and rootfstype= ++ parameters to the kernel, and while you want to ignore them, ++ you need to know the values f.e. to support dual firmware ++ layouts on the flash. ++ + config HAVE_PERF_EVENTS + bool + help +--- a/init/main.c ++++ b/init/main.c +@@ -359,6 +359,29 @@ static inline void setup_nr_cpu_ids(void + static inline void smp_prepare_cpus(unsigned int maxcpus) { } + #endif + ++#ifdef CONFIG_MANGLE_BOOTARGS ++static void __init mangle_bootargs(char *command_line) ++{ ++ char *rootdev; ++ char *rootfs; ++ ++ rootdev = strstr(command_line, "root=/dev/mtdblock"); ++ ++ if (rootdev) ++ strncpy(rootdev, "mangled_rootblock=", 18); ++ ++ rootfs = strstr(command_line, "rootfstype"); ++ ++ if (rootfs) ++ strncpy(rootfs, "mangled_fs", 10); ++ ++} ++#else ++static void __init mangle_bootargs(char *command_line) ++{ ++} ++#endif ++ + /* + * We need to store the untouched command line for future reference. + * We also need to store the touched command line since the parameter +@@ -536,6 +559,7 @@ asmlinkage __visible void __init start_k + add_device_randomness(command_line, strlen(command_line)); + boot_init_stack_canary(); + mm_init_cpumask(&init_mm); ++ mangle_bootargs(command_line); + setup_command_line(command_line); + setup_nr_cpu_ids(); + setup_per_cpu_areas(); From 298ec483cb6c703c0a82cafa375c63357dabab8f Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 19 Dec 2017 13:14:19 +0800 Subject: [PATCH 40/95] x86: Add support for kernel 4.14 --- 0027-x86-Add-support-for-kernel-4.14.patch | 1233 +++++++++++++++++ target/linux/x86/64/config-default | 69 +- target/linux/x86/config-4.14 | 525 +++++++ target/linux/x86/generic/config-default | 67 +- target/linux/x86/geode/config-default | 7 +- target/linux/x86/legacy/config-default | 30 +- .../patches-4.14/011-tune_lzma_options.patch | 22 + .../100-fix_cs5535_clockevt.patch | 12 + .../200-pcengines-apu2-reboot.patch | 19 + ...0-hwmon-w83627ehf-dont-claim-nct677x.patch | 30 + 10 files changed, 1980 insertions(+), 34 deletions(-) create mode 100644 0027-x86-Add-support-for-kernel-4.14.patch create mode 100644 target/linux/x86/config-4.14 create mode 100644 target/linux/x86/patches-4.14/011-tune_lzma_options.patch create mode 100644 target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch create mode 100644 target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch create mode 100644 target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch diff --git a/0027-x86-Add-support-for-kernel-4.14.patch b/0027-x86-Add-support-for-kernel-4.14.patch new file mode 100644 index 000000000..be38619e5 --- /dev/null +++ b/0027-x86-Add-support-for-kernel-4.14.patch @@ -0,0 +1,1233 @@ +From 481e1f23f5a178f44f6cf89e761ab51d1fc8d6ed Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 29 Oct 2017 19:34:13 +0100 +Subject: [PATCH 27/37] x86: Add support for kernel 4.14 + +This adds basic support for kernel 4.14, this was tested in qemu only. +The subtarget configuration was refresh with kernel 4.14 and the +options needed to make it compile on kernel 4.9 were added manually. + +Signed-off-by: Hauke Mehrtens +--- + target/linux/x86/64/config-default | 36 +- + target/linux/x86/config-4.14 | 525 +++++++++++++++++++++ + target/linux/x86/generic/config-default | 45 +- + target/linux/x86/geode/config-default | 7 +- + target/linux/x86/legacy/config-default | 30 +- + .../x86/patches-4.14/011-tune_lzma_options.patch | 22 + + .../x86/patches-4.14/100-fix_cs5535_clockevt.patch | 12 + + .../patches-4.14/200-pcengines-apu2-reboot.patch | 19 + + .../800-hwmon-w83627ehf-dont-claim-nct677x.patch | 30 ++ + 9 files changed, 710 insertions(+), 16 deletions(-) + create mode 100644 target/linux/x86/config-4.14 + create mode 100644 target/linux/x86/patches-4.14/011-tune_lzma_options.patch + create mode 100644 target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch + create mode 100644 target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch + create mode 100644 target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch + +diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default +index b6fee8b..55b69ce 100644 +--- a/target/linux/x86/64/config-default ++++ b/target/linux/x86/64/config-default +@@ -6,6 +6,7 @@ CONFIG_ACPI_BATTERY=y + CONFIG_ACPI_BUTTON=y + # CONFIG_ACPI_CMPC is not set + CONFIG_ACPI_CONTAINER=y ++CONFIG_ACPI_CPPC_LIB=y + CONFIG_ACPI_CPU_FREQ_PSS=y + # CONFIG_ACPI_CUSTOM_DSDT is not set + # CONFIG_ACPI_DEBUG is not set +@@ -30,9 +31,11 @@ CONFIG_ACPI_THERMAL=y + # CONFIG_ACPI_WMI is not set + CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" + CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y +-CONFIG_ARCH_HAS_GIGANTIC_PAGE=y ++CONFIG_ARCH_HAS_ADD_PAGES=y + CONFIG_ARCH_HAS_KCOV=y + CONFIG_ARCH_HAS_PMEM_API=y ++CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y ++CONFIG_ARCH_HAS_ZONE_DEVICE=y + CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y + CONFIG_ARCH_MMAP_RND_BITS=28 + CONFIG_ARCH_MMAP_RND_BITS_MAX=32 +@@ -41,12 +44,13 @@ CONFIG_ARCH_SPARSEMEM_DEFAULT=y + CONFIG_ARCH_SUPPORTS_INT128=y + CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y + CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +-CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y ++CONFIG_ARCH_WANTS_THP_SWAP=y + CONFIG_AUDIT_ARCH=y + CONFIG_BACKLIGHT_CLASS_DEVICE=y + CONFIG_BACKLIGHT_GENERIC=y + CONFIG_BACKLIGHT_LCD_SUPPORT=y + CONFIG_BLK_DEV_INTEGRITY=y ++CONFIG_BLK_MQ_VIRTIO=y + # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set + CONFIG_CALGARY_IOMMU=y + CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y +@@ -54,7 +58,6 @@ CONFIG_CONNECTOR=y + # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set + CONFIG_CPU_RMAP=y + CONFIG_CRC_T10DIF=y +-CONFIG_CRYPTO_ABLK_HELPER=y + CONFIG_CRYPTO_AEAD=y + CONFIG_CRYPTO_AEAD2=y + CONFIG_CRYPTO_AES_NI_INTEL=y +@@ -88,6 +91,7 @@ CONFIG_CRYPTO_NULL2=y + # CONFIG_CRYPTO_SHA256_SSSE3 is not set + # CONFIG_CRYPTO_SHA512_MB is not set + # CONFIG_CRYPTO_SHA512_SSSE3 is not set ++CONFIG_CRYPTO_SIMD=y + # CONFIG_CRYPTO_SKEIN is not set + # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set + # CONFIG_CRYPTO_TWOFISH_X86_64 is not set +@@ -100,6 +104,7 @@ CONFIG_EFI=y + CONFIG_EFIVAR_FS=m + # CONFIG_EFI_BOOTLOADER_CONTROL is not set + # CONFIG_EFI_CAPSULE_LOADER is not set ++# CONFIG_EFI_DEV_PATH_PARSER is not set + CONFIG_EFI_ESRT=y + # CONFIG_EFI_FAKE_MEMMAP is not set + # CONFIG_EFI_MIXED is not set +@@ -118,6 +123,7 @@ CONFIG_FB_DEFERRED_IO=y + CONFIG_FB_EFI=y + CONFIG_FB_HYPERV=y + CONFIG_FB_MODE_HELPERS=y ++# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set + CONFIG_FB_SIMPLE=y + CONFIG_FB_SYS_COPYAREA=y + CONFIG_FB_SYS_FILLRECT=y +@@ -136,6 +142,8 @@ CONFIG_FREEZER=y + CONFIG_GART_IOMMU=y + CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y + CONFIG_GENERIC_CPU=y ++CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y ++CONFIG_GENERIC_IRQ_MIGRATION=y + CONFIG_GENERIC_PENDING_IRQ=y + CONFIG_GPIOLIB=y + CONFIG_GPIOLIB_IRQCHIP=y +@@ -145,10 +153,12 @@ CONFIG_GPIO_IT87=y + CONFIG_GPIO_LYNXPOINT=y + CONFIG_GPIO_SCH=y + CONFIG_GPIO_SYSFS=y ++CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y + CONFIG_HAVE_ACPI_APEI=y + CONFIG_HAVE_ACPI_APEI_NMI=y + # CONFIG_HAVE_AOUT is not set + CONFIG_HAVE_ARCH_SOFT_DIRTY=y ++CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y + CONFIG_HAVE_ARCH_VMAP_STACK=y + CONFIG_HAVE_CONTEXT_TRACKING=y + CONFIG_HAVE_EBPF_JIT=y +@@ -188,7 +198,9 @@ CONFIG_HYPERV_BALLOON=y + CONFIG_HYPERV_KEYBOARD=y + CONFIG_HYPERV_NET=y + CONFIG_HYPERV_STORAGE=y ++CONFIG_HYPERV_TSCPAGE=y + CONFIG_HYPERV_UTILS=y ++# CONFIG_HYPERV_VSOCKETS is not set + CONFIG_I2C=y + CONFIG_I2C_BOARDINFO=y + # CONFIG_I7300_IDLE is not set +@@ -196,6 +208,7 @@ CONFIG_I2C_BOARDINFO=y + CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 + CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y + CONFIG_INTEL_IDLE=y ++# CONFIG_INTEL_INT0002_VGPIO is not set + # CONFIG_INTEL_IPS is not set + # CONFIG_INTEL_MENLOW is not set + # CONFIG_INTEL_MIC_BUS is not set +@@ -203,6 +216,7 @@ CONFIG_INTEL_PCH_THERMAL=y + # CONFIG_INTEL_PMC_IPC is not set + CONFIG_INTEL_SOC_DTS_IOSF_CORE=y + CONFIG_INTEL_SOC_DTS_THERMAL=y ++# CONFIG_INTEL_TURBO_MAX_3 is not set + # CONFIG_IOMMU_DEBUG is not set + CONFIG_IOSF_MBI=y + # CONFIG_IOSF_MBI_DEBUG is not set +@@ -218,6 +232,7 @@ CONFIG_LEGACY_VSYSCALL_NONE=y + CONFIG_LOCK_SPIN_ON_OWNER=y + CONFIG_LPC_ICH=y + CONFIG_LPC_SCH=y ++CONFIG_MAILBOX=y + # CONFIG_MAXSMP is not set + CONFIG_MEMORY_BALLOON=y + # CONFIG_MEMORY_HOTPLUG is not set +@@ -238,6 +253,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y + CONFIG_NET_FLOW_LIMIT=y + CONFIG_NR_CPUS=8 + # CONFIG_NUMA is not set ++# CONFIG_ORC_UNWINDER is not set + CONFIG_OUTPUT_FORMAT="elf64-x86-64" + CONFIG_PADATA=y + CONFIG_PARAVIRT=y +@@ -250,6 +266,7 @@ CONFIG_PATA_MPIIX=y + CONFIG_PATA_OLDPIIX=y + CONFIG_PATA_PLATFORM=y + CONFIG_PATA_VIA=y ++CONFIG_PCC=y + CONFIG_PCIEAER=y + CONFIG_PCIEPORTBUS=y + CONFIG_PCIE_PME=y +@@ -260,6 +277,7 @@ CONFIG_PGTABLE_LEVELS=4 + CONFIG_PHYSICAL_ALIGN=0x1000000 + CONFIG_PM=y + # CONFIG_PMIC_OPREGION is not set ++CONFIG_PM_CLK=y + # CONFIG_PM_DEBUG is not set + CONFIG_PM_SLEEP=y + CONFIG_PM_SLEEP_SMP=y +@@ -272,10 +290,12 @@ CONFIG_QUEUED_RWLOCKS=y + CONFIG_QUEUED_SPINLOCKS=y + # CONFIG_RANDOMIZE_BASE is not set + CONFIG_RAS=y ++CONFIG_RCU_NEED_SEGCBLIST=y + CONFIG_RCU_STALL_COMMON=y + CONFIG_REGMAP=y + CONFIG_REGMAP_I2C=y + CONFIG_RELOCATABLE=y ++CONFIG_RESET_ATTACK_MITIGATION=y + CONFIG_RFS_ACCEL=y + CONFIG_RPS=y + CONFIG_RTC_I2C_AND_SPI=y +@@ -283,6 +303,7 @@ CONFIG_RWSEM_SPIN_ON_OWNER=y + # CONFIG_SAMSUNG_Q10 is not set + CONFIG_SATA_AHCI=y + CONFIG_SCHED_MC=y ++CONFIG_SCHED_MC_PRIO=y + CONFIG_SCHED_SMT=y + # CONFIG_SCIF_BUS is not set + CONFIG_SCSI_VIRTIO=y +@@ -308,8 +329,8 @@ CONFIG_THERMAL_HWMON=y + CONFIG_THERMAL_WRITABLE_TRIPS=y + # CONFIG_TOSHIBA_BT_RFKILL is not set + CONFIG_TREE_RCU=y ++CONFIG_TREE_SRCU=y + CONFIG_UCS2_STRING=y +-CONFIG_UCSI=y + # CONFIG_UNISYSSPAR is not set + CONFIG_USB_OHCI_HCD_PCI=y + CONFIG_USB_STORAGE=y +@@ -317,6 +338,7 @@ CONFIG_USB_XHCI_HCD=y + CONFIG_USB_XHCI_PCI=y + # CONFIG_USB_XHCI_PLATFORM is not set + CONFIG_VGACON_SOFT_SCROLLBACK=y ++# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set + CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 + CONFIG_VIRTIO=y + CONFIG_VIRTIO_BALLOON=y +@@ -339,6 +361,7 @@ CONFIG_VMXNET3=y + CONFIG_VSOCKETS=y + CONFIG_VT_CONSOLE_SLEEP=y + CONFIG_WATCHDOG_CORE=y ++# CONFIG_X86_5LEVEL is not set + CONFIG_X86_64=y + CONFIG_X86_64_SMP=y + CONFIG_X86_ACPI_CPUFREQ=y +@@ -352,6 +375,8 @@ CONFIG_X86_DEV_DMA_OPS=y + CONFIG_X86_DIRECT_GBPAGES=y + # CONFIG_X86_INTEL_LPSS is not set + # CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set ++# CONFIG_X86_INTEL_MPX is not set ++CONFIG_X86_INTEL_PSTATE=y + CONFIG_X86_MINIMUM_CPU_FAMILY=64 + # CONFIG_X86_PCC_CPUFREQ is not set + CONFIG_X86_PKG_TEMP_THERMAL=y +@@ -384,8 +409,11 @@ CONFIG_XEN_HAVE_VPMU=y + CONFIG_XEN_NETDEV_FRONTEND=y + CONFIG_XEN_PCIDEV_FRONTEND=y + CONFIG_XEN_PRIVCMD=y ++CONFIG_XEN_PV=y + CONFIG_XEN_PVH=y + CONFIG_XEN_PVHVM=y ++CONFIG_XEN_PVHVM_SMP=y ++CONFIG_XEN_PV_SMP=y + CONFIG_XEN_SAVE_RESTORE=y + CONFIG_XEN_SCRUB_PAGES=y + CONFIG_XEN_SCSI_FRONTEND=y +diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 +new file mode 100644 +index 0000000..05af598 +--- /dev/null ++++ b/target/linux/x86/config-4.14 +@@ -0,0 +1,525 @@ ++# CONFIG_60XX_WDT is not set ++# CONFIG_64BIT is not set ++# CONFIG_ACPI is not set ++# CONFIG_ACQUIRE_WDT is not set ++# CONFIG_ADVANTECH_WDT is not set ++# CONFIG_ALIM1535_WDT is not set ++# CONFIG_ALIX is not set ++CONFIG_AMD_NB=y ++CONFIG_ARCH_CLOCKSOURCE_DATA=y ++CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" ++CONFIG_ARCH_DISCARD_MEMBLOCK=y ++CONFIG_ARCH_DMA_ADDR_T_64BIT=y ++CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y ++CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y ++CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y ++CONFIG_ARCH_HAS_CPU_RELAX=y ++CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y ++CONFIG_ARCH_HAS_ELF_RANDOMIZE=y ++CONFIG_ARCH_HAS_FAST_MULTIPLIER=y ++CONFIG_ARCH_HAS_FORTIFY_SOURCE=y ++CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y ++CONFIG_ARCH_HAS_MEM_ENCRYPT=y ++CONFIG_ARCH_HAS_SET_MEMORY=y ++CONFIG_ARCH_HAS_SG_CHAIN=y ++CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y ++CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y ++CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y ++CONFIG_ARCH_HIBERNATION_POSSIBLE=y ++CONFIG_ARCH_MAY_HAVE_PC_FDC=y ++CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y ++CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y ++# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set ++# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set ++CONFIG_ARCH_PHYS_ADDR_T_64BIT=y ++CONFIG_ARCH_RANDOM=y ++CONFIG_ARCH_SELECT_MEMORY_MODEL=y ++CONFIG_ARCH_SPARSEMEM_ENABLE=y ++CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y ++CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y ++CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y ++CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y ++CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y ++CONFIG_ARCH_SUPPORTS_UPROBES=y ++CONFIG_ARCH_SUSPEND_POSSIBLE=y ++CONFIG_ARCH_USES_PG_UNCACHED=y ++CONFIG_ARCH_USE_BUILTIN_BSWAP=y ++CONFIG_ARCH_USE_QUEUED_RWLOCKS=y ++CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y ++CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y ++# CONFIG_ARCH_WANTS_THP_SWAP is not set ++CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y ++CONFIG_ARCH_WANT_GENERAL_HUGETLB=y ++CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y ++CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y ++CONFIG_ATA=y ++CONFIG_ATA_GENERIC=y ++CONFIG_ATA_PIIX=y ++CONFIG_BINFMT_MISC=y ++CONFIG_BLK_DEV_LOOP=y ++CONFIG_BLK_DEV_SD=y ++CONFIG_BLK_MQ_PCI=y ++CONFIG_BLK_SCSI_REQUEST=y ++CONFIG_BOUNCE=y ++CONFIG_BTT=y ++CONFIG_CLKBLD_I8253=y ++CONFIG_CLKDEV_LOOKUP=y ++CONFIG_CLKEVT_I8253=y ++CONFIG_CLKSRC_I8253=y ++CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y ++CONFIG_CLOCKSOURCE_WATCHDOG=y ++CONFIG_CLONE_BACKWARDS=y ++CONFIG_COMMON_CLK=y ++CONFIG_COMPAT_32=y ++# CONFIG_COMPAT_VDSO is not set ++CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 ++CONFIG_CONSOLE_TRANSLATIONS=y ++# CONFIG_CPU5_WDT is not set ++CONFIG_CPU_FREQ=y ++CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y ++# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set ++CONFIG_CPU_FREQ_GOV_ATTR_SET=y ++CONFIG_CPU_FREQ_GOV_COMMON=y ++# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set ++CONFIG_CPU_FREQ_GOV_ONDEMAND=y ++CONFIG_CPU_FREQ_GOV_PERFORMANCE=y ++# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set ++# CONFIG_CPU_FREQ_GOV_USERSPACE is not set ++CONFIG_CPU_FREQ_STAT=y ++CONFIG_CPU_IDLE=y ++CONFIG_CPU_IDLE_GOV_LADDER=y ++CONFIG_CPU_SUP_AMD=y ++CONFIG_CPU_SUP_CENTAUR=y ++CONFIG_CPU_SUP_CYRIX_32=y ++CONFIG_CPU_SUP_INTEL=y ++CONFIG_CPU_SUP_TRANSMETA_32=y ++CONFIG_CPU_SUP_UMC_32=y ++# CONFIG_CRASHLOG is not set ++CONFIG_CRASH_CORE=y ++CONFIG_CRC16=y ++CONFIG_CRYPTO_AES_586=y ++CONFIG_CRYPTO_CRC32=y ++CONFIG_CRYPTO_CRC32C=y ++# CONFIG_CRYPTO_CRC32_PCLMUL is not set ++CONFIG_CRYPTO_HASH=y ++CONFIG_CRYPTO_HASH2=y ++CONFIG_CRYPTO_RNG2=y ++# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set ++CONFIG_CRYPTO_WORKQUEUE=y ++# CONFIG_CX_ECAT is not set ++CONFIG_DCACHE_WORD_ACCESS=y ++# CONFIG_DCDBAS is not set ++# CONFIG_DEBUG_BOOT_PARAMS is not set ++# CONFIG_DEBUG_ENTRY is not set ++CONFIG_DEBUG_MEMORY_INIT=y ++# CONFIG_DEBUG_NMI_SELFTEST is not set ++# CONFIG_DEBUG_TLBFLUSH is not set ++# CONFIG_DEBUG_VIRTUAL is not set ++CONFIG_DECOMPRESS_BZIP2=y ++CONFIG_DECOMPRESS_GZIP=y ++CONFIG_DEFAULT_IO_DELAY_TYPE=0 ++# CONFIG_DELL_RBU is not set ++# CONFIG_DMA_NOOP_OPS is not set ++# CONFIG_DMA_VIRT_OPS is not set ++CONFIG_DMI=y ++CONFIG_DMIID=y ++CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y ++CONFIG_DMI_SYSFS=y ++CONFIG_DNOTIFY=y ++# CONFIG_DRM_LIB_RANDOM is not set ++CONFIG_DUMMY_CONSOLE=y ++CONFIG_EARLY_PRINTK=y ++# CONFIG_EARLY_PRINTK_DBGP is not set ++CONFIG_EDAC_ATOMIC_SCRUB=y ++CONFIG_EDAC_SUPPORT=y ++# CONFIG_EDD is not set ++# CONFIG_EUROTECH_WDT is not set ++CONFIG_EXPORTFS=y ++CONFIG_EXT4_FS=y ++# CONFIG_F2FS_CHECK_FS is not set ++CONFIG_F2FS_FS=y ++# CONFIG_F2FS_FS_SECURITY is not set ++CONFIG_F2FS_FS_XATTR=y ++CONFIG_F2FS_STAT_FS=y ++# CONFIG_F71808E_WDT is not set ++CONFIG_FIRMWARE_IN_KERNEL=y ++CONFIG_FIRMWARE_MEMMAP=y ++CONFIG_FIX_EARLYCON_MEM=y ++CONFIG_FRAME_POINTER=y ++CONFIG_FRAME_POINTER_UNWINDER=y ++CONFIG_FS_MBCACHE=y ++CONFIG_FUSION=y ++# CONFIG_FUSION_CTL is not set ++# CONFIG_FUSION_LOGGING is not set ++CONFIG_FUSION_MAX_SGE=128 ++CONFIG_FUSION_SPI=y ++CONFIG_FUTEX_PI=y ++CONFIG_GENERIC_ALLOCATOR=y ++CONFIG_GENERIC_BUG=y ++CONFIG_GENERIC_CLOCKEVENTS=y ++CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y ++CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y ++CONFIG_GENERIC_CMOS_UPDATE=y ++CONFIG_GENERIC_CPU_AUTOPROBE=y ++CONFIG_GENERIC_EARLY_IOREMAP=y ++CONFIG_GENERIC_FIND_FIRST_BIT=y ++CONFIG_GENERIC_IO=y ++CONFIG_GENERIC_IOMAP=y ++CONFIG_GENERIC_IRQ_SHOW=y ++CONFIG_GENERIC_ISA_DMA=y ++CONFIG_GENERIC_MSI_IRQ=y ++CONFIG_GENERIC_MSI_IRQ_DOMAIN=y ++CONFIG_GENERIC_PCI_IOMAP=y ++CONFIG_GENERIC_SMP_IDLE_THREAD=y ++CONFIG_GENERIC_STRNCPY_FROM_USER=y ++CONFIG_GENERIC_STRNLEN_USER=y ++CONFIG_GENERIC_TIME_VSYSCALL=y ++# CONFIG_GEOS is not set ++CONFIG_GLOB=y ++# CONFIG_GRO_CELLS is not set ++# CONFIG_GUESS_UNWINDER is not set ++# CONFIG_HANGCHECK_TIMER is not set ++CONFIG_HAS_DMA=y ++CONFIG_HAS_IOMEM=y ++CONFIG_HAS_IOPORT_MAP=y ++# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set ++CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y ++CONFIG_HAVE_AOUT=y ++CONFIG_HAVE_ARCH_AUDITSYSCALL=y ++# CONFIG_HAVE_ARCH_BITREVERSE is not set ++CONFIG_HAVE_ARCH_HUGE_VMAP=y ++CONFIG_HAVE_ARCH_JUMP_LABEL=y ++CONFIG_HAVE_ARCH_KGDB=y ++CONFIG_HAVE_ARCH_KMEMCHECK=y ++CONFIG_HAVE_ARCH_SECCOMP_FILTER=y ++CONFIG_HAVE_ARCH_TRACEHOOK=y ++CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y ++CONFIG_HAVE_ATOMIC_IOMAP=y ++# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set ++CONFIG_HAVE_CC_STACKPROTECTOR=y ++CONFIG_HAVE_CLK=y ++CONFIG_HAVE_CLK_PREPARE=y ++CONFIG_HAVE_CMPXCHG_DOUBLE=y ++CONFIG_HAVE_CMPXCHG_LOCAL=y ++CONFIG_HAVE_COPY_THREAD_TLS=y ++CONFIG_HAVE_C_RECORDMCOUNT=y ++CONFIG_HAVE_DEBUG_KMEMLEAK=y ++CONFIG_HAVE_DEBUG_STACKOVERFLOW=y ++CONFIG_HAVE_DMA_API_DEBUG=y ++CONFIG_HAVE_DMA_CONTIGUOUS=y ++CONFIG_HAVE_DYNAMIC_FTRACE=y ++CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y ++CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y ++CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y ++CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y ++CONFIG_HAVE_FUNCTION_TRACER=y ++CONFIG_HAVE_GENERIC_DMA_COHERENT=y ++CONFIG_HAVE_GENERIC_GUP=y ++CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y ++CONFIG_HAVE_HW_BREAKPOINT=y ++CONFIG_HAVE_IDE=y ++CONFIG_HAVE_IOREMAP_PROT=y ++CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y ++CONFIG_HAVE_KPROBES_ON_FTRACE=y ++CONFIG_HAVE_KVM=y ++CONFIG_HAVE_MEMBLOCK=y ++CONFIG_HAVE_MEMBLOCK_NODE_MAP=y ++CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y ++CONFIG_HAVE_MMIOTRACE_SUPPORT=y ++CONFIG_HAVE_MOD_ARCH_SPECIFIC=y ++CONFIG_HAVE_NET_DSA=y ++CONFIG_HAVE_OPROFILE=y ++CONFIG_HAVE_OPTPROBES=y ++CONFIG_HAVE_PCSPKR_PLATFORM=y ++CONFIG_HAVE_PERF_EVENTS=y ++CONFIG_HAVE_PERF_EVENTS_NMI=y ++CONFIG_HAVE_PERF_REGS=y ++CONFIG_HAVE_PERF_USER_STACK_DUMP=y ++CONFIG_HAVE_RCU_TABLE_FREE=y ++CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y ++CONFIG_HAVE_SETUP_PER_CPU_AREA=y ++CONFIG_HAVE_SYSCALL_TRACEPOINTS=y ++CONFIG_HAVE_UID16=y ++CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y ++CONFIG_HAVE_USER_RETURN_NOTIFIER=y ++CONFIG_HID=y ++CONFIG_HIGHMEM=y ++# CONFIG_HIGHMEM4G is not set ++CONFIG_HIGHMEM64G=y ++# CONFIG_HIGHPTE is not set ++CONFIG_HPET_EMULATE_RTC=y ++CONFIG_HPET_TIMER=y ++# CONFIG_HP_WATCHDOG is not set ++CONFIG_HT_IRQ=y ++# CONFIG_HUGETLBFS is not set ++CONFIG_HW_CONSOLE=y ++CONFIG_HW_RANDOM=y ++CONFIG_HW_RANDOM_GEODE=y ++CONFIG_HW_RANDOM_VIA=y ++# CONFIG_HYPERVISOR_GUEST is not set ++CONFIG_HZ_PERIODIC=y ++CONFIG_I8253_LOCK=y ++# CONFIG_I8K is not set ++# CONFIG_IB700_WDT is not set ++# CONFIG_IBMASR is not set ++# CONFIG_IBM_RTL is not set ++# CONFIG_IE6XX_WDT is not set ++CONFIG_ILLEGAL_POINTER_VALUE=0 ++CONFIG_INITRAMFS_SOURCE="" ++CONFIG_INPUT=y ++CONFIG_INPUT_KEYBOARD=y ++CONFIG_INSTRUCTION_DECODER=y ++# CONFIG_INTEL_PCH_THERMAL is not set ++# CONFIG_INTEL_POWERCLAMP is not set ++# CONFIG_INTEL_RDT is not set ++# CONFIG_INTEL_SOC_DTS_THERMAL is not set ++CONFIG_IOMMU_HELPER=y ++# CONFIG_IOMMU_STRESS is not set ++# CONFIG_IOSF_MBI is not set ++CONFIG_IO_DELAY_0X80=y ++# CONFIG_IO_DELAY_0XED is not set ++# CONFIG_IO_DELAY_NONE is not set ++CONFIG_IO_DELAY_TYPE_0X80=0 ++CONFIG_IO_DELAY_TYPE_0XED=1 ++CONFIG_IO_DELAY_TYPE_NONE=3 ++CONFIG_IO_DELAY_TYPE_UDELAY=2 ++# CONFIG_IO_DELAY_UDELAY is not set ++CONFIG_IRQ_DOMAIN=y ++CONFIG_IRQ_DOMAIN_HIERARCHY=y ++CONFIG_IRQ_FORCED_THREADING=y ++CONFIG_IRQ_WORK=y ++# CONFIG_ISA is not set ++CONFIG_ISA_DMA_API=y ++# CONFIG_IT8712F_WDT is not set ++# CONFIG_IT87_WDT is not set ++# CONFIG_ITCO_WDT is not set ++CONFIG_JBD2=y ++CONFIG_KALLSYMS=y ++CONFIG_KEXEC=y ++CONFIG_KEXEC_CORE=y ++CONFIG_KEYBOARD_ATKBD=y ++# CONFIG_LEDS_CLEVO_MAIL is not set ++CONFIG_LIBNVDIMM=y ++# CONFIG_M486 is not set ++# CONFIG_M586 is not set ++CONFIG_M586MMX=y ++# CONFIG_M586TSC is not set ++# CONFIG_M686 is not set ++# CONFIG_MACHZ_WDT is not set ++# CONFIG_MATOM is not set ++# CONFIG_MCORE2 is not set ++# CONFIG_MCRUSOE is not set ++# CONFIG_MCYRIXIII is not set ++# CONFIG_MDIO_BUS is not set ++# CONFIG_MEFFICEON is not set ++# CONFIG_MELAN is not set ++# CONFIG_MFD_INTEL_LPSS_PCI is not set ++# CONFIG_MGEODEGX1 is not set ++# CONFIG_MGEODE_LX is not set ++# CONFIG_MICROCODE is not set ++# CONFIG_MK6 is not set ++# CONFIG_MK7 is not set ++# CONFIG_MK8 is not set ++# CONFIG_MODIFY_LDT_SYSCALL is not set ++CONFIG_MODULES_TREE_LOOKUP=y ++CONFIG_MODULES_USE_ELF_REL=y ++# CONFIG_MPENTIUM4 is not set ++# CONFIG_MPENTIUMII is not set ++# CONFIG_MPENTIUMIII is not set ++# CONFIG_MPENTIUMM is not set ++# CONFIG_MTD is not set ++CONFIG_MTRR=y ++# CONFIG_MTRR_SANITIZER is not set ++# CONFIG_MVIAC3_2 is not set ++# CONFIG_MVIAC7 is not set ++# CONFIG_MWINCHIP3D is not set ++# CONFIG_MWINCHIPC6 is not set ++CONFIG_NAMESPACES=y ++CONFIG_ND_BLK=y ++CONFIG_ND_BTT=y ++CONFIG_ND_CLAIM=y ++CONFIG_NEED_DMA_MAP_STATE=y ++CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y ++CONFIG_NEED_PER_CPU_KM=y ++CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y ++CONFIG_NEED_SG_DMA_LENGTH=y ++# CONFIG_NET5501 is not set ++# CONFIG_NET_NS is not set ++CONFIG_NLS=y ++# CONFIG_NOHIGHMEM is not set ++CONFIG_NO_BOOTMEM=y ++CONFIG_NR_CPUS=1 ++# CONFIG_NSC_GPIO is not set ++CONFIG_NVRAM=y ++# CONFIG_OF is not set ++CONFIG_OLD_SIGACTION=y ++CONFIG_OLD_SIGSUSPEND3=y ++CONFIG_OPROFILE_NMI_TIMER=y ++# CONFIG_OPTIMIZE_INLINING is not set ++CONFIG_OUTPUT_FORMAT="elf32-i386" ++CONFIG_PAGE_OFFSET=0xC0000000 ++CONFIG_PC104=y ++# CONFIG_PC8736x_GPIO is not set ++# CONFIG_PC87413_WDT is not set ++CONFIG_PCI=y ++CONFIG_PCI_BIOS=y ++CONFIG_PCI_BUS_ADDR_T_64BIT=y ++CONFIG_PCI_DIRECT=y ++CONFIG_PCI_DOMAINS=y ++CONFIG_PCI_GOANY=y ++# CONFIG_PCI_GOBIOS is not set ++# CONFIG_PCI_GODIRECT is not set ++# CONFIG_PCI_GOMMCONFIG is not set ++CONFIG_PCI_LABEL=y ++CONFIG_PCI_LOCKLESS_CONFIG=y ++CONFIG_PCI_MSI=y ++CONFIG_PCI_MSI_IRQ_DOMAIN=y ++CONFIG_PCSPKR_PLATFORM=y ++CONFIG_PERF_EVENTS=y ++CONFIG_PERF_EVENTS_INTEL_CSTATE=y ++CONFIG_PERF_EVENTS_INTEL_RAPL=y ++CONFIG_PERF_EVENTS_INTEL_UNCORE=y ++CONFIG_PGTABLE_LEVELS=3 ++CONFIG_PHYSICAL_ALIGN=0x100000 ++CONFIG_PHYSICAL_START=0x1000000 ++CONFIG_PHYS_ADDR_T_64BIT=y ++CONFIG_PMC_ATOM=y ++CONFIG_POWER_SUPPLY=y ++CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 ++# CONFIG_PROCESSOR_SELECT is not set ++CONFIG_PROC_PAGE_MONITOR=y ++# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set ++# CONFIG_PUNIT_ATOM_DEBUG is not set ++CONFIG_RATIONAL=y ++# CONFIG_RCU_NEED_SEGCBLIST is not set ++# CONFIG_RCU_STALL_COMMON is not set ++CONFIG_RD_BZIP2=y ++CONFIG_RD_GZIP=y ++CONFIG_RTC_CLASS=y ++CONFIG_RTC_MC146818_LIB=y ++CONFIG_RWSEM_XCHGADD_ALGORITHM=y ++# CONFIG_SBC7240_WDT is not set ++# CONFIG_SBC8360_WDT is not set ++# CONFIG_SBC_EPX_C3_WATCHDOG is not set ++# CONFIG_SC1200_WDT is not set ++# CONFIG_SCHED_INFO is not set ++CONFIG_SCSI=y ++CONFIG_SCSI_SPI_ATTRS=y ++CONFIG_SCx200=y ++CONFIG_SCx200HR_TIMER=y ++# CONFIG_SCx200_GPIO is not set ++# CONFIG_SCx200_WDT is not set ++# CONFIG_SERIAL_8250_FSL is not set ++CONFIG_SERIAL_8250_PCI=y ++CONFIG_SERIO=y ++CONFIG_SERIO_I8042=y ++CONFIG_SERIO_LIBPS2=y ++CONFIG_SERIO_SERPORT=y ++CONFIG_SG_POOL=y ++# CONFIG_SMSC37B787_WDT is not set ++# CONFIG_SMSC_SCH311X_WDT is not set ++CONFIG_SPARSEMEM_STATIC=y ++CONFIG_SPARSE_IRQ=y ++CONFIG_SRCU=y ++CONFIG_STRICT_KERNEL_RWX=y ++CONFIG_STRICT_MODULE_RWX=y ++CONFIG_SWIOTLB=y ++CONFIG_SYSCTL_EXCEPTION_TRACE=y ++# CONFIG_TELCLOCK is not set ++CONFIG_THERMAL=y ++CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y ++CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 ++CONFIG_THERMAL_GOV_STEP_WISE=y ++CONFIG_THIN_ARCHIVES=y ++CONFIG_THREAD_INFO_IN_TASK=y ++CONFIG_TICK_CPU_ACCOUNTING=y ++CONFIG_TINY_SRCU=y ++# CONFIG_TOSHIBA is not set ++CONFIG_UP_LATE_INIT=y ++CONFIG_USB=y ++CONFIG_USB_COMMON=y ++CONFIG_USB_EHCI_HCD=y ++# CONFIG_USB_EHCI_HCD_PLATFORM is not set ++CONFIG_USB_EHCI_PCI=y ++CONFIG_USB_HID=y ++CONFIG_USB_HIDDEV=y ++CONFIG_USB_OHCI_HCD=y ++# CONFIG_USB_OHCI_HCD_PLATFORM is not set ++CONFIG_USB_PCI=y ++CONFIG_USB_SUPPORT=y ++# CONFIG_USB_UHCI_HCD is not set ++# CONFIG_USERIO is not set ++# CONFIG_USER_NS is not set ++CONFIG_USER_STACKTRACE_SUPPORT=y ++# CONFIG_VGACON_SOFT_SCROLLBACK is not set ++CONFIG_VGA_CONSOLE=y ++# CONFIG_VIA_WDT is not set ++# CONFIG_VM86 is not set ++# CONFIG_VMWARE_VMCI is not set ++CONFIG_VM_EVENT_COUNTERS=y ++CONFIG_VT=y ++CONFIG_VT_CONSOLE=y ++CONFIG_VT_HW_CONSOLE_BINDING=y ++# CONFIG_WAFER_WDT is not set ++CONFIG_X86=y ++CONFIG_X86_32=y ++# CONFIG_X86_32_IRIS is not set ++CONFIG_X86_32_LAZY_GS=y ++CONFIG_X86_ALIGNMENT_16=y ++# CONFIG_X86_ANCIENT_MCE is not set ++# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set ++CONFIG_X86_CMPXCHG64=y ++# CONFIG_X86_CPUFREQ_NFORCE2 is not set ++# CONFIG_X86_CPUID is not set ++# CONFIG_X86_DEBUG_FPU is not set ++# CONFIG_X86_EXTENDED_PLATFORM is not set ++CONFIG_X86_F00F_BUG=y ++CONFIG_X86_FAST_FEATURE_TESTS=y ++CONFIG_X86_FEATURE_NAMES=y ++CONFIG_X86_GENERIC=y ++# CONFIG_X86_GX_SUSPMOD is not set ++# CONFIG_X86_INTEL_PSTATE is not set ++CONFIG_X86_INTEL_USERCOPY=y ++CONFIG_X86_INTERNODE_CACHE_SHIFT=6 ++CONFIG_X86_IO_APIC=y ++CONFIG_X86_L1_CACHE_SHIFT=6 ++# CONFIG_X86_LEGACY_VM86 is not set ++CONFIG_X86_LOCAL_APIC=y ++# CONFIG_X86_LONGRUN is not set ++CONFIG_X86_MCE=y ++# CONFIG_X86_MCELOG_LEGACY is not set ++CONFIG_X86_MCE_AMD=y ++# CONFIG_X86_MCE_INJECT is not set ++CONFIG_X86_MCE_INTEL=y ++CONFIG_X86_MCE_THRESHOLD=y ++CONFIG_X86_MINIMUM_CPU_FAMILY=5 ++CONFIG_X86_MPPARSE=y ++CONFIG_X86_MSR=y ++# CONFIG_X86_P4_CLOCKMOD is not set ++CONFIG_X86_PAE=y ++CONFIG_X86_PAT=y ++CONFIG_X86_PLATFORM_DEVICES=y ++CONFIG_X86_PMEM_LEGACY=y ++CONFIG_X86_PMEM_LEGACY_DEVICE=y ++# CONFIG_X86_POWERNOW_K6 is not set ++# CONFIG_X86_POWERNOW_K7 is not set ++CONFIG_X86_PPRO_FENCE=y ++# CONFIG_X86_PTDUMP is not set ++# CONFIG_X86_PTDUMP_CORE is not set ++# CONFIG_X86_REBOOTFIXUPS is not set ++CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y ++CONFIG_X86_RESERVE_LOW=64 ++# CONFIG_X86_SMAP is not set ++# CONFIG_X86_SPEEDSTEP_CENTRINO is not set ++# CONFIG_X86_SPEEDSTEP_ICH is not set ++# CONFIG_X86_SPEEDSTEP_LIB is not set ++# CONFIG_X86_SPEEDSTEP_SMI is not set ++CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y ++CONFIG_X86_THERMAL_VECTOR=y ++CONFIG_X86_TSC=y ++CONFIG_X86_UP_APIC=y ++CONFIG_X86_UP_IOAPIC=y ++CONFIG_X86_VERBOSE_BOOTUP=y ++CONFIG_XZ_DEC_BCJ=y ++CONFIG_XZ_DEC_X86=y ++CONFIG_ZLIB_INFLATE=y +diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default +index f9893f4..c7e7ed3 100644 +--- a/target/linux/x86/generic/config-default ++++ b/target/linux/x86/generic/config-default +@@ -1,3 +1,4 @@ ++# CONFIG_104_QUAD_8 is not set + # CONFIG_3C515 is not set + CONFIG_ACPI=y + CONFIG_ACPI_AC=y +@@ -43,15 +44,13 @@ CONFIG_AGP_INTEL=y + # CONFIG_APM is not set + CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y + CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y +-CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y + CONFIG_BACKLIGHT_CLASS_DEVICE=y + CONFIG_BACKLIGHT_GENERIC=y + CONFIG_BACKLIGHT_LCD_SUPPORT=y + CONFIG_BLK_DEV_SR=y + # CONFIG_BLK_DEV_SR_VENDOR is not set ++CONFIG_BLK_MQ_VIRTIO=y + # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set +-CONFIG_CLKDEV_LOOKUP=y +-CONFIG_COMMON_CLK=y + CONFIG_CONNECTOR=y + # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set + CONFIG_CPU_IDLE_GOV_MENU=y +@@ -73,18 +72,30 @@ CONFIG_DRM_AMDGPU=y + # CONFIG_DRM_AMD_ACP is not set + CONFIG_DRM_BOCHS=y + CONFIG_DRM_BRIDGE=y ++# CONFIG_DRM_DEBUG_MM is not set ++# CONFIG_DRM_DEBUG_MM_SELFTEST is not set + CONFIG_DRM_FBDEV_EMULATION=y ++CONFIG_DRM_FBDEV_OVERALLOC=100 + # CONFIG_DRM_GMA500 is not set + CONFIG_DRM_I915=y ++# CONFIG_DRM_I915_ALPHA_SUPPORT is not set ++CONFIG_DRM_I915_CAPTURE_ERROR=y ++CONFIG_DRM_I915_COMPRESS_ERROR=y + # CONFIG_DRM_I915_DEBUG is not set ++# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set + # CONFIG_DRM_I915_GVT is not set ++# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set + # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set ++# CONFIG_DRM_I915_SELFTEST is not set ++# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set ++# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set + CONFIG_DRM_I915_USERPTR=y + # CONFIG_DRM_I915_WERROR is not set + CONFIG_DRM_KMS_FB_HELPER=y + CONFIG_DRM_KMS_HELPER=y + CONFIG_DRM_MIPI_DSI=y + CONFIG_DRM_PANEL=y ++CONFIG_DRM_PANEL_BRIDGE=y + CONFIG_DRM_RADEON=y + # CONFIG_DRM_RADEON_USERPTR is not set + CONFIG_DRM_TTM=y +@@ -96,6 +107,8 @@ CONFIG_EFI=y + CONFIG_EFIVAR_FS=m + # CONFIG_EFI_BOOTLOADER_CONTROL is not set + # CONFIG_EFI_CAPSULE_LOADER is not set ++# CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH is not set ++# CONFIG_EFI_DEV_PATH_PARSER is not set + CONFIG_EFI_ESRT=y + # CONFIG_EFI_FAKE_MEMMAP is not set + # CONFIG_EFI_PGT_DUMP is not set +@@ -115,6 +128,7 @@ CONFIG_FB_DEFERRED_IO=y + CONFIG_FB_EFI=y + CONFIG_FB_HYPERV=y + # CONFIG_FB_I810 is not set ++# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set + CONFIG_FB_SYS_COPYAREA=y + CONFIG_FB_SYS_FILLRECT=y + CONFIG_FB_SYS_FOPS=y +@@ -128,6 +142,8 @@ CONFIG_FRAMEBUFFER_CONSOLE=y + CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y + # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set + CONFIG_FREEZER=y ++CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y ++CONFIG_GENERIC_IRQ_MIGRATION=y + CONFIG_GENERIC_PENDING_IRQ=y + CONFIG_GENERIC_PINCONF=y + CONFIG_GPIOLIB=y +@@ -138,8 +154,6 @@ CONFIG_GPIOLIB_IRQCHIP=y + CONFIG_GPIO_ACPI=y + CONFIG_HAVE_ACPI_APEI=y + CONFIG_HAVE_ACPI_APEI_NMI=y +-CONFIG_HAVE_CLK=y +-CONFIG_HAVE_CLK_PREPARE=y + CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y + CONFIG_HAVE_KVM_EVENTFD=y + CONFIG_HAVE_KVM_IRQCHIP=y +@@ -189,12 +203,14 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 + CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y + CONFIG_INTEL_GTT=y + CONFIG_INTEL_IDLE=y ++# CONFIG_INTEL_INT0002_VGPIO is not set + # CONFIG_INTEL_IPS is not set + # CONFIG_INTEL_MENLOW is not set + CONFIG_INTEL_PCH_THERMAL=y + # CONFIG_INTEL_PMC_IPC is not set + CONFIG_INTEL_SOC_DTS_IOSF_CORE=y + CONFIG_INTEL_SOC_DTS_THERMAL=y ++# CONFIG_INTEL_SOC_PMIC_CHTWC is not set + CONFIG_INTERVAL_TREE=y + CONFIG_IOSF_MBI=y + # CONFIG_IOSF_MBI_DEBUG is not set +@@ -244,7 +260,9 @@ CONFIG_MOUSE_PS2_ALPS=y + # CONFIG_MOUSE_PS2_ELANTECH is not set + CONFIG_MOUSE_PS2_LIFEBOOK=y + CONFIG_MOUSE_PS2_LOGIPS2PP=y ++CONFIG_MOUSE_PS2_SMBUS=y + CONFIG_MOUSE_PS2_SYNAPTICS=y ++CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y + # CONFIG_MOUSE_PS2_TOUCHKIT is not set + CONFIG_MOUSE_PS2_TRACKPOINT=y + # CONFIG_MOUSE_PS2_VMMOUSE is not set +@@ -276,8 +294,12 @@ CONFIG_PCI_XEN=y + CONFIG_PINCTRL=y + CONFIG_PINCTRL_BAYTRAIL=y + CONFIG_PINCTRL_BROXTON=y ++CONFIG_PINCTRL_CANNONLAKE=y + CONFIG_PINCTRL_CHERRYVIEW=y ++CONFIG_PINCTRL_DENVERTON=y ++CONFIG_PINCTRL_GEMINILAKE=y + CONFIG_PINCTRL_INTEL=y ++# CONFIG_PINCTRL_LEWISBURG is not set + CONFIG_PINCTRL_SUNRISEPOINT=y + CONFIG_PM=y + # CONFIG_PMIC_OPREGION is not set +@@ -296,11 +318,13 @@ CONFIG_QUEUED_RWLOCKS=y + CONFIG_QUEUED_SPINLOCKS=y + # CONFIG_RANDOMIZE_BASE is not set + CONFIG_RAS=y +-CONFIG_RATIONAL=y ++CONFIG_RCU_NEED_SEGCBLIST=y + CONFIG_RCU_STALL_COMMON=y + CONFIG_REGMAP=y + CONFIG_REGMAP_I2C=y ++# CONFIG_RELAY is not set + CONFIG_RELOCATABLE=y ++CONFIG_RESET_ATTACK_MITIGATION=y + CONFIG_RFS_ACCEL=y + CONFIG_RPS=y + CONFIG_RTC_I2C_AND_SPI=y +@@ -320,6 +344,8 @@ CONFIG_SERIAL_8250_PNP=y + CONFIG_SMP=y + # CONFIG_SURFACE_PRO3_BUTTON is not set + CONFIG_SWIOTLB_XEN=y ++# CONFIG_SW_SYNC is not set ++# CONFIG_SYNC_FILE is not set + CONFIG_SYS_HYPERVISOR=y + CONFIG_TASKSTATS=y + CONFIG_TASK_DELAY_ACCT=y +@@ -328,10 +354,12 @@ CONFIG_THERMAL_HWMON=y + CONFIG_THERMAL_WRITABLE_TRIPS=y + # CONFIG_TOSHIBA_BT_RFKILL is not set + CONFIG_TREE_RCU=y ++CONFIG_TREE_SRCU=y + CONFIG_UCS2_STRING=y + CONFIG_USB_STORAGE=y + CONFIG_USER_RETURN_NOTIFIER=y + CONFIG_VGACON_SOFT_SCROLLBACK=y ++# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set + CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 + CONFIG_VHOST=y + CONFIG_VHOST_NET=y +@@ -390,7 +418,11 @@ CONFIG_XEN_HAVE_VPMU=y + CONFIG_XEN_NETDEV_FRONTEND=y + CONFIG_XEN_PCIDEV_FRONTEND=y + CONFIG_XEN_PRIVCMD=y ++CONFIG_XEN_PV=y ++CONFIG_XEN_PVH=y + CONFIG_XEN_PVHVM=y ++CONFIG_XEN_PVHVM_SMP=y ++CONFIG_XEN_PV_SMP=y + CONFIG_XEN_SAVE_RESTORE=y + CONFIG_XEN_SCRUB_PAGES=y + CONFIG_XEN_SCSI_FRONTEND=y +@@ -399,3 +431,4 @@ CONFIG_XEN_SYS_HYPERVISOR=y + CONFIG_XEN_WDT=y + CONFIG_XEN_XENBUS_FRONTEND=y + CONFIG_XPS=y ++CONFIG_ZLIB_DEFLATE=y +diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default +index daf397b..b564b94 100644 +--- a/target/linux/x86/geode/config-default ++++ b/target/linux/x86/geode/config-default +@@ -1,3 +1,4 @@ ++# CONFIG_104_QUAD_8 is not set + # CONFIG_3C515 is not set + CONFIG_8139CP=y + CONFIG_8139TOO=y +@@ -40,6 +41,7 @@ CONFIG_CS5535_MFGPT=y + CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 + # CONFIG_DPTF_POWER is not set + # CONFIG_EBC_C384_WDT is not set ++# CONFIG_EFI_DEV_PATH_PARSER is not set + # CONFIG_EISA is not set + # CONFIG_EL3 is not set + CONFIG_GEODE_WDT=y +@@ -63,9 +65,11 @@ CONFIG_I2C_ALGOBIT=y + CONFIG_I2C_ALGOPCA=y + CONFIG_I2C_ALGOPCF=y + CONFIG_I2C_BOARDINFO=y ++# CONFIG_INTEL_INT0002_VGPIO is not set + # CONFIG_INTEL_IPS is not set + # CONFIG_INTEL_MENLOW is not set + # CONFIG_INTEL_PMC_IPC is not set ++# CONFIG_INTEL_SOC_PMIC_CHTWC is not set + CONFIG_ISA=y + # CONFIG_ISAPNP is not set + CONFIG_ISA_BUS_API=y +@@ -110,9 +114,10 @@ CONFIG_SENSORS_LM90=y + CONFIG_SERIAL_8250_PNP=y + # CONFIG_SURFACE_PRO3_BUTTON is not set + # CONFIG_TOSHIBA_BT_RFKILL is not set +-CONFIG_USB_OHCI_HCD_PCI=y + # CONFIG_USB_UHCI_HCD is not set ++CONFIG_USB_OHCI_HCD_PCI=y + CONFIG_VGACON_SOFT_SCROLLBACK=y ++# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set + CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 + CONFIG_VIA_RHINE=y + CONFIG_VIA_RHINE_MMIO=y +diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default +index 3e0b065..a438eed 100644 +--- a/target/linux/x86/legacy/config-default ++++ b/target/linux/x86/legacy/config-default +@@ -1,3 +1,4 @@ ++# CONFIG_104_QUAD_8 is not set + # CONFIG_3C515 is not set + CONFIG_ACPI=y + CONFIG_ACPI_AC=y +@@ -45,8 +46,6 @@ CONFIG_BACKLIGHT_GENERIC=y + CONFIG_BACKLIGHT_LCD_SUPPORT=y + CONFIG_BLK_DEV_SR=y + # CONFIG_BLK_DEV_SR_VENDOR is not set +-CONFIG_CLKDEV_LOOKUP=y +-CONFIG_COMMON_CLK=y + CONFIG_CPU_IDLE_GOV_MENU=y + CONFIG_DMA_SHARED_BUFFER=y + # CONFIG_DPTF_POWER is not set +@@ -59,23 +58,36 @@ CONFIG_DRM_AMDGPU=y + # CONFIG_DRM_AMD_ACP is not set + CONFIG_DRM_BOCHS=y + CONFIG_DRM_BRIDGE=y ++# CONFIG_DRM_DEBUG_MM is not set ++# CONFIG_DRM_DEBUG_MM_SELFTEST is not set + CONFIG_DRM_FBDEV_EMULATION=y ++CONFIG_DRM_FBDEV_OVERALLOC=100 + # CONFIG_DRM_GMA500 is not set + CONFIG_DRM_I915=y ++# CONFIG_DRM_I915_ALPHA_SUPPORT is not set ++CONFIG_DRM_I915_CAPTURE_ERROR=y ++CONFIG_DRM_I915_COMPRESS_ERROR=y + # CONFIG_DRM_I915_DEBUG is not set ++# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set + # CONFIG_DRM_I915_GVT is not set ++# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set ++# CONFIG_DRM_I915_SELFTEST is not set + # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set ++# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set ++# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set + CONFIG_DRM_I915_USERPTR=y + # CONFIG_DRM_I915_WERROR is not set + CONFIG_DRM_KMS_FB_HELPER=y + CONFIG_DRM_KMS_HELPER=y + CONFIG_DRM_MIPI_DSI=y + CONFIG_DRM_PANEL=y ++CONFIG_DRM_PANEL_BRIDGE=y + CONFIG_DRM_RADEON=y + # CONFIG_DRM_RADEON_USERPTR is not set + CONFIG_DRM_TTM=y + # CONFIG_DRM_VMWGFX is not set + # CONFIG_EBC_C384_WDT is not set ++# CONFIG_EFI_DEV_PATH_PARSER is not set + # CONFIG_EISA is not set + # CONFIG_EL3 is not set + CONFIG_FB=y +@@ -85,6 +97,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y + CONFIG_FB_CMDLINE=y + CONFIG_FB_DEFERRED_IO=y + # CONFIG_FB_I810 is not set ++# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set + CONFIG_FB_SYS_COPYAREA=y + CONFIG_FB_SYS_FILLRECT=y + CONFIG_FB_SYS_FOPS=y +@@ -99,8 +112,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y + # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set + CONFIG_HAVE_ACPI_APEI=y + CONFIG_HAVE_ACPI_APEI_NMI=y +-CONFIG_HAVE_CLK=y +-CONFIG_HAVE_CLK_PREPARE=y + CONFIG_HDMI=y + CONFIG_HID_BATTERY_STRENGTH=y + # CONFIG_HIGHMEM64G is not set +@@ -121,7 +132,10 @@ CONFIG_INTEL_IDLE=y + # CONFIG_INTEL_IPS is not set + # CONFIG_INTEL_MENLOW is not set + # CONFIG_INTEL_PMC_IPC is not set ++# CONFIG_INTEL_SOC_PMIC_CHTWC is not set + CONFIG_INTERVAL_TREE=y ++CONFIG_IOSF_MBI=y ++# CONFIG_IOSF_MBI_DEBUG is not set + CONFIG_ISA=y + CONFIG_ISAPNP=y + CONFIG_ISA_BUS_API=y +@@ -146,7 +160,9 @@ CONFIG_MOUSE_PS2_ALPS=y + # CONFIG_MOUSE_PS2_ELANTECH is not set + CONFIG_MOUSE_PS2_LIFEBOOK=y + CONFIG_MOUSE_PS2_LOGIPS2PP=y ++CONFIG_MOUSE_PS2_SMBUS=y + CONFIG_MOUSE_PS2_SYNAPTICS=y ++CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y + # CONFIG_MOUSE_PS2_TOUCHKIT is not set + CONFIG_MOUSE_PS2_TRACKPOINT=y + # CONFIG_MOUSE_SERIAL is not set +@@ -175,17 +191,20 @@ CONFIG_PNPACPI=y + CONFIG_PNP_DEBUG_MESSAGES=y + # CONFIG_PVPANIC is not set + CONFIG_RAS=y +-CONFIG_RATIONAL=y + CONFIG_REGMAP=y + CONFIG_REGMAP_I2C=y ++CONFIG_RELAY=y + CONFIG_RTC_I2C_AND_SPI=y + # CONFIG_SAMSUNG_Q10 is not set + CONFIG_SATA_AHCI=y + CONFIG_SERIAL_8250_PNP=y + # CONFIG_SURFACE_PRO3_BUTTON is not set ++# CONFIG_SW_SYNC is not set ++CONFIG_SYNC_FILE=y + # CONFIG_TOSHIBA_BT_RFKILL is not set + CONFIG_USB_STORAGE=y + CONFIG_VGACON_SOFT_SCROLLBACK=y ++# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set + CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 + # CONFIG_WDT is not set + CONFIG_X86_ACPI_CPUFREQ=y +@@ -200,3 +219,4 @@ CONFIG_X86_MINIMUM_CPU_FAMILY=4 + # CONFIG_X86_PCC_CPUFREQ is not set + CONFIG_X86_PM_TIMER=y + # CONFIG_X86_POWERNOW_K8 is not set ++CONFIG_ZLIB_DEFLATE=y +diff --git a/target/linux/x86/patches-4.14/011-tune_lzma_options.patch b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch +new file mode 100644 +index 0000000..daed310 +--- /dev/null ++++ b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch +@@ -0,0 +1,22 @@ ++--- a/scripts/Makefile.lib +++++ b/scripts/Makefile.lib ++@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) ++ ++ quiet_cmd_lzma = LZMA $@ ++ cmd_lzma = (cat $(filter-out FORCE,$^) | \ ++- lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ +++ lzma e -lc8 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ (rm -f $@ ; false) ++ ++ quiet_cmd_lzo = LZO $@ ++--- a/arch/x86/include/asm/boot.h +++++ b/arch/x86/include/asm/boot.h ++@@ -24,7 +24,7 @@ ++ # error "Invalid value for CONFIG_PHYSICAL_ALIGN" ++ #endif ++ ++-#ifdef CONFIG_KERNEL_BZIP2 +++#if defined(CONFIG_KERNEL_BZIP2) || defined(CONFIG_KERNEL_LZMA) ++ # define BOOT_HEAP_SIZE 0x400000 ++ #else /* !CONFIG_KERNEL_BZIP2 */ ++ # define BOOT_HEAP_SIZE 0x10000 +diff --git a/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch +new file mode 100644 +index 0000000..c3a7fce +--- /dev/null ++++ b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch +@@ -0,0 +1,12 @@ ++--- a/drivers/clocksource/cs5535-clockevt.c +++++ b/drivers/clocksource/cs5535-clockevt.c ++@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v ++ cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, ++ MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); ++ ++- cs5535_clockevent.event_handler(&cs5535_clockevent); +++ if (cs5535_clockevent.event_handler) +++ cs5535_clockevent.event_handler(&cs5535_clockevent); ++ return IRQ_HANDLED; ++ } ++ +diff --git a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch +new file mode 100644 +index 0000000..048dfae +--- /dev/null ++++ b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch +@@ -0,0 +1,19 @@ ++--- a/arch/x86/kernel/reboot.c +++++ b/arch/x86/kernel/reboot.c ++@@ -448,6 +448,16 @@ static const struct dmi_system_id reboot ++ }, ++ }, ++ +++ /* PC Engines */ +++ { /* Handle problems with rebooting on PC Engines apu2 */ +++ .callback = set_pci_reboot, +++ .ident = "PC Engines apu2", +++ .matches = { +++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), +++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), +++ }, +++ }, +++ ++ /* Sony */ ++ { /* Handle problems with rebooting on Sony VGN-Z540N */ ++ .callback = set_bios_reboot, +diff --git a/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch +new file mode 100644 +index 0000000..ef2e133 +--- /dev/null ++++ b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch +@@ -0,0 +1,30 @@ ++--- a/drivers/hwmon/w83627ehf.c +++++ b/drivers/hwmon/w83627ehf.c ++@@ -2717,8 +2717,8 @@ static int __init w83627ehf_find(int sio ++ static const char sio_name_W83627UHG[] __initconst = "W83627UHG"; ++ static const char sio_name_W83667HG[] __initconst = "W83667HG"; ++ static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B"; ++- static const char sio_name_NCT6775[] __initconst = "NCT6775F"; ++- static const char sio_name_NCT6776[] __initconst = "NCT6776F"; +++/* static const char sio_name_NCT6775[] __initconst = "NCT6775F"; +++ static const char sio_name_NCT6776[] __initconst = "NCT6776F"; */ ++ ++ u16 val; ++ const char *sio_name; ++@@ -2762,14 +2762,14 @@ static int __init w83627ehf_find(int sio ++ sio_data->kind = w83667hg_b; ++ sio_name = sio_name_W83667HG_B; ++ break; ++- case SIO_NCT6775_ID: +++/* case SIO_NCT6775_ID: ++ sio_data->kind = nct6775; ++ sio_name = sio_name_NCT6775; ++ break; ++ case SIO_NCT6776_ID: ++ sio_data->kind = nct6776; ++ sio_name = sio_name_NCT6776; ++- break; +++ break; */ ++ default: ++ if (val != 0xffff) ++ pr_debug("unsupported chip ID: 0x%04x\n", val); +-- +1.9.1 + diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 92b27d36a..55b69cec8 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -6,6 +6,7 @@ CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y # CONFIG_ACPI_CMPC is not set CONFIG_ACPI_CONTAINER=y +CONFIG_ACPI_CPPC_LIB=y CONFIG_ACPI_CPU_FREQ_PSS=y # CONFIG_ACPI_CUSTOM_DSDT is not set # CONFIG_ACPI_DEBUG is not set @@ -15,8 +16,8 @@ CONFIG_ACPI_CPU_FREQ_PSS=y CONFIG_ACPI_FAN=y CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_IOAPIC=y +# CONFIG_ACPI_I2C_OPREGION is not set CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set @@ -30,9 +31,11 @@ CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_WMI is not set CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y -CONFIG_ARCH_HAS_GIGANTIC_PAGE=y +CONFIG_ARCH_HAS_ADD_PAGES=y CONFIG_ARCH_HAS_KCOV=y CONFIG_ARCH_HAS_PMEM_API=y +CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y +CONFIG_ARCH_HAS_ZONE_DEVICE=y CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MMAP_RND_BITS=28 CONFIG_ARCH_MMAP_RND_BITS_MAX=32 @@ -41,12 +44,13 @@ CONFIG_ARCH_SPARSEMEM_DEFAULT=y CONFIG_ARCH_SUPPORTS_INT128=y CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y +CONFIG_ARCH_WANTS_THP_SWAP=y CONFIG_AUDIT_ARCH=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_INTEGRITY=y +CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set CONFIG_CALGARY_IOMMU=y CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y @@ -54,7 +58,6 @@ CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_RMAP=y CONFIG_CRC_T10DIF=y -CONFIG_CRYPTO_ABLK_HELPER=y CONFIG_CRYPTO_AEAD=y CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_AES_NI_INTEL=y @@ -70,6 +73,7 @@ CONFIG_CRYPTO_CRCT10DIF=y # CONFIG_CRYPTO_CRCT10DIF_PCLMUL is not set CONFIG_CRYPTO_CRYPTD=y # CONFIG_CRYPTO_DES3_EDE_X86_64 is not set +CONFIG_CRYPTO_ECB=y CONFIG_CRYPTO_GF128MUL=y CONFIG_CRYPTO_GLUE_HELPER_X86=y CONFIG_CRYPTO_LRW=y @@ -87,6 +91,7 @@ CONFIG_CRYPTO_NULL2=y # CONFIG_CRYPTO_SHA256_SSSE3 is not set # CONFIG_CRYPTO_SHA512_MB is not set # CONFIG_CRYPTO_SHA512_SSSE3 is not set +CONFIG_CRYPTO_SIMD=y # CONFIG_CRYPTO_SKEIN is not set # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set # CONFIG_CRYPTO_TWOFISH_X86_64 is not set @@ -99,6 +104,7 @@ CONFIG_EFI=y CONFIG_EFIVAR_FS=m # CONFIG_EFI_BOOTLOADER_CONTROL is not set # CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set CONFIG_EFI_ESRT=y # CONFIG_EFI_FAKE_MEMMAP is not set # CONFIG_EFI_MIXED is not set @@ -117,6 +123,7 @@ CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y CONFIG_FB_HYPERV=y CONFIG_FB_MODE_HELPERS=y +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SIMPLE=y CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y @@ -135,21 +142,23 @@ CONFIG_FREEZER=y CONFIG_GART_IOMMU=y CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y CONFIG_GENERIC_CPU=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_F7188X is not set CONFIG_GPIO_ICH=y CONFIG_GPIO_IT87=y CONFIG_GPIO_LYNXPOINT=y CONFIG_GPIO_SCH=y CONFIG_GPIO_SYSFS=y +CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y # CONFIG_HAVE_AOUT is not set CONFIG_HAVE_ARCH_SOFT_DIRTY=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y CONFIG_HAVE_ARCH_VMAP_STACK=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_EBPF_JIT=y @@ -179,6 +188,7 @@ CONFIG_HVC_IRQ=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y +CONFIG_HWMON_VID=y CONFIG_HW_RANDOM_AMD=y CONFIG_HW_RANDOM_INTEL=y CONFIG_HW_RANDOM_VIRTIO=y @@ -188,20 +198,29 @@ CONFIG_HYPERV_BALLOON=y CONFIG_HYPERV_KEYBOARD=y CONFIG_HYPERV_NET=y CONFIG_HYPERV_STORAGE=y +CONFIG_HYPERV_TSCPAGE=y CONFIG_HYPERV_UTILS=y +# CONFIG_HYPERV_VSOCKETS is not set +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y # CONFIG_I7300_IDLE is not set # CONFIG_IA32_EMULATION is not set CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_MIC_BUS is not set +CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_PMC_IPC is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_TURBO_MAX_3 is not set # CONFIG_IOMMU_DEBUG is not set +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set # CONFIG_ISCSI_IBFT_FIND is not set -# CONFIG_ITCO_VENDOR_SUPPORT is not set -CONFIG_ITCO_WDT=y CONFIG_KALLSYMS_ABSOLUTE_PERCPU=y # CONFIG_KVM_DEBUG_FS is not set CONFIG_KVM_GUEST=y @@ -210,10 +229,10 @@ CONFIG_LEDS_GPIO=y # CONFIG_LEGACY_VSYSCALL_EMULATE is not set # CONFIG_LEGACY_VSYSCALL_NATIVE is not set CONFIG_LEGACY_VSYSCALL_NONE=y -# CONFIG_LIQUIDIO is not set CONFIG_LOCK_SPIN_ON_OWNER=y CONFIG_LPC_ICH=y CONFIG_LPC_SCH=y +CONFIG_MAILBOX=y # CONFIG_MAXSMP is not set CONFIG_MEMORY_BALLOON=y # CONFIG_MEMORY_HOTPLUG is not set @@ -234,6 +253,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=8 # CONFIG_NUMA is not set +# CONFIG_ORC_UNWINDER is not set CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_PADATA=y CONFIG_PARAVIRT=y @@ -246,6 +266,7 @@ CONFIG_PATA_MPIIX=y CONFIG_PATA_OLDPIIX=y CONFIG_PATA_PLATFORM=y CONFIG_PATA_VIA=y +CONFIG_PCC=y CONFIG_PCIEAER=y CONFIG_PCIEPORTBUS=y CONFIG_PCIE_PME=y @@ -256,6 +277,7 @@ CONFIG_PGTABLE_LEVELS=4 CONFIG_PHYSICAL_ALIGN=0x1000000 CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set +CONFIG_PM_CLK=y # CONFIG_PM_DEBUG is not set CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y @@ -268,19 +290,29 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y # CONFIG_RANDOMIZE_BASE is not set CONFIG_RAS=y +CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_SPIN_ON_OWNER=y # CONFIG_SAMSUNG_Q10 is not set CONFIG_SATA_AHCI=y CONFIG_SCHED_MC=y +CONFIG_SCHED_MC_PRIO=y CONFIG_SCHED_SMT=y # CONFIG_SCIF_BUS is not set CONFIG_SCSI_VIRTIO=y CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y CONFIG_SERIAL_8250_PNP=y CONFIG_SMP=y CONFIG_SPARSEMEM=y @@ -292,14 +324,13 @@ CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y # CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB_XEN=y CONFIG_SYS_HYPERVISOR=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_RGX is not set -# CONFIG_THUNDER_NIC_VF is not set +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y CONFIG_UCS2_STRING=y -CONFIG_UCSI=y # CONFIG_UNISYSSPAR is not set CONFIG_USB_OHCI_HCD_PCI=y CONFIG_USB_STORAGE=y @@ -307,6 +338,7 @@ CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y # CONFIG_USB_XHCI_PLATFORM is not set CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VIRTIO=y CONFIG_VIRTIO_BALLOON=y @@ -329,6 +361,7 @@ CONFIG_VMXNET3=y CONFIG_VSOCKETS=y CONFIG_VT_CONSOLE_SLEEP=y CONFIG_WATCHDOG_CORE=y +# CONFIG_X86_5LEVEL is not set CONFIG_X86_64=y CONFIG_X86_64_SMP=y CONFIG_X86_ACPI_CPUFREQ=y @@ -336,14 +369,17 @@ CONFIG_X86_ACPI_CPUFREQ=y CONFIG_X86_AMD_FREQ_SENSITIVITY=y # CONFIG_X86_AMD_PLATFORM_DEVICE is not set CONFIG_X86_CMOV=y +CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y CONFIG_X86_DEV_DMA_OPS=y CONFIG_X86_DIRECT_GBPAGES=y # CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set +# CONFIG_X86_INTEL_MPX is not set +CONFIG_X86_INTEL_PSTATE=y CONFIG_X86_MINIMUM_CPU_FAMILY=64 -# CONFIG_X86_MSR is not set # CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y # CONFIG_X86_PMEM_LEGACY is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set @@ -373,8 +409,11 @@ CONFIG_XEN_HAVE_VPMU=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PV=y CONFIG_XEN_PVH=y CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_PV_SMP=y CONFIG_XEN_SAVE_RESTORE=y CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_SCSI_FRONTEND=y diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 new file mode 100644 index 000000000..05af59890 --- /dev/null +++ b/target/linux/x86/config-4.14 @@ -0,0 +1,525 @@ +# CONFIG_60XX_WDT is not set +# CONFIG_64BIT is not set +# CONFIG_ACPI is not set +# CONFIG_ACQUIRE_WDT is not set +# CONFIG_ADVANTECH_WDT is not set +# CONFIG_ALIM1535_WDT is not set +# CONFIG_ALIX is not set +CONFIG_AMD_NB=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y +CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y +CONFIG_ARCH_HAS_CPU_RELAX=y +CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FAST_MULTIPLIER=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_MEM_ENCRYPT=y +CONFIG_ARCH_HAS_SET_MEMORY=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y +CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_RANDOM=y +CONFIG_ARCH_SELECT_MEMORY_MODEL=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y +CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y +CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y +CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USES_PG_UNCACHED=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ATA=y +CONFIG_ATA_GENERIC=y +CONFIG_ATA_PIIX=y +CONFIG_BINFMT_MISC=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BOUNCE=y +CONFIG_BTT=y +CONFIG_CLKBLD_I8253=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_I8253=y +CONFIG_CLKSRC_I8253=y +CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y +CONFIG_CLOCKSOURCE_WATCHDOG=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +CONFIG_COMPAT_32=y +# CONFIG_COMPAT_VDSO is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 +CONFIG_CONSOLE_TRANSLATIONS=y +# CONFIG_CPU5_WDT is not set +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set +# CONFIG_CPU_FREQ_GOV_USERSPACE is not set +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_SUP_AMD=y +CONFIG_CPU_SUP_CENTAUR=y +CONFIG_CPU_SUP_CYRIX_32=y +CONFIG_CPU_SUP_INTEL=y +CONFIG_CPU_SUP_TRANSMETA_32=y +CONFIG_CPU_SUP_UMC_32=y +# CONFIG_CRASHLOG is not set +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AES_586=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +# CONFIG_CRYPTO_CRC32_PCLMUL is not set +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_RNG2=y +# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set +CONFIG_CRYPTO_WORKQUEUE=y +# CONFIG_CX_ECAT is not set +CONFIG_DCACHE_WORD_ACCESS=y +# CONFIG_DCDBAS is not set +# CONFIG_DEBUG_BOOT_PARAMS is not set +# CONFIG_DEBUG_ENTRY is not set +CONFIG_DEBUG_MEMORY_INIT=y +# CONFIG_DEBUG_NMI_SELFTEST is not set +# CONFIG_DEBUG_TLBFLUSH is not set +# CONFIG_DEBUG_VIRTUAL is not set +CONFIG_DECOMPRESS_BZIP2=y +CONFIG_DECOMPRESS_GZIP=y +CONFIG_DEFAULT_IO_DELAY_TYPE=0 +# CONFIG_DELL_RBU is not set +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +CONFIG_DMI=y +CONFIG_DMIID=y +CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y +CONFIG_DMI_SYSFS=y +CONFIG_DNOTIFY=y +# CONFIG_DRM_LIB_RANDOM is not set +CONFIG_DUMMY_CONSOLE=y +CONFIG_EARLY_PRINTK=y +# CONFIG_EARLY_PRINTK_DBGP is not set +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +# CONFIG_EDD is not set +# CONFIG_EUROTECH_WDT is not set +CONFIG_EXPORTFS=y +CONFIG_EXT4_FS=y +# CONFIG_F2FS_CHECK_FS is not set +CONFIG_F2FS_FS=y +# CONFIG_F2FS_FS_SECURITY is not set +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_STAT_FS=y +# CONFIG_F71808E_WDT is not set +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_FIRMWARE_MEMMAP=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FRAME_POINTER_UNWINDER=y +CONFIG_FS_MBCACHE=y +CONFIG_FUSION=y +# CONFIG_FUSION_CTL is not set +# CONFIG_FUSION_LOGGING is not set +CONFIG_FUSION_MAX_SGE=128 +CONFIG_FUSION_SPI=y +CONFIG_FUTEX_PI=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_FIND_FIRST_BIT=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IOMAP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GENERIC_TIME_VSYSCALL=y +# CONFIG_GEOS is not set +CONFIG_GLOB=y +# CONFIG_GRO_CELLS is not set +# CONFIG_GUESS_UNWINDER is not set +# CONFIG_HANGCHECK_TIMER is not set +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y +CONFIG_HAVE_AOUT=y +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_HUGE_VMAP=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_KMEMCHECK=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +CONFIG_HAVE_ATOMIC_IOMAP=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CMPXCHG_DOUBLE=y +CONFIG_HAVE_CMPXCHG_LOCAL=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_GENERIC_GUP=y +CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y +CONFIG_HAVE_HW_BREAKPOINT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IOREMAP_PROT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y +CONFIG_HAVE_MMIOTRACE_SUPPORT=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PCSPKR_PLATFORM=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_EVENTS_NMI=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SETUP_PER_CPU_AREA=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y +CONFIG_HAVE_USER_RETURN_NOTIFIER=y +CONFIG_HID=y +CONFIG_HIGHMEM=y +# CONFIG_HIGHMEM4G is not set +CONFIG_HIGHMEM64G=y +# CONFIG_HIGHPTE is not set +CONFIG_HPET_EMULATE_RTC=y +CONFIG_HPET_TIMER=y +# CONFIG_HP_WATCHDOG is not set +CONFIG_HT_IRQ=y +# CONFIG_HUGETLBFS is not set +CONFIG_HW_CONSOLE=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_GEODE=y +CONFIG_HW_RANDOM_VIA=y +# CONFIG_HYPERVISOR_GUEST is not set +CONFIG_HZ_PERIODIC=y +CONFIG_I8253_LOCK=y +# CONFIG_I8K is not set +# CONFIG_IB700_WDT is not set +# CONFIG_IBMASR is not set +# CONFIG_IBM_RTL is not set +# CONFIG_IE6XX_WDT is not set +CONFIG_ILLEGAL_POINTER_VALUE=0 +CONFIG_INITRAMFS_SOURCE="" +CONFIG_INPUT=y +CONFIG_INPUT_KEYBOARD=y +CONFIG_INSTRUCTION_DECODER=y +# CONFIG_INTEL_PCH_THERMAL is not set +# CONFIG_INTEL_POWERCLAMP is not set +# CONFIG_INTEL_RDT is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set +CONFIG_IOMMU_HELPER=y +# CONFIG_IOMMU_STRESS is not set +# CONFIG_IOSF_MBI is not set +CONFIG_IO_DELAY_0X80=y +# CONFIG_IO_DELAY_0XED is not set +# CONFIG_IO_DELAY_NONE is not set +CONFIG_IO_DELAY_TYPE_0X80=0 +CONFIG_IO_DELAY_TYPE_0XED=1 +CONFIG_IO_DELAY_TYPE_NONE=3 +CONFIG_IO_DELAY_TYPE_UDELAY=2 +# CONFIG_IO_DELAY_UDELAY is not set +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_ISA is not set +CONFIG_ISA_DMA_API=y +# CONFIG_IT8712F_WDT is not set +# CONFIG_IT87_WDT is not set +# CONFIG_ITCO_WDT is not set +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_KEYBOARD_ATKBD=y +# CONFIG_LEDS_CLEVO_MAIL is not set +CONFIG_LIBNVDIMM=y +# CONFIG_M486 is not set +# CONFIG_M586 is not set +CONFIG_M586MMX=y +# CONFIG_M586TSC is not set +# CONFIG_M686 is not set +# CONFIG_MACHZ_WDT is not set +# CONFIG_MATOM is not set +# CONFIG_MCORE2 is not set +# CONFIG_MCRUSOE is not set +# CONFIG_MCYRIXIII is not set +# CONFIG_MDIO_BUS is not set +# CONFIG_MEFFICEON is not set +# CONFIG_MELAN is not set +# CONFIG_MFD_INTEL_LPSS_PCI is not set +# CONFIG_MGEODEGX1 is not set +# CONFIG_MGEODE_LX is not set +# CONFIG_MICROCODE is not set +# CONFIG_MK6 is not set +# CONFIG_MK7 is not set +# CONFIG_MK8 is not set +# CONFIG_MODIFY_LDT_SYSCALL is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_MODULES_USE_ELF_REL=y +# CONFIG_MPENTIUM4 is not set +# CONFIG_MPENTIUMII is not set +# CONFIG_MPENTIUMIII is not set +# CONFIG_MPENTIUMM is not set +# CONFIG_MTD is not set +CONFIG_MTRR=y +# CONFIG_MTRR_SANITIZER is not set +# CONFIG_MVIAC3_2 is not set +# CONFIG_MVIAC7 is not set +# CONFIG_MWINCHIP3D is not set +# CONFIG_MWINCHIPC6 is not set +CONFIG_NAMESPACES=y +CONFIG_ND_BLK=y +CONFIG_ND_BTT=y +CONFIG_ND_CLAIM=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y +CONFIG_NEED_SG_DMA_LENGTH=y +# CONFIG_NET5501 is not set +# CONFIG_NET_NS is not set +CONFIG_NLS=y +# CONFIG_NOHIGHMEM is not set +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=1 +# CONFIG_NSC_GPIO is not set +CONFIG_NVRAM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OPROFILE_NMI_TIMER=y +# CONFIG_OPTIMIZE_INLINING is not set +CONFIG_OUTPUT_FORMAT="elf32-i386" +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PC104=y +# CONFIG_PC8736x_GPIO is not set +# CONFIG_PC87413_WDT is not set +CONFIG_PCI=y +CONFIG_PCI_BIOS=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y +CONFIG_PCI_DIRECT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_GOANY=y +# CONFIG_PCI_GOBIOS is not set +# CONFIG_PCI_GODIRECT is not set +# CONFIG_PCI_GOMMCONFIG is not set +CONFIG_PCI_LABEL=y +CONFIG_PCI_LOCKLESS_CONFIG=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PERF_EVENTS=y +CONFIG_PERF_EVENTS_INTEL_CSTATE=y +CONFIG_PERF_EVENTS_INTEL_RAPL=y +CONFIG_PERF_EVENTS_INTEL_UNCORE=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYSICAL_ALIGN=0x100000 +CONFIG_PHYSICAL_START=0x1000000 +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_PMC_ATOM=y +CONFIG_POWER_SUPPLY=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +# CONFIG_PROCESSOR_SELECT is not set +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set +# CONFIG_PUNIT_ATOM_DEBUG is not set +CONFIG_RATIONAL=y +# CONFIG_RCU_NEED_SEGCBLIST is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RD_BZIP2=y +CONFIG_RD_GZIP=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SBC7240_WDT is not set +# CONFIG_SBC8360_WDT is not set +# CONFIG_SBC_EPX_C3_WATCHDOG is not set +# CONFIG_SC1200_WDT is not set +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SCSI_SPI_ATTRS=y +CONFIG_SCx200=y +CONFIG_SCx200HR_TIMER=y +# CONFIG_SCx200_GPIO is not set +# CONFIG_SCx200_WDT is not set +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIO=y +CONFIG_SERIO_I8042=y +CONFIG_SERIO_LIBPS2=y +CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y +# CONFIG_SMSC37B787_WDT is not set +# CONFIG_SMSC_SCH311X_WDT is not set +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_STRICT_KERNEL_RWX=y +CONFIG_STRICT_MODULE_RWX=y +CONFIG_SWIOTLB=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +# CONFIG_TELCLOCK is not set +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THIN_ARCHIVES=y +CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y +# CONFIG_TOSHIBA is not set +CONFIG_UP_LATE_INIT=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_HCD=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_EHCI_PCI=y +CONFIG_USB_HID=y +CONFIG_USB_HIDDEV=y +CONFIG_USB_OHCI_HCD=y +# CONFIG_USB_OHCI_HCD_PLATFORM is not set +CONFIG_USB_PCI=y +CONFIG_USB_SUPPORT=y +# CONFIG_USB_UHCI_HCD is not set +# CONFIG_USERIO is not set +# CONFIG_USER_NS is not set +CONFIG_USER_STACKTRACE_SUPPORT=y +# CONFIG_VGACON_SOFT_SCROLLBACK is not set +CONFIG_VGA_CONSOLE=y +# CONFIG_VIA_WDT is not set +# CONFIG_VM86 is not set +# CONFIG_VMWARE_VMCI is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +# CONFIG_WAFER_WDT is not set +CONFIG_X86=y +CONFIG_X86_32=y +# CONFIG_X86_32_IRIS is not set +CONFIG_X86_32_LAZY_GS=y +CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_ANCIENT_MCE is not set +# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set +CONFIG_X86_CMPXCHG64=y +# CONFIG_X86_CPUFREQ_NFORCE2 is not set +# CONFIG_X86_CPUID is not set +# CONFIG_X86_DEBUG_FPU is not set +# CONFIG_X86_EXTENDED_PLATFORM is not set +CONFIG_X86_F00F_BUG=y +CONFIG_X86_FAST_FEATURE_TESTS=y +CONFIG_X86_FEATURE_NAMES=y +CONFIG_X86_GENERIC=y +# CONFIG_X86_GX_SUSPMOD is not set +# CONFIG_X86_INTEL_PSTATE is not set +CONFIG_X86_INTEL_USERCOPY=y +CONFIG_X86_INTERNODE_CACHE_SHIFT=6 +CONFIG_X86_IO_APIC=y +CONFIG_X86_L1_CACHE_SHIFT=6 +# CONFIG_X86_LEGACY_VM86 is not set +CONFIG_X86_LOCAL_APIC=y +# CONFIG_X86_LONGRUN is not set +CONFIG_X86_MCE=y +# CONFIG_X86_MCELOG_LEGACY is not set +CONFIG_X86_MCE_AMD=y +# CONFIG_X86_MCE_INJECT is not set +CONFIG_X86_MCE_INTEL=y +CONFIG_X86_MCE_THRESHOLD=y +CONFIG_X86_MINIMUM_CPU_FAMILY=5 +CONFIG_X86_MPPARSE=y +CONFIG_X86_MSR=y +# CONFIG_X86_P4_CLOCKMOD is not set +CONFIG_X86_PAE=y +CONFIG_X86_PAT=y +CONFIG_X86_PLATFORM_DEVICES=y +CONFIG_X86_PMEM_LEGACY=y +CONFIG_X86_PMEM_LEGACY_DEVICE=y +# CONFIG_X86_POWERNOW_K6 is not set +# CONFIG_X86_POWERNOW_K7 is not set +CONFIG_X86_PPRO_FENCE=y +# CONFIG_X86_PTDUMP is not set +# CONFIG_X86_PTDUMP_CORE is not set +# CONFIG_X86_REBOOTFIXUPS is not set +CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y +CONFIG_X86_RESERVE_LOW=64 +# CONFIG_X86_SMAP is not set +# CONFIG_X86_SPEEDSTEP_CENTRINO is not set +# CONFIG_X86_SPEEDSTEP_ICH is not set +# CONFIG_X86_SPEEDSTEP_LIB is not set +# CONFIG_X86_SPEEDSTEP_SMI is not set +CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y +CONFIG_X86_THERMAL_VECTOR=y +CONFIG_X86_TSC=y +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y +CONFIG_X86_VERBOSE_BOOTUP=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_XZ_DEC_X86=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index f6cd62fc6..c7e7ed366 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_ACPI=y CONFIG_ACPI_AC=y @@ -17,7 +18,6 @@ CONFIG_ACPI_HOTPLUG_CPU=y CONFIG_ACPI_HOTPLUG_IOAPIC=y # CONFIG_ACPI_I2C_OPREGION is not set CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set @@ -44,15 +44,13 @@ CONFIG_AGP_INTEL=y # CONFIG_APM is not set CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_BACKLIGHT_CLASS_DEVICE=y CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set +CONFIG_BLK_MQ_VIRTIO=y # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_COMMON_CLK=y CONFIG_CONNECTOR=y # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set CONFIG_CPU_IDLE_GOV_MENU=y @@ -74,18 +72,30 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set CONFIG_DRM_I915=y +# CONFIG_DRM_I915_ALPHA_SUPPORT is not set +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y # CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set # CONFIG_DRM_I915_GVT is not set +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set +# CONFIG_DRM_I915_SELFTEST is not set +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set CONFIG_DRM_I915_USERPTR=y # CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_RADEON=y # CONFIG_DRM_RADEON_USERPTR is not set CONFIG_DRM_TTM=y @@ -97,6 +107,8 @@ CONFIG_EFI=y CONFIG_EFIVAR_FS=m # CONFIG_EFI_BOOTLOADER_CONTROL is not set # CONFIG_EFI_CAPSULE_LOADER is not set +# CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set CONFIG_EFI_ESRT=y # CONFIG_EFI_FAKE_MEMMAP is not set # CONFIG_EFI_PGT_DUMP is not set @@ -116,6 +128,7 @@ CONFIG_FB_DEFERRED_IO=y CONFIG_FB_EFI=y CONFIG_FB_HYPERV=y # CONFIG_FB_I810 is not set +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y @@ -129,6 +142,8 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_FREEZER=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GENERIC_IRQ_MIGRATION=y CONFIG_GENERIC_PENDING_IRQ=y CONFIG_GENERIC_PINCONF=y CONFIG_GPIOLIB=y @@ -137,16 +152,8 @@ CONFIG_GPIOLIB_IRQCHIP=y # CONFIG_GPIO_104_IDIO_16 is not set # CONFIG_GPIO_104_IDI_48 is not set CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_F7188X is not set -# CONFIG_GPIO_GPIO_MM is not set -# CONFIG_GPIO_IT87 is not set -# CONFIG_GPIO_LYNXPOINT is not set -# CONFIG_GPIO_WS16C48 is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y CONFIG_HAVE_KVM_EVENTFD=y CONFIG_HAVE_KVM_IRQCHIP=y @@ -176,6 +183,7 @@ CONFIG_HVC_IRQ=y CONFIG_HVC_XEN=y CONFIG_HVC_XEN_FRONTEND=y CONFIG_HWMON=y +CONFIG_HWMON_VID=y CONFIG_HW_RANDOM_VIRTIO=y CONFIG_HYPERV=y CONFIG_HYPERVISOR_GUEST=y @@ -195,9 +203,14 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y CONFIG_INTEL_GTT=y CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set +CONFIG_INTEL_PCH_THERMAL=y # CONFIG_INTEL_PMC_IPC is not set +CONFIG_INTEL_SOC_DTS_IOSF_CORE=y +CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_INTERVAL_TREE=y CONFIG_IOSF_MBI=y # CONFIG_IOSF_MBI_DEBUG is not set @@ -247,7 +260,9 @@ CONFIG_MOUSE_PS2_ALPS=y # CONFIG_MOUSE_PS2_ELANTECH is not set CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y # CONFIG_MOUSE_PS2_TOUCHKIT is not set CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_PS2_VMMOUSE is not set @@ -279,8 +294,12 @@ CONFIG_PCI_XEN=y CONFIG_PINCTRL=y CONFIG_PINCTRL_BAYTRAIL=y CONFIG_PINCTRL_BROXTON=y +CONFIG_PINCTRL_CANNONLAKE=y CONFIG_PINCTRL_CHERRYVIEW=y +CONFIG_PINCTRL_DENVERTON=y +CONFIG_PINCTRL_GEMINILAKE=y CONFIG_PINCTRL_INTEL=y +# CONFIG_PINCTRL_LEWISBURG is not set CONFIG_PINCTRL_SUNRISEPOINT=y CONFIG_PM=y # CONFIG_PMIC_OPREGION is not set @@ -299,11 +318,13 @@ CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y # CONFIG_RANDOMIZE_BASE is not set CONFIG_RAS=y -CONFIG_RATIONAL=y +CONFIG_RCU_NEED_SEGCBLIST=y CONFIG_RCU_STALL_COMMON=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y +# CONFIG_RELAY is not set CONFIG_RELOCATABLE=y +CONFIG_RESET_ATTACK_MITIGATION=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y CONFIG_RTC_I2C_AND_SPI=y @@ -313,19 +334,32 @@ CONFIG_SATA_AHCI=y CONFIG_SATA_VIA=y CONFIG_SCHED_INFO=y CONFIG_SCSI_VIRTIO=y +CONFIG_SENSORS_CORETEMP=y +CONFIG_SENSORS_FAM15H_POWER=y +CONFIG_SENSORS_I5500=y +CONFIG_SENSORS_K10TEMP=y +CONFIG_SENSORS_K8TEMP=y +CONFIG_SENSORS_VIA_CPUTEMP=y CONFIG_SERIAL_8250_PNP=y CONFIG_SMP=y # CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB_XEN=y +# CONFIG_SW_SYNC is not set +# CONFIG_SYNC_FILE is not set CONFIG_SYS_HYPERVISOR=y CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_HWMON=y +CONFIG_THERMAL_WRITABLE_TRIPS=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y CONFIG_UCS2_STRING=y CONFIG_USB_STORAGE=y CONFIG_USER_RETURN_NOTIFIER=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VHOST=y CONFIG_VHOST_NET=y @@ -349,6 +383,7 @@ CONFIG_X86_AMD_FREQ_SENSITIVITY=y # CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_BIGSMP is not set CONFIG_X86_CMOV=y +CONFIG_X86_CPUID=y CONFIG_X86_DEBUGCTLMSR=y # CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_INTEL_LPSS=y @@ -358,6 +393,7 @@ CONFIG_X86_L1_CACHE_SHIFT=7 # CONFIG_X86_LONGHAUL is not set CONFIG_X86_NEED_RELOCS=y # CONFIG_X86_PCC_CPUFREQ is not set +CONFIG_X86_PKG_TEMP_THERMAL=y # CONFIG_X86_PMEM_LEGACY is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set @@ -382,7 +418,11 @@ CONFIG_XEN_HAVE_VPMU=y CONFIG_XEN_NETDEV_FRONTEND=y CONFIG_XEN_PCIDEV_FRONTEND=y CONFIG_XEN_PRIVCMD=y +CONFIG_XEN_PV=y +CONFIG_XEN_PVH=y CONFIG_XEN_PVHVM=y +CONFIG_XEN_PVHVM_SMP=y +CONFIG_XEN_PV_SMP=y CONFIG_XEN_SAVE_RESTORE=y CONFIG_XEN_SCRUB_PAGES=y CONFIG_XEN_SCSI_FRONTEND=y @@ -391,3 +431,4 @@ CONFIG_XEN_SYS_HYPERVISOR=y CONFIG_XEN_WDT=y CONFIG_XEN_XENBUS_FRONTEND=y CONFIG_XPS=y +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default index 69d31b00a..446f7d275 100644 --- a/target/linux/x86/geode/config-default +++ b/target/linux/x86/geode/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_8139CP=y CONFIG_8139TOO=y @@ -40,6 +41,7 @@ CONFIG_CS5535_MFGPT=y CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 # CONFIG_DPTF_POWER is not set # CONFIG_EBC_C384_WDT is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set # CONFIG_EISA is not set # CONFIG_EL3 is not set CONFIG_GEODE_WDT=y @@ -69,9 +71,11 @@ CONFIG_I2C_ALGOBIT=y CONFIG_I2C_ALGOPCA=y CONFIG_I2C_ALGOPCF=y CONFIG_I2C_BOARDINFO=y +# CONFIG_INTEL_INT0002_VGPIO is not set # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_ISA=y # CONFIG_ISAPNP is not set CONFIG_ISA_BUS_API=y @@ -116,9 +120,10 @@ CONFIG_SENSORS_LM90=y CONFIG_SERIAL_8250_PNP=y # CONFIG_SURFACE_PRO3_BUTTON is not set # CONFIG_TOSHIBA_BT_RFKILL is not set -CONFIG_USB_OHCI_HCD_PCI=y # CONFIG_USB_UHCI_HCD is not set +CONFIG_USB_OHCI_HCD_PCI=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 CONFIG_VIA_RHINE=y CONFIG_VIA_RHINE_MMIO=y diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default index 3e0b06525..a438eedd8 100644 --- a/target/linux/x86/legacy/config-default +++ b/target/linux/x86/legacy/config-default @@ -1,3 +1,4 @@ +# CONFIG_104_QUAD_8 is not set # CONFIG_3C515 is not set CONFIG_ACPI=y CONFIG_ACPI_AC=y @@ -45,8 +46,6 @@ CONFIG_BACKLIGHT_GENERIC=y CONFIG_BACKLIGHT_LCD_SUPPORT=y CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set -CONFIG_CLKDEV_LOOKUP=y -CONFIG_COMMON_CLK=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_DMA_SHARED_BUFFER=y # CONFIG_DPTF_POWER is not set @@ -59,23 +58,36 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y +CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set CONFIG_DRM_I915=y +# CONFIG_DRM_I915_ALPHA_SUPPORT is not set +CONFIG_DRM_I915_CAPTURE_ERROR=y +CONFIG_DRM_I915_COMPRESS_ERROR=y # CONFIG_DRM_I915_DEBUG is not set +# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set # CONFIG_DRM_I915_GVT is not set +# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set +# CONFIG_DRM_I915_SELFTEST is not set # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set +# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set +# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set CONFIG_DRM_I915_USERPTR=y # CONFIG_DRM_I915_WERROR is not set CONFIG_DRM_KMS_FB_HELPER=y CONFIG_DRM_KMS_HELPER=y CONFIG_DRM_MIPI_DSI=y CONFIG_DRM_PANEL=y +CONFIG_DRM_PANEL_BRIDGE=y CONFIG_DRM_RADEON=y # CONFIG_DRM_RADEON_USERPTR is not set CONFIG_DRM_TTM=y # CONFIG_DRM_VMWGFX is not set # CONFIG_EBC_C384_WDT is not set +# CONFIG_EFI_DEV_PATH_PARSER is not set # CONFIG_EISA is not set # CONFIG_EL3 is not set CONFIG_FB=y @@ -85,6 +97,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_CMDLINE=y CONFIG_FB_DEFERRED_IO=y # CONFIG_FB_I810 is not set +# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set CONFIG_FB_SYS_COPYAREA=y CONFIG_FB_SYS_FILLRECT=y CONFIG_FB_SYS_FOPS=y @@ -99,8 +112,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y CONFIG_HDMI=y CONFIG_HID_BATTERY_STRENGTH=y # CONFIG_HIGHMEM64G is not set @@ -121,7 +132,10 @@ CONFIG_INTEL_IDLE=y # CONFIG_INTEL_IPS is not set # CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PMC_IPC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set CONFIG_INTERVAL_TREE=y +CONFIG_IOSF_MBI=y +# CONFIG_IOSF_MBI_DEBUG is not set CONFIG_ISA=y CONFIG_ISAPNP=y CONFIG_ISA_BUS_API=y @@ -146,7 +160,9 @@ CONFIG_MOUSE_PS2_ALPS=y # CONFIG_MOUSE_PS2_ELANTECH is not set CONFIG_MOUSE_PS2_LIFEBOOK=y CONFIG_MOUSE_PS2_LOGIPS2PP=y +CONFIG_MOUSE_PS2_SMBUS=y CONFIG_MOUSE_PS2_SYNAPTICS=y +CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y # CONFIG_MOUSE_PS2_TOUCHKIT is not set CONFIG_MOUSE_PS2_TRACKPOINT=y # CONFIG_MOUSE_SERIAL is not set @@ -175,17 +191,20 @@ CONFIG_PNPACPI=y CONFIG_PNP_DEBUG_MESSAGES=y # CONFIG_PVPANIC is not set CONFIG_RAS=y -CONFIG_RATIONAL=y CONFIG_REGMAP=y CONFIG_REGMAP_I2C=y +CONFIG_RELAY=y CONFIG_RTC_I2C_AND_SPI=y # CONFIG_SAMSUNG_Q10 is not set CONFIG_SATA_AHCI=y CONFIG_SERIAL_8250_PNP=y # CONFIG_SURFACE_PRO3_BUTTON is not set +# CONFIG_SW_SYNC is not set +CONFIG_SYNC_FILE=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_USB_STORAGE=y CONFIG_VGACON_SOFT_SCROLLBACK=y +# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 # CONFIG_WDT is not set CONFIG_X86_ACPI_CPUFREQ=y @@ -200,3 +219,4 @@ CONFIG_X86_MINIMUM_CPU_FAMILY=4 # CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K8 is not set +CONFIG_ZLIB_DEFLATE=y diff --git a/target/linux/x86/patches-4.14/011-tune_lzma_options.patch b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch new file mode 100644 index 000000000..daed310a1 --- /dev/null +++ b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch @@ -0,0 +1,22 @@ +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) + + quiet_cmd_lzma = LZMA $@ + cmd_lzma = (cat $(filter-out FORCE,$^) | \ +- lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ ++ lzma e -lc8 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ + (rm -f $@ ; false) + + quiet_cmd_lzo = LZO $@ +--- a/arch/x86/include/asm/boot.h ++++ b/arch/x86/include/asm/boot.h +@@ -24,7 +24,7 @@ + # error "Invalid value for CONFIG_PHYSICAL_ALIGN" + #endif + +-#ifdef CONFIG_KERNEL_BZIP2 ++#if defined(CONFIG_KERNEL_BZIP2) || defined(CONFIG_KERNEL_LZMA) + # define BOOT_HEAP_SIZE 0x400000 + #else /* !CONFIG_KERNEL_BZIP2 */ + # define BOOT_HEAP_SIZE 0x10000 diff --git a/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch new file mode 100644 index 000000000..c3a7fce9c --- /dev/null +++ b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch @@ -0,0 +1,12 @@ +--- a/drivers/clocksource/cs5535-clockevt.c ++++ b/drivers/clocksource/cs5535-clockevt.c +@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v + cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, + MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); + +- cs5535_clockevent.event_handler(&cs5535_clockevent); ++ if (cs5535_clockevent.event_handler) ++ cs5535_clockevent.event_handler(&cs5535_clockevent); + return IRQ_HANDLED; + } + diff --git a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch new file mode 100644 index 000000000..048dfae04 --- /dev/null +++ b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch @@ -0,0 +1,19 @@ +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -448,6 +448,16 @@ static const struct dmi_system_id reboot + }, + }, + ++ /* PC Engines */ ++ { /* Handle problems with rebooting on PC Engines apu2 */ ++ .callback = set_pci_reboot, ++ .ident = "PC Engines apu2", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), ++ }, ++ }, ++ + /* Sony */ + { /* Handle problems with rebooting on Sony VGN-Z540N */ + .callback = set_bios_reboot, diff --git a/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch new file mode 100644 index 000000000..ef2e1333e --- /dev/null +++ b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch @@ -0,0 +1,30 @@ +--- a/drivers/hwmon/w83627ehf.c ++++ b/drivers/hwmon/w83627ehf.c +@@ -2717,8 +2717,8 @@ static int __init w83627ehf_find(int sio + static const char sio_name_W83627UHG[] __initconst = "W83627UHG"; + static const char sio_name_W83667HG[] __initconst = "W83667HG"; + static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B"; +- static const char sio_name_NCT6775[] __initconst = "NCT6775F"; +- static const char sio_name_NCT6776[] __initconst = "NCT6776F"; ++/* static const char sio_name_NCT6775[] __initconst = "NCT6775F"; ++ static const char sio_name_NCT6776[] __initconst = "NCT6776F"; */ + + u16 val; + const char *sio_name; +@@ -2762,14 +2762,14 @@ static int __init w83627ehf_find(int sio + sio_data->kind = w83667hg_b; + sio_name = sio_name_W83667HG_B; + break; +- case SIO_NCT6775_ID: ++/* case SIO_NCT6775_ID: + sio_data->kind = nct6775; + sio_name = sio_name_NCT6775; + break; + case SIO_NCT6776_ID: + sio_data->kind = nct6776; + sio_name = sio_name_NCT6776; +- break; ++ break; */ + default: + if (val != 0xffff) + pr_debug("unsupported chip ID: 0x%04x\n", val); From d1c7890c220138553f0e4ba8a5d51096a5ed133a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 19 Dec 2017 15:25:36 +0800 Subject: [PATCH 41/95] x86:Add support for kernel 4.14 and new toolchain --- 0027-x86-Add-support-for-kernel-4.14.patch | 1233 ----------------- include/kernel-version.mk | 2 +- include/target.mk | 2 +- package/kernel/kmod-sched-cake/Makefile | 6 +- package/kernel/linux/modules/block.mk | 13 +- package/kernel/linux/modules/crypto.mk | 61 +- package/kernel/linux/modules/fs.mk | 5 +- package/kernel/linux/modules/i2c.mk | 26 + package/kernel/linux/modules/iio.mk | 120 ++ package/kernel/linux/modules/lib.mk | 32 +- package/kernel/linux/modules/netdevices.mk | 40 +- package/kernel/linux/modules/netfilter.mk | 17 + package/kernel/linux/modules/netsupport.mk | 28 +- package/kernel/linux/modules/other.mk | 143 +- package/kernel/linux/modules/sound.mk | 3 +- package/kernel/linux/modules/usb.mk | 28 +- package/kernel/linux/modules/video.mk | 2 +- package/lean/automount/Makefile | 2 +- target/linux/x86/Makefile | 2 +- toolchain-old/Config.in | 318 +++++ toolchain-old/Makefile | 97 ++ toolchain-old/binutils/Config.in | 32 + toolchain-old/binutils/Config.version | 16 + toolchain-old/binutils/Makefile | 112 ++ .../001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch | 36 + .../2.27/300-001_ld_makefile_patch.patch | 22 + .../2.27/300-012_check_ldrunpath_length.patch | 20 + .../400-mips_no_dynamic_linking_sym.patch | 18 + ...e-default-emulation-for-mips64-linux.patch | 37 + .../2.28/300-001_ld_makefile_patch.patch | 22 + .../2.28/300-012_check_ldrunpath_length.patch | 20 + .../400-mips_no_dynamic_linking_sym.patch | 18 + ...e-default-emulation-for-mips64-linux.patch | 37 + .../300-001_ld_makefile_patch.patch | 22 + .../300-012_check_ldrunpath_length.patch | 20 + toolchain-old/fortify-headers/Makefile | 28 + toolchain-old/gcc/Config.in | 78 ++ toolchain-old/gcc/Config.version | 14 + toolchain-old/gcc/common.mk | 228 +++ toolchain-old/gcc/exclude-testsuite | 9 + toolchain-old/gcc/files/alternate-arch-cc.in | 3 + toolchain-old/gcc/final/Makefile | 87 ++ toolchain-old/gcc/initial/Makefile | 36 + toolchain-old/gcc/minimal/Makefile | 29 + .../001-revert_register_mode_search.patch | 0 .../patches/5.4.0/002-case_insensitive.patch | 0 .../gcc/patches/5.4.0/010-documentation.patch | 0 .../patches/5.4.0/020-no-plt-backport.patch | 0 .../5.4.0/040-fix-mips-ICE-PR-68400.patch | 0 .../gcc/patches/5.4.0/200-musl_config.patch | 0 .../gcc/patches/5.4.0/201-musl_arm.patch | 0 .../gcc/patches/5.4.0/202-musl_mips.patch | 0 .../gcc/patches/5.4.0/203-musl_powerpc.patch | 0 .../gcc/patches/5.4.0/204-musl_sh.patch | 0 .../gcc/patches/5.4.0/205-musl_x86.patch | 0 .../gcc/patches/5.4.0/206-musl_aarch64.patch | 0 .../patches/5.4.0/207-musl_fixincludes.patch | 0 .../patches/5.4.0/209-musl_libstdc++.patch | 0 .../gcc/patches/5.4.0/230-musl_libssp.patch | 0 .../patches/5.4.0/240-musl-libitm-fixes.patch | 0 .../gcc/patches/5.4.0/250-add-musl.patch | 0 .../5.4.0/260-musl-add-unwind-fix.patch | 0 .../270-musl-add-powerpc-softfloat-fix.patch | 0 .../280-musl-disable-ifunc-by-default.patch | 0 .../300-mips_Os_cpu_rtx_cost_model.patch | 0 .../5.4.0/800-arm_v5te_no_ldrd_strd.patch | 0 .../5.4.0/810-arm-softfloat-libgcc.patch | 0 .../gcc/patches/5.4.0/820-libgcc_pic.patch | 0 .../5.4.0/830-arm_unbreak_armv4t.patch | 0 .../5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch | 0 .../patches/5.4.0/850-use_shared_libgcc.patch | 0 .../patches/5.4.0/851-libgcc_no_compat.patch | 0 .../patches/5.4.0/870-ppc_no_crtsavres.patch | 0 .../patches/5.4.0/880-no_java_section.patch | 0 .../gcc/patches/5.4.0/881-no_tm_section.patch | 0 .../patches/5.4.0/900-bad-mips16-crt.patch | 0 .../gcc/patches/5.4.0/910-mbsd_multi.patch | 0 .../5.4.0/920-specs_nonfatal_getenv.patch | 0 .../5.4.0/930-fix-mips-noexecstack.patch | 0 .../931-fix-MIPS-softfloat-build-issue.patch | 0 .../5.4.0/940-no-clobber-stamp-bits.patch | 0 .../5.4.0/950-cpp_file_path_translation.patch | 0 .../gcc/patches/5.4.0/960-go_libm.patch | 0 .../gcc/patches/5.4.0/970-warn_bug.patch | 0 .../001-revert_register_mode_search.patch | 65 + .../patches/6.3.0}/002-case_insensitive.patch | 0 .../gcc/patches/6.3.0/010-documentation.patch | 23 + .../gcc/patches/6.3.0/230-musl_libssp.patch | 13 + .../280-musl-disable-ifunc-by-default.patch | 36 + .../300-mips_Os_cpu_rtx_cost_model.patch | 11 + .../6.3.0/800-arm_v5te_no_ldrd_strd.patch | 11 + .../6.3.0/810-arm-softfloat-libgcc.patch | 25 + .../gcc/patches/6.3.0/820-libgcc_pic.patch | 36 + .../6.3.0/830-arm_unbreak_armv4t.patch | 13 + .../6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch | 19 + .../patches/6.3.0/850-use_shared_libgcc.patch | 47 + .../patches/6.3.0}/851-libgcc_no_compat.patch | 0 .../patches/6.3.0/870-ppc_no_crtsavres.patch | 11 + .../patches/6.3.0/880-no_java_section.patch | 11 + .../patches/6.3.0}/881-no_tm_section.patch | 0 .../patches/6.3.0}/900-bad-mips16-crt.patch | 0 .../gcc/patches/6.3.0/910-mbsd_multi.patch | 222 +++ .../6.3.0/920-specs_nonfatal_getenv.patch | 15 + .../6.3.0/930-fix-mips-noexecstack.patch | 111 ++ .../6.3.0/940-no-clobber-stamp-bits.patch | 11 + .../6.3.0/950-cpp_file_path_translation.patch | 182 +++ .../patches/6.3.0/960-fix-ubsan-defref.patch | 11 + .../001-revert_register_mode_search.patch | 0 .../patches/7.1.0/002-case_insensitive.patch | 14 + .../gcc/patches/7.1.0/010-documentation.patch | 0 .../gcc/patches/7.1.0/230-musl_libssp.patch | 0 .../300-mips_Os_cpu_rtx_cost_model.patch | 0 .../7.1.0/800-arm_v5te_no_ldrd_strd.patch | 0 .../7.1.0/810-arm-softfloat-libgcc.patch | 0 .../gcc/patches/7.1.0/820-libgcc_pic.patch | 0 .../7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch | 0 .../patches/7.1.0/850-use_shared_libgcc.patch | 0 .../patches/7.1.0/851-libgcc_no_compat.patch | 12 + .../patches/7.1.0/870-ppc_no_crtsavres.patch | 0 .../gcc/patches/7.1.0/881-no_tm_section.patch | 11 + .../patches/7.1.0/900-bad-mips16-crt.patch | 9 + .../gcc/patches/7.1.0/910-mbsd_multi.patch | 0 .../7.1.0/920-specs_nonfatal_getenv.patch | 0 .../7.1.0/930-fix-mips-noexecstack.patch | 0 .../7.1.0/940-no-clobber-stamp-bits.patch | 0 .../7.1.0/950-cpp_file_path_translation.patch | 0 .../001-revert_register_mode_search.patch | 65 + .../002-case_insensitive.patch | 14 + .../010-documentation.patch | 23 + .../arc-2017.03-release/230-musl_libssp.patch | 13 + .../280-musl-disable-ifunc-by-default.patch | 36 + .../300-mips_Os_cpu_rtx_cost_model.patch | 11 + .../800-arm_v5te_no_ldrd_strd.patch | 11 + .../810-arm-softfloat-libgcc.patch | 25 + .../arc-2017.03-release/820-libgcc_pic.patch | 36 + .../830-arm_unbreak_armv4t.patch | 13 + .../840-armv4_pass_fix-v4bx_to_ld.patch | 19 + .../850-use_shared_libgcc.patch | 47 + .../851-libgcc_no_compat.patch | 12 + .../870-ppc_no_crtsavres.patch | 11 + .../880-no_java_section.patch | 11 + .../881-no_tm_section.patch | 11 + .../900-bad-mips16-crt.patch | 9 + .../arc-2017.03-release/910-mbsd_multi.patch | 222 +++ .../920-specs_nonfatal_getenv.patch | 15 + .../930-fix-mips-noexecstack.patch | 111 ++ .../940-no-clobber-stamp-bits.patch | 11 + .../950-cpp_file_path_translation.patch | 182 +++ toolchain-old/gdb/Makefile | 68 + .../patches-arc/100-no_extern_inline.patch | 32 + .../gdb/patches-arc/110-no_testsuite.patch | 21 + .../120-fix-compile-flag-mismatch.patch | 11 + .../gdb/patches/100-no_extern_inline.patch | 32 + .../gdb/patches/110-no_testsuite.patch | 21 + .../120-fix-compile-flag-mismatch.patch | 11 + toolchain-old/glibc/Makefile | 32 + toolchain-old/glibc/common.mk | 94 ++ toolchain-old/glibc/headers/Makefile | 28 + toolchain-old/glibc/include/libintl.h | 6 + .../glibc/patches/100-fix_cross_rpcgen.patch | 52 + .../patches/200-add-dl-search-paths.patch | 14 + toolchain-old/info.mk | 6 + toolchain-old/kernel-headers/Makefile | 102 ++ toolchain-old/musl/Makefile | 31 + toolchain-old/musl/common.mk | 62 + toolchain-old/musl/include/bits/wordsize.h | 1 + toolchain-old/musl/include/features.h | 48 + toolchain-old/musl/include/sgidefs.h | 73 + toolchain-old/musl/include/sys/cdefs.h | 378 +++++ toolchain-old/musl/include/sys/glibc-types.h | 35 + toolchain-old/musl/include/sys/queue.h | 574 ++++++++ .../musl/patches/100-add_glob_onlydir.patch | 11 + .../patches/110-read_timezone_from_fs.patch | 28 + .../patches/200-add_libssp_nonshared.patch | 50 + toolchain-old/musl/patches/300-relative.patch | 11 + ...ribute-to-some-function-declarations.patch | 197 +++ .../musl/patches/900-iconv_size_hack.patch | 68 + .../musl/patches/901-crypt_size_hack.patch | 60 + toolchain-old/uClibc/Config.in | 6 + toolchain-old/uClibc/Makefile | 37 + toolchain-old/uClibc/common.mk | 97 ++ toolchain-old/uClibc/config/arc | 10 + toolchain-old/uClibc/config/archs | 10 + toolchain-old/uClibc/config/arm | 9 + toolchain-old/uClibc/config/armeb | 9 + toolchain-old/uClibc/config/common | 226 +++ toolchain-old/uClibc/config/debug | 6 + toolchain-old/uClibc/config/i386 | 21 + toolchain-old/uClibc/config/i686 | 21 + toolchain-old/uClibc/config/m68k | 6 + toolchain-old/uClibc/config/mips | 18 + toolchain-old/uClibc/config/mips64 | 18 + toolchain-old/uClibc/config/mips64.32 | 19 + toolchain-old/uClibc/config/mips64.64 | 19 + toolchain-old/uClibc/config/mips64.n32 | 19 + toolchain-old/uClibc/config/mips64el | 18 + toolchain-old/uClibc/config/mips64el.32 | 19 + toolchain-old/uClibc/config/mips64el.64 | 19 + toolchain-old/uClibc/config/mips64el.n32 | 19 + toolchain-old/uClibc/config/mipsel | 18 + toolchain-old/uClibc/config/mipsel.cobalt | 18 + toolchain-old/uClibc/config/powerpc | 6 + toolchain-old/uClibc/config/powerpc.e500 | 6 + toolchain-old/uClibc/config/sparc | 8 + toolchain-old/uClibc/config/sparc.leon | 8 + toolchain-old/uClibc/config/x86_64 | 6 + toolchain-old/uClibc/headers/Makefile | 27 + toolchain-old/uClibc/utils/Makefile | 24 + toolchain-old/wrapper/Makefile | 62 + toolchain-old/yasm/Makefile | 63 + toolchain/Config.in | 11 +- toolchain/binutils/Config.in | 5 + toolchain/binutils/Config.version | 4 + toolchain/binutils/Makefile | 4 + .../2.29.1/300-001_ld_makefile_patch.patch | 22 + .../300-012_check_ldrunpath_length.patch | 20 + .../400-mips_no_dynamic_linking_sym.patch | 18 + ...e-default-emulation-for-mips64-linux.patch | 37 + toolchain/fortify-headers/Makefile | 4 +- toolchain/gcc/Config.in | 8 - toolchain/gcc/Config.version | 4 +- toolchain/gcc/common.mk | 18 +- .../001-revert_register_mode_search.patch | 65 + .../patches/5.5.0/002-case_insensitive.patch | 14 + .../gcc/patches/5.5.0/010-documentation.patch | 23 + .../patches/5.5.0/020-no-plt-backport.patch | 28 + .../5.5.0/040-fix-mips-ICE-PR-68400.patch | 23 + .../gcc/patches/5.5.0/200-musl_config.patch | 309 +++++ .../gcc/patches/5.5.0/201-musl_arm.patch | 43 + .../gcc/patches/5.5.0/202-musl_mips.patch | 35 + .../gcc/patches/5.5.0/203-musl_powerpc.patch | 209 +++ toolchain/gcc/patches/5.5.0/204-musl_sh.patch | 39 + .../gcc/patches/5.5.0/205-musl_x86.patch | 41 + .../gcc/patches/5.5.0/206-musl_aarch64.patch | 31 + .../patches/5.5.0/207-musl_fixincludes.patch | 30 + .../patches/5.5.0/209-musl_libstdc++.patch | 72 + .../gcc/patches/5.5.0/230-musl_libssp.patch | 13 + .../patches/5.5.0/240-musl-libitm-fixes.patch | 61 + .../gcc/patches/5.5.0/250-add-musl.patch | 120 ++ .../5.5.0/260-musl-add-unwind-fix.patch | 34 + .../270-musl-add-powerpc-softfloat-fix.patch | 24 + .../280-musl-disable-ifunc-by-default.patch | 36 + .../300-mips_Os_cpu_rtx_cost_model.patch | 14 + .../5.5.0/800-arm_v5te_no_ldrd_strd.patch | 11 + .../5.5.0/810-arm-softfloat-libgcc.patch | 25 + .../gcc/patches/5.5.0/820-libgcc_pic.patch | 36 + .../5.5.0/830-arm_unbreak_armv4t.patch | 13 + .../5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch | 19 + .../patches/5.5.0/850-use_shared_libgcc.patch | 47 + .../patches/5.5.0/851-libgcc_no_compat.patch | 12 + .../patches/5.5.0/870-ppc_no_crtsavres.patch | 11 + .../patches/5.5.0/880-no_java_section.patch | 11 + .../gcc/patches/5.5.0/881-no_tm_section.patch | 11 + .../patches/5.5.0/900-bad-mips16-crt.patch | 9 + .../gcc/patches/5.5.0/910-mbsd_multi.patch | 222 +++ .../5.5.0/920-specs_nonfatal_getenv.patch | 15 + .../5.5.0/930-fix-mips-noexecstack.patch | 111 ++ .../931-fix-MIPS-softfloat-build-issue.patch | 167 +++ .../5.5.0/940-no-clobber-stamp-bits.patch | 11 + .../5.5.0/950-cpp_file_path_translation.patch | 182 +++ toolchain/gcc/patches/5.5.0/960-go_libm.patch | 11 + .../gcc/patches/5.5.0/970-warn_bug.patch | 11 + .../001-revert_register_mode_search.patch | 77 + .../patches/7.2.0/002-case_insensitive.patch | 24 + .../gcc/patches/7.2.0/010-documentation.patch | 35 + .../gcc/patches/7.2.0/230-musl_libssp.patch | 28 + .../300-mips_Os_cpu_rtx_cost_model.patch | 21 + .../7.2.0/800-arm_v5te_no_ldrd_strd.patch | 32 + .../7.2.0/810-arm-softfloat-libgcc.patch | 33 + .../gcc/patches/7.2.0/820-libgcc_pic.patch | 44 + .../7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch | 28 + .../patches/7.2.0/850-use_shared_libgcc.patch | 54 + .../patches/7.2.0/851-libgcc_no_compat.patch | 22 + .../patches/7.2.0/870-ppc_no_crtsavres.patch | 18 + .../gcc/patches/7.2.0/881-no_tm_section.patch | 22 + .../patches/7.2.0/900-bad-mips16-crt.patch | 30 + .../gcc/patches/7.2.0/910-mbsd_multi.patch | 146 ++ .../7.2.0/920-specs_nonfatal_getenv.patch | 22 + .../7.2.0/930-fix-mips-noexecstack.patch | 111 ++ .../7.2.0/940-no-clobber-stamp-bits.patch | 33 + .../7.2.0/950-cpp_file_path_translation.patch | 181 +++ toolchain/gdb/Makefile | 4 +- toolchain/gdb/patches/110-no_testsuite.patch | 4 +- .../120-fix-compile-flag-mismatch.patch | 2 +- toolchain/glibc/common.mk | 4 +- toolchain/kernel-headers/Makefile | 8 +- toolchain/musl/common.mk | 6 +- .../musl/patches/900-iconv_size_hack.patch | 72 +- 288 files changed, 9999 insertions(+), 1396 deletions(-) delete mode 100644 0027-x86-Add-support-for-kernel-4.14.patch create mode 100644 package/kernel/linux/modules/iio.mk create mode 100644 toolchain-old/Config.in create mode 100644 toolchain-old/Makefile create mode 100644 toolchain-old/binutils/Config.in create mode 100644 toolchain-old/binutils/Config.version create mode 100644 toolchain-old/binutils/Makefile create mode 100644 toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch create mode 100644 toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch create mode 100644 toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch create mode 100644 toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch create mode 100644 toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch create mode 100644 toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch create mode 100644 toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch create mode 100644 toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch create mode 100644 toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch create mode 100644 toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch create mode 100644 toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch create mode 100644 toolchain-old/fortify-headers/Makefile create mode 100644 toolchain-old/gcc/Config.in create mode 100644 toolchain-old/gcc/Config.version create mode 100644 toolchain-old/gcc/common.mk create mode 100644 toolchain-old/gcc/exclude-testsuite create mode 100644 toolchain-old/gcc/files/alternate-arch-cc.in create mode 100644 toolchain-old/gcc/final/Makefile create mode 100644 toolchain-old/gcc/initial/Makefile create mode 100644 toolchain-old/gcc/minimal/Makefile rename {toolchain => toolchain-old}/gcc/patches/5.4.0/001-revert_register_mode_search.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/002-case_insensitive.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/010-documentation.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/020-no-plt-backport.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/200-musl_config.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/201-musl_arm.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/202-musl_mips.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/203-musl_powerpc.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/204-musl_sh.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/205-musl_x86.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/206-musl_aarch64.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/207-musl_fixincludes.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/209-musl_libstdc++.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/230-musl_libssp.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/240-musl-libitm-fixes.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/250-add-musl.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/820-libgcc_pic.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/850-use_shared_libgcc.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/851-libgcc_no_compat.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/880-no_java_section.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/881-no_tm_section.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/900-bad-mips16-crt.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/910-mbsd_multi.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/950-cpp_file_path_translation.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/960-go_libm.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/5.4.0/970-warn_bug.patch (100%) create mode 100644 toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch rename {toolchain/gcc/patches/7.1.0 => toolchain-old/gcc/patches/6.3.0}/002-case_insensitive.patch (100%) create mode 100644 toolchain-old/gcc/patches/6.3.0/010-documentation.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch rename {toolchain/gcc/patches/7.1.0 => toolchain-old/gcc/patches/6.3.0}/851-libgcc_no_compat.patch (100%) create mode 100644 toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch rename {toolchain/gcc/patches/7.1.0 => toolchain-old/gcc/patches/6.3.0}/881-no_tm_section.patch (100%) rename {toolchain/gcc/patches/7.1.0 => toolchain-old/gcc/patches/6.3.0}/900-bad-mips16-crt.patch (100%) create mode 100644 toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch create mode 100644 toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch rename {toolchain => toolchain-old}/gcc/patches/7.1.0/001-revert_register_mode_search.patch (100%) create mode 100644 toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch rename {toolchain => toolchain-old}/gcc/patches/7.1.0/010-documentation.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/230-musl_libssp.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/820-libgcc_pic.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/850-use_shared_libgcc.patch (100%) create mode 100644 toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch rename {toolchain => toolchain-old}/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch (100%) create mode 100644 toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch create mode 100644 toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch rename {toolchain => toolchain-old}/gcc/patches/7.1.0/910-mbsd_multi.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch (100%) rename {toolchain => toolchain-old}/gcc/patches/7.1.0/950-cpp_file_path_translation.patch (100%) create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch create mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch create mode 100644 toolchain-old/gdb/Makefile create mode 100644 toolchain-old/gdb/patches-arc/100-no_extern_inline.patch create mode 100644 toolchain-old/gdb/patches-arc/110-no_testsuite.patch create mode 100644 toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch create mode 100644 toolchain-old/gdb/patches/100-no_extern_inline.patch create mode 100644 toolchain-old/gdb/patches/110-no_testsuite.patch create mode 100644 toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch create mode 100644 toolchain-old/glibc/Makefile create mode 100644 toolchain-old/glibc/common.mk create mode 100644 toolchain-old/glibc/headers/Makefile create mode 100644 toolchain-old/glibc/include/libintl.h create mode 100644 toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch create mode 100644 toolchain-old/glibc/patches/200-add-dl-search-paths.patch create mode 100644 toolchain-old/info.mk create mode 100644 toolchain-old/kernel-headers/Makefile create mode 100644 toolchain-old/musl/Makefile create mode 100644 toolchain-old/musl/common.mk create mode 100644 toolchain-old/musl/include/bits/wordsize.h create mode 100644 toolchain-old/musl/include/features.h create mode 100644 toolchain-old/musl/include/sgidefs.h create mode 100644 toolchain-old/musl/include/sys/cdefs.h create mode 100644 toolchain-old/musl/include/sys/glibc-types.h create mode 100644 toolchain-old/musl/include/sys/queue.h create mode 100644 toolchain-old/musl/patches/100-add_glob_onlydir.patch create mode 100644 toolchain-old/musl/patches/110-read_timezone_from_fs.patch create mode 100644 toolchain-old/musl/patches/200-add_libssp_nonshared.patch create mode 100644 toolchain-old/musl/patches/300-relative.patch create mode 100644 toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch create mode 100644 toolchain-old/musl/patches/900-iconv_size_hack.patch create mode 100644 toolchain-old/musl/patches/901-crypt_size_hack.patch create mode 100644 toolchain-old/uClibc/Config.in create mode 100644 toolchain-old/uClibc/Makefile create mode 100644 toolchain-old/uClibc/common.mk create mode 100644 toolchain-old/uClibc/config/arc create mode 100644 toolchain-old/uClibc/config/archs create mode 100644 toolchain-old/uClibc/config/arm create mode 100644 toolchain-old/uClibc/config/armeb create mode 100644 toolchain-old/uClibc/config/common create mode 100644 toolchain-old/uClibc/config/debug create mode 100644 toolchain-old/uClibc/config/i386 create mode 100644 toolchain-old/uClibc/config/i686 create mode 100644 toolchain-old/uClibc/config/m68k create mode 100644 toolchain-old/uClibc/config/mips create mode 100644 toolchain-old/uClibc/config/mips64 create mode 100644 toolchain-old/uClibc/config/mips64.32 create mode 100644 toolchain-old/uClibc/config/mips64.64 create mode 100644 toolchain-old/uClibc/config/mips64.n32 create mode 100644 toolchain-old/uClibc/config/mips64el create mode 100644 toolchain-old/uClibc/config/mips64el.32 create mode 100644 toolchain-old/uClibc/config/mips64el.64 create mode 100644 toolchain-old/uClibc/config/mips64el.n32 create mode 100644 toolchain-old/uClibc/config/mipsel create mode 100644 toolchain-old/uClibc/config/mipsel.cobalt create mode 100644 toolchain-old/uClibc/config/powerpc create mode 100644 toolchain-old/uClibc/config/powerpc.e500 create mode 100644 toolchain-old/uClibc/config/sparc create mode 100644 toolchain-old/uClibc/config/sparc.leon create mode 100644 toolchain-old/uClibc/config/x86_64 create mode 100644 toolchain-old/uClibc/headers/Makefile create mode 100644 toolchain-old/uClibc/utils/Makefile create mode 100644 toolchain-old/wrapper/Makefile create mode 100644 toolchain-old/yasm/Makefile create mode 100644 toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch create mode 100644 toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch create mode 100644 toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch create mode 100644 toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch create mode 100644 toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch create mode 100644 toolchain/gcc/patches/5.5.0/002-case_insensitive.patch create mode 100644 toolchain/gcc/patches/5.5.0/010-documentation.patch create mode 100644 toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch create mode 100644 toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch create mode 100644 toolchain/gcc/patches/5.5.0/200-musl_config.patch create mode 100644 toolchain/gcc/patches/5.5.0/201-musl_arm.patch create mode 100644 toolchain/gcc/patches/5.5.0/202-musl_mips.patch create mode 100644 toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch create mode 100644 toolchain/gcc/patches/5.5.0/204-musl_sh.patch create mode 100644 toolchain/gcc/patches/5.5.0/205-musl_x86.patch create mode 100644 toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch create mode 100644 toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch create mode 100644 toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch create mode 100644 toolchain/gcc/patches/5.5.0/230-musl_libssp.patch create mode 100644 toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch create mode 100644 toolchain/gcc/patches/5.5.0/250-add-musl.patch create mode 100644 toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch create mode 100644 toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch create mode 100644 toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch create mode 100644 toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch create mode 100644 toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch create mode 100644 toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch create mode 100644 toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch create mode 100644 toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch create mode 100644 toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch create mode 100644 toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch create mode 100644 toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch create mode 100644 toolchain/gcc/patches/5.5.0/880-no_java_section.patch create mode 100644 toolchain/gcc/patches/5.5.0/881-no_tm_section.patch create mode 100644 toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch create mode 100644 toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch create mode 100644 toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch create mode 100644 toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch create mode 100644 toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch create mode 100644 toolchain/gcc/patches/5.5.0/940-no-clobber-stamp-bits.patch create mode 100644 toolchain/gcc/patches/5.5.0/950-cpp_file_path_translation.patch create mode 100644 toolchain/gcc/patches/5.5.0/960-go_libm.patch create mode 100644 toolchain/gcc/patches/5.5.0/970-warn_bug.patch create mode 100644 toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch create mode 100644 toolchain/gcc/patches/7.2.0/002-case_insensitive.patch create mode 100644 toolchain/gcc/patches/7.2.0/010-documentation.patch create mode 100644 toolchain/gcc/patches/7.2.0/230-musl_libssp.patch create mode 100644 toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch create mode 100644 toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch create mode 100644 toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch create mode 100644 toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch create mode 100644 toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch create mode 100644 toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch create mode 100644 toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch create mode 100644 toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch create mode 100644 toolchain/gcc/patches/7.2.0/881-no_tm_section.patch create mode 100644 toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch create mode 100644 toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch create mode 100644 toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch create mode 100644 toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch create mode 100644 toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch create mode 100644 toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch diff --git a/0027-x86-Add-support-for-kernel-4.14.patch b/0027-x86-Add-support-for-kernel-4.14.patch deleted file mode 100644 index be38619e5..000000000 --- a/0027-x86-Add-support-for-kernel-4.14.patch +++ /dev/null @@ -1,1233 +0,0 @@ -From 481e1f23f5a178f44f6cf89e761ab51d1fc8d6ed Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 29 Oct 2017 19:34:13 +0100 -Subject: [PATCH 27/37] x86: Add support for kernel 4.14 - -This adds basic support for kernel 4.14, this was tested in qemu only. -The subtarget configuration was refresh with kernel 4.14 and the -options needed to make it compile on kernel 4.9 were added manually. - -Signed-off-by: Hauke Mehrtens ---- - target/linux/x86/64/config-default | 36 +- - target/linux/x86/config-4.14 | 525 +++++++++++++++++++++ - target/linux/x86/generic/config-default | 45 +- - target/linux/x86/geode/config-default | 7 +- - target/linux/x86/legacy/config-default | 30 +- - .../x86/patches-4.14/011-tune_lzma_options.patch | 22 + - .../x86/patches-4.14/100-fix_cs5535_clockevt.patch | 12 + - .../patches-4.14/200-pcengines-apu2-reboot.patch | 19 + - .../800-hwmon-w83627ehf-dont-claim-nct677x.patch | 30 ++ - 9 files changed, 710 insertions(+), 16 deletions(-) - create mode 100644 target/linux/x86/config-4.14 - create mode 100644 target/linux/x86/patches-4.14/011-tune_lzma_options.patch - create mode 100644 target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch - create mode 100644 target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch - create mode 100644 target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch - -diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default -index b6fee8b..55b69ce 100644 ---- a/target/linux/x86/64/config-default -+++ b/target/linux/x86/64/config-default -@@ -6,6 +6,7 @@ CONFIG_ACPI_BATTERY=y - CONFIG_ACPI_BUTTON=y - # CONFIG_ACPI_CMPC is not set - CONFIG_ACPI_CONTAINER=y -+CONFIG_ACPI_CPPC_LIB=y - CONFIG_ACPI_CPU_FREQ_PSS=y - # CONFIG_ACPI_CUSTOM_DSDT is not set - # CONFIG_ACPI_DEBUG is not set -@@ -30,9 +31,11 @@ CONFIG_ACPI_THERMAL=y - # CONFIG_ACPI_WMI is not set - CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" - CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y --CONFIG_ARCH_HAS_GIGANTIC_PAGE=y -+CONFIG_ARCH_HAS_ADD_PAGES=y - CONFIG_ARCH_HAS_KCOV=y - CONFIG_ARCH_HAS_PMEM_API=y -+CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE=y -+CONFIG_ARCH_HAS_ZONE_DEVICE=y - CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y - CONFIG_ARCH_MMAP_RND_BITS=28 - CONFIG_ARCH_MMAP_RND_BITS_MAX=32 -@@ -41,12 +44,13 @@ CONFIG_ARCH_SPARSEMEM_DEFAULT=y - CONFIG_ARCH_SUPPORTS_INT128=y - CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y - CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y --CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -+CONFIG_ARCH_WANTS_THP_SWAP=y - CONFIG_AUDIT_ARCH=y - CONFIG_BACKLIGHT_CLASS_DEVICE=y - CONFIG_BACKLIGHT_GENERIC=y - CONFIG_BACKLIGHT_LCD_SUPPORT=y - CONFIG_BLK_DEV_INTEGRITY=y -+CONFIG_BLK_MQ_VIRTIO=y - # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set - CONFIG_CALGARY_IOMMU=y - CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT=y -@@ -54,7 +58,6 @@ CONFIG_CONNECTOR=y - # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set - CONFIG_CPU_RMAP=y - CONFIG_CRC_T10DIF=y --CONFIG_CRYPTO_ABLK_HELPER=y - CONFIG_CRYPTO_AEAD=y - CONFIG_CRYPTO_AEAD2=y - CONFIG_CRYPTO_AES_NI_INTEL=y -@@ -88,6 +91,7 @@ CONFIG_CRYPTO_NULL2=y - # CONFIG_CRYPTO_SHA256_SSSE3 is not set - # CONFIG_CRYPTO_SHA512_MB is not set - # CONFIG_CRYPTO_SHA512_SSSE3 is not set -+CONFIG_CRYPTO_SIMD=y - # CONFIG_CRYPTO_SKEIN is not set - # CONFIG_CRYPTO_TWOFISH_AVX_X86_64 is not set - # CONFIG_CRYPTO_TWOFISH_X86_64 is not set -@@ -100,6 +104,7 @@ CONFIG_EFI=y - CONFIG_EFIVAR_FS=m - # CONFIG_EFI_BOOTLOADER_CONTROL is not set - # CONFIG_EFI_CAPSULE_LOADER is not set -+# CONFIG_EFI_DEV_PATH_PARSER is not set - CONFIG_EFI_ESRT=y - # CONFIG_EFI_FAKE_MEMMAP is not set - # CONFIG_EFI_MIXED is not set -@@ -118,6 +123,7 @@ CONFIG_FB_DEFERRED_IO=y - CONFIG_FB_EFI=y - CONFIG_FB_HYPERV=y - CONFIG_FB_MODE_HELPERS=y -+# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set - CONFIG_FB_SIMPLE=y - CONFIG_FB_SYS_COPYAREA=y - CONFIG_FB_SYS_FILLRECT=y -@@ -136,6 +142,8 @@ CONFIG_FREEZER=y - CONFIG_GART_IOMMU=y - CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y - CONFIG_GENERIC_CPU=y -+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -+CONFIG_GENERIC_IRQ_MIGRATION=y - CONFIG_GENERIC_PENDING_IRQ=y - CONFIG_GPIOLIB=y - CONFIG_GPIOLIB_IRQCHIP=y -@@ -145,10 +153,12 @@ CONFIG_GPIO_IT87=y - CONFIG_GPIO_LYNXPOINT=y - CONFIG_GPIO_SCH=y - CONFIG_GPIO_SYSFS=y -+CONFIG_HARDLOCKUP_CHECK_TIMESTAMP=y - CONFIG_HAVE_ACPI_APEI=y - CONFIG_HAVE_ACPI_APEI_NMI=y - # CONFIG_HAVE_AOUT is not set - CONFIG_HAVE_ARCH_SOFT_DIRTY=y -+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD=y - CONFIG_HAVE_ARCH_VMAP_STACK=y - CONFIG_HAVE_CONTEXT_TRACKING=y - CONFIG_HAVE_EBPF_JIT=y -@@ -188,7 +198,9 @@ CONFIG_HYPERV_BALLOON=y - CONFIG_HYPERV_KEYBOARD=y - CONFIG_HYPERV_NET=y - CONFIG_HYPERV_STORAGE=y -+CONFIG_HYPERV_TSCPAGE=y - CONFIG_HYPERV_UTILS=y -+# CONFIG_HYPERV_VSOCKETS is not set - CONFIG_I2C=y - CONFIG_I2C_BOARDINFO=y - # CONFIG_I7300_IDLE is not set -@@ -196,6 +208,7 @@ CONFIG_I2C_BOARDINFO=y - CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 - CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y - CONFIG_INTEL_IDLE=y -+# CONFIG_INTEL_INT0002_VGPIO is not set - # CONFIG_INTEL_IPS is not set - # CONFIG_INTEL_MENLOW is not set - # CONFIG_INTEL_MIC_BUS is not set -@@ -203,6 +216,7 @@ CONFIG_INTEL_PCH_THERMAL=y - # CONFIG_INTEL_PMC_IPC is not set - CONFIG_INTEL_SOC_DTS_IOSF_CORE=y - CONFIG_INTEL_SOC_DTS_THERMAL=y -+# CONFIG_INTEL_TURBO_MAX_3 is not set - # CONFIG_IOMMU_DEBUG is not set - CONFIG_IOSF_MBI=y - # CONFIG_IOSF_MBI_DEBUG is not set -@@ -218,6 +232,7 @@ CONFIG_LEGACY_VSYSCALL_NONE=y - CONFIG_LOCK_SPIN_ON_OWNER=y - CONFIG_LPC_ICH=y - CONFIG_LPC_SCH=y -+CONFIG_MAILBOX=y - # CONFIG_MAXSMP is not set - CONFIG_MEMORY_BALLOON=y - # CONFIG_MEMORY_HOTPLUG is not set -@@ -238,6 +253,7 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y - CONFIG_NET_FLOW_LIMIT=y - CONFIG_NR_CPUS=8 - # CONFIG_NUMA is not set -+# CONFIG_ORC_UNWINDER is not set - CONFIG_OUTPUT_FORMAT="elf64-x86-64" - CONFIG_PADATA=y - CONFIG_PARAVIRT=y -@@ -250,6 +266,7 @@ CONFIG_PATA_MPIIX=y - CONFIG_PATA_OLDPIIX=y - CONFIG_PATA_PLATFORM=y - CONFIG_PATA_VIA=y -+CONFIG_PCC=y - CONFIG_PCIEAER=y - CONFIG_PCIEPORTBUS=y - CONFIG_PCIE_PME=y -@@ -260,6 +277,7 @@ CONFIG_PGTABLE_LEVELS=4 - CONFIG_PHYSICAL_ALIGN=0x1000000 - CONFIG_PM=y - # CONFIG_PMIC_OPREGION is not set -+CONFIG_PM_CLK=y - # CONFIG_PM_DEBUG is not set - CONFIG_PM_SLEEP=y - CONFIG_PM_SLEEP_SMP=y -@@ -272,10 +290,12 @@ CONFIG_QUEUED_RWLOCKS=y - CONFIG_QUEUED_SPINLOCKS=y - # CONFIG_RANDOMIZE_BASE is not set - CONFIG_RAS=y -+CONFIG_RCU_NEED_SEGCBLIST=y - CONFIG_RCU_STALL_COMMON=y - CONFIG_REGMAP=y - CONFIG_REGMAP_I2C=y - CONFIG_RELOCATABLE=y -+CONFIG_RESET_ATTACK_MITIGATION=y - CONFIG_RFS_ACCEL=y - CONFIG_RPS=y - CONFIG_RTC_I2C_AND_SPI=y -@@ -283,6 +303,7 @@ CONFIG_RWSEM_SPIN_ON_OWNER=y - # CONFIG_SAMSUNG_Q10 is not set - CONFIG_SATA_AHCI=y - CONFIG_SCHED_MC=y -+CONFIG_SCHED_MC_PRIO=y - CONFIG_SCHED_SMT=y - # CONFIG_SCIF_BUS is not set - CONFIG_SCSI_VIRTIO=y -@@ -308,8 +329,8 @@ CONFIG_THERMAL_HWMON=y - CONFIG_THERMAL_WRITABLE_TRIPS=y - # CONFIG_TOSHIBA_BT_RFKILL is not set - CONFIG_TREE_RCU=y -+CONFIG_TREE_SRCU=y - CONFIG_UCS2_STRING=y --CONFIG_UCSI=y - # CONFIG_UNISYSSPAR is not set - CONFIG_USB_OHCI_HCD_PCI=y - CONFIG_USB_STORAGE=y -@@ -317,6 +338,7 @@ CONFIG_USB_XHCI_HCD=y - CONFIG_USB_XHCI_PCI=y - # CONFIG_USB_XHCI_PLATFORM is not set - CONFIG_VGACON_SOFT_SCROLLBACK=y -+# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set - CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 - CONFIG_VIRTIO=y - CONFIG_VIRTIO_BALLOON=y -@@ -339,6 +361,7 @@ CONFIG_VMXNET3=y - CONFIG_VSOCKETS=y - CONFIG_VT_CONSOLE_SLEEP=y - CONFIG_WATCHDOG_CORE=y -+# CONFIG_X86_5LEVEL is not set - CONFIG_X86_64=y - CONFIG_X86_64_SMP=y - CONFIG_X86_ACPI_CPUFREQ=y -@@ -352,6 +375,8 @@ CONFIG_X86_DEV_DMA_OPS=y - CONFIG_X86_DIRECT_GBPAGES=y - # CONFIG_X86_INTEL_LPSS is not set - # CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS is not set -+# CONFIG_X86_INTEL_MPX is not set -+CONFIG_X86_INTEL_PSTATE=y - CONFIG_X86_MINIMUM_CPU_FAMILY=64 - # CONFIG_X86_PCC_CPUFREQ is not set - CONFIG_X86_PKG_TEMP_THERMAL=y -@@ -384,8 +409,11 @@ CONFIG_XEN_HAVE_VPMU=y - CONFIG_XEN_NETDEV_FRONTEND=y - CONFIG_XEN_PCIDEV_FRONTEND=y - CONFIG_XEN_PRIVCMD=y -+CONFIG_XEN_PV=y - CONFIG_XEN_PVH=y - CONFIG_XEN_PVHVM=y -+CONFIG_XEN_PVHVM_SMP=y -+CONFIG_XEN_PV_SMP=y - CONFIG_XEN_SAVE_RESTORE=y - CONFIG_XEN_SCRUB_PAGES=y - CONFIG_XEN_SCSI_FRONTEND=y -diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 -new file mode 100644 -index 0000000..05af598 ---- /dev/null -+++ b/target/linux/x86/config-4.14 -@@ -0,0 +1,525 @@ -+# CONFIG_60XX_WDT is not set -+# CONFIG_64BIT is not set -+# CONFIG_ACPI is not set -+# CONFIG_ACQUIRE_WDT is not set -+# CONFIG_ADVANTECH_WDT is not set -+# CONFIG_ALIM1535_WDT is not set -+# CONFIG_ALIX is not set -+CONFIG_AMD_NB=y -+CONFIG_ARCH_CLOCKSOURCE_DATA=y -+CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig" -+CONFIG_ARCH_DISCARD_MEMBLOCK=y -+CONFIG_ARCH_DMA_ADDR_T_64BIT=y -+CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y -+CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -+CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y -+CONFIG_ARCH_HAS_CPU_RELAX=y -+CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y -+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -+CONFIG_ARCH_HAS_FAST_MULTIPLIER=y -+CONFIG_ARCH_HAS_FORTIFY_SOURCE=y -+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -+CONFIG_ARCH_HAS_MEM_ENCRYPT=y -+CONFIG_ARCH_HAS_SET_MEMORY=y -+CONFIG_ARCH_HAS_SG_CHAIN=y -+CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y -+CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y -+CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y -+CONFIG_ARCH_HIBERNATION_POSSIBLE=y -+CONFIG_ARCH_MAY_HAVE_PC_FDC=y -+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -+CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set -+# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set -+CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -+CONFIG_ARCH_RANDOM=y -+CONFIG_ARCH_SELECT_MEMORY_MODEL=y -+CONFIG_ARCH_SPARSEMEM_ENABLE=y -+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -+CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y -+CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y -+CONFIG_ARCH_SUPPORTS_MEMORY_FAILURE=y -+CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y -+CONFIG_ARCH_SUPPORTS_UPROBES=y -+CONFIG_ARCH_SUSPEND_POSSIBLE=y -+CONFIG_ARCH_USES_PG_UNCACHED=y -+CONFIG_ARCH_USE_BUILTIN_BSWAP=y -+CONFIG_ARCH_USE_QUEUED_RWLOCKS=y -+CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y -+CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y -+# CONFIG_ARCH_WANTS_THP_SWAP is not set -+CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y -+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -+CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y -+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -+CONFIG_ATA=y -+CONFIG_ATA_GENERIC=y -+CONFIG_ATA_PIIX=y -+CONFIG_BINFMT_MISC=y -+CONFIG_BLK_DEV_LOOP=y -+CONFIG_BLK_DEV_SD=y -+CONFIG_BLK_MQ_PCI=y -+CONFIG_BLK_SCSI_REQUEST=y -+CONFIG_BOUNCE=y -+CONFIG_BTT=y -+CONFIG_CLKBLD_I8253=y -+CONFIG_CLKDEV_LOOKUP=y -+CONFIG_CLKEVT_I8253=y -+CONFIG_CLKSRC_I8253=y -+CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y -+CONFIG_CLOCKSOURCE_WATCHDOG=y -+CONFIG_CLONE_BACKWARDS=y -+CONFIG_COMMON_CLK=y -+CONFIG_COMPAT_32=y -+# CONFIG_COMPAT_VDSO is not set -+CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 -+CONFIG_CONSOLE_TRANSLATIONS=y -+# CONFIG_CPU5_WDT is not set -+CONFIG_CPU_FREQ=y -+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y -+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set -+CONFIG_CPU_FREQ_GOV_ATTR_SET=y -+CONFIG_CPU_FREQ_GOV_COMMON=y -+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set -+CONFIG_CPU_FREQ_GOV_ONDEMAND=y -+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set -+# CONFIG_CPU_FREQ_GOV_USERSPACE is not set -+CONFIG_CPU_FREQ_STAT=y -+CONFIG_CPU_IDLE=y -+CONFIG_CPU_IDLE_GOV_LADDER=y -+CONFIG_CPU_SUP_AMD=y -+CONFIG_CPU_SUP_CENTAUR=y -+CONFIG_CPU_SUP_CYRIX_32=y -+CONFIG_CPU_SUP_INTEL=y -+CONFIG_CPU_SUP_TRANSMETA_32=y -+CONFIG_CPU_SUP_UMC_32=y -+# CONFIG_CRASHLOG is not set -+CONFIG_CRASH_CORE=y -+CONFIG_CRC16=y -+CONFIG_CRYPTO_AES_586=y -+CONFIG_CRYPTO_CRC32=y -+CONFIG_CRYPTO_CRC32C=y -+# CONFIG_CRYPTO_CRC32_PCLMUL is not set -+CONFIG_CRYPTO_HASH=y -+CONFIG_CRYPTO_HASH2=y -+CONFIG_CRYPTO_RNG2=y -+# CONFIG_CRYPTO_SERPENT_SSE2_586 is not set -+CONFIG_CRYPTO_WORKQUEUE=y -+# CONFIG_CX_ECAT is not set -+CONFIG_DCACHE_WORD_ACCESS=y -+# CONFIG_DCDBAS is not set -+# CONFIG_DEBUG_BOOT_PARAMS is not set -+# CONFIG_DEBUG_ENTRY is not set -+CONFIG_DEBUG_MEMORY_INIT=y -+# CONFIG_DEBUG_NMI_SELFTEST is not set -+# CONFIG_DEBUG_TLBFLUSH is not set -+# CONFIG_DEBUG_VIRTUAL is not set -+CONFIG_DECOMPRESS_BZIP2=y -+CONFIG_DECOMPRESS_GZIP=y -+CONFIG_DEFAULT_IO_DELAY_TYPE=0 -+# CONFIG_DELL_RBU is not set -+# CONFIG_DMA_NOOP_OPS is not set -+# CONFIG_DMA_VIRT_OPS is not set -+CONFIG_DMI=y -+CONFIG_DMIID=y -+CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y -+CONFIG_DMI_SYSFS=y -+CONFIG_DNOTIFY=y -+# CONFIG_DRM_LIB_RANDOM is not set -+CONFIG_DUMMY_CONSOLE=y -+CONFIG_EARLY_PRINTK=y -+# CONFIG_EARLY_PRINTK_DBGP is not set -+CONFIG_EDAC_ATOMIC_SCRUB=y -+CONFIG_EDAC_SUPPORT=y -+# CONFIG_EDD is not set -+# CONFIG_EUROTECH_WDT is not set -+CONFIG_EXPORTFS=y -+CONFIG_EXT4_FS=y -+# CONFIG_F2FS_CHECK_FS is not set -+CONFIG_F2FS_FS=y -+# CONFIG_F2FS_FS_SECURITY is not set -+CONFIG_F2FS_FS_XATTR=y -+CONFIG_F2FS_STAT_FS=y -+# CONFIG_F71808E_WDT is not set -+CONFIG_FIRMWARE_IN_KERNEL=y -+CONFIG_FIRMWARE_MEMMAP=y -+CONFIG_FIX_EARLYCON_MEM=y -+CONFIG_FRAME_POINTER=y -+CONFIG_FRAME_POINTER_UNWINDER=y -+CONFIG_FS_MBCACHE=y -+CONFIG_FUSION=y -+# CONFIG_FUSION_CTL is not set -+# CONFIG_FUSION_LOGGING is not set -+CONFIG_FUSION_MAX_SGE=128 -+CONFIG_FUSION_SPI=y -+CONFIG_FUTEX_PI=y -+CONFIG_GENERIC_ALLOCATOR=y -+CONFIG_GENERIC_BUG=y -+CONFIG_GENERIC_CLOCKEVENTS=y -+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -+CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y -+CONFIG_GENERIC_CMOS_UPDATE=y -+CONFIG_GENERIC_CPU_AUTOPROBE=y -+CONFIG_GENERIC_EARLY_IOREMAP=y -+CONFIG_GENERIC_FIND_FIRST_BIT=y -+CONFIG_GENERIC_IO=y -+CONFIG_GENERIC_IOMAP=y -+CONFIG_GENERIC_IRQ_SHOW=y -+CONFIG_GENERIC_ISA_DMA=y -+CONFIG_GENERIC_MSI_IRQ=y -+CONFIG_GENERIC_MSI_IRQ_DOMAIN=y -+CONFIG_GENERIC_PCI_IOMAP=y -+CONFIG_GENERIC_SMP_IDLE_THREAD=y -+CONFIG_GENERIC_STRNCPY_FROM_USER=y -+CONFIG_GENERIC_STRNLEN_USER=y -+CONFIG_GENERIC_TIME_VSYSCALL=y -+# CONFIG_GEOS is not set -+CONFIG_GLOB=y -+# CONFIG_GRO_CELLS is not set -+# CONFIG_GUESS_UNWINDER is not set -+# CONFIG_HANGCHECK_TIMER is not set -+CONFIG_HAS_DMA=y -+CONFIG_HAS_IOMEM=y -+CONFIG_HAS_IOPORT_MAP=y -+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -+CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y -+CONFIG_HAVE_AOUT=y -+CONFIG_HAVE_ARCH_AUDITSYSCALL=y -+# CONFIG_HAVE_ARCH_BITREVERSE is not set -+CONFIG_HAVE_ARCH_HUGE_VMAP=y -+CONFIG_HAVE_ARCH_JUMP_LABEL=y -+CONFIG_HAVE_ARCH_KGDB=y -+CONFIG_HAVE_ARCH_KMEMCHECK=y -+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -+CONFIG_HAVE_ARCH_TRACEHOOK=y -+CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -+CONFIG_HAVE_ATOMIC_IOMAP=y -+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -+CONFIG_HAVE_CC_STACKPROTECTOR=y -+CONFIG_HAVE_CLK=y -+CONFIG_HAVE_CLK_PREPARE=y -+CONFIG_HAVE_CMPXCHG_DOUBLE=y -+CONFIG_HAVE_CMPXCHG_LOCAL=y -+CONFIG_HAVE_COPY_THREAD_TLS=y -+CONFIG_HAVE_C_RECORDMCOUNT=y -+CONFIG_HAVE_DEBUG_KMEMLEAK=y -+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -+CONFIG_HAVE_DMA_API_DEBUG=y -+CONFIG_HAVE_DMA_CONTIGUOUS=y -+CONFIG_HAVE_DYNAMIC_FTRACE=y -+CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y -+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -+CONFIG_HAVE_FUNCTION_TRACER=y -+CONFIG_HAVE_GENERIC_DMA_COHERENT=y -+CONFIG_HAVE_GENERIC_GUP=y -+CONFIG_HAVE_HARDLOCKUP_DETECTOR_PERF=y -+CONFIG_HAVE_HW_BREAKPOINT=y -+CONFIG_HAVE_IDE=y -+CONFIG_HAVE_IOREMAP_PROT=y -+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -+CONFIG_HAVE_KPROBES_ON_FTRACE=y -+CONFIG_HAVE_KVM=y -+CONFIG_HAVE_MEMBLOCK=y -+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y -+CONFIG_HAVE_MIXED_BREAKPOINTS_REGS=y -+CONFIG_HAVE_MMIOTRACE_SUPPORT=y -+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -+CONFIG_HAVE_NET_DSA=y -+CONFIG_HAVE_OPROFILE=y -+CONFIG_HAVE_OPTPROBES=y -+CONFIG_HAVE_PCSPKR_PLATFORM=y -+CONFIG_HAVE_PERF_EVENTS=y -+CONFIG_HAVE_PERF_EVENTS_NMI=y -+CONFIG_HAVE_PERF_REGS=y -+CONFIG_HAVE_PERF_USER_STACK_DUMP=y -+CONFIG_HAVE_RCU_TABLE_FREE=y -+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -+CONFIG_HAVE_SETUP_PER_CPU_AREA=y -+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -+CONFIG_HAVE_UID16=y -+CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y -+CONFIG_HAVE_USER_RETURN_NOTIFIER=y -+CONFIG_HID=y -+CONFIG_HIGHMEM=y -+# CONFIG_HIGHMEM4G is not set -+CONFIG_HIGHMEM64G=y -+# CONFIG_HIGHPTE is not set -+CONFIG_HPET_EMULATE_RTC=y -+CONFIG_HPET_TIMER=y -+# CONFIG_HP_WATCHDOG is not set -+CONFIG_HT_IRQ=y -+# CONFIG_HUGETLBFS is not set -+CONFIG_HW_CONSOLE=y -+CONFIG_HW_RANDOM=y -+CONFIG_HW_RANDOM_GEODE=y -+CONFIG_HW_RANDOM_VIA=y -+# CONFIG_HYPERVISOR_GUEST is not set -+CONFIG_HZ_PERIODIC=y -+CONFIG_I8253_LOCK=y -+# CONFIG_I8K is not set -+# CONFIG_IB700_WDT is not set -+# CONFIG_IBMASR is not set -+# CONFIG_IBM_RTL is not set -+# CONFIG_IE6XX_WDT is not set -+CONFIG_ILLEGAL_POINTER_VALUE=0 -+CONFIG_INITRAMFS_SOURCE="" -+CONFIG_INPUT=y -+CONFIG_INPUT_KEYBOARD=y -+CONFIG_INSTRUCTION_DECODER=y -+# CONFIG_INTEL_PCH_THERMAL is not set -+# CONFIG_INTEL_POWERCLAMP is not set -+# CONFIG_INTEL_RDT is not set -+# CONFIG_INTEL_SOC_DTS_THERMAL is not set -+CONFIG_IOMMU_HELPER=y -+# CONFIG_IOMMU_STRESS is not set -+# CONFIG_IOSF_MBI is not set -+CONFIG_IO_DELAY_0X80=y -+# CONFIG_IO_DELAY_0XED is not set -+# CONFIG_IO_DELAY_NONE is not set -+CONFIG_IO_DELAY_TYPE_0X80=0 -+CONFIG_IO_DELAY_TYPE_0XED=1 -+CONFIG_IO_DELAY_TYPE_NONE=3 -+CONFIG_IO_DELAY_TYPE_UDELAY=2 -+# CONFIG_IO_DELAY_UDELAY is not set -+CONFIG_IRQ_DOMAIN=y -+CONFIG_IRQ_DOMAIN_HIERARCHY=y -+CONFIG_IRQ_FORCED_THREADING=y -+CONFIG_IRQ_WORK=y -+# CONFIG_ISA is not set -+CONFIG_ISA_DMA_API=y -+# CONFIG_IT8712F_WDT is not set -+# CONFIG_IT87_WDT is not set -+# CONFIG_ITCO_WDT is not set -+CONFIG_JBD2=y -+CONFIG_KALLSYMS=y -+CONFIG_KEXEC=y -+CONFIG_KEXEC_CORE=y -+CONFIG_KEYBOARD_ATKBD=y -+# CONFIG_LEDS_CLEVO_MAIL is not set -+CONFIG_LIBNVDIMM=y -+# CONFIG_M486 is not set -+# CONFIG_M586 is not set -+CONFIG_M586MMX=y -+# CONFIG_M586TSC is not set -+# CONFIG_M686 is not set -+# CONFIG_MACHZ_WDT is not set -+# CONFIG_MATOM is not set -+# CONFIG_MCORE2 is not set -+# CONFIG_MCRUSOE is not set -+# CONFIG_MCYRIXIII is not set -+# CONFIG_MDIO_BUS is not set -+# CONFIG_MEFFICEON is not set -+# CONFIG_MELAN is not set -+# CONFIG_MFD_INTEL_LPSS_PCI is not set -+# CONFIG_MGEODEGX1 is not set -+# CONFIG_MGEODE_LX is not set -+# CONFIG_MICROCODE is not set -+# CONFIG_MK6 is not set -+# CONFIG_MK7 is not set -+# CONFIG_MK8 is not set -+# CONFIG_MODIFY_LDT_SYSCALL is not set -+CONFIG_MODULES_TREE_LOOKUP=y -+CONFIG_MODULES_USE_ELF_REL=y -+# CONFIG_MPENTIUM4 is not set -+# CONFIG_MPENTIUMII is not set -+# CONFIG_MPENTIUMIII is not set -+# CONFIG_MPENTIUMM is not set -+# CONFIG_MTD is not set -+CONFIG_MTRR=y -+# CONFIG_MTRR_SANITIZER is not set -+# CONFIG_MVIAC3_2 is not set -+# CONFIG_MVIAC7 is not set -+# CONFIG_MWINCHIP3D is not set -+# CONFIG_MWINCHIPC6 is not set -+CONFIG_NAMESPACES=y -+CONFIG_ND_BLK=y -+CONFIG_ND_BTT=y -+CONFIG_ND_CLAIM=y -+CONFIG_NEED_DMA_MAP_STATE=y -+CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y -+CONFIG_NEED_PER_CPU_KM=y -+CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y -+CONFIG_NEED_SG_DMA_LENGTH=y -+# CONFIG_NET5501 is not set -+# CONFIG_NET_NS is not set -+CONFIG_NLS=y -+# CONFIG_NOHIGHMEM is not set -+CONFIG_NO_BOOTMEM=y -+CONFIG_NR_CPUS=1 -+# CONFIG_NSC_GPIO is not set -+CONFIG_NVRAM=y -+# CONFIG_OF is not set -+CONFIG_OLD_SIGACTION=y -+CONFIG_OLD_SIGSUSPEND3=y -+CONFIG_OPROFILE_NMI_TIMER=y -+# CONFIG_OPTIMIZE_INLINING is not set -+CONFIG_OUTPUT_FORMAT="elf32-i386" -+CONFIG_PAGE_OFFSET=0xC0000000 -+CONFIG_PC104=y -+# CONFIG_PC8736x_GPIO is not set -+# CONFIG_PC87413_WDT is not set -+CONFIG_PCI=y -+CONFIG_PCI_BIOS=y -+CONFIG_PCI_BUS_ADDR_T_64BIT=y -+CONFIG_PCI_DIRECT=y -+CONFIG_PCI_DOMAINS=y -+CONFIG_PCI_GOANY=y -+# CONFIG_PCI_GOBIOS is not set -+# CONFIG_PCI_GODIRECT is not set -+# CONFIG_PCI_GOMMCONFIG is not set -+CONFIG_PCI_LABEL=y -+CONFIG_PCI_LOCKLESS_CONFIG=y -+CONFIG_PCI_MSI=y -+CONFIG_PCI_MSI_IRQ_DOMAIN=y -+CONFIG_PCSPKR_PLATFORM=y -+CONFIG_PERF_EVENTS=y -+CONFIG_PERF_EVENTS_INTEL_CSTATE=y -+CONFIG_PERF_EVENTS_INTEL_RAPL=y -+CONFIG_PERF_EVENTS_INTEL_UNCORE=y -+CONFIG_PGTABLE_LEVELS=3 -+CONFIG_PHYSICAL_ALIGN=0x100000 -+CONFIG_PHYSICAL_START=0x1000000 -+CONFIG_PHYS_ADDR_T_64BIT=y -+CONFIG_PMC_ATOM=y -+CONFIG_POWER_SUPPLY=y -+CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 -+# CONFIG_PROCESSOR_SELECT is not set -+CONFIG_PROC_PAGE_MONITOR=y -+# CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set -+# CONFIG_PUNIT_ATOM_DEBUG is not set -+CONFIG_RATIONAL=y -+# CONFIG_RCU_NEED_SEGCBLIST is not set -+# CONFIG_RCU_STALL_COMMON is not set -+CONFIG_RD_BZIP2=y -+CONFIG_RD_GZIP=y -+CONFIG_RTC_CLASS=y -+CONFIG_RTC_MC146818_LIB=y -+CONFIG_RWSEM_XCHGADD_ALGORITHM=y -+# CONFIG_SBC7240_WDT is not set -+# CONFIG_SBC8360_WDT is not set -+# CONFIG_SBC_EPX_C3_WATCHDOG is not set -+# CONFIG_SC1200_WDT is not set -+# CONFIG_SCHED_INFO is not set -+CONFIG_SCSI=y -+CONFIG_SCSI_SPI_ATTRS=y -+CONFIG_SCx200=y -+CONFIG_SCx200HR_TIMER=y -+# CONFIG_SCx200_GPIO is not set -+# CONFIG_SCx200_WDT is not set -+# CONFIG_SERIAL_8250_FSL is not set -+CONFIG_SERIAL_8250_PCI=y -+CONFIG_SERIO=y -+CONFIG_SERIO_I8042=y -+CONFIG_SERIO_LIBPS2=y -+CONFIG_SERIO_SERPORT=y -+CONFIG_SG_POOL=y -+# CONFIG_SMSC37B787_WDT is not set -+# CONFIG_SMSC_SCH311X_WDT is not set -+CONFIG_SPARSEMEM_STATIC=y -+CONFIG_SPARSE_IRQ=y -+CONFIG_SRCU=y -+CONFIG_STRICT_KERNEL_RWX=y -+CONFIG_STRICT_MODULE_RWX=y -+CONFIG_SWIOTLB=y -+CONFIG_SYSCTL_EXCEPTION_TRACE=y -+# CONFIG_TELCLOCK is not set -+CONFIG_THERMAL=y -+CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -+CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 -+CONFIG_THERMAL_GOV_STEP_WISE=y -+CONFIG_THIN_ARCHIVES=y -+CONFIG_THREAD_INFO_IN_TASK=y -+CONFIG_TICK_CPU_ACCOUNTING=y -+CONFIG_TINY_SRCU=y -+# CONFIG_TOSHIBA is not set -+CONFIG_UP_LATE_INIT=y -+CONFIG_USB=y -+CONFIG_USB_COMMON=y -+CONFIG_USB_EHCI_HCD=y -+# CONFIG_USB_EHCI_HCD_PLATFORM is not set -+CONFIG_USB_EHCI_PCI=y -+CONFIG_USB_HID=y -+CONFIG_USB_HIDDEV=y -+CONFIG_USB_OHCI_HCD=y -+# CONFIG_USB_OHCI_HCD_PLATFORM is not set -+CONFIG_USB_PCI=y -+CONFIG_USB_SUPPORT=y -+# CONFIG_USB_UHCI_HCD is not set -+# CONFIG_USERIO is not set -+# CONFIG_USER_NS is not set -+CONFIG_USER_STACKTRACE_SUPPORT=y -+# CONFIG_VGACON_SOFT_SCROLLBACK is not set -+CONFIG_VGA_CONSOLE=y -+# CONFIG_VIA_WDT is not set -+# CONFIG_VM86 is not set -+# CONFIG_VMWARE_VMCI is not set -+CONFIG_VM_EVENT_COUNTERS=y -+CONFIG_VT=y -+CONFIG_VT_CONSOLE=y -+CONFIG_VT_HW_CONSOLE_BINDING=y -+# CONFIG_WAFER_WDT is not set -+CONFIG_X86=y -+CONFIG_X86_32=y -+# CONFIG_X86_32_IRIS is not set -+CONFIG_X86_32_LAZY_GS=y -+CONFIG_X86_ALIGNMENT_16=y -+# CONFIG_X86_ANCIENT_MCE is not set -+# CONFIG_X86_CHECK_BIOS_CORRUPTION is not set -+CONFIG_X86_CMPXCHG64=y -+# CONFIG_X86_CPUFREQ_NFORCE2 is not set -+# CONFIG_X86_CPUID is not set -+# CONFIG_X86_DEBUG_FPU is not set -+# CONFIG_X86_EXTENDED_PLATFORM is not set -+CONFIG_X86_F00F_BUG=y -+CONFIG_X86_FAST_FEATURE_TESTS=y -+CONFIG_X86_FEATURE_NAMES=y -+CONFIG_X86_GENERIC=y -+# CONFIG_X86_GX_SUSPMOD is not set -+# CONFIG_X86_INTEL_PSTATE is not set -+CONFIG_X86_INTEL_USERCOPY=y -+CONFIG_X86_INTERNODE_CACHE_SHIFT=6 -+CONFIG_X86_IO_APIC=y -+CONFIG_X86_L1_CACHE_SHIFT=6 -+# CONFIG_X86_LEGACY_VM86 is not set -+CONFIG_X86_LOCAL_APIC=y -+# CONFIG_X86_LONGRUN is not set -+CONFIG_X86_MCE=y -+# CONFIG_X86_MCELOG_LEGACY is not set -+CONFIG_X86_MCE_AMD=y -+# CONFIG_X86_MCE_INJECT is not set -+CONFIG_X86_MCE_INTEL=y -+CONFIG_X86_MCE_THRESHOLD=y -+CONFIG_X86_MINIMUM_CPU_FAMILY=5 -+CONFIG_X86_MPPARSE=y -+CONFIG_X86_MSR=y -+# CONFIG_X86_P4_CLOCKMOD is not set -+CONFIG_X86_PAE=y -+CONFIG_X86_PAT=y -+CONFIG_X86_PLATFORM_DEVICES=y -+CONFIG_X86_PMEM_LEGACY=y -+CONFIG_X86_PMEM_LEGACY_DEVICE=y -+# CONFIG_X86_POWERNOW_K6 is not set -+# CONFIG_X86_POWERNOW_K7 is not set -+CONFIG_X86_PPRO_FENCE=y -+# CONFIG_X86_PTDUMP is not set -+# CONFIG_X86_PTDUMP_CORE is not set -+# CONFIG_X86_REBOOTFIXUPS is not set -+CONFIG_X86_REROUTE_FOR_BROKEN_BOOT_IRQS=y -+CONFIG_X86_RESERVE_LOW=64 -+# CONFIG_X86_SMAP is not set -+# CONFIG_X86_SPEEDSTEP_CENTRINO is not set -+# CONFIG_X86_SPEEDSTEP_ICH is not set -+# CONFIG_X86_SPEEDSTEP_LIB is not set -+# CONFIG_X86_SPEEDSTEP_SMI is not set -+CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y -+CONFIG_X86_THERMAL_VECTOR=y -+CONFIG_X86_TSC=y -+CONFIG_X86_UP_APIC=y -+CONFIG_X86_UP_IOAPIC=y -+CONFIG_X86_VERBOSE_BOOTUP=y -+CONFIG_XZ_DEC_BCJ=y -+CONFIG_XZ_DEC_X86=y -+CONFIG_ZLIB_INFLATE=y -diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default -index f9893f4..c7e7ed3 100644 ---- a/target/linux/x86/generic/config-default -+++ b/target/linux/x86/generic/config-default -@@ -1,3 +1,4 @@ -+# CONFIG_104_QUAD_8 is not set - # CONFIG_3C515 is not set - CONFIG_ACPI=y - CONFIG_ACPI_AC=y -@@ -43,15 +44,13 @@ CONFIG_AGP_INTEL=y - # CONFIG_APM is not set - CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y - CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y --CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y - CONFIG_BACKLIGHT_CLASS_DEVICE=y - CONFIG_BACKLIGHT_GENERIC=y - CONFIG_BACKLIGHT_LCD_SUPPORT=y - CONFIG_BLK_DEV_SR=y - # CONFIG_BLK_DEV_SR_VENDOR is not set -+CONFIG_BLK_MQ_VIRTIO=y - # CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set --CONFIG_CLKDEV_LOOKUP=y --CONFIG_COMMON_CLK=y - CONFIG_CONNECTOR=y - # CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set - CONFIG_CPU_IDLE_GOV_MENU=y -@@ -73,18 +72,30 @@ CONFIG_DRM_AMDGPU=y - # CONFIG_DRM_AMD_ACP is not set - CONFIG_DRM_BOCHS=y - CONFIG_DRM_BRIDGE=y -+# CONFIG_DRM_DEBUG_MM is not set -+# CONFIG_DRM_DEBUG_MM_SELFTEST is not set - CONFIG_DRM_FBDEV_EMULATION=y -+CONFIG_DRM_FBDEV_OVERALLOC=100 - # CONFIG_DRM_GMA500 is not set - CONFIG_DRM_I915=y -+# CONFIG_DRM_I915_ALPHA_SUPPORT is not set -+CONFIG_DRM_I915_CAPTURE_ERROR=y -+CONFIG_DRM_I915_COMPRESS_ERROR=y - # CONFIG_DRM_I915_DEBUG is not set -+# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set - # CONFIG_DRM_I915_GVT is not set -+# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set - # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set -+# CONFIG_DRM_I915_SELFTEST is not set -+# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -+# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set - CONFIG_DRM_I915_USERPTR=y - # CONFIG_DRM_I915_WERROR is not set - CONFIG_DRM_KMS_FB_HELPER=y - CONFIG_DRM_KMS_HELPER=y - CONFIG_DRM_MIPI_DSI=y - CONFIG_DRM_PANEL=y -+CONFIG_DRM_PANEL_BRIDGE=y - CONFIG_DRM_RADEON=y - # CONFIG_DRM_RADEON_USERPTR is not set - CONFIG_DRM_TTM=y -@@ -96,6 +107,8 @@ CONFIG_EFI=y - CONFIG_EFIVAR_FS=m - # CONFIG_EFI_BOOTLOADER_CONTROL is not set - # CONFIG_EFI_CAPSULE_LOADER is not set -+# CONFIG_EFI_CAPSULE_QUIRK_QUARK_CSH is not set -+# CONFIG_EFI_DEV_PATH_PARSER is not set - CONFIG_EFI_ESRT=y - # CONFIG_EFI_FAKE_MEMMAP is not set - # CONFIG_EFI_PGT_DUMP is not set -@@ -115,6 +128,7 @@ CONFIG_FB_DEFERRED_IO=y - CONFIG_FB_EFI=y - CONFIG_FB_HYPERV=y - # CONFIG_FB_I810 is not set -+# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set - CONFIG_FB_SYS_COPYAREA=y - CONFIG_FB_SYS_FILLRECT=y - CONFIG_FB_SYS_FOPS=y -@@ -128,6 +142,8 @@ CONFIG_FRAMEBUFFER_CONSOLE=y - CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y - # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set - CONFIG_FREEZER=y -+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y -+CONFIG_GENERIC_IRQ_MIGRATION=y - CONFIG_GENERIC_PENDING_IRQ=y - CONFIG_GENERIC_PINCONF=y - CONFIG_GPIOLIB=y -@@ -138,8 +154,6 @@ CONFIG_GPIOLIB_IRQCHIP=y - CONFIG_GPIO_ACPI=y - CONFIG_HAVE_ACPI_APEI=y - CONFIG_HAVE_ACPI_APEI_NMI=y --CONFIG_HAVE_CLK=y --CONFIG_HAVE_CLK_PREPARE=y - CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y - CONFIG_HAVE_KVM_EVENTFD=y - CONFIG_HAVE_KVM_IRQCHIP=y -@@ -189,12 +203,14 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 - CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y - CONFIG_INTEL_GTT=y - CONFIG_INTEL_IDLE=y -+# CONFIG_INTEL_INT0002_VGPIO is not set - # CONFIG_INTEL_IPS is not set - # CONFIG_INTEL_MENLOW is not set - CONFIG_INTEL_PCH_THERMAL=y - # CONFIG_INTEL_PMC_IPC is not set - CONFIG_INTEL_SOC_DTS_IOSF_CORE=y - CONFIG_INTEL_SOC_DTS_THERMAL=y -+# CONFIG_INTEL_SOC_PMIC_CHTWC is not set - CONFIG_INTERVAL_TREE=y - CONFIG_IOSF_MBI=y - # CONFIG_IOSF_MBI_DEBUG is not set -@@ -244,7 +260,9 @@ CONFIG_MOUSE_PS2_ALPS=y - # CONFIG_MOUSE_PS2_ELANTECH is not set - CONFIG_MOUSE_PS2_LIFEBOOK=y - CONFIG_MOUSE_PS2_LOGIPS2PP=y -+CONFIG_MOUSE_PS2_SMBUS=y - CONFIG_MOUSE_PS2_SYNAPTICS=y -+CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y - # CONFIG_MOUSE_PS2_TOUCHKIT is not set - CONFIG_MOUSE_PS2_TRACKPOINT=y - # CONFIG_MOUSE_PS2_VMMOUSE is not set -@@ -276,8 +294,12 @@ CONFIG_PCI_XEN=y - CONFIG_PINCTRL=y - CONFIG_PINCTRL_BAYTRAIL=y - CONFIG_PINCTRL_BROXTON=y -+CONFIG_PINCTRL_CANNONLAKE=y - CONFIG_PINCTRL_CHERRYVIEW=y -+CONFIG_PINCTRL_DENVERTON=y -+CONFIG_PINCTRL_GEMINILAKE=y - CONFIG_PINCTRL_INTEL=y -+# CONFIG_PINCTRL_LEWISBURG is not set - CONFIG_PINCTRL_SUNRISEPOINT=y - CONFIG_PM=y - # CONFIG_PMIC_OPREGION is not set -@@ -296,11 +318,13 @@ CONFIG_QUEUED_RWLOCKS=y - CONFIG_QUEUED_SPINLOCKS=y - # CONFIG_RANDOMIZE_BASE is not set - CONFIG_RAS=y --CONFIG_RATIONAL=y -+CONFIG_RCU_NEED_SEGCBLIST=y - CONFIG_RCU_STALL_COMMON=y - CONFIG_REGMAP=y - CONFIG_REGMAP_I2C=y -+# CONFIG_RELAY is not set - CONFIG_RELOCATABLE=y -+CONFIG_RESET_ATTACK_MITIGATION=y - CONFIG_RFS_ACCEL=y - CONFIG_RPS=y - CONFIG_RTC_I2C_AND_SPI=y -@@ -320,6 +344,8 @@ CONFIG_SERIAL_8250_PNP=y - CONFIG_SMP=y - # CONFIG_SURFACE_PRO3_BUTTON is not set - CONFIG_SWIOTLB_XEN=y -+# CONFIG_SW_SYNC is not set -+# CONFIG_SYNC_FILE is not set - CONFIG_SYS_HYPERVISOR=y - CONFIG_TASKSTATS=y - CONFIG_TASK_DELAY_ACCT=y -@@ -328,10 +354,12 @@ CONFIG_THERMAL_HWMON=y - CONFIG_THERMAL_WRITABLE_TRIPS=y - # CONFIG_TOSHIBA_BT_RFKILL is not set - CONFIG_TREE_RCU=y -+CONFIG_TREE_SRCU=y - CONFIG_UCS2_STRING=y - CONFIG_USB_STORAGE=y - CONFIG_USER_RETURN_NOTIFIER=y - CONFIG_VGACON_SOFT_SCROLLBACK=y -+# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set - CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 - CONFIG_VHOST=y - CONFIG_VHOST_NET=y -@@ -390,7 +418,11 @@ CONFIG_XEN_HAVE_VPMU=y - CONFIG_XEN_NETDEV_FRONTEND=y - CONFIG_XEN_PCIDEV_FRONTEND=y - CONFIG_XEN_PRIVCMD=y -+CONFIG_XEN_PV=y -+CONFIG_XEN_PVH=y - CONFIG_XEN_PVHVM=y -+CONFIG_XEN_PVHVM_SMP=y -+CONFIG_XEN_PV_SMP=y - CONFIG_XEN_SAVE_RESTORE=y - CONFIG_XEN_SCRUB_PAGES=y - CONFIG_XEN_SCSI_FRONTEND=y -@@ -399,3 +431,4 @@ CONFIG_XEN_SYS_HYPERVISOR=y - CONFIG_XEN_WDT=y - CONFIG_XEN_XENBUS_FRONTEND=y - CONFIG_XPS=y -+CONFIG_ZLIB_DEFLATE=y -diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default -index daf397b..b564b94 100644 ---- a/target/linux/x86/geode/config-default -+++ b/target/linux/x86/geode/config-default -@@ -1,3 +1,4 @@ -+# CONFIG_104_QUAD_8 is not set - # CONFIG_3C515 is not set - CONFIG_8139CP=y - CONFIG_8139TOO=y -@@ -40,6 +41,7 @@ CONFIG_CS5535_MFGPT=y - CONFIG_CS5535_MFGPT_DEFAULT_IRQ=7 - # CONFIG_DPTF_POWER is not set - # CONFIG_EBC_C384_WDT is not set -+# CONFIG_EFI_DEV_PATH_PARSER is not set - # CONFIG_EISA is not set - # CONFIG_EL3 is not set - CONFIG_GEODE_WDT=y -@@ -63,9 +65,11 @@ CONFIG_I2C_ALGOBIT=y - CONFIG_I2C_ALGOPCA=y - CONFIG_I2C_ALGOPCF=y - CONFIG_I2C_BOARDINFO=y -+# CONFIG_INTEL_INT0002_VGPIO is not set - # CONFIG_INTEL_IPS is not set - # CONFIG_INTEL_MENLOW is not set - # CONFIG_INTEL_PMC_IPC is not set -+# CONFIG_INTEL_SOC_PMIC_CHTWC is not set - CONFIG_ISA=y - # CONFIG_ISAPNP is not set - CONFIG_ISA_BUS_API=y -@@ -110,9 +114,10 @@ CONFIG_SENSORS_LM90=y - CONFIG_SERIAL_8250_PNP=y - # CONFIG_SURFACE_PRO3_BUTTON is not set - # CONFIG_TOSHIBA_BT_RFKILL is not set --CONFIG_USB_OHCI_HCD_PCI=y - # CONFIG_USB_UHCI_HCD is not set -+CONFIG_USB_OHCI_HCD_PCI=y - CONFIG_VGACON_SOFT_SCROLLBACK=y -+# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set - CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 - CONFIG_VIA_RHINE=y - CONFIG_VIA_RHINE_MMIO=y -diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default -index 3e0b065..a438eed 100644 ---- a/target/linux/x86/legacy/config-default -+++ b/target/linux/x86/legacy/config-default -@@ -1,3 +1,4 @@ -+# CONFIG_104_QUAD_8 is not set - # CONFIG_3C515 is not set - CONFIG_ACPI=y - CONFIG_ACPI_AC=y -@@ -45,8 +46,6 @@ CONFIG_BACKLIGHT_GENERIC=y - CONFIG_BACKLIGHT_LCD_SUPPORT=y - CONFIG_BLK_DEV_SR=y - # CONFIG_BLK_DEV_SR_VENDOR is not set --CONFIG_CLKDEV_LOOKUP=y --CONFIG_COMMON_CLK=y - CONFIG_CPU_IDLE_GOV_MENU=y - CONFIG_DMA_SHARED_BUFFER=y - # CONFIG_DPTF_POWER is not set -@@ -59,23 +58,36 @@ CONFIG_DRM_AMDGPU=y - # CONFIG_DRM_AMD_ACP is not set - CONFIG_DRM_BOCHS=y - CONFIG_DRM_BRIDGE=y -+# CONFIG_DRM_DEBUG_MM is not set -+# CONFIG_DRM_DEBUG_MM_SELFTEST is not set - CONFIG_DRM_FBDEV_EMULATION=y -+CONFIG_DRM_FBDEV_OVERALLOC=100 - # CONFIG_DRM_GMA500 is not set - CONFIG_DRM_I915=y -+# CONFIG_DRM_I915_ALPHA_SUPPORT is not set -+CONFIG_DRM_I915_CAPTURE_ERROR=y -+CONFIG_DRM_I915_COMPRESS_ERROR=y - # CONFIG_DRM_I915_DEBUG is not set -+# CONFIG_DRM_I915_DEBUG_VBLANK_EVADE is not set - # CONFIG_DRM_I915_GVT is not set -+# CONFIG_DRM_I915_LOW_LEVEL_TRACEPOINTS is not set -+# CONFIG_DRM_I915_SELFTEST is not set - # CONFIG_DRM_I915_PRELIMINARY_HW_SUPPORT is not set -+# CONFIG_DRM_I915_SW_FENCE_CHECK_DAG is not set -+# CONFIG_DRM_I915_SW_FENCE_DEBUG_OBJECTS is not set - CONFIG_DRM_I915_USERPTR=y - # CONFIG_DRM_I915_WERROR is not set - CONFIG_DRM_KMS_FB_HELPER=y - CONFIG_DRM_KMS_HELPER=y - CONFIG_DRM_MIPI_DSI=y - CONFIG_DRM_PANEL=y -+CONFIG_DRM_PANEL_BRIDGE=y - CONFIG_DRM_RADEON=y - # CONFIG_DRM_RADEON_USERPTR is not set - CONFIG_DRM_TTM=y - # CONFIG_DRM_VMWGFX is not set - # CONFIG_EBC_C384_WDT is not set -+# CONFIG_EFI_DEV_PATH_PARSER is not set - # CONFIG_EISA is not set - # CONFIG_EL3 is not set - CONFIG_FB=y -@@ -85,6 +97,7 @@ CONFIG_FB_CFB_IMAGEBLIT=y - CONFIG_FB_CMDLINE=y - CONFIG_FB_DEFERRED_IO=y - # CONFIG_FB_I810 is not set -+# CONFIG_FB_PROVIDE_GET_FB_UNMAPPED_AREA is not set - CONFIG_FB_SYS_COPYAREA=y - CONFIG_FB_SYS_FILLRECT=y - CONFIG_FB_SYS_FOPS=y -@@ -99,8 +112,6 @@ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y - # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set - CONFIG_HAVE_ACPI_APEI=y - CONFIG_HAVE_ACPI_APEI_NMI=y --CONFIG_HAVE_CLK=y --CONFIG_HAVE_CLK_PREPARE=y - CONFIG_HDMI=y - CONFIG_HID_BATTERY_STRENGTH=y - # CONFIG_HIGHMEM64G is not set -@@ -121,7 +132,10 @@ CONFIG_INTEL_IDLE=y - # CONFIG_INTEL_IPS is not set - # CONFIG_INTEL_MENLOW is not set - # CONFIG_INTEL_PMC_IPC is not set -+# CONFIG_INTEL_SOC_PMIC_CHTWC is not set - CONFIG_INTERVAL_TREE=y -+CONFIG_IOSF_MBI=y -+# CONFIG_IOSF_MBI_DEBUG is not set - CONFIG_ISA=y - CONFIG_ISAPNP=y - CONFIG_ISA_BUS_API=y -@@ -146,7 +160,9 @@ CONFIG_MOUSE_PS2_ALPS=y - # CONFIG_MOUSE_PS2_ELANTECH is not set - CONFIG_MOUSE_PS2_LIFEBOOK=y - CONFIG_MOUSE_PS2_LOGIPS2PP=y -+CONFIG_MOUSE_PS2_SMBUS=y - CONFIG_MOUSE_PS2_SYNAPTICS=y -+CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS=y - # CONFIG_MOUSE_PS2_TOUCHKIT is not set - CONFIG_MOUSE_PS2_TRACKPOINT=y - # CONFIG_MOUSE_SERIAL is not set -@@ -175,17 +191,20 @@ CONFIG_PNPACPI=y - CONFIG_PNP_DEBUG_MESSAGES=y - # CONFIG_PVPANIC is not set - CONFIG_RAS=y --CONFIG_RATIONAL=y - CONFIG_REGMAP=y - CONFIG_REGMAP_I2C=y -+CONFIG_RELAY=y - CONFIG_RTC_I2C_AND_SPI=y - # CONFIG_SAMSUNG_Q10 is not set - CONFIG_SATA_AHCI=y - CONFIG_SERIAL_8250_PNP=y - # CONFIG_SURFACE_PRO3_BUTTON is not set -+# CONFIG_SW_SYNC is not set -+CONFIG_SYNC_FILE=y - # CONFIG_TOSHIBA_BT_RFKILL is not set - CONFIG_USB_STORAGE=y - CONFIG_VGACON_SOFT_SCROLLBACK=y -+# CONFIG_VGACON_SOFT_SCROLLBACK_PERSISTENT_ENABLE_BY_DEFAULT is not set - CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=64 - # CONFIG_WDT is not set - CONFIG_X86_ACPI_CPUFREQ=y -@@ -200,3 +219,4 @@ CONFIG_X86_MINIMUM_CPU_FAMILY=4 - # CONFIG_X86_PCC_CPUFREQ is not set - CONFIG_X86_PM_TIMER=y - # CONFIG_X86_POWERNOW_K8 is not set -+CONFIG_ZLIB_DEFLATE=y -diff --git a/target/linux/x86/patches-4.14/011-tune_lzma_options.patch b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch -new file mode 100644 -index 0000000..daed310 ---- /dev/null -+++ b/target/linux/x86/patches-4.14/011-tune_lzma_options.patch -@@ -0,0 +1,22 @@ -+--- a/scripts/Makefile.lib -++++ b/scripts/Makefile.lib -+@@ -348,7 +348,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^) -+ -+ quiet_cmd_lzma = LZMA $@ -+ cmd_lzma = (cat $(filter-out FORCE,$^) | \ -+- lzma e -d20 -lc1 -lp2 -pb2 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ -++ lzma e -lc8 -eos -si -so && $(call size_append, $(filter-out FORCE,$^))) > $@ || \ -+ (rm -f $@ ; false) -+ -+ quiet_cmd_lzo = LZO $@ -+--- a/arch/x86/include/asm/boot.h -++++ b/arch/x86/include/asm/boot.h -+@@ -24,7 +24,7 @@ -+ # error "Invalid value for CONFIG_PHYSICAL_ALIGN" -+ #endif -+ -+-#ifdef CONFIG_KERNEL_BZIP2 -++#if defined(CONFIG_KERNEL_BZIP2) || defined(CONFIG_KERNEL_LZMA) -+ # define BOOT_HEAP_SIZE 0x400000 -+ #else /* !CONFIG_KERNEL_BZIP2 */ -+ # define BOOT_HEAP_SIZE 0x10000 -diff --git a/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch -new file mode 100644 -index 0000000..c3a7fce ---- /dev/null -+++ b/target/linux/x86/patches-4.14/100-fix_cs5535_clockevt.patch -@@ -0,0 +1,12 @@ -+--- a/drivers/clocksource/cs5535-clockevt.c -++++ b/drivers/clocksource/cs5535-clockevt.c -+@@ -130,7 +130,8 @@ static irqreturn_t mfgpt_tick(int irq, v -+ cs5535_mfgpt_write(cs5535_event_clock, MFGPT_REG_SETUP, -+ MFGPT_SETUP_CNTEN | MFGPT_SETUP_CMP2); -+ -+- cs5535_clockevent.event_handler(&cs5535_clockevent); -++ if (cs5535_clockevent.event_handler) -++ cs5535_clockevent.event_handler(&cs5535_clockevent); -+ return IRQ_HANDLED; -+ } -+ -diff --git a/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch -new file mode 100644 -index 0000000..048dfae ---- /dev/null -+++ b/target/linux/x86/patches-4.14/200-pcengines-apu2-reboot.patch -@@ -0,0 +1,19 @@ -+--- a/arch/x86/kernel/reboot.c -++++ b/arch/x86/kernel/reboot.c -+@@ -448,6 +448,16 @@ static const struct dmi_system_id reboot -+ }, -+ }, -+ -++ /* PC Engines */ -++ { /* Handle problems with rebooting on PC Engines apu2 */ -++ .callback = set_pci_reboot, -++ .ident = "PC Engines apu2", -++ .matches = { -++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), -++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), -++ }, -++ }, -++ -+ /* Sony */ -+ { /* Handle problems with rebooting on Sony VGN-Z540N */ -+ .callback = set_bios_reboot, -diff --git a/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch -new file mode 100644 -index 0000000..ef2e133 ---- /dev/null -+++ b/target/linux/x86/patches-4.14/800-hwmon-w83627ehf-dont-claim-nct677x.patch -@@ -0,0 +1,30 @@ -+--- a/drivers/hwmon/w83627ehf.c -++++ b/drivers/hwmon/w83627ehf.c -+@@ -2717,8 +2717,8 @@ static int __init w83627ehf_find(int sio -+ static const char sio_name_W83627UHG[] __initconst = "W83627UHG"; -+ static const char sio_name_W83667HG[] __initconst = "W83667HG"; -+ static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B"; -+- static const char sio_name_NCT6775[] __initconst = "NCT6775F"; -+- static const char sio_name_NCT6776[] __initconst = "NCT6776F"; -++/* static const char sio_name_NCT6775[] __initconst = "NCT6775F"; -++ static const char sio_name_NCT6776[] __initconst = "NCT6776F"; */ -+ -+ u16 val; -+ const char *sio_name; -+@@ -2762,14 +2762,14 @@ static int __init w83627ehf_find(int sio -+ sio_data->kind = w83667hg_b; -+ sio_name = sio_name_W83667HG_B; -+ break; -+- case SIO_NCT6775_ID: -++/* case SIO_NCT6775_ID: -+ sio_data->kind = nct6775; -+ sio_name = sio_name_NCT6775; -+ break; -+ case SIO_NCT6776_ID: -+ sio_data->kind = nct6776; -+ sio_name = sio_name_NCT6776; -+- break; -++ break; */ -+ default: -+ if (val != 0xffff) -+ pr_debug("unsupported chip ID: 0x%04x\n", val); --- -1.9.1 - diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 208baf75a..623d20493 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -24,4 +24,4 @@ KERNEL_PATCHVER ?= $(KERNEL) # disable the md5sum check for unknown kernel versions LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION))) -LINUX_KERNEL_HASH?=x +LINUX_KERNEL_HASH?=x \ No newline at end of file diff --git a/include/target.mk b/include/target.mk index 6fb5a31bc..3fe99d33a 100644 --- a/include/target.mk +++ b/include/target.mk @@ -16,7 +16,7 @@ DEVICE_TYPE?=router DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ -luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd luci-app-sfe \ +luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \ luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index f97967f24..5f57433d6 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2017-01-28 -PKG_SOURCE_VERSION:=9789742cfc596d48583ba4cdbc8f38d026121fa6 -PKG_MIRROR_HASH:=2a5afc45722c28ca8778eb50452eb305306e7898b32d7d6d73d3e77edf3cce99 +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=49776da5b93f03c8548e26f2d7982d553d1d226c +PKG_MIRROR_HASH:=d7bc6c333b43f6ff100a4b1d4593a18686fcdd6fd28a3aae55ea8bdad868b67f include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/linux/modules/block.mk b/package/kernel/linux/modules/block.mk index 62f08218c..ab9d7af8c 100644 --- a/package/kernel/linux/modules/block.mk +++ b/package/kernel/linux/modules/block.mk @@ -206,10 +206,21 @@ endef $(eval $(call KernelPackage,block2mtd)) +define KernelPackage/dax + SUBMENU:=$(BLOCK_MENU) + TITLE:=DAX: direct access to differentiated memory + DEPENDS:=@LINUX_4_14 + KCONFIG:=CONFIG_DAX + FILES:=$(LINUX_DIR)/drivers/dax/dax.ko +endef + +$(eval $(call KernelPackage,dax)) + + define KernelPackage/dm SUBMENU:=$(BLOCK_MENU) TITLE:=Device Mapper - DEPENDS:=+kmod-crypto-manager + DEPENDS:=+kmod-crypto-manager +LINUX_4_14:kmod-dax # All the "=n" are unnecessary, they're only there # to stop the config from asking the question. # MIRROR is M because I've needed it for pvmove. diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index fc2739811..b05552006 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -120,6 +120,36 @@ endef $(eval $(call KernelPackage,crypto-rng)) +define KernelPackage/crypto-rsa + TITLE:=RSA algorithm + DEPENDS:=@!LINUX_3_18 +kmod-crypto-manager + KCONFIG:= CONFIG_CRYPTO_RSA + HIDDEN:=1 + FILES:= \ + $(LINUX_DIR)/lib/asn1_decoder.ko \ + $(LINUX_DIR)/lib/mpi/mpi.ko \ + $(LINUX_DIR)/crypto/akcipher.ko \ + $(LINUX_DIR)/crypto/rsa_generic.ko + AUTOLOAD:=$(call AutoLoad,10,rsa_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-rsa)) + + +define KernelPackage/crypto-ecdh + TITLE:=ECDH algorithm + DEPENDS:=@!(LINUX_3_18||LINUX_4_4) +kmod-crypto-kpp + KCONFIG:= CONFIG_CRYPTO_ECDH + FILES:= \ + $(LINUX_DIR)/crypto/ecdh_generic.ko + AUTOLOAD:=$(call AutoLoad,10,ecdh_generic) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-ecdh)) + + define KernelPackage/crypto-iv TITLE:=CryptoAPI initialization vectors DEPENDS:=+kmod-crypto-manager +kmod-crypto-rng +kmod-crypto-wq @@ -196,12 +226,13 @@ $(eval $(call KernelPackage,crypto-hw-padlock)) define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor - DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 + DEPENDS:=+kmod-crypto-authenc +kmod-crypto-hash +kmod-crypto-manager +kmod-random-core +kmod-crypto-sha1 +kmod-crypto-sha256 +LINUX_4_14:kmod-crypto-rsa KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_CCP=y \ CONFIG_CRYPTO_DEV_CCP_CRYPTO \ - CONFIG_CRYPTO_DEV_CCP_DD + CONFIG_CRYPTO_DEV_CCP_DD \ + CONFIG_CRYPTO_DEV_SP_CCP=y FILES:= \ $(LINUX_DIR)/drivers/crypto/ccp/ccp.ko \ $(LINUX_DIR)/drivers/crypto/ccp/ccp-crypto.ko @@ -330,9 +361,33 @@ endef $(eval $(call KernelPackage,crypto-des)) +define KernelPackage/crypto-kpp + TITLE:=Key-agreement Protocol Primitives + KCONFIG:=CONFIG_CRYPTO_KPP + HIDDEN:=1 + FILES:=$(LINUX_DIR)/crypto/kpp.ko + AUTOLOAD:=$(call AutoLoad,09,kpp) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-kpp)) + + +define KernelPackage/crypto-acompress + TITLE:=Asynchronous Compression operations + HIDDEN:=1 + KCONFIG:=CONFIG_CRYPTO_ACOMP2 + FILES:=$(LINUX_DIR)/crypto/crypto_acompress.ko + AUTOLOAD:=$(call AutoLoad,09,crypto_acompress) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-acompress)) + + define KernelPackage/crypto-deflate TITLE:=Deflate compression CryptoAPI module - DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate + DEPENDS:=+kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +LINUX_4_14:kmod-crypto-acompress KCONFIG:=CONFIG_CRYPTO_DEFLATE FILES:=$(LINUX_DIR)/crypto/deflate.ko AUTOLOAD:=$(call AutoLoad,09,deflate) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index 3db633a8b..f75758557 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -82,7 +82,7 @@ $(eval $(call KernelPackage,fs-autofs4)) define KernelPackage/fs-btrfs SUBMENU:=$(FS_MENU) TITLE:=BTRFS filesystem support - DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor + DEPENDS:=+kmod-lib-crc32c +kmod-lib-lzo +kmod-lib-zlib-inflate +kmod-lib-zlib-deflate +kmod-lib-raid6 +kmod-lib-xor +LINUX_4_14:kmod-lib-zstd KCONFIG:=\ CONFIG_BTRFS_FS \ CONFIG_BTRFS_FS_POSIX_ACL=n \ @@ -106,7 +106,8 @@ define KernelPackage/fs-cifs CONFIG_CIFS \ CONFIG_CIFS_XATTR=y \ CONFIG_CIFS_DFS_UPCALL=n \ - CONFIG_CIFS_UPCALL=n + CONFIG_CIFS_UPCALL=n \ + CONFIG_CIFS_SMB311=n FILES:=$(LINUX_DIR)/fs/cifs/cifs.ko AUTOLOAD:=$(call AutoLoad,30,cifs) $(call AddDepends/nls) diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index 1bb881cb0..5141766a9 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -142,6 +142,32 @@ endef $(eval $(call KernelPackage,i2c-piix4)) +I2C_I801_MODULES:= \ + CONFIG_I2C_I801:drivers/i2c/busses/i2c-i801 \ + CONFIG_I2C_SMBUS:drivers/i2c/i2c-smbus + +define KernelPackage/i2c-i801 + $(call i2c_defaults,$(I2C_I801_MODULES),59) + TITLE:=Intel I801 and compatible I2C interfaces + DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core +endef + +define KernelPackage/i2c-i801/description + Support for the Intel I801 family of mainboard I2C interfaces, + specifically 82801AA, 82801AB, 82801BA, 82801CA/CAM, 82801DB, + 82801EB/ER (ICH5/ICH5R), 6300ESB, ICH6, ICH7, ESB2, ICH8, ICH9, + EP80579 (Tolapai), ICH10, 5/3400 Series (PCH), 6 Series (PCH), + Patsburg (PCH), DH89xxCC (PCH), Panther Point (PCH), + Lynx Point (PCH), Lynx Point-LP (PCH), Avoton (SOC), + Wellsburg (PCH), Coleto Creek (PCH), Wildcat Point (PCH), + Wildcat Point-LP (PCH), BayTrail (SOC), Sunrise Point-H (PCH), + Sunrise Point-LP (PCH), DNV (SOC), Broxton (SOC), + Lewisburg (PCH). +endef + +$(eval $(call KernelPackage,i2c-i801)) + + I2C_MUX_MODULES:= \ CONFIG_I2C_MUX:drivers/i2c/i2c-mux diff --git a/package/kernel/linux/modules/iio.mk b/package/kernel/linux/modules/iio.mk new file mode 100644 index 000000000..8990e5481 --- /dev/null +++ b/package/kernel/linux/modules/iio.mk @@ -0,0 +1,120 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +IIO_MENU:=Industrial I/O Modules + + +define KernelPackage/iio-core + SUBMENU:=$(IIO_MENU) + TITLE:=Industrial IO core + KCONFIG:= \ + CONFIG_IIO \ + CONFIG_IIO_BUFFER=y \ + CONFIG_IIO_KFIFO_BUF \ + CONFIG_IIO_TRIGGER=y \ + CONFIG_IIO_TRIGGERED_BUFFER + FILES:= \ + $(LINUX_DIR)/drivers/iio/industrialio.ko \ + $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko@lt4.4) \ + $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko@ge4.4) \ + $(LINUX_DIR)/drivers/iio/kfifo_buf.ko@lt4.4 \ + $(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko@ge4.4 + AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer) +endef + +define KernelPackage/iio-core/description + The industrial I/O subsystem provides a unified framework for + drivers for many different types of embedded sensors using a + number of different physical interfaces (i2c, spi, etc) +endef + +$(eval $(call KernelPackage,iio-core)) + + +define KernelPackage/iio-ad799x + SUBMENU:=$(IIO_MENU) + DEPENDS:=+kmod-i2c-core +kmod-iio-core + TITLE:=Analog Devices AD799x ADC driver + KCONFIG:= \ + CONFIG_AD799X_RING_BUFFER=y \ + CONFIG_AD799X + FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko + AUTOLOAD:=$(call AutoLoad,56,ad799x) +endef + +define KernelPackage/iio-ad799x/description + support for Analog Devices: + ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998 + i2c analog to digital converters (ADC). +endef + +$(eval $(call KernelPackage,iio-ad799x)) + + +define KernelPackage/iio-dht11 + SUBMENU:=$(IIO_MENU) + DEPENDS:=+kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE + TITLE:=DHT11 (and compatible) humidity and temperature sensors + KCONFIG:= \ + CONFIG_DHT11 + FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko + AUTOLOAD:=$(call AutoLoad,56,dht11) +endef + +define KernelPackage/iio-dht11/description + support for DHT11 and DHT22 digitial humidity and temperature sensors + attached at GPIO lines. You will need a custom device tree file to + specify the GPIO line to use. +endef + +$(eval $(call KernelPackage,iio-dht11)) + +define KernelPackage/iio-bmp280 + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor + DEPENDS:=@(LINUX_4_9||LINUX_4_14) +kmod-iio-core +kmod-regmap + KCONFIG:=CONFIG_BMP280 + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280.ko +endef + +define KernelPackage/iio-bmp280/description + This driver adds support for Bosch Sensortec BMP180 and BMP280 pressure and + temperature sensors. Also supports the BME280 with an additional humidity + sensor channel. +endef + +$(eval $(call KernelPackage,iio-bmp280)) + + +define KernelPackage/iio-bmp280-i2c + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (I2C) + DEPENDS:=+kmod-iio-bmp280 +kmod-i2c-core + KCONFIG:=CONFIG_BMP280_I2C + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-i2c.ko + AUTOLOAD:=$(call AutoProbe,iio-bmp280-i2c) +endef +define KernelPackage/iio-bmp280-i2c/description + This driver adds support for Bosch Sensortec's digital pressure and + temperature sensor connected via I2C. +endef + +$(eval $(call KernelPackage,iio-bmp280-i2c)) + + +define KernelPackage/iio-bmp280-spi + SUBMENU:=$(IIO_MENU) + TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor (SPI) + DEPENDS:=+kmod-iio-bmp280 +kmod-spi-bitbang + KCONFIG:=CONFIG_BMP280_SPI + FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280-spi.ko + AUTOLOAD:=$(call AutoProbe,iio-bmp280-spi) +endef +define KernelPackage/iio-bmp280-spi/description + This driver adds support for Bosch Sensortec's digital pressure and + temperature sensor connected via SPI. +endef + +$(eval $(call KernelPackage,iio-bmp280-spi)) diff --git a/package/kernel/linux/modules/lib.mk b/package/kernel/linux/modules/lib.mk index 72c5eff69..6d7e0dc99 100644 --- a/package/kernel/linux/modules/lib.mk +++ b/package/kernel/linux/modules/lib.mk @@ -101,14 +101,17 @@ $(eval $(call KernelPackage,lib-crc32c)) define KernelPackage/lib-lzo SUBMENU:=$(LIB_MENU) TITLE:=LZO support + DEPENDS:=+LINUX_4_14:kmod-crypto-acompress KCONFIG:= \ + CONFIG_CRYPTO_LZO@ge4.9 \ CONFIG_LZO_COMPRESS \ CONFIG_LZO_DECOMPRESS HIDDEN:=1 FILES:= \ + $(LINUX_DIR)/crypto/lzo.ko@ge4.9 \ $(LINUX_DIR)/lib/lzo/lzo_compress.ko \ $(LINUX_DIR)/lib/lzo/lzo_decompress.ko - AUTOLOAD:=$(call AutoProbe,lzo_compress lzo_decompress) + AUTOLOAD:=$(call AutoProbe,lzo@ge4.9 lzo_compress lzo_decompress) endef define KernelPackage/lib-lzo/description @@ -118,17 +121,42 @@ endef $(eval $(call KernelPackage,lib-lzo)) +define KernelPackage/lib-zstd + SUBMENU:=$(LIB_MENU) + TITLE:=ZSTD support + KCONFIG:= \ + CONFIG_ZSTD_COMPRESS \ + CONFIG_ZSTD_DECOMPRESS \ + CONFIG_XXHASH + HIDDEN:=1 + FILES:= \ + $(LINUX_DIR)/lib/xxhash.ko \ + $(LINUX_DIR)/lib/zstd/zstd_compress.ko \ + $(LINUX_DIR)/lib/zstd/zstd_decompress.ko + AUTOLOAD:=$(call AutoProbe,xxhash zstd_compress zstd_decompress) +endef + +define KernelPackage/lib-zstd/description + Kernel module for ZSTD compression/decompression support +endef + +$(eval $(call KernelPackage,lib-zstd)) + + define KernelPackage/lib-lz4 SUBMENU:=$(LIB_MENU) TITLE:=LZ4 support + DEPENDS:=+LINUX_4_14:kmod-crypto-acompress HIDDEN:=1 KCONFIG:= \ + CONFIG_CRYPTO_LZ4@ge4.9 \ CONFIG_LZ4_COMPRESS \ CONFIG_LZ4_DECOMPRESS FILES:= \ + $(LINUX_DIR)/crypto/lz4.ko@ge4.9 \ $(LINUX_DIR)/lib/lz4/lz4_compress.ko \ $(LINUX_DIR)/lib/lz4/lz4_decompress.ko - AUTOLOAD:=$(call AutoProbe,lz4_compress lz4_decompress) + AUTOLOAD:=$(call AutoProbe,lz4@ge4.9 lz4_compress lz4_decompress) endef define KernelPackage/lib-lz4/description diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index a3ff005eb..a9740ef35 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -304,6 +304,22 @@ endef $(eval $(call KernelPackage,r6040)) +define KernelPackage/niu + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Sun Neptune 10Gbit Ethernet support + DEPENDS:=@PCI_SUPPORT + KCONFIG:=CONFIG_NIU + FILES:=$(LINUX_DIR)/drivers/net/ethernet/sun/niu.ko + AUTOLOAD:=$(call AutoProbe,niu) +endef + +define KernelPackage/niu/description + This enables support for cards based upon Sun's Neptune chipset. +endef + +$(eval $(call KernelPackage,niu)) + + define KernelPackage/sis900 SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=SiS 900 Ethernet support @@ -555,6 +571,25 @@ endef $(eval $(call KernelPackage,ixgbe)) +define KernelPackage/ixgbevf + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Intel(R) 82599 Virtual Function Ethernet support + DEPENDS:=@PCI_SUPPORT +kmod-ixgbe + KCONFIG:=CONFIG_IXGBEVF \ + CONFIG_IXGBE_VXLAN=n \ + CONFIG_IXGBE_HWMON=n \ + CONFIG_IXGBE_DCA=n + FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/ixgbevf/ixgbevf.ko + AUTOLOAD:=$(call AutoLoad,35,ixgbevf) +endef + +define KernelPackage/ixgbevf/description + Kernel modules for Intel(R) 82599 Virtual Function Ethernet adapters. +endef + +$(eval $(call KernelPackage,ixgbevf)) + + define KernelPackage/b44 TITLE:=Broadcom 44xx driver KCONFIG:=CONFIG_B44 @@ -611,8 +646,9 @@ $(eval $(call KernelPackage,pcnet32)) define KernelPackage/tg3 TITLE:=Broadcom Tigon3 Gigabit Ethernet - KCONFIG:=CONFIG_TIGON3 - DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +kmod-hwmon-core +kmod-ptp + KCONFIG:=CONFIG_TIGON3 \ + CONFIG_TIGON3_HWMON=n + DEPENDS:=+!TARGET_brcm47xx:kmod-libphy +!LINUX_4_14:kmod-hwmon-core +kmod-ptp SUBMENU:=$(NETWORK_DEVICES_MENU) FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/tg3.ko AUTOLOAD:=$(call AutoLoad,19,tg3,1) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 0ad6987aa..0d817ed7f 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -529,6 +529,23 @@ endef $(eval $(call KernelPackage,ipt-u32)) +define KernelPackage/ipt-checksum + TITLE:=CHECKSUM support + KCONFIG:= \ + CONFIG_NETFILTER_XT_TARGET_CHECKSUM + FILES:= \ + $(LINUX_DIR)/net/netfilter/xt_CHECKSUM.ko \ + $(foreach mod,$(IPT_CHECKSUM-m),$(LINUX_DIR)/net/$(mod).ko) + AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CHECKSUM-m))) + $(call AddDepends/ipt) +endef + +define KernelPackage/ipt-checksum/description + Kernel modules for CHECKSUM fillin target +endef + +$(eval $(call KernelPackage,ipt-checksum)) + define KernelPackage/ipt-iprange TITLE:=Module for matching ip ranges diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 6c9b03be1..836034ad1 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -271,7 +271,8 @@ define KernelPackage/ipsec4 CONFIG_INET_XFRM_MODE_BEET \ CONFIG_INET_XFRM_MODE_TRANSPORT \ CONFIG_INET_XFRM_MODE_TUNNEL \ - CONFIG_INET_XFRM_TUNNEL + CONFIG_INET_XFRM_TUNNEL \ + CONFIG_INET_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC4-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC4-m))) endef @@ -311,7 +312,8 @@ define KernelPackage/ipsec6 CONFIG_INET6_XFRM_MODE_BEET \ CONFIG_INET6_XFRM_MODE_TRANSPORT \ CONFIG_INET6_XFRM_MODE_TUNNEL \ - CONFIG_INET6_XFRM_TUNNEL + CONFIG_INET6_XFRM_TUNNEL \ + CONFIG_INET6_ESP_OFFLOAD=n FILES:=$(foreach mod,$(IPSEC6-m),$(LINUX_DIR)/net/$(mod).ko) AUTOLOAD:=$(call AutoLoad,32,$(notdir $(IPSEC6-m))) endef @@ -923,9 +925,10 @@ define KernelPackage/rxrpc CONFIG_RXKAD=m \ CONFIG_AF_RXRPC_DEBUG=n FILES:= \ - $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \ + $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko@lt4.11 \ + $(LINUX_DIR)/net/rxrpc/rxrpc.ko@ge4.11 \ $(LINUX_DIR)/net/rxrpc/rxkad.ko@lt4.7 - AUTOLOAD:=$(call AutoLoad,30,rxkad@lt4.7 af-rxrpc) + AUTOLOAD:=$(call AutoLoad,30,rxkad@lt4.7 af-rxrpc.ko@lt4.11 rxrpc.ko@ge4.11) DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt endef @@ -942,6 +945,7 @@ define KernelPackage/mpls KCONFIG:= \ CONFIG_MPLS=y \ CONFIG_LWTUNNEL=y \ + CONFIG_LWTUNNEL_BPF=n \ CONFIG_NET_MPLS_GSO=m \ CONFIG_MPLS_ROUTING=m \ CONFIG_MPLS_IPTUNNEL=m @@ -965,6 +969,7 @@ define KernelPackage/9pnet KCONFIG:= \ CONFIG_NET_9P \ CONFIG_NET_9P_DEBUG=n \ + CONFIG_NET_9P_XEN=n \ CONFIG_NET_9P_VIRTIO FILES:= \ $(LINUX_DIR)/net/9p/9pnet.ko \ @@ -1009,3 +1014,18 @@ define KernelPackage/mdio/description endef $(eval $(call KernelPackage,mdio)) + +define KernelPackage/macsec + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=IEEE 802.1AE MAC-level encryption (MAC) + DEPENDS:=+kmod-crypto-gcm @!LINUX_3_18 @!LINUX_4_1 @!LINUX_4_4 + KCONFIG:=CONFIG_MACSEC + FILES:=$(LINUX_DIR)/drivers/net/macsec.ko + AUTOLOAD:=$(call AutoLoad,13,macsec) +endef + +define KernelPackage/macsec/description + MACsec is an encryption standard for Ethernet. +endef + +$(eval $(call KernelPackage,macsec)) diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 1b31a861f..1c7869e7c 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -30,7 +30,7 @@ $(eval $(call KernelPackage,6lowpan)) define KernelPackage/bluetooth SUBMENU:=$(OTHER_MENU) TITLE:=Bluetooth support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap + DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-crypto-hash +kmod-crypto-ecb +kmod-lib-crc16 +kmod-hid +!LINUX_3_18:kmod-crypto-cmac +!LINUX_3_18:kmod-regmap +LINUX_4_14:kmod-crypto-ecdh KCONFIG:= \ CONFIG_BLUEZ \ CONFIG_BLUEZ_L2CAP \ @@ -114,6 +114,27 @@ endef $(eval $(call KernelPackage,bluetooth_6lowpan)) +define KernelPackage/btmrvl + SUBMENU:=$(OTHER_MENU) + TITLE:=Marvell Bluetooth Kernel Module support + DEPENDS:=+kmod-mmc +kmod-bluetooth +mwifiex-sdio-firmware + KCONFIG:= \ + CONFIG_BT_MRVL \ + CONFIG_BT_MRVL_SDIO + $(call AddDepends/bluetooth) + FILES:= \ + $(LINUX_DIR)/drivers/bluetooth/btmrvl.ko \ + $(LINUX_DIR)/drivers/bluetooth/btmrvl_sdio.ko + AUTOLOAD:=$(call AutoProbe,btmrvl btmrvl_sdio) +endef + +define KernelPackage/btmrvl/description + Kernel support for Marvell SDIO Bluetooth Module +endef + +$(eval $(call KernelPackage,btmrvl)) + + define KernelPackage/dma-buf SUBMENU:=$(OTHER_MENU) TITLE:=DMA shared buffer support @@ -263,71 +284,6 @@ endef $(eval $(call KernelPackage,gpio-pcf857x)) -define KernelPackage/iio-core - SUBMENU:=$(OTHER_MENU) - TITLE:=Industrial IO core - KCONFIG:= \ - CONFIG_IIO \ - CONFIG_IIO_BUFFER=y \ - CONFIG_IIO_KFIFO_BUF \ - CONFIG_IIO_TRIGGER=y \ - CONFIG_IIO_TRIGGERED_BUFFER - FILES:= \ - $(LINUX_DIR)/drivers/iio/industrialio.ko \ - $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/industrialio-triggered-buffer.ko@lt4.4) \ - $(if $(CONFIG_IIO_TRIGGERED_BUFFER),$(LINUX_DIR)/drivers/iio/buffer/industrialio-triggered-buffer.ko@ge4.4) \ - $(LINUX_DIR)/drivers/iio/kfifo_buf.ko@lt4.4 \ - $(LINUX_DIR)/drivers/iio/buffer/kfifo_buf.ko@ge4.4 - AUTOLOAD:=$(call AutoLoad,55,industrialio kfifo_buf industrialio-triggered-buffer) -endef - -define KernelPackage/iio-core/description - The industrial I/O subsystem provides a unified framework for - drivers for many different types of embedded sensors using a - number of different physical interfaces (i2c, spi, etc) -endef - -$(eval $(call KernelPackage,iio-core)) - - -define KernelPackage/iio-ad799x - SUBMENU:=$(OTHER_MENU) - DEPENDS:=kmod-i2c-core kmod-iio-core - TITLE:=Analog Devices AD799x ADC driver - KCONFIG:= \ - CONFIG_AD799X_RING_BUFFER=y \ - CONFIG_AD799X - FILES:=$(LINUX_DIR)/drivers/iio/adc/ad799x.ko - AUTOLOAD:=$(call AutoLoad,56,ad799x) -endef - -define KernelPackage/iio-ad799x/description - support for Analog Devices: - ad7991, ad7995, ad7999, ad7992, ad7993, ad7994, ad7997, ad7998 - i2c analog to digital converters (ADC). -endef - -$(eval $(call KernelPackage,iio-ad799x)) - - -define KernelPackage/iio-dht11 - SUBMENU:=$(OTHER_MENU) - DEPENDS:=kmod-iio-core @GPIO_SUPPORT @USES_DEVICETREE - TITLE:=DHT11 (and compatible) humidity and temperature sensors - KCONFIG:= \ - CONFIG_DHT11 - FILES:=$(LINUX_DIR)/drivers/iio/humidity/dht11.ko - AUTOLOAD:=$(call AutoLoad,56,dht11) -endef - -define KernelPackage/iio-dht11/description - support for DHT11 and DHT22 digitial humidity and temperature sensors - attached at GPIO lines. You will need a custom device tree file to - specify the GPIO line to use. -endef - -$(eval $(call KernelPackage,iio-dht11)) - define KernelPackage/lp SUBMENU:=$(OTHER_MENU) @@ -361,7 +317,8 @@ define KernelPackage/mmc CONFIG_SDIO_UART=n FILES:= \ $(LINUX_DIR)/drivers/mmc/core/mmc_core.ko \ - $(LINUX_DIR)/drivers/mmc/card/mmc_block.ko + $(LINUX_DIR)/drivers/mmc/card/mmc_block.ko@lt4.10 \ + $(LINUX_DIR)/drivers/mmc/core/mmc_block.ko@ge4.10 AUTOLOAD:=$(call AutoProbe,mmc_core mmc_block,1) endef @@ -486,7 +443,7 @@ define KernelPackage/rtc-ds1307 SUBMENU:=$(OTHER_MENU) TITLE:=Dallas/Maxim DS1307 (and compatible) RTC support DEFAULT:=m if ALL_KMODS && RTC_SUPPORT - DEPENDS:=+kmod-i2c-core + DEPENDS:=+kmod-i2c-core +LINUX_4_14:kmod-regmap KCONFIG:=CONFIG_RTC_DRV_DS1307 \ CONFIG_RTC_CLASS=y FILES:=$(LINUX_DIR)/drivers/rtc/rtc-ds1307.ko @@ -648,6 +605,20 @@ endef $(eval $(call KernelPackage,mtdtests)) +define KernelPackage/mtdoops + SUBMENU:=$(OTHER_MENU) + TITLE:=Log panic/oops to an MTD buffer + KCONFIG:=CONFIG_MTD_OOPS + FILES:=$(LINUX_DIR)/drivers/mtd/mtdoops.ko +endef + +define KernelPackage/mtdoops/description + Kernel modules for Log panic/oops to an MTD buffer +endef + +$(eval $(call KernelPackage,mtdoops)) + + define KernelPackage/serial-8250 SUBMENU:=$(OTHER_MENU) TITLE:=8250 UARTs @@ -722,6 +693,7 @@ define KernelPackage/zram CONFIG_ZRAM \ CONFIG_ZRAM_DEBUG=n \ CONFIG_PGTABLE_MAPPING=n \ + CONFIG_ZRAM_WRITEBACK=n \ CONFIG_ZSMALLOC_STAT=n \ CONFIG_ZRAM_LZ4_COMPRESS=y FILES:= \ @@ -1044,3 +1016,38 @@ define KernelPackage/w83627hf-wdt/description endef $(eval $(call KernelPackage,w83627hf-wdt)) + + +define KernelPackage/itco-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=Intel iTCO Watchdog Timer + KCONFIG:=CONFIG_ITCO_WDT \ + CONFIG_ITCO_VENDOR_SUPPORT=y + FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_wdt.ko \ + $(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/iTCO_vendor_support.ko + AUTOLOAD:=$(call AutoLoad,50,iTCO_vendor_support iTCO_wdt,1) +endef + +define KernelPackage/itco-wdt/description + Kernel module for Intel iTCO Watchdog Timer +endef + +$(eval $(call KernelPackage,itco-wdt)) + + +define KernelPackage/it87-wdt + SUBMENU:=$(OTHER_MENU) + TITLE:=ITE IT87 Watchdog Timer + KCONFIG:=CONFIG_IT87_WDT + FILES:=$(LINUX_DIR)/drivers/$(WATCHDOG_DIR)/it87_wdt.ko + AUTOLOAD:=$(call AutoLoad,50,it87-wdt,1) + MODPARAMS.it87-wdt:= \ + nogameport=1 \ + nocir=1 +endef + +define KernelPackage/it87-wdt/description + Kernel module for ITE IT87 Watchdog Timer +endef + +$(eval $(call KernelPackage,it87-wdt)) diff --git a/package/kernel/linux/modules/sound.mk b/package/kernel/linux/modules/sound.mk index 75aa3d3fc..faee1f367 100644 --- a/package/kernel/linux/modules/sound.mk +++ b/package/kernel/linux/modules/sound.mk @@ -24,7 +24,8 @@ SOUNDCORE_FILES ?= \ $(LINUX_DIR)/sound/soundcore.ko \ $(LINUX_DIR)/sound/core/snd.ko \ $(LINUX_DIR)/sound/core/snd-hwdep.ko \ - $(LINUX_DIR)/sound/core/seq/snd-seq-device.ko \ + $(LINUX_DIR)/sound/core/seq/snd-seq-device.ko@lt4.13 \ + $(LINUX_DIR)/sound/core/snd-seq-device.ko@ge4.13 \ $(LINUX_DIR)/sound/core/snd-rawmidi.ko \ $(LINUX_DIR)/sound/core/snd-timer.ko \ $(LINUX_DIR)/sound/core/snd-pcm.ko \ diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index ee5b95438..d1fb5f4cd 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -509,6 +509,7 @@ define KernelPackage/usb-serial-edgeport FILES:=$(LINUX_DIR)/drivers/usb/serial/io_edgeport.ko AUTOLOAD:=$(call AutoProbe,io_edgeport) $(call AddDepends/usb-serial) + DEPENDS+=+edgeport-firmware endef define KernelPackage/usb-serial-edgeport/description @@ -531,14 +532,6 @@ define KernelPackage/usb-serial-edgeport/description Edgeport/16 Dual endef -define KernelPackage/usb-serial-edgeport/install - $(INSTALL_DIR) $(1)/lib/firmware/edgeport - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/boot.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/boot2.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/down.fw $(1)/lib/firmware/edgeport/ - $(INSTALL_DATA) $(LINUX_DIR)/firmware/edgeport/down2.fw $(1)/lib/firmware/edgeport/ -endef - $(eval $(call KernelPackage,usb-serial-edgeport)) @@ -895,6 +888,25 @@ endef $(eval $(call KernelPackage,usb-storage-extras)) +define KernelPackage/usb-storage-uas + SUBMENU:=$(USB_MENU) + TITLE:=USB Attached SCSI (UASP) support + DEPENDS:=+kmod-usb-storage + KCONFIG:=CONFIG_USB_UAS + FILES:=$(LINUX_DIR)/drivers/usb/storage/uas.ko + AUTOLOAD:=$(call AutoProbe,uas) +endef + +define KernelPackage/usb-storage-uas/description + Say Y here if you want to include support for + USB Attached SCSI (UAS/UASP), a higher + performance protocol available on many + newer USB 3.0 storage devices +endef + +$(eval $(call KernelPackage,usb-storage-uas)) + + define KernelPackage/usb-atm TITLE:=Support for ATM on USB bus DEPENDS:=+kmod-atm diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index ef6bd4bc0..8f0f0dc9e 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -81,7 +81,7 @@ $(eval $(call KernelPackage,fb)) define KernelPackage/fbcon SUBMENU:=$(VIDEO_MENU) TITLE:=Framebuffer Console support - DEPENDS:=+kmod-fb + DEPENDS:=+kmod-fb @!LINUX_4_14 KCONFIG:= \ CONFIG_FRAMEBUFFER_CONSOLE \ CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y \ diff --git a/package/lean/automount/Makefile b/package/lean/automount/Makefile index 8881a060d..3d8589c90 100644 --- a/package/lean/automount/Makefile +++ b/package/lean/automount/Makefile @@ -17,7 +17,7 @@ include $(INCLUDE_DIR)/package.mk define Package/automount TITLE:=Mount autoconfig hotplug script. MAINTAINER:=Lean - DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +kmod-fs-exfat +ntfs-3g + DEPENDS:=block-mount +kmod-usb-storage +kmod-usb-storage-extras +kmod-fs-ext4 +kmod-fs-vfat +ntfs-3g endef define Package/automount/description diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index 058edd1a3..b82a0f4e9 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -13,7 +13,7 @@ FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu SUBTARGETS:=generic legacy geode 64 MAINTAINER:=Felix Fietkau -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 KERNELNAME:=bzImage diff --git a/toolchain-old/Config.in b/toolchain-old/Config.in new file mode 100644 index 000000000..f6753ad8b --- /dev/null +++ b/toolchain-old/Config.in @@ -0,0 +1,318 @@ +# Copyright (C) 2006-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +menuconfig TARGET_OPTIONS + bool "Target Options" if DEVEL + + config TARGET_OPTIMIZATION + string "Target Optimizations" if TARGET_OPTIONS + default DEFAULT_TARGET_OPTIMIZATION + help + Optimizations to use when building for the target host. + + config SOFT_FLOAT + bool "Use software floating point by default" if TARGET_OPTIONS + default y if !HAS_FPU + depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64 + help + If your target CPU does not have a Floating Point Unit (FPU) or a + kernel FPU emulator, but you still wish to support floating point + functions, then everything will need to be compiled with soft floating + point support (-msoft-float). + + Most people will answer N. + + config USE_MIPS16 + bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS + depends on HAS_MIPS16 + default y + help + If your target CPU does support the MIPS16 instruction set + and you want to use it for packages, enable this option. + MIPS16 produces smaller binaries thus reducing pressure on + caches and TLB. + + Most people will answer N. + + +menuconfig EXTERNAL_TOOLCHAIN + bool + prompt "Use external toolchain" if DEVEL + help + If enabled, LEDE will compile using an existing toolchain instead of + compiling one. + + config NATIVE_TOOLCHAIN + bool + prompt "Use host's toolchain" if DEVEL + depends on EXTERNAL_TOOLCHAIN + select NO_STRIP + help + If enabled, LEDE will compile using the native toolchain for your + host instead of compiling one. + + config TARGET_NAME + string + prompt "Target name" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "aarch64-unknown-linux-gnu" if aarch64 + default "aarch64_be-unknown-linux-gnu" if aarch64_be + default "arm-unknown-linux-gnu" if arm + default "armeb-unknown-linux-gnu" if armeb + default "i486-unknown-linux-gnu" if i386 + default "mips-unknown-linux-gnu" if mips + default "mipsel-unknown-linux-gnu" if mipsel + default "powerpc-unknown-linux-gnu" if powerpc + default "x86_64-unknown-linux-gnu" if x86_64 + + config TOOLCHAIN_PREFIX + string + prompt "Toolchain prefix" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "aarch64-unknown-linux-gnu" if aarch64 + default "aarch64_be-unknown-linux-gnu" if aarch64_be + default "arm-unknown-linux-gnu-" if arm + default "armeb-unknown-linux-gnu-" if armeb + default "i486-unknown-linux-gnu-" if i386 + default "mips-unknown-linux-gnu-" if mips + default "mipsel-unknown-linux-gnu-" if mipsel + default "powerpc-unknown-linux-gnu-" if powerpc + default "x86_64-unknown-linux-gnu-" if x86_64 + + config TOOLCHAIN_ROOT + string + prompt "Toolchain root" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64 + default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be + default "/opt/cross/arm-unknown-linux-gnu" if arm + default "/opt/cross/armeb-unknown-linux-gnu" if armeb + default "/opt/cross/i486-unknown-linux-gnu" if i386 + default "/opt/cross/mips-unknown-linux-gnu" if mips + default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel + default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc + default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64 + + choice TOOLCHAIN_LIBC_TYPE + prompt "Toolchain libc" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL + help + Specify the libc type used by the external toolchain. The given value + is passed as -m flag to all gcc and g++ invocations. This is mainly + intended for multilib toolchains which support glibc and uclibc at + the same time. If no value is specified, no -m flag is passed. + + config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC + bool "glibc" + select USE_GLIBC + + config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC + bool "uClibc" + select USE_UCLIBC + depends on !(aarch64 || aarch64_be) + + config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL + bool "musl" + select USE_MUSL + + endchoice + + config TOOLCHAIN_LIBC + string + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC + default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC + default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL + + config TOOLCHAIN_BIN_PATH + string + prompt "Toolchain program path" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "./usr/bin ./bin" + help + Specify additional directories searched for toolchain binaries + (override PATH). Use ./DIR for directories relative to the root above. + + config TOOLCHAIN_INC_PATH + string + prompt "Toolchain include path" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "./usr/include ./include" + help + Specify additional directories searched for header files (override + CPPFLAGS). Use ./DIR for directories relative to the root above. + + config TOOLCHAIN_LIB_PATH + string + prompt "Toolchain library path" if DEVEL + depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN + default "./usr/lib ./lib" + help + Specify additional directories searched for libraries (override LDFLAGS). + Use ./DIR for directories relative to the root above. + +config NEED_TOOLCHAIN + bool + depends on DEVEL + default y if !EXTERNAL_TOOLCHAIN + +menuconfig TOOLCHAINOPTS + bool "Toolchain Options" if DEVEL + depends on NEED_TOOLCHAIN + +menuconfig EXTRA_TARGET_ARCH + bool + prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS + depends on !sparc + default y if powerpc64 + default n + help + Some builds may require a 'biarch' toolchain. This option + allows you to specify an additional target arch. + + Most people will answer N here. + + config EXTRA_TARGET_ARCH_NAME + string + default "powerpc64" if powerpc64 + prompt "Extra architecture name" if EXTRA_TARGET_ARCH + help + Specify the cpu name (eg powerpc64 or x86_64) of the + additional target architecture. + + config EXTRA_TARGET_ARCH_OPTS + string + default "-m64" if powerpc64 + prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH + help + If you're specifying an addition target architecture, + you'll probably need to also provide options to make + the compiler use this alternate arch. + + For example, if you're building a compiler that can build + both powerpc and powerpc64 binaries, you'll need to + specify -m64 here. + + + choice + prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el) + default MIPS64_ABI_N64 + help + MIPS64 supports 3 different user-land ABIs: o32 (legacy), + n32 and n64. + + config MIPS64_ABI_N64 + bool "n64" + + config MIPS64_ABI_N32 + depends on !LIBC_USE_MUSL + bool "n32" + + config MIPS64_ABI_O32 + bool "o32" + + endchoice + +comment "Binary tools" + depends on TOOLCHAINOPTS + +source "toolchain/binutils/Config.in" + +comment "Compiler" + depends on TOOLCHAINOPTS + +source "toolchain/gcc/Config.in" + +config YASM + bool + depends on ( i386 || x86_64 ) + prompt "Build yasm" if TOOLCHAINOPTS + default y + help + Enable if you want to build yasm + +comment "C Library" + depends on TOOLCHAINOPTS + +choice + prompt "C Library implementation" if TOOLCHAINOPTS + default LIBC_USE_UCLIBC if arc + default LIBC_USE_MUSL + help + Select the C library implementation. + + config LIBC_USE_GLIBC + bool "Use glibc" + select USE_GLIBC + depends on !arc + + config LIBC_USE_UCLIBC + select USE_UCLIBC + bool "Use uClibc" + depends on !(aarch64 || aarch64_be) + depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) + + config LIBC_USE_MUSL + select USE_MUSL + bool "Use musl" + depends on !(arc) + +endchoice + +source "toolchain/uClibc/Config.in" + +comment "Debuggers" + depends on TOOLCHAINOPTS + +config GDB + bool + depends on !(aarch64 || aarch64_be) + prompt "Build gdb" if TOOLCHAINOPTS + default y if !EXTERNAL_TOOLCHAIN + help + Enable if you want to build the gdb. + +config USE_GLIBC + bool + +config USE_UCLIBC + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) + bool + +config USE_MUSL + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) + bool + +config USE_EXTERNAL_LIBC + bool + default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN + +source "toolchain/binutils/Config.version" +source "toolchain/gcc/Config.version" + +config LIBC + string + default "glibc" if USE_GLIBC + default "uClibc" if USE_UCLIBC + default "musl" if USE_MUSL + +config TARGET_SUFFIX + string + default "gnueabi" if USE_GLIBC && (arm || armeb) + default "gnu" if USE_GLIBC && !(arm || armeb) + default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) + default "uclibc" if USE_UCLIBC && !(arm || armeb) + default "muslgnueabi" if USE_MUSL && (arm || armeb) + default "musl" if USE_MUSL && !(arm || armeb) + +config MIPS64_ABI + depends on mips64 || mips64el + string + default "64" if MIPS64_ABI_N64 + default "n32" if MIPS64_ABI_N32 + default "32" if MIPS64_ABI_O32 + default "64" diff --git a/toolchain-old/Makefile b/toolchain-old/Makefile new file mode 100644 index 000000000..409955c23 --- /dev/null +++ b/toolchain-old/Makefile @@ -0,0 +1,97 @@ +# +# Copyright (C) 2007-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# Main makefile for the toolchain +# +# Steps: +# 1) toolchain/binutils/compile +# build & install binutils +# 2) toolchain/gcc/minimal/compile +# build & install a minimal gcc, needed for steps 3 & 4 +# 3) toolchain/kernel-headers/compile +# install kernel headers, needed for step 4 +# 4) toolchain/libc/headers/compile +# build & install libc headers & support files, needed for step 5 +# 5) toolchain/gcc/initial/compile +# build & install an initial gcc, needed for step 6 +# 6) toolchain/libc/compile +# build & install the final libc +# 7) toolchain/gcc/final/compile +# build & install the final gcc +# 8) toolchain/libc/utils/compile +# build & install libc utilities +# +# For musl, steps 2 and 4 are skipped, and step 3 is done after 5 + +curdir:=toolchain + +# subdirectories to descend into +$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_YASM),yasm) +ifdef CONFIG_USE_UCLIBC + $(curdir)/builddirs += $(LIBC)/utils +endif + +# builddir dependencies +ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) + ifdef CONFIG_USE_MUSL + $(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/compile + $(curdir)/$(LIBC)/compile:=$(curdir)/kernel-headers/compile + else + $(curdir)/builddirs += $(LIBC)/headers gcc/minimal + $(curdir)/gcc/minimal/compile:=$(curdir)/binutils/compile + $(curdir)/kernel-headers/compile:=$(curdir)/gcc/minimal/compile + $(curdir)/$(LIBC)/headers/compile:=$(curdir)/kernel-headers/compile + $(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/compile + endif + + $(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile + $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile + $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile + $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile +endif + +ifndef DUMP_TARGET_DB +ifneq ($(ARCH),) + $(TOOLCHAIN_DIR)/info.mk: .config + @for dir in $(TOOLCHAIN_DIR); do ( \ + $(if $(QUIET),,set -x;) \ + mkdir -p "$$dir"; \ + cd "$$dir"; \ + ln -nsf lib lib64; \ + ln -nsf lib lib32; \ + mkdir -p stamp lib usr/include usr/lib ; \ + ); done + @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@ + @touch $@ +endif +endif + +ifdef CONFIG_BUILDBOT + $(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build + cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check + cmp -s $(TMP_DIR)/.ver_check $@ || { \ + rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \ + mkdir -p $(TOOLCHAIN_DIR)/stamp; \ + mv $(TMP_DIR)/.ver_check $@; \ + } + +$(TOOLCHAIN_DIR)/info.mk $(STAGING_DIR)/.prepared: $(TOOLCHAIN_DIR)/stamp/.ver_check +endif + +# prerequisites for the individual targets +$(curdir)/ := .config prereq +$(curdir)//compile = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk $(tools/stamp-compile) + +ifndef DUMP_TARGET_DB +$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed: +endif + +$(curdir)/install: $(curdir)/compile + +$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR))) +$(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build)) +$(eval $(call subdir,$(curdir))) + diff --git a/toolchain-old/binutils/Config.in b/toolchain-old/binutils/Config.in new file mode 100644 index 000000000..8fe33fb6b --- /dev/null +++ b/toolchain-old/binutils/Config.in @@ -0,0 +1,32 @@ +# Choose binutils version. + +choice + prompt "Binutils Version" if TOOLCHAINOPTS + default BINUTILS_USE_VERSION_2_28 if !arc + default BINUTILS_USE_VERSION_2_28_ARC if arc + help + Select the version of binutils you wish to use. + + config BINUTILS_USE_VERSION_2_27 + depends on !arc + bool "Binutils 2.27" + select BINUTILS_VERSION_2_27 + + config BINUTILS_USE_VERSION_2_28 + depends on !arc + bool "Binutils 2.28" + select BINUTILS_VERSION_2_28 + + config BINUTILS_USE_VERSION_2_28_ARC + depends on arc + bool "ARC binutils 2.28" + select BINUTILS_VERSION_2_28_ARC + +endchoice + +config EXTRA_BINUTILS_CONFIG_OPTIONS + string + prompt "Additional binutils configure options" if TOOLCHAINOPTS + default "" + help + Any additional binutils options you may want to include.... diff --git a/toolchain-old/binutils/Config.version b/toolchain-old/binutils/Config.version new file mode 100644 index 000000000..1b223e410 --- /dev/null +++ b/toolchain-old/binutils/Config.version @@ -0,0 +1,16 @@ +config BINUTILS_VERSION_2_27 + bool + +config BINUTILS_VERSION_2_28 + default y if (!TOOLCHAINOPTS && !arc) + bool + +config BINUTILS_VERSION_2_28_ARC + default y if (!TOOLCHAINOPTS && arc) + bool + +config BINUTILS_VERSION + string + default "2.27" if BINUTILS_VERSION_2_27 + default "2.28" if BINUTILS_VERSION_2_28 + default "arc-2017.03" if BINUTILS_VERSION_2_28_ARC diff --git a/toolchain-old/binutils/Makefile b/toolchain-old/binutils/Makefile new file mode 100644 index 000000000..6df11fbd3 --- /dev/null +++ b/toolchain-old/binutils/Makefile @@ -0,0 +1,112 @@ +# +# Copyright (C) 2006-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=binutils +PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION)) +BIN_VERSION:=$(PKG_VERSION) + +PKG_SOURCE_URL:=@GNU/binutils/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +ifeq ($(PKG_VERSION),2.27) + PKG_HASH:=369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 +endif + +ifeq ($(PKG_VERSION),2.28) + PKG_HASH:=6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 +endif + +ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),) + PKG_REV:=arc-2017.03-release + PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/ + PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz + PKG_HASH:=f9c1e09ef10aaf9619181f49587f464ba0a70d29b7f6f879047140acac852409 + BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV) + HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR) +endif + +HOST_BUILD_PARALLEL:=1 + +PATCH_DIR:=./patches/$(PKG_VERSION) + +include $(INCLUDE_DIR)/toolchain-build.mk + +BINUTILS_CONFIGURE:= \ + ./configure \ + --prefix=$(TOOLCHAIN_DIR) \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --with-sysroot=$(TOOLCHAIN_DIR) \ + --enable-deterministic-archives \ + --enable-plugins \ + --disable-multilib \ + --disable-werror \ + --disable-nls \ + --disable-sim \ + --disable-gdb \ + $(GRAPHITE_CONFIGURE) \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) + +ifneq ($(CONFIG_SSP_SUPPORT),) + BINUTILS_CONFIGURE+= \ + --enable-libssp +else + BINUTILS_CONFIGURE+= \ + --disable-libssp +endif + +ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) + BINUTILS_CONFIGURE+= \ + --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) +endif + +define Host/Prepare + $(call Host/Prepare/Default) + ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ + $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h +endef + +define Host/Configure + (cd $(HOST_BUILD_DIR); \ + $(BINUTILS_CONFIGURE) \ + ); +endef + +define Host/Compile + +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all +endef + +define Host/Install + mkdir -p $(TOOLCHAIN_DIR)/initial + $(MAKE) -C $(HOST_BUILD_DIR) \ + prefix=$(TOOLCHAIN_DIR)/initial \ + install + $(MAKE) -C $(HOST_BUILD_DIR) \ + prefix=$(TOOLCHAIN_DIR) \ + install + $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) + $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a + $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf + # ARC gcc requires extlib. + # If extlib is not available in "initial" folder + # initial gcc will fail to build libc. + if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \ + $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \ + fi +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch b/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch new file mode 100644 index 000000000..36e09b1bb --- /dev/null +++ b/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch @@ -0,0 +1,36 @@ +From 4d4f40e041ce7c8c7c8e50f957e0440b64ab7e95 Mon Sep 17 00:00:00 2001 +From: "Maciej W. Rozycki" +Date: Fri, 23 Dec 2016 20:03:36 +0000 +Subject: [PATCH] MIPS/BFD: Remove EI_ABIVERSION 5 allocation for PT_GNU_STACK + support + +Revert commit 17733f5be961 ("Increment the ABIVERSION to 5 for MIPS +objects with non-executable stacks.") and remove EI_ABIVERSION 5 +allocation for PT_GNU_STACK support, which has not made it to glibc +and will be reassigned. + + bfd/ + * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Revert + 2016-02-23 change and remove EI_ABIVERSION 5 support. +--- + bfd/ChangeLog | 5 +++++ + bfd/elfxx-mips.c | 3 --- + 2 files changed, 5 insertions(+), 3 deletions(-) + +diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c +index d649676..486607c 100644 +--- a/bfd/elfxx-mips.c ++++ b/bfd/elfxx-mips.c +@@ -16358,9 +16358,6 @@ _bfd_mips_post_process_headers (bfd *abfd, struct bfd_link_info *link_info) + if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64 + || mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A) + i_ehdrp->e_ident[EI_ABIVERSION] = 3; +- +- if (elf_stack_flags (abfd) && !(elf_stack_flags (abfd) & PF_X)) +- i_ehdrp->e_ident[EI_ABIVERSION] = 5; + } + + int +-- +2.9.3 + diff --git a/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch new file mode 100644 index 000000000..e4cec7f69 --- /dev/null +++ b/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch @@ -0,0 +1,22 @@ +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch new file mode 100644 index 000000000..95d3f75b8 --- /dev/null +++ b/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch @@ -0,0 +1,20 @@ +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1244,6 +1244,8 @@ fragment <link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch b/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch new file mode 100644 index 000000000..b7458e58a --- /dev/null +++ b/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch @@ -0,0 +1,18 @@ +--- a/bfd/elfxx-mips.c ++++ b/bfd/elfxx-mips.c +@@ -7713,6 +7713,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; + bh = NULL; ++ if (0) { + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, + NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) +@@ -7725,6 +7726,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; ++ } + + if (! mips_elf_hash_table (info)->use_rld_obj_head) + { diff --git a/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch b/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch new file mode 100644 index 000000000..7a8f0ae13 --- /dev/null +++ b/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch @@ -0,0 +1,37 @@ +--- a/bfd/config.bfd ++++ b/bfd/config.bfd +@@ -1101,12 +1101,12 @@ case "${targ}" in + targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" + ;; + mips64*el-*-linux*) +- targ_defvec=mips_elf32_ntrad_le_vec +- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" ++ targ_defvec=mips_elf64_trad_le_vec ++ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" + ;; + mips64*-*-linux*) +- targ_defvec=mips_elf32_ntrad_be_vec +- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ++ targ_defvec=mips_elf64_trad_be_vec ++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" + ;; + mips*el-*-linux*) + targ_defvec=mips_elf32_trad_le_vec +--- a/ld/configure.tgt ++++ b/ld/configure.tgt +@@ -513,11 +513,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip + mips*-*-vxworks*) targ_emul=elf32ebmipvxworks + targ_extra_emuls="elf32elmipvxworks" ;; + mips*-*-windiss) targ_emul=elf32mipswindiss ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch new file mode 100644 index 000000000..e4cec7f69 --- /dev/null +++ b/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch @@ -0,0 +1,22 @@ +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch new file mode 100644 index 000000000..95d3f75b8 --- /dev/null +++ b/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch @@ -0,0 +1,20 @@ +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1244,6 +1244,8 @@ fragment <link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch b/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch new file mode 100644 index 000000000..b7458e58a --- /dev/null +++ b/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch @@ -0,0 +1,18 @@ +--- a/bfd/elfxx-mips.c ++++ b/bfd/elfxx-mips.c +@@ -7713,6 +7713,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; + bh = NULL; ++ if (0) { + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, + NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) +@@ -7725,6 +7726,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; ++ } + + if (! mips_elf_hash_table (info)->use_rld_obj_head) + { diff --git a/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch b/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch new file mode 100644 index 000000000..7a8f0ae13 --- /dev/null +++ b/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch @@ -0,0 +1,37 @@ +--- a/bfd/config.bfd ++++ b/bfd/config.bfd +@@ -1101,12 +1101,12 @@ case "${targ}" in + targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" + ;; + mips64*el-*-linux*) +- targ_defvec=mips_elf32_ntrad_le_vec +- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" ++ targ_defvec=mips_elf64_trad_le_vec ++ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" + ;; + mips64*-*-linux*) +- targ_defvec=mips_elf32_ntrad_be_vec +- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ++ targ_defvec=mips_elf64_trad_be_vec ++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" + ;; + mips*el-*-linux*) + targ_defvec=mips_elf32_trad_le_vec +--- a/ld/configure.tgt ++++ b/ld/configure.tgt +@@ -513,11 +513,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip + mips*-*-vxworks*) targ_emul=elf32ebmipvxworks + targ_extra_emuls="elf32elmipvxworks" ;; + mips*-*-windiss) targ_emul=elf32mipswindiss ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch new file mode 100644 index 000000000..e4cec7f69 --- /dev/null +++ b/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch @@ -0,0 +1,22 @@ +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch new file mode 100644 index 000000000..95d3f75b8 --- /dev/null +++ b/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch @@ -0,0 +1,20 @@ +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1244,6 +1244,8 @@ fragment <link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/fortify-headers/Makefile b/toolchain-old/fortify-headers/Makefile new file mode 100644 index 000000000..8caf8c84c --- /dev/null +++ b/toolchain-old/fortify-headers/Makefile @@ -0,0 +1,28 @@ +# +# Copyright (C) 2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/target.mk + +PKG_NAME:=fortify-headers +PKG_VERSION:=0.8 +PKG_RELEASE=1 + +PKG_SOURCE_URL:=http://dl.2f30.org/releases +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=afcd073d6d8d175eede2a28a7dd71b7150cb03290f99102261892c793f6b4cb1 + +include $(INCLUDE_DIR)/toolchain-build.mk + +define Host/Compile + true +endef + +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) PREFIX="" DESTDIR="$(TOOLCHAIN_DIR)" install +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/gcc/Config.in b/toolchain-old/gcc/Config.in new file mode 100644 index 000000000..ea33ac29c --- /dev/null +++ b/toolchain-old/gcc/Config.in @@ -0,0 +1,78 @@ +# Choose gcc version. + +choice + prompt "GCC compiler Version" if TOOLCHAINOPTS + default GCC_USE_VERSION_6_3_ARC if arc + default GCC_USE_VERSION_5 + help + Select the version of gcc you wish to use. + + config GCC_USE_VERSION_6_3_ARC + select GCC_VERSION_6_3_ARC + bool "gcc 6.3.x with support of ARC cores" + depends on arc + + config GCC_USE_VERSION_5 + bool "gcc 5.x" + depends on !arc + + config GCC_USE_VERSION_6 + bool "gcc 6.x" + depends on !arc + + config GCC_USE_VERSION_7 + bool "gcc 7.x" + depends on !arc + +endchoice + +config GCC_USE_GRAPHITE + bool + prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS + +config EXTRA_GCC_CONFIG_OPTIONS + string + prompt "Additional gcc configure options" if TOOLCHAINOPTS + default "" + help + Any additional gcc options you may want to include.... + +config SSP_SUPPORT + bool + prompt "Enable Stack-Smashing Protection support" if TOOLCHAINOPTS + depends on !USE_MUSL + default y if !USE_MUSL + help + Enable Stack-Smashing Protection support + +config SJLJ_EXCEPTIONS + bool + prompt "Use setjump()/longjump() exceptions" if TOOLCHAINOPTS + default n + help + Use old setjump()/longjump() exceptions instead of the newer + frame unwinding exceptions handling routines. Warning: increases + code size and runtime memory usage. + +config INSTALL_LIBGCJ + bool + prompt "Build/install java compiler and GNU classpath ?" if TOOLCHAINOPTS + default n + help + Build/install java compiler and GNU classpath ? + + +config INSTALL_GFORTRAN + bool + prompt "Build/install fortran compiler?" if TOOLCHAINOPTS + default n + help + Build/install GNU fortran compiler ? + +config INSTALL_GCCGO + bool + prompt "Build/install Go compiler?" if TOOLCHAINOPTS + depends on USE_GLIBC || BROKEN + default n + help + Build/install GNU gccgo compiler ? diff --git a/toolchain-old/gcc/Config.version b/toolchain-old/gcc/Config.version new file mode 100644 index 000000000..86c723dc9 --- /dev/null +++ b/toolchain-old/gcc/Config.version @@ -0,0 +1,14 @@ +config GCC_VERSION_6_3_ARC + default y if (!TOOLCHAINOPTS && arc) + bool + +config GCC_VERSION + string + default "arc-2017.03-release" if GCC_VERSION_6_3_ARC + default "6.3.0" if GCC_USE_VERSION_6 + default "7.1.0" if GCC_USE_VERSION_7 + default "5.4.0" + +config GCC_VERSION_6_3 + bool + default y if GCC_VERSION_6_3_ARC diff --git a/toolchain-old/gcc/common.mk b/toolchain-old/gcc/common.mk new file mode 100644 index 000000000..abf69bfdc --- /dev/null +++ b/toolchain-old/gcc/common.mk @@ -0,0 +1,228 @@ +# +# Copyright (C) 2002-2003 Erik Andersen +# Copyright (C) 2004 Manuel Novoa III +# Copyright (C) 2005-2006 Felix Fietkau +# Copyright (C) 2006-2014 OpenWrt.org +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +include $(TOPDIR)/rules.mk + +PKG_NAME:=gcc +GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION)) +PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION))) +GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) + +PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 + +ifeq ($(PKG_VERSION),5.4.0) + PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a +endif + +ifeq ($(PKG_VERSION),6.3.0) + PKG_HASH:=f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f +endif + +ifeq ($(PKG_VERSION),7.1.0) + PKG_HASH:=8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 +endif + +ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),) + PKG_VERSION:=6.3.0 + PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/$(GCC_VERSION) + PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz + PKG_HASH:=b7223e134199b1a6f71de629da6aa845790e55d28e9892143dde09b1bc878110 + PKG_REV:=2017.03-release + GCC_DIR:=gcc-arc-$(PKG_REV) + HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION) +endif + +PATCH_DIR=../patches/$(GCC_VERSION) + +BUGURL=http://www.lede-project.org/bugs/ +PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION) + +HOST_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/toolchain-build.mk + +HOST_SOURCE_DIR:=$(HOST_BUILD_DIR) +ifeq ($(GCC_VARIANT),minimal) + GCC_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) +else + HOST_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) + GCC_BUILD_DIR:=$(HOST_BUILD_DIR) +endif + +HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared +HOST_STAMP_BUILT:=$(GCC_BUILD_DIR)/.built +HOST_STAMP_CONFIGURED:=$(GCC_BUILD_DIR)/.configured +HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.gcc_$(GCC_VARIANT)_installed + +SEP:=, +TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" + +TAR_OPTIONS += \ + --exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ + +ifndef CONFIG_INSTALL_LIBGCJ + TAR_OPTIONS += --exclude=libjava +endif + +export libgcc_cv_fixed_point=no +ifdef CONFIG_USE_UCLIBC + export glibcxx_cv_c99_math_tr1=no +endif +ifdef CONFIG_INSTALL_GCCGO + export libgo_cv_c_split_stack_supported=no +endif + +ifdef CONFIG_GCC_USE_GRAPHITE + GRAPHITE_CONFIGURE:= --with-isl=$(TOPDIR)/staging_dir/host +else + GRAPHITE_CONFIGURE:= --without-isl --without-cloog +endif + +GCC_CONFIGURE:= \ + SHELL="$(BASH)" \ + $(if $(shell gcc --version 2>&1 | grep LLVM), \ + CFLAGS="-O2 -fbracket-depth=512 -pipe" \ + CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \ + ) \ + $(HOST_SOURCE_DIR)/configure \ + --with-bugurl=$(BUGURL) \ + --with-pkgversion="$(PKGVERSION)" \ + --prefix=$(TOOLCHAIN_DIR) \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --with-gnu-ld \ + --enable-target-optspace \ + --disable-libgomp \ + --disable-libmudflap \ + --disable-multilib \ + --disable-libmpx \ + --disable-nls \ + $(GRAPHITE_CONFIGURE) \ + --with-host-libstdcxx=-lstdc++ \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ + $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ + --with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \ + $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ + --with-gmp=$(TOPDIR)/staging_dir/host \ + --with-mpfr=$(TOPDIR)/staging_dir/host \ + --with-mpc=$(TOPDIR)/staging_dir/host \ + --disable-decimal-float +ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) + GCC_CONFIGURE += --with-mips-plt +endif + +ifndef GCC_VERSION_4_8 + GCC_CONFIGURE += --with-diagnostics-color=auto-if-env +endif + +ifneq ($(CONFIG_SSP_SUPPORT),) + GCC_CONFIGURE+= \ + --enable-libssp +else + GCC_CONFIGURE+= \ + --disable-libssp +endif + +ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) + GCC_CONFIGURE+= \ + --enable-biarch \ + --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) +endif + +ifdef CONFIG_sparc + GCC_CONFIGURE+= \ + --enable-targets=all \ + --with-long-double-128 +endif + +ifeq ($(LIBC),uClibc) + GCC_CONFIGURE+= \ + --disable-__cxa_atexit +else + GCC_CONFIGURE+= \ + --enable-__cxa_atexit +endif + +ifneq ($(GCC_ARCH),) + GCC_CONFIGURE+= --with-arch=$(GCC_ARCH) +endif + +ifneq ($(CONFIG_SOFT_FLOAT),y) + ifeq ($(CONFIG_arm),y) + GCC_CONFIGURE+= \ + --with-float=hard + endif +endif + +ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy) + TARGET_CFLAGS+=-fno-split-stack +endif + +GCC_MAKE:= \ + export SHELL="$(BASH)"; \ + $(MAKE) \ + CFLAGS="$(HOST_CFLAGS)" \ + CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ + CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ + GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" + +define Host/SetToolchainInfo + $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk +endef + +ifneq ($(GCC_PREPARE),) + define Host/Prepare + $(call Host/SetToolchainInfo) + $(call Host/Prepare/Default) + ln -snf $(GCC_DIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_SOURCE_DIR)/ + $(SED) 's,^MULTILIB_OSDIRNAMES,# MULTILIB_OSDIRNAMES,' $(HOST_SOURCE_DIR)/gcc/config/*/t-* + $(SED) 'd' $(HOST_SOURCE_DIR)/gcc/DEV-PHASE + $(SED) 's, DATESTAMP,,' $(HOST_SOURCE_DIR)/gcc/version.c + #(cd $(HOST_SOURCE_DIR)/libstdc++-v3; autoconf;); + $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_SOURCE_DIR)/libstdc++-v3/configure + mkdir -p $(GCC_BUILD_DIR) + endef +else + define Host/Prepare + mkdir -p $(GCC_BUILD_DIR) + endef +endif + +define Host/Configure + (cd $(GCC_BUILD_DIR) && rm -f config.cache; \ + $(GCC_CONFIGURE) \ + ); +endef + +define Host/Clean + rm -rf $(if $(GCC_PREPARE),$(HOST_SOURCE_DIR)) \ + $(HOST_BUILD_PREFIX)/stamp/.gcc_* \ + $(HOST_BUILD_PREFIX)/stamp/.binutils_* \ + $(GCC_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ + $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) \ + $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc* \ + $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c* +endef diff --git a/toolchain-old/gcc/exclude-testsuite b/toolchain-old/gcc/exclude-testsuite new file mode 100644 index 000000000..37a8f2476 --- /dev/null +++ b/toolchain-old/gcc/exclude-testsuite @@ -0,0 +1,9 @@ +gcc-*/gcc/testsuite/ada +gcc-*/gcc/testsuite/brig.dg +gcc-*/gcc/testsuite/c-c++-common +gcc-*/gcc/testsuite/ChangeLog* +gcc-*/gcc/testsuite/config +gcc-*/gcc/testsuite/g* +gcc-*/gcc/testsuite/jit.dg +gcc-*/gcc/testsuite/lib +gcc-*/gcc/testsuite/o* diff --git a/toolchain-old/gcc/files/alternate-arch-cc.in b/toolchain-old/gcc/files/alternate-arch-cc.in new file mode 100644 index 000000000..e169951eb --- /dev/null +++ b/toolchain-old/gcc/files/alternate-arch-cc.in @@ -0,0 +1,3 @@ +#!/bin/sh + +exec @CC_BASE@ @EXTRA_ARCH_OPTS@ "$@" diff --git a/toolchain-old/gcc/final/Makefile b/toolchain-old/gcc/final/Makefile new file mode 100644 index 000000000..b815f677d --- /dev/null +++ b/toolchain-old/gcc/final/Makefile @@ -0,0 +1,87 @@ +GCC_VARIANT:=final + +include ../common.mk + +GCC_CONFIGURE += \ + --with-headers=$(TOOLCHAIN_DIR)/include \ + --disable-libsanitizer \ + --enable-languages=$(TARGET_LANGUAGES) \ + --enable-shared \ + --enable-threads \ + --with-slibdir=$(TOOLCHAIN_DIR)/lib \ + --enable-lto \ + --with-libelf=$(TOPDIR)/staging_dir/host + +ifdef CONFIG_USE_MUSL + GCC_MAKE += gcc_cv_libc_provides_ssp=yes +endif + +ifneq ($(CONFIG_SJLJ_EXCEPTIONS),) + GCC_CONFIGURE += \ + --enable-sjlj-exceptions +endif + +define CleanupToolchain + $(INSTALL_DIR) $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) + # Important! Required for limits.h to be fixed. + rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include + ln -sf ../include $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include + rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib + ln -sf ../lib $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib + $(if $(CONFIG_ARCH_64BIT),ln -sf ../lib64 $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib64) +endef + +define Host/Configure + $(CleanupToolchain) + mkdir -p $(GCC_BUILD_DIR) + (cd $(GCC_BUILD_DIR) && rm -f config.cache; \ + $(GCC_CONFIGURE) \ + ); +endef + +ifeq ($(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yy) +define FixGogccCrt + # link crtX.o for gotools + mkdir -p $(GCC_BUILD_DIR)/gotools + $(foreach crt, i 1 n, ln -sf ../../glibc-dev/lib/crt$(crt).o $(GCC_BUILD_DIR)/gotools/ ; ) +endef +endif + +define Host/Compile + $(FixGogccCrt) + +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all +endef + +define SetupExtraArch + for app in $(TOOLCHAIN_DIR)/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \ + [ -e $$$$app ] || continue; \ + old_base=$$$$(basename $$$$app); \ + new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \ + sed -e "s/@CC_BASE@/$$$$old_base/" \ + -e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \ + ../files/alternate-arch-cc.in > \ + $(TOOLCHAIN_DIR)/bin/$$$$new_base; \ + chmod a+x $(TOOLCHAIN_DIR)/bin/$$$$new_base; \ + done +endef + +define Host/Install + $(CleanupToolchain) + +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) install + # Set up the symlinks to enable lying about target name. + set -e; \ + (cd $(TOOLCHAIN_DIR); \ + ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ + cd bin; \ + for app in $(REAL_GNU_TARGET_NAME)-* ; do \ + ln -sf $$$${app} \ + $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ + done; \ + ); + $(if $(CONFIG_EXTRA_TARGET_ARCH),$(call SetupExtraArch)) + $(RM) $(TOOLCHAIN_DIR)/lib/libiberty.a + $(SCRIPT_DIR)/patch-specs.sh "$(TOOLCHAIN_DIR)" +endef + +$(eval $(call HostBuild)) + diff --git a/toolchain-old/gcc/initial/Makefile b/toolchain-old/gcc/initial/Makefile new file mode 100644 index 000000000..c71b17dd8 --- /dev/null +++ b/toolchain-old/gcc/initial/Makefile @@ -0,0 +1,36 @@ +GCC_VARIANT:=initial +GCC_PREPARE=$(CONFIG_USE_MUSL) + +include ../common.mk + +GCC_CONFIGURE += \ + --with-newlib \ + --with-sysroot=$(TOOLCHAIN_DIR) \ + --enable-languages=c \ + --disable-shared \ + --disable-threads \ + +define Host/Compile + +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ + all-build-libiberty \ + all-gcc \ + all-target-libgcc +endef + +define Host/Install + +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ + prefix="$(TOOLCHAIN_DIR)/initial" \ + install-gcc \ + install-target-libgcc + + # XXX: glibc insists on linking against libgcc_eh + ( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \ + [ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \ + cp libgcc.a libgcc_initial.a; \ + ) + + $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) + $$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/gcc/minimal/Makefile b/toolchain-old/gcc/minimal/Makefile new file mode 100644 index 000000000..31d6f675a --- /dev/null +++ b/toolchain-old/gcc/minimal/Makefile @@ -0,0 +1,29 @@ +GCC_VARIANT:=minimal +GCC_PREPARE=$(if $(CONFIG_USE_MUSL),,1) + +include ../common.mk + +GCC_CONFIGURE += \ + --with-newlib \ + --without-headers \ + --enable-languages=c \ + --disable-libsanitizer \ + --disable-libssp \ + --disable-shared \ + --disable-threads + +define Host/Compile + +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all-gcc all-target-libgcc +endef + +define Host/Install + $(GCC_MAKE) -C $(GCC_BUILD_DIR) install-gcc install-target-libgcc +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(GCC_BUILD_DIR) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain/gcc/patches/5.4.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/001-revert_register_mode_search.patch rename to toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch diff --git a/toolchain/gcc/patches/5.4.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/002-case_insensitive.patch rename to toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch diff --git a/toolchain/gcc/patches/5.4.0/010-documentation.patch b/toolchain-old/gcc/patches/5.4.0/010-documentation.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/010-documentation.patch rename to toolchain-old/gcc/patches/5.4.0/010-documentation.patch diff --git a/toolchain/gcc/patches/5.4.0/020-no-plt-backport.patch b/toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/020-no-plt-backport.patch rename to toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch diff --git a/toolchain/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch b/toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch rename to toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch diff --git a/toolchain/gcc/patches/5.4.0/200-musl_config.patch b/toolchain-old/gcc/patches/5.4.0/200-musl_config.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/200-musl_config.patch rename to toolchain-old/gcc/patches/5.4.0/200-musl_config.patch diff --git a/toolchain/gcc/patches/5.4.0/201-musl_arm.patch b/toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/201-musl_arm.patch rename to toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch diff --git a/toolchain/gcc/patches/5.4.0/202-musl_mips.patch b/toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/202-musl_mips.patch rename to toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch diff --git a/toolchain/gcc/patches/5.4.0/203-musl_powerpc.patch b/toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/203-musl_powerpc.patch rename to toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch diff --git a/toolchain/gcc/patches/5.4.0/204-musl_sh.patch b/toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/204-musl_sh.patch rename to toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch diff --git a/toolchain/gcc/patches/5.4.0/205-musl_x86.patch b/toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/205-musl_x86.patch rename to toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch diff --git a/toolchain/gcc/patches/5.4.0/206-musl_aarch64.patch b/toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/206-musl_aarch64.patch rename to toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch diff --git a/toolchain/gcc/patches/5.4.0/207-musl_fixincludes.patch b/toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/207-musl_fixincludes.patch rename to toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch diff --git a/toolchain/gcc/patches/5.4.0/209-musl_libstdc++.patch b/toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/209-musl_libstdc++.patch rename to toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch diff --git a/toolchain/gcc/patches/5.4.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/230-musl_libssp.patch rename to toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch diff --git a/toolchain/gcc/patches/5.4.0/240-musl-libitm-fixes.patch b/toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/240-musl-libitm-fixes.patch rename to toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch diff --git a/toolchain/gcc/patches/5.4.0/250-add-musl.patch b/toolchain-old/gcc/patches/5.4.0/250-add-musl.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/250-add-musl.patch rename to toolchain-old/gcc/patches/5.4.0/250-add-musl.patch diff --git a/toolchain/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch b/toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch rename to toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch diff --git a/toolchain/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch b/toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch rename to toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch diff --git a/toolchain/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch rename to toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch diff --git a/toolchain/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch diff --git a/toolchain/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch rename to toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch diff --git a/toolchain/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch rename to toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/patches/5.4.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/820-libgcc_pic.patch rename to toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch diff --git a/toolchain/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch rename to toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch diff --git a/toolchain/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch diff --git a/toolchain/gcc/patches/5.4.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/850-use_shared_libgcc.patch rename to toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch diff --git a/toolchain/gcc/patches/5.4.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/851-libgcc_no_compat.patch rename to toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch diff --git a/toolchain/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch rename to toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch diff --git a/toolchain/gcc/patches/5.4.0/880-no_java_section.patch b/toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/880-no_java_section.patch rename to toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch diff --git a/toolchain/gcc/patches/5.4.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/881-no_tm_section.patch rename to toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch diff --git a/toolchain/gcc/patches/5.4.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/900-bad-mips16-crt.patch rename to toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch diff --git a/toolchain/gcc/patches/5.4.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/910-mbsd_multi.patch rename to toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch diff --git a/toolchain/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch rename to toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch diff --git a/toolchain/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch rename to toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch diff --git a/toolchain/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch b/toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch rename to toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch diff --git a/toolchain/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch rename to toolchain-old/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch diff --git a/toolchain/gcc/patches/5.4.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/950-cpp_file_path_translation.patch rename to toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch diff --git a/toolchain/gcc/patches/5.4.0/960-go_libm.patch b/toolchain-old/gcc/patches/5.4.0/960-go_libm.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/960-go_libm.patch rename to toolchain-old/gcc/patches/5.4.0/960-go_libm.patch diff --git a/toolchain/gcc/patches/5.4.0/970-warn_bug.patch b/toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch similarity index 100% rename from toolchain/gcc/patches/5.4.0/970-warn_bug.patch rename to toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch diff --git a/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch new file mode 100644 index 000000000..bd6fbdb4a --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch @@ -0,0 +1,65 @@ +Revert of: + +commit 275035b56823b26d5fb7e90fad945b998648edf2 +Author: bergner +Date: Thu Sep 5 14:09:07 2013 +0000 + + PR target/58139 + * reginfo.c (choose_hard_reg_mode): Scan through all mode classes + looking for widest mode. + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 + + +--- a/gcc/reginfo.c ++++ b/gcc/reginfo.c +@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + + if (found_mode != VOIDmode) diff --git a/toolchain/gcc/patches/7.1.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/002-case_insensitive.patch rename to toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch diff --git a/toolchain-old/gcc/patches/6.3.0/010-documentation.patch b/toolchain-old/gcc/patches/6.3.0/010-documentation.patch new file mode 100644 index 000000000..2adb28c83 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/010-documentation.patch @@ -0,0 +1,23 @@ +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch new file mode 100644 index 000000000..8dfd1fc28 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch @@ -0,0 +1,13 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -858,7 +858,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch new file mode 100644 index 000000000..df09e4f63 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch @@ -0,0 +1,36 @@ +From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 +From: nsz +Date: Tue, 30 Aug 2016 10:26:22 +0000 +Subject: [PATCH] disable ifunc on *-musl by default + +gcc/ + * config.gcc (*-*-*musl*): Disable gnu-indirect-function. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ChangeLog | 4 ++++ + gcc/config.gcc | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes +@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes diff --git a/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 000000000..d76bd8cb1 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -17928,7 +17928,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 000000000..2e7c23f85 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch new file mode 100644 index 000000000..1d06f5b2e --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch @@ -0,0 +1,25 @@ +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -60,8 +60,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch new file mode 100644 index 000000000..f925d96f6 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch @@ -0,0 +1,36 @@ +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -913,7 +914,7 @@ all: libunwind.a + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1115,6 +1116,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch new file mode 100644 index 000000000..37f8f2a54 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch @@ -0,0 +1,13 @@ +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -45,7 +45,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 000000000..cb1fb9823 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,19 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -94,10 +94,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch new file mode 100644 index 000000000..cd20244c6 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch @@ -0,0 +1,47 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -132,10 +132,6 @@ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_assert ("system=posix"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -132,5 +132,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -60,6 +60,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + diff --git a/toolchain/gcc/patches/7.1.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/851-libgcc_no_compat.patch rename to toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch diff --git a/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch new file mode 100644 index 000000000..9e543a0fc --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -24171,7 +24171,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch b/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch new file mode 100644 index 000000000..0fa9e627c --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch @@ -0,0 +1,11 @@ +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -395,7 +395,7 @@ see the files COPYING3 and COPYING.RUNTI + /* If we have named section and we support weak symbols, then use the + .jcr section for recording java classes which need to be registered + at program start-up time. */ +-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK ++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK + #ifndef JCR_SECTION_NAME + #define JCR_SECTION_NAME ".jcr" + #endif diff --git a/toolchain/gcc/patches/7.1.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/881-no_tm_section.patch rename to toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch diff --git a/toolchain/gcc/patches/7.1.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/900-bad-mips16-crt.patch rename to toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch diff --git a/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch new file mode 100644 index 000000000..b747935f0 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch @@ -0,0 +1,222 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -107,6 +107,9 @@ static int class_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1041,6 +1050,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -438,6 +438,10 @@ Wfloat-conversion + C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion) + Warn for implicit type conversions that cause loss of floating point precision. + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality. +@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment. +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -581,6 +581,10 @@ Werror= + Common Joined + Treat specified warning as error. + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings. +@@ -1432,6 +1436,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities. + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -163,6 +163,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++@item -Werror-maybe-reset ++@opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}. + -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol + -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol + -Wempty-body -Wenum-compare -Wno-endif-labels @gol +--Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol ++-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol + -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol +@@ -5737,6 +5737,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++@item -Werror-maybe-reset ++@opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++@item -fhonour-copts ++@opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -629,6 +629,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch new file mode 100644 index 000000000..dc0acb95a --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch @@ -0,0 +1,15 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch + value = varname; + + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", varname); ++ { ++ warning (input_location, "environment variable %qs not defined", varname); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch new file mode 100644 index 000000000..2a99840b6 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t + #undef TARGET_HARD_REGNO_SCRATCH_OK + #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch new file mode 100644 index 000000000..68e62865b --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch @@ -0,0 +1,11 @@ +--- a/libstdc++-v3/include/Makefile.in ++++ b/libstdc++-v3/include/Makefile.in +@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers} + @$(STAMP) stamp-bits + + stamp-bits-sup: stamp-bits ${bits_sup_headers} +- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null ++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null + @$(STAMP) stamp-bits-sup + + stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch new file mode 100644 index 000000000..d467eb7c9 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch @@ -0,0 +1,182 @@ +Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co + add_path (xstrdup (arg), SYSTEM, 0, true); + break; + ++ case OPT_iremap: ++ add_cpp_remap_path (arg); ++ break; ++ + case OPT_iwithprefix: + add_prefixed_path (arg, SYSTEM); + break; +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1632,6 +1632,10 @@ iquote + C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) + -iquote Add to the end of the quote include path. + ++iremap ++C ObjC C++ ObjC++ Joined Separate ++-iremap Convert to if it occurs as prefix in __FILE__. ++ + iwithprefix + C ObjC C++ ObjC++ Joined Separate + -iwithprefix Add to the end of the system include path. +--- a/gcc/doc/cpp.texi ++++ b/gcc/doc/cpp.texi +@@ -4444,6 +4444,7 @@ without notice. + @c man begin SYNOPSIS + cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] + [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] ++ [@option{-iremap}@var{src}:@var{dst}] + [@option{-W}@var{warn}@dots{}] + [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] + [@option{-MP}] [@option{-MQ} @var{target}@dots{}] +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -532,6 +532,12 @@ Search @var{dir} only for header files r + If @var{dir} begins with @code{=}, then the @code{=} will be replaced + by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -fdirectives-only + @opindex fdirectives-only + When preprocessing, handle directives, but do not expand macros. +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}. + @item Directory Options + @xref{Directory Options,,Options for Directory Search}. + @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol +--iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol +---sysroot=@var{dir} --no-sysroot-suffix} ++-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -no-canonical-prefixes @gol ++-I- --sysroot=@var{dir} --no-sysroot-suffix} + + @item Code Generation Options + @xref{Code Gen Options,,Options for Code Generation Conventions}. +@@ -10861,6 +10861,12 @@ be searched for header files only for th + "@var{file}"}; they are not searched for @code{#include <@var{file}>}, + otherwise just like @option{-I}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -L@var{dir} + @opindex L + Add directory @var{dir} to the list of directories to be searched +--- a/libcpp/include/cpplib.h ++++ b/libcpp/include/cpplib.h +@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *, + /* Set the include paths. */ + extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); + ++/* Provide src:dst pair for __FILE__ remapping. */ ++extern void add_cpp_remap_path (const char *); ++ + /* Call these to get pointers to the options, callback, and deps + structures for a given reader. These pointers are good until you + call cpp_finish on that reader. You can either edit the callbacks +--- a/libcpp/macro.c ++++ b/libcpp/macro.c +@@ -227,6 +227,64 @@ static const char * const monthnames[] = + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + ++static size_t remap_pairs; ++static char **remap_src; ++static char **remap_dst; ++ ++void ++add_cpp_remap_path (const char *arg) ++{ ++ const char *arg_dst; ++ size_t len; ++ ++ arg_dst = strchr(arg, ':'); ++ if (arg_dst == NULL) ++ { ++ fprintf(stderr, "Invalid argument for -iremap\n"); ++ exit(1); ++ } ++ ++ len = arg_dst - arg; ++ ++arg_dst; ++ ++ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); ++ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); ++ ++ remap_src[remap_pairs] = (char *) xmalloc(len + 1); ++ memcpy(remap_src[remap_pairs], arg, len); ++ remap_src[remap_pairs][len] = '\0'; ++ remap_dst[remap_pairs] = xstrdup(arg_dst); ++ ++remap_pairs; ++} ++ ++static const char * ++cpp_remap_file (const char *arg, char **tmp_name) ++{ ++ char *result; ++ size_t i, len; ++ ++ for (i = 0; i < remap_pairs; ++i) ++ { ++ len = strlen (remap_src[i]); ++ if (strncmp (remap_src[i], arg, len)) ++ continue; ++ if (arg[len] == '\0') ++ return xstrdup (remap_dst[i]); ++ if (arg[len] != '/') ++ continue; ++ arg += len; ++ len = strlen (remap_dst[i]); ++ result = (char *) xmalloc (len + strlen (arg) + 1); ++ memcpy(result, remap_dst[i], len); ++ strcpy(result + len, arg); ++ *tmp_name = result; ++ ++ return result; ++ } ++ ++ return arg; ++} ++ + /* Helper function for builtin_macro. Returns the text generated by + a builtin macro. */ + const uchar * +@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + { + unsigned int len; + const char *name; ++ char *tmp_name = NULL; + uchar *buf; + + if (node->value.builtin == BT_FILE) +@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + if (!name) + abort (); + } ++ name = cpp_remap_file (name, &tmp_name); + len = strlen (name); + buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); + result = buf; +@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + *buf++ = '"'; + *buf = '\0'; ++ free (tmp_name); + } + break; + diff --git a/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch b/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch new file mode 100644 index 000000000..72d86c149 --- /dev/null +++ b/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch @@ -0,0 +1,11 @@ +--- a/gcc/ubsan.c ++++ b/gcc/ubsan.c +@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc) + + expanded_location xloc = expand_location (loc); + if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 +- || xloc.file == '\0' || xloc.file[0] == '\xff' ++ || xloc.file[0] == '\0' || xloc.file[0] == '\xff' + || xloc.file[1] == '\xff') + return false; + diff --git a/toolchain/gcc/patches/7.1.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/001-revert_register_mode_search.patch rename to toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch diff --git a/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch new file mode 100644 index 000000000..b3d2dbe29 --- /dev/null +++ b/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch @@ -0,0 +1,14 @@ +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -43,11 +43,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain/gcc/patches/7.1.0/010-documentation.patch b/toolchain-old/gcc/patches/7.1.0/010-documentation.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/010-documentation.patch rename to toolchain-old/gcc/patches/7.1.0/010-documentation.patch diff --git a/toolchain/gcc/patches/7.1.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/230-musl_libssp.patch rename to toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch diff --git a/toolchain/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch rename to toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch diff --git a/toolchain/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch rename to toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch diff --git a/toolchain/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch rename to toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch diff --git a/toolchain/gcc/patches/7.1.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/820-libgcc_pic.patch rename to toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch diff --git a/toolchain/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch rename to toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch diff --git a/toolchain/gcc/patches/7.1.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/850-use_shared_libgcc.patch rename to toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch diff --git a/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch new file mode 100644 index 000000000..80c347684 --- /dev/null +++ b/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch @@ -0,0 +1,12 @@ +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch rename to toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch diff --git a/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch new file mode 100644 index 000000000..fab5db3be --- /dev/null +++ b/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch @@ -0,0 +1,11 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch new file mode 100644 index 000000000..dd6e9dc88 --- /dev/null +++ b/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/7.1.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/910-mbsd_multi.patch rename to toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch diff --git a/toolchain/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch rename to toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch diff --git a/toolchain/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch rename to toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch diff --git a/toolchain/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch rename to toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch diff --git a/toolchain/gcc/patches/7.1.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch similarity index 100% rename from toolchain/gcc/patches/7.1.0/950-cpp_file_path_translation.patch rename to toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch new file mode 100644 index 000000000..bd6fbdb4a --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch @@ -0,0 +1,65 @@ +Revert of: + +commit 275035b56823b26d5fb7e90fad945b998648edf2 +Author: bergner +Date: Thu Sep 5 14:09:07 2013 +0000 + + PR target/58139 + * reginfo.c (choose_hard_reg_mode): Scan through all mode classes + looking for widest mode. + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 + + +--- a/gcc/reginfo.c ++++ b/gcc/reginfo.c +@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + + if (found_mode != VOIDmode) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch b/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch new file mode 100644 index 000000000..b3d2dbe29 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch @@ -0,0 +1,14 @@ +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -43,11 +43,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch b/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch new file mode 100644 index 000000000..2adb28c83 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch @@ -0,0 +1,23 @@ +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch b/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch new file mode 100644 index 000000000..8dfd1fc28 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch @@ -0,0 +1,13 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -858,7 +858,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch new file mode 100644 index 000000000..df09e4f63 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch @@ -0,0 +1,36 @@ +From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 +From: nsz +Date: Tue, 30 Aug 2016 10:26:22 +0000 +Subject: [PATCH] disable ifunc on *-musl by default + +gcc/ + * config.gcc (*-*-*musl*): Disable gnu-indirect-function. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ChangeLog | 4 ++++ + gcc/config.gcc | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes +@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 000000000..d76bd8cb1 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -17928,7 +17928,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 000000000..2e7c23f85 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch new file mode 100644 index 000000000..1d06f5b2e --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch @@ -0,0 +1,25 @@ +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -60,8 +60,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch b/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch new file mode 100644 index 000000000..f925d96f6 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch @@ -0,0 +1,36 @@ +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -913,7 +914,7 @@ all: libunwind.a + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1115,6 +1116,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch new file mode 100644 index 000000000..37f8f2a54 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch @@ -0,0 +1,13 @@ +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -45,7 +45,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 000000000..cb1fb9823 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,19 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -94,10 +94,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch new file mode 100644 index 000000000..cd20244c6 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch @@ -0,0 +1,47 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -132,10 +132,6 @@ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_assert ("system=posix"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -132,5 +132,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -60,6 +60,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch new file mode 100644 index 000000000..80c347684 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch @@ -0,0 +1,12 @@ +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch new file mode 100644 index 000000000..9e543a0fc --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -24171,7 +24171,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch b/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch new file mode 100644 index 000000000..0fa9e627c --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch @@ -0,0 +1,11 @@ +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -395,7 +395,7 @@ see the files COPYING3 and COPYING.RUNTI + /* If we have named section and we support weak symbols, then use the + .jcr section for recording java classes which need to be registered + at program start-up time. */ +-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK ++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK + #ifndef JCR_SECTION_NAME + #define JCR_SECTION_NAME ".jcr" + #endif diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch b/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch new file mode 100644 index 000000000..fab5db3be --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch @@ -0,0 +1,11 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch new file mode 100644 index 000000000..dd6e9dc88 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch b/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch new file mode 100644 index 000000000..62203dfcf --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch @@ -0,0 +1,222 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -107,6 +107,9 @@ static int class_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1041,6 +1050,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -438,6 +438,10 @@ Wfloat-conversion + C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion) + Warn for implicit type conversions that cause loss of floating point precision. + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality. +@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment. +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -581,6 +581,10 @@ Werror= + Common Joined + Treat specified warning as error. + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings. +@@ -1432,6 +1436,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities. + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -163,6 +163,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}. + -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol + -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol + -Wempty-body -Wenum-compare -Wno-endif-labels @gol +--Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol ++-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol + -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol +@@ -5737,6 +5737,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++ at item -Werror-maybe-reset ++ at opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++ at item -fhonour-copts ++ at opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -629,6 +629,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch new file mode 100644 index 000000000..dc0acb95a --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch @@ -0,0 +1,15 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch + value = varname; + + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", varname); ++ { ++ warning (input_location, "environment variable %qs not defined", varname); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch new file mode 100644 index 000000000..2a99840b6 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t + #undef TARGET_HARD_REGNO_SCRATCH_OK + #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch new file mode 100644 index 000000000..68e62865b --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch @@ -0,0 +1,11 @@ +--- a/libstdc++-v3/include/Makefile.in ++++ b/libstdc++-v3/include/Makefile.in +@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers} + @$(STAMP) stamp-bits + + stamp-bits-sup: stamp-bits ${bits_sup_headers} +- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null ++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null + @$(STAMP) stamp-bits-sup + + stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch new file mode 100644 index 000000000..d467eb7c9 --- /dev/null +++ b/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch @@ -0,0 +1,182 @@ +Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co + add_path (xstrdup (arg), SYSTEM, 0, true); + break; + ++ case OPT_iremap: ++ add_cpp_remap_path (arg); ++ break; ++ + case OPT_iwithprefix: + add_prefixed_path (arg, SYSTEM); + break; +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1632,6 +1632,10 @@ iquote + C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) + -iquote Add to the end of the quote include path. + ++iremap ++C ObjC C++ ObjC++ Joined Separate ++-iremap Convert to if it occurs as prefix in __FILE__. ++ + iwithprefix + C ObjC C++ ObjC++ Joined Separate + -iwithprefix Add to the end of the system include path. +--- a/gcc/doc/cpp.texi ++++ b/gcc/doc/cpp.texi +@@ -4444,6 +4444,7 @@ without notice. + @c man begin SYNOPSIS + cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] + [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] ++ [@option{-iremap}@var{src}:@var{dst}] + [@option{-W}@var{warn}@dots{}] + [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] + [@option{-MP}] [@option{-MQ} @var{target}@dots{}] +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -532,6 +532,12 @@ Search @var{dir} only for header files r + If @var{dir} begins with @code{=}, then the @code{=} will be replaced + by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -fdirectives-only + @opindex fdirectives-only + When preprocessing, handle directives, but do not expand macros. +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}. + @item Directory Options + @xref{Directory Options,,Options for Directory Search}. + @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol +--iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol +---sysroot=@var{dir} --no-sysroot-suffix} ++-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -no-canonical-prefixes @gol ++-I- --sysroot=@var{dir} --no-sysroot-suffix} + + @item Code Generation Options + @xref{Code Gen Options,,Options for Code Generation Conventions}. +@@ -10861,6 +10861,12 @@ be searched for header files only for th + "@var{file}"}; they are not searched for @code{#include <@var{file}>}, + otherwise just like @option{-I}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -L@var{dir} + @opindex L + Add directory @var{dir} to the list of directories to be searched +--- a/libcpp/include/cpplib.h ++++ b/libcpp/include/cpplib.h +@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *, + /* Set the include paths. */ + extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); + ++/* Provide src:dst pair for __FILE__ remapping. */ ++extern void add_cpp_remap_path (const char *); ++ + /* Call these to get pointers to the options, callback, and deps + structures for a given reader. These pointers are good until you + call cpp_finish on that reader. You can either edit the callbacks +--- a/libcpp/macro.c ++++ b/libcpp/macro.c +@@ -227,6 +227,64 @@ static const char * const monthnames[] = + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + ++static size_t remap_pairs; ++static char **remap_src; ++static char **remap_dst; ++ ++void ++add_cpp_remap_path (const char *arg) ++{ ++ const char *arg_dst; ++ size_t len; ++ ++ arg_dst = strchr(arg, ':'); ++ if (arg_dst == NULL) ++ { ++ fprintf(stderr, "Invalid argument for -iremap\n"); ++ exit(1); ++ } ++ ++ len = arg_dst - arg; ++ ++arg_dst; ++ ++ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); ++ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); ++ ++ remap_src[remap_pairs] = (char *) xmalloc(len + 1); ++ memcpy(remap_src[remap_pairs], arg, len); ++ remap_src[remap_pairs][len] = '\0'; ++ remap_dst[remap_pairs] = xstrdup(arg_dst); ++ ++remap_pairs; ++} ++ ++static const char * ++cpp_remap_file (const char *arg, char **tmp_name) ++{ ++ char *result; ++ size_t i, len; ++ ++ for (i = 0; i < remap_pairs; ++i) ++ { ++ len = strlen (remap_src[i]); ++ if (strncmp (remap_src[i], arg, len)) ++ continue; ++ if (arg[len] == '\0') ++ return xstrdup (remap_dst[i]); ++ if (arg[len] != '/') ++ continue; ++ arg += len; ++ len = strlen (remap_dst[i]); ++ result = (char *) xmalloc (len + strlen (arg) + 1); ++ memcpy(result, remap_dst[i], len); ++ strcpy(result + len, arg); ++ *tmp_name = result; ++ ++ return result; ++ } ++ ++ return arg; ++} ++ + /* Helper function for builtin_macro. Returns the text generated by + a builtin macro. */ + const uchar * +@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + { + unsigned int len; + const char *name; ++ char *tmp_name = NULL; + uchar *buf; + + if (node->value.builtin == BT_FILE) +@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + if (!name) + abort (); + } ++ name = cpp_remap_file (name, &tmp_name); + len = strlen (name); + buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); + result = buf; +@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + *buf++ = '"'; + *buf = '\0'; ++ free (tmp_name); + } + break; + diff --git a/toolchain-old/gdb/Makefile b/toolchain-old/gdb/Makefile new file mode 100644 index 000000000..77e24f460 --- /dev/null +++ b/toolchain-old/gdb/Makefile @@ -0,0 +1,68 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=gdb + +ifeq ($(CONFIG_arc),y) +PKG_VERSION:=arc-2017.03-gdb + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.03-gdb +PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6 +GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) +PATCH_DIR:=./patches-arc +else +PKG_VERSION:=7.12.1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@GNU/gdb +PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 +GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) +endif + +HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) + +HOST_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/toolchain-build.mk + +HOST_CONFIGURE_VARS += \ + gdb_cv_func_sigsetjmp=yes + +HOST_CONFIGURE_ARGS = \ + --prefix=$(TOOLCHAIN_DIR) \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --disable-werror \ + --without-uiout \ + --disable-tui --disable-gdbtk --without-x \ + --without-included-gettext \ + --enable-threads \ + --with-expat \ + --without-python \ + --disable-binutils \ + --disable-ld \ + --disable-gas \ + --disable-sim + +define Host/Install + mkdir -p $(TOOLCHAIN_DIR)/bin + $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb + ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb + strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \ + $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch b/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch new file mode 100644 index 000000000..8c18c6e2e --- /dev/null +++ b/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch @@ -0,0 +1,32 @@ +--- a/sim/common/sim-arange.c ++++ b/sim/common/sim-arange.c +@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a + build_search_tree (ar); + } + +-#endif /* DEFINE_NON_INLINE_P */ +- +-#if DEFINE_INLINE_P +- +-SIM_ARANGE_INLINE int ++int + sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) + { + ADDR_RANGE_TREE *t = ar->range_tree; +@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad + return 0; + } + +-#endif /* DEFINE_INLINE_P */ ++#endif /* DEFINE_NON_INLINE_P */ +--- a/sim/common/sim-arange.h ++++ b/sim/common/sim-arange.h +@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ + + /* Return non-zero if ADDR is in range AR, traversing the entire tree. + If no range is specified, that is defined to mean "everything". */ +-SIM_ARANGE_INLINE int ++extern int + sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); + #define ADDR_RANGE_HIT_P(ar, addr) \ + ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) diff --git a/toolchain-old/gdb/patches-arc/110-no_testsuite.patch b/toolchain-old/gdb/patches-arc/110-no_testsuite.patch new file mode 100644 index 000000000..1b284ea76 --- /dev/null +++ b/toolchain-old/gdb/patches-arc/110-no_testsuite.patch @@ -0,0 +1,21 @@ +--- a/gdb/configure ++++ b/gdb/configure +@@ -870,8 +870,7 @@ MAKEINFOFLAGS + YACC + YFLAGS + XMKMF' +-ac_subdirs_all='testsuite +-gdbtk ++ac_subdirs_all='gdbtk + multi-ice + gdbserver' + +@@ -5610,7 +5610,7 @@ $as_echo "$with_auto_load_safe_path" >&6 + + + +-subdirs="$subdirs testsuite" ++subdirs="$subdirs" + + + # Check whether to support alternative target configurations diff --git a/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch b/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch new file mode 100644 index 000000000..c8b41f264 --- /dev/null +++ b/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch @@ -0,0 +1,11 @@ +--- a/gdb/gdbserver/configure ++++ b/gdb/gdbserver/configure +@@ -2468,7 +2468,7 @@ $as_echo "$as_me: error: \`$ac_var' was + ac_cache_corrupted=: ;; + ,);; + *) +- if test "x$ac_old_val" != "x$ac_new_val"; then ++ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` diff --git a/toolchain-old/gdb/patches/100-no_extern_inline.patch b/toolchain-old/gdb/patches/100-no_extern_inline.patch new file mode 100644 index 000000000..8c18c6e2e --- /dev/null +++ b/toolchain-old/gdb/patches/100-no_extern_inline.patch @@ -0,0 +1,32 @@ +--- a/sim/common/sim-arange.c ++++ b/sim/common/sim-arange.c +@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a + build_search_tree (ar); + } + +-#endif /* DEFINE_NON_INLINE_P */ +- +-#if DEFINE_INLINE_P +- +-SIM_ARANGE_INLINE int ++int + sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) + { + ADDR_RANGE_TREE *t = ar->range_tree; +@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad + return 0; + } + +-#endif /* DEFINE_INLINE_P */ ++#endif /* DEFINE_NON_INLINE_P */ +--- a/sim/common/sim-arange.h ++++ b/sim/common/sim-arange.h +@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ + + /* Return non-zero if ADDR is in range AR, traversing the entire tree. + If no range is specified, that is defined to mean "everything". */ +-SIM_ARANGE_INLINE int ++extern int + sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); + #define ADDR_RANGE_HIT_P(ar, addr) \ + ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) diff --git a/toolchain-old/gdb/patches/110-no_testsuite.patch b/toolchain-old/gdb/patches/110-no_testsuite.patch new file mode 100644 index 000000000..68d1c9035 --- /dev/null +++ b/toolchain-old/gdb/patches/110-no_testsuite.patch @@ -0,0 +1,21 @@ +--- a/gdb/configure ++++ b/gdb/configure +@@ -874,8 +874,7 @@ MAKEINFOFLAGS + YACC + YFLAGS + XMKMF' +-ac_subdirs_all='testsuite +-gdbtk ++ac_subdirs_all='gdbtk + multi-ice + gdbserver' + +@@ -5617,7 +5616,7 @@ $as_echo "$with_auto_load_safe_path" >&6 + + + +-subdirs="$subdirs testsuite" ++subdirs="$subdirs" + + + # Check whether to support alternative target configurations diff --git a/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch new file mode 100644 index 000000000..562902c50 --- /dev/null +++ b/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch @@ -0,0 +1,11 @@ +--- a/gdb/gdbserver/configure ++++ b/gdb/gdbserver/configure +@@ -2476,7 +2476,7 @@ $as_echo "$as_me: error: \`$ac_var' was + ac_cache_corrupted=: ;; + ,);; + *) +- if test "x$ac_old_val" != "x$ac_new_val"; then ++ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` diff --git a/toolchain-old/glibc/Makefile b/toolchain-old/glibc/Makefile new file mode 100644 index 000000000..24526ceec --- /dev/null +++ b/toolchain-old/glibc/Makefile @@ -0,0 +1,32 @@ +PATH_PREFIX := . +VARIANT:=final +HOST_BUILD_PARALLEL:=1 + +include ./common.mk + +define Host/Compile + +$(MAKE) -C $(CUR_BUILD_DIR) \ + PARALLELMFLAGS="$(HOST_JOBS)" \ + BUILD_CFLAGS="$(HOST_CFLAGS)" \ + default-rpath="/lib:/usr/lib" \ + all +endef + +define Host/Install + $(call Host/SetToolchainInfo) + $(MAKE) -C $(CUR_BUILD_DIR) \ + BUILD_CFLAGS="$(HOST_CFLAGS)" \ + install_root="$(TOOLCHAIN_DIR)" \ + install + ( cd $(TOOLCHAIN_DIR) ; \ + for d in lib usr/lib ; do \ + for f in libc.so libpthread.so libgcc_s.so ; do \ + if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ + $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ + fi \ + done \ + done \ + ) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/glibc/common.mk b/toolchain-old/glibc/common.mk new file mode 100644 index 000000000..0ea166e77 --- /dev/null +++ b/toolchain-old/glibc/common.mk @@ -0,0 +1,94 @@ +# +# Copyright (C) 2006-2016 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=glibc +PKG_VERSION:=2.25 + +PKG_SOURCE_URL:=@GNU/libc +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_HASH:=067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 + +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) +CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT) + +include $(INCLUDE_DIR)/toolchain-build.mk + +HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared +HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured +HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built +HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed + +ifeq ($(ARCH),mips64) + ifdef CONFIG_MIPS64_ABI_N64 + TARGET_CFLAGS += -mabi=64 + endif + ifdef CONFIG_MIPS64_ABI_N32 + TARGET_CFLAGS += -mabi=n32 + endif + ifdef CONFIG_MIPS64_ABI_O32 + TARGET_CFLAGS += -mabi=32 + endif +endif + + +# -Os miscompiles w. 2.24 gcc5/gcc6 +# only -O2 tested by upstream changeset +# "Optimize i386 syscall inlining for GCC 5" +GLIBC_CONFIGURE:= \ + BUILD_CC="$(HOSTCC)" \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="-O2 $(filter-out -Os,$(call qstrip,$(TARGET_CFLAGS)))" \ + libc_cv_slibdir="/lib" \ + use_ldconfig=no \ + $(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \ + --prefix= \ + --build=$(GNU_HOST_NAME) \ + --host=$(REAL_GNU_TARGET_NAME) \ + --with-headers=$(TOOLCHAIN_DIR)/include \ + --disable-profile \ + --disable-werror \ + --without-gd \ + --without-cvs \ + --enable-add-ons \ + --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp + +export libc_cv_ssp=no +export libc_cv_ssp_strong=no +export ac_cv_header_cpuid_h=yes +export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include + +define Host/SetToolchainInfo + $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk +endef + +define Host/Configure + [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \ + cd $(HOST_BUILD_DIR)/; \ + autoconf --force && \ + touch $(HOST_BUILD_DIR)/.autoconf; \ + } + mkdir -p $(CUR_BUILD_DIR) + ( cd $(CUR_BUILD_DIR); rm -f config.cache; \ + $(GLIBC_CONFIGURE) \ + ); +endef + +define Host/Prepare + $(call Host/Prepare/Default) + ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef + +define Host/Clean + rm -rf $(CUR_BUILD_DIR)* \ + $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef diff --git a/toolchain-old/glibc/headers/Makefile b/toolchain-old/glibc/headers/Makefile new file mode 100644 index 000000000..f1d8a8bc6 --- /dev/null +++ b/toolchain-old/glibc/headers/Makefile @@ -0,0 +1,28 @@ +PATH_PREFIX:=.. +VARIANT:=headers + +include ../common.mk + +define Host/Compile + +endef + +define Host/Install + $(call Host/SetToolchainInfo) + mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib} + $(MAKE) -C $(CUR_BUILD_DIR) \ + BUILD_CFLAGS="$(HOST_CFLAGS)" \ + install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ + install-bootstrap-headers=yes \ + install-headers + $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ + $(MAKE) -C $(CUR_BUILD_DIR) \ + csu/subdir_lib + ( cd $(CUR_BUILD_DIR); \ + $(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \ + ) + $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ + -o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/glibc/include/libintl.h b/toolchain-old/glibc/include/libintl.h new file mode 100644 index 000000000..69cb887a2 --- /dev/null +++ b/toolchain-old/glibc/include/libintl.h @@ -0,0 +1,6 @@ +#ifndef __FAKE_LIBINTL_H +#define __FAKE_LIBINTL_H + +#define _(X) (X) + +#endif diff --git a/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch new file mode 100644 index 000000000..6a5e537b7 --- /dev/null +++ b/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch @@ -0,0 +1,52 @@ +--- a/sunrpc/rpc/types.h ++++ b/sunrpc/rpc/types.h +@@ -75,18 +75,23 @@ typedef unsigned long rpcport_t; + #endif + + #ifndef __u_char_defined +-typedef __u_char u_char; +-typedef __u_short u_short; +-typedef __u_int u_int; +-typedef __u_long u_long; +-typedef __quad_t quad_t; +-typedef __u_quad_t u_quad_t; +-typedef __fsid_t fsid_t; ++typedef unsigned char u_char; ++typedef unsigned short u_short; ++typedef unsigned int u_int; ++typedef unsigned long u_long; ++#if __WORDSIZE == 64 ++typedef long int quad_t; ++typedef unsigned long int u_quad_t; ++#elif defined __GLIBC_HAVE_LONG_LONG ++typedef long long int quad_t; ++typedef unsigned long long int u_quad_t; ++#endif ++typedef u_quad_t fsid_t; + # define __u_char_defined + #endif +-#ifndef __daddr_t_defined +-typedef __daddr_t daddr_t; +-typedef __caddr_t caddr_t; ++#if !defined(__daddr_t_defined) && defined(linux) ++typedef long int daddr_t; ++typedef char *caddr_t; + # define __daddr_t_defined + #endif + +--- a/sunrpc/rpc_main.c ++++ b/sunrpc/rpc_main.c +@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) + abort (); + temp = rindex (cmd->infile, '.'); + cp = stpcpy (mkfilename, "Makefile."); +- if (temp != NULL) +- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; +- else ++ if (temp != NULL) { ++ strncpy(cp, cmd->infile, temp - cmd->infile); ++ cp[temp - cmd->infile - 1] = 0; ++ } else + stpcpy (cp, cmd->infile); + + } diff --git a/toolchain-old/glibc/patches/200-add-dl-search-paths.patch b/toolchain-old/glibc/patches/200-add-dl-search-paths.patch new file mode 100644 index 000000000..8f720cb9f --- /dev/null +++ b/toolchain-old/glibc/patches/200-add-dl-search-paths.patch @@ -0,0 +1,14 @@ +add /usr/lib to default search path for the dynamic linker + +--- a/Makeconfig ++++ b/Makeconfig +@@ -571,6 +571,9 @@ else + default-rpath = $(libdir) + endif + ++# Add /usr/lib to default search path for the dynamic linker ++user-defined-trusted-dirs := /usr/lib ++ + ifndef link-extra-libs + link-extra-libs = $(LDLIBS-$(@F)) + link-extra-libs-static = $(link-extra-libs) diff --git a/toolchain-old/info.mk b/toolchain-old/info.mk new file mode 100644 index 000000000..4f311c550 --- /dev/null +++ b/toolchain-old/info.mk @@ -0,0 +1,6 @@ +TARGET_CROSS= +GCC_VERSION=unknown +LIBC_TYPE=unknown +LIBC_URL=unknown +LIBC_VERSION=unknown +LIBC_SO_VERSION=unknown diff --git a/toolchain-old/kernel-headers/Makefile b/toolchain-old/kernel-headers/Makefile new file mode 100644 index 000000000..1bf5598d6 --- /dev/null +++ b/toolchain-old/kernel-headers/Makefile @@ -0,0 +1,102 @@ +# +# Copyright (C) 2006-2009 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN) +BUILD_DIR := $(KERNEL_BUILD_DIR) + +override QUILT:= +override HOST_QUILT:= + +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=linux +PKG_VERSION:=$(LINUX_VERSION) +PKG_SOURCE:=$(LINUX_SOURCE) +PKG_SOURCE_URL:=$(LINUX_SITE) +HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) +PKG_HASH:=$(LINUX_KERNEL_HASH) +LINUX_DIR := $(HOST_BUILD_DIR) +FILES_DIR := +PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION)) + +include $(INCLUDE_DIR)/toolchain-build.mk +include $(INCLUDE_DIR)/kernel-defaults.mk + +ifeq ($(strip $(BOARD)),uml) + LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH))) +endif + +HOST_EXTRACFLAGS= + +LINUX_HAS_HEADERS_INSTALL:=y + +KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ + HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ + ARCH=$(LINUX_KARCH) \ + CC="$(KERNEL_CC)" \ + CFLAGS="$(TARGET_CFLAGS)" \ + CROSS_COMPILE=$(TARGET_CROSS) \ + KBUILD_HAVE_NLS=no \ + CONFIG_SHELL=$(BASH) + +define Host/Configure/all + mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev + $(KMAKE) \ + INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \ + headers_install +endef + +# XXX: the following is needed to build lzma-loader +ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) + define Host/Configure/lzma + $(CP) \ + $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \ + $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \ + $(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \ + $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/ + endef +endif + +define Host/Configure/post/mips + $(call Host/Configure/lzma) +endef + +define Host/Configure/post/mipsel + $(call Host/Configure/lzma) +endef + +define Host/Prepare + rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-* + $(call Kernel/Prepare/Default) + rm -f $(BUILD_DIR_TOOLCHAIN)/linux + ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux + $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile +endef + +define Host/Configure + env + yes '' | $(KMAKE) oldconfig + $(call Host/Configure/all) + $(call Host/Configure/post/$(ARCH)) +endef + +define Host/Compile +endef + +define Host/Install + $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/ +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/linux \ + $(BUILD_DIR_TOOLCHAIN)/linux-dev +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/musl/Makefile b/toolchain-old/musl/Makefile new file mode 100644 index 000000000..2b9312bcb --- /dev/null +++ b/toolchain-old/musl/Makefile @@ -0,0 +1,31 @@ +PATH_PREFIX=. + +include ./common.mk + +HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built +HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed + +HOST_BUILD_PARALLEL:=1 + +MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \ + DESTDIR="$(TOOLCHAIN_DIR)/" \ + LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" + +define Host/SetToolchainInfo + $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk +endef + +define Host/Compile + +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) all +endef + +define Host/Install + $(call Host/SetToolchainInfo) + +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) DESTDIR="$(TOOLCHAIN_DIR)/" install + $(CP) ./include $(TOOLCHAIN_DIR)/ +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/musl/common.mk b/toolchain-old/musl/common.mk new file mode 100644 index 000000000..0a45828f7 --- /dev/null +++ b/toolchain-old/musl/common.mk @@ -0,0 +1,62 @@ +# +# Copyright (C) 2012-2013 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/target.mk + +PKG_NAME:=musl +PKG_VERSION:=1.1.16 +PKG_RELEASE=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=5f7efb87a28a311ad377dd26adf53715dedb096d +PKG_MIRROR_HASH:=da18ef24f270e5cae6bc4c440479da17bec1949ae5a1bc990352ca04f24c4378 +PKG_SOURCE_URL:=git://git.musl-libc.org/musl +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz + +LIBC_SO_VERSION:=$(PKG_VERSION) +PATCH_DIR:=$(PATH_PREFIX)/patches + +HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/toolchain-build.mk +include $(INCLUDE_DIR)/hardening.mk + +MUSL_CONFIGURE:= \ + $(TARGET_CONFIGURE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + $(HOST_BUILD_DIR)/configure \ + --prefix=/ \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --disable-gcc-wrapper \ + --enable-debug + +define Host/Prepare + $(call Host/Prepare/Default) + $(if $(strip $(QUILT)), \ + cd $(HOST_BUILD_DIR); \ + if $(QUILT_CMD) next >/dev/null 2>&1; then \ + $(QUILT_CMD) push -a; \ + fi + ) + ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef + +define Host/Configure + ( cd $(HOST_BUILD_DIR); rm -f config.cache; \ + $(MUSL_CONFIGURE) \ + ); +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ + $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev +endef diff --git a/toolchain-old/musl/include/bits/wordsize.h b/toolchain-old/musl/include/bits/wordsize.h new file mode 100644 index 000000000..2d4cbe831 --- /dev/null +++ b/toolchain-old/musl/include/bits/wordsize.h @@ -0,0 +1 @@ +#include diff --git a/toolchain-old/musl/include/features.h b/toolchain-old/musl/include/features.h new file mode 100644 index 000000000..edb8cc72d --- /dev/null +++ b/toolchain-old/musl/include/features.h @@ -0,0 +1,48 @@ +#ifndef _FEATURES_H +#define _FEATURES_H + +#ifdef _ALL_SOURCE +#define _GNU_SOURCE 1 +#endif + +#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ + && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ + && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) +#define _BSD_SOURCE 1 +#define _XOPEN_SOURCE 700 +#endif + +#if __STDC_VERSION__ >= 199901L +#define __restrict restrict +#elif !defined(__GNUC__) +#define __restrict +#endif + +#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) +#define __inline inline +#endif + +#if __STDC_VERSION__ >= 201112L +#elif defined(__GNUC__) +#define _Noreturn __attribute__((__noreturn__)) +#else +#define _Noreturn +#endif + +/* Convenience macros to test the versions of glibc and gcc. + Use them like this: + #if __GNUC_PREREQ (2,8) + ... code requiring gcc 2.8 or later ... + #endif + Note - they won't work for gcc1 or glibc1, since the _MINOR macros + were not defined then. */ +#if defined __GNUC__ && defined __GNUC_MINOR__ +# define __GNUC_PREREQ(maj, min) \ + ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) +#else +# define __GNUC_PREREQ(maj, min) 0 +#endif + +#include + +#endif diff --git a/toolchain-old/musl/include/sgidefs.h b/toolchain-old/musl/include/sgidefs.h new file mode 100644 index 000000000..74509fdbd --- /dev/null +++ b/toolchain-old/musl/include/sgidefs.h @@ -0,0 +1,73 @@ +/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. + This file is part of the GNU C Library. + Contributed by Ralf Baechle . + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +#ifndef _SGIDEFS_H +#define _SGIDEFS_H 1 + +/* + * A crude hack to stop + */ +#undef __ASM_SGIDEFS_H +#define __ASM_SGIDEFS_H + +/* + * And remove any damage it might have already done + */ +#undef _MIPS_ISA_MIPS1 +#undef _MIPS_ISA_MIPS2 +#undef _MIPS_ISA_MIPS3 +#undef _MIPS_ISA_MIPS4 +#undef _MIPS_ISA_MIPS5 +#undef _MIPS_ISA_MIPS32 +#undef _MIPS_ISA_MIPS64 + +#undef _MIPS_SIM_ABI32 +#undef _MIPS_SIM_NABI32 +#undef _MIPS_SIM_ABI64 + +/* + * Definitions for the ISA level + */ +#define _MIPS_ISA_MIPS1 1 +#define _MIPS_ISA_MIPS2 2 +#define _MIPS_ISA_MIPS3 3 +#define _MIPS_ISA_MIPS4 4 +#define _MIPS_ISA_MIPS5 5 +#define _MIPS_ISA_MIPS32 6 +#define _MIPS_ISA_MIPS64 7 + +/* + * Subprogram calling convention + */ +#ifndef _ABIO32 +# define _ABIO32 1 +#endif +#define _MIPS_SIM_ABI32 _ABIO32 + +#ifndef _ABIN32 +# define _ABIN32 2 +#endif +#define _MIPS_SIM_NABI32 _ABIN32 + +#ifndef _ABI64 +# define _ABI64 3 +#endif +#define _MIPS_SIM_ABI64 _ABI64 + +#endif /* sgidefs.h */ diff --git a/toolchain-old/musl/include/sys/cdefs.h b/toolchain-old/musl/include/sys/cdefs.h new file mode 100644 index 000000000..e9866700d --- /dev/null +++ b/toolchain-old/musl/include/sys/cdefs.h @@ -0,0 +1,378 @@ +/* Copyright (C) 1992-2002, 2004, 2005, 2006, 2007, 2009, 2011, 2012 + Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _SYS_CDEFS_H +#define _SYS_CDEFS_H 1 + +/* We are almost always included from features.h. */ +#ifndef _FEATURES_H +# include +#endif + +/* The GNU libc does not support any K&R compilers or the traditional mode + of ISO C compilers anymore. Check for some of the combinations not + anymore supported. */ +#if defined __GNUC__ && !defined __STDC__ +# error "You need a ISO C conforming compiler to use the glibc headers" +#endif + +/* Some user header file might have defined this before. */ +#undef __P +#undef __PMT + +#ifdef __GNUC__ + +/* All functions, except those with callbacks or those that + synchronize memory, are leaf functions. */ +# if __GNUC_PREREQ (4, 6) && !defined _LIBC +# define __LEAF , __leaf__ +# define __LEAF_ATTR __attribute__ ((__leaf__)) +# else +# define __LEAF +# define __LEAF_ATTR +# endif + +/* GCC can always grok prototypes. For C++ programs we add throw() + to help it optimize the function calls. But this works only with + gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions + as non-throwing using a function attribute since programs can use + the -fexceptions options for C code as well. */ +# if !defined __cplusplus && __GNUC_PREREQ (3, 3) +# define __THROW __attribute__ ((__nothrow__ __LEAF)) +# define __THROWNL __attribute__ ((__nothrow__)) +# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct +# else +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# define __THROWNL throw () +# define __NTH(fct) __LEAF_ATTR fct throw () +# else +# define __THROW +# define __THROWNL +# define __NTH(fct) fct +# endif +# endif + +#else /* Not GCC. */ + +# define __inline /* No inline functions. */ + +# define __THROW +# define __THROWNL +# define __NTH(fct) fct + +#endif /* GCC. */ + +/* These two macros are not used in glibc anymore. They are kept here + only because some other projects expect the macros to be defined. */ +#define __P(args) args +#define __PMT(args) args + +/* For these things, GCC behaves the ANSI way normally, + and the non-ANSI way under -traditional. */ + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +/* This is not a typedef so `const __ptr_t' does the right thing. */ +#define __ptr_t void * +#define __long_double_t long double + + +/* C++ needs to know that types and declarations are C, not C++. */ +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + + +/* The standard library needs the functions from the ISO C90 standard + in the std namespace. At the same time we want to be safe for + future changes and we include the ISO C99 code in the non-standard + namespace __c99. The C++ wrapper header take case of adding the + definitions to the global namespace. */ +#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES +# define __BEGIN_NAMESPACE_STD namespace std { +# define __END_NAMESPACE_STD } +# define __USING_NAMESPACE_STD(name) using std::name; +# define __BEGIN_NAMESPACE_C99 namespace __c99 { +# define __END_NAMESPACE_C99 } +# define __USING_NAMESPACE_C99(name) using __c99::name; +#else +/* For compatibility we do not add the declarations into any + namespace. They will end up in the global namespace which is what + old code expects. */ +# define __BEGIN_NAMESPACE_STD +# define __END_NAMESPACE_STD +# define __USING_NAMESPACE_STD(name) +# define __BEGIN_NAMESPACE_C99 +# define __END_NAMESPACE_C99 +# define __USING_NAMESPACE_C99(name) +#endif + + +/* Support for bounded pointers. */ +#ifndef __BOUNDED_POINTERS__ +# define __bounded /* nothing */ +# define __unbounded /* nothing */ +# define __ptrvalue /* nothing */ +#endif + + +/* Fortify support. */ +#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) +#define __bos0(ptr) __builtin_object_size (ptr, 0) +#define __fortify_function __extern_always_inline __attribute_artificial__ + +#if __GNUC_PREREQ (4,3) +# define __warndecl(name, msg) \ + extern void name (void) __attribute__((__warning__ (msg))) +# define __warnattr(msg) __attribute__((__warning__ (msg))) +# define __errordecl(name, msg) \ + extern void name (void) __attribute__((__error__ (msg))) +#else +# define __warndecl(name, msg) extern void name (void) +# define __warnattr(msg) +# define __errordecl(name, msg) extern void name (void) +#endif + +/* Support for flexible arrays. */ +#if __GNUC_PREREQ (2,97) +/* GCC 2.97 supports C99 flexible array members. */ +# define __flexarr [] +#else +# ifdef __GNUC__ +# define __flexarr [0] +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __flexarr [] +# else +/* Some other non-C99 compiler. Approximate with [1]. */ +# define __flexarr [1] +# endif +# endif +#endif + + +/* __asm__ ("xyz") is used throughout the headers to rename functions + at the assembly language level. This is wrapped by the __REDIRECT + macro, in order to support compilers that can do this some other + way. When compilers don't support asm-names at all, we have to do + preprocessor tricks instead (which don't have exactly the right + semantics, but it's the best we can do). + + Example: + int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ + +#if defined __GNUC__ && __GNUC__ >= 2 + +# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) +# ifdef __cplusplus +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __THROW __asm__ (__ASMNAME (#alias)) +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __THROWNL __asm__ (__ASMNAME (#alias)) +# else +# define __REDIRECT_NTH(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROW +# define __REDIRECT_NTHNL(name, proto, alias) \ + name proto __asm__ (__ASMNAME (#alias)) __THROWNL +# endif +# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) +# define __ASMNAME2(prefix, cname) __STRING (prefix) cname + +/* +#elif __SOME_OTHER_COMPILER__ + +# define __REDIRECT(name, proto, alias) name proto; \ + _Pragma("let " #name " = " #alias) +*/ +#endif + +/* GCC has various useful declarations that can be made with the + `__attribute__' syntax. All of the ways we use this do fine if + they are omitted for compilers that don't understand it. */ +#if !defined __GNUC__ || __GNUC__ < 2 +# define __attribute__(xyz) /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `malloc' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_malloc__ __attribute__ ((__malloc__)) +#else +# define __attribute_malloc__ /* Ignore */ +#endif + +/* At some point during the gcc 2.96 development the `pure' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (2,96) +# define __attribute_pure__ __attribute__ ((__pure__)) +#else +# define __attribute_pure__ /* Ignore */ +#endif + +/* This declaration tells the compiler that the value is constant. */ +#if __GNUC_PREREQ (2,5) +# define __attribute_const__ __attribute__ ((__const__)) +#else +# define __attribute_const__ /* Ignore */ +#endif + +/* At some point during the gcc 3.1 development the `used' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. */ +#if __GNUC_PREREQ (3,1) +# define __attribute_used__ __attribute__ ((__used__)) +# define __attribute_noinline__ __attribute__ ((__noinline__)) +#else +# define __attribute_used__ __attribute__ ((__unused__)) +# define __attribute_noinline__ /* Ignore */ +#endif + +/* gcc allows marking deprecated functions. */ +#if __GNUC_PREREQ (3,2) +# define __attribute_deprecated__ __attribute__ ((__deprecated__)) +#else +# define __attribute_deprecated__ /* Ignore */ +#endif + +/* At some point during the gcc 2.8 development the `format_arg' attribute + for functions was introduced. We don't want to use it unconditionally + (although this would be possible) since it generates warnings. + If several `format_arg' attributes are given for the same function, in + gcc-3.0 and older, all but the last one are ignored. In newer gccs, + all designated arguments are considered. */ +#if __GNUC_PREREQ (2,8) +# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) +#else +# define __attribute_format_arg__(x) /* Ignore */ +#endif + +/* At some point during the gcc 2.97 development the `strfmon' format + attribute for functions was introduced. We don't want to use it + unconditionally (although this would be possible) since it + generates warnings. */ +#if __GNUC_PREREQ (2,97) +# define __attribute_format_strfmon__(a,b) \ + __attribute__ ((__format__ (__strfmon__, a, b))) +#else +# define __attribute_format_strfmon__(a,b) /* Ignore */ +#endif + +/* The nonull function attribute allows to mark pointer parameters which + must not be NULL. */ +#if __GNUC_PREREQ (3,3) +# define __nonnull(params) __attribute__ ((__nonnull__ params)) +#else +# define __nonnull(params) +#endif + +/* If fortification mode, we warn about unused results of certain + function calls which can lead to problems. */ +#if __GNUC_PREREQ (3,4) +# define __attribute_warn_unused_result__ \ + __attribute__ ((__warn_unused_result__)) +# if __USE_FORTIFY_LEVEL > 0 +# define __wur __attribute_warn_unused_result__ +# endif +#else +# define __attribute_warn_unused_result__ /* empty */ +#endif +#ifndef __wur +# define __wur /* Ignore */ +#endif + +/* Forces a function to be always inlined. */ +#if __GNUC_PREREQ (3,2) +# define __always_inline __inline __attribute__ ((__always_inline__)) +#else +# define __always_inline __inline +#endif + +/* Associate error messages with the source location of the call site rather + than with the source location inside the function. */ +#if __GNUC_PREREQ (4,3) +# define __attribute_artificial__ __attribute__ ((__artificial__)) +#else +# define __attribute_artificial__ /* Ignore */ +#endif + +/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 + inline semantics, unless -fgnu89-inline is used. */ +#if !defined __cplusplus || __GNUC_PREREQ (4,3) +# if defined __GNUC_STDC_INLINE__ || defined __cplusplus +# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) +# define __extern_always_inline \ + extern __always_inline __attribute__ ((__gnu_inline__)) +# else +# define __extern_inline extern __inline +# define __extern_always_inline extern __always_inline +# endif +#endif + +/* GCC 4.3 and above allow passing all anonymous arguments of an + __extern_always_inline function to some other vararg function. */ +#if __GNUC_PREREQ (4,3) +# define __va_arg_pack() __builtin_va_arg_pack () +# define __va_arg_pack_len() __builtin_va_arg_pack_len () +#endif + +/* It is possible to compile containing GCC extensions even if GCC is + run in pedantic mode if the uses are carefully marked using the + `__extension__' keyword. But this is not generally available before + version 2.8. */ +#if !__GNUC_PREREQ (2,8) +# define __extension__ /* Ignore */ +#endif + +/* __restrict is known in EGCS 1.2 and above. */ +#if !__GNUC_PREREQ (2,92) +# define __restrict /* Ignore */ +#endif + +/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is + array_name[restrict] + GCC 3.1 supports this. */ +#if __GNUC_PREREQ (3,1) && !defined __GNUG__ +# define __restrict_arr __restrict +#else +# ifdef __GNUC__ +# define __restrict_arr /* Not supported in old GCC. */ +# else +# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L +# define __restrict_arr restrict +# else +/* Some other non-C99 compiler. */ +# define __restrict_arr /* Not supported. */ +# endif +# endif +#endif + +#if __GNUC__ >= 3 +# define __glibc_unlikely(cond) __builtin_expect((cond), 0) +#else +# define __glibc_unlikely(cond) (cond) +#endif + +#endif /* sys/cdefs.h */ diff --git a/toolchain-old/musl/include/sys/glibc-types.h b/toolchain-old/musl/include/sys/glibc-types.h new file mode 100644 index 000000000..fa0684ced --- /dev/null +++ b/toolchain-old/musl/include/sys/glibc-types.h @@ -0,0 +1,35 @@ +#ifndef __MUSL_GLIBC_TYPES_H +#define __MUSL_GLIBC_TYPES_H + +#include + +/* Convenience types. */ +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; + +/* Fixed-size types, underlying types depend on word size and compiler. */ +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +#if __WORDSIZE == 64 +typedef signed long int __int64_t; +typedef unsigned long int __uint64_t; +#else +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; +#endif + +#define __off64_t off_t +#define __loff_t off_t +typedef char *__caddr_t; +#define __locale_t locale_t + +#define __gid_t gid_t +#define __uid_t uid_t + +#endif diff --git a/toolchain-old/musl/include/sys/queue.h b/toolchain-old/musl/include/sys/queue.h new file mode 100644 index 000000000..daf4553d3 --- /dev/null +++ b/toolchain-old/musl/include/sys/queue.h @@ -0,0 +1,574 @@ +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List functions. + */ +#define LIST_INIT(head) do { \ + (head)->lh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.le_next = (head)->lh_first) != NULL) \ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var); \ + (var) = ((var)->field.le_next)) + +/* + * List access methods. + */ +#define LIST_EMPTY(head) ((head)->lh_first == NULL) +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = NULL; \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) + +/* + * Singly-linked List access methods. + */ +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +#define STAILQ_CONCAT(head1, head2) do { \ + if (!STAILQ_EMPTY((head2))) { \ + *(head1)->stqh_last = (head2)->stqh_first; \ + (head1)->stqh_last = (head2)->stqh_last; \ + STAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) + + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var); \ + (var) = ((var)->field.sqe_next)) + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue functions. + */ +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = NULL; \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.tqe_next = NULL; \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + if (((elm)->field.tqe_next) != NULL) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ + (var); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +#define TAILQ_CONCAT(head1, head2, field) do { \ + if (!TAILQ_EMPTY(head2)) { \ + *(head1)->tqh_last = (head2)->tqh_first; \ + (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ + (head1)->tqh_last = (head2)->tqh_last; \ + TAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * Tail queue access methods. + */ +#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) + +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) + + +/* + * Circular queue definitions. + */ +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { (void *)&head, (void *)&head } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = (void *)(head); \ + (head)->cqh_last = (void *)(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = (void *)(head); \ + if ((head)->cqh_last == (void *)(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.cqe_next = (void *)(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == (void *)(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + if ((elm)->field.cqe_next == (void *)(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == (void *)(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != (const void *)(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == (void *)(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == (void *)(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) + +#endif /* sys/queue.h */ diff --git a/toolchain-old/musl/patches/100-add_glob_onlydir.patch b/toolchain-old/musl/patches/100-add_glob_onlydir.patch new file mode 100644 index 000000000..db0bc22af --- /dev/null +++ b/toolchain-old/musl/patches/100-add_glob_onlydir.patch @@ -0,0 +1,11 @@ +--- a/include/glob.h ++++ b/include/glob.h +@@ -31,6 +31,8 @@ void globfree(glob_t *); + #define GLOB_NOESCAPE 0x40 + #define GLOB_PERIOD 0x80 + ++#define GLOB_ONLYDIR 0x100 ++ + #define GLOB_NOSPACE 1 + #define GLOB_ABORTED 2 + #define GLOB_NOMATCH 3 diff --git a/toolchain-old/musl/patches/110-read_timezone_from_fs.patch b/toolchain-old/musl/patches/110-read_timezone_from_fs.patch new file mode 100644 index 000000000..b4349e736 --- /dev/null +++ b/toolchain-old/musl/patches/110-read_timezone_from_fs.patch @@ -0,0 +1,28 @@ +--- a/src/time/__tz.c ++++ b/src/time/__tz.c +@@ -23,6 +23,9 @@ static int r0[5], r1[5]; + static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end; + static size_t map_size; + ++static const char *tzfile; ++static size_t tzfile_size; ++ + static char old_tz_buf[32]; + static char *old_tz = old_tz_buf; + static size_t old_tz_size = sizeof old_tz_buf; +@@ -125,6 +128,15 @@ static void do_tzset() + "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; + + s = getenv("TZ"); ++ ++ /* if TZ is empty try to read it from /etc/TZ */ ++ if (!s || !*s) { ++ if (tzfile) ++ __munmap((void*)tzfile, tzfile_size); ++ ++ s = tzfile = (void *)__map_file("/etc/TZ", &tzfile_size); ++ } ++ + if (!s) s = "/etc/localtime"; + if (!*s) s = __gmt; + diff --git a/toolchain-old/musl/patches/200-add_libssp_nonshared.patch b/toolchain-old/musl/patches/200-add_libssp_nonshared.patch new file mode 100644 index 000000000..218ca4140 --- /dev/null +++ b/toolchain-old/musl/patches/200-add_libssp_nonshared.patch @@ -0,0 +1,50 @@ +From 7ec87fbbc3cac99b4173d082dd6195f47c9a32e7 Mon Sep 17 00:00:00 2001 +From: Steven Barth +Date: Mon, 22 Jun 2015 11:01:56 +0200 +Subject: [PATCH] Add libssp_nonshared.a so GCC's is not needed + +Signed-off-by: Steven Barth +--- + Makefile | 10 ++++++++-- + libssp_nonshared/__stack_chk_fail_local.c | 2 ++ + 2 files changed, 10 insertions(+), 2 deletions(-) + create mode 100644 libssp_nonshared/__stack_chk_fail_local.c + +--- a/Makefile ++++ b/Makefile +@@ -66,7 +66,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C + STATIC_LIBS = lib/libc.a + SHARED_LIBS = lib/libc.so + TOOL_LIBS = lib/musl-gcc.specs +-ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) ++ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) lib/libssp_nonshared.a + ALL_TOOLS = obj/musl-gcc + + WRAPCC_GCC = gcc +@@ -129,7 +129,8 @@ NOSSP_SRCS = $(wildcard crt/*.c) \ + src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \ + src/string/memset.c src/string/$(ARCH)/memset.c \ + src/string/memcpy.c src/string/$(ARCH)/memcpy.c \ +- ldso/dlstart.c ldso/dynlink.c ++ ldso/dlstart.c ldso/dynlink.c \ ++ src/libssp_nonshared/__stack_chk_fail_local.c + $(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) + + $(CRT_OBJS): CFLAGS_ALL += -DCRT +@@ -172,6 +173,11 @@ lib/libc.a: $(AOBJS) + $(AR) rc $@ $(AOBJS) + $(RANLIB) $@ + ++lib/libssp_nonshared.a: obj/src/libssp_nonshared/__stack_chk_fail_local.o ++ rm -f $@ ++ $(AR) rc $@ $< ++ $(RANLIB) $@ ++ + $(EMPTY_LIBS): + rm -f $@ + $(AR) rc $@ +--- /dev/null ++++ b/src/libssp_nonshared/__stack_chk_fail_local.c +@@ -0,0 +1,2 @@ ++#include "atomic.h" ++void __attribute__((visibility ("hidden"))) __stack_chk_fail_local(void) { a_crash(); } diff --git a/toolchain-old/musl/patches/300-relative.patch b/toolchain-old/musl/patches/300-relative.patch new file mode 100644 index 000000000..6e30e0a88 --- /dev/null +++ b/toolchain-old/musl/patches/300-relative.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -221,7 +221,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc + $(INSTALL) -D -m 644 $< $@ + + $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so +- $(INSTALL) -D -l $(libdir)/libc.so $@ || true ++ $(INSTALL) -D -l libc.so $@ || true + + install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) + diff --git a/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch new file mode 100644 index 000000000..c495d67e0 --- /dev/null +++ b/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch @@ -0,0 +1,197 @@ +From e6683d001a95d7c3d4d992496f00f77e01fcd268 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 22 Nov 2015 15:04:23 +0100 +Subject: [PATCH v2] Add format attribute to some function declarations + +GCC and Clang are able to check the format arguments given to a +function and warn the user if there is a error in the format arguments +or if there is a potential uncontrolled format string security problem +in the code. GCC does this automatically for some functions like +printf(), but it is also possible to annotate other functions in a way +that it will check them too. This feature is used by glibc for many +functions. This patch adds the attribute to the some functions of musl +expect for these functions where gcc automatically adds it. + +GCC automatically adds checks for these functions: printf, fprintf, +sprintf, scanf, fscanf, sscanf, strftime, vprintf, vfprintf and +vsprintf. + +The documentation from gcc is here: +https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html + +The documentation from Clang is here: +http://clang.llvm.org/docs/AttributeReference.html#format-gnu-format + +Signed-off-by: Hauke Mehrtens +--- + include/err.h | 26 +++++++++++++++++--------- + include/monetary.h | 12 ++++++++++-- + include/stdio.h | 29 ++++++++++++++++++++--------- + include/syslog.h | 12 ++++++++++-- + 4 files changed, 57 insertions(+), 22 deletions(-) + +--- a/include/err.h ++++ b/include/err.h +@@ -8,15 +8,23 @@ + extern "C" { + #endif + +-void warn(const char *, ...); +-void vwarn(const char *, va_list); +-void warnx(const char *, ...); +-void vwarnx(const char *, va_list); ++#if __GNUC__ >= 3 ++#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) ++#else ++#define __fp(x, y) ++#endif + +-_Noreturn void err(int, const char *, ...); +-_Noreturn void verr(int, const char *, va_list); +-_Noreturn void errx(int, const char *, ...); +-_Noreturn void verrx(int, const char *, va_list); ++void warn(const char *, ...) __fp(1, 2); ++void vwarn(const char *, va_list) __fp(1, 0); ++void warnx(const char *, ...) __fp(1, 2); ++void vwarnx(const char *, va_list) __fp(1, 0); ++ ++_Noreturn void err(int, const char *, ...) __fp(2, 3); ++_Noreturn void verr(int, const char *, va_list) __fp(2, 0); ++_Noreturn void errx(int, const char *, ...) __fp(2, 3); ++_Noreturn void verrx(int, const char *, va_list) __fp(2, 0); ++ ++#undef __fp + + #ifdef __cplusplus + } +--- a/include/monetary.h ++++ b/include/monetary.h +@@ -13,8 +13,16 @@ extern "C" { + + #include + +-ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...); +-ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...); ++#if __GNUC__ >= 3 ++#define __fsfm(x, y) __attribute__ ((__format__ (__strfmon__, x, y))) ++#else ++#define __fsfm(x, y) ++#endif ++ ++ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...) __fsfm(3, 4); ++ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...) __fsfm(4, 5); ++ ++#undef __fsfm + + #ifdef __cplusplus + } +--- a/include/stdio.h ++++ b/include/stdio.h +@@ -21,6 +21,14 @@ extern "C" { + + #include + ++#if __GNUC__ >= 3 ++#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) ++#define __fs(x, y) __attribute__ ((__format__ (__scanf__, x, y))) ++#else ++#define __fp(x, y) ++#define __fs(x, y) ++#endif ++ + #ifdef __cplusplus + #define NULL 0L + #else +@@ -102,19 +110,19 @@ int puts(const char *); + int printf(const char *__restrict, ...); + int fprintf(FILE *__restrict, const char *__restrict, ...); + int sprintf(char *__restrict, const char *__restrict, ...); +-int snprintf(char *__restrict, size_t, const char *__restrict, ...); ++int snprintf(char *__restrict, size_t, const char *__restrict, ...) __fp(3, 4); + + int vprintf(const char *__restrict, __isoc_va_list); + int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list); + int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list); +-int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list); ++int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list) __fp(3, 0); + + int scanf(const char *__restrict, ...); + int fscanf(FILE *__restrict, const char *__restrict, ...); + int sscanf(const char *__restrict, const char *__restrict, ...); +-int vscanf(const char *__restrict, __isoc_va_list); +-int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list); +-int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list); ++int vscanf(const char *__restrict, __isoc_va_list) __fs(1, 0); ++int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); ++int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); + + void perror(const char *); + +@@ -135,8 +143,8 @@ int pclose(FILE *); + int fileno(FILE *); + int fseeko(FILE *, off_t, int); + off_t ftello(FILE *); +-int dprintf(int, const char *__restrict, ...); +-int vdprintf(int, const char *__restrict, __isoc_va_list); ++int dprintf(int, const char *__restrict, ...) __fp(2, 3); ++int vdprintf(int, const char *__restrict, __isoc_va_list) __fp(2, 0); + void flockfile(FILE *); + int ftrylockfile(FILE *); + void funlockfile(FILE *); +@@ -175,8 +183,8 @@ int fileno_unlocked(FILE *); + int getw(FILE *); + int putw(int, FILE *); + char *fgetln(FILE *, size_t *); +-int asprintf(char **, const char *, ...); +-int vasprintf(char **, const char *, __isoc_va_list); ++int asprintf(char **, const char *, ...) __fp(2, 3); ++int vasprintf(char **, const char *, __isoc_va_list) __fp(2, 0); + #endif + + #ifdef _GNU_SOURCE +@@ -184,6 +192,9 @@ char *fgets_unlocked(char *, int, FILE * + int fputs_unlocked(const char *, FILE *); + #endif + ++#undef __fp ++#undef __fs ++ + #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) + #define tmpfile64 tmpfile + #define fopen64 fopen +--- a/include/syslog.h ++++ b/include/syslog.h +@@ -56,16 +56,22 @@ extern "C" { + #define LOG_NOWAIT 0x10 + #define LOG_PERROR 0x20 + ++#if __GNUC__ >= 3 ++#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) ++#else ++#define __fp(x, y) ++#endif ++ + void closelog (void); + void openlog (const char *, int, int); + int setlogmask (int); +-void syslog (int, const char *, ...); ++void syslog (int, const char *, ...) __fp(2, 3); + + #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) + #define _PATH_LOG "/dev/log" + #define __NEED_va_list + #include +-void vsyslog (int, const char *, va_list); ++void vsyslog (int, const char *, va_list) __fp(2, 0); + #if defined(SYSLOG_NAMES) + #define INTERNAL_NOPRI 0x10 + #define INTERNAL_MARK (LOG_NFACILITIES<<3) +@@ -93,6 +99,8 @@ typedef struct { + #endif + #endif + ++#undef __fp ++ + #ifdef __cplusplus + } + #endif diff --git a/toolchain-old/musl/patches/900-iconv_size_hack.patch b/toolchain-old/musl/patches/900-iconv_size_hack.patch new file mode 100644 index 000000000..343915fb0 --- /dev/null +++ b/toolchain-old/musl/patches/900-iconv_size_hack.patch @@ -0,0 +1,68 @@ +--- a/src/locale/iconv.c ++++ b/src/locale/iconv.c +@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = + "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" + "ucs4le\0utf32le\0\0\303" + "ascii\0usascii\0iso646\0iso646us\0\0\307" ++#ifdef FULL_ICONV + "eucjp\0\0\320" + "shiftjis\0sjis\0\0\321" + "gb18030\0\0\330" +@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = + "gb2312\0\0\332" + "big5\0bigfive\0cp950\0big5hkscs\0\0\340" + "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" ++#endif + #include "codepages.h" + ; + +@@ -53,6 +55,7 @@ static const unsigned short legacy_chars + #include "legacychars.h" + }; + ++#ifdef FULL_ICONV + static const unsigned short jis0208[84][94] = { + #include "jis0208.h" + }; +@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { + static const unsigned short ksc[93][94] = { + #include "ksc.h" + }; ++#endif + + static int fuzzycmp(const unsigned char *a, const unsigned char *b) + { +@@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric + c = ((c-0xd7c0)<<10) + (d-0xdc00); + } + break; ++#ifdef FULL_ICONV + case SHIFT_JIS: + if (c-0xa1 <= 0xdf-0xa1) { + c += 0xff61-0xa1; +@@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric + c = ksc[c][d]; + if (!c) goto ilseq; + break; ++#endif + default: + if (c < 128+type) break; + c -= 128+type; +--- a/src/locale/codepages.h ++++ b/src/locale/codepages.h +@@ -118,6 +118,7 @@ + "\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40" + "\230\0\0\0\0\0\44\341\12\0" + ++#ifdef FULL_ICONV + "cp1250\0" + "windows1250\0" + "\0\0" +@@ -214,6 +215,7 @@ + "\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0" + "\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0" + "\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0" ++#endif + + "koi8r\0" + "\0\0" diff --git a/toolchain-old/musl/patches/901-crypt_size_hack.patch b/toolchain-old/musl/patches/901-crypt_size_hack.patch new file mode 100644 index 000000000..8cd7b1989 --- /dev/null +++ b/toolchain-old/musl/patches/901-crypt_size_hack.patch @@ -0,0 +1,60 @@ +--- a/src/crypt/crypt_r.c ++++ b/src/crypt/crypt_r.c +@@ -19,12 +19,6 @@ char *__crypt_r(const char *key, const c + if (salt[0] == '$' && salt[1] && salt[2]) { + if (salt[1] == '1' && salt[2] == '$') + return __crypt_md5(key, salt, output); +- if (salt[1] == '2' && salt[3] == '$') +- return __crypt_blowfish(key, salt, output); +- if (salt[1] == '5' && salt[2] == '$') +- return __crypt_sha256(key, salt, output); +- if (salt[1] == '6' && salt[2] == '$') +- return __crypt_sha512(key, salt, output); + } + return __crypt_des(key, salt, output); + } +--- a/src/crypt/crypt_sha512.c ++++ b/src/crypt/crypt_sha512.c +@@ -12,6 +12,7 @@ + #include + #include + #include ++#if 0 + + /* public domain sha512 implementation based on fips180-3 */ + /* >=2^64 bits messages are not supported (about 2000 peta bytes) */ +@@ -369,3 +370,4 @@ char *__crypt_sha512(const char *key, co + return "*"; + return p; + } ++#endif +--- a/src/crypt/crypt_blowfish.c ++++ b/src/crypt/crypt_blowfish.c +@@ -50,6 +50,7 @@ + #include + #include + ++#if 0 + typedef uint32_t BF_word; + typedef int32_t BF_word_signed; + +@@ -796,3 +797,4 @@ char *__crypt_blowfish(const char *key, + + return "*"; + } ++#endif +--- a/src/crypt/crypt_sha256.c ++++ b/src/crypt/crypt_sha256.c +@@ -13,6 +13,7 @@ + #include + #include + ++#if 0 + /* public domain sha256 implementation based on fips180-3 */ + + struct sha256 { +@@ -320,3 +321,4 @@ char *__crypt_sha256(const char *key, co + return "*"; + return p; + } ++#endif diff --git a/toolchain-old/uClibc/Config.in b/toolchain-old/uClibc/Config.in new file mode 100644 index 000000000..3bcb0037e --- /dev/null +++ b/toolchain-old/uClibc/Config.in @@ -0,0 +1,6 @@ +# Debug version. + +config UCLIBC_ENABLE_DEBUG + bool "Build with debug information" + depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN + default n diff --git a/toolchain-old/uClibc/Makefile b/toolchain-old/uClibc/Makefile new file mode 100644 index 000000000..4764f2fa1 --- /dev/null +++ b/toolchain-old/uClibc/Makefile @@ -0,0 +1,37 @@ +PATH_PREFIX=. + +include ./common.mk + +HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built +HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed + +HOST_BUILD_PARALLEL:=1 + +define Host/SetToolchainInfo + $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk + $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk +endef + +define Host/Compile + $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak + $(UCLIBC_MAKE) PREFIX= all +endef + +define Host/Install + $(call Host/SetToolchainInfo) + $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev + $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/ + ( cd $(TOOLCHAIN_DIR) ; \ + for d in lib usr/lib ; do \ + for f in libc.so libgcc_s.so ; do \ + if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ + $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ + fi \ + done \ + done \ + ) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/uClibc/common.mk b/toolchain-old/uClibc/common.mk new file mode 100644 index 000000000..384d73233 --- /dev/null +++ b/toolchain-old/uClibc/common.mk @@ -0,0 +1,97 @@ +# +# Copyright (C) 2006-2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/target.mk + +PKG_VERSION:=1.0.22 + +PKG_NAME:=uClibc-ng +PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/ +PATCH_DIR:=$(PATH_PREFIX)/patches +CONFIG_DIR:=$(PATH_PREFIX)/config +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +LIBC_SO_VERSION:=$(PKG_VERSION) + +PKG_HASH:=f2004c85db8e07e9f1c2e8b7c513fa7c237bc9f9685d8e1bfc89535b8a85449b + +HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) + +include $(INCLUDE_DIR)/toolchain-build.mk + +UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ + -e 's/arc.*/arc/' \ + -e 's/i.86/i386/' \ + -e 's/sparc.*/sparc/' \ + -e 's/arm.*/arm/g' \ + -e 's/m68k.*/m68k/' \ + -e 's/ppc/powerpc/g' \ + -e 's/v850.*/v850/g' \ + -e 's/sh64/sh/' \ + -e 's/sh[234].*/sh/' \ + -e 's/mips.*/mips/' \ + -e 's/mipsel.*/mips/' \ +) + +GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ + $(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \ + $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ + $(CONFIG_DIR)/$(ARCH)$(strip \ + $(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ + $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ + $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ + $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) + +CPU_CFLAGS = \ + -funsigned-char -fno-builtin -fno-asm \ + --std=gnu99 -ffunction-sections -fdata-sections \ + -Wno-unused-but-set-variable \ + $(TARGET_CFLAGS) -ggdb + +UCLIBC_MAKE = PATH='$(TOOLCHAIN_DIR)/initial/bin:$(TARGET_PATH)' $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ + $(TARGET_CONFIGURE_OPTS) \ + DEVEL_PREFIX=/ \ + RUNTIME_PREFIX=/ \ + HOSTCC="$(HOSTCC)" \ + CPU_CFLAGS="$(CPU_CFLAGS)" \ + ARCH="$(CONFIG_ARCH)" \ + LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \ + DOSTRIP="" + +define Host/Prepare + $(call Host/Prepare/Default) + $(if $(strip $(QUILT)), \ + cd $(HOST_BUILD_DIR); \ + if $(QUILT_CMD) next >/dev/null 2>&1; then \ + $(QUILT_CMD) push -a; \ + fi + ) + ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef + +define Host/Configure + $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config.new + $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \ + -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ + -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ + -e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ + -e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ + -e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \ + $(HOST_BUILD_DIR)/.config.new + cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \ + cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \ + $(MAKE) -C $(HOST_BUILD_DIR) olddefconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ + $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ + cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last; \ + } +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ + $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev +endef diff --git a/toolchain-old/uClibc/config/arc b/toolchain-old/uClibc/config/arc new file mode 100644 index 000000000..de1ffc441 --- /dev/null +++ b/toolchain-old/uClibc/config/arc @@ -0,0 +1,10 @@ +ARCH_ANY_ENDIAN=y +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +TARGET_ARCH="arc" +TARGET_arc=y +CONFIG_ARC_CPU_700=y +# CONFIG_ARC_CPU_HS is not set +CONFIG_ARC_PAGE_SIZE_8K=y +# CONFIG_ARC_PAGE_SIZE_16K is not set +# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain-old/uClibc/config/archs b/toolchain-old/uClibc/config/archs new file mode 100644 index 000000000..961628ed8 --- /dev/null +++ b/toolchain-old/uClibc/config/archs @@ -0,0 +1,10 @@ +ARCH_ANY_ENDIAN=y +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +TARGET_ARCH="arc" +TARGET_arc=y +# CONFIG_ARC_CPU_700 is not set +CONFIG_ARC_CPU_HS=y +CONFIG_ARC_PAGE_SIZE_8K=y +# CONFIG_ARC_PAGE_SIZE_16K is not set +# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain-old/uClibc/config/arm b/toolchain-old/uClibc/config/arm new file mode 100644 index 000000000..41a60b1c3 --- /dev/null +++ b/toolchain-old/uClibc/config/arm @@ -0,0 +1,9 @@ +ARCH_ANY_ENDIAN=y +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# COMPILE_IN_THUMB_MODE is not set +TARGET_ARCH="arm" +TARGET_arm=y +# USE_BX is not set +CONFIG_ARM_EABI=y + diff --git a/toolchain-old/uClibc/config/armeb b/toolchain-old/uClibc/config/armeb new file mode 100644 index 000000000..2e46dd67d --- /dev/null +++ b/toolchain-old/uClibc/config/armeb @@ -0,0 +1,9 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_WANTS_BIG_ENDIAN=y +# COMPILE_IN_THUMB_MODE is not set +TARGET_ARCH="arm" +TARGET_arm=y +# USE_BX is not set +CONFIG_ARM_EABI=y + diff --git a/toolchain-old/uClibc/config/common b/toolchain-old/uClibc/config/common new file mode 100644 index 000000000..b679c0a1e --- /dev/null +++ b/toolchain-old/uClibc/config/common @@ -0,0 +1,226 @@ +# ARCH_ANY_ENDIAN is not set +ARCH_HAS_MMU=y +# ARCH_HAS_NO_LDSO is not set +# ARCH_HAS_NO_SHARED is not set +# ARCH_LITTLE_ENDIAN is not set +ARCH_USE_MMU=y +# ARCH_WANTS_BIG_ENDIAN is not set +# ARCH_WANTS_LITTLE_ENDIAN is not set +ASSUME_DEVPTS=y +# COMPAT_ATEXIT is not set +CROSS_COMPILER_PREFIX="" +DEVEL_PREFIX="/usr/" +# DOASSERTS is not set +# DODEBUG is not set +# DODEBUG_PT is not set +# DOMULTI is not set +DOPIC=y +DOSTRIP=y +DO_C99_MATH=y +# DO_XSI_MATH is not set +# EXTRA_WARNINGS is not set +FORCE_OPTIONS_FOR_ARCH=y +# FORCE_SHAREABLE_TEXT_SEGMENTS is not set +# HARDWIRED_ABSPATH is not set +# HAS_NO_THREADS is not set +HAVE_DOT_CONFIG=y +# HAVE_NO_PIC is not set +# HAVE_NO_SSP is not set +HAVE_SHARED=y +KERNEL_HEADERS="." +LDSO_BASE_FILENAME="ld.so" +LDSO_CACHE_SUPPORT=y +# LDSO_GNU_HASH_SUPPORT is not set +LDSO_LD_LIBRARY_PATH=y +LDSO_LDD_SUPPORT=y +# LDSO_NO_CLEANUP is not set +# LDSO_PRELINK_SUPPORT is not set +# LDSO_PRELOAD_FILE_SUPPORT is not set +LDSO_PRELOAD_ENV_SUPPORT=y +LDSO_RUNPATH=y +LDSO_SAFE_RUNPATH=y +# LDSO_RUNPATH_OF_EXECUTABLE is not set +# LDSO_SEARCH_INTERP_PATH is not set +# LDSO_STANDALONE_SUPPORT is not set +# LINUXTHREADS_NEW is not set +# LINUXTHREADS_OLD is not set +# UCLIBC_HAS_BACKTRACE is not set +UCLIBC_HAS_THREADS_NATIVE=y +# MALLOC is not set +MALLOC_GLIBC_COMPAT=y +# MALLOC_SIMPLE is not set +MALLOC_STANDARD=y +MULTILIB_DIR="lib" +PTHREADS_DEBUG_SUPPORT=y +RUNTIME_PREFIX="/" +# SUPPORT_LD_DEBUG is not set +# SUPPORT_LD_DEBUG_EARLY is not set +TARGET_SUBARCH="" +# TARGET_alpha is not set +# TARGET_arc is not set +# TARGET_arm is not set +# TARGET_avr32 is not set +# TARGET_bfin is not set +# TARGET_c6x is not set +# TARGET_cris is not set +# TARGET_e1 is not set +# TARGET_frv is not set +# TARGET_h8300 is not set +# TARGET_hppa is not set +# TARGET_i386 is not set +# TARGET_i960 is not set +# TARGET_ia64 is not set +# TARGET_lm32 is not set +# TARGET_m68k is not set +# TARGET_metag is not set +# TARGET_microblaze is not set +# TARGET_mips is not set +# TARGET_nios is not set +# TARGET_nios2 is not set +# TARGET_or1k is not set +# TARGET_powerpc is not set +# TARGET_sh is not set +# TARGET_sh64 is not set +# TARGET_sparc is not set +# TARGET_v850 is not set +# TARGET_vax is not set +# TARGET_x86_64 is not set +# TARGET_xtensa is not set +UCLIBC_BSD_SPECIFIC=y +UCLIBC_BUILD_NOEXECSTACK=y +# UCLIBC_BUILD_NOW is not set +# UCLIBC_BUILD_PIE is not set +UCLIBC_BUILD_RELRO=y +UCLIBC_CTOR_DTOR=y +UCLIBC_DYNAMIC_ATEXIT=y +UCLIBC_EXTRA_CFLAGS="" +UCLIBC_GRP_BUFFER_SIZE=256 +UCLIBC_HAS_ADVANCED_REALTIME=y +# UCLIBC_HAS_ARC4RANDOM is not set +# UCLIBC_HAS_ARGP is not set +UCLIBC_HAS_BSD_ERR=y +UCLIBC_HAS_BSD_RES_CLOSE=y +# UCLIBC_HAS_COMPAT_RES_STATE is not set +UCLIBC_HAS_CRYPT=y +UCLIBC_HAS_CRYPT_IMPL=y +UCLIBC_HAS_CTYPE_CHECKED=y +# UCLIBC_HAS_CTYPE_ENFORCED is not set +UCLIBC_HAS_CTYPE_SIGNED=y +UCLIBC_HAS_CTYPE_TABLES=y +# UCLIBC_HAS_CTYPE_UNSAFE is not set +UCLIBC_HAS_EPOLL=y +UCLIBC_HAS_ERRNO_MESSAGES=y +# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set +# UCLIBC_HAS_FENV is not set +UCLIBC_HAS_FLOATS=y +UCLIBC_HAS_FNMATCH=y +UCLIBC_HAS_FNMATCH_OLD=y +# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set +UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y +# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set +# UCLIBC_HAS_FPU is not set +UCLIBC_HAS_FTS=y +UCLIBC_HAS_FTW=y +# UCLIBC_HAS_FULL_RPC is not set +UCLIBC_HAS_GETPT=y +UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y +UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y +# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set +UCLIBC_HAS_GLOB=y +UCLIBC_HAS_GNU_ERROR=y +UCLIBC_HAS_GNU_GETOPT=y +UCLIBC_HAS_GNU_GETSUBOPT=y +UCLIBC_HAS_GNU_GLOB=y +UCLIBC_HAS_HEXADECIMAL_FLOATS=y +UCLIBC_HAS_IPV4=y +UCLIBC_HAS_IPV6=y +UCLIBC_HAS_LFS=y +UCLIBC_HAS_LIBNSL_STUB=y +UCLIBC_HAS_LIBRESOLV_STUB=y +UCLIBC_HAS_LIBUTIL=y +# UCLIBC_HAS_LOCALE is not set +# UCLIBC_BUILD_ALL_LOCALE is not set +# UCLIBC_BUILD_MINIMAL_LOCALE is not set +# UCLIBC_PREGENERATED_LOCALE_DATA is not set +UCLIBC_HAS_LONG_DOUBLE_MATH=y +UCLIBC_HAS_NETWORK_SUPPORT=y +UCLIBC_HAS_NFTW=y +UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y +# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set +UCLIBC_HAS_PRINTF_M_SPEC=y +# UCLIBC_HAS_PROFILING is not set +UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y +UCLIBC_HAS_PTY=y +UCLIBC_HAS_REALTIME=y +# UCLIBC_HAS_REENTRANT_RPC is not set +UCLIBC_HAS_REGEX=y +UCLIBC_HAS_REGEX_OLD=y +UCLIBC_HAS_RESOLVER_SUPPORT=y +# UCLIBC_HAS_RPC is not set +UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y +# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set +# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set +UCLIBC_HAS_SHADOW=y +UCLIBC_HAS_SIGNUM_MESSAGES=y +UCLIBC_HAS_SOCKET=y +UCLIBC_HAS_SOFT_FLOAT=y +# UCLIBC_HAS_SSP is not set +# UCLIBC_HAS_SSP_COMPAT is not set +UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y +# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set +UCLIBC_HAS_STDIO_BUFSIZ_4096=y +# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set +# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set +# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set +UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y +UCLIBC_HAS_STDIO_GETC_MACRO=y +UCLIBC_HAS_STDIO_PUTC_MACRO=y +# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set +UCLIBC_HAS_STRING_ARCH_OPT=y +UCLIBC_HAS_STRING_GENERIC_OPT=y +# UCLIBC_HAS_STUBS is not set +UCLIBC_HAS_SYSLOG=y +# UCLIBC_HAS_SYS_ERRLIST is not set +# UCLIBC_HAS_SYS_SIGLIST is not set +UCLIBC_HAS_THREADS=y +UCLIBC_HAS_TM_EXTENSIONS=y +UCLIBC_HAS_TZ_CACHING=y +UCLIBC_HAS_TZ_FILE=y +UCLIBC_HAS_TZ_FILE_READ_MANY=y +UCLIBC_HAS_UTMPX=y +UCLIBC_HAS_UTMP=y +UCLIBC_HAS_WCHAR=y +UCLIBC_HAS_WORDEXP=y +UCLIBC_HAS_XATTR=y +# UCLIBC_HAS_XLOCALE is not set +UCLIBC_HAS___PROGNAME=y +# UCLIBC_LINUX_MODULE_24 is not set +UCLIBC_LINUX_MODULE_26=y +UCLIBC_LINUX_SPECIFIC=y +# UCLIBC_MALLOC_DEBUGGING is not set +# UCLIBC_MJN3_ONLY is not set +# UCLIBC_NTP_LEGACY is not set +# USE_OLD_VFPRINTF is not set +UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 +UCLIBC_PWD_BUFFER_SIZE=256 +# UCLIBC_STATIC_LDCONFIG is not set +# UCLIBC_STRICT_HEADERS is not set +UCLIBC_SUPPORT_AI_ADDRCONFIG=y +UCLIBC_SUSV3_LEGACY=y +UCLIBC_SUSV3_LEGACY_MACROS=y +UCLIBC_SUSV4_LEGACY=y +# UCLIBC_SV4_DEPRECATED is not set +UCLIBC_TZ_FILE_PATH="/etc/TZ" +# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set +UCLIBC_USE_NETLINK=y +# UNIX98PTY_ONLY is not set +USE_BX=y +WARNINGS="-Wall" +# UCLIBC_HAS_OBSTACK is not set +# UCLIBC_SUSV2_LEGACY is not set +# UCLIBC_HAS_CONTEXT_FUNCS is not set +UCLIBC_HAS_GETOPT_LONG=y diff --git a/toolchain-old/uClibc/config/debug b/toolchain-old/uClibc/config/debug new file mode 100644 index 000000000..b366e66e3 --- /dev/null +++ b/toolchain-old/uClibc/config/debug @@ -0,0 +1,6 @@ +DODEBUG=y +DODEBUG_PT=y +PTHREADS_DEBUG_SUPPORT=y +SUPPORT_LD_DEBUG=y +SUPPORT_LD_DEBUG_EARLY=y +UCLIBC_MALLOC_DEBUGGING=y diff --git a/toolchain-old/uClibc/config/i386 b/toolchain-old/uClibc/config/i386 new file mode 100644 index 000000000..5ef264c27 --- /dev/null +++ b/toolchain-old/uClibc/config/i386 @@ -0,0 +1,21 @@ +ARCH_LITTLE_ENDIAN=y +# CONFIG_386 is not set +CONFIG_486=y +# CONFIG_586 is not set +# CONFIG_586MMX is not set +# CONFIG_686 is not set +# CONFIG_CRUSOE is not set +# CONFIG_CYRIXIII is not set +# CONFIG_ELAN is not set +# CONFIG_GENERIC_386 is not set +# CONFIG_K6 is not set +# CONFIG_K7 is not set +# CONFIG_NEHEMIAH is not set +# CONFIG_PENTIUM4 is not set +# CONFIG_PENTIUMII is not set +# CONFIG_PENTIUMIII is not set +# CONFIG_WINCHIP2 is not set +# CONFIG_WINCHIPC6 is not set +TARGET_ARCH="i386" +TARGET_i386=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/i686 b/toolchain-old/uClibc/config/i686 new file mode 100644 index 000000000..ba615f6b8 --- /dev/null +++ b/toolchain-old/uClibc/config/i686 @@ -0,0 +1,21 @@ +ARCH_LITTLE_ENDIAN=y +# CONFIG_386 is not set +# CONFIG_486 is not set +# CONFIG_586 is not set +# CONFIG_586MMX is not set +CONFIG_686=y +# CONFIG_CRUSOE is not set +# CONFIG_CYRIXIII is not set +# CONFIG_ELAN is not set +# CONFIG_GENERIC_386 is not set +# CONFIG_K6 is not set +# CONFIG_K7 is not set +# CONFIG_NEHEMIAH is not set +# CONFIG_PENTIUM4 is not set +# CONFIG_PENTIUMII is not set +# CONFIG_PENTIUMIII is not set +# CONFIG_WINCHIP2 is not set +# CONFIG_WINCHIPC6 is not set +TARGET_ARCH="i386" +TARGET_i386=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/m68k b/toolchain-old/uClibc/config/m68k new file mode 100644 index 000000000..14ce5aef7 --- /dev/null +++ b/toolchain-old/uClibc/config/m68k @@ -0,0 +1,6 @@ +ARCH_BIG_ENDIAN=y +LINUXTHREADS_OLD=y +TARGET_ARCH="m68k" +TARGET_SUBARCH="" +TARGET_m68k=y +# UCLIBC_HAS_THREADS_NATIVE is not set diff --git a/toolchain-old/uClibc/config/mips b/toolchain-old/uClibc/config/mips new file mode 100644 index 000000000..8cec22f4d --- /dev/null +++ b/toolchain-old/uClibc/config/mips @@ -0,0 +1,18 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_WANTS_BIG_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +CONFIG_MIPS_ISA_MIPS32=y +# CONFIG_MIPS_ISA_MIPS32R2 is not set +# CONFIG_MIPS_ISA_MIPS64 is not set +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +CONFIG_MIPS_O32_ABI=y +TARGET_ARCH="mips" +TARGET_mips=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64 b/toolchain-old/uClibc/config/mips64 new file mode 100644 index 000000000..566d87a6e --- /dev/null +++ b/toolchain-old/uClibc/config/mips64 @@ -0,0 +1,18 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_WANTS_BIG_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +CONFIG_MIPS_N64_ABI=y +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.32 b/toolchain-old/uClibc/config/mips64.32 new file mode 100644 index 000000000..b7ea8f457 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64.32 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_WANTS_BIG_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +CONFIG_MIPS_O32_ABI=y +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.64 b/toolchain-old/uClibc/config/mips64.64 new file mode 100644 index 000000000..2a0b755a7 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64.64 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_WANTS_BIG_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +CONFIG_MIPS_N64_ABI=y +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.n32 b/toolchain-old/uClibc/config/mips64.n32 new file mode 100644 index 000000000..f8def5837 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64.n32 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_BIG_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_WANTS_BIG_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +CONFIG_MIPS_N32_ABI=y +# CONFIG_MIPS_N64_ABI is not set +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el b/toolchain-old/uClibc/config/mips64el new file mode 100644 index 000000000..53580787b --- /dev/null +++ b/toolchain-old/uClibc/config/mips64el @@ -0,0 +1,18 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +CONFIG_MIPS_N64_ABI=y +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.32 b/toolchain-old/uClibc/config/mips64el.32 new file mode 100644 index 000000000..a10840bf9 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64el.32 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +CONFIG_MIPS_O32_ABI=y +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.64 b/toolchain-old/uClibc/config/mips64el.64 new file mode 100644 index 000000000..8b90a54a5 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64el.64 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +CONFIG_MIPS_N64_ABI=y +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.n32 b/toolchain-old/uClibc/config/mips64el.n32 new file mode 100644 index 000000000..4ac4d06c0 --- /dev/null +++ b/toolchain-old/uClibc/config/mips64el.n32 @@ -0,0 +1,19 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +CONFIG_MIPS_ISA_MIPS64=y +# CONFIG_MIPS_ISA_MIPS64R2 is not set +CONFIG_MIPS_N32_ABI=y +# CONFIG_MIPS_N64_ABI is not set +# CONFIG_MIPS_O32_ABI is not set +TARGET_ARCH="mips" +TARGET_mips=y +TARGET_SUBARCH="mips64" +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mipsel b/toolchain-old/uClibc/config/mipsel new file mode 100644 index 000000000..d9dedbb02 --- /dev/null +++ b/toolchain-old/uClibc/config/mipsel @@ -0,0 +1,18 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +# CONFIG_MIPS_ISA_3 is not set +# CONFIG_MIPS_ISA_4 is not set +CONFIG_MIPS_ISA_MIPS32=y +# CONFIG_MIPS_ISA_MIPS32R2 is not set +# CONFIG_MIPS_ISA_MIPS64 is not set +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +CONFIG_MIPS_O32_ABI=y +TARGET_ARCH="mips" +TARGET_mips=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mipsel.cobalt b/toolchain-old/uClibc/config/mipsel.cobalt new file mode 100644 index 000000000..1d42a70f2 --- /dev/null +++ b/toolchain-old/uClibc/config/mipsel.cobalt @@ -0,0 +1,18 @@ +ARCH_ANY_ENDIAN=y +ARCH_CFLAGS="-mno-split-addresses" +ARCH_LITTLE_ENDIAN=y +ARCH_WANTS_LITTLE_ENDIAN=y +# CONFIG_MIPS_ISA_1 is not set +# CONFIG_MIPS_ISA_2 is not set +CONFIG_MIPS_ISA_3=y +# CONFIG_MIPS_ISA_4 is not set +# CONFIG_MIPS_ISA_MIPS32 is not set +# CONFIG_MIPS_ISA_MIPS32R2 is not set +# CONFIG_MIPS_ISA_MIPS64 is not set +# CONFIG_MIPS_ISA_MIPS64R2 is not set +# CONFIG_MIPS_N32_ABI is not set +# CONFIG_MIPS_N64_ABI is not set +CONFIG_MIPS_O32_ABI=y +TARGET_ARCH="mips" +TARGET_mips=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/powerpc b/toolchain-old/uClibc/config/powerpc new file mode 100644 index 000000000..5b1292d12 --- /dev/null +++ b/toolchain-old/uClibc/config/powerpc @@ -0,0 +1,6 @@ +ARCH_BIG_ENDIAN=y +CONFIG_CLASSIC=y +# CONFIG_E500 is not set +TARGET_ARCH="powerpc" +TARGET_SUBARCH="classic" +TARGET_powerpc=y diff --git a/toolchain-old/uClibc/config/powerpc.e500 b/toolchain-old/uClibc/config/powerpc.e500 new file mode 100644 index 000000000..a835c3d5e --- /dev/null +++ b/toolchain-old/uClibc/config/powerpc.e500 @@ -0,0 +1,6 @@ +ARCH_BIG_ENDIAN=y +# CONFIG_CLASSIC is not set +CONFIG_E500=y +TARGET_ARCH="powerpc" +TARGET_SUBARCH="classic" +TARGET_powerpc=y diff --git a/toolchain-old/uClibc/config/sparc b/toolchain-old/uClibc/config/sparc new file mode 100644 index 000000000..e1596c410 --- /dev/null +++ b/toolchain-old/uClibc/config/sparc @@ -0,0 +1,8 @@ +ARCH_BIG_ENDIAN=y +# CONFIG_SPARC_V7 is not set +# CONFIG_SPARC_V8 is not set +CONFIG_SPARC_V9=y +# CONFIG_SPARC_V9B is not set +TARGET_ARCH="sparc" +TARGET_sparc=y +UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain-old/uClibc/config/sparc.leon b/toolchain-old/uClibc/config/sparc.leon new file mode 100644 index 000000000..eb725ac05 --- /dev/null +++ b/toolchain-old/uClibc/config/sparc.leon @@ -0,0 +1,8 @@ +ARCH_BIG_ENDIAN=y +# CONFIG_SPARC_V7 is not set +CONFIG_SPARC_V8=y +# CONFIG_SPARC_V9 is not set +# CONFIG_SPARC_V9B is not set +TARGET_ARCH="sparc" +TARGET_sparc=y +UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain-old/uClibc/config/x86_64 b/toolchain-old/uClibc/config/x86_64 new file mode 100644 index 000000000..b6dc2c2af --- /dev/null +++ b/toolchain-old/uClibc/config/x86_64 @@ -0,0 +1,6 @@ +ARCH_LITTLE_ENDIAN=y +# LINUXTHREADS_NEW is not set +TARGET_ARCH="x86_64" +TARGET_x86_64=y +UCLIBC_BSD_SPECIFIC=y +UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/headers/Makefile b/toolchain-old/uClibc/headers/Makefile new file mode 100644 index 000000000..abd3620d3 --- /dev/null +++ b/toolchain-old/uClibc/headers/Makefile @@ -0,0 +1,27 @@ +PATH_PREFIX:=.. + +include ../common.mk + +HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built +HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed + +define Host/Compile + +endef + +define Host/Install + PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ + PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ + DEVEL_PREFIX=/ \ + RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ + HOSTCC="$(HOSTCC)" \ + CC="$(TARGET_CC)" \ + CPU_CFLAGS="$(TARGET_CFLAGS)" \ + ARCH="$(CONFIG_ARCH)" \ + pregen \ + install_headers + $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ +endef + +$(eval $(call HostBuild)) + diff --git a/toolchain-old/uClibc/utils/Makefile b/toolchain-old/uClibc/utils/Makefile new file mode 100644 index 000000000..83100d70c --- /dev/null +++ b/toolchain-old/uClibc/utils/Makefile @@ -0,0 +1,24 @@ +PATH_PREFIX=.. + +include ../common.mk + +HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.utils_built +HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_utils_installed + +define Host/Compile + $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak + $(UCLIBC_MAKE) PREFIX= utils +endef + +define Host/Install + $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin + $(INSTALL_BIN) \ + $(HOST_BUILD_DIR)/utils/ldd \ + $(TOOLCHAIN_DIR)/bin/ + $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin + $(INSTALL_BIN) \ + $(HOST_BUILD_DIR)/utils/ldconfig \ + $(TOOLCHAIN_DIR)/sbin/ +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/wrapper/Makefile b/toolchain-old/wrapper/Makefile new file mode 100644 index 000000000..3398e407c --- /dev/null +++ b/toolchain-old/wrapper/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=wrapper +PKG_VERSION:=1 + +include $(INCLUDE_DIR)/toolchain-build.mk + + +# 1: args +define toolchain_util +$(strip $(SCRIPT_DIR)/ext-toolchain.sh --toolchain $(CONFIG_TOOLCHAIN_ROOT) \ + --cflags $(CONFIG_TARGET_OPTIMIZATION) \ + --cflags "$(if $(call qstrip,$(CONFIG_TOOLCHAIN_LIBC)),-m$(call qstrip,$(CONFIG_TOOLCHAIN_LIBC))) $(if $(CONFIG_SOFT_FLOAT),-msoft-float)" \ + --cflags "$(patsubst ./%,-I$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH)))" \ + --cflags "$(patsubst ./%,-L$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH)))" \ + $(1)) +endef + +# 1: config symbol +# 2: feature +define toolchain_test +$$(if $$($(1)), \ + @echo -n "Testing external toolchain for $(2) support ... "; \ + if $(call toolchain_util,--test "$(2)"); then \ + echo "ok"; exit 0; \ + else \ + echo "failed"; \ + echo "ERROR: $(1) is enabled but the external toolchain does not support it"; \ + exit 1; \ + fi) +endef + + +define Host/Prepare + $(call toolchain_test,CONFIG_SOFT_FLOAT,softfloat) + $(call toolchain_test,CONFIG_IPV6,ipv6) + $(call toolchain_test,CONFIG_NLS,wchar) + $(call toolchain_test,CONFIG_PACKAGE_libpthread,threads) +endef + +define Host/Configure +endef + +define Host/Compile +endef + +define Host/Install + $(call toolchain_util,--wrap "$(TOOLCHAIN_DIR)/bin") +endef + +define Host/Clean + rm -rf $(TOOLCHAIN_DIR)/bin +endef + +$(eval $(call HostBuild)) diff --git a/toolchain-old/yasm/Makefile b/toolchain-old/yasm/Makefile new file mode 100644 index 000000000..e5cdac6fe --- /dev/null +++ b/toolchain-old/yasm/Makefile @@ -0,0 +1,63 @@ +# +# Copyright (C) 2016 Daniel Golle +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +include $(TOPDIR)/rules.mk + +PKG_NAME:=yasm +PKG_VERSION:=1.3.0 + +PKG_SOURCE_URL:=http://www.tortall.net/projects/yasm/releases/ +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz + +PKG_HASH:=3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f + +HOST_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/toolchain-build.mk + +YASM_CONFIGURE:= \ + ./configure \ + --prefix=$(TOOLCHAIN_DIR) \ + --build=$(GNU_HOST_NAME) \ + --host=$(GNU_HOST_NAME) \ + --target=$(REAL_GNU_TARGET_NAME) \ + --with-sysroot=$(TOOLCHAIN_DIR) \ + --disable-multilib \ + --disable-werror \ + --disable-nls \ + --disable-sim \ + --disable-gdb \ + $(SOFT_FLOAT_CONFIG_OPTION) \ + +define Host/Prepare + $(call Host/Prepare/Default) + ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) + $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ +endef + +define Host/Configure + (cd $(HOST_BUILD_DIR); \ + $(YASM_CONFIGURE) \ + ); +endef + +define Host/Compile + +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all +endef + +define Host/Install + $(MAKE) -C $(HOST_BUILD_DIR) \ + prefix=$(TOOLCHAIN_DIR) \ + install +endef + +define Host/Clean + rm -rf \ + $(HOST_BUILD_DIR) \ + $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) +endef + +$(eval $(call HostBuild)) diff --git a/toolchain/Config.in b/toolchain/Config.in index f6753ad8b..bf7b9c33d 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -168,7 +168,6 @@ menuconfig EXTRA_TARGET_ARCH bool prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS depends on !sparc - default y if powerpc64 default n help Some builds may require a 'biarch' toolchain. This option @@ -178,7 +177,6 @@ menuconfig EXTRA_TARGET_ARCH config EXTRA_TARGET_ARCH_NAME string - default "powerpc64" if powerpc64 prompt "Extra architecture name" if EXTRA_TARGET_ARCH help Specify the cpu name (eg powerpc64 or x86_64) of the @@ -186,7 +184,6 @@ menuconfig EXTRA_TARGET_ARCH config EXTRA_TARGET_ARCH_OPTS string - default "-m64" if powerpc64 prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH help If you're specifying an addition target architecture, @@ -241,6 +238,7 @@ comment "C Library" choice prompt "C Library implementation" if TOOLCHAINOPTS default LIBC_USE_UCLIBC if arc + default LIBC_USE_GLIBC if powerpc64 default LIBC_USE_MUSL help Select the C library implementation. @@ -253,13 +251,13 @@ choice config LIBC_USE_UCLIBC select USE_UCLIBC bool "Use uClibc" - depends on !(aarch64 || aarch64_be) + depends on !(aarch64 || aarch64_be || powerpc64) depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) config LIBC_USE_MUSL select USE_MUSL bool "Use musl" - depends on !(arc) + depends on !(arc || powerpc64) endchoice @@ -277,6 +275,7 @@ config GDB Enable if you want to build the gdb. config USE_GLIBC + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (powerpc64) bool config USE_UCLIBC @@ -284,7 +283,7 @@ config USE_UCLIBC bool config USE_MUSL - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) + default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc || powerpc64) bool config USE_EXTERNAL_LIBC diff --git a/toolchain/binutils/Config.in b/toolchain/binutils/Config.in index 8fe33fb6b..25f721a6b 100644 --- a/toolchain/binutils/Config.in +++ b/toolchain/binutils/Config.in @@ -22,6 +22,11 @@ choice bool "ARC binutils 2.28" select BINUTILS_VERSION_2_28_ARC + config BINUTILS_USE_VERSION_2_29_1 + depends on !arc + bool "Binutils 2.29.1" + select BINUTILS_VERSION_2_29_1 + endchoice config EXTRA_BINUTILS_CONFIG_OPTIONS diff --git a/toolchain/binutils/Config.version b/toolchain/binutils/Config.version index 1b223e410..54df1730c 100644 --- a/toolchain/binutils/Config.version +++ b/toolchain/binutils/Config.version @@ -9,8 +9,12 @@ config BINUTILS_VERSION_2_28_ARC default y if (!TOOLCHAINOPTS && arc) bool +config BINUTILS_VERSION_2_29_1 + bool + config BINUTILS_VERSION string default "2.27" if BINUTILS_VERSION_2_27 default "2.28" if BINUTILS_VERSION_2_28 + default "2.29.1" if BINUTILS_VERSION_2_29_1 default "arc-2017.03" if BINUTILS_VERSION_2_28_ARC diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 6df11fbd3..fd4af5c25 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -21,6 +21,10 @@ ifeq ($(PKG_VERSION),2.28) PKG_HASH:=6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 endif +ifeq ($(PKG_VERSION),2.29.1) + PKG_HASH:=1509dff41369fb70aed23682351b663b56db894034773e6dbf7d5d6071fc55cc +endif + ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),) PKG_REV:=arc-2017.03-release PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/ diff --git a/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch b/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch new file mode 100644 index 000000000..4365197f7 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/300-001_ld_makefile_patch.patch @@ -0,0 +1,22 @@ +--- a/ld/Makefile.am ++++ b/ld/Makefile.am +@@ -57,7 +57,7 @@ endif + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + + EMUL = @EMUL@ + EMULATION_OFILES = @EMULATION_OFILES@ +--- a/ld/Makefile.in ++++ b/ld/Makefile.in +@@ -446,7 +446,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) + # We put the scripts in the directory $(scriptdir)/ldscripts. + # We can't put the scripts in $(datadir) because the SEARCH_DIR + # directives need to be different for native and cross linkers. +-scriptdir = $(tooldir)/lib ++scriptdir = $(libdir) + BASEDIR = $(srcdir)/.. + BFDDIR = $(BASEDIR)/bfd + INCDIR = $(BASEDIR)/include diff --git a/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch b/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch new file mode 100644 index 000000000..0b02c5597 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/300-012_check_ldrunpath_length.patch @@ -0,0 +1,20 @@ +--- a/ld/emultempl/elf32.em ++++ b/ld/emultempl/elf32.em +@@ -1463,6 +1463,8 @@ fragment <link.next) + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch b/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch new file mode 100644 index 000000000..a28e9348a --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/400-mips_no_dynamic_linking_sym.patch @@ -0,0 +1,18 @@ +--- a/bfd/elfxx-mips.c ++++ b/bfd/elfxx-mips.c +@@ -7871,6 +7871,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; + bh = NULL; ++ if (0) { + if (!(_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, + NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) +@@ -7883,6 +7884,7 @@ _bfd_mips_elf_create_dynamic_sections (b + + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; ++ } + + if (! mips_elf_hash_table (info)->use_rld_obj_head) + { diff --git a/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch b/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch new file mode 100644 index 000000000..53d5b5ac5 --- /dev/null +++ b/toolchain/binutils/patches/2.29.1/500-Change-default-emulation-for-mips64-linux.patch @@ -0,0 +1,37 @@ +--- a/bfd/config.bfd ++++ b/bfd/config.bfd +@@ -1186,12 +1186,12 @@ case "${targ}" in + targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" + ;; + mips64*el-*-linux*) +- targ_defvec=mips_elf32_ntrad_le_vec +- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" ++ targ_defvec=mips_elf64_trad_le_vec ++ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" + ;; + mips64*-*-linux*) +- targ_defvec=mips_elf32_ntrad_be_vec +- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" ++ targ_defvec=mips_elf64_trad_be_vec ++ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" + ;; + mips*el-*-linux*) + targ_defvec=mips_elf32_trad_le_vec +--- a/ld/configure.tgt ++++ b/ld/configure.tgt +@@ -530,11 +530,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip + mips*-*-vxworks*) targ_emul=elf32ebmipvxworks + targ_extra_emuls="elf32elmipvxworks" ;; + mips*-*-windiss) targ_emul=elf32mipswindiss ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip + targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain/fortify-headers/Makefile b/toolchain/fortify-headers/Makefile index 8caf8c84c..8550a999c 100644 --- a/toolchain/fortify-headers/Makefile +++ b/toolchain/fortify-headers/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=fortify-headers -PKG_VERSION:=0.8 +PKG_VERSION:=0.9 PKG_RELEASE=1 PKG_SOURCE_URL:=http://dl.2f30.org/releases PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=afcd073d6d8d175eede2a28a7dd71b7150cb03290f99102261892c793f6b4cb1 +PKG_HASH:=cf75f1c27a95da8ebf124293e8dc534ff6a4625d703ff169998292e1a53aa1fc include $(INCLUDE_DIR)/toolchain-build.mk diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in index ea33ac29c..a54c8d12d 100644 --- a/toolchain/gcc/Config.in +++ b/toolchain/gcc/Config.in @@ -54,14 +54,6 @@ config SJLJ_EXCEPTIONS frame unwinding exceptions handling routines. Warning: increases code size and runtime memory usage. -config INSTALL_LIBGCJ - bool - prompt "Build/install java compiler and GNU classpath ?" if TOOLCHAINOPTS - default n - help - Build/install java compiler and GNU classpath ? - - config INSTALL_GFORTRAN bool prompt "Build/install fortran compiler?" if TOOLCHAINOPTS diff --git a/toolchain/gcc/Config.version b/toolchain/gcc/Config.version index 86c723dc9..4edf8a87a 100644 --- a/toolchain/gcc/Config.version +++ b/toolchain/gcc/Config.version @@ -6,8 +6,8 @@ config GCC_VERSION string default "arc-2017.03-release" if GCC_VERSION_6_3_ARC default "6.3.0" if GCC_USE_VERSION_6 - default "7.1.0" if GCC_USE_VERSION_7 - default "5.4.0" + default "7.2.0" if GCC_USE_VERSION_7 + default "5.5.0" config GCC_VERSION_6_3 bool diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index abf69bfdc..69214aca0 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -26,18 +26,19 @@ PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION))) GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -ifeq ($(PKG_VERSION),5.4.0) - PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a +ifeq ($(PKG_VERSION),5.5.0) + PKG_HASH:=530cea139d82fe542b358961130c69cfde8b3d14556370b65823d2f91f0ced87 endif ifeq ($(PKG_VERSION),6.3.0) PKG_HASH:=f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f + PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 endif -ifeq ($(PKG_VERSION),7.1.0) - PKG_HASH:=8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 +ifeq ($(PKG_VERSION),7.2.0) + PKG_HASH:=1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a endif ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),) @@ -73,14 +74,11 @@ HOST_STAMP_CONFIGURED:=$(GCC_BUILD_DIR)/.configured HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.gcc_$(GCC_VARIANT)_installed SEP:=, -TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" +TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" TAR_OPTIONS += \ --exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ - -ifndef CONFIG_INSTALL_LIBGCJ - TAR_OPTIONS += --exclude=libjava -endif + --exclude=libjava export libgcc_cv_fixed_point=no ifdef CONFIG_USE_UCLIBC diff --git a/toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch b/toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch new file mode 100644 index 000000000..06373eb6a --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/001-revert_register_mode_search.patch @@ -0,0 +1,65 @@ +Revert of: + +commit 275035b56823b26d5fb7e90fad945b998648edf2 +Author: bergner +Date: Thu Sep 5 14:09:07 2013 +0000 + + PR target/58139 + * reginfo.c (choose_hard_reg_mode): Scan through all mode classes + looking for widest mode. + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 + + +--- a/gcc/reginfo.c ++++ b/gcc/reginfo.c +@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + + if (found_mode != VOIDmode) diff --git a/toolchain/gcc/patches/5.5.0/002-case_insensitive.patch b/toolchain/gcc/patches/5.5.0/002-case_insensitive.patch new file mode 100644 index 000000000..b3d2dbe29 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/002-case_insensitive.patch @@ -0,0 +1,14 @@ +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -43,11 +43,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain/gcc/patches/5.5.0/010-documentation.patch b/toolchain/gcc/patches/5.5.0/010-documentation.patch new file mode 100644 index 000000000..d7166b24e --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/010-documentation.patch @@ -0,0 +1,23 @@ +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -2943,18 +2943,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch b/toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch new file mode 100644 index 000000000..b9702c952 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/020-no-plt-backport.patch @@ -0,0 +1,28 @@ +--- a/gcc/calls.c ++++ b/gcc/calls.c +@@ -225,6 +225,12 @@ prepare_call_address (tree fndecl_or_typ + && targetm.small_register_classes_for_mode_p (FUNCTION_MODE)) + ? force_not_mem (memory_address (FUNCTION_MODE, funexp)) + : memory_address (FUNCTION_MODE, funexp)); ++ else if (flag_pic && !flag_plt && fndecl_or_type ++ && TREE_CODE (fndecl_or_type) == FUNCTION_DECL ++ && !targetm.binds_local_p (fndecl_or_type)) ++ { ++ funexp = force_reg (Pmode, funexp); ++ } + else if (! sibcallp) + { + #ifndef NO_FUNCTION_CSE +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -1779,6 +1779,10 @@ fpie + Common Report Var(flag_pie,1) Negative(fPIC) + Generate position-independent code for executables if possible (small mode) + ++fplt ++Common Report Var(flag_plt) Init(1) ++Use PLT for PIC calls (-fno-plt: load the address from GOT at call site) ++ + fplugin= + Common Joined RejectNegative Var(common_deferred_options) Defer + Specify a plugin to load diff --git a/toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch b/toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch new file mode 100644 index 000000000..e88af3403 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/040-fix-mips-ICE-PR-68400.patch @@ -0,0 +1,23 @@ +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -8001,9 +8001,17 @@ mask_low_and_shift_p (machine_mode mode, + bool + and_operands_ok (machine_mode mode, rtx op1, rtx op2) + { +- return (memory_operand (op1, mode) +- ? and_load_operand (op2, mode) +- : and_reg_operand (op2, mode)); ++ if (!memory_operand (op1, mode)) ++ return and_reg_operand (op2, mode); ++ ++ if (!and_load_operand (op2, mode)) ++ return false; ++ ++ if (!TARGET_MIPS16 || si_mask_operand(op2, mode)) ++ return true; ++ ++ op1 = XEXP (op1, 0); ++ return !(REG_P (op1) && REGNO (op1) == STACK_POINTER_REGNUM); + } + + /* The canonical form of a mask-low-and-shift-left operation is diff --git a/toolchain/gcc/patches/5.5.0/200-musl_config.patch b/toolchain/gcc/patches/5.5.0/200-musl_config.patch new file mode 100644 index 000000000..178c25ce3 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/200-musl_config.patch @@ -0,0 +1,309 @@ +From: ktkachov +Date: Fri, 8 May 2015 08:25:47 +0000 (+0000) +Subject: [PATCH 2/13] musl libc config +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb + +[PATCH 2/13] musl libc config + +2015-05-08 Gregor Richards + Szabolcs Nagy + + * config.gcc (LIBC_MUSL): New tm_defines macro. + * config/linux.h (OPTION_MUSL): Define. + (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,) + (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,) + (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) + (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) + (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. + * config/linux.opt (mmusl): New option. + * doc/invoke.texi (GNU/Linux Options): Document -mmusl. + * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*. + (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*. + * configure: Regenerate. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -575,7 +575,7 @@ case ${target} in + esac + + # Common C libraries. +-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" ++tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" + + # 32-bit x86 processors supported by --with-arch=. Each processor + # MUST be separated by exactly one space. +@@ -720,6 +720,9 @@ case ${target} in + *-*-*uclibc*) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" + ;; ++ *-*-*musl*) ++ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" ++ ;; + *) + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" + ;; +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ +@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTI + } while (0) + + /* Determine which dynamic linker to use depending on whether GLIBC or +- uClibc or Bionic is the default C library and whether +- -muclibc or -mglibc or -mbionic has been passed to change the default. */ ++ uClibc or Bionic or musl is the default C library and whether ++ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change ++ the default. */ + +-#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ +- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" ++#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ ++ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" + + #if DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) + #elif DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) + #elif DEFAULT_LIBC == LIBC_BIONIC +-#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ +- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ ++ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) + #else + #error "Unsupported DEFAULT_LIBC" + #endif /* DEFAULT_LIBC */ +@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTI + #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" + #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" + #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" ++/* Should be redefined for each target that supports musl. */ ++#define MUSL_DYNAMIC_LINKER "/dev/null" ++#define MUSL_DYNAMIC_LINKER32 "/dev/null" ++#define MUSL_DYNAMIC_LINKER64 "/dev/null" ++#define MUSL_DYNAMIC_LINKERX32 "/dev/null" + + #define GNU_USER_DYNAMIC_LINKER \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ +- BIONIC_DYNAMIC_LINKER) ++ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + #define GNU_USER_DYNAMIC_LINKER32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ +- BIONIC_DYNAMIC_LINKER32) ++ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ +- BIONIC_DYNAMIC_LINKER64) ++ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + #define GNU_USER_DYNAMIC_LINKERX32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ +- BIONIC_DYNAMIC_LINKERX32) ++ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) + + /* Whether we have Bionic libc runtime */ + #undef TARGET_HAS_BIONIC + #define TARGET_HAS_BIONIC (OPTION_BIONIC) + ++/* musl avoids problematic includes by rearranging the include directories. ++ * Unfortunately, this is mostly duplicated from cppdefault.c */ ++#if DEFAULT_LIBC == LIBC_MUSL ++#define INCLUDE_DEFAULTS_MUSL_GPP \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, ++ ++#ifdef LOCAL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_LOCAL \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_LOCAL ++#endif ++ ++#ifdef PREFIX_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_PREFIX ++#endif ++ ++#ifdef CROSS_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_CROSS \ ++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#ifdef TOOL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_TOOL \ ++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_TOOL ++#endif ++ ++#ifdef NATIVE_SYSTEM_HEADER_DIR ++#define INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_NATIVE ++#endif ++ ++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) ++# undef INCLUDE_DEFAULTS_MUSL_LOCAL ++# define INCLUDE_DEFAULTS_MUSL_LOCAL ++# undef INCLUDE_DEFAULTS_MUSL_NATIVE ++# define INCLUDE_DEFAULTS_MUSL_NATIVE ++#else ++# undef INCLUDE_DEFAULTS_MUSL_CROSS ++# define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#undef INCLUDE_DEFAULTS ++#define INCLUDE_DEFAULTS \ ++ { \ ++ INCLUDE_DEFAULTS_MUSL_GPP \ ++ INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ INCLUDE_DEFAULTS_MUSL_CROSS \ ++ INCLUDE_DEFAULTS_MUSL_TOOL \ ++ INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++ } ++#endif ++ + #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ + /* This is a *uclinux* target. We don't define below macros to normal linux + versions, because doing so would require *uclinux* targets to include +--- a/gcc/config/linux.opt ++++ b/gcc/config/linux.opt +@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_l + Use GNU C library + + muclibc +-Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) ++Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl) + Use uClibc C library ++ ++mmusl ++Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic) ++Use musl C library +--- a/gcc/configure ++++ b/gcc/configure +@@ -27833,6 +27833,9 @@ if test "${gcc_cv_libc_provides_ssp+set} + else + gcc_cv_libc_provides_ssp=no + case "$target" in ++ *-*-musl*) ++ # All versions of musl provide stack protector ++ gcc_cv_libc_provides_ssp=yes;; + *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) + # glibc 2.4 and later provides __stack_chk_fail and + # either __stack_chk_guard, or TLS access to stack guard canary. +@@ -27865,6 +27868,7 @@ fi + # ) and for now + # simply assert that glibc does provide this, which is true for all + # realistically usable GNU/Hurd configurations. ++ # All supported versions of musl provide it as well + gcc_cv_libc_provides_ssp=yes;; + *-*-darwin* | *-*-freebsd*) + ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" +@@ -27961,6 +27965,9 @@ case "$target" in + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -5287,6 +5287,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe + gcc_cv_libc_provides_ssp, + [gcc_cv_libc_provides_ssp=no + case "$target" in ++ *-*-musl*) ++ # All versions of musl provide stack protector ++ gcc_cv_libc_provides_ssp=yes;; + *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) + # glibc 2.4 and later provides __stack_chk_fail and + # either __stack_chk_guard, or TLS access to stack guard canary. +@@ -5313,6 +5316,7 @@ AC_CACHE_CHECK(__stack_chk_fail in targe + # ) and for now + # simply assert that glibc does provide this, which is true for all + # realistically usable GNU/Hurd configurations. ++ # All supported versions of musl provide it as well + gcc_cv_libc_provides_ssp=yes;; + *-*-darwin* | *-*-freebsd*) + AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], +@@ -5386,6 +5390,9 @@ case "$target" in + gcc_cv_target_dl_iterate_phdr=no + fi + ;; ++ *-linux-musl*) ++ gcc_cv_target_dl_iterate_phdr=yes ++ ;; + esac + GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) + if test x$gcc_cv_target_dl_iterate_phdr = xyes; then +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -668,7 +668,7 @@ Objective-C and Objective-C++ Dialects}. + -mcpu=@var{cpu}} + + @emph{GNU/Linux Options} +-@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol ++@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol + -tno-android-cc -tno-android-ld} + + @emph{H8/300 Options} +@@ -15351,13 +15351,19 @@ These @samp{-m} options are defined for + @item -mglibc + @opindex mglibc + Use the GNU C library. This is the default except +-on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets. ++on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and ++@samp{*-*-linux-*android*} targets. + + @item -muclibc + @opindex muclibc + Use uClibc C library. This is the default on + @samp{*-*-linux-*uclibc*} targets. + ++@item -mmusl ++@opindex mmusl ++Use the musl C library. This is the default on ++@samp{*-*-linux-*musl*} targets. ++ + @item -mbionic + @opindex mbionic + Use Bionic C library. This is the default on diff --git a/toolchain/gcc/patches/5.5.0/201-musl_arm.patch b/toolchain/gcc/patches/5.5.0/201-musl_arm.patch new file mode 100644 index 000000000..27a26afc0 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/201-musl_arm.patch @@ -0,0 +1,43 @@ +From: ktkachov +Date: Wed, 27 May 2015 13:17:11 +0000 (+0000) +Subject: [PATCH 4/13] arm musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4 + +[PATCH 4/13] arm musl support + +On behalf of szabolcs.nagy@arm.com + +2015-05-27 Gregor Richards + + * config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -77,6 +77,23 @@ + %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ + %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" + ++/* For ARM musl currently supports four dynamic linkers: ++ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI ++ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI ++ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB ++ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB ++ musl does not support the legacy OABI mode. ++ All the dynamic linkers live in /lib. ++ We default to soft-float, EL. */ ++#undef MUSL_DYNAMIC_LINKER ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" ++#else ++#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" ++#endif ++#define MUSL_DYNAMIC_LINKER \ ++ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC diff --git a/toolchain/gcc/patches/5.5.0/202-musl_mips.patch b/toolchain/gcc/patches/5.5.0/202-musl_mips.patch new file mode 100644 index 000000000..816dd8d10 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/202-musl_mips.patch @@ -0,0 +1,35 @@ +From: ktkachov +Date: Fri, 8 May 2015 15:16:50 +0000 (+0000) +Subject: [PATCH 6/13] mips musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8 + +[PATCH 6/13] mips musl support + +2015-05-08 Gregor Richards + Szabolcs Nagy + + * config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define. + (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define. + (GNU_USER_DYNAMIC_LINKERN32): Update. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config/mips/linux.h ++++ b/gcc/config/mips/linux.h +@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3. + #define UCLIBC_DYNAMIC_LINKERN32 \ + "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" + ++#undef MUSL_DYNAMIC_LINKER32 ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1" ++#undef MUSL_DYNAMIC_LINKER64 ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1" ++#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1" ++ + #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" + #define GNU_USER_DYNAMIC_LINKERN32 \ + CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ +- BIONIC_DYNAMIC_LINKERN32) ++ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) diff --git a/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch b/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch new file mode 100644 index 000000000..073c834ce --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/203-musl_powerpc.patch @@ -0,0 +1,209 @@ + +gcc/Changelog: + +2015-04-24 Gregor Richards + Szabolcs Nagy + + * config.gcc (secure_plt): Add *-linux*-musl*. + * config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define. + (MUSL_DYNAMIC_LINKER64): Define. + (GNU_USER_DYNAMIC_LINKER32): Update. + (GNU_USER_DYNAMIC_LINKER64): Update. + (CHOOSE_DYNAMIC_LINKER): Update. + + * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. + * config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update. + (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,) + (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) + (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) + (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. + (LINK_SECURE_PLT_DEFAULT_SPEC): Define. + (CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update. + + * config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define. + +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -365,17 +365,21 @@ extern int dot_symbols; + #endif + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER32 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) + #define GNU_USER_DYNAMIC_LINKER64 \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) + + #undef DEFAULT_ASM_ENDIAN + #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) +--- a/gcc/config/rs6000/secureplt.h ++++ b/gcc/config/rs6000/secureplt.h +@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. + . */ + + #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" ++#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF + #ifndef CC1_SECURE_PLT_DEFAULT_SPEC + #define CC1_SECURE_PLT_DEFAULT_SPEC "" + #endif ++#ifndef LINK_SECURE_PLT_DEFAULT_SPEC ++#define LINK_SECURE_PLT_DEFAULT_SPEC "" ++#endif + + /* Pass -G xxx to the compiler. */ + #undef CC1_SPEC +@@ -574,7 +577,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF + %{R*} \ + %(link_shlib) \ + %{!T*: %(link_start) } \ +-%(link_os)" ++%(link_os)" \ ++"%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" + + /* Shared libraries are not default. */ + #define LINK_SHLIB_SPEC "\ +@@ -757,17 +761,22 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF + + #define LINK_START_LINUX_SPEC "" + ++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") ++ + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" ++#elif DEFAULT_LIBC == LIBC_MUSL ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" + #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC +-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" ++#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" + #else + #error "Unsupported DEFAULT_LIBC" + #endif + #define GNU_USER_DYNAMIC_LINKER \ +- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) ++ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) + + #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ +@@ -889,6 +898,7 @@ ncrtn.o%s" + { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ + { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ + { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ ++ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ + { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ + { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ + { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ +@@ -943,3 +953,72 @@ ncrtn.o%s" + /* This target uses the sysv4.opt file. */ + #define TARGET_USES_SYSV4_OPT 1 + ++/* Include order changes for musl, same as in generic linux.h. */ ++#if DEFAULT_LIBC == LIBC_MUSL ++#define INCLUDE_DEFAULTS_MUSL_GPP \ ++ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ ++ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ ++ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ ++ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, ++ ++#ifdef LOCAL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_LOCAL \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ ++ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_LOCAL ++#endif ++ ++#ifdef PREFIX_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_PREFIX ++#endif ++ ++#ifdef CROSS_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_CROSS \ ++ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#ifdef TOOL_INCLUDE_DIR ++#define INCLUDE_DEFAULTS_MUSL_TOOL \ ++ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, ++#else ++#define INCLUDE_DEFAULTS_MUSL_TOOL ++#endif ++ ++#ifdef NATIVE_SYSTEM_HEADER_DIR ++#define INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ ++ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, ++#else ++#define INCLUDE_DEFAULTS_MUSL_NATIVE ++#endif ++ ++#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) ++# undef INCLUDE_DEFAULTS_MUSL_LOCAL ++# define INCLUDE_DEFAULTS_MUSL_LOCAL ++# undef INCLUDE_DEFAULTS_MUSL_NATIVE ++# define INCLUDE_DEFAULTS_MUSL_NATIVE ++#else ++# undef INCLUDE_DEFAULTS_MUSL_CROSS ++# define INCLUDE_DEFAULTS_MUSL_CROSS ++#endif ++ ++#undef INCLUDE_DEFAULTS ++#define INCLUDE_DEFAULTS \ ++ { \ ++ INCLUDE_DEFAULTS_MUSL_GPP \ ++ INCLUDE_DEFAULTS_MUSL_PREFIX \ ++ INCLUDE_DEFAULTS_MUSL_CROSS \ ++ INCLUDE_DEFAULTS_MUSL_TOOL \ ++ INCLUDE_DEFAULTS_MUSL_NATIVE \ ++ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ ++ { 0, 0, 0, 0, 0, 0 } \ ++ } ++#endif +--- a/gcc/config/rs6000/sysv4le.h ++++ b/gcc/config/rs6000/sysv4le.h +@@ -31,3 +31,5 @@ + /* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */ + #define LINUX64_DEFAULT_ABI_ELFv2 + ++#undef MUSL_DYNAMIC_LINKER_E ++#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le") +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -2430,6 +2430,10 @@ powerpc*-*-linux*) + powerpc*-*-linux*paired*) + tm_file="${tm_file} rs6000/750cl.h" ;; + esac ++ case ${target} in ++ *-linux*-musl*) ++ enable_secureplt=yes ;; ++ esac + if test x${enable_secureplt} = xyes; then + tm_file="rs6000/secureplt.h ${tm_file}" + fi diff --git a/toolchain/gcc/patches/5.5.0/204-musl_sh.patch b/toolchain/gcc/patches/5.5.0/204-musl_sh.patch new file mode 100644 index 000000000..8c3753d53 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/204-musl_sh.patch @@ -0,0 +1,39 @@ +gcc/Changelog: + +2015-04-27 Gregor Richards + Szabolcs Nagy + + * config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define. + (MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define. + +--- a/gcc/config/sh/linux.h ++++ b/gcc/config/sh/linux.h +@@ -43,6 +43,28 @@ along with GCC; see the file COPYING3. + + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack + ++#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN ++#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}" ++#else ++#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}" ++#endif ++ ++#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 ) ++/* "-nofpu" if any nofpu option is specified */ ++#define MUSL_DYNAMIC_LINKER_FP \ ++ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \ ++ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \ ++ "m5-compact-nofpu:-nofpu}" ++#else ++/* "-nofpu" if none of the hard fpu options are specified */ ++#define MUSL_DYNAMIC_LINKER_FP \ ++ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}" ++#endif ++ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER \ ++ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1" ++ + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #undef SUBTARGET_LINK_EMUL_SUFFIX diff --git a/toolchain/gcc/patches/5.5.0/205-musl_x86.patch b/toolchain/gcc/patches/5.5.0/205-musl_x86.patch new file mode 100644 index 000000000..8772328d6 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/205-musl_x86.patch @@ -0,0 +1,41 @@ +From: ktkachov +Date: Fri, 15 May 2015 13:20:01 +0000 (+0000) +Subject: [PATCH 9/13] x86 musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c + +[PATCH 9/13] x86 musl support + +On behalf of Szabolcs Nagy. + +2015-05-15 Gregor Richards + + * config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define. + * config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define. + (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config/i386/linux.h ++++ b/gcc/config/i386/linux.h +@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. + + #define GNU_USER_LINK_EMULATION "elf_i386" + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" ++ ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" +--- a/gcc/config/i386/linux64.h ++++ b/gcc/config/i386/linux64.h +@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTI + #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" + #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" + #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" ++ ++#undef MUSL_DYNAMIC_LINKER32 ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" ++#undef MUSL_DYNAMIC_LINKER64 ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" ++#undef MUSL_DYNAMIC_LINKERX32 ++#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" diff --git a/toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch b/toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch new file mode 100644 index 000000000..6925a026e --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/206-musl_aarch64.patch @@ -0,0 +1,31 @@ +From: jgreenhalgh +Date: Wed, 27 May 2015 16:46:39 +0000 (+0000) +Subject: [PATCH 3/13] aarch64 musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78 + +[PATCH 3/13] aarch64 musl support + +gcc/Changelog: + +2015-05-27 Gregor Richards + Szabolcs Nagy + + * config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config/aarch64/aarch64-linux.h ++++ b/gcc/config/aarch64/aarch64-linux.h +@@ -23,6 +23,9 @@ + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" ++ + #undef ASAN_CC1_SPEC + #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" + diff --git a/toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch b/toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch new file mode 100644 index 000000000..0ff33d39d --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/207-musl_fixincludes.patch @@ -0,0 +1,30 @@ +From: ktkachov +Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000) +Subject: fixincludes update for musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d + +fixincludes update for musl support + +On behalf of Szabolcs.Nagy@arm.com + +2015-04-22 Gregor Richards + + * mkfixinc.sh: Add *-musl* with no fixes. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/fixincludes/mkfixinc.sh ++++ b/fixincludes/mkfixinc.sh +@@ -19,7 +19,8 @@ case $machine in + powerpc-*-eabi* | \ + powerpc-*-rtems* | \ + powerpcle-*-eabisim* | \ +- powerpcle-*-eabi* ) ++ powerpcle-*-eabi* | \ ++ *-musl* ) + # IF there is no include fixing, + # THEN create a no-op fixer and exit + (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} diff --git a/toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch b/toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch new file mode 100644 index 000000000..d2414d023 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/209-musl_libstdc++.patch @@ -0,0 +1,72 @@ +From: ktkachov +Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000) +Subject: libstdc++, libgfortran gthr workaround for musl +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61 + +libstdc++, libgfortran gthr workaround for musl + +On behalf of szabolcs.nagy@arm.com + +[libstdc++-v3/] +2015-04-22 Szabolcs Nagy + + * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define. + * configure.host (os_include_dir): Set to "os/generic" for linux-musl*. + +[libgfortran/] +2015-04-22 Szabolcs Nagy + + * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*. + * configure: Regenerate. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/libgfortran/acinclude.m4 ++++ b/libgfortran/acinclude.m4 +@@ -100,7 +100,7 @@ void foo (void); + [Define to 1 if the target supports #pragma weak]) + fi + case "$host" in +- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) ++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) + AC_DEFINE(GTHREAD_USE_WEAK, 0, + [Define to 0 if the target shouldn't use #pragma weak]) + ;; +--- a/libgfortran/configure ++++ b/libgfortran/configure +@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con + + fi + case "$host" in +- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) ++ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) + + $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h + +--- a/libstdc++-v3/config/os/generic/os_defines.h ++++ b/libstdc++-v3/config/os/generic/os_defines.h +@@ -33,4 +33,9 @@ + // System-specific #define, typedefs, corrections, etc, go here. This + // file will come before all others. + ++// Disable the weak reference logic in gthr.h for os/generic because it ++// is broken on every platform unless there is implementation specific ++// workaround in gthr-posix.h and at link-time for static linking. ++#define _GLIBCXX_GTHREAD_USE_WEAK 0 ++ + #endif +--- a/libstdc++-v3/configure.host ++++ b/libstdc++-v3/configure.host +@@ -273,6 +273,9 @@ case "${host_os}" in + freebsd*) + os_include_dir="os/bsd/freebsd" + ;; ++ linux-musl*) ++ os_include_dir="os/generic" ++ ;; + gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) + if [ "$uclibc" = "yes" ]; then + os_include_dir="os/uclibc" diff --git a/toolchain/gcc/patches/5.5.0/230-musl_libssp.patch b/toolchain/gcc/patches/5.5.0/230-musl_libssp.patch new file mode 100644 index 000000000..30f42e9f7 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/230-musl_libssp.patch @@ -0,0 +1,13 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -727,7 +727,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch b/toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch new file mode 100644 index 000000000..533cb6849 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/240-musl-libitm-fixes.patch @@ -0,0 +1,61 @@ +From: ktkachov +Date: Wed, 22 Apr 2015 14:11:25 +0000 (+0000) +Subject: libitm fixes for musl support +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e53a4d49c3d03ab8eaddb073cf972c1c46d75338 + +libitm fixes for musl support + +On behalf of Szabolcs.Nagy@arm.com + +2015-04-22 Gregor Richards + + * config/arm/hwcap.cc: Use fcntl.h instead of sys/fcntl.h. + * config/linux/x86/tls.h: Only use __GLIBC_PREREQ if defined. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/libitm/config/arm/hwcap.cc ++++ b/libitm/config/arm/hwcap.cc +@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0 + + #ifdef __linux__ + #include +-#include ++#include + #include + + static void __attribute__((constructor)) +--- a/libitm/config/linux/x86/tls.h ++++ b/libitm/config/linux/x86/tls.h +@@ -25,16 +25,19 @@ + #ifndef LIBITM_X86_TLS_H + #define LIBITM_X86_TLS_H 1 + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + /* Use slots in the TCB head rather than __thread lookups. + GLIBC has reserved words 10 through 13 for TM. */ + #define HAVE_ARCH_GTM_THREAD 1 + #define HAVE_ARCH_GTM_THREAD_DISP 1 + #endif ++#endif + + #include "config/generic/tls.h" + +-#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) ++#if defined(__GLIBC_PREREQ) ++#if __GLIBC_PREREQ(2, 10) + namespace GTM HIDDEN { + + #ifdef __x86_64__ +@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a + + } // namespace GTM + #endif /* >= GLIBC 2.10 */ ++#endif + + #endif // LIBITM_X86_TLS_H diff --git a/toolchain/gcc/patches/5.5.0/250-add-musl.patch b/toolchain/gcc/patches/5.5.0/250-add-musl.patch new file mode 100644 index 000000000..8cbeddea3 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/250-add-musl.patch @@ -0,0 +1,120 @@ +From: ktkachov +Date: Fri, 8 May 2015 08:30:40 +0000 (+0000) +Subject: [PATCH 0/13] Add musl support to GCC +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e + +[PATCH 0/13] Add musl support to GCC + +2015-05-08 Szabolcs Nagy + + * config/glibc-stdint.h (OPTION_MUSL): Define. + (INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE): + Change the definition based on OPTION_MUSL for 64 bit targets. + * config/linux.h (OPTION_MUSL): Redefine. + * config/alpha/linux.h (OPTION_MUSL): Redefine. + * config/rs6000/linux.h (OPTION_MUSL): Redefine. + * config/rs6000/linux64.h (OPTION_MUSL): Redefine. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/gcc/config/alpha/linux.h ++++ b/gcc/config/alpha/linux.h +@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + /* Determine what functions are present at the runtime; +--- a/gcc/config/glibc-stdint.h ++++ b/gcc/config/glibc-stdint.h +@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* Systems using musl libc should use this header and make sure ++ OPTION_MUSL is defined correctly before using the TYPE macros. */ ++#ifndef OPTION_MUSL ++#define OPTION_MUSL 0 ++#endif ++ + #define SIG_ATOMIC_TYPE "int" + + #define INT8_TYPE "signed char" +@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTI + #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") + + #define INT_FAST8_TYPE "signed char" +-#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") +-#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") ++#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") ++#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") + #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") + #define UINT_FAST8_TYPE "unsigned char" +-#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") +-#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") ++#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") ++#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") + #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") + + #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -32,11 +32,13 @@ see the files COPYING3 and COPYING.RUNTI + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#undef OPTION_MUSL + #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#undef OPTION_MUSL + #define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -30,10 +30,14 @@ + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + /* Determine what functions are present at the runtime; +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -299,10 +299,14 @@ extern int dot_symbols; + #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) + #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) + #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) + #else + #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) + #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) + #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) ++#undef OPTION_MUSL ++#define OPTION_MUSL (linux_libc == LIBC_MUSL) + #endif + + /* Determine what functions are present at the runtime; diff --git a/toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch b/toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch new file mode 100644 index 000000000..a3b83e207 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/260-musl-add-unwind-fix.patch @@ -0,0 +1,34 @@ +From: ktkachov +Date: Wed, 22 Apr 2015 14:20:01 +0000 (+0000) +Subject: unwind fix for musl +X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a2e31d0681d8a47389b8a3552622fbd9827bcef4 + +unwind fix for musl + +On behalf of szabolcs.nagy@arm.com + +2015-04-22 Gregor Richards + Szabolcs Nagy + + * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on + Linux if target provides dl_iterate_phdr. + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + +--- a/libgcc/unwind-dw2-fde-dip.c ++++ b/libgcc/unwind-dw2-fde-dip.c +@@ -59,6 +59,12 @@ + + #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ ++ && defined(__linux__) ++# define USE_PT_GNU_EH_FRAME ++#endif ++ ++#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ ++ && defined(TARGET_DL_ITERATE_PHDR) \ + && (defined(__DragonFly__) || defined(__FreeBSD__)) + # define ElfW __ElfN + # define USE_PT_GNU_EH_FRAME diff --git a/toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch b/toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch new file mode 100644 index 000000000..bdebf6c01 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/270-musl-add-powerpc-softfloat-fix.patch @@ -0,0 +1,24 @@ +--- a/gcc/config/rs6000/linux64.h ++++ b/gcc/config/rs6000/linux64.h +@@ -369,8 +369,8 @@ extern int dot_symbols; + #endif + #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" + #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" +-#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" +-#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" ++#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" ++#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_GLIBC +--- a/gcc/config/rs6000/sysv4.h ++++ b/gcc/config/rs6000/sysv4.h +@@ -765,7 +765,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" +-#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" + #if DEFAULT_LIBC == LIBC_UCLIBC + #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" + #elif DEFAULT_LIBC == LIBC_MUSL diff --git a/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch b/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch new file mode 100644 index 000000000..9a043eed3 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/280-musl-disable-ifunc-by-default.patch @@ -0,0 +1,36 @@ +From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 +From: nsz +Date: Tue, 30 Aug 2016 10:26:22 +0000 +Subject: [PATCH] disable ifunc on *-musl by default + +gcc/ + * config.gcc (*-*-*musl*): Disable gnu-indirect-function. + + + +git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 +--- + gcc/ChangeLog | 4 ++++ + gcc/config.gcc | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +--- a/gcc/config.gcc ++++ b/gcc/config.gcc +@@ -1455,7 +1455,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes +@@ -1524,7 +1524,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu + extra_options="${extra_options} linux-android.opt" + # Assume modern glibc if not targeting Android nor uclibc. + case ${target} in +- *-*-*android*|*-*-*uclibc*) ++ *-*-*android*|*-*-*uclibc*|*-*-*musl*) + ;; + *) + default_gnu_indirect_function=yes diff --git a/toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 000000000..1743658ac --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,14 @@ +Use the proper rtx cost model for the selected CPU, even when optimizing +for size. This generates better code. + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -17483,7 +17483,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 000000000..0edeb13c7 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -285,7 +285,7 @@ extern void (*arm_lang_output_object_att + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch new file mode 100644 index 000000000..1d06f5b2e --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/810-arm-softfloat-libgcc.patch @@ -0,0 +1,25 @@ +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -60,8 +60,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch b/toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch new file mode 100644 index 000000000..42bf0c8cc --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/820-libgcc_pic.patch @@ -0,0 +1,36 @@ +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -887,11 +887,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -913,7 +914,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + endif +@@ -1108,6 +1109,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch b/toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch new file mode 100644 index 000000000..37f8f2a54 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/830-arm_unbreak_armv4t.patch @@ -0,0 +1,13 @@ +http://sourceware.org/ml/crossgcc/2008-05/msg00009.html + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -45,7 +45,7 @@ + The ARM10TDMI core is the default for armv5t, so set + SUBTARGET_CPU_DEFAULT to achieve this. */ + #undef SUBTARGET_CPU_DEFAULT +-#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi ++#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ diff --git a/toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 000000000..cb1fb9823 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,19 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -94,10 +94,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch new file mode 100644 index 000000000..5818cf4da --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/850-use_shared_libgcc.patch @@ -0,0 +1,47 @@ +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -131,10 +131,6 @@ + #define ENDFILE_SPEC \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_assert ("system=posix"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -132,5 +132,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -60,6 +60,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + diff --git a/toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch new file mode 100644 index 000000000..80c347684 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/851-libgcc_no_compat.patch @@ -0,0 +1,12 @@ +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch new file mode 100644 index 000000000..d06673efc --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,11 @@ +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -21528,7 +21528,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/5.5.0/880-no_java_section.patch b/toolchain/gcc/patches/5.5.0/880-no_java_section.patch new file mode 100644 index 000000000..def6c9f4a --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/880-no_java_section.patch @@ -0,0 +1,11 @@ +--- a/gcc/defaults.h ++++ b/gcc/defaults.h +@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI + /* If we have named section and we support weak symbols, then use the + .jcr section for recording java classes which need to be registered + at program start-up time. */ +-#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK ++#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK + #ifndef JCR_SECTION_NAME + #define JCR_SECTION_NAME ".jcr" + #endif diff --git a/toolchain/gcc/patches/5.5.0/881-no_tm_section.patch b/toolchain/gcc/patches/5.5.0/881-no_tm_section.patch new file mode 100644 index 000000000..fab5db3be --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/881-no_tm_section.patch @@ -0,0 +1,11 @@ +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch new file mode 100644 index 000000000..dd6e9dc88 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/900-bad-mips16-crt.patch @@ -0,0 +1,9 @@ +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch b/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch new file mode 100644 index 000000000..88905f6f2 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/910-mbsd_multi.patch @@ -0,0 +1,222 @@ + + This patch brings over a few features from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + * -Werror-maybe-reset + Has the effect of -Wno-error if GCC_NO_WERROR is + set and not '0', a no-operation otherwise. This is + to be able to use -Werror in "make" but prevent + GNU autoconf generated configure scripts from + freaking out. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -122,6 +122,9 @@ static int class_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -449,6 +452,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1039,6 +1048,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -431,6 +431,10 @@ Wfloat-conversion + C ObjC C++ ObjC++ Var(warn_float_conversion) LangEnabledBy(C ObjC C++ ObjC++,Wconversion) + Warn for implicit type conversions that cause loss of floating point precision + ++Werror-maybe-reset ++C ObjC C++ ObjC++ ++; Documented in common.opt ++ + Wfloat-equal + C ObjC C++ ObjC++ Var(warn_float_equal) Warning + Warn if testing floating point numbers for equality +@@ -1161,6 +1165,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -561,6 +561,10 @@ Werror= + Common Joined + Treat specified warning as error + ++Werror-maybe-reset ++Common ++If environment variable GCC_NO_WERROR is set, act as -Wno-error ++ + Wextra + Common Var(extra_warnings) Warning + Print extra (possibly unwanted) warnings +@@ -1360,6 +1364,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -1699,6 +1699,17 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_Werror_maybe_reset: ++ { ++ char *ev = getenv ("GCC_NO_WERROR"); ++ if ((ev != NULL) && (*ev != '0')) ++ warnings_are_errors = 0; ++ } ++ break; ++ ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -163,6 +163,11 @@ in older programs. This warning is on b + Make all warnings into hard errors. Source code which triggers warnings + will be rejected. + ++@item -Werror-maybe-reset ++@opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ + @item -Wsystem-headers + @opindex Wsystem-headers + Issue warnings for code in system headers. These are normally unhelpful +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -251,7 +251,7 @@ Objective-C and Objective-C++ Dialects}. + -Wdisabled-optimization @gol + -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol + -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol +--Wno-endif-labels -Werror -Werror=* @gol ++-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol + -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol + -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol + -Wformat-security -Wformat-signedness -Wformat-y2k @gol +@@ -5388,6 +5388,22 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++@item -Werror-maybe-reset ++@opindex Werror-maybe-reset ++Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment ++variable is set to anything other than 0 or empty. ++ ++@item -fhonour-copts ++@opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector +@@ -7866,7 +7882,7 @@ so, the first branch is redirected to ei + second branch or a point immediately following it, depending on whether + the condition is known to be true or false. + +-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. ++Enabled at levels @option{-O3}. + + @item -fsplit-wide-types + @opindex fsplit-wide-types +--- a/gcc/java/jvspec.c ++++ b/gcc/java/jvspec.c +@@ -629,6 +629,7 @@ lang_specific_pre_link (void) + class name. Append dummy `.c' that can be stripped by set_input so %b + is correct. */ + set_input (concat (main_class_name, "main.c", NULL)); ++ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ + err = do_spec (jvgenmain_spec); + if (err == 0) + { diff --git a/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch new file mode 100644 index 000000000..4c705ad86 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/920-specs_nonfatal_getenv.patch @@ -0,0 +1,15 @@ +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -8828,8 +8828,10 @@ getenv_spec_function (int argc, const ch + + value = getenv (argv[0]); + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", argv[0]); ++ { ++ warning (input_location, "environment variable %qs not defined", argv[0]); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch new file mode 100644 index 000000000..c05844d2e --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -19629,6 +19629,9 @@ mips_lra_p (void) + #undef TARGET_LRA_P + #define TARGET_LRA_P mips_lra_p + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch b/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch new file mode 100644 index 000000000..9ac0939eb --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/931-fix-MIPS-softfloat-build-issue.patch @@ -0,0 +1,167 @@ +From 2b46f9187b6f994fc450628a7cd97fc703dd23e0 Mon Sep 17 00:00:00 2001 +From: BangLang Huang +Date: Wed, 9 Nov 2016 10:36:49 +0800 +Subject: [PATCH] fix MIPS softfloat build issue + + This patch is backport from github/libffi #272 + +Signed-off-by: BangLang Huang +--- + libffi/src/mips/n32.S | 17 +++++++++++++++++ + libffi/src/mips/o32.S | 17 +++++++++++++++++ + 2 files changed, 34 insertions(+) + +--- a/libffi/src/mips/n32.S ++++ b/libffi/src/mips/n32.S +@@ -107,6 +107,16 @@ loadregs: + + REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. + ++#ifdef __mips_soft_float ++ REG_L a0, 0*FFI_SIZEOF_ARG(t9) ++ REG_L a1, 1*FFI_SIZEOF_ARG(t9) ++ REG_L a2, 2*FFI_SIZEOF_ARG(t9) ++ REG_L a3, 3*FFI_SIZEOF_ARG(t9) ++ REG_L a4, 4*FFI_SIZEOF_ARG(t9) ++ REG_L a5, 5*FFI_SIZEOF_ARG(t9) ++ REG_L a6, 6*FFI_SIZEOF_ARG(t9) ++ REG_L a7, 7*FFI_SIZEOF_ARG(t9) ++#else + and t4, t6, ((1</dev/null ++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null + @$(STAMP) stamp-bits-sup + + stamp-c_base: ${c_base_headers} diff --git a/toolchain/gcc/patches/5.5.0/950-cpp_file_path_translation.patch b/toolchain/gcc/patches/5.5.0/950-cpp_file_path_translation.patch new file mode 100644 index 000000000..b67940897 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/950-cpp_file_path_translation.patch @@ -0,0 +1,182 @@ +Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -581,6 +581,10 @@ c_common_handle_option (size_t scode, co + add_path (xstrdup (arg), SYSTEM, 0, true); + break; + ++ case OPT_iremap: ++ add_cpp_remap_path (arg); ++ break; ++ + case OPT_iwithprefix: + add_prefixed_path (arg, SYSTEM); + break; +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1528,6 +1528,10 @@ iquote + C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) + -iquote Add to the end of the quote include path + ++iremap ++C ObjC C++ ObjC++ Joined Separate ++-iremap Convert to if it occurs as prefix in __FILE__. ++ + iwithprefix + C ObjC C++ ObjC++ Joined Separate + -iwithprefix Add to the end of the system include path +--- a/gcc/doc/cpp.texi ++++ b/gcc/doc/cpp.texi +@@ -4441,6 +4441,7 @@ without notice. + @c man begin SYNOPSIS + cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] + [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] ++ [@option{-iremap}@var{src}:@var{dst}] + [@option{-W}@var{warn}@dots{}] + [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] + [@option{-MP}] [@option{-MQ} @var{target}@dots{}] +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -532,6 +532,12 @@ Search @var{dir} only for header files r + If @var{dir} begins with @code{=}, then the @code{=} will be replaced + by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -fdirectives-only + @opindex fdirectives-only + When preprocessing, handle directives, but do not expand macros. +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -494,8 +494,8 @@ Objective-C and Objective-C++ Dialects}. + @item Directory Options + @xref{Directory Options,,Options for Directory Search}. + @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol +--iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol +---sysroot=@var{dir} --no-sysroot-suffix} ++-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -specs=@var{file} @gol ++-I- --sysroot=@var{dir} --no-sysroot-suffix} + + @item Machine Dependent Options + @xref{Submodel Options,,Hardware Models and Configurations}. +@@ -11485,6 +11485,12 @@ be searched for header files only for th + "@var{file}"}; they are not searched for @code{#include <@var{file}>}, + otherwise just like @option{-I}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -L@var{dir} + @opindex L + Add directory @var{dir} to the list of directories to be searched +--- a/libcpp/include/cpplib.h ++++ b/libcpp/include/cpplib.h +@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *, + /* Set the include paths. */ + extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); + ++/* Provide src:dst pair for __FILE__ remapping. */ ++extern void add_cpp_remap_path (const char *); ++ + /* Call these to get pointers to the options, callback, and deps + structures for a given reader. These pointers are good until you + call cpp_finish on that reader. You can either edit the callbacks +--- a/libcpp/macro.c ++++ b/libcpp/macro.c +@@ -224,6 +224,64 @@ static const char * const monthnames[] = + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + ++static size_t remap_pairs; ++static char **remap_src; ++static char **remap_dst; ++ ++void ++add_cpp_remap_path (const char *arg) ++{ ++ const char *arg_dst; ++ size_t len; ++ ++ arg_dst = strchr(arg, ':'); ++ if (arg_dst == NULL) ++ { ++ fprintf(stderr, "Invalid argument for -iremap\n"); ++ exit(1); ++ } ++ ++ len = arg_dst - arg; ++ ++arg_dst; ++ ++ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); ++ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); ++ ++ remap_src[remap_pairs] = (char *) xmalloc(len + 1); ++ memcpy(remap_src[remap_pairs], arg, len); ++ remap_src[remap_pairs][len] = '\0'; ++ remap_dst[remap_pairs] = xstrdup(arg_dst); ++ ++remap_pairs; ++} ++ ++static const char * ++cpp_remap_file (const char *arg, char **tmp_name) ++{ ++ char *result; ++ size_t i, len; ++ ++ for (i = 0; i < remap_pairs; ++i) ++ { ++ len = strlen (remap_src[i]); ++ if (strncmp (remap_src[i], arg, len)) ++ continue; ++ if (arg[len] == '\0') ++ return xstrdup (remap_dst[i]); ++ if (arg[len] != '/') ++ continue; ++ arg += len; ++ len = strlen (remap_dst[i]); ++ result = (char *) xmalloc (len + strlen (arg) + 1); ++ memcpy(result, remap_dst[i], len); ++ strcpy(result + len, arg); ++ *tmp_name = result; ++ ++ return result; ++ } ++ ++ return arg; ++} ++ + /* Helper function for builtin_macro. Returns the text generated by + a builtin macro. */ + const uchar * +@@ -286,6 +344,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + { + unsigned int len; + const char *name; ++ char *tmp_name = NULL; + uchar *buf; + + if (node->value.builtin == BT_FILE) +@@ -297,6 +356,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + if (!name) + abort (); + } ++ name = cpp_remap_file (name, &tmp_name); + len = strlen (name); + buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); + result = buf; +@@ -304,6 +364,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + *buf++ = '"'; + *buf = '\0'; ++ free (tmp_name); + } + break; + diff --git a/toolchain/gcc/patches/5.5.0/960-go_libm.patch b/toolchain/gcc/patches/5.5.0/960-go_libm.patch new file mode 100644 index 000000000..d16b0200c --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/960-go_libm.patch @@ -0,0 +1,11 @@ +--- a/gcc/go/Make-lang.in ++++ b/gcc/go/Make-lang.in +@@ -74,7 +74,7 @@ go_OBJS = $(GO_OBJS) go/gospec.o + + go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS) + +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ +- $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) ++ $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -lm + + # Documentation. + diff --git a/toolchain/gcc/patches/5.5.0/970-warn_bug.patch b/toolchain/gcc/patches/5.5.0/970-warn_bug.patch new file mode 100644 index 000000000..2c5cf9be2 --- /dev/null +++ b/toolchain/gcc/patches/5.5.0/970-warn_bug.patch @@ -0,0 +1,11 @@ +--- a/libgo/runtime/mprof.goc ++++ b/libgo/runtime/mprof.goc +@@ -403,7 +403,7 @@ func ThreadCreateProfile(p Slice) (n int + + func Stack(b Slice, all bool) (n int) { + byte *pc, *sp; +- bool enablegc; ++ bool enablegc = false; /* workaround GCC bug #36550 */ + + sp = runtime_getcallersp(&b); + pc = (byte*)(uintptr)runtime_getcallerpc(&b); diff --git a/toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch b/toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch new file mode 100644 index 000000000..63e3fee00 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/001-revert_register_mode_search.patch @@ -0,0 +1,77 @@ +commit 31285a20390a5e53a74a2a71d1b5c82f366ddd5a +Author: Felix Fietkau +Date: Tue May 6 11:49:05 2014 +0000 + + gcc: revert an upstream patch that is causing a regression on powerpc + + https://forum.openwrt.org/viewtopic.php?pid=232494#p232494 + + Signed-off-by: Felix Fietkau + + SVN-Revision: 40709 + +Revert of: + +commit 275035b56823b26d5fb7e90fad945b998648edf2 +Author: bergner +Date: Thu Sep 5 14:09:07 2013 +0000 + + PR target/58139 + * reginfo.c (choose_hard_reg_mode): Scan through all mode classes + looking for widest mode. + + + git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 + + +--- a/gcc/reginfo.c ++++ b/gcc/reginfo.c +@@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + ++ if (found_mode != VOIDmode) ++ return found_mode; ++ + for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); + mode != VOIDmode; + mode = GET_MODE_WIDER_MODE (mode)) + if ((unsigned) hard_regno_nregs[regno][mode] == nregs + && HARD_REGNO_MODE_OK (regno, mode) +- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) +- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) ++ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) + found_mode = mode; + + if (found_mode != VOIDmode) diff --git a/toolchain/gcc/patches/7.2.0/002-case_insensitive.patch b/toolchain/gcc/patches/7.2.0/002-case_insensitive.patch new file mode 100644 index 000000000..3442076d7 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/002-case_insensitive.patch @@ -0,0 +1,24 @@ +commit 81cc26c706b2bc8c8c1eb1a322e5c5157900836e +Author: Felix Fietkau +Date: Sun Oct 19 21:45:51 2014 +0000 + + gcc: do not assume that the Mac OS X filesystem is case insensitive + + Signed-off-by: Felix Fietkau + + SVN-Revision: 42973 + +--- a/include/filenames.h ++++ b/include/filenames.h +@@ -43,11 +43,6 @@ extern "C" { + # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) + #else /* not DOSish */ +-# if defined(__APPLE__) +-# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM +-# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 +-# endif +-# endif /* __APPLE__ */ + # define HAS_DRIVE_SPEC(f) (0) + # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) + # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain/gcc/patches/7.2.0/010-documentation.patch b/toolchain/gcc/patches/7.2.0/010-documentation.patch new file mode 100644 index 000000000..0106814f4 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/010-documentation.patch @@ -0,0 +1,35 @@ +commit 098bd91f5eae625c7d2ee621e10930fc4434e5e2 +Author: Luka Perkov +Date: Tue Feb 26 16:16:33 2013 +0000 + + gcc: don't build documentation + + This closes #13039. + + Signed-off-by: Luka Perkov + + SVN-Revision: 35807 + +--- a/gcc/Makefile.in ++++ b/gcc/Makefile.in +@@ -3121,18 +3121,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) + doc/gccint.info: $(TEXI_GCCINT_FILES) + doc/cppinternals.info: $(TEXI_CPPINT_FILES) + +-doc/%.info: %.texi +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/%.info: + + # Duplicate entry to handle renaming of gccinstall.info +-doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) +- if [ x$(BUILD_INFO) = xinfo ]; then \ +- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ +- -I $(gcc_docdir)/include -o $@ $<; \ +- fi ++doc/gccinstall.info: + + doc/cpp.dvi: $(TEXI_CPP_FILES) + doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch b/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch new file mode 100644 index 000000000..eebee9175 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/230-musl_libssp.patch @@ -0,0 +1,28 @@ +commit 1877bc9d8f2be143fbe530347a945850d0ecd234 +Author: Steven Barth +Date: Mon Jun 22 10:31:07 2015 +0000 + + gcc/musl: rework SSP-support + + Make musl provide libssp_nonshared.a and make GCC link it unconditionally + if musl is used. This should be a no-op if SSP is disabled and seems to be + the only reliable way of dealing with SSP over all packages due to the mess + that is linkerflags handling in packages. + + Signed-off-by: Steven Barth + + SVN-Revision: 46108 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -861,7 +861,9 @@ proper position among the other output f + #endif + + #ifndef LINK_SSP_SPEC +-#ifdef TARGET_LIBC_PROVIDES_SSP ++#if DEFAULT_LIBC == LIBC_MUSL ++#define LINK_SSP_SPEC "-lssp_nonshared" ++#elif defined(TARGET_LIBC_PROVIDES_SSP) + #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ + "|fstack-protector-strong|fstack-protector-explicit:}" + #else diff --git a/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch new file mode 100644 index 000000000..84c0fdab6 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/300-mips_Os_cpu_rtx_cost_model.patch @@ -0,0 +1,21 @@ +commit ecf7671b769fe96f7b5134be442089f8bdba55d2 +Author: Felix Fietkau +Date: Thu Aug 4 20:29:45 2016 +0200 + +gcc: add a patch to generate better code with Os on mips + +Also happens to reduce compressed code size a bit + +Signed-off-by: Felix Fietkau + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -19784,7 +19784,7 @@ mips_option_override (void) + flag_pcc_struct_return = 0; + + /* Decide which rtx_costs structure to use. */ +- if (optimize_size) ++ if (0 && optimize_size) + mips_cost = &mips_rtx_cost_optimize_size; + else + mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch new file mode 100644 index 000000000..76200a166 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/800-arm_v5te_no_ldrd_strd.patch @@ -0,0 +1,32 @@ +commit b050f87d13b5dc7ed82feb9a90f4529de58bdf25 +Author: Felix Fietkau +Date: Wed Feb 19 19:20:10 2014 +0000 + + gcc: prevent the use of LDRD/STRD on ARMv5TE + + These instructions are for 64-bit load/store. On ARMv5TE, the CPU + requires addresses to be aligned to 64-bit. When misaligned, behavior is + undefined (effectively either loads the same word twice on LDRD, or + corrupts surrounding memory on STRD). + + On ARMv6 and newer, unaligned access is safe. + + Removing these instructions for ARMv5TE is necessary, because GCC + ignores alignment information in pointers and does unsafe optimizations + that have shown up as bugs in various places. + + Signed-off-by: Felix Fietkau + + SVN-Revision: 39638 + +--- a/gcc/config/arm/arm.h ++++ b/gcc/config/arm/arm.h +@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; + /* Thumb-1 only. */ + #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) + +-#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ ++#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ + && !TARGET_THUMB1) + + #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch b/toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch new file mode 100644 index 000000000..5c9d86aea --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/810-arm-softfloat-libgcc.patch @@ -0,0 +1,33 @@ +commit 8570c4be394cff7282f332f97da2ff569a927ddb +Author: Imre Kaloz +Date: Wed Feb 2 20:06:12 2011 +0000 + + fixup arm soft-float symbols + + SVN-Revision: 25325 + +--- a/libgcc/config/arm/t-linux ++++ b/libgcc/config/arm/t-linux +@@ -1,6 +1,10 @@ + LIB1ASMSRC = arm/lib1funcs.S + LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 ++ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ ++ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ ++ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ ++ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ ++ _arm_fixsfsi _arm_fixunssfsi + + # Just for these, we omit the frame pointer since it makes such a big + # difference. +--- a/gcc/config/arm/linux-elf.h ++++ b/gcc/config/arm/linux-elf.h +@@ -58,8 +58,6 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" +- + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + + #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch b/toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch new file mode 100644 index 000000000..0cc1e07e2 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/820-libgcc_pic.patch @@ -0,0 +1,44 @@ +commit c96312958c0621e72c9b32da5bc224ffe2161384 +Author: Felix Fietkau +Date: Mon Oct 19 23:26:09 2009 +0000 + + gcc: create a proper libgcc_pic.a static library for relinking (4.3.3+ for now, backport will follow) + + SVN-Revision: 18086 + +--- a/libgcc/Makefile.in ++++ b/libgcc/Makefile.in +@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $ + + # Static libraries. + libgcc.a: $(libgcc-objects) ++libgcc_pic.a: $(libgcc-s-objects) + libgcov.a: $(libgcov-objects) + libunwind.a: $(libunwind-objects) + libgcc_eh.a: $(libgcc-eh-objects) + +-libgcc.a libgcov.a libunwind.a libgcc_eh.a: ++libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: + -rm -f $@ + + objects="$(objects)"; \ +@@ -945,7 +946,7 @@ all: libunwind.a + endif + + ifeq ($(enable_shared),yes) +-all: libgcc_eh.a libgcc_s$(SHLIB_EXT) ++all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) + ifneq ($(LIBUNWIND),) + all: libunwind$(SHLIB_EXT) + libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) +@@ -1151,6 +1152,10 @@ install-shared: + chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a + $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a + ++ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ ++ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a ++ + $(subst @multilib_dir@,$(MULTIDIR),$(subst \ + @shlib_base_name@,libgcc_s,$(subst \ + @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch new file mode 100644 index 000000000..b9c9b161a --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/840-armv4_pass_fix-v4bx_to_ld.patch @@ -0,0 +1,28 @@ +commit 7edc8ca5456d9743dd0075eb3cc5b04f4f24c8cc +Author: Imre Kaloz +Date: Wed Feb 2 19:34:36 2011 +0000 + + add armv4 fixup patches + + SVN-Revision: 25322 + + +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -88,10 +88,15 @@ + #define MUSL_DYNAMIC_LINKER \ + "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" + ++/* For armv4 we pass --fix-v4bx to linker to support EABI */ ++#undef TARGET_FIX_V4BX_SPEC ++#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ ++ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" ++ + /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to + use the GNU/Linux version, not the generic BPABI version. */ + #undef LINK_SPEC +-#define LINK_SPEC EABI_LINK_SPEC \ ++#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ + LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ + LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) + diff --git a/toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch b/toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch new file mode 100644 index 000000000..1d07efed8 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/850-use_shared_libgcc.patch @@ -0,0 +1,54 @@ +commit dcfc40358b5a3cae7320c17f8d1cebd5ad5540cd +Author: Felix Fietkau +Date: Sun Feb 12 20:25:47 2012 +0000 + + gcc 4.6: port over the missing patch 850-use_shared_libgcc.patch to prevent libgcc crap from leaking into every single binary + + SVN-Revision: 30486 +--- a/gcc/config/arm/linux-eabi.h ++++ b/gcc/config/arm/linux-eabi.h +@@ -126,10 +126,6 @@ + "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ + LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) + +-/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we +- do not use -lfloat. */ +-#undef LIBGCC_SPEC +- + /* Clear the instruction cache from `beg' to `end'. This is + implemented in lib1funcs.S, so ensure an error if this definition + is used. */ +--- a/gcc/config/linux.h ++++ b/gcc/config/linux.h +@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI + builtin_assert ("system=posix"); \ + } while (0) + ++#ifndef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" ++#endif ++ + /* Determine which dynamic linker to use depending on whether GLIBC or + uClibc or Bionic or musl is the default C library and whether + -muclibc or -mglibc or -mbionic or -mmusl has been passed to change +--- a/libgcc/mkmap-symver.awk ++++ b/libgcc/mkmap-symver.awk +@@ -136,5 +136,5 @@ function output(lib) { + else if (inherit[lib]) + printf("} %s;\n", inherit[lib]); + else +- printf ("\n local:\n\t*;\n};\n"); ++ printf ("\n\t*;\n};\n"); + } +--- a/gcc/config/rs6000/linux.h ++++ b/gcc/config/rs6000/linux.h +@@ -60,6 +60,9 @@ + #undef CPP_OS_DEFAULT_SPEC + #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" + ++#undef LIBGCC_SPEC ++#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" ++ + #undef LINK_SHLIB_SPEC + #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" + diff --git a/toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch b/toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch new file mode 100644 index 000000000..d710e4071 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/851-libgcc_no_compat.patch @@ -0,0 +1,22 @@ +commit 64661de100da1ec1061ef3e5e400285dce115e6b +Author: Felix Fietkau +Date: Sun May 10 13:16:35 2015 +0000 + + gcc: add some size optimization patches + + Signed-off-by: Felix Fietkau + + SVN-Revision: 45664 + +--- a/libgcc/config/t-libunwind ++++ b/libgcc/config/t-libunwind +@@ -2,8 +2,7 @@ + + HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER + +-LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ +- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c + + # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch b/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch new file mode 100644 index 000000000..156468b45 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/870-ppc_no_crtsavres.patch @@ -0,0 +1,18 @@ +commit d8c570a1531035c3e26bcd94741e5f5b9c36b5d9 +Author: Felix Fietkau +Date: Mon Mar 5 00:51:01 2012 +0000 + + gcc: do not emit references to _savegpr_* and _restgpr_* on powerpc, as they are tricky to deal with wrt. libgcc. they cannot be linked dynamically + + SVN-Revision: 30814 +--- a/gcc/config/rs6000/rs6000.c ++++ b/gcc/config/rs6000/rs6000.c +@@ -26936,7 +26936,7 @@ rs6000_savres_strategy (rs6000_stack_t * + /* Define cutoff for using out-of-line functions to save registers. */ + if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) + { +- if (!optimize_size) ++ if (1) + { + strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; + strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch b/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch new file mode 100644 index 000000000..a58dc27e6 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/881-no_tm_section.patch @@ -0,0 +1,22 @@ +commit 565988ab47bd9b96b50608564aee2104aeb4b7ae +Author: Felix Fietkau +Date: Tue Dec 13 14:20:49 2016 +0100 + + gcc: rip out transactional memory related bloat from crtbegin + + Slightly improves compression for each executable, saving about 4k from + the default ar71xx rootfs + + Signed-off-by: Felix Fietkau + +--- a/libgcc/crtstuff.c ++++ b/libgcc/crtstuff.c +@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ + #endif + + #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) +-# define USE_TM_CLONE_REGISTRY 1 ++# define USE_TM_CLONE_REGISTRY 0 + #endif + + /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch b/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch new file mode 100644 index 000000000..f5cc0a74e --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/900-bad-mips16-crt.patch @@ -0,0 +1,30 @@ +commit 9dc38e48f7a6f88b7ac7bfaced91f53660204e46 +Author: Florian Fainelli +Date: Fri Apr 5 12:36:06 2013 +0000 + + toolchain/gcc: .init and .fini need to pick one ISA + + The .init and .fini sections are built by concatenating code + fragments. Putting mips16 code in the middle of a mips32 code block + doesn't work. Make gcc built the magic crt stuff in no-mips16 mode. + + This is specific to 4.6-linaro but is probably portable to other gcc + flavors. Adding this to the t-libgcc-mips16 makefile fragment is a + hack not suitable for pushing upstream, but there is no mips/t-linux + or mips/t-uclibc and I am not going to touch gcc/configure for two + lines. + + Signed-off-by: Jay Carlson + Signed-off-by: Florian Fainelli + + SVN-Revision: 36200 + +--- a/libgcc/config/mips/t-mips16 ++++ b/libgcc/config/mips/t-mips16 +@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 + + # Version these symbols if building libgcc.so. + SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver ++ ++CRTSTUFF_T_CFLAGS += -mno-mips16 ++CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch b/toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch new file mode 100644 index 000000000..286cfadae --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/910-mbsd_multi.patch @@ -0,0 +1,146 @@ +commit 99368862e44740ff4fd33760893f04e14f9dbdf1 +Author: Felix Fietkau +Date: Tue Jul 31 00:52:27 2007 +0000 + + Port the mbsd_multi patch from freewrt, which adds -fhonour-copts. This will emit warnings in packages that don't use our target cflags properly + + SVN-Revision: 8256 + + This patch brings over a feature from MirBSD: + * -fhonour-copts + If this option is not given, it's warned (depending + on environment variables). This is to catch errors + of misbuilt packages which override CFLAGS themselves. + + This patch was authored by Thorsten Glaser + with copyright assignment to the FSF in effect. + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -108,6 +108,9 @@ static int class_dump_flags; + /* Whether any standard preincluded header has been preincluded. */ + static bool done_preinclude; + ++/* Check if a port honours COPTS. */ ++static int honour_copts = 0; ++ + static void handle_OPT_d (const char *); + static void set_std_cxx98 (int); + static void set_std_cxx11 (int); +@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co + flag_no_builtin = !value; + break; + ++ case OPT_fhonour_copts: ++ if (c_language == clk_c) { ++ honour_copts++; ++ } ++ break; ++ + case OPT_fconstant_string_class_: + constant_string_class_name = arg; + break; +@@ -1084,6 +1093,47 @@ c_common_init (void) + return false; + } + ++ if (c_language == clk_c) { ++ char *ev = getenv ("GCC_HONOUR_COPTS"); ++ int evv; ++ if (ev == NULL) ++ evv = -1; ++ else if ((*ev == '0') || (*ev == '\0')) ++ evv = 0; ++ else if (*ev == '1') ++ evv = 1; ++ else if (*ev == '2') ++ evv = 2; ++ else if (*ev == 's') ++ evv = -1; ++ else { ++ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); ++ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ ++ } ++ if (evv == 1) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in lenient mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ warning (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } else if (evv == 2) { ++ if (honour_copts == 0) { ++ error ("someone does not honour COPTS at all in strict mode"); ++ return false; ++ } else if (honour_copts != 1) { ++ error ("someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ return false; ++ } ++ } else if (evv == 0) { ++ if (honour_copts != 1) ++ inform (0, "someone does not honour COPTS correctly, passed %d times", ++ honour_copts); ++ } ++ } ++ + return true; + } + +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception + fhonor-std + C++ ObjC++ Ignore Warn(switch %qs is no longer supported) + ++fhonour-copts ++C ObjC C++ ObjC++ RejectNegative ++ + fhosted + C ObjC + Assume normal C execution environment. +--- a/gcc/common.opt ++++ b/gcc/common.opt +@@ -1510,6 +1510,9 @@ fguess-branch-probability + Common Report Var(flag_guess_branch_prob) Optimization + Enable guessing of branch probabilities. + ++fhonour-copts ++Common RejectNegative ++ + ; Nonzero means ignore `#ident' directives. 0 means handle them. + ; Generate position-independent code for executables if possible + ; On SVR4 targets, it also controls whether or not to emit a +--- a/gcc/opts.c ++++ b/gcc/opts.c +@@ -1928,6 +1928,9 @@ common_handle_option (struct gcc_options + opts, opts_set, loc, dc); + break; + ++ case OPT_fhonour_copts: ++ break; ++ + case OPT_Wlarger_than_: + opts->x_larger_than_size = value; + opts->x_warn_larger_than = value != -1; +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -6567,6 +6567,17 @@ This option is only supported for C and + @option{-Wall} and by @option{-Wpedantic}, which can be disabled with + @option{-Wno-pointer-sign}. + ++@item -fhonour-copts ++@opindex fhonour-copts ++If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not ++given at least once, and warn if it is given more than once. ++If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not ++given exactly once. ++If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option ++is not given exactly once. ++The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. ++This flag and environment variable only affect the C language. ++ + @item -Wstack-protector + @opindex Wstack-protector + @opindex Wno-stack-protector diff --git a/toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch b/toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch new file mode 100644 index 000000000..69b40621d --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/920-specs_nonfatal_getenv.patch @@ -0,0 +1,22 @@ +Author: Jo-Philipp Wich +Date: Sat Apr 21 03:02:39 2012 +0000 + + gcc: add patch to make the getenv() spec function nonfatal if requested environment variable is unset + + SVN-Revision: 31390 + +--- a/gcc/gcc.c ++++ b/gcc/gcc.c +@@ -9280,8 +9280,10 @@ getenv_spec_function (int argc, const ch + value = varname; + + if (!value) +- fatal_error (input_location, +- "environment variable %qs not defined", varname); ++ { ++ warning (input_location, "environment variable %qs not defined", varname); ++ value = ""; ++ } + + /* We have to escape every character of the environment variable so + they are not interpreted as active spec characters. A diff --git a/toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch b/toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch new file mode 100644 index 000000000..90d10f11e --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/930-fix-mips-noexecstack.patch @@ -0,0 +1,111 @@ +From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 +From: Andrew McDonnell +Date: Fri, 3 Oct 2014 19:09:00 +0930 +Subject: Add .note.GNU-stack section + +See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html +Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html + +Re: [Patch, MIPS] Add .note.GNU-stack section + + From: Steve Ellcey + +On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: +> +> +> On Wed, Sep 10, 2014 at 9:27 AM, wrote: + +> This works except you did not update the assembly files in +> libgcc or glibc. We (Cavium) have the same patch in our tree +> for a few released versions. + +> Mind just checking yours in then Andrew? + +> Thanks! +> -eric + +I talked to Andrew about what files he changed in GCC and created and +tested this new patch. Andrew also mentioned changing some assembly +files in glibc but I don't see any use of '.section .note.GNU-stack' in +any assembly files in glibc (for any platform) so I wasn't planning on +creating a glibc to add them to mips glibc assembly language files. + +OK to check in this patch? + +Steve Ellcey +sellcey@mips.com + + + +2014-09-26 Steve Ellcey +--- + gcc/config/mips/mips.c | 3 +++ + libgcc/config/mips/crti.S | 4 ++++ + libgcc/config/mips/crtn.S | 3 +++ + libgcc/config/mips/mips16.S | 4 ++++ + libgcc/config/mips/vr4120-div.S | 4 ++++ + 5 files changed, 18 insertions(+) + +--- a/gcc/config/mips/mips.c ++++ b/gcc/config/mips/mips.c +@@ -22561,6 +22561,9 @@ mips_promote_function_mode (const_tree t + #undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS + #define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2 + ++#undef TARGET_ASM_FILE_END ++#define TARGET_ASM_FILE_END file_end_indicate_exec_stack ++ + struct gcc_target targetm = TARGET_INITIALIZER; + + #include "gt-mips.h" +--- a/libgcc/config/mips/crti.S ++++ b/libgcc/config/mips/crti.S +@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++ ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/crtn.S ++++ b/libgcc/config/mips/crtn.S +@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + . */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ + /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. + Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ + +--- a/libgcc/config/mips/mips16.S ++++ b/libgcc/config/mips/mips16.S +@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI + values using the soft-float calling convention, but do the actual + operation using the hard floating point instructions. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) + + /* This file contains 32-bit assembly code. */ +--- a/libgcc/config/mips/vr4120-div.S ++++ b/libgcc/config/mips/vr4120-div.S +@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI + -mfix-vr4120. div and ddiv do not give the correct result when one + of the operands is negative. */ + ++/* An executable stack is *not* required for these functions. */ ++ .section .note.GNU-stack,"",%progbits ++ .previous ++ + .set nomips16 + + #define DIV \ diff --git a/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch b/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch new file mode 100644 index 000000000..8b88b4066 --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/940-no-clobber-stamp-bits.patch @@ -0,0 +1,33 @@ +commit 548d9a008ff265e9eaa3c7e0e6e301c6bd5645e6 +Author: Felix Fietkau +Date: Fri Dec 12 17:01:57 2014 +0000 + + gcc: don't clobber stamp-bits with a symlink to itself + + Several versions of gcc have an issue in libstdc++v3 where the build may + clobber stamp-bits with a link to itself. This doesn't manifest itself + on all systems. On several Ubuntu systems, this doesn't appear to be a + problem, but it is an issue on Fedora 16 systems. + + To fix the issue, we'll simply filter out stamp-bits from the symlinks + to be generated. + + Note: gcc 4.4.7 is unaffected by this issue, so no fix is necessary + there. + + Signed-off-by: John Szakmeister + + SVN-Revision: 43669 + + +--- a/libstdc++-v3/include/Makefile.in ++++ b/libstdc++-v3/include/Makefile.in +@@ -1476,7 +1476,7 @@ stamp-bits: ${bits_headers} + @$(STAMP) stamp-bits + + stamp-bits-sup: stamp-bits ${bits_sup_headers} +- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null ++ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null + @$(STAMP) stamp-bits-sup + + stamp-c_base: ${c_base_headers} diff --git a/toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch b/toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch new file mode 100644 index 000000000..60729dd7f --- /dev/null +++ b/toolchain/gcc/patches/7.2.0/950-cpp_file_path_translation.patch @@ -0,0 +1,181 @@ +commit 331735a357a73c7b8adc205241ac3cc6543d985e +Author: Felix Fietkau +Date: Tue Nov 17 12:38:22 2015 +0000 + + gcc: add a patch to 5.x that supports translation of __FILE__ paths + + Signed-off-by: Felix Fietkau + + SVN-Revision: 47490 + +Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 + +--- a/gcc/c-family/c-opts.c ++++ b/gcc/c-family/c-opts.c +@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co + add_path (xstrdup (arg), SYSTEM, 0, true); + break; + ++ case OPT_iremap: ++ add_cpp_remap_path (arg); ++ break; ++ + case OPT_iwithprefix: + add_prefixed_path (arg, SYSTEM); + break; +--- a/gcc/c-family/c.opt ++++ b/gcc/c-family/c.opt +@@ -1825,6 +1825,10 @@ iquote + C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) + -iquote Add to the end of the quote include path. + ++iremap ++C ObjC C++ ObjC++ Joined Separate ++-iremap Convert to if it occurs as prefix in __FILE__. ++ + iwithprefix + C ObjC C++ ObjC++ Joined Separate + -iwithprefix Add to the end of the system include path. +--- a/gcc/doc/cpp.texi ++++ b/gcc/doc/cpp.texi +@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen + @c man begin SYNOPSIS + cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] + [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] ++ [@option{-iremap}@var{src}:@var{dst}] + [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] + [@option{-MP}] [@option{-MQ} @var{target}@dots{}] + [@option{-MT} @var{target}@dots{}] +--- a/gcc/doc/cppopts.texi ++++ b/gcc/doc/cppopts.texi +@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam + extensions that GCC uses for preprocessed files created by + @option{-save-temps}. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -fdirectives-only + @opindex fdirectives-only + When preprocessing, handle directives, but do not expand macros. +--- a/gcc/doc/invoke.texi ++++ b/gcc/doc/invoke.texi +@@ -11863,6 +11863,12 @@ by @option{-fplugin=@var{name}} instead + @option{-fplugin=@var{path}/@var{name}.so}. This option is not meant + to be used by the user, but only passed by the driver. + ++@item -iremap @var{src}:@var{dst} ++@opindex iremap ++Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. ++This option can be specified more than once. Processing stops at the first ++match. ++ + @item -L@var{dir} + @opindex L + Add directory @var{dir} to the list of directories to be searched +--- a/libcpp/include/cpplib.h ++++ b/libcpp/include/cpplib.h +@@ -820,6 +820,9 @@ extern void cpp_set_lang (cpp_reader *, + /* Set the include paths. */ + extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); + ++/* Provide src:dst pair for __FILE__ remapping. */ ++extern void add_cpp_remap_path (const char *); ++ + /* Call these to get pointers to the options, callback, and deps + structures for a given reader. These pointers are good until you + call cpp_finish on that reader. You can either edit the callbacks +--- a/libcpp/macro.c ++++ b/libcpp/macro.c +@@ -227,6 +227,64 @@ static const char * const monthnames[] = + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + ++static size_t remap_pairs; ++static char **remap_src; ++static char **remap_dst; ++ ++void ++add_cpp_remap_path (const char *arg) ++{ ++ const char *arg_dst; ++ size_t len; ++ ++ arg_dst = strchr(arg, ':'); ++ if (arg_dst == NULL) ++ { ++ fprintf(stderr, "Invalid argument for -iremap\n"); ++ exit(1); ++ } ++ ++ len = arg_dst - arg; ++ ++arg_dst; ++ ++ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); ++ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); ++ ++ remap_src[remap_pairs] = (char *) xmalloc(len + 1); ++ memcpy(remap_src[remap_pairs], arg, len); ++ remap_src[remap_pairs][len] = '\0'; ++ remap_dst[remap_pairs] = xstrdup(arg_dst); ++ ++remap_pairs; ++} ++ ++static const char * ++cpp_remap_file (const char *arg, char **tmp_name) ++{ ++ char *result; ++ size_t i, len; ++ ++ for (i = 0; i < remap_pairs; ++i) ++ { ++ len = strlen (remap_src[i]); ++ if (strncmp (remap_src[i], arg, len)) ++ continue; ++ if (arg[len] == '\0') ++ return xstrdup (remap_dst[i]); ++ if (arg[len] != '/') ++ continue; ++ arg += len; ++ len = strlen (remap_dst[i]); ++ result = (char *) xmalloc (len + strlen (arg) + 1); ++ memcpy(result, remap_dst[i], len); ++ strcpy(result + len, arg); ++ *tmp_name = result; ++ ++ return result; ++ } ++ ++ return arg; ++} ++ + /* Helper function for builtin_macro. Returns the text generated by + a builtin macro. */ + const uchar * +@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + { + unsigned int len; + const char *name; ++ char *tmp_name = NULL; + uchar *buf; + + if (node->value.builtin == BT_FILE) +@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + if (!name) + abort (); + } ++ name = cpp_remap_file (name, &tmp_name); + len = strlen (name); + buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); + result = buf; +@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi + buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); + *buf++ = '"'; + *buf = '\0'; ++ free (tmp_name); + } + break; + diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 77e24f460..abd6d033c 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -17,11 +17,11 @@ PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6 GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) PATCH_DIR:=./patches-arc else -PKG_VERSION:=7.12.1 +PKG_VERSION:=8.0.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 +PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) endif diff --git a/toolchain/gdb/patches/110-no_testsuite.patch b/toolchain/gdb/patches/110-no_testsuite.patch index 68d1c9035..e86ba6d0c 100644 --- a/toolchain/gdb/patches/110-no_testsuite.patch +++ b/toolchain/gdb/patches/110-no_testsuite.patch @@ -1,6 +1,6 @@ --- a/gdb/configure +++ b/gdb/configure -@@ -874,8 +874,7 @@ MAKEINFOFLAGS +@@ -869,8 +869,7 @@ MAKEINFOFLAGS YACC YFLAGS XMKMF' @@ -10,7 +10,7 @@ multi-ice gdbserver' -@@ -5617,7 +5616,7 @@ $as_echo "$with_auto_load_safe_path" >&6 +@@ -6473,7 +6472,7 @@ $as_echo "$with_auto_load_safe_path" >&6 diff --git a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch index 562902c50..9ce91a024 100644 --- a/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch +++ b/toolchain/gdb/patches/120-fix-compile-flag-mismatch.patch @@ -1,6 +1,6 @@ --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure -@@ -2476,7 +2476,7 @@ $as_echo "$as_me: error: \`$ac_var' was +@@ -2469,7 +2469,7 @@ $as_echo "$as_me: error: \`$ac_var' was ac_cache_corrupted=: ;; ,);; *) diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk index 0ea166e77..0ffeef0f6 100644 --- a/toolchain/glibc/common.mk +++ b/toolchain/glibc/common.mk @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=glibc -PKG_VERSION:=2.25 +PKG_VERSION:=2.26 PKG_SOURCE_URL:=@GNU/libc PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 +PKG_HASH:=e54e0a934cd2bc94429be79da5e9385898d2306b9eaf3c92d5a77af96190f6bd PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile index 1bf5598d6..e374e706e 100644 --- a/toolchain/kernel-headers/Makefile +++ b/toolchain/kernel-headers/Makefile @@ -36,13 +36,9 @@ HOST_EXTRACFLAGS= LINUX_HAS_HEADERS_INSTALL:=y KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ - HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ - ARCH=$(LINUX_KARCH) \ + $(KERNEL_MAKE_FLAGS) \ CC="$(KERNEL_CC)" \ - CFLAGS="$(TARGET_CFLAGS)" \ - CROSS_COMPILE=$(TARGET_CROSS) \ - KBUILD_HAVE_NLS=no \ - CONFIG_SHELL=$(BASH) + CFLAGS="$(TARGET_CFLAGS)" define Host/Configure/all mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev diff --git a/toolchain/musl/common.mk b/toolchain/musl/common.mk index 0a45828f7..a94a47557 100644 --- a/toolchain/musl/common.mk +++ b/toolchain/musl/common.mk @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=musl -PKG_VERSION:=1.1.16 +PKG_VERSION:=1.1.18 PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=5f7efb87a28a311ad377dd26adf53715dedb096d -PKG_MIRROR_HASH:=da18ef24f270e5cae6bc4c440479da17bec1949ae5a1bc990352ca04f24c4378 +PKG_SOURCE_VERSION:=72656157f54c47277b01ec85a6ba7c4084fea6c8 +PKG_MIRROR_HASH:=a3d857c23c94aa96a4ad5f442aaf236e5a189a717273c4e4faf425988d98cd32 PKG_SOURCE_URL:=git://git.musl-libc.org/musl PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz diff --git a/toolchain/musl/patches/900-iconv_size_hack.patch b/toolchain/musl/patches/900-iconv_size_hack.patch index 343915fb0..41cff5b03 100644 --- a/toolchain/musl/patches/900-iconv_size_hack.patch +++ b/toolchain/musl/patches/900-iconv_size_hack.patch @@ -1,14 +1,14 @@ --- a/src/locale/iconv.c +++ b/src/locale/iconv.c -@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = +@@ -42,6 +42,7 @@ static const unsigned char charmaps[] = "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" "ucs4le\0utf32le\0\0\303" "ascii\0usascii\0iso646\0iso646us\0\0\307" +#ifdef FULL_ICONV "eucjp\0\0\320" "shiftjis\0sjis\0\0\321" - "gb18030\0\0\330" -@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = + "iso2022jp\0\0\322" +@@ -50,6 +51,7 @@ static const unsigned char charmaps[] = "gb2312\0\0\332" "big5\0bigfive\0cp950\0big5hkscs\0\0\340" "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" @@ -16,7 +16,7 @@ #include "codepages.h" ; -@@ -53,6 +55,7 @@ static const unsigned short legacy_chars +@@ -60,6 +62,7 @@ static const unsigned short legacy_chars #include "legacychars.h" }; @@ -24,45 +24,77 @@ static const unsigned short jis0208[84][94] = { #include "jis0208.h" }; -@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { +@@ -79,6 +82,7 @@ static const unsigned short hkscs[] = { static const unsigned short ksc[93][94] = { #include "ksc.h" }; +#endif - static int fuzzycmp(const unsigned char *a, const unsigned char *b) + static const unsigned short rev_jis[] = { + #include "revjis.h" +@@ -196,6 +200,7 @@ static unsigned legacy_map(const unsigne + return x < 256 ? x : legacy_chars[x-256]; + } + ++#ifdef FULL_ICONV + static unsigned uni_to_jis(unsigned c) { -@@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric + unsigned nel = sizeof rev_jis / sizeof *rev_jis; +@@ -214,6 +219,7 @@ static unsigned uni_to_jis(unsigned c) + } + } + } ++#endif + + size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restrict out, size_t *restrict outb) + { +@@ -285,6 +291,7 @@ size_t iconv(iconv_t cd, char **restrict c = ((c-0xd7c0)<<10) + (d-0xdc00); } break; +#ifdef FULL_ICONV case SHIFT_JIS: + if (c < 128) break; if (c-0xa1 <= 0xdf-0xa1) { - c += 0xff61-0xa1; -@@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric +@@ -476,6 +483,7 @@ size_t iconv(iconv_t cd, char **restrict c = ksc[c][d]; if (!c) goto ilseq; break; +#endif default: - if (c < 128+type) break; - c -= 128+type; + if (!c) break; + c = legacy_map(map, c); +@@ -516,6 +524,7 @@ size_t iconv(iconv_t cd, char **restrict + } + } + goto subst; ++#ifdef FULL_ICONV + case SHIFT_JIS: + if (c < 128) goto revout; + if (c == 0xa5) { +@@ -589,6 +598,7 @@ size_t iconv(iconv_t cd, char **restrict + *(*out)++ = 'B'; + *outb -= 8; + break; ++#endif + case UCS2BE: + case UCS2LE: + case UTF_16BE: --- a/src/locale/codepages.h +++ b/src/locale/codepages.h -@@ -118,6 +118,7 @@ - "\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40" - "\230\0\0\0\0\0\44\341\12\0" +@@ -129,6 +129,7 @@ + "\340\204\43\316\100\344\34\144\316\71\350\244\243\316\72\354\264\343\316\73" + "\21\361\44\317\74\364\30\145\17\124\146\345\243\317\76\374\134\304\327\77" +#ifdef FULL_ICONV "cp1250\0" "windows1250\0" - "\0\0" -@@ -214,6 +215,7 @@ - "\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0" - "\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0" - "\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0" + "\0\40" +@@ -239,6 +240,7 @@ + "\20\105\163\330\64\324\324\145\315\65\330\144\243\315\66\334\334\145\330\67" + "\340\204\43\316\100\344\224\143\316\71\350\244\243\316\72\205\265\343\316\73" + "\21\305\203\330\74\364\330\145\317\75\370\344\243\317\76\374\340\65\362\77" +#endif "koi8r\0" - "\0\0" + "\0\40" From 761ccf5cf565c6bb293d6cca1d327f714ea588ab Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 19 Dec 2017 15:35:01 +0800 Subject: [PATCH 42/95] udpate version to R7.5.1 --- package/lean/default-settings/Makefile | 2 +- package/lean/default-settings/files/zzz-default-settings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index c34bfa4dd..b1e4f1951 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=27 +PKG_RELEASE:=28 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index 96a56c050..55868f54e 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -47,7 +47,7 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.5 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5.1 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release echo "DISTRIB_DESCRIPTION='OpenWrt 17.01.4'" >> /etc/openwrt_release From 03e969ff384443079b40b171b05b2b232aacf631 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 25 Dec 2017 10:45:33 +0800 Subject: [PATCH 43/95] update kernel 4.4/4.9 to the lastest version --- README | Bin 4570 -> 4564 bytes include/kernel-version.mk | 8 +- package/libs/libiconv-full/Makefile | 2 +- .../patches-4.9/300-add-ac49x-platform.patch | 2 +- .../432-spi-rb4xx-spi-driver.patch | 2 +- .../433-spi-rb4xx-cpld-driver.patch | 2 +- .../patches-4.9/435-spi-vsc7385_driver.patch | 2 +- ...U-port-fixes-for-devices-not-using-p.patch | 4 +- .../950-0031-Add-dwc_otg-driver.patch | 2 +- ...o_user-and-__copy_from_user-performa.patch | 2 +- .../brcm63xx/base-files/etc/board.d/01_leds | 3 + .../base-files/etc/board.d/02_network | 1 + target/linux/brcm63xx/base-files/etc/diag.sh | 3 + .../linux/brcm63xx/base-files/lib/brcm63xx.sh | 3 + target/linux/brcm63xx/config-4.4 | 1 + target/linux/brcm63xx/dts/a226g.dts | 5 + target/linux/brcm63xx/dts/a226m-fwb.dts | 5 + target/linux/brcm63xx/dts/a226m.dts | 5 + target/linux/brcm63xx/dts/a4001n.dts | 5 + target/linux/brcm63xx/dts/a4001n1.dts | 5 + target/linux/brcm63xx/dts/ad1018-nor.dts | 141 ++ target/linux/brcm63xx/dts/agpf-s0.dts | 5 + target/linux/brcm63xx/dts/ar-5315u.dts | 5 + target/linux/brcm63xx/dts/ar-5381u.dts | 5 + target/linux/brcm63xx/dts/ar-5387un.dts | 5 + target/linux/brcm63xx/dts/ar1004g.dts | 5 + target/linux/brcm63xx/dts/av4202n.dts | 5 + target/linux/brcm63xx/dts/bcm3368.dtsi | 28 + target/linux/brcm63xx/dts/bcm6318.dtsi | 14 + target/linux/brcm63xx/dts/bcm63268.dtsi | 28 + target/linux/brcm63xx/dts/bcm6328.dtsi | 28 + target/linux/brcm63xx/dts/bcm6338.dtsi | 14 + target/linux/brcm63xx/dts/bcm6345.dtsi | 14 + target/linux/brcm63xx/dts/bcm6348.dtsi | 14 + target/linux/brcm63xx/dts/bcm6358.dtsi | 28 + target/linux/brcm63xx/dts/bcm6362.dtsi | 28 + target/linux/brcm63xx/dts/bcm6368.dtsi | 28 + target/linux/brcm63xx/dts/bcm96318ref.dts | 5 + .../linux/brcm63xx/dts/bcm96318ref_p300.dts | 5 + .../linux/brcm63xx/dts/bcm963268bu_p300.dts | 5 + target/linux/brcm63xx/dts/bcm963269bhr.dts | 5 + target/linux/brcm63xx/dts/bcm963281TAN.dts | 5 + target/linux/brcm63xx/dts/bcm96328avng.dts | 5 + target/linux/brcm63xx/dts/bcm96338GW.dts | 5 + target/linux/brcm63xx/dts/bcm96338W.dts | 5 + target/linux/brcm63xx/dts/bcm96345GW2.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW-10.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW-11.dts | 5 + target/linux/brcm63xx/dts/bcm96348GW.dts | 5 + target/linux/brcm63xx/dts/bcm96348R.dts | 5 + target/linux/brcm63xx/dts/bcm96358VW.dts | 5 + target/linux/brcm63xx/dts/bcm96358VW2.dts | 5 + target/linux/brcm63xx/dts/bcm96368MVNgr.dts | 5 + target/linux/brcm63xx/dts/bcm96368MVWG.dts | 5 + target/linux/brcm63xx/dts/cpva502plus.dts | 5 + target/linux/brcm63xx/dts/cpva642.dts | 5 + target/linux/brcm63xx/dts/ct-5365.dts | 5 + target/linux/brcm63xx/dts/ct-6373.dts | 5 + target/linux/brcm63xx/dts/ct536plus.dts | 5 + target/linux/brcm63xx/dts/cvg834g.dts | 9 + target/linux/brcm63xx/dts/dg834g_v4.dts | 5 + target/linux/brcm63xx/dts/dg834gtpn.dts | 5 + target/linux/brcm63xx/dts/dgnd3700v1.dts | 5 + target/linux/brcm63xx/dts/dsl-2640b-b.dts | 5 + target/linux/brcm63xx/dts/dsl-2640u.dts | 5 + target/linux/brcm63xx/dts/dsl-2650u.dts | 5 + target/linux/brcm63xx/dts/dsl-274xb-c.dts | 5 + target/linux/brcm63xx/dts/dsl-274xb-f.dts | 5 + target/linux/brcm63xx/dts/dsl-275xb-d.dts | 5 + target/linux/brcm63xx/dts/dv-201amr.dts | 5 + target/linux/brcm63xx/dts/dva-g3810bn_tl.dts | 5 + target/linux/brcm63xx/dts/evg2000.dts | 5 + target/linux/brcm63xx/dts/f5d7633.dts | 5 + target/linux/brcm63xx/dts/fast2404.dts | 5 + target/linux/brcm63xx/dts/fast2504n.dts | 5 + target/linux/brcm63xx/dts/fast2604.dts | 5 + target/linux/brcm63xx/dts/fast2704n.dts | 5 + target/linux/brcm63xx/dts/fast2704v2.dts | 5 + target/linux/brcm63xx/dts/gw6000.dts | 5 + target/linux/brcm63xx/dts/gw6200.dts | 5 + target/linux/brcm63xx/dts/hg520v.dts | 5 + target/linux/brcm63xx/dts/hg553.dts | 5 + target/linux/brcm63xx/dts/hg556a-a.dts | 5 + target/linux/brcm63xx/dts/hg556a-b.dts | 5 + target/linux/brcm63xx/dts/hg556a-c.dts | 5 + target/linux/brcm63xx/dts/hg622.dts | 5 + target/linux/brcm63xx/dts/hg655b.dts | 5 + target/linux/brcm63xx/dts/homehub2a.dts | 5 + target/linux/brcm63xx/dts/livebox-blue-5g.dts | 5 + target/linux/brcm63xx/dts/magic.dts | 5 + target/linux/brcm63xx/dts/nb4-fxc-r1.dts | 5 + target/linux/brcm63xx/dts/nb4-ser-r0.dts | 5 + target/linux/brcm63xx/dts/nb6-ser-r0.dts | 5 + target/linux/brcm63xx/dts/p870hw-51a-v2.dts | 5 + target/linux/brcm63xx/dts/r1000h.dts | 9 + target/linux/brcm63xx/dts/r5010unv2.dts | 5 + target/linux/brcm63xx/dts/rg100a.dts | 5 + target/linux/brcm63xx/dts/rta1025w.dts | 5 + target/linux/brcm63xx/dts/rta1320.dts | 5 + target/linux/brcm63xx/dts/rta770bw.dts | 5 + target/linux/brcm63xx/dts/rta770w.dts | 5 + target/linux/brcm63xx/dts/spw303v.dts | 5 + target/linux/brcm63xx/dts/spw500v.dts | 5 + target/linux/brcm63xx/dts/td-w8900gb.dts | 5 + target/linux/brcm63xx/dts/usr9108.dts | 5 + target/linux/brcm63xx/dts/v2110.dts | 5 + target/linux/brcm63xx/dts/v2500v-bb.dts | 5 + target/linux/brcm63xx/dts/vg50.dts | 5 + target/linux/brcm63xx/dts/vh4032n.dts | 5 + target/linux/brcm63xx/dts/vr-3025u.dts | 5 + target/linux/brcm63xx/dts/vr-3025un.dts | 5 + target/linux/brcm63xx/dts/vr-3026e.dts | 5 + target/linux/brcm63xx/dts/wap-5813n.dts | 5 + target/linux/brcm63xx/image/bcm63xx.mk | 12 + ...-mtd-nand-spi-nor-assign-MTD-of_node.patch | 2 +- ...cm63xx_uart-use-correct-alias-naming.patch | 37 + ...07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch | 192 ++ ...-reset-after-releasing-PHYs-from-res.patch | 43 + ...us-handle-only-single-PHY-reset-GPIO.patch | 120 + ...mdio_bus-use-devm_gpiod_get_optional.patch | 39 + ...PS-BCM63XX-add-clkdev-lookup-support.patch | 210 ++ ...vide-periph-clock-as-refclk-for-uart.patch | 84 + ...-use-refclk-for-the-expected-clock-n.patch | 26 + ...rt-allow-naming-clock-in-device-tree.patch | 55 + ...e-the-HSSPI-PLL-HZ-into-its-own-cloc.patch | 62 + ...vide-enet-clocks-as-enet-to-the-ethe.patch | 60 + ...M63XX-split-out-swpkt_sar-usb-clocks.patch | 105 + ...-08-bcm63xx_enet-correct-clock-usage.patch | 101 + ...not-write-to-random-DMA-channel-on-B.patch | 29 + ...63xx_enet-do-not-rely-on-probe-order.patch | 41 + ...-managed-functions-for-clock-ioremap.patch | 150 ++ ...net-drop-unneeded-NULL-phy_clk-check.patch | 36 + ...bcm63xx_enet-remove-unneeded-include.patch | 22 + ...63XX-add-USB-host-clock-enable-delay.patch | 2 +- ...-USB-device-clock-enable-delay-to-cl.patch | 2 +- ...XX-allow-NULL-clock-for-clk_get_rate.patch | 2 +- .../130-pinctrl-add-bcm63xx-base-code.patch | 2 +- ...-add-a-pincontrol-driver-for-BCM6368.patch | 2 +- ...IPS-BCM63XX-add-support-for-BCM63268.patch | 73 +- ...MIPS-BCM63XX-add-support-for-BCM6318.patch | 40 +- ...BCM63XX-add-PCIe-support-for-BCM6318.patch | 13 +- ...-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch | 22 +- ...-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch | 4 +- ...t-use-named-gpio-for-ephy-reset-gpio.patch | 46 - ...-register-lookup-for-ephy-reset-gpio.patch | 2 +- ...81-net-bcm63xx_enet-fully-reset-ephy.patch | 28 - ...X-add-clkdev-lookups-for-device-tree.patch | 105 + ...63XX-do-not-register-SPI-controllers.patch | 135 ++ ...91-MIPS-BCM63XX-do-not-register-uart.patch | 257 ++ ...IPS-BCM63XX-remove-leds-and-buttons.patch} | 36 +- .../403-6358-enet1-external-mii-clk.patch | 2 +- ...-move-phy_-dis-connect-into-probe-re.patch | 14 +- ...enable-rgmii-clock-on-external-ports.patch | 2 +- ...CM63XX-Register-SPI-flash-if-present.patch | 18 +- ...w-providing-fixup-data-in-board-data.patch | 12 +- ...M63XX-export-the-attached-flash-type.patch | 2 +- ...CM63XX-add-a-fixup-for-ath9k-devices.patch | 5 +- ...0-BCM63XX-add-endian-check-for-ath9k.patch | 4 +- .../421-BCM63XX-add-led-pin-for-ath9k.patch | 4 +- ...M63XX-add-a-fixup-for-rt2x00-devices.patch | 8 +- .../423-bcm63xx_enet_add_b53_support.patch | 30 +- ...4-bcm63xx_enet_no_request_mem_region.patch | 20 +- .../patches-4.4/427-boards_probe_switch.patch | 46 +- ...low_better_context_for_board_patches.patch | 20 +- .../brcm63xx/patches-4.4/500-board-D4PW.patch | 7 +- .../brcm63xx/patches-4.4/501-board-NB4.patch | 8 +- .../patches-4.4/502-board-96338W2_E7T.patch | 8 +- .../patches-4.4/503-board-CPVA642.patch | 9 +- .../504-board_dsl_274xb_rev_c.patch | 7 +- .../patches-4.4/505-board_spw500v.patch | 7 +- .../patches-4.4/506-board_gw6200_gw6000.patch | 8 +- .../patches-4.4/507-board-MAGIC.patch | 7 +- .../patches-4.4/508-board_hw553.patch | 8 +- .../patches-4.4/509-board_rta1320_16m.patch | 7 +- .../patches-4.4/510-board_spw303v.patch | 7 +- .../patches-4.4/511-board_V2500V.patch | 13 +- .../patches-4.4/512-board_BTV2110.patch | 9 +- ...BCM63XX-add-inventel-Livebox-support.patch | 5 +- .../patches-4.4/514-board_ct536_ct5621.patch | 7 +- .../patches-4.4/515-board_DWV-S0_fixes.patch | 11 +- .../patches-4.4/516-board_96348A-122.patch | 7 +- .../517-RTA1205W_16_uart_fixes.patch | 10 - .../patches-4.4/519_board_CPVA502plus.patch | 7 +- ...63xx-add-support-for-96368MVWG-board.patch | 9 +- ...3xx-add-support-for-96368MVNgr-board.patch | 7 +- ...CM63XX-add-96328avng-reference-board.patch | 6 +- ...CM63XX-add-963281TAN-reference-board.patch | 7 +- .../524-board_dsl_274xb_rev_f.patch | 7 +- .../patches-4.4/525-board_96348w3.patch | 7 +- .../patches-4.4/526-board_CT6373-1.patch | 7 +- .../527-board_dva-g3810bn-tl-1.patch | 7 +- .../brcm63xx/patches-4.4/528-board_nb6.patch | 8 +- .../patches-4.4/529-board_fast2604.patch | 7 +- .../patches-4.4/530-board_A4001N1.patch | 7 +- .../patches-4.4/531-board_AR-5387un.patch | 7 +- .../patches-4.4/532-board_AR-5381u.patch | 7 +- .../patches-4.4/533-board_rta770bw.patch | 12 +- .../patches-4.4/534-board_hw556.patch | 9 +- .../patches-4.4/535-board_rta770w.patch | 8 +- .../patches-4.4/536-board_fast2704.patch | 7 +- .../patches-4.4/537-board_fast2504n.patch | 8 +- .../patches-4.4/555-board_96318ref.patch | 7 +- .../patches-4.4/556-board_96318ref_p300.patch | 7 +- .../patches-4.4/557-board_bcm963269bhr.patch | 8 +- .../patches-4.4/558-board_AR1004G.patch | 7 +- .../patches-4.4/559-board_vw6339gu.patch | 8 +- .../patches-4.4/560-board_963268gu_p300.patch | 8 +- .../patches-4.4/561-board_WAP-5813n.patch | 7 +- .../patches-4.4/562-board_VR-3025u.patch | 7 +- .../patches-4.4/563-board_VR-3025un.patch | 7 +- .../patches-4.4/564-board_P870HW-51a_v2.patch | 7 +- .../patches-4.4/565-board_hw520.patch | 7 +- .../patches-4.4/566-board_A4001N.patch | 7 +- .../patches-4.4/567-board_dsl-2751b_e1.patch | 7 +- .../568-board_DGND3700v1_3800B.patch | 7 +- .../patches-4.4/569-board_homehub2a.patch | 7 +- .../patches-4.4/570-board_HG655b.patch | 7 +- .../patches-4.4/571-board_fast2704n.patch | 7 +- .../patches-4.4/572-board_VR-3026e.patch | 7 +- .../patches-4.4/573-board_R5010UNv2.patch | 7 +- .../patches-4.4/574-board_HG622.patch | 7 +- .../patches-4.4/575-board_EVG2000.patch | 7 +- .../patches-4.4/576-board_AV4202N.patch | 7 +- .../patches-4.4/577-board_VH4032N.patch | 7 +- .../patches-4.4/578-board_R1000H.patch | 8 +- .../patches-4.4/579-board_AR-5315u.patch | 7 +- .../patches-4.4/580-board_AD1018.patch | 92 + .../804-bcm63xx_enet_63268_rgmii_ports.patch | 2 +- .../011-kbuild-export-SUBARCH.patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 6 +- target/linux/generic/config-4.14 | 5 + .../hack-4.9/202-reduce_module_size.patch | 6 +- .../hack-4.9/207-disable-modorder.patch | 4 +- .../generic/hack-4.9/220-gc_sections.patch | 6 +- .../301-mips_image_cmdline_hack.patch | 2 +- .../321-powerpc_crtsavres_prereq.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../002-phy_drivers_backport.patch | 16 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 6 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../pending-4.4/630-packet_socket_type.patch | 18 +- ...ng-with-source-address-failed-policy.patch | 8 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- .../generic/pending-4.4/721-phy_packets.patch | 2 +- .../pending-4.4/902-debloat_proc.patch | 8 +- .../pending-4.4/904-debloat_dma_buf.patch | 2 +- ...e_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- .../pending-4.9/201-extra_optimization.patch | 2 +- ...mtd-device-named-ubi-or-data-on-boot.patch | 4 +- .../494-mtd-ubi-add-EOF-marker-support.patch | 2 +- .../pending-4.9/630-packet_socket_type.patch | 18 +- target/linux/ixp4xx/Makefile | 5 +- target/linux/ixp4xx/config-4.9 | 247 ++ .../patches-4.4/160-delayed_uart_io.patch | 4 +- .../207-npe_driver_multiphy_support.patch | 28 +- ...ohorent_dma_mask-for-ethernet-platfo.patch | 136 ++ ...se-parent-device-for-dma-allocations.patch | 95 + .../patches-4.9/020-gateworks_i2c_pld.patch | 424 ++++ .../patches-4.9/030-gpio_line_config.patch | 73 + .../patches-4.9/040-arm_mach_types.patch | 18 + .../090-increase_entropy_pools.patch | 17 + ...00-wg302v2_gateway7001_mac_plat_info.patch | 78 + .../patches-4.9/105-wg302v1_support.patch | 261 ++ .../110-pronghorn_series_support.patch | 393 ++++ .../111-pronghorn_swap_uarts.patch | 44 + .../patches-4.9/115-sidewinder_support.patch | 286 +++ .../116-sidewinder_fis_location.patch | 30 + .../patches-4.9/120-compex_support.patch | 199 ++ .../patches-4.9/130-wrt300nv2_support.patch | 227 ++ .../131-wrt300nv2_mac_plat_info.patch | 42 + .../patches-4.9/132-wrt300nv2_mac_fix.patch | 72 + .../150-lanready_ap1000_support.patch | 201 ++ .../151-lanready_ap1000_mac_plat_info.patch | 44 + .../patches-4.9/160-delayed_uart_io.patch | 133 ++ .../patches-4.9/162-wg302v1_mem_fixup.patch | 37 + .../170-ixdpg425_mac_plat_info.patch | 51 + .../175-avila_hss_audio_support.patch | 2093 +++++++++++++++++ .../patches-4.9/180-tw5334_support.patch | 287 +++ .../patches-4.9/185-mi424wr_support.patch | 504 ++++ .../patches-4.9/190-cambria_support.patch | 1131 +++++++++ ...01-npe_driver_print_license_location.patch | 11 + ...05-npe_driver_separate_phy_functions.patch | 127 + ...-npe_driver_add_update_link_function.patch | 100 + .../207-npe_driver_multiphy_support.patch | 153 ++ .../patches-4.9/295-latch_led_driver.patch | 201 ++ .../patches-4.9/300-avila_support.patch | 726 ++++++ .../304-ixp4xx_eth_jumboframe.patch | 6 +- .../patches-4.9/310-gtwx5717_spi_bus.patch | 57 + .../311-gtwx5717_mac_plat_info.patch | 50 + .../312-ixp4xx_pata_optimization.patch | 137 ++ .../patches-4.9/500-usr8200_support.patch | 347 +++ .../patches-4.9/520-tw2662_support.patch | 316 +++ .../patches-4.9/530-ap42x_support.patch | 282 +++ .../patches-4.9/600-skb_avoid_dmabounce.patch | 23 + .../900-ixp4xx-crypto-include-module.h.patch | 10 + .../patches-4.9/910-ixp4xx-nr_irq_lines.patch | 22 + ...dd-support-for-Lantiq-SSC-SPI-contro.patch | 2 +- .../lantiq/patches-4.9/0152-lantiq-VPE.patch | 2 +- .../804-crypto-support-layerscape.patch | 94 +- .../807-gpu-support-layerscape.patch | 16 +- .../810-iommu-support-layerscape.patch | 8 +- ...ackport-v4.7-0day-patches-from-Boris.patch | 42 +- ...mtd-nand-import-nand_hw_control_init.patch | 2 +- .../oxnas/patches-4.4/330-oxnas-pinctrl.patch | 2 +- ...25-pinctrl-ralink-add-pinctrl-driver.patch | 2 +- ...IO-ralink-add-mt7621-gpio-controller.patch | 2 +- ...SPI-ralink-add-Ralink-SoC-spi-driver.patch | 2 +- .../0043-spi-add-mt7621-support.patch | 2 +- .../patches-4.9/0050-stmmac-form-4-10.patch | 100 +- .../patches-4.9/0051-stmmac-form-4-11.patch | 22 +- .../patches-4.9/0052-stmmac-form-4-12.patch | 100 +- .../patches-4.9/0053-stmmac-form-4-13.patch | 16 +- 314 files changed, 13186 insertions(+), 888 deletions(-) create mode 100644 target/linux/brcm63xx/dts/ad1018-nor.dts create mode 100644 target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch create mode 100644 target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch delete mode 100644 target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch delete mode 100644 target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch create mode 100644 target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch create mode 100644 target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch rename target/linux/brcm63xx/patches-4.4/{550-MIPS-BCM63XX-remove-leds-and-buttons.patch => 392-MIPS-BCM63XX-remove-leds-and-buttons.patch} (85%) delete mode 100644 target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch create mode 100644 target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch create mode 100644 target/linux/ixp4xx/config-4.9 create mode 100644 target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch create mode 100644 target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch create mode 100644 target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch create mode 100644 target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch create mode 100644 target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch create mode 100644 target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch create mode 100644 target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch create mode 100644 target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch create mode 100644 target/linux/ixp4xx/patches-4.9/120-compex_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch create mode 100644 target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch create mode 100644 target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch create mode 100644 target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/190-cambria_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch create mode 100644 target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch create mode 100644 target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch create mode 100644 target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch create mode 100644 target/linux/ixp4xx/patches-4.9/300-avila_support.patch rename target/linux/ixp4xx/{patches-4.4 => patches-4.9}/304-ixp4xx_eth_jumboframe.patch (90%) create mode 100644 target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch create mode 100644 target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch create mode 100644 target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch create mode 100644 target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch create mode 100644 target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch create mode 100644 target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch create mode 100644 target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch diff --git a/README b/README index 67e86acf72892f6e0a204dfb965554dd29352760..ca910714b1bad99a97e513f35af2895b5de0a8f4 100644 GIT binary patch delta 20 ccmcbmd_{S~HD>l4hE#?WhSbfEnZNS_091|#yZ`_I delta 15 Xcmcbjd`o%5HRg#f0-GN&f8hlHI^zcV diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 623d20493..762c2a723 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,13 +3,13 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .100 -LINUX_VERSION-4.9 = .67 +LINUX_VERSION-4.4 = .107 +LINUX_VERSION-4.9 = .70 LINUX_VERSION-4.14 = .6 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.100 = 9936cd99c4bd35f6bc6962c9acdd1fa2ac8999e07a9be6a94a03b5492f1bd14f -LINUX_KERNEL_HASH-4.9.67 = 7fbaa7dcc17877dfa0c96fb9a7d2f4ffed20ceeb13cbbeb18d77213c6cf75f7d +LINUX_KERNEL_HASH-4.4.107 = d25dc23c8b05d34518ede68f03668cd344f805049a16bc4f189da90533881a17 +LINUX_KERNEL_HASH-4.9.70 = baaf45f3826fa0d257a42005240cced402a12c99adf2a8d77402738304d5300a LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc ifdef KERNEL_PATCHVER diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index 9776711a7..ac7bfddf5 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -51,7 +51,7 @@ define Package/iconv TITLE+= utility endef -TARGET_CFLAGS += $(FPIC) -DUSE_DOS +TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89 CONFIGURE_ARGS += \ --enable-shared \ diff --git a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch index c17ae69aa..67ed3e494 100644 --- a/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch +++ b/target/linux/ar7/patches-4.9/300-add-ac49x-platform.patch @@ -46,7 +46,7 @@ config ATH25 bool "Atheros AR231x/AR531x SoC support" -@@ -1002,6 +1002,7 @@ config MIPS_PARAVIRT +@@ -1004,6 +1004,7 @@ config MIPS_PARAVIRT endchoice source "arch/mips/alchemy/Kconfig" diff --git a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch index 5428d3d1c..e896d0bdf 100644 --- a/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch +++ b/target/linux/ar71xx/patches-4.9/432-spi-rb4xx-spi-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -534,6 +534,12 @@ config SPI_QUP +@@ -533,6 +533,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch index b1cd6a545..c44acab32 100644 --- a/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch +++ b/target/linux/ar71xx/patches-4.9/433-spi-rb4xx-cpld-driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -762,6 +762,13 @@ config SPI_TLE62X0 +@@ -761,6 +761,13 @@ config SPI_TLE62X0 sysfs interface, with each line presented as a kind of GPIO exposing both switch control and diagnostic feedback. diff --git a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch index fe6acde70..f9f1f7a1e 100644 --- a/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch +++ b/target/linux/ar71xx/patches-4.9/435-spi-vsc7385_driver.patch @@ -1,6 +1,6 @@ --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -769,6 +769,11 @@ config SPI_RB4XX_CPLD +@@ -768,6 +768,11 @@ config SPI_RB4XX_CPLD SPI driver for the Xilinx CPLD chip present on the MikroTik RB4xx boards. diff --git a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 244a4a658..91bb4fae1 100644 --- a/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.4/710-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -13,7 +13,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/phy/b53/b53_common.c +++ b/drivers/net/phy/b53/b53_common.c -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: Rafał Miłecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1578,6 +1579,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de return ret; } diff --git a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch index c3862fc07..8569e4a83 100644 --- a/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch +++ b/target/linux/brcm2708/patches-4.9/950-0031-Add-dwc_otg-driver.patch @@ -696,7 +696,7 @@ Signed-off-by: Noralf Trønnes } --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c -@@ -5045,7 +5045,7 @@ static void port_event(struct usb_hub *h +@@ -5054,7 +5054,7 @@ static void port_event(struct usb_hub *h if (portchange & USB_PORT_STAT_C_OVERCURRENT) { u16 status = 0, unused; diff --git a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch index a7ce64ba3..016d48dd2 100644 --- a/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch +++ b/target/linux/brcm2708/patches-4.9/950-0063-Improve-__copy_to_user-and-__copy_from_user-performa.patch @@ -65,7 +65,7 @@ Signed-off-by: Phil Elwell +__copy_from_user_std(void *to, const void __user *from, unsigned long n); + static inline unsigned long __must_check - __copy_from_user(void *to, const void __user *from, unsigned long n) + __arch_copy_from_user(void *to, const void __user *from, unsigned long n) { --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile diff --git a/target/linux/brcm63xx/base-files/etc/board.d/01_leds b/target/linux/brcm63xx/base-files/etc/board.d/01_leds index ef70cde79..d25d37e84 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/01_leds +++ b/target/linux/brcm63xx/base-files/etc/board.d/01_leds @@ -15,6 +15,9 @@ a4001n1) a4001n) ucidef_set_led_usbdev "usb" "USB" "A4001N:green:usb" "1-1" ;; +ad1018-nor) + ucidef_set_led_netdev "wlan0" "WLAN" "AD1018:green:wifi" "wlan0" + ;; ar-5315u) ucidef_set_led_usbdev "usb" "USB" "AR-5315u:green:usb" "1-1" ;; diff --git a/target/linux/brcm63xx/base-files/etc/board.d/02_network b/target/linux/brcm63xx/base-files/etc/board.d/02_network index 9addba654..06b4b6ece 100755 --- a/target/linux/brcm63xx/base-files/etc/board.d/02_network +++ b/target/linux/brcm63xx/base-files/etc/board.d/02_network @@ -98,6 +98,7 @@ vr-3026e) "0:lan:1" "1:lan:2" "2:lan:3" "3:lan:4" "8t@eth0" ;; +ad1018-nor|\ ar-5315u |\ vh4032n) ucidef_add_switch "switch0" \ diff --git a/target/linux/brcm63xx/base-files/etc/diag.sh b/target/linux/brcm63xx/base-files/etc/diag.sh index 700c9ea85..acb179521 100644 --- a/target/linux/brcm63xx/base-files/etc/diag.sh +++ b/target/linux/brcm63xx/base-files/etc/diag.sh @@ -12,6 +12,9 @@ set_state() { a4001n) status_led="A4001N:green:power" ;; + ad1018-nor) + status_led="AD1018:green:power" + ;; ar-5315u) status_led="AR-5315u:green:power" ;; diff --git a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh index 3f46633fa..82abd737c 100755 --- a/target/linux/brcm63xx/base-files/lib/brcm63xx.sh +++ b/target/linux/brcm63xx/base-files/lib/brcm63xx.sh @@ -228,6 +228,9 @@ brcm63xx_dt_detect() { "Sagem F@ST2704V2") board_name="fast2704v2" ;; + "Sercomm AD1018 (SPI flash mod)") + board_name="ad1018-nor" + ;; "SFR Neuf Box 4"*) board_name="neufbox4" ;; diff --git a/target/linux/brcm63xx/config-4.4 b/target/linux/brcm63xx/config-4.4 index f74459be3..755590f53 100644 --- a/target/linux/brcm63xx/config-4.4 +++ b/target/linux/brcm63xx/config-4.4 @@ -47,6 +47,7 @@ CONFIG_BOARD_BCM963XX=y CONFIG_BOARD_LIVEBOX=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y +CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y CONFIG_CPU_BIG_ENDIAN=y CONFIG_CPU_BMIPS=y diff --git a/target/linux/brcm63xx/dts/a226g.dts b/target/linux/brcm63xx/dts/a226g.dts index f7a0b72b7..921e46c79 100644 --- a/target/linux/brcm63xx/dts/a226g.dts +++ b/target/linux/brcm63xx/dts/a226g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m-fwb.dts b/target/linux/brcm63xx/dts/a226m-fwb.dts index 43a82bbe1..c21d06ec5 100644 --- a/target/linux/brcm63xx/dts/a226m-fwb.dts +++ b/target/linux/brcm63xx/dts/a226m-fwb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a226m.dts b/target/linux/brcm63xx/dts/a226m.dts index 269c4edea..7c8bdabf7 100644 --- a/target/linux/brcm63xx/dts/a226m.dts +++ b/target/linux/brcm63xx/dts/a226m.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -111,3 +112,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n.dts b/target/linux/brcm63xx/dts/a4001n.dts index d29b834a3..db835434d 100644 --- a/target/linux/brcm63xx/dts/a4001n.dts +++ b/target/linux/brcm63xx/dts/a4001n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -90,3 +91,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/a4001n1.dts b/target/linux/brcm63xx/dts/a4001n1.dts index 325489730..ad1590d7a 100644 --- a/target/linux/brcm63xx/dts/a4001n1.dts +++ b/target/linux/brcm63xx/dts/a4001n1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -118,3 +119,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ad1018-nor.dts b/target/linux/brcm63xx/dts/ad1018-nor.dts new file mode 100644 index 000000000..7a630a185 --- /dev/null +++ b/target/linux/brcm63xx/dts/ad1018-nor.dts @@ -0,0 +1,141 @@ +/dts-v1/; + +#include "bcm6328.dtsi" + +#include + +/ { + model = "Sercomm AD1018 (SPI flash mod)"; + compatible = "sercomm,ad1018-nor", "brcm,bcm6328"; + + chosen { + bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + debounce-interval = <60>; + + wps { + label = "wps"; + gpios = <&pinctrl 24 1>; + linux,code = ; + }; + wifi { + label = "wifi"; + gpios = <&pinctrl 25 1>; + linux,code = ; + }; + reset { + label = "reset"; + gpios = <&pinctrl 31 1>; + linux,code = ; + }; + }; + +}; + +&pinctrl { + pinctrl_leds: leds { + function = "led"; + pins = "gpio0", "gpio1"; + }; +}; + +&leds { + status = "ok"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_leds &pinctrl_serial_led + &pinctrl_ephy0_spd_led &pinctrl_ephy1_act_led + &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; + + brcm,serial-leds; + brcm,serial-shift-inv; + brcm,serial-dat-low; + + inet_red@0 { + reg = <0>; + active-low; + label = "AD1018:red:internet"; + }; + + inet_green@1 { + reg = <1>; + active-low; + label = "AD1018:green:internet"; + }; + + power_green@8 { + reg = <8>; + active-low; + label = "AD1018:green:power"; + default-state = "on"; + }; + + adsl_green@10 { + reg = <10>; + active-low; + label = "AD1018:green:adsl"; + }; + + adsl_red@11 { + reg = <11>; + active-low; + label = "AD1018:red:adsl"; + }; + + phone_green@12 { + reg = <12>; + active-low; + label = "AD1018:green:phone"; + }; + + wps_green@13 { + reg = <13>; + active-low; + label = "AD1018:green:wps"; + }; + + wifi_green@14 { + reg = <14>; + active-low; + label = "AD1018:green:wifi"; + }; + + usb_green@15 { + reg = <15>; + active-low; + label = "AD1018:green:usb"; + }; + + ephy0_spd@17 { + reg = <17>; + brcm,hardware-controlled; + }; +}; + +&hsspi { + status = "ok"; + + flash@0 { + compatible = "jedec,spi-nor"; + spi-max-frequency = <16666667>; + spi-tx-bus-width = <2>; + spi-rx-bus-width = <2>; + reg = <0>; + + #address-cells = <1>; + #size-cells = <1>; + + linux,part-probe = "bcm63xxpart"; + }; +}; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/agpf-s0.dts b/target/linux/brcm63xx/dts/agpf-s0.dts index be1f9fb4f..6ac3801c3 100644 --- a/target/linux/brcm63xx/dts/agpf-s0.dts +++ b/target/linux/brcm63xx/dts/agpf-s0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -115,3 +116,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5315u.dts b/target/linux/brcm63xx/dts/ar-5315u.dts index 63883f048..e359fe4eb 100644 --- a/target/linux/brcm63xx/dts/ar-5315u.dts +++ b/target/linux/brcm63xx/dts/ar-5315u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -104,3 +105,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5381u.dts b/target/linux/brcm63xx/dts/ar-5381u.dts index 883198c6b..9da5b7e3c 100644 --- a/target/linux/brcm63xx/dts/ar-5381u.dts +++ b/target/linux/brcm63xx/dts/ar-5381u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -77,3 +78,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar-5387un.dts b/target/linux/brcm63xx/dts/ar-5387un.dts index a0e07fb4f..4dd71459f 100644 --- a/target/linux/brcm63xx/dts/ar-5387un.dts +++ b/target/linux/brcm63xx/dts/ar-5387un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -85,3 +86,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ar1004g.dts b/target/linux/brcm63xx/dts/ar1004g.dts index eb6d9a2b2..e7265f4d4 100644 --- a/target/linux/brcm63xx/dts/ar1004g.dts +++ b/target/linux/brcm63xx/dts/ar1004g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -71,3 +72,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_ext_mii &pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/av4202n.dts b/target/linux/brcm63xx/dts/av4202n.dts index 4babd3b12..ef6160788 100644 --- a/target/linux/brcm63xx/dts/av4202n.dts +++ b/target/linux/brcm63xx/dts/av4202n.dts @@ -11,6 +11,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -88,3 +89,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm3368.dtsi b/target/linux/brcm63xx/dts/bcm3368.dtsi index 29dae01d7..66cb6ab8a 100644 --- a/target/linux/brcm63xx/dts/bcm3368.dtsi +++ b/target/linux/brcm63xx/dts/bcm3368.dtsi @@ -7,6 +7,8 @@ pflash = &pflash; gpio0 = &gpio0; gpio1 = &gpio1; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -93,6 +95,32 @@ #gpio-cells = <2>; }; + uart0: serial@fff8c100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fff8c120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfff8c120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fff8c800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6318.dtsi b/target/linux/brcm63xx/dts/bcm6318.dtsi index 7c4505157..a902c1bd5 100644 --- a/target/linux/brcm63xx/dts/bcm6318.dtsi +++ b/target/linux/brcm63xx/dts/bcm6318.dtsi @@ -5,6 +5,7 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; spi1 = &hsspi; }; @@ -166,6 +167,19 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000200 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm63268.dtsi b/target/linux/brcm63xx/dts/bcm63268.dtsi index 94c7dd013..1b4b3e617 100644 --- a/target/linux/brcm63xx/dts/bcm63268.dtsi +++ b/target/linux/brcm63xx/dts/bcm63268.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -193,6 +195,32 @@ }; }; + uart0: serial@10000180 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000180 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <5>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@100001a0 { + compatible = "brcm,bcm6345-uart"; + reg = <0x100001a0 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <34>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6328.dtsi b/target/linux/brcm63xx/dts/bcm6328.dtsi index 7a79aed26..d08b6bab7 100644 --- a/target/linux/brcm63xx/dts/bcm6328.dtsi +++ b/target/linux/brcm63xx/dts/bcm6328.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi1 = &hsspi; }; @@ -151,6 +153,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <28>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <39>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + leds: led-controller@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6338.dtsi b/target/linux/brcm63xx/dts/bcm6338.dtsi index 1811acfed..3d1c06835 100644 --- a/target/linux/brcm63xx/dts/bcm6338.dtsi +++ b/target/linux/brcm63xx/dts/bcm6338.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; gpio0 = &gpio0; + serial0 = &uart0; spi0 = &lsspi; }; @@ -79,6 +80,19 @@ ngpios = <8>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6345.dtsi b/target/linux/brcm63xx/dts/bcm6345.dtsi index b16c132ce..7d5f79be3 100644 --- a/target/linux/brcm63xx/dts/bcm6345.dtsi +++ b/target/linux/brcm63xx/dts/bcm6345.dtsi @@ -5,6 +5,7 @@ aliases { pflash = &pflash; + serial0 = &uart0; gpio0 = &gpio0; }; @@ -67,6 +68,19 @@ interrupts = <3>, <4>, <5>, <6>; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + gpio0: gpio-controller@fffe0404 { compatible = "brcm,bcm6345-gpio"; reg = <0xfffe0404 4>, <0xfffe0408 4>; diff --git a/target/linux/brcm63xx/dts/bcm6348.dtsi b/target/linux/brcm63xx/dts/bcm6348.dtsi index b6dafeeae..f3e17be53 100644 --- a/target/linux/brcm63xx/dts/bcm6348.dtsi +++ b/target/linux/brcm63xx/dts/bcm6348.dtsi @@ -6,6 +6,7 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; spi0 = &lsspi; }; @@ -126,6 +127,19 @@ }; }; + uart0: serial@fffe0300 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0300 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0c00 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6358.dtsi b/target/linux/brcm63xx/dts/bcm6358.dtsi index 8feb3dd61..a78cdef37 100644 --- a/target/linux/brcm63xx/dts/bcm6358.dtsi +++ b/target/linux/brcm63xx/dts/bcm6358.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -163,6 +165,32 @@ status = "disabled"; }; + uart0: serial@fffe0100 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@fffe0120 { + compatible = "brcm,bcm6345-uart"; + reg = <0xfffe0120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@fffe0800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6362.dtsi b/target/linux/brcm63xx/dts/bcm6362.dtsi index 076fc6a3a..2ff5c52ad 100644 --- a/target/linux/brcm63xx/dts/bcm6362.dtsi +++ b/target/linux/brcm63xx/dts/bcm6362.dtsi @@ -5,6 +5,8 @@ aliases { pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; spi1 = &hsspi; }; @@ -237,6 +239,32 @@ }; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <4>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm6368.dtsi b/target/linux/brcm63xx/dts/bcm6368.dtsi index 3efe76c6c..b834f9ef0 100644 --- a/target/linux/brcm63xx/dts/bcm6368.dtsi +++ b/target/linux/brcm63xx/dts/bcm6368.dtsi @@ -6,6 +6,8 @@ aliases { pflash = &pflash; pinctrl = &pinctrl; + serial0 = &uart0; + serial1 = &uart1; spi0 = &lsspi; }; @@ -270,6 +272,32 @@ status = "disabled"; }; + uart0: serial@10000100 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000100 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <2>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + + uart1: serial@10000120 { + compatible = "brcm,bcm6345-uart"; + reg = <0x10000120 0x18>; + + interrupt-parent = <&periph_intc>; + interrupts = <3>; + + /* clocks = <&periph_clk>; */ + /* clock-names = "refclk"; */ + + status = "disabled"; + }; + lsspi: spi@10000800 { #address-cells = <1>; #size-cells = <0>; diff --git a/target/linux/brcm63xx/dts/bcm96318ref.dts b/target/linux/brcm63xx/dts/bcm96318ref.dts index 5780ccba4..e48c0bf46 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -73,3 +74,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts index 8fae7fa78..db9d5eccd 100644 --- a/target/linux/brcm63xx/dts/bcm96318ref_p300.dts +++ b/target/linux/brcm63xx/dts/bcm96318ref_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_pwron>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts index a96bed761..2bccb57a9 100644 --- a/target/linux/brcm63xx/dts/bcm963268bu_p300.dts +++ b/target/linux/brcm63xx/dts/bcm963268bu_p300.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963269bhr.dts b/target/linux/brcm63xx/dts/bcm963269bhr.dts index 4984f8fe7..d3c709877 100644 --- a/target/linux/brcm63xx/dts/bcm963269bhr.dts +++ b/target/linux/brcm63xx/dts/bcm963269bhr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm963281TAN.dts b/target/linux/brcm63xx/dts/bcm963281TAN.dts index a1c5d7ad7..d0d19a355 100644 --- a/target/linux/brcm63xx/dts/bcm963281TAN.dts +++ b/target/linux/brcm63xx/dts/bcm963281TAN.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -59,3 +60,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96328avng.dts b/target/linux/brcm63xx/dts/bcm96328avng.dts index e74a60a1f..d0d67880e 100644 --- a/target/linux/brcm63xx/dts/bcm96328avng.dts +++ b/target/linux/brcm63xx/dts/bcm96328avng.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -64,3 +65,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_usb_port1_device>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338GW.dts b/target/linux/brcm63xx/dts/bcm96338GW.dts index 7815962cd..d6ff449d3 100644 --- a/target/linux/brcm63xx/dts/bcm96338GW.dts +++ b/target/linux/brcm63xx/dts/bcm96338GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96338W.dts b/target/linux/brcm63xx/dts/bcm96338W.dts index 21190706e..f91ca9a39 100644 --- a/target/linux/brcm63xx/dts/bcm96338W.dts +++ b/target/linux/brcm63xx/dts/bcm96338W.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96345GW2.dts b/target/linux/brcm63xx/dts/bcm96345GW2.dts index 521f1b38a..a7b3fad13 100644 --- a/target/linux/brcm63xx/dts/bcm96345GW2.dts +++ b/target/linux/brcm63xx/dts/bcm96345GW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -18,3 +19,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-10.dts b/target/linux/brcm63xx/dts/bcm96348GW-10.dts index d78805787..59850b5a1 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-10.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-10.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW-11.dts b/target/linux/brcm63xx/dts/bcm96348GW-11.dts index 9ef82e62a..3caca0970 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW-11.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW-11.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348GW.dts b/target/linux/brcm63xx/dts/bcm96348GW.dts index d7511b052..c213ac7a1 100644 --- a/target/linux/brcm63xx/dts/bcm96348GW.dts +++ b/target/linux/brcm63xx/dts/bcm96348GW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -63,3 +64,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96348R.dts b/target/linux/brcm63xx/dts/bcm96348R.dts index 3042693b0..b56869b3e 100644 --- a/target/linux/brcm63xx/dts/bcm96348R.dts +++ b/target/linux/brcm63xx/dts/bcm96348R.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW.dts b/target/linux/brcm63xx/dts/bcm96358VW.dts index c2fe5b01b..e097c0518 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96358VW2.dts b/target/linux/brcm63xx/dts/bcm96358VW2.dts index cc4a8b581..5c242c215 100644 --- a/target/linux/brcm63xx/dts/bcm96358VW2.dts +++ b/target/linux/brcm63xx/dts/bcm96358VW2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -40,3 +41,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts index 1078be713..6c4ef091a 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVNgr.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVNgr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/bcm96368MVWG.dts b/target/linux/brcm63xx/dts/bcm96368MVWG.dts index 0f7c42b3c..ed1dd9016 100644 --- a/target/linux/brcm63xx/dts/bcm96368MVWG.dts +++ b/target/linux/brcm63xx/dts/bcm96368MVWG.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -49,3 +50,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva502plus.dts b/target/linux/brcm63xx/dts/cpva502plus.dts index dbe7aae97..6d8455e91 100644 --- a/target/linux/brcm63xx/dts/cpva502plus.dts +++ b/target/linux/brcm63xx/dts/cpva502plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cpva642.dts b/target/linux/brcm63xx/dts/cpva642.dts index 108997df7..212bf6c32 100644 --- a/target/linux/brcm63xx/dts/cpva642.dts +++ b/target/linux/brcm63xx/dts/cpva642.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -99,3 +100,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-5365.dts b/target/linux/brcm63xx/dts/ct-5365.dts index f0676497d..ac3b80954 100644 --- a/target/linux/brcm63xx/dts/ct-5365.dts +++ b/target/linux/brcm63xx/dts/ct-5365.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -81,3 +82,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct-6373.dts b/target/linux/brcm63xx/dts/ct-6373.dts index 8ddcacb4d..579b514f9 100644 --- a/target/linux/brcm63xx/dts/ct-6373.dts +++ b/target/linux/brcm63xx/dts/ct-6373.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -97,3 +98,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/ct536plus.dts b/target/linux/brcm63xx/dts/ct536plus.dts index 8aa47575b..f9bc7e136 100644 --- a/target/linux/brcm63xx/dts/ct536plus.dts +++ b/target/linux/brcm63xx/dts/ct536plus.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -67,3 +68,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/cvg834g.dts b/target/linux/brcm63xx/dts/cvg834g.dts index 519f1f53a..fa14c8bbd 100644 --- a/target/linux/brcm63xx/dts/cvg834g.dts +++ b/target/linux/brcm63xx/dts/cvg834g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -44,3 +45,11 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834g_v4.dts b/target/linux/brcm63xx/dts/dg834g_v4.dts index 0af695d90..369a67c22 100644 --- a/target/linux/brcm63xx/dts/dg834g_v4.dts +++ b/target/linux/brcm63xx/dts/dg834g_v4.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dg834gtpn.dts b/target/linux/brcm63xx/dts/dg834gtpn.dts index 84ef9b2c0..794c701da 100644 --- a/target/linux/brcm63xx/dts/dg834gtpn.dts +++ b/target/linux/brcm63xx/dts/dg834gtpn.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dgnd3700v1.dts b/target/linux/brcm63xx/dts/dgnd3700v1.dts index ea917e8f3..2d23f19b7 100644 --- a/target/linux/brcm63xx/dts/dgnd3700v1.dts +++ b/target/linux/brcm63xx/dts/dgnd3700v1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -169,3 +170,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640b-b.dts b/target/linux/brcm63xx/dts/dsl-2640b-b.dts index fce774d32..df7f4adc0 100644 --- a/target/linux/brcm63xx/dts/dsl-2640b-b.dts +++ b/target/linux/brcm63xx/dts/dsl-2640b-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2640u.dts b/target/linux/brcm63xx/dts/dsl-2640u.dts index 3b94a4abc..8fea2acb2 100644 --- a/target/linux/brcm63xx/dts/dsl-2640u.dts +++ b/target/linux/brcm63xx/dts/dsl-2640u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -54,3 +55,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-2650u.dts b/target/linux/brcm63xx/dts/dsl-2650u.dts index 4b4515103..c9b189b8b 100644 --- a/target/linux/brcm63xx/dts/dsl-2650u.dts +++ b/target/linux/brcm63xx/dts/dsl-2650u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-c.dts b/target/linux/brcm63xx/dts/dsl-274xb-c.dts index fb67fc985..3468dea8b 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-c.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-274xb-f.dts b/target/linux/brcm63xx/dts/dsl-274xb-f.dts index be1d16b36..00a5a9e99 100644 --- a/target/linux/brcm63xx/dts/dsl-274xb-f.dts +++ b/target/linux/brcm63xx/dts/dsl-274xb-f.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dsl-275xb-d.dts b/target/linux/brcm63xx/dts/dsl-275xb-d.dts index 9ac4ea1c2..d8f8c08e1 100644 --- a/target/linux/brcm63xx/dts/dsl-275xb-d.dts +++ b/target/linux/brcm63xx/dts/dsl-275xb-d.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dv-201amr.dts b/target/linux/brcm63xx/dts/dv-201amr.dts index e6955190f..42a825f92 100644 --- a/target/linux/brcm63xx/dts/dv-201amr.dts +++ b/target/linux/brcm63xx/dts/dv-201amr.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts index 4ebb25d01..2945165ce 100644 --- a/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts +++ b/target/linux/brcm63xx/dts/dva-g3810bn_tl.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/evg2000.dts b/target/linux/brcm63xx/dts/evg2000.dts index 07c98f11a..10e0ddcc9 100644 --- a/target/linux/brcm63xx/dts/evg2000.dts +++ b/target/linux/brcm63xx/dts/evg2000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -110,3 +111,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/f5d7633.dts b/target/linux/brcm63xx/dts/f5d7633.dts index 27e81a3e5..89c646b92 100644 --- a/target/linux/brcm63xx/dts/f5d7633.dts +++ b/target/linux/brcm63xx/dts/f5d7633.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2404.dts b/target/linux/brcm63xx/dts/fast2404.dts index ce52af6d4..c0a30a08e 100644 --- a/target/linux/brcm63xx/dts/fast2404.dts +++ b/target/linux/brcm63xx/dts/fast2404.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2504n.dts b/target/linux/brcm63xx/dts/fast2504n.dts index 296bc0993..8b644fb8f 100644 --- a/target/linux/brcm63xx/dts/fast2504n.dts +++ b/target/linux/brcm63xx/dts/fast2504n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -94,3 +95,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2604.dts b/target/linux/brcm63xx/dts/fast2604.dts index 952b66811..14339408b 100644 --- a/target/linux/brcm63xx/dts/fast2604.dts +++ b/target/linux/brcm63xx/dts/fast2604.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704n.dts b/target/linux/brcm63xx/dts/fast2704n.dts index ee343a633..217ef12d7 100644 --- a/target/linux/brcm63xx/dts/fast2704n.dts +++ b/target/linux/brcm63xx/dts/fast2704n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -119,3 +120,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/fast2704v2.dts b/target/linux/brcm63xx/dts/fast2704v2.dts index bbd23da36..eeed6b1da 100644 --- a/target/linux/brcm63xx/dts/fast2704v2.dts +++ b/target/linux/brcm63xx/dts/fast2704v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6000.dts b/target/linux/brcm63xx/dts/gw6000.dts index 5645ae0a8..31555b3ad 100644 --- a/target/linux/brcm63xx/dts/gw6000.dts +++ b/target/linux/brcm63xx/dts/gw6000.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -53,3 +54,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/gw6200.dts b/target/linux/brcm63xx/dts/gw6200.dts index 3e0037a86..acc100c74 100644 --- a/target/linux/brcm63xx/dts/gw6200.dts +++ b/target/linux/brcm63xx/dts/gw6200.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -74,3 +75,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg520v.dts b/target/linux/brcm63xx/dts/hg520v.dts index f0eefc0c0..bfd30693c 100644 --- a/target/linux/brcm63xx/dts/hg520v.dts +++ b/target/linux/brcm63xx/dts/hg520v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -57,3 +58,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg553.dts b/target/linux/brcm63xx/dts/hg553.dts index a00821fb1..a459976c4 100644 --- a/target/linux/brcm63xx/dts/hg553.dts +++ b/target/linux/brcm63xx/dts/hg553.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -96,3 +97,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-a.dts b/target/linux/brcm63xx/dts/hg556a-a.dts index de17500ce..906ee611b 100644 --- a/target/linux/brcm63xx/dts/hg556a-a.dts +++ b/target/linux/brcm63xx/dts/hg556a-a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-b.dts b/target/linux/brcm63xx/dts/hg556a-b.dts index 782beda98..4285e17bc 100644 --- a/target/linux/brcm63xx/dts/hg556a-b.dts +++ b/target/linux/brcm63xx/dts/hg556a-b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -128,3 +129,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg556a-c.dts b/target/linux/brcm63xx/dts/hg556a-c.dts index 36f298be6..48c601e12 100644 --- a/target/linux/brcm63xx/dts/hg556a-c.dts +++ b/target/linux/brcm63xx/dts/hg556a-c.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -123,3 +124,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg622.dts b/target/linux/brcm63xx/dts/hg622.dts index f96af2bf2..419439d02 100644 --- a/target/linux/brcm63xx/dts/hg622.dts +++ b/target/linux/brcm63xx/dts/hg622.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -84,3 +85,7 @@ &pinctrl_pci_intb &pinctrl_pci_gnt1 &pinctrl_pci_req1>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/hg655b.dts b/target/linux/brcm63xx/dts/hg655b.dts index 63e13090c..0336a633e 100644 --- a/target/linux/brcm63xx/dts/hg655b.dts +++ b/target/linux/brcm63xx/dts/hg655b.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -105,3 +106,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/homehub2a.dts b/target/linux/brcm63xx/dts/homehub2a.dts index 6192687d1..1f55265bc 100644 --- a/target/linux/brcm63xx/dts/homehub2a.dts +++ b/target/linux/brcm63xx/dts/homehub2a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -155,3 +156,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/livebox-blue-5g.dts b/target/linux/brcm63xx/dts/livebox-blue-5g.dts index 8a060736c..10a88669b 100644 --- a/target/linux/brcm63xx/dts/livebox-blue-5g.dts +++ b/target/linux/brcm63xx/dts/livebox-blue-5g.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -75,3 +76,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/magic.dts b/target/linux/brcm63xx/dts/magic.dts index 9053c26e6..c78b836df 100644 --- a/target/linux/brcm63xx/dts/magic.dts +++ b/target/linux/brcm63xx/dts/magic.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts index e11ec4678..9d341ec1a 100644 --- a/target/linux/brcm63xx/dts/nb4-fxc-r1.dts +++ b/target/linux/brcm63xx/dts/nb4-fxc-r1.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb4-ser-r0.dts b/target/linux/brcm63xx/dts/nb4-ser-r0.dts index 8a33c6601..e97d9f219 100644 --- a/target/linux/brcm63xx/dts/nb4-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb4-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -103,3 +104,7 @@ linux,part-probe = "bcm63xxpart"; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/nb6-ser-r0.dts b/target/linux/brcm63xx/dts/nb6-ser-r0.dts index 8fb434f34..70d719e1e 100644 --- a/target/linux/brcm63xx/dts/nb6-ser-r0.dts +++ b/target/linux/brcm63xx/dts/nb6-ser-r0.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -82,3 +83,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts index eea30219e..d7e5d3e3f 100644 --- a/target/linux/brcm63xx/dts/p870hw-51a-v2.dts +++ b/target/linux/brcm63xx/dts/p870hw-51a-v2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -84,3 +85,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r1000h.dts b/target/linux/brcm63xx/dts/r1000h.dts index 37cfa15da..299b520a6 100644 --- a/target/linux/brcm63xx/dts/r1000h.dts +++ b/target/linux/brcm63xx/dts/r1000h.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -91,3 +92,11 @@ reg = <0x1fe0000 0x20000>; }; }; + +&uart0 { + status = "ok"; +}; + +&uart1 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/r5010unv2.dts b/target/linux/brcm63xx/dts/r5010unv2.dts index 0bd88b2e4..c0b0a85c4 100644 --- a/target/linux/brcm63xx/dts/r5010unv2.dts +++ b/target/linux/brcm63xx/dts/r5010unv2.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; @@ -99,3 +100,7 @@ }; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rg100a.dts b/target/linux/brcm63xx/dts/rg100a.dts index e96e310fd..871aada25 100644 --- a/target/linux/brcm63xx/dts/rg100a.dts +++ b/target/linux/brcm63xx/dts/rg100a.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0xfe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1025w.dts b/target/linux/brcm63xx/dts/rta1025w.dts index 16c3abf85..e4de95dbe 100644 --- a/target/linux/brcm63xx/dts/rta1025w.dts +++ b/target/linux/brcm63xx/dts/rta1025w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; }; @@ -39,3 +40,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta1320.dts b/target/linux/brcm63xx/dts/rta1320.dts index 6dbf0a5a9..aedc9d30f 100644 --- a/target/linux/brcm63xx/dts/rta1320.dts +++ b/target/linux/brcm63xx/dts/rta1320.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -56,3 +57,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770bw.dts b/target/linux/brcm63xx/dts/rta770bw.dts index bb92d1ec0..0f7146758 100644 --- a/target/linux/brcm63xx/dts/rta770bw.dts +++ b/target/linux/brcm63xx/dts/rta770bw.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/rta770w.dts b/target/linux/brcm63xx/dts/rta770w.dts index 7cefa5008..ce9f0be37 100644 --- a/target/linux/brcm63xx/dts/rta770w.dts +++ b/target/linux/brcm63xx/dts/rta770w.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -72,3 +73,7 @@ reg = <0x3f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw303v.dts b/target/linux/brcm63xx/dts/spw303v.dts index 0040540a4..7a0002023 100644 --- a/target/linux/brcm63xx/dts/spw303v.dts +++ b/target/linux/brcm63xx/dts/spw303v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -83,3 +84,7 @@ reg = <0x7f0000 0x010000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/spw500v.dts b/target/linux/brcm63xx/dts/spw500v.dts index a9603b388..c7a4c7dfd 100644 --- a/target/linux/brcm63xx/dts/spw500v.dts +++ b/target/linux/brcm63xx/dts/spw500v.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/td-w8900gb.dts b/target/linux/brcm63xx/dts/td-w8900gb.dts index b52670b9b..e5c02e63a 100644 --- a/target/linux/brcm63xx/dts/td-w8900gb.dts +++ b/target/linux/brcm63xx/dts/td-w8900gb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -79,3 +80,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii &pinctrl_mii_pccard>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/usr9108.dts b/target/linux/brcm63xx/dts/usr9108.dts index 81af20bcd..4852d65ad 100644 --- a/target/linux/brcm63xx/dts/usr9108.dts +++ b/target/linux/brcm63xx/dts/usr9108.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-leds { @@ -52,3 +53,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2110.dts b/target/linux/brcm63xx/dts/v2110.dts index 23378a472..93a5d9443 100644 --- a/target/linux/brcm63xx/dts/v2110.dts +++ b/target/linux/brcm63xx/dts/v2110.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/v2500v-bb.dts b/target/linux/brcm63xx/dts/v2500v-bb.dts index b6370ee1c..d6b5964f8 100644 --- a/target/linux/brcm63xx/dts/v2500v-bb.dts +++ b/target/linux/brcm63xx/dts/v2500v-bb.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -78,3 +79,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci &pinctrl_ext_mii>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vg50.dts b/target/linux/brcm63xx/dts/vg50.dts index 2180802db..f1d48ea3c 100644 --- a/target/linux/brcm63xx/dts/vg50.dts +++ b/target/linux/brcm63xx/dts/vg50.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -49,3 +50,7 @@ linux,part-probe = "bcm63xxpart"; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vh4032n.dts b/target/linux/brcm63xx/dts/vh4032n.dts index 1b646ce5c..78a708ac0 100644 --- a/target/linux/brcm63xx/dts/vh4032n.dts +++ b/target/linux/brcm63xx/dts/vh4032n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -100,3 +101,7 @@ reg = <0x1fe0000 0x020000>; }; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025u.dts b/target/linux/brcm63xx/dts/vr-3025u.dts index 2c53f516b..fd2a56769 100644 --- a/target/linux/brcm63xx/dts/vr-3025u.dts +++ b/target/linux/brcm63xx/dts/vr-3025u.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3025un.dts b/target/linux/brcm63xx/dts/vr-3025un.dts index f9aed5175..61e197251 100644 --- a/target/linux/brcm63xx/dts/vr-3025un.dts +++ b/target/linux/brcm63xx/dts/vr-3025un.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/vr-3026e.dts b/target/linux/brcm63xx/dts/vr-3026e.dts index da75df8a1..01cb98817 100644 --- a/target/linux/brcm63xx/dts/vr-3026e.dts +++ b/target/linux/brcm63xx/dts/vr-3026e.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -80,3 +81,7 @@ pinctrl-0 = <&pinctrl_pci &pinctrl_ephy0_led &pinctrl_ephy1_led &pinctrl_ephy2_led &pinctrl_ephy3_led>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/dts/wap-5813n.dts b/target/linux/brcm63xx/dts/wap-5813n.dts index 8b47b200b..1a71426ca 100644 --- a/target/linux/brcm63xx/dts/wap-5813n.dts +++ b/target/linux/brcm63xx/dts/wap-5813n.dts @@ -10,6 +10,7 @@ chosen { bootargs = "root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200"; + stdout-path = "serial0:115200n8"; }; gpio-keys-polled { @@ -141,3 +142,7 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_pci>; }; + +&uart0 { + status = "ok"; +}; diff --git a/target/linux/brcm63xx/image/bcm63xx.mk b/target/linux/brcm63xx/image/bcm63xx.mk index 4e90eb050..918dfc798 100644 --- a/target/linux/brcm63xx/image/bcm63xx.mk +++ b/target/linux/brcm63xx/image/bcm63xx.mk @@ -971,6 +971,18 @@ define Device/FAST2704V2 endef TARGET_DEVICES += FAST2704V2 +### Sercomm ### +define Device/AD1018-SPI_flash + $(Device/bcm63xx) + DEVICE_TITLE := Sercomm AD1018 (SPI flash mod) + DEVICE_DTS := ad1018-nor + CFE_BOARD_ID := 96328avngr + CFE_CHIP_ID := 6328 + DEVICE_PACKAGES := \ + $(B43_PACKAGES) $(USB2_PACKAGES) +endef +TARGET_DEVICES += AD1018-SPI_flash + ### SFR ### define Device/NEUFBOX4-SER $(Device/bcm63xx) diff --git a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch index 14eaca354..6b0a12132 100644 --- a/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch +++ b/target/linux/brcm63xx/patches-4.4/000-4.5-03-mtd-nand-spi-nor-assign-MTD-of_node.patch @@ -15,7 +15,7 @@ Reviewed-by: Boris Brezillon --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3989,6 +3989,9 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3992,6 +3992,9 @@ int nand_scan_ident(struct mtd_info *mtd int ret; if (chip->flash_node) { diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch new file mode 100644 index 000000000..9f4e21aab --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/000-4.8-11-serial-bcm63xx_uart-use-correct-alias-naming.patch @@ -0,0 +1,37 @@ +From a59388668d0ce19dadea909e09f4eb905a27b1ce Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Wed, 8 Jun 2016 12:08:43 +0200 +Subject: [PATCH] serial/bcm63xx_uart: use correct alias naming + +The bcm63xx_uart driver uses the of alias for determing its id. Recent +changes in dts files changed the expected 'uartX' to the recommended +'serialX', breaking serial output. Fix this by checking for a 'serialX' +alias as well. + +Fixes: e3b992d028f8 ("MIPS: BMIPS: Improve BCM6328 device tree") +Fixes: 2d52ee82b475 ("MIPS: BMIPS: Improve BCM6368 device tree") +Fixes: 7537d273e2f3 ("MIPS: BMIPS: Add device tree example for BCM6358") +Signed-off-by: Jonas Gorski +Acked-by: Florian Fainelli +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/bcm63xx_uart.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -813,8 +813,12 @@ static int bcm_uart_probe(struct platfor + struct clk *clk; + int ret; + +- if (pdev->dev.of_node) +- pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ if (pdev->dev.of_node) { ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "serial"); ++ ++ if (pdev->id < 0) ++ pdev->id = of_alias_get_id(pdev->dev.of_node, "uart"); ++ } + + if (pdev->id < 0 || pdev->id >= BCM63XX_NR_UARTS) + return -EINVAL; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch new file mode 100644 index 000000000..aa813f3d9 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-07-mdio_bus-Issue-GPIO-RESET-to-PHYs.patch @@ -0,0 +1,192 @@ +From 69226896ad636b94f6d2e55d75ff21a29c4de83b Mon Sep 17 00:00:00 2001 +From: Roger Quadros +Date: Fri, 21 Apr 2017 16:15:38 +0300 +Subject: [PATCH] mdio_bus: Issue GPIO RESET to PHYs. + +Some boards [1] leave the PHYs at an invalid state +during system power-up or reset thus causing unreliability +issues with the PHY which manifests as PHY not being detected +or link not functional. To fix this, these PHYs need to be RESET +via a GPIO connected to the PHY's RESET pin. + +Some boards have a single GPIO controlling the PHY RESET pin of all +PHYs on the bus whereas some others have separate GPIOs controlling +individual PHY RESETs. + +In both cases, the RESET de-assertion cannot be done in the PHY driver +as the PHY will not probe till its reset is de-asserted. +So do the RESET de-assertion in the MDIO bus driver. + +[1] - am572x-idk, am571x-idk, a437x-idk + +Signed-off-by: Roger Quadros +Signed-off-by: David S. Miller +--- + Documentation/devicetree/bindings/net/mdio.txt | 33 ++++++++++++++++++ + drivers/net/phy/mdio_bus.c | 47 ++++++++++++++++++++++++++ + drivers/of/of_mdio.c | 7 ++++ + include/linux/phy.h | 7 ++++ + 4 files changed, 94 insertions(+) + create mode 100644 Documentation/devicetree/bindings/net/mdio.txt + +--- /dev/null ++++ b/Documentation/devicetree/bindings/net/mdio.txt +@@ -0,0 +1,33 @@ ++Common MDIO bus properties. ++ ++These are generic properties that can apply to any MDIO bus. ++ ++Optional properties: ++- reset-gpios: List of one or more GPIOs that control the RESET lines ++ of the PHYs on that MDIO bus. ++- reset-delay-us: RESET pulse width in microseconds as per PHY datasheet. ++ ++A list of child nodes, one per device on the bus is expected. These ++should follow the generic phy.txt, or a device specific binding document. ++ ++Example : ++This example shows these optional properties, plus other properties ++required for the TI Davinci MDIO driver. ++ ++ davinci_mdio: ethernet@0x5c030000 { ++ compatible = "ti,davinci_mdio"; ++ reg = <0x5c030000 0x1000>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ ++ reset-gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; ++ reset-delay-us = <2>; /* PHY datasheet states 1us min */ ++ ++ ethphy0: ethernet-phy@1 { ++ reg = <1>; ++ }; ++ ++ ethphy1: ethernet-phy@3 { ++ reg = <3>; ++ }; ++ }; +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -22,8 +22,11 @@ + #include + #include + #include ++#include ++#include + #include + #include ++#include + #include + #include + #include +@@ -252,6 +255,7 @@ static inline void of_mdiobus_link_phyde + int __mdiobus_register(struct mii_bus *bus, struct module *owner) + { + int i, err; ++ struct gpio_desc *gpiod; + + if (NULL == bus || NULL == bus->name || + NULL == bus->read || NULL == bus->write) +@@ -278,6 +282,35 @@ int __mdiobus_register(struct mii_bus *b + if (bus->reset) + bus->reset(bus); + ++ /* de-assert bus level PHY GPIO resets */ ++ if (bus->num_reset_gpios > 0) { ++ bus->reset_gpiod = devm_kcalloc(&bus->dev, ++ bus->num_reset_gpios, ++ sizeof(struct gpio_desc *), ++ GFP_KERNEL); ++ if (!bus->reset_gpiod) ++ return -ENOMEM; ++ } ++ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ gpiod = devm_gpiod_get_index(&bus->dev, "reset", i, ++ GPIOD_OUT_LOW); ++ if (IS_ERR(gpiod)) { ++ err = PTR_ERR(gpiod); ++ if (err != -ENOENT) { ++ dev_err(&bus->dev, ++ "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return err; ++ } ++ } else { ++ bus->reset_gpiod[i] = gpiod; ++ gpiod_set_value_cansleep(gpiod, 1); ++ udelay(bus->reset_delay_us); ++ gpiod_set_value_cansleep(gpiod, 0); ++ } ++ } ++ + for (i = 0; i < PHY_MAX_ADDR; i++) { + if ((bus->phy_mask & (1 << i)) == 0) { + struct phy_device *phydev; +@@ -302,6 +335,13 @@ error: + phy_device_free(phydev); + } + } ++ ++ /* Put PHYs in RESET to save power */ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ if (bus->reset_gpiod[i]) ++ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); ++ } ++ + device_del(&bus->dev); + return err; + } +@@ -321,6 +361,13 @@ void mdiobus_unregister(struct mii_bus * + phy_device_free(phydev); + } + } ++ ++ /* Put PHYs in RESET to save power */ ++ for (i = 0; i < bus->num_reset_gpios; i++) { ++ if (bus->reset_gpiod[i]) ++ gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); ++ } ++ + device_del(&bus->dev); + } + EXPORT_SYMBOL(mdiobus_unregister); +--- a/drivers/of/of_mdio.c ++++ b/drivers/of/of_mdio.c +@@ -21,6 +21,8 @@ + #include + #include + ++#define DEFAULT_GPIO_RESET_DELAY 10 /* in microseconds */ ++ + MODULE_AUTHOR("Grant Likely "); + MODULE_LICENSE("GPL"); + +@@ -140,6 +142,11 @@ int of_mdiobus_register(struct mii_bus * + + mdio->dev.of_node = np; + ++ /* Get bus level PHY reset GPIO details */ ++ mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; ++ of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); ++ mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios"); ++ + /* Register the MDIO bus */ + rc = mdiobus_register(mdio); + if (rc) +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -187,6 +187,13 @@ struct mii_bus { + * interrupt at the index matching its address + */ + int *irq; ++ ++ /* GPIO reset pulse width in microseconds */ ++ int reset_delay_us; ++ /* Number of reset GPIOs */ ++ int num_reset_gpios; ++ /* Array of RESET GPIO descriptors */ ++ struct gpio_desc **reset_gpiod; + }; + #define to_mii_bus(d) container_of(d, struct mii_bus, dev) + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch new file mode 100644 index 000000000..5788a37de --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.12-08-net-phy-Call-bus-reset-after-releasing-PHYs-from-res.patch @@ -0,0 +1,43 @@ +From df0c8d911abf6ba97b2c2fc3c5a12769e0b081a3 Mon Sep 17 00:00:00 2001 +From: Florian Fainelli +Date: Thu, 11 May 2017 11:24:16 -0700 +Subject: [PATCH] net: phy: Call bus->reset() after releasing PHYs from reset + +The API convention makes it that a given MDIO bus reset should be able +to access PHY devices in its reset() callback and perform additional +MDIO accesses in order to bring the bus and PHYs in a working state. + +Commit 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") broke that +contract by first calling bus->reset() and then release all PHYs from +reset using their shared GPIO line, so restore the expected +functionality here. + +Fixes: 69226896ad63 ("mdio_bus: Issue GPIO RESET to PHYs.") +Signed-off-by: Florian Fainelli +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -279,9 +279,6 @@ int __mdiobus_register(struct mii_bus *b + + mutex_init(&bus->mdio_lock); + +- if (bus->reset) +- bus->reset(bus); +- + /* de-assert bus level PHY GPIO resets */ + if (bus->num_reset_gpios > 0) { + bus->reset_gpiod = devm_kcalloc(&bus->dev, +@@ -311,6 +308,9 @@ int __mdiobus_register(struct mii_bus *b + } + } + ++ if (bus->reset) ++ bus->reset(bus); ++ + for (i = 0; i < PHY_MAX_ADDR; i++) { + if ((bus->phy_mask & (1 << i)) == 0) { + struct phy_device *phydev; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch new file mode 100644 index 000000000..7ce5eb59c --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-02-mdio_bus-handle-only-single-PHY-reset-GPIO.patch @@ -0,0 +1,120 @@ +From d396e84c56047b303cac378dde4b2e5cc430b336 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:38 +0300 +Subject: [PATCH] mdio_bus: handle only single PHY reset GPIO + +Commit 4c5e7a2c0501 ("dt-bindings: mdio: Clarify binding document") +declared that a MDIO reset GPIO property should have only a single GPIO +reference/specifier, however the supporting code was left intact, still +burdening the kernel with now apparently useless loops -- get rid of them. + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 53 +++++++++++++++++----------------------------- + drivers/of/of_mdio.c | 1 - + include/linux/phy.h | 6 ++---- + 3 files changed, 21 insertions(+), 39 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -279,33 +279,22 @@ int __mdiobus_register(struct mii_bus *b + + mutex_init(&bus->mdio_lock); + +- /* de-assert bus level PHY GPIO resets */ +- if (bus->num_reset_gpios > 0) { +- bus->reset_gpiod = devm_kcalloc(&bus->dev, +- bus->num_reset_gpios, +- sizeof(struct gpio_desc *), +- GFP_KERNEL); +- if (!bus->reset_gpiod) +- return -ENOMEM; +- } +- +- for (i = 0; i < bus->num_reset_gpios; i++) { +- gpiod = devm_gpiod_get_index(&bus->dev, "reset", i, +- GPIOD_OUT_LOW); +- if (IS_ERR(gpiod)) { +- err = PTR_ERR(gpiod); +- if (err != -ENOENT) { +- dev_err(&bus->dev, +- "mii_bus %s couldn't get reset GPIO\n", +- bus->id); +- return err; +- } +- } else { +- bus->reset_gpiod[i] = gpiod; +- gpiod_set_value_cansleep(gpiod, 1); +- udelay(bus->reset_delay_us); +- gpiod_set_value_cansleep(gpiod, 0); ++ /* de-assert bus level PHY GPIO reset */ ++ gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW); ++ if (IS_ERR(gpiod)) { ++ err = PTR_ERR(gpiod); ++ if (err != -ENOENT) { ++ dev_err(&bus->dev, ++ "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return err; + } ++ } else { ++ bus->reset_gpiod = gpiod; ++ ++ gpiod_set_value_cansleep(gpiod, 1); ++ udelay(bus->reset_delay_us); ++ gpiod_set_value_cansleep(gpiod, 0); + } + + if (bus->reset) +@@ -337,10 +326,8 @@ error: + } + + /* Put PHYs in RESET to save power */ +- for (i = 0; i < bus->num_reset_gpios; i++) { +- if (bus->reset_gpiod[i]) +- gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + return err; +@@ -363,10 +350,8 @@ void mdiobus_unregister(struct mii_bus * + } + + /* Put PHYs in RESET to save power */ +- for (i = 0; i < bus->num_reset_gpios; i++) { +- if (bus->reset_gpiod[i]) +- gpiod_set_value_cansleep(bus->reset_gpiod[i], 1); +- } ++ if (bus->reset_gpiod) ++ gpiod_set_value_cansleep(bus->reset_gpiod, 1); + + device_del(&bus->dev); + } +--- a/drivers/of/of_mdio.c ++++ b/drivers/of/of_mdio.c +@@ -145,7 +145,6 @@ int of_mdiobus_register(struct mii_bus * + /* Get bus level PHY reset GPIO details */ + mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; + of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); +- mdio->num_reset_gpios = of_gpio_named_count(np, "reset-gpios"); + + /* Register the MDIO bus */ + rc = mdiobus_register(mdio); +--- a/include/linux/phy.h ++++ b/include/linux/phy.h +@@ -190,10 +190,8 @@ struct mii_bus { + + /* GPIO reset pulse width in microseconds */ + int reset_delay_us; +- /* Number of reset GPIOs */ +- int num_reset_gpios; +- /* Array of RESET GPIO descriptors */ +- struct gpio_desc **reset_gpiod; ++ /* RESET GPIO descriptor pointer */ ++ struct gpio_desc *reset_gpiod; + }; + #define to_mii_bus(d) container_of(d, struct mii_bus, dev) + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch new file mode 100644 index 000000000..d7ac6234c --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.13-03-mdio_bus-use-devm_gpiod_get_optional.patch @@ -0,0 +1,39 @@ +From fe0e4052fb11d5c713961ab7e136520be40052a3 Mon Sep 17 00:00:00 2001 +From: Sergei Shtylyov +Date: Mon, 12 Jun 2017 23:55:39 +0300 +Subject: [PATCH] mdio_bus: use devm_gpiod_get_optional() + +The MDIO reset GPIO is really a classical optional GPIO property case, +so devm_gpiod_get_optional() should have been used, not devm_gpiod_get(). +Doing this saves several LoCs... + +Signed-off-by: Sergei Shtylyov +Signed-off-by: David S. Miller +--- + drivers/net/phy/mdio_bus.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +--- a/drivers/net/phy/mdio_bus.c ++++ b/drivers/net/phy/mdio_bus.c +@@ -280,16 +280,12 @@ int __mdiobus_register(struct mii_bus *b + mutex_init(&bus->mdio_lock); + + /* de-assert bus level PHY GPIO reset */ +- gpiod = devm_gpiod_get(&bus->dev, "reset", GPIOD_OUT_LOW); ++ gpiod = devm_gpiod_get_optional(&bus->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(gpiod)) { +- err = PTR_ERR(gpiod); +- if (err != -ENOENT) { +- dev_err(&bus->dev, +- "mii_bus %s couldn't get reset GPIO\n", +- bus->id); +- return err; +- } +- } else { ++ dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n", ++ bus->id); ++ return PTR_ERR(gpiod); ++ } else if (gpiod) { + bus->reset_gpiod = gpiod; + + gpiod_set_value_cansleep(gpiod, 1); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch new file mode 100644 index 000000000..08511d69f --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-01-MIPS-BCM63XX-add-clkdev-lookup-support.patch @@ -0,0 +1,210 @@ +From e74caf41aec5338b8cbbd0a1483650848f16f532 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:23:47 +0200 +Subject: [PATCH V2 1/8] MIPS: BCM63XX: add clkdev lookup support + +Enable clkdev lookup support to allow us providing clocks under +different names to devices more easily, so we don't need to care +about clock name clashes anymore. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/Kconfig | 1 + + arch/mips/bcm63xx/clk.c | 150 +++++++++++++++++++++++++++++++++++++----------- + 2 files changed, 116 insertions(+), 35 deletions(-) + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -214,6 +214,7 @@ config BCM63XX + select ARCH_REQUIRE_GPIOLIB + select HAVE_CLK + select MIPS_L1_CACHE_SHIFT_4 ++ select CLKDEV_LOOKUP + help + Support for BCM63XX based boards + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -352,44 +353,103 @@ long clk_round_rate(struct clk *clk, uns + } + EXPORT_SYMBOL_GPL(clk_round_rate); + +-struct clk *clk_get(struct device *dev, const char *id) +-{ +- if (!strcmp(id, "enet0")) +- return &clk_enet0; +- if (!strcmp(id, "enet1")) +- return &clk_enet1; +- if (!strcmp(id, "enetsw")) +- return &clk_enetsw; +- if (!strcmp(id, "ephy")) +- return &clk_ephy; +- if (!strcmp(id, "usbh")) +- return &clk_usbh; +- if (!strcmp(id, "usbd")) +- return &clk_usbd; +- if (!strcmp(id, "spi")) +- return &clk_spi; +- if (!strcmp(id, "hsspi")) +- return &clk_hsspi; +- if (!strcmp(id, "xtm")) +- return &clk_xtm; +- if (!strcmp(id, "periph")) +- return &clk_periph; +- if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) +- return &clk_pcm; +- if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) +- return &clk_ipsec; +- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) +- return &clk_pcie; +- return ERR_PTR(-ENOENT); +-} +- +-EXPORT_SYMBOL(clk_get); +- +-void clk_put(struct clk *clk) +-{ +-} +- +-EXPORT_SYMBOL(clk_put); ++static struct clk_lookup bcm3368_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++}; ++ ++static struct clk_lookup bcm6328_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ ++static struct clk_lookup bcm6338_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6345_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6348_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++}; ++ ++static struct clk_lookup bcm6358_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enet0", &clk_enet0), ++ CLKDEV_INIT(NULL, "enet1", &clk_enet1), ++ CLKDEV_INIT(NULL, "ephy", &clk_ephy), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++}; ++ ++static struct clk_lookup bcm6362_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++ CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), ++}; ++ ++static struct clk_lookup bcm6368_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "xtm", &clk_xtm), ++ CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), ++}; + + #define HSSPI_PLL_HZ_6328 133333333 + #define HSSPI_PLL_HZ_6362 400000000 +@@ -397,11 +457,31 @@ EXPORT_SYMBOL(clk_put); + static int __init bcm63xx_clk_init(void) + { + switch (bcm63xx_get_cpu_id()) { ++ case BCM3368_CPU_ID: ++ clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); ++ break; + case BCM6328_CPU_ID: + clk_hsspi.rate = HSSPI_PLL_HZ_6328; ++ clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); ++ break; ++ case BCM6338_CPU_ID: ++ clkdev_add_table(bcm6338_clks, ARRAY_SIZE(bcm6338_clks)); ++ break; ++ case BCM6345_CPU_ID: ++ clkdev_add_table(bcm6345_clks, ARRAY_SIZE(bcm6345_clks)); ++ break; ++ case BCM6348_CPU_ID: ++ clkdev_add_table(bcm6348_clks, ARRAY_SIZE(bcm6348_clks)); ++ break; ++ case BCM6358_CPU_ID: ++ clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks)); + break; + case BCM6362_CPU_ID: + clk_hsspi.rate = HSSPI_PLL_HZ_6362; ++ clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks)); ++ break; ++ case BCM6368_CPU_ID: ++ clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); + break; + } + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch new file mode 100644 index 000000000..2b3ca16de --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-02-MIPS-BCM63XX-provide-periph-clock-as-refclk-for-uart.patch @@ -0,0 +1,84 @@ +From d0322bf7bebe87012b4f95c85be6b5ba0cb6f344 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:31:44 +0200 +Subject: [PATCH V2 2/8] MIPS: BCM63XX: provide periph clock as refclk for uart + +Add a lookup as "refclk" to describe its function for the uarts. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -356,6 +356,8 @@ EXPORT_SYMBOL_GPL(clk_round_rate); + static struct clk_lookup bcm3368_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -369,6 +371,8 @@ static struct clk_lookup bcm3368_clks[] + static struct clk_lookup bcm6328_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -380,6 +384,7 @@ static struct clk_lookup bcm6328_clks[] + static struct clk_lookup bcm6338_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -392,6 +397,7 @@ static struct clk_lookup bcm6338_clks[] + static struct clk_lookup bcm6345_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -404,6 +410,7 @@ static struct clk_lookup bcm6345_clks[] + static struct clk_lookup bcm6348_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -416,6 +423,8 @@ static struct clk_lookup bcm6348_clks[] + static struct clk_lookup bcm6358_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -429,6 +438,8 @@ static struct clk_lookup bcm6358_clks[] + static struct clk_lookup bcm6362_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -442,6 +453,8 @@ static struct clk_lookup bcm6362_clks[] + static struct clk_lookup bcm6368_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch new file mode 100644 index 000000000..5152fbe24 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-03-tty-bcm63xx_uart-use-refclk-for-the-expected-clock-n.patch @@ -0,0 +1,26 @@ +From 8124706e6040b1cf0d2dd3a05759df6cec4bddfb Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:32:37 +0200 +Subject: [PATCH V2 3/8] tty/bcm63xx_uart: use refclk for the expected clock + name + +We now have the clock available under refclk, so use that. + +Acked-by: Greg Kroah-Hartman +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + drivers/tty/serial/bcm63xx_uart.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -842,7 +842,7 @@ static int bcm_uart_probe(struct platfor + return -ENODEV; + + clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : +- clk_get(&pdev->dev, "periph"); ++ clk_get(&pdev->dev, "refclk"); + if (IS_ERR(clk)) + return -ENODEV; + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch new file mode 100644 index 000000000..a8fd5afcb --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-04-tty-bcm63xx_uart-allow-naming-clock-in-device-tree.patch @@ -0,0 +1,55 @@ +From 317f8659bba01b307cbe4e9902d4e3d333fd7164 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:39:17 +0200 +Subject: [PATCH V2 4/8] tty/bcm63xx_uart: allow naming clock in device tree + +Codify using a named clock for the refclk of the uart. This makes it +easier if we might need to add a gating clock (like present on the +BCM6345). + +Acked-by: Rob Herring +Acked-by: Greg Kroah-Hartman +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt | 6 ++++++ + drivers/tty/serial/bcm63xx_uart.c | 6 ++++-- + 2 files changed, 10 insertions(+), 2 deletions(-) + +--- a/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt ++++ b/Documentation/devicetree/bindings/serial/brcm,bcm6345-uart.txt +@@ -11,6 +11,11 @@ Required properties: + - clocks: Clock driving the hardware; used to figure out the baud rate + divisor. + ++ ++Optional properties: ++ ++- clock-names: Should be "refclk". ++ + Example: + + uart0: serial@14e00520 { +@@ -19,6 +24,7 @@ Example: + interrupt-parent = <&periph_intc>; + interrupts = <2>; + clocks = <&periph_clk>; ++ clock-names = "refclk"; + }; + + clocks { +--- a/drivers/tty/serial/bcm63xx_uart.c ++++ b/drivers/tty/serial/bcm63xx_uart.c +@@ -841,8 +841,10 @@ static int bcm_uart_probe(struct platfor + if (!res_irq) + return -ENODEV; + +- clk = pdev->dev.of_node ? of_clk_get(pdev->dev.of_node, 0) : +- clk_get(&pdev->dev, "refclk"); ++ clk = clk_get(&pdev->dev, "refclk"); ++ if (IS_ERR(clk) && pdev->dev.of_node) ++ clk = of_clk_get(pdev->dev.of_node, 0); ++ + if (IS_ERR(clk)) + return -ENODEV; + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch new file mode 100644 index 000000000..3d9deee79 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-05-MIPS-BCM63XX-move-the-HSSPI-PLL-HZ-into-its-own-cloc.patch @@ -0,0 +1,62 @@ +From cb86630379c8f3432c916d62045b5176f17f4123 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:57:21 +0200 +Subject: [PATCH V2 6/8] MIPS: BCM63XX: move the HSSPI PLL HZ into its own + clock + +Split up the HSSPL clock into rate and a gate clock, to more closely +match the actual hardware. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -247,6 +247,10 @@ static struct clk clk_hsspi = { + .set = hsspi_set, + }; + ++/* ++ * HSSPI PLL ++ */ ++static struct clk clk_hsspi_pll; + + /* + * XTM clock +@@ -373,6 +377,7 @@ static struct clk_lookup bcm6328_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -440,6 +445,7 @@ static struct clk_lookup bcm6362_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -474,7 +480,7 @@ static int __init bcm63xx_clk_init(void) + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); + break; + case BCM6328_CPU_ID: +- clk_hsspi.rate = HSSPI_PLL_HZ_6328; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); + break; + case BCM6338_CPU_ID: +@@ -490,7 +496,7 @@ static int __init bcm63xx_clk_init(void) + clkdev_add_table(bcm6358_clks, ARRAY_SIZE(bcm6358_clks)); + break; + case BCM6362_CPU_ID: +- clk_hsspi.rate = HSSPI_PLL_HZ_6362; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; + clkdev_add_table(bcm6362_clks, ARRAY_SIZE(bcm6362_clks)); + break; + case BCM6368_CPU_ID: diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch new file mode 100644 index 000000000..0eafe5f72 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-06-MIPS-BCM63XX-provide-enet-clocks-as-enet-to-the-ethe.patch @@ -0,0 +1,60 @@ +From 6d43970a2eb1c7ee88caf7328d201f9c001262e9 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 16 Jul 2017 12:48:41 +0200 +Subject: [PATCH V2 7/8] MIPS: BCM63XX: provide enet clocks as "enet" to the + ethernet devices + +Add lookups to provide the appropriate enetX clocks as just "enet" to +the ethernet devices. + +Reviewed-by: Florian Fainelli +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -370,6 +370,8 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; + + static struct clk_lookup bcm6328_clks[] = { +@@ -397,6 +399,7 @@ static struct clk_lookup bcm6338_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6345_clks[] = { +@@ -410,6 +413,7 @@ static struct clk_lookup bcm6345_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6348_clks[] = { +@@ -423,6 +427,8 @@ static struct clk_lookup bcm6348_clks[] + CLKDEV_INIT(NULL, "usbh", &clk_usbh), + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet_misc), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet_misc), + }; + + static struct clk_lookup bcm6358_clks[] = { +@@ -438,6 +444,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), ++ CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; + + static struct clk_lookup bcm6362_clks[] = { diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch new file mode 100644 index 000000000..b53660182 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-07-MIPS-BCM63XX-split-out-swpkt_sar-usb-clocks.patch @@ -0,0 +1,105 @@ +From b98027285bd1fa95da0645a4234a5fc1f1a83f92 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 26 Feb 2017 11:59:52 +0100 +Subject: [PATCH V2 8/8] MIPS: BCM63XX: split out swpkt_sar/usb clocks + +Make the secondary switch clocks their own clocks. This allows proper +enable reference counting between SAR/XTM and the main switch clocks, +and controlling them individually from drivers. + +Signed-off-by: Jonas Gorski +--- + arch/mips/bcm63xx/clk.c | 61 +++++++++++++++++++++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 10 deletions(-) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -121,21 +121,56 @@ static struct clk clk_ephy = { + }; + + /* ++ * Ethernet switch SAR clock ++ */ ++static void swpkt_sar_set(struct clk *clk, int enable) ++{ ++ if (BCMCPU_IS_6368()) ++ bcm_hwclock_set(CKCTL_6368_SWPKT_SAR_EN, enable); ++ else ++ return; ++} ++ ++static struct clk clk_swpkt_sar = { ++ .set = swpkt_sar_set, ++}; ++ ++/* ++ * Ethernet switch USB clock ++ */ ++static void swpkt_usb_set(struct clk *clk, int enable) ++{ ++ if (BCMCPU_IS_6368()) ++ bcm_hwclock_set(CKCTL_6368_SWPKT_USB_EN, enable); ++ else ++ return; ++} ++ ++static struct clk clk_swpkt_usb = { ++ .set = swpkt_usb_set, ++}; ++ ++/* + * Ethernet switch clock + */ + static void enetsw_set(struct clk *clk, int enable) + { +- if (BCMCPU_IS_6328()) ++ if (BCMCPU_IS_6328()) { + bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable); +- else if (BCMCPU_IS_6362()) ++ } else if (BCMCPU_IS_6362()) { + bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable); +- else if (BCMCPU_IS_6368()) +- bcm_hwclock_set(CKCTL_6368_ROBOSW_EN | +- CKCTL_6368_SWPKT_USB_EN | +- CKCTL_6368_SWPKT_SAR_EN, +- enable); +- else ++ } else if (BCMCPU_IS_6368()) { ++ if (enable) { ++ clk_enable_unlocked(&clk_swpkt_sar); ++ clk_enable_unlocked(&clk_swpkt_usb); ++ } else { ++ clk_disable_unlocked(&clk_swpkt_usb); ++ clk_disable_unlocked(&clk_swpkt_sar); ++ } ++ bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); ++ } else { + return; ++ } + + if (enable) { + /* reset switch core afer clock change */ +@@ -260,8 +295,12 @@ static void xtm_set(struct clk *clk, int + if (!BCMCPU_IS_6368()) + return; + +- bcm_hwclock_set(CKCTL_6368_SAR_EN | +- CKCTL_6368_SWPKT_SAR_EN, enable); ++ if (enable) ++ clk_enable_unlocked(&clk_swpkt_sar); ++ else ++ clk_disable_unlocked(&clk_swpkt_sar); ++ ++ bcm_hwclock_set(CKCTL_6368_SAR_EN, enable); + + if (enable) { + /* reset sar core afer clock change */ +@@ -444,6 +483,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "usbd", &clk_usbd), + CLKDEV_INIT(NULL, "spi", &clk_spi), + CLKDEV_INIT(NULL, "pcm", &clk_pcm), ++ CLKDEV_INIT(NULL, "swpkt_sar", &clk_swpkt_sar), ++ CLKDEV_INIT(NULL, "swpkt_usb", &clk_swpkt_usb), + CLKDEV_INIT("bcm63xx_enet.0", "enet", &clk_enet0), + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch new file mode 100644 index 000000000..b85f38b59 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-08-bcm63xx_enet-correct-clock-usage.patch @@ -0,0 +1,101 @@ +From d0423d3e4fa7ae305729cb50369427f075ccb279 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 25 Feb 2017 12:41:28 +0100 +Subject: [PATCH 1/6] bcm63xx_enet: correct clock usage + +Check the return code of prepare_enable and change one last instance of +enable only to prepare_enable. Also properly disable and release the +clock in error paths and on remove for enetsw. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 31 +++++++++++++++++++++------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1787,7 +1787,9 @@ static int bcm_enet_probe(struct platfor + ret = PTR_ERR(priv->mac_clk); + goto out; + } +- clk_prepare_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk_mac; + + /* initialize default and fetch platform data */ + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +@@ -1819,9 +1821,11 @@ static int bcm_enet_probe(struct platfor + if (IS_ERR(priv->phy_clk)) { + ret = PTR_ERR(priv->phy_clk); + priv->phy_clk = NULL; +- goto out_put_clk_mac; ++ goto out_disable_clk_mac; + } +- clk_prepare_enable(priv->phy_clk); ++ ret = clk_prepare_enable(priv->phy_clk); ++ if (ret) ++ goto out_put_clk_phy; + } + + /* do minimal hardware init to be able to probe mii bus */ +@@ -1921,13 +1925,16 @@ out_free_mdio: + out_uninit_hw: + /* turn off mdc clock */ + enet_writel(priv, 0, ENET_MIISC_REG); +- if (priv->phy_clk) { ++ if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); ++ ++out_put_clk_phy: ++ if (priv->phy_clk) + clk_put(priv->phy_clk); +- } + +-out_put_clk_mac: ++out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); ++out_put_clk_mac: + clk_put(priv->mac_clk); + out: + free_netdev(dev); +@@ -2772,7 +2779,9 @@ static int bcm_enetsw_probe(struct platf + ret = PTR_ERR(priv->mac_clk); + goto out_unmap; + } +- clk_enable(priv->mac_clk); ++ ret = clk_prepare_enable(priv->mac_clk); ++ if (ret) ++ goto out_put_clk; + + priv->rx_chan = 0; + priv->tx_chan = 1; +@@ -2793,7 +2802,7 @@ static int bcm_enetsw_probe(struct platf + + ret = register_netdev(dev); + if (ret) +- goto out_put_clk; ++ goto out_disable_clk; + + netif_carrier_off(dev); + platform_set_drvdata(pdev, dev); +@@ -2802,6 +2811,9 @@ static int bcm_enetsw_probe(struct platf + + return 0; + ++out_disable_clk: ++ clk_disable_unprepare(priv->mac_clk); ++ + out_put_clk: + clk_put(priv->mac_clk); + +@@ -2833,6 +2845,9 @@ static int bcm_enetsw_remove(struct plat + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(res->start, resource_size(res)); + ++ clk_disable_unprepare(priv->mac_clk); ++ clk_put(priv->mac_clk); ++ + free_netdev(dev); + return 0; + } diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch new file mode 100644 index 000000000..22c6d0187 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-09-bcm63xx_enet-do-not-write-to-random-DMA-channel-on-B.patch @@ -0,0 +1,29 @@ +From 23d94cb855b6f4f0ee1c01679224472104ac6440 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 30 Sep 2017 14:10:18 +0200 +Subject: [PATCH 2/6] bcm63xx_enet: do not write to random DMA channel on + BCM6345 + +The DMA controller regs actually point to DMA channel 0, so the write to +ENETDMA_CFG_REG will actually modify a random DMA channel. + +Since DMA controller registers do not exist on BCM6345, guard the write +with the usual check for dma_has_sram. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1063,7 +1063,8 @@ static int bcm_enet_open(struct net_devi + val = enet_readl(priv, ENET_CTL_REG); + val |= ENET_CTL_ENABLE_MASK; + enet_writel(priv, val, ENET_CTL_REG); +- enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); ++ if (priv->dma_has_sram) ++ enet_dma_writel(priv, ENETDMA_CFG_EN_MASK, ENETDMA_CFG_REG); + enet_dmac_writel(priv, priv->dma_chan_en_mask, + ENETDMAC_CHANCFG, priv->rx_chan); + diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch new file mode 100644 index 000000000..b14dedcd7 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-10-bcm63xx_enet-do-not-rely-on-probe-order.patch @@ -0,0 +1,41 @@ +From 71710bb6cbc82f411a4e5faafa0c3178e48e7137 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 30 May 2017 13:31:45 +0200 +Subject: [PATCH 3/6] bcm63xx_enet: do not rely on probe order + +Do not rely on the shared device being probed before the enet(sw) +devices. This makes it easier to eventually move out the shared +device as a dma controller driver (what it should be). + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 ++------- + 1 file changed, 2 insertions(+), 7 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1736,10 +1736,8 @@ static int bcm_enet_probe(struct platfor + const char *clk_name; + int i, ret; + +- /* stop if shared driver failed, assume driver->probe will be +- * called in the same order we register devices (correct ?) */ + if (!bcm_enet_shared_base[0]) +- return -ENODEV; ++ return -EPROBE_DEFER; + + res_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); + res_irq_rx = platform_get_resource(pdev, IORESOURCE_IRQ, 1); +@@ -2720,11 +2718,8 @@ static int bcm_enetsw_probe(struct platf + struct resource *res_mem; + int ret, irq_rx, irq_tx; + +- /* stop if shared driver failed, assume driver->probe will be +- * called in the same order we register devices (correct ?) +- */ + if (!bcm_enet_shared_base[0]) +- return -ENODEV; ++ return -EPROBE_DEFER; + + res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + irq_rx = platform_get_irq(pdev, 0); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch new file mode 100644 index 000000000..ae009064b --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-11-bcm63xx_enet-use-managed-functions-for-clock-ioremap.patch @@ -0,0 +1,150 @@ +From 179a445ae4ef36ec44f4aea18e5f42d21334d186 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sat, 25 Feb 2017 12:39:25 +0100 +Subject: [PATCH 4/6] bcm63xx_enet: use managed functions for clock/ioremap + +Use managed functions where possible to reduce the amount of resource +handling on error and remove paths. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 54 +++++++--------------------- + 1 file changed, 12 insertions(+), 42 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1781,14 +1781,14 @@ static int bcm_enet_probe(struct platfor + clk_name = "enet1"; + } + +- priv->mac_clk = clk_get(&pdev->dev, clk_name); ++ priv->mac_clk = devm_clk_get(&pdev->dev, clk_name); + if (IS_ERR(priv->mac_clk)) { + ret = PTR_ERR(priv->mac_clk); + goto out; + } + ret = clk_prepare_enable(priv->mac_clk); + if (ret) +- goto out_put_clk_mac; ++ goto out; + + /* initialize default and fetch platform data */ + priv->rx_ring_size = BCMENET_DEF_RX_DESC; +@@ -1816,7 +1816,7 @@ static int bcm_enet_probe(struct platfor + + if (priv->mac_id == 0 && priv->has_phy && !priv->use_external_mii) { + /* using internal PHY, enable clock */ +- priv->phy_clk = clk_get(&pdev->dev, "ephy"); ++ priv->phy_clk = devm_clk_get(&pdev->dev, "ephy"); + if (IS_ERR(priv->phy_clk)) { + ret = PTR_ERR(priv->phy_clk); + priv->phy_clk = NULL; +@@ -1824,7 +1824,7 @@ static int bcm_enet_probe(struct platfor + } + ret = clk_prepare_enable(priv->phy_clk); + if (ret) +- goto out_put_clk_phy; ++ goto out_disable_clk_mac; + } + + /* do minimal hardware init to be able to probe mii bus */ +@@ -1927,14 +1927,8 @@ out_uninit_hw: + if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); + +-out_put_clk_phy: +- if (priv->phy_clk) +- clk_put(priv->phy_clk); +- + out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); +-out_put_clk_mac: +- clk_put(priv->mac_clk); + out: + free_netdev(dev); + return ret; +@@ -1970,12 +1964,10 @@ static int bcm_enet_remove(struct platfo + } + + /* disable hw block clocks */ +- if (priv->phy_clk) { ++ if (priv->phy_clk) + clk_disable_unprepare(priv->phy_clk); +- clk_put(priv->phy_clk); +- } ++ + clk_disable_unprepare(priv->mac_clk); +- clk_put(priv->mac_clk); + + free_netdev(dev); + return 0; +@@ -2758,26 +2750,20 @@ static int bcm_enetsw_probe(struct platf + if (ret) + goto out; + +- if (!request_mem_region(res_mem->start, resource_size(res_mem), +- "bcm63xx_enetsw")) { +- ret = -EBUSY; ++ priv->base = devm_ioremap_resource(&pdev->dev, res_mem); ++ if (IS_ERR(priv->base)) { ++ ret = PTR_ERR(priv->base); + goto out; + } + +- priv->base = ioremap(res_mem->start, resource_size(res_mem)); +- if (priv->base == NULL) { +- ret = -ENOMEM; +- goto out_release_mem; +- } +- +- priv->mac_clk = clk_get(&pdev->dev, "enetsw"); ++ priv->mac_clk = devm_clk_get(&pdev->dev, "enetsw"); + if (IS_ERR(priv->mac_clk)) { + ret = PTR_ERR(priv->mac_clk); +- goto out_unmap; ++ goto out; + } + ret = clk_prepare_enable(priv->mac_clk); + if (ret) +- goto out_put_clk; ++ goto out; + + priv->rx_chan = 0; + priv->tx_chan = 1; +@@ -2809,15 +2795,6 @@ static int bcm_enetsw_probe(struct platf + + out_disable_clk: + clk_disable_unprepare(priv->mac_clk); +- +-out_put_clk: +- clk_put(priv->mac_clk); +- +-out_unmap: +- iounmap(priv->base); +- +-out_release_mem: +- release_mem_region(res_mem->start, resource_size(res_mem)); + out: + free_netdev(dev); + return ret; +@@ -2829,20 +2806,13 @@ static int bcm_enetsw_remove(struct plat + { + struct bcm_enet_priv *priv; + struct net_device *dev; +- struct resource *res; + + /* stop netdevice */ + dev = platform_get_drvdata(pdev); + priv = netdev_priv(dev); + unregister_netdev(dev); + +- /* release device resources */ +- iounmap(priv->base); +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- release_mem_region(res->start, resource_size(res)); +- + clk_disable_unprepare(priv->mac_clk); +- clk_put(priv->mac_clk); + + free_netdev(dev); + return 0; diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch new file mode 100644 index 000000000..957c0f372 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-12-bcm63xx_enet-drop-unneeded-NULL-phy_clk-check.patch @@ -0,0 +1,36 @@ +From 555baec974ede81e616ca88ac6d3fca09239368f Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Tue, 18 Jul 2017 13:18:01 +0200 +Subject: [PATCH 5/6] bcm63xx_enet: drop unneeded NULL phy_clk check + +clk_disable and clk_unprepare are NULL-safe, so need to duplicate the +NULL check of the functions. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c +@@ -1924,8 +1924,7 @@ out_free_mdio: + out_uninit_hw: + /* turn off mdc clock */ + enet_writel(priv, 0, ENET_MIISC_REG); +- if (priv->phy_clk) +- clk_disable_unprepare(priv->phy_clk); ++ clk_disable_unprepare(priv->phy_clk); + + out_disable_clk_mac: + clk_disable_unprepare(priv->mac_clk); +@@ -1964,9 +1963,7 @@ static int bcm_enet_remove(struct platfo + } + + /* disable hw block clocks */ +- if (priv->phy_clk) +- clk_disable_unprepare(priv->phy_clk); +- ++ clk_disable_unprepare(priv->phy_clk); + clk_disable_unprepare(priv->mac_clk); + + free_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch new file mode 100644 index 000000000..482bd5892 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/001-4.15-13-bcm63xx_enet-remove-unneeded-include.patch @@ -0,0 +1,22 @@ +From 77364ce98037972fb1c57d0ee0418eb1c2b26521 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 29 May 2017 13:11:14 +0200 +Subject: [PATCH 6/6] bcm63xx_enet: remove unneeded include + +We don't use anyhing from that file, so drop it. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/broadcom/bcm63xx_enet.h | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h ++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h +@@ -8,7 +8,6 @@ + #include + + #include +-#include + #include + #include + diff --git a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch index 63d385be4..67c5ef450 100644 --- a/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch +++ b/target/linux/brcm63xx/patches-4.4/100-MIPS-BCM63XX-add-USB-host-clock-enable-delay.patch @@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -177,6 +177,11 @@ static void usbh_set(struct clk *clk, in +@@ -213,6 +213,11 @@ static void usbh_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBH_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); diff --git a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch index 43bbcd10e..1001df375 100644 --- a/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch +++ b/target/linux/brcm63xx/patches-4.4/101-MIPS-BCM63XX-add-USB-device-clock-enable-delay-to-cl.patch @@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -199,6 +199,11 @@ static void usbd_set(struct clk *clk, in +@@ -235,6 +235,11 @@ static void usbd_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBD_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); diff --git a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch index 75a3a23a9..0a96e1bbb 100644 --- a/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch +++ b/target/linux/brcm63xx/patches-4.4/111-MIPS-BCM63XX-allow-NULL-clock-for-clk_get_rate.patch @@ -36,7 +36,7 @@ Reviewed-by: Florian Fainelli --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -345,6 +345,9 @@ EXPORT_SYMBOL(clk_disable); +@@ -389,6 +389,9 @@ EXPORT_SYMBOL(clk_disable); unsigned long clk_get_rate(struct clk *clk) { diff --git a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch index 57614c270..27c2d0908 100644 --- a/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch +++ b/target/linux/brcm63xx/patches-4.4/130-pinctrl-add-bcm63xx-base-code.patch @@ -21,7 +21,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -247,6 +247,7 @@ config PINCTRL_ZYNQ +@@ -248,6 +248,7 @@ config PINCTRL_ZYNQ This selectes the pinctrl driver for Xilinx Zynq. source "drivers/pinctrl/bcm/Kconfig" diff --git a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch index 9d086a65f..6a9b9e080 100644 --- a/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch +++ b/target/linux/brcm63xx/patches-4.4/140-pinctrl-add-a-pincontrol-driver-for-BCM6368.patch @@ -575,7 +575,7 @@ Signed-off-by: Jonas Gorski + if (!pctl) + return -ENOMEM; + -+ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, mode, overlay); ++ pctl->overlay = devm_regmap_field_alloc(&pdev->dev, basemode, overlay); + if (IS_ERR(pctl->overlay)) + return PTR_ERR(pctl->overlay); + diff --git a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch index 25b0df5dc..85abad4d3 100644 --- a/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch +++ b/target/linux/brcm63xx/patches-4.4/339-MIPS-BCM63XX-add-support-for-BCM63268.patch @@ -46,16 +46,16 @@ Signed-off-by: Jonas Gorski val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -133,6 +133,8 @@ static void enetsw_set(struct clk *clk, - CKCTL_6368_SWPKT_USB_EN | - CKCTL_6368_SWPKT_SAR_EN, - enable); -+ else if (BCMCPU_IS_63268()) +@@ -168,6 +168,8 @@ static void enetsw_set(struct clk *clk, + clk_disable_unlocked(&clk_swpkt_sar); + } + bcm_hwclock_set(CKCTL_6368_ROBOSW_EN, enable); ++ } else if (BCMCPU_IS_63268()) { + bcm_hwclock_set(CKCTL_63268_ROBOSW_EN, enable); - else + } else { return; - -@@ -177,6 +179,8 @@ static void usbh_set(struct clk *clk, in + } +@@ -213,6 +215,8 @@ static void usbh_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBH_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); @@ -64,7 +64,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -199,6 +203,8 @@ static void usbd_set(struct clk *clk, in +@@ -235,6 +239,8 @@ static void usbd_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6362_USBD_EN, enable); else if (BCMCPU_IS_6368()) bcm_hwclock_set(CKCTL_6368_USBD_EN, enable); @@ -73,7 +73,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -225,9 +231,13 @@ static void spi_set(struct clk *clk, int +@@ -261,9 +267,13 @@ static void spi_set(struct clk *clk, int mask = CKCTL_6358_SPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_SPI_EN; @@ -89,7 +89,7 @@ Signed-off-by: Jonas Gorski bcm_hwclock_set(mask, enable); } -@@ -246,6 +256,8 @@ static void hsspi_set(struct clk *clk, i +@@ -282,6 +292,8 @@ static void hsspi_set(struct clk *clk, i mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; @@ -98,7 +98,7 @@ Signed-off-by: Jonas Gorski else return; -@@ -307,6 +319,8 @@ static void pcie_set(struct clk *clk, in +@@ -351,6 +363,8 @@ static void pcie_set(struct clk *clk, in bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable); else if (BCMCPU_IS_6362()) bcm_hwclock_set(CKCTL_6362_PCIE_EN, enable); @@ -107,28 +107,39 @@ Signed-off-by: Jonas Gorski } static struct clk clk_pcie = { -@@ -389,9 +403,11 @@ struct clk *clk_get(struct device *dev, - return &clk_periph; - if ((BCMCPU_IS_3368() || BCMCPU_IS_6358()) && !strcmp(id, "pcm")) - return &clk_pcm; -- if ((BCMCPU_IS_6362() || BCMCPU_IS_6368()) && !strcmp(id, "ipsec")) -+ if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && -+ !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362()) && !strcmp(id, "pcie")) -+ if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); - } -@@ -414,6 +430,7 @@ static int __init bcm63xx_clk_init(void) - clk_hsspi.rate = HSSPI_PLL_HZ_6328; +@@ -532,6 +546,21 @@ static struct clk_lookup bcm6368_clks[] + CLKDEV_INIT(NULL, "ipsec", &clk_ipsec), + }; + ++static struct clk_lookup bcm63268_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbd), ++ CLKDEV_INIT(NULL, "spi", &clk_spi), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ + #define HSSPI_PLL_HZ_6328 133333333 + #define HSSPI_PLL_HZ_6362 400000000 + +@@ -564,6 +593,10 @@ static int __init bcm63xx_clk_init(void) + case BCM6368_CPU_ID: + clkdev_add_table(bcm6368_clks, ARRAY_SIZE(bcm6368_clks)); break; - case BCM6362_CPU_ID: + case BCM63268_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6362; - break; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6362; ++ clkdev_add_table(bcm63268_clks, ARRAY_SIZE(bcm63268_clks)); ++ break; } + + return 0; --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -101,6 +101,15 @@ static const int bcm6368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch index 3b0995afc..3b5da024b 100644 --- a/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/341-MIPS-BCM63XX-add-support-for-BCM6318.patch @@ -46,7 +46,7 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 val = bcm_mpi_readl(MPI_CSBASE_REG(0)); --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -252,7 +252,9 @@ static void hsspi_set(struct clk *clk, i +@@ -288,7 +288,9 @@ static void hsspi_set(struct clk *clk, i { u32 mask; @@ -57,23 +57,45 @@ Subject: [PATCH 51/53] MIPS: BCM63XX: add support for BCM6318 mask = CKCTL_6328_HSSPI_EN; else if (BCMCPU_IS_6362()) mask = CKCTL_6362_HSSPI_EN; -@@ -420,12 +422,16 @@ void clk_put(struct clk *clk) +@@ -440,6 +442,19 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT("bcm63xx_enet.1", "enet", &clk_enet1), + }; - EXPORT_SYMBOL(clk_put); ++static struct clk_lookup bcm6318_clks[] = { ++ /* fixed rate clocks */ ++ CLKDEV_INIT(NULL, "periph", &clk_periph), ++ CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ /* gated clocks */ ++ CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), ++ CLKDEV_INIT(NULL, "usbh", &clk_usbh), ++ CLKDEV_INIT(NULL, "usbd", &clk_usbh), ++ CLKDEV_INIT(NULL, "hsspi", &clk_hsspi), ++ CLKDEV_INIT(NULL, "pcie", &clk_pcie), ++}; ++ + static struct clk_lookup bcm6328_clks[] = { + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), +@@ -561,6 +576,7 @@ static struct clk_lookup bcm63268_clks[] + CLKDEV_INIT(NULL, "pcie", &clk_pcie), + }; +#define HSSPI_PLL_HZ_6318 250000000 #define HSSPI_PLL_HZ_6328 133333333 #define HSSPI_PLL_HZ_6362 400000000 - static int __init bcm63xx_clk_init(void) - { - switch (bcm63xx_get_cpu_id()) { +@@ -570,6 +586,10 @@ static int __init bcm63xx_clk_init(void) + case BCM3368_CPU_ID: + clkdev_add_table(bcm3368_clks, ARRAY_SIZE(bcm3368_clks)); + break; + case BCM6318_CPU_ID: -+ clk_hsspi.rate = HSSPI_PLL_HZ_6318; ++ clk_hsspi_pll.rate = HSSPI_PLL_HZ_6318; ++ clkdev_add_table(bcm6318_clks, ARRAY_SIZE(bcm6318_clks)); + break; case BCM6328_CPU_ID: - clk_hsspi.rate = HSSPI_PLL_HZ_6328; - break; + clk_hsspi_pll.rate = HSSPI_PLL_HZ_6328; + clkdev_add_table(bcm6328_clks, ARRAY_SIZE(bcm6328_clks)); --- a/arch/mips/bcm63xx/cpu.c +++ b/arch/mips/bcm63xx/cpu.c @@ -41,6 +41,14 @@ static const int bcm3368_irqs[] = { diff --git a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch index 3e28a38e0..cc2937c57 100644 --- a/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch +++ b/target/linux/brcm63xx/patches-4.4/343-MIPS-BCM63XX-add-PCIe-support-for-BCM6318.patch @@ -13,7 +13,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -50,6 +50,18 @@ static void bcm_hwclock_set(u32 mask, in +@@ -51,6 +51,18 @@ static void bcm_hwclock_set(u32 mask, in bcm_perf_writel(reg, PERF_CKCTL_REG); } @@ -32,7 +32,7 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -317,12 +329,17 @@ static struct clk clk_ipsec = { +@@ -361,12 +373,17 @@ static struct clk clk_ipsec = { static void pcie_set(struct clk *clk, int enable) { @@ -53,15 +53,6 @@ Subject: [PATCH 53/53] MIPS: BCM63XX: add PCIe support for BCM6318 } static struct clk clk_pcie = { -@@ -408,7 +425,7 @@ struct clk *clk_get(struct device *dev, - if ((BCMCPU_IS_6362() || BCMCPU_IS_6368() || BCMCPU_IS_63268()) && - !strcmp(id, "ipsec")) - return &clk_ipsec; -- if ((BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && -+ if ((BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6362() || BCMCPU_IS_63268()) && - !strcmp(id, "pcie")) - return &clk_pcie; - return ERR_PTR(-ENOENT); --- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h +++ b/arch/mips/include/asm/mach-bcm63xx/bcm63xx_io.h @@ -40,6 +40,12 @@ diff --git a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch index 947f7223f..8e4efeb8d 100644 --- a/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch +++ b/target/linux/brcm63xx/patches-4.4/346-MIPS-BCM63XX-USB-ENETSW-6318-clocks.patch @@ -1,19 +1,19 @@ --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -136,7 +136,11 @@ static struct clk clk_ephy = { +@@ -167,7 +167,11 @@ static struct clk clk_swpkt_usb = { */ static void enetsw_set(struct clk *clk, int enable) { -- if (BCMCPU_IS_6328()) +- if (BCMCPU_IS_6328()) { + if (BCMCPU_IS_6318()) { + bcm_hwclock_set(CKCTL_6318_ROBOSW250_EN | + CKCTL_6318_ROBOSW025_EN, enable); + bcm_ub_hwclock_set(UB_CKCTL_6318_ROBOSW_EN, enable); -+ } else if (BCMCPU_IS_6328()) ++ } else if (BCMCPU_IS_6328()) { bcm_hwclock_set(CKCTL_6328_ROBOSW_EN, enable); - else if (BCMCPU_IS_6362()) + } else if (BCMCPU_IS_6362()) { bcm_hwclock_set(CKCTL_6362_ROBOSW_EN, enable); -@@ -183,18 +187,22 @@ static struct clk clk_pcm = { +@@ -219,18 +223,22 @@ static struct clk clk_pcm = { */ static void usbh_set(struct clk *clk, int enable) { @@ -42,15 +42,3 @@ if (enable) msleep(100); -@@ -408,9 +416,9 @@ struct clk *clk_get(struct device *dev, - return &clk_enetsw; - if (!strcmp(id, "ephy")) - return &clk_ephy; -- if (!strcmp(id, "usbh")) -+ if (!strcmp(id, "usbh") || (BCMCPU_IS_6318() && !strcmp(id, "usbd"))) - return &clk_usbh; -- if (!strcmp(id, "usbd")) -+ if (!strcmp(id, "usbd") && !BCMCPU_IS_6318()) - return &clk_usbd; - if (!strcmp(id, "spi")) - return &clk_spi; diff --git a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch index 10edbc4dd..0b8a5a170 100644 --- a/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch +++ b/target/linux/brcm63xx/patches-4.4/348-MIPS-BCM63XX-fix-BCM63268-USB-clock.patch @@ -24,7 +24,7 @@ #define STRAPBUS_6328_FCVO_MASK (0x1f << STRAPBUS_6328_FCVO_SHIFT) --- a/arch/mips/bcm63xx/clk.c +++ b/arch/mips/bcm63xx/clk.c -@@ -62,6 +62,26 @@ static void bcm_ub_hwclock_set(u32 mask, +@@ -63,6 +63,26 @@ static void bcm_ub_hwclock_set(u32 mask, bcm_perf_writel(reg, PERF_UB_CKCTL_REG); } @@ -51,7 +51,7 @@ /* * Ethernet MAC "misc" clock: dma clocks and main clock on 6348 */ -@@ -199,7 +219,17 @@ static void usbh_set(struct clk *clk, in +@@ -235,7 +255,17 @@ static void usbh_set(struct clk *clk, in } else if (BCMCPU_IS_6368()) { bcm_hwclock_set(CKCTL_6368_USBH_EN, enable); } else if (BCMCPU_IS_63268()) { diff --git a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch deleted file mode 100644 index db3fc5bc3..000000000 --- a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch +++ /dev/null @@ -1,46 +0,0 @@ -From ec905f2ea78ec40602a685ede31c5e4f9893d196 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Sat, 21 Feb 2015 16:35:07 +0100 -Subject: [PATCH 3/6] net: bcm63xx_enet: use named gpio for ephy reset gpio - -Allow using a named optional gpio for ephy reset gpio registration. ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include - #include "bcm63xx_enet.h" -@@ -2851,10 +2852,15 @@ static int bcm_enet_shared_probe(struct - { - struct resource *res; - void __iomem *p[3]; -+ struct gpio_desc *ephy_reset; - unsigned int i; - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ if (IS_ERR(ephy_reset)) -+ return PTR_ERR(ephy_reset); -+ - for (i = 0; i < 3; i++) { - res = platform_get_resource(pdev, IORESOURCE_MEM, i); - p[i] = devm_ioremap_resource(&pdev->dev, res); -@@ -2864,6 +2870,9 @@ static int bcm_enet_shared_probe(struct - - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - -+ if (ephy_reset) -+ gpiod_direction_output(ephy_reset, 0); -+ - return 0; - } - diff --git a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch index e71791fc6..2259b024a 100644 --- a/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch +++ b/target/linux/brcm63xx/patches-4.4/377-MIPS-BCM63XX-register-lookup-for-ephy-reset-gpio.patch @@ -72,7 +72,7 @@ Signed-off-by: Jonas Gorski } + +static struct gpiod_lookup_table ephy_reset = { -+ .dev_id = "bcm63xx_enet_shared.0", ++ .dev_id = "bcm63xx_enet-0", + .table = { + { /* filled at runtime */ }, + { }, diff --git a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch b/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch deleted file mode 100644 index dc9e3c134..000000000 --- a/target/linux/brcm63xx/patches-4.4/381-net-bcm63xx_enet-fully-reset-ephy.patch +++ /dev/null @@ -1,28 +0,0 @@ -From: Jonas Gorski -Subject: [PATCH] net: bcm63xx_enet: fully reset ephy - -Signed-off-by: Jonas Gorski ---- - drivers/net/ethernet/broadcom/bcm63xx_enet.c | 4 ++-- - 1 file changed, 2 insertions(+), , 1 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c -+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2857,7 +2857,7 @@ static int bcm_enet_shared_probe(struct - - memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base)); - -- ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS); -+ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_OUT_HIGH); - if (IS_ERR(ephy_reset)) - return PTR_ERR(ephy_reset); - -@@ -2871,7 +2871,7 @@ static int bcm_enet_shared_probe(struct - memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base)); - - if (ephy_reset) -- gpiod_direction_output(ephy_reset, 0); -+ gpiod_set_value(ephy_reset, 0); - - return 0; - } diff --git a/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch new file mode 100644 index 000000000..3b2dda121 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/389-MIPS-BCM63XX-add-clkdev-lookups-for-device-tree.patch @@ -0,0 +1,105 @@ +From cad8f63047c0691e8185d3c9c6a2705b83310c9c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 31 Jul 2017 20:10:36 +0200 +Subject: [PATCH] MIPS: BCM63XX: add clkdev lookups for device tree + +--- + arch/mips/bcm63xx/clk.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/arch/mips/bcm63xx/clk.c ++++ b/arch/mips/bcm63xx/clk.c +@@ -485,6 +485,8 @@ static struct clk_lookup bcm3368_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("fff8c100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fff8c120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -501,7 +503,9 @@ static struct clk_lookup bcm6318_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10003000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -515,7 +519,10 @@ static struct clk_lookup bcm6328_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -528,6 +535,7 @@ static struct clk_lookup bcm6338_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -542,6 +550,7 @@ static struct clk_lookup bcm6345_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -556,6 +565,7 @@ static struct clk_lookup bcm6348_clks[] + /* fixed rate clocks */ + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0300.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -572,6 +582,8 @@ static struct clk_lookup bcm6358_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("fffe0120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enet0", &clk_enet0), + CLKDEV_INIT(NULL, "enet1", &clk_enet1), +@@ -591,7 +603,10 @@ static struct clk_lookup bcm6362_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -607,6 +622,8 @@ static struct clk_lookup bcm6368_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000100.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("10000120.serial", "refclk", &clk_periph), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), +@@ -621,7 +638,10 @@ static struct clk_lookup bcm63268_clks[] + CLKDEV_INIT(NULL, "periph", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.0", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx_uart.1", "refclk", &clk_periph), ++ CLKDEV_INIT("10000180.serial", "refclk", &clk_periph), ++ CLKDEV_INIT("100001a0.serial", "refclk", &clk_periph), + CLKDEV_INIT("bcm63xx-hsspi.0", "pll", &clk_hsspi_pll), ++ CLKDEV_INIT("10001000.spi", "pll", &clk_hsspi_pll), + /* gated clocks */ + CLKDEV_INIT(NULL, "enetsw", &clk_enetsw), + CLKDEV_INIT(NULL, "usbh", &clk_usbh), diff --git a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch index 10db690b5..084ef9ee8 100644 --- a/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch +++ b/target/linux/brcm63xx/patches-4.4/390-MIPS-BCM63XX-do-not-register-SPI-controllers.patch @@ -33,3 +33,138 @@ Signed-off-by: Jonas Gorski bcm63xx_flash_register(); bcm63xx_led_data.num_leds = ARRAY_SIZE(board.leds); +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ + setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ +- dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ ++ dev-pcmcia.o dev-rng.o dev-uart.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-hsspi.c ++++ /dev/null +@@ -1,48 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2012 Jonas Gorski +- */ +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_resources[] = { +- { +- .start = -1, /* filled at runtime */ +- .end = -1, /* filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- .start = -1, /* filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_hsspi_device = { +- .name = "bcm63xx-hsspi", +- .id = 0, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_hsspi_register(void) +-{ +- if (!BCMCPU_IS_6318() && !BCMCPU_IS_6328() && !BCMCPU_IS_6362() && +- !BCMCPU_IS_63268()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_HSSPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[0].end += RSET_HSSPI_SIZE - 1; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_HSSPI); +- +- return platform_device_register(&bcm63xx_hsspi_device); +-} +--- a/arch/mips/bcm63xx/dev-spi.c ++++ /dev/null +@@ -1,60 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2009-2011 Florian Fainelli +- * Copyright (C) 2010 Tanguy Bouzeloc +- */ +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-static struct resource spi_resources[] = { +- { +- .start = -1, /* filled at runtime */ +- .end = -1, /* filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- .start = -1, /* filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_spi_device = { +- .id = -1, +- .num_resources = ARRAY_SIZE(spi_resources), +- .resource = spi_resources, +-}; +- +-int __init bcm63xx_spi_register(void) +-{ +- if (BCMCPU_IS_6318() || BCMCPU_IS_6328() || BCMCPU_IS_6345()) +- return -ENODEV; +- +- spi_resources[0].start = bcm63xx_regset_address(RSET_SPI); +- spi_resources[0].end = spi_resources[0].start; +- spi_resources[1].start = bcm63xx_get_irq_number(IRQ_SPI); +- +- if (BCMCPU_IS_6338() || BCMCPU_IS_6348()) { +- bcm63xx_spi_device.name = "bcm6348-spi", +- spi_resources[0].end += BCM_6348_RSET_SPI_SIZE - 1; +- } +- +- if (BCMCPU_IS_3368() || BCMCPU_IS_6358() || BCMCPU_IS_6362() || +- BCMCPU_IS_6368() || BCMCPU_IS_63268()) { +- bcm63xx_spi_device.name = "bcm6358-spi", +- spi_resources[0].end += BCM_6358_RSET_SPI_SIZE - 1; +- } +- +- return platform_device_register(&bcm63xx_spi_device); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_hsspi.h ++++ /dev/null +@@ -1,8 +0,0 @@ +-#ifndef BCM63XX_DEV_HSSPI_H +-#define BCM63XX_DEV_HSSPI_H +- +-#include +- +-int bcm63xx_hsspi_register(void); +- +-#endif /* BCM63XX_DEV_HSSPI_H */ diff --git a/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch new file mode 100644 index 000000000..e033ea3a4 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/391-MIPS-BCM63XX-do-not-register-uart.patch @@ -0,0 +1,257 @@ +--- a/arch/mips/bcm63xx/Makefile ++++ b/arch/mips/bcm63xx/Makefile +@@ -1,6 +1,6 @@ + obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ + setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ +- dev-pcmcia.o dev-rng.o dev-uart.o \ ++ dev-pcmcia.o dev-rng.o \ + dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ + usb-common.o sprom.o + obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +--- a/arch/mips/bcm63xx/dev-uart.c ++++ /dev/null +@@ -1,76 +0,0 @@ +-/* +- * This file is subject to the terms and conditions of the GNU General Public +- * License. See the file "COPYING" in the main directory of this archive +- * for more details. +- * +- * Copyright (C) 2008 Maxime Bizon +- */ +- +-#include +-#include +-#include +-#include +- +-static struct resource uart0_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct resource uart1_resources[] = { +- { +- /* start & end filled at runtime */ +- .flags = IORESOURCE_MEM, +- }, +- { +- /* start filled at runtime */ +- .flags = IORESOURCE_IRQ, +- }, +-}; +- +-static struct platform_device bcm63xx_uart_devices[] = { +- { +- .name = "bcm63xx_uart", +- .id = 0, +- .num_resources = ARRAY_SIZE(uart0_resources), +- .resource = uart0_resources, +- }, +- +- { +- .name = "bcm63xx_uart", +- .id = 1, +- .num_resources = ARRAY_SIZE(uart1_resources), +- .resource = uart1_resources, +- } +-}; +- +-int __init bcm63xx_uart_register(unsigned int id) +-{ +- if (id >= ARRAY_SIZE(bcm63xx_uart_devices)) +- return -ENODEV; +- +- if (id == 1 && (!BCMCPU_IS_3368() && !BCMCPU_IS_6358() && +- !BCMCPU_IS_6368())) +- return -ENODEV; +- +- if (id == 0) { +- uart0_resources[0].start = bcm63xx_regset_address(RSET_UART0); +- uart0_resources[0].end = uart0_resources[0].start + +- RSET_UART_SIZE - 1; +- uart0_resources[1].start = bcm63xx_get_irq_number(IRQ_UART0); +- } +- +- if (id == 1) { +- uart1_resources[0].start = bcm63xx_regset_address(RSET_UART1); +- uart1_resources[0].end = uart1_resources[0].start + +- RSET_UART_SIZE - 1; +- uart1_resources[1].start = bcm63xx_get_irq_number(IRQ_UART1); +- } +- +- return platform_device_register(&bcm63xx_uart_devices[id]); +-} +--- a/arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_uart.h ++++ /dev/null +@@ -1,6 +0,0 @@ +-#ifndef BCM63XX_DEV_UART_H_ +-#define BCM63XX_DEV_UART_H_ +- +-int bcm63xx_uart_register(unsigned int id); +- +-#endif /* BCM63XX_DEV_UART_H_ */ +--- a/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h ++++ b/arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +@@ -33,8 +33,6 @@ struct board_info { + unsigned int has_ehci0:1; + unsigned int has_usbd:1; + unsigned int has_dsp:1; +- unsigned int has_uart0:1; +- unsigned int has_uart1:1; + unsigned int use_fallback_sprom:1; + + /* ethernet config */ +--- a/arch/mips/bcm63xx/boards/board_common.c ++++ b/arch/mips/bcm63xx/boards/board_common.c +@@ -20,7 +20,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -189,12 +188,6 @@ int __init board_register_devices(void) + + bcm63xx_gpio_init(); + +- if (board.has_uart0) +- bcm63xx_uart_register(0); +- +- if (board.has_uart1) +- bcm63xx_uart_register(1); +- + if (board.has_pccard) + bcm63xx_pcmcia_register(); + +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -35,9 +35,6 @@ static struct board_info __initdata boar + .name = "CVG834G_E15R3921", + .expected_cpu_id = 0x3368, + +- .has_uart0 = 1, +- .has_uart1 = 1, +- + .has_enet0 = 1, + .has_pci = 1, + +@@ -67,7 +64,6 @@ static struct board_info __initdata boar + .name = "96328avng", + .expected_cpu_id = 0x6328, + +- .has_uart0 = 1, + .has_pci = 1, + .has_usbd = 0, + .use_fallback_sprom = 1, +@@ -116,7 +112,6 @@ static struct board_info __initdata boar + .name = "96338GW", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -159,7 +154,6 @@ static struct board_info __initdata boar + .name = "96338W", + .expected_cpu_id = 0x6338, + +- .has_uart0 = 1, + .has_enet0 = 1, + .enet0 = { + .force_speed_100 = 1, +@@ -204,8 +198,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96345gw2 = { + .name = "96345GW2", + .expected_cpu_id = 0x6345, +- +- .has_uart0 = 1, + }; + #endif + +@@ -217,7 +209,6 @@ static struct board_info __initdata boar + .name = "96348R", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, +@@ -262,7 +253,6 @@ static struct board_info __initdata boar + .name = "96348GW-10", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -323,7 +313,6 @@ static struct board_info __initdata boar + .name = "96348GW-11", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -378,7 +367,6 @@ static struct board_info __initdata boar + .name = "96348GW", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -437,7 +425,6 @@ static struct board_info __initdata boar + .name = "F@ST2404", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -482,7 +469,6 @@ static struct board_info __initdata boar + .name = "DV201AMR", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, +@@ -503,7 +489,6 @@ static struct board_info __initdata boar + .name = "96348GW-A", + .expected_cpu_id = 0x6348, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -530,7 +515,6 @@ static struct board_info __initdata boar + .name = "96358VW", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -583,7 +567,6 @@ static struct board_info __initdata boar + .name = "96358VW2", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, +@@ -633,7 +616,6 @@ static struct board_info __initdata boar + .name = "AGPF-S0", + .expected_cpu_id = 0x6358, + +- .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch similarity index 85% rename from target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch rename to target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch index 2ae8107ac..1bbbf9144 100644 --- a/target/linux/brcm63xx/patches-4.4/550-MIPS-BCM63XX-remove-leds-and-buttons.patch +++ b/target/linux/brcm63xx/patches-4.4/392-MIPS-BCM63XX-remove-leds-and-buttons.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -47,14 +47,6 @@ static struct board_info __initdata boar +@@ -43,14 +43,6 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, @@ -24,10 +24,11 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; -@@ -78,35 +70,6 @@ static struct board_info __initdata boar +@@ -72,35 +64,6 @@ static struct board_info __initdata boar + .use_fullspeed = 0, .port_no = 0, }, - +- - .leds = { - { - .name = "96328avng::ppp-fail", @@ -56,11 +57,10 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - .active_low = 1, - }, - }, -- - .has_enetsw = 1, + }; + #endif - .enetsw = { -@@ -445,35 +408,6 @@ static struct board_info __initdata boar +@@ -119,35 +82,6 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, @@ -96,7 +96,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96338w = { -@@ -488,35 +422,6 @@ static struct board_info __initdata boar +@@ -159,35 +93,6 @@ static struct board_info __initdata boar .force_speed_100 = 1, .force_duplex_full = 1, }, @@ -130,9 +130,9 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, - }, }; + #endif - static struct board_info __initdata board_96338w2_e7t = { -@@ -615,36 +520,6 @@ static struct board_info __initdata boar +@@ -217,36 +122,6 @@ static struct board_info __initdata boar .has_phy = 1, .use_internal_phy = 1, }, @@ -169,7 +169,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_10 = { -@@ -679,35 +554,6 @@ static struct board_info __initdata boar +@@ -278,35 +153,6 @@ static struct board_info __initdata boar .cs = 2, .ext_irq = 2, }, @@ -205,7 +205,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96348gw_11 = { -@@ -736,35 +582,6 @@ static struct board_info __initdata boar +@@ -332,35 +178,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -240,8 +240,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - -@@ -897,35 +714,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_96348gw = { +@@ -390,35 +207,6 @@ static struct board_info __initdata boar .ext_irq = 2, .cs = 2, }, @@ -276,8 +276,8 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_gw6200 = { -@@ -1262,33 +1050,6 @@ static struct board_info __initdata boar + static struct board_info __initdata board_FAST2404 = { +@@ -534,33 +322,6 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_pccard = 1, .has_ehci0 = 1, @@ -311,7 +311,7 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons }; static struct board_info __initdata board_96358vw2 = { -@@ -1318,29 +1079,6 @@ static struct board_info __initdata boar +@@ -587,29 +348,6 @@ static struct board_info __initdata boar .has_pccard = 1, .has_ehci0 = 1, .num_usbh_ports = 2, @@ -340,4 +340,4 @@ Subject: [PATCH] MIPS: BCM63XX: remove leds and buttons - }, }; - static struct board_info __initdata board_CPVA642 = { + static struct board_info __initdata board_AGPFS0 = { diff --git a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch index 334a93422..9227eb28a 100644 --- a/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch +++ b/target/linux/brcm63xx/patches-4.4/403-6358-enet1-external-mii-clk.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -99,6 +99,8 @@ void __init board_early_setup(const stru +@@ -98,6 +98,8 @@ void __init board_early_setup(const stru if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G3_EXT_MII | GPIO_MODE_6348_G0_EXT_MII; diff --git a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch index a1acd614a..7c2b686a9 100644 --- a/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch +++ b/target/linux/brcm63xx/patches-4.4/404-NET-bcm63xx_enet-move-phy_-dis-connect-into-probe-re.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonas Gorski --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -871,10 +871,8 @@ static int bcm_enet_open(struct net_devi +@@ -870,10 +870,8 @@ static int bcm_enet_open(struct net_devi struct bcm_enet_priv *priv; struct sockaddr addr; struct device *kdev; @@ -26,7 +26,7 @@ Signed-off-by: Jonas Gorski void *p; u32 val; -@@ -882,40 +880,10 @@ static int bcm_enet_open(struct net_devi +@@ -881,40 +879,10 @@ static int bcm_enet_open(struct net_devi kdev = &priv->pdev->dev; if (priv->has_phy) { @@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski } /* mask all interrupts and request them */ -@@ -925,7 +893,7 @@ static int bcm_enet_open(struct net_devi +@@ -924,7 +892,7 @@ static int bcm_enet_open(struct net_devi ret = request_irq(dev->irq, bcm_enet_isr_mac, 0, dev->name, dev); if (ret) @@ -100,7 +100,7 @@ Signed-off-by: Jonas Gorski return 0; } -@@ -1830,6 +1789,8 @@ static int bcm_enet_probe(struct platfor +@@ -1832,6 +1791,8 @@ static int bcm_enet_probe(struct platfor /* MII bus registration */ if (priv->has_phy) { @@ -109,7 +109,7 @@ Signed-off-by: Jonas Gorski priv->mii_bus = mdiobus_alloc(); if (!priv->mii_bus) { -@@ -1867,6 +1828,38 @@ static int bcm_enet_probe(struct platfor +@@ -1869,6 +1830,38 @@ static int bcm_enet_probe(struct platfor dev_err(&pdev->dev, "unable to register mdio bus\n"); goto out_free_mdio; } @@ -148,7 +148,7 @@ Signed-off-by: Jonas Gorski } else { /* run platform code to initialize PHY device */ -@@ -1912,6 +1905,9 @@ static int bcm_enet_probe(struct platfor +@@ -1914,6 +1907,9 @@ static int bcm_enet_probe(struct platfor return 0; out_unregister_mdio: @@ -158,7 +158,7 @@ Signed-off-by: Jonas Gorski if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); -@@ -1953,6 +1949,8 @@ static int bcm_enet_remove(struct platfo +@@ -1951,6 +1947,8 @@ static int bcm_enet_remove(struct platfo enet_writel(priv, 0, ENET_MIISC_REG); if (priv->has_phy) { diff --git a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch index 1cff9c1ff..cf3715e4f 100644 --- a/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch +++ b/target/linux/brcm63xx/patches-4.4/408-bcm63xx_enet-enable-rgmii-clock-on-external-ports.patch @@ -32,7 +32,7 @@ Subject: [PATCH 54/81] bcm63xx_enet: enable rgmii clock on external ports #define ENETSW_MDIOC_EXT_MASK (1 << 16) --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2229,6 +2229,18 @@ static int bcm_enetsw_open(struct net_de +@@ -2223,6 +2223,18 @@ static int bcm_enetsw_open(struct net_de priv->sw_port_link[i] = 0; } diff --git a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch index 6dab40d7e..608ad8e39 100644 --- a/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch +++ b/target/linux/brcm63xx/patches-4.4/411-MIPS-BCM63XX-Register-SPI-flash-if-present.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -17,9 +17,13 @@ +@@ -17,6 +17,9 @@ #include #include #include @@ -21,11 +21,7 @@ Signed-off-by: Jonas Gorski #include #include -+#include - #include - #include - -@@ -66,6 +70,41 @@ void __init bcm63xx_flash_force_phys_bas +@@ -66,6 +69,41 @@ void __init bcm63xx_flash_force_phys_bas mtd_resources[0].end = end; } @@ -67,7 +63,7 @@ Signed-off-by: Jonas Gorski static int __init bcm63xx_detect_flash_type(void) { u32 val; -@@ -73,9 +112,15 @@ static int __init bcm63xx_detect_flash_t +@@ -73,9 +111,15 @@ static int __init bcm63xx_detect_flash_t switch (bcm63xx_get_cpu_id()) { case BCM6318_CPU_ID: /* only support serial flash */ @@ -83,7 +79,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_6328_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -94,12 +139,20 @@ static int __init bcm63xx_detect_flash_t +@@ -94,12 +138,20 @@ static int __init bcm63xx_detect_flash_t return BCM63XX_FLASH_TYPE_SERIAL; case BCM6362_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_6362_REG); @@ -104,7 +100,7 @@ Signed-off-by: Jonas Gorski switch (val & STRAPBUS_6368_BOOT_SEL_MASK) { case STRAPBUS_6368_BOOT_SEL_NAND: return BCM63XX_FLASH_TYPE_NAND; -@@ -110,6 +163,11 @@ static int __init bcm63xx_detect_flash_t +@@ -110,6 +162,11 @@ static int __init bcm63xx_detect_flash_t } case BCM63268_CPU_ID: val = bcm_misc_readl(MISC_STRAPBUS_63268_REG); @@ -116,7 +112,7 @@ Signed-off-by: Jonas Gorski if (val & STRAPBUS_63268_BOOT_SEL_SERIAL) return BCM63XX_FLASH_TYPE_SERIAL; else -@@ -176,6 +234,7 @@ void __init bcm63xx_flash_detect(void) +@@ -176,6 +233,7 @@ void __init bcm63xx_flash_detect(void) int __init bcm63xx_flash_register(void) { @@ -124,7 +120,7 @@ Signed-off-by: Jonas Gorski u32 val; switch (flash_type) { -@@ -195,8 +254,14 @@ int __init bcm63xx_flash_register(void) +@@ -195,8 +253,14 @@ int __init bcm63xx_flash_register(void) return platform_device_register(&mtd_dev); case BCM63XX_FLASH_TYPE_SERIAL: diff --git a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch index d86e6a05f..a0ad6e6ce 100644 --- a/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch +++ b/target/linux/brcm63xx/patches-4.4/413-BCM63XX-allow-providing-fixup-data-in-board-data.patch @@ -10,7 +10,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -33,6 +33,7 @@ +@@ -32,6 +32,7 @@ #include #include #include @@ -18,7 +18,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #include "board_common.h" -@@ -179,6 +180,7 @@ static struct of_device_id of_ids[] = { +@@ -178,6 +179,7 @@ static struct of_device_id of_ids[] = { int __init board_register_devices(void) { int usbh_ports = 0; @@ -26,7 +26,7 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data #if CONFIG_OF if (of_have_populated_dt()) { -@@ -252,6 +254,10 @@ int __init board_register_devices(void) +@@ -245,6 +247,10 @@ int __init board_register_devices(void) board.ephy_reset_gpio_flags); } @@ -59,9 +59,9 @@ Subject: [PATCH 58/72] BCM63XX: allow providing fixup data in board data /* * board definition */ -@@ -36,6 +42,10 @@ struct board_info { - unsigned int has_uart0:1; - unsigned int has_uart1:1; +@@ -34,6 +40,10 @@ struct board_info { + unsigned int has_usbd:1; + unsigned int has_dsp:1; unsigned int use_fallback_sprom:1; + unsigned int has_caldata:2; + diff --git a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch index 9eb4e5e09..94c63c5e8 100644 --- a/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch +++ b/target/linux/brcm63xx/patches-4.4/415-MIPS-BCM63XX-export-the-attached-flash-type.patch @@ -11,7 +11,7 @@ Signed-off-by: Jonas Gorski --- a/arch/mips/bcm63xx/dev-flash.c +++ b/arch/mips/bcm63xx/dev-flash.c -@@ -271,3 +271,8 @@ int __init bcm63xx_flash_register(void) +@@ -270,3 +270,8 @@ int __init bcm63xx_flash_register(void) return -ENODEV; } } diff --git a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch index 7d012167c..0f6706a6b 100644 --- a/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/416-BCM63XX-add-a-fixup-for-ath9k-devices.patch @@ -15,7 +15,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.o setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ + dev-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - usb-common.o sprom.o + pci-ath9k-fixup.o usb-common.o sprom.o @@ -24,7 +24,7 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices obj-y += boards/ --- /dev/null +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -0,0 +1,201 @@ +@@ -0,0 +1,200 @@ +/* + * Broadcom BCM63XX Ath9k EEPROM fixup helper. + * @@ -52,7 +52,6 @@ Subject: [PATCH 61/72] BCM63XX: add a fixup for ath9k devices +#include +#include +#include -+#include +#include + +#define bcm_hsspi_writel(v, o) bcm_rset_writel(RSET_HSSPI, (v), (o)) diff --git a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch index f314e018f..8921f2d9b 100644 --- a/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/420-BCM63XX-add-endian-check-for-ath9k.patch @@ -21,7 +21,7 @@ /* --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -183,12 +183,14 @@ static void ath9k_pci_fixup(struct pci_d +@@ -182,12 +182,14 @@ static void ath9k_pci_fixup(struct pci_d } DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); @@ -39,7 +39,7 @@ return; --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -256,7 +256,8 @@ int __init board_register_devices(void) +@@ -249,7 +249,8 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) diff --git a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch index ccd3160a3..3ccf6dcdf 100644 --- a/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch +++ b/target/linux/brcm63xx/patches-4.4/421-BCM63XX-add-led-pin-for-ath9k.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -257,7 +257,7 @@ int __init board_register_devices(void) +@@ -250,7 +250,7 @@ int __init board_register_devices(void) /* register any fixups */ for (i = 0; i < board.has_caldata; i++) pci_enable_ath9k_fixup(board.caldata[i].slot, board.caldata[i].caldata_offset, @@ -11,7 +11,7 @@ } --- a/arch/mips/bcm63xx/pci-ath9k-fixup.c +++ b/arch/mips/bcm63xx/pci-ath9k-fixup.c -@@ -184,13 +184,15 @@ static void ath9k_pci_fixup(struct pci_d +@@ -183,13 +183,15 @@ static void ath9k_pci_fixup(struct pci_d DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATHEROS, PCI_ANY_ID, ath9k_pci_fixup); void __init pci_enable_ath9k_fixup(unsigned slot, u32 offset, diff --git a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch index 5731cb34a..d021b3690 100644 --- a/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch +++ b/target/linux/brcm63xx/patches-4.4/422-BCM63XX-add-a-fixup-for-rt2x00-devices.patch @@ -19,7 +19,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices +++ b/arch/mips/bcm63xx/Makefile @@ -2,7 +2,7 @@ obj-y += clk.o cpu.o cs.o gpio.o irq.o setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ + dev-pcmcia.o dev-rng.o \ dev-wdt.o dev-usb-ehci.o dev-usb-ohci.o dev-usb-usbd.o \ - pci-ath9k-fixup.o usb-common.o sprom.o + pci-ath9k-fixup.o pci-rt2x00-fixup.o usb-common.o sprom.o @@ -28,7 +28,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices obj-y += boards/ --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -34,6 +34,7 @@ +@@ -33,6 +33,7 @@ #include #include #include @@ -36,7 +36,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices #include "board_common.h" -@@ -255,9 +256,19 @@ int __init board_register_devices(void) +@@ -248,9 +249,19 @@ int __init board_register_devices(void) } /* register any fixups */ @@ -162,7 +162,7 @@ Subject: [PATCH 72/72] 446-BCM63XX-add-a-fixup-for-rt2x00-devices }; /* -@@ -48,7 +53,7 @@ struct board_info { +@@ -46,7 +51,7 @@ struct board_info { unsigned int has_caldata:2; /* wifi calibration data config */ diff --git a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch index 19d790511..c905cb2d4 100644 --- a/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch +++ b/target/linux/brcm63xx/patches-4.4/423-bcm63xx_enet_add_b53_support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.h +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.h -@@ -336,6 +336,9 @@ struct bcm_enet_priv { +@@ -335,6 +335,9 @@ struct bcm_enet_priv { struct bcm63xx_enetsw_port used_ports[ENETSW_MAX_PORT]; int sw_port_link[ENETSW_MAX_PORT]; @@ -12,15 +12,15 @@ spinlock_t enetsw_mdio_lock; --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -31,6 +31,7 @@ +@@ -30,6 +30,7 @@ + #include #include #include - #include +#include #include #include "bcm63xx_enet.h" -@@ -1974,7 +1975,8 @@ static int bcm_enet_remove(struct platfo +@@ -1968,7 +1969,8 @@ static int bcm_enet_remove(struct platfo return 0; } @@ -30,7 +30,7 @@ .probe = bcm_enet_probe, .remove = bcm_enet_remove, .driver = { -@@ -1983,6 +1985,42 @@ struct platform_driver bcm63xx_enet_driv +@@ -1977,6 +1979,42 @@ struct platform_driver bcm63xx_enet_driv }, }; @@ -73,7 +73,7 @@ /* * switch mii access callbacks */ -@@ -2241,29 +2279,6 @@ static int bcm_enetsw_open(struct net_de +@@ -2235,29 +2273,6 @@ static int bcm_enetsw_open(struct net_de enetsw_writeb(priv, rgmii_ctrl, ENETSW_RGMII_CTRL_REG(i)); } @@ -103,7 +103,7 @@ /* initialize flow control buffer allocation */ enet_dma_writel(priv, ENETDMA_BUFALLOC_FORCE_MASK | 0, ENETDMA_BUFALLOC_REG(priv->rx_chan)); -@@ -2722,6 +2737,9 @@ static int bcm_enetsw_probe(struct platf +@@ -2716,6 +2731,9 @@ static int bcm_enetsw_probe(struct platf struct bcm63xx_enetsw_platform_data *pd; struct resource *res_mem; int ret, irq_rx, irq_tx; @@ -111,9 +111,9 @@ + u16 port_mask = BIT(8); + u8 val; - /* stop if shared driver failed, assume driver->probe will be - * called in the same order we register devices (correct ?) -@@ -2811,6 +2829,43 @@ static int bcm_enetsw_probe(struct platf + if (!bcm_enet_shared_base[0]) + return -EPROBE_DEFER; +@@ -2798,6 +2816,43 @@ static int bcm_enetsw_probe(struct platf priv->pdev = pdev; priv->net_dev = dev; @@ -156,14 +156,14 @@ + return 0; - out_put_clk: -@@ -2839,6 +2894,9 @@ static int bcm_enetsw_remove(struct plat + out_disable_clk: +@@ -2819,6 +2874,9 @@ static int bcm_enetsw_remove(struct plat priv = netdev_priv(dev); unregister_netdev(dev); + /* remove switch */ + bcmenet_switch_unregister(priv); + - /* release device resources */ - iounmap(priv->base); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + clk_disable_unprepare(priv->mac_clk); + + free_netdev(dev); diff --git a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch index 24dd27a29..f1c7589c4 100644 --- a/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch +++ b/target/linux/brcm63xx/patches-4.4/424-bcm63xx_enet_no_request_mem_region.patch @@ -1,15 +1,15 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2784,12 +2784,6 @@ static int bcm_enetsw_probe(struct platf +@@ -2775,9 +2775,9 @@ static int bcm_enetsw_probe(struct platf if (ret) goto out; -- if (!request_mem_region(res_mem->start, resource_size(res_mem), -- "bcm63xx_enetsw")) { -- ret = -EBUSY; -- goto out; -- } -- - priv->base = ioremap(res_mem->start, resource_size(res_mem)); - if (priv->base == NULL) { - ret = -ENOMEM; +- priv->base = devm_ioremap_resource(&pdev->dev, res_mem); +- if (IS_ERR(priv->base)) { +- ret = PTR_ERR(priv->base); ++ priv->base = devm_ioremap(&pdev->dev, res_mem->start, resource_size(res_mem)); ++ if (priv->base == NULL) { ++ ret = -ENOMEM; + goto out; + } + diff --git a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch index 4c4eb7d67..ec03e4cee 100644 --- a/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch +++ b/target/linux/brcm63xx/patches-4.4/427-boards_probe_switch.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -119,6 +119,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -77,6 +77,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -9,8 +9,8 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -162,6 +164,8 @@ static struct board_info __initdata boar - .has_uart0 = 1, +@@ -90,6 +92,8 @@ static struct board_info __initdata boar + .has_enet0 = 1, .enet0 = { + .has_phy = 1, @@ -18,7 +18,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -273,6 +277,8 @@ static struct board_info __initdata boar +@@ -138,6 +142,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -27,7 +27,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -335,6 +341,8 @@ static struct board_info __initdata boar +@@ -170,6 +176,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -36,7 +36,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -389,6 +397,8 @@ static struct board_info __initdata boar +@@ -194,6 +202,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -45,7 +45,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -449,6 +459,8 @@ static struct board_info __initdata boar +@@ -224,6 +234,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -54,7 +54,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -472,6 +484,8 @@ static struct board_info __initdata boar +@@ -247,6 +259,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -63,16 +63,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -491,6 +505,8 @@ static struct board_info __initdata boar - .has_enet1 = 1, - .enet0 = { - .has_phy = 1, -+ .phy_id = 0, -+ .has_phy = 1, - .use_internal_phy = 1, - }, - .enet1 = { -@@ -514,6 +530,8 @@ static struct board_info __initdata boar +@@ -268,6 +282,8 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, .enet1 = { @@ -81,7 +72,16 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -542,6 +560,8 @@ static struct board_info __initdata boar +@@ -287,6 +303,8 @@ static struct board_info __initdata boar + .use_internal_phy = 1, + }, + .enet1 = { ++ .has_phy = 1, ++ .phy_id = 0, + .force_speed_100 = 1, + .force_duplex_full = 1, + }, +@@ -314,6 +332,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -90,7 +90,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -595,6 +615,8 @@ static struct board_info __initdata boar +@@ -339,6 +359,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -99,7 +99,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -644,6 +666,8 @@ static struct board_info __initdata boar +@@ -364,6 +386,8 @@ static struct board_info __initdata boar }, .enet1 = { @@ -108,7 +108,7 @@ .force_speed_100 = 1, .force_duplex_full = 1, }, -@@ -667,6 +691,8 @@ static struct board_info __initdata boar +@@ -387,6 +411,8 @@ static struct board_info __initdata boar }, .enet1 = { diff --git a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch index 98292d539..ad9c5b30e 100644 --- a/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch +++ b/target/linux/brcm63xx/patches-4.4/499-allow_better_context_for_board_patches.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -57,7 +57,7 @@ static struct board_info __initdata boar +@@ -46,7 +46,7 @@ static struct board_info __initdata boar .ephy_reset_gpio = 36, .ephy_reset_gpio_flags = GPIO_ACTIVE_LOW, }; @@ -9,8 +9,8 @@ /* * known 6328 boards -@@ -106,7 +106,7 @@ static struct board_info __initdata boar - }, +@@ -65,7 +65,7 @@ static struct board_info __initdata boar + .port_no = 0, }, }; -#endif @@ -18,8 +18,8 @@ /* * known 6338 boards -@@ -199,7 +199,7 @@ static struct board_info __initdata boar - }, +@@ -98,7 +98,7 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; -#endif @@ -27,16 +27,16 @@ /* * known 6345 boards -@@ -211,7 +211,7 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -108,7 +108,7 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; -#endif +#endif /* CONFIG_BCM63XX_CPU_6345 */ /* * known 6348 boards -@@ -538,7 +538,7 @@ static struct board_info __initdata boar +@@ -311,7 +311,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -45,7 +45,7 @@ /* * known 6358 boards -@@ -699,7 +699,7 @@ static struct board_info __initdata boar +@@ -419,7 +419,7 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; diff --git a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch index c2b2d330a..31757c464 100644 --- a/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch +++ b/target/linux/brcm63xx/patches-4.4/500-board-D4PW.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -538,6 +538,22 @@ static struct board_info __initdata boar +@@ -311,6 +311,21 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -11,7 +11,6 @@ + + .has_enet1 = 1, + .has_pci = 1, -+ .has_uart0 = 1, + + .enet1 = { + .has_phy = 1, @@ -23,7 +22,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -727,6 +743,7 @@ static const struct board_info __initcon +@@ -447,6 +462,7 @@ static const struct board_info __initcon &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, @@ -31,7 +30,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -758,6 +775,7 @@ static struct of_device_id const bcm963x +@@ -478,6 +494,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch index c55221cf9..fe228c6b0 100644 --- a/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch +++ b/target/linux/brcm63xx/patches-4.4/501-board-NB4.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -715,6 +715,62 @@ static struct board_info __initdata boar +@@ -434,6 +434,60 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "NB4-SER-r0", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "NB4-FXC-r1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -63,7 +61,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -751,6 +807,8 @@ static const struct board_info __initcon +@@ -470,6 +524,8 @@ static const struct board_info __initcon &board_96358vw2, &board_AGPFS0, &board_DWVS0, @@ -72,7 +70,7 @@ #endif }; -@@ -792,6 +850,8 @@ static struct of_device_id const bcm963x +@@ -511,6 +567,8 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,a226m", .data = &board_DWVS0, }, { .compatible = "pirelli,a226m-fwb", .data = &board_DWVS0, }, { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, diff --git a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch index e4036b25c..64edf76e5 100644 --- a/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch +++ b/target/linux/brcm63xx/patches-4.4/502-board-96338W2_E7T.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -199,6 +199,20 @@ static struct board_info __initdata boar - }, +@@ -98,6 +98,20 @@ static struct board_info __initdata boar + .force_duplex_full = 1, }, }; + @@ -21,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -786,6 +800,7 @@ static const struct board_info __initcon +@@ -503,6 +517,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, &board_96338w, @@ -29,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -823,6 +838,7 @@ static struct of_device_id const bcm963x +@@ -540,6 +555,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch index d38aa3405..2639aa6fd 100644 --- a/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch +++ b/target/linux/brcm63xx/patches-4.4/503-board-CPVA642.patch @@ -1,14 +1,13 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -681,6 +681,26 @@ static struct board_info __initdata boar - }, +@@ -401,6 +401,25 @@ static struct board_info __initdata boar + .num_usbh_ports = 2, }; +static struct board_info __initdata board_CPVA642 = { + .name = "CPVA642", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -27,7 +26,7 @@ static struct board_info __initdata board_AGPFS0 = { .name = "AGPF-S0", .expected_cpu_id = 0x6358, -@@ -821,6 +841,7 @@ static const struct board_info __initcon +@@ -538,6 +557,7 @@ static const struct board_info __initcon &board_96358vw, &board_96358vw2, &board_AGPFS0, @@ -35,7 +34,7 @@ &board_DWVS0, &board_nb4_ser_r0, &board_nb4_fxc_r1, -@@ -868,6 +889,7 @@ static struct of_device_id const bcm963x +@@ -585,6 +605,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch index 032085fde..c125b3e0a 100644 --- a/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch +++ b/target/linux/brcm63xx/patches-4.4/504-board_dsl_274xb_rev_c.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -750,6 +750,23 @@ static struct board_info __initdata boar +@@ -468,6 +468,22 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "AW4139", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_nb4_ser_r0 = { .name = "NB4-SER-r0", .expected_cpu_id = 0x6358, -@@ -843,6 +860,7 @@ static const struct board_info __initcon +@@ -559,6 +575,7 @@ static const struct board_info __initcon &board_AGPFS0, &board_CPVA642, &board_DWVS0, @@ -32,7 +31,7 @@ &board_nb4_ser_r0, &board_nb4_fxc_r1, #endif -@@ -882,6 +900,7 @@ static struct of_device_id const bcm963x +@@ -598,6 +615,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch index a9847c1b7..c6bc4ec2d 100644 --- a/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch +++ b/target/linux/brcm63xx/patches-4.4/505-board_spw500v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -568,6 +568,45 @@ static struct board_info __initdata boar +@@ -340,6 +340,44 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -17,7 +17,6 @@ + .name = "SPW500V", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -46,7 +45,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -852,6 +891,7 @@ static const struct board_info __initcon +@@ -567,6 +605,7 @@ static const struct board_info __initcon &board_96348gw_a, &board_rta1025w_16, &board_96348_D4PW, @@ -54,7 +53,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -893,6 +933,7 @@ static struct of_device_id const bcm963x +@@ -608,6 +647,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch index 3bb22ba34..fb28302eb 100644 --- a/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch +++ b/target/linux/brcm63xx/patches-4.4/506-board_gw6200_gw6000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -457,6 +457,66 @@ static struct board_info __initdata boar +@@ -233,6 +233,64 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "GW6200", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,6 @@ + .name = "GW6000", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_FAST2404 = { .name = "F@ST2404", .expected_cpu_id = 0x6348, -@@ -884,6 +944,8 @@ static const struct board_info __initcon +@@ -598,6 +656,8 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, &board_96348gw, @@ -76,7 +74,7 @@ &board_96348gw_10, &board_96348gw_11, &board_FAST2404, -@@ -934,6 +996,8 @@ static struct of_device_id const bcm963x +@@ -648,6 +708,8 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, { .compatible = "t-com,spw500v", .data = &board_spw500v, }, diff --git a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch index 198045b91..9ba7d8c23 100644 --- a/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch +++ b/target/linux/brcm63xx/patches-4.4/507-board-MAGIC.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -667,6 +667,40 @@ static struct board_info __initdata boar +@@ -436,6 +436,39 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(spw500v_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "MAGIC", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -41,7 +40,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -954,6 +988,7 @@ static const struct board_info __initcon +@@ -666,6 +699,7 @@ static const struct board_info __initcon &board_rta1025w_16, &board_96348_D4PW, &board_spw500v, @@ -49,7 +48,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -998,6 +1033,7 @@ static struct of_device_id const bcm963x +@@ -710,6 +744,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch index 50a0dc7b6..34800672c 100644 --- a/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch +++ b/target/linux/brcm63xx/patches-4.4/508-board_hw553.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -955,6 +955,34 @@ static struct board_info __initdata boar +@@ -666,6 +666,32 @@ static struct board_info __initdata boar .has_ehci0 = 1, .num_usbh_ports = 2, }; @@ -9,8 +9,6 @@ + .name = "HW553", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, -+ + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -35,7 +33,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1000,6 +1028,7 @@ static const struct board_info __initcon +@@ -711,6 +737,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -43,7 +41,7 @@ #endif }; -@@ -1043,6 +1072,7 @@ static struct of_device_id const bcm963x +@@ -754,6 +781,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch index b744c3138..f30dfbee1 100644 --- a/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch +++ b/target/linux/brcm63xx/patches-4.4/509-board_rta1320_16m.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -213,6 +213,21 @@ static struct board_info __initdata boar +@@ -112,6 +112,20 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -9,7 +9,6 @@ + .name = "RTA1320_16M", + .expected_cpu_id = 0x6338, + -+ .has_uart0 = 1, + .has_enet0 = 1, + + .enet0 = { @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6338 */ /* -@@ -999,6 +1014,7 @@ static const struct board_info __initcon +@@ -708,6 +722,7 @@ static const struct board_info __initcon &board_96338gw, &board_96338w, &board_96338w2_e7t, @@ -30,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, -@@ -1043,6 +1059,7 @@ static struct of_device_id const bcm963x +@@ -752,6 +767,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6338 { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, { .compatible = "brcm,bcm96338w", .data = &board_96338w, }, diff --git a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch index 37dec2ce7..30ef4e051 100644 --- a/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch +++ b/target/linux/brcm63xx/patches-4.4/510-board_spw303v.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -998,6 +998,21 @@ static struct board_info __initdata boar +@@ -706,6 +706,20 @@ static struct board_info __initdata boar .pci_dev = 1, }, }; @@ -10,7 +10,6 @@ + .name = "96358-502V", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_pci = 1, + @@ -22,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1045,6 +1060,7 @@ static const struct board_info __initcon +@@ -753,6 +767,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_HW553, @@ -30,7 +29,7 @@ #endif }; -@@ -1096,6 +1112,7 @@ static struct of_device_id const bcm963x +@@ -804,6 +819,7 @@ static struct of_device_id const bcm963x { .compatible = "pirelli,agpf-s0", .data = &board_AGPFS0, }, { .compatible = "sfr,nb4-ser-r0", .data = &board_nb4_ser_r0, }, { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, diff --git a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch index 3ac6c1800..46909b073 100644 --- a/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch +++ b/target/linux/brcm63xx/patches-4.4/511-board_V2500V.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -716,6 +716,27 @@ static struct board_info __initdata boar +@@ -483,6 +483,26 @@ static struct board_info __initdata boar .ext_irq = 2, }, }; @@ -9,7 +9,6 @@ + .name = "V2500V_BB", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -28,7 +27,7 @@ #endif /* CONFIG_BCM63XX_CPU_6348 */ /* -@@ -1048,6 +1069,7 @@ static const struct board_info __initcon +@@ -755,6 +775,7 @@ static const struct board_info __initcon &board_96348_D4PW, &board_spw500v, &board_96348sv, @@ -36,7 +35,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1087,6 +1109,7 @@ static struct of_device_id const bcm963x +@@ -794,6 +815,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, @@ -44,7 +43,7 @@ { .compatible = "d-link,dsl-2640b-b", .data = &board_96348_D4PW, }, { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, -@@ -1146,6 +1169,22 @@ void __init board_bcm963xx_init(void) +@@ -853,6 +875,22 @@ void __init board_bcm963xx_init(void) val &= MPI_CSBASE_BASE_MASK; } boot_addr = (u8 *)KSEG1ADDR(val); @@ -76,8 +75,8 @@ +#include #include #include - #include -@@ -248,6 +249,13 @@ int __init bcm63xx_flash_register(void) + #include +@@ -247,6 +248,13 @@ int __init bcm63xx_flash_register(void) val = bcm_mpi_readl(MPI_CSBASE_REG(0)); val &= MPI_CSBASE_BASE_MASK; diff --git a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch index a3e24049b..f58e294eb 100644 --- a/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch +++ b/target/linux/brcm63xx/patches-4.4/512-board_BTV2110.patch @@ -1,7 +1,7 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -411,6 +411,25 @@ static struct board_info __initdata boar - }, +@@ -216,6 +216,24 @@ static struct board_info __initdata boar + .has_ehci0 = 1, }; + @@ -10,7 +10,6 @@ + .name = "V2110", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1070,6 +1089,7 @@ static const struct board_info __initcon +@@ -776,6 +794,7 @@ static const struct board_info __initcon &board_spw500v, &board_96348sv, &board_V2500V_BB, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1109,6 +1129,7 @@ static struct of_device_id const bcm963x +@@ -815,6 +834,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-10", .data = &board_96348gw_10, }, { .compatible = "brcm,bcm96348gw-11", .data = &board_96348gw_11, }, { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, diff --git a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch index 28462e059..769be5a17 100644 --- a/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch +++ b/target/linux/brcm63xx/patches-4.4/513-MIPS-BCM63XX-add-inventel-Livebox-support.patch @@ -33,7 +33,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support +obj-$(CONFIG_BOARD_LIVEBOX) += board_livebox.o --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -56,7 +56,7 @@ void __init board_prom_init(void) +@@ -55,7 +55,7 @@ void __init board_prom_init(void) if (fw_arg3 == CFE_EPTSEAL) board_bcm963xx_init(); else @@ -57,7 +57,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support #endif /* __BOARD_COMMON_H */ --- /dev/null +++ b/arch/mips/bcm63xx/boards/board_livebox.c -@@ -0,0 +1,164 @@ +@@ -0,0 +1,163 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive @@ -92,7 +92,6 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support + .name = "Livebox-blue-5g", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch index b3b9125a9..d111d97d6 100644 --- a/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch +++ b/target/linux/brcm63xx/patches-4.4/514-board_ct536_ct5621.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -430,6 +430,34 @@ static struct board_info __initdata boar +@@ -234,6 +234,33 @@ static struct board_info __initdata boar }; @@ -8,7 +8,6 @@ + .name = "CT536_CT5621", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 0, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1090,6 +1118,7 @@ static const struct board_info __initcon +@@ -795,6 +822,7 @@ static const struct board_info __initcon &board_96348sv, &board_V2500V_BB, &board_V2110, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1131,6 +1160,8 @@ static struct of_device_id const bcm963x +@@ -836,6 +864,8 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96348gw-a", .data = &board_96348gw_a, }, { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, diff --git a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch index c2cef899f..8e053b293 100644 --- a/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch +++ b/target/linux/brcm63xx/patches-4.4/515-board_DWV-S0_fixes.patch @@ -1,15 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -946,6 +946,8 @@ static struct board_info __initdata boar - .name = "DWV-S0", - .expected_cpu_id = 0x6358, - -+ .has_uart0 = 1, -+ - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, -@@ -964,6 +966,7 @@ static struct board_info __initdata boar +@@ -674,6 +674,7 @@ static struct board_info __initdata boar }, .has_ohci0 = 1, diff --git a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch index 5eea5369a..29dc2620d 100644 --- a/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch +++ b/target/linux/brcm63xx/patches-4.4/516-board_96348A-122.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -458,6 +458,31 @@ static struct board_info __initdata boar +@@ -261,6 +261,30 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96348A-122", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_96348gw = { .name = "96348GW", .expected_cpu_id = 0x6348, -@@ -1122,6 +1147,7 @@ static const struct board_info __initcon +@@ -824,6 +848,7 @@ static const struct board_info __initcon &board_V2500V_BB, &board_V2110, &board_ct536_ct5621, @@ -40,7 +39,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1164,6 +1190,7 @@ static struct of_device_id const bcm963x +@@ -866,6 +891,7 @@ static struct of_device_id const bcm963x { .compatible = "bt,v2110", .data = &board_V2110, }, { .compatible = "bt,v2500v-bb", .data = &board_V2500V_BB, }, { .compatible = "comtrend,ct-536+", .data = &board_ct536_ct5621, }, diff --git a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch b/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch deleted file mode 100644 index 9b637fcca..000000000 --- a/target/linux/brcm63xx/patches-4.4/517-RTA1205W_16_uart_fixes.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/arch/mips/bcm63xx/boards/board_bcm963xx.c -+++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -635,6 +635,7 @@ static struct board_info __initdata boar - .name = "RTA1025W_16", - .expected_cpu_id = 0x6348, - -+ .has_uart0 = 1, - .has_enet0 = 1, - .has_enet1 = 1, - .has_pci = 1, diff --git a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch index 5dc69e468..5af1060df 100644 --- a/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch +++ b/target/linux/brcm63xx/patches-4.4/519_board_CPVA502plus.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -429,6 +429,34 @@ static struct board_info __initdata boar +@@ -233,6 +233,33 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "CPVA502+", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -35,7 +34,7 @@ static struct board_info __initdata board_ct536_ct5621 = { .name = "CT536_CT5621", -@@ -1149,6 +1177,7 @@ static const struct board_info __initcon +@@ -849,6 +876,7 @@ static const struct board_info __initcon &board_V2110, &board_ct536_ct5621, &board_96348A_122, @@ -43,7 +42,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1201,6 +1230,7 @@ static struct of_device_id const bcm963x +@@ -901,6 +929,7 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw500v", .data = &board_spw500v, }, { .compatible = "tecom,gw6000", .data = &board_gw6000, }, { .compatible = "tecom,gw6200", .data = &board_gw6200, }, diff --git a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch index 0175104d3..31002842f 100644 --- a/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch +++ b/target/linux/brcm63xx/patches-4.4/520-bcm63xx-add-support-for-96368MVWG-board.patch @@ -10,7 +10,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1141,6 +1141,59 @@ static struct board_info __initdata boar +@@ -840,6 +840,58 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6358 */ /* @@ -21,7 +21,6 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. + .name = "96368MVWG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -70,7 +69,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1192,6 +1245,10 @@ static const struct board_info __initcon +@@ -891,6 +943,10 @@ static const struct board_info __initcon &board_HW553, &board_spw303v, #endif @@ -81,7 +80,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1252,6 +1309,7 @@ static struct of_device_id const bcm963x +@@ -951,6 +1007,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -91,7 +90,7 @@ Subject: [PATCH 32/63] bcm63xx: add support for 96368MVWG board. #endif --- a/arch/mips/bcm63xx/boards/board_common.c +++ b/arch/mips/bcm63xx/boards/board_common.c -@@ -83,12 +83,25 @@ void __init board_early_setup(const stru +@@ -82,12 +82,25 @@ void __init board_early_setup(const stru bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348()) val |= GPIO_MODE_6348_G2_PCI; diff --git a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch index 0a5cd6c5b..f719c2428 100644 --- a/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch +++ b/target/linux/brcm63xx/patches-4.4/521-bcm63xx-add-support-for-96368MVNgr-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1191,6 +1191,46 @@ static struct board_info __initdata boar +@@ -889,6 +889,45 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -18,7 +18,6 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. + .name = "96368MVNgr", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_enetsw = 1, + @@ -56,7 +55,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1248,6 +1288,7 @@ static const struct board_info __initcon +@@ -946,6 +985,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, @@ -64,7 +63,7 @@ Subject: [PATCH 33/63] bcm63xx: add support for 96368MVNgr board. #endif }; -@@ -1309,6 +1350,7 @@ static struct of_device_id const bcm963x +@@ -1007,6 +1047,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch index 030382bb8..e482b2093 100644 --- a/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/522-MIPS-BCM63XX-add-96328avng-reference-board.patch @@ -9,9 +9,9 @@ Subject: [PATCH] MIPS: BCM63XX: add 96328avng reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -105,6 +105,33 @@ static struct board_info __initdata boar - .active_low = 1, - }, +@@ -64,6 +64,33 @@ static struct board_info __initdata boar + .use_fullspeed = 0, + .port_no = 0, }, + + .has_enetsw = 1, diff --git a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch index d6f732a88..c0f235bee 100644 --- a/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch +++ b/target/linux/brcm63xx/patches-4.4/523-MIPS-BCM63XX-add-963281TAN-reference-board.patch @@ -9,7 +9,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -133,6 +133,41 @@ static struct board_info __initdata boar +@@ -92,6 +92,40 @@ static struct board_info __initdata boar }, }, }; @@ -18,7 +18,6 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board + .name = "963281TAN", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_enetsw = 1, @@ -51,7 +50,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1269,6 +1304,7 @@ static const struct board_info __initcon +@@ -966,6 +1000,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -59,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add 963281TAN reference board #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1325,6 +1361,7 @@ static struct of_device_id const bcm963x +@@ -1022,6 +1057,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch index f89f01f99..e3be8926d 100644 --- a/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch +++ b/target/linux/brcm63xx/patches-4.4/524-board_dsl_274xb_rev_f.patch @@ -10,7 +10,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -168,6 +168,52 @@ static struct board_info __initdata boar +@@ -126,6 +126,51 @@ static struct board_info __initdata boar }, }, }; @@ -19,7 +19,6 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link + .name = "AW4339U", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_caldata = 1, @@ -63,7 +62,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1305,6 +1351,7 @@ static const struct board_info __initcon +@@ -1001,6 +1046,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -71,7 +70,7 @@ Subject: [PATCH 70/79] MIPS: BCM63XX: Add board definition for D-Link #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1363,6 +1410,7 @@ static struct of_device_id const bcm963x +@@ -1059,6 +1105,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6328 { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch index 7f9b3caa4..8fd0e85b6 100644 --- a/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch +++ b/target/linux/brcm63xx/patches-4.4/525-board_96348w3.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -837,6 +837,25 @@ static struct board_info __initdata boar +@@ -600,6 +600,24 @@ static struct board_info __initdata boar .has_ohci0 = 1, }; @@ -9,7 +9,6 @@ + .name = "96348W3", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -26,7 +25,7 @@ static struct board_info __initdata board_96348_D4PW = { .name = "D-4P-W", .expected_cpu_id = 0x6348, -@@ -1381,6 +1400,7 @@ static const struct board_info __initcon +@@ -1076,6 +1094,7 @@ static const struct board_info __initcon &board_ct536_ct5621, &board_96348A_122, &board_CPVA502plus, @@ -34,7 +33,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1436,6 +1456,7 @@ static struct of_device_id const bcm963x +@@ -1131,6 +1150,7 @@ static struct of_device_id const bcm963x { .compatible = "davolink,dv-201amr", .data = &board_DV201AMR, }, { .compatible = "dynalink,rta1025w", .data = &board_rta1025w_16, }, { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, diff --git a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch index 52839a34a..f9257d29d 100644 --- a/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch +++ b/target/linux/brcm63xx/patches-4.4/526-board_CT6373-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1223,6 +1223,31 @@ static struct board_info __initdata boar +@@ -922,6 +922,30 @@ static struct board_info __initdata boar .num_usbh_ports = 2, }; @@ -8,7 +8,6 @@ + .name = "CT6373-1", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -32,7 +31,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -1412,6 +1437,7 @@ static const struct board_info __initcon +@@ -1106,6 +1130,7 @@ static const struct board_info __initcon &board_dsl_274xb_rev_c, &board_nb4_ser_r0, &board_nb4_fxc_r1, @@ -40,7 +39,7 @@ &board_HW553, &board_spw303v, #endif -@@ -1470,6 +1496,7 @@ static struct of_device_id const bcm963x +@@ -1164,6 +1189,7 @@ static struct of_device_id const bcm963x { .compatible = "alcatel,rg100a", .data = &board_96358vw2, }, { .compatible = "brcm,bcm96358vw", .data = &board_96358vw, }, { .compatible = "brcm,bcm96358vw2", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch index 7d211f973..6936fa4d5 100644 --- a/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch +++ b/target/linux/brcm63xx/patches-4.4/527-board_dva-g3810bn-tl-1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1290,6 +1290,36 @@ static struct board_info __initdata boar +@@ -985,6 +985,35 @@ static struct board_info __initdata boar .use_internal_phy = 1, }, }; @@ -10,7 +10,6 @@ + .name = "DVAG3810BN", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_enet0 = 1, + .has_enet1 = 1, + .has_pci = 1, @@ -37,7 +36,7 @@ #endif /* CONFIG_BCM63XX_CPU_6358 */ /* -@@ -1440,6 +1470,7 @@ static const struct board_info __initcon +@@ -1133,6 +1162,7 @@ static const struct board_info __initcon &board_ct6373_1, &board_HW553, &board_spw303v, @@ -45,7 +44,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1499,6 +1530,7 @@ static struct of_device_id const bcm963x +@@ -1192,6 +1222,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ct-6373", .data = &board_ct6373_1, }, { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch index 915d48dea..55cc9ab86 100644 --- a/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch +++ b/target/linux/brcm63xx/patches-4.4/528-board_nb6.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1322,6 +1322,34 @@ static struct board_info __initdata boar +@@ -1016,6 +1016,32 @@ static struct board_info __initdata boar }; #endif /* CONFIG_BCM63XX_CPU_6358 */ @@ -9,8 +9,6 @@ + .name = "NB6", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_ohci0 = 1, + .has_ehci0 = 1, + .num_usbh_ports = 2, @@ -35,7 +33,7 @@ /* * known 6368 boards */ -@@ -1473,6 +1501,10 @@ static const struct board_info __initcon +@@ -1165,6 +1191,10 @@ static const struct board_info __initcon &board_DVAG3810BN, #endif @@ -46,7 +44,7 @@ #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, -@@ -1541,6 +1573,9 @@ static struct of_device_id const bcm963x +@@ -1233,6 +1263,9 @@ static struct of_device_id const bcm963x { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch index 09cf1b7a9..2bca04aa8 100644 --- a/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch +++ b/target/linux/brcm63xx/patches-4.4/529-board_fast2604.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -767,6 +767,23 @@ static struct board_info __initdata boar +@@ -533,6 +533,22 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "F@ST2604", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + @@ -24,7 +23,7 @@ static struct board_info __initdata board_rta1025w_16 = { .name = "RTA1025W_16", .expected_cpu_id = 0x6348, -@@ -1472,6 +1489,7 @@ static const struct board_info __initcon +@@ -1162,6 +1178,7 @@ static const struct board_info __initcon &board_96348gw_10, &board_96348gw_11, &board_FAST2404, @@ -32,7 +31,7 @@ &board_DV201AMR, &board_96348gw_a, &board_rta1025w_16, -@@ -1547,6 +1565,7 @@ static struct of_device_id const bcm963x +@@ -1237,6 +1254,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,dg834gtpn", .data = &board_96348gw_10, }, { .compatible = "netgear,dg834g-v4", .data = &board_96348W3, }, { .compatible = "sagem,f@st2404", .data = &board_FAST2404, }, diff --git a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch index 8094c3652..ec0695cc0 100644 --- a/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch +++ b/target/linux/brcm63xx/patches-4.4/530-board_A4001N1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -169,6 +169,50 @@ static struct board_info __initdata boar +@@ -127,6 +127,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "963281T_TEF", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_dsl_274xb_f1 = { .name = "AW4339U", .expected_cpu_id = 0x6328, -@@ -1470,6 +1514,7 @@ static const struct board_info __initcon +@@ -1159,6 +1202,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_963281TAN, @@ -59,7 +58,7 @@ &board_dsl_274xb_f1, #endif #ifdef CONFIG_BCM63XX_CPU_6338 -@@ -1535,6 +1580,7 @@ static struct of_device_id const bcm963x +@@ -1224,6 +1268,7 @@ static struct of_device_id const bcm963x { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch index 5cac3be43..d38cb3bb1 100644 --- a/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch +++ b/target/linux/brcm63xx/patches-4.4/531-board_AR-5387un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,79 @@ static struct board_info __initdata boar +@@ -93,6 +93,78 @@ static struct board_info __initdata boar }, }; @@ -35,7 +35,6 @@ + .name = "96328A-1441N1", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -80,7 +79,7 @@ static struct board_info __initdata board_963281TAN = { .name = "963281TAN", .expected_cpu_id = 0x6328, -@@ -1513,6 +1586,7 @@ static const struct board_info __initcon +@@ -1201,6 +1273,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -88,7 +87,7 @@ &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, -@@ -1583,6 +1657,7 @@ static struct of_device_id const bcm963x +@@ -1271,6 +1344,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch index ef8b2200c..07015caaa 100644 --- a/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch +++ b/target/linux/brcm63xx/patches-4.4/532-board_AR-5381u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -134,6 +134,61 @@ static struct board_info __initdata boar +@@ -93,6 +93,60 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96328A-1241N", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -62,7 +61,7 @@ static struct sprom_fixup __initdata ar5387un_fixups[] = { { .offset = 2, .value = 0x05bb }, { .offset = 65, .value = 0x1204 }, -@@ -1586,6 +1641,7 @@ static const struct board_info __initcon +@@ -1273,6 +1327,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, @@ -70,7 +69,7 @@ &board_AR5387un, &board_963281TAN, &board_A4001N1, -@@ -1657,6 +1713,7 @@ static struct of_device_id const bcm963x +@@ -1344,6 +1399,7 @@ static struct of_device_id const bcm963x { .compatible = "adb,a4001n1", .data = &board_A4001N1, }, { .compatible = "brcm,bcm963281TAN", .data = &board_963281TAN, }, { .compatible = "brcm,bcm96328avng", .data = &board_96328avng, }, diff --git a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch index 61f3ee23a..3ac6161bc 100644 --- a/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch +++ b/target/linux/brcm63xx/patches-4.4/533-board_rta770bw.patch @@ -1,16 +1,14 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -520,6 +520,22 @@ static struct board_info __initdata boar - - .has_uart0 = 1, +@@ -411,6 +411,20 @@ static struct board_info __initdata boar + .name = "96345GW2", + .expected_cpu_id = 0x6345, }; + +static struct board_info __initdata board_rta770bw = { + .name = "RTA770BW", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -23,7 +21,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1655,6 +1671,7 @@ static const struct board_info __initcon +@@ -1341,6 +1355,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, @@ -31,7 +29,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1725,6 +1742,7 @@ static struct of_device_id const bcm963x +@@ -1411,6 +1426,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, diff --git a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch index e59f1aa02..604ffe7a3 100644 --- a/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch +++ b/target/linux/brcm63xx/patches-4.4/534-board_hw556.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -1481,6 +1482,95 @@ static struct board_info __initdata boar +@@ -1171,6 +1172,92 @@ static struct board_info __initdata boar }, }; @@ -16,7 +16,6 @@ + .name = "HW556_C", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,6 @@ + .name = "HW556_A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -74,7 +72,6 @@ + .name = "HW556_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -104,7 +101,7 @@ /* T-Home Speedport W 303V Typ B */ static struct board_info __initdata board_spw303v = { .name = "96358-502V", -@@ -1707,6 +1797,9 @@ static const struct board_info __initcon +@@ -1391,6 +1478,9 @@ static const struct board_info __initcon &board_nb4_fxc_r1, &board_ct6373_1, &board_HW553, @@ -114,7 +111,7 @@ &board_spw303v, &board_DVAG3810BN, #endif -@@ -1779,6 +1872,9 @@ static struct of_device_id const bcm963x +@@ -1463,6 +1553,9 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, { .compatible = "huawei,hg553", .data = &board_HW553, }, diff --git a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch index e3b7724b8..7149ed748 100644 --- a/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch +++ b/target/linux/brcm63xx/patches-4.4/535-board_rta770w.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -537,6 +537,27 @@ static struct board_info __initdata boar +@@ -426,6 +426,25 @@ static struct board_info __initdata boar .force_duplex_full = 1, }, }; @@ -14,8 +14,6 @@ + .name = "RTA770W", + .expected_cpu_id = 0x6345, + -+ .has_uart0 = 1, -+ + .has_enet0 = 1, + + .enet0 = { @@ -28,7 +26,7 @@ #endif /* CONFIG_BCM63XX_CPU_6345 */ /* -@@ -1762,6 +1783,7 @@ static const struct board_info __initcon +@@ -1443,6 +1462,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6345 &board_96345gw2, &board_rta770bw, @@ -36,7 +34,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6348 &board_96348r, -@@ -1836,6 +1858,7 @@ static struct of_device_id const bcm963x +@@ -1517,6 +1537,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6345 { .compatible = "brcm,bcm96345gw2", .data = &board_96345gw2, }, { .compatible = "dynalink,rta770bw", .data = &board_rta770bw, }, diff --git a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch index 1cdef8b30..888854a9c 100644 --- a/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch +++ b/target/linux/brcm63xx/patches-4.4/536-board_fast2704.patch @@ -12,7 +12,7 @@ Signed-off-by: Marcin Jurkowski --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -387,6 +387,44 @@ static struct board_info __initdata boar +@@ -341,6 +341,43 @@ static struct board_info __initdata boar }, }, }; @@ -21,7 +21,6 @@ Signed-off-by: Marcin Jurkowski + .name = "F@ST2704V2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -57,7 +56,7 @@ Signed-off-by: Marcin Jurkowski #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -1773,6 +1811,7 @@ static const struct board_info __initcon +@@ -1452,6 +1489,7 @@ static const struct board_info __initcon &board_963281TAN, &board_A4001N1, &board_dsl_274xb_f1, @@ -65,7 +64,7 @@ Signed-off-by: Marcin Jurkowski #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -1848,6 +1887,7 @@ static struct of_device_id const bcm963x +@@ -1527,6 +1565,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch index d5ecc3c4c..3472d90e9 100644 --- a/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch +++ b/target/linux/brcm63xx/patches-4.4/537-board_fast2504n.patch @@ -6,7 +6,7 @@ Signed-off-by: Max Staudt --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1702,6 +1702,43 @@ static struct board_info __initdata boar +@@ -1382,6 +1382,41 @@ static struct board_info __initdata boar }, }, }; @@ -15,8 +15,6 @@ Signed-off-by: Max Staudt + .name = "F@ST2504n", + .expected_cpu_id = 0x6362, + -+ .has_uart0 = 1, -+ + .has_enetsw = 1, + + .enetsw = { @@ -50,7 +48,7 @@ Signed-off-by: Max Staudt #endif /* CONFIG_BCM63XX_CPU_6362 */ /* -@@ -1867,6 +1904,7 @@ static const struct board_info __initcon +@@ -1545,6 +1580,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6362 &board_nb6, @@ -58,7 +56,7 @@ Signed-off-by: Max Staudt #endif #ifdef CONFIG_BCM63XX_CPU_6368 -@@ -1948,6 +1986,7 @@ static struct of_device_id const bcm963x +@@ -1626,6 +1662,7 @@ static struct of_device_id const bcm963x { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, #endif #ifdef CONFIG_BCM63XX_CPU_6362 diff --git a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch index f0949f9ed..c7eadf1b8 100644 --- a/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch +++ b/target/linux/brcm63xx/patches-4.4/555-board_96318ref.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -53,6 +53,56 @@ static struct board_info __initdata boar +@@ -50,6 +50,55 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_3368 */ /* @@ -11,7 +11,6 @@ + .name = "96318REF", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -57,7 +56,7 @@ * known 6328 boards */ #ifdef CONFIG_BCM63XX_CPU_6328 -@@ -1579,6 +1629,9 @@ static const struct board_info __initcon +@@ -1517,6 +1566,9 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_3368 &board_cvg834g, #endif @@ -67,7 +66,7 @@ #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, &board_AR5381u, -@@ -1656,6 +1709,9 @@ static struct of_device_id const bcm963x +@@ -1594,6 +1646,9 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_3368 { .compatible = "netgear,cvg834g", .data = &board_cvg834g, }, #endif diff --git a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch index eda826e13..162ecb7c3 100644 --- a/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/556-board_96318ref_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -100,6 +100,51 @@ static struct board_info __initdata boar +@@ -96,6 +96,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96318REF_P300", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + + .has_usbd = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -1631,6 +1676,7 @@ static const struct board_info __initcon +@@ -1568,6 +1612,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -1711,6 +1757,7 @@ static struct of_device_id const bcm963x +@@ -1648,6 +1693,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, diff --git a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch index 2d5dc607b..be0e7e783 100644 --- a/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch +++ b/target/linux/brcm63xx/patches-4.4/557-board_bcm963269bhr.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1668,6 +1668,52 @@ static struct board_info __initdata boar +@@ -1604,6 +1604,50 @@ static struct board_info __initdata boar #endif /* CONFIG_BCM63XX_CPU_6368 */ /* @@ -11,8 +11,6 @@ + .name = "963269BHR", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_pci = 1, + + .has_ehci0 = 1, @@ -53,7 +51,7 @@ * all boards */ static const struct board_info __initconst *bcm963xx_boards[] = { -@@ -1748,6 +1794,9 @@ static const struct board_info __initcon +@@ -1684,6 +1728,9 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, #endif @@ -63,7 +61,7 @@ }; static struct of_device_id const bcm963xx_boards_dt[] = { -@@ -1835,6 +1884,7 @@ static struct of_device_id const bcm963x +@@ -1771,6 +1818,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch index a312b4137..dc3c13ef4 100644 --- a/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch +++ b/target/linux/brcm63xx/patches-4.4/558-board_AR1004G.patch @@ -8,7 +8,7 @@ Signed-off-by: Adrian Feliks --- --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -679,6 +679,22 @@ static struct board_info __initdata boar +@@ -655,6 +655,21 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -16,7 +16,6 @@ Signed-off-by: Adrian Feliks + .name = "AR1004G", + .expected_cpu_id = 0x6348, + -+ .has_uart0 = 1, + .has_enet1 = 1, + .has_pci = 1, + @@ -31,7 +30,7 @@ Signed-off-by: Adrian Feliks /* BT Voyager 2110 */ static struct board_info __initdata board_V2110 = { -@@ -1765,6 +1781,7 @@ static const struct board_info __initcon +@@ -1699,6 +1714,7 @@ static const struct board_info __initcon &board_96348A_122, &board_CPVA502plus, &board_96348W3, @@ -39,7 +38,7 @@ Signed-off-by: Adrian Feliks #endif #ifdef CONFIG_BCM63XX_CPU_6358 -@@ -1829,6 +1846,7 @@ static struct of_device_id const bcm963x +@@ -1763,6 +1779,7 @@ static struct of_device_id const bcm963x { .compatible = "dynalink,rta770w", .data = &board_rta770w, }, #endif #ifdef CONFIG_BCM63XX_CPU_6348 diff --git a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch index b9dd163d6..dff30121b 100644 --- a/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch +++ b/target/linux/brcm63xx/patches-4.4/559-board_vw6339gu.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1727,6 +1727,53 @@ static struct board_info __initdata boar +@@ -1660,6 +1660,51 @@ static struct board_info __initdata boar }, }, }; @@ -9,8 +9,6 @@ + .name = "VW6339GU", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -54,7 +52,7 @@ #endif /* CONFIG_BCM63XX_CPU_63268 */ /* -@@ -1813,6 +1860,7 @@ static const struct board_info __initcon +@@ -1746,6 +1791,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963269bhr, @@ -62,7 +60,7 @@ #endif }; -@@ -1903,6 +1951,7 @@ static struct of_device_id const bcm963x +@@ -1836,6 +1882,7 @@ static struct of_device_id const bcm963x #endif #ifdef CONFIG_BCM63XX_CPU_63268 { .compatible = "brcm,bcm963269bhr", .data = &board_963269bhr, }, diff --git a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch index 7a8575e70..4819fc545 100644 --- a/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch +++ b/target/linux/brcm63xx/patches-4.4/560-board_963268gu_p300.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1687,6 +1687,66 @@ static struct board_info __initdata boar +@@ -1622,6 +1622,64 @@ static struct board_info __initdata boar * known 63268/63269 boards */ #ifdef CONFIG_BCM63XX_CPU_63268 @@ -8,8 +8,6 @@ + .name = "963268BU_P300", + .expected_cpu_id = 0x63268, + -+ .has_uart0 = 1, -+ + .has_ehci0 = 1, + .has_ohci0 = 1, + .num_usbh_ports = 1, @@ -67,7 +65,7 @@ static struct board_info __initdata board_963269bhr = { .name = "963269BHR", .expected_cpu_id = 0x63268, -@@ -1859,6 +1919,7 @@ static const struct board_info __initcon +@@ -1790,6 +1848,7 @@ static const struct board_info __initcon &board_96368mvngr, #endif #ifdef CONFIG_BCM63XX_CPU_63268 @@ -75,7 +73,7 @@ &board_963269bhr, &board_vw6339gu, #endif -@@ -1950,6 +2011,7 @@ static struct of_device_id const bcm963x +@@ -1881,6 +1940,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, #endif #ifdef CONFIG_BCM63XX_CPU_63268 diff --git a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch index 38c92b110..675185035 100644 --- a/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch +++ b/target/linux/brcm63xx/patches-4.4/561-board_WAP-5813n.patch @@ -9,7 +9,7 @@ #include #include #include -@@ -1681,6 +1683,48 @@ static struct board_info __initdata boar +@@ -1616,6 +1618,47 @@ static struct board_info __initdata boar .has_ohci0 = 1, .has_ehci0 = 1, }; @@ -27,7 +27,6 @@ + .name = "96369R-1231N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -58,7 +57,7 @@ #endif /* CONFIG_BCM63XX_CPU_6368 */ /* -@@ -1917,6 +1961,7 @@ static const struct board_info __initcon +@@ -1846,6 +1889,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -66,7 +65,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_63268 &board_963268bu_p300, -@@ -2009,6 +2054,7 @@ static struct of_device_id const bcm963x +@@ -1938,6 +1982,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch index 5f56c0e97..29413e947 100644 --- a/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch +++ b/target/linux/brcm63xx/patches-4.4/562-board_VR-3025u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1684,6 +1684,60 @@ static struct board_info __initdata boar +@@ -1619,6 +1619,59 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -17,7 +17,6 @@ + .name = "96368M-1541N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -1961,6 +2015,7 @@ static const struct board_info __initcon +@@ -1889,6 +1942,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2054,6 +2109,7 @@ static struct of_device_id const bcm963x +@@ -1982,6 +2036,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6368 { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, diff --git a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch index c2c17fdc2..81ac7021c 100644 --- a/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch +++ b/target/linux/brcm63xx/patches-4.4/563-board_VR-3025un.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1738,6 +1738,60 @@ static struct board_info __initdata boar +@@ -1672,6 +1672,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368M-1341N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2016,6 +2070,7 @@ static const struct board_info __initcon +@@ -1943,6 +1996,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_VR3025u, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2110,6 +2165,7 @@ static struct of_device_id const bcm963x +@@ -2037,6 +2091,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvngr", .data = &board_96368mvngr, }, { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, diff --git a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch index 2fd368a60..cdab8de25 100644 --- a/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch +++ b/target/linux/brcm63xx/patches-4.4/564-board_P870HW-51a_v2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1693,6 +1693,49 @@ static struct sprom_fixup __initdata vr3 +@@ -1628,6 +1628,48 @@ static struct sprom_fixup __initdata vr3 { .offset = 115, .value = 0xfad9 }, }; @@ -8,7 +8,6 @@ + .name = "P870HW-51a_v2", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -50,7 +49,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2069,6 +2112,7 @@ static const struct board_info __initcon +@@ -1995,6 +2037,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -58,7 +57,7 @@ &board_VR3025u, &board_VR3025un, &board_WAP5813n, -@@ -2167,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2093,6 +2136,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch index 070e3ec82..75b7ef96e 100644 --- a/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch +++ b/target/linux/brcm63xx/patches-4.4/565-board_hw520.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1364,6 +1364,37 @@ static struct board_info __initdata boar +@@ -1312,6 +1312,36 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW6358GW_B", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -38,7 +37,7 @@ static struct board_info __initdata board_HW553 = { .name = "HW553", .expected_cpu_id = 0x6358, -@@ -2096,6 +2127,7 @@ static const struct board_info __initcon +@@ -2021,6 +2051,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -46,7 +45,7 @@ &board_HW553, &board_HW556_A, &board_HW556_B, -@@ -2188,6 +2220,7 @@ static struct of_device_id const bcm963x +@@ -2113,6 +2144,7 @@ static struct of_device_id const bcm963x { .compatible = "d-link,dsl-274xb-c2", .data = &board_dsl_274xb_rev_c, }, { .compatible = "d-link,dsl-2650u", .data = &board_96358vw2, }, { .compatible = "d-link,dva-g3810bn/tl", .data = &board_DVAG3810BN, }, diff --git a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch index dfddf193b..2e194a54f 100644 --- a/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch +++ b/target/linux/brcm63xx/patches-4.4/566-board_A4001N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -358,6 +358,50 @@ static struct board_info __initdata boar +@@ -349,6 +349,49 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96328dg2x2", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -51,7 +50,7 @@ static struct board_info __initdata board_A4001N1 = { .name = "963281T_TEF", .expected_cpu_id = 0x6328, -@@ -2078,6 +2122,7 @@ static const struct board_info __initcon +@@ -2002,6 +2045,7 @@ static const struct board_info __initcon &board_AR5381u, &board_AR5387un, &board_963281TAN, @@ -59,7 +58,7 @@ &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, -@@ -2166,6 +2211,7 @@ static struct of_device_id const bcm963x +@@ -2090,6 +2134,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, #endif #ifdef CONFIG_BCM63XX_CPU_6328 diff --git a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch index 24c15fd2e..9852f3460 100644 --- a/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch +++ b/target/linux/brcm63xx/patches-4.4/567-board_dsl-2751b_e1.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -147,6 +147,75 @@ static struct board_info __initdata boar +@@ -142,6 +142,74 @@ static struct board_info __initdata boar }, }, }; @@ -30,7 +30,6 @@ + .name = "AW5200B", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -76,7 +75,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2116,6 +2185,7 @@ static const struct board_info __initcon +@@ -2039,6 +2107,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -84,7 +83,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2209,6 +2279,7 @@ static struct of_device_id const bcm963x +@@ -2132,6 +2201,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch index a07ebdb9e..cc31a8188 100644 --- a/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch +++ b/target/linux/brcm63xx/patches-4.4/568-board_DGND3700v1_3800B.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1828,6 +1828,31 @@ static struct board_info __initdata boar +@@ -1760,6 +1760,30 @@ static struct board_info __initdata boar .has_ehci0 = 1, }; @@ -8,7 +8,6 @@ + .name = "DGND3700v1_3800B", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +31,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2259,6 +2284,7 @@ static const struct board_info __initcon +@@ -2181,6 +2205,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6368 &board_96368mvwg, &board_96368mvngr, @@ -40,7 +39,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2361,6 +2387,7 @@ static struct of_device_id const bcm963x +@@ -2283,6 +2308,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch index e094882e3..8dca58683 100644 --- a/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch +++ b/target/linux/brcm63xx/patches-4.4/569-board_homehub2a.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1477,6 +1477,32 @@ static struct board_info __initdata boar +@@ -1423,6 +1423,31 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HOMEHUB2A", + .expected_cpu_id = 0x6358, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -33,7 +32,7 @@ static struct board_info __initdata board_HW520 = { .name = "HW6358GW_B", .expected_cpu_id = 0x6358, -@@ -2267,6 +2293,7 @@ static const struct board_info __initcon +@@ -2188,6 +2213,7 @@ static const struct board_info __initcon &board_nb4_ser_r0, &board_nb4_fxc_r1, &board_ct6373_1, @@ -41,7 +40,7 @@ &board_HW520, &board_HW553, &board_HW556_A, -@@ -2376,6 +2403,7 @@ static struct of_device_id const bcm963x +@@ -2297,6 +2323,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb4-fxc-r1", .data = &board_nb4_fxc_r1, }, { .compatible = "t-com,spw303v", .data = &board_spw303v, }, { .compatible = "telsey,cpva642", .data = &board_CPVA642, }, diff --git a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch index 2a13400f2..8fa9112b8 100644 --- a/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch +++ b/target/linux/brcm63xx/patches-4.4/570-board_HG655b.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1879,6 +1879,53 @@ static struct board_info __initdata boar +@@ -1809,6 +1809,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "HW65x", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2312,6 +2359,7 @@ static const struct board_info __initcon +@@ -2232,6 +2278,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, -@@ -2415,6 +2463,7 @@ static struct of_device_id const bcm963x +@@ -2335,6 +2382,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch index c62f2ac8c..bdae1a7e4 100644 --- a/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch +++ b/target/linux/brcm63xx/patches-4.4/571-board_fast2704n.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -216,6 +216,46 @@ static struct board_info __initdata boar +@@ -210,6 +210,45 @@ static struct board_info __initdata boar .num_board_fixups = ARRAY_SIZE(dsl2751b_e1_fixups), }, }; @@ -9,7 +9,6 @@ + .name = "F@ST2704N", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -47,7 +46,7 @@ #endif /* CONFIG_BCM63XX_CPU_6318 */ /* -@@ -2284,6 +2324,7 @@ static const struct board_info __initcon +@@ -2203,6 +2242,7 @@ static const struct board_info __initcon &board_96318ref, &board_96318ref_p300, &board_dsl_2751b_d1, @@ -55,7 +54,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6328 &board_96328avng, -@@ -2381,6 +2422,7 @@ static struct of_device_id const bcm963x +@@ -2300,6 +2340,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, { .compatible = "d-link,dsl-275xb-d", .data = &board_dsl_2751b_d1, }, diff --git a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch index 5a7d200e5..260424bee 100644 --- a/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch +++ b/target/linux/brcm63xx/patches-4.4/572-board_VR-3026e.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2117,6 +2117,60 @@ static struct board_info __initdata boar +@@ -2042,6 +2042,59 @@ static struct board_info __initdata boar }, }; @@ -17,7 +17,6 @@ + .name = "96368MT-1341N1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -61,7 +60,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2404,6 +2458,7 @@ static const struct board_info __initcon +@@ -2322,6 +2375,7 @@ static const struct board_info __initcon &board_P870HW51A_V2, &board_VR3025u, &board_VR3025un, @@ -69,7 +68,7 @@ &board_WAP5813n, #endif #ifdef CONFIG_BCM63XX_CPU_63268 -@@ -2504,6 +2559,7 @@ static struct of_device_id const bcm963x +@@ -2422,6 +2476,7 @@ static struct of_device_id const bcm963x { .compatible = "brcm,bcm96368mvwg", .data = &board_96368mvwg, }, { .compatible = "comtrend,vr-3025u", .data = &board_VR3025u, }, { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, diff --git a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch index cda9c4169..2764846a0 100644 --- a/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch +++ b/target/linux/brcm63xx/patches-4.4/573-board_R5010UNv2.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -638,6 +638,51 @@ static struct board_info __initdata boar +@@ -623,6 +623,50 @@ static struct board_info __initdata boar }, }, }; @@ -9,7 +9,6 @@ + .name = "96328ang", + .expected_cpu_id = 0x6328, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + .has_ohci0 = 1, @@ -52,7 +51,7 @@ #endif /* CONFIG_BCM63XX_CPU_6328 */ /* -@@ -2389,6 +2434,7 @@ static const struct board_info __initcon +@@ -2306,6 +2350,7 @@ static const struct board_info __initcon &board_A4001N1, &board_dsl_274xb_f1, &board_FAST2704V2, @@ -60,7 +59,7 @@ #endif #ifdef CONFIG_BCM63XX_CPU_6338 &board_96338gw, -@@ -2487,6 +2533,7 @@ static struct of_device_id const bcm963x +@@ -2404,6 +2449,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,ar-5381u", .data = &board_AR5381u, }, { .compatible = "comtrend,ar-5387un", .data = &board_AR5387un, }, { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, diff --git a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch index 3ec2d139d..860c0e787 100644 --- a/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch +++ b/target/linux/brcm63xx/patches-4.4/574-board_HG622.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2011,6 +2011,53 @@ static struct board_info __initdata boar +@@ -1938,6 +1938,52 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "96368MVWG_hg622", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -54,7 +53,7 @@ static struct sprom_fixup __initdata vr3025u_fixups[] = { { .offset = 97, .value = 0xfeb3 }, { .offset = 98, .value = 0x1618 }, -@@ -2500,6 +2547,7 @@ static const struct board_info __initcon +@@ -2416,6 +2462,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -62,7 +61,7 @@ &board_HG655b, &board_P870HW51A_V2, &board_VR3025u, -@@ -2608,6 +2656,7 @@ static struct of_device_id const bcm963x +@@ -2524,6 +2571,7 @@ static struct of_device_id const bcm963x { .compatible = "comtrend,vr-3025un", .data = &board_VR3025un, }, { .compatible = "comtrend,vr-3026e", .data = &board_VR3026e, }, { .compatible = "comtrend,wap-5813n", .data = &board_WAP5813n, }, diff --git a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch index cbec9492f..4c9d19ac6 100644 --- a/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch +++ b/target/linux/brcm63xx/patches-4.4/575-board_EVG2000.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1964,6 +1964,43 @@ static struct board_info __initdata boar +@@ -1892,6 +1892,42 @@ static struct board_info __initdata boar }, }; @@ -12,7 +12,6 @@ + .name = "96369PVG", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -44,7 +43,7 @@ static struct board_info __initdata board_HG655b = { .name = "HW65x", .expected_cpu_id = 0x6368, -@@ -2547,6 +2584,7 @@ static const struct board_info __initcon +@@ -2462,6 +2498,7 @@ static const struct board_info __initcon &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, @@ -52,7 +51,7 @@ &board_HG622, &board_HG655b, &board_P870HW51A_V2, -@@ -2659,6 +2697,7 @@ static struct of_device_id const bcm963x +@@ -2574,6 +2611,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg622", .data = &board_HG622, }, { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, diff --git a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch index f3d08eb2a..927ce2735 100644 --- a/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch +++ b/target/linux/brcm63xx/patches-4.4/576-board_AV4202N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -1851,6 +1851,52 @@ static struct board_info __initdata boar +@@ -1782,6 +1782,51 @@ static struct board_info __initdata boar * known 6368 boards */ #ifdef CONFIG_BCM63XX_CPU_6368 @@ -8,7 +8,6 @@ + .name = "96368_Swiss_S1", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -53,7 +52,7 @@ static struct board_info __initdata board_96368mvwg = { .name = "96368MVWG", .expected_cpu_id = 0x6368, -@@ -2581,6 +2627,7 @@ static const struct board_info __initcon +@@ -2495,6 +2540,7 @@ static const struct board_info __initcon #endif #ifdef CONFIG_BCM63XX_CPU_6368 @@ -61,7 +60,7 @@ &board_96368mvwg, &board_96368mvngr, &board_DGND3700v1_3800B, -@@ -2688,6 +2735,7 @@ static struct of_device_id const bcm963x +@@ -2602,6 +2648,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch index 74f1b5006..e9bf9a768 100644 --- a/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch +++ b/target/linux/brcm63xx/patches-4.4/577-board_VH4032N.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2346,6 +2346,45 @@ static struct board_info __initdata boar +@@ -2266,6 +2266,44 @@ static struct board_info __initdata boar }, }; @@ -8,7 +8,6 @@ + .name = "VH4032N", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -46,7 +45,7 @@ static struct sprom_fixup __initdata wap5813n_fixups[] = { { .offset = 97, .value = 0xfeed }, { .offset = 98, .value = 0x15d1 }, -@@ -2635,6 +2674,7 @@ static const struct board_info __initcon +@@ -2548,6 +2586,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -54,7 +53,7 @@ &board_VR3025u, &board_VR3025un, &board_VR3026e, -@@ -2746,6 +2786,7 @@ static struct of_device_id const bcm963x +@@ -2659,6 +2698,7 @@ static struct of_device_id const bcm963x { .compatible = "huawei,hg655b", .data = &board_HG655b, }, { .compatible = "netgear,dgnd3700v1", .data = &board_DGND3700v1_3800B, }, { .compatible = "netgear,evg2000", .data = &board_EVG2000, }, diff --git a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch index d1a1b0363..4b4b1a0de 100644 --- a/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch +++ b/target/linux/brcm63xx/patches-4.4/578-board_R1000H.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -2193,6 +2193,31 @@ static struct board_info __initdata boar +@@ -2116,6 +2116,29 @@ static struct board_info __initdata boar }, }; @@ -8,8 +8,6 @@ + .name = "R1000H", + .expected_cpu_id = 0x6368, + -+ .has_uart0 = 1, -+ .has_uart1 = 1, + .has_pci = 1, + .has_ohci0 = 1, + .has_ehci0 = 1, @@ -32,7 +30,7 @@ static struct board_info __initdata board_VR3025u = { .name = "96368M-1541N", .expected_cpu_id = 0x6368, -@@ -2674,6 +2699,7 @@ static const struct board_info __initcon +@@ -2586,6 +2609,7 @@ static const struct board_info __initcon &board_HG622, &board_HG655b, &board_P870HW51A_V2, @@ -40,7 +38,7 @@ &board_VH4032N, &board_VR3025u, &board_VR3025un, -@@ -2775,6 +2801,7 @@ static struct of_device_id const bcm963x +@@ -2687,6 +2711,7 @@ static struct of_device_id const bcm963x { .compatible = "sfr,nb6-ser-r0", .data = &board_nb6, }, #endif #ifdef CONFIG_BCM63XX_CPU_6368 diff --git a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch index 6f7f26c32..1974ccd81 100644 --- a/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch +++ b/target/linux/brcm63xx/patches-4.4/579-board_AR-5315u.patch @@ -1,6 +1,6 @@ --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c -@@ -148,6 +148,68 @@ static struct board_info __initdata boar +@@ -143,6 +143,67 @@ static struct board_info __initdata boar }, }; @@ -22,7 +22,6 @@ + .name = "96318A-1441N1", + .expected_cpu_id = 0x6318, + -+ .has_uart0 = 1, + .has_pci = 1, + .use_fallback_sprom = 1, + @@ -69,7 +68,7 @@ static struct sprom_fixup __initdata dsl2751b_e1_fixups[] = { { .offset = 96, .value = 0x2046 }, { .offset = 97, .value = 0xfe9d }, -@@ -2616,6 +2678,7 @@ static const struct board_info __initcon +@@ -2526,6 +2587,7 @@ static const struct board_info __initcon #ifdef CONFIG_BCM63XX_CPU_6318 &board_96318ref, &board_96318ref_p300, @@ -77,7 +76,7 @@ &board_dsl_2751b_d1, &board_FAST2704N, #endif -@@ -2721,6 +2784,7 @@ static struct of_device_id const bcm963x +@@ -2631,6 +2693,7 @@ static struct of_device_id const bcm963x #ifdef CONFIG_BCM63XX_CPU_6318 { .compatible = "brcm,bcm96318ref", .data = &board_96318ref, }, { .compatible = "brcm,bcm96318ref_p300", .data = &board_96318ref_p300, }, diff --git a/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch new file mode 100644 index 000000000..7b28a24e3 --- /dev/null +++ b/target/linux/brcm63xx/patches-4.4/580-board_AD1018.patch @@ -0,0 +1,92 @@ +--- a/arch/mips/bcm63xx/boards/board_bcm963xx.c ++++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c +@@ -357,6 +357,73 @@ static struct board_info __initdata boar + }, + }; + ++static struct sprom_fixup __initdata ad1018_fixups[] = { ++ { .offset = 6, .value = 0x1c00 }, ++ { .offset = 65, .value = 0x1256 }, ++ { .offset = 96, .value = 0x2046 }, ++ { .offset = 97, .value = 0xfe69 }, ++ { .offset = 98, .value = 0x1726 }, ++ { .offset = 99, .value = 0xfa5c }, ++ { .offset = 112, .value = 0x2046 }, ++ { .offset = 113, .value = 0xfea8 }, ++ { .offset = 114, .value = 0x1978 }, ++ { .offset = 115, .value = 0xfa26 }, ++ { .offset = 161, .value = 0x2222 }, ++ { .offset = 169, .value = 0x2222 }, ++ { .offset = 171, .value = 0x2222 }, ++ { .offset = 173, .value = 0x2222 }, ++ { .offset = 174, .value = 0x4444 }, ++ { .offset = 175, .value = 0x2222 }, ++ { .offset = 176, .value = 0x4444 }, ++}; ++ ++static struct board_info __initdata board_AD1018 = { ++ .name = "96328avngr", ++ .expected_cpu_id = 0x6328, ++ ++ .has_pci = 1, ++ .use_fallback_sprom = 1, ++ ++ .has_ohci0 = 1, ++ .has_ehci0 = 1, ++ .num_usbh_ports = 1, ++ ++ .has_enetsw = 1, ++ ++ .enetsw = { ++ .used_ports = { ++ [0] = { ++ .used = 1, ++ .phy_id = 1, ++ .name = "FIBRE", ++ }, ++ [1] = { ++ .used = 1, ++ .phy_id = 2, ++ .name = "LAN3", ++ }, ++ [2] = { ++ .used = 1, ++ .phy_id = 3, ++ .name = "LAN2", ++ }, ++ [3] = { ++ .used = 1, ++ .phy_id = 4, ++ .name = "LAN1", ++ }, ++ }, ++ }, ++ ++ .fallback_sprom = { ++ .type = SPROM_BCM43217, ++ .pci_bus = 1, ++ .pci_dev = 0, ++ .board_fixups = ad1018_fixups, ++ .num_board_fixups = ARRAY_SIZE(ad1018_fixups), ++ }, ++}; ++ + static struct sprom_fixup __initdata ar5381u_fixups[] = { + { .offset = 97, .value = 0xfee5 }, + { .offset = 98, .value = 0x157c }, +@@ -2593,6 +2660,7 @@ static const struct board_info __initcon + #endif + #ifdef CONFIG_BCM63XX_CPU_6328 + &board_96328avng, ++ &board_AD1018, + &board_AR5381u, + &board_AR5387un, + &board_963281TAN, +@@ -2707,6 +2775,7 @@ static struct of_device_id const bcm963x + { .compatible = "d-link,dsl-274xb-f", .data = &board_dsl_274xb_f1, }, + { .compatible = "nucom,r5010unv2", .data = &board_R5010UNV2, }, + { .compatible = "sagem,f@st2704v2", .data = &board_FAST2704V2, }, ++ { .compatible = "sercomm,ad1018-nor", .data = &board_AD1018, }, + #endif + #ifdef CONFIG_BCM63XX_CPU_6338 + { .compatible = "brcm,bcm96338gw", .data = &board_96338gw, }, diff --git a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch index 99075c6b9..a573d2166 100644 --- a/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch +++ b/target/linux/brcm63xx/patches-4.4/804-bcm63xx_enet_63268_rgmii_ports.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c -@@ -2276,6 +2276,10 @@ static int bcm_enetsw_open(struct net_de +@@ -2270,6 +2270,10 @@ static int bcm_enetsw_open(struct net_de rgmii_ctrl = enetsw_readb(priv, ENETSW_RGMII_CTRL_REG(i)); rgmii_ctrl |= ENETSW_RGMII_CTRL_GMII_CLK_EN; diff --git a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch index d3d11e104..a191f9b2c 100644 --- a/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-4.9/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -414,8 +414,8 @@ KERNELRELEASE = $(shell cat include/conf +@@ -409,8 +409,8 @@ KERNELRELEASE = $(shell cat include/conf KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index d234651fd..f951a0daf 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -582,7 +582,7 @@ Signed-off-by: David S. Miller dnet_writel(bp, int_enable, INTR_ENB); --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c -@@ -3346,7 +3346,7 @@ int be_poll(struct napi_struct *napi, in +@@ -3344,7 +3344,7 @@ int be_poll(struct napi_struct *napi, in be_process_mcc(adapter); if (max_work < budget) { @@ -712,7 +712,7 @@ Signed-off-by: David S. Miller * then check once more to make sure we are done. --- a/drivers/net/ethernet/ibm/ibmvnic.c +++ b/drivers/net/ethernet/ibm/ibmvnic.c -@@ -999,7 +999,7 @@ restart_poll: +@@ -1009,7 +1009,7 @@ restart_poll: if (frames_processed < budget) { enable_scrq_irq(adapter, adapter->rx_scrq[scrq_num]); @@ -1095,7 +1095,7 @@ Signed-off-by: David S. Miller dma_intr_ena = smsc9420_reg_read(pd, DMAC_INTR_ENA); --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -2677,7 +2677,7 @@ static int stmmac_poll(struct napi_struc +@@ -2678,7 +2678,7 @@ static int stmmac_poll(struct napi_struc work_done = stmmac_rx(priv, budget); if (work_done < budget) { diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index 060f64341..d1b41d3e2 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -722,8 +722,10 @@ CONFIG_CC_STACKPROTECTOR_NONE=y # CONFIG_CFG80211 is not set # CONFIG_CFG80211_CERTIFICATION_ONUS is not set # CONFIG_CGROUPS is not set +# CONFIG_CGROUP_BPF is not set # CONFIG_CGROUP_DEBUG is not set # CONFIG_CGROUP_NET_PRIO is not set +# CONFIG_CGROUP_RDMA is not set # CONFIG_CHARGER_BQ2415X is not set # CONFIG_CHARGER_BQ24190 is not set # CONFIG_CHARGER_BQ24257 is not set @@ -1960,6 +1962,7 @@ CONFIG_INPUT_MISC=y # CONFIG_INTEL_RST is not set # CONFIG_INTEL_SMARTCONNECT is not set # CONFIG_INTEL_SOC_PMIC is not set +# CONFIG_INTEL_SOC_PMIC_CHTWC is not set # CONFIG_INTEL_TH is not set # CONFIG_INTEL_VBTN is not set # CONFIG_INTEL_XWAY_PHY is not set @@ -4236,6 +4239,7 @@ CONFIG_SLUB=y CONFIG_SLUB_CPU_PARTIAL=y # CONFIG_SLUB_DEBUG is not set # CONFIG_SLUB_DEBUG_ON is not set +# CONFIG_SLUB_MEMCG_SYSFS_ON is not set # CONFIG_SLUB_STATS is not set # CONFIG_SMARTJOYPLUS_FF is not set # CONFIG_SMC911X is not set @@ -5589,3 +5593,4 @@ CONFIG_ZONE_DMA=y # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set # CONFIG_ZX_TDM is not set +# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/hack-4.9/202-reduce_module_size.patch b/target/linux/generic/hack-4.9/202-reduce_module_size.patch index 1b4e19a4a..6e5fc9cd4 100644 --- a/target/linux/generic/hack-4.9/202-reduce_module_size.patch +++ b/target/linux/generic/hack-4.9/202-reduce_module_size.patch @@ -13,12 +13,12 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -407,7 +407,7 @@ KBUILD_CFLAGS_KERNEL := - KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) +@@ -401,7 +401,7 @@ KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE -KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) - KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 354052d8b..1b0262a06 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1196,7 +1196,6 @@ all: modules +@@ -1197,7 +1197,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1226,7 +1225,6 @@ _modinst_: +@@ -1227,7 +1226,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/220-gc_sections.patch b/target/linux/generic/hack-4.9/220-gc_sections.patch index eda8bb8b2..e39f0f5f4 100644 --- a/target/linux/generic/hack-4.9/220-gc_sections.patch +++ b/target/linux/generic/hack-4.9/220-gc_sections.patch @@ -21,9 +21,9 @@ Signed-off-by: Gabor Juhos --- a/Makefile +++ b/Makefile -@@ -409,6 +409,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE - KBUILD_CFLAGS_MODULE := -DMODULE +@@ -404,6 +404,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -633,11 +638,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -634,11 +639,6 @@ KBUILD_CFLAGS += $(call cc-disable-warni KBUILD_CFLAGS += $(call cc-disable-warning, format-overflow) KBUILD_CFLAGS += $(call cc-disable-warning, int-in-bool-context) diff --git a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch index a3df4fbe3..7c3e38efc 100644 --- a/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch +++ b/target/linux/generic/hack-4.9/301-mips_image_cmdline_hack.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1150,6 +1150,10 @@ config SYNC_R4K +@@ -1155,6 +1155,10 @@ config SYNC_R4K config MIPS_MACHINE def_bool n diff --git a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch index c22a4823f..8c6ed8c20 100644 --- a/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch +++ b/target/linux/generic/hack-4.9/321-powerpc_crtsavres_prereq.patch @@ -16,7 +16,7 @@ Signed-off-by: Alexandros C. Couloumbis --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile -@@ -179,7 +179,6 @@ else +@@ -188,7 +188,6 @@ else CHECKFLAGS += -D__LITTLE_ENDIAN__ endif diff --git a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index 523a69c87..180d1407d 100644 --- a/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.14/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch index 99cc0f6cd..c8e25710b 100644 --- a/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.14/494-mtd-ubi-add-EOF-marker-support.patch @@ -36,7 +36,7 @@ Signed-off-by: Gabor Juhos + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch index 5d83aa3bb..6c9f30a97 100644 --- a/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-4.4/002-phy_drivers_backport.patch @@ -464,7 +464,7 @@ module_init(psb6970_init); --- a/drivers/net/phy/rtl8306.c +++ b/drivers/net/phy/rtl8306.c -@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p +@@ -877,7 +877,7 @@ rtl8306_config_init(struct phy_device *p int err; /* Only init the switch for the primary PHY */ @@ -473,7 +473,7 @@ return 0; val.value.i = 1; -@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p +@@ -887,7 +887,7 @@ rtl8306_config_init(struct phy_device *p priv->dev.ops = &rtl8306_ops; priv->do_cpu = 0; priv->page = -1; @@ -482,7 +482,7 @@ chipid = rtl_get(dev, RTL_REG_CHIPID); chipver = rtl_get(dev, RTL_REG_CHIPVER); -@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev) +@@ -933,13 +933,13 @@ rtl8306_fixup(struct phy_device *pdev) u16 chipid; /* Attach to primary LAN port and WAN port */ @@ -498,7 +498,7 @@ chipid = rtl_get(&priv.dev, RTL_REG_CHIPID); if (chipid == 0x5988) pdev->phy_id = RTL8306_MAGIC; -@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev) +@@ -957,14 +957,14 @@ rtl8306_probe(struct phy_device *pdev) * share one rtl_priv instance between virtual phy * devices on the same bus */ @@ -515,7 +515,7 @@ found: pdev->priv = priv; -@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p +@@ -985,7 +985,7 @@ rtl8306_config_aneg(struct phy_device *p struct rtl_priv *priv = pdev->priv; /* Only for WAN */ @@ -524,7 +524,7 @@ return 0; /* Restart autonegotiation */ -@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p +@@ -1001,7 +1001,7 @@ rtl8306_read_status(struct phy_device *p struct rtl_priv *priv = pdev->priv; struct switch_dev *dev = &priv->dev; @@ -533,7 +533,7 @@ /* WAN */ pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10; pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF; -@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver +@@ -1044,6 +1044,7 @@ static struct phy_driver rtl8306_driver .config_init = &rtl8306_config_init, .config_aneg = &rtl8306_config_aneg, .read_status = &rtl8306_read_status, @@ -541,7 +541,7 @@ }; -@@ -1048,7 +1049,7 @@ static int __init +@@ -1051,7 +1052,7 @@ static int __init rtl_init(void) { phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup); diff --git a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 6c9b12c2e..a53be2d15 100644 --- a/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.4/103-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -75,7 +75,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5357,7 +5357,7 @@ static void __init_refok alloc_node_mem_ +@@ -5372,7 +5372,7 @@ static void __init_refok alloc_node_mem_ mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index f08f9b4a7..b15066f75 100644 --- a/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.4/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -47,11 +47,11 @@ Signed-off-by: Daniel Golle + mtd->type == MTD_DATAFLASH || + mtd->type == MTD_MLCNANDFLASH) { + mutex_lock(&ubi_devices_mutex); -+ pr_notice("UBI: auto-attach mtd%d", mtd->index); ++ pr_notice("UBI: auto-attach mtd%d\n", mtd->index); + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch index dd5ee306e..749232a39 100644 --- a/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.4/494-mtd-ubi-add-EOF-marker-support.patch @@ -27,7 +27,7 @@ + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.4/630-packet_socket_type.patch b/target/linux/generic/pending-4.4/630-packet_socket_type.patch index a427165f4..0314938ac 100644 --- a/target/linux/generic/pending-4.4/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.4/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1784,6 +1784,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1777,6 +1777,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1791,6 +1792,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1784,6 +1785,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1803,7 +1805,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1796,7 +1798,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2006,12 +2008,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1999,12 +2001,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2131,12 +2133,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2124,12 +2126,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3127,6 +3129,7 @@ static int packet_create(struct net *net +@@ -3126,6 +3128,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3756,6 +3759,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3755,6 +3758,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3809,6 +3822,13 @@ static int packet_getsockopt(struct sock +@@ -3807,6 +3820,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index c5f3e195d..4bf34c128 100644 --- a/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3597,6 +3636,17 @@ static int __net_init ip6_route_net_init +@@ -3601,6 +3640,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3615,6 +3665,8 @@ out: +@@ -3619,6 +3669,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3632,6 +3684,7 @@ static void __net_exit ip6_route_net_exi +@@ -3636,6 +3688,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3705,6 +3758,9 @@ void __init ip6_route_init_special_entri +@@ -3709,6 +3762,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index b7ba384f4..d91db1fe7 100644 --- a/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4259,6 +4259,9 @@ static enum gro_result dev_gro_receive(s +@@ -4260,6 +4260,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5425,6 +5428,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5426,6 +5429,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5496,6 +5541,7 @@ static int __netdev_upper_dev_link(struc +@@ -5497,6 +5542,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,7 +84,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); return 0; -@@ -5622,6 +5668,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5623,6 +5669,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -92,7 +92,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6162,6 +6209,7 @@ int dev_set_mac_address(struct net_devic +@@ -6163,6 +6210,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.4/721-phy_packets.patch b/target/linux/generic/pending-4.4/721-phy_packets.patch index a7a23278d..716c1a027 100644 --- a/target/linux/generic/pending-4.4/721-phy_packets.patch +++ b/target/linux/generic/pending-4.4/721-phy_packets.patch @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2746,10 +2746,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2747,10 +2747,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 1ef9f9800..5aada68e3 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -34,7 +34,7 @@ } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -143,7 +143,10 @@ static const struct file_operations proc +@@ -144,7 +144,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -46,7 +46,7 @@ if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -160,6 +163,9 @@ void proc_tty_unregister_driver(struct t +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -56,7 +56,7 @@ ent = driver->proc_entry; if (!ent) return; -@@ -174,6 +180,9 @@ void proc_tty_unregister_driver(struct t +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { @@ -133,7 +133,7 @@ } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1553,10 +1553,12 @@ static int __init setup_vmstat(void) +@@ -1555,10 +1555,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch index 10613de85..eac39669d 100644 --- a/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch +++ b/target/linux/generic/pending-4.4/904-debloat_dma_buf.patch @@ -34,7 +34,7 @@ +MODULE_LICENSE("GPL"); --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -2097,6 +2097,7 @@ int wake_up_state(struct task_struct *p, +@@ -2096,6 +2096,7 @@ int wake_up_state(struct task_struct *p, { return try_to_wake_up(p, state, 0); } diff --git a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 826496b41..794280eec 100644 --- a/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-4.9/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -5930,7 +5930,7 @@ static void __ref alloc_node_mem_map(str +@@ -5923,7 +5923,7 @@ static void __ref alloc_node_mem_map(str mem_map = NODE_DATA(0)->node_mem_map; #if defined(CONFIG_HAVE_MEMBLOCK_NODE_MAP) || defined(CONFIG_FLATMEM) if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-4.9/201-extra_optimization.patch b/target/linux/generic/pending-4.9/201-extra_optimization.patch index 74acc3571..6a8467a8b 100644 --- a/target/linux/generic/pending-4.9/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.9/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -639,12 +639,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata +@@ -640,12 +640,12 @@ KBUILD_CFLAGS += $(call cc-option,-fdata endif ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE diff --git a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch index a8dcad458..76d031002 100644 --- a/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch +++ b/target/linux/generic/pending-4.9/490-ubi-auto-attach-mtd-device-named-ubi-or-data-on-boot.patch @@ -33,7 +33,7 @@ Signed-off-by: Daniel Golle + /* check for a valid ubi magic */ + err = mtd_read(mtd, 0, 4, &len, (void *) magic); + if (!err && len == 4 && strncmp(magic, "UBI#", 4)) { -+ pr_err("UBI error: no valid UBI magic found inside mtd%d", mtd->index); ++ pr_err("UBI error: no valid UBI magic found inside mtd%d\n", mtd->index); + put_mtd_device(mtd); + return; + } @@ -48,7 +48,7 @@ Signed-off-by: Daniel Golle + err = ubi_attach_mtd_dev(mtd, UBI_DEV_NUM_AUTO, 0, 0); + mutex_unlock(&ubi_devices_mutex); + if (err < 0) { -+ pr_err("UBI error: cannot attach mtd%d", mtd->index); ++ pr_err("UBI error: cannot attach mtd%d\n", mtd->index); + put_mtd_device(mtd); + } + } diff --git a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch index c6ba444b4..0b2314955 100644 --- a/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch +++ b/target/linux/generic/pending-4.9/494-mtd-ubi-add-EOF-marker-support.patch @@ -36,7 +36,7 @@ Signed-off-by: Gabor Juhos + return err; + + if (ec_hdr_has_eof(ech)) { -+ pr_notice("UBI: EOF marker found, PEBs from %d will be erased", ++ pr_notice("UBI: EOF marker found, PEBs from %d will be erased\n", + pnum); + ai->eof_found = true; + } diff --git a/target/linux/generic/pending-4.9/630-packet_socket_type.patch b/target/linux/generic/pending-4.9/630-packet_socket_type.patch index e943a47a8..092011d0e 100644 --- a/target/linux/generic/pending-4.9/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.9/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1780,6 +1780,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1773,6 +1773,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1787,6 +1788,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1780,6 +1781,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1799,7 +1801,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1792,7 +1794,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2037,12 +2039,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2030,12 +2032,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2168,12 +2170,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2161,12 +2163,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock +@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -129,6 +129,7 @@ struct packet_sock { +@@ -128,6 +128,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/ixp4xx/Makefile b/target/linux/ixp4xx/Makefile index a185ce8df..e1964331a 100644 --- a/target/linux/ixp4xx/Makefile +++ b/target/linux/ixp4xx/Makefile @@ -10,10 +10,11 @@ ARCH:=armeb BOARD:=ixp4xx BOARDNAME:=Intel IXP4xx FEATURES:=squashfs -MAINTAINER:=Imre Kaloz +MAINTAINER:=Ted Hess , \ + Imre Kaloz SUBTARGETS:=generic harddisk -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ixp4xx/config-4.9 b/target/linux/ixp4xx/config-4.9 new file mode 100644 index 000000000..c9b1be930 --- /dev/null +++ b/target/linux/ixp4xx/config-4.9 @@ -0,0 +1,247 @@ +CONFIG_ALIGNMENT_TRAP=y +# CONFIG_ARCH_ADI_COYOTE is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_IXCDP1100=y +CONFIG_ARCH_IXDP425=y +CONFIG_ARCH_IXDP4XX=y +CONFIG_ARCH_IXP4XX=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_NR_GPIO=0 +# CONFIG_ARCH_PRPMC1100 is not set +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ATAGS=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOUNCE=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200" +CONFIG_CMDLINE_FROM_BOOTLOADER=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_ENDIAN_BE32=y +# CONFIG_CPU_ENDIAN_BE8 is not set +CONFIG_CPU_IXP43X=y +CONFIG_CPU_IXP46X=y +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_V4WBI=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CPU_XSCALE=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xc8000003 +CONFIG_DEBUG_UART_VIRT=0xfef00003 +# CONFIG_DEBUG_USER is not set +CONFIG_DMABOUNCE=y +CONFIG_DNOTIFY=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_AT24=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HWMON=y +CONFIG_HWMON_VID=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_IXP4XX=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_GPIO=y +# CONFIG_I2C_IOP3XX is not set +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IP_PIMSM_V1=y +CONFIG_IP_PIMSM_V2=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +# CONFIG_IWMMXT is not set +CONFIG_IXP4XX_ETH=y +# CONFIG_IXP4XX_INDIRECT_PCI is not set +CONFIG_IXP4XX_NPE=y +CONFIG_IXP4XX_QMGR=y +CONFIG_IXP4XX_WATCHDOG=y +CONFIG_LEDS_FSG=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_LATCH=y +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MACH_AP1000=y +CONFIG_MACH_AP42X=y +# CONFIG_MACH_ARCOM_VULCAN is not set +CONFIG_MACH_AVILA=y +CONFIG_MACH_CAMBRIA=y +CONFIG_MACH_COMPEXWP18=y +# CONFIG_MACH_DEVIXP is not set +CONFIG_MACH_DSMG600=y +CONFIG_MACH_FSG=y +CONFIG_MACH_GATEWAY7001=y +# CONFIG_MACH_GORAMO_MLR is not set +# CONFIG_MACH_GTWX5715 is not set +# CONFIG_MACH_IXDP465 is not set +CONFIG_MACH_IXDPG425=y +# CONFIG_MACH_KIXRP435 is not set +CONFIG_MACH_LOFT=y +CONFIG_MACH_MI424WR=y +# CONFIG_MACH_MIC256 is not set +# CONFIG_MACH_MICCPT is not set +CONFIG_MACH_NAS100D=y +CONFIG_MACH_NSLU2=y +CONFIG_MACH_PRONGHORN=y +CONFIG_MACH_PRONGHORNMETRO=y +CONFIG_MACH_SIDEWINDER=y +CONFIG_MACH_TW2662=y +CONFIG_MACH_TW5334=y +CONFIG_MACH_USR8200=y +CONFIG_MACH_WG302V1=y +CONFIG_MACH_WG302V2=y +CONFIG_MACH_WRT300NV2=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_CFI_ADV_OPTIONS=y +# CONFIG_MTD_CFI_GEOMETRY is not set +CONFIG_MTD_IXP4XX=y +CONFIG_MTD_OTP=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_REDBOOT_PARTS=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_MACH_IO_H=y +CONFIG_NEED_PER_CPU_KM=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NET_VENDOR_XSCALE=y +CONFIG_NO_BOOTMEM=y +CONFIG_NVMEM=y +# CONFIG_OF is not set +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1672=y +CONFIG_RTC_DRV_ISL1208=y +CONFIG_RTC_DRV_PCF8563=y +CONFIG_RTC_DRV_X1205=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +CONFIG_SENSORS_AD7418=y +CONFIG_SENSORS_MAX6650=y +CONFIG_SENSORS_W83781D=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_USB_EHCI_BIG_ENDIAN_DESC=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_SUPPORT=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_NOWAYOUT=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 diff --git a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch index 2bcc801b1..937a65e43 100644 --- a/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch +++ b/target/linux/ixp4xx/patches-4.4/160-delayed_uart_io.patch @@ -115,7 +115,7 @@ case UPIO_AU: p->serial_out(p, offset, value); p->serial_in(p, UART_LCR); /* safe, no side-effects */ -@@ -2457,6 +2477,7 @@ static int serial8250_request_std_resour +@@ -2460,6 +2480,7 @@ static int serial8250_request_std_resour case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: @@ -123,7 +123,7 @@ if (!port->mapbase) break; -@@ -2494,6 +2515,7 @@ static void serial8250_release_std_resou +@@ -2497,6 +2518,7 @@ static void serial8250_release_std_resou case UPIO_MEM32: case UPIO_MEM32BE: case UPIO_MEM: diff --git a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch index 207ccc533..33c3327ee 100644 --- a/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch +++ b/target/linux/ixp4xx/patches-4.4/207-npe_driver_multiphy_support.patch @@ -66,7 +66,18 @@ TODO: take care of additional PHYs through the PHY abstraction layer snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, mdio_bus->id, plat->phy); port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, -@@ -632,21 +663,32 @@ static void ixp4xx_phy_disconnect(struct +@@ -625,6 +656,10 @@ static int ixp4xx_phy_connect(struct net + + port->phydev->irq = PHY_POLL; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + return 0; + } + +@@ -632,21 +667,32 @@ static void ixp4xx_phy_disconnect(struct { struct port *port = netdev_priv(dev); @@ -102,7 +113,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer } static inline void debug_pkt(struct net_device *dev, const char *func, -@@ -1048,6 +1090,9 @@ static int eth_ioctl(struct net_device * +@@ -1048,6 +1094,9 @@ static int eth_ioctl(struct net_device * return hwtstamp_get(dev, req); } @@ -112,7 +123,7 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_mii_ioctl(port->phydev, req, cmd); } -@@ -1068,18 +1113,30 @@ static void ixp4xx_get_drvinfo(struct ne +@@ -1068,18 +1117,30 @@ static void ixp4xx_get_drvinfo(struct ne static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct port *port = netdev_priv(dev); @@ -143,3 +154,14 @@ TODO: take care of additional PHYs through the PHY abstraction layer return phy_start_aneg(port->phydev); } +@@ -1529,10 +1590,6 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + +- port->link = 0; +- port->speed = 0; +- port->duplex = -1; +- + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch new file mode 100644 index 000000000..3ca3eb76a --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/001-arm-ixp4xx-set-cohorent_dma_mask-for-ethernet-platfo.patch @@ -0,0 +1,136 @@ +From 7113f56b683c5123df5c20724ac813cee66fa21a Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:49:05 +0200 +Subject: [PATCH 1/2] arm: ixp4xx: set cohorent_dma_mask for ethernet platform + devices + +ARM requires the cohorent_dma_mask set, so set it for the platform +devices so that the ethernet driver has access to it. + +Signed-off-by: Jonas Gorski +--- + arch/arm/mach-ixp4xx/fsg-setup.c | 2 ++ + arch/arm/mach-ixp4xx/goramo_mlr.c | 2 ++ + arch/arm/mach-ixp4xx/ixdp425-setup.c | 3 +++ + arch/arm/mach-ixp4xx/nas100d-setup.c | 1 + + arch/arm/mach-ixp4xx/nslu2-setup.c | 1 + + arch/arm/mach-ixp4xx/omixp-setup.c | 3 +++ + arch/arm/mach-ixp4xx/vulcan-setup.c | 2 ++ + 7 files changed, 14 insertions(+) + +--- a/arch/arm/mach-ixp4xx/fsg-setup.c ++++ b/arch/arm/mach-ixp4xx/fsg-setup.c +@@ -142,12 +142,14 @@ static struct platform_device fsg_eth[] + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = fsg_plat_eth, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = fsg_plat_eth + 1, ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + } + }; +--- a/arch/arm/mach-ixp4xx/goramo_mlr.c ++++ b/arch/arm/mach-ixp4xx/goramo_mlr.c +@@ -295,10 +295,12 @@ static struct platform_device device_eth + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = eth_plat, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = eth_plat + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -196,10 +197,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nas100d-setup.c ++++ b/arch/arm/mach-ixp4xx/nas100d-setup.c +@@ -170,6 +170,7 @@ static struct platform_device nas100d_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nas100d_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/nslu2-setup.c ++++ b/arch/arm/mach-ixp4xx/nslu2-setup.c +@@ -182,6 +182,7 @@ static struct platform_device nslu2_eth[ + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = nslu2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + } + }; + +--- a/arch/arm/mach-ixp4xx/omixp-setup.c ++++ b/arch/arm/mach-ixp4xx/omixp-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -188,10 +189,12 @@ static struct platform_device ixdp425_et + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEB, + .dev.platform_data = ixdp425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, { + .name = "ixp4xx_eth", + .id = IXP4XX_ETH_NPEC, + .dev.platform_data = ixdp425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), + }, + }; + +--- a/arch/arm/mach-ixp4xx/vulcan-setup.c ++++ b/arch/arm/mach-ixp4xx/vulcan-setup.c +@@ -139,6 +139,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEB, + .dev = { + .platform_data = &vulcan_plat_eth[0], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + [1] = { +@@ -146,6 +147,7 @@ static struct platform_device vulcan_eth + .id = IXP4XX_ETH_NPEC, + .dev = { + .platform_data = &vulcan_plat_eth[1], ++ .coherent_dma_mask = DMA_BIT_MASK(32), + }, + }, + }; diff --git a/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch new file mode 100644 index 000000000..b369b56f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/002-ixp4xx_eth-use-parent-device-for-dma-allocations.patch @@ -0,0 +1,95 @@ +From 1d67040af0144c549f4db8144d2ccc253ff8639c Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Mon, 1 Jul 2013 16:39:28 +0200 +Subject: [PATCH 2/2] net: ixp4xx_eth: use parent device for dma allocations + +Now that the platfomr device provides a dma_cohorent_mask, use it for +dma operations. + +This fixes ethernet on ixp4xx which was broken since 3.7. + +Signed-off-by: Jonas Gorski +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -656,10 +656,10 @@ static inline void queue_put_desc(unsign + static inline void dma_unmap_tx(struct port *port, struct desc *desc) + { + #ifdef __ARMEB__ +- dma_unmap_single(&port->netdev->dev, desc->data, ++ dma_unmap_single(port->netdev->dev.parent, desc->data, + desc->buf_len, DMA_TO_DEVICE); + #else +- dma_unmap_single(&port->netdev->dev, desc->data & ~3, ++ dma_unmap_single(port->netdev->dev.parent, desc->data & ~3, + ALIGN((desc->data & 3) + desc->buf_len, 4), + DMA_TO_DEVICE); + #endif +@@ -725,9 +725,9 @@ static int eth_poll(struct napi_struct * + + #ifdef __ARMEB__ + if ((skb = netdev_alloc_skb(dev, RX_BUFF_SIZE))) { +- phys = dma_map_single(&dev->dev, skb->data, ++ phys = dma_map_single(dev->dev.parent, skb->data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&dev->dev, phys)) { ++ if (dma_mapping_error(dev->dev.parent, phys)) { + dev_kfree_skb(skb); + skb = NULL; + } +@@ -750,10 +750,11 @@ static int eth_poll(struct napi_struct * + #ifdef __ARMEB__ + temp = skb; + skb = port->rx_buff_tab[n]; +- dma_unmap_single(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_unmap_single(dev->dev.parent, desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + #else +- dma_sync_single_for_cpu(&dev->dev, desc->data - NET_IP_ALIGN, ++ dma_sync_single_for_cpu(dev->dev.parent, ++ desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + memcpy_swab32((u32 *)skb->data, (u32 *)port->rx_buff_tab[n], + ALIGN(NET_IP_ALIGN + desc->pkt_len, 4) / 4); +@@ -872,7 +873,7 @@ static int eth_xmit(struct sk_buff *skb, + memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4); + #endif + +- phys = dma_map_single(&dev->dev, mem, bytes, DMA_TO_DEVICE); ++ phys = dma_map_single(dev->dev.parent, mem, bytes, DMA_TO_DEVICE); + if (dma_mapping_error(&dev->dev, phys)) { + dev_kfree_skb(skb); + #ifndef __ARMEB__ +@@ -1107,7 +1108,7 @@ static int init_queues(struct port *port + int i; + + if (!ports_open) { +- dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev, ++ dma_pool = dma_pool_create(DRV_NAME, port->netdev->dev.parent, + POOL_ALLOC_SIZE, 32, 0); + if (!dma_pool) + return -ENOMEM; +@@ -1135,9 +1136,9 @@ static int init_queues(struct port *port + data = buff; + #endif + desc->buf_len = MAX_MRU; +- desc->data = dma_map_single(&port->netdev->dev, data, ++ desc->data = dma_map_single(port->netdev->dev.parent, data, + RX_BUFF_SIZE, DMA_FROM_DEVICE); +- if (dma_mapping_error(&port->netdev->dev, desc->data)) { ++ if (dma_mapping_error(port->netdev->dev.parent, desc->data)) { + free_buffer(buff); + return -EIO; + } +@@ -1157,7 +1158,7 @@ static void destroy_queues(struct port * + struct desc *desc = rx_desc_ptr(port, i); + buffer_t *buff = port->rx_buff_tab[i]; + if (buff) { +- dma_unmap_single(&port->netdev->dev, ++ dma_unmap_single(port->netdev->dev.parent, + desc->data - NET_IP_ALIGN, + RX_BUFF_SIZE, DMA_FROM_DEVICE); + free_buffer(buff); diff --git a/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch new file mode 100644 index 000000000..185a09fff --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/020-gateworks_i2c_pld.patch @@ -0,0 +1,424 @@ +--- a/drivers/gpio/Kconfig ++++ b/drivers/gpio/Kconfig +@@ -656,6 +656,14 @@ config GPIO_WS16C48 + parameter. The interrupt line numbers for the devices may be + configured via the irq module parameter. + ++config GPIO_GW_I2C_PLD ++ tristate "Gateworks I2C PLD GPIO Expander" ++ depends on I2C ++ help ++ Say yes here to provide access to the Gateworks I2C PLD GPIO ++ Expander. This is used at least on the GW2358-4. ++ ++ + endmenu + + menu "I2C GPIO expanders" +--- a/drivers/gpio/Makefile ++++ b/drivers/gpio/Makefile +@@ -48,6 +48,7 @@ obj-$(CONFIG_GPIO_F7188X) += gpio-f7188x + obj-$(CONFIG_GPIO_GE_FPGA) += gpio-ge.o + obj-$(CONFIG_GPIO_GPIO_MM) += gpio-gpio-mm.o + obj-$(CONFIG_GPIO_GRGPIO) += gpio-grgpio.o ++obj-$(CONFIG_GPIO_GW_I2C_PLD) += gw_i2c_pld.o + obj-$(CONFIG_HTC_EGPIO) += gpio-htc-egpio.o + obj-$(CONFIG_GPIO_ICH) += gpio-ich.o + obj-$(CONFIG_GPIO_IOP) += gpio-iop.o +--- /dev/null ++++ b/drivers/gpio/gw_i2c_pld.c +@@ -0,0 +1,371 @@ ++/* ++ * Gateworks I2C PLD GPIO expander ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static const struct i2c_device_id gw_i2c_pld_id[] = { ++ { "gw_i2c_pld", 8 }, ++ { } ++}; ++MODULE_DEVICE_TABLE(i2c, gw_i2c_pld_id); ++ ++/* ++ * The Gateworks I2C PLD chip only expose one read and one ++ * write register. Writing a "one" bit (to match the reset state) lets ++ * that pin be used as an input. It is an open-drain model. ++ */ ++ ++struct gw_i2c_pld { ++ struct gpio_chip chip; ++ struct i2c_client *client; ++ unsigned out; /* software latch */ ++}; ++ ++/*-------------------------------------------------------------------------*/ ++ ++/* ++ * The Gateworks I2C PLD chip does not properly send the acknowledge bit ++ * thus we cannot use standard i2c_smbus functions. We have recreated ++ * our own here, but we still use the rt_mutex_lock to lock the i2c_bus ++ * as the device still exists on the I2C bus. ++*/ ++ ++#define PLD_SCL_GPIO 6 ++#define PLD_SDA_GPIO 7 ++ ++#define SCL_LO() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_LOW) ++#define SCL_HI() gpio_line_set(PLD_SCL_GPIO, IXP4XX_GPIO_HIGH) ++#define SCL_EN() gpio_line_config(PLD_SCL_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_LO() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_LOW) ++#define SDA_HI() gpio_line_set(PLD_SDA_GPIO, IXP4XX_GPIO_HIGH) ++#define SDA_EN() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_OUT) ++#define SDA_DIS() gpio_line_config(PLD_SDA_GPIO, IXP4XX_GPIO_IN) ++#define SDA_IN(x) gpio_line_get(PLD_SDA_GPIO, &x); ++ ++static int i2c_pld_write_byte(int address, int byte) ++{ ++ int i; ++ ++ address = (address << 1) & ~0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (byte & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ ++ SDA_HI(); ++ SDA_EN(); ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return 0; ++} ++ ++static unsigned int i2c_pld_read_byte(int address) ++{ ++ int i = 0, byte = 0; ++ int bit; ++ ++ address = (address << 1) | 0x1; ++ ++ SDA_HI(); ++ SDA_EN(); ++ SCL_EN(); ++ SCL_HI(); ++ SDA_LO(); ++ SCL_LO(); ++ ++ for (i = 7; i >= 0; i--) ++ { ++ if (address & (1 << i)) ++ SDA_HI(); ++ else ++ SDA_LO(); ++ ++ SCL_HI(); ++ SCL_LO(); ++ } ++ ++ SDA_DIS(); ++ SCL_HI(); ++ SDA_IN(i); ++ SCL_LO(); ++ SDA_EN(); ++ ++ SDA_DIS(); ++ for (i = 7; i >= 0; i--) ++ { ++ SCL_HI(); ++ SDA_IN(bit); ++ byte |= bit << i; ++ SCL_LO(); ++ } ++ ++ SDA_LO(); ++ SCL_HI(); ++ SDA_HI(); ++ SCL_LO(); ++ SCL_HI(); ++ ++ return byte; ++} ++ ++ ++static int gw_i2c_pld_input8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ gpio->out |= (1 << offset); ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static int gw_i2c_pld_get8(struct gpio_chip *chip, unsigned offset) ++{ ++ int ret; ++ s32 value; ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ value = i2c_pld_read_byte(gpio->client->addr); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return (value < 0) ? 0 : (value & (1 << offset)); ++} ++ ++static int gw_i2c_pld_output8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ int ret; ++ ++ struct gw_i2c_pld *gpio = container_of(chip, struct gw_i2c_pld, chip); ++ struct i2c_adapter *adap = gpio->client->adapter; ++ ++ unsigned bit = 1 << offset; ++ ++ if (in_atomic() || irqs_disabled()) { ++ ret = rt_mutex_trylock(&adap->bus_lock); ++ if (!ret) ++ /* I2C activity is ongoing. */ ++ return -EAGAIN; ++ } else { ++ rt_mutex_lock(&adap->bus_lock); ++ } ++ ++ ++ if (value) ++ gpio->out |= bit; ++ else ++ gpio->out &= ~bit; ++ ++ ret = i2c_pld_write_byte(gpio->client->addr, gpio->out); ++ ++ rt_mutex_unlock(&adap->bus_lock); ++ ++ return ret; ++} ++ ++static void gw_i2c_pld_set8(struct gpio_chip *chip, unsigned offset, int value) ++{ ++ gw_i2c_pld_output8(chip, offset, value); ++} ++ ++/*-------------------------------------------------------------------------*/ ++ ++static int gw_i2c_pld_probe(struct i2c_client *client, ++ const struct i2c_device_id *id) ++{ ++ struct gw_i2c_pld_platform_data *pdata; ++ struct gw_i2c_pld *gpio; ++ int status; ++ ++ pdata = client->dev.platform_data; ++ if (!pdata) ++ return -ENODEV; ++ ++ /* Allocate, initialize, and register this gpio_chip. */ ++ gpio = kzalloc(sizeof *gpio, GFP_KERNEL); ++ if (!gpio) ++ return -ENOMEM; ++ ++ gpio->chip.base = pdata->gpio_base; ++ gpio->chip.can_sleep = 1; ++ gpio->chip.dev = &client->dev; ++ gpio->chip.owner = THIS_MODULE; ++ ++ gpio->chip.ngpio = pdata->nr_gpio; ++ gpio->chip.direction_input = gw_i2c_pld_input8; ++ gpio->chip.get = gw_i2c_pld_get8; ++ gpio->chip.direction_output = gw_i2c_pld_output8; ++ gpio->chip.set = gw_i2c_pld_set8; ++ ++ gpio->chip.label = client->name; ++ ++ gpio->client = client; ++ i2c_set_clientdata(client, gpio); ++ ++ gpio->out = 0xFF; ++ ++ status = gpiochip_add(&gpio->chip); ++ if (status < 0) ++ goto fail; ++ ++ dev_info(&client->dev, "gpios %d..%d on a %s%s\n", ++ gpio->chip.base, ++ gpio->chip.base + gpio->chip.ngpio - 1, ++ client->name, ++ client->irq ? " (irq ignored)" : ""); ++ ++ /* Let platform code set up the GPIOs and their users. ++ * Now is the first time anyone could use them. ++ */ ++ if (pdata->setup) { ++ status = pdata->setup(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) ++ dev_warn(&client->dev, "setup --> %d\n", status); ++ } ++ ++ return 0; ++ ++fail: ++ dev_dbg(&client->dev, "probe error %d for '%s'\n", ++ status, client->name); ++ kfree(gpio); ++ return status; ++} ++ ++static int gw_i2c_pld_remove(struct i2c_client *client) ++{ ++ struct gw_i2c_pld_platform_data *pdata = client->dev.platform_data; ++ struct gw_i2c_pld *gpio = i2c_get_clientdata(client); ++ int status = 0; ++ ++ if (pdata->teardown) { ++ status = pdata->teardown(client, ++ gpio->chip.base, gpio->chip.ngpio, ++ pdata->context); ++ if (status < 0) { ++ dev_err(&client->dev, "%s --> %d\n", ++ "teardown", status); ++ return status; ++ } ++ } ++ ++ gpiochip_remove(&gpio->chip); ++ kfree(gpio); ++ return 0; ++} ++ ++static struct i2c_driver gw_i2c_pld_driver = { ++ .driver = { ++ .name = "gw_i2c_pld", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_i2c_pld_probe, ++ .remove = gw_i2c_pld_remove, ++ .id_table = gw_i2c_pld_id, ++}; ++ ++static int __init gw_i2c_pld_init(void) ++{ ++ return i2c_add_driver(&gw_i2c_pld_driver); ++} ++module_init(gw_i2c_pld_init); ++ ++static void __exit gw_i2c_pld_exit(void) ++{ ++ i2c_del_driver(&gw_i2c_pld_driver); ++} ++module_exit(gw_i2c_pld_exit); ++ ++MODULE_LICENSE("GPL"); ++MODULE_AUTHOR("Chris Lang"); +--- /dev/null ++++ b/include/linux/i2c/gw_i2c_pld.h +@@ -0,0 +1,20 @@ ++#ifndef __LINUX_GW_I2C_PLD_H ++#define __LINUX_GW_I2C_PLD_H ++ ++/** ++ * The Gateworks I2C PLD Implements an additional 8 bits of GPIO through the PLD ++ */ ++ ++struct gw_i2c_pld_platform_data { ++ unsigned gpio_base; ++ unsigned nr_gpio; ++ int (*setup)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ int (*teardown)(struct i2c_client *client, ++ int gpio, unsigned ngpio, ++ void *context); ++ void *context; ++}; ++ ++#endif /* __LINUX_GW_I2C_PLD_H */ diff --git a/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch new file mode 100644 index 000000000..0e5179327 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/030-gpio_line_config.patch @@ -0,0 +1,73 @@ +--- a/arch/arm/mach-ixp4xx/common.c ++++ b/arch/arm/mach-ixp4xx/common.c +@@ -93,22 +93,7 @@ void __init ixp4xx_map_io(void) + /* + * GPIO-functions + */ +-/* +- * The following converted to the real HW bits the gpio_line_config +- */ +-/* GPIO pin types */ +-#define IXP4XX_GPIO_OUT 0x1 +-#define IXP4XX_GPIO_IN 0x2 +- +-/* GPIO signal types */ +-#define IXP4XX_GPIO_LOW 0 +-#define IXP4XX_GPIO_HIGH 1 +- +-/* GPIO Clocks */ +-#define IXP4XX_GPIO_CLK_0 14 +-#define IXP4XX_GPIO_CLK_1 15 +- +-static void gpio_line_config(u8 line, u32 direction) ++void gpio_line_config(u8 line, u32 direction) + { + if (direction == IXP4XX_GPIO_IN) + *IXP4XX_GPIO_GPOER |= (1 << line); +@@ -116,17 +101,17 @@ static void gpio_line_config(u8 line, u3 + *IXP4XX_GPIO_GPOER &= ~(1 << line); + } + +-static void gpio_line_get(u8 line, int *value) ++void gpio_line_get(u8 line, int *value) + { + *value = (*IXP4XX_GPIO_GPINR >> line) & 0x1; + } + +-static void gpio_line_set(u8 line, int value) ++void gpio_line_set(u8 line, int value) + { +- if (value == IXP4XX_GPIO_HIGH) +- *IXP4XX_GPIO_GPOUTR |= (1 << line); +- else if (value == IXP4XX_GPIO_LOW) ++ if (value == IXP4XX_GPIO_LOW) + *IXP4XX_GPIO_GPOUTR &= ~(1 << line); ++ else ++ *IXP4XX_GPIO_GPOUTR |= (1 << line); + } + + /************************************************************************* +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -131,5 +131,21 @@ struct pci_sys_data; + extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); + extern struct pci_ops ixp4xx_ops; + ++/* GPIO pin types */ ++#define IXP4XX_GPIO_OUT 0x1 ++#define IXP4XX_GPIO_IN 0x2 ++ ++/* GPIO signal types */ ++#define IXP4XX_GPIO_LOW 0 ++#define IXP4XX_GPIO_HIGH 1 ++ ++/* GPIO Clocks */ ++#define IXP4XX_GPIO_CLK_0 14 ++#define IXP4XX_GPIO_CLK_1 15 ++ ++void gpio_line_config(u8 line, u32 direction); ++void gpio_line_get(u8 line, int *value); ++void gpio_line_set(u8 line, int value); ++ + #endif // __ASSEMBLY__ + diff --git a/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch new file mode 100644 index 000000000..c6392ef2f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/040-arm_mach_types.patch @@ -0,0 +1,18 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -1006,3 +1006,15 @@ eco5_bx2 MACH_ECO5_BX2 ECO5_BX2 4572 + eukrea_cpuimx28sd MACH_EUKREA_CPUIMX28SD EUKREA_CPUIMX28SD 4573 + domotab MACH_DOMOTAB DOMOTAB 4574 + pfla03 MACH_PFLA03 PFLA03 4575 ++wg302v1 MACH_WG302V1 WG302V1 889 ++pronghorn MACH_PRONGHORN PRONGHORN 928 ++pronghorn_metro MACH_PRONGHORNMETRO PRONGHORNMETRO 1040 ++sidewinder MACH_SIDEWINDER SIDEWINDER 1041 ++wrt300nv2 MACH_WRT300NV2 WRT300NV2 1077 ++compex42x MACH_COMPEXWP18 COMPEXWP18 1273 ++cambria MACH_CAMBRIA CAMBRIA 1468 ++ap1000 MACH_AP1000 AP1000 1543 ++tw2662 MACH_TW2662 TW2662 1658 ++tw5334 MACH_TW5334 TW5334 1664 ++usr8200 MACH_USR8200 USR8200 1762 ++mi424wr MACH_MI424WR MI424WR 1778 diff --git a/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch new file mode 100644 index 000000000..2b4db053c --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/090-increase_entropy_pools.patch @@ -0,0 +1,17 @@ +--- a/drivers/char/random.c ++++ b/drivers/char/random.c +@@ -278,11 +278,11 @@ + /* + * Configuration information + */ +-#define INPUT_POOL_SHIFT 12 ++#define INPUT_POOL_SHIFT 13 + #define INPUT_POOL_WORDS (1 << (INPUT_POOL_SHIFT-5)) +-#define OUTPUT_POOL_SHIFT 10 ++#define OUTPUT_POOL_SHIFT 11 + #define OUTPUT_POOL_WORDS (1 << (OUTPUT_POOL_SHIFT-5)) +-#define SEC_XFER_SIZE 512 ++#define SEC_XFER_SIZE 1024 + #define EXTRACT_SIZE 10 + + #define DEBUG_RANDOM_BOOT 0 diff --git a/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch new file mode 100644 index 000000000..317103fda --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/100-wg302v2_gateway7001_mac_plat_info.patch @@ -0,0 +1,78 @@ +--- a/arch/arm/mach-ixp4xx/gateway7001-setup.c ++++ b/arch/arm/mach-ixp4xx/gateway7001-setup.c +@@ -17,6 +17,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -75,9 +76,37 @@ static struct platform_device gateway700 + .resource = &gateway7001_uart_resource, + }; + ++static struct eth_plat_info gateway7001_plat_eth[] = { ++ { ++ .phy = 1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 2, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device gateway7001_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = gateway7001_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = gateway7001_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *gateway7001_devices[] __initdata = { + &gateway7001_flash, +- &gateway7001_uart ++ &gateway7001_uart, ++ &gateway7001_eth[0], ++ &gateway7001_eth[1], + }; + + static void __init gateway7001_init(void) +--- a/arch/arm/mach-ixp4xx/wg302v2-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v2-setup.c +@@ -76,9 +76,26 @@ static struct platform_device wg302v2_ua + .resource = &wg302v2_uart_resource, + }; + ++static struct eth_plat_info wg302v2_plat_eth[] = { ++ { ++ .phy = 8, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v2_plat_eth, ++ } ++}; ++ + static struct platform_device *wg302v2_devices[] __initdata = { + &wg302v2_flash, + &wg302v2_uart, ++ &wg302v2_eth[0], + }; + + static void __init wg302v2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch new file mode 100644 index 000000000..8793549c6 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/105-wg302v1_support.patch @@ -0,0 +1,261 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -13,6 +13,7 @@ CONFIG_MACH_AVILA=y + CONFIG_MACH_LOFT=y + CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y ++CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -45,6 +45,14 @@ config MACH_GATEWAY7001 + 7001 Access Point. For more information on this platform, + see http://openwrt.org + ++config MACH_WG302V1 ++ bool "Netgear WG302 v1 / WAG302 v1" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Netgear's ++ WG302 v1 or WAG302 v1 Access Points. For more information ++ on this platform, see http://openwrt.org ++ + config MACH_WG302V2 + bool "Netgear WG302 v2 / WAG302 v2" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -15,6 +15,7 @@ obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-p + obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o + obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o + obj-pci-$(CONFIG_MACH_GATEWAY7001) += gateway7001-pci.o ++obj-pci-$(CONFIG_MACH_WG302V1) += wg302v1-pci.o + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o +@@ -33,6 +34,7 @@ obj-$(CONFIG_MACH_NSLU2) += nslu2-setup. + obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o + obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o + obj-$(CONFIG_MACH_GATEWAY7001) += gateway7001-setup.o ++obj-$(CONFIG_MACH_WG302V1) += wg302v1-setup.o + obj-$(CONFIG_MACH_WG302V2) += wg302v2-setup.o + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/wg302v1-pci.c ++ * ++ * PCI setup routines for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Software, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init wg302v1_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wg302v1_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else ++ return -1; ++} ++ ++struct hw_pci wg302v1_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wg302v1_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wg302v1_map_irq, ++}; ++ ++int __init wg302v1_pci_init(void) ++{ ++ if (machine_is_wg302v1()) ++ pci_common_init(&wg302v1_pci); ++ return 0; ++} ++ ++subsys_initcall(wg302v1_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -0,0 +1,147 @@ ++/* ++ * arch/arm/mach-ixp4xx/wg302v1-setup.c ++ * ++ * Board setup for the Netgear WG302 v1 and WAG302 v1 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wg302v1_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wg302v1_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wg302v1_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wg302v1_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wg302v1_flash_resource, ++}; ++ ++static struct resource wg302v1_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port wg302v1_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wg302v1_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wg302v1_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = wg302v1_uart_resources, ++}; ++ ++static struct eth_plat_info wg302v1_plat_eth[] = { ++ { ++ .phy = 30, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device wg302v1_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wg302v1_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *wg302v1_devices[] __initdata = { ++ &wg302v1_flash, ++ &wg302v1_uart, ++ &wg302v1_eth[0], ++}; ++ ++static void __init wg302v1_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wg302v1_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wg302v1_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wg302v1_devices, ARRAY_SIZE(wg302v1_devices)); ++} ++ ++#ifdef CONFIG_MACH_WG302V1 ++MACHINE_START(WG302V1, "Netgear WG302 v1 / WAG302 v1") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = wg302v1_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wg302v1_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch new file mode 100644 index 000000000..d1fdfcba4 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/110-pronghorn_series_support.patch @@ -0,0 +1,393 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -15,6 +15,8 @@ CONFIG_ARCH_ADI_COYOTE=y + CONFIG_MACH_GATEWAY7001=y + CONFIG_MACH_WG302V1=y + CONFIG_MACH_WG302V2=y ++CONFIG_MACH_PRONGHORN=y ++CONFIG_MACH_PRONGHORNMETRO=y + CONFIG_ARCH_IXDP425=y + CONFIG_MACH_IXDPG425=y + CONFIG_MACH_IXDP465=y +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -61,6 +61,22 @@ config MACH_WG302V2 + WG302 v2 or WAG302 v2 Access Points. For more information + on this platform, see http://openwrt.org + ++config MACH_PRONGHORN ++ bool "ADI Pronghorn series" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Pronghorn series. For more ++ information on this platform, see http://www.adiengineering.com ++ ++# ++# There're only minimal differences kernel-wise between the Pronghorn and ++# Pronghorn Metro boards - they use different chip selects to drive the ++# CF slot connected to the expansion bus, so we just enable them together. ++# ++config MACH_PRONGHORNMETRO ++ def_bool MACH_PRONGHORN ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -19,6 +19,7 @@ obj-pci-$(CONFIG_MACH_WG302V1) += wg302 + obj-pci-$(CONFIG_MACH_WG302V2) += wg302v2-pci.o + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o ++obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + + obj-y += common.o + +@@ -39,6 +40,7 @@ obj-$(CONFIG_MACH_WG302V2) += wg302v2-se + obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o ++obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -42,7 +42,8 @@ static __inline__ void __arch_decomp_set + */ + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || +- machine_is_devixp() || machine_is_miccpt() || machine_is_mic256()) ++ machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || ++ machine_is_pronghorn() || machine_is_pronghorn_metro()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-pci.c +@@ -0,0 +1,69 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghorn-pci.c ++ * ++ * PCI setup routines for ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init pronghorn_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init pronghorn_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO4; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 16) ++ return IRQ_IXP4XX_GPIO1; ++ else ++ return -1; ++} ++ ++struct hw_pci pronghorn_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = pronghorn_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = pronghorn_map_irq, ++}; ++ ++int __init pronghorn_pci_init(void) ++{ ++ if (machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ pci_common_init(&pronghorn_pci); ++ return 0; ++} ++ ++subsys_initcall(pronghorn_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -0,0 +1,252 @@ ++/* ++ * arch/arm/mach-ixp4xx/pronghorn-setup.c ++ * ++ * Board setup for the ADI Engineering Pronghorn series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data pronghorn_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource pronghorn_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device pronghorn_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &pronghorn_flash_resource, ++}; ++ ++static struct resource pronghorn_uart_resources [] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port pronghorn_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device pronghorn_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = pronghorn_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = pronghorn_uart_resources, ++}; ++ ++static struct i2c_gpio_platform_data pronghorn_i2c_gpio_data = { ++ .sda_pin = 9, ++ .scl_pin = 10, ++}; ++ ++static struct platform_device pronghorn_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &pronghorn_i2c_gpio_data, ++ }, ++}; ++ ++static struct gpio_led pronghorn_led_pin[] = { ++ { ++ .name = "pronghorn:green:status", ++ .gpio = 7, ++ } ++}; ++ ++static struct gpio_led_platform_data pronghorn_led_data = { ++ .num_leds = 1, ++ .leds = pronghorn_led_pin, ++}; ++ ++static struct platform_device pronghorn_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &pronghorn_led_data, ++}; ++ ++static struct resource pronghorn_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO0, ++ .end = IRQ_IXP4XX_GPIO0, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data pronghorn_pata_data = { ++ .cs0_bits = 0xbfff0043, ++ .cs1_bits = 0xbfff0043, ++}; ++ ++static struct platform_device pronghorn_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &pronghorn_pata_data, ++ .num_resources = ARRAY_SIZE(pronghorn_pata_resources), ++ .resource = pronghorn_pata_resources, ++}; ++ ++static struct eth_plat_info pronghorn_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device pronghorn_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = pronghorn_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = pronghorn_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *pronghorn_devices[] __initdata = { ++ &pronghorn_flash, ++ &pronghorn_uart, ++ &pronghorn_led, ++ &pronghorn_eth[0], ++ &pronghorn_eth[1], ++}; ++ ++static void __init pronghorn_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ pronghorn_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ pronghorn_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(pronghorn_devices, ARRAY_SIZE(pronghorn_devices)); ++ ++ if (machine_is_pronghorn()) { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ } else { ++ pronghorn_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(3); ++ pronghorn_pata_resources[0].end = IXP4XX_EXP_BUS_END(3); ++ ++ pronghorn_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(4); ++ pronghorn_pata_resources[1].end = IXP4XX_EXP_BUS_END(4); ++ ++ pronghorn_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ pronghorn_pata_data.cs1_cfg = IXP4XX_EXP_CS4; ++ ++ platform_device_register(&pronghorn_i2c_gpio); ++ } ++ ++ platform_device_register(&pronghorn_pata); ++} ++ ++MACHINE_START(PRONGHORN, "ADI Engineering Pronghorn") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ ++MACHINE_START(PRONGHORNMETRO, "ADI Engineering Pronghorn Metro") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = pronghorn_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch new file mode 100644 index 000000000..ed9f7a785 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/111-pronghorn_swap_uarts.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/pronghorn-setup.c ++++ b/arch/arm/mach-ixp4xx/pronghorn-setup.c +@@ -52,31 +52,31 @@ static struct platform_device pronghorn_ + + static struct resource pronghorn_uart_resources [] = { + { +- .start = IXP4XX_UART1_BASE_PHYS, +- .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + }, + { +- .start = IXP4XX_UART2_BASE_PHYS, +- .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, + .flags = IORESOURCE_MEM + } + }; + + static struct plat_serial8250_port pronghorn_uart_data[] = { + { +- .mapbase = IXP4XX_UART1_BASE_PHYS, +- .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART1, ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, + .uartclk = IXP4XX_UART_XTAL, + }, + { +- .mapbase = IXP4XX_UART2_BASE_PHYS, +- .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, +- .irq = IRQ_IXP4XX_UART2, ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, + .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, + .iotype = UPIO_MEM, + .regshift = 2, diff --git a/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch new file mode 100644 index 000000000..20adbb5c0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/115-sidewinder_support.patch @@ -0,0 +1,286 @@ +From 95dac4a842a3c66f69f949b48f9075e16275f77b Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:48:47 +0200 +Subject: [PATCH 07/36] 115-sidewinder_support.patch + +--- + arch/arm/mach-ixp4xx/Kconfig | 10 +- + arch/arm/mach-ixp4xx/Makefile | 2 + + arch/arm/mach-ixp4xx/sidewinder-pci.c | 68 ++++++++++++++ + arch/arm/mach-ixp4xx/sidewinder-setup.c | 151 +++++++++++++++++++++++++++++++ + 4 files changed, 230 insertions(+), 1 deletion(-) + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-pci.c + create mode 100644 arch/arm/mach-ixp4xx/sidewinder-setup.c + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -77,6 +77,14 @@ config MACH_PRONGHORN + config MACH_PRONGHORNMETRO + def_bool MACH_PRONGHORN + ++config MACH_SIDEWINDER ++ bool "ADI Sidewinder" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the ADI ++ Engineering Sidewinder board. For more information on this ++ platform, see http://www.adiengineering.com ++ + config ARCH_IXDP425 + bool "IXDP425" + help +@@ -173,7 +181,7 @@ config MACH_ARCOM_VULCAN + # + config CPU_IXP46X + bool +- depends on MACH_IXDP465 ++ depends on MACH_IXDP465 || MACH_SIDEWINDER + default y + + config CPU_IXP43X +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -20,6 +20,7 @@ obj-pci-$(CONFIG_MACH_WG302V2) += wg302 + obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o ++obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + + obj-y += common.o + +@@ -41,6 +42,7 @@ obj-$(CONFIG_MACH_FSG) += fsg-setup.o + obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_mlr.o + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o ++obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arch/mach-ixp4xx/pronghornmetro-pci.c ++ * ++ * PCI setup routines for ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++void __init sidewinder_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init sidewinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++} ++ ++struct hw_pci sidewinder_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = sidewinder_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = sidewinder_map_irq, ++}; ++ ++int __init sidewinder_pci_init(void) ++{ ++ if (machine_is_sidewinder()) ++ pci_common_init(&sidewinder_pci); ++ return 0; ++} ++ ++subsys_initcall(sidewinder_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/sidewinder-setup.c +@@ -0,0 +1,155 @@ ++/* ++ * arch/arm/mach-ixp4xx/sidewinder-setup.c ++ * ++ * Board setup for the ADI Engineering Sidewinder ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data sidewinder_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource sidewinder_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device sidewinder_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &sidewinder_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &sidewinder_flash_resource, ++}; ++ ++static struct resource sidewinder_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++static struct plat_serial8250_port sidewinder_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device sidewinder_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = sidewinder_uart_data, ++ }, ++ .num_resources = ARRAY_SIZE(sidewinder_uart_resources), ++ .resource = sidewinder_uart_resources, ++}; ++ ++static struct eth_plat_info sidewinder_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { ++ .phy = 31, ++ .rxq = 2, ++ .txreadyq = 19, ++ } ++}; ++ ++static struct platform_device sidewinder_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = sidewinder_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = sidewinder_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = sidewinder_plat_eth + 2, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *sidewinder_devices[] __initdata = { ++ &sidewinder_flash, ++ &sidewinder_uart, ++ &sidewinder_eth[0], ++ &sidewinder_eth[1], ++ &sidewinder_eth[2], ++}; ++ ++static void __init sidewinder_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ sidewinder_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ sidewinder_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_64M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(sidewinder_devices, ARRAY_SIZE(sidewinder_devices)); ++} ++ ++MACHINE_START(SIDEWINDER, "ADI Engineering Sidewinder") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = sidewinder_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch new file mode 100644 index 000000000..7d633f713 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/116-sidewinder_fis_location.patch @@ -0,0 +1,30 @@ +--- a/drivers/mtd/redboot.c ++++ b/drivers/mtd/redboot.c +@@ -30,6 +30,8 @@ + #include + #include + ++#include ++ + struct fis_image_desc { + unsigned char name[16]; // Null terminated name + uint32_t flash_base; // Address within FLASH of image +@@ -47,7 +49,8 @@ struct fis_list { + struct fis_list *next; + }; + +-static int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++int directory = CONFIG_MTD_REDBOOT_DIRECTORY_BLOCK; ++ + module_param(directory, int, 0); + + static inline int redboot_checksum(struct fis_image_desc *img) +@@ -75,6 +78,8 @@ static int parse_redboot_partitions(stru + #ifdef CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED + static char nullstring[] = "unallocated"; + #endif ++ if (machine_is_sidewinder()) ++ directory = -5; + + if ( directory < 0 ) { + offset = master->size + directory * master->erasesize; diff --git a/target/linux/ixp4xx/patches-4.9/120-compex_support.patch b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch new file mode 100644 index 000000000..2abc159f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/120-compex_support.patch @@ -0,0 +1,199 @@ +From 24025a2dcf1248079dd3019fac6ed955252d277f Mon Sep 17 00:00:00 2001 +From: Imre Kaloz +Date: Mon, 14 Jul 2008 21:56:34 +0200 +Subject: [PATCH] Add support for the Compex WP18 / NP18A boards + +Signed-off-by: Imre Kaloz +--- + +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -85,6 +85,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_COMPEXWP18 ++ bool "Compex WP18 / NP18A" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Compex' ++ WP18 or NP18A boards. For more information on this ++ platform, see http://www.compex.com.sg/home/OEM/product_ap.htm ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -21,6 +21,7 @@ obj-pci-$(CONFIG_MACH_FSG) += fsg-pci.o + obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-pci.o + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o ++obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + + obj-y += common.o + +@@ -43,6 +44,7 @@ obj-$(CONFIG_MACH_GORAMO_MLR) += goramo_ + obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulcan-setup.o + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o ++obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/compex42x-setup.c +@@ -0,0 +1,141 @@ ++/* ++ * arch/arm/mach-ixp4xx/compex-setup.c ++ * ++ * Compex WP18 / NP18A board-setup ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++static struct flash_platform_data compex42x_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource compex42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device compex42x_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &compex42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &compex42x_flash_resource, ++}; ++ ++static struct resource compex42x_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port compex42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device compex42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = compex42x_uart_data, ++ .num_resources = 2, ++ .resource = compex42x_uart_resources, ++}; ++ ++static struct eth_plat_info compex42x_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0xf0000, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 3, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device compex42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = compex42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = compex42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *compex42x_devices[] __initdata = { ++ &compex42x_flash, ++ &compex42x_uart, ++ &compex42x_eth[0], ++ &compex42x_eth[1], ++}; ++ ++static void __init compex42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ compex42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ compex42x_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ platform_add_devices(compex42x_devices, ARRAY_SIZE(compex42x_devices)); ++} ++ ++MACHINE_START(COMPEXWP18, "Compex WP18 / NP18A") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = compex42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -69,7 +69,8 @@ struct hw_pci ixdp425_pci __initdata = { + int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || +- machine_is_ixdp465() || machine_is_kixrp435()) ++ machine_is_ixdp465() || machine_is_kixrp435() || ++ machine_is_compex42x()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch new file mode 100644 index 000000000..49359be44 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/130-wrt300nv2_support.patch @@ -0,0 +1,227 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_COMPEXWP18 + WP18 or NP18A boards. For more information on this + platform, see http://www.compex.com.sg/home/OEM/product_ap.htm + ++config MACH_WRT300NV2 ++ bool "Linksys WRT300N v2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Linksys' ++ WRT300N v2 router. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -22,6 +22,7 @@ obj-pci-$(CONFIG_MACH_ARCOM_VULCAN) += v + obj-pci-$(CONFIG_MACH_PRONGHORN) += pronghorn-pci.o + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + + obj-y += common.o + +@@ -45,6 +46,7 @@ obj-$(CONFIG_MACH_ARCOM_VULCAN) += vulca + obj-$(CONFIG_MACH_PRONGHORN) += pronghorn-setup.o + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o ++obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -43,7 +43,8 @@ static __inline__ void __arch_decomp_set + if (machine_is_adi_coyote() || machine_is_gtwx5715() || + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || +- machine_is_pronghorn() || machine_is_pronghorn_metro()) ++ machine_is_pronghorn() || machine_is_pronghorn_metro() || ++ machine_is_wrt300nv2()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-pci.c +@@ -0,0 +1,64 @@ ++/* ++ * arch/arch/mach-ixp4xx/wrt300nv2-pci.c ++ * ++ * PCI setup routines for Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init wrt300nv2_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init wrt300nv2_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO8; ++ else return -1; ++} ++ ++struct hw_pci wrt300nv2_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = wrt300nv2_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = wrt300nv2_map_irq, ++}; ++ ++int __init wrt300nv2_pci_init(void) ++{ ++ if (machine_is_wrt300nv2()) ++ pci_common_init(&wrt300nv2_pci); ++ return 0; ++} ++ ++subsys_initcall(wrt300nv2_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -0,0 +1,110 @@ ++/* ++ * arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++ * ++ * Board setup for the Linksys WRT300N v2 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data wrt300nv2_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource wrt300nv2_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device wrt300nv2_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &wrt300nv2_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_flash_resource, ++}; ++ ++static struct resource wrt300nv2_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port wrt300nv2_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device wrt300nv2_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = wrt300nv2_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &wrt300nv2_uart_resource, ++}; ++ ++static struct platform_device *wrt300nv2_devices[] __initdata = { ++ &wrt300nv2_flash, ++ &wrt300nv2_uart ++}; ++ ++static void __init wrt300nv2_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ wrt300nv2_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++} ++ ++#ifdef CONFIG_MACH_WRT300NV2 ++MACHINE_START(WRT300NV2, "Linksys WRT300N v2") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = wrt300nv2_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch new file mode 100644 index 000000000..5debbf107 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/131-wrt300nv2_mac_plat_info.patch @@ -0,0 +1,42 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -76,9 +76,38 @@ static struct platform_device wrt300nv2_ + .resource = &wrt300nv2_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info wrt300nv2_plat_eth[] = { ++ { ++ .phy = -1, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device wrt300nv2_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = wrt300nv2_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = wrt300nv2_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *wrt300nv2_devices[] __initdata = { + &wrt300nv2_flash, +- &wrt300nv2_uart ++ &wrt300nv2_uart, ++ &wrt300nv2_eth[0], ++ &wrt300nv2_eth[1], + }; + + static void __init wrt300nv2_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch new file mode 100644 index 000000000..99db2673d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/132-wrt300nv2_mac_fix.patch @@ -0,0 +1,72 @@ +--- a/arch/arm/mach-ixp4xx/wrt300nv2-setup.c ++++ b/arch/arm/mach-ixp4xx/wrt300nv2-setup.c +@@ -3,6 +3,7 @@ + * + * Board setup for the Linksys WRT300N v2 + * ++ * Copyright (C) 2010 Alexandros C. Couloumbis + * Copyright (C) 2007 Imre Kaloz + * + * based on coyote-setup.c: +@@ -18,6 +19,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -79,7 +81,8 @@ static struct platform_device wrt300nv2_ + /* Built-in 10/100 Ethernet MAC interfaces */ + static struct eth_plat_info wrt300nv2_plat_eth[] = { + { +- .phy = -1, ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, + .rxq = 3, + .txreadyq = 20, + }, { +@@ -112,6 +115,10 @@ static struct platform_device *wrt300nv2 + + static void __init wrt300nv2_init(void) + { ++ uint8_t __iomem *f; ++ int offset = 0; ++ int i; ++ + ixp4xx_sys_init(); + + wrt300nv2_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +@@ -121,6 +128,32 @@ static void __init wrt300nv2_init(void) + *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; + + platform_add_devices(wrt300nv2_devices, ARRAY_SIZE(wrt300nv2_devices)); ++ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x60000); ++ ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + i); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#else ++ wrt300nv2_plat_eth[0].hwaddr[i] = readb(f + 0x5FFA0 + (i^3)); ++ if (i == 5) ++ offset = 1; ++ wrt300nv2_plat_eth[1].hwaddr[i] = (wrt300nv2_plat_eth[0].hwaddr[i] + offset); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[0].hwaddr))) ++ random_ether_addr(wrt300nv2_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(wrt300nv2_plat_eth[1].hwaddr))) { ++ memcpy(wrt300nv2_plat_eth[1].hwaddr, wrt300nv2_plat_eth[0].hwaddr, ETH_ALEN); ++ wrt300nv2_plat_eth[1].hwaddr[5] = (wrt300nv2_plat_eth[0].hwaddr[5] + 1); ++ } + } + + #ifdef CONFIG_MACH_WRT300NV2 diff --git a/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch new file mode 100644 index 000000000..fb5c3adb7 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/150-lanready_ap1000_support.patch @@ -0,0 +1,201 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -101,6 +101,14 @@ config MACH_WRT300NV2 + WRT300N v2 router. For more information on this + platform, see http://openwrt.org + ++config MACH_AP1000 ++ bool "Lanready AP-1000" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Lanready's ++ AP1000 board. For more information on this ++ platform, see http://openwrt.org ++ + config ARCH_IXDP425 + bool "IXDP425" + help +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -23,6 +23,7 @@ obj-pci-$(CONFIG_MACH_PRONGHORN) += pron + obj-pci-$(CONFIG_MACH_SIDEWINDER) += sidewinder-pci.o + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o ++obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + + obj-y += common.o + +@@ -47,6 +48,7 @@ obj-$(CONFIG_MACH_PRONGHORN) += pronghor + obj-$(CONFIG_MACH_SIDEWINDER) += sidewinder-setup.o + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o ++obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -0,0 +1,152 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap1000-setup.c ++ * ++ * Lanready AP-1000 ++ * ++ * Copyright (C) 2007 Imre Kaloz ++ * ++ * based on ixdp425-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data ap1000_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource ap1000_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device ap1000_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap1000_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap1000_flash_resource, ++}; ++ ++static struct resource ap1000_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port ap1000_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap1000_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = ap1000_uart_data, ++ .num_resources = 2, ++ .resource = ap1000_uart_resources ++}; ++ ++static struct platform_device *ap1000_devices[] __initdata = { ++ &ap1000_flash, ++ &ap1000_uart ++}; ++ ++static char ap1000_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init ap1000_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(ap1000_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, ap1000_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(ap1000_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(ap1000_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init ap1000_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap1000_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap1000_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(ap1000_devices, ARRAY_SIZE(ap1000_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP1000 ++MACHINE_START(AP1000, "Lanready AP-1000") ++ /* Maintainer: Imre Kaloz */ ++ .fixup = ap1000_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = ap1000_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -70,7 +70,7 @@ int __init ixdp425_pci_init(void) + { + if (machine_is_ixdp425() || machine_is_ixcdp1100() || + machine_is_ixdp465() || machine_is_kixrp435() || +- machine_is_compex42x()) ++ machine_is_compex42x() || machine_is_ap1000()) + pci_common_init(&ixdp425_pci); + return 0; + } diff --git a/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch new file mode 100644 index 000000000..a3ed2d066 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/151-lanready_ap1000_mac_plat_info.patch @@ -0,0 +1,44 @@ +--- a/arch/arm/mach-ixp4xx/ap1000-setup.c ++++ b/arch/arm/mach-ixp4xx/ap1000-setup.c +@@ -91,9 +91,39 @@ static struct platform_device ap1000_uar + .resource = ap1000_uart_resources + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ap1000_plat_eth[] = { ++ { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap1000_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap1000_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap1000_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ + static struct platform_device *ap1000_devices[] __initdata = { +- &ap1000_flash, +- &ap1000_uart ++ &ap1000_flash, ++ &ap1000_uart, ++ &ap1000_eth[0], ++ &ap1000_eth[1], + }; + + static char ap1000_mem_fixup[] __initdata = "mem=64M "; diff --git a/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch new file mode 100644 index 000000000..1ac9e5f9f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/160-delayed_uart_io.patch @@ -0,0 +1,133 @@ +--- a/drivers/tty/serial/8250/8250_core.c ++++ b/drivers/tty/serial/8250/8250_core.c +@@ -833,6 +833,7 @@ static int serial8250_probe(struct platf + uart.port.get_mctrl = p->get_mctrl; + uart.port.pm = p->pm; + uart.port.dev = &dev->dev; ++ uart.port.rw_delay = p->rw_delay; + uart.port.irqflags |= irqflag; + ret = serial8250_register_8250_port(&uart); + if (ret < 0) { +@@ -989,6 +990,7 @@ int serial8250_register_8250_port(struct + uart->bugs = up->bugs; + uart->port.mapbase = up->port.mapbase; + uart->port.mapsize = up->port.mapsize; ++ uart->port.rw_delay = up->port.rw_delay; + uart->port.private_data = up->port.private_data; + uart->tx_loadsz = up->tx_loadsz; + uart->capabilities = up->capabilities; +--- a/drivers/tty/serial/serial_core.c ++++ b/drivers/tty/serial/serial_core.c +@@ -2229,6 +2229,7 @@ uart_report_port(struct uart_driver *drv + snprintf(address, sizeof(address), + "I/O 0x%lx offset 0x%x", port->iobase, port->hub6); + break; ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +@@ -2893,6 +2894,7 @@ int uart_match_port(struct uart_port *po + case UPIO_HUB6: + return (port1->iobase == port2->iobase) && + (port1->hub6 == port2->hub6); ++ case UPIO_MEM_DELAY: + case UPIO_MEM: + case UPIO_MEM16: + case UPIO_MEM32: +--- a/include/linux/serial_8250.h ++++ b/include/linux/serial_8250.h +@@ -28,6 +28,7 @@ struct plat_serial8250_port { + void *private_data; + unsigned char regshift; /* register shift */ + unsigned char iotype; /* UPIO_* */ ++ unsigned int rw_delay; /* udelay for slower busses IXP4XX Expansion Bus */ + unsigned char hub6; + upf_t flags; /* UPF_* flags */ + unsigned int type; /* If UPF_FIXED_TYPE */ +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -152,6 +152,7 @@ struct uart_port { + #define UPIO_TSI (SERIAL_IO_TSI) /* Tsi108/109 type IO */ + #define UPIO_MEM32BE (SERIAL_IO_MEM32BE) /* 32b big endian */ + #define UPIO_MEM16 (SERIAL_IO_MEM16) /* 16b little endian */ ++#define UPIO_MEM_DELAY (SERIAL_IO_MEM_DELAY) + + unsigned int read_status_mask; /* driver specific */ + unsigned int ignore_status_mask; /* driver specific */ +@@ -233,6 +234,7 @@ struct uart_port { + int hw_stopped; /* sw-assisted CTS flow state */ + unsigned int mctrl; /* current modem ctrl settings */ + unsigned int timeout; /* character-based timeout */ ++ unsigned int rw_delay; /* udelay for slow busses, IXP4XX Expansion Bus */ + unsigned int type; /* port type */ + const struct uart_ops *ops; + unsigned int custom_divisor; +--- a/drivers/tty/serial/8250/8250_port.c ++++ b/drivers/tty/serial/8250/8250_port.c +@@ -384,6 +384,20 @@ static unsigned int mem16_serial_in(stru + return readw(p->membase + offset); + } + ++static unsigned int memdelay_serial_in(struct uart_port *p, int offset) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ return mem_serial_in(p, offset); ++} ++ ++static void memdelay_serial_out(struct uart_port *p, int offset, int value) ++{ ++ struct uart_8250_port *up = (struct uart_8250_port *)p; ++ udelay(up->port.rw_delay); ++ mem_serial_out(p, offset, value); ++} ++ + static void mem32_serial_out(struct uart_port *p, int offset, int value) + { + offset = offset << p->regshift; +@@ -456,6 +470,11 @@ static void set_io_from_upio(struct uart + p->serial_out = mem32be_serial_out; + break; + ++ case UPIO_MEM_DELAY: ++ p->serial_in = memdelay_serial_in; ++ p->serial_out = memdelay_serial_out; ++ break; ++ + #ifdef CONFIG_SERIAL_8250_RT288X + case UPIO_AU: + p->serial_in = au_serial_in; +@@ -483,6 +502,7 @@ serial_port_out_sync(struct uart_port *p + case UPIO_MEM16: + case UPIO_MEM32: + case UPIO_MEM32BE: ++ case UPIO_MEM_DELAY: + case UPIO_AU: + p->serial_out(p, offset, value); + p->serial_in(p, UART_LCR); /* safe, no side-effects */ +@@ -2759,6 +2779,7 @@ static int serial8250_request_std_resour + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +@@ -2797,6 +2818,7 @@ static void serial8250_release_std_resou + case UPIO_MEM32BE: + case UPIO_MEM16: + case UPIO_MEM: ++ case UPIO_MEM_DELAY: + if (!port->mapbase) + break; + +--- a/include/uapi/linux/serial.h ++++ b/include/uapi/linux/serial.h +@@ -70,6 +70,7 @@ struct serial_struct { + #define SERIAL_IO_TSI 5 + #define SERIAL_IO_MEM32BE 6 + #define SERIAL_IO_MEM16 7 ++#define SERIAL_IO_MEM_DELAY 10 + + #define UART_CLEAR_FIFO 0x01 + #define UART_USE_FIFO 0x02 diff --git a/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch new file mode 100644 index 000000000..efa389d78 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/162-wg302v1_mem_fixup.patch @@ -0,0 +1,37 @@ +--- a/arch/arm/mach-ixp4xx/wg302v1-setup.c ++++ b/arch/arm/mach-ixp4xx/wg302v1-setup.c +@@ -117,6 +117,34 @@ static struct platform_device *wg302v1_d + &wg302v1_eth[0], + }; + ++static char wg302v1_mem_fixup[] __initdata = " mem=32M"; ++ ++static void __init wg302v1_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ size_t fixlen, cmdlen; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ fixlen = strlen(wg302v1_mem_fixup); ++ cmdlen = strlen(p); ++ if (fixlen + cmdlen >= COMMAND_LINE_SIZE) ++ return; ++ ++ /* append the fixup to the cmdline */ ++ memmove(p + cmdlen, wg302v1_mem_fixup, fixlen + 1); ++ ++ /* Adjust the size of the atag if there was one */ ++ if (t->hdr.size) ++ t->hdr.size += fixlen; ++} ++ + static void __init wg302v1_init(void) + { + ixp4xx_sys_init(); diff --git a/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch new file mode 100644 index 000000000..f7090cd1b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/170-ixdpg425_mac_plat_info.patch @@ -0,0 +1,51 @@ +--- a/arch/arm/mach-ixp4xx/coyote-setup.c ++++ b/arch/arm/mach-ixp4xx/coyote-setup.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -81,9 +82,39 @@ static struct platform_device coyote_uar + .resource = &coyote_uart_resource, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info ixdpg425_plat_eth[] = { ++ { ++ .phy = 5, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 4, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ixdpg425_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ixdpg425_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ixdpg425_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ + static struct platform_device *coyote_devices[] __initdata = { + &coyote_flash, +- &coyote_uart ++ &coyote_uart, ++ &ixdpg425_eth[0], ++ &ixdpg425_eth[1], + }; + + static void __init coyote_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch new file mode 100644 index 000000000..398344d18 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/175-avila_hss_audio_support.patch @@ -0,0 +1,2093 @@ +--- a/sound/soc/Kconfig ++++ b/sound/soc/Kconfig +@@ -47,6 +47,7 @@ source "sound/soc/cirrus/Kconfig" + source "sound/soc/davinci/Kconfig" + source "sound/soc/dwc/Kconfig" + source "sound/soc/fsl/Kconfig" ++source "sound/soc/gw-avila/Kconfig" + source "sound/soc/jz4740/Kconfig" + source "sound/soc/nuc900/Kconfig" + source "sound/soc/omap/Kconfig" +--- a/sound/soc/Makefile ++++ b/sound/soc/Makefile +@@ -27,6 +27,7 @@ obj-$(CONFIG_SND_SOC) += cirrus/ + obj-$(CONFIG_SND_SOC) += davinci/ + obj-$(CONFIG_SND_SOC) += dwc/ + obj-$(CONFIG_SND_SOC) += fsl/ ++obj-$(CONFIG_SND_SOC) += gw-avila/ + obj-$(CONFIG_SND_SOC) += jz4740/ + obj-$(CONFIG_SND_SOC) += img/ + obj-$(CONFIG_SND_SOC) += intel/ +--- /dev/null ++++ b/sound/soc/gw-avila/Kconfig +@@ -0,0 +1,17 @@ ++config SND_GW_AVILA_SOC_PCM ++ tristate ++ ++config SND_GW_AVILA_SOC_HSS ++ tristate ++ ++config SND_GW_AVILA_SOC ++ tristate "SoC Audio for the Gateworks AVILA Family" ++ depends on ARCH_IXP4XX && SND_SOC ++ select SND_GW_AVILA_SOC_PCM ++ select SND_GW_AVILA_SOC_HSS ++ select SND_SOC_TLV320AIC3X ++ help ++ Say Y or M if you want to add support for codecs attached to ++ the Gateworks HSS interface. You will also need ++ to select the audio interfaces to support below. ++ +--- /dev/null ++++ b/sound/soc/gw-avila/Makefile +@@ -0,0 +1,8 @@ ++# Gateworks Avila HSS Platform Support ++snd-soc-gw-avila-objs := gw-avila.o ixp4xx_hss.o ++snd-soc-gw-avila-pcm-objs := gw-avila-pcm.o ++snd-soc-gw-avila-hss-objs := gw-avila-hss.o ++ ++obj-$(CONFIG_SND_GW_AVILA_SOC) += snd-soc-gw-avila.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_PCM) += snd-soc-gw-avila-pcm.o ++obj-$(CONFIG_SND_GW_AVILA_SOC_HSS) += snd-soc-gw-avila-hss.o +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.c +@@ -0,0 +1,103 @@ ++/* ++ * gw-avila-hss.c -- HSS Audio Support for Gateworks Avila ++ * ++ * Author: Chris Lang ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++ ++#define gw_avila_hss_suspend NULL ++#define gw_avila_hss_resume NULL ++ ++struct snd_soc_dai_driver gw_avila_hss_dai = { ++ .playback = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++ .capture = { ++ .channels_min = 2, ++ .channels_max = 2, ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .formats = SNDRV_PCM_FMTBIT_S16_LE, }, ++}; ++ ++static const struct snd_soc_component_driver gw_avila_hss_component = { ++ .name = "gw_avila_hss", ++}; ++ ++static int gw_avila_hss_probe(struct platform_device *pdev) ++{ ++ int port = (pdev->id < 2) ? 0 : 1; ++ int channel = (pdev->id % 2); ++ ++ hss_handle[pdev->id] = hss_init(port, channel); ++ if (!hss_handle[pdev->id]) { ++ return -ENODEV; ++ } ++ ++ return snd_soc_register_component(&pdev->dev, &gw_avila_hss_component, ++ &gw_avila_hss_dai, 1); ++} ++ ++static int gw_avila_hss_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_component(&pdev->dev); ++ ++ return 0; ++} ++ ++static struct platform_driver gw_avila_hss_driver = { ++ .probe = gw_avila_hss_probe, ++ .remove = gw_avila_hss_remove, ++ .driver = { ++ .name = "gw_avila_hss", ++ .owner = THIS_MODULE, ++ } ++}; ++ ++static int __init gw_avila_hss_init(void) ++{ ++ return platform_driver_register(&gw_avila_hss_driver); ++} ++module_init(gw_avila_hss_init); ++ ++static void __exit gw_avila_hss_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_hss_driver); ++} ++module_exit(gw_avila_hss_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("HSS Audio Driver for Gateworks Avila"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-hss.h +@@ -0,0 +1,12 @@ ++/* ++ * Author: Chris Lang ++ * ++ * 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. ++ */ ++ ++#ifndef _GW_AVILA_HSS_H ++#define _GW_AVILA_HSS_H ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.c +@@ -0,0 +1,327 @@ ++/* ++ * ALSA PCM interface for the TI DAVINCI processor ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * 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 ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "gw-avila-pcm.h" ++#include "gw-avila-hss.h" ++#include "ixp4xx_hss.h" ++ ++#define GW_AVILA_PCM_DEBUG 0 ++#if GW_AVILA_PCM_DEBUG ++#define DPRINTK(x...) printk(KERN_DEBUG x) ++#else ++#define DPRINTK(x...) ++#endif ++ ++static struct snd_pcm_hardware gw_avila_pcm_hardware = { ++ .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER | ++ SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID), ++/* SNDRV_PCM_INFO_PAUSE),*/ ++ .formats = (SNDRV_PCM_FMTBIT_S16_LE), ++ .rates = (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000 | ++ SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | ++ SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | ++ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 | ++ SNDRV_PCM_RATE_KNOT), ++ .rate_min = 8000, ++ .rate_max = 8000, ++ .channels_min = 2, ++ .channels_max = 2, ++ .buffer_bytes_max = 64 * 1024, // All of the lines below may need to be changed ++ .period_bytes_min = 128, ++ .period_bytes_max = 4 * 1024, ++ .periods_min = 16, ++ .periods_max = 32, ++ .fifo_size = 0, ++}; ++ ++struct gw_avila_runtime_data { ++ spinlock_t lock; ++ int period; /* current DMA period */ ++ int master_lch; /* Master DMA channel */ ++ int slave_lch; /* Slave DMA channel */ ++ struct gw_avila_pcm_dma_params *params; /* DMA params */ ++}; ++ ++static void gw_avila_dma_irq(void *data) ++{ ++ struct snd_pcm_substream *substream = data; ++ snd_pcm_period_elapsed(substream); ++} ++ ++static int gw_avila_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ int ret = 0; ++ ++ switch (cmd) { ++ case SNDRV_PCM_TRIGGER_START: ++ case SNDRV_PCM_TRIGGER_RESUME: ++ case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_start(hdev); ++ else ++ hss_rx_start(hdev); ++ break; ++ case SNDRV_PCM_TRIGGER_STOP: ++ case SNDRV_PCM_TRIGGER_SUSPEND: ++ case SNDRV_PCM_TRIGGER_PAUSE_PUSH: ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ hss_tx_stop(hdev); ++ else ++ hss_rx_stop(hdev); ++ break; ++ default: ++ ret = -EINVAL; ++ break; ++ } ++ return ret; ++} ++ ++static int gw_avila_pcm_prepare(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ hss_set_tx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_tx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } else { ++ hss_set_rx_callback(hdev, gw_avila_dma_irq, substream); ++ hss_config_rx_dma(hdev, runtime->dma_area, runtime->buffer_size, runtime->period_size); ++ } ++ ++ return 0; ++} ++ ++static snd_pcm_uframes_t ++gw_avila_pcm_pointer(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ unsigned int curr = 0; ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ curr = hss_curr_offset_tx(hdev); ++ else ++ curr = hss_curr_offset_rx(hdev); ++ return curr; ++} ++ ++static int gw_avila_pcm_open(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ snd_soc_set_runtime_hwparams(substream, &gw_avila_pcm_hardware); ++ ++ if (hss_handle[cpu_dai->id] != NULL) ++ runtime->private_data = hss_handle[cpu_dai->id]; ++ else { ++ pr_err("hss_handle is NULL\n"); ++ return -1; ++ } ++ ++ hss_chan_open(hss_handle[cpu_dai->id]); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_close(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ struct hss_device *hdev = runtime->private_data; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { ++ memset(hdev->tx_buf, 0, runtime->buffer_size); ++ } else ++ memset(hdev->rx_buf, 0, runtime->buffer_size); ++ ++ hss_chan_close(hdev); ++ ++ return 0; ++} ++ ++static int gw_avila_pcm_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *hw_params) ++{ ++ return snd_pcm_lib_malloc_pages(substream, ++ params_buffer_bytes(hw_params)); ++} ++ ++static int gw_avila_pcm_hw_free(struct snd_pcm_substream *substream) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) ++ memset(runtime->dma_area, 0, runtime->buffer_size); ++ ++ return snd_pcm_lib_free_pages(substream); ++} ++ ++static int gw_avila_pcm_mmap(struct snd_pcm_substream *substream, ++ struct vm_area_struct *vma) ++{ ++ struct snd_pcm_runtime *runtime = substream->runtime; ++ ++ return dma_mmap_writecombine(substream->pcm->card->dev, vma, ++ runtime->dma_area, ++ runtime->dma_addr, ++ runtime->dma_bytes); ++} ++ ++struct snd_pcm_ops gw_avila_pcm_ops = { ++ .open = gw_avila_pcm_open, ++ .close = gw_avila_pcm_close, ++ .ioctl = snd_pcm_lib_ioctl, ++ .hw_params = gw_avila_pcm_hw_params, ++ .hw_free = gw_avila_pcm_hw_free, ++ .prepare = gw_avila_pcm_prepare, ++ .trigger = gw_avila_pcm_trigger, ++ .pointer = gw_avila_pcm_pointer, ++ .mmap = gw_avila_pcm_mmap, ++}; ++ ++static int gw_avila_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream) ++{ ++ struct snd_pcm_substream *substream = pcm->streams[stream].substream; ++ struct snd_dma_buffer *buf = &substream->dma_buffer; ++ size_t size = gw_avila_pcm_hardware.buffer_bytes_max; ++ ++ buf->dev.type = SNDRV_DMA_TYPE_DEV; ++ buf->dev.dev = pcm->card->dev; ++ buf->private_data = NULL; ++ ++ buf->area = dma_alloc_coherent(pcm->card->dev, size, ++ &buf->addr, GFP_KERNEL); ++ ++ if (!buf->area) { ++ return -ENOMEM; ++ } ++ ++ memset(buf->area, 0xff, size); ++ ++ DPRINTK("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n", ++ (void *) buf->area, (void *) buf->addr, size); ++ ++ buf->bytes = size; ++ ++ return 0; ++} ++ ++static void gw_avila_pcm_free(struct snd_pcm *pcm) ++{ ++ struct snd_pcm_substream *substream; ++ struct snd_dma_buffer *buf; ++ int stream; ++ ++ for (stream = 0; stream < 2; stream++) { ++ substream = pcm->streams[stream].substream; ++ if (!substream) ++ continue; ++ ++ buf = &substream->dma_buffer; ++ if (!buf->area) ++ continue; ++ ++ dma_free_coherent(NULL, buf->bytes, buf->area, 0); ++ buf->area = NULL; ++ } ++} ++ ++static u64 gw_avila_pcm_dmamask = 0xFFFFFFFF; ++ ++static int gw_avila_pcm_new(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_card *card = rtd->card->snd_card; ++ struct snd_pcm *pcm = rtd->pcm; ++ struct snd_soc_dai *dai = rtd->codec_dai; ++ int ret; ++ ++ if (!card->dev->dma_mask) ++ card->dev->dma_mask = &gw_avila_pcm_dmamask; ++ if (!card->dev->coherent_dma_mask) ++ card->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ if (dai->driver->playback.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_PLAYBACK); ++ if (ret) ++ return ret; ++ } ++ ++ if (dai->driver->capture.channels_min) { ++ ret = gw_avila_pcm_preallocate_dma_buffer(pcm, ++ SNDRV_PCM_STREAM_CAPTURE); ++ if (ret) ++ return ret; ++ } ++ ++ return 0; ++} ++ ++struct snd_soc_platform_driver gw_avila_soc_platform = { ++ .ops = &gw_avila_pcm_ops, ++ .pcm_new = gw_avila_pcm_new, ++ .pcm_free = gw_avila_pcm_free, ++}; ++ ++static int gw_avila_pcm_platform_probe(struct platform_device *pdev) ++{ ++ return snd_soc_register_platform(&pdev->dev, &gw_avila_soc_platform); ++} ++ ++static int gw_avila_pcm_platform_remove(struct platform_device *pdev) ++{ ++ snd_soc_unregister_platform(&pdev->dev); ++ return 0; ++} ++ ++static struct platform_driver gw_avila_pcm_driver = { ++ .driver = { ++ .name = "gw_avila-audio", ++ .owner = THIS_MODULE, ++ }, ++ .probe = gw_avila_pcm_platform_probe, ++ .remove = gw_avila_pcm_platform_remove, ++}; ++ ++static int __init gw_avila_soc_platform_init(void) ++{ ++ return platform_driver_register(&gw_avila_pcm_driver); ++} ++module_init(gw_avila_soc_platform_init); ++ ++static void __exit gw_avila_soc_platform_exit(void) ++{ ++ platform_driver_unregister(&gw_avila_pcm_driver); ++} ++module_exit(gw_avila_soc_platform_exit); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Gateworks Avila PCM DMA module"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila-pcm.h +@@ -0,0 +1,32 @@ ++/* ++ * ALSA PCM interface for the Gateworks Avila platform ++ * ++ * Author: Chris Lang, ++ * Copyright: (C) 2009 Gateworks Corporation ++ * ++ * Based On: davinci-evm.c, Author: Vladimir Barinov, ++ * ++ * 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. ++ */ ++ ++#ifndef _GW_AVILA_PCM_H ++#define _GW_AVILA_PCM_H ++ ++#if 0 ++struct gw_avila_pcm_dma_params { ++ char *name; /* stream identifier */ ++ int channel; /* sync dma channel ID */ ++ dma_addr_t dma_addr; /* device physical address for DMA */ ++ unsigned int data_type; /* xfer data type */ ++}; ++ ++struct gw_avila_snd_platform_data { ++ int tx_dma_ch; // XXX Do we need this? ++ int rx_dma_ch; // XXX Do we need this ++}; ++extern struct snd_soc_platform gw_avila_soc_platform[]; ++#endif ++ ++#endif +--- /dev/null ++++ b/sound/soc/gw-avila/gw-avila.c +@@ -0,0 +1,244 @@ ++/* ++ * File: sound/soc/gw-avila/gw_avila.c ++ * Author: Chris Lang ++ * ++ * Created: Tue June 06 2008 ++ * Description: Board driver for Gateworks Avila ++ * ++ * Modified: ++ * Copyright 2009 Gateworks Corporation ++ * ++ * Bugs: What Bugs? ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, see the file COPYING, or write ++ * to the Free Software Foundation, Inc., ++ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++#include "gw-avila-hss.h" ++#include "gw-avila-pcm.h" ++ ++#define CODEC_FREQ 33333000 ++ ++static int gw_avila_board_startup(struct snd_pcm_substream *substream) ++{ ++ pr_debug("%s enter\n", __func__); ++ return 0; ++} ++ ++static int gw_avila_hw_params(struct snd_pcm_substream *substream, ++ struct snd_pcm_hw_params *params) ++{ ++ struct snd_soc_pcm_runtime *rtd = substream->private_data; ++ struct snd_soc_dai *codec_dai = rtd->codec_dai; ++ struct snd_soc_dai *cpu_dai = rtd->cpu_dai; ++ ++ int ret = 0; ++ ++ /* set codec DAI configuration */ ++ if (cpu_dai->id % 2) { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBS_CFS); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 1, 32); ++ } else { ++ ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_DSP_B | SND_SOC_DAIFMT_IB_NF | SND_SOC_DAIFMT_CBM_CFM); ++ snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 0, 32); ++ } ++ ++ if (ret < 0) ++ return ret; ++ ++ /* set the codec system clock */ ++ ret = snd_soc_dai_set_sysclk(codec_dai, 0, CODEC_FREQ, SND_SOC_CLOCK_OUT); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = { ++ SND_SOC_DAPM_HP("Headphone Jack", NULL), ++ SND_SOC_DAPM_LINE("Line Out", NULL), ++ SND_SOC_DAPM_LINE("Line In", NULL), ++}; ++ ++static const struct snd_soc_dapm_route audio_map[] = { ++ {"Headphone Jack", NULL, "HPLOUT"}, ++ {"Headphone Jack", NULL, "HPROUT"}, ++ ++ /* Line Out connected to LLOUT, RLOUT */ ++ {"Line Out", NULL, "LLOUT"}, ++ {"Line Out", NULL, "RLOUT"}, ++ ++ /* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */ ++ {"LINE1L", NULL, "Line In"}, ++ {"LINE1R", NULL, "Line In"}, ++}; ++ ++/* Logic for a aic3x as connected on a davinci-evm */ ++static int avila_aic3x_init(struct snd_soc_pcm_runtime *rtd) ++{ ++ struct snd_soc_codec *codec = rtd->codec; ++ struct snd_soc_dapm_context *dapm = snd_soc_codec_get_dapm(codec); ++ ++ /* Add davinci-evm specific widgets */ ++ snd_soc_dapm_new_controls(dapm, aic3x_dapm_widgets, ++ ARRAY_SIZE(aic3x_dapm_widgets)); ++ ++ /* Set up davinci-evm specific audio path audio_map */ ++ snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map)); ++ ++ /* not connected */ ++ snd_soc_dapm_disable_pin(dapm, "MONO_LOUT"); ++ //snd_soc_dapm_disable_pin(dapm, "HPLCOM"); ++ //snd_soc_dapm_disable_pin(dapm, "HPRCOM"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3L"); ++ snd_soc_dapm_disable_pin(dapm, "MIC3R"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2L"); ++ snd_soc_dapm_disable_pin(dapm, "LINE2R"); ++ ++ /* always connected */ ++ snd_soc_dapm_enable_pin(dapm, "Headphone Jack"); ++ snd_soc_dapm_enable_pin(dapm, "Line Out"); ++ snd_soc_dapm_enable_pin(dapm, "Line In"); ++ ++ snd_soc_dapm_sync(dapm); ++ ++ return 0; ++} ++ ++static struct snd_soc_ops gw_avila_board_ops = { ++ .startup = gw_avila_board_startup, ++ .hw_params = gw_avila_hw_params, ++}; ++ ++static struct snd_soc_dai_link gw_avila_board_dai[] = { ++ { ++ .name = "HSS-0", ++ .stream_name = "HSS-0", ++ .cpu_dai_name = "gw_avila_hss.0", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001b", ++ .platform_name = "gw_avila-audio.0", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-1", ++ .stream_name = "HSS-1", ++ .cpu_dai_name = "gw_avila_hss.1", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-001a", ++ .platform_name = "gw_avila-audio.1", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-2", ++ .stream_name = "HSS-2", ++ .cpu_dai_name = "gw_avila_hss.2", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0019", ++ .platform_name = "gw_avila-audio.2", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ },{ ++ .name = "HSS-3", ++ .stream_name = "HSS-3", ++ .cpu_dai_name = "gw_avila_hss.3", ++ .codec_dai_name = "tlv320aic3x-hifi", ++ .codec_name = "tlv320aic3x-codec.0-0018", ++ .platform_name = "gw_avila-audio.3", ++ .init = avila_aic3x_init, ++ .ops = &gw_avila_board_ops, ++ }, ++}; ++ ++static struct snd_soc_card gw_avila_board[] = { ++ { ++ .name = "gw_avila-board.0", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[0], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.1", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[1], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.2", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[2], ++ .num_links = 1, ++ },{ ++ .name = "gw_avila-board.3", ++ .owner = THIS_MODULE, ++ .dai_link = &gw_avila_board_dai[3], ++ .num_links = 1, ++ } ++}; ++ ++static struct platform_device *gw_avila_board_snd_device[4]; ++ ++static int __init gw_avila_board_init(void) ++{ ++ int ret; ++ struct port *port; ++ int i; ++ ++ if ((hss_port[0] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ if ((hss_port[1] = kzalloc(sizeof(*port), GFP_KERNEL)) == NULL) ++ return -ENOMEM; ++ ++ for (i = 0; i < 4; i++) { ++ gw_avila_board_snd_device[i] = platform_device_alloc("soc-audio", i); ++ if (!gw_avila_board_snd_device[i]) { ++ return -ENOMEM; ++ } ++ ++ platform_set_drvdata(gw_avila_board_snd_device[i], &gw_avila_board[i]); ++ ret = platform_device_add(gw_avila_board_snd_device[i]); ++ ++ if (ret) { ++ platform_device_put(gw_avila_board_snd_device[i]); ++ } ++ } ++ return ret; ++} ++ ++static void __exit gw_avila_board_exit(void) ++{ ++ int i; ++ for (i = 0; i < 4; i++) ++ platform_device_unregister(gw_avila_board_snd_device[i]); ++} ++ ++module_init(gw_avila_board_init); ++module_exit(gw_avila_board_exit); ++ ++/* Module information */ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("ALSA SoC HSS Audio gw_avila board"); ++MODULE_LICENSE("GPL"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.c +@@ -0,0 +1,902 @@ ++/* ++ * Intel IXP4xx HSS (synchronous serial port) driver for Linux ++ * ++ * Copyright (C) 2009 Chris Lang ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "ixp4xx_hss.h" ++ ++/***************************************************************************** ++ * global variables ++ ****************************************************************************/ ++ ++void hss_chan_read(unsigned long data); ++static char lock_init = 0; ++static spinlock_t npe_lock; ++static struct npe *npe; ++ ++static const struct { ++ int tx, txdone, rx, rxfree, chan; ++}queue_ids[2] = {{HSS0_PKT_TX0_QUEUE, HSS0_PKT_TXDONE_QUEUE, HSS0_PKT_RX_QUEUE, ++ HSS0_PKT_RXFREE0_QUEUE, HSS0_CHL_RXTRIG_QUEUE}, ++ {HSS1_PKT_TX0_QUEUE, HSS1_PKT_TXDONE_QUEUE, HSS1_PKT_RX_QUEUE, ++ HSS1_PKT_RXFREE0_QUEUE, HSS1_CHL_RXTRIG_QUEUE}, ++}; ++ ++struct port *hss_port[2]; ++struct hss_device *hss_handle[32]; ++EXPORT_SYMBOL(hss_handle); ++ ++/***************************************************************************** ++ * utility functions ++ ****************************************************************************/ ++ ++#ifndef __ARMEB__ ++static inline void memcpy_swab32(u32 *dest, u32 *src, int cnt) ++{ ++ int i; ++ for (i = 0; i < cnt; i++) ++ dest[i] = swab32(src[i]); ++} ++#endif ++ ++static inline unsigned int sub_offset(unsigned int a, unsigned int b, ++ unsigned int modulo) ++{ ++ return (modulo /* make sure the result >= 0 */ + a - b) % modulo; ++} ++ ++/***************************************************************************** ++ * HSS access ++ ****************************************************************************/ ++ ++static void hss_config_load(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_LOAD; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ if (npe_recv_message(npe, &msg, "HSS_LOAD_CONFIG")) ++ break; ++ ++ /* HSS_LOAD_CONFIG for port #1 returns port_id = #4 */ ++ if (msg.cmd != PORT_CONFIG_LOAD || msg.data32) ++ break; ++ ++ /* HDLC may stop working without this */ ++ npe_recv_message(npe, &msg, "FLUSH_IT"); ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to reload HSS configuration\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_set_pcr(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_PCR; ++#if 0 ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_UNASS_HIGH_IMP | PCR_TX_V56K_HIGH_IMP | PCR_TX_FB_HIGH_IMP; ++#else ++ msg.data32 = PCR_FRM_SYNC_RISINGEDGE | PCR_MSB_ENDIAN | ++ PCR_TX_DATA_ENABLE | PCR_TX_FB_HIGH_IMP | PCR_DCLK_EDGE_RISING; ++#endif ++ if (port->frame_size % 8 == 0) ++ msg.data32 |= PCR_SOF_NO_FBIT; ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_PCR")) ++ break; ++ ++ msg.index = HSS_CONFIG_RX_PCR; ++ msg.data32 &= ~ (PCR_DCLK_EDGE_RISING | PCR_FCLK_EDGE_RISING | PCR_TX_DATA_ENABLE); ++ ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_PCR")) ++ break; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to set HSS PCR registers\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_set_core(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CORE_CR; ++#if 0 ++ msg.data32 = 0 | CCR_LOOPBACK | ++ (port->id ? CCR_SECOND_HSS : 0); ++#else ++ msg.data32 = 0 | ++ (port->id ? CCR_SECOND_HSS : 0); ++#endif ++ if (npe_send_message(npe, &msg, "HSS_SET_CORE_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS core control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_line(struct port *port) ++{ ++ struct msg msg; ++ ++ hss_config_set_pcr(port); ++ hss_config_set_core(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_CLOCK_CR; ++ msg.data32 = CLK42X_SPEED_8192KHZ /* FIXME */; ++ if (npe_send_message(npe, &msg, "HSS_SET_CLOCK_CR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS clock control" ++ " register\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_rx_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_RX_FCR; ++ msg.data16a = port->frame_sync_offset; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_RX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS RX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++} ++ ++static void hss_config_set_frame(struct port *port) ++{ ++ struct msg msg; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ msg.index = HSS_CONFIG_TX_FCR; ++ msg.data16a = TX_FRAME_SYNC_OFFSET; ++ msg.data16b = port->frame_size - 1; ++ if (npe_send_message(npe, &msg, "HSS_SET_TX_FCR")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS TX frame size" ++ " and offset\n", port->id); ++ BUG(); ++ } ++ hss_config_set_rx_frame(port); ++} ++ ++static void hss_config_set_lut(struct port *port) ++{ ++ struct msg msg; ++ int chan_count = 32; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_CONFIG_WRITE; ++ msg.hss_port = port->id; ++ ++ msg.index = HSS_CONFIG_TX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_TX_LUT"); ++ ++ msg.index = HSS_CONFIG_RX_LUT; ++ msg.data32 = 0xffffffff; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.data32 = 0x0; ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ msg.index += 4; ++ npe_send_message(npe, &msg, "HSS_SET_RX_LUT"); ++ ++ hss_config_set_frame(port); ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_NUM_CHANS_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = chan_count; ++ if (npe_send_message(npe, &msg, "CHAN_NUM_CHANS_WRITE")) { ++ printk(KERN_CRIT "HSS-%i: unable to set HSS channel count\n", ++ port->id); ++ BUG(); ++ } ++} ++ ++static u32 hss_config_get_status(struct port *port) ++{ ++ struct msg msg; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = PORT_ERROR_READ; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ if (npe_recv_message(npe, &msg, "PORT_ERROR_READ")) ++ break; ++ ++ return msg.data32; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to read HSS status\n", port->id); ++ BUG(); ++} ++ ++static void hss_config_start_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ port->chan_last_tx = 0; ++ port->chan_last_rx = 0; ++ ++ do { ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_rx_buf_phys; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_ADDR_WRITE; ++ msg.hss_port = port->id; ++ msg.data32 = port->chan_tx_pointers_phys; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_ADDR_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_ENABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_ENABLE")) ++ break; ++ port->chan_started = 1; ++ return; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start channelized flow\n", ++ port->id); ++ BUG(); ++} ++ ++static void hss_config_stop_chan(struct port *port) ++{ ++ struct msg msg; ++ ++ if (!port->chan_started) ++ return; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_FLOW_DISABLE; ++ msg.hss_port = port->id; ++ if (npe_send_message(npe, &msg, "CHAN_FLOW_DISABLE")) { ++ printk(KERN_CRIT "HSS-%i: unable to stop channelized flow\n", ++ port->id); ++ BUG(); ++ } ++ hss_config_get_status(port); /* make sure it's halted */ ++ port->chan_started = 0; ++} ++ ++static int hss_config_load_firmware(struct port *port) ++{ ++ struct msg msg; ++ ++ if (port->initialized) ++ return 0; ++ ++ if (!npe_running(npe)) { ++ int err; ++ if ((err = npe_load_firmware(npe, "NPE-A-HSS", ++ port->dev))) ++ return err; ++ } ++ ++ do { ++ /* HSS main configuration */ ++ hss_config_set_line(port); ++ ++ hss_config_set_frame(port); ++ ++ /* Channelized operation settings */ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BLK_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8b = (CHAN_TX_LIST_FRAMES & ~7) / 2; ++ msg.data8a = msg.data8b / 4; ++ msg.data8d = CHAN_TX_LIST_FRAMES - msg.data8b; ++ msg.data8c = msg.data8d / 4; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BLK_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_RX_BUF_CFG_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_RX_TRIGGER / 8; ++ msg.data8b = CHAN_RX_FRAMES; ++ if (npe_send_message(npe, &msg, "CHAN_RX_BUF_CFG_WRITE")) ++ break; ++ ++ memset(&msg, 0, sizeof(msg)); ++ msg.cmd = CHAN_TX_BUF_SIZE_WRITE; ++ msg.hss_port = port->id; ++ msg.data8a = CHAN_TX_LISTS; ++ if (npe_send_message(npe, &msg, "CHAN_TX_BUF_SIZE_WRITE")) ++ break; ++ ++ port->initialized = 1; ++ return 0; ++ } while (0); ++ ++ printk(KERN_CRIT "HSS-%i: unable to start HSS operation\n", port->id); ++ BUG(); ++} ++ ++void hss_chan_irq(void *pdev) ++{ ++ struct port *port = pdev; ++ ++ qmgr_disable_irq(queue_ids[port->id].chan); ++ ++ tasklet_hi_schedule(&port->task); ++} ++ ++ ++int hss_prepare_chan(struct port *port) ++{ ++ int err, i, j; ++ u32 *temp; ++ u32 temp2; ++ u8 *temp3; ++ ++ if (port->initialized) ++ return 0; ++ ++ if ((err = hss_config_load_firmware(port))) ++ return err; ++ ++ if ((err = qmgr_request_queue(queue_ids[port->id].chan, ++ CHAN_QUEUE_LEN, 0, 0, "%s:hss", "hss"))) ++ return err; ++ ++ port->chan_tx_buf = dma_alloc_coherent(port->dev, chan_tx_buf_len(port), &port->chan_tx_buf_phys, GFP_DMA); ++ memset(port->chan_tx_buf, 0, chan_tx_buf_len(port)); ++ ++ port->chan_tx_pointers = dma_alloc_coherent(port->dev, chan_tx_buf_len(port) / CHAN_TX_LIST_FRAMES * 4, &port->chan_tx_pointers_phys, GFP_DMA); ++ ++ temp3 = port->chan_tx_buf; ++ for (i = 0; i < CHAN_TX_LISTS; i++) { ++ for (j = 0; j < 8; j++) { ++ port->tx_lists[i][j] = temp3; ++ temp3 += CHAN_TX_LIST_FRAMES * 4; ++ } ++ } ++ ++ temp = port->chan_tx_pointers; ++ temp2 = port->chan_tx_buf_phys; ++ for (i = 0; i < CHAN_TX_LISTS; i++) ++ { ++ for (j = 0; j < 32; j++) ++ { ++ *temp = temp2; ++ temp2 += CHAN_TX_LIST_FRAMES; ++ temp++; ++ } ++ } ++ ++ port->chan_rx_buf = dma_alloc_coherent(port->dev, chan_rx_buf_len(port), &port->chan_rx_buf_phys, GFP_DMA); ++ ++ for (i = 0; i < 8; i++) { ++ temp3 = port->chan_rx_buf + (i * 4 * 128); ++ for (j = 0; j < 8; j++) { ++ port->rx_frames[i][j] = temp3; ++ temp3 += CHAN_RX_TRIGGER; ++ } ++ } ++ ++ qmgr_set_irq(queue_ids[port->id].chan, QUEUE_IRQ_SRC_NOT_EMPTY, ++ hss_chan_irq, port); ++ ++ return 0; ++ ++} ++ ++int hss_tx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->tx_loc = 0; ++ hdev->tx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_start); ++ ++int hss_rx_start(struct hss_device *hdev) ++{ ++ unsigned long flags; ++ struct port *port = hdev->port; ++ ++ hdev->rx_loc = 0; ++ hdev->rx_frame = 0; ++ ++ set_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ if (!port->chan_started) ++ { ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ spin_lock_irqsave(&npe_lock, flags); ++ hss_config_start_chan(port); ++ spin_unlock_irqrestore(&npe_lock, flags); ++ hss_chan_irq(port); ++ } ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_start); ++ ++int hss_tx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_tx_stop); ++ ++int hss_rx_stop(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ ++ clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_rx_stop); ++ ++int hss_chan_open(struct hss_device *hdev) ++{ ++ struct port *port = hdev->port; ++ int i, err = 0; ++ ++ if (port->chan_open) ++ return 0; ++ ++ if (port->mode == MODE_HDLC) { ++ err = -ENOSYS; ++ goto out; ++ } ++ ++ if (port->mode == MODE_G704 && port->channels[0] == hdev->id) { ++ err = -EBUSY; /* channel #0 is used for G.704 signaling */ ++ goto out; ++ } ++ ++ for (i = MAX_CHANNELS; i > port->frame_size / 8; i--) ++ if (port->channels[i - 1] == hdev->id) { ++ err = -ECHRNG; /* frame too short */ ++ goto out; ++ } ++ ++ hdev->rx_loc = hdev->tx_loc = 0; ++ hdev->rx_frame = hdev->tx_frame = 0; ++ ++ //clear_bit((1 << hdev->id), &port->chan_rx_bitmap); ++ //clear_bit((1 << hdev->id), &port->chan_tx_bitmap); ++ ++ if (!port->initialized) { ++ hss_prepare_chan(port); ++ ++ hss_config_stop_chan(port); ++ hdev->open_count++; ++ port->chan_open_count++; ++ ++ hss_config_set_lut(port); ++ hss_config_load(port); ++ ++ } ++ port->chan_open = 1; ++ ++out: ++ return err; ++} ++EXPORT_SYMBOL(hss_chan_open); ++ ++int hss_chan_close(struct hss_device *hdev) ++{ ++ return 0; ++} ++EXPORT_SYMBOL(hss_chan_close); ++ ++void hss_chan_read(unsigned long data) ++{ ++ struct port *port = (void *)data; ++ struct hss_device *hdev; ++ u8 *hw_buf, *save_buf; ++ u8 *buf; ++ u32 v; ++ unsigned int tx_list, rx_frame; ++ int i, j, channel; ++ u8 more_work = 0; ++ ++/* ++ My Data in the hardware buffer is scattered by channels into 4 trunks ++ as follows for rx ++ ++ channel 0 channel 1 channel 2 channel 3 ++Trunk 1 = 0 -> 127 128 -> 255 256 -> 383 384 -> 512 ++Trunk 2 = 513 -> 639 640 -> 768 769 -> 895 896 -> 1023 ++Trunk 3 = 1024 -> 1151 1152 -> 1207 1208 -> 1407 1408 -> 1535 ++Trunk 4 = 1535 -> 1663 1664 -> 1791 1792 -> 1920 1921 -> 2047 ++ ++ I will get CHAN_RX_TRIGGER worth of bytes out of each channel on each trunk ++ with each IRQ ++ ++ For TX Data, it is split into 8 lists with each list containing 16 bytes per ++ channel ++ ++Trunk 1 = 0 -> 16 17 -> 32 33 -> 48 49 -> 64 ++Trunk 2 = 65 -> 80 81 -> 96 97 -> 112 113 -> 128 ++Trunk 3 = 129 -> 144 145 -> 160 161 -> 176 177 -> 192 ++Trunk 4 = 193 -> 208 209 -> 224 225 -> 240 241 -> 256 ++ ++*/ ++ ++ ++ while ((v = qmgr_get_entry(queue_ids[port->id].chan))) ++ { ++ tx_list = (v >> 8) & 0xFF; ++ rx_frame = v & 0xFF; ++ ++ if (tx_list == 7) ++ tx_list = 0; ++ else ++ tx_list++; ++ for (channel = 0; channel < 8; channel++) { ++ ++ hdev = port->chan_devices[channel]; ++ if (!hdev) ++ continue; ++ ++ if (test_bit(1 << channel, &port->chan_tx_bitmap)) { ++ buf = (u8 *)hdev->tx_buf + hdev->tx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++ save_buf = hw_buf; ++#else ++ save_buf = port->tx_lists[tx_list][channel]; ++#endif ++ for (i = 0; i < CHAN_TX_LIST_FRAMES; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *hw_buf = *(buf++); ++ hw_buf += CHAN_TX_LIST_FRAMES; ++ } ++ ++ hdev->tx_loc += 4; ++ hdev->tx_frame++; ++ if (hdev->tx_loc >= hdev->tx_buffer_size) { ++ hdev->tx_loc = 0; ++ buf = (u8 *)hdev->tx_buf; ++ } ++ } ++ } else { ++#if 0 ++ hw_buf = (u8 *)port->chan_tx_buf; ++ hw_buf += (tx_list * CHAN_TX_LIST_FRAMES * 32); ++ hw_buf += (4 * CHAN_TX_LIST_FRAMES * channel); ++#else ++ hw_buf = port->tx_lists[tx_list][channel]; ++#endif ++ memset(hw_buf, 0, 64); ++ } ++ ++ if (hdev->tx_frame >= hdev->tx_period_size && test_bit(1 << channel, &port->chan_tx_bitmap)) ++ { ++ hdev->tx_frame %= hdev->tx_period_size; ++ if (hdev->tx_callback) ++ hdev->tx_callback(hdev->tx_data); ++ more_work = 1; ++ } ++ ++ if (test_bit(1 << channel, &port->chan_rx_bitmap)) { ++ buf = (u8 *)hdev->rx_buf + hdev->rx_loc; ++#if 0 ++ hw_buf = (u8 *)port->chan_rx_buf; ++ hw_buf += (4 * CHAN_RX_FRAMES * channel); ++ hw_buf += rx_frame; ++ save_buf = hw_buf; ++#else ++ save_buf = port->rx_frames[channel][rx_frame >> 4]; ++#endif ++ for (i = 0; i < CHAN_RX_TRIGGER; i++) { ++ hw_buf = save_buf + i; ++ for (j = 0; j < 4; j++) { ++ *(buf++) = *hw_buf; ++ hw_buf += CHAN_RX_FRAMES; ++ } ++ hdev->rx_loc += 4; ++ hdev->rx_frame++; ++ if (hdev->rx_loc >= hdev->rx_buffer_size) { ++ hdev->rx_loc = 0; ++ buf = (u8 *)hdev->rx_buf; ++ } ++ } ++ } ++ ++ if (hdev->rx_frame >= hdev->rx_period_size && test_bit(1 << channel, &port->chan_rx_bitmap)) ++ { ++ hdev->rx_frame %= hdev->rx_period_size; ++ if (hdev->rx_callback) ++ hdev->rx_callback(hdev->rx_data); ++ more_work = 1; ++ } ++ } ++#if 0 ++ if (more_work) ++ { ++ tasklet_hi_schedule(&port->task); ++ return; ++ } ++#endif ++ } ++ ++ qmgr_enable_irq(queue_ids[port->id].chan); ++ ++ return; ++ ++} ++ ++struct hss_device *hss_chan_create(struct port *port, unsigned int channel) ++{ ++ struct hss_device *chan_dev; ++ unsigned long flags; ++ ++ chan_dev = kzalloc(sizeof(struct hss_device), GFP_KERNEL); ++ ++ spin_lock_irqsave(&npe_lock, flags); ++ ++ chan_dev->id = channel; ++ chan_dev->port = port; ++ ++ port->channels[channel] = channel; ++ ++ port->chan_devices[channel] = chan_dev; ++ ++ spin_unlock_irqrestore(&npe_lock, flags); ++ ++ return chan_dev; ++} ++ ++/***************************************************************************** ++ * initialization ++ ****************************************************************************/ ++ ++static struct platform_device gw_avila_hss_device_0 = { ++ .name = "ixp4xx_hss", ++ .id = 0, ++}; ++ ++static struct platform_device gw_avila_hss_device_1 = { ++ .name = "ixp4xx_hss", ++ .id = 1, ++}; ++ ++static struct platform_device *gw_avila_hss_port_0; ++static struct platform_device *gw_avila_hss_port_1; ++static u64 hss_dmamask = 0xFFFFFFFF; ++ ++struct hss_device *hss_init(int id, int channel) ++{ ++ struct port *port = hss_port[id]; ++ struct hss_device *hdev; ++ int ret; ++ ++ if (!lock_init) ++ { ++ spin_lock_init(&npe_lock); ++ lock_init = 1; ++ npe = npe_request(0); ++ } ++ ++ if (!port->init) { ++ if (id == 0) { ++ gw_avila_hss_port_0 = platform_device_alloc("hss-port", 0); ++ ++ platform_set_drvdata(gw_avila_hss_port_0, &gw_avila_hss_device_0); ++ port->dev = &gw_avila_hss_port_0->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_0); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_0); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ else ++ { ++ gw_avila_hss_port_1 = platform_device_alloc("hss-port", 1); ++ ++ platform_set_drvdata(gw_avila_hss_port_1, &gw_avila_hss_device_1); ++ port->dev = &gw_avila_hss_port_1->dev; ++ ++ if (!port->dev->dma_mask) ++ port->dev->dma_mask = &hss_dmamask; ++ if (!port->dev->coherent_dma_mask) ++ port->dev->coherent_dma_mask = 0xFFFFFFFF; ++ ++ ret = platform_device_add(gw_avila_hss_port_1); ++ ++ if (ret) ++ platform_device_put(gw_avila_hss_port_1); ++ ++ tasklet_init(&port->task, hss_chan_read, (unsigned long) port); ++ } ++ ++ port->init = 1; ++ port->id = id; ++ port->clock_type = CLOCK_EXT; ++ port->clock_rate = 8192000; ++ port->frame_size = 256; /* E1 */ ++ port->mode = MODE_RAW; ++ port->next_rx_frame = 0; ++ memset(port->channels, CHANNEL_UNUSED, sizeof(port->channels)); ++ } ++ ++ hdev = hss_chan_create(port, channel); ++ ++ return hdev; ++} ++EXPORT_SYMBOL(hss_init); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data) ++{ ++ BUG_ON(tx_callback == NULL); ++ hdev->tx_callback = tx_callback; ++ hdev->tx_data = tx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_tx_callback); ++ ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data) ++{ ++ BUG_ON(rx_callback == NULL); ++ hdev->rx_callback = rx_callback; ++ hdev->rx_data = rx_data; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_set_rx_callback); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->rx_buf = (u8 *)buf; ++ hdev->rx_buffer_size = buffer_size << 2; ++ hdev->rx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_rx_dma); ++ ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size) ++{ ++ /* ++ * Period Size and Buffer Size are in Frames which are u32 ++ * We convert the u32 *buf to u8 in order to make channel reads ++ * and rx_loc easier ++ */ ++ ++ hdev->tx_buf = (u8 *)buf; ++ hdev->tx_buffer_size = buffer_size << 2; ++ hdev->tx_period_size = period_size; ++ ++ return 0; ++} ++EXPORT_SYMBOL(hss_config_tx_dma); ++ ++unsigned long hss_curr_offset_rx(struct hss_device *hdev) ++{ ++ return hdev->rx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_rx); ++ ++unsigned long hss_curr_offset_tx(struct hss_device *hdev) ++{ ++ return hdev->tx_loc >> 2; ++} ++EXPORT_SYMBOL(hss_curr_offset_tx); ++ ++MODULE_AUTHOR("Chris Lang"); ++MODULE_DESCRIPTION("Intel IXP4xx HSS Audio driver"); ++MODULE_LICENSE("GPL v2"); +--- /dev/null ++++ b/sound/soc/gw-avila/ixp4xx_hss.h +@@ -0,0 +1,401 @@ ++/* ++ * ++ * ++ * Copyright (C) 2009 Gateworks Corporation ++ * ++ * This program is free software; you can redistribute it and/or modify it ++ * under the terms of version 2 of the GNU General Public License ++ * as published by the Free Software Foundation. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++//#include XXX We aren't HDLC ++ ++#define DEBUG_QUEUES 0 ++#define DEBUG_DESC 0 ++#define DEBUG_RX 0 ++#define DEBUG_TX 0 ++#define DEBUG_PKT_BYTES 0 ++#define DEBUG_CLOSE 0 ++#define DEBUG_FRAMER 0 ++ ++#define DRV_NAME "ixp4xx_hss" ++ ++#define PKT_EXTRA_FLAGS 0 /* orig 1 */ ++#define TX_FRAME_SYNC_OFFSET 0 /* channelized */ ++#define PKT_NUM_PIPES 1 /* 1, 2 or 4 */ ++#define PKT_PIPE_FIFO_SIZEW 4 /* total 4 dwords per HSS */ ++ ++#define RX_DESCS 512 /* also length of all RX queues */ ++#define TX_DESCS 512 /* also length of all TX queues */ ++ ++//#define POOL_ALLOC_SIZE (sizeof(struct desc) * (RX_DESCS + TX_DESCS)) ++#define RX_SIZE (HDLC_MAX_MRU + 4) /* NPE needs more space */ ++#define MAX_CLOSE_WAIT 1000 /* microseconds */ ++#define HSS_COUNT 2 ++#define MIN_FRAME_SIZE 16 /* bits */ ++#define MAX_FRAME_SIZE 257 /* 256 bits + framing bit */ ++#define MAX_CHANNELS (MAX_FRAME_SIZE / 8) ++#define MAX_CHAN_DEVICES 32 ++#define CHANNEL_HDLC 0xFE ++#define CHANNEL_UNUSED 0xFF ++ ++#define NAPI_WEIGHT 16 ++#define CHAN_RX_TRIGGER 16 /* 8 RX frames = 1 ms @ E1 */ ++#define CHAN_RX_FRAMES 128 ++#define CHAN_RX_TRUNKS 1 ++#define MAX_CHAN_RX_BAD_SYNC (CHAN_RX_TRIGGER / 2 /* pairs */ - 3) ++ ++#define CHAN_TX_LIST_FRAMES CHAN_RX_TRIGGER /* bytes/channel per list, 16 - 48 */ ++#define CHAN_TX_LISTS 8 ++#define CHAN_TX_TRUNKS CHAN_RX_TRUNKS ++#define CHAN_TX_FRAMES (CHAN_TX_LIST_FRAMES * CHAN_TX_LISTS) ++ ++#define CHAN_QUEUE_LEN 32 /* minimum possible */ ++ ++#define chan_rx_buf_len(port) (port->frame_size / 8 * CHAN_RX_FRAMES * CHAN_RX_TRUNKS) ++#define chan_tx_buf_len(port) (port->frame_size / 8 * CHAN_TX_FRAMES * CHAN_TX_TRUNKS) ++ ++/* Queue IDs */ ++#define HSS0_CHL_RXTRIG_QUEUE 12 /* orig size = 32 dwords */ ++#define HSS0_PKT_RX_QUEUE 13 /* orig size = 32 dwords */ ++#define HSS0_PKT_TX0_QUEUE 14 /* orig size = 16 dwords */ ++#define HSS0_PKT_TX1_QUEUE 15 ++#define HSS0_PKT_TX2_QUEUE 16 ++#define HSS0_PKT_TX3_QUEUE 17 ++#define HSS0_PKT_RXFREE0_QUEUE 18 /* orig size = 16 dwords */ ++#define HSS0_PKT_RXFREE1_QUEUE 19 ++#define HSS0_PKT_RXFREE2_QUEUE 20 ++#define HSS0_PKT_RXFREE3_QUEUE 21 ++#define HSS0_PKT_TXDONE_QUEUE 22 /* orig size = 64 dwords */ ++ ++#define HSS1_CHL_RXTRIG_QUEUE 10 ++#define HSS1_PKT_RX_QUEUE 0 ++#define HSS1_PKT_TX0_QUEUE 5 ++#define HSS1_PKT_TX1_QUEUE 6 ++#define HSS1_PKT_TX2_QUEUE 7 ++#define HSS1_PKT_TX3_QUEUE 8 ++#define HSS1_PKT_RXFREE0_QUEUE 1 ++#define HSS1_PKT_RXFREE1_QUEUE 2 ++#define HSS1_PKT_RXFREE2_QUEUE 3 ++#define HSS1_PKT_RXFREE3_QUEUE 4 ++#define HSS1_PKT_TXDONE_QUEUE 9 ++ ++#define NPE_PKT_MODE_HDLC 0 ++#define NPE_PKT_MODE_RAW 1 ++#define NPE_PKT_MODE_56KMODE 2 ++#define NPE_PKT_MODE_56KENDIAN_MSB 4 ++ ++/* PKT_PIPE_HDLC_CFG_WRITE flags */ ++#define PKT_HDLC_IDLE_ONES 0x1 /* default = flags */ ++#define PKT_HDLC_CRC_32 0x2 /* default = CRC-16 */ ++#define PKT_HDLC_MSB_ENDIAN 0x4 /* default = LE */ ++ ++ ++/* hss_config, PCRs */ ++/* Frame sync sampling, default = active low */ ++#define PCR_FRM_SYNC_ACTIVE_HIGH 0x40000000 ++#define PCR_FRM_SYNC_FALLINGEDGE 0x80000000 ++#define PCR_FRM_SYNC_RISINGEDGE 0xC0000000 ++ ++/* Frame sync pin: input (default) or output generated off a given clk edge */ ++#define PCR_FRM_SYNC_OUTPUT_FALLING 0x20000000 ++#define PCR_FRM_SYNC_OUTPUT_RISING 0x30000000 ++ ++/* Frame and data clock sampling on edge, default = falling */ ++#define PCR_FCLK_EDGE_RISING 0x08000000 ++#define PCR_DCLK_EDGE_RISING 0x04000000 ++ ++/* Clock direction, default = input */ ++#define PCR_SYNC_CLK_DIR_OUTPUT 0x02000000 ++ ++/* Generate/Receive frame pulses, default = enabled */ ++#define PCR_FRM_PULSE_DISABLED 0x01000000 ++ ++ /* Data rate is full (default) or half the configured clk speed */ ++#define PCR_HALF_CLK_RATE 0x00200000 ++ ++/* Invert data between NPE and HSS FIFOs? (default = no) */ ++#define PCR_DATA_POLARITY_INVERT 0x00100000 ++ ++/* TX/RX endianness, default = LSB */ ++#define PCR_MSB_ENDIAN 0x00080000 ++ ++/* Normal (default) / open drain mode (TX only) */ ++#define PCR_TX_PINS_OPEN_DRAIN 0x00040000 ++ ++/* No framing bit transmitted and expected on RX? (default = framing bit) */ ++#define PCR_SOF_NO_FBIT 0x00020000 ++ ++/* Drive data pins? */ ++#define PCR_TX_DATA_ENABLE 0x00010000 ++ ++/* Voice 56k type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_V56K_HIGH 0x00002000 ++#define PCR_TX_V56K_HIGH_IMP 0x00004000 ++ ++/* Unassigned type: drive the data pins low (default), high, high Z */ ++#define PCR_TX_UNASS_HIGH 0x00000800 ++#define PCR_TX_UNASS_HIGH_IMP 0x00001000 ++ ++/* T1 @ 1.544MHz only: Fbit dictated in FIFO (default) or high Z */ ++#define PCR_TX_FB_HIGH_IMP 0x00000400 ++ ++/* 56k data endiannes - which bit unused: high (default) or low */ ++#define PCR_TX_56KE_BIT_0_UNUSED 0x00000200 ++ ++/* 56k data transmission type: 32/8 bit data (default) or 56K data */ ++#define PCR_TX_56KS_56K_DATA 0x00000100 ++ ++/* hss_config, cCR */ ++/* Number of packetized clients, default = 1 */ ++#define CCR_NPE_HFIFO_2_HDLC 0x04000000 ++#define CCR_NPE_HFIFO_3_OR_4HDLC 0x08000000 ++ ++/* default = no loopback */ ++#define CCR_LOOPBACK 0x02000000 ++ ++/* HSS number, default = 0 (first) */ ++#define CCR_SECOND_HSS 0x01000000 ++ ++ ++/* hss_config, clkCR: main:10, num:10, denom:12 */ ++#define CLK42X_SPEED_EXP ((0x3FF << 22) | ( 2 << 12) | 15) /*65 KHz*/ ++ ++#define CLK42X_SPEED_512KHZ (( 130 << 22) | ( 2 << 12) | 15) ++#define CLK42X_SPEED_1536KHZ (( 43 << 22) | ( 18 << 12) | 47) ++#define CLK42X_SPEED_1544KHZ (( 43 << 22) | ( 33 << 12) | 192) ++#define CLK42X_SPEED_2048KHZ (( 32 << 22) | ( 34 << 12) | 63) ++#define CLK42X_SPEED_4096KHZ (( 16 << 22) | ( 34 << 12) | 127) ++#define CLK42X_SPEED_8192KHZ (( 8 << 22) | ( 34 << 12) | 255) ++ ++#define CLK46X_SPEED_512KHZ (( 130 << 22) | ( 24 << 12) | 127) ++#define CLK46X_SPEED_1536KHZ (( 43 << 22) | (152 << 12) | 383) ++#define CLK46X_SPEED_1544KHZ (( 43 << 22) | ( 66 << 12) | 385) ++#define CLK46X_SPEED_2048KHZ (( 32 << 22) | (280 << 12) | 511) ++#define CLK46X_SPEED_4096KHZ (( 16 << 22) | (280 << 12) | 1023) ++#define CLK46X_SPEED_8192KHZ (( 8 << 22) | (280 << 12) | 2047) ++ ++ ++/* hss_config, LUT entries */ ++#define TDMMAP_UNASSIGNED 0 ++#define TDMMAP_HDLC 1 /* HDLC - packetized */ ++#define TDMMAP_VOICE56K 2 /* Voice56K - 7-bit channelized */ ++#define TDMMAP_VOICE64K 3 /* Voice64K - 8-bit channelized */ ++ ++/* offsets into HSS config */ ++#define HSS_CONFIG_TX_PCR 0x00 /* port configuration registers */ ++#define HSS_CONFIG_RX_PCR 0x04 ++#define HSS_CONFIG_CORE_CR 0x08 /* loopback control, HSS# */ ++#define HSS_CONFIG_CLOCK_CR 0x0C /* clock generator control */ ++#define HSS_CONFIG_TX_FCR 0x10 /* frame configuration registers */ ++#define HSS_CONFIG_RX_FCR 0x14 ++#define HSS_CONFIG_TX_LUT 0x18 /* channel look-up tables */ ++#define HSS_CONFIG_RX_LUT 0x38 ++ ++ ++/* NPE command codes */ ++/* writes the ConfigWord value to the location specified by offset */ ++#define PORT_CONFIG_WRITE 0x40 ++ ++/* triggers the NPE to load the contents of the configuration table */ ++#define PORT_CONFIG_LOAD 0x41 ++ ++/* triggers the NPE to return an HssErrorReadResponse message */ ++#define PORT_ERROR_READ 0x42 ++ ++/* reset NPE internal status and enable the HssChannelized operation */ ++#define CHAN_FLOW_ENABLE 0x43 ++#define CHAN_FLOW_DISABLE 0x44 ++#define CHAN_IDLE_PATTERN_WRITE 0x45 ++#define CHAN_NUM_CHANS_WRITE 0x46 ++#define CHAN_RX_BUF_ADDR_WRITE 0x47 ++#define CHAN_RX_BUF_CFG_WRITE 0x48 ++#define CHAN_TX_BLK_CFG_WRITE 0x49 ++#define CHAN_TX_BUF_ADDR_WRITE 0x4A ++#define CHAN_TX_BUF_SIZE_WRITE 0x4B ++#define CHAN_TSLOTSWITCH_ENABLE 0x4C ++#define CHAN_TSLOTSWITCH_DISABLE 0x4D ++ ++/* downloads the gainWord value for a timeslot switching channel associated ++ with bypassNum */ ++#define CHAN_TSLOTSWITCH_GCT_DOWNLOAD 0x4E ++ ++/* triggers the NPE to reset internal status and enable the HssPacketized ++ operation for the flow specified by pPipe */ ++#define PKT_PIPE_FLOW_ENABLE 0x50 ++#define PKT_PIPE_FLOW_DISABLE 0x51 ++#define PKT_NUM_PIPES_WRITE 0x52 ++#define PKT_PIPE_FIFO_SIZEW_WRITE 0x53 ++#define PKT_PIPE_HDLC_CFG_WRITE 0x54 ++#define PKT_PIPE_IDLE_PATTERN_WRITE 0x55 ++#define PKT_PIPE_RX_SIZE_WRITE 0x56 ++#define PKT_PIPE_MODE_WRITE 0x57 ++ ++/* HDLC packet status values - desc->status */ ++#define ERR_SHUTDOWN 1 /* stop or shutdown occurrance */ ++#define ERR_HDLC_ALIGN 2 /* HDLC alignment error */ ++#define ERR_HDLC_FCS 3 /* HDLC Frame Check Sum error */ ++#define ERR_RXFREE_Q_EMPTY 4 /* RX-free queue became empty while receiving ++ this packet (if buf_len < pkt_len) */ ++#define ERR_HDLC_TOO_LONG 5 /* HDLC frame size too long */ ++#define ERR_HDLC_ABORT 6 /* abort sequence received */ ++#define ERR_DISCONNECTING 7 /* disconnect is in progress */ ++ ++#define CLOCK_EXT 0 ++#define CLOCK_INT 1 ++ ++enum mode {MODE_HDLC = 0, MODE_RAW, MODE_G704}; ++enum rx_tx_bit { ++ TX_BIT = 0, ++ RX_BIT = 1 ++}; ++enum chan_bit { ++ CHAN_0 = (1 << 0), ++ CHAN_1 = (1 << 1), ++ CHAN_2 = (1 << 2), ++ CHAN_3 = (1 << 3), ++ CHAN_4 = (1 << 4), ++ CHAN_5 = (1 << 5), ++ CHAN_6 = (1 << 6), ++ CHAN_7 = (1 << 7), ++ CHAN_8 = (1 << 8), ++ CHAN_9 = (1 << 9), ++ CHAN_10 = (1 << 10), ++ CHAN_11 = (1 << 11), ++ CHAN_12 = (1 << 12), ++ CHAN_13 = (1 << 13), ++ CHAN_14 = (1 << 14), ++ CHAN_15 = (1 << 15) ++}; ++ ++enum alignment { NOT_ALIGNED = 0, EVEN_FIRST, ODD_FIRST }; ++ ++#ifdef __ARMEB__ ++typedef struct sk_buff buffer_t; ++#define free_buffer dev_kfree_skb ++#define free_buffer_irq dev_kfree_skb_irq ++#else ++typedef void buffer_t; ++#define free_buffer kfree ++#define free_buffer_irq kfree ++#endif ++ ++struct hss_device { ++ struct port *port; ++ unsigned int open_count, excl_open; ++ unsigned long tx_loc, rx_loc; /* bytes */ ++ unsigned long tx_frame, rx_frame; /* Frames */ ++ u8 id, chan_count; ++ u8 log_channels[MAX_CHANNELS]; ++ ++ u8 *rx_buf; ++ u8 *tx_buf; ++ ++ size_t rx_buffer_size; ++ size_t rx_period_size; ++ size_t tx_buffer_size; ++ size_t tx_period_size; ++ ++ void (*rx_callback)(void *data); ++ void *rx_data; ++ void (*tx_callback)(void *data); ++ void *tx_data; ++ void *private_data; ++}; ++ ++extern struct hss_device *hss_handle[32]; ++extern struct port *hss_port[2]; ++ ++struct port { ++ unsigned char init; ++ ++ struct device *dev; ++ ++ struct tasklet_struct task; ++ unsigned int id; ++ unsigned long chan_rx_bitmap; ++ unsigned long chan_tx_bitmap; ++ unsigned char chan_open; ++ ++ /* the following fields must be protected by npe_lock */ ++ enum mode mode; ++ unsigned int clock_type, clock_rate, loopback; ++ unsigned int frame_size, frame_sync_offset; ++ unsigned int next_rx_frame; ++ ++ struct hss_device *chan_devices[MAX_CHAN_DEVICES]; ++ u32 chan_tx_buf_phys, chan_rx_buf_phys; ++ u32 chan_tx_pointers_phys; ++ u32 *chan_tx_pointers; ++ u8 *chan_rx_buf; ++ u8 *chan_tx_buf; ++ u8 *tx_lists[CHAN_TX_LISTS][8]; ++ u8 *rx_frames[8][CHAN_TX_LISTS]; ++ unsigned int chan_open_count, hdlc_open; ++ unsigned int chan_started, initialized, just_set_offset; ++ unsigned int chan_last_rx, chan_last_tx; ++ ++ /* assigned channels, may be invalid with given frame length or mode */ ++ u8 channels[MAX_CHANNELS]; ++ int msg_count; ++}; ++ ++/* NPE message structure */ ++struct msg { ++#ifdef __ARMEB__ ++ u8 cmd, unused, hss_port, index; ++ union { ++ struct { u8 data8a, data8b, data8c, data8d; }; ++ struct { u16 data16a, data16b; }; ++ struct { u32 data32; }; ++ }; ++#else ++ u8 index, hss_port, unused, cmd; ++ union { ++ struct { u8 data8d, data8c, data8b, data8a; }; ++ struct { u16 data16b, data16a; }; ++ struct { u32 data32; }; ++ }; ++#endif ++}; ++ ++#define rx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ (n) * sizeof(struct desc)) ++#define rx_desc_ptr(port, n) (&(port)->desc_tab[n]) ++ ++#define tx_desc_phys(port, n) ((port)->desc_tab_phys + \ ++ ((n) + RX_DESCS) * sizeof(struct desc)) ++#define tx_desc_ptr(port, n) (&(port)->desc_tab[(n) + RX_DESCS]) ++ ++int hss_prepare_chan(struct port *port); ++void hss_chan_stop(struct port *port); ++ ++struct hss_device *hss_init(int id, int channel); ++int hss_chan_open(struct hss_device *hdev); ++int hss_chan_close(struct hss_device *hdev); ++ ++int hss_set_tx_callback(struct hss_device *hdev, void (*tx_callback)(void *), void *tx_data); ++int hss_set_rx_callback(struct hss_device *hdev, void (*rx_callback)(void *), void *rx_data); ++int hss_tx_start(struct hss_device *hdev); ++int hss_tx_stop(struct hss_device *hdev); ++int hss_rx_start(struct hss_device *hdev); ++int hss_rx_stop(struct hss_device *hdev); ++ ++int hss_config_rx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++int hss_config_tx_dma(struct hss_device *hdev, void *buf, size_t buffer_size, size_t period_size); ++unsigned long hss_curr_offset_rx(struct hss_device *hdev); ++unsigned long hss_curr_offset_tx(struct hss_device *hdev); ++ diff --git a/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch new file mode 100644 index 000000000..b56fbb732 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/180-tw5334_support.patch @@ -0,0 +1,287 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -160,6 +160,14 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW5334 ++ bool "Titan Wireless TW-533-4" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW533-4. For more information on this platform, ++ see http://openwrt.org ++ + config MACH_NAS100D + bool + prompt "NAS100D" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -24,6 +24,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + + obj-y += common.o + +@@ -49,6 +50,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,7 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2()) ++ machine_is_wrt300nv2() || machine_is_tw5334()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-pci.c +@@ -0,0 +1,68 @@ ++/* ++ * arch/arch/mach-ixp4xx/tw5334-pci.c ++ * ++ * PCI setup routines for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init tw5334_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw5334_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 12) ++ return IRQ_IXP4XX_GPIO6; ++ else if (slot == 13) ++ return IRQ_IXP4XX_GPIO2; ++ else if (slot == 14) ++ return IRQ_IXP4XX_GPIO1; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO0; ++ else return -1; ++} ++ ++struct hw_pci tw5334_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw5334_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw5334_map_irq, ++}; ++ ++int __init tw5334_pci_init(void) ++{ ++ if (machine_is_tw5334()) ++ pci_common_init(&tw5334_pci); ++ return 0; ++} ++ ++subsys_initcall(tw5334_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw5334-setup.c +@@ -0,0 +1,167 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw5334-setup.c ++ * ++ * Board setup for the Titan Wireless TW-533-4 ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data tw5334_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw5334_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw5334_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw5334_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_flash_resource, ++}; ++ ++static struct resource tw5334_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port tw5334_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw5334_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = tw5334_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw5334_uart_resource, ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw5334_plat_eth[] = { ++ { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw5334_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw5334_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw5334_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *tw5334_devices[] __initdata = { ++ &tw5334_flash, ++ &tw5334_uart, ++ &tw5334_eth[0], ++ &tw5334_eth[1], ++}; ++ ++static void __init tw5334_init(void) ++{ ++ uint8_t __iomem *f; ++ int i; ++ ++ ixp4xx_sys_init(); ++ ++ tw5334_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw5334_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(tw5334_devices, ARRAY_SIZE(tw5334_devices)); ++ ++ /* ++ * Map in a portion of the flash and read the MAC addresses. ++ * Since it is stored in BE in the flash itself, we need to ++ * byteswap it if we're in LE mode. ++ */ ++ f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x1000000); ++ if (f) { ++ for (i = 0; i < 6; i++) { ++#ifdef __ARMEB__ ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + i); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + i); ++#else ++ tw5334_plat_eth[0].hwaddr[i] = readb(f + 0xFC0422 + (i^3)); ++ tw5334_plat_eth[1].hwaddr[i] = readb(f + 0xFC043B + (i^3)); ++#endif ++ } ++ iounmap(f); ++ } ++ ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 0\n", ++ tw5334_plat_eth[0].hwaddr); ++ printk(KERN_INFO "TW-533-4: Using MAC address %pM for port 1\n", ++ tw5334_plat_eth[1].hwaddr); ++} ++ ++#ifdef CONFIG_MACH_TW5334 ++MACHINE_START(TW5334, "Titan Wireless TW-533-4") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw5334_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch new file mode 100644 index 000000000..7c229276f --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/185-mi424wr_support.patch @@ -0,0 +1,504 @@ +--- a/arch/arm/configs/ixp4xx_defconfig ++++ b/arch/arm/configs/ixp4xx_defconfig +@@ -26,6 +26,7 @@ CONFIG_MACH_NAS100D=y + CONFIG_MACH_DSMG600=y + CONFIG_MACH_FSG=y + CONFIG_MACH_GTWX5715=y ++CONFIG_MACH_MI424WR=y + CONFIG_IXP4XX_QMGR=y + CONFIG_IXP4XX_NPE=y + # CONFIG_ARM_THUMB is not set +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -258,6 +258,13 @@ config MACH_MIC256 + Say 'Y' here if you want your kernel to support the MIC256 + board from OMICRON electronics GmbH. + ++config MACH_MI424WR ++ bool "Actiontec MI424WR" ++ depends on ARCH_IXP4XX ++ select PCI ++ help ++ Add support for the Actiontec MI424-WR. ++ + comment "IXP4xx Options" + + config IXP4XX_INDIRECT_PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixd + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o ++obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + + obj-y += common.o + +@@ -51,6 +52,7 @@ obj-$(CONFIG_MACH_COMPEXWP18) += compex4 + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o ++obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-pci.c +@@ -0,0 +1,70 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-pci.c ++ * ++ * Actiontec MI424WR board-level PCI initialization ++ * ++ * Copyright (C) 2008 Jose Vasconcellos ++ * ++ * Maintainer: Jose Vasconcellos ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++/* PCI controller GPIO to IRQ pin mappings ++ * This information was obtained from Actiontec's GPL release. ++ * ++ * INTA INTB ++ * SLOT 13 8 6 ++ * SLOT 14 7 8 ++ * SLOT 15 6 7 ++ */ ++ ++void __init mi424wr_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init mi424wr_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 13) ++ return IRQ_IXP4XX_GPIO8; ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ if (slot == 15) ++ return IRQ_IXP4XX_GPIO6; ++ ++ return -1; ++} ++ ++struct hw_pci mi424wr_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = mi424wr_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = mi424wr_map_irq, ++}; ++ ++int __init mi424wr_pci_init(void) ++{ ++ if (machine_is_mi424wr()) ++ pci_common_init(&mi424wr_pci); ++ return 0; ++} ++ ++subsys_initcall(mi424wr_pci_init); ++ +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/mi424wr-setup.c +@@ -0,0 +1,384 @@ ++/* ++ * arch/arm/mach-ixp4xx/mi424wr-setup.c ++ * ++ * Actiontec MI424-WR board setup ++ * Copyright (c) 2008 Jose Vasconcellos ++ * ++ * Based on Gemtek GTWX5715 by ++ * Copyright (C) 2004 George T. Joseph ++ * Derived from Coyote ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version 2 ++ * of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* ++ * GPIO 2,3,4 and 9 are hard wired to the Micrel/Kendin KS8995M Switch ++ * and operate as an SPI type interface. The details of the interface ++ * are available on Kendin/Micrel's web site. ++ */ ++ ++#define MI424WR_KSSPI_SELECT 9 ++#define MI424WR_KSSPI_TXD 4 ++#define MI424WR_KSSPI_CLOCK 2 ++#define MI424WR_KSSPI_RXD 3 ++ ++/* ++ * The "reset" button is wired to GPIO 10. ++ * The GPIO is brought "low" when the button is pushed. ++ */ ++ ++#define MI424WR_BUTTON_GPIO 10 ++#define MI424WR_BUTTON_IRQ IRQ_IXP4XX_GPIO10 ++ ++#define MI424WR_MOCA_WAN_LED 11 ++ ++/* Latch on CS1 - taken from Actiontec's 2.4 source code ++ * ++ * default latch value ++ * 0 - power alarm led (red) 0 (off) ++ * 1 - power led (green) 0 (off) ++ * 2 - wireless led (green) 1 (off) ++ * 3 - no internet led (red) 0 (off) ++ * 4 - internet ok led (green) 0 (off) ++ * 5 - moca LAN 0 (off) ++ * 6 - WAN alarm led (red) 0 (off) ++ * 7 - PCI reset 1 (not reset) ++ * 8 - IP phone 1 led (green) 1 (off) ++ * 9 - IP phone 2 led (green) 1 (off) ++ * 10 - VOIP ready led (green) 1 (off) ++ * 11 - PSTN relay 1 control 0 (PSTN) ++ * 12 - PSTN relay 1 control 0 (PSTN) ++ * 13 - N/A ++ * 14 - N/A ++ * 15 - N/A ++ */ ++ ++#define MI424WR_LATCH_MASK 0x04 ++#define MI424WR_LATCH_DEFAULT 0x1f86 ++ ++#define MI424WR_LATCH_ALARM_LED 0x00 ++#define MI424WR_LATCH_POWER_LED 0x01 ++#define MI424WR_LATCH_WIRELESS_LED 0x02 ++#define MI424WR_LATCH_INET_DOWN_LED 0x03 ++#define MI424WR_LATCH_INET_OK_LED 0x04 ++#define MI424WR_LATCH_MOCA_LAN_LED 0x05 ++#define MI424WR_LATCH_WAN_ALARM_LED 0x06 ++#define MI424WR_LATCH_PCI_RESET 0x07 ++#define MI424WR_LATCH_PHONE1_LED 0x08 ++#define MI424WR_LATCH_PHONE2_LED 0x09 ++#define MI424WR_LATCH_VOIP_LED 0x10 ++#define MI424WR_LATCH_PSTN_RELAY1 0x11 ++#define MI424WR_LATCH_PSTN_RELAY2 0x12 ++ ++/* initialize CS1 to default timings, Intel style, 16-bit bus */ ++#define MI424WR_CS1_CONFIG 0x80000002 ++ ++/* Define both UARTs but they are not easily accessible. ++ */ ++ ++static struct resource mi424wr_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++ } ++}; ++ ++ ++static struct plat_serial8250_port mi424wr_uart_platform_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device mi424wr_uart_device = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = mi424wr_uart_platform_data, ++ .num_resources = ARRAY_SIZE(mi424wr_uart_resources), ++ .resource = mi424wr_uart_resources, ++}; ++ ++static struct flash_platform_data mi424wr_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource mi424wr_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device mi424wr_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev.platform_data = &mi424wr_flash_data, ++ .num_resources = 1, ++ .resource = &mi424wr_flash_resource, ++}; ++ ++static struct spi_gpio_platform_data mi424wr_spi_platform_data = { ++ .sck = MI424WR_KSSPI_CLOCK, ++ .mosi = MI424WR_KSSPI_TXD, ++ .miso = MI424WR_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device mi424wr_spi_device = { ++ .name = "spi-gpio", ++ .id = 1, ++ .dev.platform_data = &mi424wr_spi_platform_data, ++}; ++ ++static struct spi_board_info mi424wr_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 500000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)MI424WR_KSSPI_SELECT, ++ } ++}; ++ ++static struct gpio_led mi424wr_gpio_led[] = { ++ { ++ .name = "moca-wan", /* green led */ ++ .gpio = MI424WR_MOCA_WAN_LED, ++ .active_low = 0, ++ } ++}; ++ ++static struct gpio_led_platform_data mi424wr_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = mi424wr_gpio_led, ++}; ++ ++static struct platform_device mi424wr_gpio_leds = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &mi424wr_gpio_leds_data, ++}; ++ ++static uint16_t latch_value = MI424WR_LATCH_DEFAULT; ++static uint16_t __iomem *iobase; ++ ++static void mi424wr_latch_set_led(u8 bit, enum led_brightness value) ++{ ++ ++ if (((MI424WR_LATCH_MASK >> bit) & 1) ^ (value == LED_OFF)) ++ latch_value &= ~(0x1 << bit); ++ else ++ latch_value |= (0x1 << bit); ++ ++ __raw_writew(latch_value, iobase); ++ ++} ++ ++static struct latch_led mi424wr_latch_led[] = { ++ { ++ .name = "power-alarm", ++ .bit = MI424WR_LATCH_ALARM_LED, ++ }, ++ { ++ .name = "power-ok", ++ .bit = MI424WR_LATCH_POWER_LED, ++ }, ++ { ++ .name = "wireless", /* green led */ ++ .bit = MI424WR_LATCH_WIRELESS_LED, ++ }, ++ { ++ .name = "inet-down", /* red led */ ++ .bit = MI424WR_LATCH_INET_DOWN_LED, ++ }, ++ { ++ .name = "inet-up", /* green led */ ++ .bit = MI424WR_LATCH_INET_OK_LED, ++ }, ++ { ++ .name = "moca-lan", /* green led */ ++ .bit = MI424WR_LATCH_MOCA_LAN_LED, ++ }, ++ { ++ .name = "wan-alarm", /* red led */ ++ .bit = MI424WR_LATCH_WAN_ALARM_LED, ++ } ++}; ++ ++static struct latch_led_platform_data mi424wr_latch_leds_data = { ++ .num_leds = ARRAY_SIZE(mi424wr_latch_led), ++ .mem = 0x51000000, ++ .leds = mi424wr_latch_led, ++ .set_led = mi424wr_latch_set_led, ++}; ++ ++static struct platform_device mi424wr_latch_leds = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &mi424wr_latch_leds_data, ++}; ++ ++static struct eth_plat_info mi424wr_wan_data = { ++ .phy = 17, /* KS8721 */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info mi424wr_lan_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device mi424wr_npe_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_lan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_wan_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct eth_plat_info mi424wr_wanD_data = { ++ .phy = 5, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info mi424wr_lanD_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct platform_device mi424wr_npeD_devices[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &mi424wr_lanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &mi424wr_wanD_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *mi424wr_devices[] __initdata = { ++ &mi424wr_uart_device, ++ &mi424wr_flash, ++ &mi424wr_spi_device, ++ &mi424wr_gpio_leds, ++ &mi424wr_latch_leds, ++}; ++ ++static void __init mi424wr_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ mi424wr_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ mi424wr_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = MI424WR_CS1_CONFIG; ++ ++ /* configure button as input ++ */ ++ gpio_line_config(MI424WR_BUTTON_GPIO, IXP4XX_GPIO_IN); ++ ++ /* Initialize LEDs and enables PCI bus. ++ */ ++ iobase = ioremap_nocache(IXP4XX_EXP_BUS_BASE(1), 0x1000); ++ __raw_writew(latch_value, iobase); ++ ++ spi_register_board_info(mi424wr_spi_devices, ARRAY_SIZE(mi424wr_spi_devices)); ++ platform_add_devices(mi424wr_devices, ARRAY_SIZE(mi424wr_devices)); ++ ++ /* Need to figure out how to detect revD. ++ * Look for a revision argument sent by redboot. ++ */ ++#define revD 4 ++ if (system_rev == revD) { ++ platform_device_register(&mi424wr_npeD_devices[0]); ++ platform_device_register(&mi424wr_npeD_devices[1]); ++ } else { ++ platform_device_register(&mi424wr_npe_devices[0]); ++ platform_device_register(&mi424wr_npe_devices[1]); ++ } ++} ++ ++ ++MACHINE_START(MI424WR, "Actiontec MI424WR") ++ /* Maintainer: Jose Vasconcellos */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = mi424wr_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++ diff --git a/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch new file mode 100644 index 000000000..83a331926 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/190-cambria_support.patch @@ -0,0 +1,1131 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -21,6 +21,14 @@ config MACH_AVILA + Avila Network Platform. For more information on this platform, + see . + ++config MACH_CAMBRIA ++ bool "Cambria" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Gateworks ++ Cambria series. For more information on this platform, ++ see . ++ + config MACH_LOFT + bool "Loft" + depends on MACH_AVILA +@@ -218,7 +226,7 @@ config CPU_IXP46X + + config CPU_IXP43X + bool +- depends on MACH_KIXRP435 ++ depends on MACH_KIXRP435 || MACH_CAMBRIA + default y + + config MACH_GTWX5715 +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -7,6 +7,7 @@ obj-pci-n := + + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o ++obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o + obj-pci-$(CONFIG_MACH_IXDPG425) += ixdpg425-pci.o + obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o + obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o +@@ -31,6 +32,7 @@ obj-y += common.o + + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o ++obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o + obj-$(CONFIG_MACH_IXDPG425) += coyote-setup.o + obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o + obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-pci.c +@@ -0,0 +1,78 @@ ++/* ++ * arch/arch/mach-ixp4xx/cambria-pci.c ++ * ++ * PCI setup routines for Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++ ++extern void ixp4xx_pci_preinit(void); ++extern int ixp4xx_setup(int nr, struct pci_sys_data *sys); ++extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys); ++ ++void __init cambria_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init cambria_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else if (slot == 4) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 6) ++ return IRQ_IXP4XX_GPIO10; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ ++ else return -1; ++} ++ ++struct hw_pci cambria_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = cambria_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = cambria_map_irq, ++}; ++ ++int __init cambria_pci_init(void) ++{ ++ if (machine_is_cambria()) ++ pci_common_init(&cambria_pci); ++ return 0; ++} ++ ++subsys_initcall(cambria_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/cambria-setup.c +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-ixp4xx/cambria-setup.c ++ * ++ * Board setup for the Gateworks Cambria series ++ * ++ * Copyright (C) 2008 Imre Kaloz ++ * Copyright (C) 2012 Gateworks Corporation ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ * Tim Harvey ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) ++ ++struct cambria_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct cambria_board_info *cambria_info __initdata; ++ ++static struct flash_platform_data cambria_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource cambria_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device cambria_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_flash_resource, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_data = { ++ .sda_pin = 7, ++ .scl_pin = 6, ++}; ++ ++static struct platform_device cambria_i2c_gpio = { ++ .name = "i2c-gpio", ++ .id = 0, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_data, ++ }, ++}; ++ ++#ifdef SFP_SERIALID ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpa_data = { ++ .sda_pin = 113, ++ .scl_pin = 112, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpa = { ++ .name = "i2c-gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpa_data, ++ }, ++}; ++ ++static struct i2c_gpio_platform_data cambria_i2c_gpio_sfpb_data = { ++ .sda_pin = 115, ++ .scl_pin = 114, ++ .sda_is_open_drain = 0, ++ .scl_is_open_drain = 0, ++}; ++ ++static struct platform_device cambria_i2c_gpio_sfpb = { ++ .name = "i2c-gpio", ++ .id = 2, ++ .dev = { ++ .platform_data = &cambria_i2c_gpio_sfpb_data, ++ }, ++}; ++#endif // #ifdef SFP_SERIALID ++ ++static struct eth_plat_info cambria_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct eth_plat_info cambria_npea_data = { ++ .phy = 2, ++ .rxq = 2, ++ .txreadyq = 19, ++}; ++ ++static struct platform_device cambria_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &cambria_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device cambria_npea_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEA, ++ .dev.platform_data = &cambria_npea_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct resource cambria_uart_resource = { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port cambria_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = cambria_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &cambria_uart_resource, ++}; ++ ++static struct resource cambria_optional_uart_resources[] = { ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x52000000, ++ .end = 0x52000fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = 0x53000000, ++ .end = 0x53000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port cambria_optional_uart_data[] = { ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM_DELAY, ++ .regshift = 0, ++ .uartclk = 1843200, ++ .rw_delay = 10, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ }, ++ { }, ++}; ++ ++static struct platform_device cambria_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = cambria_optional_uart_data, ++ .num_resources = 2, ++ .resource = cambria_optional_uart_resources, ++}; ++ ++static struct resource cambria_pata_resources[] = { ++ { ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .name = "intrq", ++ .start = IRQ_IXP4XX_GPIO12, ++ .end = IRQ_IXP4XX_GPIO12, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct ixp4xx_pata_data cambria_pata_data = { ++ .cs0_bits = 0xbfff3c03, ++ .cs1_bits = 0xbfff3c03, ++}; ++ ++static struct platform_device cambria_pata = { ++ .name = "pata_ixp4xx_cf", ++ .id = 0, ++ .dev.platform_data = &cambria_pata_data, ++ .num_resources = ARRAY_SIZE(cambria_pata_resources), ++ .resource = cambria_pata_resources, ++}; ++ ++static struct gpio_led cambria_gpio_leds[] = { ++ { ++ .name = "user", ++ .gpio = 5, ++ .active_low = 1, ++ }, ++ { ++ .name = "user2", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user3", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "user4", ++ .gpio = 0, ++ .active_low = 1, ++ } ++}; ++ ++static struct gpio_led_platform_data cambria_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = cambria_gpio_leds, ++}; ++ ++static struct platform_device cambria_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_leds_data, ++}; ++ ++static struct resource cambria_gpio_resources[] = { ++ { ++ .name = "gpio", ++ .flags = 0, ++ }, ++}; ++ ++static struct gpio cambria_gpios_gw2350[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "ARM_DIO0" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 12, GPIOF_OUT_INIT_HIGH, "WDOGEN#" }, ++#endif ++ { 8, GPIOF_IN, "ARM_DIO8" }, ++ { 9, GPIOF_IN, "ARM_DIO9" }, ++}; ++ ++static struct gpio cambria_gpios_gw2358[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*VINLOW#" }, ++ { 2, GPIOF_IN, "*GPS_PPS" }, ++ { 3, GPIOF_IN, "*GPS_IRQ#" }, ++ { 4, GPIOF_IN, "*RS485_IRQ#" }, ++ { 5, GPIOF_IN, "*SER_EN#" }, ++ { 14, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++}; ++ ++static struct gpio cambria_gpios_gw2359[] = { ++ // ARM GPIO ++#if 0 // configured from bootloader ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 1, GPIOF_IN, "ARM_DIO1" }, ++ { 2, GPIOF_IN, "ARM_DIO2" }, ++ { 3, GPIOF_IN, "ARM_DIO3" }, ++ { 4, GPIOF_IN, "ARM_DIO4" }, ++ { 5, GPIOF_IN, "ARM_DIO5" }, ++ { 8, GPIOF_OUT_INIT_HIGH, "*WDOGEN#" }, ++#endif ++ { 11, GPIOF_OUT_INIT_HIGH, "*SER_EN" }, // console serial enable ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {103, GPIOF_OUT_INIT_HIGH, "*5V_EN" }, // 5V aux supply enable ++ {108, GPIOF_IN, "*SMUXDA0" }, ++ {109, GPIOF_IN, "*SMUXDA1" }, ++ {110, GPIOF_IN, "*SMUXDA2" }, ++ {111, GPIOF_IN, "*SMUXDB0" }, ++ {112, GPIOF_IN, "*SMUXDB1" }, ++ {113, GPIOF_IN, "*SMUXDB2" }, ++ // PCA GPIO ++ {118, GPIOF_IN, "*USIM2_DET#"}, // USIM2 Detect ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCI, 0=FP) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCI, 0=FP) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {123, GPIOF_OUT_INIT_HIGH, "*COM1_DTR#" }, // J21/J10 ++ {124, GPIOF_IN, "*COM1_DSR#" }, // J21/J10 ++ {127, GPIOF_IN, "PCA_DIO0" }, ++ {128, GPIOF_IN, "PCA_DIO1" }, ++ {129, GPIOF_IN, "PCA_DIO2" }, ++ {130, GPIOF_IN, "PCA_DIO3" }, ++ {131, GPIOF_IN, "PCA_DIO4" }, ++}; ++ ++static struct gpio cambria_gpios_gw2360[] = { ++ // ARM GPIO ++ { 0, GPIOF_IN, "*PCA_IRQ#" }, ++ { 11, GPIOF_OUT_INIT_LOW, "*SER0_EN#" }, ++ { 12, GPIOF_IN, "*GSC_IRQ#" }, ++ { 13, GPIOF_OUT_INIT_HIGH, "*PCIE_RST#"}, ++ // GSC GPIO ++#if !(IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ {100, GPIOF_IN, "*USER_PB#" }, ++#endif ++ {108, GPIOF_OUT_INIT_LOW, "*ENET1_EN#" }, // ENET1 TX Enable ++ {109, GPIOF_IN, "*ENET1_PRES#" }, // ENET1 Detect (0=SFP present) ++ {110, GPIOF_OUT_INIT_LOW, "*ENET2_EN#" }, // ENET2 TX Enable ++ {111, GPIOF_IN, "*ENET2_PRES#"}, // ENET2 Detect (0=SFP present) ++ // PCA GPIO ++ {116, GPIOF_OUT_INIT_HIGH, "*USIM2_LOC"}, // USIM2 Select (1=Loc, 0=Rem) ++ {117, GPIOF_IN, "*USIM2_DET_LOC#" },// USIM2 Detect (Local Slot) ++ {118, GPIOF_IN, "*USIM2_DET_REM#" },// USIM2 Detect (Remote Slot) ++ {120, GPIOF_OUT_INIT_LOW, "*USB1_PCI_SEL"}, // USB1 Select (1=PCIe1, 0=J1) ++ {121, GPIOF_OUT_INIT_LOW, "*USB2_PCI_SEL"}, // USB2 Select (1=PCIe2, 0=J1) ++ {122, GPIOF_IN, "*USIM1_DET#"}, // USIM1 Detect ++ {127, GPIOF_IN, "DIO0" }, ++ {128, GPIOF_IN, "DIO1" }, ++ {129, GPIOF_IN, "DIO2" }, ++ {130, GPIOF_IN, "DIO3" }, ++ {131, GPIOF_IN, "DIO4" }, ++}; ++ ++static struct latch_led cambria_latch_leds[] = { ++ { ++ .name = "ledA", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "ledB", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "ledC", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "ledD", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "ledE", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "ledF", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "ledG", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "ledH", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data cambria_latch_leds_data = { ++ .num_leds = 8, ++ .leds = cambria_latch_leds, ++ .mem = 0x53F40000, ++}; ++ ++static struct platform_device cambria_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &cambria_latch_leds_data, ++}; ++ ++static struct resource cambria_usb0_resources[] = { ++ { ++ .start = 0xCD000000, ++ .end = 0xCD000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 32, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct resource cambria_usb1_resources[] = { ++ { ++ .start = 0xCE000000, ++ .end = 0xCE000300, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = 33, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static u64 ehci_dma_mask = ~(u32)0; ++ ++static struct usb_ehci_pdata cambria_usb_pdata = { ++ .big_endian_desc = 1, ++ .big_endian_mmio = 1, ++ .has_tt = 1, ++ .caps_offset = 0x100, ++}; ++ ++static struct platform_device cambria_usb0_device = { ++ .name = "ehci-platform", ++ .id = 0, ++ .resource = cambria_usb0_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb0_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct platform_device cambria_usb1_device = { ++ .name = "ehci-platform", ++ .id = 1, ++ .resource = cambria_usb1_resources, ++ .num_resources = ARRAY_SIZE(cambria_usb1_resources), ++ .dev = { ++ .dma_mask = &ehci_dma_mask, ++ .coherent_dma_mask = 0xffffffff, ++ .platform_data = &cambria_usb_pdata, ++ }, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data0 = { ++ .gpio_base = 16, ++ .nr_gpio = 8, ++}; ++ ++static struct gw_i2c_pld_platform_data gw_i2c_pld_data1 = { ++ .gpio_base = 24, ++ .nr_gpio = 2, ++}; ++ ++ ++static struct gpio_keys_button cambria_gpio_buttons[] = { ++ { ++ .desc = "user", ++ .type = EV_KEY, ++ .code = BTN_0, ++ .debounce_interval = 6, ++ .gpio = 25, ++ } ++}; ++ ++static struct gpio_keys_platform_data cambria_gpio_buttons_data = { ++ .poll_interval = 500, ++ .nbuttons = 1, ++ .buttons = cambria_gpio_buttons, ++}; ++ ++static struct platform_device cambria_gpio_buttons_device = { ++ .name = "gpio-keys-polled", ++ .id = -1, ++ .dev.platform_data = &cambria_gpio_buttons_data, ++}; ++ ++static struct platform_device *cambria_devices[] __initdata = { ++ &cambria_i2c_gpio, ++ &cambria_flash, ++ &cambria_uart, ++}; ++ ++static int cambria_register_gpio(struct gpio *array, size_t num) ++{ ++ int i, err, ret; ++ ++ ret = 0; ++ for (i = 0; i < num; i++, array++) { ++ const char *label = array->label; ++ if (label[0] == '*') ++ label++; ++ err = gpio_request_one(array->gpio, array->flags, label); ++ if (err) ++ ret = err; ++ else { ++ err = gpio_export(array->gpio, array->label[0] != '*'); ++ } ++ } ++ return ret; ++} ++ ++static void __init cambria_gw23xx_setup(void) ++{ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++} ++ ++static void __init cambria_gw2350_setup(void) ++{ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x52FF0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52FF0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53FF0000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53FF0000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) |\ ++ (1 << 5) | (1 << 8) | (1 << 9) | (1 << 12); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2350)); ++} ++ ++static void __init cambria_gw2358_setup(void) ++{ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; // bit0 = 16bit vs 8bit bus ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[0].mapbase = 0x53FC0000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x53FC0000, 0x0fff); ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO3; ++ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ cambria_optional_uart_data[1].mapbase = 0x53F80000; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53F80000, 0x0fff); ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO4; ++ ++ cambria_gpio_resources[0].start = (1 << 14) | (1 << 16) | (1 << 17) | (1 << 18) |\ ++ (1 << 19) | (1 << 20) | (1 << 24) | (1 << 25); ++ cambria_gpio_resources[0].end = cambria_gpio_resources[0].start; ++ ++ platform_device_register(&cambria_optional_uart); ++ ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ platform_device_register(&cambria_pata); ++ ++ cambria_gpio_leds[0].gpio = 24; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++ platform_device_register(&cambria_latch_leds_device); ++ ++ platform_device_register(&cambria_gpio_buttons_device); ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2358)); ++} ++ ++static void __init cambria_gw2359_setup(void) ++{ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the genphy driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ // CPU NPE-C is in bridge bypass mode to Port4 PHY@0x14 ++ cambria_npec_data.phy = 0x14; ++#endif ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; // PNLLED1# ++ cambria_gpio_leds[1].gpio = 126; // PNLLED3# ++ cambria_gpio_leds[2].gpio = 119; // PNLLED4# ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2359)); ++} ++ ++static void __init cambria_gw2360_setup(void) ++{ ++ /* The GW2360 has 8 UARTs in addition to the 1 IXP4xxx UART. ++ * The chip-selects are expanded via a 3-to-8 decoder and CS2 ++ * and they are 8bit devices ++ */ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ cambria_optional_uart_data[0].mapbase = 0x52000000; ++ cambria_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ cambria_optional_uart_data[0].uartclk = 18432000; ++ cambria_optional_uart_data[0].iotype = UPIO_MEM; ++ cambria_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[1].mapbase = 0x52000008; ++ cambria_optional_uart_data[1].membase = (void __iomem *)ioremap(0x52000008, 0x0fff); ++ cambria_optional_uart_data[1].uartclk = 18432000; ++ cambria_optional_uart_data[1].iotype = UPIO_MEM; ++ cambria_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[2].mapbase = 0x52000010; ++ cambria_optional_uart_data[2].membase = (void __iomem *)ioremap(0x52000010, 0x0fff); ++ cambria_optional_uart_data[2].uartclk = 18432000; ++ cambria_optional_uart_data[2].iotype = UPIO_MEM; ++ cambria_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO4; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO4, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[3].mapbase = 0x52000018; ++ cambria_optional_uart_data[3].membase = (void __iomem *)ioremap(0x52000018, 0x0fff); ++ cambria_optional_uart_data[3].uartclk = 18432000; ++ cambria_optional_uart_data[3].iotype = UPIO_MEM; ++ cambria_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO5; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO5, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[4].mapbase = 0x52000020; ++ cambria_optional_uart_data[4].membase = (void __iomem *)ioremap(0x52000020, 0x0fff); ++ cambria_optional_uart_data[4].uartclk = 18432000; ++ cambria_optional_uart_data[4].iotype = UPIO_MEM; ++ cambria_optional_uart_data[4].irq = IRQ_IXP4XX_GPIO8; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[5].mapbase = 0x52000028; ++ cambria_optional_uart_data[5].membase = (void __iomem *)ioremap(0x52000028, 0x0fff); ++ cambria_optional_uart_data[5].uartclk = 18432000; ++ cambria_optional_uart_data[5].iotype = UPIO_MEM; ++ cambria_optional_uart_data[5].irq = IRQ_IXP4XX_GPIO9; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart_data[6].mapbase = 0x52000030; ++ cambria_optional_uart_data[6].membase = (void __iomem *)ioremap(0x52000030, 0x0fff); ++ cambria_optional_uart_data[6].uartclk = 18432000; ++ cambria_optional_uart_data[6].iotype = UPIO_MEM; ++ cambria_optional_uart_data[6].irq = IRQ_IXP4XX_GPIO10; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ ++ cambria_optional_uart.num_resources = 7, ++ platform_device_register(&cambria_optional_uart); ++ ++#if defined(CONFIG_MVSWITCH_PHY) || defined(CONFIG_MVSWITCH_PHY_MODULE) ++ /* The mvswitch driver has some hard-coded values which could ++ * easily be turned into a platform resource if needed. For now they ++ * match our hardware configuration: ++ * MV_BASE 0x10 - phy base address ++ * MV_WANPORT 0 - Port0 (ENET2) is WAN (SFP module) ++ * MV_CPUPORT 5 - Port5 is CPU NPEA (eth1) ++ * ++ * The mvswitch driver registers a fixup which forces a driver match ++ * if phy_addr matches MV_BASE ++ * ++ * Two static defautl VLAN's are created: WAN port in 1, and all other ports ++ * in the other. ++ */ ++ cambria_npea_data.phy = 0x10; // mvswitch driver catches this ++#else ++ // Switch Port5 to CPU is MII<->MII (no PHY) - this disables the generic PHY driver ++ cambria_npea_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++#endif ++ ++ // disable genphy autonegotiation on NPE-C PHY (eth1) as its 100BaseFX ++ //cambria_npec_data.noautoneg = 1; // disable autoneg ++ cambria_npec_data.speed_10 = 0; // 100mbps ++ cambria_npec_data.half_duplex = 0; // full-duplex ++ platform_device_register(&cambria_npec_device); ++ platform_device_register(&cambria_npea_device); ++ ++ platform_device_register(&cambria_usb0_device); ++ platform_device_register(&cambria_usb1_device); ++ ++ cambria_gpio_leds_data.num_leds = 3; ++ cambria_gpio_leds[0].name = "user1"; ++ cambria_gpio_leds[0].gpio = 125; ++ cambria_gpio_leds[1].gpio = 126; ++ cambria_gpio_leds[2].gpio = 119; ++ platform_device_register(&cambria_gpio_leds_device); ++ ++#if (IS_ENABLED(CONFIG_KEYBOARD_GPIO_POLLED)) ++ cambria_gpio_buttons[0].gpio = 100; ++ platform_device_register(&cambria_gpio_buttons_device); ++#endif ++ ++#ifdef SFP_SERIALID ++ /* the SFP modules each have an i2c bus for serial ident via GSC GPIO ++ * To use these the i2c-gpio driver must be changed to use the _cansleep ++ * varients of gpio_get_value/gpio_set_value (I don't know why it doesn't ++ * use that anyway as it doesn't operate in an IRQ context). ++ * Additionally the i2c-gpio module must set the gpio to output-high prior ++ * to changing direction to an input to enable internal Pullups ++ */ ++ platform_device_register(&cambria_i2c_gpio_sfpa); ++ platform_device_register(&cambria_i2c_gpio_sfpb); ++#endif ++ ++ /* gpio config (/sys/class/gpio) */ ++ cambria_register_gpio(ARRAY_AND_SIZE(cambria_gpios_gw2360)); ++} ++ ++static struct cambria_board_info cambria_boards[] __initdata = { ++ { ++ .model = "GW2350", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2351", ++ .setup = cambria_gw2350_setup, ++ }, { ++ .model = "GW2358", ++ .setup = cambria_gw2358_setup, ++ }, { ++ .model = "GW2359", ++ .setup = cambria_gw2359_setup, ++ }, { ++ .model = "GW2360", ++ .setup = cambria_gw2360_setup, ++ }, { ++ .model = "GW2371", ++ .setup = cambria_gw2358_setup, ++ } ++}; ++ ++static struct cambria_board_info * __init cambria_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(cambria_boards); i++) { ++ struct cambria_board_info *info = &cambria_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&cambria_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&cambria_npea_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ cambria_info = cambria_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data cambria_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++ .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data cambria_pca_data = { ++ .gpio_base = 100, ++ .irq_base = -1, ++}; ++ ++static struct pca953x_platform_data cambria_pca2_data = { ++ .gpio_base = 116, ++ .irq_base = -1, ++}; ++ ++static struct i2c_board_info __initdata cambria_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &cambria_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x27), ++ .platform_data = &cambria_pca2_data, ++ }, ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &cambria_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x56), ++ .platform_data = &gw_i2c_pld_data0, ++ }, ++ { ++ I2C_BOARD_INFO("gw_i2c_pld", 0x57), ++ .platform_data = &gw_i2c_pld_data1, ++ }, ++}; ++ ++static void __init cambria_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ cambria_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ cambria_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; // make sure window is writable ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ARRAY_AND_SIZE(cambria_devices)); ++ ++ cambria_pata_resources[0].start = 0x53e00000; ++ cambria_pata_resources[0].end = 0x53e3ffff; ++ ++ cambria_pata_resources[1].start = 0x53e40000; ++ cambria_pata_resources[1].end = 0x53e7ffff; ++ ++ cambria_pata_data.cs0_cfg = IXP4XX_EXP_CS3; ++ cambria_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ i2c_register_board_info(0, ARRAY_AND_SIZE(cambria_i2c_board_info)); ++} ++ ++static int __init cambria_model_setup(void) ++{ ++ if (!machine_is_cambria()) ++ return 0; ++ ++ if (cambria_info) { ++ printk(KERN_DEBUG "Running on Gateworks Cambria %s\n", ++ cambria_info->model); ++ cambria_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Cambria model number" ++ " -- defaults will be used\n"); ++ cambria_gw23xx_setup(); ++ } ++ ++ return 0; ++} ++late_initcall(cambria_model_setup); ++ ++MACHINE_START(CAMBRIA, "Gateworks Cambria series") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = cambria_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch new file mode 100644 index 000000000..f46b9c61b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/201-npe_driver_print_license_location.patch @@ -0,0 +1,11 @@ +--- a/arch/arm/mach-ixp4xx/ixp4xx_npe.c ++++ b/arch/arm/mach-ixp4xx/ixp4xx_npe.c +@@ -586,6 +586,8 @@ int npe_load_firmware(struct npe *npe, c + npe_reset(npe); + #endif + ++ print_npe(KERN_INFO, npe, "firmware's license can be found in /usr/share/doc/LICENSE.IPL\n"); ++ + print_npe(KERN_INFO, npe, "firmware functionality 0x%X, " + "revision 0x%X:%X\n", (image->id >> 16) & 0xFF, + (image->id >> 8) & 0xFF, image->id & 0xFF); diff --git a/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch new file mode 100644 index 000000000..cc77c5ddd --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/205-npe_driver_separate_phy_functions.patch @@ -0,0 +1,127 @@ +From e3eab80fb5d0a7d7fdb0f2f231b27161d5ec3804 Mon Sep 17 00:00:00 2001 +From: Jonas Gorski +Date: Sun, 30 Jun 2013 15:52:53 +0200 +Subject: [PATCH 23/36] 205-npe_driver_separate_phy_functions.patch + +--- + drivers/net/ethernet/xscale/ixp4xx_eth.c | 70 ++++++++++++++++++++++-------- + 1 file changed, 51 insertions(+), 19 deletions(-) + +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -588,6 +588,51 @@ static void ixp4xx_adjust_link(struct ne + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static int ixp4xx_phy_connect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct eth_plat_info *plat = port->plat; ++ char phy_id[MII_BUS_ID_SIZE + 3]; ++ ++ snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, ++ mdio_bus->id, plat->phy); ++ port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, ++ PHY_INTERFACE_MODE_MII); ++ if (IS_ERR(port->phydev)) { ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ return PTR_ERR(port->phydev); ++ } ++ ++ /* mask with MAC supported features */ ++ port->phydev->supported &= PHY_BASIC_FEATURES; ++ port->phydev->advertising = port->phydev->supported; ++ ++ port->phydev->irq = PHY_POLL; ++ ++ return 0; ++} ++ ++static void ixp4xx_phy_disconnect(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_disconnect(port->phydev); ++} ++ ++static void ixp4xx_phy_start(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ port->speed = 0; /* force "link up" message */ ++ phy_start(port->phydev); ++} ++ ++static void ixp4xx_phy_stop(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ ++ phy_stop(port->phydev); ++} + + static inline void debug_pkt(struct net_device *dev, const char *func, + u8 *data, int len) +@@ -1242,8 +1287,7 @@ static int eth_open(struct net_device *d + return err; + } + +- port->speed = 0; /* force "link up" message */ +- phy_start(dev->phydev); ++ ixp4xx_phy_start(dev); + + for (i = 0; i < ETH_ALEN; i++) + __raw_writel(dev->dev_addr[i], &port->regs->hw_addr[i]); +@@ -1364,7 +1408,7 @@ static int eth_close(struct net_device * + printk(KERN_CRIT "%s: unable to disable loopback\n", + dev->name); + +- phy_stop(dev->phydev); ++ ixp4xx_phy_stop(dev); + + if (!ports_open) + qmgr_disable_irq(TXDONE_QUEUE); +@@ -1391,7 +1435,6 @@ static int eth_init_one(struct platform_ + struct eth_plat_info *plat = dev_get_platdata(&pdev->dev); + struct phy_device *phydev = NULL; + u32 regs_phys; +- char phy_id[MII_BUS_ID_SIZE + 3]; + int err; + + if (!(dev = alloc_etherdev(sizeof(struct port)))) +@@ -1449,16 +1492,9 @@ static int eth_init_one(struct platform_ + __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); + udelay(50); + +- snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, +- mdio_bus->id, plat->phy); +- phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +- PHY_INTERFACE_MODE_MII); +- if (IS_ERR(phydev)) { +- err = PTR_ERR(phydev); ++ err = ixp4xx_phy_connect(dev); ++ if (err) + goto err_free_mem; +- } +- +- phydev->irq = PHY_POLL; + + if ((err = register_netdev(dev))) + goto err_phy_dis; +@@ -1469,7 +1505,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1487,7 +1523,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(phydev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch new file mode 100644 index 000000000..e12764e05 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/206-npe_driver_add_update_link_function.patch @@ -0,0 +1,100 @@ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -171,12 +171,13 @@ struct port { + struct npe *npe; + struct net_device *netdev; + struct napi_struct napi; ++ struct phy_device *phydev; + struct eth_plat_info *plat; + buffer_t *rx_buff_tab[RX_DESCS], *tx_buff_tab[TX_DESCS]; + struct desc *desc_tab; /* coherent */ + u32 desc_tab_phys; + int id; /* logical port ID */ +- int speed, duplex; ++ int link, speed, duplex; + u8 firmware[4]; + int hwts_tx_en; + int hwts_rx_en; +@@ -558,36 +559,46 @@ static void ixp4xx_mdio_remove(void) + } + + +-static void ixp4xx_adjust_link(struct net_device *dev) ++static void ixp4xx_update_link(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +- struct phy_device *phydev = dev->phydev; +- +- if (!phydev->link) { +- if (port->speed) { +- port->speed = 0; +- printk(KERN_INFO "%s: link down\n", dev->name); +- } +- return; +- } +- +- if (port->speed == phydev->speed && port->duplex == phydev->duplex) +- return; +- +- port->speed = phydev->speed; +- port->duplex = phydev->duplex; + +- if (port->duplex) ++ if (port->duplex == DUPLEX_FULL) + __raw_writel(DEFAULT_TX_CNTRL0 & ~TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + else + __raw_writel(DEFAULT_TX_CNTRL0 | TX_CNTRL0_HALFDUPLEX, + &port->regs->tx_control[0]); + ++ netif_carrier_on(dev); + printk(KERN_INFO "%s: link up, speed %u Mb/s, %s duplex\n", + dev->name, port->speed, port->duplex ? "full" : "half"); + } + ++static void ixp4xx_adjust_link(struct net_device *dev) ++{ ++ struct port *port = netdev_priv(dev); ++ struct phy_device *phydev = port->phydev; ++ int status_change = 0; ++ ++ if (phydev->link) { ++ if (port->duplex != phydev->duplex ++ || port->speed != phydev->speed) { ++ status_change = 1; ++ } ++ } ++ ++ if (phydev->link != port->link) ++ status_change = 1; ++ ++ port->link = phydev->link; ++ port->speed = phydev->speed; ++ port->duplex = phydev->duplex; ++ ++ if (status_change) ++ ixp4xx_update_link(dev); ++} ++ + static int ixp4xx_phy_connect(struct net_device *dev) + { + struct port *port = netdev_priv(dev); +@@ -623,7 +634,6 @@ static void ixp4xx_phy_start(struct net_ + { + struct port *port = netdev_priv(dev); + +- port->speed = 0; /* force "link up" message */ + phy_start(port->phydev); + } + +@@ -1499,6 +1509,10 @@ static int eth_init_one(struct platform_ + if ((err = register_netdev(dev))) + goto err_phy_dis; + ++ port->link = 0; ++ port->speed = 0; ++ port->duplex = -1; ++ + printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy, + npe_name(port->npe)); + diff --git a/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch new file mode 100644 index 000000000..a23644a16 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/207-npe_driver_multiphy_support.patch @@ -0,0 +1,153 @@ +TODO: take care of additional PHYs through the PHY abstraction layer + +--- a/arch/arm/mach-ixp4xx/include/mach/platform.h ++++ b/arch/arm/mach-ixp4xx/include/mach/platform.h +@@ -95,12 +95,23 @@ struct ixp4xx_pata_data { + #define IXP4XX_ETH_NPEB 0x10 + #define IXP4XX_ETH_NPEC 0x20 + ++#define IXP4XX_ETH_PHY_MAX_ADDR 32 ++ + /* Information about built-in Ethernet MAC interfaces */ + struct eth_plat_info { + u8 phy; /* MII PHY ID, 0 - 31 */ + u8 rxq; /* configurable, currently 0 - 31 only */ + u8 txreadyq; + u8 hwaddr[6]; ++ ++ u32 phy_mask; ++#if 0 ++ int speed; ++ int duplex; ++#else ++ int speed_10; ++ int half_duplex; ++#endif + }; + + /* Information about built-in HSS (synchronous serial) interfaces */ +--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c ++++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c +@@ -605,6 +605,37 @@ static int ixp4xx_phy_connect(struct net + struct eth_plat_info *plat = port->plat; + char phy_id[MII_BUS_ID_SIZE + 3]; + ++ if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) { ++#if 0 ++ switch (plat->speed) { ++ case SPEED_10: ++ case SPEED_100: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid speed (%d)\n", ++ dev->name, plat->speed); ++ return -EINVAL; ++ } ++ ++ switch (plat->duplex) { ++ case DUPLEX_HALF: ++ case DUPLEX_FULL: ++ break; ++ default: ++ printk(KERN_ERR "%s: invalid duplex mode (%d)\n", ++ dev->name, plat->duplex); ++ return -EINVAL; ++ } ++ port->speed = plat->speed; ++ port->duplex = plat->duplex; ++#else ++ port->speed = plat->speed_10 ? SPEED_10 : SPEED_100; ++ port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL; ++#endif ++ ++ return 0; ++ } ++ + snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, + mdio_bus->id, plat->phy); + port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, +@@ -627,21 +658,32 @@ static void ixp4xx_phy_disconnect(struct + { + struct port *port = netdev_priv(dev); + +- phy_disconnect(port->phydev); ++ if (port->phydev) ++ phy_disconnect(port->phydev); + } + + static void ixp4xx_phy_start(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_start(port->phydev); ++ if (port->phydev) { ++ phy_start(port->phydev); ++ } else { ++ port->link = 1; ++ ixp4xx_update_link(dev); ++ } + } + + static void ixp4xx_phy_stop(struct net_device *dev) + { + struct port *port = netdev_priv(dev); + +- phy_stop(port->phydev); ++ if (port->phydev) { ++ phy_stop(port->phydev); ++ } else { ++ port->link = 0; ++ ixp4xx_update_link(dev); ++ } + } + + static inline void debug_pkt(struct net_device *dev, const char *func, +@@ -1030,6 +1072,8 @@ static void eth_set_mcast_list(struct ne + + static int eth_ioctl(struct net_device *dev, struct ifreq *req, int cmd) + { ++ struct port *port = netdev_priv(dev); ++ + if (!netif_running(dev)) + return -EINVAL; + +@@ -1040,6 +1084,9 @@ static int eth_ioctl(struct net_device * + return hwtstamp_get(dev, req); + } + ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_mii_ioctl(dev->phydev, req, cmd); + } + +@@ -1059,6 +1106,11 @@ static void ixp4xx_get_drvinfo(struct ne + + static int ixp4xx_nway_reset(struct net_device *dev) + { ++ struct port *port = netdev_priv(dev); ++ ++ if (!port->phydev) ++ return -EOPNOTSUPP; ++ + return phy_start_aneg(dev->phydev); + } + +@@ -1519,7 +1571,7 @@ static int eth_init_one(struct platform_ + return 0; + + err_phy_dis: +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + err_free_mem: + npe_port_tab[NPE_ID(port->id)] = NULL; + release_resource(port->mem_res); +@@ -1537,7 +1589,7 @@ static int eth_remove_one(struct platfor + struct port *port = netdev_priv(dev); + + unregister_netdev(dev); +- ixp4xx_phy_disconnect(phydev); ++ ixp4xx_phy_disconnect(port->netdev); + npe_port_tab[NPE_ID(port->id)] = NULL; + npe_release(port->npe); + release_resource(port->mem_res); diff --git a/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch new file mode 100644 index 000000000..66bc3e86b --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/295-latch_led_driver.patch @@ -0,0 +1,201 @@ +--- a/drivers/leds/Kconfig ++++ b/drivers/leds/Kconfig +@@ -312,6 +312,12 @@ config LEDS_LP8860 + on the LP8860 4 channel LED driver using the I2C communication + bus. + ++config LEDS_LATCH ++ tristate "LED Support for Memory Latched LEDs" ++ depends on LEDS_CLASS ++ help ++ -- To Do -- ++ + config LEDS_CLEVO_MAIL + tristate "Mail LED on Clevo notebook" + depends on LEDS_CLASS +--- a/drivers/leds/Makefile ++++ b/drivers/leds/Makefile +@@ -25,6 +25,7 @@ obj-$(CONFIG_LEDS_SUNFIRE) += leds-sunf + obj-$(CONFIG_LEDS_PCA9532) += leds-pca9532.o + obj-$(CONFIG_LEDS_GPIO_REGISTER) += leds-gpio-register.o + obj-$(CONFIG_LEDS_GPIO) += leds-gpio.o ++obj-$(CONFIG_LEDS_LATCH) += leds-latch.o + obj-$(CONFIG_LEDS_LP3944) += leds-lp3944.o + obj-$(CONFIG_LEDS_LP3952) += leds-lp3952.o + obj-$(CONFIG_LEDS_LP55XX_COMMON) += leds-lp55xx-common.o +--- /dev/null ++++ b/drivers/leds/leds-latch.c +@@ -0,0 +1,152 @@ ++/* ++ * LEDs driver for Memory Latched Devices ++ * ++ * Copyright (C) 2008 Gateworks Corp. ++ * Chris Lang ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static unsigned int mem_keep = 0xFF; ++static spinlock_t mem_lock; ++static unsigned char *iobase; ++ ++struct latch_led_data { ++ struct led_classdev cdev; ++ struct work_struct work; ++ u8 new_level; ++ u8 bit; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ ++static void latch_set_led(u8 bit, enum led_brightness value) ++{ ++ if (value == LED_OFF) ++ mem_keep |= (0x1 << bit); ++ else ++ mem_keep &= ~(0x1 << bit); ++ ++ writeb(mem_keep, iobase); ++} ++ ++static void latch_led_set(struct led_classdev *led_cdev, ++ enum led_brightness value) ++{ ++ struct latch_led_data *led_dat = ++ container_of(led_cdev, struct latch_led_data, cdev); ++ ++ raw_spin_lock(mem_lock); ++ ++ led_dat->set_led(led_dat->bit, value); ++ ++ raw_spin_unlock(mem_lock); ++} ++ ++static int latch_led_probe(struct platform_device *pdev) ++{ ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led *cur_led; ++ struct latch_led_data *leds_data, *led_dat; ++ int i, ret = 0; ++ ++ if (!pdata) ++ return -EBUSY; ++ ++ leds_data = kzalloc(sizeof(struct latch_led_data) * pdata->num_leds, ++ GFP_KERNEL); ++ if (!leds_data) ++ return -ENOMEM; ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ cur_led = &pdata->leds[i]; ++ led_dat = &leds_data[i]; ++ ++ led_dat->cdev.name = cur_led->name; ++ led_dat->cdev.default_trigger = cur_led->default_trigger; ++ led_dat->cdev.brightness_set = latch_led_set; ++ led_dat->cdev.brightness = LED_OFF; ++ led_dat->bit = cur_led->bit; ++ led_dat->set_led = pdata->set_led ? pdata->set_led : latch_set_led; ++ ++ ret = led_classdev_register(&pdev->dev, &led_dat->cdev); ++ if (ret < 0) { ++ goto err; ++ } ++ } ++ ++ if (!pdata->set_led) { ++ iobase = ioremap_nocache(pdata->mem, 0x1000); ++ writeb(0xFF, iobase); ++ } ++ platform_set_drvdata(pdev, leds_data); ++ ++ return 0; ++ ++err: ++ if (i > 0) { ++ for (i = i - 1; i >= 0; i--) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ } ++ } ++ ++ kfree(leds_data); ++ ++ return ret; ++} ++ ++static int latch_led_remove(struct platform_device *pdev) ++{ ++ int i; ++ struct latch_led_platform_data *pdata = pdev->dev.platform_data; ++ struct latch_led_data *leds_data; ++ ++ leds_data = platform_get_drvdata(pdev); ++ ++ for (i = 0; i < pdata->num_leds; i++) { ++ led_classdev_unregister(&leds_data[i].cdev); ++ cancel_work_sync(&leds_data[i].work); ++ } ++ ++ kfree(leds_data); ++ ++ return 0; ++} ++ ++static struct platform_driver latch_led_driver = { ++ .probe = latch_led_probe, ++ .remove = latch_led_remove, ++ .driver = { ++ .name = "leds-latch", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init latch_led_init(void) ++{ ++ return platform_driver_register(&latch_led_driver); ++} ++ ++static void __exit latch_led_exit(void) ++{ ++ platform_driver_unregister(&latch_led_driver); ++} ++ ++module_init(latch_led_init); ++module_exit(latch_led_exit); ++ ++MODULE_AUTHOR("Chris Lang "); ++MODULE_DESCRIPTION("Latch LED driver"); +--- a/include/linux/leds.h ++++ b/include/linux/leds.h +@@ -423,4 +423,18 @@ static inline void ledtrig_cpu(enum cpu_ + } + #endif + ++/* For the leds-latch driver */ ++struct latch_led { ++ const char *name; ++ char *default_trigger; ++ unsigned bit; ++}; ++ ++struct latch_led_platform_data { ++ int num_leds; ++ u32 mem; ++ struct latch_led *leds; ++ void (*set_led)(u8 bit, enum led_brightness value); ++}; ++ + #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/target/linux/ixp4xx/patches-4.9/300-avila_support.patch b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch new file mode 100644 index 000000000..c801607f4 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/300-avila_support.patch @@ -0,0 +1,726 @@ +--- a/arch/arm/mach-ixp4xx/avila-pci.c ++++ b/arch/arm/mach-ixp4xx/avila-pci.c +@@ -27,8 +27,8 @@ + #include + #include + +-#define AVILA_MAX_DEV 4 +-#define LOFT_MAX_DEV 6 ++#define AVILA_MAX_DEV 6 ++ + #define IRQ_LINES 4 + + /* PCI controller GPIO to IRQ pin mappings */ +@@ -55,10 +55,8 @@ static int __init avila_map_irq(const st + IXP4XX_GPIO_IRQ(INTD) + }; + +- if (slot >= 1 && +- slot <= (machine_is_loft() ? LOFT_MAX_DEV : AVILA_MAX_DEV) && +- pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ if (slot >= 1 && slot <= AVILA_MAX_DEV && pin >= 1 && pin <= IRQ_LINES) ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/avila-setup.c ++++ b/arch/arm/mach-ixp4xx/avila-setup.c +@@ -14,9 +14,16 @@ + #include + #include + #include ++#include ++#include ++#include + #include + #include + #include ++#include ++#include ++#include ++#include + #include + #include + #include +@@ -26,10 +33,25 @@ + #include + #include + #include ++#include + + #define AVILA_SDA_PIN 7 + #define AVILA_SCL_PIN 6 + ++/* User LEDs */ ++#define AVILA_GW23XX_LED_USER_GPIO 3 ++#define AVILA_GW23X7_LED_USER_GPIO 4 ++ ++/* gpio mask used by platform device */ ++#define AVILA_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) | (1 << 9) ++ ++struct avila_board_info { ++ unsigned char *model; ++ void (*setup)(void); ++}; ++ ++static struct avila_board_info *avila_info __initdata; ++ + static struct flash_platform_data avila_flash_data = { + .map_name = "cfi_probe", + .width = 2, +@@ -105,14 +127,69 @@ static struct platform_device avila_uart + .resource = avila_uart_resources + }; + +-static struct resource avila_pata_resources[] = { ++static struct resource avila_optional_uart_resources[] = { + { +- .flags = IORESOURCE_MEM +- }, ++ .start = 0x54000000, ++ .end = 0x54000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x55000000, ++ .end = 0x55000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x56000000, ++ .end = 0x56000fff, ++ .flags = IORESOURCE_MEM ++ },{ ++ .start = 0x57000000, ++ .end = 0x57000fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port avila_optional_uart_data[] = { + { +- .flags = IORESOURCE_MEM, ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, ++ },{ ++ .flags = UPF_BOOT_AUTOCONF, ++ .iotype = UPIO_MEM, ++ .regshift = 0, ++ .uartclk = 18432000, ++ .rw_delay = 2, + }, ++ { } ++}; ++ ++static struct platform_device avila_optional_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM1, ++ .dev.platform_data = avila_optional_uart_data, ++ .num_resources = 4, ++ .resource = avila_optional_uart_resources, ++}; ++ ++static struct resource avila_pata_resources[] = { + { ++ .flags = IORESOURCE_MEM ++ },{ ++ .flags = IORESOURCE_MEM, ++ },{ + .name = "intrq", + .start = IRQ_IXP4XX_GPIO12, + .end = IRQ_IXP4XX_GPIO12, +@@ -133,21 +210,237 @@ static struct platform_device avila_pata + .resource = avila_pata_resources, + }; + ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info avila_npeb_data = { ++ .phy = 0, ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info avila_npec_data = { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device avila_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = &avila_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device avila_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = &avila_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct gpio_led avila_gpio_leds[] = { ++ { ++ .name = "user", /* green led */ ++ .gpio = AVILA_GW23XX_LED_USER_GPIO, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio1", /* green led */ ++ .gpio = 104, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio2", /* green led */ ++ .gpio = 105, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio3", /* green led */ ++ .gpio = 106, ++ .active_low = 1, ++ }, ++ { ++ .name = "radio4", /* green led */ ++ .gpio = 107, ++ .active_low = 1, ++ }, ++ ++}; ++ ++static struct gpio_led_platform_data avila_gpio_leds_data = { ++ .num_leds = 1, ++ .leds = avila_gpio_leds, ++}; ++ ++static struct platform_device avila_gpio_leds_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &avila_gpio_leds_data, ++}; ++ ++static struct latch_led avila_latch_leds[] = { ++ { ++ .name = "led0", /* green led */ ++ .bit = 0, ++ }, ++ { ++ .name = "led1", /* green led */ ++ .bit = 1, ++ }, ++ { ++ .name = "led2", /* green led */ ++ .bit = 2, ++ }, ++ { ++ .name = "led3", /* green led */ ++ .bit = 3, ++ }, ++ { ++ .name = "led4", /* green led */ ++ .bit = 4, ++ }, ++ { ++ .name = "led5", /* green led */ ++ .bit = 5, ++ }, ++ { ++ .name = "led6", /* green led */ ++ .bit = 6, ++ }, ++ { ++ .name = "led7", /* green led */ ++ .bit = 7, ++ } ++}; ++ ++static struct latch_led_platform_data avila_latch_leds_data = { ++ .num_leds = 8, ++ .leds = avila_latch_leds, ++ .mem = 0x51000000, ++}; ++ ++static struct platform_device avila_latch_leds_device = { ++ .name = "leds-latch", ++ .id = -1, ++ .dev.platform_data = &avila_latch_leds_data, ++}; ++ + static struct platform_device *avila_devices[] __initdata = { + &avila_i2c_gpio, +- &avila_flash, + &avila_uart + }; + +-static void __init avila_init(void) ++/* ++ * Audio Devices ++ */ ++ ++static struct platform_device avila_hss_device[] = { ++ { ++ .name = "gw_avila_hss", ++ .id = 0, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 1, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 2, ++ },{ ++ .name = "gw_avila_hss", ++ .id = 3, ++ }, ++}; ++ ++static struct platform_device avila_pcm_device[] = { ++ { ++ .name = "gw_avila-audio", ++ .id = 0, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 1, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 2, ++ },{ ++ .name = "gw_avila-audio", ++ .id = 3, ++ } ++}; ++ ++static void setup_audio_devices(void) { ++ platform_device_register(&avila_hss_device[0]); ++ platform_device_register(&avila_hss_device[1]); ++ platform_device_register(&avila_hss_device[2]); ++ platform_device_register(&avila_hss_device[3]); ++ ++ platform_device_register(&avila_pcm_device[0]); ++ platform_device_register(&avila_pcm_device[1]); ++ platform_device_register(&avila_pcm_device[2]); ++ platform_device_register(&avila_pcm_device[3]); ++} ++ ++static void __init avila_gw23xx_setup(void) + { +- ixp4xx_sys_init(); ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); + +- avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); +- avila_flash_resource.end = +- IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ platform_device_register(&avila_gpio_leds_device); ++} + +- platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++static void __init avila_gw2342_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2345_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 5; /* port 5 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2347_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2348_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_npec_device); ++ ++ platform_device_register(&avila_gpio_leds_device); + + avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); + avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); +@@ -159,8 +452,335 @@ static void __init avila_init(void) + avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; + + platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2353_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ platform_device_register(&avila_gpio_leds_device); ++} ++ ++static void __init avila_gw2355_setup(void) ++{ ++ avila_npeb_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npeb_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 16; ++ platform_device_register(&avila_npec_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS4 |= 0xbfff3c03; ++ avila_latch_leds[0].name = "RXD"; ++ avila_latch_leds[1].name = "TXD"; ++ avila_latch_leds[2].name = "POL"; ++ avila_latch_leds[3].name = "LNK"; ++ avila_latch_leds[4].name = "ERR"; ++ avila_latch_leds_data.num_leds = 5; ++ avila_latch_leds_data.mem = 0x54000000; ++ platform_device_register(&avila_latch_leds_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(1); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(1); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS1; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS2; ++ ++ platform_device_register(&avila_pata); ++} ++ ++static void __init avila_gw2357_setup(void) ++{ ++ platform_device_register(&avila_npeb_device); ++ ++ avila_gpio_leds[0].gpio = AVILA_GW23X7_LED_USER_GPIO; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ *IXP4XX_EXP_CS1 |= 0xbfff3c03; ++ platform_device_register(&avila_latch_leds_device); ++} ++ ++static void __init avila_gw2365_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS4 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO0, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x54000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x54000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO0; ++ ++ *IXP4XX_EXP_CS5 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO1, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x55000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x55000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO1; ++ ++ *IXP4XX_EXP_CS6 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[2].mapbase = 0x56000000; ++ avila_optional_uart_data[2].membase = (void __iomem *)ioremap(0x56000000, 0x0fff); ++ avila_optional_uart_data[2].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS7 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[3].mapbase = 0x57000000; ++ avila_optional_uart_data[3].membase = (void __iomem *)ioremap(0x57000000, 0x0fff); ++ avila_optional_uart_data[3].irq = IRQ_IXP4XX_GPIO3; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ avila_pata_resources[0].start = IXP4XX_EXP_BUS_BASE(2); ++ avila_pata_resources[0].end = IXP4XX_EXP_BUS_END(2); ++ ++ avila_pata_resources[1].start = IXP4XX_EXP_BUS_BASE(3); ++ avila_pata_resources[1].end = IXP4XX_EXP_BUS_END(3); ++ ++ avila_pata_data.cs0_cfg = IXP4XX_EXP_CS2; ++ avila_pata_data.cs1_cfg = IXP4XX_EXP_CS3; ++ ++ platform_device_register(&avila_pata); ++ ++ avila_gpio_leds[0].gpio = 109; ++ avila_gpio_leds_data.num_leds = 5; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2369_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2370_setup(void) ++{ ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ avila_npeb_data.phy = 5; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = IXP4XX_ETH_PHY_MAX_ADDR; ++ avila_npec_data.phy_mask = 0x1e; /* ports 1-4 of the KS8995 switch */ ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO2, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO2; ++ ++ *IXP4XX_EXP_CS3 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO3, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[1].mapbase = 0x53000000; ++ avila_optional_uart_data[1].membase = (void __iomem *)ioremap(0x53000000, 0x0fff); ++ avila_optional_uart_data[1].irq = IRQ_IXP4XX_GPIO3; ++ ++ avila_optional_uart.num_resources = 2; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ avila_gpio_leds[0].gpio = 101; ++ platform_device_register(&avila_gpio_leds_device); ++ ++ setup_audio_devices(); ++} ++ ++static void __init avila_gw2375_setup(void) ++{ ++ avila_npeb_data.phy = 1; ++ platform_device_register(&avila_npeb_device); ++ ++ avila_npec_data.phy = 2; ++ platform_device_register(&avila_npec_device); ++ ++ *IXP4XX_EXP_CS2 = 0xBFFF3C43; ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_EDGE_RISING); ++ avila_optional_uart_data[0].mapbase = 0x52000000; ++ avila_optional_uart_data[0].membase = (void __iomem *)ioremap(0x52000000, 0x0fff); ++ avila_optional_uart_data[0].irq = IRQ_IXP4XX_GPIO10; ++ ++ avila_optional_uart.num_resources = 1; ++ ++ platform_device_register(&avila_optional_uart); ++ ++ setup_audio_devices(); ++} ++ ++ ++static struct avila_board_info avila_boards[] __initdata = { ++ { ++ .model = "GW2342", ++ .setup = avila_gw2342_setup, ++ }, { ++ .model = "GW2345", ++ .setup = avila_gw2345_setup, ++ }, { ++ .model = "GW2347", ++ .setup = avila_gw2347_setup, ++ }, { ++ .model = "GW2348", ++ .setup = avila_gw2348_setup, ++ }, { ++ .model = "GW2353", ++ .setup = avila_gw2353_setup, ++ }, { ++ .model = "GW2355", ++ .setup = avila_gw2355_setup, ++ }, { ++ .model = "GW2357", ++ .setup = avila_gw2357_setup, ++ }, { ++ .model = "GW2365", ++ .setup = avila_gw2365_setup, ++ }, { ++ .model = "GW2369", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2370", ++ .setup = avila_gw2370_setup, ++ }, { ++ .model = "GW2373", ++ .setup = avila_gw2369_setup, ++ }, { ++ .model = "GW2375", ++ .setup = avila_gw2375_setup, ++ } ++}; ++ ++static struct avila_board_info * __init avila_find_board_info(char *model) ++{ ++ int i; ++ model[6] = '\0'; ++ ++ for (i = 0; i < ARRAY_SIZE(avila_boards); i++) { ++ struct avila_board_info *info = &avila_boards[i]; ++ if (strcmp(info->model, model) == 0) ++ return info; ++ } ++ ++ return NULL; ++} ++ ++static struct nvmem_device *at24_nvmem; ++ ++static void at24_setup(struct nvmem_device *mem_acc, void *context) ++{ ++ char mac_addr[ETH_ALEN]; ++ char model[7]; ++ ++ at24_nvmem = mem_acc; ++ ++ /* Read MAC addresses */ ++ if (nvmem_device_read(at24_nvmem, 0x0, 6, mac_addr) == 6) { ++ memcpy(&avila_npeb_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ if (nvmem_device_read(at24_nvmem, 0x6, 6, mac_addr) == 6) { ++ memcpy(&avila_npec_data.hwaddr, mac_addr, ETH_ALEN); ++ } ++ ++ /* Read the first 6 bytes of the model number */ ++ if (nvmem_device_read(at24_nvmem, 0x20, 6, model) == 6) { ++ avila_info = avila_find_board_info(model); ++ } ++ ++} ++ ++static struct at24_platform_data avila_eeprom_info = { ++ .byte_len = 1024, ++ .page_size = 16, ++// .flags = AT24_FLAG_READONLY, ++ .setup = at24_setup, ++}; ++ ++static struct pca953x_platform_data avila_pca_data = { ++ .gpio_base = 100, ++}; ++ ++static struct i2c_board_info __initdata avila_i2c_board_info[] = { ++ { ++ I2C_BOARD_INFO("ds1672", 0x68), ++ }, ++ { ++ I2C_BOARD_INFO("gsp", 0x29), ++ }, ++ { ++ I2C_BOARD_INFO("pca9555", 0x23), ++ .platform_data = &avila_pca_data, ++ }, ++ { ++ I2C_BOARD_INFO("ad7418", 0x28), ++ }, ++ { ++ I2C_BOARD_INFO("24c08", 0x51), ++ .platform_data = &avila_eeprom_info ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1b), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x1a), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x19), ++ }, ++ { ++ I2C_BOARD_INFO("tlv320aic33", 0x18), ++ }, ++}; ++ ++static void __init avila_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ platform_add_devices(avila_devices, ARRAY_SIZE(avila_devices)); ++ ++ i2c_register_board_info(0, avila_i2c_board_info, ++ ARRAY_SIZE(avila_i2c_board_info)); ++} ++ ++static int __init avila_model_setup(void) ++{ ++ if (!machine_is_avila()) ++ return 0; ++ ++ /* default 16MB flash */ ++ avila_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ avila_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ if (avila_info) { ++ printk(KERN_DEBUG "Running on Gateworks Avila %s\n", ++ avila_info->model); ++ avila_info->setup(); ++ } else { ++ printk(KERN_INFO "Unknown/missing Avila model number" ++ " -- defaults will be used\n"); ++ avila_gw23xx_setup(); ++ } ++ platform_device_register(&avila_flash); + ++ return 0; + } ++late_initcall(avila_model_setup); + + MACHINE_START(AVILA, "Gateworks Avila Network Platform") + /* Maintainer: Deepak Saxena */ diff --git a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch similarity index 90% rename from target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch rename to target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch index b16086bbc..108fbcb37 100644 --- a/target/linux/ixp4xx/patches-4.4/304-ixp4xx_eth_jumboframe.patch +++ b/target/linux/ixp4xx/patches-4.9/304-ixp4xx_eth_jumboframe.patch @@ -9,7 +9,7 @@ #define RX_BUFF_SIZE ALIGN((NET_IP_ALIGN) + MAX_MRU, 4) #define NAPI_WEIGHT 16 -@@ -1315,6 +1315,32 @@ static void destroy_queues(struct port * +@@ -1289,6 +1289,32 @@ static void destroy_queues(struct port * } } @@ -42,7 +42,7 @@ static int eth_open(struct net_device *dev) { struct port *port = netdev_priv(dev); -@@ -1366,6 +1392,8 @@ static int eth_open(struct net_device *d +@@ -1340,6 +1366,8 @@ static int eth_open(struct net_device *d if (npe_send_recv_message(port->npe, &msg, "ETH_SET_FIREWALL_MODE")) return -EIO; @@ -51,7 +51,7 @@ if ((err = request_queues(port)) != 0) return err; -@@ -1505,7 +1533,26 @@ static int eth_close(struct net_device * +@@ -1479,7 +1507,26 @@ static int eth_close(struct net_device * return 0; } diff --git a/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch new file mode 100644 index 000000000..51f3f1451 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/310-gtwx5717_spi_bus.patch @@ -0,0 +1,57 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -27,6 +27,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -146,9 +148,37 @@ static struct platform_device gtwx5715_f + .resource = >wx5715_flash_resource, + }; + ++static struct spi_gpio_platform_data gtwx5715_spi_platform_data = { ++ .sck = GTWX5715_KSSPI_CLOCK, ++ .mosi = GTWX5715_KSSPI_TXD, ++ .miso = GTWX5715_KSSPI_RXD, ++ .num_chipselect = 1, ++}; ++ ++static struct platform_device gtwx5715_spi_device = { ++ .name = "spi_gpio", ++ .id = 1, ++ .dev = { ++ .platform_data = >wx5715_spi_platform_data, ++ } ++}; ++ ++static struct spi_board_info gtwx5715_spi_devices[] __initdata = { ++ { ++ .modalias = "spi-ks8995", ++ .max_speed_hz = 5000000, ++ .mode = SPI_MODE_0, ++ .bus_num = 1, ++ .chip_select = 0, ++ .controller_data = (void *)GTWX5715_KSSPI_SELECT, ++ } ++}; ++ ++ + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, ++ >wx5715_spi_device, + }; + + static void __init gtwx5715_init(void) +@@ -158,6 +188,7 @@ static void __init gtwx5715_init(void) + gtwx5715_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); + gtwx5715_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_8M - 1; + ++ spi_register_board_info(gtwx5715_spi_devices, ARRAY_SIZE(gtwx5715_spi_devices)); + platform_add_devices(gtwx5715_devices, ARRAY_SIZE(gtwx5715_devices)); + } + diff --git a/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch new file mode 100644 index 000000000..85a8f162c --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/311-gtwx5717_mac_plat_info.patch @@ -0,0 +1,50 @@ +--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c ++++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c +@@ -29,6 +29,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -174,11 +175,39 @@ static struct spi_board_info gtwx5715_sp + } + }; + ++static struct eth_plat_info gtwx5715_npeb_data = { ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x1e, /* ports 1-4 of the KS8995 switch */ ++ .rxq = 3, ++ .txreadyq = 20, ++}; ++ ++static struct eth_plat_info gtwx5715_npec_data = { ++ .phy = 5, /* port 5 of the KS8995 switch */ ++ .rxq = 4, ++ .txreadyq = 21, ++}; ++ ++static struct platform_device gtwx5715_npeb_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = >wx5715_npeb_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; ++ ++static struct platform_device gtwx5715_npec_device = { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = >wx5715_npec_data, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++}; + + static struct platform_device *gtwx5715_devices[] __initdata = { + >wx5715_uart_device, + >wx5715_flash, + >wx5715_spi_device, ++ >wx5715_npeb_device, ++ >wx5715_npec_device, + }; + + static void __init gtwx5715_init(void) diff --git a/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch new file mode 100644 index 000000000..59c2837f0 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/312-ixp4xx_pata_optimization.patch @@ -0,0 +1,137 @@ +--- a/drivers/ata/pata_ixp4xx_cf.c ++++ b/drivers/ata/pata_ixp4xx_cf.c +@@ -24,16 +24,58 @@ + #include + + #define DRV_NAME "pata_ixp4xx_cf" +-#define DRV_VERSION "0.2" ++#define DRV_VERSION "0.3" + + static int ixp4xx_set_mode(struct ata_link *link, struct ata_device **error) + { ++ struct ixp4xx_pata_data *data = link->ap->host->dev->platform_data; ++ unsigned int pio_mask; + struct ata_device *dev; + + ata_for_each_dev(dev, link, ENABLED) { +- ata_dev_info(dev, "configured for PIO0\n"); +- dev->pio_mode = XFER_PIO_0; +- dev->xfer_mode = XFER_PIO_0; ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)) { ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)) { ++ pio_mask = 4; ++ } else { ++ pio_mask = 3; ++ } ++ } else { ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ ++ switch (pio_mask){ ++ case 0: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO0\n"); ++ dev->pio_mode = XFER_PIO_0; ++ dev->xfer_mode = XFER_PIO_0; ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO1\n"); ++ dev->pio_mode = XFER_PIO_1; ++ dev->xfer_mode = XFER_PIO_1; ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO2\n"); ++ dev->pio_mode = XFER_PIO_2; ++ dev->xfer_mode = XFER_PIO_2; ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO3\n"); ++ dev->pio_mode = XFER_PIO_3; ++ dev->xfer_mode = XFER_PIO_3; ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ ata_dev_printk(dev, KERN_INFO, "configured for PIO4\n"); ++ dev->pio_mode = XFER_PIO_4; ++ dev->xfer_mode = XFER_PIO_4; ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + dev->xfer_shift = ATA_SHIFT_PIO; + dev->flags |= ATA_DFLAG_PIO; + } +@@ -46,6 +88,7 @@ static unsigned int ixp4xx_mmio_data_xfe + unsigned int i; + unsigned int words = buflen >> 1; + u16 *buf16 = (u16 *) buf; ++ unsigned int pio_mask; + struct ata_port *ap = dev->link->ap; + void __iomem *mmio = ap->ioaddr.data_addr; + struct ixp4xx_pata_data *data = dev_get_platdata(ap->host->dev); +@@ -53,8 +96,34 @@ static unsigned int ixp4xx_mmio_data_xfe + /* set the expansion bus in 16bit mode and restore + * 8 bit mode after the transaction. + */ +- *data->cs0_cfg &= ~(0x01); +- udelay(100); ++ if (dev->id[ATA_ID_FIELD_VALID] & (1 << 1)){ ++ pio_mask = dev->id[ATA_ID_PIO_MODES] & 0x03; ++ if (pio_mask & (1 << 1)){ ++ pio_mask = 4; ++ }else{ ++ pio_mask = 3; ++ } ++ }else{ ++ pio_mask = (dev->id[ATA_ID_OLD_PIO_MODES] >> 8); ++ } ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0xa9643c42; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x85033c42; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x80b23c42; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c42; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c42; ++ break; ++ } ++ udelay(5); + + /* Transfer multiple of 2 bytes */ + if (rw == READ) +@@ -79,8 +148,24 @@ static unsigned int ixp4xx_mmio_data_xfe + words++; + } + +- udelay(100); +- *data->cs0_cfg |= 0x01; ++ udelay(5); ++ switch (pio_mask){ ++ case 0: ++ *data->cs0_cfg = 0x8a473c03; ++ break; ++ case 1: ++ *data->cs0_cfg = 0x86433c03; ++ break; ++ case 2: ++ *data->cs0_cfg = 0x82413c03; ++ break; ++ case 3: ++ *data->cs0_cfg = 0x80823c03; ++ break; ++ case 4: ++ *data->cs0_cfg = 0x80403c03; ++ break; ++ } + + return words << 1; + } diff --git a/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch new file mode 100644 index 000000000..fb7f03ee1 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/500-usr8200_support.patch @@ -0,0 +1,347 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -93,6 +93,14 @@ config MACH_SIDEWINDER + Engineering Sidewinder board. For more information on this + platform, see http://www.adiengineering.com + ++config MACH_USR8200 ++ bool "USRobotics USR8200" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the USRobotics ++ USR8200 router board. For more information on this platform, see ++ http://openwrt.org ++ + config MACH_COMPEXWP18 + bool "Compex WP18 / NP18A" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -27,6 +27,7 @@ obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o ++obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o + + obj-y += common.o + +@@ -55,6 +56,7 @@ obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o ++obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o + + obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o + obj-$(CONFIG_IXP4XX_QMGR) += ixp4xx_qmgr.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -44,7 +44,8 @@ static __inline__ void __arch_decomp_set + machine_is_gateway7001() || machine_is_wg302v2() || + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || +- machine_is_wrt300nv2() || machine_is_tw5334()) ++ machine_is_wrt300nv2() || machine_is_tw5334() || ++ machine_is_usr8200()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-pci.c +@@ -0,0 +1,77 @@ ++/* ++ * arch/arch/mach-ixp4xx/usr8200-pci.c ++ * ++ * PCI setup routines for USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-pci.c ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Peter Denison ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init usr8200_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO8, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO9, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init usr8200_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == 14) ++ return IRQ_IXP4XX_GPIO7; ++ else if (slot == 15) ++ return IRQ_IXP4XX_GPIO8; ++ else if (slot == 16) { ++ if (pin == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (pin == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else if (pin == 3) ++ return IRQ_IXP4XX_GPIO9; ++ else ++ return -1; ++ } else ++ return -1; ++} ++ ++struct hw_pci usr8200_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = usr8200_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = usr8200_map_irq, ++}; ++ ++int __init usr8200_pci_init(void) ++{ ++ if (machine_is_usr8200()) ++ pci_common_init(&usr8200_pci); ++ return 0; ++} ++ ++subsys_initcall(usr8200_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/usr8200-setup.c +@@ -0,0 +1,217 @@ ++/* ++ * arch/arm/mach-ixp4xx/usr8200-setup.c ++ * ++ * Board setup for the USRobotics USR8200 ++ * ++ * Copyright (C) 2008 Peter Denison ++ * ++ * based on pronghorn-setup.c: ++ * Copyright (C) 2008 Imre Kaloz ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Peter Denison ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct flash_platform_data usr8200_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource usr8200_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device usr8200_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &usr8200_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &usr8200_flash_resource, ++}; ++ ++static struct resource usr8200_uart_resources [] = { ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port usr8200_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device usr8200_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = usr8200_uart_data, ++ }, ++ .num_resources = 2, ++ .resource = usr8200_uart_resources, ++}; ++ ++static struct gpio_led usr8200_led_pin[] = { ++ { ++ .name = "usr8200:usb1", ++ .gpio = 0, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:usb2", ++ .gpio = 1, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:ieee1394", ++ .gpio = 2, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:internal", ++ .gpio = 3, ++ .active_low = 1, ++ }, ++ { ++ .name = "usr8200:power", ++ .gpio = 14, ++ } ++}; ++ ++static struct gpio_led_platform_data usr8200_led_data = { ++ .num_leds = ARRAY_SIZE(usr8200_led_pin), ++ .leds = usr8200_led_pin, ++}; ++ ++static struct platform_device usr8200_led = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev.platform_data = &usr8200_led_data, ++}; ++ ++static struct eth_plat_info usr8200_plat_eth[] = { ++ { /* NPEC - LAN with Marvell 88E6060 switch */ ++ .phy = IXP4XX_ETH_PHY_MAX_ADDR, ++ .phy_mask = 0x0F0000, ++ .rxq = 4, ++ .txreadyq = 21, ++ }, { /* NPEB - WAN */ ++ .phy = 9, ++ .rxq = 3, ++ .txreadyq = 20, ++ } ++}; ++ ++static struct platform_device usr8200_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = usr8200_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = usr8200_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct resource usr8200_rtc_resources = { ++ .flags = IORESOURCE_MEM ++}; ++ ++static struct platform_device usr8200_rtc = { ++ .name = "rtc7301", ++ .id = 0, ++ .num_resources = 1, ++ .resource = &usr8200_rtc_resources, ++}; ++ ++static struct platform_device *usr8200_devices[] __initdata = { ++ &usr8200_flash, ++ &usr8200_uart, ++ &usr8200_led, ++ &usr8200_eth[0], ++ &usr8200_eth[1], ++ &usr8200_rtc, ++}; ++ ++static void __init usr8200_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ usr8200_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ usr8200_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_16M - 1; ++ ++ usr8200_rtc_resources.start = IXP4XX_EXP_BUS_BASE(2); ++ usr8200_rtc_resources.end = IXP4XX_EXP_BUS_BASE(2) + 0x01ff; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS2 = 0x3fff000 | IXP4XX_EXP_BUS_SIZE(0) | IXP4XX_EXP_BUS_WR_EN | ++ IXP4XX_EXP_BUS_CS_EN | IXP4XX_EXP_BUS_BYTE_EN; ++ *IXP4XX_GPIO_GPCLKR = 0x01100000; ++ ++ /* configure button as input */ ++ gpio_line_config(12, IXP4XX_GPIO_IN); ++ ++ platform_add_devices(usr8200_devices, ARRAY_SIZE(usr8200_devices)); ++} ++ ++MACHINE_START(USR8200, "USRobotics USR8200") ++ /* Maintainer: Peter Denison */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = usr8200_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END diff --git a/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch new file mode 100644 index 000000000..39a261b8e --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/520-tw2662_support.patch @@ -0,0 +1,316 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -176,6 +176,15 @@ config ARCH_PRPMC1100 + PrPCM1100 Processor Mezanine Module. For more information on + this platform, see . + ++config MACH_TW2662 ++ bool "Titan Wireless TW-266-2" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support the Titan ++ Wireless TW266-2. For more information on this platform, ++ see http://openwrt.org ++ ++ + config MACH_TW5334 + bool "Titan Wireless TW-533-4" + select PCI +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -25,6 +25,7 @@ obj-pci-$(CONFIG_MACH_SIDEWINDER) += sid + obj-pci-$(CONFIG_MACH_COMPEXWP18) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-pci.o + obj-pci-$(CONFIG_MACH_AP1000) += ixdp425-pci.o ++obj-pci-$(CONFIG_MACH_TW2662) += tw2662-pci.o + obj-pci-$(CONFIG_MACH_TW5334) += tw5334-pci.o + obj-pci-$(CONFIG_MACH_MI424WR) += mi424wr-pci.o + obj-pci-$(CONFIG_MACH_USR8200) += usr8200-pci.o +@@ -54,6 +55,7 @@ obj-$(CONFIG_MACH_SIDEWINDER) += sidewin + obj-$(CONFIG_MACH_COMPEXWP18) += compex42x-setup.o + obj-$(CONFIG_MACH_WRT300NV2) += wrt300nv2-setup.o + obj-$(CONFIG_MACH_AP1000) += ap1000-setup.o ++obj-$(CONFIG_MACH_TW2662) += tw2662-setup.o + obj-$(CONFIG_MACH_TW5334) += tw5334-setup.o + obj-$(CONFIG_MACH_MI424WR) += mi424wr-setup.o + obj-$(CONFIG_MACH_USR8200) += usr8200-setup.o +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,7 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200()) ++ machine_is_usr8200() || machine_is_tw2662()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-pci.c +@@ -0,0 +1,67 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-pci.c ++ * ++ * PCI setup routines for Tiran Wireless TW-266-2 platform ++ * ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * Copyright (C) 2010 Gabor Juhos ++ * ++ * Maintainer: Deepak Saxena ++ * Maintainer: Alexandros C. Couloumbis ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define SLOT0_DEVID 1 ++#define SLOT1_DEVID 3 ++ ++/* PCI controller GPIO to IRQ pin mappings */ ++#define SLOT0_INTA 11 ++#define SLOT1_INTA 9 ++ ++void __init tw2662_pci_preinit(void) ++{ ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT0_INTA), IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IXP4XX_GPIO_IRQ(SLOT1_INTA), IRQ_TYPE_LEVEL_LOW); ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init tw2662_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ if (slot == SLOT0_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT0_INTA); ++ else if (slot == SLOT1_DEVID) ++ return IXP4XX_GPIO_IRQ(SLOT1_INTA); ++ else return -1; ++} ++ ++struct hw_pci tw2662_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = tw2662_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = tw2662_map_irq, ++}; ++ ++int __init tw2662_pci_init(void) ++{ ++ if (machine_is_tw2662()) ++ pci_common_init(&tw2662_pci); ++ return 0; ++} ++ ++subsys_initcall(tw2662_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/tw2662-setup.c +@@ -0,0 +1,196 @@ ++/* ++ * arch/arm/mach-ixp4xx/tw2662-setup.c ++ * ++ * Titan Wireless TW-266-2 ++ * ++ * Copyright (C) 2010 Gabor Juhos ++ * Copyright (C) 2010 Alexandros C. Couloumbis ++ * ++ * based on ap1000-setup.c: ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* gpio mask used by platform device */ ++#define TW2662_GPIO_MASK (1 << 1) | (1 << 3) | (1 << 5) | (1 << 7) ++ ++static struct flash_platform_data tw2662_flash_data = { ++ .map_name = "cfi_probe", ++ .width = 2, ++}; ++ ++static struct resource tw2662_flash_resource = { ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct platform_device tw2662_flash = { ++ .name = "IXP4XX-Flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &tw2662_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &tw2662_flash_resource, ++}; ++ ++static struct resource tw2662_uart_resources[] = { ++ { ++ .start = IXP4XX_UART1_BASE_PHYS, ++ .end = IXP4XX_UART1_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ }, ++ { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM ++ } ++}; ++ ++static struct plat_serial8250_port tw2662_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART1_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART1, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device tw2662_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev.platform_data = tw2662_uart_data, ++ .num_resources = 2, ++ .resource = tw2662_uart_resources ++}; ++ ++/* Built-in 10/100 Ethernet MAC interfaces */ ++static struct eth_plat_info tw2662_plat_eth[] = { ++ { ++ .phy = 3, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device tw2662_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = tw2662_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = tw2662_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++ ++static struct platform_device *tw2662_devices[] __initdata = { ++ &tw2662_flash, ++ &tw2662_uart, ++ &tw2662_eth[0], ++ &tw2662_eth[1], ++}; ++ ++static char tw2662_mem_fixup[] __initdata = "mem=64M "; ++ ++static void __init tw2662_fixup(struct tag *tags, char **cmdline) ++{ ++ struct tag *t = tags; ++ char *p = *cmdline; ++ ++ /* Find the end of the tags table, taking note of any cmdline tag. */ ++ for (; t->hdr.size; t = tag_next(t)) { ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ } ++ } ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = (sizeof (struct tag_header) + ++ strlen(tw2662_mem_fixup) + strlen(p) + 1 + 4) >> 2; ++ strlcpy(t->u.cmdline.cmdline, tw2662_mem_fixup, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(tw2662_mem_fixup), p, ++ COMMAND_LINE_SIZE - strlen(tw2662_mem_fixup)); ++ ++ /* Terminate the table. */ ++ t = tag_next(t); ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++static void __init tw2662_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ tw2662_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ tw2662_flash_resource.end = ++ IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; ++ ++ platform_add_devices(tw2662_devices, ARRAY_SIZE(tw2662_devices)); ++ ++ if (!(is_valid_ether_addr(tw2662_plat_eth[0].hwaddr))) ++ random_ether_addr(tw2662_plat_eth[0].hwaddr); ++ if (!(is_valid_ether_addr(tw2662_plat_eth[1].hwaddr))) { ++ memcpy(tw2662_plat_eth[1].hwaddr, tw2662_plat_eth[0].hwaddr, ETH_ALEN); ++ tw2662_plat_eth[1].hwaddr[5] = (tw2662_plat_eth[0].hwaddr[5] + 1); ++ } ++ ++} ++ ++#ifdef CONFIG_MACH_TW2662 ++MACHINE_START(TW2662, "Titan Wireless TW-266-2") ++ /* Maintainer: Alexandros C. Couloumbis */ ++ .fixup = tw2662_fixup, ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x0100, ++ .init_machine = tw2662_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif diff --git a/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch new file mode 100644 index 000000000..1afbe3d61 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/530-ap42x_support.patch @@ -0,0 +1,282 @@ +--- a/arch/arm/mach-ixp4xx/Kconfig ++++ b/arch/arm/mach-ixp4xx/Kconfig +@@ -4,6 +4,14 @@ menu "Intel IXP4xx Implementation Option + + comment "IXP4xx Platforms" + ++config MACH_AP42X ++ bool "Tonze AP-422/425" ++ select PCI ++ help ++ Say 'Y' here if you want your kernel to support Tonze's ++ AP-422/425 boards. For more information on this platform, ++ see http://tonze.com.tw ++ + config MACH_NSLU2 + bool + prompt "Linksys NSLU2" +--- a/arch/arm/mach-ixp4xx/Makefile ++++ b/arch/arm/mach-ixp4xx/Makefile +@@ -5,6 +5,7 @@ + obj-pci-y := + obj-pci-n := + ++obj-pci-$(CONFIG_MACH_AP42X) += ap42x-pci.o + obj-pci-$(CONFIG_ARCH_IXDP4XX) += ixdp425-pci.o + obj-pci-$(CONFIG_MACH_AVILA) += avila-pci.o + obj-pci-$(CONFIG_MACH_CAMBRIA) += cambria-pci.o +@@ -32,6 +33,7 @@ obj-pci-$(CONFIG_MACH_USR8200) += usr82 + + obj-y += common.o + ++obj-$(CONFIG_MACH_AP42X) += ap42x-setup.o + obj-$(CONFIG_ARCH_IXDP4XX) += ixdp425-setup.o + obj-$(CONFIG_MACH_AVILA) += avila-setup.o + obj-$(CONFIG_MACH_CAMBRIA) += cambria-setup.o +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-pci.c +@@ -0,0 +1,63 @@ ++/* ++ * arch/arch/mach-ixp4xx/ap42x-pci.c ++ * ++ * PCI setup routines for Tonze AP-422/425 ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-pci.c: ++ * Copyright (C) 2002 Jungo Software Technologies. ++ * Copyright (C) 2003 MontaVista Softwrae, Inc. ++ * ++ * Maintainer: Imre Kaloz ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++void __init ap42x_pci_preinit(void) ++{ ++ irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW); ++ irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW); ++ ++ ixp4xx_pci_preinit(); ++} ++ ++static int __init ap42x_map_irq(const struct pci_dev *dev, u8 slot, ++ u8 pin) ++{ ++ if (slot == 1) ++ return IRQ_IXP4XX_GPIO11; ++ else if (slot == 2) ++ return IRQ_IXP4XX_GPIO10; ++ else return -1; ++} ++ ++struct hw_pci ap42x_pci __initdata = { ++ .nr_controllers = 1, ++ .preinit = ap42x_pci_preinit, ++ .ops = &ixp4xx_ops, ++ .setup = ixp4xx_setup, ++ .map_irq = ap42x_map_irq, ++}; ++ ++int __init ap42x_pci_init(void) ++{ ++ if (machine_is_ap42x()) ++ pci_common_init(&ap42x_pci); ++ return 0; ++} ++ ++subsys_initcall(ap42x_pci_init); +--- /dev/null ++++ b/arch/arm/mach-ixp4xx/ap42x-setup.c +@@ -0,0 +1,166 @@ ++/* ++ * arch/arm/mach-ixp4xx/ap42x-setup.c ++ * ++ * Board setup for the Tonze AP-42x boards ++ * ++ * Copyright (C) 2012 Imre Kaloz ++ * ++ * based on coyote-setup.c: ++ * Copyright (C) 2003-2005 MontaVista Software, Inc. ++ * ++ * Author: Imre Kaloz ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++static struct mtd_partition ap42x_flash_partitions[] = { ++ { ++ .name = "RedBoot", ++ .offset = 0x00000000, ++ .size = 0x00080000, ++ }, { ++ .name = "linux", ++ .offset = 0x00080000, ++ .size = 0x00100000, ++ }, { ++ .name = "rootfs", ++ .offset = 0x00180000, ++ .size = 0x00660000, ++ }, { ++ .name = "FIS directory", ++ .offset = 0x007f8000, ++ .size = 0x00007000, ++ }, { ++ .name = "RedBoot config", ++ .offset = 0x007ff000, ++ .size = 0x00001000, ++ }, ++}; ++ ++static struct physmap_flash_data ap42x_flash_data = { ++ .width = 2, ++ .parts = ap42x_flash_partitions, ++ .nr_parts = ARRAY_SIZE(ap42x_flash_partitions), ++}; ++ ++static struct resource ap42x_flash_resource = { ++ .flags = IORESOURCE_MEM, ++ .start = IXP4XX_EXP_BUS_BASE_PHYS, ++ .end = IXP4XX_EXP_BUS_BASE_PHYS + SZ_8M - 1, ++}; ++ ++static struct platform_device ap42x_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &ap42x_flash_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_flash_resource, ++}; ++ ++static struct resource ap42x_uart_resource = { ++ .start = IXP4XX_UART2_BASE_PHYS, ++ .end = IXP4XX_UART2_BASE_PHYS + 0x0fff, ++ .flags = IORESOURCE_MEM, ++}; ++ ++static struct plat_serial8250_port ap42x_uart_data[] = { ++ { ++ .mapbase = IXP4XX_UART2_BASE_PHYS, ++ .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET, ++ .irq = IRQ_IXP4XX_UART2, ++ .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST, ++ .iotype = UPIO_MEM, ++ .regshift = 2, ++ .uartclk = IXP4XX_UART_XTAL, ++ }, ++ { }, ++}; ++ ++static struct platform_device ap42x_uart = { ++ .name = "serial8250", ++ .id = PLAT8250_DEV_PLATFORM, ++ .dev = { ++ .platform_data = ap42x_uart_data, ++ }, ++ .num_resources = 1, ++ .resource = &ap42x_uart_resource, ++}; ++ ++static struct eth_plat_info ap42x_plat_eth[] = { ++ { ++ .phy = 2, ++ .rxq = 3, ++ .txreadyq = 20, ++ }, { ++ .phy = 1, ++ .rxq = 4, ++ .txreadyq = 21, ++ } ++}; ++ ++static struct platform_device ap42x_eth[] = { ++ { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEB, ++ .dev.platform_data = ap42x_plat_eth, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ }, { ++ .name = "ixp4xx_eth", ++ .id = IXP4XX_ETH_NPEC, ++ .dev.platform_data = ap42x_plat_eth + 1, ++ .dev.coherent_dma_mask = DMA_BIT_MASK(32), ++ } ++}; ++ ++static struct platform_device *ap42x_devices[] __initdata = { ++ &ap42x_flash, ++ &ap42x_uart, ++ &ap42x_eth[0], ++ &ap42x_eth[1], ++}; ++ ++static void __init ap42x_init(void) ++{ ++ ixp4xx_sys_init(); ++ ++ ap42x_flash_resource.start = IXP4XX_EXP_BUS_BASE(0); ++ ap42x_flash_resource.end = IXP4XX_EXP_BUS_BASE(0) + SZ_32M - 1; ++ ++ *IXP4XX_EXP_CS0 |= IXP4XX_FLASH_WRITABLE; ++ *IXP4XX_EXP_CS1 = *IXP4XX_EXP_CS0; ++ ++ platform_add_devices(ap42x_devices, ARRAY_SIZE(ap42x_devices)); ++} ++ ++#ifdef CONFIG_MACH_AP42X ++MACHINE_START(AP42X, "Tonze AP-422/425") ++ /* Maintainer: Imre Kaloz */ ++ .map_io = ixp4xx_map_io, ++ .init_irq = ixp4xx_init_irq, ++ .init_time = ixp4xx_timer_init, ++ .atag_offset = 0x100, ++ .init_machine = ap42x_init, ++#if defined(CONFIG_PCI) ++ .dma_zone_size = SZ_64M, ++#endif ++ .restart = ixp4xx_restart, ++MACHINE_END ++#endif +--- a/arch/arm/mach-ixp4xx/include/mach/uncompress.h ++++ b/arch/arm/mach-ixp4xx/include/mach/uncompress.h +@@ -45,7 +45,8 @@ static __inline__ void __arch_decomp_set + machine_is_devixp() || machine_is_miccpt() || machine_is_mic256() || + machine_is_pronghorn() || machine_is_pronghorn_metro() || + machine_is_wrt300nv2() || machine_is_tw5334() || +- machine_is_usr8200() || machine_is_tw2662()) ++ machine_is_usr8200() || machine_is_tw2662() || ++ machine_is_ap42x()) + uart_base = (volatile u32*) IXP4XX_UART2_BASE_PHYS; + else + uart_base = (volatile u32*) IXP4XX_UART1_BASE_PHYS; diff --git a/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch new file mode 100644 index 000000000..3f3621b0d --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/600-skb_avoid_dmabounce.patch @@ -0,0 +1,23 @@ +--- a/net/core/skbuff.c ++++ b/net/core/skbuff.c +@@ -215,6 +215,9 @@ struct sk_buff *__alloc_skb(unsigned int + + if (sk_memalloc_socks() && (flags & SKB_ALLOC_RX)) + gfp_mask |= __GFP_MEMALLOC; ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif + + /* Get the HEAD */ + skb = kmem_cache_alloc_node(cache, gfp_mask & ~__GFP_DMA, node); +@@ -1222,6 +1225,10 @@ int pskb_expand_head(struct sk_buff *skb + if (skb_shared(skb)) + BUG(); + ++#ifdef CONFIG_ARCH_IXP4XX ++ gfp_mask |= GFP_DMA; ++#endif ++ + size = SKB_DATA_ALIGN(size); + + if (skb_pfmemalloc(skb)) diff --git a/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch new file mode 100644 index 000000000..24c93dc74 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/900-ixp4xx-crypto-include-module.h.patch @@ -0,0 +1,10 @@ +--- a/drivers/crypto/ixp4xx_crypto.c ++++ b/drivers/crypto/ixp4xx_crypto.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + #include + #include + #include diff --git a/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch new file mode 100644 index 000000000..06e09f469 --- /dev/null +++ b/target/linux/ixp4xx/patches-4.9/910-ixp4xx-nr_irq_lines.patch @@ -0,0 +1,22 @@ +--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c ++++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c +@@ -53,7 +53,7 @@ static int __init ixdp425_map_irq(const + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } +--- a/arch/arm/mach-ixp4xx/miccpt-pci.c ++++ b/arch/arm/mach-ixp4xx/miccpt-pci.c +@@ -54,7 +54,7 @@ static int __init miccpt_map_irq(const s + }; + + if (slot >= 1 && slot <= MAX_DEV && pin >= 1 && pin <= IRQ_LINES) +- return pci_irq_table[(slot + pin - 2) % 4]; ++ return pci_irq_table[(slot + pin - 2) % IRQ_LINES]; + + return -1; + } diff --git a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch index 64597cec8..da48ae3a1 100644 --- a/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch +++ b/target/linux/lantiq/patches-4.9/0090-spi-lantiq-ssc-add-support-for-Lantiq-SSC-SPI-contro.patch @@ -65,7 +65,7 @@ Signed-off-by: Mark Brown +}; --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -404,6 +404,14 @@ config SPI_NUC900 +@@ -403,6 +403,14 @@ config SPI_NUC900 help SPI driver for Nuvoton NUC900 series ARM SoCs diff --git a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch index 101902b93..7b14d9e5a 100644 --- a/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch +++ b/target/linux/lantiq/patches-4.9/0152-lantiq-VPE.patch @@ -1,6 +1,6 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -2311,6 +2311,12 @@ config MIPS_VPE_LOADER +@@ -2320,6 +2320,12 @@ config MIPS_VPE_LOADER Includes a loader for loading an elf relocatable object onto another VPE and running it. diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index f6a7bca7c..8ce3b56e3 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -24281,15 +24281,7 @@ Signed-off-by: Yangbo Lu #endif /* CAAM_ERROR_H */ --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h -@@ -41,6 +41,7 @@ struct caam_drv_private_jr { - struct device *dev; - int ridx; - struct caam_job_ring __iomem *rregs; /* JobR's register space */ -+ struct tasklet_struct irqtask; - int irq; /* One per queue */ - - /* Number of scatterlist crypt transforms active on the JobR */ -@@ -63,10 +64,9 @@ struct caam_drv_private_jr { +@@ -64,10 +64,9 @@ struct caam_drv_private_jr { * Driver-private storage for a single CAAM block instance */ struct caam_drv_private { @@ -24303,7 +24295,7 @@ Signed-off-by: Yangbo Lu /* Physical-presence section */ struct caam_ctrl __iomem *ctrl; /* controller region */ -@@ -102,11 +102,6 @@ struct caam_drv_private { +@@ -103,11 +102,6 @@ struct caam_drv_private { #ifdef CONFIG_DEBUG_FS struct dentry *dfs_root; struct dentry *ctl; /* controller dir */ @@ -24315,7 +24307,7 @@ Signed-off-by: Yangbo Lu struct debugfs_blob_wrapper ctl_kek_wrap, ctl_tkek_wrap, ctl_tdsk_wrap; struct dentry *ctl_kek, *ctl_tkek, *ctl_tdsk; #endif -@@ -114,4 +109,22 @@ struct caam_drv_private { +@@ -115,4 +109,22 @@ struct caam_drv_private { void caam_jr_algapi_init(struct device *dev); void caam_jr_algapi_remove(struct device *dev); @@ -24363,16 +24355,7 @@ Signed-off-by: Yangbo Lu static int caam_reset_hw_jr(struct device *dev) { struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); -@@ -73,6 +82,8 @@ static int caam_jr_shutdown(struct devic - - ret = caam_reset_hw_jr(dev); - -+ tasklet_kill(&jrp->irqtask); -+ - /* Release interrupt */ - free_irq(jrp->irq, dev); - -@@ -116,6 +127,8 @@ static int caam_jr_remove(struct platfor +@@ -118,6 +127,8 @@ static int caam_jr_remove(struct platfor dev_err(jrdev, "Failed to shut down job ring\n"); irq_dispose_mapping(jrpriv->irq); @@ -24381,47 +24364,7 @@ Signed-off-by: Yangbo Lu return ret; } -@@ -128,7 +141,7 @@ static irqreturn_t caam_jr_interrupt(int - - /* - * Check the output ring for ready responses, kick -- * the threaded irq if jobs done. -+ * tasklet if jobs done. - */ - irqstate = rd_reg32(&jrp->rregs->jrintstatus); - if (!irqstate) -@@ -150,13 +163,18 @@ static irqreturn_t caam_jr_interrupt(int - /* Have valid interrupt at this point, just ACK and trigger */ - wr_reg32(&jrp->rregs->jrintstatus, irqstate); - -- return IRQ_WAKE_THREAD; -+ preempt_disable(); -+ tasklet_schedule(&jrp->irqtask); -+ preempt_enable(); -+ -+ return IRQ_HANDLED; - } - --static irqreturn_t caam_jr_threadirq(int irq, void *st_dev) -+/* Deferred service handler, run as interrupt-fired tasklet */ -+static void caam_jr_dequeue(unsigned long devarg) - { - int hw_idx, sw_idx, i, head, tail; -- struct device *dev = st_dev; -+ struct device *dev = (struct device *)devarg; - struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); - void (*usercall)(struct device *dev, u32 *desc, u32 status, void *arg); - u32 *userdesc, userstatus; -@@ -230,8 +248,6 @@ static irqreturn_t caam_jr_threadirq(int - - /* reenable / unmask IRQs */ - clrsetbits_32(&jrp->rregs->rconfig_lo, JRCFG_IMSK, 0); -- -- return IRQ_HANDLED; - } - - /** -@@ -275,6 +291,36 @@ struct device *caam_jr_alloc(void) +@@ -280,6 +291,36 @@ struct device *caam_jr_alloc(void) EXPORT_SYMBOL(caam_jr_alloc); /** @@ -24458,30 +24401,7 @@ Signed-off-by: Yangbo Lu * caam_jr_free() - Free the Job Ring * @rdev - points to the dev that identifies the Job ring to * be released. -@@ -389,10 +435,11 @@ static int caam_jr_init(struct device *d - - jrp = dev_get_drvdata(dev); - -+ tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev); -+ - /* Connect job ring interrupt handler. */ -- error = request_threaded_irq(jrp->irq, caam_jr_interrupt, -- caam_jr_threadirq, IRQF_SHARED, -- dev_name(dev), dev); -+ error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, -+ dev_name(dev), dev); - if (error) { - dev_err(dev, "can't connect JobR %d interrupt (%d)\n", - jrp->ridx, jrp->irq); -@@ -454,6 +501,7 @@ out_free_inpring: - out_free_irq: - free_irq(jrp->irq, dev); - out_kill_deq: -+ tasklet_kill(&jrp->irqtask); - return error; - } - -@@ -489,15 +537,28 @@ static int caam_jr_probe(struct platform +@@ -496,15 +537,28 @@ static int caam_jr_probe(struct platform return -ENOMEM; } @@ -24517,7 +24437,7 @@ Signed-off-by: Yangbo Lu /* Identify the interrupt */ jrpriv->irq = irq_of_parse_and_map(nprop, 0); -@@ -517,10 +578,12 @@ static int caam_jr_probe(struct platform +@@ -524,10 +578,12 @@ static int caam_jr_probe(struct platform atomic_set(&jrpriv->tfm_count, 0); diff --git a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch index 6c81b0044..cd99f9492 100644 --- a/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/807-gpu-support-layerscape.patch @@ -27,10 +27,10 @@ Signed-off-by: Yangbo Lu + disable_irq(fsl_dev->irq); + - clk_disable_unprepare(fsl_dev->pix_clk); clk_disable_unprepare(fsl_dev->clk); -@@ -263,6 +264,14 @@ static int fsl_dcu_drm_pm_resume(struct + return 0; +@@ -262,6 +263,12 @@ static int fsl_dcu_drm_pm_resume(struct return ret; } @@ -39,21 +39,11 @@ Signed-off-by: Yangbo Lu + dev_err(dev, "failed to enable dcu pix clk\n"); + return ret; + } -+ -+ enable_irq(fsl_dev->irq); + if (fsl_dev->tcon) fsl_tcon_bypass_enable(fsl_dev->tcon); fsl_dcu_drm_init_planes(fsl_dev->drm); -@@ -273,7 +282,6 @@ static int fsl_dcu_drm_pm_resume(struct - console_unlock(); - - drm_kms_helper_poll_enable(fsl_dev->drm); -- enable_irq(fsl_dev->irq); - - return 0; - } -@@ -389,6 +397,12 @@ static int fsl_dcu_drm_probe(struct plat +@@ -388,6 +395,12 @@ static int fsl_dcu_drm_probe(struct plat goto disable_clk; } diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 657a38fec..7773e70e9 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -995,7 +995,7 @@ Signed-off-by: Yangbo Lu }; struct dmar_atsr_unit { -@@ -4250,27 +4251,40 @@ static inline void init_iommu_pm_ops(voi +@@ -4252,27 +4253,40 @@ static inline void init_iommu_pm_ops(voi int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header, void *arg) { struct acpi_dmar_reserved_memory *rmrr; @@ -1041,7 +1041,7 @@ Signed-off-by: Yangbo Lu } static struct dmar_atsr_unit *dmar_find_atsr(struct acpi_dmar_atsr *atsr) -@@ -4484,6 +4498,7 @@ static void intel_iommu_free_dmars(void) +@@ -4486,6 +4500,7 @@ static void intel_iommu_free_dmars(void) list_for_each_entry_safe(rmrru, rmrr_n, &dmar_rmrr_units, list) { list_del(&rmrru->list); dmar_free_dev_scope(&rmrru->devices, &rmrru->devices_cnt); @@ -1049,7 +1049,7 @@ Signed-off-by: Yangbo Lu kfree(rmrru); } -@@ -5219,6 +5234,45 @@ static void intel_iommu_remove_device(st +@@ -5221,6 +5236,45 @@ static void intel_iommu_remove_device(st iommu_device_unlink(iommu->iommu_dev, dev); } @@ -1095,7 +1095,7 @@ Signed-off-by: Yangbo Lu #ifdef CONFIG_INTEL_IOMMU_SVM #define MAX_NR_PASID_BITS (20) static inline unsigned long intel_iommu_get_pts(struct intel_iommu *iommu) -@@ -5349,19 +5403,21 @@ struct intel_iommu *intel_svm_device_to_ +@@ -5351,19 +5405,21 @@ struct intel_iommu *intel_svm_device_to_ #endif /* CONFIG_INTEL_IOMMU_SVM */ static const struct iommu_ops intel_iommu_ops = { diff --git a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch index 48fda9b02..9f4b04447 100644 --- a/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch +++ b/target/linux/oxnas/patches-4.4/0072-mtd-backport-v4.7-0day-patches-from-Boris.patch @@ -2512,10 +2512,10 @@ Signed-off-by: John Crispin { - struct nand_chip *chip = mtd->priv; + struct nand_chip *chip = mtd_to_nand(mtd); + int chipnr = (int)(to >> chip->chip_shift); struct mtd_oob_ops ops; int ret; - -@@ -2722,15 +2757,12 @@ static int nand_do_write_oob(struct mtd_ +@@ -2725,15 +2760,12 @@ static int nand_do_write_oob(struct mtd_ struct mtd_oob_ops *ops) { int chipnr, page, status, len; @@ -2533,7 +2533,7 @@ Signed-off-by: John Crispin /* Do not allow write past end of page */ if ((ops->ooboffs + ops->ooblen) > len) { -@@ -2847,7 +2879,7 @@ out: +@@ -2850,7 +2882,7 @@ out: */ static int single_erase(struct mtd_info *mtd, int page) { @@ -2542,7 +2542,7 @@ Signed-off-by: John Crispin /* Send commands to erase a block */ chip->cmdfunc(mtd, NAND_CMD_ERASE1, -1, page); chip->cmdfunc(mtd, NAND_CMD_ERASE2, -1, -1); -@@ -2879,7 +2911,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2882,7 +2914,7 @@ int nand_erase_nand(struct mtd_info *mtd int allowbbt) { int page, status, pages_per_block, ret, chipnr; @@ -2551,7 +2551,7 @@ Signed-off-by: John Crispin loff_t len; pr_debug("%s: start = 0x%012llx, len = %llu\n", -@@ -2918,7 +2950,7 @@ int nand_erase_nand(struct mtd_info *mtd +@@ -2921,7 +2953,7 @@ int nand_erase_nand(struct mtd_info *mtd while (len) { /* Check if we have a bad block, we do not erase bad blocks! */ if (nand_block_checkbad(mtd, ((loff_t) page) << @@ -2560,7 +2560,7 @@ Signed-off-by: John Crispin pr_warn("%s: attempt to erase a bad block at page 0x%08x\n", __func__, page); instr->state = MTD_ERASE_FAILED; -@@ -3005,7 +3037,20 @@ static void nand_sync(struct mtd_info *m +@@ -3008,7 +3040,20 @@ static void nand_sync(struct mtd_info *m */ static int nand_block_isbad(struct mtd_info *mtd, loff_t offs) { @@ -2582,7 +2582,7 @@ Signed-off-by: John Crispin } /** -@@ -3094,7 +3139,7 @@ static int nand_suspend(struct mtd_info +@@ -3097,7 +3142,7 @@ static int nand_suspend(struct mtd_info */ static void nand_resume(struct mtd_info *mtd) { @@ -2591,7 +2591,7 @@ Signed-off-by: John Crispin if (chip->state == FL_PM_SUSPENDED) nand_release_device(mtd); -@@ -3266,7 +3311,7 @@ ext_out: +@@ -3269,7 +3314,7 @@ ext_out: static int nand_setup_read_retry_micron(struct mtd_info *mtd, int retry_mode) { @@ -2600,7 +2600,7 @@ Signed-off-by: John Crispin uint8_t feature[ONFI_SUBFEATURE_PARAM_LEN] = {retry_mode}; return chip->onfi_set_features(mtd, chip, ONFI_FEATURE_ADDR_READ_RETRY, -@@ -3937,10 +3982,13 @@ ident_done: +@@ -3940,10 +3985,13 @@ ident_done: return type; } @@ -2617,7 +2617,7 @@ Signed-off-by: John Crispin if (of_get_nand_bus_width(dn) == 16) chip->options |= NAND_BUSWIDTH_16; -@@ -3949,6 +3997,7 @@ static int nand_dt_init(struct mtd_info +@@ -3952,6 +4000,7 @@ static int nand_dt_init(struct mtd_info chip->bbt_options |= NAND_BBT_USE_FLASH; ecc_mode = of_get_nand_ecc_mode(dn); @@ -2625,7 +2625,7 @@ Signed-off-by: John Crispin ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); -@@ -3961,6 +4010,9 @@ static int nand_dt_init(struct mtd_info +@@ -3964,6 +4013,9 @@ static int nand_dt_init(struct mtd_info if (ecc_mode >= 0) chip->ecc.mode = ecc_mode; @@ -2635,7 +2635,7 @@ Signed-off-by: John Crispin if (ecc_strength >= 0) chip->ecc.strength = ecc_strength; -@@ -3984,15 +4036,16 @@ int nand_scan_ident(struct mtd_info *mtd +@@ -3987,15 +4039,16 @@ int nand_scan_ident(struct mtd_info *mtd struct nand_flash_dev *table) { int i, nand_maf_id, nand_dev_id; @@ -2658,7 +2658,7 @@ Signed-off-by: John Crispin if (!mtd->name && mtd->dev.parent) mtd->name = dev_name(mtd->dev.parent); -@@ -4055,7 +4108,7 @@ EXPORT_SYMBOL(nand_scan_ident); +@@ -4058,7 +4111,7 @@ EXPORT_SYMBOL(nand_scan_ident); */ static bool nand_ecc_strength_good(struct mtd_info *mtd) { @@ -2667,7 +2667,7 @@ Signed-off-by: John Crispin struct nand_ecc_ctrl *ecc = &chip->ecc; int corr, ds_corr; -@@ -4083,10 +4136,10 @@ static bool nand_ecc_strength_good(struc +@@ -4086,10 +4139,10 @@ static bool nand_ecc_strength_good(struc */ int nand_scan_tail(struct mtd_info *mtd) { @@ -2680,7 +2680,7 @@ Signed-off-by: John Crispin /* New bad blocks should be marked in OOB, flash-based BBT, or both */ BUG_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) && -@@ -4113,19 +4166,15 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4116,19 +4169,15 @@ int nand_scan_tail(struct mtd_info *mtd) /* * If no default placement scheme is given, select an appropriate one. */ @@ -2703,7 +2703,7 @@ Signed-off-by: John Crispin break; default: pr_warn("No oob scheme defined for oobsize %d\n", -@@ -4168,7 +4217,7 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4171,7 +4220,7 @@ int nand_scan_tail(struct mtd_info *mtd) ecc->write_oob = nand_write_oob_std; if (!ecc->read_subpage) ecc->read_subpage = nand_read_subpage; @@ -2712,7 +2712,7 @@ Signed-off-by: John Crispin ecc->write_subpage = nand_write_subpage_hwecc; case NAND_ECC_HW_SYNDROME: -@@ -4246,10 +4295,8 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4249,10 +4298,8 @@ int nand_scan_tail(struct mtd_info *mtd) } /* See nand_bch_init() for details. */ @@ -2725,7 +2725,7 @@ Signed-off-by: John Crispin if (!ecc->priv) { pr_warn("BCH ECC initialization failed!\n"); BUG(); -@@ -4280,20 +4327,9 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4283,20 +4330,9 @@ int nand_scan_tail(struct mtd_info *mtd) if (!ecc->write_oob_raw) ecc->write_oob_raw = ecc->write_oob; @@ -2749,7 +2749,7 @@ Signed-off-by: John Crispin /* * Set the number of read / write steps for one page depending on ECC -@@ -4306,6 +4342,21 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4309,6 +4345,21 @@ int nand_scan_tail(struct mtd_info *mtd) } ecc->total = ecc->steps * ecc->bytes; @@ -2771,7 +2771,7 @@ Signed-off-by: John Crispin /* Allow subpage writes up to ecc.steps. Not possible for MLC flash */ if (!(chip->options & NAND_NO_SUBPAGE_WRITE) && nand_is_slc(chip)) { switch (ecc->steps) { -@@ -4362,10 +4413,6 @@ int nand_scan_tail(struct mtd_info *mtd) +@@ -4365,10 +4416,6 @@ int nand_scan_tail(struct mtd_info *mtd) mtd->_block_markbad = nand_block_markbad; mtd->writebufsize = mtd->writesize; @@ -2782,7 +2782,7 @@ Signed-off-by: John Crispin /* * Initialize bitflip_threshold to its default prior scan_bbt() call. * scan_bbt() might invoke mtd_read(), thus bitflip_threshold must be -@@ -4421,7 +4468,7 @@ EXPORT_SYMBOL(nand_scan); +@@ -4424,7 +4471,7 @@ EXPORT_SYMBOL(nand_scan); */ void nand_release(struct mtd_info *mtd) { diff --git a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch index 4b3260c41..aefcfd98a 100644 --- a/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch +++ b/target/linux/oxnas/patches-4.4/0074-mtd-nand-import-nand_hw_control_init.patch @@ -87,7 +87,7 @@ Signed-off-by: Boris Brezillon } --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c -@@ -3202,8 +3202,7 @@ static void nand_set_defaults(struct nan +@@ -3205,8 +3205,7 @@ static void nand_set_defaults(struct nan if (!chip->controller) { chip->controller = &chip->hwcontrol; diff --git a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch index 479bfddc5..76a19267a 100644 --- a/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch +++ b/target/linux/oxnas/patches-4.4/330-oxnas-pinctrl.patch @@ -1,6 +1,6 @@ --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -227,6 +227,15 @@ config PINCTRL_COH901 +@@ -228,6 +228,15 @@ config PINCTRL_COH901 COH 901 335 and COH 901 571/3. They contain 3, 5 or 7 ports of 8 GPIO pins each. diff --git a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch index 2225454d1..099a04e54 100644 --- a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -617,6 +617,8 @@ config RALINK +@@ -619,6 +619,8 @@ config RALINK select CLKDEV_LOOKUP select ARCH_HAS_RESET_CONTROLLER select RESET_CONTROLLER diff --git a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch index ca3dc8464..3b84aefd0 100644 --- a/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch +++ b/target/linux/ramips/patches-4.9/0028-GPIO-ralink-add-mt7621-gpio-controller.patch @@ -14,7 +14,7 @@ Signed-off-by: John Crispin --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -619,6 +619,9 @@ config RALINK +@@ -621,6 +621,9 @@ config RALINK select RESET_CONTROLLER select PINCTRL select PINCTRL_RT2880 diff --git a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch index 3150dd838..0288b9755 100644 --- a/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch +++ b/target/linux/ramips/patches-4.9/0042-SPI-ralink-add-Ralink-SoC-spi-driver.patch @@ -16,7 +16,7 @@ Acked-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -534,6 +534,12 @@ config SPI_QUP +@@ -533,6 +533,12 @@ config SPI_QUP This driver can also be built as a module. If so, the module will be called spi_qup. diff --git a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch index 984f4ada9..339dc5a87 100644 --- a/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch +++ b/target/linux/ramips/patches-4.9/0043-spi-add-mt7621-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig -@@ -540,6 +540,12 @@ config SPI_RT2880 +@@ -539,6 +539,12 @@ config SPI_RT2880 help This selects a driver for the Ralink RT288x/RT305x SPI Controller. diff --git a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch index b88c19e25..ca2eb3ac8 100644 --- a/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch +++ b/target/linux/sunxi/patches-4.9/0050-stmmac-form-4-10.patch @@ -2464,7 +2464,7 @@ return ret; } } -@@ -1798,33 +1793,36 @@ static int stmmac_open(struct net_device +@@ -1799,33 +1794,36 @@ static int stmmac_open(struct net_device ret = alloc_dma_desc_resources(priv); if (ret < 0) { @@ -2508,7 +2508,7 @@ goto init_error; } -@@ -1833,8 +1831,9 @@ static int stmmac_open(struct net_device +@@ -1834,8 +1832,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->wol_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2520,7 +2520,7 @@ goto wolirq_error; } } -@@ -1844,8 +1843,9 @@ static int stmmac_open(struct net_device +@@ -1845,8 +1844,9 @@ static int stmmac_open(struct net_device ret = request_irq(priv->lpi_irq, stmmac_interrupt, IRQF_SHARED, dev->name, dev); if (unlikely(ret < 0)) { @@ -2532,7 +2532,7 @@ goto lpiirq_error; } } -@@ -1864,8 +1864,8 @@ wolirq_error: +@@ -1865,8 +1865,8 @@ wolirq_error: init_error: free_dma_desc_resources(priv); dma_desc_error: @@ -2543,7 +2543,7 @@ return ret; } -@@ -1884,10 +1884,9 @@ static int stmmac_release(struct net_dev +@@ -1885,10 +1885,9 @@ static int stmmac_release(struct net_dev del_timer_sync(&priv->eee_ctrl_timer); /* Stop and disconnect the PHY */ @@ -2557,7 +2557,7 @@ } netif_stop_queue(dev); -@@ -1947,13 +1946,13 @@ static void stmmac_tso_allocator(struct +@@ -1948,13 +1947,13 @@ static void stmmac_tso_allocator(struct priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); desc = priv->dma_tx + priv->cur_tx; @@ -2573,7 +2573,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1998,8 +1997,6 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -1999,8 +1998,6 @@ static netdev_tx_t stmmac_tso_xmit(struc u8 proto_hdr_len; int i; @@ -2582,7 +2582,7 @@ /* Compute header lengths */ proto_hdr_len = skb_transport_offset(skb) + tcp_hdrlen(skb); -@@ -2009,9 +2006,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2010,9 +2007,10 @@ static netdev_tx_t stmmac_tso_xmit(struc if (!netif_queue_stopped(dev)) { netif_stop_queue(dev); /* This is a hard error, log it. */ @@ -2595,7 +2595,7 @@ return NETDEV_TX_BUSY; } -@@ -2049,11 +2047,11 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2050,11 +2048,11 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->tx_skbuff_dma[first_entry].len = skb_headlen(skb); priv->tx_skbuff[first_entry] = skb; @@ -2609,7 +2609,7 @@ /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; -@@ -2082,8 +2080,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2083,8 +2081,8 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->cur_tx = STMMAC_GET_ENTRY(priv->cur_tx, DMA_TX_SIZE); if (unlikely(stmmac_tx_avail(priv) <= (MAX_SKB_FRAGS + 1))) { @@ -2620,7 +2620,7 @@ netif_stop_queue(dev); } -@@ -2127,7 +2125,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,7 +2126,7 @@ static netdev_tx_t stmmac_tso_xmit(struc * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2629,7 +2629,7 @@ if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", -@@ -2146,11 +2144,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2147,11 +2145,9 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2641,7 +2641,7 @@ dev_err(priv->device, "Tx dma map failed\n"); dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; -@@ -2182,14 +2178,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2183,14 +2179,13 @@ static netdev_tx_t stmmac_xmit(struct sk return stmmac_tso_xmit(skb, dev); } @@ -2659,7 +2659,7 @@ } return NETDEV_TX_BUSY; } -@@ -2242,13 +2237,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2243,13 +2238,11 @@ static netdev_tx_t stmmac_xmit(struct sk priv->tx_skbuff[entry] = NULL; @@ -2678,7 +2678,7 @@ priv->tx_skbuff_dma[entry].map_as_page = true; priv->tx_skbuff_dma[entry].len = len; -@@ -2266,9 +2259,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2267,9 +2260,10 @@ static netdev_tx_t stmmac_xmit(struct sk if (netif_msg_pktdata(priv)) { void *tx_head; @@ -2692,7 +2692,7 @@ if (priv->extend_desc) tx_head = (void *)priv->dma_etx; -@@ -2277,13 +2271,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2278,13 +2272,13 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); @@ -2709,7 +2709,7 @@ netif_stop_queue(dev); } -@@ -2319,13 +2313,11 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2320,13 +2314,11 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -2728,7 +2728,7 @@ priv->tx_skbuff_dma[first_entry].len = nopaged_len; priv->tx_skbuff_dma[first_entry].last_segment = last_segment; -@@ -2346,7 +2338,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2347,7 +2339,7 @@ static netdev_tx_t stmmac_xmit(struct sk * descriptor and then barrier is needed to make sure that * all is coherent before granting the DMA engine. */ @@ -2737,7 +2737,7 @@ } netdev_sent_queue(dev, skb->len); -@@ -2357,12 +2349,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2358,12 +2350,10 @@ static netdev_tx_t stmmac_xmit(struct sk priv->hw->dma->set_tx_tail_ptr(priv->ioaddr, priv->tx_tail_addr, STMMAC_CHAN0); @@ -2751,7 +2751,7 @@ dev_kfree_skb(skb); priv->dev->stats.tx_dropped++; return NETDEV_TX_OK; -@@ -2433,16 +2423,16 @@ static inline void stmmac_rx_refill(stru +@@ -2434,16 +2424,16 @@ static inline void stmmac_rx_refill(stru DMA_FROM_DEVICE); if (dma_mapping_error(priv->device, priv->rx_skbuff_dma[entry])) { @@ -2771,7 +2771,7 @@ } if (priv->hw->mode->refill_desc3) priv->hw->mode->refill_desc3(priv, p); -@@ -2450,17 +2440,17 @@ static inline void stmmac_rx_refill(stru +@@ -2451,17 +2441,17 @@ static inline void stmmac_rx_refill(stru if (priv->rx_zeroc_thresh > 0) priv->rx_zeroc_thresh--; @@ -2793,7 +2793,7 @@ entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } -@@ -2484,7 +2474,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2485,7 +2475,7 @@ static int stmmac_rx(struct stmmac_priv if (netif_msg_rx_status(priv)) { void *rx_head; @@ -2802,7 +2802,7 @@ if (priv->extend_desc) rx_head = (void *)priv->dma_erx; else -@@ -2546,9 +2536,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2547,9 +2537,9 @@ static int stmmac_rx(struct stmmac_priv unsigned int des; if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00)) @@ -2814,7 +2814,7 @@ frame_len = priv->hw->desc->get_rx_frame_len(p, coe); -@@ -2557,9 +2547,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2558,9 +2548,9 @@ static int stmmac_rx(struct stmmac_priv * ignored */ if (frame_len > priv->dma_buf_sz) { @@ -2827,7 +2827,7 @@ priv->dev->stats.rx_length_errors++; break; } -@@ -2571,11 +2561,11 @@ static int stmmac_rx(struct stmmac_priv +@@ -2572,11 +2562,11 @@ static int stmmac_rx(struct stmmac_priv frame_len -= ETH_FCS_LEN; if (netif_msg_rx_status(priv)) { @@ -2843,7 +2843,7 @@ } /* The zero-copy is always used for all the sizes -@@ -2612,8 +2602,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2613,8 +2603,9 @@ static int stmmac_rx(struct stmmac_priv } else { skb = priv->rx_skbuff[entry]; if (unlikely(!skb)) { @@ -2855,7 +2855,7 @@ priv->dev->stats.rx_dropped++; break; } -@@ -2629,7 +2620,8 @@ static int stmmac_rx(struct stmmac_priv +@@ -2630,7 +2621,8 @@ static int stmmac_rx(struct stmmac_priv } if (netif_msg_pktdata(priv)) { @@ -2865,7 +2865,7 @@ print_pkt(skb->data, frame_len); } -@@ -2732,7 +2724,7 @@ static int stmmac_change_mtu(struct net_ +@@ -2733,7 +2725,7 @@ static int stmmac_change_mtu(struct net_ int max_mtu; if (netif_running(dev)) { @@ -2874,7 +2874,7 @@ return -EBUSY; } -@@ -2824,7 +2816,7 @@ static irqreturn_t stmmac_interrupt(int +@@ -2825,7 +2817,7 @@ static irqreturn_t stmmac_interrupt(int pm_wakeup_event(priv->device, 0); if (unlikely(!dev)) { @@ -2883,7 +2883,7 @@ return IRQ_NONE; } -@@ -2882,7 +2874,6 @@ static void stmmac_poll_controller(struc +@@ -2883,7 +2875,6 @@ static void stmmac_poll_controller(struc */ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { @@ -2891,7 +2891,7 @@ int ret = -EOPNOTSUPP; if (!netif_running(dev)) -@@ -2892,9 +2883,9 @@ static int stmmac_ioctl(struct net_devic +@@ -2893,9 +2884,9 @@ static int stmmac_ioctl(struct net_devic case SIOCGMIIPHY: case SIOCGMIIREG: case SIOCSMIIREG: @@ -2903,7 +2903,7 @@ break; case SIOCSHWTSTAMP: ret = stmmac_hwtstamp_ioctl(dev, rq); -@@ -2922,14 +2913,17 @@ static void sysfs_display_ring(void *hea +@@ -2923,14 +2914,17 @@ static void sysfs_display_ring(void *hea x = *(u64 *) ep; seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), @@ -2924,7 +2924,7 @@ p++; } seq_printf(seq, "\n"); -@@ -2961,6 +2955,8 @@ static int stmmac_sysfs_ring_open(struct +@@ -2962,6 +2956,8 @@ static int stmmac_sysfs_ring_open(struct return single_open(file, stmmac_sysfs_ring_read, inode->i_private); } @@ -2933,7 +2933,7 @@ static const struct file_operations stmmac_rings_status_fops = { .owner = THIS_MODULE, .open = stmmac_sysfs_ring_open, -@@ -2983,11 +2979,11 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2984,11 +2980,11 @@ static int stmmac_sysfs_dma_cap_read(str seq_printf(seq, "\tDMA HW features\n"); seq_printf(seq, "==============================\n"); @@ -2948,7 +2948,7 @@ (priv->dma_cap.half_duplex) ? "Y" : "N"); seq_printf(seq, "\tHash Filter: %s\n", (priv->dma_cap.hash_filter) ? "Y" : "N"); -@@ -3005,9 +3001,9 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -3006,9 +3002,9 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.rmon) ? "Y" : "N"); seq_printf(seq, "\tIEEE 1588-2002 Time Stamp: %s\n", (priv->dma_cap.time_stamp) ? "Y" : "N"); @@ -2960,7 +2960,7 @@ (priv->dma_cap.eee) ? "Y" : "N"); seq_printf(seq, "\tAV features: %s\n", (priv->dma_cap.av) ? "Y" : "N"); seq_printf(seq, "\tChecksum Offload in TX: %s\n", -@@ -3054,8 +3050,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3055,8 +3051,7 @@ static int stmmac_init_fs(struct net_dev priv->dbgfs_dir = debugfs_create_dir(dev->name, stmmac_fs_dir); if (!priv->dbgfs_dir || IS_ERR(priv->dbgfs_dir)) { @@ -2970,7 +2970,7 @@ return -ENOMEM; } -@@ -3067,7 +3062,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3068,7 +3063,7 @@ static int stmmac_init_fs(struct net_dev &stmmac_rings_status_fops); if (!priv->dbgfs_rings_status || IS_ERR(priv->dbgfs_rings_status)) { @@ -2979,7 +2979,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3079,7 +3074,7 @@ static int stmmac_init_fs(struct net_dev +@@ -3080,7 +3075,7 @@ static int stmmac_init_fs(struct net_dev dev, &stmmac_dma_cap_fops); if (!priv->dbgfs_dma_cap || IS_ERR(priv->dbgfs_dma_cap)) { @@ -2988,7 +2988,7 @@ debugfs_remove_recursive(priv->dbgfs_dir); return -ENOMEM; -@@ -3151,11 +3146,11 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3152,11 +3147,11 @@ static int stmmac_hw_init(struct stmmac_ } else { if (chain_mode) { priv->hw->mode = &chain_mode_ops; @@ -3002,7 +3002,7 @@ priv->mode = STMMAC_RING_MODE; } } -@@ -3163,7 +3158,7 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3164,7 +3159,7 @@ static int stmmac_hw_init(struct stmmac_ /* Get the HW capability (new GMAC newer than 3.50a) */ priv->hw_cap_support = stmmac_get_hw_features(priv); if (priv->hw_cap_support) { @@ -3011,7 +3011,7 @@ /* We can override some gmac/dma configuration fields: e.g. * enh_desc, tx_coe (e.g. that are passed through the -@@ -3188,8 +3183,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3189,8 +3184,9 @@ static int stmmac_hw_init(struct stmmac_ else if (priv->dma_cap.rx_coe_type1) priv->plat->rx_coe = STMMAC_RX_COE_TYPE1; @@ -3023,7 +3023,7 @@ /* To use alternate (extended), normal or GMAC4 descriptor structures */ if (priv->synopsys_id >= DWMAC_CORE_4_00) -@@ -3199,20 +3195,20 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3200,20 +3196,20 @@ static int stmmac_hw_init(struct stmmac_ if (priv->plat->rx_coe) { priv->hw->rx_csum = priv->plat->rx_coe; @@ -3049,7 +3049,7 @@ return 0; } -@@ -3271,8 +3267,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3272,8 +3268,8 @@ int stmmac_dvr_probe(struct device *devi priv->stmmac_clk = devm_clk_get(priv->device, STMMAC_RESOURCE_NAME); if (IS_ERR(priv->stmmac_clk)) { @@ -3060,7 +3060,7 @@ /* If failed to obtain stmmac_clk and specific clk_csr value * is NOT passed from the platform, probe fail. */ -@@ -3321,7 +3317,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -3322,7 +3318,7 @@ int stmmac_dvr_probe(struct device *devi if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { ndev->hw_features |= NETIF_F_TSO; priv->tso = true; @@ -3069,7 +3069,7 @@ } ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; ndev->watchdog_timeo = msecs_to_jiffies(watchdog); -@@ -3341,13 +3337,13 @@ int stmmac_dvr_probe(struct device *devi +@@ -3342,13 +3338,13 @@ int stmmac_dvr_probe(struct device *devi */ if ((priv->synopsys_id >= DWMAC_CORE_3_50) && (!priv->plat->riwt_off)) { priv->use_riwt = 1; @@ -3085,7 +3085,7 @@ /* If a specific clk_csr value is passed from the platform * this means that the CSR Clock Range selection cannot be -@@ -3368,15 +3364,17 @@ int stmmac_dvr_probe(struct device *devi +@@ -3369,15 +3365,17 @@ int stmmac_dvr_probe(struct device *devi /* MDIO bus Registration */ ret = stmmac_mdio_register(ndev); if (ret < 0) { @@ -3107,7 +3107,7 @@ goto error_netdev_register; } -@@ -3387,7 +3385,7 @@ error_netdev_register: +@@ -3388,7 +3386,7 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); @@ -3116,7 +3116,7 @@ netif_napi_del(&priv->napi); error_hw_init: clk_disable_unprepare(priv->pclk); -@@ -3411,7 +3409,7 @@ int stmmac_dvr_remove(struct device *dev +@@ -3412,7 +3410,7 @@ int stmmac_dvr_remove(struct device *dev struct net_device *ndev = dev_get_drvdata(dev); struct stmmac_priv *priv = netdev_priv(ndev); @@ -3125,7 +3125,7 @@ priv->hw->dma->stop_rx(priv->ioaddr); priv->hw->dma->stop_tx(priv->ioaddr); -@@ -3449,8 +3447,8 @@ int stmmac_suspend(struct device *dev) +@@ -3450,8 +3448,8 @@ int stmmac_suspend(struct device *dev) if (!ndev || !netif_running(ndev)) return 0; @@ -3136,7 +3136,7 @@ spin_lock_irqsave(&priv->lock, flags); -@@ -3544,8 +3542,8 @@ int stmmac_resume(struct device *dev) +@@ -3545,8 +3543,8 @@ int stmmac_resume(struct device *dev) spin_unlock_irqrestore(&priv->lock, flags); diff --git a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch index abd130448..fc626cbb9 100644 --- a/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch +++ b/target/linux/sunxi/patches-4.9/0051-stmmac-form-4-11.patch @@ -1718,7 +1718,7 @@ priv->tx_lpi_timer = STMMAC_DEFAULT_TWT_LS; if ((priv->use_riwt) && (priv->hw->dma->rx_watchdog)) { -@@ -2519,7 +2517,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2520,7 +2518,7 @@ static int stmmac_rx(struct stmmac_priv if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; if (priv->hwts_rx_en && !priv->extend_desc) { @@ -1727,7 +1727,7 @@ * with timestamp value, hence reinitialize * them in stmmac_rx_refill() function so that * device can reuse it. -@@ -2542,7 +2540,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2543,7 +2541,7 @@ static int stmmac_rx(struct stmmac_priv frame_len = priv->hw->desc->get_rx_frame_len(p, coe); @@ -1736,7 +1736,7 @@ * (preallocated during init) then the packet is * ignored */ -@@ -2762,7 +2760,7 @@ static netdev_features_t stmmac_fix_feat +@@ -2763,7 +2761,7 @@ static netdev_features_t stmmac_fix_feat /* Some GMAC devices have a bugged Jumbo frame support that * needs to have the Tx COE disabled for oversized frames * (due to limited buffer sizes). In this case we disable @@ -1745,7 +1745,7 @@ */ if (priv->plat->bugged_jumbo && (dev->mtu > ETH_DATA_LEN)) features &= ~NETIF_F_CSUM_MASK; -@@ -2908,9 +2906,7 @@ static void sysfs_display_ring(void *hea +@@ -2909,9 +2907,7 @@ static void sysfs_display_ring(void *hea struct dma_desc *p = (struct dma_desc *)head; for (i = 0; i < size; i++) { @@ -1755,7 +1755,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(ep->basic.des0), -@@ -2919,7 +2915,6 @@ static void sysfs_display_ring(void *hea +@@ -2920,7 +2916,6 @@ static void sysfs_display_ring(void *hea le32_to_cpu(ep->basic.des3)); ep++; } else { @@ -1763,7 +1763,7 @@ seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", i, (unsigned int)virt_to_phys(ep), le32_to_cpu(p->des0), le32_to_cpu(p->des1), -@@ -2989,7 +2984,7 @@ static int stmmac_sysfs_dma_cap_read(str +@@ -2990,7 +2985,7 @@ static int stmmac_sysfs_dma_cap_read(str (priv->dma_cap.hash_filter) ? "Y" : "N"); seq_printf(seq, "\tMultiple MAC address registers: %s\n", (priv->dma_cap.multi_addr) ? "Y" : "N"); @@ -1772,7 +1772,7 @@ (priv->dma_cap.pcs) ? "Y" : "N"); seq_printf(seq, "\tSMA (MDIO) Interface: %s\n", (priv->dma_cap.sma_mdio) ? "Y" : "N"); -@@ -3265,44 +3260,8 @@ int stmmac_dvr_probe(struct device *devi +@@ -3266,44 +3261,8 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1819,7 +1819,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -3388,10 +3347,6 @@ error_netdev_register: +@@ -3389,10 +3348,6 @@ error_netdev_register: error_mdio_register: netif_napi_del(&priv->napi); error_hw_init: @@ -1830,7 +1830,7 @@ free_netdev(ndev); return ret; -@@ -3417,10 +3372,10 @@ int stmmac_dvr_remove(struct device *dev +@@ -3418,10 +3373,10 @@ int stmmac_dvr_remove(struct device *dev stmmac_set_mac(priv->ioaddr, false); netif_carrier_off(ndev); unregister_netdev(ndev); @@ -1845,7 +1845,7 @@ if (priv->hw->pcs != STMMAC_PCS_RGMII && priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) -@@ -3469,14 +3424,14 @@ int stmmac_suspend(struct device *dev) +@@ -3470,14 +3425,14 @@ int stmmac_suspend(struct device *dev) stmmac_set_mac(priv->ioaddr, false); pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ @@ -1864,7 +1864,7 @@ return 0; } EXPORT_SYMBOL_GPL(stmmac_suspend); -@@ -3509,9 +3464,9 @@ int stmmac_resume(struct device *dev) +@@ -3510,9 +3465,9 @@ int stmmac_resume(struct device *dev) priv->irq_wake = 0; } else { pinctrl_pm_select_default_state(priv->device); diff --git a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch index 285e4d276..18f58e947 100644 --- a/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch +++ b/target/linux/sunxi/patches-4.9/0052-stmmac-form-4-12.patch @@ -4523,7 +4523,7 @@ /** * stmmac_open - open entry point of the driver * @dev : pointer to the device structure. -@@ -1821,7 +2598,7 @@ static int stmmac_open(struct net_device +@@ -1822,7 +2599,7 @@ static int stmmac_open(struct net_device netdev_err(priv->dev, "%s: ERROR: allocating the IRQ %d (error: %d)\n", __func__, dev->irq, ret); @@ -4532,7 +4532,7 @@ } /* Request the Wake IRQ in case of another line is used for WoL */ -@@ -1848,8 +2625,8 @@ static int stmmac_open(struct net_device +@@ -1849,8 +2626,8 @@ static int stmmac_open(struct net_device } } @@ -4543,7 +4543,7 @@ return 0; -@@ -1858,7 +2635,12 @@ lpiirq_error: +@@ -1859,7 +2636,12 @@ lpiirq_error: free_irq(priv->wol_irq, dev); wolirq_error: free_irq(dev->irq, dev); @@ -4556,7 +4556,7 @@ init_error: free_dma_desc_resources(priv); dma_desc_error: -@@ -1887,9 +2669,9 @@ static int stmmac_release(struct net_dev +@@ -1888,9 +2670,9 @@ static int stmmac_release(struct net_dev phy_disconnect(dev->phydev); } @@ -4568,7 +4568,7 @@ del_timer_sync(&priv->txtimer); -@@ -1901,14 +2683,13 @@ static int stmmac_release(struct net_dev +@@ -1902,14 +2684,13 @@ static int stmmac_release(struct net_dev free_irq(priv->lpi_irq, dev); /* Stop TX/RX DMA and clear the descriptors */ @@ -4585,7 +4585,7 @@ netif_carrier_off(dev); -@@ -1927,22 +2708,24 @@ static int stmmac_release(struct net_dev +@@ -1928,22 +2709,24 @@ static int stmmac_release(struct net_dev * @des: buffer start address * @total_len: total length to fill in descriptors * @last_segmant: condition for the last descriptor @@ -4614,7 +4614,7 @@ desc->des0 = cpu_to_le32(des + (total_len - tmp_len)); buff_size = tmp_len >= TSO_MAX_BUFF_SIZE ? -@@ -1950,7 +2733,7 @@ static void stmmac_tso_allocator(struct +@@ -1951,7 +2734,7 @@ static void stmmac_tso_allocator(struct priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size, 0, 1, @@ -4623,7 +4623,7 @@ 0, 0); tmp_len -= TSO_MAX_BUFF_SIZE; -@@ -1986,23 +2769,28 @@ static void stmmac_tso_allocator(struct +@@ -1987,23 +2770,28 @@ static void stmmac_tso_allocator(struct */ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev) { @@ -4658,7 +4658,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2017,10 +2805,10 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2018,10 +2806,10 @@ static netdev_tx_t stmmac_tso_xmit(struc /* set new MSS value if needed */ if (mss != priv->mss) { @@ -4671,7 +4671,7 @@ } if (netif_msg_tx_queued(priv)) { -@@ -2030,9 +2818,9 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2031,9 +2819,9 @@ static netdev_tx_t stmmac_tso_xmit(struc skb->data_len); } @@ -4683,7 +4683,7 @@ first = desc; /* first descriptor: fill Headers on Buf1 */ -@@ -2041,9 +2829,8 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2042,9 +2830,8 @@ static netdev_tx_t stmmac_tso_xmit(struc if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4695,7 +4695,7 @@ first->des0 = cpu_to_le32(des); -@@ -2054,7 +2841,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2055,7 +2842,7 @@ static netdev_tx_t stmmac_tso_xmit(struc /* If needed take extra descriptors to fill the remaining payload */ tmp_pay_len = pay_len - TSO_MAX_BUFF_SIZE; @@ -4704,7 +4704,7 @@ /* Prepare fragments */ for (i = 0; i < nfrags; i++) { -@@ -2063,24 +2850,34 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2064,24 +2851,34 @@ static netdev_tx_t stmmac_tso_xmit(struc des = skb_frag_dma_map(priv->device, frag, 0, skb_frag_size(frag), DMA_TO_DEVICE); @@ -4748,7 +4748,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2112,7 +2909,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2113,7 +2910,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->hw->desc->prepare_tso_tx_desc(first, 1, proto_hdr_len, pay_len, @@ -4757,7 +4757,7 @@ tcp_hdrlen(skb) / 4, (skb->len - proto_hdr_len)); /* If context desc is used to change MSS */ -@@ -2127,20 +2924,20 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2128,20 +2925,20 @@ static netdev_tx_t stmmac_tso_xmit(struc if (netif_msg_pktdata(priv)) { pr_info("%s: curr=%d dirty=%d f=%d, e=%d, f_p=%p, nfrags %d\n", @@ -4784,7 +4784,7 @@ return NETDEV_TX_OK; -@@ -2164,21 +2961,27 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2165,21 +2962,27 @@ static netdev_tx_t stmmac_xmit(struct sk struct stmmac_priv *priv = netdev_priv(dev); unsigned int nopaged_len = skb_headlen(skb); int i, csum_insertion = 0, is_jumbo = 0; @@ -4816,7 +4816,7 @@ /* This is a hard error, log it. */ netdev_err(priv->dev, "%s: Tx Ring full when queue awake\n", -@@ -2190,20 +2993,18 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2191,20 +2994,18 @@ static netdev_tx_t stmmac_xmit(struct sk if (priv->tx_path_in_lpi_mode) stmmac_disable_eee_mode(priv); @@ -4840,7 +4840,7 @@ enh_desc = priv->plat->enh_desc; /* To program the descriptors according to the size of the frame */ if (enh_desc) -@@ -2211,7 +3012,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2212,7 +3013,7 @@ static netdev_tx_t stmmac_xmit(struct sk if (unlikely(is_jumbo) && likely(priv->synopsys_id < DWMAC_CORE_4_00)) { @@ -4849,7 +4849,7 @@ if (unlikely(entry < 0)) goto dma_map_err; } -@@ -2224,48 +3025,56 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2225,48 +3026,56 @@ static netdev_tx_t stmmac_xmit(struct sk entry = STMMAC_GET_ENTRY(entry, DMA_TX_SIZE); if (likely(priv->extend_desc)) @@ -4919,7 +4919,7 @@ priv->hw->desc->display_ring(tx_head, DMA_TX_SIZE, false); -@@ -2273,10 +3082,10 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2274,10 +3083,10 @@ static netdev_tx_t stmmac_xmit(struct sk print_pkt(skb->data, skb->len); } @@ -4932,7 +4932,7 @@ } dev->stats.tx_bytes += skb->len; -@@ -2311,14 +3120,14 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2312,14 +3121,14 @@ static netdev_tx_t stmmac_xmit(struct sk if (dma_mapping_error(priv->device, des)) goto dma_map_err; @@ -4950,7 +4950,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2330,7 +3139,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2331,7 +3140,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Prepare the first descriptor setting the OWN bit too */ priv->hw->desc->prepare_tx_desc(first, 1, nopaged_len, csum_insertion, priv->mode, 1, @@ -4959,7 +4959,7 @@ /* The own bit must be the latest setting done when prepare the * descriptor and then barrier is needed to make sure that -@@ -2339,13 +3148,13 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2340,13 +3149,13 @@ static netdev_tx_t stmmac_xmit(struct sk dma_wmb(); } @@ -4976,7 +4976,7 @@ return NETDEV_TX_OK; -@@ -2373,9 +3182,9 @@ static void stmmac_rx_vlan(struct net_de +@@ -2374,9 +3183,9 @@ static void stmmac_rx_vlan(struct net_de } @@ -4988,7 +4988,7 @@ return 0; return 1; -@@ -2384,30 +3193,33 @@ static inline int stmmac_rx_threshold_co +@@ -2385,30 +3194,33 @@ static inline int stmmac_rx_threshold_co /** * stmmac_rx_refill - refill used skb preallocated buffers * @priv: driver private structure @@ -5029,7 +5029,7 @@ if (unlikely(net_ratelimit())) dev_err(priv->device, "fail to alloc skb entry %d\n", -@@ -2415,28 +3227,28 @@ static inline void stmmac_rx_refill(stru +@@ -2416,28 +3228,28 @@ static inline void stmmac_rx_refill(stru break; } @@ -5066,7 +5066,7 @@ netif_dbg(priv, rx_status, priv->dev, "refill entry #%d\n", entry); -@@ -2452,31 +3264,33 @@ static inline void stmmac_rx_refill(stru +@@ -2453,31 +3265,33 @@ static inline void stmmac_rx_refill(stru entry = STMMAC_GET_ENTRY(entry, DMA_RX_SIZE); } @@ -5107,7 +5107,7 @@ priv->hw->desc->display_ring(rx_head, DMA_RX_SIZE, true); } -@@ -2486,9 +3300,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2487,9 +3301,9 @@ static int stmmac_rx(struct stmmac_priv struct dma_desc *np; if (priv->extend_desc) @@ -5119,7 +5119,7 @@ /* read the status of the incoming frame */ status = priv->hw->desc->rx_status(&priv->dev->stats, -@@ -2499,20 +3313,20 @@ static int stmmac_rx(struct stmmac_priv +@@ -2500,20 +3314,20 @@ static int stmmac_rx(struct stmmac_priv count++; @@ -5145,7 +5145,7 @@ entry); if (unlikely(status == discard_frame)) { priv->dev->stats.rx_errors++; -@@ -2522,9 +3336,9 @@ static int stmmac_rx(struct stmmac_priv +@@ -2523,9 +3337,9 @@ static int stmmac_rx(struct stmmac_priv * them in stmmac_rx_refill() function so that * device can reuse it. */ @@ -5157,7 +5157,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2572,7 +3386,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2573,7 +3387,7 @@ static int stmmac_rx(struct stmmac_priv */ if (unlikely(!priv->plat->has_gmac4 && ((frame_len < priv->rx_copybreak) || @@ -5166,7 +5166,7 @@ skb = netdev_alloc_skb_ip_align(priv->dev, frame_len); if (unlikely(!skb)) { -@@ -2584,21 +3398,21 @@ static int stmmac_rx(struct stmmac_priv +@@ -2585,21 +3399,21 @@ static int stmmac_rx(struct stmmac_priv } dma_sync_single_for_cpu(priv->device, @@ -5192,7 +5192,7 @@ if (unlikely(!skb)) { netdev_err(priv->dev, "%s: Inconsistent Rx chain\n", -@@ -2607,12 +3421,12 @@ static int stmmac_rx(struct stmmac_priv +@@ -2608,12 +3422,12 @@ static int stmmac_rx(struct stmmac_priv break; } prefetch(skb->data - NET_IP_ALIGN); @@ -5208,7 +5208,7 @@ priv->dma_buf_sz, DMA_FROM_DEVICE); } -@@ -2634,7 +3448,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2635,7 +3449,7 @@ static int stmmac_rx(struct stmmac_priv else skb->ip_summed = CHECKSUM_UNNECESSARY; @@ -5217,7 +5217,7 @@ priv->dev->stats.rx_packets++; priv->dev->stats.rx_bytes += frame_len; -@@ -2642,7 +3456,7 @@ static int stmmac_rx(struct stmmac_priv +@@ -2643,7 +3457,7 @@ static int stmmac_rx(struct stmmac_priv entry = next_entry; } @@ -5226,7 +5226,7 @@ priv->xstats.rx_pkt_n += count; -@@ -2659,16 +3473,24 @@ static int stmmac_rx(struct stmmac_priv +@@ -2660,16 +3474,24 @@ static int stmmac_rx(struct stmmac_priv */ static int stmmac_poll(struct napi_struct *napi, int budget) { @@ -5255,7 +5255,7 @@ } return work_done; } -@@ -2684,9 +3506,12 @@ static int stmmac_poll(struct napi_struc +@@ -2685,9 +3507,12 @@ static int stmmac_poll(struct napi_struc static void stmmac_tx_timeout(struct net_device *dev) { struct stmmac_priv *priv = netdev_priv(dev); @@ -5269,7 +5269,7 @@ } /** -@@ -2809,6 +3634,12 @@ static irqreturn_t stmmac_interrupt(int +@@ -2810,6 +3635,12 @@ static irqreturn_t stmmac_interrupt(int { struct net_device *dev = (struct net_device *)dev_id; struct stmmac_priv *priv = netdev_priv(dev); @@ -5282,7 +5282,7 @@ if (priv->irq_wake) pm_wakeup_event(priv->device, 0); -@@ -2822,16 +3653,30 @@ static irqreturn_t stmmac_interrupt(int +@@ -2823,16 +3654,30 @@ static irqreturn_t stmmac_interrupt(int if ((priv->plat->has_gmac) || (priv->plat->has_gmac4)) { int status = priv->hw->mac->host_irq_status(priv->hw, &priv->xstats); @@ -5317,7 +5317,7 @@ } /* PCS link status */ -@@ -2916,7 +3761,7 @@ static void sysfs_display_ring(void *hea +@@ -2917,7 +3762,7 @@ static void sysfs_display_ring(void *hea ep++; } else { seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n", @@ -5326,7 +5326,7 @@ le32_to_cpu(p->des0), le32_to_cpu(p->des1), le32_to_cpu(p->des2), le32_to_cpu(p->des3)); p++; -@@ -2929,17 +3774,40 @@ static int stmmac_sysfs_ring_read(struct +@@ -2930,17 +3775,40 @@ static int stmmac_sysfs_ring_read(struct { struct net_device *dev = seq->private; struct stmmac_priv *priv = netdev_priv(dev); @@ -5377,7 +5377,7 @@ } return 0; -@@ -3222,11 +4090,14 @@ int stmmac_dvr_probe(struct device *devi +@@ -3223,11 +4091,14 @@ int stmmac_dvr_probe(struct device *devi struct plat_stmmacenet_data *plat_dat, struct stmmac_resources *res) { @@ -5394,7 +5394,7 @@ if (!ndev) return -ENOMEM; -@@ -3268,6 +4139,10 @@ int stmmac_dvr_probe(struct device *devi +@@ -3269,6 +4140,10 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; @@ -5405,7 +5405,7 @@ ndev->netdev_ops = &stmmac_netdev_ops; ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | -@@ -3300,7 +4175,12 @@ int stmmac_dvr_probe(struct device *devi +@@ -3301,7 +4176,12 @@ int stmmac_dvr_probe(struct device *devi "Enable RX Mitigation via HW Watchdog Timer\n"); } @@ -5419,7 +5419,7 @@ spin_lock_init(&priv->lock); -@@ -3345,7 +4225,11 @@ error_netdev_register: +@@ -3346,7 +4226,11 @@ error_netdev_register: priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); error_mdio_register: @@ -5432,7 +5432,7 @@ error_hw_init: free_netdev(ndev); -@@ -3366,10 +4250,9 @@ int stmmac_dvr_remove(struct device *dev +@@ -3367,10 +4251,9 @@ int stmmac_dvr_remove(struct device *dev netdev_info(priv->dev, "%s: removing driver", __func__); @@ -5445,7 +5445,7 @@ netif_carrier_off(ndev); unregister_netdev(ndev); if (priv->plat->stmmac_rst) -@@ -3408,20 +4291,19 @@ int stmmac_suspend(struct device *dev) +@@ -3409,20 +4292,19 @@ int stmmac_suspend(struct device *dev) spin_lock_irqsave(&priv->lock, flags); netif_device_detach(ndev); @@ -5470,7 +5470,7 @@ pinctrl_pm_select_sleep_state(priv->device); /* Disable clock in case of PWM is off */ clk_disable(priv->plat->pclk); -@@ -3437,6 +4319,31 @@ int stmmac_suspend(struct device *dev) +@@ -3438,6 +4320,31 @@ int stmmac_suspend(struct device *dev) EXPORT_SYMBOL_GPL(stmmac_suspend); /** @@ -5502,7 +5502,7 @@ * stmmac_resume - resume callback * @dev: device pointer * Description: when resume this function is invoked to setup the DMA and CORE -@@ -3476,10 +4383,8 @@ int stmmac_resume(struct device *dev) +@@ -3477,10 +4384,8 @@ int stmmac_resume(struct device *dev) spin_lock_irqsave(&priv->lock, flags); @@ -5515,7 +5515,7 @@ /* reset private mss value to force mss context settings at * next tso xmit (only used for gmac4). */ -@@ -3491,9 +4396,9 @@ int stmmac_resume(struct device *dev) +@@ -3492,9 +4397,9 @@ int stmmac_resume(struct device *dev) stmmac_init_tx_coalesce(priv); stmmac_set_rx_mode(ndev); diff --git a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch index f829b79dc..161e9f0e6 100644 --- a/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch +++ b/target/linux/sunxi/patches-4.9/0053-stmmac-form-4-13.patch @@ -1491,7 +1491,7 @@ free_dma_tx_desc_resources(priv); return ret; -@@ -2895,8 +2893,7 @@ static netdev_tx_t stmmac_tso_xmit(struc +@@ -2896,8 +2894,7 @@ static netdev_tx_t stmmac_tso_xmit(struc priv->xstats.tx_set_ic_bit++; } @@ -1501,7 +1501,7 @@ if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && priv->hwts_tx_en)) { -@@ -2974,7 +2971,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -2975,7 +2972,7 @@ static netdev_tx_t stmmac_xmit(struct sk /* Manage oversized TCP frames for GMAC4 device */ if (skb_is_gso(skb) && priv->tso) { @@ -1510,7 +1510,7 @@ return stmmac_tso_xmit(skb, dev); } -@@ -3105,8 +3102,7 @@ static netdev_tx_t stmmac_xmit(struct sk +@@ -3106,8 +3103,7 @@ static netdev_tx_t stmmac_xmit(struct sk priv->xstats.tx_set_ic_bit++; } @@ -1520,7 +1520,7 @@ /* Ready to fill the first descriptor and set the OWN bit w/o any * problems because all the descriptors are actually ready to be -@@ -3983,7 +3979,9 @@ static int stmmac_hw_init(struct stmmac_ +@@ -3984,7 +3980,9 @@ static int stmmac_hw_init(struct stmmac_ struct mac_device_info *mac; /* Identify the MAC HW device */ @@ -1531,7 +1531,7 @@ priv->dev->priv_flags |= IFF_UNICAST_FLT; mac = dwmac1000_setup(priv->ioaddr, priv->plat->multicast_filter_bins, -@@ -4003,6 +4001,10 @@ static int stmmac_hw_init(struct stmmac_ +@@ -4004,6 +4002,10 @@ static int stmmac_hw_init(struct stmmac_ priv->hw = mac; @@ -1542,7 +1542,7 @@ /* To use the chained or ring mode */ if (priv->synopsys_id >= DWMAC_CORE_4_00) { priv->hw->mode = &dwmac4_ring_mode_ops; -@@ -4131,8 +4133,15 @@ int stmmac_dvr_probe(struct device *devi +@@ -4132,8 +4134,15 @@ int stmmac_dvr_probe(struct device *devi if ((phyaddr >= 0) && (phyaddr <= 31)) priv->plat->phy_addr = phyaddr; @@ -1559,7 +1559,7 @@ /* Init MAC and get the capabilities */ ret = stmmac_hw_init(priv); -@@ -4149,7 +4158,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -4150,7 +4159,7 @@ int stmmac_dvr_probe(struct device *devi NETIF_F_RXCSUM; if ((priv->plat->tso_en) && (priv->dma_cap.tsoen)) { @@ -1568,7 +1568,7 @@ priv->tso = true; dev_info(priv->device, "TSO feature enabled\n"); } -@@ -4311,7 +4320,7 @@ int stmmac_suspend(struct device *dev) +@@ -4312,7 +4321,7 @@ int stmmac_suspend(struct device *dev) } spin_unlock_irqrestore(&priv->lock, flags); From fdc5c1ce04de4494e49077a27561cc3753749f27 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:06:44 +0800 Subject: [PATCH 44/95] kernel: add i2c-smbus module package --- package/kernel/linux/modules/i2c.mk | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk index 5141766a9..14c5b6448 100644 --- a/package/kernel/linux/modules/i2c.mk +++ b/package/kernel/linux/modules/i2c.mk @@ -143,13 +143,12 @@ $(eval $(call KernelPackage,i2c-piix4)) I2C_I801_MODULES:= \ - CONFIG_I2C_I801:drivers/i2c/busses/i2c-i801 \ - CONFIG_I2C_SMBUS:drivers/i2c/i2c-smbus + CONFIG_I2C_I801:drivers/i2c/busses/i2c-i801 define KernelPackage/i2c-i801 $(call i2c_defaults,$(I2C_I801_MODULES),59) TITLE:=Intel I801 and compatible I2C interfaces - DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core + DEPENDS:=@PCI_SUPPORT @TARGET_x86 kmod-i2c-core +kmod-i2c-smbus endef define KernelPackage/i2c-i801/description @@ -168,6 +167,22 @@ endef $(eval $(call KernelPackage,i2c-i801)) +I2C_SMBUS_MODULES:= \ + CONFIG_I2C_SMBUS:drivers/i2c/i2c-smbus + +define KernelPackage/i2c-smbus + $(call i2c_defaults,$(I2C_SMBUS_MODULES),58) + TITLE:=SMBus-specific protocols helper + DEPENDS:=kmod-i2c-core +endef + +define KernelPackage/i2c-smbus/description + Support for the SMBus extensions to the I2C specification. +endef + +$(eval $(call KernelPackage,i2c-smbus)) + + I2C_MUX_MODULES:= \ CONFIG_I2C_MUX:drivers/i2c/i2c-mux From d1a4dbb0a5bc1252834e217f700dc89396fbb5b7 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:12:19 +0800 Subject: [PATCH 45/95] kernel update to 4.4.108 and 4.9.72 --- include/kernel-version.mk | 8 +- ...U-port-fixes-for-devices-not-using-p.patch | 4 +- .../base-files/etc/board.d/02_network | 12 +- target/linux/brcm2708/base-files/etc/diag.sh | 11 +- .../linux/brcm2708/base-files/lib/brcm2708.sh | 43 ------- .../lib/preinit/01_preinit_do_brcm2708.sh | 10 -- .../lib/preinit/05_set_preinit_iface_brcm2708 | 9 +- .../base-files/lib/upgrade/keep.d/platform | 1 + .../base-files/lib/upgrade/platform.sh | 106 +++++++++++++++--- target/linux/brcm2708/image/Makefile | 7 +- .../960-add-rasbperrypi-compatible.patch | 70 ++++++++++++ ...-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch | 2 +- ...90-net-generalize-napi_complete_done.patch | 2 +- .../generic/hack-4.9/721-phy_packets.patch | 2 +- .../generic/hack-4.9/902-debloat_proc.patch | 6 +- .../653-disable_netlink_trim.patch | 2 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 8 +- .../202-core-linux-support-layerscape.patch | 2 +- .../301-arch-support-layerscape.patch | 2 +- .../804-crypto-support-layerscape.patch | 8 +- .../817-usb-support-layerscape.patch | 2 +- .../0048-net-core-add-RPS-balancer.patch | 6 +- ...25-pinctrl-ralink-add-pinctrl-driver.patch | 2 +- 23 files changed, 210 insertions(+), 115 deletions(-) delete mode 100644 target/linux/brcm2708/base-files/lib/brcm2708.sh delete mode 100644 target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh create mode 100644 target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform create mode 100644 target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 762c2a723..8c5af2f76 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,13 +3,13 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .107 -LINUX_VERSION-4.9 = .70 +LINUX_VERSION-4.4 = .108 +LINUX_VERSION-4.9 = .72 LINUX_VERSION-4.14 = .6 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.107 = d25dc23c8b05d34518ede68f03668cd344f805049a16bc4f189da90533881a17 -LINUX_KERNEL_HASH-4.9.70 = baaf45f3826fa0d257a42005240cced402a12c99adf2a8d77402738304d5300a +LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a +LINUX_KERNEL_HASH-4.9.72 = 69f201f1eb9eade9a3cde26d3896a53df9fddf1e19f9fa7b36331b8b1976b83b LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc ifdef KERNEL_PATCHVER diff --git a/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch b/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch index 244a4a658..91bb4fae1 100644 --- a/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch +++ b/target/linux/bcm53xx/patches-4.9/700-b53-add-hacky-CPU-port-fixes-for-devices-not-using-p.patch @@ -13,7 +13,7 @@ Signed-off-by: RafaÅ‚ MiÅ‚ecki --- a/drivers/net/phy/b53/b53_common.c +++ b/drivers/net/phy/b53/b53_common.c -@@ -27,6 +27,7 @@ +@@ -28,6 +28,7 @@ #include #include #include @@ -21,7 +21,7 @@ Signed-off-by: RafaÅ‚ MiÅ‚ecki #include "b53_regs.h" #include "b53_priv.h" -@@ -1578,6 +1579,28 @@ static int b53_switch_init(struct b53_de +@@ -1579,6 +1580,28 @@ static int b53_switch_init(struct b53_de return ret; } diff --git a/target/linux/brcm2708/base-files/etc/board.d/02_network b/target/linux/brcm2708/base-files/etc/board.d/02_network index 29bcf33e3..a9c947b65 100755 --- a/target/linux/brcm2708/base-files/etc/board.d/02_network +++ b/target/linux/brcm2708/base-files/etc/board.d/02_network @@ -11,13 +11,15 @@ board_config_update board=$(board_name) case "$board" in -rpi-2-b |\ -rpi-3-b |\ -rpi-b |\ -rpi-b-plus) +raspberrypi,model-b |\ +raspberrypi,model-b-plus |\ +raspberrypi,model-b-rev2 |\ +raspberrypi,2-model-b |\ +raspberrypi,3-model-b) ucidef_set_interface_lan "eth0" ;; -rpi-zero-w) + +raspberrypi,model-zero-w) ucidef_set_interface_lan "wlan0" ;; esac diff --git a/target/linux/brcm2708/base-files/etc/diag.sh b/target/linux/brcm2708/base-files/etc/diag.sh index 6f5810ed5..ce0f59151 100644 --- a/target/linux/brcm2708/base-files/etc/diag.sh +++ b/target/linux/brcm2708/base-files/etc/diag.sh @@ -7,14 +7,13 @@ set_state() { case "$(board_name)" in - rpi-2-b |\ - rpi-b-plus) + raspberrypi,2-model-b |\ + raspberrypi,model-b-plus) status_led="led1" ;; - rpi-b |\ - rpi-cm |\ - rpi-zero |\ - rpi-zero-w) + raspberrypi,model-b |\ + raspberrypi,model-zero |\ + raspberrypi,model-zero-w) status_led="led0" ;; esac diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh b/target/linux/brcm2708/base-files/lib/brcm2708.sh deleted file mode 100644 index 76e678ff9..000000000 --- a/target/linux/brcm2708/base-files/lib/brcm2708.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# Copyright (C) 2015-2016 OpenWrt.org -# Copyright (C) 2017 LEDE project - -ifname="" - -brcm2708_detect() { - local board_name model - - model=$(cat /proc/device-tree/model) - case "$model" in - "Raspberry Pi 2 Model B Rev"*) - board_name="rpi-2-b" - ;; - "Raspberry Pi 3 Model B Rev"*) - board_name="rpi-3-b" - ;; - "Raspberry Pi Compute Module Rev"*) - board_name="rpi-cm" - ;; - "Raspberry Pi Model B Plus Rev"* |\ - "Raspberry Pi Model B+ Rev"*) - board_name="rpi-b-plus" - ;; - "Raspberry Pi Model B Rev"*) - board_name="rpi-b" - ;; - "Raspberry Pi Zero Rev"*) - board_name="rpi-zero" - ;; - "Raspberry Pi Zero W Rev"*) - board_name="rpi-zero-w" - ;; - *) - board_name="unknown" - ;; - esac - - [ -e "/tmp/sysinfo" ] || mkdir -p "/tmp/sysinfo" - - echo "$board_name" > /tmp/sysinfo/board_name - echo "$model" > /tmp/sysinfo/model -} diff --git a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh b/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh deleted file mode 100644 index 294364848..000000000 --- a/target/linux/brcm2708/base-files/lib/preinit/01_preinit_do_brcm2708.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -# Copyright (C) 2015 OpenWrt.org - -do_brcm2708() { - . /lib/brcm2708.sh - - brcm2708_detect -} - -boot_hook_add preinit_main do_brcm2708 diff --git a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 index 95497cc58..76eb5905e 100644 --- a/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 +++ b/target/linux/brcm2708/base-files/lib/preinit/05_set_preinit_iface_brcm2708 @@ -6,10 +6,11 @@ set_preinit_iface() { . /lib/functions.sh case "$(board_name)" in - rpi-2-b |\ - rpi-3-b |\ - rpi-b |\ - rpi-b-plus) + raspberrypi,2-model-b |\ + raspberrypi,3-model-b |\ + raspberrypi,model-b |\ + raspberrypi,model-b-plus |\ + raspberrypi,model-b-rev2) ifname=eth0 ;; esac diff --git a/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform new file mode 100644 index 000000000..786796577 --- /dev/null +++ b/target/linux/brcm2708/base-files/lib/upgrade/keep.d/platform @@ -0,0 +1 @@ +/boot/config.txt diff --git a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh index 2f2aeb098..b9cd8d282 100644 --- a/target/linux/brcm2708/base-files/lib/upgrade/platform.sh +++ b/target/linux/brcm2708/base-files/lib/upgrade/platform.sh @@ -1,32 +1,104 @@ -get_magic_at() { - local file="$1" - local pos="$2" - get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"' -} +. /lib/functions.sh + +REQUIRE_IMAGE_METADATA=1 + +# copied from x86's platform.sh platform_check_image() { - local file="$1" - local magic + local diskdev partdev diff - magic=$(get_magic_at "$file" 510) - [ "$magic" != "55aa" ] && { - echo "Failed to verify MBR boot signature." + [ "$#" -gt 1 ] && return 1 + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" return 1 } + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi + return 0; } platform_do_upgrade() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" + return 1 + } + sync - get_image "$1" | dd of=/dev/mmcblk0 bs=2M conv=fsync - sleep 1 + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=2M conv=fsync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync } platform_copy_config() { - mkdir -p /boot - [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime /dev/mmcblk0p1 /boot - cp -af "$CONF_TAR" /boot/ - sync - umount /boot + local partdev + + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then + mkdir -p /boot + [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot + cp -af "$CONF_TAR" /boot/ + tar --directory / -xvf "$CONF_TAR" boot/config.txt + sync + unmount /boot + fi } diff --git a/target/linux/brcm2708/image/Makefile b/target/linux/brcm2708/image/Makefile index 7909c6d81..9ea9a07a9 100644 --- a/target/linux/brcm2708/image/Makefile +++ b/target/linux/brcm2708/image/Makefile @@ -50,13 +50,14 @@ define Device/Default FILESYSTEMS := ext4 KERNEL := kernel-bin | kernel-img KERNEL_IMG := kernel.img - IMAGES := sdcard.img - IMAGE/sdcard.img := boot-img | sdcard-img + IMAGES := sdcard.img.gz + IMAGE/sdcard.img.gz := boot-img | sdcard-img | gzip | append-metadata endef define Device/rpi DEVICE_TITLE := Raspberry Pi B/B+/CM/Zero/ZeroW DEVICE_DTS := bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm bcm2708-rpi-0-w + SUPPORTED_DEVICES := rpi-b rpi-b-plus rpi-cm rpi-zero rpi-zero-w raspberrypi,model-b raspberrypi,model-b-plus raspberrypi,compute-module-1 raspberrypi,model-b-rev2 raspberrypi,model-zero raspberrypi,model-zero-w endef ifeq ($(SUBTARGET),bcm2708) TARGET_DEVICES += rpi @@ -65,6 +66,7 @@ endif define Device/rpi-2 DEVICE_TITLE := Raspberry Pi 2B/3B/3CM DEVICE_DTS := bcm2709-rpi-2-b bcm2710-rpi-3-b bcm2710-rpi-cm3 + SUPPORTED_DEVICES := rpi-2-b rpi-3-b rpi-cm raspberrypi,2-model-b raspberrypi,3-model-b raspberrypi,compute-module-3 endef ifeq ($(SUBTARGET),bcm2709) TARGET_DEVICES += rpi-2 @@ -74,6 +76,7 @@ define Device/rpi-3 KERNEL_IMG := kernel8.img DEVICE_TITLE := Raspberry Pi 3B (64 bit) DEVICE_DTS := broadcom/bcm2710-rpi-3-b + SUPPORTED_DEVICES := rpi-3-b raspberrypi,3-model-b endef ifeq ($(SUBTARGET),bcm2710) TARGET_DEVICES += rpi-3 diff --git a/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch new file mode 100644 index 000000000..0be65916a --- /dev/null +++ b/target/linux/brcm2708/patches-4.9/960-add-rasbperrypi-compatible.patch @@ -0,0 +1,70 @@ +--- a/arch/arm/boot/dts/bcm2708-rpi-0-w.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-0-w.dts +@@ -3,6 +3,7 @@ + #include "bcm2708.dtsi" + + / { ++ compatible = "raspberrypi,model-zero-w", "brcm,bcm2835"; + model = "Raspberry Pi Zero W"; + }; + +--- a/arch/arm/boot/dts/bcm2710-rpi-3-b.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-3-b.dts +@@ -8,6 +8,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,3-model-b", "brcm,bcm2837", "brcm,bcm2836"; + model = "Raspberry Pi 3 Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2709-rpi-2-b.dts ++++ b/arch/arm/boot/dts/bcm2709-rpi-2-b.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,2-model-b", "brcm,bcm2836"; + model = "Raspberry Pi 2 Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-b.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9512.dtsi" + + / { ++ compatible = "raspberrypi,model-b", "brcm,bcm2835"; + model = "Raspberry Pi Model B"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-b-plus.dts +@@ -4,6 +4,7 @@ + #include "bcm283x-rpi-smsc9514.dtsi" + + / { ++ compatible = "raspberrypi,model-b-plus", "brcm,bcm2835"; + model = "Raspberry Pi Model B+"; + }; + +--- a/arch/arm/boot/dts/bcm2708-rpi-cm.dts ++++ b/arch/arm/boot/dts/bcm2708-rpi-cm.dts +@@ -3,6 +3,7 @@ + #include "bcm2708-rpi-cm.dtsi" + + / { ++ compatible = "raspberrypi,compute-module-1", "brcm,bcm2835"; + model = "Raspberry Pi Compute Module"; + }; + +--- a/arch/arm/boot/dts/bcm2710-rpi-cm3.dts ++++ b/arch/arm/boot/dts/bcm2710-rpi-cm3.dts +@@ -3,6 +3,7 @@ + #include "bcm2710.dtsi" + + / { ++ compatible = "raspberrypi,compute-module-3", "brcm,bcm2837", "brcm,bcm2836"; + model = "Raspberry Pi Compute Module 3"; + }; + diff --git a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch index 15c59ce95..2e30fe500 100644 --- a/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch +++ b/target/linux/cns3xxx/patches-4.9/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch @@ -1,6 +1,6 @@ --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c -@@ -2014,7 +2014,8 @@ static void pcie_write_mrrs(struct pci_d +@@ -2015,7 +2015,8 @@ static void pcie_write_mrrs(struct pci_d /* In the "safe" case, do not configure the MRRS. There appear to be * issues with setting MRRS to 0 on a number of devices. */ diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index f951a0daf..9da3f3e32 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -841,7 +841,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c -@@ -269,7 +269,7 @@ rx_next: +@@ -270,7 +270,7 @@ rx_next: } if (rx < budget) { diff --git a/target/linux/generic/hack-4.9/721-phy_packets.patch b/target/linux/generic/hack-4.9/721-phy_packets.patch index 0d47c7621..b312ac7d4 100644 --- a/target/linux/generic/hack-4.9/721-phy_packets.patch +++ b/target/linux/generic/hack-4.9/721-phy_packets.patch @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2942,10 +2942,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2943,10 +2943,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index 6881d5faf..7074c9e63 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -63,7 +63,7 @@ Signed-off-by: Felix Fietkau } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -143,7 +143,10 @@ static const struct file_operations proc +@@ -144,7 +144,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -160,6 +163,9 @@ void proc_tty_unregister_driver(struct t +@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau ent = driver->proc_entry; if (!ent) return; -@@ -174,6 +180,9 @@ void proc_tty_unregister_driver(struct t +@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { diff --git a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch index cc19b8ef3..5f4688570 100644 --- a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch +++ b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch @@ -1,6 +1,6 @@ --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -1187,24 +1187,7 @@ void netlink_detachskb(struct sock *sk, +@@ -1228,24 +1228,7 @@ void netlink_detachskb(struct sock *sk, static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) { diff --git a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index ad0fb5bdc..bd2ffe34e 100644 --- a/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.9/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4523,6 +4523,9 @@ static enum gro_result dev_gro_receive(s +@@ -4524,6 +4524,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5811,6 +5814,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5812,6 +5815,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -93,7 +93,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -6009,6 +6054,8 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6010,6 +6055,8 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); @@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6609,6 +6656,7 @@ int dev_set_mac_address(struct net_devic +@@ -6610,6 +6657,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch index 45b3c7ae6..51408253c 100644 --- a/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/202-core-linux-support-layerscape.patch @@ -417,7 +417,7 @@ Signed-off-by: Yangbo Lu * These are the defined Ethernet Protocol ID's. --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -6603,9 +6603,18 @@ int dev_set_mtu(struct net_device *dev, +@@ -6604,9 +6604,18 @@ int dev_set_mtu(struct net_device *dev, if (new_mtu == dev->mtu) return 0; diff --git a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch index 7216933b7..135333e47 100644 --- a/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/301-arch-support-layerscape.patch @@ -207,7 +207,7 @@ Signed-off-by: Yangbo Lu * Note that the arbiter/ISA bridge appears to be buggy, specifically in --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c -@@ -2392,6 +2392,7 @@ void arch_setup_dma_ops(struct device *d +@@ -2410,6 +2410,7 @@ void arch_setup_dma_ops(struct device *d set_dma_ops(dev, dma_ops); } diff --git a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch index 8ce3b56e3..6deb5f975 100644 --- a/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/804-crypto-support-layerscape.patch @@ -777,7 +777,7 @@ Signed-off-by: Yangbo Lu }; struct tcrypt_result { -@@ -1329,6 +1329,10 @@ static int do_test(const char *alg, u32 +@@ -1331,6 +1331,10 @@ static int do_test(const char *alg, u32 ret += tcrypt_test("hmac(sha3-512)"); break; @@ -788,7 +788,7 @@ Signed-off-by: Yangbo Lu case 150: ret += tcrypt_test("ansi_cprng"); break; -@@ -1390,6 +1394,9 @@ static int do_test(const char *alg, u32 +@@ -1392,6 +1396,9 @@ static int do_test(const char *alg, u32 case 190: ret += tcrypt_test("authenc(hmac(sha512),cbc(des3_ede))"); break; @@ -798,7 +798,7 @@ Signed-off-by: Yangbo Lu case 200: test_cipher_speed("ecb(aes)", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); -@@ -1404,9 +1411,9 @@ static int do_test(const char *alg, u32 +@@ -1406,9 +1413,9 @@ static int do_test(const char *alg, u32 test_cipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_cipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, @@ -810,7 +810,7 @@ Signed-off-by: Yangbo Lu test_cipher_speed("cts(cbc(aes))", ENCRYPT, sec, NULL, 0, speed_template_16_24_32); test_cipher_speed("cts(cbc(aes))", DECRYPT, sec, NULL, 0, -@@ -1837,9 +1844,9 @@ static int do_test(const char *alg, u32 +@@ -1839,9 +1846,9 @@ static int do_test(const char *alg, u32 test_acipher_speed("lrw(aes)", DECRYPT, sec, NULL, 0, speed_template_32_40_48); test_acipher_speed("xts(aes)", ENCRYPT, sec, NULL, 0, diff --git a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch index eccac7400..2e7885a69 100644 --- a/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/817-usb-support-layerscape.patch @@ -37,7 +37,7 @@ Signed-off-by: Yangbo Lu --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c -@@ -1812,6 +1812,10 @@ static int rx_bottom(struct r8152 *tp, i +@@ -1816,6 +1816,10 @@ static int rx_bottom(struct r8152 *tp, i unsigned int pkt_len; struct sk_buff *skb; diff --git a/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch b/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch index fca43cbdf..aeb81e14b 100644 --- a/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch +++ b/target/linux/mediatek/patches-4.9/0048-net-core-add-RPS-balancer.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -3550,6 +3550,58 @@ set_rps_cpu(struct net_device *dev, stru +@@ -3551,6 +3551,58 @@ set_rps_cpu(struct net_device *dev, stru return rflow; } @@ -69,7 +69,7 @@ Signed-off-by: John Crispin /* * get_rps_cpu is called from netif_receive_skb and returns the target * CPU from the RPS map of the receiving queue for a given skb. -@@ -3639,7 +3691,7 @@ static int get_rps_cpu(struct net_device +@@ -3640,7 +3692,7 @@ static int get_rps_cpu(struct net_device try_rps: if (map) { @@ -78,7 +78,7 @@ Signed-off-by: John Crispin if (cpu_online(tcpu)) { cpu = tcpu; goto done; -@@ -8430,6 +8482,9 @@ static int __init net_dev_init(void) +@@ -8431,6 +8483,9 @@ static int __init net_dev_init(void) sd->backlog.weight = weight_p; } diff --git a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch index 099a04e54..0dfd4c233 100644 --- a/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch +++ b/target/linux/ramips/patches-4.9/0025-pinctrl-ralink-add-pinctrl-driver.patch @@ -25,7 +25,7 @@ Signed-off-by: John Crispin bool "SGI IP22 (Indy/Indigo2)" --- a/drivers/pinctrl/Kconfig +++ b/drivers/pinctrl/Kconfig -@@ -115,6 +115,11 @@ config PINCTRL_LPC18XX +@@ -116,6 +116,11 @@ config PINCTRL_LPC18XX help Pinctrl driver for NXP LPC18xx/43xx System Control Unit (SCU). From 84bc8c0a5c6c373212210ba6ed425713b907c541 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:15:44 +0800 Subject: [PATCH 46/95] dnsmasq: rewrite config on host name modification --- package/network/services/dnsmasq/Makefile | 18 +++++--- .../services/dnsmasq/files/dnsmasq.init | 30 ++++++------- .../services/dnsmasq/patches/240-ubus.patch | 16 ++++--- ...nfinite-retries-in-strict-order-mode.patch | 45 +++++++++++++++++++ 4 files changed, 80 insertions(+), 29 deletions(-) create mode 100644 package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index dd9df245a..79c228aff 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.78 -PKG_RELEASE:=2 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/ @@ -17,12 +17,14 @@ PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:thekelleys:dnsmasq PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ +PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \ + CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \ @@ -75,8 +77,8 @@ endef define Package/dnsmasq-full/description $(call Package/dnsmasq/description) -This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and -IPset, Conntrack support & NO_ID enabled by default. +This is a fully configurable variant with DHCPv4, DHCPv6, DNSSEC, Authoritative DNS +and IPset, Conntrack support & NO_ID enabled by default. endef define Package/dnsmasq/conffiles @@ -86,9 +88,12 @@ endef define Package/dnsmasq-full/config if PACKAGE_dnsmasq-full + config PACKAGE_dnsmasq_full_dhcp + bool "Build with DHCP support." + default y config PACKAGE_dnsmasq_full_dhcpv6 bool "Build with DHCPv6 support." - depends on IPV6 + depends on IPV6 && PACKAGE_dnsmasq_full_dhcp default n config PACKAGE_dnsmasq_full_dnssec bool "Build with DNSSEC support." @@ -124,7 +129,8 @@ ifeq ($(BUILD_VARIANT),nodhcpv6) endif ifeq ($(BUILD_VARIANT),full) - COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ + COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp),,-DNO_DHCP) \ + $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 9bbffe679..dcc18e34d 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -13,7 +13,6 @@ ADD_LOCAL_FQDN="" BASECONFIGFILE="/var/etc/dnsmasq.conf" BASEHOSTFILE="/tmp/hosts/dhcp" -BASETIMESTAMPFILE="/etc/dnsmasq.time" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" BASEDHCPSTAMPFILE="/var/run/dnsmasq" @@ -295,7 +294,7 @@ dhcp_host_add() { config_get_bool dns "$cfg" dns 0 [ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && { - echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE + echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP } config_get mac "$cfg" mac @@ -636,7 +635,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE + echo "$ip $record" >> $HOSTFILE_TMP } dhcp_srv_add() { @@ -742,7 +741,7 @@ dnsmasq_start() CONFIGFILE="${BASECONFIGFILE}.${cfg}" CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" - TIMESTAMPFILE="${BASETIMESTAMPFILE}.${cfg}" + HOSTFILE_TMP="${HOSTFILE}.$$" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend @@ -752,14 +751,17 @@ dnsmasq_start() mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq - [ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE" - echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP - echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE + echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP + + local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" + if [ ! -r "$dnsmasqconffile" ]; then + dnsmasqconffile=/etc/dnsmasq.conf + fi # if we did this last, we could override auto-generated config - [ -f /etc/dnsmasq.conf ] && { - xappend "--conf-file=/etc/dnsmasq.conf" + [ -f "${dnsmasqconffile}" ] && { + xappend "--conf-file=${dnsmasqconffile}" } $PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0 @@ -997,6 +999,7 @@ dnsmasq_start() echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE + mv -f $HOSTFILE_TMP $HOSTFILE [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && { rm -f /tmp/resolv.conf @@ -1015,11 +1018,6 @@ dnsmasq_start() [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn - local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" - if [ ! -r "$dnsmasqconffile" ]; then - dnsmasqconffile=/etc/dnsmasq.conf - fi - procd_add_jail dnsmasq ubus log procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile @@ -1046,7 +1044,7 @@ dnsmasq_stop() service_triggers() { - procd_add_reload_trigger "dhcp" + procd_add_reload_trigger "dhcp" "system" procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload } @@ -1086,7 +1084,7 @@ start_service() { reload_service() { rc_procd start_service "$@" - return 0 + procd_send_signal dnsmasq "$@" } stop_service() { diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch index 2d37b5d2f..d21ca0dba 100644 --- a/package/network/services/dnsmasq/patches/240-ubus.patch +++ b/package/network/services/dnsmasq/patches/240-ubus.patch @@ -9,7 +9,7 @@ struct daemon *daemon; static volatile pid_t pid = 0; -@@ -32,6 +34,62 @@ static void fatal_event(struct event_des +@@ -32,6 +34,64 @@ static void fatal_event(struct event_des static int read_event(int fd, struct event_desc *evp, char **msg); static void poll_resolv(int force, int do_reload, time_t now); @@ -25,7 +25,7 @@ + .type = &ubus_object_type, +}; + -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name) ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface) +{ + if (!ubus || !ubus_object.has_subscribers) + return; @@ -37,6 +37,8 @@ + blobmsg_add_string(&b, "ip", ip); + if (name) + blobmsg_add_string(&b, "name", name); ++ if (interface) ++ blobmsg_add_string(&b, "interface", interface); + ubus_notify(ubus, &ubus_object, type, b.head, -1); +} + @@ -72,7 +74,7 @@ int main (int argc, char **argv) { int bind_fallback = 0; -@@ -911,6 +969,7 @@ int main (int argc, char **argv) +@@ -911,6 +971,7 @@ int main (int argc, char **argv) set_dbus_listeners(); #endif @@ -80,7 +82,7 @@ #ifdef HAVE_DHCP if (daemon->dhcp || daemon->relay4) { -@@ -1041,6 +1100,8 @@ int main (int argc, char **argv) +@@ -1041,6 +1102,8 @@ int main (int argc, char **argv) check_dbus_listeners(); #endif @@ -106,7 +108,7 @@ # endif #endif -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name); ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); + /* ipset.c */ #ifdef HAVE_IPSET @@ -118,9 +120,9 @@ string ? string : "", err ? err : ""); + if (!strcmp(type, "DHCPACK")) -+ ubus_event_bcast("dhcp.ack", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL); ++ ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); + else if (!strcmp(type, "DHCPRELEASE")) -+ ubus_event_bcast("dhcp.release", addr ? inet_ntoa(a) : NULL, daemon->namebuff, string ? string : NULL); ++ ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); } static void log_options(unsigned char *start, u32 xid) diff --git a/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch b/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch new file mode 100644 index 000000000..faff680e0 --- /dev/null +++ b/package/network/services/dnsmasq/patches/250-Fix-infinite-retries-in-strict-order-mode.patch @@ -0,0 +1,45 @@ +From ef3d137a646fa8309e1ff5184e3e145eef40cc4d Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Tue, 5 Dec 2017 22:37:29 +0000 +Subject: [PATCH] Fix infinite retries in strict-order mode. + + If all configured dns servers return refused in + response to a query; dnsmasq will end up in an infinite loop + retransmitting the dns query resulting into high CPU load. + Problem is caused by the dns refuse retransmission logic which does + not check for the end of a dns server list iteration in strict mode. + Having one configured dns server returning a refused reply easily + triggers this problem in strict order mode. This was introduced in + 9396752c115b3ab733fa476b30da73237e12e7ba + + Thanks to Hans Dedecker for spotting this + and the initial patch. +--- + src/forward.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/src/forward.c ++++ b/src/forward.c +@@ -797,10 +797,20 @@ void reply_query(int fd, int family, tim + unsigned char *pheader; + size_t plen; + int is_sign; +- ++ ++ /* In strict order mode, there must be a server later in the chain ++ left to send to, otherwise without the forwardall mechanism, ++ code further on will cycle around the list forwever if they ++ all return REFUSED. Note that server is always non-NULL before ++ this executes. */ ++ if (option_bool(OPT_ORDER)) ++ for (server = forward->sentto->next; server; server = server->next) ++ if (!(server->flags & (SERV_LITERAL_ADDRESS | SERV_HAS_DOMAIN | SERV_FOR_NODOTS | SERV_NO_ADDR | SERV_LOOP))) ++ break; ++ + /* recreate query from reply */ + pheader = find_pseudoheader(header, (size_t)n, &plen, NULL, &is_sign, NULL); +- if (!is_sign) ++ if (!is_sign && server) + { + header->ancount = htons(0); + header->nscount = htons(0); From 25383e0b4dee9c8cfe8a2ef1515d8746f199fddb Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:23:10 +0800 Subject: [PATCH 47/95] revert kernel 4.9 for x86 and add NVME full support --- target/linux/x86/Makefile | 2 +- target/linux/x86/config-4.9 | 175 +++--------------------------------- 2 files changed, 14 insertions(+), 163 deletions(-) diff --git a/target/linux/x86/Makefile b/target/linux/x86/Makefile index b82a0f4e9..058edd1a3 100644 --- a/target/linux/x86/Makefile +++ b/target/linux/x86/Makefile @@ -13,7 +13,7 @@ FEATURES:=squashfs ext4 vdi vmdk pcmcia targz fpu SUBTARGETS:=generic legacy geode 64 MAINTAINER:=Felix Fietkau -KERNEL_PATCHVER:=4.14 +KERNEL_PATCHVER:=4.9 KERNELNAME:=bzImage diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 1c10e57f6..b5003546c 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -1,32 +1,6 @@ # CONFIG_60XX_WDT is not set # CONFIG_64BIT is not set -CONFIG_ACPI=y -CONFIG_ACPI_AC=y -CONFIG_ACPI_BATTERY=y -# CONFIG_ACPI_CMPC is not set -# CONFIG_ACPI_CONTAINER is not set -CONFIG_ACPI_CPU_FREQ_PSS=y -# CONFIG_ACPI_CUSTOM_DSDT is not set -# CONFIG_ACPI_DEBUG is not set -# CONFIG_ACPI_DEBUGGER is not set -# CONFIG_ACPI_DOCK is not set -# CONFIG_ACPI_EC_DEBUGFS is not set -CONFIG_ACPI_FAN=y -CONFIG_ACPI_HOTPLUG_IOAPIC=y -CONFIG_ACPI_I2C_OPREGION=y -CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set -# CONFIG_ACPI_PCI_SLOT is not set -CONFIG_ACPI_PROCESSOR=y -# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set -CONFIG_ACPI_PROCESSOR_CSTATE=y -CONFIG_ACPI_PROCESSOR_IDLE=y -# CONFIG_ACPI_PROCFS_POWER is not set -CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y -# CONFIG_ACPI_SBS is not set -CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y -CONFIG_ACPI_THERMAL=y -# CONFIG_ACPI_WMI is not set +# CONFIG_ACPI is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_ALIM1535_WDT is not set @@ -38,7 +12,6 @@ CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y @@ -49,7 +22,6 @@ CONFIG_ARCH_HAS_SG_CHAIN=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y @@ -68,7 +40,6 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_USE_QUEUED_RWLOCKS=y CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y -CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y @@ -79,7 +50,7 @@ CONFIG_ATA_PIIX=y CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_NVME_SCSI=y +# CONFIG_BLK_DEV_NVME_SCSI is not set CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -107,7 +78,6 @@ CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_STAT_DETAILS=y CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_LADDER=y -CONFIG_CPU_RMAP=y CONFIG_CPU_SUP_AMD=y CONFIG_CPU_SUP_CENTAUR=y CONFIG_CPU_SUP_CYRIX_32=y @@ -116,17 +86,12 @@ CONFIG_CPU_SUP_TRANSMETA_32=y CONFIG_CPU_SUP_UMC_32=y # CONFIG_CRASHLOG is not set CONFIG_CRC16=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_AES_586=y CONFIG_CRYPTO_CRC32=y CONFIG_CRYPTO_CRC32C=y # CONFIG_CRYPTO_CRC32_PCLMUL is not set CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG2=y # CONFIG_CRYPTO_SERPENT_SSE2_586 is not set CONFIG_CRYPTO_WORKQUEUE=y @@ -149,7 +114,6 @@ CONFIG_DMIID=y CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y CONFIG_DMI_SYSFS=y CONFIG_DNOTIFY=y -# CONFIG_DPTF_POWER is not set CONFIG_DUMMY_CONSOLE=y CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set @@ -189,8 +153,6 @@ CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_MSI_IRQ=y CONFIG_GENERIC_MSI_IRQ_DOMAIN=y CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PENDING_IRQ=y -CONFIG_GENERIC_PHY=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y @@ -203,8 +165,6 @@ CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ACPI_APEI=y -CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_AOUT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y @@ -263,23 +223,17 @@ CONFIG_HIGHMEM=y # CONFIG_HIGHMEM4G is not set CONFIG_HIGHMEM64G=y # CONFIG_HIGHPTE is not set -# CONFIG_HPET is not set CONFIG_HPET_EMULATE_RTC=y CONFIG_HPET_TIMER=y -# CONFIG_HP_ACCEL is not set # CONFIG_HP_WATCHDOG is not set CONFIG_HT_IRQ=y # CONFIG_HUGETLBFS is not set -CONFIG_HWMON=y -CONFIG_HWMON_VID=y CONFIG_HW_CONSOLE=y CONFIG_HW_RANDOM=y CONFIG_HW_RANDOM_GEODE=y CONFIG_HW_RANDOM_VIA=y -CONFIG_HYPERVISOR_GUEST=y +# CONFIG_HYPERVISOR_GUEST is not set CONFIG_HZ_PERIODIC=y -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y CONFIG_I8253_LOCK=y # CONFIG_I8K is not set # CONFIG_IB700_WDT is not set @@ -291,20 +245,12 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y -CONFIG_INTEL_IDLE=y -# CONFIG_INTEL_IPS is not set -CONFIG_INTEL_MEI=y -CONFIG_INTEL_MEI_WDT=y -# CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_PMC_IPC is not set -CONFIG_INTEL_POWERCLAMP=y -CONFIG_INTEL_SOC_DTS_IOSF_CORE=y -CONFIG_INTEL_SOC_DTS_THERMAL=y +# CONFIG_INTEL_POWERCLAMP is not set +# CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_IOMMU_HELPER=y # CONFIG_IOMMU_STRESS is not set -CONFIG_IOSF_MBI=y -# CONFIG_IOSF_MBI_DEBUG is not set +# CONFIG_IOSF_MBI is not set CONFIG_IO_DELAY_0X80=y # CONFIG_IO_DELAY_0XED is not set # CONFIG_IO_DELAY_NONE is not set @@ -319,7 +265,6 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISA is not set CONFIG_ISA_DMA_API=y -# CONFIG_ISCSI_IBFT_FIND is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set # CONFIG_ITCO_WDT is not set @@ -330,7 +275,6 @@ CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y -CONFIG_LOCK_SPIN_ON_OWNER=y # CONFIG_M486 is not set # CONFIG_M586 is not set CONFIG_M586MMX=y @@ -343,7 +287,6 @@ CONFIG_M586MMX=y # CONFIG_MCYRIXIII is not set # CONFIG_MEFFICEON is not set # CONFIG_MELAN is not set -# CONFIG_MFD_INTEL_LPSS_ACPI is not set # CONFIG_MFD_INTEL_LPSS_PCI is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set @@ -351,15 +294,6 @@ CONFIG_M586MMX=y # CONFIG_MK6 is not set # CONFIG_MK7 is not set # CONFIG_MK8 is not set -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -CONFIG_MMC_RICOH_MMC=y -CONFIG_MMC_SDHCI=y -CONFIG_MMC_SDHCI_ACPI=y -CONFIG_MMC_SDHCI_PCI=y -CONFIG_MMC_SDHCI_PLTFM=y -# CONFIG_MMC_TIFM_SD is not set -# CONFIG_MMC_WBSD is not set # CONFIG_MODIFY_LDT_SYSCALL is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_REL=y @@ -370,7 +304,6 @@ CONFIG_MODULES_USE_ELF_REL=y # CONFIG_MTD is not set CONFIG_MTRR=y # CONFIG_MTRR_SANITIZER is not set -CONFIG_MUTEX_SPIN_ON_OWNER=y # CONFIG_MVIAC3_2 is not set # CONFIG_MVIAC7 is not set # CONFIG_MWINCHIP3D is not set @@ -381,15 +314,15 @@ CONFIG_ND_BTT=y CONFIG_ND_CLAIM=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y +CONFIG_NEED_PER_CPU_KM=y CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y CONFIG_NEED_SG_DMA_LENGTH=y # CONFIG_NET5501 is not set -CONFIG_NET_FLOW_LIMIT=y # CONFIG_NET_NS is not set CONFIG_NLS=y # CONFIG_NOHIGHMEM is not set CONFIG_NO_BOOTMEM=y -CONFIG_NR_CPUS=8 +CONFIG_NR_CPUS=1 # CONFIG_NSC_GPIO is not set CONFIG_NVME_CORE=y CONFIG_NVRAM=y @@ -399,10 +332,7 @@ CONFIG_OLD_SIGSUSPEND3=y CONFIG_OPROFILE_NMI_TIMER=y # CONFIG_OPTIMIZE_INLINING is not set CONFIG_OUTPUT_FORMAT="elf32-i386" -CONFIG_PADATA=y CONFIG_PAGE_OFFSET=0xC0000000 -CONFIG_PATA_MPIIX=y -CONFIG_PATA_OLDPIIX=y # CONFIG_PC8736x_GPIO is not set # CONFIG_PC87413_WDT is not set CONFIG_PCI=y @@ -415,7 +345,6 @@ CONFIG_PCI_GOANY=y # CONFIG_PCI_GODIRECT is not set # CONFIG_PCI_GOMMCONFIG is not set CONFIG_PCI_LABEL=y -CONFIG_PCI_MMCONFIG=y CONFIG_PCI_MSI=y CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCSPKR_PLATFORM=y @@ -428,115 +357,52 @@ CONFIG_PHYSICAL_ALIGN=0x100000 CONFIG_PHYSICAL_START=0x1000000 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_PMC_ATOM=y -# CONFIG_PMIC_OPREGION is not set -CONFIG_PNP=y -CONFIG_PNPACPI=y -CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_POWER_SUPPLY=y # CONFIG_PROCESSOR_SELECT is not set CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_PUNIT_ATOM_DEBUG is not set -# CONFIG_PVPANIC is not set -CONFIG_QUEUED_RWLOCKS=y -CONFIG_QUEUED_SPINLOCKS=y -CONFIG_RCU_STALL_COMMON=y +# CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y CONFIG_RTC_CLASS=y -CONFIG_RTC_I2C_AND_SPI=y CONFIG_RTC_MC146818_LIB=y -CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y -# CONFIG_SAMSUNG_Q10 is not set -CONFIG_SATA_AHCI=y -CONFIG_SATA_AHCI_PLATFORM=y -CONFIG_SATA_MV=y -CONFIG_SATA_PMP=y # CONFIG_SBC7240_WDT is not set # CONFIG_SBC8360_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set # CONFIG_SC1200_WDT is not set # CONFIG_SCHED_INFO is not set -CONFIG_SCHED_MC=y -CONFIG_SCHED_SMT=y CONFIG_SCSI=y -CONFIG_SCSI_BUSLOGIC=y -CONFIG_SCSI_FLASHPOINT=y CONFIG_SCSI_SPI_ATTRS=y CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_WDT is not set -CONFIG_SDIO_UART=y -CONFIG_SENSORS_CORETEMP=y -CONFIG_SENSORS_FAM15H_POWER=y -CONFIG_SENSORS_K10TEMP=y -CONFIG_SENSORS_K8TEMP=y -CONFIG_SENSORS_VIA_CPUTEMP=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_PNP=y CONFIG_SERIO=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_I8042=y CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_SERPORT=y CONFIG_SG_POOL=y -CONFIG_SMP=y # CONFIG_SMSC37B787_WDT is not set # CONFIG_SMSC_SCH311X_WDT is not set -CONFIG_SND=y -# CONFIG_SND_COMPRESS_OFFLOAD is not set -CONFIG_SND_DMA_SGBUF=y -CONFIG_SND_HDA=y -CONFIG_SND_HDA_CODEC_ANALOG=y -# CONFIG_SND_HDA_CODEC_CA0110 is not set -# CONFIG_SND_HDA_CODEC_CA0132 is not set -# CONFIG_SND_HDA_CODEC_CIRRUS is not set -# CONFIG_SND_HDA_CODEC_CMEDIA is not set -CONFIG_SND_HDA_CODEC_CONEXANT=y -# CONFIG_SND_HDA_CODEC_HDMI is not set -CONFIG_SND_HDA_CODEC_REALTEK=y -# CONFIG_SND_HDA_CODEC_SI3054 is not set -CONFIG_SND_HDA_CODEC_SIGMATEL=y -CONFIG_SND_HDA_CODEC_VIA=y -CONFIG_SND_HDA_CORE=y -CONFIG_SND_HDA_GENERIC=y -CONFIG_SND_HDA_HWDEP=y -# CONFIG_SND_HDA_INPUT_BEEP is not set -CONFIG_SND_HDA_INTEL=y -CONFIG_SND_HDA_PATCH_LOADER=y -CONFIG_SND_HDA_RECONFIG=y -CONFIG_SND_HWDEP=y -CONFIG_SND_JACK=y -CONFIG_SND_JACK_INPUT_DEV=y -CONFIG_SND_PCM=y -# CONFIG_SND_PCSP is not set -CONFIG_SND_VMASTER=y -CONFIG_SOUND=y CONFIG_SPARSEMEM_STATIC=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y CONFIG_STRICT_DEVMEM=y -# CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TELCLOCK is not set CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_WRITABLE_TRIPS=y CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set -# CONFIG_TOSHIBA_BT_RFKILL is not set -CONFIG_TREE_RCU=y +CONFIG_UP_LATE_INIT=y CONFIG_USB=y CONFIG_USB_COMMON=y CONFIG_USB_EHCI_HCD=y @@ -546,12 +412,8 @@ CONFIG_USB_HID=y CONFIG_USB_HIDDEV=y CONFIG_USB_OHCI_HCD=y # CONFIG_USB_OHCI_HCD_PLATFORM is not set -CONFIG_USB_STORAGE=y CONFIG_USB_SUPPORT=y CONFIG_USB_UHCI_HCD=y -CONFIG_USB_XHCI_HCD=y -CONFIG_USB_XHCI_PCI=y -# CONFIG_USB_XHCI_PLATFORM is not set # CONFIG_USERIO is not set # CONFIG_USER_NS is not set CONFIG_USER_STACKTRACE_SUPPORT=y @@ -559,38 +421,29 @@ CONFIG_USER_STACKTRACE_SUPPORT=y CONFIG_VGA_CONSOLE=y # CONFIG_VIA_WDT is not set # CONFIG_VM86 is not set -CONFIG_VMWARE_BALLOON=y -CONFIG_VMWARE_PVSCSI=y -CONFIG_VMWARE_VMCI=y +# CONFIG_VMWARE_VMCI is not set CONFIG_VM_EVENT_COUNTERS=y CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y # CONFIG_WAFER_WDT is not set -CONFIG_WATCHDOG_CORE=y CONFIG_X86=y CONFIG_X86_32=y # CONFIG_X86_32_IRIS is not set CONFIG_X86_32_LAZY_GS=y -CONFIG_X86_32_SMP=y -# CONFIG_X86_ACPI_CPUFREQ is not set CONFIG_X86_ALIGNMENT_16=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_ANCIENT_MCE is not set -# CONFIG_X86_BIGSMP is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_CMPXCHG64=y # CONFIG_X86_CPUFREQ_NFORCE2 is not set # CONFIG_X86_CPUID is not set # CONFIG_X86_DEBUG_FPU is not set # CONFIG_X86_EXTENDED_PLATFORM is not set -# CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_F00F_BUG=y CONFIG_X86_FAST_FEATURE_TESTS=y CONFIG_X86_FEATURE_NAMES=y CONFIG_X86_GENERIC=y # CONFIG_X86_GX_SUSPMOD is not set -# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MPX is not set # CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_INTEL_USERCOPY=y @@ -599,7 +452,6 @@ CONFIG_X86_IO_APIC=y CONFIG_X86_L1_CACHE_SHIFT=6 # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_LOCAL_APIC=y -# CONFIG_X86_LONGHAUL is not set # CONFIG_X86_LONGRUN is not set CONFIG_X86_MCE=y CONFIG_X86_MCE_AMD=y @@ -612,11 +464,9 @@ CONFIG_X86_MSR=y # CONFIG_X86_P4_CLOCKMOD is not set CONFIG_X86_PAE=y CONFIG_X86_PAT=y -# CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PLATFORM_DEVICES=y CONFIG_X86_PMEM_LEGACY=y CONFIG_X86_PMEM_LEGACY_DEVICE=y -CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K6 is not set # CONFIG_X86_POWERNOW_K7 is not set CONFIG_X86_PPRO_FENCE=y @@ -633,8 +483,9 @@ CONFIG_X86_RESERVE_LOW=64 CONFIG_X86_SUPPORTS_MEMORY_FAILURE=y CONFIG_X86_THERMAL_VECTOR=y CONFIG_X86_TSC=y +CONFIG_X86_UP_APIC=y +CONFIG_X86_UP_IOAPIC=y CONFIG_X86_VERBOSE_BOOTUP=y -CONFIG_XPS=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y From 45fade0d399be9fdb1bf40e69f8be82b3f6f9c10 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:24:57 +0800 Subject: [PATCH 48/95] add luci-app-sfe by default --- include/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index 3fe99d33a..b1e97b438 100644 --- a/include/target.mk +++ b/include/target.mk @@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \ -luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol +luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets From fd99d100dc86cd47cb507058a081c0ae33a8c299 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 28 Dec 2017 14:56:23 +0800 Subject: [PATCH 49/95] add NVDIMM support for x86 --- target/linux/x86/config-4.9 | 69 +++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index b5003546c..f10835474 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -1,6 +1,31 @@ # CONFIG_60XX_WDT is not set # CONFIG_64BIT is not set -# CONFIG_ACPI is not set +CONFIG_ACPI=y +CONFIG_ACPI_AC=y +CONFIG_ACPI_BATTERY=y +# CONFIG_ACPI_CMPC is not set +# CONFIG_ACPI_CONTAINER is not set +CONFIG_ACPI_CPU_FREQ_PSS=y +# CONFIG_ACPI_CUSTOM_DSDT is not set +# CONFIG_ACPI_DEBUG is not set +# CONFIG_ACPI_DEBUGGER is not set +# CONFIG_ACPI_DOCK is not set +# CONFIG_ACPI_EC_DEBUGFS is not set +CONFIG_ACPI_FAN=y +CONFIG_ACPI_HOTPLUG_IOAPIC=y +CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y +# CONFIG_ACPI_NFIT is not set +# CONFIG_ACPI_PCI_SLOT is not set +CONFIG_ACPI_PROCESSOR=y +# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set +CONFIG_ACPI_PROCESSOR_CSTATE=y +CONFIG_ACPI_PROCESSOR_IDLE=y +# CONFIG_ACPI_PROCFS_POWER is not set +CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y +# CONFIG_ACPI_SBS is not set +CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y +CONFIG_ACPI_THERMAL=y +# CONFIG_ACPI_WMI is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_ALIM1535_WDT is not set @@ -12,6 +37,7 @@ CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y +CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y @@ -22,6 +48,7 @@ CONFIG_ARCH_HAS_SG_CHAIN=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y @@ -50,7 +77,7 @@ CONFIG_ATA_PIIX=y CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NVME=y -# CONFIG_BLK_DEV_NVME_SCSI is not set +CONFIG_BLK_DEV_NVME_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -114,6 +141,7 @@ CONFIG_DMIID=y CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y CONFIG_DMI_SYSFS=y CONFIG_DNOTIFY=y +# CONFIG_DPTF_POWER is not set CONFIG_DUMMY_CONSOLE=y CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set @@ -165,6 +193,8 @@ CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ACPI_APEI=y +CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_AOUT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y @@ -223,8 +253,10 @@ CONFIG_HIGHMEM=y # CONFIG_HIGHMEM4G is not set CONFIG_HIGHMEM64G=y # CONFIG_HIGHPTE is not set +# CONFIG_HPET is not set CONFIG_HPET_EMULATE_RTC=y CONFIG_HPET_TIMER=y +# CONFIG_HP_ACCEL is not set # CONFIG_HP_WATCHDOG is not set CONFIG_HT_IRQ=y # CONFIG_HUGETLBFS is not set @@ -245,7 +277,11 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y +CONFIG_INTEL_IDLE=y +# CONFIG_INTEL_IPS is not set +# CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PCH_THERMAL is not set +# CONFIG_INTEL_PMC_IPC is not set # CONFIG_INTEL_POWERCLAMP is not set # CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_IOMMU_HELPER=y @@ -265,6 +301,7 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISA is not set CONFIG_ISA_DMA_API=y +# CONFIG_ISCSI_IBFT_FIND is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set # CONFIG_ITCO_WDT is not set @@ -287,6 +324,7 @@ CONFIG_M586MMX=y # CONFIG_MCYRIXIII is not set # CONFIG_MEFFICEON is not set # CONFIG_MELAN is not set +# CONFIG_MFD_INTEL_LPSS_ACPI is not set # CONFIG_MFD_INTEL_LPSS_PCI is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set @@ -345,6 +383,7 @@ CONFIG_PCI_GOANY=y # CONFIG_PCI_GODIRECT is not set # CONFIG_PCI_GOMMCONFIG is not set CONFIG_PCI_LABEL=y +CONFIG_PCI_MMCONFIG=y CONFIG_PCI_MSI=y CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCSPKR_PLATFORM=y @@ -357,17 +396,23 @@ CONFIG_PHYSICAL_ALIGN=0x100000 CONFIG_PHYSICAL_START=0x1000000 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_PMC_ATOM=y +# CONFIG_PMIC_OPREGION is not set +CONFIG_PNP=y +CONFIG_PNPACPI=y +CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_POWER_SUPPLY=y # CONFIG_PROCESSOR_SELECT is not set CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_PUNIT_ATOM_DEBUG is not set +# CONFIG_PVPANIC is not set # CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y CONFIG_RTC_CLASS=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SAMSUNG_Q10 is not set # CONFIG_SBC7240_WDT is not set # CONFIG_SBC8360_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set @@ -381,6 +426,7 @@ CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_WDT is not set # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_PCI=y +CONFIG_SERIAL_8250_PNP=y CONFIG_SERIO=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_I8042=y @@ -393,6 +439,7 @@ CONFIG_SPARSEMEM_STATIC=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y CONFIG_STRICT_DEVMEM=y +# CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TELCLOCK is not set @@ -402,6 +449,7 @@ CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set +# CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_UP_LATE_INIT=y CONFIG_USB=y CONFIG_USB_COMMON=y @@ -431,7 +479,9 @@ CONFIG_X86=y CONFIG_X86_32=y # CONFIG_X86_32_IRIS is not set CONFIG_X86_32_LAZY_GS=y +# CONFIG_X86_ACPI_CPUFREQ is not set CONFIG_X86_ALIGNMENT_16=y +# CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_ANCIENT_MCE is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_CMPXCHG64=y @@ -439,11 +489,13 @@ CONFIG_X86_CMPXCHG64=y # CONFIG_X86_CPUID is not set # CONFIG_X86_DEBUG_FPU is not set # CONFIG_X86_EXTENDED_PLATFORM is not set +# CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_F00F_BUG=y CONFIG_X86_FAST_FEATURE_TESTS=y CONFIG_X86_FEATURE_NAMES=y CONFIG_X86_GENERIC=y # CONFIG_X86_GX_SUSPMOD is not set +# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MPX is not set # CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_INTEL_USERCOPY=y @@ -452,6 +504,7 @@ CONFIG_X86_IO_APIC=y CONFIG_X86_L1_CACHE_SHIFT=6 # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_LOCAL_APIC=y +# CONFIG_X86_LONGHAUL is not set # CONFIG_X86_LONGRUN is not set CONFIG_X86_MCE=y CONFIG_X86_MCE_AMD=y @@ -464,9 +517,11 @@ CONFIG_X86_MSR=y # CONFIG_X86_P4_CLOCKMOD is not set CONFIG_X86_PAE=y CONFIG_X86_PAT=y +# CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PLATFORM_DEVICES=y CONFIG_X86_PMEM_LEGACY=y CONFIG_X86_PMEM_LEGACY_DEVICE=y +CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K6 is not set # CONFIG_X86_POWERNOW_K7 is not set CONFIG_X86_PPRO_FENCE=y @@ -489,3 +544,13 @@ CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y +CONFIG_ACPI_NFIT=y +CONFIG_THUNDER_NIC_PF=y +CONFIG_THUNDER_NIC_VF=y +CONFIG_THUNDER_NIC_BGX=y +CONFIG_THUNDER_NIC_RGX=y +CONFIG_LIQUIDIO=n +CONFIG_GPIO_AMDPT=n +CONFIG_GPIO_F7188X=n +CONFIG_SENSORS_XGENE=n +CONFIG_ARM_SCPI_PROTOCOL=n \ No newline at end of file From b8b41992a86b96aff945f52a503bde1e0cb95924 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 29 Dec 2017 11:12:59 +0800 Subject: [PATCH 50/95] update mt76 and mwlwifi --- package/kernel/mt76/Makefile | 6 +++--- package/kernel/mwlwifi/Makefile | 11 +++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 6d96ff264..441f59e43 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-12-08 -PKG_SOURCE_VERSION:=e50465605266118060df1b86eb7641c65fd29c65 -PKG_MIRROR_HASH:=3d7d3aa29c1e8dabe8f2c0a14480140f60ddc73681510aadbf07c5a1e5efac6e +PKG_SOURCE_DATE:=2017-12-17 +PKG_SOURCE_VERSION:=68b0cf17efe32623efd2a46d33b0b551bb78cbbe +PKG_MIRROR_HASH:=855901e5e02249f53bb943d2d5da5bb3cb357f02e4c68c6291604867e250e9bd PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 6c8a5d836..811b31426 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_VERSION:=10.3.4.0-20171011 +PKG_VERSION:=10.3.4.0-20171129 PKG_RELEASE=1 PKG_LICENSE:=ISC @@ -16,8 +16,8 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=e119077b68d64e368cb9cc46bd364308db4289dc -PKG_MIRROR_HASH:=6b450f91941de1787a41e1cf162764e9b8e9ff9cdf7f80743afc5081ef435c81 +PKG_SOURCE_VERSION:=1522af59a501f74c8b6b02ae763829a79114a325 +PKG_MIRROR_HASH:=2de445e805db8b8eef907ae3cab41bdb4500b3f5563257c262fed3e5d0a63559 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 @@ -30,7 +30,7 @@ define KernelPackage/mwlwifi TITLE:=Marvell 88W8864 wireless driver DEPENDS:=+kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT @TARGET_mvebu FILES:=$(PKG_BUILD_DIR)/mwlwifi.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 mwlwifi) + AUTOLOAD:=$(call AutoLoad,50,mwlwifi) endef NOSTDINC_FLAGS = \ @@ -43,8 +43,7 @@ NOSTDINC_FLAGS = \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules From 40ac35e97a79b94e9ea0757096cebd66078bef8f Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 3 Jan 2018 11:45:18 +0800 Subject: [PATCH 51/95] update uci to fit new luci --- package/system/uci/Makefile | 6 +++--- package/system/uci/files/lib/config/uci.sh | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 4d11ee1b9..d4718ee90 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE=2017-09-29 -PKG_SOURCE_VERSION:=5ad59ad412a784c5c478e31d1701ce39568ffd58 -PKG_MIRROR_HASH:=0c1c40e8c7e08163a4c8d306ab4b676a9c545028e14aa57b5cf2d6f7bfe726cb +PKG_SOURCE_DATE=2018-01-01 +PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6 +PKG_MIRROR_HASH:=123c5d3ed8f86db76ab52584e952c8e870891bca4dab682b753ca384d7d067bf PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 50891a64e..78ec27766 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -118,9 +118,10 @@ uci_add() { uci_rename() { local PACKAGE="$1" local CONFIG="$2" - local VALUE="$3" + local OPTION="$3" + local VALUE="$4" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE" + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}" } uci_remove() { From bacb253fac73e056c574d0d612a8e177c95e2bf6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 3 Jan 2018 18:02:32 +0800 Subject: [PATCH 52/95] disable X86_BUG_CPU_INSECURE ASLR future in x86/x64 AMD or Intel CPUs --- target/linux/x86/config-4.14 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index 05af59890..9b2f5e3d3 100644 --- a/target/linux/x86/config-4.14 +++ b/target/linux/x86/config-4.14 @@ -523,3 +523,4 @@ CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y +CONFIG_PAGE_TABLE_ISOLATION=n \ No newline at end of file From 4c965143d0ea7ec2eef1d85decd83cc829a635e6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 8 Jan 2018 13:43:42 +0800 Subject: [PATCH 53/95] fix mvebu wifi issue --- .../base-files/etc/init.d/set_cpu_affinity | 56 ------------- target/linux/mvebu/image/Makefile | 24 ++++-- .../120-net-mvneta-add-BQL-support.patch | 16 ++-- .../130-irqchip-armada-xp-backport.patch | 17 ++++ .../300-mvneta-tx-queue-workaround.patch | 4 +- .../419-net-mvneta-convert-to-phylink.patch | 81 +++++++++++-------- ...le-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch | 8 +- ...22-net-mvneta-add-nway_reset-support.patch | 4 +- ...add-flow-control-support-via-phylink.patch | 10 +-- ...ble-flow-control-for-PHY-connections.patch | 2 +- ...e-flow-control-for-fixed-connections.patch | 4 +- .../427-phylink-add-EEE-support.patch | 2 +- .../428-net-mvneta-add-EEE-support.patch | 12 +-- ...ta-add-module-EEPROM-reading-support.patch | 4 +- 14 files changed, 115 insertions(+), 129 deletions(-) delete mode 100755 target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity create mode 100644 target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch diff --git a/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity b/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity deleted file mode 100755 index a52e62acb..000000000 --- a/target/linux/mvebu/base-files/etc/init.d/set_cpu_affinity +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -set_irq_affinity() { - local name="$1" - local val="$2" - -case "$name" in -wifi0) - local irq_wifi0=`grep -E -m1 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi0" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi0/smp_affinity" - ;; -wifi1) - local irq_wifi1=`grep -E -m2 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi1" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi1/smp_affinity" - ;; -wifi2) - local irq_wifi1=`grep -E -m3 'mwlwifi' /proc/interrupts | cut -d: -f1 | tail -n1 | tr -d ' '` - [ -n "$irq_wifi1" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq_wifi1/smp_affinity" - ;; -*) - local irq=`grep -m 1 "$name" /proc/interrupts | cut -d: -f1 | sed 's, *,,'` - [ -n "$irq" ] || echo "$name irq not found." - echo "$val" > "/proc/irq/$irq/smp_affinity" - ;; -esac -} - -start() { - -. /lib/functions.sh - -local board=$(board_name) - -case "$board" in -armada-385-linksys-caiman |\ -armada-385-linksys-cobra |\ -armada-385-linksys-shelby |\ -armada-xp-linksys-mamba) - set_irq_affinity wifi0 2 - set_irq_affinity wifi1 2 - ;; -armada-385-linksys-rango) - set_irq_affinity wifi0 2 - set_irq_affinity wifi1 2 - set_irq_affinity wifi2 2 - ;; -*) - echo "Unsupported hardware. CPU affinity is not adjusted." - ;; -esac -} diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index f0c4b09c9..989ba5084 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -163,11 +163,25 @@ define Device/marvell-nand DEVICE_TITLE := Marvell Armada $(1) endef -Device/armada-370-db = $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3)) -Device/armada-370-rd = $(call Device/marvell-nand,370 RD (RD-88F6710-A1)) -Device/armada-xp-db = $(call Device/marvell-nand,XP DB (DB-78460-BP)) -Device/armada-xp-gp = $(call Device/marvell-nand,XP GP (DB-MV784MP-GP)) -TARGET_DEVICES += armada-370-db armada-370-rd armada-xp-db armada-xp-gp +define Device/armada-370-db + $(call Device/marvell-nand,370 DB (DB-88F6710-BP-DDR3)) +endef +TARGET_DEVICES += armada-370-db + +define Device/armada-370-rd + $(call Device/marvell-nand,370 RD (RD-88F6710-A1)) +endef +TARGET_DEVICES += armada-370-rd + +define Device/armada-xp-db + $(call Device/marvell-nand,XP DB (DB-78460-BP)) +endef +TARGET_DEVICES += armada-xp-db + +define Device/armada-xp-gp + $(call Device/marvell-nand,XP GP (DB-MV784MP-GP)) +endef +TARGET_DEVICES += armada-xp-gp define Device/armada-388-rd DEVICE_TITLE := Marvell Armada 388 RD (RD-88F6820-AP) diff --git a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch index dba8f27b3..f9d5ac1bb 100644 --- a/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch +++ b/target/linux/mvebu/patches-4.9/120-net-mvneta-add-BQL-support.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1720,8 +1720,10 @@ static struct mvneta_tx_queue *mvneta_tx +@@ -1724,8 +1724,10 @@ static struct mvneta_tx_queue *mvneta_tx /* Free tx queue skbuffs */ static void mvneta_txq_bufs_free(struct mvneta_port *pp, @@ -12,7 +12,7 @@ int i; for (i = 0; i < num; i++) { -@@ -1729,6 +1731,11 @@ static void mvneta_txq_bufs_free(struct +@@ -1733,6 +1735,11 @@ static void mvneta_txq_bufs_free(struct txq->txq_get_index; struct sk_buff *skb = txq->tx_skb[txq->txq_get_index]; @@ -24,7 +24,7 @@ mvneta_txq_inc_get(txq); if (!IS_TSO_HEADER(txq, tx_desc->buf_phys_addr)) -@@ -1739,6 +1746,8 @@ static void mvneta_txq_bufs_free(struct +@@ -1743,6 +1750,8 @@ static void mvneta_txq_bufs_free(struct continue; dev_kfree_skb_any(skb); } @@ -33,7 +33,7 @@ } /* Handle end of transmission */ -@@ -1752,7 +1761,7 @@ static void mvneta_txq_done(struct mvnet +@@ -1756,7 +1765,7 @@ static void mvneta_txq_done(struct mvnet if (!tx_done) return; @@ -42,7 +42,7 @@ txq->count -= tx_done; -@@ -2359,6 +2368,8 @@ out: +@@ -2363,6 +2372,8 @@ out: struct mvneta_pcpu_stats *stats = this_cpu_ptr(pp->stats); struct netdev_queue *nq = netdev_get_tx_queue(dev, txq_id); @@ -51,7 +51,7 @@ txq->count += frags; mvneta_txq_pend_desc_add(pp, txq, frags); -@@ -2383,9 +2394,10 @@ static void mvneta_txq_done_force(struct +@@ -2387,9 +2398,10 @@ static void mvneta_txq_done_force(struct struct mvneta_tx_queue *txq) { @@ -63,7 +63,7 @@ /* reset txq */ txq->count = 0; -@@ -2881,6 +2893,8 @@ static int mvneta_txq_init(struct mvneta +@@ -2885,6 +2897,8 @@ static int mvneta_txq_init(struct mvneta static void mvneta_txq_deinit(struct mvneta_port *pp, struct mvneta_tx_queue *txq) { @@ -72,7 +72,7 @@ kfree(txq->tx_skb); if (txq->tso_hdrs) -@@ -2892,6 +2906,8 @@ static void mvneta_txq_deinit(struct mvn +@@ -2896,6 +2910,8 @@ static void mvneta_txq_deinit(struct mvn txq->size * MVNETA_DESC_ALIGNED_SIZE, txq->descs, txq->descs_phys); diff --git a/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch b/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch new file mode 100644 index 000000000..14cbb7beb --- /dev/null +++ b/target/linux/mvebu/patches-4.9/130-irqchip-armada-xp-backport.patch @@ -0,0 +1,17 @@ +Backport a change that updates the effective affinity mask. The Armada IRQ +controller only supports setting the affinity to a single CPU, and the IRQ +subsystem needs to know about that. + +Signed-off-by: Felix Fietkau +--- +--- a/drivers/irqchip/irq-armada-370-xp.c ++++ b/drivers/irqchip/irq-armada-370-xp.c +@@ -251,6 +251,8 @@ static int armada_xp_set_affinity(struct + writel(reg, main_int_base + ARMADA_370_XP_INT_SOURCE_CTL(hwirq)); + raw_spin_unlock(&irq_controller_lock); + ++ cpumask_copy(irq_data_get_affinity_mask(d), cpumask_of(cpu)); ++ + return IRQ_SET_MASK_OK; + } + #endif diff --git a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch index 2601d92fc..d5486e738 100644 --- a/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch +++ b/target/linux/mvebu/patches-4.9/300-mvneta-tx-queue-workaround.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3834,6 +3834,16 @@ static int mvneta_ethtool_get_rxfh(struc +@@ -3838,6 +3838,16 @@ static int mvneta_ethtool_get_rxfh(struc return 0; } @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3844,6 +3854,7 @@ static const struct net_device_ops mvnet +@@ -3848,6 +3858,7 @@ static const struct net_device_ops mvnet .ndo_fix_features = mvneta_fix_features, .ndo_get_stats64 = mvneta_get_stats64, .ndo_do_ioctl = mvneta_ioctl, diff --git a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch index 8084a17af..b62dadd2f 100644 --- a/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.9/419-net-mvneta-convert-to-phylink.patch @@ -74,7 +74,18 @@ Signed-off-by: Russell King struct mvneta_bm *bm_priv; struct mvneta_bm_pool *pool_long; -@@ -1241,44 +1244,6 @@ static void mvneta_set_other_mcast_table +@@ -1182,10 +1185,6 @@ static void mvneta_port_disable(struct m + val &= ~MVNETA_GMAC0_PORT_ENABLE; + mvreg_write(pp, MVNETA_GMAC_CTRL_0, val); + +- pp->link = 0; +- pp->duplex = -1; +- pp->speed = 0; +- + udelay(200); + } + +@@ -1245,44 +1244,6 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -119,7 +130,7 @@ Signed-off-by: Russell King static void mvneta_percpu_unmask_interrupt(void *arg) { struct mvneta_port *pp = arg; -@@ -1426,7 +1391,6 @@ static void mvneta_defaults_set(struct m +@@ -1430,7 +1391,6 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -127,7 +138,7 @@ Signed-off-by: Russell King mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2631,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v +@@ -2635,26 +2595,11 @@ static irqreturn_t mvneta_isr(int irq, v return IRQ_HANDLED; } @@ -156,7 +167,7 @@ Signed-off-by: Russell King } /* NAPI handler -@@ -2666,7 +2615,6 @@ static int mvneta_poll(struct napi_struc +@@ -2670,7 +2615,6 @@ static int mvneta_poll(struct napi_struc u32 cause_rx_tx; int rx_queue; struct mvneta_port *pp = netdev_priv(napi->dev); @@ -164,7 +175,7 @@ Signed-off-by: Russell King struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); if (!netif_running(pp->dev)) { -@@ -2680,12 +2628,11 @@ static int mvneta_poll(struct napi_struc +@@ -2684,12 +2628,11 @@ static int mvneta_poll(struct napi_struc u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE); mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); @@ -182,7 +193,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2981,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne +@@ -2985,7 +2928,6 @@ static int mvneta_setup_txqs(struct mvne static void mvneta_start_dev(struct mvneta_port *pp) { int cpu; @@ -190,7 +201,7 @@ Signed-off-by: Russell King mvneta_max_rx_size_set(pp, pp->pkt_size); mvneta_txq_max_tx_size_set(pp, pp->pkt_size); -@@ -3004,16 +2950,15 @@ static void mvneta_start_dev(struct mvne +@@ -3008,16 +2950,15 @@ static void mvneta_start_dev(struct mvne MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); @@ -209,7 +220,7 @@ Signed-off-by: Russell King for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3183,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne +@@ -3187,99 +3128,210 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -252,15 +263,6 @@ Signed-off-by: Russell King - struct phy_device *phydev = ndev->phydev; - int status_change = 0; + u32 gmac_stat; -+ -+ gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS); -+ -+ if (gmac_stat & MVNETA_GMAC_SPEED_1000) -+ state->speed = SPEED_1000; -+ else if (gmac_stat & MVNETA_GMAC_SPEED_100) -+ state->speed = SPEED_100; -+ else -+ state->speed = SPEED_10; - if (phydev->link) { - if ((pp->speed != phydev->speed) || @@ -279,17 +281,26 @@ Signed-off-by: Russell King - val |= MVNETA_GMAC_CONFIG_GMII_SPEED; - else if (phydev->speed == SPEED_100) - val |= MVNETA_GMAC_CONFIG_MII_SPEED; -+ state->an_complete = !!(gmac_stat & MVNETA_GMAC_AN_COMPLETE); -+ state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); -+ state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); ++ gmac_stat = mvreg_read(pp, MVNETA_GMAC_STATUS); - mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); -+ return 1; -+} ++ if (gmac_stat & MVNETA_GMAC_SPEED_1000) ++ state->speed = SPEED_1000; ++ else if (gmac_stat & MVNETA_GMAC_SPEED_100) ++ state->speed = SPEED_100; ++ else ++ state->speed = SPEED_10; - pp->duplex = phydev->duplex; - pp->speed = phydev->speed; - } ++ state->an_complete = !!(gmac_stat & MVNETA_GMAC_AN_COMPLETE); ++ state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); ++ state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); ++ ++ return 1; ++} ++ +static void mvneta_mac_an_restart(struct net_device *ndev, unsigned int mode) +{ + struct mvneta_port *pp = netdev_priv(ndev); @@ -490,7 +501,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3533,10 +3589,9 @@ static int mvneta_stop(struct net_device +@@ -3537,10 +3589,9 @@ static int mvneta_stop(struct net_device static int mvneta_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { @@ -503,7 +514,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3547,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct +@@ -3551,44 +3602,18 @@ mvneta_ethtool_set_link_ksettings(struct const struct ethtool_link_ksettings *cmd) { struct mvneta_port *pp = netdev_priv(ndev); @@ -557,7 +568,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3692,26 +3721,28 @@ static void mvneta_ethtool_update_stats( +@@ -3696,26 +3721,28 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -591,7 +602,7 @@ Signed-off-by: Russell King } } -@@ -3871,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3875,7 +3902,7 @@ const struct ethtool_ops mvneta_eth_tool .get_rxnfc = mvneta_ethtool_get_rxnfc, .get_rxfh = mvneta_ethtool_get_rxfh, .set_rxfh = mvneta_ethtool_set_rxfh, @@ -600,7 +611,7 @@ Signed-off-by: Russell King .set_link_ksettings = mvneta_ethtool_set_link_ksettings, }; -@@ -3998,14 +4029,13 @@ static int mvneta_probe(struct platform_ +@@ -4002,14 +4029,13 @@ static int mvneta_probe(struct platform_ const struct mbus_dram_target_info *dram_target_info; struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -616,7 +627,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -4021,31 +4051,11 @@ static int mvneta_probe(struct platform_ +@@ -4025,31 +4051,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -649,7 +660,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4056,12 +4066,7 @@ static int mvneta_probe(struct platform_ +@@ -4060,12 +4066,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -663,7 +674,7 @@ Signed-off-by: Russell King pp->rxq_def = rxq_def; -@@ -4072,7 +4077,7 @@ static int mvneta_probe(struct platform_ +@@ -4076,7 +4077,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -672,7 +683,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4180,6 +4185,14 @@ static int mvneta_probe(struct platform_ +@@ -4184,6 +4185,14 @@ static int mvneta_probe(struct platform_ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE; dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; @@ -687,7 +698,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4191,14 +4204,6 @@ static int mvneta_probe(struct platform_ +@@ -4195,14 +4204,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -702,7 +713,7 @@ Signed-off-by: Russell King return 0; err_netdev: -@@ -4209,16 +4214,14 @@ err_netdev: +@@ -4213,16 +4214,14 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -721,7 +732,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4230,7 +4233,6 @@ err_free_netdev: +@@ -4234,7 +4233,6 @@ err_free_netdev: static int mvneta_remove(struct platform_device *pdev) { struct net_device *dev = platform_get_drvdata(pdev); @@ -729,7 +740,7 @@ Signed-off-by: Russell King struct mvneta_port *pp = netdev_priv(dev); unregister_netdev(dev); -@@ -4238,10 +4240,8 @@ static int mvneta_remove(struct platform +@@ -4242,10 +4240,8 @@ static int mvneta_remove(struct platform clk_disable_unprepare(pp->clk); free_percpu(pp->ports); free_percpu(pp->stats); diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index 6d35b5005..f6e6df3de 100644 --- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc +@@ -2634,9 +2634,11 @@ static int mvneta_poll(struct napi_struc mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -26,7 +26,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne +@@ -2951,8 +2953,7 @@ static void mvneta_start_dev(struct mvne mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -36,7 +36,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3443,8 +3444,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -46,7 +46,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3485,8 +3485,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch index 20c23ba2a..d2bbb26ab 100644 --- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch +++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct +@@ -3619,6 +3619,13 @@ mvneta_ethtool_get_link_ksettings(struct return phylink_ethtool_ksettings_get(pp->phylink, cmd); } @@ -25,7 +25,7 @@ Signed-off-by: Russell King /* Set interrupt coalescing for ethtools */ static int mvneta_ethtool_set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) -@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet +@@ -3892,6 +3899,7 @@ static const struct net_device_ops mvnet }; const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch index 3f778953e..cb4cebe0e 100644 --- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch +++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct +@@ -3183,6 +3183,12 @@ static int mvneta_mac_link_state(struct state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); @@ -24,7 +24,7 @@ Signed-off-by: Russell King return 1; } -@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net +@@ -3225,6 +3231,8 @@ static void mvneta_mac_config(struct net if (phylink_test(state->advertising, Pause)) new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL; @@ -33,7 +33,7 @@ Signed-off-by: Russell King switch (mode) { case MLO_AN_SGMII: -@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net +@@ -3249,7 +3257,7 @@ static void mvneta_mac_config(struct net /* The MAC only supports FD mode */ MVNETA_GMAC_CONFIG_FULL_DUPLEX; @@ -42,7 +42,7 @@ Signed-off-by: Russell King new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN; break; -@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3715,6 +3723,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -65,7 +65,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3906,6 +3930,8 @@ const struct ethtool_ops mvneta_eth_tool .get_drvinfo = mvneta_ethtool_get_drvinfo, .get_ringparam = mvneta_ethtool_get_ringparam, .set_ringparam = mvneta_ethtool_set_ringparam, diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch index f2d14afda..3c2511d26 100644 --- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch +++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru +@@ -3157,10 +3157,11 @@ static void mvneta_validate_support(stru phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Full); diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch index bac74ca4e..8bd6cec5c 100644 --- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch +++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru +@@ -3147,6 +3147,8 @@ static void mvneta_validate_support(stru phylink_set(mask, BNC); phylink_set(mask, Backplane); @@ -20,7 +20,7 @@ Signed-off-by: Russell King /* Half-duplex at speeds higher than 100Mbit is unsupported */ phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); -@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru +@@ -3159,9 +3161,6 @@ static void mvneta_validate_support(stru phylink_set(mask, 100baseT_Full); } diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch index bc7e5eeeb..8451e1ef1 100644 --- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct +@@ -3309,7 +3309,8 @@ static void mvneta_mac_link_down(struct } } diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch index 3a20a06be..9cffde54d 100644 --- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch @@ -65,7 +65,7 @@ Signed-off-by: Russell King u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; u32 indir[MVNETA_RSS_LU_TABLE_SIZE]; -@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net +@@ -3294,6 +3311,18 @@ static void mvneta_mac_config(struct net mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an); } @@ -84,7 +84,7 @@ Signed-off-by: Russell King static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) { struct mvneta_port *pp = netdev_priv(ndev); -@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct +@@ -3307,6 +3336,9 @@ static void mvneta_mac_link_down(struct val |= MVNETA_GMAC_FORCE_LINK_DOWN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); } @@ -94,7 +94,7 @@ Signed-off-by: Russell King } static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode, -@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne +@@ -3323,6 +3355,11 @@ static void mvneta_mac_link_up(struct ne } mvneta_port_up(pp); @@ -106,7 +106,7 @@ Signed-off-by: Russell King } static const struct phylink_mac_ops mvneta_phylink_ops = { -@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats( +@@ -3775,6 +3812,13 @@ static void mvneta_ethtool_update_stats( high = readl_relaxed(base + s->offset + 4); val = (u64)high << 32 | low; break; @@ -120,7 +120,7 @@ Signed-off-by: Russell King } pp->ethtool_stats[i] += val; -@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne +@@ -3910,6 +3954,47 @@ static u16 mvneta_select_queue(struct ne } @@ -168,7 +168,7 @@ Signed-off-by: Russell King static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3942,6 +4027,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch index 834bbe9a3..da98c1cbb 100644 --- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch @@ -7,7 +7,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne +@@ -3954,6 +3954,22 @@ static u16 mvneta_select_queue(struct ne } @@ -30,7 +30,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -4027,6 +4043,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, From 62284be4328794423bdac1983b1a2fff4d4b63dd Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 8 Jan 2018 13:45:29 +0800 Subject: [PATCH 54/95] fix ramips (mtk762x) wifi issue --- .../ramips/base-files/etc/board.d/01_leds | 380 +++++++++--------- .../ramips/base-files/etc/board.d/02_network | 13 +- target/linux/ramips/base-files/etc/diag.sh | 107 ++--- target/linux/ramips/base-files/lib/ramips.sh | 27 +- .../ramips/base-files/lib/upgrade/platform.sh | 7 +- target/linux/ramips/dts/ArcherMR200.dts | 2 +- target/linux/ramips/dts/BR-6475ND.dts | 2 +- target/linux/ramips/dts/DWR-512-B.dts | 2 +- target/linux/ramips/dts/GL-MT300N-V2.dts | 2 +- target/linux/ramips/dts/HC5861.dts | 4 +- target/linux/ramips/dts/JHR-N926R.dts | 2 +- target/linux/ramips/dts/LINKIT7688.dts | 27 +- target/linux/ramips/dts/Newifi-D2.dts | 159 ++++++++ target/linux/ramips/dts/OMEGA2.dts | 1 + target/linux/ramips/dts/OMEGA2.dtsi | 2 +- target/linux/ramips/dts/OMEGA2P.dts | 1 + target/linux/ramips/dts/PBR-D1.dts | 2 +- target/linux/ramips/dts/PBR-M1.dts | 2 +- target/linux/ramips/dts/R6220.dts | 2 +- target/linux/ramips/dts/RT-N12-PLUS.dts | 117 ++++++ target/linux/ramips/dts/TL-MR3420V5.dts | 86 ++++ target/linux/ramips/dts/VAR11N-300.dts | 90 +++++ target/linux/ramips/dts/WIZFI630A.dts | 5 - target/linux/ramips/dts/WNDR3700V5.dts | 2 +- target/linux/ramips/dts/WR6202.dts | 2 +- target/linux/ramips/dts/WT1520.dtsi | 24 +- target/linux/ramips/dts/X5.dts | 2 +- target/linux/ramips/dts/Y1.dts | 2 +- target/linux/ramips/dts/Y1.dtsi | 2 +- target/linux/ramips/dts/Y1S.dts | 2 +- target/linux/ramips/image/Makefile | 2 +- target/linux/ramips/image/mt7620.mk | 20 + target/linux/ramips/image/mt7621.mk | 14 +- target/linux/ramips/image/mt76x8.mk | 55 ++- 34 files changed, 844 insertions(+), 325 deletions(-) create mode 100644 target/linux/ramips/dts/Newifi-D2.dts create mode 100644 target/linux/ramips/dts/RT-N12-PLUS.dts create mode 100644 target/linux/ramips/dts/TL-MR3420V5.dts create mode 100644 target/linux/ramips/dts/VAR11N-300.dts diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 74e405e42..03d084f17 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -12,6 +12,7 @@ set_wifi_led() { board=$(board_name) +boardname="${board##*,}" board_config_update @@ -25,35 +26,35 @@ sap-g3200u3|\ sk-wb8|\ w2914nsv2|\ wf-2881) - set_usb_led "$board:green:usb" + set_usb_led "$boardname:green:usb" ;; 3g150b|\ 3g300m) - set_usb_led "$board:blue:3g" + set_usb_led "$boardname:blue:3g" ;; 3g-6200n) - set_wifi_led "$board:amber:wlan" - set_usb_led "$board:blue:3g" + set_wifi_led "$boardname:amber:wlan" + set_usb_led "$boardname:blue:3g" ;; 3g-6200nl|\ wnce2001) - set_wifi_led "$board:green:wlan" + set_wifi_led "$boardname:green:wlan" ;; br-6475nd|\ mzk-w300nh2) - set_wifi_led "$board:amber:wlan" + set_wifi_led "$boardname:amber:wlan" ;; a5-v11|\ cs-qr10) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" ;; ai-br100) - ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" "eth0.2" - set_wifi_led "$board:blue:wlan" + ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" "eth0.2" + set_wifi_led "$boardname:blue:wlan" ;; air3gii) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:mobile" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:mobile" ;; all0256n-4M|\ all0256n-8M) @@ -76,66 +77,66 @@ asl26555-16M) set_usb_led "asl26555:green:3g" ;; bc2) - set_usb_led "$board:blue:usb" + set_usb_led "$boardname:blue:usb" ;; broadway) - set_usb_led "$board:red:diskmounted" - set_wifi_led "$board:red:wps_active" + set_usb_led "$boardname:red:diskmounted" + set_wifi_led "$boardname:red:wps_active" ;; c108) - ucidef_set_led_netdev "lan" "lan" "$board:green:lan" "eth0" - ucidef_set_led_netdev "modem" "modem" "$board:green:modem" "wwan0" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:lan" "eth0" + ucidef_set_led_netdev "modem" "modem" "$boardname:green:modem" "wwan0" ;; c20) - ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01" - set_usb_led "$board:blue:usb" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$board:blue:wlan2g" "wlan0" + ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:blue:wlan2g" "wlan0" ;; c20i) - ucidef_set_led_switch "lan" "lan" "$board:blue:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x01" - set_usb_led "$board:blue:usb" "2-1" - ucidef_set_led_wlan "wlan" "wlan" "$board:blue:wlan" "phy0radio" + ucidef_set_led_switch "lan" "lan" "$boardname:blue:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x01" + set_usb_led "$boardname:blue:usb" "2-1" + ucidef_set_led_wlan "wlan" "wlan" "$boardname:blue:wlan" "phy0radio" ;; c50) - ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" - set_usb_led "$board:green:usb" - ucidef_set_led_netdev "wlan2g" "wlan2g" "$board:green:wlan2g" wlan1 - set_wifi_led "$board:green:wlan5g" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" + set_usb_led "$boardname:green:usb" + ucidef_set_led_netdev "wlan2g" "wlan2g" "$boardname:green:wlan2g" wlan1 + set_wifi_led "$boardname:green:wlan5g" ;; cf-wr800n) - ucidef_set_led_netdev "lan" "lan" "$board:white:ethernet" eth0.1 - set_wifi_led "$board:white:wifi" + ucidef_set_led_netdev "lan" "lan" "$boardname:white:ethernet" eth0.1 + set_wifi_led "$boardname:white:wifi" ;; cy-swr1100) - ucidef_set_led_default "wps" "WPS" "$board:blue:wps" "0" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "wps" "WPS" "$boardname:blue:wps" "0" + set_usb_led "$boardname:blue:usb" ;; d105) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" - set_usb_led "$board:green:usb" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" + set_usb_led "$boardname:green:usb" ;; d240) - set_wifi_led "$board:blue:wifi" - set_usb_led "$board:blue:usb" + set_wifi_led "$boardname:blue:wifi" + set_usb_led "$boardname:blue:usb" ;; db-wrt01) - ucidef_set_led_default "power" "power" "$board:orange:power" "1" + ucidef_set_led_default "power" "power" "$boardname:orange:power" "1" ;; dch-m225) ucidef_set_led_default "power" "POWER" "$board:geeen:power" "1" ucidef_set_led_default "status" "STATUS" "$board:red:status" "0" ;; dcs-930l-b1) - ucidef_set_led_default "power" "POWER" "$board:red:power" "1" - ucidef_set_led_netdev "wifi" "WiFi" "$board:blue:wps" + ucidef_set_led_default "power" "POWER" "$boardname:red:power" "1" + ucidef_set_led_netdev "wifi" "WiFi" "$boardname:blue:wps" ;; dir-300-b1|\ dir-600-b1|\ dir-620-a1) - ucidef_set_led_default "wan" "WAN LED (amber)" "$board:amber:wan" "1" + ucidef_set_led_default "wan" "WAN LED (amber)" "$boardname:amber:wan" "1" set_wifi_led "rt2800pci-phy0::radio" ;; dir-300-b7|\ @@ -152,165 +153,174 @@ wt1520-8M) ;; dir-615-d|\ dir-615-h1) - ucidef_set_led_default "status" "Status LED (amber)" "$board:amber:status" "0" + ucidef_set_led_default "status" "Status LED (amber)" "$boardname:amber:status" "0" set_wifi_led "rt2800pci-phy0::radio" ;; dir-620-d1|\ mzk-ex300np) - set_wifi_led "$board:green:wifi" + set_wifi_led "$boardname:green:wifi" ;; dir-810l|\ mzk-750dhp|\ mzk-dp150n|\ vr500) - ucidef_set_led_default "power" "power" "$board:green:power" "1" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" ;; dir-860l-b1) - ucidef_set_led_netdev "wan" "wan" "$board:green:net" "eth0.2" + ucidef_set_led_netdev "wan" "wan" "$boardname:green:net" "eth0.2" ;; ex2700|\ wn3000rpv3) - set_wifi_led "$board:green:router" + set_wifi_led "$boardname:green:router" ;; ex3700) - ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$board:green:router" "wlan0" - ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$board:green:device" "wlan1" + ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "$boardname:green:router" "wlan0" + ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "$boardname:green:device" "wlan1" ;; f5d8235-v1) - ucidef_set_led_default "lan" "lan" "$board:blue:wired" "0" - set_usb_led "$board:blue:storage" - set_wifi_led "$board:blue:wireless" + ucidef_set_led_default "lan" "lan" "$boardname:blue:wired" "0" + set_usb_led "$boardname:blue:storage" + set_wifi_led "$boardname:blue:wireless" ;; f5d8235-v2) - set_usb_led "$board:blue:storage" + set_usb_led "$boardname:blue:storage" ;; fonera20n) - set_usb_led "$board:orange:usb" - set_wifi_led "$board:orange:wifi" + set_usb_led "$boardname:orange:usb" + set_wifi_led "$boardname:orange:wifi" ;; gb-pc1) - ucidef_set_led_switch "lan1" "lan1" "$board:green:lan1" "switch0" "0x01" - ucidef_set_led_switch "lan2" "lan2" "$board:green:lan2" "switch0" "0x10" + ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x01" + ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x10" ;; gl-mt300a|\ gl-mt300n|\ gl-mt750) - set_wifi_led "$board:wlan" + set_wifi_led "$boardname:wlan" ;; gl-mt300n-v2) - set_wifi_led "$board:red:wlan" + set_wifi_led "$boardname:red:wlan" ;; hc5661|\ hc5661a) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" ;; hc5761) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0" ;; hc5861) - ucidef_set_led_default "system" "system" "$board:blue:system" "1" - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - set_wifi_led "$board:blue:wlan2g" - ucidef_set_led_netdev "wifi5g" "wifi5g" "$board:blue:wlan5g" "rai0" - ucidef_set_led_default "turbo" "turbo" "$board:blue:turbo" "0" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + set_wifi_led "$boardname:blue:wlan2g" + ucidef_set_led_netdev "wifi5g" "wifi5g" "$boardname:blue:wlan5g" "rai0" + ucidef_set_led_default "turbo" "turbo" "$boardname:blue:turbo" "0" ;; hg255d) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:usb" - ucidef_set_led_netdev "internet" "internet" "$board:green:internet" "eth0.2" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:usb" + ucidef_set_led_netdev "internet" "internet" "$boardname:green:internet" "eth0.2" ;; hpm) - ucidef_set_led_default "power" "POWER" "$board:orange:power" "1" - ucidef_set_led_netdev "eth" "ETH" "$board:green:eth" "eth0" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "POWER" "$boardname:orange:power" "1" + ucidef_set_led_netdev "eth" "ETH" "$boardname:green:eth" "eth0" + set_wifi_led "$boardname:green:wifi" ;; ht-tm02) - ucidef_set_led_netdev "eth" "Ethernet" "$board:green:lan" "eth0" - set_wifi_led "$board:blue:wlan" + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:lan" "eth0" + set_wifi_led "$boardname:blue:wlan" ;; kn|\ nbg-419n2) - set_usb_led "$board:green:usb" + set_usb_led "$boardname:green:usb" set_wifi_led "rt2800pci-phy0::radio" ;; kn_rc|\ kn_rf|\ kng_rc) - set_usb_led "$board:green:usb" - set_wifi_led "$board:green:wifi" + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wifi" + ;; +linkits7688) + ucidef_set_led_wlan "wifi" "wifi" "linkit-smart-7688:orange:wifi" "phy0tpt" ;; m2m) - set_wifi_led "$board:blue:wifi" - ucidef_set_led_netdev "eth" "Ethernet" "$board:green:wan" "eth0" + set_wifi_led "$boardname:blue:wifi" + ucidef_set_led_netdev "eth" "Ethernet" "$boardname:green:wan" "eth0" ;; miniembplug) - set_wifi_led "$board:red:wlan" - set_usb_led "$board:green:mobile" + set_wifi_led "$boardname:red:wlan" + set_usb_led "$boardname:green:mobile" ;; mir3g) - ucidef_set_led_switch "wan-amber" "WAN (amber)" "$board:amber:wan" "switch0" "0x02" "0x08" - ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$board:amber:lan1" "switch0" "0x08" "0x08" - ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$board:amber:lan2" "switch0" "0x04" "0x08" + ucidef_set_led_switch "wan-amber" "WAN (amber)" "$boardname:amber:wan" "switch0" "0x02" "0x08" + ucidef_set_led_switch "lan1-amber" "LAN1 (amber)" "$boardname:amber:lan1" "switch0" "0x08" "0x08" + ucidef_set_led_switch "lan2-amber" "LAN2 (amber)" "$boardname:amber:lan2" "switch0" "0x04" "0x08" ;; miwifi-mini) - ucidef_set_led_default "power" "power" "$board:red:status" "1" + ucidef_set_led_default "power" "power" "$boardname:red:status" "1" ;; mlw221|\ mlwg2) - set_wifi_led "$board:blue:wifi" - ucidef_set_led_default "system" "system" "$board:blue:system" "1" + set_wifi_led "$boardname:blue:wifi" + ucidef_set_led_default "system" "system" "$boardname:blue:system" "1" ;; mpr-a1|\ mpr-a2) - set_wifi_led "$board:blue:system" + set_wifi_led "$boardname:blue:system" ;; mr-102n) - set_wifi_led "$board:green:wlan" - set_usb_led "$board:green:usb" + set_wifi_led "$boardname:green:wlan" + set_usb_led "$boardname:green:usb" ;; mr200) - ucidef_set_led_default "power" "power" "$board:white:power" "1" - ucidef_set_led_netdev "lan" "lan" "$board:white:lan" "eth0.1" - ucidef_set_led_netdev "wan" "wan" "$board:white:wan" "usb0" - set_wifi_led "$board:white:wlan" + ucidef_set_led_default "power" "power" "$boardname:white:power" "1" + ucidef_set_led_netdev "lan" "lan" "$boardname:white:lan" "eth0.1" + ucidef_set_led_netdev "wan" "wan" "$boardname:white:wan" "usb0" + set_wifi_led "$boardname:white:wlan" ;; mzk-ex750np) - ucidef_set_led_default "power" "power" "$board:red:power" "1" - set_wifi_led "$board:red:wifi" + ucidef_set_led_default "power" "power" "$boardname:red:power" "1" + set_wifi_led "$boardname:red:wifi" ;; na930) - set_usb_led "$board:blue:status" + set_usb_led "$boardname:blue:status" ;; newifi-d1) - set_usb_led "$board:red:status" + set_usb_led "$boardname:red:status" ;; nw718) - set_usb_led "$board:amber:usb" + set_usb_led "$boardname:amber:usb" ;; oy-0001) - ucidef_set_led_default "power" "power" "$board:green:power" "1" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" + set_wifi_led "$boardname:green:wifi" ;; pbr-d1) - set_usb_led "$board:orange:usb" + set_usb_led "$boardname:orange:usb" ;; pbr-m1) - ucidef_set_led_netdev "internet" "internet" "$board:blue:internet" "eth0.2" - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - ucidef_set_led_default "sys" "sys" "$board:blue:sys" "1" + ucidef_set_led_netdev "internet" "internet" "$boardname:blue:internet" "eth0.2" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + ucidef_set_led_default "sys" "sys" "$boardname:blue:sys" "1" + ;; +d-team,newifi-d2) + set_usb_led "$boardname:blue:usb" + ucidef_set_led_switch "internet" "internet" "$boardname:amber:internet" "switch0" "0x10" + ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "$boardname:blue:wlan2g" "wlan0" + ucidef_set_led_netdev "wlan5g" "WiFi 5GHz" "$boardname:blue:wlan5g" "wlan1" ;; psg1208) - set_wifi_led "$board:white:wlan2g" + set_wifi_led "$boardname:white:wlan2g" ;; psg1218a|\ psg1218b) - ucidef_set_led_netdev "Network" "Network" "$board:blue:status" "eth0" - ucidef_set_led_default "status" "STATUS" "$board:yellow:status" "0" + ucidef_set_led_netdev "Network" "Network" "$boardname:blue:status" "eth0" + ucidef_set_led_default "status" "STATUS" "$boardname:yellow:status" "0" ;; px-4885-4M|\ px-4885-8M) @@ -318,55 +328,67 @@ px-4885-8M) set_usb_led "px-4885:blue:storage" ;; r6220) - ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2 - set_wifi_led "$board:green:wifi" - set_usb_led "$board:green:usb" + ucidef_set_led_netdev "wan" "wan" "$boardname:green:wan" eth0.2 + set_wifi_led "$boardname:green:wifi" + set_usb_led "$boardname:green:usb" ;; re350-v1) - ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$board:blue:wifi2G" "wlan0" - ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$board:blue:wifi5G" "wlan1" - ucidef_set_led_netdev "eth_act" "LAN act" "$board:green:eth_act" "eth0" "tx rx" - ucidef_set_led_switch "eth_link" "LAN link" "$board:green:eth_link" "switch0" "0x01" + ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "$boardname:blue:wifi2G" "wlan0" + ucidef_set_led_netdev "wifi5g" "Wifi 5G" "$boardname:blue:wifi5G" "wlan1" + ucidef_set_led_netdev "eth_act" "LAN act" "$boardname:green:eth_act" "eth0" "tx rx" + ucidef_set_led_switch "eth_link" "LAN link" "$boardname:green:eth_link" "switch0" "0x01" ;; re6500) - ucidef_set_led_default "power" "power" "$board:white:power" "1" - ucidef_set_led_default "wifi" "wifi" "$board:orange:wifi" "1" + ucidef_set_led_default "power" "power" "$boardname:white:power" "1" + ucidef_set_led_default "wifi" "wifi" "$boardname:orange:wifi" "1" ;; rp-n53) - ucidef_set_led_netdev "eth" "Network" "$board:white:back" "eth0" - set_wifi_led "$board:blue:wifi" + ucidef_set_led_netdev "eth" "Network" "$boardname:white:back" "eth0" + set_wifi_led "$boardname:blue:wifi" ;; rt-ac51u) - set_wifi_led "$board:blue:wifi" - set_usb_led "$board:blue:usb" "1-1" + set_wifi_led "$boardname:blue:wifi" + set_usb_led "$boardname:blue:usb" "1-1" + ;; +rt-n12p) + ucidef_set_led_default "power" "power" "$board:green:power" "1" + ucidef_set_led_netdev "lan" "lan" "$board:green:lan" eth0.1 + ucidef_set_led_netdev "wan" "wan" "$board:green:wan" eth0.2 + set_wifi_led "$board:green:air" ;; rt-n14u) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - ucidef_set_led_netdev "lan" "lan" "$board:blue:lan" eth0.1 - ucidef_set_led_netdev "wan" "wan" "$board:blue:wan" eth0.2 - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + ucidef_set_led_netdev "lan" "lan" "$boardname:blue:lan" eth0.1 + ucidef_set_led_netdev "wan" "wan" "$boardname:blue:wan" eth0.2 + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" ;; tew-714tru) - set_usb_led "$board:red:usb" - set_wifi_led "$board:green:wifi" + set_usb_led "$boardname:red:usb" + set_wifi_led "$boardname:green:wifi" ;; tiny-ac) - set_wifi_led "$board:orange:wifi" - set_usb_led "$board:green:usb" + set_wifi_led "$boardname:orange:wifi" + set_usb_led "$boardname:green:usb" ;; tl-wr840n-v4) - set_wifi_led "$board:green:wlan" - ucidef_set_led_switch "lan" "lan" "$board:green:lan" "switch0" "0x1e" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; tl-wr841n-v13) - set_wifi_led "$board:green:wlan" - ucidef_set_led_switch "lan1" "lan1" "$board:green:lan1" "switch0" "0x2" - ucidef_set_led_switch "lan2" "lan2" "$board:green:lan2" "switch0" "0x4" - ucidef_set_led_switch "lan3" "lan3" "$board:green:lan3" "switch0" "0x8" - ucidef_set_led_switch "lan4" "lan4" "$board:green:lan4" "switch0" "0x10" - ucidef_set_led_switch "wan" "wan" "$board:green:wan" "switch0" "0x01" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan1" "lan1" "$boardname:green:lan1" "switch0" "0x2" + ucidef_set_led_switch "lan2" "lan2" "$boardname:green:lan2" "switch0" "0x4" + ucidef_set_led_switch "lan3" "lan3" "$boardname:green:lan3" "switch0" "0x8" + ucidef_set_led_switch "lan4" "lan4" "$boardname:green:lan4" "switch0" "0x10" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" + ;; +tplink,tl-mr3420-v5) + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_switch "lan" "lan" "$boardname:green:lan" "switch0" "0x1e" + ucidef_set_led_switch "wan" "wan" "$boardname:green:wan" "switch0" "0x01" ;; u25awf-h1) set_wifi_led "u25awf:red:wifi" @@ -387,17 +409,17 @@ vocore-16M) set_wifi_led "vocore:green:status" ;; vocore2) - set_wifi_led "$board:fuchsia:status" + set_wifi_led "$boardname:fuchsia:status" ;; vocore2lite) - set_wifi_led "$board:green:status" + set_wifi_led "$boardname:green:status" ;; w502u) - set_usb_led "$board:blue:usb" + set_usb_led "$boardname:blue:usb" set_wifi_led "rt2800pci-phy0::radio" ;; wcr-150gn) - set_usb_led "$board:amber:user" + set_usb_led "$boardname:amber:user" ;; we1026-5g-16m) ucidef_set_led_netdev "lan" "LAN" "we1026-5g:green:lan" "eth0" @@ -407,54 +429,54 @@ we1026-5g-16m) whr-1166d|\ whr-300hp2|\ whr-600d) - ucidef_set_led_default "power" "power" "$board:green:power" "1" - ucidef_set_led_default "router" "router" "$board:green:router" "1" + ucidef_set_led_default "power" "power" "$boardname:green:power" "1" + ucidef_set_led_default "router" "router" "$boardname:green:router" "1" ;; wl-wn575a3) ucidef_set_rssimon "wlan1" "200000" "1" - ucidef_set_led_rssi "wifi-low" "wifi-low" "$board:green:wifi-low" "wlan1" "1" "49" - ucidef_set_led_rssi "wifi-med" "wifi-med" "$board:green:wifi-med" "wlan1" "50" "84" - ucidef_set_led_rssi "wifi-high" "wifi-high" "$board:green:wifi-high" "wlan1" "85" "100" + ucidef_set_led_rssi "wifi-low" "wifi-low" "$boardname:green:wifi-low" "wlan1" "1" "49" + ucidef_set_led_rssi "wifi-med" "wifi-med" "$boardname:green:wifi-med" "wlan1" "50" "84" + ucidef_set_led_rssi "wifi-high" "wifi-high" "$boardname:green:wifi-high" "wlan1" "85" "100" ;; wrh-300cr) - set_wifi_led "$board:green:wlan" - ucidef_set_led_netdev "lan" "lan" "$board:green:ethernet" "eth0" + set_wifi_led "$boardname:green:wlan" + ucidef_set_led_netdev "lan" "lan" "$boardname:green:ethernet" "eth0" ;; wndr3700v5) - ucidef_set_led_default "power" "POWER" "$board:green:power" "0" + ucidef_set_led_default "power" "POWER" "$boardname:green:power" "0" ;; wt3020-4M|\ wt3020-8M) ucidef_set_led_default "power" "power" "wt3020:blue:power" "0" ;; y1) - set_usb_led "$board:blue:usb" - ucidef_set_led_netdev "wifi" "WIFI" "$board:blue:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi5g" "wlan0" - ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0.1" "tx rx" - ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1" + ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0" + ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0.1" "tx rx" + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" ;; y1s) - set_usb_led "$board:blue:usb" - ucidef_set_led_netdev "wifi" "WIFI" "$board:yellow:wifi" "wlan1" - ucidef_set_led_netdev "wifi5g" "WIFI5G" "$board:blue:wifi" "wlan0" - ucidef_set_led_netdev "wan" "WAN" "$board:blue:internet" "eth0.2" "tx rx" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_netdev "wifi" "WIFI" "$boardname:yellow:wifi" "wlan1" + ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi" "wlan0" + ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" ;; zbt-ape522ii) - ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$board:green:wlan2g4" "wlan1" - ucidef_set_led_netdev "sys1" "wlan1" "$board:green:sys1" "wlan1" "tx rx" - ucidef_set_led_netdev "sys2" "wlan0" "$board:green:sys2" "wlan0" "tx rx" + ucidef_set_led_netdev "wlan2g4" "wlan1-link" "$boardname:green:wlan2g4" "wlan1" + ucidef_set_led_netdev "sys1" "wlan1" "$boardname:green:sys1" "wlan1" "tx rx" + ucidef_set_led_netdev "sys2" "wlan0" "$boardname:green:sys2" "wlan0" "tx rx" ;; zbt-cpe102) - ucidef_set_led_default "power" "power" "$board:green:4g-0" "0" + ucidef_set_led_default "power" "power" "$boardname:green:4g-0" "0" ;; zbt-wa05) - ucidef_set_led_default "power" "power" "$board:blue:power" "1" - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" + ucidef_set_led_default "power" "power" "$boardname:blue:power" "1" + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" ;; zbt-we2026) - set_wifi_led "$board:green:wlan" + set_wifi_led "$boardname:green:wlan" ;; zbt-we826-16M|\ zbt-we826-32M) @@ -462,17 +484,17 @@ zbt-we826-32M) set_usb_led "zbt-we826:green:usb" ;; zbt-wr8305rt) - ucidef_set_led_default "power" "power" "$board:green:sys" "1" - set_usb_led "$board:green:usb" - set_wifi_led "$board:green:wifi" + ucidef_set_led_default "power" "power" "$boardname:green:sys" "1" + set_usb_led "$boardname:green:usb" + set_wifi_led "$boardname:green:wifi" ;; zte-q7) - set_wifi_led "$board:blue:status" + set_wifi_led "$boardname:blue:status" ;; youku-yk1) - set_wifi_led "$board:blue:air" - set_usb_led "$board:blue:usb" - ucidef_set_led_switch "wan" "wan" "$board:blue:wan" "switch0" "0x10" + set_wifi_led "$boardname:blue:air" + set_usb_led "$boardname:blue:usb" + ucidef_set_led_switch "wan" "wan" "$boardname:blue:wan" "switch0" "0x10" ;; esac diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index 6ad64e672..b8116c773 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -49,7 +49,6 @@ ramips_setup_interfaces() dcs-930l-b1|\ ht-tm02|\ linkits7688 | \ - linkits7688d | \ m2m|\ microwrt|\ mpr-a2|\ @@ -93,6 +92,7 @@ ramips_setup_interfaces() mt7628|\ mzk-750dhp|\ mzk-w300nh2|\ + d-team,newifi-d2|\ nixcore-x1-8M|\ nixcore-x1-16M|\ oy-0001|\ @@ -100,6 +100,7 @@ ramips_setup_interfaces() psg1208|\ psg1218a|\ r6220|\ + rt-n12p|\ sap-g3200u3|\ sk-wb8|\ u7621-06-256M-16M|\ @@ -114,7 +115,7 @@ ramips_setup_interfaces() youku-yk1|\ zbt-ape522ii|\ zbt-we1326|\ - zbt-we3526|\ + zbtlink,zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -172,6 +173,7 @@ ramips_setup_interfaces() mzk-wdpr|\ rb750gr3|\ rt-n14u|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ tl-wr840n-v5|\ tl-wr841n-v13|\ @@ -313,6 +315,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" ;; + vonets,var11n-300) + ucidef_add_switch "switch0" \ + "0:lan" "4:wan" "6@eth0" + ;; vocore2|\ vocore2lite) ucidef_add_switch "switch0" \ @@ -424,8 +430,7 @@ ramips_setup_macs() kng_rc) wan_mac=$(mtd_get_mac_binary factory 40) ;; - linkits7688 | \ - linkits7688d) + linkits7688) wan_mac=$(mtd_get_mac_binary factory 4) lan_mac=$(mtd_get_mac_binary factory 46) ;; diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index 50cc44058..d7cc4173a 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -6,12 +6,13 @@ get_status_led() { board=$(board_name) + boardname="${board##*,}" case $board in 3g150b|\ 3g300m|\ w150m) - status_led="$board:blue:ap" + status_led="$boardname:blue:ap" ;; 3g-6200n|\ ar670w|\ @@ -36,6 +37,7 @@ get_status_led() { nbg-419n2|\ pwh2004|\ r6220|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ tl-wr840n-v5|\ tl-wr841n-v13|\ @@ -46,10 +48,10 @@ get_status_led() { x8|\ xdxrn502j|\ wn3000rpv3) - status_led="$board:green:power" + status_led="$boardname:green:power" ;; 3g-6200nl) - status_led="$board:green:internet" + status_led="$boardname:green:internet" ;; a5-v11|\ cs-qr10|\ @@ -60,11 +62,11 @@ get_status_led() { mpr-a1|\ mpr-a2|\ mzk-ex750np) - status_led="$board:red:power" + status_led="$boardname:red:power" ;; ai-br100|\ ht-tm02) - status_led="$board:blue:wlan" + status_led="$boardname:blue:wlan" ;; all0239-3g|\ dcs-930|\ @@ -88,7 +90,7 @@ get_status_led() { v11st-fe|\ wmr-300|\ zbt-wg2626) - status_led="$board:green:status" + status_led="$boardname:green:status" ;; asl26555-8M|\ asl26555-16M) @@ -97,33 +99,34 @@ get_status_led() { atp-52b|\ ew1200|\ ip2202) - status_led="$board:green:run" + status_led="$boardname:green:run" ;; awapn2403|\ dir-645|\ sk-wb8|\ wrh-300cr) - status_led="$board:green:wps" + status_led="$boardname:green:wps" ;; c108) - status_led="$board:green:lan" + status_led="$boardname:green:lan" ;; cf-wr800n|\ psg1208) - status_led="$board:white:wps" + status_led="$boardname:white:wps" ;; psg1218a|\ psg1218b) - status_led="$board:yellow:status" + status_led="$boardname:yellow:status" ;; cy-swr1100|\ w502u) - status_led="$board:blue:wps" + status_led="$boardname:blue:wps" ;; c20|\ d240|\ dap-1350|\ na930|\ + d-team,newifi-d2|\ pbr-m1|\ re350-v1|\ rt-ac51u|\ @@ -137,82 +140,82 @@ get_status_led() { y1|\ y1s|\ youku-yk1) - status_led="$board:blue:power" + status_led="$boardname:blue:power" ;; db-wrt01|\ esr-9753|\ pbr-d1) - status_led="$board:orange:power" + status_led="$boardname:orange:power" ;; f5d8235-v1) - status_led="$board:blue:wired" + status_led="$boardname:blue:wired" ;; f5d8235-v2) - status_led="$board:blue:router" + status_led="$boardname:blue:router" ;; f7c027|\ timecloud) - status_led="$board:orange:status" + status_led="$boardname:orange:status" ;; hc5*61|\ hc5661a|\ jhr-n805r|\ jhr-n926r|\ mlw221|\ - mlwg2) - status_led="$board:blue:system" + mlwg2|\ + vonets,var11n-300) + status_led="$boardname:blue:system" ;; hc5962) - status_led="$board:white:status" + status_led="$boardname:white:status" ;; k2p|\ m3|\ miwifi-nano) - status_led="$board:blue:status" + status_led="$boardname:blue:status" ;; - linkits7688| \ - linkits7688d) - [ "$1" = "upgrade" ] && status_led="mediatek:orange:wifi" + linkits7688) + status_led="linkit-smart-7688:orange:wifi" ;; m2m) - status_led="$board:blue:wifi" + status_led="$boardname:blue:wifi" ;; gl-mt300n-v2) - status_led="$board:red:wlan" + status_led="$boardname:red:wlan" ;; m4-4M|\ m4-8M) status_led="m4:blue:status" ;; mir3g) - status_led="$board:yellow:status" + status_led="$boardname:yellow:status" ;; miwifi-mini|\ zte-q7) - status_led="$board:red:status" + status_led="$boardname:red:status" ;; mr-102n) - status_led="$board:amber:status" + status_led="$boardname:amber:status" ;; mr200) - status_led="$board:white:power" + status_led="$boardname:white:power" ;; nw718) - status_led="$board:amber:cpu" + status_led="$boardname:amber:cpu" ;; newifi-d1) - status_led="$board:blue:status" + status_led="$boardname:blue:status" ;; omega2| \ omega2p) - status_led="$board:amber:system" + status_led="$boardname:amber:system" ;; oy-0001|\ sl-r7205) - status_led="$board:green:wifi" + status_led="$boardname:green:wifi" ;; psr-680w) - status_led="$board:red:wan" + status_led="$boardname:red:wan" ;; px-4885-4M|\ px-4885-8M) @@ -220,9 +223,8 @@ get_status_led() { ;; re6500|\ whr-1166d|\ - whr-600d|\ - widora-neo) - status_led="$board:orange:wifi" + whr-600d) + status_led="$boardname:orange:wifi" ;; mzk-ex300np|\ rt-n10-plus|\ @@ -232,13 +234,13 @@ get_status_led() { ur-326n4g|\ ur-336un|\ wf-2881) - status_led="$board:green:wps" + status_led="$boardname:green:wps" ;; rb750gr3) - status_led="$board:blue:pwr" + status_led="$boardname:blue:pwr" ;; sap-g3200u3) - status_led="$board:green:usb" + status_led="$boardname:green:usb" ;; u25awf-h1) status_led="u25awf:red:wifi" @@ -250,43 +252,46 @@ get_status_led() { status_led="u7628-01:green:power" ;; v22rw-2x2) - status_led="$board:green:security" + status_led="$boardname:green:security" ;; vocore-8M|\ vocore-16M) status_led="vocore:green:status" ;; vocore2) - status_led="$board:fuchsia:status" + status_led="$boardname:fuchsia:status" ;; vocore2lite) - status_led="$board:green:status" + status_led="$boardname:green:status" ;; w306r-v20|\ witi|\ zbt-wr8305rt) - status_led="$board:green:sys" + status_led="$boardname:green:sys" ;; wcr-1166ds|\ whr-300hp2|\ wsr-1166|\ wsr-600) - status_led="$board:green:power" + status_led="$boardname:green:power" ;; wcr-150gn|\ wl-351) - status_led="$board:amber:power" + status_led="$boardname:amber:power" ;; whr-g300n|\ wlr-6000|\ zbt-we2026) - status_led="$board:red:power" + status_led="$boardname:red:power" + ;; + widora-neo) + status_led="widora:orange:wifi" ;; wzr-agl300nh) - status_led="$board:green:router" + status_led="$boardname:green:router" ;; wizfi630a) - status_led="$board::run" + status_led="$boardname::run" ;; wr512-3gn-4M|\ wr512-3gn-8M) @@ -302,7 +307,7 @@ get_status_led() { status_led="wt3020:blue:power" ;; zbt-cpe102) - status_led="$board:green:4g-0" + status_led="$boardname:green:4g-0" ;; zbt-we826-16M|\ zbt-we826-32M) diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index 76ca3d130..e85b29361 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -3,9 +3,6 @@ # Copyright (C) 2010-2013 OpenWrt.org # -RAMIPS_BOARD_NAME= -RAMIPS_MODEL= - ramips_board_detect() { local machine local name @@ -278,13 +275,7 @@ ramips_board_detect() { name="m4-8M" ;; *"MediaTek LinkIt Smart 7688") - linkit="$(dd bs=1 skip=1024 count=12 if=/dev/mtd2 2> /dev/null)" - if [ "${linkit}" = "LINKITS7688D" ]; then - name="linkits7688d" - RAMIPS_MODEL="${machine} DUO" - else - name="linkits7688" - fi + name="linkits7688" ;; *"Memory 2 Move") name="m2m" @@ -460,6 +451,9 @@ ramips_board_detect() { *"RT-N10+") name="rt-n10-plus" ;; + *"RT-N12+") + name="rt-n12p" + ;; *"RT-N13U") name="rt-n13u" ;; @@ -736,18 +730,13 @@ ramips_board_detect() { *"YK1") name="youku-yk1" ;; - *) - name="$(strings /proc/device-tree/compatible | head -1)" - name="${name##*,}" - name="${name:-generic}" - ;; esac - [ -z "$RAMIPS_BOARD_NAME" ] && RAMIPS_BOARD_NAME="$name" - [ -z "$RAMIPS_MODEL" ] && RAMIPS_MODEL="$machine" + # use generic board detect if no name is set + [ -z "$name" ] && return [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - echo "$RAMIPS_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$RAMIPS_MODEL" > /tmp/sysinfo/model + echo "$name" > /tmp/sysinfo/board_name + echo "$machine" > /tmp/sysinfo/model } diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 0d5b6bb4f..8160f5d38 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -81,7 +81,6 @@ platform_check_image() { kn_rf|\ kng_rc|\ linkits7688|\ - linkits7688d|\ m2m|\ m3|\ m4-4M|\ @@ -108,6 +107,7 @@ platform_check_image() { nbg-419n|\ nbg-419n2|\ newifi-d1|\ + d-team,newifi-d2|\ nixcore-x1-8M|\ nixcore-x1-16M|\ nw718|\ @@ -130,6 +130,7 @@ platform_check_image() { rt-ac51u|\ rt-g32-b1|\ rt-n10-plus|\ + rt-n12p|\ rt-n13u|\ rt-n14u|\ rt-n15|\ @@ -150,6 +151,7 @@ platform_check_image() { ur-326n4g|\ ur-336un|\ v22rw-2x2|\ + vonets,var11n-300|\ vocore-8M|\ vocore-16M|\ vocore2|\ @@ -202,7 +204,7 @@ platform_check_image() { zbt-wa05|\ zbt-we1326|\ zbt-we2026|\ - zbt-we3526|\ + zbtlink,zbt-we3526|\ zbt-we826-16M|\ zbt-we826-32M|\ zbt-wg2626|\ @@ -238,6 +240,7 @@ platform_check_image() { c20i|\ c50|\ mr200|\ + tplink,tl-mr3420-v5|\ tl-wr840n-v4|\ tl-wr840n-v5|\ tl-wr841n-v13) diff --git a/target/linux/ramips/dts/ArcherMR200.dts b/target/linux/ramips/dts/ArcherMR200.dts index 2736a05b3..ec28d3967 100644 --- a/target/linux/ramips/dts/ArcherMR200.dts +++ b/target/linux/ramips/dts/ArcherMR200.dts @@ -92,7 +92,7 @@ power_usb { gpio-export,name = "power_usb1"; gpio-export,output = <1>; - gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ramips/dts/BR-6475ND.dts b/target/linux/ramips/dts/BR-6475ND.dts index 4e52da04b..11611b083 100644 --- a/target/linux/ramips/dts/BR-6475ND.dts +++ b/target/linux/ramips/dts/BR-6475ND.dts @@ -103,7 +103,7 @@ usb { gpio-export,name="usb"; gpio-export,output=<0>; - gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 19 GPIO_ACTIVE_LOW>; }; }; */ diff --git a/target/linux/ramips/dts/DWR-512-B.dts b/target/linux/ramips/dts/DWR-512-B.dts index f531df80a..afcac21c6 100644 --- a/target/linux/ramips/dts/DWR-512-B.dts +++ b/target/linux/ramips/dts/DWR-512-B.dts @@ -68,7 +68,7 @@ modem3g_enable { gpio-export,name = "modem3g_enable"; gpio-export,output = <1>; - gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/GL-MT300N-V2.dts b/target/linux/ramips/dts/GL-MT300N-V2.dts index e7df340ee..8db3d4bc9 100644 --- a/target/linux/ramips/dts/GL-MT300N-V2.dts +++ b/target/linux/ramips/dts/GL-MT300N-V2.dts @@ -64,7 +64,7 @@ usb { gpio-export,name = "usb"; gpio-export,output = <1>; - gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; }; }; diff --git a/target/linux/ramips/dts/HC5861.dts b/target/linux/ramips/dts/HC5861.dts index d4f34b32d..8773588e3 100644 --- a/target/linux/ramips/dts/HC5861.dts +++ b/target/linux/ramips/dts/HC5861.dts @@ -42,13 +42,13 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <0>; - gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; }; sdpower { gpio-export,name = "sdpower"; gpio-export,output = <0>; - gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 8 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/JHR-N926R.dts b/target/linux/ramips/dts/JHR-N926R.dts index 93310e128..d1d2627f2 100644 --- a/target/linux/ramips/dts/JHR-N926R.dts +++ b/target/linux/ramips/dts/JHR-N926R.dts @@ -72,7 +72,7 @@ display_data { gpio-export,name = "display_data"; gpio-export,output = <1>; - gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; }; display_clock { diff --git a/target/linux/ramips/dts/LINKIT7688.dts b/target/linux/ramips/dts/LINKIT7688.dts index f21ffcca6..a81a2d5a4 100644 --- a/target/linux/ramips/dts/LINKIT7688.dts +++ b/target/linux/ramips/dts/LINKIT7688.dts @@ -6,7 +6,7 @@ #include / { - compatible = "mediatek,linkit", "mediatek,mt7628an-soc"; + compatible = "mediatek,linkit-smart-7688", "mediatek,mt7628an-soc"; model = "MediaTek LinkIt Smart 7688"; chosen { @@ -32,9 +32,8 @@ compatible = "gpio-leds"; wifi { - label = "mediatek:orange:wifi"; - gpios = <&wgpio 0 GPIO_ACTIVE_HIGH>; - default-state = "on"; + label = "linkit-smart-7688:orange:wifi"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; }; }; @@ -50,14 +49,6 @@ linux,code = ; }; }; - - wgpio: gpio-wifi { - compatible = "mediatek,gpio-wifi"; - #address-cells = <1>; - #size-cells = <0>; - gpio-controller; - #gpio-cells = <2>; - }; }; &pinctrl { @@ -67,11 +58,6 @@ ralink,function = "gpio"; }; - perst { - ralink,group = "perst"; - ralink,function = "gpio"; - }; - refclk { ralink,group = "refclk"; ralink,function = "gpio"; @@ -87,14 +73,9 @@ ralink,function = "gpio"; }; - wled_kn { - ralink,group = "wled_kn"; - ralink,function = "gpio"; - }; - wled_an { ralink,group = "wled_an"; - ralink,function = "wled_an"; + ralink,function = "gpio"; }; wdt { diff --git a/target/linux/ramips/dts/Newifi-D2.dts b/target/linux/ramips/dts/Newifi-D2.dts new file mode 100644 index 000000000..e919338e4 --- /dev/null +++ b/target/linux/ramips/dts/Newifi-D2.dts @@ -0,0 +1,159 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "d-team,newifi-d2", "mediatek,mt7621-soc"; + model = "Newifi-D2"; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x1c000000>, <0x20000000 0x4000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + power-amber { + label = "newifi-d2:amber:power"; + gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; + }; + + power-blue { + label = "newifi-d2:blue:power"; + gpios = <&gpio0 15 GPIO_ACTIVE_LOW>; + }; + + internet-amber { + label = "newifi-d2:amber:internet"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + internet-blue { + label = "newifi-d2:blue:internet"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "newifi-d2:blue:wlan2g"; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + }; + + wlan5g { + label = "newifi-d2:blue:wlan5g"; + gpios = <&gpio0 16 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "newifi-d2:blue:usb"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio0 7 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + power_usb3 { + gpio-export,name = "power_usb3"; + gpio-export,output = <1>; + gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + m25p,chunked-io = <32>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x1fb0000>; + }; + }; +}; + +&pcie { + status = "okay"; + + pcie0 { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; + }; + + pcie1 { + mt76@1,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0xe000>; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "jtag", "uart2", "uart3"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/OMEGA2.dts b/target/linux/ramips/dts/OMEGA2.dts index f419dc9c7..25cc818d5 100644 --- a/target/linux/ramips/dts/OMEGA2.dts +++ b/target/linux/ramips/dts/OMEGA2.dts @@ -3,6 +3,7 @@ #include "OMEGA2.dtsi" / { + compatible = "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2"; memory@0 { diff --git a/target/linux/ramips/dts/OMEGA2.dtsi b/target/linux/ramips/dts/OMEGA2.dtsi index 132df58ac..73a690879 100644 --- a/target/linux/ramips/dts/OMEGA2.dtsi +++ b/target/linux/ramips/dts/OMEGA2.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "onion,omega", "mediatek,mt7628an-soc"; + compatible = "onion,omega2", "mediatek,mt7628an-soc"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/ramips/dts/OMEGA2P.dts b/target/linux/ramips/dts/OMEGA2P.dts index a49d94c08..53e837729 100644 --- a/target/linux/ramips/dts/OMEGA2P.dts +++ b/target/linux/ramips/dts/OMEGA2P.dts @@ -3,6 +3,7 @@ #include "OMEGA2.dtsi" / { + compatible = "onion,omega2p", "onion,omega2", "mediatek,mt7628an-soc"; model = "Onion Omega2+"; memory@0 { diff --git a/target/linux/ramips/dts/PBR-D1.dts b/target/linux/ramips/dts/PBR-D1.dts index a982eebbe..78a36577c 100644 --- a/target/linux/ramips/dts/PBR-D1.dts +++ b/target/linux/ramips/dts/PBR-D1.dts @@ -6,7 +6,7 @@ #include / { - compatible = "pandorabox,pbr-d1", "mediatek,mt7628an-soc"; + compatible = "d-team,pbr-d1", "mediatek,mt7628an-soc"; model = "PBR-D1"; chosen { diff --git a/target/linux/ramips/dts/PBR-M1.dts b/target/linux/ramips/dts/PBR-M1.dts index f5d5f29a7..66a71a91a 100644 --- a/target/linux/ramips/dts/PBR-M1.dts +++ b/target/linux/ramips/dts/PBR-M1.dts @@ -6,7 +6,7 @@ #include / { - compatible = "pandorabox,pbr-m1", "mediatek,mt7621-soc"; + compatible = "d-team,pbr-m1", "mediatek,mt7621-soc"; model = "PBR-M1"; memory@0 { diff --git a/target/linux/ramips/dts/R6220.dts b/target/linux/ramips/dts/R6220.dts index 2bbb0db3b..7d886725e 100644 --- a/target/linux/ramips/dts/R6220.dts +++ b/target/linux/ramips/dts/R6220.dts @@ -79,7 +79,7 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <1>; - gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/RT-N12-PLUS.dts b/target/linux/ramips/dts/RT-N12-PLUS.dts new file mode 100644 index 000000000..f3e0284ae --- /dev/null +++ b/target/linux/ramips/dts/RT-N12-PLUS.dts @@ -0,0 +1,117 @@ +/dts-v1/; + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "asus,rt-n12p", "ralink,mt7620n-soc"; + model = "Asus RT-N12+"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wan { + label = "rt-n12p:green:wan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + lan { + label = "rt-n12p:green:lan"; + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>; + }; + + power { + label = "rt-n12p:green:power"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + air { + label = "rt-n12p:green:air"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "wllll"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "ephy", "wled", "i2c", "wdt", "pa", "spi refclk"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/TL-MR3420V5.dts b/target/linux/ramips/dts/TL-MR3420V5.dts new file mode 100644 index 000000000..fdb09dcd6 --- /dev/null +++ b/target/linux/ramips/dts/TL-MR3420V5.dts @@ -0,0 +1,86 @@ +/dts-v1/; + +#include "TL-WR84XN.dtsi" + +#include +#include + +/ { + compatible = "tplink,tl-mr3420-v5", "mediatek,mt7628an-soc"; + model = "TP-Link TL-MR3420 v5"; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio1 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + rfkill { + label = "rfkill"; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + lan { + label = "tl-mr3420-v5:green:lan"; + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; + }; + + power { + label = "tl-mr3420-v5:green:power"; + gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "tl-mr3420-v5:green:usb"; + gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "tl-mr3420-v5:green:wan"; + gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + }; + + wan_amber { + label = "tl-mr3420-v5:amber:wan"; + gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "tl-mr3420-v5:green:wlan"; + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "tl-mr3420-v5:green:wps"; + gpios = <&gpio1 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "i2c", "i2s", "p2led_an", "refclk", "uart1", "wdt", "wled_an"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/VAR11N-300.dts b/target/linux/ramips/dts/VAR11N-300.dts new file mode 100644 index 000000000..54bcb3df0 --- /dev/null +++ b/target/linux/ramips/dts/VAR11N-300.dts @@ -0,0 +1,90 @@ +/dts-v1/; + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "vonets,var11n-300", "ralink,mt7620n-soc"; + model = "Vonets VAR11N-300"; + + gpio-leds { + compatible = "gpio-leds"; + + system { + label = "var11n-300:blue:system"; + gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>; + }; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio0 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0x3b0000>; + }; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x4>; + mediatek,portmap = "llllw"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; + +&pinctrl { + state_default: pinctrl0 { + default { + ralink,group = "i2c"; + ralink,function = "gpio"; + }; + }; +}; diff --git a/target/linux/ramips/dts/WIZFI630A.dts b/target/linux/ramips/dts/WIZFI630A.dts index 86ed19730..d12753650 100644 --- a/target/linux/ramips/dts/WIZFI630A.dts +++ b/target/linux/ramips/dts/WIZFI630A.dts @@ -13,11 +13,6 @@ bootargs = "console=ttyS1,115200"; }; - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - }; - gpio-leds { compatible = "gpio-leds"; diff --git a/target/linux/ramips/dts/WNDR3700V5.dts b/target/linux/ramips/dts/WNDR3700V5.dts index c7800115d..ce9644036 100644 --- a/target/linux/ramips/dts/WNDR3700V5.dts +++ b/target/linux/ramips/dts/WNDR3700V5.dts @@ -64,7 +64,7 @@ usbpower { gpio-export,name = "usbpower"; gpio-export,output = <1>; - gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; }; }; }; diff --git a/target/linux/ramips/dts/WR6202.dts b/target/linux/ramips/dts/WR6202.dts index 3cc1b23ef..2f3981804 100644 --- a/target/linux/ramips/dts/WR6202.dts +++ b/target/linux/ramips/dts/WR6202.dts @@ -85,7 +85,7 @@ usb { gpio-export,name = "usb"; gpio-export,output = <0>; - gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/WT1520.dtsi b/target/linux/ramips/dts/WT1520.dtsi index 1031e2274..95886d7e2 100644 --- a/target/linux/ramips/dts/WT1520.dtsi +++ b/target/linux/ramips/dts/WT1520.dtsi @@ -1,5 +1,8 @@ #include "rt5350.dtsi" +#include +#include + / { compatible = "nexx,wt1520", "ralink,rt5350-soc"; @@ -8,21 +11,24 @@ reg = <0x0 0x2000000>; }; - chosen { - bootargs = "console=ttyS1,57600"; - }; -}; + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; -&uart { - pinctrl-names = "default"; - pinctrl-0 = <&uartf_pins>; - status = "okay"; + reset { + label = "reset"; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; }; &pinctrl { state_default: pinctrl0 { gpio { - ralink,group = "jtag"; + ralink,group = "jtag", "uartf"; ralink,function = "gpio"; }; }; diff --git a/target/linux/ramips/dts/X5.dts b/target/linux/ramips/dts/X5.dts index 8911fa80e..20c4237eb 100644 --- a/target/linux/ramips/dts/X5.dts +++ b/target/linux/ramips/dts/X5.dts @@ -66,7 +66,7 @@ usb-mode { gpio-export,name = "usb-mode"; gpio-export,output = <0>; - gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>; + gpios = <&gpio0 18 GPIO_ACTIVE_LOW>; }; }; }; diff --git a/target/linux/ramips/dts/Y1.dts b/target/linux/ramips/dts/Y1.dts index 15b3b3b81..8aed5c120 100644 --- a/target/linux/ramips/dts/Y1.dts +++ b/target/linux/ramips/dts/Y1.dts @@ -3,7 +3,7 @@ #include "Y1.dtsi" / { - compatible = "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1", "ralink,mt7620a-soc"; model = "Lenovo Y1"; gpio-leds { diff --git a/target/linux/ramips/dts/Y1.dtsi b/target/linux/ramips/dts/Y1.dtsi index cc126f04a..0db064576 100644 --- a/target/linux/ramips/dts/Y1.dtsi +++ b/target/linux/ramips/dts/Y1.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1", "ralink,mt7620a-soc"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/ramips/dts/Y1S.dts b/target/linux/ramips/dts/Y1S.dts index 07719c25e..74f7ca93c 100644 --- a/target/linux/ramips/dts/Y1S.dts +++ b/target/linux/ramips/dts/Y1S.dts @@ -3,7 +3,7 @@ #include "Y1.dtsi" / { - compatible = "lenovo,y1s", "lenovo,y1", "ralink,mt7620a-soc"; + compatible = "lenovo,newifi-y1s", "lenovo,newifi-y1", "ralink,mt7620a-soc"; model = "Lenovo Y1S"; gpio_export { diff --git a/target/linux/ramips/image/Makefile b/target/linux/ramips/image/Makefile index c70761b25..ea7ce0bc9 100644 --- a/target/linux/ramips/image/Makefile +++ b/target/linux/ramips/image/Makefile @@ -39,7 +39,7 @@ define Device/Default DEVICE_DTS_DIR := ../dts IMAGES := sysupgrade.bin IMAGE_SIZE := $(ralink_default_fw_size_8M) - SUPPORTED_DEVICES = $(1) + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) sysupgrade_bin := append-kernel | append-rootfs | pad-rootfs IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 7dd26fe27..902677f3a 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -252,6 +252,7 @@ define Device/kng_rc IMAGES += factory.bin IMAGE/factory.bin := $$(sysupgrade_bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 8997 -v "ZyXEL Keenetic Viva" + SUPPORTED_DEVICES := kng_rc endef TARGET_DEVICES += kng_rc @@ -262,6 +263,7 @@ define Device/kn_rc IMAGES += factory.bin IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 4882 -v "ZyXEL Keenetic Omni" + SUPPORTED_DEVICES := kn_rc endef TARGET_DEVICES += kn_rc @@ -272,6 +274,7 @@ define Device/kn_rf IMAGES += factory.bin IMAGE/factory.bin := $$(IMAGE/sysupgrade.bin) | pad-to 64k | check-size $$$$(IMAGE_SIZE) | \ zyimage -d 2102034 -v "ZyXEL Keenetic Omni II" + SUPPORTED_DEVICES := kn_rf endef TARGET_DEVICES += kn_rf @@ -313,18 +316,21 @@ TARGET_DEVICES += mt7620a define Device/mt7620a_mt7530 DTS := MT7620a_MT7530 DEVICE_TITLE := MediaTek MT7620a + MT7530 EVB + SUPPORTED_DEVICES := mt7620a_mt7530 endef TARGET_DEVICES += mt7620a_mt7530 define Device/mt7620a_mt7610e DTS := MT7620a_MT7610e DEVICE_TITLE := MediaTek MT7620a + MT7610e EVB + SUPPORTED_DEVICES := mt7620a_mt7610e endef TARGET_DEVICES += mt7620a_mt7610e define Device/mt7620a_v22sg DTS := MT7620a_V22SG DEVICE_TITLE := MediaTek MT7620a V22SG + SUPPORTED_DEVICES := mt7620a_v22sg endef TARGET_DEVICES += mt7620a_v22sg @@ -391,6 +397,12 @@ define Device/rp-n53 endef TARGET_DEVICES += rp-n53 +define Device/rt-n12p + DTS := RT-N12-PLUS + DEVICE_TITLE := Asus RT-N11P/RT-N12+/RT-N12Eb1 +endef +TARGET_DEVICES += rt-n12p + define Device/rt-n14u DTS := RT-N14U DEVICE_TITLE := Asus RT-N14u @@ -412,6 +424,14 @@ define Device/tiny-ac endef TARGET_DEVICES += tiny-ac +define Device/vonets_var11n-300 + DTS := VAR11N-300 + IMAGE_SIZE := $(ralink_default_fw_size_4M) + BLOCKSIZE := 4k + DEVICE_TITLE := Vonets VAR11N-300 +endef +TARGET_DEVICES += vonets_var11n-300 + define Device/whr-1166d DTS := WHR-1166D IMAGE_SIZE := 15040k diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 82d0eeae6..8ba65a1af 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -142,6 +142,15 @@ define Device/newifi-d1 endef TARGET_DEVICES += newifi-d1 +define Device/d-team_newifi-d2 + DTS := Newifi-D2 + IMAGE_SIZE := $(ralink_default_fw_size_32M) + DEVICE_TITLE := Newifi D2 + DEVICE_PACKAGES := \ + kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += d-team_newifi-d2 + define Device/pbr-m1 DTS := PBR-M1 IMAGE_SIZE := $(ralink_default_fw_size_16M) @@ -329,16 +338,15 @@ define Device/zbt-we1326 endef TARGET_DEVICES += zbt-we1326 -define Device/zbt-we3526 +define Device/zbtlink_zbt-we3526 DTS := ZBT-WE3526 IMAGE_SIZE := $(ralink_default_fw_size_16M) - SUPPORTED_DEVICES += zbt-we3526 DEVICE_TITLE := ZBT WE3526 DEVICE_PACKAGES := \ kmod-sdhci-mt7620 kmod-mt7603 kmod-mt76x2 \ kmod-usb3 kmod-usb-ledtrig-usbport wpad-mini endef -TARGET_DEVICES += zbt-we3526 +TARGET_DEVICES += zbtlink_zbt-we3526 define Device/zbt-wg2626 DTS := ZBT-WG2626 diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk index 0e9b8fc7e..8bbbcf6ad 100644 --- a/target/linux/ramips/image/mt76x8.mk +++ b/target/linux/ramips/image/mt76x8.mk @@ -2,8 +2,23 @@ # MT76x8 Profiles # +define Device/tplink + TPLINK_FLASHLAYOUT := + TPLINK_HWID := + TPLINK_HWREV := + TPLINK_HWREVADD := + TPLINK_HVERSION := + KERNEL := $(KERNEL_DTB) + KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e + IMAGES += tftp-recovery.bin + IMAGE/factory.bin := tplink-v2-image -e + IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) + IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ + check-size $$$$(IMAGE_SIZE) +endef DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION + define Device/duzun-dm06 DTS := DUZUN-DM06 DEVICE_TITLE := DuZun DM06 @@ -64,6 +79,7 @@ define Device/omega2 DEVICE_TITLE := Onion Omega2 DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools endef +TARGET_DEVICES += omega2 define Device/omega2p DTS := OMEGA2P @@ -71,7 +87,7 @@ define Device/omega2p DEVICE_TITLE := Onion Omega2+ DEVICE_PACKAGES:= kmod-usb2 kmod-usb-ohci uboot-envtools kmod-sdhci-mt7620 endef -TARGET_DEVICES += omega2 omega2p +TARGET_DEVICES += omega2p define Device/pbr-d1 DTS := PBR-D1 @@ -82,6 +98,7 @@ endef TARGET_DEVICES += pbr-d1 define Device/tl-wr840n-v4 + $(Device/tplink) DTS := TL-WR840NV4 IMAGE_SIZE := 7808k DEVICE_TITLE := TP-Link TL-WR840N v4 @@ -90,14 +107,8 @@ define Device/tl-wr840n-v4 TPLINK_HWREV := 0x1 TPLINK_HWREVADD := 0x4 TPLINK_HVERSION := 3 - KERNEL := $(KERNEL_DTB) - KERNEL_INITRAMFS := $(KERNEL_DTB) | tplink-v2-header -e - IMAGES += tftp-recovery.bin - IMAGE/factory.bin := tplink-v2-image -e - IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin) - IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ - check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += tl-wr840n-v4 define Device/tl-wr840n-v5 DTS := TL-WR840NV5 @@ -113,16 +124,34 @@ define Device/tl-wr840n-v5 IMAGE/sysupgrade.bin := tplink-v2-image -s -e | append-metadata | \ check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += tl-wr840n-v5 define Device/tl-wr841n-v13 - $(Device/tl-wr840n-v4) + $(Device/tplink) DTS := TL-WR841NV13 + IMAGE_SIZE := 7808k DEVICE_TITLE := TP-Link TL-WR841N v13 + TPLINK_FLASHLAYOUT := 8Mmtk TPLINK_HWID := 0x08410013 TPLINK_HWREV := 0x268 TPLINK_HWREVADD := 0x13 + TPLINK_HVERSION := 3 endef -TARGET_DEVICES += tl-wr840n-v4 tl-wr840n-v5 tl-wr841n-v13 +TARGET_DEVICES += tl-wr841n-v13 + +define Device/tplink_tl-mr3420-v5 + $(Device/tplink) + DTS := TL-MR3420V5 + IMAGE_SIZE := 7808k + DEVICE_TITLE := TP-Link TL-MR3420 v5 + TPLINK_FLASHLAYOUT := 8Mmtk + TPLINK_HWID := 0x34200005 + TPLINK_HWREV := 0x5 + TPLINK_HWREVADD := 0x5 + TPLINK_HVERSION := 3 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport +endef +TARGET_DEVICES += tplink_tl-mr3420-v5 define Device/u7628-01-128M-16M DTS := U7628-01-128M-16M @@ -139,6 +168,7 @@ define Device/vocore2 DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 endef +TARGET_DEVICES += vocore2 define Device/vocore2lite DTS := VOCORE2LITE @@ -147,7 +177,7 @@ define Device/vocore2lite DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \ kmod-sdhci-mt7620 endef -TARGET_DEVICES += vocore2 vocore2lite +TARGET_DEVICES += vocore2lite define Device/wcr-1166ds DTS := WCR-1166DS @@ -186,6 +216,7 @@ define Device/wrtnode2p DEVICE_TITLE := WRTnode 2P DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport endef +TARGET_DEVICES += wrtnode2p define Device/wrtnode2r DTS := WRTNODE2R @@ -193,4 +224,4 @@ define Device/wrtnode2r DEVICE_TITLE := WRTnode 2R DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci endef -TARGET_DEVICES += wrtnode2p wrtnode2r +TARGET_DEVICES += wrtnode2r From cc356177d42a0b2daf76a1817d763f880df46007 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 8 Jan 2018 18:15:11 +0800 Subject: [PATCH 55/95] add udp2raw and luci-app-udp2raw --- package/lean/luci-app-udp2raw/LICENSE | 622 ++++++++++++++++++ package/lean/luci-app-udp2raw/Makefile | 76 +++ .../files/luci/controller/udp2raw.lua | 30 + .../files/luci/i18n/udp2raw.zh-cn.lmo | Bin 0 -> 1364 bytes .../files/luci/i18n/udp2raw.zh-cn.po | 120 ++++ .../files/luci/model/cbi/udp2raw/general.lua | 38 ++ .../model/cbi/udp2raw/servers-details.lua | 96 +++ .../files/luci/model/cbi/udp2raw/servers.lua | 56 ++ .../files/luci/view/udp2raw_status.htm | 39 ++ .../files/root/etc/config/udp2raw | 16 + .../files/root/etc/init.d/udp2raw | 121 ++++ .../files/root/etc/uci-defaults/luci-udp2raw | 25 + .../luci-app-udp2raw/tools/po2lmo/Makefile | 12 + .../tools/po2lmo/src/po2lmo.c | 247 +++++++ .../tools/po2lmo/src/template_lmo.c | 328 +++++++++ .../tools/po2lmo/src/template_lmo.h | 92 +++ package/lean/udp2raw/LICENSE | 21 + package/lean/udp2raw/Makefile | 56 ++ target/linux/x86/config-4.9 | 21 +- 19 files changed, 2005 insertions(+), 11 deletions(-) create mode 100644 package/lean/luci-app-udp2raw/LICENSE create mode 100644 package/lean/luci-app-udp2raw/Makefile create mode 100644 package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua create mode 100644 package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo create mode 100644 package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po create mode 100644 package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua create mode 100644 package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua create mode 100644 package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua create mode 100644 package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm create mode 100644 package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw create mode 100755 package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw create mode 100755 package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw create mode 100644 package/lean/luci-app-udp2raw/tools/po2lmo/Makefile create mode 100644 package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c create mode 100644 package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c create mode 100644 package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h create mode 100644 package/lean/udp2raw/LICENSE create mode 100644 package/lean/udp2raw/Makefile diff --git a/package/lean/luci-app-udp2raw/LICENSE b/package/lean/luci-app-udp2raw/LICENSE new file mode 100644 index 000000000..e963df829 --- /dev/null +++ b/package/lean/luci-app-udp2raw/LICENSE @@ -0,0 +1,622 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + diff --git a/package/lean/luci-app-udp2raw/Makefile b/package/lean/luci-app-udp2raw/Makefile new file mode 100644 index 000000000..8ce589eed --- /dev/null +++ b/package/lean/luci-app-udp2raw/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (C) 2016-2017 Jian Chang +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-udp2raw +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jian Chang + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-udp2raw + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI Support for udp2raw-tunnel + PKGARCH:=all + DEPENDS:=+udp2raw-tunnel +endef + +define Package/luci-app-udp2raw/description + LuCI Support for udp2raw-tunnel. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-udp2raw/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + ( . /etc/uci-defaults/luci-udp2raw ) && rm -f /etc/uci-defaults/luci-udp2raw + rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +fi +exit 0 +endef + +define Package/luci-app-udp2raw/conffiles +/etc/config/udp2raw +endef + +define Package/luci-app-udp2raw/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/udp2raw.*.lmo $(1)/usr/lib/lua/luci/i18n/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/udp2raw + $(INSTALL_DATA) ./files/luci/model/cbi/udp2raw/*.lua $(1)/usr/lib/lua/luci/model/cbi/udp2raw/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view + $(INSTALL_DATA) ./files/luci/view/*.htm $(1)/usr/lib/lua/luci/view/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/root/etc/config/udp2raw $(1)/etc/config/udp2raw + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/root/etc/init.d/udp2raw $(1)/etc/init.d/udp2raw + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-udp2raw $(1)/etc/uci-defaults/luci-udp2raw +endef + +$(eval $(call BuildPackage,luci-app-udp2raw)) diff --git a/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua b/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua new file mode 100644 index 000000000..81d1f0135 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/controller/udp2raw.lua @@ -0,0 +1,30 @@ +module("luci.controller.udp2raw", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/udp2raw") then + return + end + + entry({"admin", "services", "udp2raw"}, + firstchild(), _("udp2raw-tunnel")).dependent = false + + entry({"admin", "services", "udp2raw", "general"}, + cbi("udp2raw/general"), _("Settings"), 1) + + entry({"admin", "services", "udp2raw", "servers"}, + arcombine(cbi("udp2raw/servers"), cbi("udp2raw/servers-details")), + _("Servers Manage"), 2).leaf = true + + entry({"admin", "services", "udp2raw", "status"}, call("action_status")) +end + +local function is_running(name) + return luci.sys.call("pidof %s >/dev/null" %{name}) == 0 +end + +function action_status() + luci.http.prepare_content("application/json") + luci.http.write_json({ + running = is_running("udp2raw") + }) +end diff --git a/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.lmo new file mode 100644 index 0000000000000000000000000000000000000000..e25325de0821449545710424e3005f4229cfaf7e GIT binary patch literal 1364 zcma)5eN06Le%Z_H0jAHj=DMCXe44a*xe&DFb`>h{Y;32q8!j`mZ7R$M?D!QHteBa=bm z^pI$Wa8k=|yvs;!0nu{NVSn9TIrR)C^5N!Up(FA)s~hW@Ycz7+(Jp7(WatD!h!GPr zVJhFUy)4mpqKEf-V<7_>KTJ%PI3Bh&K#e|P=(rv+P*()T*CP%^U2}bIW^S%3FHe=9 zuPP`|6&9-2uU9aQ&L&q>A86jANO;qbxlGNTDS{svAnu+;KfDhl5+b@FHFOc5BOy$* zaDe|^_y6h>#h4uncicJiju+H9J4@Af{OltnYUe|4yadT_TQeTu#xoHq10|C#NPc*X z`nCh>P^oFZmNca_zT5$d33d%@EmA~TNS$}1;<%TXDRtCF?BZ(b}0 zZbeCzCY>apSeFESF8J~%RNvLonEldjrQ*3F;QLW2RTp|U@5)vhfCG%z*vO>CnY93YDY&$$<*&5x-d}jkk1@VawQQ5( z$zIHt)Pt|lm*2SW)CwQV5<$sKNA<%8zkb+?ePrfR`mFhm`JYNZK)(z8c?Yc>)fD$( zo7pT@7=SJF6<|Rzc#tqJ9o&j`g7nywjZ8tI9D)Eeun->@a12Y_N+RZ)xyrt z&X<1nt(U&?Zd6a9pXE_rC|WhVXMSZXFuSjmxyzrbYjS4a2VRSkUcSAsF?4bFP57A^ zr+){MgmULL;4`RY!llM~<&}sA`@7hFd{af>{Cmesz#j!qkK6T+)D7OA2NqCizg?T? pes#KG4!9PTdh?IA-q-7gwjxgz_&v9b2TLm3)3bs9M9Hvz<6pM!bj|<( literal 0 HcmV?d00001 diff --git a/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po new file mode 100644 index 000000000..fb20472f1 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/i18n/udp2raw.zh-cn.po @@ -0,0 +1,120 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "udp2raw-tunnel" +msgstr "udp2raw 隧é“" + +msgid "Settings" +msgstr "设置" + +msgid "Servers Manage" +msgstr "æœåŠ¡å™¨ç®¡ç†" + +msgid "Running Status" +msgstr "è¿è¡ŒçŠ¶æ€" + +msgid "Binary Version" +msgstr "文件版本" + +msgid "Build Time" +msgstr "编译时间" + +msgid "Invalid Binary File." +msgstr "å¯æ‰§è¡Œæ–‡ä»¶æ— æ•ˆã€‚" + +msgid "RUNNING" +msgstr "è¿è¡Œä¸­" + +msgid "NOT RUNNING" +msgstr "未è¿è¡Œ" + +msgid "General Settings" +msgstr "基本设置" + +msgid "Server" +msgstr "æœåŠ¡å™¨" + +msgid "Disable" +msgstr "åœç”¨" + +msgid "Run Daemon as User" +msgstr "以该用户å¯åŠ¨" + +msgid "Alias" +msgstr "别å" + +msgid "None" +msgstr "æ— " + +msgid "Server Address" +msgstr "æœåŠ¡å™¨åœ°å€" + +msgid "Listen Address" +msgstr "监å¬åœ°å€" + +msgid "Edit Server" +msgstr "编辑æœåŠ¡å™¨" + +msgid "Alias(optional)" +msgstr "别å(å¯é€‰)" + +msgid "Server Port" +msgstr "æœåŠ¡å™¨ç«¯å£" + +msgid "Local Listen Host" +msgstr "本地监å¬åœ°å€" + +msgid "Local Listen Port" +msgstr "本地监å¬ç«¯å£" + +msgid "Raw Mode" +msgstr "Raw æ–¹å¼" + +msgid "Password" +msgstr "密ç " + +msgid "Cipher Mode" +msgstr "加密方å¼" + +msgid "Auth Mode" +msgstr "认è¯æ–¹å¼" + +msgid "Auto Rule" +msgstr "自动规则" + +msgid "Auto add (and delete) iptables rule." +msgstr "自动添加/删除 iptables 规则。" + +msgid "Keep Rule" +msgstr "ä¿æŒè§„则" + +msgid "Monitor iptables and auto re-add if necessary." +msgstr "监视 iptables 并在必è¦æ—¶é‡æ–°æ·»åŠ è§„则。" + +msgid "seq Mode" +msgstr "seq 模å¼" + +msgid "seq increase mode for faketcp." +msgstr "用于 faketcp çš„ seq 增加方å¼ã€‚" + +msgid "Lower Level" +msgstr "" + +msgid "Send packets at OSI level 2, format: \"eth0#00:11:22:33:44:55\", or \"auto\"." +msgstr "在 OSI 模型第二层å‘é€æ•°æ®åŒ…,格å¼ï¼š\"eth0#00:11:22:33:44:55\",或 \"auto\"。" + +msgid "Source-IP" +msgstr "æºIP" + +msgid "Force source-ip for Raw Socket." +msgstr "在原始数æ®åŒ…中强制指定æºIP。" + +msgid "Source-Port" +msgstr "æºç«¯å£" + +msgid "Force source-port for Raw Socket, TCP/UDP only." +msgstr "在原始数æ®åŒ…中强制指定æºç«¯å£ï¼Œä»…用于 TCP/UDP。" + +msgid "Log Level" +msgstr "日志级别" + diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua new file mode 100644 index 000000000..a4d343091 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/general.lua @@ -0,0 +1,38 @@ +local m, s, o +local uci = luci.model.uci.cursor() +local servers = {} + +local function has_bin(name) + return luci.sys.call("command -v %s >/dev/null" %{name}) == 0 +end + +if not has_bin("udp2raw") then + return Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), + translate("Settings")}, 'udp2raw-tunnel binary file not found.') +end + +uci:foreach("udp2raw", "servers", function(s) + if s.server_addr and s.server_port then + servers[#servers+1] = {name = s[".name"], alias = s.alias or "%s:%s" %{s.server_addr, s.server_port}} + end +end) + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Settings")}) +m:append(Template("udp2raw_status")) + +s = m:section(NamedSection, "general", "general", translate("General Settings")) +s.anonymous = true +s.addremove = false + +o = s:option(ListValue, "server", translate("Server")) +o:value("nil", translate("Disable")) +for _, s in ipairs(servers) do o:value(s.name, s.alias) end +o.default = "nil" +o.rmempty = false + +o = s:option(ListValue, "daemon_user", translate("Run Daemon as User")) +for u in luci.util.execi("cat /etc/passwd | cut -d ':' -f1") do o:value(u) end +o.default = "root" +o.rmempty = false + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua new file mode 100644 index 000000000..ba961d189 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers-details.lua @@ -0,0 +1,96 @@ +local m, s, o +local sid = arg[1] + +local raw_modes = { + "faketcp", + "udp", + "icmp", +} + +local cipher_modes = { + "aes128cbc", + "xor", + "none", +} + +local auth_modes = { + "md5", + "crc32", + "simple", + "none", +} + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Edit Server")}) +m.redirect = luci.dispatcher.build_url("admin/services/udp2raw/servers") +m.sid = sid + +if m.uci:get("udp2raw", sid) ~= "servers" then + luci.http.redirect(m.redirect) + return +end + +s = m:section(NamedSection, sid, "servers") +s.anonymous = true +s.addremove = false + +o = s:option(Value, "alias", translate("Alias(optional)")) + +o = s:option(Value, "server_addr", translate("Server")) +o.datatype = "host" +o.rmempty = false + +o = s:option(Value, "server_port", translate("Server Port")) +o.datatype = "port" +o.placeholder = "8080" + +o = s:option(Value, "listen_addr", translate("Local Listen Host")) +o.datatype = "ipaddr" +o.placeholder = "127.0.0.1" + +o = s:option(Value, "listen_port", translate("Local Listen Port")) +o.datatype = "port" +o.placeholder = "2080" + +o = s:option(ListValue, "raw_mode", translate("Raw Mode")) +for _, v in ipairs(raw_modes) do o:value(v, v:lower()) end +o.default = "faketcp" +o.rmempty = false + +o = s:option(Value, "key", translate("Password")) +o.password = true + +o = s:option(ListValue, "cipher_mode", translate("Cipher Mode")) +for _, v in ipairs(cipher_modes) do o:value(v, v:lower()) end +o.default = "aes128cbc" + +o = s:option(ListValue, "auth_mode", translate("Auth Mode")) +for _, v in ipairs(auth_modes) do o:value(v, v:lower()) end +o.default = "md5" + +o = s:option(Flag, "auto_rule", translate("Auto Rule"), translate("Auto add (and delete) iptables rule.")) +o.enabled = "1" +o.disabled = "0" +o.default = "1" + +o = s:option(Flag, "keep_rule", translate("Keep Rule"), translate("Monitor iptables and auto re-add if necessary.")) +o.enabled = "1" +o.disabled = "0" +o:depends("auto_rule", "1") + +o = s:option(Value, "seq_mode", translate("seq Mode"), translate("seq increase mode for faketcp.")) +o.datatype = "range(0,4)" +o.placeholder = "3" + +o = s:option(Value, "lower_level", translate("Lower Level"), translate("Send packets at OSI level 2, format: \"eth0#00:11:22:33:44:55\", or \"auto\".")) + +o = s:option(Value, "source_ip", translate("Source-IP"), translate("Force source-ip for Raw Socket.")) +o.datatype = "ipaddr" + +o = s:option(Value, "source_port", translate("Source-Port"), translate("Force source-port for Raw Socket, TCP/UDP only.")) +o.datatype = "port" + +o = s:option(Value, "log_level", translate("Log Level")) +o.datatype = "range(0,6)" +o.placeholder = "4" + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua new file mode 100644 index 000000000..34be00522 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/model/cbi/udp2raw/servers.lua @@ -0,0 +1,56 @@ +local m, s, o + +m = Map("udp2raw", "%s - %s" %{translate("udp2raw-tunnel"), translate("Servers Manage")}) + +s = m:section(TypedSection, "servers") +s.anonymous = true +s.addremove = true +s.sortable = true +s.template = "cbi/tblsection" +s.extedit = luci.dispatcher.build_url("admin/services/udp2raw/servers/%s") +function s.create(...) + local sid = TypedSection.create(...) + if sid then + luci.http.redirect(s.extedit % sid) + return + end +end + +o = s:option(DummyValue, "alias", translate("Alias")) +function o.cfgvalue(...) + return Value.cfgvalue(...) or translate("None") +end + +o = s:option(DummyValue, "_server_address", translate("Server Address")) +function o.cfgvalue(self, section) + local server_addr = m.uci:get("udp2raw", section, "server_addr") or "?" + local server_port = m.uci:get("udp2raw", section, "server_port") or "8080" + return "%s:%s" %{server_addr, server_port} +end + +o = s:option(DummyValue, "_listen_address", translate("Listen Address")) +function o.cfgvalue(self, section) + local listen_addr = m.uci:get("udp2raw", section, "listen_addr") or "127.0.0.1" + local listen_port = m.uci:get("udp2raw", section, "listen_port") or "2080" + return "%s:%s" %{listen_addr, listen_port} +end + +o = s:option(DummyValue, "raw_mode", translate("Raw Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "faketcp" +end + +o = s:option(DummyValue, "cipher_mode", translate("Cipher Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "aes128cbc" +end + +o = s:option(DummyValue, "auth_mode", translate("Auth Mode")) +function o.cfgvalue(...) + local v = Value.cfgvalue(...) + return v and v:lower() or "md5" +end + +return m diff --git a/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm b/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm new file mode 100644 index 000000000..964b11786 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/luci/view/udp2raw_status.htm @@ -0,0 +1,39 @@ +<% +local function get_udp2raw_version(name) + local info = luci.util.split(luci.sys.exec("%s -h 2>/dev/null" %{name}), "\n") + local version = string.match(info[2], "git version:(%w+)") + local build = string.match(info[2], "build date:(.+)") + return info[1] == "udp2raw-tunnel" and version or "", info[1] == "udp2raw-tunnel" and build or "" +end + +local udp2raw_version, udp2raw_build = get_udp2raw_version("udp2raw") +-%> + +
+ <%:Running Status%> + + + + + + <% if udp2raw_build ~= "" then -%> + + <% end -%> + +
<%:Binary Version%> + <% if udp2raw_version == "" then -%> + <%:Invalid Binary File.%> + <% else -%> + <%=pcdata(udp2raw_version)%> + <%- end %> +
<%:Build Time%><%=pcdata(udp2raw_build)%>
<%:Running Status%><%:Collecting data...%>
+
+ + diff --git a/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw new file mode 100644 index 000000000..8a27625ca --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/config/udp2raw @@ -0,0 +1,16 @@ + +config general 'general' + option server 'nil' + option daemon_user 'root' + +config servers 'default' + option server_addr '' + option server_port '8080' + option listen_addr '127.0.0.1' + option listen_port '2080' + option raw_mode 'faketcp' + option key '' + option cipher_mode 'aes128cbc' + option auth_mode 'md5' + option auto_rule '1' + diff --git a/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw new file mode 100755 index 000000000..3733b66d6 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/init.d/udp2raw @@ -0,0 +1,121 @@ +#!/bin/sh /etc/rc.common + +START=88 +USE_PROCD=1 + +UDP2RAW=udp2raw + +_log() { + local level="$1" + local msg="$2" + + logger -p "daemon.${level}" -t "$UDP2RAW" "$msg" +} + +gen_client_config_file() { + local config_file="$1" + echo "# auto-generated config file from /etc/config/udp2raw" > $config_file + + echo "-c" >> $config_file + echo "-l ${listen_addr}:${listen_port}" >> $config_file && _log "info" "listening on: ${listen_addr}:${listen_port}" + echo "-r ${server_addr}:${server_port}" >> $config_file && _log "info" "remote address: ${server_addr}:${server_port}" + + [ -n "$raw_mode" ] && echo "--raw-mode ${raw_mode}" >> $config_file && _log "info" "raw-mode: ${raw_mode}" + [ -n "$key" ] && echo "--key ${key}" >> $config_file + [ -n "$cipher_mode" ] && echo "--cipher-mode ${cipher_mode}" >> $config_file && _log "info" "cipher-mode: ${cipher_mode}" + [ -n "$auth_mode" ] && echo "--auth-mode ${auth_mode}" >> $config_file && _log "info" "auth-mode: ${auth_mode}" + + [ "$auto_rule" -ne 0 ] && echo "--auto-rule" >> $config_file && _log "info" "auto-rule: true" + [ "$auto_rule" -ne 0 -a "$keep_rule" -ne 0 ] && echo "--keep-rule" >> $config_file && _log "info" "keep-rule: true" + + [ -n "$seq_mode" ] && echo "--seq-mode ${seq_mode}" >> $config_file && _log "info" "seq-mode: ${seq_mode}" + [ -n "$lower_level" ] && echo "--lower-level ${lower_level}" >> $config_file && _log "info" "lower-level: ${lower_level}" + [ -n "$source_ip" ] && echo "--source-ip ${source_ip}" >> $config_file + [ -n "$source_port" ] && echo "--source-port ${source_port}" >> $config_file + + [ -n "$log_level" ] && echo "--log-level ${log_level}" >> $config_file + echo "--disable-color" >> $config_file + _log "info" "running from ${daemon_user} user" +} + +validate_config_section() { + uci_validate_section "$UDP2RAW" general "$1" \ + 'server:uciname' \ + 'daemon_user:string:root' +} + +validate_server_section() { + uci_validate_section "$UDP2RAW" servers "$1" \ + 'server_addr:host' \ + 'server_port:port:8080' \ + 'listen_addr:ipaddr:127.0.0.1' \ + 'listen_port:port:2080' \ + 'raw_mode:or("faketcp", "udp", "icmp"):faketcp' \ + 'key:string' \ + 'cipher_mode:or("aes128cbc", "xor", "none"):aes128cbc' \ + 'auth_mode:or("md5", "crc32", "simple", "none"):md5' \ + 'auto_rule:bool:1' \ + 'keep_rule:bool:0' \ + 'seq_mode:range(0,4)' \ + 'lower_level:string' \ + 'source_ip:ipaddr' \ + 'source_port:port' \ + 'log_level:range(0,6)' +} + +start_udp2raw_instance() { + local section="$1" + + if ! validate_config_section "$section" ; then + _log "err" "Config validate failed." + return 1 + fi + + if [ -z "$server" ] || [ "$server" = "nil" ]; then + return 0 + elif ! validate_server_section "$server"; then + _log "err" "Server config validation failed." + return 1 + elif [ -z "$server_addr" ]; then + _log "err" "Server address validation failed." + return 1 + fi + + is_ipv6_address() { + echo "$1" | grep -q ":" + } + + is_ipv6_address "$server_addr" && server_addr="[${server_addr}]" + is_ipv6_address "$listen_addr" && listen_addr="[${listen_addr}]" + + _log "notice" "udp2raw-tunnel start." + [ -d /var/etc ] || mkdir -p /var/etc + local config_file=/var/etc/${UDP2RAW}.${server}.conf + + if ! ( gen_client_config_file "$config_file" ); then + _log "err" "Can't create config file". + return 1 + fi + + procd_open_instance + procd_set_param command /usr/bin/udp2raw + procd_append_param command --conf-file "$config_file" + procd_set_param respawn + procd_set_param file "$config_file" + procd_set_param user "$daemon_user" + procd_set_param pidfile /var/run/${UDP2RAW}.${server}.pid + procd_close_instance +} + +service_triggers() { + procd_add_reload_trigger "$UDP2RAW" +} + +start_service() { + config_load "$UDP2RAW" + config_foreach start_udp2raw_instance "general" +} + +stop_service() { + _log "notice" "udp2raw-tunnel stop." +} diff --git a/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw b/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw new file mode 100755 index 000000000..c04688e41 --- /dev/null +++ b/package/lean/luci-app-udp2raw/files/root/etc/uci-defaults/luci-udp2raw @@ -0,0 +1,25 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@udp2raw[-1] + add ucitrack udp2raw + set ucitrack.@udp2raw[-1].init=udp2raw + commit ucitrack +EOF + +general=$(uci -q get udp2raw.@general[-1]) + +if [ -z "$general" ]; then + uci -q add udp2raw general +fi + +if [ ."$general" != ."general" ]; then + uci -q batch <<-EOF >/dev/null + rename udp2raw.@general[-1]="general" + set udp2raw.general.server="nil" + commit udp2raw + EOF +fi + +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +exit 0 diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile b/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile new file mode 100644 index 000000000..ad2c13320 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/Makefile @@ -0,0 +1,12 @@ + +INSTALL = install +PREFIX = /usr/bin + +po2lmo: src/po2lmo.o src/template_lmo.o + $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o + +install: + $(INSTALL) -m 755 src/po2lmo $(PREFIX) + +clean: + $(RM) src/po2lmo src/*.o diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c b/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c new file mode 100644 index 000000000..0da792b68 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/po2lmo.c @@ -0,0 +1,247 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static int extract_string(const char *src, char *dest, int len) +{ + int pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c new file mode 100644 index 000000000..27205a722 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.c @@ -0,0 +1,328 @@ +/* + * lmo - Lua Machine Objects - Base functions + * + * Copyright (C) 2009-2010 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +/* + * Hash function from http://www.azillionmonkeys.com/qed/hash.html + * Copyright (C) 2004-2008 by Paul Hsieh + */ + +uint32_t sfh_hash(const char *data, int len) +{ + uint32_t hash = len, tmp; + int rem; + + if (len <= 0 || data == NULL) return 0; + + rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) { + hash += sfh_get16(data); + tmp = (sfh_get16(data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += sfh_get16(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += sfh_get16(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; +} + +uint32_t lmo_canon_hash(const char *str, int len) +{ + char res[4096]; + char *ptr, prev; + int off; + + if (!str || len >= sizeof(res)) + return 0; + + for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) + { + if (isspace(*str)) + { + if (!isspace(prev)) + *ptr++ = ' '; + } + else + { + *ptr++ = *str; + } + } + + if ((ptr > res) && isspace(*(ptr-1))) + ptr--; + + return sfh_hash(res, ptr - res); +} + +lmo_archive_t * lmo_open(const char *file) +{ + int in = -1; + uint32_t idx_offset = 0; + struct stat s; + + lmo_archive_t *ar = NULL; + + if (stat(file, &s) == -1) + goto err; + + if ((in = open(file, O_RDONLY)) == -1) + goto err; + + if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) + { + memset(ar, 0, sizeof(*ar)); + + ar->fd = in; + ar->size = s.st_size; + + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + + if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) + goto err; + + idx_offset = ntohl(*((const uint32_t *) + (ar->mmap + ar->size - sizeof(uint32_t)))); + + if (idx_offset >= ar->size) + goto err; + + ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); + ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); + ar->end = ar->mmap + ar->size; + + return ar; + } + +err: + if (in > -1) + close(in); + + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + free(ar); + } + + return NULL; +} + +void lmo_close(lmo_archive_t *ar) +{ + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + close(ar->fd); + free(ar); + + ar = NULL; + } +} + + +lmo_catalog_t *_lmo_catalogs = NULL; +lmo_catalog_t *_lmo_active_catalog = NULL; + +int lmo_load_catalog(const char *lang, const char *dir) +{ + DIR *dh = NULL; + char pattern[16]; + char path[PATH_MAX]; + struct dirent *de = NULL; + + lmo_archive_t *ar = NULL; + lmo_catalog_t *cat = NULL; + + if (!lmo_change_catalog(lang)) + return 0; + + if (!dir || !(dh = opendir(dir))) + goto err; + + if (!(cat = malloc(sizeof(*cat)))) + goto err; + + memset(cat, 0, sizeof(*cat)); + + snprintf(cat->lang, sizeof(cat->lang), "%s", lang); + snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); + + while ((de = readdir(dh)) != NULL) + { + if (!fnmatch(pattern, de->d_name, 0)) + { + snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); + ar = lmo_open(path); + + if (ar) + { + ar->next = cat->archives; + cat->archives = ar; + } + } + } + + closedir(dh); + + cat->next = _lmo_catalogs; + _lmo_catalogs = cat; + + if (!_lmo_active_catalog) + _lmo_active_catalog = cat; + + return 0; + +err: + if (dh) closedir(dh); + if (cat) free(cat); + + return -1; +} + +int lmo_change_catalog(const char *lang) +{ + lmo_catalog_t *cat; + + for (cat = _lmo_catalogs; cat; cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + _lmo_active_catalog = cat; + return 0; + } + } + + return -1; +} + +static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) +{ + unsigned int m, l, r; + uint32_t k; + + l = 0; + r = ar->length - 1; + + while (1) + { + m = l + ((r - l) / 2); + + if (r < l) + break; + + k = ntohl(ar->index[m].key_id); + + if (k == hash) + return &ar->index[m]; + + if (k > hash) + { + if (!m) + break; + + r = m - 1; + } + else + { + l = m + 1; + } + } + + return NULL; +} + +int lmo_translate(const char *key, int keylen, char **out, int *outlen) +{ + uint32_t hash; + lmo_entry_t *e; + lmo_archive_t *ar; + + if (!key || !_lmo_active_catalog) + return -2; + + hash = lmo_canon_hash(key, keylen); + + for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) + { + if ((e = lmo_find_entry(ar, hash)) != NULL) + { + *out = ar->mmap + ntohl(e->offset); + *outlen = ntohl(e->length); + return 0; + } + } + + return -1; +} + +void lmo_close_catalog(const char *lang) +{ + lmo_archive_t *ar, *next; + lmo_catalog_t *cat, *prev; + + for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + if (prev) + prev->next = cat->next; + else + _lmo_catalogs = cat->next; + + for (ar = cat->archives; ar; ar = next) + { + next = ar->next; + lmo_close(ar); + } + + free(cat); + break; + } + } +} diff --git a/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h new file mode 100644 index 000000000..57f59aa56 --- /dev/null +++ b/package/lean/luci-app-udp2raw/tools/po2lmo/src/template_lmo.h @@ -0,0 +1,92 @@ +/* + * lmo - Lua Machine Objects - General header + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _TEMPLATE_LMO_H_ +#define _TEMPLATE_LMO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__GNUC__) && defined(__i386__)) +#define sfh_get16(d) (*((const uint16_t *) (d))) +#else +#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif + + +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); + +typedef struct lmo_entry lmo_entry_t; + + +struct lmo_archive { + int fd; + int length; + uint32_t size; + lmo_entry_t *index; + char *mmap; + char *end; + struct lmo_archive *next; +}; + +typedef struct lmo_archive lmo_archive_t; + + +struct lmo_catalog { + char lang[6]; + struct lmo_archive *archives; + struct lmo_catalog *next; +}; + +typedef struct lmo_catalog lmo_catalog_t; + + +uint32_t sfh_hash(const char *data, int len); +uint32_t lmo_canon_hash(const char *data, int len); + +lmo_archive_t * lmo_open(const char *file); +void lmo_close(lmo_archive_t *ar); + + +extern lmo_catalog_t *_lmo_catalogs; +extern lmo_catalog_t *_lmo_active_catalog; + +int lmo_load_catalog(const char *lang, const char *dir); +int lmo_change_catalog(const char *lang); +int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_close_catalog(const char *lang); + +#endif diff --git a/package/lean/udp2raw/LICENSE b/package/lean/udp2raw/LICENSE new file mode 100644 index 000000000..6e53158db --- /dev/null +++ b/package/lean/udp2raw/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Yu Wang (wangyucn at gmail.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/package/lean/udp2raw/Makefile b/package/lean/udp2raw/Makefile new file mode 100644 index 000000000..22f767378 --- /dev/null +++ b/package/lean/udp2raw/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (c) 2017 Yu Wang +# +# This is free software, licensed under the MIT. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=udp2raw-tunnel +PKG_VERSION:=20171125.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/wangyu-/udp2raw-tunnel.git +PKG_SOURCE_VERSION:=b35edf74865275cdc970384681a1a076d3a8d0e1 +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Yu Wang + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/udp2raw-tunnel + SECTION:=net + CATEGORY:=Network + TITLE:=Tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic + URL:=https://github.com/wangyu-/udp2raw-tunnel +endef + +define Package/udp2raw-tunnel/description + udp2raw-tunnel is a tunnel which turns UDP Traffic into Encrypted FakeTCP/UDP/ICMP Traffic by using Raw Socket. +endef + +MAKE_FLAGS += cross2 + +define Build/Prepare + $(PKG_UNPACK) + sed -i 's/cc_cross=.*/cc_cross=$(TARGET_CXX)/g' $(PKG_BUILD_DIR)/makefile + sed -i '/\*gitversion/d' $(PKG_BUILD_DIR)/makefile + echo 'const char *gitversion = "$(PKG_SOURCE_VERSION)";' > $(PKG_BUILD_DIR)/git_version.h + $(Build/Patch) +endef + +define Package/udp2raw-tunnel/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/udp2raw_cross $(1)/usr/bin/udp2raw +endef + +$(eval $(call BuildPackage,udp2raw-tunnel)) diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index f10835474..1e478e181 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -14,7 +14,7 @@ CONFIG_ACPI_CPU_FREQ_PSS=y CONFIG_ACPI_FAN=y CONFIG_ACPI_HOTPLUG_IOAPIC=y CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -# CONFIG_ACPI_NFIT is not set +CONFIG_ACPI_NFIT=y # CONFIG_ACPI_PCI_SLOT is not set CONFIG_ACPI_PROCESSOR=y # CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set @@ -71,6 +71,7 @@ CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +# CONFIG_ARM_SCPI_PROTOCOL is not set CONFIG_ATA=y CONFIG_ATA_GENERIC=y CONFIG_ATA_PIIX=y @@ -188,6 +189,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEOS is not set CONFIG_GLOB=y # CONFIG_GOOGLE_FIRMWARE is not set +# CONFIG_GPIO_AMDPT is not set +# CONFIG_GPIO_F7188X is not set # CONFIG_HANGCHECK_TIMER is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -312,6 +315,7 @@ CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y +# CONFIG_LIQUIDIO is not set # CONFIG_M486 is not set # CONFIG_M586 is not set CONFIG_M586MMX=y @@ -424,6 +428,7 @@ CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_WDT is not set +# CONFIG_SENSORS_XGENE is not set # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_PCI=y CONFIG_SERIAL_8250_PNP=y @@ -447,6 +452,10 @@ CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THREAD_INFO_IN_TASK=y +CONFIG_THUNDER_NIC_BGX=y +CONFIG_THUNDER_NIC_PF=y +CONFIG_THUNDER_NIC_RGX=y +CONFIG_THUNDER_NIC_VF=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set # CONFIG_TOSHIBA_BT_RFKILL is not set @@ -544,13 +553,3 @@ CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y -CONFIG_ACPI_NFIT=y -CONFIG_THUNDER_NIC_PF=y -CONFIG_THUNDER_NIC_VF=y -CONFIG_THUNDER_NIC_BGX=y -CONFIG_THUNDER_NIC_RGX=y -CONFIG_LIQUIDIO=n -CONFIG_GPIO_AMDPT=n -CONFIG_GPIO_F7188X=n -CONFIG_SENSORS_XGENE=n -CONFIG_ARM_SCPI_PROTOCOL=n \ No newline at end of file From b780d3bfb657b26c886252036cba33c15e10fd89 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 8 Jan 2018 18:19:57 +0800 Subject: [PATCH 56/95] Add ARM and NEON optimizations --- package/libs/zlib/Config.in | 11 + package/libs/zlib/Makefile | 42 +- .../001-neon-implementation-of-adler32.patch | 253 ++ ...m-specific-optimisations-for-inflate.patch | 2411 +++++++++++++++++ ...rcefiles-in-patch-002-to-buildsystem.patch | 100 + 5 files changed, 2795 insertions(+), 22 deletions(-) create mode 100644 package/libs/zlib/Config.in create mode 100644 package/libs/zlib/patches/001-neon-implementation-of-adler32.patch create mode 100644 package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch create mode 100644 package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch diff --git a/package/libs/zlib/Config.in b/package/libs/zlib/Config.in new file mode 100644 index 000000000..64b835e77 --- /dev/null +++ b/package/libs/zlib/Config.in @@ -0,0 +1,11 @@ +menu "Configuration" + depends on PACKAGE_zlib + +config ZLIB_OPTIMIZE_SPEED + bool "Optimize for speed" + help + This enables additional optimization and + increases performance considerably at + the expense of binary size. + +endmenu diff --git a/package/libs/zlib/Makefile b/package/libs/zlib/Makefile index 7e3bd8319..a7c61f7dd 100644 --- a/package/libs/zlib/Makefile +++ b/package/libs/zlib/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zlib PKG_VERSION:=1.2.11 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/libpng http://www.zlib.net @@ -17,8 +17,13 @@ PKG_HASH:=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066 PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=README +PKG_CPE_ID:=cpe:/a:gnu:zlib +PKG_CONFIG_DEPENDS:= CONFIG_ZLIB_OPTIMIZE_SPEED + +include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk define Package/zlib SECTION:=libs @@ -45,27 +50,19 @@ define Package/zlib-dev/description This package includes the development support files. endef -CONFIGURE_VARS := \ - $(TARGET_CONFIGURE_OPTS) \ - LDSHARED="$(TARGET_CC) -shared -Wl,-soname,libz.so.1" \ - CFLAGS="$(TARGET_CFLAGS) $(FPIC)" \ - -CONFIGURE_ARGS := \ - --prefix=/usr \ - --shared \ - --uname=Linux \ - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - libz.a libz.so.$(PKG_VERSION) - mkdir -p $(PKG_INSTALL_DIR) - $(MAKE) -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - install +define Package/zlib/config + source "$(SOURCE)/Config.in" endef +TARGET_CFLAGS += $(FPIC) + +ifeq ($(CONFIG_ZLIB_OPTIMIZE_SPEED),y) + TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3 +endif + +CMAKE_OPTIONS += \ + -DARMv8=$$$$(echo -e '\#ifdef __ARM_NEON__\nON\n\#else\nOFF\n\#endif' | $$(TARGET_CC) $$(TARGET_CFLAGS) -x c -E - | grep -xE 'ON|OFF') + define Build/InstallDev mkdir -p $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/z{conf,lib}.h \ @@ -74,7 +71,7 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.{a,so*} \ $(1)/usr/lib/ mkdir -p $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \ + $(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \ $(1)/usr/lib/pkgconfig/ endef @@ -94,9 +91,10 @@ define Package/zlib-dev/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libz.a $(1)/usr/lib/ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/zlib.pc \ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/zlib.pc \ $(1)/usr/lib/pkgconfig/ endef +$(eval $(call HostBuild)) $(eval $(call BuildPackage,zlib)) $(eval $(call BuildPackage,zlib-dev)) diff --git a/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch b/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch new file mode 100644 index 000000000..843ef45c7 --- /dev/null +++ b/package/libs/zlib/patches/001-neon-implementation-of-adler32.patch @@ -0,0 +1,253 @@ +From d2f06cd65d7ac39c6dd6761eef162abc946b155b Mon Sep 17 00:00:00 2001 +From: Adenilson Cavalcanti +Date: Tue, 11 Apr 2017 17:13:02 -0700 +Subject: [PATCH] NEON implementation for Adler32 + +The checksum is calculated in the uncompressed PNG data +and can be made much faster by using SIMD. + +Tests in ARMv8 yielded an improvement of about 3x +(e.g. walltime was 350ms x 125ms for a 4096x4096 bytes +executed 30 times). That results in at least 18% improvement +in image decoding in Chromium. + +Further details at: +https://bugs.chromium.org/p/chromium/issues/detail?id=688601 +--- + CMakeLists.txt | 29 +++++++--- + adler32.c | 5 ++ + contrib/README.contrib | 3 + + contrib/arm/neon_adler32.c | 137 +++++++++++++++++++++++++++++++++++++++++++++ + 4 files changed, 166 insertions(+), 8 deletions(-) + create mode 100644 contrib/arm/neon_adler32.c + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0fe939df..8e75f664 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -7,6 +7,7 @@ set(VERSION "1.2.11") + + option(ASM686 "Enable building i686 assembly implementation") + option(AMD64 "Enable building amd64 assembly implementation") ++option(ARMv8 "Enable building ARM NEON intrinsics implementation") + + set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") + set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") +@@ -132,14 +133,26 @@ endif() + if(CMAKE_COMPILER_IS_GNUCC) + if(ASM686) + set(ZLIB_ASMS contrib/asm686/match.S) +- elseif (AMD64) ++ elseif(AMD64) + set(ZLIB_ASMS contrib/amd64/amd64-match.S) +- endif () ++ elseif(ARMv8) ++ set(ZLIB_ARMv8 contrib/arm/neon_adler32.c) ++ endif() + +- if(ZLIB_ASMS) +- add_definitions(-DASMV) +- set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) +- endif() ++ if(ZLIB_ASMS) ++ add_definitions(-DASMV) ++ set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE) ++ elseif(ZLIB_ARMv8) ++ add_definitions(-DARMv8) ++ set(COMPILER ${CMAKE_C_COMPILER}) ++ # NEON is mandatory in ARMv8. ++ if(${COMPILER} MATCHES "aarch64") ++ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -march=armv8-a) ++ # But it was optional for ARMv7. ++ elseif(${COMPILER} MATCHES "arm") ++ set_source_files_properties(${ZLIB_ARMv8} PROPERTIES LANGUAGE C COMPILE_FLAGS -mfpu=neon) ++ endif() ++ endif() + endif() + + if(MSVC) +@@ -183,8 +196,8 @@ if(MINGW) + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) + endif(MINGW) + +-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) +-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) ++add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_ARMv8} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) + +diff --git a/adler32.c b/adler32.c +index d0be4380..45ebaa4b 100644 +--- a/adler32.c ++++ b/adler32.c +@@ -136,7 +136,12 @@ uLong ZEXPORT adler32(adler, buf, len) + const Bytef *buf; + uInt len; + { ++#ifdef ARMv8 ++# pragma message("Using NEON-ized Adler32.") ++ return NEON_adler32(adler, buf, len); ++#else + return adler32_z(adler, buf, len); ++#endif + } + + /* ========================================================================= */ +diff --git a/contrib/README.contrib b/contrib/README.contrib +index a411d5c3..3fd1d202 100644 +--- a/contrib/README.contrib ++++ b/contrib/README.contrib +@@ -12,6 +12,9 @@ amd64/ by Mikhail Teterin + asm code for AMD64 + See patch at http://www.freebsd.org/cgi/query-pr.cgi?pr=bin/96393 + ++arm/ by Adenilson Cavalcanti ++ ARM optimizations (NEON and ARMv8 code). ++ + asm686/ by Brian Raiter + asm code for Pentium and PPro/PII, using the AT&T (GNU as) syntax + See http://www.muppetlabs.com/~breadbox/software/assembly.html +diff --git a/contrib/arm/neon_adler32.c b/contrib/arm/neon_adler32.c +new file mode 100644 +index 00000000..f173a74f +--- /dev/null ++++ b/contrib/arm/neon_adler32.c +@@ -0,0 +1,137 @@ ++/* Copyright (C) 1995-2011, 2016 Mark Adler ++ * Copyright (C) 2017 ARM Holdings Inc. ++ * Authors: Adenilson Cavalcanti ++ * Simon Hosie ++ * This software is provided 'as-is', without any express or implied ++ * warranty. In no event will the authors be held liable for any damages ++ * arising from the use of this software. ++ * Permission is granted to anyone to use this software for any purpose, ++ * including commercial applications, and to alter it and redistribute it ++ * freely, subject to the following restrictions: ++ * 1. The origin of this software must not be misrepresented; you must not ++ * claim that you wrote the original software. If you use this software ++ * in a product, an acknowledgment in the product documentation would be ++ * appreciated but is not required. ++ * 2. Altered source versions must be plainly marked as such, and must not be ++ * misrepresented as being the original software. ++ * 3. This notice may not be removed or altered from any source distribution. ++ */ ++ ++#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) ++#include ++ ++static void NEON_accum32(uint32_t *s, const unsigned char *buf, ++ unsigned int len) ++{ ++ static const uint8_t taps[32] = { ++ 32, 31, 30, 29, 28, 27, 26, 25, ++ 24, 23, 22, 21, 20, 19, 18, 17, ++ 16, 15, 14, 13, 12, 11, 10, 9, ++ 8, 7, 6, 5, 4, 3, 2, 1 }; ++ ++ uint32x2_t adacc2, s2acc2, as; ++ uint8x16_t t0 = vld1q_u8(taps), t1 = vld1q_u8(taps + 16); ++ ++ uint32x4_t adacc = vdupq_n_u32(0), s2acc = vdupq_n_u32(0); ++ adacc = vsetq_lane_u32(s[0], adacc, 0); ++ s2acc = vsetq_lane_u32(s[1], s2acc, 0); ++ ++ while (len >= 2) { ++ uint8x16_t d0 = vld1q_u8(buf), d1 = vld1q_u8(buf + 16); ++ uint16x8_t adler, sum2; ++ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 5)); ++ adler = vpaddlq_u8( d0); ++ adler = vpadalq_u8(adler, d1); ++ sum2 = vmull_u8( vget_low_u8(t0), vget_low_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t0), vget_high_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_low_u8(t1), vget_low_u8(d1)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d1)); ++ adacc = vpadalq_u16(adacc, adler); ++ s2acc = vpadalq_u16(s2acc, sum2); ++ len -= 2; ++ buf += 32; ++ } ++ ++ while (len > 0) { ++ uint8x16_t d0 = vld1q_u8(buf); ++ uint16x8_t adler, sum2; ++ s2acc = vaddq_u32(s2acc, vshlq_n_u32(adacc, 4)); ++ adler = vpaddlq_u8(d0); ++ sum2 = vmull_u8( vget_low_u8(t1), vget_low_u8(d0)); ++ sum2 = vmlal_u8(sum2, vget_high_u8(t1), vget_high_u8(d0)); ++ adacc = vpadalq_u16(adacc, adler); ++ s2acc = vpadalq_u16(s2acc, sum2); ++ buf += 16; ++ len--; ++ } ++ ++ adacc2 = vpadd_u32(vget_low_u32(adacc), vget_high_u32(adacc)); ++ s2acc2 = vpadd_u32(vget_low_u32(s2acc), vget_high_u32(s2acc)); ++ as = vpadd_u32(adacc2, s2acc2); ++ s[0] = vget_lane_u32(as, 0); ++ s[1] = vget_lane_u32(as, 1); ++} ++ ++static void NEON_handle_tail(uint32_t *pair, const unsigned char *buf, ++ unsigned int len) ++{ ++ /* Oldie K&R code integration. */ ++ unsigned int i; ++ for (i = 0; i < len; ++i) { ++ pair[0] += buf[i]; ++ pair[1] += pair[0]; ++ } ++} ++ ++extern unsigned long NEON_adler32(unsigned long adler, const unsigned char *buf, ++ const unsigned int len) ++{ ++ /* initial Adler-32 value (deferred check for len == 1 speed) */ ++ if (!buf) ++ return 1L; ++ ++ /* The largest prime smaller than 65536. */ ++ const uint32_t M_BASE = 65521; ++ /* This is the threshold where doing accumulation may overflow. */ ++ const int M_NMAX = 5552; ++ ++ unsigned long sum2; ++ uint32_t pair[2]; ++ int n = M_NMAX; ++ unsigned int done = 0; ++ /* Oldie K&R code integration. */ ++ unsigned int i; ++ ++ /* Split Adler-32 into component sums, it can be supplied by ++ * the caller sites (e.g. in a PNG file). ++ */ ++ sum2 = (adler >> 16) & 0xffff; ++ adler &= 0xffff; ++ pair[0] = adler; ++ pair[1] = sum2; ++ ++ for (i = 0; i < len; i += n) { ++ if ((i + n) > len) ++ n = len - i; ++ ++ if (n < 16) ++ break; ++ ++ NEON_accum32(pair, buf + i, n / 16); ++ pair[0] %= M_BASE; ++ pair[1] %= M_BASE; ++ ++ done += (n / 16) * 16; ++ } ++ ++ /* Handle the tail elements. */ ++ if (done < len) { ++ NEON_handle_tail(pair, (buf + done), len - done); ++ pair[0] %= M_BASE; ++ pair[1] %= M_BASE; ++ } ++ ++ /* D = B * 65536 + A, see: https://en.wikipedia.org/wiki/Adler-32. */ ++ return (pair[1] << 16) | pair[0]; ++} ++#endif diff --git a/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch new file mode 100644 index 000000000..475ed6f3e --- /dev/null +++ b/package/libs/zlib/patches/002-arm-specific-optimisations-for-inflate.patch @@ -0,0 +1,2411 @@ +From 6bac7a3e0ebcd3147294b73acb34606eba18ae7f Mon Sep 17 00:00:00 2001 +From: Simon Hosie +Date: Wed, 12 Apr 2017 12:52:33 -0700 +Subject: [PATCH 1/2] Prepare ARM-specific contrib directory. + +Change-Id: Id4cda552b39bfb39ab35ec499dbe122b43b6d1a1 +--- + contrib/arm/inffast.c | 323 ++++++++++ + contrib/arm/inflate.c | 1561 +++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 1884 insertions(+) + create mode 100644 contrib/arm/inffast.c + create mode 100644 contrib/arm/inflate.c + +diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c +new file mode 100644 +index 00000000..0dbd1dbc +--- /dev/null ++++ b/contrib/arm/inffast.c +@@ -0,0 +1,323 @@ ++/* inffast.c -- fast decoding ++ * Copyright (C) 1995-2017 Mark Adler ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++#include "zutil.h" ++#include "inftrees.h" ++#include "inflate.h" ++#include "inffast.h" ++ ++#ifdef ASMINF ++# pragma message("Assembler code may have bugs -- use at your own risk") ++#else ++ ++/* ++ Decode literal, length, and distance codes and write out the resulting ++ literal and match bytes until either not enough input or output is ++ available, an end-of-block is encountered, or a data error is encountered. ++ When large enough input and output buffers are supplied to inflate(), for ++ example, a 16K input buffer and a 64K output buffer, more than 95% of the ++ inflate execution time is spent in this routine. ++ ++ Entry assumptions: ++ ++ state->mode == LEN ++ strm->avail_in >= 6 ++ strm->avail_out >= 258 ++ start >= strm->avail_out ++ state->bits < 8 ++ ++ On return, state->mode is one of: ++ ++ LEN -- ran out of enough output space or enough available input ++ TYPE -- reached end of block code, inflate() to interpret next block ++ BAD -- error in block data ++ ++ Notes: ++ ++ - The maximum input bits used by a length/distance pair is 15 bits for the ++ length code, 5 bits for the length extra, 15 bits for the distance code, ++ and 13 bits for the distance extra. This totals 48 bits, or six bytes. ++ Therefore if strm->avail_in >= 6, then there is enough input to avoid ++ checking for available input while decoding. ++ ++ - The maximum bytes that a single length/distance pair can output is 258 ++ bytes, which is the maximum length that can be coded. inflate_fast() ++ requires strm->avail_out >= 258 for each loop to avoid checking for ++ output space. ++ */ ++void ZLIB_INTERNAL inflate_fast(strm, start) ++z_streamp strm; ++unsigned start; /* inflate()'s starting value for strm->avail_out */ ++{ ++ struct inflate_state FAR *state; ++ z_const unsigned char FAR *in; /* local strm->next_in */ ++ z_const unsigned char FAR *last; /* have enough input while in < last */ ++ unsigned char FAR *out; /* local strm->next_out */ ++ unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ ++ unsigned char FAR *end; /* while out < end, enough space available */ ++#ifdef INFLATE_STRICT ++ unsigned dmax; /* maximum distance from zlib header */ ++#endif ++ unsigned wsize; /* window size or zero if not using window */ ++ unsigned whave; /* valid bytes in the window */ ++ unsigned wnext; /* window write index */ ++ unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ ++ unsigned long hold; /* local strm->hold */ ++ unsigned bits; /* local strm->bits */ ++ code const FAR *lcode; /* local strm->lencode */ ++ code const FAR *dcode; /* local strm->distcode */ ++ unsigned lmask; /* mask for first level of length codes */ ++ unsigned dmask; /* mask for first level of distance codes */ ++ code here; /* retrieved table entry */ ++ unsigned op; /* code bits, operation, extra bits, or */ ++ /* window position, window bytes to copy */ ++ unsigned len; /* match length, unused bytes */ ++ unsigned dist; /* match distance */ ++ unsigned char FAR *from; /* where to copy match from */ ++ ++ /* copy state to local variables */ ++ state = (struct inflate_state FAR *)strm->state; ++ in = strm->next_in; ++ last = in + (strm->avail_in - 5); ++ out = strm->next_out; ++ beg = out - (start - strm->avail_out); ++ end = out + (strm->avail_out - 257); ++#ifdef INFLATE_STRICT ++ dmax = state->dmax; ++#endif ++ wsize = state->wsize; ++ whave = state->whave; ++ wnext = state->wnext; ++ window = state->window; ++ hold = state->hold; ++ bits = state->bits; ++ lcode = state->lencode; ++ dcode = state->distcode; ++ lmask = (1U << state->lenbits) - 1; ++ dmask = (1U << state->distbits) - 1; ++ ++ /* decode literals and length/distances until end-of-block or not enough ++ input data or output space */ ++ do { ++ if (bits < 15) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ here = lcode[hold & lmask]; ++ dolen: ++ op = (unsigned)(here.bits); ++ hold >>= op; ++ bits -= op; ++ op = (unsigned)(here.op); ++ if (op == 0) { /* literal */ ++ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? ++ "inflate: literal '%c'\n" : ++ "inflate: literal 0x%02x\n", here.val)); ++ *out++ = (unsigned char)(here.val); ++ } ++ else if (op & 16) { /* length base */ ++ len = (unsigned)(here.val); ++ op &= 15; /* number of extra bits */ ++ if (op) { ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ len += (unsigned)hold & ((1U << op) - 1); ++ hold >>= op; ++ bits -= op; ++ } ++ Tracevv((stderr, "inflate: length %u\n", len)); ++ if (bits < 15) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ here = dcode[hold & dmask]; ++ dodist: ++ op = (unsigned)(here.bits); ++ hold >>= op; ++ bits -= op; ++ op = (unsigned)(here.op); ++ if (op & 16) { /* distance base */ ++ dist = (unsigned)(here.val); ++ op &= 15; /* number of extra bits */ ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ if (bits < op) { ++ hold += (unsigned long)(*in++) << bits; ++ bits += 8; ++ } ++ } ++ dist += (unsigned)hold & ((1U << op) - 1); ++#ifdef INFLATE_STRICT ++ if (dist > dmax) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ hold >>= op; ++ bits -= op; ++ Tracevv((stderr, "inflate: distance %u\n", dist)); ++ op = (unsigned)(out - beg); /* max distance in output */ ++ if (dist > op) { /* see if copy from window */ ++ op = dist - op; /* distance back in window */ ++ if (op > whave) { ++ if (state->sane) { ++ strm->msg = ++ (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ if (len <= op - whave) { ++ do { ++ *out++ = 0; ++ } while (--len); ++ continue; ++ } ++ len -= op - whave; ++ do { ++ *out++ = 0; ++ } while (--op > whave); ++ if (op == 0) { ++ from = out - dist; ++ do { ++ *out++ = *from++; ++ } while (--len); ++ continue; ++ } ++#endif ++ } ++ from = window; ++ if (wnext == 0) { /* very common case */ ++ from += wsize - op; ++ if (op < len) { /* some from window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ else if (wnext < op) { /* wrap around window */ ++ from += wsize + wnext - op; ++ op -= wnext; ++ if (op < len) { /* some from end of window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = window; ++ if (wnext < len) { /* some from start of window */ ++ op = wnext; ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ } ++ else { /* contiguous in window */ ++ from += wnext - op; ++ if (op < len) { /* some from window */ ++ len -= op; ++ do { ++ *out++ = *from++; ++ } while (--op); ++ from = out - dist; /* rest from output */ ++ } ++ } ++ while (len > 2) { ++ *out++ = *from++; ++ *out++ = *from++; ++ *out++ = *from++; ++ len -= 3; ++ } ++ if (len) { ++ *out++ = *from++; ++ if (len > 1) ++ *out++ = *from++; ++ } ++ } ++ else { ++ from = out - dist; /* copy direct from output */ ++ do { /* minimum length is three */ ++ *out++ = *from++; ++ *out++ = *from++; ++ *out++ = *from++; ++ len -= 3; ++ } while (len > 2); ++ if (len) { ++ *out++ = *from++; ++ if (len > 1) ++ *out++ = *from++; ++ } ++ } ++ } ++ else if ((op & 64) == 0) { /* 2nd level distance code */ ++ here = dcode[here.val + (hold & ((1U << op) - 1))]; ++ goto dodist; ++ } ++ else { ++ strm->msg = (char *)"invalid distance code"; ++ state->mode = BAD; ++ break; ++ } ++ } ++ else if ((op & 64) == 0) { /* 2nd level length code */ ++ here = lcode[here.val + (hold & ((1U << op) - 1))]; ++ goto dolen; ++ } ++ else if (op & 32) { /* end-of-block */ ++ Tracevv((stderr, "inflate: end of block\n")); ++ state->mode = TYPE; ++ break; ++ } ++ else { ++ strm->msg = (char *)"invalid literal/length code"; ++ state->mode = BAD; ++ break; ++ } ++ } while (in < last && out < end); ++ ++ /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ ++ len = bits >> 3; ++ in -= len; ++ bits -= len << 3; ++ hold &= (1U << bits) - 1; ++ ++ /* update state and return */ ++ strm->next_in = in; ++ strm->next_out = out; ++ strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); ++ strm->avail_out = (unsigned)(out < end ? ++ 257 + (end - out) : 257 - (out - end)); ++ state->hold = hold; ++ state->bits = bits; ++ return; ++} ++ ++/* ++ inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): ++ - Using bit fields for code structure ++ - Different op definition to avoid & for extra bits (do & for table bits) ++ - Three separate decoding do-loops for direct, window, and wnext == 0 ++ - Special case for distance > 1 copies to do overlapped load and store copy ++ - Explicit branch predictions (based on measured branch probabilities) ++ - Deferring match copy and interspersed it with decoding subsequent codes ++ - Swapping literal/length else ++ - Swapping window/direct else ++ - Larger unrolled copy loops (three is about right) ++ - Moving len -= 3 statement into middle of loop ++ */ ++ ++#endif /* !ASMINF */ +diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c +new file mode 100644 +index 00000000..ac333e8c +--- /dev/null ++++ b/contrib/arm/inflate.c +@@ -0,0 +1,1561 @@ ++/* inflate.c -- zlib decompression ++ * Copyright (C) 1995-2016 Mark Adler ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++/* ++ * Change history: ++ * ++ * 1.2.beta0 24 Nov 2002 ++ * - First version -- complete rewrite of inflate to simplify code, avoid ++ * creation of window when not needed, minimize use of window when it is ++ * needed, make inffast.c even faster, implement gzip decoding, and to ++ * improve code readability and style over the previous zlib inflate code ++ * ++ * 1.2.beta1 25 Nov 2002 ++ * - Use pointers for available input and output checking in inffast.c ++ * - Remove input and output counters in inffast.c ++ * - Change inffast.c entry and loop from avail_in >= 7 to >= 6 ++ * - Remove unnecessary second byte pull from length extra in inffast.c ++ * - Unroll direct copy to three copies per loop in inffast.c ++ * ++ * 1.2.beta2 4 Dec 2002 ++ * - Change external routine names to reduce potential conflicts ++ * - Correct filename to inffixed.h for fixed tables in inflate.c ++ * - Make hbuf[] unsigned char to match parameter type in inflate.c ++ * - Change strm->next_out[-state->offset] to *(strm->next_out - state->offset) ++ * to avoid negation problem on Alphas (64 bit) in inflate.c ++ * ++ * 1.2.beta3 22 Dec 2002 ++ * - Add comments on state->bits assertion in inffast.c ++ * - Add comments on op field in inftrees.h ++ * - Fix bug in reuse of allocated window after inflateReset() ++ * - Remove bit fields--back to byte structure for speed ++ * - Remove distance extra == 0 check in inflate_fast()--only helps for lengths ++ * - Change post-increments to pre-increments in inflate_fast(), PPC biased? ++ * - Add compile time option, POSTINC, to use post-increments instead (Intel?) ++ * - Make MATCH copy in inflate() much faster for when inflate_fast() not used ++ * - Use local copies of stream next and avail values, as well as local bit ++ * buffer and bit count in inflate()--for speed when inflate_fast() not used ++ * ++ * 1.2.beta4 1 Jan 2003 ++ * - Split ptr - 257 statements in inflate_table() to avoid compiler warnings ++ * - Move a comment on output buffer sizes from inffast.c to inflate.c ++ * - Add comments in inffast.c to introduce the inflate_fast() routine ++ * - Rearrange window copies in inflate_fast() for speed and simplification ++ * - Unroll last copy for window match in inflate_fast() ++ * - Use local copies of window variables in inflate_fast() for speed ++ * - Pull out common wnext == 0 case for speed in inflate_fast() ++ * - Make op and len in inflate_fast() unsigned for consistency ++ * - Add FAR to lcode and dcode declarations in inflate_fast() ++ * - Simplified bad distance check in inflate_fast() ++ * - Added inflateBackInit(), inflateBack(), and inflateBackEnd() in new ++ * source file infback.c to provide a call-back interface to inflate for ++ * programs like gzip and unzip -- uses window as output buffer to avoid ++ * window copying ++ * ++ * 1.2.beta5 1 Jan 2003 ++ * - Improved inflateBack() interface to allow the caller to provide initial ++ * input in strm. ++ * - Fixed stored blocks bug in inflateBack() ++ * ++ * 1.2.beta6 4 Jan 2003 ++ * - Added comments in inffast.c on effectiveness of POSTINC ++ * - Typecasting all around to reduce compiler warnings ++ * - Changed loops from while (1) or do {} while (1) to for (;;), again to ++ * make compilers happy ++ * - Changed type of window in inflateBackInit() to unsigned char * ++ * ++ * 1.2.beta7 27 Jan 2003 ++ * - Changed many types to unsigned or unsigned short to avoid warnings ++ * - Added inflateCopy() function ++ * ++ * 1.2.0 9 Mar 2003 ++ * - Changed inflateBack() interface to provide separate opaque descriptors ++ * for the in() and out() functions ++ * - Changed inflateBack() argument and in_func typedef to swap the length ++ * and buffer address return values for the input function ++ * - Check next_in and next_out for Z_NULL on entry to inflate() ++ * ++ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. ++ */ ++ ++#include "zutil.h" ++#include "inftrees.h" ++#include "inflate.h" ++#include "inffast.h" ++ ++#ifdef MAKEFIXED ++# ifndef BUILDFIXED ++# define BUILDFIXED ++# endif ++#endif ++ ++/* function prototypes */ ++local int inflateStateCheck OF((z_streamp strm)); ++local void fixedtables OF((struct inflate_state FAR *state)); ++local int updatewindow OF((z_streamp strm, const unsigned char FAR *end, ++ unsigned copy)); ++#ifdef BUILDFIXED ++ void makefixed OF((void)); ++#endif ++local unsigned syncsearch OF((unsigned FAR *have, const unsigned char FAR *buf, ++ unsigned len)); ++ ++local int inflateStateCheck(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (strm == Z_NULL || ++ strm->zalloc == (alloc_func)0 || strm->zfree == (free_func)0) ++ return 1; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state == Z_NULL || state->strm != strm || ++ state->mode < HEAD || state->mode > SYNC) ++ return 1; ++ return 0; ++} ++ ++int ZEXPORT inflateResetKeep(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ strm->total_in = strm->total_out = state->total = 0; ++ strm->msg = Z_NULL; ++ if (state->wrap) /* to support ill-conceived Java test suite */ ++ strm->adler = state->wrap & 1; ++ state->mode = HEAD; ++ state->last = 0; ++ state->havedict = 0; ++ state->dmax = 32768U; ++ state->head = Z_NULL; ++ state->hold = 0; ++ state->bits = 0; ++ state->lencode = state->distcode = state->next = state->codes; ++ state->sane = 1; ++ state->back = -1; ++ Tracev((stderr, "inflate: reset\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateReset(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ state->wsize = 0; ++ state->whave = 0; ++ state->wnext = 0; ++ return inflateResetKeep(strm); ++} ++ ++int ZEXPORT inflateReset2(strm, windowBits) ++z_streamp strm; ++int windowBits; ++{ ++ int wrap; ++ struct inflate_state FAR *state; ++ ++ /* get the state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* extract wrap request from windowBits parameter */ ++ if (windowBits < 0) { ++ wrap = 0; ++ windowBits = -windowBits; ++ } ++ else { ++ wrap = (windowBits >> 4) + 5; ++#ifdef GUNZIP ++ if (windowBits < 48) ++ windowBits &= 15; ++#endif ++ } ++ ++ /* set number of window bits, free window if different */ ++ if (windowBits && (windowBits < 8 || windowBits > 15)) ++ return Z_STREAM_ERROR; ++ if (state->window != Z_NULL && state->wbits != (unsigned)windowBits) { ++ ZFREE(strm, state->window); ++ state->window = Z_NULL; ++ } ++ ++ /* update state and reset the rest of it */ ++ state->wrap = wrap; ++ state->wbits = (unsigned)windowBits; ++ return inflateReset(strm); ++} ++ ++int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) ++z_streamp strm; ++int windowBits; ++const char *version; ++int stream_size; ++{ ++ int ret; ++ struct inflate_state FAR *state; ++ ++ if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || ++ stream_size != (int)(sizeof(z_stream))) ++ return Z_VERSION_ERROR; ++ if (strm == Z_NULL) return Z_STREAM_ERROR; ++ strm->msg = Z_NULL; /* in case we return an error */ ++ if (strm->zalloc == (alloc_func)0) { ++#ifdef Z_SOLO ++ return Z_STREAM_ERROR; ++#else ++ strm->zalloc = zcalloc; ++ strm->opaque = (voidpf)0; ++#endif ++ } ++ if (strm->zfree == (free_func)0) ++#ifdef Z_SOLO ++ return Z_STREAM_ERROR; ++#else ++ strm->zfree = zcfree; ++#endif ++ state = (struct inflate_state FAR *) ++ ZALLOC(strm, 1, sizeof(struct inflate_state)); ++ if (state == Z_NULL) return Z_MEM_ERROR; ++ Tracev((stderr, "inflate: allocated\n")); ++ strm->state = (struct internal_state FAR *)state; ++ state->strm = strm; ++ state->window = Z_NULL; ++ state->mode = HEAD; /* to pass state test in inflateReset2() */ ++ ret = inflateReset2(strm, windowBits); ++ if (ret != Z_OK) { ++ ZFREE(strm, state); ++ strm->state = Z_NULL; ++ } ++ return ret; ++} ++ ++int ZEXPORT inflateInit_(strm, version, stream_size) ++z_streamp strm; ++const char *version; ++int stream_size; ++{ ++ return inflateInit2_(strm, DEF_WBITS, version, stream_size); ++} ++ ++int ZEXPORT inflatePrime(strm, bits, value) ++z_streamp strm; ++int bits; ++int value; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (bits < 0) { ++ state->hold = 0; ++ state->bits = 0; ++ return Z_OK; ++ } ++ if (bits > 16 || state->bits + (uInt)bits > 32) return Z_STREAM_ERROR; ++ value &= (1L << bits) - 1; ++ state->hold += (unsigned)value << state->bits; ++ state->bits += (uInt)bits; ++ return Z_OK; ++} ++ ++/* ++ Return state with length and distance decoding tables and index sizes set to ++ fixed code decoding. Normally this returns fixed tables from inffixed.h. ++ If BUILDFIXED is defined, then instead this routine builds the tables the ++ first time it's called, and returns those tables the first time and ++ thereafter. This reduces the size of the code by about 2K bytes, in ++ exchange for a little execution time. However, BUILDFIXED should not be ++ used for threaded applications, since the rewriting of the tables and virgin ++ may not be thread-safe. ++ */ ++local void fixedtables(state) ++struct inflate_state FAR *state; ++{ ++#ifdef BUILDFIXED ++ static int virgin = 1; ++ static code *lenfix, *distfix; ++ static code fixed[544]; ++ ++ /* build fixed huffman tables if first call (may not be thread safe) */ ++ if (virgin) { ++ unsigned sym, bits; ++ static code *next; ++ ++ /* literal/length table */ ++ sym = 0; ++ while (sym < 144) state->lens[sym++] = 8; ++ while (sym < 256) state->lens[sym++] = 9; ++ while (sym < 280) state->lens[sym++] = 7; ++ while (sym < 288) state->lens[sym++] = 8; ++ next = fixed; ++ lenfix = next; ++ bits = 9; ++ inflate_table(LENS, state->lens, 288, &(next), &(bits), state->work); ++ ++ /* distance table */ ++ sym = 0; ++ while (sym < 32) state->lens[sym++] = 5; ++ distfix = next; ++ bits = 5; ++ inflate_table(DISTS, state->lens, 32, &(next), &(bits), state->work); ++ ++ /* do this just once */ ++ virgin = 0; ++ } ++#else /* !BUILDFIXED */ ++# include "inffixed.h" ++#endif /* BUILDFIXED */ ++ state->lencode = lenfix; ++ state->lenbits = 9; ++ state->distcode = distfix; ++ state->distbits = 5; ++} ++ ++#ifdef MAKEFIXED ++#include ++ ++/* ++ Write out the inffixed.h that is #include'd above. Defining MAKEFIXED also ++ defines BUILDFIXED, so the tables are built on the fly. makefixed() writes ++ those tables to stdout, which would be piped to inffixed.h. A small program ++ can simply call makefixed to do this: ++ ++ void makefixed(void); ++ ++ int main(void) ++ { ++ makefixed(); ++ return 0; ++ } ++ ++ Then that can be linked with zlib built with MAKEFIXED defined and run: ++ ++ a.out > inffixed.h ++ */ ++void makefixed() ++{ ++ unsigned low, size; ++ struct inflate_state state; ++ ++ fixedtables(&state); ++ puts(" /* inffixed.h -- table for decoding fixed codes"); ++ puts(" * Generated automatically by makefixed()."); ++ puts(" */"); ++ puts(""); ++ puts(" /* WARNING: this file should *not* be used by applications."); ++ puts(" It is part of the implementation of this library and is"); ++ puts(" subject to change. Applications should only use zlib.h."); ++ puts(" */"); ++ puts(""); ++ size = 1U << 9; ++ printf(" static const code lenfix[%u] = {", size); ++ low = 0; ++ for (;;) { ++ if ((low % 7) == 0) printf("\n "); ++ printf("{%u,%u,%d}", (low & 127) == 99 ? 64 : state.lencode[low].op, ++ state.lencode[low].bits, state.lencode[low].val); ++ if (++low == size) break; ++ putchar(','); ++ } ++ puts("\n };"); ++ size = 1U << 5; ++ printf("\n static const code distfix[%u] = {", size); ++ low = 0; ++ for (;;) { ++ if ((low % 6) == 0) printf("\n "); ++ printf("{%u,%u,%d}", state.distcode[low].op, state.distcode[low].bits, ++ state.distcode[low].val); ++ if (++low == size) break; ++ putchar(','); ++ } ++ puts("\n };"); ++} ++#endif /* MAKEFIXED */ ++ ++/* ++ Update the window with the last wsize (normally 32K) bytes written before ++ returning. If window does not exist yet, create it. This is only called ++ when a window is already in use, or when output has been written during this ++ inflate call, but the end of the deflate stream has not been reached yet. ++ It is also called to create a window for dictionary data when a dictionary ++ is loaded. ++ ++ Providing output buffers larger than 32K to inflate() should provide a speed ++ advantage, since only the last 32K of output is copied to the sliding window ++ upon return from inflate(), and since all distances after the first 32K of ++ output will fall in the output data, making match copies simpler and faster. ++ The advantage may be dependent on the size of the processor's data caches. ++ */ ++local int updatewindow(strm, end, copy) ++z_streamp strm; ++const Bytef *end; ++unsigned copy; ++{ ++ struct inflate_state FAR *state; ++ unsigned dist; ++ ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* if it hasn't been done already, allocate space for the window */ ++ if (state->window == Z_NULL) { ++ state->window = (unsigned char FAR *) ++ ZALLOC(strm, 1U << state->wbits, ++ sizeof(unsigned char)); ++ if (state->window == Z_NULL) return 1; ++ } ++ ++ /* if window not in use yet, initialize */ ++ if (state->wsize == 0) { ++ state->wsize = 1U << state->wbits; ++ state->wnext = 0; ++ state->whave = 0; ++ } ++ ++ /* copy state->wsize or less output bytes into the circular window */ ++ if (copy >= state->wsize) { ++ zmemcpy(state->window, end - state->wsize, state->wsize); ++ state->wnext = 0; ++ state->whave = state->wsize; ++ } ++ else { ++ dist = state->wsize - state->wnext; ++ if (dist > copy) dist = copy; ++ zmemcpy(state->window + state->wnext, end - copy, dist); ++ copy -= dist; ++ if (copy) { ++ zmemcpy(state->window, end - copy, copy); ++ state->wnext = copy; ++ state->whave = state->wsize; ++ } ++ else { ++ state->wnext += dist; ++ if (state->wnext == state->wsize) state->wnext = 0; ++ if (state->whave < state->wsize) state->whave += dist; ++ } ++ } ++ return 0; ++} ++ ++/* Macros for inflate(): */ ++ ++/* check function to use adler32() for zlib or crc32() for gzip */ ++#ifdef GUNZIP ++# define UPDATE(check, buf, len) \ ++ (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) ++#else ++# define UPDATE(check, buf, len) adler32(check, buf, len) ++#endif ++ ++/* check macros for header crc */ ++#ifdef GUNZIP ++# define CRC2(check, word) \ ++ do { \ ++ hbuf[0] = (unsigned char)(word); \ ++ hbuf[1] = (unsigned char)((word) >> 8); \ ++ check = crc32(check, hbuf, 2); \ ++ } while (0) ++ ++# define CRC4(check, word) \ ++ do { \ ++ hbuf[0] = (unsigned char)(word); \ ++ hbuf[1] = (unsigned char)((word) >> 8); \ ++ hbuf[2] = (unsigned char)((word) >> 16); \ ++ hbuf[3] = (unsigned char)((word) >> 24); \ ++ check = crc32(check, hbuf, 4); \ ++ } while (0) ++#endif ++ ++/* Load registers with state in inflate() for speed */ ++#define LOAD() \ ++ do { \ ++ put = strm->next_out; \ ++ left = strm->avail_out; \ ++ next = strm->next_in; \ ++ have = strm->avail_in; \ ++ hold = state->hold; \ ++ bits = state->bits; \ ++ } while (0) ++ ++/* Restore state from registers in inflate() */ ++#define RESTORE() \ ++ do { \ ++ strm->next_out = put; \ ++ strm->avail_out = left; \ ++ strm->next_in = next; \ ++ strm->avail_in = have; \ ++ state->hold = hold; \ ++ state->bits = bits; \ ++ } while (0) ++ ++/* Clear the input bit accumulator */ ++#define INITBITS() \ ++ do { \ ++ hold = 0; \ ++ bits = 0; \ ++ } while (0) ++ ++/* Get a byte of input into the bit accumulator, or return from inflate() ++ if there is no input available. */ ++#define PULLBYTE() \ ++ do { \ ++ if (have == 0) goto inf_leave; \ ++ have--; \ ++ hold += (unsigned long)(*next++) << bits; \ ++ bits += 8; \ ++ } while (0) ++ ++/* Assure that there are at least n bits in the bit accumulator. If there is ++ not enough available input to do that, then return from inflate(). */ ++#define NEEDBITS(n) \ ++ do { \ ++ while (bits < (unsigned)(n)) \ ++ PULLBYTE(); \ ++ } while (0) ++ ++/* Return the low n bits of the bit accumulator (n < 16) */ ++#define BITS(n) \ ++ ((unsigned)hold & ((1U << (n)) - 1)) ++ ++/* Remove n bits from the bit accumulator */ ++#define DROPBITS(n) \ ++ do { \ ++ hold >>= (n); \ ++ bits -= (unsigned)(n); \ ++ } while (0) ++ ++/* Remove zero to seven bits as needed to go to a byte boundary */ ++#define BYTEBITS() \ ++ do { \ ++ hold >>= bits & 7; \ ++ bits -= bits & 7; \ ++ } while (0) ++ ++/* ++ inflate() uses a state machine to process as much input data and generate as ++ much output data as possible before returning. The state machine is ++ structured roughly as follows: ++ ++ for (;;) switch (state) { ++ ... ++ case STATEn: ++ if (not enough input data or output space to make progress) ++ return; ++ ... make progress ... ++ state = STATEm; ++ break; ++ ... ++ } ++ ++ so when inflate() is called again, the same case is attempted again, and ++ if the appropriate resources are provided, the machine proceeds to the ++ next state. The NEEDBITS() macro is usually the way the state evaluates ++ whether it can proceed or should return. NEEDBITS() does the return if ++ the requested bits are not available. The typical use of the BITS macros ++ is: ++ ++ NEEDBITS(n); ++ ... do something with BITS(n) ... ++ DROPBITS(n); ++ ++ where NEEDBITS(n) either returns from inflate() if there isn't enough ++ input left to load n bits into the accumulator, or it continues. BITS(n) ++ gives the low n bits in the accumulator. When done, DROPBITS(n) drops ++ the low n bits off the accumulator. INITBITS() clears the accumulator ++ and sets the number of available bits to zero. BYTEBITS() discards just ++ enough bits to put the accumulator on a byte boundary. After BYTEBITS() ++ and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. ++ ++ NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return ++ if there is no input available. The decoding of variable length codes uses ++ PULLBYTE() directly in order to pull just enough bytes to decode the next ++ code, and no more. ++ ++ Some states loop until they get enough input, making sure that enough ++ state information is maintained to continue the loop where it left off ++ if NEEDBITS() returns in the loop. For example, want, need, and keep ++ would all have to actually be part of the saved state in case NEEDBITS() ++ returns: ++ ++ case STATEw: ++ while (want < need) { ++ NEEDBITS(n); ++ keep[want++] = BITS(n); ++ DROPBITS(n); ++ } ++ state = STATEx; ++ case STATEx: ++ ++ As shown above, if the next state is also the next case, then the break ++ is omitted. ++ ++ A state may also return if there is not enough output space available to ++ complete that state. Those states are copying stored data, writing a ++ literal byte, and copying a matching string. ++ ++ When returning, a "goto inf_leave" is used to update the total counters, ++ update the check value, and determine whether any progress has been made ++ during that inflate() call in order to return the proper return code. ++ Progress is defined as a change in either strm->avail_in or strm->avail_out. ++ When there is a window, goto inf_leave will update the window with the last ++ output written. If a goto inf_leave occurs in the middle of decompression ++ and there is no window currently, goto inf_leave will create one and copy ++ output to the window for the next call of inflate(). ++ ++ In this implementation, the flush parameter of inflate() only affects the ++ return code (per zlib.h). inflate() always writes as much as possible to ++ strm->next_out, given the space available and the provided input--the effect ++ documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers ++ the allocation of and copying into a sliding window until necessary, which ++ provides the effect documented in zlib.h for Z_FINISH when the entire input ++ stream available. So the only thing the flush parameter actually does is: ++ when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it ++ will return Z_BUF_ERROR if it has not reached the end of the stream. ++ */ ++ ++int ZEXPORT inflate(strm, flush) ++z_streamp strm; ++int flush; ++{ ++ struct inflate_state FAR *state; ++ z_const unsigned char FAR *next; /* next input */ ++ unsigned char FAR *put; /* next output */ ++ unsigned have, left; /* available input and output */ ++ unsigned long hold; /* bit buffer */ ++ unsigned bits; /* bits in bit buffer */ ++ unsigned in, out; /* save starting available input and output */ ++ unsigned copy; /* number of stored or match bytes to copy */ ++ unsigned char FAR *from; /* where to copy match bytes from */ ++ code here; /* current decoding table entry */ ++ code last; /* parent table entry */ ++ unsigned len; /* length to copy for repeats, bits to drop */ ++ int ret; /* return code */ ++#ifdef GUNZIP ++ unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ ++#endif ++ static const unsigned short order[19] = /* permutation of code lengths */ ++ {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; ++ ++ if (inflateStateCheck(strm) || strm->next_out == Z_NULL || ++ (strm->next_in == Z_NULL && strm->avail_in != 0)) ++ return Z_STREAM_ERROR; ++ ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ ++ LOAD(); ++ in = have; ++ out = left; ++ ret = Z_OK; ++ for (;;) ++ switch (state->mode) { ++ case HEAD: ++ if (state->wrap == 0) { ++ state->mode = TYPEDO; ++ break; ++ } ++ NEEDBITS(16); ++#ifdef GUNZIP ++ if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ ++ if (state->wbits == 0) ++ state->wbits = 15; ++ state->check = crc32(0L, Z_NULL, 0); ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = FLAGS; ++ break; ++ } ++ state->flags = 0; /* expect zlib header */ ++ if (state->head != Z_NULL) ++ state->head->done = -1; ++ if (!(state->wrap & 1) || /* check if zlib header allowed */ ++#else ++ if ( ++#endif ++ ((BITS(8) << 8) + (hold >> 8)) % 31) { ++ strm->msg = (char *)"incorrect header check"; ++ state->mode = BAD; ++ break; ++ } ++ if (BITS(4) != Z_DEFLATED) { ++ strm->msg = (char *)"unknown compression method"; ++ state->mode = BAD; ++ break; ++ } ++ DROPBITS(4); ++ len = BITS(4) + 8; ++ if (state->wbits == 0) ++ state->wbits = len; ++ if (len > 15 || len > state->wbits) { ++ strm->msg = (char *)"invalid window size"; ++ state->mode = BAD; ++ break; ++ } ++ state->dmax = 1U << len; ++ Tracev((stderr, "inflate: zlib header ok\n")); ++ strm->adler = state->check = adler32(0L, Z_NULL, 0); ++ state->mode = hold & 0x200 ? DICTID : TYPE; ++ INITBITS(); ++ break; ++#ifdef GUNZIP ++ case FLAGS: ++ NEEDBITS(16); ++ state->flags = (int)(hold); ++ if ((state->flags & 0xff) != Z_DEFLATED) { ++ strm->msg = (char *)"unknown compression method"; ++ state->mode = BAD; ++ break; ++ } ++ if (state->flags & 0xe000) { ++ strm->msg = (char *)"unknown header flags set"; ++ state->mode = BAD; ++ break; ++ } ++ if (state->head != Z_NULL) ++ state->head->text = (int)((hold >> 8) & 1); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = TIME; ++ case TIME: ++ NEEDBITS(32); ++ if (state->head != Z_NULL) ++ state->head->time = hold; ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC4(state->check, hold); ++ INITBITS(); ++ state->mode = OS; ++ case OS: ++ NEEDBITS(16); ++ if (state->head != Z_NULL) { ++ state->head->xflags = (int)(hold & 0xff); ++ state->head->os = (int)(hold >> 8); ++ } ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ state->mode = EXLEN; ++ case EXLEN: ++ if (state->flags & 0x0400) { ++ NEEDBITS(16); ++ state->length = (unsigned)(hold); ++ if (state->head != Z_NULL) ++ state->head->extra_len = (unsigned)hold; ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ CRC2(state->check, hold); ++ INITBITS(); ++ } ++ else if (state->head != Z_NULL) ++ state->head->extra = Z_NULL; ++ state->mode = EXTRA; ++ case EXTRA: ++ if (state->flags & 0x0400) { ++ copy = state->length; ++ if (copy > have) copy = have; ++ if (copy) { ++ if (state->head != Z_NULL && ++ state->head->extra != Z_NULL) { ++ len = state->head->extra_len - state->length; ++ zmemcpy(state->head->extra + len, next, ++ len + copy > state->head->extra_max ? ++ state->head->extra_max - len : copy); ++ } ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ state->length -= copy; ++ } ++ if (state->length) goto inf_leave; ++ } ++ state->length = 0; ++ state->mode = NAME; ++ case NAME: ++ if (state->flags & 0x0800) { ++ if (have == 0) goto inf_leave; ++ copy = 0; ++ do { ++ len = (unsigned)(next[copy++]); ++ if (state->head != Z_NULL && ++ state->head->name != Z_NULL && ++ state->length < state->head->name_max) ++ state->head->name[state->length++] = (Bytef)len; ++ } while (len && copy < have); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ if (len) goto inf_leave; ++ } ++ else if (state->head != Z_NULL) ++ state->head->name = Z_NULL; ++ state->length = 0; ++ state->mode = COMMENT; ++ case COMMENT: ++ if (state->flags & 0x1000) { ++ if (have == 0) goto inf_leave; ++ copy = 0; ++ do { ++ len = (unsigned)(next[copy++]); ++ if (state->head != Z_NULL && ++ state->head->comment != Z_NULL && ++ state->length < state->head->comm_max) ++ state->head->comment[state->length++] = (Bytef)len; ++ } while (len && copy < have); ++ if ((state->flags & 0x0200) && (state->wrap & 4)) ++ state->check = crc32(state->check, next, copy); ++ have -= copy; ++ next += copy; ++ if (len) goto inf_leave; ++ } ++ else if (state->head != Z_NULL) ++ state->head->comment = Z_NULL; ++ state->mode = HCRC; ++ case HCRC: ++ if (state->flags & 0x0200) { ++ NEEDBITS(16); ++ if ((state->wrap & 4) && hold != (state->check & 0xffff)) { ++ strm->msg = (char *)"header crc mismatch"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ } ++ if (state->head != Z_NULL) { ++ state->head->hcrc = (int)((state->flags >> 9) & 1); ++ state->head->done = 1; ++ } ++ strm->adler = state->check = crc32(0L, Z_NULL, 0); ++ state->mode = TYPE; ++ break; ++#endif ++ case DICTID: ++ NEEDBITS(32); ++ strm->adler = state->check = ZSWAP32(hold); ++ INITBITS(); ++ state->mode = DICT; ++ case DICT: ++ if (state->havedict == 0) { ++ RESTORE(); ++ return Z_NEED_DICT; ++ } ++ strm->adler = state->check = adler32(0L, Z_NULL, 0); ++ state->mode = TYPE; ++ case TYPE: ++ if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave; ++ case TYPEDO: ++ if (state->last) { ++ BYTEBITS(); ++ state->mode = CHECK; ++ break; ++ } ++ NEEDBITS(3); ++ state->last = BITS(1); ++ DROPBITS(1); ++ switch (BITS(2)) { ++ case 0: /* stored block */ ++ Tracev((stderr, "inflate: stored block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = STORED; ++ break; ++ case 1: /* fixed block */ ++ fixedtables(state); ++ Tracev((stderr, "inflate: fixed codes block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = LEN_; /* decode codes */ ++ if (flush == Z_TREES) { ++ DROPBITS(2); ++ goto inf_leave; ++ } ++ break; ++ case 2: /* dynamic block */ ++ Tracev((stderr, "inflate: dynamic codes block%s\n", ++ state->last ? " (last)" : "")); ++ state->mode = TABLE; ++ break; ++ case 3: ++ strm->msg = (char *)"invalid block type"; ++ state->mode = BAD; ++ } ++ DROPBITS(2); ++ break; ++ case STORED: ++ BYTEBITS(); /* go to byte boundary */ ++ NEEDBITS(32); ++ if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { ++ strm->msg = (char *)"invalid stored block lengths"; ++ state->mode = BAD; ++ break; ++ } ++ state->length = (unsigned)hold & 0xffff; ++ Tracev((stderr, "inflate: stored length %u\n", ++ state->length)); ++ INITBITS(); ++ state->mode = COPY_; ++ if (flush == Z_TREES) goto inf_leave; ++ case COPY_: ++ state->mode = COPY; ++ case COPY: ++ copy = state->length; ++ if (copy) { ++ if (copy > have) copy = have; ++ if (copy > left) copy = left; ++ if (copy == 0) goto inf_leave; ++ zmemcpy(put, next, copy); ++ have -= copy; ++ next += copy; ++ left -= copy; ++ put += copy; ++ state->length -= copy; ++ break; ++ } ++ Tracev((stderr, "inflate: stored end\n")); ++ state->mode = TYPE; ++ break; ++ case TABLE: ++ NEEDBITS(14); ++ state->nlen = BITS(5) + 257; ++ DROPBITS(5); ++ state->ndist = BITS(5) + 1; ++ DROPBITS(5); ++ state->ncode = BITS(4) + 4; ++ DROPBITS(4); ++#ifndef PKZIP_BUG_WORKAROUND ++ if (state->nlen > 286 || state->ndist > 30) { ++ strm->msg = (char *)"too many length or distance symbols"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ Tracev((stderr, "inflate: table sizes ok\n")); ++ state->have = 0; ++ state->mode = LENLENS; ++ case LENLENS: ++ while (state->have < state->ncode) { ++ NEEDBITS(3); ++ state->lens[order[state->have++]] = (unsigned short)BITS(3); ++ DROPBITS(3); ++ } ++ while (state->have < 19) ++ state->lens[order[state->have++]] = 0; ++ state->next = state->codes; ++ state->lencode = (const code FAR *)(state->next); ++ state->lenbits = 7; ++ ret = inflate_table(CODES, state->lens, 19, &(state->next), ++ &(state->lenbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid code lengths set"; ++ state->mode = BAD; ++ break; ++ } ++ Tracev((stderr, "inflate: code lengths ok\n")); ++ state->have = 0; ++ state->mode = CODELENS; ++ case CODELENS: ++ while (state->have < state->nlen + state->ndist) { ++ for (;;) { ++ here = state->lencode[BITS(state->lenbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if (here.val < 16) { ++ DROPBITS(here.bits); ++ state->lens[state->have++] = here.val; ++ } ++ else { ++ if (here.val == 16) { ++ NEEDBITS(here.bits + 2); ++ DROPBITS(here.bits); ++ if (state->have == 0) { ++ strm->msg = (char *)"invalid bit length repeat"; ++ state->mode = BAD; ++ break; ++ } ++ len = state->lens[state->have - 1]; ++ copy = 3 + BITS(2); ++ DROPBITS(2); ++ } ++ else if (here.val == 17) { ++ NEEDBITS(here.bits + 3); ++ DROPBITS(here.bits); ++ len = 0; ++ copy = 3 + BITS(3); ++ DROPBITS(3); ++ } ++ else { ++ NEEDBITS(here.bits + 7); ++ DROPBITS(here.bits); ++ len = 0; ++ copy = 11 + BITS(7); ++ DROPBITS(7); ++ } ++ if (state->have + copy > state->nlen + state->ndist) { ++ strm->msg = (char *)"invalid bit length repeat"; ++ state->mode = BAD; ++ break; ++ } ++ while (copy--) ++ state->lens[state->have++] = (unsigned short)len; ++ } ++ } ++ ++ /* handle error breaks in while */ ++ if (state->mode == BAD) break; ++ ++ /* check for end-of-block code (better have one) */ ++ if (state->lens[256] == 0) { ++ strm->msg = (char *)"invalid code -- missing end-of-block"; ++ state->mode = BAD; ++ break; ++ } ++ ++ /* build code tables -- note: do not change the lenbits or distbits ++ values here (9 and 6) without reading the comments in inftrees.h ++ concerning the ENOUGH constants, which depend on those values */ ++ state->next = state->codes; ++ state->lencode = (const code FAR *)(state->next); ++ state->lenbits = 9; ++ ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), ++ &(state->lenbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid literal/lengths set"; ++ state->mode = BAD; ++ break; ++ } ++ state->distcode = (const code FAR *)(state->next); ++ state->distbits = 6; ++ ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, ++ &(state->next), &(state->distbits), state->work); ++ if (ret) { ++ strm->msg = (char *)"invalid distances set"; ++ state->mode = BAD; ++ break; ++ } ++ Tracev((stderr, "inflate: codes ok\n")); ++ state->mode = LEN_; ++ if (flush == Z_TREES) goto inf_leave; ++ case LEN_: ++ state->mode = LEN; ++ case LEN: ++ if (have >= 6 && left >= 258) { ++ RESTORE(); ++ inflate_fast(strm, out); ++ LOAD(); ++ if (state->mode == TYPE) ++ state->back = -1; ++ break; ++ } ++ state->back = 0; ++ for (;;) { ++ here = state->lencode[BITS(state->lenbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if (here.op && (here.op & 0xf0) == 0) { ++ last = here; ++ for (;;) { ++ here = state->lencode[last.val + ++ (BITS(last.bits + last.op) >> last.bits)]; ++ if ((unsigned)(last.bits + here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ DROPBITS(last.bits); ++ state->back += last.bits; ++ } ++ DROPBITS(here.bits); ++ state->back += here.bits; ++ state->length = (unsigned)here.val; ++ if ((int)(here.op) == 0) { ++ Tracevv((stderr, here.val >= 0x20 && here.val < 0x7f ? ++ "inflate: literal '%c'\n" : ++ "inflate: literal 0x%02x\n", here.val)); ++ state->mode = LIT; ++ break; ++ } ++ if (here.op & 32) { ++ Tracevv((stderr, "inflate: end of block\n")); ++ state->back = -1; ++ state->mode = TYPE; ++ break; ++ } ++ if (here.op & 64) { ++ strm->msg = (char *)"invalid literal/length code"; ++ state->mode = BAD; ++ break; ++ } ++ state->extra = (unsigned)(here.op) & 15; ++ state->mode = LENEXT; ++ case LENEXT: ++ if (state->extra) { ++ NEEDBITS(state->extra); ++ state->length += BITS(state->extra); ++ DROPBITS(state->extra); ++ state->back += state->extra; ++ } ++ Tracevv((stderr, "inflate: length %u\n", state->length)); ++ state->was = state->length; ++ state->mode = DIST; ++ case DIST: ++ for (;;) { ++ here = state->distcode[BITS(state->distbits)]; ++ if ((unsigned)(here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ if ((here.op & 0xf0) == 0) { ++ last = here; ++ for (;;) { ++ here = state->distcode[last.val + ++ (BITS(last.bits + last.op) >> last.bits)]; ++ if ((unsigned)(last.bits + here.bits) <= bits) break; ++ PULLBYTE(); ++ } ++ DROPBITS(last.bits); ++ state->back += last.bits; ++ } ++ DROPBITS(here.bits); ++ state->back += here.bits; ++ if (here.op & 64) { ++ strm->msg = (char *)"invalid distance code"; ++ state->mode = BAD; ++ break; ++ } ++ state->offset = (unsigned)here.val; ++ state->extra = (unsigned)(here.op) & 15; ++ state->mode = DISTEXT; ++ case DISTEXT: ++ if (state->extra) { ++ NEEDBITS(state->extra); ++ state->offset += BITS(state->extra); ++ DROPBITS(state->extra); ++ state->back += state->extra; ++ } ++#ifdef INFLATE_STRICT ++ if (state->offset > state->dmax) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#endif ++ Tracevv((stderr, "inflate: distance %u\n", state->offset)); ++ state->mode = MATCH; ++ case MATCH: ++ if (left == 0) goto inf_leave; ++ copy = out - left; ++ if (state->offset > copy) { /* copy from window */ ++ copy = state->offset - copy; ++ if (copy > state->whave) { ++ if (state->sane) { ++ strm->msg = (char *)"invalid distance too far back"; ++ state->mode = BAD; ++ break; ++ } ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ Trace((stderr, "inflate.c too far\n")); ++ copy -= state->whave; ++ if (copy > state->length) copy = state->length; ++ if (copy > left) copy = left; ++ left -= copy; ++ state->length -= copy; ++ do { ++ *put++ = 0; ++ } while (--copy); ++ if (state->length == 0) state->mode = LEN; ++ break; ++#endif ++ } ++ if (copy > state->wnext) { ++ copy -= state->wnext; ++ from = state->window + (state->wsize - copy); ++ } ++ else ++ from = state->window + (state->wnext - copy); ++ if (copy > state->length) copy = state->length; ++ } ++ else { /* copy from output */ ++ from = put - state->offset; ++ copy = state->length; ++ } ++ if (copy > left) copy = left; ++ left -= copy; ++ state->length -= copy; ++ do { ++ *put++ = *from++; ++ } while (--copy); ++ if (state->length == 0) state->mode = LEN; ++ break; ++ case LIT: ++ if (left == 0) goto inf_leave; ++ *put++ = (unsigned char)(state->length); ++ left--; ++ state->mode = LEN; ++ break; ++ case CHECK: ++ if (state->wrap) { ++ NEEDBITS(32); ++ out -= left; ++ strm->total_out += out; ++ state->total += out; ++ if ((state->wrap & 4) && out) ++ strm->adler = state->check = ++ UPDATE(state->check, put - out, out); ++ out = left; ++ if ((state->wrap & 4) && ( ++#ifdef GUNZIP ++ state->flags ? hold : ++#endif ++ ZSWAP32(hold)) != state->check) { ++ strm->msg = (char *)"incorrect data check"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ Tracev((stderr, "inflate: check matches trailer\n")); ++ } ++#ifdef GUNZIP ++ state->mode = LENGTH; ++ case LENGTH: ++ if (state->wrap && state->flags) { ++ NEEDBITS(32); ++ if (hold != (state->total & 0xffffffffUL)) { ++ strm->msg = (char *)"incorrect length check"; ++ state->mode = BAD; ++ break; ++ } ++ INITBITS(); ++ Tracev((stderr, "inflate: length matches trailer\n")); ++ } ++#endif ++ state->mode = DONE; ++ case DONE: ++ ret = Z_STREAM_END; ++ goto inf_leave; ++ case BAD: ++ ret = Z_DATA_ERROR; ++ goto inf_leave; ++ case MEM: ++ return Z_MEM_ERROR; ++ case SYNC: ++ default: ++ return Z_STREAM_ERROR; ++ } ++ ++ /* ++ Return from inflate(), updating the total counts and the check value. ++ If there was no progress during the inflate() call, return a buffer ++ error. Call updatewindow() to create and/or update the window state. ++ Note: a memory error from inflate() is non-recoverable. ++ */ ++ inf_leave: ++ RESTORE(); ++ if (state->wsize || (out != strm->avail_out && state->mode < BAD && ++ (state->mode < CHECK || flush != Z_FINISH))) ++ if (updatewindow(strm, strm->next_out, out - strm->avail_out)) { ++ state->mode = MEM; ++ return Z_MEM_ERROR; ++ } ++ in -= strm->avail_in; ++ out -= strm->avail_out; ++ strm->total_in += in; ++ strm->total_out += out; ++ state->total += out; ++ if ((state->wrap & 4) && out) ++ strm->adler = state->check = ++ UPDATE(state->check, strm->next_out - out, out); ++ strm->data_type = (int)state->bits + (state->last ? 64 : 0) + ++ (state->mode == TYPE ? 128 : 0) + ++ (state->mode == LEN_ || state->mode == COPY_ ? 256 : 0); ++ if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) ++ ret = Z_BUF_ERROR; ++ return ret; ++} ++ ++int ZEXPORT inflateEnd(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (inflateStateCheck(strm)) ++ return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->window != Z_NULL) ZFREE(strm, state->window); ++ ZFREE(strm, strm->state); ++ strm->state = Z_NULL; ++ Tracev((stderr, "inflate: end\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateGetDictionary(strm, dictionary, dictLength) ++z_streamp strm; ++Bytef *dictionary; ++uInt *dictLength; ++{ ++ struct inflate_state FAR *state; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ ++ /* copy dictionary */ ++ if (state->whave && dictionary != Z_NULL) { ++ zmemcpy(dictionary, state->window + state->wnext, ++ state->whave - state->wnext); ++ zmemcpy(dictionary + state->whave - state->wnext, ++ state->window, state->wnext); ++ } ++ if (dictLength != Z_NULL) ++ *dictLength = state->whave; ++ return Z_OK; ++} ++ ++int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) ++z_streamp strm; ++const Bytef *dictionary; ++uInt dictLength; ++{ ++ struct inflate_state FAR *state; ++ unsigned long dictid; ++ int ret; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (state->wrap != 0 && state->mode != DICT) ++ return Z_STREAM_ERROR; ++ ++ /* check for correct dictionary identifier */ ++ if (state->mode == DICT) { ++ dictid = adler32(0L, Z_NULL, 0); ++ dictid = adler32(dictid, dictionary, dictLength); ++ if (dictid != state->check) ++ return Z_DATA_ERROR; ++ } ++ ++ /* copy dictionary to window using updatewindow(), which will amend the ++ existing dictionary if appropriate */ ++ ret = updatewindow(strm, dictionary + dictLength, dictLength); ++ if (ret) { ++ state->mode = MEM; ++ return Z_MEM_ERROR; ++ } ++ state->havedict = 1; ++ Tracev((stderr, "inflate: dictionary set\n")); ++ return Z_OK; ++} ++ ++int ZEXPORT inflateGetHeader(strm, head) ++z_streamp strm; ++gz_headerp head; ++{ ++ struct inflate_state FAR *state; ++ ++ /* check state */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; ++ ++ /* save header structure */ ++ state->head = head; ++ head->done = 0; ++ return Z_OK; ++} ++ ++/* ++ Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found ++ or when out of input. When called, *have is the number of pattern bytes ++ found in order so far, in 0..3. On return *have is updated to the new ++ state. If on return *have equals four, then the pattern was found and the ++ return value is how many bytes were read including the last byte of the ++ pattern. If *have is less than four, then the pattern has not been found ++ yet and the return value is len. In the latter case, syncsearch() can be ++ called again with more data and the *have state. *have is initialized to ++ zero for the first call. ++ */ ++local unsigned syncsearch(have, buf, len) ++unsigned FAR *have; ++const unsigned char FAR *buf; ++unsigned len; ++{ ++ unsigned got; ++ unsigned next; ++ ++ got = *have; ++ next = 0; ++ while (next < len && got < 4) { ++ if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) ++ got++; ++ else if (buf[next]) ++ got = 0; ++ else ++ got = 4 - got; ++ next++; ++ } ++ *have = got; ++ return next; ++} ++ ++int ZEXPORT inflateSync(strm) ++z_streamp strm; ++{ ++ unsigned len; /* number of bytes to look at or looked at */ ++ unsigned long in, out; /* temporary to save total_in and total_out */ ++ unsigned char buf[4]; /* to restore bit buffer to byte string */ ++ struct inflate_state FAR *state; ++ ++ /* check parameters */ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; ++ ++ /* if first time, start search in bit buffer */ ++ if (state->mode != SYNC) { ++ state->mode = SYNC; ++ state->hold <<= state->bits & 7; ++ state->bits -= state->bits & 7; ++ len = 0; ++ while (state->bits >= 8) { ++ buf[len++] = (unsigned char)(state->hold); ++ state->hold >>= 8; ++ state->bits -= 8; ++ } ++ state->have = 0; ++ syncsearch(&(state->have), buf, len); ++ } ++ ++ /* search available input */ ++ len = syncsearch(&(state->have), strm->next_in, strm->avail_in); ++ strm->avail_in -= len; ++ strm->next_in += len; ++ strm->total_in += len; ++ ++ /* return no joy or set up to restart inflate() on a new block */ ++ if (state->have != 4) return Z_DATA_ERROR; ++ in = strm->total_in; out = strm->total_out; ++ inflateReset(strm); ++ strm->total_in = in; strm->total_out = out; ++ state->mode = TYPE; ++ return Z_OK; ++} ++ ++/* ++ Returns true if inflate is currently at the end of a block generated by ++ Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP ++ implementation to provide an additional safety check. PPP uses ++ Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored ++ block. When decompressing, PPP checks that at the end of input packet, ++ inflate is waiting for these length bytes. ++ */ ++int ZEXPORT inflateSyncPoint(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ return state->mode == STORED && state->bits == 0; ++} ++ ++int ZEXPORT inflateCopy(dest, source) ++z_streamp dest; ++z_streamp source; ++{ ++ struct inflate_state FAR *state; ++ struct inflate_state FAR *copy; ++ unsigned char FAR *window; ++ unsigned wsize; ++ ++ /* check input */ ++ if (inflateStateCheck(source) || dest == Z_NULL) ++ return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)source->state; ++ ++ /* allocate space */ ++ copy = (struct inflate_state FAR *) ++ ZALLOC(source, 1, sizeof(struct inflate_state)); ++ if (copy == Z_NULL) return Z_MEM_ERROR; ++ window = Z_NULL; ++ if (state->window != Z_NULL) { ++ window = (unsigned char FAR *) ++ ZALLOC(source, 1U << state->wbits, sizeof(unsigned char)); ++ if (window == Z_NULL) { ++ ZFREE(source, copy); ++ return Z_MEM_ERROR; ++ } ++ } ++ ++ /* copy state */ ++ zmemcpy((voidpf)dest, (voidpf)source, sizeof(z_stream)); ++ zmemcpy((voidpf)copy, (voidpf)state, sizeof(struct inflate_state)); ++ copy->strm = dest; ++ if (state->lencode >= state->codes && ++ state->lencode <= state->codes + ENOUGH - 1) { ++ copy->lencode = copy->codes + (state->lencode - state->codes); ++ copy->distcode = copy->codes + (state->distcode - state->codes); ++ } ++ copy->next = copy->codes + (state->next - state->codes); ++ if (window != Z_NULL) { ++ wsize = 1U << state->wbits; ++ zmemcpy(window, state->window, wsize); ++ } ++ copy->window = window; ++ dest->state = (struct internal_state FAR *)copy; ++ return Z_OK; ++} ++ ++int ZEXPORT inflateUndermine(strm, subvert) ++z_streamp strm; ++int subvert; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++#ifdef INFLATE_ALLOW_INVALID_DISTANCE_TOOFAR_ARRR ++ state->sane = !subvert; ++ return Z_OK; ++#else ++ (void)subvert; ++ state->sane = 1; ++ return Z_DATA_ERROR; ++#endif ++} ++ ++int ZEXPORT inflateValidate(strm, check) ++z_streamp strm; ++int check; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) return Z_STREAM_ERROR; ++ state = (struct inflate_state FAR *)strm->state; ++ if (check) ++ state->wrap |= 4; ++ else ++ state->wrap &= ~4; ++ return Z_OK; ++} ++ ++long ZEXPORT inflateMark(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ ++ if (inflateStateCheck(strm)) ++ return -(1L << 16); ++ state = (struct inflate_state FAR *)strm->state; ++ return (long)(((unsigned long)((long)state->back)) << 16) + ++ (state->mode == COPY ? state->length : ++ (state->mode == MATCH ? state->was - state->length : 0)); ++} ++ ++unsigned long ZEXPORT inflateCodesUsed(strm) ++z_streamp strm; ++{ ++ struct inflate_state FAR *state; ++ if (inflateStateCheck(strm)) return (unsigned long)-1; ++ state = (struct inflate_state FAR *)strm->state; ++ return (unsigned long)(state->next - state->codes); ++} + +From 247147654fe5cd11cf15d8dff91440405ea57040 Mon Sep 17 00:00:00 2001 +From: Simon Hosie +Date: Wed, 12 Apr 2017 15:44:21 -0700 +Subject: [PATCH 2/2] Inflate using wider loads and stores + +In inflate_fast() the output pointer always has plenty of room to write. This +means that so long as the target is capable, wide un-aligned loads and stores +can be used to transfer several bytes at once. When the reference distance is +too short simply unroll the data a little to increase the distance. + +Change-Id: I59854eb25d2b1e43561c8a2afaf9175bf10cf674 +--- + contrib/arm/chunkcopy.h | 279 ++++++++++++++++++++++++++++++++++++++++++++++++ + contrib/arm/inffast.c | 96 +++++++---------- + contrib/arm/inflate.c | 22 ++-- + 3 files changed, 335 insertions(+), 62 deletions(-) + create mode 100644 contrib/arm/chunkcopy.h + +diff --git a/contrib/arm/chunkcopy.h b/contrib/arm/chunkcopy.h +new file mode 100644 +index 00000000..2d6fd6f9 +--- /dev/null ++++ b/contrib/arm/chunkcopy.h +@@ -0,0 +1,279 @@ ++/* chunkcopy.h -- fast copies and sets ++ * Copyright (C) 2017 ARM, Inc. ++ * For conditions of distribution and use, see copyright notice in zlib.h ++ */ ++ ++#ifndef CHUNKCOPY_H ++#define CHUNKCOPY_H ++ ++#include "zutil.h" ++#include ++ ++#if __STDC_VERSION__ >= 199901L ++#define Z_RESTRICT restrict ++#else ++#define Z_RESTRICT ++#endif ++ ++typedef uint8x16_t chunkcopy_chunk_t; ++#define CHUNKCOPY_CHUNK_SIZE sizeof(chunkcopy_chunk_t) ++ ++/* ++ Ask the compiler to perform a wide, unaligned load with an machine ++ instruction appropriate for the chunkcopy_chunk_t type. ++ */ ++static inline chunkcopy_chunk_t loadchunk(const unsigned char FAR *s) { ++ chunkcopy_chunk_t c; ++ __builtin_memcpy(&c, s, sizeof(c)); ++ return c; ++} ++ ++/* ++ Ask the compiler to perform a wide, unaligned store with an machine ++ instruction appropriate for the chunkcopy_chunk_t type. ++ */ ++static inline void storechunk(unsigned char FAR *d, chunkcopy_chunk_t c) { ++ __builtin_memcpy(d, &c, sizeof(c)); ++} ++ ++/* ++ Perform a memcpy-like operation, but assume that length is non-zero and that ++ it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE bytes of output even if ++ the length is shorter than this. ++ ++ It also guarantees that it will properly unroll the data if the distance ++ between `out` and `from` is at least CHUNKCOPY_CHUNK_SIZE, which we rely on ++ in chunkcopy_relaxed(). ++ ++ Aside from better memory bus utilisation, this means that short copies ++ (CHUNKCOPY_CHUNK_SIZE bytes or fewer) will fall straight through the loop ++ without iteration, which will hopefully make the branch prediction more ++ reliable. ++ */ ++static inline unsigned char FAR *chunkcopy_core(unsigned char FAR *out, ++ const unsigned char FAR *from, ++ unsigned len) { ++ int bump = (--len % CHUNKCOPY_CHUNK_SIZE) + 1; ++ storechunk(out, loadchunk(from)); ++ out += bump; ++ from += bump; ++ len /= CHUNKCOPY_CHUNK_SIZE; ++ while (len-- > 0) { ++ storechunk(out, loadchunk(from)); ++ out += CHUNKCOPY_CHUNK_SIZE; ++ from += CHUNKCOPY_CHUNK_SIZE; ++ } ++ return out; ++} ++ ++/* ++ Like chunkcopy_core, but avoid writing beyond of legal output. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_core_safe(unsigned char FAR *out, ++ const unsigned char FAR * from, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ if (limit - out < CHUNKCOPY_CHUNK_SIZE) { ++ const unsigned char FAR * Z_RESTRICT rfrom = from; ++ if (len & 8) { __builtin_memcpy(out, rfrom, 8); out += 8; rfrom += 8; } ++ if (len & 4) { __builtin_memcpy(out, rfrom, 4); out += 4; rfrom += 4; } ++ if (len & 2) { __builtin_memcpy(out, rfrom, 2); out += 2; rfrom += 2; } ++ if (len & 1) { *out++ = *rfrom++; } ++ return out; ++ } ++ return chunkcopy_core(out, from, len); ++} ++ ++/* ++ Perform short copies until distance can be rewritten as being at least ++ CHUNKCOPY_CHUNK_SIZE. ++ ++ This assumes that it's OK to overwrite at least the first ++ 2*CHUNKCOPY_CHUNK_SIZE bytes of output even if the copy is shorter than ++ this. This assumption holds within inflate_fast() which starts every ++ iteration with at least 258 bytes of output space available (258 being the ++ maximum length output from a single token; see inffast.c). ++ */ ++static inline unsigned char FAR *chunkunroll_relaxed(unsigned char FAR *out, ++ unsigned FAR *dist, ++ unsigned FAR *len) { ++ const unsigned char FAR *from = out - *dist; ++ while (*dist < *len && *dist < CHUNKCOPY_CHUNK_SIZE) { ++ storechunk(out, loadchunk(from)); ++ out += *dist; ++ *len -= *dist; ++ *dist += *dist; ++ } ++ return out; ++} ++ ++ ++static inline uint8x16_t chunkset_vld1q_dup_u8x8(const unsigned char FAR * Z_RESTRICT from) { ++#if defined(__clang__) || defined(__aarch64__) ++ return vreinterpretq_u8_u64(vld1q_dup_u64((void *)from)); ++#else ++ /* 32-bit GCC uses an alignment hint for vld1q_dup_u64, even when given a ++ * void pointer, so here's an alternate implementation. ++ */ ++ uint8x8_t h = vld1_u8(from); ++ return vcombine_u8(h, h); ++#endif ++} ++ ++/* ++ Perform an overlapping copy which behaves as a memset() operation, but ++ supporting periods other than one, and assume that length is non-zero and ++ that it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE*3 bytes of output ++ even if the length is shorter than this. ++ */ ++static inline unsigned char FAR *chunkset_core(unsigned char FAR *out, ++ unsigned period, ++ unsigned len) { ++ uint8x16_t f; ++ int bump = ((len - 1) % sizeof(f)) + 1; ++ ++ switch (period) { ++ case 1: ++ f = vld1q_dup_u8(out - 1); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ while (len > 0) { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } ++ return out; ++ case 2: ++ f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2))); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = vreinterpretq_u8_u16(vld1q_dup_u16((void *)(out - 2))); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ case 4: ++ f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4))); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = vreinterpretq_u8_u32(vld1q_dup_u32((void *)(out - 4))); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ case 8: ++ f = chunkset_vld1q_dup_u8x8(out - 8); ++ vst1q_u8(out, f); ++ out += bump; ++ len -= bump; ++ if (len > 0) { ++ f = chunkset_vld1q_dup_u8x8(out - 8); ++ do { ++ vst1q_u8(out, f); ++ out += sizeof(f); ++ len -= sizeof(f); ++ } while (len > 0); ++ } ++ return out; ++ } ++ out = chunkunroll_relaxed(out, &period, &len); ++ return chunkcopy_core(out, out - period, len); ++} ++ ++/* ++ Perform a memcpy-like operation, but assume that length is non-zero and that ++ it's OK to overwrite at least CHUNKCOPY_CHUNK_SIZE bytes of output even if ++ the length is shorter than this. ++ ++ Unlike chunkcopy_core() above, no guarantee is made regarding the behaviour ++ of overlapping buffers, regardless of the distance between the pointers. ++ This is reflected in the `restrict`-qualified pointers, allowing the ++ compiler to reorder loads and stores. ++ */ ++static inline unsigned char FAR *chunkcopy_relaxed(unsigned char FAR * Z_RESTRICT out, ++ const unsigned char FAR * Z_RESTRICT from, ++ unsigned len) { ++ return chunkcopy_core(out, from, len); ++} ++ ++/* ++ Like chunkcopy_relaxed, but avoid writing beyond of legal output. ++ ++ Unlike chunkcopy_core_safe() above, no guarantee is made regarding the ++ behaviour of overlapping buffers, regardless of the distance between the ++ pointers. This is reflected in the `restrict`-qualified pointers, allowing ++ the compiler to reorder loads and stores. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_safe(unsigned char FAR *out, ++ const unsigned char FAR * Z_RESTRICT from, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ return chunkcopy_core_safe(out, from, len, limit); ++} ++ ++/* ++ Perform chunky copy within the same buffer, where the source and destination ++ may potentially overlap. ++ ++ Assumes that len > 0 on entry, and that it's safe to write at least ++ CHUNKCOPY_CHUNK_SIZE*3 bytes to the output. ++ */ ++static inline unsigned char FAR *chunkcopy_lapped_relaxed(unsigned char FAR *out, ++ unsigned dist, ++ unsigned len) { ++ if (dist < len && dist < CHUNKCOPY_CHUNK_SIZE) { ++ return chunkset_core(out, dist, len); ++ } ++ return chunkcopy_core(out, out - dist, len); ++} ++ ++/* ++ Behave like chunkcopy_lapped_relaxed, but avoid writing beyond of legal output. ++ ++ Accepts an additional pointer to the end of safe output. A generic safe ++ copy would use (out + len), but it's normally the case that the end of the ++ output buffer is beyond the end of the current copy, and this can still be ++ exploited. ++ */ ++static inline unsigned char FAR *chunkcopy_lapped_safe(unsigned char FAR *out, ++ unsigned dist, ++ unsigned len, ++ unsigned char FAR *limit) { ++ Assert(out + len <= limit, "chunk copy exceeds safety limit"); ++ if (limit - out < CHUNKCOPY_CHUNK_SIZE * 3) { ++ /* TODO: try harder to optimise this */ ++ while (len-- > 0) { ++ *out = *(out - dist); ++ out++; ++ } ++ return out; ++ } ++ return chunkcopy_lapped_relaxed(out, dist, len); ++} ++ ++#undef Z_RESTRICT ++ ++#endif /* CHUNKCOPY_H */ +diff --git a/contrib/arm/inffast.c b/contrib/arm/inffast.c +index 0dbd1dbc..f7f50071 100644 +--- a/contrib/arm/inffast.c ++++ b/contrib/arm/inffast.c +@@ -7,6 +7,7 @@ + #include "inftrees.h" + #include "inflate.h" + #include "inffast.h" ++#include "chunkcopy.h" + + #ifdef ASMINF + # pragma message("Assembler code may have bugs -- use at your own risk") +@@ -57,6 +58,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + unsigned char FAR *out; /* local strm->next_out */ + unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ + unsigned char FAR *end; /* while out < end, enough space available */ ++ unsigned char FAR *limit; /* safety limit for chunky copies */ + #ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ + #endif +@@ -84,12 +86,13 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + out = strm->next_out; + beg = out - (start - strm->avail_out); + end = out + (strm->avail_out - 257); ++ limit = out + strm->avail_out; + #ifdef INFLATE_STRICT + dmax = state->dmax; + #endif + wsize = state->wsize; + whave = state->whave; +- wnext = state->wnext; ++ wnext = (state->wnext == 0 && whave >= wsize) ? wsize : state->wnext; + window = state->window; + hold = state->hold; + bits = state->bits; +@@ -197,70 +200,51 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */ + #endif + } + from = window; +- if (wnext == 0) { /* very common case */ +- from += wsize - op; +- if (op < len) { /* some from window */ +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } ++ if (wnext >= op) { /* contiguous in window */ ++ from += wnext - op; + } +- else if (wnext < op) { /* wrap around window */ +- from += wsize + wnext - op; ++ else { /* wrap around window */ + op -= wnext; ++ from += wsize - op; + if (op < len) { /* some from end of window */ + len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = window; +- if (wnext < len) { /* some from start of window */ +- op = wnext; +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } ++ out = chunkcopy_safe(out, from, op, limit); ++ from = window; /* more from start of window */ ++ op = wnext; ++ /* This (rare) case can create a situation where ++ the first chunkcopy below must be checked. ++ */ + } + } +- else { /* contiguous in window */ +- from += wnext - op; +- if (op < len) { /* some from window */ +- len -= op; +- do { +- *out++ = *from++; +- } while (--op); +- from = out - dist; /* rest from output */ +- } +- } +- while (len > 2) { +- *out++ = *from++; +- *out++ = *from++; +- *out++ = *from++; +- len -= 3; +- } +- if (len) { +- *out++ = *from++; +- if (len > 1) +- *out++ = *from++; ++ if (op < len) { /* still need some from output */ ++ out = chunkcopy_safe(out, from, op, limit); ++ len -= op; ++ /* When dist is small the amount of data that can be ++ copied from the window is also small, and progress ++ towards the dangerous end of the output buffer is ++ also small. This means that for trivial memsets and ++ for chunkunroll_relaxed() a safety check is ++ unnecessary. However, these conditions may not be ++ entered at all, and in that case it's possible that ++ the main copy is near the end. ++ */ ++ out = chunkunroll_relaxed(out, &dist, &len); ++ out = chunkcopy_safe(out, out - dist, len, limit); ++ } else { ++ /* from points to window, so there is no risk of ++ overlapping pointers requiring memset-like behaviour ++ */ ++ out = chunkcopy_safe(out, from, len, limit); + } + } + else { +- from = out - dist; /* copy direct from output */ +- do { /* minimum length is three */ +- *out++ = *from++; +- *out++ = *from++; +- *out++ = *from++; +- len -= 3; +- } while (len > 2); +- if (len) { +- *out++ = *from++; +- if (len > 1) +- *out++ = *from++; +- } ++ /* Whole reference is in range of current output. No ++ range checks are necessary because we start with room ++ for at least 258 bytes of output, so unroll and roundoff ++ operations can write beyond `out+len` so long as they ++ stay within 258 bytes of `out`. ++ */ ++ out = chunkcopy_lapped_relaxed(out, dist, len); + } + } + else if ((op & 64) == 0) { /* 2nd level distance code */ +diff --git a/contrib/arm/inflate.c b/contrib/arm/inflate.c +index ac333e8c..e40322c3 100644 +--- a/contrib/arm/inflate.c ++++ b/contrib/arm/inflate.c +@@ -84,6 +84,7 @@ + #include "inftrees.h" + #include "inflate.h" + #include "inffast.h" ++#include "contrib/arm/chunkcopy.h" + + #ifdef MAKEFIXED + # ifndef BUILDFIXED +@@ -405,10 +406,20 @@ unsigned copy; + + /* if it hasn't been done already, allocate space for the window */ + if (state->window == Z_NULL) { ++ unsigned wsize = 1U << state->wbits; + state->window = (unsigned char FAR *) +- ZALLOC(strm, 1U << state->wbits, ++ ZALLOC(strm, wsize + CHUNKCOPY_CHUNK_SIZE, + sizeof(unsigned char)); + if (state->window == Z_NULL) return 1; ++#ifdef INFLATE_CLEAR_UNUSED_UNDEFINED ++ /* Copies from the overflow portion of this buffer are undefined and ++ may cause analysis tools to raise a warning if we don't initialize ++ it. However, this undefined data overwrites other undefined data ++ and is subsequently either overwritten or left deliberately ++ undefined at the end of decode; so there's really no point. ++ */ ++ memset(state->window + wsize, 0, CHUNKCOPY_CHUNK_SIZE); ++#endif + } + + /* if window not in use yet, initialize */ +@@ -1175,17 +1186,16 @@ int flush; + else + from = state->window + (state->wnext - copy); + if (copy > state->length) copy = state->length; ++ if (copy > left) copy = left; ++ put = chunkcopy_safe(put, from, copy, put + left); + } + else { /* copy from output */ +- from = put - state->offset; + copy = state->length; ++ if (copy > left) copy = left; ++ put = chunkcopy_lapped_safe(put, state->offset, copy, put + left); + } +- if (copy > left) copy = left; + left -= copy; + state->length -= copy; +- do { +- *put++ = *from++; +- } while (--copy); + if (state->length == 0) state->mode = LEN; + break; + case LIT: diff --git a/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch b/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch new file mode 100644 index 000000000..68f317b24 --- /dev/null +++ b/package/libs/zlib/patches/003-attach-sourcefiles-in-patch-002-to-buildsystem.patch @@ -0,0 +1,100 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8e75f66..24d7329 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -95,34 +95,67 @@ set(ZLIB_PUBLIC_HDRS + ${CMAKE_CURRENT_BINARY_DIR}/zconf.h + zlib.h + ) +-set(ZLIB_PRIVATE_HDRS +- crc32.h +- deflate.h +- gzguts.h +- inffast.h +- inffixed.h +- inflate.h +- inftrees.h +- trees.h +- zutil.h +-) +-set(ZLIB_SRCS +- adler32.c +- compress.c +- crc32.c +- deflate.c +- gzclose.c +- gzlib.c +- gzread.c +- gzwrite.c +- inflate.c +- infback.c +- inftrees.c +- inffast.c +- trees.c +- uncompr.c +- zutil.c +-) ++ ++if(ARMv8) ++ set(ZLIB_PRIVATE_HDRS ++ crc32.h ++ deflate.h ++ gzguts.h ++ inffast.h ++ inffixed.h ++ inflate.h ++ inftrees.h ++ trees.h ++ zutil.h ++ contrib/arm/chunkcopy.h ++ ) ++ set(ZLIB_SRCS ++ adler32.c ++ compress.c ++ crc32.c ++ deflate.c ++ gzclose.c ++ gzlib.c ++ gzread.c ++ gzwrite.c ++ infback.c ++ inftrees.c ++ contrib/arm/inflate.c ++ contrib/arm/inffast.c ++ trees.c ++ uncompr.c ++ zutil.c ++ ) ++ else() ++ set(ZLIB_PRIVATE_HDRS ++ crc32.h ++ deflate.h ++ gzguts.h ++ inffast.h ++ inffixed.h ++ inflate.h ++ inftrees.h ++ trees.h ++ zutil.h ++ ) ++ set(ZLIB_SRCS ++ adler32.c ++ compress.c ++ crc32.c ++ deflate.c ++ gzclose.c ++ gzlib.c ++ gzread.c ++ gzwrite.c ++ inflate.c ++ infback.c ++ inftrees.c ++ inffast.c ++ trees.c ++ uncompr.c ++ zutil.c ++ ) ++endif() + + if(NOT MINGW) + set(ZLIB_DLL_SRCS From 229cde62a4c1ab7014a1aeefeb71a85be668a161 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 14:38:15 +0800 Subject: [PATCH 57/95] Merge branch 'master' of https://github.com/lede-project/source --- config/Config-images.in | 49 +- config/Config-kernel.in | 4 +- include/download.mk | 2 +- include/host-build.mk | 7 +- include/image-commands.mk | 22 +- include/image.mk | 20 + include/kernel-version.mk | 10 +- include/kernel.mk | 106 +- include/netfilter.mk | 5 +- include/package-defaults.mk | 2 + include/package-dumpinfo.mk | 4 +- include/package-ipkg.mk | 4 +- include/package.mk | 9 +- include/prereq-build.mk | 32 +- include/site/darwin | 2 + include/site/powerpc64 | 26 + include/target.mk | 8 +- include/toplevel.mk | 9 + include/version.mk | 2 +- package/base-files/Makefile | 16 +- package/base-files/files/bin/config_generate | 7 +- package/base-files/files/etc/config/fstab | 13 - package/base-files/files/etc/init.d/led | 1 + package/base-files/files/etc/profile | 5 +- package/base-files/files/etc/rc.common | 21 +- package/base-files/files/etc/sysctl.conf | 1 + package/base-files/files/lib/functions.sh | 19 +- .../base-files/files/lib/functions/leds.sh | 12 + .../base-files/files/lib/upgrade/common.sh | 36 +- package/base-files/files/lib/upgrade/nand.sh | 25 +- package/base-files/files/lib/upgrade/stage2 | 5 +- package/base-files/files/sbin/sysupgrade | 21 +- package/base-files/files/usr/lib/os-release | 6 +- package/base-files/image-config.in | 7 - .../boot/arm-trusted-firmware-sunxi/Makefile | 52 + package/boot/at91bootstrap/Makefile | 94 + package/boot/at91bootstrap/at91bootstrap.mk | 88 + package/boot/grub2/{common.mk => Makefile} | 41 +- package/boot/grub2/grub2-efi/Makefile | 22 - package/boot/grub2/grub2/Makefile | 33 - .../boot/kobs-ng/patches/001-compile.patch | 3 +- package/boot/rbcfg/Makefile | 2 +- package/boot/rbcfg/src/main.c | 133 +- package/boot/rbcfg/src/rbcfg.h | 8 + package/boot/uboot-at91/Makefile | 56 +- package/boot/uboot-envtools/Makefile | 2 +- package/boot/uboot-envtools/files/ar71xx | 4 + package/boot/uboot-envtools/files/lantiq | 10 +- package/boot/uboot-envtools/files/ramips | 4 +- package/boot/uboot-kirkwood/Makefile | 4 +- .../patches/007-nsa310-uboot-generic.patch | 50 +- .../patches/008-nsa325-uboot-generic.patch | 47 +- .../uboot-kirkwood/patches/110-dockstar.patch | 4 +- .../uboot-kirkwood/patches/120-iconnect.patch | 8 +- .../uboot-kirkwood/patches/130-ib62x0.patch | 2 +- .../patches/140-pogoplug_e02.patch | 2 +- .../patches/150-goflexhome.patch | 5 +- .../patches/200-openwrt-config.patch | 139 +- package/boot/uboot-lantiq/Makefile | 94 +- package/boot/uboot-layerscape-32b/Makefile | 51 - .../boot/uboot-layerscape-armv8_32b/Makefile | 53 + package/boot/uboot-layerscape/Makefile | 33 +- ...add-LEDE-boot-support-in-environment.patch | 51 + ...-add-LEDE-boot-support-in-environmen.patch | 57 + ...-add-LEDE-boot-support-in-environmen.patch | 51 + ...-add-LEDE-boot-support-in-environmen.patch | 58 + ...-add-LEDE-boot-support-in-environmen.patch | 54 + ...m-add-LEDE-boot-support-in-environme.patch | 49 + package/boot/uboot-mvebu/Makefile | 2 + ...og-enable-setexpr-command-by-default.patch | 20 +- ...011-rsa-Fix-build-with-OpenSSL-1.1.x.patch | 153 + ...wbimage-fix-build-with-OpenSSL-1.1.x.patch | 96 + package/boot/uboot-sunxi/Makefile | 88 +- .../patches/002-add-olimex-a13-som.patch | 3 +- .../003-add-theobroma-a31-pangolin.patch | 22 +- .../010-dt-sync-files-with-kernel.patch | 1403 ---- .../011-dt-sync-dts-files-with-kernel.patch | 7211 ----------------- .../012-sun6i-fix-clock_twi_onoff.patch | 38 - .../patches/013-enable-realtek-phy.patch | 24 - .../patches/014-fix-gmac-init.patch | 127 - .../015-fix-2nd-usb-ctrler-on-sun47i.patch | 78 - .../patches/016-spl-print-mmc-slot.patch | 31 - ...17-usb-add-support-for-usb3-vbus-pin.patch | 39 - ...8-usb-specify-vbus-pins-on-orangepis.patch | 31 - ...19-sid-add-efuse-support-for-h3-a83t.patch | 33 - ...-boot-display-board-model-on-startup.patch | 23 - ...t-for-Olimex-A20-OLinuXino-LIME2-eMM.patch | 76 + ...ange-node-name-for-pwrseq-pin-on-Oli.patch | 31 + .../patches/062-A20-improve-gmac-upload.patch | 12 + ...1-sun6i-sync-PLL1-multdiv-with-Boot1.patch | 6 +- .../093-sun6i-fix-PLL-LDO-voltselect.patch | 15 +- .../100-sun6i-alternate-on-UART2.patch | 4 +- .../101-sun6i-support-console-on-UART2.patch | 8 +- ...2-sunxi-make_CONS_INDEX-configurable.patch | 6 +- ...-environment-for-dtc-binary-location.patch | 35 + ...ile-Build-python-libfdt-library-if-n.patch | 89 + ...akefile.lib-Always-have-.-u-boot.dts.patch | 26 + ...ert-Avoid-non-portable-sed-construct.patch | 21 + ...rt-sunxi-Use-binman-for-sunxi-boards.patch | 58 + ...d-device-tree-for-Orange-Pi-R1-board.patch | 182 + .../301-sunxi-add-orangepi-R1-defconfig.patch | 48 + ...nxi-Fix-CONFIG_SUNXI_GMAC-references.patch | 83 + package/boot/uboot-sunxi/uEnv-a64.txt | 5 + package/devel/binutils/Makefile | 1 + package/devel/gdb/Makefile | 11 +- .../devel/gdb/patches/110-shared_libgcc.patch | 12 +- .../120-sigprocmask-invalid-call.patch | 5 - package/devel/strace/Makefile | 6 +- package/devel/valgrind/Makefile | 1 + package/firmware/ath10k-firmware/Makefile | 8 +- package/firmware/ipq-wifi/Makefile | 1 + .../{ => layerscape}/fman-ucode/Makefile | 17 +- package/firmware/layerscape/ls-dpl/Makefile | 58 + package/firmware/layerscape/ls-mc/Makefile | 57 + package/firmware/layerscape/ls-ppa/Makefile | 111 + .../{rcw => layerscape/ls-rcw}/Makefile | 49 +- ...dd-a-python-script-for-byte-swapping.patch | 66 + .../layerscape/ppfe-firmware/Makefile | 52 + package/firmware/linux-firmware/edgeport.mk | 12 + package/firmware/ppfe-firmware/Makefile | 87 - package/firmware/wireless-regdb/Makefile | 31 + ...firmware-file-format-version-code-20.patch | 251 + .../patches/500-world-regd-5GHz.patch | 16 + package/kernel/acx-mac80211/Makefile | 8 +- .../acx-mac80211/patches/100-compat.patch | 16 + package/kernel/ar7-atm/Makefile | 3 +- .../170-bus_id_removal.patch | 19 +- .../180-git_headers_include.patch | 35 +- .../190-2.6.32_proc_fixes.patch | 75 +- .../patches-D7.04.03.00/200-2.6.37_args.patch | 12 +- .../220-3.10-update_proc_code.patch | 124 +- .../patches-D7.04.03.00/240-3.18_fixes.patch | 30 +- .../patches-D7.04.03.00/250-4.1_fixes.patch | 4 +- .../260-fix_function_signatures.patch | 63 + .../170-bus_id_removal.patch | 19 +- .../180-git_headers_include.patch | 35 +- .../190-2.6.32_proc_fixes.patch | 75 +- .../patches-D7.05.01.00/200-2.6.37_args.patch | 12 +- .../220-3.10-update_proc_code.patch | 170 +- .../patches-D7.05.01.00/240-3.18_fixes.patch | 30 +- .../patches-D7.05.01.00/250-4.1_fixes.patch | 4 +- .../260-fix_function_signatures.patch | 63 + package/kernel/ath10k-ct/Makefile | 6 +- package/kernel/avila-wdt/Makefile | 3 +- package/kernel/broadcom-wl/Makefile | 19 +- package/kernel/button-hotplug/Makefile | 3 +- ...-dtc-Update-to-version-with-overlays.patch | 642 ++ package/kernel/gpio-button-hotplug/Makefile | 3 +- package/kernel/gpio-nct5104d/Makefile | 3 +- package/kernel/hwmon-gsc/Makefile | 3 +- package/kernel/i2c-gpio-custom/Makefile | 3 +- package/kernel/kmod-sched-cake/Makefile | 6 +- package/kernel/lantiq/ltq-adsl-mei/Makefile | 4 +- .../kernel/lantiq/ltq-adsl-mei/src/Makefile | 8 +- .../src/{lantiq_mei.c => drv_mei_cpe.c} | 0 package/kernel/lantiq/ltq-atm/Makefile | 15 +- package/kernel/lantiq/ltq-ifxos/Makefile | 4 +- ...ion-failure-from-inclusion-of-wrong-.patch | 59 + package/kernel/lantiq/ltq-ptm/Makefile | 8 + package/kernel/lantiq/ltq-vdsl-mei/Makefile | 2 +- package/kernel/lantiq/ltq-vdsl/Makefile | 2 +- .../ltq-vdsl/patches/110-semaphore-lock.patch | 107 + package/kernel/lantiq/ltq-vmmc/Makefile | 2 +- package/kernel/leds-apu2/Makefile | 3 +- package/kernel/leds-apu2/src/leds-apu2.c | 35 +- package/kernel/linux/modules/crypto.mk | 2 +- package/kernel/linux/modules/other.mk | 6 +- package/kernel/linux/modules/usb.mk | 2 +- package/kernel/mac80211/Makefile | 13 +- .../files/lib/netifd/wireless/mac80211.sh | 12 +- package/kernel/mac80211/files/regdb.txt | 1314 --- .../patches/005-revert-devcoredump.patch | 10 +- .../patches/006-fix-genl-multicast.patch | 10 + .../007-fix-linux-verification-h.patch | 11 + .../patches/008-fix-genl-family-id.patch | 10 + .../patches/050-lib80211_option.patch | 4 +- .../patches/060-no_local_ssb_bcma.patch | 4 +- .../100-remove-cryptoapi-dependencies.patch | 763 +- .../110-mac80211_keep_keys_on_stop_ap.patch | 2 +- .../patches/140-tweak-TSQ-setting.patch | 15 + .../patches/150-disable_addr_notifier.patch | 6 +- .../kernel/mac80211/patches/210-ap_scan.patch | 2 +- ...0211-add-hdrlen-to-ieee80211_tx_data.patch | 4 +- ...80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch | 32 +- ...sable-wake_tx_queue-for-older-device.patch | 2 +- ...h10k-fix-build-errors-with-CONFIG_PM.patch | 72 + ...-fix-recent-bandwidth-conversion-bug.patch | 61 + ...y-free-requested-but-not-started-TX-.patch | 37 + ...key-reinstall-without-changing-anyth.patch | 81 - ...e-constant-time-comparison-with-keys.patch | 33 - ...compare-TKIP-TX-MIC-key-in-reinstall.patch | 73 - .../patches/402-ath_regd_optional.patch | 2 +- .../patches/404-regd_no_assoc_hints.patch | 4 +- .../522-mac80211_configure_antenna_gain.patch | 10 +- .../patches/542-ath9k_debugfs_diag.patch | 2 +- .../549-ath9k_enable_gpio_buttons.patch | 11 +- .../patches/551-ath9k_ubnt_uap_plus_hsr.patch | 10 +- .../602-rt2x00-introduce-rt2x00eeprom.patch | 2 +- .../801-libertas-configure-sysfs-links.patch | 4 +- .../802-libertas-set-wireless-macaddr.patch | 2 +- ...21-ath10k_init_devices_synchronously.patch | 2 +- .../930-ath10k_add_tpt_led_trigger.patch | 4 +- .../936-ath10k-fix-otp-failure-result.patch | 2 +- package/kernel/mwlwifi/Makefile | 6 +- package/kernel/rotary-gpio-custom/Makefile | 3 +- package/kernel/rtc-rv5c386a/Makefile | 3 +- package/kernel/spi-gpio-custom/Makefile | 3 +- package/kernel/w1-gpio-custom/Makefile | 3 +- package/kernel/wrt55agv2-spidevs/Makefile | 3 +- package/{kernel => lean}/shortcut-fe/Makefile | 0 .../{kernel => lean}/shortcut-fe/src/Kconfig | 0 .../{kernel => lean}/shortcut-fe/src/Makefile | 0 .../{kernel => lean}/shortcut-fe/src/README | 0 .../shortcut-fe/src/fast-classifier.c | 0 .../shortcut-fe/src/fast-classifier.h | 0 .../shortcut-fe/src/nl_classifier_test.c | 0 .../{kernel => lean}/shortcut-fe/src/sfe.h | 0 .../shortcut-fe/src/sfe_backport.h | 0 .../{kernel => lean}/shortcut-fe/src/sfe_cm.c | 0 .../{kernel => lean}/shortcut-fe/src/sfe_cm.h | 0 .../shortcut-fe/src/sfe_ipv4.c | 0 .../shortcut-fe/src/sfe_ipv6.c | 0 .../shortcut-fe/src/userspace_example.c | 0 .../patches/001-throw-in-funcdef.patch | 16 +- package/libs/elfutils/Makefile | 3 +- package/libs/gettext-full/Makefile | 1 + package/libs/libevent2/Makefile | 1 + package/libs/libjson-c/Makefile | 1 + package/libs/libnetfilter-conntrack/Makefile | 12 +- package/libs/libnetfilter-queue/Makefile | 8 +- .../patches/100-checksum_computation.patch | 18 +- package/libs/libnftnl/Makefile | 2 +- package/libs/libnl-tiny/src/msg.c | 7 +- package/libs/libnl/Makefile | 16 +- ...-of-strerror_l-if-it-doesn-t-exist-i.patch | 105 - ...ivate-field-in-libnl-pkg-config-file.patch | 30 + ...workaround-to-the-libc-compat.h-copy.patch | 103 + ...ild-enable-building-cli-during-tests.patch | 115 + package/libs/libtool/Makefile | 1 + package/libs/libubox/Makefile | 6 +- package/libs/libunwind/Makefile | 4 +- package/libs/libusb-compat/Makefile | 6 +- package/libs/mbedtls/Makefile | 1 + package/libs/nghttp2/Makefile | 45 + package/libs/openssl/Config.in | 12 +- package/libs/openssl/Makefile | 23 +- .../libs/openssl/patches/150-no_engines.patch | 2 +- package/libs/readline/Makefile | 1 + package/libs/uclient/Makefile | 6 +- package/libs/ustream-ssl/Makefile | 14 +- package/libs/{cyassl => wolfssl}/Config.in | 26 +- package/libs/{cyassl => wolfssl}/Makefile | 53 +- .../wolfssl/patches/001-CVE-2017-13099.patch | 144 + .../patches/100-disable-hardening-check.patch | 11 + .../400-additional_compatibility.patch | 0 package/network/config/firewall/Makefile | 6 +- package/network/config/gre/Makefile | 2 +- package/network/config/gre/files/gre.sh | 2 +- package/network/config/ltq-adsl-app/Makefile | 11 +- .../config/ltq-adsl-app/files/10-adsl_rename | 7 + .../config/ltq-adsl-app/files/10_atm.sh | 31 + .../config/ltq-adsl-app/files/10_ptm.sh | 29 + .../config/ltq-adsl-app/files/dsl_control | 17 +- .../100-add-more-script-notifications.patch | 42 + package/network/config/ltq-vdsl-app/Makefile | 5 +- .../config/ltq-vdsl-app/files/10-xdsl_rename | 7 + .../config/ltq-vdsl-app/files/dsl_control | 4 +- package/network/config/netifd/Makefile | 6 +- .../netifd/files/lib/netifd/dhcp.script | 10 +- .../netifd/files/lib/netifd/proto/dhcp.sh | 1 + package/network/services/dropbear/Config.in | 9 + package/network/services/dropbear/Makefile | 11 +- .../patches/120-openwrt_options.patch | 6 +- package/network/services/hostapd/Makefile | 3 +- .../network/services/hostapd/files/hostapd.sh | 55 +- .../hostapd/files/wpa_supplicant-full.config | 4 +- .../hostapd/files/wpa_supplicant-mini.config | 4 +- .../hostapd/files/wpa_supplicant-p2p.config | 4 +- ...leep-Mode-Request-in-wnm_sleep_mode-.patch | 35 + ...dd-new-config-params-to-be-used-with.patch | 6 +- .../462-wpa_s-support-htmode-param.patch | 156 - .../patches/463-add-mcast_rate-to-11s.patch | 68 + .../patches/464-fix-mesh-obss-check.patch | 19 + .../hostapd/patches/600-ubus_support.patch | 54 +- package/network/services/igmpproxy/Makefile | 2 +- .../services/igmpproxy/files/igmpproxy.init | 4 + package/network/services/ipset-dns/Makefile | 6 +- .../patches/100-simultaneous-ipv4-ipv6.patch | 57 - package/network/services/lldpd/Makefile | 4 +- package/network/services/odhcpd/Makefile | 94 +- .../services/odhcpd/files/odhcpd.defaults | 19 +- package/network/services/openvpn/Makefile | 10 +- .../services/openvpn/files/openvpn.init | 53 +- .../services/openvpn/files/openvpn.options | 1 + .../210-build_always_use_internal_lz4.patch | 83 +- package/network/services/samba36/Makefile | 27 +- .../samba36/patches/029-CVE-2017-15275.patch | 40 + package/network/services/uhttpd/Makefile | 12 +- package/network/services/umdns/Makefile | 6 +- package/network/services/wireguard/Makefile | 115 + .../services/wireguard/files/wireguard.sh | 192 + .../wireguard/patches/100-portability.patch | 18 + package/network/utils/arptables/Makefile | 2 +- package/network/utils/comgt/Makefile | 2 +- package/network/utils/comgt/files/3g.sh | 2 +- package/network/utils/comgt/files/directip.sh | 3 +- .../network/utils/conntrack-tools/Makefile | 13 +- package/network/utils/curl/Config.in | 8 +- package/network/utils/curl/Makefile | 16 +- .../curl/patches/200-no_docs_tests.patch | 16 +- ...bedtls-disable-runtime-version-check.patch | 4 +- package/network/utils/ebtables/Makefile | 2 +- package/network/utils/iperf/Makefile | 13 +- package/network/utils/iperf3/Makefile | 4 +- .../patches/010-fix-openssl-ac-macro.patch | 41 - .../010-iperf-3.3-fix-build-warnings.patch | 300 + .../patches/100-iperf_auth-rsa-header.patch | 17 - package/network/utils/iproute2/Makefile | 38 +- .../utils/iproute2/patches/001-config.patch | 3 +- .../iproute2/patches/004-darwin_fixes.patch | 2 +- .../utils/iproute2/patches/006-no_sctp.patch | 4 +- .../utils/iproute2/patches/007-no_arpd.patch | 6 +- .../utils/iproute2/patches/008-no_netem.patch | 8 +- .../patches/009-keep_libmnl_optional.patch | 11 + .../iproute2/patches/110-extra-ccopts.patch | 2 +- .../iproute2/patches/120-libnetlink-pic.patch | 7 +- ...bc-compat.h-do-not-rely-on-__GLIBC__.patch | 20 +- ...prevent-redefinition-of-struct-ethhd.patch | 28 +- .../utils/iproute2/patches/300-ip_tiny.patch | 43 +- .../patches/900-drop_FAILED_POLICY.patch | 33 +- .../iproute2/patches/950-add-cake-to-tc.patch | 166 +- package/network/utils/ipset/Makefile | 6 +- ...t-reference-to-u_int8_t-with-uint8_t.patch | 25 + package/network/utils/iptables/Makefile | 26 + .../iptables/patches/600-shared-libext.patch | 20 + package/network/utils/iputils/Makefile | 1 + package/network/utils/iw/Makefile | 3 +- package/network/utils/iwinfo/Makefile | 1 + .../network/utils/layerscape/restool/Makefile | 38 + ...ripts-move-shebang-on-the-first-line.patch | 35 + ...ull-path-option-to-dprc-list-command.patch | 151 + ...03-scripts-remove-unnecessary-arrays.patch | 62 + ...scripts-use-restool-full-path-option.patch | 111 + ...e-proper-arithmetic-operation-syntax.patch | 26 + ...cripts-use-strings-instead-of-arrays.patch | 79 + ...-use-Bourne-shell-s-pattern-matching.patch | 126 + ...pts-use-Bourne-shell-instead-of-bash.patch | 32 + ...nd-for-a-improper-sed-substitution-T.patch | 36 + ...pts-use-proper-arithmetic-operations.patch | 44 + ...ompare-strings-with-regexp-expressio.patch | 27 + ...nproc-with-cross-platform-implementa.patch | 27 + package/network/utils/linux-atm/Makefile | 1 + package/network/utils/nftables/Makefile | 4 +- package/network/utils/tcpdump/Makefile | 2 +- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 18 +- package/network/utils/wpan-tools/Makefile | 1 + ...h-fix-compatibility-with-libnl-3.3.0.patch | 44 + .../network/utils/wwan/files/data/0421-03a7 | 4 +- .../network/utils/wwan/files/data/0421-060d | 4 +- .../network/utils/wwan/files/data/0421-060e | 4 +- .../network/utils/wwan/files/data/0421-0612 | 4 +- .../network/utils/wwan/files/data/0421-0619 | 4 +- .../network/utils/wwan/files/data/0421-061e | 4 +- .../network/utils/wwan/files/data/0421-0623 | 4 +- .../network/utils/wwan/files/data/0421-0629 | 4 +- .../network/utils/wwan/files/data/0421-062d | 4 +- .../network/utils/wwan/files/data/0421-062f | 4 +- .../network/utils/wwan/files/data/0421-0638 | 4 +- .../network/utils/wwan/files/data/05c6-0016 | 4 +- .../network/utils/wwan/files/data/05c6-0023 | 2 +- .../network/utils/wwan/files/data/05c6-00a0 | 4 +- .../network/utils/wwan/files/data/05c6-6000 | 2 +- .../network/utils/wwan/files/data/05c6-9000 | 2 +- .../network/utils/wwan/files/data/07d1-3e01 | 2 +- .../network/utils/wwan/files/data/07d1-3e02 | 2 +- .../network/utils/wwan/files/data/07d1-7e11 | 4 +- .../network/utils/wwan/files/data/0af0-6901 | 2 +- .../network/utils/wwan/files/data/0af0-7201 | 2 +- .../network/utils/wwan/files/data/0af0-9200 | 2 +- .../network/utils/wwan/files/data/0b3c-c003 | 2 +- .../network/utils/wwan/files/data/0bdb-1900 | 4 +- .../network/utils/wwan/files/data/0bdb-1902 | 4 +- .../network/utils/wwan/files/data/0bdb-190a | 4 +- .../network/utils/wwan/files/data/0bdb-190d | 4 +- .../network/utils/wwan/files/data/0bdb-1910 | 4 +- .../network/utils/wwan/files/data/0c88-17da | 2 +- .../network/utils/wwan/files/data/0c88-180a | 2 +- .../network/utils/wwan/files/data/0f3d-68aa | 2 +- .../network/utils/wwan/files/data/1004-6124 | 4 +- .../network/utils/wwan/files/data/1004-6141 | 4 +- .../network/utils/wwan/files/data/1004-6157 | 4 +- .../network/utils/wwan/files/data/1004-618f | 2 +- .../network/utils/wwan/files/data/106c-3711 | 4 +- .../network/utils/wwan/files/data/106c-3714 | 4 +- .../network/utils/wwan/files/data/106c-3715 | 4 +- .../network/utils/wwan/files/data/106c-3716 | 4 +- .../network/utils/wwan/files/data/106c-3717 | 4 +- .../network/utils/wwan/files/data/1199-0017 | 2 +- .../network/utils/wwan/files/data/1199-0018 | 2 +- .../network/utils/wwan/files/data/1199-0019 | 2 +- .../network/utils/wwan/files/data/1199-0020 | 2 +- .../network/utils/wwan/files/data/1199-0021 | 2 +- .../network/utils/wwan/files/data/1199-0022 | 2 +- .../network/utils/wwan/files/data/1199-0023 | 2 +- .../network/utils/wwan/files/data/1199-0024 | 2 +- .../network/utils/wwan/files/data/1199-0025 | 2 +- .../network/utils/wwan/files/data/1199-0026 | 2 +- .../network/utils/wwan/files/data/1199-0027 | 2 +- .../network/utils/wwan/files/data/1199-0028 | 2 +- .../network/utils/wwan/files/data/1199-0112 | 2 +- .../network/utils/wwan/files/data/1199-0120 | 2 +- .../network/utils/wwan/files/data/1199-0218 | 2 +- .../network/utils/wwan/files/data/1199-0220 | 2 +- .../network/utils/wwan/files/data/1199-0224 | 2 +- .../network/utils/wwan/files/data/1199-0301 | 2 +- .../network/utils/wwan/files/data/1199-6802 | 2 +- .../network/utils/wwan/files/data/1199-6803 | 2 +- .../network/utils/wwan/files/data/1199-6804 | 2 +- .../network/utils/wwan/files/data/1199-6805 | 2 +- .../network/utils/wwan/files/data/1199-6808 | 2 +- .../network/utils/wwan/files/data/1199-6809 | 2 +- .../network/utils/wwan/files/data/1199-6813 | 2 +- .../network/utils/wwan/files/data/1199-6815 | 2 +- .../network/utils/wwan/files/data/1199-6816 | 2 +- .../network/utils/wwan/files/data/1199-6820 | 2 +- .../network/utils/wwan/files/data/1199-6821 | 2 +- .../network/utils/wwan/files/data/1199-6822 | 2 +- .../network/utils/wwan/files/data/1199-6833 | 2 +- .../network/utils/wwan/files/data/1199-6834 | 2 +- .../network/utils/wwan/files/data/1199-6835 | 2 +- .../network/utils/wwan/files/data/1199-6838 | 2 +- .../network/utils/wwan/files/data/1199-6839 | 2 +- .../network/utils/wwan/files/data/1199-683a | 2 +- .../network/utils/wwan/files/data/1199-683b | 2 +- .../network/utils/wwan/files/data/1199-6850 | 2 +- .../network/utils/wwan/files/data/1199-6851 | 2 +- .../network/utils/wwan/files/data/1199-6852 | 2 +- .../network/utils/wwan/files/data/1199-6853 | 2 +- .../network/utils/wwan/files/data/1199-6855 | 2 +- .../network/utils/wwan/files/data/1199-6856 | 2 +- .../network/utils/wwan/files/data/1199-6859 | 2 +- .../network/utils/wwan/files/data/1199-685a | 2 +- .../network/utils/wwan/files/data/1199-6880 | 2 +- .../network/utils/wwan/files/data/1199-6890 | 2 +- .../network/utils/wwan/files/data/1199-6891 | 2 +- .../network/utils/wwan/files/data/1199-6892 | 2 +- .../network/utils/wwan/files/data/1199-6893 | 2 +- .../network/utils/wwan/files/data/1199-68aa | 2 +- .../network/utils/wwan/files/data/12d1-1035 | 2 +- .../network/utils/wwan/files/data/12d1-1406 | 2 +- .../network/utils/wwan/files/data/12d1-140b | 2 +- .../network/utils/wwan/files/data/12d1-1412 | 2 +- .../network/utils/wwan/files/data/12d1-141b | 2 +- .../network/utils/wwan/files/data/12d1-1433 | 2 +- .../network/utils/wwan/files/data/12d1-1436 | 2 +- .../network/utils/wwan/files/data/12d1-1444 | 2 +- .../network/utils/wwan/files/data/12d1-144e | 2 +- .../network/utils/wwan/files/data/12d1-1464 | 2 +- .../network/utils/wwan/files/data/12d1-1465 | 2 +- .../network/utils/wwan/files/data/12d1-1491 | 2 +- .../network/utils/wwan/files/data/12d1-14a5 | 2 +- .../network/utils/wwan/files/data/12d1-14a8 | 2 +- .../network/utils/wwan/files/data/12d1-14ae | 2 +- .../network/utils/wwan/files/data/12d1-14cb | 2 +- .../network/utils/wwan/files/data/12d1-14cf | 2 +- .../network/utils/wwan/files/data/12d1-1506 | 2 +- .../network/utils/wwan/files/data/12d1-151d | 2 +- .../network/utils/wwan/files/data/12d1-156c | 2 +- .../network/utils/wwan/files/data/12d1-1c05 | 2 +- .../network/utils/wwan/files/data/12d1-1c07 | 2 +- .../network/utils/wwan/files/data/12d1-1c08 | 2 +- .../network/utils/wwan/files/data/12d1-1c10 | 2 +- .../network/utils/wwan/files/data/12d1-1c12 | 2 +- .../network/utils/wwan/files/data/12d1-1c23 | 2 +- .../network/utils/wwan/files/data/1410-1400 | 2 +- .../network/utils/wwan/files/data/1410-1410 | 2 +- .../network/utils/wwan/files/data/1410-1420 | 2 +- .../network/utils/wwan/files/data/1410-1430 | 2 +- .../network/utils/wwan/files/data/1410-1450 | 2 +- .../network/utils/wwan/files/data/1410-2100 | 2 +- .../network/utils/wwan/files/data/1410-2110 | 2 +- .../network/utils/wwan/files/data/1410-2120 | 2 +- .../network/utils/wwan/files/data/1410-2130 | 2 +- .../network/utils/wwan/files/data/1410-2400 | 2 +- .../network/utils/wwan/files/data/1410-2410 | 2 +- .../network/utils/wwan/files/data/1410-2420 | 2 +- .../network/utils/wwan/files/data/1410-4100 | 2 +- .../network/utils/wwan/files/data/1410-4400 | 2 +- .../network/utils/wwan/files/data/1410-6000 | 2 +- .../network/utils/wwan/files/data/1410-6001 | 2 +- .../network/utils/wwan/files/data/1410-6002 | 2 +- .../network/utils/wwan/files/data/1410-6010 | 2 +- .../network/utils/wwan/files/data/1410-7001 | 2 +- .../network/utils/wwan/files/data/1410-7003 | 2 +- .../network/utils/wwan/files/data/1410-7030 | 2 +- .../network/utils/wwan/files/data/1410-7031 | 4 +- .../network/utils/wwan/files/data/1410-7041 | 2 +- .../network/utils/wwan/files/data/1410-7042 | 2 +- .../network/utils/wwan/files/data/1529-3100 | 4 +- .../network/utils/wwan/files/data/16d5-6202 | 2 +- .../network/utils/wwan/files/data/16d5-6501 | 2 +- .../network/utils/wwan/files/data/16d5-6502 | 2 +- .../network/utils/wwan/files/data/16d5-6603 | 4 +- .../network/utils/wwan/files/data/16d5-900d | 4 +- .../network/utils/wwan/files/data/16d8-5141 | 4 +- .../network/utils/wwan/files/data/16d8-5533 | 4 +- .../network/utils/wwan/files/data/16d8-5543 | 4 +- .../network/utils/wwan/files/data/16d8-5553 | 4 +- .../network/utils/wwan/files/data/16d8-6002 | 2 +- .../network/utils/wwan/files/data/16d8-6006 | 2 +- .../network/utils/wwan/files/data/16d8-6522 | 4 +- .../network/utils/wwan/files/data/16d8-6523 | 4 +- .../network/utils/wwan/files/data/16d8-6532 | 4 +- .../network/utils/wwan/files/data/16d8-6533 | 4 +- .../network/utils/wwan/files/data/16d8-6543 | 4 +- .../network/utils/wwan/files/data/16d8-680a | 4 +- .../network/utils/wwan/files/data/19d2-0001 | 2 +- .../network/utils/wwan/files/data/19d2-0015 | 2 +- .../network/utils/wwan/files/data/19d2-0016 | 2 +- .../network/utils/wwan/files/data/19d2-0018 | 2 +- .../network/utils/wwan/files/data/19d2-0022 | 2 +- .../network/utils/wwan/files/data/19d2-0024 | 2 +- .../network/utils/wwan/files/data/19d2-0033 | 2 +- .../network/utils/wwan/files/data/19d2-0037 | 2 +- .../network/utils/wwan/files/data/19d2-0039 | 2 +- .../network/utils/wwan/files/data/19d2-0057 | 2 +- .../network/utils/wwan/files/data/19d2-0064 | 2 +- .../network/utils/wwan/files/data/19d2-0066 | 2 +- .../network/utils/wwan/files/data/19d2-0073 | 2 +- .../network/utils/wwan/files/data/19d2-0079 | 2 +- .../network/utils/wwan/files/data/19d2-0082 | 2 +- .../network/utils/wwan/files/data/19d2-0086 | 2 +- .../network/utils/wwan/files/data/19d2-0091 | 2 +- .../network/utils/wwan/files/data/19d2-0094 | 2 +- .../network/utils/wwan/files/data/19d2-0108 | 2 +- .../network/utils/wwan/files/data/19d2-0116 | 4 +- .../network/utils/wwan/files/data/19d2-0117 | 2 +- .../network/utils/wwan/files/data/19d2-0128 | 2 +- .../network/utils/wwan/files/data/19d2-0142 | 4 +- .../network/utils/wwan/files/data/19d2-0143 | 4 +- .../network/utils/wwan/files/data/19d2-0152 | 2 +- .../network/utils/wwan/files/data/19d2-0170 | 4 +- .../network/utils/wwan/files/data/19d2-1003 | 4 +- .../network/utils/wwan/files/data/19d2-1015 | 4 +- .../network/utils/wwan/files/data/19d2-1172 | 4 +- .../network/utils/wwan/files/data/19d2-1173 | 4 +- .../network/utils/wwan/files/data/19d2-1177 | 4 +- .../network/utils/wwan/files/data/19d2-1181 | 4 +- .../network/utils/wwan/files/data/19d2-1203 | 4 +- .../network/utils/wwan/files/data/19d2-1208 | 4 +- .../network/utils/wwan/files/data/19d2-1211 | 4 +- .../network/utils/wwan/files/data/19d2-1212 | 4 +- .../network/utils/wwan/files/data/19d2-1217 | 4 +- .../network/utils/wwan/files/data/19d2-1218 | 4 +- .../network/utils/wwan/files/data/19d2-1220 | 4 +- .../network/utils/wwan/files/data/19d2-1222 | 4 +- .../network/utils/wwan/files/data/19d2-1512 | 4 +- .../network/utils/wwan/files/data/19d2-1515 | 4 +- .../network/utils/wwan/files/data/19d2-1518 | 4 +- .../network/utils/wwan/files/data/19d2-1519 | 4 +- .../network/utils/wwan/files/data/19d2-1522 | 4 +- .../network/utils/wwan/files/data/19d2-1525 | 4 +- .../network/utils/wwan/files/data/19d2-1527 | 4 +- .../network/utils/wwan/files/data/19d2-1537 | 4 +- .../network/utils/wwan/files/data/19d2-1538 | 4 +- .../network/utils/wwan/files/data/19d2-1544 | 4 +- .../network/utils/wwan/files/data/19d2-2003 | 2 +- .../network/utils/wwan/files/data/19d2-ffdd | 2 +- .../network/utils/wwan/files/data/19d2-ffe4 | 4 +- .../network/utils/wwan/files/data/19d2-ffe9 | 2 +- .../network/utils/wwan/files/data/19d2-fff1 | 2 +- .../network/utils/wwan/files/data/19d2-fffb | 2 +- .../network/utils/wwan/files/data/19d2-fffc | 2 +- .../network/utils/wwan/files/data/19d2-fffd | 2 +- .../network/utils/wwan/files/data/19d2-fffe | 2 +- .../network/utils/wwan/files/data/19d2-ffff | 2 +- .../network/utils/wwan/files/data/1a8d-1002 | 2 +- .../network/utils/wwan/files/data/1a8d-1003 | 2 +- .../network/utils/wwan/files/data/1a8d-1007 | 2 +- .../network/utils/wwan/files/data/1a8d-1009 | 2 +- .../network/utils/wwan/files/data/1a8d-100c | 2 +- .../network/utils/wwan/files/data/1a8d-100d | 2 +- .../network/utils/wwan/files/data/1a8d-2006 | 4 +- .../network/utils/wwan/files/data/1bbb-0000 | 2 +- .../network/utils/wwan/files/data/1bbb-0012 | 4 +- .../network/utils/wwan/files/data/1bbb-0017 | 2 +- .../network/utils/wwan/files/data/1bbb-0052 | 2 +- .../network/utils/wwan/files/data/1bbb-00b7 | 2 +- .../network/utils/wwan/files/data/1bbb-00ca | 4 +- .../network/utils/wwan/files/data/1c9e-6060 | 4 +- .../network/utils/wwan/files/data/1c9e-6061 | 4 +- .../network/utils/wwan/files/data/1c9e-9000 | 4 +- .../network/utils/wwan/files/data/1c9e-9603 | 2 +- .../network/utils/wwan/files/data/1c9e-9605 | 2 +- .../network/utils/wwan/files/data/1c9e-9607 | 2 +- .../network/utils/wwan/files/data/1c9e-9801 | 4 +- .../network/utils/wwan/files/data/1c9e-9900 | 4 +- .../network/utils/wwan/files/data/1e0e-9000 | 2 +- .../network/utils/wwan/files/data/1e0e-9100 | 2 +- .../network/utils/wwan/files/data/1e0e-9200 | 2 +- .../network/utils/wwan/files/data/1e0e-ce16 | 2 +- .../network/utils/wwan/files/data/1e0e-cefe | 4 +- .../network/utils/wwan/files/data/2001-7d00 | 4 +- .../network/utils/wwan/files/data/2001-7d01 | 2 +- .../network/utils/wwan/files/data/2001-7d02 | 2 +- .../network/utils/wwan/files/data/2001-7d03 | 2 +- .../network/utils/wwan/files/data/211f-6801 | 2 +- .../network/utils/wwan/files/data/413c-8114 | 2 +- .../network/utils/wwan/files/data/413c-8115 | 2 +- .../network/utils/wwan/files/data/413c-8116 | 2 +- .../network/utils/wwan/files/data/413c-8117 | 2 +- .../network/utils/wwan/files/data/413c-8118 | 2 +- .../network/utils/wwan/files/data/413c-8128 | 2 +- .../network/utils/wwan/files/data/413c-8129 | 2 +- .../network/utils/wwan/files/data/413c-8133 | 2 +- .../network/utils/wwan/files/data/413c-8134 | 2 +- .../network/utils/wwan/files/data/413c-8135 | 2 +- .../network/utils/wwan/files/data/413c-8136 | 2 +- .../network/utils/wwan/files/data/413c-8137 | 2 +- .../network/utils/wwan/files/data/413c-8138 | 2 +- .../network/utils/wwan/files/data/413c-8147 | 4 +- .../network/utils/wwan/files/data/413c-8180 | 2 +- .../network/utils/wwan/files/data/413c-8181 | 2 +- .../network/utils/wwan/files/data/413c-8182 | 2 +- .../network/utils/wwan/files/data/413c-819b | 2 +- package/network/utils/xtables-addons/Makefile | 10 +- .../patches/201-fix-lua-packetscript.patch | 9 + package/system/fstools/Makefile | 6 +- package/system/opkg/Makefile | 27 +- package/system/procd/Makefile | 14 +- package/system/procd/files/procd.sh | 34 + package/system/rpcd/Makefile | 6 +- package/system/ubox/Makefile | 6 +- package/system/ubus/Makefile | 6 +- package/utils/adb/Makefile | 2 +- package/utils/busybox/Config-defaults.in | 4 +- package/utils/busybox/Makefile | 72 +- .../500-move-traceroute-applets-to-bin.patch | 4 +- .../busybox/patches/600-cve-2017-16544.patch | 35 + package/utils/bzip2/Makefile | 1 + package/utils/e2fsprogs/Makefile | 17 +- package/utils/f2fs-tools/Makefile | 9 +- ...fs-f2fs-segment.c-718-update_sit_ent.patch | 66 - package/utils/fuse/Makefile | 1 + package/utils/k3screenctrl/Makefile | 47 - .../k3screenctrl/files/k3screenctrl.init | 14 - .../010-lua-5.1.3-lnum-full-260308.patch | 47 +- ...2-lnum-fix-ltle-relational-operators.patch | 4 +- .../utils/lua/patches/020-shared_liblua.patch | 2 +- .../utils/lua/patches/050-honor-cflags.patch | 2 +- .../lua/patches/300-opcode_performance.patch | 32 +- package/utils/mdadm/Makefile | 25 +- package/utils/mdadm/files/mdadm.init | 11 +- package/utils/nvram/src/nvram.c | 4 + package/utils/otrx/src/otrx.c | 73 +- package/utils/usbmode/Makefile | 6 +- package/utils/usbutils/Makefile | 8 +- package/utils/util-linux/Makefile | 7 +- .../util-linux/patches/100-use_urandom.patch | 14 + package/utils/xfsprogs/Makefile | 1 + rules.mk | 1 + scripts/brcmImage.pl | 2 +- scripts/config/.gitignore | 6 + scripts/config/Makefile | 57 + scripts/config/images.c | 326 + scripts/config/qconf.cc | 1870 +++++ scripts/config/qconf.h | 330 + scripts/download.pl | 1 + scripts/om-fwupgradecfg-gen.sh | 2 +- scripts/package-metadata.pl | 5 - target/Config.in | 1 + .../apm821xx/base-files/etc/board.d/01_leds | 9 +- .../base-files/etc/board.d/02_network | 9 +- target/linux/apm821xx/base-files/etc/diag.sh | 54 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 +- .../linux/apm821xx/base-files/lib/apm821xx.sh | 43 - .../lib/preinit/01_preinit_do_apm821xx.sh | 9 - .../lib/preinit/05_set_iface_mac_apm821xx | 4 +- .../lib/preinit/05_set_preinit_iface_apm821xx | 2 - .../base-files/lib/preinit/79_move_config | 18 +- .../base-files/lib/upgrade/merakinand.sh | 68 - .../base-files/lib/upgrade/platform.sh | 39 +- .../apm821xx/base-files/lib/upgrade/wdbook.sh | 99 +- target/linux/apm821xx/dts/apollo3g.dtsi | 19 +- .../dts/{MR24.dts => meraki-mr24.dts} | 10 +- .../dts/{MX60.dts => meraki-mx60.dts} | 10 +- .../{wndr4700.dts => netgear-wndr4700.dts} | 8 +- ...apollo3g-duo.dts => wd-mybooklive-duo.dts} | 1 + .../dts/{apollo3g.dts => wd-mybooklive.dts} | 1 + target/linux/apm821xx/image/Makefile | 62 +- target/linux/apm821xx/sata/config-default | 1 + target/linux/arc770/generic/target.mk | 2 +- target/linux/armvirt/64/config-default | 2 +- target/linux/at91/Makefile | 8 +- target/linux/at91/base-files/lib/at91.sh | 6 + target/linux/at91/{config-4.4 => config-4.9} | 36 +- .../files/arch/arm/boot/dts/at91-q5xr5.dts | 2 +- .../at91/files/arch/arm/boot/dts/lmu5000.dts | 2 +- .../at91/files/arch/arm/boot/dts/wb45n.dts | 220 + .../at91/files/arch/arm/boot/dts/wb50n.dts | 117 + .../at91/files/arch/arm/boot/dts/wb50n.dtsi | 205 + .../linux/at91/files/drivers/mtd/at91part.c | 122 - target/linux/at91/image/Makefile | 25 +- .../linux/at91/image/gen_at91_sdcard_img.sh | 33 + target/linux/at91/image/legacy.mk | 22 + target/linux/at91/image/sama5.mk | 91 + target/linux/at91/image/sama5d3.mk | 8 - target/linux/at91/legacy/config-default | 33 - .../100-ARM-at91-build-dtb-for-LMU5000.patch | 2 +- .../101-ARM-at91-build-dtb-for-q5xr5.patch | 2 +- .../102-ARM-at91-build-dtb-for-wb45n.patch | 12 + .../103-ARM-at91-build-dtb-for-wb50n.patch | 12 + target/linux/at91/sama5/config-default | 52 + target/linux/at91/sama5/target.mk | 11 + target/linux/at91/sama5d3/config-default | 20 - target/linux/at91/sama5d3/target.mk | 9 - target/linux/brcm2708/bcm2710/config-4.9 | 1 - .../brcm47xx/base-files/etc/board.d/01_detect | 3 +- target/linux/brcm47xx/image/Makefile | 30 +- .../brcm47xx/image/lzma-loader/src/Makefile | 7 +- .../brcm47xx/image/lzma-loader/src/head.S | 1 + target/linux/cns3xxx/config-4.9 | 6 - .../files/arch/arm/mach-cns3xxx/gpio.c | 6 +- target/linux/gemini/image/Makefile | 18 +- .../011-kbuild-export-SUBARCH.patch | 2 +- ...ypo-in-KPP-dependency-of-CRYPTO_ECDH.patch | 25 + ...ypo-in-KPP-dependency-of-CRYPTO_ECDH.patch | 25 + ...90-net-generalize-napi_complete_done.patch | 2 +- target/linux/generic/config-3.18 | 2 +- target/linux/generic/config-4.14 | 3 +- .../generic/files/drivers/misc/owl-loader.c | 2 +- .../drivers/mtd/mtdsplit/mtdsplit_tplink.c | 12 +- .../generic/files/drivers/net/phy/ar8216.c | 65 +- .../generic/files/drivers/net/phy/ar8216.h | 3 - .../generic/files/drivers/net/phy/ar8327.c | 9 + .../hack-4.14/202-reduce_module_size.patch | 6 +- .../hack-4.14/207-disable-modorder.patch | 4 +- .../211-host_tools_portability.patch | 2 +- .../generic/hack-4.14/220-gc_sections.patch | 6 +- .../generic/hack-4.14/721-phy_packets.patch | 6 +- .../generic/hack-4.14/902-debloat_proc.patch | 6 +- .../hack-4.9/660-fq_codel_defaults.patch | 10 +- .../661-use_fq_codel_by_default.patch | 4 +- .../002-phy_drivers_backport.patch | 56 +- ...-mtd-bcm47xxpart-backports-from-3.20.patch | 2 +- .../044-backport-m25p80-jedec-probe.patch | 2 +- ...gmac-register-napi-before-the-device.patch | 6 +- ...-initialization-on-Northstar-SoCs-co.patch | 40 - ...mac-implement-scatter-gather-support.patch | 2 +- ...enable-Ethernet-core-before-using-it.patch | 6 +- ...Push-rcu_read_lock-unlock-to-callers.patch | 2 +- ...ment-fix-headroom-tests-and-skb-leak.patch | 8 +- ...layfs-fallback-to-readonly-when-full.patch | 2 +- ...ags-FOLL_WRITE-games-from-__get_user.patch | 90 - ...-__arch_swab-16-32-64-when-using-MIP.patch | 53 - ...limit-scanned-flash-area-on-BCM47XX-.patch | 33 - ...part-don-t-fail-because-of-bit-flips.patch | 4 +- ...t_for_moving_ndp_to_end_of_ncm_frame.patch | 22 +- ...ehci-orion-fix-probe-for-GENERIC_PHY.patch | 35 - ...-support-for-Quectel-EC20-Mini-PCIe-.patch | 4 +- ...-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch | 6 +- .../pending-3.18/201-extra_optimization.patch | 4 +- .../pending-3.18/204-module_strip.patch | 16 +- .../550-ubifs-symlink-xattr-support.patch | 2 +- .../pending-3.18/630-packet_socket_type.patch | 16 +- .../653-disable_netlink_trim.patch | 8 +- .../pending-3.18/655-increase_skb_pad.patch | 2 +- .../656-skb_reduce_truesize-helper.patch | 2 +- ...Add-support-for-MAP-E-FMRs-mesh-mode.patch | 26 +- ...urce-specific-default-route-handling.patch | 4 +- ...ng-with-source-address-failed-policy.patch | 20 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 14 +- .../pending-3.18/701-phy_extension.patch | 2 +- .../704-phy-no-genphy-soft-reset.patch | 29 - ...710-phy-add-mdio_register_board_info.patch | 2 +- .../pending-3.18/721-phy_packets.patch | 8 +- .../773-bgmac-add-srab-switch.patch | 4 +- .../811-pci_disable_usb_common_quirks.patch | 8 +- .../pending-3.18/901-debloat_sock_diag.patch | 2 +- .../pending-3.18/902-debloat_proc.patch | 2 +- .../997-device_tree_cmdline.patch | 2 +- .../pending-4.14/201-extra_optimization.patch | 2 +- .../pending-4.14/630-packet_socket_type.patch | 18 +- .../pending-4.14/655-increase_skb_pad.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 10 +- ...T-skip-GRO-for-foreign-MAC-addresses.patch | 10 +- .../pending-4.14/920-mangle_bootargs.patch | 4 +- .../pending-4.4/001-mtdsplit_backport.patch | 11 + .../704-phy-no-genphy-soft-reset.patch | 11 - ...IPS-mm-remove-mips_dma_mapping_error.patch | 32 + ...ove-no-op-dma_map_ops-where-possible.patch | 140 + .../704-phy-no-genphy-soft-reset.patch | 31 - target/linux/imx6/image/Makefile | 7 +- target/linux/kirkwood/image/Makefile | 12 +- target/linux/lantiq/ase/config-default | 9 +- .../lantiq/base-files/etc/board.d/01_leds | 45 +- .../lantiq/base-files/etc/board.d/02_network | 93 +- target/linux/lantiq/base-files/etc/diag.sh | 9 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 2 +- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 16 +- .../etc/uci-defaults/01_led_migration | 25 +- .../etc/uci-defaults/02_migrate_xdsl_iface | 55 + .../lantiq/base-files/lib/functions/lantiq.sh | 12 - .../base-files/lib/functions/lantiq_dsl.sh | 6 +- .../lib/preinit/01_preinit_board.sh | 19 - .../lantiq/base-files/lib/upgrade/platform.sh | 2 +- target/linux/lantiq/config-4.9 | 8 - target/linux/lantiq/dts/ACMP252.dts | 3 +- target/linux/lantiq/dts/ALL0333CJ.dts | 3 +- target/linux/lantiq/dts/ARV4510PW.dts | 3 +- target/linux/lantiq/dts/ARV4518PWR01.dts | 3 +- target/linux/lantiq/dts/ARV4518PWR01A.dts | 3 +- target/linux/lantiq/dts/ARV4519PW.dts | 3 +- target/linux/lantiq/dts/ARV4520PW.dts | 3 +- target/linux/lantiq/dts/ARV4525PW.dts | 3 +- target/linux/lantiq/dts/ARV452CQW.dts | 3 +- target/linux/lantiq/dts/ARV7506PW11.dts | 3 +- target/linux/lantiq/dts/ARV7510PW22.dts | 3 +- target/linux/lantiq/dts/ARV7518PW.dts | 3 +- target/linux/lantiq/dts/ARV7519PW.dts | 3 +- target/linux/lantiq/dts/ARV7519RW22.dts | 3 +- target/linux/lantiq/dts/ARV7525PW.dts | 3 +- target/linux/lantiq/dts/ARV752DPW.dts | 3 +- target/linux/lantiq/dts/ARV752DPW22.dts | 4 +- target/linux/lantiq/dts/ARV8539PW22.dts | 3 +- target/linux/lantiq/dts/ASL56026.dts | 3 +- target/linux/lantiq/dts/BTHOMEHUBV2B.dts | 5 +- target/linux/lantiq/dts/BTHOMEHUBV3A.dts | 5 +- target/linux/lantiq/dts/BTHOMEHUBV5A.dts | 5 +- target/linux/lantiq/dts/DGN1000B.dts | 4 +- target/linux/lantiq/dts/DGN3500.dts | 3 +- target/linux/lantiq/dts/DGN3500B.dts | 3 +- target/linux/lantiq/dts/DM200.dts | 3 +- target/linux/lantiq/dts/EASY50712.dts | 3 +- target/linux/lantiq/dts/EASY50810.dts | 3 + target/linux/lantiq/dts/EASY80920.dtsi | 2 + target/linux/lantiq/dts/EASY80920NAND.dts | 5 +- target/linux/lantiq/dts/EASY80920NOR.dts | 3 +- target/linux/lantiq/dts/EASY88388.dts | 4 +- target/linux/lantiq/dts/EASY88444.dts | 4 +- target/linux/lantiq/dts/EASY98000-base.dtsi | 2 +- target/linux/lantiq/dts/EASY98000NAND.dts | 4 +- target/linux/lantiq/dts/EASY98000NOR.dts | 4 +- target/linux/lantiq/dts/EASY98000SFLASH.dts | 4 +- target/linux/lantiq/dts/EASY98020.dts | 4 +- target/linux/lantiq/dts/EASY98020V18.dts | 4 +- target/linux/lantiq/dts/EASY98021.dts | 4 +- target/linux/lantiq/dts/EASY98035SYNCE.dts | 4 +- .../linux/lantiq/dts/EASY98035SYNCE1588.dts | 4 +- target/linux/lantiq/dts/FALCON-MDU.dts | 2 +- target/linux/lantiq/dts/FALCON-SFP.dts | 2 +- target/linux/lantiq/dts/FRITZ3370.dts | 5 +- target/linux/lantiq/dts/FRITZ7320.dts | 3 +- target/linux/lantiq/dts/FRITZ7360SL.dts | 7 +- target/linux/lantiq/dts/GIGASX76X.dts | 3 +- target/linux/lantiq/dts/H201L.dts | 3 +- target/linux/lantiq/dts/P2601HNFX.dts | 3 +- target/linux/lantiq/dts/P2812HNUF1.dts | 5 +- target/linux/lantiq/dts/P2812HNUF3.dts | 5 +- target/linux/lantiq/dts/P2812HNUFX.dtsi | 2 + target/linux/lantiq/dts/TDW8970.dts | 3 +- target/linux/lantiq/dts/TDW8980.dts | 3 +- target/linux/lantiq/dts/TDW89X0.dtsi | 2 + target/linux/lantiq/dts/VG3503J.dts | 3 +- target/linux/lantiq/dts/VGV7510KW22.dtsi | 4 +- target/linux/lantiq/dts/VGV7510KW22BRN.dts | 3 +- target/linux/lantiq/dts/VGV7510KW22NOR.dts | 3 +- target/linux/lantiq/dts/VGV7519.dtsi | 2 + target/linux/lantiq/dts/VGV7519BRN.dts | 3 +- target/linux/lantiq/dts/VGV7519NOR.dts | 3 +- target/linux/lantiq/dts/VR200v.dts | 3 +- target/linux/lantiq/dts/WBMR.dts | 3 +- target/linux/lantiq/dts/WBMR300.dts | 3 +- target/linux/lantiq/dts/amazonse.dtsi | 1 + target/linux/lantiq/image/Makefile | 345 +- target/linux/lantiq/image/tp-link.mk | 35 +- .../0028-NET-lantiq-various-etop-fixes.patch | 71 +- ...iq-wifi-and-ethernet-eeprom-handling.patch | 2 +- target/linux/lantiq/xrx200/config-default | 26 +- target/linux/lantiq/xrx200/target.mk | 2 +- target/linux/lantiq/xway/config-default | 37 +- target/linux/lantiq/xway/target.mk | 2 +- .../linux/lantiq/xway_legacy/config-default | 8 + target/linux/layerscape/Makefile | 2 +- target/linux/layerscape/armv8_64b/config-4.9 | 1 - target/linux/malta/Makefile | 2 +- target/linux/malta/README | 10 +- target/linux/malta/be/config-default | 6 - target/linux/malta/be64/config-default | 10 +- target/linux/malta/{config-4.4 => config-4.9} | 47 +- target/linux/malta/image/Makefile | 2 +- target/linux/malta/le/config-default | 6 - target/linux/malta/le64/config-default | 10 +- target/linux/mpc85xx/Makefile | 9 +- .../mpc85xx/base-files/etc/board.d/02_network | 5 +- target/linux/mpc85xx/base-files/etc/diag.sh | 13 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 +- .../linux/mpc85xx/base-files/lib/mpc85xx.sh | 30 - .../lib/preinit/01_preinit_do_mpc85xx.sh | 9 - .../lib/preinit/05_set_preinit_iface_mpc85xx | 2 - .../base-files/lib/upgrade/platform.sh | 66 +- target/linux/mpc85xx/config-4.9 | 23 +- .../arch/powerpc/boot/dts/hiveap-330.dts | 228 + .../arch/powerpc/boot/dts/tl-wdr4900-v1.dts | 2 +- .../arch/powerpc/platforms/85xx/hiveap-330.c | 89 + .../powerpc/platforms/85xx/tl_wdr4900_v1.c | 2 +- target/linux/mpc85xx/generic/config-default | 1 + .../{ => generic}/profiles/00-default.mk | 8 +- target/linux/mpc85xx/generic/target.mk | 1 + target/linux/mpc85xx/image/Makefile | 114 +- target/linux/mpc85xx/p1020/config-default | 16 + .../mpc85xx/p1020/profiles/00-default.mk | 15 + target/linux/mpc85xx/p1020/target.mk | 2 +- .../101-powerpc-85xx-hiveap-330-support.patch | 30 + .../102-powerpc-add-cmdline-override.patch | 37 + target/linux/mpc85xx/profiles/tp-link.mk | 16 - target/linux/octeon/config-4.14 | 322 + .../100-ubnt_edgerouter2_support.patch | 31 + .../110-er200-ethernet_probe_order.patch | 34 + .../patches-4.14/160-cmdline-hack.patch | 47 + .../octeon/patches-4.14/170-cisco-hack.patch | 31 + target/linux/omap/Makefile | 2 +- target/linux/omap/config-4.9 | 730 ++ .../001-omap4_pandaboard-wlan_fix.patch | 10 + target/linux/orion/Makefile | 2 +- target/linux/orion/config-4.9 | 246 + .../000-arm_openwrt_machtypes.patch | 8 + .../100-wrt350nv2_openwrt_partition_map.patch | 32 + .../101-wnr854t_partition_map.patch | 25 + .../patches-4.9/200-dt2_board_support.patch | 562 ++ .../patches-4.9/210-wn802t_support.patch | 73 + target/linux/pistachio/config-4.9 | 1 + target/linux/rb532/Makefile | 3 +- .../linux/rb532/base-files/etc/config/network | 1 + target/linux/rb532/{config-4.4 => config-4.9} | 5 +- target/linux/rb532/image/Makefile | 2 +- .../patches-4.4/002-rb532_nand_fixup.patch | 47 - .../001-cmdline_hack.patch | 0 .../004-rb532-fix-partition-info.patch | 2 +- ...overflow-and-tx-underflow-interrupts.patch | 156 + ...actor-rx-descriptor-flags-processing.patch | 110 + .../107-use-NAPI_POLL_WEIGHT.patch | 11 + .../patches-4.9/108-korina-use-gro.patch | 11 + .../109-korina-whitespace-cleanup-2.patch | 135 + .../110-korina-update-authors.patch | 17 + .../patches-4.9/111-korina-version-bump.patch | 13 + .../lib/firmware/brcm/brcmfmac43430-sdio.txt | 53 + target/linux/sunxi/config-4.4 | 549 -- target/linux/sunxi/cortexa53/config-default | 1 - target/linux/sunxi/image/cortex-a7.mk | 21 + target/linux/sunxi/image/cortex-a8.mk | 10 + ...100-clk-sunxi-add-dram-gates-support.patch | 39 - .../101-dt-sun4i-add-dram-gates.patch | 88 - .../102-dt-sun7i-add-dram-gates.patch | 77 - .../103-clk-sunxi-add-h3-clksupport.patch | 180 - .../104-1-dt-sunxi-add-h3-dtsi.patch | 515 -- .../105-phy-use_of_match_node.patch | 218 - .../patches-4.4/106-phy-add-h3-usbphys.patch | 124 - .../107-clk-sunxi-add-h3-usbphy-clocks.patch | 47 - .../110-clk-sunxi-add-ve-for-sun457i.patch | 226 - .../111-1-dt-sun4i-add-ve-clock-module.patch | 32 - .../111-2-dt-sun7i-add-ve-clock-module.patch | 32 - .../115-musb-ignore-vbus-errors.patch | 26 - .../130-pinctrl-sunxi-add-h3-pio.patch | 568 -- .../patches-4.4/131-reset-add-h3-resets.patch | 92 - .../132-dt-sun8i-add-h3-usbclocks.patch | 34 - ...-sun8i-add-usbphy-usbhost-ctrl-nodes.patch | 123 - ...dt-sun8i-orangepiplus-enable-usbhost.patch | 77 - .../135-clk-sunxi-fix-signedness-bug.patch | 25 - ...et-add-of_reset_control_get_by_index.patch | 109 - .../141-reset-fix-of_reset_control_get.patch | 39 - ...reset-use-ENOTSUPP-instead-of-ENOSYS.patch | 87 - ...eset-add-shared-resetcontrol-asserts.patch | 265 - ...lat-support-multiple-reset-ctrllines.patch | 127 - ...lat-support-multiple-reset-ctrllines.patch | 128 - ...50-dt-sun7i-enable-codec-on-pcduino3.patch | 27 - .../200-dt-sun7i-add-lamobo-r1.patch | 330 - ...dd-common-dtsi-file-for-nanopi-SBCs.patch} | 125 +- .../patches-4.9/090-sunxi-mmc-from-4-13.patch | 288 + ...add-support-for-nanopi-m1-plus-board.patch | 168 + target/linux/x86/64/config-default | 3 +- .../x86/base-files/lib/preinit/01_sysinfo | 25 +- target/linux/x86/config-4.14 | 6 +- target/linux/x86/config-4.9 | 68 +- target/linux/x86/geode/config-default | 6 - target/linux/x86/image/Makefile | 121 +- target/linux/x86/image/gen_image_efi.sh | 44 - .../200-pcengines-apu2-reboot.patch | 19 + target/sdk/Makefile | 5 +- toolchain-old/Config.in | 318 - toolchain-old/Makefile | 97 - toolchain-old/binutils/Config.in | 32 - toolchain-old/binutils/Config.version | 16 - toolchain-old/binutils/Makefile | 112 - .../001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch | 36 - .../2.27/300-001_ld_makefile_patch.patch | 22 - .../2.27/300-012_check_ldrunpath_length.patch | 20 - .../400-mips_no_dynamic_linking_sym.patch | 18 - ...e-default-emulation-for-mips64-linux.patch | 37 - .../2.28/300-001_ld_makefile_patch.patch | 22 - .../2.28/300-012_check_ldrunpath_length.patch | 20 - .../400-mips_no_dynamic_linking_sym.patch | 18 - ...e-default-emulation-for-mips64-linux.patch | 37 - .../300-001_ld_makefile_patch.patch | 22 - .../300-012_check_ldrunpath_length.patch | 20 - toolchain-old/fortify-headers/Makefile | 28 - toolchain-old/gcc/Config.in | 78 - toolchain-old/gcc/Config.version | 14 - toolchain-old/gcc/common.mk | 228 - toolchain-old/gcc/exclude-testsuite | 9 - toolchain-old/gcc/files/alternate-arch-cc.in | 3 - toolchain-old/gcc/final/Makefile | 87 - toolchain-old/gcc/initial/Makefile | 36 - toolchain-old/gcc/minimal/Makefile | 29 - .../001-revert_register_mode_search.patch | 65 - .../patches/5.4.0/002-case_insensitive.patch | 14 - .../gcc/patches/5.4.0/010-documentation.patch | 23 - .../patches/5.4.0/020-no-plt-backport.patch | 28 - .../5.4.0/040-fix-mips-ICE-PR-68400.patch | 23 - .../gcc/patches/5.4.0/200-musl_config.patch | 309 - .../gcc/patches/5.4.0/201-musl_arm.patch | 43 - .../gcc/patches/5.4.0/202-musl_mips.patch | 35 - .../gcc/patches/5.4.0/203-musl_powerpc.patch | 209 - .../gcc/patches/5.4.0/204-musl_sh.patch | 39 - .../gcc/patches/5.4.0/205-musl_x86.patch | 41 - .../gcc/patches/5.4.0/206-musl_aarch64.patch | 31 - .../patches/5.4.0/207-musl_fixincludes.patch | 30 - .../patches/5.4.0/209-musl_libstdc++.patch | 72 - .../gcc/patches/5.4.0/230-musl_libssp.patch | 13 - .../patches/5.4.0/240-musl-libitm-fixes.patch | 61 - .../gcc/patches/5.4.0/250-add-musl.patch | 120 - .../5.4.0/260-musl-add-unwind-fix.patch | 34 - .../270-musl-add-powerpc-softfloat-fix.patch | 24 - .../280-musl-disable-ifunc-by-default.patch | 38 - .../300-mips_Os_cpu_rtx_cost_model.patch | 14 - .../5.4.0/800-arm_v5te_no_ldrd_strd.patch | 11 - .../5.4.0/810-arm-softfloat-libgcc.patch | 25 - .../gcc/patches/5.4.0/820-libgcc_pic.patch | 36 - .../5.4.0/830-arm_unbreak_armv4t.patch | 13 - .../5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch | 19 - .../patches/5.4.0/850-use_shared_libgcc.patch | 47 - .../patches/5.4.0/851-libgcc_no_compat.patch | 12 - .../patches/5.4.0/870-ppc_no_crtsavres.patch | 11 - .../patches/5.4.0/880-no_java_section.patch | 11 - .../gcc/patches/5.4.0/881-no_tm_section.patch | 11 - .../patches/5.4.0/900-bad-mips16-crt.patch | 9 - .../gcc/patches/5.4.0/910-mbsd_multi.patch | 222 - .../5.4.0/920-specs_nonfatal_getenv.patch | 15 - .../5.4.0/930-fix-mips-noexecstack.patch | 111 - .../931-fix-MIPS-softfloat-build-issue.patch | 174 - .../5.4.0/940-no-clobber-stamp-bits.patch | 11 - .../5.4.0/950-cpp_file_path_translation.patch | 182 - .../gcc/patches/5.4.0/960-go_libm.patch | 11 - .../gcc/patches/5.4.0/970-warn_bug.patch | 11 - .../001-revert_register_mode_search.patch | 65 - .../patches/6.3.0/002-case_insensitive.patch | 14 - .../gcc/patches/6.3.0/010-documentation.patch | 23 - .../gcc/patches/6.3.0/230-musl_libssp.patch | 13 - .../280-musl-disable-ifunc-by-default.patch | 36 - .../300-mips_Os_cpu_rtx_cost_model.patch | 11 - .../6.3.0/800-arm_v5te_no_ldrd_strd.patch | 11 - .../6.3.0/810-arm-softfloat-libgcc.patch | 25 - .../gcc/patches/6.3.0/820-libgcc_pic.patch | 36 - .../6.3.0/830-arm_unbreak_armv4t.patch | 13 - .../6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch | 19 - .../patches/6.3.0/850-use_shared_libgcc.patch | 47 - .../patches/6.3.0/851-libgcc_no_compat.patch | 12 - .../patches/6.3.0/870-ppc_no_crtsavres.patch | 11 - .../patches/6.3.0/880-no_java_section.patch | 11 - .../gcc/patches/6.3.0/881-no_tm_section.patch | 11 - .../patches/6.3.0/900-bad-mips16-crt.patch | 9 - .../gcc/patches/6.3.0/910-mbsd_multi.patch | 222 - .../6.3.0/920-specs_nonfatal_getenv.patch | 15 - .../6.3.0/930-fix-mips-noexecstack.patch | 111 - .../6.3.0/940-no-clobber-stamp-bits.patch | 11 - .../6.3.0/950-cpp_file_path_translation.patch | 182 - .../patches/6.3.0/960-fix-ubsan-defref.patch | 11 - .../001-revert_register_mode_search.patch | 65 - .../patches/7.1.0/002-case_insensitive.patch | 14 - .../gcc/patches/7.1.0/010-documentation.patch | 23 - .../gcc/patches/7.1.0/230-musl_libssp.patch | 13 - .../300-mips_Os_cpu_rtx_cost_model.patch | 11 - .../7.1.0/800-arm_v5te_no_ldrd_strd.patch | 11 - .../7.1.0/810-arm-softfloat-libgcc.patch | 25 - .../gcc/patches/7.1.0/820-libgcc_pic.patch | 36 - .../7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch | 19 - .../patches/7.1.0/850-use_shared_libgcc.patch | 47 - .../patches/7.1.0/851-libgcc_no_compat.patch | 12 - .../patches/7.1.0/870-ppc_no_crtsavres.patch | 11 - .../gcc/patches/7.1.0/881-no_tm_section.patch | 11 - .../patches/7.1.0/900-bad-mips16-crt.patch | 9 - .../gcc/patches/7.1.0/910-mbsd_multi.patch | 140 - .../7.1.0/920-specs_nonfatal_getenv.patch | 15 - .../7.1.0/930-fix-mips-noexecstack.patch | 111 - .../7.1.0/940-no-clobber-stamp-bits.patch | 11 - .../7.1.0/950-cpp_file_path_translation.patch | 171 - .../001-revert_register_mode_search.patch | 65 - .../002-case_insensitive.patch | 14 - .../010-documentation.patch | 23 - .../arc-2017.03-release/230-musl_libssp.patch | 13 - .../280-musl-disable-ifunc-by-default.patch | 36 - .../300-mips_Os_cpu_rtx_cost_model.patch | 11 - .../800-arm_v5te_no_ldrd_strd.patch | 11 - .../810-arm-softfloat-libgcc.patch | 25 - .../arc-2017.03-release/820-libgcc_pic.patch | 36 - .../830-arm_unbreak_armv4t.patch | 13 - .../840-armv4_pass_fix-v4bx_to_ld.patch | 19 - .../850-use_shared_libgcc.patch | 47 - .../851-libgcc_no_compat.patch | 12 - .../870-ppc_no_crtsavres.patch | 11 - .../880-no_java_section.patch | 11 - .../881-no_tm_section.patch | 11 - .../900-bad-mips16-crt.patch | 9 - .../arc-2017.03-release/910-mbsd_multi.patch | 222 - .../920-specs_nonfatal_getenv.patch | 15 - .../930-fix-mips-noexecstack.patch | 111 - .../940-no-clobber-stamp-bits.patch | 11 - .../950-cpp_file_path_translation.patch | 182 - toolchain-old/gdb/Makefile | 68 - .../patches-arc/100-no_extern_inline.patch | 32 - .../gdb/patches-arc/110-no_testsuite.patch | 21 - .../120-fix-compile-flag-mismatch.patch | 11 - .../gdb/patches/100-no_extern_inline.patch | 32 - .../gdb/patches/110-no_testsuite.patch | 21 - .../120-fix-compile-flag-mismatch.patch | 11 - toolchain-old/glibc/Makefile | 32 - toolchain-old/glibc/common.mk | 94 - toolchain-old/glibc/headers/Makefile | 28 - toolchain-old/glibc/include/libintl.h | 6 - .../glibc/patches/100-fix_cross_rpcgen.patch | 52 - .../patches/200-add-dl-search-paths.patch | 14 - toolchain-old/info.mk | 6 - toolchain-old/kernel-headers/Makefile | 102 - toolchain-old/musl/Makefile | 31 - toolchain-old/musl/common.mk | 62 - toolchain-old/musl/include/bits/wordsize.h | 1 - toolchain-old/musl/include/features.h | 48 - toolchain-old/musl/include/sgidefs.h | 73 - toolchain-old/musl/include/sys/cdefs.h | 378 - toolchain-old/musl/include/sys/glibc-types.h | 35 - toolchain-old/musl/include/sys/queue.h | 574 -- .../musl/patches/100-add_glob_onlydir.patch | 11 - .../patches/110-read_timezone_from_fs.patch | 28 - .../patches/200-add_libssp_nonshared.patch | 50 - toolchain-old/musl/patches/300-relative.patch | 11 - ...ribute-to-some-function-declarations.patch | 197 - .../musl/patches/900-iconv_size_hack.patch | 68 - .../musl/patches/901-crypt_size_hack.patch | 60 - toolchain-old/uClibc/Config.in | 6 - toolchain-old/uClibc/Makefile | 37 - toolchain-old/uClibc/common.mk | 97 - toolchain-old/uClibc/config/arc | 10 - toolchain-old/uClibc/config/archs | 10 - toolchain-old/uClibc/config/arm | 9 - toolchain-old/uClibc/config/armeb | 9 - toolchain-old/uClibc/config/common | 226 - toolchain-old/uClibc/config/debug | 6 - toolchain-old/uClibc/config/i386 | 21 - toolchain-old/uClibc/config/i686 | 21 - toolchain-old/uClibc/config/m68k | 6 - toolchain-old/uClibc/config/mips | 18 - toolchain-old/uClibc/config/mips64 | 18 - toolchain-old/uClibc/config/mips64.32 | 19 - toolchain-old/uClibc/config/mips64.64 | 19 - toolchain-old/uClibc/config/mips64.n32 | 19 - toolchain-old/uClibc/config/mips64el | 18 - toolchain-old/uClibc/config/mips64el.32 | 19 - toolchain-old/uClibc/config/mips64el.64 | 19 - toolchain-old/uClibc/config/mips64el.n32 | 19 - toolchain-old/uClibc/config/mipsel | 18 - toolchain-old/uClibc/config/mipsel.cobalt | 18 - toolchain-old/uClibc/config/powerpc | 6 - toolchain-old/uClibc/config/powerpc.e500 | 6 - toolchain-old/uClibc/config/sparc | 8 - toolchain-old/uClibc/config/sparc.leon | 8 - toolchain-old/uClibc/config/x86_64 | 6 - toolchain-old/uClibc/headers/Makefile | 27 - toolchain-old/uClibc/utils/Makefile | 24 - toolchain-old/wrapper/Makefile | 62 - toolchain-old/yasm/Makefile | 63 - tools/Makefile | 2 - tools/automake/Makefile | 1 + tools/cmake/Makefile | 7 +- .../patches/010-backport-macos-fix.patch | 15 + .../cmake/patches/100-disable_qt_tests.patch | 4 +- ...pat.patch => 110-alpine_musl-compat.patch} | 0 tools/cmake/patches/110-freebsd-compat.patch | 39 - ... 120-libarchive-fix-libressl-compat.patch} | 0 ...ch => 130-curl-fix-libressl-linking.patch} | 23 +- ...=> 140-bootstrap_parallel_make_flag.patch} | 2 +- tools/coreutils/Makefile | 5 +- tools/dosfstools/Makefile | 1 + tools/e2fsprogs/Makefile | 5 +- ...n-compat.patch => 004-darwin-compat.patch} | 0 .../patches/004-freebsd-compat.patch | 12 - .../e2fsprogs/patches/010-old-libmagic.patch | 25 - tools/expat/Makefile | 5 +- tools/findutils/Makefile | 1 + .../patches/100-include_sysmacros.patch | 13 + tools/firmware-utils/Makefile | 5 +- tools/firmware-utils/src/mktplinkfw-lib.c | 265 + tools/firmware-utils/src/mktplinkfw-lib.h | 68 + tools/firmware-utils/src/mktplinkfw.c | 297 +- tools/firmware-utils/src/mktplinkfw2.c | 518 +- tools/firmware-utils/src/otrx.c | 592 ++ tools/firmware-utils/src/ptgen.c | 66 +- tools/firmware-utils/src/tplink-safeloader.c | 67 +- tools/flex/Makefile | 1 + ...SE_SYSTEM_EXTENSIONS-in-configure.ac.patch | 27 + tools/gptfdisk/Makefile | 37 - tools/libtool/Makefile | 1 + tools/m4/Makefile | 1 + tools/mm-macros/Makefile | 4 +- tools/mpfr/Makefile | 5 +- .../patches/120-include_sysmacros.patch | 25 + .../320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch | 6 +- tools/popt/Makefile | 20 - tools/qemu/Makefile | 1 + tools/squashfs/Makefile | 1 + .../patches/130-include_sysmacros.patch | 20 + tools/squashfs4/Makefile | 1 + .../patches/130-include_sysmacros.patch | 20 + ..._support_for_LZMA_MAGIC_to_unsqashfs.patch | 8 +- .../patches/180-openbsd_compat.patch | 2 +- .../patches/190-no_nonstatic_inline.patch | 6 +- .../200-add-fixed-timestamp-option.patch | 16 +- tools/sstrip/src/sstrip.c | 9 +- tools/tar/Makefile | 1 + 1228 files changed, 18795 insertions(+), 30035 deletions(-) create mode 100644 include/site/darwin create mode 100644 include/site/powerpc64 delete mode 100644 package/base-files/files/etc/config/fstab create mode 100644 package/boot/arm-trusted-firmware-sunxi/Makefile create mode 100644 package/boot/at91bootstrap/Makefile create mode 100644 package/boot/at91bootstrap/at91bootstrap.mk rename package/boot/grub2/{common.mk => Makefile} (57%) delete mode 100644 package/boot/grub2/grub2-efi/Makefile delete mode 100644 package/boot/grub2/grub2/Makefile delete mode 100644 package/boot/uboot-layerscape-32b/Makefile create mode 100644 package/boot/uboot-layerscape-armv8_32b/Makefile create mode 100644 package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch create mode 100644 package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch create mode 100644 package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch create mode 100644 package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch delete mode 100644 package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch delete mode 100644 package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch delete mode 100644 package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch delete mode 100644 package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch delete mode 100644 package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch delete mode 100644 package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch delete mode 100644 package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch delete mode 100644 package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch delete mode 100644 package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch delete mode 100644 package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch delete mode 100644 package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch create mode 100644 package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch create mode 100644 package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch create mode 100644 package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch create mode 100644 package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch create mode 100644 package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch create mode 100644 package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch create mode 100644 package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch create mode 100644 package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch create mode 100644 package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch create mode 100644 package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch create mode 100644 package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch create mode 100644 package/boot/uboot-sunxi/uEnv-a64.txt rename package/firmware/{ => layerscape}/fman-ucode/Makefile (79%) create mode 100644 package/firmware/layerscape/ls-dpl/Makefile create mode 100644 package/firmware/layerscape/ls-mc/Makefile create mode 100644 package/firmware/layerscape/ls-ppa/Makefile rename package/firmware/{rcw => layerscape/ls-rcw}/Makefile (56%) create mode 100644 package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch create mode 100644 package/firmware/layerscape/ppfe-firmware/Makefile create mode 100644 package/firmware/linux-firmware/edgeport.mk delete mode 100644 package/firmware/ppfe-firmware/Makefile create mode 100644 package/firmware/wireless-regdb/Makefile create mode 100644 package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch create mode 100644 package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch create mode 100644 package/kernel/acx-mac80211/patches/100-compat.patch create mode 100644 package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch create mode 100644 package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch create mode 100644 package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch rename package/kernel/lantiq/ltq-adsl-mei/src/{lantiq_mei.c => drv_mei_cpe.c} (100%) create mode 100644 package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch create mode 100644 package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch delete mode 100644 package/kernel/mac80211/files/regdb.txt create mode 100644 package/kernel/mac80211/patches/006-fix-genl-multicast.patch create mode 100644 package/kernel/mac80211/patches/007-fix-linux-verification-h.patch create mode 100644 package/kernel/mac80211/patches/008-fix-genl-family-id.patch create mode 100644 package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch create mode 100644 package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch create mode 100644 package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch create mode 100644 package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch delete mode 100644 package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch delete mode 100644 package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch delete mode 100644 package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch rename package/{kernel => lean}/shortcut-fe/Makefile (100%) rename package/{kernel => lean}/shortcut-fe/src/Kconfig (100%) rename package/{kernel => lean}/shortcut-fe/src/Makefile (100%) rename package/{kernel => lean}/shortcut-fe/src/README (100%) rename package/{kernel => lean}/shortcut-fe/src/fast-classifier.c (100%) rename package/{kernel => lean}/shortcut-fe/src/fast-classifier.h (100%) rename package/{kernel => lean}/shortcut-fe/src/nl_classifier_test.c (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe.h (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe_backport.h (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe_cm.c (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe_cm.h (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe_ipv4.c (100%) rename package/{kernel => lean}/shortcut-fe/src/sfe_ipv6.c (100%) rename package/{kernel => lean}/shortcut-fe/src/userspace_example.c (100%) delete mode 100644 package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch create mode 100644 package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch create mode 100644 package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch create mode 100644 package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch create mode 100644 package/libs/nghttp2/Makefile rename package/libs/{cyassl => wolfssl}/Config.in (63%) rename package/libs/{cyassl => wolfssl}/Makefile (65%) create mode 100644 package/libs/wolfssl/patches/001-CVE-2017-13099.patch create mode 100644 package/libs/wolfssl/patches/100-disable-hardening-check.patch rename package/libs/{cyassl => wolfssl}/patches/400-additional_compatibility.patch (100%) create mode 100644 package/network/config/ltq-adsl-app/files/10-adsl_rename create mode 100755 package/network/config/ltq-adsl-app/files/10_atm.sh create mode 100755 package/network/config/ltq-adsl-app/files/10_ptm.sh create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch create mode 100644 package/network/config/ltq-vdsl-app/files/10-xdsl_rename create mode 100644 package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch delete mode 100644 package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch create mode 100644 package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch create mode 100644 package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch delete mode 100644 package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch create mode 100644 package/network/services/samba36/patches/029-CVE-2017-15275.patch create mode 100644 package/network/services/wireguard/Makefile create mode 100644 package/network/services/wireguard/files/wireguard.sh create mode 100644 package/network/services/wireguard/patches/100-portability.patch delete mode 100644 package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch create mode 100644 package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch delete mode 100644 package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch create mode 100644 package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch create mode 100644 package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch create mode 100644 package/network/utils/layerscape/restool/Makefile create mode 100644 package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch create mode 100644 package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch create mode 100644 package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch create mode 100644 package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch create mode 100644 package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch create mode 100644 package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch create mode 100644 package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch create mode 100644 package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch create mode 100644 package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch create mode 100644 package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch create mode 100644 package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch create mode 100644 package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch create mode 100644 package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch create mode 100644 package/utils/busybox/patches/600-cve-2017-16544.patch delete mode 100644 package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch delete mode 100644 package/utils/k3screenctrl/Makefile delete mode 100755 package/utils/k3screenctrl/files/k3screenctrl.init create mode 100644 package/utils/util-linux/patches/100-use_urandom.patch create mode 100644 scripts/config/images.c create mode 100644 scripts/config/qconf.cc create mode 100644 scripts/config/qconf.h delete mode 100755 target/linux/apm821xx/base-files/lib/apm821xx.sh delete mode 100644 target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh delete mode 100755 target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh rename target/linux/apm821xx/dts/{MR24.dts => meraki-mr24.dts} (91%) rename target/linux/apm821xx/dts/{MX60.dts => meraki-mx60.dts} (93%) rename target/linux/apm821xx/dts/{wndr4700.dts => netgear-wndr4700.dts} (98%) rename target/linux/apm821xx/dts/{apollo3g-duo.dts => wd-mybooklive-duo.dts} (92%) rename target/linux/apm821xx/dts/{apollo3g.dts => wd-mybooklive.dts} (89%) rename target/linux/at91/{config-4.4 => config-4.9} (93%) create mode 100644 target/linux/at91/files/arch/arm/boot/dts/wb45n.dts create mode 100644 target/linux/at91/files/arch/arm/boot/dts/wb50n.dts create mode 100644 target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi delete mode 100644 target/linux/at91/files/drivers/mtd/at91part.c create mode 100755 target/linux/at91/image/gen_at91_sdcard_img.sh create mode 100644 target/linux/at91/image/sama5.mk delete mode 100644 target/linux/at91/image/sama5d3.mk rename target/linux/at91/{patches-4.4 => patches-4.9}/100-ARM-at91-build-dtb-for-LMU5000.patch (80%) rename target/linux/at91/{patches-4.4 => patches-4.9}/101-ARM-at91-build-dtb-for-q5xr5.patch (81%) create mode 100644 target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch create mode 100644 target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch create mode 100644 target/linux/at91/sama5/config-default create mode 100644 target/linux/at91/sama5/target.mk delete mode 100644 target/linux/at91/sama5d3/config-default delete mode 100644 target/linux/at91/sama5d3/target.mk create mode 100644 target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch create mode 100644 target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch delete mode 100644 target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch delete mode 100644 target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch delete mode 100644 target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch delete mode 100644 target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch delete mode 100644 target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch delete mode 100644 target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch delete mode 100644 target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch create mode 100644 target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch create mode 100644 target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch delete mode 100644 target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch create mode 100644 target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface delete mode 100755 target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh rename target/linux/malta/{config-4.4 => config-4.9} (90%) delete mode 100755 target/linux/mpc85xx/base-files/lib/mpc85xx.sh delete mode 100644 target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh create mode 100644 target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts create mode 100644 target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c rename target/linux/mpc85xx/{ => generic}/profiles/00-default.mk (64%) create mode 100644 target/linux/mpc85xx/p1020/profiles/00-default.mk create mode 100644 target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch create mode 100644 target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch delete mode 100644 target/linux/mpc85xx/profiles/tp-link.mk create mode 100644 target/linux/octeon/config-4.14 create mode 100644 target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch create mode 100644 target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch create mode 100644 target/linux/octeon/patches-4.14/160-cmdline-hack.patch create mode 100644 target/linux/octeon/patches-4.14/170-cisco-hack.patch create mode 100644 target/linux/omap/config-4.9 create mode 100644 target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch create mode 100644 target/linux/orion/config-4.9 create mode 100644 target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch create mode 100644 target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch create mode 100644 target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch create mode 100644 target/linux/orion/patches-4.9/200-dt2_board_support.patch create mode 100644 target/linux/orion/patches-4.9/210-wn802t_support.patch rename target/linux/rb532/{config-4.4 => config-4.9} (98%) delete mode 100644 target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch rename target/linux/rb532/{patches-4.4 => patches-4.9}/001-cmdline_hack.patch (100%) rename target/linux/rb532/{patches-4.4 => patches-4.9}/004-rb532-fix-partition-info.patch (85%) create mode 100644 target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch create mode 100644 target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch create mode 100644 target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch create mode 100644 target/linux/rb532/patches-4.9/108-korina-use-gro.patch create mode 100644 target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch create mode 100644 target/linux/rb532/patches-4.9/110-korina-update-authors.patch create mode 100644 target/linux/rb532/patches-4.9/111-korina-version-bump.patch create mode 100644 target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt delete mode 100644 target/linux/sunxi/config-4.4 delete mode 100644 target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch delete mode 100644 target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch delete mode 100644 target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch delete mode 100644 target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch delete mode 100644 target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch delete mode 100644 target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch delete mode 100644 target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch delete mode 100644 target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch delete mode 100644 target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch delete mode 100644 target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch delete mode 100644 target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch delete mode 100644 target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch delete mode 100644 target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch delete mode 100644 target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch delete mode 100644 target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch delete mode 100644 target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch delete mode 100644 target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch delete mode 100644 target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch delete mode 100644 target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch delete mode 100644 target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch delete mode 100644 target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch delete mode 100644 target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch delete mode 100644 target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch delete mode 100644 target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch delete mode 100644 target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch delete mode 100644 target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch rename target/linux/sunxi/{patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch => patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch} (59%) create mode 100644 target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch create mode 100644 target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch delete mode 100755 target/linux/x86/image/gen_image_efi.sh create mode 100644 target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch delete mode 100644 toolchain-old/Config.in delete mode 100644 toolchain-old/Makefile delete mode 100644 toolchain-old/binutils/Config.in delete mode 100644 toolchain-old/binutils/Config.version delete mode 100644 toolchain-old/binutils/Makefile delete mode 100644 toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch delete mode 100644 toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch delete mode 100644 toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch delete mode 100644 toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch delete mode 100644 toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch delete mode 100644 toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch delete mode 100644 toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch delete mode 100644 toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch delete mode 100644 toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch delete mode 100644 toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch delete mode 100644 toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch delete mode 100644 toolchain-old/fortify-headers/Makefile delete mode 100644 toolchain-old/gcc/Config.in delete mode 100644 toolchain-old/gcc/Config.version delete mode 100644 toolchain-old/gcc/common.mk delete mode 100644 toolchain-old/gcc/exclude-testsuite delete mode 100644 toolchain-old/gcc/files/alternate-arch-cc.in delete mode 100644 toolchain-old/gcc/final/Makefile delete mode 100644 toolchain-old/gcc/initial/Makefile delete mode 100644 toolchain-old/gcc/minimal/Makefile delete mode 100644 toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/010-documentation.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/200-musl_config.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/250-add-musl.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/940-no-clobber-stamp-bits.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/960-go_libm.patch delete mode 100644 toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/010-documentation.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch delete mode 100644 toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/010-documentation.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch delete mode 100644 toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch delete mode 100644 toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch delete mode 100644 toolchain-old/gdb/Makefile delete mode 100644 toolchain-old/gdb/patches-arc/100-no_extern_inline.patch delete mode 100644 toolchain-old/gdb/patches-arc/110-no_testsuite.patch delete mode 100644 toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch delete mode 100644 toolchain-old/gdb/patches/100-no_extern_inline.patch delete mode 100644 toolchain-old/gdb/patches/110-no_testsuite.patch delete mode 100644 toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch delete mode 100644 toolchain-old/glibc/Makefile delete mode 100644 toolchain-old/glibc/common.mk delete mode 100644 toolchain-old/glibc/headers/Makefile delete mode 100644 toolchain-old/glibc/include/libintl.h delete mode 100644 toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch delete mode 100644 toolchain-old/glibc/patches/200-add-dl-search-paths.patch delete mode 100644 toolchain-old/info.mk delete mode 100644 toolchain-old/kernel-headers/Makefile delete mode 100644 toolchain-old/musl/Makefile delete mode 100644 toolchain-old/musl/common.mk delete mode 100644 toolchain-old/musl/include/bits/wordsize.h delete mode 100644 toolchain-old/musl/include/features.h delete mode 100644 toolchain-old/musl/include/sgidefs.h delete mode 100644 toolchain-old/musl/include/sys/cdefs.h delete mode 100644 toolchain-old/musl/include/sys/glibc-types.h delete mode 100644 toolchain-old/musl/include/sys/queue.h delete mode 100644 toolchain-old/musl/patches/100-add_glob_onlydir.patch delete mode 100644 toolchain-old/musl/patches/110-read_timezone_from_fs.patch delete mode 100644 toolchain-old/musl/patches/200-add_libssp_nonshared.patch delete mode 100644 toolchain-old/musl/patches/300-relative.patch delete mode 100644 toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch delete mode 100644 toolchain-old/musl/patches/900-iconv_size_hack.patch delete mode 100644 toolchain-old/musl/patches/901-crypt_size_hack.patch delete mode 100644 toolchain-old/uClibc/Config.in delete mode 100644 toolchain-old/uClibc/Makefile delete mode 100644 toolchain-old/uClibc/common.mk delete mode 100644 toolchain-old/uClibc/config/arc delete mode 100644 toolchain-old/uClibc/config/archs delete mode 100644 toolchain-old/uClibc/config/arm delete mode 100644 toolchain-old/uClibc/config/armeb delete mode 100644 toolchain-old/uClibc/config/common delete mode 100644 toolchain-old/uClibc/config/debug delete mode 100644 toolchain-old/uClibc/config/i386 delete mode 100644 toolchain-old/uClibc/config/i686 delete mode 100644 toolchain-old/uClibc/config/m68k delete mode 100644 toolchain-old/uClibc/config/mips delete mode 100644 toolchain-old/uClibc/config/mips64 delete mode 100644 toolchain-old/uClibc/config/mips64.32 delete mode 100644 toolchain-old/uClibc/config/mips64.64 delete mode 100644 toolchain-old/uClibc/config/mips64.n32 delete mode 100644 toolchain-old/uClibc/config/mips64el delete mode 100644 toolchain-old/uClibc/config/mips64el.32 delete mode 100644 toolchain-old/uClibc/config/mips64el.64 delete mode 100644 toolchain-old/uClibc/config/mips64el.n32 delete mode 100644 toolchain-old/uClibc/config/mipsel delete mode 100644 toolchain-old/uClibc/config/mipsel.cobalt delete mode 100644 toolchain-old/uClibc/config/powerpc delete mode 100644 toolchain-old/uClibc/config/powerpc.e500 delete mode 100644 toolchain-old/uClibc/config/sparc delete mode 100644 toolchain-old/uClibc/config/sparc.leon delete mode 100644 toolchain-old/uClibc/config/x86_64 delete mode 100644 toolchain-old/uClibc/headers/Makefile delete mode 100644 toolchain-old/uClibc/utils/Makefile delete mode 100644 toolchain-old/wrapper/Makefile delete mode 100644 toolchain-old/yasm/Makefile create mode 100644 tools/cmake/patches/010-backport-macos-fix.patch rename tools/cmake/patches/{120-alpine_musl-compat.patch => 110-alpine_musl-compat.patch} (100%) delete mode 100644 tools/cmake/patches/110-freebsd-compat.patch rename tools/cmake/patches/{130-libarchive-fix-libressl-compat.patch => 120-libarchive-fix-libressl-compat.patch} (100%) rename tools/cmake/patches/{140-curl-fix-libressl-linking.patch => 130-curl-fix-libressl-linking.patch} (69%) rename tools/cmake/patches/{150-bootstrap_parallel_make_flag.patch => 140-bootstrap_parallel_make_flag.patch} (89%) rename tools/e2fsprogs/patches/{005-darwin-compat.patch => 004-darwin-compat.patch} (100%) delete mode 100644 tools/e2fsprogs/patches/004-freebsd-compat.patch delete mode 100644 tools/e2fsprogs/patches/010-old-libmagic.patch create mode 100644 tools/findutils/patches/100-include_sysmacros.patch create mode 100644 tools/firmware-utils/src/mktplinkfw-lib.c create mode 100644 tools/firmware-utils/src/mktplinkfw-lib.h create mode 100644 tools/firmware-utils/src/otrx.c create mode 100644 tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch delete mode 100644 tools/gptfdisk/Makefile create mode 100644 tools/mtd-utils/patches/120-include_sysmacros.patch delete mode 100644 tools/popt/Makefile create mode 100644 tools/squashfs/patches/130-include_sysmacros.patch create mode 100644 tools/squashfs4/patches/130-include_sysmacros.patch diff --git a/config/Config-images.in b/config/Config-images.in index dcaf6fb0b..607659114 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -17,6 +17,7 @@ menu "Target Images" default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ar71xx default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx + default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx default TARGET_INITRAMFS_COMPRESSION_NONE depends on TARGET_ROOTFS_INITRAMFS help @@ -61,7 +62,7 @@ menu "Target Images" config TARGET_ROOTFS_TARGZ bool "tar.gz" - default n if USES_TARGZ + default y if USES_TARGZ help Build a compressed tar archive of the root filesystem. @@ -69,7 +70,7 @@ menu "Target Images" menuconfig TARGET_ROOTFS_EXT4FS bool "ext4" - default n if USES_EXT4 + default y if USES_EXT4 help Build an ext4 root filesystem. @@ -114,7 +115,7 @@ menu "Target Images" config TARGET_ROOTFS_ISO bool "iso" default n - depends on TARGET_x86 + depends on TARGET_x86_generic help Create a bootable ISO image. @@ -141,7 +142,7 @@ menu "Target Images" int "Block size (in KiB)" depends on TARGET_ROOTFS_SQUASHFS default 64 if LOW_MEMORY_FOOTPRINT - default 1024 + default 256 menuconfig TARGET_ROOTFS_UBIFS bool "ubifs" @@ -184,31 +185,22 @@ menu "Target Images" depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 default y - - config EFI_IMAGES - bool "Build EFI GRUB images (Linux x86 or x86_64 host only)" - depends on TARGET_x86 - depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_ISO || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS - select PACKAGE_grub2 - select PACKAGE_grub2-efi - default n - config GRUB_CONSOLE bool "Use Console Terminal (in addition to Serial)" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default n if (TARGET_x86_generic_Soekris45xx || TARGET_x86_generic_Soekris48xx || TARGET_x86_net5501 || TARGET_x86_geos || TARGET_x86_alix2) default y config GRUB_SERIAL string "Serial port device" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default "hvc0" if TARGET_x86_xen_domu default "ttyS0" if ! TARGET_x86_xen_domu config GRUB_BAUDRATE int "Serial port baud rate" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default 38400 if TARGET_x86_generic default 115200 @@ -219,41 +211,40 @@ menu "Target Images" config GRUB_BOOTOPTS string "Extra kernel boot options" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES default "xencons=hvc" if TARGET_x86_xen_domu help If you don't know, just leave it blank. config GRUB_TIMEOUT string "Seconds to wait before booting the default entry" - depends on GRUB_IMAGES || EFI_IMAGES - default "0" + depends on GRUB_IMAGES + default "5" help If you don't know, 5 seconds is a reasonable default. config VDI_IMAGES bool "Build VirtualBox image files (VDI)" depends on TARGET_x86 || TARGET_x86_64 - depends on GRUB_IMAGES || EFI_IMAGES + select GRUB_IMAGES select TARGET_IMAGES_PAD select PACKAGE_kmod-e1000 config VMDK_IMAGES bool "Build VMware image files (VMDK)" depends on TARGET_x86 || TARGET_x86_64 - depends on GRUB_IMAGES || EFI_IMAGES + select GRUB_IMAGES select TARGET_IMAGES_PAD select PACKAGE_kmod-e1000 - default y config TARGET_IMAGES_PAD bool "Pad images to filesystem size (for JFFS2)" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES config TARGET_IMAGES_GZIP bool "GZip images" depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || TARGET_x86 - default n + default y comment "Image Options" @@ -261,19 +252,19 @@ menu "Target Images" config TARGET_KERNEL_PARTSIZE int "Kernel partition size (in MB)" - depends on GRUB_IMAGES || EFI_IMAGES - default 8 + depends on GRUB_IMAGES + default 16 config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" - depends on GRUB_IMAGES || EFI_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml - default 96 + depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml + default 256 help Select the root filesystem partition size. config TARGET_ROOTFS_PARTNAME string "Root partition on target device" - depends on GRUB_IMAGES || EFI_IMAGES + depends on GRUB_IMAGES help Override the root partition on the final device. If left empty, it will be mounted by PARTUUID which makes the kernel find the diff --git a/config/Config-kernel.in b/config/Config-kernel.in index d7cb2d9fc..678323efa 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -62,7 +62,7 @@ config KERNEL_PROFILING config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" - default n + default y if !SMALL_FLASH help This will give you more information in stack traces from kernel oopses. @@ -254,7 +254,7 @@ config KERNEL_DEVTMPFS default n help devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates - devices nodes for all registered devices ti simplify boot, but leaves more + devices nodes for all registered devices to simplify boot, but leaves more complex tasks to userspace (e.g. udev). if KERNEL_DEVTMPFS diff --git a/include/download.mk b/include/download.mk index 82a3dd2f9..0a2564173 100644 --- a/include/download.mk +++ b/include/download.mk @@ -103,7 +103,7 @@ hash_var = $(if $(filter-out x,$(1)),MD5SUM,HASH) endif define DownloadMethod/unknown - @echo "ERROR: No download method available"; false + echo "ERROR: No download method available"; false endef define DownloadMethod/default diff --git a/include/host-build.mk b/include/host-build.mk index dc7037385..9120570c5 100644 --- a/include/host-build.mk +++ b/include/host-build.mk @@ -24,7 +24,7 @@ include $(INCLUDE_DIR)/depends.mk include $(INCLUDE_DIR)/quilt.mk BUILD_TYPES += host -HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) +HOST_STAMP_PREPARED=$(HOST_BUILD_DIR)/.prepared$(if $(HOST_QUILT)$(DUMP),,$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(HOST_PREPARED_DEPENDS))) HOST_STAMP_CONFIGURED:=$(HOST_BUILD_DIR)/.configured HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built HOST_BUILD_PREFIX?=$(if $(IS_PACKAGE_BUILD),$(STAGING_DIR_HOSTPKG),$(STAGING_DIR_HOST)) @@ -78,6 +78,10 @@ HOST_MAKE_FLAGS = HOST_CONFIGURE_CMD = $(BASH) ./configure +ifeq ($(HOST_OS),Darwin) + HOST_CONFIG_SITE:=$(INCLUDE_DIR)/site/darwin +endif + define Host/Configure/Default $(if $(HOST_CONFIGURE_PARALLEL),+)(cd $(HOST_BUILD_DIR)/$(3); \ if [ -x configure ]; then \ @@ -128,6 +132,7 @@ define Host/Exports/Default $(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig $(1) : export CCACHE_DIR:=$(STAGING_DIR_HOST)/ccache + $(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE)) $(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG)) endef Host/Exports=$(Host/Exports/Default) diff --git a/include/image-commands.mk b/include/image-commands.mk index 970bdc9b3..5f0ac6164 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -102,8 +102,7 @@ define Build/tplink-safeloader endef define Build/append-dtb - $(call Image/BuildDTB,$(if $(DEVICE_DTS_DIR),$(DEVICE_DTS_DIR),$(DTS_DIR))/$(DEVICE_DTS).dts,$@.dtb) - cat $@.dtb >> $@ + cat $(KDIR)/image-$(firstword $(DEVICE_DTS)).dtb >> $@ endef define Build/install-dtb @@ -114,6 +113,11 @@ define Build/install-dtb ) endef +define Build/install-zImage + $(CP) $(KDIR)/zImage \ + $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE_SANITIZED)-zImage +endef + define Build/fit $(TOPDIR)/scripts/mkits.sh \ -D $(DEVICE_NAME) -o $@.its -k $@ \ @@ -244,14 +248,20 @@ endef define Build/tplink-v2-header $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ - -c -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) -k $@ -o $@.new + -c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \ + -E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" \ + -k $@ -o $@.new $(1) @mv $@.new $@ endef define Build/tplink-v2-image $(STAGING_DIR_HOST)/bin/mktplinkfw2 \ - -a 0x4 -j -V "ver. 2.0" -B $(TPLINK_BOARD_ID) $(1) \ - -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) \ + -w $(TPLINK_HWREVADD) -F "$(TPLINK_FLASHLAYOUT)" \ + -T $(TPLINK_HVERSION) -V "ver. 2.0" -a 0x4 -j \ + -k $(IMAGE_KERNEL) -r $(IMAGE_ROOTFS) -o $@.new $(1) cat $@.new >> $@ rm -rf $@.new endef @@ -271,7 +281,7 @@ metadata_json = \ }' define Build/append-metadata - $(if $(SUPPORTED_DEVICES),echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) + $(if $(SUPPORTED_DEVICES),-echo $(call metadata_json,$(SUPPORTED_DEVICES)) | fwtool -I - $@) endef define Build/kernel2minor diff --git a/include/image.mk b/include/image.mk index a1c378156..605cb0667 100644 --- a/include/image.mk +++ b/include/image.mk @@ -435,7 +435,27 @@ define Device/Build/compile endef +ifndef IB +define Device/Build/dtb + ifndef BUILD_DTS_$(1) + BUILD_DTS_$(1) := 1 + $(KDIR)/image-$(1).dtb: FORCE + $(call Image/BuildDTB,$(strip $(2))/$(strip $(3)).dts,$$@) + + image_prepare: $(KDIR)/image-$(1).dtb + endif + +endef +endif + define Device/Build/kernel + $$(eval $$(foreach dts,$$(DEVICE_DTS), \ + $$(call Device/Build/dtb,$$(notdir $$(dts)), \ + $$(if $$(DEVICE_DTS_DIR),$$(DEVICE_DTS_DIR),$$(DTS_DIR)), \ + $$(dts) \ + ) \ + )) + $(KDIR)/$$(KERNEL_NAME):: image_prepare $$(_TARGET): $$(if $$(KERNEL_INSTALL),$(BIN_DIR)/$$(KERNEL_IMAGE)) $(call Device/Export,$$(KDIR_KERNEL_IMAGE),$(1)) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 8c5af2f76..ff6ba2a70 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -4,13 +4,13 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 LINUX_VERSION-4.4 = .108 -LINUX_VERSION-4.9 = .72 -LINUX_VERSION-4.14 = .6 +LINUX_VERSION-4.9 = .73 +LINUX_VERSION-4.14 = .12 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a -LINUX_KERNEL_HASH-4.9.72 = 69f201f1eb9eade9a3cde26d3896a53df9fddf1e19f9fa7b36331b8b1976b83b -LINUX_KERNEL_HASH-4.14.6 = 0907678ba9ea146ddbdecd0a0b6363f56b896b5c61c9a15e809effb3ea346ccc +LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b +LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) @@ -24,4 +24,4 @@ KERNEL_PATCHVER ?= $(KERNEL) # disable the md5sum check for unknown kernel versions LINUX_KERNEL_HASH:=$(LINUX_KERNEL_HASH-$(strip $(LINUX_VERSION))) -LINUX_KERNEL_HASH?=x \ No newline at end of file +LINUX_KERNEL_HASH?=x diff --git a/include/kernel.mk b/include/kernel.mk index 7674f0dad..1b6006a62 100644 --- a/include/kernel.mk +++ b/include/kernel.mk @@ -52,7 +52,7 @@ else LINUX_VERMAGIC:=$(strip $(shell cat $(LINUX_DIR)/.vermagic 2>/dev/null)) LINUX_VERMAGIC:=$(if $(LINUX_VERMAGIC),$(LINUX_VERMAGIC),unknown) - LINUX_UNAME_VERSION:=$(if $(word 3,$(subst ., ,$(KERNEL_BASE))),$(KERNEL_BASE),$(KERNEL_BASE).0) + LINUX_UNAME_VERSION:=$(KERNEL_BASE) ifneq ($(findstring -rc,$(LINUX_VERSION)),) LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION)))) endif @@ -64,7 +64,7 @@ else ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),) LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING) else - LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release)) + LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null)) endif MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION) @@ -85,6 +85,8 @@ else ifneq (,$(findstring $(ARCH) , armeb )) LINUX_KARCH := arm else ifneq (,$(findstring $(ARCH) , mipsel mips64 mips64el )) LINUX_KARCH := mips +else ifneq (,$(findstring $(ARCH) , powerpc64 )) + LINUX_KARCH := powerpc else ifneq (,$(findstring $(ARCH) , sh2 sh3 sh4 )) LINUX_KARCH := sh else ifneq (,$(findstring $(ARCH) , i386 x86_64 )) @@ -121,61 +123,53 @@ ifdef CONFIG_USE_SPARSE KERNEL_MAKEOPTS += C=1 CHECK=$(STAGING_DIR_HOST)/bin/sparse endif +PKG_EXTMOD_SUBDIRS ?= . + +define populate_module_symvers + @mkdir -p $(PKG_INFO_DIR) + cat /dev/null > $(PKG_INFO_DIR)/$(PKG_NAME).symvers; \ + for subdir in $(PKG_EXTMOD_SUBDIRS); do \ + cat $(PKG_INFO_DIR)/*.symvers 2>/dev/null > $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers; \ + done +endef + +define collect_module_symvers + for subdir in $(PKG_EXTMOD_SUBDIRS); do \ + grep -F $$$$(readlink -f $(PKG_BUILD_DIR)) $(PKG_BUILD_DIR)/$$$$subdir/Module.symvers >> $(PKG_BUILD_DIR)/Module.symvers.tmp; \ + done; \ + sort -u $(PKG_BUILD_DIR)/Module.symvers.tmp > $(PKG_BUILD_DIR)/Module.symvers; \ + mv $(PKG_BUILD_DIR)/Module.symvers $(PKG_INFO_DIR)/$(PKG_NAME).symvers +endef + +define KernelPackage/hooks + ifneq ($(PKG_NAME),kernel) + Hooks/Compile/Pre += populate_module_symvers + Hooks/Compile/Post += collect_module_symvers + endif + define KernelPackage/hooks + endef +endef + define KernelPackage/Defaults FILES:= AUTOLOAD:= + MODPARAMS:= PKGFLAGS+=nonshared endef +# 1: name +# 2: install prefix +# 3: module priority prefix +# 4: required for boot +# 5: module list define ModuleAutoLoad - $(SH_FUNC) \ - export modules=; \ - probe_module() { \ - local mods="$$$$$$$$1"; \ - local boot="$$$$$$$$2"; \ - local mod; \ - shift 2; \ - for mod in $$$$$$$$mods; do \ - mkdir -p $(2)/etc/modules.d; \ - echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$(1); \ - done; \ - if [ -e $(2)/etc/modules.d/$(1) ]; then \ - if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$(1) ]; then \ - mkdir -p $(2)/etc/modules-boot.d; \ - ln -s ../modules.d/$(1) $(2)/etc/modules-boot.d/; \ - fi; \ - modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$mods"; \ - fi; \ - }; \ - add_module() { \ - local priority="$$$$$$$$1"; \ - local mods="$$$$$$$$2"; \ - local boot="$$$$$$$$3"; \ - local mod; \ - shift 3; \ - for mod in $$$$$$$$mods; do \ - mkdir -p $(2)/etc/modules.d; \ - echo "$$$$$$$$mod" >> $(2)/etc/modules.d/$$$$$$$$priority-$(1); \ - done; \ - if [ -e $(2)/etc/modules.d/$$$$$$$$priority-$(1) ]; then \ - if [ "$$$$$$$$boot" = "1" -a ! -e $(2)/etc/modules-boot.d/$$$$$$$$priority-$(1) ]; then \ - mkdir -p $(2)/etc/modules-boot.d; \ - ln -s ../modules.d/$$$$$$$$priority-$(1) $(2)/etc/modules-boot.d/; \ - fi; \ - modules="$$$$$$$${modules:+$$$$$$$$modules }$$$$$$$$priority-$(1)"; \ - fi; \ - }; \ - $(3) \ - if [ -n "$$$$$$$$modules" ]; then \ - modules="$$$$$$$$(echo "$$$$$$$$modules" | tr ' ' '\n' | sort | uniq | paste -s -d' ' -)"; \ - mkdir -p $(2)/etc/modules.d; \ - mkdir -p $(2)/CONTROL; \ - echo "#!/bin/sh" > $(2)/CONTROL/postinst-pkg; \ - echo "[ -z \"\$$$$$$$$IPKG_INSTROOT\" ] || exit 0" >> $(2)/CONTROL/postinst-pkg; \ - echo ". /lib/functions.sh" >> $(2)/CONTROL/postinst-pkg; \ - echo "insert_modules $$$$$$$$modules" >> $(2)/CONTROL/postinst-pkg; \ - chmod 0755 $(2)/CONTROL/postinst-pkg; \ - fi + $(if $(5), \ + mkdir -p $(2)/etc/modules.d; \ + ($(foreach mod,$(5), \ + echo "$(mod)$(if $(MODPARAMS.$(mod)), $(MODPARAMS.$(mod)),$(if $(MODPARAMS), $(MODPARAMS)))"; )) > $(2)/etc/modules.d/$(3)$(1); \ + $(if $(4), \ + mkdir -p $(2)/etc/modules-boot.d; \ + ln -sf ../modules.d/$(3)$(1) $(2)/etc/modules-boot.d/;)) endef ifeq ($(DUMP)$(TARGET_BUILD),) @@ -228,6 +222,7 @@ $(call KernelPackage/$(1)/config) endif $(call KernelPackage/depends) + $(call KernelPackage/hooks) ifneq ($(if $(filter-out %=y %=n %=m,$(KCONFIG)),$(filter m y,$(foreach c,$(filter-out %=y %=n %=m,$(KCONFIG)),$($(c)))),.),) ifneq ($(strip $(FILES)),) @@ -243,7 +238,7 @@ $(call KernelPackage/$(1)/config) exit 1; \ fi; \ done; - $(call ModuleAutoLoad,$(1),$$(1),$(AUTOLOAD)) + $(call ModuleAutoLoad,$(1),$$(1),$(filter-out 0-,$(word 1,$(AUTOLOAD))-),$(filter-out 0,$(word 2,$(AUTOLOAD))),$(wordlist 3,99,$(AUTOLOAD))) $(call KernelPackage/$(1)/install,$$(1)) endef endif @@ -265,12 +260,17 @@ endef version_filter=$(if $(findstring @,$(1)),$(shell $(SCRIPT_DIR)/package-metadata.pl version_filter $(KERNEL_PATCHVER) $(1)),$(1)) +# 1: priority (optional) +# 2: module list +# 3: boot flag define AutoLoad - add_module "$(1)" "$(call version_filter,$(2))" "$(3)"; + $(if $(1),$(1),0) $(if $(3),1,0) $(call version_filter,$(2)) endef +# 1: module list +# 2: boot flag define AutoProbe - probe_module "$(call version_filter,$(1))" "$(2)"; + $(call AutoLoad,,$(1),$(2)) endef version_field=$(if $(word $(1),$(2)),$(word $(1),$(2)),0) diff --git a/include/netfilter.mk b/include/netfilter.mk index 2d537583b..616425cb0 100644 --- a/include/netfilter.mk +++ b/include/netfilter.mk @@ -262,6 +262,10 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_TEE,CONFIG_NF_DUP_IPV6, $(P_V6)nf_dup_i $(eval $(call nf_add,IPT_U32,CONFIG_NETFILTER_XT_MATCH_U32, $(P_XT)xt_u32)) +# checksum + +$(eval $(call nf_add,IPT_CHECKSUM,CONFIG_NETFILTER_XT_TARGET_CHECKSUM, $(P_XT)xt_CHECKSUM)) + # netlink @@ -366,7 +370,6 @@ IPT_BUILTIN += $(IPT_NAT_EXTRA-y) IPT_BUILTIN += $(NF_NATHELPER-y) IPT_BUILTIN += $(NF_NATHELPER_EXTRA-y) IPT_BUILTIN += $(IPT_ULOG-y) -IPT_BUILTIN += $(IPT_DEBUG-y) IPT_BUILTIN += $(IPT_TPROXY-y) IPT_BUILTIN += $(NFNETLINK-y) IPT_BUILTIN += $(NFNETLINK_LOG-y) diff --git a/include/package-defaults.mk b/include/package-defaults.mk index 0eecd6c4f..0bca076e7 100644 --- a/include/package-defaults.mk +++ b/include/package-defaults.mk @@ -57,6 +57,8 @@ define Package/Default DEFAULT_VARIANT:= USERID:= ALTERNATIVES:= + LICENSE:=$(PKG_LICENSE) + LICENSE_FILES:=$(PKG_LICENSE_FILES) endef Build/Patch:=$(Build/Patch/Default) diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index b717c1b47..1be7d958d 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -46,8 +46,8 @@ $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base) Maintainer: $(MAINTAINER) $(if $(USERID),Require-User: $(USERID) )Source: $(PKG_SOURCE) -$(if $(PKG_LICENSE),License: $(PKG_LICENSE) -)$(if $(PKG_LICENSE_FILES),LicenseFiles: $(PKG_LICENSE_FILES) +$(if $(LICENSE),License: $(LICENSE) +)$(if $(LICENSE_FILES),LicenseFiles: $(LICENSE_FILES) )Type: $(if $(Package/$(1)/targets),$(Package/$(1)/targets),$(if $(PKG_TARGETS),$(PKG_TARGETS),ipkg)) $(if $(KCONFIG),Kernel-Config: $(KCONFIG) )$(if $(BUILDONLY),Build-Only: $(BUILDONLY) diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk index bf508fb49..9e2717e78 100644 --- a/include/package-ipkg.mk +++ b/include/package-ipkg.mk @@ -161,8 +161,8 @@ $$(call addfield,Depends,$$(Package/$(1)/DEPENDS) )$$(call addfield,Provides,$$(call mergelist,$(PROVIDES)) )$$(call addfield,Alternatives,$$(call mergelist,$(ALTERNATIVES)) )$$(call addfield,Source,$(SOURCE) -)$$(call addfield,License,$$(PKG_LICENSE) -)$$(call addfield,LicenseFiles,$$(PKG_LICENSE_FILES) +)$$(call addfield,License,$(LICENSE) +)$$(call addfield,LicenseFiles,$(LICENSE_FILES) )$$(call addfield,Section,$(SECTION) )$$(call addfield,Require-User,$(USERID) )$(if $(filter hold,$(PKG_FLAGS)),Status: unknown hold not-installed diff --git a/include/package.mk b/include/package.mk index 5dc4aec70..78ea5d0ef 100644 --- a/include/package.mk +++ b/include/package.mk @@ -69,9 +69,9 @@ ifneq ($(PREV_STAMP_PREPARED),) STAMP_PREPARED:=$(PREV_STAMP_PREPARED) CONFIG_AUTOREBUILD:= else - STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) + STAMP_PREPARED=$(PKG_BUILD_DIR)/.prepared$(if $(QUILT)$(DUMP),,_$(shell $(call find_md5,${CURDIR} $(PKG_FILE_DEPENDS),))_$(call confvar,CONFIG_AUTOREMOVE $(PKG_PREPARED_DEPENDS))) endif -STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) +STAMP_CONFIGURED=$(PKG_BUILD_DIR)/.configured$(if $(DUMP),,_$(call confvar,$(PKG_CONFIG_DEPENDS))) STAMP_CONFIGURED_WILDCARD=$(PKG_BUILD_DIR)/.configured_* STAMP_BUILT:=$(PKG_BUILD_DIR)/.built STAMP_INSTALLED:=$(STAGING_DIR)/stamp/.$(PKG_DIR_NAME)$(if $(BUILD_VARIANT),.$(BUILD_VARIANT),)_installed @@ -144,6 +144,9 @@ endef Build/Exports=$(Build/Exports/Default) define Build/CoreTargets + STAMP_PREPARED:=$$(STAMP_PREPARED) + STAMP_CONFIGURED:=$$(STAMP_CONFIGURED) + $(if $(QUILT),$(Build/Quilt)) $(call Build/Autoclean) $(call DefaultTargets) @@ -165,11 +168,11 @@ define Build/CoreTargets $(call Build/Exports,$(STAMP_CONFIGURED)) $(STAMP_CONFIGURED): $(STAMP_PREPARED) $(STAMP_CONFIGURED_DEPENDS) + rm -f $(STAMP_CONFIGURED_WILDCARD) $(CleanStaging) $(foreach hook,$(Hooks/Configure/Pre),$(call $(hook))$(sep)) $(Build/Configure) $(foreach hook,$(Hooks/Configure/Post),$(call $(hook))$(sep)) - rm -f $(STAMP_CONFIGURED_WILDCARD) touch $$@ $(call Build/Exports,$(STAMP_BUILT)) diff --git a/include/prereq-build.mk b/include/prereq-build.mk index 0fab32601..6a423d2c7 100644 --- a/include/prereq-build.mk +++ b/include/prereq-build.mk @@ -27,32 +27,36 @@ $(eval $(call TestHostCommand,proper-umask, \ umask | grep -xE 00[012][012])) $(eval $(call SetupHostCommand,gcc, \ - Please install the GNU C Compiler (gcc), \ - $(CC) --version | grep gcc, \ - gcc --version | grep gcc, \ - gcc49 --version | grep gcc, \ + Please install the GNU C Compiler (gcc) 4.8 or later \ + $(CC) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ + gcc -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ gcc48 --version | grep gcc, \ - gcc47 --version | grep gcc, \ - gcc46 --version | grep gcc, \ + gcc49 --version | grep gcc, \ + gcc5 --version | grep gcc, \ + gcc6 --version | grep gcc, \ + gcc7 --version | grep gcc, \ gcc --version | grep Apple.LLVM )) $(eval $(call TestHostCommand,working-gcc, \ - Please reinstall the GNU C Compiler - it appears to be broken, \ + \nPlease reinstall the GNU C Compiler (4.8 or later) - \ + it appears to be broken, \ echo 'int main(int argc, char **argv) { return 0; }' | \ gcc -x c -o $(TMP_DIR)/a.out -)) $(eval $(call SetupHostCommand,g++, \ - Please install the GNU C++ Compiler (g++), \ - $(CXX) --version | grep g++, \ - g++ --version | grep g++, \ - g++49 --version | grep g++, \ + Please install the GNU C++ Compiler (g++) 4.8 or later \ + $(CXX) -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ + g++ -dumpversion | grep -E '(4\.[8-9]|5\.?[0-9]?|6\.?[0-9]?|7\.?[0-9]?)', \ g++48 --version | grep g++, \ - g++47 --version | grep g++, \ - g++46 --version | grep g++, \ + g++49 --version | grep g++, \ + g++5 --version | grep g++, \ + g++6 --version | grep g++, \ + g++7 --version | grep g++, \ g++ --version | grep Apple.LLVM )) $(eval $(call TestHostCommand,working-g++, \ - Please reinstall the GNU C++ Compiler - it appears to be broken, \ + \nPlease reinstall the GNU C++ Compiler (4.8 or later) - \ + it appears to be broken, \ echo 'int main(int argc, char **argv) { return 0; }' | \ g++ -x c++ -o $(TMP_DIR)/a.out - -lstdc++ && \ $(TMP_DIR)/a.out)) diff --git a/include/site/darwin b/include/site/darwin new file mode 100644 index 000000000..ec38f67be --- /dev/null +++ b/include/site/darwin @@ -0,0 +1,2 @@ +ac_cv_func_futimens=no +ac_cv_func_utimensat=no diff --git a/include/site/powerpc64 b/include/site/powerpc64 new file mode 100644 index 000000000..6a66346b4 --- /dev/null +++ b/include/site/powerpc64 @@ -0,0 +1,26 @@ +#!/bin/sh +. $TOPDIR/include/site/linux +ac_cv_c_littleendian=${ac_cv_c_littleendian=no} +ac_cv_c_bigendian=${ac_cv_c_bigendian=yes} + +ac_cv_sizeof_char=1 +ac_cv_sizeof_char_p=8 +ac_cv_sizeof_double=8 +ac_cv_sizeof_float=4 +ac_cv_sizeof_int=4 +ac_cv_sizeof_long=8 +ac_cv_sizeof_long_double=16 +ac_cv_sizeof_long_int=8 +ac_cv_sizeof_long_long=8 +ac_cv_sizeof_long_long_int=8 +ac_cv_sizeof_short=2 +ac_cv_sizeof_short_int=2 +ac_cv_sizeof_signed_char=1 +ac_cv_sizeof_unsigned_char=1 +ac_cv_sizeof_unsigned_int=4 +ac_cv_sizeof_unsigned_long=8 +ac_cv_sizeof_unsigned_long_int=8 +ac_cv_sizeof_unsigned_long_long_int=8 +ac_cv_sizeof_unsigned_short=2 +ac_cv_sizeof_unsigned_short_int=2 +ac_cv_sizeof_void_p=8 diff --git a/include/target.mk b/include/target.mk index b1e97b438..73a211c9f 100644 --- a/include/target.mk +++ b/include/target.mk @@ -21,7 +21,7 @@ luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule l # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets -DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall +DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c DEFAULT_PACKAGES.bootloader:= ifneq ($(DUMP),) @@ -190,7 +190,7 @@ ifeq ($(DUMP),1) CPU_CFLAGS_cortex-a7 = -mcpu=cortex-a7 CPU_CFLAGS_cortex-a8 = -mcpu=cortex-a8 CPU_CFLAGS_cortex-a9 = -mcpu=cortex-a9 - CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 -mtune=cortex-a15 + CPU_CFLAGS_cortex-a15 = -mcpu=cortex-a15 CPU_CFLAGS_cortex-a53 = -mcpu=cortex-a53 CPU_CFLAGS_fa526 = -mcpu=fa526 CPU_CFLAGS_mpcore = -mcpu=mpcore @@ -209,6 +209,10 @@ ifeq ($(DUMP),1) CPU_CFLAGS_440:=-mcpu=440 CPU_CFLAGS_464fp:=-mcpu=464fp endif + ifeq ($(ARCH),powerpc64) + CPU_TYPE ?= powerpc64 + CPU_CFLAGS_powerpc64:=-mcpu=powerpc64 + endif ifeq ($(ARCH),sparc) CPU_TYPE = sparc CPU_CFLAGS_ultrasparc = -mcpu=ultrasparc diff --git a/include/toplevel.mk b/include/toplevel.mk index 658eb4ce4..3f5a75003 100644 --- a/include/toplevel.mk +++ b/include/toplevel.mk @@ -104,6 +104,9 @@ scripts/config/mconf: $(eval $(call rdep,scripts/config,scripts/config/mconf)) +scripts/config/qconf: + @$(_SINGLE)$(SUBMAKE) -s -C scripts/config qconf CC="$(HOSTCC_WRAPPER)" + scripts/config/conf: @$(_SINGLE)$(SUBMAKE) -s -C scripts/config conf CC="$(HOSTCC_WRAPPER)" @@ -136,6 +139,12 @@ menuconfig: scripts/config/mconf prepare-tmpinfo FORCE [ -L .config ] && export KCONFIG_OVERWRITECONFIG=1; \ $< Config.in +xconfig: scripts/config/qconf prepare-tmpinfo FORCE + if [ \! -e .config -a -e $(HOME)/.openwrt/defconfig ]; then \ + cp $(HOME)/.openwrt/defconfig .config; \ + fi + $< Config.in + prepare_kernel_conf: .config FORCE ifeq ($(wildcard staging_dir/host/bin/quilt),) diff --git a/include/version.mk b/include/version.mk index 880721afe..a869ed6f5 100644 --- a/include/version.mk +++ b/include/version.mk @@ -101,4 +101,4 @@ VERSION_SED:=$(SED) 's,%U,$(VERSION_REPO),g' \ -e 's,%P,$(VERSION_PRODUCT),g' \ -e 's,%h,$(VERSION_HWREV),g' -VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED)) \ No newline at end of file +VERSION_SED_SCRIPT:=$(subst '\'','\'\\\\\'\'',$(VERSION_SED)) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 99690300b..a7cc4ca48 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=174 +PKG_RELEASE:=181 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -21,7 +22,12 @@ PKG_LICENSE:=GPL-2.0 # Extend depends from version.mk PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ - CONFIG_NAND_SUPPORT + CONFIG_NAND_SUPPORT \ + CONFIG_CLEAN_IPKG \ + CONFIG_PER_FEED_REPO \ + CONFIG_PER_FEED_REPO_ADD_DISABLED \ + CONFIG_PER_FEED_REPO_ADD_COMMENTED \ + $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) include $(INCLUDE_DIR)/package.mk @@ -148,6 +154,7 @@ define Package/base-files/install mkdir -p $(1)/CONTROL mkdir -p $(1)/dev + mkdir -p $(1)/etc/config mkdir -p $(1)/etc/crontabs mkdir -p $(1)/etc/rc.d mkdir -p $(1)/overlay @@ -183,6 +190,11 @@ define Package/base-files/install $(if $(CONFIG_INCLUDE_CONFIG), \ echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \ cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config) + + $(if $(CONFIG_CLEAN_IPKG),, \ + mkdir -p $(1)/etc/opkg; \ + $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \ + $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf) endef ifneq ($(DUMP),1) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index e181c9649..bbed567de 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -119,17 +119,14 @@ generate_network() { ;; pppoe) - # fixup IPv6 slave interface - ifname="pppoe-$1" - uci -q batch <<-EOF set network.$1.proto='pppoe' set network.$1.username='username' set network.$1.password='password' - set network.$1.ipv6='auto' + set network.$1.ipv6='1' delete network.${1}6 set network.${1}6='interface' - set network.${1}6.ifname='$ifname' + set network.${1}6.ifname='@${1}' set network.${1}6.proto='dhcpv6' EOF ;; diff --git a/package/base-files/files/etc/config/fstab b/package/base-files/files/etc/config/fstab deleted file mode 100644 index fcc6c7bc1..000000000 --- a/package/base-files/files/etc/config/fstab +++ /dev/null @@ -1,13 +0,0 @@ - -config global - option from_fstab '1' - option anon_swap '1' - option anon_mount '1' - option auto_swap '1' - option auto_mount '1' - option delay_root '5' - option check_fs '0' - - - - diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 7c2a18501..c790e3e18 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -72,6 +72,7 @@ load_led() { [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name echo $mode > /sys/class/leds/${sysfs}/mode + echo $interval > /sys/class/leds/${sysfs}/interval } ;; diff --git a/package/base-files/files/etc/profile b/package/base-files/files/etc/profile index 3eda09b45..e9936fb36 100644 --- a/package/base-files/files/etc/profile +++ b/package/base-files/files/etc/profile @@ -1,6 +1,9 @@ #!/bin/sh +[ -e /tmp/.failsafe ] && export FAILSAFE=1 + [ -f /etc/banner ] && cat /etc/banner -[ -e /tmp/.failsafe ] && cat /etc/banner.failsafe +[ -n "$FAILSAFE" ] && cat /etc/banner.failsafe + fgrep -sq '/ overlay ro,' /proc/mounts && { echo 'Your JFFS2-partition seems full and overlayfs is mounted read-only.' echo 'Please try to remove files from /overlay/upper/... and reboot!' diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index e80af891e..3e237170b 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -41,14 +41,15 @@ disable() { } enable() { + err=1 name="$(basename "${initscript}")" - disable - [ -n "$START" -o -n "$STOP" ] || { - echo "/etc/init.d/$name does not have a START or STOP value" - return 1 - } - [ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" - [ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" + [ "$START" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \ + err=0 + [ "$STOP" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \ + err=0 + return $err } enabled() { @@ -88,6 +89,10 @@ service_triggers() { return 0 } +service_data() { + return 0 +} + service_running() { return 0 } @@ -122,12 +127,14 @@ ${INIT_TRACE:+set -x} } stop() { + procd_lock stop_service "$@" procd_kill "$(basename ${basescript:-$initscript})" "$1" } reload() { if eval "type reload_service" 2>/dev/null >/dev/null; then + procd_lock reload_service "$@" else start diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf index 91a3ac9a0..ddc7a9bf6 100644 --- a/package/base-files/files/etc/sysctl.conf +++ b/package/base-files/files/etc/sysctl.conf @@ -1,5 +1,6 @@ kernel.panic=3 kernel.core_pattern=/tmp/%e.%t.%p.%s.core +fs.suid_dumpable=2 net.ipv4.conf.default.arp_ignore=1 net.ipv4.conf.all.arp_ignore=1 diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 81ef84b8e..dfadfdb2d 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -202,7 +202,7 @@ add_group_and_user() { if [ -n "$gname" ] && [ -n "$gid" ]; then group_exists "$gname" || group_add "$gname" "$gid" elif [ -n "$gname" ]; then - group_add_next "$gname"; gid=$? + gid="$(group_add_next "$gname")" fi if [ -n "$uname" ]; then @@ -235,12 +235,16 @@ default_postinst() { rm -fR $root/rootfs-overlay/ fi + if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then + kmodloader + fi + if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci for i in $(sed -ne 's!^/etc/uci-defaults/!!p' "/usr/lib/opkg/info/${pkgname}.list"); do ( cd /etc/uci-defaults - [ -f "$i" ] && . "$i" && rm -f "$i" + [ -f "$i" ] && . ./"$i" && rm -f "$i" ) done uci commit fi @@ -292,9 +296,7 @@ group_add() { [ -f "${IPKG_INSTROOT}/etc/group" ] || return 1 [ -n "$IPKG_INSTROOT" ] || lock /var/lock/group echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group - return $rc } group_exists() { @@ -304,14 +306,17 @@ group_exists() { group_add_next() { local gid gids gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - [ -n "$gid" ] && return $gid + if [ -n "$gid" ]; then + echo $gid + return + fi gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) gid=65536 while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do gid=$((gid + 1)) done group_add $1 $gid - return $gid + echo $gid } group_add_user() { @@ -344,9 +349,7 @@ user_add() { [ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd - return $rc } user_exists() { diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index 857e7e539..83e775fad 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -1,6 +1,18 @@ #!/bin/sh # Copyright (C) 2013 OpenWrt.org +get_dt_led() { + local label + local ledpath + local basepath="/proc/device-tree" + local nodepath="$basepath/aliases/led-$1" + + [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") + [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") + + echo "$label" +} + led_set_attr() { [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" } diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index e1f6ded68..71cffc858 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -117,24 +117,6 @@ export_bootdevice() { esac case "$disk" in - PARTUUID=[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9]-[A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9][A-F0-9]0002) - uuid="${disk#PARTUUID=}" - uuid="${uuid%0002}0002" - for disk in $(find /dev -type b); do - set -- $(dd if=$disk bs=1 skip=$((2*512+256+128+16)) count=16 2>/dev/null | hexdump -v -e '4/1 "%02x"' | awk '{ \ - for(i=1;i<9;i=i+2) first=substr($0,i,1) substr($0,i+1,1) first; \ - for(i=9;i<13;i=i+2) second=substr($0,i,1) substr($0,i+1,1) second; \ - for(i=13;i<16;i=i+2) third=substr($0,i,1) substr($0,i+1,1) third; \ - fourth = substr($0,17,4); \ - five = substr($0,21,12); \ - } END { print toupper(first"-"second"-"third"-"fourth"-"five) }') - if [ "$1" = "$uuid" ]; then - uevent="/sys/class/block/${disk##*/}/uevent" - export SAVE_PARTITIONS=0 - break - fi - done -;; PARTUUID=[a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9][a-f0-9]-02) uuid="${disk#PARTUUID=}" uuid="${uuid%-02}" @@ -178,6 +160,14 @@ export_partdevice() { return 1 } +hex_le32_to_cpu() { + [ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && { + echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}" + return + } + echo "$@" +} + get_partitions() { # local disk="$1" local filename="$2" @@ -185,8 +175,8 @@ get_partitions() { # if [ -b "$disk" -o -f "$disk" ]; then v "Reading partition table from $filename..." - local magic="$(hexdump -v -n 2 -s 0x1FE -e '1/2 "0x%04X"' "$disk")" - if [ "$magic" != 0xAA55 ]; then + local magic=$(dd if="$disk" bs=2 count=1 skip=255 2>/dev/null) + if [ "$magic" != $'\x55\xAA' ]; then v "Invalid partition table on $disk" exit fi @@ -197,9 +187,9 @@ get_partitions() { # for part in 1 2 3 4; do set -- $(hexdump -v -n 12 -s "$((0x1B2 + $part * 16))" -e '3/4 "0x%08X "' "$disk") - local type="$(($1 % 256))" - local lba="$(($2))" - local num="$(($3))" + local type="$(( $(hex_le32_to_cpu $1) % 256))" + local lba="$(( $(hex_le32_to_cpu $2) ))" + local num="$(( $(hex_le32_to_cpu $3) ))" [ $type -gt 0 ] || continue diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh index 563db4c32..42f488c11 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -239,30 +239,23 @@ nand_upgrade_ubifs() { nand_do_upgrade_success } -nand_board_name() { - if type 'platform_nand_board_name' >/dev/null 2>/dev/null; then - platform_nand_board_name - return - fi - - cat /tmp/sysinfo/board_name -} - nand_upgrade_tar() { local tar_file="$1" - local board_name="$(nand_board_name)" local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - local kernel_length=`(tar xf $tar_file sysupgrade-$board_name/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file sysupgrade-$board_name/root -O | wc -c) 2> /dev/null` + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} - local rootfs_type="$(identify_tar "$tar_file" sysupgrade-$board_name/root)" + local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` + local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` + + local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" local has_kernel=1 local has_env=0 [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file sysupgrade-$board_name/kernel -O | mtd write - $CI_KERNPART + tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART } [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 @@ -271,12 +264,12 @@ nand_upgrade_tar() { local ubidev="$( nand_find_ubi "$CI_UBIPART" )" [ "$has_kernel" = "1" ] && { local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - tar xf $tar_file sysupgrade-$board_name/kernel -O | \ + tar xf $tar_file ${board_dir}/kernel -O | \ ubiupdatevol /dev/$kern_ubivol -s $kernel_length - } local root_ubivol="$(nand_find_volume $ubidev rootfs)" - tar xf $tar_file sysupgrade-$board_name/root -O | \ + tar xf $tar_file ${board_dir}/root -O | \ ubiupdatevol /dev/$root_ubivol -s $rootfs_length - nand_do_upgrade_success diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 index d7f92a4f3..3985d8fd7 100755 --- a/package/base-files/files/lib/upgrade/stage2 +++ b/package/base-files/files/lib/upgrade/stage2 @@ -84,6 +84,7 @@ kill_remaining() { # [ [ ] ] local loop="${2:-0}" local run=true local stat + local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) echo -n "Sending $sig to remaining processes ... " @@ -96,8 +97,8 @@ kill_remaining() { # [ [ ] ] read pid name state ppid rest < $stat name="${name#(}"; name="${name%)}" - # Skip PID1, ourself and our children - [ $pid -ne 1 -a $pid -ne $$ -a $ppid -ne $$ ] || continue + # Skip PID1, our parent, ourself and our children + [ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue local cmdline read cmdline < /proc/$pid/cmdline diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 359f21f51..3fd612c37 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -108,14 +108,8 @@ add_uci_conffiles() { add_overlayfiles() { local file="$1" - if [ -d /overlay/upper ]; then - local overlaydir="/overlay/upper" - else - local overlaydir="/overlay" - fi - find $overlaydir/etc/ -type f -o -type l | sed \ + find /overlay/upper/etc/ -type f -o -type l | sed \ -e 's,^/overlay\/upper/,/,' \ - -e 's,^/overlay/,/,' \ -e '\,/META_[a-zA-Z0-9]*$,d' \ -e '\,/functions.sh$,d' \ -e '\,/[^/]*-opkg$,d' \ @@ -126,9 +120,16 @@ add_overlayfiles() { # hooks sysupgrade_image_check="fwtool_check_image platform_check_image" sysupgrade_pre_upgrade="fwtool_pre_upgrade" -[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \ - sysupgrade_init_conffiles="add_uci_conffiles" || \ + +if [ $SAVE_OVERLAY = 1 ]; then + [ ! -d /overlay/upper/etc ] && { + echo "Cannot find '/overlay/upper/etc', required for '-c'" + exit 1 + } sysupgrade_init_conffiles="add_overlayfiles" +else + sysupgrade_init_conffiles="add_uci_conffiles" +fi include /lib/upgrade @@ -152,7 +153,7 @@ do_save_conffiles() { } if [ $CONF_BACKUP_LIST -eq 1 ]; then - add_uci_conffiles "$CONFFILES" + run_hooks "$CONFFILES" $sysupgrade_init_conffiles cat "$CONFFILES" rm -f "$CONFFILES" exit 0 diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 21abf969e..82ade5940 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -1,8 +1,8 @@ NAME="%D" -VERSION="%V, %N" +VERSION="%V" ID="%d" ID_LIKE="lede openwrt" -PRETTY_NAME="%D %N %V" +PRETTY_NAME="%D %V" VERSION_ID="%v" HOME_URL="%m" BUG_URL="%b" @@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M" LEDE_DEVICE_MANUFACTURER_URL="%m" LEDE_DEVICE_PRODUCT="%P" LEDE_DEVICE_REVISION="%h" -LEDE_RELEASE="%D %N %V %C" +LEDE_RELEASE="%D %V %C" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 45ca1306f..dbbd60b15 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -163,13 +163,6 @@ if VERSIONOPT This is the name of the release distribution. If unspecified, it defaults to OpenWrt. - config VERSION_NICK - string - prompt "Release version nickname" - help - This is the release codename embedded in the image. - If unspecified, it defaults to the name of source branch. - config VERSION_NUMBER string prompt "Release version number" diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile new file mode 100644 index 000000000..88d4f6efa --- /dev/null +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Hauke Mehrtens +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=arm-trusted-firmware-sunxi +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware +PKG_SOURCE_DATE:=2016-07-12 +PKG_SOURCE_VERSION:=87e8aedd80e6448a55b2328768d956fcb5f5d410 +PKG_MIRROR_HASH:=4e71a7d4bc0613533854c646b0fa574b18503c0ab28621aac67c70b9827562d8 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=license.md + +PKG_MAINTAINER:=Hauke Mehrtens + +include $(INCLUDE_DIR)/package.mk + + +define Package/arm-trusted-firmware-sunxi + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for Allwinner + DEPENDS:=@TARGET_sunxi_cortexa53 +endef + +export GCC_HONOUR_COPTS=s + +MAKE_VARS = \ + CROSS_COMPILE="$(TARGET_CROSS)" + +MAKE_FLAGS += \ + PLAT=sun50iw1p1 \ + DEBUG=1 \ + bl31 + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/debug/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin +endef + +define Package/arm-trusted-firmware-sunxi/install +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-sunxi)) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile new file mode 100644 index 000000000..4571fedc0 --- /dev/null +++ b/package/boot/at91bootstrap/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (C) 2016 Microchip Technology Inc. +# +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=at91bootstrap +PKG_VERSION:=v3.8.8 +PKG_RELEASE:= + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git +PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db + +PKG_BUILD_DIR = \ + $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include at91bootstrap.mk +include $(INCLUDE_DIR)/package.mk + +define AT91Bootstrap/Default + BUILD_TARGET:=at91 + BUILD_SUBTARGET:=sama5 + AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin +endef + +define at91bootstrap/sama5d2_xplaineddf_uboot + TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define at91bootstrap/sama5d2_xplaineddf_qspi_uboot + TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define at91bootstrap/sama5d2_xplainedsd_uboot + TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define at91bootstrap/sama5d3_xplainednf_uboot + TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define at91bootstrap/sama5d3_xplainedsd_uboot + TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define at91bootstrap/sama5d4_xplainednf_uboot + TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define at91bootstrap/sama5d4_xplaineddf_uboot_secure + TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define at91bootstrap/sama5d4_xplainedsd_uboot_secure + TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +AT91BOOTSTRAP_TARGETS := \ + sama5d2_xplaineddf_uboot \ + sama5d2_xplaineddf_qspi_uboot \ + sama5d2_xplainedsd_uboot \ + sama5d3_xplainednf_uboot \ + sama5d3_xplainedsd_uboot \ + sama5d4_xplainednf_uboot_secure \ + sama5d4_xplaineddf_uboot_secure \ + sama5d4_xplainedsd_uboot_secure + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +$(eval $(call BuildPackage/AT91Bootstrap)) diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk new file mode 100644 index 000000000..dda5fa4e9 --- /dev/null +++ b/package/boot/at91bootstrap/at91bootstrap.mk @@ -0,0 +1,88 @@ + +PKG_TARGETS := bin +PKG_FLAGS:=nonshared + +export GCC_HONOUR_COPTS=s + +define Package/at91bootstrap/install/default + $(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/ +endef + +Package/at91bootstrap/install = $(Package/at91bootstrap/install/default) + +define AT91Bootstrap/Init + BUILD_TARGET:= + BUILD_SUBTARGET:= + BUILD_DEVICES:= + NAME:= + DEPENDS:= + HIDDEN:= + DEFAULT:= + VARIANT:=$(1) + AT91BOOTSTRAP_CONFIG:=$(1) +endef + +TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET)) + +AT91BOOTSTRAP_MAKE_FLAGS = \ + HOSTCC="$(HOSTCC)" \ + HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \ + HOSTLDFLAGS="" + +define Build/AT91Bootstrap/Target + $(eval $(call AT91Bootstrap/Init,$(1))) + $(eval $(call AT91Bootstrap/Default,$(1))) + $(eval $(call AT91Bootstrap/$(1),$(1))) + + define Package/at91bootstrap-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:= .$(NAME) + VARIANT:=$(VARIANT) + DEPENDS:=@!IN_SDK $(DEPENDS) + HIDDEN:=$(HIDDEN) + ifneq ($(BUILD_TARGET),) + DEPENDS += @$(TARGET_DEP) + ifneq ($(BUILD_DEVICES),) + DEFAULT := y if ($(TARGET_DEP)_Default \ + $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ + $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ + $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) + endif + endif + $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) + URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap + endef + + define Package/at91bootstrap-$(1)/install + $$(Package/at91bootstrap/install) + endef +endef + +define Build/Configure/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(AT91BOOTSTRAP_CONFIG)_defconfig +endef + + +define Build/Compile/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + $(AT91BOOTSTRAP_MAKE_FLAGS) +endef + +define BuildPackage/AT91Bootstrap/Defaults + Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) + Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) +endef + +define BuildPackage/AT91Bootstrap + $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(eval $(call Build/AT91Bootstrap/Target,$(type))) + ) + $(eval $(call Build/DefaultTargets)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(call BuildPackage,at91bootstrap-$(type)) + ) +endef diff --git a/package/boot/grub2/common.mk b/package/boot/grub2/Makefile similarity index 57% rename from package/boot/grub2/common.mk rename to package/boot/grub2/Makefile index 0f528f0b6..8cfc0dcff 100644 --- a/package/boot/grub2/common.mk +++ b/package/boot/grub2/Makefile @@ -1,24 +1,34 @@ +# +# Copyright (C) 2006-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=grub +PKG_CPE_ID:=cpe:/a:gnu:grub2 PKG_VERSION:=2.02 PKG_RELEASE:=1 -PKG_SOURCE:=grub-$(PKG_VERSION).tar.xz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/grub PKG_HASH:=810b3798d316394f94096ec2797909dbf23c858e48f7b3830826b8daa06b7b0f PKG_FIXUP:=autoreconf HOST_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=grub2/host PKG_SSP:=0 PKG_FLAGS:=nonshared -PATCH_DIR := ../patches -HOST_PATCH_DIR := ../patches - include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk -define Package/grub2/Default +define Package/grub2 CATEGORY:=Boot Loaders SECTION:=boot TITLE:=GRand Unified Bootloader @@ -26,6 +36,19 @@ define Package/grub2/Default DEPENDS:=@TARGET_x86||TARGET_x86_64 endef +define Package/grub2-editenv + CATEGORY:=Utilities + SECTION:=utils + SUBMENU:=Boot Loaders + TITLE:=Grub2 Environment editor + URL:=http://www.gnu.org/software/grub/ + DEPENDS:=@TARGET_x86||TARGET_x86_64 +endef + +define Package/grub2-editenv/description + Edit grub2 environment files. +endef + HOST_BUILD_PREFIX := $(STAGING_DIR_HOST) CONFIGURE_VARS += \ @@ -59,3 +82,11 @@ define Host/Configure $(Host/Configure/Default) endef +define Package/grub2-editenv/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/ +endef + +$(eval $(call HostBuild)) +$(eval $(call BuildPackage,grub2)) +$(eval $(call BuildPackage,grub2-editenv)) diff --git a/package/boot/grub2/grub2-efi/Makefile b/package/boot/grub2/grub2-efi/Makefile deleted file mode 100644 index 37e0b353e..000000000 --- a/package/boot/grub2/grub2-efi/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=grub-efi - -include ../common.mk - -TAR_OPTIONS:= --transform 's/grub-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}/' $(TAR_OPTIONS) - -PKG_BUILD_DEPENDS:=grub2-efi/host - -CONFIGURE_ARGS += --with-platform=efi -HOST_CONFIGURE_ARGS += --with-platform=efi --program-suffix=-efi - -define Package/grub2-efi -$(call Package/grub2/Default) -HIDDEN:=1 -TITLE += (with EFI support) -endef - -$(eval $(call HostBuild)) -$(eval $(call BuildPackage,grub2-efi)) diff --git a/package/boot/grub2/grub2/Makefile b/package/boot/grub2/grub2/Makefile deleted file mode 100644 index c00797662..000000000 --- a/package/boot/grub2/grub2/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=grub - -include ../common.mk - -PKG_BUILD_DEPENDS:=grub2/host - -define Package/grub2 -$(call Package/grub2/Default) -endef - -define Package/grub2-editenv - CATEGORY:=Utilities - SECTION:=utils - TITLE:=Grub2 Environment editor - URL:=http://www.gnu.org/software/grub/ - DEPENDS:=@TARGET_x86||TARGET_x86_64 -endef - -define Package/grub2-editenv/description - Edit grub2 environment files. -endef - -define Package/grub2-editenv/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/ -endef - -$(eval $(call HostBuild)) -$(eval $(call BuildPackage,grub2)) -$(eval $(call BuildPackage,grub2-editenv)) diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch index 67da93a32..8648dc8b9 100644 --- a/package/boot/kobs-ng/patches/001-compile.patch +++ b/package/boot/kobs-ng/patches/001-compile.patch @@ -10,13 +10,14 @@ #include --- a/src/mtd.h +++ b/src/mtd.h -@@ -25,8 +25,10 @@ +@@ -25,8 +25,11 @@ #ifndef MTD_H #define MTD_H +#define _GNU_SOURCE #include #include ++#include +#include #include "BootControlBlocks.h" diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile index 412f7ab11..9d9b97524 100644 --- a/package/boot/rbcfg/Makefile +++ b/package/boot/rbcfg/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rbcfg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c index 9aedcc55a..2acbfbd8c 100644 --- a/package/boot/rbcfg/src/main.c +++ b/package/boot/rbcfg/src/main.c @@ -2,6 +2,7 @@ * RouterBOOT configuration utility * * Copyright (C) 2010 Gabor Juhos + * Copyright (C) 2017 Thibaut VARENE * * 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 @@ -29,6 +30,7 @@ #define RB_ERR_INVALID 2 #define RB_ERR_NOMEM 3 #define RB_ERR_IO 4 +#define RB_ERR_NOTWANTED 5 #define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) @@ -67,6 +69,11 @@ struct rbcfg_command { int (*exec)(int argc, const char *argv[]); }; +struct rbcfg_soc { + const char *needle; + const int type; +}; + static void usage(void); /* Globals */ @@ -135,12 +142,32 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = { RB_CPU_MODE_REGULAR), }; +static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = { +}; + +static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), +}; + +static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), + CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3), +}; + static const struct rbcfg_value rbcfg_booter[] = { CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), }; -static const struct rbcfg_env rbcfg_envs[] = { +static struct rbcfg_env rbcfg_envs[] = { { .name = "boot_delay", .id = RB_ID_BOOT_DELAY, @@ -177,6 +204,12 @@ static const struct rbcfg_env rbcfg_envs[] = { .type = RBCFG_ENV_TYPE_U32, .values = rbcfg_cpu_mode, .num_values = ARRAY_SIZE(rbcfg_cpu_mode), + }, { + .name = "cpu_freq", + .id = RB_ID_CPU_FREQ, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_cpu_freq_dummy, + .num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy), }, { .name = "uart_speed", .id = RB_ID_UART_SPEED, @@ -240,8 +273,10 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buf += 2; buflen -= 2; - if (id == RB_ID_TERMINATOR) + if (id == RB_ID_TERMINATOR) { + ret = RB_ERR_NOTWANTED; break; + } if (buflen < len) break; @@ -257,7 +292,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buflen -= len; } - if (ret) + if (RB_ERR_NOTFOUND == ret) fprintf(stderr, "no tag found with id=%u\n", tag_id); return ret; @@ -748,6 +783,96 @@ usage(void) fprintf(stderr, "\n"); } +#define RBCFG_SOC_UNKNOWN 0 +#define RBCFG_SOC_QCA953X 1 +#define RBCFG_SOC_AR9344 2 + +static const struct rbcfg_soc rbcfg_socs[] = { + { + .needle = "QCA953", + .type = RBCFG_SOC_QCA953X, + }, { + .needle = "AR9344", + .type = RBCFG_SOC_AR9344, + }, +}; + +#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */ + +static int cpuinfo_find_soc(void) +{ + FILE *fp; + char temp[CPUINFO_BUFSIZE]; + char *haystack, *needle; + int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN; + + fp = fopen("/proc/cpuinfo", "r"); + if (!fp) + goto end; + + /* first, extract the system type line */ + needle = "system type"; + while(fgets(temp, CPUINFO_BUFSIZE, fp)) { + if (!strncmp(temp, needle, strlen(needle))) { + found = 1; + break; + } + } + + fclose(fp); + + /* failsafe in case cpuinfo format changes */ + if (!found) + goto end; + + /* skip the field header */ + haystack = strchr(temp, ':'); + + /* then, try to identify known SoC, stop at first match */ + for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) { + if ((strstr(haystack, rbcfg_socs[i].needle))) { + soc_type = rbcfg_socs[i].type; + break; + } + } + +end: + return soc_type; +} + +static void fixup_rbcfg_envs(void) +{ + int i, num_val, soc_type; + const struct rbcfg_value * env_value; + + /* detect SoC */ + soc_type = cpuinfo_find_soc(); + + /* update rbcfg_envs */ + switch (soc_type) { + case RBCFG_SOC_QCA953X: + env_value = rbcfg_cpu_freq_qca953x; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x); + break; + case RBCFG_SOC_AR9344: + env_value = rbcfg_cpu_freq_ar9344; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344); + break; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) { + if (RBCFG_SOC_UNKNOWN == soc_type) + rbcfg_envs[i].id = RB_ID_TERMINATOR; + else { + rbcfg_envs[i].values = env_value; + rbcfg_envs[i].num_values = num_val; + } + break; + } + } +} + int main(int argc, const char *argv[]) { const struct rbcfg_command *cmd = NULL; @@ -756,6 +881,8 @@ int main(int argc, const char *argv[]) rbcfg_name = (char *) argv[0]; + fixup_rbcfg_envs(); + if (argc < 2) { usage(); return EXIT_FAILURE; diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h index 864bc8217..88acc13dc 100644 --- a/package/boot/rbcfg/src/rbcfg.h +++ b/package/boot/rbcfg/src/rbcfg.h @@ -32,6 +32,7 @@ #define RB_ID_BOOT_PROTOCOL 9 #define RB_ID_SOFT_10 10 #define RB_ID_SOFT_11 11 +#define RB_ID_CPU_FREQ 12 #define RB_ID_BOOTER 13 #define RB_UART_SPEED_115200 0 @@ -71,6 +72,13 @@ #define RB_BOOT_PROTOCOL_BOOTP 0 #define RB_BOOT_PROTOCOL_DHCP 1 +#define RB_CPU_FREQ_L2 (0 << 3) +#define RB_CPU_FREQ_L1 (1 << 3) +#define RB_CPU_FREQ_N0 (2 << 3) +#define RB_CPU_FREQ_H1 (3 << 3) +#define RB_CPU_FREQ_H2 (4 << 3) +#define RB_CPU_FREQ_H3 (5 << 3) + #define RB_BOOTER_REGULAR 0 #define RB_BOOTER_BACKUP 1 diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index 6a806ff63..7c420f126 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -17,21 +17,73 @@ include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=at91 - BUILD_SUBTARGET:=legacy UBOOT_IMAGE:=u-boot.bin boot.bin endef define U-Boot/at91sam9m10g45ek_nandflash NAME:=AT91SAM9M10G45-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9m10g45ek endef define U-Boot/at91sam9x5ek_nandflash NAME:=AT91SAM9X5-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek +endef + +define U-Boot/sama5d3_xplained_nandflash + NAME:=SAMA5D3 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d3_xplained_mmc + NAME:=SAMA5D3 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d2_xplained_spiflash + NAME:=SAMA5D2 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d2_xplained_mmc + NAME:=SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d4_xplained_spiflash + NAME:=SAMA5D4 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_mmc + NAME:=SAMA5D4 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_nandflash + NAME:=SAMA5D4 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained endef UBOOT_TARGETS := \ at91sam9m10g45ek_nandflash \ - at91sam9x5ek_nandflash + at91sam9x5ek_nandflash \ + sama5d3_xplained_nandflash \ + sama5d3_xplained_mmc \ + sama5d2_xplained_mmc \ + sama5d2_xplained_spiflash \ + sama5d4_xplained_mmc \ + sama5d4_xplained_spiflash \ + sama5d4_xplained_nandflash define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 10175b0f7..57a2ec539 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\ ftp://ftp.denx.de/pub/u-boot PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 -PKG_BUILD_DEPENDS:=+fstools +PKG_BUILD_DEPENDS:=fstools PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE_FILES:=Licenses/README diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 0bdb6dea4..6acfa6969 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -66,6 +66,7 @@ dap-2695-a1|\ wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; +dr342|\ dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; @@ -76,6 +77,9 @@ rambutan) qihoo-c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +wi2a-ac200i) + ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq index d1a6668e8..f4541a559 100644 --- a/package/boot/uboot-envtools/files/lantiq +++ b/package/boot/uboot-envtools/files/lantiq @@ -13,19 +13,19 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -BTHOMEHUBV2B) +bt,homehub-v2b) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -BTHOMEHUBV3A) +bt,homehub-v3a) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1" ;; -GIGASX76X) +siemens,gigaset-sx76x) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -P2812HNUF1) +zyxel,p-2812hnu-f1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1" ;; -WBMR300) +buffalo,wbmr-300hpd) idx="$(find_mtd_index ubootconfig)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2" diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 70ba6a23b..ce200a1ff 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -20,7 +20,6 @@ all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; linkits7688|\ -linkits7688d|\ miwifi-nano|\ sk-wb8|\ wsr-1166|\ @@ -28,6 +27,9 @@ wsr-600|\ zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +mir3g) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index c2d8eaa73..929fca6ae 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2017.03 +PKG_VERSION:=2017.09 PKG_RELEASE:=1 -PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f +PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch index 0831f1092..10d8d4405 100644 --- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -27,23 +27,23 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 9205b1e..819bd3b 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME +@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME config TARGET_NAS220 - bool "BlackArmor NAS220" - + bool "BlackArmor NAS220" + +config TARGET_NSA310 + bool "Zyxel NSA310 Board" + config TARGET_NSA310S - bool "Zyxel NSA310S" - -@@ -77,6 +80,7 @@ source "board/raidsonic/ib62x0/Kconfig" + bool "Zyxel NSA310S" + +@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig" source "board/Seagate/dockstar/Kconfig" source "board/Seagate/goflexhome/Kconfig" source "board/Seagate/nas220/Kconfig" +source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" - + endif diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig new file mode 100644 @@ -528,7 +528,7 @@ new file mode 100644 index 0000000..d26ef35 --- /dev/null +++ b/configs/nsa310_defconfig -@@ -0,0 +1,22 @@ +@@ -0,0 +1,34 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_TARGET_NSA310=y @@ -544,19 +544,31 @@ index 0000000..d26ef35 +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y +CONFIG_CMD_USB=y ++CONFIG_CMD_DATE=y +CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y +CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y +CONFIG_CMD_UBI=y +CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h new file mode 100644 index 0000000..86ef825 --- /dev/null +++ b/include/configs/nsa310.h -@@ -0,0 +1,144 @@ +@@ -0,0 +1,126 @@ +/* Copyright (C) 2015-2016 bodhi + * + * Based on @@ -594,7 +606,7 @@ index 0000000..86ef825 + */ +#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ +#define CONFIG_KW88F6281 /* SOC Name */ -+#define CONFIG_MACH_NSA310 /* Machine type */ ++ +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ + +/* @@ -605,14 +617,8 @@ index 0000000..86ef825 +/* + * Commands configuration + */ -+#define CONFIG_CMD_ENV -+#define CONFIG_CMD_IDE -+#define CONFIG_CMD_NAND -+#define CONFIG_CMD_DATE +#define CONFIG_SYS_LONGHELP +#define CONFIG_PREBOOT -+#define CONFIG_SYS_HUSH_PARSER -+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " + +/* + * mv-common.h should be defined after CMD configs since it used them @@ -624,10 +630,7 @@ index 0000000..86ef825 + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#else -+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif + +/* max 4k env size is enough, but in case of nand @@ -665,7 +668,6 @@ index 0000000..86ef825 +#define CONFIG_NET_MULTI +#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_PHY_GIGE +#define CONFIG_RESET_PHY_R +#endif /* CONFIG_CMD_NET */ + @@ -680,24 +682,16 @@ index 0000000..86ef825 +/* + * File system + */ -+#define CONFIG_CMD_EXT4 -+#define CONFIG_CMD_JFFS2 +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_CMD_UBIFS -+#define CONFIG_RBTREE +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define CONFIG_MTD_PARTITIONS -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_LZO + +/* + * Date Time + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV -+#define CONFIG_CMD_SNTP -+#define CONFIG_CMD_DNS +#endif /* CONFIG_CMD_DATE */ + +#endif /* _CONFIG_NSA310_H */ diff --git a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch index 0bb79fa4e..4b4356e5d 100644 --- a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch +++ b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch @@ -2,22 +2,22 @@ diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig index 819bd3b..6a2d578 100644 --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -59,6 +59,9 @@ config TARGET_NSA310 +@@ -62,6 +62,9 @@ config TARGET_NSA310 config TARGET_NSA310S - bool "Zyxel NSA310S" - + bool "Zyxel NSA310S" + +config TARGET_NSA325 + bool "Zyxel NSA325 board" + endchoice - + config SYS_SOC -@@ -82,5 +85,6 @@ source "board/Seagate/goflexhome/Kconfig" +@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" +source "board/zyxel/nsa325/Kconfig" - + endif diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig new file mode 100644 @@ -511,7 +511,7 @@ new file mode 100644 index 0000000..48e09cc --- /dev/null +++ b/configs/nsa325_defconfig -@@ -0,0 +1,22 @@ +@@ -0,0 +1,34 @@ +CONFIG_ARM=y +CONFIG_KIRKWOOD=y +CONFIG_TARGET_NSA325=y @@ -527,19 +527,31 @@ index 0000000..48e09cc +CONFIG_CMD_DHCP=y +CONFIG_CMD_MII=y +CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y +CONFIG_CMD_USB=y +CONFIG_USB=y ++CONFIG_CMD_DATE=y +CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y +CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y +CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y +CONFIG_CMD_UBI=y ++CONFIG_USB_EHCI_HCD=y +CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h new file mode 100644 index 0000000..e5a8e2a --- /dev/null +++ b/include/configs/nsa325.h -@@ -0,0 +1,148 @@ +@@ -0,0 +1,129 @@ +/* + * (C) Copyright 2016 bodhi + * @@ -579,7 +591,6 @@ index 0000000..e5a8e2a + * High Level Configuration Options (easy to change) + */ +#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ -+#define CONFIG_KIRKWOOD 1 /* SOC Family Name */ +#define CONFIG_KW88F6281 1 /* SOC Name */ + +#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ @@ -592,14 +603,8 @@ index 0000000..e5a8e2a +/* + * Commands configuration + */ -+#define CONFIG_CMD_ENV -+#define CONFIG_CMD_IDE -+#define CONFIG_CMD_NAND -+#define CONFIG_CMD_DATE +#define CONFIG_SYS_LONGHELP +#define CONFIG_PREBOOT -+#define CONFIG_SYS_HUSH_PARSER -+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> " + +/* + * mv-common.h should be defined after CMD configs since it used them @@ -611,10 +616,7 @@ index 0000000..e5a8e2a + * Environment variables configurations + */ +#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_IS_IN_NAND 1 +#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#else -+#define CONFIG_ENV_IS_NOWHERE 1 /* if env in SDRAM */ +#endif +/* + * max 4k env size is enough, but in case of nand @@ -650,7 +652,6 @@ index 0000000..e5a8e2a +#ifdef CONFIG_CMD_NET +#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ +#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_PHY_GIGE +#define CONFIG_NETCONSOLE +#endif /* CONFIG_CMD_NET */ + @@ -665,24 +666,16 @@ index 0000000..e5a8e2a +/* + * File system + */ -+#define CONFIG_CMD_EXT4 -+#define CONFIG_CMD_JFFS2 +#define CONFIG_JFFS2_NAND +#define CONFIG_JFFS2_LZO -+#define CONFIG_CMD_UBIFS -+#define CONFIG_RBTREE +#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ +#define CONFIG_MTD_PARTITIONS -+#define CONFIG_CMD_MTDPARTS -+#define CONFIG_LZO + +/* + * Date Time + */ +#ifdef CONFIG_CMD_DATE +#define CONFIG_RTC_MV -+#define CONFIG_CMD_SNTP -+#define CONFIG_CMD_DNS +#endif /* CONFIG_CMD_DATE */ + +#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 46b838f30..94d62cee8 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -7,8 +7,8 @@ +#define CONFIG_SYS_MVFS /* - * Commands configuration -@@ -45,29 +46,29 @@ + * mv-common.h should be defined after CMD configs since it used them +@@ -37,29 +38,29 @@ * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index 1f1ce75f2..bd1dab818 100644 --- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch +++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch @@ -1,7 +1,7 @@ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -51,30 +51,29 @@ - #define CONFIG_ENV_IS_NOWHERE +@@ -44,30 +44,29 @@ + #define CONFIG_ENV_SECT_SIZE 0x20000 #endif #define CONFIG_ENV_SIZE 0x20000 -#define CONFIG_ENV_OFFSET 0x80000 @@ -42,8 +42,8 @@ * Ethernet driver configuration --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -9,6 +9,7 @@ CONFIG_SYS_PROMPT="iconnect => " - # CONFIG_CMD_FLASH is not set +@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => " + CONFIG_CMD_NAND=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch index 1be0c6251..58db8c8c8 100644 --- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch +++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch @@ -1,6 +1,6 @@ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -54,27 +54,22 @@ +@@ -49,27 +49,22 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch index 871affc1a..5c8ff35be 100644 --- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -1,6 +1,6 @@ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -49,23 +49,30 @@ +@@ -44,23 +44,30 @@ #endif #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch index a7fa8e6f9..88b833072 100644 --- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch +++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch @@ -1,16 +1,15 @@ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -77,20 +77,18 @@ +@@ -70,20 +70,18 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ - "ubi part root; " \ - "ubifsmount ubi:root; " \ - "ubifsload 0x800000 ${kernel}; " \ -- "bootm 0x800000" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ -+ "bootm 0x800000" + "bootm 0x800000" #define CONFIG_MTDPARTS \ - "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 278498592..d6246dc93 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,43 +1,43 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -87,4 +87,7 @@ source "board/Seagate/nas220/Kconfig" +@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" source "board/zyxel/nsa325/Kconfig" - + +config SECOND_STAGE + bool "OpenWrt second stage hack" + endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -89,4 +89,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO - +@@ -76,4 +76,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_DOCKSTAR_H */ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -99,4 +99,6 @@ +@@ -94,4 +94,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -94,4 +94,6 @@ +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS - #define CONFIG_CMD_MTDPARTS - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h -@@ -0,0 +1,40 @@ +@@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -47,9 +47,6 @@ +#ifndef __OPENWRT_KIRKWOOD_COMMON_H +#define __OPENWRT_KIRKWOOD_COMMON_H + -+/* Commands */ -+#define CONFIG_CMD_BOOTZ -+ +/* Ethernet */ +#if defined(CONFIG_CMD_NET) +#define CONFIG_SERVERIP 192.168.1.2 @@ -63,14 +60,8 @@ +#define CONFIG_ENV_IS_NOWHERE +#endif + -+/* Flattened uImage Tree */ -+#define CONFIG_FIT 1 -+#define CONFIG_FIT_VERBOSE 1 -+ +/* Various */ +#define CONFIG_BZIP2 -+#define CONFIG_LZMA -+#define CONFIG_LZO + +/* Unnecessary */ +#undef CONFIG_BOOTM_NETBSD @@ -80,37 +71,119 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -93,4 +93,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO - +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_POGO_E02_H */ --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h -@@ -99,4 +99,6 @@ +@@ -96,4 +96,6 @@ #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET - #endif /* CONFIG_CMD_IDE */ - + #endif /* CONFIG_IDE */ + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_SHEEVAPLUG_H */ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -112,4 +112,6 @@ +@@ -105,4 +105,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_GOFLEXHOME_H */ --- a/include/configs/nsa310.h +++ b/include/configs/nsa310.h -@@ -141,4 +141,6 @@ - #define CONFIG_CMD_DNS +@@ -123,4 +123,6 @@ + #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ - + +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_NSA310_H */ +--- a/configs/dockstar_defconfig ++++ b/configs/dockstar_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/goflexhome_defconfig ++++ b/configs/goflexhome_defconfig +@@ -29,3 +29,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/ib62x0_defconfig ++++ b/configs/ib62x0_defconfig +@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/iconnect_defconfig ++++ b/configs/iconnect_defconfig +@@ -24,5 +24,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/nsa310_defconfig ++++ b/configs/nsa310_defconfig +@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y + CONFIG_LZMA=y + CONFIG_LZO=y +--- a/configs/pogo_e02_defconfig ++++ b/configs/pogo_e02_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/sheevaplug_defconfig ++++ b/configs/sheevaplug_defconfig +@@ -28,5 +28,8 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/package/boot/uboot-lantiq/Makefile b/package/boot/uboot-lantiq/Makefile index 94b604af3..5493737d3 100644 --- a/package/boot/uboot-lantiq/Makefile +++ b/package/boot/uboot-lantiq/Makefile @@ -26,205 +26,205 @@ endef define U-Boot/arv4519pw_ram NAME:=Arcadyan arv4519pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h endef define U-Boot/arv4519pw_nor NAME:=Arcadyan arv4519pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw endef define U-Boot/arv4519pw_brn NAME:=Arcadyan arv4519pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4519PW + BUILD_DEVICES:=arcadyan_arv4519pw endef define U-Boot/arv7506pw11_ram NAME:=Arcadyan ARV7506PW11 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h endef define U-Boot/arv7506pw11_nor NAME:=Arcadyan ARV7506PW11 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 endef define U-Boot/arv7506pw11_brn NAME:=Arcadyan ARV7506PW11 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7506PW11 + BUILD_DEVICES:=arcadyan_arv7506pw11 endef define U-Boot/arv7510pw_ram NAME:=Arcadyan arv7510pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h endef define U-Boot/arv7510pw_nor NAME:=Arcadyan arv7510pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw endef define U-Boot/arv7510pw_brn NAME:=Arcadyan arv7510pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV4510PW + BUILD_DEVICES:=arcadyan_arv4510pw endef define U-Boot/arv7510pw22_ram NAME:=Arcadyan arv7510pw22 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h endef define U-Boot/arv7510pw22_nor NAME:=Arcadyan arv7510pw22 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 endef define U-Boot/arv7510pw22_brn NAME:=Arcadyan arv7510pw22 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7510PW22 + BUILD_DEVICES:=arcadyan_arv7510pw22 endef define U-Boot/arv7518pw_ram NAME:=Arcadyan arv7518pw (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h endef define U-Boot/arv7518pw_nor NAME:=Arcadyan arv7518pw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw endef define U-Boot/arv7518pw_brn NAME:=Arcadyan arv7518pw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV7518PW + BUILD_DEVICES:=arcadyan_arv7518pw endef define U-Boot/arv752dpw_ram NAME:=Arcadyan arv752dpw (RAM) BUILD_SUBTARGET:=xway DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw_nor NAME:=Arcadyan arv752dpw (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw_brn NAME:=Arcadyan arv752dpw (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW + BUILD_DEVICES:=arcadyan_arv752dpw endef define U-Boot/arv752dpw22_ram NAME:=Arcadyan arv752dpw22 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h endef define U-Boot/arv752dpw22_nor NAME:=Arcadyan arv752dpw22 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 endef define U-Boot/arv752dpw22_brn NAME:=Arcadyan arv752dpw22 (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV752DPW22 + BUILD_DEVICES:=arcadyan_arv752dpw22 endef define U-Boot/arv8539pw22_ram NAME:=Speedport W 504V Typ A (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h endef define U-Boot/arv8539pw22_nor NAME:=Speedport W 504V Typ A (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 endef define U-Boot/arv8539pw22_brn NAME:=Speedport W 504V Typ A (BRN) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ARV8539PW22 + BUILD_DEVICES:=arcadyan_arv8539pw22 endef define U-Boot/gigasx76x_ram NAME:=Siemens Gigaset sx76x (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=GIGASX76X + BUILD_DEVICES:=siemens_gigaset-sx76x DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h endef define U-Boot/gigasx76x_nor NAME:=Siemens Gigaset sx76x (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=GIGASX76X + BUILD_DEVICES:=siemens_gigaset-sx76x endef define U-Boot/acmp252_ram NAME:=AudioCodes MP-252 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ACMP252 + BUILD_DEVICES:=audiocodes_mp-252 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h endef define U-Boot/acmp252_nor NAME:=AudioCodes MP-252 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=ACMP252 + BUILD_DEVICES:=audiocodes_mp-252 endef define U-Boot/bthomehubv5a_ram NAME:=BT Home Hub 5A (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=BTHOMEHUBV5A + BUILD_DEVICES:=bt_homehub-v5a DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h endef define U-Boot/easy50712_ram NAME:=Lantiq EASY50712 (RAM) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h endef define U-Boot/easy50712_nor NAME:=Lantiq EASY50712 (NOR) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 endef define U-Boot/easy50712_norspl NAME:=Lantiq EASY50712 (NOR SPL) BUILD_SUBTARGET:=xway - BUILD_DEVICES:=EASY50712 + BUILD_DEVICES:=lantiq_easy50712 UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPENDS+=@BROKEN endef @@ -232,20 +232,20 @@ endef define U-Boot/easy80920_ram NAME:=Lantiq EASY80920 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h endef define U-Boot/easy80920_nor NAME:=Lantiq EASY80920 (NOR) - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand BUILD_SUBTARGET:=xrx200 endef define U-Boot/easy80920_norspl NAME:=Lantiq EASY80920 (NOR SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand UBOOT_IMAGE:=u-boot.ltq.lzo.norspl DEPENDS+=@BROKEN endef @@ -253,7 +253,7 @@ endef define U-Boot/easy80920_sfspl NAME:=Lantiq EASY80920 (SPI SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=EASY80920NOR EASY80920NAND + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPENDS+=@BROKEN endef @@ -261,20 +261,20 @@ endef define U-Boot/fb3370_eva NAME:=AVM FRITZ3370 (EVA) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 endef define U-Boot/fb3370_ram NAME:=AVM FRITZ3370 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h endef define U-Boot/fb3370_sfspl NAME:=AVM FRITZ3370 (SPI SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=FRITZ3370 + BUILD_DEVICES:=avm_fritz3370 UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl DEPENDS+=@BROKEN endef @@ -282,14 +282,14 @@ endef define U-Boot/p2812hnufx_ram NAME:=ZyXEL P-2812HNU-Fx (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=P2812HNUF1 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h endef define U-Boot/p2812hnufx_nandspl NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=P2812HNUF1 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl DEPENDS+=@BROKEN endef @@ -297,38 +297,38 @@ endef define U-Boot/vgv7510kw22_brn NAME:=Arcadyan VGV7510KW22 (BRN) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef define U-Boot/vgv7510kw22_nor NAME:=Arcadyan VGV7510KW22 (NOR) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef define U-Boot/vgv7510kw22_ram NAME:=Arcadyan VGV7510KW22 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7510KW22NOR + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h endef define U-Boot/vgv7519_brn NAME:=Arcadyan VGV7519 (BRN) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef define U-Boot/vgv7519_nor NAME:=Arcadyan VGV7519 (NOR) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef define U-Boot/vgv7519_ram NAME:=Arcadyan VGV7519 (RAM) BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=VGV7519NOR VGV7519BRN + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h endef diff --git a/package/boot/uboot-layerscape-32b/Makefile b/package/boot/uboot-layerscape-32b/Makefile deleted file mode 100644 index 2ea03e5f4..000000000 --- a/package/boot/uboot-layerscape-32b/Makefile +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=uboot-layerscape-32bit -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=a29edbeddde4b3007ac349c2a5ee434719049ac4753e459dbb1bab21e1c585da -PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git -PKG_SOURCE_VERSION:=6476195551ea83193afd06d0c441483c04729c8d - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_MAINTAINER:=Jiang Yutang - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/kernel.mk - -define Package/uboot-layerscape-32b - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_layerscape_32b - TITLE:=32-bit U-Boot for Layerscape boards - DEFAULT:=y - HIDDEN:=1 -endef - -define Build/Configure - -endef - -define Build/Compile - -endef - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin.swap $(STAGING_DIR_IMAGE)/ls1012ardb-32b-uboot.bin -endef - -$(eval $(call BuildPackage,uboot-layerscape-32b)) diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile new file mode 100644 index 000000000..d1ca82917 --- /dev/null +++ b/package/boot/uboot-layerscape-armv8_32b/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uboot-layerscape-armv8_32b +PKG_SOURCE_DATE:=2017-10-24 +PKG_RELEASE:=1 + +# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit +# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets, +# 64-bit u-boot images git tree is provided here whose source code actually is +# uboot-layerscape's source code. +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git +PKG_SOURCE_VERSION:=43cb4c0fcab237f8daa39c393cc1441b76b99fcf +PKG_MIRROR_HASH:=ff7d1fcb85dda2be6a9e3785821b5791c7189d2d412b160a9621bb2dcad24dea + +PKG_MAINTAINER:=Yangbo Lu + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/uboot-layerscape-armv8_32b + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_layerscape_armv8_32b + TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards + DEFAULT:=y + HIDDEN:=1 +endef + +define Build/Configure + +endef + +define Build/Compile + +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin +endef + +$(eval $(call BuildPackage,uboot-layerscape-armv8_32b)) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index f98205335..c37b335b4 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=uboot-layerscape -PKG_VERSION:=v1.0 +PKG_SOURCE_DATE:=2017-08-24 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=462fea9bdf03ec4bc23f2f1bb3917c2ec57017eca1e11b8a609bf60cd51a94e7 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git -PKG_SOURCE_VERSION:=69b5ea576a2b0448391a910114d6c05859bf78d0 +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git +PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af +PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk define U-Boot/Default BUILD_TARGET:=layerscape - BUILD_SUBTARGET:=64b + BUILD_SUBTARGET:=armv8_64b BUILD_DEVICES:=$(1) UBOOT_IMAGE:=u-boot-dtb.bin HIDDEN:=y @@ -40,17 +40,34 @@ endef define U-Boot/ls1012ardb NAME:=NXP ls1012ardb 64b Dev Board UBOOT_CONFIG:=ls1012ardb_qspi - UBOOT_IMAGE:=u-boot-swap.bin +endef + +define U-Boot/ls1088ardb + NAME:=NXP ls1088ardb 64b Dev Board + UBOOT_CONFIG:=ls1088ardb_qspi +endef + +define U-Boot/ls2088ardb + NAME:=NXP ls2088ardb 64b Dev Board + UBOOT_CONFIG:=ls2080ardb +endef + +define U-Boot/ls1012afrdm + NAME:=NXP ls1012afrdm 64b Dev Board + UBOOT_CONFIG:=ls1012afrdm_qspi endef UBOOT_TARGETS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-64b-uboot.bin + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin endef define Package/u-boot/install/default diff --git a/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch new file mode 100644 index 000000000..597383166 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch @@ -0,0 +1,51 @@ +From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:00:12 +0800 +Subject: [PATCH 1/3] armv8: ls1043a: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1043a_common.h | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h +index 0b3fb4e..5c01111 100644 +--- a/include/configs/ls1043a_common.h ++++ b/include/configs/ls1043a_common.h +@@ -336,7 +336,19 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \ ++ "cp.b 61000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #undef CONFIG_BOOTCOMMAND +@@ -351,6 +363,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0500 " \ + MTDPARTS_DEFAULT +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..418f6287f --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,57 @@ +From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:36:43 +0800 +Subject: [PATCH 2/3] armv8: ls1046ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1046a_common.h | 15 ++++++++++++++- + include/configs/ls1046ardb.h | 6 ++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h +index 4fc2f94..53bd41b 100644 +--- a/include/configs/ls1046a_common.h ++++ b/include/configs/ls1046a_common.h +@@ -276,7 +276,20 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ +diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h +index f8c15a6..c3b50b1 100644 +--- a/include/configs/ls1046ardb.h ++++ b/include/configs/ls1046ardb.h +@@ -251,6 +251,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \ + "15m(u-boot),48m(kernel.itb);" \ + "7e800000.flash:16m(nand_uboot)," \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..e8bbe7faa --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,51 @@ +From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 28 Sep 2017 11:25:58 +0800 +Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012ardb.h | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h +index 5fe3218..242cdf0 100644 +--- a/include/configs/ls1012ardb.h ++++ b/include/configs/ls1012ardb.h +@@ -127,13 +127,32 @@ + "$kernel_addr $kernel_size; env exists secureboot " \ + "&& sf read $kernelheader_addr_r $kernelheader_addr " \ + "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ + "env exists secureboot && esbc_halt;" + #endif ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + + #include + +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..eaf0da283 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,58 @@ +From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 11:57:36 +0800 +Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h +index 7bd152d..4cefa40 100644 +--- a/include/configs/ls1088ardb.h ++++ b/include/configs/ls1088ardb.h +@@ -404,7 +404,20 @@ + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$BOARD\0" ++ "bootm $load_addr#$BOARD\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock10 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) +@@ -429,6 +442,18 @@ + "run distro_bootcmd;run sd_bootcmd;" \ + "env exists secureboot && esbc_halt;" + #endif ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \ ++ "sf read 0x80300000 0xE00000 0x100000;" \ ++ "fsl_mc start mc 0x80000000 0x80300000;" \ ++ "sf read 0x80400000 0xd00000 0x100000;" \ ++ "fsl_mc apply dpl 0x80400000;" \ ++ "run lede_boot;" ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* MAC/PHY configuration */ + #ifdef CONFIG_FSL_MC_ENET + #define CONFIG_PHYLIB_10G +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..6da256ab0 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,54 @@ +From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 12:37:05 +0800 +Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h +index 8a34990..8ae3944 100644 +--- a/include/configs/ls2080ardb.h ++++ b/include/configs/ls2080ardb.h +@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \ ++ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \ ++ "cp.b 581000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_QSPI_BOOT +@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "fsl_mc start mc 0x580a00000 0x580e00000;" \ ++ "fsl_mc apply dpl 0x580d00000;" \ ++ "run lede_boot;" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #undef CONFIG_BOOTARGS + #define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0600 " \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch new file mode 100644 index 000000000..45010a210 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch @@ -0,0 +1,49 @@ +From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Tue, 24 Oct 2017 17:48:08 +0800 +Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012afrdm.h | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h +index a3f8824d27..36dff19bdd 100644 +--- a/include/configs/ls1012afrdm.h ++++ b/include/configs/ls1012afrdm.h +@@ -73,12 +73,31 @@ + "qspi_bootcmd=echo Trying load from qspi..;" \ + "sf probe && sf read $load_addr " \ + "$kernel_addr $kernel_size && bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* + * USB + */ +-- +2.14.1 + diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 2c280faa2..b29039cd8 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -16,6 +16,8 @@ PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk +UBOOT_MAKE_FLAGS:= + define U-Boot/Default BUILD_TARGET:=mvebu HIDDEN:=1 diff --git a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch index 9a74c52c6..ca734660e 100644 --- a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch +++ b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch @@ -11,18 +11,14 @@ Signed-off-by: Josua Mayer configs/clearfog_defconfig | 1 + 1 file changed, 1 insertion(+) -diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig -index 41e94e6daf..f3572971be 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig -@@ -34,6 +34,7 @@ CONFIG_CMD_EXT2=y - CONFIG_CMD_EXT4=y - CONFIG_CMD_FAT=y - CONFIG_CMD_FS_GENERIC=y +@@ -23,7 +23,7 @@ CONFIG_CMD_SF=y + CONFIG_CMD_SPI=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y +-# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_SETEXPR=y - CONFIG_EFI_PARTITION=y - # CONFIG_PARTITION_UUIDS is not set - # CONFIG_SPL_PARTITION_UUIDS is not set --- -2.12.2 - + CONFIG_CMD_TFTPPUT=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y diff --git a/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 000000000..fbbfe462b --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,153 @@ +From 59be82ef7e7ec4be6e1597d8aef65dd3d8c3a0d9 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:19 +0200 +Subject: [PATCH 1/2] rsa: Fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. +--- + lib/rsa/rsa-sign.c | 44 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 38 insertions(+), 6 deletions(-) + +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -20,6 +21,19 @@ + #define HAVE_ERR_REMOVE_THREAD_STATE + #endif + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++#endif ++ + static int rsa_err(const char *msg) + { + unsigned long sslErr = ERR_get_error(); +@@ -286,16 +300,22 @@ static int rsa_init(void) + { + int ret; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ret = SSL_library_init(); ++#else ++ ret = OPENSSL_init_ssl(0, NULL); ++#endif + if (!ret) { + fprintf(stderr, "Failure to init SSL library\n"); + return -1; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_load_error_strings(); + + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_digests(); + OpenSSL_add_all_ciphers(); ++#endif + + return 0; + } +@@ -335,12 +355,15 @@ err_set_rsa: + err_engine_init: + ENGINE_free(e); + err_engine_by_id: ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ENGINE_cleanup(); ++#endif + return ret; + } + + static void rsa_remove(void) + { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + #ifdef HAVE_ERR_REMOVE_THREAD_STATE +@@ -349,6 +372,7 @@ static void rsa_remove(void) + ERR_remove_state(0); + #endif + EVP_cleanup(); ++#endif + } + + static void rsa_engine_remove(ENGINE *e) +@@ -409,7 +433,11 @@ static int rsa_sign_with_key(RSA *rsa, s + ret = rsa_err("Could not obtain signature"); + goto err_sign; + } +- EVP_MD_CTX_cleanup(context); ++ #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_MD_CTX_cleanup(context); ++ #else ++ EVP_MD_CTX_reset(context); ++ #endif + EVP_MD_CTX_destroy(context); + EVP_PKEY_free(key); + +@@ -479,6 +507,7 @@ static int rsa_get_exponent(RSA *key, ui + { + int ret; + BIGNUM *bn_te; ++ const BIGNUM *key_e; + uint64_t te; + + ret = -EINVAL; +@@ -487,17 +516,18 @@ static int rsa_get_exponent(RSA *key, ui + if (!e) + goto cleanup; + +- if (BN_num_bits(key->e) > 64) ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ if (BN_num_bits(key_e) > 64) + goto cleanup; + +- *e = BN_get_word(key->e); ++ *e = BN_get_word(key_e); + +- if (BN_num_bits(key->e) < 33) { ++ if (BN_num_bits(key_e) < 33) { + ret = 0; + goto cleanup; + } + +- bn_te = BN_dup(key->e); ++ bn_te = BN_dup(key_e); + if (!bn_te) + goto cleanup; + +@@ -527,6 +557,7 @@ int rsa_get_params(RSA *key, uint64_t *e + { + BIGNUM *big1, *big2, *big32, *big2_32; + BIGNUM *n, *r, *r_squared, *tmp; ++ const BIGNUM *key_n; + BN_CTX *bn_ctx = BN_CTX_new(); + int ret = 0; + +@@ -548,7 +579,8 @@ int rsa_get_params(RSA *key, uint64_t *e + if (0 != rsa_get_exponent(key, exponent)) + ret = -1; + +- if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) || ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ if (!BN_copy(n, key_n) || !BN_set_word(big1, 1L) || + !BN_set_word(big2, 2L) || !BN_set_word(big32, 32L)) + ret = -1; + diff --git a/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 000000000..882969905 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,96 @@ +From 65030804dc57f3488e4ffe21e72fc65cd245cb98 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:20 +0200 +Subject: [PATCH 2/2] tools: kwbimage fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. + +Signed-off-by: Jelle van der Waa +--- + tools/kwbimage.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +--- a/tools/kwbimage.c ++++ b/tools/kwbimage.c +@@ -18,10 +18,30 @@ + #include "kwbimage.h" + + #ifdef CONFIG_KWB_SECURE ++#include + #include + #include + #include + #include ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++ ++#else ++void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) ++{ ++ EVP_MD_CTX_reset(ctx); ++} ++#endif + #endif + + static struct image_cfg_element *image_cfg; +@@ -470,12 +490,16 @@ static int kwb_export_pubkey(RSA *key, s + char *keyname) + { + int size_exp, size_mod, size_seq; ++ const BIGNUM *key_e, *key_n; + uint8_t *cur; + char *errmsg = "Failed to encode %s\n"; + +- if (!key || !key->e || !key->n || !dst) { ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ ++ if (!key || !key_e || !key_n || !dst) { + fprintf(stderr, "export pk failed: (%p, %p, %p, %p)", +- key, key->e, key->n, dst); ++ key, key_e, key_n, dst); + fprintf(stderr, errmsg, keyname); + return -EINVAL; + } +@@ -490,8 +514,8 @@ static int kwb_export_pubkey(RSA *key, s + * do the encoding manually. + */ + +- size_exp = BN_num_bytes(key->e); +- size_mod = BN_num_bytes(key->n); ++ size_exp = BN_num_bytes(key_e); ++ size_mod = BN_num_bytes(key_n); + size_seq = 4 + size_mod + 4 + size_exp; + + if (size_mod > 256) { +@@ -520,14 +544,14 @@ static int kwb_export_pubkey(RSA *key, s + *cur++ = 0x82; + *cur++ = (size_mod >> 8) & 0xFF; + *cur++ = size_mod & 0xFF; +- BN_bn2bin(key->n, cur); ++ BN_bn2bin(key_n, cur); + cur += size_mod; + /* Exponent */ + *cur++ = 0x02; /* INTEGER */ + *cur++ = 0x82; + *cur++ = (size_exp >> 8) & 0xFF; + *cur++ = size_exp & 0xFF; +- BN_bn2bin(key->e, cur); ++ BN_bn2bin(key_e, cur); + + if (hashf) { + struct hash_v1 pk_hash; diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index bb58104d0..056300e18 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2016.03 +PKG_VERSION:=2017.07 -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb +PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff PKG_MAINTAINER:=Zoltan HERPAI @@ -26,93 +26,162 @@ define U-Boot/Default endef define U-Boot/A10-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa8 NAME:=A10 OLinuXino LIME BUILD_DEVICES:=sun4i-a10-olinuxino-lime endef define U-Boot/A13-OLinuXino + BUILD_SUBTARGET:=cortexa8 NAME:=A13 OlinuXino BUILD_DEVICES:=sun5i-a13-olinuxino endef define U-Boot/A20-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino LIME BUILD_DEVICES:=sun7i-a20-olinuxino-lime endef +define U-Boot/A20-OLinuXino-Lime2 + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 +endef + +define U-Boot/A20-OLinuXino-Lime2-eMMC + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 eMMC + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc +endef + define U-Boot/A20-OLinuXino_MICRO + BUILD_SUBTARGET:=cortexa7 NAME:=A20 OLinuXino MICRO BUILD_DEVICES:=sun7i-a20-olinuxino-micro endef define U-Boot/Bananapi + BUILD_SUBTARGET:=cortexa7 NAME:=Bananapi BUILD_DEVICES:=sun7i-a20-bananapi endef define U-Boot/Bananapro + BUILD_SUBTARGET:=cortexa7 NAME:=Bananapro BUILD_DEVICES:=sun7i-a20-bananapro endef define U-Boot/Cubieboard + BUILD_SUBTARGET:=cortexa8 NAME:=Cubieboard BUILD_DEVICES:=sun4i-a10-cubieboard endef define U-Boot/Cubieboard2 + BUILD_SUBTARGET:=cortexa7 NAME:=Cubieboard2 BUILD_DEVICES:=sun7i-a20-cubieboard2 endef define U-Boot/Cubietruck + BUILD_SUBTARGET:=cortexa7 NAME:=Cubietruck BUILD_DEVICES:=sun7i-a20-cubietruck endef define U-Boot/Hummingbird_A31 + BUILD_SUBTARGET:=cortexa7 NAME:=Hummingbird A31 board endef +define U-Boot/Marsboard_A10 + BUILD_SUBTARGET:=cortexa8 + NAME:=Marsboard + BUILD_DEVICES:=sun4i-a10-marsboard +endef + define U-Boot/Mele_M9 + BUILD_SUBTARGET:=cortexa7 NAME:=Mele M9 (A31) BUILD_DEVICES:=sun6i-a31-m9 endef define U-Boot/OLIMEX_A13_SOM + BUILD_SUBTARGET:=cortexa8 NAME:=Olimex A13 SOM BUILD_DEVICES:=sun5i-a13-olimex-som endef define U-Boot/Linksprite_pcDuino + BUILD_SUBTARGET:=cortexa8 NAME:=Linksprite pcDuino BUILD_DEVICES:=sun4i-a10-pcduino endef define U-Boot/Linksprite_pcDuino3 + BUILD_SUBTARGET:=cortexa7 NAME:=Linksprite pcDuino3 BUILD_DEVICES:=sun7i-a20-pcduino3 endef define U-Boot/Lamobo_R1 + BUILD_SUBTARGET:=cortexa7 NAME:=Lamobo R1 BUILD_DEVICES:=sun7i-a20-lamobo-r1 endef +define U-Boot/nanopi_m1_plus + BUILD_SUBTARGET:=cortexa7 + NAME:=NanoPi M1 Plus (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus +endef + +define U-Boot/nanopi_neo + BUILD_SUBTARGET:=cortexa7 + NAME:=U-Boot for NanoPi NEO (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-neo +endef + +define U-Boot/orangepi_r1 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi R1 (H2+) + BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1 +endef + define U-Boot/orangepi_plus + BUILD_SUBTARGET:=cortexa7 NAME:=Orange Pi Plus (H3) BUILD_DEVICES:=sun8i-h3-orangepi-plus endef +define U-Boot/orangepi_2 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi 2 (H3) + BUILD_DEVICES:=sun8i-h3-orangepi-2 +endef + define U-Boot/pangolin + BUILD_SUBTARGET:=cortexa7 NAME:=Theobroma A31-yQ7 devboard UENV:=pangolin endef +define U-Boot/pine64_plus + BUILD_SUBTARGET:=cortexa53 + NAME:=Pine64 Plus A64 + BUILD_DEVICES:=sun50i-a64-pine64-plus + DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi + UENV:=a64 +endef + UBOOT_TARGETS := \ A10-OLinuXino-Lime \ A13-OLinuXino \ A20-OLinuXino-Lime \ + A20-OLinuXino-Lime2 \ + A20-OLinuXino-Lime2-eMMC \ A20-OLinuXino_MICRO \ Bananapi \ Bananapro \ @@ -120,19 +189,32 @@ UBOOT_TARGETS := \ Cubieboard2 \ Cubietruck \ Hummingbird_A31 \ + Marsboard_A10 \ Mele_M9 \ OLIMEX_A13_SOM \ Linksprite_pcDuino \ Linksprite_pcDuino3 \ Lamobo_R1 \ + nanopi_m1_plus \ + nanopi_neo \ + orangepi_r1 \ orangepi_plus \ - pangolin + orangepi_2 \ + pangolin \ + pine64_plus UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes +UBOOT_MAKE_FLAGS += \ + BL31=$(STAGING_DIR_IMAGE)/bl31.bin + define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) +ifeq ($(SUBTARGET),cortexa53) + cat $(PKG_BUILD_DIR)/spl/sunxi-spl.bin $(PKG_BUILD_DIR)/u-boot.itb > $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +else $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +endif mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr endef diff --git a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch index f29ad12b7..c19f3781d 100644 --- a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch +++ b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch @@ -1,8 +1,7 @@ --- /dev/null +++ b/configs/OLIMEX_A13_SOM_defconfig -@@ -0,0 +1,18 @@ +@@ -0,0 +1,17 @@ +CONFIG_SPL=y -+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2" +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y diff --git a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch index e5a66d7eb..2fce04828 100644 --- a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch +++ b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch @@ -1,16 +1,16 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ +@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-m9.dtb \ sun6i-a31-mele-a1000g-quad.dtb \ sun6i-a31-mixtile-loftq.dtb \ + sun6i-a31-pangolin.dtb \ + sun6i-a31s-colorfly-e708-q1.dtb \ sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ - sun6i-a31s-sinovoip-bpi-m2.dtb + sun6i-a31s-inet-q972.dtb \ --- a/arch/arm/dts/sun6i-a31.dtsi +++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -643,6 +643,13 @@ +@@ -679,6 +679,13 @@ allwinner,pull = ; }; @@ -358,17 +358,9 @@ +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SUNXI_SPI=y ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I - separate ahb reset control registers, custom pmic bus, new style - watchdog, etc. - -- - choice - prompt "Sunxi SoC Variant" - optional -@@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL Set the SCL pin for the LCD i2c interface. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. diff --git a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch deleted file mode 100644 index d8fa52c7e..000000000 --- a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch +++ /dev/null @@ -1,1403 +0,0 @@ -From 4bb656e9dde2019cb42ac4c27b3a114a801ad127 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:41:23 +0100 -Subject: [PATCH] include/dt-bindings: Sync some files with the kernel - -This commit syncs the dt-bindings/input/* headers with the kernel (v4.5) -and adds dt-bindings/clock/sun4i-a10-pll2.h, both are necessary for newer -sunxi dts files to build. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini -Acked-by: Ian Campbell ---- - include/dt-bindings/clock/sun4i-a10-pll2.h | 53 ++ - include/dt-bindings/input/input.h | 510 +--------------- - include/dt-bindings/input/linux-event-codes.h | 805 ++++++++++++++++++++++++++ - 3 files changed, 859 insertions(+), 509 deletions(-) - create mode 100644 include/dt-bindings/clock/sun4i-a10-pll2.h - create mode 100644 include/dt-bindings/input/linux-event-codes.h - ---- /dev/null -+++ b/include/dt-bindings/clock/sun4i-a10-pll2.h -@@ -0,0 +1,53 @@ -+/* -+ * Copyright 2015 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+#define __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+ -+#define SUN4I_A10_PLL2_1X 0 -+#define SUN4I_A10_PLL2_2X 1 -+#define SUN4I_A10_PLL2_4X 2 -+#define SUN4I_A10_PLL2_8X 3 -+ -+#endif /* __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ */ ---- a/include/dt-bindings/input/input.h -+++ b/include/dt-bindings/input/input.h -@@ -9,515 +9,7 @@ - #ifndef _DT_BINDINGS_INPUT_INPUT_H - #define _DT_BINDINGS_INPUT_INPUT_H - --#define KEY_RESERVED 0 --#define KEY_ESC 1 --#define KEY_1 2 --#define KEY_2 3 --#define KEY_3 4 --#define KEY_4 5 --#define KEY_5 6 --#define KEY_6 7 --#define KEY_7 8 --#define KEY_8 9 --#define KEY_9 10 --#define KEY_0 11 --#define KEY_MINUS 12 --#define KEY_EQUAL 13 --#define KEY_BACKSPACE 14 --#define KEY_TAB 15 --#define KEY_Q 16 --#define KEY_W 17 --#define KEY_E 18 --#define KEY_R 19 --#define KEY_T 20 --#define KEY_Y 21 --#define KEY_U 22 --#define KEY_I 23 --#define KEY_O 24 --#define KEY_P 25 --#define KEY_LEFTBRACE 26 --#define KEY_RIGHTBRACE 27 --#define KEY_ENTER 28 --#define KEY_LEFTCTRL 29 --#define KEY_A 30 --#define KEY_S 31 --#define KEY_D 32 --#define KEY_F 33 --#define KEY_G 34 --#define KEY_H 35 --#define KEY_J 36 --#define KEY_K 37 --#define KEY_L 38 --#define KEY_SEMICOLON 39 --#define KEY_APOSTROPHE 40 --#define KEY_GRAVE 41 --#define KEY_LEFTSHIFT 42 --#define KEY_BACKSLASH 43 --#define KEY_Z 44 --#define KEY_X 45 --#define KEY_C 46 --#define KEY_V 47 --#define KEY_B 48 --#define KEY_N 49 --#define KEY_M 50 --#define KEY_COMMA 51 --#define KEY_DOT 52 --#define KEY_SLASH 53 --#define KEY_RIGHTSHIFT 54 --#define KEY_KPASTERISK 55 --#define KEY_LEFTALT 56 --#define KEY_SPACE 57 --#define KEY_CAPSLOCK 58 --#define KEY_F1 59 --#define KEY_F2 60 --#define KEY_F3 61 --#define KEY_F4 62 --#define KEY_F5 63 --#define KEY_F6 64 --#define KEY_F7 65 --#define KEY_F8 66 --#define KEY_F9 67 --#define KEY_F10 68 --#define KEY_NUMLOCK 69 --#define KEY_SCROLLLOCK 70 --#define KEY_KP7 71 --#define KEY_KP8 72 --#define KEY_KP9 73 --#define KEY_KPMINUS 74 --#define KEY_KP4 75 --#define KEY_KP5 76 --#define KEY_KP6 77 --#define KEY_KPPLUS 78 --#define KEY_KP1 79 --#define KEY_KP2 80 --#define KEY_KP3 81 --#define KEY_KP0 82 --#define KEY_KPDOT 83 -- --#define KEY_ZENKAKUHANKAKU 85 --#define KEY_102ND 86 --#define KEY_F11 87 --#define KEY_F12 88 --#define KEY_RO 89 --#define KEY_KATAKANA 90 --#define KEY_HIRAGANA 91 --#define KEY_HENKAN 92 --#define KEY_KATAKANAHIRAGANA 93 --#define KEY_MUHENKAN 94 --#define KEY_KPJPCOMMA 95 --#define KEY_KPENTER 96 --#define KEY_RIGHTCTRL 97 --#define KEY_KPSLASH 98 --#define KEY_SYSRQ 99 --#define KEY_RIGHTALT 100 --#define KEY_LINEFEED 101 --#define KEY_HOME 102 --#define KEY_UP 103 --#define KEY_PAGEUP 104 --#define KEY_LEFT 105 --#define KEY_RIGHT 106 --#define KEY_END 107 --#define KEY_DOWN 108 --#define KEY_PAGEDOWN 109 --#define KEY_INSERT 110 --#define KEY_DELETE 111 --#define KEY_MACRO 112 --#define KEY_MUTE 113 --#define KEY_VOLUMEDOWN 114 --#define KEY_VOLUMEUP 115 --#define KEY_POWER 116 /* SC System Power Down */ --#define KEY_KPEQUAL 117 --#define KEY_KPPLUSMINUS 118 --#define KEY_PAUSE 119 --#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -- --#define KEY_KPCOMMA 121 --#define KEY_HANGEUL 122 --#define KEY_HANGUEL KEY_HANGEUL --#define KEY_HANJA 123 --#define KEY_YEN 124 --#define KEY_LEFTMETA 125 --#define KEY_RIGHTMETA 126 --#define KEY_COMPOSE 127 -- --#define KEY_STOP 128 /* AC Stop */ --#define KEY_AGAIN 129 --#define KEY_PROPS 130 /* AC Properties */ --#define KEY_UNDO 131 /* AC Undo */ --#define KEY_FRONT 132 --#define KEY_COPY 133 /* AC Copy */ --#define KEY_OPEN 134 /* AC Open */ --#define KEY_PASTE 135 /* AC Paste */ --#define KEY_FIND 136 /* AC Search */ --#define KEY_CUT 137 /* AC Cut */ --#define KEY_HELP 138 /* AL Integrated Help Center */ --#define KEY_MENU 139 /* Menu (show menu) */ --#define KEY_CALC 140 /* AL Calculator */ --#define KEY_SETUP 141 --#define KEY_SLEEP 142 /* SC System Sleep */ --#define KEY_WAKEUP 143 /* System Wake Up */ --#define KEY_FILE 144 /* AL Local Machine Browser */ --#define KEY_SENDFILE 145 --#define KEY_DELETEFILE 146 --#define KEY_XFER 147 --#define KEY_PROG1 148 --#define KEY_PROG2 149 --#define KEY_WWW 150 /* AL Internet Browser */ --#define KEY_MSDOS 151 --#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ --#define KEY_SCREENLOCK KEY_COFFEE --#define KEY_DIRECTION 153 --#define KEY_CYCLEWINDOWS 154 --#define KEY_MAIL 155 --#define KEY_BOOKMARKS 156 /* AC Bookmarks */ --#define KEY_COMPUTER 157 --#define KEY_BACK 158 /* AC Back */ --#define KEY_FORWARD 159 /* AC Forward */ --#define KEY_CLOSECD 160 --#define KEY_EJECTCD 161 --#define KEY_EJECTCLOSECD 162 --#define KEY_NEXTSONG 163 --#define KEY_PLAYPAUSE 164 --#define KEY_PREVIOUSSONG 165 --#define KEY_STOPCD 166 --#define KEY_RECORD 167 --#define KEY_REWIND 168 --#define KEY_PHONE 169 /* Media Select Telephone */ --#define KEY_ISO 170 --#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ --#define KEY_HOMEPAGE 172 /* AC Home */ --#define KEY_REFRESH 173 /* AC Refresh */ --#define KEY_EXIT 174 /* AC Exit */ --#define KEY_MOVE 175 --#define KEY_EDIT 176 --#define KEY_SCROLLUP 177 --#define KEY_SCROLLDOWN 178 --#define KEY_KPLEFTPAREN 179 --#define KEY_KPRIGHTPAREN 180 --#define KEY_NEW 181 /* AC New */ --#define KEY_REDO 182 /* AC Redo/Repeat */ -- --#define KEY_F13 183 --#define KEY_F14 184 --#define KEY_F15 185 --#define KEY_F16 186 --#define KEY_F17 187 --#define KEY_F18 188 --#define KEY_F19 189 --#define KEY_F20 190 --#define KEY_F21 191 --#define KEY_F22 192 --#define KEY_F23 193 --#define KEY_F24 194 -- --#define KEY_PLAYCD 200 --#define KEY_PAUSECD 201 --#define KEY_PROG3 202 --#define KEY_PROG4 203 --#define KEY_DASHBOARD 204 /* AL Dashboard */ --#define KEY_SUSPEND 205 --#define KEY_CLOSE 206 /* AC Close */ --#define KEY_PLAY 207 --#define KEY_FASTFORWARD 208 --#define KEY_BASSBOOST 209 --#define KEY_PRINT 210 /* AC Print */ --#define KEY_HP 211 --#define KEY_CAMERA 212 --#define KEY_SOUND 213 --#define KEY_QUESTION 214 --#define KEY_EMAIL 215 --#define KEY_CHAT 216 --#define KEY_SEARCH 217 --#define KEY_CONNECT 218 --#define KEY_FINANCE 219 /* AL Checkbook/Finance */ --#define KEY_SPORT 220 --#define KEY_SHOP 221 --#define KEY_ALTERASE 222 --#define KEY_CANCEL 223 /* AC Cancel */ --#define KEY_BRIGHTNESSDOWN 224 --#define KEY_BRIGHTNESSUP 225 --#define KEY_MEDIA 226 -- --#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -- outputs (Monitor/LCD/TV-out/etc) */ --#define KEY_KBDILLUMTOGGLE 228 --#define KEY_KBDILLUMDOWN 229 --#define KEY_KBDILLUMUP 230 -- --#define KEY_SEND 231 /* AC Send */ --#define KEY_REPLY 232 /* AC Reply */ --#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ --#define KEY_SAVE 234 /* AC Save */ --#define KEY_DOCUMENTS 235 -- --#define KEY_BATTERY 236 -- --#define KEY_BLUETOOTH 237 --#define KEY_WLAN 238 --#define KEY_UWB 239 -- --#define KEY_UNKNOWN 240 -- --#define KEY_VIDEO_NEXT 241 /* drive next video source */ --#define KEY_VIDEO_PREV 242 /* drive previous video source */ --#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ --#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ --#define KEY_DISPLAY_OFF 245 /* display device to off state */ -- --#define KEY_WIMAX 246 --#define KEY_RFKILL 247 /* Key that controls all radios */ -- --#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -- --/* Code 255 is reserved for special needs of AT keyboard driver */ -- --#define BTN_MISC 0x100 --#define BTN_0 0x100 --#define BTN_1 0x101 --#define BTN_2 0x102 --#define BTN_3 0x103 --#define BTN_4 0x104 --#define BTN_5 0x105 --#define BTN_6 0x106 --#define BTN_7 0x107 --#define BTN_8 0x108 --#define BTN_9 0x109 -- --#define BTN_MOUSE 0x110 --#define BTN_LEFT 0x110 --#define BTN_RIGHT 0x111 --#define BTN_MIDDLE 0x112 --#define BTN_SIDE 0x113 --#define BTN_EXTRA 0x114 --#define BTN_FORWARD 0x115 --#define BTN_BACK 0x116 --#define BTN_TASK 0x117 -- --#define BTN_JOYSTICK 0x120 --#define BTN_TRIGGER 0x120 --#define BTN_THUMB 0x121 --#define BTN_THUMB2 0x122 --#define BTN_TOP 0x123 --#define BTN_TOP2 0x124 --#define BTN_PINKIE 0x125 --#define BTN_BASE 0x126 --#define BTN_BASE2 0x127 --#define BTN_BASE3 0x128 --#define BTN_BASE4 0x129 --#define BTN_BASE5 0x12a --#define BTN_BASE6 0x12b --#define BTN_DEAD 0x12f -- --#define BTN_GAMEPAD 0x130 --#define BTN_SOUTH 0x130 --#define BTN_A BTN_SOUTH --#define BTN_EAST 0x131 --#define BTN_B BTN_EAST --#define BTN_C 0x132 --#define BTN_NORTH 0x133 --#define BTN_X BTN_NORTH --#define BTN_WEST 0x134 --#define BTN_Y BTN_WEST --#define BTN_Z 0x135 --#define BTN_TL 0x136 --#define BTN_TR 0x137 --#define BTN_TL2 0x138 --#define BTN_TR2 0x139 --#define BTN_SELECT 0x13a --#define BTN_START 0x13b --#define BTN_MODE 0x13c --#define BTN_THUMBL 0x13d --#define BTN_THUMBR 0x13e -- --#define BTN_DIGI 0x140 --#define BTN_TOOL_PEN 0x140 --#define BTN_TOOL_RUBBER 0x141 --#define BTN_TOOL_BRUSH 0x142 --#define BTN_TOOL_PENCIL 0x143 --#define BTN_TOOL_AIRBRUSH 0x144 --#define BTN_TOOL_FINGER 0x145 --#define BTN_TOOL_MOUSE 0x146 --#define BTN_TOOL_LENS 0x147 --#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ --#define BTN_TOUCH 0x14a --#define BTN_STYLUS 0x14b --#define BTN_STYLUS2 0x14c --#define BTN_TOOL_DOUBLETAP 0x14d --#define BTN_TOOL_TRIPLETAP 0x14e --#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -- --#define BTN_WHEEL 0x150 --#define BTN_GEAR_DOWN 0x150 --#define BTN_GEAR_UP 0x151 -- --#define KEY_OK 0x160 --#define KEY_SELECT 0x161 --#define KEY_GOTO 0x162 --#define KEY_CLEAR 0x163 --#define KEY_POWER2 0x164 --#define KEY_OPTION 0x165 --#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ --#define KEY_TIME 0x167 --#define KEY_VENDOR 0x168 --#define KEY_ARCHIVE 0x169 --#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ --#define KEY_CHANNEL 0x16b --#define KEY_FAVORITES 0x16c --#define KEY_EPG 0x16d --#define KEY_PVR 0x16e /* Media Select Home */ --#define KEY_MHP 0x16f --#define KEY_LANGUAGE 0x170 --#define KEY_TITLE 0x171 --#define KEY_SUBTITLE 0x172 --#define KEY_ANGLE 0x173 --#define KEY_ZOOM 0x174 --#define KEY_MODE 0x175 --#define KEY_KEYBOARD 0x176 --#define KEY_SCREEN 0x177 --#define KEY_PC 0x178 /* Media Select Computer */ --#define KEY_TV 0x179 /* Media Select TV */ --#define KEY_TV2 0x17a /* Media Select Cable */ --#define KEY_VCR 0x17b /* Media Select VCR */ --#define KEY_VCR2 0x17c /* VCR Plus */ --#define KEY_SAT 0x17d /* Media Select Satellite */ --#define KEY_SAT2 0x17e --#define KEY_CD 0x17f /* Media Select CD */ --#define KEY_TAPE 0x180 /* Media Select Tape */ --#define KEY_RADIO 0x181 --#define KEY_TUNER 0x182 /* Media Select Tuner */ --#define KEY_PLAYER 0x183 --#define KEY_TEXT 0x184 --#define KEY_DVD 0x185 /* Media Select DVD */ --#define KEY_AUX 0x186 --#define KEY_MP3 0x187 --#define KEY_AUDIO 0x188 /* AL Audio Browser */ --#define KEY_VIDEO 0x189 /* AL Movie Browser */ --#define KEY_DIRECTORY 0x18a --#define KEY_LIST 0x18b --#define KEY_MEMO 0x18c /* Media Select Messages */ --#define KEY_CALENDAR 0x18d --#define KEY_RED 0x18e --#define KEY_GREEN 0x18f --#define KEY_YELLOW 0x190 --#define KEY_BLUE 0x191 --#define KEY_CHANNELUP 0x192 /* Channel Increment */ --#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ --#define KEY_FIRST 0x194 --#define KEY_LAST 0x195 /* Recall Last */ --#define KEY_AB 0x196 --#define KEY_NEXT 0x197 --#define KEY_RESTART 0x198 --#define KEY_SLOW 0x199 --#define KEY_SHUFFLE 0x19a --#define KEY_BREAK 0x19b --#define KEY_PREVIOUS 0x19c --#define KEY_DIGITS 0x19d --#define KEY_TEEN 0x19e --#define KEY_TWEN 0x19f --#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ --#define KEY_GAMES 0x1a1 /* Media Select Games */ --#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ --#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ --#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ --#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ --#define KEY_EDITOR 0x1a6 /* AL Text Editor */ --#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ --#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ --#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ --#define KEY_DATABASE 0x1aa /* AL Database App */ --#define KEY_NEWS 0x1ab /* AL Newsreader */ --#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ --#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ --#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ --#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ --#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ --#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -- --#define KEY_DOLLAR 0x1b2 --#define KEY_EURO 0x1b3 -- --#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ --#define KEY_FRAMEFORWARD 0x1b5 --#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ --#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ --#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ --#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ --#define KEY_IMAGES 0x1ba /* AL Image Browser */ -- --#define KEY_DEL_EOL 0x1c0 --#define KEY_DEL_EOS 0x1c1 --#define KEY_INS_LINE 0x1c2 --#define KEY_DEL_LINE 0x1c3 -- --#define KEY_FN 0x1d0 --#define KEY_FN_ESC 0x1d1 --#define KEY_FN_F1 0x1d2 --#define KEY_FN_F2 0x1d3 --#define KEY_FN_F3 0x1d4 --#define KEY_FN_F4 0x1d5 --#define KEY_FN_F5 0x1d6 --#define KEY_FN_F6 0x1d7 --#define KEY_FN_F7 0x1d8 --#define KEY_FN_F8 0x1d9 --#define KEY_FN_F9 0x1da --#define KEY_FN_F10 0x1db --#define KEY_FN_F11 0x1dc --#define KEY_FN_F12 0x1dd --#define KEY_FN_1 0x1de --#define KEY_FN_2 0x1df --#define KEY_FN_D 0x1e0 --#define KEY_FN_E 0x1e1 --#define KEY_FN_F 0x1e2 --#define KEY_FN_S 0x1e3 --#define KEY_FN_B 0x1e4 -- --#define KEY_BRL_DOT1 0x1f1 --#define KEY_BRL_DOT2 0x1f2 --#define KEY_BRL_DOT3 0x1f3 --#define KEY_BRL_DOT4 0x1f4 --#define KEY_BRL_DOT5 0x1f5 --#define KEY_BRL_DOT6 0x1f6 --#define KEY_BRL_DOT7 0x1f7 --#define KEY_BRL_DOT8 0x1f8 --#define KEY_BRL_DOT9 0x1f9 --#define KEY_BRL_DOT10 0x1fa -- --#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ --#define KEY_NUMERIC_1 0x201 /* and other keypads */ --#define KEY_NUMERIC_2 0x202 --#define KEY_NUMERIC_3 0x203 --#define KEY_NUMERIC_4 0x204 --#define KEY_NUMERIC_5 0x205 --#define KEY_NUMERIC_6 0x206 --#define KEY_NUMERIC_7 0x207 --#define KEY_NUMERIC_8 0x208 --#define KEY_NUMERIC_9 0x209 --#define KEY_NUMERIC_STAR 0x20a --#define KEY_NUMERIC_POUND 0x20b -- --#define KEY_CAMERA_FOCUS 0x210 --#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -- --#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ --#define KEY_TOUCHPAD_ON 0x213 --#define KEY_TOUCHPAD_OFF 0x214 -- --#define KEY_CAMERA_ZOOMIN 0x215 --#define KEY_CAMERA_ZOOMOUT 0x216 --#define KEY_CAMERA_UP 0x217 --#define KEY_CAMERA_DOWN 0x218 --#define KEY_CAMERA_LEFT 0x219 --#define KEY_CAMERA_RIGHT 0x21a -- --#define KEY_ATTENDANT_ON 0x21b --#define KEY_ATTENDANT_OFF 0x21c --#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ --#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -- --#define BTN_DPAD_UP 0x220 --#define BTN_DPAD_DOWN 0x221 --#define BTN_DPAD_LEFT 0x222 --#define BTN_DPAD_RIGHT 0x223 -+#include "linux-event-codes.h" - - #define MATRIX_KEY(row, col, code) \ - ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF)) ---- /dev/null -+++ b/include/dt-bindings/input/linux-event-codes.h -@@ -0,0 +1,805 @@ -+/* -+ * Input event codes -+ * -+ * *** IMPORTANT *** -+ * This file is not only included from C-code but also from devicetree source -+ * files. As such this file MUST only contain comments and defines. -+ * -+ * Copyright (c) 1999-2002 Vojtech Pavlik -+ * Copyright (c) 2015 Hans de Goede -+ * -+ * 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. -+ */ -+#ifndef _UAPI_INPUT_EVENT_CODES_H -+#define _UAPI_INPUT_EVENT_CODES_H -+ -+/* -+ * Device properties and quirks -+ */ -+ -+#define INPUT_PROP_POINTER 0x00 /* needs a pointer */ -+#define INPUT_PROP_DIRECT 0x01 /* direct input devices */ -+#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ -+#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ -+#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ -+#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ -+#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ -+ -+#define INPUT_PROP_MAX 0x1f -+#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) -+ -+/* -+ * Event types -+ */ -+ -+#define EV_SYN 0x00 -+#define EV_KEY 0x01 -+#define EV_REL 0x02 -+#define EV_ABS 0x03 -+#define EV_MSC 0x04 -+#define EV_SW 0x05 -+#define EV_LED 0x11 -+#define EV_SND 0x12 -+#define EV_REP 0x14 -+#define EV_FF 0x15 -+#define EV_PWR 0x16 -+#define EV_FF_STATUS 0x17 -+#define EV_MAX 0x1f -+#define EV_CNT (EV_MAX+1) -+ -+/* -+ * Synchronization events. -+ */ -+ -+#define SYN_REPORT 0 -+#define SYN_CONFIG 1 -+#define SYN_MT_REPORT 2 -+#define SYN_DROPPED 3 -+#define SYN_MAX 0xf -+#define SYN_CNT (SYN_MAX+1) -+ -+/* -+ * Keys and buttons -+ * -+ * Most of the keys/buttons are modeled after USB HUT 1.12 -+ * (see http://www.usb.org/developers/hidpage). -+ * Abbreviations in the comments: -+ * AC - Application Control -+ * AL - Application Launch Button -+ * SC - System Control -+ */ -+ -+#define KEY_RESERVED 0 -+#define KEY_ESC 1 -+#define KEY_1 2 -+#define KEY_2 3 -+#define KEY_3 4 -+#define KEY_4 5 -+#define KEY_5 6 -+#define KEY_6 7 -+#define KEY_7 8 -+#define KEY_8 9 -+#define KEY_9 10 -+#define KEY_0 11 -+#define KEY_MINUS 12 -+#define KEY_EQUAL 13 -+#define KEY_BACKSPACE 14 -+#define KEY_TAB 15 -+#define KEY_Q 16 -+#define KEY_W 17 -+#define KEY_E 18 -+#define KEY_R 19 -+#define KEY_T 20 -+#define KEY_Y 21 -+#define KEY_U 22 -+#define KEY_I 23 -+#define KEY_O 24 -+#define KEY_P 25 -+#define KEY_LEFTBRACE 26 -+#define KEY_RIGHTBRACE 27 -+#define KEY_ENTER 28 -+#define KEY_LEFTCTRL 29 -+#define KEY_A 30 -+#define KEY_S 31 -+#define KEY_D 32 -+#define KEY_F 33 -+#define KEY_G 34 -+#define KEY_H 35 -+#define KEY_J 36 -+#define KEY_K 37 -+#define KEY_L 38 -+#define KEY_SEMICOLON 39 -+#define KEY_APOSTROPHE 40 -+#define KEY_GRAVE 41 -+#define KEY_LEFTSHIFT 42 -+#define KEY_BACKSLASH 43 -+#define KEY_Z 44 -+#define KEY_X 45 -+#define KEY_C 46 -+#define KEY_V 47 -+#define KEY_B 48 -+#define KEY_N 49 -+#define KEY_M 50 -+#define KEY_COMMA 51 -+#define KEY_DOT 52 -+#define KEY_SLASH 53 -+#define KEY_RIGHTSHIFT 54 -+#define KEY_KPASTERISK 55 -+#define KEY_LEFTALT 56 -+#define KEY_SPACE 57 -+#define KEY_CAPSLOCK 58 -+#define KEY_F1 59 -+#define KEY_F2 60 -+#define KEY_F3 61 -+#define KEY_F4 62 -+#define KEY_F5 63 -+#define KEY_F6 64 -+#define KEY_F7 65 -+#define KEY_F8 66 -+#define KEY_F9 67 -+#define KEY_F10 68 -+#define KEY_NUMLOCK 69 -+#define KEY_SCROLLLOCK 70 -+#define KEY_KP7 71 -+#define KEY_KP8 72 -+#define KEY_KP9 73 -+#define KEY_KPMINUS 74 -+#define KEY_KP4 75 -+#define KEY_KP5 76 -+#define KEY_KP6 77 -+#define KEY_KPPLUS 78 -+#define KEY_KP1 79 -+#define KEY_KP2 80 -+#define KEY_KP3 81 -+#define KEY_KP0 82 -+#define KEY_KPDOT 83 -+ -+#define KEY_ZENKAKUHANKAKU 85 -+#define KEY_102ND 86 -+#define KEY_F11 87 -+#define KEY_F12 88 -+#define KEY_RO 89 -+#define KEY_KATAKANA 90 -+#define KEY_HIRAGANA 91 -+#define KEY_HENKAN 92 -+#define KEY_KATAKANAHIRAGANA 93 -+#define KEY_MUHENKAN 94 -+#define KEY_KPJPCOMMA 95 -+#define KEY_KPENTER 96 -+#define KEY_RIGHTCTRL 97 -+#define KEY_KPSLASH 98 -+#define KEY_SYSRQ 99 -+#define KEY_RIGHTALT 100 -+#define KEY_LINEFEED 101 -+#define KEY_HOME 102 -+#define KEY_UP 103 -+#define KEY_PAGEUP 104 -+#define KEY_LEFT 105 -+#define KEY_RIGHT 106 -+#define KEY_END 107 -+#define KEY_DOWN 108 -+#define KEY_PAGEDOWN 109 -+#define KEY_INSERT 110 -+#define KEY_DELETE 111 -+#define KEY_MACRO 112 -+#define KEY_MUTE 113 -+#define KEY_VOLUMEDOWN 114 -+#define KEY_VOLUMEUP 115 -+#define KEY_POWER 116 /* SC System Power Down */ -+#define KEY_KPEQUAL 117 -+#define KEY_KPPLUSMINUS 118 -+#define KEY_PAUSE 119 -+#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -+ -+#define KEY_KPCOMMA 121 -+#define KEY_HANGEUL 122 -+#define KEY_HANGUEL KEY_HANGEUL -+#define KEY_HANJA 123 -+#define KEY_YEN 124 -+#define KEY_LEFTMETA 125 -+#define KEY_RIGHTMETA 126 -+#define KEY_COMPOSE 127 -+ -+#define KEY_STOP 128 /* AC Stop */ -+#define KEY_AGAIN 129 -+#define KEY_PROPS 130 /* AC Properties */ -+#define KEY_UNDO 131 /* AC Undo */ -+#define KEY_FRONT 132 -+#define KEY_COPY 133 /* AC Copy */ -+#define KEY_OPEN 134 /* AC Open */ -+#define KEY_PASTE 135 /* AC Paste */ -+#define KEY_FIND 136 /* AC Search */ -+#define KEY_CUT 137 /* AC Cut */ -+#define KEY_HELP 138 /* AL Integrated Help Center */ -+#define KEY_MENU 139 /* Menu (show menu) */ -+#define KEY_CALC 140 /* AL Calculator */ -+#define KEY_SETUP 141 -+#define KEY_SLEEP 142 /* SC System Sleep */ -+#define KEY_WAKEUP 143 /* System Wake Up */ -+#define KEY_FILE 144 /* AL Local Machine Browser */ -+#define KEY_SENDFILE 145 -+#define KEY_DELETEFILE 146 -+#define KEY_XFER 147 -+#define KEY_PROG1 148 -+#define KEY_PROG2 149 -+#define KEY_WWW 150 /* AL Internet Browser */ -+#define KEY_MSDOS 151 -+#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ -+#define KEY_SCREENLOCK KEY_COFFEE -+#define KEY_ROTATE_DISPLAY 153 /* Display orientation for e.g. tablets */ -+#define KEY_DIRECTION KEY_ROTATE_DISPLAY -+#define KEY_CYCLEWINDOWS 154 -+#define KEY_MAIL 155 -+#define KEY_BOOKMARKS 156 /* AC Bookmarks */ -+#define KEY_COMPUTER 157 -+#define KEY_BACK 158 /* AC Back */ -+#define KEY_FORWARD 159 /* AC Forward */ -+#define KEY_CLOSECD 160 -+#define KEY_EJECTCD 161 -+#define KEY_EJECTCLOSECD 162 -+#define KEY_NEXTSONG 163 -+#define KEY_PLAYPAUSE 164 -+#define KEY_PREVIOUSSONG 165 -+#define KEY_STOPCD 166 -+#define KEY_RECORD 167 -+#define KEY_REWIND 168 -+#define KEY_PHONE 169 /* Media Select Telephone */ -+#define KEY_ISO 170 -+#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ -+#define KEY_HOMEPAGE 172 /* AC Home */ -+#define KEY_REFRESH 173 /* AC Refresh */ -+#define KEY_EXIT 174 /* AC Exit */ -+#define KEY_MOVE 175 -+#define KEY_EDIT 176 -+#define KEY_SCROLLUP 177 -+#define KEY_SCROLLDOWN 178 -+#define KEY_KPLEFTPAREN 179 -+#define KEY_KPRIGHTPAREN 180 -+#define KEY_NEW 181 /* AC New */ -+#define KEY_REDO 182 /* AC Redo/Repeat */ -+ -+#define KEY_F13 183 -+#define KEY_F14 184 -+#define KEY_F15 185 -+#define KEY_F16 186 -+#define KEY_F17 187 -+#define KEY_F18 188 -+#define KEY_F19 189 -+#define KEY_F20 190 -+#define KEY_F21 191 -+#define KEY_F22 192 -+#define KEY_F23 193 -+#define KEY_F24 194 -+ -+#define KEY_PLAYCD 200 -+#define KEY_PAUSECD 201 -+#define KEY_PROG3 202 -+#define KEY_PROG4 203 -+#define KEY_DASHBOARD 204 /* AL Dashboard */ -+#define KEY_SUSPEND 205 -+#define KEY_CLOSE 206 /* AC Close */ -+#define KEY_PLAY 207 -+#define KEY_FASTFORWARD 208 -+#define KEY_BASSBOOST 209 -+#define KEY_PRINT 210 /* AC Print */ -+#define KEY_HP 211 -+#define KEY_CAMERA 212 -+#define KEY_SOUND 213 -+#define KEY_QUESTION 214 -+#define KEY_EMAIL 215 -+#define KEY_CHAT 216 -+#define KEY_SEARCH 217 -+#define KEY_CONNECT 218 -+#define KEY_FINANCE 219 /* AL Checkbook/Finance */ -+#define KEY_SPORT 220 -+#define KEY_SHOP 221 -+#define KEY_ALTERASE 222 -+#define KEY_CANCEL 223 /* AC Cancel */ -+#define KEY_BRIGHTNESSDOWN 224 -+#define KEY_BRIGHTNESSUP 225 -+#define KEY_MEDIA 226 -+ -+#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -+ outputs (Monitor/LCD/TV-out/etc) */ -+#define KEY_KBDILLUMTOGGLE 228 -+#define KEY_KBDILLUMDOWN 229 -+#define KEY_KBDILLUMUP 230 -+ -+#define KEY_SEND 231 /* AC Send */ -+#define KEY_REPLY 232 /* AC Reply */ -+#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ -+#define KEY_SAVE 234 /* AC Save */ -+#define KEY_DOCUMENTS 235 -+ -+#define KEY_BATTERY 236 -+ -+#define KEY_BLUETOOTH 237 -+#define KEY_WLAN 238 -+#define KEY_UWB 239 -+ -+#define KEY_UNKNOWN 240 -+ -+#define KEY_VIDEO_NEXT 241 /* drive next video source */ -+#define KEY_VIDEO_PREV 242 /* drive previous video source */ -+#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ -+#define KEY_BRIGHTNESS_AUTO 244 /* Set Auto Brightness: manual -+ brightness control is off, -+ rely on ambient */ -+#define KEY_BRIGHTNESS_ZERO KEY_BRIGHTNESS_AUTO -+#define KEY_DISPLAY_OFF 245 /* display device to off state */ -+ -+#define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ -+#define KEY_WIMAX KEY_WWAN -+#define KEY_RFKILL 247 /* Key that controls all radios */ -+ -+#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -+ -+/* Code 255 is reserved for special needs of AT keyboard driver */ -+ -+#define BTN_MISC 0x100 -+#define BTN_0 0x100 -+#define BTN_1 0x101 -+#define BTN_2 0x102 -+#define BTN_3 0x103 -+#define BTN_4 0x104 -+#define BTN_5 0x105 -+#define BTN_6 0x106 -+#define BTN_7 0x107 -+#define BTN_8 0x108 -+#define BTN_9 0x109 -+ -+#define BTN_MOUSE 0x110 -+#define BTN_LEFT 0x110 -+#define BTN_RIGHT 0x111 -+#define BTN_MIDDLE 0x112 -+#define BTN_SIDE 0x113 -+#define BTN_EXTRA 0x114 -+#define BTN_FORWARD 0x115 -+#define BTN_BACK 0x116 -+#define BTN_TASK 0x117 -+ -+#define BTN_JOYSTICK 0x120 -+#define BTN_TRIGGER 0x120 -+#define BTN_THUMB 0x121 -+#define BTN_THUMB2 0x122 -+#define BTN_TOP 0x123 -+#define BTN_TOP2 0x124 -+#define BTN_PINKIE 0x125 -+#define BTN_BASE 0x126 -+#define BTN_BASE2 0x127 -+#define BTN_BASE3 0x128 -+#define BTN_BASE4 0x129 -+#define BTN_BASE5 0x12a -+#define BTN_BASE6 0x12b -+#define BTN_DEAD 0x12f -+ -+#define BTN_GAMEPAD 0x130 -+#define BTN_SOUTH 0x130 -+#define BTN_A BTN_SOUTH -+#define BTN_EAST 0x131 -+#define BTN_B BTN_EAST -+#define BTN_C 0x132 -+#define BTN_NORTH 0x133 -+#define BTN_X BTN_NORTH -+#define BTN_WEST 0x134 -+#define BTN_Y BTN_WEST -+#define BTN_Z 0x135 -+#define BTN_TL 0x136 -+#define BTN_TR 0x137 -+#define BTN_TL2 0x138 -+#define BTN_TR2 0x139 -+#define BTN_SELECT 0x13a -+#define BTN_START 0x13b -+#define BTN_MODE 0x13c -+#define BTN_THUMBL 0x13d -+#define BTN_THUMBR 0x13e -+ -+#define BTN_DIGI 0x140 -+#define BTN_TOOL_PEN 0x140 -+#define BTN_TOOL_RUBBER 0x141 -+#define BTN_TOOL_BRUSH 0x142 -+#define BTN_TOOL_PENCIL 0x143 -+#define BTN_TOOL_AIRBRUSH 0x144 -+#define BTN_TOOL_FINGER 0x145 -+#define BTN_TOOL_MOUSE 0x146 -+#define BTN_TOOL_LENS 0x147 -+#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ -+#define BTN_TOUCH 0x14a -+#define BTN_STYLUS 0x14b -+#define BTN_STYLUS2 0x14c -+#define BTN_TOOL_DOUBLETAP 0x14d -+#define BTN_TOOL_TRIPLETAP 0x14e -+#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -+ -+#define BTN_WHEEL 0x150 -+#define BTN_GEAR_DOWN 0x150 -+#define BTN_GEAR_UP 0x151 -+ -+#define KEY_OK 0x160 -+#define KEY_SELECT 0x161 -+#define KEY_GOTO 0x162 -+#define KEY_CLEAR 0x163 -+#define KEY_POWER2 0x164 -+#define KEY_OPTION 0x165 -+#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ -+#define KEY_TIME 0x167 -+#define KEY_VENDOR 0x168 -+#define KEY_ARCHIVE 0x169 -+#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ -+#define KEY_CHANNEL 0x16b -+#define KEY_FAVORITES 0x16c -+#define KEY_EPG 0x16d -+#define KEY_PVR 0x16e /* Media Select Home */ -+#define KEY_MHP 0x16f -+#define KEY_LANGUAGE 0x170 -+#define KEY_TITLE 0x171 -+#define KEY_SUBTITLE 0x172 -+#define KEY_ANGLE 0x173 -+#define KEY_ZOOM 0x174 -+#define KEY_MODE 0x175 -+#define KEY_KEYBOARD 0x176 -+#define KEY_SCREEN 0x177 -+#define KEY_PC 0x178 /* Media Select Computer */ -+#define KEY_TV 0x179 /* Media Select TV */ -+#define KEY_TV2 0x17a /* Media Select Cable */ -+#define KEY_VCR 0x17b /* Media Select VCR */ -+#define KEY_VCR2 0x17c /* VCR Plus */ -+#define KEY_SAT 0x17d /* Media Select Satellite */ -+#define KEY_SAT2 0x17e -+#define KEY_CD 0x17f /* Media Select CD */ -+#define KEY_TAPE 0x180 /* Media Select Tape */ -+#define KEY_RADIO 0x181 -+#define KEY_TUNER 0x182 /* Media Select Tuner */ -+#define KEY_PLAYER 0x183 -+#define KEY_TEXT 0x184 -+#define KEY_DVD 0x185 /* Media Select DVD */ -+#define KEY_AUX 0x186 -+#define KEY_MP3 0x187 -+#define KEY_AUDIO 0x188 /* AL Audio Browser */ -+#define KEY_VIDEO 0x189 /* AL Movie Browser */ -+#define KEY_DIRECTORY 0x18a -+#define KEY_LIST 0x18b -+#define KEY_MEMO 0x18c /* Media Select Messages */ -+#define KEY_CALENDAR 0x18d -+#define KEY_RED 0x18e -+#define KEY_GREEN 0x18f -+#define KEY_YELLOW 0x190 -+#define KEY_BLUE 0x191 -+#define KEY_CHANNELUP 0x192 /* Channel Increment */ -+#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ -+#define KEY_FIRST 0x194 -+#define KEY_LAST 0x195 /* Recall Last */ -+#define KEY_AB 0x196 -+#define KEY_NEXT 0x197 -+#define KEY_RESTART 0x198 -+#define KEY_SLOW 0x199 -+#define KEY_SHUFFLE 0x19a -+#define KEY_BREAK 0x19b -+#define KEY_PREVIOUS 0x19c -+#define KEY_DIGITS 0x19d -+#define KEY_TEEN 0x19e -+#define KEY_TWEN 0x19f -+#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ -+#define KEY_GAMES 0x1a1 /* Media Select Games */ -+#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ -+#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ -+#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ -+#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ -+#define KEY_EDITOR 0x1a6 /* AL Text Editor */ -+#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ -+#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ -+#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ -+#define KEY_DATABASE 0x1aa /* AL Database App */ -+#define KEY_NEWS 0x1ab /* AL Newsreader */ -+#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ -+#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ -+#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ -+#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ -+#define KEY_BRIGHTNESS_TOGGLE KEY_DISPLAYTOGGLE -+#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ -+#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -+ -+#define KEY_DOLLAR 0x1b2 -+#define KEY_EURO 0x1b3 -+ -+#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ -+#define KEY_FRAMEFORWARD 0x1b5 -+#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ -+#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ -+#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ -+#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ -+#define KEY_IMAGES 0x1ba /* AL Image Browser */ -+ -+#define KEY_DEL_EOL 0x1c0 -+#define KEY_DEL_EOS 0x1c1 -+#define KEY_INS_LINE 0x1c2 -+#define KEY_DEL_LINE 0x1c3 -+ -+#define KEY_FN 0x1d0 -+#define KEY_FN_ESC 0x1d1 -+#define KEY_FN_F1 0x1d2 -+#define KEY_FN_F2 0x1d3 -+#define KEY_FN_F3 0x1d4 -+#define KEY_FN_F4 0x1d5 -+#define KEY_FN_F5 0x1d6 -+#define KEY_FN_F6 0x1d7 -+#define KEY_FN_F7 0x1d8 -+#define KEY_FN_F8 0x1d9 -+#define KEY_FN_F9 0x1da -+#define KEY_FN_F10 0x1db -+#define KEY_FN_F11 0x1dc -+#define KEY_FN_F12 0x1dd -+#define KEY_FN_1 0x1de -+#define KEY_FN_2 0x1df -+#define KEY_FN_D 0x1e0 -+#define KEY_FN_E 0x1e1 -+#define KEY_FN_F 0x1e2 -+#define KEY_FN_S 0x1e3 -+#define KEY_FN_B 0x1e4 -+ -+#define KEY_BRL_DOT1 0x1f1 -+#define KEY_BRL_DOT2 0x1f2 -+#define KEY_BRL_DOT3 0x1f3 -+#define KEY_BRL_DOT4 0x1f4 -+#define KEY_BRL_DOT5 0x1f5 -+#define KEY_BRL_DOT6 0x1f6 -+#define KEY_BRL_DOT7 0x1f7 -+#define KEY_BRL_DOT8 0x1f8 -+#define KEY_BRL_DOT9 0x1f9 -+#define KEY_BRL_DOT10 0x1fa -+ -+#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ -+#define KEY_NUMERIC_1 0x201 /* and other keypads */ -+#define KEY_NUMERIC_2 0x202 -+#define KEY_NUMERIC_3 0x203 -+#define KEY_NUMERIC_4 0x204 -+#define KEY_NUMERIC_5 0x205 -+#define KEY_NUMERIC_6 0x206 -+#define KEY_NUMERIC_7 0x207 -+#define KEY_NUMERIC_8 0x208 -+#define KEY_NUMERIC_9 0x209 -+#define KEY_NUMERIC_STAR 0x20a -+#define KEY_NUMERIC_POUND 0x20b -+#define KEY_NUMERIC_A 0x20c /* Phone key A - HUT Telephony 0xb9 */ -+#define KEY_NUMERIC_B 0x20d -+#define KEY_NUMERIC_C 0x20e -+#define KEY_NUMERIC_D 0x20f -+ -+#define KEY_CAMERA_FOCUS 0x210 -+#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -+ -+#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ -+#define KEY_TOUCHPAD_ON 0x213 -+#define KEY_TOUCHPAD_OFF 0x214 -+ -+#define KEY_CAMERA_ZOOMIN 0x215 -+#define KEY_CAMERA_ZOOMOUT 0x216 -+#define KEY_CAMERA_UP 0x217 -+#define KEY_CAMERA_DOWN 0x218 -+#define KEY_CAMERA_LEFT 0x219 -+#define KEY_CAMERA_RIGHT 0x21a -+ -+#define KEY_ATTENDANT_ON 0x21b -+#define KEY_ATTENDANT_OFF 0x21c -+#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ -+#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -+ -+#define BTN_DPAD_UP 0x220 -+#define BTN_DPAD_DOWN 0x221 -+#define BTN_DPAD_LEFT 0x222 -+#define BTN_DPAD_RIGHT 0x223 -+ -+#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ -+ -+#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ -+#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ -+#define KEY_JOURNAL 0x242 /* AL Log/Journal/Timecard */ -+#define KEY_CONTROLPANEL 0x243 /* AL Control Panel */ -+#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ -+#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ -+#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ -+ -+#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ -+#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ -+ -+#define KEY_KBDINPUTASSIST_PREV 0x260 -+#define KEY_KBDINPUTASSIST_NEXT 0x261 -+#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 -+#define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 -+#define KEY_KBDINPUTASSIST_ACCEPT 0x264 -+#define KEY_KBDINPUTASSIST_CANCEL 0x265 -+ -+#define BTN_TRIGGER_HAPPY 0x2c0 -+#define BTN_TRIGGER_HAPPY1 0x2c0 -+#define BTN_TRIGGER_HAPPY2 0x2c1 -+#define BTN_TRIGGER_HAPPY3 0x2c2 -+#define BTN_TRIGGER_HAPPY4 0x2c3 -+#define BTN_TRIGGER_HAPPY5 0x2c4 -+#define BTN_TRIGGER_HAPPY6 0x2c5 -+#define BTN_TRIGGER_HAPPY7 0x2c6 -+#define BTN_TRIGGER_HAPPY8 0x2c7 -+#define BTN_TRIGGER_HAPPY9 0x2c8 -+#define BTN_TRIGGER_HAPPY10 0x2c9 -+#define BTN_TRIGGER_HAPPY11 0x2ca -+#define BTN_TRIGGER_HAPPY12 0x2cb -+#define BTN_TRIGGER_HAPPY13 0x2cc -+#define BTN_TRIGGER_HAPPY14 0x2cd -+#define BTN_TRIGGER_HAPPY15 0x2ce -+#define BTN_TRIGGER_HAPPY16 0x2cf -+#define BTN_TRIGGER_HAPPY17 0x2d0 -+#define BTN_TRIGGER_HAPPY18 0x2d1 -+#define BTN_TRIGGER_HAPPY19 0x2d2 -+#define BTN_TRIGGER_HAPPY20 0x2d3 -+#define BTN_TRIGGER_HAPPY21 0x2d4 -+#define BTN_TRIGGER_HAPPY22 0x2d5 -+#define BTN_TRIGGER_HAPPY23 0x2d6 -+#define BTN_TRIGGER_HAPPY24 0x2d7 -+#define BTN_TRIGGER_HAPPY25 0x2d8 -+#define BTN_TRIGGER_HAPPY26 0x2d9 -+#define BTN_TRIGGER_HAPPY27 0x2da -+#define BTN_TRIGGER_HAPPY28 0x2db -+#define BTN_TRIGGER_HAPPY29 0x2dc -+#define BTN_TRIGGER_HAPPY30 0x2dd -+#define BTN_TRIGGER_HAPPY31 0x2de -+#define BTN_TRIGGER_HAPPY32 0x2df -+#define BTN_TRIGGER_HAPPY33 0x2e0 -+#define BTN_TRIGGER_HAPPY34 0x2e1 -+#define BTN_TRIGGER_HAPPY35 0x2e2 -+#define BTN_TRIGGER_HAPPY36 0x2e3 -+#define BTN_TRIGGER_HAPPY37 0x2e4 -+#define BTN_TRIGGER_HAPPY38 0x2e5 -+#define BTN_TRIGGER_HAPPY39 0x2e6 -+#define BTN_TRIGGER_HAPPY40 0x2e7 -+ -+/* We avoid low common keys in module aliases so they don't get huge. */ -+#define KEY_MIN_INTERESTING KEY_MUTE -+#define KEY_MAX 0x2ff -+#define KEY_CNT (KEY_MAX+1) -+ -+/* -+ * Relative axes -+ */ -+ -+#define REL_X 0x00 -+#define REL_Y 0x01 -+#define REL_Z 0x02 -+#define REL_RX 0x03 -+#define REL_RY 0x04 -+#define REL_RZ 0x05 -+#define REL_HWHEEL 0x06 -+#define REL_DIAL 0x07 -+#define REL_WHEEL 0x08 -+#define REL_MISC 0x09 -+#define REL_MAX 0x0f -+#define REL_CNT (REL_MAX+1) -+ -+/* -+ * Absolute axes -+ */ -+ -+#define ABS_X 0x00 -+#define ABS_Y 0x01 -+#define ABS_Z 0x02 -+#define ABS_RX 0x03 -+#define ABS_RY 0x04 -+#define ABS_RZ 0x05 -+#define ABS_THROTTLE 0x06 -+#define ABS_RUDDER 0x07 -+#define ABS_WHEEL 0x08 -+#define ABS_GAS 0x09 -+#define ABS_BRAKE 0x0a -+#define ABS_HAT0X 0x10 -+#define ABS_HAT0Y 0x11 -+#define ABS_HAT1X 0x12 -+#define ABS_HAT1Y 0x13 -+#define ABS_HAT2X 0x14 -+#define ABS_HAT2Y 0x15 -+#define ABS_HAT3X 0x16 -+#define ABS_HAT3Y 0x17 -+#define ABS_PRESSURE 0x18 -+#define ABS_DISTANCE 0x19 -+#define ABS_TILT_X 0x1a -+#define ABS_TILT_Y 0x1b -+#define ABS_TOOL_WIDTH 0x1c -+ -+#define ABS_VOLUME 0x20 -+ -+#define ABS_MISC 0x28 -+ -+#define ABS_MT_SLOT 0x2f /* MT slot being modified */ -+#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ -+#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ -+#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ -+#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ -+#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ -+#define ABS_MT_POSITION_X 0x35 /* Center X touch position */ -+#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */ -+#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ -+#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ -+#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ -+#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ -+#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ -+#define ABS_MT_TOOL_X 0x3c /* Center X tool position */ -+#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ -+ -+ -+#define ABS_MAX 0x3f -+#define ABS_CNT (ABS_MAX+1) -+ -+/* -+ * Switch events -+ */ -+ -+#define SW_LID 0x00 /* set = lid shut */ -+#define SW_TABLET_MODE 0x01 /* set = tablet mode */ -+#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ -+#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" -+ set = radio enabled */ -+#define SW_RADIO SW_RFKILL_ALL /* deprecated */ -+#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ -+#define SW_DOCK 0x05 /* set = plugged into dock */ -+#define SW_LINEOUT_INSERT 0x06 /* set = inserted */ -+#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ -+#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ -+#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ -+#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ -+#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ -+#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ -+#define SW_LINEIN_INSERT 0x0d /* set = inserted */ -+#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ -+#define SW_MAX 0x0f -+#define SW_CNT (SW_MAX+1) -+ -+/* -+ * Misc events -+ */ -+ -+#define MSC_SERIAL 0x00 -+#define MSC_PULSELED 0x01 -+#define MSC_GESTURE 0x02 -+#define MSC_RAW 0x03 -+#define MSC_SCAN 0x04 -+#define MSC_TIMESTAMP 0x05 -+#define MSC_MAX 0x07 -+#define MSC_CNT (MSC_MAX+1) -+ -+/* -+ * LEDs -+ */ -+ -+#define LED_NUML 0x00 -+#define LED_CAPSL 0x01 -+#define LED_SCROLLL 0x02 -+#define LED_COMPOSE 0x03 -+#define LED_KANA 0x04 -+#define LED_SLEEP 0x05 -+#define LED_SUSPEND 0x06 -+#define LED_MUTE 0x07 -+#define LED_MISC 0x08 -+#define LED_MAIL 0x09 -+#define LED_CHARGING 0x0a -+#define LED_MAX 0x0f -+#define LED_CNT (LED_MAX+1) -+ -+/* -+ * Autorepeat values -+ */ -+ -+#define REP_DELAY 0x00 -+#define REP_PERIOD 0x01 -+#define REP_MAX 0x01 -+#define REP_CNT (REP_MAX+1) -+ -+/* -+ * Sounds -+ */ -+ -+#define SND_CLICK 0x00 -+#define SND_BELL 0x01 -+#define SND_TONE 0x02 -+#define SND_MAX 0x07 -+#define SND_CNT (SND_MAX+1) -+ -+#endif diff --git a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch deleted file mode 100644 index e36f9e3c5..000000000 --- a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch +++ /dev/null @@ -1,7211 +0,0 @@ -From 80e5f83c0fc4bf42110cc55ce671ad7ddc7b08a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 14 Mar 2016 17:37:09 +0100 -Subject: [PATCH] sunxi: Sync dts files with the upstream kernel - -Sync dts files with the upstream kernel including -changes queued for 4.6: - -https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6 - -Note this adds a number of new unused board dts files. I've asked the -authors of the kernel commits adding these to submit a matching defconfig -to u-boot. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/dts/Makefile | 8 +- - arch/arm/dts/axp22x.dtsi | 145 ++++++++++++ - arch/arm/dts/sun4i-a10-a1000.dts | 4 + - arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 22 ++ - arch/arm/dts/sun4i-a10-cubieboard.dts | 4 + - arch/arm/dts/sun4i-a10-gemei-g9.dts | 63 +++++- - arch/arm/dts/sun4i-a10-inet1.dts | 48 ++++ - arch/arm/dts/sun4i-a10-inet97fv2.dts | 127 ++++++++++- - arch/arm/dts/sun4i-a10-inet9f-rev03.dts | 181 +++++++++++++++ - arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts | 86 +------ - arch/arm/dts/sun4i-a10-jesurun-q5.dts | 15 ++ - arch/arm/dts/sun4i-a10-marsboard.dts | 23 ++ - arch/arm/dts/sun4i-a10-mk802.dts | 37 +++ - arch/arm/dts/sun4i-a10-olinuxino-lime.dts | 12 + - arch/arm/dts/sun4i-a10-pcduino.dts | 58 ++++- - arch/arm/dts/sun4i-a10-pcduino2.dts | 78 +++++++ - arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts | 69 ++++++ - arch/arm/dts/sun4i-a10.dtsi | 153 +++++++++++-- - arch/arm/dts/sun5i-a10s-auxtek-t004.dts | 14 ++ - arch/arm/dts/sun5i-a10s-olinuxino-micro.dts | 2 +- - arch/arm/dts/sun5i-a13-empire-electronix-d709.dts | 19 +- - arch/arm/dts/sun5i-a13-inet-98v-rev2.dts | 26 +-- - arch/arm/dts/sun5i-a13-utoo-p66.dts | 30 +++ - arch/arm/dts/sun5i-q8-common.dtsi | 10 + - arch/arm/dts/sun5i-r8-chip.dts | 47 +++- - arch/arm/dts/sun5i.dtsi | 31 +++ - arch/arm/dts/sun6i-a31-colombus.dts | 24 ++ - arch/arm/dts/sun6i-a31-hummingbird.dts | 132 ++++++----- - arch/arm/dts/sun6i-a31.dtsi | 65 +++++- - arch/arm/dts/sun6i-a31s-primo81.dts | 247 ++++++++++++++++++++- - arch/arm/dts/sun6i-a31s-sina31s-core.dtsi | 142 ++++++++++++ - arch/arm/dts/sun6i-a31s-sina31s.dts | 153 +++++++++++++ - .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | 205 +++++++++++++++++ - arch/arm/dts/sun7i-a20-bananapi.dts | 78 ++++++- - arch/arm/dts/sun7i-a20-cubieboard2.dts | 23 ++ - arch/arm/dts/sun7i-a20-cubietruck.dts | 4 + - arch/arm/dts/sun7i-a20-icnova-swac.dts | 169 ++++++++++++++ - arch/arm/dts/sun7i-a20-itead-ibox.dts | 125 +++++++++++ - arch/arm/dts/sun7i-a20-lamobo-r1.dts | 10 - - arch/arm/dts/sun7i-a20-mk808c.dts | 39 ++++ - arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 95 ++++++-- - arch/arm/dts/sun7i-a20-olinuxino-lime.dts | 12 + - arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 47 ++++ - arch/arm/dts/sun7i-a20-olinuxino-micro.dts | 6 + - arch/arm/dts/sun7i-a20-orangepi-mini.dts | 33 +++ - arch/arm/dts/sun7i-a20-orangepi.dts | 29 +++ - arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 69 +++++- - arch/arm/dts/sun7i-a20-pcduino3.dts | 58 ++++- - arch/arm/dts/sun7i-a20-wexler-tab7200.dts | 90 +++++++- - arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 187 +++++++++++++++- - arch/arm/dts/sun7i-a20.dtsi | 113 +++++++++- - arch/arm/dts/sun8i-a23-a33.dtsi | 71 ++++-- - arch/arm/dts/sun8i-a23-gt90h-v4.dts | 120 +++++++++- - arch/arm/dts/sun8i-a23.dtsi | 25 +++ - arch/arm/dts/sun8i-a33-sinlinx-sina33.dts | 83 ++++++- - arch/arm/dts/sun8i-a33.dtsi | 45 ++++ - arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 65 ++++++ - arch/arm/dts/sun8i-a83t.dtsi | 125 +++++------ - arch/arm/dts/sun8i-h3-orangepi-pc.dts | 69 ++++++ - arch/arm/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++ - arch/arm/dts/sun8i-h3.dtsi | 189 +++++++++++----- - arch/arm/dts/sun8i-q8-common.dtsi | 96 +++++++- - arch/arm/dts/sun9i-a80-cubieboard4.dts | 36 +++ - arch/arm/dts/sun9i-a80-optimus.dts | 48 ++-- - arch/arm/dts/sun9i-a80.dtsi | 204 +++++++++++++++-- - arch/arm/dts/sunxi-itead-core-common.dtsi | 136 ++++++++++++ - arch/arm/dts/sunxi-q8-common.dtsi | 6 + - 67 files changed, 4351 insertions(+), 497 deletions(-) - create mode 100644 arch/arm/dts/axp22x.dtsi - create mode 100644 arch/arm/dts/sun4i-a10-pcduino2.dts - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s.dts - create mode 100644 arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts - create mode 100644 arch/arm/dts/sun7i-a20-icnova-swac.dts - create mode 100644 arch/arm/dts/sun7i-a20-itead-ibox.dts - create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts - create mode 100644 arch/arm/dts/sunxi-itead-core-common.dtsi - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \ - sun4i-a10-mk802ii.dtb \ - sun4i-a10-olinuxino-lime.dtb \ - sun4i-a10-pcduino.dtb \ -+ sun4i-a10-pcduino2.dtb \ - sun4i-a10-pov-protab2-ips9.dtb - dtb-$(CONFIG_MACH_SUN5I) += \ - sun5i-a10s-auxtek-t003.dtb \ -@@ -155,7 +156,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \ - sun6i-a31-pangolin.dtb \ - sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ -- sun6i-a31s-sinovoip-bpi-m2.dtb -+ sun6i-a31s-sina31s.dtb \ -+ sun6i-a31s-sinovoip-bpi-m2.dtb \ -+ sun6i-a31s-yones-toptech-bs1078-v2.dtb - dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-ainol-aw1.dtb \ - sun7i-a20-bananapi.dtb \ -@@ -164,6 +167,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-cubietruck.dtb \ - sun7i-a20-hummingbird.dtb \ - sun7i-a20-i12-tvbox.dtb \ -+ sun7i-a20-icnova-swac.dtb \ -+ sun7i-a20-itead-ibox.dtb \ - sun7i-a20-lamobo-r1.dtb \ - sun7i-a20-m3.dtb \ - sun7i-a20-m5.dtb \ -@@ -190,6 +195,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ - sun8i-a33-sinlinx-sina33.dtb - dtb-$(CONFIG_MACH_SUN8I_A83T) += \ - sun8i-a83t-allwinner-h8homlet-v2.dtb \ -+ sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-sinovoip-bpi-m3.dtb - dtb-$(CONFIG_MACH_SUN8I_H3) += \ - sun8i-h3-orangepi-pc.dtb \ ---- /dev/null -+++ b/arch/arm/dts/axp22x.dtsi -@@ -0,0 +1,145 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * AXP221/221s/223 Integrated Power Management Chip -+ * http://www.x-powers.com/product/AXP22X.php -+ * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf -+ */ -+ -+&axp22x { -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ -+ regulators { -+ /* Default work frequency for buck regulators */ -+ x-powers,dcdc-freq = <3000>; -+ -+ reg_dcdc1: dcdc1 { -+ regulator-name = "dcdc1"; -+ }; -+ -+ reg_dcdc2: dcdc2 { -+ regulator-name = "dcdc2"; -+ }; -+ -+ reg_dcdc3: dcdc3 { -+ regulator-name = "dcdc3"; -+ }; -+ -+ reg_dcdc4: dcdc4 { -+ regulator-name = "dcdc4"; -+ }; -+ -+ reg_dcdc5: dcdc5 { -+ regulator-name = "dcdc5"; -+ }; -+ -+ reg_dc1sw: dc1sw { -+ regulator-name = "dc1sw"; -+ }; -+ -+ reg_dc5ldo: dc5ldo { -+ regulator-name = "dc5ldo"; -+ }; -+ -+ reg_aldo1: aldo1 { -+ regulator-name = "aldo1"; -+ }; -+ -+ reg_aldo2: aldo2 { -+ regulator-name = "aldo2"; -+ }; -+ -+ reg_aldo3: aldo3 { -+ regulator-name = "aldo3"; -+ }; -+ -+ reg_dldo1: dldo1 { -+ regulator-name = "dldo1"; -+ }; -+ -+ reg_dldo2: dldo2 { -+ regulator-name = "dldo2"; -+ }; -+ -+ reg_dldo3: dldo3 { -+ regulator-name = "dldo3"; -+ }; -+ -+ reg_dldo4: dldo4 { -+ regulator-name = "dldo4"; -+ }; -+ -+ reg_eldo1: eldo1 { -+ regulator-name = "eldo1"; -+ }; -+ -+ reg_eldo2: eldo2 { -+ regulator-name = "eldo2"; -+ }; -+ -+ reg_eldo3: eldo3 { -+ regulator-name = "eldo3"; -+ }; -+ -+ reg_ldo_io0: ldo_io0 { -+ regulator-name = "ldo_io0"; -+ status = "disabled"; -+ }; -+ -+ reg_ldo_io1: ldo_io1 { -+ regulator-name = "ldo_io1"; -+ status = "disabled"; -+ }; -+ -+ reg_rtc_ldo: rtc_ldo { -+ /* RTC_LDO is a fixed, always-on regulator */ -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "rtc_ldo"; -+ }; -+ }; -+}; ---- a/arch/arm/dts/sun4i-a10-a1000.dts -+++ b/arch/arm/dts/sun4i-a10-a1000.dts -@@ -93,6 +93,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -+++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Chuwi V7 CW0825"; -@@ -78,6 +79,27 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5306de4: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ }; -+}; -+ - &lradc { - vref-supply = <®_vcc3v0>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-cubieboard.dts -+++ b/arch/arm/dts/sun4i-a10-cubieboard.dts -@@ -83,6 +83,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- a/arch/arm/dts/sun4i-a10-gemei-g9.dts -+++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts -@@ -47,6 +47,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Gemei G9 Tablet"; -@@ -64,12 +65,22 @@ - /* - * TODO: - * 2x cameras via CSI -- * bma250 IRQs - * AXP battery management - * NAND - * OTG - * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48 - */ -+&codec { -+ /* PH15 controls power to external amplifier (ft2012q) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; - - &ehci0 { - status = "okay"; -@@ -85,15 +96,13 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -103,17 +112,13 @@ - bma250@18 { - compatible = "bosch,bma250"; - reg = <0x18>; -- -- /* -- * TODO: interrupt pins: -- * int1 - PH00 -- * int2 - PI10 -- */ -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */ - }; - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_ldo2>; - - status = "okay"; - -@@ -149,6 +154,40 @@ - status = "okay"; - }; - -+&pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet1.dts -+++ b/arch/arm/dts/sun4i-a10-inet1.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "iNet-1"; -@@ -56,11 +57,25 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_inet>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -104,6 +119,19 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5x: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_wake_pin>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ -+ touchscreen-size-x = <600>; -+ touchscreen-size-y = <1024>; -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -151,6 +179,20 @@ - }; - - &pio { -+ bl_en_pin_inet: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_wake_pin: touchscreen_wake_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -166,6 +208,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10-inet97fv2.dts -+++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts -@@ -47,6 +47,8 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include -+#include - - / { - model = "INet-97F Rev 02"; -@@ -61,8 +63,8 @@ - }; - }; - --&ehci0 { -- status = "okay"; -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci1 { -@@ -75,12 +77,71 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -+ }; -+}; -+ -+#include "axp209.dtsi" -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_ldo2>; -+ status = "okay"; -+ -+ button@200 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <200000>; -+ }; -+ -+ button@600 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; - -- interrupt-controller; -- #interrupt-cells = <1>; -+ button@800 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@1000 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1000000>; -+ }; -+ -+ button@1200 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1200000>; - }; - }; - -@@ -94,15 +155,52 @@ - status = "okay"; - }; - --&ohci0 { -+&otg_sram { - status = "okay"; - }; - --&ohci1 { -- status = "okay"; -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb1_vbus { -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { - status = "okay"; - }; - -@@ -116,8 +214,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -+++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -@@ -59,6 +59,159 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ gpio_keys { -+ compatible = "gpio-keys-polled"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&key_pins_inet9f>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <20>; -+ -+ button@0 { -+ label = "Left Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ -+ }; -+ -+ button@1 { -+ label = "Left Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ -+ }; -+ -+ button@2 { -+ label = "Left Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ -+ }; -+ -+ button@3 { -+ label = "Left Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ -+ }; -+ -+ button@4 { -+ label = "Right Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ -+ }; -+ -+ button@5 { -+ label = "Right Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ -+ }; -+ -+ button@6 { -+ label = "Right Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ -+ }; -+ -+ button@7 { -+ label = "Right Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ -+ }; -+ -+ button@8 { -+ label = "DPad Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */ -+ }; -+ -+ button@9 { -+ label = "DPad Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */ -+ }; -+ -+ button@10 { -+ label = "DPad Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */ -+ }; -+ -+ button@11 { -+ label = "DPad Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */ -+ }; -+ -+ button@12 { -+ label = "Button X"; -+ linux,code = ; -+ gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */ -+ }; -+ -+ button@13 { -+ label = "Button Y"; -+ linux,code = ; -+ gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */ -+ }; -+ -+ button@14 { -+ label = "Button A"; -+ linux,code = ; -+ gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */ -+ }; -+ -+ button@15 { -+ label = "Button B"; -+ linux,code = ; -+ gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */ -+ }; -+ -+ button@16 { -+ label = "Select Button"; -+ linux,code = ; -+ gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ -+ }; -+ -+ button@17 { -+ label = "Start Button"; -+ linux,code = ; -+ gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ -+ }; -+ -+ button@18 { -+ label = "Top Left Button"; -+ linux,code = ; -+ gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */ -+ }; -+ -+ button@19 { -+ label = "Top Right Button"; -+ linux,code = ; -+ gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */ -+ }; -+ }; - }; - - &cpu0 { -@@ -86,12 +239,29 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; - }; - - &lradc { -@@ -149,6 +319,17 @@ - }; - - &pio { -+ key_pins_inet9f: key_pins@0 { -+ allwinner,pins = "PA0", "PA1", "PA3", "PA4", -+ "PA5", "PA6", "PA8", "PA9", -+ "PA11", "PA12", "PA13", -+ "PA14", "PA15", "PA16", "PA17", -+ "PH22", "PH23", "PH24", "PH25", "PH26"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; ---- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -+++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 Josef Gajdusek -+ * Copyright 2015 - Marcus Cooper - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -42,22 +43,11 @@ - - /dts-v1/; - #include "sun4i-a10.dtsi" --#include "sunxi-common-regulators.dtsi" -- --#include --#include -+#include "sunxi-itead-core-common.dtsi" - - / { - model = "Iteaduino Plus A10"; - compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10"; -- -- aliases { -- serial0 = &uart0; -- }; -- -- chosen { -- stdout-path = "serial0:115200n8"; -- }; - }; - - &ahci { -@@ -65,18 +55,6 @@ - status = "okay"; - }; - --&cpu0 { -- cpu-supply = <®_dcdc2>; --}; -- --&ehci0 { -- status = "okay"; --}; -- --&ehci1 { -- status = "okay"; --}; -- - &emac { - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins_a>; -@@ -89,12 +67,7 @@ - }; - - &i2c0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c0_pins_a>; -- status = "okay"; -- - axp209: pmic@34 { -- reg = <0x34>; - interrupts = <0>; - }; - }; -@@ -135,68 +108,13 @@ - status = "okay"; - }; - --&ohci0 { -- status = "okay"; --}; -- --&ohci1 { -- status = "okay"; --}; -- - ®_ahci_5v { - status = "okay"; - }; - --#include "axp209.dtsi" -- --®_dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1450000>; -- regulator-name = "vdd-cpu"; --}; -- --®_dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1400000>; -- regulator-name = "vdd-int-dll"; --}; -- --®_ldo1 { -- regulator-name = "vdd-rtc"; --}; -- --®_ldo2 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; --}; -- --®_usb1_vbus { -- status = "okay"; --}; -- --®_usb2_vbus { -- status = "okay"; --}; -- - &spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins_a>, - <&spi0_cs0_pins_a>; - status = "okay"; - }; -- --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -- status = "okay"; --}; -- --&usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -- status = "okay"; --}; ---- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts -+++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts -@@ -156,6 +156,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - emac_power_pin_q5: emac_power_pin@0 { - allwinner,pins = "PH19"; -@@ -172,6 +176,11 @@ - }; - }; - -+®_usb0_vbus { -+ regulator-boot-on; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -186,7 +195,13 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ - &usbphy { -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-marsboard.dts -+++ b/arch/arm/dts/sun4i-a10-marsboard.dts -@@ -91,6 +91,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -154,6 +158,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_marsboard: led_pins@0 { - allwinner,pins = "PB5", "PB6", "PB7", "PB8"; -@@ -161,6 +169,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb1_vbus { -@@ -184,7 +199,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-mk802.dts -+++ b/arch/arm/dts/sun4i-a10-mk802.dts -@@ -44,6 +44,7 @@ - #include "sun4i-a10.dtsi" - #include "sunxi-common-regulators.dtsi" - #include -+#include - - / { - model = "MK802"; -@@ -58,6 +59,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -80,7 +85,25 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb2_vbus_pin_mk802: usb2_vbus_pin@0 { - allwinner,pins = "PH12"; - allwinner,function = "gpio_out"; -@@ -89,6 +112,10 @@ - }; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -105,7 +132,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -+++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -@@ -124,6 +124,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mdio { - status = "okay"; - ---- a/arch/arm/dts/sun4i-a10-pcduino.dts -+++ b/arch/arm/dts/sun4i-a10-pcduino.dts -@@ -104,6 +104,10 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -129,12 +133,8 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -164,6 +164,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -178,14 +182,40 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - --®_usb1_vbus { -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb2_vbus { -- status = "okay"; -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - - &uart0 { -@@ -194,8 +224,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb1_vbus-supply = <®_vcc5v0>; /* USB1 VBUS is always on */ -+ usb2_vbus-supply = <®_vcc5v0>; /* USB2 VBUS is always on */ - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun4i-a10-pcduino2.dts -@@ -0,0 +1,78 @@ -+/* -+ * Copyright 2015 Siarhei Siamashka -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * The LinkSprite pcDuino2 board is almost identical to the older -+ * LinkSprite pcDuino1 board. The only software visible difference -+ * is that the pcDuino2 board got a USB VBUS voltage regulator, which -+ * is controlled by the PD2 pin (pulled-up by default). Also one of -+ * the USB host ports has been replaced with a USB WIFI chip. -+ */ -+ -+#include "sun4i-a10-pcduino.dts" -+ -+/ { -+ model = "LinkSprite pcDuino2"; -+ compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10"; -+}; -+ -+&pio { -+ usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 { -+ allwinner,pins = "PD2"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb2_vbus { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb2_vbus_pin_pcduino2>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_vcc3v3>; /* USB WIFI is always on */ -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -+++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "Point of View Protab2-IPS9"; -@@ -56,11 +57,28 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_protab>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,12 +104,36 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ pixcir_ts@5c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_pins>; -+ compatible = "pixcir,pixcir_tangoc"; -+ reg = <0x5c>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */ -+ enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ touchscreen-inverted-x; -+ touchscreen-inverted-y; -+ }; - }; - - &lradc { -@@ -128,6 +170,27 @@ - }; - - &pio { -+ bl_en_pin_protab: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_pins: touchscreen_pins@0 { -+ allwinner,pins = "PA5", "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -143,6 +206,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10.dtsi -+++ b/arch/arm/dts/sun4i-a10.dtsi -@@ -45,6 +45,7 @@ - - #include - -+#include - #include - #include - -@@ -65,7 +66,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -74,7 +75,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -83,7 +85,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -- <&ahb_gates 46>; -+ <&ahb_gates 46>, <&dram_gates 25>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -92,7 +95,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -195,6 +199,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -241,6 +254,7 @@ - compatible = "allwinner,sun4i-a10-axi-gates-clk"; - reg = <0x01c2005c 0x4>; - clocks = <&axi>; -+ clock-indices = <0>; - clock-output-names = "axi_dram"; - }; - -@@ -257,17 +271,36 @@ - compatible = "allwinner,sun4i-a10-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, <6>, -+ <7>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, -+ <21>, <22>, <23>, -+ <24>, <25>, <26>, -+ <32>, <33>, <34>, -+ <35>, <36>, <37>, -+ <40>, <41>, <43>, -+ <44>, <45>, -+ <46>, <47>, -+ <50>, <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", -- "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss", -- "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1", -- "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand", -- "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts", -- "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3", -- "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve", -- "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0", -- "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi", -- "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0", -- "ahb_de_fe1", "ahb_mp", "ahb_mali400"; -+ "ahb_ohci0", "ahb_ehci1", -+ "ahb_ohci1", "ahb_ss", "ahb_dma", -+ "ahb_bist", "ahb_mmc0", "ahb_mmc1", -+ "ahb_mmc2", "ahb_mmc3", "ahb_ms", -+ "ahb_nand", "ahb_sdram", "ahb_ace", -+ "ahb_emac", "ahb_ts", "ahb_spi0", -+ "ahb_spi1", "ahb_spi2", "ahb_spi3", -+ "ahb_pata", "ahb_sata", "ahb_gps", -+ "ahb_ve", "ahb_tvd", "ahb_tve0", -+ "ahb_tve1", "ahb_lcd0", "ahb_lcd1", -+ "ahb_csi0", "ahb_csi1", "ahb_hdmi", -+ "ahb_de_be0", "ahb_de_be1", -+ "ahb_de_fe0", "ahb_de_fe1", -+ "ahb_mp", "ahb_mali400"; - }; - - apb0: apb0@01c20054 { -@@ -283,9 +316,14 @@ - compatible = "allwinner,sun4i-a10-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <5>, <6>, -+ <7>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", -- "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0", -- "apb0_ir1", "apb0_keypad"; -+ "apb0_ac97", "apb0_iis", -+ "apb0_pio", "apb0_ir0", -+ "apb0_ir1", "apb0_keypad"; - }; - - apb1: clk@01c20058 { -@@ -301,12 +339,22 @@ - compatible = "allwinner,sun4i-a10-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, -+ <5>, <6>, -+ <7>, <16>, -+ <17>, <18>, -+ <19>, <20>, -+ <21>, <22>, -+ <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", -- "apb1_i2c2", "apb1_can", "apb1_scr", -- "apb1_ps20", "apb1_ps21", "apb1_uart0", -- "apb1_uart1", "apb1_uart2", "apb1_uart3", -- "apb1_uart4", "apb1_uart5", "apb1_uart6", -- "apb1_uart7"; -+ "apb1_i2c2", "apb1_can", -+ "apb1_scr", "apb1_ps20", -+ "apb1_ps21", "apb1_uart0", -+ "apb1_uart1", "apb1_uart2", -+ "apb1_uart3", "apb1_uart4", -+ "apb1_uart5", "apb1_uart6", -+ "apb1_uart7"; - }; - - nand_clk: clk@01c20080 { -@@ -446,6 +494,48 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; - clock-output-names = "spi3"; - }; -+ -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; - }; - - soc@01c00000 { -@@ -656,6 +746,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = <86>; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -961,6 +1059,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -+++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -@@ -86,6 +86,20 @@ - status = "okay"; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp152: pmic@30 { -+ compatible = "x-powers,axp152"; -+ reg = <0x30>; -+ interrupts = <0>; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>; ---- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -+++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -@@ -111,7 +111,7 @@ - status = "okay"; - - at24@50 { -- compatible = "at,24c16"; -+ compatible = "atmel,24c16"; - pagesize = <16>; - reg = <0x50>; - read-only; ---- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -+++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -@@ -123,7 +123,7 @@ - - &mmc0 { - pinctrl-names = "default"; -- pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>; - vmmc-supply = <®_vcc3v3>; - bus-width = <4>; - cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ -@@ -131,27 +131,12 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; - - &pio { -- mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 { -+ mmc0_cd_pin_d709: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; - allwinner,drive = ; ---- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -+++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -@@ -123,21 +123,6 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; -@@ -201,11 +186,6 @@ - status = "okay"; - }; - --®_usb1_vbus { -- gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ -- status = "okay"; --}; -- - &uart1 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins_b>; -@@ -221,16 +201,12 @@ - allwinner,pins = "PG12"; - }; - --&usb1_vbus_pin_a { -- allwinner,pins = "PG11"; --}; -- - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; - usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ - usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ - usb0_vbus-supply = <®_usb0_vbus>; -- usb1_vbus-supply = <®_usb1_vbus>; -+ usb1_vbus-supply = <®_ldo3>; - status = "okay"; - }; ---- a/arch/arm/dts/sun5i-a13-utoo-p66.dts -+++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts -@@ -47,11 +47,21 @@ - #include - #include - #include -+#include - - / { - model = "Utoo P66"; - compatible = "utoo,p66", "allwinner,sun5i-a13"; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ /* Note levels of 10 / 20% result in backlight off */ -+ brightness-levels = <0 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <6>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - i2c_lcd: i2c@0 { - /* The lcd panel i2c interface is hooked up via gpios */ - compatible = "i2c-gpio"; -@@ -63,6 +73,13 @@ - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -158,6 +175,13 @@ - }; - - &pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PG3"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_p66: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; -@@ -201,6 +225,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun5i-q8-common.dtsi -+++ b/arch/arm/dts/sun5i-q8-common.dtsi -@@ -41,11 +41,21 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &uart1; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; ---- a/arch/arm/dts/sun5i-r8-chip.dts -+++ b/arch/arm/dts/sun5i-r8-chip.dts -@@ -64,6 +64,26 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ wifi_reg_on: wifi_reg_on { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&chip_wifi_reg_on_pin>; -+ -+ regulator-name = "wifi-reg-on"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */ -+ enable-active-high; -+ }; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -109,10 +129,14 @@ - }; - }; - -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>; -- vmmc-supply = <®_vcc3v3>; -+ vmmc-supply = <&wifi_reg_on>; - bus-width = <4>; - non-removable; - status = "okay"; -@@ -134,6 +158,13 @@ - allwinner,pull = ; - }; - -+ chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 { -+ allwinner,pins = "PC19"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - chip_id_det_pin: chip_id_det_pin@0 { - allwinner,pins = "PG2"; - allwinner,function = "gpio_in"; -@@ -167,6 +198,20 @@ - regulator-always-on; - }; - -+®_ldo3 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi1"; -+ regulator-always-on; -+}; -+ -+®_ldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi2"; -+ regulator-always-on; -+}; -+ - ®_ldo5 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; ---- a/arch/arm/dts/sun5i.dtsi -+++ b/arch/arm/dts/sun5i.dtsi -@@ -44,6 +44,7 @@ - - #include "skeleton.dtsi" - -+#include - #include - #include - -@@ -102,6 +103,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun5i-a13-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -285,6 +295,14 @@ - clock-output-names = "usb_ohci0", "usb_phy"; - }; - -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -571,6 +589,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun6i-a31-colombus.dts -+++ b/arch/arm/dts/sun6i-a31-colombus.dts -@@ -60,6 +60,16 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ i2c_lcd: i2c@0 { -+ /* The lcd panel i2c interface is hooked up via gpios */ -+ compatible = "i2c-gpio"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c_lcd_pins>; -+ gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */ -+ <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */ -+ i2c-gpio,delay-us = <5>; -+ }; - }; - - &ehci1 { -@@ -94,6 +104,13 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ mma8452: mma8452@1d { -+ compatible = "fsl,mma8452"; -+ reg = <0x1d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */ -+ }; - }; - - &mmc0 { -@@ -124,6 +141,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ i2c_lcd_pins: i2c_lcd_pin@0 { -+ allwinner,pins = "PA23", "PA24"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb2_vbus { ---- a/arch/arm/dts/sun6i-a31-hummingbird.dts -+++ b/arch/arm/dts/sun6i-a31-hummingbird.dts -@@ -54,6 +54,8 @@ - compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31"; - - aliases { -+ rtc0 = &pcf8563; -+ rtc1 = &rtc; - serial0 = &uart0; - }; - -@@ -67,13 +69,17 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ - &ehci0 { - status = "okay"; - }; - - &gmac { - pinctrl-names = "default"; -- pinctrl-0 = <&gmac_pins_rgmii_a>; -+ pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>; - phy = <&phy1>; - phy-mode = "rgmii"; - snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; -@@ -119,7 +125,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; -- vmmc-supply = <&vcc_3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ - cd-inverted; -@@ -134,7 +140,7 @@ - &mmc1 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>; -- vmmc-supply = <&vcc_wifi>; -+ vmmc-supply = <®_aldo1>; - mmc-pwrseq = <&wifi_pwrseq>; - bus-width = <4>; - non-removable; -@@ -146,6 +152,13 @@ - }; - - &pio { -+ gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 { -+ allwinner,pins = "PA21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 { - allwinner,pins = "PA8"; - allwinner,function = "gpio_in"; -@@ -164,70 +177,69 @@ - &p2wi { - status = "okay"; - -- axp221: pmic@68 { -+ axp22x: pmic@68 { - compatible = "x-powers,axp221"; - reg = <0x68>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- interrupt-controller; -- #interrupt-cells = <1>; -- dcdc1-supply = <&vcc_3v0>; -- dcdc5-supply = <&vcc_dram>; -- -- regulators { -- x-powers,dcdc-freq = <3000>; -- -- vcc_3v0: dcdc1 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "vcc-3v0"; -- }; -- -- vdd_cpu: dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-cpu"; -- }; -- -- vdd_gpu: dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-gpu"; -- }; -- -- vdd_sys_dll: dcdc4 { -- regulator-always-on; -- regulator-min-microvolt = <1100000>; -- regulator-max-microvolt = <1100000>; -- regulator-name = "vdd-sys-dll"; -- }; -- -- vcc_dram: dcdc5 { -- regulator-always-on; -- regulator-min-microvolt = <1500000>; -- regulator-max-microvolt = <1500000>; -- regulator-name = "vcc-dram"; -- }; -- -- vcc_wifi: aldo1 { -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- regulator-name = "vcc_wifi"; -- }; -- -- avcc: aldo3 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; -- }; -- }; - }; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ - ®_usb1_vbus { - gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */ - status = "okay"; ---- a/arch/arm/dts/sun6i-a31.dtsi -+++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -61,7 +61,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_hdmi: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; -@@ -69,7 +69,7 @@ - status = "disabled"; - }; - -- framebuffer@1 { -+ simplefb_lcd: framebuffer@1 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -252,6 +252,20 @@ - compatible = "allwinner,sun6i-a31-ahb1-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, -+ <17>, <18>, <19>, -+ <20>, <21>, <22>, -+ <23>, <24>, <26>, -+ <27>, <29>, -+ <30>, <31>, <32>, -+ <36>, <37>, <40>, -+ <43>, <44>, <45>, -+ <46>, <47>, <50>, -+ <52>, <55>, <56>, -+ <57>, <58>; - clock-output-names = "ahb1_mipidsi", "ahb1_ss", - "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1", - "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1", -@@ -281,6 +295,9 @@ - compatible = "allwinner,sun6i-a31-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <4>, -+ <5>, <12>, -+ <13>; - clock-output-names = "apb1_codec", "apb1_digital_mic", - "apb1_pio", "apb1_daudio0", - "apb1_daudio1"; -@@ -299,6 +316,10 @@ - compatible = "allwinner,sun6i-a31-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <16>, -+ <17>, <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_i2c3", - "apb2_uart0", "apb2_uart1", -@@ -346,6 +367,14 @@ - "mmc3_sample"; - }; - -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - spi0_clk: clk@01c200a0 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; -@@ -384,6 +413,9 @@ - compatible = "allwinner,sun6i-a31-usb-clk"; - reg = <0x01c200cc 0x4>; - clocks = <&osc24M>; -+ clock-indices = <8>, <9>, <10>, -+ <16>, <17>, -+ <18>; - clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2", - "usb_ohci0", "usb_ohci1", - "usb_ohci2"; -@@ -684,6 +716,16 @@ - allwinner,pull = ; - }; - -+ mmc3_8bit_emmc_pins: mmc3@1 { -+ allwinner,pins = "PC6", "PC7", "PC8", "PC9", -+ "PC10", "PC11", "PC12", -+ "PC13", "PC14", "PC15", -+ "PC24"; -+ allwinner,function = "mmc3"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - gmac_pins_mii_a: gmac_mii@0 { - allwinner,pins = "PA0", "PA1", "PA2", "PA3", - "PA8", "PA9", "PA11", -@@ -761,6 +803,13 @@ - reg = <0x01c20ca0 0x20>; - }; - -+ lradc: lradc@01c22800 { -+ compatible = "allwinner,sun4i-a10-lradc-keys"; -+ reg = <0x01c22800 0x100>; -+ interrupts = ; -+ status = "disabled"; -+ }; -+ - rtp: rtp@01c25000 { - compatible = "allwinner,sun6i-a31-ts"; - reg = <0x01c25000 0x100>; -@@ -907,6 +956,16 @@ - #size-cells = <0>; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - timer@01c60000 { - compatible = "allwinner,sun6i-a31-hstimer", - "allwinner,sun7i-a20-hstimer"; -@@ -1068,7 +1127,7 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - ---- a/arch/arm/dts/sun6i-a31s-primo81.dts -+++ b/arch/arm/dts/sun6i-a31s-primo81.dts -@@ -1,16 +1,57 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2014 Siarhei Siamashka -+ * Copyright 2015 Karsten Merker -+ * Copyright 2015 Chen-Yu Tsai - * -- * Minimal dts file for the MSI Primo81 for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { -- model = "MSI Primo81"; -+ model = "MSI Primo81 tablet"; - compatible = "msi,primo81", "allwinner,sun6i-a31s"; - - aliases { -@@ -22,8 +63,202 @@ - }; - }; - --&uart0 { -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+&ehci0 { -+ /* rtl8188etv wifi is connected here */ -+ status = "okay"; -+}; -+ -+&i2c0 { -+ /* pull-ups and device VDDIO use AXP221 DLDO3 */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "failed"; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ ctp@5d { -+ pinctrl-names = "default"; -+ pinctrl-0 = <>911_int_primo81>; -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */ -+ touchscreen-swapped-x-y; -+ }; -+}; -+ -+&i2c2 { - pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ accelerometer@1c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mma8452_int_primo81>; -+ compatible = "fsl,mma8452"; -+ reg = <0x1c>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ -+ #io-channel-cells = <1>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ gt911_int_primo81: gt911_int_pin@0 { -+ allwinner,pins = "PA3"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mma8452_int_primo81: mma8452_int_pin@0 { -+ allwinner,pins = "PA9"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_primo81: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; /* This is an educated guess */ -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+®_eldo3 { -+ regulator-min-microvolt = <1080000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-mipi-bridge"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+ vdd-mipi-bridge-supply = <®_eldo3>; -+}; -+ -+&usb_otg { -+ /* otg support requires support for AXP221 usb-power-supply and GPIO */ -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi -@@ -0,0 +1,142 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Core Board"; -+ compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+/* eMMC on core board */ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_8bit_emmc_pins>; -+ vmmc-supply = <®_dcdc1>; -+ vqmmc-supply = <®_dcdc1>; -+ bus-width = <8>; -+ non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+/* AXP221s PMIC on core board */ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+/* UART0 pads available on core board */ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s.dts -@@ -0,0 +1,153 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* The SinA31s development board has the SinA31s core board soldered on */ -+#include "sun6i-a31s-sina31s-core.dtsi" -+ -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Development Board"; -+ compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s"; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pin_sina31s>; -+ -+ status { -+ label = "sina31s:status:usr"; -+ gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ -+ }; -+ }; -+}; -+ -+&ehci0 { -+ /* USB 2.0 4 port hub IC */ -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ phy-supply = <®_dldo1>; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ led_pin_sina31s: led_pin@0 { -+ allwinner,pins = "PH13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_sina31s: mmc0_cd_pin@0 { -+ allwinner,pins = "PA4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-gmac-phy"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts -@@ -0,0 +1,205 @@ -+/* -+ * Copyright 2015 Lawrence Yu -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Yones TopTech BS1078 v2 Tablet"; -+ compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ i2c1 = &i2c1; -+ i2c2 = &i2c2; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>; -+ vmmc-supply = <®_vcc3v0>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd-usb2"; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+/* Voltage source for I2C pullup resistors for I2C Bus 0 */ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; -+ usb2_vbus-supply = <®_dc1sw>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-bananapi.dts -+++ b/arch/arm/dts/sun7i-a20-bananapi.dts -@@ -92,6 +92,24 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+ operating-points = < -+ /* kHz uV */ -+ 960000 1400000 -+ 912000 1400000 -+ 864000 1350000 -+ 720000 1250000 -+ 528000 1150000 -+ 312000 1100000 -+ 144000 1050000 -+ >; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -119,13 +137,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -159,7 +173,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_bananapi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -182,6 +207,37 @@ - }; - }; - -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -216,7 +272,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubieboard2.dts -+++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts -@@ -84,6 +84,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -150,6 +154,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_cubieboard2: led_pins@0 { - allwinner,pins = "PH20", "PH21"; -@@ -157,12 +165,24 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - #include "axp209.dtsi" - - ®_dcdc2 { -@@ -205,6 +225,9 @@ - }; - - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubietruck.dts -+++ b/arch/arm/dts/sun7i-a20-cubietruck.dts -@@ -101,6 +101,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts -@@ -0,0 +1,169 @@ -+/* -+ * Copyright 2015 Stefan Roese -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "ICnova-A20 SWAC"; -+ compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts -@@ -0,0 +1,125 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-itead-core-common.dtsi" -+ -+/ { -+ model = "Itead Ibox A20"; -+ compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20"; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_itead_core>; -+ -+ green { -+ label = "itead_core:green:usr"; -+ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ -+ blue { -+ label = "itead_core:blue:usr"; -+ gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+}; -+ -+&ahci { -+ target-supply = <®_ahci_5v>; -+ status = "okay"; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ axp209: pmic@34 { -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&ir0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir0_rx_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ led_pins_itead_core: led_pins@0 { -+ allwinner,pins = "PH20","PH21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_ahci_5v { -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts -+++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts -@@ -97,16 +97,6 @@ - - &cpu0 { - cpu-supply = <®_dcdc2>; -- operating-points = < -- /* kHz uV */ -- 960000 1400000 -- 912000 1400000 -- 864000 1350000 -- 720000 1250000 -- 528000 1150000 -- 312000 1100000 -- 144000 1050000 -- >; - }; - - &ehci0 { ---- a/arch/arm/dts/sun7i-a20-mk808c.dts -+++ b/arch/arm/dts/sun7i-a20-mk808c.dts -@@ -53,6 +53,7 @@ - - #include - #include -+#include - - / { - model = "mk808c"; -@@ -68,6 +69,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -121,6 +126,30 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -141,7 +170,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -+++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 - Marcus Cooper -+ * Copyright 2015 - Karsten Merker - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -45,6 +46,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - #include - -@@ -71,14 +73,6 @@ - default-state = "on"; - }; - }; -- -- reg_axp_ipsout: axp_ipsout { -- compatible = "regulator-fixed"; -- regulator-name = "axp-ipsout"; -- regulator-min-microvolt = <5000000>; -- regulator-max-microvolt = <5000000>; -- regulator-always-on; -- }; - }; - - &ahci { -@@ -94,6 +88,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &gmac { - pinctrl-names = "default"; - pinctrl-0 = <&gmac_pins_rgmii_a>; -@@ -118,10 +116,58 @@ - }; - }; - --&i2c1 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c1_pins_a>; -+&lradc { -+ vref-supply = <®_vcc3v0>; - status = "okay"; -+ -+ button@190 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <190000>; -+ }; -+ -+ button@390 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <390000>; -+ }; -+ -+ button@600 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; -+ -+ button@800 { -+ label = "Search"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@980 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <980000>; -+ }; -+ -+ button@1180 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1180000>; -+ }; -+ -+ button@1400 { -+ label = "Enter"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1400000>; -+ }; - }; - - &mmc0 { -@@ -134,6 +180,16 @@ - status = "okay"; - }; - -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -161,15 +217,22 @@ - allwinner,pull = ; - }; - -+ mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { -- allwinner,pins = "PH04"; -+ allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; - }; - - usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -- allwinner,pins = "PH05"; -+ allwinner,pins = "PH5"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; -@@ -187,7 +250,7 @@ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1425000>; -+ regulator-max-microvolt = <1400000>; - regulator-name = "vdd-cpu"; - }; - -@@ -235,8 +298,8 @@ - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -- usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */ -- usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */ -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */ - usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -@@ -117,6 +117,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -@@ -170,6 +170,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &mmc0 { -@@ -190,6 +196,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 { - allwinner,pins = "PC3"; -@@ -204,6 +214,27 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_pin_lime2: usb0_vbus_pin@0 { -+ allwinner,pins = "PC17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -212,6 +243,12 @@ - status = "okay"; - }; - -+®_usb0_vbus { -+ pinctrl-0 = <&usb0_vbus_pin_lime2>; -+ gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -226,7 +263,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -@@ -125,6 +125,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &i2c2 { ---- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts -@@ -95,6 +95,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -156,7 +160,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -225,6 +240,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -243,7 +262,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-orangepi.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi.dts -@@ -141,7 +141,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -203,6 +214,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -221,7 +236,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -@@ -82,6 +82,14 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -108,13 +116,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -142,6 +146,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 { - allwinner,pins = "PH2"; -@@ -157,8 +165,15 @@ - allwinner,pull = ; - }; - -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 { -- allwinner,pins = "PH11"; -+ allwinner,pins = "PD2"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; -@@ -171,13 +186,37 @@ - status = "okay"; - }; - --®_usb1_vbus { -- pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -- gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - --®_usb2_vbus { -+/* A single regulator (U24) powers both USB host ports. */ -+®_usb1_vbus { -+ pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */ - status = "okay"; - }; - -@@ -187,8 +226,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ usb2_vbus-supply = <®_usb1_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun7i-a20-pcduino3.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3.dts -@@ -111,6 +111,14 @@ - allwinner,pins = "PH2"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -137,16 +145,14 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &ir0 { - pinctrl-names = "default"; - pinctrl-0 = <&ir0_rx_pins_a>; -@@ -171,6 +177,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino3: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -185,6 +195,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -192,6 +209,31 @@ - status = "okay"; - }; - -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -206,7 +248,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -+++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - / { - model = "Wexler TAB7200"; -@@ -57,11 +58,28 @@ - serial0 = &uart0; - }; - -+ backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_enable_pin>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,6 +104,8 @@ - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -96,6 +116,18 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ gt911: touchscreen@5d { -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ts_reset_pin>; -+ irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */ -+ reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */ -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -135,7 +167,45 @@ - status = "okay"; - }; - --#include "axp209.dtsi" -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ bl_enable_pin: bl_enable_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ ts_reset_pin: ts_reset_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; - - ®_dcdc2 { - regulator-always-on; -@@ -162,6 +232,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -176,7 +250,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -+++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -@@ -1,13 +1,52 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2015 Jelle de Jong - * -- * Minimal dts file for the Wits Pro A20 DKT for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { - model = "Wits Pro A20 DKT"; -@@ -20,6 +59,17 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ mmc3_pwrseq: mmc3_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>; -+ reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */ -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -42,6 +92,60 @@ - }; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ mmc-pwrseq = <&mmc3_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ brcmf: bcrmf@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ interrupt-parent = <&pio>; -+ interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */ -+ interrupt-names = "host-wake"; -+ }; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -50,8 +154,85 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 { -+ allwinner,pins = "PH9"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1450000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20.dtsi -+++ b/arch/arm/dts/sun7i-a20.dtsi -@@ -47,6 +47,7 @@ - #include - #include - -+#include - #include - #include - -@@ -67,7 +68,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -75,7 +76,8 @@ - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; -+ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -84,7 +86,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -107,7 +109,7 @@ - 720000 1200000 - 528000 1100000 - 312000 1000000 -- 144000 900000 -+ 144000 1000000 - >; - #cooling-cells = <2>; - cooling-min-level = <0>; -@@ -199,6 +201,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun7i-a20-pll4-clk"; -@@ -267,6 +278,19 @@ - compatible = "allwinner,sun7i-a20-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, <8>, -+ <9>, <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, <21>, -+ <22>, <23>, <25>, -+ <28>, <32>, <33>, <34>, -+ <35>, <36>, <37>, <40>, -+ <41>, <42>, <43>, -+ <44>, <45>, <46>, -+ <47>, <49>, <50>, -+ <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", - "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", - "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0", -@@ -295,6 +319,10 @@ - compatible = "allwinner,sun7i-a20-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <8>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", - "apb0_ac97", "apb0_iis0", "apb0_iis1", - "apb0_pio", "apb0_ir0", "apb0_ir1", -@@ -314,6 +342,12 @@ - compatible = "allwinner,sun7i-a20-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <15>, <16>, <17>, -+ <18>, <19>, <20>, -+ <21>, <22>, <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_can", - "apb1_scr", "apb1_ps20", "apb1_ps21", -@@ -442,6 +476,14 @@ - clock-output-names = "ir1"; - }; - -+ keypad_clk: clk@01c200c4 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c200c4 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "keypad"; -+ }; -+ - usb_clk: clk@01c200cc { - #clock-cells = <1>; - #reset-cells = <1>; -@@ -460,6 +502,48 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -744,6 +828,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -1159,6 +1251,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun7i-a20-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun7i-a20-sid"; - reg = <0x01c23800 0x200>; ---- a/arch/arm/dts/sun8i-a23-a33.dtsi -+++ b/arch/arm/dts/sun8i-a23-a33.dtsi -@@ -56,7 +56,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_lcd: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -175,27 +175,13 @@ - clock-output-names = "apb1"; - }; - -- ahb1_gates: clk@01c20060 { -- #clock-cells = <1>; -- compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -- reg = <0x01c20060 0x8>; -- clocks = <&ahb1>; -- clock-output-names = "ahb1_mipidsi", "ahb1_dma", -- "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -- "ahb1_nand", "ahb1_sdram", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -- "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -- "ahb1_csi", "ahb1_be", "ahb1_fe", -- "ahb1_gpu", "ahb1_spinlock", -- "ahb1_drc"; -- }; -- - apb1_gates: clk@01c20068 { - #clock-cells = <1>; - compatible = "allwinner,sun8i-a23-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <5>, -+ <12>, <13>; - clock-output-names = "apb1_codec", "apb1_pio", - "apb1_daudio0", "apb1_daudio1"; - }; -@@ -213,6 +199,10 @@ - compatible = "allwinner,sun8i-a23-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <16>, -+ <17>, <18>, -+ <19>, <20>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_uart0", - "apb2_uart1", "apb2_uart2", -@@ -391,12 +381,19 @@ - allwinner,pins = "PC5", "PC6", "PC8", - "PC9", "PC10", "PC11", - "PC12", "PC13", "PC14", -- "PC15"; -+ "PC15", "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; - }; - -+ pwm0_pins: pwm0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "pwm0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - i2c0_pins_a: i2c0@0 { - allwinner,pins = "PH2", "PH3"; - allwinner,function = "i2c0"; -@@ -451,6 +448,14 @@ - interrupts = ; - }; - -+ pwm: pwm@01c21400 { -+ compatible = "allwinner,sun7i-a20-pwm"; -+ reg = <0x01c21400 0xc>; -+ clocks = <&osc24M>; -+ #pwm-cells = <3>; -+ status = "disabled"; -+ }; -+ - lradc: lradc@01c22800 { - compatible = "allwinner,sun4i-a10-lradc-keys"; - reg = <0x01c22800 0x100>; -@@ -574,6 +579,14 @@ - ; - }; - -+ nmi_intc: interrupt-controller@01f00c0c { -+ compatible = "allwinner,sun6i-a31-sc-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x01f00c0c 0x38>; -+ interrupts = ; -+ }; -+ - prcm@01f01400 { - compatible = "allwinner,sun8i-a23-prcm"; - reg = <0x01f01400 0x200>; -@@ -642,10 +655,18 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -+ #interrupt-cells = <3>; - #address-cells = <1>; - #size-cells = <0>; - #gpio-cells = <3>; - -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PL0", "PL1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - r_uart_pins_a: r_uart@0 { - allwinner,pins = "PL2", "PL3"; - allwinner,function = "s_uart"; -@@ -653,5 +674,19 @@ - allwinner,pull = ; - }; - }; -+ -+ r_rsb: rsb@01f03400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x01f03400 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apb0_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts -+++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts -@@ -47,15 +47,26 @@ - #include - #include - #include -+#include - - / { -- model = "Allwinner GT90H Quad Core Tablet (v4)"; -- compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33"; -+ model = "Allwinner GT90H Dual Core Tablet (v4)"; -+ compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23"; - - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_gt90h>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -106,8 +117,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>; -- /* FIXME this really is aldo1, correct once we've pmic support */ -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_aldo1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -115,6 +125,13 @@ - }; - - &pio { -+ bl_en_pin_gt90h: bl_en_pin@0 { -+ allwinner,pins = "PH6"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_gt90h: mmc0_cd_pin@0 { - allwinner,pins = "PB4"; - allwinner,function = "gpio_in"; -@@ -123,12 +140,106 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; -+ - /* - * FIXME for now we only support host mode and rely on u-boot to have - * turned on Vbus which is controlled by the axp223 pmic on the board. -@@ -141,5 +252,6 @@ - }; - - &usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- a/arch/arm/dts/sun8i-a23.dtsi -+++ b/arch/arm/dts/sun8i-a23.dtsi -@@ -50,6 +50,31 @@ - }; - - clocks { -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <6>, -+ <8>, <9>, <10>, -+ <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_dma", -+ "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -+ "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; ---- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -+++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -@@ -68,7 +68,7 @@ - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_dcdc1>; - status = "okay"; - - button@200 { -@@ -96,7 +96,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -106,13 +106,16 @@ - &mmc2 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_8bit_pins>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - - &mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; - /* eMMC is missing pull-ups */ - allwinner,pull = ; - }; -@@ -130,6 +133,80 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_b>; ---- a/arch/arm/dts/sun8i-a33.dtsi -+++ b/arch/arm/dts/sun8i-a33.dtsi -@@ -72,6 +72,41 @@ - clock-output-names = "pll11"; - }; - -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a33-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>, -+ <58>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_ss", -+ "ahb1_dma","ahb1_mmc0", "ahb1_mmc1", -+ "ahb1_mmc2", "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc", -+ "ahb1_sat"; -+ }; -+ -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; -@@ -82,6 +117,16 @@ - }; - - soc@01c00000 { -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - usb_otg: usb@01c19000 { - compatible = "allwinner,sun8i-a33-musb"; - reg = <0x01c19000 0x0400>; ---- /dev/null -+++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts -@@ -0,0 +1,65 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-a83t.dtsi" -+ -+/ { -+ model = "Cubietech Cubietruck Plus"; -+ compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_b>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun8i-a83t.dtsi -+++ b/arch/arm/dts/sun8i-a83t.dtsi -@@ -52,12 +52,6 @@ - / { - interrupt-parent = <&gic>; - -- chosen { -- #address-cells = <1>; -- #size-cells = <1>; -- ranges; -- }; -- - cpus { - #address-cells = <1>; - #size-cells = <0>; -@@ -85,6 +79,7 @@ - device_type = "cpu"; - reg = <3>; - }; -+ - cpu@100 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -96,6 +91,7 @@ - device_type = "cpu"; - reg = <0x101>; - }; -+ - cpu@102 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -109,18 +105,12 @@ - }; - }; - -- memory { -- reg = <0x40000000 0x80000000>; -- }; -- - timer { - compatible = "arm,armv7-timer"; -- interrupts = , -- , -- , -- ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -+ interrupts = , -+ , -+ , -+ ; - }; - - clocks { -@@ -128,6 +118,7 @@ - #size-cells = <1>; - ranges; - -+ /* TODO: PRCM block has a mux for this. */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,36 +126,39 @@ - clock-output-names = "osc24M"; - }; - -- osc32k: osc32k_clk { -+ /* -+ * This is called "internal OSC" in some places. -+ * It is an internal RC-based oscillator. -+ * TODO: Its controls are in the PRCM block. -+ */ -+ osc16M: osc16M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -- clock-frequency = <32768>; -- clock-output-names = "osc32k"; -+ clock-frequency = <16000000>; -+ clock-output-names = "osc16M"; -+ }; -+ -+ osc16Md512: osc16Md512_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <512>; -+ clock-mult = <1>; -+ clocks = <&osc16M>; -+ clock-output-names = "osc16M-d512"; - }; - }; - -- soc@01c00000 { -+ soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - -- gic: interrupt-controller@01c81000 { -- compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -- reg = <0x01c81000 0x1000>, -- <0x01c82000 0x1000>, -- <0x01c84000 0x2000>, -- <0x01c86000 0x2000>; -- interrupt-controller; -- #interrupt-cells = <3>; -- interrupts = ; -- }; -- - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-a83t-pinctrl"; - interrupts = , -- , -- ; -+ , -+ ; - reg = <0x01c20800 0x400>; - clocks = <&osc24M>; - gpio-controller; -@@ -172,27 +166,6 @@ - #interrupt-cells = <3>; - #gpio-cells = <3>; - -- i2c0_pins_a: i2c0@0 { -- allwinner,pins = "PH0", "PH1"; -- allwinner,function = "i2c0"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c1_pins_a: i2c1@0 { -- allwinner,pins = "PH2", "PH3"; -- allwinner,function = "i2c1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c2_pins_a: i2c2@0 { -- allwinner,pins = "PH4", "PH5"; -- allwinner,function = "i2c2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - mmc0_pins_a: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", - "PF3", "PF4", "PF5"; -@@ -201,24 +174,6 @@ - allwinner,pull = ; - }; - -- mmc1_pins_a: mmc1@0 { -- allwinner,pins = "PG0", "PG1", "PG2", -- "PG3", "PG4", "PG5"; -- allwinner,function = "mmc1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- mmc2_8bit_pins: mmc2_8bit { -- allwinner,pins = "PC5", "PC6", "PC8", -- "PC9", "PC10", "PC11", -- "PC12", "PC13", "PC14", -- "PC15"; -- allwinner,function = "mmc2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - uart0_pins_a: uart0@0 { - allwinner,pins = "PF2", "PF4"; - allwinner,function = "uart0"; -@@ -234,6 +189,21 @@ - }; - }; - -+ timer@01c20c00 { -+ compatible = "allwinner,sun4i-a10-timer"; -+ reg = <0x01c20c00 0xa0>; -+ interrupts = , -+ ; -+ clocks = <&osc24M>; -+ }; -+ -+ watchdog@01c20ca0 { -+ compatible = "allwinner,sun6i-a31-wdt"; -+ reg = <0x01c20ca0 0x20>; -+ interrupts = ; -+ clocks = <&osc24M>; -+ }; -+ - uart0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; -@@ -243,5 +213,16 @@ - clocks = <&osc24M>; - status = "disabled"; - }; -+ -+ gic: interrupt-controller@01c81000 { -+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x1000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ interrupts = ; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -58,6 +59,43 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; - }; - - &ehci1 { -@@ -72,6 +110,12 @@ - status = "okay"; - }; - -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -@@ -94,6 +138,31 @@ - status = "okay"; - }; - -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; ---- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -70,6 +71,68 @@ - enable-active-high; - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - &ehci1 { ---- a/arch/arm/dts/sun8i-h3.dtsi -+++ b/arch/arm/dts/sun8i-h3.dtsi -@@ -83,12 +83,6 @@ - , - , - ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -- }; -- -- memory { -- reg = <0x40000000 0x80000000>; - }; - - clocks { -@@ -131,15 +125,24 @@ - compatible = "allwinner,sun6i-a31-pll6-clk"; - reg = <0x01c20028 0x4>; - clocks = <&osc24M>; -- clock-output-names = "pll6", "pll6x2", "pll6d2"; -+ clock-output-names = "pll6", "pll6x2"; - }; - -- pll8: clk@01c20044 { -- #clock-cells = <1>; -- compatible = "allwinner,sun6i-a31-pll6-clk"; -- reg = <0x01c20044 0x4>; -- clocks = <&osc24M>; -- clock-output-names = "pll8", "pll8x2"; -+ pll6d2: pll6d2_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <2>; -+ clock-mult = <1>; -+ clocks = <&pll6 0>; -+ clock-output-names = "pll6d2"; -+ }; -+ -+ /* dummy clock until pll6 can be reused */ -+ pll8: pll8_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <1>; -+ clock-output-names = "pll8"; - }; - - cpu: cpu_clk@01c20050 { -@@ -170,7 +173,7 @@ - #clock-cells = <0>; - compatible = "allwinner,sun8i-h3-ahb2-clk"; - reg = <0x01c2005c 0x4>; -- clocks = <&ahb1>, <&pll6 2>; -+ clocks = <&ahb1>, <&pll6d2>; - clock-output-names = "ahb2"; - }; - -@@ -213,34 +216,34 @@ - <76>, <77>, <78>, - <96>, <97>, <98>, - <112>, <113>, -- <114>, <115>, <116>, -- <128>, <135>; -- clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0", -- "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand", -- "ahb1_sdram", "ahb2_gmac", "ahb1_ts", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", -- "ahb1_otg_ehci0", "ahb1_ehic1", -- "ahb1_ehic2", "ahb1_ehic3", -- "ahb1_otg_ohci0", "ahb2_ohic1", -- "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve", -- "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint", -- "ahb1_csi", "ahb1_tve", "ahb1_hdmi", -- "ahb1_de", "ahb1_gpu", "ahb1_msgbox", -- "ahb1_spinlock", "apb1_codec", -- "apb1_spdif", "apb1_pio", "apb1_ths", -- "apb1_i2s0", "apb1_i2s1", "apb1_i2s2", -- "apb2_i2c0", "apb2_i2c1", "apb2_i2c2", -- "apb2_uart0", "apb2_uart1", -- "apb2_uart2", "apb2_uart3", "apb2_scr", -- "ahb1_ephy", "ahb1_dbg"; -+ <114>, <115>, -+ <116>, <128>, <135>; -+ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", -+ "bus_mmc1", "bus_mmc2", "bus_nand", -+ "bus_sdram", "bus_gmac", "bus_ts", -+ "bus_hstimer", "bus_spi0", -+ "bus_spi1", "bus_otg", -+ "bus_otg_ehci0", "bus_ehci1", -+ "bus_ehci2", "bus_ehci3", -+ "bus_otg_ohci0", "bus_ohci1", -+ "bus_ohci2", "bus_ohci3", "bus_ve", -+ "bus_lcd0", "bus_lcd1", "bus_deint", -+ "bus_csi", "bus_tve", "bus_hdmi", -+ "bus_de", "bus_gpu", "bus_msgbox", -+ "bus_spinlock", "bus_codec", -+ "bus_spdif", "bus_pio", "bus_ths", -+ "bus_i2s0", "bus_i2s1", "bus_i2s2", -+ "bus_i2c0", "bus_i2c1", "bus_i2c2", -+ "bus_uart0", "bus_uart1", -+ "bus_uart2", "bus_uart3", -+ "bus_scr", "bus_ephy", "bus_dbg"; - }; - - mmc0_clk: clk@01c20088 { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20088 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc0", - "mmc0_output", - "mmc0_sample"; -@@ -250,7 +253,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c2008c 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc1", - "mmc1_output", - "mmc1_sample"; -@@ -260,7 +263,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20090 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc2", - "mmc2_output", - "mmc2_sample"; -@@ -285,6 +288,33 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5>; - clock-output-names = "mbus"; - }; -+ -+ apb0: apb0_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&osc24M>; -+ clock-output-names = "apb0"; -+ }; -+ -+ apb0_gates: clk@01f01428 { -+ compatible = "allwinner,sun8i-h3-apb0-gates-clk", -+ "allwinner,sun4i-a10-gates-clk"; -+ reg = <0x01f01428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apb0>; -+ clock-indices = <0>, <1>; -+ clock-output-names = "apb0_pio", "apb0_ir"; -+ }; -+ -+ ir_clk: ir_clk@01f01454 { -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01f01454 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "ir"; -+ }; - }; - - soc { -@@ -298,7 +328,7 @@ - reg = <0x01c02000 0x1000>; - interrupts = ; - clocks = <&bus_gates 6>; -- resets = <&bus_rst 6>; -+ resets = <&ahb_rst 6>; - #dma-cells = <1>; - }; - -@@ -313,7 +343,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 8>; -+ resets = <&ahb_rst 8>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -332,7 +362,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 9>; -+ resets = <&ahb_rst 9>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -351,7 +381,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 10>; -+ resets = <&ahb_rst 10>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -396,7 +426,7 @@ - reg = <0x01c1b000 0x100>; - interrupts = ; - clocks = <&bus_gates 25>, <&bus_gates 29>; -- resets = <&bus_rst 25>, <&bus_rst 29>; -+ resets = <&ahb_rst 25>, <&ahb_rst 29>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -408,7 +438,7 @@ - interrupts = ; - clocks = <&bus_gates 29>, <&bus_gates 25>, - <&usb_clk 17>; -- resets = <&bus_rst 29>, <&bus_rst 25>; -+ resets = <&ahb_rst 29>, <&ahb_rst 25>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -419,7 +449,7 @@ - reg = <0x01c1c000 0x100>; - interrupts = ; - clocks = <&bus_gates 26>, <&bus_gates 30>; -- resets = <&bus_rst 26>, <&bus_rst 30>; -+ resets = <&ahb_rst 26>, <&ahb_rst 30>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -431,7 +461,7 @@ - interrupts = ; - clocks = <&bus_gates 30>, <&bus_gates 26>, - <&usb_clk 18>; -- resets = <&bus_rst 30>, <&bus_rst 26>; -+ resets = <&ahb_rst 30>, <&ahb_rst 26>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -442,7 +472,7 @@ - reg = <0x01c1d000 0x100>; - interrupts = ; - clocks = <&bus_gates 27>, <&bus_gates 31>; -- resets = <&bus_rst 27>, <&bus_rst 31>; -+ resets = <&ahb_rst 27>, <&ahb_rst 31>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -454,7 +484,7 @@ - interrupts = ; - clocks = <&bus_gates 31>, <&bus_gates 27>, - <&usb_clk 19>; -- resets = <&bus_rst 31>, <&bus_rst 27>; -+ resets = <&ahb_rst 31>, <&ahb_rst 27>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -469,7 +499,7 @@ - gpio-controller; - #gpio-cells = <3>; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - - uart0_pins_a: uart0@0 { - allwinner,pins = "PA4", "PA5"; -@@ -502,10 +532,22 @@ - }; - }; - -- bus_rst: reset@01c202c0 { -+ ahb_rst: reset@01c202c0 { - #reset-cells = <1>; -- compatible = "allwinner,sun8i-h3-bus-reset"; -- reg = <0x01c202c0 0x1c>; -+ compatible = "allwinner,sun6i-a31-ahb1-reset"; -+ reg = <0x01c202c0 0xc>; -+ }; -+ -+ apb1_rst: reset@01c202d0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d0 0x4>; -+ }; -+ -+ apb2_rst: reset@01c202d8 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d8 0x4>; - }; - - timer@01c20c00 { -@@ -529,7 +571,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 112>; -- resets = <&bus_rst 144>; -+ resets = <&apb2_rst 16>; - dmas = <&dma 6>, <&dma 6>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -542,7 +584,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 113>; -- resets = <&bus_rst 145>; -+ resets = <&apb2_rst 17>; - dmas = <&dma 7>, <&dma 7>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -555,7 +597,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 114>; -- resets = <&bus_rst 146>; -+ resets = <&apb2_rst 18>; - dmas = <&dma 8>, <&dma 8>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -568,7 +610,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 115>; -- resets = <&bus_rst 147>; -+ resets = <&apb2_rst 19>; - dmas = <&dma 9>, <&dma 9>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -591,5 +633,40 @@ - interrupts = , - ; - }; -+ -+ apb0_reset: reset@01f014b0 { -+ reg = <0x01f014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ ir: ir@01f02000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ clocks = <&apb0_gates 1>, <&ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apb0_reset 1>; -+ interrupts = ; -+ reg = <0x01f02000 0x40>; -+ status = "disabled"; -+ }; -+ -+ r_pio: pinctrl@01f02c00 { -+ compatible = "allwinner,sun8i-h3-r-pinctrl"; -+ reg = <0x01f02c00 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>; -+ resets = <&apb0_reset 0>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ -+ ir_pins_a: ir@0 { -+ allwinner,pins = "PL11"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-q8-common.dtsi -+++ b/arch/arm/dts/sun8i-q8-common.dtsi -@@ -41,11 +41,23 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_q8>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -54,7 +66,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -77,8 +89,90 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; ---- a/arch/arm/dts/sun9i-a80-cubieboard4.dts -+++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts -@@ -62,9 +62,31 @@ - stdout-path = "serial0:115200n8"; - }; - -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_cubieboard4>; -+ -+ green { -+ label = "cubieboard4:green:usr"; -+ gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */ -+ }; -+ -+ red { -+ label = "cubieboard4:red:usr"; -+ gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ }; - }; - - &pio { -+ led_pins_cubieboard4: led-pins@0 { -+ allwinner,pins = "PH6", "PH17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 { - allwinner,pins = "PH18"; - allwinner,function = "gpio_in"; -@@ -89,6 +111,20 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ -+&r_ir { -+ status = "okay"; -+}; -+ -+&r_rsb { - status = "okay"; - }; - ---- a/arch/arm/dts/sun9i-a80-optimus.dts -+++ b/arch/arm/dts/sun9i-a80-optimus.dts -@@ -65,7 +65,7 @@ - leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; -- pinctrl-0 = <&led_pins_optimus>; -+ pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>; - - /* The LED names match those found on the board */ - -@@ -74,7 +74,10 @@ - gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; - }; - -- /* led3 is on PM15, in R_PIO */ -+ led3 { -+ label = "optimus:led3:usr"; -+ gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */ -+ }; - - led4 { - label = "optimus:led4:usr"; -@@ -106,17 +109,6 @@ - status = "okay"; - }; - --&i2c3 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c3_pins_a>; -- status = "okay"; --}; -- --&i2c3_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; --}; -- - &ohci0 { - status = "okay"; - }; -@@ -171,30 +163,42 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_optimus>; - gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - status = "okay"; - }; - --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+&r_ir { - status = "okay"; - }; - --&uart4 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart4_pins_a>; -+&r_pio { -+ led_r_pins_optimus: led-pins@1 { -+ allwinner,pins = "PM15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_rsb { - status = "okay"; - }; - --&uart4_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; - }; - - &usbphy1 { ---- a/arch/arm/dts/sun9i-a80.dtsi -+++ b/arch/arm/dts/sun9i-a80.dtsi -@@ -128,6 +128,17 @@ - */ - ranges = <0 0 0 0x20000000>; - -+ /* -+ * This clock is actually configurable from the PRCM address -+ * space. The external 24M oscillator can be turned off, and -+ * the clock switched to an internal 16M RC oscillator. Under -+ * normal operation there's no reason to do this, and the -+ * default is to use the external good one, so just model this -+ * as a fixed clock. Also it is not entirely clear if the -+ * osc24M mux in the PRCM affects the entire clock tree, which -+ * would also throw all the PLL clock rates off, or just the -+ * downstream clocks in the PRCM. -+ */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,6 +146,13 @@ - clock-output-names = "osc24M"; - }; - -+ /* -+ * The 32k clock is from an external source, normally the -+ * AC100 codec/RTC chip. This clock is by default enabled -+ * and clocked at 32768 Hz, from the oscillator connected -+ * to the AC100. It is configurable, but no such driver or -+ * bindings exist yet. -+ */ - osc32k: osc32k_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -164,6 +182,14 @@ - "usb_phy2", "usb_hsic_12M"; - }; - -+ pll3: clk@06000008 { -+ /* placeholder until implemented */ -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-rate = <0>; -+ clock-output-names = "pll3"; -+ }; -+ - pll4: clk@0600000c { - #clock-cells = <0>; - compatible = "allwinner,sun9i-a80-pll4-clk"; -@@ -277,9 +303,12 @@ - compatible = "allwinner,sun9i-a80-ahb0-gates-clk"; - reg = <0x06000580 0x4>; - clocks = <&ahb0>; -- clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>, -- <14>, <15>, <16>, <18>, <20>, <21>, -- <22>, <23>; -+ clock-indices = <0>, <1>, <3>, -+ <5>, <8>, <12>, -+ <13>, <14>, -+ <15>, <16>, <18>, -+ <20>, <21>, <22>, -+ <23>; - clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu", - "ahb0_ss", "ahb0_sd", "ahb0_nand1", - "ahb0_nand0", "ahb0_sdram", -@@ -293,7 +322,10 @@ - compatible = "allwinner,sun9i-a80-ahb1-gates-clk"; - reg = <0x06000584 0x4>; - clocks = <&ahb1>; -- clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>; -+ clock-indices = <0>, <1>, -+ <17>, <21>, -+ <22>, <23>, -+ <24>; - clock-output-names = "ahb1_usbotg", "ahb1_usbhci", - "ahb1_gmac", "ahb1_msgbox", - "ahb1_spinlock", "ahb1_hstimer", -@@ -305,8 +337,9 @@ - compatible = "allwinner,sun9i-a80-ahb2-gates-clk"; - reg = <0x06000588 0x4>; - clocks = <&ahb2>; -- clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>, -- <11>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, <5>, -+ <7>, <8>, <11>; - clock-output-names = "ahb2_lcd0", "ahb2_lcd1", - "ahb2_edp", "ahb2_csi", "ahb2_hdmi", - "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi"; -@@ -317,8 +350,10 @@ - compatible = "allwinner,sun9i-a80-apb0-gates-clk"; - reg = <0x06000590 0x4>; - clocks = <&apb0>; -- clock-indices = <1>, <5>, <11>, <12>, <13>, <15>, -- <17>, <18>, <19>; -+ clock-indices = <1>, <5>, -+ <11>, <12>, <13>, -+ <15>, <17>, <18>, -+ <19>; - clock-output-names = "apb0_spdif", "apb0_pio", - "apb0_ac97", "apb0_i2s0", "apb0_i2s1", - "apb0_lradc", "apb0_gpadc", "apb0_twd", -@@ -330,14 +365,79 @@ - compatible = "allwinner,sun9i-a80-apb1-gates-clk"; - reg = <0x06000594 0x4>; - clocks = <&apb1>; -- clock-indices = <0>, <1>, <2>, <3>, <4>, -- <16>, <17>, <18>, <19>, <20>, <21>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <16>, <17>, -+ <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_i2c4", - "apb1_uart0", "apb1_uart1", - "apb1_uart2", "apb1_uart3", - "apb1_uart4", "apb1_uart5"; - }; -+ -+ cpus_clk: clk@08001410 { -+ compatible = "allwinner,sun9i-a80-cpus-clk"; -+ reg = <0x08001410 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>; -+ clock-output-names = "cpus"; -+ }; -+ -+ ahbs: ahbs_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&cpus_clk>; -+ clock-output-names = "ahbs"; -+ }; -+ -+ apbs: clk@0800141c { -+ compatible = "allwinner,sun8i-a23-apb0-clk"; -+ reg = <0x0800141c 0x4>; -+ #clock-cells = <0>; -+ clocks = <&ahbs>; -+ clock-output-names = "apbs"; -+ }; -+ -+ apbs_gates: clk@08001428 { -+ compatible = "allwinner,sun9i-a80-apbs-gates-clk"; -+ reg = <0x08001428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apbs>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, -+ <6>, <7>, -+ <12>, <13>, -+ <16>, <17>, -+ <18>, <20>; -+ clock-output-names = "apbs_pio", "apbs_ir", -+ "apbs_timer", "apbs_rsb", -+ "apbs_uart", "apbs_1wire", -+ "apbs_i2c0", "apbs_i2c1", -+ "apbs_ps2_0", "apbs_ps2_1", -+ "apbs_dma", "apbs_i2s0", -+ "apbs_i2s1", "apbs_twd"; -+ }; -+ -+ r_1wire_clk: clk@08001450 { -+ reg = <0x08001450 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_1wire"; -+ }; -+ -+ r_ir_clk: clk@08001454 { -+ reg = <0x08001454 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_ir"; -+ }; - }; - - soc { -@@ -443,7 +543,7 @@ - }; - - mmc0: mmc@01c0f000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c0f000 0x1000>; - clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>, - <&mmc0_clk 1>, <&mmc0_clk 2>; -@@ -457,7 +557,7 @@ - }; - - mmc1: mmc@01c10000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c10000 0x1000>; - clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>, - <&mmc1_clk 1>, <&mmc1_clk 2>; -@@ -471,7 +571,7 @@ - }; - - mmc2: mmc@01c11000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c11000 0x1000>; - clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>, - <&mmc2_clk 1>, <&mmc2_clk 2>; -@@ -485,7 +585,7 @@ - }; - - mmc3: mmc@01c12000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c12000 0x1000>; - clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>, - <&mmc3_clk 1>, <&mmc3_clk 2>; -@@ -582,7 +682,7 @@ - clocks = <&apb0_gates 5>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - -@@ -604,7 +704,8 @@ - mmc2_8bit_pins: mmc2_8bit { - allwinner,pins = "PC6", "PC7", "PC8", "PC9", - "PC10", "PC11", "PC12", -- "PC13", "PC14", "PC15"; -+ "PC13", "PC14", "PC15", -+ "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; -@@ -752,14 +853,83 @@ - interrupts = ; - }; - -+ apbs_rst: reset@080014b0 { -+ reg = <0x080014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ nmi_intc: interrupt-controller@080015a0 { -+ compatible = "allwinner,sun9i-a80-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x080015a0 0xc>; -+ interrupts = ; -+ }; -+ -+ r_ir: ir@08002000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_ir_pins>; -+ clocks = <&apbs_gates 1>, <&r_ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apbs_rst 1>; -+ reg = <0x08002000 0x40>; -+ status = "disabled"; -+ }; -+ - r_uart: serial@08002800 { - compatible = "snps,dw-apb-uart"; - reg = <0x08002800 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&osc24M>; -+ clocks = <&apbs_gates 4>; -+ resets = <&apbs_rst 4>; - status = "disabled"; - }; -+ -+ r_pio: pinctrl@08002c00 { -+ compatible = "allwinner,sun9i-a80-r-pinctrl"; -+ reg = <0x08002c00 0x400>; -+ interrupts = , -+ ; -+ clocks = <&apbs_gates 0>; -+ resets = <&apbs_rst 0>; -+ gpio-controller; -+ interrupt-controller; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ #gpio-cells = <3>; -+ -+ r_ir_pins: r_ir { -+ allwinner,pins = "PL6"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PN0", "PN1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; -+ -+ r_rsb: i2c@08003400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x08003400 0x400>; -+ interrupts = ; -+ clocks = <&apbs_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apbs_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- /dev/null -+++ b/arch/arm/dts/sunxi-itead-core-common.dtsi -@@ -0,0 +1,136 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "sunxi-common-regulators.dtsi" -+ -+/ { -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sunxi-q8-common.dtsi -+++ b/arch/arm/dts/sunxi-q8-common.dtsi -@@ -75,3 +75,9 @@ - voltage = <400000>; - }; - }; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; diff --git a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch deleted file mode 100644 index 45416703a..000000000 --- a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 20:44:51 +0100 -Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i - -The clock_sun6i.c implementation was not deasserting the reset for -the regular i2c controllers, this commit fixes this. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) - return 0; - } - -- /* set the apb clock gate for twi */ -- if (state) -+ /* set the apb clock gate and reset for twi */ -+ if (state) { - setbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -- else -+ setbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); -+ } else { -+ clrbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); - clrbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -+ } - - return 0; - } diff --git a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch b/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch deleted file mode 100644 index 47f825c57..000000000 --- a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1eae8f66ff749409eb96e2f3f3387c56232d0b8a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:46:22 +0100 -Subject: [PATCH] sunxi: Enable realtek phy support - -Enable building of drivers/net/phy/realtek.c so that realtek phys -get properly initialized. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -314,6 +314,7 @@ extern int soft_i2c_gpio_scl; - #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ - #define CONFIG_PHY_ADDR 1 - #define CONFIG_MII /* MII PHY management */ -+#define CONFIG_PHY_REALTEK - #endif - - #ifdef CONFIG_USB_EHCI_HCD diff --git a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch b/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch deleted file mode 100644 index cf511ce77..000000000 --- a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch +++ /dev/null @@ -1,127 +0,0 @@ -From fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 17 Mar 2016 13:53:03 +0100 -Subject: [PATCH] sunxi: Fix gmac not working due to cpu_eth_init no longer - being called - -cpu_eth_init is no longer called for dm enabled eth drivers, this -was causing the sunxi gmac eth controller to no longer work in u-boot. - -This commit fixes this by calling the clock, reset and pinmux setup -function from s_init() and enabling the phy power pin (if any) from -board_init(). - -The enabling of phy power cannot be done from s_init because it uses dm -and dm is not ready yet at this point. - -Note that the mdelay is dropped as the phy gets enabled much earlier -now, so it is no longer needed. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell -Tested-by: Karsten Merker -Tested-by: Michael Haas ---- - arch/arm/cpu/armv7/sunxi/board.c | 28 +--------------------------- - arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 +++++- - board/sunxi/board.c | 5 +++++ - board/sunxi/gmac.c | 14 +------------- - 4 files changed, 12 insertions(+), 41 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -136,6 +136,7 @@ void s_init(void) - timer_init(); - gpio_init(); - i2c_init_board(); -+ eth_init_board(); - } - - #ifdef CONFIG_SPL_BUILD -@@ -243,30 +244,3 @@ void enable_caches(void) - dcache_enable(); - } - #endif -- --#ifdef CONFIG_CMD_NET --/* -- * Initializes on-chip ethernet controllers. -- * to override, implement board_eth_init() -- */ --int cpu_eth_init(bd_t *bis) --{ -- __maybe_unused int rc; -- --#ifdef CONFIG_MACPWR -- gpio_request(CONFIG_MACPWR, "macpwr"); -- gpio_direction_output(CONFIG_MACPWR, 1); -- mdelay(200); --#endif -- --#ifdef CONFIG_SUNXI_GMAC -- rc = sunxi_gmac_initialize(bis); -- if (rc < 0) { -- printf("sunxi: failed to initialize gmac\n"); -- return rc; -- } --#endif -- -- return 0; --} --#endif ---- a/arch/arm/include/asm/arch-sunxi/sys_proto.h -+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h -@@ -24,6 +24,10 @@ void sdelay(unsigned long); - void return_to_fel(uint32_t lr, uint32_t sp); - - /* Board / SoC level designware gmac init */ --int sunxi_gmac_initialize(bd_t *bis); -+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC -+void eth_init_board(void); -+#else -+static inline void eth_init_board(void) {} -+#endif - - #endif ---- a/board/sunxi/board.c -+++ b/board/sunxi/board.c -@@ -90,6 +90,11 @@ int board_init(void) - if (ret) - return ret; - -+#ifdef CONFIG_MACPWR -+ gpio_request(CONFIG_MACPWR, "macpwr"); -+ gpio_direction_output(CONFIG_MACPWR, 1); -+#endif -+ - /* Uses dm gpio code so do this here and not in i2c_init_board() */ - return soft_i2c_board_init(); - } ---- a/board/sunxi/gmac.c -+++ b/board/sunxi/gmac.c -@@ -6,7 +6,7 @@ - #include - #include - --int sunxi_gmac_initialize(bd_t *bis) -+void eth_init_board(void) - { - int pin; - struct sunxi_ccm_reg *const ccm = -@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis) - for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++) - sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC); - #endif -- --#ifdef CONFIG_DM_ETH -- return 0; --#else --# ifdef CONFIG_RGMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); --# elif defined CONFIG_GMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII); --# else -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII); --# endif --#endif - } diff --git a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch b/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch deleted file mode 100644 index 95a77c68d..000000000 --- a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 948603d4d637a0e04a3214253b911cfc4ed11220 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 21 Mar 2016 14:44:35 +0100 -Subject: [PATCH] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer - working - -The 2nd usb controller on sun4i/sun7i has its base address 0x8000 -bytes from the 1st one, rather then 0x1000. Also the ahb clk gates -are interleaved with the ohci clk-gates introducing a hole between -the clks for usb1 and usb2. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - drivers/usb/host/ehci-sunxi.c | 13 +++++++++++-- - drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++--- - 2 files changed, 23 insertions(+), 5 deletions(-) - ---- a/drivers/usb/host/ehci-sunxi.c -+++ b/drivers/usb/host/ehci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ehci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ehci_sunxi_priv { - struct ehci_ctrl ehci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice - #ifdef CONFIG_MACH_SUN8I_H3 - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0; - #endif -- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - #ifdef CONFIG_SUNXI_GEN_SUN6I ---- a/drivers/usb/host/ohci-sunxi.c -+++ b/drivers/usb/host/ohci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ohci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ohci_sunxi_priv { - ohci_t ohci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0; - #endif - priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK; -- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -- priv->usb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->usb_gate_mask <<= priv->phy_index; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask); diff --git a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch b/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch deleted file mode 100644 index 04a2af72e..000000000 --- a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8f10b5c65611e6c15a113bf63289b6696452f90d Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 20 Mar 2016 14:17:10 +0100 -Subject: [PATCH] spl: Print from which mmc slot spl is trying to boot - -On some sunxi boards (and presumably also non sunxi boards) u-boot can -be either loaded from a sdcard in a micro-sd slot, or from eMMC. - -Print which MMC spl tries to boot from, to help debugging. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini ---- - common/spl/spl.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/common/spl/spl.c -+++ b/common/spl/spl.c -@@ -210,9 +210,9 @@ struct boot_device_name boot_name_table[ - { BOOT_DEVICE_RAM, "RAM" }, - #endif - #ifdef CONFIG_SPL_MMC_SUPPORT -- { BOOT_DEVICE_MMC1, "MMC" }, -- { BOOT_DEVICE_MMC2, "MMC" }, -- { BOOT_DEVICE_MMC2_2, "MMC" }, -+ { BOOT_DEVICE_MMC1, "MMC1" }, -+ { BOOT_DEVICE_MMC2, "MMC2" }, -+ { BOOT_DEVICE_MMC2_2, "MMC2_2" }, - #endif - #ifdef CONFIG_SPL_NAND_SUPPORT - { BOOT_DEVICE_NAND, "NAND" }, diff --git a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch b/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch deleted file mode 100644 index 098fe7203..000000000 --- a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 60fa63012fcdc3c4ec1497bf5e358f0a90b40949 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:42:01 +0100 -Subject: [PATCH] sunxi: Add support for USB vbus pin for USB3 - -The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 + - board/sunxi/Kconfig | 6 ++++++ - 2 files changed, 7 insertions(+) - ---- a/arch/arm/cpu/armv7/sunxi/usb_phy.c -+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c -@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index) - case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN); - case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN); - case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN); -+ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN); - } - return -EINVAL; - } ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -341,6 +341,12 @@ config USB2_VBUS_PIN - ---help--- - See USB1_VBUS_PIN help text. - -+config USB3_VBUS_PIN -+ string "Vbus enable pin for usb3 (ehci2)" -+ default "" -+ ---help--- -+ See USB1_VBUS_PIN help text. -+ - config I2C0_ENABLE - bool "Enable I2C/TWI controller 0" - default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I diff --git a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch b/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch deleted file mode 100644 index a216bc9f1..000000000 --- a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ce0d0926758f631fdd655d438acd32d5935d43a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:45:21 +0100 -Subject: [PATCH] sunxi: Specify USB vbus pins for orangepi boards - -This fixes the USB ports not working on the orangepi_plus and stops us -from messing with gpio-s which we should not touch on the orangepi_pc. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - configs/orangepi_pc_defconfig | 3 +++ - configs/orangepi_plus_defconfig | 1 + - 2 files changed, 4 insertions(+) - ---- a/configs/orangepi_pc_defconfig -+++ b/configs/orangepi_pc_defconfig -@@ -14,3 +14,6 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="" -+CONFIG_USB2_VBUS_PIN="" -+CONFIG_USB3_VBUS_PIN="" ---- a/configs/orangepi_plus_defconfig -+++ b/configs/orangepi_plus_defconfig -@@ -14,3 +14,4 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="PG13" diff --git a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch b/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch deleted file mode 100644 index e7b8cd73d..000000000 --- a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 70fe24ed93fa90eb407d18a5fc9d9ad85ac9184c Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Wed, 27 Jan 2016 16:34:43 +0800 -Subject: [PATCH] sunxi: Support SID e-fuses on A83T and H3 - -On the A83T and H3, the SID block is at a different address. -Furthurmore, the e-fuses are at an offset of 0x200 within the -hardware's address space. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Hans de Goede -Signed-off-by: Hans de Goede ---- - arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -@@ -82,7 +82,14 @@ - #define SUNXI_AD_DA_BASE 0x01c22c00 - #define SUNXI_KEYPAD_BASE 0x01c23000 - #define SUNXI_TZPC_BASE 0x01c23400 -+ -+#if defined(CONFIG_MACH_SUN8I_A83T) || defined(CONFIG_MACH_SUN8I_H3) -+/* SID address space starts at 0x01c1400, but e-fuse is at offset 0x200 */ -+#define SUNXI_SID_BASE 0x01c14200 -+#else - #define SUNXI_SID_BASE 0x01c23800 -+#endif -+ - #define SUNXI_SJTAG_BASE 0x01c23c00 - - #define SUNXI_TP_BASE 0x01c25000 diff --git a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch b/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch deleted file mode 100644 index d49fc9737..000000000 --- a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 2af25b747340c6c8f6a6b9e27632db577bf4da52 Mon Sep 17 00:00:00 2001 -From: Simon Glass -Date: Mon, 22 Feb 2016 22:55:46 -0700 -Subject: [PATCH] sunxi: Display the board model on start-up - -It is useful to know which sunxi board you are booting. Display this on -start-up to avoid confusion. - -Signed-off-by: Simon Glass ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -174,6 +174,7 @@ - - #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ - #define CONFIG_IDENT_STRING " Allwinner Technology" -+#define CONFIG_DISPLAY_BOARDINFO - - #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ - #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ diff --git a/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch new file mode 100644 index 000000000..a7bfdd62d --- /dev/null +++ b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch @@ -0,0 +1,76 @@ +From 335d30050b0d02444c9297f7a9b0cbf75dce847f Mon Sep 17 00:00:00 2001 +From: Olliver Schinagl +Date: Fri, 12 May 2017 11:38:54 +0200 +Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC + +This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash +storage. +https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ + +It is a assembly variant of the regular Lime2 but featuring eMMC for +storage. + +Signed-off-by: Olliver Schinagl +Signed-off-by: Jagan Teki +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 36 ++++++++++++++++++++++++++++++ + 2 files changed, 41 insertions(+) + create mode 100644 configs/A20-OLinuXino-Lime2-eMMC_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -88,6 +88,11 @@ M: Iain Paton + S: Maintained + F: configs/A20-OLinuXino-Lime2_defconfig + ++A20-OLINUXINO-LIME2-EMMC BOARD ++M: Olliver Schinagl ++S: Maintained ++F: configs/A20-OLinuXino-Lime2-eMMC_defconfig ++ + A33-OLINUXINO BOARD + M: Stefan Mavrodiev + S: Maintained +--- /dev/null ++++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig +@@ -0,0 +1,37 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_MACH_SUN7I=y ++CONFIG_DRAM_CLK=384 ++CONFIG_MMC0_CD_PIN="PH1" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_USB0_VBUS_PIN="PC17" ++CONFIG_USB0_VBUS_DET="PH5" ++CONFIG_I2C1_ENABLE=y ++CONFIG_SATAPWR="PC3" ++CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc" ++CONFIG_AHCI=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SPL=y ++CONFIG_SPL_I2C_SUPPORT=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_DFU=y ++CONFIG_CMD_USB_MASS_STORAGE=y ++# CONFIG_CMD_FPGA is not set ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_ISO_PARTITION is not set ++# CONFIG_SPL_PARTITION_UUIDS is not set ++CONFIG_DFU_RAM=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_RGMII=y ++CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 ++CONFIG_AXP_ALDO3_VOLT=2800 ++CONFIG_AXP_ALDO4_VOLT=2800 ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_MUSB_GADGET=y ++CONFIG_USB_GADGET=y ++CONFIG_USB_GADGET_DOWNLOAD=y ++CONFIG_G_DNL_MANUFACTURER="Allwinner Technology" ++CONFIG_G_DNL_VENDOR_NUM=0x1f3a ++CONFIG_G_DNL_PRODUCT_NUM=0x1010 diff --git a/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch new file mode 100644 index 000000000..8db3e67e5 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch @@ -0,0 +1,31 @@ +From fb7fe04da2187b9853d713cb643d01bd56813e3d Mon Sep 17 00:00:00 2001 +From: Emmanuel Vadot +Date: Fri, 12 May 2017 11:38:53 +0200 +Subject: ARM: dts: sunxi: Change node name for pwrseq pin on + Olinuxino-lime2-emmc + +The node name for the power seq pin is mmc2@0 like the mmc2_pins_a one. +This makes the original node (mmc2_pins_a) scrapped out of the dtb and +result in a unusable eMMC if U-Boot didn't configured the pins to the +correct functions. + +Signed-off-by: Emmanuel Vadot +Signed-off-by: Maxime Ripard +Signed-off-by: Olliver Schinagl +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts +@@ -56,7 +56,7 @@ + }; + + &pio { +- mmc2_pins_nrst: mmc2@0 { ++ mmc2_pins_nrst: mmc2-rst-pin { + allwinner,pins = "PC16"; + allwinner,function = "gpio_out"; + allwinner,drive = ; diff --git a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch new file mode 100644 index 000000000..df2300194 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch @@ -0,0 +1,12 @@ + GNU nano 2.7.4 File: 062-A20-improve-gmac-upload.patch + +--- a/configs/A20-OLinuXino-Lime2_defconfig ++++ b/configs/A20-OLinuXino-Lime2_defconfig +@@ -24,6 +24,7 @@ CONFIG_DFU_RAM=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_RGMII=y + CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 + CONFIG_AXP_ALDO3_VOLT=2800 + CONFIG_AXP_ALDO4_VOLT=2800 + CONFIG_USB_EHCI_HCD=y diff --git a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch index a402feb3c..40d79878a 100644 --- a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch +++ b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch @@ -12,9 +12,9 @@ More specifically, the following settings are now used: * up to 1152MHz: mul=3, div=2 (unchanged) * above 1152MHz: mul=4, div=2 (was: mul=2, div=1) ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -122,11 +122,12 @@ void clock_set_pll1(unsigned int clk) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -107,11 +107,12 @@ void clock_set_pll1(unsigned int clk) struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; const int p = 0; diff --git a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch index d200633bc..a8e03e2fb 100644 --- a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch +++ b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch @@ -16,9 +16,9 @@ order of magnitude as Boot1. Furthermore, a bit of documentation is added to clarify that the required setting for the PLL LDO is 1.37v as per the A31 manual. ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -24,14 +24,27 @@ void clock_init_safe(void) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -26,13 +26,26 @@ void clock_init_safe(void) struct sunxi_prcm_reg * const prcm = (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE; @@ -34,9 +34,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. clrsetbits_le32(&prcm->pll_ctrl1, ~PRCM_PLL_CTRL_LDO_KEY_MASK, PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN | - PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140)); -+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370) ); ++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370)); clrbits_le32(&prcm->pll_ctrl1, PRCM_PLL_CTRL_LDO_KEY_MASK); - ++ + /* Give the PLL LDO voltage setting some time to take hold. + * Notes: + * 1) We need to use sdelay() as the timers aren't set up yet. @@ -44,10 +44,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. + * iterations through a loop. + */ + sdelay(100000); -+ - clock_set_pll1(408000000); + #endif - writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg); + #if defined(CONFIG_MACH_SUN8I_R40) || defined(CONFIG_MACH_SUN50I) --- a/arch/arm/include/asm/arch-sunxi/prcm.h +++ b/arch/arm/include/asm/arch-sunxi/prcm.h @@ -111,13 +111,13 @@ diff --git a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch index bf5dc66e1..8bab22051 100644 --- a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch @@ -6,11 +6,11 @@ Subject: sun6i: define alternate-function for UART2 on GPG --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h -@@ -180,6 +180,7 @@ enum sunxi_gpio_number { +@@ -186,6 +186,7 @@ enum sunxi_gpio_number { #define SUN6I_GPG_SDC1 2 #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 +#define SUN6I_GPG_UART2 2 #define SUN5I_GPG_UART1 4 - #define SUN4I_GPH_SDC1 5 + #define SUN6I_GPH_PWM 2 diff --git a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch index 087074d0c..d140f2d53 100644 --- a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:53:11 +0200 Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -88,6 +88,10 @@ static int gpio_init(void) +--- a/arch/arm/mach-sunxi/board.c ++++ b/arch/arm/mach-sunxi/board.c +@@ -126,6 +126,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); @@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h -@@ -260,6 +260,8 @@ extern int soft_i2c_gpio_scl; +@@ -259,6 +259,8 @@ extern int soft_i2c_gpio_scl; #endif #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" diff --git a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch index ee1e3c9bf..41039796a 100644 --- a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch +++ b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:59:38 +0200 Subject: ARM: sunxi: Make CONS_INDEX configurable ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -229,6 +229,14 @@ config SYS_BOARD +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -412,6 +412,14 @@ config SYS_BOARD config SYS_SOC default "sunxi" diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch new file mode 100644 index 000000000..d61895a3f --- /dev/null +++ b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch @@ -0,0 +1,35 @@ +From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 22:23:15 +0200 +Subject: [PATCH] mkimage: check environment for dtc binary location + +Currently mkimage assumes the dtc binary is in the path and fails +otherwise. This patch makes it check the DTC environment variable first +for the dtc binary and then fall back to the default path. This makes +it possible to call the u-boot build with make DTC=... and build a fit +image with the dtc binary not being the the default path. + +Signed-off-by: Hauke Mehrtens +Cc: Simon Glass +--- + tools/fit_image.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/tools/fit_image.c ++++ b/tools/fit_image.c +@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_ + } + *cmd = '\0'; + } else if (params->datafile) { ++ const char* dtc = getenv("DTC"); ++ ++ if (!dtc) ++ dtc = MKIMAGE_DTC; ++ + /* dtc -I dts -O dtb -p 500 datafile > tmpfile */ + snprintf(cmd, sizeof(cmd), "%s %s %s > %s", +- MKIMAGE_DTC, params->dtc, params->datafile, tmpfile); ++ dtc, params->dtc, params->datafile, tmpfile); + debug("Trying to execute \"%s\"\n", cmd); + } else { + snprintf(cmd, sizeof(cmd), "cp %s %s", diff --git a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch new file mode 100644 index 000000000..25edf5104 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch @@ -0,0 +1,89 @@ +From eed65e5c25cbc4b6e893f140e9d7898f4624c114 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 23:12:38 +0200 +Subject: [PATCH 210/213] Revert "fdt: Makefile: Build python libfdt library if + needed" + +This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5. +--- + Makefile | 17 ++--------------- + scripts/Makefile.spl | 17 ++++------------- + 2 files changed, 6 insertions(+), 28 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ + + u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ +- $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE ++ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE + $(call if_changed,binman) + + OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec +@@ -1125,8 +1125,7 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ +- checkbinman FORCE ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE + $(call if_changed,binman) + endif + +@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea + $(timestamp_h): $(srctree)/Makefile FORCE + $(call filechk,timestamp.h) + +-checkbinman: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo >&2; \ +- echo >&2 '*** binman needs the Python libfdt library.'; \ +- echo >&2 '*** Either install it on your system, or try:'; \ +- echo >&2 '***'; \ +- echo >&2 '*** sudo apt-get install swig libpython-dev'; \ +- echo >&2 '***'; \ +- echo >&2 '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds = LDS $@ + cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ +--- a/scripts/Makefile.spl ++++ b/scripts/Makefile.spl +@@ -257,12 +257,14 @@ PHONY += dts_dir + dts_dir: + $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) + +-include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtoch) + +-$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtocc) + ++dtoc: #$(objtree)/tools/_libfdt.so ++ + ifdef CONFIG_SAMSUNG + ifdef CONFIG_VAR_SIZE_SPL + VAR_SIZE_PARAM = --vs +@@ -355,17 +357,6 @@ ifneq ($(cmd_files),) + include $(cmd_files) + endif + +-checkdtoc: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo '*** dtoc needs the Python libfdt library. Either '; \ +- echo '*** install it on your system, or try:'; \ +- echo '***'; \ +- echo '*** sudo apt-get install swig libpython-dev'; \ +- echo '***'; \ +- echo '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + PHONY += FORCE + FORCE: + diff --git a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch new file mode 100644 index 000000000..d40238d3a --- /dev/null +++ b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch @@ -0,0 +1,26 @@ +From cdee74ad13e933631caf7f544c319d8e981c6063 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:49:25 +0200 +Subject: [PATCH 211/213] Revert "scripts/Makefile.lib: Always have + ...-u-boot.dtsi be able to override" + +This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88. +--- + scripts/Makefile.lib | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb + + quiet_cmd_dtc = DTC $@ + # Modified for U-Boot +-# Bring in any U-Boot-specific include at the end of the file ++# Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \ ++ | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch new file mode 100644 index 000000000..1a5603417 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch @@ -0,0 +1,21 @@ +From 53d123333fa0ddc64b2c55d48366f4582ac6922d Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:50:52 +0200 +Subject: [PATCH 212/213] Revert "Avoid non-portable sed construct" + +This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9. +--- + scripts/Makefile.lib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC $@ + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ ++ | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch new file mode 100644 index 000000000..6f75259a7 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch @@ -0,0 +1,58 @@ +From cf1defd80b7594f6f2721ab2dacffe48522abfca Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:51:01 +0200 +Subject: [PATCH 213/213] Revert "sunxi: Use binman for sunxi boards" + +This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c. +--- + Makefile | 6 ++++-- + arch/arm/dts/sunxi-u-boot.dtsi | 14 -------------- + scripts/Makefile.lib | 4 ++-- + 3 files changed, 6 insertions(+), 18 deletions(-) + delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi + +--- a/Makefile ++++ b/Makefile +@@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE +- $(call if_changed,binman) ++OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ ++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE ++ $(call if_changed,pad_cat) + endif + + ifneq ($(CONFIG_TEGRA),) +--- a/arch/arm/dts/sunxi-u-boot.dtsi ++++ /dev/null +@@ -1,14 +0,0 @@ +-#include +- +-/ { +- binman { +- filename = "u-boot-sunxi-with-spl.bin"; +- pad-byte = <0xff>; +- blob { +- filename = "spl/sunxi-spl.bin"; +- }; +- u-boot-img { +- pos = ; +- }; +- }; +-}; +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC $@ + # Modified for U-Boot + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +- cat $< $(if $(u_boot_dtsi),\ +- | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ ++ cat $< $(if $(u-boot-dtsi),\ ++ | sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch new file mode 100644 index 000000000..65ae63c64 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch @@ -0,0 +1,182 @@ +From 1f92596cc520f760589289059a5aa739366dd19c Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:16:59 +0200 +Subject: sunxi: add device tree for Orange Pi R1 board + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 157 +++++++++++++++++++++++++++++ + 2 files changed, 158 insertions(+) + create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-sinovoip-bpi-m3.dtb + dtb-$(CONFIG_MACH_SUN8I_H3) += \ ++ sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ + sun8i-h3-orangepi-2.dtb \ +--- /dev/null ++++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts +@@ -0,0 +1,157 @@ ++/* ++ * Copyright (C) 2017 Hauke Mehrtens ++ * ++ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: ++ * Copyright (C) 2016 Icenowy Zheng ++ * ++ * Based on sun8i-h3-orangepi-one.dts, which is: ++ * Copyright (C) 2016 Hans de Goede ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun8i-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "Xunlong Orange Pi R1"; ++ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ++ ethernet1 = &xr819; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "orangepi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ status_led { ++ label = "orangepi:red:status"; ++ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ reg_vcc_wifi: reg_vcc_wifi { ++ compatible = "regulator-fixed"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++ enable-active-high; ++ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ allwinner,use-internal-phy; ++ allwinner,leds-active-low; ++ status = "okay"; ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc_wifi>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ /* ++ * Explicitly define the sdio device, so that we can add an ethernet ++ * alias for it (which e.g. makes u-boot set a mac-address). ++ */ ++ xr819: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB VBUS is always on */ ++ status = "okay"; ++}; diff --git a/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch new file mode 100644 index 000000000..6240fe3f5 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch @@ -0,0 +1,48 @@ +From 231201c71b902b5999ed9b143f2a54674cfae88a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:17:33 +0200 +Subject: sunxi: add orangepi R1 defconfig + +Signed-off-by: Hauke Mehrtens +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/orangepi_r1_defconfig | 19 +++++++++++++++++++ + 2 files changed, 24 insertions(+) + create mode 100644 configs/orangepi_r1_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -302,6 +302,11 @@ M: Jagan Teki ++S: Maintained ++F: configs/orangepi_r1_defconfig ++ + PINE64 BOARDS + M: Andre Przywara + S: Maintained +--- /dev/null ++++ b/configs/orangepi_r1_defconfig +@@ -0,0 +1,19 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_MACH_SUN8I_H3=y ++CONFIG_DRAM_CLK=624 ++CONFIG_DRAM_ZQ=3881979 ++CONFIG_DRAM_ODT_EN=y ++# CONFIG_VIDEO_DE2 is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_CONSOLE_MUX=y ++CONFIG_SPL=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++# CONFIG_CMD_FPGA is not set ++CONFIG_SPL_SPI_SUNXI=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch new file mode 100644 index 000000000..d884173c4 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch @@ -0,0 +1,83 @@ +From 6ff005cf19363382fc867d7876a75fd8a386e894 Mon Sep 17 00:00:00 2001 +From: Dave Prue +Date: Thu, 31 Aug 2017 19:21:01 +0200 +Subject: [PATCH] sunxi: Fix CONFIG_SUNXI_GMAC references + +SUNXI_GMAC was still used to configure the code where as the +same has been renamed and moved to Kconfig in below commit +"sunxi: Move SUNXI_GMAC to Kconfig" +(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb) + +Signed-off-by: Dave Prue +Reviewed-by: Simon Glass +Reviewed-by: Jagan Teki +Reviewed-by: Mark Kettenis +Tested-by: Mark Kettenis +[Tweek commit message, config_whitelist.txt, build-whitelist.sh] +Signed-off-by: Jagan Teki +--- + arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +- + board/sunxi/Makefile | 2 +- + include/configs/sunxi-common.h | 2 +- + scripts/build-whitelist.sh | 4 ++-- + scripts/config_whitelist.txt | 1 - + 5 files changed, 5 insertions(+), 6 deletions(-) + +--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h ++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h +@@ -24,7 +24,7 @@ void sdelay(unsigned long); + void return_to_fel(uint32_t lr, uint32_t sp); + + /* Board / SoC level designware gmac init */ +-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC ++#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC + void eth_init_board(void); + #else + static inline void eth_init_board(void) {} +--- a/board/sunxi/Makefile ++++ b/board/sunxi/Makefile +@@ -9,7 +9,7 @@ + # SPDX-License-Identifier: GPL-2.0+ + # + obj-y += board.o +-obj-$(CONFIG_SUNXI_GMAC) += gmac.o ++obj-$(CONFIG_SUN7I_GMAC) += gmac.o + obj-$(CONFIG_SUNXI_AHCI) += ahci.o + obj-$(CONFIG_MACH_SUN4I) += dram_sun4i_auto.o + obj-$(CONFIG_MACH_SUN5I) += dram_sun5i_auto.o +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -302,7 +302,7 @@ extern int soft_i2c_gpio_scl; + #define CONFIG_PHYLIB + #endif + +-#ifdef CONFIG_SUNXI_GMAC ++#ifdef CONFIG_SUN7I_GMAC + #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ + #define CONFIG_PHY_ADDR 1 + #define CONFIG_MII /* MII PHY management */ +--- a/scripts/build-whitelist.sh ++++ b/scripts/build-whitelist.sh +@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C + # There are two independent greps. The first pulls out the component parts + # of CONFIG_SYS_EXTRA_OPTIONS. An example is: + # +-# SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) ++# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) + # + # We want this to produce: +-# CONFIG_SUNXI_GMAC ++# CONFIG_SUN7I_GMAC + # CONFIG_AHCI + # CONFIG_SATAPWR + # +--- a/scripts/config_whitelist.txt ++++ b/scripts/config_whitelist.txt +@@ -2371,7 +2371,6 @@ CONFIG_STV0991_HZ_CLOCK + CONFIG_ST_SMI + CONFIG_SUNXI_AHCI + CONFIG_SUNXI_EMAC +-CONFIG_SUNXI_GMAC + CONFIG_SUNXI_GPIO + CONFIG_SUNXI_MAX_FB_SIZE + CONFIG_SUNXI_USB_PHYS diff --git a/package/boot/uboot-sunxi/uEnv-a64.txt b/package/boot/uboot-sunxi/uEnv-a64.txt new file mode 100644 index 000000000..7a717fdc0 --- /dev/null +++ b/package/boot/uboot-sunxi/uEnv-a64.txt @@ -0,0 +1,5 @@ +setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage +setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait earlycon=uart,mmio32,0x01c28000 +setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r +run uenvcmd diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 222922df2..291f45205 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -23,6 +23,7 @@ PKG_INSTALL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:binutils PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 23039910c..4cf2aaa87 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,16 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=7.12.1 -PKG_RELEASE:=3 +PKG_VERSION:=8.0.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 +PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gdb include $(INCLUDE_DIR)/package.mk @@ -61,6 +62,10 @@ CONFIGURE_ARGS+= \ CONFIGURE_VARS+= \ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" +TARGET_LDFLAGS+= \ + -static-libstdc++ \ + -Wl,--gc-sections + define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ DESTDIR="$(PKG_INSTALL_DIR)" \ diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch index e44616f4a..929a5ae97 100644 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1406,13 +1406,13 @@ if test -z "$LD"; then +@@ -1300,13 +1300,13 @@ if test -z "$LD"; then fi fi @@ -17,7 +17,7 @@ AC_LANG_PUSH(C++) AC_LINK_IFELSE([ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1740,7 +1740,7 @@ AC_ARG_WITH(stage1-ldflags, +@@ -1632,7 +1632,7 @@ AC_ARG_WITH(stage1-ldflags, # if supported. But if the user explicitly specified the libraries to use, # trust that they are doing what they want. if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then @@ -26,7 +26,7 @@ fi]) AC_SUBST(stage1_ldflags) -@@ -1769,7 +1769,7 @@ AC_ARG_WITH(boot-ldflags, +@@ -1661,7 +1661,7 @@ AC_ARG_WITH(boot-ldflags, # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then @@ -37,7 +37,7 @@ --- a/configure +++ b/configure -@@ -5109,14 +5109,14 @@ if test -z "$LD"; then +@@ -5005,14 +5005,14 @@ if test -z "$LD"; then fi fi @@ -56,7 +56,7 @@ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -5902,7 +5902,7 @@ else +@@ -5795,7 +5795,7 @@ else # if supported. But if the user explicitly specified the libraries to use, # trust that they are doing what they want. if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then @@ -65,7 +65,7 @@ fi fi -@@ -5938,7 +5938,7 @@ else +@@ -5831,7 +5831,7 @@ else # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch index 7090db170..8afa8ccf8 100644 --- a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch +++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch @@ -25,8 +25,6 @@ gdb/ChangeLog: gdb/common/signals-state-save-restore.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) -diff --git a/gdb/common/signals-state-save-restore.c b/gdb/common/signals-state-save-restore.c -index d11a9ae..734335c 100644 --- a/gdb/common/signals-state-save-restore.c +++ b/gdb/common/signals-state-save-restore.c @@ -41,7 +41,7 @@ save_original_signals_state (void) @@ -38,6 +36,3 @@ index d11a9ae..734335c 100644 if (res == -1) perror_with_name (("sigprocmask")); --- -2.6.4 - diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 5793e0e9c..6209dc5a6 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace - -PKG_VERSION:=4.19 +PKG_VERSION:=4.20 PKG_RELEASE:=1 -PKG_HASH:=7c93ebc6c29280f47c24a0eb86873a99ccb2cac6512c60a60ba4ef99ab807281 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_HASH:=5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523 PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYRIGHT +PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace PKG_MAINTAINER:=Felix Fietkau diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index 57ab75f96..6be2f9ec1 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:valgrind:valgrind PKG_FIXUP = autoreconf PKG_INSTALL := 1 diff --git a/package/firmware/ath10k-firmware/Makefile b/package/firmware/ath10k-firmware/Makefile index 9a34ac315..1c6f4dfb7 100644 --- a/package/firmware/ath10k-firmware/Makefile +++ b/package/firmware/ath10k-firmware/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-firmware -PKG_SOURCE_DATE:=2017-03-29 -PKG_SOURCE_VERSION:=956e2609b7e42c8c710bba10ef925a5be1be5137 -PKG_MIRROR_HASH:=25f724ff38c830281b3efba4a4ddffaae0c4bd8fea0f4c1061591229ff05535b +PKG_SOURCE_DATE:=2017-10-30 +PKG_SOURCE_VERSION:=476a2850b1e8582d51187799d7de209daf1a57b2 +PKG_MIRROR_HASH:=77ba59f75c5897c842c5c525945de019fd23f1e2d8bea6239924857e500bf73a PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git @@ -223,7 +223,7 @@ define Package/ath10k-firmware-qca4019/install $(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00053 \ + $(PKG_BUILD_DIR)/QCA4019/hw1.0/3.2.1/firmware-5.bin_10.4-3.2.1-00058 \ $(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin endef diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 2f1b280be..aec8bf27c 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -1,6 +1,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/version.mk +PKG_NAME:=ipq-wifi PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/firmware/fman-ucode/Makefile b/package/firmware/layerscape/fman-ucode/Makefile similarity index 79% rename from package/firmware/fman-ucode/Makefile rename to package/firmware/layerscape/fman-ucode/Makefile index 396750f80..aa2601b26 100644 --- a/package/firmware/fman-ucode/Makefile +++ b/package/firmware/layerscape/fman-ucode/Makefile @@ -9,19 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk PKG_NAME:=fman-ucode -PKG_VERSION:=fsl-sdk-v2.0 +PKG_SOURCE_DATE:=2017-02-13 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=209c60e4efaa3ce9c9a954266a7210fa0047a2de47ce00a412aa0318d94d0d88 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/fm-ucode.git -PKG_SOURCE_VERSION:=b19c645821941493fbef32e616b5a16404259976 +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/fm-ucode.git +PKG_SOURCE_VERSION:=c275e91392e2adab1ed22f3867b8269ca3c54014 +PKG_MIRROR_HASH:=1a4611d528f67f3acfa88aefdec9a9a67d96a3139ac5fe1089f599272e6c4a52 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk @@ -33,12 +30,12 @@ endef define fman/ls1043ardb TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board - CONFIG=fsl_fman_ucode_ls1043_r1.0_108_4_5.bin + CONFIG=fsl_fman_ucode_ls1043_r1.1_106_4_18.bin endef define fman/ls1046ardb TITLE=FMAN UCODE $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board - CONFIG=fsl_fman_ucode_t2080_r1.1_106_4_18.bin + CONFIG=fsl_fman_ucode_ls1046_r1.0_106_4_18.bin endef FMANS := \ @@ -51,7 +48,7 @@ define Package/fman-layerscape-$(1) CATEGORY:=Firmware DEPENDS:=@TARGET_layerscape TITLE:=$(2) - URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/fm-ucode.git + URL:=https://github.com/qoriq-open-source/fm-ucode.git VARIANT:=$(1) MAINTAINER:=Jiang Yutang endef diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile new file mode 100644 index 000000000..86483cab8 --- /dev/null +++ b/package/firmware/layerscape/ls-dpl/Makefile @@ -0,0 +1,58 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ls-dpl +PKG_SOURCE_DATE:=2017-09-07 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/dpl-examples.git +PKG_SOURCE_VERSION:=a6c83759c0d9c02822eec89e86357a0998ef51d4 +PKG_MIRROR_HASH:=d0311591843fbf9faebc7e2f0d53cba47d42ef21c4407c5881f354df6c458ce5 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/layerscape-dpl-ls1088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS1088ARDB DPL firmware + VARIANT:=ls1088ardb + DPC_CONFIG:=ls1088a/RDB/dpc.0x1D-0x0D.dtb + DPL_CONFIG:=ls1088a/RDB/dpl-eth.0x1D_0x0D.dtb +endef + +define Package/layerscape-dpl-ls2088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS2088ARDB DPL firmware + VARIANT:=ls2088ardb + DPC_CONFIG:=ls2088a/RDB/dpc.0x2A_0x41.dtb + DPL_CONFIG:=ls2088a/RDB/dpl-eth.0x2A_0x41.dtb +endef + +define Package/layerscape-dpl-ls1088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(DPL_CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-dpl.dtb + $(CP) $(PKG_BUILD_DIR)/$(DPC_CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-dpc.dtb +endef + +define Package/layerscape-dpl-ls2088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(DPL_CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-dpl.dtb + $(CP) $(PKG_BUILD_DIR)/$(DPC_CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-dpc.dtb +endef + +$(eval $(call BuildPackage,layerscape-dpl-ls1088ardb)) +$(eval $(call BuildPackage,layerscape-dpl-ls2088ardb)) diff --git a/package/firmware/layerscape/ls-mc/Makefile b/package/firmware/layerscape/ls-mc/Makefile new file mode 100644 index 000000000..a81e09563 --- /dev/null +++ b/package/firmware/layerscape/ls-mc/Makefile @@ -0,0 +1,57 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ls-mc +PKG_SOURCE_DATE:=2014-07-04 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/mc-binary.git +PKG_SOURCE_VERSION:=824745fe1580b281bebb808321c3f41353a3140a +PKG_MIRROR_HASH:=984c7905af3a4b87b72263de9220901c531fe064f0b89dd2882676354e09ed16 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define Package/layerscape-mc-ls1088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS1088ARDB MC firmware + VARIANT:=ls1088ardb + CONFIG:=ls1088a/mc_10.3.4_ls1088a_20170929.itb +endef + +define Package/layerscape-mc-ls2088ardb + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP LS2088ARDB MC firmware + VARIANT:=ls2088ardb + CONFIG:=ls2088a/mc_10.3.4_ls2088a_20170929.itb +endef + +define Build/Compile +endef + +define Package/layerscape-mc-ls1088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/ls1088ardb-mc.itb +endef + +define Package/layerscape-mc-ls2088ardb/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(CONFIG) $(STAGING_DIR_IMAGE)/ls2088ardb-mc.itb +endef + +$(eval $(call BuildPackage,layerscape-mc-ls1088ardb)) +$(eval $(call BuildPackage,layerscape-mc-ls2088ardb)) diff --git a/package/firmware/layerscape/ls-ppa/Makefile b/package/firmware/layerscape/ls-ppa/Makefile new file mode 100644 index 000000000..a354ad1a9 --- /dev/null +++ b/package/firmware/layerscape/ls-ppa/Makefile @@ -0,0 +1,111 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +PKG_NAME:=ls-ppa +PKG_SOURCE_DATE:=2017-10-26 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/ppa-binary.git +PKG_SOURCE_VERSION:=76a80ca988affbee67bb17096aefb82ba6d91be7 +PKG_MIRROR_HASH:=55e6cfa0f03f2db667ed4270e5aaf43ab830343af3b9724f92e830a1e3a3a25f + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +define ppa/Default + TITLE:= + CONFIG:= +endef + +define ppa/ls1043ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board + CONFIG=ppa-ls1043a.itb +endef + +define ppa/ls1046ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board + CONFIG=ppa-ls1046a.itb +endef + +define ppa/ls1012ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board + CONFIG=ppa-ls1012a.itb +endef + +define ppa/ls1088ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board + CONFIG=ppa-ls1088a.itb +endef + +define ppa/ls2088ardb + TITLE=PPA firmware $(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board + CONFIG=ppa-ls2088a.itb +endef + +define ppa/ls1012afrdm + TITLE=PPA firmware $(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board + CONFIG=ppa-ls1012a.itb +endef + +PPAS := \ + ls1043ardb \ + ls1046ardb \ + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm + +define Package/ppa/template +define Package/layerscape-ppa-$(1) + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:= @TARGET_layerscape + TITLE:=$(2) + VARIANT:=$(1) +endef +endef + +define BuildPPAPackage + $(eval $(ppa/Default)) + $(eval $(ppa/$(1))) + $(call Package/ppa/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call ppa/$(BUILD_VARIANT))) +PPA_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +endif + +define Build/Compile +endef + +define Package/ppa/install/default + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(PPA_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-ppa.itb +endef + +define Package/ppa/install/template +define Package/layerscape-ppa-$(1)/install + $(call Package/ppa/install/default,$(2)) +endef +endef + +$(foreach r,$(PPAS), \ + $(eval $(call Package/ppa/install/template,$(r),$(r))) \ +) + +$(foreach r,$(PPAS), \ + $(eval $(call BuildPPAPackage,$(r))) \ + $(eval $(call BuildPackage,layerscape-ppa-$(r))) \ +) diff --git a/package/firmware/rcw/Makefile b/package/firmware/layerscape/ls-rcw/Makefile similarity index 56% rename from package/firmware/rcw/Makefile rename to package/firmware/layerscape/ls-rcw/Makefile index bae9c95b6..70791d47b 100644 --- a/package/firmware/rcw/Makefile +++ b/package/firmware/layerscape/ls-rcw/Makefile @@ -8,19 +8,19 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -PKG_NAME:=rcw -PKG_VERSION:=v1.0 +PKG_NAME:=ls-rcw +PKG_SOURCE_DATE:=2017-09-26 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=8082979dbdef57e36a3096986aa426ef678c152403eb1dbd132da28f01490b6d -PKG_SOURCE_URL:=https://github.com/fsl-jyt/rcw.git -PKG_SOURCE_VERSION:=17e09e19bd5cf94e5ebc84916b4607743c29723e +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/rcw.git +PKG_SOURCE_VERSION:=6719b046ee87b04026fe163e6c8fbbebba2186aa +PKG_MIRROR_HASH:=9645ecf148640ec7d1029bce65950f2a0b0e6b351a25ef60c8a839c42c6ed56d PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=LICENSE PKG_FLAGS:=nonshared @@ -32,24 +32,42 @@ define rcw/Default endef define rcw/ls1043ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board - CONFIG=ls1043ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1043ardb 64b/32b Dev Board + CONFIG=ls1043ardb/RR_FQPP_1455/rcw_1600.bin endef define rcw/ls1046ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board - CONFIG=ls1046ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1046ardb 64b/32b Dev Board + CONFIG=ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin.swap endef define rcw/ls1012ardb - TITLE=RCW binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board - CONFIG=ls1012ardb-rcw.bin + TITLE=RCW binary $(PKG_VERSION) for NXP ls1012ardb 64b/32b Dev Board + CONFIG=ls1012ardb/R_SPNH_3508/PBL_0x35_0x08_1000_250_1000_default.bin +endef + +define rcw/ls1088ardb + TITLE=RCW binary $(PKG_VERSION) for NXP ls1088ardb 64b/32b Dev Board + CONFIG=ls1088ardb/FCQQQQQQQQ_PPP_H_0x1d_0x0d/PBL_QSPI_1600_700_2100_0x1d_0x0d.bin +endef + +define rcw/ls2088ardb + TITLE=RCW binary $(PKG_VERSION) for NXP ls2088ardb 64b/32b Dev Board + CONFIG=ls2088ardb/FFFFFFFF_PP_HH_0x2a_0x41/PBL_0x2a_0x41_1800_700_1866_1600.bin +endef + +define rcw/ls1012afrdm + TITLE=RCW binary $(PKG_VERSION) for NXP ls1012afrdm 64b/32b Dev Board + CONFIG=ls1012afrdm/N_SSNP_3305/PBL_0x33_0x05_800_250_1000_default.bin endef RCWS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm define Package/rcw/template define Package/rcw-layerscape-$(1) @@ -77,9 +95,6 @@ endif define Build/Configure endef -define Build/Compile -endef - define Package/rcw/install/default $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(CP) $(PKG_BUILD_DIR)/$(RCW_CONFIG) $(STAGING_DIR_IMAGE)/$(1)-rcw.bin diff --git a/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch b/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch new file mode 100644 index 000000000..a2b714065 --- /dev/null +++ b/package/firmware/layerscape/ls-rcw/patches/0001-rcw-add-a-python-script-for-byte-swapping.patch @@ -0,0 +1,66 @@ +From ebded197f9c12168d61973043fd9ebd5d49528a8 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 25 Dec 2017 14:11:02 +0800 +Subject: [PATCH] rcw: add a python script for byte swapping + +Signed-off-by: Yangbo Lu +--- + Makefile | 2 ++ + byte_swap.py | 32 ++++++++++++++++++++++++++++++++ + 2 files changed, 34 insertions(+) + create mode 100755 byte_swap.py + +diff --git a/Makefile b/Makefile +index fb55c8b..27e3ba2 100644 +--- a/Makefile ++++ b/Makefile +@@ -11,6 +11,8 @@ all install clean: + @for board in $(BOARDS); do \ + $(MAKE) -C $$board $@ DESTDIR=$(DESTDIR)/$$board; \ + done ++ chmod 755 ./byte_swap.py; \ ++ ./byte_swap.py ls1046ardb/RR_FFSSPPPH_1133_5559/rcw_1800_qspiboot.bin 8 + + release: $(foreach board,$(BOARDS),rcw-$(board)-$(VER).tar.gz) + +diff --git a/byte_swap.py b/byte_swap.py +new file mode 100755 +index 0000000..7ee4129 +--- /dev/null ++++ b/byte_swap.py +@@ -0,0 +1,32 @@ ++#!/usr/bin/env python ++""" ++Swap the 4/8 bytes endian except for PBI CRC ++2016-10-9: Initial version ++ ++Usage: ++ ./byte_swap.py ++""" ++import sys ++ ++try: ++ file_name = sys.argv[1] ++ byte = int(sys.argv[2]) ++except: ++ print("Usage: ./byte_swap.py ") ++ print("E.g.: ./byte_swap.py rcw_1600.bin 8\n") ++ exit ++ ++with open(file_name,'rb') as file: ++ tmp = file.read() ++file.close() ++ ++with open(file_name + '.swap','wb') as file: ++ for i in range(0, len(tmp) - 1, byte): ++ if(tmp[i:i+4].encode('hex')) == "08610040": ++ #print("PBI CRC command") ++ file.write(tmp[i:i+8]) ++ break ++ file.write(tmp[i:i+byte][::-1]) ++file.close() ++ ++print("Swapped file: " + file_name + '.swap') +-- +2.7.4 + diff --git a/package/firmware/layerscape/ppfe-firmware/Makefile b/package/firmware/layerscape/ppfe-firmware/Makefile new file mode 100644 index 000000000..419201e87 --- /dev/null +++ b/package/firmware/layerscape/ppfe-firmware/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ppfe +PKG_SOURCE_DATE:=2017-10-13 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/engine-pfe-bin.git +PKG_SOURCE_VERSION:=97cd13d3070d7199e62881bc495b332194b67edd +PKG_MIRROR_HASH:=3457bfe7201a8410443f34d4bb5fa67d4ff19e2d0f3957e84e3f20e2ae3fa34a + +PKG_FLAGS:=nonshared + +include $(INCLUDE_DIR)/package.mk + +RSTRIP:=: +STRIP:=: + +define Package/layerscape-ppfe + SECTION:=firmware + CATEGORY:=Firmware + DEPENDS:=@TARGET_layerscape + TITLE:=NXP Layerscape PPFE firmware + CONFIG_FW:=ls1012a/u-boot/pfe_fw_sbl.itb + CONFIG_BIN1:=ls1012a/slow_path/ppfe_class_ls1012a.elf + CONFIG_BIN2:=ls1012a/slow_path/ppfe_tmu_ls1012a.elf + CONFIG_LIC:=Freescale-Binary-EULA +endef + +define Build/Compile +endef + +define Package/layerscape-ppfe/install + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(CONFIG_FW) \ + $(STAGING_DIR_IMAGE)/pfe.itb + $(INSTALL_DIR) $(1)/lib/firmware/ + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/$(CONFIG_BIN1) \ + $(PKG_BUILD_DIR)/$(CONFIG_BIN2) \ + $(PKG_BUILD_DIR)/$(CONFIG_LIC) \ + $(1)/lib/firmware/ +endef + +$(eval $(call BuildPackage,layerscape-ppfe)) diff --git a/package/firmware/linux-firmware/edgeport.mk b/package/firmware/linux-firmware/edgeport.mk new file mode 100644 index 000000000..d68c75a0d --- /dev/null +++ b/package/firmware/linux-firmware/edgeport.mk @@ -0,0 +1,12 @@ +Package/edgeport-firmware = $(call Package/firmware-default,USB Inside Out Edgeport Serial Driver firmware) +define Package/edgeport-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/edgeport + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/edgeport/boot.fw \ + $(PKG_BUILD_DIR)/edgeport/boot2.fw \ + $(PKG_BUILD_DIR)/edgeport/down.fw \ + $(PKG_BUILD_DIR)/edgeport/down2.fw \ + $(1)/lib/firmware/edgeport +endef + +$(eval $(call BuildPackage,edgeport-firmware)) diff --git a/package/firmware/ppfe-firmware/Makefile b/package/firmware/ppfe-firmware/Makefile deleted file mode 100644 index 506046db4..000000000 --- a/package/firmware/ppfe-firmware/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=ppfe -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=645d9aaaaa39ac1fa50cf805f1866feb5f717b34cb110c80e3f45303ea6d7259 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/ppfe.git -PKG_SOURCE_VERSION:=b9bb5cc690c0aab2592eb9d443ef55cc9dff8557 -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_FLAGS:=nonshared - -include $(INCLUDE_DIR)/package.mk - -define ppfe/Default - TITLE:= - CONFIG:= -endef - -define ppfe/ls1012ardb - TITLE:=PPFE firmware $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012a Dev Board\ - (must enable CONFIG_NO_STRIP=y for avoid firmware be broke) - CONFIG:=ls1012a/Freescale-Binary-EULA ls1012a/ppfe_class_ls1012a.elf ls1012a/ppfe_tmu_ls1012a.elf -endef - -PPFES := \ - ls1012ardb - -define Package/ppfe/template -define Package/ppfe-$(1) - SECTION:=firmware - CATEGORY:=Firmware - DEPENDS:=@TARGET_layerscape - TITLE:=$(2) - URL:=https://github.com/fsl-jyt/ppfe.git - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef -endef - -define BuildPPFEPackage - $(eval $(ppfe/Default)) - $(eval $(ppfe/$(1))) - $(call Package/ppfe/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call ppfe/$(BUILD_VARIANT))) -PPFE_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -endif - -define Build/Compile -endef - -define Package/ppfe/install/default - $(INSTALL_DIR) $(1)/lib/firmware - $(foreach i,$(PPFE_CONFIG), \ - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(i) $(1)/lib/firmware/ ;\ - ) -endef - -define Package/ppfe/install/template -define Package/ppfe-$(1)/install - $(call Package/ppfe/install/default,$$(1),$(2)) -endef -endef - -$(foreach p,$(PPFES), \ - $(eval $(call Package/ppfe/install/template,$(p),$(p))) \ -) - -$(foreach p,$(PPFES), \ - $(eval $(call BuildPPFEPackage,$(p))) \ - $(eval $(call BuildPackage,ppfe-$(p))) \ -) diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile new file mode 100644 index 000000000..d06da2c70 --- /dev/null +++ b/package/firmware/wireless-regdb/Makefile @@ -0,0 +1,31 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=wireless-regdb + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git +PKG_SOURCE_DATE:=2017-10-20 +PKG_SOURCE_VERSION:=4343d359ed5e7404de8803a74df186457b26ab79 +PKG_MIRROR_HASH:=5f5b669f32ae36cb65b1d99efbbbfd42c2983cda32f6448346e3e54ffaba3889 + +PKG_MAINTAINER:=Felix Fietkau + +include $(INCLUDE_DIR)/package.mk + +define Package/wireless-regdb + SECTION:=firmware + CATEGORY:=Firmware + URL:=$(patsubst pub/scm,cgit,$(PKG_SOURCE_URL)) + TITLE:=Wireless Regulatory Database +endef + +define Build/Compile + python $(PKG_BUILD_DIR)/db2fw.py $(PKG_BUILD_DIR)/regulatory.db $(PKG_BUILD_DIR)/db.txt +endef + +define Package/wireless-regdb/install + $(INSTALL_DIR) $(1)/lib/firmware + $(CP) $(PKG_BUILD_DIR)/regulatory.db $(1)/lib/firmware/ +endef + +$(eval $(call BuildPackage,wireless-regdb)) diff --git a/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch b/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch new file mode 100644 index 000000000..0c5c63fc5 --- /dev/null +++ b/package/firmware/wireless-regdb/patches/100-regdb-write-firmware-file-format-version-code-20.patch @@ -0,0 +1,251 @@ +From: Johannes Berg +Date: Mon, 9 Oct 2017 11:50:57 +0200 +Subject: [PATCH] regdb: write firmware file format (version code 20) + +TODO: clean up the Makefile stuff ... + +Signed-off-by: Johannes Berg +--- + create mode 100755 db2fw.py + +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,5 @@ + # Install prefix + PREFIX ?= /usr +-CRDA_PATH ?= $(PREFIX)/lib/crda +-CRDA_KEY_PATH ?= $(CRDA_PATH)/pubkeys + + MANDIR ?= $(PREFIX)/share/man/ + +@@ -30,39 +28,47 @@ REGDB_AUTHOR ?= $(shell if [ -f $(DISTRO + fi) + + REGDB_PRIVKEY ?= ~/.wireless-regdb-$(REGDB_AUTHOR).key.priv.pem +-REGDB_PUBKEY ?= $(REGDB_AUTHOR).key.pub.pem +- +-REGDB_UPSTREAM_PUBKEY ?= sforshee.key.pub.pem ++REGDB_PUBCERT ?= $(REGDB_AUTHOR).x509.pem + + REGDB_CHANGED = $(shell $(SHA1SUM) -c --status sha1sum.txt >/dev/null 2>&1; \ + if [ $$? -ne 0 ]; then \ +- echo maintainer-clean $(REGDB_PUBKEY); \ ++ echo maintainer-clean $(REGDB_PUBCERT); \ + fi) + + .PHONY: all clean mrproper install maintainer-clean install-distro-key + +-all: $(REGDB_CHANGED) regulatory.bin sha1sum.txt ++all: $(REGDB_CHANGED) regulatory.db.p7s sha1sum.txt + + clean: + @rm -f *.pyc *.gz + + maintainer-clean: clean +- @rm -f regulatory.bin ++ @rm -f regulatory.db regulatory.db.p7s + + mrproper: clean maintainer-clean +- @echo Removed public key, regulatory.bin and compresed man pages +- @rm -f $(REGDB_PUBKEY) .custom ++ @echo Removed public key, regulatory.db* and compressed man pages ++ @rm -f $(REGDB_PUBCERT) .custom + +-regulatory.bin: db.txt $(REGDB_PRIVKEY) $(REGDB_PUBKEY) +- @echo Generating $@ digitally signed by $(REGDB_AUTHOR)... +- ./db2bin.py regulatory.bin db.txt $(REGDB_PRIVKEY) ++regulatory.db: db.txt db2fw.py ++ @echo "Generating $@" ++ ./db2fw.py regulatory.db db.txt ++ ++regulatory.db.p7s: regulatory.db $(REGDB_PRIVKEY) $(REGDB_PUBCERT) ++ @echo "Signing regulatory.db (by $(REGDB_AUTHOR))..." ++ @openssl smime -sign \ ++ -signer $(REGDB_PUBCERT) \ ++ -inkey $(REGDB_PRIVKEY) \ ++ -in $< -nosmimecap -binary \ ++ -outform DER -out $@ + + sha1sum.txt: db.txt + sha1sum $< > $@ + +-$(REGDB_PUBKEY): $(REGDB_PRIVKEY) +- @echo "Generating public key for $(REGDB_AUTHOR)..." +- openssl rsa -in $(REGDB_PRIVKEY) -out $(REGDB_PUBKEY) -pubout -outform PEM ++$(REGDB_PUBCERT): $(REGDB_PRIVKEY) ++ @echo "Generating certificate for $(REGDB_AUTHOR)..." ++ @openssl req -config regulatory.openssl.conf \ ++ -key $(REGDB_PRIVKEY) -days 36500 -utf8 -nodes -batch \ ++ -x509 -outform PEM -out $(REGDB_PUBCERT) + @echo $(REGDB_PUBKEY) > .custom + + +@@ -97,16 +103,7 @@ install-distro-key: maintainer-clean $(D + # make maintainer-clean + # make + # sudo make install +-install: regulatory.bin.5.gz +- install -m 755 -d $(DESTDIR)/$(CRDA_PATH) +- install -m 755 -d $(DESTDIR)/$(CRDA_KEY_PATH) +- if [ -f .custom ]; then \ +- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(shell cat .custom); \ +- fi +- install -m 644 -t $(DESTDIR)/$(CRDA_KEY_PATH)/ $(REGDB_UPSTREAM_PUBKEY) +- install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.bin ++install: regulatory.db.5.gz ++ install -m 644 -t $(DESTDIR)/$(CRDA_PATH)/ regulatory.db + install -m 755 -d $(DESTDIR)/$(MANDIR)/man5/ +- install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.bin.5.gz +- +-uninstall: +- rm -rf $(DESTDIR)/$(CRDA_PATH)/ ++ install -m 644 -t $(DESTDIR)/$(MANDIR)/man5/ regulatory.db.5.gz +--- a/README ++++ b/README +@@ -18,8 +18,8 @@ python module is used by the web viewer + implemented as a MoinMoin macro (and used on http://wireless.kernel.org) + to allow viewing the database for verification. + +-The dbparse module is also used by db2bin.py, the `compiler', which +-compiles and signs the binary database. ++The dbparse module is also used by db2bin.py and db2fw.py, the `compilers' ++that compile the database to its binary formats. + + For more information, please see the CRDA git repository: + +--- /dev/null ++++ b/db2fw.py +@@ -0,0 +1,133 @@ ++#!/usr/bin/env python ++ ++from cStringIO import StringIO ++import struct ++import hashlib ++from dbparse import DBParser ++import sys ++ ++MAGIC = 0x52474442 ++VERSION = 20 ++ ++if len(sys.argv) < 3: ++ print 'Usage: %s output-file input-file' % sys.argv[0] ++ sys.exit(2) ++ ++def create_rules(countries): ++ result = {} ++ for c in countries.itervalues(): ++ for rule in c.permissions: ++ result[rule] = 1 ++ return result.keys() ++ ++def create_collections(countries): ++ result = {} ++ for c in countries.itervalues(): ++ result[(c.permissions, c.dfs_region)] = 1 ++ return result.keys() ++ ++ ++def be32(output, val): ++ output.write(struct.pack('>I', val)) ++def be16(output, val): ++ output.write(struct.pack('>H', val)) ++ ++class PTR(object): ++ def __init__(self, output): ++ self._output = output ++ self._pos = output.tell() ++ be16(output, 0) ++ self._written = False ++ ++ def set(self, val=None): ++ if val is None: ++ val = self._output.tell() ++ assert val & 3 == 0 ++ self._offset = val ++ pos = self._output.tell() ++ self._output.seek(self._pos) ++ be16(self._output, val >> 2) ++ self._output.seek(pos) ++ self._written = True ++ ++ def get(self): ++ return self._offset ++ ++ @property ++ def written(self): ++ return self._written ++ ++p = DBParser() ++countries = p.parse(file(sys.argv[2])) ++rules = create_rules(countries) ++rules.sort(cmp=lambda x, y: cmp(x.freqband, y.freqband)) ++collections = create_collections(countries) ++collections.sort(cmp=lambda x, y: cmp(x[0][0].freqband, y[0][0].freqband)) ++ ++output = StringIO() ++ ++# struct regdb_file_header ++be32(output, MAGIC) ++be32(output, VERSION) ++ ++country_ptrs = {} ++countrynames = countries.keys() ++countrynames.sort() ++for alpha2 in countrynames: ++ coll = countries[alpha2] ++ output.write(struct.pack('>cc', str(alpha2[0]), str(alpha2[1]))) ++ country_ptrs[alpha2] = PTR(output) ++output.write('\x00' * 4) ++ ++reg_rules = {} ++flags = 0 ++for reg_rule in rules: ++ freq_range, power_rule = reg_rule.freqband, reg_rule.power ++ reg_rules[reg_rule] = output.tell() ++ assert power_rule.max_ant_gain == 0 ++ flags = 0 ++ # convert to new rule flags ++ assert reg_rule.flags & ~0x899 == 0 ++ if reg_rule.flags & 1<<0: ++ flags |= 1<<0 ++ if reg_rule.flags & 1<<3: ++ flags |= 1<<1 ++ if reg_rule.flags & 1<<4: ++ flags |= 1<<2 ++ if reg_rule.flags & 1<<7: ++ flags |= 1<<3 ++ if reg_rule.flags & 1<<11: ++ flags |= 1<<4 ++ rule_len = 16 ++ cac_timeout = 0 # TODO ++ if not (flags & 1<<2): ++ cac_timeout = 0 ++ if cac_timeout: ++ rule_len += 2 ++ output.write(struct.pack('>BBHIII', rule_len, flags, power_rule.max_eirp * 100, ++ freq_range.start * 1000, freq_range.end * 1000, freq_range.maxbw * 1000, ++ )) ++ if cac_timeout: ++ output.write(struct.pack('>H', cac_timeout)) ++ while rule_len % 4: ++ output.write('\0') ++ rule_len += 1 ++ ++for coll in collections: ++ for alpha2 in countrynames: ++ if (countries[alpha2].permissions, countries[alpha2].dfs_region) == coll: ++ assert not country_ptrs[alpha2].written ++ country_ptrs[alpha2].set() ++ slen = 3 ++ output.write(struct.pack('>BBBx', slen, len(list(coll[0])), coll[1])) ++ coll = list(coll[0]) ++ for regrule in coll: ++ be16(output, reg_rules[regrule] >> 2) ++ if len(coll) % 2: ++ be16(output, 0) ++ ++for alpha2 in countrynames: ++ assert country_ptrs[alpha2].written ++ ++outfile = open(sys.argv[1], 'w') ++outfile.write(output.getvalue()) diff --git a/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch b/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch new file mode 100644 index 000000000..9baba808b --- /dev/null +++ b/package/firmware/wireless-regdb/patches/500-world-regd-5GHz.patch @@ -0,0 +1,16 @@ +Remove the NO-IR flag from channels 36-48 on the World domain, +to make it usable for AP mode. + +Signed-off-by: Felix Fietkau +--- +--- a/db.txt ++++ b/db.txt +@@ -6,7 +6,7 @@ country 00: + # Channel 14. Only JP enables this and for 802.11b only + (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM + # Channel 36 - 48 +- (5170 - 5250 @ 80), (20), NO-IR, AUTO-BW ++ (5170 - 5250 @ 80), (20), AUTO-BW + # Channel 52 - 64 + (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW + # Channel 100 - 144 diff --git a/package/kernel/acx-mac80211/Makefile b/package/kernel/acx-mac80211/Makefile index 5629b050b..5927f174d 100644 --- a/package/kernel/acx-mac80211/Makefile +++ b/package/kernel/acx-mac80211/Makefile @@ -16,7 +16,6 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2014-02-16 PKG_SOURCE_VERSION:=b6fc31491020cb01d2cd1acc170cfa03ced7e726 PKG_MIRROR_HASH:=58590245715f0e5fb4b57aab6d91071dfb6a97d3273f5aee0b97b1edee030ed0 -PKG_BUILD_DEPENDS:=mac80211 PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_MAC80211_DEBUGFS \ @@ -27,9 +26,9 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/acx-mac80211 SUBMENU:=Wireless Drivers TITLE:=ACX1xx mac80211 driver - DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel @LINUX_3_18||LINUX_4_4 +kmod-mac80211 + DEPENDS:=@(PCI_SUPPORT||TARGET_ar7) @mipsel +kmod-mac80211 FILES:=$(PKG_BUILD_DIR)/acx-mac80211.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 acx-mac80211) + AUTOLOAD:=$(call AutoProbe,acx-mac80211) MAINTAINER:=Florian Fainelli MENU:=1 endef @@ -183,8 +182,7 @@ PKG_EXTRA_CFLAGS:= \ define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ $(PKG_EXTRA_KCONFIG) \ EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS) -DCONFIG_ACX_MAC80211_VERSION=\"KERNEL_VERSION(4,2,0)\"" \ diff --git a/package/kernel/acx-mac80211/patches/100-compat.patch b/package/kernel/acx-mac80211/patches/100-compat.patch new file mode 100644 index 000000000..6fcab5ea4 --- /dev/null +++ b/package/kernel/acx-mac80211/patches/100-compat.patch @@ -0,0 +1,16 @@ +diff --git a/pci.c b/pci.c +index ae07f5a..72d542f 100644 +--- a/pci.c ++++ b/pci.c +@@ -1495,7 +1495,11 @@ static struct acxpci_device_info acxpci_info_tbl[] __devinitdata = { + #endif + + #ifdef CONFIG_PCI ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) + static DEFINE_PCI_DEVICE_TABLE(acxpci_id_tbl) = { ++#else ++static const struct pci_device_id acxpci_id_tbl[] = { ++#endif + { PCI_VDEVICE(TI, PCI_DEVICE_ID_TI_TNETW1100A), + .driver_data = CHIPTYPE_ACX100, + }, diff --git a/package/kernel/ar7-atm/Makefile b/package/kernel/ar7-atm/Makefile index edec44f96..82d6f61a7 100644 --- a/package/kernel/ar7-atm/Makefile +++ b/package/kernel/ar7-atm/Makefile @@ -80,8 +80,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ modules endef diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch index 9f1f0fdae..a970574fe 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -109,6 +109,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -446,7 +447,9 @@ static void avsar_release(struct device +@@ -446,7 +446,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -455,6 +458,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -455,6 +454,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch index 6bd8f4876..6d72b0054 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -71,10 +71,16 @@ - #include - #include +@@ -73,8 +73,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #include "tn7atm.h" --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -112,8 +112,13 @@ - #include +@@ -111,8 +111,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #include "tn7atm.h" --- a/tn7sar.c +++ b/tn7sar.c -@@ -52,10 +52,16 @@ - #include - #include +@@ -54,8 +54,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch index 11487bf7a..1223604b0 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,70 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -203,7 +203,11 @@ led_reg_t ledreg[2]; +@@ -197,7 +197,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3431,9 +3435,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -333,8 +333,8 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++ size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -3398,8 +3398,8 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++ size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3411,7 +3411,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3421,9 +3421,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3517,14 +3528,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3507,14 +3507,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +73,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3532,7 +3558,16 @@ ctl_table dslmod_table[] = { +@@ -3522,7 +3529,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch index e8668b6c5..2007b497c 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -1876,7 +1876,11 @@ static int __init tn7atm_register (Tn7At +@@ -1870,7 +1870,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -466,14 +466,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -453,13 +453,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch index be81ee125..7a2bbe808 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/220-3.10-update_proc_code.patch @@ -116,7 +116,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -277,25 +277,15 @@ static int tn7atm_change_qos (struct atm +@@ -271,25 +271,15 @@ static int tn7atm_change_qos (struct atm static int tn7atm_detect (void); static int tn7atm_init (struct atm_dev *dev); static int tn7atm_irq_request (struct atm_dev *dev); @@ -147,15 +147,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -415,63 +405,67 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -412,60 +402,59 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -250,7 +242,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1709,75 +1703,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1703,75 +1692,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -301,15 +293,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -353,11 +345,11 @@ Signed-off-by: Jonas Gorski + + seq_printf (m, "tx_irq: %02d", priv->sar_irq); + seq_printf (m, "rx_irq: %02d", priv->dsl_irq); - -- return len; ++ + return 0; +} -+ + +- return len; +static int tn7atm_proc_private_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_private, PDE_DATA(inode)); @@ -374,7 +366,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -1900,10 +1900,8 @@ static int __init tn7atm_register (Tn7At +@@ -1890,10 +1885,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -386,7 +378,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -1914,56 +1912,64 @@ static int tn7atm_proc_version (char *bu +@@ -1904,56 +1897,64 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; @@ -472,7 +464,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2012,24 +2018,7 @@ static int __init tn7atm_detect (void) +@@ -2002,24 +2003,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -498,7 +490,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2501,63 +2490,10 @@ static int tn7atm_set_can_support_adsl2 +@@ -2491,63 +2475,10 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -564,7 +556,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2591,5 +2527,19 @@ static int tn7atm_proc_qos_write(struct +@@ -2581,5 +2512,19 @@ static int tn7atm_proc_qos_write(struct return count; } @@ -586,17 +578,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -221,6 +221,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -349,7 +352,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -339,7 +339,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -605,7 +587,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -649,11 +652,9 @@ void shim_osCriticalExit(void) +@@ -635,11 +635,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -618,7 +600,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -674,95 +675,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -660,95 +658,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -791,7 +773,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -825,59 +859,48 @@ static char *pUnknown= "Unknown"; +@@ -811,59 +842,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -874,7 +856,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -886,66 +909,53 @@ static int proc_adv_stats_header(char* b +@@ -872,66 +892,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -963,7 +945,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -968,29 +978,24 @@ static int getDiagDisplayMode() +@@ -954,29 +961,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -998,7 +980,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1001,26 +1006,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -987,26 +989,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1041,7 +1023,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1030,12 +1043,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1016,12 +1026,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1056,7 +1038,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1046,26 +1057,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1032,26 +1040,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1100,7 +1082,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1075,12 +1095,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1061,12 +1078,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1115,7 +1097,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1091,283 +1109,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1077,283 +1092,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1256,7 +1238,9 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_cmsgs, PDE_DATA(inode)); +} -+ + +- int len = 0; +- int limit = count - 80; +struct file_operations tn7dsl_proc_dbg_cmsgs_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_cmsgs_open, @@ -1264,9 +1248,7 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; - -- int len = 0; -- int limit = count - 80; ++ + +int tn7dsl_proc_dbg_rmsgs1(struct seq_file *m, void *data) +{ @@ -1544,7 +1526,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1375,80 +1397,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1361,80 +1380,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1648,7 +1630,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1456,9 +1456,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1442,9 +1439,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1659,7 +1641,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1466,57 +1464,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1452,57 +1447,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1732,7 +1714,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1528,12 +1514,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1514,12 +1497,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1747,7 +1729,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1549,283 +1535,213 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1535,283 +1518,213 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2129,7 +2111,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1859,16 +1775,26 @@ int tn7dsl_proc_modem(char* buf, char ** +@@ -1845,16 +1758,26 @@ int tn7dsl_proc_modem(char* buf, char ** if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2163,7 +2145,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2133,11 +2059,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2119,11 +2042,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2176,7 +2158,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2146,62 +2069,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2132,62 +2052,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2279,7 +2261,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4440,14 +4350,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4407,14 +4314,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2295,7 +2277,7 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4528,197 +4434,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4495,197 +4398,185 @@ int tn7dsl_proc_train_mode_export (char } @@ -2574,7 +2556,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4727,39 +4621,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4694,39 +4585,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2679,7 +2661,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4767,64 +4711,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4734,64 +4675,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2760,7 +2742,7 @@ Signed-off-by: Jonas Gorski } -@@ -4832,19 +4760,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4799,19 +4724,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2800,15 +2782,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1401,44 +1401,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1395,44 +1395,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -2883,7 +2861,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1447,21 +1473,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1441,21 +1463,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -2908,7 +2886,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1474,26 +1498,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1468,26 +1488,18 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -2919,7 +2897,8 @@ Signed-off-by: Jonas Gorski - k += dBytes; - } + -+ k += seq_printf(m, "%s: ",(char *) *pSarStat); ++ seq_printf(m, "%s: ",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen(": "); pSarStat++; - if(len<=limit) - { @@ -2927,7 +2906,8 @@ Signed-off-by: Jonas Gorski - len += dBytes; - k += dBytes; - } -+ k += seq_printf(m, "%s; \n",(char *) *pSarStat); ++ seq_printf(m, "%s; \n",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen("; \n"); pSarStat++; if(k > 60) @@ -2939,7 +2919,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1502,9 +1516,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1496,9 +1508,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch index e8bdab63d..2e6930014 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/240-3.18_fixes.patch @@ -1,38 +1,38 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -346,7 +346,7 @@ static void tn7dsl_chng_modulation(void* +@@ -333,7 +333,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); --static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, -+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp, - void *buffer, size_t * lenp); +-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer, + size_t * lenp, loff_t *ppos); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3325,7 +3325,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3308,7 +3308,7 @@ unsigned int tn7dsl_get_memory(unsigned --static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, -+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp, - void *buffer, size_t *lenp) +-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer, + size_t *lenp, loff_t *ppos) { char *ptr; -@@ -3451,7 +3451,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3423,7 +3423,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3469,7 +3469,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3437,7 +3437,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch index 97a26cb41..f26b7e221 100644 --- a/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -788,7 +788,7 @@ static int __init tn7atm_irq_request (st +@@ -777,7 +777,7 @@ static int __init tn7atm_irq_request (st * Register SAR interrupt */ priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -806,7 +806,7 @@ static int __init tn7atm_irq_request (st +@@ -795,7 +795,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ diff --git a/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch new file mode 100644 index 000000000..fe13fc547 --- /dev/null +++ b/package/kernel/ar7-atm/patches-D7.04.03.00/260-fix_function_signatures.patch @@ -0,0 +1,63 @@ +--- a/cpswhal_cpsar.h ++++ b/cpswhal_cpsar.h +@@ -430,10 +430,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/cpswhal_cpaal5.h ++++ b/cpswhal_cpaal5.h +@@ -430,10 +430,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/tn7atm.c ++++ b/tn7atm.c +@@ -2481,7 +2481,7 @@ static int tn7atm_proc_qos_read(struct s + return 0; + + } +-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) ++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data) + { + char local_buf[32]; + +--- a/tn7dsl.c ++++ b/tn7dsl.c +@@ -1712,7 +1712,7 @@ static int tn7dsl_proc_stats_open(struct + return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode)); + } + +-int tn7dsl_proc_write_stats (struct file *fp, const char *buf, unsigned long count, void *data); ++int tn7dsl_proc_write_stats (struct file *fp, const char *buf, size_t count, loff_t *data); + + struct file_operations tn7dsl_proc_stats_fops = { + .owner = THIS_MODULE, +@@ -4256,7 +4256,7 @@ int tn7dsl_generic_write( int offsetnum, + } + + int tn7dsl_proc_write_stats (struct file *fp, const char *buf, +- unsigned long count, void *data) ++ size_t count, loff_t *data) + { + char local_buf[31]; + int ret_val = 0; diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch index 6692f40f6..53767e45b 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/170-bus_id_removal.patch @@ -1,30 +1,19 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -117,6 +117,7 @@ - #include - #include - #include -+#include - - #include - #include -@@ -492,7 +493,9 @@ static void avsar_release(struct device +@@ -492,7 +492,6 @@ static void avsar_release(struct device } static struct device avsar = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,30) - .bus_id = "vlynq", -+#endif +- .bus_id = "vlynq", .release = avsar_release, }; -@@ -501,6 +504,9 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -501,6 +500,8 @@ int shim_osLoadFWImage(unsigned char *pt const struct firmware *fw_entry; size_t size; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) + dev_set_name(&avsar, "avsar"); -+#endif ++ printk("requesting firmware image \"ar0700xx.bin\"\n"); if(device_register(&avsar) < 0) { printk(KERN_ERR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch index feb6ea860..69b433b2b 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/180-git_headers_include.patch @@ -1,54 +1,39 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -76,10 +76,16 @@ - #include - #include +@@ -78,8 +78,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #include "dsl_hal_api.h" #ifdef AR7_EFM --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -120,8 +120,13 @@ - #include +@@ -119,8 +119,8 @@ + #include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif /* Modules specific header files */ #ifdef AR7_EFM --- a/tn7sar.c +++ b/tn7sar.c -@@ -53,10 +53,16 @@ - #include - #include +@@ -55,8 +55,8 @@ #include -+#include #include -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31) - #include - #include -+#else +-#include +-#include +#include +#include -+#endif #define _CPHAL_AAL5 #define _CPHAL_SAR diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch index 52ebbc152..10d32d261 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/190-2.6.32_proc_fixes.patch @@ -1,53 +1,70 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -215,7 +215,11 @@ led_reg_t ledreg[2]; +@@ -209,7 +209,7 @@ led_reg_t ledreg[2]; static struct led_funcs ledreg[2]; #endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - #define DEV_DSLMOD CTL_UNNUMBERED -+#else +-#define DEV_DSLMOD CTL_UNNUMBERED +#define DEV_DSLMOD 0 -+#endif #define MAX_STR_SIZE 256 #define DSL_MOD_SIZE 256 -@@ -3615,9 +3619,16 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -350,8 +350,8 @@ static void tn7dsl_chng_modulation(void* + static unsigned int tn7dsl_set_modulation(void* data, int flag); + static void tn7dsl_ctrl_fineGain(int value); + static void tn7dsl_set_fineGainValue(int value); +-static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, +- void *buffer, size_t * lenp); ++static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++ size_t * lenp, loff_t *ppos); + static void tn7dsl_register_dslss_led(void); + void tn7dsl_dslmod_sysctl_register(void); + void tn7dsl_dslmod_sysctl_unregister(void); +@@ -3582,8 +3582,8 @@ unsigned int tn7dsl_get_memory(unsigned + + + +-static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, +- void *buffer, size_t *lenp) ++static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++ size_t *lenp, loff_t *ppos) + { + char *ptr; + int ret, len = 0; +@@ -3595,7 +3595,7 @@ static int dslmod_sysctl(ctl_table *ctl, + char mod_req[16] = { '\t' }; + char fst_byt; + +- if (!*lenp || (filp->f_pos && !write)) ++ if (!*lenp || (*ppos && !write)) + { + *lenp = 0; + return 0; +@@ -3605,9 +3605,9 @@ static int dslmod_sysctl(ctl_table *ctl, */ if(write) { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -- -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - switch (ctl->ctl_name) -+#else +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); + +- switch (ctl->ctl_name) + switch ((long)ctl->extra2) -+#endif { case DEV_DSLMOD: ptr = strpbrk(info, " \t"); -@@ -3701,14 +3712,29 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3691,14 +3691,21 @@ static int dslmod_sysctl(ctl_table *ctl, else { len += sprintf(info+len, mod_req); -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) - ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); -+#else -+ ret = proc_dostring(ctl, write, buffer, lenp, 0); -+#endif +- ret = proc_dostring(ctl, write, filp, buffer, lenp, 0); ++ ret = proc_dostring(ctl, write, buffer, lenp, ppos); } return ret; } ctl_table dslmod_table[] = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} -+#else +- {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} + { + .procname = "dslmod", + .data = info, @@ -56,24 +73,20 @@ + .proc_handler = &dslmod_sysctl, + .extra2 = (void *)DEV_DSLMOD, + } -+#endif , {0} }; -@@ -3716,7 +3742,16 @@ ctl_table dslmod_table[] = { +@@ -3706,7 +3713,12 @@ ctl_table dslmod_table[] = { /* Make sure that /proc/sys/dev is there */ ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} -+ #else +- {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", + .maxlen = 0, + .mode = 0555, + .child = dslmod_table, + } -+ #endif , #endif /* CONFIG_PROC_FS */ {0} diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch index f6dba4be9..75de5a33e 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/200-2.6.37_args.patch @@ -1,28 +1,24 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -2009,7 +2009,11 @@ static int __init tn7atm_register (Tn7At +@@ -2003,7 +2003,7 @@ static int __init tn7atm_register (Tn7At dgprintf (4, "device %s being registered\n", priv->name); -+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37) - mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); -+ #else +- mydev = atm_dev_register (priv->proc_name, &tn7atm_ops, -1, NULL); + mydev = atm_dev_register (priv->proc_name, NULL, &tn7atm_ops, -1, NULL); -+ #endif if (mydev == NULL) { --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -512,14 +512,17 @@ int shim_osLoadFWImage(unsigned char *pt +@@ -499,13 +499,16 @@ int shim_osLoadFWImage(unsigned char *pt { const struct firmware *fw_entry; size_t size; + int ret; - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,30) dev_set_name(&avsar, "avsar"); - #endif + printk("requesting firmware image \"ar0700xx.bin\"\n"); - if(device_register(&avsar) < 0) { + dev_set_name(&avsar, "avsar"); diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch index 747869bf7..ef1ddd833 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/220-3.10-update_proc_code.patch @@ -125,7 +125,7 @@ Signed-off-by: Jonas Gorski #endif __SGAPI_H --- a/tn7atm.c +++ b/tn7atm.c -@@ -265,11 +265,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB +@@ -259,11 +259,9 @@ MODULE_PARM_DESC(oam_lb_timeout, "OAM LB #ifdef AR7_EFM extern void tn7dsl_disable_alarm(void); @@ -140,7 +140,7 @@ Signed-off-by: Jonas Gorski extern unsigned int g_efm_proc_ctl; extern struct net_device *mydev_efm; extern Tn7AtmPrivate *mypriv; -@@ -305,31 +303,17 @@ extern int tn7efm_register (Tn7AtmPrivat +@@ -299,31 +297,17 @@ extern int tn7efm_register (Tn7AtmPrivat static int tn7atm_irq_request (struct atm_dev *dev); #endif @@ -177,15 +177,7 @@ Signed-off-by: Jonas Gorski //CT - Added function to return chipset Id void tn7atm_get_chipsetId (char *pVerId); -@@ -456,78 +440,83 @@ const char drv_proc_root_folder[] = "ava - static struct proc_dir_entry *root_proc_dir_entry = NULL; - #define DRV_PROC_MODE 0644 - static int proc_root_already_exists = TRUE; -+ -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +@@ -453,75 +437,75 @@ static int proc_root_already_exists = TR static struct { const unsigned char name[32]; @@ -301,7 +293,7 @@ Signed-off-by: Jonas Gorski }; /* *INDENT-ON* */ -@@ -1811,76 +1800,81 @@ int tn7atm_receive (void *os_dev, int ch +@@ -1805,76 +1789,81 @@ int tn7atm_receive (void *os_dev, int ch return 0; } @@ -353,15 +345,15 @@ Signed-off-by: Jonas Gorski - return len; + return 0; -+} -+ -+static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); } -static int tn7atm_proc_private (char *buf, char **start, off_t offset, - int count, int *eof, void *data) ++static int tn7atm_proc_channels_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, tn7atm_proc_channels, PDE_DATA(inode)); ++} ++ +static struct file_operations tn7atm_proc_channels_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_channels_open, @@ -426,7 +418,7 @@ Signed-off-by: Jonas Gorski void tn7atm_sarhal_isr_register (void *os_dev, void *hal_isr, int interrupt_num) { -@@ -2033,10 +2027,8 @@ static int __init tn7atm_register (Tn7At +@@ -2023,10 +2012,8 @@ static int __init tn7atm_register (Tn7At return ATM_REG_OK; } @@ -438,7 +430,7 @@ Signed-off-by: Jonas Gorski char dslVer[8]; char dspVer[10]; char chipsetID[32]; //CT CQ10076 - Added temporary buffer to store chipset Id -@@ -2051,58 +2043,52 @@ static int tn7atm_proc_version (char *bu +@@ -2041,58 +2028,52 @@ static int tn7atm_proc_version (char *bu priv = mydev->dev_data; #ifdef AR7_EFM @@ -517,7 +509,7 @@ Signed-off-by: Jonas Gorski pdspV1, pdspV2, (priv->curr_TC_mode== TC_MODE_ATM) ? '*' : ' '); tn7sar_get_EFM_firmware_version (&pdspV1, &pdspV2); -@@ -2114,26 +2100,37 @@ static int tn7atm_proc_version (char *bu +@@ -2104,26 +2085,37 @@ static int tn7atm_proc_version (char *bu #endif str = "EFM"; @@ -531,16 +523,16 @@ Signed-off-by: Jonas Gorski tn7atm_get_chipsetId(chipsetID); - len += sprintf (buf + len, "Chipset ID: [%s]\n",chipsetID); + seq_printf (m, "Chipset ID: [%s]\n",chipsetID); -+ -+ return 0; -+} - return len; ++ return 0; + } + +static int tn7atm_proc_version_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7atm_proc_version, PDE_DATA(inode)); - } - ++} ++ +static struct file_operations tn7atm_proc_version_fops = { + .owner = THIS_MODULE, + .open = tn7atm_proc_version_open, @@ -560,7 +552,7 @@ Signed-off-by: Jonas Gorski int ctr; const char *residual; -@@ -2214,24 +2211,7 @@ static int __init tn7atm_detect (void) +@@ -2204,24 +2196,7 @@ static int __init tn7atm_detect (void) */ for (ctr = 0; ctr < (NUM_ELEMS (proc_if)); ctr++) { @@ -586,7 +578,7 @@ Signed-off-by: Jonas Gorski } tn7dsl_dslmod_sysctl_register (); -@@ -2711,73 +2691,18 @@ static int tn7atm_set_can_support_adsl2 +@@ -2701,73 +2676,18 @@ static int tn7atm_set_can_support_adsl2 return TRUE; } @@ -599,10 +591,10 @@ Signed-off-by: Jonas Gorski +static int tn7atm_proc_qos_read(struct seq_file *m, void *data) { - if (!de || !de->low_ino) +- return 0; +- if (de->namelen != len) + seq_printf (m, "\nEnableQoS = %d\n", EnableQoS); return 0; -- if (de->namelen != len) -- return 0; - return !strncmp (name, de->name, len); -} - @@ -665,7 +657,7 @@ Signed-off-by: Jonas Gorski } static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) -@@ -2812,7 +2737,7 @@ static int tn7atm_proc_qos_write(struct +@@ -2802,7 +2722,7 @@ static int tn7atm_proc_qos_write(struct } // [KT] @@ -674,7 +666,7 @@ Signed-off-by: Jonas Gorski { char local_buf[10]; -@@ -2843,5 +2768,33 @@ int tn7atm_proc_turbodsl_write(struct fi +@@ -2833,5 +2753,33 @@ int tn7atm_proc_turbodsl_write(struct fi return count; } @@ -710,17 +702,7 @@ Signed-off-by: Jonas Gorski module_exit (tn7atm_exit); --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -233,6 +233,9 @@ static struct led_funcs ledreg[2]; - - #define tn7dsl_kfree_skb(x) dev_kfree_skb(x) - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif - - //--------------------------------------------- - // Begin Clear EOC definitions -@@ -366,7 +369,7 @@ static void tn7dsl_register_dslss_led(vo +@@ -356,7 +356,7 @@ static void tn7dsl_register_dslss_led(vo void tn7dsl_dslmod_sysctl_register(void); void tn7dsl_dslmod_sysctl_unregister(void); static int tn7dsl_clear_eoc_receive(void); @@ -729,7 +711,7 @@ Signed-off-by: Jonas Gorski /* end of internal functions */ // UR8_MERGE_START CQ11054 Jack Zhang -@@ -698,11 +701,9 @@ void shim_osCriticalExit(void) +@@ -684,11 +684,9 @@ void shim_osCriticalExit(void) spin_unlock_irqrestore(&shimLock, flags); } @@ -742,7 +724,7 @@ Signed-off-by: Jonas Gorski int i, j; int bin = (int) data; unsigned short *rxSnrPerBin; -@@ -723,95 +724,128 @@ static int tn7dsl_proc_snr_print (char * +@@ -709,95 +707,128 @@ static int tn7dsl_proc_snr_print (char * break; default: @@ -915,7 +897,7 @@ Signed-off-by: Jonas Gorski #ifndef NO_ACT int tn7dsl_proc_ds_noise(char* buf, char **start, off_t offset, int count, int *eof, void *data) -@@ -874,59 +908,48 @@ static char *pUnknown= "Unknown"; +@@ -860,59 +891,48 @@ static char *pUnknown= "Unknown"; #ifdef ADV_DIAG_STATS //CQ10275, CQ10449 //UR8_MERGE_START CQ10449 Jack Zhang @@ -975,15 +957,15 @@ Signed-off-by: Jonas Gorski printk("proc_adv_stats - return: ctr=%d, len=%d\n", ctr, len); - return len; + return 0; - } - --static int proc_adv_stats_header(char* buf, int limit) ++} ++ + +static int tn7dsl_proc_adv_stats_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_adv_stats, PDE_DATA(inode)); -+} -+ + } + +-static int proc_adv_stats_header(char* buf, int limit) +struct file_operations tn7dsl_proc_adv_stats_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_adv_stats_open, @@ -996,7 +978,7 @@ Signed-off-by: Jonas Gorski { int len = 0; int i = 0; -@@ -935,66 +958,53 @@ static int proc_adv_stats_header(char* b +@@ -921,66 +941,53 @@ static int proc_adv_stats_header(char* b */ dslhal_api_gatherStatistics(pIhw); @@ -1084,7 +1066,7 @@ Signed-off-by: Jonas Gorski } static int getDiagDisplayMode() -@@ -1017,29 +1027,24 @@ static int getDiagDisplayMode() +@@ -1003,29 +1010,24 @@ static int getDiagDisplayMode() ret = 2; return ret; } @@ -1118,7 +1100,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1050,26 +1055,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch +@@ -1036,26 +1038,34 @@ int tn7dsl_proc_adv_stats1(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1161,7 +1143,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1079,12 +1092,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1065,12 +1075,10 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1176,7 +1158,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1095,26 +1106,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch +@@ -1081,26 +1089,35 @@ int tn7dsl_proc_adv_stats2(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1220,7 +1202,7 @@ Signed-off-by: Jonas Gorski int i; int mode = 0; //mode = 0 => ADSL1 or ADSL2 & 2+ unsigned char SNRpsds[512]; -@@ -1124,12 +1144,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1110,12 +1127,10 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if( mode==1) //ADSL1 { dslhal_api_gatherStatistics(pIhw); @@ -1235,7 +1217,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.BitAllocTblDstrm[i], (unsigned int)pIhw->AppData.marginTblDstrm[i], (int)pIhw->AppData.rxSnrPerBin0[i]); -@@ -1140,283 +1158,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch +@@ -1126,283 +1141,287 @@ int tn7dsl_proc_adv_stats3(char* buf, ch if (dslhal_api_getSNRpsds(pIhw, SNRpsds, 1)) { dgprintf(4, "dslhal_api_getSNRpsds failed!\n"); @@ -1455,9 +1437,7 @@ Signed-off-by: Jonas Gorski { + return single_open(file, tn7dsl_proc_dbg_rmsgs1, PDE_DATA(inode)); +} - -- int len = 0; -- int limit = count - 80; ++ +struct file_operations tn7dsl_proc_dbg_rmsgs1_fops = { + .owner = THIS_MODULE, + .open = tn7dsl_proc_dbg_rmsgs1_open, @@ -1465,7 +1445,9 @@ Signed-off-by: Jonas Gorski + .llseek = seq_lseek, + .release = single_release, +}; -+ + +- int len = 0; +- int limit = count - 80; + +int tn7dsl_proc_dbg_rmsgs2(struct seq_file *m, void *data) +{ @@ -1636,12 +1618,12 @@ Signed-off-by: Jonas Gorski - return len; + return 0; - } ++} + +static int tn7dsl_proc_dbg_rmsgs4_open(struct inode *inode, struct file *file) +{ + return single_open(file, tn7dsl_proc_dbg_rmsgs4, PDE_DATA(inode)); -+} + } + +struct file_operations tn7dsl_proc_dbg_rmsgs4_fops = { + .owner = THIS_MODULE, @@ -1664,7 +1646,7 @@ Signed-off-by: Jonas Gorski int F4count, F5count; unsigned int maxRate=0; unsigned int us_maxRate=0; -@@ -1424,80 +1446,58 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1410,80 +1429,58 @@ int tn7dsl_proc_stats(char* buf, char ** //UR8_MERGE_START CQ10700 Manjula K struct atm_dev *dev; Tn7AtmPrivate *priv; @@ -1768,7 +1750,7 @@ Signed-off-by: Jonas Gorski ((unsigned int) pIhw->AppData.usAtm_count[0] + (unsigned int) pIhw->AppData.usAtm_count[1]) * 48, ((unsigned int) pIhw->AppData.dsGood_count[0] + -@@ -1505,9 +1505,7 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1491,9 +1488,7 @@ int tn7dsl_proc_stats(char* buf, char ** /* * Superframe Count */ @@ -1779,7 +1761,7 @@ Signed-off-by: Jonas Gorski "\tUS Superframe Cnt :\t%u\tDS Superframe Cnt:\t%u\n", (unsigned int)pIhw->AppData.usSuperFrmCnt, (unsigned int)pIhw->AppData.dsSuperFrmCnt ); -@@ -1515,59 +1513,45 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1501,59 +1496,45 @@ int tn7dsl_proc_stats(char* buf, char ** /* * US and DS power */ @@ -1851,7 +1833,7 @@ Signed-off-by: Jonas Gorski (unsigned int)pIhw->AppData.currentHybridNum, trellis); //@Added Maximum attainable bit rate information. 05-14-2004 -@@ -1581,12 +1565,12 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1567,12 +1548,12 @@ int tn7dsl_proc_stats(char* buf, char ** } else { @@ -1866,7 +1848,7 @@ Signed-off-by: Jonas Gorski (unsigned char *) &rMsgsRA[0], 12); maxRate = (unsigned int)pIhw->AppData.DSConRate; -@@ -1602,294 +1586,223 @@ int tn7dsl_proc_stats(char* buf, char ** +@@ -1588,294 +1569,223 @@ int tn7dsl_proc_stats(char* buf, char ** } } @@ -2259,7 +2241,7 @@ Signed-off-by: Jonas Gorski char *state; int tag; -@@ -1923,22 +1836,31 @@ extern int tn7efm_get_currTCmode(void); +@@ -1909,22 +1819,31 @@ extern int tn7efm_get_currTCmode(void); if(pIhw->lConnected == 1) state = "SHOWTIME"; @@ -2301,7 +2283,7 @@ Signed-off-by: Jonas Gorski /********************************************************************** ** * ** tn7dsl_hdlc_update_crc() -- Calculate CRC * -@@ -2203,11 +2125,8 @@ static int tn7dsl_hdlc_rx_process(unsign +@@ -2189,11 +2108,8 @@ static int tn7dsl_hdlc_rx_process(unsign return(ret); } @@ -2314,7 +2296,7 @@ Signed-off-by: Jonas Gorski int offset[2] = {34, 0}; // point to buffer parameter data structure clearEocParm_t peoc; -@@ -2216,62 +2135,49 @@ int tn7dsl_proc_eoc (char *buf, char **s +@@ -2202,62 +2118,49 @@ int tn7dsl_proc_eoc (char *buf, char **s (unsigned char *) &peoc, sizeof (clearEocParm_t)); @@ -2417,7 +2399,7 @@ Signed-off-by: Jonas Gorski int tn7dsl_clear_eoc_setup(void) { int i; -@@ -4624,14 +4530,10 @@ int tn7dsl_proc_write_stats (struct file +@@ -4591,14 +4494,10 @@ int tn7dsl_proc_write_stats (struct file } @@ -2433,13 +2415,12 @@ Signed-off-by: Jonas Gorski typedef struct { -@@ -4712,197 +4614,185 @@ int tn7dsl_proc_train_mode_export (char +@@ -4679,197 +4578,185 @@ int tn7dsl_proc_train_mode_export (char } - if(len <= count) -+ for (i = 0; (i < num_entries) ; i++) - { +- { - for (i = ctr; ((i < num_entries)&& (len <= count)) ; i++) - { - /* @@ -2453,21 +2434,22 @@ Signed-off-by: Jonas Gorski - else - break; - } -+ seq_printf(m, "%s\t\t\t%#x\n", -+ dsl_modes[i].mode_name, dsl_modes[i].mode_value); - } - +- } +- - /* - * Data was completely written - */ - if (i >= num_entries) -- { ++ for (i = 0; (i < num_entries) ; i++) + { - /* - * We are done with this - */ - *eof = 1; - ctr = 0; -- } ++ seq_printf(m, "%s\t\t\t%#x\n", ++ dsl_modes[i].mode_name, dsl_modes[i].mode_value); + } - else - { - /* @@ -2475,7 +2457,7 @@ Signed-off-by: Jonas Gorski - * terminate the buffer. - */ - *(cp + len) = '\0'; -- + - /* - * Save the value of the counter for the next read for the rest of the - * data. @@ -2712,7 +2694,7 @@ Signed-off-by: Jonas Gorski } start = (indx -1) * 128; -@@ -4911,39 +4801,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char +@@ -4878,39 +4765,89 @@ static int tn7dsl_proc_HLINpsdsIndx(char { if (!(i%8)) { @@ -2817,7 +2799,7 @@ Signed-off-by: Jonas Gorski #endif #endif //TR69_HLIN_IN // UR8_MERGE_END CQ10979* -@@ -4951,64 +4891,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha +@@ -4918,64 +4855,48 @@ int tn7dsl_proc_HLINpsds4(char* buf, cha // * UR8_MERGE_START CQ11057 Jack Zhang #ifdef TR69_PMD_IN #ifndef NO_ADV_STATS @@ -2897,7 +2879,7 @@ Signed-off-by: Jonas Gorski } -@@ -5016,19 +4940,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** +@@ -4983,19 +4904,28 @@ int tn7dsl_proc_PMDus(char* buf, char ** for (i=0; iAppData.max_us_tones; i++) { if (!(i%16)) @@ -2937,15 +2919,11 @@ Signed-off-by: Jonas Gorski // * UR8_MERGE_END CQ11057 * --- a/tn7sar.c +++ b/tn7sar.c -@@ -1553,44 +1553,70 @@ int tn7sar_oam_generation(void *privCont +@@ -1547,44 +1547,66 @@ int tn7sar_oam_generation(void *privCont return 0; } -int tn7sar_proc_oam_ping(char* buf, char **start, off_t offset, int count,int *eof, void *data) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) -+#define PDE_DATA(inode) PDE(inode)->data -+#endif -+ +static int tn7sar_proc_oam_ping(struct seq_file *m, void *data) { - int len = 0; @@ -3020,7 +2998,7 @@ Signed-off-by: Jonas Gorski struct atm_dev *dev; Tn7AtmPrivate *priv; int i, j, k; -@@ -1599,21 +1625,19 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1593,21 +1615,19 @@ int tn7sar_proc_sar_stat(char* buf, char unsigned int *pStateBase, *pSarStat; HAL_FUNCTIONS *pHalFunc; HAL_DEVICE *pHalDev; @@ -3045,7 +3023,7 @@ Signed-off-by: Jonas Gorski k=0; for(j=0;j<4;j++) { -@@ -1626,26 +1650,16 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1620,26 +1640,18 @@ int tn7sar_proc_sar_stat(char* buf, char { if((char *)*pSarStat == NULL) break; @@ -3056,7 +3034,8 @@ Signed-off-by: Jonas Gorski - k += dBytes; - } + -+ k += seq_printf(m, "%s: ",(char *) *pSarStat); ++ seq_printf(m, "%s: ",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen(": "); pSarStat++; - if(len<=limit) - { @@ -3064,7 +3043,8 @@ Signed-off-by: Jonas Gorski - len += dBytes; - k += dBytes; - } -+ k += seq_printf(m, "%s; \n",(char *) *pSarStat); ++ seq_printf(m, "%s; \n",(char *) *pSarStat); ++ k += strlen((char *) *pSarStat) + strlen("; \n"); pSarStat++; if(k > 60) @@ -3076,7 +3056,7 @@ Signed-off-by: Jonas Gorski } } -@@ -1654,9 +1668,22 @@ int tn7sar_proc_sar_stat(char* buf, char +@@ -1648,9 +1660,22 @@ int tn7sar_proc_sar_stat(char* buf, char } } diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch index a29bae80a..c95c876c5 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/240-3.18_fixes.patch @@ -1,38 +1,38 @@ --- a/tn7dsl.c +++ b/tn7dsl.c -@@ -363,7 +363,7 @@ static void tn7dsl_chng_modulation(void* +@@ -350,7 +350,7 @@ static void tn7dsl_chng_modulation(void* static unsigned int tn7dsl_set_modulation(void* data, int flag); static void tn7dsl_ctrl_fineGain(int value); static void tn7dsl_set_fineGainValue(int value); --static int dslmod_sysctl (ctl_table * ctl, int write, struct file *filp, -+static int dslmod_sysctl (struct ctl_table * ctl, int write, struct file *filp, - void *buffer, size_t * lenp); +-static int dslmod_sysctl (ctl_table * ctl, int write, void *buffer, ++static int dslmod_sysctl (struct ctl_table * ctl, int write, void *buffer, + size_t * lenp, loff_t *ppos); static void tn7dsl_register_dslss_led(void); void tn7dsl_dslmod_sysctl_register(void); -@@ -3505,7 +3505,7 @@ unsigned int tn7dsl_get_memory(unsigned +@@ -3488,7 +3488,7 @@ unsigned int tn7dsl_get_memory(unsigned --static int dslmod_sysctl(ctl_table *ctl, int write, struct file * filp, -+static int dslmod_sysctl(struct ctl_table *ctl, int write, struct file * filp, - void *buffer, size_t *lenp) +-static int dslmod_sysctl(ctl_table *ctl, int write, void *buffer, ++static int dslmod_sysctl(struct ctl_table *ctl, int write, void *buffer, + size_t *lenp, loff_t *ppos) { char *ptr; -@@ -3631,7 +3631,7 @@ static int dslmod_sysctl(ctl_table *ctl, +@@ -3603,7 +3603,7 @@ static int dslmod_sysctl(ctl_table *ctl, } -ctl_table dslmod_table[] = { +struct ctl_table dslmod_table[] = { - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {DEV_DSLMOD, "dslmod", info, DSL_MOD_SIZE, 0644, NULL, NULL, &dslmod_sysctl, &sysctl_string} - #else -@@ -3649,7 +3649,7 @@ ctl_table dslmod_table[] = { + { + .procname = "dslmod", + .data = info, +@@ -3617,7 +3617,7 @@ ctl_table dslmod_table[] = { }; /* Make sure that /proc/sys/dev is there */ -ctl_table dslmod_root_table[] = { +struct ctl_table dslmod_root_table[] = { #ifdef CONFIG_PROC_FS - #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33) - {CTL_DEV, "dev", NULL, 0, 0555, dslmod_table} + { + .procname = "dev", diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch index bc913a78a..426d59319 100644 --- a/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/250-4.1_fixes.patch @@ -1,6 +1,6 @@ --- a/tn7atm.c +++ b/tn7atm.c -@@ -856,7 +856,7 @@ static int __init tn7atm_irq_request (st +@@ -845,7 +845,7 @@ static int __init tn7atm_irq_request (st priv->sar_irq = LNXINTNUM (ATM_SAR_INT); /* Interrupt line # */ @@ -9,7 +9,7 @@ printk ("Could not register tn7atm_sar_irq\n"); /* -@@ -880,7 +880,7 @@ static int __init tn7atm_irq_request (st +@@ -869,7 +869,7 @@ static int __init tn7atm_irq_request (st * Reigster Receive interrupt A */ priv->dsl_irq = LNXINTNUM (ATM_DSL_INT); /* Interrupt line # */ diff --git a/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch new file mode 100644 index 000000000..61a1ff7c8 --- /dev/null +++ b/package/kernel/ar7-atm/patches-D7.05.01.00/260-fix_function_signatures.patch @@ -0,0 +1,63 @@ +--- a/cpswhal_cpsar.h ++++ b/cpswhal_cpsar.h +@@ -437,10 +437,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/cpswhal_cpaal5.h ++++ b/cpswhal_cpaal5.h +@@ -436,10 +436,10 @@ typedef struct + int (*DeviceFindInfo)(int Inst, const char *DeviceName, void *DeviceInfo); + int (*DeviceFindParmUint)(void *DeviceInfo, const char *Parm, bit32u *Value); + int (*DeviceFindParmValue)(void *DeviceInfo, const char *Parm, void *Value); +- void (*Free)(void *MemPtr); ++ void (*Free)(const void *MemPtr); + void (*FreeRxBuffer)(OS_RECEIVEINFO *OsReceiveInfo, void *MemPtr); +- void (*FreeDev)(void *MemPtr); +- void (*FreeDmaXfer)(void *MemPtr); ++ void (*FreeDev)(const void *MemPtr); ++ void (*FreeDmaXfer)(const void *MemPtr); + void (*IsrRegister)(OS_DEVICE *OsDev, int (*halISR)(HAL_DEVICE*, int*), int InterruptBit); + void (*IsrUnRegister)(OS_DEVICE *OsDev, int InterruptBit); + void* (*Malloc)(bit32u size); +--- a/tn7atm.c ++++ b/tn7atm.c +@@ -2690,7 +2690,7 @@ static int tn7atm_proc_turbodsl_read(str + return 0; + } + +-static int tn7atm_proc_qos_write(struct file *fp, const char *buf, unsigned long count, void *data) ++static int tn7atm_proc_qos_write(struct file *fp, const char *buf, size_t count, loff_t *data) + { + char local_buf[32]; + +--- a/tn7dsl.c ++++ b/tn7dsl.c +@@ -1770,7 +1770,7 @@ static int tn7dsl_proc_stats_open(struct + return single_open(file, tn7dsl_proc_stats, PDE_DATA(inode)); + } + +-int tn7dsl_proc_write_stats(struct file *fp, const char * buf, unsigned long count, void * data); ++int tn7dsl_proc_write_stats(struct file *fp, const char * buf, size_t count, loff_t * data); + + struct file_operations tn7dsl_proc_stats_fops = { + .owner = THIS_MODULE, +@@ -4436,7 +4436,7 @@ int tn7dsl_generic_write( int offsetnum, + } + + int tn7dsl_proc_write_stats (struct file *fp, const char *buf, +- unsigned long count, void *data) ++ size_t count, loff_t *data) + { + char local_buf[31]; + int ret_val = 0; diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index a894773b7..82d7664b7 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -14,6 +14,7 @@ PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814 PKG_MAINTAINER:=Ben Greear PKG_BUILD_PARALLEL:=1 +PKG_EXTMOD_SUBDIRS:=ath10k # Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or # leave un-defined for 4.7 kernel. Probably this should match as closely as @@ -32,7 +33,7 @@ define KernelPackage/ath10k-ct FILES:=\ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \ $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko - AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci) + AUTOLOAD:=$(call AutoProbe,ath10k_pci) endef NOSTDINC_FLAGS = \ @@ -78,8 +79,7 @@ endif define Build/Compile +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ modules diff --git a/package/kernel/avila-wdt/Makefile b/package/kernel/avila-wdt/Makefile index 94bda9b8d..a91c93374 100644 --- a/package/kernel/avila-wdt/Makefile +++ b/package/kernel/avila-wdt/Makefile @@ -22,8 +22,7 @@ define KernelPackage/avila-wdt endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/kernel/broadcom-wl/Makefile b/package/kernel/broadcom-wl/Makefile index 2f3a0c5dc..d1d060451 100644 --- a/package/kernel/broadcom-wl/Makefile +++ b/package/kernel/broadcom-wl/Makefile @@ -22,6 +22,8 @@ ifeq ($(ARCH),mips) PKG_HASH:=ca6a86ca3e3e9c85b6dbb665b35bcbf338c37829c1b2f1994487d55664886045 endif +PKG_EXTMOD_SUBDIRS:=driver driver-mini glue + PKG_USE_MIPS16:=0 PKG_FLAGS:=nonshared @@ -41,7 +43,7 @@ define KernelPackage/brcm-wl/Default DEPENDS:=@TARGET_brcm47xx||TARGET_brcm63xx +wireless-tools TITLE:=Kernel driver for BCM43xx chipsets FILES:=$(PKG_BUILD_DIR)/driver$(1)/wl.ko $(PKG_BUILD_DIR)/glue/wl_glue.ko - AUTOLOAD:=$(call AutoLoad,30,wl_glue wl) + AUTOLOAD:=$(call AutoProbe,wl) endef define KernelPackage/brcm-wl/Default/description @@ -98,8 +100,7 @@ define Package/nas/description endef MAKE_KMOD := $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ PATH="$(TARGET_PATH)" \ SUBDIRS="$(PKG_BUILD_DIR)/kmod" \ @@ -110,23 +111,25 @@ define Build/Prepare endef define Build/Compile + # Compile glue driver + $(MAKE_KMOD) -C "$(LINUX_DIR)" \ + SUBDIRS="$(PKG_BUILD_DIR)/glue" \ + modules + # Compile the kernel part $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver" \ MODFLAGS="-DMODULE -mlong-calls" \ + KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \ modules $(MAKE_KMOD) \ SUBDIRS="$(PKG_BUILD_DIR)/driver-mini" \ MODFLAGS="-DMODULE -mlong-calls" \ BUILD_TYPE="wl_apsta_mini" \ + KBUILD_EXTRA_SYMBOLS="$(PKG_BUILD_DIR)/glue/Module.symvers" \ modules - # Compile glue driver - $(MAKE_KMOD) -C "$(LINUX_DIR)" \ - SUBDIRS="$(PKG_BUILD_DIR)/glue" \ - modules - # Compile libshared $(MAKE) -C $(PKG_BUILD_DIR)/shared \ $(TARGET_CONFIGURE_OPTS) \ diff --git a/package/kernel/button-hotplug/Makefile b/package/kernel/button-hotplug/Makefile index 7b6aacfbf..2554ae61d 100644 --- a/package/kernel/button-hotplug/Makefile +++ b/package/kernel/button-hotplug/Makefile @@ -36,8 +36,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch b/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch new file mode 100644 index 000000000..605d303c4 --- /dev/null +++ b/package/kernel/dtc/patches/0001-scripts-dtc-Update-to-version-with-overlays.patch @@ -0,0 +1,642 @@ +From 5f84cb93eef9f8a8ff7f49d593893f252744d0fe Mon Sep 17 00:00:00 2001 +From: Pantelis Antoniou +Date: Wed, 26 Aug 2015 18:28:08 +0300 +Subject: [PATCH] scripts/dtc: Update to version with overlays + +Update to mainline dtc with overlay support + +Signed-off-by: Pantelis Antoniou +--- + checks.c | 20 +++++- + dtc-lexer.l | 5 ++ + dtc-parser.y | 54 ++++++++++++++-- + dtc.c | 83 ++++++++++++++++++++++-- + dtc.h | 13 +++- + livetree.c | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + treesource.c | 3 + + util.c | 2 +- + 8 files changed, 367 insertions(+), 15 deletions(-) + +diff --git a/checks.c b/checks.c +index 3bf0fa4..af25c2b 100644 +--- a/checks.c ++++ b/checks.c +@@ -465,8 +465,12 @@ static void fixup_phandle_references(struct check *c, struct node *dt, + + refnode = get_node_by_ref(dt, m->ref); + if (! refnode) { +- FAIL(c, "Reference to non-existent node or label \"%s\"\n", +- m->ref); ++ if (!source_is_plugin) ++ FAIL(c, "Reference to non-existent node or " ++ "label \"%s\"\n", m->ref); ++ else /* mark the entry as unresolved */ ++ *((cell_t *)(prop->val.val + m->offset)) = ++ cpu_to_fdt32(0xffffffff); + continue; + } + +@@ -559,7 +563,7 @@ static void check_reg_format(struct check *c, struct node *dt, + size_cells = node_size_cells(node->parent); + entrylen = (addr_cells + size_cells) * sizeof(cell_t); + +- if ((prop->val.len % entrylen) != 0) ++ if (!entrylen || (prop->val.len % entrylen) != 0) + FAIL(c, "\"reg\" property in %s has invalid length (%d bytes) " + "(#address-cells == %d, #size-cells == %d)", + node->fullpath, prop->val.len, addr_cells, size_cells); +@@ -651,6 +655,15 @@ static void check_obsolete_chosen_interrupt_controller(struct check *c, + } + TREE_WARNING(obsolete_chosen_interrupt_controller, NULL); + ++static void check_deprecated_plugin_syntax(struct check *c, ++ struct node *dt) ++{ ++ if (deprecated_plugin_syntax_warning) ++ FAIL(c, "Use '/dts-v1/ /plugin/'; syntax. /dts-v1/; /plugin/; " ++ "is going to be removed in next versions"); ++} ++TREE_WARNING(deprecated_plugin_syntax, NULL); ++ + static struct check *check_table[] = { + &duplicate_node_names, &duplicate_property_names, + &node_name_chars, &node_name_format, &property_name_chars, +@@ -668,6 +681,7 @@ static struct check *check_table[] = { + + &avoid_default_addr_size, + &obsolete_chosen_interrupt_controller, ++ &deprecated_plugin_syntax, + + &always_fail, + }; +diff --git a/dtc-lexer.l b/dtc-lexer.l +index 0ee1caf..dd44ba2 100644 +--- a/dtc-lexer.l ++++ b/dtc-lexer.l +@@ -113,6 +113,11 @@ static void lexical_error(const char *fmt, ...); + return DT_V1; + } + ++<*>"/plugin/" { ++ DPRINT("Keyword: /plugin/\n"); ++ return DT_PLUGIN; ++ } ++ + <*>"/memreserve/" { + DPRINT("Keyword: /memreserve/\n"); + BEGIN_DEFAULT(); +diff --git a/dtc-parser.y b/dtc-parser.y +index ea57e0a..7d9652d 100644 +--- a/dtc-parser.y ++++ b/dtc-parser.y +@@ -19,6 +19,7 @@ + */ + %{ + #include ++#include + + #include "dtc.h" + #include "srcpos.h" +@@ -52,9 +53,11 @@ extern bool treesource_error; + struct node *nodelist; + struct reserve_info *re; + uint64_t integer; ++ bool is_plugin; + } + + %token DT_V1 ++%token DT_PLUGIN + %token DT_MEMRESERVE + %token DT_LSHIFT DT_RSHIFT DT_LE DT_GE DT_EQ DT_NE DT_AND DT_OR + %token DT_BITS +@@ -71,6 +74,7 @@ extern bool treesource_error; + + %type propdata + %type propdataprefix ++%type plugindecl + %type memreserve + %type memreserves + %type arrayprefix +@@ -101,10 +105,39 @@ extern bool treesource_error; + %% + + sourcefile: +- DT_V1 ';' memreserves devicetree ++ basesource ++ | pluginsource ++ ; ++ ++basesource: ++ DT_V1 ';' plugindecl memreserves devicetree ++ { ++ source_is_plugin = $3; ++ if (source_is_plugin) ++ deprecated_plugin_syntax_warning = true; ++ the_boot_info = build_boot_info($4, $5, ++ guess_boot_cpuid($5)); ++ } ++ ; ++ ++plugindecl: ++ /* empty */ ++ { ++ $$ = false; ++ } ++ | DT_PLUGIN ';' ++ { ++ $$ = true; ++ } ++ ; ++ ++pluginsource: ++ DT_V1 DT_PLUGIN ';' memreserves devicetree + { +- the_boot_info = build_boot_info($3, $4, +- guess_boot_cpuid($4)); ++ source_is_plugin = true; ++ deprecated_plugin_syntax_warning = false; ++ the_boot_info = build_boot_info($4, $5, ++ guess_boot_cpuid($5)); + } + ; + +@@ -144,10 +177,14 @@ devicetree: + { + struct node *target = get_node_by_ref($1, $2); + +- if (target) ++ if (target) { + merge_nodes(target, $3); +- else +- ERROR(&@2, "Label or path %s not found", $2); ++ } else { ++ if (symbol_fixup_support) ++ add_orphan_node($1, $3, $2); ++ else ++ ERROR(&@2, "Label or path %s not found", $2); ++ } + $$ = $1; + } + | devicetree DT_DEL_NODE DT_REF ';' +@@ -162,6 +199,11 @@ devicetree: + + $$ = $1; + } ++ | /* empty */ ++ { ++ /* build empty node */ ++ $$ = name_node(build_node(NULL, NULL), ""); ++ } + ; + + nodedef: +diff --git a/dtc.c b/dtc.c +index 8c4add6..ee37be9 100644 +--- a/dtc.c ++++ b/dtc.c +@@ -18,6 +18,8 @@ + * USA + */ + ++#include ++ + #include "dtc.h" + #include "srcpos.h" + +@@ -29,6 +31,8 @@ int reservenum; /* Number of memory reservation slots */ + int minsize; /* Minimum blob size */ + int padsize; /* Additional padding to blob */ + int phandle_format = PHANDLE_BOTH; /* Use linux,phandle or phandle properties */ ++int symbol_fixup_support; ++int auto_label_aliases; + + static void fill_fullpaths(struct node *tree, const char *prefix) + { +@@ -51,7 +55,7 @@ static void fill_fullpaths(struct node *tree, const char *prefix) + #define FDT_VERSION(version) _FDT_VERSION(version) + #define _FDT_VERSION(version) #version + static const char usage_synopsis[] = "dtc [options] "; +-static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv"; ++static const char usage_short_opts[] = "qI:O:o:V:d:R:S:p:fb:i:H:sW:E:@Ahv"; + static struct option const usage_long_opts[] = { + {"quiet", no_argument, NULL, 'q'}, + {"in-format", a_argument, NULL, 'I'}, +@@ -69,6 +73,8 @@ static struct option const usage_long_opts[] = { + {"phandle", a_argument, NULL, 'H'}, + {"warning", a_argument, NULL, 'W'}, + {"error", a_argument, NULL, 'E'}, ++ {"symbols", no_argument, NULL, '@'}, ++ {"auto-alias", no_argument, NULL, 'A'}, + {"help", no_argument, NULL, 'h'}, + {"version", no_argument, NULL, 'v'}, + {NULL, no_argument, NULL, 0x0}, +@@ -99,16 +105,63 @@ static const char * const usage_opts_help[] = { + "\t\tboth - Both \"linux,phandle\" and \"phandle\" properties", + "\n\tEnable/disable warnings (prefix with \"no-\")", + "\n\tEnable/disable errors (prefix with \"no-\")", ++ "\n\tEnable symbols/fixup support", ++ "\n\tEnable auto-alias of labels", + "\n\tPrint this help and exit", + "\n\tPrint version and exit", + NULL, + }; + ++static const char *guess_type_by_name(const char *fname, const char *fallback) ++{ ++ const char *s; ++ ++ s = strrchr(fname, '.'); ++ if (s == NULL) ++ return fallback; ++ if (!strcasecmp(s, ".dts")) ++ return "dts"; ++ if (!strcasecmp(s, ".dtb")) ++ return "dtb"; ++ return fallback; ++} ++ ++static const char *guess_input_format(const char *fname, const char *fallback) ++{ ++ struct stat statbuf; ++ uint32_t magic; ++ FILE *f; ++ ++ if (stat(fname, &statbuf) != 0) ++ return fallback; ++ ++ if (S_ISDIR(statbuf.st_mode)) ++ return "fs"; ++ ++ if (!S_ISREG(statbuf.st_mode)) ++ return fallback; ++ ++ f = fopen(fname, "r"); ++ if (f == NULL) ++ return fallback; ++ if (fread(&magic, 4, 1, f) != 1) { ++ fclose(f); ++ return fallback; ++ } ++ fclose(f); ++ ++ magic = fdt32_to_cpu(magic); ++ if (magic == FDT_MAGIC) ++ return "dtb"; ++ ++ return guess_type_by_name(fname, fallback); ++} ++ + int main(int argc, char *argv[]) + { + struct boot_info *bi; +- const char *inform = "dts"; +- const char *outform = "dts"; ++ const char *inform = NULL; ++ const char *outform = NULL; + const char *outname = "-"; + const char *depname = NULL; + bool force = false, sort = false; +@@ -186,7 +239,12 @@ int main(int argc, char *argv[]) + case 'E': + parse_checks_option(false, true, optarg); + break; +- ++ case '@': ++ symbol_fixup_support = 1; ++ break; ++ case 'A': ++ auto_label_aliases = 1; ++ break; + case 'h': + usage(NULL); + default: +@@ -213,6 +271,17 @@ int main(int argc, char *argv[]) + fprintf(depfile, "%s:", outname); + } + ++ if (inform == NULL) ++ inform = guess_input_format(arg, "dts"); ++ if (outform == NULL) { ++ outform = guess_type_by_name(outname, NULL); ++ if (outform == NULL) { ++ if (streq(inform, "dts")) ++ outform = "dtb"; ++ else ++ outform = "dts"; ++ } ++ } + if (streq(inform, "dts")) + bi = dt_from_source(arg); + else if (streq(inform, "fs")) +@@ -236,6 +305,12 @@ int main(int argc, char *argv[]) + if (sort) + sort_tree(bi); + ++ if (symbol_fixup_support || auto_label_aliases) ++ generate_label_node(bi->dt, bi->dt); ++ ++ if (symbol_fixup_support) ++ generate_fixups_node(bi->dt, bi->dt); ++ + if (streq(outname, "-")) { + outf = stdout; + } else { +diff --git a/dtc.h b/dtc.h +index 56212c8..d025111 100644 +--- a/dtc.h ++++ b/dtc.h +@@ -20,7 +20,7 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + */ +- ++#define _GNU_SOURCE + #include + #include + #include +@@ -54,6 +54,14 @@ extern int reservenum; /* Number of memory reservation slots */ + extern int minsize; /* Minimum blob size */ + extern int padsize; /* Additional padding to blob */ + extern int phandle_format; /* Use linux,phandle or phandle properties */ ++extern int symbol_fixup_support;/* enable symbols & fixup support */ ++extern int auto_label_aliases; /* auto generate labels -> aliases */ ++ ++/* ++ * Tree source globals ++ */ ++extern bool source_is_plugin; ++extern bool deprecated_plugin_syntax_warning; + + #define PHANDLE_LEGACY 0x1 + #define PHANDLE_EPAPR 0x2 +@@ -194,6 +202,7 @@ struct node *build_node_delete(void); + struct node *name_node(struct node *node, char *name); + struct node *chain_node(struct node *first, struct node *list); + struct node *merge_nodes(struct node *old_node, struct node *new_node); ++void add_orphan_node(struct node *old_node, struct node *new_node, char *ref); + + void add_property(struct node *node, struct property *prop); + void delete_property_by_name(struct node *node, char *name); +@@ -244,6 +253,8 @@ struct boot_info { + struct boot_info *build_boot_info(struct reserve_info *reservelist, + struct node *tree, uint32_t boot_cpuid_phys); + void sort_tree(struct boot_info *bi); ++void generate_label_node(struct node *node, struct node *dt); ++void generate_fixups_node(struct node *node, struct node *dt); + + /* Checks */ + +diff --git a/livetree.c b/livetree.c +index e229b84..1ef9fc4 100644 +--- a/livetree.c ++++ b/livetree.c +@@ -216,6 +216,34 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node) + return old_node; + } + ++void add_orphan_node(struct node *dt, struct node *new_node, char *ref) ++{ ++ static unsigned int next_orphan_fragment = 0; ++ struct node *ovl = xmalloc(sizeof(*ovl)); ++ struct property *p; ++ struct data d = empty_data; ++ char *name; ++ int ret; ++ ++ memset(ovl, 0, sizeof(*ovl)); ++ ++ d = data_add_marker(d, REF_PHANDLE, ref); ++ d = data_append_integer(d, 0xffffffff, 32); ++ ++ p = build_property("target", d); ++ add_property(ovl, p); ++ ++ ret = asprintf(&name, "fragment@%u", ++ next_orphan_fragment++); ++ if (ret == -1) ++ die("asprintf() failed\n"); ++ name_node(ovl, name); ++ name_node(new_node, "__overlay__"); ++ ++ add_child(dt, ovl); ++ add_child(ovl, new_node); ++} ++ + struct node *chain_node(struct node *first, struct node *list) + { + assert(first->next_sibling == NULL); +@@ -709,3 +737,177 @@ void sort_tree(struct boot_info *bi) + sort_reserve_entries(bi); + sort_node(bi->dt); + } ++ ++void generate_label_node(struct node *node, struct node *dt) ++{ ++ struct node *c, *an; ++ struct property *p; ++ struct label *l; ++ int has_label; ++ char *gen_node_name; ++ ++ if (auto_label_aliases) ++ gen_node_name = "aliases"; ++ else ++ gen_node_name = "__symbols__"; ++ ++ /* Make sure the label isn't already there */ ++ has_label = 0; ++ for_each_label(node->labels, l) { ++ has_label = 1; ++ break; ++ } ++ ++ if (has_label) { ++ ++ /* an is the aliases/__symbols__ node */ ++ an = get_subnode(dt, gen_node_name); ++ /* if no node exists, create it */ ++ if (!an) { ++ an = build_node(NULL, NULL); ++ name_node(an, gen_node_name); ++ add_child(dt, an); ++ } ++ ++ /* now add the label in the node */ ++ for_each_label(node->labels, l) { ++ /* check whether the label already exists */ ++ p = get_property(an, l->label); ++ if (p) { ++ fprintf(stderr, "WARNING: label %s already" ++ " exists in /%s", l->label, ++ gen_node_name); ++ continue; ++ } ++ ++ /* insert it */ ++ p = build_property(l->label, ++ data_copy_escape_string(node->fullpath, ++ strlen(node->fullpath))); ++ add_property(an, p); ++ } ++ ++ /* force allocation of a phandle for this node */ ++ if (symbol_fixup_support) ++ (void)get_node_phandle(dt, node); ++ } ++ ++ for_each_child(node, c) ++ generate_label_node(c, dt); ++} ++ ++static void add_fixup_entry(struct node *dt, struct node *node, ++ struct property *prop, struct marker *m) ++{ ++ struct node *fn; /* local fixup node */ ++ struct property *p; ++ char *fixups_name = "__fixups__"; ++ struct data d; ++ char *entry; ++ int ret; ++ ++ /* fn is the node we're putting entries in */ ++ fn = get_subnode(dt, fixups_name); ++ /* if no node exists, create it */ ++ if (!fn) { ++ fn = build_node(NULL, NULL); ++ name_node(fn, fixups_name); ++ add_child(dt, fn); ++ } ++ ++ ret = asprintf(&entry, "%s:%s:%u", ++ node->fullpath, prop->name, m->offset); ++ if (ret == -1) ++ die("asprintf() failed\n"); ++ ++ p = get_property(fn, m->ref); ++ d = data_append_data(p ? p->val : empty_data, entry, strlen(entry) + 1); ++ if (!p) ++ add_property(fn, build_property(m->ref, d)); ++ else ++ p->val = d; ++} ++ ++static void add_local_fixup_entry(struct node *dt, struct node *node, ++ struct property *prop, struct marker *m, ++ struct node *refnode) ++{ ++ struct node *lfn, *wn, *nwn; /* local fixup node, walk node, new */ ++ struct property *p; ++ struct data d; ++ char *local_fixups_name = "__local_fixups__"; ++ char *s, *e, *comp; ++ int len; ++ ++ /* fn is the node we're putting entries in */ ++ lfn = get_subnode(dt, local_fixups_name); ++ /* if no node exists, create it */ ++ if (!lfn) { ++ lfn = build_node(NULL, NULL); ++ name_node(lfn, local_fixups_name); ++ add_child(dt, lfn); ++ } ++ ++ /* walk the path components creating nodes if they don't exist */ ++ comp = NULL; ++ /* start skipping the first / */ ++ s = node->fullpath + 1; ++ wn = lfn; ++ while (*s) { ++ /* retrieve path component */ ++ e = strchr(s, '/'); ++ if (e == NULL) ++ e = s + strlen(s); ++ len = e - s; ++ comp = xrealloc(comp, len + 1); ++ memcpy(comp, s, len); ++ comp[len] = '\0'; ++ ++ /* if no node exists, create it */ ++ nwn = get_subnode(wn, comp); ++ if (!nwn) { ++ nwn = build_node(NULL, NULL); ++ name_node(nwn, strdup(comp)); ++ add_child(wn, nwn); ++ } ++ wn = nwn; ++ ++ /* last path component */ ++ if (!*e) ++ break; ++ ++ /* next path component */ ++ s = e + 1; ++ } ++ free(comp); ++ ++ p = get_property(wn, prop->name); ++ d = data_append_cell(p ? p->val : empty_data, (cell_t)m->offset); ++ if (!p) ++ add_property(wn, build_property(prop->name, d)); ++ else ++ p->val = d; ++} ++ ++void generate_fixups_node(struct node *node, struct node *dt) ++{ ++ struct node *c; ++ struct property *prop; ++ struct marker *m; ++ struct node *refnode; ++ ++ for_each_property(node, prop) { ++ m = prop->val.markers; ++ for_each_marker_of_type(m, REF_PHANDLE) { ++ refnode = get_node_by_ref(dt, m->ref); ++ if (!refnode) ++ add_fixup_entry(dt, node, prop, m); ++ else ++ add_local_fixup_entry(dt, node, prop, m, ++ refnode); ++ } ++ } ++ ++ for_each_child(node, c) ++ generate_fixups_node(c, dt); ++} +diff --git a/treesource.c b/treesource.c +index a55d1d1..e1d6657 100644 +--- a/treesource.c ++++ b/treesource.c +@@ -28,6 +28,9 @@ extern YYLTYPE yylloc; + struct boot_info *the_boot_info; + bool treesource_error; + ++bool source_is_plugin; ++bool deprecated_plugin_syntax_warning; ++ + struct boot_info *dt_from_source(const char *fname) + { + the_boot_info = NULL; +diff --git a/util.c b/util.c +index 9d65226..cbb945b 100644 +--- a/util.c ++++ b/util.c +@@ -349,7 +349,6 @@ int utilfdt_decode_type(const char *fmt, int *type, int *size) + void utilfdt_print_data(const char *data, int len) + { + int i; +- const char *p = data; + const char *s; + + /* no data, don't print */ +@@ -376,6 +375,7 @@ void utilfdt_print_data(const char *data, int len) + i < (len - 1) ? " " : ""); + printf(">"); + } else { ++ const unsigned char *p = (const unsigned char *)data; + printf(" = ["); + for (i = 0; i < len; i++) + printf("%02x%s", *p++, i < len - 1 ? " " : ""); +-- +2.7.0 + diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile index 8f836a841..216d23b76 100644 --- a/package/kernel/gpio-button-hotplug/Makefile +++ b/package/kernel/gpio-button-hotplug/Makefile @@ -33,8 +33,7 @@ define KernelPackage/gpio-button-hotplug/description endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/kernel/gpio-nct5104d/Makefile b/package/kernel/gpio-nct5104d/Makefile index b43291e5a..33352388c 100644 --- a/package/kernel/gpio-nct5104d/Makefile +++ b/package/kernel/gpio-nct5104d/Makefile @@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/hwmon-gsc/Makefile b/package/kernel/hwmon-gsc/Makefile index 1892e027c..3888a2f17 100644 --- a/package/kernel/hwmon-gsc/Makefile +++ b/package/kernel/hwmon-gsc/Makefile @@ -20,8 +20,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \ modules diff --git a/package/kernel/i2c-gpio-custom/Makefile b/package/kernel/i2c-gpio-custom/Makefile index fb3f3bf17..d1123cc3f 100644 --- a/package/kernel/i2c-gpio-custom/Makefile +++ b/package/kernel/i2c-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index 5f57433d6..ff27e9517 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2017-12-07 -PKG_SOURCE_VERSION:=49776da5b93f03c8548e26f2d7982d553d1d226c -PKG_MIRROR_HASH:=d7bc6c333b43f6ff100a4b1d4593a18686fcdd6fd28a3aae55ea8bdad868b67f +PKG_SOURCE_DATE:=2017-12-22 +PKG_SOURCE_VERSION:=5bf0b6596721e18269ee4bae6e3549c75cba923a +PKG_MIRROR_HASH:=95c0f886a3ad8ccfd7b35fa19af8b5ecbf0b2f74caea73fbabd6574f1c3be2db include $(INCLUDE_DIR)/package.mk diff --git a/package/kernel/lantiq/ltq-adsl-mei/Makefile b/package/kernel/lantiq/ltq-adsl-mei/Makefile index 91c798418..08e577577 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-adsl-mei/Makefile @@ -23,8 +23,8 @@ define KernelPackage/ltq-adsl-mei-template URL:=http://www.lantiq.com/ VARIANT:=$(1) DEPENDS:=@$(2) - FILES:=$(PKG_BUILD_DIR)/ltq_mei_$(1).ko - AUTOLOAD:=$(call AutoLoad,50,ltq_mei_$(1)) + FILES:=$(PKG_BUILD_DIR)/drv_mei_cpe.ko + AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe) endef KernelPackage/ltq-adsl-danube-mei=$(call KernelPackage/ltq-adsl-mei-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy)) diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/Makefile b/package/kernel/lantiq/ltq-adsl-mei/src/Makefile index 2d8645f8f..9a3b89195 100644 --- a/package/kernel/lantiq/ltq-adsl-mei/src/Makefile +++ b/package/kernel/lantiq/ltq-adsl-mei/src/Makefile @@ -1,17 +1,13 @@ ifeq ($(BUILD_VARIANT),danube) CFLAGS_MODULE = -DCONFIG_DANUBE -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_danube.o - ltq_mei_danube-objs = lantiq_mei.o endif ifeq ($(BUILD_VARIANT),ase) CFLAGS_MODULE = -DCONFIG_AMAZON_SE -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_ase.o - ltq_mei_ase-objs = lantiq_mei.o endif ifeq ($(BUILD_VARIANT),ar9) CFLAGS_MODULE = -DCONFIG_AR9 -DCONFIG_IFXMIPS_DSL_CPE_MEI - obj-m = ltq_mei_ar9.o - ltq_mei_ar9-objs = lantiq_mei.o endif + +obj-m = drv_mei_cpe.o diff --git a/package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c b/package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c similarity index 100% rename from package/kernel/lantiq/ltq-adsl-mei/src/lantiq_mei.c rename to package/kernel/lantiq/ltq-adsl-mei/src/drv_mei_cpe.c diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile index 7f4c197fe..5d63983d2 100644 --- a/package/kernel/lantiq/ltq-atm/Makefile +++ b/package/kernel/lantiq/ltq-atm/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-atm -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/ltq-atm-$(BUILD_VARIANT) PKG_MAINTAINER:=John Crispin @@ -24,17 +24,12 @@ define KernelPackage/ltq-atm-template VARIANT:=$(1) DEPENDS:=@$(2) +kmod-atm +br2684ctl FILES:=$(PKG_BUILD_DIR)/ltq_atm_$(1).ko - AUTOLOAD:=$(call AutoProbe,ltq_atm_$(1)) endef -KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy)) -KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway) -KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase) - -define KernelPackage/ltq-atm-vr9 - $(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200) - AUTOLOAD:= -endef +KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy) +kmod-ltq-adsl-danube-mei) +KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway +kmod-ltq-adsl-ar9-mei) +KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase +kmod-ltq-adsl-ase-mei) +KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei) define Build/Configure endef diff --git a/package/kernel/lantiq/ltq-ifxos/Makefile b/package/kernel/lantiq/ltq-ifxos/Makefile index 05663de2c..a0891be3e 100644 --- a/package/kernel/lantiq/ltq-ifxos/Makefile +++ b/package/kernel/lantiq/ltq-ifxos/Makefile @@ -8,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=lib_ifxos PKG_VERSION:=1.5.19 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_SOURCE_URL:=https://github.com/xdarklight/$(PKG_NAME)/archive/v$(PKG_VERSION) @@ -34,8 +34,6 @@ define KernelPackage/ltq-ifxos AUTOLOAD:=$(call AutoLoad,10,drv_ifxos) endef -MAKE_FLAGS+=-s - CONFIGURE_ARGS += \ ARCH=$(LINUX_KARCH) \ --enable-linux-26 \ diff --git a/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch new file mode 100644 index 000000000..dee3482e4 --- /dev/null +++ b/package/kernel/lantiq/ltq-ifxos/patches/200-Fix-app-compilation-failure-from-inclusion-of-wrong-.patch @@ -0,0 +1,59 @@ +From 7d52945b0b261c54ec736ecc435936c5fb8b81a4 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Thu, 30 Nov 2017 11:07:12 +0800 +Subject: [PATCH] Fix app compilation failure from inclusion of wrong headers + +Compiling against glibc can fail with the following errors + + In file included from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl-linux.h:321:0, + from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/bits/fcntl.h:104, + from /home/stefan/Router/o26431-vmmc_v5/source/staging_dir/toolchain-mips_24kc_gcc-5.5.0_glibc/include/fcntl.h:35, + from linux/ifxos_linux_device_access_appl.c:30: + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:12:2: error: unknown type name '__s16' + __s16 l_type; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:13:2: error: unknown type name '__s16' + __s16 l_whence; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:14:2: error: unknown type name '__s64' + __s64 l_start; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:15:2: error: unknown type name '__s64' + __s64 l_len; /* len == 0 means until end of file */ + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:16:2: error: unknown type name '__s32' + __s32 l_sysid; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:17:2: error: unknown type name '__u32' + __u32 l_pid; + ^ + /home/stefan/Router/o26431-vmmc_v5/source/build_dir/target-mips_24kc_glibc/linux-lantiq_xrx200/linux-4.9.65/include/linux/falloc.h:18:2: error: unknown type name '__s32' + __s32 l_pad[4]; /* reserved area */ + ^ + Makefile:1945: recipe for target 'libifxos_a-ifxos_linux_device_access_appl.o' failed + +Ref: https://bugs.lede-project.org/index.php?do=details&task_id=1196 +--- + src/Makefile.am | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/Makefile.am b/src/Makefile.am +index f95668f..d232e7f 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -14,11 +14,7 @@ lib_LIBRARIES = libifxos.a + + AM_CPPFLAGS = \ + -I@srcdir@\ +- -I@srcdir@/include \ +- -I@KERNEL_INCL_PATH@ \ +- -I@KERNEL_BUILD_PATH@/include \ +- -I@KERNEL_BUILD_PATH@/include2 \ +- -I$(TARGET_INCL_PATH) ++ -I@srcdir@/include + + if HAVE_GCC + +-- +1.8.3.1 + diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile index d0743cda3..13831a2b6 100644 --- a/package/kernel/lantiq/ltq-ptm/Makefile +++ b/package/kernel/lantiq/ltq-ptm/Makefile @@ -24,6 +24,14 @@ define KernelPackage/ltq-ptm-template URL:=http://www.lantiq.com/ VARIANT:=$(1) DEPENDS:=@TARGET_lantiq_$(2) +ifeq ($(1),vr9) + DEPENDS+= +kmod-ltq-vdsl-vr9-mei +else + DEPENDS+= +kmod-ltq-adsl-$(1)-mei +endif +ifeq ($(1),ase) + DEPENDS+=@BROKEN +endif FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko endef diff --git a/package/kernel/lantiq/ltq-vdsl-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-mei/Makefile index 76bf3e957..96bbc98c7 100644 --- a/package/kernel/lantiq/ltq-vdsl-mei/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-mei/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-vr9-mei PKG_VERSION:=1.5.17.6 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_BASE_NAME:=drv_mei_cpe PKG_SOURCE:=$(PKG_BASE_NAME)-$(PKG_VERSION).tar.gz diff --git a/package/kernel/lantiq/ltq-vdsl/Makefile b/package/kernel/lantiq/ltq-vdsl/Makefile index 042e6080b..3b085ed8a 100644 --- a/package/kernel/lantiq/ltq-vdsl/Makefile +++ b/package/kernel/lantiq/ltq-vdsl/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-vr9 PKG_VERSION:=4.17.18.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BASE_NAME:=drv_dsl_cpe_api PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz diff --git a/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch b/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch new file mode 100644 index 000000000..12c00c33e --- /dev/null +++ b/package/kernel/lantiq/ltq-vdsl/patches/110-semaphore-lock.patch @@ -0,0 +1,107 @@ +--- a/src/include/drv_dsl_cpe_pm_core.h ++++ b/src/include/drv_dsl_cpe_pm_core.h +@@ -1510,9 +1510,9 @@ typedef struct + /** Common PM module mutex*/ + DSL_DRV_Mutex_t pmMutex; + /** PM module direction Near-End mutex*/ +- DSL_DRV_Mutex_t pmNeMutex; ++ struct semaphore pmNeMutex; + /** PM module direction Far-End mutex*/ +- DSL_DRV_Mutex_t pmFeMutex; ++ struct semaphore pmFeMutex; + /** PM module Near-End access mutex*/ + DSL_DRV_Mutex_t pmNeAccessMutex; + /** PM module Far-End access mutex*/ +--- a/src/pm/drv_dsl_cpe_api_pm.c ++++ b/src/pm/drv_dsl_cpe_api_pm.c +@@ -220,9 +220,9 @@ DSL_Error_t DSL_DRV_PM_Start( + /* init PM module common mutex */ + DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmMutex); + /* init PM module direction Near-End mutex */ +- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex),1); + /* init PM module direction Far-End mutex */ +- DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ sema_init(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex),1); + /* init PM module Near-End access mutex */ + DSL_DRV_MUTEX_INIT(DSL_DRV_PM_CONTEXT(pContext)->pmNeAccessMutex); + /* init PM module Far-End access mutex */ +@@ -592,7 +592,7 @@ DSL_Error_t DSL_DRV_PM_Stop( + if( DSL_DRV_PM_CONTEXT(pContext)->pmThreadFe.bRun != DSL_TRUE ) + { + DSL_DEBUG(DSL_DBG_WRN, +- (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Near-End thread already stopped" ++ (pContext, SYS_DBG_WRN"DSL[%02d]: PM module Far-End thread already stopped" + DSL_DRV_CRLF, DSL_DEV_NUM(pContext))); + } + else +--- a/src/pm/drv_dsl_cpe_pm_core.c ++++ b/src/pm/drv_dsl_cpe_pm_core.c +@@ -1022,7 +1022,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + { + if( bLock ) + { +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!" +@@ -1034,14 +1034,14 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + else + { + /* Unlock PM module NE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)); + } + } + else + { + if( bLock ) + { +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!" +@@ -1053,7 +1053,7 @@ DSL_Error_t DSL_DRV_PM_DirectionMutexCon + else + { + /* Unlock PM module FE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)); + } + } + +@@ -1139,7 +1139,7 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_ + if( !(DSL_DRV_PM_CONTEXT(pContext)->bPmLock) ) + { + /* Lock PM module Near-End Mutex*/ +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex) ) ++ if(down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex))) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM NE mutex!" +@@ -1148,8 +1148,8 @@ DSL_Error_t DSL_DRV_PM_Lock(DSL_Context_ + return DSL_ERR_SEMAPHORE_GET; + } + +- /* Lock PM module Near-End Mutex*/ +- if( DSL_DRV_MUTEX_LOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex) ) ++ /* Lock PM module Far-End Mutex*/ ++ if( down_interruptible(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)) ) + { + DSL_DEBUG( DSL_DBG_ERR, + (pContext, SYS_DBG_ERR"DSL[%02d]: ERROR - Couldn't lock PM FE mutex!" +@@ -1193,10 +1193,10 @@ DSL_Error_t DSL_DRV_PM_UnLock(DSL_Contex + if( DSL_DRV_PM_CONTEXT(pContext)->bPmLock ) + { + /* Unlock PM module NE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmNeMutex)); + + /* Unlock PM module FE Mutex*/ +- DSL_DRV_MUTEX_UNLOCK(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex); ++ up(&(DSL_DRV_PM_CONTEXT(pContext)->pmFeMutex)); + + /* Clear bPmLock flag*/ + DSL_DRV_PM_CONTEXT(pContext)->bPmLock = DSL_FALSE; diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile index ab0ef727b..e42d5c071 100644 --- a/package/kernel/lantiq/ltq-vmmc/Makefile +++ b/package/kernel/lantiq/ltq-vmmc/Makefile @@ -27,7 +27,7 @@ define KernelPackage/ltq-vmmc SUBMENU:=Voice over IP TITLE:=TAPI LL driver for Voice Macro URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_falcon||TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi + DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xrx200) +kmod-ltq-tapi FILES:=$(PKG_BUILD_DIR)/src/drv_vmmc.ko AUTOLOAD:=$(call AutoProbe,drv_vmmc) endef diff --git a/package/kernel/leds-apu2/Makefile b/package/kernel/leds-apu2/Makefile index bab2315b0..08aca1750 100644 --- a/package/kernel/leds-apu2/Makefile +++ b/package/kernel/leds-apu2/Makefile @@ -37,8 +37,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/leds-apu2/src/leds-apu2.c b/package/kernel/leds-apu2/src/leds-apu2.c index 0a60df1bc..4ea552cf5 100644 --- a/package/kernel/leds-apu2/src/leds-apu2.c +++ b/package/kernel/leds-apu2/src/leds-apu2.c @@ -228,21 +228,21 @@ static struct platform_driver gpio_apu2_driver = { }; static struct gpio_led apu2_leds_gpio[] = { - { - .name = "apu2:green:power", - .gpio = 509, - .active_low = 1, - }, - { - .name = "apu2:green:led2", - .gpio = 510, - .active_low = 1, - }, - { - .name = "apu2:green:led3", - .gpio = 511, - .active_low = 1, - }, + { + .name = "apu2:green:power", + .gpio = 509, + .active_low = 1, + }, + { + .name = "apu2:green:led2", + .gpio = 510, + .active_low = 1, + }, + { + .name = "apu2:green:led3", + .gpio = 511, + .active_low = 1, + }, }; static struct gpio_keys_button apu2_gpio_keys[] = { @@ -332,7 +332,10 @@ static int __init gpio_apu2_init (void) const char *board_name = dmi_get_system_info(DMI_BOARD_NAME); /* Match the device name/model */ - if (!board_name || !board_vendor || strcasecmp(board_vendor, "PC Engines") || strcasecmp(board_name, "apu2")) { + if (!board_name \ + || !board_vendor \ + || strcasecmp(board_vendor, "PC Engines") \ + || (strcasecmp(board_name, "apu2") && strcasecmp(board_name, "apu3"))) { err = -ENODEV; goto exit; } diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index b05552006..bc56b3cc1 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -191,7 +191,7 @@ $(eval $(call KernelPackage,crypto-seqiv)) define KernelPackage/crypto-hw-talitos TITLE:=Freescale integrated security engine (SEC) driver - DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc + DEPENDS:=+kmod-crypto-manager +kmod-crypto-hash +kmod-random-core +kmod-crypto-authenc +kmod-crypto-des KCONFIG:= \ CONFIG_CRYPTO_HW=y \ CONFIG_CRYPTO_DEV_TALITOS \ diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk index 1c7869e7c..973e4f3e2 100644 --- a/package/kernel/linux/modules/other.mk +++ b/package/kernel/linux/modules/other.mk @@ -242,9 +242,9 @@ $(eval $(call KernelPackage,gpio-mcp23s08)) define KernelPackage/gpio-nxp-74hc164 SUBMENU:=$(OTHER_MENU) TITLE:=NXP 74HC164 GPIO expander support - KCONFIG:=CONFIG_GPIO_NXP_74HC164 - FILES:=$(LINUX_DIR)/drivers/gpio/nxp_74hc164.ko - AUTOLOAD:=$(call AutoProbe,nxp_74hc164) + KCONFIG:=CONFIG_GPIO_74X164 + FILES:=$(LINUX_DIR)/drivers/gpio/gpio-74x164.ko + AUTOLOAD:=$(call AutoProbe,gpio-74x164) endef define KernelPackage/gpio-nxp-74hc164/description diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index d1fb5f4cd..08e3bf699 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -894,7 +894,7 @@ define KernelPackage/usb-storage-uas DEPENDS:=+kmod-usb-storage KCONFIG:=CONFIG_USB_UAS FILES:=$(LINUX_DIR)/drivers/usb/storage/uas.ko - AUTOLOAD:=$(call AutoProbe,uas) + AUTOLOAD:=$(call AutoProbe,uas,1) endef define KernelPackage/usb-storage-uas/description diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 7e9b5ad61..385bea4d2 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2017-10-06 +PKG_VERSION:=2017-11-01 PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_HASH:=194786b7635f36b9ce280fd2319f6a4feeff209175e330ddbcbe789a3b4540a5 +PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) @@ -87,7 +87,7 @@ endef define KernelPackage/cfg80211 $(call KernelPackage/mac80211/Default) TITLE:=cfg80211 - wireless configuration API - DEPENDS+= +iw + DEPENDS+= +iw +wireless-regdb FILES:= \ $(PKG_BUILD_DIR)/compat/compat.ko \ $(PKG_BUILD_DIR)/net/wireless/cfg80211.ko @@ -320,7 +320,7 @@ define KernelPackage/ath10k FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko - AUTOLOAD:=$(call AutoLoad,55,ath10k_core ath10k_pci) + AUTOLOAD:=$(call AutoProbe,ath10k_pci) endef define KernelPackage/ath10k/description @@ -742,6 +742,7 @@ define KernelPackage/brcmfmac/config config BRCMFMAC_SDIO bool "Enable SDIO bus interface support" default y if TARGET_brcm2708 + default y if TARGET_sunxi default n help Enable support for cards attached to an SDIO bus. @@ -1516,7 +1517,6 @@ config-y:= \ WLAN \ NL80211_TESTMODE \ CFG80211_WEXT \ - CFG80211_INTERNAL_REGDB \ CFG80211_CERTIFICATION_ONUS \ MAC80211_RC_MINSTREL \ MAC80211_RC_MINSTREL_HT \ @@ -1568,7 +1568,7 @@ config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_C config-$(call config_package,airo) += AIRO -config-$(call config_package,ath) += ATH_CARDS ATH_COMMON +config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED @@ -1742,7 +1742,6 @@ define Build/Prepare $(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version - $(CP) ./files/regdb.txt $(PKG_BUILD_DIR)/net/wireless/db.txt endef ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index ebd24df0d..cdc155405 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -522,6 +522,12 @@ mac80211_setup_supplicant() { wpa_supplicant_run "$ifname" ${hostapd_ctrl:+-H $hostapd_ctrl} } +mac80211_setup_supplicant_noctl() { + wpa_supplicant_prepare_interface "$ifname" nl80211 || return 1 + wpa_supplicant_add_network "$ifname" "$freq" "$htmode" + wpa_supplicant_run "$ifname" +} + mac80211_setup_adhoc_htmode() { case "$htmode" in VHT20|HT20) ibss_htmode=HT20;; @@ -631,7 +637,8 @@ mac80211_setup_vif() { authsae_start_interface || failed=1 else wireless_vif_parse_encryption - mac80211_setup_supplicant || failed=1 + freq="$(get_freq "$phy" "$channel")" + mac80211_setup_supplicant_noctl || failed=1 fi else json_get_vars mesh_id mcast_rate @@ -688,7 +695,8 @@ mac80211_setup_vif() { wireless_vif_parse_encryption mac80211_setup_adhoc_htmode if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then - mac80211_setup_supplicant || failed=1 + freq="$(get_freq "$phy" "$channel")" + mac80211_setup_supplicant_noctl || failed=1 else mac80211_setup_adhoc fi diff --git a/package/kernel/mac80211/files/regdb.txt b/package/kernel/mac80211/files/regdb.txt deleted file mode 100644 index d58388760..000000000 --- a/package/kernel/mac80211/files/regdb.txt +++ /dev/null @@ -1,1314 +0,0 @@ -# This is the world regulatory domain -country 00: - (2402 - 2472 @ 40), (20) - # Channel 12 - 13. - (2457 - 2482 @ 20), (20), NO-IR, AUTO-BW - # Channel 14. Only JP enables this and for 802.11b only - (2474 - 2494 @ 20), (20), NO-IR, NO-OFDM - # Channel 36 - 48 - (5170 - 5250 @ 80), (20), AUTO-BW - # Channel 52 - 64 - (5250 - 5330 @ 80), (20), NO-IR, DFS, AUTO-BW - # Channel 100 - 144 - (5490 - 5730 @ 160), (20), NO-IR, DFS - # Channel 149 - 165 - (5735 - 5835 @ 80), (20), NO-IR - # IEEE 802.11ad (60GHz), channels 1..3 - (57240 - 63720 @ 2160), (0) - - -country AD: - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20) - (5250 - 5330 @ 80), (20), DFS - (5490 - 5710 @ 80), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country AE: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://pucanguilla.org/Downloads/January2005-Anguilla%20Table%20of%20Allocations.pdf -country AI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20.00), AUTO-BW - (5250 - 5330 @ 80), (20.00), DFS, AUTO-BW - (5490 - 5710 @ 160), (27.00), DFS - -country AM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (18) - (5250 - 5330 @ 20), (18), DFS - -country AN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AS: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country AT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# https://www.legislation.gov.au/Details/F2016C00432 -# Both DFS-ETSI and DFS-FCC are acceptable per AS/NZS 4268 Appendix B. -# The EIRP for DFS bands can be increased by 3dB if TPC is implemented. -# In order to allow 80MHz operation between 5650-5730MHz the upper boundary -# of this more restrictive band has been shifted up by 5MHz from 5725MHz. -country AU: DFS-ETSI - (2400 - 2483.5 @ 40), (36) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, AUTO-BW, DFS - (5470 - 5600 @ 80), (27), DFS - (5650 - 5730 @ 80), (27), DFS - (5730 - 5850 @ 80), (36) - (57000 - 66000 @ 2160), (43), NO-OUTDOOR - -country AW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country AZ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (18), AUTO-BW - (5250 - 5330 @ 80), (18), DFS, AUTO-BW - -country BA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country BB: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country BD: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country BE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country BF: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Bulgarian rules as defined by the Communications Regulation Commission in the -# following documents: -# -# Rules for carrying out electronic communications through radio equipment using -# radio spectrum, which does not need to be individually assigned (the Rules): -# http://www.crc.bg/files/_bg/Pravila_09_06_2015.pdf -# -# List of radio equipment that uses harmonized within the European Union bands -# and electronic communications terminal equipment (the List): -# http://www.crc.bg/files/_bg/Spisak_2015.pdf -# -# Note: The transmit power limits in the 5250-5350 MHz and 5470-5725 MHz bands -# can be raised by 3 dBm if TPC is enabled. Refer to BDS EN 301 893 for details. -country BG: DFS-ETSI - # Wideband data transmission systems (WDTS) in the 2.4GHz ISM band, ref: - # I.22 of the List, BDS EN 300 328 - (2402 - 2482 @ 40), (20) - # 5 GHz Radio Local Area Networks (RLANs), ref: - # II.H01 of the List, BDS EN 301 893 - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - # II.H01 of the List, I.54 from the List, BDS EN 301 893 - (5490 - 5710 @ 160), (27), DFS - # Short range devices (SRDs) in the 5725-5875 MHz frequency range, ref: - # I.43 of the List, BDS EN 300 440-2, BDS EN 300 440-1 - (5725 - 5875 @ 80), (14) - # 60 GHz Multiple-Gigabit RLAN Systems, ref: - # II.H03 of the List, BDS EN 302 567-2 - (57000 - 66000 @ 2160), (40), NO-OUTDOOR - -country BH: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (20) - (5250 - 5330 @ 20), (20), DFS - (5735 - 5835 @ 20), (20) - -country BL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country BN: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country BO: DFS-JP - (2402 - 2482 @ 40), (20) - (5250 - 5330 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - -country BR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country BS: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.bicma.gov.bt/paper/publication/nrrpart4.pdf -country BT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BY: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country BZ: DFS-JP - (2402 - 2482 @ 40), (30) - (5735 - 5835 @ 80), (30) - -country CA: DFS-FCC - (2402 - 2472 @ 40), (30) - (5150 - 5250 @ 80), (23), AUTO-BW - (5250 - 5350 @ 80), (24), DFS, AUTO-BW - (5470 - 5600 @ 80), (24), DFS - (5650 - 5730 @ 80), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.art-rca.org -country CF: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (17) - (5250 - 5330 @ 40), (24), DFS - (5490 - 5730 @ 40), (24), DFS - (5735 - 5835 @ 40), (30) - -country CH: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country CI: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CL: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country CN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1,4: 28dBm, channels 2,3: 44dBm - # ref: http://www.miit.gov.cn/n11293472/n11505629/n11506593/n11960250/n11960606/n11960700/n12330791.files/n12330790.pdf - (57240 - 59400 @ 2160), (28) - (59400 - 63720 @ 2160), (44) - (63720 - 65880 @ 2160), (28) - -country CO: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CR: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -# http://www.mincom.gob.cu/?q=marcoregulatorio -# - Redes Informáticas -# Resolución 127, 2011 - Reglamento Banda 2,4 GHz. -country CU: DFS-FCC - (2400 - 2483.5 @ 40), (200 mW) - -country CX: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country CY: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Data from http://www.ctu.eu/164/download/VOR/VOR-12-08-2005-34.pdf -# and http://www.ctu.eu/164/download/VOR/VOR-12-05-2007-6-AN.pdf -# Power at 5250 - 5350 MHz and 5470 - 5725 MHz can be doubled if TPC is -# implemented. -country CZ: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Allocation for the 2.4 GHz band (Vfg 10 / 2013, Allgemeinzuteilung von -# Frequenzen für die Nutzung in lokalen Netzwerken; Wireless Local Area -# Networks (WLAN-Funkanwendungen). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2013_10_WLAN_2,4GHz_pdf.pdf -# -# Allocation for the 5 GHz band (Vfg. 7 / 2010, Allgemeinzuteilung von -# Frequenzen in den Bereichen 5150 MHz - 5350 MHz und 5470 MHz - 5725 MHz für -# Funkanwendungen zur breitbandigen Datenübertragung, WAS/WLAN („Wireless -# Access Systems including Wireless Local Area Networks“). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2010_07_WLAN_5GHz_pdf.pdf -# The values for the 5 GHz have been reduced by a factor of 2 (3db) for non TPC -# devices (in other words: devices with TPC can use twice the tx power of this -# table). Note that the docs do not require TPC for 5150--5250; the reduction -# to 100mW thus is not strictly required -- however the conservative 100mW -# limit is used here as the non-interference with radar and satellite -# apps relies on the attenuation by the building walls only in the -# absence of DFS; the neighbour countries have 100mW limit here as well. -# -# The ETSI EN 300 440-1 standard for short range devices in the 5 GHz band has -# been implemented in Germany: -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2014_69_SRD_pdf.pdf -# -# Allocation for the 60 GHz band (Allgemeinzuteilung von Frequenzen im -# Bereich 57 GHz - 66 GHz für Funkanwendungen für weitbandige -# Datenübertragungssysteme; „Multiple Gigabit WAS/RLAN Systems (MGWS)“). -# https://www.bundesnetzagentur.de/SharedDocs/Downloads/DE/Sachgebiete/Telekommunikation/Unternehmen_Institutionen/Frequenzen/Allgemeinzuteilungen/2011_08_MGWS_pdf.pdf - -country DE: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (100 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # short range devices (ETSI EN 300 440-1) - (5725 - 5875 @ 80), (25 mW) - # 60 GHz band channels 1-4 (ETSI EN 302 567) - (57000 - 66000 @ 2160), (40) - -country DK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# http://www.ntrcdom.org/index.php?option=com_content&view=category&layout=blog&id=10&Itemid=55 -country DM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country DO: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country DZ: DFS-JP - (2402 - 2482 @ 40), (20) - (5170.000 - 5250.000 @ 80.000), (23.00), AUTO-BW - (5250.000 - 5330.000 @ 80.000), (23.00), DFS, AUTO-BW - (5490.000 - 5670.000 @ 160.000), (23.00), DFS - -country EC: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -country EE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country EG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - -# Orden IET/787/2013, de 25 de abril, por la que se aprueba -# el cuadro nacional de atribución de frecuencias. -# http://www.boe.es/diario_boe/txt.php?id=BOE-A-2013-4845 -# -# more info at "Cuadro nacional de atribución de frecuencias (CNAF)": -# http://www.minetur.gob.es/telecomunicaciones/espectro/paginas/cnaf.aspx - -country ES: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (100 mW), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (500 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country ET: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country FI: DFS-ETSI - (2400 - 2483.5 @ 40), (20) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country FM: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country FR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GB: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GD: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country GE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (18), AUTO-BW - (5250 - 5330 @ 80), (18), DFS, AUTO-BW - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country GL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GP: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country GR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country GT: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country GU: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -country GY: - (2402 - 2482 @ 40), (30) - (5735 - 5835 @ 80), (30) - -country HK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5710 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HR: DFS-ETSI - (2400 - 2483.5 @ 40), (20) - (5150 - 5250 @ 80), (23), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5470 - 5725 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country HT: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country HU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country ID: DFS-JP - # ref: http://www.postel.go.id/content/ID/regulasi/standardisasi/kepdir/bwa%205,8%20ghz.pdf - (2402 - 2482 @ 20), (20) - (5735 - 5815 @ 20), (23) - -country IE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country IL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5150 - 5250 @ 80), (200 mW), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (200 mW), NO-OUTDOOR, DFS, AUTO-BW - -country IN: - (2402 - 2482 @ 40), (20) - (5150 - 5350 @ 160), (23) - (5725 - 5875 @ 80), (23) - -country IR: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country IS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country IT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country JM: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country JO: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23) - (5735 - 5835 @ 80), (23) - -country JP: DFS-JP - (2402 - 2482 @ 40), (20) - (2474 - 2494 @ 20), (20), NO-OFDM - (4910 - 4990 @ 40), (23) - (5030 - 5090 @ 40), (23) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (23), DFS - # 60 GHz band channels 2-4 at 10mW, - # ref: http://www.arib.or.jp/english/html/overview/doc/1-STD-T74v1_1.pdf - (59000 - 66000 @ 2160), (10 mW) - -country KE: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23) - (5490 - 5570 @ 80), (30), DFS - (5735 - 5775 @ 40), (23) - -country KH: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source -# http://ntrc.kn/?page_id=7 -country KN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5815 @ 80), (30) - -country KP: DFS-JP - (2402 - 2482 @ 20), (20) - (5170 - 5250 @ 20), (20) - (5250 - 5330 @ 20), (20), DFS - (5490 - 5630 @ 20), (30), DFS - (5735 - 5815 @ 20), (30) - -country KR: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1-4, - # ref: http://www.law.go.kr/%ED%96%89%EC%A0%95%EA%B7%9C%EC%B9%99/%EB%AC%B4%EC%84%A0%EC%84%A4%EB%B9%84%EA%B7%9C%EC%B9%99 - (57000 - 66000 @ 2160), (43) - -country KW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country KY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country KZ: - (2402 - 2482 @ 40), (20) - -country LB: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.ntrc.org.lc/operational_structures.htm -country LC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30), DFS - (5735 - 5815 @ 80), (30) - -country LI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country LK: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (24), DFS - (5490 - 5730 @ 20), (24), DFS - (5735 - 5835 @ 20), (30) - -# Source: -# http://lca.org.ls/images/documents/lesotho_national_frequency_allocation_plan.pdf -country LS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country LT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country LU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country LV: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country MC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.cnfr.md/index.php?pag=sec&id=117&l=en -country MD: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.cept.org/files/1050/Tools%20and%20Services/EFIS%20-%20ECO%20Frequency%20Information%20System/National%20frequency%20tables/Montenegro%20NAFT%20-%202010.pdf -country ME: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MH: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MO: DFS-FCC - (2402 - 2482 @ 40), (23) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5490 - 5730 @ 160), (30), DFS - (5735 - 5835 @ 80), (30) - -country MP: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MQ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# http://www.are.mr/pdfs/telec_freq_TNAbf_2010.pdf -country MR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country MU: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.cam.gov.mv/docs/tech_standards/TAM-TS-100-2004-WLAN.pdf -country MV: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), AUTO-BW - (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW - (5725 - 5850 @ 80), (100 mW) - -country MW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country MX: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country MY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5650 @ 160), (24), DFS - (5735 - 5835 @ 80), (24) - -country NG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5250 - 5330 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - -country NI: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Regulation on the use of frequency space without a license and -# without notification 2015 -# -# http://wetten.overheid.nl/BWBR0036378/2015-03-05 - -country NL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW - (5250 - 5330 @ 80), (20), NO-OUTDOOR, DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # short range devices (ETSI EN 300 440-1) - (5725 - 5875 @ 80), (25 mW) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Data from http://www.lovdata.no/dokument/SF/forskrift/2012-01-19-77 -# Power at 5250 - 5350 MHz, 5470 - 5725 MHz and 5815 – 5850 MHz can -# be doubled if TPC is implemented. -# Up to 2W (or 4W with TPC) is allowed in the 5725 – 5795 MHz band -# which has been merged with 5470 - 5725 MHz to allow wide channels -country NO: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5250 @ 80), (200 mW), AUTO-BW - (5250 - 5350 @ 80), (100 mW), DFS, AUTO-BW - (5470 - 5795 @ 160), (500 mW), DFS - (5815 - 5850 @ 35), (2000 mW), DFS - (17100 - 17300 @ 200), (100 mW) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country NP: DFS-JP - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5735 - 5835 @ 80), (20) - -country NZ: DFS-ETSI - (2402 - 2482 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country OM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PA: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country PE: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PK: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country PL: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country PM: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country PR: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country PW: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country PY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country QA: DFS-JP - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -country RE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country RO: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - - -# Source: -# http://www.ratel.rs/upload/documents/Plan_namene/Plan_namene-sl_glasnik.pdf -country RS: DFS-ETSI - (2400 - 2483.5 @ 40), (100 mW) - (5150 - 5350 @ 40), (200 mW), NO-OUTDOOR - (5470 - 5725 @ 20), (1000 mW), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country RU: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5650 - 5730 @ 80), (30), DFS - (5735 - 5835 @ 80), (30) - # 60 GHz band channels 1-4, ref: Changes to NLA 124_Order â„–129_22042015.pdf - (57000 - 66000 @ 2160), (40) - -country RW: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country SE: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country SG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SI: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country SK: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -# Source: -# Regulation N° 2004-005 ART/DG/DRC/D.Rég -country SN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country SR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country SV: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 20), (17) - (5250 - 5330 @ 20), (23), DFS - (5735 - 5835 @ 20), (30) - -country SY: - (2402 - 2482 @ 40), (20) - -# Source: -# http://www.telecommission.tc/Spectrum-plan20110324-101210.html -country TC: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country TD: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country TG: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - (5490 - 5710 @ 40), (27), DFS - -country TH: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country TN: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -country TR: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country TT: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# Table of Frequency Allocations of Republic of China (Taiwan) / Nov 2014: -# http://www.motc.gov.tw/websitedowndoc?file=post/201411171137330.doc& \ -# filedisplay=Table+of+radio+frequency+allocation.doc -# LP0002 Low-power Radio-frequency Devices Technical Regulations / 28 Jun 2011: -# http://www.ncc.gov.tw/english/show_file.aspx?table_name=news&file_sn=681 -# (section 3.10.1, 4.7) -country TW: DFS-FCC - (2400 - 2483.5 @ 40), (30) - # Follow US 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients - (5150 - 5250 @ 80), (23), AUTO-BW - (5250 - 5350 @ 80), (23), DFS, AUTO-BW - (5470 - 5725 @ 160), (23), DFS - (5725 - 5850 @ 80), (30) - -country TZ: - (2402 - 2482 @ 40), (20) - (5735 - 5835 @ 80), (30) - -# Source: -# #914 / 06 Sep 2007: http://www.ucrf.gov.ua/uk/doc/nkrz/1196068874 -# #1174 / 23 Oct 2008: http://www.nkrz.gov.ua/uk/activities/ruling/1225269361 -# (appendix 8) -# Listed 5GHz range is a lowest common denominator for all related -# rules in the referenced laws. Such a range is used because of -# disputable definitions there. -country UA: DFS-ETSI - (2400 - 2483.5 @ 40), (20), NO-OUTDOOR - (5150 - 5250 @ 80), (20), NO-OUTDOOR, AUTO-BW - (5250 - 5350 @ 80), (20), DFS, NO-OUTDOOR, AUTO-BW - (5490 - 5670 @ 160), (20), DFS - (5735 - 5835 @ 80), (20) - # 60 GHz band channels 1-4, ref: Etsi En 302 567 - (57000 - 66000 @ 2160), (40) - -country UG: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country US: DFS-FCC - (2402 - 2472 @ 40), (30) - # 5.15 ~ 5.25 GHz: 30 dBm for master mode, 23 dBm for clients - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5490 - 5730 @ 160), (23), DFS - (5735 - 5835 @ 80), (30) - # 60g band - # reference: http://cfr.regstoday.com/47cfr15.aspx#47_CFR_15p255 - # channels 1,2,3, EIRP=40dBm(43dBm peak) - (57240 - 63720 @ 2160), (40) - -country UY: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -# Source: -# http://cemc.uz/article/1976/ -country UZ: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - -# Source: -# http://www.ntrc.vc/regulations/Jun_2006_Spectrum_Managment_Regulations.pdf -country VC: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -# Source: -# Official Gazette (Gaceta Oficial) concerning Unlicensed transmitter use -# (10 June 2013) -# http://www.conatel.gob.ve/ -country VE: DFS-FCC - (2402 - 2482 @ 40), (30) - (5170 - 5250 @ 80), (23), AUTO-BW - (5250 - 5330 @ 80), (23), DFS, AUTO-BW - (5735 - 5835 @ 80), (30) - -country VI: DFS-FCC - (2402 - 2472 @ 40), (30) - (5170 - 5250 @ 80), (24), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country VN: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17) - (5250 - 5330 @ 80), (24), DFS - (5490 - 5730 @ 80), (24), DFS - (5735 - 5835 @ 80), (30) - -# Source: -# http://www.trr.vu/attachments/category/130/GURL_for_Short-range_Radiocommunication_Devices2.pdf -country VU: DFS-FCC - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (17), AUTO-BW - (5250 - 5330 @ 80), (24), DFS, AUTO-BW - (5490 - 5730 @ 160), (24), DFS - (5735 - 5835 @ 80), (30) - -country WF: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country WS: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 40), (20) - (5250 - 5330 @ 40), (20), DFS - (5490 - 5710 @ 40), (27), DFS - -country YE: - (2402 - 2482 @ 40), (20) - -country YT: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - -country ZA: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (30) - -country ZW: DFS-ETSI - (2402 - 2482 @ 40), (20) - (5170 - 5250 @ 80), (20), AUTO-BW - (5250 - 5330 @ 80), (20), DFS, AUTO-BW - (5490 - 5710 @ 160), (27), DFS - diff --git a/package/kernel/mac80211/patches/005-revert-devcoredump.patch b/package/kernel/mac80211/patches/005-revert-devcoredump.patch index 1216b9957..d485d9558 100644 --- a/package/kernel/mac80211/patches/005-revert-devcoredump.patch +++ b/package/kernel/mac80211/patches/005-revert-devcoredump.patch @@ -1,11 +1,11 @@ --- a/compat/Makefile +++ b/compat/Makefile -@@ -39,8 +39,6 @@ compat-$(CPTCFG_KERNEL_4_10) += backport - - compat-$(CPTCFG_BPAUTO_BUILD_CRYPTO_CCM) += crypto-ccm.o - compat-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += crypto-skcipher.o +@@ -70,8 +70,6 @@ quiet_cmd_build_OID_registry = GEN $ + cmd_build_OID_registry = perl $(src)/build_OID_registry $< $@ + compat-$(CPTCFG_BPAUTO_ASN1_DECODER) += lib-asn1_decoder.o + compat-$(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) += lib-oid_registry.o -skcipher-objs += crypto-skcipher.o -obj-$(CPTCFG_BPAUTO_CRYPTO_SKCIPHER) += skcipher.o - compat-$(CPTCFG_BPAUTO_BUILD_WANT_DEV_COREDUMP) += drivers-base-devcoredump.o compat-$(CPTCFG_BPAUTO_RHASHTABLE) += lib-rhashtable.o cordic-objs += lib-cordic.o + obj-$(CPTCFG_BPAUTO_BUILD_CORDIC) += cordic.o diff --git a/package/kernel/mac80211/patches/006-fix-genl-multicast.patch b/package/kernel/mac80211/patches/006-fix-genl-multicast.patch new file mode 100644 index 000000000..42fd3e827 --- /dev/null +++ b/package/kernel/mac80211/patches/006-fix-genl-multicast.patch @@ -0,0 +1,10 @@ +--- a/compat/backport-4.12.c ++++ b/compat/backport-4.12.c +@@ -225,6 +225,7 @@ int bp_extack_genl_register_family(struc + + /* copy this since the family might access it directly */ + family->attrbuf = copy->family.attrbuf; ++ family->mcgrp_offset = copy->family.mcgrp_offset; + + mutex_lock(&copies_mutex); + list_add_tail(©->list, &copies_list); diff --git a/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch b/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch new file mode 100644 index 000000000..4011f1d3b --- /dev/null +++ b/package/kernel/mac80211/patches/007-fix-linux-verification-h.patch @@ -0,0 +1,11 @@ +--- a/backport-include/linux/verification.h ++++ b/backport-include/linux/verification.h +@@ -1,7 +1,7 @@ + #ifndef __BP_VERIFICATION_H + #define __BP_VERIFICATION_H + #include +-#ifndef CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION ++#if LINUX_VERSION_IS_GEQ(4,7,0) && !defined(CPTCFG_BPAUTO_BUILD_SYSTEM_DATA_VERIFICATION) + #include_next + #else + #include diff --git a/package/kernel/mac80211/patches/008-fix-genl-family-id.patch b/package/kernel/mac80211/patches/008-fix-genl-family-id.patch new file mode 100644 index 000000000..ee8fa6c2b --- /dev/null +++ b/package/kernel/mac80211/patches/008-fix-genl-family-id.patch @@ -0,0 +1,10 @@ +--- a/compat/backport-4.12.c ++++ b/compat/backport-4.12.c +@@ -224,6 +224,7 @@ int bp_extack_genl_register_family(struc + } + + /* copy this since the family might access it directly */ ++ family->id = copy->family.id; + family->attrbuf = copy->family.attrbuf; + family->mcgrp_offset = copy->family.mcgrp_offset; + diff --git a/package/kernel/mac80211/patches/050-lib80211_option.patch b/package/kernel/mac80211/patches/050-lib80211_option.patch index 3fc8c0520..28a0d905b 100644 --- a/package/kernel/mac80211/patches/050-lib80211_option.patch +++ b/package/kernel/mac80211/patches/050-lib80211_option.patch @@ -1,6 +1,6 @@ --- a/net/wireless/Kconfig +++ b/net/wireless/Kconfig -@@ -171,7 +171,7 @@ config CFG80211_WEXT_EXPORT +@@ -181,7 +181,7 @@ config CFG80211_WEXT_EXPORT wext compatibility symbols to be exported. config LIB80211 @@ -9,7 +9,7 @@ depends on m default n help -@@ -181,15 +181,15 @@ config LIB80211 +@@ -191,15 +191,15 @@ config LIB80211 Drivers should select this themselves if needed. config LIB80211_CRYPT_WEP diff --git a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch index 1fc52f9ab..d897b2b40 100644 --- a/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch +++ b/package/kernel/mac80211/patches/060-no_local_ssb_bcma.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -383,45 +383,6 @@ USB_IPHETH= +@@ -388,45 +388,6 @@ USB_IPHETH= USB_SIERRA_NET= USB_VL600= USB_NET_CH9200= @@ -121,7 +121,7 @@ #source "$BACKPORT_DIR/drivers/media/Kconfig" --- a/Makefile.kernel +++ b/Makefile.kernel -@@ -39,8 +39,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ +@@ -42,8 +42,6 @@ obj-$(CPTCFG_MAC80211) += net/mac80211/ obj-$(CPTCFG_WLAN) += drivers/net/wireless/ #obj-$(CPTCFG_BT) += net/bluetooth/ #obj-$(CPTCFG_BT) += drivers/bluetooth/ diff --git a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch index 0febc57b3..aa44149ae 100644 --- a/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/100-remove-cryptoapi-dependencies.patch @@ -1,270 +1,388 @@ ---- a/net/mac80211/Kconfig -+++ b/net/mac80211/Kconfig -@@ -5,8 +5,6 @@ config MAC80211 - depends on CRYPTO - depends on CRYPTO_ARC4 - depends on CRYPTO_AES -- select BPAUTO_CRYPTO_CCM -- depends on CRYPTO_GCM - depends on CRYPTO_CMAC - depends on CRC32 - ---help--- --- a/net/mac80211/Makefile +++ b/net/mac80211/Makefile -@@ -16,9 +16,7 @@ mac80211-y := \ +@@ -6,7 +6,6 @@ mac80211-y := \ + driver-ops.o \ + sta_info.o \ + wep.o \ +- aead_api.o \ + wpa.o \ + scan.o offchannel.o \ + ht.o agg-tx.o agg-rx.o \ +@@ -16,8 +15,8 @@ mac80211-y := \ + rate.o \ michael.o \ tkip.o \ - aes_ccm.o \ -- aes_gcm.o \ ++ aes_ccm.o \ aes_cmac.o \ - aes_gmac.o \ fils_aead.o \ cfg.o \ ethtool.o \ ---- a/net/mac80211/aes_ccm.c -+++ b/net/mac80211/aes_ccm.c -@@ -13,103 +13,132 @@ - #include - #include - #include -+#include - - #include - #include "key.h" - #include "aes_ccm.h" - --int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len) -+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, -+ u8 *a, u8 *b) - { +--- a/net/mac80211/aead_api.c ++++ /dev/null +@@ -1,115 +0,0 @@ +-/* +- * Copyright 2003-2004, Instant802 Networks, Inc. +- * Copyright 2005-2006, Devicescape Software, Inc. +- * Copyright 2014-2015, Qualcomm Atheros, Inc. +- * +- * Rewrite: Copyright (C) 2013 Linaro Ltd +- * +- * 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 +-#include +-#include +-#include +-#include +- +-#include "aead_api.h" +- +-int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, +- u8 *data, size_t data_len, u8 *mic) +-{ +- size_t mic_len = crypto_aead_authsize(tfm); - struct scatterlist sg[3]; - struct aead_request *aead_req; - int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); - u8 *__aad; -+ int i; - -- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- +- aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC); - if (!aead_req) - return -ENOMEM; -+ crypto_cipher_encrypt_one(tfm, b, b_0); - +- - __aad = (u8 *)aead_req + reqsize; -- memcpy(__aad, aad, CCM_AAD_LEN); -+ /* Extra Authenticate-only data (always two AES blocks) */ -+ for (i = 0; i < AES_BLOCK_SIZE; i++) -+ aad[i] ^= b[i]; -+ crypto_cipher_encrypt_one(tfm, b, aad); - +- memcpy(__aad, aad, aad_len); +- - sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[0], __aad, aad_len); - sg_set_buf(&sg[1], data, data_len); - sg_set_buf(&sg[2], mic, mic_len); -+ aad += AES_BLOCK_SIZE; - +- - aead_request_set_tfm(aead_req, tfm); - aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); - aead_request_set_ad(aead_req, sg[0].length); -+ for (i = 0; i < AES_BLOCK_SIZE; i++) -+ aad[i] ^= b[i]; -+ crypto_cipher_encrypt_one(tfm, a, aad); - +- - crypto_aead_encrypt(aead_req); - kzfree(aead_req); -+ /* Mask out bits from auth-only-b_0 */ -+ b_0[0] &= 0x07; - +- - return 0; -+ /* S_0 is used to encrypt T (= MIC) */ -+ b_0[14] = 0; -+ b_0[15] = 0; -+ crypto_cipher_encrypt_one(tfm, s_0, b_0); - } - --int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len) -+ -+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) - { +-} +- +-int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, +- u8 *data, size_t data_len, u8 *mic) +-{ +- size_t mic_len = crypto_aead_authsize(tfm); - struct scatterlist sg[3]; - struct aead_request *aead_req; - int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); - u8 *__aad; - int err; -+ int i, j, last_len, num_blocks; -+ u8 b[AES_BLOCK_SIZE]; -+ u8 s_0[AES_BLOCK_SIZE]; -+ u8 e[AES_BLOCK_SIZE]; -+ u8 *pos, *cpos; - +- - if (data_len == 0) - return -EINVAL; -+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -+ last_len = data_len % AES_BLOCK_SIZE; -+ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); - -- aead_req = kzalloc(reqsize + CCM_AAD_LEN, GFP_ATOMIC); +- +- aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC); - if (!aead_req) - return -ENOMEM; -+ /* Process payload blocks */ -+ pos = data; -+ cpos = data; -+ for (j = 1; j <= num_blocks; j++) { -+ int blen = (j == num_blocks && last_len) ? -+ last_len : AES_BLOCK_SIZE; - +- - __aad = (u8 *)aead_req + reqsize; -- memcpy(__aad, aad, CCM_AAD_LEN); -+ /* Authentication followed by encryption */ -+ for (i = 0; i < blen; i++) -+ b[i] ^= pos[i]; -+ crypto_cipher_encrypt_one(tfm, b, b); - +- memcpy(__aad, aad, aad_len); +- - sg_init_table(sg, 3); -- sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); +- sg_set_buf(&sg[0], __aad, aad_len); - sg_set_buf(&sg[1], data, data_len); - sg_set_buf(&sg[2], mic, mic_len); -+ b_0[14] = (j >> 8) & 0xff; -+ b_0[15] = j & 0xff; -+ crypto_cipher_encrypt_one(tfm, e, b_0); -+ for (i = 0; i < blen; i++) -+ *cpos++ = *pos++ ^ e[i]; -+ } - +- - aead_request_set_tfm(aead_req, tfm); - aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0); - aead_request_set_ad(aead_req, sg[0].length); -+ for (i = 0; i < mic_len; i++) -+ mic[i] = b[i] ^ s_0[i]; -+} - +- - err = crypto_aead_decrypt(aead_req); - kzfree(aead_req); -+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len) -+{ -+ int i, j, last_len, num_blocks; -+ u8 *pos, *cpos; -+ u8 a[AES_BLOCK_SIZE]; -+ u8 b[AES_BLOCK_SIZE]; -+ u8 s_0[AES_BLOCK_SIZE]; - +- - return err; -+ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); -+ last_len = data_len % AES_BLOCK_SIZE; -+ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); -+ -+ /* Process payload blocks */ -+ cpos = data; -+ pos = data; -+ for (j = 1; j <= num_blocks; j++) { -+ int blen = (j == num_blocks && last_len) ? -+ last_len : AES_BLOCK_SIZE; -+ -+ /* Decryption followed by authentication */ -+ b_0[14] = (j >> 8) & 0xff; -+ b_0[15] = j & 0xff; -+ crypto_cipher_encrypt_one(tfm, b, b_0); -+ for (i = 0; i < blen; i++) { -+ *pos = *cpos++ ^ b[i]; -+ a[i] ^= *pos++; -+ } -+ crypto_cipher_encrypt_one(tfm, a, a); -+ } -+ -+ for (i = 0; i < mic_len; i++) { -+ if ((mic[i] ^ s_0[i]) != a[i]) -+ return -1; -+ } -+ -+ return 0; - } - --struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -- size_t key_len, -- size_t mic_len) -+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -+ size_t key_len, -+ size_t mic_len) - { +-} +- +-struct crypto_aead * +-aead_key_setup_encrypt(const char *alg, const u8 key[], +- size_t key_len, size_t mic_len) +-{ - struct crypto_aead *tfm; - int err; - -- tfm = crypto_alloc_aead("ccm(aes)", 0, CRYPTO_ALG_ASYNC); +- tfm = crypto_alloc_aead(alg, 0, CRYPTO_ALG_ASYNC); - if (IS_ERR(tfm)) - return tfm; -+ struct crypto_cipher *tfm; - +- - err = crypto_aead_setkey(tfm, key, key_len); - if (err) - goto free_aead; - err = crypto_aead_setauthsize(tfm, mic_len); - if (err) - goto free_aead; -+ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); -+ if (!IS_ERR(tfm)) -+ crypto_cipher_setkey(tfm, key, key_len); - - return tfm; +- +- return tfm; - -free_aead: - crypto_free_aead(tfm); - return ERR_PTR(err); - } - --void ieee80211_aes_key_free(struct crypto_aead *tfm) -+ -+void ieee80211_aes_key_free(struct crypto_cipher *tfm) - { +-} +- +-void aead_key_free(struct crypto_aead *tfm) +-{ - crypto_free_aead(tfm); -+ crypto_free_cipher(tfm); - } ---- a/net/mac80211/aes_gmac.h -+++ b/net/mac80211/aes_gmac.h -@@ -15,10 +15,22 @@ - #define GMAC_MIC_LEN 16 - #define GMAC_NONCE_LEN 12 +-} +--- a/net/mac80211/aead_api.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/* +- * 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. +- */ +- +-#ifndef _AEAD_API_H +-#define _AEAD_API_H +- +-#include +-#include +- +-struct crypto_aead * +-aead_key_setup_encrypt(const char *alg, const u8 key[], +- size_t key_len, size_t mic_len); +- +-int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- size_t aad_len, u8 *data, +- size_t data_len, u8 *mic); +- +-int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, +- size_t aad_len, u8 *data, +- size_t data_len, u8 *mic); +- +-void aead_key_free(struct crypto_aead *tfm); +- +-#endif /* _AEAD_API_H */ +--- a/net/mac80211/aes_ccm.h ++++ b/net/mac80211/aes_ccm.h +@@ -10,39 +10,17 @@ + #ifndef AES_CCM_H + #define AES_CCM_H --struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], -- size_t key_len); --int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -- const u8 *data, size_t data_len, u8 *mic); --void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); -+static inline struct crypto_aead * -+ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +-#include "aead_api.h" +- +-#define CCM_AAD_LEN 32 +- +-static inline struct crypto_aead * +-ieee80211_aes_key_setup_encrypt(const u8 key[], size_t key_len, size_t mic_len) +-{ +- return aead_key_setup_encrypt("ccm(aes)", key, key_len, mic_len); +-} +- +-static inline int +-ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, +- u8 *b_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +-{ +- return aead_encrypt(tfm, b_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); +-} +- +-static inline int +-ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, +- u8 *b_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +-{ +- return aead_decrypt(tfm, b_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); +-} ++#include + +-static inline void ieee80211_aes_key_free(struct crypto_aead *tfm) +-{ +- return aead_key_free(tfm); +-} ++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], ++ size_t key_len, ++ size_t mic_len); ++void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len); ++void ieee80211_aes_key_free(struct crypto_cipher *tfm); + + #endif /* AES_CCM_H */ +--- /dev/null ++++ b/net/mac80211/aes_gcm.c +@@ -0,0 +1,109 @@ ++/* ++ * Copyright 2014-2015, Qualcomm Atheros, Inc. ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include ++#include "key.h" ++#include "aes_gcm.h" ++ ++int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) +{ -+ return NULL; ++ struct scatterlist sg[3]; ++ struct aead_request *aead_req; ++ int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); ++ u8 *__aad; ++ ++ aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC); ++ if (!aead_req) ++ return -ENOMEM; ++ ++ __aad = (u8 *)aead_req + reqsize; ++ memcpy(__aad, aad, GCM_AAD_LEN); ++ ++ sg_init_table(sg, 3); ++ sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); ++ sg_set_buf(&sg[1], data, data_len); ++ sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN); ++ ++ aead_request_set_tfm(aead_req, tfm); ++ aead_request_set_crypt(aead_req, sg, sg, data_len, j_0); ++ aead_request_set_ad(aead_req, sg[0].length); ++ ++ crypto_aead_encrypt(aead_req); ++ kzfree(aead_req); ++ return 0; +} + -+static inline int -+ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, -+ const u8 *data, size_t data_len, u8 *mic) ++int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) +{ -+ return -EOPNOTSUPP; ++ struct scatterlist sg[3]; ++ struct aead_request *aead_req; ++ int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); ++ u8 *__aad; ++ int err; ++ ++ if (data_len == 0) ++ return -EINVAL; ++ ++ aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC); ++ if (!aead_req) ++ return -ENOMEM; ++ ++ __aad = (u8 *)aead_req + reqsize; ++ memcpy(__aad, aad, GCM_AAD_LEN); ++ ++ sg_init_table(sg, 3); ++ sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad)); ++ sg_set_buf(&sg[1], data, data_len); ++ sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN); ++ ++ aead_request_set_tfm(aead_req, tfm); ++ aead_request_set_crypt(aead_req, sg, sg, ++ data_len + IEEE80211_GCMP_MIC_LEN, j_0); ++ aead_request_set_ad(aead_req, sg[0].length); ++ ++ err = crypto_aead_decrypt(aead_req); ++ kzfree(aead_req); ++ ++ return err; +} + ++struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], ++ size_t key_len) ++{ ++ struct crypto_aead *tfm; ++ int err; ++ ++ tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); ++ if (IS_ERR(tfm)) ++ return tfm; ++ ++ err = crypto_aead_setkey(tfm, key, key_len); ++ if (err) ++ goto free_aead; ++ err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN); ++ if (err) ++ goto free_aead; ++ ++ return tfm; ++ ++free_aead: ++ crypto_free_aead(tfm); ++ return ERR_PTR(err); ++} ++ ++void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++{ ++ crypto_free_aead(tfm); ++} +--- a/net/mac80211/aes_gcm.h ++++ b/net/mac80211/aes_gcm.h +@@ -9,38 +9,30 @@ + #ifndef AES_GCM_H + #define AES_GCM_H + +-#include "aead_api.h" +- +-#define GCM_AAD_LEN 32 ++#include + +-static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, +- u8 *j_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) +static inline void -+ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) -+{ -+} ++ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) + { +- return aead_encrypt(tfm, j_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); + } - #endif /* AES_GMAC_H */ ---- a/net/mac80211/key.h -+++ b/net/mac80211/key.h -@@ -88,7 +88,7 @@ struct ieee80211_key { - * Management frames. - */ - u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; -- struct crypto_aead *tfm; -+ struct crypto_cipher *tfm; - u32 replays; /* dot11RSNAStatsCCMPReplays */ - } ccmp; - struct { +-static inline int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, +- u8 *j_0, u8 *aad, u8 *data, +- size_t data_len, u8 *mic) ++static inline int ++ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, ++ u8 *data, size_t data_len, u8 *mic) + { +- return aead_decrypt(tfm, j_0, aad + 2, +- be16_to_cpup((__be16 *)aad), +- data, data_len, mic); ++ return -EOPNOTSUPP; + } + + static inline struct crypto_aead * + ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) + { +- return aead_key_setup_encrypt("gcm(aes)", key, +- key_len, IEEE80211_GCMP_MIC_LEN); ++ return NULL; + } + +-static inline void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++static inline void ++ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) + { +- return aead_key_free(tfm); + } + + #endif /* AES_GCM_H */ --- a/net/mac80211/wpa.c +++ b/net/mac80211/wpa.c @@ -306,7 +306,8 @@ ieee80211_crypto_tkip_decrypt(struct iee @@ -318,7 +436,7 @@ pos += IEEE80211_CCMP_HDR_LEN; - ccmp_special_blocks(skb, pn, b_0, aad); - return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, -- skb_put(skb, mic_len), mic_len); +- skb_put(skb, mic_len)); + ccmp_special_blocks(skb, pn, b_0, aad, len); + ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len, + skb_put(skb, mic_len), mic_len); @@ -327,7 +445,7 @@ } -@@ -537,7 +536,7 @@ ieee80211_crypto_ccmp_decrypt(struct iee +@@ -537,13 +536,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee u8 aad[2 * AES_BLOCK_SIZE]; u8 b_0[AES_BLOCK_SIZE]; /* hardware didn't decrypt/verify MIC */ @@ -336,6 +454,13 @@ if (ieee80211_aes_ccm_decrypt( key->u.ccmp.tfm, b_0, aad, + skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN, + data_len, +- skb->data + skb->len - mic_len)) ++ skb->data + skb->len - mic_len, mic_len)) + return RX_DROP_UNUSABLE; + } + @@ -639,7 +638,7 @@ static int gcmp_encrypt_skb(struct ieee8 u8 *pos; u8 pn[6]; @@ -379,70 +504,202 @@ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; if (!ieee80211_is_mgmt(hdr->frame_control)) ---- a/net/mac80211/aes_ccm.h -+++ b/net/mac80211/aes_ccm.h -@@ -12,17 +12,15 @@ - - #include - --#define CCM_AAD_LEN 32 -- --struct crypto_aead *ieee80211_aes_key_setup_encrypt(const u8 key[], -- size_t key_len, -- size_t mic_len); --int ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic, -- size_t mic_len); --int ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, -+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], -+ size_t key_len, -+ size_t mic_len); +--- /dev/null ++++ b/net/mac80211/aes_ccm.c +@@ -0,0 +1,144 @@ ++/* ++ * Copyright 2003-2004, Instant802 Networks, Inc. ++ * Copyright 2005-2006, Devicescape Software, Inc. ++ * ++ * Rewrite: Copyright (C) 2013 Linaro Ltd ++ * ++ * 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 ++#include ++#include ++#include ++#include ++ ++#include ++#include "key.h" ++#include "aes_ccm.h" ++ ++static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0, ++ u8 *a, u8 *b) ++{ ++ int i; ++ ++ crypto_cipher_encrypt_one(tfm, b, b_0); ++ ++ /* Extra Authenticate-only data (always two AES blocks) */ ++ for (i = 0; i < AES_BLOCK_SIZE; i++) ++ aad[i] ^= b[i]; ++ crypto_cipher_encrypt_one(tfm, b, aad); ++ ++ aad += AES_BLOCK_SIZE; ++ ++ for (i = 0; i < AES_BLOCK_SIZE; i++) ++ aad[i] ^= b[i]; ++ crypto_cipher_encrypt_one(tfm, a, aad); ++ ++ /* Mask out bits from auth-only-b_0 */ ++ b_0[0] &= 0x07; ++ ++ /* S_0 is used to encrypt T (= MIC) */ ++ b_0[14] = 0; ++ b_0[15] = 0; ++ crypto_cipher_encrypt_one(tfm, s_0, b_0); ++} ++ ++ +void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, + u8 *data, size_t data_len, u8 *mic, -+ size_t mic_len); ++ size_t mic_len) ++{ ++ int i, j, last_len, num_blocks; ++ u8 b[AES_BLOCK_SIZE]; ++ u8 s_0[AES_BLOCK_SIZE]; ++ u8 e[AES_BLOCK_SIZE]; ++ u8 *pos, *cpos; ++ ++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); ++ last_len = data_len % AES_BLOCK_SIZE; ++ aes_ccm_prepare(tfm, b_0, aad, s_0, b, b); ++ ++ /* Process payload blocks */ ++ pos = data; ++ cpos = data; ++ for (j = 1; j <= num_blocks; j++) { ++ int blen = (j == num_blocks && last_len) ? ++ last_len : AES_BLOCK_SIZE; ++ ++ /* Authentication followed by encryption */ ++ for (i = 0; i < blen; i++) ++ b[i] ^= pos[i]; ++ crypto_cipher_encrypt_one(tfm, b, b); ++ ++ b_0[14] = (j >> 8) & 0xff; ++ b_0[15] = j & 0xff; ++ crypto_cipher_encrypt_one(tfm, e, b_0); ++ for (i = 0; i < blen; i++) ++ *cpos++ = *pos++ ^ e[i]; ++ } ++ ++ for (i = 0; i < mic_len; i++) ++ mic[i] = b[i] ^ s_0[i]; ++} ++ +int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, - u8 *data, size_t data_len, u8 *mic, - size_t mic_len); --void ieee80211_aes_key_free(struct crypto_aead *tfm); -+void ieee80211_aes_key_free(struct crypto_cipher *tfm); - - #endif /* AES_CCM_H */ ---- a/net/mac80211/aes_gcm.h -+++ b/net/mac80211/aes_gcm.h -@@ -11,14 +11,28 @@ - - #include - --#define GCM_AAD_LEN 32 -+static inline void -+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) ++ u8 *data, size_t data_len, u8 *mic, ++ size_t mic_len) +{ -+} - --int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -- u8 *data, size_t data_len, u8 *mic); --struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], -- size_t key_len); --void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm); -+static inline int -+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad, -+ u8 *data, size_t data_len, u8 *mic) -+{ -+ return -EOPNOTSUPP; ++ int i, j, last_len, num_blocks; ++ u8 *pos, *cpos; ++ u8 a[AES_BLOCK_SIZE]; ++ u8 b[AES_BLOCK_SIZE]; ++ u8 s_0[AES_BLOCK_SIZE]; ++ ++ num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE); ++ last_len = data_len % AES_BLOCK_SIZE; ++ aes_ccm_prepare(tfm, b_0, aad, s_0, a, b); ++ ++ /* Process payload blocks */ ++ cpos = data; ++ pos = data; ++ for (j = 1; j <= num_blocks; j++) { ++ int blen = (j == num_blocks && last_len) ? ++ last_len : AES_BLOCK_SIZE; ++ ++ /* Decryption followed by authentication */ ++ b_0[14] = (j >> 8) & 0xff; ++ b_0[15] = j & 0xff; ++ crypto_cipher_encrypt_one(tfm, b, b_0); ++ for (i = 0; i < blen; i++) { ++ *pos = *cpos++ ^ b[i]; ++ a[i] ^= *pos++; ++ } ++ crypto_cipher_encrypt_one(tfm, a, a); ++ } ++ ++ for (i = 0; i < mic_len; i++) { ++ if ((mic[i] ^ s_0[i]) != a[i]) ++ return -1; ++ } ++ ++ return 0; +} + ++struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[], ++ size_t key_len, ++ size_t mic_len) ++{ ++ struct crypto_cipher *tfm; ++ ++ tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC); ++ if (!IS_ERR(tfm)) ++ crypto_cipher_setkey(tfm, key, key_len); ++ ++ return tfm; ++} ++ ++ ++void ieee80211_aes_key_free(struct crypto_cipher *tfm) ++{ ++ crypto_free_cipher(tfm); ++} +--- a/net/mac80211/Kconfig ++++ b/net/mac80211/Kconfig +@@ -5,8 +5,6 @@ config MAC80211 + depends on CRYPTO + depends on CRYPTO_ARC4 + depends on CRYPTO_AES +- depends on CRYPTO_CCM +- depends on CRYPTO_GCM + depends on CRYPTO_CMAC + depends on CRC32 + ---help--- +--- a/net/mac80211/aes_gmac.h ++++ b/net/mac80211/aes_gmac.h +@@ -15,10 +15,22 @@ + #define GMAC_MIC_LEN 16 + #define GMAC_NONCE_LEN 12 + +-struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[], +- size_t key_len); +-int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, +- const u8 *data, size_t data_len, u8 *mic); +-void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm); +static inline struct crypto_aead * -+ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len) ++ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len) +{ -+ return NULL; ++ return NULL; ++} ++ ++static inline int ++ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce, ++ const u8 *data, size_t data_len, u8 *mic) ++{ ++ return -EOPNOTSUPP; +} + +static inline void -+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm) ++ieee80211_aes_gmac_key_free(struct crypto_aead *tfm) +{ +} - #endif /* AES_GCM_H */ + #endif /* AES_GMAC_H */ +--- a/net/mac80211/key.h ++++ b/net/mac80211/key.h +@@ -88,7 +88,7 @@ struct ieee80211_key { + * Management frames. + */ + u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN]; +- struct crypto_aead *tfm; ++ struct crypto_cipher *tfm; + u32 replays; /* dot11RSNAStatsCCMPReplays */ + } ccmp; + struct { diff --git a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch index 005e3e5d5..3b1fcdf9c 100644 --- a/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/110-mac80211_keep_keys_on_stop_ap.patch @@ -2,7 +2,7 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnects --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1056,7 +1056,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1058,7 +1058,6 @@ static int ieee80211_stop_ap(struct wiph sdata->u.ap.driver_smps_mode = IEEE80211_SMPS_OFF; __sta_info_flush(sdata, true); diff --git a/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch b/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch new file mode 100644 index 000000000..6e9a07a92 --- /dev/null +++ b/package/kernel/mac80211/patches/140-tweak-TSQ-setting.patch @@ -0,0 +1,15 @@ +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3750,6 +3750,12 @@ out: + netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev) + { ++#if defined(sk_pacing_shift) || LINUX_VERSION_IS_GEQ(4,15,0) ++ if (skb->sk && sk_fullsock(skb->sk) && ++ skb->sk->sk_pacing_shift != 6) ++ skb->sk->sk_pacing_shift = 6; ++#endif ++ + if (unlikely(ieee80211_multicast_to_unicast(skb, dev))) { + struct sk_buff_head queue; + diff --git a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch index 42a692a1f..781dd3c1b 100644 --- a/package/kernel/mac80211/patches/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1115,14 +1115,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1114,14 +1114,14 @@ int ieee80211_register_hw(struct ieee802 if (result) goto fail_flows; @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1131,13 +1131,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1130,13 +1130,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif ieee80211_txq_teardown_flows(local); -@@ -1167,10 +1167,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1166,10 +1166,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/210-ap_scan.patch b/package/kernel/mac80211/patches/210-ap_scan.patch index e9999e32b..8ade963c9 100644 --- a/package/kernel/mac80211/patches/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2212,7 +2212,7 @@ static int ieee80211_scan(struct wiphy * +@@ -2215,7 +2215,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ diff --git a/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch index baaca173c..83c613434 100644 --- a/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch +++ b/package/kernel/mac80211/patches/307-mac80211-add-hdrlen-to-ieee80211_tx_data.patch @@ -48,7 +48,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) tx->sta = sta; -@@ -3434,6 +3434,7 @@ begin: +@@ -3468,6 +3468,7 @@ begin: tx.local = local; tx.skb = skb; tx.sdata = vif_to_sdata(info->control.vif); @@ -56,7 +56,7 @@ Signed-off-by: Janusz Dziedzic if (txq->sta) tx.sta = container_of(txq->sta, struct sta_info, sta); -@@ -3756,6 +3757,7 @@ ieee80211_build_data_template(struct iee +@@ -3796,6 +3797,7 @@ ieee80211_build_data_template(struct iee hdr = (void *)skb->data; tx.sta = sta_info_get(sdata, hdr->addr1); tx.skb = skb; diff --git a/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch index 762458ba7..a9f01b368 100644 --- a/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch +++ b/package/kernel/mac80211/patches/308-mac80211-add-NEED_ALIGNED4_SKBS-hw-flag.patch @@ -23,9 +23,9 @@ Signed-off-by: Janusz Dziedzic --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -2056,6 +2056,9 @@ struct ieee80211_txq { - * The stack will not do fragmentation. - * The callback for @set_frag_threshold should be set as well. +@@ -2059,6 +2059,9 @@ struct ieee80211_txq { + * @IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA: Hardware supports buffer STA on + * TDLS links. * + * @IEEE80211_HW_NEEDS_ALIGNED4_SKBS: Driver need aligned skbs to four-byte. + * Padding will be added after ieee80211_hdr, before IV/LLC. @@ -33,27 +33,27 @@ Signed-off-by: Janusz Dziedzic * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags { -@@ -2098,6 +2101,7 @@ enum ieee80211_hw_flags { - IEEE80211_HW_TX_FRAG_LIST, +@@ -2102,6 +2105,7 @@ enum ieee80211_hw_flags { IEEE80211_HW_REPORTS_LOW_ACK, IEEE80211_HW_SUPPORTS_TX_FRAG, + IEEE80211_HW_SUPPORTS_TDLS_BUFFER_STA, + IEEE80211_HW_NEEDS_ALIGNED4_SKBS, /* keep last, obviously */ NUM_IEEE80211_HW_FLAGS --- a/net/mac80211/debugfs.c +++ b/net/mac80211/debugfs.c -@@ -211,6 +211,7 @@ static const char *hw_flag_names[] = { - FLAG(TX_FRAG_LIST), +@@ -212,6 +212,7 @@ static const char *hw_flag_names[] = { FLAG(REPORTS_LOW_ACK), FLAG(SUPPORTS_TX_FRAG), + FLAG(SUPPORTS_TDLS_BUFFER_STA), + FLAG(NEEDS_ALIGNED4_SKBS), #undef FLAG }; --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1547,6 +1547,29 @@ ieee80211_vif_get_num_mcast_if(struct ie +@@ -1548,6 +1548,29 @@ ieee80211_vif_get_num_mcast_if(struct ie return -1; } @@ -85,7 +85,7 @@ Signed-off-by: Janusz Dziedzic unsigned int mpdu_len, --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h -@@ -290,7 +290,7 @@ struct ieee80211_fast_tx { +@@ -300,7 +300,7 @@ struct ieee80211_fast_tx { u8 hdr_len; u8 sa_offs, da_offs, pn_offs; u8 band; @@ -147,7 +147,7 @@ Signed-off-by: Janusz Dziedzic if (likely(sta)) { if (!IS_ERR(sta)) -@@ -2150,7 +2149,7 @@ netdev_tx_t ieee80211_monitor_start_xmit +@@ -2184,7 +2183,7 @@ netdev_tx_t ieee80211_monitor_start_xmit goto fail; hdr = (struct ieee80211_hdr *)(skb->data + len_rthdr); @@ -156,7 +156,7 @@ Signed-off-by: Janusz Dziedzic if (skb->len < len_rthdr + hdrlen) goto fail; -@@ -2368,7 +2367,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2402,7 +2401,7 @@ static struct sk_buff *ieee80211_build_h struct ieee80211_chanctx_conf *chanctx_conf; struct ieee80211_sub_if_data *ap_sdata; enum nl80211_band band; @@ -165,7 +165,7 @@ Signed-off-by: Janusz Dziedzic if (IS_ERR(sta)) sta = NULL; -@@ -2588,6 +2587,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2622,6 +2621,9 @@ static struct sk_buff *ieee80211_build_h hdrlen += 2; } @@ -175,7 +175,7 @@ Signed-off-by: Janusz Dziedzic /* * Drop unicast frames to unauthorised stations unless they are * EAPOL frames from the local station. -@@ -2668,6 +2670,7 @@ static struct sk_buff *ieee80211_build_h +@@ -2702,6 +2704,7 @@ static struct sk_buff *ieee80211_build_h skb_pull(skb, skip_header_bytes); head_need = hdrlen + encaps_len + meshhdrlen - skb_headroom(skb); @@ -183,7 +183,7 @@ Signed-off-by: Janusz Dziedzic /* * So we need to modify the skb header and hence need a copy of -@@ -2700,6 +2703,9 @@ static struct sk_buff *ieee80211_build_h +@@ -2734,6 +2737,9 @@ static struct sk_buff *ieee80211_build_h memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen); #endif @@ -193,7 +193,7 @@ Signed-off-by: Janusz Dziedzic if (ieee80211_is_data_qos(fc)) { __le16 *qos_control; -@@ -2875,6 +2881,9 @@ void ieee80211_check_fast_xmit(struct st +@@ -2909,6 +2915,9 @@ void ieee80211_check_fast_xmit(struct st fc |= cpu_to_le16(IEEE80211_STYPE_QOS_DATA); } @@ -203,7 +203,7 @@ Signed-off-by: Janusz Dziedzic /* We store the key here so there's no point in using rcu_dereference() * but that's fine because the code that changes the pointers will call * this function after doing so. For a single CPU that would be enough, -@@ -3461,7 +3470,7 @@ begin: +@@ -3495,7 +3504,7 @@ begin: if (tx.key && (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) diff --git a/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch b/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch index 5e18f285a..56d86c152 100644 --- a/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch +++ b/package/kernel/mac80211/patches/317-Revert-ath10k-disable-wake_tx_queue-for-older-device.patch @@ -9,7 +9,7 @@ in the hope that we've fixed all the performance problems now. --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8286,15 +8286,6 @@ int ath10k_mac_register(struct ath10k *a +@@ -8319,15 +8319,6 @@ int ath10k_mac_register(struct ath10k *a ath10k_warn(ar, "failed to initialise DFS pattern detector\n"); } diff --git a/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch b/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch new file mode 100644 index 000000000..2aeb49dc1 --- /dev/null +++ b/package/kernel/mac80211/patches/318-ath10k-fix-build-errors-with-CONFIG_PM.patch @@ -0,0 +1,72 @@ +From: Brian Norris +Date: Thu, 19 Oct 2017 11:45:19 -0700 +Subject: [PATCH] ath10k: fix build errors with !CONFIG_PM + +Build errors have been reported with CONFIG_PM=n: + +drivers/net/wireless/ath/ath10k/pci.c:3416:8: error: implicit +declaration of function 'ath10k_pci_suspend' +[-Werror=implicit-function-declaration] + +drivers/net/wireless/ath/ath10k/pci.c:3428:8: error: implicit +declaration of function 'ath10k_pci_resume' +[-Werror=implicit-function-declaration] + +These are caused by the combination of the following two commits: + +6af1de2e4ec4 ("ath10k: mark PM functions as __maybe_unused") +96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but +disabled") + +Both build fine on their own. + +But now that ath10k_pci_pm_{suspend,resume}() is compiled +unconditionally, we should also compile ath10k_pci_{suspend,resume}() +unconditionally. + +And drop the #ifdef around ath10k_pci_hif_{suspend,resume}() too; they +are trivial (empty), so we're not saving much space by compiling them +out. And the alternatives would be to sprinkle more __maybe_unused, or +spread the #ifdef's further. + +Build tested with the following combinations: +CONFIG_PM=y && CONFIG_PM_SLEEP=y +CONFIG_PM=y && CONFIG_PM_SLEEP=n +CONFIG_PM=n + +Fixes: 96378bd2c6cd ("ath10k: fix core PCI suspend when WoWLAN is supported but disabled") +Fixes: 096ad2a15fd8 ("Merge branch 'ath-next'") +Signed-off-by: Brian Norris +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/ath/ath10k/pci.c ++++ b/drivers/net/wireless/ath/ath10k/pci.c +@@ -2577,8 +2577,6 @@ void ath10k_pci_hif_power_down(struct at + */ + } + +-#ifdef CONFIG_PM +- + static int ath10k_pci_hif_suspend(struct ath10k *ar) + { + /* Nothing to do; the important stuff is in the driver suspend. */ +@@ -2627,7 +2625,6 @@ static int ath10k_pci_resume(struct ath1 + + return ret; + } +-#endif + + static bool ath10k_pci_validate_cal(void *data, size_t size) + { +@@ -2782,10 +2779,8 @@ static const struct ath10k_hif_ops ath10 + .power_down = ath10k_pci_hif_power_down, + .read32 = ath10k_pci_read32, + .write32 = ath10k_pci_write32, +-#ifdef CONFIG_PM + .suspend = ath10k_pci_hif_suspend, + .resume = ath10k_pci_hif_resume, +-#endif + .fetch_cal_eeprom = ath10k_pci_hif_fetch_cal_eeprom, + }; + diff --git a/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch b/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch new file mode 100644 index 000000000..5d5329f27 --- /dev/null +++ b/package/kernel/mac80211/patches/319-ath10k-fix-recent-bandwidth-conversion-bug.patch @@ -0,0 +1,61 @@ +From: Christian Lamparter +Date: Wed, 1 Nov 2017 21:01:57 +0100 +Subject: [PATCH] ath10k: fix recent bandwidth conversion bug + +The commit "cfg80211: make RATE_INFO_BW_20 the default" changed +the index of RATE_INFO_BW_20, but the updates to ath10k missed +the special bandwidth calculation case in +ath10k_update_per_peer_tx_stats(). + +Fixes: 842be75c77cb ("cfg80211: make RATE_INFO_BW_20 the default") +Signed-off-by: Christian Lamparter +Patchwork-Id: 10037035 +Signed-off-by: Kalle Valo +--- + +--- a/drivers/net/wireless/ath/ath10k/htt_rx.c ++++ b/drivers/net/wireless/ath/ath10k/htt_rx.c +@@ -592,6 +592,9 @@ struct amsdu_subframe_hdr { + + #define GROUP_ID_IS_SU_MIMO(x) ((x) == 0 || (x) == 63) + ++static const u8 ath10k_bw_to_mac80211[] = { RATE_INFO_BW_20, RATE_INFO_BW_40, ++ RATE_INFO_BW_80, RATE_INFO_BW_160 }; ++ + static void ath10k_htt_rx_h_rates(struct ath10k *ar, + struct ieee80211_rx_status *status, + struct htt_rx_desc *rxd) +@@ -694,23 +697,7 @@ static void ath10k_htt_rx_h_rates(struct + if (sgi) + status->enc_flags |= RX_ENC_FLAG_SHORT_GI; + +- switch (bw) { +- /* 20MHZ */ +- case 0: +- break; +- /* 40MHZ */ +- case 1: +- status->bw = RATE_INFO_BW_40; +- break; +- /* 80MHZ */ +- case 2: +- status->bw = RATE_INFO_BW_80; +- break; +- case 3: +- status->bw = RATE_INFO_BW_160; +- break; +- } +- ++ status->bw = ath10k_bw_to_mac80211[bw]; + status->encoding = RX_ENC_VHT; + break; + default: +@@ -2297,7 +2284,7 @@ ath10k_update_per_peer_tx_stats(struct a + arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; + + arsta->txrate.nss = txrate.nss; +- arsta->txrate.bw = txrate.bw + RATE_INFO_BW_20; ++ arsta->txrate.bw = ath10k_bw_to_mac80211[txrate.bw]; + } + + static void ath10k_htt_fetch_peer_stats(struct ath10k *ar, diff --git a/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch b/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch new file mode 100644 index 000000000..ecc5e4912 --- /dev/null +++ b/package/kernel/mac80211/patches/320-mac80211-properly-free-requested-but-not-started-TX-.patch @@ -0,0 +1,37 @@ +From: Johannes Berg +Date: Mon, 20 Nov 2017 17:01:44 +0100 +Subject: [PATCH] mac80211: properly free requested-but-not-started TX agg + sessions + +When deleting a station or otherwise tearing down all aggregation +sessions, make sure to delete requested but not yet started ones, +to avoid the following scenario: + + * session is requested, added to tid_start_tx[] + * ieee80211_ba_session_work() runs, gets past BLOCK_BA check + * ieee80211_sta_tear_down_BA_sessions() runs, locks &sta->ampdu_mlme.mtx, + e.g. while deleting the station - deleting all active sessions + * ieee80211_ba_session_work() continues since tear down flushes it, and + calls ieee80211_tx_ba_session_handle_start() for the new session, arms + the timer for it + * station deletion continues to __cleanup_single_sta() and frees the + session struct, while the timer is armed + +Reported-by: Fengguang Wu +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/agg-tx.c ++++ b/net/mac80211/agg-tx.c +@@ -330,6 +330,11 @@ int ___ieee80211_stop_tx_ba_session(stru + + spin_lock_bh(&sta->lock); + ++ /* free struct pending for start, if present */ ++ tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; ++ kfree(tid_tx); ++ sta->ampdu_mlme.tid_start_tx[tid] = NULL; ++ + tid_tx = rcu_dereference_protected_tid_tx(sta, tid); + if (!tid_tx) { + spin_unlock_bh(&sta->lock); diff --git a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch b/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch deleted file mode 100644 index 7d0be0395..000000000 --- a/package/kernel/mac80211/patches/327-mac80211-accept-key-reinstall-without-changing-anyth.patch +++ /dev/null @@ -1,81 +0,0 @@ -From fdf7cb4185b60c68e1a75e61691c4afdc15dea0e Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Tue, 5 Sep 2017 14:54:54 +0200 -Subject: [PATCH] mac80211: accept key reinstall without changing anything - -When a key is reinstalled we can reset the replay counters -etc. which can lead to nonce reuse and/or replay detection -being impossible, breaking security properties, as described -in the "KRACK attacks". - -In particular, CVE-2017-13080 applies to GTK rekeying that -happened in firmware while the host is in D3, with the second -part of the attack being done after the host wakes up. In -this case, the wpa_supplicant mitigation isn't sufficient -since wpa_supplicant doesn't know the GTK material. - -In case this happens, simply silently accept the new key -coming from userspace but don't take any action on it since -it's the same key; this keeps the PN replay counters intact. - -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 21 +++++++++++++++++---- - 1 file changed, 17 insertions(+), 4 deletions(-) - -diff --git a/net/mac80211/key.c b/net/mac80211/key.c -index a98fc2b5e0dc..ae995c8480db 100644 ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -4,7 +4,7 @@ - * Copyright 2006-2007 Jiri Benc - * Copyright 2007-2008 Johannes Berg - * Copyright 2013-2014 Intel Mobile Communications GmbH -- * Copyright 2015 Intel Deutschland GmbH -+ * Copyright 2015-2017 Intel Deutschland GmbH - * - * 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 -@@ -620,9 +620,6 @@ int ieee80211_key_link(struct ieee80211_key *key, - - pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE; - idx = key->conf.keyidx; -- key->local = sdata->local; -- key->sdata = sdata; -- key->sta = sta; - - mutex_lock(&sdata->local->key_mtx); - -@@ -633,6 +630,21 @@ int ieee80211_key_link(struct ieee80211_key *key, - else - old_key = key_mtx_dereference(sdata->local, sdata->keys[idx]); - -+ /* -+ * Silently accept key re-installation without really installing the -+ * new version of the key to avoid nonce reuse or replay issues. -+ */ -+ if (old_key && key->conf.keylen == old_key->conf.keylen && -+ !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ ieee80211_key_free_unused(key); -+ ret = 0; -+ goto out; -+ } -+ -+ key->local = sdata->local; -+ key->sdata = sdata; -+ key->sta = sta; -+ - increment_tailroom_need_count(sdata); - - ieee80211_key_replace(sdata, sta, pairwise, old_key, key); -@@ -648,6 +660,7 @@ int ieee80211_key_link(struct ieee80211_key *key, - ret = 0; - } - -+ out: - mutex_unlock(&sdata->local->key_mtx); - - return ret; --- -2.13.6 - diff --git a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch b/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch deleted file mode 100644 index 03e820190..000000000 --- a/package/kernel/mac80211/patches/328-mac80211-use-constant-time-comparison-with-keys.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2bdd713b92a9cade239d3c7d15205a09f556624d Mon Sep 17 00:00:00 2001 -From: "Jason A. Donenfeld" -Date: Tue, 17 Oct 2017 20:32:07 +0200 -Subject: [PATCH] mac80211: use constant time comparison with keys - -Otherwise we risk leaking information via timing side channel. - -Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") -Signed-off-by: Jason A. Donenfeld -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -19,6 +19,7 @@ - #include - #include - #include -+#include - #include - #include "ieee80211_i.h" - #include "driver-ops.h" -@@ -635,7 +636,7 @@ int ieee80211_key_link(struct ieee80211_ - * new version of the key to avoid nonce reuse or replay issues. - */ - if (old_key && key->conf.keylen == old_key->conf.keylen && -- !memcmp(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { - ieee80211_key_free_unused(key); - ret = 0; - goto out; diff --git a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch b/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch deleted file mode 100644 index 1eaf51de7..000000000 --- a/package/kernel/mac80211/patches/329-mac80211-don-t-compare-TKIP-TX-MIC-key-in-reinstall.patch +++ /dev/null @@ -1,73 +0,0 @@ -From cfbb0d90a7abb289edc91833d0905931f8805f12 Mon Sep 17 00:00:00 2001 -From: Johannes Berg -Date: Tue, 24 Oct 2017 21:12:13 +0200 -Subject: [PATCH] mac80211: don't compare TKIP TX MIC key in reinstall prevention - -For the reinstall prevention, the code I had added compares the -whole key. It turns out though that iwlwifi firmware doesn't -provide the TKIP TX MIC key as it's not needed in client mode, -and thus the comparison will always return false. - -For client mode, thus always zero out the TX MIC key part before -doing the comparison in order to avoid accepting the reinstall -of the key with identical encryption and RX MIC key, but not the -same TX MIC key (since the supplicant provides the real one.) - -Fixes: fdf7cb4185b6 ("mac80211: accept key reinstall without changing anything") -Signed-off-by: Johannes Berg ---- - net/mac80211/key.c | 36 ++++++++++++++++++++++++++++++++++-- - 1 file changed, 34 insertions(+), 2 deletions(-) - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -610,6 +610,39 @@ void ieee80211_key_free_unused(struct ie - ieee80211_key_free_common(key); - } - -+static bool ieee80211_key_identical(struct ieee80211_sub_if_data *sdata, -+ struct ieee80211_key *old, -+ struct ieee80211_key *new) -+{ -+ u8 tkip_old[WLAN_KEY_LEN_TKIP], tkip_new[WLAN_KEY_LEN_TKIP]; -+ u8 *tk_old, *tk_new; -+ -+ if (!old || new->conf.keylen != old->conf.keylen) -+ return false; -+ -+ tk_old = old->conf.key; -+ tk_new = new->conf.key; -+ -+ /* -+ * In station mode, don't compare the TX MIC key, as it's never used -+ * and offloaded rekeying may not care to send it to the host. This -+ * is the case in iwlwifi, for example. -+ */ -+ if (sdata->vif.type == NL80211_IFTYPE_STATION && -+ new->conf.cipher == WLAN_CIPHER_SUITE_TKIP && -+ new->conf.keylen == WLAN_KEY_LEN_TKIP && -+ !(new->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE)) { -+ memcpy(tkip_old, tk_old, WLAN_KEY_LEN_TKIP); -+ memcpy(tkip_new, tk_new, WLAN_KEY_LEN_TKIP); -+ memset(tkip_old + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); -+ memset(tkip_new + NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY, 0, 8); -+ tk_old = tkip_old; -+ tk_new = tkip_new; -+ } -+ -+ return !crypto_memneq(tk_old, tk_new, new->conf.keylen); -+} -+ - int ieee80211_key_link(struct ieee80211_key *key, - struct ieee80211_sub_if_data *sdata, - struct sta_info *sta) -@@ -635,8 +668,7 @@ int ieee80211_key_link(struct ieee80211_ - * Silently accept key re-installation without really installing the - * new version of the key to avoid nonce reuse or replay issues. - */ -- if (old_key && key->conf.keylen == old_key->conf.keylen && -- !crypto_memneq(key->conf.key, old_key->conf.key, key->conf.keylen)) { -+ if (ieee80211_key_identical(sdata, old_key, key)) { - ieee80211_key_free_unused(key); - ret = 0; - goto out; diff --git a/package/kernel/mac80211/patches/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/402-ath_regd_optional.patch index fae9b5552..edd4ce26b 100644 --- a/package/kernel/mac80211/patches/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/402-ath_regd_optional.patch @@ -106,7 +106,7 @@ ---help--- --- a/local-symbols +++ b/local-symbols -@@ -82,6 +82,7 @@ ADM8211= +@@ -87,6 +87,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch index 457c0cb28..00be2ef98 100644 --- a/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -2497,6 +2497,8 @@ void regulatory_hint_country_ie(struct w +@@ -2860,6 +2860,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* IE len must be evenly divisible by 2 */ if (country_ie_len & 0x01) return; -@@ -2703,6 +2705,7 @@ static void restore_regulatory_settings( +@@ -3066,6 +3068,7 @@ static void restore_regulatory_settings( void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch index 72857a0db..2a2d2f3cd 100644 --- a/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/522-mac80211_configure_antenna_gain.patch @@ -36,7 +36,7 @@ u8 ps_dtim_period; --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h -@@ -2149,6 +2149,9 @@ enum nl80211_commands { +@@ -2153,6 +2153,9 @@ enum nl80211_commands { * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. * @NL80211_ATTR_PORT_AUTHORIZED: (reserved) * @@ -46,7 +46,7 @@ * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -2575,6 +2578,8 @@ enum nl80211_attrs { +@@ -2579,6 +2582,8 @@ enum nl80211_attrs { NL80211_ATTR_PMKR0_NAME, NL80211_ATTR_PORT_AUTHORIZED, @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2444,6 +2444,19 @@ static int ieee80211_get_tx_power(struct +@@ -2447,6 +2447,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -3717,6 +3730,7 @@ const struct cfg80211_ops mac80211_confi +@@ -3720,6 +3733,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -87,7 +87,7 @@ CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1347,6 +1347,7 @@ struct ieee80211_local { +@@ -1348,6 +1348,7 @@ struct ieee80211_local { int dynamic_ps_forced_timeout; int user_power_level; /* in dBm, for all interfaces */ diff --git a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch index 7cf589485..6dd03fd28 100644 --- a/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/542-ath9k_debugfs_diag.patch @@ -125,7 +125,7 @@ REG_SET_BIT(ah, AR_BTCOEX_WL_LNADIV, AR_BTCOEX_WL_LNADIV_FORCE_ON); --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -527,6 +527,11 @@ irqreturn_t ath_isr(int irq, void *dev) +@@ -528,6 +528,11 @@ irqreturn_t ath_isr(int irq, void *dev) if (test_bit(ATH_OP_HW_RESET, &common->op_flags)) return IRQ_HANDLED; diff --git a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch index f3fead0a1..e86e3e38b 100644 --- a/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/549-ath9k_enable_gpio_buttons.patch @@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau #ifdef CPTCFG_MAC80211_LEDS -@@ -129,6 +131,64 @@ static void ath9k_unregister_gpio_chip(s +@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s sc->gpiochip = NULL; } @@ -59,6 +59,9 @@ Signed-off-by: Felix Fietkau + return; + + for (i = 0; i < pdata->num_btns; i++) { ++ if (pdata->btns[i].gpio == sc->sc_ah->led_pin) ++ sc->sc_ah->led_pin = -1; ++ + ath9k_hw_gpio_request_in(sc->sc_ah, pdata->btns[i].gpio, + "ath9k-gpio"); + bt[i].gpio = sc->gpiochip->gchip.base + pdata->btns[i].gpio; @@ -94,7 +97,7 @@ Signed-off-by: Felix Fietkau #else /* CONFIG_GPIOLIB */ static inline void ath9k_register_gpio_chip(struct ath_softc *sc) -@@ -139,6 +199,14 @@ static inline void ath9k_unregister_gpio +@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio { } @@ -109,7 +112,7 @@ Signed-off-by: Felix Fietkau #endif /* CONFIG_GPIOLIB */ /********************************/ -@@ -262,6 +330,7 @@ void ath_deinit_leds(struct ath_softc *s +@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s { struct ath_led *led; @@ -117,7 +120,7 @@ Signed-off-by: Felix Fietkau while (!list_empty(&sc->leds)) { led = list_first_entry(&sc->leds, struct ath_led, list); #ifdef CONFIG_GPIOLIB -@@ -301,6 +370,7 @@ void ath_init_leds(struct ath_softc *sc) +@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc) } ath_fill_led_pin(sc); diff --git a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch index 6d541d6a5..82b8109e0 100644 --- a/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/551-ath9k_ubnt_uap_plus_hsr.patch @@ -17,7 +17,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_hw *hw = sc->hw; -@@ -41,6 +44,11 @@ static int ath_set_channel(struct ath_so +@@ -42,6 +45,11 @@ static int ath_set_channel(struct ath_so ath_dbg(common, CONFIG, "Set channel: %d MHz width: %d\n", chan->center_freq, chandef->width); @@ -27,7 +27,7 @@ + } + /* update survey stats for the old channel before switching */ - spin_lock_bh(&common->cc_lock); + spin_lock_irqsave(&common->cc_lock, flags); ath_update_survey_stats(sc); --- /dev/null +++ b/drivers/net/wireless/ath/ath9k/hsr.c @@ -343,7 +343,7 @@ u8 ath9k_parse_mpdudensity(u8 mpdudensity) { -@@ -648,6 +650,7 @@ void ath_reset_work(struct work_struct * +@@ -649,6 +651,7 @@ void ath_reset_work(struct work_struct * static int ath9k_start(struct ieee80211_hw *hw) { struct ath_softc *sc = hw->priv; @@ -351,7 +351,7 @@ struct ath_hw *ah = sc->sc_ah; struct ath_common *common = ath9k_hw_common(ah); struct ieee80211_channel *curchan = sc->cur_chan->chandef.chan; -@@ -726,6 +729,11 @@ static int ath9k_start(struct ieee80211_ +@@ -727,6 +730,11 @@ static int ath9k_start(struct ieee80211_ AR_GPIO_OUTPUT_MUX_AS_OUTPUT); } @@ -386,7 +386,7 @@ #endif /* _LINUX_ATH9K_PLATFORM_H */ --- a/local-symbols +++ b/local-symbols -@@ -109,6 +109,7 @@ ATH9K_WOW= +@@ -114,6 +114,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch index 5ad99995c..b0c5d5ba3 100644 --- a/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch +++ b/package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch @@ -1,6 +1,6 @@ --- a/local-symbols +++ b/local-symbols -@@ -291,6 +291,7 @@ RT2X00_LIB_FIRMWARE= +@@ -296,6 +296,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch index cfde08d4e..885bc246b 100644 --- a/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch +++ b/package/kernel/mac80211/patches/801-libertas-configure-sysfs-links.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2043,6 +2043,8 @@ struct wireless_dev *lbs_cfg_alloc(struc +@@ -2040,6 +2040,8 @@ struct wireless_dev *lbs_cfg_alloc(struc goto err_wiphy_new; } @@ -11,7 +11,7 @@ err_wiphy_new: --- a/drivers/net/wireless/marvell/libertas/main.c +++ b/drivers/net/wireless/marvell/libertas/main.c -@@ -933,6 +933,7 @@ struct lbs_private *lbs_add_card(void *c +@@ -930,6 +930,7 @@ struct lbs_private *lbs_add_card(void *c goto err_adapter; } diff --git a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch index b26505de2..089ad2fe7 100644 --- a/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch +++ b/package/kernel/mac80211/patches/802-libertas-set-wireless-macaddr.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/libertas/cfg.c +++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -2119,6 +2119,8 @@ int lbs_cfg_register(struct lbs_private +@@ -2116,6 +2116,8 @@ int lbs_cfg_register(struct lbs_private wdev->wiphy->n_cipher_suites = ARRAY_SIZE(cipher_suites); wdev->wiphy->reg_notifier = lbs_reg_notifier; diff --git a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch index 94a25b680..3b1e9673b 100644 --- a/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/921-ath10k_init_devices_synchronously.patch @@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -2445,6 +2445,16 @@ int ath10k_core_register(struct ath10k * +@@ -2458,6 +2458,16 @@ int ath10k_core_register(struct ath10k * ar->chip_id = chip_id; queue_work(ar->workqueue, &ar->register_work); diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch index e0ab67176..21e7359bc 100644 --- a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8067,6 +8067,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -8080,6 +8080,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -8308,6 +8323,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -8352,6 +8367,12 @@ int ath10k_mac_register(struct ath10k *a wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch b/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch index 0af8025d9..ea30a9dfd 100644 --- a/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch +++ b/package/kernel/mac80211/patches/936-ath10k-fix-otp-failure-result.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c -@@ -757,7 +757,7 @@ static int ath10k_core_get_board_id_from +@@ -770,7 +770,7 @@ static int ath10k_core_get_board_id_from if (ret) { ath10k_err(ar, "could not execute otp for board id check: %d\n", ret); diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 811b31426..f8e70e54a 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_VERSION:=10.3.4.0-20171129 +PKG_VERSION:=10.3.4.0-20171214 PKG_RELEASE=1 PKG_LICENSE:=ISC @@ -16,8 +16,8 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=1522af59a501f74c8b6b02ae763829a79114a325 -PKG_MIRROR_HASH:=2de445e805db8b8eef907ae3cab41bdb4500b3f5563257c262fed3e5d0a63559 +PKG_SOURCE_VERSION:=843d00cd9c134629b9dad7162831ec5f136399b3 +PKG_MIRROR_HASH:=080c491473f0dbe9a7cac0fa3c6d004bf2dc3bd953a9f9d074eb8876a86437c2 PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/rotary-gpio-custom/Makefile b/package/kernel/rotary-gpio-custom/Makefile index e1cf7ff1d..f75856736 100644 --- a/package/kernel/rotary-gpio-custom/Makefile +++ b/package/kernel/rotary-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/rtc-rv5c386a/Makefile b/package/kernel/rtc-rv5c386a/Makefile index e97098207..a268ad508 100644 --- a/package/kernel/rtc-rv5c386a/Makefile +++ b/package/kernel/rtc-rv5c386a/Makefile @@ -23,8 +23,7 @@ endef define Build/Compile $(MAKE) -C "$(LINUX_DIR)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - ARCH="$(LINUX_KARCH)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(BUILDFLAGS)" \ modules diff --git a/package/kernel/spi-gpio-custom/Makefile b/package/kernel/spi-gpio-custom/Makefile index e6d692db4..19aef20ed 100644 --- a/package/kernel/spi-gpio-custom/Makefile +++ b/package/kernel/spi-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) \ MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/w1-gpio-custom/Makefile b/package/kernel/w1-gpio-custom/Makefile index 67fdc7d15..1008cf973 100644 --- a/package/kernel/w1-gpio-custom/Makefile +++ b/package/kernel/w1-gpio-custom/Makefile @@ -33,8 +33,7 @@ EXTRA_CFLAGS:= \ $(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(EXTRA_KCONFIG)))) MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" \ EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ $(EXTRA_KCONFIG) diff --git a/package/kernel/wrt55agv2-spidevs/Makefile b/package/kernel/wrt55agv2-spidevs/Makefile index 169f6b4da..d80c1e570 100644 --- a/package/kernel/wrt55agv2-spidevs/Makefile +++ b/package/kernel/wrt55agv2-spidevs/Makefile @@ -25,8 +25,7 @@ define KernelPackage/wrt55agv2-spidevs/description endef MAKE_OPTS:= \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ SUBDIRS="$(PKG_BUILD_DIR)" define Build/Compile diff --git a/package/kernel/shortcut-fe/Makefile b/package/lean/shortcut-fe/Makefile similarity index 100% rename from package/kernel/shortcut-fe/Makefile rename to package/lean/shortcut-fe/Makefile diff --git a/package/kernel/shortcut-fe/src/Kconfig b/package/lean/shortcut-fe/src/Kconfig similarity index 100% rename from package/kernel/shortcut-fe/src/Kconfig rename to package/lean/shortcut-fe/src/Kconfig diff --git a/package/kernel/shortcut-fe/src/Makefile b/package/lean/shortcut-fe/src/Makefile similarity index 100% rename from package/kernel/shortcut-fe/src/Makefile rename to package/lean/shortcut-fe/src/Makefile diff --git a/package/kernel/shortcut-fe/src/README b/package/lean/shortcut-fe/src/README similarity index 100% rename from package/kernel/shortcut-fe/src/README rename to package/lean/shortcut-fe/src/README diff --git a/package/kernel/shortcut-fe/src/fast-classifier.c b/package/lean/shortcut-fe/src/fast-classifier.c similarity index 100% rename from package/kernel/shortcut-fe/src/fast-classifier.c rename to package/lean/shortcut-fe/src/fast-classifier.c diff --git a/package/kernel/shortcut-fe/src/fast-classifier.h b/package/lean/shortcut-fe/src/fast-classifier.h similarity index 100% rename from package/kernel/shortcut-fe/src/fast-classifier.h rename to package/lean/shortcut-fe/src/fast-classifier.h diff --git a/package/kernel/shortcut-fe/src/nl_classifier_test.c b/package/lean/shortcut-fe/src/nl_classifier_test.c similarity index 100% rename from package/kernel/shortcut-fe/src/nl_classifier_test.c rename to package/lean/shortcut-fe/src/nl_classifier_test.c diff --git a/package/kernel/shortcut-fe/src/sfe.h b/package/lean/shortcut-fe/src/sfe.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe.h rename to package/lean/shortcut-fe/src/sfe.h diff --git a/package/kernel/shortcut-fe/src/sfe_backport.h b/package/lean/shortcut-fe/src/sfe_backport.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_backport.h rename to package/lean/shortcut-fe/src/sfe_backport.h diff --git a/package/kernel/shortcut-fe/src/sfe_cm.c b/package/lean/shortcut-fe/src/sfe_cm.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_cm.c rename to package/lean/shortcut-fe/src/sfe_cm.c diff --git a/package/kernel/shortcut-fe/src/sfe_cm.h b/package/lean/shortcut-fe/src/sfe_cm.h similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_cm.h rename to package/lean/shortcut-fe/src/sfe_cm.h diff --git a/package/kernel/shortcut-fe/src/sfe_ipv4.c b/package/lean/shortcut-fe/src/sfe_ipv4.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_ipv4.c rename to package/lean/shortcut-fe/src/sfe_ipv4.c diff --git a/package/kernel/shortcut-fe/src/sfe_ipv6.c b/package/lean/shortcut-fe/src/sfe_ipv6.c similarity index 100% rename from package/kernel/shortcut-fe/src/sfe_ipv6.c rename to package/lean/shortcut-fe/src/sfe_ipv6.c diff --git a/package/kernel/shortcut-fe/src/userspace_example.c b/package/lean/shortcut-fe/src/userspace_example.c similarity index 100% rename from package/kernel/shortcut-fe/src/userspace_example.c rename to package/lean/shortcut-fe/src/userspace_example.c diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch index 4a90751e1..2dcfe9c21 100644 --- a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch +++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch @@ -18,9 +18,9 @@ No __THROW in function implementation. --jsaw ---- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 -+++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 -@@ -560,17 +560,17 @@ +--- a/argp.h ++++ b/argp.h +@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a # endif # ifndef ARGP_EI @@ -41,7 +41,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -582,7 +582,7 @@ +@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o } ARGP_EI int @@ -50,9 +50,9 @@ No __THROW in function implementation. { return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; } ---- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 -+++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 -@@ -1290,13 +1290,13 @@ +--- a/argp-parse.c ++++ b/argp-parse.c +@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input) /* Defined here, in case a user is not inlining the definitions in * argp.h */ void @@ -68,7 +68,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -1310,7 +1310,7 @@ +@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o } int diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 869513f16..07e1eb815 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0+ PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3 +PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils PKG_INSTALL:=1 PKG_USE_MIPS16:=0 @@ -68,7 +69,7 @@ endif CONFIGURE_ARGS += \ --without-lzma -TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result +TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index deb484010..db6aee750 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -19,6 +19,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 99034bb22..5d56f37c5 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -17,6 +17,7 @@ PKG_SOURCE_URL:=@SF/levent PKG_HASH:=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:libevent_project:libevent PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 359a688f1..eeb7870f0 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:json-c_project:json-c PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index 399aa6ce1..be8228531 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_conntrack -PKG_VERSION:=1.0.6 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \ - ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/ -PKG_HASH:=efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack +PKG_SOURCE_DATE:=2017-07-25 +PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5 +PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57 + PKG_MAINTAINER:=Jo-Philipp Wich PKG_FIXUP:=autoreconf diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile index dd8fd9f09..8a11d0798 100644 --- a/package/libs/libnetfilter-queue/Makefile +++ b/package/libs/libnetfilter-queue/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=libnetfilter_queue PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=http://git.netfilter.org/libnetfilter_queue -PKG_SOURCE_DATE:=2016-07-03 -PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098 -PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f +PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue +PKG_SOURCE_DATE:=2017-06-27 +PKG_SOURCE_VERSION:=601abd1c71ccdf90753cf294c120ad43fb25dc54 +PKG_MIRROR_HASH:=283b99cfe5856dc87fd6bab8f78c0c59b72462d6b4f2b13111f928cf33020eb3 PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch index 81faffe82..92e750d51 100644 --- a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch +++ b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint sum += *buf++; size -= sizeof(uint16_t); } @@ -24,7 +24,7 @@ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >>16); -@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint return (uint16_t)(~sum); } @@ -33,7 +33,7 @@ { uint32_t sum = 0; uint32_t iph_len = iph->ihl*4; -@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph) +@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct sum += (iph->saddr) & 0xFFFF; sum += (iph->daddr >> 16) & 0xFFFF; sum += (iph->daddr) & 0xFFFF; @@ -49,7 +49,7 @@ { uint32_t sum = 0; uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h; -@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr) +@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF; sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF; } @@ -58,11 +58,9 @@ sum += htons(ip6h->ip6_plen); return nfq_checksum(sum, (uint16_t *)payload, len); -diff --git a/src/extra/tcp.c b/src/extra/tcp.c -index d1cd79d..a66f392 100644 --- a/src/extra/tcp.c +++ b/src/extra/tcp.c -@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -71,7 +69,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4); -@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h) +@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -82,7 +80,7 @@ index d1cd79d..a66f392 100644 --- a/src/extra/udp.c +++ b/src/extra/udp.c -@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; @@ -91,7 +89,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4); -@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h) +@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index f7d6875b6..f4a1bb132 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=libnftnl PKG_VERSION:=1.0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/libnftnl +PKG_SOURCE_URL:=https://git.netfilter.org/libnftnl PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=libnftnl-1.0.7 PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9 diff --git a/package/libs/libnl-tiny/src/msg.c b/package/libs/libnl-tiny/src/msg.c index e84c281fc..b502047c4 100644 --- a/package/libs/libnl-tiny/src/msg.c +++ b/package/libs/libnl-tiny/src/msg.c @@ -166,12 +166,7 @@ #include #include -static size_t default_msg_size; - -static void __init init_msg_size(void) -{ - default_msg_size = getpagesize(); -} +static size_t default_msg_size = 4096; /** * @name Attribute Access diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 7916556c0..67201cc7c 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -8,14 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.2.29 +PKG_VERSION:=3.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_2_29 -PKG_HASH:=0beb593dc6abfffa18a5c787b27884979c1b7e7f1fd468c801e3cc938a685922 +PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_3_0 +PKG_HASH:=705468b5ae4cd1eb099d2d1c476d6a3abe519bc2810becf12fb1e32de1e074e4 PKG_LICENSE:=LGPL-2.1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk define Package/libnl/default @@ -77,13 +80,6 @@ endef TARGET_CFLAGS += -ffunction-sections $(FPIC) -define Build/Compile - $(call Build/Compile/Default) - make -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - install -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/ diff --git a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch b/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch deleted file mode 100644 index a31ef4772..000000000 --- a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 098a4cc35b0da4438b8b67a914edecebef5bb6a9 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Fri, 10 Mar 2017 13:22:14 +0300 -Subject: [PATCH] lib: Escape usage of strerror_l() if it doesn't exist in libc - -uClibc doesn't implement strerror_l() and thus libnl starting from -3.2.29 couldn't be compiled with it any longer. - -To work-around that problem we'll just do a check on strerror_l() -availability during configuration and if it's not there just fall back -to locale-less strerror(). - -Signed-off-by: Alexey Brodkin -Cc: Andre Draszik -Cc: Thomas Haller ---- - -This patch is now accepted upstream and will be a part of the next libnl -release, see -https://github.com/thom311/libnl/commit/e15966ac7f3b43df2acf869f98089762807d0568 - - configure.ac | 2 ++ - lib/utils.c | 8 +++++++- - src/lib/utils.c | 6 ++++++ - 3 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 68b285e5b15c..2739b997ee3a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -121,6 +121,8 @@ fi - - AC_CONFIG_SUBDIRS([doc]) - -+AC_CHECK_FUNCS([strerror_l]) -+ - AC_CONFIG_FILES([ - Makefile - libnl-3.0.pc -diff --git a/lib/utils.c b/lib/utils.c -index fb350d13fd2f..06273c5b291e 100644 ---- a/lib/utils.c -+++ b/lib/utils.c -@@ -30,7 +30,9 @@ - #include - #include - #include /* exit() */ -+#ifdef HAVE_STRERROR_L - #include -+#endif - - /** - * Global variable indicating the desired level of debugging output. -@@ -123,9 +125,10 @@ int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *)) - - const char *nl_strerror_l(int err) - { -+ const char *buf; -+#ifdef HAVE_STRERROR_L - int errno_save = errno; - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); -- const char *buf; - - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -140,6 +143,9 @@ const char *nl_strerror_l(int err) - } - - errno = errno_save; -+#else -+ buf = strerror(err); -+#endif - return buf; - } - /** @endcond */ -diff --git a/src/lib/utils.c b/src/lib/utils.c -index 5878f279c364..feb1d4ef4056 100644 ---- a/src/lib/utils.c -+++ b/src/lib/utils.c -@@ -81,6 +81,7 @@ void nl_cli_fatal(int err, const char *fmt, ...) - fprintf(stderr, "\n"); - } else { - char *buf; -+#ifdef HAVE_STRERROR_L - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -91,9 +92,14 @@ void nl_cli_fatal(int err, const char *fmt, ...) - } - if (loc != (locale_t)0) - buf = strerror_l(err, loc); -+#else -+ buf = strerror(err); -+#endif - fprintf(stderr, "%s\n", buf); -+#ifdef HAVE_STRERROR_L - if (loc != (locale_t)0) - freelocale(loc); -+#endif - } - - exit(abs(err)); --- -2.7.4 - diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch new file mode 100644 index 000000000..845a59376 --- /dev/null +++ b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch @@ -0,0 +1,30 @@ +From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 7 Mar 2015 11:34:42 +0100 +Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file + +In order to support static linking, the libnl pkg-config file should +indicate in its Libs.private field the libraries that libnl-3.0.a +requires. The LIBS variable contains the appropriate list of +libraries: -lm in all cases, and -lpthread when pthread support is +enabled. This allows to statically link applications against libnl +properly. + +Signed-off-by: Thomas Petazzoni +--- + libnl-3.0.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in +index b87e3dc..ddbc999 100644 +--- a/libnl-3.0.pc.in ++++ b/libnl-3.0.pc.in +@@ -7,4 +7,5 @@ Name: libnl + Description: Convenience library for netlink sockets + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lnl-@MAJ_VERSION@ ++Libs.private: @LIBS@ + Cflags: -I${includedir}/libnl@MAJ_VERSION@ +-- +2.1.0 + diff --git a/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch new file mode 100644 index 000000000..11dc75b89 --- /dev/null +++ b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch @@ -0,0 +1,103 @@ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h +--- /include/linux-private/linux/if_ether.h 2017-03-08 19:56:31.824516933 -0800 ++++ /include/linux-private/linux/if_ether.h 2017-03-08 20:07:01.938237767 -0800 +@@ -22,6 +22,7 @@ + #define _LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -117,10 +118,12 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + #endif /* _LINUX_IF_ETHER_H */ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h +--- /include/linux-private/linux/libc-compat.h 2017-03-08 19:56:31.823516923 -0800 ++++ /include/linux-private/linux/libc-compat.h 2017-03-08 20:12:30.376843489 -0800 +@@ -48,10 +48,18 @@ + #ifndef _LIBC_COMPAT_H + #define _LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We're used from userspace... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/if_ether.h */ ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else ++/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + + /* GLIBC headers included first so don't define anything +@@ -64,15 +72,7 @@ + #define __UAPI_DEF_IN_CLASS 0 + + #define __UAPI_DEF_IN6_ADDR 0 +-/* The exception is the in6_addr macros which must be defined +- * if the glibc code didn't define them. This guard matches +- * the guard in glibc/inet/netinet/in.h which defines the +- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 +-#else +-#define __UAPI_DEF_IN6_ADDR_ALT 1 +-#endif + #define __UAPI_DEF_SOCKADDR_IN6 0 + #define __UAPI_DEF_IPV6_MREQ 0 + #define __UAPI_DEF_IPPROTO_V6 0 +@@ -83,7 +83,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -93,7 +93,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -115,7 +115,10 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ ++ ++/* Definitions for if/ether.h */ ++#define __UAPI_DEF_ETHHDR 1 + + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 +@@ -138,6 +141,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* defined(__KERNEL__) */ + + #endif /* _LIBC_COMPAT_H */ diff --git a/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch new file mode 100644 index 000000000..f715bb83f --- /dev/null +++ b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch @@ -0,0 +1,115 @@ +From 68f8393bd356a3d0598cf77e1044b7e8b98aa4d8 Mon Sep 17 00:00:00 2001 +Message-Id: <68f8393bd356a3d0598cf77e1044b7e8b98aa4d8.1493920165.git.baruch@tkos.co.il> +From: Baruch Siach +Date: Thu, 4 May 2017 15:56:14 +0300 +Subject: [PATCH] Revert "build: enable building cli during tests" + +This reverts commit 3cb28534d34392ceec4adead0cfa97039796ccb7. + +Contrary to what 3cb28534d commit log claims, the cli programs depend on +dynamic libraries support of the toolchain. Enabling cli programs +unconditionally breaks static build as follows: + +In file included from lib/cli/cls/basic.c:12:0: +./include/netlink/cli/utils.h:25:19: fatal error: dlfcn.h: No such file or directory +compilation terminated. +Makefile:3666: recipe for target 'lib/cli/cls/lib_cli_cls_basic_la-basic.lo' failed +make[1]: *** [lib/cli/cls/lib_cli_cls_basic_la-basic.lo] Error 1 + +Revert that commit to restore the ability of static only build of libnl, and +its dependencies. + +Signed-off-by: Baruch Siach +--- +Upstream status: https://github.com/thom311/libnl/pull/141 + + Makefile.am | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 1b95a559304f..279548394650 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,8 +3,6 @@ + ACLOCAL_AMFLAGS = -I m4 + + lib_LTLIBRARIES = +-noinst_LTLIBRARIES = +-check_LTLIBRARIES = + + check_PROGRAMS = + check_programs = +@@ -500,6 +498,8 @@ EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \ + lib_libnl_xfrm_3_la_LIBADD = \ + lib/libnl-3.la + ++if ENABLE_CLI ++ + lib_cli_ltlibraries_cls = \ + lib/cli/cls/basic.la \ + lib/cli/cls/cgroup.la +@@ -513,15 +513,11 @@ lib_cli_ltlibraries_qdisc = \ + lib/cli/qdisc/pfifo.la \ + lib/cli/qdisc/plug.la + +-if ENABLE_CLI + pkglib_clsdir = $(pkglibdir)/cli/cls + pkglib_qdiscdir = $(pkglibdir)/cli/qdisc + pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls) + pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc) +-else +-noinst_LTLIBRARIES += \ +- $(lib_cli_ltlibraries_cls) \ +- $(lib_cli_ltlibraries_qdisc) ++ + endif + + lib_cli_ldflags = \ +@@ -550,13 +546,8 @@ lib_cli_qdisc_plug_la_LDFLAGS = $(lib_cli_ldflags) + + ############################################################################### + +-src_lib_ldflags = +- + if ENABLE_CLI + lib_LTLIBRARIES += src/lib/libnl-cli-3.la +-src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +-else +-check_LTLIBRARIES += src/lib/libnl-cli-3.la + endif + + src_lib_libnl_cli_3_la_SOURCES = \ +@@ -583,7 +574,7 @@ src_lib_libnl_cli_3_la_CPPFLAGS = \ + -I$(srcdir)/include \ + -I$(builddir)/include + src_lib_libnl_cli_3_la_LDFLAGS = \ +- $(src_lib_ldflags) \ ++ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(srcdir)/libnl-cli-3.sym + src_lib_libnl_cli_3_la_LIBADD = \ + lib/libnl-3.la \ +@@ -668,8 +659,6 @@ else + noinst_PROGRAMS += $(cli_programs) + endif + endif +-else +-check_PROGRAMS += $(cli_programs) + endif + + src_genl_ctrl_list_CPPFLAGS = $(src_cppflags) +@@ -847,10 +836,12 @@ tests_test_complex_HTB_with_hash_filters_LDADD = $(tests_ldadd) + tests_test_u32_filter_with_actions_CPPFLAGS = $(tests_cppflags) + tests_test_u32_filter_with_actions_LDADD = $(tests_ldadd) + ++if ENABLE_CLI + check_PROGRAMS += \ + tests/test-cache-mngr \ + tests/test-genl \ + tests/test-nf-cache-mngr ++endif + + tests_cli_ldadd = \ + $(tests_ldadd) \ +-- +2.11.0 + diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 5eb521a72..8cef09f78 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=afcce660d3dc54c63a0a5ba3cf05272239dc3c54bbeba20f6bad250f9dc007ae PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_BUILD_PARALLEL:=0 diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 5fdf94641..36a3bbeb2 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git -PKG_SOURCE_DATE:=2017-09-29 -PKG_SOURCE_VERSION:=632688e8d6cde32781e4ec685d59afb0938300ad -PKG_MIRROR_HASH:=84b5a0bc404e96a2965cadc1beb92664f4c22cc878a0a624eecd4b6884b56625 +PKG_SOURCE_DATE:=2018-01-07 +PKG_SOURCE_VERSION:=1c08e80313fd487112c48346889cc57badeef751 +PKG_MIRROR_HASH:=58cad98de55d44d7791e5d49b809ac5c32d3e6c481dc385b10e02386853f2263 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile index 913d61623..2e655ed6f 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libunwind PKG_VERSION:=1.2.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SAVANNAH/$(PKG_NAME) @@ -20,9 +20,11 @@ PKG_INSTALL:=1 PKG_LICENSE:=X11 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind PKG_MAINTAINER:=Yousong Zhou +PKG_SSP:=0 include $(INCLUDE_DIR)/package.mk define Package/libunwind diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 59c5a80bd..0dc93941a 100644 --- a/package/libs/libusb-compat/Makefile +++ b/package/libs/libusb-compat/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb-compat -PKG_VERSION:=0.1.4 -PKG_RELEASE:=2 +PKG_VERSION:=0.1.5 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/libusb -PKG_HASH:=ed5bdd160c7b01ef767fb931a81b454f46226d1e2cf58502ced758d3e5a9fdc4 +PKG_HASH:=404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 0e3383150..3a2b29228 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=a99959d7360def22f9108d2d487c9de384fe76c349697176b1f22370080d5810 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:arm:mbed_tls include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile new file mode 100644 index 000000000..3cc2a5543 --- /dev/null +++ b/package/libs/nghttp2/Makefile @@ -0,0 +1,45 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=nghttp2 +PKG_VERSION:=1.29.0 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + +PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2/releases/download/v$(PKG_VERSION) +PKG_HASH:=a7a1b18be57be6a53a7739988ea27d6ec9209e7b0e8372b8483cd911d7838739 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libnghttp2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library implementing the framing layer of HTTP/2 + MAINTAINER:=Hans Dedecker +endef + +define Package/libnghttp2/description + C library implementing the framing layer of the HTTP/2 protocol. It can be used to build a HTTP/2-capable HTTP client or server +endef + +CMAKE_OPTIONS += \ + -DENABLE_LIB_ONLY=ON + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/nghttp2 + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h $(1)/usr/include/nghttp2/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/ +endef + +define Package/libnghttp2/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libnghttp2)) diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in index 40fc945ea..96d3ba3e9 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -49,20 +49,20 @@ config OPENSSL_ENGINE_DIGEST bool depends on OPENSSL_ENGINE_CRYPTO prompt "Digests acceleration support" - -config OPENSSL_THREADS - bool - prompt "Threading support" - default y - select PACKAGE_libpthread config OPENSSL_HARDWARE_SUPPORT bool default n prompt "Enable hardware support" +config OPENSSL_OPTIMIZE_SPEED + bool + default n + prompt "Enable optimization for speed instead of size" + endif config OPENSSL_ENGINE_CRYPTO bool + select OPENSSL_HARDWARE_SUPPORT prompt "Crypto acceleration support" if PACKAGE_libopenssl diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 37dae96fe..b75aa45e8 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openssl PKG_BASE:=1.0.2 -PKG_BUGFIX:=l +PKG_BUGFIX:=n PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX) -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=0 @@ -24,10 +24,11 @@ PKG_SOURCE_URL:= \ http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ http://www.openssl.org/source/ \ http://www.openssl.org/source/old/$(PKG_BASE)/ -PKG_HASH:=ce07195b659e75f4e1db43552860070061f156a98bb37b672b101ba6e3ddf30c +PKG_HASH:=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:openssl:openssl PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_ENGINE_CRYPTO \ CONFIG_OPENSSL_ENGINE_DIGEST \ @@ -35,13 +36,13 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_WITH_EC2M \ CONFIG_OPENSSL_WITH_SSL3 \ CONFIG_OPENSSL_HARDWARE_SUPPORT \ - CONFIG_OPENSSL_THREADS \ CONFIG_OPENSSL_WITH_DEPRECATED \ CONFIG_OPENSSL_WITH_DTLS \ CONFIG_OPENSSL_WITH_COMPRESSION \ CONFIG_OPENSSL_WITH_NPN \ CONFIG_OPENSSL_WITH_PSK \ - CONFIG_OPENSSL_WITH_SRP + CONFIG_OPENSSL_WITH_SRP \ + CONFIG_OPENSSL_OPTIMIZE_SPEED include $(INCLUDE_DIR)/package.mk @@ -129,12 +130,6 @@ ifndef CONFIG_OPENSSL_HARDWARE_SUPPORT OPENSSL_OPTIONS += no-hw endif -ifdef CONFIG_OPENSSL_THREADS - OPENSSL_OPTIONS += threads -else - OPENSSL_OPTIONS += no-threads -endif - ifndef CONFIG_OPENSSL_WITH_DEPRECATED OPENSSL_OPTIONS += no-deprecated endif @@ -161,6 +156,10 @@ ifndef CONFIG_OPENSSL_WITH_SRP OPENSSL_OPTIONS += no-srp endif +ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y) + TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3 +endif + ifeq ($(CONFIG_x86_64),y) OPENSSL_TARGET:=linux-x86_64-openwrt OPENSSL_MAKEFLAGS += LIBDIR=lib @@ -191,7 +190,7 @@ define Build/Configure --openssldir=/etc/ssl \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) -ldl \ - -DOPENSSL_SMALL_FOOTPRINT \ + $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \ $(OPENSSL_NO_CIPHERS) \ $(OPENSSL_OPTIONS) \ ) diff --git a/package/libs/openssl/patches/150-no_engines.patch b/package/libs/openssl/patches/150-no_engines.patch index f8c5d6e6c..1cb04bdab 100644 --- a/package/libs/openssl/patches/150-no_engines.patch +++ b/package/libs/openssl/patches/150-no_engines.patch @@ -1,6 +1,6 @@ --- a/Configure +++ b/Configure -@@ -2129,6 +2129,11 @@ EOF +@@ -2130,6 +2130,11 @@ EOF close(OUT); } diff --git a/package/libs/readline/Makefile b/package/libs/readline/Makefile index ccd20a4b1..ca3a46863 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/readline/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:readline PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 2c4c62623..3eefa2e01 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/uclient.git -PKG_SOURCE_DATE:=2017-09-06 -PKG_SOURCE_VERSION:=24d6eded73dec427fc4a3a20cc73c94227f59c31 -PKG_MIRROR_HASH:=e884ae0c859baa20a5c7f3d924022f8e1f57d28474dbe5fed1efb8fb97790dd0 +PKG_SOURCE_DATE:=2017-11-02 +PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c +PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3 CMAKE_INSTALL:=1 PKG_BUILD_DEPENDS:=ustream-ssl diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ff6c4b7d0..7afbeeba6 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -35,11 +35,11 @@ define Package/libustream-openssl VARIANT:=openssl endef -define Package/libustream-cyassl +define Package/libustream-wolfssl $(Package/libustream/default) - TITLE += (cyassl) - DEPENDS += +PACKAGE_libustream-cyassl:libcyassl - VARIANT:=cyassl + TITLE += (wolfssl) + DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl + VARIANT:=wolfssl endef define Package/libustream-mbedtls @@ -50,7 +50,7 @@ define Package/libustream-mbedtls DEFAULT_VARIANT:=1 endef -ifeq ($(BUILD_VARIANT),cyassl) +ifeq ($(BUILD_VARIANT),wolfssl) TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/cyassl -DHAVE_SNI CMAKE_OPTIONS += -DCYASSL=on endif @@ -64,9 +64,9 @@ define Package/libustream/default/install endef Package/libustream-openssl/install = $(Package/libustream/default/install) -Package/libustream-cyassl/install = $(Package/libustream/default/install) +Package/libustream-wolfssl/install = $(Package/libustream/default/install) Package/libustream-mbedtls/install = $(Package/libustream/default/install) $(eval $(call BuildPackage,libustream-mbedtls)) -$(eval $(call BuildPackage,libustream-cyassl)) +$(eval $(call BuildPackage,libustream-wolfssl)) $(eval $(call BuildPackage,libustream-openssl)) diff --git a/package/libs/cyassl/Config.in b/package/libs/wolfssl/Config.in similarity index 63% rename from package/libs/cyassl/Config.in rename to package/libs/wolfssl/Config.in index 371bb564f..7e8a4b6ce 100644 --- a/package/libs/cyassl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -1,47 +1,47 @@ -if PACKAGE_libcyassl +if PACKAGE_libwolfssl -config CYASSL_HAS_AES_CCM +config WOLFSSL_HAS_AES_CCM bool "Include AES-CCM support" default n -config CYASSL_HAS_AES_GCM +config WOLFSSL_HAS_AES_GCM bool "Include AES-GCM support" default n -config CYASSL_HAS_CHACHA +config WOLFSSL_HAS_CHACHA bool "Include ChaCha cipher suite support" default n -config CYASSL_HAS_ECC +config WOLFSSL_HAS_ECC bool "Include ECC (Elliptic Curve Cryptography) support" default y -config CYASSL_HAS_DH +config WOLFSSL_HAS_DH bool "Include DH (Diffie-Hellman) support" default n -config CYASSL_HAS_ARC4 +config WOLFSSL_HAS_ARC4 bool "Include ARC4 support" default n -config CYASSL_HAS_DES3 +config WOLFSSL_HAS_DES3 bool "Include DES3 (Tripple-DES) support" default n -config CYASSL_HAS_PSK +config WOLFSSL_HAS_PSK bool "Include PKS (Pre Share Key) support" default n -config CYASSL_HAS_DTLS +config WOLFSSL_HAS_DTLS bool "Include DTLS support" default n -config CYASSL_HAS_ECC25519 +config WOLFSSL_HAS_ECC25519 bool "Include ECC Curve 22519 support" - depends on CYASSL_HAS_ECC + depends on WOLFSSL_HAS_ECC default n -config CYASSL_HAS_POLY_1305 +config WOLFSSL_HAS_POLY_1305 bool "Include Poly-1305 support" default n diff --git a/package/libs/cyassl/Makefile b/package/libs/wolfssl/Makefile similarity index 65% rename from package/libs/cyassl/Makefile rename to package/libs/wolfssl/Makefile index 68646d9b0..1d4b7f557 100644 --- a/package/libs/cyassl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2016 OpenWrt.org +# Copyright (C) 2006-2017 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,36 +8,39 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=3.10.0 +PKG_VERSION:=3.12.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).zip PKG_SOURCE_URL:=https://www.wolfssl.com/ -PKG_HASH:=66f7f2a8b8ee37d6b4beab3cb0dcb6a6980fd4674373bfd3bf1214b9d0d2c02e +PKG_HASH:=4993844c4b7919007c4511ec3f987fb06543536c3fc933cb53491bffe9150e49 PKG_FIXUP:=libtool PKG_INSTALL:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:yassl:cyassl include $(INCLUDE_DIR)/package.mk -define Package/libcyassl +define Package/libwolfssl SECTION:=libs SUBMENU:=SSL CATEGORY:=Libraries - TITLE:=CyaSSL library + TITLE:=wolfSSL library URL:=http://www.wolfssl.com/ + MAINTAINER:=Alexandru Ardelean MENU:=1 + PROVIDES:=libcyassl endef -define Package/libcyassl/description -CyaSSL is an SSL library optimized for small footprint, both on disk and for -memory use. +define Package/libwolfssl/description +wolfSSL (formerly CyaSSL) is an SSL library optimized for small +footprint, both on disk and for memory use. endef -define Package/libcyassl/config +define Package/libwolfssl/config source "$(SOURCE)/Config.in" endef @@ -55,58 +58,58 @@ CONFIGURE_ARGS += \ --enable-ipv6 endif -ifeq ($(CONFIG_CYASSL_HAS_AES_CCM),y) +ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y) CONFIGURE_ARGS += \ --enable-aesccm endif -ifeq ($(CONFIG_CYASSL_HAS_AES_GCM),y) +ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y) CONFIGURE_ARGS += \ - --enable-aesgcm + --disable-aesgcm endif -ifeq ($(CONFIG_CYASSL_HAS_CHACHA),y) +ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y) CONFIGURE_ARGS += \ - --enable-chacha + --disable-chacha endif -ifeq ($(CONFIG_CYASSL_HAS_ECC),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y) CONFIGURE_ARGS += \ --enable-ecc \ --enable-supportedcurves endif -ifeq ($(CONFIG_CYASSL_HAS_DH),y) +ifneq ($(CONFIG_WOLFSSL_HAS_DH),y) CONFIGURE_ARGS += \ --enable-dh endif -ifeq ($(CONFIG_CYASSL_HAS_ARC4),n) +ifeq ($(CONFIG_WOLFSSL_HAS_ARC4),n) CONFIGURE_ARGS += \ --disable-arc4 endif -ifeq ($(CONFIG_CYASSL_HAS_DES3),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DES3),y) CONFIGURE_ARGS += \ --disable-des3 endif -ifeq ($(CONFIG_CYASSL_HAS_PSK),y) +ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y) CONFIGURE_ARGS += \ --enable-psk endif -ifeq ($(CONFIG_CYASSL_HAS_DTLS),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y) CONFIGURE_ARGS += \ --enable-dtls endif -ifeq ($(CONFIG_CYASSL_HAS_ECC25519),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y) CONFIGURE_ARGS += \ - --enable-ecc25519 + --enable-curve25519 endif -ifeq ($(CONFIG_CYASSL_HAS_POLY1305),y) +ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y) CONFIGURE_ARGS += \ --enable-poly1305 endif @@ -130,10 +133,10 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endef -define Package/libcyassl/install +define Package/libwolfssl/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/ ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so endef -$(eval $(call BuildPackage,libcyassl)) +$(eval $(call BuildPackage,libwolfssl)) diff --git a/package/libs/wolfssl/patches/001-CVE-2017-13099.patch b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch new file mode 100644 index 000000000..e7b63cb8d --- /dev/null +++ b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch @@ -0,0 +1,144 @@ +From fd455d5a5e9fef24c208e7ac7d3a4bc58834cbf1 Mon Sep 17 00:00:00 2001 +From: David Garske +Date: Tue, 14 Nov 2017 14:05:50 -0800 +Subject: [PATCH] Fix for handling of static RSA PKCS formatting failures so + they are indistinguishable from from correctly formatted RSA blocks (per + RFC5246 section 7.4.7.1). Adjusted the static RSA preMasterSecret RNG + creation for consistency in client case. Removed obsolete + `PMS_VERSION_ERROR`. + +--- + src/internal.c | 70 +++++++++++++++++++++++++++++++++++++++++++++-------- + wolfssl/error-ssl.h | 2 +- + 2 files changed, 61 insertions(+), 11 deletions(-) + +--- a/src/internal.c ++++ b/src/internal.c +@@ -14190,9 +14190,6 @@ const char* wolfSSL_ERR_reason_error_str + case NOT_READY_ERROR : + return "handshake layer not ready yet, complete first"; + +- case PMS_VERSION_ERROR : +- return "premaster secret version mismatch error"; +- + case VERSION_ERROR : + return "record layer version error"; + +@@ -18758,8 +18755,10 @@ int SendClientKeyExchange(WOLFSSL* ssl) + #ifndef NO_RSA + case rsa_kea: + { ++ /* build PreMasterSecret with RNG data */ + ret = wc_RNG_GenerateBlock(ssl->rng, +- ssl->arrays->preMasterSecret, SECRET_LEN); ++ &ssl->arrays->preMasterSecret[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); + if (ret != 0) { + goto exit_scke; + } +@@ -23545,6 +23544,9 @@ static int DoSessionTicket(WOLFSSL* ssl, + word32 idx; + word32 begin; + word32 sigSz; ++ #ifndef NO_RSA ++ int lastErr; ++ #endif + } DckeArgs; + + static void FreeDckeArgs(WOLFSSL* ssl, void* pArgs) +@@ -23770,6 +23772,14 @@ static int DoSessionTicket(WOLFSSL* ssl, + ERROR_OUT(BUFFER_ERROR, exit_dcke); + } + ++ /* pre-load PreMasterSecret with RNG data */ ++ ret = wc_RNG_GenerateBlock(ssl->rng, ++ &ssl->arrays->preMasterSecret[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); ++ if (ret != 0) { ++ goto exit_dcke; ++ } ++ + args->output = NULL; + break; + } /* rsa_kea */ +@@ -24234,6 +24244,20 @@ static int DoSessionTicket(WOLFSSL* ssl, + NULL, 0, NULL + #endif + ); ++ ++ /* Errors that can occur here that should be ++ * indistinguishable: ++ * RSA_BUFFER_E, RSA_PAD_E and RSA_PRIVATE_ERROR ++ */ ++ if (ret < 0 && ret != BAD_FUNC_ARG) { ++ #ifdef WOLFSSL_ASYNC_CRYPT ++ if (ret == WC_PENDING_E) ++ goto exit_dcke; ++ #endif ++ /* store error code for handling below */ ++ args->lastErr = ret; ++ ret = 0; ++ } + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ +@@ -24380,16 +24404,42 @@ static int DoSessionTicket(WOLFSSL* ssl, + /* Add the signature length to idx */ + args->idx += args->length; + +- if (args->sigSz == SECRET_LEN && args->output != NULL) { +- XMEMCPY(ssl->arrays->preMasterSecret, args->output, SECRET_LEN); +- if (ssl->arrays->preMasterSecret[0] != ssl->chVersion.major || +- ssl->arrays->preMasterSecret[1] != ssl->chVersion.minor) { +- ERROR_OUT(PMS_VERSION_ERROR, exit_dcke); ++ #ifdef DEBUG_WOLFSSL ++ /* check version (debug warning message only) */ ++ if (args->output != NULL) { ++ if (args->output[0] != ssl->chVersion.major || ++ args->output[1] != ssl->chVersion.minor) { ++ WOLFSSL_MSG("preMasterSecret version mismatch"); + } + } ++ #endif ++ ++ /* RFC5246 7.4.7.1: ++ * Treat incorrectly formatted message blocks and/or ++ * mismatched version numbers in a manner ++ * indistinguishable from correctly formatted RSA blocks ++ */ ++ ++ ret = args->lastErr; ++ args->lastErr = 0; /* reset */ ++ ++ /* build PreMasterSecret */ ++ ssl->arrays->preMasterSecret[0] = ssl->chVersion.major; ++ ssl->arrays->preMasterSecret[1] = ssl->chVersion.minor; ++ if (ret == 0 && args->sigSz == SECRET_LEN && ++ args->output != NULL) { ++ XMEMCPY(&ssl->arrays->preMasterSecret[VERSION_SZ], ++ &args->output[VERSION_SZ], ++ SECRET_LEN - VERSION_SZ); ++ } + else { +- ERROR_OUT(RSA_PRIVATE_ERROR, exit_dcke); ++ /* preMasterSecret has RNG and version set */ ++ /* return proper length and ignore error */ ++ /* error will be caught as decryption error */ ++ args->sigSz = SECRET_LEN; ++ ret = 0; + } ++ + break; + } /* rsa_kea */ + #endif /* !NO_RSA */ +--- a/wolfssl/error-ssl.h ++++ b/wolfssl/error-ssl.h +@@ -57,7 +57,7 @@ enum wolfSSL_ErrorCodes { + DOMAIN_NAME_MISMATCH = -322, /* peer subject name mismatch */ + WANT_READ = -323, /* want read, call again */ + NOT_READY_ERROR = -324, /* handshake layer not ready */ +- PMS_VERSION_ERROR = -325, /* pre m secret version error */ ++ + VERSION_ERROR = -326, /* record layer version error */ + WANT_WRITE = -327, /* want write, call again */ + BUFFER_ERROR = -328, /* malformed buffer input */ diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch new file mode 100644 index 000000000..83d51b1d5 --- /dev/null +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -0,0 +1,11 @@ +--- a/wolfssl/wolfcrypt/settings.h ++++ b/wolfssl/wolfcrypt/settings.h +@@ -1553,7 +1553,7 @@ extern void uITRON4_free(void *p) ; + #endif + + /* warning for not using harden build options (default with ./configure) */ +-#ifndef WC_NO_HARDEN ++#if 0 + #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \ + (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \ + (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS)) diff --git a/package/libs/cyassl/patches/400-additional_compatibility.patch b/package/libs/wolfssl/patches/400-additional_compatibility.patch similarity index 100% rename from package/libs/cyassl/patches/400-additional_compatibility.patch rename to package/libs/wolfssl/patches/400-additional_compatibility.patch diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index e5fcb8c91..06e67543b 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2017-05-27 -PKG_SOURCE_VERSION:=a4d98aea373e04f3fdc3c492c1688ba52ce490a9 -PKG_MIRROR_HASH:=55402b1e6bb471f6aed599c61c1c63b58212f5789f094d78247646fc0a7cf435 +PKG_SOURCE_DATE:=2017-11-07 +PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68 +PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index 9193f5c9f..b191327f8 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index a6b4ba85f..e604bfb25 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -25,7 +25,7 @@ gre_generic_setup() { json_add_string mode "$mode" json_add_int mtu "${mtu:-1280}" [ -n "$df" ] && json_add_boolean df "$df" - [ -n "ttl" ] && json_add_int ttl "$ttl" + [ -n "$ttl" ] && json_add_int ttl "$ttl" [ -n "$tos" ] && json_add_string tos "$tos" json_add_boolean multicast "$multicast" json_add_string local "$local" diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index 6e0b47f87..cf8eaf247 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=dsl_cpe_control_danube PKG_VERSION:=3.24.4.4 -PKG_RELEASE:=2 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION) PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ @@ -35,7 +35,7 @@ define Package/ltq-adsl-app CATEGORY:=Network TITLE:=Lantiq DSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread + DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread +ip MENU:=1 endef @@ -76,10 +76,11 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += -I$(LINUX_DIR)/include define Package/ltq-adsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(1)/etc/hotplug.d/net $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - - $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10-adsl_rename $(1)/etc/hotplug.d/net $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin endef diff --git a/package/network/config/ltq-adsl-app/files/10-adsl_rename b/package/network/config/ltq-adsl-app/files/10-adsl_rename new file mode 100644 index 000000000..f81a90a5f --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10-adsl_rename @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$ACTION" = add ]; then + [ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit + + ip link set $DEVICENAME name dsl0 +fi diff --git a/package/network/config/ltq-adsl-app/files/10_atm.sh b/package/network/config/ltq-adsl-app/files/10_atm.sh new file mode 100755 index 000000000..898d8ec07 --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_atm.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_atm_${soc} + +/etc/init.d/br2684ctl reload diff --git a/package/network/config/ltq-adsl-app/files/10_ptm.sh b/package/network/config/ltq-adsl-app/files/10_ptm.sh new file mode 100755 index 000000000..8a76b926f --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_ptm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_ptm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control index 8218186ef..d93d47808 100644 --- a/package/network/config/ltq-adsl-app/files/dsl_control +++ b/package/network/config/ltq-adsl-app/files/dsl_control @@ -2,14 +2,12 @@ # Copyright (C) 2012 OpenWrt.org START=49 +USE_PROCD=1 EXTRA_COMMANDS="status lucistat" EXTRA_HELP=" status Get DSL status information lucistat Get status information if lua friendly format" -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 - [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh annex_b=10_00_10_00_00_04_00_00 @@ -28,7 +26,11 @@ annex_m2=00_00_00_00_40_00_00_00 annex_m2p=00_00_00_00_00_00_04_00 annex_j=10_00_10_40_00_04_01_00 -start() { +service_triggers() { + procd_add_reload_trigger network +} + +start_service() { local annex local firmware local xtu @@ -45,12 +47,15 @@ start() { return 1 } - service_start /sbin/dsl_cpe_control -i${xtu} \ + procd_open_instance + procd_set_param command /sbin/dsl_cpe_control \ + -i${xtu} \ -n /sbin/dsl_notify.sh \ -f ${firmware} + procd_close_instance } -stop() { +stop_service() { DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \ DSL_INTERFACE_STATUS="DOWN" \ /sbin/dsl_notify.sh diff --git a/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch b/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch new file mode 100644 index 000000000..9d611c1ca --- /dev/null +++ b/package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch @@ -0,0 +1,42 @@ +From 9d4f86ba2cf10304303011f4f5628fa68dc77624 Mon Sep 17 00:00:00 2001 +From: Mathias Kresin +Date: Mon, 16 Oct 2017 21:08:26 +0200 +Subject: ltq-adsl-app: add more script notifications + +Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It +unifies the dsl led blinking pattern accross all subtargets and allows +to get the current line status from the dsl led. + +Signed-off-by: Mathias Kresin +--- + .../100-add-more-script-notifications.patch | 27 ++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch + +--- a/src/dsl_cpe_control.c ++++ b/src/dsl_cpe_control.c +@@ -3273,7 +3273,23 @@ DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S + #ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { +- if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && ++ if ( (nLineState == DSL_LINESTATE_HANDSHAKE) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_FULL_INIT) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS) diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile index 20b506c48..baf63f9d1 100644 --- a/package/network/config/ltq-vdsl-app/Makefile +++ b/package/network/config/ltq-vdsl-app/Makefile @@ -28,7 +28,7 @@ define Package/ltq-vdsl-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt + DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +ip endef define Package/ltq-vdsl-app/description @@ -58,10 +58,11 @@ CONFIGURE_ARGS += \ #CONFIGURE_ARGS += --enable-model=debug define Package/ltq-vdsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(1)/etc/hotplug.d/net $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10-xdsl_rename $(1)/etc/hotplug.d/net $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin/vdsl_cpe_control $(INSTALL_BIN) ./files/dsl_cpe_pipe.sh $(1)/sbin/ diff --git a/package/network/config/ltq-vdsl-app/files/10-xdsl_rename b/package/network/config/ltq-vdsl-app/files/10-xdsl_rename new file mode 100644 index 000000000..f81a90a5f --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/10-xdsl_rename @@ -0,0 +1,7 @@ +#!/bin/sh + +if [ "$ACTION" = add ]; then + [ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit + + ip link set $DEVICENAME name dsl0 +fi diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index 425208a0d..818990e57 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -109,7 +109,7 @@ locs 0 $1 } [Common]={ -}" > /tmp/adsl.scr +}" > /tmp/dsl.scr } lowlevel_cfg() { @@ -291,7 +291,7 @@ start_service() { [ -z "${snr}" ] || { # for SNR offset setting autoboot_script "$snr" - autoboot="-a /tmp/adsl.scr" + autoboot="-a /tmp/dsl.scr -A /tmp/dsl.scr" } procd_open_instance diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 2efbaf83e..4eb4737a3 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2017-08-27 -PKG_SOURCE_VERSION:=7d94ede3c38dd7b8e08c8a2fd8ae5ede71a2059b -PKG_MIRROR_HASH:=967e993cdb49ddc6d6add23fa8ccbf2af798fdca6708e7937496baa4c2653957 +PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_VERSION:=fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 +PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index e841f9185..24f243c2c 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -18,10 +18,12 @@ setup_interface () { proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast + local i for i in $router; do proto_add_ipv4_route "$i" 32 "" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" + local r for r in $CUSTOMROUTES; do proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip" done @@ -31,11 +33,11 @@ setup_interface () { [ -n "$staticroutes" ] && set_classless_routes $staticroutes [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes - for dns in $dns; do - proto_add_dns_server "$dns" + for i in $dns; do + proto_add_dns_server "$i" done - for domain in $domain; do - proto_add_dns_search "$domain" + for i in $domain; do + proto_add_dns_search "$i" done proto_add_data diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea02d68bb..143e4451b 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -40,6 +40,7 @@ proto_dhcp_setup() { append dhcpopts "-x $opt" done + [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)" [ "$broadcast" = 1 ] && broadcast="-B" || broadcast= [ "$release" = 1 ] && release="-R" || release= [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C" diff --git a/package/network/services/dropbear/Config.in b/package/network/services/dropbear/Config.in index 7c2edd79f..ca0af9d5e 100644 --- a/package/network/services/dropbear/Config.in +++ b/package/network/services/dropbear/Config.in @@ -32,6 +32,15 @@ config DROPBEAR_ECC Increases binary size by about 23 kB (MIPS). +config DROPBEAR_ZLIB + bool "Enable compression" + default n + help + Enables compression using shared zlib library. + + Increases binary size by about 0.1 kB (MIPS) and requires additional 62 kB (MIPS) + for a shared zlib library. + config DROPBEAR_UTMP bool "Utmp support" default n diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 7302db273..21ac09f72 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=3 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -19,11 +19,15 @@ PKG_HASH:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE +PKG_CPE_ID:=cpe:/a:matt_johnston:dropbear_ssh_server PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 -PKG_CONFIG_DEPENDS:=CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC CONFIG_DROPBEAR_CURVE25519 +PKG_CONFIG_DEPENDS:= \ + CONFIG_TARGET_INIT_PATH CONFIG_DROPBEAR_ECC \ + CONFIG_DROPBEAR_CURVE25519 CONFIG_DROPBEAR_ZLIB \ + CONFIG_DROPBEAR_UTMP CONFIG_DROPBEAR_PUTUTLINE include $(INCLUDE_DIR)/package.mk @@ -44,6 +48,7 @@ define Package/dropbear SECTION:=net CATEGORY:=Base system TITLE:=Small SSH2 client/server + DEPENDS:= +DROPBEAR_ZLIB:zlib endef define Package/dropbear/description @@ -74,7 +79,7 @@ CONFIGURE_ARGS += \ --disable-loginfunc \ $(if $(CONFIG_DROPBEAR_PUTUTLINE),,--disable-pututline) \ --disable-pututxline \ - --disable-zlib \ + $(if $(CONFIG_DROPBEAR_ZLIB),,--disable-zlib) \ --enable-bundled-libtom TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index b49a95ce9..7f47a7430 100644 --- a/package/network/services/dropbear/patches/120-openwrt_options.patch +++ b/package/network/services/dropbear/patches/120-openwrt_options.patch @@ -39,7 +39,7 @@ /* Enable "Counter Mode" for ciphers. This is more secure than normal * CBC mode against certain attacks. It is recommended for security -@@ -131,9 +131,9 @@ If you test it please contact the Dropbe +@@ -131,10 +131,10 @@ If you test it please contact the Dropbe * If you disable MD5, Dropbear will fall back to SHA1 fingerprints, * which are not the standard form. */ #define DROPBEAR_SHA1_HMAC @@ -47,10 +47,12 @@ +/*#define DROPBEAR_SHA1_96_HMAC*/ #define DROPBEAR_SHA2_256_HMAC -#define DROPBEAR_SHA2_512_HMAC +-#define DROPBEAR_MD5_HMAC +/*#define DROPBEAR_SHA2_512_HMAC*/ - #define DROPBEAR_MD5_HMAC ++/*#define DROPBEAR_MD5_HMAC*/ /* You can also disable integrity. Don't bother disabling this if you're + * still using a cipher, it's relatively cheap. If you disable this it's dead @@ -146,7 +146,7 @@ If you test it please contact the Dropbe * Removing either of these won't save very much space. * SSH2 RFC Draft requires dss, recommends rsa */ diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 5a353e67e..51f169293 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=3 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git @@ -17,6 +17,7 @@ PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e7 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:w1.fi:hostapd PKG_BUILD_PARALLEL:=1 diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 6b2d73370..36aee85f1 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -151,6 +151,8 @@ hostapd_common_add_bss_config() { wpa_group_rekey wpa_pair_rekey wpa_master_rekey config_add_boolean wpa_disable_eapol_key_retries + config_add_boolean tdls_prohibit + config_add_boolean rsn_preauth auth_cache config_add_int ieee80211w config_add_int eapol_version @@ -172,6 +174,7 @@ hostapd_common_add_bss_config() { config_add_string ownip config_add_string iapp_interface config_add_string eap_type ca_cert client_cert identity anonymous_identity auth priv_key priv_key_pwd + config_add_string ieee80211w_mgmt_cipher config_add_int dynamic_vlan vlan_naming config_add_string vlan_tagged_interface vlan_bridge @@ -215,7 +218,7 @@ hostapd_set_bss_options() { json_get_vars \ wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey \ - wpa_disable_eapol_key_retries \ + wpa_disable_eapol_key_retries tdls_prohibit \ maxassoc max_inactivity disassoc_low_ack isolate auth_cache \ wps_pushbutton wps_label ext_registrar wps_pbc_in_m1 wps_ap_setup_locked \ wps_independent wps_device_type wps_device_name wps_manufacturer wps_pin \ @@ -232,6 +235,7 @@ hostapd_set_bss_options() { set_default wmm 1 set_default uapsd 1 set_default wpa_disable_eapol_key_retries 0 + set_default tdls_prohibit 0 set_default eapol_version 0 set_default acct_port 1813 @@ -252,6 +256,8 @@ hostapd_set_bss_options() { append bss_conf "ignore_broadcast_ssid=$hidden" "$N" append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N" + [ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N" + [ "$wpa" -gt 0 ] && { [ -n "$wpa_group_rekey" ] && append bss_conf "wpa_group_rekey=$wpa_group_rekey" "$N" [ -n "$wpa_pair_rekey" ] && append bss_conf "wpa_ptk_rekey=$wpa_pair_rekey" "$N" @@ -397,7 +403,6 @@ hostapd_set_bss_options() { set_default mobility_domain "4f57" set_default r0_key_lifetime 10000 - set_default r1_key_holder "00004f577274" set_default reassociation_deadline 1000 set_default pmk_r1_push 0 set_default ft_psk_generate_local 0 @@ -405,7 +410,7 @@ hostapd_set_bss_options() { append bss_conf "mobility_domain=$mobility_domain" "$N" append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" - append bss_conf "r1_key_holder=$r1_key_holder" "$N" + [ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N" append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N" @@ -440,9 +445,10 @@ hostapd_set_bss_options() { # RSN -> allow management frame protection case "$ieee80211w" in [012]) - json_get_vars ieee80211w_max_timeout ieee80211w_retry_timeout + json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout append bss_conf "ieee80211w=$ieee80211w" "$N" [ "$ieee80211w" -gt "0" ] && { + append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N" [ -n "$ieee80211w_max_timeout" ] && \ append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" [ -n "$ieee80211w_retry_timeout" ] && \ @@ -595,8 +601,31 @@ EOF return 0 } +wpa_supplicant_set_fixed_freq() { + local freq="$1" + local htmode="$2" + + append network_data "fixed_freq=1" "$N$T" + append network_data "frequency=$freq" "$N$T" + case "$htmode" in + NOHT) append network_data "disable_ht=1" "$N$T";; + HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; + HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; + esac + case "$htmode" in + VHT*) append network_data "vht=1" "$N$T";; + esac + case "$htmode" in + VHT80) append network_data "max_oper_chwidth=1" "$N$T";; + VHT160) append network_data "max_oper_chwidth=2" "$N$T";; + *) append network_data "max_oper_chwidth=0" "$N$T";; + esac +} + wpa_supplicant_add_network() { local ifname="$1" + local freq="$2" + local htmode="$3" _wpa_supplicant_common "$1" wireless_vif_parse_encryption @@ -618,11 +647,7 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "fixed_freq=1" "$N$T" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" scan_ssid="scan_ssid=0" @@ -634,10 +659,7 @@ wpa_supplicant_add_network() { ssid="${mesh_id}" append network_data "mode=5" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" append wpa_key_mgmt "SAE" scan_ssid="" } @@ -731,6 +753,7 @@ wpa_supplicant_add_network() { esac } [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" + [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" local bssid_blacklist bssid_whitelist json_get_values bssid_blacklist bssid_blacklist @@ -753,10 +776,6 @@ wpa_supplicant_add_network() { append network_data "mcast_rate=$mc_rate" "$N$T" } - local ht_str - [[ "$_w_mode" = adhoc ]] || ibss_htmode= - [ -n "$ibss_htmode" ] && append network_data "htmode=$ibss_htmode" "$N$T" - cat >> "$_config" < +Date: Fri, 20 Oct 2017 17:39:42 +0300 +Subject: [PATCH] WNM: Ignore WNM-Sleep Mode Request in wnm_sleep_mode=0 case + +The hostapd wnm_sleep_mode parameter was previously used to control +advertisement of WNM-Sleep Mode support, but it was not used when +processing a request to use WNM-Sleep Mode. Add an explicit check during +request processing as well so that any misbehaving station is ignored. + +Signed-off-by: Jouni Malinen +--- + src/ap/wnm_ap.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/src/ap/wnm_ap.c b/src/ap/wnm_ap.c +index 7c4fde0..973e4d3 100644 +--- a/src/ap/wnm_ap.c ++++ b/src/ap/wnm_ap.c +@@ -200,6 +200,13 @@ static void ieee802_11_rx_wnmsleep_req(struct hostapd_data *hapd, + u8 *tfsreq_ie_end = NULL; + u16 tfsreq_ie_len = 0; + ++ if (!hapd->conf->wnm_sleep_mode) { ++ wpa_printf(MSG_DEBUG, "Ignore WNM-Sleep Mode Request from " ++ MACSTR " since WNM-Sleep Mode is disabled", ++ MAC2STR(addr)); ++ return; ++ } ++ + dialog_token = *pos++; + while (pos + 1 < frm + len) { + u8 ie_len = pos[1]; +-- +2.1.4 diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 88698524e..213ee6d72 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -140,11 +140,10 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2224,6 +2316,9 @@ static const struct parse_data ssid_fiel +@@ -2224,6 +2316,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, -+ { INT_RANGE(fixed_freq, 0, 1) }, + { FUNC(rates) }, + { FUNC(mcast_rate) }, #ifdef CONFIG_MACSEC @@ -175,11 +174,10 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2781,6 +2781,13 @@ static void wpas_start_assoc_cb(struct w +@@ -2781,6 +2781,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; -+ params.fixed_freq = ssid->fixed_freq; + i = 0; + while (i < WLAN_SUPP_RATES_MAX) { + params.rates[i] = ssid->rates[i]; diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch deleted file mode 100644 index d2e5eab99..000000000 --- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch +++ /dev/null @@ -1,156 +0,0 @@ -From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli -Date: Tue, 3 Jul 2012 00:36:24 +0200 -Subject: [PATCH] wpa_s: support htmode param - -possible values are HT20, HT40-, HT40+ and NOHT - -Signed-off-by: Antonio Quartulli ---- - src/drivers/driver.h | 2 ++ - src/drivers/driver_nl80211.c | 16 ++++++++++ - wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 2 ++ - wpa_supplicant/wpa_supplicant.c | 2 ++ - 5 files changed, 88 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -765,6 +765,8 @@ struct wpa_driver_associate_params { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - int mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - /** - * bssid_hint - BSSID of a proposed AP ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -5070,6 +5070,22 @@ retry: - nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); - } - -+ if (params->ht_set) { -+ switch(params->htmode) { -+ case NL80211_CHAN_HT20: -+ wpa_printf(MSG_DEBUG, " * ht=HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40-"); -+ break; -+ } -+ nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, -+ params->htmode); -+ } -+ - ret = nl80211_set_conn_keys(params, msg); - if (ret) - goto fail; ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -2017,6 +2017,71 @@ static char * wpa_config_write_mcast_rat - } - #endif /* NO_CONFIG_WRITE */ - -+static int wpa_config_parse_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ int i; -+ static const struct { -+ const char *name; -+ unsigned int val; -+ } htmap[] = { -+ { .name = "HT20", .val = NL80211_CHAN_HT20, }, -+ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, }, -+ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, }, -+ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, }, -+ }; -+ ssid->ht_set = 0;; -+ for (i = 0; i < 4; i++) { -+ if (strcasecmp(htmap[i].name, value) == 0) { -+ ssid->htmode = htmap[i].val; -+ ssid->ht_set = 1; -+ break; -+ } -+ } -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value; -+ int res; -+ -+ value = os_malloc(6); /* longest: HT40+ */ -+ if (value == NULL) -+ return NULL; -+ -+ switch(ssid->htmode) { -+ case NL80211_CHAN_HT20: -+ res = os_snprintf(value, 4, "HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ res = os_snprintf(value, 5, "HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ res = os_snprintf(value, 5, "HT40-"); -+ break; -+ case NL80211_CHAN_NO_HT: -+ res = os_snprintf(value, 4, "NOHT"); -+ break; -+ default: -+ os_free(value); -+ return NULL; -+ } -+ -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ -+ - static int wpa_config_parse_rates(const struct parse_data *data, - struct wpa_ssid *ssid, int line, - const char *value) -@@ -2319,6 +2384,7 @@ static const struct parse_data ssid_fiel - { INT_RANGE(fixed_freq, 0, 1) }, - { FUNC(rates) }, - { FUNC(mcast_rate) }, -+ { FUNC(htmode) }, - #ifdef CONFIG_MACSEC - { INT_RANGE(macsec_policy, 0, 1) }, - { INT_RANGE(macsec_integ_only, 0, 1) }, ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -739,6 +739,8 @@ struct wpa_ssid { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - double mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - #ifdef CONFIG_MACSEC - /** ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2788,6 +2788,8 @@ static void wpas_start_assoc_cb(struct w - i++; - } - params.mcast_rate = ssid->mcast_rate; -+ params.ht_set = ssid->ht_set; -+ params.htmode = ssid->htmode; - } - - params.wpa_ie = wpa_ie; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch new file mode 100644 index 000000000..9b5ee4bbb --- /dev/null +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -0,0 +1,68 @@ +From: Sven Eckelmann +Date: Thu, 11 May 2017 08:21:45 +0200 +Subject: [PATCH] set mcast_rate in mesh mode + +The wpa_supplicant code for IBSS allows to set the mcast rate. It is +recommended to increase this value from 1 or 6 Mbit/s to something higher +when using a mesh protocol on top which uses the multicast packet loss as +indicator for the link quality. + +This setting was unfortunately not applied for mesh mode. But it would be +beneficial when wpa_supplicant would behave similar to IBSS mode and set +this argument during mesh join like authsae already does. At least it is +helpful for companies/projects which are currently switching to 802.11s +(without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS +because newer drivers seem to support 802.11s but not IBSS anymore. + +Signed-off-by: Sven Eckelmann +Tested-by: Simon Wunderlich + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1424,6 +1424,7 @@ struct wpa_driver_mesh_join_params { + #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 + #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 + unsigned int flags; ++ int mcast_rate; + }; + + /** +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl + } + + ++static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate) ++{ ++ if (mcast_rate > 0) { ++ wpa_printf(MSG_DEBUG, " * mcast_rate=%.1f", ++ (double)mcast_rate / 10); ++ return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate); ++ } ++ ++ return 0; ++} ++ ++ + static int nl80211_put_mesh_config(struct nl_msg *msg, + struct wpa_driver_mesh_bss_params *params) + { +@@ -9039,6 +9051,7 @@ static int nl80211_join_mesh(struct i802 + nl80211_put_basic_rates(msg, params->basic_rates) || + nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || + nl80211_put_beacon_int(msg, params->beacon_int) || ++ nl80211_put_mcast_rate(msg, params->mcast_rate) || + nl80211_put_dtim_period(msg, params->dtim_period)) + goto fail; + +--- a/wpa_supplicant/mesh.c ++++ b/wpa_supplicant/mesh.c +@@ -379,6 +379,7 @@ int wpa_supplicant_join_mesh(struct wpa_ + os_memset(¶ms, 0, sizeof(params)); + params.meshid = ssid->ssid; + params.meshid_len = ssid->ssid_len; ++ params.mcast_rate = ssid->mcast_rate; + ibss_mesh_setup_freq(wpa_s, ssid, ¶ms.freq); + wpa_s->mesh_ht_enabled = !!params.freq.ht_enabled; + wpa_s->mesh_vht_enabled = !!params.freq.vht_enabled; diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch new file mode 100644 index 000000000..383353948 --- /dev/null +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -0,0 +1,19 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2010,11 +2010,13 @@ void ibss_mesh_setup_freq(struct wpa_sup + for (j = 0; j < wpa_s->last_scan_res_used; j++) { + struct wpa_bss *bss = wpa_s->last_scan_res[j]; + +- if (ssid->mode != WPAS_MODE_IBSS) ++ /* Don't adjust control freq in case of fixed_freq */ ++ if (ssid->fixed_freq) { ++ obss_scan = 0; + break; ++ } + +- /* Don't adjust control freq in case of fixed_freq */ +- if (ssid->fixed_freq) ++ if (ssid->mode != WPAS_MODE_IBSS) + break; + + if (!bss_is_ibss(bss)) diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index b63d99a57..8f14f125d 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -1,7 +1,5 @@ -Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/hostapd/Makefile -+++ hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile +--- a/hostapd/Makefile ++++ b/hostapd/Makefile @@ -165,6 +165,11 @@ OBJS += ../src/common/hw_features_common OBJS += ../src/eapol_auth/eapol_auth_sm.o @@ -14,10 +12,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/hostapd/Makefile ifdef CONFIG_CODE_COVERAGE CFLAGS += -O0 -fprofile-arcs -ftest-coverage -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.h -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h +--- a/src/ap/hostapd.h ++++ b/src/ap/hostapd.h @@ -13,6 +13,7 @@ #include "utils/list.h" #include "ap_config.h" @@ -43,10 +39,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.h enum hostapd_iface_state { HAPD_IFACE_UNINITIALIZED, HAPD_IFACE_DISABLED, -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/hostapd.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c +--- a/src/ap/hostapd.c ++++ b/src/ap/hostapd.c @@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; @@ -88,10 +82,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/hostapd.c hostapd_interface_deinit(iface); wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", __func__, driver, drv_priv); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/ieee802_11.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c @@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap @@ -209,10 +201,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/ieee802_11.c ret = 1; break; case WLAN_FC_STYPE_DISASSOC: -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c +--- a/src/ap/beacon.c ++++ b/src/ap/beacon.c @@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, @@ -251,10 +241,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.c /* TODO: verify that supp_rates contains at least one matching rate * with AP configuration */ -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/beacon.h -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h +--- a/src/ap/beacon.h ++++ b/src/ap/beacon.h @@ -14,7 +14,7 @@ struct ieee80211_mgmt; void handle_probe_req(struct hostapd_data *hapd, @@ -264,10 +252,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/beacon.h int ieee802_11_set_beacon(struct hostapd_data *hapd); int ieee802_11_set_beacons(struct hostapd_iface *iface); int ieee802_11_update_beacons(struct hostapd_iface *iface); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/drv_callbacks.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c +--- a/src/ap/drv_callbacks.c ++++ b/src/ap/drv_callbacks.c @@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; @@ -292,10 +278,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/drv_callbacks.c #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/sta_info.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c @@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo HOSTAPD_LEVEL_INFO, "deauthenticated due to " "local deauth request"); @@ -320,10 +304,8 @@ Index: hostapd-2017-08-24-c2d4f2eb/src/ap/sta_info.c if (hapd->msg_ctx_parent && hapd->msg_ctx_parent != hapd->msg_ctx) -Index: hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c -=================================================================== ---- hostapd-2017-08-24-c2d4f2eb.orig/src/ap/wpa_auth_glue.c -+++ hostapd-2017-08-24-c2d4f2eb/src/ap/wpa_auth_glue.c +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c @@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure struct hostapd_data *hapd = ctx; wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, diff --git a/package/network/services/igmpproxy/Makefile b/package/network/services/igmpproxy/Makefile index d07fe6699..38efabe1c 100644 --- a/package/network/services/igmpproxy/Makefile +++ b/package/network/services/igmpproxy/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=igmpproxy PKG_VERSION:=0.1 -PKG_RELEASE:=9 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=@SF/igmpproxy diff --git a/package/network/services/igmpproxy/files/igmpproxy.init b/package/network/services/igmpproxy/files/igmpproxy.init index 9f4e51ada..403854546 100644 --- a/package/network/services/igmpproxy/files/igmpproxy.init +++ b/package/network/services/igmpproxy/files/igmpproxy.init @@ -132,3 +132,7 @@ start_service() { service_started() { procd_set_config_changed firewall } + +stop_service() { + procd_set_config_changed firewall +} diff --git a/package/network/services/ipset-dns/Makefile b/package/network/services/ipset-dns/Makefile index 2adc9fe03..3f21d04c4 100644 --- a/package/network/services/ipset-dns/Makefile +++ b/package/network/services/ipset-dns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=http://git.zx2c4.com/ipset-dns -PKG_SOURCE_DATE:=2013-05-03 -PKG_SOURCE_VERSION:=6be3afd819a86136b51c5ae722ab48266187155b -PKG_MIRROR_HASH:=4e34943b547babe705c2fad295ee24a5ee0c93ca03e2a9cdeaf323150f97e60b +PKG_SOURCE_DATE:=2017-10-08 +PKG_SOURCE_VERSION:=ade2cf88e933f4f90451e0a6171f0aa4a523f989 +PKG_MIRROR_HASH:=34ad1f5c7d2eab90b795f2a512102891428216e3d439d918a8992846550e9697 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch b/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch deleted file mode 100644 index 19669a05b..000000000 --- a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/ipset-dns.c -+++ b/ipset-dns.c -@@ -307,19 +307,20 @@ int main(int argc, char *argv[]) - struct timeval tv; - char msg[512]; - char ip[INET6_ADDRSTRLEN]; -- char *ipset; -+ char *ipset, *ipset6; - int listen_sock, upstream_sock; - int pos, i, size, af; - socklen_t len; - size_t received; - pid_t child; - -- if (argc != 4) { -- fprintf(stderr, "Usage: %s ipset port upstream\n", argv[0]); -+ if (argc != 5) { -+ fprintf(stderr, "Usage: %s ipv4-ipset ipv6-ipset port upstream\n", argv[0]); - return 1; - } - - ipset = argv[1]; -+ ipset6 = argv[2]; - - listen_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (listen_sock < 0) { -@@ -329,7 +330,7 @@ int main(int argc, char *argv[]) - - memset(&listen_addr, 0, sizeof(listen_addr)); - listen_addr.sin_family = AF_INET; -- listen_addr.sin_port = htons(atoi(argv[2])); -+ listen_addr.sin_port = htons(atoi(argv[3])); - listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - i = 1; - setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)); -@@ -341,7 +342,7 @@ int main(int argc, char *argv[]) - memset(&upstream_addr, 0, sizeof(upstream_addr)); - upstream_addr.sin_family = AF_INET; - upstream_addr.sin_port = htons(53); -- inet_aton(argv[3], &upstream_addr.sin_addr); -+ inet_aton(argv[4], &upstream_addr.sin_addr); - - /* TODO: Put all of the below code in several forks all listening on the same sock. */ - -@@ -434,8 +435,11 @@ int main(int argc, char *argv[]) - continue; - } - -+ if ((af == AF_INET && !*ipset) || (af == AF_INET6 && !*ipset6)) -+ continue; -+ - printf("%s: %s\n", answer.dotted, ip); -- if (add_to_ipset(ipset, answer.rdata, af) < 0) -+ if (add_to_ipset((af == AF_INET) ? ipset : ipset6, answer.rdata, af) < 0) - perror("add_to_ipset"); - } - diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 8b1e4e96d..cdd8f99d5 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=0.9.8 +PKG_VERSION:=0.9.9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd -PKG_HASH:=9ee494e91bc33938575b2c09b26188c486ef8eac6e2155d250c189cc4e988c4f +PKG_HASH:=5e9e08f500d21376631cbc9f8e19a4b167cd38eb2d8fd9e660b8e80507f802db PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=ISC diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 9c59fb648..2a22cd874 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -9,53 +9,94 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd PKG_RELEASE:=1 +PKG_VERSION:=1.3 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2017-08-16 -PKG_SOURCE_VERSION:=94e65ee0aecf0749e64fb29b4532c614e7be86a8 -PKG_MIRROR_HASH:=cb3d1e42f87bfd1eb78e27ae6a59e34302db11a6e6c119962c1c02b2f51ddaef +PKG_SOURCE_DATE:=2017-12-22 +PKG_SOURCE_VERSION:=7aa2594c5a127d92fa8f04328ac7b43e595bcaa7 +PKG_MIRROR_HASH:=67ce9303ce2f7a47ca9c54e1ebd984f108066ab0fa4e0d81f39a9cfc2431f90b PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += -DUBUS=1 - -ifneq ($(CONFIG_PACKAGE_odhcpd_ext_cer_id),0) - CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_ext_cer_id) -endif - - -define Package/odhcpd +define Package/odhcpd/default SECTION:=net CATEGORY:=Network - TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay + TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay DEPENDS:=+libubox +libuci +libubus +libnl-tiny endef -define Package/odhcpd/config - config PACKAGE_odhcpd_ext_cer_id - int "CER-ID Extension ID (0 = disabled)" - depends on PACKAGE_odhcpd - default 0 -endef - -define Package/odhcpd/description +define Package/odhcpd/default/description odhcpd is a daemon for serving and relaying IP management protocols to configure clients and downstream routers. It tries to follow the RFC 6204 requirements for IPv6 home routers. - - odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6, - prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed - (non-bridged) interfaces in case no delegated prefixes are available. endef +define Package/odhcpd/default/config +menu "Configuration" + depends on PACKAGE_$(1) + +config PACKAGE_odhcpd_$(2)_ext_cer_id + int + default 0 + prompt "CER-ID Extension ID (0 = disabled)" +endmenu +endef + +define Package/odhcpd + $(call Package/odhcpd/default) + TITLE += and DHCPv4 server + VARIANT:=full +endef + +Package/odhcpd/config=$(call Package/odhcpd/default/config,odhcpd,full) + +define Package/odhcpd/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for DHCPv4, RA, stateless and + stateful DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and + NDP between routed (non-bridged) interfaces in case no delegated prefixes + are available. +endef + +define Package/odhcpd-ipv6only + $(call Package/odhcpd/default) + VARIANT:=ipv6only +endef + +Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only) + +define Package/odhcpd-ipv6only/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for RA, stateless and stateful + DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and NDP between + routed (non-bridged) interfaces in case no delegated prefixes are available. +endef + +CMAKE_OPTIONS += -DUBUS=1 + +ifeq ($(BUILD_VARIANT),full) + CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1 +endif + +ifneq ($(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id),0) + CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id) +endif + define Package/odhcpd/install $(INSTALL_DIR) $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcpd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/ $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd @@ -63,4 +104,7 @@ define Package/odhcpd/install $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults endef +Package/odhcpd-ipv6only/install = $(Package/odhcpd/install) + $(eval $(call BuildPackage,odhcpd)) +$(eval $(call BuildPackage,odhcpd-ipv6only)) diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index e184da90a..cecbdd4a8 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -2,13 +2,28 @@ uci -q get dhcp.odhcpd && exit 0 touch /etc/config/dhcp +. /usr/share/libubox/jshn.sh + +json_load "$(cat /etc/board.json)" +json_select network +json_select lan +json_get_vars protocol +json_select .. +json_select .. + +case "$protocol" in +# only enable server mode on statically addressed lan ports +"static") MODE=server ;; +*) MODE=disabled ;; +esac + uci batch < @@ -26,6 +25,7 @@ PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:openvpn:openvpn include $(INCLUDE_DIR)/package.mk diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index 98c1710f0..ab4f7dba0 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -60,7 +60,7 @@ openvpn_add_instance() { local dir="$2" local conf="$3" - procd_open_instance + procd_open_instance "$name" procd_set_param command "$PROG" \ --syslog "openvpn($name)" \ --status "/var/run/openvpn.$name.status" \ @@ -103,28 +103,47 @@ start_instance() { } start_service() { + local instance="$1" + local instance_found=0 + + config_cb() { + local type="$1" + local name="$2" + if [ "$type" = "openvpn" ]; then + if [ -n "$instance" -a "$instance" = "$name" ]; then + instance_found=1 + fi + fi + } + . /usr/share/openvpn/openvpn.options config_load 'openvpn' - config_foreach start_instance 'openvpn' - local path name - for path in /etc/openvpn/*.conf; do - if [ -f "$path" ]; then - name="${path##*/}"; name="${name%.conf}" + if [ -n "$instance" ]; then + [ "$instance_found" -gt 0 ] || return + start_instance "$instance" + else + config_foreach start_instance 'openvpn' - # don't start configs again that are already started by uci - if echo "$UCI_STARTED" | grep -qxF "$path"; then - continue + local path name + for path in /etc/openvpn/*.conf; do + if [ -f "$path" ]; then + name="${path##*/}"; name="${name%.conf}" - # don't start configs which are set to disabled in uci - elif echo "$UCI_DISABLED" | grep -qxF "$path"; then - logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" - continue + # don't start configs again that are already started by uci + if echo "$UCI_STARTED" | grep -qxF "$path"; then + continue + + # don't start configs which are set to disabled in uci + elif echo "$UCI_DISABLED" | grep -qxF "$path"; then + logger -t openvpn "$name.conf is disabled in /etc/config/openvpn" + continue + fi + + openvpn_add_instance "$name" "${path%/*}" "$path" fi - - openvpn_add_instance "$name" "${path%/*}" "$path" - fi - done + done + fi } service_triggers() { diff --git a/package/network/services/openvpn/files/openvpn.options b/package/network/services/openvpn/files/openvpn.options index 022f530a0..a6a3ded06 100644 --- a/package/network/services/openvpn/files/openvpn.options +++ b/package/network/services/openvpn/files/openvpn.options @@ -30,6 +30,7 @@ ecdh_curve echo engine explicit_exit_notify +extra_certs fragment group hand_window diff --git a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch index b0fe00df9..d49e0bf9e 100644 --- a/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch +++ b/package/network/services/openvpn/patches/210-build_always_use_internal_lz4.patch @@ -1,43 +1,68 @@ --- a/configure.ac +++ b/configure.ac -@@ -1076,37 +1076,14 @@ dnl +@@ -1068,62 +1068,15 @@ dnl AC_ARG_VAR([LZ4_CFLAGS], [C compiler flags for lz4]) AC_ARG_VAR([LZ4_LIBS], [linker flags for lz4]) if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then -- AC_CHECKING([for LZ4 Library and Header files]) -- havelz4lib=1 - +- if test -z "${LZ4_CFLAGS}" -a -z "${LZ4_LIBS}"; then +- # if the user did not explicitly specify flags, try to autodetect +- PKG_CHECK_MODULES([LZ4], +- [liblz4 >= 1.7.1], +- [have_lz4="yes"], +- [] # If this fails, we will do another test next +- ) +- fi + + saved_CFLAGS="${CFLAGS}" + saved_LIBS="${LIBS}" + CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" + LIBS="${LIBS} ${LZ4_LIBS}" + +- # If pkgconfig check failed or LZ4_CFLAGS/LZ4_LIBS env vars +- # are used, check the version directly in the LZ4 include file +- if test "${have_lz4}" != "yes"; then +- AC_CHECK_HEADERS([lz4.h], +- [have_lz4h="yes"], +- []) +- +- if test "${have_lz4h}" = "yes" ; then +- AC_MSG_CHECKING([additionally if system LZ4 version >= 1.7.1]) +- AC_COMPILE_IFELSE( +- [AC_LANG_PROGRAM([[ +-#include +- ]], +- [[ +-/* Version encoding: MMNNPP (Major miNor Patch) - see lz4.h for details */ +-#if LZ4_VERSION_NUMBER < 10701L +-#error LZ4 is too old +-#endif +- ]] +- )], +- [ +- AC_MSG_RESULT([ok]) +- have_lz4="yes" +- ], +- [AC_MSG_RESULT([system LZ4 library is too old])] +- ) +- fi +- fi +- - # if LZ4_LIBS is set, we assume it will work, otherwise test - if test -z "${LZ4_LIBS}"; then -- AC_CHECK_LIB(lz4, LZ4_compress, -- [ LZ4_LIBS="-llz4" ], -- [ -- AC_MSG_RESULT([LZ4 library not found.]) -- havelz4lib=0 -- ]) +- AC_CHECK_LIB([lz4], +- [LZ4_compress], +- [LZ4_LIBS="-llz4"], +- [have_lz4="no"]) - fi -+ AC_MSG_RESULT([Using LZ4 library in src/compat/compat-lz4.*]) -+ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) -+ LZ4_LIBS="" - -- saved_CFLAGS="${CFLAGS}" -- CFLAGS="${CFLAGS} ${LZ4_CFLAGS}" -- AC_CHECK_HEADERS(lz4.h, -- , -- [ -- AC_MSG_RESULT([LZ4 headers not found.]) -- havelz4lib=0 -- ]) - -- if test $havelz4lib = 0 ; then -- AC_MSG_RESULT([LZ4 library or header not found, using version in src/compat/compat-lz4.*]) +- if test "${have_lz4}" != "yes" ; then +- AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) - AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) - LZ4_LIBS="" - fi ++ AC_MSG_RESULT([ usuable LZ4 library or header not found, using version in src/compat/compat-lz4.*]) ++ AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/]) ++ LZ4_LIBS="" OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}" OPTIONAL_LZ4_LIBS="${LZ4_LIBS}" - AC_DEFINE(ENABLE_LZ4, 1, [Enable LZ4 compression library]) -- CFLAGS="${saved_CFLAGS}" - fi - - + AC_DEFINE(ENABLE_LZ4, [1], [Enable LZ4 compression library]) diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 81bad871a..42c23b4e8 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable @@ -18,8 +18,7 @@ PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING - -PKG_MAINTAINER:=Felix Fietkau +PKG_CPE_ID:=cpe:/a:samba:samba PKG_BUILD_PARALLEL:=1 @@ -30,27 +29,29 @@ CONFIGURE_PATH:=source3 PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin -define Package/samba36-server +define Package/samba/Default SECTION:=net CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS server + TITLE:=Samba 3.6 SMB/CIFS URL:=https://www.samba.org/ + MAINTAINER:=Felix Fietkau +endef + +define Package/samba36-server + $(call Package/samba/Default) + TITLE+= server DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS) endef define Package/samba36-client - SECTION:=net - CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS client - URL:=https://www.samba.org/ + $(call Package/samba/Default) + TITLE+= client DEPENDS:=+libreadline +libncurses endef define Package/samba36-net - SECTION:=net - CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS net commands - URL:=https://www.samba.org/ + $(call Package/samba/Default) + TITLE+= net commands DEPENDS:=+libreadline +libncurses endef diff --git a/package/network/services/samba36/patches/029-CVE-2017-15275.patch b/package/network/services/samba36/patches/029-CVE-2017-15275.patch new file mode 100644 index 000000000..055a15e87 --- /dev/null +++ b/package/network/services/samba36/patches/029-CVE-2017-15275.patch @@ -0,0 +1,40 @@ +From c1a22e59f87783d88dfbaeeb132b89be166b2754 Mon Sep 17 00:00:00 2001 +From: Jeremy Allison +Date: Wed, 20 Sep 2017 11:04:50 -0700 +Subject: [PATCH 2/2] s3: smbd: Chain code can return uninitialized memory when + talloc buffer is grown. + +Ensure we zero out unused grown area. + +CVE-2017-15275 + +BUG: https://bugzilla.samba.org/show_bug.cgi?id=13077 + +Signed-off-by: Jeremy Allison +--- + source3/smbd/srvstr.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/source3/smbd/srvstr.c ++++ b/source3/smbd/srvstr.c +@@ -70,6 +70,20 @@ ssize_t message_push_string(uint8 **outb + DEBUG(0, ("srvstr_push failed\n")); + return -1; + } ++ ++ /* ++ * Ensure we clear out the extra data we have ++ * grown the buffer by, but not written to. ++ */ ++ if (buf_size + result < buf_size) { ++ return -1; ++ } ++ if (grow_size < result) { ++ return -1; ++ } ++ ++ memset(tmp + buf_size + result, '\0', grow_size - result); ++ + set_message_bcc((char *)tmp, smb_buflen(tmp) + result); + + *outbuf = tmp; diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 3d483b692..f2d061c09 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -8,17 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uhttpd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git -PKG_SOURCE_DATE:=2016-10-25 -PKG_SOURCE_VERSION:=1628fa4b34aa143187353f81e8001b9a15286bda -PKG_MIRROR_HASH:=2ac4ba8dc0b349d72174aac9ff693a73a214295a9890fe3d2a8eedcad54d06e3 +PKG_SOURCE_DATE:=2017-11-04 +PKG_SOURCE_VERSION:=a235636a2687fafb9c474e4b134a59ff66425c92 +PKG_MIRROR_HASH:=626392a485e8ab8085bb55d9424b176be9143529db59a820a7de71061a93a007 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC PKG_BUILD_DEPENDS = ustream-ssl +PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -43,9 +44,6 @@ define Package/uhttpd/description endef define Package/uhttpd/config - config PACKAGE_uhttpd_debug - bool "Build with debug messages" - default n config uhttpd_lua depends on PACKAGE_uhttpd-mod-lua bool "Enable Integrated Lua interpreter" diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index cdafa5be1..7fae197fe 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-05-22 -PKG_SOURCE_VERSION:=0e8b948ff8dd1cb1763180c99b522390529c7841 -PKG_MIRROR_HASH:=1cdd25464e1be69bef56092bc8547ba254ffc2d7c32f13cf02a80c8742876f1b +PKG_SOURCE_DATE:=2018-01-02 +PKG_SOURCE_VERSION:=78974417e182a3de8f78b7d73366ec0c98396b6c +PKG_MIRROR_HASH:=a60f9eb9428ac3256cd7c3c6d4207c116cedf4d212b82e2f86c1bf7c7898fcbb PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 diff --git a/package/network/services/wireguard/Makefile b/package/network/services/wireguard/Makefile new file mode 100644 index 000000000..0cb17e9cc --- /dev/null +++ b/package/network/services/wireguard/Makefile @@ -0,0 +1,115 @@ +# +# Copyright (C) 2016-2017 Jason A. Donenfeld +# Copyright (C) 2016 Baptiste Jonglez +# Copyright (C) 2016-2017 Dan Luedtke +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=wireguard + +PKG_VERSION:=0.0.20171221 +PKG_RELEASE:=1 + +PKG_SOURCE:=WireGuard-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=https://git.zx2c4.com/WireGuard/snapshot/ +PKG_HASH:=2b97697e9b271ba8836a04120a287b824648124f21d5309170ec51c1f86ac5ed + +PKG_LICENSE:=GPL-2.0 Apache-2.0 +PKG_LICENSE_FILES:=COPYING + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/WireGuard-$(PKG_VERSION) +PKG_BUILD_PARALLEL:=1 +PKG_USE_MIPS16:=0 + +# WireGuard's makefile needs this to know where to build the kernel module +export KERNELDIR:=$(LINUX_DIR) + +include $(INCLUDE_DIR)/package.mk + +define Package/wireguard/Default + SECTION:=net + CATEGORY:=Network + SUBMENU:=VPN + URL:=https://www.wireguard.com + MAINTAINER:=Baptiste Jonglez , \ + Dan Luedtke , \ + Jason A. Donenfeld +endef + +define Package/wireguard/Default/description + WireGuard is a novel VPN that runs inside the Linux Kernel and utilizes + state-of-the-art cryptography. It aims to be faster, simpler, leaner, and + more useful than IPSec, while avoiding the massive headache. It intends to + be considerably more performant than OpenVPN. WireGuard is designed as a + general purpose VPN for running on embedded interfaces and super computers + alike, fit for many different circumstances. It uses UDP. +endef + +define Package/wireguard + $(call Package/wireguard/Default) + TITLE:=WireGuard meta-package + DEPENDS:=+wireguard-tools +kmod-wireguard +endef + +include $(INCLUDE_DIR)/kernel-defaults.mk +include $(INCLUDE_DIR)/package-defaults.mk + +# Used by Build/Compile/Default +MAKE_PATH:=src/tools + +define Build/Compile + $(MAKE) $(KERNEL_MAKEOPTS) M="$(PKG_BUILD_DIR)/src" modules + $(call Build/Compile/Default) +endef + +define Package/wireguard/install + true +endef + +define Package/wireguard/description + $(call Package/wireguard/Default/description) +endef + +define Package/wireguard-tools + $(call Package/wireguard/Default) + TITLE:=WireGuard userspace control program (wg) + DEPENDS:=+libmnl +ip +endef + +define Package/wireguard-tools/description + $(call Package/wireguard/Default/description) + + This package provides the userspace control program for WireGuard, + `wg(8)`, and a netifd protocol helper. +endef + +define Package/wireguard-tools/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/tools/wg $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/lib/netifd/proto/ + $(INSTALL_BIN) ./files/wireguard.sh $(1)/lib/netifd/proto/ +endef + +define KernelPackage/wireguard + SECTION:=kernel + CATEGORY:=Kernel modules + SUBMENU:=Network Support + TITLE:=WireGuard kernel module + DEPENDS:=+IPV6:kmod-udptunnel6 +kmod-udptunnel4 + FILES:= $(PKG_BUILD_DIR)/src/wireguard.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoProbe,wireguard) +endef + +define KernelPackage/wireguard/description + $(call Package/wireguard/Default/description) + + This package provides the kernel module for WireGuard. +endef + +$(eval $(call BuildPackage,wireguard)) +$(eval $(call BuildPackage,wireguard-tools)) +$(eval $(call KernelPackage,wireguard)) diff --git a/package/network/services/wireguard/files/wireguard.sh b/package/network/services/wireguard/files/wireguard.sh new file mode 100644 index 000000000..7b18a2e0e --- /dev/null +++ b/package/network/services/wireguard/files/wireguard.sh @@ -0,0 +1,192 @@ +#!/bin/sh +# Copyright 2016-2017 Dan Luedtke +# Licensed to the public under the Apache License 2.0. + + +WG=/usr/bin/wg +if [ ! -x $WG ]; then + logger -t "wireguard" "error: missing wireguard-tools (${WG})" + exit 0 +fi + + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . ../netifd-proto.sh + init_proto "$@" +} + + +proto_wireguard_init_config() { + proto_config_add_string "private_key" + proto_config_add_int "listen_port" + proto_config_add_int "mtu" + proto_config_add_string "fwmark" + available=1 + no_proto_task=1 +} + + +proto_wireguard_setup_peer() { + local peer_config="$1" + + local public_key + local preshared_key + local allowed_ips + local route_allowed_ips + local endpoint_host + local endpoint_port + local persistent_keepalive + + config_get public_key "${peer_config}" "public_key" + config_get preshared_key "${peer_config}" "preshared_key" + config_get allowed_ips "${peer_config}" "allowed_ips" + config_get_bool route_allowed_ips "${peer_config}" "route_allowed_ips" 0 + config_get endpoint_host "${peer_config}" "endpoint_host" + config_get endpoint_port "${peer_config}" "endpoint_port" + config_get persistent_keepalive "${peer_config}" "persistent_keepalive" + + # peer configuration + echo "[Peer]" >> "${wg_cfg}" + echo "PublicKey=${public_key}" >> "${wg_cfg}" + if [ "${preshared_key}" ]; then + echo "PresharedKey=${preshared_key}" >> "${wg_cfg}" + fi + for allowed_ip in $allowed_ips; do + echo "AllowedIPs=${allowed_ip}" >> "${wg_cfg}" + done + if [ "${endpoint_host}" ]; then + case "${endpoint_host}" in + *:*) + endpoint="[${endpoint_host}]" + ;; + *) + endpoint="${endpoint_host}" + ;; + esac + if [ "${endpoint_port}" ]; then + endpoint="${endpoint}:${endpoint_port}" + else + endpoint="${endpoint}:51820" + fi + echo "Endpoint=${endpoint}" >> "${wg_cfg}" + fi + if [ "${persistent_keepalive}" ]; then + echo "PersistentKeepalive=${persistent_keepalive}" >> "${wg_cfg}" + fi + + # add routes for allowed ips + if [ ${route_allowed_ips} -ne 0 ]; then + for allowed_ip in ${allowed_ips}; do + case "${allowed_ip}" in + *:*/*) + proto_add_ipv6_route "${allowed_ip%%/*}" "${allowed_ip##*/}" + ;; + *.*/*) + proto_add_ipv4_route "${allowed_ip%%/*}" "${allowed_ip##*/}" + ;; + *:*) + proto_add_ipv6_route "${allowed_ip%%/*}" "128" + ;; + *.*) + proto_add_ipv4_route "${allowed_ip%%/*}" "32" + ;; + esac + done + fi +} + + +proto_wireguard_setup() { + local config="$1" + local wg_dir="/tmp/wireguard" + local wg_cfg="${wg_dir}/${config}" + + local private_key + local listen_port + local mtu + + # load configuration + config_load network + config_get private_key "${config}" "private_key" + config_get listen_port "${config}" "listen_port" + config_get addresses "${config}" "addresses" + config_get mtu "${config}" "mtu" + config_get fwmark "${config}" "fwmark" + + # create interface + ip link del dev "${config}" 2>/dev/null + ip link add dev "${config}" type wireguard + + if [ "${mtu}" ]; then + ip link set mtu "${mtu}" dev "${config}" + fi + + proto_init_update "${config}" 1 + + # generate configuration file + umask 077 + mkdir -p "${wg_dir}" + echo "[Interface]" > "${wg_cfg}" + echo "PrivateKey=${private_key}" >> "${wg_cfg}" + if [ "${listen_port}" ]; then + echo "ListenPort=${listen_port}" >> "${wg_cfg}" + fi + if [ "${fwmark}" ]; then + echo "FwMark=${fwmark}" >> "${wg_cfg}" + fi + config_foreach proto_wireguard_setup_peer "wireguard_${config}" + + # apply configuration file + ${WG} setconf ${config} "${wg_cfg}" + WG_RETURN=$? + + # delete configuration file + rm -f "${wg_cfg}" + + # check status + if [ ${WG_RETURN} -ne 0 ]; then + sleep 5 + proto_setup_failed "${config}" + exit 1 + fi + + # add ip addresses + for address in ${addresses}; do + case "${address}" in + *:*/*) + proto_add_ipv6_address "${address%%/*}" "${address##*/}" + ;; + *.*/*) + proto_add_ipv4_address "${address%%/*}" "${address##*/}" + ;; + *:*) + proto_add_ipv6_address "${address%%/*}" "128" + ;; + *.*) + proto_add_ipv4_address "${address%%/*}" "32" + ;; + esac + done + + # endpoint dependency + wg show "${config}" endpoints | \ + sed -E 's/\[?([0-9.:a-f]+)\]?:([0-9]+)/\1 \2/' | \ + while IFS=$'\t ' read -r key address port; do + [ -n "${port}" ] || continue + proto_add_host_dependency "${config}" "${address}" + done + + proto_send_update "${config}" +} + + +proto_wireguard_teardown() { + local config="$1" + ip link del dev "${config}" >/dev/null 2>&1 +} + + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol wireguard +} diff --git a/package/network/services/wireguard/patches/100-portability.patch b/package/network/services/wireguard/patches/100-portability.patch new file mode 100644 index 000000000..b26d51ebd --- /dev/null +++ b/package/network/services/wireguard/patches/100-portability.patch @@ -0,0 +1,18 @@ +tools: fix portability issue + +Check if the compiler defines __linux__, instead of assuming that the +host OS is the same as the target OS. + +Signed-off-by: Felix Fietkau +--- +--- a/src/tools/Makefile ++++ b/src/tools/Makefile +@@ -43,7 +43,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR + ifeq ($(DEBUG_TOOLS),y) + CFLAGS += -g + endif +-ifeq ($(shell uname -s),Linux) ++ifeq ($(strip $(shell echo __linux__ | $(CC) -E - | grep -v '^\#')),1) + LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null) + LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl) + CFLAGS += $(LIBMNL_CFLAGS) diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile index d2fd2593a..d1168ae68 100644 --- a/package/network/utils/arptables/Makefile +++ b/package/network/utils/arptables/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arptables PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/arptables +PKG_SOURCE_URL:=https://git.netfilter.org/arptables PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2015-05-20 PKG_SOURCE_VERSION:=f4ab8f63f11a72f14687a6646d04ae1bae3fa45f diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index ce99a2a68..3b7f4b902 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=29 +PKG_RELEASE:=30 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh index d438cb7a6..0d02d4c4b 100644 --- a/package/network/utils/comgt/files/3g.sh +++ b/package/network/utils/comgt/files/3g.sh @@ -109,4 +109,4 @@ proto_3g_teardown() { proto_kill_command "$interface" } -[ -z "NOT_INCLUDED" ] || add_protocol 3g +[ -z "$NOT_INCLUDED" ] || add_protocol 3g diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh index 381bfb000..3452fa5db 100644 --- a/package/network/utils/comgt/files/directip.sh +++ b/package/network/utils/comgt/files/directip.sh @@ -44,8 +44,7 @@ proto_directip_setup() { return 1 } - cardinfo=$(gcom -d "$device" -s /etc/gcom/getcardinfo.gcom) - [ -n $(echo "$cardinfo" | grep -q "Sierra Wireless") ] || { + gcom -d "$device" -s /etc/gcom/getcardinfo.gcom | grep -q "Sierra Wireless" || { proto_notify_error "$interface" BAD_DEVICE proto_block_restart "$interface" return 1 diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile index 128fa9e6f..f04ac69d2 100644 --- a/package/network/utils/conntrack-tools/Makefile +++ b/package/network/utils/conntrack-tools/Makefile @@ -8,18 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=conntrack-tools -PKG_VERSION:=1.4.4 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/conntrack-tools/files \ - ftp://ftp.netfilter.org/pub/conntrack-tools \ - http://mirrors.evolva.ro/netfilter.org/conntrack-tools -PKG_HASH:=b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools +PKG_SOURCE_DATE:=2017-09-27 +PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c +PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:conntrack-tools_project:conntrack-tools PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in index 6fa10b678..973da3d96 100644 --- a/package/network/utils/curl/Config.in +++ b/package/network/utils/curl/Config.in @@ -9,8 +9,8 @@ choice config LIBCURL_MBEDTLS bool "mbed TLS" - config LIBCURL_CYASSL - bool "CyaSSL" + config LIBCURL_WOLFSSL + bool "wolfSSL" config LIBCURL_OPENSSL bool "OpenSSL" @@ -101,6 +101,10 @@ config LIBCURL_TFTP bool "TFTP protocol" default n +config LIBCURL_NGHTTP2 + bool "HTTP2 protocol" + default n + comment "Miscellaneous" config LIBCURL_PROXY diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 5d510a4d3..17fcf704d 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl -PKG_VERSION:=7.54.1 +PKG_VERSION:=7.57.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -16,10 +16,11 @@ PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ http://curl.mirror.anstey.ca/ \ http://curl.askapache.com/download/ \ https://curl.haxx.se/download/ -PKG_HASH:=fdfc4df2d001ee0c44ec071186e770046249263c491fcae48df0e1a3ca8f25a0 +PKG_HASH:=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:haxx:libcurl PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -27,7 +28,7 @@ PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:= \ CONFIG_IPV6 \ \ - CONFIG_LIBCURL_CYASSL \ + CONFIG_LIBCURL_WOLFSSL \ CONFIG_LIBCURL_GNUTLS \ CONFIG_LIBCURL_OPENSSL \ CONFIG_LIBCURL_MBEDTLS \ @@ -53,6 +54,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_LIBCURL_SMTP \ CONFIG_LIBCURL_TELNET \ CONFIG_LIBCURL_TFTP \ + CONFIG_LIBCURL_NGHTTP2 \ \ CONFIG_LIBCURL_COOKIES \ CONFIG_LIBCURL_CRYPTO_AUTH \ @@ -84,8 +86,9 @@ define Package/libcurl $(call Package/curl/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:= +LIBCURL_CYASSL:libcyassl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls - DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2 + DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls + DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn + DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 TITLE:=A client-side URL transfer library MENU:=1 endef @@ -111,7 +114,7 @@ CONFIGURE_ARGS += \ \ $(call autoconf_bool,CONFIG_IPV6,ipv6) \ \ - $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ + $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \ $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \ $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \ @@ -119,6 +122,7 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \ $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ + $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ \ $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ diff --git a/package/network/utils/curl/patches/200-no_docs_tests.patch b/package/network/utils/curl/patches/200-no_docs_tests.patch index f5a158bf9..a2a685125 100644 --- a/package/network/utils/curl/patches/200-no_docs_tests.patch +++ b/package/network/utils/curl/patches/200-no_docs_tests.patch @@ -1,22 +1,22 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -154,8 +154,8 @@ - +@@ -156,7 +156,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) bin_SCRIPTS = curl-config --SUBDIRS = lib docs src include --DIST_SUBDIRS = $(SUBDIRS) tests packages scripts -+SUBDIRS = lib src include -+DIST_SUBDIRS = $(SUBDIRS) packages + SUBDIRS = lib src +-DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs ++DIST_SUBDIRS = $(SUBDIRS) packages include pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc -@@ -275,7 +275,7 @@ +@@ -267,8 +267,8 @@ cygwinbin: # We extend the standard install with a custom hook: install-data-hook: cd include && $(MAKE) install - cd docs && $(MAKE) install -+# cd docs && $(MAKE) install +- cd docs/libcurl && $(MAKE) install ++ #cd docs && $(MAKE) install ++ #cd docs/libcurl && $(MAKE) install # We extend the standard uninstall with a custom hook: uninstall-hook: diff --git a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch index ef9c4b807..aabf274ac 100644 --- a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch +++ b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch @@ -1,8 +1,8 @@ --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c -@@ -796,7 +796,7 @@ +@@ -814,7 +814,7 @@ static void Curl_mbedtls_session_free(vo - size_t Curl_mbedtls_version(char *buffer, size_t size) + static size_t Curl_mbedtls_version(char *buffer, size_t size) { - unsigned int version = mbedtls_version_get_number(); + unsigned int version = MBEDTLS_VERSION_NUMBER; diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index da7b7416a..7a3a82569 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=ebtables PKG_SOURCE_DATE:=2015-10-28 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/ebtables +PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index ea8f02631..2f420a2e2 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -8,17 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=2.0.9 -PKG_VERSION_SUFFIX:=a +PKG_VERSION:=2.0.10 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VERSION_SUFFIX).tar.gz -# Temporary URL change - iperf upstream altered the already released target -# without bumping the version number. The new tarball is renamed to avoid -# conflicts with existing mirrored files. -# PKG_SOURCE_URL:=@SF/iperf2 -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_HASH:=db02911f35686e808ed247160dfa766e08ae3f59d1e7dcedef0ffb2a6643f0bf +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=7fe4348dcca313b74e0aa9c34a8ccd713b84a5615b8578f4aa94cedce9891ef2 +PKG_SOURCE_URL:=@SF/iperf2 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/Makefile b/package/network/utils/iperf3/Makefile index 1b94ce70f..a64d7396a 100644 --- a/package/network/utils/iperf3/Makefile +++ b/package/network/utils/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.2 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.es.net/pub/iperf -PKG_HASH:=f207b36f861485845dbdf09f909c62f3d2222a3cf3d2682095aede8213cd9c1d +PKG_HASH:=6f596271251056bffc11bbb8f17d4244ad9a7d4a317c2459fdbb853ae51284d8 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch b/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch deleted file mode 100644 index d49e421ae..000000000 --- a/package/network/utils/iperf3/patches/010-fix-openssl-ac-macro.patch +++ /dev/null @@ -1,41 +0,0 @@ -commit 3fd1a2ae907bff2d7593c0bb9944aa05eca7b58d -Author: ralcini -Date: Mon Aug 14 22:43:38 2017 +0200 - - fix for issue #624 - force build without openssl (#631) - - * fix: now --without-openssl configure flags works - enh: if openssl support is required and no valid installation is found, now it raise an error - - * enh: added warning if building without openssl (iperf_auth disabled) - -diff --git a/configure.ac b/configure.ac -index 3c56cb3..79f3869 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -101,13 +101,18 @@ AC_CHECK_HEADERS([netinet/sctp.h], - #endif - ]) - --# Check for OPENSSL support --AX_CHECK_OPENSSL( -- AC_DEFINE([HAVE_SSL], [1], [OpenSSL Is Available]) --) --LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" --LIBS="$OPENSSL_LIBS $LIBS" --CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" -+if test "x$with_openssl" = "xno"; then -+ AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) -+else -+ # Check for OPENSSL support -+ AX_CHECK_OPENSSL( -+ [ AC_DEFINE([HAVE_SSL], [1], [OpenSSL Is Available]) ], -+ [ AC_MSG_FAILURE([--with-openssl was given, but test for openssl failed]) ] -+ ) -+ LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" -+ LIBS="$OPENSSL_LIBS $LIBS" -+ CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" -+fi - - # Check for TCP_CONGESTION sockopt (believed to be Linux and FreeBSD only) - AC_CACHE_CHECK([TCP_CONGESTION socket option], diff --git a/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch new file mode 100644 index 000000000..d617ba9f4 --- /dev/null +++ b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch @@ -0,0 +1,300 @@ +The following patches are taken directly from: + +https://github.com/esnet/iperf/pull/664 + +as an upstream submission. + +commit b63d41b25f49a76d0be66edfb61bd4cb68921d55 +Author: Philip Prindeville +Date: Tue Oct 31 13:41:08 2017 -0600 + + Fix warnings about _GNU_SOURCE being redefined. + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf.h b/src/iperf.h +index bb951dc..b656784 100755 +--- a/src/iperf.h ++++ b/src/iperf.h +@@ -36,7 +36,9 @@ + #endif + #include + #include +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #include + + #if defined(HAVE_CPUSET_SETAFFINITY) +diff --git a/src/iperf_api.c b/src/iperf_api.c +index ab30b93..9e41238 100755 +--- a/src/iperf_api.c ++++ b/src/iperf_api.c +@@ -24,7 +24,9 @@ + * This code is distributed under a BSD style license, see the LICENSE file + * for complete information. + */ +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #define __USE_GNU + + #include "iperf_config.h" + +commit 315254cfc5f5682627f4a46ade3100bc3c64cfcc +Author: Philip Prindeville +Date: Tue Oct 31 13:42:58 2017 -0600 + + Fix warnings of format-specified mismatching type + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c +index 91cf032..6f86d5d 100644 +--- a/src/iperf_tcp.c ++++ b/src/iperf_tcp.c +@@ -24,8 +24,6 @@ + * This code is distributed under a BSD style license, see the LICENSE + * file for complete information. + */ +-#include "iperf_config.h" +- + #include + #include + #include +@@ -44,6 +42,12 @@ + #include "net.h" + #include "cjson.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + #if defined(HAVE_FLOWLABEL) + #include "flowlabel.h" + #endif /* HAVE_FLOWLABEL */ +@@ -90,7 +94,7 @@ iperf_tcp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } +diff --git a/src/iperf_udp.c b/src/iperf_udp.c +index a2ea6d0..d04ae44 100644 +--- a/src/iperf_udp.c ++++ b/src/iperf_udp.c +@@ -48,6 +48,12 @@ + #include "cjson.h" + #include "portable_endian.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + /* iperf_udp_recv + * + * receives the data for UDP +@@ -98,7 +104,7 @@ iperf_udp_recv(struct iperf_stream *sp) + } + + if (sp->test->debug) +- fprintf(stderr, "pcount %llu packet_count %d\n", pcount, sp->packet_count); ++ fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); + + /* + * Try to handle out of order packets. The way we do this +@@ -141,7 +147,7 @@ iperf_udp_recv(struct iperf_stream *sp) + + /* Log the out-of-order packet */ + if (sp->test->debug) +- fprintf(stderr, "OUT OF ORDER - incoming packet sequence %llu but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); ++ fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); + } + + /* +@@ -220,7 +226,7 @@ iperf_udp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } + +commit 9a66b3b0349e0a158bb4940b668a5cbc7c245762 +Author: Philip Prindeville +Date: Tue Oct 31 13:44:34 2017 -0600 + + Simplify endianness checks + + Linux can be built with too many types of C run-time library and it's + not reasonable to have to enumerate all of them, especially since at + least one of them (MUSL) goes out of its way to not be easily + detectable. + + Instead, leverage autoconf better for Linux/BSD to detect either + or directly. + + Signed-off-by: Philip Prindeville + +diff --git a/configure.ac b/configure.ac +index f57e83f..cfb42ac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,6 +101,14 @@ AC_CHECK_HEADERS([netinet/sctp.h], + #endif + ]) + ++AC_CHECK_HEADER([endian.h], ++ AC_DEFINE([HAVE_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_CHECK_HEADER([sys/endian.h], ++ AC_DEFINE([HAVE_SYS_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_MSG_WARN([Couldn't find endian.h or sys/endian.h files: doing compile-time tests.]) ++ ) ++ ) ++ + if test "x$with_openssl" = "xno"; then + AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) + else +diff --git a/src/iperf_config.h.in b/src/iperf_config.h.in +index bd03935..a9e51ec 100644 +--- a/src/iperf_config.h.in ++++ b/src/iperf_config.h.in +@@ -9,6 +9,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ENDIAN_H ++ + /* Have IPv6 flowlabel support. */ + #undef HAVE_FLOWLABEL + +@@ -54,6 +57,9 @@ + /* Define to 1 if the system has the type `struct sctp_assoc_value'. */ + #undef HAVE_STRUCT_SCTP_ASSOC_VALUE + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_ENDIAN_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_SOCKET_H + +diff --git a/src/portable_endian.h b/src/portable_endian.h +index b86d37a..5dbc6e5 100644 +--- a/src/portable_endian.h ++++ b/src/portable_endian.h +@@ -10,14 +10,33 @@ + + #endif + +-// GLIBC / Linux with endian(3) support, which was added in glibc 2.9. +-// Intended to support CentOS 6 and newer. +-#if defined(__linux__) && \ +- ((__GLIBC__ > 3) || \ +- (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9)) +- ++#if defined(HAVE_ENDIAN_H) + # include + ++#elif defined(HAVE_SYS_ENDIAN_H) ++# include ++ ++# if defined(__OpenBSD__) ++ ++# define be16toh(x) betoh16(x) ++# define le16toh(x) letoh16(x) ++ ++# define be32toh(x) betoh32(x) ++# define le32toh(x) letoh32(x) ++ ++# define be64toh(x) betoh64(x) ++# define le64toh(x) letoh64(x) ++ ++# elif defined(__sgi) ++ ++# include ++# include ++ ++# define be64toh(x) (x) ++# define htobe64(x) (x) ++ ++# endif ++ + #elif defined(__CYGWIN__) + + # include +@@ -46,32 +65,6 @@ + # define __LITTLE_ENDIAN LITTLE_ENDIAN + # define __PDP_ENDIAN PDP_ENDIAN + +-#elif defined(__OpenBSD__) +- +-# include +- +-# define be16toh(x) betoh16(x) +-# define le16toh(x) letoh16(x) +- +-# define be32toh(x) betoh32(x) +-# define le32toh(x) letoh32(x) +- +-# define be64toh(x) betoh64(x) +-# define le64toh(x) letoh64(x) +- +-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +- +-# include +- +-#elif defined(__sgi) +- +-# include +-# include +-# include +- +-# define be64toh(x) (x) +-# define htobe64(x) (x) +- + #elif defined(__sun) && defined(__SVR4) + + # include + +commit 7e7285d0daf92ef7beda8f78a6f63cc647a77f38 +Author: Philip Prindeville +Date: Tue Oct 31 13:48:06 2017 -0600 + + Sys headers should not be included directly + + There's usually a top-level header which then includes the sys/ + descendent. + + Signed-off-by: Philip Prindeville + +diff --git a/src/net.c b/src/net.c +index af456cb..afd0022 100644 +--- a/src/net.c ++++ b/src/net.c +@@ -31,13 +31,12 @@ + #include + #include + #include +-#include + #include + #include + #include + #include + #include +-#include ++#include + + #ifdef HAVE_SENDFILE + #ifdef linux diff --git a/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch b/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch deleted file mode 100644 index fa78d91b1..000000000 --- a/package/network/utils/iperf3/patches/100-iperf_auth-rsa-header.patch +++ /dev/null @@ -1,17 +0,0 @@ -commit 31d5b6b580a356c5149dbc4f53118b7f83c60822 -Author: Philip Prindeville -Date: Sun Jul 30 18:54:46 2017 -0600 -Subject: Add required RSA header for OpenSSL - -Signed-off-by: Philip Prindeville - ---- a/src/iperf_auth.c 2017-06-26 11:42:56.000000000 -0600 -+++ b/src/iperf_auth.c 2017-07-30 17:42:43.070447875 -0600 -@@ -40,6 +40,7 @@ - #include - #include - #include -+#include - - void sha256(const char *string, char outputBuffer[65]) - { diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 260bdac77..5f718748d 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,18 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=4.11.0 -PKG_RELEASE:=1 +PKG_VERSION:=4.14.1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=72671028bda696d0cb8f48ec8e702581c3a501caeed33eec3a81d7041cbc8026 +PKG_HASH:=d43ac068afcc350a448f4581b6e292331ef7e4e7aa746e34981582d5fdb10067 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/iproute2/Default @@ -28,7 +30,6 @@ define Package/iproute2/Default URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 SUBMENU:=Routing and Redirection MAINTAINER:=Russell Senior - DEPENDS:= +libnl-tiny endef define Package/ip-tiny @@ -37,6 +38,7 @@ $(call Package/iproute2/Default) VARIANT:=tiny PROVIDES:=ip ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-full @@ -45,32 +47,37 @@ $(call Package/iproute2/Default) VARIANT:=full PROVIDES:=ip ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/tc $(call Package/iproute2/Default) TITLE:=Traffic control utility - DEPENDS:=+kmod-sched-core + DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/genl $(call Package/iproute2/Default) TITLE:=General netlink utility frontend + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-bridge $(call Package/iproute2/Default) TITLE:=Bridge configuration utility from iproute2 + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ss $(call Package/iproute2/Default) TITLE:=Socket statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/nstat $(call Package/iproute2/Default) TITLE:=Network statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/devlink @@ -79,10 +86,24 @@ $(call Package/iproute2/Default) DEPENDS:=+libmnl endef +define Package/rdma +$(call Package/iproute2/Default) + TITLE:=Network rdma utility + DEPENDS:=+libmnl +endef + ifeq ($(BUILD_VARIANT),tiny) IP_CONFIG_TINY:=y endif +ifdef CONFIG_PACKAGE_devlink + HAVE_MNL:=y +endif + +ifdef CONFIG_PACKAGE_rdma + HAVE_MNL:=y +endif + define Build/Configure $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \ @@ -101,6 +122,7 @@ MAKE_FLAGS += \ SHARED_LIBS="" \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ IP_CONFIG_TINY=$(IP_CONFIG_TINY) \ + HAVE_MNL=$(HAVE_MNL) \ IPT_LIB_DIR=/usr/lib/iptables \ FPIC="$(FPIC)" @@ -157,6 +179,11 @@ define Package/devlink/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/ endef +define Package/rdma/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) $(eval $(call BuildPackage,tc)) @@ -165,3 +192,4 @@ $(eval $(call BuildPackage,ip-bridge)) $(eval $(call BuildPackage,ss)) $(eval $(call BuildPackage,nstat)) $(eval $(call BuildPackage,devlink)) +$(eval $(call BuildPackage,rdma)) diff --git a/package/network/utils/iproute2/patches/001-config.patch b/package/network/utils/iproute2/patches/001-config.patch index b3208e063..7f23cfc35 100644 --- a/package/network/utils/iproute2/patches/001-config.patch +++ b/package/network/utils/iproute2/patches/001-config.patch @@ -1,8 +1,7 @@ --- /dev/null +++ b/Config -@@ -0,0 +1,5 @@ +@@ -0,0 +1,4 @@ +# Fixed config to disable ATM support even if present on host system +IP_CONFIG_SETNS:=y +TC_CONFIG_ATM:=n +TC_CONFIG_XT:=y -+HAVE_MNL:=y diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch index e1a5e9756..1f3eb101e 100644 --- a/package/network/utils/iproute2/patches/004-darwin_fixes.patch +++ b/package/network/utils/iproute2/patches/004-darwin_fixes.patch @@ -42,7 +42,7 @@ #define TABLESIZE 16384 --- a/netem/paretonormal.c +++ b/netem/paretonormal.c -@@ -15,10 +15,13 @@ +@@ -14,10 +14,13 @@ #include #include #include diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch index 0f6f269d4..e23fbcd77 100644 --- a/package/network/utils/iproute2/patches/006-no_sctp.patch +++ b/package/network/utils/iproute2/patches/006-no_sctp.patch @@ -1,6 +1,6 @@ --- a/ip/ipxfrm.c +++ b/ip/ipxfrm.c -@@ -465,7 +465,6 @@ void xfrm_selector_print(struct xfrm_sel +@@ -454,7 +454,6 @@ void xfrm_selector_print(struct xfrm_sel switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: @@ -8,7 +8,7 @@ case IPPROTO_DCCP: default: /* XXX */ if (sel->sport_mask) -@@ -1321,7 +1320,6 @@ static int xfrm_selector_upspec_parse(st +@@ -1329,7 +1328,6 @@ static int xfrm_selector_upspec_parse(st switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: diff --git a/package/network/utils/iproute2/patches/007-no_arpd.patch b/package/network/utils/iproute2/patches/007-no_arpd.patch index 94fb197a4..ac216ba82 100644 --- a/package/network/utils/iproute2/patches/007-no_arpd.patch +++ b/package/network/utils/iproute2/patches/007-no_arpd.patch @@ -2,7 +2,7 @@ +++ b/misc/Makefile @@ -5,9 +5,9 @@ TARGETS=ss nstat ifstat rtacct lnstat - include ../Config + include ../config.mk -ifeq ($(HAVE_BERKELEY_DB),y) - TARGETS += arpd @@ -11,5 +11,5 @@ +# TARGETS += arpd +#endif - ifeq ($(HAVE_SELINUX),y) - LDLIBS += $(shell $(PKG_CONFIG) --libs libselinux) + all: $(TARGETS) + diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch index 47ffd9946..2e088f199 100644 --- a/package/network/utils/iproute2/patches/008-no_netem.patch +++ b/package/network/utils/iproute2/patches/008-no_netem.patch @@ -1,11 +1,11 @@ --- a/Makefile +++ b/Makefile -@@ -52,7 +52,7 @@ WFLAGS += -Wmissing-declarations -Wold-s - CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS) +@@ -49,7 +49,7 @@ WFLAGS += -Wmissing-declarations -Wold-s + CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v --SUBDIRS=lib ip tc bridge misc netem genl tipc devlink man -+SUBDIRS=lib ip tc bridge misc genl tipc devlink man +-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man ++SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a LDLIBS += $(LIBNETLINK) diff --git a/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch new file mode 100644 index 000000000..7a5a70223 --- /dev/null +++ b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -292,7 +292,7 @@ check_selinux() + + check_mnl() + { +- if ${PKG_CONFIG} libmnl --exists ++ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists + then + echo "HAVE_MNL:=y" >>$CONFIG + echo "yes" diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch index b28e19de5..e779934d7 100644 --- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch +++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -45,7 +45,7 @@ HOSTCC ?= $(CC) +@@ -42,7 +42,7 @@ HOSTCC ?= $(CC) DEFINES += -D_GNU_SOURCE # Turn on transparent support for LFS DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch index 1f397f71b..83ce66d97 100644 --- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch +++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch @@ -1,11 +1,10 @@ --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,7 +4,7 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -1,6 +1,6 @@ + include ../config.mk -CFLAGS += -fPIC +CFLAGS += $(FPIC) UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ - inet_proto.o namespace.o json_writer.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ diff --git a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch index b0ed59919..e3364ad05 100644 --- a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch +++ b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -15,9 +15,9 @@ Signed-off-by: Jonas Gorski include/uapi/linux/libc-compat.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) ---- a/include/linux/libc-compat.h -+++ b/include/linux/libc-compat.h -@@ -48,13 +48,13 @@ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -49,13 +49,13 @@ #ifndef _LIBC_COMPAT_H #define _LIBC_COMPAT_H @@ -36,7 +36,7 @@ Signed-off-by: Jonas Gorski * that would already be defined. */ #define __UAPI_DEF_IF_IFCONF 0 -@@ -65,7 +65,11 @@ +@@ -66,7 +66,11 @@ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO @@ -48,7 +48,7 @@ Signed-off-by: Jonas Gorski #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ #else /* _NET_IF_H */ -@@ -85,10 +89,10 @@ +@@ -86,10 +90,10 @@ #endif /* _NET_IF_H */ @@ -61,7 +61,7 @@ Signed-off-by: Jonas Gorski * that would already be defined. */ #define __UAPI_DEF_IN_ADDR 0 #define __UAPI_DEF_IN_IPPROTO 0 -@@ -102,7 +106,7 @@ +@@ -103,7 +107,7 @@ * if the glibc code didn't define them. This guard matches * the guard in glibc/inet/netinet/in.h which defines the * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ @@ -70,7 +70,7 @@ Signed-off-by: Jonas Gorski #define __UAPI_DEF_IN6_ADDR_ALT 0 #else #define __UAPI_DEF_IN6_ADDR_ALT 1 -@@ -117,7 +121,7 @@ +@@ -118,7 +122,7 @@ #else /* Linux headers included first, and we must define everything @@ -79,7 +79,7 @@ Signed-off-by: Jonas Gorski * __UAPI_DEF_* defines and adjust appropriately. */ #define __UAPI_DEF_IN_ADDR 1 #define __UAPI_DEF_IN_IPPROTO 1 -@@ -127,7 +131,7 @@ +@@ -128,7 +132,7 @@ #define __UAPI_DEF_IN_CLASS 1 #define __UAPI_DEF_IN6_ADDR 1 @@ -88,7 +88,7 @@ Signed-off-by: Jonas Gorski * coordinate. */ #define __UAPI_DEF_IN6_ADDR_ALT 1 #define __UAPI_DEF_SOCKADDR_IN6 1 -@@ -168,7 +172,7 @@ +@@ -169,7 +173,7 @@ /* If we did not see any headers from any supported C libraries, * or we are being included in the kernel, then define everything * that we need. */ @@ -97,7 +97,7 @@ Signed-off-by: Jonas Gorski /* Definitions for if.h */ #define __UAPI_DEF_IF_IFCONF 1 -@@ -208,6 +212,6 @@ +@@ -209,6 +213,6 @@ /* Definitions for xattr.h */ #define __UAPI_DEF_XATTR 1 diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch index 42e29326b..abd1f7eac 100644 --- a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch +++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -14,9 +14,9 @@ Signed-off-by: Jonas Gorski include/uapi/linux/libc-compat.h | 11 +++++++++++ 2 files changed, 14 insertions(+) ---- a/include/linux/if_ether.h -+++ b/include/linux/if_ether.h -@@ -22,6 +22,7 @@ +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,6 +23,7 @@ #define _LINUX_IF_ETHER_H #include @@ -24,7 +24,7 @@ Signed-off-by: Jonas Gorski /* * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -142,11 +143,13 @@ +@@ -149,11 +150,13 @@ * This is an Ethernet frame header. */ @@ -38,9 +38,9 @@ Signed-off-by: Jonas Gorski #endif /* _LINUX_IF_ETHER_H */ ---- a/include/linux/libc-compat.h -+++ b/include/linux/libc-compat.h -@@ -89,6 +89,14 @@ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -90,6 +90,14 @@ #endif /* _NET_IF_H */ @@ -55,7 +55,7 @@ Signed-off-by: Jonas Gorski /* Coordinate with libc netinet/in.h header. */ #if defined(_NETINET_IN_H) -@@ -184,6 +192,9 @@ +@@ -185,6 +193,9 @@ /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 @@ -65,15 +65,3 @@ Signed-off-by: Jonas Gorski /* Definitions for in.h */ #define __UAPI_DEF_IN_ADDR 1 #define __UAPI_DEF_IN_IPPROTO 1 ---- a/ip/iplink_bridge.c -+++ b/ip/iplink_bridge.c -@@ -14,8 +14,8 @@ - #include - #include - #include --#include - #include -+#include - #include - - #include "rt_names.h" diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch index e1b1da4d2..35b588f7e 100644 --- a/package/network/utils/iproute2/patches/300-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch @@ -1,8 +1,8 @@ --- a/ip/Makefile +++ b/ip/Makefile -@@ -19,6 +19,13 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -15,6 +15,13 @@ RTMONOBJ=rtmon.o + + include ../config.mk +STATIC_SYM_FILTER:= +ifeq ($(IP_CONFIG_TINY),y) @@ -14,7 +14,7 @@ ALLOBJ=$(IPOBJ) $(RTMONOBJ) SCRIPTS=ifcfg rtpr routel routef TARGETS=ip rtmon -@@ -48,7 +55,7 @@ else +@@ -44,7 +51,7 @@ else ip: static-syms.o static-syms.o: static-syms.h @@ -25,7 +25,24 @@ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ --- a/ip/ip.c +++ b/ip/ip.c -@@ -74,32 +74,44 @@ static const struct cmd { +@@ -49,10 +49,16 @@ static void usage(void) + fprintf(stderr, + "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" + " ip [ -force ] -batch filename\n" ++#ifndef IPROUTE2_TINY + "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" + " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" + " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" + " vrf | sr }\n" ++#else ++"where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n" ++" mroute | mrule | monitor | netns | macsec | token | ila |\n" ++" vrf | sr }\n" ++#endif + " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" + " -h[uman-readable] | -iec |\n" + " -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n" +@@ -74,32 +80,44 @@ static const struct cmd { int (*func)(int argc, char **argv); } cmds[] = { { "address", do_ipaddr }, @@ -68,11 +85,11 @@ { "netconf", do_ipnetconf }, +#endif { "vrf", do_ipvrf}, + { "sr", do_seg6 }, { "help", do_help }, - { 0 } --- a/lib/utils.c +++ b/lib/utils.c -@@ -777,6 +777,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -817,6 +817,7 @@ const char *rt_addr_n2a_r(int af, int le return inet_ntop(af, addr, buf, buflen); case AF_MPLS: return mpls_ntop(af, addr, buf, buflen); @@ -80,7 +97,7 @@ case AF_IPX: return ipx_ntop(af, addr, buf, buflen); case AF_DECnet: -@@ -786,6 +787,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -826,6 +827,7 @@ const char *rt_addr_n2a_r(int af, int le memcpy(dna.a_addr, addr, 2); return dnet_ntop(af, &dna, buf, buflen); } @@ -90,14 +107,14 @@ default: --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -2,6 +2,10 @@ include ../config.mk + + CFLAGS += $(FPIC) +ifeq ($(IP_CONFIG_TINY),y) + CFLAGS += -DIPROUTE2_TINY +endif + - CFLAGS += $(FPIC) - UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ + names.o color.o bpf.o exec.o fs.o diff --git a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch index 44f198f1b..1980f8710 100644 --- a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch +++ b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch @@ -9,29 +9,6 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY ip/rtm_map.c | 4 ++++ 3 files changed, 9 insertions(+) ---- a/include/linux/fib_rules.h -+++ b/include/linux/fib_rules.h -@@ -72,6 +72,10 @@ enum { - FR_ACT_BLACKHOLE, /* Drop without notification */ - FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ - FR_ACT_PROHIBIT, /* Drop with EACCES */ -+ FR_ACT_RES8, -+ FR_ACT_RES9, -+ FR_ACT_RES10, -+ FR_ACT_FAILED_POLICY, /* Drop with EPERM */ - __FR_ACT_MAX, - }; - ---- a/include/linux/rtnetlink.h -+++ b/include/linux/rtnetlink.h -@@ -215,6 +215,7 @@ enum { - RTN_THROW, /* Not in this table */ - RTN_NAT, /* Translate this address */ - RTN_XRESOLVE, /* Use external resolver */ -+ RTN_FAILED_POLICY, /* Source address failed policy */ - __RTN_MAX - }; - --- a/ip/rtm_map.c +++ b/ip/rtm_map.c @@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf @@ -52,3 +29,13 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY else { res = strtoul(arg, &end, 0); if (!end || end == arg || *end || res > 255) +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -221,6 +221,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_FAILED_POLICY, /* Source address failed policy */ + __RTN_MAX + }; + diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 0705eb12c..5e91cd7ed 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -1,6 +1,6 @@ ---- a/include/linux/pkt_sched.h -+++ b/include/linux/pkt_sched.h -@@ -863,4 +863,60 @@ struct tc_pie_xstats { +--- a/include/uapi/linux/pkt_sched.h ++++ b/include/uapi/linux/pkt_sched.h +@@ -872,4 +872,63 @@ struct tc_pie_xstats { __u32 maxq; /* maximum queue size */ __u32 ecn_mark; /* packets marked with ecn*/ }; @@ -21,6 +21,8 @@ + TCA_CAKE_ETHERNET, + TCA_CAKE_WASH, + TCA_CAKE_MPU, ++ TCA_CAKE_INGRESS, ++ TCA_CAKE_ACK_FILTER, + __TCA_CAKE_MAX +}; +#define TCA_CAKE_MAX (__TCA_CAKE_MAX - 1) @@ -33,12 +35,12 @@ + +#define TC_CAKE_MAX_TINS (8) +struct tc_cake_xstats { -+ __u16 version; /* == 4, increments when struct extended */ ++ __u16 version; /* == 5, increments when struct extended */ + __u8 max_tins; /* == TC_CAKE_MAX_TINS */ + __u8 tin_cnt; /* <= TC_CAKE_MAX_TINS */ + + __u32 threshold_rate [TC_CAKE_MAX_TINS]; -+ __u32 target_us [TC_CAKE_MAX_TINS]; ++ __u32 target_us [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats sent [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats dropped [TC_CAKE_MAX_TINS]; + struct tc_cake_traffic_stats ecn_marked[TC_CAKE_MAX_TINS]; @@ -47,23 +49,24 @@ + __u32 way_indirect_hits[TC_CAKE_MAX_TINS]; + __u32 way_misses [TC_CAKE_MAX_TINS]; + __u32 way_collisions [TC_CAKE_MAX_TINS]; -+ __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to bulk flows */ ++ __u32 peak_delay_us [TC_CAKE_MAX_TINS]; /* ~= bulk flow delay */ + __u32 avge_delay_us [TC_CAKE_MAX_TINS]; -+ __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= delay to sparse flows */ ++ __u32 base_delay_us [TC_CAKE_MAX_TINS]; /* ~= sparse flows delay */ + __u16 sparse_flows [TC_CAKE_MAX_TINS]; + __u16 bulk_flows [TC_CAKE_MAX_TINS]; -+ __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */ -+ __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */ ++ __u16 unresponse_flows [TC_CAKE_MAX_TINS]; /* v4 - was u32 last_len */ ++ __u16 spare [TC_CAKE_MAX_TINS]; /* v4 - split last_len */ + __u32 max_skblen [TC_CAKE_MAX_TINS]; + __u32 capacity_estimate; /* version 2 */ + __u32 memory_limit; /* version 3 */ -+ __u32 memory_used; /* version 3 */ ++ __u32 memory_used; /* version 3 */ ++ struct tc_cake_traffic_stats ack_drops [TC_CAKE_MAX_TINS]; /* v5 */ +}; + #endif --- a/tc/Makefile +++ b/tc/Makefile -@@ -67,6 +67,7 @@ TCMODULES += q_codel.o +@@ -65,6 +65,7 @@ TCMODULES += q_codel.o TCMODULES += q_fq_codel.o TCMODULES += q_fq.o TCMODULES += q_pie.o @@ -73,7 +76,7 @@ TCMODULES += e_bpf.o --- /dev/null +++ b/tc/q_cake.c -@@ -0,0 +1,692 @@ +@@ -0,0 +1,771 @@ +/* + * Common Applications Kept Enhanced -- CAKE + * @@ -137,9 +140,10 @@ +" dual-srchost | dual-dsthost | triple-isolate* ]\n" +" [ nat | nonat* ]\n" +" [ wash | nowash * ]\n" ++" [ ack-filter | ack-filter-aggressive | no-ack-filter * ]\n" +" [ memlimit LIMIT ]\n" +" [ ptm | atm | noatm* ] [ overhead N | conservative | raw* ]\n" -+" [ mpu N ]\n" ++" [ mpu N ] [ ingress | egress* ]\n" +" (* marks defaults)\n"); +} + @@ -155,12 +159,14 @@ + int overhead = 0; + bool overhead_set = false; + bool overhead_override = false; -+ int wash = -1; + int mpu = 0; + int flowmode = -1; + int nat = -1; + int atm = -1; + int autorate = -1; ++ int wash = -1; ++ int ingress = -1; ++ int ack_filter = -1; + struct rtattr *tail; + + while (argc > 0) { @@ -314,12 +320,22 @@ + /* Typical VDSL2 framing schemes, both over PTM */ + /* PTM has 64b/65b coding which absorbs some bandwidth */ + } else if (strcmp(*argv, "pppoe-ptm") == 0) { ++ /* 2B PPP + 6B PPPoE + 6B dest MAC + 6B src MAC ++ * + 2B ethertype + 4B Frame Check Sequence ++ * + 1B Start of Frame (S) + 1B End of Frame (Ck) ++ * + 2B TC-CRC (PTM-FCS) = 30B ++ */ + atm = 2; -+ overhead += 27; ++ overhead += 30; + overhead_set = true; + } else if (strcmp(*argv, "bridged-ptm") == 0) { ++ /* 6B dest MAC + 6B src MAC + 2B ethertype ++ * + 4B Frame Check Sequence ++ * + 1B Start of Frame (S) + 1B End of Frame (Ck) ++ * + 2B TC-CRC (PTM-FCS) = 22B ++ */ + atm = 2; -+ overhead += 19; ++ overhead += 22; + overhead_set = true; + + } else if (strcmp(*argv, "via-ethernet") == 0) { @@ -332,9 +348,27 @@ + * that automatically, and is thus ignored. + * + * It would be deleted entirely, but it appears in the -+ * stats output when the automatic compensation is active. ++ * stats output when the automatic compensation is ++ * active. + */ + ++ } else if (strcmp(*argv, "total_overhead") == 0) { ++ /* ++ * This is the overhead cake accounts for; added here so ++ * that cake's "tc -s qdisc" output can be directly ++ * pasted into the tc command to instantate a new cake.. ++ */ ++ NEXT_ARG(); ++ ++ } else if (strcmp(*argv, "hard_header_len") == 0) { ++ /* ++ * This is the overhead the kernel automatically ++ * accounted for; added here so that cake's "tc -s ++ * qdisc" output can be directly pasted into the tc ++ * command to instantiate a new cake.. ++ */ ++ NEXT_ARG(); ++ + } else if (strcmp(*argv, "ethernet") == 0) { + /* ethernet pre-amble & interframe gap & FCS + * you may need to add vlan tag */ @@ -350,7 +384,7 @@ + + /* + * DOCSIS cable shapers account for Ethernet frame with FCS, -+ * but not interframe gap nor preamble. ++ * but not interframe gap or preamble. + */ + } else if (strcmp(*argv, "docsis") == 0) { + atm = 0; @@ -377,6 +411,18 @@ + return -1; + } + ++ } else if (strcmp(*argv, "ingress") == 0) { ++ ingress = 1; ++ } else if (strcmp(*argv, "egress") == 0) { ++ ingress = 0; ++ ++ } else if (strcmp(*argv, "no-ack-filter") == 0) { ++ ack_filter = 0; ++ } else if (strcmp(*argv, "ack-filter") == 0) { ++ ack_filter = 0x0200; ++ } else if (strcmp(*argv, "ack-filter-aggressive") == 0) { ++ ack_filter = 0x0600; ++ + } else if (strcmp(*argv, "memlimit") == 0) { + NEXT_ARG(); + if(get_size(&memlimit, *argv)) { @@ -425,6 +471,10 @@ + addattr_l(n, 1024, TCA_CAKE_NAT, &nat, sizeof(nat)); + if (wash != -1) + addattr_l(n, 1024, TCA_CAKE_WASH, &wash, sizeof(wash)); ++ if (ingress != -1) ++ addattr_l(n, 1024, TCA_CAKE_INGRESS, &ingress, sizeof(ingress)); ++ if (ack_filter != -1) ++ addattr_l(n, 1024, TCA_CAKE_ACK_FILTER, &ack_filter, sizeof(ack_filter)); + + tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail; + return 0; @@ -446,6 +496,8 @@ + int nat = 0; + int autorate = 0; + int wash = 0; ++ int ingress = 0; ++ int ack_filter = 0; + SPRINT_BUF(b1); + SPRINT_BUF(b2); + @@ -551,6 +603,14 @@ + RTA_PAYLOAD(tb[TCA_CAKE_MPU]) >= sizeof(__u32)) { + mpu = rta_getattr_u32(tb[TCA_CAKE_MPU]); + } ++ if (tb[TCA_CAKE_INGRESS] && ++ RTA_PAYLOAD(tb[TCA_CAKE_INGRESS]) >= sizeof(__u32)) { ++ ingress = rta_getattr_u32(tb[TCA_CAKE_INGRESS]); ++ } ++ if (tb[TCA_CAKE_ACK_FILTER] && ++ RTA_PAYLOAD(tb[TCA_CAKE_ACK_FILTER]) >= sizeof(__u32)) { ++ ack_filter = rta_getattr_u32(tb[TCA_CAKE_ACK_FILTER]); ++ } + if (tb[TCA_CAKE_ETHERNET] && + RTA_PAYLOAD(tb[TCA_CAKE_ETHERNET]) >= sizeof(__u32)) { + ethernet = rta_getattr_u32(tb[TCA_CAKE_ETHERNET]); @@ -563,6 +623,14 @@ + if (wash) + fprintf(f,"wash "); + ++ if (ingress) ++ fprintf(f,"ingress "); ++ ++ if (ack_filter == 0x0600) ++ fprintf(f,"ack-filter-aggressive "); ++ else if (ack_filter) ++ fprintf(f,"ack-filter "); ++ + if (interval) + fprintf(f, "rtt %s ", sprint_time(interval, b2)); + @@ -578,12 +646,19 @@ + + fprintf(f, "overhead %d ", overhead); + -+ // This is actually the *amount* of automatic compensation, but we only report -+ // its presence as a boolean for now. ++ /* This is actually the *amount* of automatic compensation, but ++ * we only report its presence as a boolean for now. ++ */ + if (ethernet) + fprintf(f, "via-ethernet "); + } + ++ /* unconditionally report the overhead and hard_header_len overhead the ++ * kernel added automatically ++ */ ++ fprintf(f, "total_overhead %d ", overhead); ++ fprintf(f, "hard_header_len %d ", ethernet); ++ + if (mpu) { + fprintf(f, "mpu %d ", mpu); + } @@ -595,7 +670,7 @@ +} + +static int cake_print_xstats(struct qdisc_util *qu, FILE *f, -+ struct rtattr *xstats) ++ struct rtattr *xstats) +{ + /* fq_codel stats format borrowed */ + struct tc_fq_codel_xstats *st; @@ -650,109 +725,116 @@ + + switch(stnc->tin_cnt) { + case 3: -+ fprintf(f, " Bulk Best Effort Voice\n"); ++ fprintf(f, " Bulk Best Effort Voice\n"); + break; + + case 4: -+ fprintf(f, " Bulk Best Effort Video Voice\n"); ++ fprintf(f, " Bulk Best Effort Video Voice\n"); + break; + + case 5: -+ fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n"); ++ fprintf(f, " Low Loss Best Effort Low Delay Bulk Net Control\n"); + break; + + default: + fprintf(f, " "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, " Tin %u", i); ++ fprintf(f, " Tin %u", i); + fprintf(f, "\n"); + }; + + fprintf(f, " thresh "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_rate(stnc->threshold_rate[i], b1)); ++ fprintf(f, " %12s", sprint_rate(stnc->threshold_rate[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " target "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->target_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->target_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " interval"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->interval_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->interval_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " pk_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->peak_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->peak_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " av_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->avge_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->avge_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " sp_delay"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12s", sprint_time(stnc->base_delay_us[i], b1)); ++ fprintf(f, " %12s", sprint_time(stnc->base_delay_us[i], b1)); + fprintf(f, "\n"); + + fprintf(f, " pkts "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->sent[i].packets); ++ fprintf(f, " %12u", stnc->sent[i].packets); + fprintf(f, "\n"); + + fprintf(f, " bytes "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12llu", stnc->sent[i].bytes); ++ fprintf(f, " %12llu", stnc->sent[i].bytes); + fprintf(f, "\n"); + + fprintf(f, " way_inds"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_indirect_hits[i]); ++ fprintf(f, " %12u", stnc->way_indirect_hits[i]); + fprintf(f, "\n"); + + fprintf(f, " way_miss"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_misses[i]); ++ fprintf(f, " %12u", stnc->way_misses[i]); + fprintf(f, "\n"); + + fprintf(f, " way_cols"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->way_collisions[i]); ++ fprintf(f, " %12u", stnc->way_collisions[i]); + fprintf(f, "\n"); + + fprintf(f, " drops "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->dropped[i].packets); ++ fprintf(f, " %12u", stnc->dropped[i].packets); + fprintf(f, "\n"); + + fprintf(f, " marks "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->ecn_marked[i].packets); ++ fprintf(f, " %12u", stnc->ecn_marked[i].packets); + fprintf(f, "\n"); + ++ if(stnc->version >= 5) { ++ fprintf(f, " ack_drop"); ++ for(i=0; i < stnc->tin_cnt; i++) ++ fprintf(f, " %12u", stnc->ack_drops[i].packets); ++ fprintf(f, "\n"); ++ } ++ + fprintf(f, " sp_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->sparse_flows[i]); ++ fprintf(f, " %12u", stnc->sparse_flows[i]); + fprintf(f, "\n"); + + fprintf(f, " bk_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->bulk_flows[i]); ++ fprintf(f, " %12u", stnc->bulk_flows[i]); + fprintf(f, "\n"); + + if(stnc->version >= 4) { + fprintf(f, " un_flows"); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->unresponse_flows[i]); ++ fprintf(f, " %12u", stnc->unresponse_flows[i]); + fprintf(f, "\n"); + } + + fprintf(f, " max_len "); + for(i=0; i < stnc->tin_cnt; i++) -+ fprintf(f, "%12u", stnc->max_skblen[i]); ++ fprintf(f, " %12u", stnc->max_skblen[i]); + fprintf(f, "\n"); + } else { + return -1; diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 66a987405..55b7c493d 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset -PKG_VERSION:=6.32 -PKG_RELEASE:=2 +PKG_VERSION:=6.34 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org -PKG_HASH:=d9cbb49a4ae9e32d7808a604f1a37f359f9fc9064c210c4c5f35d629d49fb9fe +PKG_HASH:=d70e831b670b7aa25dde81fd994d3a7ce0c0e801559a557105576df66cd8d680 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch new file mode 100644 index 000000000..745e9fa3b --- /dev/null +++ b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch @@ -0,0 +1,25 @@ +From a4212bf911026740afc7fce98d9100e2ef5dcea0 Mon Sep 17 00:00:00 2001 +From: Jozsef Kadlecsik +Date: Tue, 26 Sep 2017 07:00:13 +0200 +Subject: [PATCH] Replace the last reference to u_int8_t with uint8_t. + +--- + src/ipset.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ipset.c b/src/ipset.c +index 79f56b8..df0778a 100644 +--- a/src/ipset.c ++++ b/src/ipset.c +@@ -282,7 +282,7 @@ call_parser(int *argc, char *argv[], const struct ipset_type *type, + const struct ipset_arg *arg; + const char *optstr; + const struct ipset_type *t = type; +- u_int8_t revision = type->revision; ++ uint8_t revision = type->revision; + int ret = 0, i = 1; + + /* Currently CREATE and ADT may have got additional arguments */ +-- +2.13.5 + diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index 89f4354d0..e09c35c69 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -22,6 +22,7 @@ PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables include $(INCLUDE_DIR)/package.mk ifeq ($(DUMP),) @@ -216,6 +217,20 @@ define Package/iptables-mod-nflog/description endef +define Package/iptables-mod-trace +$(call Package/iptables/Module, +kmod-ipt-debug +kmod-ipt-raw) + TITLE:=Netfilter TRACE target +endef + +define Package/iptables-mod-trace/description + iptables extension for TRACE target + + Includes: + - libxt_TRACE + +endef + + define Package/iptables-mod-nfqueue $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue) TITLE:=Netfilter NFQUEUE target @@ -381,6 +396,15 @@ U32 iptables extensions. endef +define Package/iptables-mod-checksum +$(call Package/iptables/Module, +kmod-ipt-checksum) + TITLE:=IP CHECKSUM target extension +endef + +define Package/iptables-mod-checksum/description +iptables extension for the CHECKSUM calculation target +endef + define Package/ip6tables $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables @@ -584,7 +608,9 @@ $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m))) $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m))) $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) +$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) +$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) $(eval $(call BuildPackage,ip6tables)) $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) diff --git a/package/network/utils/iptables/patches/600-shared-libext.patch b/package/network/utils/iptables/patches/600-shared-libext.patch index 6704af501..a906d4060 100644 --- a/package/network/utils/iptables/patches/600-shared-libext.patch +++ b/package/network/utils/iptables/patches/600-shared-libext.patch @@ -82,3 +82,23 @@ endif xtables_multi_SOURCES += xshared.c xtables_multi_LDADD += ../libxtables/libxtables.la -lm +@@ -32,7 +35,8 @@ if ENABLE_NFTABLES + BUILT_SOURCES += xtables-config-parser.h + xtables_compat_multi_SOURCES = xtables-compat-multi.c iptables-xml.c + xtables_compat_multi_CFLAGS = ${AM_CFLAGS} +-xtables_compat_multi_LDADD = ../extensions/libext.a ../extensions/libext_ebt.a ++xtables_compat_multi_LDADD = ++xtables_compat_multi_LDFLAGS = -L../extensions/ -liptext -liptext_ebt + if ENABLE_STATIC + xtables_compat_multi_CFLAGS += -DALL_INCLUSIVE + endif +@@ -45,7 +49,8 @@ xtables_compat_multi_SOURCES += xtables- + getethertype.c nft-bridge.c \ + xtables-eb-standalone.c xtables-eb.c \ + xtables-translate.c +-xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a ++xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ++xtables_compat_multi_LDFLAGS += -liptext4 -liptext6 -liptext_arpt + # yacc and lex generate dirty code + xtables_compat_multi-xtables-config-parser.o xtables_compat_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls + xtables_compat_multi_SOURCES += xshared.c diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile index b6799e68b..344af07af 100644 --- a/package/network/utils/iputils/Makefile +++ b/package/network/utils/iputils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=fd3af46c80ebb99607c2ca1f2a3608b6fe828e25bbec6e54f2afd25f6ddb6ee7 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:skbuff:iputils PKG_BUILD_DEPENDS:=sysfsutils PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index a578ddc98..9b3c12bec 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -30,8 +30,7 @@ endef define Build/Configure echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c - rm -f $(PKG_BUILD_DIR)/version.sh - touch $(PKG_BUILD_DIR)/version.sh + echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh chmod +x $(PKG_BUILD_DIR)/version.sh endef diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index a42aa13ee..1b8a3ad2b 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -13,6 +13,7 @@ PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git PKG_SOURCE_DATE:=2017-08-23 PKG_SOURCE_VERSION:=c1a03e8231a5d8b348b70a182d256725c98a3b0b +PKG_MIRROR_HASH:=7bd294f50f8ec8c0497c5fbe5527f3ae098814cdfeecf4ccf78a2a8937611664 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile new file mode 100644 index 000000000..988bc8075 --- /dev/null +++ b/package/network/utils/layerscape/restool/Makefile @@ -0,0 +1,38 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=restool +PKG_SOURCE_DATE:=2017-10-23 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/restool.git +PKG_SOURCE_VERSION:=8f08b9d499e84f9057784c2036f0ddf75ae3fc70 +PKG_MIRROR_HASH:=29f70ad27c7ab20bc018f0d0b11c680fcf8b829d10e5af5c30af4a3f9228a2fc + +include $(INCLUDE_DIR)/package.mk + +define Package/restool + SECTION:=net + CATEGORY:=Network + DEPENDS:=@TARGET_layerscape + TITLE:=Layerscape DPAA2 dynamical management tool +endef + +MAKE_FLAGS += \ + DESTDIR="$(PKG_BUILD_DIR)"/output/ \ + install + +define Package/restool/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/output/usr/local/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,restool)) diff --git a/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch new file mode 100644 index 000000000..691e3bba5 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch @@ -0,0 +1,35 @@ +From 978f00c0a9f17de9cf17b205a741222084261d3a Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:17 +0000 +Subject: [PATCH 01/12] scripts: move shebang on the first line + +If the shebang is not placed on the first line of the shell script +it will be accounted only as a comment. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 588c736..09bef5a 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,3 +1,5 @@ ++#!/bin/bash ++ + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP + +@@ -30,8 +32,6 @@ + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + +-#!/bin/bash +- + ## Restool wrapper script + # + # Prerequisites: +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch new file mode 100644 index 000000000..0e39ef724 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch @@ -0,0 +1,151 @@ +From 6039bd1b7e5e71a0a171406cf980d2d61a6e79d4 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:37 +0000 +Subject: [PATCH 02/12] dprc: add --full-path option to dprc list command + +Instead of printing an indented dprc list, activating +the --full-path option restool will print the entire path +of the dprc. +Example: + +root@rodos:~# restool dprc list --full-path +dprc.1 +dprc.1/dprc.3 +dprc.1/dprc.2 +dprc.1/dprc.2/dprc.4 + +Signed-off-by: Ioana Ciornei +--- + dprc_commands.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 50 insertions(+), 11 deletions(-) + +diff --git a/dprc_commands.c b/dprc_commands.c +index e1a8f16..8de2f0e 100644 +--- a/dprc_commands.c ++++ b/dprc_commands.c +@@ -76,13 +76,16 @@ C_ASSERT(ARRAY_SIZE(dprc_sync_options) <= MAX_NUM_CMD_LINE_OPTIONS + 1); + */ + enum dprc_list_options { + LIST_OPT_HELP = 0, ++ LIST_OPT_FULL_PATH, + }; + + static struct option dprc_list_options[] = { + [LIST_OPT_HELP] = { + .name = "help", + }, +- ++ [LIST_OPT_FULL_PATH] = { ++ .name = "full-path", ++ }, + { 0 }, + }; + +@@ -421,17 +424,33 @@ static int cmd_dprc_sync(void) + * Lists nested DPRCs inside a given DPRC, recursively + */ + static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, +- int nesting_level, bool show_non_dprc_objects) ++ int nesting_level, bool show_non_dprc_objects, ++ char *full_path) + { ++ char *updated_full_path = NULL; + int num_child_devices; + int error = 0; ++ int full_path_len; + + assert(nesting_level <= MAX_DPRC_NESTING); + +- for (int i = 0; i < nesting_level; i++) +- printf(" "); +- +- printf("dprc.%u\n", dprc_id); ++ if (full_path) { ++ full_path_len = strlen(full_path); ++ updated_full_path = malloc(full_path_len + 10); ++ if (!updated_full_path) { ++ ERROR_PRINTF("Could not alloc memory for full-path!\n"); ++ return -ENOMEM; ++ } ++ if (full_path_len != 0) ++ sprintf(updated_full_path, "%s/dprc.%d", full_path, dprc_id); ++ else ++ sprintf(updated_full_path, "dprc.%d", dprc_id); ++ printf("%s\n", updated_full_path); ++ } else { ++ for (int i = 0; i < nesting_level; i++) ++ printf(" "); ++ printf("dprc.%u\n", dprc_id); ++ } + + error = dprc_get_obj_count(&restool.mc_io, 0, + dprc_handle, +@@ -475,8 +494,11 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + if (error < 0) + goto out; + +- error = list_dprc(obj_desc.id, child_dprc_handle, +- nesting_level + 1, show_non_dprc_objects); ++ error = list_dprc(obj_desc.id, ++ child_dprc_handle, ++ nesting_level + 1, ++ show_non_dprc_objects, ++ updated_full_path); + + error2 = dprc_close(&restool.mc_io, 0, child_dprc_handle); + if (error2 < 0) { +@@ -491,6 +513,9 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + } + + out: ++ if (full_path) ++ free(updated_full_path); ++ + return error; + } + +@@ -498,8 +523,14 @@ static int cmd_dprc_list(void) + { + static const char usage_msg[] = + "\n" +- "Usage: restool dprc list\n" ++ "Usage: restool dprc list [OPTIONS]\n" ++ "\n" ++ "OPTIONS:\n" ++ "--full-path\n" ++ " prints the dprc list in a full-path\n" ++ " format like: dprc.1/dprc.2\n" + "\n"; ++ bool full_path = false; + + if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_HELP)) { + puts(usage_msg); +@@ -507,6 +538,12 @@ static int cmd_dprc_list(void) + return 0; + } + ++ ++ if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_FULL_PATH)) { ++ restool.cmd_option_mask &= ~ONE_BIT_MASK(LIST_OPT_FULL_PATH); ++ full_path = true; ++ } ++ + if (restool.obj_name != NULL) { + ERROR_PRINTF( + "Unexpected argument: \'%s\'\n\n", restool.obj_name); +@@ -514,8 +551,10 @@ static int cmd_dprc_list(void) + return -EINVAL; + } + +- return list_dprc( +- restool.root_dprc_id, restool.root_dprc_handle, 0, false); ++ return list_dprc(restool.root_dprc_id, ++ restool.root_dprc_handle, ++ 0, false, ++ full_path ? "" : NULL); + } + + static int show_one_resource_type(uint16_t dprc_handle, +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch new file mode 100644 index 000000000..c846fbab5 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch @@ -0,0 +1,62 @@ +From e316b4c7d421afa6ca5f6b6ae86d0a8219a9bd56 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:42 +0000 +Subject: [PATCH 03/12] scripts: remove unnecessary arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 09bef5a..ea0df92 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -87,8 +87,6 @@ root_c= + # Type of endpoint object + toe= + +-dpnis=() +-dpmacs=() + containers=() + # Full path containers + fpc=() +@@ -944,16 +942,8 @@ process_listni() { + fi + fi + +- dpnis+=("$dpni $details") ++ echo "${i}/${dpni} ${details}" + done +- +- if [ -n "$dpnis" ]; then +- for j in "${dpnis[@]}"; do +- echo "$i/$j" +- done +- +- dpnis=() +- fi + done + } + +@@ -984,16 +974,8 @@ process_listmac() { + fi + fi + +- dpmacs+=("$dpmac $details") ++ echo "${i}/${dpmac} ${details}" + done +- +- if [ -n "$dpmacs" ]; then +- for j in "${dpmacs[@]}"; do +- echo "$i/$j" +- done +- +- dpmacs=() +- fi + done + } + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch new file mode 100644 index 000000000..e1cc38f48 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch @@ -0,0 +1,111 @@ +From 09f840049d155fa4b681ece749feeff9a269ecde Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:45 +0000 +Subject: [PATCH 04/12] scripts: use restool --full-path option + +Instead of constructing the the full path container list by +hand use the restool option newly added. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 54 +++++++----------------------------------------------- + 1 file changed, 7 insertions(+), 47 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index ea0df92..72f6c77 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -73,7 +73,6 @@ + ## + + shopt -s extglob +-shopt -s lastpipe + + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT +@@ -87,11 +86,6 @@ root_c= + # Type of endpoint object + toe= + +-containers=() +-# Full path containers +-fpc=() +-idx=0 +- + SYS_DPRC="/sys/bus/fsl-mc/drivers/fsl_mc_dprc" + + set -e +@@ -220,42 +214,6 @@ get_container() { + echo $(echo "$i" | sed "s/\(dprc.[0-9]*\/\)*//g") + } + +-build_fpc_list() { +- $restool dprc list | +- while IFS= read -r line +- do +- containers+=("$line") +- done +- +- for i in "${containers[@]}" +- do +- cnt=$(count_spaces "$i") +- +- if [ "$cnt" -gt 0 ]; then +- # Get index of the upper level container +- idx2=$((idx-1)) +- crt_ct="$i" +- +- while [ "$idx2" -ge 0 ] +- do +- cntp=$(count_spaces "${containers[idx2]}") +- +- if [ "$cntp" -lt "$cnt" ]; then +- upc=$(echo "${containers[idx2]}" | sed "s/ *$//") +- crt_ct=$upc"/""$(echo $crt_ct | sed 's/ *$//')" +- fi +- idx2=$((idx2-1)) +- done +- +- fpc+=($crt_ct) +- else +- fpc+=("$i") +- fi +- +- idx=$((idx+1)) +- done +-} +- + get_label() { + # Retrieve the type of the object + too=$(echo "$1" | sed "s/\(\.[0-9]*\)\(\.[0-9]*\)*$//g") +@@ -897,9 +855,9 @@ process_addni() { + } + + process_listni() { +- build_fpc_list +- +- for i in "${fpc[@]}" ++ dprc_list="$($restool dprc list --full-path)" ++ echo "${dprc_list}" | ++ while read -r i + do + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpni | +@@ -948,10 +906,12 @@ process_listni() { + } + + process_listmac() { +- build_fpc_list ++ dprc_list="$($restool dprc list --full-path)" + +- for i in "${fpc[@]}" ++ echo "${dprc_list}" | ++ while read -r i + do ++ + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpmac | + while IFS= read -r line +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch new file mode 100644 index 000000000..b34c6a31a --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch @@ -0,0 +1,26 @@ +From 899d6c74286cbc672e1bad1abd7eff15b1b7298d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:49 +0000 +Subject: [PATCH 05/12] scripts: use proper arithmetic operation syntax + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 72f6c77..a39df2c 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -966,7 +966,7 @@ fi + + # Check compatibility with MC version + mc_major=$($restool --mc-version | cut -f2 -d':' | cut -f1 -d'.' | tr -d ' ') +-if (( $mc_major != 10 )); then ++if [ $mc_major != 10 ]; then + echo "Restool wrapper scripts only support the latest major MC version\n" + echo "that currently is MC10.x. Use with caution." + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch new file mode 100644 index 000000000..a1217668f --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch @@ -0,0 +1,79 @@ +From 2127850302de2bd8dccff0e31415ce0218750773 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:53 +0000 +Subject: [PATCH 06/12] scripts: use strings instead of arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a39df2c..b0c742e 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -485,7 +485,9 @@ create_dpsw() { + + # Make a link in case there is an end point specified + index=0 +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + connect $root_c "$dpsw.$index" "$i" + index=$((index + 1)) + done +@@ -519,8 +521,8 @@ process_addsw() { + max_fdb_mc_groups=32 + # dpsw object label + label= +- #Endpoint objects provided as argument +- endpoint=() ++ # Endpoint objects provided as argument ++ endpoint= + ifcnt=0 + container=$root_c + +@@ -559,7 +561,7 @@ process_addsw() { + container="${i#*=}" + ;; + @(dpni|dpmac).+([0-9])) +- endpoint[$ifcnt]="$(echo ${i#*=} | tr -d ,)" ++ endpoint="${endpoint}"$'\n'"${i}" + ifcnt=$((ifcnt + 1)) + ;; + *) +@@ -571,14 +573,19 @@ process_addsw() { + done + + # Check if there are more endpoints provided than the number of the interfaces +- if [ $num_ifs -lt ${#endpoint[@]} ]; then ++ if [ $num_ifs -lt $ifcnt ]; then + echo "Error: there are more endpoints provided than the number of the interfaces" + usage_addsw + exit 1 + fi + ++ # Delete first empty line from the endpoint string ++ endpoint="$(echo "${endpoint}" | tail -n +2)" ++ + # Check if the endpoints are valid +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + type_of_endpoint "$i" + check_endpoint "$i" + has_endpoint "$i" +@@ -592,7 +599,7 @@ process_addsw() { + if (( $object_exists_status == 1 )); then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + +- if [ $num_ifs -gt ${#endpoint[@]} ]; then ++ if [ $num_ifs -gt $ifcnt ]; then + echo "Do not forget to connect devices to interface(s)." + fi + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch new file mode 100644 index 000000000..ed9d76d45 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch @@ -0,0 +1,126 @@ +From e1036011baf9204d5fe6dd74e5a65f95b9681ebd Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:56 +0000 +Subject: [PATCH 07/12] scripts: use Bourne shell's pattern matching + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 71 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 35 insertions(+), 36 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index b0c742e..a8b9573 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -72,8 +72,6 @@ + # + ## + +-shopt -s extglob +- + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT + +@@ -370,15 +368,16 @@ process_addmux() { + -c=* | --container=*) + container="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- endpoint="${i#*=}" +- ;; + *) +- usage_addmux +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ usage_addmux ++ exit 1 ++ fi + ;; + esac + done +@@ -560,14 +559,17 @@ process_addsw() { + -c=* | --container=*) + container="${i#*=}" + ;; +- @(dpni|dpmac).+([0-9])) +- endpoint="${endpoint}"$'\n'"${i}" +- ifcnt=$((ifcnt + 1)) +- ;; + *) +- echo "Error: $i argument is invalid" +- usage_addsw +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ echo "Error: $i argument is invalid" ++ usage_addsw ++ exit 1 ++ fi + ;; + esac + done +@@ -704,7 +706,8 @@ process_addni() { + ;; + --mac-addr=*) + mac_addr="${i#*=}" +- if [[ ! "$mac_addr" =~ ^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$ ]]; then ++ mac_addr_valid="$(echo $mac_addr | grep -x -E "^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$" || true )" ++ if [ "$mac_addr" != "$mac_addr_valid" ]; then + echo "Invalid MAC address: $mac_addr" + exit 1 + fi +@@ -776,25 +779,21 @@ process_addni() { + -o=* | --options=*) + options="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpdmux.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpsw.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; + *) +- usage_addni +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ arg_dpdmux="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpdmux.[0-9]+.[0-9]+" || true )" ++ arg_dpsw="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpsw.[0-9]+.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ] || ++ [ "$i" = "$arg_dpdmux" ] || ++ [ "$i" = "$arg_dpsw" ]; then ++ no_link=0 ++ endpoint="$i" ++ else ++ usage_addni ++ exit 1 ++ fi + ;; + esac + done +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch new file mode 100644 index 000000000..4921f63c9 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch @@ -0,0 +1,32 @@ +From 4a1df345edc59a7407b955529955d6799d974b70 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:30:00 +0000 +Subject: [PATCH 08/12] scripts: use Bourne shell instead of bash + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a8b9573..bd79295 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP +@@ -37,7 +37,7 @@ + # Prerequisites: + # - Management Complex version 10.x + # - restool version 1.4 or newer +-# - bash shell ++# - Bourne Shell (sh) + # + # + # The purpose of this script is to offer a user friendly way to create +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch new file mode 100644 index 000000000..c642afcaf --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch @@ -0,0 +1,36 @@ +From ac387de9688099bca1fbdb587d078b369aaf2dab Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:23:42 +0000 +Subject: [PATCH 09/12] scripts: workaround for a improper sed substitution + (TODO) + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index bd79295..7ce73f0 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -197,7 +197,7 @@ has_endpoint() { + ep=$($restool "$toe" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$ep" != *"No object associated"* && "$ep" != *"none"* ]]; then ++ if [[ "$ep" != "endpoint: No object associated" && "$ep" != *"none"* ]]; then + echo "$1 is already linked to $ep" + exit 1 + fi +@@ -230,7 +230,7 @@ get_endpoint() { + end_point=$($restool "$too" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$end_point" != *"No object associated"* && "$end_point" != *"none"* ]]; then ++ if [[ "$end_point" != "endpoint: No object associated" && "$end_point" != *"none"* ]]; then + echo "$end_point" + fi + } +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch new file mode 100644 index 000000000..9945cd438 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch @@ -0,0 +1,44 @@ +From 66ae6e5313da8be5742a502c0d7027689e84a17d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:08 +0000 +Subject: [PATCH 10/12] scripts: use proper arithmetic operations + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 7ce73f0..0dcd2fa 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -409,7 +409,7 @@ process_addmux() { + + # check the status + object_exists $container $dpdmux +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + + if [ "$root_c" == "$container" ]; then + evb=$(ls $SYS_DPRC/"$root_c"/"$dpdmux"/net/ | grep -v "p") +@@ -598,7 +598,7 @@ process_addsw() { + + # check the status + object_exists $container $dpsw +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + + if [ $num_ifs -gt $ifcnt ]; then +@@ -850,7 +850,7 @@ process_addni() { + + # check the status + object_exists $container $dpni +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + if [ "$root_c" == "$container" ]; then + ni=$(ls $SYS_DPRC/"$root_c"/"$dpni"/net/) + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch new file mode 100644 index 000000000..1b6cc46a3 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch @@ -0,0 +1,27 @@ +From 6af86a65f2dcfd42f572e04207eef45da3573b92 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:33 +0000 +Subject: [PATCH 11/12] scripts: do not compare strings with regexp expressions + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 0dcd2fa..526c052 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -805,7 +805,8 @@ process_addni() { + fi + + # if no --num-queues is specified then set it to number of cores +- if [[ $dpni_args != *"--num-queues"* ]]; then ++ num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) ++ if [[ -z "$num_queues_present" ]]; then + dpni_args=$dpni_args" --num-queues="$(nproc) + fi + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch new file mode 100644 index 000000000..3acb3b5d8 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch @@ -0,0 +1,27 @@ +From 0e5f9f0a7f0ef1947984cd82ade9dbc14ba2c80d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 12:48:04 +0000 +Subject: [PATCH 12/12] scripts: replace 'nproc' with cross-platform + implementation + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 526c052..7d127f6 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -807,7 +807,7 @@ process_addni() { + # if no --num-queues is specified then set it to number of cores + num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) + if [[ -z "$num_queues_present" ]]; then +- dpni_args=$dpni_args" --num-queues="$(nproc) ++ dpni_args=$dpni_args" --num-queues="$(grep -c ^processor /proc/cpuinfo) + fi + + # Check if --no-link the endpoint have been provided otherwise display the usage +-- +2.14.1 + diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index 3d3662264..532a02821 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -19,6 +19,7 @@ PKG_HASH:=9645481a2b16476b59220aa2d6bc5bc41043f291326c9b37581018fbd16dd53a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index b45440367..5aaa1cbf4 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -10,10 +10,10 @@ PKG_NAME:=nftables PKG_VERSION:=0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/nftables +PKG_SOURCE_URL:=https://git.netfilter.org/nftables PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7 -PKG_MIRROR_HASH:=6b06a114c5a1b397b0ae616d5d292859611b0eb05b647182b3c00421909338b8 +PKG_MIRROR_HASH:=2c0af691948519556952097673ad1b57f888c8314b8eb15e83066951de01fc82 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 92e08d58c..50919819b 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -21,6 +21,7 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 @@ -76,7 +77,6 @@ endif MAKE_FLAGS += \ CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)" - define Package/tcpdump/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/tcpdump $(1)/usr/sbin/ diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 35de6c5ad..9c953ea69 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -65,11 +65,12 @@ proto_qmi_setup() { [ -n "$delay" ] && sleep "$delay" while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 1; done [ -n "$pincode" ] && { - uqmi -s -d "$device" --verify-pin1 "$pincode" || { + uqmi -s -d "$device" --verify-pin1 "$pincode" || uqmi -s -d "$device" --uim-verify-pin1 "$pincode" || { echo "Unable to verify PIN" proto_notify_error "$interface" PIN_FAILED proto_block_restart "$interface" @@ -102,6 +103,7 @@ proto_qmi_setup() { echo "Waiting for network registration" while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 5; done @@ -109,7 +111,7 @@ proto_qmi_setup() { echo "Starting network $interface" - pdptype=`echo "$pdptype" | awk '{print tolower($0)}'` + pdptype=$(echo "$pdptype" | awk '{print tolower($0)}') [ "$pdptype" = "ip" -o "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] || pdptype="ip" if [ "$pdptype" = "ip" ]; then @@ -120,7 +122,7 @@ proto_qmi_setup() { fi [ "$pdptype" = "ip" -o "$pdptype" = "ipv4v6" ] && { - cid_4=`uqmi -s -d "$device" --get-client-id wds` + cid_4=$(uqmi -s -d "$device" --get-client-id wds) [ $? -ne 0 ] && { echo "Unable to obtain client ID" proto_notify_error "$interface" NO_CID @@ -134,14 +136,14 @@ proto_qmi_setup() { --stop-network 0xffffffff \ --autoconnect > /dev/null - pdh_4=`uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ + pdh_4=$(uqmi -s -d "$device" --set-client-id wds,"$cid_4" \ --start-network \ ${apn:+--apn $apn} \ ${profile:+--profile $profile} \ ${auth:+--auth-type $auth} \ ${username:+--username $username} \ ${password:+--password $password} \ - ${autoconnect:+--autoconnect}` + ${autoconnect:+--autoconnect}) [ $? -ne 0 ] && { echo "Unable to connect IPv4" uqmi -s -d "$device" --set-client-id wds,"$cid_4" --release-client-id wds @@ -151,7 +153,7 @@ proto_qmi_setup() { } [ "$pdptype" = "ipv6" -o "$pdptype" = "ipv4v6" ] && { - cid_6=`uqmi -s -d "$device" --get-client-id wds` + cid_6=$(uqmi -s -d "$device" --get-client-id wds) [ $? -ne 0 ] && { echo "Unable to obtain client ID" proto_notify_error "$interface" NO_CID @@ -165,14 +167,14 @@ proto_qmi_setup() { --stop-network 0xffffffff \ --autoconnect > /dev/null - pdh_6=`uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ + pdh_6=$(uqmi -s -d "$device" --set-client-id wds,"$cid_6" \ --start-network \ ${apn:+--apn $apn} \ ${profile:+--profile $profile} \ ${auth:+--auth-type $auth} \ ${username:+--username $username} \ ${password:+--password $password} \ - ${autoconnect:+--autoconnect}` + ${autoconnect:+--autoconnect}) [ $? -ne 0 ] && { echo "Unable to connect IPv6" uqmi -s -d "$device" --set-client-id wds,"$cid_6" --release-client-id wds diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index ff6537572..e57223dee 100644 --- a/package/network/utils/wpan-tools/Makefile +++ b/package/network/utils/wpan-tools/Makefile @@ -31,6 +31,7 @@ endef define Package/wpan-tools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iwpan $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpan-ping/wpan-ping $(1)/usr/sbin/ endef $(eval $(call BuildPackage,wpan-tools)) diff --git a/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch new file mode 100644 index 000000000..1370854b6 --- /dev/null +++ b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch @@ -0,0 +1,44 @@ +From bb522bd584f05e6658d5dba97f48ca018f46394c Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 6 May 2017 14:36:08 +0200 +Subject: [PATCH] src/nl_extras.h: fix compatibility with libnl 3.3.0 + +nl_extras.h defines a set of nla_set_s*() functions if not provided by +libnl. They are provided by libnl since version 3.2.26. The test +(LIBNL_VER_MIC <= 26) was working fine while libnl was in the 3.2.x +series, but now that they have incremented the minor version, the +micro version was reset to 0, with the latest libnl version being +3.3.0. + +Due to this, the condition (LIBNL_VER_MIC <= 26) is true, and we get +redefinition errors because nl_extras.h redefines functions already +provided by libnl. + +This commit improves the condition so that nl_extras.h provides the +missing functions only if the minor version is < 2, or if minor is 2 +and micro is < 26. + +Signed-off-by: Thomas Petazzoni +--- + src/nl_extras.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/nl_extras.h ++++ b/src/nl_extras.h +@@ -1,7 +1,7 @@ + #ifndef __NL_EXTRAS_H + #define __NL_EXTRAS_H + +-#if LIBNL_VER_MIC <= 26 ++#if (LIBNL_VER_MIN < 2) || (LIBNL_VER_MIN == 2) && (LIBNL_VER_MIC <= 26) + + #ifndef NLA_S8 + +@@ -45,6 +45,6 @@ static inline int32_t nla_get_s32(struct + + #endif /* NLA_S64 */ + +-#endif /* LIBNL_VER_MIC */ ++#endif /* LIBNL_VER_* */ + + #endif /* __NL_EXTRAS_H */ diff --git a/package/network/utils/wwan/files/data/0421-03a7 b/package/network/utils/wwan/files/data/0421-03a7 index 131340135..c2ce00824 100644 --- a/package/network/utils/wwan/files/data/0421-03a7 +++ b/package/network/utils/wwan/files/data/0421-03a7 @@ -1,6 +1,6 @@ { "desc": "Nokia C5-00 Mobile phone", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-060d b/package/network/utils/wwan/files/data/0421-060d index a9ad650d6..3ef6df4cc 100644 --- a/package/network/utils/wwan/files/data/0421-060d +++ b/package/network/utils/wwan/files/data/0421-060d @@ -1,6 +1,6 @@ { "desc": "Nokia CS-10", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-060e b/package/network/utils/wwan/files/data/0421-060e index a9ad650d6..3ef6df4cc 100644 --- a/package/network/utils/wwan/files/data/0421-060e +++ b/package/network/utils/wwan/files/data/0421-060e @@ -1,6 +1,6 @@ { "desc": "Nokia CS-10", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0612 b/package/network/utils/wwan/files/data/0421-0612 index bc3e780ba..d219e7a65 100644 --- a/package/network/utils/wwan/files/data/0421-0612 +++ b/package/network/utils/wwan/files/data/0421-0612 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-15/CS-18", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0619 b/package/network/utils/wwan/files/data/0421-0619 index 52fbf5841..e61bb093b 100644 --- a/package/network/utils/wwan/files/data/0421-0619 +++ b/package/network/utils/wwan/files/data/0421-0619 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-12", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-061e b/package/network/utils/wwan/files/data/0421-061e index c1cb9f44d..41c8afae4 100644 --- a/package/network/utils/wwan/files/data/0421-061e +++ b/package/network/utils/wwan/files/data/0421-061e @@ -1,6 +1,6 @@ { "desc": "Nokia CS-11", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0623 b/package/network/utils/wwan/files/data/0421-0623 index f6674bac6..14c2530f3 100644 --- a/package/network/utils/wwan/files/data/0421-0623 +++ b/package/network/utils/wwan/files/data/0421-0623 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-17", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0629 b/package/network/utils/wwan/files/data/0421-0629 index b637c344b..0feb718ba 100644 --- a/package/network/utils/wwan/files/data/0421-0629 +++ b/package/network/utils/wwan/files/data/0421-0629 @@ -1,6 +1,6 @@ { "desc": "Nokia CS-18", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-062d b/package/network/utils/wwan/files/data/0421-062d index a95192b8e..e90158990 100644 --- a/package/network/utils/wwan/files/data/0421-062d +++ b/package/network/utils/wwan/files/data/0421-062d @@ -1,6 +1,6 @@ { "desc": "Nokia CS-19", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-062f b/package/network/utils/wwan/files/data/0421-062f index a95192b8e..e90158990 100644 --- a/package/network/utils/wwan/files/data/0421-062f +++ b/package/network/utils/wwan/files/data/0421-062f @@ -1,6 +1,6 @@ { "desc": "Nokia CS-19", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0421-0638 b/package/network/utils/wwan/files/data/0421-0638 index 5fa7d4983..42ec6fe6a 100644 --- a/package/network/utils/wwan/files/data/0421-0638 +++ b/package/network/utils/wwan/files/data/0421-0638 @@ -1,6 +1,6 @@ { "desc": "Nokia 21M-02", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-0016 b/package/network/utils/wwan/files/data/05c6-0016 index 1a4a796b7..b623ebff6 100644 --- a/package/network/utils/wwan/files/data/05c6-0016 +++ b/package/network/utils/wwan/files/data/05c6-0016 @@ -1,6 +1,6 @@ { "desc": "iBall 3.5G Connect", "control": 2, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-0023 b/package/network/utils/wwan/files/data/05c6-0023 index ce288ed48..a01dea80d 100644 --- a/package/network/utils/wwan/files/data/05c6-0023 +++ b/package/network/utils/wwan/files/data/05c6-0023 @@ -2,4 +2,4 @@ "desc": "Leoxsys LN-72V", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/05c6-00a0 b/package/network/utils/wwan/files/data/05c6-00a0 index 0b9616025..33972528a 100644 --- a/package/network/utils/wwan/files/data/05c6-00a0 +++ b/package/network/utils/wwan/files/data/05c6-00a0 @@ -1,6 +1,6 @@ { "desc": "Axesstel MV241", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/05c6-6000 b/package/network/utils/wwan/files/data/05c6-6000 index e8863b9e1..217038fe8 100644 --- a/package/network/utils/wwan/files/data/05c6-6000 +++ b/package/network/utils/wwan/files/data/05c6-6000 @@ -2,4 +2,4 @@ "desc": "Siemens SG75", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/05c6-9000 b/package/network/utils/wwan/files/data/05c6-9000 index 6a72f4ff9..17cc41d4f 100644 --- a/package/network/utils/wwan/files/data/05c6-9000 +++ b/package/network/utils/wwan/files/data/05c6-9000 @@ -2,4 +2,4 @@ "desc": "Generic Qualcomm", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-3e01 b/package/network/utils/wwan/files/data/07d1-3e01 index b1da17700..89447058d 100644 --- a/package/network/utils/wwan/files/data/07d1-3e01 +++ b/package/network/utils/wwan/files/data/07d1-3e01 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-152", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-3e02 b/package/network/utils/wwan/files/data/07d1-3e02 index cd1eceed9..be0a89333 100644 --- a/package/network/utils/wwan/files/data/07d1-3e02 +++ b/package/network/utils/wwan/files/data/07d1-3e02 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/07d1-7e11 b/package/network/utils/wwan/files/data/07d1-7e11 index 84705b751..3da9895e5 100644 --- a/package/network/utils/wwan/files/data/07d1-7e11 +++ b/package/network/utils/wwan/files/data/07d1-7e11 @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-156", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/0af0-6901 b/package/network/utils/wwan/files/data/0af0-6901 index 06b26643d..a88c36dda 100644 --- a/package/network/utils/wwan/files/data/0af0-6901 +++ b/package/network/utils/wwan/files/data/0af0-6901 @@ -2,4 +2,4 @@ "desc": "Option GI0201", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0af0-7201 b/package/network/utils/wwan/files/data/0af0-7201 index 20b18b76c..fc84354c4 100644 --- a/package/network/utils/wwan/files/data/0af0-7201 +++ b/package/network/utils/wwan/files/data/0af0-7201 @@ -2,4 +2,4 @@ "desc": "Option GTM380", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0af0-9200 b/package/network/utils/wwan/files/data/0af0-9200 index 7e55a3661..8230dd025 100644 --- a/package/network/utils/wwan/files/data/0af0-9200 +++ b/package/network/utils/wwan/files/data/0af0-9200 @@ -2,4 +2,4 @@ "desc": "Option GTM671WFS", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/0b3c-c003 b/package/network/utils/wwan/files/data/0b3c-c003 index 5b4ea480e..77528b5be 100644 --- a/package/network/utils/wwan/files/data/0b3c-c003 +++ b/package/network/utils/wwan/files/data/0b3c-c003 @@ -2,4 +2,4 @@ "desc": "Olivetti Olicard 145", "control": 0, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/0bdb-1900 b/package/network/utils/wwan/files/data/0bdb-1900 index 84a9a9b7b..e7d72f121 100644 --- a/package/network/utils/wwan/files/data/0bdb-1900 +++ b/package/network/utils/wwan/files/data/0bdb-1900 @@ -1,6 +1,6 @@ { "desc": "Ericsson F3507g", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-1902 b/package/network/utils/wwan/files/data/0bdb-1902 index 84a9a9b7b..e7d72f121 100644 --- a/package/network/utils/wwan/files/data/0bdb-1902 +++ b/package/network/utils/wwan/files/data/0bdb-1902 @@ -1,6 +1,6 @@ { "desc": "Ericsson F3507g", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-190a b/package/network/utils/wwan/files/data/0bdb-190a index 2e826130b..e5b16e34a 100644 --- a/package/network/utils/wwan/files/data/0bdb-190a +++ b/package/network/utils/wwan/files/data/0bdb-190a @@ -1,6 +1,6 @@ { "desc": "Ericsson F3307", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-190d b/package/network/utils/wwan/files/data/0bdb-190d index 2f725eb72..126c09f1e 100644 --- a/package/network/utils/wwan/files/data/0bdb-190d +++ b/package/network/utils/wwan/files/data/0bdb-190d @@ -1,6 +1,6 @@ { "desc": "Ericsson F5521gw", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0bdb-1910 b/package/network/utils/wwan/files/data/0bdb-1910 index 2f725eb72..126c09f1e 100644 --- a/package/network/utils/wwan/files/data/0bdb-1910 +++ b/package/network/utils/wwan/files/data/0bdb-1910 @@ -1,6 +1,6 @@ { "desc": "Ericsson F5521gw", "control": 4, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/0c88-17da b/package/network/utils/wwan/files/data/0c88-17da index d5ca787a6..fcdf611cb 100644 --- a/package/network/utils/wwan/files/data/0c88-17da +++ b/package/network/utils/wwan/files/data/0c88-17da @@ -2,4 +2,4 @@ "desc": "Kyocera KPC650", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0c88-180a b/package/network/utils/wwan/files/data/0c88-180a index a2bee34e5..e0426423c 100644 --- a/package/network/utils/wwan/files/data/0c88-180a +++ b/package/network/utils/wwan/files/data/0c88-180a @@ -2,4 +2,4 @@ "desc": "Kyocera KPC680", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/0f3d-68aa b/package/network/utils/wwan/files/data/0f3d-68aa index 3a68c2064..dab35fa74 100644 --- a/package/network/utils/wwan/files/data/0f3d-68aa +++ b/package/network/utils/wwan/files/data/0f3d-68aa @@ -2,4 +2,4 @@ "desc": "Sierra Wireless AC313U/320U/330U Direct IP", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1004-6124 b/package/network/utils/wwan/files/data/1004-6124 index 471d8a5cf..b6da8c49b 100644 --- a/package/network/utils/wwan/files/data/1004-6124 +++ b/package/network/utils/wwan/files/data/1004-6124 @@ -1,6 +1,6 @@ { "desc": "LG L-05A", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-6141 b/package/network/utils/wwan/files/data/1004-6141 index 840dc64cf..142d70fd4 100644 --- a/package/network/utils/wwan/files/data/1004-6141 +++ b/package/network/utils/wwan/files/data/1004-6141 @@ -1,6 +1,6 @@ { "desc": "LG LUU-2100TI", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-6157 b/package/network/utils/wwan/files/data/1004-6157 index ec9495662..842c0b4bd 100644 --- a/package/network/utils/wwan/files/data/1004-6157 +++ b/package/network/utils/wwan/files/data/1004-6157 @@ -1,6 +1,6 @@ { "desc": "LG LUU-2110TI", "control": 0, - "data": 2 -} "acm": 1 + "data": 2, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1004-618f b/package/network/utils/wwan/files/data/1004-618f index df98b66be..bb4b53412 100644 --- a/package/network/utils/wwan/files/data/1004-618f +++ b/package/network/utils/wwan/files/data/1004-618f @@ -2,4 +2,4 @@ "desc": "LG L-02C", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/106c-3711 b/package/network/utils/wwan/files/data/106c-3711 index 4d22d4daa..0198c33ff 100644 --- a/package/network/utils/wwan/files/data/106c-3711 +++ b/package/network/utils/wwan/files/data/106c-3711 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-150", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3714 b/package/network/utils/wwan/files/data/106c-3714 index 5fa2a3a69..a735680ba 100644 --- a/package/network/utils/wwan/files/data/106c-3714 +++ b/package/network/utils/wwan/files/data/106c-3714 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-175", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3715 b/package/network/utils/wwan/files/data/106c-3715 index 8cbe23dad..5a5194d55 100644 --- a/package/network/utils/wwan/files/data/106c-3715 +++ b/package/network/utils/wwan/files/data/106c-3715 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-175AL", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3716 b/package/network/utils/wwan/files/data/106c-3716 index 18bd074f9..aa50f5d54 100644 --- a/package/network/utils/wwan/files/data/106c-3716 +++ b/package/network/utils/wwan/files/data/106c-3716 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-190", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/106c-3717 b/package/network/utils/wwan/files/data/106c-3717 index e028a4b41..fd80949d8 100644 --- a/package/network/utils/wwan/files/data/106c-3717 +++ b/package/network/utils/wwan/files/data/106c-3717 @@ -1,6 +1,6 @@ { "desc": "PANTECH UM-185C/UM185E", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1199-0017 b/package/network/utils/wwan/files/data/1199-0017 index a50654d7f..532aaddc1 100644 --- a/package/network/utils/wwan/files/data/1199-0017 +++ b/package/network/utils/wwan/files/data/1199-0017 @@ -2,4 +2,4 @@ "desc": "Sierra EM5625", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0018 b/package/network/utils/wwan/files/data/1199-0018 index 02d7494ae..71447d1b6 100644 --- a/package/network/utils/wwan/files/data/1199-0018 +++ b/package/network/utils/wwan/files/data/1199-0018 @@ -2,4 +2,4 @@ "desc": "Sierra MC5720", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0019 b/package/network/utils/wwan/files/data/1199-0019 index 4d6d4a9db..43ccfd09c 100644 --- a/package/network/utils/wwan/files/data/1199-0019 +++ b/package/network/utils/wwan/files/data/1199-0019 @@ -2,4 +2,4 @@ "desc": "Sierra AC595U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0020 b/package/network/utils/wwan/files/data/1199-0020 index 3482db4d6..d92732c66 100644 --- a/package/network/utils/wwan/files/data/1199-0020 +++ b/package/network/utils/wwan/files/data/1199-0020 @@ -2,4 +2,4 @@ "desc": "Sierra MC5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0021 b/package/network/utils/wwan/files/data/1199-0021 index 226c1b44d..d879a34dd 100644 --- a/package/network/utils/wwan/files/data/1199-0021 +++ b/package/network/utils/wwan/files/data/1199-0021 @@ -2,4 +2,4 @@ "desc": "Sierra AC597E", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0022 b/package/network/utils/wwan/files/data/1199-0022 index dd089a37e..b4780db9d 100644 --- a/package/network/utils/wwan/files/data/1199-0022 +++ b/package/network/utils/wwan/files/data/1199-0022 @@ -2,4 +2,4 @@ "desc": "Sierra EM5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0023 b/package/network/utils/wwan/files/data/1199-0023 index 9c7e72b9b..447f681a1 100644 --- a/package/network/utils/wwan/files/data/1199-0023 +++ b/package/network/utils/wwan/files/data/1199-0023 @@ -2,4 +2,4 @@ "desc": "Sierra AC597", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0024 b/package/network/utils/wwan/files/data/1199-0024 index 425d4cccd..9617b69fd 100644 --- a/package/network/utils/wwan/files/data/1199-0024 +++ b/package/network/utils/wwan/files/data/1199-0024 @@ -2,4 +2,4 @@ "desc": "Sierra MC5727 CDMA", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0025 b/package/network/utils/wwan/files/data/1199-0025 index 002d6fb18..f0792c8ed 100644 --- a/package/network/utils/wwan/files/data/1199-0025 +++ b/package/network/utils/wwan/files/data/1199-0025 @@ -2,4 +2,4 @@ "desc": "Sierra AC598", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0026 b/package/network/utils/wwan/files/data/1199-0026 index 13998dee9..ba1ea2a08 100644 --- a/package/network/utils/wwan/files/data/1199-0026 +++ b/package/network/utils/wwan/files/data/1199-0026 @@ -2,4 +2,4 @@ "desc": "Sierra T11", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0027 b/package/network/utils/wwan/files/data/1199-0027 index af4824c9c..b959eca4b 100644 --- a/package/network/utils/wwan/files/data/1199-0027 +++ b/package/network/utils/wwan/files/data/1199-0027 @@ -2,4 +2,4 @@ "desc": "Sierra AC402", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0028 b/package/network/utils/wwan/files/data/1199-0028 index 34c896e41..02967db89 100644 --- a/package/network/utils/wwan/files/data/1199-0028 +++ b/package/network/utils/wwan/files/data/1199-0028 @@ -2,4 +2,4 @@ "desc": "Sierra MC5728", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0112 b/package/network/utils/wwan/files/data/1199-0112 index 083baeea5..900923c7b 100644 --- a/package/network/utils/wwan/files/data/1199-0112 +++ b/package/network/utils/wwan/files/data/1199-0112 @@ -2,4 +2,4 @@ "desc": "Sierra CDMA 1xEVDO PC Card, AC580", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0120 b/package/network/utils/wwan/files/data/1199-0120 index 4d6d4a9db..43ccfd09c 100644 --- a/package/network/utils/wwan/files/data/1199-0120 +++ b/package/network/utils/wwan/files/data/1199-0120 @@ -2,4 +2,4 @@ "desc": "Sierra AC595U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0218 b/package/network/utils/wwan/files/data/1199-0218 index 02d7494ae..71447d1b6 100644 --- a/package/network/utils/wwan/files/data/1199-0218 +++ b/package/network/utils/wwan/files/data/1199-0218 @@ -2,4 +2,4 @@ "desc": "Sierra MC5720", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0220 b/package/network/utils/wwan/files/data/1199-0220 index 3482db4d6..d92732c66 100644 --- a/package/network/utils/wwan/files/data/1199-0220 +++ b/package/network/utils/wwan/files/data/1199-0220 @@ -2,4 +2,4 @@ "desc": "Sierra MC5725", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0224 b/package/network/utils/wwan/files/data/1199-0224 index a57e54a64..b5b13cc4b 100644 --- a/package/network/utils/wwan/files/data/1199-0224 +++ b/package/network/utils/wwan/files/data/1199-0224 @@ -2,4 +2,4 @@ "desc": "Sierra MC5727", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-0301 b/package/network/utils/wwan/files/data/1199-0301 index 13fd7da9f..2f3a6d00f 100644 --- a/package/network/utils/wwan/files/data/1199-0301 +++ b/package/network/utils/wwan/files/data/1199-0301 @@ -2,4 +2,4 @@ "desc": "Sierra AC250U", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6802 b/package/network/utils/wwan/files/data/1199-6802 index d9bd29f95..497aff248 100644 --- a/package/network/utils/wwan/files/data/1199-6802 +++ b/package/network/utils/wwan/files/data/1199-6802 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6803 b/package/network/utils/wwan/files/data/1199-6803 index c694fa3e1..0e3ebbb20 100644 --- a/package/network/utils/wwan/files/data/1199-6803 +++ b/package/network/utils/wwan/files/data/1199-6803 @@ -2,4 +2,4 @@ "desc": "Sierra MC8765", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6804 b/package/network/utils/wwan/files/data/1199-6804 index d9bd29f95..497aff248 100644 --- a/package/network/utils/wwan/files/data/1199-6804 +++ b/package/network/utils/wwan/files/data/1199-6804 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6805 b/package/network/utils/wwan/files/data/1199-6805 index c694fa3e1..0e3ebbb20 100644 --- a/package/network/utils/wwan/files/data/1199-6805 +++ b/package/network/utils/wwan/files/data/1199-6805 @@ -2,4 +2,4 @@ "desc": "Sierra MC8765", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6808 b/package/network/utils/wwan/files/data/1199-6808 index d9bd29f95..497aff248 100644 --- a/package/network/utils/wwan/files/data/1199-6808 +++ b/package/network/utils/wwan/files/data/1199-6808 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6809 b/package/network/utils/wwan/files/data/1199-6809 index d9bd29f95..497aff248 100644 --- a/package/network/utils/wwan/files/data/1199-6809 +++ b/package/network/utils/wwan/files/data/1199-6809 @@ -2,4 +2,4 @@ "desc": "Sierra MC8755", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6813 b/package/network/utils/wwan/files/data/1199-6813 index f10c10449..4e667e76a 100644 --- a/package/network/utils/wwan/files/data/1199-6813 +++ b/package/network/utils/wwan/files/data/1199-6813 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6815 b/package/network/utils/wwan/files/data/1199-6815 index f10c10449..4e667e76a 100644 --- a/package/network/utils/wwan/files/data/1199-6815 +++ b/package/network/utils/wwan/files/data/1199-6815 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6816 b/package/network/utils/wwan/files/data/1199-6816 index f10c10449..4e667e76a 100644 --- a/package/network/utils/wwan/files/data/1199-6816 +++ b/package/network/utils/wwan/files/data/1199-6816 @@ -2,4 +2,4 @@ "desc": "Sierra MC8775", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6820 b/package/network/utils/wwan/files/data/1199-6820 index ce52c8f2a..be1a6596e 100644 --- a/package/network/utils/wwan/files/data/1199-6820 +++ b/package/network/utils/wwan/files/data/1199-6820 @@ -2,4 +2,4 @@ "desc": "Sierra AC875", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6821 b/package/network/utils/wwan/files/data/1199-6821 index 3ebd0be11..a91228851 100644 --- a/package/network/utils/wwan/files/data/1199-6821 +++ b/package/network/utils/wwan/files/data/1199-6821 @@ -2,4 +2,4 @@ "desc": "Sierra AC875U", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6822 b/package/network/utils/wwan/files/data/1199-6822 index 35ee919cc..90fe42bd8 100644 --- a/package/network/utils/wwan/files/data/1199-6822 +++ b/package/network/utils/wwan/files/data/1199-6822 @@ -2,4 +2,4 @@ "desc": "Sierra AC875E", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6833 b/package/network/utils/wwan/files/data/1199-6833 index 0fcd10e93..11859acd4 100644 --- a/package/network/utils/wwan/files/data/1199-6833 +++ b/package/network/utils/wwan/files/data/1199-6833 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6834 b/package/network/utils/wwan/files/data/1199-6834 index 0b9eadf70..e23f53e07 100644 --- a/package/network/utils/wwan/files/data/1199-6834 +++ b/package/network/utils/wwan/files/data/1199-6834 @@ -2,4 +2,4 @@ "desc": "Sierra MC8780", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6835 b/package/network/utils/wwan/files/data/1199-6835 index 0fcd10e93..11859acd4 100644 --- a/package/network/utils/wwan/files/data/1199-6835 +++ b/package/network/utils/wwan/files/data/1199-6835 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6838 b/package/network/utils/wwan/files/data/1199-6838 index 0b9eadf70..e23f53e07 100644 --- a/package/network/utils/wwan/files/data/1199-6838 +++ b/package/network/utils/wwan/files/data/1199-6838 @@ -2,4 +2,4 @@ "desc": "Sierra MC8780", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6839 b/package/network/utils/wwan/files/data/1199-6839 index 0fcd10e93..11859acd4 100644 --- a/package/network/utils/wwan/files/data/1199-6839 +++ b/package/network/utils/wwan/files/data/1199-6839 @@ -2,4 +2,4 @@ "desc": "Sierra MC8781", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-683a b/package/network/utils/wwan/files/data/1199-683a index 02da610cf..aca144df2 100644 --- a/package/network/utils/wwan/files/data/1199-683a +++ b/package/network/utils/wwan/files/data/1199-683a @@ -2,4 +2,4 @@ "desc": "Sierra MC8785", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-683b b/package/network/utils/wwan/files/data/1199-683b index 0f2a133cf..8df7e72d6 100644 --- a/package/network/utils/wwan/files/data/1199-683b +++ b/package/network/utils/wwan/files/data/1199-683b @@ -2,4 +2,4 @@ "desc": "Sierra MC8785 Composite", "control": 3, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6850 b/package/network/utils/wwan/files/data/1199-6850 index 1989d0abc..c8788251f 100644 --- a/package/network/utils/wwan/files/data/1199-6850 +++ b/package/network/utils/wwan/files/data/1199-6850 @@ -2,4 +2,4 @@ "desc": "Sierra AC880", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6851 b/package/network/utils/wwan/files/data/1199-6851 index 16d8ab465..339f39a5e 100644 --- a/package/network/utils/wwan/files/data/1199-6851 +++ b/package/network/utils/wwan/files/data/1199-6851 @@ -2,4 +2,4 @@ "desc": "Sierra AC 881", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6852 b/package/network/utils/wwan/files/data/1199-6852 index 65be37b7a..6dcb045c5 100644 --- a/package/network/utils/wwan/files/data/1199-6852 +++ b/package/network/utils/wwan/files/data/1199-6852 @@ -2,4 +2,4 @@ "desc": "Sierra AC880E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6853 b/package/network/utils/wwan/files/data/1199-6853 index a8aee6d9c..09b482cf7 100644 --- a/package/network/utils/wwan/files/data/1199-6853 +++ b/package/network/utils/wwan/files/data/1199-6853 @@ -2,4 +2,4 @@ "desc": "Sierra AC881E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6855 b/package/network/utils/wwan/files/data/1199-6855 index 24eddc6f1..ad5f0491d 100644 --- a/package/network/utils/wwan/files/data/1199-6855 +++ b/package/network/utils/wwan/files/data/1199-6855 @@ -2,4 +2,4 @@ "desc": "Sierra AC880U", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6856 b/package/network/utils/wwan/files/data/1199-6856 index 415a80a15..9bc68721c 100644 --- a/package/network/utils/wwan/files/data/1199-6856 +++ b/package/network/utils/wwan/files/data/1199-6856 @@ -2,4 +2,4 @@ "desc": "Sierra ATT USB Connect 881", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6859 b/package/network/utils/wwan/files/data/1199-6859 index 075cc6bcd..9383e6c0d 100644 --- a/package/network/utils/wwan/files/data/1199-6859 +++ b/package/network/utils/wwan/files/data/1199-6859 @@ -2,4 +2,4 @@ "desc": "Sierra AC885E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-685a b/package/network/utils/wwan/files/data/1199-685a index 075cc6bcd..9383e6c0d 100644 --- a/package/network/utils/wwan/files/data/1199-685a +++ b/package/network/utils/wwan/files/data/1199-685a @@ -2,4 +2,4 @@ "desc": "Sierra AC885E", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6880 b/package/network/utils/wwan/files/data/1199-6880 index e188c0377..bae654f5e 100644 --- a/package/network/utils/wwan/files/data/1199-6880 +++ b/package/network/utils/wwan/files/data/1199-6880 @@ -2,4 +2,4 @@ "desc": "Sierra C885", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6890 b/package/network/utils/wwan/files/data/1199-6890 index 6d2f892a3..7154b0ceb 100644 --- a/package/network/utils/wwan/files/data/1199-6890 +++ b/package/network/utils/wwan/files/data/1199-6890 @@ -2,4 +2,4 @@ "desc": "Sierra C888", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6891 b/package/network/utils/wwan/files/data/1199-6891 index fa866e291..1e1c89c1e 100644 --- a/package/network/utils/wwan/files/data/1199-6891 +++ b/package/network/utils/wwan/files/data/1199-6891 @@ -2,4 +2,4 @@ "desc": "Sierra C22 and C33", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6892 b/package/network/utils/wwan/files/data/1199-6892 index 99a2bd2d6..923302a4f 100644 --- a/package/network/utils/wwan/files/data/1199-6892 +++ b/package/network/utils/wwan/files/data/1199-6892 @@ -2,4 +2,4 @@ "desc": "Sierra Compass HSPA", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-6893 b/package/network/utils/wwan/files/data/1199-6893 index 16f4dfda4..9cd3ad09e 100644 --- a/package/network/utils/wwan/files/data/1199-6893 +++ b/package/network/utils/wwan/files/data/1199-6893 @@ -2,4 +2,4 @@ "desc": "Sierra C889", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1199-68aa b/package/network/utils/wwan/files/data/1199-68aa index 7c5a9f2ba..062c200f4 100644 --- a/package/network/utils/wwan/files/data/1199-68aa +++ b/package/network/utils/wwan/files/data/1199-68aa @@ -2,4 +2,4 @@ "desc": "Sierra AC320U/AC330U Direct IP", "control": 3, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1035 b/package/network/utils/wwan/files/data/12d1-1035 index ad7025a1d..1b595cd58 100644 --- a/package/network/utils/wwan/files/data/12d1-1035 +++ b/package/network/utils/wwan/files/data/12d1-1035 @@ -2,4 +2,4 @@ "desc": "HUAWEI U8110", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1406 b/package/network/utils/wwan/files/data/12d1-1406 index b1aa31783..796190807 100644 --- a/package/network/utils/wwan/files/data/12d1-1406 +++ b/package/network/utils/wwan/files/data/12d1-1406 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option newer modems", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-140b b/package/network/utils/wwan/files/data/12d1-140b index cc99898ae..cd8cbdd51 100644 --- a/package/network/utils/wwan/files/data/12d1-140b +++ b/package/network/utils/wwan/files/data/12d1-140b @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option EC1260 Wireless Data Modem HSD USB Card", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1412 b/package/network/utils/wwan/files/data/12d1-1412 index e6fb6cc7e..342672a1d 100644 --- a/package/network/utils/wwan/files/data/12d1-1412 +++ b/package/network/utils/wwan/files/data/12d1-1412 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option EC168", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-141b b/package/network/utils/wwan/files/data/12d1-141b index b1aa31783..796190807 100644 --- a/package/network/utils/wwan/files/data/12d1-141b +++ b/package/network/utils/wwan/files/data/12d1-141b @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option newer modems", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1433 b/package/network/utils/wwan/files/data/12d1-1433 index c5d86cb15..315971474 100644 --- a/package/network/utils/wwan/files/data/12d1-1433 +++ b/package/network/utils/wwan/files/data/12d1-1433 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E1756C", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1436 b/package/network/utils/wwan/files/data/12d1-1436 index 7db8644b1..a73fdc4c3 100644 --- a/package/network/utils/wwan/files/data/12d1-1436 +++ b/package/network/utils/wwan/files/data/12d1-1436 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E1800", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1444 b/package/network/utils/wwan/files/data/12d1-1444 index 500d77512..cbbf9d28f 100644 --- a/package/network/utils/wwan/files/data/12d1-1444 +++ b/package/network/utils/wwan/files/data/12d1-1444 @@ -2,4 +2,4 @@ "desc": "HUAWEI/Option E352-R1", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-144e b/package/network/utils/wwan/files/data/12d1-144e index a704946aa..c80d2e9b5 100644 --- a/package/network/utils/wwan/files/data/12d1-144e +++ b/package/network/utils/wwan/files/data/12d1-144e @@ -2,4 +2,4 @@ "desc": "Huawei K3806", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1464 b/package/network/utils/wwan/files/data/12d1-1464 index 1b5397cd6..ffa690d8a 100644 --- a/package/network/utils/wwan/files/data/12d1-1464 +++ b/package/network/utils/wwan/files/data/12d1-1464 @@ -2,4 +2,4 @@ "desc": "Huawei K4505", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1465 b/package/network/utils/wwan/files/data/12d1-1465 index dbb20f7cc..55696ffa4 100644 --- a/package/network/utils/wwan/files/data/12d1-1465 +++ b/package/network/utils/wwan/files/data/12d1-1465 @@ -2,4 +2,4 @@ "desc": "Huawei K3765", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1491 b/package/network/utils/wwan/files/data/12d1-1491 index c1ae9a568..2228a909f 100644 --- a/package/network/utils/wwan/files/data/12d1-1491 +++ b/package/network/utils/wwan/files/data/12d1-1491 @@ -2,4 +2,4 @@ "desc": "Huawei R201", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14a5 b/package/network/utils/wwan/files/data/12d1-14a5 index 50ea07957..6eac38b53 100644 --- a/package/network/utils/wwan/files/data/12d1-14a5 +++ b/package/network/utils/wwan/files/data/12d1-14a5 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14a8 b/package/network/utils/wwan/files/data/12d1-14a8 index 50ea07957..6eac38b53 100644 --- a/package/network/utils/wwan/files/data/12d1-14a8 +++ b/package/network/utils/wwan/files/data/12d1-14a8 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14ae b/package/network/utils/wwan/files/data/12d1-14ae index e27a798ff..92f9b6a1c 100644 --- a/package/network/utils/wwan/files/data/12d1-14ae +++ b/package/network/utils/wwan/files/data/12d1-14ae @@ -2,4 +2,4 @@ "desc": "Huawei K3806", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14cb b/package/network/utils/wwan/files/data/12d1-14cb index b496a60bc..8419b6937 100644 --- a/package/network/utils/wwan/files/data/12d1-14cb +++ b/package/network/utils/wwan/files/data/12d1-14cb @@ -2,4 +2,4 @@ "desc": "Huawei K4510", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-14cf b/package/network/utils/wwan/files/data/12d1-14cf index 18e1e1e3a..88a0f92de 100644 --- a/package/network/utils/wwan/files/data/12d1-14cf +++ b/package/network/utils/wwan/files/data/12d1-14cf @@ -2,4 +2,4 @@ "desc": "Huawei K3772", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1506 b/package/network/utils/wwan/files/data/12d1-1506 index 65760e8f9..9e575afd9 100644 --- a/package/network/utils/wwan/files/data/12d1-1506 +++ b/package/network/utils/wwan/files/data/12d1-1506 @@ -2,4 +2,4 @@ "desc": "Huawei E367/E398", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-151d b/package/network/utils/wwan/files/data/12d1-151d index e5eae2a88..b5a3f104d 100644 --- a/package/network/utils/wwan/files/data/12d1-151d +++ b/package/network/utils/wwan/files/data/12d1-151d @@ -2,4 +2,4 @@ "desc": "Huawei E3131", "control": 3, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-156c b/package/network/utils/wwan/files/data/12d1-156c index 3fc6b1b13..9a0a2927c 100644 --- a/package/network/utils/wwan/files/data/12d1-156c +++ b/package/network/utils/wwan/files/data/12d1-156c @@ -2,4 +2,4 @@ "desc": "Huawei E3276", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c05 b/package/network/utils/wwan/files/data/12d1-1c05 index c5612241b..6345f537d 100644 --- a/package/network/utils/wwan/files/data/12d1-1c05 +++ b/package/network/utils/wwan/files/data/12d1-1c05 @@ -2,4 +2,4 @@ "desc": "Huawei E173s", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c07 b/package/network/utils/wwan/files/data/12d1-1c07 index cee727686..e8681e623 100644 --- a/package/network/utils/wwan/files/data/12d1-1c07 +++ b/package/network/utils/wwan/files/data/12d1-1c07 @@ -2,4 +2,4 @@ "desc": "Huawei E188", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c08 b/package/network/utils/wwan/files/data/12d1-1c08 index 4f6fb21fa..52df7e2a3 100644 --- a/package/network/utils/wwan/files/data/12d1-1c08 +++ b/package/network/utils/wwan/files/data/12d1-1c08 @@ -2,4 +2,4 @@ "desc": "Huawei E173s", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c10 b/package/network/utils/wwan/files/data/12d1-1c10 index 50ea07957..6eac38b53 100644 --- a/package/network/utils/wwan/files/data/12d1-1c10 +++ b/package/network/utils/wwan/files/data/12d1-1c10 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c12 b/package/network/utils/wwan/files/data/12d1-1c12 index 50ea07957..6eac38b53 100644 --- a/package/network/utils/wwan/files/data/12d1-1c12 +++ b/package/network/utils/wwan/files/data/12d1-1c12 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/12d1-1c23 b/package/network/utils/wwan/files/data/12d1-1c23 index d1043471b..41aef76b2 100644 --- a/package/network/utils/wwan/files/data/12d1-1c23 +++ b/package/network/utils/wwan/files/data/12d1-1c23 @@ -2,4 +2,4 @@ "desc": "Huawei E173", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1400 b/package/network/utils/wwan/files/data/1410-1400 index e2bda9674..a36e1aa59 100644 --- a/package/network/utils/wwan/files/data/1410-1400 +++ b/package/network/utils/wwan/files/data/1410-1400 @@ -2,4 +2,4 @@ "desc": "Novatel U730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1410 b/package/network/utils/wwan/files/data/1410-1410 index ba48aea92..0702468e5 100644 --- a/package/network/utils/wwan/files/data/1410-1410 +++ b/package/network/utils/wwan/files/data/1410-1410 @@ -2,4 +2,4 @@ "desc": "Novatel U740", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1420 b/package/network/utils/wwan/files/data/1410-1420 index 5cc96b695..f29b08fae 100644 --- a/package/network/utils/wwan/files/data/1410-1420 +++ b/package/network/utils/wwan/files/data/1410-1420 @@ -2,4 +2,4 @@ "desc": "Novatel U870", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1430 b/package/network/utils/wwan/files/data/1410-1430 index 012f3ad9f..275d3a70c 100644 --- a/package/network/utils/wwan/files/data/1410-1430 +++ b/package/network/utils/wwan/files/data/1410-1430 @@ -2,4 +2,4 @@ "desc": "Novatel XU870", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-1450 b/package/network/utils/wwan/files/data/1410-1450 index d1016773d..a28901f00 100644 --- a/package/network/utils/wwan/files/data/1410-1450 +++ b/package/network/utils/wwan/files/data/1410-1450 @@ -2,4 +2,4 @@ "desc": "Novatel X950D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2100 b/package/network/utils/wwan/files/data/1410-2100 index a0328cf92..4c8f57693 100644 --- a/package/network/utils/wwan/files/data/1410-2100 +++ b/package/network/utils/wwan/files/data/1410-2100 @@ -2,4 +2,4 @@ "desc": "Novatel EV620", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2110 b/package/network/utils/wwan/files/data/1410-2110 index 701bf4245..14012df7a 100644 --- a/package/network/utils/wwan/files/data/1410-2110 +++ b/package/network/utils/wwan/files/data/1410-2110 @@ -2,4 +2,4 @@ "desc": "Novatel ES720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2120 b/package/network/utils/wwan/files/data/1410-2120 index 7ab3c9d78..d1c7615c5 100644 --- a/package/network/utils/wwan/files/data/1410-2120 +++ b/package/network/utils/wwan/files/data/1410-2120 @@ -2,4 +2,4 @@ "desc": "Novatel E725", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2130 b/package/network/utils/wwan/files/data/1410-2130 index 98006e20e..fc8404f3d 100644 --- a/package/network/utils/wwan/files/data/1410-2130 +++ b/package/network/utils/wwan/files/data/1410-2130 @@ -2,4 +2,4 @@ "desc": "Novatel ES620", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2400 b/package/network/utils/wwan/files/data/1410-2400 index cd9f29069..1f1871254 100644 --- a/package/network/utils/wwan/files/data/1410-2400 +++ b/package/network/utils/wwan/files/data/1410-2400 @@ -2,4 +2,4 @@ "desc": "Novatel EU730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2410 b/package/network/utils/wwan/files/data/1410-2410 index 4635063b2..fe656f56c 100644 --- a/package/network/utils/wwan/files/data/1410-2410 +++ b/package/network/utils/wwan/files/data/1410-2410 @@ -2,4 +2,4 @@ "desc": "Novatel EU740", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-2420 b/package/network/utils/wwan/files/data/1410-2420 index 340666c7c..db1c68fd5 100644 --- a/package/network/utils/wwan/files/data/1410-2420 +++ b/package/network/utils/wwan/files/data/1410-2420 @@ -2,4 +2,4 @@ "desc": "Novatel EU870D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-4100 b/package/network/utils/wwan/files/data/1410-4100 index 260a2891a..6ec573596 100644 --- a/package/network/utils/wwan/files/data/1410-4100 +++ b/package/network/utils/wwan/files/data/1410-4100 @@ -2,4 +2,4 @@ "desc": "Novatel MC727/U727", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-4400 b/package/network/utils/wwan/files/data/1410-4400 index 838a7fbf9..0ecddcf11 100644 --- a/package/network/utils/wwan/files/data/1410-4400 +++ b/package/network/utils/wwan/files/data/1410-4400 @@ -2,4 +2,4 @@ "desc": "Novatel Ovation MC930D/MC950D", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6000 b/package/network/utils/wwan/files/data/1410-6000 index a12716e4b..861c992e0 100644 --- a/package/network/utils/wwan/files/data/1410-6000 +++ b/package/network/utils/wwan/files/data/1410-6000 @@ -2,4 +2,4 @@ "desc": "Novatel USB760", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6001 b/package/network/utils/wwan/files/data/1410-6001 index a12716e4b..861c992e0 100644 --- a/package/network/utils/wwan/files/data/1410-6001 +++ b/package/network/utils/wwan/files/data/1410-6001 @@ -2,4 +2,4 @@ "desc": "Novatel USB760", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6002 b/package/network/utils/wwan/files/data/1410-6002 index fce8e9bfd..1c97f16de 100644 --- a/package/network/utils/wwan/files/data/1410-6002 +++ b/package/network/utils/wwan/files/data/1410-6002 @@ -2,4 +2,4 @@ "desc": "Novatel USB760 3G", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-6010 b/package/network/utils/wwan/files/data/1410-6010 index d08c399a1..0b9b226d2 100644 --- a/package/network/utils/wwan/files/data/1410-6010 +++ b/package/network/utils/wwan/files/data/1410-6010 @@ -2,4 +2,4 @@ "desc": "Novatel MC780", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7001 b/package/network/utils/wwan/files/data/1410-7001 index 079c7d52c..ac03ddc69 100644 --- a/package/network/utils/wwan/files/data/1410-7001 +++ b/package/network/utils/wwan/files/data/1410-7001 @@ -2,4 +2,4 @@ "desc": "Novatel MiFi 2372", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7003 b/package/network/utils/wwan/files/data/1410-7003 index 079c7d52c..ac03ddc69 100644 --- a/package/network/utils/wwan/files/data/1410-7003 +++ b/package/network/utils/wwan/files/data/1410-7003 @@ -2,4 +2,4 @@ "desc": "Novatel MiFi 2372", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7030 b/package/network/utils/wwan/files/data/1410-7030 index 0fc402905..1ea46ea5d 100644 --- a/package/network/utils/wwan/files/data/1410-7030 +++ b/package/network/utils/wwan/files/data/1410-7030 @@ -2,4 +2,4 @@ "desc": "Novatel USB998", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7031 b/package/network/utils/wwan/files/data/1410-7031 index e1ba049c1..86d03cee0 100644 --- a/package/network/utils/wwan/files/data/1410-7031 +++ b/package/network/utils/wwan/files/data/1410-7031 @@ -1,6 +1,6 @@ { "desc": "Novatel USB679", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1410-7041 b/package/network/utils/wwan/files/data/1410-7041 index 03e8fcd50..203597dd7 100644 --- a/package/network/utils/wwan/files/data/1410-7041 +++ b/package/network/utils/wwan/files/data/1410-7041 @@ -2,4 +2,4 @@ "desc": "Novatel MF3470", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1410-7042 b/package/network/utils/wwan/files/data/1410-7042 index 0bb9cdbd2..ea6d71fa2 100644 --- a/package/network/utils/wwan/files/data/1410-7042 +++ b/package/network/utils/wwan/files/data/1410-7042 @@ -2,4 +2,4 @@ "desc": "Novatel Ovation MC545/MC547", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1529-3100 b/package/network/utils/wwan/files/data/1529-3100 index 5e4fe34b5..afeb681a2 100644 --- a/package/network/utils/wwan/files/data/1529-3100 +++ b/package/network/utils/wwan/files/data/1529-3100 @@ -1,6 +1,6 @@ { "desc": "UBIQUAM U-100/105/200/300/520", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d5-6202 b/package/network/utils/wwan/files/data/16d5-6202 index 1ba8a502b..622578521 100644 --- a/package/network/utils/wwan/files/data/16d5-6202 +++ b/package/network/utils/wwan/files/data/16d5-6202 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-620UW", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6501 b/package/network/utils/wwan/files/data/16d5-6501 index 09207df3b..96574f365 100644 --- a/package/network/utils/wwan/files/data/16d5-6501 +++ b/package/network/utils/wwan/files/data/16d5-6501 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-300A", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6502 b/package/network/utils/wwan/files/data/16d5-6502 index 4bdbf899a..8607d4187 100644 --- a/package/network/utils/wwan/files/data/16d5-6502 +++ b/package/network/utils/wwan/files/data/16d5-6502 @@ -2,4 +2,4 @@ "desc": "AnyData ADU-500A", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d5-6603 b/package/network/utils/wwan/files/data/16d5-6603 index 5c108a2d3..8f0ff3b0b 100644 --- a/package/network/utils/wwan/files/data/16d5-6603 +++ b/package/network/utils/wwan/files/data/16d5-6603 @@ -1,6 +1,6 @@ { "desc": "AnyData ADU-890WH", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/16d5-900d b/package/network/utils/wwan/files/data/16d5-900d index b1c486988..4ac52bba6 100644 --- a/package/network/utils/wwan/files/data/16d5-900d +++ b/package/network/utils/wwan/files/data/16d5-900d @@ -1,6 +1,6 @@ { "desc": "AnyData ADU-890WH", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5141 b/package/network/utils/wwan/files/data/16d8-5141 index bda356fda..eeb3ea4f3 100644 --- a/package/network/utils/wwan/files/data/16d8-5141 +++ b/package/network/utils/wwan/files/data/16d8-5141 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-510", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5533 b/package/network/utils/wwan/files/data/16d8-5533 index 185d257d4..9fd23cdcd 100644 --- a/package/network/utils/wwan/files/data/16d8-5533 +++ b/package/network/utils/wwan/files/data/16d8-5533 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5543 b/package/network/utils/wwan/files/data/16d8-5543 index 185d257d4..9fd23cdcd 100644 --- a/package/network/utils/wwan/files/data/16d8-5543 +++ b/package/network/utils/wwan/files/data/16d8-5543 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-5553 b/package/network/utils/wwan/files/data/16d8-5553 index 2403381d1..323ec28f8 100644 --- a/package/network/utils/wwan/files/data/16d8-5553 +++ b/package/network/utils/wwan/files/data/16d8-5553 @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-550", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6002 b/package/network/utils/wwan/files/data/16d8-6002 index 715878c45..d779cdf8a 100644 --- a/package/network/utils/wwan/files/data/16d8-6002 +++ b/package/network/utils/wwan/files/data/16d8-6002 @@ -2,4 +2,4 @@ "desc": "Franklin U300", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d8-6006 b/package/network/utils/wwan/files/data/16d8-6006 index bb8f87e0c..92c5f0d8d 100644 --- a/package/network/utils/wwan/files/data/16d8-6006 +++ b/package/network/utils/wwan/files/data/16d8-6006 @@ -2,4 +2,4 @@ "desc": "Cmotech CGU-628", "control": 0, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/16d8-6522 b/package/network/utils/wwan/files/data/16d8-6522 index 44343d002..8301da181 100644 --- a/package/network/utils/wwan/files/data/16d8-6522 +++ b/package/network/utils/wwan/files/data/16d8-6522 @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-650", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6523 b/package/network/utils/wwan/files/data/16d8-6523 index 406566b9a..40ee5cbd6 100644 --- a/package/network/utils/wwan/files/data/16d8-6523 +++ b/package/network/utils/wwan/files/data/16d8-6523 @@ -1,6 +1,6 @@ { "desc": "Cmotech CCU-650U", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6532 b/package/network/utils/wwan/files/data/16d8-6532 index 5b6a147ff..e0cbfe2cb 100644 --- a/package/network/utils/wwan/files/data/16d8-6532 +++ b/package/network/utils/wwan/files/data/16d8-6532 @@ -1,6 +1,6 @@ { "desc": "Cmotech CCU-650", "control": 2, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6533 b/package/network/utils/wwan/files/data/16d8-6533 index 07175f318..f3866bbc3 100644 --- a/package/network/utils/wwan/files/data/16d8-6533 +++ b/package/network/utils/wwan/files/data/16d8-6533 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNM-650", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-6543 b/package/network/utils/wwan/files/data/16d8-6543 index c518ca723..99fcedd65 100644 --- a/package/network/utils/wwan/files/data/16d8-6543 +++ b/package/network/utils/wwan/files/data/16d8-6543 @@ -1,6 +1,6 @@ { "desc": "Cmotech CNU-650", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/16d8-680a b/package/network/utils/wwan/files/data/16d8-680a index 9b1c85fe8..836092149 100644 --- a/package/network/utils/wwan/files/data/16d8-680a +++ b/package/network/utils/wwan/files/data/16d8-680a @@ -1,6 +1,6 @@ { "desc": "Cmotech CDU-680", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0001 b/package/network/utils/wwan/files/data/19d2-0001 index 31ee3fd32..5b0d9622d 100644 --- a/package/network/utils/wwan/files/data/19d2-0001 +++ b/package/network/utils/wwan/files/data/19d2-0001 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0015 b/package/network/utils/wwan/files/data/19d2-0015 index 31ee3fd32..5b0d9622d 100644 --- a/package/network/utils/wwan/files/data/19d2-0015 +++ b/package/network/utils/wwan/files/data/19d2-0015 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0016 b/package/network/utils/wwan/files/data/19d2-0016 index 48c5fefd3..31c7421e0 100644 --- a/package/network/utils/wwan/files/data/19d2-0016 +++ b/package/network/utils/wwan/files/data/19d2-0016 @@ -2,4 +2,4 @@ "desc": "ONDA MF110/ZTE", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0018 b/package/network/utils/wwan/files/data/19d2-0018 index 76120d480..35dc57ef9 100644 --- a/package/network/utils/wwan/files/data/19d2-0018 +++ b/package/network/utils/wwan/files/data/19d2-0018 @@ -2,4 +2,4 @@ "desc": "ONDA MSA110UP/ZTE", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0022 b/package/network/utils/wwan/files/data/19d2-0022 index 7ed8ed1ca..0d7b8264b 100644 --- a/package/network/utils/wwan/files/data/19d2-0022 +++ b/package/network/utils/wwan/files/data/19d2-0022 @@ -2,4 +2,4 @@ "desc": "ZTE K2525", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0024 b/package/network/utils/wwan/files/data/19d2-0024 index 5ae34af23..128bd72ef 100644 --- a/package/network/utils/wwan/files/data/19d2-0024 +++ b/package/network/utils/wwan/files/data/19d2-0024 @@ -2,4 +2,4 @@ "desc": "ONDA MT503HSA", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0033 b/package/network/utils/wwan/files/data/19d2-0033 index e99314e34..bcca7ffaa 100644 --- a/package/network/utils/wwan/files/data/19d2-0033 +++ b/package/network/utils/wwan/files/data/19d2-0033 @@ -2,4 +2,4 @@ "desc": "ZTE MF636", "control": 1, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0037 b/package/network/utils/wwan/files/data/19d2-0037 index 8ee565d42..0bc992ece 100644 --- a/package/network/utils/wwan/files/data/19d2-0037 +++ b/package/network/utils/wwan/files/data/19d2-0037 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0039 b/package/network/utils/wwan/files/data/19d2-0039 index c80a51aef..3a6e72e40 100644 --- a/package/network/utils/wwan/files/data/19d2-0039 +++ b/package/network/utils/wwan/files/data/19d2-0039 @@ -2,4 +2,4 @@ "desc": "ZTE MF100", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0057 b/package/network/utils/wwan/files/data/19d2-0057 index 780074613..1d0f0a159 100644 --- a/package/network/utils/wwan/files/data/19d2-0057 +++ b/package/network/utils/wwan/files/data/19d2-0057 @@ -2,4 +2,4 @@ "desc": "AIKO 83D", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0064 b/package/network/utils/wwan/files/data/19d2-0064 index edb0efef0..2b4784134 100644 --- a/package/network/utils/wwan/files/data/19d2-0064 +++ b/package/network/utils/wwan/files/data/19d2-0064 @@ -2,4 +2,4 @@ "desc": "ZTE MF627", "control": 0, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0066 b/package/network/utils/wwan/files/data/19d2-0066 index c57d7aec1..f8bbdaef7 100644 --- a/package/network/utils/wwan/files/data/19d2-0066 +++ b/package/network/utils/wwan/files/data/19d2-0066 @@ -2,4 +2,4 @@ "desc": "ZTE MF626", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0073 b/package/network/utils/wwan/files/data/19d2-0073 index 0f9502f12..acd581c2a 100644 --- a/package/network/utils/wwan/files/data/19d2-0073 +++ b/package/network/utils/wwan/files/data/19d2-0073 @@ -2,4 +2,4 @@ "desc": "ZTE A580", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0079 b/package/network/utils/wwan/files/data/19d2-0079 index 569a9996c..c2d52de5f 100644 --- a/package/network/utils/wwan/files/data/19d2-0079 +++ b/package/network/utils/wwan/files/data/19d2-0079 @@ -2,4 +2,4 @@ "desc": "ZTE A353", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0082 b/package/network/utils/wwan/files/data/19d2-0082 index ea4fcd945..2dbd3b51a 100644 --- a/package/network/utils/wwan/files/data/19d2-0082 +++ b/package/network/utils/wwan/files/data/19d2-0082 @@ -2,4 +2,4 @@ "desc": "ZTE MF668/MF190", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0086 b/package/network/utils/wwan/files/data/19d2-0086 index f25d77a60..0527f6fed 100644 --- a/package/network/utils/wwan/files/data/19d2-0086 +++ b/package/network/utils/wwan/files/data/19d2-0086 @@ -2,4 +2,4 @@ "desc": "ZTE MF645", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0091 b/package/network/utils/wwan/files/data/19d2-0091 index 4e429a632..be9cb55bd 100644 --- a/package/network/utils/wwan/files/data/19d2-0091 +++ b/package/network/utils/wwan/files/data/19d2-0091 @@ -2,4 +2,4 @@ "desc": "ZTE MF636", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0094 b/package/network/utils/wwan/files/data/19d2-0094 index 34a976eba..ed2fd2637 100644 --- a/package/network/utils/wwan/files/data/19d2-0094 +++ b/package/network/utils/wwan/files/data/19d2-0094 @@ -2,4 +2,4 @@ "desc": "ZTE AC581", "control": 3, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0108 b/package/network/utils/wwan/files/data/19d2-0108 index 369d70f09..aac3158c3 100644 --- a/package/network/utils/wwan/files/data/19d2-0108 +++ b/package/network/utils/wwan/files/data/19d2-0108 @@ -2,4 +2,4 @@ "desc": "ONDA MT505UP/ZTE", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0116 b/package/network/utils/wwan/files/data/19d2-0116 index bfe9b5d44..974edf4e3 100644 --- a/package/network/utils/wwan/files/data/19d2-0116 +++ b/package/network/utils/wwan/files/data/19d2-0116 @@ -1,6 +1,6 @@ { "desc": "ZTE MF651", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0117 b/package/network/utils/wwan/files/data/19d2-0117 index 8610bbf41..0cb57d9b2 100644 --- a/package/network/utils/wwan/files/data/19d2-0117 +++ b/package/network/utils/wwan/files/data/19d2-0117 @@ -2,4 +2,4 @@ "desc": "ZTE MF112", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0128 b/package/network/utils/wwan/files/data/19d2-0128 index 620eb90f0..078932e7b 100644 --- a/package/network/utils/wwan/files/data/19d2-0128 +++ b/package/network/utils/wwan/files/data/19d2-0128 @@ -2,4 +2,4 @@ "desc": "ZTE MF651", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0142 b/package/network/utils/wwan/files/data/19d2-0142 index 6d19e3e8d..db865819b 100644 --- a/package/network/utils/wwan/files/data/19d2-0142 +++ b/package/network/utils/wwan/files/data/19d2-0142 @@ -1,6 +1,6 @@ { "desc": "ZTE MF665C", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0143 b/package/network/utils/wwan/files/data/19d2-0143 index 6885a9b2e..4208016e0 100644 --- a/package/network/utils/wwan/files/data/19d2-0143 +++ b/package/network/utils/wwan/files/data/19d2-0143 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190B", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-0152 b/package/network/utils/wwan/files/data/19d2-0152 index 20047be7a..f5b84eb3a 100644 --- a/package/network/utils/wwan/files/data/19d2-0152 +++ b/package/network/utils/wwan/files/data/19d2-0152 @@ -2,4 +2,4 @@ "desc": "ZTE AC583", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-0170 b/package/network/utils/wwan/files/data/19d2-0170 index d7d6f97a5..e7eb5aa43 100644 --- a/package/network/utils/wwan/files/data/19d2-0170 +++ b/package/network/utils/wwan/files/data/19d2-0170 @@ -1,6 +1,6 @@ { "desc": "ZTE A371", "control": 0, - "data": 1 -} "generic": 1 + "data": 1, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1003 b/package/network/utils/wwan/files/data/19d2-1003 index a7d0eb5aa..d91f388cd 100644 --- a/package/network/utils/wwan/files/data/19d2-1003 +++ b/package/network/utils/wwan/files/data/19d2-1003 @@ -1,6 +1,6 @@ { "desc": "ZTE K3805-Z", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1015 b/package/network/utils/wwan/files/data/19d2-1015 index a5eab00e9..5d3e5a6c2 100644 --- a/package/network/utils/wwan/files/data/19d2-1015 +++ b/package/network/utils/wwan/files/data/19d2-1015 @@ -1,6 +1,6 @@ { "desc": "ZTE K3806-Z", "control": 1, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1172 b/package/network/utils/wwan/files/data/19d2-1172 index 1b4c728f9..7f6805b4b 100644 --- a/package/network/utils/wwan/files/data/19d2-1172 +++ b/package/network/utils/wwan/files/data/19d2-1172 @@ -1,6 +1,6 @@ { "desc": "ZTE K4510-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1173 b/package/network/utils/wwan/files/data/19d2-1173 index 1b4c728f9..7f6805b4b 100644 --- a/package/network/utils/wwan/files/data/19d2-1173 +++ b/package/network/utils/wwan/files/data/19d2-1173 @@ -1,6 +1,6 @@ { "desc": "ZTE K4510-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1177 b/package/network/utils/wwan/files/data/19d2-1177 index 3d196af44..b5113e983 100644 --- a/package/network/utils/wwan/files/data/19d2-1177 +++ b/package/network/utils/wwan/files/data/19d2-1177 @@ -1,6 +1,6 @@ { "desc": "ZTE K3770-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1181 b/package/network/utils/wwan/files/data/19d2-1181 index 5ee7b2f20..bad2bd84a 100644 --- a/package/network/utils/wwan/files/data/19d2-1181 +++ b/package/network/utils/wwan/files/data/19d2-1181 @@ -1,6 +1,6 @@ { "desc": "ZTE K3772-Z", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1203 b/package/network/utils/wwan/files/data/19d2-1203 index 450253124..7155ac70b 100644 --- a/package/network/utils/wwan/files/data/19d2-1203 +++ b/package/network/utils/wwan/files/data/19d2-1203 @@ -1,6 +1,6 @@ { "desc": "ZTE MF691", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1208 b/package/network/utils/wwan/files/data/19d2-1208 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1208 +++ b/package/network/utils/wwan/files/data/19d2-1208 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1211 b/package/network/utils/wwan/files/data/19d2-1211 index 0df58f0ae..807068fa0 100644 --- a/package/network/utils/wwan/files/data/19d2-1211 +++ b/package/network/utils/wwan/files/data/19d2-1211 @@ -1,6 +1,6 @@ { "desc": "ZTE MF195", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1212 b/package/network/utils/wwan/files/data/19d2-1212 index 0df58f0ae..807068fa0 100644 --- a/package/network/utils/wwan/files/data/19d2-1212 +++ b/package/network/utils/wwan/files/data/19d2-1212 @@ -1,6 +1,6 @@ { "desc": "ZTE MF195", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1217 b/package/network/utils/wwan/files/data/19d2-1217 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1217 +++ b/package/network/utils/wwan/files/data/19d2-1217 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1218 b/package/network/utils/wwan/files/data/19d2-1218 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1218 +++ b/package/network/utils/wwan/files/data/19d2-1218 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1220 b/package/network/utils/wwan/files/data/19d2-1220 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1220 +++ b/package/network/utils/wwan/files/data/19d2-1220 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1222 b/package/network/utils/wwan/files/data/19d2-1222 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1222 +++ b/package/network/utils/wwan/files/data/19d2-1222 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1512 b/package/network/utils/wwan/files/data/19d2-1512 index 7e4bbf750..fa2c87dbb 100644 --- a/package/network/utils/wwan/files/data/19d2-1512 +++ b/package/network/utils/wwan/files/data/19d2-1512 @@ -1,6 +1,6 @@ { "desc": "ZTE MFxxx", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1515 b/package/network/utils/wwan/files/data/19d2-1515 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1515 +++ b/package/network/utils/wwan/files/data/19d2-1515 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1518 b/package/network/utils/wwan/files/data/19d2-1518 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1518 +++ b/package/network/utils/wwan/files/data/19d2-1518 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1519 b/package/network/utils/wwan/files/data/19d2-1519 index d8bc573a1..9884b7d48 100644 --- a/package/network/utils/wwan/files/data/19d2-1519 +++ b/package/network/utils/wwan/files/data/19d2-1519 @@ -1,6 +1,6 @@ { "desc": "ZTE MF192", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1522 b/package/network/utils/wwan/files/data/19d2-1522 index 4c926f018..1e19b2c53 100644 --- a/package/network/utils/wwan/files/data/19d2-1522 +++ b/package/network/utils/wwan/files/data/19d2-1522 @@ -1,6 +1,6 @@ { "desc": "ZTE MF652", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1525 b/package/network/utils/wwan/files/data/19d2-1525 index 7a37c432c..58e392c79 100644 --- a/package/network/utils/wwan/files/data/19d2-1525 +++ b/package/network/utils/wwan/files/data/19d2-1525 @@ -1,6 +1,6 @@ { "desc": "ZTE MF591", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1527 b/package/network/utils/wwan/files/data/19d2-1527 index 6b46c73d7..c62210010 100644 --- a/package/network/utils/wwan/files/data/19d2-1527 +++ b/package/network/utils/wwan/files/data/19d2-1527 @@ -1,6 +1,6 @@ { "desc": "ZTE MF196", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1537 b/package/network/utils/wwan/files/data/19d2-1537 index a62516407..b58df7056 100644 --- a/package/network/utils/wwan/files/data/19d2-1537 +++ b/package/network/utils/wwan/files/data/19d2-1537 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1538 b/package/network/utils/wwan/files/data/19d2-1538 index a62516407..b58df7056 100644 --- a/package/network/utils/wwan/files/data/19d2-1538 +++ b/package/network/utils/wwan/files/data/19d2-1538 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-1544 b/package/network/utils/wwan/files/data/19d2-1544 index a62516407..b58df7056 100644 --- a/package/network/utils/wwan/files/data/19d2-1544 +++ b/package/network/utils/wwan/files/data/19d2-1544 @@ -1,6 +1,6 @@ { "desc": "ZTE MF190J", "control": 0, - "data": 0 -} "acm": 1 + "data": 0, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-2003 b/package/network/utils/wwan/files/data/19d2-2003 index a2a088086..ae1da49ef 100644 --- a/package/network/utils/wwan/files/data/19d2-2003 +++ b/package/network/utils/wwan/files/data/19d2-2003 @@ -2,4 +2,4 @@ "desc": "ZTE MF180", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffdd b/package/network/utils/wwan/files/data/19d2-ffdd index 71d1050a9..e1220283a 100644 --- a/package/network/utils/wwan/files/data/19d2-ffdd +++ b/package/network/utils/wwan/files/data/19d2-ffdd @@ -2,4 +2,4 @@ "desc": "ZTE AC682", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffe4 b/package/network/utils/wwan/files/data/19d2-ffe4 index 03a16bff5..d561593b7 100644 --- a/package/network/utils/wwan/files/data/19d2-ffe4 +++ b/package/network/utils/wwan/files/data/19d2-ffe4 @@ -1,6 +1,6 @@ { "desc": "ZTE AC3781", "control": 1, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/19d2-ffe9 b/package/network/utils/wwan/files/data/19d2-ffe9 index 57531e26e..3fe5f4b88 100644 --- a/package/network/utils/wwan/files/data/19d2-ffe9 +++ b/package/network/utils/wwan/files/data/19d2-ffe9 @@ -2,4 +2,4 @@ "desc": "ZTE AC2738", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fff1 b/package/network/utils/wwan/files/data/19d2-fff1 index 4347f288a..adf579ccd 100644 --- a/package/network/utils/wwan/files/data/19d2-fff1 +++ b/package/network/utils/wwan/files/data/19d2-fff1 @@ -2,4 +2,4 @@ "desc": "ZTE generic", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffb b/package/network/utils/wwan/files/data/19d2-fffb index 4ff616a0c..fb3d59780 100644 --- a/package/network/utils/wwan/files/data/19d2-fffb +++ b/package/network/utils/wwan/files/data/19d2-fffb @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffc b/package/network/utils/wwan/files/data/19d2-fffc index 4ff616a0c..fb3d59780 100644 --- a/package/network/utils/wwan/files/data/19d2-fffc +++ b/package/network/utils/wwan/files/data/19d2-fffc @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffd b/package/network/utils/wwan/files/data/19d2-fffd index 4ff616a0c..fb3d59780 100644 --- a/package/network/utils/wwan/files/data/19d2-fffd +++ b/package/network/utils/wwan/files/data/19d2-fffd @@ -2,4 +2,4 @@ "desc": "ZTE MG880", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-fffe b/package/network/utils/wwan/files/data/19d2-fffe index 4e6004981..faf983243 100644 --- a/package/network/utils/wwan/files/data/19d2-fffe +++ b/package/network/utils/wwan/files/data/19d2-fffe @@ -2,4 +2,4 @@ "desc": "ZTE AC8700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/19d2-ffff b/package/network/utils/wwan/files/data/19d2-ffff index 747fa238d..517dbb88a 100644 --- a/package/network/utils/wwan/files/data/19d2-ffff +++ b/package/network/utils/wwan/files/data/19d2-ffff @@ -2,4 +2,4 @@ "desc": "ZTE AC8710", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1002 b/package/network/utils/wwan/files/data/1a8d-1002 index 93388be2f..bf67e6571 100644 --- a/package/network/utils/wwan/files/data/1a8d-1002 +++ b/package/network/utils/wwan/files/data/1a8d-1002 @@ -2,4 +2,4 @@ "desc": "Bandrich C-100/C-120", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1003 b/package/network/utils/wwan/files/data/1a8d-1003 index 93388be2f..bf67e6571 100644 --- a/package/network/utils/wwan/files/data/1a8d-1003 +++ b/package/network/utils/wwan/files/data/1a8d-1003 @@ -2,4 +2,4 @@ "desc": "Bandrich C-100/C-120", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1007 b/package/network/utils/wwan/files/data/1a8d-1007 index f013968f9..9e482b133 100644 --- a/package/network/utils/wwan/files/data/1a8d-1007 +++ b/package/network/utils/wwan/files/data/1a8d-1007 @@ -2,4 +2,4 @@ "desc": "Bandrich C-270", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-1009 b/package/network/utils/wwan/files/data/1a8d-1009 index 82e4bf03a..b1838340d 100644 --- a/package/network/utils/wwan/files/data/1a8d-1009 +++ b/package/network/utils/wwan/files/data/1a8d-1009 @@ -2,4 +2,4 @@ "desc": "Bandrich C-170/C-180", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-100c b/package/network/utils/wwan/files/data/1a8d-100c index 1acb9eec5..6f19f1fb3 100644 --- a/package/network/utils/wwan/files/data/1a8d-100c +++ b/package/network/utils/wwan/files/data/1a8d-100c @@ -2,4 +2,4 @@ "desc": "Bandrich C-320", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-100d b/package/network/utils/wwan/files/data/1a8d-100d index 67db2b46c..e96c51a88 100644 --- a/package/network/utils/wwan/files/data/1a8d-100d +++ b/package/network/utils/wwan/files/data/1a8d-100d @@ -2,4 +2,4 @@ "desc": "Bandrich C-508", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1a8d-2006 b/package/network/utils/wwan/files/data/1a8d-2006 index 78f36cef1..8164eed0b 100644 --- a/package/network/utils/wwan/files/data/1a8d-2006 +++ b/package/network/utils/wwan/files/data/1a8d-2006 @@ -1,6 +1,6 @@ { "desc": "Bandrich C-33x", "control": 0, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/1bbb-0000 b/package/network/utils/wwan/files/data/1bbb-0000 index 0be73afa1..5b445a35f 100644 --- a/package/network/utils/wwan/files/data/1bbb-0000 +++ b/package/network/utils/wwan/files/data/1bbb-0000 @@ -2,4 +2,4 @@ "desc": "Alcatel X060S/X070S/X080S/X200", "control": 2, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-0012 b/package/network/utils/wwan/files/data/1bbb-0012 index 3eecac0e5..9ba190f2e 100644 --- a/package/network/utils/wwan/files/data/1bbb-0012 +++ b/package/network/utils/wwan/files/data/1bbb-0012 @@ -1,6 +1,6 @@ { "desc": "Alcatel X085C", "control": 2, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1bbb-0017 b/package/network/utils/wwan/files/data/1bbb-0017 index 853c05c0b..ad488dde9 100644 --- a/package/network/utils/wwan/files/data/1bbb-0017 +++ b/package/network/utils/wwan/files/data/1bbb-0017 @@ -2,4 +2,4 @@ "desc": "Alcatel X220L", "control": 4, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-0052 b/package/network/utils/wwan/files/data/1bbb-0052 index 853c05c0b..ad488dde9 100644 --- a/package/network/utils/wwan/files/data/1bbb-0052 +++ b/package/network/utils/wwan/files/data/1bbb-0052 @@ -2,4 +2,4 @@ "desc": "Alcatel X220L", "control": 4, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-00b7 b/package/network/utils/wwan/files/data/1bbb-00b7 index 9eaffe660..0fbf6de1a 100644 --- a/package/network/utils/wwan/files/data/1bbb-00b7 +++ b/package/network/utils/wwan/files/data/1bbb-00b7 @@ -2,4 +2,4 @@ "desc": "Alcatel X600", "control": 0, "data": 4 -}} +} diff --git a/package/network/utils/wwan/files/data/1bbb-00ca b/package/network/utils/wwan/files/data/1bbb-00ca index 80d71fad5..e40cc863d 100644 --- a/package/network/utils/wwan/files/data/1bbb-00ca +++ b/package/network/utils/wwan/files/data/1bbb-00ca @@ -1,6 +1,6 @@ { "desc": "Alcatel X080C", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-6060 b/package/network/utils/wwan/files/data/1c9e-6060 index 6f77bb4b9..878637533 100644 --- a/package/network/utils/wwan/files/data/1c9e-6060 +++ b/package/network/utils/wwan/files/data/1c9e-6060 @@ -1,6 +1,6 @@ { "desc": "Alcatel X020 & X030", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-6061 b/package/network/utils/wwan/files/data/1c9e-6061 index 6f77bb4b9..878637533 100644 --- a/package/network/utils/wwan/files/data/1c9e-6061 +++ b/package/network/utils/wwan/files/data/1c9e-6061 @@ -1,6 +1,6 @@ { "desc": "Alcatel X020 & X030", "control": 2, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9000 b/package/network/utils/wwan/files/data/1c9e-9000 index 39dcd776e..28566b311 100644 --- a/package/network/utils/wwan/files/data/1c9e-9000 +++ b/package/network/utils/wwan/files/data/1c9e-9000 @@ -1,6 +1,6 @@ { "desc": "4G Systems XS Stick W14", "control": 0, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9603 b/package/network/utils/wwan/files/data/1c9e-9603 index fd3f099d1..44f62eb1a 100644 --- a/package/network/utils/wwan/files/data/1c9e-9603 +++ b/package/network/utils/wwan/files/data/1c9e-9603 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9605 b/package/network/utils/wwan/files/data/1c9e-9605 index c2992c16e..fafcefdfa 100644 --- a/package/network/utils/wwan/files/data/1c9e-9605 +++ b/package/network/utils/wwan/files/data/1c9e-9605 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9607 b/package/network/utils/wwan/files/data/1c9e-9607 index c2992c16e..fafcefdfa 100644 --- a/package/network/utils/wwan/files/data/1c9e-9607 +++ b/package/network/utils/wwan/files/data/1c9e-9607 @@ -2,4 +2,4 @@ "desc": "4G Systems XS Stick W14", "control": 1, "data": 3 -}} +} diff --git a/package/network/utils/wwan/files/data/1c9e-9801 b/package/network/utils/wwan/files/data/1c9e-9801 index 40dcc7605..dced60d9d 100644 --- a/package/network/utils/wwan/files/data/1c9e-9801 +++ b/package/network/utils/wwan/files/data/1c9e-9801 @@ -1,6 +1,6 @@ { "desc": "4G Systems XS Stick W21", "control": 2, - "data": 1 -} "generic": 1 + "data": 1, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1c9e-9900 b/package/network/utils/wwan/files/data/1c9e-9900 index 42da3abaf..efbb056f2 100644 --- a/package/network/utils/wwan/files/data/1c9e-9900 +++ b/package/network/utils/wwan/files/data/1c9e-9900 @@ -1,6 +1,6 @@ { "desc": "Softbank C02LC", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/1e0e-9000 b/package/network/utils/wwan/files/data/1e0e-9000 index bdb159da1..5b8321380 100644 --- a/package/network/utils/wwan/files/data/1e0e-9000 +++ b/package/network/utils/wwan/files/data/1e0e-9000 @@ -2,4 +2,4 @@ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-9100 b/package/network/utils/wwan/files/data/1e0e-9100 index d1b2dda7b..b89257f52 100644 --- a/package/network/utils/wwan/files/data/1e0e-9100 +++ b/package/network/utils/wwan/files/data/1e0e-9100 @@ -2,4 +2,4 @@ "desc": "PROLink PHS300, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-9200 b/package/network/utils/wwan/files/data/1e0e-9200 index bdb159da1..5b8321380 100644 --- a/package/network/utils/wwan/files/data/1e0e-9200 +++ b/package/network/utils/wwan/files/data/1e0e-9200 @@ -2,4 +2,4 @@ "desc": "PROLink PHS100, Hyundai MB-810, A-Link 3GU", "control": 1, "data": 2 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-ce16 b/package/network/utils/wwan/files/data/1e0e-ce16 index 93e0c3fa1..d9088e97c 100644 --- a/package/network/utils/wwan/files/data/1e0e-ce16 +++ b/package/network/utils/wwan/files/data/1e0e-ce16 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-162-U5, Micromax MMX 300c", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/1e0e-cefe b/package/network/utils/wwan/files/data/1e0e-cefe index ebc941dfb..78d614859 100644 --- a/package/network/utils/wwan/files/data/1e0e-cefe +++ b/package/network/utils/wwan/files/data/1e0e-cefe @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-162-U5, Micromax MMX 300c", "control": 1, - "data": 2 -} "generic": 1 + "data": 2, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/2001-7d00 b/package/network/utils/wwan/files/data/2001-7d00 index b0cc47912..3b5a3a2e5 100644 --- a/package/network/utils/wwan/files/data/2001-7d00 +++ b/package/network/utils/wwan/files/data/2001-7d00 @@ -1,6 +1,6 @@ { "desc": "D-Link DWM-156 A6", "control": 1, - "data": 0 -} "generic": 1 + "data": 0, + "generic": 1 } diff --git a/package/network/utils/wwan/files/data/2001-7d01 b/package/network/utils/wwan/files/data/2001-7d01 index ab8fd9ded..9f039b12c 100644 --- a/package/network/utils/wwan/files/data/2001-7d01 +++ b/package/network/utils/wwan/files/data/2001-7d01 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/2001-7d02 b/package/network/utils/wwan/files/data/2001-7d02 index ab8fd9ded..9f039b12c 100644 --- a/package/network/utils/wwan/files/data/2001-7d02 +++ b/package/network/utils/wwan/files/data/2001-7d02 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/2001-7d03 b/package/network/utils/wwan/files/data/2001-7d03 index ab8fd9ded..9f039b12c 100644 --- a/package/network/utils/wwan/files/data/2001-7d03 +++ b/package/network/utils/wwan/files/data/2001-7d03 @@ -2,4 +2,4 @@ "desc": "D-Link DWM-156 A7", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/211f-6801 b/package/network/utils/wwan/files/data/211f-6801 index 06cdddca9..07f114847 100644 --- a/package/network/utils/wwan/files/data/211f-6801 +++ b/package/network/utils/wwan/files/data/211f-6801 @@ -2,4 +2,4 @@ "desc": "Celot K-3000/CT-650/CT-680", "control": 2, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8114 b/package/network/utils/wwan/files/data/413c-8114 index a3cb2cd74..c0b767840 100644 --- a/package/network/utils/wwan/files/data/413c-8114 +++ b/package/network/utils/wwan/files/data/413c-8114 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8115 b/package/network/utils/wwan/files/data/413c-8115 index af27cbe07..3f99a0bd8 100644 --- a/package/network/utils/wwan/files/data/413c-8115 +++ b/package/network/utils/wwan/files/data/413c-8115 @@ -2,4 +2,4 @@ "desc": "Dell 5500", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8116 b/package/network/utils/wwan/files/data/413c-8116 index 31b79bf98..ff18d6a46 100644 --- a/package/network/utils/wwan/files/data/413c-8116 +++ b/package/network/utils/wwan/files/data/413c-8116 @@ -2,4 +2,4 @@ "desc": "Dell 5505", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8117 b/package/network/utils/wwan/files/data/413c-8117 index a3cb2cd74..c0b767840 100644 --- a/package/network/utils/wwan/files/data/413c-8117 +++ b/package/network/utils/wwan/files/data/413c-8117 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8118 b/package/network/utils/wwan/files/data/413c-8118 index b92d41514..0404557c6 100644 --- a/package/network/utils/wwan/files/data/413c-8118 +++ b/package/network/utils/wwan/files/data/413c-8118 @@ -2,4 +2,4 @@ "desc": "Dell 5510", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8128 b/package/network/utils/wwan/files/data/413c-8128 index a3cb2cd74..c0b767840 100644 --- a/package/network/utils/wwan/files/data/413c-8128 +++ b/package/network/utils/wwan/files/data/413c-8128 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8129 b/package/network/utils/wwan/files/data/413c-8129 index a3cb2cd74..c0b767840 100644 --- a/package/network/utils/wwan/files/data/413c-8129 +++ b/package/network/utils/wwan/files/data/413c-8129 @@ -2,4 +2,4 @@ "desc": "Dell 5700", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8133 b/package/network/utils/wwan/files/data/413c-8133 index 4ae84020f..7940b3399 100644 --- a/package/network/utils/wwan/files/data/413c-8133 +++ b/package/network/utils/wwan/files/data/413c-8133 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8134 b/package/network/utils/wwan/files/data/413c-8134 index 4ae84020f..7940b3399 100644 --- a/package/network/utils/wwan/files/data/413c-8134 +++ b/package/network/utils/wwan/files/data/413c-8134 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8135 b/package/network/utils/wwan/files/data/413c-8135 index 4ae84020f..7940b3399 100644 --- a/package/network/utils/wwan/files/data/413c-8135 +++ b/package/network/utils/wwan/files/data/413c-8135 @@ -2,4 +2,4 @@ "desc": "Dell 5720", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8136 b/package/network/utils/wwan/files/data/413c-8136 index d2bf508fe..fffa1e858 100644 --- a/package/network/utils/wwan/files/data/413c-8136 +++ b/package/network/utils/wwan/files/data/413c-8136 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8137 b/package/network/utils/wwan/files/data/413c-8137 index d2bf508fe..fffa1e858 100644 --- a/package/network/utils/wwan/files/data/413c-8137 +++ b/package/network/utils/wwan/files/data/413c-8137 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8138 b/package/network/utils/wwan/files/data/413c-8138 index d2bf508fe..fffa1e858 100644 --- a/package/network/utils/wwan/files/data/413c-8138 +++ b/package/network/utils/wwan/files/data/413c-8138 @@ -2,4 +2,4 @@ "desc": "Dell 5520", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8147 b/package/network/utils/wwan/files/data/413c-8147 index f0b0638fd..e9aff093a 100644 --- a/package/network/utils/wwan/files/data/413c-8147 +++ b/package/network/utils/wwan/files/data/413c-8147 @@ -1,6 +1,6 @@ { "desc": "Dell 5530", "control": 0, - "data": 1 -} "acm": 1 + "data": 1, + "acm": 1 } diff --git a/package/network/utils/wwan/files/data/413c-8180 b/package/network/utils/wwan/files/data/413c-8180 index 1ae44053c..d3ac0d8cd 100644 --- a/package/network/utils/wwan/files/data/413c-8180 +++ b/package/network/utils/wwan/files/data/413c-8180 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8181 b/package/network/utils/wwan/files/data/413c-8181 index 1ae44053c..d3ac0d8cd 100644 --- a/package/network/utils/wwan/files/data/413c-8181 +++ b/package/network/utils/wwan/files/data/413c-8181 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-8182 b/package/network/utils/wwan/files/data/413c-8182 index 1ae44053c..d3ac0d8cd 100644 --- a/package/network/utils/wwan/files/data/413c-8182 +++ b/package/network/utils/wwan/files/data/413c-8182 @@ -2,4 +2,4 @@ "desc": "Dell 5730", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/wwan/files/data/413c-819b b/package/network/utils/wwan/files/data/413c-819b index e66c3fc4c..575410bdf 100644 --- a/package/network/utils/wwan/files/data/413c-819b +++ b/package/network/utils/wwan/files/data/413c-819b @@ -2,4 +2,4 @@ "desc": "Dell 5804", "control": 1, "data": 0 -}} +} diff --git a/package/network/utils/xtables-addons/Makefile b/package/network/utils/xtables-addons/Makefile index a1415fc18..0c12d7464 100644 --- a/package/network/utils/xtables-addons/Makefile +++ b/package/network/utils/xtables-addons/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=2.13 +PKG_VERSION:=2.14 PKG_RELEASE:=1 -PKG_HASH:=d141879d438424764e953b97fbb16edafdf8ef6baa57f6e36e07b894a7775dfc +PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/xtables-addons @@ -43,8 +43,7 @@ CONFIGURE_ARGS+= \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ all @@ -52,8 +51,7 @@ endef define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ install diff --git a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch index 7599684bd..a9fb796d0 100644 --- a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch +++ b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch @@ -1,5 +1,14 @@ --- a/extensions/LUA/xt_LUA_target.c +++ b/extensions/LUA/xt_LUA_target.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include "xt_LUA.h" @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY * XT_CONTINUE inside the *register_lua_packet_lib* function. */ diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index dd54d6b19..61fc5daa8 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2017-07-31 -PKG_SOURCE_VERSION:=8ab4fda66a136f5b0f1e5dff9d3649961ffc9158 -PKG_MIRROR_HASH:=f04712fbefbcc2af1da9364310ac6dd771322c3ce2d920d2c003aaea97dbe4b4 +PKG_SOURCE_DATE:=2018-01-02 +PKG_SOURCE_VERSION:=11efbf3b90f031ce634fc38cad07a4aef2985777 +PKG_MIRROR_HASH:=35f14ea0ed799d2eb972f4901116a0e447d4bc1e37fb0edb239c44b270aeae18 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 499de217c..f00e574de 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -7,33 +7,26 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/version.mk -include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2017-07-28 -PKG_SOURCE_VERSION:=4bd8601ebd95c130e504cc724b0c5eb163050982 -PKG_MIRROR_HASH:=adb2d610185a83fb630ccd3f0c80cb8acfd89260e0a5e598aadb8c8f0d903cf5 +PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c +PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Jo-Philipp Wich -PKG_FLAGS := nonshared - -PKG_CONFIG_DEPENDS := \ +# Extend depends from version.mk +PKG_CONFIG_DEPENDS += \ CONFIG_SIGNED_PACKAGES \ - CONFIG_TARGET_INIT_PATH \ - CONFIG_PER_FEED_REPO \ - CONFIG_PER_FEED_REPO_ADD_DISABLED \ - CONFIG_PER_FEED_REPO_ADD_COMMENTED \ - $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) + CONFIG_TARGET_INIT_PATH PKG_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1 @@ -50,7 +43,7 @@ define Package/opkg CATEGORY:=Base system TITLE:=opkg package manager DEPENDS:=+uclient-fetch +libpthread +libubox - URL:=https://git.lede-project.org/?p=project/opkg-lede.git + URL:=$(PKG_SOURCE_URL) MENU:=1 endef @@ -93,8 +86,6 @@ define Package/opkg/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf - $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf) - $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg ifneq ($(CONFIG_SIGNED_PACKAGES),) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 5f2d21c10..7c8a1669b 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git -PKG_SOURCE_DATE:=2017-08-22 -PKG_SOURCE_VERSION:=54b46a351fab736a92221a6f9c750b5f9da499a1 -PKG_MIRROR_HASH:=dcbeea89910bbdf7d6cf20c38892d6c51de375c8b35c372a7106ae17090694f3 +PKG_SOURCE_DATE:=2018-12-02 +PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e +PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -87,9 +87,8 @@ ifdef CONFIG_PACKAGE_procd-ujail CMAKE_OPTIONS += -DJAIL_SUPPORT=1 endif -ifdef CONFIG_PACKAGE_procd-seccomp - CMAKE_OPTIONS += -DSECCOMP_SUPPORT=1 -DUTRACE_SUPPORT=1 -endif +SECCOMP=$(if $(CONFIG_PACKAGE_procd-seccomp),1,0) +CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP) define Package/procd/install $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions @@ -110,6 +109,7 @@ define Package/procd-seccomp/install $(INSTALL_DIR) $(1)/sbin $(1)/lib $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/ + $(LN) utrace $(1)/sbin/seccomp-trace $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index c23c37b83..b4b6faa66 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -38,6 +38,20 @@ PROCD_RELOAD_DELAY=1000 _PROCD_SERVICE= +procd_lock() { + local basescript=$(readlink "$initscript") + local service_name="$(basename ${basescript:-$initscript})" + + flock -n 1000 &> /dev/null + if [ "$?" != "0" ]; then + exec 1000>/var/lock/procd_${service_name}.lock + flock 1000 + if [ "$?" != "0" ]; then + logger "warning: procd flock for $service_name failed" + fi + fi +} + _procd_call() { local old_cb @@ -47,6 +61,7 @@ _procd_call() { } _procd_wrapper() { + procd_lock while [ -n "$1" ]; do eval "$1() { _procd_call _$1 \"\$@\"; }" shift @@ -79,6 +94,9 @@ _procd_close_service() { _procd_open_trigger service_triggers _procd_close_trigger + _procd_open_data + service_data + _procd_close_data _procd_ubus_call ${1:-set} } @@ -134,6 +152,18 @@ _procd_close_trigger() { json_close_array } +_procd_open_data() { + let '_procd_data_open = _procd_data_open + 1' + [ "$_procd_data_open" -gt 1 ] && return + json_add_object "data" +} + +_procd_close_data() { + let '_procd_data_open = _procd_data_open - 1' + [ "$_procd_data_open" -lt 1 ] || return + json_close_object +} + _procd_open_validate() { json_select .. json_add_array "validate" @@ -383,6 +413,10 @@ _procd_send_signal() { local instance="$2" local signal="$3" + case "$signal" in + [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;; + esac + json_init json_add_string name "$service" [ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance" diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index d13f20eab..dc4bbb982 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -12,10 +12,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git -PKG_SOURCE_DATE:=2016-12-03 -PKG_SOURCE_VERSION:=0577cfc1acdbaf30c31090e75045ba58d6dd8a78 +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524 PKG_MAINTAINER:=Jo-Philipp Wich -PKG_MIRROR_HASH:=bbcd750df4867a57604e3b922e28f7a019cf940c3586d813d88001dc314e2a1c +PKG_MIRROR_HASH:=4857497c88115defbf6add68a37975ed79e8f992e65d7d0df56cd29288dea379 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index d19f7551a..21119ee6d 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2017-09-01 -PKG_SOURCE_VERSION:=b1bc8d5fb874cdd22701a08d0fb0de4330f86814 -PKG_MIRROR_HASH:=b07e750d941d691e2745aa3a058e504966b15d1db5636162dc686bad275eb296 +PKG_SOURCE_DATE:=2017-11-06 +PKG_SOURCE_VERSION:=2c0d9cfe05e9712d44622c6bb4558e97359bfb76 +PKG_MIRROR_HASH:=e545a29959a310fd7243ee2e799bf9f759894ea4e872010a781c3a65290377b6 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4f3d4e830..ce8b054b4 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2017-02-18 -PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692 -PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5 +PKG_SOURCE_DATE:=2017-11-13 +PKG_SOURCE_VERSION:=5f87f5480ebf004d735dbf44259d08cf8affd305 +PKG_MIRROR_HASH:=a490348da86c6cdf0cbc8cc01b77fa6f708d86b94674fd312e0c822ca3d7eba0 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index 086169652..c42c94d3a 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -28,7 +28,7 @@ define Package/adb DEPENDS:=+zlib +libopenssl +libpthread endef -define Package/bridge/description +define Package/adb/description Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. endef diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 2a8d9dd39..4e429f437 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -1089,7 +1089,7 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH default y config BUSYBOX_DEFAULT_FEATURE_FIND_NEWER bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_FIND_INUM bool default n @@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS default n config BUSYBOX_DEFAULT_FLOCK bool - default n + default y config BUSYBOX_DEFAULT_FDFLUSH bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 941e82835..8866756ae 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.27.2 -PKG_RELEASE:=1 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -20,9 +20,11 @@ PKG_HASH:=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 +PKG_INSTALL:=1 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE +PKG_CPE_ID:=cpe:/a:busybox:busybox include $(INCLUDE_DIR)/package.mk @@ -30,12 +32,6 @@ ifeq ($(DUMP),) STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5) endif -ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) - BB_MAKE_VERBOSE := V=1 -else - BB_MAKE_VERBOSE := -endif - BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) @@ -47,6 +43,7 @@ define Package/busybox URL:=http://busybox.net/ DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter MENU:=1 + PROVIDES:=ip ALTERNATIVES:=\ $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ @@ -74,59 +71,32 @@ endef # don't create a version string containing the actual timestamp export KCONFIG_NOTIMESTAMP=1 -define Build/Configure - rm -f $(PKG_BUILD_DIR)/.configured* - grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config - yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - ARCH="$(ARCH)" \ - $(BB_MAKE_VERBOSE) \ - oldconfig -endef LDLIBS:=m crypt +LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread) ifdef CONFIG_BUSYBOX_USE_LIBRPC - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) LDLIBS += rpc endif - -ifdef CONFIG_BUSYBOX_CONFIG_PAM - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) - LDLIBS += pam pam_misc pthread +ifeq ($(CONFIG_USE_GLIBC),y) + LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv) endif -ifdef CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE - ifeq ($(CONFIG_USE_GLIBC),y) - LDLIBS += resolv - endif +MAKE_VARS := +MAKE_FLAGS += \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ + LDLIBS="$(LDLIBS)" \ + SKIP_STRIP=y +ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) + MAKE_FLAGS += V=1 endif -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - SKIP_STRIP=y \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - all - rm -rf $(PKG_INSTALL_DIR) - $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \; - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - install +MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)" + + +define Build/Configure + grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config + yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig endef define Package/busybox/install diff --git a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch index 7fa06a68c..3741e25c3 100644 --- a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch +++ b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch @@ -1,7 +1,7 @@ --- a/networking/traceroute.c +++ b/networking/traceroute.c -@@ -239,8 +239,8 @@ - //config: Add option -I to use ICMP ECHO instead of UDP datagrams. +@@ -237,8 +237,8 @@ + //config: depends on TRACEROUTE || TRACEROUTE6 /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ -//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) diff --git a/package/utils/busybox/patches/600-cve-2017-16544.patch b/package/utils/busybox/patches/600-cve-2017-16544.patch new file mode 100644 index 000000000..3b142bdd6 --- /dev/null +++ b/package/utils/busybox/patches/600-cve-2017-16544.patch @@ -0,0 +1,35 @@ +From c3797d40a1c57352192c6106cc0f435e7d9c11e8 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Tue, 7 Nov 2017 18:09:29 +0100 +Subject: lineedit: do not tab-complete any strings which have control + characters + +function old new delta +add_match 41 68 +27 + +Signed-off-by: Denys Vlasenko +--- + libbb/lineedit.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -633,6 +633,18 @@ static void free_tab_completion_data(voi + + static void add_match(char *matched) + { ++ unsigned char *p = (unsigned char*)matched; ++ while (*p) { ++ /* ESC attack fix: drop any string with control chars */ ++ if (*p < ' ' ++ || (!ENABLE_UNICODE_SUPPORT && *p >= 0x7f) ++ || (ENABLE_UNICODE_SUPPORT && *p == 0x7f) ++ ) { ++ free(matched); ++ return; ++ } ++ p++; ++ } + matches = xrealloc_vector(matches, 4, num_matches); + matches[num_matches] = matched; + num_matches++; diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile index 62c255a90..4c8b360de 100644 --- a/package/utils/bzip2/Makefile +++ b/package/utils/bzip2/Makefile @@ -18,6 +18,7 @@ PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=BZIP2 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:bzip:bzip2 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index b10ba8a86..068ce3ede 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -8,13 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.5 -PKG_HASH:=261f3d9ade383fbf032a19140c9c25e998cc0f71a1ae686614fb3ae0eb955a17 +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs PKG_BUILD_DEPENDS:=util-linux PKG_INSTALL:=1 @@ -45,7 +46,7 @@ define Package/libext2fs $(call Package/e2fsprogs/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libuuid + DEPENDS:=+libuuid +libblkid TITLE:=ext2/3/4 filesystem library endef @@ -109,18 +110,17 @@ endef TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -CONFIGURE_VARS += \ - ac_cv_lib_pthread_sem_init=no - CONFIGURE_ARGS += \ --disable-testio-debug \ --enable-elf-shlibs \ --disable-libuuid \ - --enable-libblkid \ + --disable-libblkid \ --disable-uuidd \ --disable-tls \ --disable-nls \ - --disable-rpath + --disable-rpath \ + --disable-threads \ + --disable-fuse2fs define Build/Prepare $(call Build/Prepare/Default) @@ -139,7 +139,6 @@ define Build/Compile LDFLAGS=-Wl,--gc-sections \ BUILDCC="$(HOSTCC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ - LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \ ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \ SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \ V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 8a27c47ad..3e8bf63f0 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.8.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.9.0 +PKG_RELEASE:=1 PKG_LICENSE:=GPLv2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=d4dbecf55560c548bf0758c9f641d1beec1e960b38cbbc19951195d5144d39ae +PKG_HASH:=77217562ae7011a6d81b7b3c43c42623db1796a57596408d6c8037def70d6cc7 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -57,7 +57,8 @@ define Package/libf2fs endef CONFIGURE_ARGS += \ - --without-selinux + --without-selinux \ + --without-blkid CONFIGURE_VARS += \ ac_cv_file__git=no diff --git a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch b/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch deleted file mode 100644 index d4e25397a..000000000 --- a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 31873d5cdf8a97d5f7921451c54f6d293293c6cc Mon Sep 17 00:00:00 2001 -From: Jaegeuk Kim -Date: Wed, 23 Aug 2017 13:33:00 -0700 -Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version - -The error on mips was reported by Stijn as follow. - -Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools -("mkfs.f2fs: give random checkpoint version") causes a bug when mounting -a filesystem created with it on a MIPS64 device running a 4.4(.83) -kernel. The following kernel warning appears several times per second, -for 30 seconds: - -[ 23.837262] ------------[ cut here ]------------ -[ 23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718 -update_sit_entry+0x1c0/0x2b0() -[ 23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat -[ 24.174064] Call Trace: -[ 24.176527] [] show_stack+0x68/0xb4 -[ 24.181595] [] dump_stack+0x8c/0xc4 -[ 24.186660] [] warn_slowpath_common+0xa0/0xd0 -[ 24.192597] [] update_sit_entry+0x1c0/0x2b0 -[ 24.198353] [] refresh_sit_entry+0x70/0xf8 -[ 24.204022] [] allocate_data_block+0x1f0/0x310 -[ 24.210038] [] do_write_page+0x29c/0x2bc -[ 24.215532] [] write_data_page+0xa0/0xd8 -[ 24.221028] [] do_write_data_page+0xe4/0x384 -[ 24.226870] [] f2fs_write_data_page+0x208/0x464 -[ 24.232972] [] __f2fs_writepage+0x1c/0x74 -[ 24.238553] [] -f2fs_write_cache_pages.constprop.7+0x250/0x394 -[ 24.245869] [] f2fs_write_data_pages+0x130/0x1b0 -[ 24.252066] [] __filemap_fdatawrite_range+0xa0/0xd4 -[ 24.258515] [] sync_dirty_dir_inodes+0x94/0xd8 -[ 24.264530] [] write_checkpoint+0x108/0xb9c -[ 24.270283] [] f2fs_sync_fs+0x68/0xb0 -[ 24.275526] [] f2fs_sync_file+0x2e8/0x518 -[ 24.281107] [] do_fsync+0x38/0x70 -[ 24.285992] [] SyS_fsync+0x14/0x20 -[ 24.290972] [] syscall_common+0x34/0x58 -[ 24.296372] -[ 24.298096] ---[ end trace fd3ac44449b218ab ]--- - -Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version") -Reported-And-Tested-by: Stijn Tintel -Signed-off-by: Jaegeuk Kim ---- - mkfs/f2fs_format.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c -index 92876b8..b379e80 100644 ---- a/mkfs/f2fs_format.c -+++ b/mkfs/f2fs_format.c -@@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void) - } - - /* 1. cp page 1 of checkpoint pack 1 */ -- cp->checkpoint_ver = rand() | 0x1; -+ cp->checkpoint_ver = cpu_to_le64(rand() | 0x1); - set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]); - set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]); - set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]); --- -2.13.5 - diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index d0cefff1a..e853a8e04 100644 --- a/package/utils/fuse/Makefile +++ b/package/utils/fuse/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=832432d1ad4f833c20e13b57cf40ce5277a9d33e483205fc63c78111b3358874 PKG_LICENSE:=LGPLv2.1 GPLv2 PKG_LICENSE_FILES:=COPYING.LIB COPYING +PKG_CPE_ID:=cpe:/a:fuse_project:fuse PKG_INSTALL:=1 diff --git a/package/utils/k3screenctrl/Makefile b/package/utils/k3screenctrl/Makefile deleted file mode 100644 index 6f862cec0..000000000 --- a/package/utils/k3screenctrl/Makefile +++ /dev/null @@ -1,47 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=k3screenctrl -PKG_VERSION:=0.10 -PKG_RELEASE:=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/updateing/k3screenctrl.git -PKG_SOURCE_VERSION:=dd05ce9a5cb0cb6cebfc6b3b5823c7f6d75796ff -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) -PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) -PKG_MAINTAINER:=Hamster Tian - -include $(INCLUDE_DIR)/package.mk - -TARGET_CFLAGS+= -D_GNU_SOURCE - -define Package/k3screenctrl - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=@TARGET_bcm53xx_DEVICE_phicomm-k3 +@KERNEL_DEVMEM - TITLE:=LCD screen controller on PHICOMM K3 - URL:=https://github.com/updateing/k3-screen-ctrl -endef - -define Package/k3screenctrl/description - K3 Screen Controller (k3screenctrl) is a program utilizing -the LCD screen on PHICOMM K3 to display some stats. -endef - -define Package/k3screenctrl/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_DIR) $(1)/lib/k3screenctrl - $(INSTALL_DIR) $(1)/etc/init.d - - $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/k3screenctrl $(1)/usr/bin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wan.sh $(1)/lib/k3screenctrl/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wifi.sh $(1)/lib/k3screenctrl/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/port.sh $(1)/lib/k3screenctrl/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/basic.sh $(1)/lib/k3screenctrl/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/host.sh $(1)/lib/k3screenctrl/ - - $(INSTALL_BIN) ./files/k3screenctrl.init $(1)/etc/init.d/k3screenctrl -endef - -$(eval $(call BuildPackage,k3screenctrl)) diff --git a/package/utils/k3screenctrl/files/k3screenctrl.init b/package/utils/k3screenctrl/files/k3screenctrl.init deleted file mode 100755 index 5d3d190a2..000000000 --- a/package/utils/k3screenctrl/files/k3screenctrl.init +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 -STOP=99 - -SCRIPTS_BASE=/lib/k3screenctrl/ - -start() { - /usr/bin/k3screenctrl & -} - -stop() { - killall k3screenctrl -} diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch index 74b8c6f8f..ac0722c70 100644 --- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch +++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch @@ -62,7 +62,7 @@ return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; } -@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, +@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, } @@ -77,7 +77,7 @@ LUA_API int lua_isstring (lua_State *L, int idx) { int t = lua_type(L, idx); return (t == LUA_TSTRING || t == LUA_TNUMBER); -@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, +@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, } @@ -162,7 +162,7 @@ case LUA_TNUMBER: { size_t l; lua_lock(L); /* `luaV_tostring' may create a new string */ -@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) +@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) } @@ -196,7 +196,7 @@ LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { -@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, +@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, lua_lock(L); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -205,7 +205,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State +@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State case LUA_TUSERDATA: mt = uvalue(obj)->metatable; break; @@ -215,7 +215,7 @@ default: mt = G(L)->mt[ttype(obj)]; break; -@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, +@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, api_checknelems(L, 1); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -224,7 +224,7 @@ luaC_barriert(L, hvalue(o), L->top-1); L->top--; lua_unlock(L); -@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State +@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State break; } default: { @@ -286,7 +286,7 @@ #define FREELIST_REF 0 /* free list of references */ -@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State +@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State static void tag_error (lua_State *L, int narg, int tag) { @@ -351,7 +351,7 @@ -@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) +@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) int base = luaL_optint(L, 2, 10); if (base == 10) { /* standard conversion */ luaL_checkany(L, 1); @@ -503,7 +503,7 @@ case VKNUM: case VTRUE: case VFALSE: -@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc +@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ e->u.s.info = (e->k == VNIL) ? nilK(fs) : (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : @@ -896,7 +896,7 @@ lua_assert(isdigit(ls->current)); do { save_and_next(ls); -@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, +@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, save_and_next(ls); save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ @@ -1009,6 +1009,7 @@ -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - +- +#ifdef LNUM_FLOAT +# define PI (3.14159265358979323846F) +#elif defined(M_PI) @@ -1017,7 +1018,7 @@ +# define PI (3.14159265358979323846264338327950288) +#endif +#define RADIANS_PER_DEGREE (PI/180) - ++ +#undef HUGE +#ifdef LNUM_FLOAT +# define HUGE HUGE_VALF @@ -2103,7 +2104,7 @@ case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ case LUA_TLIGHTUSERDATA: -@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, +@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, } } @@ -2606,7 +2607,7 @@ nums[ceillog2(k)]++; /* count as such */ return 1; } -@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table +@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table /* re-insert elements from vanishing slice */ for (i=nasize; iarray[i])) @@ -2650,7 +2651,7 @@ } while (n); return luaO_nilobject; } -@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const +@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const switch (ttype(key)) { case LUA_TNIL: return luaO_nilobject; case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); @@ -3061,7 +3062,7 @@ /* @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. ** CHANGE it if your system requires alignments larger than double. (For -@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; +@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; #define luai_userstateyield(L,n) ((void)L) @@ -3092,7 +3093,7 @@ /* --- a/src/lundump.c +++ b/src/lundump.c -@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* +@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* return x; } @@ -3106,7 +3107,7 @@ static TString* LoadString(LoadState* S) { size_t size; -@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, +@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; @@ -3198,7 +3199,7 @@ setsvalue2s(L, obj, luaS_new(L, s)); return 1; } -@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, +@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, } @@ -3421,10 +3422,10 @@ + case TM_POW: if (try_powint( ri, ib, ic)) return; break; + case TM_UNM: if (try_unmint( ri, ib)) return; break; + default: lua_assert(0); -+ } + } + } + /* Fallback to floating point, when leaving range. */ -+ + +#ifdef LNUM_COMPLEX + if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) { + lua_Complex r; @@ -3444,7 +3445,7 @@ + default: lua_assert(0); r=0; + } + setnvalue_complex( ra, r ); - } ++ } + return; + } +#endif @@ -3465,7 +3466,7 @@ + if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} - ++ +/* Helper macro to sort arithmetic operations into four categories: + * TK_INT: integer - integer operands + * TK_NUMBER: number - number (non complex, either may be integer) diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch index 937fc137e..3d3d6850e 100644 --- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch +++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch @@ -1,6 +1,6 @@ --- a/src/lvm.c +++ b/src/lvm.c -@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T +@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T else return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) ); @@ -10,7 +10,7 @@ return res; return luaG_ordererror(L, l, r); -@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons +@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons else return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) ); diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch index bcd410f69..64f683ddb 100644 --- a/package/utils/lua/patches/020-shared_liblua.patch +++ b/package/utils/lua/patches/020-shared_liblua.patch @@ -21,7 +21,7 @@ ranlib: --- a/src/ldo.h +++ b/src/ldo.h -@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, +@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch index dd6579148..d221c4ee9 100644 --- a/package/utils/lua/patches/050-honor-cflags.patch +++ b/package/utils/lua/patches/050-honor-cflags.patch @@ -8,4 +8,4 @@ + $(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $? ln -fs $@.$(PKG_VERSION) $@ - + $(LUA_T): $(LUA_O) $(LUA_SO) diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch index 5fbb87388..b971e0975 100644 --- a/package/utils/lua/patches/300-opcode_performance.patch +++ b/package/utils/lua/patches/300-opcode_performance.patch @@ -10,7 +10,7 @@ /* * If 'obj' is a string, it is tried to be interpreted as a number. -@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal +@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal ARITH_OP1_END #endif @@ -74,7 +74,7 @@ reentry: /* entry point */ lua_assert(isLua(L->ci)); pc = L->savedpc; -@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex +@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex lua_assert(base == L->base && L->base == L->ci->base); lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); @@ -115,7 +115,7 @@ TValue g; TValue *rb = KBx(i); sethvalue(L, &g, cl->env); -@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex +@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex Protect(luaV_gettable(L, &g, rb, ra)); continue; } @@ -219,7 +219,7 @@ const TValue *rb = RB(i); switch (ttype(rb)) { case LUA_TTABLE: { -@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex +@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -241,7 +241,7 @@ TValue *rb = RKB(i); TValue *rc = RKC(i); Protect( -@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex +@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -250,7 +250,7 @@ Protect( if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex +@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -259,7 +259,7 @@ Protect( if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex +@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -275,7 +275,7 @@ TValue *rb = RB(i); if (l_isfalse(rb) != GETARG_C(i)) { setobjs2s(L, ra, rb); -@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex +@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -284,7 +284,7 @@ int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ -@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex +@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -293,7 +293,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b; /* else previous instruction set top */ L->savedpc = pc; -@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex +@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -302,7 +302,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); -@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex +@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex goto reentry; } } @@ -311,7 +311,7 @@ /* If start,step and limit are all integers, we don't need to check * against overflow in the looping. */ -@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex +@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -320,7 +320,7 @@ const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; -@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex +@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex dojump(L, pc, GETARG_sBx(i)); continue; } @@ -329,7 +329,7 @@ StkId cb = ra + 3; /* call base */ setobjs2s(L, cb+2, ra+2); setobjs2s(L, cb+1, ra+1); -@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex +@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -338,7 +338,7 @@ int n = GETARG_B(i); int c = GETARG_C(i); int last; -@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex +@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -352,7 +352,7 @@ Proto *p; Closure *ncl; int nup, j; -@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex +@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex Protect(luaC_checkGC(L)); continue; } diff --git a/package/utils/mdadm/Makefile b/package/utils/mdadm/Makefile index 1ed62d817..2b44db284 100644 --- a/package/utils/mdadm/Makefile +++ b/package/utils/mdadm/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mdadm PKG_VERSION:=4.0 -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_URL:=@KERNEL/linux/utils/raid/mdadm PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -32,26 +32,29 @@ endef define Package/mdadm/description A tool for managing Linux Software RAID arrays. - RAID 0, 1 and 10 support included. - If you need RAID 4,5 or 6 functionality please + RAID 0, 1 and 10 support included. + If you need RAID 4,5 or 6 functionality please install kmod-md-raid456 . endef define Package/mdadm/conffiles -/etc/mdadm.conf /etc/config/mdadm endef -TARGET_CFLAGS += -ffunction-sections -fdata-sections -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS +TARGET_CFLAGS += \ + -ffunction-sections -fdata-sections \ + -DHAVE_STDINT_H -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS \ + -DCONFFILE='\"/var/etc/mdadm.conf\"' \ + -DMAP_DIR='\"/var/run/mdadm\"' \ + -DMDMON_DIR='\"/var/run/mdadm\"' \ + -DFAILED_SLOTS_DIR='\"/var/run/mdadm/failed-slots\"' + TARGET_LDFLAGS += -Wl,--gc-sections +MAKE_VARS += CHECK_RUN_DIR=0 + define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CFLAGS="$(TARGET_CFLAGS) -DHAVE_STDINT_H" \ - LDFLAGS="$(TARGET_LDFLAGS)" \ - CHECK_RUN_DIR=0 \ - mdadm + $(call Build/Compile/Default,mdadm) endef define Package/mdadm/install diff --git a/package/utils/mdadm/files/mdadm.init b/package/utils/mdadm/files/mdadm.init index e6624a776..64a50b35d 100644 --- a/package/utils/mdadm/files/mdadm.init +++ b/package/utils/mdadm/files/mdadm.init @@ -34,14 +34,13 @@ mdadm_common() { local cfg="$1" local email devices - if [ -x /sbin/sendmail ]; then - append_option email "$cfg" email "MAILADDR" - + if [ -x /usr/sbin/sendmail ]; then + config_get email "$cfg" email + [ -n "$email" ] && printf "MAILADDR %s\n" "$email" >> $CONF fi - append_option devices "$cfg" devices DEVICE " " - - printf "%s\n%s\n" "$email" "$devices" >> $CONF + config_list_foreach "$cfg" devices append_list_item devices " " + [ -n "$devices" ] && printf "DEVICE %s\n" "$devices" >> $CONF } mdadm_array() { diff --git a/package/utils/nvram/src/nvram.c b/package/utils/nvram/src/nvram.c index ca8939210..d5e12ee69 100644 --- a/package/utils/nvram/src/nvram.c +++ b/package/utils/nvram/src/nvram.c @@ -47,6 +47,8 @@ static void _nvram_free(nvram_handle_t *h) for (i = 0; i < NVRAM_ARRAYSIZE(h->nvram_hash); i++) { for (t = h->nvram_hash[i]; t; t = next) { next = t->next; + if (t->value) + free(t->value); free(t); } h->nvram_hash[i] = NULL; @@ -55,6 +57,8 @@ static void _nvram_free(nvram_handle_t *h) /* Free dead table */ for (t = h->nvram_dead; t; t = next) { next = t->next; + if (t->value) + free(t->value); free(t); } diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 101a31004..223e032f2 100644 --- a/package/utils/otrx/src/otrx.c +++ b/package/utils/otrx/src/otrx.c @@ -1,7 +1,7 @@ /* * otrx * - * Copyright (C) 2015 Rafał Miłecki + * Copyright (C) 2015-2017 Rafał Miłecki * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -124,9 +124,7 @@ static const uint32_t crc32_tbl[] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -uint32_t otrx_crc32(uint8_t *buf, size_t len) { - uint32_t crc = 0xffffffff; - +uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { while (len) { crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); buf++; @@ -158,7 +156,6 @@ static int otrx_check(int argc, char **argv) { size_t bytes, length; uint8_t buf[1024]; uint32_t crc32; - int i; int err = 0; if (argc < 3) { @@ -203,8 +200,7 @@ static int otrx_check(int argc, char **argv) { fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); length -= TRX_FLAGS_OFFSET; while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { - for (i = 0; i < bytes; i++) - crc32 = crc32_tbl[(crc32 ^ buf[i]) & 0xff] ^ (crc32 >> 8); + crc32 = otrx_crc32(crc32, buf, bytes); length -= bytes; } @@ -232,14 +228,11 @@ out: * Create **************************************************/ -static void otrx_create_parse_options(int argc, char **argv) { -} - static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { FILE *in; size_t bytes; ssize_t length = 0; - uint8_t buf[128]; + uint8_t buf[1024]; in = fopen(in_path, "r"); if (!in) { @@ -271,9 +264,12 @@ static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { if (fwrite(buf, 1, length, trx) != length) { fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); + free(buf); return -EIO; } + free(buf); + return length; } @@ -288,7 +284,7 @@ static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { size_t bytes, length; - uint8_t *buf; + uint8_t buf[1024]; uint32_t crc32; hdr->magic = cpu_to_le32(TRX_MAGIC); @@ -303,20 +299,13 @@ static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { length = le32_to_cpu(hdr->length); - buf = malloc(length); - if (!buf) { - fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); - return -ENOMEM; + crc32 = 0xffffffff; + fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; } - - fseek(trx, 0, SEEK_SET); - bytes = fread(buf, 1, length, trx); - if (bytes != length) { - fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); - return -ENOMEM; - } - - crc32 = otrx_crc32(buf + TRX_FLAGS_OFFSET, length - TRX_FLAGS_OFFSET); hdr->crc32 = cpu_to_le32(crc32); fseek(trx, 0, SEEK_SET); @@ -345,9 +334,6 @@ static int otrx_create(int argc, char **argv) { } trx_path = argv[2]; - optind = 3; - otrx_create_parse_options(argc, argv); - trx = fopen(trx_path, "w+"); if (!trx) { fprintf(stderr, "Couldn't open %s\n", trx_path); @@ -357,7 +343,7 @@ static int otrx_create(int argc, char **argv) { fseek(trx, curr_offset, SEEK_SET); optind = 3; - while ((c = getopt(argc, argv, "f:b:")) != -1) { + while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { switch (c) { case 'f': if (curr_idx >= TRX_MAX_PARTS) { @@ -381,6 +367,27 @@ static int otrx_create(int argc, char **argv) { curr_offset += sbytes; break; + case 'A': + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'a': + sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; case 'b': sbytes = strtol(optarg, NULL, 0) - curr_offset; if (sbytes < 0) { @@ -398,6 +405,12 @@ static int otrx_create(int argc, char **argv) { break; } + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + hdr.length = curr_offset; otrx_create_write_hdr(trx, &hdr); err_close: @@ -552,6 +565,8 @@ static void usage() { printf("Creating new TRX file:\n"); printf("\totrx create [options] [partitions]\n"); printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); + printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); + printf("\t-a alignment\t\t\t[partition] align current partition\n"); printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); printf("\n"); printf("Extracting from TRX file:\n"); diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index 1b1ef147b..2560f1c40 100644 --- a/package/utils/usbmode/Makefile +++ b/package/utils/usbmode/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git -PKG_SOURCE_DATE:=2017-05-24 -PKG_SOURCE_VERSION:=453da8e540b1c53d357b897d6c70372cd4633390 -PKG_MIRROR_HASH:=b4a7132b940192f2e9a74bd890bd7008ede701e1d52284c3ade0cdc7d663929f +PKG_SOURCE_DATE:=2017-12-19 +PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26 +PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/utils/usbutils/Makefile b/package/utils/usbutils/Makefile index 29b1f85e1..7f798954a 100644 --- a/package/utils/usbutils/Makefile +++ b/package/utils/usbutils/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbutils PKG_VERSION:=007 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/usb/usbutils @@ -32,13 +32,13 @@ define Package/usbutils URL:=http://www.linux-usb.org/ endef -USB_IDS_REV:=ae25707c751fff79148328229a76fc44232abeae +USB_IDS_REV:=0a6be488b4c1485d30c9efee1cc895af5d4a1383 USB_IDS_FILE:=usb.ids.$(USB_IDS_REV) define Download/usb_ids FILE:=$(USB_IDS_FILE) URL_FILE:=usb.ids - URL:=@GITHUB/gentoo/hwids/ae25707c751fff79148328229a76fc44232abeae - HASH:=eca5d4b4b2c72e61d5d6d67b5dc6f75e92b4ac9cf9cdf1344f06622e0f57d82f + URL:=@GITHUB/gentoo/hwids/$(USB_IDS_REV) + HASH:=2d0403ffccc0ff7150e32c0bf8e2878816b76ba08d2c3bb1059f33627a3da30f endef $(eval $(call Download,usb_ids)) diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 9ab5bfa6f..88cb31477 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.30.1 -PKG_RELEASE:=2 +PKG_VERSION:=2.30.2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.30 -PKG_HASH:=1be4363a91ac428c9e43fc04dc6d2c66a19ec1e36f1105bd4b481540be13b841 +PKG_HASH:=7b5be5489e9b5b7177832836467aba1c87bf0e9bcbcb5a6f35d76cd4782589dc +PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= COPYING \ diff --git a/package/utils/util-linux/patches/100-use_urandom.patch b/package/utils/util-linux/patches/100-use_urandom.patch new file mode 100644 index 000000000..848f2f40c --- /dev/null +++ b/package/utils/util-linux/patches/100-use_urandom.patch @@ -0,0 +1,14 @@ +--- a/lib/randutils.c ++++ b/lib/randutils.c +@@ -25,6 +25,11 @@ + #define THREAD_LOCAL static + #endif + ++/* force /dev/urandom to avoid hanging on early boot */ ++#undef HAVE_GETRANDOM ++#undef SYS_getrandom ++#undef __NR_getrandom ++ + #ifdef HAVE_GETRANDOM + # include + #elif defined (__linux__) diff --git a/package/utils/xfsprogs/Makefile b/package/utils/xfsprogs/Makefile index 486ded72d..5cf1da240 100644 --- a/package/utils/xfsprogs/Makefile +++ b/package/utils/xfsprogs/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfsprogs +PKG_CPE_ID:=cpe:/a:sgi:xfsprogs PKG_RELEASE:=1 PKG_VERSION:=4.11.0 PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs diff --git a/rules.mk b/rules.mk index ed796a540..3558f2f02 100644 --- a/rules.mk +++ b/rules.mk @@ -21,6 +21,7 @@ DUMP:=1 endif export TMP_DIR:=$(TOPDIR)/tmp +export TMPDIR:=$(TMP_DIR) qstrip=$(strip $(subst ",,$(1))) #")) diff --git a/scripts/brcmImage.pl b/scripts/brcmImage.pl index aab86d6d9..60a59f2bf 100755 --- a/scripts/brcmImage.pl +++ b/scripts/brcmImage.pl @@ -33,7 +33,7 @@ use Compress::Zlib; my $version = "0.1"; my %arg = ( o => 'bcm963xx_fs_kernel', - b => 'LEDE', + b => 'OpenWrt', c => '6348', s => 64, f => 0xbfc00000, diff --git a/scripts/config/.gitignore b/scripts/config/.gitignore index 0326e060b..1206e5022 100644 --- a/scripts/config/.gitignore +++ b/scripts/config/.gitignore @@ -7,3 +7,9 @@ mconf* !mconf*.h mconf_check *.*.c +qconf* +qconf*.moc +!qconf*.cc +!qconf*.h +!images*.c +.tmp_qtcheck diff --git a/scripts/config/Makefile b/scripts/config/Makefile index 3de98082b..962027320 100644 --- a/scripts/config/Makefile +++ b/scripts/config/Makefile @@ -7,6 +7,8 @@ # conf: Used for defconfig, oldconfig and related targets # mconf: Used for the mconfig target. # Utilizes the lxdialog package +# qconf: Used for the xconfig target +# Based on Qt which needs to be installed to compile it # object files used by all kconfig flavours @@ -16,20 +18,35 @@ check_lxdialog = $(shell $(SHELL) $(CURDIR)/lxdialog/check-lxdialog.sh -$(1)) export CFLAGS += -DKBUILD_NO_NLS -I. $(call check_lxdialog,ccflags) +export CXXFLAGS += -DKBUILD_NO_NLS + +DISTRO-PKG-CONFIG := $(shell which -a pkg-config | grep -E '\/usr' | head -n 1) conf-objs := conf.o zconf.tab.o mconf-objs := mconf.o zconf.tab.o +qconf-cxxobjs := qconf.o +qconf-objs := zconf.tab.o + lxdialog-objs := \ lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o \ lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o clean-files := zconf.tab.c lex.zconf.c zconf.hash.c +# Remove qconf junk files +clean-files += $(qconf-cxxobjs) qconf.moc .tmp_qtcheck all: conf mconf conf: $(conf-objs) mconf: $(mconf-objs) $(lxdialog-objs) $(CC) -o $@ $^ $(call check_lxdialog,ldflags $(CC)) +qconf: $(qconf-cxxobjs) $(qconf-objs) +ifneq ($(DISTRO-PKG-CONFIG),) + $(CXX) $(HOSTLOADLIBES_qconf) -o $@ $^ +else + echo "You don't have 'pkg-config' installed. Cannot continue" + echo "For now, you may use 'make menuconfig' instead of 'make xconfig'" +endif clean: rm -f *.o lxdialog/*.o $(clean-files) conf mconf @@ -50,3 +67,43 @@ zconf.hash.c: zconf.gperf %.hash.c: %.gperf cp $@_shipped $@ || gperf < $< > $@ + +ifeq ($(MAKECMDGOALS),qconf) +qconf.o: .tmp_qtcheck +.tmp_qtcheck: Makefile +-include .tmp_qtcheck + +# Qt needs some extra effort... +.tmp_qtcheck: + @set -e; echo " CHECK qt"; \ + if $(DISTRO-PKG-CONFIG) --exists Qt5Core; then \ + cflags="-std=c++11 -fPIC `$(DISTRO-PKG-CONFIG) --cflags Qt5Core Qt5Gui Qt5Widgets`"; \ + libs=`$(DISTRO-PKG-CONFIG) --libs Qt5Core Qt5Gui Qt5Widgets`; \ + moc=`$(DISTRO-PKG-CONFIG) --variable=host_bins Qt5Core`/moc; \ + elif $(DISTRO-PKG-CONFIG) --exists QtCore; then \ + cflags=`$(DISTRO-PKG-CONFIG) --cflags QtCore QtGui`; \ + libs=`$(DISTRO-PKG-CONFIG) --libs QtCore QtGui`; \ + moc=`$(DISTRO-PKG-CONFIG) --variable=moc_location QtCore`; \ + else \ + echo >&2 "*"; \ + echo >&2 "* Could not find Qt via $(DISTRO-PKG-CONFIG)."; \ + echo >&2 "* Please install either Qt 4.8 or 5.x. and make sure it's in PKG_CONFIG_PATH"; \ + echo >&2 "*"; \ + exit 1; \ + fi; \ + echo "KC_QT_CFLAGS=$$cflags" > $@; \ + echo "KC_QT_LIBS=$$libs" >> $@; \ + echo "KC_QT_MOC=$$moc" >> $@ +endif + +#Define compiler flags to build qconf +HOSTLOADLIBES_qconf = $(KC_QT_LIBS) +HOSTCXXFLAGS_qconf.o = $(KC_QT_CFLAGS) + +qconf.o: qconf.moc +qconf.o: CXXFLAGS+=$(HOSTCXXFLAGS_qconf.o) + +moc = $(KC_QT_MOC) -i $< -o $@ + +%.moc: %.h .tmp_qtcheck + $(call moc) diff --git a/scripts/config/images.c b/scripts/config/images.c new file mode 100644 index 000000000..d4f84bd4a --- /dev/null +++ b/scripts/config/images.c @@ -0,0 +1,326 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +static const char *xpm_load[] = { +"22 22 5 1", +". c None", +"# c #000000", +"c c #838100", +"a c #ffff00", +"b c #ffffff", +"......................", +"......................", +"......................", +"............####....#.", +"...........#....##.##.", +"..................###.", +".................####.", +".####...........#####.", +"#abab##########.......", +"#babababababab#.......", +"#ababababababa#.......", +"#babababababab#.......", +"#ababab###############", +"#babab##cccccccccccc##", +"#abab##cccccccccccc##.", +"#bab##cccccccccccc##..", +"#ab##cccccccccccc##...", +"#b##cccccccccccc##....", +"###cccccccccccc##.....", +"##cccccccccccc##......", +"###############.......", +"......................"}; + +static const char *xpm_save[] = { +"22 22 5 1", +". c None", +"# c #000000", +"a c #838100", +"b c #c5c2c5", +"c c #cdb6d5", +"......................", +".####################.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbbbb#bb#.", +".#aa#bbbbbbbbbcbb####.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbccbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aa#bbbbbbbbbbbb#aa#.", +".#aaa############aaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaaaaaaaaaaaaaaaaa#.", +".#aaa#############aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +".#aaa#########bbb#aa#.", +"..##################..", +"......................"}; + +static const char *xpm_back[] = { +"22 22 3 1", +". c None", +"# c #000083", +"a c #838183", +"......................", +"......................", +"......................", +"......................", +"......................", +"...........######a....", +"..#......##########...", +"..##...####......##a..", +"..###.###.........##..", +"..######..........##..", +"..#####...........##..", +"..######..........##..", +"..#######.........##..", +"..########.......##a..", +"...............a###...", +"...............###....", +"......................", +"......................", +"......................", +"......................", +"......................", +"......................"}; + +static const char *xpm_tree_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......#...............", +"......########........", +"......................", +"......................"}; + +static const char *xpm_single_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"..........#...........", +"......................", +"......................"}; + +static const char *xpm_split_view[] = { +"22 22 2 1", +". c None", +"# c #000000", +"......................", +"......................", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......#......#........", +"......................", +"......................"}; + +static const char *xpm_symbol_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_mod[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_symbol_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . . ", +" . . . ", +" . .. . ", +" . . .. . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_choice_no[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_choice_yes[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .... ", +" .. .. ", +" . . ", +" . .. . ", +" . .... . ", +" . .... . ", +" . .. . ", +" . . ", +" .. .. ", +" .... ", +" "}; + +static const char *xpm_menu[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_menu_inv[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" .......... ", +" .. ...... ", +" .. .... ", +" .. .. ", +" .. .. ", +" .. .... ", +" .. ...... ", +" .......... ", +" .......... ", +" "}; + +static const char *xpm_menuback[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" .......... ", +" . . ", +" . .. . ", +" . .... . ", +" . ...... . ", +" . ...... . ", +" . .... . ", +" . .. . ", +" . . ", +" .......... ", +" "}; + +static const char *xpm_void[] = { +"12 12 2 1", +" c white", +". c black", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/scripts/config/qconf.cc b/scripts/config/qconf.cc new file mode 100644 index 000000000..fc5555992 --- /dev/null +++ b/scripts/config/qconf.cc @@ -0,0 +1,1870 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Copyright (C) 2015 Boris Barbulovski + * Released under the terms of the GNU GPL v2.0. + */ + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "lkc.h" +#include "qconf.h" + +#include "qconf.moc" +#include "images.c" + +#ifdef _ +# undef _ +# define _ qgettext +#endif + +static QApplication *configApp; +static ConfigSettings *configSettings; + +QAction *ConfigMainWindow::saveAction; + +static inline QString qgettext(const char* str) +{ + return QString::fromLocal8Bit(gettext(str)); +} + +static inline QString qgettext(const QString& str) +{ + return QString::fromLocal8Bit(gettext(str.toLatin1())); +} + +ConfigSettings::ConfigSettings() + : QSettings("kernel.org", "qconf") +{ +} + +/** + * Reads a list of integer values from the application settings. + */ +QList ConfigSettings::readSizes(const QString& key, bool *ok) +{ + QList result; + QStringList entryList = value(key).toStringList(); + QStringList::Iterator it; + + for (it = entryList.begin(); it != entryList.end(); ++it) + result.push_back((*it).toInt()); + + return result; +} + +/** + * Writes a list of integer values to the application settings. + */ +bool ConfigSettings::writeSizes(const QString& key, const QList& value) +{ + QStringList stringList; + QList::ConstIterator it; + + for (it = value.begin(); it != value.end(); ++it) + stringList.push_back(QString::number(*it)); + setValue(key, stringList); + + return true; +} + + +/* + * set the new data + * TODO check the value + */ +void ConfigItem::okRename(int col) +{ +} + +/* + * update the displayed of a menu entry + */ +void ConfigItem::updateMenu(void) +{ + ConfigList* list; + struct symbol* sym; + struct property *prop; + QString prompt; + int type; + tristate expr; + + list = listView(); + if (goParent) { + setPixmap(promptColIdx, list->menuBackPix); + prompt = ".."; + goto set_prompt; + } + + sym = menu->sym; + prop = menu->prompt; + prompt = _(menu_get_prompt(menu)); + + if (prop) switch (prop->type) { + case P_MENU: + if (list->mode == singleMode || list->mode == symbolMode) { + /* a menuconfig entry is displayed differently + * depending whether it's at the view root or a child. + */ + if (sym && list->rootEntry == menu) + break; + setPixmap(promptColIdx, list->menuPix); + } else { + if (sym) + break; + setPixmap(promptColIdx, QIcon()); + } + goto set_prompt; + case P_COMMENT: + setPixmap(promptColIdx, QIcon()); + goto set_prompt; + default: + ; + } + if (!sym) + goto set_prompt; + + setText(nameColIdx, QString::fromLocal8Bit(sym->name)); + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + char ch; + + if (!sym_is_changable(sym) && list->optMode == normalOpt) { + setPixmap(promptColIdx, QIcon()); + setText(noColIdx, QString::null); + setText(modColIdx, QString::null); + setText(yesColIdx, QString::null); + break; + } + expr = sym_get_tristate_value(sym); + switch (expr) { + case yes: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceYesPix); + else + setPixmap(promptColIdx, list->symbolYesPix); + setText(yesColIdx, "Y"); + ch = 'Y'; + break; + case mod: + setPixmap(promptColIdx, list->symbolModPix); + setText(modColIdx, "M"); + ch = 'M'; + break; + default: + if (sym_is_choice_value(sym) && type == S_BOOLEAN) + setPixmap(promptColIdx, list->choiceNoPix); + else + setPixmap(promptColIdx, list->symbolNoPix); + setText(noColIdx, "N"); + ch = 'N'; + break; + } + if (expr != no) + setText(noColIdx, sym_tristate_within_range(sym, no) ? "_" : 0); + if (expr != mod) + setText(modColIdx, sym_tristate_within_range(sym, mod) ? "_" : 0); + if (expr != yes) + setText(yesColIdx, sym_tristate_within_range(sym, yes) ? "_" : 0); + + setText(dataColIdx, QChar(ch)); + break; + case S_INT: + case S_HEX: + case S_STRING: + const char* data; + + data = sym_get_string_value(sym); + + setText(dataColIdx, data); + if (type == S_STRING) + prompt = QString("%1: %2").arg(prompt).arg(data); + else + prompt = QString("(%2) %1").arg(prompt).arg(data); + break; + } + if (!sym_has_value(sym) && visible) + prompt += _(" (NEW)"); +set_prompt: + setText(promptColIdx, prompt); +} + +void ConfigItem::testUpdateMenu(bool v) +{ + ConfigItem* i; + + visible = v; + if (!menu) + return; + + sym_calc_value(menu->sym); + if (menu->flags & MENU_CHANGED) { + /* the menu entry changed, so update all list items */ + menu->flags &= ~MENU_CHANGED; + for (i = (ConfigItem*)menu->data; i; i = i->nextItem) + i->updateMenu(); + } else if (listView()->updateAll) + updateMenu(); +} + + +/* + * construct a menu entry + */ +void ConfigItem::init(void) +{ + if (menu) { + ConfigList* list = listView(); + nextItem = (ConfigItem*)menu->data; + menu->data = this; + + if (list->mode != fullMode) + setExpanded(true); + sym_calc_value(menu->sym); + } + updateMenu(); +} + +/* + * destruct a menu entry + */ +ConfigItem::~ConfigItem(void) +{ + if (menu) { + ConfigItem** ip = (ConfigItem**)&menu->data; + for (; *ip; ip = &(*ip)->nextItem) { + if (*ip == this) { + *ip = nextItem; + break; + } + } + } +} + +ConfigLineEdit::ConfigLineEdit(ConfigView* parent) + : Parent(parent) +{ + connect(this, SIGNAL(editingFinished()), SLOT(hide())); +} + +void ConfigLineEdit::show(ConfigItem* i) +{ + item = i; + if (sym_get_string_value(item->menu->sym)) + setText(QString::fromLocal8Bit(sym_get_string_value(item->menu->sym))); + else + setText(QString::null); + Parent::show(); + setFocus(); +} + +void ConfigLineEdit::keyPressEvent(QKeyEvent* e) +{ + switch (e->key()) { + case Qt::Key_Escape: + break; + case Qt::Key_Return: + case Qt::Key_Enter: + sym_set_string_value(item->menu->sym, text().toLatin1()); + parent()->updateList(item); + break; + default: + Parent::keyPressEvent(e); + return; + } + e->accept(); + parent()->list->setFocus(); + hide(); +} + +ConfigList::ConfigList(ConfigView* p, const char *name) + : Parent(p), + updateAll(false), + symbolYesPix(xpm_symbol_yes), symbolModPix(xpm_symbol_mod), symbolNoPix(xpm_symbol_no), + choiceYesPix(xpm_choice_yes), choiceNoPix(xpm_choice_no), + menuPix(xpm_menu), menuInvPix(xpm_menu_inv), menuBackPix(xpm_menuback), voidPix(xpm_void), + showName(false), showRange(false), showData(false), mode(singleMode), optMode(normalOpt), + rootEntry(0), headerPopup(0) +{ + int i; + + setObjectName(name); + setSortingEnabled(false); + setRootIsDecorated(true); + + setVerticalScrollMode(ScrollPerPixel); + setHorizontalScrollMode(ScrollPerPixel); + + setHeaderLabels(QStringList() << _("Option") << _("Name") << "N" << "M" << "Y" << _("Value")); + + connect(this, SIGNAL(itemSelectionChanged(void)), + SLOT(updateSelection(void))); + + if (name) { + configSettings->beginGroup(name); + showName = configSettings->value("/showName", false).toBool(); + showRange = configSettings->value("/showRange", false).toBool(); + showData = configSettings->value("/showData", false).toBool(); + optMode = (enum optionMode)configSettings->value("/optionMode", 0).toInt(); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } + + addColumn(promptColIdx); + + reinit(); +} + +bool ConfigList::menuSkip(struct menu *menu) +{ + if (optMode == normalOpt && menu_is_visible(menu)) + return false; + if (optMode == promptOpt && menu_has_prompt(menu)) + return false; + if (optMode == allOpt) + return false; + return true; +} + +void ConfigList::reinit(void) +{ + removeColumn(dataColIdx); + removeColumn(yesColIdx); + removeColumn(modColIdx); + removeColumn(noColIdx); + removeColumn(nameColIdx); + + if (showName) + addColumn(nameColIdx); + if (showRange) { + addColumn(noColIdx); + addColumn(modColIdx); + addColumn(yesColIdx); + } + if (showData) + addColumn(dataColIdx); + + updateListAll(); +} + +void ConfigList::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/showName", showName); + configSettings->setValue("/showRange", showRange); + configSettings->setValue("/showData", showData); + configSettings->setValue("/optionMode", (int)optMode); + configSettings->endGroup(); + } +} + +ConfigItem* ConfigList::findConfigItem(struct menu *menu) +{ + ConfigItem* item = (ConfigItem*)menu->data; + + for (; item; item = item->nextItem) { + if (this == item->listView()) + break; + } + + return item; +} + +void ConfigList::updateSelection(void) +{ + struct menu *menu; + enum prop_type type; + + if (selectedItems().count() == 0) + return; + + ConfigItem* item = (ConfigItem*)selectedItems().first(); + if (!item) + return; + + menu = item->menu; + emit menuChanged(menu); + if (!menu) + return; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (mode == menuMode && type == P_MENU) + emit menuSelected(menu); +} + +void ConfigList::updateList(ConfigItem* item) +{ + ConfigItem* last = 0; + + if (!rootEntry) { + if (mode != listMode) + goto update; + QTreeWidgetItemIterator it(this); + ConfigItem* item; + + while (*it) { + item = (ConfigItem*)(*it); + if (!item->menu) + continue; + item->testUpdateMenu(menu_is_visible(item->menu)); + + ++it; + } + return; + } + + if (rootEntry != &rootmenu && (mode == singleMode || + (mode == symbolMode && rootEntry->parent != &rootmenu))) { + item = (ConfigItem *)topLevelItem(0); + if (!item) + item = new ConfigItem(this, 0, true); + last = item; + } + if ((mode == singleMode || (mode == symbolMode && !(rootEntry->flags & MENU_ROOT))) && + rootEntry->sym && rootEntry->prompt) { + item = last ? last->nextSibling() : firstChild(); + if (!item) + item = new ConfigItem(this, last, rootEntry, true); + else + item->testUpdateMenu(true); + + updateMenuList(item, rootEntry); + update(); + resizeColumnToContents(0); + return; + } +update: + updateMenuList(this, rootEntry); + update(); + resizeColumnToContents(0); +} + +void ConfigList::setValue(ConfigItem* item, tristate val) +{ + struct symbol* sym; + int type; + tristate oldval; + + sym = item->menu ? item->menu->sym : 0; + if (!sym) + return; + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldval = sym_get_tristate_value(sym); + + if (!sym_set_tristate_value(sym, val)) + return; + if (oldval == no && item->menu->list) + item->setExpanded(true); + parent()->updateList(item); + break; + } +} + +void ConfigList::changeValue(ConfigItem* item) +{ + struct symbol* sym; + struct menu* menu; + int type, oldexpr, newexpr; + + menu = item->menu; + if (!menu) + return; + sym = menu->sym; + if (!sym) { + if (item->menu->list) + item->setExpanded(!item->isExpanded()); + return; + } + + type = sym_get_type(sym); + switch (type) { + case S_BOOLEAN: + case S_TRISTATE: + oldexpr = sym_get_tristate_value(sym); + newexpr = sym_toggle_tristate_value(sym); + if (item->menu->list) { + if (oldexpr == newexpr) + item->setExpanded(!item->isExpanded()); + else if (oldexpr == no) + item->setExpanded(true); + } + if (oldexpr != newexpr) + parent()->updateList(item); + break; + case S_INT: + case S_HEX: + case S_STRING: + parent()->lineEdit->show(item); + break; + } +} + +void ConfigList::setRootMenu(struct menu *menu) +{ + enum prop_type type; + + if (rootEntry == menu) + return; + type = menu && menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type != P_MENU) + return; + updateMenuList(this, 0); + rootEntry = menu; + updateListAll(); + if (currentItem()) { + currentItem()->setSelected(hasFocus()); + scrollToItem(currentItem()); + } +} + +void ConfigList::setParentMenu(void) +{ + ConfigItem* item; + struct menu *oldroot; + + oldroot = rootEntry; + if (rootEntry == &rootmenu) + return; + setRootMenu(menu_get_parent_menu(rootEntry->parent)); + + QTreeWidgetItemIterator it(this); + while (*it) { + item = (ConfigItem *)(*it); + if (item->menu == oldroot) { + setCurrentItem(item); + scrollToItem(item); + break; + } + + ++it; + } +} + +/* + * update all the children of a menu entry + * removes/adds the entries from the parent widget as necessary + * + * parent: either the menu list widget or a menu entry widget + * menu: entry to be updated + */ +void ConfigList::updateMenuList(ConfigItem *parent, struct menu* menu) +{ + struct menu* child; + ConfigItem* item; + ConfigItem* last; + bool visible; + enum prop_type type; + + if (!menu) { + while (parent->childCount() > 0) + { + delete parent->takeChild(0); + } + + return; + } + + last = parent->firstChild(); + if (last && !last->goParent) + last = 0; + for (child = menu->list; child; child = child->next) { + item = last ? last->nextSibling() : parent->firstChild(); + type = child->prompt ? child->prompt->type : P_UNKNOWN; + + switch (mode) { + case menuMode: + if (!(child->flags & MENU_ROOT)) + goto hide; + break; + case symbolMode: + if (child->flags & MENU_ROOT) + goto hide; + break; + default: + break; + } + + visible = menu_is_visible(child); + if (!menuSkip(child)) { + if (!child->sym && !child->list && !child->prompt) + continue; + if (!item || item->menu != child) + item = new ConfigItem(parent, last, child, visible); + else + item->testUpdateMenu(visible); + + if (mode == fullMode || mode == menuMode || type != P_MENU) + updateMenuList(item, child); + else + updateMenuList(item, 0); + last = item; + continue; + } + hide: + if (item && item->menu == child) { + last = parent->firstChild(); + if (last == item) + last = 0; + else while (last->nextSibling() != item) + last = last->nextSibling(); + delete item; + } + } +} + +void ConfigList::updateMenuList(ConfigList *parent, struct menu* menu) +{ + struct menu* child; + ConfigItem* item; + ConfigItem* last; + bool visible; + enum prop_type type; + + if (!menu) { + while (parent->topLevelItemCount() > 0) + { + delete parent->takeTopLevelItem(0); + } + + return; + } + + last = (ConfigItem*)parent->topLevelItem(0); + if (last && !last->goParent) + last = 0; + for (child = menu->list; child; child = child->next) { + item = last ? last->nextSibling() : (ConfigItem*)parent->topLevelItem(0); + type = child->prompt ? child->prompt->type : P_UNKNOWN; + + switch (mode) { + case menuMode: + if (!(child->flags & MENU_ROOT)) + goto hide; + break; + case symbolMode: + if (child->flags & MENU_ROOT) + goto hide; + break; + default: + break; + } + + visible = menu_is_visible(child); + if (!menuSkip(child)) { + if (!child->sym && !child->list && !child->prompt) + continue; + if (!item || item->menu != child) + item = new ConfigItem(parent, last, child, visible); + else + item->testUpdateMenu(visible); + + if (mode == fullMode || mode == menuMode || type != P_MENU) + updateMenuList(item, child); + else + updateMenuList(item, 0); + last = item; + continue; + } + hide: + if (item && item->menu == child) { + last = (ConfigItem*)parent->topLevelItem(0); + if (last == item) + last = 0; + else while (last->nextSibling() != item) + last = last->nextSibling(); + delete item; + } + } +} + +void ConfigList::keyPressEvent(QKeyEvent* ev) +{ + QTreeWidgetItem* i = currentItem(); + ConfigItem* item; + struct menu *menu; + enum prop_type type; + + if (ev->key() == Qt::Key_Escape && mode != fullMode && mode != listMode) { + emit parentSelected(); + ev->accept(); + return; + } + + if (!i) { + Parent::keyPressEvent(ev); + return; + } + item = (ConfigItem*)i; + + switch (ev->key()) { + case Qt::Key_Return: + case Qt::Key_Enter: + if (item->goParent) { + emit parentSelected(); + break; + } + menu = item->menu; + if (!menu) + break; + type = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (type == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) { + emit menuSelected(menu); + break; + } + case Qt::Key_Space: + changeValue(item); + break; + case Qt::Key_N: + setValue(item, no); + break; + case Qt::Key_M: + setValue(item, mod); + break; + case Qt::Key_Y: + setValue(item, yes); + break; + default: + Parent::keyPressEvent(ev); + return; + } + ev->accept(); +} + +void ConfigList::mousePressEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMousePressEvent: %d,%d\n", p.x(), p.y()); + Parent::mousePressEvent(e); +} + +void ConfigList::mouseReleaseEvent(QMouseEvent* e) +{ + QPoint p = e->pos(); + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + QIcon icon; + int idx, x; + + if (!item) + goto skip; + + menu = item->menu; + x = header()->offset() + p.x(); + idx = header()->logicalIndexAt(x); + switch (idx) { + case promptColIdx: + icon = item->pixmap(promptColIdx); + if (!icon.isNull()) { + int off = header()->sectionPosition(0) + visualRect(indexAt(p)).x() + 4; // 4 is Hardcoded image offset. There might be a way to do it properly. + if (x >= off && x < off + icon.availableSizes().first().width()) { + if (item->goParent) { + emit parentSelected(); + break; + } else if (!menu) + break; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && rootEntry != menu && + mode != fullMode && mode != menuMode) + emit menuSelected(menu); + else + changeValue(item); + } + } + break; + case noColIdx: + setValue(item, no); + break; + case modColIdx: + setValue(item, mod); + break; + case yesColIdx: + setValue(item, yes); + break; + case dataColIdx: + changeValue(item); + break; + } + +skip: + //printf("contentsMouseReleaseEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseReleaseEvent(e); +} + +void ConfigList::mouseMoveEvent(QMouseEvent* e) +{ + //QPoint p(contentsToViewport(e->pos())); + //printf("contentsMouseMoveEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseMoveEvent(e); +} + +void ConfigList::mouseDoubleClickEvent(QMouseEvent* e) +{ + QPoint p = e->pos(); // TODO: Check if this works(was contentsToViewport). + ConfigItem* item = (ConfigItem*)itemAt(p); + struct menu *menu; + enum prop_type ptype; + + if (!item) + goto skip; + if (item->goParent) { + emit parentSelected(); + goto skip; + } + menu = item->menu; + if (!menu) + goto skip; + ptype = menu->prompt ? menu->prompt->type : P_UNKNOWN; + if (ptype == P_MENU && (mode == singleMode || mode == symbolMode)) + emit menuSelected(menu); + else if (menu->sym) + changeValue(item); + +skip: + //printf("contentsMouseDoubleClickEvent: %d,%d\n", p.x(), p.y()); + Parent::mouseDoubleClickEvent(e); +} + +void ConfigList::focusInEvent(QFocusEvent *e) +{ + struct menu *menu = NULL; + + Parent::focusInEvent(e); + + ConfigItem* item = (ConfigItem *)currentItem(); + if (item) { + item->setSelected(true); + menu = item->menu; + } + emit gotFocus(menu); +} + +void ConfigList::contextMenuEvent(QContextMenuEvent *e) +{ + if (e->y() <= header()->geometry().bottom()) { + if (!headerPopup) { + QAction *action; + + headerPopup = new QMenu(this); + action = new QAction(_("Show Name"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowName(bool))); + connect(parent(), SIGNAL(showNameChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showName); + headerPopup->addAction(action); + action = new QAction(_("Show Range"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowRange(bool))); + connect(parent(), SIGNAL(showRangeChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showRange); + headerPopup->addAction(action); + action = new QAction(_("Show Data"), this); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), + parent(), SLOT(setShowData(bool))); + connect(parent(), SIGNAL(showDataChanged(bool)), + action, SLOT(setOn(bool))); + action->setChecked(showData); + headerPopup->addAction(action); + } + headerPopup->exec(e->globalPos()); + e->accept(); + } else + e->ignore(); +} + +ConfigView*ConfigView::viewList; +QAction *ConfigView::showNormalAction; +QAction *ConfigView::showAllAction; +QAction *ConfigView::showPromptAction; + +ConfigView::ConfigView(QWidget* parent, const char *name) + : Parent(parent) +{ + setObjectName(name); + QVBoxLayout *verticalLayout = new QVBoxLayout(this); + verticalLayout->setContentsMargins(0, 0, 0, 0); + + list = new ConfigList(this); + verticalLayout->addWidget(list); + lineEdit = new ConfigLineEdit(this); + lineEdit->hide(); + verticalLayout->addWidget(lineEdit); + + this->nextView = viewList; + viewList = this; +} + +ConfigView::~ConfigView(void) +{ + ConfigView** vp; + + for (vp = &viewList; *vp; vp = &(*vp)->nextView) { + if (*vp == this) { + *vp = nextView; + break; + } + } +} + +void ConfigView::setOptionMode(QAction *act) +{ + if (act == showNormalAction) + list->optMode = normalOpt; + else if (act == showAllAction) + list->optMode = allOpt; + else + list->optMode = promptOpt; + + list->updateListAll(); +} + +void ConfigView::setShowName(bool b) +{ + if (list->showName != b) { + list->showName = b; + list->reinit(); + emit showNameChanged(b); + } +} + +void ConfigView::setShowRange(bool b) +{ + if (list->showRange != b) { + list->showRange = b; + list->reinit(); + emit showRangeChanged(b); + } +} + +void ConfigView::setShowData(bool b) +{ + if (list->showData != b) { + list->showData = b; + list->reinit(); + emit showDataChanged(b); + } +} + +void ConfigList::setAllOpen(bool open) +{ + QTreeWidgetItemIterator it(this); + + while (*it) { + (*it)->setExpanded(open); + + ++it; + } +} + +void ConfigView::updateList(ConfigItem* item) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateList(item); +} + +void ConfigView::updateListAll(void) +{ + ConfigView* v; + + for (v = viewList; v; v = v->nextView) + v->list->updateListAll(); +} + +ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name) + : Parent(parent), sym(0), _menu(0) +{ + setObjectName(name); + + + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + _showDebug = configSettings->value("/showDebug", false).toBool(); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigInfoView::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/showDebug", showDebug()); + configSettings->endGroup(); + } +} + +void ConfigInfoView::setShowDebug(bool b) +{ + if (_showDebug != b) { + _showDebug = b; + if (_menu) + menuInfo(); + else if (sym) + symbolInfo(); + emit showDebugChanged(b); + } +} + +void ConfigInfoView::setInfo(struct menu *m) +{ + if (_menu == m) + return; + _menu = m; + sym = NULL; + if (!_menu) + clear(); + else + menuInfo(); +} + +void ConfigInfoView::symbolInfo(void) +{ + QString str; + + str += "Symbol: "; + str += print_filter(sym->name); + str += "

value: "; + str += print_filter(sym_get_string_value(sym)); + str += "
visibility: "; + str += sym->visible == yes ? "y" : sym->visible == mod ? "m" : "n"; + str += "
"; + str += debug_info(sym); + + setText(str); +} + +void ConfigInfoView::menuInfo(void) +{ + struct symbol* sym; + QString head, debug, help; + + sym = _menu->sym; + if (sym) { + if (_menu->prompt) { + head += ""; + head += print_filter(_(_menu->prompt->text)); + head += ""; + if (sym->name) { + head += " ("; + if (showDebug()) + head += QString().sprintf("", sym); + head += print_filter(sym->name); + if (showDebug()) + head += ""; + head += ")"; + } + } else if (sym->name) { + head += ""; + if (showDebug()) + head += QString().sprintf("", sym); + head += print_filter(sym->name); + if (showDebug()) + head += ""; + head += ""; + } + head += "

"; + + if (showDebug()) + debug = debug_info(sym); + + struct gstr help_gstr = str_new(); + menu_get_ext_help(_menu, &help_gstr); + help = print_filter(str_get(&help_gstr)); + str_free(&help_gstr); + } else if (_menu->prompt) { + head += ""; + head += print_filter(_(_menu->prompt->text)); + head += "

"; + if (showDebug()) { + if (_menu->prompt->visible.expr) { + debug += "  dep: "; + expr_print(_menu->prompt->visible.expr, expr_print_help, &debug, E_NONE); + debug += "

"; + } + } + } + if (showDebug()) + debug += QString().sprintf("defined at %s:%d

", _menu->file->name, _menu->lineno); + + setText(head + debug + help); +} + +QString ConfigInfoView::debug_info(struct symbol *sym) +{ + QString debug; + + debug += "type: "; + debug += print_filter(sym_type_name(sym->type)); + if (sym_is_choice(sym)) + debug += " (choice)"; + debug += "
"; + if (sym->rev_dep.expr) { + debug += "reverse dep: "; + expr_print(sym->rev_dep.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + for (struct property *prop = sym->prop; prop; prop = prop->next) { + switch (prop->type) { + case P_PROMPT: + case P_MENU: + debug += QString().sprintf("prompt: ", prop->menu); + debug += print_filter(_(prop->text)); + debug += "
"; + break; + case P_DEFAULT: + case P_SELECT: + case P_RANGE: + case P_ENV: + debug += prop_get_type_name(prop->type); + debug += ": "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; + break; + case P_CHOICE: + if (sym_is_choice(sym)) { + debug += "choice: "; + expr_print(prop->expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + break; + default: + debug += "unknown property: "; + debug += prop_get_type_name(prop->type); + debug += "
"; + } + if (prop->visible.expr) { + debug += "    dep: "; + expr_print(prop->visible.expr, expr_print_help, &debug, E_NONE); + debug += "
"; + } + } + debug += "
"; + + return debug; +} + +QString ConfigInfoView::print_filter(const QString &str) +{ + QRegExp re("[<>&\"\\n]"); + QString res = str; + for (int i = 0; (i = res.indexOf(re, i)) >= 0;) { + switch (res[i].toLatin1()) { + case '<': + res.replace(i, 1, "<"); + i += 4; + break; + case '>': + res.replace(i, 1, ">"); + i += 4; + break; + case '&': + res.replace(i, 1, "&"); + i += 5; + break; + case '"': + res.replace(i, 1, """); + i += 6; + break; + case '\n': + res.replace(i, 1, "
"); + i += 4; + break; + } + } + return res; +} + +void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char *str) +{ + QString* text = reinterpret_cast(data); + QString str2 = print_filter(str); + + if (sym && sym->name && !(sym->flags & SYMBOL_CONST)) { + *text += QString().sprintf("", sym); + *text += str2; + *text += ""; + } else + *text += str2; +} + +QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos) +{ + QMenu* popup = Parent::createStandardContextMenu(pos); + QAction* action = new QAction(_("Show Debug Info"), popup); + action->setCheckable(true); + connect(action, SIGNAL(toggled(bool)), SLOT(setShowDebug(bool))); + connect(this, SIGNAL(showDebugChanged(bool)), action, SLOT(setOn(bool))); + action->setChecked(showDebug()); + popup->addSeparator(); + popup->addAction(action); + return popup; +} + +void ConfigInfoView::contextMenuEvent(QContextMenuEvent *e) +{ + Parent::contextMenuEvent(e); +} + +ConfigSearchWindow::ConfigSearchWindow(ConfigMainWindow* parent, const char *name) + : Parent(parent), result(NULL) +{ + setObjectName(name); + setWindowTitle("Search Config"); + + QVBoxLayout* layout1 = new QVBoxLayout(this); + layout1->setContentsMargins(11, 11, 11, 11); + layout1->setSpacing(6); + QHBoxLayout* layout2 = new QHBoxLayout(0); + layout2->setContentsMargins(0, 0, 0, 0); + layout2->setSpacing(6); + layout2->addWidget(new QLabel(_("Find:"), this)); + editField = new QLineEdit(this); + connect(editField, SIGNAL(returnPressed()), SLOT(search())); + layout2->addWidget(editField); + searchButton = new QPushButton(_("Search"), this); + searchButton->setAutoDefault(false); + connect(searchButton, SIGNAL(clicked()), SLOT(search())); + layout2->addWidget(searchButton); + layout1->addLayout(layout2); + + split = new QSplitter(this); + split->setOrientation(Qt::Vertical); + list = new ConfigView(split, name); + list->list->mode = listMode; + info = new ConfigInfoView(split, name); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + info, SLOT(setInfo(struct menu *))); + connect(list->list, SIGNAL(menuChanged(struct menu *)), + parent, SLOT(setMenuLink(struct menu *))); + + layout1->addWidget(split); + + if (name) { + QVariant x, y; + int width, height; + bool ok; + + configSettings->beginGroup(name); + width = configSettings->value("/window width", parent->width() / 2).toInt(); + height = configSettings->value("/window height", parent->height() / 2).toInt(); + resize(width, height); + x = configSettings->value("/window x"); + y = configSettings->value("/window y"); + if ((x.isValid())&&(y.isValid())) + move(x.toInt(), y.toInt()); + QList sizes = configSettings->readSizes("/split", &ok); + if (ok) + split->setSizes(sizes); + configSettings->endGroup(); + connect(configApp, SIGNAL(aboutToQuit()), SLOT(saveSettings())); + } +} + +void ConfigSearchWindow::saveSettings(void) +{ + if (!objectName().isEmpty()) { + configSettings->beginGroup(objectName()); + configSettings->setValue("/window x", pos().x()); + configSettings->setValue("/window y", pos().y()); + configSettings->setValue("/window width", size().width()); + configSettings->setValue("/window height", size().height()); + configSettings->writeSizes("/split", split->sizes()); + configSettings->endGroup(); + } +} + +void ConfigSearchWindow::search(void) +{ + struct symbol **p; + struct property *prop; + ConfigItem *lastItem = NULL; + + free(result); + list->list->clear(); + info->clear(); + + result = sym_re_search(editField->text().toLatin1()); + if (!result) + return; + for (p = result; *p; p++) { + for_all_prompts((*p), prop) + lastItem = new ConfigItem(list->list, lastItem, prop->menu, + menu_is_visible(prop->menu)); + } +} + +/* + * Construct the complete config widget + */ +ConfigMainWindow::ConfigMainWindow(void) + : searchWindow(0) +{ + QMenuBar* menu; + bool ok = true; + QVariant x, y; + int width, height; + char title[256]; + + QDesktopWidget *d = configApp->desktop(); + snprintf(title, sizeof(title), "%s%s", + rootmenu.prompt->text, + "" + ); + setWindowTitle(title); + + width = configSettings->value("/window width", d->width() - 64).toInt(); + height = configSettings->value("/window height", d->height() - 64).toInt(); + resize(width, height); + x = configSettings->value("/window x"); + y = configSettings->value("/window y"); + if ((x.isValid())&&(y.isValid())) + move(x.toInt(), y.toInt()); + + split1 = new QSplitter(this); + split1->setOrientation(Qt::Horizontal); + setCentralWidget(split1); + + menuView = new ConfigView(split1, "menu"); + menuList = menuView->list; + + split2 = new QSplitter(split1); + split2->setOrientation(Qt::Vertical); + + // create config tree + configView = new ConfigView(split2, "config"); + configList = configView->list; + + helpText = new ConfigInfoView(split2, "help"); + + setTabOrder(configList, helpText); + configList->setFocus(); + + menu = menuBar(); + toolBar = new QToolBar("Tools", this); + addToolBar(toolBar); + + backAction = new QAction(QPixmap(xpm_back), _("Back"), this); + connect(backAction, SIGNAL(triggered(bool)), SLOT(goBack())); + backAction->setEnabled(false); + QAction *quitAction = new QAction(_("&Quit"), this); + quitAction->setShortcut(Qt::CTRL + Qt::Key_Q); + connect(quitAction, SIGNAL(triggered(bool)), SLOT(close())); + QAction *loadAction = new QAction(QPixmap(xpm_load), _("&Load"), this); + loadAction->setShortcut(Qt::CTRL + Qt::Key_L); + connect(loadAction, SIGNAL(triggered(bool)), SLOT(loadConfig())); + saveAction = new QAction(QPixmap(xpm_save), _("&Save"), this); + saveAction->setShortcut(Qt::CTRL + Qt::Key_S); + connect(saveAction, SIGNAL(triggered(bool)), SLOT(saveConfig())); + conf_set_changed_callback(conf_changed); + // Set saveAction's initial state + conf_changed(); + QAction *saveAsAction = new QAction(_("Save &As..."), this); + connect(saveAsAction, SIGNAL(triggered(bool)), SLOT(saveConfigAs())); + QAction *searchAction = new QAction(_("&Find"), this); + searchAction->setShortcut(Qt::CTRL + Qt::Key_F); + connect(searchAction, SIGNAL(triggered(bool)), SLOT(searchConfig())); + singleViewAction = new QAction(QPixmap(xpm_single_view), _("Single View"), this); + singleViewAction->setCheckable(true); + connect(singleViewAction, SIGNAL(triggered(bool)), SLOT(showSingleView())); + splitViewAction = new QAction(QPixmap(xpm_split_view), _("Split View"), this); + splitViewAction->setCheckable(true); + connect(splitViewAction, SIGNAL(triggered(bool)), SLOT(showSplitView())); + fullViewAction = new QAction(QPixmap(xpm_tree_view), _("Full View"), this); + fullViewAction->setCheckable(true); + connect(fullViewAction, SIGNAL(triggered(bool)), SLOT(showFullView())); + + QAction *showNameAction = new QAction(_("Show Name"), this); + showNameAction->setCheckable(true); + connect(showNameAction, SIGNAL(toggled(bool)), configView, SLOT(setShowName(bool))); + showNameAction->setChecked(configView->showName()); + QAction *showRangeAction = new QAction(_("Show Range"), this); + showRangeAction->setCheckable(true); + connect(showRangeAction, SIGNAL(toggled(bool)), configView, SLOT(setShowRange(bool))); + QAction *showDataAction = new QAction(_("Show Data"), this); + showDataAction->setCheckable(true); + connect(showDataAction, SIGNAL(toggled(bool)), configView, SLOT(setShowData(bool))); + + QActionGroup *optGroup = new QActionGroup(this); + optGroup->setExclusive(true); + connect(optGroup, SIGNAL(triggered(QAction*)), configView, + SLOT(setOptionMode(QAction *))); + connect(optGroup, SIGNAL(triggered(QAction *)), menuView, + SLOT(setOptionMode(QAction *))); + + configView->showNormalAction = new QAction(_("Show Normal Options"), optGroup); + configView->showAllAction = new QAction(_("Show All Options"), optGroup); + configView->showPromptAction = new QAction(_("Show Prompt Options"), optGroup); + configView->showNormalAction->setCheckable(true); + configView->showAllAction->setCheckable(true); + configView->showPromptAction->setCheckable(true); + + QAction *showDebugAction = new QAction( _("Show Debug Info"), this); + showDebugAction->setCheckable(true); + connect(showDebugAction, SIGNAL(toggled(bool)), helpText, SLOT(setShowDebug(bool))); + showDebugAction->setChecked(helpText->showDebug()); + + QAction *showIntroAction = new QAction( _("Introduction"), this); + connect(showIntroAction, SIGNAL(triggered(bool)), SLOT(showIntro())); + QAction *showAboutAction = new QAction( _("About"), this); + connect(showAboutAction, SIGNAL(triggered(bool)), SLOT(showAbout())); + + // init tool bar + toolBar->addAction(backAction); + toolBar->addSeparator(); + toolBar->addAction(loadAction); + toolBar->addAction(saveAction); + toolBar->addSeparator(); + toolBar->addAction(singleViewAction); + toolBar->addAction(splitViewAction); + toolBar->addAction(fullViewAction); + + // create config menu + QMenu* config = menu->addMenu(_("&File")); + config->addAction(loadAction); + config->addAction(saveAction); + config->addAction(saveAsAction); + config->addSeparator(); + config->addAction(quitAction); + + // create edit menu + QMenu* editMenu = menu->addMenu(_("&Edit")); + editMenu->addAction(searchAction); + + // create options menu + QMenu* optionMenu = menu->addMenu(_("&Option")); + optionMenu->addAction(showNameAction); + optionMenu->addAction(showRangeAction); + optionMenu->addAction(showDataAction); + optionMenu->addSeparator(); + optionMenu->addActions(optGroup->actions()); + optionMenu->addSeparator(); + + // create help menu + menu->addSeparator(); + QMenu* helpMenu = menu->addMenu(_("&Help")); + helpMenu->addAction(showIntroAction); + helpMenu->addAction(showAboutAction); + + connect(configList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(configList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + connect(configList, SIGNAL(parentSelected()), + SLOT(goBack())); + connect(menuList, SIGNAL(menuChanged(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(menuSelected(struct menu *)), + SLOT(changeMenu(struct menu *))); + + connect(configList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + helpText, SLOT(setInfo(struct menu *))); + connect(menuList, SIGNAL(gotFocus(struct menu *)), + SLOT(listFocusChanged(void))); + connect(helpText, SIGNAL(menuSelected(struct menu *)), + SLOT(setMenuLink(struct menu *))); + + QString listMode = configSettings->value("/listMode", "symbol").toString(); + if (listMode == "single") + showSingleView(); + else if (listMode == "full") + showFullView(); + else /*if (listMode == "split")*/ + showSplitView(); + + // UI setup done, restore splitter positions + QList sizes = configSettings->readSizes("/split1", &ok); + if (ok) + split1->setSizes(sizes); + + sizes = configSettings->readSizes("/split2", &ok); + if (ok) + split2->setSizes(sizes); +} + +void ConfigMainWindow::loadConfig(void) +{ + QString s = QFileDialog::getOpenFileName(this, "", conf_get_configname()); + if (s.isNull()) + return; + if (conf_read(QFile::encodeName(s))) + QMessageBox::information(this, "qconf", _("Unable to load configuration!")); + ConfigView::updateListAll(); +} + +bool ConfigMainWindow::saveConfig(void) +{ + if (conf_write(NULL)) { + QMessageBox::information(this, "qconf", _("Unable to save configuration!")); + return false; + } + return true; +} + +void ConfigMainWindow::saveConfigAs(void) +{ + QString s = QFileDialog::getSaveFileName(this, "", conf_get_configname()); + if (s.isNull()) + return; + saveConfig(); +} + +void ConfigMainWindow::searchConfig(void) +{ + if (!searchWindow) + searchWindow = new ConfigSearchWindow(this, "search"); + searchWindow->show(); +} + +void ConfigMainWindow::changeMenu(struct menu *menu) +{ + configList->setRootMenu(menu); + if (configList->rootEntry->parent == &rootmenu) + backAction->setEnabled(false); + else + backAction->setEnabled(true); +} + +void ConfigMainWindow::setMenuLink(struct menu *menu) +{ + struct menu *parent; + ConfigList* list = NULL; + ConfigItem* item; + + if (configList->menuSkip(menu)) + return; + + switch (configList->mode) { + case singleMode: + list = configList; + parent = menu_get_parent_menu(menu); + if (!parent) + return; + list->setRootMenu(parent); + break; + case symbolMode: + if (menu->flags & MENU_ROOT) { + configList->setRootMenu(menu); + configList->clearSelection(); + list = menuList; + } else { + list = configList; + parent = menu_get_parent_menu(menu->parent); + if (!parent) + return; + item = menuList->findConfigItem(parent); + if (item) { + item->setSelected(true); + menuList->scrollToItem(item); + } + list->setRootMenu(parent); + } + break; + case fullMode: + list = configList; + break; + default: + break; + } + + if (list) { + item = list->findConfigItem(menu); + if (item) { + item->setSelected(true); + list->scrollToItem(item); + list->setFocus(); + } + } +} + +void ConfigMainWindow::listFocusChanged(void) +{ + if (menuList->mode == menuMode) + configList->clearSelection(); +} + +void ConfigMainWindow::goBack(void) +{ + ConfigItem* item, *oldSelection; + + configList->setParentMenu(); + if (configList->rootEntry == &rootmenu) + backAction->setEnabled(false); + + if (menuList->selectedItems().count() == 0) + return; + + item = (ConfigItem*)menuList->selectedItems().first(); + oldSelection = item; + while (item) { + if (item->menu == configList->rootEntry) { + oldSelection->setSelected(false); + item->setSelected(true); + break; + } + item = (ConfigItem*)item->parent(); + } +} + +void ConfigMainWindow::showSingleView(void) +{ + singleViewAction->setEnabled(false); + singleViewAction->setChecked(true); + splitViewAction->setEnabled(true); + splitViewAction->setChecked(false); + fullViewAction->setEnabled(true); + fullViewAction->setChecked(false); + + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = singleMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setFocus(); +} + +void ConfigMainWindow::showSplitView(void) +{ + singleViewAction->setEnabled(true); + singleViewAction->setChecked(false); + splitViewAction->setEnabled(false); + splitViewAction->setChecked(true); + fullViewAction->setEnabled(true); + fullViewAction->setChecked(false); + + configList->mode = symbolMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setAllOpen(true); + configApp->processEvents(); + menuList->mode = menuMode; + menuList->setRootMenu(&rootmenu); + menuList->setAllOpen(true); + menuView->show(); + menuList->setFocus(); +} + +void ConfigMainWindow::showFullView(void) +{ + singleViewAction->setEnabled(true); + singleViewAction->setChecked(false); + splitViewAction->setEnabled(true); + splitViewAction->setChecked(false); + fullViewAction->setEnabled(false); + fullViewAction->setChecked(true); + + menuView->hide(); + menuList->setRootMenu(0); + configList->mode = fullMode; + if (configList->rootEntry == &rootmenu) + configList->updateListAll(); + else + configList->setRootMenu(&rootmenu); + configList->setFocus(); +} + +/* + * ask for saving configuration before quitting + * TODO ask only when something changed + */ +void ConfigMainWindow::closeEvent(QCloseEvent* e) +{ + if (!conf_get_changed()) { + e->accept(); + return; + } + QMessageBox mb("qconf", _("Save configuration?"), QMessageBox::Warning, + QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Cancel | QMessageBox::Escape); + mb.setButtonText(QMessageBox::Yes, _("&Save Changes")); + mb.setButtonText(QMessageBox::No, _("&Discard Changes")); + mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit")); + switch (mb.exec()) { + case QMessageBox::Yes: + if (saveConfig()) + e->accept(); + else + e->ignore(); + break; + case QMessageBox::No: + e->accept(); + break; + case QMessageBox::Cancel: + e->ignore(); + break; + } +} + +void ConfigMainWindow::showIntro(void) +{ + static const QString str = _("Welcome to the qconf graphical configuration tool.\n\n" + "For each option, a blank box indicates the feature is disabled, a check\n" + "indicates it is enabled, and a dot indicates that it is to be compiled\n" + "as a module. Clicking on the box will cycle through the three states.\n\n" + "If you do not see an option (e.g., a device driver) that you believe\n" + "should be present, try turning on Show All Options under the Options menu.\n" + "Although there is no cross reference yet to help you figure out what other\n" + "options must be enabled to support the option you are interested in, you can\n" + "still view the help of a grayed-out option.\n\n" + "Toggling Show Debug Info under the Options menu will show the dependencies,\n" + "which you can then match by examining other options.\n\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::showAbout(void) +{ + static const QString str = _("qconf is Copyright (C) 2002 Roman Zippel .\n" + "Copyright (C) 2015 Boris Barbulovski .\n\n" + "Bug reports and feature request can also be entered at http://bugzilla.kernel.org/\n"); + + QMessageBox::information(this, "qconf", str); +} + +void ConfigMainWindow::saveSettings(void) +{ + configSettings->setValue("/window x", pos().x()); + configSettings->setValue("/window y", pos().y()); + configSettings->setValue("/window width", size().width()); + configSettings->setValue("/window height", size().height()); + + QString entry; + switch(configList->mode) { + case singleMode : + entry = "single"; + break; + + case symbolMode : + entry = "split"; + break; + + case fullMode : + entry = "full"; + break; + + default: + break; + } + configSettings->setValue("/listMode", entry); + + configSettings->writeSizes("/split1", split1->sizes()); + configSettings->writeSizes("/split2", split2->sizes()); +} + +void ConfigMainWindow::conf_changed(void) +{ + if (saveAction) + saveAction->setEnabled(conf_get_changed()); +} + +void fixup_rootmenu(struct menu *menu) +{ + struct menu *child; + static int menu_cnt = 0; + + menu->flags |= MENU_ROOT; + for (child = menu->list; child; child = child->next) { + if (child->prompt && child->prompt->type == P_MENU) { + menu_cnt++; + fixup_rootmenu(child); + menu_cnt--; + } else if (!menu_cnt) + fixup_rootmenu(child); + } +} + +static const char *progname; + +static void usage(void) +{ + printf(_("%s [-s] \n").toLatin1().constData(), progname); + exit(0); +} + +int main(int ac, char** av) +{ + ConfigMainWindow* v; + const char *name; + + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + + progname = av[0]; + configApp = new QApplication(ac, av); + if (ac > 1 && av[1][0] == '-') { + switch (av[1][1]) { + case 's': + conf_set_message_callback(NULL); + break; + case 'h': + case '?': + usage(); + } + name = av[2]; + } else + name = av[1]; + if (!name) + usage(); + + conf_parse(name); + fixup_rootmenu(&rootmenu); + conf_read(NULL); + //zconfdump(stdout); + + configSettings = new ConfigSettings(); + configSettings->beginGroup("/kconfig/qconf"); + v = new ConfigMainWindow(); + + //zconfdump(stdout); + configApp->connect(configApp, SIGNAL(lastWindowClosed()), SLOT(quit())); + configApp->connect(configApp, SIGNAL(aboutToQuit()), v, SLOT(saveSettings())); + v->show(); + configApp->exec(); + + configSettings->endGroup(); + delete configSettings; + delete v; + delete configApp; + + return 0; +} diff --git a/scripts/config/qconf.h b/scripts/config/qconf.h new file mode 100644 index 000000000..a40036d1b --- /dev/null +++ b/scripts/config/qconf.h @@ -0,0 +1,330 @@ +/* + * Copyright (C) 2002 Roman Zippel + * Released under the terms of the GNU GPL v2.0. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "expr.h" + +class ConfigView; +class ConfigList; +class ConfigItem; +class ConfigLineEdit; +class ConfigMainWindow; + +class ConfigSettings : public QSettings { +public: + ConfigSettings(); + QList readSizes(const QString& key, bool *ok); + bool writeSizes(const QString& key, const QList& value); +}; + +enum colIdx { + promptColIdx, nameColIdx, noColIdx, modColIdx, yesColIdx, dataColIdx, colNr +}; +enum listMode { + singleMode, menuMode, symbolMode, fullMode, listMode +}; +enum optionMode { + normalOpt = 0, allOpt, promptOpt +}; + +class ConfigList : public QTreeWidget { + Q_OBJECT + typedef class QTreeWidget Parent; +public: + ConfigList(ConfigView* p, const char *name = 0); + void reinit(void); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + ConfigItem* findConfigItem(struct menu *); + +protected: + void keyPressEvent(QKeyEvent *e); + void mousePressEvent(QMouseEvent *e); + void mouseReleaseEvent(QMouseEvent *e); + void mouseMoveEvent(QMouseEvent *e); + void mouseDoubleClickEvent(QMouseEvent *e); + void focusInEvent(QFocusEvent *e); + void contextMenuEvent(QContextMenuEvent *e); + +public slots: + void setRootMenu(struct menu *menu); + + void updateList(ConfigItem *item); + void setValue(ConfigItem* item, tristate val); + void changeValue(ConfigItem* item); + void updateSelection(void); + void saveSettings(void); +signals: + void menuChanged(struct menu *menu); + void menuSelected(struct menu *menu); + void parentSelected(void); + void gotFocus(struct menu *); + +public: + void updateListAll(void) + { + updateAll = true; + updateList(NULL); + updateAll = false; + } + ConfigList* listView() + { + return this; + } + ConfigItem* firstChild() const + { + return (ConfigItem *)children().first(); + } + void addColumn(colIdx idx) + { + showColumn(idx); + } + void removeColumn(colIdx idx) + { + hideColumn(idx); + } + void setAllOpen(bool open); + void setParentMenu(void); + + bool menuSkip(struct menu *); + + void updateMenuList(ConfigItem *parent, struct menu*); + void updateMenuList(ConfigList *parent, struct menu*); + + bool updateAll; + + QPixmap symbolYesPix, symbolModPix, symbolNoPix; + QPixmap choiceYesPix, choiceNoPix; + QPixmap menuPix, menuInvPix, menuBackPix, voidPix; + + bool showName, showRange, showData; + enum listMode mode; + enum optionMode optMode; + struct menu *rootEntry; + QPalette disabledColorGroup; + QPalette inactivedColorGroup; + QMenu* headerPopup; +}; + +class ConfigItem : public QTreeWidgetItem { + typedef class QTreeWidgetItem Parent; +public: + ConfigItem(ConfigList *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(ConfigItem *parent, ConfigItem *after, struct menu *m, bool v) + : Parent(parent, after), nextItem(0), menu(m), visible(v), goParent(false) + { + init(); + } + ConfigItem(ConfigList *parent, ConfigItem *after, bool v) + : Parent(parent, after), nextItem(0), menu(0), visible(v), goParent(true) + { + init(); + } + ~ConfigItem(void); + void init(void); + void okRename(int col); + void updateMenu(void); + void testUpdateMenu(bool v); + ConfigList* listView() const + { + return (ConfigList*)Parent::treeWidget(); + } + ConfigItem* firstChild() const + { + return (ConfigItem *)Parent::child(0); + } + ConfigItem* nextSibling() + { + ConfigItem *ret = NULL; + ConfigItem *_parent = (ConfigItem *)parent(); + + if(_parent) { + ret = (ConfigItem *)_parent->child(_parent->indexOfChild(this)+1); + } else { + QTreeWidget *_treeWidget = treeWidget(); + ret = (ConfigItem *)_treeWidget->topLevelItem(_treeWidget->indexOfTopLevelItem(this)+1); + } + + return ret; + } + void setText(colIdx idx, const QString& text) + { + Parent::setText(idx, text); + } + QString text(colIdx idx) const + { + return Parent::text(idx); + } + void setPixmap(colIdx idx, const QIcon &icon) + { + Parent::setIcon(idx, icon); + } + const QIcon pixmap(colIdx idx) const + { + return icon(idx); + } + // TODO: Implement paintCell + + ConfigItem* nextItem; + struct menu *menu; + bool visible; + bool goParent; +}; + +class ConfigLineEdit : public QLineEdit { + Q_OBJECT + typedef class QLineEdit Parent; +public: + ConfigLineEdit(ConfigView* parent); + ConfigView* parent(void) const + { + return (ConfigView*)Parent::parent(); + } + void show(ConfigItem *i); + void keyPressEvent(QKeyEvent *e); + +public: + ConfigItem *item; +}; + +class ConfigView : public QWidget { + Q_OBJECT + typedef class QWidget Parent; +public: + ConfigView(QWidget* parent, const char *name = 0); + ~ConfigView(void); + static void updateList(ConfigItem* item); + static void updateListAll(void); + + bool showName(void) const { return list->showName; } + bool showRange(void) const { return list->showRange; } + bool showData(void) const { return list->showData; } +public slots: + void setShowName(bool); + void setShowRange(bool); + void setShowData(bool); + void setOptionMode(QAction *); +signals: + void showNameChanged(bool); + void showRangeChanged(bool); + void showDataChanged(bool); +public: + ConfigList* list; + ConfigLineEdit* lineEdit; + + static ConfigView* viewList; + ConfigView* nextView; + + static QAction *showNormalAction; + static QAction *showAllAction; + static QAction *showPromptAction; +}; + +class ConfigInfoView : public QTextBrowser { + Q_OBJECT + typedef class QTextBrowser Parent; +public: + ConfigInfoView(QWidget* parent, const char *name = 0); + bool showDebug(void) const { return _showDebug; } + +public slots: + void setInfo(struct menu *menu); + void saveSettings(void); + void setShowDebug(bool); + +signals: + void showDebugChanged(bool); + void menuSelected(struct menu *); + +protected: + void symbolInfo(void); + void menuInfo(void); + QString debug_info(struct symbol *sym); + static QString print_filter(const QString &str); + static void expr_print_help(void *data, struct symbol *sym, const char *str); + QMenu *createStandardContextMenu(const QPoint & pos); + void contextMenuEvent(QContextMenuEvent *e); + + struct symbol *sym; + struct menu *_menu; + bool _showDebug; +}; + +class ConfigSearchWindow : public QDialog { + Q_OBJECT + typedef class QDialog Parent; +public: + ConfigSearchWindow(ConfigMainWindow* parent, const char *name = 0); + +public slots: + void saveSettings(void); + void search(void); + +protected: + QLineEdit* editField; + QPushButton* searchButton; + QSplitter* split; + ConfigView* list; + ConfigInfoView* info; + + struct symbol **result; +}; + +class ConfigMainWindow : public QMainWindow { + Q_OBJECT + + static QAction *saveAction; + static void conf_changed(void); +public: + ConfigMainWindow(void); +public slots: + void changeMenu(struct menu *); + void setMenuLink(struct menu *); + void listFocusChanged(void); + void goBack(void); + void loadConfig(void); + bool saveConfig(void); + void saveConfigAs(void); + void searchConfig(void); + void showSingleView(void); + void showSplitView(void); + void showFullView(void); + void showIntro(void); + void showAbout(void); + void saveSettings(void); + +protected: + void closeEvent(QCloseEvent *e); + + ConfigSearchWindow *searchWindow; + ConfigView *menuView; + ConfigList *menuList; + ConfigView *configView; + ConfigList *configList; + ConfigInfoView *helpText; + QToolBar *toolBar; + QAction *backAction; + QAction *singleViewAction; + QAction *splitViewAction; + QAction *fullViewAction; + QSplitter *split1; + QSplitter *split2; +}; diff --git a/scripts/download.pl b/scripts/download.pl index 936bd0bdd..64e29392a 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -88,6 +88,7 @@ sub download_cmd($) { } my $hash_cmd = hash_cmd(); +$hash_cmd or ($file_hash eq "skip") or die "Cannot find appropriate hash command, ensure the provided hash is either a MD5 or SHA256 checksum.\n"; sub download { diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index a96adf9bc..4960149f1 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -1,4 +1,4 @@ -#/bin/sh +#!/bin/sh # # Copyright (C) 2011 OpenWrt.org # diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index 261490b86..fbd458bf2 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -535,11 +535,6 @@ sub gen_package_mk() { $pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; next; } - unless ($pkg->{src} ne $pkg_dep->{sec}.$suffix) { - warn sprintf "WARNING: Makefile '%s' has a build dependency on itself\n", - $pkg->{makefile}; - next; - } $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; } elsif (defined($srcpackage{$dep})) { $idx = $subdir{$dep}.$dep; diff --git a/target/Config.in b/target/Config.in index cb876c6af..3aef76890 100644 --- a/target/Config.in +++ b/target/Config.in @@ -199,6 +199,7 @@ config ARCH default "mips64" if mips64 default "mips64el" if mips64el default "powerpc" if powerpc + default "powerpc64" if powerpc64 default "sh3" if sh3 default "sh3eb" if sh3eb default "sh4" if sh4 diff --git a/target/linux/apm821xx/base-files/etc/board.d/01_leds b/target/linux/apm821xx/base-files/etc/board.d/01_leds index 3b5fb721a..c218efa49 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/01_leds +++ b/target/linux/apm821xx/base-files/etc/board.d/01_leds @@ -7,7 +7,7 @@ board_config_update board=$(board_name) case "$board" in -mr24) +meraki,mr24) ucidef_set_led_netdev "wan" "WAN" "mr24:green:wan" "eth0" ucidef_set_led_wlan "wlan1" "WLAN1" "mr24:green:wifi1" "phy0assoc" ucidef_set_led_wlan "wlan2" "WLAN2" "mr24:green:wifi2" "phy0assoc" @@ -15,7 +15,7 @@ mr24) ucidef_set_led_wlan "wlan4" "WLAN4" "mr24:green:wifi4" "phy0tpt" ;; -mx60) +meraki,mx60) ucidef_set_led_switch "wan" "WAN" "mx60:green:wan" "switch0" "0x20" ucidef_set_led_switch "lan1" "LAN1" "mx60:green:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "mx60:green:lan2" "switch0" "0x08" @@ -23,11 +23,12 @@ mx60) ucidef_set_led_switch "lan4" "LAN4" "mx60:green:lan4" "switch0" "0x02" ;; -mbl) +wd,mybooklive|\ +wd,mybooklive-duo) ucidef_set_led_ide "sata" "SATA" "mbl:blue:power" ;; -wndr4700) +netgear,wndr4700) ucidef_set_led_ide "sata" "SATA" "wndr4700:green:hd" ucidef_set_led_switch "wan_green" "WAN (green)" "wndr4700:green:wan" "switch0" "0x20" ucidef_set_led_netdev "wan_yellow" "WAN (yellow)" "wndr4700:yellow:wan" "eth0.2" "tx rx" diff --git a/target/linux/apm821xx/base-files/etc/board.d/02_network b/target/linux/apm821xx/base-files/etc/board.d/02_network index 03df7cb49..6f4456e8a 100755 --- a/target/linux/apm821xx/base-files/etc/board.d/02_network +++ b/target/linux/apm821xx/base-files/etc/board.d/02_network @@ -8,13 +8,14 @@ board_config_update board=$(board_name) case "$board" in -mbl|\ -mr24) +meraki,mr24|\ +wd,mybooklive|\ +wd,mybooklive-duo) ucidef_set_interface_lan "eth0" ;; -mx60|\ -wndr4700) +meraki,mx60|\ +netgear,wndr4700) ucidef_add_switch "switch0" \ "0@eth0" "4:lan" "3:lan" "2:lan" "1:lan" "5:wan" ;; diff --git a/target/linux/apm821xx/base-files/etc/diag.sh b/target/linux/apm821xx/base-files/etc/diag.sh index eb9b04b52..26c035c6f 100755 --- a/target/linux/apm821xx/base-files/etc/diag.sh +++ b/target/linux/apm821xx/base-files/etc/diag.sh @@ -3,40 +3,42 @@ . /lib/functions.sh . /lib/functions/leds.sh -get_status_led() { - local board=$(board_name) - - case $board in - mbl|\ - mr24|\ - mx60|\ - wndr4700) - status_led="$board:green:power" - ;; - - *) - ;; - esac -} +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" +upgrade="$(get_dt_led upgrade)" set_state() { - get_status_led + status_led="$boot" case "$1" in - preinit) - status_led_blink_preinit - ;; - - failsafe) - status_led_blink_failsafe - ;; - preinit_regular) status_led_blink_preinit_regular ;; - + preinit) + status_led_blink_preinit + ;; + failsafe) + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_off + } + status_led="$failsafe" + status_led_blink_failsafe + ;; + upgrade) + [ -n "$running" ] && { + status_led="$upgrade" + status_led_blink_preinit_regular + } + ;; done) - status_led_on + status_led_off + [ -n "$running" ] && { + status_led="$running" + status_led_on + } ;; esac } diff --git a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 4a7e1c0b1..7a13a0afa 100644 --- a/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/apm821xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -52,7 +52,7 @@ board=$(board_name) case "$FIRMWARE" in "pci_wmac0.eeprom") case $board in - wndr4700) + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then @@ -70,7 +70,7 @@ case "$FIRMWARE" in "pci_wmac1.eeprom") case $board in - wndr4700) + netgear,wndr4700) . /lib/upgrade/nand.sh if [ -n "$(nand_find_volume ubi0 caldata)" ]; then diff --git a/target/linux/apm821xx/base-files/lib/apm821xx.sh b/target/linux/apm821xx/base-files/lib/apm821xx.sh deleted file mode 100755 index 8f0814b29..000000000 --- a/target/linux/apm821xx/base-files/lib/apm821xx.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -APM821XX_BOARD_NAME= -APM821XX_MODEL= - -apm821xx_board_detect() { - local model - local name - - model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo) - - case "$model" in - *"Meraki MR24 Access Point") - name="mr24" - ;; - - *"Meraki MX60/MX60W Security Appliance") - name="mx60" - ;; - - *"MyBook Live"*) - name="mbl" - ;; - - *"Netgear WNDR4700/WNDR4720 Series") - name="wndr4700" - ;; - - *) - name="unknown" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$APM821XX_BOARD_NAME" ] && APM821XX_BOARD_NAME="$name" - [ -z "$APM821XX_MODEL" ] && APM821XX_MODEL="$model" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$APM821XX_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$APM821XX_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh b/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh deleted file mode 100644 index 567535753..000000000 --- a/target/linux/apm821xx/base-files/lib/preinit/01_preinit_do_apm821xx.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_apm821xx() { - . /lib/apm821xx.sh - - apm821xx_board_detect -} - -boot_hook_add preinit_main do_apm821xx diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx index ec540feb8..1a27930d2 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_iface_mac_apm821xx @@ -4,8 +4,8 @@ preinit_set_mac_address() { . /lib/functions.sh case $(board_name) in - mr24|\ - mx60) + meraki,mr24|\ + meraki,mx60) mac_lan=$(mtd_get_mac_binary_ubi board-config 102) [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" ;; diff --git a/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx b/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx index 97ef6dc68..a15a055a2 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx +++ b/target/linux/apm821xx/base-files/lib/preinit/05_set_preinit_iface_apm821xx @@ -1,7 +1,5 @@ #!/bin/sh -. /lib/apm821xx.sh - apm821xx_set_preinit_iface() { ifname=eth0 } diff --git a/target/linux/apm821xx/base-files/lib/preinit/79_move_config b/target/linux/apm821xx/base-files/lib/preinit/79_move_config index 3ca8b0a71..5d33feb91 100644 --- a/target/linux/apm821xx/base-files/lib/preinit/79_move_config +++ b/target/linux/apm821xx/base-files/lib/preinit/79_move_config @@ -5,12 +5,18 @@ BOOTPART=/dev/sda1 move_config() { . /lib/functions.sh - [ "$(board_name)" = "mbl" ] || return - if [ -b $BOOTPART ]; then - mkdir -p /boot - mount -t ext4 -o rw,noatime $BOOTPART /boot - [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / - fi + case "$(board_name)" in + wd,mybooklive|\ + wd,mybooklive-duo) + if [ -b $BOOTPART ]; then + mkdir -p /boot + mount -t ext4 -o rw,noatime $BOOTPART /boot + [ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz / + fi + ;; + *) + ;; + esac } boot_hook_add preinit_mount_root move_config diff --git a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh b/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh deleted file mode 100755 index fb961b894..000000000 --- a/target/linux/apm821xx/base-files/lib/upgrade/merakinand.sh +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2016 Chris Blake -# -# Custom upgrade script for Meraki NAND devices (ex. MR24) -# Based on merakinand.sh from the ar71xx target -# -. /lib/apm821xx.sh -. /lib/functions.sh - -merakinand_do_kernel_check() { - local board_name="$1" - local tar_file="$2" - local image_magic_word=`(tar xf $tar_file sysupgrade-$board_name/kernel -O 2>/dev/null | dd bs=1 count=4 skip=0 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"')` - - # What is our kernel magic string? - case "$board_name" in - "mr24"|\ - "mx60") - [ "$image_magic_word" == "8e73ed8a" ] && { - echo "pass" && return 0 - } - ;; - esac - - exit 1 -} - -merakinand_do_platform_check() { - local board_name="$1" - local tar_file="$2" - local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` - local file_type="$(identify_tar $2 sysupgrade-$board_name/root)" - local kernel_magic="$(merakinand_do_kernel_check $1 $2)" - - case "$board_name" in - "mr24"|\ - "mx60") - [ "$control_length" = 0 -o "$file_type" != "squashfs" -o "$kernel_magic" != "pass" ] && { - echo "Invalid sysupgrade file for $board_name" - return 1 - } - ;; - *) - echo "Unsupported device $board_name"; - return 1 - ;; - esac - - return 0 -} - -merakinand_do_upgrade() { - local tar_file="$1" - local board_name="$(board_name)" - - # Do we need to do any platform tweaks? - case "$board_name" in - "mr24"|\ - "mx60") - nand_do_upgrade $1 - ;; - *) - echo "Unsupported device $board_name"; - exit 1 - ;; - esac -} diff --git a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh index 55f8ffa75..5d2eee4ca 100755 --- a/target/linux/apm821xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/platform.sh @@ -1,47 +1,30 @@ #!/bin/sh PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 platform_check_image() { local board=$(board_name) - [ "$#" -gt 1 ] && return 1 - case "$board" in - mbl) - mbl_do_platform_check $board "$1" + wd,mybooklive|\ + wd,mybooklive-duo) + mbl_do_platform_check "$1" return $?; ;; - - mr24|\ - mx60) - merakinand_do_platform_check $board "$1" - return $?; - ;; - - wndr4700) - nand_do_platform_check $board "$1" - return $?; - ;; - *) + return 0 ;; esac - - echo "Sysupgrade is not yet supported on $board." - return 1 } platform_pre_upgrade() { local board=$(board_name) case "$board" in - mr24|\ - mx60) - merakinand_do_upgrade "$1" - ;; - - wndr4700) + meraki,mr24|\ + meraki,mx60|\ + netgear,wndr4700) nand_do_upgrade "$1" ;; @@ -54,7 +37,8 @@ platform_do_upgrade() { local board=$(board_name) case "$board" in - mbl) + wd,mybooklive|\ + wd,mybooklive-duo) mbl_do_upgrade "$ARGV" ;; @@ -68,7 +52,8 @@ platform_copy_config() { local board=$(board_name) case "$board" in - mbl) + wd,mybooklive|\ + wd,mybooklive-duo) mbl_copy_config ;; diff --git a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh index d7347516c..2287e0619 100644 --- a/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh +++ b/target/linux/apm821xx/base-files/lib/upgrade/wdbook.sh @@ -1,36 +1,99 @@ . /lib/functions.sh -get_magic_at() { - local file="$1" - local pos="$2" - get_image "$file" | dd bs=1 count=2 skip="$pos" 2>/dev/null | hexdump -v -n 2 -e '1/1 "%02x"' -} +# copied from x86's platform.sh mbl_do_platform_check() { - local board="$1" - local file="$2" - local magic + local diskdev partdev diff - magic=$(get_magic_at "$file" 510) + [ "$#" -gt 1 ] && return 1 - [ "$magic" != "55aa" ] && { - echo "Failed to verify MBR boot signature." + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" return 1 } + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b 2>/dev/null + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + + rm -f /tmp/image.bs /tmp/partmap.bootdisk /tmp/partmap.image + + if [ -n "$diff" ]; then + echo "Partition layout has changed. Full image will be written." + ask_bool 0 "Abort" && exit 1 + return 0 + fi + return 0; } mbl_do_upgrade() { + local diskdev partdev diff + + export_bootdevice && export_partdevice diskdev -2 || { + echo "Unable to determine upgrade device" + return 1 + } + sync - get_image "$1" | dd of=/dev/sda bs=2M conv=fsync - sleep 1 + + if [ "$SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + + #extract the boot sector from the image + get_image "$@" | dd of=/tmp/image.bs count=1 bs=512b + + get_partitions /tmp/image.bs image + + #compare tables + diff="$(grep -F -x -v -f /tmp/partmap.bootdisk /tmp/partmap.image)" + else + diff=1 + fi + + if [ -n "$diff" ]; then + get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync + + # Separate removal and addtion is necessary; otherwise, partition 1 + # will be missing if it overlaps with the old partition 2 + partx -d - "/dev/$diskdev" + partx -a - "/dev/$diskdev" + + return 0 + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + # root is /dev/sd[a|b]2 and not /dev/sd[a|b] this causes some problem + # one of which is this offset, I'm not sure what's the best fix, so + # here's a WA. + let part=$((part - 2)) + if export_partdevice partdev $part; then + echo "Writing image to /dev/$partdev..." + get_image "$@" | dd of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + else + echo "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + #copy partition uuid + echo "Writing new UUID to /dev/$diskdev..." + get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync } mbl_copy_config() { - mkdir -p /boot - [ -f /boot/uImage ] || mount -t ext4 -o rw,noatime /dev/sda1 /boot - cp -af "$CONF_TAR" /boot/ - sync - umount /boot + local partdev + + # Same as above /dev/sd[a|b]2 is root, so /boot is -1 + if export_partdevice partdev -1; then + mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt + cp -af "$CONF_TAR" /mnt/ + umount /mnt + fi } diff --git a/target/linux/apm821xx/dts/apollo3g.dtsi b/target/linux/apm821xx/dts/apollo3g.dtsi index 783348a67..e88973f8d 100644 --- a/target/linux/apm821xx/dts/apollo3g.dtsi +++ b/target/linux/apm821xx/dts/apollo3g.dtsi @@ -14,6 +14,10 @@ aliases { serial0 = &UART0; + led-boot = &status; + led-failsafe = &status; + led-running = &status; + led-upgrade = &status; }; }; @@ -113,13 +117,13 @@ gpio-leds { compatible = "gpio-leds"; - power-red { + failsafe: power-red { label = "mbl:red:power"; gpios = <&GPIO1 4 GPIO_ACTIVE_HIGH>; linux,default-trigger = "panic"; }; - power-green { + status: power-green { label = "mbl:green:power"; gpios = <&GPIO1 5 GPIO_ACTIVE_HIGH>; }; @@ -167,6 +171,17 @@ &EMAC0 { status = "okay"; + + phy-map = <0x2>; + phy-address = <0x1>; + phy-handle = <&phy>; + + mdio { + phy: phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; }; &SATA1 { diff --git a/target/linux/apm821xx/dts/MR24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts similarity index 91% rename from target/linux/apm821xx/dts/MR24.dts rename to target/linux/apm821xx/dts/meraki-mr24.dts index 8d20872c3..2c2f8d281 100644 --- a/target/linux/apm821xx/dts/MR24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -16,10 +16,14 @@ / { model = "Meraki MR24 Access Point"; - compatible = "meraki,ikarem"; + compatible = "meraki,mr24", "meraki,ikarem", "apm,bluestone"; aliases { serial0 = &UART1; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -91,12 +95,12 @@ gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "mr24:green:power"; gpios = <&GPIO0 18 GPIO_ACTIVE_LOW>; }; - power-orange { + failsafe: power-orange { label = "mr24:orange:power"; gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/apm821xx/dts/MX60.dts b/target/linux/apm821xx/dts/meraki-mx60.dts similarity index 93% rename from target/linux/apm821xx/dts/MX60.dts rename to target/linux/apm821xx/dts/meraki-mx60.dts index 4ec0043f3..32e5c859e 100644 --- a/target/linux/apm821xx/dts/MX60.dts +++ b/target/linux/apm821xx/dts/meraki-mx60.dts @@ -16,10 +16,14 @@ / { model = "Meraki MX60/MX60W Security Appliance"; - compatible = "meraki,buckminster"; + compatible = "meraki,mx60", "meraki,buckminster", "apm,bluestone"; aliases { serial0 = &UART1; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -120,12 +124,12 @@ gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "mx60:green:power"; gpios = <&GPIO0 18 GPIO_ACTIVE_LOW>; }; - power-orange { + failsafe: power-orange { label = "mx60:orange:power"; gpios = <&GPIO0 19 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/apm821xx/dts/wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts similarity index 98% rename from target/linux/apm821xx/dts/wndr4700.dts rename to target/linux/apm821xx/dts/netgear-wndr4700.dts index d1a65f3e6..2e0addf74 100644 --- a/target/linux/apm821xx/dts/wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -19,6 +19,10 @@ aliases { serial0 = &UART0; + led-boot = &status; + led-failsafe = &failsafe; + led-running = &status; + led-upgrade = &status; }; chosen { @@ -348,12 +352,12 @@ gpio-leds { compatible = "gpio-leds"; - power-green { + status: power-green { label = "wndr4700:green:power"; gpios = <&GPIO0 8 GPIO_ACTIVE_HIGH>; }; - power-orange { + failsafe: power-orange { label = "wndr4700:orange:power"; gpios = <&GPIO0 9 GPIO_ACTIVE_LOW>; linux,default-trigger = "panic"; diff --git a/target/linux/apm821xx/dts/apollo3g-duo.dts b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts similarity index 92% rename from target/linux/apm821xx/dts/apollo3g-duo.dts rename to target/linux/apm821xx/dts/wd-mybooklive-duo.dts index 53459b0cc..4f6cc506f 100644 --- a/target/linux/apm821xx/dts/apollo3g-duo.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive-duo.dts @@ -14,6 +14,7 @@ #include "apollo3g.dtsi" / { + compatible = "wd,mybooklive-duo", "amcc,apollo3g"; model = "MyBook Live Duo"; }; diff --git a/target/linux/apm821xx/dts/apollo3g.dts b/target/linux/apm821xx/dts/wd-mybooklive.dts similarity index 89% rename from target/linux/apm821xx/dts/apollo3g.dts rename to target/linux/apm821xx/dts/wd-mybooklive.dts index 4d31edae4..d84135229 100644 --- a/target/linux/apm821xx/dts/apollo3g.dts +++ b/target/linux/apm821xx/dts/wd-mybooklive.dts @@ -12,5 +12,6 @@ #include "apollo3g.dtsi" / { + compatible = "wd,mybooklive", "amcc,apollo3g"; model = "MyBook Live"; }; diff --git a/target/linux/apm821xx/image/Makefile b/target/linux/apm821xx/image/Makefile index ee85292d5..c012906ea 100644 --- a/target/linux/apm821xx/image/Makefile +++ b/target/linux/apm821xx/image/Makefile @@ -5,16 +5,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -DEVICE_VARS += DEVICE_PROFILE IMAGE_SIZE DTB_SIZE +DEVICE_VARS += IMAGE_SIZE DTB_SIZE define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard ../dts/$$(DEVICE_DTS).dts) - DEVICE_PROFILE := DEVICE_DTS := KERNEL_ENTRY := 0x00000000 KERNEL_LOADADDR := 0x00000000 DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES = $(subst _,$(comma),$(1)) endef define Build/dtb @@ -61,17 +61,17 @@ endef define Build/MerakiNAND -$(STAGING_DIR_HOST)/bin/mkmerakifw \ - -B $(DEVICE_PROFILE) -s \ + -B $(BOARD_NAME) -s \ -i $@ \ -o $@.new @cp $@.new $@ endef -define Device/mr24 +define Device/meraki_mr24 DEVICE_TITLE := Cisco Meraki MR24 DEVICE_PACKAGES := kmod-spi-gpio - DEVICE_PROFILE := MR24 - DEVICE_DTS := MR24 + BOARD_NAME := mr24 + DEVICE_DTS := meraki-mr24 BLOCKSIZE := 63k IMAGES := sysupgrade.tar DTB_SIZE := 64512 @@ -82,17 +82,18 @@ define Device/mr24 check-size $$(KERNEL_SIZE) | \ MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ MerakiNAND - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += mr24 endef -TARGET_DEVICES += mr24 +TARGET_DEVICES += meraki_mr24 -define Device/mx60 +define Device/meraki_mx60 DEVICE_TITLE := Cisco Meraki MX60/MX60W DEVICE_PACKAGES := kmod-spi-gpio kmod-usb-ledtrig-usbport kmod-usb-dwc2 \ kmod-usb-storage block-mount - DEVICE_PROFILE := MX60 - DEVICE_DTS := MX60 + BOARD_NAME := mx60 + DEVICE_DTS := meraki-mx60 BLOCKSIZE := 63k IMAGES := sysupgrade.tar DTB_SIZE := 64512 @@ -107,10 +108,11 @@ define Device/mx60 check-size $$(KERNEL_SIZE) | \ MerakiAdd-dtb | pad-to 2047k | MerakiAdd-initramfs | \ MerakiNAND - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += mx60 endef -TARGET_DEVICES += mx60 +TARGET_DEVICES += meraki_mx60 define Build/create-uImage-dtb # flat_dt target expect FIT image - which WNDR4700's uboot doesn't support @@ -145,21 +147,20 @@ define Build/wndr4700-specialImage -$(STAGING_DIR_HOST)/bin/mkimage -A $(LINUX_KARCH) -O linux -T multi \ -C $(1) -a $(KERNEL_LOADADDR) -e $(KERNEL_ENTRY) \ - -n '$(DEVICE_PROFILE) initramfs' -d $@:$@.fakerd:$@.dtb $@.new + -n '$(BOARD_NAME) initramfs' -d $@:$@.fakerd:$@.dtb $@.new mv $@.new $@ rm -rf $@.fakerd endef -define Device/WNDR4700 +define Device/netgear_wndr4700 DEVICE_TITLE := Netgear Centria N900 WNDR4700/WNDR4720 DEVICE_PACKAGES := badblocks block-mount e2fsprogs \ kmod-dm kmod-fs-ext4 kmod-fs-vfat kmod-usb-ledtrig-usbport \ kmod-md-mod kmod-nls-cp437 kmod-nls-iso8859-1 kmod-nls-iso8859-15 \ kmod-nls-utf8 kmod-usb3 kmod-usb-dwc2 kmod-usb-storage \ partx-utils - DEVICE_NAME := wndr4700 - DEVICE_PROFILE := wndr4700 - DEVICE_DTS := wndr4700 + BOARD_NAME := wndr4700 + DEVICE_DTS := netgear-wndr4700 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k @@ -172,13 +173,14 @@ define Device/WNDR4700 KERNEL_INITRAMFS := kernel-bin | gzip | dtb | wndr4700-specialImage gzip IMAGE/factory.img := create-uImage-dtb | append-kernel | pad-to 2M | append-ubi | \ netgear-dni | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade.tar := sysupgrade-tar + IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata IMAGE/kernel.dtb := export-dtb | uImage none NETGEAR_BOARD_ID := WNDR4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 + SUPPORTED_DEVICES += wndr4700 endef -TARGET_DEVICES += WNDR4700 +TARGET_DEVICES += netgear_wndr4700 endif @@ -217,31 +219,31 @@ define Device/MyBookLiveDefault KERNEL := kernel-bin | dtb | gzip | uImage gzip KERNEL_INITRAMFS := kernel-bin | dtb | gzip | uImage gzip BOOT_SIZE := 8 - IMAGES := rootfs.img kernel.dtb + IMAGES := rootfs.img.gz kernel.dtb DEVICE_DTB := apollo3g.dtb FILESYSTEMS := ext4 IMAGE/kernel.dtb := export-dtb - IMAGE/rootfs.img := boot-script | boot-img | hdd-img + IMAGE/rootfs.img.gz := boot-script | boot-img | hdd-img | gzip | append-metadata endef -define Device/MyBookLiveSingle +define Device/wd_mybooklive $(Device/MyBookLiveDefault) DEVICE_TITLE := Western Digital My Book Live - DEVICE_DTS := apollo3g - DEVICE_PROFILE := apollo3g + DEVICE_DTS := wd-mybooklive + SUPPORTED_DEVICES += mbl endef -TARGET_DEVICES += MyBookLiveSingle +TARGET_DEVICES += wd_mybooklive -define Device/MyBookLiveDuo +define Device/wd_mybooklive-duo $(Device/MyBookLiveDefault) DEVICE_TITLE := Western Digital My Book Live Duo DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-mini - DEVICE_DTS := apollo3g-duo - DEVICE_PROFILE := ap2nc + DEVICE_DTS := wd-mybooklive-duo + SUPPORTED_DEVICES += mbl endef -TARGET_DEVICES += MyBookLiveDuo +TARGET_DEVICES += wd_mybooklive-duo endif diff --git a/target/linux/apm821xx/sata/config-default b/target/linux/apm821xx/sata/config-default index b8342de04..7ca6bd4d3 100644 --- a/target/linux/apm821xx/sata/config-default +++ b/target/linux/apm821xx/sata/config-default @@ -1,5 +1,6 @@ # CONFIG_IKAREM is not set CONFIG_APOLLO3G=y +CONFIG_BROADCOM_PHY=y CONFIG_EXT4_FS=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y diff --git a/target/linux/arc770/generic/target.mk b/target/linux/arc770/generic/target.mk index 15f598ee1..2ca59b579 100644 --- a/target/linux/arc770/generic/target.mk +++ b/target/linux/arc770/generic/target.mk @@ -1,5 +1,5 @@ BOARDNAME:=Generic -FEATURES += ramdisk usb ext4 +FEATURES += ramdisk usb ext4 source-only define Target/Description Build firmware images for generic ARC 770D based boards. diff --git a/target/linux/armvirt/64/config-default b/target/linux/armvirt/64/config-default index 8a8c50bc2..c58863dc8 100644 --- a/target/linux/armvirt/64/config-default +++ b/target/linux/armvirt/64/config-default @@ -47,6 +47,7 @@ CONFIG_ARM64_VA_BITS_39=y CONFIG_ARM64_VHE=y # CONFIG_ARMV8_DEPRECATED is not set CONFIG_ARM_GIC_V3_ITS=y +CONFIG_ARM_PMU=y # CONFIG_ARM_SBSA_WATCHDOG is not set CONFIG_ATOMIC64_SELFTEST=y CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y @@ -115,7 +116,6 @@ CONFIG_HW_RANDOM=y # CONFIG_HW_RANDOM_CAVIUM is not set CONFIG_HW_RANDOM_VIRTIO=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -# CONFIG_KASAN is not set CONFIG_LCD_CLASS_DEVICE=m # CONFIG_LCD_PLATFORM is not set # CONFIG_LIQUIDIO is not set diff --git a/target/linux/at91/Makefile b/target/linux/at91/Makefile index a3e0be7c8..cae3c6278 100644 --- a/target/linux/at91/Makefile +++ b/target/linux/at91/Makefile @@ -9,11 +9,11 @@ include $(TOPDIR)/rules.mk ARCH:=arm BOARD:=at91 MAINTAINER:=Claudio Mignanti -BOARDNAME:=Atmel AT91 -FEATURES:=squashfs targz ext2 usb usbgadget ubifs -SUBTARGETS:=legacy sama5d3 +BOARDNAME:=Microchip (Atmel AT91) +FEATURES:=ext4 squashfs targz usb usbgadget ubifs +SUBTARGETS:=sama5 legacy -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/at91/base-files/lib/at91.sh b/target/linux/at91/base-files/lib/at91.sh index 0fa2ee325..61921edd1 100755 --- a/target/linux/at91/base-files/lib/at91.sh +++ b/target/linux/at91/base-files/lib/at91.sh @@ -43,6 +43,12 @@ at91_board_detect() { *"SAMA5D3 Xplained") name="sama5d3_xplained" ;; + *"SAMA5D2 Xplained") + name="sama5d2_xplained" + ;; + *"SAMA5D4 Xplained") + name="sama5d4_xplained" + ;; *"CalAmp LMU5000") name="lmu5000" ;; diff --git a/target/linux/at91/config-4.4 b/target/linux/at91/config-4.9 similarity index 93% rename from target/linux/at91/config-4.4 rename to target/linux/at91/config-4.9 index 4e3b03611..c0151a591 100644 --- a/target/linux/at91/config-4.4 +++ b/target/linux/at91/config-4.9 @@ -1,6 +1,6 @@ CONFIG_ALIGNMENT_TRAP=y CONFIG_ARCH_AT91=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y CONFIG_ARCH_HAS_SG_CHAIN=y @@ -14,7 +14,6 @@ CONFIG_ARCH_MULTI_CPU_AUTO=y CONFIG_ARCH_MULTI_V4_V5=y CONFIG_ARCH_MULTI_V5=y CONFIG_ARCH_NR_GPIO=0 -CONFIG_ARCH_REQUIRE_GPIOLIB=y # CONFIG_ARCH_SELECT_MEMORY_MODEL is not set # CONFIG_ARCH_SPARSEMEM_DEFAULT is not set CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y @@ -24,7 +23,6 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y CONFIG_ARM=y CONFIG_ARM_APPENDED_DTB=y # CONFIG_ARM_ATAG_DTB_COMPAT is not set @@ -36,13 +34,15 @@ CONFIG_ARM_THUMB=y CONFIG_AT91SAM9X_WATCHDOG=y CONFIG_ATAGS=y CONFIG_ATMEL_AIC_IRQ=y +CONFIG_ATMEL_EBI=y CONFIG_ATMEL_PIT=y CONFIG_ATMEL_SDRAMC=y # CONFIG_ATMEL_TCLIB is not set +CONFIG_AT_HDMAC=y +# CONFIG_AT_XDMAC is not set CONFIG_AUTO_ZRELADDR=y # CONFIG_BLK_DEV_INITRD is not set # CONFIG_CACHE_L2X0 is not set -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLKSRC_OF=y CONFIG_CLKSRC_PROBE=y @@ -75,11 +75,14 @@ CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" # CONFIG_DEBUG_UART_8250 is not set # CONFIG_DEBUG_USER is not set -CONFIG_DEVPTS_MULTIPLE_INSTANCES=y +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y CONFIG_DTC=y CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y CONFIG_EXT4_FS=y +CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FRAME_POINTER=y CONFIG_FS_MBCACHE=y @@ -87,6 +90,7 @@ CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_EARLY_IOREMAP=y CONFIG_GENERIC_IDLE_POLL_SETUP=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y @@ -99,7 +103,6 @@ CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y -CONFIG_GPIO_DEVRES=y CONFIG_GPIO_SYSFS=y CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDIRQS_SW_RESEND=y @@ -118,7 +121,7 @@ CONFIG_HAVE_AT91_SMD=y CONFIG_HAVE_AT91_USB_CLK=y CONFIG_HAVE_AT91_UTMI=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CLK_PREPARE=y @@ -126,7 +129,6 @@ CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FB_ATMEL=y @@ -135,12 +137,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y -CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y CONFIG_HAVE_NET_DSA=y @@ -171,6 +167,7 @@ CONFIG_LZO_DECOMPRESS=y CONFIG_MACB=y CONFIG_MDIO_BOARDINFO=y CONFIG_MEMORY=y +CONFIG_MFD_SYSCON=y CONFIG_MICREL_PHY=y CONFIG_MIGHT_HAVE_PCI=y CONFIG_MMC=y @@ -186,7 +183,7 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_PHYSMAP=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 -# CONFIG_MTD_UBI_BLOCK is not set +CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 @@ -203,13 +200,11 @@ CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y -CONFIG_OF_MTD=y CONFIG_OF_NET=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND3=y CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PCI is not set # CONFIG_PCI_DOMAINS_GENERIC is not set # CONFIG_PCI_SYSCALL is not set CONFIG_PERF_USE_VMALLOC=y @@ -222,13 +217,18 @@ CONFIG_PINCTRL_AT91=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_AT91_POWEROFF=y CONFIG_POWER_RESET_AT91_RESET=y +# CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC is not set CONFIG_POWER_SUPPLY=y CONFIG_RATIONAL=y # CONFIG_RCU_STALL_COMMON is not set +CONFIG_REGMAP=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y CONFIG_RTC_CLASS=y # CONFIG_RTC_DRV_AT91RM9200 is not set # CONFIG_RTC_DRV_AT91SAM9 is not set # CONFIG_RTC_DRV_CMOS is not set +CONFIG_RTC_I2C_AND_SPI=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_SAMA5D4_WATCHDOG is not set # CONFIG_SCHED_INFO is not set @@ -251,6 +251,7 @@ CONFIG_SPLIT_PTLOCK_CPUS=999999 CONFIG_SRCU=y # CONFIG_STAGING is not set CONFIG_SWIOTLB=y +CONFIG_SWPHY=y CONFIG_SYS_SUPPORTS_APM_EMULATION=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_UBIFS_FS=y @@ -270,4 +271,3 @@ CONFIG_ZBOOT_ROM_BSS=0 CONFIG_ZBOOT_ROM_TEXT=0 CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts index 2aa04ca6f..728553bce 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/at91-q5xr5.dts @@ -168,7 +168,7 @@ }; }; - usb0: ohci@00500000 { + usb0: ohci@500000 { num-ports = <2>; status = "okay"; }; diff --git a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts index 921d44bee..fb3dd565a 100644 --- a/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts +++ b/target/linux/at91/files/arch/arm/boot/dts/lmu5000.dts @@ -117,7 +117,7 @@ }; }; - usb0: ohci@00500000 { + usb0: ohci@500000 { num-ports = <2>; status = "okay"; }; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts new file mode 100644 index 000000000..2d1fe0c08 --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb45n.dts @@ -0,0 +1,220 @@ +/* + * wb45n.dts - Device Tree file for WB45NBT board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "at91sam9g25.dtsi" + +/ { + model = "Laird Workgroup Bridge 45N - Atmel AT91SAM (dt)"; + compatible = "laird,wb45n", "laird,wbxx", "atmel,at91sam9x5", "atmel,at91sam9"; + + chosen { + bootargs = "console=ttyS0,115200 root=/dev/mtdblock1 rw rootfstype=ubifs ubi.mtd=1 root=ubi0:rootfs"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + main_clock: clock@0 { + compatible = "atmel,osc", "fixed-clock"; + clock-frequency = <12000000>; + }; + + slow_xtal { + clock-frequency = <32768>; + }; + + main_xtal { + clock-frequency = <12000000>; + }; + }; + + ahb { + apb { + + rstc@fffffe00 { + compatible = "atmel,sama5d3-rstc"; + }; + + pinctrl@fffff400 { + nand { + pinctrl_nand: nand-0 { + atmel,pins = + ; /* PD5 gpio RDY/BUSY pin pull_up */ + }; + }; + + usb2 { + pinctrl_board_usb2: usb2-board { + atmel,pins = + ; /* PB11 gpio vbus sense, deglitch */ + }; + }; + }; + + dbgu: serial@fffff200 { + status = "okay"; + }; + + usart0: serial@f801c000 { + status = "okay"; + }; + + usart3: serial@f8028000 { + status = "okay"; + }; + + spi0: spi@f0000000 { + status = "okay"; + cs-gpios = <&pioA 14 0>, <&pioA 7 0>, <0>, <0>; + }; + + mmc0: mmc@f0008000 { + pinctrl-0 = < + &pinctrl_mmc0_slot0_clk_cmd_dat0 + &pinctrl_mmc0_slot0_dat1_3>; + status = "okay"; + /delete-property/dmas; + /delete-property/dma-names; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + macb0: ethernet@f802c000 { + phy-mode = "rmii"; + status = "okay"; + }; + + usb2: gadget@f803c000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_board_usb2>; + atmel,vbus-gpio = <&pioB 11 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + + i2c1: i2c@f8014000 { + status = "okay"; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + + shdwc@fffffe10 { + atmel,wakeup-mode = "low"; + }; + + rtc@fffffeb0 { + status = "okay"; + }; + }; + + usb0: ohci@00600000 { + status = "okay"; + num-ports = <2>; + atmel,vbus-gpio = < + &pioB 12 GPIO_ACTIVE_HIGH + &pioA 31 GPIO_ACTIVE_HIGH + >; + atmel,oc-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + }; + + usb1: ehci@00700000 { + status = "okay"; + }; + + nand0: nand@40000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; /* Enable PMECC */ + atmel,pmecc-cap = <4>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bs"; + reg = <0x0 0x20000>; + }; + + uboot@20000 { + label = "u-boot"; + reg = <0x20000 0x80000>; + }; + + ubootenv@a0000 { + label = "u-boot-env"; + reg = <0xa0000 0x20000>; + }; + + ubootenv@c0000 { + label = "redund-env"; + reg = <0xc0000 0x20000>; + }; + + kernel-a@e0000 { + label = "kernel-a"; + reg = <0xe0000 0x280000>; + }; + + kernel-b@360000 { + label = "kernel-b"; + reg = <0x360000 0x280000>; + }; + + rootfs-a@5e0000 { + label = "rootfs-a"; + reg = <0x5e0000 0x2600000>; + }; + + rootfs-b@2be0000 { + label = "rootfs-b"; + reg = <0x2be0000 0x2600000>; + }; + + user@51e0000 { + label = "user"; + reg = <0x51e0000 0x2dc0000>; + }; + + logs@7fa0000 { + label = "logs"; + reg = <0x7fa0000 0x60000>; + }; + }; + }; + + atheros { + compatible = "atheros,ath6kl"; + atheros,board-id = "SD32"; + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + irqbtn@pb18 { + label = "IRQBTN"; + linux,code = <99>; + gpios = <&pioB 18 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + }; +}; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts new file mode 100644 index 000000000..9c28a2197 --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dts @@ -0,0 +1,117 @@ +/* + * wb50n.dts - Device Tree file for wb50n board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +/dts-v1/; +#include "wb50n.dtsi" + +/ { + model = "Laird Workgroup Bridge 50N - Atmel SAMA5D"; + compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M"; + }; + + ahb { + + apb { + mmc0: mmc@f0000000 { + status = "okay"; + }; + + macb1: ethernet@f802c000 { + status = "okay"; + }; + + dbgu: serial@ffffee00 { + status = "okay"; + }; + + /* On BB40 this port is labeled UART1 */ + usart0: serial@f001c000 { + status = "okay"; + }; + + /* On BB40 this port is labeled UART0 */ + usart1: serial@f0020000 { + status = "okay"; + }; + + i2c0: i2c@f0014000 { + status = "okay"; + }; + + spi1: spi@f8008000 { + status = "okay"; + + spidev@0 { + compatible = "spidev"; + reg = <0>; + spi-max-frequency = <8000000>; + }; + }; + + watchdog@fffffe40 { + status = "okay"; + }; + }; + + usb0: gadget@00500000 { + status = "okay"; + }; + + usb1: ohci@00600000 { + status = "okay"; + }; + + usb2: ehci@00700000 { + status = "okay"; + }; + + }; + + gpio_keys { + compatible = "gpio-keys"; + #address-cells = <1>; + #size-cells = <0>; + btn0@pa10 { + label = "BTNESC"; + linux,code = <1>; /* ESC button */ + gpios = <&pioA 10 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + + irqbtn@pe31 { + label = "IRQBTN"; + linux,code = <99>; /* SysReq button */ + gpios = <&pioE 31 GPIO_ACTIVE_LOW>; + gpio-key,wakeup = <1>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led0 { + label = "wb50n:blue:led0"; + gpios = <&pioA 12 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led1 { + label = "wb50n:green:led1"; + gpios = <&pioA 24 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + led2 { + label = "wb50n:red:led2"; + gpios = <&pioA 26 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + }; +}; diff --git a/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi new file mode 100644 index 000000000..8d3042444 --- /dev/null +++ b/target/linux/at91/files/arch/arm/boot/dts/wb50n.dtsi @@ -0,0 +1,205 @@ +/* + * wb50n.dts - Device Tree file for wb50n board + * + * Copyright (C) 2015 Laird + * + * Licensed under GPLv2 or later. + */ +#include "sama5d31.dtsi" + +/ { + model = "Laird Workgroup Bridge 50N - Atmel SAMA5D"; + compatible = "laird,wb50n", "atmel,sama5d31ek", "atmel,sama5d3xmb", "atmel,sama5d3xcm", "atmel,sama5d31", "atmel,sama5d3", "atmel,sama5"; + + chosen { + bootargs = "console=ttyS0,115200 earlyprintk loglevel=4 mem=64M"; + }; + + memory { + reg = <0x20000000 0x4000000>; + }; + + clocks { + slow_xtal { + clock-frequency = <32768>; + }; + + main_xtal { + clock-frequency = <12000000>; + }; + }; + + ahb { + + apb { + pmc: pmc@fffffc00 { + main: mainck { + clock-frequency = <12000000>; + }; + + periphck { + usart1_clk: usart1_clk { + #clock-cells = <0>; + reg = <13>; + atmel,clk-output-range = <0 132000000>; + }; + }; + }; + + pinctrl@fffff200 { + board { + pinctrl_mmc0_cd: mmc0_cd { + atmel,pins = + ; /* PC26 GPIO with pullup deglitch */ + }; + + pinctrl_usba_vbus: usba_vbus { + atmel,pins = + ; /* PB13 GPIO with deglitch */ + }; + }; + }; + + mmc0: mmc@f0000000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mmc0_clk_cmd_dat0 &pinctrl_mmc0_dat1_3 &pinctrl_mmc0_cd>; + cd-gpios = <&pioC 26 GPIO_ACTIVE_LOW>; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + mmc1: mmc@f8000000 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_mmc1_clk_cmd_dat0 &pinctrl_mmc1_dat1_3>; + status = "okay"; + slot@0 { + reg = <0>; + bus-width = <4>; + }; + }; + + macb1: ethernet@f802c000 { + phy-mode = "rmii"; + }; + + + dbgu: serial@ffffee00 { + dmas = <0>, <0>; /* Do not use DMA for dbgu */ + }; + + /* On BB40 this port is labeled UART1 */ + usart0: serial@f001c000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart0 &pinctrl_usart0_rts_cts>; + }; + + /* On BB40 this port is labeled UART0 */ + usart1: serial@f0020000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart1 &pinctrl_usart1_rts_cts>; + dtr-gpios = <&pioD 13 GPIO_ACTIVE_LOW>; + dsr-gpios = <&pioD 11 GPIO_ACTIVE_LOW>; + dcd-gpios = <&pioD 7 GPIO_ACTIVE_LOW>; + rng-gpios = <&pioD 8 GPIO_ACTIVE_LOW>; + }; + + /* USART3 is direct-connect to the Bluetooth UART on the radio SIP */ + usart3: serial@f8024000 { + atmel,use-dma-rx; + atmel,use-dma-tx; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usart3 &pinctrl_usart3_rts_cts>; + status = "okay"; + }; + + spi1: spi@f8008000 { + cs-gpios = <&pioC 25 0>, <0>, <0>, <0>; + }; + + sckc@fffffe50 { + slow_osc: slow_osc { + atmel,osc-bypass; + }; + }; + }; + + nand0: nand@60000000 { + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + atmel,has-pmecc; + atmel,pmecc-cap = <8>; + atmel,pmecc-sector-size = <512>; + nand-on-flash-bbt; + status = "okay"; + + at91bootstrap@0 { + label = "at91bs"; + reg = <0x0 0x20000>; + }; + + uboot@20000 { + label = "u-boot"; + reg = <0x20000 0x80000>; + }; + + ubootenv@a0000 { + label = "u-boot-env"; + reg = <0xa0000 0x20000>; + }; + + ubootenv@c0000 { + label = "u-boot-env"; + reg = <0xc0000 0x20000>; + }; + + kernel-a@e0000 { + label = "kernel-a"; + reg = <0xe0000 0x500000>; + }; + + kernel-b@5e0000 { + label = "kernel-b"; + reg = <0x5e0000 0x500000>; + }; + + rootfs-a@ae0000 { + label = "rootfs-a"; + reg = <0xae0000 0x3000000>; + }; + + rootfs-b@3ae0000 { + label = "rootfs-b"; + reg = <0x3ae0000 0x3000000>; + }; + + user@6ae0000 { + label = "user"; + reg = <0x6ae0000 0x14e0000>; + }; + + }; + + usb0: gadget@00500000 { + atmel,vbus-gpio = <&pioB 13 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usba_vbus>; + }; + + usb1: ohci@00600000 { + num-ports = <3>; + atmel,vbus-gpio = <&pioA 2 GPIO_ACTIVE_LOW>; + atmel,oc-gpio = <&pioA 4 GPIO_ACTIVE_LOW>; + }; + }; + + atheros { + compatible = "atheros,ath6kl"; + atheros,board-id = "SD32"; + }; +}; diff --git a/target/linux/at91/files/drivers/mtd/at91part.c b/target/linux/at91/files/drivers/mtd/at91part.c deleted file mode 100644 index 31f3bbd69..000000000 --- a/target/linux/at91/files/drivers/mtd/at91part.c +++ /dev/null @@ -1,122 +0,0 @@ -/* - * - * Copyright (C) 2007 OpenWrt.org - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - * Atmel AT91 flash partition table. (Modified by Hamish Guthrie). - * Based on ar7 map by Felix Fietkau. - * - */ - -#include -#include - -#include -#include -#include -#include - -static struct mtd_partition at91_parts[6]; - -static int create_mtd_partitions(struct mtd_info *master, - struct mtd_partition **pparts, - unsigned long origin) -{ - unsigned int offset, len; - unsigned int pre_size = 0x42000, root_max = 0x362400; - unsigned char buf[512]; - struct squashfs_super_block *sb = (struct squashfs_super_block *) buf; - - printk("Parsing AT91 partition map...\n"); - - at91_parts[0].name = "loaders"; - at91_parts[0].offset = 0; - at91_parts[0].size = 0x21000; - at91_parts[0].mask_flags = MTD_WRITEABLE; - - at91_parts[1].name = "ubparams"; - at91_parts[1].offset = 0x21000; - at91_parts[1].size = 0x8400; - at91_parts[1].mask_flags = 0; - - at91_parts[2].name = "kernel"; - at91_parts[2].offset = pre_size; - at91_parts[2].size = 0; - at91_parts[2].mask_flags = 0; - - at91_parts[3].name = "rootfs"; - at91_parts[3].offset = 0; - at91_parts[3].size = 0; - at91_parts[3].mask_flags = 0; - - for(offset = pre_size; offset < root_max; offset += master->erasesize) { - - memset(&buf, 0xe5, sizeof(buf)); - - if (master->read(master, offset, sizeof(buf), &len, buf) || len != sizeof(buf)) - break; - - if (*((__u32 *) buf) == SQUASHFS_MAGIC) { - printk(KERN_INFO "%s: Filesystem type: squashfs, size=0x%x\n", - master->name, (u32) sb->bytes_used); - - at91_parts[3].size = sb->bytes_used; - at91_parts[3].offset = offset; - len = at91_parts[3].offset + at91_parts[3].size; - len = ((len / (master->erasesize * 8)) + 1) * master->erasesize * 8; - at91_parts[3].size = len - at91_parts[3].offset; - at91_parts[2].size = offset - at91_parts[2].offset; - break; - } - } - - if (at91_parts[3].size == 0) { - printk(KERN_NOTICE "%s: Couldn't find root filesystem\n", master->name); - return -1; - } - - at91_parts[4].name = "rootfs_data"; - at91_parts[4].offset = root_max; - at91_parts[4].size = master->size - root_max; - at91_parts[4].mask_flags = 0; - - at91_parts[5].name = "complete"; - at91_parts[5].offset = 0; - at91_parts[5].size = master->size; - at91_parts[5].mask_flags = 0; - - *pparts = at91_parts; - return 6; -} - -static struct mtd_part_parser at91_parser = { - .owner = THIS_MODULE, - .parse_fn = create_mtd_partitions, - .name = "at91part", -}; - -static int __init at91_parser_init(void) -{ - register_mtd_parser(&at91_parser); - - return 0; -} - -module_init(at91_parser_init); - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Felix Fietkau, Eugene Konev, Hamish Guthrie"); -MODULE_DESCRIPTION("MTD partitioning for Atmel at91"); diff --git a/target/linux/at91/image/Makefile b/target/linux/at91/image/Makefile index d1ae61484..12607073e 100644 --- a/target/linux/at91/image/Makefile +++ b/target/linux/at91/image/Makefile @@ -11,24 +11,20 @@ KERNEL_LOADADDR := 0x20008000 ifeq ($(SUBTARGET),legacy) include ./legacy.mk -UBIFS_OPTS := -m 2048 -e 126KiB -c 2048 endif -ifeq ($(SUBTARGET),sama5d3) -include ./sama5d3.mk -UBIFS_OPTS := -m 2048 -e 124KiB -c 2048 +ifeq ($(SUBTARGET),sama5) +include ./sama5.mk endif define Device/Default + $(Device/default-nand) PROFILES := Default FILESYSTEMS := squashfs ubifs DEVICE_DTS := $(1) KERNEL_NAME := zImage KERNEL_SIZE := 4096k KERNEL := kernel-bin | append-dtb | lzma | uImage lzma - BLOCKSIZE := 128k - PAGESIZE := 2048 - SUBPAGESIZE := 512 - DTB_SIZE := + DTB_SIZE := 128k endef define Device/dtb @@ -42,13 +38,25 @@ define Device/evaluation IMAGE/root.ubi := append-ubi endef +define Device/evaluation-zImage + IMAGES += zImage + IMAGE/zImage := install-zImage +endef + define Device/evaluation-dtb $(Device/evaluation) $(Device/dtb) + $(Device/evaluation-zImage) IMAGES += dtb IMAGE/dtb := install-dtb endef +define Device/evaluation-fit + $(Device/evaluation) + KERNEL_SUFFIX := -fit-uImage.itb + KERNEL := kernel-bin | lzma | fit lzma $$(DTS_DIR)/$$(DEVICE_DTS).dtb +endef + define Device/production UBINIZE_OPTS := -E 5 IMAGES := factory.bin @@ -58,7 +66,6 @@ endef define Device/production-dtb $(Device/production) $(Device/dtb) - DTB_SIZE := 128k IMAGE/factory.bin := append-dtb | pad-to $$$$(DTB_SIZE) \ | append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef diff --git a/target/linux/at91/image/gen_at91_sdcard_img.sh b/target/linux/at91/image/gen_at91_sdcard_img.sh new file mode 100755 index 000000000..316ecea2e --- /dev/null +++ b/target/linux/at91/image/gen_at91_sdcard_img.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +set -x +[ $# -eq 5 ] || { + echo "SYNTAX: $0 " + exit 1 +} + +OUTPUT="$1" +BOOTFS="$2" +ROOTFS="$3" +BOOTFSSIZE="$4" +ROOTFSSIZE="$5" + +head=4 +sect=2048 + +set `ptgen -o $OUTPUT -h $head -s $sect -l 1024 -t c -p ${BOOTFSSIZE}M -t 83 -p ${ROOTFSSIZE}M` + +BOOTOFFSET="$(($1 / 512))" +BOOTSIZE="$(($2 / 512))" +ROOTFSOFFSET="$(($3 / 512))" +ROOTFSSIZE="$(($4 / 512))" + +dd bs=512 if="$BOOTFS" of="$OUTPUT" seek="$BOOTOFFSET" conv=notrunc +dd bs=512 if="$ROOTFS" of="$OUTPUT" seek="$ROOTFSOFFSET" conv=notrunc diff --git a/target/linux/at91/image/legacy.mk b/target/linux/at91/image/legacy.mk index 7fe388135..c6d9ed810 100644 --- a/target/linux/at91/image/legacy.mk +++ b/target/linux/at91/image/legacy.mk @@ -1,3 +1,10 @@ +define Device/default-nand + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 512 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 126KiB -c 2048 +endef + define Device/at91sam9263ek $(Device/evaluation-dtb) DEVICE_TITLE := Atmel AT91SAM9263-EK @@ -109,3 +116,18 @@ define Device/at91-q5xr5 KERNEL_SIZE := 2048k endef TARGET_DEVICES += at91-q5xr5 + +define Device/wb45n + $(Device/evaluation-fit) + DEVICE_TITLE := Laird WB45N + DEVICE_PACKAGES := \ + kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ + kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ + kmod-leds-gpio + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 +endef +TARGET_DEVICES += wb45n + diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk new file mode 100644 index 000000000..d33a39865 --- /dev/null +++ b/target/linux/at91/image/sama5.mk @@ -0,0 +1,91 @@ +AT91_SD_BOOT_PARTSIZE:=64 +FAT32_BLOCK_SIZE:=1024 +FAT32_BLOCKS:=$(shell echo \ + $$(($(AT91_SD_BOOT_PARTSIZE)*1024*1024/$(FAT32_BLOCK_SIZE)))) + +define Build/at91-sdcard + rm -f $@.boot + mkfs.fat -C $@.boot $(FAT32_BLOCKS) + + mcopy -i $@.boot $(KDIR)/zImage ::zImage + + $(foreach dts,$(DEVICE_DTS), \ + mcopy -i $@.boot $(DTS_DIR)/$(dts).dtb \ + ::$(dts).dtb; \ + mcopy -i $@.boot \ + $(BIN_DIR)/u-boot-$(dts:at91-%=%)_mmc/u-boot.bin \ + ::u-boot.bin; \ + $(CP) $(BIN_DIR)/at91bootstrap-$(dts:at91-%=%)sd_uboot*/*.bin \ + $(BIN_DIR)/BOOT.bin; \ + mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;) + + ./gen_at91_sdcard_img.sh \ + $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ + $@.boot \ + $(KDIR)/root.ext4 \ + $(AT91_SD_BOOT_PARTSIZE) \ + $(CONFIG_TARGET_ROOTFS_PARTSIZE) + + gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ + > $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz + + $(CP) $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz \ + $(BIN_DIR)/ + + rm -f $(BIN_DIR)/BOOT.bin + rm -f $@.boot +endef + +define Device/evaluation-sdimage + IMAGES += sdcard.img.gz + IMAGE/sdcard.img.gz := at91-sdcard +endef + +define Device/default-nand + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 2048 +endef + +define Device/at91-sama5d3_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D3 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d3_xplained + +define Device/at91-sama5d2_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D2 Xplained + KERNEL_SIZE := 6144k + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d2_xplained + +define Device/at91-sama5d4_xplained + $(Device/evaluation-dtb) + DEVICE_TITLE := Microchip(Atmel AT91) SAMA5D4 Xplained + KERNEL_SIZE := 6144k + BLOCKSIZE := 256k + PAGESIZE := 4096 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB -c 2082 -x lzo + $(Device/evaluation-sdimage) +endef +TARGET_DEVICES += at91-sama5d4_xplained + +define Device/wb50n + $(Device/evaluation-fit) + DEVICE_TITLE := Laird WB50N + DEVICE_PACKAGES := \ + kmod-mmc-at91 kmod-ath6kl-sdio ath6k-firmware \ + kmod-usb-storage kmod-fs-vfat kmod-fs-msdos \ + kmod-leds-gpio + BLOCKSIZE := 128k + PAGESIZE := 2048 + SUBPAGESIZE := 2048 + MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB -c 955 +endef +TARGET_DEVICES += wb50n diff --git a/target/linux/at91/image/sama5d3.mk b/target/linux/at91/image/sama5d3.mk deleted file mode 100644 index fb02ee1bc..000000000 --- a/target/linux/at91/image/sama5d3.mk +++ /dev/null @@ -1,8 +0,0 @@ -define Device/at91-sama5d3_xplained - $(Device/evaluation-dtb) - DEVICE_TITLE := Atmel AT91SAMA5D3XPLAINED - KERNEL_SIZE := 6144k - SUBPAGESIZE := 2048 -endef -TARGET_DEVICES += at91-sama5d3_xplained - diff --git a/target/linux/at91/legacy/config-default b/target/linux/at91/legacy/config-default index 12beb46f6..e69de29bb 100644 --- a/target/linux/at91/legacy/config-default +++ b/target/linux/at91/legacy/config-default @@ -1,33 +0,0 @@ -# CONFIG_ARCH_AT91RM9200 is not set -# CONFIG_ARCH_AT91SAM9260 is not set -# CONFIG_ARCH_AT91SAM9261 is not set -# CONFIG_ARCH_AT91SAM9263 is not set -# CONFIG_ARCH_AT91SAM9G10 is not set -# CONFIG_ARCH_AT91SAM9G20 is not set -# CONFIG_ARCH_AT91SAM9G45 is not set -# CONFIG_ARCH_AT91SAM9RL is not set -CONFIG_ARCH_AT91_NONE=y -CONFIG_ARM_L1_CACHE_SHIFT=5 -CONFIG_CPU_32v5=y -CONFIG_CPU_ABRT_EV5TJ=y -CONFIG_CPU_ARM926T=y -# CONFIG_CPU_CACHE_ROUND_ROBIN is not set -CONFIG_CPU_CACHE_VIVT=y -CONFIG_CPU_COPY_V4WB=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -# CONFIG_CPU_DCACHE_WRITETHROUGH is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_PABRT_LEGACY=y -CONFIG_CPU_TLB_V4WBI=y -# CONFIG_SOC_AT91RM9200 is not set -CONFIG_SOC_AT91SAM9=y -CONFIG_SOC_AT91SAM9260=y -CONFIG_SOC_AT91SAM9261=y -CONFIG_SOC_AT91SAM9263=y -CONFIG_SOC_AT91SAM9G45=y -CONFIG_SOC_AT91SAM9N12=y -CONFIG_SOC_AT91SAM9RL=y -CONFIG_SOC_AT91SAM9X5=y -CONFIG_SOC_SAM_V4_V5=y -# CONFIG_SOC_SAM_V7 is not set diff --git a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch similarity index 80% rename from target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch rename to target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch index aac5b3de5..2a64fb8a5 100644 --- a/target/linux/at91/patches-4.4/100-ARM-at91-build-dtb-for-LMU5000.patch +++ b/target/linux/at91/patches-4.9/100-ARM-at91-build-dtb-for-LMU5000.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -27,6 +27,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \ +@@ -32,6 +32,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ usb_a9g20.dtb \ usb_a9g20_lpw.dtb \ at91sam9m10g45ek.dtb \ diff --git a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch similarity index 81% rename from target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch rename to target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch index d6bf7ae41..1cee5588a 100644 --- a/target/linux/at91/patches-4.4/101-ARM-at91-build-dtb-for-q5xr5.patch +++ b/target/linux/at91/patches-4.9/101-ARM-at91-build-dtb-for-q5xr5.patch @@ -1,6 +1,6 @@ --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -35,6 +35,7 @@ dtb-$(CONFIG_SOC_SAM_V4_V5) += \ +@@ -40,6 +40,7 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ at91-ariettag25.dtb \ at91-cosino_mega2560.dtb \ at91-kizboxmini.dtb \ diff --git a/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch new file mode 100644 index 000000000..aeb523a5b --- /dev/null +++ b/target/linux/at91/patches-4.9/102-ARM-at91-build-dtb-for-wb45n.patch @@ -0,0 +1,12 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -45,7 +45,8 @@ dtb-$(CONFIG_SOC_AT91SAM9) += \ + at91sam9g25ek.dtb \ + at91sam9g35ek.dtb \ + at91sam9x25ek.dtb \ +- at91sam9x35ek.dtb ++ at91sam9x35ek.dtb \ ++ wb45n.dtb + dtb-$(CONFIG_SOC_SAM_V7) += \ + at91-kizbox2.dtb \ + at91-sama5d2_xplained.dtb \ diff --git a/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch new file mode 100644 index 000000000..a30a803c9 --- /dev/null +++ b/target/linux/at91/patches-4.9/103-ARM-at91-build-dtb-for-wb50n.patch @@ -0,0 +1,12 @@ +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -59,7 +59,8 @@ dtb-$(CONFIG_SOC_SAM_V7) += \ + at91-sama5d4_ma5d4evk.dtb \ + at91-sama5d4_xplained.dtb \ + at91-sama5d4ek.dtb \ +- at91-vinco.dtb ++ at91-vinco.dtb \ ++ wb50n.dtb + dtb-$(CONFIG_ARCH_ATLAS6) += \ + atlas6-evb.dtb + dtb-$(CONFIG_ARCH_ATLAS7) += \ diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default new file mode 100644 index 000000000..00d4cf930 --- /dev/null +++ b/target/linux/at91/sama5/config-default @@ -0,0 +1,52 @@ +# CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_PATCH_IDIV=y +# CONFIG_ARM_THUMBEE is not set +CONFIG_ARM_VIRT_EXT=y +CONFIG_ATMEL_AIC5_IRQ=y +CONFIG_CACHE_L2X0=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_HAS_ASID=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_GENERIC_PINCONF=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_AT91_GENERATED_CLK=y +CONFIG_HAVE_AT91_H32MX=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_SMP=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_IO_ACCESSORS=y +CONFIG_MMC_SDHCI_OF_AT91=y +CONFIG_MMC_SDHCI_PLTFM=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PINCTRL_AT91PIO4=y +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +CONFIG_PL310_ERRATA_753970=y +CONFIG_PL310_ERRATA_769419=y +CONFIG_POWER_RESET_AT91_SAMA5D2_SHDWC=y +CONFIG_SOC_SAMA5=y +CONFIG_SOC_SAMA5D2=y +CONFIG_SOC_SAMA5D3=y +CONFIG_SOC_SAMA5D4=y +CONFIG_SOC_SAM_V7=y +CONFIG_SPLIT_PTLOCK_CPUS=4 +# CONFIG_SWP_EMULATE is not set +# CONFIG_THUMB2_KERNEL is not set diff --git a/target/linux/at91/sama5/target.mk b/target/linux/at91/sama5/target.mk new file mode 100644 index 000000000..8ff6c761a --- /dev/null +++ b/target/linux/at91/sama5/target.mk @@ -0,0 +1,11 @@ +BOARDNAME:=SAMA5 Xplained boards(Cortex-A5) +CPU_TYPE:=cortex-a5 +CPU_SUBTYPE:=neon-vfpv4 + +FEATURES+=fpu +DEFAULT_PACKAGES += kmod-usb2 + +define Target/Description + Build generic firmware for Microchip(Atmel AT91) SAMA5 MPU's + using the ARMv7 instruction set. +endef diff --git a/target/linux/at91/sama5d3/config-default b/target/linux/at91/sama5d3/config-default deleted file mode 100644 index 660e27e8a..000000000 --- a/target/linux/at91/sama5d3/config-default +++ /dev/null @@ -1,20 +0,0 @@ -# CONFIG_ARCH_MULTI_V4_V5 is not set -# CONFIG_ARCH_MULTI_V5 is not set -CONFIG_ARCH_MULTI_V7=y -# CONFIG_ARM_LPAE is not set -# CONFIG_ARM_THUMBEE is not set -# CONFIG_CPU_ICACHE_DISABLE is not set -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_SOC_SAMA5=y -# CONFIG_SOC_SAM_V4_V5 is not set -CONFIG_SOC_SAM_V7=y -CONFIG_SOC_SAMA5D2=y -CONFIG_SOC_SAMA5D3=y -CONFIG_SOC_SAMA5D4=y -CONFIG_MACH_SAMA5_DT=y -CONFIG_PL310_ERRATA_588369=y -CONFIG_PL310_ERRATA_727915=y -CONFIG_PL310_ERRATA_753970=y -CONFIG_PL310_ERRATA_769419=y -# CONFIG_SWP_EMULATE is not set -# CONFIG_THUMB2_KERNEL is not set diff --git a/target/linux/at91/sama5d3/target.mk b/target/linux/at91/sama5d3/target.mk deleted file mode 100644 index 0319f4bf0..000000000 --- a/target/linux/at91/sama5d3/target.mk +++ /dev/null @@ -1,9 +0,0 @@ -BOARDNAME:=SAMA5D3 (Cortex-A5) -CPU_TYPE:=cortex-a5 - -DEFAULT_PACKAGES += kmod-usb2 - -define Target/Description - Build generic firmware for SAMA5D3 AT91 platforms - using the ARMv7 instruction set. -endef diff --git a/target/linux/brcm2708/bcm2710/config-4.9 b/target/linux/brcm2708/bcm2710/config-4.9 index ae4a2c7bf..af69f080b 100644 --- a/target/linux/brcm2708/bcm2710/config-4.9 +++ b/target/linux/brcm2708/bcm2710/config-4.9 @@ -276,7 +276,6 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y CONFIG_JBD2=y -# CONFIG_KASAN is not set # CONFIG_LCD_CLASS_DEVICE is not set CONFIG_LEDS_GPIO=y CONFIG_LEDS_TRIGGER_INPUT=y diff --git a/target/linux/brcm47xx/base-files/etc/board.d/01_detect b/target/linux/brcm47xx/base-files/etc/board.d/01_detect index 04d13950a..18604072f 100755 --- a/target/linux/brcm47xx/base-files/etc/board.d/01_detect +++ b/target/linux/brcm47xx/base-files/etc/board.d/01_detect @@ -145,9 +145,9 @@ detect_by_model() { ;; "Asus RT-N12"* | \ - "Asus RT-N16"* | \ "Asus WL500GP V2" | \ "Buffalo WHR-G125" | \ + "D-Link DIR-330" | \ "Motorola WR850G" | \ "Siemens SE505 V2") ucidef_add_switch "switch0" \ @@ -165,6 +165,7 @@ detect_by_model() { "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" ;; + "Asus RT-N16"* | \ "Linksys E3000 V1") ucidef_add_switch "switch0" \ "0:wan" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "8@eth0" diff --git a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile index 8c681ac34..47f031b8b 100644 --- a/target/linux/brcm47xx/image/Makefile +++ b/target/linux/brcm47xx/image/Makefile @@ -282,6 +282,14 @@ define Device/asus-wl-330ge endef TARGET_DEVICES += asus-wl-330ge +define Device/asus-wl-500gd + DEVICE_TITLE := Asus WL-500g Deluxe + DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) + $(Device/asus) + PRODUCTID := "WL500gx " +endef +TARGET_DEVICES += asus-wl-500gd + define Device/asus-wl-500gp-v1 DEVICE_TITLE := Asus WL-500gP v1 DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) @@ -701,14 +709,14 @@ define Device/linksys-e900-v1 endef TARGET_DEVICES += linksys-e900-v1 -define Device/linksys-e1000-v1-v2-v2.1 +define Device/linksys-e1000 DEVICE_TITLE := Linksys E1000 v1 v2 v2.1 DEVICE_PACKAGES := kmod-b43 $(Device/linksys) DEVICE_ID := E100 VERSION := 1.1.3 endef -TARGET_DEVICES += linksys-e1000-v1-v2-v2.1 +TARGET_DEVICES += linksys-e1000 define Device/linksys-e1200-v1 DEVICE_TITLE := Linksys E1200 v1 @@ -806,21 +814,21 @@ define Device/linksys-e4200-v1 endef TARGET_DEVICES += linksys-e4200-v1 -define Device/netgear-wgr614-v10_north-america +define Device/netgear-wgr614-v10-na DEVICE_TITLE := Netgear WGR614 v10 North America $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wgr614-v10_north-america +TARGET_DEVICES += netgear-wgr614-v10-na -define Device/netgear-wgr614-v10_other-regions - DEVICE_TITLE := Netgear WGR614 v10 Other Regions +define Device/netgear-wgr614-v10 + DEVICE_TITLE := Netgear WGR614 v10 $(Device/netgear) NETGEAR_BOARD_ID := U12H139T01_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wgr614-v10_other-regions +TARGET_DEVICES += netgear-wgr614-v10 define Device/netgear-wn2500rp-v1 DEVICE_TITLE := Netgear WN2500RP v1 @@ -910,23 +918,23 @@ define Device/netgear-wnr2000v2 endef TARGET_DEVICES += netgear-wnr2000v2 -define Device/netgear-wnr3500l-v1-north-america +define Device/netgear-wnr3500l-v1-na DEVICE_TITLE := Netgear WNR3500L v1 North America DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 2 endef -TARGET_DEVICES += netgear-wnr3500l-v1-north-america +TARGET_DEVICES += netgear-wnr3500l-v1-na -define Device/netgear-wnr3500l-v1-other-regions +define Device/netgear-wnr3500l-v1 DEVICE_TITLE := Netgear WNR3500L v1 Other Regions DEVICE_PACKAGES := kmod-b43 $(USB2_PACKAGES) $(Device/netgear) NETGEAR_BOARD_ID := U12H136T99_NETGEAR NETGEAR_REGION := 1 endef -TARGET_DEVICES += netgear-wnr3500l-v1-other-regions +TARGET_DEVICES += netgear-wnr3500l-v1 define Device/netgear-wnr3500l-v2 DEVICE_TITLE := Netgear WNR3500L v2 diff --git a/target/linux/brcm47xx/image/lzma-loader/src/Makefile b/target/linux/brcm47xx/image/lzma-loader/src/Makefile index 3320e565d..a08fc05b9 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/Makefile +++ b/target/linux/brcm47xx/image/lzma-loader/src/Makefile @@ -18,7 +18,8 @@ # TEXT_START := 0x80001000 -BZ_TEXT_START := 0x80400000 +BZ_TEXT_START := 0x80600000 +BZ_STACK_START := 0x80700000 OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S @@ -28,9 +29,9 @@ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap CFLAGS += -DLOADADDR=$(TEXT_START) -D_LZMA_IN_CB -ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START) +ASFLAGS = $(CFLAGS) -D__ASSEMBLY__ -DBZ_TEXT_START=$(BZ_TEXT_START) -DBZ_STACK_START=$(BZ_STACK_START) -SEDFLAGS := s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/TEXT_START/$(TEXT_START)/ +SEDFLAGS := s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/BZ_STACK_START/$(BZ_STACK_START)/;s/TEXT_START/$(TEXT_START)/ OBJECTS := head.o data.o diff --git a/target/linux/brcm47xx/image/lzma-loader/src/head.S b/target/linux/brcm47xx/image/lzma-loader/src/head.S index 930c9ba27..50c159ce5 100644 --- a/target/linux/brcm47xx/image/lzma-loader/src/head.S +++ b/target/linux/brcm47xx/image/lzma-loader/src/head.S @@ -38,6 +38,7 @@ .text LEAF(startup) .set noreorder + li sp, BZ_STACK_START addi sp, -48 sw a0, 16(sp) sw a1, 20(sp) diff --git a/target/linux/cns3xxx/config-4.9 b/target/linux/cns3xxx/config-4.9 index 4e5e016c1..36b4857c2 100644 --- a/target/linux/cns3xxx/config-4.9 +++ b/target/linux/cns3xxx/config-4.9 @@ -36,7 +36,6 @@ CONFIG_ATAGS=y CONFIG_ATA_VERBOSE_ERROR=y CONFIG_AUTO_ZRELADDR=y CONFIG_BCM_NET_PHYLIB=y -# CONFIG_BINFMT_FLAT is not set CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BROADCOM_PHY=y @@ -173,12 +172,9 @@ CONFIG_LEDS_GPIO=y # CONFIG_LEDS_TRIGGER_NETDEV is not set CONFIG_LIBFDT=y CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y # CONFIG_MACH_CNS3420VB is not set CONFIG_MACH_GW2388=y CONFIG_MDIO_BOARDINFO=y -# CONFIG_MFD_MAX77620 is not set CONFIG_MIGHT_HAVE_CACHE_L2X0=y CONFIG_MIGHT_HAVE_PCI=y CONFIG_MMC=y @@ -265,7 +261,6 @@ CONFIG_SMP_ON_UP=y CONFIG_SPARSE_IRQ=y CONFIG_SPI=y CONFIG_SPI_BITBANG=y -# CONFIG_SPI_CADENCE_QUADSPI is not set CONFIG_SPI_CNS3XXX=y CONFIG_SPI_MASTER=y CONFIG_SRCU=y @@ -288,7 +283,6 @@ CONFIG_USB_DWC2_HOST=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_HCD_PLATFORM=y CONFIG_USB_EHCI_PCI=y -# CONFIG_USB_ETH is not set CONFIG_USB_GADGET=y CONFIG_USB_OHCI_HCD=y CONFIG_USB_OHCI_HCD_PLATFORM=y diff --git a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c index 19de24c34..bdf930a79 100644 --- a/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c +++ b/target/linux/cns3xxx/files/arch/arm/mach-cns3xxx/gpio.c @@ -273,10 +273,10 @@ void __init cns3xxx_gpio_init(int gpio_base, int ngpio, ct = gc->chip_types; ct->type = IRQ_TYPE_EDGE_FALLING; ct->regs.ack = GPIO_INTERRUPT_CLEAR; - ct->regs.enable = GPIO_INTERRUPT_ENABLE; ct->chip.irq_ack = irq_gc_ack_set_bit; - ct->chip.irq_enable = irq_gc_unmask_enable_reg; - ct->chip.irq_disable = irq_gc_mask_disable_reg; + ct->regs.mask = GPIO_INTERRUPT_ENABLE; + ct->chip.irq_enable = irq_gc_mask_set_bit; + ct->chip.irq_disable = irq_gc_mask_clr_bit; ct->chip.irq_set_type = cns3xxx_gpio_irq_set_type; ct->handler = handle_edge_irq; diff --git a/target/linux/gemini/image/Makefile b/target/linux/gemini/image/Makefile index 1c51b62f6..2cea85777 100644 --- a/target/linux/gemini/image/Makefile +++ b/target/linux/gemini/image/Makefile @@ -10,19 +10,19 @@ include $(INCLUDE_DIR)/image.mk ifeq ($(SUBTARGET),wiligear) define Image/Prepare # WBD111: mach id 1690 (0x69a) - echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd111-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd111-zImage + echo -en "\x06\x1c\xa0\xe3\x9a\x10\x81\xe3" > $(KDIR)/wbd111-zImage + cat $(KDIR)/zImage >> $(KDIR)/wbd111-zImage # WBD222: mach id 2753 (0xAC1) - echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-wbd222-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-wbd222-zImage + echo -en "\x0a\x1c\xa0\xe3\xc1\x10\x81\xe3" > $(KDIR)/wbd222-zImage + cat $(KDIR)/zImage >> $(KDIR)/wbd222-zImage endef endif ifeq ($(SUBTARGET),raidsonic) define Image/Prepare # NAS4220: mach id 2038 (0x7F6) - echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/$(IMG_PREFIX)-nas4220-zImage - cat $(KDIR)/zImage >> $(KDIR)/$(IMG_PREFIX)-nas4220-zImage + echo -en "\x07\x1c\xa0\xe3\xf6\x10\x81\xe3" > $(KDIR)/nas4220-zImage + cat $(KDIR)/zImage >> $(KDIR)/nas4220-zImage endef endif @@ -30,9 +30,9 @@ ifeq ($(SUBTARGET),wiligear) define Image/BuildKernel # workaround the bootloader's bug with extra nops echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage - cat $(KDIR)/$(IMG_PREFIX)-wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage + cat $(KDIR)/wbd111-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd111-zImage echo -en "\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1\x00\x00\xa0\xe1" > $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage - cat $(KDIR)/$(IMG_PREFIX)-wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage + cat $(KDIR)/wbd222-zImage >> $(BIN_DIR)/$(IMG_PREFIX)-wbd222-zImage endef endif @@ -74,7 +74,7 @@ define Image/Build dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/rd.gz bs=6144k count=1 # dd if=/dev/zero of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 dd if=$(BIN_DIR)/$(IMG_PREFIX)-$(1).img of=$(BIN_DIR)/hddapp.tgz bs=6144k count=1 seek=1 - cp $(KDIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/ + cp $(KDIR)/nas4220-zImage $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage cp $(BIN_DIR)/$(IMG_PREFIX)-nas4220-zImage $(BIN_DIR)/zImage cp ./ImageInfo-ib4220 $(BIN_DIR)/ImageInfo (cd $(BIN_DIR); tar -czf $(IMG_PREFIX)-sysupgrade-ib4220.tar.gz ImageInfo zImage rd.gz hddapp.tgz) diff --git a/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch index 896658672..7080cd10a 100644 --- a/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch +++ b/target/linux/generic/backport-4.14/011-kbuild-export-SUBARCH.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -415,8 +415,8 @@ KERNELRELEASE = $(shell cat include/conf +@@ -410,8 +410,8 @@ KERNELRELEASE = $(shell cat include/conf KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION diff --git a/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch new file mode 100644 index 000000000..b3e272066 --- /dev/null +++ b/target/linux/generic/backport-4.14/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch @@ -0,0 +1,25 @@ +From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 26 Nov 2017 00:09:45 +0100 +Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH + +This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH. + +Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support") +Cc: # v4.8+ +Signed-off-by: Hauke Mehrtens +--- + crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -130,7 +130,7 @@ config CRYPTO_DH + + config CRYPTO_ECDH + tristate "ECDH algorithm" +- select CRYTPO_KPP ++ select CRYPTO_KPP + select CRYPTO_RNG_DEFAULT + help + Generic implementation of the ECDH algorithm diff --git a/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch b/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch new file mode 100644 index 000000000..eaef5ca0e --- /dev/null +++ b/target/linux/generic/backport-4.9/040-crypto-fix-typo-in-KPP-dependency-of-CRYPTO_ECDH.patch @@ -0,0 +1,25 @@ +From 4b05f09db650d215632da97f2c25ceba8235102a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Sun, 26 Nov 2017 00:09:45 +0100 +Subject: [PATCH] crypto: fix typo in KPP dependency of CRYPTO_ECDH + +This fixes a typo in the CRYPTO_KPP dependency of CRYPTO_ECDH. + +Fixes: 3c4b23901a0c ("crypto: ecdh - Add ECDH software support") +Cc: # v4.8+ +Signed-off-by: Hauke Mehrtens +--- + crypto/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/crypto/Kconfig ++++ b/crypto/Kconfig +@@ -120,7 +120,7 @@ config CRYPTO_DH + + config CRYPTO_ECDH + tristate "ECDH algorithm" +- select CRYTPO_KPP ++ select CRYPTO_KPP + help + Generic implementation of the ECDH algorithm + diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index 9da3f3e32..aa7c857b1 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -803,7 +803,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2697,11 +2697,9 @@ static int mvneta_poll(struct napi_struc +@@ -2701,11 +2701,9 @@ static int mvneta_poll(struct napi_struc rx_done = mvneta_rx_swbm(pp, budget, &pp->rxqs[rx_queue]); } diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 index 1e3f0b5ab..4909fa0cd 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -90,7 +90,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFFS_FS is not set diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index d1b41d3e2..f156cda85 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -809,6 +809,7 @@ CONFIG_CMDLINE="" # CONFIG_COMPILE_TEST is not set # CONFIG_CONFIGFS_FS is not set # CONFIG_CONNECTOR is not set +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CONSTRUCTORS=y # CONFIG_CONTEXT_SWITCH_TRACER is not set # CONFIG_COPS is not set @@ -2148,6 +2149,7 @@ CONFIG_JOLIET=y CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KCOV is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set @@ -5593,4 +5595,3 @@ CONFIG_ZONE_DMA=y # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set # CONFIG_ZX_TDM is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/files/drivers/misc/owl-loader.c b/target/linux/generic/files/drivers/misc/owl-loader.c index 30340da48..f11cb2b49 100644 --- a/target/linux/generic/files/drivers/misc/owl-loader.c +++ b/target/linux/generic/files/drivers/misc/owl-loader.c @@ -89,7 +89,7 @@ static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data, val = swahb32(val); } -#if CONFIG_LANTIQ +#ifdef CONFIG_LANTIQ val = swab32(val); #endif diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c index 3a5025071..c346aa813 100644 --- a/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c +++ b/target/linux/generic/files/drivers/mtd/mtdsplit/mtdsplit_tplink.c @@ -106,6 +106,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, return -EINVAL; kernel_size = sizeof(hdr) + be32_to_cpu(hdr.v1.kernel_len); + rootfs_offset = be32_to_cpu(hdr.v1.rootfs_ofs); break; case 2: case 3: @@ -113,6 +114,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, return -EINVAL; kernel_size = sizeof(hdr) + be32_to_cpu(hdr.v2.kernel_len); + rootfs_offset = be32_to_cpu(hdr.v2.rootfs_ofs); break; default: return -EINVAL; @@ -121,11 +123,9 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, if (kernel_size > master->size) return -EINVAL; - /* Find the rootfs after the kernel. */ - err = mtd_check_rootfs_magic(master, kernel_size, NULL); - if (!err) { - rootfs_offset = kernel_size; - } else { + /* Find the rootfs */ + err = mtd_check_rootfs_magic(master, rootfs_offset, NULL); + if (err) { /* * The size in the header might cover the rootfs as well. * Start the search from an arbitrary offset. @@ -142,7 +142,7 @@ static int mtdsplit_parse_tplink(struct mtd_info *master, parts[0].name = KERNEL_PART_NAME; parts[0].offset = 0; - parts[0].size = rootfs_offset; + parts[0].size = kernel_size; parts[1].name = ROOTFS_PART_NAME; parts[1].offset = rootfs_offset; diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 7f3d5115a..61811370d 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.c +++ b/target/linux/generic/files/drivers/net/phy/ar8216.c @@ -49,12 +49,6 @@ extern const struct ar8xxx_chip ar8337_chip; .name = (_n), \ } -#define AR8216_MIB_RXB_ID 14 /* RxGoodByte */ -#define AR8216_MIB_TXB_ID 29 /* TxByte */ - -#define AR8236_MIB_RXB_ID 15 /* RxGoodByte */ -#define AR8236_MIB_TXB_ID 31 /* TxByte */ - static const struct ar8xxx_mib_desc ar8216_mibs[] = { MIB_DESC(1, AR8216_STATS_RXBROAD, "RxBroad"), MIB_DESC(1, AR8216_STATS_RXPAUSE, "RxPause"), @@ -1587,56 +1581,6 @@ ar8xxx_sw_set_flush_port_arl_table(struct switch_dev *dev, return ret; } -int -ar8xxx_sw_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats) -{ - struct ar8xxx_priv *priv = swdev_to_ar8xxx(dev); - u64 *mib_stats; - int ret; - int mib_txb_id, mib_rxb_id; - - if (!ar8xxx_has_mib_counters(priv)) - return -EOPNOTSUPP; - - if (port >= dev->ports) - return -EINVAL; - - switch (priv->chip_ver) { - case AR8XXX_VER_AR8216: - mib_txb_id = AR8216_MIB_TXB_ID; - mib_rxb_id = AR8216_MIB_RXB_ID; - break; - case AR8XXX_VER_AR8236: - case AR8XXX_VER_AR8316: - case AR8XXX_VER_AR8327: - case AR8XXX_VER_AR8337: - mib_txb_id = AR8236_MIB_TXB_ID; - mib_rxb_id = AR8236_MIB_RXB_ID; - break; - default: - return -EOPNOTSUPP; - } - - mutex_lock(&priv->mib_lock); - ret = ar8xxx_mib_capture(priv); - if (ret) - goto unlock; - - ar8xxx_mib_fetch_port_stat(priv, port, false); - - mib_stats = &priv->mib_stats[port * priv->chip->num_mibs]; - - stats->tx_bytes = mib_stats[mib_txb_id]; - stats->rx_bytes = mib_stats[mib_rxb_id]; - - ret = 0; - -unlock: - mutex_unlock(&priv->mib_lock); - return ret; -} - static const struct switch_attr ar8xxx_sw_attr_globals[] = { { .type = SWITCH_TYPE_INT, @@ -1752,7 +1696,16 @@ static const struct switch_dev_ops ar8xxx_sw_ops = { .apply_config = ar8xxx_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch, .get_port_link = ar8xxx_sw_get_port_link, +/* The following op is disabled as it hogs the CPU and degrades performance. + An implementation has been attempted in 4d8a66d but reading MIB data is slow + on ar8xxx switches. + + The high CPU load has been traced down to the ar8xxx_reg_wait() call in + ar8xxx_mib_op(), which has to usleep_range() till the MIB busy flag set by + the request to update the MIB counter is cleared. */ +#if 0 .get_port_stats = ar8xxx_sw_get_port_stats, +#endif }; static const struct ar8xxx_chip ar8216_chip = { diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.h b/target/linux/generic/files/drivers/net/phy/ar8216.h index 321eeb792..d9508b9ff 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8216.h +++ b/target/linux/generic/files/drivers/net/phy/ar8216.h @@ -566,9 +566,6 @@ ar8xxx_sw_set_flush_port_arl_table(struct switch_dev *dev, const struct switch_attr *attr, struct switch_val *val); int -ar8xxx_sw_get_port_stats(struct switch_dev *dev, int port, - struct switch_port_stats *stats); -int ar8216_wait_bit(struct ar8xxx_priv *priv, int reg, u32 mask, u32 val); static inline struct ar8xxx_priv * diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index bae974473..6ebd2e8ae 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -1411,7 +1411,16 @@ static const struct switch_dev_ops ar8327_sw_ops = { .apply_config = ar8327_sw_hw_apply, .reset_switch = ar8xxx_sw_reset_switch, .get_port_link = ar8xxx_sw_get_port_link, +/* The following op is disabled as it hogs the CPU and degrades performance. + An implementation has been attempted in 4d8a66d but reading MIB data is slow + on ar8xxx switches. + + The high CPU load has been traced down to the ar8xxx_reg_wait() call in + ar8xxx_mib_op(), which has to usleep_range() till the MIB busy flag set by + the request to update the MIB counter is cleared. */ +#if 0 .get_port_stats = ar8xxx_sw_get_port_stats, +#endif }; const struct ar8xxx_chip ar8327_chip = { diff --git a/target/linux/generic/hack-4.14/202-reduce_module_size.patch b/target/linux/generic/hack-4.14/202-reduce_module_size.patch index f85424d0c..d3e014f41 100644 --- a/target/linux/generic/hack-4.14/202-reduce_module_size.patch +++ b/target/linux/generic/hack-4.14/202-reduce_module_size.patch @@ -13,12 +13,12 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -408,7 +408,7 @@ KBUILD_CFLAGS_KERNEL := - KBUILD_AFLAGS := -D__ASSEMBLY__ $(call cc-option,-fno-PIE) +@@ -402,7 +402,7 @@ KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE -KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := # Read KERNELRELEASE from include/config/kernel.release (if it exists) - KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) diff --git a/target/linux/generic/hack-4.14/207-disable-modorder.patch b/target/linux/generic/hack-4.14/207-disable-modorder.patch index a9e90dae8..4afed16a0 100644 --- a/target/linux/generic/hack-4.14/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.14/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1208,7 +1208,6 @@ all: modules +@@ -1212,7 +1212,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost -@@ -1237,7 +1236,6 @@ _modinst_: +@@ -1241,7 +1240,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.14/211-host_tools_portability.patch b/target/linux/generic/hack-4.14/211-host_tools_portability.patch index 1434f1c4d..59f147943 100644 --- a/target/linux/generic/hack-4.14/211-host_tools_portability.patch +++ b/target/linux/generic/hack-4.14/211-host_tools_portability.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau ## HOSTCC C flags -host_c_flags = -Wp,-MD,$(depfile) -Wp,-MT,$@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) -+host_c_flags = -MD -MF $(depfile) -Wp -MT $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) ++host_c_flags = -MD -MF $(depfile) -MT $@ $(CHOSTFLAGS) -D"BUILD_STR(s)=\#s" $(CHOSTFLAGS_$(basetarget).o) $(CHOSTFLAGS_$(obj)) --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -35,6 +35,7 @@ diff --git a/target/linux/generic/hack-4.14/220-gc_sections.patch b/target/linux/generic/hack-4.14/220-gc_sections.patch index 4463e2313..e06ddb80d 100644 --- a/target/linux/generic/hack-4.14/220-gc_sections.patch +++ b/target/linux/generic/hack-4.14/220-gc_sections.patch @@ -21,9 +21,9 @@ Signed-off-by: Gabor Juhos --- a/Makefile +++ b/Makefile -@@ -410,6 +410,11 @@ KBUILD_AFLAGS_MODULE := -DMODULE - KBUILD_CFLAGS_MODULE := -DMODULE +@@ -405,6 +405,11 @@ KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE = -T $(srctree)/scripts/module-common.lds $(if $(CONFIG_PROFILING),,-s) + GCC_PLUGINS_CFLAGS := +ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION +KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,) @@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos # Read KERNELRELEASE from include/config/kernel.release (if it exists) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) -@@ -783,11 +788,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH +@@ -784,11 +789,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) endif diff --git a/target/linux/generic/hack-4.14/721-phy_packets.patch b/target/linux/generic/hack-4.14/721-phy_packets.patch index f6ac7147f..07e6e9da6 100644 --- a/target/linux/generic/hack-4.14/721-phy_packets.patch +++ b/target/linux/generic/hack-4.14/721-phy_packets.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2492,6 +2492,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2494,6 +2494,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2622,16 +2626,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2624,16 +2628,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2974,10 +2974,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2975,10 +2975,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all) || !list_empty(&dev->ptype_all)) dev_queue_xmit_nit(skb, dev); diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch index a624cb1c4..e291da516 100644 --- a/target/linux/generic/hack-4.14/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch @@ -63,7 +63,7 @@ Signed-off-by: Felix Fietkau } --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c -@@ -144,7 +144,10 @@ static const struct file_operations proc +@@ -145,7 +145,10 @@ static const struct file_operations proc void proc_tty_register_driver(struct tty_driver *driver) { struct proc_dir_entry *ent; @@ -75,7 +75,7 @@ Signed-off-by: Felix Fietkau if (!driver->driver_name || driver->proc_entry || !driver->ops->proc_fops) return; -@@ -161,6 +164,9 @@ void proc_tty_unregister_driver(struct t +@@ -162,6 +165,9 @@ void proc_tty_unregister_driver(struct t { struct proc_dir_entry *ent; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau ent = driver->proc_entry; if (!ent) return; -@@ -175,6 +181,9 @@ void proc_tty_unregister_driver(struct t +@@ -176,6 +182,9 @@ void proc_tty_unregister_driver(struct t */ void __init proc_tty_init(void) { diff --git a/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch b/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch index c91ea01b5..3e6473056 100644 --- a/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch +++ b/target/linux/generic/hack-4.9/660-fq_codel_defaults.patch @@ -3,6 +3,9 @@ From: Felix Fietkau Date: Fri, 7 Jul 2017 17:21:53 +0200 Subject: hack: net: fq_codel: tune defaults for small devices +Assume that x86_64 devices always have a big memory and do not need this +optimization compared to devices with only 32 MB or 64 MB RAM. + Signed-off-by: Felix Fietkau --- net/sched/sch_fq_codel.c | 2 +- @@ -10,12 +13,15 @@ Signed-off-by: Felix Fietkau --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -479,7 +479,7 @@ static int fq_codel_init(struct Qdisc *s +@@ -479,7 +479,11 @@ static int fq_codel_init(struct Qdisc *s sch->limit = 10*1024; q->flows_cnt = 1024; -- q->memory_limit = 32 << 20; /* 32 MBytes */ ++#ifdef CONFIG_X86_64 + q->memory_limit = 32 << 20; /* 32 MBytes */ ++#else + q->memory_limit = 4 << 20; /* 4 MBytes */ ++#endif q->drop_batch_size = 64; q->quantum = psched_mtu(qdisc_dev(sch)); q->perturbation = prandom_u32(); diff --git a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch index 18a98b3aa..7a249e37f 100644 --- a/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch +++ b/target/linux/generic/hack-4.9/661-use_fq_codel_by_default.patch @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau register_qdisc(&pfifo_head_drop_qdisc_ops); --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c -@@ -705,7 +705,7 @@ static const struct Qdisc_class_ops fq_c +@@ -709,7 +709,7 @@ static const struct Qdisc_class_ops fq_c .walk = fq_codel_walk, }; @@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau .cl_ops = &fq_codel_class_ops, .id = "fq_codel", .priv_size = sizeof(struct fq_codel_sched_data), -@@ -720,6 +720,7 @@ static struct Qdisc_ops fq_codel_qdisc_o +@@ -724,6 +724,7 @@ static struct Qdisc_ops fq_codel_qdisc_o .dump_stats = fq_codel_dump_stats, .owner = THIS_MODULE, }; diff --git a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch index c97c759e7..63071c999 100644 --- a/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch +++ b/target/linux/generic/pending-3.18/002-phy_drivers_backport.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/adm6996.c +++ b/drivers/net/phy/adm6996.c -@@ -287,7 +287,7 @@ static u16 +@@ -289,7 +289,7 @@ static u16 adm6996_read_mii_reg(struct adm6996_priv *priv, enum admreg reg) { struct phy_device *phydev = priv->priv; @@ -9,7 +9,7 @@ return bus->read(bus, PHYADDR(reg)); } -@@ -296,7 +296,7 @@ static void +@@ -298,7 +298,7 @@ static void adm6996_write_mii_reg(struct adm6996_priv *priv, enum admreg reg, u16 val) { struct phy_device *phydev = priv->priv; @@ -18,7 +18,7 @@ bus->write(bus, PHYADDR(reg), val); } -@@ -1019,13 +1019,13 @@ static int adm6996_config_init(struct ph +@@ -1050,13 +1050,13 @@ static int adm6996_config_init(struct ph pdev->supported = ADVERTISED_100baseT_Full; pdev->advertising = ADVERTISED_100baseT_Full; @@ -35,7 +35,7 @@ if (!priv) return -ENOMEM; -@@ -1045,7 +1045,7 @@ static int adm6996_config_init(struct ph +@@ -1076,7 +1076,7 @@ static int adm6996_config_init(struct ph } /* @@ -44,7 +44,7 @@ */ static int adm6996_read_status(struct phy_device *phydev) { -@@ -1061,7 +1061,7 @@ static int adm6996_read_status(struct ph +@@ -1092,7 +1092,7 @@ static int adm6996_read_status(struct ph } /* @@ -53,7 +53,7 @@ */ static int adm6996_config_aneg(struct phy_device *phydev) { -@@ -1070,11 +1070,11 @@ static int adm6996_config_aneg(struct ph +@@ -1101,11 +1101,11 @@ static int adm6996_config_aneg(struct ph static int adm6996_fixup(struct phy_device *dev) { @@ -67,7 +67,7 @@ return 0; /* look for the switch on the bus */ -@@ -1121,6 +1121,7 @@ static struct phy_driver adm6996_phy_dri +@@ -1152,6 +1152,7 @@ static struct phy_driver adm6996_phy_dri .config_aneg = &adm6996_config_aneg, .read_status = &adm6996_read_status, .soft_reset = adm6996_soft_reset, @@ -75,7 +75,7 @@ }; static int adm6996_gpio_probe(struct platform_device *pdev) -@@ -1193,7 +1194,7 @@ static int __init adm6996_init(void) +@@ -1220,7 +1221,7 @@ static int __init adm6996_init(void) int err; phy_register_fixup_for_id(PHY_ANY_ID, adm6996_fixup); @@ -95,7 +95,7 @@ ret |= BMCR_ANENABLE | BMCR_ANRESTART; return phy_write(phydev, MII_BMCR, ret); } -@@ -1996,7 +1996,7 @@ ar8xxx_phy_config_init(struct phy_device +@@ -2007,7 +2007,7 @@ ar8xxx_phy_config_init(struct phy_device priv->phy = phydev; @@ -104,7 +104,7 @@ if (chip_is_ar8316(priv)) { /* switch device has been initialized, reinit */ priv->dev.ports = (AR8216_NUM_PORTS - 1); -@@ -2044,7 +2044,7 @@ ar8xxx_check_link_states(struct ar8xxx_p +@@ -2055,7 +2055,7 @@ ar8xxx_check_link_states(struct ar8xxx_p /* flush ARL entries for this port if it went down*/ if (!link_new) priv->chip->atu_flush_port(priv, i); @@ -113,7 +113,7 @@ i, link_new ? "up" : "down"); } -@@ -2063,10 +2063,10 @@ ar8xxx_phy_read_status(struct phy_device +@@ -2074,10 +2074,10 @@ ar8xxx_phy_read_status(struct phy_device if (phydev->state == PHY_CHANGELINK) ar8xxx_check_link_states(priv); @@ -126,7 +126,7 @@ phydev->link = !!link.link; if (!phydev->link) return 0; -@@ -2096,7 +2096,7 @@ ar8xxx_phy_read_status(struct phy_device +@@ -2107,7 +2107,7 @@ ar8xxx_phy_read_status(struct phy_device static int ar8xxx_phy_config_aneg(struct phy_device *phydev) { @@ -135,7 +135,7 @@ return 0; return genphy_config_aneg(phydev); -@@ -2151,15 +2151,15 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2162,15 +2162,15 @@ ar8xxx_phy_probe(struct phy_device *phyd int ret; /* skip PHYs at unused adresses */ @@ -154,7 +154,7 @@ goto found; priv = ar8xxx_create(); -@@ -2168,7 +2168,7 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2179,7 +2179,7 @@ ar8xxx_phy_probe(struct phy_device *phyd goto unlock; } @@ -163,7 +163,7 @@ ret = ar8xxx_probe_switch(priv); if (ret) -@@ -2189,7 +2189,7 @@ ar8xxx_phy_probe(struct phy_device *phyd +@@ -2200,7 +2200,7 @@ ar8xxx_phy_probe(struct phy_device *phyd found: priv->use_count++; @@ -172,7 +172,7 @@ if (ar8xxx_has_gige(priv)) { phydev->supported = SUPPORTED_1000baseT_Full; phydev->advertising = ADVERTISED_1000baseT_Full; -@@ -2277,21 +2277,33 @@ ar8xxx_phy_soft_reset(struct phy_device +@@ -2288,21 +2288,33 @@ ar8xxx_phy_soft_reset(struct phy_device return 0; } @@ -223,7 +223,7 @@ MODULE_LICENSE("GPL"); --- a/drivers/net/phy/ar8327.c +++ b/drivers/net/phy/ar8327.c -@@ -619,11 +619,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) +@@ -627,11 +627,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv) if (!priv->chip_data) return -ENOMEM; @@ -363,7 +363,7 @@ } -@@ -392,13 +388,12 @@ mvswitch_probe(struct phy_device *pdev) +@@ -398,13 +394,12 @@ mvswitch_probe(struct phy_device *pdev) static int mvswitch_fixup(struct phy_device *dev) { @@ -379,9 +379,9 @@ if (reg != MV_IDENT_VALUE) return 0; -@@ -418,13 +413,14 @@ static struct phy_driver mvswitch_driver - .config_init = &mvswitch_config_init, +@@ -425,13 +420,14 @@ static struct phy_driver mvswitch_driver .config_aneg = &mvswitch_config_aneg, + .aneg_done = &mvswitch_aneg_done, .read_status = &mvswitch_read_status, + .driver = { .owner = THIS_MODULE,}, }; @@ -464,7 +464,7 @@ module_init(psb6970_init); --- a/drivers/net/phy/rtl8306.c +++ b/drivers/net/phy/rtl8306.c -@@ -872,7 +872,7 @@ rtl8306_config_init(struct phy_device *p +@@ -876,7 +876,7 @@ rtl8306_config_init(struct phy_device *p int err; /* Only init the switch for the primary PHY */ @@ -473,7 +473,7 @@ return 0; val.value.i = 1; -@@ -882,7 +882,7 @@ rtl8306_config_init(struct phy_device *p +@@ -886,7 +886,7 @@ rtl8306_config_init(struct phy_device *p priv->dev.ops = &rtl8306_ops; priv->do_cpu = 0; priv->page = -1; @@ -482,7 +482,7 @@ chipid = rtl_get(dev, RTL_REG_CHIPID); chipver = rtl_get(dev, RTL_REG_CHIPVER); -@@ -928,13 +928,13 @@ rtl8306_fixup(struct phy_device *pdev) +@@ -932,13 +932,13 @@ rtl8306_fixup(struct phy_device *pdev) u16 chipid; /* Attach to primary LAN port and WAN port */ @@ -498,7 +498,7 @@ chipid = rtl_get(&priv.dev, RTL_REG_CHIPID); if (chipid == 0x5988) pdev->phy_id = RTL8306_MAGIC; -@@ -952,14 +952,14 @@ rtl8306_probe(struct phy_device *pdev) +@@ -956,14 +956,14 @@ rtl8306_probe(struct phy_device *pdev) * share one rtl_priv instance between virtual phy * devices on the same bus */ @@ -515,7 +515,7 @@ found: pdev->priv = priv; -@@ -980,7 +980,7 @@ rtl8306_config_aneg(struct phy_device *p +@@ -984,7 +984,7 @@ rtl8306_config_aneg(struct phy_device *p struct rtl_priv *priv = pdev->priv; /* Only for WAN */ @@ -524,7 +524,7 @@ return 0; /* Restart autonegotiation */ -@@ -996,7 +996,7 @@ rtl8306_read_status(struct phy_device *p +@@ -1000,7 +1000,7 @@ rtl8306_read_status(struct phy_device *p struct rtl_priv *priv = pdev->priv; struct switch_dev *dev = &priv->dev; @@ -533,7 +533,7 @@ /* WAN */ pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10; pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF; -@@ -1037,6 +1037,7 @@ static struct phy_driver rtl8306_driver +@@ -1041,6 +1041,7 @@ static struct phy_driver rtl8306_driver .config_init = &rtl8306_config_init, .config_aneg = &rtl8306_config_aneg, .read_status = &rtl8306_read_status, @@ -541,7 +541,7 @@ }; -@@ -1044,7 +1045,7 @@ static int __init +@@ -1048,7 +1049,7 @@ static int __init rtl_init(void) { phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup); diff --git a/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch b/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch index 59180c208..f3dfa901f 100644 --- a/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch +++ b/target/linux/generic/pending-3.18/041-mtd-bcm47xxpart-backports-from-3.20.patch @@ -83,7 +83,7 @@ offset + trx->offset[i], 0); i++; -@@ -205,7 +235,8 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -203,7 +233,8 @@ static int bcm47xxpart_parse(struct mtd_ } /* Squashfs on devices not using TRX */ diff --git a/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch b/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch index 41b912d5d..24c264ba9 100644 --- a/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch +++ b/target/linux/generic/pending-3.18/044-backport-m25p80-jedec-probe.patch @@ -24,7 +24,7 @@ .probe = m25p_probe, --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c -@@ -927,8 +927,11 @@ int spi_nor_scan(struct spi_nor *nor, co +@@ -934,8 +934,11 @@ int spi_nor_scan(struct spi_nor *nor, co if (ret) return ret; diff --git a/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch b/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch index aa45860e9..0e7e4f8b1 100644 --- a/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch +++ b/target/linux/generic/pending-3.18/070-bgmac-register-napi-before-the-device.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_devic +@@ -1521,6 +1521,8 @@ static int bgmac_probe(struct bcma_devic if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM) bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n"); @@ -22,7 +22,7 @@ Signed-off-by: David S. Miller err = bgmac_mii_register(bgmac); if (err) { bgmac_err(bgmac, "Cannot register MDIO\n"); -@@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_devic +@@ -1535,8 +1537,6 @@ static int bgmac_probe(struct bcma_devic netif_carrier_off(net_dev); @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller return 0; err_mii_unregister: -@@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_dev +@@ -1555,9 +1555,9 @@ static void bgmac_remove(struct bcma_dev { struct bgmac *bgmac = bcma_get_drvdata(core); diff --git a/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch b/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch deleted file mode 100644 index 121d2f412..000000000 --- a/target/linux/generic/pending-3.18/072-bgmac-fix-device-initialization-on-Northstar-SoCs-co.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 21697336d46b71dd031f29e426dda0b1e7f06cc0 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Wed, 11 Feb 2015 18:06:34 +0100 -Subject: [PATCH] bgmac: fix device initialization on Northstar SoCs (condition - typo) -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -On Northstar (Broadcom's ARM architecture) we need to manually enable -all cores. Code for that is already in place, but the condition for it -was wrong. - -Signed-off-by: RafaÅ‚ MiÅ‚ecki -Signed-off-by: David S. Miller ---- - drivers/net/ethernet/broadcom/bgmac.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - ---- a/drivers/net/ethernet/broadcom/bgmac.c -+++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1412,6 +1412,7 @@ static void bgmac_mii_unregister(struct - /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipattach */ - static int bgmac_probe(struct bcma_device *core) - { -+ struct bcma_chipinfo *ci = &core->bus->chipinfo; - struct net_device *net_dev; - struct bgmac *bgmac; - struct ssb_sprom *sprom = &core->bus->sprom; -@@ -1474,8 +1475,8 @@ static int bgmac_probe(struct bcma_devic - bgmac_chip_reset(bgmac); - - /* For Northstar, we have to take all GMAC core out of reset */ -- if (core->id.id == BCMA_CHIP_ID_BCM4707 || -- core->id.id == BCMA_CHIP_ID_BCM53018) { -+ if (ci->id == BCMA_CHIP_ID_BCM4707 || -+ ci->id == BCMA_CHIP_ID_BCM53018) { - struct bcma_device *ns_core; - int ns_gmac; - diff --git a/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch b/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch index ceb25e85a..642dd2ad7 100644 --- a/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch +++ b/target/linux/generic/pending-3.18/077-03-bgmac-implement-scatter-gather-support.patch @@ -254,7 +254,7 @@ Signed-off-by: Felix Fietkau } } -@@ -1583,6 +1657,10 @@ static int bgmac_probe(struct bcma_devic +@@ -1588,6 +1662,10 @@ static int bgmac_probe(struct bcma_devic goto err_dma_free; } diff --git a/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch b/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch index ca061a50d..a4c7876d7 100644 --- a/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch +++ b/target/linux/generic/pending-3.18/078-bgmac-reset-enable-Ethernet-core-before-using-it.patch @@ -17,9 +17,9 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c -@@ -1564,6 +1564,11 @@ static int bgmac_probe(struct bcma_devic - dev_warn(&core->dev, "Using random MAC: %pM\n", mac); - } +@@ -1569,6 +1569,11 @@ static int bgmac_probe(struct bcma_devic + */ + bcma_core_enable(core, 0); + /* This (reset &) enable is not preset in specs or reference driver but + * Broadcom does it in arch PCI code when enabling fake PCI device. diff --git a/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch b/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch index fe55323a5..29bec8387 100644 --- a/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch +++ b/target/linux/generic/pending-3.18/080-11-fib_trie-Push-rcu_read_lock-unlock-to-callers.patch @@ -172,7 +172,7 @@ Signed-off-by: David S. Miller u32 portid; net = sock_net(skb->sk); -@@ -971,9 +976,7 @@ static void nl_fib_input(struct sk_buff +@@ -972,9 +977,7 @@ static void nl_fib_input(struct sk_buff nlh = nlmsg_hdr(skb); frn = (struct fib_result_nl *) nlmsg_data(nlh); diff --git a/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch b/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch index d3da41e91..9f39e5ba5 100644 --- a/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch +++ b/target/linux/generic/pending-3.18/082-ipv6-ip6_fragment-fix-headroom-tests-and-skb-leak.patch @@ -44,7 +44,7 @@ Closes 20532 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -597,20 +597,22 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -600,20 +600,22 @@ int ip6_fragment(struct sk_buff *skb, in } mtu -= hlen + sizeof(struct frag_hdr); @@ -69,7 +69,7 @@ Closes 20532 goto slow_path_clean; /* Partially cloned skb? */ -@@ -627,8 +629,6 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -630,8 +632,6 @@ int ip6_fragment(struct sk_buff *skb, in err = 0; offset = 0; @@ -78,7 +78,7 @@ Closes 20532 /* BUILD HEADER */ *prevhdr = NEXTHDR_FRAGMENT; -@@ -636,8 +636,11 @@ int ip6_fragment(struct sk_buff *skb, in +@@ -639,8 +639,11 @@ int ip6_fragment(struct sk_buff *skb, in if (!tmp_hdr) { IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)), IPSTATS_MIB_FRAGFAILS); @@ -91,7 +91,7 @@ Closes 20532 __skb_pull(skb, hlen); fh = (struct frag_hdr *)__skb_push(skb, sizeof(struct frag_hdr)); -@@ -735,7 +738,6 @@ slow_path: +@@ -738,7 +741,6 @@ slow_path: */ *prevhdr = NEXTHDR_FRAGMENT; diff --git a/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch b/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch index c75af99c6..6c26a47c5 100644 --- a/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch +++ b/target/linux/generic/pending-3.18/090-overlayfs-fallback-to-readonly-when-full.patch @@ -44,7 +44,7 @@ Miklos --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c -@@ -313,6 +313,9 @@ int ovl_copy_up_one(struct dentry *paren +@@ -315,6 +315,9 @@ int ovl_copy_up_one(struct dentry *paren struct cred *override_cred; char *link = NULL; diff --git a/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch b/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch deleted file mode 100644 index 213f85b0a..000000000 --- a/target/linux/generic/pending-3.18/097-mm-remove-gup_flags-FOLL_WRITE-games-from-__get_user.patch +++ /dev/null @@ -1,90 +0,0 @@ -From e45a502bdeae5a075257c4f061d1ff4ff0821354 Mon Sep 17 00:00:00 2001 -From: Linus Torvalds -Date: Thu, 13 Oct 2016 13:07:36 -0700 -Subject: [PATCH] mm: remove gup_flags FOLL_WRITE games from __get_user_pages() - -[ Upstream commit 19be0eaffa3ac7d8eb6784ad9bdbc7d67ed8e619 ] - -This is an ancient bug that was actually attempted to be fixed once -(badly) by me eleven years ago in commit 4ceb5db9757a ("Fix -get_user_pages() race for write access") but that was then undone due to -problems on s390 by commit f33ea7f404e5 ("fix get_user_pages bug"). - -In the meantime, the s390 situation has long been fixed, and we can now -fix it by checking the pte_dirty() bit properly (and do it better). The -s390 dirty bit was implemented in abf09bed3cce ("s390/mm: implement -software dirty bits") which made it into v3.9. Earlier kernels will -have to look at the page state itself. - -Also, the VM has become more scalable, and what used a purely -theoretical race back then has become easier to trigger. - -To fix it, we introduce a new internal FOLL_COW flag to mark the "yes, -we already did a COW" rather than play racy games with FOLL_WRITE that -is very fundamental, and then use the pte dirty flag to validate that -the FOLL_COW flag is still valid. - -Reported-and-tested-by: Phil "not Paul" Oester -Acked-by: Hugh Dickins -Reviewed-by: Michal Hocko -Cc: Andy Lutomirski -Cc: Kees Cook -Cc: Oleg Nesterov -Cc: Willy Tarreau -Cc: Nick Piggin -Cc: Greg Thelen -Cc: stable@vger.kernel.org -Signed-off-by: Linus Torvalds -Signed-off-by: Sasha Levin ---- - include/linux/mm.h | 1 + - mm/gup.c | 14 ++++++++++++-- - 2 files changed, 13 insertions(+), 2 deletions(-) - ---- a/include/linux/mm.h -+++ b/include/linux/mm.h -@@ -2029,6 +2029,7 @@ static inline struct page *follow_page(s - #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ - #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ - #define FOLL_TRIED 0x800 /* a retry, previous pass started an IO */ -+#define FOLL_COW 0x4000 /* internal GUP flag */ - - typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr, - void *data); ---- a/mm/gup.c -+++ b/mm/gup.c -@@ -32,6 +32,16 @@ static struct page *no_page_table(struct - return NULL; - } - -+/* -+ * FOLL_FORCE can write to even unwritable pte's, but only -+ * after we've gone through a COW cycle and they are dirty. -+ */ -+static inline bool can_follow_write_pte(pte_t pte, unsigned int flags) -+{ -+ return pte_write(pte) || -+ ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pte_dirty(pte)); -+} -+ - static struct page *follow_page_pte(struct vm_area_struct *vma, - unsigned long address, pmd_t *pmd, unsigned int flags) - { -@@ -66,7 +76,7 @@ retry: - } - if ((flags & FOLL_NUMA) && pte_numa(pte)) - goto no_page; -- if ((flags & FOLL_WRITE) && !pte_write(pte)) { -+ if ((flags & FOLL_WRITE) && !can_follow_write_pte(pte, flags)) { - pte_unmap_unlock(ptep, ptl); - return NULL; - } -@@ -315,7 +325,7 @@ static int faultin_page(struct task_stru - * reCOWed by userspace write). - */ - if ((ret & VM_FAULT_WRITE) && !(vma->vm_flags & VM_WRITE)) -- *flags &= ~FOLL_WRITE; -+ *flags |= FOLL_COW; - return 0; - } - diff --git a/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch b/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch deleted file mode 100644 index ebbe1bbae..000000000 --- a/target/linux/generic/pending-3.18/133-MIPS-UAPI-Ignore-__arch_swab-16-32-64-when-using-MIP.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 71a0a72456b48de972d7ed613b06a22a3aa9057f Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Sat, 26 Sep 2015 13:41:43 +0800 -Subject: [PATCH] MIPS: UAPI: Ignore __arch_swab{16,32,64} when using MIPS16 - -Some GCC versions (e.g. 4.8.3) can incorrectly inline a function with -MIPS32 instructions into another function with MIPS16 code [1], causing -the assembler to genereate incorrect binary code or fail right away -complaining about unrecognized opcode. - -In the case of __arch_swab{16,32}, when inlined by the compiler with -flags `-mips32r2 -mips16 -Os', the assembler can fail with the following -error. - - {standard input}:79: Error: unrecognized opcode `wsbh $2,$2' - -For performance concerns and to workaround the issue already existing in -older compilers, just ignore these 2 functions when compiling with -mips16 enabled. - - [1] Inlining nomips16 function into mips16 function can result in - undefined builtins, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55777 - -Signed-off-by: Yousong Zhou -Cc: Maciej W. Rozycki -Cc: linux-mips@linux-mips.org -Patchwork: https://patchwork.linux-mips.org/patch/11241/ -Signed-off-by: Ralf Baechle ---- - arch/mips/include/uapi/asm/swab.h | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - ---- a/arch/mips/include/uapi/asm/swab.h -+++ b/arch/mips/include/uapi/asm/swab.h -@@ -13,8 +13,9 @@ - - #define __SWAB_64_THRU_32__ - --#if (defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ -- defined(_MIPS_ARCH_LOONGSON3A) -+#if !defined(__mips16) && \ -+ ((defined(__mips_isa_rev) && (__mips_isa_rev >= 2)) || \ -+ defined(_MIPS_ARCH_LOONGSON3A)) - - static inline __attribute_const__ __u16 __arch_swab16(__u16 x) - { -@@ -65,5 +66,5 @@ static inline __attribute_const__ __u64 - } - #define __arch_swab64 __arch_swab64 - #endif /* __mips64 */ --#endif /* MIPS R2 or newer or Loongson 3A */ -+#endif /* (not __mips16) and (MIPS R2 or newer or Loongson 3A) */ - #endif /* _ASM_SWAB_H */ diff --git a/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch b/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch deleted file mode 100644 index 761cff316..000000000 --- a/target/linux/generic/pending-3.18/141-mtd-bcm47xxpart-limit-scanned-flash-area-on-BCM47XX-.patch +++ /dev/null @@ -1,33 +0,0 @@ -From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= -Date: Sat, 5 Dec 2015 02:03:32 +0100 -Subject: [PATCH] mtd: bcm47xxpart: limit scanned flash area on BCM47XX (MIPS) - only -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -We allowed using bcm47xxpart on BCM5301X arch with commit: -9e3afa5f5c7 ("mtd: bcm47xxpart: allow enabling on ARCH_BCM_5301X") - -BCM5301X devices may contain some partitions in higher memory, e.g. -Netgear R8000 has board_data at 0x2600000. To detect them we should -use size limit on MIPS only. - -Signed-off-by: RafaÅ‚ MiÅ‚ecki ---- - drivers/mtd/bcm47xxpart.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/mtd/bcm47xxpart.c -+++ b/drivers/mtd/bcm47xxpart.c -@@ -118,8 +118,8 @@ static int bcm47xxpart_parse(struct mtd_ - /* Parse block by block looking for magics */ - for (offset = 0; offset <= master->size - blocksize; - offset += blocksize) { -- /* Nothing more in higher memory */ -- if (offset >= 0x2000000) -+ /* Nothing more in higher memory on BCM47XX (MIPS) */ -+ if (config_enabled(CONFIG_BCM47XX) && offset >= 0x2000000) - break; - - if (curr_part >= BCM47XXPART_MAX_PARTS) { diff --git a/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch b/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch index 9073f795e..926de5fef 100644 --- a/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch +++ b/target/linux/generic/pending-3.18/142-mtd-bcm47xxpart-don-t-fail-because-of-bit-flips.patch @@ -58,7 +58,7 @@ Signed-off-by: RafaÅ‚ MiÅ‚ecki continue; } -@@ -254,10 +258,11 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -252,10 +256,11 @@ static int bcm47xxpart_parse(struct mtd_ } /* Read middle of the block */ @@ -74,7 +74,7 @@ Signed-off-by: RafaÅ‚ MiÅ‚ecki continue; } -@@ -277,10 +282,11 @@ static int bcm47xxpart_parse(struct mtd_ +@@ -275,10 +280,11 @@ static int bcm47xxpart_parse(struct mtd_ } offset = master->size - possible_nvram_sizes[i]; diff --git a/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch b/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch index 0b03963f0..632384d56 100644 --- a/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch +++ b/target/linux/generic/pending-3.18/190-cdc_ncm_add_support_for_moving_ndp_to_end_of_ncm_frame.patch @@ -79,21 +79,21 @@ Signed-off-by: David S. Miller /* override ethtool_ops */ dev->net->ethtool_ops = &cdc_ncm_ethtool_ops; -@@ -958,8 +971,11 @@ static int cdc_ncm_bind(struct usbnet *d +@@ -956,8 +969,11 @@ static int cdc_ncm_bind(struct usbnet *d if (cdc_ncm_select_altsetting(intf) != CDC_NCM_COMM_ALTSETTING_NCM) return -ENODEV; - /* The NCM data altsetting is fixed */ -- ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM); +- return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM); + /* The NCM data altsetting is fixed, so we hard-coded it. + * Additionally, generic NCM devices are assumed to accept arbitrarily + * placed NDP. + */ -+ ret = cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0); ++ return cdc_ncm_bind_common(dev, intf, CDC_NCM_DATA_ALTSETTING_NCM, 0); + } - /* - * We should get an event when network connection is "connected" or -@@ -990,6 +1006,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm + static void cdc_ncm_align_tail(struct sk_buff *skb, size_t modulus, size_t remainder, size_t max) +@@ -979,6 +995,14 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm struct usb_cdc_ncm_nth16 *nth16 = (void *)skb->data; size_t ndpoffset = le16_to_cpu(nth16->wNdpIndex); @@ -108,7 +108,7 @@ Signed-off-by: David S. Miller /* follow the chain of NDPs, looking for a match */ while (ndpoffset) { ndp16 = (struct usb_cdc_ncm_ndp16 *)(skb->data + ndpoffset); -@@ -999,7 +1023,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -988,7 +1012,8 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm } /* align new NDP */ @@ -118,7 +118,7 @@ Signed-off-by: David S. Miller /* verify that there is room for the NDP and the datagram (reserve) */ if ((ctx->tx_max - skb->len - reserve) < ctx->max_ndp_size) -@@ -1012,7 +1037,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm +@@ -1001,7 +1026,11 @@ static struct usb_cdc_ncm_ndp16 *cdc_ncm nth16->wNdpIndex = cpu_to_le16(skb->len); /* push a new empty NDP */ @@ -131,7 +131,7 @@ Signed-off-by: David S. Miller ndp16->dwSignature = sign; ndp16->wLength = cpu_to_le16(sizeof(struct usb_cdc_ncm_ndp16) + sizeof(struct usb_cdc_ncm_dpe16)); return ndp16; -@@ -1027,6 +1056,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1016,6 +1045,15 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev struct sk_buff *skb_out; u16 n = 0, index, ndplen; u8 ready2send = 0; @@ -147,7 +147,7 @@ Signed-off-by: David S. Miller /* if there is a remaining skb, it gets priority */ if (skb != NULL) { -@@ -1081,7 +1119,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1070,7 +1108,7 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev cdc_ncm_align_tail(skb_out, ctx->tx_modulus, ctx->tx_remainder, ctx->tx_max); /* check if we had enough room left for both NDP and frame */ @@ -156,7 +156,7 @@ Signed-off-by: David S. Miller if (n == 0) { /* won't fit, MTU problem? */ dev_kfree_skb_any(skb); -@@ -1154,6 +1192,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev +@@ -1143,6 +1181,17 @@ cdc_ncm_fill_tx_frame(struct usbnet *dev /* variables will be reset at next call */ } diff --git a/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch b/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch deleted file mode 100644 index 5a3dc06c1..000000000 --- a/target/linux/generic/pending-3.18/191-usb-ehci-orion-fix-probe-for-GENERIC_PHY.patch +++ /dev/null @@ -1,35 +0,0 @@ -From a95f03e51471dbdbafd3391991d867ac2358ed02 Mon Sep 17 00:00:00 2001 -From: Jonas Gorski -Date: Sun, 23 Aug 2015 14:23:29 +0200 -Subject: [PATCH] usb: ehci-orion: fix probe for !GENERIC_PHY - -Commit d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") -added support for optional phys, but devm_phy_optional_get returns --ENOSYS if GENERIC_PHY is not enabled. - -This causes probe failures, even when there are no phys specified: - -[ 1.443365] orion-ehci f1058000.usb: init f1058000.usb fail, -38 -[ 1.449403] orion-ehci: probe of f1058000.usb failed with error -38 - -Similar to dwc3, treat -ENOSYS as no phy. - -Fixes: d445913ce0ab7f ("usb: ehci-orion: add optional PHY support") - -Signed-off-by: Jonas Gorski ---- - drivers/usb/host/ehci-orion.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/usb/host/ehci-orion.c -+++ b/drivers/usb/host/ehci-orion.c -@@ -226,7 +226,8 @@ static int ehci_orion_drv_probe(struct p - priv->phy = devm_phy_optional_get(&pdev->dev, "usb"); - if (IS_ERR(priv->phy)) { - err = PTR_ERR(priv->phy); -- goto err_phy_get; -+ if (err != -ENOSYS) -+ goto err_phy_get; - } else { - err = phy_init(priv->phy); - if (err) diff --git a/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch b/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch index 7c49a6f11..ae018cbab 100644 --- a/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch +++ b/target/linux/generic/pending-3.18/192-USB-qcserial-Add-support-for-Quectel-EC20-Mini-PCIe-.patch @@ -61,7 +61,7 @@ Signed-off-by: Petr Å tetiar /* standard device layouts supported by this driver */ enum qcserial_layouts { QCSERIAL_G2K = 0, /* Gobi 2000 */ -@@ -171,6 +173,38 @@ static const struct usb_device_id id_tab +@@ -176,6 +178,38 @@ static const struct usb_device_id id_tab }; MODULE_DEVICE_TABLE(usb, id_table); @@ -100,7 +100,7 @@ Signed-off-by: Petr Å tetiar static int qcprobe(struct usb_serial *serial, const struct usb_device_id *id) { struct usb_host_interface *intf = serial->interface->cur_altsetting; -@@ -239,6 +273,11 @@ static int qcprobe(struct usb_serial *se +@@ -244,6 +278,11 @@ static int qcprobe(struct usb_serial *se altsetting = -1; break; case QCSERIAL_G2K: diff --git a/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch b/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch index 1b1afd5d3..ee0d7b2cc 100644 --- a/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch +++ b/target/linux/generic/pending-3.18/193-USB-qmi_wwan-Add-quirk-for-Quectel-EC20-Mini-PCIe-mo.patch @@ -48,7 +48,7 @@ Signed-off-by: Petr Å tetiar --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -822,6 +822,7 @@ static const struct usb_device_id produc +@@ -825,6 +825,7 @@ static const struct usb_device_id produc {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */ {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */ {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */ @@ -56,7 +56,7 @@ Signed-off-by: Petr Å tetiar {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */ {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */ {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */ -@@ -853,10 +854,24 @@ static const struct usb_device_id produc +@@ -856,10 +857,24 @@ static const struct usb_device_id produc }; MODULE_DEVICE_TABLE(usb, products); @@ -81,7 +81,7 @@ Signed-off-by: Petr Å tetiar /* Workaround to enable dynamic IDs. This disables usbnet * blacklisting functionality. Which, if required, can be -@@ -868,6 +883,12 @@ static int qmi_wwan_probe(struct usb_int +@@ -871,6 +886,12 @@ static int qmi_wwan_probe(struct usb_int id->driver_info = (unsigned long)&qmi_wwan_info; } diff --git a/target/linux/generic/pending-3.18/201-extra_optimization.patch b/target/linux/generic/pending-3.18/201-extra_optimization.patch index 7ec93a47f..5a2396cfa 100644 --- a/target/linux/generic/pending-3.18/201-extra_optimization.patch +++ b/target/linux/generic/pending-3.18/201-extra_optimization.patch @@ -1,7 +1,7 @@ --- a/Makefile +++ b/Makefile -@@ -612,9 +612,9 @@ include $(srctree)/arch/$(SRCARCH)/Makef - KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) +@@ -618,9 +618,9 @@ KBUILD_CFLAGS += $(call cc-option,-fno-P + KBUILD_AFLAGS += $(call cc-option,-fno-PIE) ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) diff --git a/target/linux/generic/pending-3.18/204-module_strip.patch b/target/linux/generic/pending-3.18/204-module_strip.patch index 844c3b550..2df7ba013 100644 --- a/target/linux/generic/pending-3.18/204-module_strip.patch +++ b/target/linux/generic/pending-3.18/204-module_strip.patch @@ -28,8 +28,8 @@ Signed-off-by: Felix Fietkau +#if defined(MODULE) && !defined(CONFIG_MODULE_STRIPPED) /* Creates an alias so file2alias.c can find device table. */ #define MODULE_DEVICE_TABLE(type, name) \ - extern const struct type##_device_id __mod_##type##__##name##_device_table \ -@@ -159,7 +160,9 @@ void trim_init_extable(struct module *m) + extern const typeof(name) __mod_##type##__##name##_device_table \ +@@ -159,7 +160,9 @@ extern const typeof(name) __mod_##type## */ #if defined(MODULE) || !defined(CONFIG_SYSFS) @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau #else #define MODULE_VERSION(_version) \ static struct module_version_attribute ___modver_attr = { \ -@@ -181,7 +184,7 @@ void trim_init_extable(struct module *m) +@@ -181,7 +184,7 @@ extern const typeof(name) __mod_##type## /* Optional firmware file (or files) needed by the module * format is simply firmware file name. Multiple firmware * files require multiple MODULE_FIRMWARE() specifiers */ @@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau set_license(mod, get_modinfo(info, "license")); --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1726,7 +1726,9 @@ static void read_symbols(char *modname) +@@ -1758,7 +1758,9 @@ static void read_symbols(char *modname) symname = remove_dot(info.strtab + sym->st_name); handle_modversions(mod, &info, sym, symname); @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau } if (!is_vmlinux(modname) || (is_vmlinux(modname) && vmlinux_section_warnings)) -@@ -1870,7 +1872,9 @@ static void add_header(struct buffer *b, +@@ -1902,7 +1904,9 @@ static void add_header(struct buffer *b, buf_printf(b, "#include \n"); buf_printf(b, "#include \n"); buf_printf(b, "\n"); @@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__attribute__((section(\".gnu.linkonce.this_module\"))) = {\n"); -@@ -1887,16 +1891,20 @@ static void add_header(struct buffer *b, +@@ -1919,16 +1923,20 @@ static void add_header(struct buffer *b, static void add_intree_flag(struct buffer *b, int is_intree) { @@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau } /** -@@ -1989,11 +1997,13 @@ static void add_depends(struct buffer *b +@@ -2021,11 +2029,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -178,7 +178,7 @@ Signed-off-by: Felix Fietkau } static void write_if_changed(struct buffer *b, const char *fname) -@@ -2224,7 +2234,9 @@ int main(int argc, char **argv) +@@ -2256,7 +2266,9 @@ int main(int argc, char **argv) add_staging_flag(&buf, mod->name); err |= add_versions(&buf, mod); add_depends(&buf, mod, modules); diff --git a/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch b/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch index 42ae9cb84..6e08ca302 100644 --- a/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch +++ b/target/linux/generic/pending-3.18/550-ubifs-symlink-xattr-support.patch @@ -39,7 +39,7 @@ --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c -@@ -209,12 +209,12 @@ static int change_xattr(struct ubifs_inf +@@ -210,12 +210,12 @@ static int change_xattr(struct ubifs_inf goto out_free; } inode->i_size = ui->ui_size = size; diff --git a/target/linux/generic/pending-3.18/630-packet_socket_type.patch b/target/linux/generic/pending-3.18/630-packet_socket_type.patch index 61ddea84c..ec7383e11 100644 --- a/target/linux/generic/pending-3.18/630-packet_socket_type.patch +++ b/target/linux/generic/pending-3.18/630-packet_socket_type.patch @@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1530,6 +1530,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1529,6 +1529,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1537,6 +1538,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1536,6 +1537,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1549,7 +1551,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1548,7 +1550,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -1748,12 +1750,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -1747,12 +1749,12 @@ static int packet_rcv(struct sk_buff *sk int skb_len = skb->len; unsigned int snaplen, res; @@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -1873,12 +1875,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -1872,12 +1874,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2828,6 +2830,7 @@ static int packet_create(struct net *net +@@ -2831,6 +2833,7 @@ static int packet_create(struct net *net spin_lock_init(&po->bind_lock); mutex_init(&po->pg_vec_lock); po->prot_hook.func = packet_rcv; @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3409,6 +3412,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3425,6 +3428,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -108,7 +108,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3460,6 +3473,13 @@ static int packet_getsockopt(struct sock +@@ -3476,6 +3489,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; diff --git a/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch b/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch index b38b87b48..fe62110f0 100644 --- a/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch +++ b/target/linux/generic/pending-3.18/653-disable_netlink_trim.patch @@ -1,15 +1,12 @@ --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -1721,27 +1721,7 @@ void netlink_detachskb(struct sock *sk, +@@ -1107,23 +1107,7 @@ void netlink_detachskb(struct sock *sk, static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) { - int delta; - WARN_ON(skb->sk != NULL); -- if (netlink_skb_is_mmaped(skb)) -- return skb; -- - delta = skb->end - skb->tail; - if (is_vmalloc_addr(skb->head) || delta * 2 < skb->truesize) - return skb; @@ -24,7 +21,6 @@ - - if (!pskb_expand_head(skb, 0, -delta, allocation)) - skb->truesize -= delta; -- + return skb; } - diff --git a/target/linux/generic/pending-3.18/655-increase_skb_pad.patch b/target/linux/generic/pending-3.18/655-increase_skb_pad.patch index 19344cca3..96f81e9aa 100644 --- a/target/linux/generic/pending-3.18/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-3.18/655-increase_skb_pad.patch @@ -1,6 +1,6 @@ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2023,7 +2023,7 @@ static inline int pskb_network_may_pull( +@@ -2024,7 +2024,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch b/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch index b326a8b72..0fde9f6e6 100644 --- a/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch +++ b/target/linux/generic/pending-3.18/656-skb_reduce_truesize-helper.patch @@ -14,7 +14,7 @@ when needed. --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2068,6 +2068,24 @@ static inline void pskb_trim_unique(stru +@@ -2069,6 +2069,24 @@ static inline void pskb_trim_unique(stru BUG_ON(err); } diff --git a/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch index 000665f04..43bdbe456 100644 --- a/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch +++ b/target/linux/generic/pending-3.18/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch @@ -145,7 +145,7 @@ Signed-off-by: Steven Barth if (dev == ip6n->fb_tnl_dev) RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL); else -@@ -771,6 +786,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, +@@ -781,6 +796,108 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t, } EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl); @@ -254,7 +254,7 @@ Signed-off-by: Steven Barth /** * ip6_tnl_rcv - decapsulate IPv6 packet and retransmit it locally * @skb: received socket buffer -@@ -815,6 +932,26 @@ static int ip6_tnl_rcv(struct sk_buff *s +@@ -825,6 +942,26 @@ static int ip6_tnl_rcv(struct sk_buff *s skb_reset_network_header(skb); skb->protocol = htons(protocol); memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); @@ -281,7 +281,7 @@ Signed-off-by: Steven Barth __skb_tunnel_rx(skb, t->dev, t->net); -@@ -1076,6 +1213,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1086,6 +1223,7 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str __u8 dsfield; __u32 mtu; int err; @@ -289,7 +289,7 @@ Signed-off-by: Steven Barth if ((t->parms.proto != IPPROTO_IPIP && t->parms.proto != 0) || !ip6_tnl_xmit_ctl(t)) -@@ -1095,6 +1233,18 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str +@@ -1105,6 +1243,18 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, str if (t->parms.flags & IP6_TNL_F_USE_ORIG_FWMARK) fl6.flowi6_mark = skb->mark; @@ -308,7 +308,7 @@ Signed-off-by: Steven Barth err = ip6_tnl_xmit2(skb, dev, dsfield, &fl6, encap_limit, &mtu); if (err != 0) { /* XXX: send ICMP error even if DF is not set. */ -@@ -1263,6 +1413,14 @@ ip6_tnl_change(struct ip6_tnl *t, const +@@ -1273,6 +1423,14 @@ ip6_tnl_change(struct ip6_tnl *t, const t->parms.flowinfo = p->flowinfo; t->parms.link = p->link; t->parms.proto = p->proto; @@ -323,7 +323,7 @@ Signed-off-by: Steven Barth ip6_tnl_dst_reset(t); ip6_tnl_link_config(t); return 0; -@@ -1293,6 +1451,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ +@@ -1303,6 +1461,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_ p->flowinfo = u->flowinfo; p->link = u->link; p->proto = u->proto; @@ -331,7 +331,7 @@ Signed-off-by: Steven Barth memcpy(p->name, u->name, sizeof(u->name)); } -@@ -1568,6 +1727,15 @@ static int ip6_tnl_validate(struct nlatt +@@ -1578,6 +1737,15 @@ static int ip6_tnl_validate(struct nlatt return 0; } @@ -347,7 +347,7 @@ Signed-off-by: Steven Barth static void ip6_tnl_netlink_parms(struct nlattr *data[], struct __ip6_tnl_parm *parms) { -@@ -1601,6 +1769,46 @@ static void ip6_tnl_netlink_parms(struct +@@ -1611,6 +1779,46 @@ static void ip6_tnl_netlink_parms(struct if (data[IFLA_IPTUN_PROTO]) parms->proto = nla_get_u8(data[IFLA_IPTUN_PROTO]); @@ -394,7 +394,7 @@ Signed-off-by: Steven Barth } static int ip6_tnl_newlink(struct net *src_net, struct net_device *dev, -@@ -1653,6 +1861,12 @@ static void ip6_tnl_dellink(struct net_d +@@ -1663,6 +1871,12 @@ static void ip6_tnl_dellink(struct net_d static size_t ip6_tnl_get_size(const struct net_device *dev) { @@ -407,7 +407,7 @@ Signed-off-by: Steven Barth return /* IFLA_IPTUN_LINK */ nla_total_size(4) + -@@ -1670,6 +1884,24 @@ static size_t ip6_tnl_get_size(const str +@@ -1680,6 +1894,24 @@ static size_t ip6_tnl_get_size(const str nla_total_size(4) + /* IFLA_IPTUN_PROTO */ nla_total_size(1) + @@ -432,7 +432,7 @@ Signed-off-by: Steven Barth 0; } -@@ -1677,6 +1909,9 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1687,6 +1919,9 @@ static int ip6_tnl_fill_info(struct sk_b { struct ip6_tnl *tunnel = netdev_priv(dev); struct __ip6_tnl_parm *parm = &tunnel->parms; @@ -442,7 +442,7 @@ Signed-off-by: Steven Barth if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) || nla_put(skb, IFLA_IPTUN_LOCAL, sizeof(struct in6_addr), -@@ -1687,8 +1922,27 @@ static int ip6_tnl_fill_info(struct sk_b +@@ -1697,8 +1932,27 @@ static int ip6_tnl_fill_info(struct sk_b nla_put_u8(skb, IFLA_IPTUN_ENCAP_LIMIT, parm->encap_limit) || nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) || nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) || @@ -471,7 +471,7 @@ Signed-off-by: Steven Barth return 0; nla_put_failure: -@@ -1704,6 +1958,7 @@ static const struct nla_policy ip6_tnl_p +@@ -1714,6 +1968,7 @@ static const struct nla_policy ip6_tnl_p [IFLA_IPTUN_FLOWINFO] = { .type = NLA_U32 }, [IFLA_IPTUN_FLAGS] = { .type = NLA_U32 }, [IFLA_IPTUN_PROTO] = { .type = NLA_U8 }, diff --git a/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch b/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch index 0c951069c..de8745cdc 100644 --- a/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch +++ b/target/linux/generic/pending-3.18/667-ipv6-Fixed-source-specific-default-route-handling.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c -@@ -903,21 +903,45 @@ static int ip6_dst_lookup_tail(struct so +@@ -906,21 +906,45 @@ static int ip6_dst_lookup_tail(struct so #endif int err; @@ -81,7 +81,7 @@ Signed-off-by: David S. Miller * Here if the dst entry we've looked up --- a/net/ipv6/route.c +++ b/net/ipv6/route.c -@@ -2182,9 +2182,10 @@ int ip6_route_get_saddr(struct net *net, +@@ -2184,9 +2184,10 @@ int ip6_route_get_saddr(struct net *net, unsigned int prefs, struct in6_addr *saddr) { diff --git a/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 1bf9dc99d..f999d44df 100644 --- a/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-3.18/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -155,7 +155,7 @@ Signed-off-by: Jonas Gorski case RTN_THROW: default: rt->dst.error = (cfg->fc_type == RTN_THROW) ? -EAGAIN -@@ -2139,6 +2161,17 @@ static int ip6_pkt_prohibit_out(struct s +@@ -2141,6 +2163,17 @@ static int ip6_pkt_prohibit_out(struct s return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES); } @@ -173,7 +173,7 @@ Signed-off-by: Jonas Gorski /* * Allocate a dst for local (unicast / anycast) address. */ -@@ -2363,7 +2396,8 @@ static int rtm_to_fib6_config(struct sk_ +@@ -2365,7 +2398,8 @@ static int rtm_to_fib6_config(struct sk_ if (rtm->rtm_type == RTN_UNREACHABLE || rtm->rtm_type == RTN_BLACKHOLE || rtm->rtm_type == RTN_PROHIBIT || @@ -183,7 +183,7 @@ Signed-off-by: Jonas Gorski cfg->fc_flags |= RTF_REJECT; if (rtm->rtm_type == RTN_LOCAL) -@@ -2565,6 +2599,9 @@ static int rt6_fill_node(struct net *net +@@ -2567,6 +2601,9 @@ static int rt6_fill_node(struct net *net case -EACCES: rtm->rtm_type = RTN_PROHIBIT; break; @@ -193,7 +193,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -2818,6 +2855,8 @@ static int ip6_route_dev_notify(struct n +@@ -2825,6 +2862,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -3034,6 +3073,17 @@ static int __net_init ip6_route_net_init +@@ -3047,6 +3086,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -220,7 +220,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -3052,6 +3102,8 @@ out: +@@ -3065,6 +3115,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -229,7 +229,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -3069,6 +3121,7 @@ static void __net_exit ip6_route_net_exi +@@ -3082,6 +3134,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -237,7 +237,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -3165,6 +3218,9 @@ int __init ip6_route_init(void) +@@ -3155,6 +3208,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); @@ -245,5 +245,5 @@ Signed-off-by: Jonas Gorski + init_net.ipv6.ip6_policy_failed_entry->rt6i_idev = + in6_dev_get(init_net.loopback_dev); #endif - ret = fib6_init(); - if (ret) + } + diff --git a/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 714097bca..da4b58883 100644 --- a/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-3.18/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -17,7 +17,7 @@ Signed-off-by: Felix Fietkau --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4002,6 +4002,9 @@ static enum gro_result dev_gro_receive(s +@@ -4006,6 +4006,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau if (!(skb->dev->features & NETIF_F_GRO)) goto normal; -@@ -5067,6 +5070,48 @@ static void __netdev_adjacent_dev_unlink +@@ -5077,6 +5080,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *private) -@@ -5127,6 +5172,7 @@ static int __netdev_upper_dev_link(struc +@@ -5137,6 +5182,7 @@ static int __netdev_upper_dev_link(struc goto rollback_lower_mesh; } @@ -84,15 +84,15 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); return 0; -@@ -5244,6 +5290,7 @@ void netdev_upper_dev_unlink(struct net_ +@@ -5254,6 +5300,7 @@ void netdev_upper_dev_unlink(struct net_ list_for_each_entry(i, &upper_dev->all_adj_list.upper, list) - __netdev_adjacent_dev_unlink(dev, i->dev); + __netdev_adjacent_dev_unlink(dev, i->dev, i->ref_nr); + netdev_update_addr_mask(dev); call_netdevice_notifiers(NETDEV_CHANGEUPPER, dev); } EXPORT_SYMBOL(netdev_upper_dev_unlink); -@@ -5763,6 +5810,7 @@ int dev_set_mac_address(struct net_devic +@@ -5773,6 +5820,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -597,7 +597,8 @@ struct sk_buff { +@@ -598,7 +598,8 @@ struct sk_buff { #endif __u8 ipvs_property:1; __u8 inner_protocol_type:1; diff --git a/target/linux/generic/pending-3.18/701-phy_extension.patch b/target/linux/generic/pending-3.18/701-phy_extension.patch index 5c63dbec6..fa4542b88 100644 --- a/target/linux/generic/pending-3.18/701-phy_extension.patch +++ b/target/linux/generic/pending-3.18/701-phy_extension.patch @@ -53,7 +53,7 @@ * @phydev: the phy_device struct --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -748,6 +748,7 @@ void phy_start_machine(struct phy_device +@@ -752,6 +752,7 @@ void phy_start_machine(struct phy_device void phy_stop_machine(struct phy_device *phydev); int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); diff --git a/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 0350f9efe..000000000 --- a/target/linux/generic/pending-3.18/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,29 +0,0 @@ ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1133,7 +1133,7 @@ int genphy_config_init(struct phy_device - return 0; - } - --static int gen10g_soft_reset(struct phy_device *phydev) -+static int no_soft_reset(struct phy_device *phydev) - { - /* Do nothing for now */ - return 0; -@@ -1347,7 +1347,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic PHY", -- .soft_reset = genphy_soft_reset, -+ .soft_reset = no_soft_reset, - .config_init = genphy_config_init, - .features = PHY_GBIT_FEATURES | SUPPORTED_MII | - SUPPORTED_AUI | SUPPORTED_FIBRE | -@@ -1362,7 +1362,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch b/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch index cc3cb2445..424c63e31 100644 --- a/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch +++ b/target/linux/generic/pending-3.18/710-phy-add-mdio_register_board_info.patch @@ -46,7 +46,7 @@ phy_device_free(phydev); --- a/include/linux/phy.h +++ b/include/linux/phy.h -@@ -785,4 +785,22 @@ int __init mdio_bus_init(void); +@@ -789,4 +789,22 @@ int __init mdio_bus_init(void); void mdio_bus_exit(void); extern struct bus_type mdio_bus_type; diff --git a/target/linux/generic/pending-3.18/721-phy_packets.patch b/target/linux/generic/pending-3.18/721-phy_packets.patch index 99811c624..7235ab355 100644 --- a/target/linux/generic/pending-3.18/721-phy_packets.patch +++ b/target/linux/generic/pending-3.18/721-phy_packets.patch @@ -41,7 +41,7 @@ */ --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2054,6 +2054,10 @@ static inline int pskb_trim(struct sk_bu +@@ -2055,6 +2055,10 @@ static inline int pskb_trim(struct sk_bu return (len < skb->len) ? __pskb_trim(skb, len) : 0; } @@ -52,7 +52,7 @@ /** * pskb_trim_unique - remove end from a paged unique (not cloned) buffer * @skb: buffer to alter -@@ -2180,16 +2184,6 @@ static inline struct sk_buff *dev_alloc_ +@@ -2181,16 +2185,6 @@ static inline struct sk_buff *dev_alloc_ } @@ -86,7 +86,7 @@ help --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -2623,10 +2623,20 @@ static int xmit_one(struct sk_buff *skb, +@@ -2626,10 +2626,20 @@ static int xmit_one(struct sk_buff *skb, if (!list_empty(&ptype_all)) dev_queue_xmit_nit(skb, dev); @@ -121,7 +121,7 @@ #include #include -@@ -469,6 +470,22 @@ struct sk_buff *__netdev_alloc_skb(struc +@@ -471,6 +472,22 @@ struct sk_buff *__netdev_alloc_skb(struc } EXPORT_SYMBOL(__netdev_alloc_skb); diff --git a/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch b/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch index 52fc25244..a93877b69 100644 --- a/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch +++ b/target/linux/generic/pending-3.18/773-bgmac-add-srab-switch.patch @@ -30,7 +30,7 @@ Signed-off-by: Hauke Mehrtens /************************************************** * BCMA bus ops **************************************************/ -@@ -1666,6 +1678,16 @@ static int bgmac_probe(struct bcma_devic +@@ -1671,6 +1683,16 @@ static int bgmac_probe(struct bcma_devic net_dev->hw_features = net_dev->features; net_dev->vlan_features = net_dev->features; @@ -47,7 +47,7 @@ Signed-off-by: Hauke Mehrtens err = register_netdev(bgmac->net_dev); if (err) { bgmac_err(bgmac, "Cannot register net device\n"); -@@ -1692,6 +1714,10 @@ static void bgmac_remove(struct bcma_dev +@@ -1697,6 +1719,10 @@ static void bgmac_remove(struct bcma_dev { struct bgmac *bgmac = bcma_get_drvdata(core); diff --git a/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch b/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch index a7bf0bb9f..ddc854963 100644 --- a/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch +++ b/target/linux/generic/pending-3.18/811-pci_disable_usb_common_quirks.patch @@ -1,7 +1,7 @@ --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c -@@ -97,6 +97,8 @@ struct amd_chipset_type { +@@ -98,6 +98,8 @@ struct amd_chipset_type { u8 rev; }; @@ -10,7 +10,7 @@ static struct amd_chipset_info { struct pci_dev *nb_dev; struct pci_dev *smbus_dev; -@@ -454,6 +456,10 @@ void usb_amd_dev_put(void) +@@ -462,6 +464,10 @@ void usb_amd_dev_put(void) } EXPORT_SYMBOL_GPL(usb_amd_dev_put); @@ -21,7 +21,7 @@ /* * Make sure the controller is completely inactive, unable to * generate interrupts or do DMA. -@@ -533,8 +539,17 @@ reset_needed: +@@ -541,8 +547,17 @@ reset_needed: uhci_reset_hc(pdev, base); return 1; } @@ -39,7 +39,7 @@ static inline int io_type_enabled(struct pci_dev *pdev, unsigned int mask) { u16 cmd; -@@ -1095,3 +1110,4 @@ static void quirk_usb_early_handoff(stru +@@ -1103,3 +1118,4 @@ static void quirk_usb_early_handoff(stru } DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_SERIAL_USB, 8, quirk_usb_early_handoff); diff --git a/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch b/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch index 99f23a027..41c9220a6 100644 --- a/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch +++ b/target/linux/generic/pending-3.18/901-debloat_sock_diag.patch @@ -45,7 +45,7 @@ Support for UNIX socket monitoring interface used by the ss tool. --- a/net/netlink/Kconfig +++ b/net/netlink/Kconfig -@@ -13,6 +13,7 @@ config NETLINK_MMAP +@@ -4,6 +4,7 @@ config NETLINK_DIAG tristate "NETLINK: socket monitoring interface" diff --git a/target/linux/generic/pending-3.18/902-debloat_proc.patch b/target/linux/generic/pending-3.18/902-debloat_proc.patch index 79cecf90d..596a84f8d 100644 --- a/target/linux/generic/pending-3.18/902-debloat_proc.patch +++ b/target/linux/generic/pending-3.18/902-debloat_proc.patch @@ -173,7 +173,7 @@ goto err; --- a/net/core/sock.c +++ b/net/core/sock.c -@@ -2933,6 +2933,8 @@ static __net_initdata struct pernet_oper +@@ -2939,6 +2939,8 @@ static __net_initdata struct pernet_oper static int __init proto_init(void) { diff --git a/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch b/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch index dd725b01b..61fe71b78 100644 --- a/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch +++ b/target/linux/generic/pending-3.18/997-device_tree_cmdline.patch @@ -1,6 +1,6 @@ --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -903,6 +903,9 @@ int __init early_init_dt_scan_chosen(uns +@@ -909,6 +909,9 @@ int __init early_init_dt_scan_chosen(uns p = of_get_flat_dt_prop(node, "bootargs", &l); if (p != NULL && l > 0) strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch index 71883755c..81f7e2664 100644 --- a/target/linux/generic/pending-4.14/201-extra_optimization.patch +++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch @@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -637,12 +637,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni +@@ -638,12 +638,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) diff --git a/target/linux/generic/pending-4.14/630-packet_socket_type.patch b/target/linux/generic/pending-4.14/630-packet_socket_type.patch index 7a0f924b8..ed48128c9 100644 --- a/target/linux/generic/pending-4.14/630-packet_socket_type.patch +++ b/target/linux/generic/pending-4.14/630-packet_socket_type.patch @@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau #define PACKET_FANOUT_LB 1 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c -@@ -1829,6 +1829,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1822,6 +1822,7 @@ static int packet_rcv_spkt(struct sk_buf { struct sock *sk; struct sockaddr_pkt *spkt; @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau /* * When we registered the protocol we saved the socket in the data -@@ -1836,6 +1837,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1829,6 +1830,7 @@ static int packet_rcv_spkt(struct sk_buf */ sk = pt->af_packet_priv; @@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau /* * Yank back the headers [hope the device set this -@@ -1848,7 +1850,7 @@ static int packet_rcv_spkt(struct sk_buf +@@ -1841,7 +1843,7 @@ static int packet_rcv_spkt(struct sk_buf * so that this procedure is noop. */ @@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau goto out; if (!net_eq(dev_net(dev), sock_net(sk))) -@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk +@@ -2068,12 +2070,12 @@ static int packet_rcv(struct sk_buff *sk unsigned int snaplen, res; bool is_drop_n_account = false; @@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s +@@ -2199,12 +2201,12 @@ static int tpacket_rcv(struct sk_buff *s BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32); BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48); @@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau if (!net_eq(dev_net(dev), sock_net(sk))) goto drop; -@@ -3252,6 +3254,7 @@ static int packet_create(struct net *net +@@ -3251,6 +3253,7 @@ static int packet_create(struct net *net mutex_init(&po->pg_vec_lock); po->rollover = NULL; po->prot_hook.func = packet_rcv; @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (sock->type == SOCK_PACKET) po->prot_hook.func = packet_rcv_spkt; -@@ -3838,6 +3841,16 @@ packet_setsockopt(struct socket *sock, i +@@ -3837,6 +3840,16 @@ packet_setsockopt(struct socket *sock, i po->xmit = val ? packet_direct_xmit : dev_queue_xmit; return 0; } @@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau default: return -ENOPROTOOPT; } -@@ -3891,6 +3904,13 @@ static int packet_getsockopt(struct sock +@@ -3889,6 +3902,13 @@ static int packet_getsockopt(struct sock case PACKET_VNET_HDR: val = po->has_vnet_hdr; break; @@ -128,7 +128,7 @@ Signed-off-by: Felix Fietkau break; --- a/net/packet/internal.h +++ b/net/packet/internal.h -@@ -132,6 +132,7 @@ struct packet_sock { +@@ -131,6 +131,7 @@ struct packet_sock { struct net_device __rcu *cached_dev; int (*xmit)(struct sk_buff *skb); struct packet_type prot_hook ____cacheline_aligned_in_smp; diff --git a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch index 4bc8a5e1c..515c69f81 100644 --- a/target/linux/generic/pending-4.14/655-increase_skb_pad.patch +++ b/target/linux/generic/pending-4.14/655-increase_skb_pad.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -2456,7 +2456,7 @@ static inline int pskb_network_may_pull( +@@ -2458,7 +2458,7 @@ static inline int pskb_network_may_pull( * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD diff --git a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 82b9ba535..9a088c461 100644 --- a/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-4.14/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -191,7 +191,7 @@ Signed-off-by: Jonas Gorski case -EAGAIN: rtm->rtm_type = RTN_THROW; break; -@@ -3801,6 +3838,8 @@ static int ip6_route_dev_notify(struct n +@@ -3804,6 +3841,8 @@ static int ip6_route_dev_notify(struct n #ifdef CONFIG_IPV6_MULTIPLE_TABLES net->ipv6.ip6_prohibit_entry->dst.dev = dev; net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev); @@ -200,7 +200,7 @@ Signed-off-by: Jonas Gorski net->ipv6.ip6_blk_hole_entry->dst.dev = dev; net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev); #endif -@@ -4028,6 +4067,17 @@ static int __net_init ip6_route_net_init +@@ -4031,6 +4070,17 @@ static int __net_init ip6_route_net_init net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops; dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst, ip6_template_metrics, true); @@ -218,7 +218,7 @@ Signed-off-by: Jonas Gorski #endif net->ipv6.sysctl.flush_delay = 0; -@@ -4046,6 +4096,8 @@ out: +@@ -4049,6 +4099,8 @@ out: return ret; #ifdef CONFIG_IPV6_MULTIPLE_TABLES @@ -227,7 +227,7 @@ Signed-off-by: Jonas Gorski out_ip6_prohibit_entry: kfree(net->ipv6.ip6_prohibit_entry); out_ip6_null_entry: -@@ -4063,6 +4115,7 @@ static void __net_exit ip6_route_net_exi +@@ -4066,6 +4118,7 @@ static void __net_exit ip6_route_net_exi #ifdef CONFIG_IPV6_MULTIPLE_TABLES kfree(net->ipv6.ip6_prohibit_entry); kfree(net->ipv6.ip6_blk_hole_entry); @@ -235,7 +235,7 @@ Signed-off-by: Jonas Gorski #endif dst_entries_destroy(&net->ipv6.ip6_dst_ops); } -@@ -4136,6 +4189,9 @@ void __init ip6_route_init_special_entri +@@ -4139,6 +4192,9 @@ void __init ip6_route_init_special_entri init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev; init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev); diff --git a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch index 4467975b9..e7fb83cee 100644 --- a/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch +++ b/target/linux/generic/pending-4.14/680-NET-skip-GRO-for-foreign-MAC-addresses.patch @@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau #endif --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h -@@ -778,6 +778,7 @@ struct sk_buff { +@@ -780,6 +780,7 @@ struct sk_buff { __u8 tc_redirected:1; __u8 tc_from_ingress:1; #endif @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau __u16 tc_index; /* traffic control index */ --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4756,6 +4756,9 @@ static enum gro_result dev_gro_receive(s +@@ -4757,6 +4757,9 @@ static enum gro_result dev_gro_receive(s enum gro_result ret; int grow; @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau if (netif_elide_gro(skb->dev)) goto normal; -@@ -6226,6 +6229,48 @@ static void __netdev_adjacent_dev_unlink +@@ -6227,6 +6230,48 @@ static void __netdev_adjacent_dev_unlink &upper_dev->adj_list.lower); } @@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau static int __netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev, bool master, void *upper_priv, void *upper_info) -@@ -6341,6 +6386,8 @@ void netdev_upper_dev_unlink(struct net_ +@@ -6342,6 +6387,8 @@ void netdev_upper_dev_unlink(struct net_ __netdev_adjacent_dev_unlink_neighbour(dev, upper_dev); @@ -100,7 +100,7 @@ Signed-off-by: Felix Fietkau call_netdevice_notifiers_info(NETDEV_CHANGEUPPER, dev, &changeupper_info.info); } -@@ -6911,6 +6958,7 @@ int dev_set_mac_address(struct net_devic +@@ -6912,6 +6959,7 @@ int dev_set_mac_address(struct net_devic if (err) return err; dev->addr_assign_type = NET_ADDR_SET; diff --git a/target/linux/generic/pending-4.14/920-mangle_bootargs.patch b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch index be89441d3..ec5ec6b52 100644 --- a/target/linux/generic/pending-4.14/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.14/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -359,6 +359,29 @@ static inline void setup_nr_cpu_ids(void +@@ -360,6 +360,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -536,6 +559,7 @@ asmlinkage __visible void __init start_k +@@ -541,6 +564,7 @@ asmlinkage __visible void __init start_k add_device_randomness(command_line, strlen(command_line)); boot_init_stack_canary(); mm_init_cpumask(&init_mm); diff --git a/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch b/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch index 97cd62d75..f0839b6b9 100644 --- a/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch +++ b/target/linux/generic/pending-4.4/001-mtdsplit_backport.patch @@ -140,3 +140,14 @@ { struct wrgg03_header hdr; size_t hdr_len, retlen, kernel_ent_size; +--- a/drivers/mtd/mtdsplit/mtdsplit_minor.c ++++ b/drivers/mtd/mtdsplit/mtdsplit_minor.c +@@ -49,7 +49,7 @@ struct minor_header { + }; + + static int mtdsplit_parse_minor(struct mtd_info *master, +- const struct mtd_partition **pparts, ++ struct mtd_partition **pparts, + struct mtd_part_parser_data *data) + { + struct minor_header hdr; diff --git a/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 7cec6d322..000000000 --- a/target/linux/generic/pending-4.4/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1465,7 +1465,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = genphy_no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch b/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch new file mode 100644 index 000000000..409154258 --- /dev/null +++ b/target/linux/generic/pending-4.9/340-MIPS-mm-remove-mips_dma_mapping_error.patch @@ -0,0 +1,32 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:34:31 +0100 +Subject: [PATCH] MIPS: mm: remove mips_dma_mapping_error + +dma_mapping_error() already checks if ops->mapping_error is a null +pointer + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -394,11 +394,6 @@ static void mips_dma_sync_sg_for_device( + } + } + +-int mips_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) +-{ +- return 0; +-} +- + int mips_dma_supported(struct device *dev, u64 mask) + { + return plat_dma_supported(dev, mask); +@@ -427,7 +422,6 @@ static struct dma_map_ops mips_default_d + .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, + .sync_sg_for_device = mips_dma_sync_sg_for_device, +- .mapping_error = mips_dma_mapping_error, + .dma_supported = mips_dma_supported + }; + diff --git a/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch new file mode 100644 index 000000000..5b237a6d2 --- /dev/null +++ b/target/linux/generic/pending-4.9/341-MIPS-mm-remove-no-op-dma_map_ops-where-possible.patch @@ -0,0 +1,140 @@ +From: Felix Fietkau +Date: Tue, 5 Dec 2017 12:46:01 +0100 +Subject: [PATCH] MIPS: mm: remove no-op dma_map_ops where possible + +If no post-DMA flush is required, and the platform does not provide +plat_unmap_dma_mem(), there is no need to include unmap or sync_for_cpu +ops. + +With this patch they are compiled out to improve icache footprint +on devices that handle lots of DMA traffic (especially network routers). + +Signed-off-by: Felix Fietkau +--- + +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -213,6 +213,7 @@ config BMIPS_GENERIC + select BRCMSTB_L2_IRQ + select IRQ_MIPS_CPU + select DMA_NONCOHERENT ++ select DMA_UNMAP_POST_FLUSH + select SYS_SUPPORTS_32BIT_KERNEL + select SYS_SUPPORTS_LITTLE_ENDIAN + select SYS_SUPPORTS_BIG_ENDIAN +@@ -338,6 +339,7 @@ config MACH_JAZZ + select CSRC_R4K + select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN + select GENERIC_ISA_DMA ++ select DMA_UNMAP_POST_FLUSH + select HAVE_PCSPKR_PLATFORM + select IRQ_MIPS_CPU + select I8253 +@@ -1125,6 +1127,9 @@ config DMA_NONCOHERENT + bool + select NEED_DMA_MAP_STATE + ++config DMA_UNMAP_POST_FLUSH ++ bool ++ + config NEED_DMA_MAP_STATE + bool + +@@ -1649,6 +1654,7 @@ config CPU_R10000 + select CPU_SUPPORTS_64BIT_KERNEL + select CPU_SUPPORTS_HIGHMEM + select CPU_SUPPORTS_HUGEPAGES ++ select DMA_UNMAP_POST_FLUSH + help + MIPS Technologies R10000-series processors. + +@@ -1894,9 +1900,11 @@ config SYS_HAS_CPU_MIPS32_R3_5 + bool + + config SYS_HAS_CPU_MIPS32_R5 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS32_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_MIPS64_R1 +@@ -1906,6 +1914,7 @@ config SYS_HAS_CPU_MIPS64_R2 + bool + + config SYS_HAS_CPU_MIPS64_R6 ++ select DMA_UNMAP_POST_FLUSH + bool + + config SYS_HAS_CPU_R3000 +--- a/arch/mips/mm/dma-default.c ++++ b/arch/mips/mm/dma-default.c +@@ -290,8 +290,9 @@ static inline void __dma_sync(struct pag + } while (left); + } + +-static void mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, +- size_t size, enum dma_data_direction direction, unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size, ++ enum dma_data_direction direction, unsigned long attrs) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_addr), +@@ -330,9 +331,10 @@ static dma_addr_t mips_dma_map_page(stru + return plat_map_dma_mem_page(dev, page) + offset; + } + +-static void mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, +- int nhwentries, enum dma_data_direction direction, +- unsigned long attrs) ++static void __maybe_unused ++mips_dma_unmap_sg(struct device *dev, struct scatterlist *sglist, ++ int nhwentries, enum dma_data_direction direction, ++ unsigned long attrs) + { + int i; + struct scatterlist *sg; +@@ -346,8 +348,9 @@ static void mips_dma_unmap_sg(struct dev + } + } + +-static void mips_dma_sync_single_for_cpu(struct device *dev, +- dma_addr_t dma_handle, size_t size, enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, ++ size_t size, enum dma_data_direction direction) + { + if (cpu_needs_post_dma_flush(dev)) + __dma_sync(dma_addr_to_page(dev, dma_handle), +@@ -363,9 +366,9 @@ static void mips_dma_sync_single_for_dev + dma_handle & ~PAGE_MASK, size, direction); + } + +-static void mips_dma_sync_sg_for_cpu(struct device *dev, +- struct scatterlist *sglist, int nelems, +- enum dma_data_direction direction) ++static void __maybe_unused ++mips_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sglist, ++ int nelems, enum dma_data_direction direction) + { + int i; + struct scatterlist *sg; +@@ -415,12 +418,14 @@ static struct dma_map_ops mips_default_d + .free = mips_dma_free_coherent, + .mmap = mips_dma_mmap, + .map_page = mips_dma_map_page, +- .unmap_page = mips_dma_unmap_page, + .map_sg = mips_dma_map_sg, ++#ifdef CONFIG_DMA_UNMAP_POST_FLUSH ++ .unmap_page = mips_dma_unmap_page, + .unmap_sg = mips_dma_unmap_sg, + .sync_single_for_cpu = mips_dma_sync_single_for_cpu, +- .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_cpu = mips_dma_sync_sg_for_cpu, ++#endif ++ .sync_single_for_device = mips_dma_sync_single_for_device, + .sync_sg_for_device = mips_dma_sync_sg_for_device, + .dma_supported = mips_dma_supported + }; diff --git a/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch b/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch deleted file mode 100644 index 4fad37ab3..000000000 --- a/target/linux/generic/pending-4.9/704-phy-no-genphy-soft-reset.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Felix Fietkau -Subject: net: phy: disable soft-reset for generic PHY devices to avoid accidentally clearing preinitialized state - -Signed-off-by: Felix Fietkau ---- - drivers/net/phy/phy_device.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/drivers/net/phy/phy_device.c -+++ b/drivers/net/phy/phy_device.c -@@ -1524,11 +1524,6 @@ int genphy_config_init(struct phy_device - return 0; - } - --static int gen10g_soft_reset(struct phy_device *phydev) --{ -- /* Do nothing for now */ -- return 0; --} - EXPORT_SYMBOL(genphy_config_init); - - static int gen10g_config_init(struct phy_device *phydev) -@@ -1811,7 +1806,7 @@ static struct phy_driver genphy_driver[] - .phy_id = 0xffffffff, - .phy_id_mask = 0xffffffff, - .name = "Generic 10G PHY", -- .soft_reset = gen10g_soft_reset, -+ .soft_reset = genphy_no_soft_reset, - .config_init = gen10g_config_init, - .features = 0, - .config_aneg = gen10g_config_aneg, diff --git a/target/linux/imx6/image/Makefile b/target/linux/imx6/image/Makefile index c3653cd6f..7f35c56b7 100644 --- a/target/linux/imx6/image/Makefile +++ b/target/linux/imx6/image/Makefile @@ -104,6 +104,7 @@ define Device/ventana BLOCKSIZE := 128k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 124KiB endef +TARGET_DEVICES += ventana define Device/ventana-large $(Device/ventana) @@ -114,14 +115,12 @@ define Device/ventana-large BLOCKSIZE := 256k MKUBIFS_OPTS := -m $$(PAGESIZE) -e 248KiB endef +TARGET_DEVICES += ventana-large define Device/wandboard DEVICE_TITLE := Wandboard Dual DEVICE_DTS := imx6dl-wandboard endef - -TARGET_DEVICES += \ - ventana ventana-large \ - wandboard +TARGET_DEVICES += wandboard $(eval $(call BuildImage)) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index fc21aa465..77ef89679 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -11,7 +11,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 -TARGET_DEVICES = linksys-audi linksys-viper dockstar goflexnet goflexhome iconnect pogo_e02 ib62x0 nsa310b nsa325 on100 UBI_OPTS := -m 2048 -p 128KiB -s 512 UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 @@ -39,18 +38,21 @@ define Device/dockstar IMAGE/factory.bin := append-ubi KERNEL_IN_UBI := 1 endef +TARGET_DEVICES += dockstar define Device/goflexnet $(Device/dockstar) DEVICE_TITLE := Seagate GoFlexNet DEVICE_DTS := kirkwood-goflexnet endef +TARGET_DEVICES += goflexnet define Device/goflexhome $(Device/dockstar) DEVICE_TITLE := Seagate GoFlexHome DEVICE_DTS := kirkwood-goflexhome endef +TARGET_DEVICES += goflexhome define Device/linksys-audi DEVICE_TITLE := Linksys EA3500 (Audi) @@ -62,6 +64,7 @@ define Device/linksys-audi UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef +TARGET_DEVICES += linksys-audi define Device/linksys-viper DEVICE_TITLE := Linksys E4200v2 / EA4500 (Viper) @@ -73,12 +76,14 @@ define Device/linksys-viper UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi endef +TARGET_DEVICES += linksys-viper define Device/iconnect $(Device/dockstar) DEVICE_TITLE := Iomega Iconnect DEVICE_DTS := kirkwood-iconnect endef +TARGET_DEVICES += iconnect define Device/nsa310b $(Device/dockstar) @@ -86,6 +91,7 @@ $(Device/dockstar) DEVICE_DTS := kirkwood-nsa310b DEVICE_PACKAGES := kmod-r8169 kmod-gpio-button-hotplug kmod-hwmon-lm85 endef +TARGET_DEVICES += nsa310b define Device/nsa325 $(Device/dockstar) @@ -93,6 +99,7 @@ $(Device/dockstar) DEVICE_DTS := kirkwood-nsa325 DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3 endef +TARGET_DEVICES += nsa325 define Device/on100 DEVICE_TITLE := Cisco Systems ON100 @@ -104,17 +111,20 @@ define Device/on100 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi UBINIZE_OPTS := -E 5 endef +TARGET_DEVICES += on100 define Device/pogo_e02 $(Device/dockstar) DEVICE_TITLE := Cloud Engines Pogoplug E02 DEVICE_DTS := kirkwood-pogo_e02 endef +TARGET_DEVICES += pogo_e02 define Device/ib62x0 $(Device/dockstar) DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 DEVICE_DTS := kirkwood-ib62x0 endef +TARGET_DEVICES += ib62x0 $(eval $(call BuildImage)) diff --git a/target/linux/lantiq/ase/config-default b/target/linux/lantiq/ase/config-default index b6cd4f391..b80250902 100644 --- a/target/linux/lantiq/ase/config-default +++ b/target/linux/lantiq/ase/config-default @@ -1,5 +1,4 @@ CONFIG_ADM6996_PHY=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CPU_MIPS32_R1=y # CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPSR1=y @@ -9,18 +8,18 @@ CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIRMWARE_MEMMAP=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y # CONFIG_ISDN is not set # CONFIG_LBDAF is not set CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_MIPS_FPU_EMULATOR=y +CONFIG_NLS=y # CONFIG_PSB6970_PHY is not set # CONFIG_RTL8366_SMI is not set CONFIG_SOC_AMAZON_SE=y # CONFIG_SOC_XWAY is not set -# CONFIG_SPI is not set +CONFIG_USB=y +CONFIG_USB_COMMON=y +# CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y -# CONFIG_WIRELESS is not set -# CONFIG_WLAN is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/base-files/etc/board.d/01_leds b/target/linux/lantiq/base-files/etc/board.d/01_leds index 817e2e91c..0426fb18e 100755 --- a/target/linux/lantiq/base-files/etc/board.d/01_leds +++ b/target/linux/lantiq/base-files/etc/board.d/01_leds @@ -4,68 +4,71 @@ # based on ar71xx # +. /lib/functions/leds.sh . /lib/functions/uci-defaults.sh -. /lib/functions/lantiq.sh board_config_update -led_wifi="$(lantiq_get_dt_led wifi)" +led_wifi="$(get_dt_led wifi)" [ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt" -led_usb="$(lantiq_get_dt_led usb)" +led_usb="$(get_dt_led usb)" [ -n "$led_usb" ] && ucidef_set_led_usbdev "usb" "usb" "$led_usb" "1-1" -led_usb2="$(lantiq_get_dt_led usb2)" +led_usb2="$(get_dt_led usb2)" [ -n "$led_usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "$led_usb2" "2-1" -led_dsl="$(lantiq_get_dt_led dsl)" +led_dsl="$(get_dt_led dsl)" [ -n "$led_dsl" ] && { - interface="nas0" - lantiq_is_vdsl_system && interface="ptm0" - - led_internet="$(lantiq_get_dt_led internet)" + led_internet="$(get_dt_led internet)" if [ -n "$led_internet" ]; then ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0" ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan" else - ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "$interface" + ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0" fi } board=$(board_name) case "$board" in -ALL0333CJ) +allnet,all0333cj) ucidef_set_led_netdev "lan" "lan" "all0333cj:green:lan" "eth0.1" ;; -ARV4525PW) +arcadyan,arv4525pw) ucidef_set_led_netdev "wifi" "wifi" "arv4525pw:green:wlan" "wlan0" ;; -ARV7506PW11) +arcadyan,arv7506pw11) ucidef_set_led_wlan "wifi" "wifi" "arv7506pw11:green:wlan" "phy0radio" ;; -ARV7519RW22) +arcadyan,arv7519rw22) ucidef_set_led_netdev "lan" "lan" "arv7519rw22:green:lan" "eth0.1" ;; -BTHOMEHUBV5A) +arcadyan,arv752dpw22) + ucidef_set_led_wlan "wifi" "wifi" "arv752dpw22:red:wifi" "phy0radio" + ;; +bt,homehub-v5a) ucidef_set_led_default "dimmed" "dimmed" "dimmed" "0" ;; -DM200) +netgear,dm200) ucidef_set_led_netdev "lan" "lan" "dm200:green:lan" "eth0" ;; -FRITZ7320) +avm,fritz7320) ucidef_set_led_netdev "wifi" "wifi" "fritz7320:green:wlan" "wlan0" ;; -P2812HNUF*) +zyxel,p-2812hnu-f1|\ +zyxel,p-2812hnu-f3) ucidef_set_led_wlan "wifi" "wifi" "p2812hnufx:green:wlan" "phy0radio" ;; -VGV7510KW22*) +arcadyan,vgv7510kw22-nor|\ +arcadyan,vgv7510kw22-brn) ucidef_set_led_wlan "wifi" "wifi" "vgv7510kw22:green:wlan" "phy0radio" ;; -VGV7519*) +arcadyan,vgv7519-nor|\ +arcadyan,vgv7519-brn) ucidef_set_led_wlan "wifi" "wifi" "vgv7519:green:wireless" "phy0radio" ;; -WBMR300) +buffalo,wbmr-300hpd) ucidef_set_led_switch "lan1" "LAN1" "wbmr300:green:lan1" "switch0" "0x08" ucidef_set_led_switch "lan2" "LAN2" "wbmr300:green:lan2" "switch0" "0x04" ucidef_set_led_switch "wan" "WAN" "wbmr300:green:wan" "switch0" "0x10" diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index 2feeb9c20..efe631c99 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -18,171 +18,204 @@ encaps="llc" payload="bridged" lan_mac="" wan_mac="" -interface_wan="" +interface_wan="dsl0" board=$(board_name) case "$board" in -ACMP252|GIGASX76X) +audiocodes,mp-252) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" ;; -ALL0333CJ) +allnet,all0333cj) annex="b" lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -ARV4510PW) +arcadyan,arv4510pw) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "2:lan:2" "1:lan:3" "3:lan:1" "5t@eth0" ;; -ARV4519PW|ARV7510PW22|ARV7518PW|ARV752DPW22|ARV8539PW22) +arcadyan,arv4519pw|arcadyan,arv7510pw22|arcadyan,arv7518pw) ucidef_add_switch "switch0" \ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" ;; -ARV4520PW) +arcadyan,arv4520pw) + annex="b" ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0" ;; -ARV7506PW11) +arcadyan,arv4525pw|arcadyan,arv452cqw|arcadyan,arv7525pw|arcadyan,arv752dpw) + annex="b" + ucidef_set_interface_lan 'eth0' + ;; + +arcadyan,arv7506pw11) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2) ucidef_add_switch "switch0" \ "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" ;; -ARV7519PW) +arcadyan,arv7519pw) wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 1) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0" ;; -ARV7519RW22) +arcadyan,arv7519rw22) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 22)" 1) ucidef_add_switch "switch0" \ "0:lan:5" "2:lan:3" "3:lan:4" "4:lan:1" "5:lan:2" "6t@eth0" ;; -ASL56026) +arcadyan,arv752dpw22|arcadyan,arv8539pw22) + annex="b" + ucidef_add_switch "switch0" \ + "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" + ;; + +alphanetworks,asl56026) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(mtd_get_mac_ascii uboot_env wanmac) ucidef_add_switch "switch0"\ "2:lan" "3:lan" "6t@eth0" ;; -BTHOMEHUBV2B) +bt,homehub-v2b) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "5t@eth0" ;; -BTHOMEHUBV3A) +bt,homehub-v3a) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -BTHOMEHUBV5A) +bt,homehub-v5a) lan_mac=$(mtd_get_mac_binary_ubi caldata 4364) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -DGN3500*) +netgear,dgn1000b) + annex="b" + ucidef_set_interface_lan 'eth0' + ;; + +netgear,dgn3500|netgear,dgn3500b) + lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) + wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "3:lan:1" "5t@eth0" ;; -DM200) +netgear,dm200) lan_mac=$(mtd_get_mac_binary ART 0) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_set_interface_lan 'eth0' ;; -EASY80920NAND|EASY80920NOR) +lantiq,easy80920-nand|lantiq,easy80920-nor) lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -FRITZ3370) +avm,fritz3370) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2439)" 1) + ucidef_set_interface_lan 'eth0' ;; -FRITZ7320) +avm,fritz7320) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1) + ucidef_set_interface_lan 'eth0' ;; -FRITZ7360SL) +avm,fritz7360sl) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 2705)" 1) ucidef_add_switch "switch0" \ "0:lan:3" "1:lan:4" "2:lan:2" "4:lan:1" "6t@eth0" ;; -H201L) +siemens,gigaset-sx76x) + annex="b" + ucidef_add_switch "switch0" \ + "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5t@eth0" + ;; + +zte,h201l) + annex="b" ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4t@eth0" ;; -P2601HNFX) +zyxel,p-2601hn) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "5t@eth0" ;; -P2812HNUF*) +zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3) lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "4:lan" "5:wan" "6t@eth0" ;; -TDW8970|TDW8980) +tplink,tdw8970|tplink,tdw8980) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 61696)" 1) ucidef_add_switch "switch0" \ "0:lan:2" "2:lan:3" "4:lan:4" "5:lan:1" "6t@eth0" ;; -VG3503J) +arcadyan,vg3503j) lan_mac=$(mtd_get_mac_ascii uboot-env ethaddr) wan_mac=$(macaddr_add "$lan_mac" 1) ucidef_add_switch "switch0" \ "2:lan:1" "4:lan:2" "6t@eth0" ;; -VR200v) +tplink,vr200v) wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 61696)" 1) ucidef_add_switch "switch0" \ "0:lan" "2:lan" "4:lan" "5:lan" "6t@eth0" ;; -VGV7510KW22*) +arcadyan,vgv7510kw22-nor|arcadyan,vgv7510kw22-brn) + annex="b" wan_mac=$(macaddr_add "$(mtd_get_mac_binary board_config 22)" 2) ucidef_add_switch "switch0" \ "2:lan:2" "3:lan:1" "4:lan:4" "5:lan:3" "0:wan:5" "6t@eth0" ;; -VGV7519*) +arcadyan,vgv7519-nor|arcadyan,vgv7519-brn) wan_mac=$(mtd_get_mac_binary board_config 22) ucidef_add_switch "switch0" \ "0:lan:4" "1:lan:3" "2:lan:2" "4:lan:1" "5:wan:5" "6t@eth0" ;; -WBMR) +buffalo,wbmr-hp-g300h) ucidef_add_switch "switch0" \ "0t@eth0" "2:lan" "3:lan" "4:lan" "5:lan" ;; -WBMR300) +buffalo,wbmr-300hpd) lan_mac=$(mtd_get_mac_ascii ubootconfig ethaddr) wan_mac="$lan_mac" ucidef_add_switch "switch0" \ @@ -199,10 +232,8 @@ ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \ ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" if lantiq_is_vdsl_system; then - interface_wan="ptm0" ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode" else - interface_wan="nas0" ucidef_add_adsl_modem "$annex" "/lib/firmware/adsl.bin" fi diff --git a/target/linux/lantiq/base-files/etc/diag.sh b/target/linux/lantiq/base-files/etc/diag.sh index 70ed25cb8..4fb47bd27 100644 --- a/target/linux/lantiq/base-files/etc/diag.sh +++ b/target/linux/lantiq/base-files/etc/diag.sh @@ -2,14 +2,13 @@ # Copyright (C) 2010-2015 OpenWrt.org . /lib/functions/leds.sh -. /lib/functions/lantiq.sh -boot="$(lantiq_get_dt_led boot)" -failsafe="$(lantiq_get_dt_led failsafe)" -running="$(lantiq_get_dt_led running)" +boot="$(get_dt_led boot)" +failsafe="$(get_dt_led failsafe)" +running="$(get_dt_led running)" set_state() { - status_led="$boot" + status_led="$boot" case "$1" in preinit) diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 1c2b8456f..6b4d09dd3 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -38,7 +38,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:02:00.0.bin") board=$(board_name) case $board in - BTHOMEHUBV5A) + bt,homehub-v5a) ath10k_caldata_extract_ubi "caldata" 20480 2116 ath10k_caldata_set_macaddr $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +3) ;; diff --git a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 7144423d4..498a50901 100644 --- a/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -116,32 +116,32 @@ case "$FIRMWARE" in board=$(board_name) case "$board" in - ARV7518PW) + arcadyan,arv7518pw) ath9k_eeprom_extract "boardconfig" 1024 1 ;; - ARV8539PW22) + arcadyan,arv8539pw22) ath9k_eeprom_extract "art" 1024 1 ;; - BTHOMEHUBV2B) + bt,homehub-v2b) ath9k_eeprom_extract "art" 0 1 ath9k_patch_fw_mac_crc "00:00:00:00:00:00" 524 ;; - BTHOMEHUBV3A) + bt,homehub-v3a) ath9k_eeprom_extract "art-copy" 0 1 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot_env ethaddr) +2) 268 ;; - BTHOMEHUBV5A) + bt,homehub-v5a) ath9k_ubi_eeprom_extract "caldata" 4096 0 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 4364) +2) 268 ;; - DGN3500*) + netgear,dgn3500|netgear,dgn3500b) ath9k_eeprom_extract "calibration" 61440 0 ath9k_patch_fw_mac_crc $(macaddr_add $(mtd_get_mac_ascii uboot-env ethaddr) +2) 524 ;; - FRITZ3370|FRITZ7320|FRITZ7360SL) + avm,fritz3370|avm,fritz7320|avm,fritz7360sl) ath9k_eeprom_extract "urlader" 2437 0 ;; - TDW8970|TDW8980) + tplink,tdw8970|tplink,tdw8980) ath9k_eeprom_extract "boardconfig" 135168 0 ;; *) diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration index 6ff435585..dc594e35e 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration +++ b/target/linux/lantiq/base-files/etc/uci-defaults/01_led_migration @@ -56,20 +56,21 @@ migrate_leds() } case "$(board_name)" in -ARV452CQW|\ -ARV7510PW22|\ -ARV7519RW22|\ -ARV752DPW|\ -ARV752DPW22|\ -ASL56026|\ -BTHOMEHUBV2B|\ -BTHOMEHUBV3A|\ -BTHOMEHUBV5A|\ -FRTZ7360SL|\ -VG3503J) +arcadyan,arv452cqw|\ +arcadyan,arv7510pw22|\ +arcadyan,arv7519rw22|\ +arcadyan,arv752dpw|\ +arcadyan,arv752dpw22|\ +alphanetworks,asl56026|\ +bt,homehub-v2b|\ +bt,homehub-v3a|\ +bt,homehub-v5a|\ +avm,fritz7360sl|\ +arcadyan,vg3503j) do_internet_led_rename ;; -DGN3500*) +netgear,dgn3500|\ +netgear,dgn3500b) migrate_leds "dgn3500:blue:wireless=dgn3500:green:wireless" ;; *) diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface new file mode 100644 index 000000000..292d407c3 --- /dev/null +++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface @@ -0,0 +1,55 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/lantiq.sh + +IFNAME_CHANGED=0 + +rename_xdsl_ifname() +{ + local cfg="$1" + local section="$2" + local option="$3" + local name + + config_get name ${section} $option + case $name in + nas0*) + name=${name/nas0/dsl0} + ;; + ptm0*) + name=${name/ptm0/dsl0} + ;; + *) + return + ;; + esac + + uci set ${cfg}.${section}.$option=$name + IFNAME_CHANGED=1 +} + +migrate_network_xdsl_ifname() +{ + rename_xdsl_ifname network "$1" ifname + rename_xdsl_ifname network "$1" name +} + +migrate_led_xdsl_ifname() +{ + rename_xdsl_ifname system "$1" dev +} + +config_load network +config_foreach migrate_network_xdsl_ifname + +[ "$IFNAME_CHANGED" = "1" ] && uci commit network + +IFNAME_CHANGED=0 + +config_load system +config_foreach migrate_led_xdsl_ifname led + +[ "$IFNAME_CHANGED" = "1" ] && uci commit system + +exit 0 diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq.sh b/target/linux/lantiq/base-files/lib/functions/lantiq.sh index 8c2e0ce5c..62c7a6b66 100644 --- a/target/linux/lantiq/base-files/lib/functions/lantiq.sh +++ b/target/linux/lantiq/base-files/lib/functions/lantiq.sh @@ -1,17 +1,5 @@ #!/bin/sh -lantiq_get_dt_led() { - local label - local ledpath - local basepath="/proc/device-tree" - local nodepath="$basepath/aliases/led-$1" - - [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") - [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") - - echo "$label" -} - lantiq_is_vdsl_system() { grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo } diff --git a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh index 47f5b7381..a76fec94e 100755 --- a/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh +++ b/target/linux/lantiq/base-files/lib/functions/lantiq_dsl.sh @@ -166,20 +166,18 @@ data_rates() { chipset() { local vig local cs - local csv vig=$(dsl_cmd vig) cs=$(dsl_val "$vig" DSL_ChipSetType) - csv=$(dsl_val "$vig" DSL_ChipSetHWVersion) csfw=$(dsl_val "$vig" DSL_ChipSetFWVersion) csapi=$(dsl_val "$vig" DSL_DriverVersionApi) if [ "$action" = "lucistat" ]; then - echo "dsl.chipset=\"${cs} ${csv}\"" + echo "dsl.chipset=\"${cs}\"" echo "dsl.firmware_version=\"${csfw}\"" echo "dsl.api_version=\"${csapi}\"" else - echo "Chipset: ${cs} ${csv}" + echo "Chipset: ${cs}" echo "Firmware Version: ${csfw}" echo "API Version: ${csapi}" fi diff --git a/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh b/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh deleted file mode 100755 index aef946036..000000000 --- a/target/linux/lantiq/base-files/lib/preinit/01_preinit_board.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -lantiq_board_detect() { - name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"` - model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"` - [ -z "$name" ] && name="unknown" - [ -z "$model" ] && model="unknown" - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - echo $name > /tmp/sysinfo/board_name - echo $model > /tmp/sysinfo/model -} - -do_lantiq() { - . /lib/functions/lantiq.sh - - lantiq_board_detect -} - -boot_hook_add preinit_main do_lantiq diff --git a/target/linux/lantiq/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/base-files/lib/upgrade/platform.sh index 9158fa742..77b3868dc 100755 --- a/target/linux/lantiq/base-files/lib/upgrade/platform.sh +++ b/target/linux/lantiq/base-files/lib/upgrade/platform.sh @@ -9,7 +9,7 @@ platform_pre_upgrade() { local board=$(board_name) case "$board" in - BTHOMEHUBV2B|BTHOMEHUBV3A|BTHOMEHUBV5A|P2812HNUF* ) + bt,homehub-v2b|bt,homehub-v3a|bt,homehub-v5a|zyxel,p-2812hnu-f1|zyxel,p-2812hnu-f3) nand_do_upgrade $1 ;; esac diff --git a/target/linux/lantiq/config-4.9 b/target/linux/lantiq/config-4.9 index 387a1893b..a98509e5d 100644 --- a/target/linux/lantiq/config-4.9 +++ b/target/linux/lantiq/config-4.9 @@ -12,7 +12,6 @@ CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -151,20 +150,13 @@ CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -# CONFIG_PCIE_LANTIQ is not set -CONFIG_PCI_DOMAINS=y CONFIG_PCI_DRIVERS_LEGACY=y -CONFIG_PCI_LANTIQ=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y diff --git a/target/linux/lantiq/dts/ACMP252.dts b/target/linux/lantiq/dts/ACMP252.dts index a94014b0f..729472011 100644 --- a/target/linux/lantiq/dts/ACMP252.dts +++ b/target/linux/lantiq/dts/ACMP252.dts @@ -3,7 +3,8 @@ #include "danube.dtsi" / { - model = "ACMP252 - AudioCodes MediaPack MP-252"; + compatible = "audiocodes,mp-252", "lantiq,xway", "lantiq,danube"; + model = "AudioCodes MediaPack MP-252"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ALL0333CJ.dts b/target/linux/lantiq/dts/ALL0333CJ.dts index 99174c53f..16c5facb3 100644 --- a/target/linux/lantiq/dts/ALL0333CJ.dts +++ b/target/linux/lantiq/dts/ALL0333CJ.dts @@ -3,7 +3,8 @@ #include "amazonse.dtsi" / { - model = "ALL0333CJ - Allnet ALL0333CJ DSL Modem"; + compatible = "allnet,all0333cj", "lantiq,xway", "lantiq,ase"; + model = "Allnet ALL0333CJ DSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4510PW.dts b/target/linux/lantiq/dts/ARV4510PW.dts index 17609e25b..4720b57dd 100644 --- a/target/linux/lantiq/dts/ARV4510PW.dts +++ b/target/linux/lantiq/dts/ARV4510PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4510PW - Wippies, Elisa"; + compatible = "arcadyan,arv4510pw", "lantiq,xway", "lantiq,danube"; + model = "Wippies, Elisa"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4518PWR01.dts b/target/linux/lantiq/dts/ARV4518PWR01.dts index 21a03dde4..34f868f48 100644 --- a/target/linux/lantiq/dts/ARV4518PWR01.dts +++ b/target/linux/lantiq/dts/ARV4518PWR01.dts @@ -3,5 +3,6 @@ #include "ARV4518PWR01.dtsi" / { - model = "ARV4518PWR01 - SMC7908A-ISP"; + compatible = "arcadyan,arv4518pwr01", "lantiq,xway", "lantiq,danube"; + model = "SMC7908A-ISP"; }; diff --git a/target/linux/lantiq/dts/ARV4518PWR01A.dts b/target/linux/lantiq/dts/ARV4518PWR01A.dts index e94076b43..771d0146d 100644 --- a/target/linux/lantiq/dts/ARV4518PWR01A.dts +++ b/target/linux/lantiq/dts/ARV4518PWR01A.dts @@ -3,7 +3,8 @@ #include "ARV4518PWR01.dtsi" / { - model = "ARV4518PWR01A - SMC7908A-ISP, Airties WAV-221"; + compatible = "arcadyan,arv4518pwr01a", "lantiq,xway", "lantiq,danube"; + model = "SMC7908A-ISP, Airties WAV-221"; fpi@10000000 { pci@E105400 { diff --git a/target/linux/lantiq/dts/ARV4519PW.dts b/target/linux/lantiq/dts/ARV4519PW.dts index 86c0d4876..8f781760f 100644 --- a/target/linux/lantiq/dts/ARV4519PW.dts +++ b/target/linux/lantiq/dts/ARV4519PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4519PW - Vodafone Netfaster IAD 2, Pirelli P.RG A4201G"; + compatible = "arcadyan,arv4519pw", "lantiq,xway", "lantiq,danube"; + model = "Vodafone Netfaster IAD 2, Pirelli P.RG A4201G"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4520PW.dts b/target/linux/lantiq/dts/ARV4520PW.dts index 030e316c8..05e0dfe04 100644 --- a/target/linux/lantiq/dts/ARV4520PW.dts +++ b/target/linux/lantiq/dts/ARV4520PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4520PW - Easybox 800, WAV-281"; + compatible = "arcadyan,arv4520pw", "lantiq,xway", "lantiq,danube"; + model = "Easybox 800, WAV-281"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV4525PW.dts b/target/linux/lantiq/dts/ARV4525PW.dts index 64b45aedb..61548c793 100644 --- a/target/linux/lantiq/dts/ARV4525PW.dts +++ b/target/linux/lantiq/dts/ARV4525PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV4525PW - Speedport W501V Typ A"; + compatible = "arcadyan,arv4525pw", "lantiq,xway", "lantiq,danube"; + model = "Speedport W501V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV452CQW.dts b/target/linux/lantiq/dts/ARV452CQW.dts index e43bab3dd..d996e8b66 100644 --- a/target/linux/lantiq/dts/ARV452CQW.dts +++ b/target/linux/lantiq/dts/ARV452CQW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV452CQW - Arcor 801"; + compatible = "arcadyan,arv452cqw", "lantiq,xway", "lantiq,danube"; + model = "Arcor 801"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7506PW11.dts b/target/linux/lantiq/dts/ARV7506PW11.dts index 1a57d64cb..3ec4bf41a 100644 --- a/target/linux/lantiq/dts/ARV7506PW11.dts +++ b/target/linux/lantiq/dts/ARV7506PW11.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7506PW11 - Alice/O2 IAD 4421"; + compatible = "arcadyan,arv7506pw11", "lantiq,xway", "lantiq,danube"; + model = "Alice/O2 IAD 4421"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7510PW22.dts b/target/linux/lantiq/dts/ARV7510PW22.dts index 6bad4e3e7..dc3f614b9 100644 --- a/target/linux/lantiq/dts/ARV7510PW22.dts +++ b/target/linux/lantiq/dts/ARV7510PW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7510PW22 - Astoria Networks"; + compatible = "arcadyan,arv7510pw22", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7510PW22"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7518PW.dts b/target/linux/lantiq/dts/ARV7518PW.dts index a05443725..41b124932 100644 --- a/target/linux/lantiq/dts/ARV7518PW.dts +++ b/target/linux/lantiq/dts/ARV7518PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7518PW - Astoria Networks"; + compatible = "arcadyan,arv7518pw", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7518PW"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7519PW.dts b/target/linux/lantiq/dts/ARV7519PW.dts index cc6786833..9983a7906 100644 --- a/target/linux/lantiq/dts/ARV7519PW.dts +++ b/target/linux/lantiq/dts/ARV7519PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7519PW - Astoria Networks"; + compatible = "arcadyan,arv7519pw", "lantiq,xway", "lantiq,danube"; + model = "Astoria Networks ARV7519PW"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7519RW22.dts b/target/linux/lantiq/dts/ARV7519RW22.dts index f31c03f45..9e2ae9d6f 100644 --- a/target/linux/lantiq/dts/ARV7519RW22.dts +++ b/target/linux/lantiq/dts/ARV7519RW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7519RW22 - Orange Livebox 2.1"; + compatible = "arcadyan,arv7519rw22", "lantiq,xway", "lantiq,vr9"; + model = "Orange Livebox 2.1"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV7525PW.dts b/target/linux/lantiq/dts/ARV7525PW.dts index 7d643be2f..000753589 100644 --- a/target/linux/lantiq/dts/ARV7525PW.dts +++ b/target/linux/lantiq/dts/ARV7525PW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV7525PW - Speedport W303V Typ A"; + compatible = "arcadyan,arv7525pw", "lantiq,xway", "lantiq,danube"; + model = "Speedport W303V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV752DPW.dts b/target/linux/lantiq/dts/ARV752DPW.dts index 5069d0d74..3591b4367 100644 --- a/target/linux/lantiq/dts/ARV752DPW.dts +++ b/target/linux/lantiq/dts/ARV752DPW.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV752DPW - Arcor 802"; + compatible = "arcadyan,arv752dpw", "lantiq,xway", "lantiq,danube"; + model = "Arcor 802"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ARV752DPW22.dts b/target/linux/lantiq/dts/ARV752DPW22.dts index d5a6d3184..8b5be8b76 100644 --- a/target/linux/lantiq/dts/ARV752DPW22.dts +++ b/target/linux/lantiq/dts/ARV752DPW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV752DPW22 - Arcor 803"; + compatible = "arcadyan,arv752dpw22", "lantiq,xway", "lantiq,danube"; + model = "Arcor 803"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -253,5 +254,6 @@ reg = <0x7000 0 0 0 0>; ralink,mtd-eeprom = <&boardconfig 0x410>; ralink,mtd-eeprom-swap; + mtd-mac-address = <&boardconfig 0x16>; }; }; diff --git a/target/linux/lantiq/dts/ARV8539PW22.dts b/target/linux/lantiq/dts/ARV8539PW22.dts index c55c9a61e..4edcde976 100644 --- a/target/linux/lantiq/dts/ARV8539PW22.dts +++ b/target/linux/lantiq/dts/ARV8539PW22.dts @@ -5,7 +5,8 @@ #include / { - model = "ARV8539PW22 - Speedport W 504V Typ A"; + compatible = "arcadyan,arv8539pw22", "lantiq,xway", "lantiq,danube"; + model = "Speedport W 504V Typ A"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/ASL56026.dts b/target/linux/lantiq/dts/ASL56026.dts index e2990e451..293a3e27d 100644 --- a/target/linux/lantiq/dts/ASL56026.dts +++ b/target/linux/lantiq/dts/ASL56026.dts @@ -5,7 +5,8 @@ #include / { - model = "ASL56026 - BT OpenReach VDSL Modem"; + compatible = "alphanetworks,asl56026", "lantiq,xway", "lantiq,vr9"; + model = "BT OpenReach VDSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts index 87b4dfbd4..961fd9b92 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV2B.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV2B.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV2B - BT Home Hub 2B"; /* SoC: Lantiq Danube-S PSB 50712 @ 333MHz V1.3/1.5 */ + compatible = "bt,homehub-v2b", "lantiq,xway", "lantiq,danube"; + model = "BT Home Hub 2B"; /* SoC: Lantiq Danube-S PSB 50712 @ 333MHz V1.3/1.5 */ chosen { bootargs = "console=ttyLTQ0,115200"; @@ -74,7 +75,7 @@ }; nand-parts@0 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts index ca9020bf7..d37b9728d 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV3A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV3A.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV3A - BT Home Hub 3A"; /* SoC: Lantiq ar9 @ 333MHz */ + compatible = "bt,homehub-v3a", "lantiq,xway", "lantiq,ar9"; + model = "BT Home Hub 3A"; /* SoC: Lantiq ar9 @ 333MHz */ chosen { bootargs = "console=ttyLTQ0,115200"; @@ -34,7 +35,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { /* NAND Flash: Samsung K9F5608U0D-JIB0 32MB */ - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000 >; diff --git a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts index a33690cef..4bdeddcaf 100644 --- a/target/linux/lantiq/dts/BTHOMEHUBV5A.dts +++ b/target/linux/lantiq/dts/BTHOMEHUBV5A.dts @@ -5,7 +5,8 @@ #include / { - model = "BTHOMEHUBV5A - BT Home Hub 5A"; + compatible = "bt,homehub-v5a", "lantiq,xway", "lantiq,vr9"; + model = "BT Home Hub 5A"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -27,7 +28,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0x1 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/DGN1000B.dts b/target/linux/lantiq/dts/DGN1000B.dts index 558658292..e5637efca 100644 --- a/target/linux/lantiq/dts/DGN1000B.dts +++ b/target/linux/lantiq/dts/DGN1000B.dts @@ -5,7 +5,8 @@ #include / { - model = "DGN1000B - Netgear DGN1000B"; + compatible = "netgear,dgn1000b", "lantiq,xway", "lantiq,ase"; + model = "Netgear DGN1000B"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -60,6 +61,7 @@ }; spi@E100800 { + status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&pins_spi_default>; diff --git a/target/linux/lantiq/dts/DGN3500.dts b/target/linux/lantiq/dts/DGN3500.dts index 9017a427c..98a2ebd98 100644 --- a/target/linux/lantiq/dts/DGN3500.dts +++ b/target/linux/lantiq/dts/DGN3500.dts @@ -3,5 +3,6 @@ #include "DGN3500.dtsi" / { - model = "DGN3500 - Netgear DGN3500"; + compatible = "netgear,dgn3500", "lantiq,xway", "lantiq,ar9"; + model = "Netgear DGN3500"; }; diff --git a/target/linux/lantiq/dts/DGN3500B.dts b/target/linux/lantiq/dts/DGN3500B.dts index d0ed5ebd5..d1d788cc7 100644 --- a/target/linux/lantiq/dts/DGN3500B.dts +++ b/target/linux/lantiq/dts/DGN3500B.dts @@ -3,5 +3,6 @@ #include "DGN3500.dtsi" / { - model = "DGN3500B - Netgear DGN3500B"; + compatible = "netgear,dgn3500b", "lantiq,xway", "lantiq,ar9"; + model = "Netgear DGN3500B"; }; diff --git a/target/linux/lantiq/dts/DM200.dts b/target/linux/lantiq/dts/DM200.dts index 050d558a2..eef408491 100644 --- a/target/linux/lantiq/dts/DM200.dts +++ b/target/linux/lantiq/dts/DM200.dts @@ -5,7 +5,8 @@ #include / { - model = "DM200 - Netgear DM200"; + compatible = "netgear,dm200", "lantiq,xway", "lantiq,vr9"; + model = "Netgear DM200"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/EASY50712.dts b/target/linux/lantiq/dts/EASY50712.dts index ec3516ca8..ebd30a7c0 100644 --- a/target/linux/lantiq/dts/EASY50712.dts +++ b/target/linux/lantiq/dts/EASY50712.dts @@ -3,7 +3,8 @@ #include "danube.dtsi" / { - model = "EASY50712 - Intel EASY50712 Nand"; + compatible = "lantiq,easy50712", "lantiq,xway", "lantiq,danube"; + model = "Intel EASY50712 Nand"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/EASY50810.dts b/target/linux/lantiq/dts/EASY50810.dts index 7c274a15a..605eb826a 100644 --- a/target/linux/lantiq/dts/EASY50810.dts +++ b/target/linux/lantiq/dts/EASY50810.dts @@ -3,6 +3,9 @@ #include "ar9.dtsi" / { + compatible = "lantiq,easy50810", "lantiq,xway", "lantiq,ar9"; + model = "Lantiq EASY50810"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/EASY80920.dtsi b/target/linux/lantiq/dts/EASY80920.dtsi index 220916266..3565842f2 100644 --- a/target/linux/lantiq/dts/EASY80920.dtsi +++ b/target/linux/lantiq/dts/EASY80920.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/EASY80920NAND.dts b/target/linux/lantiq/dts/EASY80920NAND.dts index 332f2fb35..095bd564d 100644 --- a/target/linux/lantiq/dts/EASY80920NAND.dts +++ b/target/linux/lantiq/dts/EASY80920NAND.dts @@ -4,7 +4,8 @@ #include "EASY80920.dtsi" / { - model = "EASY80920NAND - Intel EASY80920 Nand"; + compatible = "lantiq,easy80920-nand", "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + model = "Intel EASY80920 Nand"; chosen { bootargs = "ubi.mtd=ubi ubi.block=0,rootfsA root=/dev/ubiblock0_1"; @@ -14,7 +15,7 @@ localbus@0 { ranges = <0 0 0x4000000 0x3ffffff>; nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/EASY80920NOR.dts b/target/linux/lantiq/dts/EASY80920NOR.dts index 6ad17d6fc..e273138d8 100644 --- a/target/linux/lantiq/dts/EASY80920NOR.dts +++ b/target/linux/lantiq/dts/EASY80920NOR.dts @@ -4,7 +4,8 @@ #include "EASY80920.dtsi" / { - model = "EASY80920NOR - Intel EASY80920 Nor"; + compatible = "lantiq,easy80920-nor", "lantiq,easy80920", "lantiq,xway", "lantiq,vr9"; + model = "Intel EASY80920 Nor"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/EASY88388.dts b/target/linux/lantiq/dts/EASY88388.dts index a6382e785..a9c5b3c24 100644 --- a/target/linux/lantiq/dts/EASY88388.dts +++ b/target/linux/lantiq/dts/EASY88388.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY88388 - Lantiq Falcon FTTDP8 Reference Board"; - compatible = "lantiq,falcon-easy88388", "lantiq,falcon"; + model = "Lantiq Falcon FTTDP8 Reference Board"; + compatible = "lantiq,easy88388", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY88444.dts b/target/linux/lantiq/dts/EASY88444.dts index 583f5fbcd..ceb81ea13 100644 --- a/target/linux/lantiq/dts/EASY88444.dts +++ b/target/linux/lantiq/dts/EASY88444.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY88444 - Lantiq Falcon FTTdp G.FAST Reference Board"; - compatible = "lantiq,falcon-easy88444", "lantiq,falcon"; + model = "Lantiq Falcon FTTdp G.FAST Reference Board"; + compatible = "lantiq,easy88444", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98000-base.dtsi b/target/linux/lantiq/dts/EASY98000-base.dtsi index ccb96247e..cfe1140ac 100644 --- a/target/linux/lantiq/dts/EASY98000-base.dtsi +++ b/target/linux/lantiq/dts/EASY98000-base.dtsi @@ -3,7 +3,7 @@ #include / { - compatible = "lantiq,falcon-easy98000", "lantiq,falcon"; + compatible = "lantiq,easy98000", "lantiq,falcon"; memory@0 { device_type = "memory"; diff --git a/target/linux/lantiq/dts/EASY98000NAND.dts b/target/linux/lantiq/dts/EASY98000NAND.dts index 0e5b89d50..a40cef393 100644 --- a/target/linux/lantiq/dts/EASY98000NAND.dts +++ b/target/linux/lantiq/dts/EASY98000NAND.dts @@ -4,8 +4,8 @@ #include "EASY98000-base.dtsi" / { - model = "EASY98000NAND - Lantiq Falcon (NAND)"; - compatible = "lantiq,falcon-easy98000-nand", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (NAND)"; + compatible = "lantiq,easy98000-nand", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &spi; diff --git a/target/linux/lantiq/dts/EASY98000NOR.dts b/target/linux/lantiq/dts/EASY98000NOR.dts index 812ffb6c5..ad53bf96e 100644 --- a/target/linux/lantiq/dts/EASY98000NOR.dts +++ b/target/linux/lantiq/dts/EASY98000NOR.dts @@ -4,8 +4,8 @@ #include "EASY98000-base.dtsi" / { - model = "EASY98000NOR - Lantiq Falcon (NOR)"; - compatible = "lantiq,falcon-easy98000-nor", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (NOR)"; + compatible = "lantiq,easy98000-nor", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &spi; diff --git a/target/linux/lantiq/dts/EASY98000SFLASH.dts b/target/linux/lantiq/dts/EASY98000SFLASH.dts index 4fb5ba577..bbe524e94 100644 --- a/target/linux/lantiq/dts/EASY98000SFLASH.dts +++ b/target/linux/lantiq/dts/EASY98000SFLASH.dts @@ -5,8 +5,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98000SFLASH - Lantiq Falcon (SFLASH)"; - compatible = "lantiq,falcon-easy98000-sflash", "lantiq,falcon-easy98000", "lantiq,falcon"; + model = "Lantiq Falcon (SFLASH)"; + compatible = "lantiq,easy98000-sflash", "lantiq,easy98000", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98020.dts b/target/linux/lantiq/dts/EASY98020.dts index 5e5e13017..c0970ef48 100644 --- a/target/linux/lantiq/dts/EASY98020.dts +++ b/target/linux/lantiq/dts/EASY98020.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98020 - Lantiq Falcon Reference Board"; - compatible = "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon Reference Board"; + compatible = "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98020V18.dts b/target/linux/lantiq/dts/EASY98020V18.dts index 136f56c9f..9aa1be91e 100644 --- a/target/linux/lantiq/dts/EASY98020V18.dts +++ b/target/linux/lantiq/dts/EASY98020V18.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98020V18 - Lantiq Falcon Reference Board V1.8"; - compatible = "lantiq,falcon-easy98020-V18", "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon Reference Board V1.8"; + compatible = "lantiq,easy98020-v18", "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98021.dts b/target/linux/lantiq/dts/EASY98021.dts index a7c5ad9bc..7b2e490fc 100644 --- a/target/linux/lantiq/dts/EASY98021.dts +++ b/target/linux/lantiq/dts/EASY98021.dts @@ -6,8 +6,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98021 - Lantiq Falcon HGU Reference Board"; - compatible = "lantiq,falcon-easy98021", "lantiq,falcon-easy98020", "lantiq,falcon"; + model = "Lantiq Falcon HGU Reference Board"; + compatible = "lantiq,easy98021", "lantiq,easy98020", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98035SYNCE.dts b/target/linux/lantiq/dts/EASY98035SYNCE.dts index f6d98e79a..df941cdb6 100644 --- a/target/linux/lantiq/dts/EASY98035SYNCE.dts +++ b/target/linux/lantiq/dts/EASY98035SYNCE.dts @@ -4,8 +4,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98035SYNCE - Lantiq Falcon SFP Stick with SyncE"; - compatible = "lantiq,falcon-easy98035synce", "lantiq,falcon-sfp", "lantiq,falcon"; + model = "Lantiq Falcon SFP Stick with SyncE"; + compatible = "lantiq,easy98035synce", "lantiq,falcon-sfp", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/EASY98035SYNCE1588.dts b/target/linux/lantiq/dts/EASY98035SYNCE1588.dts index 8cefef8c1..a3abc6e70 100644 --- a/target/linux/lantiq/dts/EASY98035SYNCE1588.dts +++ b/target/linux/lantiq/dts/EASY98035SYNCE1588.dts @@ -4,8 +4,8 @@ #include "falcon-sflash-16M.dtsi" / { - model = "EASY98035SYNCE1588 - Lantiq Falcon SFP Stick with SyncE/1588"; - compatible = "lantiq,falcon-easy98035synce1588", "lantiq,falcon-sfp", "lantiq,falcon"; + model = "Lantiq Falcon SFP Stick with SyncE/1588"; + compatible = "lantiq,easy98035synce1588", "lantiq,falcon-sfp", "lantiq,falcon"; aliases { spi0 = &ebu_cs0; diff --git a/target/linux/lantiq/dts/FALCON-MDU.dts b/target/linux/lantiq/dts/FALCON-MDU.dts index 32b7e2355..6710bbe98 100644 --- a/target/linux/lantiq/dts/FALCON-MDU.dts +++ b/target/linux/lantiq/dts/FALCON-MDU.dts @@ -6,7 +6,7 @@ #include "falcon-sflash-16M.dtsi" / { - model = "FALCON-MDU - Lantiq Falcon / Vinax MDU Board"; + model = "Lantiq Falcon / Vinax MDU Board"; compatible = "lantiq,falcon-mdu", "lantiq,falcon"; aliases { diff --git a/target/linux/lantiq/dts/FALCON-SFP.dts b/target/linux/lantiq/dts/FALCON-SFP.dts index bba52d876..8d45de4eb 100644 --- a/target/linux/lantiq/dts/FALCON-SFP.dts +++ b/target/linux/lantiq/dts/FALCON-SFP.dts @@ -4,7 +4,7 @@ #include "falcon-sflash-16M.dtsi" / { - model = "FALCON-SFP - Lantiq Falcon SFP Stick"; + model = "Lantiq Falcon SFP Stick"; compatible = "lantiq,falcon-sfp", "lantiq,falcon"; aliases { diff --git a/target/linux/lantiq/dts/FRITZ3370.dts b/target/linux/lantiq/dts/FRITZ3370.dts index 3f57f45ee..76f7f877b 100644 --- a/target/linux/lantiq/dts/FRITZ3370.dts +++ b/target/linux/lantiq/dts/FRITZ3370.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ3370 - Fritz!Box WLAN 3370"; + compatible = "avm,fritz3370", "lantiq,xway", "lantiq,vr9"; + model = "Fritz!Box WLAN 3370"; chosen { bootargs = "console=ttyLTQ0,115200 ubi.mtd=1,512 root=/dev/mtdblock9"; @@ -28,7 +29,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; bank-width = <2>; reg = <1 0x0 0x2000000>; #address-cells = <1>; diff --git a/target/linux/lantiq/dts/FRITZ7320.dts b/target/linux/lantiq/dts/FRITZ7320.dts index 491baee7e..34d0df9b3 100644 --- a/target/linux/lantiq/dts/FRITZ7320.dts +++ b/target/linux/lantiq/dts/FRITZ7320.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ7320 - 1&1 HomeServer"; + compatible = "avm,fritz7320", "lantiq,xway", "lantiq,ar9"; + model = "1&1 HomeServer"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/FRITZ7360SL.dts b/target/linux/lantiq/dts/FRITZ7360SL.dts index 496fe2e96..cf8245140 100644 --- a/target/linux/lantiq/dts/FRITZ7360SL.dts +++ b/target/linux/lantiq/dts/FRITZ7360SL.dts @@ -5,7 +5,8 @@ #include / { - model = "FRITZ7360SL - 1&1 HomeServer"; + compatible = "avm,fritz7360sl", "lantiq,xway", "lantiq,vr9"; + model = "1&1 HomeServer"; chosen { bootargs = "console=ttyLTQ0,115200"; @@ -191,12 +192,12 @@ compatible = "lantiq,xrx200-mdio"; phy0: ethernet-phy@0 { reg = <0x00>; - compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 37 GPIO_ACTIVE_LOW>; }; phy1: ethernet-phy@1 { reg = <0x01>; - compatible = "ethernet-phy-id004d.d076", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; phy11: ethernet-phy@11 { diff --git a/target/linux/lantiq/dts/GIGASX76X.dts b/target/linux/lantiq/dts/GIGASX76X.dts index f5707e9c9..99ccbce29 100644 --- a/target/linux/lantiq/dts/GIGASX76X.dts +++ b/target/linux/lantiq/dts/GIGASX76X.dts @@ -5,7 +5,8 @@ #include / { - model = "GIGASX76X - Gigaset SX761,SX762,SX763"; + compatible = "siemens,gigaset-sx76x", "lantiq,xway", "lantiq,danube"; + model = "Gigaset SX761,SX762,SX763"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/H201L.dts b/target/linux/lantiq/dts/H201L.dts index a24d7590e..01016f45c 100644 --- a/target/linux/lantiq/dts/H201L.dts +++ b/target/linux/lantiq/dts/H201L.dts @@ -5,7 +5,8 @@ #include / { - model = "H201L - ZTE H210L"; + compatible = "zte,h201l", "lantiq,xway", "lantiq,ar9"; + model = "ZTE H210L"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/P2601HNFX.dts b/target/linux/lantiq/dts/P2601HNFX.dts index 7bfd52cf5..1b885ad84 100644 --- a/target/linux/lantiq/dts/P2601HNFX.dts +++ b/target/linux/lantiq/dts/P2601HNFX.dts @@ -5,7 +5,8 @@ #include / { - model = "P2601HNFX - ZyXEL P-2601HN-Fx"; + compatible = "zyxel,p-2601hn", "lantiq,xway", "lantiq,ar9"; + model = "ZyXEL P-2601HN-Fx"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/P2812HNUF1.dts b/target/linux/lantiq/dts/P2812HNUF1.dts index b1d9eedb3..4a29cd929 100644 --- a/target/linux/lantiq/dts/P2812HNUF1.dts +++ b/target/linux/lantiq/dts/P2812HNUF1.dts @@ -3,7 +3,8 @@ #include "P2812HNUFX.dtsi" / { - model = "P2812HNUF1 - ZyXEL P-2812HNU-F1"; + compatible = "zyxel,p-2812hnu-f1", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + model = "ZyXEL P-2812HNU-F1"; aliases { led-usb = &usb1; @@ -13,7 +14,7 @@ fpi@10000000 { localbus@0 { nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <0 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/P2812HNUF3.dts b/target/linux/lantiq/dts/P2812HNUF3.dts index 366d03467..d37ad0a8e 100644 --- a/target/linux/lantiq/dts/P2812HNUF3.dts +++ b/target/linux/lantiq/dts/P2812HNUF3.dts @@ -3,7 +3,8 @@ #include "P2812HNUFX.dtsi" / { - model = "P2812HNUF3 - ZyXEL P-2812HNU-F3"; + compatible = "zyxel,p-2812hnu-f3", "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + model = "ZyXEL P-2812HNU-F3"; fpi@10000000 { localbus@0 { @@ -36,7 +37,7 @@ }; nand-parts@0 { - compatible = "gen_nand", "lantiq,nand-xway"; + compatible = "lantiq,nand-xway"; lantiq,cs = <1>; bank-width = <2>; reg = <1 0x0 0x2000000>; diff --git a/target/linux/lantiq/dts/P2812HNUFX.dtsi b/target/linux/lantiq/dts/P2812HNUFX.dtsi index cc133f65f..9429d5caf 100644 --- a/target/linux/lantiq/dts/P2812HNUFX.dtsi +++ b/target/linux/lantiq/dts/P2812HNUFX.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "zyxel,p-2812hnu", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/TDW8970.dts b/target/linux/lantiq/dts/TDW8970.dts index 6a376a05c..25eb3dac6 100644 --- a/target/linux/lantiq/dts/TDW8970.dts +++ b/target/linux/lantiq/dts/TDW8970.dts @@ -3,5 +3,6 @@ #include "TDW89X0.dtsi" / { - model = "TDW8970 - TP-LINK TD-W8970"; + compatible = "tplink,tdw8970", "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK TD-W8970"; }; diff --git a/target/linux/lantiq/dts/TDW8980.dts b/target/linux/lantiq/dts/TDW8980.dts index 0796b2b23..def34b55b 100644 --- a/target/linux/lantiq/dts/TDW8980.dts +++ b/target/linux/lantiq/dts/TDW8980.dts @@ -3,7 +3,8 @@ #include "TDW89X0.dtsi" / { - model = "TDW8980 - TP-LINK TD-W8980"; + compatible = "tplink,tdw8980", "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK TD-W8980"; fpi@10000000 { gpio: pinmux@E100B10 { diff --git a/target/linux/lantiq/dts/TDW89X0.dtsi b/target/linux/lantiq/dts/TDW89X0.dtsi index 4252297df..79bcfc103 100644 --- a/target/linux/lantiq/dts/TDW89X0.dtsi +++ b/target/linux/lantiq/dts/TDW89X0.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "tplink,tdw89x0", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200"; }; diff --git a/target/linux/lantiq/dts/VG3503J.dts b/target/linux/lantiq/dts/VG3503J.dts index 99fe486dc..cb0d5ddec 100644 --- a/target/linux/lantiq/dts/VG3503J.dts +++ b/target/linux/lantiq/dts/VG3503J.dts @@ -5,7 +5,8 @@ #include / { - model = "VG3503J - BT OpenReach VDSL Modem"; + compatible = "arcadyan,vg3503j", "lantiq,xway", "lantiq,vr9"; + model = "BT OpenReach VDSL Modem"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/VGV7510KW22.dtsi b/target/linux/lantiq/dts/VGV7510KW22.dtsi index 73240bf2b..2d8e528f4 100644 --- a/target/linux/lantiq/dts/VGV7510KW22.dtsi +++ b/target/linux/lantiq/dts/VGV7510KW22.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp"; }; @@ -228,7 +230,7 @@ phy1: ethernet-phy@1 { reg = <0x1>; - compatible = "ethernet-phy-id0243.0c54", "ethernet-phy-ieee802.3-c22"; + compatible = "ethernet-phy-ieee802.3-c22"; }; phy11: ethernet-phy@11 { diff --git a/target/linux/lantiq/dts/VGV7510KW22BRN.dts b/target/linux/lantiq/dts/VGV7510KW22BRN.dts index 2fec1aedd..d0be62f63 100644 --- a/target/linux/lantiq/dts/VGV7510KW22BRN.dts +++ b/target/linux/lantiq/dts/VGV7510KW22BRN.dts @@ -3,7 +3,8 @@ #include "VGV7510KW22.dtsi" / { - model = "VGV7510KW22BRN - o2 Box 6431"; + compatible = "arcadyan,vgv7510kw22-brn", "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + model = "o2 Box 6431"; sram@1F000000 { cgu@103000 { diff --git a/target/linux/lantiq/dts/VGV7510KW22NOR.dts b/target/linux/lantiq/dts/VGV7510KW22NOR.dts index 5dfc149c3..1d21e14f0 100644 --- a/target/linux/lantiq/dts/VGV7510KW22NOR.dts +++ b/target/linux/lantiq/dts/VGV7510KW22NOR.dts @@ -3,7 +3,8 @@ #include "VGV7510KW22.dtsi" / { - model = "VGV7510KW22NOR - o2 Box 6431"; + compatible = "arcadyan,vgv7510kw22-nor", "arcadyan,vgv7510kw22", "lantiq,xway", "lantiq,vr9"; + model = "o2 Box 6431"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VGV7519.dtsi b/target/linux/lantiq/dts/VGV7519.dtsi index 0c2da5279..edff93cf4 100644 --- a/target/linux/lantiq/dts/VGV7519.dtsi +++ b/target/linux/lantiq/dts/VGV7519.dtsi @@ -3,6 +3,8 @@ #include / { + compatible = "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + chosen { bootargs = "console=ttyLTQ0,115200 mem=62M vpe1_load_addr=0x83e00000 vpe1_mem=2M maxvpes=1 maxtcs=1 nosmp"; }; diff --git a/target/linux/lantiq/dts/VGV7519BRN.dts b/target/linux/lantiq/dts/VGV7519BRN.dts index 3d51aaa43..f30d2f920 100644 --- a/target/linux/lantiq/dts/VGV7519BRN.dts +++ b/target/linux/lantiq/dts/VGV7519BRN.dts @@ -4,7 +4,8 @@ #include "VGV7519.dtsi" / { - model = "VGV7519BRN - KPN Experiabox V8"; + compatible = "arcadyan,vgv7519-brn", "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + model = "KPN Experiabox V8"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VGV7519NOR.dts b/target/linux/lantiq/dts/VGV7519NOR.dts index 4ca820844..ec548fbe7 100644 --- a/target/linux/lantiq/dts/VGV7519NOR.dts +++ b/target/linux/lantiq/dts/VGV7519NOR.dts @@ -4,7 +4,8 @@ #include "VGV7519.dtsi" / { - model = "VGV7519NOR - KPN Experiabox V8"; + compatible = "arcadyan,vgv7519-nor", "arcadyan,vgv7519", "lantiq,xway", "lantiq,vr9"; + model = "KPN Experiabox V8"; fpi@10000000 { localbus@0 { diff --git a/target/linux/lantiq/dts/VR200v.dts b/target/linux/lantiq/dts/VR200v.dts index 11930ba67..b063d758c 100644 --- a/target/linux/lantiq/dts/VR200v.dts +++ b/target/linux/lantiq/dts/VR200v.dts @@ -5,7 +5,8 @@ #include / { - model = "VR200v - TP-LINK Archer VR200v"; + compatible = "tplink,vr200v", "lantiq,xway", "lantiq,vr9"; + model = "TP-LINK Archer VR200v"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/WBMR.dts b/target/linux/lantiq/dts/WBMR.dts index 79d7b63bf..fab99d00e 100644 --- a/target/linux/lantiq/dts/WBMR.dts +++ b/target/linux/lantiq/dts/WBMR.dts @@ -5,7 +5,8 @@ #include / { - model = "WBMR - Buffalo WBMR-HP-G300H"; + compatible = "buffalo,wbmr-hp-g300h", "lantiq,xway", "lantiq,ar9"; + model = "Buffalo WBMR-HP-G300H"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/WBMR300.dts b/target/linux/lantiq/dts/WBMR300.dts index d89e8a19d..de2be582f 100644 --- a/target/linux/lantiq/dts/WBMR300.dts +++ b/target/linux/lantiq/dts/WBMR300.dts @@ -5,7 +5,8 @@ #include / { - model = "WBMR300 - Buffalo WBMR-300HPD"; + compatible = "buffalo,wbmr-300hpd", "lantiq,xway", "lantiq,vr9"; + model = "Buffalo WBMR-300HPD"; chosen { bootargs = "console=ttyLTQ0,115200"; diff --git a/target/linux/lantiq/dts/amazonse.dtsi b/target/linux/lantiq/dts/amazonse.dtsi index e88fc161b..e6925a3ad 100644 --- a/target/linux/lantiq/dts/amazonse.dtsi +++ b/target/linux/lantiq/dts/amazonse.dtsi @@ -104,6 +104,7 @@ "spi_frm"; #address-cells = <1>; #size-cells = <1>; + status = "disabled"; }; gptu@E100A00 { diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index f6795ee61..dcd0c710d 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -60,10 +60,9 @@ define Device/Default KERNEL := kernel-bin | append-dtb | lzma | uImage lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma FILESYSTEMS := squashfs - DEVICE_DTS := $(1) DEVICE_DTS_DIR := ../dts IMAGE_SIZE := - SUPPORTED_DEVICES = $$(DEVICE_DTS) + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) IMAGES := sysupgrade.bin IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef @@ -97,8 +96,8 @@ DEVICE_VARS += SIGNATURE MAGIC CRC32_POLY define Device/lantiqFullImage KERNEL := kernel-bin | append-dtb | lzma | uImage lzma | pad-offset 4 0 - IMAGES := sysupgrade.bin fullimage.img - IMAGE/fullimage.img := fullimage | check-size $$$$(IMAGE_SIZE) + IMAGES := sysupgrade.bin fullimage.bin + IMAGE/fullimage.bin := fullimage | check-size $$$$(IMAGE_SIZE) endef define Device/AVM @@ -109,7 +108,7 @@ endef ifeq ($(SUBTARGET),ase) -define Device/ALL0333CJ +define Device/allnet_all0333cj IMAGE_SIZE := 3700k DEVICE_DTS := ALL0333CJ DEVICE_TITLE := Allnet ALL0333CJ @@ -117,75 +116,86 @@ define Device/ALL0333CJ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe endef -TARGET_DEVICES += ALL0333CJ +TARGET_DEVICES += allnet_all0333cj -define Device/DGN1000B +define Device/netgear_dgn1000b IMAGE_SIZE := 6000k DEVICE_DTS := DGN1000B DEVICE_TITLE := Netgear DGN1000B DEVICE_PACKAGES := kmod-ltq-adsl-ase kmod-ltq-adsl-ase-mei \ kmod-ltq-adsl-ase-fw-b kmod-ltq-atm-ase \ ltq-adsl-app ppp-mod-pppoe + SUPPORTED_DEVICES += DGN1000B endef -TARGET_DEVICES += DGN1000B +TARGET_DEVICES += netgear_dgn1000b endif ifeq ($(SUBTARGET),xway_legacy) -define Device/ARV4520PW +define Device/arcadyan_arv4520pw IMAGE_SIZE := 3648k + DEVICE_DTS := ARV4520PW DEVICE_TITLE := Easybox 800, WAV-281 - ARV4520PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt61-pci wpad-mini + SUPPORTED_DEVICES += ARV4520PW endef -TARGET_DEVICES += ARV4520PW +TARGET_DEVICES += arcadyan_arv4520pw -define Device/ARV4525PW +define Device/arcadyan_arv4525pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4525PW DEVICE_TITLE := Speedport W502V Typ A - ARV4525PW DEVICE_PACKAGES := kmod-ath5k wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig + SUPPORTED_DEVICES += ARV4525PW endef -TARGET_DEVICES += ARV4525PW +TARGET_DEVICES += arcadyan_arv4525pw -define Device/ARV452CQW +define Device/arcadyan_arv452cqw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV452CQW DEVICE_TITLE := Easybox 801 - ARV452CQW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ath5k wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa + SUPPORTED_DEVICES += ARV452CQW endef -TARGET_DEVICES += ARV452CQW +TARGET_DEVICES += arcadyan_arv452cqw -define Device/ARV4518PWR01 +define Device/arcadyan_arv4518pwr01 IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4518PWR01 DEVICE_TITLE := ARV4518PWR01 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4518PWR01 endef -TARGET_DEVICES += ARV4518PWR01 +TARGET_DEVICES += arcadyan_arv4518pwr01 -define Device/ARV4518PWR01A +define Device/arcadyan_arv4518pwr01a IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4518PWR01A DEVICE_TITLE := ARV4518PWR01A DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4518PWR01A endef -TARGET_DEVICES += ARV4518PWR01A +TARGET_DEVICES += arcadyan_arv4518pwr01a endif @@ -193,8 +203,10 @@ ifeq ($(SUBTARGET),xway) # Danube -define Device/BTHOMEHUBV2B +define Device/bt_homehub-v2b $(Device/NAND) + BOARD_NAME := BTHOMEHUBV2B + DEVICE_DTS := BTHOMEHUBV2B DEVICE_TITLE := BT Home Hub 2B DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -202,17 +214,20 @@ define Device/BTHOMEHUBV2B kmod-ltq-deu-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += BTHOMEHUBV2B endef -TARGET_DEVICES += BTHOMEHUBV2B +TARGET_DEVICES += bt_homehub-v2b -define Device/EASY50712 +define Device/lantiq_easy50712 + DEVICE_DTS := EASY50712 IMAGE_SIZE := 3776k DEVICE_TITLE := Lantiq Danube - EASY50712 endef -TARGET_DEVICES += EASY50712 +TARGET_DEVICES += lantiq_easy50712 -define Device/ACMP252 +define Device/audiocodes_mp-252 IMAGE_SIZE := 14848k + DEVICE_DTS := ACMP252 DEVICE_TITLE := AudioCodes MediaPack MP-252 DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ @@ -221,11 +236,13 @@ define Device/ACMP252 kmod-rt2800-pci \ ltq-adsl-app ppp-mod-pppoa \ wpad-mini + SUPPORTED_DEVICES += ACMP252 endef -TARGET_DEVICES += ACMP252 +TARGET_DEVICES += audiocodes_mp-252 -define Device/ARV4510PW +define Device/arcadyan_arv4510pw IMAGE_SIZE := 15616k + DEVICE_DTS := ARV4510PW DEVICE_TITLE := Wippies, Elisa - ARV4510PW DEVICE_PACKAGES := kmod-usb-ledtrig-usbport kmod-usb2-pci kmod-usb-uhci \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -233,41 +250,49 @@ define Device/ARV4510PW ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci kmod-ath5k wpad-mini + SUPPORTED_DEVICES += ARV4510PW endef -TARGET_DEVICES += ARV4510PW +TARGET_DEVICES += arcadyan_arv4510pw -define Device/ARV7525PW +define Device/arcadyan_arv7525pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4510PW DEVICE_TITLE := Speedport W303V Typ A - ARV7525PW DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa -swconfig + SUPPORTED_DEVICES += ARV4510PW endef -TARGET_DEVICES += ARV7525PW +TARGET_DEVICES += arcadyan_arv7525pw -define Device/ARV4519PW +define Device/arcadyan_arv4519pw IMAGE_SIZE := 3776k + DEVICE_DTS := ARV4519PW DEVICE_TITLE := Vodafone, Pirelli - ARV4519PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa + SUPPORTED_DEVICES += ARV4519PW endef -TARGET_DEVICES += ARV4519PW +TARGET_DEVICES += arcadyan_arv4519pw -define Device/ARV7506PW11 +define Device/arcadyan_arv7506pw11 IMAGE_SIZE := 7808k + DEVICE_DTS := ARV7506PW11 DEVICE_TITLE := Alice/O2 IAD 4421 - ARV7506PW11 DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV7506PW11 endef -TARGET_DEVICES += ARV7506PW11 +TARGET_DEVICES += arcadyan_arv7506pw11 -define Device/ARV7510PW22 +define Device/arcadyan_arv7510pw22 IMAGE_SIZE := 31232k + DEVICE_DTS := ARV7510PW22 DEVICE_TITLE := Astoria - ARV7510PW22 DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -276,33 +301,39 @@ define Device/ARV7510PW22 kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini \ kmod-usb-uhci kmod-usb2 kmod-usb2-pci + SUPPORTED_DEVICES += ARV7510PW22 endef -TARGET_DEVICES += ARV7510PW22 +TARGET_DEVICES += arcadyan_arv7510pw22 -define Device/ARV7518PW +define Device/arcadyan_arv7518pw IMAGE_SIZE := 7872k + DEVICE_DTS := ARV7518PW DEVICE_TITLE := Astoria - ARV7518PW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += ARV7518PW endef -TARGET_DEVICES += ARV7518PW +TARGET_DEVICES += arcadyan_arv7518pw -define Device/ARV7519PW +define Device/arcadyan_arv7519pw IMAGE_SIZE := 15488k + DEVICE_DTS := ARV7519PW DEVICE_TITLE := Astoria - ARV7519PW DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV7519PW endef -TARGET_DEVICES += ARV7519PW +TARGET_DEVICES += arcadyan_arv7519pw -define Device/ARV752DPW +define Device/arcadyan_arv752dpw IMAGE_SIZE := 7872k + DEVICE_DTS := ARV752DPW DEVICE_TITLE := Easybox 802 - ARV752DPW DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -310,11 +341,13 @@ define Device/ARV752DPW ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV752DPW endef -TARGET_DEVICES += ARV752DPW +TARGET_DEVICES += arcadyan_arv752dpw -define Device/ARV752DPW22 +define Device/arcadyan_arv752dpw22 IMAGE_SIZE := 7616k + DEVICE_DTS := ARV752DPW22 DEVICE_TITLE := Easybox 803 - ARV752DPW22 DEVICE_PACKAGES := kmod-usb2-pci kmod-usb-uhci kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ @@ -322,36 +355,43 @@ define Device/ARV752DPW22 ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-tapi kmod-ltq-vmmc \ kmod-rt2800-pci wpad-mini + SUPPORTED_DEVICES += ARV752DPW22 endef -TARGET_DEVICES += ARV752DPW22 +TARGET_DEVICES += arcadyan_arv752dpw22 -define Device/ARV8539PW22 +define Device/arcadyan_arv8539pw22 IMAGE_SIZE := 7616k + DEVICE_DTS := ARV8539PW22 DEVICE_TITLE := Speedport W504V Typ A - ARV8539PW22 DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES += ARV8539PW22 endef -TARGET_DEVICES += ARV8539PW22 +TARGET_DEVICES += arcadyan_arv8539pw22 -define Device/GIGASX76X +define Device/siemens_gigaset-sx76x IMAGE_SIZE := 7680k + DEVICE_DTS := GIGASX76X DEVICE_TITLE := Gigaset sx76x DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \ ltq-adsl-app ppp-mod-pppoe \ kmod-ath5k wpad-mini + SUPPORTED_DEVICES += GIGASX76X endef -TARGET_DEVICES += GIGASX76X +TARGET_DEVICES += siemens_gigaset-sx76x # AR9 -define Device/BTHOMEHUBV3A +define Device/bt_homehub-v3a $(Device/NAND) + BOARD_NAME := BTHOMEHUBV3A + DEVICE_DTS := BTHOMEHUBV3A DEVICE_TITLE := BT Home Hub 3A DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ @@ -360,27 +400,29 @@ define Device/BTHOMEHUBV3A ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini \ uboot-envtools + SUPPORTED_DEVICES += BTHOMEHUBV3A endef -TARGET_DEVICES += BTHOMEHUBV3A +TARGET_DEVICES += bt_homehub-v3a DGN3500_KERNEL_OFFSET_HEX=0x50000 DGN3500_KERNEL_OFFSET_DEC=327680 -define Device/DGN3500 +define Device/netgear_dgn3500 + DEVICE_DTS := DGN3500 IMAGE_SIZE := 16000k IMAGES := \ - sysupgrade-NA.bin sysupgrade-WW.bin \ - factory-NA.img factory-WW.img - IMAGE/sysupgrade-NA.bin := \ + sysupgrade-na.bin sysupgrade.bin \ + factory-na.img factory.img + IMAGE/sysupgrade-na.bin := \ append-kernel | append-rootfs | dgn3500-sercom-footer 0x0 "NA" | \ pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/sysupgrade-WW.bin := \ + IMAGE/sysupgrade.bin := \ append-kernel | append-rootfs | dgn3500-sercom-footer 0x0 "WW" | \ pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory-NA.img := \ + IMAGE/factory-na.img := \ pad-extra $(DGN3500_KERNEL_OFFSET_DEC) | append-kernel | append-rootfs | \ dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "NA" | pad-rootfs | \ check-size 16320k | pad-to 16384k - IMAGE/factory-WW.img := \ + IMAGE/factory.img := \ pad-extra $(DGN3500_KERNEL_OFFSET_DEC) | append-kernel | append-rootfs | \ dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "WW" | pad-rootfs | \ check-size 16320k | pad-to 16384k @@ -391,10 +433,12 @@ define Device/DGN3500 kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 + SUPPORTED_DEVICES += DGN3500 endef -TARGET_DEVICES += DGN3500 +TARGET_DEVICES += netgear_dgn3500 -define Device/DGN3500B +define Device/netgear_dgn3500b + DEVICE_DTS := DGN3500B IMAGE_SIZE := 16000k IMAGES += factory.img IMAGE/sysupgrade.bin := \ @@ -411,10 +455,11 @@ define Device/DGN3500B kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 + SUPPORTED_DEVICES += DGN3500B endef -TARGET_DEVICES += DGN3500B +TARGET_DEVICES += netgear_dgn3500b -define Device/WBMRA +define Device/buffalo_wbmr-hp-g300h-a IMAGE_SIZE := 31488k DEVICE_DTS := WBMR DEVICE_TITLE := Buffalo WBMR-HP-G300H (A) - WBMR @@ -423,10 +468,11 @@ define Device/WBMRA kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef -TARGET_DEVICES += WBMRA +TARGET_DEVICES += buffalo_wbmr-hp-g300h-a -define Device/WBMRB +define Device/buffalo_wbmr-hp-g300h-b IMAGE_SIZE := 31488k DEVICE_DTS := WBMR DEVICE_TITLE := Buffalo WBMR-HP-G300H (B) - WBMR @@ -435,11 +481,13 @@ define Device/WBMRB kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-mini + SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h endef -TARGET_DEVICES += WBMRB +TARGET_DEVICES += buffalo_wbmr-hp-g300h-b -define Device/FRITZ7320 +define Device/avm_fritz7320 $(Device/AVM) + DEVICE_DTS := FRITZ7320 IMAGE_SIZE := 15744k DEVICE_TITLE := 1&1 HomeServer - FRITZ7320 DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini \ @@ -447,11 +495,13 @@ define Device/FRITZ7320 kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig + SUPPORTED_DEVICES += FRITZ7320 endef -TARGET_DEVICES += FRITZ7320 +TARGET_DEVICES += avm_fritz7320 -define Device/H201L +define Device/zte_h201l IMAGE_SIZE := 7808k + DEVICE_DTS := H201L DEVICE_TITLE := ZTE H201L - H201L DEVICE_PACKAGES := kmod-ath9k-htc wpad-mini \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ @@ -459,19 +509,22 @@ define Device/H201L ltq-adsl-app ppp-mod-pppoe \ kmod-ltq-deu-ar9 kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += H201L endef -TARGET_DEVICES += H201L +TARGET_DEVICES += zte_h201l -define Device/P2601HNFX +define Device/zyxel_p-2601hn IMAGE_SIZE := 15616k + DEVICE_DTS := P2601HNFX DEVICE_TITLE := ZyXEL P-2601HN-Fx DEVICE_PACKAGES := kmod-rt2800-usb wpad-mini \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ kmod-ltq-deu-ar9 kmod-usb-dwc2 + SUPPORTED_DEVICES += P2601HNFX endef -TARGET_DEVICES += P2601HNFX +TARGET_DEVICES += zyxel_p-2601hn endif @@ -481,42 +534,55 @@ ifeq ($(SUBTARGET),xrx200) # VR9 -define Device/P2812HNUF1 +define Device/zyxel_p-2812hnu-f1 $(Device/NAND) + BOARD_NAME := P2812HNUF1 + DEVICE_DTS := P2812HNUF1 DEVICE_TITLE := ZyXEL P-2812HNU-F1 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += P2812HNUF1 endef -TARGET_DEVICES += P2812HNUF1 +TARGET_DEVICES += zyxel_p-2812hnu-f1 -define Device/P2812HNUF3 +define Device/zyxel_p-2812hnu-f3 $(Device/NAND) + BOARD_NAME := P2812HNUF3 + DEVICE_DTS := P2812HNUF3 DEVICE_TITLE := ZyXEL P-2812HNU-F3 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += P2812HNUF3 endef -TARGET_DEVICES += P2812HNUF3 +TARGET_DEVICES += zyxel_p-2812hnu-f3 -define Device/ARV7519RW22 +define Device/arcadyan_arv7519rw22 IMAGE_SIZE := 31232k + DEVICE_DTS := ARV7519RW22 DEVICE_TITLE := Livebox Astoria ARV7519RW22 DEVICE_PACKAGES := kmod-usb-dwc2 + SUPPORTED_DEVICES += ARV7519RW22 endef -TARGET_DEVICES += ARV7519RW22 +TARGET_DEVICES += arcadyan_arv7519rw22 -define Device/ASL56026 +define Device/alphanetworks_asl56026 + DEVICE_DTS := ASL56026 IMAGE_SIZE := 7488k DEVICE_TITLE := BT OpenReach - ECI VDSL Modem V-2FUb/I endef -TARGET_DEVICES += ASL56026 +TARGET_DEVICES += alphanetworks_asl56026 -define Device/BTHOMEHUBV5A +define Device/bt_homehub-v5a $(Device/NAND) + BOARD_NAME := BTHOMEHUBV5A + DEVICE_DTS := BTHOMEHUBV5A DEVICE_TITLE := BT Home Hub 5A DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \ kmod-ath10k ath10k-firmware-qca988x wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += BTHOMEHUBV5A endef -TARGET_DEVICES += BTHOMEHUBV5A +TARGET_DEVICES += bt_homehub-v5a -define Device/DM200 +define Device/netgear_dm200 + DEVICE_DTS := DM200 IMAGES := sysupgrade.bin factory.img IMAGE/factory.img := $$(IMAGE/sysupgrade.bin) | netgear-dni IMAGE_SIZE := 7872k @@ -525,169 +591,200 @@ define Device/DM200 NETGEAR_HW_ID := 29765233+8+0+64+0+0 endef DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID -TARGET_DEVICES += DM200 +TARGET_DEVICES += netgear_dm200 -define Device/EASY80920NAND +define Device/lantiq_easy80920-nand $(Device/lantiqFullImage) + DEVICE_DTS := EASY80920NAND IMAGE_SIZE := 64512k DEVICE_TITLE := Lantiq VR9 - EASY80920NAND DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef -TARGET_DEVICES += EASY80920NAND +TARGET_DEVICES += lantiq_easy80920-nand -define Device/EASY80920NOR +define Device/lantiq_easy80920-nor + DEVICE_DTS := EASY80920NOR IMAGE_SIZE := 7936k DEVICE_TITLE := Lantiq VR9 - EASY80920NOR DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport endef -TARGET_DEVICES += EASY80920NOR +TARGET_DEVICES += lantiq_easy80920-nor -define Device/FRITZ3370 +define Device/avm_fritz3370 $(Device/AVM) $(Device/NAND) + BOARD_NAME := FRITZ3370 + DEVICE_DTS := FRITZ3370 DEVICE_TITLE := Fritz!Box WLan - FRITZ3370 DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += FRITZ3370 endef -TARGET_DEVICES += FRITZ3370 +TARGET_DEVICES += avm_fritz3370 -define Device/FRITZ7360SL +define Device/avm_fritz7360sl $(Device/AVM) IMAGE_SIZE := 15744k + DEVICE_DTS := FRITZ7360SL DEVICE_TITLE := 1&1 HomeServer - FRITZ7360SL DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += FRITZ7360SL endef -TARGET_DEVICES += FRITZ7360SL +TARGET_DEVICES += avm_fritz7360sl -define Device/VG3503J +define Device/arcadyan_vg3503j IMAGE_SIZE := 8000k + DEVICE_DTS := VG3503J DEVICE_TITLE := BT OpenReach - ECI VDSL Modem V-2FUb/R + SUPPORTED_DEVICES += VG3503J endef -TARGET_DEVICES += VG3503J +TARGET_DEVICES += arcadyan_vg3503j include tp-link.mk -define Device/WBMR300 +define Device/buffalo_wbmr-300hpd IMAGE_SIZE := 15616k + DEVICE_DTS := WBMR300 DEVICE_TITLE := Buffalo WBMR-300HPD DEVICE_PACKAGES := kmod-mt7603 wpad-mini kmod-usb-dwc2 + SUPPORTED_DEVICES += WBMR300 endef -TARGET_DEVICES += WBMR300 +TARGET_DEVICES += buffalo_wbmr-300hpd -define Device/VGV7510KW22NOR +define Device/arcadyan_vgv7510kw22-nor IMAGE_SIZE := 15232k + DEVICE_DTS := VGV7510KW22NOR DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (NOR) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7510KW22NOR endef -TARGET_DEVICES += VGV7510KW22NOR +TARGET_DEVICES += arcadyan_vgv7510kw22-nor -define Device/VGV7510KW22BRN +define Device/arcadyan_vgv7510kw22-brn $(Device/lantiqBrnImage) IMAGE_SIZE := 7168k + DEVICE_DTS := VGV7510KW22BRN SIGNATURE := BRNDA6431 MAGIC := 0x12345678 CRC32_POLY := 0x04c11db7 DEVICE_TITLE := o2 Box 6431 / Arcadyan VGV7510KW22 (BRN) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7510KW22BRN endef -TARGET_DEVICES += VGV7510KW22BRN +TARGET_DEVICES += arcadyan_vgv7510kw22-brn -define Device/VGV7519NOR +define Device/arcadyan_vgv7519-nor IMAGE_SIZE := 15360k + DEVICE_DTS := VGV7519NOR DEVICE_TITLE := Experiabox 8 VGV7519 DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7519NOR endef -TARGET_DEVICES += VGV7519NOR +TARGET_DEVICES += arcadyan_vgv7519-nor -define Device/VGV7519BRN +define Device/arcadyan_vgv7519-brn $(Device/lantiqBrnImage) IMAGE_SIZE := 7168k + DEVICE_DTS := VGV7519BRN SIGNATURE := 5D00008000 MAGIC := 0x12345678 CRC32_POLY := 0x2083b8ed DEVICE_TITLE := Experiabox 8 VGV7519 (BRN) DEVICE_PACKAGES := kmod-rt2800-pci wpad-mini kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc + SUPPORTED_DEVICES += VGV7519BRN endef -TARGET_DEVICES += VGV7519BRN +TARGET_DEVICES += arcadyan_vgv7519-brn endif ifeq ($(SUBTARGET),falcon) -define Device/EASY98000NOR +define Device/lantiq_easy98000-nor IMAGE_SIZE := 3904k + DEVICE_DTS := EASY98000NOR DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board NOR DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000NOR +TARGET_DEVICES += lantiq_easy98000-nor -define Device/EASY98000NAND +define Device/lantiq_easy98000-nand IMAGE_SIZE := 3904k + DEVICE_DTS := EASY98000NAND DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board NAND DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000NAND +TARGET_DEVICES += lantiq_easy98000-nand -define Device/EASY98000SFLASH +define Device/lantiq_easy98000-sflash IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98000SFLASH DEVICE_TITLE := EASY98000 - Lantiq Falcon Eval Board SFLASH DEVICE_PACKAGES := kmod-dm9000 kmod-i2c-lantiq kmod-eeprom-at24 endef -TARGET_DEVICES += EASY98000SFLASH +TARGET_DEVICES += lantiq_easy98000-sflash -define Device/FALCON-MDU +define Device/lantiq_falcon-mdu IMAGE_SIZE := 7424k + DEVICE_DTS := FALCON-MDU DEVICE_TITLE := MDU - Lantiq Falcon / VINAXdp MDU Board endef -TARGET_DEVICES += FALCON-MDU +TARGET_DEVICES += lantiq_falcon-mdu -define Device/EASY88388 +define Device/lantiq_easy88388 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY88388 DEVICE_TITLE := EASY88388 - Lantiq Falcon FTTDP8 Reference Board endef -TARGET_DEVICES += EASY88388 +TARGET_DEVICES += lantiq_easy88388 -define Device/EASY88444 +define Device/lantiq_easy88444 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY88444 DEVICE_TITLE := EASY88444 - Lantiq Falcon FTTdp G.FAST Reference Board endef -TARGET_DEVICES += EASY88444 +TARGET_DEVICES += lantiq_easy88444 -define Device/FALCON-SFP +define Device/lantiq_falcon-sfp IMAGE_SIZE := 7424k + DEVICE_DTS := FALCON-SFP DEVICE_TITLE := SFP - Lantiq Falcon SFP Stick endef -TARGET_DEVICES += FALCON-SFP +TARGET_DEVICES += lantiq_falcon-sfp -define Device/EASY98035SYNCE +define Device/lantiq_easy98035synce IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98035SYNCE DEVICE_TITLE := EASY98035SYNCE - Lantiq Falcon SFP Stick with Synchronous Ethernet endef -TARGET_DEVICES += EASY98035SYNCE +TARGET_DEVICES += lantiq_easy98035synce -define Device/EASY98035SYNCE1588 +define Device/lantiq_easy98035synce1588 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98035SYNCE1588 DEVICE_TITLE := EASY98035SYNCE1588 - Lantiq Falcon SFP Stick with SyncE and IEEE1588 endef -TARGET_DEVICES += EASY98035SYNCE1588 +TARGET_DEVICES += lantiq_easy98035synce1588 -define Device/EASY98020 +define Device/lantiq_easy98020 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98020 DEVICE_TITLE := EASY98020 - Lantiq Falcon SFU Reference Board endef -TARGET_DEVICES += EASY98020 +TARGET_DEVICES += lantiq_easy98020 -define Device/EASY98020V18 +define Device/lantiq_easy98020-v18 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98020V18 DEVICE_TITLE := EASY98020V18 - Lantiq Falcon SFU Reference Board V1.8 endef -TARGET_DEVICES += EASY98020V18 +TARGET_DEVICES += lantiq_easy98020-v18 -define Device/EASY98021 +define Device/lantiq_easy98021 IMAGE_SIZE := 7424k + DEVICE_DTS := EASY98021 DEVICE_TITLE := EASY98021 - Lantiq Falcon HGU Reference Board endef -TARGET_DEVICES += EASY98021 +TARGET_DEVICES += lantiq_easy98021 endif diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk index 976184175..561d390d8 100644 --- a/target/linux/lantiq/image/tp-link.mk +++ b/target/linux/lantiq/image/tp-link.mk @@ -1,6 +1,8 @@ -DEVICE_VARS += TPLINK_BOARD_ID +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION define Device/lantiqTpLink + TPLINK_HWREVADD := 0 + TPLINK_HVERSION := 2 KERNEL := kernel-bin | append-dtb | lzma KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \ tplink-v2-header -s -V "ver. 1.0" @@ -9,31 +11,42 @@ define Device/lantiqTpLink append-metadata | check-size $$$$(IMAGE_SIZE) endef -define Device/TDW8970 +define Device/tplink_tdw8970 $(Device/lantiqTpLink) - DEVICE_PROFILE := TDW8970 - TPLINK_BOARD_ID := TD-W8970v1 + DEVICE_DTS := TDW8970 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89700001 + TPLINK_HWREV := 1 IMAGE_SIZE := 7680k DEVICE_TITLE := TP-LINK TD-W8970 DEVICE_PACKAGES:= kmod-ath9k wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8970 endef +TARGET_DEVICES += tplink_tdw8970 -define Device/TDW8980 +define Device/tplink_tdw8980 $(Device/lantiqTpLink) - DEVICE_PROFILE := TDW8980 - TPLINK_BOARD_ID := TD-W8980v1 + DEVICE_DTS := TDW8980 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89800001 + TPLINK_HWREV := 14 IMAGE_SIZE := 7680k DEVICE_TITLE := TP-LINK TD-W8980 DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-mini kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8980 endef +TARGET_DEVICES += tplink_tdw8980 -define Device/VR200v +define Device/tplink_vr200v $(Device/lantiqTpLink) - DEVICE_PROFILE := VR200v + DEVICE_DTS := VR200v TPLINK_BOARD_ID := ArcherVR200V + TPLINK_FLASHLAYOUT := 16Mltq + TPLINK_HWID := 0x73b70801 + TPLINK_HWREV := 0x2f IMAGE_SIZE := 15808k DEVICE_TITLE := TP-LINK Archer VR200v DEVICE_PACKAGES:= kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += VR200v endef -TARGET_DEVICES += TDW8970 TDW8980 VR200v - +TARGET_DEVICES += tplink_vr200v diff --git a/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch b/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch index 4f3d46ce6..dc99f48ea 100644 --- a/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch +++ b/target/linux/lantiq/patches-4.9/0028-NET-lantiq-various-etop-fixes.patch @@ -203,28 +203,27 @@ Signed-off-by: John Crispin } static int -@@ -156,8 +224,10 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -156,7 +224,9 @@ ltq_etop_poll_rx(struct napi_struct *nap { struct ltq_etop_chan *ch = container_of(napi, struct ltq_etop_chan, napi); + struct ltq_etop_priv *priv = netdev_priv(ch->netdev); - int rx = 0; - int complete = 0; + int work_done = 0; + unsigned long flags; - while ((rx < budget) && !complete) { + while (work_done < budget) { struct ltq_dma_desc *desc = &ch->dma.desc_base[ch->dma.desc]; -@@ -171,7 +241,9 @@ ltq_etop_poll_rx(struct napi_struct *nap +@@ -168,7 +238,9 @@ ltq_etop_poll_rx(struct napi_struct *nap } - if (complete || !rx) { - napi_complete(&ch->napi); + if (work_done < budget) { + napi_complete_done(&ch->napi, work_done); + spin_lock_irqsave(&priv->lock, flags); ltq_dma_ack_irq(&ch->dma); + spin_unlock_irqrestore(&priv->lock, flags); } - return rx; + return work_done; } -@@ -183,12 +255,14 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -180,12 +252,14 @@ ltq_etop_poll_tx(struct napi_struct *nap container_of(napi, struct ltq_etop_chan, napi); struct ltq_etop_priv *priv = netdev_priv(ch->netdev); struct netdev_queue *txq = @@ -240,7 +239,7 @@ Signed-off-by: John Crispin dev_kfree_skb_any(ch->skb[ch->tx_free]); ch->skb[ch->tx_free] = NULL; memset(&ch->dma.desc_base[ch->tx_free], 0, -@@ -201,7 +275,9 @@ ltq_etop_poll_tx(struct napi_struct *nap +@@ -198,7 +272,9 @@ ltq_etop_poll_tx(struct napi_struct *nap if (netif_tx_queue_stopped(txq)) netif_tx_start_queue(txq); napi_complete(&ch->napi); @@ -250,7 +249,7 @@ Signed-off-by: John Crispin return 1; } -@@ -209,9 +285,10 @@ static irqreturn_t +@@ -206,9 +282,10 @@ static irqreturn_t ltq_etop_dma_irq(int irq, void *_priv) { struct ltq_etop_priv *priv = _priv; @@ -264,7 +263,7 @@ Signed-off-by: John Crispin return IRQ_HANDLED; } -@@ -223,7 +300,7 @@ ltq_etop_free_channel(struct net_device +@@ -220,7 +297,7 @@ ltq_etop_free_channel(struct net_device ltq_dma_free(&ch->dma); if (ch->dma.irq) free_irq(ch->dma.irq, priv); @@ -273,7 +272,7 @@ Signed-off-by: John Crispin int desc; for (desc = 0; desc < LTQ_DESC_NUM; desc++) dev_kfree_skb_any(ch->skb[ch->dma.desc]); -@@ -234,65 +311,133 @@ static void +@@ -231,65 +308,133 @@ static void ltq_etop_hw_exit(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -329,11 +328,10 @@ Signed-off-by: John Crispin struct ltq_etop_priv *priv = netdev_priv(dev); - int i; + int mii_mode = priv->mii_mode; - -- ltq_pmu_enable(PMU_PPE); ++ + clk_enable(priv->clk_ppe); -- switch (priv->pldata->mii_mode) { +- ltq_pmu_enable(PMU_PPE); + if (of_machine_is_compatible("lantiq,ar9")) { + ltq_etop_gbit_init(dev); + /* force the etops link to the gbit to MII */ @@ -342,7 +340,8 @@ Signed-off-by: John Crispin + ltq_etop_w32_mask(MDIO_CFG_MASK, 0, LTQ_ETOP_MDIO_CFG); + ltq_etop_w32_mask(MAC_CFG_MASK, MAC_CFG_CGEN | MAC_CFG_DUPLEX | + MAC_CFG_SPEED | MAC_CFG_LINK, LTQ_ETOP_MAC_CFG); -+ + +- switch (priv->pldata->mii_mode) { + switch (mii_mode) { case PHY_INTERFACE_MODE_RMII: - ltq_etop_w32_mask(ETOP_MII_MASK, @@ -441,7 +440,7 @@ Signed-off-by: John Crispin } static void -@@ -306,7 +451,10 @@ ltq_etop_get_drvinfo(struct net_device * +@@ -303,7 +448,10 @@ ltq_etop_get_drvinfo(struct net_device * static int ltq_etop_nway_reset(struct net_device *dev) { @@ -453,7 +452,7 @@ Signed-off-by: John Crispin } static const struct ethtool_ops ltq_etop_ethtool_ops = { -@@ -317,6 +465,39 @@ static const struct ethtool_ops ltq_etop +@@ -314,6 +462,39 @@ static const struct ethtool_ops ltq_etop }; static int @@ -493,7 +492,7 @@ Signed-off-by: John Crispin ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data) { u32 val = MDIO_REQUEST | -@@ -324,9 +505,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in +@@ -321,9 +502,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) | phy_data; @@ -505,7 +504,7 @@ Signed-off-by: John Crispin return 0; } -@@ -337,12 +518,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in +@@ -334,12 +515,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in ((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) | ((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET); @@ -522,7 +521,7 @@ Signed-off-by: John Crispin return val; } -@@ -357,8 +538,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -354,8 +535,18 @@ ltq_etop_mdio_probe(struct net_device *d { struct ltq_etop_priv *priv = netdev_priv(dev); struct phy_device *phydev; @@ -542,7 +541,7 @@ Signed-off-by: John Crispin if (!phydev) { netdev_err(dev, "no PHY found\n"); -@@ -366,21 +557,18 @@ ltq_etop_mdio_probe(struct net_device *d +@@ -363,21 +554,18 @@ ltq_etop_mdio_probe(struct net_device *d } phydev = phy_connect(dev, phydev_name(phydev), @@ -569,7 +568,7 @@ Signed-off-by: John Crispin phydev->advertising = phydev->supported; phy_attached_info(phydev); -@@ -401,8 +589,13 @@ ltq_etop_mdio_init(struct net_device *de +@@ -398,8 +586,13 @@ ltq_etop_mdio_init(struct net_device *de } priv->mii_bus->priv = dev; @@ -585,7 +584,7 @@ Signed-off-by: John Crispin priv->mii_bus->name = "ltq_mii"; snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x", priv->pdev->name, priv->pdev->id); -@@ -439,17 +632,19 @@ static int +@@ -436,17 +629,19 @@ static int ltq_etop_open(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -614,7 +613,7 @@ Signed-off-by: John Crispin netif_tx_start_all_queues(dev); return 0; } -@@ -458,18 +653,19 @@ static int +@@ -455,18 +650,19 @@ static int ltq_etop_stop(struct net_device *dev) { struct ltq_etop_priv *priv = netdev_priv(dev); @@ -644,7 +643,7 @@ Signed-off-by: John Crispin return 0; } -@@ -479,16 +675,16 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -476,16 +672,16 @@ ltq_etop_tx(struct sk_buff *skb, struct int queue = skb_get_queue_mapping(skb); struct netdev_queue *txq = netdev_get_tx_queue(dev, queue); struct ltq_etop_priv *priv = netdev_priv(dev); @@ -666,7 +665,7 @@ Signed-off-by: John Crispin netdev_err(dev, "tx ring full\n"); netif_tx_stop_queue(txq); return NETDEV_TX_BUSY; -@@ -496,7 +692,7 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -493,7 +689,7 @@ ltq_etop_tx(struct sk_buff *skb, struct /* dma needs to start on a 16 byte aligned address */ byte_offset = CPHYSADDR(skb->data) % 16; @@ -675,7 +674,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); -@@ -506,11 +702,11 @@ ltq_etop_tx(struct sk_buff *skb, struct +@@ -503,11 +699,11 @@ ltq_etop_tx(struct sk_buff *skb, struct wmb(); desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK); @@ -690,7 +689,7 @@ Signed-off-by: John Crispin netif_tx_stop_queue(txq); return NETDEV_TX_OK; -@@ -525,8 +721,10 @@ ltq_etop_change_mtu(struct net_device *d +@@ -522,8 +718,10 @@ ltq_etop_change_mtu(struct net_device *d struct ltq_etop_priv *priv = netdev_priv(dev); unsigned long flags; @@ -702,7 +701,7 @@ Signed-off-by: John Crispin LTQ_ETOP_IGPLEN); spin_unlock_irqrestore(&priv->lock, flags); } -@@ -595,6 +793,9 @@ ltq_etop_init(struct net_device *dev) +@@ -592,6 +790,9 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; ltq_etop_change_mtu(dev, 1500); @@ -712,7 +711,7 @@ Signed-off-by: John Crispin memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr)); if (!is_valid_ether_addr(mac.sa_data)) { -@@ -612,9 +813,10 @@ ltq_etop_init(struct net_device *dev) +@@ -609,9 +810,10 @@ ltq_etop_init(struct net_device *dev) dev->addr_assign_type = NET_ADDR_RANDOM; ltq_etop_set_multicast_list(dev); @@ -726,7 +725,7 @@ Signed-off-by: John Crispin return 0; err_netdev: -@@ -634,6 +836,9 @@ ltq_etop_tx_timeout(struct net_device *d +@@ -631,6 +833,9 @@ ltq_etop_tx_timeout(struct net_device *d err = ltq_etop_hw_init(dev); if (err) goto err_hw; @@ -736,7 +735,7 @@ Signed-off-by: John Crispin netif_trans_update(dev); netif_wake_queue(dev); return; -@@ -657,14 +862,19 @@ static const struct net_device_ops ltq_e +@@ -654,14 +859,19 @@ static const struct net_device_ops ltq_e .ndo_tx_timeout = ltq_etop_tx_timeout, }; @@ -760,7 +759,7 @@ Signed-off-by: John Crispin res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { -@@ -690,31 +900,62 @@ ltq_etop_probe(struct platform_device *p +@@ -687,31 +897,62 @@ ltq_etop_probe(struct platform_device *p goto err_out; } @@ -838,7 +837,7 @@ Signed-off-by: John Crispin err = register_netdev(dev); if (err) -@@ -743,31 +984,22 @@ ltq_etop_remove(struct platform_device * +@@ -740,31 +981,22 @@ ltq_etop_remove(struct platform_device * return 0; } diff --git a/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch index cef4c1e2a..a5ecd94c4 100644 --- a/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch +++ b/target/linux/lantiq/patches-4.9/0035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch @@ -204,7 +204,7 @@ Signed-off-by: John Crispin +early_param("ethaddr", setup_ethaddr); --- a/drivers/net/ethernet/lantiq_etop.c +++ b/drivers/net/ethernet/lantiq_etop.c -@@ -797,7 +797,11 @@ ltq_etop_init(struct net_device *dev) +@@ -794,7 +794,11 @@ ltq_etop_init(struct net_device *dev) if (err) goto err_hw; diff --git a/target/linux/lantiq/xrx200/config-default b/target/linux/lantiq/xrx200/config-default index c307dc802..73ccaf34a 100644 --- a/target/linux/lantiq/xrx200/config-default +++ b/target/linux/lantiq/xrx200/config-default @@ -1,21 +1,27 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y CONFIG_AT803X_PHY=y +CONFIG_BLK_MQ_PCI=y CONFIG_CPU_MIPSR2_IRQ_EI=y CONFIG_CPU_MIPSR2_IRQ_VI=y CONFIG_CPU_RMAP=y CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_HWMON=y CONFIG_ICPLUS_PHY=y +CONFIG_IFX_VPE_EXT=y CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y CONFIG_INPUT_POLLDEV=y CONFIG_INTEL_XWAY_PHY=y # CONFIG_ISDN is not set -CONFIG_LANTIQ_PHY=y CONFIG_LANTIQ_XRX200=y CONFIG_LEDS_TRIGGER_HEARTBEAT=y CONFIG_LZO_COMPRESS=y @@ -24,6 +30,11 @@ CONFIG_MIPS_MT=y # CONFIG_MIPS_MT_FPAFF is not set CONFIG_MIPS_MT_SMP=y CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +CONFIG_MIPS_VPE_APSP_API=y +CONFIG_MIPS_VPE_APSP_API_MT=y +CONFIG_MIPS_VPE_LOADER=y +CONFIG_MIPS_VPE_LOADER_MT=y +CONFIG_MIPS_VPE_LOADER_TOM=y CONFIG_MTD_NAND=y CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_PLATFORM=y @@ -38,7 +49,14 @@ CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NET_FLOW_LIMIT=y CONFIG_NLS=y CONFIG_NR_CPUS=2 +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +CONFIG_PCI=y CONFIG_PCIE_LANTIQ=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO=y CONFIG_POWER_SUPPLY=y @@ -70,9 +88,3 @@ CONFIG_XPS=y CONFIG_XRX200_PHY_FW=y CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y -CONFIG_MIPS_VPE_LOADER=y -CONFIG_MIPS_VPE_LOADER_TOM=y -CONFIG_MIPS_VPE_APSP_API=y -CONFIG_IFX_VPE_EXT=y -CONFIG_PERFCTRS=n -# CONFIG_MTSCHED is not set diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index 9600f04fd..fc8115e79 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xrx200 BOARDNAME:=XRX200 -FEATURES:=squashfs atm nand ubifs +FEATURES:=squashfs atm nand CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio \ diff --git a/target/linux/lantiq/xway/config-default b/target/linux/lantiq/xway/config-default index bddf02763..79064ccc0 100644 --- a/target/linux/lantiq/xway/config-default +++ b/target/linux/lantiq/xway/config-default @@ -1,36 +1,15 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y -# CONFIG_ARCH_HAS_SG_CHAIN is not set -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y -CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y CONFIG_FIRMWARE_IN_KERNEL=y -CONFIG_GPIO_DEVRES=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_DEBUG_STACKOVERFLOW=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HZ_PERIODIC=y CONFIG_INPUT=y CONFIG_INPUT_EVDEV=y CONFIG_INPUT_POLLDEV=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_WORK=y # CONFIG_ISDN is not set CONFIG_LEDS_TRIGGER_HEARTBEAT=y -CONFIG_LIBFDT=y CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y CONFIG_MTD_NAND=y @@ -38,7 +17,6 @@ CONFIG_MTD_NAND_ECC=y CONFIG_MTD_NAND_PLATFORM=y CONFIG_MTD_NAND_XWAY=y # CONFIG_MTD_PHYSMAP_OF is not set -CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y @@ -46,17 +24,17 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_NLS=y -# CONFIG_NO_IOPORT_MAP is not set CONFIG_OF_ADDRESS_PCI=y -# CONFIG_RCU_STALL_COMMON is not set +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +# CONFIG_PCIE_LANTIQ is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_RTL8306_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8367B_PHY=y CONFIG_RTL8367_PHY=y -CONFIG_SPI=y -CONFIG_SPI_LANTIQ=y -CONFIG_SPI_MASTER=y -CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_UBIFS_FS=y CONFIG_UBIFS_FS_ADVANCED_COMPR=y CONFIG_UBIFS_FS_LZO=y @@ -66,6 +44,5 @@ CONFIG_USB_COMMON=y # CONFIG_USB_EHCI_HCD is not set CONFIG_USB_SUPPORT=y # CONFIG_USB_UHCI_HCD is not set -# CONFIG_XRX200_PHY_FW is not set CONFIG_ZLIB_DEFLATE=y CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/lantiq/xway/target.mk b/target/linux/lantiq/xway/target.mk index 429be761c..550c61edf 100644 --- a/target/linux/lantiq/xway/target.mk +++ b/target/linux/lantiq/xway/target.mk @@ -1,7 +1,7 @@ ARCH:=mips SUBTARGET:=xway BOARDNAME:=XWAY -FEATURES:=squashfs atm nand ubifs ramdisk +FEATURES:=squashfs atm nand ramdisk CPU_TYPE:=24kc DEFAULT_PACKAGES+=kmod-leds-gpio kmod-gpio-button-hotplug swconfig diff --git a/target/linux/lantiq/xway_legacy/config-default b/target/linux/lantiq/xway_legacy/config-default index b838106dd..c8aa63178 100644 --- a/target/linux/lantiq/xway_legacy/config-default +++ b/target/linux/lantiq/xway_legacy/config-default @@ -1,5 +1,6 @@ CONFIG_ADM6996_PHY=y CONFIG_AR8216_PHY=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y @@ -16,6 +17,13 @@ CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y # CONFIG_MTD_PHYSMAP_OF is not set CONFIG_NLS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PCI=y +# CONFIG_PCIE_LANTIQ is not set +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y CONFIG_RTL8306_PHY=y CONFIG_RTL8366S_PHY=y CONFIG_RTL8367B_PHY=y diff --git a/target/linux/layerscape/Makefile b/target/linux/layerscape/Makefile index 67da8449a..bd91556ef 100644 --- a/target/linux/layerscape/Makefile +++ b/target/linux/layerscape/Makefile @@ -10,7 +10,7 @@ BOARD:=layerscape BOARDNAME:=NXP Layerscape DEVICE_TYPE:=developerboard KERNEL_PATCHVER:=4.9 -FEATURES:=squashfs nand usb pcie gpio +FEATURES:=squashfs nand usb pcie gpio fpu SUBTARGETS:=armv8_64b armv8_32b MAINTAINER:=Yangbo Lu diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 9e0c8e032..546e589be 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -702,7 +702,6 @@ CONFIG_JBD2=y CONFIG_JUMP_LABEL=y CONFIG_KALLSYMS=y CONFIG_KALLSYMS_ALL=y -# CONFIG_KASAN is not set CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile index 34818f17b..c2b50f55b 100644 --- a/target/linux/malta/Makefile +++ b/target/linux/malta/Makefile @@ -14,7 +14,7 @@ INITRAMFS_EXTRA_FILES:= MAINTAINER:=Florian Fainelli FEATURES:=ramdisk -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/malta/README b/target/linux/malta/README index c34afe110..e48665909 100644 --- a/target/linux/malta/README +++ b/target/linux/malta/README @@ -4,10 +4,16 @@ troubleshoot MIPS applications without access to real hardware. To use the images built by OpenWrt with qemu, use the following commands: -For the little-endian image: +For the 32 bit little-endian image: qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256 -For the big-endian image: +For the 32 bit big-endian image: qemu-system-mips -kernel bin/targets/malta/be/lede-malta-be-vmlinux-initramfs.elf -nographic -m 256 +For the 64 bit little-endian image: +qemu-system-mips64el -kernel bin/targets/malta/le64/lede-malta-le64-vmlinux-initramfs.elf -nographic -m 256 + +For the 64 bit big-endian image: +qemu-system-mips64 -kernel bin/targets/malta/be64/lede-malta-be64-vmlinux-initramfs.elf -nographic -m 256 + and enjoy the system bootin. diff --git a/target/linux/malta/be/config-default b/target/linux/malta/be/config-default index 2772ed75b..f51301a05 100644 --- a/target/linux/malta/be/config-default +++ b/target/linux/malta/be/config-default @@ -1,9 +1,3 @@ CONFIG_CPU_BIG_ENDIAN=y # CONFIG_CPU_LITTLE_ENDIAN is not set -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set diff --git a/target/linux/malta/be64/config-default b/target/linux/malta/be64/config-default index 374e29a56..2c0c9d2db 100644 --- a/target/linux/malta/be64/config-default +++ b/target/linux/malta/be64/config-default @@ -1,6 +1,7 @@ # CONFIG_32BIT is not set CONFIG_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y CONFIG_BINFMT_ELF32=y @@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y CONFIG_COMPAT=y CONFIG_COMPAT_NETLINK_MESSAGES=y CONFIG_CPU_BIG_ENDIAN=y -# CONFIG_LIQUIDIO is not set # CONFIG_CPU_LITTLE_ENDIAN is not set -# CONFIG_CPU_MIPS32_R1 is not set -# CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPS64=y CONFIG_CPU_MIPS64_R1=y -# CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR1=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HUGEPAGES=y CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y @@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_MIPS32_COMPAT=y CONFIG_MIPS32_N32=y CONFIG_MIPS32_O32=y +# CONFIG_MIPS_VA_BITS_48 is not set CONFIG_MODULES_USE_ELF_RELA=y CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set CONFIG_ZONE_DMA32=y diff --git a/target/linux/malta/config-4.4 b/target/linux/malta/config-4.9 similarity index 90% rename from target/linux/malta/config-4.4 rename to target/linux/malta/config-4.9 index d027c9db9..0e9daf6e0 100644 --- a/target/linux/malta/config-4.4 +++ b/target/linux/malta/config-4.9 @@ -1,7 +1,6 @@ CONFIG_ARCH_BINFMT_ELF_STATE=y CONFIG_ARCH_CLOCKSOURCE_DATA=y CONFIG_ARCH_DISCARD_MEMBLOCK=y -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y # CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set # CONFIG_ARCH_HAS_SG_CHAIN is not set @@ -10,7 +9,6 @@ CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_ATA=y CONFIG_ATA_PIIX=y @@ -23,11 +21,11 @@ CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=4096 CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y CONFIG_BOARD_SCACHE=y CONFIG_BOOT_ELF32=y CONFIG_BOUNCE=y CONFIG_BUILTIN_DTB=y -CONFIG_CC_OPTIMIZE_FOR_SIZE=y CONFIG_CEVT_R4K=y CONFIG_CLKBLD_I8253=y CONFIG_CLKDEV_LOOKUP=y @@ -41,12 +39,18 @@ CONFIG_COMMON_CLK=y CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_CPU_GENERIC_DUMP_TLB=y CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y # CONFIG_CPU_HAS_SMARTMIPS is not set CONFIG_CPU_HAS_SYNC=y # CONFIG_CPU_MICROMIPS is not set +CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_3_5_FEATURES is not set +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set # CONFIG_CPU_MIPS32_R5_FEATURES is not set # CONFIG_CPU_MIPS32_R6 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set # CONFIG_CPU_MIPS64_R6 is not set CONFIG_CPU_MIPSR2=y CONFIG_CPU_MIPSR2_IRQ_EI=y @@ -57,16 +61,21 @@ CONFIG_CPU_R4K_CACHE_TLB=y CONFIG_CPU_R4K_FPU=y # CONFIG_CPU_RM7000 is not set CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CPU_SUPPORTS_MSA=y CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y CONFIG_CRYPTO_CRC32C=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y -# CONFIG_DEBUG_FS is not set CONFIG_DMA_MAYBE_COHERENT=y CONFIG_DMA_NONCOHERENT=y CONFIG_DNOTIFY=y @@ -82,6 +91,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CMOS_UPDATE=y CONFIG_GENERIC_IO=y CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_IPI=y CONFIG_GENERIC_IRQ_SHOW=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_PCI_IOMAP=y @@ -89,17 +99,19 @@ CONFIG_GENERIC_SCHED_CLOCK=y CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y +CONFIG_HANDLE_DOMAIN_IRQ=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set # CONFIG_HAVE_ARCH_BITREVERSE is not set CONFIG_HAVE_ARCH_JUMP_LABEL=y CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CBPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CLK=y CONFIG_HAVE_CLK_PREPARE=y @@ -108,7 +120,6 @@ CONFIG_HAVE_C_RECORDMCOUNT=y CONFIG_HAVE_DEBUG_KMEMLEAK=y CONFIG_HAVE_DEBUG_STACKOVERFLOW=y CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y CONFIG_HAVE_DMA_CONTIGUOUS=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y @@ -116,13 +127,8 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KERNEL_BZIP2=y -CONFIG_HAVE_KERNEL_GZIP=y -CONFIG_HAVE_KERNEL_LZ4=y -CONFIG_HAVE_KERNEL_LZMA=y -CONFIG_HAVE_KERNEL_LZO=y -CONFIG_HAVE_KERNEL_XZ=y CONFIG_HAVE_KVM=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y @@ -132,6 +138,7 @@ CONFIG_HAVE_NET_DSA=y CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PCSPKR_PLATFORM=y CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y CONFIG_HW_CONSOLE=y @@ -148,6 +155,7 @@ CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 # CONFIG_IP_MROUTE is not set CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y @@ -155,7 +163,6 @@ CONFIG_ISA_DMA_API=y CONFIG_JBD2=y CONFIG_JFFS2_FS_POSIX_ACL=y CONFIG_JFFS2_FS_SECURITY=y -# CONFIG_JFFS2_SUMMARY is not set CONFIG_KALLSYMS=y CONFIG_KERNEL_GZIP=y # CONFIG_KERNEL_XZ is not set @@ -165,6 +172,8 @@ CONFIG_LEGACY_PTY_COUNT=256 CONFIG_LIBFDT=y CONFIG_MD=y CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_BONITO64=y CONFIG_MIPS_CLOCK_VSYSCALL=y CONFIG_MIPS_CM=y @@ -177,7 +186,6 @@ CONFIG_MIPS_CPU_SCACHE=y # CONFIG_MIPS_ELF_APPENDED_DTB is not set CONFIG_MIPS_EXTERNAL_TIMER=y CONFIG_MIPS_GIC=y -CONFIG_MIPS_GIC_IPI=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=6 CONFIG_MIPS_L1_CACHE_SHIFT_6=y @@ -193,7 +201,6 @@ CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y # CONFIG_MIPS_RAW_APPENDED_DTB is not set CONFIG_MIPS_SPRAM=y # CONFIG_MIPS_VPE_LOADER is not set -# CONFIG_MIPS_ZBOOT_APPENDED_DTB is not set CONFIG_MODULES_TREE_LOOKUP=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MODULE_FORCE_UNLOAD=y @@ -214,13 +221,14 @@ CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_IRQ=y -CONFIG_OF_MTD=y CONFIG_OF_NET=y CONFIG_OF_PCI=y CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y # CONFIG_PARTITION_ADVANCED is not set CONFIG_PCI=y CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PCI_GT64XXX_PCI0=y CONFIG_PCSPKR_PLATFORM=y CONFIG_PERF_EVENTS=y @@ -240,6 +248,7 @@ CONFIG_RELAY=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y CONFIG_SECCOMP=y @@ -249,11 +258,10 @@ CONFIG_SERIAL_8250_NR_UARTS=4 CONFIG_SERIAL_8250_RUNTIME_UARTS=4 CONFIG_SERIO=y CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_UP=y CONFIG_SRCU=y -# CONFIG_STAGING is not set -# CONFIG_SUNXI_SRAM is not set CONFIG_SWAP_IO_SPACE=y CONFIG_SYNC_R4K=y CONFIG_SYSCTL_EXCEPTION_TRACE=y @@ -280,11 +288,11 @@ CONFIG_SYS_SUPPORTS_MIPS16=y CONFIG_SYS_SUPPORTS_MIPS_CMP=y CONFIG_SYS_SUPPORTS_MIPS_CPS=y CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y CONFIG_SYS_SUPPORTS_SCHED_SMT=y CONFIG_SYS_SUPPORTS_SMARTMIPS=y CONFIG_SYS_SUPPORTS_SMP=y CONFIG_SYS_SUPPORTS_ZBOOT=y -# CONFIG_TCP_CONG_ADVANCED is not set CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TREE_RCU=y CONFIG_USB_SUPPORT=y @@ -296,5 +304,4 @@ CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_VT_HW_CONSOLE_BINDING=y CONFIG_VXFS_FS=y -# CONFIG_WATCHDOG is not set CONFIG_XPS=y diff --git a/target/linux/malta/image/Makefile b/target/linux/malta/image/Makefile index 31eb7ca0b..d49d4a762 100644 --- a/target/linux/malta/image/Makefile +++ b/target/linux/malta/image/Makefile @@ -22,7 +22,6 @@ define MkuImage endef define Image/Prepare - cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf $(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma) $(call MkuImage,lzma,,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma) $(call CompressGzip,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.gz) @@ -30,6 +29,7 @@ define Image/Prepare endef define Image/BuildKernel + cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-vmlinux.elf cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(IMG_PREFIX)-uImage-lzma cp $(KDIR)/uImage.gz $(BIN_DIR)/$(IMG_PREFIX)-uImage-gzip endef diff --git a/target/linux/malta/le/config-default b/target/linux/malta/le/config-default index b5634c675..aab569be3 100644 --- a/target/linux/malta/le/config-default +++ b/target/linux/malta/le/config-default @@ -1,9 +1,3 @@ # CONFIG_CPU_BIG_ENDIAN is not set CONFIG_CPU_LITTLE_ENDIAN=y -CONFIG_CPU_MIPS32=y -# CONFIG_CPU_MIPS32_R1 is not set CONFIG_CPU_MIPS32_R2=y -# CONFIG_CPU_MIPS64_R1 is not set -# CONFIG_CPU_MIPS64_R2 is not set -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set diff --git a/target/linux/malta/le64/config-default b/target/linux/malta/le64/config-default index 725c3e490..28954537a 100644 --- a/target/linux/malta/le64/config-default +++ b/target/linux/malta/le64/config-default @@ -1,6 +1,7 @@ # CONFIG_32BIT is not set CONFIG_64BIT=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y CONFIG_BINFMT_ELF32=y @@ -8,15 +9,10 @@ CONFIG_BLOCK_COMPAT=y CONFIG_COMPAT=y CONFIG_COMPAT_NETLINK_MESSAGES=y # CONFIG_CPU_BIG_ENDIAN is not set -# CONFIG_LIQUIDIO is not set CONFIG_CPU_LITTLE_ENDIAN=y -# CONFIG_CPU_MIPS32_R1 is not set -# CONFIG_CPU_MIPS32_R2 is not set CONFIG_CPU_MIPS64=y CONFIG_CPU_MIPS64_R1=y -# CONFIG_CPU_MIPS64_R2 is not set CONFIG_CPU_MIPSR1=y -CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HUGEPAGES=y CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y @@ -25,13 +21,11 @@ CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y CONFIG_MIPS32_COMPAT=y CONFIG_MIPS32_N32=y CONFIG_MIPS32_O32=y +# CONFIG_MIPS_VA_BITS_48 is not set CONFIG_MODULES_USE_ELF_RELA=y CONFIG_PCI_BUS_ADDR_T_64BIT=y CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_SYS_SUPPORTS_HUGETLBFS=y -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_VF is not set CONFIG_ZONE_DMA32=y diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile index 8428bec6b..b181e67c0 100644 --- a/target/linux/mpc85xx/Makefile +++ b/target/linux/mpc85xx/Makefile @@ -16,17 +16,10 @@ SUBTARGETS:=generic p1020 KERNEL_PATCHVER:=4.9 -define Target/Description - Build images for the Freescale MPC85xx based boards. -endef +KERNELNAME:=zImage include $(INCLUDE_DIR)/target.mk -KERNEL_IMAGES := zImage -ifeq ($(SUBTARGET),generic) -KERNEL_IMAGES += cuImage.tl-wdr4900-v1 -endif - DEFAULT_PACKAGES += \ kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \ kmod-leds-gpio swconfig kmod-ath9k wpad-mini diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network index 511b56b1c..19f01a658 100755 --- a/target/linux/mpc85xx/base-files/etc/board.d/02_network +++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network @@ -10,7 +10,10 @@ board_config_update board=$(board_name) case "$board" in -tl-wdr4900-v1) +aerohive,hiveap-330) + ucidef_set_interfaces_lan_wan "eth1" "eth0" + ;; +tplink,tl-wdr4900-v1) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" ucidef_set_interface_macaddr "wan" "$(mtd_get_mac_binary config 332)" diff --git a/target/linux/mpc85xx/base-files/etc/diag.sh b/target/linux/mpc85xx/base-files/etc/diag.sh index b269427a5..3d56d14b0 100644 --- a/target/linux/mpc85xx/base-files/etc/diag.sh +++ b/target/linux/mpc85xx/base-files/etc/diag.sh @@ -5,11 +5,14 @@ . /lib/functions/leds.sh get_status_led() { - case $(board_name) in - tl-wdr4900-v1) - status_led="tp-link:blue:system" - ;; - esac + case $(board_name) in + aerohive,hiveap-330) + status_led="hiveap-330:green:tricolor0" + ;; + tplink,tl-wdr4900-v1) + status_led="tp-link:blue:system" + ;; + esac } set_state() { diff --git a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 4b5b7a30b..3e6488b4c 100644 --- a/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/mpc85xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -42,7 +42,7 @@ board=$(board_name) case "$FIRMWARE" in "pci_wmac0.eeprom") case $board in - tl-wdr4900-v1) + tplink,tl-wdr4900-v1) ath9k_eeprom_extract "caldata" 4096 2048 tpl_set_wireless_mac 0 ;; @@ -54,7 +54,7 @@ case "$FIRMWARE" in "pci_wmac1.eeprom") case $board in - tl-wdr4900-v1) + tplink,tl-wdr4900-v1) ath9k_eeprom_extract "caldata" 20480 2048 tpl_set_wireless_mac -1 ;; diff --git a/target/linux/mpc85xx/base-files/lib/mpc85xx.sh b/target/linux/mpc85xx/base-files/lib/mpc85xx.sh deleted file mode 100755 index 1a2a671e2..000000000 --- a/target/linux/mpc85xx/base-files/lib/mpc85xx.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2013 OpenWrt.org -# - -MPC85XX_BOARD_NAME= -MPC85XX_MODEL= - -mpc85xx_board_detect() { - local model - local name - - model=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /model/ {print $2}' /proc/cpuinfo) - - case "$model" in - *"TL-WDR4900 v1") - name="tl-wdr4900-v1" - ;; - esac - - [ -z "$name" ] && name="unknown" - - [ -z "$MPC85XX_BOARD_NAME" ] && MPC85XX_BOARD_NAME="$name" - [ -z "$MPC85XX_MODEL" ] && MPC85XX_MODEL="$model" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$MPC85XX_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$MPC85XX_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh b/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh deleted file mode 100644 index 88ba60837..000000000 --- a/target/linux/mpc85xx/base-files/lib/preinit/01_preinit_do_mpc85xx.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_mpc85xx() { - . /lib/mpc85xx.sh - - mpc85xx_board_detect -} - -boot_hook_add preinit_main do_mpc85xx diff --git a/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx b/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx index 22d7471dd..748a87490 100644 --- a/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx +++ b/target/linux/mpc85xx/base-files/lib/preinit/05_set_preinit_iface_mpc85xx @@ -3,8 +3,6 @@ # Copyright (C) 2013 OpenWrt.org # -. /lib/mpc85xx.sh - mpc85xx_set_preinit_iface() { ifname=eth0 } diff --git a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh index 65b367476..67e8324c2 100755 --- a/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/mpc85xx/base-files/lib/upgrade/platform.sh @@ -3,73 +3,13 @@ # PART_NAME=firmware - -tplink_get_hwid() { - local part - - part=$(find_mtd_part u-boot) - [ -z "$part" ] && return 1 - - dd if=$part bs=4 count=1 skip=81728 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -tplink_get_image_hwid() { - get_image "$@" | dd bs=4 count=1 skip=16 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -tplink_get_image_boot_size() { - get_image "$@" | dd bs=4 count=1 skip=37 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} +REQUIRE_IMAGE_METADATA=1 platform_check_image() { - local board=$(board_name) - local magic="$(get_magic_long "$1")" - - [ "$#" -gt 1 ] && return 1 - - case $board in - tl-wdr4900-v1) - [ "$magic" != "01000000" ] && { - echo "Invalid image type." - return 1 - } - - local hwid - local imageid - - hwid=$(tplink_get_hwid) - imageid=$(tplink_get_image_hwid "$1") - - [ "$hwid" != "$imageid" ] && { - echo "Invalid image, hardware ID mismatch, hw:$hwid image:$imageid." - return 1 - } - - local boot_size - - boot_size=$(tplink_get_image_boot_size "$1") - [ "$boot_size" != "00000000" ] && { - echo "Invalid image, it contains a bootloader." - return 1 - } - - return 0 - ;; - esac - - echo "Sysupgrade is not yet supported on $board." - return 1 + return 0 } -platform_do_upgrade() { - local board=$(board_name) - - case "$board" in - *) - default_do_upgrade "$ARGV" - ;; - esac -} +# use default for platform_do_upgrade() disable_watchdog() { killall watchdog diff --git a/target/linux/mpc85xx/config-4.9 b/target/linux/mpc85xx/config-4.9 index 64ab23961..f8114215f 100644 --- a/target/linux/mpc85xx/config-4.9 +++ b/target/linux/mpc85xx/config-4.9 @@ -37,6 +37,7 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CLZ_TAB=y CONFIG_CMDLINE="console=ttyS0,115200" CONFIG_CMDLINE_BOOL=y +# CONFIG_CMDLINE_OVERRIDE is not set # CONFIG_CORENET_GENERIC is not set # CONFIG_CPM2 is not set CONFIG_CPU_BIG_ENDIAN=y @@ -72,7 +73,7 @@ CONFIG_CRYPTO_RSA=y # CONFIG_CRYPTO_SHA256_PPC_SPE is not set CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEFAULT_UIMAGE=y +# CONFIG_DEFAULT_UIMAGE is not set CONFIG_DNOTIFY=y CONFIG_DTC=y # CONFIG_E200 is not set @@ -95,7 +96,7 @@ CONFIG_FSL_PCI=y CONFIG_FSL_PQ_MDIO=y CONFIG_FSL_SOC=y CONFIG_FSL_SOC_BOOKE=y -CONFIG_FSL_ULI1575=y +# CONFIG_FSL_ULI1575 is not set CONFIG_GENERIC_ALLOCATOR=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y @@ -125,7 +126,7 @@ CONFIG_GPIO_SYSFS=y CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y -CONFIG_HAS_RAPIDIO=y +# CONFIG_HAS_RAPIDIO is not set # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set CONFIG_HAVE_ARCH_AUDITSYSCALL=y # CONFIG_HAVE_ARCH_BITREVERSE is not set @@ -160,6 +161,7 @@ CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING=y +# CONFIG_HIVEAP_330 is not set CONFIG_HW_RANDOM=y CONFIG_HZ=250 # CONFIG_HZ_100 is not set @@ -185,21 +187,18 @@ CONFIG_LIBFDT=y CONFIG_LOWMEM_CAM_NUM=3 CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_LXT_PHY=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set CONFIG_MDIO_BOARDINFO=y -# CONFIG_MFD_MAX77620 is not set CONFIG_MIGRATION=y # CONFIG_MMIO_NVRAM is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MPC8536_DS is not set # CONFIG_MPC8540_ADS is not set # CONFIG_MPC8560_ADS is not set -CONFIG_MPC85xx_CDS=y +# CONFIG_MPC85xx_CDS is not set # CONFIG_MPC85xx_DS is not set -CONFIG_MPC85xx_MDS=y -CONFIG_MPC85xx_RDB=y +# CONFIG_MPC85xx_MDS is not set +# CONFIG_MPC85xx_RDB is not set CONFIG_MPIC=y # CONFIG_MPIC_MSGR is not set CONFIG_MPIC_TIMER=y @@ -232,7 +231,7 @@ CONFIG_OF_PCI_IRQ=y CONFIG_OF_RESERVED_MEM=y CONFIG_OLD_SIGACTION=y CONFIG_OLD_SIGSUSPEND=y -CONFIG_P1010_RDB=y +# CONFIG_P1010_RDB is not set # CONFIG_P1022_DS is not set # CONFIG_P1022_RDK is not set # CONFIG_P1023_RDB is not set @@ -274,7 +273,7 @@ CONFIG_PPC_DOORBELL=y # CONFIG_PPC_EARLY_DEBUG is not set # CONFIG_PPC_EPAPR_HV_PIC is not set CONFIG_PPC_FSL_BOOK3E=y -CONFIG_PPC_I8259=y +# CONFIG_PPC_I8259 is not set # CONFIG_PPC_ICP_HV is not set # CONFIG_PPC_ICP_NATIVE is not set # CONFIG_PPC_ICS_RTAS is not set @@ -332,7 +331,7 @@ CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y CONFIG_TASK_SIZE=0xc0000000 CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TL_WDR4900_V1=y +# CONFIG_TL_WDR4900_V1 is not set # CONFIG_TQM8540 is not set # CONFIG_TQM8541 is not set # CONFIG_TQM8548 is not set diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts new file mode 100644 index 000000000..5e732664a --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts @@ -0,0 +1,228 @@ +/* + * Aerohive HiveAP-330 Device Tree Source + * + * Copyright (C) 2017 Chris Blake + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +/include/ "fsl/p1020si-pre.dtsi" +/ { + model = "Aerohive HiveAP-330"; + compatible = "aerohive,hiveap-330"; + + chosen { + bootargs-override = "console=ttyS0,9600"; + }; + + memory { + device_type = "memory"; + }; + + board_lbc: lbc: localbus@ffe05000 { + reg = <0 0xffe05000 0 0x1000>; + ranges = <0x0 0x0 0x0 0xec000000 0x4000000>; + + nor@0,0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "cfi-flash"; + reg = <0x0 0x0 0x4000000>; + bank-width = <2>; + device-width = <1>; + + partition@0 { + reg = <0x0 0x40000>; + label = "dtb"; + }; + + partition@40000 { + reg = <0x40000 0x40000>; + label = "initrd"; + }; + + partition@80000 { + reg = <0x80000 0x27c0000>; + label = "rootfs"; + }; + + partition@2840000 { + reg = <0x2840000 0x800000>; + label = "kernel"; + }; + + partition@3040000 { + reg = <0x3040000 0xec0000>; + label = "stock-jffs2"; + read-only; + }; + + hwinfo: partition@3f00000 { + reg = <0x3f00000 0x20000>; + label = "hw-info"; + read-only; + }; + + partition@3f20000 { + reg = <0x3f20000 0x20000>; + label = "boot-info"; + read-only; + }; + + partition@3f40000 { + reg = <0x3f40000 0x20000>; + label = "boot-info-backup"; + read-only; + }; + + partition@3f60000 { + reg = <0x3f60000 0x20000>; + label = "u-boot-env"; + }; + + partition@3f80000 { + reg = <0x3f80000 0x80000>; + label = "u-boot"; + read-only; + }; + + firmware@0 { + reg = <0x0 0x3040000>; + label = "firmware"; + }; + }; + }; + + board_soc: soc: soc@ffe00000 { + ranges = <0x0 0x0 0xffe00000 0x100000>; + + i2c@3100 { + tpm@29 { + compatible = "atmel,at97sc3204t"; + reg = <0x29>; + }; + + lp5521@32 { + compatible = "national,lp5521"; + reg = <0x32>; + clock-mode = /bits/ 8 <2>; + chan0 { + chan-name = "hiveap-330:red:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + chan1 { + chan-name = "hiveap-330:green:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + chan2 { + chan-name = "hiveap-330:blue:tricolor0"; + led-cur = /bits/ 8 <0x2f>; + max-cur = /bits/ 8 <0x5f>; + }; + }; + + /* Most likely SoC boot config */ + eeprom@51 { + compatible = "eeprom"; + reg = <0x51>; + }; + }; + + mdio@24000 { + phy0: ethernet-phy@0 { + interrupts = <3 1 0 0>; + reg = <0x1>; + }; + + phy1: ethernet-phy@1 { + interrupts = <2 1 0 0>; + reg = <0x2>; + }; + }; + + mdio@25000 { + status = "disabled"; + }; + + mdio@26000 { + status = "disabled"; + }; + + enet0: ethernet@b0000 { + status = "okay"; + phy-handle = <&phy0>; + phy-connection-type = "rgmii-id"; + mtd-mac-address = <&hwinfo 0>; + }; + + enet1: ethernet@b1000 { + status = "disabled"; + }; + + enet2: ethernet@b2000 { + status = "okay"; + phy-handle = <&phy1>; + phy-connection-type = "rgmii-id"; + mtd-mac-address = <&hwinfo 0>; + mtd-mac-address-increment = <1>; + }; + + gpio0: gpio-controller@fc00 { + }; + + usb@22000 { + phy_type = "ulpi"; + dr_mode = "host"; + }; + + usb@23000 { + status = "disabled"; + }; + }; + + pci0: pcie@ffe09000 { + reg = <0x0 0xffe09000 0x0 0x1000>; + ranges = <0x2000000 0x0 0xa0000000 0x0 0xa0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0x0 0xffc30000 0x0 0x10000>; + pcie@0 { + ranges = <0x2000000 0x0 0xa0000000 + 0x2000000 0x0 0xa0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + pci1: pcie@ffe0a000 { + reg = <0x0 0xffe0a000 0x0 0x1000>; + ranges = <0x2000000 0x0 0xc0000000 0x0 0xc0000000 0x0 0x20000000 + 0x1000000 0x0 0x00000000 0x0 0xffc20000 0x0 0x10000>; + pcie@0 { + ranges = <0x2000000 0x0 0xc0000000 + 0x2000000 0x0 0xc0000000 + 0x0 0x20000000 + + 0x1000000 0x0 0x0 + 0x1000000 0x0 0x0 + 0x0 0x100000>; + }; + }; + + buttons { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + gpios = <&gpio0 8 1>; /* active low */ + linux,code = <0x198>; /* KEY_RESTART */ + }; + }; +}; +/include/ "fsl/p1020si-post.dtsi" diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts index 2ad58d3fd..c2444936b 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts +++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts @@ -13,7 +13,7 @@ / { model = "TP-Link TL-WDR4900 v1"; - compatible = "tp-link,TL-WDR4900v1"; + compatible = "tplink,tl-wdr4900-v1"; chosen { bootargs = "console=ttyS0,115200"; diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c new file mode 100644 index 000000000..f325b32ce --- /dev/null +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/hiveap-330.c @@ -0,0 +1,89 @@ +/* + * Aerohive HiveAP-330 Board Setup + * + * Copyright (C) 2017 Chris Blake + * + * Based on: + * mpc85xx_rdb.c: + * MPC85xx RDB Board Setup + * Copyright 2013 Freescale Semiconductor Inc. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "smp.h" + +#include "mpc85xx.h" + +void __init hiveap_330_pic_init(void) +{ + struct mpic *mpic; + + mpic = mpic_alloc(NULL, 0, + MPIC_BIG_ENDIAN | + MPIC_SINGLE_DEST_CPU, + 0, 256, " OpenPIC "); + + BUG_ON(mpic == NULL); + mpic_init(mpic); +} + +/* + * Setup the architecture + */ +static void __init hiveap_330_setup_arch(void) +{ + if (ppc_md.progress) + ppc_md.progress("hiveap_330_setup_arch()", 0); + + mpc85xx_smp_init(); + + fsl_pci_assign_primary(); + + printk(KERN_INFO "HiveAP-330 board from Aerohive\n"); +} + +machine_arch_initcall(hiveap_330, mpc85xx_common_publish_devices); + +/* + * Called very early, device-tree isn't unflattened + */ +static int __init hiveap_330_probe(void) +{ + if (of_machine_is_compatible("aerohive,hiveap-330")) + return 1; + return 0; +} + +define_machine(hiveap_330) { + .name = "P1020 RDB", + .probe = hiveap_330_probe, + .setup_arch = hiveap_330_setup_arch, + .init_IRQ = hiveap_330_pic_init, +#ifdef CONFIG_PCI + .pcibios_fixup_bus = fsl_pcibios_fixup_bus, + .pcibios_fixup_phb = fsl_pcibios_fixup_phb, +#endif + .get_irq = mpic_get_irq, + .calibrate_decr = generic_calibrate_decr, + .progress = udbg_progress, +}; diff --git a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c index 1b6dc18ac..9d7a22d17 100644 --- a/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c +++ b/target/linux/mpc85xx/files/arch/powerpc/platforms/85xx/tl_wdr4900_v1.c @@ -124,7 +124,7 @@ static int __init tl_wdr4900_v1_probe(void) { unsigned long root = of_get_flat_dt_root(); - if (of_flat_dt_is_compatible(root, "tp-link,TL-WDR4900v1")) + if (of_flat_dt_is_compatible(root, "tplink,tl-wdr4900-v1")) return 1; return 0; diff --git a/target/linux/mpc85xx/generic/config-default b/target/linux/mpc85xx/generic/config-default index e69de29bb..81bf934b3 100644 --- a/target/linux/mpc85xx/generic/config-default +++ b/target/linux/mpc85xx/generic/config-default @@ -0,0 +1 @@ +CONFIG_TL_WDR4900_V1=y diff --git a/target/linux/mpc85xx/profiles/00-default.mk b/target/linux/mpc85xx/generic/profiles/00-default.mk similarity index 64% rename from target/linux/mpc85xx/profiles/00-default.mk rename to target/linux/mpc85xx/generic/profiles/00-default.mk index 7dcb8faaa..67507ace8 100644 --- a/target/linux/mpc85xx/profiles/00-default.mk +++ b/target/linux/mpc85xx/generic/profiles/00-default.mk @@ -1,15 +1,15 @@ # -# Copyright (C) 2013 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # define Profile/Default - NAME:=Default Profile (all drivers) + NAME:=Default Profile + PRIORITY:=1 endef define Profile/Default/Description - Default package set compatible with most boards. + Default package set compatible with most MPC85xx boards. endef + $(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/generic/target.mk b/target/linux/mpc85xx/generic/target.mk index f8a79a7b9..2620a2289 100644 --- a/target/linux/mpc85xx/generic/target.mk +++ b/target/linux/mpc85xx/generic/target.mk @@ -1,4 +1,5 @@ BOARDNAME:=Generic +KERNELNAME:=cuImage.tl-wdr4900-v1 define Target/Description Build firmware images for generic MPC85xx based boards. diff --git a/target/linux/mpc85xx/image/Makefile b/target/linux/mpc85xx/image/Makefile index 25a9b070c..7ae6e27b3 100644 --- a/target/linux/mpc85xx/image/Makefile +++ b/target/linux/mpc85xx/image/Makefile @@ -1,77 +1,79 @@ # -# Copyright (C) 2010 OpenWrt.org -# # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk -define imgname -$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1))) +DEVICE_VARS += TPLINK_HWID TPLINK_HWREV TPLINK_FLASHLAYOUT + +define Device/Default + PROFILES := Default + DEVICE_DTS := $(1) + KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) + KERNEL_ENTRY := 0x00000000 + KERNEL_LOADADDR := 0x00000000 + KERNEL := kernel-bin endef -define sysupname -$(call imgname,$(1),$(2))-sysupgrade.bin +define Build/append-uImage-fakeramdisk-hdr + rm -f $@.fakeramdisk + $(STAGING_DIR_HOST)/bin/mkimage \ + -A $(LINUX_KARCH) -O linux -T ramdisk -C none \ + -n 'fakeramdisk' \ + -s \ + $@.fakeramdisk + cat $@.fakeramdisk >> $@ endef -define factoryname -$(call imgname,$(1),$(2))-factory.bin +define Build/tplink-v1-image + $(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) \ + -N "$(VERSION_DIST)" -V $(REVISION) \ + -k $(IMAGE_KERNEL) \ + -r $(IMAGE_ROOTFS) \ + -j \ + $(1) \ + -o $@ endef -zImage:=$(BIN_DIR)/$(IMG_PREFIX)-zImage - -DTS_TARGETS = fsl/p1010rdb-pa tl-wdr4900-v1 fsl/p1020rdb - -define Image/BuildKernel - cp $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage - $(foreach dts,$(DTS_TARGETS), - $(LINUX_DIR)/scripts/dtc/dtc -I dts -O dtb $(DTS_DIR)/$(dts).dts > $(BIN_DIR)/$(IMG_PREFIX)-$(notdir $(dts)).fdt - ) -endef - -define Image/BuildKernel/Initramfs - cp $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-initramfs-zImage ifeq ($(SUBTARGET),generic) - cp $(KDIR)/cuImage.tl-wdr4900-v1-initramfs $(BIN_DIR)/$(IMG_PREFIX)-tl-wdr4900-v1-initramfs.uImage + +define Device/tl-wdr4900-v1 + DEVICE_TITLE := TP-Link TL-WDR4900 + DEVICE_PACKAGES := kmod-ath9k wpad-mini + TPLINK_HWID := 0x49000001 + TPLINK_HWREV := 1 + TPLINK_FLASHLAYOUT := 16Mppc + KERNEL_NAME := cuImage.tl-wdr4900-v1 + SUPPORTED_DEVICES:=tl-wdr4900-v1 tplink,tl-wdr4900-v1 + IMAGES := fdt.bin factory.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/factory.bin := tplink-v1-image + IMAGE/sysupgrade.bin := tplink-v1-image -s | append-metadata +endef +TARGET_DEVICES += tl-wdr4900-v1 + endif -endef -define Image/Build/TPLINK - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call factoryname,$(1),$(2)) - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) $(7) -s \ - -k $(KDIR)/$(3) \ - -r $(KDIR)/root.$(1) \ - -o $(call sysupname,$(1),$(2)) -endef +ifeq ($(SUBTARGET),p1020) -define Image/Build/Profile/TLWDR4900 - $(call Image/Build/TPLINK,$(1),tl-wdr4900-v1,cuImage.tl-wdr4900-v1,0x49000001,1,16Mppc) +define Device/hiveap-330 + DEVICE_TITLE := Aerohive HiveAP-330 + DEVICE_PACKAGES := kmod-ath9k wpad-mini kmod-tpm-i2c-atmel + BLOCKSIZE := 128k + KERNEL_NAME := zImage + KERNEL_SIZE := 8m + SUPPORTED_DEVICES := aerohive,hiveap-330 + IMAGES := fdt.bin sysupgrade.bin + IMAGE/fdt.bin := append-dtb + IMAGE/sysupgrade.bin := append-dtb | pad-to 256k | check-size 256k | \ + append-uImage-fakeramdisk-hdr | pad-to 256k | check-size 512k | \ + append-rootfs | pad-rootfs $$(BLOCKSIZE) | pad-to 41216k | check-size 41216k | \ + append-kernel | append-metadata endef +TARGET_DEVICES += hiveap-330 -define Image/Build/Profile/Default - $(call Image/Build/Profile/TLWDR4900,$(1)) -endef - -define Image/Build/ext2 - cp $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-ext2.img -endef - -define Image/Build/squashfs - $(call prepare_generic_squashfs,$(KDIR)/root.squashfs) - cp $(KDIR)/root.squashfs $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs -endef - -PROFILE ?= Default - -define Image/Build - $(call Image/Build/$(1),$(1)) - $(call Image/Build/Profile/$(PROFILE),$(1)) -endef +endif $(eval $(call BuildImage)) diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default index 8fd795730..fd9433b59 100644 --- a/target/linux/mpc85xx/p1020/config-default +++ b/target/linux/mpc85xx/p1020/config-default @@ -1,15 +1,31 @@ CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_AT803X_PHY=y +CONFIG_CMDLINE_OVERRIDE=y CONFIG_CPU_RMAP=y +CONFIG_EEPROM_LEGACY=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_GENERIC_TBSYNC=y +# CONFIG_GPIO_MAX77620 is not set CONFIG_HAVE_RCU_TABLE_FREE=y +CONFIG_HIVEAP_330=y +CONFIG_I2C_CHARDEV=y +CONFIG_LEDS_LP5521=y +CONFIG_LEDS_LP55XX_COMMON=y CONFIG_LOCK_SPIN_ON_OWNER=y +# CONFIG_MAX77620_WATCHDOG is not set +CONFIG_MFD_CORE=y +CONFIG_MFD_MAX77620=y +CONFIG_MTD_CFI=y +CONFIG_MTD_PHYSMAP=y CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=2 +CONFIG_PADATA=y CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP_IRQ=y CONFIG_RFS_ACCEL=y CONFIG_RPS=y +# CONFIG_RTC_DRV_MAX77686 is not set CONFIG_RWSEM_SPIN_ON_OWNER=y CONFIG_SMP=y CONFIG_TREE_RCU=y diff --git a/target/linux/mpc85xx/p1020/profiles/00-default.mk b/target/linux/mpc85xx/p1020/profiles/00-default.mk new file mode 100644 index 000000000..67d43020a --- /dev/null +++ b/target/linux/mpc85xx/p1020/profiles/00-default.mk @@ -0,0 +1,15 @@ +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 +endef + +define Profile/Default/Description + Default package set compatible with most P1020 boards. +endef + +$(eval $(call Profile,Default)) diff --git a/target/linux/mpc85xx/p1020/target.mk b/target/linux/mpc85xx/p1020/target.mk index c111d7a4a..5d84d8320 100644 --- a/target/linux/mpc85xx/p1020/target.mk +++ b/target/linux/mpc85xx/p1020/target.mk @@ -1,6 +1,6 @@ BOARDNAME:=P1020 +FEATURES += ramdisk define Target/Description Build firmware images for Freescale P1020 based boards. endef - diff --git a/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch b/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch new file mode 100644 index 000000000..ece8c7d80 --- /dev/null +++ b/target/linux/mpc85xx/patches-4.9/101-powerpc-85xx-hiveap-330-support.patch @@ -0,0 +1,30 @@ +--- a/arch/powerpc/platforms/85xx/Kconfig ++++ b/arch/powerpc/platforms/85xx/Kconfig +@@ -48,6 +48,17 @@ config BSC9132_QDS + and dual StarCore SC3850 DSP cores. + Manufacturer : Freescale Semiconductor, Inc + ++config HIVEAP_330 ++ bool "Aerohive HiveAP-330" ++ select DEFAULT_UIMAGE ++ select ARCH_REQUIRE_GPIOLIB ++ select GPIO_MPC8XXX ++ help ++ This option enables support for the Aerohive HiveAP-330 board. ++ ++ This board is a Concurrent Dual-Band wireless access point with a ++ Freescale P1020 SoC. ++ + config MPC8540_ADS + bool "Freescale MPC8540 ADS" + select DEFAULT_UIMAGE +--- a/arch/powerpc/platforms/85xx/Makefile ++++ b/arch/powerpc/platforms/85xx/Makefile +@@ -9,6 +9,7 @@ obj-y += common.o + obj-$(CONFIG_BSC9131_RDB) += bsc913x_rdb.o + obj-$(CONFIG_BSC9132_QDS) += bsc913x_qds.o + obj-$(CONFIG_C293_PCIE) += c293pcie.o ++obj-$(CONFIG_HIVEAP_330) += hiveap-330.o + obj-$(CONFIG_MPC8540_ADS) += mpc85xx_ads.o + obj-$(CONFIG_MPC8560_ADS) += mpc85xx_ads.o + obj-$(CONFIG_MPC85xx_CDS) += mpc85xx_cds.o diff --git a/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch new file mode 100644 index 000000000..3d59927d1 --- /dev/null +++ b/target/linux/mpc85xx/patches-4.9/102-powerpc-add-cmdline-override.patch @@ -0,0 +1,37 @@ +--- a/arch/powerpc/Kconfig ++++ b/arch/powerpc/Kconfig +@@ -707,6 +707,14 @@ config CMDLINE_FORCE + This is useful if you cannot or don't want to change the + command-line options your boot loader passes to the kernel. + ++config CMDLINE_OVERRIDE ++ bool "Use alternative cmdline from device tree" ++ help ++ Some bootloaders may have uneditable bootargs. While CMDLINE_FORCE can ++ be used, this is not a good option for kernels that are shared across ++ devices. This setting enables using "chosen/cmdline-override" as the ++ cmdline if it exists in the device tree. ++ + config EXTRA_TARGETS + string "Additional default image types" + help +--- a/drivers/of/fdt.c ++++ b/drivers/of/fdt.c +@@ -1079,6 +1079,17 @@ int __init early_init_dt_scan_chosen(uns + if (p != NULL && l > 0) + strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); + ++ /* CONFIG_CMDLINE_OVERRIDE is used to fallback to a different ++ * device tree option of chosen/bootargs-override. This is ++ * helpful on boards where u-boot sets bootargs, and is unable ++ * to be modified. ++ */ ++#ifdef CONFIG_CMDLINE_OVERRIDE ++ p = of_get_flat_dt_prop(node, "bootargs-override", &l); ++ if (p != NULL && l > 0) ++ strlcpy(data, p, min((int)l, COMMAND_LINE_SIZE)); ++#endif ++ + /* + * CONFIG_CMDLINE is meant to be a default in case nothing else + * managed to set the command line, unless CONFIG_CMDLINE_FORCE diff --git a/target/linux/mpc85xx/profiles/tp-link.mk b/target/linux/mpc85xx/profiles/tp-link.mk deleted file mode 100644 index 18a7cddd8..000000000 --- a/target/linux/mpc85xx/profiles/tp-link.mk +++ /dev/null @@ -1,16 +0,0 @@ -# -# Copyright (C) 2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -define Profile/TLWDR4900 - NAME:=TP-Link TL-WDR4900 - PACKAGES:=kmod-ath9k wpad-mini -endef - -define Profile/TLWDR4900/Description - Package set optimized for the TP-Link TL-WDR4900. -endef -$(eval $(call Profile,TLWDR4900)) diff --git a/target/linux/octeon/config-4.14 b/target/linux/octeon/config-4.14 new file mode 100644 index 000000000..687b37f3c --- /dev/null +++ b/target/linux/octeon/config-4.14 @@ -0,0 +1,322 @@ +CONFIG_64BIT=y +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_DMA_ADDR_T_64BIT=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set +# CONFIG_ARCH_HAS_STRICT_KERNEL_RWX is not set +# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_BITS=12 +CONFIG_ARCH_MMAP_RND_BITS_MAX=18 +CONFIG_ARCH_MMAP_RND_BITS_MIN=12 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS=8 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15 +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX is not set +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set +CONFIG_ARCH_PHYS_ADDR_T_64BIT=y +CONFIG_ARCH_SPARSEMEM_ENABLE=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_USE_QUEUED_RWLOCKS=y +CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set +CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WANT_OLD_COMPAT_IPC=y +CONFIG_BINFMT_ELF32=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BLK_SCSI_REQUEST=y +CONFIG_BLOCK_COMPAT=y +# CONFIG_BOOTPARAM_HUNG_TASK_PANIC is not set +CONFIG_BOOTPARAM_HUNG_TASK_PANIC_VALUE=0 +CONFIG_BUILTIN_DTB=y +CONFIG_CAVIUM_CN63XXP1=y +CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE=2 +CONFIG_CAVIUM_OCTEON_LOCK_L2=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_EXCEPTION=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_LOW_LEVEL_INTERRUPT=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_MEMCPY=y +CONFIG_CAVIUM_OCTEON_LOCK_L2_TLB=y +CONFIG_CAVIUM_OCTEON_SOC=y +CONFIG_CEVT_R4K=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMPAT=y +CONFIG_COMPAT_BRK=y +CONFIG_COMPAT_NETLINK_MESSAGES=y +CONFIG_CPU_BIG_ENDIAN=y +CONFIG_CPU_CAVIUM_OCTEON=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +CONFIG_CPU_HAS_SYNC=y +# CONFIG_CPU_LITTLE_ENDIAN is not set +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +CONFIG_CPU_R4K_FPU=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_64BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_HUGEPAGES=y +CONFIG_CRAMFS=y +CONFIG_CRASH_CORE=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +# CONFIG_CRYPTO_MD5_OCTEON is not set +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +# CONFIG_CRYPTO_SHA1_OCTEON is not set +# CONFIG_CRYPTO_SHA256_OCTEON is not set +# CONFIG_CRYPTO_SHA512_OCTEON is not set +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=120 +CONFIG_DETECT_HUNG_TASK=y +CONFIG_DMA_COHERENT=y +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +CONFIG_DNOTIFY=y +# CONFIG_DRM_LIB_RANDOM is not set +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_EXPORTFS=y +CONFIG_EXT4_FS=y +# CONFIG_F2FS_CHECK_FS is not set +CONFIG_F2FS_FS=y +# CONFIG_F2FS_FS_SECURITY is not set +CONFIG_F2FS_FS_XATTR=y +CONFIG_F2FS_STAT_FS=y +CONFIG_FAT_FS=y +CONFIG_FIXED_PHY=y +CONFIG_FRAME_WARN=2048 +CONFIG_FS_MBCACHE=y +CONFIG_FUTEX_PI=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_CPU_AUTOPROBE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_OCTEON=y +CONFIG_GPIO_SYSFS=y +# CONFIG_GRO_CELLS is not set +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +CONFIG_HAVE_64BIT_ALIGNED_ACCESS=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_MMAP_RND_COMPAT_BITS=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_COPY_THREAD_TLS=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EBPF_JIT=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MEMORY_PRESENT=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HOLES_IN_ZONE=y +# CONFIG_HUGETLBFS is not set +CONFIG_HW_HAS_PCI=y +CONFIG_HW_RANDOM=y +CONFIG_HW_RANDOM_OCTEON=y +CONFIG_HZ=250 +# CONFIG_HZ_100 is not set +CONFIG_HZ_250=y +CONFIG_HZ_PERIODIC=y +CONFIG_IMAGE_CMDLINE_HACK=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_KALLSYMS=y +CONFIG_KEXEC=y +CONFIG_KEXEC_CORE=y +CONFIG_LIBFDT=y +CONFIG_MDIO_BUS=y +CONFIG_MDIO_CAVIUM=y +CONFIG_MDIO_DEVICE=y +CONFIG_MDIO_OCTEON=y +CONFIG_MIPS=y +CONFIG_MIPS32_COMPAT=y +CONFIG_MIPS32_N32=y +CONFIG_MIPS32_O32=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +# CONFIG_MIPS_CLOCK_VSYSCALL is not set +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y +# CONFIG_MIPS_CMDLINE_FROM_DTB is not set +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=7 +CONFIG_MIPS_L1_CACHE_SHIFT_7=y +# CONFIG_MIPS_MACHINE is not set +# CONFIG_MIPS_NO_APPENDED_DTB is not set +CONFIG_MIPS_PGD_C0_CONTEXT=y +CONFIG_MIPS_RAW_APPENDED_DTB=y +CONFIG_MIPS_SPRAM=y +# CONFIG_MIPS_VA_BITS_48 is not set +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +CONFIG_MMC_CAVIUM_OCTEON=y +CONFIG_MMC_OCTEON=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MODULES_USE_ELF_RELA=y +# CONFIG_MTD_CFI_INTELEXT is not set +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_PHYSMAP=y +CONFIG_NEED_SG_DMA_LENGTH=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_NR_CPUS=16 +CONFIG_NR_CPUS_DEFAULT_16=y +CONFIG_OCTEON_ETHERNET=y +# CONFIG_OCTEON_ILM is not set +CONFIG_OCTEON_MGMT_ETHERNET=y +CONFIG_OCTEON_USB=y +CONFIG_OCTEON_WDT=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PCI=y +CONFIG_PCI_BUS_ADDR_T_64BIT=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=3 +CONFIG_PHYLIB=y +CONFIG_PHYS_ADDR_T_64BIT=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_PROC_PAGE_MONITOR=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_RCU_NEED_SEGCBLIST=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RELAY=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_SCHED_DEBUG=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +CONFIG_SERIAL_8250_DW=y +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SPARSEMEM=y +CONFIG_SPARSEMEM_STATIC=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_SYSVIPC_COMPAT=y +CONFIG_SYS_HAS_CPU_CAVIUM_OCTEON=y +CONFIG_SYS_HAS_EARLY_PRINTK=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HOTPLUG_CPU=y +CONFIG_SYS_SUPPORTS_HUGETLBFS=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_THIN_ARCHIVES=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_PLATFORM=y +CONFIG_USB_OCTEON_EHCI=y +CONFIG_USB_OCTEON_OHCI=y +CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_HCD_PLATFORM=y +CONFIG_USB_STORAGE=y +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VFAT_FS=y +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_WATCHDOG_CORE=y +CONFIG_WEAK_ORDERING=y +CONFIG_XPS=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZONE_DMA32=y diff --git a/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch b/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch new file mode 100644 index 000000000..991eb56ce --- /dev/null +++ b/target/linux/octeon/patches-4.14/100-ubnt_edgerouter2_support.patch @@ -0,0 +1,31 @@ +--- a/arch/mips/include/asm/octeon/cvmx-bootinfo.h ++++ b/arch/mips/include/asm/octeon/cvmx-bootinfo.h +@@ -295,6 +295,8 @@ enum cvmx_board_types_enum { + */ + CVMX_BOARD_TYPE_CUST_PRIVATE_MIN = 20001, + CVMX_BOARD_TYPE_UBNT_E100 = 20002, ++ CVMX_BOARD_TYPE_UBNT_E200 = 20003, ++ CVMX_BOARD_TYPE_UBNT_E220 = 20005, + CVMX_BOARD_TYPE_CUST_DSR1000N = 20006, + CVMX_BOARD_TYPE_KONTRON_S1901 = 21901, + CVMX_BOARD_TYPE_CUST_PRIVATE_MAX = 30000, +@@ -396,6 +398,8 @@ static inline const char *cvmx_board_typ + /* Customer private range */ + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MIN) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E100) ++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E200) ++ ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_UBNT_E220) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_DSR1000N) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_KONTRON_S1901) + ENUM_BRD_TYPE_CASE(CVMX_BOARD_TYPE_CUST_PRIVATE_MAX) +--- a/arch/mips/cavium-octeon/executive/cvmx-helper-board.c ++++ b/arch/mips/cavium-octeon/executive/cvmx-helper-board.c +@@ -173,6 +173,8 @@ int cvmx_helper_board_get_mii_address(in + return 7 - ipd_port; + else + return -1; ++ case CVMX_BOARD_TYPE_UBNT_E200: ++ return -1; + case CVMX_BOARD_TYPE_KONTRON_S1901: + if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT) + return 1; diff --git a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch new file mode 100644 index 000000000..1df3f6a67 --- /dev/null +++ b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch @@ -0,0 +1,34 @@ +--- a/drivers/staging/octeon/ethernet.c ++++ b/drivers/staging/octeon/ethernet.c +@@ -684,6 +684,7 @@ static int cvm_oct_probe(struct platform + int interface; + int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; + int qos; ++ int i; + struct device_node *pip; + + octeon_mdiobus_force_mod_depencency(); +@@ -800,13 +801,19 @@ static int cvm_oct_probe(struct platform + } + + num_interfaces = cvmx_helper_get_number_of_interfaces(); +- for (interface = 0; interface < num_interfaces; interface++) { +- cvmx_helper_interface_mode_t imode = +- cvmx_helper_interface_get_mode(interface); +- int num_ports = cvmx_helper_ports_on_interface(interface); ++ for (i = 0; i < num_interfaces; i++) { ++ cvmx_helper_interface_mode_t imode; ++ int interface; ++ int num_ports; + int port; + int port_index; + ++ interface = i; ++ if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_UBNT_E200) ++ interface = num_interfaces - (i + 1); ++ ++ num_ports = cvmx_helper_ports_on_interface(interface); ++ imode = cvmx_helper_interface_get_mode(interface); + for (port_index = 0, + port = cvmx_helper_get_ipd_port(interface, 0); + port < cvmx_helper_get_ipd_port(interface, num_ports); diff --git a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch new file mode 100644 index 000000000..2a4ad1dc7 --- /dev/null +++ b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch @@ -0,0 +1,47 @@ +--- a/arch/mips/cavium-octeon/setup.c ++++ b/arch/mips/cavium-octeon/setup.c +@@ -656,6 +656,35 @@ void octeon_user_io_init(void) + write_c0_derraddr1(0); + } + ++#ifdef CONFIG_IMAGE_CMDLINE_HACK ++extern char __image_cmdline[]; ++ ++static int __init octeon_use_image_cmdline(void) ++{ ++ char *p = __image_cmdline; ++ int replace = 0; ++ ++ if (*p == '-') { ++ replace = 1; ++ p++; ++ } ++ ++ if (*p == '\0') ++ return 0; ++ ++ if (replace) { ++ strlcpy(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } else { ++ strlcat(arcs_cmdline, " ", sizeof(arcs_cmdline)); ++ strlcat(arcs_cmdline, p, sizeof(arcs_cmdline)); ++ } ++ ++ return 1; ++} ++#else ++static inline int octeon_use_image_cmdline(void) { return 0; } ++#endif ++ + /** + * Early entry point for arch setup + */ +@@ -900,6 +929,8 @@ void __init prom_init(void) + } + } + ++ octeon_use_image_cmdline(); ++ + if (strstr(arcs_cmdline, "console=") == NULL) { + #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL + strcat(arcs_cmdline, " console=ttyS0,115200"); diff --git a/target/linux/octeon/patches-4.14/170-cisco-hack.patch b/target/linux/octeon/patches-4.14/170-cisco-hack.patch new file mode 100644 index 000000000..124bcfd7a --- /dev/null +++ b/target/linux/octeon/patches-4.14/170-cisco-hack.patch @@ -0,0 +1,31 @@ +From patchwork Wed Jun 8 13:49:26 2016 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 8bit +Subject: [LEDE-DEV] cavium: Ignore MEM boot param when too small +From: =?utf-8?q?Micha=C5=82_Osowiecki?= +X-Patchwork-Id: 632273 +Message-Id: <57582266.8020105@gmail.com> +To: lede-dev@lists.infradead.org +Date: Wed, 8 Jun 2016 15:49:26 +0200 + +Cisco RV0XX u-boot sets MEM=2048 as boot param. We assume that at least +4MB (mem_alloc_size) of ram is needed to run linux on cavium boards, so +if mem < 4M - ignore it and set default value + + +Signed-off-by: MichaÅ‚ Osowiecki + +--- a/arch/mips/cavium-octeon/setup.c ++++ b/arch/mips/cavium-octeon/setup.c +@@ -1005,6 +1005,10 @@ void __init plat_mem_setup(void) + if (mem_alloc_size > max_memory) + mem_alloc_size = max_memory; + ++ /* Ignore bootarg MEM <= 4MB - cisco uses a b0rked uboot env on their products */ ++ if (max_memory <= mem_alloc_size) ++ max_memory = 512ull << 20; ++ + /* Crashkernel ignores bootmem list. It relies on mem=X@Y option */ + #ifdef CONFIG_CRASH_DUMP + add_memory_region(reserve_low_mem, max_memory, BOOT_MEM_RAM); diff --git a/target/linux/omap/Makefile b/target/linux/omap/Makefile index 34dc9a4b5..d8c0fd88e 100644 --- a/target/linux/omap/Makefile +++ b/target/linux/omap/Makefile @@ -14,7 +14,7 @@ FEATURES:=usb usbgadget ext4 targz fpu audio display nand ubifs CPU_TYPE:=cortex-a8 CPU_SUBTYPE:=vfpv3 -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 MAINTAINER:=Alexander Couzens diff --git a/target/linux/omap/config-4.9 b/target/linux/omap/config-4.9 new file mode 100644 index 000000000..d6f064909 --- /dev/null +++ b/target/linux/omap/config-4.9 @@ -0,0 +1,730 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_AM335X_CONTROL_USB=y +CONFIG_AM335X_PHY_USB=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_BANDGAP=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_HOLES_MEMORYMODEL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MULTIPLATFORM=y +# CONFIG_ARCH_MULTI_CPU_AUTO is not set +CONFIG_ARCH_MULTI_V6_V7=y +CONFIG_ARCH_MULTI_V7=y +CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_OMAP=y +CONFIG_ARCH_OMAP2PLUS=y +CONFIG_ARCH_OMAP2PLUS_TYPICAL=y +CONFIG_ARCH_OMAP3=y +CONFIG_ARCH_OMAP4=y +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +CONFIG_ARM_APPENDED_DTB=y +CONFIG_ARM_ATAG_DTB_COMPAT=y +# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set +CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y +CONFIG_ARM_CPU_SUSPEND=y +CONFIG_ARM_ERRATA_430973=y +CONFIG_ARM_ERRATA_720789=y +CONFIG_ARM_ERRATA_754322=y +CONFIG_ARM_ERRATA_775420=y +CONFIG_ARM_GIC=y +CONFIG_ARM_HAS_SG_CHAIN=y +CONFIG_ARM_HEAVY_MB=y +CONFIG_ARM_L1_CACHE_SHIFT=6 +CONFIG_ARM_L1_CACHE_SHIFT_6=y +# CONFIG_ARM_LPAE is not set +CONFIG_ARM_OMAP2PLUS_CPUFREQ=y +CONFIG_ARM_PATCH_IDIV=y +CONFIG_ARM_PATCH_PHYS_VIRT=y +CONFIG_ARM_THUMB=y +CONFIG_ARM_THUMBEE=y +CONFIG_ARM_VIRT_EXT=y +CONFIG_ASSOCIATIVE_ARRAY=y +CONFIG_AT803X_PHY=y +CONFIG_ATA=y +CONFIG_AUDIT=y +CONFIG_AUDITSYSCALL=y +CONFIG_AUDIT_GENERIC=y +CONFIG_AUDIT_TREE=y +CONFIG_AUDIT_WATCH=y +CONFIG_AUTO_ZRELADDR=y +CONFIG_BACKLIGHT_CLASS_DEVICE=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +# CONFIG_BACKLIGHT_PWM is not set +# CONFIG_BACKLIGHT_TPS65217 is not set +CONFIG_BCH=y +CONFIG_BINFMT_MISC=y +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=16384 +CONFIG_BLK_DEV_SD=y +CONFIG_BOUNCE=y +CONFIG_BSD_PROCESS_ACCT=y +CONFIG_BUILD_BIN2C=y +CONFIG_CACHE_L2X0=y +# CONFIG_CHARGER_TPS65217 is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLKSRC_TI_32K=y +CONFIG_CLK_TWL6040=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMA=y +CONFIG_CMA_ALIGNMENT=8 +CONFIG_CMA_AREAS=7 +# CONFIG_CMA_DEBUG is not set +# CONFIG_CMA_DEBUGFS is not set +CONFIG_CMA_SIZE_MBYTES=16 +# CONFIG_CMA_SIZE_SEL_MAX is not set +CONFIG_CMA_SIZE_SEL_MBYTES=y +# CONFIG_CMA_SIZE_SEL_MIN is not set +# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set +CONFIG_CMDLINE="root=/dev/mmcblk0p2 rootwait console=ttyO2,115200" +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_PALMAS is not set +# CONFIG_COMMON_CLK_TI_ADPLL is not set +CONFIG_CONFIGFS_FS=y +CONFIG_CONNECTOR=y +CONFIG_CPUFREQ_DT=y +CONFIG_CPUFREQ_DT_PLATDEV=y +CONFIG_CPU_32v6K=y +CONFIG_CPU_32v7=y +CONFIG_CPU_ABRT_EV7=y +# CONFIG_CPU_BPREDICT_DISABLE is not set +CONFIG_CPU_CACHE_V7=y +CONFIG_CPU_CACHE_VIPT=y +CONFIG_CPU_COPY_V6=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FREQ=y +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_GOV_ATTR_SET=y +CONFIG_CPU_FREQ_GOV_COMMON=y +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y +CONFIG_CPU_FREQ_GOV_ONDEMAND=y +CONFIG_CPU_FREQ_GOV_PERFORMANCE=y +CONFIG_CPU_FREQ_GOV_POWERSAVE=y +CONFIG_CPU_FREQ_GOV_USERSPACE=y +CONFIG_CPU_FREQ_STAT=y +CONFIG_CPU_FREQ_STAT_DETAILS=y +CONFIG_CPU_HAS_ASID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_IDLE=y +CONFIG_CPU_IDLE_GOV_LADDER=y +CONFIG_CPU_IDLE_GOV_MENU=y +CONFIG_CPU_PABRT_V7=y +CONFIG_CPU_PM=y +CONFIG_CPU_RMAP=y +CONFIG_CPU_THERMAL=y +CONFIG_CPU_TLB_V7=y +CONFIG_CPU_V7=y +CONFIG_CRAMFS=y +CONFIG_CRC16=y +CONFIG_CRC7=y +CONFIG_CRC_CCITT=y +CONFIG_CRC_ITU_T=y +CONFIG_CRC_T10DIF=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CBC=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_CRCT10DIF=y +CONFIG_CRYPTO_CTR=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_OMAP_AES=y +CONFIG_CRYPTO_DEV_OMAP_DES=y +CONFIG_CRYPTO_DEV_OMAP_SHAM=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_ECB=y +CONFIG_CRYPTO_ENGINE=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HMAC=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_JITTERENTROPY=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_MD5=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y +CONFIG_CRYPTO_SHA1=y +CONFIG_CRYPTO_SHA256=y +CONFIG_CRYPTO_SHA512=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DDR=y +CONFIG_DEBUG_GPIO=y +CONFIG_DEBUG_INFO=y +CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" +CONFIG_DEBUG_LOCK_ALLOC=y +CONFIG_DEBUG_MUTEXES=y +CONFIG_DEBUG_SPINLOCK=y +# CONFIG_DEBUG_UART_8250 is not set +# CONFIG_DEBUG_USER is not set +CONFIG_DM9000=y +# CONFIG_DM9000_FORCE_SIMPLE_PHY_POLL is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_CMA=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_OF=y +CONFIG_DMA_OMAP=y +CONFIG_DMA_SHARED_BUFFER=y +CONFIG_DMA_VIRTUAL_CHANNELS=y +CONFIG_DNS_RESOLVER=y +CONFIG_DRM=y +CONFIG_DRM_BRIDGE=y +CONFIG_DRM_KMS_HELPER=y +CONFIG_DRM_OMAP=y +CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=y +CONFIG_DRM_OMAP_CONNECTOR_DVI=y +CONFIG_DRM_OMAP_CONNECTOR_HDMI=y +# CONFIG_DRM_OMAP_ENCODER_OPA362 is not set +CONFIG_DRM_OMAP_ENCODER_TFP410=y +CONFIG_DRM_OMAP_ENCODER_TPD12S015=y +CONFIG_DRM_OMAP_NUM_CRTCS=1 +CONFIG_DRM_OMAP_PANEL_DPI=y +CONFIG_DRM_OMAP_PANEL_DSI_CM=y +CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02=y +CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11=y +CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01=y +CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM=y +CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1=y +CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1=y +CONFIG_DTC=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EEPROM_93CX6=y +CONFIG_EXPORTFS=y +CONFIG_EXT2_FS=y +CONFIG_EXT3_FS=y +# CONFIG_EXT3_FS_POSIX_ACL is not set +# CONFIG_EXT3_FS_SECURITY is not set +CONFIG_EXT4_FS=y +CONFIG_EXTCON=y +CONFIG_EXTCON_PALMAS=y +CONFIG_EXTCON_USB_GPIO=y +CONFIG_FANOTIFY=y +CONFIG_FAT_FS=y +CONFIG_FB_CMDLINE=y +CONFIG_FHANDLE=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_PHY=y +CONFIG_GENERIC_PINCONF=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GLOB=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_OMAP=y +CONFIG_GPIO_PALMAS=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GPIO_PCF857X=y +CONFIG_GPIO_SYSFS=y +# CONFIG_GPIO_TPS65218 is not set +CONFIG_GPIO_TPS65910=y +CONFIG_GPIO_TWL4030=y +CONFIG_GPIO_TWL6040=y +CONFIG_GRACE_PERIOD=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SCU=y +CONFIG_HAVE_ARM_SMCCC=y +CONFIG_HAVE_ARM_TWD=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SMP=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HDMI=y +CONFIG_HIGHMEM=y +CONFIG_HIGHPTE=y +CONFIG_HSI=y +CONFIG_HSI_BOARDINFO=y +# CONFIG_HSI_CHAR is not set +CONFIG_HWMON=y +CONFIG_HZ_FIXED=0 +CONFIG_I2C=y +CONFIG_I2C_ALGOBIT=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_OMAP=y +CONFIG_IKCONFIG=y +CONFIG_IKCONFIG_PROC=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IP_PNP=y +CONFIG_IP_PNP_BOOTP=y +CONFIG_IP_PNP_DHCP=y +CONFIG_IP_PNP_RARP=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_JFFS2_LZO=y +CONFIG_JFFS2_RUBIN=y +CONFIG_KALLSYMS=y +CONFIG_KALLSYMS_ALL=y +CONFIG_KEYS=y +CONFIG_KPROBES=y +CONFIG_KRETPROBES=y +CONFIG_KS8851=y +CONFIG_KS8851_MLL=y +CONFIG_LCD_CLASS_DEVICE=y +CONFIG_LCD_PLATFORM=y +CONFIG_LEDS_GPIO=y +CONFIG_LEDS_PWM=y +CONFIG_LEDS_TRIGGER_BACKLIGHT=y +CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_GPIO=y +CONFIG_LEDS_TRIGGER_HEARTBEAT=y +CONFIG_LEDS_TRIGGER_ONESHOT=y +CONFIG_LIBCRC32C=y +CONFIG_LIBFDT=y +CONFIG_LOCKD=y +CONFIG_LOCKDEP=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +# CONFIG_MACH_OMAP3517EVM is not set +# CONFIG_MACH_OMAP3_PANDORA is not set +CONFIG_MACH_OMAP_GENERIC=y +CONFIG_MAGIC_SYSRQ=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MEMORY=y +CONFIG_MEMORY_ISOLATION=y +CONFIG_MFD_CORE=y +CONFIG_MFD_PALMAS=y +CONFIG_MFD_SYSCON=y +CONFIG_MFD_TI_AM335X_TSCADC=y +CONFIG_MFD_TPS65217=y +CONFIG_MFD_TPS65218=y +CONFIG_MFD_TPS65910=y +CONFIG_MFD_TWL4030_AUDIO=y +CONFIG_MIGHT_HAVE_CACHE_L2X0=y +CONFIG_MIGHT_HAVE_PCI=y +CONFIG_MIGRATION=y +CONFIG_MMC=y +CONFIG_MMC_BLOCK=y +# CONFIG_MMC_OMAP is not set +CONFIG_MMC_OMAP_HS=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MSDOS_FS=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_BCH=y +CONFIG_MTD_NAND_ECC=y +CONFIG_MTD_NAND_ECC_BCH=y +CONFIG_MTD_NAND_OMAP2=y +CONFIG_MTD_NAND_OMAP_BCH=y +CONFIG_MTD_NAND_OMAP_BCH_BUILD=y +CONFIG_MTD_ONENAND=y +# CONFIG_MTD_ONENAND_2X_PROGRAM is not set +# CONFIG_MTD_ONENAND_GENERIC is not set +CONFIG_MTD_ONENAND_OMAP2=y +# CONFIG_MTD_ONENAND_OTP is not set +CONFIG_MTD_ONENAND_VERIFY_WRITE=y +CONFIG_MTD_OOPS=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_UBI=y +CONFIG_MTD_UBI_BEB_LIMIT=20 +# CONFIG_MTD_UBI_BLOCK is not set +# CONFIG_MTD_UBI_FASTMAP is not set +# CONFIG_MTD_UBI_GLUEBI is not set +CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_MULTI_IRQ_HANDLER=y +# CONFIG_MUSB_PIO_ONLY is not set +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEON=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_KEY=y +CONFIG_NET_KEY_MIGRATE=y +CONFIG_NET_PTP_CLASSIFY=y +CONFIG_NFS_ACL_SUPPORT=y +CONFIG_NFS_FS=y +CONFIG_NFS_USE_KERNEL_DNS=y +# CONFIG_NFS_USE_LEGACY_DNS is not set +CONFIG_NFS_V3_ACL=y +CONFIG_NFS_V4=y +CONFIG_NLS=y +CONFIG_NLS_CODEPAGE_437=y +CONFIG_NLS_ISO8859_1=y +CONFIG_NOP_USB_XCEIV=y +CONFIG_NO_BOOTMEM=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_NET=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OID_REGISTRY=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_OMAP2_DSS=y +CONFIG_OMAP2_DSS_DPI=y +CONFIG_OMAP2_DSS_DSI=y +CONFIG_OMAP2_DSS_HDMI_COMMON=y +CONFIG_OMAP2_DSS_INIT=y +CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK=0 +CONFIG_OMAP2_DSS_SDI=y +CONFIG_OMAP2_DSS_SLEEP_AFTER_VENC_RESET=y +CONFIG_OMAP2_DSS_VENC=y +# CONFIG_OMAP3_L2_AUX_SECURE_SAVE_RESTORE is not set +# CONFIG_OMAP3_SDRC_AC_TIMING is not set +CONFIG_OMAP3_THERMAL=y +CONFIG_OMAP4_DSS_HDMI=y +CONFIG_OMAP4_THERMAL=y +CONFIG_OMAP5_DSS_HDMI=y +CONFIG_OMAP_32K_TIMER=y +CONFIG_OMAP_CONTROL_PHY=y +CONFIG_OMAP_DM_TIMER=y +CONFIG_OMAP_GPMC=y +# CONFIG_OMAP_GPMC_DEBUG is not set +CONFIG_OMAP_INTERCONNECT=y +CONFIG_OMAP_INTERCONNECT_BARRIER=y +CONFIG_OMAP_IRQCHIP=y +CONFIG_OMAP_MUX=y +CONFIG_OMAP_MUX_DEBUG=y +CONFIG_OMAP_MUX_WARNINGS=y +CONFIG_OMAP_OCP2SCP=y +CONFIG_OMAP_PM_NOOP=y +CONFIG_OMAP_RESET_CLOCKS=y +# CONFIG_OMAP_SSI is not set +CONFIG_OMAP_USB2=y +CONFIG_OMAP_WATCHDOG=y +CONFIG_OPROFILE=y +CONFIG_OPTPROBES=y +CONFIG_OUTER_CACHE=y +CONFIG_OUTER_CACHE_SYNC=y +CONFIG_PADATA=y +CONFIG_PAGE_OFFSET=0xC0000000 +# CONFIG_PCI_DOMAINS_GENERIC is not set +# CONFIG_PCI_SYSCALL is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +# CONFIG_PHY_DM816X_USB is not set +CONFIG_PINCTRL=y +# CONFIG_PINCTRL_PALMAS is not set +CONFIG_PL310_ERRATA_588369=y +CONFIG_PL310_ERRATA_727915=y +# CONFIG_PL310_ERRATA_753970 is not set +# CONFIG_PL310_ERRATA_769419 is not set +CONFIG_PM=y +# CONFIG_PM_ADVANCED_DEBUG is not set +CONFIG_PM_CLK=y +CONFIG_PM_DEBUG=y +CONFIG_PM_OPP=y +CONFIG_POSIX_MQUEUE=y +CONFIG_POSIX_MQUEUE_SYSCTL=y +CONFIG_POWER_AVS=y +CONFIG_POWER_AVS_OMAP=y +CONFIG_POWER_AVS_OMAP_CLASS3=y +CONFIG_POWER_SUPPLY=y +CONFIG_PPS=y +CONFIG_PRINTK_TIME=y +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PROC_EVENTS=y +CONFIG_PROFILING=y +CONFIG_PROVE_LOCKING=y +CONFIG_PROVE_RCU=y +CONFIG_PTP_1588_CLOCK=y +CONFIG_PWM=y +# CONFIG_PWM_OMAP_DMTIMER is not set +CONFIG_PWM_SYSFS=y +CONFIG_PWM_TIECAP=y +CONFIG_PWM_TIEHRPWM=y +CONFIG_PWM_TIPWMSS=y +# CONFIG_PWM_TWL is not set +# CONFIG_PWM_TWL_LED is not set +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +# CONFIG_QUOTA_NETLINK_INTERFACE is not set +CONFIG_QUOTA_TREE=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y +CONFIG_REGMAP_IRQ=y +CONFIG_REGMAP_MMIO=y +CONFIG_REGMAP_SPI=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_REGULATOR_PALMAS=y +CONFIG_REGULATOR_PBIAS=y +CONFIG_REGULATOR_TI_ABB=y +CONFIG_REGULATOR_TPS62360=y +CONFIG_REGULATOR_TPS65023=y +CONFIG_REGULATOR_TPS6507X=y +CONFIG_REGULATOR_TPS65217=y +CONFIG_REGULATOR_TPS65218=y +CONFIG_REGULATOR_TPS65910=y +CONFIG_REGULATOR_TWL4030=y +CONFIG_RFS_ACCEL=y +CONFIG_RING_BUFFER=y +CONFIG_RING_BUFFER_ALLOW_SWAP=y +CONFIG_ROOT_NFS=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_DS1307=y +CONFIG_RTC_DRV_OMAP=y +CONFIG_RTC_DRV_PALMAS=y +# CONFIG_RTC_DRV_TPS65910 is not set +CONFIG_RTC_DRV_TWL4030=y +CONFIG_RTC_I2C_AND_SPI=y +CONFIG_RTC_MC146818_LIB=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SATA_AHCI_PLATFORM=y +CONFIG_SCHEDSTATS=y +CONFIG_SCHED_INFO=y +CONFIG_SCHED_MC=y +CONFIG_SCSI=y +CONFIG_SCSI_SCAN_ASYNC=y +CONFIG_SDIO_UART=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +CONFIG_SENSORS_GPIO_FAN=y +CONFIG_SENSORS_LM75=y +CONFIG_SENSORS_TMP102=y +CONFIG_SENSORS_TSL2550=y +CONFIG_SERIAL_8250_DETECT_IRQ=y +CONFIG_SERIAL_8250_EXTENDED=y +CONFIG_SERIAL_8250_FSL=y +CONFIG_SERIAL_8250_MANY_PORTS=y +CONFIG_SERIAL_8250_NR_UARTS=32 +# CONFIG_SERIAL_8250_OMAP is not set +CONFIG_SERIAL_8250_RSA=y +CONFIG_SERIAL_8250_SHARE_IRQ=y +CONFIG_SERIAL_OF_PLATFORM=y +CONFIG_SERIAL_OMAP=y +CONFIG_SERIAL_OMAP_CONSOLE=y +CONFIG_SERIO=y +CONFIG_SG_POOL=y +CONFIG_SG_SPLIT=y +CONFIG_SMC91X=y +CONFIG_SMP=y +CONFIG_SMP_ON_UP=y +CONFIG_SMSC911X=y +# CONFIG_SMSC911X_ARCH_HOOKS is not set +CONFIG_SMSC_PHY=y +CONFIG_SND=y +# CONFIG_SND_COMPRESS_OFFLOAD is not set +CONFIG_SND_DAVINCI_SOC_MCASP=y +CONFIG_SND_DMAENGINE_PCM=y +CONFIG_SND_JACK=y +CONFIG_SND_MIXER_OSS=y +CONFIG_SND_OMAP_SOC=y +CONFIG_SND_OMAP_SOC_DMIC=y +# CONFIG_SND_OMAP_SOC_HDMI_AUDIO is not set +CONFIG_SND_OMAP_SOC_MCBSP=y +CONFIG_SND_OMAP_SOC_MCPDM=y +CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=y +CONFIG_SND_OMAP_SOC_OMAP_TWL4030=y +# CONFIG_SND_OMAP_SOC_RX51 is not set +CONFIG_SND_PCM=y +CONFIG_SND_PCM_OSS=y +CONFIG_SND_SIMPLE_CARD=y +CONFIG_SND_SIMPLE_CARD_UTILS=y +CONFIG_SND_SOC=y +CONFIG_SND_SOC_DMIC=y +CONFIG_SND_SOC_I2C_AND_SPI=y +CONFIG_SND_SOC_TLV320AIC3X=y +CONFIG_SND_SOC_TWL4030=y +CONFIG_SND_SOC_TWL6040=y +CONFIG_SND_VERBOSE_PRINTK=y +CONFIG_SOC_AM33XX=y +CONFIG_SOC_AM43XX=y +CONFIG_SOC_BUS=y +CONFIG_SOC_HAS_OMAP2_SDRC=y +CONFIG_SOC_OMAP3430=y +# CONFIG_SOC_TI81XX is not set +CONFIG_SOUND=y +CONFIG_SOUND_OSS_CORE=y +CONFIG_SOUND_OSS_CORE_PRECLAIM=y +CONFIG_SPARSE_IRQ=y +CONFIG_SPI=y +CONFIG_SPI_MASTER=y +CONFIG_SPI_OMAP24XX=y +CONFIG_SPI_TI_QSPI=y +CONFIG_SRAM=y +CONFIG_SRCU=y +CONFIG_STACKTRACE=y +CONFIG_SUNRPC=y +CONFIG_SUNRPC_GSS=y +CONFIG_SWIOTLB=y +CONFIG_SWPHY=y +CONFIG_SWP_EMULATE=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_THERMAL=y +CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_FAIR_SHARE=y +CONFIG_THERMAL_GOV_STEP_WISE=y +CONFIG_THERMAL_GOV_USER_SPACE=y +CONFIG_THERMAL_OF=y +# CONFIG_THUMB2_KERNEL is not set +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TIMER_STATS=y +CONFIG_TI_CPPI41=y +CONFIG_TI_CPSW=y +CONFIG_TI_CPSW_ALE=y +CONFIG_TI_CPSW_PHY_SEL=y +CONFIG_TI_CPTS=y +CONFIG_TI_DAVINCI_CPDMA=y +CONFIG_TI_DAVINCI_EMAC=y +CONFIG_TI_DAVINCI_MDIO=y +CONFIG_TI_DMA_CROSSBAR=y +CONFIG_TI_EDMA=y +CONFIG_TI_EMIF=y +CONFIG_TI_PIPE3=y +CONFIG_TI_SOC_THERMAL=y +CONFIG_TI_THERMAL=y +CONFIG_TMPFS_POSIX_ACL=y +CONFIG_TRACE_CLOCK=y +CONFIG_TRACE_IRQFLAGS=y +CONFIG_TREE_RCU=y +CONFIG_TWL4030_CORE=y +CONFIG_TWL4030_POWER=y +CONFIG_TWL4030_USB=y +CONFIG_TWL4030_WATCHDOG=y +# CONFIG_TWL6030_USB is not set +CONFIG_TWL6040_CORE=y +CONFIG_UBIFS_FS=y +# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_UBIFS_FS_LZO=y +CONFIG_UBIFS_FS_ZLIB=y +CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" +CONFIG_UNINLINE_SPIN_UNLOCK=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_DUAL_ROLE=y +# CONFIG_USB_DWC3_GADGET is not set +# CONFIG_USB_DWC3_HOST is not set +CONFIG_USB_DWC3_OMAP=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_HCD_OMAP=y +# CONFIG_USB_EHCI_HCD_PLATFORM is not set +CONFIG_USB_GADGET=y +CONFIG_USB_INVENTRA_DMA=y +CONFIG_USB_MUSB_AM335X_CHILD=y +CONFIG_USB_MUSB_AM35X=y +CONFIG_USB_MUSB_DSPS=y +CONFIG_USB_MUSB_DUAL_ROLE=y +# CONFIG_USB_MUSB_GADGET is not set +CONFIG_USB_MUSB_HDRC=y +# CONFIG_USB_MUSB_HOST is not set +CONFIG_USB_MUSB_OMAP2PLUS=y +CONFIG_USB_MUSB_TUSB6010=y +CONFIG_USB_PHY=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_TI_CPPI41_DMA=y +CONFIG_USB_TUSB_OMAP_DMA=y +# CONFIG_USERIO is not set +CONFIG_USE_OF=y +CONFIG_VECTORS_BASE=0xffff0000 +CONFIG_VFAT_FS=y +CONFIG_VFP=y +CONFIG_VFPv3=y +CONFIG_VIDEOMODE_HELPERS=y +CONFIG_WATCHDOG_CORE=y +# CONFIG_WKUP_M3_RPROC is not set +CONFIG_XFRM_ALGO=y +CONFIG_XFRM_MIGRATE=y +CONFIG_XPS=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y diff --git a/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch b/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch new file mode 100644 index 000000000..5a6f76fd1 --- /dev/null +++ b/target/linux/omap/patches-4.9/001-omap4_pandaboard-wlan_fix.patch @@ -0,0 +1,10 @@ +--- a/arch/arm/mach-omap2/twl-common.c ++++ b/arch/arm/mach-omap2/twl-common.c +@@ -368,6 +368,7 @@ static struct regulator_init_data omap4_ + static struct regulator_init_data omap4_clk32kg_idata = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, ++ .always_on = true, + }, + }; + diff --git a/target/linux/orion/Makefile b/target/linux/orion/Makefile index 5a541001f..07583e485 100644 --- a/target/linux/orion/Makefile +++ b/target/linux/orion/Makefile @@ -13,7 +13,7 @@ FEATURES:=broken rtc SUBTARGETS:=generic harddisk MAINTAINER:=Imre Kaloz -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/orion/config-4.9 b/target/linux/orion/config-4.9 new file mode 100644 index 000000000..56ae5ee98 --- /dev/null +++ b/target/linux/orion/config-4.9 @@ -0,0 +1,246 @@ +CONFIG_ALIGNMENT_TRAP=y +CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +# CONFIG_ARCH_MULTI_V4 is not set +# CONFIG_ARCH_MULTI_V4T is not set +CONFIG_ARCH_NR_GPIO=0 +CONFIG_ARCH_ORION5X=y +# CONFIG_ARCH_ORION5X_DT is not set +CONFIG_ARCH_REQUIRE_GPIOLIB=y +# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set +# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARM=y +# CONFIG_ARM_CPU_SUSPEND is not set +CONFIG_ARM_L1_CACHE_SHIFT=5 +CONFIG_ARM_PATCH_PHYS_VIRT=y +# CONFIG_ARM_THUMB is not set +CONFIG_ASYNC_TX_ENABLE_CHANNEL_SWITCH=y +CONFIG_ATAGS=y +CONFIG_AUTO_ZRELADDR=y +# CONFIG_CACHE_L2X0 is not set +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_MMIO=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 earlyprintk" +CONFIG_CMDLINE_FORCE=y +CONFIG_COMMON_CLK=y +CONFIG_CPU_32v5=y +CONFIG_CPU_ABRT_EV5T=y +CONFIG_CPU_CACHE_VIVT=y +CONFIG_CPU_COPY_FEROCEON=y +CONFIG_CPU_CP15=y +CONFIG_CPU_CP15_MMU=y +CONFIG_CPU_FEROCEON=y +CONFIG_CPU_FEROCEON_OLD_ID=y +# CONFIG_CPU_ICACHE_DISABLE is not set +CONFIG_CPU_PABRT_LEGACY=y +CONFIG_CPU_TLB_FEROCEON=y +CONFIG_CPU_USE_DOMAINS=y +CONFIG_CRYPTO_DES=y +CONFIG_CRYPTO_DEV_MARVELL_CESA=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DEBUG_LL=y +CONFIG_DEBUG_LL_INCLUDE="debug/8250.S" +CONFIG_DEBUG_LL_UART_8250=y +CONFIG_DEBUG_UART_8250=y +# CONFIG_DEBUG_UART_8250_FLOW_CONTROL is not set +CONFIG_DEBUG_UART_8250_SHIFT=2 +# CONFIG_DEBUG_UART_8250_WORD is not set +CONFIG_DEBUG_UART_PHYS=0xf1012000 +CONFIG_DEBUG_UART_VIRT=0xfe012000 +# CONFIG_DEBUG_USER is not set +CONFIG_DMADEVICES=y +CONFIG_DMA_ENGINE=y +CONFIG_DMA_ENGINE_RAID=y +CONFIG_DMA_OF=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_EARLY_PRINTK=y +CONFIG_EDAC_ATOMIC_SCRUB=y +CONFIG_EDAC_SUPPORT=y +CONFIG_FIXED_PHY=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_DEVRES=y +CONFIG_GPIO_MVEBU=y +CONFIG_GPIO_SYSFS=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_BPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_ATTRS=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_OPTPROBES=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_PROC_CPU=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HZ_FIXED=0 +CONFIG_HZ_PERIODIC=y +CONFIG_I2C=y +CONFIG_I2C_BOARDINFO=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MV64XXX=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_LEDS_GPIO=y +CONFIG_LIBFDT=y +# CONFIG_MACH_D2NET_DT is not set +# CONFIG_MACH_DB88F5281 is not set +# CONFIG_MACH_DNS323 is not set +# CONFIG_MACH_DT2 is not set +# CONFIG_MACH_KUROBOX_PRO is not set +# CONFIG_MACH_LINKSTATION_LSCHL is not set +# CONFIG_MACH_LINKSTATION_LS_HGL is not set +# CONFIG_MACH_LINKSTATION_MINI is not set +# CONFIG_MACH_LINKSTATION_PRO is not set +# CONFIG_MACH_MSS2_DT is not set +# CONFIG_MACH_MV2120 is not set +# CONFIG_MACH_NET2BIG is not set +# CONFIG_MACH_RD88F5181L_FXO is not set +# CONFIG_MACH_RD88F5181L_GE is not set +# CONFIG_MACH_RD88F5182 is not set +# CONFIG_MACH_RD88F5182_DT is not set +# CONFIG_MACH_RD88F6183AP_GE is not set +CONFIG_MACH_TERASTATION_PRO2=y +# CONFIG_MACH_TS209 is not set +# CONFIG_MACH_TS409 is not set +# CONFIG_MACH_TS78XX is not set +CONFIG_MACH_WN802T=y +CONFIG_MACH_WNR854T=y +CONFIG_MACH_WRT350N_V2=y +CONFIG_MDIO_BOARDINFO=y +CONFIG_MMC=y +CONFIG_MMC_MVSDIO=y +# CONFIG_MMC_TIFM_SD is not set +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MTD_PHYSMAP=y +CONFIG_MULTI_IRQ_HANDLER=y +CONFIG_MV643XX_ETH=y +CONFIG_MVEBU_MBUS=y +CONFIG_MVMDIO=y +# CONFIG_MVNETA is not set +CONFIG_MV_XOR=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NEED_KUSER_HELPERS=y +CONFIG_NEED_PER_CPU_KM=y +# CONFIG_NET_VENDOR_AURORA is not set +CONFIG_NO_BOOTMEM=y +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_MDIO=y +CONFIG_OF_MTD=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGACTION=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_ORION_WATCHDOG=y +CONFIG_PAGE_OFFSET=0xC0000000 +CONFIG_PCI=y +# CONFIG_PCI_DOMAINS_GENERIC is not set +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PHYLIB=y +CONFIG_PLAT_ORION=y +CONFIG_PLAT_ORION_LEGACY=y +CONFIG_RATIONAL=y +# CONFIG_RCU_EXPERT is not set +# CONFIG_RCU_STALL_COMMON is not set +CONFIG_RTC_CLASS=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +# CONFIG_SCSI_DMA is not set +CONFIG_SERIAL_8250_FSL=y +CONFIG_SPLIT_PTLOCK_CPUS=999999 +CONFIG_SRAM=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_SYS_SUPPORTS_APM_EMULATION=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_UNCOMPRESS_INCLUDE="mach/uncompress.h" +CONFIG_USB_SUPPORT=y +CONFIG_USE_OF=y +CONFIG_VECTORS_BASE=0xffff0000 +# CONFIG_VFP is not set +CONFIG_WATCHDOG_CORE=y +CONFIG_XZ_DEC_ARM=y +CONFIG_XZ_DEC_BCJ=y +CONFIG_ZBOOT_ROM_BSS=0x0 +CONFIG_ZBOOT_ROM_TEXT=0x0 +CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch new file mode 100644 index 000000000..764f99228 --- /dev/null +++ b/target/linux/orion/patches-4.9/000-arm_openwrt_machtypes.patch @@ -0,0 +1,8 @@ +--- a/arch/arm/tools/mach-types ++++ b/arch/arm/tools/mach-types +@@ -1006,3 +1006,5 @@ eco5_bx2 MACH_ECO5_BX2 ECO5_BX2 4572 + eukrea_cpuimx28sd MACH_EUKREA_CPUIMX28SD EUKREA_CPUIMX28SD 4573 + domotab MACH_DOMOTAB DOMOTAB 4574 + pfla03 MACH_PFLA03 PFLA03 4575 ++dt2 MACH_DT2 DT2 1514 ++wn802t MACH_WN802T WN802T 3306 diff --git a/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch new file mode 100644 index 000000000..89c2c9420 --- /dev/null +++ b/target/linux/orion/patches-4.9/100-wrt350nv2_openwrt_partition_map.patch @@ -0,0 +1,32 @@ +--- a/arch/arm/mach-orion5x/wrt350n-v2-setup.c ++++ b/arch/arm/mach-orion5x/wrt350n-v2-setup.c +@@ -134,11 +134,11 @@ static struct mtd_partition wrt350n_v2_n + { + .name = "kernel", + .offset = 0x00000000, +- .size = 0x00760000, ++ .size = 0x00140000, // change to kernel mtd size here (1/3) + }, { + .name = "rootfs", +- .offset = 0x001a0000, +- .size = 0x005c0000, ++ .offset = 0x00140000, // change to kernel mtd size here (2/3) ++ .size = 0x00610000, // adopt to kernel mtd size here (3/3) = 0x00750000 - + }, { + .name = "lang", + .offset = 0x00760000, +@@ -151,6 +151,14 @@ static struct mtd_partition wrt350n_v2_n + .name = "u-boot", + .offset = 0x007c0000, + .size = 0x00040000, ++ }, { ++ .name = "eRcOmM_do_not_touch", ++ .offset = 0x00750000, ++ .size = 0x00010000, // erasesize ++ }, { ++ .name = "image", // for sysupgrade ++ .offset = 0x00000000, ++ .size = 0x00750000, + }, + }; + diff --git a/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch new file mode 100644 index 000000000..881cfb773 --- /dev/null +++ b/target/linux/orion/patches-4.9/101-wnr854t_partition_map.patch @@ -0,0 +1,25 @@ +--- a/arch/arm/mach-orion5x/wnr854t-setup.c ++++ b/arch/arm/mach-orion5x/wnr854t-setup.c +@@ -57,15 +57,19 @@ static struct mtd_partition wnr854t_nor_ + { + .name = "kernel", + .offset = 0x00000000, +- .size = 0x00100000, ++ .size = 0x00140000, + }, { + .name = "rootfs", +- .offset = 0x00100000, +- .size = 0x00660000, ++ .offset = 0x00140000, ++ .size = 0x00620000, + }, { + .name = "uboot", + .offset = 0x00760000, + .size = 0x00040000, ++ }, { ++ .name = "image", // for sysupgrade ++ .offset = 0x00000000, ++ .size = 0x00760000, + }, + }; + diff --git a/target/linux/orion/patches-4.9/200-dt2_board_support.patch b/target/linux/orion/patches-4.9/200-dt2_board_support.patch new file mode 100644 index 000000000..5528069cd --- /dev/null +++ b/target/linux/orion/patches-4.9/200-dt2_board_support.patch @@ -0,0 +1,562 @@ +--- a/arch/arm/mach-orion5x/Kconfig ++++ b/arch/arm/mach-orion5x/Kconfig +@@ -48,6 +48,13 @@ config MACH_RD88F5182_DT + Say 'Y' here if you want your kernel to support the Marvell + Orion-NAS (88F5182) RD2, Flattened Device Tree. + ++config MACH_DT2 ++ bool "Freecom DataTank Gateway" ++ select I2C_BOARDINFO ++ help ++ Say 'Y' here if you want your kernel to support the ++ Freecom DataTank Gateway ++ + config MACH_KUROBOX_PRO + bool "KuroBox Pro" + select I2C_BOARDINFO if I2C +--- a/arch/arm/mach-orion5x/Makefile ++++ b/arch/arm/mach-orion5x/Makefile +@@ -15,6 +15,7 @@ obj-$(CONFIG_MACH_TS78XX) += ts78xx-setu + obj-$(CONFIG_MACH_MV2120) += mv2120-setup.o + obj-$(CONFIG_MACH_NET2BIG) += net2big-setup.o + obj-$(CONFIG_MACH_WNR854T) += wnr854t-setup.o ++obj-$(CONFIG_MACH_DT2) += dt2-setup.o + obj-$(CONFIG_MACH_RD88F5181L_GE) += rd88f5181l-ge-setup.o + obj-$(CONFIG_MACH_RD88F5181L_FXO) += rd88f5181l-fxo-setup.o + obj-$(CONFIG_MACH_RD88F6183AP_GE) += rd88f6183ap-ge-setup.o +--- /dev/null ++++ b/arch/arm/mach-orion5x/dt2-common.h +@@ -0,0 +1,82 @@ ++#ifndef __INC_DT2_COMMON_H ++#define __INC_DT2_COMMON_H ++ ++#define ATAG_MV_UBOOT 0x41000403 ++ ++struct tag_mv_uboot { ++ u32 uboot_version; ++ u32 tclk; ++ u32 sysclk; ++ u32 isUsbHost; ++ u32 overEthAddr; ++ u8 dt2_eeprom[256]; ++}; ++ ++#define DT2_EEPROM_ADDR 0x50 ++#define DT2_EEPROM_OFFSET 0 ++#define DT2_EEPROM_LENGTH 256 ++ ++#define DT2_SERIAL_NUMBER_DEFAULT "run on default\0" ++#define DT2_REVISION_DEFAULT_INIT 0xFF ++#define DT2_CONFIG_FLAGS_DEFAULT 0x00 ++ ++#define _PACKED_ __attribute__((packed)) ++ ++struct DT2_EEPROM_SD_CONFIG { ++ unsigned int ram_1; ++ unsigned int ram_2; ++ unsigned int ram_3; ++ unsigned int ram_4; ++ unsigned char ram_5; ++ unsigned char ram_6; ++ unsigned short ram_7; ++ unsigned int magic_id; ++ } _PACKED_; // 24 Bytes in total ++ ++struct DT2_EEPROM_FC_CONFIG { ++ unsigned char rtc_sts_mask; ++ unsigned char rtc_sts_init; ++ unsigned char rtc_int_mask; ++ unsigned char rtc_int_init; ++ unsigned char rtc_atrim_init; ++ unsigned char rtc_dtrim_init; ++ unsigned char dummy1; ++ unsigned char dummy2; ++ unsigned char dt2_config_flags; /* 0x80 to load rtc_values to RTC */ ++ unsigned char dt2_revision; /* upper nibble is HW, lower nibble is FW */ ++ unsigned char dt2_serial_number[16]; /* Serial number of DT-2 */ ++ } _PACKED_; // 26 Bytes in total ++ ++#define CFG_LOAD_RTC_VALUES 0x80 ++ ++struct DT2_EEPROM_GW_CONFIG { ++ unsigned int dummy1; ++ unsigned int dummy2; ++ unsigned int dummy3; ++ unsigned char dummy4; ++ unsigned char tos_video_val1; ++ unsigned char tos_video_val2; ++ unsigned char tos_voip_val; ++ unsigned char qos_igmp_cfg; ++ unsigned char num_of_ifs; ++ unsigned short vlan_ports_if[3]; ++ unsigned char mac_addr[3][6]; ++ } _PACKED_; // 42 Bytes in total ++ ++#define _SIZE_OF_ALL_STRUCTS_ (sizeof(struct DT2_EEPROM_SD_CONFIG) + sizeof(struct DT2_EEPROM_FC_CONFIG) + sizeof(struct DT2_EEPROM_GW_CONFIG)) ++ ++// MV = EEPROM - SD - FC - GW - CRC ++struct DT2_EEPROM_MV_CONFIG { ++ unsigned int reg_addr[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)]; ++ unsigned int reg_data[(DT2_EEPROM_LENGTH - _SIZE_OF_ALL_STRUCTS_ - sizeof(unsigned int)) / (sizeof(unsigned int) * 2)]; ++ } _PACKED_; ++ ++struct DT2_EEPROM_STRUCT { ++ struct DT2_EEPROM_MV_CONFIG mv; ++ struct DT2_EEPROM_SD_CONFIG sd; ++ struct DT2_EEPROM_FC_CONFIG fc; ++ struct DT2_EEPROM_GW_CONFIG gw; ++ unsigned int crc; ++ } _PACKED_; ++ ++#endif +--- /dev/null ++++ b/arch/arm/mach-orion5x/dt2-setup.c +@@ -0,0 +1,448 @@ ++/* ++ * arch/arm/mach-orion5x/dt2-setup.c ++ * ++ * Freecom DataTank Gateway Setup ++ * ++ * Copyright (C) 2009 Zintis Petersons ++ * ++ * This file is licensed under the terms of the GNU General Public ++ * License version 2. This program is licensed "as is" without any ++ * warranty of any kind, whether express or implied. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "orion5x.h" ++#include "common.h" ++#include "mpp.h" ++ ++/***************************************************************************** ++ * DT2 local ++ ****************************************************************************/ ++#include ++#include "dt2-common.h" ++ ++u32 mvUbootVer = 0; ++u32 mvTclk = 166666667; ++u32 mvSysclk = 200000000; ++u32 mvIsUsbHost = 1; ++u32 overEthAddr = 0; ++u32 gBoardId = -1; ++struct DT2_EEPROM_STRUCT dt2_eeprom; ++ ++/***************************************************************************** ++ * DT2 Info ++ ****************************************************************************/ ++/* ++ * PCI ++ */ ++ ++#define DT2_PCI_SLOT0_OFFS 7 ++#define DT2_PCI_SLOT0_IRQ_A_PIN 3 ++#define DT2_PCI_SLOT0_IRQ_B_PIN 2 ++ ++#define DT2_PIN_GPIO_SYNC 25 ++#define DT2_PIN_GPIO_POWER 24 ++#define DT2_PIN_GPIO_UNPLUG1 23 ++#define DT2_PIN_GPIO_UNPLUG2 22 ++#define DT2_PIN_GPIO_RESET 4 ++ ++#define DT2_NOR_BOOT_BASE 0xf4000000 ++#define DT2_NOR_BOOT_SIZE SZ_512K ++ ++#define DT2_LEDS_BASE 0xfa000000 ++#define DT2_LEDS_SIZE SZ_1K ++ ++/***************************************************************************** ++ * 512K NOR Flash on Device bus Boot CS ++ ****************************************************************************/ ++ ++static struct mtd_partition dt2_partitions[] = { ++ { ++ .name = "u-boot", ++ .size = 0x00080000, ++ .offset = 0, ++ }, ++}; ++ ++static struct physmap_flash_data dt2_nor_flash_data = { ++ .width = 1, /* 8 bit bus width */ ++ .parts = dt2_partitions, ++ .nr_parts = ARRAY_SIZE(dt2_partitions) ++}; ++ ++static struct resource dt2_nor_flash_resource = { ++ .flags = IORESOURCE_MEM, ++ .start = DT2_NOR_BOOT_BASE, ++ .end = DT2_NOR_BOOT_BASE + DT2_NOR_BOOT_SIZE - 1, ++}; ++ ++static struct platform_device dt2_nor_flash = { ++ .name = "physmap-flash", ++ .id = 0, ++ .dev = { ++ .platform_data = &dt2_nor_flash_data, ++ }, ++ .resource = &dt2_nor_flash_resource, ++ .num_resources = 1, ++}; ++ ++/***************************************************************************** ++ * PCI ++ ****************************************************************************/ ++ ++void __init dt2_pci_preinit(void) ++{ ++ int pin, irq; ++ ++ /* ++ * Configure PCI GPIO IRQ pins ++ */ ++ pin = DT2_PCI_SLOT0_IRQ_A_PIN; ++ if (gpio_request(pin, "PCI IntA") == 0) { ++ if (gpio_direction_input(pin) == 0) { ++ irq = gpio_to_irq(pin); ++ irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); ++ printk (KERN_INFO "PCI IntA IRQ: %d\n", irq); ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to " ++ "irq_set_irq_type pin %d\n", pin); ++ gpio_free(pin); ++ } ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to request gpio %d\n", pin); ++ } ++ ++ pin = DT2_PCI_SLOT0_IRQ_B_PIN; ++ if (gpio_request(pin, "PCI IntB") == 0) { ++ if (gpio_direction_input(pin) == 0) { ++ irq = gpio_to_irq(pin); ++ irq_set_irq_type(irq, IRQ_TYPE_LEVEL_LOW); ++ printk (KERN_INFO "PCI IntB IRQ: %d\n", irq); ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to " ++ "irq_set_irq_type pin %d\n", pin); ++ gpio_free(pin); ++ } ++ } else { ++ printk(KERN_ERR "dt2_pci_preinit failed to gpio_request %d\n", pin); ++ } ++} ++ ++static int __init dt2_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) ++{ ++ int irq; ++ ++ /* ++ * Check for devices with hard-wired IRQs. ++ */ ++ irq = orion5x_pci_map_irq(dev, slot, pin); ++ if (irq != -1){ ++ printk(KERN_INFO "orion5x_pci_map_irq: %d\n", irq); ++ return irq; ++ } ++ ++ /* ++ * PCI IRQs are connected via GPIOs ++ */ ++ switch (slot - DT2_PCI_SLOT0_OFFS) { ++ case 0: ++ if (pin == 1){ ++ irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_A_PIN); ++ printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_A_PIN: %d\n", irq); ++ } ++ else { ++ irq = gpio_to_irq(DT2_PCI_SLOT0_IRQ_B_PIN); ++ printk(KERN_INFO "dt2_pci_map_irq DT2_PCI_SLOT0_IRQ_B_PIN: %d\n", irq); ++ } ++ default: ++ irq = -1; ++ printk(KERN_INFO "dt2_pci_map_irq IRQ: %d\n", irq); ++ } ++ ++ return irq; ++} ++ ++static struct hw_pci dt2_pci __initdata = { ++ .nr_controllers = 2, ++ .preinit = dt2_pci_preinit, ++ .setup = orion5x_pci_sys_setup, ++ .scan = orion5x_pci_sys_scan_bus, ++ .map_irq = dt2_pci_map_irq, ++}; ++ ++static int __init dt2_pci_init(void) ++{ ++ if (machine_is_dt2()) ++ pci_common_init(&dt2_pci); ++ ++ return 0; ++} ++ ++subsys_initcall(dt2_pci_init); ++ ++/***************************************************************************** ++ * Ethernet ++ ****************************************************************************/ ++ ++static struct mv643xx_eth_platform_data dt2_eth_data = { ++ .phy_addr = MV643XX_ETH_PHY_NONE, ++ .speed = SPEED_1000, ++ .duplex = DUPLEX_FULL, ++}; ++ ++static struct dsa_chip_data dt2_switch_chip_data = { ++ .port_names[0] = "wan", ++ .port_names[1] = "lan1", ++ .port_names[2] = "lan2", ++ .port_names[3] = "cpu", ++ .port_names[4] = "lan3", ++ .port_names[5] = "lan4", ++}; ++ ++static struct dsa_platform_data dt2_switch_plat_data = { ++ .nr_chips = 1, ++ .chip = &dt2_switch_chip_data, ++}; ++ ++/***************************************************************************** ++ * RTC ISL1208 on I2C bus ++ ****************************************************************************/ ++static struct i2c_board_info __initdata dt2_i2c_rtc = { ++ I2C_BOARD_INFO("isl1208", 0x6F), ++}; ++ ++/***************************************************************************** ++ * Sata ++ ****************************************************************************/ ++static struct mv_sata_platform_data dt2_sata_data = { ++ .n_ports = 2, ++}; ++ ++/***************************************************************************** ++ * General Setup ++ ****************************************************************************/ ++static unsigned int dt2_mpp_modes[] __initdata = { ++ MPP0_GPIO, // RTC interrupt ++ MPP1_GPIO, // 88e6131 interrupt ++ MPP2_GPIO, // PCI_intB ++ MPP3_GPIO, // PCI_intA ++ MPP4_GPIO, // reset button switch ++ MPP5_GPIO, ++ MPP6_GPIO, ++ MPP7_GPIO, ++ MPP8_GPIO, ++ MPP9_GIGE, /* GE_RXERR */ ++ MPP10_GPIO, // usb ++ MPP11_GPIO, // usb ++ MPP12_GIGE, // GE_TXD[4] ++ MPP13_GIGE, // GE_TXD[5] ++ MPP14_GIGE, // GE_TXD[6] ++ MPP15_GIGE, // GE_TXD[7] ++ MPP16_GIGE, // GE_RXD[4] ++ MPP17_GIGE, // GE_RXD[5] ++ MPP18_GIGE, // GE_RXD[6] ++ MPP19_GIGE, // GE_RXD[7] ++ 0, ++}; ++ ++/***************************************************************************** ++ * LEDS ++ ****************************************************************************/ ++static struct platform_device dt2_leds = { ++ .name = "dt2-led", ++ .id = -1, ++}; ++ ++/**************************************************************************** ++ * GPIO key ++ ****************************************************************************/ ++static irqreturn_t dt2_reset_handler(int irq, void *dev_id) ++{ ++ /* This is the paper-clip reset which does an emergency reboot. */ ++ printk(KERN_INFO "Restarting system.\n"); ++ machine_restart(NULL); ++ ++ /* This should never be reached. */ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t dt2_power_handler(int irq, void *dev_id) ++{ ++ printk(KERN_INFO "Shutting down system.\n"); ++ machine_power_off(); ++ return IRQ_HANDLED; ++} ++ ++static void __init dt2_init(void) ++{ ++ /* ++ * Setup basic Orion functions. Need to be called early. ++ */ ++ orion5x_init(); ++ ++ orion5x_mpp_conf(dt2_mpp_modes); ++ ++ /* ++ * Configure peripherals. ++ */ ++ ++ orion5x_uart0_init(); ++ orion5x_ehci0_init(); ++ orion5x_ehci1_init(); ++ orion5x_i2c_init(); ++ orion5x_sata_init(&dt2_sata_data); ++ orion5x_xor_init(); ++ ++ printk(KERN_INFO "U-Boot parameters:\n"); ++ printk(KERN_INFO "Sys Clk = %d, Tclk = %d, BoardID = 0x%02x\n", mvSysclk, mvTclk, gBoardId); ++ ++ printk(KERN_INFO "Serial: %s\n", dt2_eeprom.fc.dt2_serial_number); ++ printk(KERN_INFO "Revision: %016x\n", dt2_eeprom.fc.dt2_revision); ++ printk(KERN_INFO "DT2: Using MAC address %pM for port 0\n", ++ dt2_eeprom.gw.mac_addr[0]); ++ printk(KERN_INFO "DT2: Using MAC address %pM for port 1\n", ++ dt2_eeprom.gw.mac_addr[1]); ++ ++ orion5x_eth_init(&dt2_eth_data); ++ memcpy(dt2_eth_data.mac_addr, dt2_eeprom.gw.mac_addr[0], 6); ++ orion5x_eth_switch_init(&dt2_switch_plat_data); ++ ++ i2c_register_board_info(0, &dt2_i2c_rtc, 1); ++ ++ mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET, ++ ORION_MBUS_DEVBUS_BOOT_ATTR, ++ DT2_NOR_BOOT_BASE, DT2_NOR_BOOT_SIZE); ++ ++ platform_device_register(&dt2_nor_flash); ++ ++ mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_TARGET(0), ++ ORION_MBUS_DEVBUS_ATTR(0), ++ DT2_LEDS_BASE, DT2_LEDS_SIZE); ++ platform_device_register(&dt2_leds); ++ ++ if (request_irq(gpio_to_irq(DT2_PIN_GPIO_RESET), &dt2_reset_handler, ++ IRQF_TRIGGER_LOW, ++ "DT2: Reset button", NULL) < 0) { ++ ++ printk("DT2: Reset Button IRQ %d not available\n", ++ gpio_to_irq(DT2_PIN_GPIO_RESET)); ++ } ++ ++ if (request_irq(gpio_to_irq(DT2_PIN_GPIO_POWER), &dt2_power_handler, ++ IRQF_TRIGGER_LOW, ++ "DT2: Power button", NULL) < 0) { ++ ++ printk(KERN_DEBUG "DT2: Power Button IRQ %d not available\n", ++ gpio_to_irq(DT2_PIN_GPIO_POWER)); ++ } ++} ++ ++static int __init parse_tag_dt2_uboot(const struct tag *t) ++{ ++ struct tag_mv_uboot *mv_uboot; ++ ++ // Get pointer to our block ++ mv_uboot = (struct tag_mv_uboot*)&t->u; ++ mvTclk = mv_uboot->tclk; ++ mvSysclk = mv_uboot->sysclk; ++ mvUbootVer = mv_uboot->uboot_version; ++ mvIsUsbHost = mv_uboot->isUsbHost; ++ ++ // Some clock fixups ++ if(mvTclk == 166000000) mvTclk = 166666667; ++ else if(mvTclk == 133000000) mvTclk = 133333333; ++ else if(mvSysclk == 166000000) mvSysclk = 166666667; ++ ++ gBoardId = (mvUbootVer & 0xff); ++ ++ //DT2 specific data ++ memcpy(&dt2_eeprom, mv_uboot->dt2_eeprom, sizeof(struct DT2_EEPROM_STRUCT)); ++ ++ return 0; ++} ++__tagtable(ATAG_MV_UBOOT, parse_tag_dt2_uboot); ++ ++/* ++ * This is OpenWrt specific fixup. It includes code from original "tag_fixup_mem32" to ++ * fixup bogus memory tags and also fixes kernel cmdline by adding " init=/etc/preinit" ++ * at the end. It is important to flash OpenWrt image from original Freecom firmware. ++ * ++ * Vanilla kernel should use "tag_fixup_mem32" function. ++ */ ++static void __init openwrt_fixup(struct tag *t, char **from) ++{ ++ char *p = NULL; ++ static char openwrt_init_tag[] __initdata = " init=/etc/preinit"; ++ ++ for (; t->hdr.size; t = tag_next(t)){ ++ /* Locate the Freecom cmdline */ ++ if (t->hdr.tag == ATAG_CMDLINE) { ++ p = t->u.cmdline.cmdline; ++ printk("%s(%d): Found cmdline '%s' at 0x%0lx\n", ++ __FUNCTION__, __LINE__, p, (unsigned long)p); ++ } ++ /* ++ * Many orion-based systems have buggy bootloader implementations. ++ * This is a common fixup for bogus memory tags. ++ */ ++ if (t->hdr.tag == ATAG_MEM && ++ (!t->u.mem.size || t->u.mem.size & ~PAGE_MASK || ++ t->u.mem.start & ~PAGE_MASK)) { ++ printk(KERN_WARNING ++ "Clearing invalid memory bank %dKB@0x%08x\n", ++ t->u.mem.size / 1024, t->u.mem.start); ++ t->hdr.tag = 0; ++ } ++ } ++ ++ printk("%s(%d): End of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t); ++ ++ /* Overwrite the end of the table with a new cmdline tag. */ ++ t->hdr.tag = ATAG_CMDLINE; ++ t->hdr.size = ++ (sizeof (struct tag_header) + ++ strlen(p) + strlen(openwrt_init_tag) + 1 + 4) >> 2; ++ ++ strlcpy(t->u.cmdline.cmdline, p, COMMAND_LINE_SIZE); ++ strlcpy(t->u.cmdline.cmdline + strlen(p), openwrt_init_tag, ++ COMMAND_LINE_SIZE - strlen(p)); ++ ++ printk("%s(%d): New cmdline '%s' at 0x%0lx\n", ++ __FUNCTION__, __LINE__, ++ t->u.cmdline.cmdline, (unsigned long)t->u.cmdline.cmdline); ++ ++ t = tag_next(t); ++ ++ printk("%s(%d): New end of table at 0x%0lx\n", __FUNCTION__, __LINE__, (unsigned long)t); ++ ++ t->hdr.tag = ATAG_NONE; ++ t->hdr.size = 0; ++} ++ ++/* Warning: Freecom uses their own custom bootloader with mach-type (=1500) */ ++MACHINE_START(DT2, "Freecom DataTank Gateway") ++ /* Maintainer: Zintis Petersons */ ++ .atag_offset = 0x100, ++ .init_machine = dt2_init, ++ .map_io = orion5x_map_io, ++ .init_irq = orion5x_init_irq, ++ .init_time = orion5x_timer_init, ++ .fixup = openwrt_fixup, //tag_fixup_mem32, ++MACHINE_END diff --git a/target/linux/orion/patches-4.9/210-wn802t_support.patch b/target/linux/orion/patches-4.9/210-wn802t_support.patch new file mode 100644 index 000000000..a274beedc --- /dev/null +++ b/target/linux/orion/patches-4.9/210-wn802t_support.patch @@ -0,0 +1,73 @@ +--- a/arch/arm/mach-orion5x/Kconfig ++++ b/arch/arm/mach-orion5x/Kconfig +@@ -159,10 +159,13 @@ config MACH_MSS2_DT + Maxtor Shared Storage II platform. + + config MACH_WNR854T +- bool "Netgear WNR854T" ++ bool "Netgear WNR854T / WN802T" + help + Say 'Y' here if you want your kernel to support the +- Netgear WNR854T platform. ++ Netgear WNR854T or WN802T platform. ++ ++config MACH_WN802T ++ def_bool MACH_WNR854T + + config MACH_RD88F5181L_GE + bool "Marvell Orion-VoIP GE Reference Design" +--- a/arch/arm/mach-orion5x/wnr854t-setup.c ++++ b/arch/arm/mach-orion5x/wnr854t-setup.c +@@ -115,6 +115,15 @@ static struct dsa_platform_data __initda + .chip = &wnr854t_switch_chip_data, + }; + ++static struct dsa_chip_data wn802t_switch_chip_data = { ++ .port_names[2] = "wan", ++ .port_names[3] = "cpu", ++}; ++ ++static struct dsa_platform_data wn802t_switch_plat_data = { ++ .nr_chips = 1, ++ .chip = &wn802t_switch_chip_data, ++}; + static void __init wnr854t_init(void) + { + /* +@@ -128,7 +137,10 @@ static void __init wnr854t_init(void) + * Configure peripherals. + */ + orion5x_eth_init(&wnr854t_eth_data); +- orion5x_eth_switch_init(&wnr854t_switch_plat_data); ++ if (machine_is_wn802t()) ++ orion5x_eth_switch_init(&wn802t_switch_plat_data); ++ else ++ orion5x_eth_switch_init(&wnr854t_switch_plat_data); + orion5x_uart0_init(); + + mvebu_mbus_add_window_by_id(ORION_MBUS_DEVBUS_BOOT_TARGET, +@@ -168,7 +180,7 @@ static struct hw_pci wnr854t_pci __initd + + static int __init wnr854t_pci_init(void) + { +- if (machine_is_wnr854t()) ++ if (machine_is_wnr854t() || machine_is_wn802t()) + pci_common_init(&wnr854t_pci); + + return 0; +@@ -187,3 +199,15 @@ MACHINE_START(WNR854T, "Netgear WNR854T" + .fixup = tag_fixup_mem32, + .restart = orion5x_restart, + MACHINE_END ++ ++MACHINE_START(WN802T, "Netgear WN802T") ++ /* Maintainer: Imre Kaloz */ ++ .atag_offset = 0x100, ++ .init_machine = wnr854t_init, ++ .map_io = orion5x_map_io, ++ .init_early = orion5x_init_early, ++ .init_irq = orion5x_init_irq, ++ .init_time = orion5x_timer_init, ++ .fixup = tag_fixup_mem32, ++ .restart = orion5x_restart, ++MACHINE_END diff --git a/target/linux/pistachio/config-4.9 b/target/linux/pistachio/config-4.9 index 121f6a8c1..a417a6b06 100644 --- a/target/linux/pistachio/config-4.9 +++ b/target/linux/pistachio/config-4.9 @@ -216,6 +216,7 @@ CONFIG_MTD_SPI_NAND=y CONFIG_MTD_SPI_NAND_DEVICES=y CONFIG_MTD_SPI_NOR=y CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=16384 CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y diff --git a/target/linux/rb532/Makefile b/target/linux/rb532/Makefile index e95524aed..7979bb4b8 100644 --- a/target/linux/rb532/Makefile +++ b/target/linux/rb532/Makefile @@ -10,8 +10,9 @@ ARCH:=mipsel BOARD:=rb532 BOARDNAME:=Mikrotik RouterBoard 532 FEATURES:=pci targz squashfs minor nand +MAINTAINER:=Roman Yeryomin -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/rb532/base-files/etc/config/network b/target/linux/rb532/base-files/etc/config/network index 75a14a730..c689d6327 100644 --- a/target/linux/rb532/base-files/etc/config/network +++ b/target/linux/rb532/base-files/etc/config/network @@ -11,6 +11,7 @@ config interface wan option proto dhcp config interface lan + option type bridge option ifname eth2 option proto static option ipaddr 192.168.1.1 diff --git a/target/linux/rb532/config-4.4 b/target/linux/rb532/config-4.9 similarity index 98% rename from target/linux/rb532/config-4.4 rename to target/linux/rb532/config-4.9 index 7d0bb3ab1..9290a1869 100644 --- a/target/linux/rb532/config-4.4 +++ b/target/linux/rb532/config-4.9 @@ -61,7 +61,6 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GLOB=y CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y CONFIG_GPIO_SYSFS=y CONFIG_HARDWARE_WATCHPOINTS=y CONFIG_HAS_DMA=y @@ -74,7 +73,6 @@ CONFIG_HAVE_ARCH_KGDB=y CONFIG_HAVE_ARCH_SECCOMP_FILTER=y CONFIG_HAVE_ARCH_TRACEHOOK=y # CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y CONFIG_HAVE_CC_STACKPROTECTOR=y CONFIG_HAVE_CONTEXT_TRACKING=y CONFIG_HAVE_C_RECORDMCOUNT=y @@ -89,7 +87,6 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_HAVE_IDE=y -CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y CONFIG_HAVE_LATENCYTOP_SUPPORT=y CONFIG_HAVE_MEMBLOCK=y @@ -100,6 +97,7 @@ CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +# CONFIG_HIGH_RES_TIMERS is not set CONFIG_HW_HAS_PCI=y CONFIG_HW_RANDOM=y CONFIG_HZ=250 @@ -157,6 +155,7 @@ CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_RC32434_WDT=y # CONFIG_RCU_STALL_COMMON is not set +# CONFIG_SCHED_HRTICK is not set # CONFIG_SCHED_INFO is not set CONFIG_SCSI=y # CONFIG_SCSI_LOWLEVEL is not set diff --git a/target/linux/rb532/image/Makefile b/target/linux/rb532/image/Makefile index 06255c60e..12265fe2c 100644 --- a/target/linux/rb532/image/Makefile +++ b/target/linux/rb532/image/Makefile @@ -85,7 +85,7 @@ define Image/Build $(CP) $(KDIR)/vmlinux.elf $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel $(STAGING_DIR_HOST)/bin/patch-cmdline $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel 'root=/dev/sda2 ' ./gen_image.sh $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).bin \ - 5 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel \ + 6 $(BIN_DIR)/$(IMG_PREFIX)-$(1).kernel \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1) \ 128 endef diff --git a/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch b/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch deleted file mode 100644 index 3172d0384..000000000 --- a/target/linux/rb532/patches-4.4/002-rb532_nand_fixup.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/arch/mips/rb532/devices.c -+++ b/arch/mips/rb532/devices.c -@@ -141,6 +141,19 @@ static struct platform_device cf_slot0 = - }; - - /* Resources and device for NAND */ -+ -+/* -+ * We need to use the OLD Yaffs-1 OOB layout, otherwise the RB bootloader -+ * will not be able to find the kernel that we load. So set the oobinfo -+ * when creating the partitions -+ */ -+static struct nand_ecclayout rb532_nand_ecclayout = { -+ .eccbytes = 6, -+ .eccpos = { 8, 9, 10, 13, 14, 15 }, -+ .oobavail = 9, -+ .oobfree = { { 0, 4 }, { 6, 2 }, { 11, 2 }, { 4, 1 } } -+}; -+ - static int rb532_dev_ready(struct mtd_info *mtd) - { - return gpio_get_value(GPIO_RDY); -@@ -255,6 +268,16 @@ static struct platform_device *rb532_dev - /* NAND definitions */ - #define NAND_CHIP_DELAY 25 - -+static int rb532_nand_fixup(struct mtd_info *mtd) -+{ -+ struct nand_chip *chip = mtd->priv; -+ -+ if (mtd->writesize == 512) -+ chip->ecc.layout = &rb532_nand_ecclayout; -+ -+ return 0; -+} -+ - static void __init rb532_nand_setup(void) - { - switch (mips_machtype) { -@@ -273,6 +296,7 @@ static void __init rb532_nand_setup(void - rb532_nand_data.chip.nr_partitions = ARRAY_SIZE(rb532_partition_info); - rb532_nand_data.chip.partitions = rb532_partition_info; - rb532_nand_data.chip.chip_delay = NAND_CHIP_DELAY; -+ rb532_nand_data.chip.chip_fixup = &rb532_nand_fixup; - } - - diff --git a/target/linux/rb532/patches-4.4/001-cmdline_hack.patch b/target/linux/rb532/patches-4.9/001-cmdline_hack.patch similarity index 100% rename from target/linux/rb532/patches-4.4/001-cmdline_hack.patch rename to target/linux/rb532/patches-4.9/001-cmdline_hack.patch diff --git a/target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch b/target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch similarity index 85% rename from target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch rename to target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch index fd23e09e4..5161a233d 100644 --- a/target/linux/rb532/patches-4.4/004-rb532-fix-partition-info.patch +++ b/target/linux/rb532/patches-4.9/004-rb532-fix-partition-info.patch @@ -1,6 +1,6 @@ --- a/arch/mips/rb532/devices.c +++ b/arch/mips/rb532/devices.c -@@ -199,11 +199,11 @@ static struct platform_device nand_slot0 +@@ -186,11 +186,11 @@ static struct platform_device nand_slot0 static struct mtd_partition rb532_partition_info[] = { { diff --git a/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch b/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch new file mode 100644 index 000000000..e75079b12 --- /dev/null +++ b/target/linux/rb532/patches-4.9/106-dont-use-rx-overflow-and-tx-underflow-interrupts.patch @@ -0,0 +1,156 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -122,8 +122,6 @@ struct korina_private { + + int rx_irq; + int tx_irq; +- int ovr_irq; +- int und_irq; + + spinlock_t lock; /* NIC xmit lock */ + +@@ -890,8 +888,6 @@ static void korina_restart_task(struct w + */ + disable_irq(lp->rx_irq); + disable_irq(lp->tx_irq); +- disable_irq(lp->ovr_irq); +- disable_irq(lp->und_irq); + + writel(readl(&lp->tx_dma_regs->dmasm) | + DMA_STAT_FINI | DMA_STAT_ERR, +@@ -910,40 +906,10 @@ static void korina_restart_task(struct w + } + korina_multicast_list(dev); + +- enable_irq(lp->und_irq); +- enable_irq(lp->ovr_irq); + enable_irq(lp->tx_irq); + enable_irq(lp->rx_irq); + } + +-static void korina_clear_and_restart(struct net_device *dev, u32 value) +-{ +- struct korina_private *lp = netdev_priv(dev); +- +- netif_stop_queue(dev); +- writel(value, &lp->eth_regs->ethintfc); +- schedule_work(&lp->restart_task); +-} +- +-/* Ethernet Tx Underflow interrupt */ +-static irqreturn_t korina_und_interrupt(int irq, void *dev_id) +-{ +- struct net_device *dev = dev_id; +- struct korina_private *lp = netdev_priv(dev); +- unsigned int und; +- +- spin_lock(&lp->lock); +- +- und = readl(&lp->eth_regs->ethintfc); +- +- if (und & ETH_INT_FC_UND) +- korina_clear_and_restart(dev, und & ~ETH_INT_FC_UND); +- +- spin_unlock(&lp->lock); +- +- return IRQ_HANDLED; +-} +- + static void korina_tx_timeout(struct net_device *dev) + { + struct korina_private *lp = netdev_priv(dev); +@@ -951,25 +917,6 @@ static void korina_tx_timeout(struct net + schedule_work(&lp->restart_task); + } + +-/* Ethernet Rx Overflow interrupt */ +-static irqreturn_t +-korina_ovr_interrupt(int irq, void *dev_id) +-{ +- struct net_device *dev = dev_id; +- struct korina_private *lp = netdev_priv(dev); +- unsigned int ovr; +- +- spin_lock(&lp->lock); +- ovr = readl(&lp->eth_regs->ethintfc); +- +- if (ovr & ETH_INT_FC_OVR) +- korina_clear_and_restart(dev, ovr & ~ETH_INT_FC_OVR); +- +- spin_unlock(&lp->lock); +- +- return IRQ_HANDLED; +-} +- + #ifdef CONFIG_NET_POLL_CONTROLLER + static void korina_poll_controller(struct net_device *dev) + { +@@ -992,8 +939,7 @@ static int korina_open(struct net_device + } + + /* Install the interrupt handler +- * that handles the Done Finished +- * Ovr and Und Events */ ++ * that handles the Done Finished */ + ret = request_irq(lp->rx_irq, korina_rx_dma_interrupt, + 0, "Korina ethernet Rx", dev); + if (ret < 0) { +@@ -1009,31 +955,10 @@ static int korina_open(struct net_device + goto err_free_rx_irq; + } + +- /* Install handler for overrun error. */ +- ret = request_irq(lp->ovr_irq, korina_ovr_interrupt, +- 0, "Ethernet Overflow", dev); +- if (ret < 0) { +- printk(KERN_ERR "%s: unable to get OVR IRQ %d\n", +- dev->name, lp->ovr_irq); +- goto err_free_tx_irq; +- } +- +- /* Install handler for underflow error. */ +- ret = request_irq(lp->und_irq, korina_und_interrupt, +- 0, "Ethernet Underflow", dev); +- if (ret < 0) { +- printk(KERN_ERR "%s: unable to get UND IRQ %d\n", +- dev->name, lp->und_irq); +- goto err_free_ovr_irq; +- } + mod_timer(&lp->media_check_timer, jiffies + 1); + out: + return ret; + +-err_free_ovr_irq: +- free_irq(lp->ovr_irq, dev); +-err_free_tx_irq: +- free_irq(lp->tx_irq, dev); + err_free_rx_irq: + free_irq(lp->rx_irq, dev); + err_release: +@@ -1051,8 +976,6 @@ static int korina_close(struct net_devic + /* Disable interrupts */ + disable_irq(lp->rx_irq); + disable_irq(lp->tx_irq); +- disable_irq(lp->ovr_irq); +- disable_irq(lp->und_irq); + + korina_abort_tx(dev); + tmp = readl(&lp->tx_dma_regs->dmasm); +@@ -1072,8 +995,6 @@ static int korina_close(struct net_devic + + free_irq(lp->rx_irq, dev); + free_irq(lp->tx_irq, dev); +- free_irq(lp->ovr_irq, dev); +- free_irq(lp->und_irq, dev); + + return 0; + } +@@ -1113,8 +1034,6 @@ static int korina_probe(struct platform_ + + lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx"); + lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx"); +- lp->ovr_irq = platform_get_irq_byname(pdev, "korina_ovr"); +- lp->und_irq = platform_get_irq_byname(pdev, "korina_und"); + + r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "korina_regs"); + dev->base_addr = r->start; diff --git a/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch b/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch new file mode 100644 index 000000000..80745f534 --- /dev/null +++ b/target/linux/rb532/patches-4.9/107-korina-refactor-rx-descriptor-flags-processing.patch @@ -0,0 +1,110 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -363,59 +363,60 @@ static int korina_rx(struct net_device * + if ((KORINA_RBSIZE - (u32)DMA_COUNT(rd->control)) == 0) + break; + +- /* Update statistics counters */ +- if (devcs & ETH_RX_CRC) +- dev->stats.rx_crc_errors++; +- if (devcs & ETH_RX_LOR) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_LE) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_OVR) +- dev->stats.rx_fifo_errors++; +- if (devcs & ETH_RX_CV) +- dev->stats.rx_frame_errors++; +- if (devcs & ETH_RX_CES) +- dev->stats.rx_length_errors++; +- if (devcs & ETH_RX_MP) +- dev->stats.multicast++; ++ /* check that this is a whole packet ++ * WARNING: DMA_FD bit incorrectly set ++ * in Rc32434 (errata ref #077) */ ++ if (!(devcs & ETH_RX_LD)) ++ goto next; + +- if ((devcs & ETH_RX_LD) != ETH_RX_LD) { +- /* check that this is a whole packet +- * WARNING: DMA_FD bit incorrectly set +- * in Rc32434 (errata ref #077) */ ++ if (!(devcs & ETH_RX_ROK)) { ++ /* Update statistics counters */ + dev->stats.rx_errors++; + dev->stats.rx_dropped++; +- } else if ((devcs & ETH_RX_ROK)) { +- pkt_len = RCVPKT_LENGTH(devcs); ++ if (devcs & ETH_RX_CRC) ++ dev->stats.rx_crc_errors++; ++ if (devcs & ETH_RX_LE) ++ dev->stats.rx_length_errors++; ++ if (devcs & ETH_RX_OVR) ++ dev->stats.rx_fifo_errors++; ++ if (devcs & ETH_RX_CV) ++ dev->stats.rx_frame_errors++; ++ if (devcs & ETH_RX_CES) ++ dev->stats.rx_frame_errors++; + +- /* must be the (first and) last +- * descriptor then */ +- pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; +- +- /* invalidate the cache */ +- dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); +- +- /* Malloc up new buffer. */ +- skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE); +- +- if (!skb_new) +- break; +- /* Do not count the CRC */ +- skb_put(skb, pkt_len - 4); +- skb->protocol = eth_type_trans(skb, dev); +- +- /* Pass the packet to upper layers */ +- netif_receive_skb(skb); +- dev->stats.rx_packets++; +- dev->stats.rx_bytes += pkt_len; +- +- /* Update the mcast stats */ +- if (devcs & ETH_RX_MP) +- dev->stats.multicast++; +- +- lp->rx_skb[lp->rx_next_done] = skb_new; ++ goto next; + } + ++ pkt_len = RCVPKT_LENGTH(devcs); ++ ++ /* must be the (first and) last ++ * descriptor then */ ++ pkt_buf = (u8 *)lp->rx_skb[lp->rx_next_done]->data; ++ ++ /* invalidate the cache */ ++ dma_cache_inv((unsigned long)pkt_buf, pkt_len - 4); ++ ++ /* Malloc up new buffer. */ ++ skb_new = netdev_alloc_skb_ip_align(dev, KORINA_RBSIZE); ++ ++ if (!skb_new) ++ break; ++ /* Do not count the CRC */ ++ skb_put(skb, pkt_len - 4); ++ skb->protocol = eth_type_trans(skb, dev); ++ ++ /* Pass the packet to upper layers */ ++ netif_receive_skb(skb); ++ dev->stats.rx_packets++; ++ dev->stats.rx_bytes += pkt_len; ++ ++ /* Update the mcast stats */ ++ if (devcs & ETH_RX_MP) ++ dev->stats.multicast++; ++ ++ lp->rx_skb[lp->rx_next_done] = skb_new; ++ ++next: + rd->devcs = 0; + + /* Restore descriptor's curr_addr */ diff --git a/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch b/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch new file mode 100644 index 000000000..d4af90636 --- /dev/null +++ b/target/linux/rb532/patches-4.9/107-use-NAPI_POLL_WEIGHT.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -1082,7 +1082,7 @@ static int korina_probe(struct platform_ + dev->netdev_ops = &korina_netdev_ops; + dev->ethtool_ops = &netdev_ethtool_ops; + dev->watchdog_timeo = TX_TIMEOUT; +- netif_napi_add(dev, &lp->napi, korina_poll, 64); ++ netif_napi_add(dev, &lp->napi, korina_poll, NAPI_POLL_WEIGHT); + + lp->phy_addr = (((lp->rx_irq == 0x2c? 1:0) << 8) | 0x05); + lp->mii_if.dev = dev; diff --git a/target/linux/rb532/patches-4.9/108-korina-use-gro.patch b/target/linux/rb532/patches-4.9/108-korina-use-gro.patch new file mode 100644 index 000000000..8cbe2a077 --- /dev/null +++ b/target/linux/rb532/patches-4.9/108-korina-use-gro.patch @@ -0,0 +1,11 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -406,7 +406,7 @@ static int korina_rx(struct net_device * + skb->protocol = eth_type_trans(skb, dev); + + /* Pass the packet to upper layers */ +- netif_receive_skb(skb); ++ napi_gro_receive(&lp->napi, skb); + dev->stats.rx_packets++; + dev->stats.rx_bytes += pkt_len; + diff --git a/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch b/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch new file mode 100644 index 000000000..026543395 --- /dev/null +++ b/target/linux/rb532/patches-4.9/109-korina-whitespace-cleanup-2.patch @@ -0,0 +1,135 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -64,9 +64,9 @@ + #include + #include + +-#define DRV_NAME "korina" +-#define DRV_VERSION "0.10" +-#define DRV_RELDATE "04Mar2008" ++#define DRV_NAME "korina" ++#define DRV_VERSION "0.10" ++#define DRV_RELDATE "04Mar2008" + + #define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \ + ((dev)->dev_addr[1])) +@@ -75,7 +75,7 @@ + ((dev)->dev_addr[4] << 8) | \ + ((dev)->dev_addr[5])) + +-#define MII_CLOCK 1250000 /* no more than 2.5MHz */ ++#define MII_CLOCK 1250000 /* no more than 2.5MHz */ + + /* the following must be powers of two */ + #define KORINA_NUM_RDS 64 /* number of receive descriptors */ +@@ -87,15 +87,19 @@ + #define KORINA_RBSIZE 1536 /* size of one resource buffer = Ether MTU */ + #define KORINA_RDS_MASK (KORINA_NUM_RDS - 1) + #define KORINA_TDS_MASK (KORINA_NUM_TDS - 1) +-#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) ++#define RD_RING_SIZE (KORINA_NUM_RDS * sizeof(struct dma_desc)) + #define TD_RING_SIZE (KORINA_NUM_TDS * sizeof(struct dma_desc)) + +-#define TX_TIMEOUT (6000 * HZ / 1000) ++#define TX_TIMEOUT (6000 * HZ / 1000) + +-enum chain_status { desc_filled, desc_empty }; +-#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) +-#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) +-#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) ++enum chain_status { ++ desc_filled, ++ desc_empty ++}; ++ ++#define IS_DMA_FINISHED(X) (((X) & (DMA_DESC_FINI)) != 0) ++#define IS_DMA_DONE(X) (((X) & (DMA_DESC_DONE)) != 0) ++#define RCVPKT_LENGTH(X) (((X) & ETH_RX_LEN) >> ETH_RX_LEN_BIT) + + /* Information that need to be kept for each board. */ + struct korina_private { +@@ -123,7 +127,7 @@ struct korina_private { + int rx_irq; + int tx_irq; + +- spinlock_t lock; /* NIC xmit lock */ ++ spinlock_t lock; /* NIC xmit lock */ + + int dma_halt_cnt; + int dma_run_cnt; +@@ -146,17 +150,17 @@ static inline void korina_start_dma(stru + static inline void korina_abort_dma(struct net_device *dev, + struct dma_reg *ch) + { +- if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { +- writel(0x10, &ch->dmac); ++ if (readl(&ch->dmac) & DMA_CHAN_RUN_BIT) { ++ writel(0x10, &ch->dmac); + +- while (!(readl(&ch->dmas) & DMA_STAT_HALT)) +- netif_trans_update(dev); ++ while (!(readl(&ch->dmas) & DMA_STAT_HALT)) ++ netif_trans_update(dev); + +- writel(0, &ch->dmas); +- } ++ writel(0, &ch->dmas); ++ } + +- writel(0, &ch->dmadptr); +- writel(0, &ch->dmandptr); ++ writel(0, &ch->dmadptr); ++ writel(0, &ch->dmandptr); + } + + static inline void korina_chain_dma(struct dma_reg *ch, u32 dma_addr) +@@ -685,7 +689,7 @@ static int korina_ioctl(struct net_devic + + /* ethtool helpers */ + static void netdev_get_drvinfo(struct net_device *dev, +- struct ethtool_drvinfo *info) ++ struct ethtool_drvinfo *info) + { + struct korina_private *lp = netdev_priv(dev); + +@@ -727,10 +731,10 @@ static u32 netdev_get_link(struct net_de + } + + static const struct ethtool_ops netdev_ethtool_ops = { +- .get_drvinfo = netdev_get_drvinfo, +- .get_settings = netdev_get_settings, +- .set_settings = netdev_set_settings, +- .get_link = netdev_get_link, ++ .get_drvinfo = netdev_get_drvinfo, ++ .get_settings = netdev_get_settings, ++ .set_settings = netdev_set_settings, ++ .get_link = netdev_get_link, + }; + + static int korina_alloc_ring(struct net_device *dev) +@@ -862,7 +866,7 @@ static int korina_init(struct net_device + /* Management Clock Prescaler Divisor + * Clock independent setting */ + writel(((idt_cpu_freq) / MII_CLOCK + 1) & ~1, +- &lp->eth_regs->ethmcp); ++ &lp->eth_regs->ethmcp); + + /* don't transmit until fifo contains 48b */ + writel(48, &lp->eth_regs->ethfifott); +@@ -945,14 +949,14 @@ static int korina_open(struct net_device + 0, "Korina ethernet Rx", dev); + if (ret < 0) { + printk(KERN_ERR "%s: unable to get Rx DMA IRQ %d\n", +- dev->name, lp->rx_irq); ++ dev->name, lp->rx_irq); + goto err_release; + } + ret = request_irq(lp->tx_irq, korina_tx_dma_interrupt, + 0, "Korina ethernet Tx", dev); + if (ret < 0) { + printk(KERN_ERR "%s: unable to get Tx DMA IRQ %d\n", +- dev->name, lp->tx_irq); ++ dev->name, lp->tx_irq); + goto err_free_rx_irq; + } + diff --git a/target/linux/rb532/patches-4.9/110-korina-update-authors.patch b/target/linux/rb532/patches-4.9/110-korina-update-authors.patch new file mode 100644 index 000000000..843397cf3 --- /dev/null +++ b/target/linux/rb532/patches-4.9/110-korina-update-authors.patch @@ -0,0 +1,17 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -4,6 +4,7 @@ + * Copyright 2004 IDT Inc. (rischelp@idt.com) + * Copyright 2006 Felix Fietkau + * Copyright 2008 Florian Fainelli ++ * Copyright 2017 Roman Yeryomin + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the +@@ -1150,5 +1151,6 @@ module_platform_driver(korina_driver); + MODULE_AUTHOR("Philip Rischel "); + MODULE_AUTHOR("Felix Fietkau "); + MODULE_AUTHOR("Florian Fainelli "); ++MODULE_AUTHOR("Roman Yeryomin "); + MODULE_DESCRIPTION("IDT RC32434 (Korina) Ethernet driver"); + MODULE_LICENSE("GPL"); diff --git a/target/linux/rb532/patches-4.9/111-korina-version-bump.patch b/target/linux/rb532/patches-4.9/111-korina-version-bump.patch new file mode 100644 index 000000000..1501e174b --- /dev/null +++ b/target/linux/rb532/patches-4.9/111-korina-version-bump.patch @@ -0,0 +1,13 @@ +--- a/drivers/net/ethernet/korina.c ++++ b/drivers/net/ethernet/korina.c +@@ -66,8 +66,8 @@ + #include + + #define DRV_NAME "korina" +-#define DRV_VERSION "0.10" +-#define DRV_RELDATE "04Mar2008" ++#define DRV_VERSION "0.20" ++#define DRV_RELDATE "15Sep2017" + + #define STATION_ADDRESS_HIGH(dev) (((dev)->dev_addr[0] << 8) | \ + ((dev)->dev_addr[1])) diff --git a/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt b/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt new file mode 100644 index 000000000..9baa5c33b --- /dev/null +++ b/target/linux/sunxi/base-files/lib/firmware/brcm/brcmfmac43430-sdio.txt @@ -0,0 +1,53 @@ +#AP6212_NVRAM_V1.0_20140603 +# 2.4 GHz, 20 MHz BW mode + +# The following parameter values are just placeholders, need to be updated. +manfid=0x2d0 +prodid=0x0726 +vendid=0x14e4 +devid=0x43e2 +boardtype=0x0726 +boardrev=0x1101 +boardnum=22 +macaddr=00:90:4c:c5:12:38 +sromrev=11 +boardflags=0x00404201 +xtalfreq=26000 +nocrc=1 +ag0=255 +aa2g=1 +ccode=ALL + +pa0itssit=0x20 +extpagain2g=0 + +#PA parameters for 2.4GHz, measured at CHIP OUTPUT +pa2ga0=-168,7161,-820 +AvVmid_c0=0x0,0xc8 +cckpwroffset0=5 + +# PPR params +maxp2ga0=90 +txpwrbckof=6 +cckbw202gpo=0x5555 +legofdmbw202gpo=0x77777777 +mcsbw202gpo=0xaaaaaaaa + +# OFDM IIR : +ofdmdigfilttype=7 +# PAPD mode: +papdmode=2 + +il0macaddr=00:90:4c:c5:12:38 +wl0id=0x431b + +#OOB parameters +hostwake=0x40 +hostrdy=0x41 +usbrdy=0x03 +usbrdydelay=100 +deadman_to=0xffffffff +# muxenab: 0x1 for UART enable, 0x10 for Host awake +muxenab=0x10 +# CLDO PWM voltage settings - 0x4 - 1.1 volt +#cldo_pwm=0x4 diff --git a/target/linux/sunxi/config-4.4 b/target/linux/sunxi/config-4.4 deleted file mode 100644 index 907fc5096..000000000 --- a/target/linux/sunxi/config-4.4 +++ /dev/null @@ -1,549 +0,0 @@ -CONFIG_ADVISE_SYSCALLS=y -# CONFIG_AHCI_SUNXI is not set -CONFIG_ALIGNMENT_TRAP=y -# CONFIG_APM_EMULATION is not set -# CONFIG_ARCH_AXXIA is not set -CONFIG_ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE=y -CONFIG_ARCH_HAS_ELF_RANDOMIZE=y -CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_RESET_CONTROLLER=y -CONFIG_ARCH_HAS_SG_CHAIN=y -CONFIG_ARCH_HAS_TICK_BROADCAST=y -CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y -CONFIG_ARCH_HIBERNATION_POSSIBLE=y -CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y -CONFIG_ARCH_MULTIPLATFORM=y -# CONFIG_ARCH_MULTI_CPU_AUTO is not set -CONFIG_ARCH_MULTI_V6_V7=y -CONFIG_ARCH_MULTI_V7=y -CONFIG_ARCH_NR_GPIO=416 -CONFIG_ARCH_PHYS_ADDR_T_64BIT=y -CONFIG_ARCH_REQUIRE_GPIOLIB=y -# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set -# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set -CONFIG_ARCH_SUNXI=y -CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y -CONFIG_ARCH_SUPPORTS_UPROBES=y -CONFIG_ARCH_SUSPEND_POSSIBLE=y -CONFIG_ARCH_USE_BUILTIN_BSWAP=y -CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y -CONFIG_ARCH_WANT_GENERAL_HUGETLB=y -CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y -CONFIG_ARM=y -CONFIG_ARM_APPENDED_DTB=y -CONFIG_ARM_ARCH_TIMER=y -CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y -CONFIG_ARM_ATAG_DTB_COMPAT=y -# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set -CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y -CONFIG_ARM_CPU_SUSPEND=y -CONFIG_ARM_ERRATA_643719=y -CONFIG_ARM_GIC=y -CONFIG_ARM_HAS_SG_CHAIN=y -CONFIG_ARM_HEAVY_MB=y -CONFIG_ARM_L1_CACHE_SHIFT=6 -CONFIG_ARM_L1_CACHE_SHIFT_6=y -CONFIG_ARM_LPAE=y -CONFIG_ARM_PATCH_PHYS_VIRT=y -CONFIG_ARM_PMU=y -CONFIG_ARM_PSCI=y -CONFIG_ARM_PSCI_FW=y -CONFIG_ARM_THUMB=y -# CONFIG_ARM_THUMBEE is not set -CONFIG_ARM_UNWIND=y -CONFIG_ARM_VIRT_EXT=y -CONFIG_ATA=y -CONFIG_ATAGS=y -# CONFIG_ATA_SFF is not set -CONFIG_AUDIT=y -# CONFIG_AUDITSYSCALL is not set -CONFIG_AUDIT_GENERIC=y -CONFIG_AUTO_ZRELADDR=y -CONFIG_AXP20X_POWER=y -CONFIG_BACKLIGHT_CLASS_DEVICE=y -CONFIG_BACKLIGHT_LCD_SUPPORT=y -CONFIG_BACKLIGHT_PWM=y -CONFIG_BINFMT_MISC=y -CONFIG_BLK_DEV_LOOP=y -CONFIG_BOUNCE=y -# CONFIG_BPF_SYSCALL is not set -CONFIG_CACHE_L2X0=y -CONFIG_CAN=y -CONFIG_CLKDEV_LOOKUP=y -CONFIG_CLKSRC_MMIO=y -CONFIG_CLKSRC_OF=y -CONFIG_CLKSRC_PROBE=y -CONFIG_CLONE_BACKWARDS=y -CONFIG_COMMON_CLK=y -CONFIG_COMPACTION=y -CONFIG_CONFIGFS_FS=y -CONFIG_CONNECTOR=y -CONFIG_CONSOLE_TRANSLATIONS=y -CONFIG_COREDUMP=y -CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y -CONFIG_CPUFREQ_DT=y -CONFIG_CPU_32v6K=y -CONFIG_CPU_32v7=y -CONFIG_CPU_ABRT_EV7=y -# CONFIG_CPU_BPREDICT_DISABLE is not set -CONFIG_CPU_CACHE_V7=y -CONFIG_CPU_CACHE_VIPT=y -CONFIG_CPU_COPY_V6=y -CONFIG_CPU_CP15=y -CONFIG_CPU_CP15_MMU=y -CONFIG_CPU_FREQ=y -CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_COMMON=y -CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y -CONFIG_CPU_FREQ_GOV_ONDEMAND=y -CONFIG_CPU_FREQ_GOV_PERFORMANCE=y -CONFIG_CPU_FREQ_GOV_POWERSAVE=y -CONFIG_CPU_FREQ_GOV_USERSPACE=y -CONFIG_CPU_FREQ_STAT=y -CONFIG_CPU_HAS_ASID=y -# CONFIG_CPU_ICACHE_DISABLE is not set -CONFIG_CPU_PABRT_V7=y -CONFIG_CPU_PM=y -CONFIG_CPU_RMAP=y -CONFIG_CPU_THERMAL=y -CONFIG_CPU_TLB_V7=y -CONFIG_CPU_V7=y -CONFIG_CRC16=y -CONFIG_CRC_T10DIF=y -CONFIG_CRYPTO_AEAD=y -CONFIG_CRYPTO_AEAD2=y -CONFIG_CRYPTO_CRC32C=y -CONFIG_CRYPTO_CRCT10DIF=y -CONFIG_CRYPTO_DES=y -CONFIG_CRYPTO_DEV_SUN4I_SS=y -CONFIG_CRYPTO_HASH=y -CONFIG_CRYPTO_HASH2=y -CONFIG_CRYPTO_HW=y -CONFIG_CRYPTO_MANAGER=y -CONFIG_CRYPTO_MANAGER2=y -CONFIG_CRYPTO_MD5=y -CONFIG_CRYPTO_NULL2=y -CONFIG_CRYPTO_RNG2=y -CONFIG_CRYPTO_SHA1=y -CONFIG_CRYPTO_WORKQUEUE=y -CONFIG_DCACHE_WORD_ACCESS=y -CONFIG_DEBUG_BUGVERBOSE=y -CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S" -CONFIG_DEBUG_MEMORY_INIT=y -# CONFIG_DEBUG_UART_8250 is not set -# CONFIG_DEBUG_USER is not set -CONFIG_DEFAULT_CFQ=y -# CONFIG_DEFAULT_DEADLINE is not set -CONFIG_DEFAULT_IOSCHED="cfq" -CONFIG_DMADEVICES=y -CONFIG_DMA_ENGINE=y -CONFIG_DMA_OF=y -CONFIG_DMA_SUN4I=y -CONFIG_DMA_SUN6I=y -CONFIG_DMA_VIRTUAL_CHANNELS=y -CONFIG_DNOTIFY=y -CONFIG_DTC=y -CONFIG_DUMMY_CONSOLE=y -CONFIG_DWMAC_GENERIC=y -CONFIG_DWMAC_SUNXI=y -CONFIG_DYNAMIC_DEBUG=y -CONFIG_EDAC_ATOMIC_SCRUB=y -CONFIG_EDAC_SUPPORT=y -CONFIG_ELF_CORE=y -# CONFIG_EMBEDDED is not set -CONFIG_ENABLE_MUST_CHECK=y -# CONFIG_ENABLE_WARN_DEPRECATED is not set -CONFIG_EXT4_FS=y -CONFIG_EXTCON=y -# CONFIG_F2FS_CHECK_FS is not set -CONFIG_F2FS_FS=y -# CONFIG_F2FS_FS_SECURITY is not set -CONFIG_F2FS_FS_XATTR=y -CONFIG_F2FS_STAT_FS=y -CONFIG_FAT_FS=y -CONFIG_FB=y -CONFIG_FB_CFB_COPYAREA=y -CONFIG_FB_CFB_FILLRECT=y -CONFIG_FB_CFB_IMAGEBLIT=y -CONFIG_FB_CMDLINE=y -CONFIG_FB_FOREIGN_ENDIAN=y -CONFIG_FB_LITTLE_ENDIAN=y -CONFIG_FB_MODE_HELPERS=y -CONFIG_FB_SIMPLE=y -CONFIG_FB_TILEBLITTING=y -CONFIG_FIX_EARLYCON_MEM=y -# CONFIG_FONTS is not set -CONFIG_FONT_8x16=y -CONFIG_FONT_8x8=y -CONFIG_FONT_SUPPORT=y -CONFIG_FRAMEBUFFER_CONSOLE=y -CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y -CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y -CONFIG_FRAME_WARN=2048 -CONFIG_FREEZER=y -CONFIG_FS_MBCACHE=y -CONFIG_FS_POSIX_ACL=y -CONFIG_GENERIC_ALLOCATOR=y -CONFIG_GENERIC_BUG=y -CONFIG_GENERIC_CLOCKEVENTS=y -CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y -CONFIG_GENERIC_IDLE_POLL_SETUP=y -CONFIG_GENERIC_IO=y -CONFIG_GENERIC_IRQ_CHIP=y -CONFIG_GENERIC_IRQ_SHOW=y -CONFIG_GENERIC_IRQ_SHOW_LEVEL=y -CONFIG_GENERIC_PCI_IOMAP=y -CONFIG_GENERIC_PHY=y -CONFIG_GENERIC_PINCONF=y -CONFIG_GENERIC_SCHED_CLOCK=y -CONFIG_GENERIC_SMP_IDLE_THREAD=y -CONFIG_GENERIC_STRNCPY_FROM_USER=y -CONFIG_GENERIC_STRNLEN_USER=y -CONFIG_GENERIC_TIME_VSYSCALL=y -CONFIG_GLOB=y -CONFIG_GPIOLIB=y -CONFIG_GPIO_DEVRES=y -CONFIG_GPIO_SYSFS=y -CONFIG_HANDLE_DOMAIN_IRQ=y -CONFIG_HARDIRQS_SW_RESEND=y -CONFIG_HAS_DMA=y -CONFIG_HAS_IOMEM=y -CONFIG_HAS_IOPORT_MAP=y -# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ARCH_AUDITSYSCALL=y -CONFIG_HAVE_ARCH_BITREVERSE=y -CONFIG_HAVE_ARCH_JUMP_LABEL=y -CONFIG_HAVE_ARCH_KGDB=y -CONFIG_HAVE_ARCH_PFN_VALID=y -CONFIG_HAVE_ARCH_SECCOMP_FILTER=y -CONFIG_HAVE_ARCH_TRACEHOOK=y -CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y -CONFIG_HAVE_ARM_ARCH_TIMER=y -# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set -CONFIG_HAVE_BPF_JIT=y -CONFIG_HAVE_CC_STACKPROTECTOR=y -CONFIG_HAVE_CLK=y -CONFIG_HAVE_CLK_PREPARE=y -CONFIG_HAVE_CONTEXT_TRACKING=y -CONFIG_HAVE_C_RECORDMCOUNT=y -CONFIG_HAVE_DEBUG_KMEMLEAK=y -CONFIG_HAVE_DMA_API_DEBUG=y -CONFIG_HAVE_DMA_ATTRS=y -CONFIG_HAVE_DMA_CONTIGUOUS=y -CONFIG_HAVE_DYNAMIC_FTRACE=y -CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y -CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y -CONFIG_HAVE_FUNCTION_TRACER=y -CONFIG_HAVE_GENERIC_DMA_COHERENT=y -CONFIG_HAVE_GENERIC_RCU_GUP=y -CONFIG_HAVE_HW_BREAKPOINT=y -CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y -CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL=y -CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y -CONFIG_HAVE_KVM_EVENTFD=y -CONFIG_HAVE_KVM_IRQFD=y -CONFIG_HAVE_MEMBLOCK=y -CONFIG_HAVE_MOD_ARCH_SPECIFIC=y -CONFIG_HAVE_NET_DSA=y -CONFIG_HAVE_OPROFILE=y -CONFIG_HAVE_OPTPROBES=y -CONFIG_HAVE_PERF_EVENTS=y -CONFIG_HAVE_PERF_REGS=y -CONFIG_HAVE_PERF_USER_STACK_DUMP=y -CONFIG_HAVE_PROC_CPU=y -CONFIG_HAVE_RCU_TABLE_FREE=y -CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y -CONFIG_HAVE_SMP=y -CONFIG_HAVE_SYSCALL_TRACEPOINTS=y -CONFIG_HAVE_UID16=y -CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HIGHMEM=y -CONFIG_HIGHPTE=y -CONFIG_HOTPLUG_CPU=y -# CONFIG_HUGETLBFS is not set -CONFIG_HWMON=y -CONFIG_HW_CONSOLE=y -CONFIG_HW_RANDOM=y -CONFIG_HW_RANDOM_TIMERIOMEM=y -CONFIG_HZ_FIXED=0 -CONFIG_I2C=y -CONFIG_I2C_BOARDINFO=y -CONFIG_I2C_CHARDEV=y -CONFIG_I2C_COMPAT=y -CONFIG_I2C_HELPER_AUTO=y -CONFIG_I2C_MV64XXX=y -CONFIG_I2C_SUN6I_P2WI=y -CONFIG_INITRAMFS_SOURCE="" -CONFIG_INPUT=y -CONFIG_INPUT_AXP20X_PEK=y -CONFIG_INPUT_KEYBOARD=y -CONFIG_INPUT_MOUSEDEV=y -CONFIG_INPUT_MOUSEDEV_PSAUX=y -CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 -CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 -CONFIG_INPUT_TOUCHSCREEN=y -CONFIG_IOMMU_HELPER=y -CONFIG_IOSCHED_CFQ=y -CONFIG_IRQCHIP=y -CONFIG_IRQ_DOMAIN=y -CONFIG_IRQ_DOMAIN_HIERARCHY=y -CONFIG_IRQ_FORCED_THREADING=y -CONFIG_IRQ_WORK=y -CONFIG_JBD2=y -CONFIG_KALLSYMS=y -# CONFIG_KERNEL_MODE_NEON is not set -CONFIG_KEYBOARD_SUN4I_LRADC=y -CONFIG_KSM=y -CONFIG_KVM=y -CONFIG_KVM_ARM_HOST=y -CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y -CONFIG_KVM_MMIO=y -CONFIG_KVM_VFIO=y -CONFIG_LCD_CLASS_DEVICE=y -CONFIG_LCD_PLATFORM=y -CONFIG_LEDS_GPIO=y -CONFIG_LEGACY_PTYS=y -CONFIG_LEGACY_PTY_COUNT=256 -CONFIG_LIBFDT=y -CONFIG_LOCK_SPIN_ON_OWNER=y -CONFIG_LOGO=y -CONFIG_LOGO_LINUX_CLUT224=y -CONFIG_LOGO_LINUX_MONO=y -CONFIG_LOGO_LINUX_VGA16=y -CONFIG_LZO_COMPRESS=y -CONFIG_LZO_DECOMPRESS=y -CONFIG_MACH_SUN4I=y -CONFIG_MACH_SUN5I=y -CONFIG_MACH_SUN6I=y -CONFIG_MACH_SUN7I=y -CONFIG_MACH_SUN8I=y -CONFIG_MACH_SUN9I=y -CONFIG_MAGIC_SYSRQ=y -CONFIG_MDIO_BOARDINFO=y -CONFIG_MDIO_SUN4I=y -CONFIG_MEDIA_SUPPORT=y -CONFIG_MFD_AXP20X=y -CONFIG_MFD_CORE=y -CONFIG_MFD_SUN6I_PRCM=y -CONFIG_MFD_SYSCON=y -CONFIG_MIGHT_HAVE_CACHE_L2X0=y -CONFIG_MIGHT_HAVE_PCI=y -CONFIG_MIGRATION=y -CONFIG_MMC=y -CONFIG_MMC_BLOCK=y -# CONFIG_MMC_BLOCK_BOUNCE is not set -CONFIG_MMC_SUNXI=y -CONFIG_MMU_NOTIFIER=y -CONFIG_MODULES_TREE_LOOKUP=y -CONFIG_MODULES_USE_ELF_REL=y -# CONFIG_MTD is not set -CONFIG_MULTI_IRQ_HANDLER=y -CONFIG_MUTEX_SPIN_ON_OWNER=y -CONFIG_NEED_DMA_MAP_STATE=y -CONFIG_NEON=y -CONFIG_NET_FLOW_LIMIT=y -CONFIG_NET_PTP_CLASSIFY=y -CONFIG_NET_VENDOR_ALLWINNER=y -CONFIG_NLS=y -CONFIG_NLS_CODEPAGE_437=y -CONFIG_NLS_ISO8859_1=y -CONFIG_NO_BOOTMEM=y -CONFIG_NO_HZ=y -CONFIG_NO_HZ_COMMON=y -CONFIG_NO_HZ_IDLE=y -CONFIG_NR_CPUS=8 -CONFIG_NVMEM=y -CONFIG_NVMEM_SUNXI_SID=y -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_RESERVED_MEM=y -CONFIG_OLD_SIGACTION=y -CONFIG_OLD_SIGSUSPEND3=y -CONFIG_OUTER_CACHE=y -CONFIG_OUTER_CACHE_SYNC=y -CONFIG_PADATA=y -CONFIG_PAGE_OFFSET=0xC0000000 -# CONFIG_PARTITION_ADVANCED is not set -# CONFIG_PCI is not set -# CONFIG_PCI_DOMAINS_GENERIC is not set -# CONFIG_PCI_SYSCALL is not set -CONFIG_PERF_EVENTS=y -CONFIG_PERF_USE_VMALLOC=y -CONFIG_PGTABLE_LEVELS=3 -CONFIG_PHYLIB=y -CONFIG_PHYS_ADDR_T_64BIT=y -CONFIG_PHY_SUN4I_USB=y -CONFIG_PHY_SUN9I_USB=y -CONFIG_PINCTRL=y -# CONFIG_PINCTRL_SINGLE is not set -CONFIG_PINCTRL_SUN4I_A10=y -CONFIG_PINCTRL_SUN5I_A10S=y -CONFIG_PINCTRL_SUN5I_A13=y -CONFIG_PINCTRL_SUN6I_A31=y -CONFIG_PINCTRL_SUN6I_A31S=y -CONFIG_PINCTRL_SUN6I_A31_R=y -CONFIG_PINCTRL_SUN7I_A20=y -CONFIG_PINCTRL_SUN8I_A23=y -CONFIG_PINCTRL_SUN8I_A23_R=y -CONFIG_PINCTRL_SUN8I_A33=y -CONFIG_PINCTRL_SUN8I_A83T=y -CONFIG_PINCTRL_SUN8I_H3=y -CONFIG_PINCTRL_SUN9I_A80=y -CONFIG_PINCTRL_SUNXI_COMMON=y -# CONFIG_PL310_ERRATA_588369 is not set -# CONFIG_PL310_ERRATA_727915 is not set -# CONFIG_PL310_ERRATA_753970 is not set -# CONFIG_PL310_ERRATA_769419 is not set -CONFIG_PM=y -CONFIG_PM_CLK=y -# CONFIG_PM_DEBUG is not set -CONFIG_PM_OPP=y -CONFIG_PM_SLEEP=y -CONFIG_PM_SLEEP_SMP=y -CONFIG_POWER_RESET=y -CONFIG_POWER_SUPPLY=y -CONFIG_PPS=y -CONFIG_PREEMPT=y -CONFIG_PREEMPT_COUNT=y -# CONFIG_PREEMPT_NONE is not set -CONFIG_PREEMPT_NOTIFIERS=y -CONFIG_PREEMPT_RCU=y -CONFIG_PRINTK_TIME=y -CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y -CONFIG_PTP_1588_CLOCK=y -CONFIG_PWM=y -CONFIG_PWM_SUN4I=y -CONFIG_PWM_SYSFS=y -CONFIG_RATIONAL=y -# CONFIG_RCU_BOOST is not set -CONFIG_RCU_STALL_COMMON=y -CONFIG_REGMAP=y -CONFIG_REGMAP_I2C=y -CONFIG_REGMAP_IRQ=y -CONFIG_REGMAP_MMIO=y -CONFIG_REGMAP_SPI=y -CONFIG_REGULATOR=y -CONFIG_REGULATOR_AXP20X=y -CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_GPIO=y -CONFIG_RELAY=y -CONFIG_RESET_CONTROLLER=y -CONFIG_RFS_ACCEL=y -CONFIG_RPS=y -CONFIG_RTC_CLASS=y -# CONFIG_RTC_DRV_SUNXI is not set -CONFIG_RWSEM_SPIN_ON_OWNER=y -CONFIG_RWSEM_XCHGADD_ALGORITHM=y -CONFIG_SATA_PMP=y -# CONFIG_SCHED_INFO is not set -CONFIG_SCSI=y -CONFIG_SDIO_UART=y -CONFIG_SECURITYFS=y -CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y -CONFIG_SERIAL_8250_DW=y -CONFIG_SERIAL_8250_FSL=y -CONFIG_SERIAL_8250_NR_UARTS=8 -CONFIG_SERIAL_8250_RUNTIME_UARTS=8 -CONFIG_SERIAL_OF_PLATFORM=y -CONFIG_SERIO=y -CONFIG_SERIO_SERPORT=y -CONFIG_SMP=y -CONFIG_SMP_ON_UP=y -CONFIG_SND=y -CONFIG_SND_COMPRESS_OFFLOAD=y -CONFIG_SND_JACK=y -CONFIG_SND_PCM=y -CONFIG_SND_SOC=y -CONFIG_SND_SOC_I2C_AND_SPI=y -# CONFIG_SND_USB is not set -CONFIG_SOUND=y -CONFIG_SPARSE_IRQ=y -CONFIG_SPI=y -CONFIG_SPI_MASTER=y -CONFIG_SPI_SUN4I=y -CONFIG_SPI_SUN6I=y -CONFIG_SRCU=y -# CONFIG_STAGING is not set -CONFIG_STMMAC_ETH=y -CONFIG_STMMAC_PLATFORM=y -CONFIG_STRICT_DEVMEM=y -# CONFIG_SUN4I_EMAC is not set -CONFIG_SUN4I_TIMER=y -CONFIG_SUN5I_HSTIMER=y -CONFIG_SUNXI_RSB=y -CONFIG_SUNXI_SRAM=y -CONFIG_SUNXI_WATCHDOG=y -CONFIG_SUSPEND=y -CONFIG_SUSPEND_FREEZER=y -CONFIG_SWCONFIG=y -CONFIG_SWCONFIG_B53=y -# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set -CONFIG_SWCONFIG_B53_PHY_DRIVER=y -CONFIG_SWCONFIG_B53_PHY_FIXUP=y -# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set -CONFIG_SWIOTLB=y -CONFIG_SWP_EMULATE=y -CONFIG_SYSFS_SYSCALL=y -CONFIG_SYS_SUPPORTS_APM_EMULATION=y -CONFIG_SYS_SUPPORTS_HUGETLBFS=y -CONFIG_THERMAL=y -CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y -CONFIG_THERMAL_GOV_STEP_WISE=y -CONFIG_THERMAL_HWMON=y -CONFIG_THERMAL_OF=y -# CONFIG_THUMB2_KERNEL is not set -CONFIG_TICK_CPU_ACCOUNTING=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_TOUCHSCREEN_PROPERTIES=y -CONFIG_TOUCHSCREEN_SUN4I=y -CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h" -CONFIG_UNINLINE_SPIN_UNLOCK=y -CONFIG_USB=y -CONFIG_USB_ANNOUNCE_NEW_DEVICES=y -# CONFIG_USB_AUDIO is not set -CONFIG_USB_COMMON=y -CONFIG_USB_DWC2=y -CONFIG_USB_DWC2_HOST=y -# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set -CONFIG_USB_EHCI_HCD=y -CONFIG_USB_EHCI_HCD_PLATFORM=y -# CONFIG_USB_ETH is not set -CONFIG_USB_GADGET=y -CONFIG_USB_NET_DRIVERS=y -CONFIG_USB_OHCI_HCD=y -CONFIG_USB_OHCI_HCD_PLATFORM=y -CONFIG_USB_STORAGE=y -CONFIG_USB_SUPPORT=y -CONFIG_USERIO=y -CONFIG_USE_OF=y -CONFIG_VDSO=y -CONFIG_VECTORS_BASE=0xffff0000 -CONFIG_VFAT_FS=y -CONFIG_VFP=y -CONFIG_VFPv3=y -CONFIG_VHOST=y -CONFIG_VHOST_NET=y -CONFIG_VHOST_RING=y -CONFIG_VIRTUALIZATION=y -CONFIG_VM_EVENT_COUNTERS=y -CONFIG_VT=y -CONFIG_VT_CONSOLE=y -CONFIG_VT_CONSOLE_SLEEP=y -CONFIG_VT_HW_CONSOLE_BINDING=y -CONFIG_WATCHDOG_CORE=y -# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set -CONFIG_XPS=y -CONFIG_XZ_DEC_ARM=y -CONFIG_XZ_DEC_BCJ=y -CONFIG_ZBOOT_ROM_BSS=0 -CONFIG_ZBOOT_ROM_TEXT=0 -CONFIG_ZONE_DMA_FLAG=0 diff --git a/target/linux/sunxi/cortexa53/config-default b/target/linux/sunxi/cortexa53/config-default index 527a6f697..bb94574da 100644 --- a/target/linux/sunxi/cortexa53/config-default +++ b/target/linux/sunxi/cortexa53/config-default @@ -61,7 +61,6 @@ CONFIG_HAVE_KVM_MSI=y CONFIG_HAVE_MEMORY_PRESENT=y CONFIG_HAVE_PATA_PLATFORM=y CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000 -# CONFIG_KASAN is not set CONFIG_KERNEL_MODE_NEON=y CONFIG_KVM_ARM_PMU=y CONFIG_KVM_ARM_VGIC_V3_ITS=y diff --git a/target/linux/sunxi/image/cortex-a7.mk b/target/linux/sunxi/image/cortex-a7.mk index d0b7aa04b..229b055e6 100644 --- a/target/linux/sunxi/image/cortex-a7.mk +++ b/target/linux/sunxi/image/cortex-a7.mk @@ -118,6 +118,18 @@ endef TARGET_DEVICES += sun8i-h2-plus-orangepi-r1 +define Device/sun8i-h3-nanopi-m1-plus + DEVICE_TITLE:=FriendlyArm NanoPi M1 Plus + DEVICE_PACKAGES:=kmod-rtc-sunxi \ + kmod-leds-gpio kmod-ledtrig-heartbeat \ + kmod-brcmfmac brcmfmac-firmware-43430-sdio wpad-mini + SUPPORTED_DEVICES:=friendlyarm,nanopi-m1-plus + SUNXI_DTS:=sun8i-h3-nanopi-m1-plus +endef + +TARGET_DEVICES += sun8i-h3-nanopi-m1-plus + + define Device/sun8i-h3-nanopi-neo DEVICE_TITLE:=FriendlyARM NanoPi NEO SUPPORTED_DEVICES:=friendlyarm,nanopi-neo @@ -136,6 +148,15 @@ endef TARGET_DEVICES += sun8i-h3-orangepi-plus +define Device/sun8i-h3-orangepi-2 + DEVICE_TITLE:=Xunlong Orange Pi 2 + DEVICE_PACKAGES:=kmod-rtc-sunxi + SUPPORTED_DEVICES:=xunlong,orangepi-2 + SUNXI_DTS:=sun8i-h3-orangepi-2 +endef + +TARGET_DEVICES += sun8i-h3-orangepi-2 + define Device/sun7i-a20-pcduino3 DEVICE_TITLE:=LinkSprite pcDuino3 diff --git a/target/linux/sunxi/image/cortex-a8.mk b/target/linux/sunxi/image/cortex-a8.mk index 97e033dbb..564a66f93 100644 --- a/target/linux/sunxi/image/cortex-a8.mk +++ b/target/linux/sunxi/image/cortex-a8.mk @@ -56,4 +56,14 @@ endef TARGET_DEVICES += sun4i-a10-pcduino + +define Device/sun4i-a10-marsboard + DEVICE_TITLE:=HAOYU Electronics Marsboard A10 + DEVICE_PACKAGES:=mod-ata-core kmod-ata-sunxi kmod-sun4i-emac kmod-rtc-sunxi sound-soc-sunxi + SUPPORTED_DEVICES:=marsboard,a10-marsboard + SUNXI_DTS:=sun4i-a10-marsboard +endef + +TARGET_DEVICES += sun4i-a10-marsboard + endif diff --git a/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch b/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch deleted file mode 100644 index a94e9b877..000000000 --- a/target/linux/sunxi/patches-4.4/100-clk-sunxi-add-dram-gates-support.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6d3a47c29186aa8d26ff05a6209c94291ace0696 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:42 +0800 -Subject: [PATCH] clk: sunxi: Add DRAM gates support for sun4i-a10 - -The A10/A20 share the same set of DRAM clock gates, which controls -direct memory access for some peripherals. - -On the A10, bit 15 controls the system's DRAM clock output (possibly -to the DRAM chips), which we need to keep on. - -On the A20 this has been moved to the DRAM controller, becoming a no-op. -However it is still listed in the user manual, so add it anyway. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 1 + - drivers/clk/sunxi/clk-simple-gates.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+) - ---- a/drivers/clk/sunxi/clk-simple-gates.c -+++ b/drivers/clk/sunxi/clk-simple-gates.c -@@ -160,3 +160,15 @@ CLK_OF_DECLARE(sun5i_a13_ahb, "allwinner - sun4i_a10_ahb_init); - CLK_OF_DECLARE(sun7i_a20_ahb, "allwinner,sun7i-a20-ahb-gates-clk", - sun4i_a10_ahb_init); -+ -+static const int sun4i_a10_dram_critical_clocks[] __initconst = { -+ 15, /* dram_output */ -+}; -+ -+static void __init sun4i_a10_dram_init(struct device_node *node) -+{ -+ sunxi_simple_gates_setup(node, sun4i_a10_dram_critical_clocks, -+ ARRAY_SIZE(sun4i_a10_dram_critical_clocks)); -+} -+CLK_OF_DECLARE(sun4i_a10_dram, "allwinner,sun4i-a10-dram-gates-clk", -+ sun4i_a10_dram_init); diff --git a/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch b/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch deleted file mode 100644 index e21eca4e1..000000000 --- a/target/linux/sunxi/patches-4.4/101-dt-sun4i-add-dram-gates.patch +++ /dev/null @@ -1,88 +0,0 @@ -From 82f8582feef4c048ee7ef0155a71c23614a7856d Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:44 +0800 -Subject: [PATCH] ARM: dts: sun4i: Add DRAM gates - -The DRAM gates controls direct memory access for some peripherals. -These peripherals include the display pipeline, so add the required -gates to the simplefb nodes as well. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun4i-a10.dtsi | 36 ++++++++++++++++++++++++++++++++---- - 1 file changed, 32 insertions(+), 4 deletions(-) - ---- a/arch/arm/boot/dts/sun4i-a10.dtsi -+++ b/arch/arm/boot/dts/sun4i-a10.dtsi -@@ -66,7 +66,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -75,7 +75,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -84,7 +85,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -- <&ahb_gates 46>; -+ <&ahb_gates 46>, <&dram_gates 25>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -93,7 +95,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -492,6 +495,31 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch b/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch deleted file mode 100644 index 397269076..000000000 --- a/target/linux/sunxi/patches-4.4/102-dt-sun7i-add-dram-gates.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 0b4bf5a5200b9ac5ddf545665f171feb5594677d Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:46 +0800 -Subject: [PATCH] ARM: dts: sun7i: Add DRAM gates - -The DRAM gates controls direct memory access for some peripherals. -These peripherals include the display pipeline, so add the required -gates to the simplefb nodes as well. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun7i-a20.dtsi | 32 +++++++++++++++++++++++++++++--- - 1 file changed, 29 insertions(+), 3 deletions(-) - ---- a/arch/arm/boot/dts/sun7i-a20.dtsi -+++ b/arch/arm/boot/dts/sun7i-a20.dtsi -@@ -68,7 +68,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -76,7 +76,8 @@ - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; -+ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -85,7 +86,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -501,6 +502,31 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch b/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch deleted file mode 100644 index 8bc66274c..000000000 --- a/target/linux/sunxi/patches-4.4/103-clk-sunxi-add-h3-clksupport.patch +++ /dev/null @@ -1,180 +0,0 @@ -From ab6e23a4e388f5f2696b8e92c350f845142da118 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:40 +0100 -Subject: [PATCH] clk: sunxi: Add H3 clocks support - -The H3 clock control unit is similar to the those of other sun8i family -members like the A23. - -It adds a new bus gates clock similar to the simple gates, but with a -different parent clock for each single gate. -Some of the gates use the new AHB2 clock as parent, whose clock source -is muxable between AHB1 and PLL6/2. The documentation isn't totally clear -about which devices belong to AHB2 now, especially USB EHIC/OHIC, so it -is mostly based on Allwinner kernel source code. - -Signed-off-by: Jens Kuske -Acked-by: Rob Herring -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 2 + - drivers/clk/sunxi/Makefile | 1 + - drivers/clk/sunxi/clk-sun8i-bus-gates.c | 112 ++++++++++++++++++++++ - drivers/clk/sunxi/clk-sunxi.c | 6 ++ - 4 files changed, 121 insertions(+) - create mode 100644 drivers/clk/sunxi/clk-sun8i-bus-gates.c - ---- a/drivers/clk/sunxi/Makefile -+++ b/drivers/clk/sunxi/Makefile -@@ -10,6 +10,7 @@ obj-y += clk-a10-pll2.o - obj-y += clk-a20-gmac.o - obj-y += clk-mod0.o - obj-y += clk-simple-gates.o -+obj-y += clk-sun8i-bus-gates.o - obj-y += clk-sun8i-mbus.o - obj-y += clk-sun9i-core.o - obj-y += clk-sun9i-mmc.o ---- /dev/null -+++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c -@@ -0,0 +1,112 @@ -+/* -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * Based on clk-simple-gates.c, which is: -+ * Copyright 2015 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static DEFINE_SPINLOCK(gates_lock); -+ -+static void __init sun8i_h3_bus_gates_init(struct device_node *node) -+{ -+ static const char * const names[] = { "ahb1", "ahb2", "apb1", "apb2" }; -+ enum { AHB1, AHB2, APB1, APB2, PARENT_MAX } clk_parent; -+ const char *parents[PARENT_MAX]; -+ struct clk_onecell_data *clk_data; -+ const char *clk_name; -+ struct property *prop; -+ struct resource res; -+ void __iomem *clk_reg; -+ void __iomem *reg; -+ const __be32 *p; -+ int number, i; -+ u8 clk_bit; -+ u32 index; -+ -+ reg = of_io_request_and_map(node, 0, of_node_full_name(node)); -+ if (IS_ERR(reg)) -+ return; -+ -+ for (i = 0; i < ARRAY_SIZE(names); i++) { -+ index = of_property_match_string(node, "clock-names", -+ names[i]); -+ if (index < 0) -+ return; -+ -+ parents[i] = of_clk_get_parent_name(node, index); -+ } -+ -+ clk_data = kmalloc(sizeof(struct clk_onecell_data), GFP_KERNEL); -+ if (!clk_data) -+ goto err_unmap; -+ -+ number = of_property_count_u32_elems(node, "clock-indices"); -+ of_property_read_u32_index(node, "clock-indices", number - 1, &number); -+ -+ clk_data->clks = kcalloc(number + 1, sizeof(struct clk *), GFP_KERNEL); -+ if (!clk_data->clks) -+ goto err_free_data; -+ -+ i = 0; -+ of_property_for_each_u32(node, "clock-indices", prop, p, index) { -+ of_property_read_string_index(node, "clock-output-names", -+ i, &clk_name); -+ -+ if (index == 17 || (index >= 29 && index <= 31)) -+ clk_parent = AHB2; -+ else if (index <= 63 || index >= 128) -+ clk_parent = AHB1; -+ else if (index >= 64 && index <= 95) -+ clk_parent = APB1; -+ else if (index >= 96 && index <= 127) -+ clk_parent = APB2; -+ -+ clk_reg = reg + 4 * (index / 32); -+ clk_bit = index % 32; -+ -+ clk_data->clks[index] = clk_register_gate(NULL, clk_name, -+ parents[clk_parent], -+ 0, clk_reg, clk_bit, -+ 0, &gates_lock); -+ i++; -+ -+ if (IS_ERR(clk_data->clks[index])) { -+ WARN_ON(true); -+ continue; -+ } -+ } -+ -+ clk_data->clk_num = number + 1; -+ of_clk_add_provider(node, of_clk_src_onecell_get, clk_data); -+ -+ return; -+ -+err_free_data: -+ kfree(clk_data); -+err_unmap: -+ iounmap(reg); -+ of_address_to_resource(node, 0, &res); -+ release_mem_region(res.start, resource_size(&res)); -+} -+ -+CLK_OF_DECLARE(sun8i_h3_bus_gates, "allwinner,sun8i-h3-bus-gates-clk", -+ sun8i_h3_bus_gates_init); ---- a/drivers/clk/sunxi/clk-sunxi.c -+++ b/drivers/clk/sunxi/clk-sunxi.c -@@ -778,6 +778,10 @@ static const struct mux_data sun6i_a31_a - .shift = 12, - }; - -+static const struct mux_data sun8i_h3_ahb2_mux_data __initconst = { -+ .shift = 0, -+}; -+ - static void __init sunxi_mux_clk_setup(struct device_node *node, - struct mux_data *data) - { -@@ -1130,6 +1134,7 @@ static const struct of_device_id clk_div - static const struct of_device_id clk_mux_match[] __initconst = { - {.compatible = "allwinner,sun4i-a10-cpu-clk", .data = &sun4i_cpu_mux_data,}, - {.compatible = "allwinner,sun6i-a31-ahb1-mux-clk", .data = &sun6i_a31_ahb1_mux_data,}, -+ {.compatible = "allwinner,sun8i-h3-ahb2-clk", .data = &sun8i_h3_ahb2_mux_data,}, - {} - }; - -@@ -1212,6 +1217,7 @@ CLK_OF_DECLARE(sun6i_a31_clk_init, "allw - CLK_OF_DECLARE(sun6i_a31s_clk_init, "allwinner,sun6i-a31s", sun6i_init_clocks); - CLK_OF_DECLARE(sun8i_a23_clk_init, "allwinner,sun8i-a23", sun6i_init_clocks); - CLK_OF_DECLARE(sun8i_a33_clk_init, "allwinner,sun8i-a33", sun6i_init_clocks); -+CLK_OF_DECLARE(sun8i_h3_clk_init, "allwinner,sun8i-h3", sun6i_init_clocks); - - static void __init sun9i_init_clocks(struct device_node *node) - { diff --git a/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch b/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch deleted file mode 100644 index 35a653c5f..000000000 --- a/target/linux/sunxi/patches-4.4/104-1-dt-sunxi-add-h3-dtsi.patch +++ /dev/null @@ -1,515 +0,0 @@ -From 318d93bc41823e86967c8251eef0444a72e4d687 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:42 +0100 -Subject: [PATCH] ARM: dts: sunxi: Add Allwinner H3 DTSI - -The Allwinner H3 is a home entertainment system oriented SoC with -four Cortex-A7 cores and a Mali-400MP2 GPU. - -Signed-off-by: Jens Kuske -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 497 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 497 insertions(+) - create mode 100644 arch/arm/boot/dts/sun8i-h3.dtsi - ---- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -0,0 +1,497 @@ -+/* -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "skeleton.dtsi" -+ -+#include -+#include -+ -+/ { -+ interrupt-parent = <&gic>; -+ -+ cpus { -+ #address-cells = <1>; -+ #size-cells = <0>; -+ -+ cpu@0 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <0>; -+ }; -+ -+ cpu@1 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <1>; -+ }; -+ -+ cpu@2 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <2>; -+ }; -+ -+ cpu@3 { -+ compatible = "arm,cortex-a7"; -+ device_type = "cpu"; -+ reg = <3>; -+ }; -+ }; -+ -+ timer { -+ compatible = "arm,armv7-timer"; -+ interrupts = , -+ , -+ , -+ ; -+ }; -+ -+ clocks { -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ osc24M: osc24M_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <24000000>; -+ clock-output-names = "osc24M"; -+ }; -+ -+ osc32k: osc32k_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <32768>; -+ clock-output-names = "osc32k"; -+ }; -+ -+ pll1: clk@01c20000 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-a23-pll1-clk"; -+ reg = <0x01c20000 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll1"; -+ }; -+ -+ /* dummy clock until actually implemented */ -+ pll5: pll5_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <0>; -+ clock-output-names = "pll5"; -+ }; -+ -+ pll6: clk@01c20028 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun6i-a31-pll6-clk"; -+ reg = <0x01c20028 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll6", "pll6x2"; -+ }; -+ -+ pll6d2: pll6d2_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <2>; -+ clock-mult = <1>; -+ clocks = <&pll6 0>; -+ clock-output-names = "pll6d2"; -+ }; -+ -+ /* dummy clock until pll6 can be reused */ -+ pll8: pll8_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <1>; -+ clock-output-names = "pll8"; -+ }; -+ -+ cpu: cpu_clk@01c20050 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-cpu-clk"; -+ reg = <0x01c20050 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>; -+ clock-output-names = "cpu"; -+ }; -+ -+ axi: axi_clk@01c20050 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-axi-clk"; -+ reg = <0x01c20050 0x4>; -+ clocks = <&cpu>; -+ clock-output-names = "axi"; -+ }; -+ -+ ahb1: ahb1_clk@01c20054 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun6i-a31-ahb1-clk"; -+ reg = <0x01c20054 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>; -+ clock-output-names = "ahb1"; -+ }; -+ -+ ahb2: ahb2_clk@01c2005c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-h3-ahb2-clk"; -+ reg = <0x01c2005c 0x4>; -+ clocks = <&ahb1>, <&pll6d2>; -+ clock-output-names = "ahb2"; -+ }; -+ -+ apb1: apb1_clk@01c20054 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-apb0-clk"; -+ reg = <0x01c20054 0x4>; -+ clocks = <&ahb1>; -+ clock-output-names = "apb1"; -+ }; -+ -+ apb2: apb2_clk@01c20058 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-apb1-clk"; -+ reg = <0x01c20058 0x4>; -+ clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>; -+ clock-output-names = "apb2"; -+ }; -+ -+ bus_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-h3-bus-gates-clk"; -+ reg = <0x01c20060 0x14>; -+ clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>; -+ clock-names = "ahb1", "ahb2", "apb1", "apb2"; -+ clock-indices = <5>, <6>, <8>, -+ <9>, <10>, <13>, -+ <14>, <17>, <18>, -+ <19>, <20>, -+ <21>, <23>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>, -+ <30>, <31>, <32>, -+ <35>, <36>, <37>, -+ <40>, <41>, <43>, -+ <44>, <52>, <53>, -+ <54>, <64>, -+ <65>, <69>, <72>, -+ <76>, <77>, <78>, -+ <96>, <97>, <98>, -+ <112>, <113>, -+ <114>, <115>, -+ <116>, <128>, <135>; -+ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", -+ "bus_mmc1", "bus_mmc2", "bus_nand", -+ "bus_sdram", "bus_gmac", "bus_ts", -+ "bus_hstimer", "bus_spi0", -+ "bus_spi1", "bus_otg", -+ "bus_otg_ehci0", "bus_ehci1", -+ "bus_ehci2", "bus_ehci3", -+ "bus_otg_ohci0", "bus_ohci1", -+ "bus_ohci2", "bus_ohci3", "bus_ve", -+ "bus_lcd0", "bus_lcd1", "bus_deint", -+ "bus_csi", "bus_tve", "bus_hdmi", -+ "bus_de", "bus_gpu", "bus_msgbox", -+ "bus_spinlock", "bus_codec", -+ "bus_spdif", "bus_pio", "bus_ths", -+ "bus_i2s0", "bus_i2s1", "bus_i2s2", -+ "bus_i2c0", "bus_i2c1", "bus_i2c2", -+ "bus_uart0", "bus_uart1", -+ "bus_uart2", "bus_uart3", -+ "bus_scr", "bus_ephy", "bus_dbg"; -+ }; -+ -+ mmc0_clk: clk@01c20088 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c20088 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc0", -+ "mmc0_output", -+ "mmc0_sample"; -+ }; -+ -+ mmc1_clk: clk@01c2008c { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c2008c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc1", -+ "mmc1_output", -+ "mmc1_sample"; -+ }; -+ -+ mmc2_clk: clk@01c20090 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-mmc-clk"; -+ reg = <0x01c20090 0x4>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; -+ clock-output-names = "mmc2", -+ "mmc2_output", -+ "mmc2_sample"; -+ }; -+ -+ mbus_clk: clk@01c2015c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun8i-a23-mbus-clk"; -+ reg = <0x01c2015c 0x4>; -+ clocks = <&osc24M>, <&pll6 1>, <&pll5>; -+ clock-output-names = "mbus"; -+ }; -+ }; -+ -+ soc { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <1>; -+ ranges; -+ -+ dma: dma-controller@01c02000 { -+ compatible = "allwinner,sun8i-h3-dma"; -+ reg = <0x01c02000 0x1000>; -+ interrupts = ; -+ clocks = <&bus_gates 6>; -+ resets = <&ahb_rst 6>; -+ #dma-cells = <1>; -+ }; -+ -+ mmc0: mmc@01c0f000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c0f000 0x1000>; -+ clocks = <&bus_gates 8>, -+ <&mmc0_clk 0>, -+ <&mmc0_clk 1>, -+ <&mmc0_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 8>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc1: mmc@01c10000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c10000 0x1000>; -+ clocks = <&bus_gates 9>, -+ <&mmc1_clk 0>, -+ <&mmc1_clk 1>, -+ <&mmc1_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 9>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ mmc2: mmc@01c11000 { -+ compatible = "allwinner,sun5i-a13-mmc"; -+ reg = <0x01c11000 0x1000>; -+ clocks = <&bus_gates 10>, -+ <&mmc2_clk 0>, -+ <&mmc2_clk 1>, -+ <&mmc2_clk 2>; -+ clock-names = "ahb", -+ "mmc", -+ "output", -+ "sample"; -+ resets = <&ahb_rst 10>; -+ reset-names = "ahb"; -+ interrupts = ; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; -+ -+ pio: pinctrl@01c20800 { -+ compatible = "allwinner,sun8i-h3-pinctrl"; -+ reg = <0x01c20800 0x400>; -+ interrupts = , -+ ; -+ clocks = <&bus_gates 69>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ -+ uart0_pins_a: uart0@0 { -+ allwinner,pins = "PA4", "PA5"; -+ allwinner,function = "uart0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_pins_a: mmc0@0 { -+ allwinner,pins = "PF0", "PF1", "PF2", "PF3", -+ "PF4", "PF5"; -+ allwinner,function = "mmc0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin: mmc0_cd_pin@0 { -+ allwinner,pins = "PF6"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc1_pins_a: mmc1@0 { -+ allwinner,pins = "PG0", "PG1", "PG2", "PG3", -+ "PG4", "PG5"; -+ allwinner,function = "mmc1"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; -+ -+ ahb_rst: reset@01c202c0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-ahb1-reset"; -+ reg = <0x01c202c0 0xc>; -+ }; -+ -+ apb1_rst: reset@01c202d0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d0 0x4>; -+ }; -+ -+ apb2_rst: reset@01c202d8 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d8 0x4>; -+ }; -+ -+ timer@01c20c00 { -+ compatible = "allwinner,sun4i-a10-timer"; -+ reg = <0x01c20c00 0xa0>; -+ interrupts = , -+ ; -+ clocks = <&osc24M>; -+ }; -+ -+ wdt0: watchdog@01c20ca0 { -+ compatible = "allwinner,sun6i-a31-wdt"; -+ reg = <0x01c20ca0 0x20>; -+ interrupts = ; -+ }; -+ -+ uart0: serial@01c28000 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28000 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 112>; -+ resets = <&apb2_rst 16>; -+ dmas = <&dma 6>, <&dma 6>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart1: serial@01c28400 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28400 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 113>; -+ resets = <&apb2_rst 17>; -+ dmas = <&dma 7>, <&dma 7>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart2: serial@01c28800 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28800 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 114>; -+ resets = <&apb2_rst 18>; -+ dmas = <&dma 8>, <&dma 8>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ uart3: serial@01c28c00 { -+ compatible = "snps,dw-apb-uart"; -+ reg = <0x01c28c00 0x400>; -+ interrupts = ; -+ reg-shift = <2>; -+ reg-io-width = <4>; -+ clocks = <&bus_gates 115>; -+ resets = <&apb2_rst 19>; -+ dmas = <&dma 9>, <&dma 9>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ -+ gic: interrupt-controller@01c81000 { -+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x1000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ interrupts = ; -+ }; -+ -+ rtc: rtc@01f00000 { -+ compatible = "allwinner,sun6i-a31-rtc"; -+ reg = <0x01f00000 0x54>; -+ interrupts = , -+ ; -+ }; -+ }; -+}; diff --git a/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch b/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch deleted file mode 100644 index 7715b585d..000000000 --- a/target/linux/sunxi/patches-4.4/105-phy-use_of_match_node.patch +++ /dev/null @@ -1,218 +0,0 @@ -From 5c627d8e7660c170c591ef281184fd11d0493440 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 11 Dec 2015 16:32:17 +0100 -Subject: [PATCH] phy-sun4i-usb: Use of_match_node to get model specific config - data - -Use of_match_node instead of calling of_device_is_compatible a ton of -times to get model specific config data. - -Signed-off-by: Hans de Goede -Signed-off-by: Kishon Vijay Abraham I ---- - drivers/phy/phy-sun4i-usb.c | 121 +++++++++++++++++++++++++++++--------------- - 1 file changed, 79 insertions(+), 42 deletions(-) - ---- a/drivers/phy/phy-sun4i-usb.c -+++ b/drivers/phy/phy-sun4i-usb.c -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -88,12 +89,23 @@ - #define DEBOUNCE_TIME msecs_to_jiffies(50) - #define POLL_TIME msecs_to_jiffies(250) - -+enum sun4i_usb_phy_type { -+ sun4i_a10_phy, -+ sun8i_a33_phy, -+}; -+ -+struct sun4i_usb_phy_cfg { -+ int num_phys; -+ enum sun4i_usb_phy_type type; -+ u32 disc_thresh; -+ u8 phyctl_offset; -+ bool dedicated_clocks; -+}; -+ - struct sun4i_usb_phy_data { - void __iomem *base; -+ const struct sun4i_usb_phy_cfg *cfg; - struct mutex mutex; -- int num_phys; -- u32 disc_thresh; -- bool has_a33_phyctl; - struct sun4i_usb_phy { - struct phy *phy; - void __iomem *pmu; -@@ -159,17 +171,14 @@ static void sun4i_usb_phy_write(struct s - { - struct sun4i_usb_phy_data *phy_data = to_sun4i_usb_phy_data(phy); - u32 temp, usbc_bit = BIT(phy->index * 2); -- void *phyctl; -+ void *phyctl = phy_data->base + phy_data->cfg->phyctl_offset; - int i; - - mutex_lock(&phy_data->mutex); - -- if (phy_data->has_a33_phyctl) { -- phyctl = phy_data->base + REG_PHYCTL_A33; -+ if (phy_data->cfg->type == sun8i_a33_phy) { - /* A33 needs us to set phyctl to 0 explicitly */ - writel(0, phyctl); -- } else { -- phyctl = phy_data->base + REG_PHYCTL_A10; - } - - for (i = 0; i < len; i++) { -@@ -249,7 +258,8 @@ static int sun4i_usb_phy_init(struct phy - sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); - - /* Disconnect threshold adjustment */ -- sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, data->disc_thresh, 2); -+ sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -+ data->cfg->disc_thresh, 2); - - sun4i_usb_phy_passby(phy, 1); - -@@ -476,7 +486,7 @@ static struct phy *sun4i_usb_phy_xlate(s - { - struct sun4i_usb_phy_data *data = dev_get_drvdata(dev); - -- if (args->args[0] >= data->num_phys) -+ if (args->args[0] >= data->cfg->num_phys) - return ERR_PTR(-ENODEV); - - return data->phys[args->args[0]].phy; -@@ -511,7 +521,6 @@ static int sun4i_usb_phy_probe(struct pl - struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; - struct phy_provider *phy_provider; -- bool dedicated_clocks; - struct resource *res; - int i, ret; - -@@ -522,29 +531,9 @@ static int sun4i_usb_phy_probe(struct pl - mutex_init(&data->mutex); - INIT_DELAYED_WORK(&data->detect, sun4i_usb_phy0_id_vbus_det_scan); - dev_set_drvdata(dev, data); -- -- if (of_device_is_compatible(np, "allwinner,sun5i-a13-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a23-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- data->num_phys = 2; -- else -- data->num_phys = 3; -- -- if (of_device_is_compatible(np, "allwinner,sun5i-a13-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun7i-a20-usb-phy")) -- data->disc_thresh = 2; -- else -- data->disc_thresh = 3; -- -- if (of_device_is_compatible(np, "allwinner,sun6i-a31-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a23-usb-phy") || -- of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- dedicated_clocks = true; -- else -- dedicated_clocks = false; -- -- if (of_device_is_compatible(np, "allwinner,sun8i-a33-usb-phy")) -- data->has_a33_phyctl = true; -+ data->cfg = of_device_get_match_data(dev); -+ if (!data->cfg) -+ return -EINVAL; - - res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "phy_ctrl"); - data->base = devm_ioremap_resource(dev, res); -@@ -590,7 +579,7 @@ static int sun4i_usb_phy_probe(struct pl - } - } - -- for (i = 0; i < data->num_phys; i++) { -+ for (i = 0; i < data->cfg->num_phys; i++) { - struct sun4i_usb_phy *phy = data->phys + i; - char name[16]; - -@@ -602,7 +591,7 @@ static int sun4i_usb_phy_probe(struct pl - phy->vbus = NULL; - } - -- if (dedicated_clocks) -+ if (data->cfg->dedicated_clocks) - snprintf(name, sizeof(name), "usb%d_phy", i); - else - strlcpy(name, "usb_phy", sizeof(name)); -@@ -689,13 +678,61 @@ static int sun4i_usb_phy_probe(struct pl - return 0; - } - -+static const struct sun4i_usb_phy_cfg sun4i_a10_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun5i_a13_cfg = { -+ .num_phys = 2, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 2, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun6i_a31_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = true, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun7i_a20_cfg = { -+ .num_phys = 3, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 2, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = false, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun8i_a23_cfg = { -+ .num_phys = 2, -+ .type = sun4i_a10_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A10, -+ .dedicated_clocks = true, -+}; -+ -+static const struct sun4i_usb_phy_cfg sun8i_a33_cfg = { -+ .num_phys = 2, -+ .type = sun8i_a33_phy, -+ .disc_thresh = 3, -+ .phyctl_offset = REG_PHYCTL_A33, -+ .dedicated_clocks = true, -+}; -+ - static const struct of_device_id sun4i_usb_phy_of_match[] = { -- { .compatible = "allwinner,sun4i-a10-usb-phy" }, -- { .compatible = "allwinner,sun5i-a13-usb-phy" }, -- { .compatible = "allwinner,sun6i-a31-usb-phy" }, -- { .compatible = "allwinner,sun7i-a20-usb-phy" }, -- { .compatible = "allwinner,sun8i-a23-usb-phy" }, -- { .compatible = "allwinner,sun8i-a33-usb-phy" }, -+ { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, -+ { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, -+ { .compatible = "allwinner,sun6i-a31-usb-phy", .data = &sun6i_a31_cfg }, -+ { .compatible = "allwinner,sun7i-a20-usb-phy", .data = &sun7i_a20_cfg }, -+ { .compatible = "allwinner,sun8i-a23-usb-phy", .data = &sun8i_a23_cfg }, -+ { .compatible = "allwinner,sun8i-a33-usb-phy", .data = &sun8i_a33_cfg }, - { }, - }; - MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match); diff --git a/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch b/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch deleted file mode 100644 index 33943230e..000000000 --- a/target/linux/sunxi/patches-4.4/106-phy-add-h3-usbphys.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 317c5224795b41a08ba8c08573d74ba95096faa5 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Fri, 11 Dec 2015 16:32:18 +0100 -Subject: [PATCH] phy-sun4i-usb: Add support for the host usb-phys found on the - H3 SoC - -Note this commit only adds support for phys 1-3, phy 0, the otg phy, is -not yet (fully) supported after this commit. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Acked-by: Rob Herring -Signed-off-by: Kishon Vijay Abraham I ---- - .../devicetree/bindings/phy/sun4i-usb-phy.txt | 1 + - drivers/phy/phy-sun4i-usb.c | 41 +++++++++++++++++----- - 2 files changed, 33 insertions(+), 9 deletions(-) - ---- a/Documentation/devicetree/bindings/phy/sun4i-usb-phy.txt -+++ b/Documentation/devicetree/bindings/phy/sun4i-usb-phy.txt -@@ -9,6 +9,7 @@ Required properties: - * allwinner,sun7i-a20-usb-phy - * allwinner,sun8i-a23-usb-phy - * allwinner,sun8i-a33-usb-phy -+ * allwinner,sun8i-h3-usb-phy - - reg : a list of offset + length pairs - - reg-names : - * "phy_ctrl" ---- a/drivers/phy/phy-sun4i-usb.c -+++ b/drivers/phy/phy-sun4i-usb.c -@@ -47,6 +47,9 @@ - #define REG_PHYBIST 0x08 - #define REG_PHYTUNE 0x0c - #define REG_PHYCTL_A33 0x10 -+#define REG_PHY_UNK_H3 0x20 -+ -+#define REG_PMU_UNK_H3 0x10 - - #define PHYCTL_DATA BIT(7) - -@@ -80,7 +83,7 @@ - #define PHY_DISCON_TH_SEL 0x2a - #define PHY_SQUELCH_DETECT 0x3c - --#define MAX_PHYS 3 -+#define MAX_PHYS 4 - - /* - * Note do not raise the debounce time, we must report Vusb high within 100ms -@@ -92,6 +95,7 @@ - enum sun4i_usb_phy_type { - sun4i_a10_phy, - sun8i_a33_phy, -+ sun8i_h3_phy, - }; - - struct sun4i_usb_phy_cfg { -@@ -239,6 +243,7 @@ static int sun4i_usb_phy_init(struct phy - struct sun4i_usb_phy *phy = phy_get_drvdata(_phy); - struct sun4i_usb_phy_data *data = to_sun4i_usb_phy_data(phy); - int ret; -+ u32 val; - - ret = clk_prepare_enable(phy->clk); - if (ret) -@@ -250,16 +255,26 @@ static int sun4i_usb_phy_init(struct phy - return ret; - } - -- /* Enable USB 45 Ohm resistor calibration */ -- if (phy->index == 0) -- sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1); -- -- /* Adjust PHY's magnitude and rate */ -- sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); -- -- /* Disconnect threshold adjustment */ -- sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -- data->cfg->disc_thresh, 2); -+ if (data->cfg->type == sun8i_h3_phy) { -+ if (phy->index == 0) { -+ val = readl(data->base + REG_PHY_UNK_H3); -+ writel(val & ~1, data->base + REG_PHY_UNK_H3); -+ } -+ -+ val = readl(phy->pmu + REG_PMU_UNK_H3); -+ writel(val & ~2, phy->pmu + REG_PMU_UNK_H3); -+ } else { -+ /* Enable USB 45 Ohm resistor calibration */ -+ if (phy->index == 0) -+ sun4i_usb_phy_write(phy, PHY_RES45_CAL_EN, 0x01, 1); -+ -+ /* Adjust PHY's magnitude and rate */ -+ sun4i_usb_phy_write(phy, PHY_TX_AMPLITUDE_TUNE, 0x14, 5); -+ -+ /* Disconnect threshold adjustment */ -+ sun4i_usb_phy_write(phy, PHY_DISCON_TH_SEL, -+ data->cfg->disc_thresh, 2); -+ } - - sun4i_usb_phy_passby(phy, 1); - -@@ -726,6 +741,13 @@ static const struct sun4i_usb_phy_cfg su - .dedicated_clocks = true, - }; - -+static const struct sun4i_usb_phy_cfg sun8i_h3_cfg = { -+ .num_phys = 4, -+ .type = sun8i_h3_phy, -+ .disc_thresh = 3, -+ .dedicated_clocks = true, -+}; -+ - static const struct of_device_id sun4i_usb_phy_of_match[] = { - { .compatible = "allwinner,sun4i-a10-usb-phy", .data = &sun4i_a10_cfg }, - { .compatible = "allwinner,sun5i-a13-usb-phy", .data = &sun5i_a13_cfg }, -@@ -733,6 +755,7 @@ static const struct of_device_id sun4i_u - { .compatible = "allwinner,sun7i-a20-usb-phy", .data = &sun7i_a20_cfg }, - { .compatible = "allwinner,sun8i-a23-usb-phy", .data = &sun8i_a23_cfg }, - { .compatible = "allwinner,sun8i-a33-usb-phy", .data = &sun8i_a33_cfg }, -+ { .compatible = "allwinner,sun8i-h3-usb-phy", .data = &sun8i_h3_cfg }, - { }, - }; - MODULE_DEVICE_TABLE(of, sun4i_usb_phy_of_match); diff --git a/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch b/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch deleted file mode 100644 index c845d512e..000000000 --- a/target/linux/sunxi/patches-4.4/107-clk-sunxi-add-h3-usbphy-clocks.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 7bec0200ac214b5cba44e2c2c4385815be4b9f00 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Sun, 15 Nov 2015 20:46:13 +0100 -Subject: [PATCH] clk: sunxi: Add support for the H3 usb phy clocks - -The H3 has a usb-phy clk register which is similar to that of earlier -SoCs, but with support for a larger number of phys. So we can simply add -a new set of clk-data and a new compatible and be done with it. - -Acked-by: Chen-Yu Tsai -Acked-by: Rob Herring -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 1 + - drivers/clk/sunxi/clk-usb.c | 12 ++++++++++++ - 2 files changed, 13 insertions(+) - ---- a/Documentation/devicetree/bindings/clock/sunxi.txt -+++ b/Documentation/devicetree/bindings/clock/sunxi.txt -@@ -70,6 +70,7 @@ Required properties: - "allwinner,sun5i-a13-usb-clk" - for usb gates + resets on A13 - "allwinner,sun6i-a31-usb-clk" - for usb gates + resets on A31 - "allwinner,sun8i-a23-usb-clk" - for usb gates + resets on A23 -+ "allwinner,sun8i-h3-usb-clk" - for usb gates + resets on H3 - "allwinner,sun9i-a80-usb-mod-clk" - for usb gates + resets on A80 - "allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80 - ---- a/drivers/clk/sunxi/clk-usb.c -+++ b/drivers/clk/sunxi/clk-usb.c -@@ -243,3 +243,15 @@ static void __init sun9i_a80_usb_phy_set - sunxi_usb_clk_setup(node, &sun9i_a80_usb_phy_data, &a80_usb_phy_lock); - } - CLK_OF_DECLARE(sun9i_a80_usb_phy, "allwinner,sun9i-a80-usb-phy-clk", sun9i_a80_usb_phy_setup); -+ -+static const struct usb_clk_data sun8i_h3_usb_clk_data __initconst = { -+ .clk_mask = BIT(19) | BIT(18) | BIT(17) | BIT(16) | -+ BIT(11) | BIT(10) | BIT(9) | BIT(8), -+ .reset_mask = BIT(3) | BIT(2) | BIT(1) | BIT(0), -+}; -+ -+static void __init sun8i_h3_usb_setup(struct device_node *node) -+{ -+ sunxi_usb_clk_setup(node, &sun8i_h3_usb_clk_data, &sun4i_a10_usb_lock); -+} -+CLK_OF_DECLARE(sun8i_h3_usb, "allwinner,sun8i-h3-usb-clk", sun8i_h3_usb_setup); diff --git a/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch b/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch deleted file mode 100644 index f929753d7..000000000 --- a/target/linux/sunxi/patches-4.4/110-clk-sunxi-add-ve-for-sun457i.patch +++ /dev/null @@ -1,226 +0,0 @@ -From 3cdd9f5c4953465abb87ec757159cc0576ae6b0a Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:43 +0800 -Subject: [PATCH] clk: sunxi: Add VE (Video Engine) module clock driver for - sun[457]i - -The video engine has its own special module clock, consisting of a clock -gate, configurable dividers, and a reset control. - -On later (sun[68]i) families, the reset control is moved out of this -piece of hardware and grouped with reset controls of other peripherals. - -Signed-off-by: Chen-Yu Tsai -Tested-by: Jens Kuske -Signed-off-by: Maxime Ripard ---- - Documentation/devicetree/bindings/clock/sunxi.txt | 4 + - drivers/clk/sunxi/Makefile | 1 + - drivers/clk/sunxi/clk-a10-ve.c | 171 ++++++++++++++++++++++ - 3 files changed, 176 insertions(+) - create mode 100644 drivers/clk/sunxi/clk-a10-ve.c - ---- a/Documentation/devicetree/bindings/clock/sunxi.txt -+++ b/Documentation/devicetree/bindings/clock/sunxi.txt -@@ -73,6 +73,7 @@ Required properties: - "allwinner,sun8i-h3-usb-clk" - for usb gates + resets on H3 - "allwinner,sun9i-a80-usb-mod-clk" - for usb gates + resets on A80 - "allwinner,sun9i-a80-usb-phy-clk" - for usb phy gates + resets on A80 -+ "allwinner,sun4i-a10-ve-clk" - for the Video Engine clock - - Required properties for all clocks: - - reg : shall be the control register address for the clock. -@@ -92,6 +93,9 @@ Required properties for all clocks: - And "allwinner,*-usb-clk" clocks also require: - - reset-cells : shall be set to 1 - -+The "allwinner,sun4i-a10-ve-clk" clock also requires: -+- reset-cells : shall be set to 0 -+ - The "allwinner,sun9i-a80-mmc-config-clk" clock also requires: - - #reset-cells : shall be set to 1 - - resets : shall be the reset control phandle for the mmc block. ---- a/drivers/clk/sunxi/Makefile -+++ b/drivers/clk/sunxi/Makefile -@@ -7,6 +7,7 @@ obj-y += clk-a10-codec.o - obj-y += clk-a10-hosc.o - obj-y += clk-a10-mod1.o - obj-y += clk-a10-pll2.o -+obj-y += clk-a10-ve.o - obj-y += clk-a20-gmac.o - obj-y += clk-mod0.o - obj-y += clk-simple-gates.o ---- /dev/null -+++ b/drivers/clk/sunxi/clk-a10-ve.c -@@ -0,0 +1,171 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2 of the License, or -+ * (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+static DEFINE_SPINLOCK(ve_lock); -+ -+#define SUN4I_VE_ENABLE 31 -+#define SUN4I_VE_DIVIDER_SHIFT 16 -+#define SUN4I_VE_DIVIDER_WIDTH 3 -+#define SUN4I_VE_RESET 0 -+ -+/** -+ * sunxi_ve_reset... - reset bit in ve clk registers handling -+ */ -+ -+struct ve_reset_data { -+ void __iomem *reg; -+ spinlock_t *lock; -+ struct reset_controller_dev rcdev; -+}; -+ -+static int sunxi_ve_reset_assert(struct reset_controller_dev *rcdev, -+ unsigned long id) -+{ -+ struct ve_reset_data *data = container_of(rcdev, -+ struct ve_reset_data, -+ rcdev); -+ unsigned long flags; -+ u32 reg; -+ -+ spin_lock_irqsave(data->lock, flags); -+ -+ reg = readl(data->reg); -+ writel(reg & ~BIT(SUN4I_VE_RESET), data->reg); -+ -+ spin_unlock_irqrestore(data->lock, flags); -+ -+ return 0; -+} -+ -+static int sunxi_ve_reset_deassert(struct reset_controller_dev *rcdev, -+ unsigned long id) -+{ -+ struct ve_reset_data *data = container_of(rcdev, -+ struct ve_reset_data, -+ rcdev); -+ unsigned long flags; -+ u32 reg; -+ -+ spin_lock_irqsave(data->lock, flags); -+ -+ reg = readl(data->reg); -+ writel(reg | BIT(SUN4I_VE_RESET), data->reg); -+ -+ spin_unlock_irqrestore(data->lock, flags); -+ -+ return 0; -+} -+ -+static int sunxi_ve_of_xlate(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec) -+{ -+ if (WARN_ON(reset_spec->args_count != 0)) -+ return -EINVAL; -+ -+ return 0; -+} -+ -+static struct reset_control_ops sunxi_ve_reset_ops = { -+ .assert = sunxi_ve_reset_assert, -+ .deassert = sunxi_ve_reset_deassert, -+}; -+ -+static void __init sun4i_ve_clk_setup(struct device_node *node) -+{ -+ struct clk *clk; -+ struct clk_divider *div; -+ struct clk_gate *gate; -+ struct ve_reset_data *reset_data; -+ const char *parent; -+ const char *clk_name = node->name; -+ void __iomem *reg; -+ int err; -+ -+ reg = of_io_request_and_map(node, 0, of_node_full_name(node)); -+ if (IS_ERR(reg)) -+ return; -+ -+ div = kzalloc(sizeof(*div), GFP_KERNEL); -+ if (!div) -+ goto err_unmap; -+ -+ gate = kzalloc(sizeof(*gate), GFP_KERNEL); -+ if (!gate) -+ goto err_free_div; -+ -+ of_property_read_string(node, "clock-output-names", &clk_name); -+ parent = of_clk_get_parent_name(node, 0); -+ -+ gate->reg = reg; -+ gate->bit_idx = SUN4I_VE_ENABLE; -+ gate->lock = &ve_lock; -+ -+ div->reg = reg; -+ div->shift = SUN4I_VE_DIVIDER_SHIFT; -+ div->width = SUN4I_VE_DIVIDER_WIDTH; -+ div->lock = &ve_lock; -+ -+ clk = clk_register_composite(NULL, clk_name, &parent, 1, -+ NULL, NULL, -+ &div->hw, &clk_divider_ops, -+ &gate->hw, &clk_gate_ops, -+ CLK_SET_RATE_PARENT); -+ if (IS_ERR(clk)) -+ goto err_free_gate; -+ -+ err = of_clk_add_provider(node, of_clk_src_simple_get, clk); -+ if (err) -+ goto err_unregister_clk; -+ -+ reset_data = kzalloc(sizeof(*reset_data), GFP_KERNEL); -+ if (!reset_data) -+ goto err_del_provider; -+ -+ reset_data->reg = reg; -+ reset_data->lock = &ve_lock; -+ reset_data->rcdev.nr_resets = 1; -+ reset_data->rcdev.ops = &sunxi_ve_reset_ops; -+ reset_data->rcdev.of_node = node; -+ reset_data->rcdev.of_xlate = sunxi_ve_of_xlate; -+ reset_data->rcdev.of_reset_n_cells = 0; -+ err = reset_controller_register(&reset_data->rcdev); -+ if (err) -+ goto err_free_reset; -+ -+ return; -+ -+err_free_reset: -+ kfree(reset_data); -+err_del_provider: -+ of_clk_del_provider(node); -+err_unregister_clk: -+ clk_unregister(clk); -+err_free_gate: -+ kfree(gate); -+err_free_div: -+ kfree(div); -+err_unmap: -+ iounmap(reg); -+} -+CLK_OF_DECLARE(sun4i_ve, "allwinner,sun4i-a10-ve-clk", -+ sun4i_ve_clk_setup); diff --git a/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch b/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch deleted file mode 100644 index cfcf9bfb4..000000000 --- a/target/linux/sunxi/patches-4.4/111-1-dt-sun4i-add-ve-clock-module.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1ccc4939220cf815c309feddcf82dba260499194 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:45 +0800 -Subject: [PATCH] ARM: dts: sun4i: Add VE (Video Engine) module clock node - -The video engine has its own module clock, which also includes a -reset control for it. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun4i-a10.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/arch/arm/boot/dts/sun4i-a10.dtsi -+++ b/arch/arm/boot/dts/sun4i-a10.dtsi -@@ -520,6 +520,15 @@ - "dram_de_mp", "dram_ace"; - }; - -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch b/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch deleted file mode 100644 index 85d2d3161..000000000 --- a/target/linux/sunxi/patches-4.4/111-2-dt-sun7i-add-ve-clock-module.patch +++ /dev/null @@ -1,32 +0,0 @@ -From f0571ab140723f9a898d4a404118580534dcc468 Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Sat, 5 Dec 2015 21:16:47 +0800 -Subject: [PATCH] ARM: dts: sun7i: Add VE (Video Engine) module clock node - -The video engine has its own module clock, which also includes a -reset control for it. - -Signed-off-by: Chen-Yu Tsai -Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/sun7i-a20.dtsi | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/arch/arm/boot/dts/sun7i-a20.dtsi -+++ b/arch/arm/boot/dts/sun7i-a20.dtsi -@@ -527,6 +527,15 @@ - "dram_de_mp", "dram_ace"; - }; - -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ - codec_clk: clk@01c20140 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-codec-clk"; diff --git a/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch b/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch deleted file mode 100644 index 49c7162a6..000000000 --- a/target/linux/sunxi/patches-4.4/115-musb-ignore-vbus-errors.patch +++ /dev/null @@ -1,26 +0,0 @@ -From fce20ac5d8c98f1a8ea5298051d9fa669e455f04 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Tue, 4 Aug 2015 23:22:45 +0200 -Subject: [PATCH] musb: sunxi: Ignore VBus errors in host-only mode - -For some unclear reason sometimes we get VBus errors in host-only mode, -even though we do not have any vbus-detection then. Ignore these. - -Signed-off-by: Hans de Goede ---- - drivers/usb/musb/sunxi.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/usb/musb/sunxi.c -+++ b/drivers/usb/musb/sunxi.c -@@ -194,6 +194,10 @@ static irqreturn_t sunxi_musb_interrupt( - musb_writeb(musb->mregs, MUSB_FADDR, 0); - } - -+ /* Ignore Vbus errors when in host only mode */ -+ if (musb->port_mode == MUSB_PORT_MODE_HOST) -+ musb->int_usb &= ~MUSB_INTR_VBUSERROR; -+ - musb->int_tx = readw(musb->mregs + SUNXI_MUSB_INTRTX); - if (musb->int_tx) - writew(musb->int_tx, musb->mregs + SUNXI_MUSB_INTRTX); diff --git a/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch b/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch deleted file mode 100644 index 47dce12a9..000000000 --- a/target/linux/sunxi/patches-4.4/130-pinctrl-sunxi-add-h3-pio.patch +++ /dev/null @@ -1,568 +0,0 @@ -From 03b83828e452418c18ba506e3e02b5deadbb53fa Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 27 Oct 2015 17:50:23 +0100 -Subject: [PATCH] pinctrl: sunxi: Add H3 PIO controller support - -The H3 uses the same pin controller as previous SoC's from Allwinner. -Add support for the pins controlled by the main PIO controller. - -Signed-off-by: Jens Kuske -Acked-by: Maxime Ripard ---- - .../bindings/pinctrl/allwinner,sunxi-pinctrl.txt | 1 + - drivers/pinctrl/sunxi/Kconfig | 4 + - drivers/pinctrl/sunxi/Makefile | 1 + - drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c | 516 +++++++++++++++++++++ - 4 files changed, 522 insertions(+) - create mode 100644 drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c - ---- a/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -+++ b/Documentation/devicetree/bindings/pinctrl/allwinner,sunxi-pinctrl.txt -@@ -18,6 +18,7 @@ Required properties: - "allwinner,sun8i-a23-r-pinctrl" - "allwinner,sun8i-a33-pinctrl" - "allwinner,sun8i-a83t-pinctrl" -+ "allwinner,sun8i-h3-pinctrl" - - - reg: Should contain the register physical address and length for the - pin controller. ---- a/drivers/pinctrl/sunxi/Kconfig -+++ b/drivers/pinctrl/sunxi/Kconfig -@@ -51,6 +51,10 @@ config PINCTRL_SUN8I_A23_R - depends on RESET_CONTROLLER - select PINCTRL_SUNXI_COMMON - -+config PINCTRL_SUN8I_H3 -+ def_bool MACH_SUN8I -+ select PINCTRL_SUNXI_COMMON -+ - config PINCTRL_SUN9I_A80 - def_bool MACH_SUN9I - select PINCTRL_SUNXI_COMMON ---- a/drivers/pinctrl/sunxi/Makefile -+++ b/drivers/pinctrl/sunxi/Makefile -@@ -13,4 +13,5 @@ obj-$(CONFIG_PINCTRL_SUN8I_A23) += pinc - obj-$(CONFIG_PINCTRL_SUN8I_A23_R) += pinctrl-sun8i-a23-r.o - obj-$(CONFIG_PINCTRL_SUN8I_A33) += pinctrl-sun8i-a33.o - obj-$(CONFIG_PINCTRL_SUN8I_A83T) += pinctrl-sun8i-a83t.o -+obj-$(CONFIG_PINCTRL_SUN8I_H3) += pinctrl-sun8i-h3.o - obj-$(CONFIG_PINCTRL_SUN9I_A80) += pinctrl-sun9i-a80.o ---- /dev/null -+++ b/drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c -@@ -0,0 +1,516 @@ -+/* -+ * Allwinner H3 SoCs pinctrl driver. -+ * -+ * Copyright (C) 2015 Jens Kuske -+ * -+ * Based on pinctrl-sun8i-a23.c, which is: -+ * Copyright (C) 2014 Chen-Yu Tsai -+ * Copyright (C) 2014 Maxime Ripard -+ * -+ * This file is licensed under the terms of the GNU General Public -+ * License version 2. This program is licensed "as is" without any -+ * warranty of any kind, whether express or implied. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "pinctrl-sunxi.h" -+ -+static const struct sunxi_desc_pin sun8i_h3_pins[] = { -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* TX */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* MS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* RX */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* CK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* DO */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ -+ SUNXI_FUNCTION(0x3, "jtag"), /* DI */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart0"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart0"), /* RX */ -+ SUNXI_FUNCTION(0x3, "pwm0"), -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* PWREN */ -+ SUNXI_FUNCTION(0x3, "pwm1"), -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* DATA */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* RST */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "sim"), /* DET */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */ -+ SUNXI_FUNCTION(0x3, "di"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */ -+ SUNXI_FUNCTION(0x3, "di"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* CS */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* RTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spi1"), /* MISO */ -+ SUNXI_FUNCTION(0x3, "uart3"), /* CTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "spdif"), /* OUT */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* SYNC */ -+ SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */ -+ SUNXI_FUNCTION(0x3, "sim"), /* VPPEN */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */ -+ SUNXI_FUNCTION(0x3, "sim"), /* VPPPP */ -+ SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* WE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* ALE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* MISO */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* CLE */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */ -+ SUNXI_FUNCTION(0x3, "spi0")), /* CS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0")), /* CE0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* RE */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQ6 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQ7 */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "nand"), /* DQS */ -+ SUNXI_FUNCTION(0x3, "mmc2")), /* RST */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXD0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXCTL/RCDV */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* RXERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD2L */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXD0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* CRS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXCTL/TXEN */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* TXERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* CLKIN/COL */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* MDC */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "emac")), /* MDIO */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* PCLK */ -+ SUNXI_FUNCTION(0x3, "ts")), /* CLK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* MCLK */ -+ SUNXI_FUNCTION(0x3, "ts")), /* ERR */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */ -+ SUNXI_FUNCTION(0x3, "ts")), /* SYNC */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */ -+ SUNXI_FUNCTION(0x3, "ts")), /* DVLD */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D0 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D1 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D2 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D3 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D4 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D5 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D6 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* D7 */ -+ SUNXI_FUNCTION(0x3, "ts")), /* D7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* SCK */ -+ SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "csi"), /* SDA */ -+ SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out")), -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out")), -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* MS */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* DI */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */ -+ SUNXI_FUNCTION(0x3, "uart0")), /* TX */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* DO */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */ -+ SUNXI_FUNCTION(0x3, "uart0")), /* RX */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */ -+ SUNXI_FUNCTION(0x3, "jtag")), /* CK */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc0")), /* DET */ -+ /* Hole */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 0)), /* PG_EINT0 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 1)), /* PG_EINT1 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 2)), /* PG_EINT2 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 3)), /* PG_EINT3 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 4)), /* PG_EINT4 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 5)), /* PG_EINT5 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* TX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 6)), /* PG_EINT6 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* RX */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 7)), /* PG_EINT7 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 8)), /* PG_EINT8 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 9)), /* PG_EINT9 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* SYNC */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 10)), /* PG_EINT10 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* CLK */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 11)), /* PG_EINT11 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 12)), /* PG_EINT12 */ -+ SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13), -+ SUNXI_FUNCTION(0x0, "gpio_in"), -+ SUNXI_FUNCTION(0x1, "gpio_out"), -+ SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */ -+ SUNXI_FUNCTION_IRQ_BANK(0x4, 1, 13)), /* PG_EINT13 */ -+}; -+ -+static const struct sunxi_pinctrl_desc sun8i_h3_pinctrl_data = { -+ .pins = sun8i_h3_pins, -+ .npins = ARRAY_SIZE(sun8i_h3_pins), -+ .irq_banks = 2, -+}; -+ -+static int sun8i_h3_pinctrl_probe(struct platform_device *pdev) -+{ -+ return sunxi_pinctrl_init(pdev, -+ &sun8i_h3_pinctrl_data); -+} -+ -+static const struct of_device_id sun8i_h3_pinctrl_match[] = { -+ { .compatible = "allwinner,sun8i-h3-pinctrl", }, -+ {} -+}; -+ -+static struct platform_driver sun8i_h3_pinctrl_driver = { -+ .probe = sun8i_h3_pinctrl_probe, -+ .driver = { -+ .name = "sun8i-h3-pinctrl", -+ .of_match_table = sun8i_h3_pinctrl_match, -+ }, -+}; -+builtin_platform_driver(sun8i_h3_pinctrl_driver); diff --git a/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch b/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch deleted file mode 100644 index f8e599fbe..000000000 --- a/target/linux/sunxi/patches-4.4/131-reset-add-h3-resets.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 5f0bb9d0bc545ef53a83f7bd176fdc0736eed8e5 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 27 Oct 2015 17:50:24 +0100 -Subject: [PATCH] reset: sunxi: Add Allwinner H3 bus resets - -The H3 bus resets have some holes between the registers, so we add -an of_xlate() function to skip them according to the datasheet. - -Signed-off-by: Jens Kuske ---- - .../bindings/reset/allwinner,sunxi-clock-reset.txt | 1 + - drivers/reset/reset-sunxi.c | 30 +++++++++++++++++++--- - 2 files changed, 28 insertions(+), 3 deletions(-) - ---- a/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -+++ b/Documentation/devicetree/bindings/reset/allwinner,sunxi-clock-reset.txt -@@ -8,6 +8,7 @@ Required properties: - - compatible: Should be one of the following: - "allwinner,sun6i-a31-ahb1-reset" - "allwinner,sun6i-a31-clock-reset" -+ "allwinner,sun8i-h3-bus-reset" - - reg: should be register base and length as documented in the - datasheet - - #reset-cells: 1, see below ---- a/drivers/reset/reset-sunxi.c -+++ b/drivers/reset/reset-sunxi.c -@@ -75,7 +75,9 @@ static struct reset_control_ops sunxi_re - .deassert = sunxi_reset_deassert, - }; - --static int sunxi_reset_init(struct device_node *np) -+static int sunxi_reset_init(struct device_node *np, -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec)) - { - struct sunxi_reset_data *data; - struct resource res; -@@ -108,6 +110,7 @@ static int sunxi_reset_init(struct devic - data->rcdev.nr_resets = size * 32; - data->rcdev.ops = &sunxi_reset_ops; - data->rcdev.of_node = np; -+ data->rcdev.of_xlate = of_xlate; - reset_controller_register(&data->rcdev); - - return 0; -@@ -117,6 +120,21 @@ err_alloc: - return ret; - }; - -+static int sun8i_h3_bus_reset_xlate(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec) -+{ -+ unsigned int index = reset_spec->args[0]; -+ -+ if (index < 96) -+ return index; -+ else if (index < 128) -+ return index + 32; -+ else if (index < 160) -+ return index + 64; -+ else -+ return -EINVAL; -+} -+ - /* - * These are the reset controller we need to initialize early on in - * our system, before we can even think of using a regular device -@@ -124,15 +142,21 @@ err_alloc: - */ - static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = { - { .compatible = "allwinner,sun6i-a31-ahb1-reset", }, -+ { .compatible = "allwinner,sun8i-h3-bus-reset", .data = sun8i_h3_bus_reset_xlate, }, - { /* sentinel */ }, - }; - - void __init sun6i_reset_init(void) - { - struct device_node *np; -- -- for_each_matching_node(np, sunxi_early_reset_dt_ids) -- sunxi_reset_init(np); -+ const struct of_device_id *match; -+ int (*of_xlate)(struct reset_controller_dev *rcdev, -+ const struct of_phandle_args *reset_spec); -+ -+ for_each_matching_node_and_match(np, sunxi_early_reset_dt_ids, &match) { -+ of_xlate = match->data; -+ sunxi_reset_init(np, of_xlate); -+ } - } - - /* diff --git a/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch b/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch deleted file mode 100644 index 13d44e446..000000000 --- a/target/linux/sunxi/patches-4.4/132-dt-sun8i-add-h3-usbclocks.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d6a71e3caae07fb2d98e93ee62477273abaceb27 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Tue, 3 Nov 2015 15:13:00 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add support for H3 usb clocks - -Add a node describing the usb-clks found on the H3. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -269,6 +269,18 @@ - "mmc2_sample"; - }; - -+ usb_clk: clk@01c200cc { -+ #clock-cells = <1>; -+ #reset-cells = <1>; -+ compatible = "allwinner,sun8i-h3-usb-clk"; -+ reg = <0x01c200cc 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "usb_phy0", "usb_phy1", -+ "usb_phy2", "usb_phy3", -+ "usb_ohci0", "usb_ohci1", -+ "usb_ohci2", "usb_ohci3"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; diff --git a/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch b/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch deleted file mode 100644 index 78dcaa9fe..000000000 --- a/target/linux/sunxi/patches-4.4/133-dt-sun8i-add-usbphy-usbhost-ctrl-nodes.patch +++ /dev/null @@ -1,123 +0,0 @@ -From 5971a2f283d21eab36d7de24d35301f081f83418 Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Tue, 3 Nov 2015 15:14:20 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add usbphy and usb host controller nodes - -Add nodes describing the H3's usbphy and usb host controller nodes. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun8i-h3.dtsi | 101 ++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 101 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3.dtsi -+++ b/arch/arm/boot/dts/sun8i-h3.dtsi -@@ -362,6 +362,107 @@ - #size-cells = <0>; - }; - -+ usbphy: phy@01c19400 { -+ compatible = "allwinner,sun8i-h3-usb-phy"; -+ reg = <0x01c19400 0x2c>, -+ <0x01c1a800 0x4>, -+ <0x01c1b800 0x4>, -+ <0x01c1c800 0x4>, -+ <0x01c1d800 0x4>; -+ reg-names = "phy_ctrl", -+ "pmu0", -+ "pmu1", -+ "pmu2", -+ "pmu3"; -+ clocks = <&usb_clk 8>, -+ <&usb_clk 9>, -+ <&usb_clk 10>, -+ <&usb_clk 11>; -+ clock-names = "usb0_phy", -+ "usb1_phy", -+ "usb2_phy", -+ "usb3_phy"; -+ resets = <&usb_clk 0>, -+ <&usb_clk 1>, -+ <&usb_clk 2>, -+ <&usb_clk 3>; -+ reset-names = "usb0_reset", -+ "usb1_reset", -+ "usb2_reset", -+ "usb3_reset"; -+ status = "disabled"; -+ #phy-cells = <1>; -+ }; -+ -+ ehci1: usb@01c1b000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1b000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 25>, <&bus_gates 29>; -+ resets = <&ahb_rst 25>, <&ahb_rst 29>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci1: usb@01c1b400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1b400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 29>, <&bus_gates 25>, -+ <&usb_clk 17>; -+ resets = <&ahb_rst 29>, <&ahb_rst 25>; -+ phys = <&usbphy 1>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ehci2: usb@01c1c000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1c000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 26>, <&bus_gates 30>; -+ resets = <&ahb_rst 26>, <&ahb_rst 30>; -+ phys = <&usbphy 2>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci2: usb@01c1c400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1c400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 30>, <&bus_gates 26>, -+ <&usb_clk 18>; -+ resets = <&ahb_rst 30>, <&ahb_rst 26>; -+ phys = <&usbphy 2>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ehci3: usb@01c1d000 { -+ compatible = "allwinner,sun8i-h3-ehci", "generic-ehci"; -+ reg = <0x01c1d000 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 27>, <&bus_gates 31>; -+ resets = <&ahb_rst 27>, <&ahb_rst 31>; -+ phys = <&usbphy 3>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ -+ ohci3: usb@01c1d400 { -+ compatible = "allwinner,sun8i-h3-ohci", "generic-ohci"; -+ reg = <0x01c1d400 0x100>; -+ interrupts = ; -+ clocks = <&bus_gates 31>, <&bus_gates 27>, -+ <&usb_clk 19>; -+ resets = <&ahb_rst 31>, <&ahb_rst 27>; -+ phys = <&usbphy 3>; -+ phy-names = "usb"; -+ status = "disabled"; -+ }; -+ - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-h3-pinctrl"; - reg = <0x01c20800 0x400>; diff --git a/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch b/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch deleted file mode 100644 index 733639225..000000000 --- a/target/linux/sunxi/patches-4.4/134-dt-sun8i-orangepiplus-enable-usbhost.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 37e04fd781d3fc6d08116d38d34ec8124d916441 Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Tue, 17 Nov 2015 17:12:07 +0100 -Subject: [PATCH] ARM: dts: sun8i-h3-orangepi-plus: Enable USB host controllers - -Enable the 2 USB host controllers used on the Orange Pi Plus -and add the necessary regulators. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede -Signed-off-by: Jens Kuske ---- - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 44 ++++++++++++++++++++++++++++ - 1 file changed, 44 insertions(+) - ---- a/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -@@ -58,6 +58,35 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ reg_usb3_vbus: usb3-vbus { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb3_vbus_pin_a>; -+ regulator-name = "usb3-vbus"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-boot-on; -+ enable-active-high; -+ gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ehci3 { -+ status = "okay"; -+}; -+ -+&pio { -+ usb3_vbus_pin_a: usb3_vbus_pin@0 { -+ allwinner,pins = "PG11"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - &mmc0 { -@@ -70,8 +99,23 @@ - status = "okay"; - }; - -+®_usb1_vbus { -+ gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usb1_vbus_pin_a { -+ allwinner,pins = "PG13"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb3_vbus-supply = <®_usb3_vbus>; -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch b/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch deleted file mode 100644 index a4b2af9e5..000000000 --- a/target/linux/sunxi/patches-4.4/135-clk-sunxi-fix-signedness-bug.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b1558f168f4ef5956913d73fe330c4da85c74349 Mon Sep 17 00:00:00 2001 -From: Dan Carpenter -Date: Sat, 12 Dec 2015 15:43:46 +0300 -Subject: [PATCH] clk: sunxi: signedness bug in sun8i_h3_bus_gates_init() - -"index" needs to be signed for the error handling to work. - -Fixes: ab6e23a4e388 ('clk: sunxi: Add H3 clocks support') -Signed-off-by: Dan Carpenter -Signed-off-by: Maxime Ripard ---- - drivers/clk/sunxi/clk-sun8i-bus-gates.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c -+++ b/drivers/clk/sunxi/clk-sun8i-bus-gates.c -@@ -40,7 +40,7 @@ static void __init sun8i_h3_bus_gates_in - const __be32 *p; - int number, i; - u8 clk_bit; -- u32 index; -+ int index; - - reg = of_io_request_and_map(node, 0, of_node_full_name(node)); - if (IS_ERR(reg)) diff --git a/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch b/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch deleted file mode 100644 index c7e0e2bf6..000000000 --- a/target/linux/sunxi/patches-4.4/140-reset-add-of_reset_control_get_by_index.patch +++ /dev/null @@ -1,109 +0,0 @@ -From b4faa163a7ebae9faab5d0aefe70143e3379178b Mon Sep 17 00:00:00 2001 -From: Vince Hsu -Date: Mon, 13 Jul 2015 13:39:39 +0100 -Subject: [PATCH] reset: add of_reset_control_get_by_index() - -Add of_reset_control_get_by_index() to allow the drivers to get reset -device without knowing its name. - -Signed-off-by: Vince Hsu -[jonathanh@nvidia.com: Updated stub function to return -ENOTSUPP instead - of -ENOSYS which should only be used for system calls.] -Signed-off-by: Jon Hunter -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 40 +++++++++++++++++++++++++++++----------- - include/linux/reset.h | 9 +++++++++ - 2 files changed, 38 insertions(+), 11 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -141,27 +141,24 @@ int reset_control_status(struct reset_co - EXPORT_SYMBOL_GPL(reset_control_status); - - /** -- * of_reset_control_get - Lookup and obtain a reference to a reset controller. -+ * of_reset_control_get_by_index - Lookup and obtain a reference to a reset -+ * controller by index. - * @node: device to be reset by the controller -- * @id: reset line name -- * -- * Returns a struct reset_control or IS_ERR() condition containing errno. -+ * @index: index of the reset controller - * -- * Use of id names is optional. -+ * This is to be used to perform a list of resets for a device or power domain -+ * in whatever order. Returns a struct reset_control or IS_ERR() condition -+ * containing errno. - */ --struct reset_control *of_reset_control_get(struct device_node *node, -- const char *id) -+struct reset_control *of_reset_control_get_by_index(struct device_node *node, -+ int index) - { - struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER); - struct reset_controller_dev *r, *rcdev; - struct of_phandle_args args; -- int index = 0; - int rstc_id; - int ret; - -- if (id) -- index = of_property_match_string(node, -- "reset-names", id); - ret = of_parse_phandle_with_args(node, "resets", "#reset-cells", - index, &args); - if (ret) -@@ -202,6 +199,27 @@ struct reset_control *of_reset_control_g - - return rstc; - } -+EXPORT_SYMBOL_GPL(of_reset_control_get_by_index); -+ -+/** -+ * of_reset_control_get - Lookup and obtain a reference to a reset controller. -+ * @node: device to be reset by the controller -+ * @id: reset line name -+ * -+ * Returns a struct reset_control or IS_ERR() condition containing errno. -+ * -+ * Use of id names is optional. -+ */ -+struct reset_control *of_reset_control_get(struct device_node *node, -+ const char *id) -+{ -+ int index = 0; -+ -+ if (id) -+ index = of_property_match_string(node, -+ "reset-names", id); -+ return of_reset_control_get_by_index(node, index); -+} - EXPORT_SYMBOL_GPL(of_reset_control_get); - - /** ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -38,6 +38,9 @@ static inline struct reset_control *devm - struct reset_control *of_reset_control_get(struct device_node *node, - const char *id); - -+struct reset_control *of_reset_control_get_by_index( -+ struct device_node *node, int index); -+ - #else - - static inline int reset_control_reset(struct reset_control *rstc) -@@ -106,6 +109,12 @@ static inline struct reset_control *of_r - return ERR_PTR(-ENOSYS); - } - -+static inline struct reset_control *of_reset_control_get_by_index( -+ struct device_node *node, int index) -+{ -+ return ERR_PTR(-ENOTSUPP); -+} -+ - #endif /* CONFIG_RESET_CONTROLLER */ - - #endif diff --git a/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch b/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch deleted file mode 100644 index eeab4972b..000000000 --- a/target/linux/sunxi/patches-4.4/141-reset-fix-of_reset_control_get.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 7fd7a26b60090a7df15f30ba10b0d39cbbd6a94e Mon Sep 17 00:00:00 2001 -From: Alban Bedel -Date: Tue, 1 Sep 2015 17:28:31 +0200 -Subject: [PATCH] reset: Fix of_reset_control_get() for consistent return - values - -When of_reset_control_get() is called without connection ID it returns --ENOENT when the 'resets' property doesn't exists or is an empty entry. -However when a connection ID is given it returns -EINVAL when the 'resets' -property doesn't exists or the requested name can't be found. This is -because the error code returned by of_property_match_string() is just -passed down as an index to of_parse_phandle_with_args(), which then -returns -EINVAL. - -To get a consistent return value with both code paths we must return --ENOENT when of_property_match_string() fails. - -Signed-off-by: Alban Bedel -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -215,9 +215,12 @@ struct reset_control *of_reset_control_g - { - int index = 0; - -- if (id) -+ if (id) { - index = of_property_match_string(node, - "reset-names", id); -+ if (index < 0) -+ return ERR_PTR(-ENOENT); -+ } - return of_reset_control_get_by_index(node, index); - } - EXPORT_SYMBOL_GPL(of_reset_control_get); diff --git a/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch b/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch deleted file mode 100644 index 665b15b00..000000000 --- a/target/linux/sunxi/patches-4.4/142-reset-use-ENOTSUPP-instead-of-ENOSYS.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 5a819175b911ce33f3337e1e069d4bcea1ec4788 Mon Sep 17 00:00:00 2001 -From: Philipp Zabel -Date: Thu, 29 Oct 2015 09:55:00 +0100 -Subject: [PATCH] reset: use ENOTSUPP instead of ENOSYS - -ENOSYS is reserved to report invalid syscalls to userspace. -Consistently return ENOTSUPP to indicate that the driver doesn't support -the functionality or the reset framework is not enabled at all. - -Signed-off-by: Philipp Zabel ---- - drivers/reset/core.c | 8 ++++---- - include/linux/reset.h | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -95,7 +95,7 @@ int reset_control_reset(struct reset_con - if (rstc->rcdev->ops->reset) - return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_reset); - -@@ -108,7 +108,7 @@ int reset_control_assert(struct reset_co - if (rstc->rcdev->ops->assert) - return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_assert); - -@@ -121,7 +121,7 @@ int reset_control_deassert(struct reset_ - if (rstc->rcdev->ops->deassert) - return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_deassert); - -@@ -136,7 +136,7 @@ int reset_control_status(struct reset_co - if (rstc->rcdev->ops->status) - return rstc->rcdev->ops->status(rstc->rcdev, rstc->id); - -- return -ENOSYS; -+ return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_status); - ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -74,7 +74,7 @@ static inline void reset_control_put(str - - static inline int device_reset_optional(struct device *dev) - { -- return -ENOSYS; -+ return -ENOTSUPP; - } - - static inline struct reset_control *__must_check reset_control_get( -@@ -94,19 +94,19 @@ static inline struct reset_control *__mu - static inline struct reset_control *reset_control_get_optional( - struct device *dev, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *devm_reset_control_get_optional( - struct device *dev, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *of_reset_control_get( - struct device_node *node, const char *id) - { -- return ERR_PTR(-ENOSYS); -+ return ERR_PTR(-ENOTSUPP); - } - - static inline struct reset_control *of_reset_control_get_by_index( diff --git a/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch b/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch deleted file mode 100644 index e1078e969..000000000 --- a/target/linux/sunxi/patches-4.4/143-reset-add-shared-resetcontrol-asserts.patch +++ /dev/null @@ -1,265 +0,0 @@ -From d25cfe9b4f9663216ce4e011e3f1e7fa669ab58a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 27 Nov 2015 21:09:05 +0100 -Subject: [PATCH] reset: Add shared reset_control_[de]assert variants - -Add reset_control_deassert_shared / reset_control_assert_shared -functions which are intended for use by drivers for hw blocks which -(may) share a reset line with another driver / hw block. - -Unlike the regular reset_control_[de]assert functions these functions -keep track of how often deassert_shared / assert_shared have been called -and keep the line deasserted as long as deassert has been called more -times than assert. - -Signed-off-by: Hans de Goede ---- -Changes in v2: --This is a new patch in v2 of this patch-set ---- - drivers/reset/core.c | 121 ++++++++++++++++++++++++++++++++++++--- - include/linux/reset-controller.h | 2 + - include/linux/reset.h | 2 + - 3 files changed, 116 insertions(+), 9 deletions(-) - ---- a/drivers/reset/core.c -+++ b/drivers/reset/core.c -@@ -22,16 +22,29 @@ static DEFINE_MUTEX(reset_controller_lis - static LIST_HEAD(reset_controller_list); - - /** -+ * struct reset_line - a reset line -+ * @list: list entry for the reset controllers reset line list -+ * @id: ID of the reset line in the reset controller device -+ * @refcnt: Number of reset_control structs referencing this device -+ * @deassert_cnt: Number of times this reset line has been deasserted -+ */ -+struct reset_line { -+ struct list_head list; -+ unsigned int id; -+ unsigned int refcnt; -+ unsigned int deassert_cnt; -+}; -+ -+/** - * struct reset_control - a reset control - * @rcdev: a pointer to the reset controller device - * this reset control belongs to -- * @id: ID of the reset controller in the reset -- * controller device -+ * @line: reset line for this reset control - */ - struct reset_control { - struct reset_controller_dev *rcdev; -+ struct reset_line *line; - struct device *dev; -- unsigned int id; - }; - - /** -@@ -66,6 +79,8 @@ int reset_controller_register(struct res - rcdev->of_xlate = of_reset_simple_xlate; - } - -+ INIT_LIST_HEAD(&rcdev->reset_line_head); -+ - mutex_lock(&reset_controller_list_mutex); - list_add(&rcdev->list, &reset_controller_list); - mutex_unlock(&reset_controller_list_mutex); -@@ -93,7 +108,7 @@ EXPORT_SYMBOL_GPL(reset_controller_unreg - int reset_control_reset(struct reset_control *rstc) - { - if (rstc->rcdev->ops->reset) -- return rstc->rcdev->ops->reset(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->reset(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } -@@ -106,7 +121,7 @@ EXPORT_SYMBOL_GPL(reset_control_reset); - int reset_control_assert(struct reset_control *rstc) - { - if (rstc->rcdev->ops->assert) -- return rstc->rcdev->ops->assert(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->assert(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } -@@ -119,13 +134,55 @@ EXPORT_SYMBOL_GPL(reset_control_assert); - int reset_control_deassert(struct reset_control *rstc) - { - if (rstc->rcdev->ops->deassert) -- return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_deassert); - - /** -+ * reset_control_assert_shared - asserts a shared reset line -+ * @rstc: reset controller -+ * -+ * Assert a shared reset line, this functions decreases the deassert count -+ * of the line by one and asserts it if, and only if, the deassert count -+ * reaches 0. -+ */ -+int reset_control_assert_shared(struct reset_control *rstc) -+{ -+ if (!rstc->rcdev->ops->assert) -+ return -ENOTSUPP; -+ -+ rstc->line->deassert_cnt--; -+ if (rstc->line->deassert_cnt) -+ return 0; -+ -+ return rstc->rcdev->ops->assert(rstc->rcdev, rstc->line->id); -+} -+EXPORT_SYMBOL_GPL(reset_control_assert_shared); -+ -+/** -+ * reset_control_deassert_shared - deasserts a shared reset line -+ * @rstc: reset controller -+ * -+ * Assert a shared reset line, this functions increases the deassert count -+ * of the line by one and deasserts the reset line (if it was not already -+ * deasserted). -+ */ -+int reset_control_deassert_shared(struct reset_control *rstc) -+{ -+ if (!rstc->rcdev->ops->deassert) -+ return -ENOTSUPP; -+ -+ rstc->line->deassert_cnt++; -+ if (rstc->line->deassert_cnt != 1) -+ return 0; -+ -+ return rstc->rcdev->ops->deassert(rstc->rcdev, rstc->line->id); -+} -+EXPORT_SYMBOL_GPL(reset_control_deassert_shared); -+ -+/** - * reset_control_status - returns a negative errno if not supported, a - * positive value if the reset line is asserted, or zero if the reset - * line is not asserted. -@@ -134,12 +191,47 @@ EXPORT_SYMBOL_GPL(reset_control_deassert - int reset_control_status(struct reset_control *rstc) - { - if (rstc->rcdev->ops->status) -- return rstc->rcdev->ops->status(rstc->rcdev, rstc->id); -+ return rstc->rcdev->ops->status(rstc->rcdev, rstc->line->id); - - return -ENOTSUPP; - } - EXPORT_SYMBOL_GPL(reset_control_status); - -+static struct reset_line *reset_line_get(struct reset_controller_dev *rcdev, -+ unsigned int index) -+{ -+ struct reset_line *line; -+ -+ list_for_each_entry(line, &rcdev->reset_line_head, list) { -+ if (line->id == index) { -+ line->refcnt++; -+ return line; -+ } -+ } -+ -+ line = kzalloc(sizeof(*line), GFP_KERNEL); -+ if (!line) -+ return NULL; -+ -+ list_add(&line->list, &rcdev->reset_line_head); -+ line->id = index; -+ line->refcnt = 1; -+ -+ return line; -+} -+ -+static void reset_line_put(struct reset_line *line) -+{ -+ if (!line) -+ return; -+ -+ if (--line->refcnt) -+ return; -+ -+ list_del(&line->list); -+ kfree(line); -+} -+ - /** - * of_reset_control_get_by_index - Lookup and obtain a reference to a reset - * controller by index. -@@ -155,6 +247,7 @@ struct reset_control *of_reset_control_g - { - struct reset_control *rstc = ERR_PTR(-EPROBE_DEFER); - struct reset_controller_dev *r, *rcdev; -+ struct reset_line *line; - struct of_phandle_args args; - int rstc_id; - int ret; -@@ -186,16 +279,22 @@ struct reset_control *of_reset_control_g - } - - try_module_get(rcdev->owner); -+ -+ /* reset_controller_list_mutex also protects the reset_line list */ -+ line = reset_line_get(rcdev, rstc_id); -+ - mutex_unlock(&reset_controller_list_mutex); - - rstc = kzalloc(sizeof(*rstc), GFP_KERNEL); -- if (!rstc) { -+ if (!line || !rstc) { -+ kfree(rstc); -+ reset_line_put(line); - module_put(rcdev->owner); - return ERR_PTR(-ENOMEM); - } - - rstc->rcdev = rcdev; -- rstc->id = rstc_id; -+ rstc->line = line; - - return rstc; - } -@@ -259,6 +358,10 @@ void reset_control_put(struct reset_cont - if (IS_ERR(rstc)) - return; - -+ mutex_lock(&reset_controller_list_mutex); -+ reset_line_put(rstc->line); -+ mutex_unlock(&reset_controller_list_mutex); -+ - module_put(rstc->rcdev->owner); - kfree(rstc); - } ---- a/include/linux/reset-controller.h -+++ b/include/linux/reset-controller.h -@@ -31,6 +31,7 @@ struct of_phandle_args; - * @ops: a pointer to device specific struct reset_control_ops - * @owner: kernel module of the reset controller driver - * @list: internal list of reset controller devices -+ * @reset_line_head: head of internal list of reset lines - * @of_node: corresponding device tree node as phandle target - * @of_reset_n_cells: number of cells in reset line specifiers - * @of_xlate: translation function to translate from specifier as found in the -@@ -41,6 +42,7 @@ struct reset_controller_dev { - struct reset_control_ops *ops; - struct module *owner; - struct list_head list; -+ struct list_head reset_line_head; - struct device_node *of_node; - int of_reset_n_cells; - int (*of_xlate)(struct reset_controller_dev *rcdev, ---- a/include/linux/reset.h -+++ b/include/linux/reset.h -@@ -11,6 +11,8 @@ int reset_control_reset(struct reset_con - int reset_control_assert(struct reset_control *rstc); - int reset_control_deassert(struct reset_control *rstc); - int reset_control_status(struct reset_control *rstc); -+int reset_control_assert_shared(struct reset_control *rstc); -+int reset_control_deassert_shared(struct reset_control *rstc); - - struct reset_control *reset_control_get(struct device *dev, const char *id); - void reset_control_put(struct reset_control *rstc); diff --git a/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch b/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch deleted file mode 100644 index 73cd3027b..000000000 --- a/target/linux/sunxi/patches-4.4/144-usb-ehci-plat-support-multiple-reset-ctrllines.patch +++ /dev/null @@ -1,127 +0,0 @@ -From 957e8f96c67052ca843ea9ffc5223662b973e5de Mon Sep 17 00:00:00 2001 -From: Reinder de Haan -Date: Sun, 15 Nov 2015 14:24:46 +0100 -Subject: [PATCH] ehci-platform: Add support for controllers with multiple - reset lines - -At least the EHCI/OHCI found on the Allwinnner H3 SoC needs multiple -reset lines, the controller will not initialize while the reset for -its companion is still asserted, which means we need to de-assert -2 resets for the controller to work. - -Signed-off-by: Reinder de Haan -Signed-off-by: Hans de Goede ---- -Changes in v2: --Use the new reset_control_[de]assert_shared reset-controller functions ---- - Documentation/devicetree/bindings/usb/usb-ehci.txt | 2 +- - drivers/usb/host/ehci-platform.c | 47 +++++++++++++--------- - 2 files changed, 30 insertions(+), 19 deletions(-) - ---- a/Documentation/devicetree/bindings/usb/usb-ehci.txt -+++ b/Documentation/devicetree/bindings/usb/usb-ehci.txt -@@ -18,7 +18,7 @@ Optional properties: - - clocks : a list of phandle + clock specifier pairs - - phys : phandle + phy specifier pair - - phy-names : "usb" -- - resets : phandle + reset specifier pair -+ - resets : a list of phandle + reset specifier pairs - - Example (Sequoia 440EPx): - ehci@e0000300 { ---- a/drivers/usb/host/ehci-platform.c -+++ b/drivers/usb/host/ehci-platform.c -@@ -39,11 +39,12 @@ - - #define DRIVER_DESC "EHCI generic platform driver" - #define EHCI_MAX_CLKS 3 -+#define EHCI_MAX_RESETS 2 - #define hcd_to_ehci_priv(h) ((struct ehci_platform_priv *)hcd_to_ehci(h)->priv) - - struct ehci_platform_priv { - struct clk *clks[EHCI_MAX_CLKS]; -- struct reset_control *rst; -+ struct reset_control *resets[EHCI_MAX_RESETS]; - struct phy **phys; - int num_phys; - bool reset_on_resume; -@@ -149,7 +150,7 @@ static int ehci_platform_probe(struct pl - struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ehci_platform_priv *priv; - struct ehci_hcd *ehci; -- int err, irq, phy_num, clk = 0; -+ int err, irq, phy_num, clk = 0, rst = 0; - - if (usb_disabled()) - return -ENODEV; -@@ -232,18 +233,24 @@ static int ehci_platform_probe(struct pl - break; - } - } -- } - -- priv->rst = devm_reset_control_get_optional(&dev->dev, NULL); -- if (IS_ERR(priv->rst)) { -- err = PTR_ERR(priv->rst); -- if (err == -EPROBE_DEFER) -- goto err_put_clks; -- priv->rst = NULL; -- } else { -- err = reset_control_deassert(priv->rst); -- if (err) -- goto err_put_clks; -+ for (rst = 0; rst < EHCI_MAX_RESETS; rst++) { -+ priv->resets[rst] = -+ of_reset_control_get_by_index(dev->dev.of_node, -+ rst); -+ if (IS_ERR(priv->resets[rst])) { -+ err = PTR_ERR(priv->resets[rst]); -+ if (err == -EPROBE_DEFER) -+ goto err_reset; -+ priv->resets[rst] = NULL; -+ break; -+ } -+ err = reset_control_deassert_shared(priv->resets[rst]); -+ if (err) { -+ reset_control_put(priv->resets[rst]); -+ goto err_reset; -+ } -+ } - } - - if (pdata->big_endian_desc) -@@ -302,8 +309,10 @@ err_power: - if (pdata->power_off) - pdata->power_off(dev); - err_reset: -- if (priv->rst) -- reset_control_assert(priv->rst); -+ while (--rst >= 0) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - err_put_clks: - while (--clk >= 0) - clk_put(priv->clks[clk]); -@@ -321,15 +330,17 @@ static int ehci_platform_remove(struct p - struct usb_hcd *hcd = platform_get_drvdata(dev); - struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ehci_platform_priv *priv = hcd_to_ehci_priv(hcd); -- int clk; -+ int clk, rst; - - usb_remove_hcd(hcd); - - if (pdata->power_off) - pdata->power_off(dev); - -- if (priv->rst) -- reset_control_assert(priv->rst); -+ for (rst = 0; rst < EHCI_MAX_RESETS && priv->resets[rst]; rst++) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - - for (clk = 0; clk < EHCI_MAX_CLKS && priv->clks[clk]; clk++) - clk_put(priv->clks[clk]); diff --git a/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch b/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch deleted file mode 100644 index a25d487aa..000000000 --- a/target/linux/sunxi/patches-4.4/145-usb-ohci-plat-support-multiple-reset-ctrllines.patch +++ /dev/null @@ -1,128 +0,0 @@ -From 5f0c864c1f207dba1db587747a58ec6b362dadf8 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 29 Nov 2015 18:44:14 +0100 -Subject: [PATCH] ohci-platform: Add support for controllers with multiple - reset lines - -At least the EHCI/OHCI found on the Allwinnner H3 SoC needs multiple -reset lines, the controller will not initialize while the reset for -its companion is still asserted, which means we need to de-assert -2 resets for the controller to work. - -Signed-off-by: Hans de Goede ---- -Changes in v2: --New patch in v2 of this patch-set, to complement the identical patch for - the ehci-platform code ---- - Documentation/devicetree/bindings/usb/usb-ohci.txt | 2 +- - drivers/usb/host/ohci-platform.c | 49 +++++++++++++--------- - 2 files changed, 30 insertions(+), 21 deletions(-) - ---- a/Documentation/devicetree/bindings/usb/usb-ohci.txt -+++ b/Documentation/devicetree/bindings/usb/usb-ohci.txt -@@ -14,7 +14,7 @@ Optional properties: - - clocks : a list of phandle + clock specifier pairs - - phys : phandle + phy specifier pair - - phy-names : "usb" --- resets : phandle + reset specifier pair -+- resets : a list of phandle + reset specifier pairs - - Example: - ---- a/drivers/usb/host/ohci-platform.c -+++ b/drivers/usb/host/ohci-platform.c -@@ -33,11 +33,12 @@ - - #define DRIVER_DESC "OHCI generic platform driver" - #define OHCI_MAX_CLKS 3 -+#define OHCI_MAX_RESETS 2 - #define hcd_to_ohci_priv(h) ((struct ohci_platform_priv *)hcd_to_ohci(h)->priv) - - struct ohci_platform_priv { - struct clk *clks[OHCI_MAX_CLKS]; -- struct reset_control *rst; -+ struct reset_control *resets[OHCI_MAX_RESETS]; - struct phy **phys; - int num_phys; - }; -@@ -117,7 +118,7 @@ static int ohci_platform_probe(struct pl - struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ohci_platform_priv *priv; - struct ohci_hcd *ohci; -- int err, irq, phy_num, clk = 0; -+ int err, irq, phy_num, clk = 0, rst = 0; - - if (usb_disabled()) - return -ENODEV; -@@ -195,19 +196,23 @@ static int ohci_platform_probe(struct pl - break; - } - } -- -- } -- -- priv->rst = devm_reset_control_get_optional(&dev->dev, NULL); -- if (IS_ERR(priv->rst)) { -- err = PTR_ERR(priv->rst); -- if (err == -EPROBE_DEFER) -- goto err_put_clks; -- priv->rst = NULL; -- } else { -- err = reset_control_deassert(priv->rst); -- if (err) -- goto err_put_clks; -+ for (rst = 0; rst < OHCI_MAX_RESETS; rst++) { -+ priv->resets[rst] = -+ of_reset_control_get_by_index(dev->dev.of_node, -+ rst); -+ if (IS_ERR(priv->resets[rst])) { -+ err = PTR_ERR(priv->resets[rst]); -+ if (err == -EPROBE_DEFER) -+ goto err_reset; -+ priv->resets[rst] = NULL; -+ break; -+ } -+ err = reset_control_deassert_shared(priv->resets[rst]); -+ if (err) { -+ reset_control_put(priv->resets[rst]); -+ goto err_reset; -+ } -+ } - } - - if (pdata->big_endian_desc) -@@ -265,8 +270,10 @@ err_power: - if (pdata->power_off) - pdata->power_off(dev); - err_reset: -- if (priv->rst) -- reset_control_assert(priv->rst); -+ while (--rst >= 0) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - err_put_clks: - while (--clk >= 0) - clk_put(priv->clks[clk]); -@@ -284,15 +291,17 @@ static int ohci_platform_remove(struct p - struct usb_hcd *hcd = platform_get_drvdata(dev); - struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev); - struct ohci_platform_priv *priv = hcd_to_ohci_priv(hcd); -- int clk; -+ int clk, rst; - - usb_remove_hcd(hcd); - - if (pdata->power_off) - pdata->power_off(dev); - -- if (priv->rst) -- reset_control_assert(priv->rst); -+ for (rst = 0; rst < OHCI_MAX_RESETS && priv->resets[rst]; rst++) { -+ reset_control_assert_shared(priv->resets[rst]); -+ reset_control_put(priv->resets[rst]); -+ } - - for (clk = 0; clk < OHCI_MAX_CLKS && priv->clks[clk]; clk++) - clk_put(priv->clks[clk]); diff --git a/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch b/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch deleted file mode 100644 index c967ca91a..000000000 --- a/target/linux/sunxi/patches-4.4/150-dt-sun7i-enable-codec-on-pcduino3.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 5296d8ff65298091758aa8d50d00539cd3781042 Mon Sep 17 00:00:00 2001 -From: Jelle van der Waa -Date: Sun, 9 Aug 2015 18:51:22 +0200 -Subject: [PATCH] ARM: dts: sun7i: Enable audio codec on pcDuino - -Enable the on-chip audio codec - -Signed-off-by: Jelle van der Waa -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/sun7i-a20-pcduino3.dts | 5 +++++ - 1 file changed, 5 insertions(+) - ---- a/arch/arm/boot/dts/sun7i-a20-pcduino3.dts -+++ b/arch/arm/boot/dts/sun7i-a20-pcduino3.dts -@@ -111,6 +111,11 @@ - allwinner,pins = "PH2"; - }; - -+ -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; diff --git a/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch b/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch deleted file mode 100644 index b1e00b45a..000000000 --- a/target/linux/sunxi/patches-4.4/200-dt-sun7i-add-lamobo-r1.patch +++ /dev/null @@ -1,330 +0,0 @@ -From 46662c86b453d7098ff22d6112d0481f07d523a1 Mon Sep 17 00:00:00 2001 -From: Jelle de Jong -Date: Sun, 18 Oct 2015 16:34:39 +0200 -Subject: [PATCH] ARM: dts: sun7i: Add dts file for the lamobo-r1 board - -The lamobo-r1 board, sometimes called the BPI-R1 but not labelled as such -on the PCB, is meant as a A20 based router board. As such the board comes -with a built-in switch chip giving it 5 gigabit ethernet boards, and it -has a large empty area on the pcb with mounting holes which will fit a -2.5 inch harddisk. To complete its networking features it has a -Realtek RTL8192CU for WiFi 802.11 b/g/n. - -Signed-off-by: Jelle de Jong -Signed-off-by: Hans de Goede ---- - arch/arm/boot/dts/Makefile | 1 + - arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts | 297 ++++++++++++++++++++++++++++++ - 2 files changed, 298 insertions(+) - create mode 100644 arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts - ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -638,6 +638,7 @@ dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-cubietruck.dtb \ - sun7i-a20-hummingbird.dtb \ - sun7i-a20-i12-tvbox.dtb \ -+ sun7i-a20-lamobo-r1.dtb \ - sun7i-a20-m3.dtb \ - sun7i-a20-mk808c.dtb \ - sun7i-a20-olimex-som-evb.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts -@@ -0,0 +1,297 @@ -+/* -+ * Copyright 2015 Jelle de Jong -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "Lamobo R1"; -+ compatible = "lamobo,lamobo-r1", "allwinner,sun7i-a20"; -+ -+ aliases { -+ serial0 = &uart0; -+ serial1 = &uart3; -+ serial2 = &uart7; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_lamobo_r1>; -+ -+ green { -+ label = "lamobo_r1:green:usr"; -+ gpios = <&pio 7 24 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ reg_gmac_3v3: gmac-3v3 { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_power_pin_lamobo_r1>; -+ regulator-name = "gmac-3v3"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ startup-delay-us = <100000>; -+ enable-active-high; -+ gpio = <&pio 7 23 GPIO_ACTIVE_HIGH>; /* PH23 */ -+ }; -+}; -+ -+&ahci_pwr_pin_a { -+ allwinner,pins = "PB3"; -+}; -+ -+&ahci { -+ target-supply = <®_ahci_5v>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+ operating-points = < -+ /* kHz uV */ -+ 960000 1400000 -+ 912000 1400000 -+ 864000 1350000 -+ 720000 1250000 -+ 528000 1150000 -+ 312000 1100000 -+ 144000 1050000 -+ >; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_rgmii_a>; -+ phy = <&phy1>; -+ phy-mode = "rgmii"; -+ phy-supply = <®_gmac_3v3>; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+&ir0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir0_rx_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_lamobo_r1>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_lamobo_r1: mmc0_cd_pin@0 { -+ allwinner,pins = "PH10"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ gmac_power_pin_lamobo_r1: gmac_power_pin@0 { -+ allwinner,pins = "PH23"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ led_pins_lamobo_r1: led_pins@0 { -+ allwinner,pins = "PH24"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+#include "axp209.dtsi" -+ -+®_ahci_5v { -+ gpio = <&pio 1 3 0>; /* PB3 */ -+ status = "okay"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&spi0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&spi0_pins_a>, -+ <&spi0_cs0_pins_a>, -+ <&spi0_cs1_pins_a>; -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&uart3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart3_pins_b>; -+ status = "okay"; -+}; -+ -+&uart7 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart7_pins_a>; -+ status = "okay"; -+}; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; diff --git a/target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch b/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch similarity index 59% rename from target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch rename to target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch index 67094a4be..c304f7937 100644 --- a/target/linux/sunxi/patches-4.4/104-2-dt-sun8i-add-orangepi-plus.patch +++ b/target/linux/sunxi/patches-4.9/0045-arm-dts-sun8i-add-common-dtsi-file-for-nanopi-SBCs.patch @@ -1,39 +1,29 @@ -From dfcf8196de7411a5e7fd49795938b1bc8c56859c Mon Sep 17 00:00:00 2001 -From: Jens Kuske -Date: Fri, 4 Dec 2015 22:24:43 +0100 -Subject: [PATCH] ARM: dts: sun8i: Add Orange Pi Plus support +From 49f01c9e14b3476cbdf9623c4812c43f6485830b Mon Sep 17 00:00:00 2001 +From: Milo Kim +Date: Fri, 28 Oct 2016 15:59:01 +0900 +Subject: ARM: dts: sun8i: Add common dtsi file for NanoPi SBCs -The Orange Pi Plus is a SBC based on the Allwinner H3 SoC -with 8GB eMMC, multiple USB ports through a USB hub chip, SATA through -a USB-SATA bridge, one uSD slot, a 10/100/1000M ethernet port, -WiFi, HDMI, headphone jack, IR receiver, a microphone, a CSI connector -and a 40-pin GPIO header. +(backported from kernel 4.13) -Signed-off-by: Jens Kuske +This patch provides a common file for NanoPi M1 and Neo SBC. + +Those have common features below. + * UART0 + * 2 LEDs + * USB host (EHCI3, OHCI3) and PHY + * MicroSD + * GPIO key switch + +Cc: James Pettigrew +Signed-off-by: Milo Kim Signed-off-by: Maxime Ripard ---- - arch/arm/boot/dts/Makefile | 3 +- - arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts | 77 ++++++++++++++++++++++++++++ - 2 files changed, 79 insertions(+), 1 deletion(-) - create mode 100644 arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -660,7 +660,8 @@ dtb-$(CONFIG_MACH_SUN8I) += \ - sun8i-a33-ga10h-v1.1.dtb \ - sun8i-a33-ippo-q8h-v1.2.dtb \ - sun8i-a33-q8-tablet.dtb \ -- sun8i-a33-sinlinx-sina33.dtb -+ sun8i-a33-sinlinx-sina33.dtb \ -+ sun8i-h3-orangepi-plus.dtb - dtb-$(CONFIG_MACH_SUN9I) += \ - sun9i-a80-optimus.dtb \ - sun9i-a80-cubieboard4.dtb --- /dev/null -+++ b/arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts -@@ -0,0 +1,77 @@ ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi.dtsi +@@ -0,0 +1,137 @@ +/* -+ * Copyright (C) 2015 Jens Kuske ++ * Copyright (C) 2016 James Pettigrew ++ * Copyright (C) 2016 Milo Kim + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual @@ -79,12 +69,9 @@ Signed-off-by: Maxime Ripard +#include "sunxi-common-regulators.dtsi" + +#include -+#include ++#include + +/ { -+ model = "Xunlong Orange Pi Plus"; -+ compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3"; -+ + aliases { + serial0 = &uart0; + }; @@ -92,16 +79,74 @@ Signed-off-by: Maxime Ripard + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_npi>, <&leds_r_npi>; ++ ++ status { ++ label = "nanopi:blue:status"; ++ gpios = <&pio 0 10 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ }; ++ ++ pwr { ++ label = "nanopi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++ ++ r_gpio_keys { ++ compatible = "gpio-keys"; ++ input-name = "k1"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sw_r_npi>; ++ ++ k1@0 { ++ label = "k1"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&ehci3 { ++ status = "okay"; +}; + +&mmc0 { ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; ++ cd-inverted; + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ -+ cd-inverted; + status = "okay"; ++ vmmc-supply = <®_vcc3v3>; ++}; ++ ++&ohci3 { ++ status = "okay"; ++}; ++ ++&pio { ++ leds_npi: led_pins@0 { ++ pins = "PA10"; ++ function = "gpio_out"; ++ }; ++}; ++ ++&r_pio { ++ leds_r_npi: led_pins@0 { ++ pins = "PL10"; ++ function = "gpio_out"; ++ }; ++ ++ sw_r_npi: key_pins@0 { ++ pins = "PL3"; ++ function = "gpio_in"; ++ }; +}; + +&uart0 { @@ -109,3 +154,7 @@ Signed-off-by: Maxime Ripard + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; +}; ++ ++&usbphy { ++ status = "okay"; ++}; diff --git a/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch b/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch new file mode 100644 index 000000000..e64581ff8 --- /dev/null +++ b/target/linux/sunxi/patches-4.9/090-sunxi-mmc-from-4-13.patch @@ -0,0 +1,288 @@ +--- a/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt ++++ b/Documentation/devicetree/bindings/mmc/sunxi-mmc.txt +@@ -13,6 +13,7 @@ Required properties: + * "allwinner,sun5i-a13-mmc" + * "allwinner,sun7i-a20-mmc" + * "allwinner,sun9i-a80-mmc" ++ * "allwinner,sun50i-a64-emmc" + * "allwinner,sun50i-a64-mmc" + - reg : mmc controller base registers + - clocks : a list with 4 phandle + clock specifier pairs +--- a/drivers/mmc/host/sunxi-mmc.c ++++ b/drivers/mmc/host/sunxi-mmc.c +@@ -5,6 +5,7 @@ + * (C) Copyright 2013-2014 O2S GmbH + * (C) Copyright 2013-2014 David Lanzend�rfer + * (C) Copyright 2013-2014 Hans de Goede ++ * (C) Copyright 2017 Sootech SA + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as +@@ -101,6 +102,7 @@ + (SDXC_SOFT_RESET | SDXC_FIFO_RESET | SDXC_DMA_RESET) + + /* clock control bits */ ++#define SDXC_MASK_DATA0 BIT(31) + #define SDXC_CARD_CLOCK_ON BIT(16) + #define SDXC_LOW_POWER_ON BIT(17) + +@@ -253,6 +255,11 @@ struct sunxi_mmc_cfg { + + /* does the IP block support autocalibration? */ + bool can_calibrate; ++ ++ /* Does DATA0 needs to be masked while the clock is updated */ ++ bool mask_data0; ++ ++ bool needs_new_timings; + }; + + struct sunxi_mmc_host { +@@ -482,7 +489,7 @@ static void sunxi_mmc_dump_errinfo(struc + cmd->opcode == SD_IO_RW_DIRECT)) + return; + +- dev_err(mmc_dev(host->mmc), ++ dev_dbg(mmc_dev(host->mmc), + "smc %d err, cmd %d,%s%s%s%s%s%s%s%s%s%s !!\n", + host->mmc->index, cmd->opcode, + data ? (data->flags & MMC_DATA_WRITE ? " WR" : " RD") : "", +@@ -654,11 +661,16 @@ static int sunxi_mmc_oclk_onoff(struct s + unsigned long expire = jiffies + msecs_to_jiffies(750); + u32 rval; + ++ dev_dbg(mmc_dev(host->mmc), "%sabling the clock\n", ++ oclk_en ? "en" : "dis"); ++ + rval = mmc_readl(host, REG_CLKCR); +- rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON); ++ rval &= ~(SDXC_CARD_CLOCK_ON | SDXC_LOW_POWER_ON | SDXC_MASK_DATA0); + + if (oclk_en) + rval |= SDXC_CARD_CLOCK_ON; ++ if (host->cfg->mask_data0) ++ rval |= SDXC_MASK_DATA0; + + mmc_writel(host, REG_CLKCR, rval); + +@@ -678,46 +690,29 @@ static int sunxi_mmc_oclk_onoff(struct s + return -EIO; + } + ++ if (host->cfg->mask_data0) { ++ rval = mmc_readl(host, REG_CLKCR); ++ mmc_writel(host, REG_CLKCR, rval & ~SDXC_MASK_DATA0); ++ } ++ + return 0; + } + + static int sunxi_mmc_calibrate(struct sunxi_mmc_host *host, int reg_off) + { +- u32 reg = readl(host->reg_base + reg_off); +- u32 delay; +- unsigned long timeout; +- + if (!host->cfg->can_calibrate) + return 0; + +- reg &= ~(SDXC_CAL_DL_MASK << SDXC_CAL_DL_SW_SHIFT); +- reg &= ~SDXC_CAL_DL_SW_EN; +- +- writel(reg | SDXC_CAL_START, host->reg_base + reg_off); +- +- dev_dbg(mmc_dev(host->mmc), "calibration started\n"); +- +- timeout = jiffies + HZ * SDXC_CAL_TIMEOUT; +- +- while (!((reg = readl(host->reg_base + reg_off)) & SDXC_CAL_DONE)) { +- if (time_before(jiffies, timeout)) +- cpu_relax(); +- else { +- reg &= ~SDXC_CAL_START; +- writel(reg, host->reg_base + reg_off); +- +- return -ETIMEDOUT; +- } +- } +- +- delay = (reg >> SDXC_CAL_DL_SHIFT) & SDXC_CAL_DL_MASK; +- +- reg &= ~SDXC_CAL_START; +- reg |= (delay << SDXC_CAL_DL_SW_SHIFT) | SDXC_CAL_DL_SW_EN; +- +- writel(reg, host->reg_base + reg_off); +- +- dev_dbg(mmc_dev(host->mmc), "calibration ended, reg is 0x%x\n", reg); ++ /* ++ * FIXME: ++ * This is not clear how the calibration is supposed to work ++ * yet. The best rate have been obtained by simply setting the ++ * delay to 0, as Allwinner does in its BSP. ++ * ++ * The only mode that doesn't have such a delay is HS400, that ++ * is in itself a TODO. ++ */ ++ writel(SDXC_CAL_DL_SW_EN, host->reg_base + reg_off); + + return 0; + } +@@ -745,6 +740,7 @@ static int sunxi_mmc_clk_set_phase(struc + index = SDXC_CLK_50M_DDR; + } + } else { ++ dev_dbg(mmc_dev(host->mmc), "Invalid clock... returning\n"); + return -EINVAL; + } + +@@ -757,10 +753,21 @@ static int sunxi_mmc_clk_set_phase(struc + static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host, + struct mmc_ios *ios) + { ++ struct mmc_host *mmc = host->mmc; + long rate; + u32 rval, clock = ios->clock; + int ret; + ++ ret = sunxi_mmc_oclk_onoff(host, 0); ++ if (ret) ++ return ret; ++ ++ /* Our clock is gated now */ ++ mmc->actual_clock = 0; ++ ++ if (!ios->clock) ++ return 0; ++ + /* 8 bit DDR requires a higher module clock */ + if (ios->timing == MMC_TIMING_MMC_DDR52 && + ios->bus_width == MMC_BUS_WIDTH_8) +@@ -768,25 +775,21 @@ static int sunxi_mmc_clk_set_rate(struct + + rate = clk_round_rate(host->clk_mmc, clock); + if (rate < 0) { +- dev_err(mmc_dev(host->mmc), "error rounding clk to %d: %ld\n", ++ dev_err(mmc_dev(mmc), "error rounding clk to %d: %ld\n", + clock, rate); + return rate; + } +- dev_dbg(mmc_dev(host->mmc), "setting clk to %d, rounded %ld\n", ++ dev_dbg(mmc_dev(mmc), "setting clk to %d, rounded %ld\n", + clock, rate); + + /* setting clock rate */ + ret = clk_set_rate(host->clk_mmc, rate); + if (ret) { +- dev_err(mmc_dev(host->mmc), "error setting clk to %ld: %d\n", ++ dev_err(mmc_dev(mmc), "error setting clk to %ld: %d\n", + rate, ret); + return ret; + } + +- ret = sunxi_mmc_oclk_onoff(host, 0); +- if (ret) +- return ret; +- + /* clear internal divider */ + rval = mmc_readl(host, REG_CLKCR); + rval &= ~0xff; +@@ -798,6 +801,13 @@ static int sunxi_mmc_clk_set_rate(struct + } + mmc_writel(host, REG_CLKCR, rval); + ++ if (host->cfg->needs_new_timings) { ++ /* Don't touch the delay bits */ ++ rval = mmc_readl(host, REG_SD_NTSR); ++ rval |= SDXC_2X_TIMING_MODE; ++ mmc_writel(host, REG_SD_NTSR, rval); ++ } ++ + ret = sunxi_mmc_clk_set_phase(host, ios, rate); + if (ret) + return ret; +@@ -806,9 +816,22 @@ static int sunxi_mmc_clk_set_rate(struct + if (ret) + return ret; + +- /* TODO: enable calibrate on sdc2 SDXC_REG_DS_DL_REG of A64 */ ++ /* ++ * FIXME: ++ * ++ * In HS400 we'll also need to calibrate the data strobe ++ * signal. This should only happen on the MMC2 controller (at ++ * least on the A64). ++ */ ++ ++ ret = sunxi_mmc_oclk_onoff(host, 1); ++ if (ret) ++ return ret; + +- return sunxi_mmc_oclk_onoff(host, 1); ++ /* And we just enabled our clock back */ ++ mmc->actual_clock = rate; ++ ++ return 0; + } + + static void sunxi_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) +@@ -822,10 +845,13 @@ static void sunxi_mmc_set_ios(struct mmc + break; + + case MMC_POWER_UP: +- host->ferror = mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, +- ios->vdd); +- if (host->ferror) +- return; ++ if (!IS_ERR(mmc->supply.vmmc)) { ++ host->ferror = mmc_regulator_set_ocr(mmc, ++ mmc->supply.vmmc, ++ ios->vdd); ++ if (host->ferror) ++ return; ++ } + + if (!IS_ERR(mmc->supply.vqmmc)) { + host->ferror = regulator_enable(mmc->supply.vqmmc); +@@ -847,7 +873,9 @@ static void sunxi_mmc_set_ios(struct mmc + case MMC_POWER_OFF: + dev_dbg(mmc_dev(mmc), "power off!\n"); + sunxi_mmc_reset_host(host); +- mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); ++ if (!IS_ERR(mmc->supply.vmmc)) ++ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0); ++ + if (!IS_ERR(mmc->supply.vqmmc) && host->vqmmc_enabled) + regulator_disable(mmc->supply.vqmmc); + host->vqmmc_enabled = false; +@@ -877,7 +905,7 @@ static void sunxi_mmc_set_ios(struct mmc + mmc_writel(host, REG_GCTRL, rval); + + /* set up clock */ +- if (ios->clock && ios->power_mode) { ++ if (ios->power_mode) { + host->ferror = sunxi_mmc_clk_set_rate(host, ios); + /* Android code had a usleep_range(50000, 55000); here */ + } +@@ -1084,6 +1112,14 @@ static const struct sunxi_mmc_cfg sun50i + .idma_des_size_bits = 16, + .clk_delays = NULL, + .can_calibrate = true, ++ .mask_data0 = true, ++ .needs_new_timings = true, ++}; ++ ++static const struct sunxi_mmc_cfg sun50i_a64_emmc_cfg = { ++ .idma_des_size_bits = 13, ++ .clk_delays = NULL, ++ .can_calibrate = true, + }; + + static const struct of_device_id sunxi_mmc_of_match[] = { +@@ -1092,6 +1128,7 @@ static const struct of_device_id sunxi_m + { .compatible = "allwinner,sun7i-a20-mmc", .data = &sun7i_a20_cfg }, + { .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg }, + { .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg }, ++ { .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg }, + { /* sentinel */ } + }; + MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match); diff --git a/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch b/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch new file mode 100644 index 000000000..d0ee8edd1 --- /dev/null +++ b/target/linux/sunxi/patches-4.9/205-arm-dts-sun8i-add-support-for-nanopi-m1-plus-board.patch @@ -0,0 +1,168 @@ +From 2ed2388bc0c5b7d04c7b079d673ce61a0333c818 Mon Sep 17 00:00:00 2001 +From: Jagan Teki +Date: Tue, 30 May 2017 17:42:50 +0000 +Subject: ARM: dts: sun8i: h3: Add initial NanoPi M1 Plus support + +Backported support from kernel 4.13 with the following changes: +- Added WiFi node +- Added Ethernet node +- Added eMMC node + +Original commit message: +NanoPi M1 Plus is designed and developed by FriendlyElec +for professionals, enterprise users, makers and hobbyists +using the Allwinner H3 SOC. + +NanoPi M1 Plus key features +- Allwinner H3, Quad-core Cortex-A7@1.2GHz +- 1GB DDR3 RAM +- 8GB eMMC +- microSD slot +- 10/100/1000M Ethernet +- Serial Debug Port +- 5V 2A DC power-supply + +Signed-off-by: Jagan Teki +Signed-off-by: Maxime Ripard +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -821,6 +821,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ ++ sun8i-h3-nanopi-m1-plus.dtb \ + sun8i-h3-nanopi-neo.dtb \ + sun8i-h3-orangepi-2.dtb \ + sun8i-h3-orangepi-lite.dtb \ +--- /dev/null ++++ b/arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts +@@ -0,0 +1,129 @@ ++/* ++ * Copyright (C) 2017 Jagan Teki ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#include "sun8i-h3-nanopi.dtsi" ++ ++/ { ++ model = "FriendlyArm NanoPi M1 Plus"; ++ compatible = "friendlyarm,nanopi-m1-plus", "allwinner,sun8i-h3"; ++ ++ aliases { ++ ethernet0 = &emac; ++ }; ++ ++ pwrseq_wifi: pwrseq0 { ++ compatible = "mmc-pwrseq-simple"; ++ pinctrl-names = "default"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */ ++ }; ++ ++ reg_gmac_3v3: gmac-3v3 { ++ compatible = "regulator-fixed"; ++ regulator-name = "gmac-3v3"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ startup-delay-us = <100000>; ++ enable-active-high; ++ gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */ ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ehci2 { ++ status = "okay"; ++}; ++ ++&emac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&emac_rgmii_pins>; ++ phy-supply = <®_gmac_3v3>; ++ phy-handle = <&ext_rgmii_phy>; ++ phy-mode = "rgmii"; ++ status = "okay"; ++}; ++ ++&mdio { ++ ext_rgmii_phy: ethernet-phy@7 { ++ compatible = "ethernet-phy-ieee802.3-c22"; ++ reg = <7>; ++ }; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&pwrseq_wifi>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ brcmf: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ interrupt-parent = <&pio>; ++ interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10 / EINT10 */ ++ interrupt-names = "host-wake"; ++ }; ++}; ++ ++&mmc2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc2_8bit_pins>; ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc3v3>; ++ bus-width = <8>; ++ non-removable; ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&ohci2 { ++ status = "okay"; ++}; diff --git a/target/linux/x86/64/config-default b/target/linux/x86/64/config-default index 55b69cec8..faaba8064 100644 --- a/target/linux/x86/64/config-default +++ b/target/linux/x86/64/config-default @@ -253,9 +253,9 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y CONFIG_NET_FLOW_LIMIT=y CONFIG_NR_CPUS=8 # CONFIG_NUMA is not set -# CONFIG_ORC_UNWINDER is not set CONFIG_OUTPUT_FORMAT="elf64-x86-64" CONFIG_PADATA=y +CONFIG_PAGE_TABLE_ISOLATION=y CONFIG_PARAVIRT=y CONFIG_PARAVIRT_CLOCK=y # CONFIG_PARAVIRT_DEBUG is not set @@ -330,6 +330,7 @@ CONFIG_THERMAL_WRITABLE_TRIPS=y # CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_TREE_RCU=y CONFIG_TREE_SRCU=y +# CONFIG_UNWINDER_ORC is not set CONFIG_UCS2_STRING=y # CONFIG_UNISYSSPAR is not set CONFIG_USB_OHCI_HCD_PCI=y diff --git a/target/linux/x86/base-files/lib/preinit/01_sysinfo b/target/linux/x86/base-files/lib/preinit/01_sysinfo index cb63a0401..466c831e7 100644 --- a/target/linux/x86/base-files/lib/preinit/01_sysinfo +++ b/target/linux/x86/base-files/lib/preinit/01_sysinfo @@ -1,3 +1,12 @@ +sanitize_name_x86() { + sed -e ' + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; + s/[^a-z0-9_-]\+/-/g; + s/^-//; + s/-$//; + ' "$@" +} + do_sysinfo_x86() { local vendor product file @@ -8,7 +17,14 @@ do_sysinfo_x86() { for file in product_name board_name; do product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)" - [ -n "$product" ] && break + case "$vendor:$product" in + "Supermicro:Super Server") + continue + ;; + ?*:?*) + break + ;; + esac done [ -n "$vendor" -a -n "$product" ] || return @@ -17,12 +33,7 @@ do_sysinfo_x86() { echo "$vendor $product" > /tmp/sysinfo/model - sed -e ' - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/; - s/[^a-z0-9_-]\+/-/g; - s/^-//; - s/-$//; - ' /tmp/sysinfo/model > /tmp/sysinfo/board_name + sanitize_name_x86 /tmp/sysinfo/model > /tmp/sysinfo/board_name } boot_hook_add preinit_main do_sysinfo_x86 diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index 9b2f5e3d3..b88fa77e1 100644 --- a/target/linux/x86/config-4.14 +++ b/target/linux/x86/config-4.14 @@ -72,7 +72,6 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_COMMON_CLK=y CONFIG_COMPAT_32=y # CONFIG_COMPAT_VDSO is not set -CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CONSOLE_TRANSLATIONS=y # CONFIG_CPU5_WDT is not set CONFIG_CPU_FREQ=y @@ -146,7 +145,6 @@ CONFIG_FIRMWARE_IN_KERNEL=y CONFIG_FIRMWARE_MEMMAP=y CONFIG_FIX_EARLYCON_MEM=y CONFIG_FRAME_POINTER=y -CONFIG_FRAME_POINTER_UNWINDER=y CONFIG_FS_MBCACHE=y CONFIG_FUSION=y # CONFIG_FUSION_CTL is not set @@ -177,7 +175,6 @@ CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEOS is not set CONFIG_GLOB=y # CONFIG_GRO_CELLS is not set -# CONFIG_GUESS_UNWINDER is not set # CONFIG_HANGCHECK_TIMER is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y @@ -435,6 +432,8 @@ CONFIG_THREAD_INFO_IN_TASK=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_TINY_SRCU=y # CONFIG_TOSHIBA is not set +# CONFIG_UNWINDER_GUESS is not set +CONFIG_UNWINDER_FRAME_POINTER=y CONFIG_UP_LATE_INIT=y CONFIG_USB=y CONFIG_USB_COMMON=y @@ -523,4 +522,3 @@ CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y -CONFIG_PAGE_TABLE_ISOLATION=n \ No newline at end of file diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 1e478e181..b5003546c 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -1,31 +1,6 @@ # CONFIG_60XX_WDT is not set # CONFIG_64BIT is not set -CONFIG_ACPI=y -CONFIG_ACPI_AC=y -CONFIG_ACPI_BATTERY=y -# CONFIG_ACPI_CMPC is not set -# CONFIG_ACPI_CONTAINER is not set -CONFIG_ACPI_CPU_FREQ_PSS=y -# CONFIG_ACPI_CUSTOM_DSDT is not set -# CONFIG_ACPI_DEBUG is not set -# CONFIG_ACPI_DEBUGGER is not set -# CONFIG_ACPI_DOCK is not set -# CONFIG_ACPI_EC_DEBUGFS is not set -CONFIG_ACPI_FAN=y -CONFIG_ACPI_HOTPLUG_IOAPIC=y -CONFIG_ACPI_LEGACY_TABLES_LOOKUP=y -CONFIG_ACPI_NFIT=y -# CONFIG_ACPI_PCI_SLOT is not set -CONFIG_ACPI_PROCESSOR=y -# CONFIG_ACPI_PROCESSOR_AGGREGATOR is not set -CONFIG_ACPI_PROCESSOR_CSTATE=y -CONFIG_ACPI_PROCESSOR_IDLE=y -# CONFIG_ACPI_PROCFS_POWER is not set -CONFIG_ACPI_REV_OVERRIDE_POSSIBLE=y -# CONFIG_ACPI_SBS is not set -CONFIG_ACPI_SYSTEM_POWER_STATES_SUPPORT=y -CONFIG_ACPI_THERMAL=y -# CONFIG_ACPI_WMI is not set +# CONFIG_ACPI is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_ALIM1535_WDT is not set @@ -37,7 +12,6 @@ CONFIG_ARCH_DISCARD_MEMBLOCK=y CONFIG_ARCH_DMA_ADDR_T_64BIT=y CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_SPLIT_PMD_PTLOCK=y -CONFIG_ARCH_HAS_ACPI_TABLE_UPGRADE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y CONFIG_ARCH_HAS_CPU_RELAX=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y @@ -48,7 +22,6 @@ CONFIG_ARCH_HAS_SG_CHAIN=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y -CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y CONFIG_ARCH_PHYS_ADDR_T_64BIT=y @@ -71,14 +44,13 @@ CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y -# CONFIG_ARM_SCPI_PROTOCOL is not set CONFIG_ATA=y CONFIG_ATA_GENERIC=y CONFIG_ATA_PIIX=y CONFIG_BINFMT_MISC=y CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_NVME=y -CONFIG_BLK_DEV_NVME_SCSI=y +# CONFIG_BLK_DEV_NVME_SCSI is not set CONFIG_BLK_DEV_SD=y CONFIG_BLK_MQ_PCI=y CONFIG_BOUNCE=y @@ -142,7 +114,6 @@ CONFIG_DMIID=y CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y CONFIG_DMI_SYSFS=y CONFIG_DNOTIFY=y -# CONFIG_DPTF_POWER is not set CONFIG_DUMMY_CONSOLE=y CONFIG_EARLY_PRINTK=y # CONFIG_EARLY_PRINTK_DBGP is not set @@ -189,15 +160,11 @@ CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEOS is not set CONFIG_GLOB=y # CONFIG_GOOGLE_FIRMWARE is not set -# CONFIG_GPIO_AMDPT is not set -# CONFIG_GPIO_F7188X is not set # CONFIG_HANGCHECK_TIMER is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y # CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set -CONFIG_HAVE_ACPI_APEI=y -CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HAVE_ALIGNED_STRUCT_PAGE=y CONFIG_HAVE_AOUT=y CONFIG_HAVE_ARCH_AUDITSYSCALL=y @@ -256,10 +223,8 @@ CONFIG_HIGHMEM=y # CONFIG_HIGHMEM4G is not set CONFIG_HIGHMEM64G=y # CONFIG_HIGHPTE is not set -# CONFIG_HPET is not set CONFIG_HPET_EMULATE_RTC=y CONFIG_HPET_TIMER=y -# CONFIG_HP_ACCEL is not set # CONFIG_HP_WATCHDOG is not set CONFIG_HT_IRQ=y # CONFIG_HUGETLBFS is not set @@ -280,11 +245,7 @@ CONFIG_INITRAMFS_SOURCE="" CONFIG_INPUT=y CONFIG_INPUT_KEYBOARD=y CONFIG_INSTRUCTION_DECODER=y -CONFIG_INTEL_IDLE=y -# CONFIG_INTEL_IPS is not set -# CONFIG_INTEL_MENLOW is not set # CONFIG_INTEL_PCH_THERMAL is not set -# CONFIG_INTEL_PMC_IPC is not set # CONFIG_INTEL_POWERCLAMP is not set # CONFIG_INTEL_SOC_DTS_THERMAL is not set CONFIG_IOMMU_HELPER=y @@ -304,7 +265,6 @@ CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_WORK=y # CONFIG_ISA is not set CONFIG_ISA_DMA_API=y -# CONFIG_ISCSI_IBFT_FIND is not set # CONFIG_IT8712F_WDT is not set # CONFIG_IT87_WDT is not set # CONFIG_ITCO_WDT is not set @@ -315,7 +275,6 @@ CONFIG_KEXEC_CORE=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y -# CONFIG_LIQUIDIO is not set # CONFIG_M486 is not set # CONFIG_M586 is not set CONFIG_M586MMX=y @@ -328,7 +287,6 @@ CONFIG_M586MMX=y # CONFIG_MCYRIXIII is not set # CONFIG_MEFFICEON is not set # CONFIG_MELAN is not set -# CONFIG_MFD_INTEL_LPSS_ACPI is not set # CONFIG_MFD_INTEL_LPSS_PCI is not set # CONFIG_MGEODEGX1 is not set # CONFIG_MGEODE_LX is not set @@ -387,7 +345,6 @@ CONFIG_PCI_GOANY=y # CONFIG_PCI_GODIRECT is not set # CONFIG_PCI_GOMMCONFIG is not set CONFIG_PCI_LABEL=y -CONFIG_PCI_MMCONFIG=y CONFIG_PCI_MSI=y CONFIG_PCI_MSI_IRQ_DOMAIN=y CONFIG_PCSPKR_PLATFORM=y @@ -400,23 +357,17 @@ CONFIG_PHYSICAL_ALIGN=0x100000 CONFIG_PHYSICAL_START=0x1000000 CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_PMC_ATOM=y -# CONFIG_PMIC_OPREGION is not set -CONFIG_PNP=y -CONFIG_PNPACPI=y -CONFIG_PNP_DEBUG_MESSAGES=y CONFIG_POWER_SUPPLY=y # CONFIG_PROCESSOR_SELECT is not set CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_PUNIT_ATOM_DEBUG is not set -# CONFIG_PVPANIC is not set # CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_BZIP2=y CONFIG_RD_GZIP=y CONFIG_RTC_CLASS=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y -# CONFIG_SAMSUNG_Q10 is not set # CONFIG_SBC7240_WDT is not set # CONFIG_SBC8360_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set @@ -428,10 +379,8 @@ CONFIG_SCx200=y CONFIG_SCx200HR_TIMER=y # CONFIG_SCx200_GPIO is not set # CONFIG_SCx200_WDT is not set -# CONFIG_SENSORS_XGENE is not set # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_PCI=y -CONFIG_SERIAL_8250_PNP=y CONFIG_SERIO=y # CONFIG_SERIO_CT82C710 is not set CONFIG_SERIO_I8042=y @@ -444,7 +393,6 @@ CONFIG_SPARSEMEM_STATIC=y CONFIG_SPARSE_IRQ=y CONFIG_SRCU=y CONFIG_STRICT_DEVMEM=y -# CONFIG_SURFACE_PRO3_BUTTON is not set CONFIG_SWIOTLB=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TELCLOCK is not set @@ -452,13 +400,8 @@ CONFIG_THERMAL=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_GOV_STEP_WISE=y CONFIG_THREAD_INFO_IN_TASK=y -CONFIG_THUNDER_NIC_BGX=y -CONFIG_THUNDER_NIC_PF=y -CONFIG_THUNDER_NIC_RGX=y -CONFIG_THUNDER_NIC_VF=y CONFIG_TICK_CPU_ACCOUNTING=y # CONFIG_TOSHIBA is not set -# CONFIG_TOSHIBA_BT_RFKILL is not set CONFIG_UP_LATE_INIT=y CONFIG_USB=y CONFIG_USB_COMMON=y @@ -488,9 +431,7 @@ CONFIG_X86=y CONFIG_X86_32=y # CONFIG_X86_32_IRIS is not set CONFIG_X86_32_LAZY_GS=y -# CONFIG_X86_ACPI_CPUFREQ is not set CONFIG_X86_ALIGNMENT_16=y -# CONFIG_X86_AMD_PLATFORM_DEVICE is not set # CONFIG_X86_ANCIENT_MCE is not set # CONFIG_X86_CHECK_BIOS_CORRUPTION is not set CONFIG_X86_CMPXCHG64=y @@ -498,13 +439,11 @@ CONFIG_X86_CMPXCHG64=y # CONFIG_X86_CPUID is not set # CONFIG_X86_DEBUG_FPU is not set # CONFIG_X86_EXTENDED_PLATFORM is not set -# CONFIG_X86_E_POWERSAVER is not set CONFIG_X86_F00F_BUG=y CONFIG_X86_FAST_FEATURE_TESTS=y CONFIG_X86_FEATURE_NAMES=y CONFIG_X86_GENERIC=y # CONFIG_X86_GX_SUSPMOD is not set -# CONFIG_X86_INTEL_LPSS is not set # CONFIG_X86_INTEL_MPX is not set # CONFIG_X86_INTEL_PSTATE is not set CONFIG_X86_INTEL_USERCOPY=y @@ -513,7 +452,6 @@ CONFIG_X86_IO_APIC=y CONFIG_X86_L1_CACHE_SHIFT=6 # CONFIG_X86_LEGACY_VM86 is not set CONFIG_X86_LOCAL_APIC=y -# CONFIG_X86_LONGHAUL is not set # CONFIG_X86_LONGRUN is not set CONFIG_X86_MCE=y CONFIG_X86_MCE_AMD=y @@ -526,11 +464,9 @@ CONFIG_X86_MSR=y # CONFIG_X86_P4_CLOCKMOD is not set CONFIG_X86_PAE=y CONFIG_X86_PAT=y -# CONFIG_X86_PCC_CPUFREQ is not set CONFIG_X86_PLATFORM_DEVICES=y CONFIG_X86_PMEM_LEGACY=y CONFIG_X86_PMEM_LEGACY_DEVICE=y -CONFIG_X86_PM_TIMER=y # CONFIG_X86_POWERNOW_K6 is not set # CONFIG_X86_POWERNOW_K7 is not set CONFIG_X86_PPRO_FENCE=y diff --git a/target/linux/x86/geode/config-default b/target/linux/x86/geode/config-default index 446f7d275..b564b940e 100644 --- a/target/linux/x86/geode/config-default +++ b/target/linux/x86/geode/config-default @@ -51,14 +51,8 @@ CONFIG_GPIOLIB=y # CONFIG_GPIO_104_IDIO_16 is not set # CONFIG_GPIO_104_IDI_48 is not set CONFIG_GPIO_ACPI=y -# CONFIG_GPIO_AMDPT is not set CONFIG_GPIO_CS5535=y -# CONFIG_GPIO_F7188X is not set -# CONFIG_GPIO_GPIO_MM is not set -# CONFIG_GPIO_IT87 is not set -# CONFIG_GPIO_LYNXPOINT is not set CONFIG_GPIO_SYSFS=y -# CONFIG_GPIO_WS16C48 is not set CONFIG_HAVE_ACPI_APEI=y CONFIG_HAVE_ACPI_APEI_NMI=y CONFIG_HIGHMEM4G=y diff --git a/target/linux/x86/image/Makefile b/target/linux/x86/image/Makefile index 3b5e642d1..8a3cb327e 100644 --- a/target/linux/x86/image/Makefile +++ b/target/linux/x86/image/Makefile @@ -10,9 +10,6 @@ include $(INCLUDE_DIR)/image.mk export PATH=$(TARGET_PATH):/sbin GRUB2_MODULES = biosdisk boot chain configfile ext2 linux ls part_msdos reboot serial vga -GRUB2_MODULES_LEGACY = $(GRUB2_MODULES) -GRUB2_MODULES_LEGACY += part_gpt search fat exfat -GRUB2_MODULES_EFI = boot chain configfile ext2 linux ls part_msdos reboot serial part_gpt part_msdos search fat exfat ext2 efi_gop efi_uga gfxterm GRUB2_MODULES_ISO = biosdisk boot chain configfile iso9660 linux ls part_msdos reboot serial vga GRUB_TERMINALS = GRUB_SERIAL_CONFIG = @@ -45,8 +42,6 @@ ifneq ($(GRUB_TERMINALS),) endif SIGNATURE:=$(shell perl -e 'printf("%08x", rand(0xFFFFFFFF))') -EFI_SIGNATURE:=$(shell perl -e 'printf("%08x-%04x-%04x-%04x-%06x%06x", rand(0xFFFFFFFF), rand(0xFFFF), rand(0xFFFF), rand(0xFFFF), rand(0xFFFFFF), rand(0xFFFFFF))') - ROOTPART:=$(call qstrip,$(CONFIG_TARGET_ROOTFS_PARTNAME)) ROOTPART:=$(if $(ROOTPART),$(ROOTPART),PARTUUID=$(SIGNATURE)-02) @@ -56,7 +51,7 @@ ifneq ($(CONFIG_TARGET_x86_xen_domu),) GRUB_ROOT = xen/xvda,msdos1 endif -ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) +ifneq ($(CONFIG_GRUB_IMAGES),) BOOTOPTS:=$(call qstrip,$(CONFIG_GRUB_BOOTOPTS)) @@ -68,90 +63,6 @@ ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) root=$(ROOTPART) rootfstype=squashfs rootwait endef - ifneq ($(CONFIG_EFI_IMAGES),) - - define Image/cmdline/efi - $(subst $(SIGNATURE)-02,$2,$(call Image/cmdline/$(1))) - endef - - define Image/Build/efi - # left here because the image builder doesnt need these - rm -rf $(KDIR)/root.grub/ || true - $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2 - $(CP) $(KDIR)/bzImage $(KDIR)/root.grub/boot/vmlinuz - echo '(hd0) $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img' > $(KDIR)/grub2/device.map - sed \ - -e 's#@SERIAL_CONFIG@#$(strip $(GRUB_SERIAL_CONFIG))#g' \ - -e 's#@TERMINAL_CONFIG@#$(strip $(GRUB_TERMINAL_CONFIG))#g' \ - -e 's#@CMDLINE@#$(strip $(call Image/cmdline/efi,$(1),$(EFI_SIGNATURE)) $(BOOTOPTS) $(GRUB_CONSOLE_CMDLINE))#g' \ - -e 's#@TIMEOUT@#$(GRUB_TIMEOUT)#g' \ - -e 's#set root.*#search --file /boot/grub/$(SIGNATURE).cfg --set=root#g' \ - ./grub.cfg > $(KDIR)/root.grub/boot/grub/grub.cfg - $(CP) $(KDIR)/root.grub/boot/grub/grub.cfg $(KDIR)/root.grub/boot/grub/$(SIGNATURE).cfg - grub-mkimage \ - -d $(STAGING_DIR_HOST)/lib/grub/i386-pc \ - -o $(KDIR)/grub2/core.img \ - -O i386-pc \ - -p '(hd0,gpt1)/boot/grub' \ - -c $(KDIR)/root.grub/boot/grub/grub.cfg \ - $(GRUB2_MODULES_LEGACY) - $(CP) $(STAGING_DIR_HOST)/lib/grub/i386-pc/*.img $(KDIR)/grub2/ - - # Build the efi grub version - rm -rf $(KDIR)/grub2.efi/ || true - $(INSTALL_DIR) $(KDIR)/grub2.efi/efi/boot/ - - # Generate the grub search root config (grub will search for the $(SIGNATURE).cfg file placed on the boot partition as grub does not support search of GPT UUID yet) - echo "search --file /boot/grub/$(SIGNATURE).cfg --set=root" > $(KDIR)/grub2.efi/efi/boot/grub.cfg - echo "configfile /boot/grub/grub.cfg" >> $(KDIR)/grub2.efi/efi/boot/grub.cfg - - # Create the EFI grub binary - grub-mkimage-efi \ - -d $(STAGING_DIR_HOST)/lib/grub/x86_64-efi \ - -o $(KDIR)/grub2.efi/efi/boot/bootx64.efi \ - -O x86_64-efi \ - -p /efi/boot \ - -c $(KDIR)/grub2.efi/efi/boot/grub.cfg \ - $(GRUB2_MODULES_EFI) - - # Generate the EFI VFAT bootfs - rm $(KDIR)/kernel.efi || true - mkfs.fat -C $(KDIR)/kernel.efi -S 512 1024 - mcopy -s -i "$(KDIR)/kernel.efi" $(KDIR)/grub2.efi/* ::/ - - SIGNATURE="$(SIGNATURE)" PATH="$(TARGET_PATH)" ./gen_image_efi.sh \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(CONFIG_TARGET_KERNEL_PARTSIZE) $(KDIR)/root.grub \ - 1 $(KDIR)/kernel.efi \ - 1 \ - $(CONFIG_TARGET_ROOTFS_PARTSIZE) $(KDIR)/root.$(1) \ - 256 - - # Setup legacy bios for hybrid MBR (optional) - grub-bios-setup \ - --device-map="$(KDIR)/grub2/device.map" \ - -d "$(KDIR)/grub2" \ - -r "hd0,msdos1" \ - "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - - # Convert the MBR partition to GPT and set EFI ROOTFS signature - dd if=/dev/zero of="$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" bs=512 count=33 conv=notrunc oflag=append - sgdisk -g "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -t 2:EF00 "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -t 3:EF02 "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -u 4:$(EFI_SIGNATURE) "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - sgdisk -h "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - - # Setup EFI grub - grub-bios-setup-efi \ - --device-map="$(KDIR)/grub2/device.map" \ - -d "$(KDIR)/grub2" \ - -r "hd0,gpt1" \ - "$(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img" - endef - endif - - ifneq ($(CONFIG_GRUB_IMAGES),) define Image/Build/grub2 # left here because the image builder doesnt need these $(INSTALL_DIR) $(KDIR)/root.grub/boot/grub $(KDIR)/grub2 @@ -183,8 +94,6 @@ ifneq ($(CONFIG_GRUB_IMAGES)$(CONFIG_EFI_IMAGES),) -r "hd0,msdos1" \ "$(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img" endef - endif - endif define Image/Build/squashfs @@ -224,14 +133,6 @@ ifneq ($(CONFIG_VDI_IMAGES),) # XXX: VBoxManage insists on setting perms to 0600 chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vdi endef - define Image/Build/vdi_efi - rm $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi || true - qemu-img convert -f raw -O vdi \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi - # XXX: VBoxManage insists on setting perms to 0600 - chmod 0644 $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vdi - endef endif ifneq ($(CONFIG_VMDK_IMAGES),) @@ -241,22 +142,11 @@ ifneq ($(CONFIG_VMDK_IMAGES),) $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img \ $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).vmdk endef - define Image/Build/vmdk_efi - rm $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk || true - qemu-img convert -f raw -O vmdk \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img \ - $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).vmdk - endef endif define Image/Build/gzip - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img -ifneq ($(CONFIG_GRUB_IMAGES),) gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-combined-$(1).img -endif -ifneq ($(CONFIG_EFI_IMAGES),) - gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-uefi-gpt-$(1).img -endif + gzip -f9n $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img endef ifneq ($(CONFIG_TARGET_IMAGES_GZIP),) @@ -284,15 +174,8 @@ define Image/Build $(call Image/Build/$(1)) ifneq ($(1),iso) $(call Image/Build/grub2,$(1)) - $(call Image/Build/efi,$(1)) -ifneq ($(CONFIG_GRUB_IMAGES),) $(call Image/Build/vdi,$(1)) $(call Image/Build/vmdk,$(1)) -endif -ifneq ($(CONFIG_EFI_IMAGES),) - $(call Image/Build/vdi_efi,$(1)) - $(call Image/Build/vmdk_efi,$(1)) -endif $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-rootfs-$(1).img else $(CP) $(KDIR)/root.iso $(BIN_DIR)/$(IMG_PREFIX).iso diff --git a/target/linux/x86/image/gen_image_efi.sh b/target/linux/x86/image/gen_image_efi.sh deleted file mode 100755 index 3ecb25fed..000000000 --- a/target/linux/x86/image/gen_image_efi.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -x -[ $# == 8 -o $# == 9 ] || { - echo "SYNTAX: $0 []" - exit 1 -} - -OUTPUT="$1" -KERNELSIZE="$2" -KERNELDIR="$3" -EFISIZE="$4" -EFIIMAGE="$5" -EFIGRUBSIZE="$6" -ROOTFSSIZE="$7" -ROOTFSIMAGE="$8" -ALIGN="$9" - -rm -f "$OUTPUT" - -head=16 -sect=63 -cyl=$(( ($KERNELSIZE + $EFISIZE + $EFIGRUBSIZE + $ROOTFSSIZE) * 1024 * 1024 / ($head * $sect * 512) )) - -# create partition table -set `ptgen -o "$OUTPUT" -h $head -s $sect -p ${KERNELSIZE}m -p ${EFISIZE}m -p ${EFIGRUBSIZE}m -p ${ROOTFSSIZE}m ${ALIGN:+-l $ALIGN} ${SIGNATURE:+-S 0x$SIGNATURE}` - -KERNELOFFSET="$(($1 / 512))" -KERNELSIZE="$2" -EFIOFFSET="$(($3 / 512))" -EFISIZE="$(($4 / 512))" -EFIGRUBOFFSET="$(($5 / 512))" -EFIGRUBSIZE="$(($6 / 512))" -ROOTFSOFFSET="$(($7 / 512))" -ROOTFSSIZE="$(($8 / 512))" - -dd if=/dev/zero of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc count="$ROOTFSSIZE" -dd if="$ROOTFSIMAGE" of="$OUTPUT" bs=512 seek="$ROOTFSOFFSET" conv=notrunc -dd if="$EFIIMAGE" of="$OUTPUT" bs=512 seek="$EFIOFFSET" conv=notrunc - -[ -n "$NOGRUB" ] && exit 0 - -make_ext4fs -J -l "$KERNELSIZE" "$OUTPUT.kernel" "$KERNELDIR" -dd if="$OUTPUT.kernel" of="$OUTPUT" bs=512 seek="$KERNELOFFSET" conv=notrunc -rm -f "$OUTPUT.kernel" diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch new file mode 100644 index 000000000..f4f4860e5 --- /dev/null +++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch @@ -0,0 +1,19 @@ +--- a/arch/x86/kernel/reboot.c ++++ b/arch/x86/kernel/reboot.c +@@ -443,6 +443,16 @@ static struct dmi_system_id __initdata r + }, + }, + ++ /* PC Engines */ ++ { /* Handle problems with rebooting on PC Engines apu2 */ ++ .callback = set_pci_reboot, ++ .ident = "PC Engines apu2", ++ .matches = { ++ DMI_MATCH(DMI_BOARD_VENDOR, "PC Engines"), ++ DMI_MATCH(DMI_BOARD_NAME, "apu2"), ++ }, ++ }, ++ + /* Sony */ + { /* Handle problems with rebooting on Sony VGN-Z540N */ + .callback = set_bios_reboot, diff --git a/target/sdk/Makefile b/target/sdk/Makefile index ae65fd1c8..ba2867406 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -36,7 +36,8 @@ SDK_DIRS = \ $(STAGING_SUBDIR_HOST) \ $(STAGING_SUBDIR_TOOLCHAIN) -GIT_URL:=$(filter git://% http://% https://%,$(shell git config --get remote.origin.url 2>/dev/null)) +GIT_URL:=$(shell git config --get remote.origin.url 2>/dev/null) +GIT_URL:=$(if $(CONFIG_BUILDBOT),$(filter git://% http://% https://%,$(GIT_URL)),$(GIT_URL)) GIT_COMMIT:=$(shell git rev-parse HEAD 2>/dev/null) GIT_BRANCH:=$(filter-out master HEAD,$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)) GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^$(GIT_COMMIT) / { s|^.*/||; s|\^.*||; p }') @@ -44,7 +45,7 @@ GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^ BASE_FEED:=$(if $(GIT_URL),src-git base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p')) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p')) -BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.lede-project.org/source.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) +BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.openwrt.org/source.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR)) diff --git a/toolchain-old/Config.in b/toolchain-old/Config.in deleted file mode 100644 index f6753ad8b..000000000 --- a/toolchain-old/Config.in +++ /dev/null @@ -1,318 +0,0 @@ -# Copyright (C) 2006-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -menuconfig TARGET_OPTIONS - bool "Target Options" if DEVEL - - config TARGET_OPTIMIZATION - string "Target Optimizations" if TARGET_OPTIONS - default DEFAULT_TARGET_OPTIMIZATION - help - Optimizations to use when building for the target host. - - config SOFT_FLOAT - bool "Use software floating point by default" if TARGET_OPTIONS - default y if !HAS_FPU - depends on arm || armeb || powerpc || mipsel || mips || mips64el || mips64 - help - If your target CPU does not have a Floating Point Unit (FPU) or a - kernel FPU emulator, but you still wish to support floating point - functions, then everything will need to be compiled with soft floating - point support (-msoft-float). - - Most people will answer N. - - config USE_MIPS16 - bool "Build packages with MIPS16 instructions" if TARGET_OPTIONS - depends on HAS_MIPS16 - default y - help - If your target CPU does support the MIPS16 instruction set - and you want to use it for packages, enable this option. - MIPS16 produces smaller binaries thus reducing pressure on - caches and TLB. - - Most people will answer N. - - -menuconfig EXTERNAL_TOOLCHAIN - bool - prompt "Use external toolchain" if DEVEL - help - If enabled, LEDE will compile using an existing toolchain instead of - compiling one. - - config NATIVE_TOOLCHAIN - bool - prompt "Use host's toolchain" if DEVEL - depends on EXTERNAL_TOOLCHAIN - select NO_STRIP - help - If enabled, LEDE will compile using the native toolchain for your - host instead of compiling one. - - config TARGET_NAME - string - prompt "Target name" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "aarch64-unknown-linux-gnu" if aarch64 - default "aarch64_be-unknown-linux-gnu" if aarch64_be - default "arm-unknown-linux-gnu" if arm - default "armeb-unknown-linux-gnu" if armeb - default "i486-unknown-linux-gnu" if i386 - default "mips-unknown-linux-gnu" if mips - default "mipsel-unknown-linux-gnu" if mipsel - default "powerpc-unknown-linux-gnu" if powerpc - default "x86_64-unknown-linux-gnu" if x86_64 - - config TOOLCHAIN_PREFIX - string - prompt "Toolchain prefix" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "aarch64-unknown-linux-gnu" if aarch64 - default "aarch64_be-unknown-linux-gnu" if aarch64_be - default "arm-unknown-linux-gnu-" if arm - default "armeb-unknown-linux-gnu-" if armeb - default "i486-unknown-linux-gnu-" if i386 - default "mips-unknown-linux-gnu-" if mips - default "mipsel-unknown-linux-gnu-" if mipsel - default "powerpc-unknown-linux-gnu-" if powerpc - default "x86_64-unknown-linux-gnu-" if x86_64 - - config TOOLCHAIN_ROOT - string - prompt "Toolchain root" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "/opt/cross/aarch64-unknown-linux-gnu" if aarch64 - default "/opt/cross/aarch64_be-unknown-linux-gnu" if aarch64_be - default "/opt/cross/arm-unknown-linux-gnu" if arm - default "/opt/cross/armeb-unknown-linux-gnu" if armeb - default "/opt/cross/i486-unknown-linux-gnu" if i386 - default "/opt/cross/mips-unknown-linux-gnu" if mips - default "/opt/cross/mipsel-unknown-linux-gnu" if mipsel - default "/opt/cross/powerpc-unknown-linux-gnu" if powerpc - default "/opt/cross/x86_64-unknown-linux-gnu" if x86_64 - - choice TOOLCHAIN_LIBC_TYPE - prompt "Toolchain libc" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL - help - Specify the libc type used by the external toolchain. The given value - is passed as -m flag to all gcc and g++ invocations. This is mainly - intended for multilib toolchains which support glibc and uclibc at - the same time. If no value is specified, no -m flag is passed. - - config EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC - bool "glibc" - select USE_GLIBC - - config EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC - bool "uClibc" - select USE_UCLIBC - depends on !(aarch64 || aarch64_be) - - config EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL - bool "musl" - select USE_MUSL - - endchoice - - config TOOLCHAIN_LIBC - string - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "glibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_GLIBC - default "uclibc" if EXTERNAL_TOOLCHAIN_LIBC_USE_UCLIBC - default "musl" if EXTERNAL_TOOLCHAIN_LIBC_USE_MUSL - - config TOOLCHAIN_BIN_PATH - string - prompt "Toolchain program path" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "./usr/bin ./bin" - help - Specify additional directories searched for toolchain binaries - (override PATH). Use ./DIR for directories relative to the root above. - - config TOOLCHAIN_INC_PATH - string - prompt "Toolchain include path" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "./usr/include ./include" - help - Specify additional directories searched for header files (override - CPPFLAGS). Use ./DIR for directories relative to the root above. - - config TOOLCHAIN_LIB_PATH - string - prompt "Toolchain library path" if DEVEL - depends on EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN - default "./usr/lib ./lib" - help - Specify additional directories searched for libraries (override LDFLAGS). - Use ./DIR for directories relative to the root above. - -config NEED_TOOLCHAIN - bool - depends on DEVEL - default y if !EXTERNAL_TOOLCHAIN - -menuconfig TOOLCHAINOPTS - bool "Toolchain Options" if DEVEL - depends on NEED_TOOLCHAIN - -menuconfig EXTRA_TARGET_ARCH - bool - prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS - depends on !sparc - default y if powerpc64 - default n - help - Some builds may require a 'biarch' toolchain. This option - allows you to specify an additional target arch. - - Most people will answer N here. - - config EXTRA_TARGET_ARCH_NAME - string - default "powerpc64" if powerpc64 - prompt "Extra architecture name" if EXTRA_TARGET_ARCH - help - Specify the cpu name (eg powerpc64 or x86_64) of the - additional target architecture. - - config EXTRA_TARGET_ARCH_OPTS - string - default "-m64" if powerpc64 - prompt "Extra architecture compiler options" if EXTRA_TARGET_ARCH - help - If you're specifying an addition target architecture, - you'll probably need to also provide options to make - the compiler use this alternate arch. - - For example, if you're building a compiler that can build - both powerpc and powerpc64 binaries, you'll need to - specify -m64 here. - - - choice - prompt "MIPS64 user-land ABI" if TOOLCHAINOPTS && (mips64 || mips64el) - default MIPS64_ABI_N64 - help - MIPS64 supports 3 different user-land ABIs: o32 (legacy), - n32 and n64. - - config MIPS64_ABI_N64 - bool "n64" - - config MIPS64_ABI_N32 - depends on !LIBC_USE_MUSL - bool "n32" - - config MIPS64_ABI_O32 - bool "o32" - - endchoice - -comment "Binary tools" - depends on TOOLCHAINOPTS - -source "toolchain/binutils/Config.in" - -comment "Compiler" - depends on TOOLCHAINOPTS - -source "toolchain/gcc/Config.in" - -config YASM - bool - depends on ( i386 || x86_64 ) - prompt "Build yasm" if TOOLCHAINOPTS - default y - help - Enable if you want to build yasm - -comment "C Library" - depends on TOOLCHAINOPTS - -choice - prompt "C Library implementation" if TOOLCHAINOPTS - default LIBC_USE_UCLIBC if arc - default LIBC_USE_MUSL - help - Select the C library implementation. - - config LIBC_USE_GLIBC - bool "Use glibc" - select USE_GLIBC - depends on !arc - - config LIBC_USE_UCLIBC - select USE_UCLIBC - bool "Use uClibc" - depends on !(aarch64 || aarch64_be) - depends on BROKEN || !(arm || armeb || i386 || x86_64 || mips || mipsel || mips64 || mips64el || powerpc) - - config LIBC_USE_MUSL - select USE_MUSL - bool "Use musl" - depends on !(arc) - -endchoice - -source "toolchain/uClibc/Config.in" - -comment "Debuggers" - depends on TOOLCHAINOPTS - -config GDB - bool - depends on !(aarch64 || aarch64_be) - prompt "Build gdb" if TOOLCHAINOPTS - default y if !EXTERNAL_TOOLCHAIN - help - Enable if you want to build the gdb. - -config USE_GLIBC - bool - -config USE_UCLIBC - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) - bool - -config USE_MUSL - default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && !(arc) - bool - -config USE_EXTERNAL_LIBC - bool - default y if EXTERNAL_TOOLCHAIN || NATIVE_TOOLCHAIN - -source "toolchain/binutils/Config.version" -source "toolchain/gcc/Config.version" - -config LIBC - string - default "glibc" if USE_GLIBC - default "uClibc" if USE_UCLIBC - default "musl" if USE_MUSL - -config TARGET_SUFFIX - string - default "gnueabi" if USE_GLIBC && (arm || armeb) - default "gnu" if USE_GLIBC && !(arm || armeb) - default "uclibcgnueabi" if USE_UCLIBC && (arm || armeb) - default "uclibc" if USE_UCLIBC && !(arm || armeb) - default "muslgnueabi" if USE_MUSL && (arm || armeb) - default "musl" if USE_MUSL && !(arm || armeb) - -config MIPS64_ABI - depends on mips64 || mips64el - string - default "64" if MIPS64_ABI_N64 - default "n32" if MIPS64_ABI_N32 - default "32" if MIPS64_ABI_O32 - default "64" diff --git a/toolchain-old/Makefile b/toolchain-old/Makefile deleted file mode 100644 index 409955c23..000000000 --- a/toolchain-old/Makefile +++ /dev/null @@ -1,97 +0,0 @@ -# -# Copyright (C) 2007-2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -# Main makefile for the toolchain -# -# Steps: -# 1) toolchain/binutils/compile -# build & install binutils -# 2) toolchain/gcc/minimal/compile -# build & install a minimal gcc, needed for steps 3 & 4 -# 3) toolchain/kernel-headers/compile -# install kernel headers, needed for step 4 -# 4) toolchain/libc/headers/compile -# build & install libc headers & support files, needed for step 5 -# 5) toolchain/gcc/initial/compile -# build & install an initial gcc, needed for step 6 -# 6) toolchain/libc/compile -# build & install the final libc -# 7) toolchain/gcc/final/compile -# build & install the final gcc -# 8) toolchain/libc/utils/compile -# build & install libc utilities -# -# For musl, steps 2 and 4 are skipped, and step 3 is done after 5 - -curdir:=toolchain - -# subdirectories to descend into -$(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN),wrapper,kernel-headers binutils gcc/initial gcc/final $(LIBC) fortify-headers) $(if $(CONFIG_YASM),yasm) -ifdef CONFIG_USE_UCLIBC - $(curdir)/builddirs += $(LIBC)/utils -endif - -# builddir dependencies -ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) - ifdef CONFIG_USE_MUSL - $(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/compile - $(curdir)/$(LIBC)/compile:=$(curdir)/kernel-headers/compile - else - $(curdir)/builddirs += $(LIBC)/headers gcc/minimal - $(curdir)/gcc/minimal/compile:=$(curdir)/binutils/compile - $(curdir)/kernel-headers/compile:=$(curdir)/gcc/minimal/compile - $(curdir)/$(LIBC)/headers/compile:=$(curdir)/kernel-headers/compile - $(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/compile - endif - - $(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile - $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile - $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile - $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile -endif - -ifndef DUMP_TARGET_DB -ifneq ($(ARCH),) - $(TOOLCHAIN_DIR)/info.mk: .config - @for dir in $(TOOLCHAIN_DIR); do ( \ - $(if $(QUIET),,set -x;) \ - mkdir -p "$$dir"; \ - cd "$$dir"; \ - ln -nsf lib lib64; \ - ln -nsf lib lib32; \ - mkdir -p stamp lib usr/include usr/lib ; \ - ); done - @grep GCC_VERSION $@ >/dev/null 2>&1 || $(INSTALL_DATA) $(TOPDIR)/toolchain/info.mk $@ - @touch $@ -endif -endif - -ifdef CONFIG_BUILDBOT - $(TOOLCHAIN_DIR)/stamp/.ver_check: $(TMP_DIR)/.build - cd "$(TOPDIR)"; git log --format=%h -1 toolchain > $(TMP_DIR)/.ver_check - cmp -s $(TMP_DIR)/.ver_check $@ || { \ - rm -rf $(BUILD_DIR) $(STAGING_DIR) $(TOOLCHAIN_DIR) $(BUILD_DIR_TOOLCHAIN); \ - mkdir -p $(TOOLCHAIN_DIR)/stamp; \ - mv $(TMP_DIR)/.ver_check $@; \ - } - -$(TOOLCHAIN_DIR)/info.mk $(STAGING_DIR)/.prepared: $(TOOLCHAIN_DIR)/stamp/.ver_check -endif - -# prerequisites for the individual targets -$(curdir)/ := .config prereq -$(curdir)//compile = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk $(tools/stamp-compile) - -ifndef DUMP_TARGET_DB -$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed: -endif - -$(curdir)/install: $(curdir)/compile - -$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR))) -$(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build)) -$(eval $(call subdir,$(curdir))) - diff --git a/toolchain-old/binutils/Config.in b/toolchain-old/binutils/Config.in deleted file mode 100644 index 8fe33fb6b..000000000 --- a/toolchain-old/binutils/Config.in +++ /dev/null @@ -1,32 +0,0 @@ -# Choose binutils version. - -choice - prompt "Binutils Version" if TOOLCHAINOPTS - default BINUTILS_USE_VERSION_2_28 if !arc - default BINUTILS_USE_VERSION_2_28_ARC if arc - help - Select the version of binutils you wish to use. - - config BINUTILS_USE_VERSION_2_27 - depends on !arc - bool "Binutils 2.27" - select BINUTILS_VERSION_2_27 - - config BINUTILS_USE_VERSION_2_28 - depends on !arc - bool "Binutils 2.28" - select BINUTILS_VERSION_2_28 - - config BINUTILS_USE_VERSION_2_28_ARC - depends on arc - bool "ARC binutils 2.28" - select BINUTILS_VERSION_2_28_ARC - -endchoice - -config EXTRA_BINUTILS_CONFIG_OPTIONS - string - prompt "Additional binutils configure options" if TOOLCHAINOPTS - default "" - help - Any additional binutils options you may want to include.... diff --git a/toolchain-old/binutils/Config.version b/toolchain-old/binutils/Config.version deleted file mode 100644 index 1b223e410..000000000 --- a/toolchain-old/binutils/Config.version +++ /dev/null @@ -1,16 +0,0 @@ -config BINUTILS_VERSION_2_27 - bool - -config BINUTILS_VERSION_2_28 - default y if (!TOOLCHAINOPTS && !arc) - bool - -config BINUTILS_VERSION_2_28_ARC - default y if (!TOOLCHAINOPTS && arc) - bool - -config BINUTILS_VERSION - string - default "2.27" if BINUTILS_VERSION_2_27 - default "2.28" if BINUTILS_VERSION_2_28 - default "arc-2017.03" if BINUTILS_VERSION_2_28_ARC diff --git a/toolchain-old/binutils/Makefile b/toolchain-old/binutils/Makefile deleted file mode 100644 index 6df11fbd3..000000000 --- a/toolchain-old/binutils/Makefile +++ /dev/null @@ -1,112 +0,0 @@ -# -# Copyright (C) 2006-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=binutils -PKG_VERSION:=$(call qstrip,$(CONFIG_BINUTILS_VERSION)) -BIN_VERSION:=$(PKG_VERSION) - -PKG_SOURCE_URL:=@GNU/binutils/ -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 - -ifeq ($(PKG_VERSION),2.27) - PKG_HASH:=369737ce51587f92466041a97ab7d2358c6d9e1b6490b3940eb09fb0a9a6ac88 -endif - -ifeq ($(PKG_VERSION),2.28) - PKG_HASH:=6297433ee120b11b4b0a1c8f3512d7d73501753142ab9e2daa13c5a3edd32a72 -endif - -ifneq ($(CONFIG_BINUTILS_VERSION_2_28_ARC),) - PKG_REV:=arc-2017.03-release - PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_REV)/ - PKG_SOURCE:=$(PKG_NAME)-$(PKG_REV).tar.gz - PKG_HASH:=f9c1e09ef10aaf9619181f49587f464ba0a70d29b7f6f879047140acac852409 - BINUTILS_DIR:=$(PKG_NAME)-gdb-$(PKG_REV) - HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(BINUTILS_DIR) -endif - -HOST_BUILD_PARALLEL:=1 - -PATCH_DIR:=./patches/$(PKG_VERSION) - -include $(INCLUDE_DIR)/toolchain-build.mk - -BINUTILS_CONFIGURE:= \ - ./configure \ - --prefix=$(TOOLCHAIN_DIR) \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --with-sysroot=$(TOOLCHAIN_DIR) \ - --enable-deterministic-archives \ - --enable-plugins \ - --disable-multilib \ - --disable-werror \ - --disable-nls \ - --disable-sim \ - --disable-gdb \ - $(GRAPHITE_CONFIGURE) \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - $(call qstrip,$(CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS)) - -ifneq ($(CONFIG_SSP_SUPPORT),) - BINUTILS_CONFIGURE+= \ - --enable-libssp -else - BINUTILS_CONFIGURE+= \ - --disable-libssp -endif - -ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) - BINUTILS_CONFIGURE+= \ - --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) -endif - -define Host/Prepare - $(call Host/Prepare/Default) - ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ - $(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h -endef - -define Host/Configure - (cd $(HOST_BUILD_DIR); \ - $(BINUTILS_CONFIGURE) \ - ); -endef - -define Host/Compile - +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all -endef - -define Host/Install - mkdir -p $(TOOLCHAIN_DIR)/initial - $(MAKE) -C $(HOST_BUILD_DIR) \ - prefix=$(TOOLCHAIN_DIR)/initial \ - install - $(MAKE) -C $(HOST_BUILD_DIR) \ - prefix=$(TOOLCHAIN_DIR) \ - install - $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) - $(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a - $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf - # ARC gcc requires extlib. - # If extlib is not available in "initial" folder - # initial gcc will fail to build libc. - if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \ - $(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \ - fi -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch b/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch deleted file mode 100644 index 36e09b1bb..000000000 --- a/toolchain-old/binutils/patches/2.27/001-MIPS_BFD_Remove_EI_ABIVERSION_5.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4d4f40e041ce7c8c7c8e50f957e0440b64ab7e95 Mon Sep 17 00:00:00 2001 -From: "Maciej W. Rozycki" -Date: Fri, 23 Dec 2016 20:03:36 +0000 -Subject: [PATCH] MIPS/BFD: Remove EI_ABIVERSION 5 allocation for PT_GNU_STACK - support - -Revert commit 17733f5be961 ("Increment the ABIVERSION to 5 for MIPS -objects with non-executable stacks.") and remove EI_ABIVERSION 5 -allocation for PT_GNU_STACK support, which has not made it to glibc -and will be reassigned. - - bfd/ - * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Revert - 2016-02-23 change and remove EI_ABIVERSION 5 support. ---- - bfd/ChangeLog | 5 +++++ - bfd/elfxx-mips.c | 3 --- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c -index d649676..486607c 100644 ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -16358,9 +16358,6 @@ _bfd_mips_post_process_headers (bfd *abfd, struct bfd_link_info *link_info) - if (mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64 - || mips_elf_tdata (abfd)->abiflags.fp_abi == Val_GNU_MIPS_ABI_FP_64A) - i_ehdrp->e_ident[EI_ABIVERSION] = 3; -- -- if (elf_stack_flags (abfd) && !(elf_stack_flags (abfd) & PF_X)) -- i_ehdrp->e_ident[EI_ABIVERSION] = 5; - } - - int --- -2.9.3 - diff --git a/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch deleted file mode 100644 index e4cec7f69..000000000 --- a/toolchain-old/binutils/patches/2.27/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,7 @@ endif - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 95d3f75b8..000000000 --- a/toolchain-old/binutils/patches/2.27/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1244,6 +1244,8 @@ fragment <link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch b/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch deleted file mode 100644 index b7458e58a..000000000 --- a/toolchain-old/binutils/patches/2.27/400-mips_no_dynamic_linking_sym.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -7713,6 +7713,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; - bh = NULL; -+ if (0) { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, - NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) -@@ -7725,6 +7726,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - if (! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; -+ } - - if (! mips_elf_hash_table (info)->use_rld_obj_head) - { diff --git a/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch b/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch deleted file mode 100644 index 7a8f0ae13..000000000 --- a/toolchain-old/binutils/patches/2.27/500-Change-default-emulation-for-mips64-linux.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/bfd/config.bfd -+++ b/bfd/config.bfd -@@ -1101,12 +1101,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" - ;; - mips64*el-*-linux*) -- targ_defvec=mips_elf32_ntrad_le_vec -- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" -+ targ_defvec=mips_elf64_trad_le_vec -+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" - ;; - mips64*-*-linux*) -- targ_defvec=mips_elf32_ntrad_be_vec -- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" -+ targ_defvec=mips_elf64_trad_be_vec -+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" - ;; - mips*el-*-linux*) - targ_defvec=mips_elf32_trad_le_vec ---- a/ld/configure.tgt -+++ b/ld/configure.tgt -@@ -513,11 +513,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip - mips*-*-vxworks*) targ_emul=elf32ebmipvxworks - targ_extra_emuls="elf32elmipvxworks" ;; - mips*-*-windiss) targ_emul=elf32mipswindiss ;; --mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 -- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" -+mips64*el-*-linux-*) targ_emul=elf64ltsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" - targ_extra_libpath=$targ_extra_emuls ;; --mips64*-*-linux-*) targ_emul=elf32btsmipn32 -- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" -+mips64*-*-linux-*) targ_emul=elf64btsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" - targ_extra_libpath=$targ_extra_emuls ;; - mips*el-*-linux-*) targ_emul=elf32ltsmip - targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch deleted file mode 100644 index e4cec7f69..000000000 --- a/toolchain-old/binutils/patches/2.28/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,7 @@ endif - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 95d3f75b8..000000000 --- a/toolchain-old/binutils/patches/2.28/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1244,6 +1244,8 @@ fragment <link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch b/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch deleted file mode 100644 index b7458e58a..000000000 --- a/toolchain-old/binutils/patches/2.28/400-mips_no_dynamic_linking_sym.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/bfd/elfxx-mips.c -+++ b/bfd/elfxx-mips.c -@@ -7713,6 +7713,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - name = SGI_COMPAT (abfd) ? "_DYNAMIC_LINK" : "_DYNAMIC_LINKING"; - bh = NULL; -+ if (0) { - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, name, BSF_GLOBAL, bfd_abs_section_ptr, 0, - NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) -@@ -7725,6 +7726,7 @@ _bfd_mips_elf_create_dynamic_sections (b - - if (! bfd_elf_link_record_dynamic_symbol (info, h)) - return FALSE; -+ } - - if (! mips_elf_hash_table (info)->use_rld_obj_head) - { diff --git a/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch b/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch deleted file mode 100644 index 7a8f0ae13..000000000 --- a/toolchain-old/binutils/patches/2.28/500-Change-default-emulation-for-mips64-linux.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- a/bfd/config.bfd -+++ b/bfd/config.bfd -@@ -1101,12 +1101,12 @@ case "${targ}" in - targ_selvecs="mips_elf32_le_vec mips_elf64_be_vec mips_elf64_le_vec mips_ecoff_be_vec mips_ecoff_le_vec" - ;; - mips64*el-*-linux*) -- targ_defvec=mips_elf32_ntrad_le_vec -- targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_le_vec mips_elf64_trad_be_vec" -+ targ_defvec=mips_elf64_trad_le_vec -+ targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_ntrad_be_vec mips_elf32_trad_le_vec mips_elf32_trad_be_vec mips_elf64_trad_be_vec" - ;; - mips64*-*-linux*) -- targ_defvec=mips_elf32_ntrad_be_vec -- targ_selvecs="mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_be_vec mips_elf64_trad_le_vec" -+ targ_defvec=mips_elf64_trad_be_vec -+ targ_selvecs="mips_elf32_ntrad_be_vec mips_elf32_ntrad_le_vec mips_elf32_trad_be_vec mips_elf32_trad_le_vec mips_elf64_trad_le_vec" - ;; - mips*el-*-linux*) - targ_defvec=mips_elf32_trad_le_vec ---- a/ld/configure.tgt -+++ b/ld/configure.tgt -@@ -513,11 +513,11 @@ mips*el-*-vxworks*) targ_emul=elf32elmip - mips*-*-vxworks*) targ_emul=elf32ebmipvxworks - targ_extra_emuls="elf32elmipvxworks" ;; - mips*-*-windiss) targ_emul=elf32mipswindiss ;; --mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 -- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" -+mips64*el-*-linux-*) targ_emul=elf64ltsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32ltsmip elf32btsmip elf64btsmip" - targ_extra_libpath=$targ_extra_emuls ;; --mips64*-*-linux-*) targ_emul=elf32btsmipn32 -- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" -+mips64*-*-linux-*) targ_emul=elf64btsmip -+ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" - targ_extra_libpath=$targ_extra_emuls ;; - mips*el-*-linux-*) targ_emul=elf32ltsmip - targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" diff --git a/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch b/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch deleted file mode 100644 index e4cec7f69..000000000 --- a/toolchain-old/binutils/patches/arc-2016.09-release/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/ld/Makefile.am -+++ b/ld/Makefile.am -@@ -57,7 +57,7 @@ endif - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- a/ld/Makefile.in -+++ b/ld/Makefile.in -@@ -451,7 +451,7 @@ AM_CFLAGS = $(WARN_CFLAGS) $(ELF_CLFAGS) - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch b/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 95d3f75b8..000000000 --- a/toolchain-old/binutils/patches/arc-2016.09-release/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/ld/emultempl/elf32.em -+++ b/ld/emultempl/elf32.em -@@ -1244,6 +1244,8 @@ fragment <link.next) - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) diff --git a/toolchain-old/fortify-headers/Makefile b/toolchain-old/fortify-headers/Makefile deleted file mode 100644 index 8caf8c84c..000000000 --- a/toolchain-old/fortify-headers/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (C) 2015 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/target.mk - -PKG_NAME:=fortify-headers -PKG_VERSION:=0.8 -PKG_RELEASE=1 - -PKG_SOURCE_URL:=http://dl.2f30.org/releases -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=afcd073d6d8d175eede2a28a7dd71b7150cb03290f99102261892c793f6b4cb1 - -include $(INCLUDE_DIR)/toolchain-build.mk - -define Host/Compile - true -endef - -define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) PREFIX="" DESTDIR="$(TOOLCHAIN_DIR)" install -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/gcc/Config.in b/toolchain-old/gcc/Config.in deleted file mode 100644 index ea33ac29c..000000000 --- a/toolchain-old/gcc/Config.in +++ /dev/null @@ -1,78 +0,0 @@ -# Choose gcc version. - -choice - prompt "GCC compiler Version" if TOOLCHAINOPTS - default GCC_USE_VERSION_6_3_ARC if arc - default GCC_USE_VERSION_5 - help - Select the version of gcc you wish to use. - - config GCC_USE_VERSION_6_3_ARC - select GCC_VERSION_6_3_ARC - bool "gcc 6.3.x with support of ARC cores" - depends on arc - - config GCC_USE_VERSION_5 - bool "gcc 5.x" - depends on !arc - - config GCC_USE_VERSION_6 - bool "gcc 6.x" - depends on !arc - - config GCC_USE_VERSION_7 - bool "gcc 7.x" - depends on !arc - -endchoice - -config GCC_USE_GRAPHITE - bool - prompt "Compile in support for the new Graphite framework in GCC 4.4+" if TOOLCHAINOPTS - -config EXTRA_GCC_CONFIG_OPTIONS - string - prompt "Additional gcc configure options" if TOOLCHAINOPTS - default "" - help - Any additional gcc options you may want to include.... - -config SSP_SUPPORT - bool - prompt "Enable Stack-Smashing Protection support" if TOOLCHAINOPTS - depends on !USE_MUSL - default y if !USE_MUSL - help - Enable Stack-Smashing Protection support - -config SJLJ_EXCEPTIONS - bool - prompt "Use setjump()/longjump() exceptions" if TOOLCHAINOPTS - default n - help - Use old setjump()/longjump() exceptions instead of the newer - frame unwinding exceptions handling routines. Warning: increases - code size and runtime memory usage. - -config INSTALL_LIBGCJ - bool - prompt "Build/install java compiler and GNU classpath ?" if TOOLCHAINOPTS - default n - help - Build/install java compiler and GNU classpath ? - - -config INSTALL_GFORTRAN - bool - prompt "Build/install fortran compiler?" if TOOLCHAINOPTS - default n - help - Build/install GNU fortran compiler ? - -config INSTALL_GCCGO - bool - prompt "Build/install Go compiler?" if TOOLCHAINOPTS - depends on USE_GLIBC || BROKEN - default n - help - Build/install GNU gccgo compiler ? diff --git a/toolchain-old/gcc/Config.version b/toolchain-old/gcc/Config.version deleted file mode 100644 index 86c723dc9..000000000 --- a/toolchain-old/gcc/Config.version +++ /dev/null @@ -1,14 +0,0 @@ -config GCC_VERSION_6_3_ARC - default y if (!TOOLCHAINOPTS && arc) - bool - -config GCC_VERSION - string - default "arc-2017.03-release" if GCC_VERSION_6_3_ARC - default "6.3.0" if GCC_USE_VERSION_6 - default "7.1.0" if GCC_USE_VERSION_7 - default "5.4.0" - -config GCC_VERSION_6_3 - bool - default y if GCC_VERSION_6_3_ARC diff --git a/toolchain-old/gcc/common.mk b/toolchain-old/gcc/common.mk deleted file mode 100644 index abf69bfdc..000000000 --- a/toolchain-old/gcc/common.mk +++ /dev/null @@ -1,228 +0,0 @@ -# -# Copyright (C) 2002-2003 Erik Andersen -# Copyright (C) 2004 Manuel Novoa III -# Copyright (C) 2005-2006 Felix Fietkau -# Copyright (C) 2006-2014 OpenWrt.org -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -include $(TOPDIR)/rules.mk - -PKG_NAME:=gcc -GCC_VERSION:=$(call qstrip,$(CONFIG_GCC_VERSION)) -PKG_VERSION:=$(firstword $(subst +, ,$(GCC_VERSION))) -GCC_DIR:=$(PKG_NAME)-$(PKG_VERSION) - -PKG_SOURCE_URL:=@GNU/gcc/gcc-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 - -ifeq ($(PKG_VERSION),5.4.0) - PKG_HASH:=608df76dec2d34de6558249d8af4cbee21eceddbcb580d666f7a5a583ca3303a -endif - -ifeq ($(PKG_VERSION),6.3.0) - PKG_HASH:=f06ae7f3f790fbf0f018f6d40e844451e6bc3b7bc96e128e63b09825c1f8b29f -endif - -ifeq ($(PKG_VERSION),7.1.0) - PKG_HASH:=8a8136c235f64c6fef69cac0d73a46a1a09bb250776a050aec8f9fc880bebc17 -endif - -ifneq ($(CONFIG_GCC_VERSION_6_3_ARC),) - PKG_VERSION:=6.3.0 - PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/archive/$(GCC_VERSION) - PKG_SOURCE:=$(PKG_NAME)-$(GCC_VERSION).tar.gz - PKG_HASH:=b7223e134199b1a6f71de629da6aa845790e55d28e9892143dde09b1bc878110 - PKG_REV:=2017.03-release - GCC_DIR:=gcc-arc-$(PKG_REV) - HOST_BUILD_DIR = $(BUILD_DIR_HOST)/$(PKG_NAME)-$(GCC_VERSION) -endif - -PATCH_DIR=../patches/$(GCC_VERSION) - -BUGURL=http://www.lede-project.org/bugs/ -PKGVERSION=OpenWrt GCC $(PKG_VERSION) $(REVISION) - -HOST_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/toolchain-build.mk - -HOST_SOURCE_DIR:=$(HOST_BUILD_DIR) -ifeq ($(GCC_VARIANT),minimal) - GCC_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) -else - HOST_BUILD_DIR:=$(HOST_BUILD_DIR)-$(GCC_VARIANT) - GCC_BUILD_DIR:=$(HOST_BUILD_DIR) -endif - -HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared -HOST_STAMP_BUILT:=$(GCC_BUILD_DIR)/.built -HOST_STAMP_CONFIGURED:=$(GCC_BUILD_DIR)/.configured -HOST_STAMP_INSTALLED:=$(HOST_BUILD_PREFIX)/stamp/.gcc_$(GCC_VARIANT)_installed - -SEP:=, -TARGET_LANGUAGES:="c,c++$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)$(if $(CONFIG_INSTALL_GFORTRAN),$(SEP)fortran)$(if $(CONFIG_INSTALL_GCCGO),$(SEP)go)" - -TAR_OPTIONS += \ - --exclude-from='$(CURDIR)/../exclude-testsuite' --exclude=gcc/ada/*.ad* \ - -ifndef CONFIG_INSTALL_LIBGCJ - TAR_OPTIONS += --exclude=libjava -endif - -export libgcc_cv_fixed_point=no -ifdef CONFIG_USE_UCLIBC - export glibcxx_cv_c99_math_tr1=no -endif -ifdef CONFIG_INSTALL_GCCGO - export libgo_cv_c_split_stack_supported=no -endif - -ifdef CONFIG_GCC_USE_GRAPHITE - GRAPHITE_CONFIGURE:= --with-isl=$(TOPDIR)/staging_dir/host -else - GRAPHITE_CONFIGURE:= --without-isl --without-cloog -endif - -GCC_CONFIGURE:= \ - SHELL="$(BASH)" \ - $(if $(shell gcc --version 2>&1 | grep LLVM), \ - CFLAGS="-O2 -fbracket-depth=512 -pipe" \ - CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \ - ) \ - $(HOST_SOURCE_DIR)/configure \ - --with-bugurl=$(BUGURL) \ - --with-pkgversion="$(PKGVERSION)" \ - --prefix=$(TOOLCHAIN_DIR) \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --with-gnu-ld \ - --enable-target-optspace \ - --disable-libgomp \ - --disable-libmudflap \ - --disable-multilib \ - --disable-libmpx \ - --disable-nls \ - $(GRAPHITE_CONFIGURE) \ - --with-host-libstdcxx=-lstdc++ \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \ - $(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \ - --with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \ - $(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \ - --with-gmp=$(TOPDIR)/staging_dir/host \ - --with-mpfr=$(TOPDIR)/staging_dir/host \ - --with-mpc=$(TOPDIR)/staging_dir/host \ - --disable-decimal-float -ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) - GCC_CONFIGURE += --with-mips-plt -endif - -ifndef GCC_VERSION_4_8 - GCC_CONFIGURE += --with-diagnostics-color=auto-if-env -endif - -ifneq ($(CONFIG_SSP_SUPPORT),) - GCC_CONFIGURE+= \ - --enable-libssp -else - GCC_CONFIGURE+= \ - --disable-libssp -endif - -ifneq ($(CONFIG_EXTRA_TARGET_ARCH),) - GCC_CONFIGURE+= \ - --enable-biarch \ - --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-$(TARGET_SUFFIX) -endif - -ifdef CONFIG_sparc - GCC_CONFIGURE+= \ - --enable-targets=all \ - --with-long-double-128 -endif - -ifeq ($(LIBC),uClibc) - GCC_CONFIGURE+= \ - --disable-__cxa_atexit -else - GCC_CONFIGURE+= \ - --enable-__cxa_atexit -endif - -ifneq ($(GCC_ARCH),) - GCC_CONFIGURE+= --with-arch=$(GCC_ARCH) -endif - -ifneq ($(CONFIG_SOFT_FLOAT),y) - ifeq ($(CONFIG_arm),y) - GCC_CONFIGURE+= \ - --with-float=hard - endif -endif - -ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy) - TARGET_CFLAGS+=-fno-split-stack -endif - -GCC_MAKE:= \ - export SHELL="$(BASH)"; \ - $(MAKE) \ - CFLAGS="$(HOST_CFLAGS)" \ - CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ - CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \ - GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" - -define Host/SetToolchainInfo - $(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,GCC_VERSION=.*,GCC_VERSION=$(GCC_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -ifneq ($(GCC_PREPARE),) - define Host/Prepare - $(call Host/SetToolchainInfo) - $(call Host/Prepare/Default) - ln -snf $(GCC_DIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_SOURCE_DIR)/ - $(SED) 's,^MULTILIB_OSDIRNAMES,# MULTILIB_OSDIRNAMES,' $(HOST_SOURCE_DIR)/gcc/config/*/t-* - $(SED) 'd' $(HOST_SOURCE_DIR)/gcc/DEV-PHASE - $(SED) 's, DATESTAMP,,' $(HOST_SOURCE_DIR)/gcc/version.c - #(cd $(HOST_SOURCE_DIR)/libstdc++-v3; autoconf;); - $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(HOST_SOURCE_DIR)/libstdc++-v3/configure - mkdir -p $(GCC_BUILD_DIR) - endef -else - define Host/Prepare - mkdir -p $(GCC_BUILD_DIR) - endef -endif - -define Host/Configure - (cd $(GCC_BUILD_DIR) && rm -f config.cache; \ - $(GCC_CONFIGURE) \ - ); -endef - -define Host/Clean - rm -rf $(if $(GCC_PREPARE),$(HOST_SOURCE_DIR)) \ - $(HOST_BUILD_PREFIX)/stamp/.gcc_* \ - $(HOST_BUILD_PREFIX)/stamp/.binutils_* \ - $(GCC_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ - $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) \ - $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc* \ - $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c* -endef diff --git a/toolchain-old/gcc/exclude-testsuite b/toolchain-old/gcc/exclude-testsuite deleted file mode 100644 index 37a8f2476..000000000 --- a/toolchain-old/gcc/exclude-testsuite +++ /dev/null @@ -1,9 +0,0 @@ -gcc-*/gcc/testsuite/ada -gcc-*/gcc/testsuite/brig.dg -gcc-*/gcc/testsuite/c-c++-common -gcc-*/gcc/testsuite/ChangeLog* -gcc-*/gcc/testsuite/config -gcc-*/gcc/testsuite/g* -gcc-*/gcc/testsuite/jit.dg -gcc-*/gcc/testsuite/lib -gcc-*/gcc/testsuite/o* diff --git a/toolchain-old/gcc/files/alternate-arch-cc.in b/toolchain-old/gcc/files/alternate-arch-cc.in deleted file mode 100644 index e169951eb..000000000 --- a/toolchain-old/gcc/files/alternate-arch-cc.in +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -exec @CC_BASE@ @EXTRA_ARCH_OPTS@ "$@" diff --git a/toolchain-old/gcc/final/Makefile b/toolchain-old/gcc/final/Makefile deleted file mode 100644 index b815f677d..000000000 --- a/toolchain-old/gcc/final/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -GCC_VARIANT:=final - -include ../common.mk - -GCC_CONFIGURE += \ - --with-headers=$(TOOLCHAIN_DIR)/include \ - --disable-libsanitizer \ - --enable-languages=$(TARGET_LANGUAGES) \ - --enable-shared \ - --enable-threads \ - --with-slibdir=$(TOOLCHAIN_DIR)/lib \ - --enable-lto \ - --with-libelf=$(TOPDIR)/staging_dir/host - -ifdef CONFIG_USE_MUSL - GCC_MAKE += gcc_cv_libc_provides_ssp=yes -endif - -ifneq ($(CONFIG_SJLJ_EXCEPTIONS),) - GCC_CONFIGURE += \ - --enable-sjlj-exceptions -endif - -define CleanupToolchain - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) - # Important! Required for limits.h to be fixed. - rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include - ln -sf ../include $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include - rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib - ln -sf ../lib $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib - $(if $(CONFIG_ARCH_64BIT),ln -sf ../lib64 $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib64) -endef - -define Host/Configure - $(CleanupToolchain) - mkdir -p $(GCC_BUILD_DIR) - (cd $(GCC_BUILD_DIR) && rm -f config.cache; \ - $(GCC_CONFIGURE) \ - ); -endef - -ifeq ($(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yy) -define FixGogccCrt - # link crtX.o for gotools - mkdir -p $(GCC_BUILD_DIR)/gotools - $(foreach crt, i 1 n, ln -sf ../../glibc-dev/lib/crt$(crt).o $(GCC_BUILD_DIR)/gotools/ ; ) -endef -endif - -define Host/Compile - $(FixGogccCrt) - +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all -endef - -define SetupExtraArch - for app in $(TOOLCHAIN_DIR)/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \ - [ -e $$$$app ] || continue; \ - old_base=$$$$(basename $$$$app); \ - new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \ - sed -e "s/@CC_BASE@/$$$$old_base/" \ - -e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \ - ../files/alternate-arch-cc.in > \ - $(TOOLCHAIN_DIR)/bin/$$$$new_base; \ - chmod a+x $(TOOLCHAIN_DIR)/bin/$$$$new_base; \ - done -endef - -define Host/Install - $(CleanupToolchain) - +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) install - # Set up the symlinks to enable lying about target name. - set -e; \ - (cd $(TOOLCHAIN_DIR); \ - ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ - cd bin; \ - for app in $(REAL_GNU_TARGET_NAME)-* ; do \ - ln -sf $$$${app} \ - $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \ - done; \ - ); - $(if $(CONFIG_EXTRA_TARGET_ARCH),$(call SetupExtraArch)) - $(RM) $(TOOLCHAIN_DIR)/lib/libiberty.a - $(SCRIPT_DIR)/patch-specs.sh "$(TOOLCHAIN_DIR)" -endef - -$(eval $(call HostBuild)) - diff --git a/toolchain-old/gcc/initial/Makefile b/toolchain-old/gcc/initial/Makefile deleted file mode 100644 index c71b17dd8..000000000 --- a/toolchain-old/gcc/initial/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -GCC_VARIANT:=initial -GCC_PREPARE=$(CONFIG_USE_MUSL) - -include ../common.mk - -GCC_CONFIGURE += \ - --with-newlib \ - --with-sysroot=$(TOOLCHAIN_DIR) \ - --enable-languages=c \ - --disable-shared \ - --disable-threads \ - -define Host/Compile - +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ - all-build-libiberty \ - all-gcc \ - all-target-libgcc -endef - -define Host/Install - +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \ - prefix="$(TOOLCHAIN_DIR)/initial" \ - install-gcc \ - install-target-libgcc - - # XXX: glibc insists on linking against libgcc_eh - ( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \ - [ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \ - cp libgcc.a libgcc_initial.a; \ - ) - - $(call FixupLibdir,$(TOOLCHAIN_DIR)/initial) - $$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/gcc/minimal/Makefile b/toolchain-old/gcc/minimal/Makefile deleted file mode 100644 index 31d6f675a..000000000 --- a/toolchain-old/gcc/minimal/Makefile +++ /dev/null @@ -1,29 +0,0 @@ -GCC_VARIANT:=minimal -GCC_PREPARE=$(if $(CONFIG_USE_MUSL),,1) - -include ../common.mk - -GCC_CONFIGURE += \ - --with-newlib \ - --without-headers \ - --enable-languages=c \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-shared \ - --disable-threads - -define Host/Compile - +$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) all-gcc all-target-libgcc -endef - -define Host/Install - $(GCC_MAKE) -C $(GCC_BUILD_DIR) install-gcc install-target-libgcc -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(GCC_BUILD_DIR) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch deleted file mode 100644 index 06373eb6a..000000000 --- a/toolchain-old/gcc/patches/5.4.0/001-revert_register_mode_search.patch +++ /dev/null @@ -1,65 +0,0 @@ -Revert of: - -commit 275035b56823b26d5fb7e90fad945b998648edf2 -Author: bergner -Date: Thu Sep 5 14:09:07 2013 +0000 - - PR target/58139 - * reginfo.c (choose_hard_reg_mode): Scan through all mode classes - looking for widest mode. - - - git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 - - ---- a/gcc/reginfo.c -+++ b/gcc/reginfo.c -@@ -665,35 +665,40 @@ choose_hard_reg_mode (unsigned int regno - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - - if (found_mode != VOIDmode) diff --git a/toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch deleted file mode 100644 index b3d2dbe29..000000000 --- a/toolchain-old/gcc/patches/5.4.0/002-case_insensitive.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { - # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ --# if defined(__APPLE__) --# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM --# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 --# endif --# endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain-old/gcc/patches/5.4.0/010-documentation.patch b/toolchain-old/gcc/patches/5.4.0/010-documentation.patch deleted file mode 100644 index 07064a97b..000000000 --- a/toolchain-old/gcc/patches/5.4.0/010-documentation.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -2941,18 +2941,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) - doc/gccint.info: $(TEXI_GCCINT_FILES) - doc/cppinternals.info: $(TEXI_CPPINT_FILES) - --doc/%.info: %.texi -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/%.info: - - # Duplicate entry to handle renaming of gccinstall.info --doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/gccinstall.info: - - doc/cpp.dvi: $(TEXI_CPP_FILES) - doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch b/toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch deleted file mode 100644 index b9702c952..000000000 --- a/toolchain-old/gcc/patches/5.4.0/020-no-plt-backport.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/gcc/calls.c -+++ b/gcc/calls.c -@@ -225,6 +225,12 @@ prepare_call_address (tree fndecl_or_typ - && targetm.small_register_classes_for_mode_p (FUNCTION_MODE)) - ? force_not_mem (memory_address (FUNCTION_MODE, funexp)) - : memory_address (FUNCTION_MODE, funexp)); -+ else if (flag_pic && !flag_plt && fndecl_or_type -+ && TREE_CODE (fndecl_or_type) == FUNCTION_DECL -+ && !targetm.binds_local_p (fndecl_or_type)) -+ { -+ funexp = force_reg (Pmode, funexp); -+ } - else if (! sibcallp) - { - #ifndef NO_FUNCTION_CSE ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -1779,6 +1779,10 @@ fpie - Common Report Var(flag_pie,1) Negative(fPIC) - Generate position-independent code for executables if possible (small mode) - -+fplt -+Common Report Var(flag_plt) Init(1) -+Use PLT for PIC calls (-fno-plt: load the address from GOT at call site) -+ - fplugin= - Common Joined RejectNegative Var(common_deferred_options) Defer - Specify a plugin to load diff --git a/toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch b/toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch deleted file mode 100644 index e88af3403..000000000 --- a/toolchain-old/gcc/patches/5.4.0/040-fix-mips-ICE-PR-68400.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -8001,9 +8001,17 @@ mask_low_and_shift_p (machine_mode mode, - bool - and_operands_ok (machine_mode mode, rtx op1, rtx op2) - { -- return (memory_operand (op1, mode) -- ? and_load_operand (op2, mode) -- : and_reg_operand (op2, mode)); -+ if (!memory_operand (op1, mode)) -+ return and_reg_operand (op2, mode); -+ -+ if (!and_load_operand (op2, mode)) -+ return false; -+ -+ if (!TARGET_MIPS16 || si_mask_operand(op2, mode)) -+ return true; -+ -+ op1 = XEXP (op1, 0); -+ return !(REG_P (op1) && REGNO (op1) == STACK_POINTER_REGNUM); - } - - /* The canonical form of a mask-low-and-shift-left operation is diff --git a/toolchain-old/gcc/patches/5.4.0/200-musl_config.patch b/toolchain-old/gcc/patches/5.4.0/200-musl_config.patch deleted file mode 100644 index b9a5b2827..000000000 --- a/toolchain-old/gcc/patches/5.4.0/200-musl_config.patch +++ /dev/null @@ -1,309 +0,0 @@ -From: ktkachov -Date: Fri, 8 May 2015 08:25:47 +0000 (+0000) -Subject: [PATCH 2/13] musl libc config -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a9173ceabaf29c16f8ef226fbf98af373a4b2ceb - -[PATCH 2/13] musl libc config - -2015-05-08 Gregor Richards - Szabolcs Nagy - - * config.gcc (LIBC_MUSL): New tm_defines macro. - * config/linux.h (OPTION_MUSL): Define. - (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER32,) - (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32,) - (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) - (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) - (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. - * config/linux.opt (mmusl): New option. - * doc/invoke.texi (GNU/Linux Options): Document -mmusl. - * configure.ac (gcc_cv_libc_provides_ssp): Add *-*-musl*. - (gcc_cv_target_dl_iterate_phdr): Add *-linux-musl*. - * configure: Regenerate. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222904 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -575,7 +575,7 @@ case ${target} in - esac - - # Common C libraries. --tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" -+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" - - # 32-bit x86 processors supported by --with-arch=. Each processor - # MUST be separated by exactly one space. -@@ -720,6 +720,9 @@ case ${target} in - *-*-*uclibc*) - tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC" - ;; -+ *-*-*musl*) -+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL" -+ ;; - *) - tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC" - ;; ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -32,10 +32,12 @@ see the files COPYING3 and COPYING.RUNTI - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) - #else - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) -+#define OPTION_MUSL (linux_libc == LIBC_MUSL) - #endif - - #define GNU_USER_TARGET_OS_CPP_BUILTINS() \ -@@ -50,21 +52,25 @@ see the files COPYING3 and COPYING.RUNTI - } while (0) - - /* Determine which dynamic linker to use depending on whether GLIBC or -- uClibc or Bionic is the default C library and whether -- -muclibc or -mglibc or -mbionic has been passed to change the default. */ -+ uClibc or Bionic or musl is the default C library and whether -+ -muclibc or -mglibc or -mbionic or -mmusl has been passed to change -+ the default. */ - --#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \ -- "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}" -+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4) \ -+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}" - - #if DEFAULT_LIBC == LIBC_GLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ -- CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B) -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ -+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M) - #elif DEFAULT_LIBC == LIBC_UCLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ -- CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B) -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ -+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M) - #elif DEFAULT_LIBC == LIBC_BIONIC --#define CHOOSE_DYNAMIC_LINKER(G, U, B) \ -- CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U) -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ -+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M) -+#elif DEFAULT_LIBC == LIBC_MUSL -+#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \ -+ CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B) - #else - #error "Unsupported DEFAULT_LIBC" - #endif /* DEFAULT_LIBC */ -@@ -81,24 +87,100 @@ see the files COPYING3 and COPYING.RUNTI - #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker" - #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64" - #define BIONIC_DYNAMIC_LINKERX32 "/system/bin/linkerx32" -+/* Should be redefined for each target that supports musl. */ -+#define MUSL_DYNAMIC_LINKER "/dev/null" -+#define MUSL_DYNAMIC_LINKER32 "/dev/null" -+#define MUSL_DYNAMIC_LINKER64 "/dev/null" -+#define MUSL_DYNAMIC_LINKERX32 "/dev/null" - - #define GNU_USER_DYNAMIC_LINKER \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \ -- BIONIC_DYNAMIC_LINKER) -+ BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) - #define GNU_USER_DYNAMIC_LINKER32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \ -- BIONIC_DYNAMIC_LINKER32) -+ BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) - #define GNU_USER_DYNAMIC_LINKER64 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \ -- BIONIC_DYNAMIC_LINKER64) -+ BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) - #define GNU_USER_DYNAMIC_LINKERX32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \ -- BIONIC_DYNAMIC_LINKERX32) -+ BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32) - - /* Whether we have Bionic libc runtime */ - #undef TARGET_HAS_BIONIC - #define TARGET_HAS_BIONIC (OPTION_BIONIC) - -+/* musl avoids problematic includes by rearranging the include directories. -+ * Unfortunately, this is mostly duplicated from cppdefault.c */ -+#if DEFAULT_LIBC == LIBC_MUSL -+#define INCLUDE_DEFAULTS_MUSL_GPP \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, -+ -+#ifdef LOCAL_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_LOCAL \ -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, -+#else -+#define INCLUDE_DEFAULTS_MUSL_LOCAL -+#endif -+ -+#ifdef PREFIX_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_PREFIX \ -+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_PREFIX -+#endif -+ -+#ifdef CROSS_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_CROSS \ -+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_CROSS -+#endif -+ -+#ifdef TOOL_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_TOOL \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_TOOL -+#endif -+ -+#ifdef NATIVE_SYSTEM_HEADER_DIR -+#define INCLUDE_DEFAULTS_MUSL_NATIVE \ -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, -+#else -+#define INCLUDE_DEFAULTS_MUSL_NATIVE -+#endif -+ -+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) -+# undef INCLUDE_DEFAULTS_MUSL_LOCAL -+# define INCLUDE_DEFAULTS_MUSL_LOCAL -+# undef INCLUDE_DEFAULTS_MUSL_NATIVE -+# define INCLUDE_DEFAULTS_MUSL_NATIVE -+#else -+# undef INCLUDE_DEFAULTS_MUSL_CROSS -+# define INCLUDE_DEFAULTS_MUSL_CROSS -+#endif -+ -+#undef INCLUDE_DEFAULTS -+#define INCLUDE_DEFAULTS \ -+ { \ -+ INCLUDE_DEFAULTS_MUSL_GPP \ -+ INCLUDE_DEFAULTS_MUSL_PREFIX \ -+ INCLUDE_DEFAULTS_MUSL_CROSS \ -+ INCLUDE_DEFAULTS_MUSL_TOOL \ -+ INCLUDE_DEFAULTS_MUSL_NATIVE \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+ } -+#endif -+ - #if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */ - /* This is a *uclinux* target. We don't define below macros to normal linux - versions, because doing so would require *uclinux* targets to include ---- a/gcc/config/linux.opt -+++ b/gcc/config/linux.opt -@@ -28,5 +28,9 @@ Target Report RejectNegative Var(linux_l - Use GNU C library - - muclibc --Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic) -+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mmusl) - Use uClibc C library -+ -+mmusl -+Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mbionic) -+Use musl C library ---- a/gcc/configure -+++ b/gcc/configure -@@ -27833,6 +27833,9 @@ if test "${gcc_cv_libc_provides_ssp+set} - else - gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -27865,6 +27868,7 @@ fi - # ) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail" -@@ -27961,6 +27965,9 @@ case "$target" in - gcc_cv_target_dl_iterate_phdr=no - fi - ;; -+ *-linux-musl*) -+ gcc_cv_target_dl_iterate_phdr=yes -+ ;; - esac - - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then ---- a/gcc/configure.ac -+++ b/gcc/configure.ac -@@ -5287,6 +5287,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe - gcc_cv_libc_provides_ssp, - [gcc_cv_libc_provides_ssp=no - case "$target" in -+ *-*-musl*) -+ # All versions of musl provide stack protector -+ gcc_cv_libc_provides_ssp=yes;; - *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu) - # glibc 2.4 and later provides __stack_chk_fail and - # either __stack_chk_guard, or TLS access to stack guard canary. -@@ -5313,6 +5316,7 @@ AC_CACHE_CHECK(__stack_chk_fail in targe - # ) and for now - # simply assert that glibc does provide this, which is true for all - # realistically usable GNU/Hurd configurations. -+ # All supported versions of musl provide it as well - gcc_cv_libc_provides_ssp=yes;; - *-*-darwin* | *-*-freebsd*) - AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes], -@@ -5386,6 +5390,9 @@ case "$target" in - gcc_cv_target_dl_iterate_phdr=no - fi - ;; -+ *-linux-musl*) -+ gcc_cv_target_dl_iterate_phdr=yes -+ ;; - esac - GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR]) - if test x$gcc_cv_target_dl_iterate_phdr = xyes; then ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -667,7 +667,7 @@ Objective-C and Objective-C++ Dialects}. - -mcpu=@var{cpu}} - - @emph{GNU/Linux Options} --@gccoptlist{-mglibc -muclibc -mbionic -mandroid @gol -+@gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol - -tno-android-cc -tno-android-ld} - - @emph{H8/300 Options} -@@ -15340,13 +15340,19 @@ These @samp{-m} options are defined for - @item -mglibc - @opindex mglibc - Use the GNU C library. This is the default except --on @samp{*-*-linux-*uclibc*} and @samp{*-*-linux-*android*} targets. -+on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and -+@samp{*-*-linux-*android*} targets. - - @item -muclibc - @opindex muclibc - Use uClibc C library. This is the default on - @samp{*-*-linux-*uclibc*} targets. - -+@item -mmusl -+@opindex mmusl -+Use the musl C library. This is the default on -+@samp{*-*-linux-*musl*} targets. -+ - @item -mbionic - @opindex mbionic - Use Bionic C library. This is the default on diff --git a/toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch b/toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch deleted file mode 100644 index 27a26afc0..000000000 --- a/toolchain-old/gcc/patches/5.4.0/201-musl_arm.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: ktkachov -Date: Wed, 27 May 2015 13:17:11 +0000 (+0000) -Subject: [PATCH 4/13] arm musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=de799bd087ab9a179768fea75bd195a31d3432a4 - -[PATCH 4/13] arm musl support - -On behalf of szabolcs.nagy@arm.com - -2015-05-27 Gregor Richards - - * config/arm/linux-eabi.h (MUSL_DYNAMIC_LINKER): Define. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223749 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -77,6 +77,23 @@ - %{mfloat-abi=soft*:" GLIBC_DYNAMIC_LINKER_SOFT_FLOAT "} \ - %{!mfloat-abi=*:" GLIBC_DYNAMIC_LINKER_DEFAULT "}" - -+/* For ARM musl currently supports four dynamic linkers: -+ - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI -+ - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI -+ - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB -+ - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB -+ musl does not support the legacy OABI mode. -+ All the dynamic linkers live in /lib. -+ We default to soft-float, EL. */ -+#undef MUSL_DYNAMIC_LINKER -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}" -+#else -+#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}" -+#endif -+#define MUSL_DYNAMIC_LINKER \ -+ "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" -+ - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ - #undef LINK_SPEC diff --git a/toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch b/toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch deleted file mode 100644 index 816dd8d10..000000000 --- a/toolchain-old/gcc/patches/5.4.0/202-musl_mips.patch +++ /dev/null @@ -1,35 +0,0 @@ -From: ktkachov -Date: Fri, 8 May 2015 15:16:50 +0000 (+0000) -Subject: [PATCH 6/13] mips musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2550b6a866c887472b587bef87d433c51cf1ebc8 - -[PATCH 6/13] mips musl support - -2015-05-08 Gregor Richards - Szabolcs Nagy - - * config/mips/linux.h (MUSL_DYNAMIC_LINKER32): Define. - (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERN32): Define. - (GNU_USER_DYNAMIC_LINKERN32): Update. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222915 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config/mips/linux.h -+++ b/gcc/config/mips/linux.h -@@ -37,7 +37,13 @@ along with GCC; see the file COPYING3. - #define UCLIBC_DYNAMIC_LINKERN32 \ - "%{mnan=2008:/lib32/ld-uClibc-mipsn8.so.0;:/lib32/ld-uClibc.so.0}" - -+#undef MUSL_DYNAMIC_LINKER32 -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-mips%{EL:el}%{msoft-float:-sf}.so.1" -+#undef MUSL_DYNAMIC_LINKER64 -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-mips64%{EL:el}%{msoft-float:-sf}.so.1" -+#define MUSL_DYNAMIC_LINKERN32 "/lib/ld-musl-mipsn32%{EL:el}%{msoft-float:-sf}.so.1" -+ - #define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32" - #define GNU_USER_DYNAMIC_LINKERN32 \ - CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \ -- BIONIC_DYNAMIC_LINKERN32) -+ BIONIC_DYNAMIC_LINKERN32, MUSL_DYNAMIC_LINKERN32) diff --git a/toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch b/toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch deleted file mode 100644 index b4f34e81c..000000000 --- a/toolchain-old/gcc/patches/5.4.0/203-musl_powerpc.patch +++ /dev/null @@ -1,209 +0,0 @@ - -gcc/Changelog: - -2015-04-24 Gregor Richards - Szabolcs Nagy - - * config.gcc (secure_plt): Add *-linux*-musl*. - * config/rs6000/linux64.h (MUSL_DYNAMIC_LINKER32): Define. - (MUSL_DYNAMIC_LINKER64): Define. - (GNU_USER_DYNAMIC_LINKER32): Update. - (GNU_USER_DYNAMIC_LINKER64): Update. - (CHOOSE_DYNAMIC_LINKER): Update. - - * config/rs6000/secureplt.h (LINK_SECURE_PLT_DEFAULT_SPEC): Define. - * config/rs6000/sysv4.h (GNU_USER_DYNAMIC_LINKER): Update. - (MUSL_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER_E,) - (INCLUDE_DEFAULTS_MUSL_GPP, INCLUDE_DEFAULTS_MUSL_LOCAL,) - (INCLUDE_DEFAULTS_MUSL_PREFIX, INCLUDE_DEFAULTS_MUSL_CROSS,) - (INCLUDE_DEFAULTS_MUSL_TOOL, INCLUDE_DEFAULTS_MUSL_NATIVE): Define. - (LINK_SECURE_PLT_DEFAULT_SPEC): Define. - (CHOOSE_DYNAMIC_LINKER, LINK_TARGET_SPEC, LINK_OS_LINUX_SPEC): Update. - - * config/rs6000/sysv4le.h (MUSL_DYNAMIC_LINKER_E): Define. - ---- a/gcc/config/rs6000/linux64.h -+++ b/gcc/config/rs6000/linux64.h -@@ -365,17 +365,21 @@ extern int dot_symbols; - #endif - #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" - #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" - #if DEFAULT_LIBC == LIBC_UCLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" - #elif DEFAULT_LIBC == LIBC_GLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" -+#elif DEFAULT_LIBC == LIBC_MUSL -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" - #else - #error "Unsupported DEFAULT_LIBC" - #endif - #define GNU_USER_DYNAMIC_LINKER32 \ -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32) -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32) - #define GNU_USER_DYNAMIC_LINKER64 \ -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64) -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64) - - #undef DEFAULT_ASM_ENDIAN - #if (TARGET_DEFAULT & MASK_LITTLE_ENDIAN) ---- a/gcc/config/rs6000/secureplt.h -+++ b/gcc/config/rs6000/secureplt.h -@@ -18,3 +18,4 @@ along with GCC; see the file COPYING3. - . */ - - #define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt" -+#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt" ---- a/gcc/config/rs6000/sysv4.h -+++ b/gcc/config/rs6000/sysv4.h -@@ -537,6 +537,9 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF - #ifndef CC1_SECURE_PLT_DEFAULT_SPEC - #define CC1_SECURE_PLT_DEFAULT_SPEC "" - #endif -+#ifndef LINK_SECURE_PLT_DEFAULT_SPEC -+#define LINK_SECURE_PLT_DEFAULT_SPEC "" -+#endif - - /* Pass -G xxx to the compiler. */ - #undef CC1_SPEC -@@ -574,7 +577,8 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF - %{R*} \ - %(link_shlib) \ - %{!T*: %(link_start) } \ --%(link_os)" -+%(link_os)" \ -+"%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}" - - /* Shared libraries are not default. */ - #define LINK_SHLIB_SPEC "\ -@@ -757,17 +761,22 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF - - #define LINK_START_LINUX_SPEC "" - -+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","") -+ - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" - #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" - #if DEFAULT_LIBC == LIBC_UCLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}" -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" -+#elif DEFAULT_LIBC == LIBC_MUSL -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}" - #elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC --#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}" -+#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}" - #else - #error "Unsupported DEFAULT_LIBC" - #endif - #define GNU_USER_DYNAMIC_LINKER \ -- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER) -+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER) - - #define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ - %{rdynamic:-export-dynamic} \ -@@ -889,6 +898,7 @@ ncrtn.o%s" - { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \ - { "link_os_default", LINK_OS_DEFAULT_SPEC }, \ - { "cc1_secure_plt_default", CC1_SECURE_PLT_DEFAULT_SPEC }, \ -+ { "link_secure_plt_default", LINK_SECURE_PLT_DEFAULT_SPEC }, \ - { "cpp_os_ads", CPP_OS_ADS_SPEC }, \ - { "cpp_os_yellowknife", CPP_OS_YELLOWKNIFE_SPEC }, \ - { "cpp_os_mvme", CPP_OS_MVME_SPEC }, \ -@@ -943,3 +953,72 @@ ncrtn.o%s" - /* This target uses the sysv4.opt file. */ - #define TARGET_USES_SYSV4_OPT 1 - -+/* Include order changes for musl, same as in generic linux.h. */ -+#if DEFAULT_LIBC == LIBC_MUSL -+#define INCLUDE_DEFAULTS_MUSL_GPP \ -+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, \ -+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 }, \ -+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ -+ GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, -+ -+#ifdef LOCAL_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_LOCAL \ -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ -+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, -+#else -+#define INCLUDE_DEFAULTS_MUSL_LOCAL -+#endif -+ -+#ifdef PREFIX_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_PREFIX \ -+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_PREFIX -+#endif -+ -+#ifdef CROSS_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_CROSS \ -+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_CROSS -+#endif -+ -+#ifdef TOOL_INCLUDE_DIR -+#define INCLUDE_DEFAULTS_MUSL_TOOL \ -+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0}, -+#else -+#define INCLUDE_DEFAULTS_MUSL_TOOL -+#endif -+ -+#ifdef NATIVE_SYSTEM_HEADER_DIR -+#define INCLUDE_DEFAULTS_MUSL_NATIVE \ -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 }, \ -+ { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 }, -+#else -+#define INCLUDE_DEFAULTS_MUSL_NATIVE -+#endif -+ -+#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT) -+# undef INCLUDE_DEFAULTS_MUSL_LOCAL -+# define INCLUDE_DEFAULTS_MUSL_LOCAL -+# undef INCLUDE_DEFAULTS_MUSL_NATIVE -+# define INCLUDE_DEFAULTS_MUSL_NATIVE -+#else -+# undef INCLUDE_DEFAULTS_MUSL_CROSS -+# define INCLUDE_DEFAULTS_MUSL_CROSS -+#endif -+ -+#undef INCLUDE_DEFAULTS -+#define INCLUDE_DEFAULTS \ -+ { \ -+ INCLUDE_DEFAULTS_MUSL_GPP \ -+ INCLUDE_DEFAULTS_MUSL_PREFIX \ -+ INCLUDE_DEFAULTS_MUSL_CROSS \ -+ INCLUDE_DEFAULTS_MUSL_TOOL \ -+ INCLUDE_DEFAULTS_MUSL_NATIVE \ -+ { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 }, \ -+ { 0, 0, 0, 0, 0, 0 } \ -+ } -+#endif ---- a/gcc/config/rs6000/sysv4le.h -+++ b/gcc/config/rs6000/sysv4le.h -@@ -31,3 +31,5 @@ - /* Little-endian PowerPC64 Linux uses the ELF v2 ABI by default. */ - #define LINUX64_DEFAULT_ABI_ELFv2 - -+#undef MUSL_DYNAMIC_LINKER_E -+#define MUSL_DYNAMIC_LINKER_E ENDIAN_SELECT("","le","le") ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -2416,6 +2416,10 @@ powerpc*-*-linux*) - powerpc*-*-linux*paired*) - tm_file="${tm_file} rs6000/750cl.h" ;; - esac -+ case ${target} in -+ *-linux*-musl*) -+ enable_secureplt=yes ;; -+ esac - if test x${enable_secureplt} = xyes; then - tm_file="rs6000/secureplt.h ${tm_file}" - fi diff --git a/toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch b/toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch deleted file mode 100644 index 8c3753d53..000000000 --- a/toolchain-old/gcc/patches/5.4.0/204-musl_sh.patch +++ /dev/null @@ -1,39 +0,0 @@ -gcc/Changelog: - -2015-04-27 Gregor Richards - Szabolcs Nagy - - * config/sh/linux.h (MUSL_DYNAMIC_LINKER): Define. - (MUSL_DYNAMIC_LINKER_E, MUSL_DYNAMIC_LINKER_FP): Define. - ---- a/gcc/config/sh/linux.h -+++ b/gcc/config/sh/linux.h -@@ -43,6 +43,28 @@ along with GCC; see the file COPYING3. - - #define TARGET_ASM_FILE_END file_end_indicate_exec_stack - -+#if TARGET_ENDIAN_DEFAULT == MASK_LITTLE_ENDIAN -+#define MUSL_DYNAMIC_LINKER_E "%{mb:eb}" -+#else -+#define MUSL_DYNAMIC_LINKER_E "%{!ml:eb}" -+#endif -+ -+#if TARGET_CPU_DEFAULT & ( MASK_HARD_SH2A_DOUBLE | MASK_SH4 ) -+/* "-nofpu" if any nofpu option is specified */ -+#define MUSL_DYNAMIC_LINKER_FP \ -+ "%{m1|m2|m2a-nofpu|m3|m4-nofpu|m4-100-nofpu|m4-200-nofpu|m4-300-nofpu|" \ -+ "m4-340|m4-400|m4-500|m4al|m5-32media-nofpu|m5-64media-nofpu|" \ -+ "m5-compact-nofpu:-nofpu}" -+#else -+/* "-nofpu" if none of the hard fpu options are specified */ -+#define MUSL_DYNAMIC_LINKER_FP \ -+ "%{m2a|m4|m4-100|m4-200|m4-300|m4a|m5-32media|m5-64media|m5-compact:;:-nofpu}" -+#endif -+ -+#undef MUSL_DYNAMIC_LINKER -+#define MUSL_DYNAMIC_LINKER \ -+ "/lib/ld-musl-sh" MUSL_DYNAMIC_LINKER_E MUSL_DYNAMIC_LINKER_FP ".so.1" -+ - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #undef SUBTARGET_LINK_EMUL_SUFFIX diff --git a/toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch b/toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch deleted file mode 100644 index 8772328d6..000000000 --- a/toolchain-old/gcc/patches/5.4.0/205-musl_x86.patch +++ /dev/null @@ -1,41 +0,0 @@ -From: ktkachov -Date: Fri, 15 May 2015 13:20:01 +0000 (+0000) -Subject: [PATCH 9/13] x86 musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=5551c8d927c17f60837f15f8dfe46f945ba3fa9c - -[PATCH 9/13] x86 musl support - -On behalf of Szabolcs Nagy. - -2015-05-15 Gregor Richards - - * config/i386/linux.h (MUSL_DYNAMIC_LINKER): Define. - * config/i386/linux64.h (MUSL_DYNAMIC_LINKER32): Define. - (MUSL_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKERX32): Define. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223218 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config/i386/linux.h -+++ b/gcc/config/i386/linux.h -@@ -21,3 +21,6 @@ along with GCC; see the file COPYING3. - - #define GNU_USER_LINK_EMULATION "elf_i386" - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" -+ -+#undef MUSL_DYNAMIC_LINKER -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1" ---- a/gcc/config/i386/linux64.h -+++ b/gcc/config/i386/linux64.h -@@ -30,3 +30,10 @@ see the files COPYING3 and COPYING.RUNTI - #define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2" - #define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2" - #define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2" -+ -+#undef MUSL_DYNAMIC_LINKER32 -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1" -+#undef MUSL_DYNAMIC_LINKER64 -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1" -+#undef MUSL_DYNAMIC_LINKERX32 -+#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1" diff --git a/toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch b/toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch deleted file mode 100644 index 6925a026e..000000000 --- a/toolchain-old/gcc/patches/5.4.0/206-musl_aarch64.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: jgreenhalgh -Date: Wed, 27 May 2015 16:46:39 +0000 (+0000) -Subject: [PATCH 3/13] aarch64 musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=b3ff21cf0531be91bc3fb8200296a7633090ec78 - -[PATCH 3/13] aarch64 musl support - -gcc/Changelog: - -2015-05-27 Gregor Richards - Szabolcs Nagy - - * config/aarch64/aarch64-linux.h (MUSL_DYNAMIC_LINKER): Define. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223766 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config/aarch64/aarch64-linux.h -+++ b/gcc/config/aarch64/aarch64-linux.h -@@ -23,6 +23,9 @@ - - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" - -+#undef MUSL_DYNAMIC_LINKER -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-aarch64%{mbig-endian:_be}%{mabi=ilp32:_ilp32}.so.1" -+ - #undef ASAN_CC1_SPEC - #define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}" - diff --git a/toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch b/toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch deleted file mode 100644 index 0ff33d39d..000000000 --- a/toolchain-old/gcc/patches/5.4.0/207-musl_fixincludes.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: ktkachov -Date: Wed, 22 Apr 2015 14:18:16 +0000 (+0000) -Subject: fixincludes update for musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=2dc727de2e87c2756a514cbb43cea23c99deaa3d - -fixincludes update for musl support - -On behalf of Szabolcs.Nagy@arm.com - -2015-04-22 Gregor Richards - - * mkfixinc.sh: Add *-musl* with no fixes. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222327 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/fixincludes/mkfixinc.sh -+++ b/fixincludes/mkfixinc.sh -@@ -19,7 +19,8 @@ case $machine in - powerpc-*-eabi* | \ - powerpc-*-rtems* | \ - powerpcle-*-eabisim* | \ -- powerpcle-*-eabi* ) -+ powerpcle-*-eabi* | \ -+ *-musl* ) - # IF there is no include fixing, - # THEN create a no-op fixer and exit - (echo "#! /bin/sh" ; echo "exit 0" ) > ${target} diff --git a/toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch b/toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch deleted file mode 100644 index d2414d023..000000000 --- a/toolchain-old/gcc/patches/5.4.0/209-musl_libstdc++.patch +++ /dev/null @@ -1,72 +0,0 @@ -From: ktkachov -Date: Wed, 22 Apr 2015 14:24:11 +0000 (+0000) -Subject: libstdc++, libgfortran gthr workaround for musl -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=1e5f711c11cb80ce609db9e9c1d8b2da0f7b5b61 - -libstdc++, libgfortran gthr workaround for musl - -On behalf of szabolcs.nagy@arm.com - -[libstdc++-v3/] -2015-04-22 Szabolcs Nagy - - * config/os/generic/os_defines.h (_GLIBCXX_GTHREAD_USE_WEAK): Define. - * configure.host (os_include_dir): Set to "os/generic" for linux-musl*. - -[libgfortran/] -2015-04-22 Szabolcs Nagy - - * acinclude.m4 (GTHREAD_USE_WEAK): Define as 0 for *-*-musl*. - * configure: Regenerate. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222329 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/libgfortran/acinclude.m4 -+++ b/libgfortran/acinclude.m4 -@@ -100,7 +100,7 @@ void foo (void); - [Define to 1 if the target supports #pragma weak]) - fi - case "$host" in -- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) -+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) - AC_DEFINE(GTHREAD_USE_WEAK, 0, - [Define to 0 if the target shouldn't use #pragma weak]) - ;; ---- a/libgfortran/configure -+++ b/libgfortran/configure -@@ -26456,7 +26456,7 @@ $as_echo "#define SUPPORTS_WEAK 1" >>con - - fi - case "$host" in -- *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* ) -+ *-*-darwin* | *-*-hpux* | *-*-cygwin* | *-*-mingw* | *-*-musl* ) - - $as_echo "#define GTHREAD_USE_WEAK 0" >>confdefs.h - ---- a/libstdc++-v3/config/os/generic/os_defines.h -+++ b/libstdc++-v3/config/os/generic/os_defines.h -@@ -33,4 +33,9 @@ - // System-specific #define, typedefs, corrections, etc, go here. This - // file will come before all others. - -+// Disable the weak reference logic in gthr.h for os/generic because it -+// is broken on every platform unless there is implementation specific -+// workaround in gthr-posix.h and at link-time for static linking. -+#define _GLIBCXX_GTHREAD_USE_WEAK 0 -+ - #endif ---- a/libstdc++-v3/configure.host -+++ b/libstdc++-v3/configure.host -@@ -273,6 +273,9 @@ case "${host_os}" in - freebsd*) - os_include_dir="os/bsd/freebsd" - ;; -+ linux-musl*) -+ os_include_dir="os/generic" -+ ;; - gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu) - if [ "$uclibc" = "yes" ]; then - os_include_dir="os/uclibc" diff --git a/toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch deleted file mode 100644 index 30f42e9f7..000000000 --- a/toolchain-old/gcc/patches/5.4.0/230-musl_libssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -727,7 +727,9 @@ proper position among the other output f - #endif - - #ifndef LINK_SSP_SPEC --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if DEFAULT_LIBC == LIBC_MUSL -+#define LINK_SSP_SPEC "-lssp_nonshared" -+#elif defined(TARGET_LIBC_PROVIDES_SSP) - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit:}" - #else diff --git a/toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch b/toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch deleted file mode 100644 index 533cb6849..000000000 --- a/toolchain-old/gcc/patches/5.4.0/240-musl-libitm-fixes.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: ktkachov -Date: Wed, 22 Apr 2015 14:11:25 +0000 (+0000) -Subject: libitm fixes for musl support -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=e53a4d49c3d03ab8eaddb073cf972c1c46d75338 - -libitm fixes for musl support - -On behalf of Szabolcs.Nagy@arm.com - -2015-04-22 Gregor Richards - - * config/arm/hwcap.cc: Use fcntl.h instead of sys/fcntl.h. - * config/linux/x86/tls.h: Only use __GLIBC_PREREQ if defined. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222325 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/libitm/config/arm/hwcap.cc -+++ b/libitm/config/arm/hwcap.cc -@@ -40,7 +40,7 @@ int GTM_hwcap HIDDEN = 0 - - #ifdef __linux__ - #include --#include -+#include - #include - - static void __attribute__((constructor)) ---- a/libitm/config/linux/x86/tls.h -+++ b/libitm/config/linux/x86/tls.h -@@ -25,16 +25,19 @@ - #ifndef LIBITM_X86_TLS_H - #define LIBITM_X86_TLS_H 1 - --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) -+#if defined(__GLIBC_PREREQ) -+#if __GLIBC_PREREQ(2, 10) - /* Use slots in the TCB head rather than __thread lookups. - GLIBC has reserved words 10 through 13 for TM. */ - #define HAVE_ARCH_GTM_THREAD 1 - #define HAVE_ARCH_GTM_THREAD_DISP 1 - #endif -+#endif - - #include "config/generic/tls.h" - --#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) -+#if defined(__GLIBC_PREREQ) -+#if __GLIBC_PREREQ(2, 10) - namespace GTM HIDDEN { - - #ifdef __x86_64__ -@@ -101,5 +104,6 @@ static inline void set_abi_disp(struct a - - } // namespace GTM - #endif /* >= GLIBC 2.10 */ -+#endif - - #endif // LIBITM_X86_TLS_H diff --git a/toolchain-old/gcc/patches/5.4.0/250-add-musl.patch b/toolchain-old/gcc/patches/5.4.0/250-add-musl.patch deleted file mode 100644 index 8cbeddea3..000000000 --- a/toolchain-old/gcc/patches/5.4.0/250-add-musl.patch +++ /dev/null @@ -1,120 +0,0 @@ -From: ktkachov -Date: Fri, 8 May 2015 08:30:40 +0000 (+0000) -Subject: [PATCH 0/13] Add musl support to GCC -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=f2d678afa5b8385d763b93772d73d6bf80a9739e - -[PATCH 0/13] Add musl support to GCC - -2015-05-08 Szabolcs Nagy - - * config/glibc-stdint.h (OPTION_MUSL): Define. - (INT_FAST16_TYPE, INT_FAST32_TYPE, UINT_FAST16_TYPE, UINT_FAST32_TYPE): - Change the definition based on OPTION_MUSL for 64 bit targets. - * config/linux.h (OPTION_MUSL): Redefine. - * config/alpha/linux.h (OPTION_MUSL): Redefine. - * config/rs6000/linux.h (OPTION_MUSL): Redefine. - * config/rs6000/linux64.h (OPTION_MUSL): Redefine. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222905 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/gcc/config/alpha/linux.h -+++ b/gcc/config/alpha/linux.h -@@ -61,10 +61,14 @@ along with GCC; see the file COPYING3. - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) - #else - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (linux_libc == LIBC_MUSL) - #endif - - /* Determine what functions are present at the runtime; ---- a/gcc/config/glibc-stdint.h -+++ b/gcc/config/glibc-stdint.h -@@ -22,6 +22,12 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+/* Systems using musl libc should use this header and make sure -+ OPTION_MUSL is defined correctly before using the TYPE macros. */ -+#ifndef OPTION_MUSL -+#define OPTION_MUSL 0 -+#endif -+ - #define SIG_ATOMIC_TYPE "int" - - #define INT8_TYPE "signed char" -@@ -43,12 +49,12 @@ see the files COPYING3 and COPYING.RUNTI - #define UINT_LEAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") - - #define INT_FAST8_TYPE "signed char" --#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") --#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") -+#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") -+#define INT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long int" : "int") - #define INT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "long long int") - #define UINT_FAST8_TYPE "unsigned char" --#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") --#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "unsigned int") -+#define UINT_FAST16_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") -+#define UINT_FAST32_TYPE (LONG_TYPE_SIZE == 64 && !OPTION_MUSL ? "long unsigned int" : "unsigned int") - #define UINT_FAST64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : "long long unsigned int") - - #define INTPTR_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : "int") ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -32,11 +32,13 @@ see the files COPYING3 and COPYING.RUNTI - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) -+#undef OPTION_MUSL - #define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) - #else - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) -+#undef OPTION_MUSL - #define OPTION_MUSL (linux_libc == LIBC_MUSL) - #endif - ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -30,10 +30,14 @@ - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) - #else - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (linux_libc == LIBC_MUSL) - #endif - - /* Determine what functions are present at the runtime; ---- a/gcc/config/rs6000/linux64.h -+++ b/gcc/config/rs6000/linux64.h -@@ -299,10 +299,14 @@ extern int dot_symbols; - #define OPTION_GLIBC (DEFAULT_LIBC == LIBC_GLIBC) - #define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC) - #define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (DEFAULT_LIBC == LIBC_MUSL) - #else - #define OPTION_GLIBC (linux_libc == LIBC_GLIBC) - #define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC) - #define OPTION_BIONIC (linux_libc == LIBC_BIONIC) -+#undef OPTION_MUSL -+#define OPTION_MUSL (linux_libc == LIBC_MUSL) - #endif - - /* Determine what functions are present at the runtime; diff --git a/toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch b/toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch deleted file mode 100644 index a3b83e207..000000000 --- a/toolchain-old/gcc/patches/5.4.0/260-musl-add-unwind-fix.patch +++ /dev/null @@ -1,34 +0,0 @@ -From: ktkachov -Date: Wed, 22 Apr 2015 14:20:01 +0000 (+0000) -Subject: unwind fix for musl -X-Git-Url: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff_plain;h=a2e31d0681d8a47389b8a3552622fbd9827bcef4 - -unwind fix for musl - -On behalf of szabolcs.nagy@arm.com - -2015-04-22 Gregor Richards - Szabolcs Nagy - - * unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME): Define it on - Linux if target provides dl_iterate_phdr. - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@222328 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - ---- a/libgcc/unwind-dw2-fde-dip.c -+++ b/libgcc/unwind-dw2-fde-dip.c -@@ -59,6 +59,12 @@ - - #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ - && defined(TARGET_DL_ITERATE_PHDR) \ -+ && defined(__linux__) -+# define USE_PT_GNU_EH_FRAME -+#endif -+ -+#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ -+ && defined(TARGET_DL_ITERATE_PHDR) \ - && (defined(__DragonFly__) || defined(__FreeBSD__)) - # define ElfW __ElfN - # define USE_PT_GNU_EH_FRAME diff --git a/toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch b/toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch deleted file mode 100644 index bdebf6c01..000000000 --- a/toolchain-old/gcc/patches/5.4.0/270-musl-add-powerpc-softfloat-fix.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/gcc/config/rs6000/linux64.h -+++ b/gcc/config/rs6000/linux64.h -@@ -369,8 +369,8 @@ extern int dot_symbols; - #endif - #define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0" - #define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0" --#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" --#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E ".so.1" -+#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" -+#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" - #if DEFAULT_LIBC == LIBC_UCLIBC - #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" - #elif DEFAULT_LIBC == LIBC_GLIBC ---- a/gcc/config/rs6000/sysv4.h -+++ b/gcc/config/rs6000/sysv4.h -@@ -765,7 +765,7 @@ ENDIAN_SELECT(" -mbig", " -mlittle", DEF - - #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" - #define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0" --#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E ".so.1" -+#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc" MUSL_DYNAMIC_LINKER_E "%{msoft-float:-sf}.so.1" - #if DEFAULT_LIBC == LIBC_UCLIBC - #define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}" - #elif DEFAULT_LIBC == LIBC_MUSL diff --git a/toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch deleted file mode 100644 index af5acf8cc..000000000 --- a/toolchain-old/gcc/patches/5.4.0/280-musl-disable-ifunc-by-default.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 -From: nsz -Date: Tue, 30 Aug 2016 10:26:22 +0000 -Subject: [PATCH] disable ifunc on *-musl by default - -gcc/ - * config.gcc (*-*-*musl*): Disable gnu-indirect-function. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - gcc/ChangeLog | 4 ++++ - gcc/config.gcc | 4 ++-- - 2 files changed, 6 insertions(+), 2 deletions(-) - -diff --git a/gcc/config.gcc b/gcc/config.gcc -index 8827dc8..e544d76 100644 ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1465,7 +1465,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-gnu* | i[34567]8 - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes -@@ -1531,7 +1531,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu) - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes diff --git a/toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch deleted file mode 100644 index 1743658ac..000000000 --- a/toolchain-old/gcc/patches/5.4.0/300-mips_Os_cpu_rtx_cost_model.patch +++ /dev/null @@ -1,14 +0,0 @@ -Use the proper rtx cost model for the selected CPU, even when optimizing -for size. This generates better code. - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -17483,7 +17483,7 @@ mips_option_override (void) - flag_pcc_struct_return = 0; - - /* Decide which rtx_costs structure to use. */ -- if (optimize_size) -+ if (0 && optimize_size) - mips_cost = &mips_rtx_cost_optimize_size; - else - mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch deleted file mode 100644 index 0edeb13c7..000000000 --- a/toolchain-old/gcc/patches/5.4.0/800-arm_v5te_no_ldrd_strd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h -@@ -285,7 +285,7 @@ extern void (*arm_lang_output_object_att - /* Thumb-1 only. */ - #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) - --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ - && !TARGET_THUMB1) - - #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch deleted file mode 100644 index 1d06f5b2e..000000000 --- a/toolchain-old/gcc/patches/5.4.0/810-arm-softfloat-libgcc.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/libgcc/config/arm/t-linux -+++ b/libgcc/config/arm/t-linux -@@ -1,6 +1,10 @@ - LIB1ASMSRC = arm/lib1funcs.S - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 -+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ -+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ -+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ -+ _arm_fixsfsi _arm_fixunssfsi - - # Just for these, we omit the frame pointer since it makes such a big - # difference. ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -60,8 +60,6 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" -- - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch deleted file mode 100644 index 42bf0c8cc..000000000 --- a/toolchain-old/gcc/patches/5.4.0/820-libgcc_pic.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -887,11 +887,12 @@ $(libgcov-driver-objects): %$(objext): $ - - # Static libraries. - libgcc.a: $(libgcc-objects) -+libgcc_pic.a: $(libgcc-s-objects) - libgcov.a: $(libgcov-objects) - libunwind.a: $(libunwind-objects) - libgcc_eh.a: $(libgcc-eh-objects) - --libgcc.a libgcov.a libunwind.a libgcc_eh.a: -+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: - -rm -f $@ - - objects="$(objects)"; \ -@@ -913,7 +914,7 @@ libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_E - endif - - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - endif -@@ -1108,6 +1109,10 @@ install-shared: - chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a - -+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch deleted file mode 100644 index 37f8f2a54..000000000 --- a/toolchain-old/gcc/patches/5.4.0/830-arm_unbreak_armv4t.patch +++ /dev/null @@ -1,13 +0,0 @@ -http://sourceware.org/ml/crossgcc/2008-05/msg00009.html - ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -45,7 +45,7 @@ - The ARM10TDMI core is the default for armv5t, so set - SUBTARGET_CPU_DEFAULT to achieve this. */ - #undef SUBTARGET_CPU_DEFAULT --#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi - - /* TARGET_BIG_ENDIAN_DEFAULT is set in - config.gcc for big endian configurations. */ diff --git a/toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch deleted file mode 100644 index cb1fb9823..000000000 --- a/toolchain-old/gcc/patches/5.4.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -94,10 +94,15 @@ - #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" - -+/* For armv4 we pass --fix-v4bx to linker to support EABI */ -+#undef TARGET_FIX_V4BX_SPEC -+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ -+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" -+ - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ - #undef LINK_SPEC --#define LINK_SPEC EABI_LINK_SPEC \ -+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ - LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ - LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) - diff --git a/toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch deleted file mode 100644 index 5818cf4da..000000000 --- a/toolchain-old/gcc/patches/5.4.0/850-use_shared_libgcc.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -131,10 +131,6 @@ - #define ENDFILE_SPEC \ - LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) - --/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we -- do not use -lfloat. */ --#undef LIBGCC_SPEC -- - /* Clear the instruction cache from `beg' to `end'. This is - implemented in lib1funcs.S, so ensure an error if this definition - is used. */ ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI - builtin_assert ("system=posix"); \ - } while (0) - -+#ifndef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" -+#endif -+ - /* Determine which dynamic linker to use depending on whether GLIBC or - uClibc or Bionic or musl is the default C library and whether - -muclibc or -mglibc or -mbionic or -mmusl has been passed to change ---- a/libgcc/mkmap-symver.awk -+++ b/libgcc/mkmap-symver.awk -@@ -132,5 +132,5 @@ function output(lib) { - else if (inherit[lib]) - printf("} %s;\n", inherit[lib]); - else -- printf ("\n local:\n\t*;\n};\n"); -+ printf ("\n\t*;\n};\n"); - } ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -60,6 +60,9 @@ - #undef CPP_OS_DEFAULT_SPEC - #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" - -+#undef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" -+ - #undef LINK_SHLIB_SPEC - #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" - diff --git a/toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch deleted file mode 100644 index 80c347684..000000000 --- a/toolchain-old/gcc/patches/5.4.0/851-libgcc_no_compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/libgcc/config/t-libunwind -+++ b/libgcc/config/t-libunwind -@@ -2,8 +2,7 @@ - - HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER - --LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ -- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - - # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch deleted file mode 100644 index 0e64a4164..000000000 --- a/toolchain-old/gcc/patches/5.4.0/870-ppc_no_crtsavres.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -21500,7 +21500,7 @@ rs6000_savres_strategy (rs6000_stack_t * - /* Define cutoff for using out-of-line functions to save registers. */ - if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) - { -- if (!optimize_size) -+ if (1) - { - strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; - strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch b/toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch deleted file mode 100644 index def6c9f4a..000000000 --- a/toolchain-old/gcc/patches/5.4.0/880-no_java_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -380,7 +380,7 @@ see the files COPYING3 and COPYING.RUNTI - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif diff --git a/toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch deleted file mode 100644 index fab5db3be..000000000 --- a/toolchain-old/gcc/patches/5.4.0/881-no_tm_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ - #endif - - #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) --# define USE_TM_CLONE_REGISTRY 1 -+# define USE_TM_CLONE_REGISTRY 0 - #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch deleted file mode 100644 index dd6e9dc88..000000000 --- a/toolchain-old/gcc/patches/5.4.0/900-bad-mips16-crt.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/libgcc/config/mips/t-mips16 -+++ b/libgcc/config/mips/t-mips16 -@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 - - # Version these symbols if building libgcc.so. - SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver -+ -+CRTSTUFF_T_CFLAGS += -mno-mips16 -+CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch deleted file mode 100644 index 2d7272ef9..000000000 --- a/toolchain-old/gcc/patches/5.4.0/910-mbsd_multi.patch +++ /dev/null @@ -1,222 +0,0 @@ - - This patch brings over a few features from MirBSD: - * -fhonour-copts - If this option is not given, it's warned (depending - on environment variables). This is to catch errors - of misbuilt packages which override CFLAGS themselves. - * -Werror-maybe-reset - Has the effect of -Wno-error if GCC_NO_WERROR is - set and not '0', a no-operation otherwise. This is - to be able to use -Werror in "make" but prevent - GNU autoconf generated configure scripts from - freaking out. - - This patch was authored by Thorsten Glaser - with copyright assignment to the FSF in effect. - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -122,6 +122,9 @@ static int class_dump_flags; - /* Whether any standard preincluded header has been preincluded. */ - static bool done_preinclude; - -+/* Check if a port honours COPTS. */ -+static int honour_copts = 0; -+ - static void handle_OPT_d (const char *); - static void set_std_cxx98 (int); - static void set_std_cxx11 (int); -@@ -449,6 +452,12 @@ c_common_handle_option (size_t scode, co - flag_no_builtin = !value; - break; - -+ case OPT_fhonour_copts: -+ if (c_language == clk_c) { -+ honour_copts++; -+ } -+ break; -+ - case OPT_fconstant_string_class_: - constant_string_class_name = arg; - break; -@@ -1034,6 +1043,47 @@ c_common_init (void) - return false; - } - -+ if (c_language == clk_c) { -+ char *ev = getenv ("GCC_HONOUR_COPTS"); -+ int evv; -+ if (ev == NULL) -+ evv = -1; -+ else if ((*ev == '0') || (*ev == '\0')) -+ evv = 0; -+ else if (*ev == '1') -+ evv = 1; -+ else if (*ev == '2') -+ evv = 2; -+ else if (*ev == 's') -+ evv = -1; -+ else { -+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); -+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ -+ } -+ if (evv == 1) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in lenient mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ warning (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } else if (evv == 2) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in strict mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ error ("someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ return false; -+ } -+ } else if (evv == 0) { -+ if (honour_copts != 1) -+ inform (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } -+ - return true; - } - ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -431,6 +431,10 @@ Wfloat-conversion - C ObjC C++ ObjC++ Var(warn_float_conversion) LangEnabledBy(C ObjC C++ ObjC++,Wconversion) - Warn for implicit type conversions that cause loss of floating point precision - -+Werror-maybe-reset -+C ObjC C++ ObjC++ -+; Documented in common.opt -+ - Wfloat-equal - C ObjC C++ ObjC++ Var(warn_float_equal) Warning - Warn if testing floating point numbers for equality -@@ -1161,6 +1165,9 @@ C++ ObjC++ Optimization Alias(fexception - fhonor-std - C++ ObjC++ Ignore Warn(switch %qs is no longer supported) - -+fhonour-copts -+C ObjC C++ ObjC++ RejectNegative -+ - fhosted - C ObjC - Assume normal C execution environment ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -561,6 +561,10 @@ Werror= - Common Joined - Treat specified warning as error - -+Werror-maybe-reset -+Common -+If environment variable GCC_NO_WERROR is set, act as -Wno-error -+ - Wextra - Common Var(extra_warnings) Warning - Print extra (possibly unwanted) warnings -@@ -1360,6 +1364,9 @@ fguess-branch-probability - Common Report Var(flag_guess_branch_prob) Optimization - Enable guessing of branch probabilities - -+fhonour-copts -+Common RejectNegative -+ - ; Nonzero means ignore `#ident' directives. 0 means handle them. - ; Generate position-independent code for executables if possible - ; On SVR4 targets, it also controls whether or not to emit a ---- a/gcc/opts.c -+++ b/gcc/opts.c -@@ -1699,6 +1699,17 @@ common_handle_option (struct gcc_options - opts, opts_set, loc, dc); - break; - -+ case OPT_Werror_maybe_reset: -+ { -+ char *ev = getenv ("GCC_NO_WERROR"); -+ if ((ev != NULL) && (*ev != '0')) -+ warnings_are_errors = 0; -+ } -+ break; -+ -+ case OPT_fhonour_copts: -+ break; -+ - case OPT_Wlarger_than_: - opts->x_larger_than_size = value; - opts->x_warn_larger_than = value != -1; ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -163,6 +163,11 @@ in older programs. This warning is on b - Make all warnings into hard errors. Source code which triggers warnings - will be rejected. - -+@item -Werror-maybe-reset -+@opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ - @item -Wsystem-headers - @opindex Wsystem-headers - Issue warnings for code in system headers. These are normally unhelpful ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -251,7 +251,7 @@ Objective-C and Objective-C++ Dialects}. - -Wdisabled-optimization @gol - -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol - -Wno-div-by-zero -Wdouble-promotion -Wempty-body -Wenum-compare @gol ---Wno-endif-labels -Werror -Werror=* @gol -+-Wno-endif-labels -Werror -Werror=* -Werror-maybe-reset @gol - -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol - -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol - -Wformat-security -Wformat-signedness -Wformat-y2k @gol -@@ -5382,6 +5382,22 @@ This option is only supported for C and - @option{-Wall} and by @option{-Wpedantic}, which can be disabled with - @option{-Wno-pointer-sign}. - -+@item -Werror-maybe-reset -+@opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ -+@item -fhonour-copts -+@opindex fhonour-copts -+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not -+given at least once, and warn if it is given more than once. -+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not -+given exactly once. -+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option -+is not given exactly once. -+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. -+This flag and environment variable only affect the C language. -+ - @item -Wstack-protector - @opindex Wstack-protector - @opindex Wno-stack-protector -@@ -7860,7 +7876,7 @@ so, the first branch is redirected to ei - second branch or a point immediately following it, depending on whether - the condition is known to be true or false. - --Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. -+Enabled at levels @option{-O3}. - - @item -fsplit-wide-types - @opindex fsplit-wide-types ---- a/gcc/java/jvspec.c -+++ b/gcc/java/jvspec.c -@@ -629,6 +629,7 @@ lang_specific_pre_link (void) - class name. Append dummy `.c' that can be stripped by set_input so %b - is correct. */ - set_input (concat (main_class_name, "main.c", NULL)); -+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ - err = do_spec (jvgenmain_spec); - if (err == 0) - { diff --git a/toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch deleted file mode 100644 index 3d708f24c..000000000 --- a/toolchain-old/gcc/patches/5.4.0/920-specs_nonfatal_getenv.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -8807,8 +8807,10 @@ getenv_spec_function (int argc, const ch - - value = getenv (argv[0]); - if (!value) -- fatal_error (input_location, -- "environment variable %qs not defined", argv[0]); -+ { -+ warning (input_location, "environment variable %qs not defined", argv[0]); -+ value = ""; -+ } - - /* We have to escape every character of the environment variable so - they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch deleted file mode 100644 index c05844d2e..000000000 --- a/toolchain-old/gcc/patches/5.4.0/930-fix-mips-noexecstack.patch +++ /dev/null @@ -1,111 +0,0 @@ -From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 -From: Andrew McDonnell -Date: Fri, 3 Oct 2014 19:09:00 +0930 -Subject: Add .note.GNU-stack section - -See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html -Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html - -Re: [Patch, MIPS] Add .note.GNU-stack section - - From: Steve Ellcey - -On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: -> -> -> On Wed, Sep 10, 2014 at 9:27 AM, wrote: - -> This works except you did not update the assembly files in -> libgcc or glibc. We (Cavium) have the same patch in our tree -> for a few released versions. - -> Mind just checking yours in then Andrew? - -> Thanks! -> -eric - -I talked to Andrew about what files he changed in GCC and created and -tested this new patch. Andrew also mentioned changing some assembly -files in glibc but I don't see any use of '.section .note.GNU-stack' in -any assembly files in glibc (for any platform) so I wasn't planning on -creating a glibc to add them to mips glibc assembly language files. - -OK to check in this patch? - -Steve Ellcey -sellcey@mips.com - - - -2014-09-26 Steve Ellcey ---- - gcc/config/mips/mips.c | 3 +++ - libgcc/config/mips/crti.S | 4 ++++ - libgcc/config/mips/crtn.S | 3 +++ - libgcc/config/mips/mips16.S | 4 ++++ - libgcc/config/mips/vr4120-div.S | 4 ++++ - 5 files changed, 18 insertions(+) - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -19629,6 +19629,9 @@ mips_lra_p (void) - #undef TARGET_LRA_P - #define TARGET_LRA_P mips_lra_p - -+#undef TARGET_ASM_FILE_END -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - struct gcc_target targetm = TARGET_INITIALIZER; - - #include "gt-mips.h" ---- a/libgcc/config/mips/crti.S -+++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+ -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/crtn.S -+++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/mips16.S -+++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI - values using the soft-float calling convention, but do the actual - operation using the hard floating point instructions. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) - - /* This file contains 32-bit assembly code. */ ---- a/libgcc/config/mips/vr4120-div.S -+++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI - -mfix-vr4120. div and ddiv do not give the correct result when one - of the operands is negative. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - .set nomips16 - - #define DIV \ diff --git a/toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch b/toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch deleted file mode 100644 index c8461a961..000000000 --- a/toolchain-old/gcc/patches/5.4.0/931-fix-MIPS-softfloat-build-issue.patch +++ /dev/null @@ -1,174 +0,0 @@ -From 2b46f9187b6f994fc450628a7cd97fc703dd23e0 Mon Sep 17 00:00:00 2001 -From: BangLang Huang -Date: Wed, 9 Nov 2016 10:36:49 +0800 -Subject: [PATCH] fix MIPS softfloat build issue - - This patch is backport from github/libffi #272 - -Signed-off-by: BangLang Huang ---- - libffi/src/mips/n32.S | 17 +++++++++++++++++ - libffi/src/mips/o32.S | 17 +++++++++++++++++ - 2 files changed, 34 insertions(+) - -diff --git a/libffi/src/mips/n32.S b/libffi/src/mips/n32.S -index c6985d3..8f25994 100644 ---- a/libffi/src/mips/n32.S -+++ b/libffi/src/mips/n32.S -@@ -107,6 +107,16 @@ loadregs: - - REG_L t6, 3*FFI_SIZEOF_ARG($fp) # load the flags word into t6. - -+#ifdef __mips_soft_float -+ REG_L a0, 0*FFI_SIZEOF_ARG(t9) -+ REG_L a1, 1*FFI_SIZEOF_ARG(t9) -+ REG_L a2, 2*FFI_SIZEOF_ARG(t9) -+ REG_L a3, 3*FFI_SIZEOF_ARG(t9) -+ REG_L a4, 4*FFI_SIZEOF_ARG(t9) -+ REG_L a5, 5*FFI_SIZEOF_ARG(t9) -+ REG_L a6, 6*FFI_SIZEOF_ARG(t9) -+ REG_L a7, 7*FFI_SIZEOF_ARG(t9) -+#else - and t4, t6, ((1</dev/null -+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null - @$(STAMP) stamp-bits-sup - - stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch deleted file mode 100644 index dc0938ab6..000000000 --- a/toolchain-old/gcc/patches/5.4.0/950-cpp_file_path_translation.patch +++ /dev/null @@ -1,182 +0,0 @@ -Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -581,6 +581,10 @@ c_common_handle_option (size_t scode, co - add_path (xstrdup (arg), SYSTEM, 0, true); - break; - -+ case OPT_iremap: -+ add_cpp_remap_path (arg); -+ break; -+ - case OPT_iwithprefix: - add_prefixed_path (arg, SYSTEM); - break; ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -1528,6 +1528,10 @@ iquote - C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) - -iquote Add to the end of the quote include path - -+iremap -+C ObjC C++ ObjC++ Joined Separate -+-iremap Convert to if it occurs as prefix in __FILE__. -+ - iwithprefix - C ObjC C++ ObjC++ Joined Separate - -iwithprefix Add to the end of the system include path ---- a/gcc/doc/cpp.texi -+++ b/gcc/doc/cpp.texi -@@ -4441,6 +4441,7 @@ without notice. - @c man begin SYNOPSIS - cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] - [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] -+ [@option{-iremap}@var{src}:@var{dst}] - [@option{-W}@var{warn}@dots{}] - [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] - [@option{-MP}] [@option{-MQ} @var{target}@dots{}] ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -532,6 +532,12 @@ Search @var{dir} only for header files r - If @var{dir} begins with @code{=}, then the @code{=} will be replaced - by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -fdirectives-only - @opindex fdirectives-only - When preprocessing, handle directives, but do not expand macros. ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -494,8 +494,8 @@ Objective-C and Objective-C++ Dialects}. - @item Directory Options - @xref{Directory Options,,Options for Directory Search}. - @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol ---iquote@var{dir} -L@var{dir} -specs=@var{file} -I- @gol ----sysroot=@var{dir} --no-sysroot-suffix} -+-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -specs=@var{file} @gol -+-I- --sysroot=@var{dir} --no-sysroot-suffix} - - @item Machine Dependent Options - @xref{Submodel Options,,Hardware Models and Configurations}. -@@ -11479,6 +11479,12 @@ be searched for header files only for th - "@var{file}"}; they are not searched for @code{#include <@var{file}>}, - otherwise just like @option{-I}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -L@var{dir} - @opindex L - Add directory @var{dir} to the list of directories to be searched ---- a/libcpp/include/cpplib.h -+++ b/libcpp/include/cpplib.h -@@ -751,6 +751,9 @@ extern void cpp_set_lang (cpp_reader *, - /* Set the include paths. */ - extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); - -+/* Provide src:dst pair for __FILE__ remapping. */ -+extern void add_cpp_remap_path (const char *); -+ - /* Call these to get pointers to the options, callback, and deps - structures for a given reader. These pointers are good until you - call cpp_finish on that reader. You can either edit the callbacks ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -224,6 +224,64 @@ static const char * const monthnames[] = - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - -+static size_t remap_pairs; -+static char **remap_src; -+static char **remap_dst; -+ -+void -+add_cpp_remap_path (const char *arg) -+{ -+ const char *arg_dst; -+ size_t len; -+ -+ arg_dst = strchr(arg, ':'); -+ if (arg_dst == NULL) -+ { -+ fprintf(stderr, "Invalid argument for -iremap\n"); -+ exit(1); -+ } -+ -+ len = arg_dst - arg; -+ ++arg_dst; -+ -+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); -+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); -+ -+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); -+ memcpy(remap_src[remap_pairs], arg, len); -+ remap_src[remap_pairs][len] = '\0'; -+ remap_dst[remap_pairs] = xstrdup(arg_dst); -+ ++remap_pairs; -+} -+ -+static const char * -+cpp_remap_file (const char *arg, char **tmp_name) -+{ -+ char *result; -+ size_t i, len; -+ -+ for (i = 0; i < remap_pairs; ++i) -+ { -+ len = strlen (remap_src[i]); -+ if (strncmp (remap_src[i], arg, len)) -+ continue; -+ if (arg[len] == '\0') -+ return xstrdup (remap_dst[i]); -+ if (arg[len] != '/') -+ continue; -+ arg += len; -+ len = strlen (remap_dst[i]); -+ result = (char *) xmalloc (len + strlen (arg) + 1); -+ memcpy(result, remap_dst[i], len); -+ strcpy(result + len, arg); -+ *tmp_name = result; -+ -+ return result; -+ } -+ -+ return arg; -+} -+ - /* Helper function for builtin_macro. Returns the text generated by - a builtin macro. */ - const uchar * -@@ -286,6 +344,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - { - unsigned int len; - const char *name; -+ char *tmp_name = NULL; - uchar *buf; - - if (node->value.builtin == BT_FILE) -@@ -297,6 +356,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - if (!name) - abort (); - } -+ name = cpp_remap_file (name, &tmp_name); - len = strlen (name); - buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); - result = buf; -@@ -304,6 +364,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); - *buf++ = '"'; - *buf = '\0'; -+ free (tmp_name); - } - break; - diff --git a/toolchain-old/gcc/patches/5.4.0/960-go_libm.patch b/toolchain-old/gcc/patches/5.4.0/960-go_libm.patch deleted file mode 100644 index d16b0200c..000000000 --- a/toolchain-old/gcc/patches/5.4.0/960-go_libm.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/go/Make-lang.in -+++ b/gcc/go/Make-lang.in -@@ -74,7 +74,7 @@ go_OBJS = $(GO_OBJS) go/gospec.o - - go1$(exeext): $(GO_OBJS) attribs.o $(BACKEND) $(LIBDEPS) - +$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ \ -- $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -+ $(GO_OBJS) attribs.o $(BACKEND) $(LIBS) $(BACKENDLIBS) -lm - - # Documentation. - diff --git a/toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch b/toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch deleted file mode 100644 index 2c5cf9be2..000000000 --- a/toolchain-old/gcc/patches/5.4.0/970-warn_bug.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgo/runtime/mprof.goc -+++ b/libgo/runtime/mprof.goc -@@ -403,7 +403,7 @@ func ThreadCreateProfile(p Slice) (n int - - func Stack(b Slice, all bool) (n int) { - byte *pc, *sp; -- bool enablegc; -+ bool enablegc = false; /* workaround GCC bug #36550 */ - - sp = runtime_getcallersp(&b); - pc = (byte*)(uintptr)runtime_getcallerpc(&b); diff --git a/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch deleted file mode 100644 index bd6fbdb4a..000000000 --- a/toolchain-old/gcc/patches/6.3.0/001-revert_register_mode_search.patch +++ /dev/null @@ -1,65 +0,0 @@ -Revert of: - -commit 275035b56823b26d5fb7e90fad945b998648edf2 -Author: bergner -Date: Thu Sep 5 14:09:07 2013 +0000 - - PR target/58139 - * reginfo.c (choose_hard_reg_mode): Scan through all mode classes - looking for widest mode. - - - git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 - - ---- a/gcc/reginfo.c -+++ b/gcc/reginfo.c -@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - - if (found_mode != VOIDmode) diff --git a/toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch deleted file mode 100644 index b3d2dbe29..000000000 --- a/toolchain-old/gcc/patches/6.3.0/002-case_insensitive.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { - # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ --# if defined(__APPLE__) --# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM --# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 --# endif --# endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain-old/gcc/patches/6.3.0/010-documentation.patch b/toolchain-old/gcc/patches/6.3.0/010-documentation.patch deleted file mode 100644 index 2adb28c83..000000000 --- a/toolchain-old/gcc/patches/6.3.0/010-documentation.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) - doc/gccint.info: $(TEXI_GCCINT_FILES) - doc/cppinternals.info: $(TEXI_CPPINT_FILES) - --doc/%.info: %.texi -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/%.info: - - # Duplicate entry to handle renaming of gccinstall.info --doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/gccinstall.info: - - doc/cpp.dvi: $(TEXI_CPP_FILES) - doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch deleted file mode 100644 index 8dfd1fc28..000000000 --- a/toolchain-old/gcc/patches/6.3.0/230-musl_libssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -858,7 +858,9 @@ proper position among the other output f - #endif - - #ifndef LINK_SSP_SPEC --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if DEFAULT_LIBC == LIBC_MUSL -+#define LINK_SSP_SPEC "-lssp_nonshared" -+#elif defined(TARGET_LIBC_PROVIDES_SSP) - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit:}" - #else diff --git a/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch deleted file mode 100644 index df09e4f63..000000000 --- a/toolchain-old/gcc/patches/6.3.0/280-musl-disable-ifunc-by-default.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 -From: nsz -Date: Tue, 30 Aug 2016 10:26:22 +0000 -Subject: [PATCH] disable ifunc on *-musl by default - -gcc/ - * config.gcc (*-*-*musl*): Disable gnu-indirect-function. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - gcc/ChangeLog | 4 ++++ - gcc/config.gcc | 4 ++-- - 2 files changed, 6 insertions(+), 2 deletions(-) - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes -@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes diff --git a/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch deleted file mode 100644 index d76bd8cb1..000000000 --- a/toolchain-old/gcc/patches/6.3.0/300-mips_Os_cpu_rtx_cost_model.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -17928,7 +17928,7 @@ mips_option_override (void) - flag_pcc_struct_return = 0; - - /* Decide which rtx_costs structure to use. */ -- if (optimize_size) -+ if (0 && optimize_size) - mips_cost = &mips_rtx_cost_optimize_size; - else - mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch deleted file mode 100644 index 2e7c23f85..000000000 --- a/toolchain-old/gcc/patches/6.3.0/800-arm_v5te_no_ldrd_strd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h -@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att - /* Thumb-1 only. */ - #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) - --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ - && !TARGET_THUMB1) - - #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch deleted file mode 100644 index 1d06f5b2e..000000000 --- a/toolchain-old/gcc/patches/6.3.0/810-arm-softfloat-libgcc.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/libgcc/config/arm/t-linux -+++ b/libgcc/config/arm/t-linux -@@ -1,6 +1,10 @@ - LIB1ASMSRC = arm/lib1funcs.S - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 -+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ -+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ -+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ -+ _arm_fixsfsi _arm_fixunssfsi - - # Just for these, we omit the frame pointer since it makes such a big - # difference. ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -60,8 +60,6 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" -- - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch deleted file mode 100644 index f925d96f6..000000000 --- a/toolchain-old/gcc/patches/6.3.0/820-libgcc_pic.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $ - - # Static libraries. - libgcc.a: $(libgcc-objects) -+libgcc_pic.a: $(libgcc-s-objects) - libgcov.a: $(libgcov-objects) - libunwind.a: $(libunwind-objects) - libgcc_eh.a: $(libgcc-eh-objects) - --libgcc.a libgcov.a libunwind.a libgcc_eh.a: -+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: - -rm -f $@ - - objects="$(objects)"; \ -@@ -913,7 +914,7 @@ all: libunwind.a - endif - - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1115,6 +1116,10 @@ install-shared: - chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a - -+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch deleted file mode 100644 index 37f8f2a54..000000000 --- a/toolchain-old/gcc/patches/6.3.0/830-arm_unbreak_armv4t.patch +++ /dev/null @@ -1,13 +0,0 @@ -http://sourceware.org/ml/crossgcc/2008-05/msg00009.html - ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -45,7 +45,7 @@ - The ARM10TDMI core is the default for armv5t, so set - SUBTARGET_CPU_DEFAULT to achieve this. */ - #undef SUBTARGET_CPU_DEFAULT --#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi - - /* TARGET_BIG_ENDIAN_DEFAULT is set in - config.gcc for big endian configurations. */ diff --git a/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch deleted file mode 100644 index cb1fb9823..000000000 --- a/toolchain-old/gcc/patches/6.3.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -94,10 +94,15 @@ - #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" - -+/* For armv4 we pass --fix-v4bx to linker to support EABI */ -+#undef TARGET_FIX_V4BX_SPEC -+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ -+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" -+ - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ - #undef LINK_SPEC --#define LINK_SPEC EABI_LINK_SPEC \ -+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ - LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ - LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) - diff --git a/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch deleted file mode 100644 index cd20244c6..000000000 --- a/toolchain-old/gcc/patches/6.3.0/850-use_shared_libgcc.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -132,10 +132,6 @@ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ - LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) - --/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we -- do not use -lfloat. */ --#undef LIBGCC_SPEC -- - /* Clear the instruction cache from `beg' to `end'. This is - implemented in lib1funcs.S, so ensure an error if this definition - is used. */ ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI - builtin_assert ("system=posix"); \ - } while (0) - -+#ifndef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" -+#endif -+ - /* Determine which dynamic linker to use depending on whether GLIBC or - uClibc or Bionic or musl is the default C library and whether - -muclibc or -mglibc or -mbionic or -mmusl has been passed to change ---- a/libgcc/mkmap-symver.awk -+++ b/libgcc/mkmap-symver.awk -@@ -132,5 +132,5 @@ function output(lib) { - else if (inherit[lib]) - printf("} %s;\n", inherit[lib]); - else -- printf ("\n local:\n\t*;\n};\n"); -+ printf ("\n\t*;\n};\n"); - } ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -60,6 +60,9 @@ - #undef CPP_OS_DEFAULT_SPEC - #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" - -+#undef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" -+ - #undef LINK_SHLIB_SPEC - #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" - diff --git a/toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch deleted file mode 100644 index 80c347684..000000000 --- a/toolchain-old/gcc/patches/6.3.0/851-libgcc_no_compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/libgcc/config/t-libunwind -+++ b/libgcc/config/t-libunwind -@@ -2,8 +2,7 @@ - - HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER - --LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ -- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - - # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch deleted file mode 100644 index 9e543a0fc..000000000 --- a/toolchain-old/gcc/patches/6.3.0/870-ppc_no_crtsavres.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -24171,7 +24171,7 @@ rs6000_savres_strategy (rs6000_stack_t * - /* Define cutoff for using out-of-line functions to save registers. */ - if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) - { -- if (!optimize_size) -+ if (1) - { - strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; - strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch b/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch deleted file mode 100644 index 0fa9e627c..000000000 --- a/toolchain-old/gcc/patches/6.3.0/880-no_java_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -395,7 +395,7 @@ see the files COPYING3 and COPYING.RUNTI - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif diff --git a/toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch deleted file mode 100644 index fab5db3be..000000000 --- a/toolchain-old/gcc/patches/6.3.0/881-no_tm_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ - #endif - - #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) --# define USE_TM_CLONE_REGISTRY 1 -+# define USE_TM_CLONE_REGISTRY 0 - #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch deleted file mode 100644 index dd6e9dc88..000000000 --- a/toolchain-old/gcc/patches/6.3.0/900-bad-mips16-crt.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/libgcc/config/mips/t-mips16 -+++ b/libgcc/config/mips/t-mips16 -@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 - - # Version these symbols if building libgcc.so. - SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver -+ -+CRTSTUFF_T_CFLAGS += -mno-mips16 -+CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch deleted file mode 100644 index b747935f0..000000000 --- a/toolchain-old/gcc/patches/6.3.0/910-mbsd_multi.patch +++ /dev/null @@ -1,222 +0,0 @@ - - This patch brings over a few features from MirBSD: - * -fhonour-copts - If this option is not given, it's warned (depending - on environment variables). This is to catch errors - of misbuilt packages which override CFLAGS themselves. - * -Werror-maybe-reset - Has the effect of -Wno-error if GCC_NO_WERROR is - set and not '0', a no-operation otherwise. This is - to be able to use -Werror in "make" but prevent - GNU autoconf generated configure scripts from - freaking out. - - This patch was authored by Thorsten Glaser - with copyright assignment to the FSF in effect. - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -107,6 +107,9 @@ static int class_dump_flags; - /* Whether any standard preincluded header has been preincluded. */ - static bool done_preinclude; - -+/* Check if a port honours COPTS. */ -+static int honour_copts = 0; -+ - static void handle_OPT_d (const char *); - static void set_std_cxx98 (int); - static void set_std_cxx11 (int); -@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co - flag_no_builtin = !value; - break; - -+ case OPT_fhonour_copts: -+ if (c_language == clk_c) { -+ honour_copts++; -+ } -+ break; -+ - case OPT_fconstant_string_class_: - constant_string_class_name = arg; - break; -@@ -1041,6 +1050,47 @@ c_common_init (void) - return false; - } - -+ if (c_language == clk_c) { -+ char *ev = getenv ("GCC_HONOUR_COPTS"); -+ int evv; -+ if (ev == NULL) -+ evv = -1; -+ else if ((*ev == '0') || (*ev == '\0')) -+ evv = 0; -+ else if (*ev == '1') -+ evv = 1; -+ else if (*ev == '2') -+ evv = 2; -+ else if (*ev == 's') -+ evv = -1; -+ else { -+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); -+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ -+ } -+ if (evv == 1) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in lenient mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ warning (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } else if (evv == 2) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in strict mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ error ("someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ return false; -+ } -+ } else if (evv == 0) { -+ if (honour_copts != 1) -+ inform (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } -+ - return true; - } - ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -438,6 +438,10 @@ Wfloat-conversion - C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion) - Warn for implicit type conversions that cause loss of floating point precision. - -+Werror-maybe-reset -+C ObjC C++ ObjC++ -+; Documented in common.opt -+ - Wfloat-equal - C ObjC C++ ObjC++ Var(warn_float_equal) Warning - Warn if testing floating point numbers for equality. -@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception - fhonor-std - C++ ObjC++ Ignore Warn(switch %qs is no longer supported) - -+fhonour-copts -+C ObjC C++ ObjC++ RejectNegative -+ - fhosted - C ObjC - Assume normal C execution environment. ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -581,6 +581,10 @@ Werror= - Common Joined - Treat specified warning as error. - -+Werror-maybe-reset -+Common -+If environment variable GCC_NO_WERROR is set, act as -Wno-error -+ - Wextra - Common Var(extra_warnings) Warning - Print extra (possibly unwanted) warnings. -@@ -1432,6 +1436,9 @@ fguess-branch-probability - Common Report Var(flag_guess_branch_prob) Optimization - Enable guessing of branch probabilities. - -+fhonour-copts -+Common RejectNegative -+ - ; Nonzero means ignore `#ident' directives. 0 means handle them. - ; Generate position-independent code for executables if possible - ; On SVR4 targets, it also controls whether or not to emit a ---- a/gcc/opts.c -+++ b/gcc/opts.c -@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options - opts, opts_set, loc, dc); - break; - -+ case OPT_Werror_maybe_reset: -+ { -+ char *ev = getenv ("GCC_NO_WERROR"); -+ if ((ev != NULL) && (*ev != '0')) -+ warnings_are_errors = 0; -+ } -+ break; -+ -+ case OPT_fhonour_copts: -+ break; -+ - case OPT_Wlarger_than_: - opts->x_larger_than_size = value; - opts->x_warn_larger_than = value != -1; ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -163,6 +163,11 @@ in older programs. This warning is on b - Make all warnings into hard errors. Source code which triggers warnings - will be rejected. - -+@item -Werror-maybe-reset -+@opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ - @item -Wsystem-headers - @opindex Wsystem-headers - Issue warnings for code in system headers. These are normally unhelpful ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}. - -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol - -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol - -Wempty-body -Wenum-compare -Wno-endif-labels @gol ---Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol -+-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol - -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol - -Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol - -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol -@@ -5737,6 +5737,22 @@ This option is only supported for C and - @option{-Wall} and by @option{-Wpedantic}, which can be disabled with - @option{-Wno-pointer-sign}. - -+@item -Werror-maybe-reset -+@opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ -+@item -fhonour-copts -+@opindex fhonour-copts -+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not -+given at least once, and warn if it is given more than once. -+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not -+given exactly once. -+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option -+is not given exactly once. -+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. -+This flag and environment variable only affect the C language. -+ - @item -Wstack-protector - @opindex Wstack-protector - @opindex Wno-stack-protector -@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei - second branch or a point immediately following it, depending on whether - the condition is known to be true or false. - --Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. -+Enabled at levels @option{-O3}. - - @item -fsplit-wide-types - @opindex fsplit-wide-types ---- a/gcc/java/jvspec.c -+++ b/gcc/java/jvspec.c -@@ -629,6 +629,7 @@ lang_specific_pre_link (void) - class name. Append dummy `.c' that can be stripped by set_input so %b - is correct. */ - set_input (concat (main_class_name, "main.c", NULL)); -+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ - err = do_spec (jvgenmain_spec); - if (err == 0) - { diff --git a/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch deleted file mode 100644 index dc0acb95a..000000000 --- a/toolchain-old/gcc/patches/6.3.0/920-specs_nonfatal_getenv.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch - value = varname; - - if (!value) -- fatal_error (input_location, -- "environment variable %qs not defined", varname); -+ { -+ warning (input_location, "environment variable %qs not defined", varname); -+ value = ""; -+ } - - /* We have to escape every character of the environment variable so - they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch deleted file mode 100644 index 2a99840b6..000000000 --- a/toolchain-old/gcc/patches/6.3.0/930-fix-mips-noexecstack.patch +++ /dev/null @@ -1,111 +0,0 @@ -From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 -From: Andrew McDonnell -Date: Fri, 3 Oct 2014 19:09:00 +0930 -Subject: Add .note.GNU-stack section - -See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html -Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html - -Re: [Patch, MIPS] Add .note.GNU-stack section - - From: Steve Ellcey - -On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: -> -> -> On Wed, Sep 10, 2014 at 9:27 AM, wrote: - -> This works except you did not update the assembly files in -> libgcc or glibc. We (Cavium) have the same patch in our tree -> for a few released versions. - -> Mind just checking yours in then Andrew? - -> Thanks! -> -eric - -I talked to Andrew about what files he changed in GCC and created and -tested this new patch. Andrew also mentioned changing some assembly -files in glibc but I don't see any use of '.section .note.GNU-stack' in -any assembly files in glibc (for any platform) so I wasn't planning on -creating a glibc to add them to mips glibc assembly language files. - -OK to check in this patch? - -Steve Ellcey -sellcey@mips.com - - - -2014-09-26 Steve Ellcey ---- - gcc/config/mips/mips.c | 3 +++ - libgcc/config/mips/crti.S | 4 ++++ - libgcc/config/mips/crtn.S | 3 +++ - libgcc/config/mips/mips16.S | 4 ++++ - libgcc/config/mips/vr4120-div.S | 4 ++++ - 5 files changed, 18 insertions(+) - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t - #undef TARGET_HARD_REGNO_SCRATCH_OK - #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok - -+#undef TARGET_ASM_FILE_END -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - struct gcc_target targetm = TARGET_INITIALIZER; - - #include "gt-mips.h" ---- a/libgcc/config/mips/crti.S -+++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+ -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/crtn.S -+++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/mips16.S -+++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI - values using the soft-float calling convention, but do the actual - operation using the hard floating point instructions. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) - - /* This file contains 32-bit assembly code. */ ---- a/libgcc/config/mips/vr4120-div.S -+++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI - -mfix-vr4120. div and ddiv do not give the correct result when one - of the operands is negative. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - .set nomips16 - - #define DIV \ diff --git a/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch deleted file mode 100644 index 68e62865b..000000000 --- a/toolchain-old/gcc/patches/6.3.0/940-no-clobber-stamp-bits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libstdc++-v3/include/Makefile.in -+++ b/libstdc++-v3/include/Makefile.in -@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers} - @$(STAMP) stamp-bits - - stamp-bits-sup: stamp-bits ${bits_sup_headers} -- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null -+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null - @$(STAMP) stamp-bits-sup - - stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch deleted file mode 100644 index d467eb7c9..000000000 --- a/toolchain-old/gcc/patches/6.3.0/950-cpp_file_path_translation.patch +++ /dev/null @@ -1,182 +0,0 @@ -Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co - add_path (xstrdup (arg), SYSTEM, 0, true); - break; - -+ case OPT_iremap: -+ add_cpp_remap_path (arg); -+ break; -+ - case OPT_iwithprefix: - add_prefixed_path (arg, SYSTEM); - break; ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -1632,6 +1632,10 @@ iquote - C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) - -iquote Add to the end of the quote include path. - -+iremap -+C ObjC C++ ObjC++ Joined Separate -+-iremap Convert to if it occurs as prefix in __FILE__. -+ - iwithprefix - C ObjC C++ ObjC++ Joined Separate - -iwithprefix Add to the end of the system include path. ---- a/gcc/doc/cpp.texi -+++ b/gcc/doc/cpp.texi -@@ -4444,6 +4444,7 @@ without notice. - @c man begin SYNOPSIS - cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] - [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] -+ [@option{-iremap}@var{src}:@var{dst}] - [@option{-W}@var{warn}@dots{}] - [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] - [@option{-MP}] [@option{-MQ} @var{target}@dots{}] ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -532,6 +532,12 @@ Search @var{dir} only for header files r - If @var{dir} begins with @code{=}, then the @code{=} will be replaced - by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -fdirectives-only - @opindex fdirectives-only - When preprocessing, handle directives, but do not expand macros. ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}. - @item Directory Options - @xref{Directory Options,,Options for Directory Search}. - @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol ---iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol ----sysroot=@var{dir} --no-sysroot-suffix} -+-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -no-canonical-prefixes @gol -+-I- --sysroot=@var{dir} --no-sysroot-suffix} - - @item Code Generation Options - @xref{Code Gen Options,,Options for Code Generation Conventions}. -@@ -10861,6 +10861,12 @@ be searched for header files only for th - "@var{file}"}; they are not searched for @code{#include <@var{file}>}, - otherwise just like @option{-I}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -L@var{dir} - @opindex L - Add directory @var{dir} to the list of directories to be searched ---- a/libcpp/include/cpplib.h -+++ b/libcpp/include/cpplib.h -@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *, - /* Set the include paths. */ - extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); - -+/* Provide src:dst pair for __FILE__ remapping. */ -+extern void add_cpp_remap_path (const char *); -+ - /* Call these to get pointers to the options, callback, and deps - structures for a given reader. These pointers are good until you - call cpp_finish on that reader. You can either edit the callbacks ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -227,6 +227,64 @@ static const char * const monthnames[] = - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - -+static size_t remap_pairs; -+static char **remap_src; -+static char **remap_dst; -+ -+void -+add_cpp_remap_path (const char *arg) -+{ -+ const char *arg_dst; -+ size_t len; -+ -+ arg_dst = strchr(arg, ':'); -+ if (arg_dst == NULL) -+ { -+ fprintf(stderr, "Invalid argument for -iremap\n"); -+ exit(1); -+ } -+ -+ len = arg_dst - arg; -+ ++arg_dst; -+ -+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); -+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); -+ -+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); -+ memcpy(remap_src[remap_pairs], arg, len); -+ remap_src[remap_pairs][len] = '\0'; -+ remap_dst[remap_pairs] = xstrdup(arg_dst); -+ ++remap_pairs; -+} -+ -+static const char * -+cpp_remap_file (const char *arg, char **tmp_name) -+{ -+ char *result; -+ size_t i, len; -+ -+ for (i = 0; i < remap_pairs; ++i) -+ { -+ len = strlen (remap_src[i]); -+ if (strncmp (remap_src[i], arg, len)) -+ continue; -+ if (arg[len] == '\0') -+ return xstrdup (remap_dst[i]); -+ if (arg[len] != '/') -+ continue; -+ arg += len; -+ len = strlen (remap_dst[i]); -+ result = (char *) xmalloc (len + strlen (arg) + 1); -+ memcpy(result, remap_dst[i], len); -+ strcpy(result + len, arg); -+ *tmp_name = result; -+ -+ return result; -+ } -+ -+ return arg; -+} -+ - /* Helper function for builtin_macro. Returns the text generated by - a builtin macro. */ - const uchar * -@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - { - unsigned int len; - const char *name; -+ char *tmp_name = NULL; - uchar *buf; - - if (node->value.builtin == BT_FILE) -@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - if (!name) - abort (); - } -+ name = cpp_remap_file (name, &tmp_name); - len = strlen (name); - buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); - result = buf; -@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); - *buf++ = '"'; - *buf = '\0'; -+ free (tmp_name); - } - break; - diff --git a/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch b/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch deleted file mode 100644 index 72d86c149..000000000 --- a/toolchain-old/gcc/patches/6.3.0/960-fix-ubsan-defref.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/ubsan.c -+++ b/gcc/ubsan.c -@@ -1471,7 +1471,7 @@ ubsan_use_new_style_p (location_t loc) - - expanded_location xloc = expand_location (loc); - if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 -- || xloc.file == '\0' || xloc.file[0] == '\xff' -+ || xloc.file[0] == '\0' || xloc.file[0] == '\xff' - || xloc.file[1] == '\xff') - return false; - diff --git a/toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch deleted file mode 100644 index adcc7c3c5..000000000 --- a/toolchain-old/gcc/patches/7.1.0/001-revert_register_mode_search.patch +++ /dev/null @@ -1,65 +0,0 @@ -Revert of: - -commit 275035b56823b26d5fb7e90fad945b998648edf2 -Author: bergner -Date: Thu Sep 5 14:09:07 2013 +0000 - - PR target/58139 - * reginfo.c (choose_hard_reg_mode): Scan through all mode classes - looking for widest mode. - - - git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 - - ---- a/gcc/reginfo.c -+++ b/gcc/reginfo.c -@@ -637,35 +637,40 @@ choose_hard_reg_mode (unsigned int regno - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - - if (found_mode != VOIDmode) diff --git a/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch b/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch deleted file mode 100644 index b3d2dbe29..000000000 --- a/toolchain-old/gcc/patches/7.1.0/002-case_insensitive.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { - # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ --# if defined(__APPLE__) --# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM --# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 --# endif --# endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain-old/gcc/patches/7.1.0/010-documentation.patch b/toolchain-old/gcc/patches/7.1.0/010-documentation.patch deleted file mode 100644 index 46fe81f12..000000000 --- a/toolchain-old/gcc/patches/7.1.0/010-documentation.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -3120,18 +3120,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) - doc/gccint.info: $(TEXI_GCCINT_FILES) - doc/cppinternals.info: $(TEXI_CPPINT_FILES) - --doc/%.info: %.texi -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/%.info: - - # Duplicate entry to handle renaming of gccinstall.info --doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/gccinstall.info: - - doc/cpp.dvi: $(TEXI_CPP_FILES) - doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch b/toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch deleted file mode 100644 index 65b5710d6..000000000 --- a/toolchain-old/gcc/patches/7.1.0/230-musl_libssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -861,7 +861,9 @@ proper position among the other output f - #endif - - #ifndef LINK_SSP_SPEC --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if DEFAULT_LIBC == LIBC_MUSL -+#define LINK_SSP_SPEC "-lssp_nonshared" -+#elif defined(TARGET_LIBC_PROVIDES_SSP) - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit:}" - #else diff --git a/toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch deleted file mode 100644 index 21cff871c..000000000 --- a/toolchain-old/gcc/patches/7.1.0/300-mips_Os_cpu_rtx_cost_model.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -19784,7 +19784,7 @@ mips_option_override (void) - flag_pcc_struct_return = 0; - - /* Decide which rtx_costs structure to use. */ -- if (optimize_size) -+ if (0 && optimize_size) - mips_cost = &mips_rtx_cost_optimize_size; - else - mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch deleted file mode 100644 index 435f5715b..000000000 --- a/toolchain-old/gcc/patches/7.1.0/800-arm_v5te_no_ldrd_strd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h -@@ -150,7 +150,7 @@ extern tree arm_fp16_type_node; - /* Thumb-1 only. */ - #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) - --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ - && !TARGET_THUMB1) - - #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch deleted file mode 100644 index a437d8151..000000000 --- a/toolchain-old/gcc/patches/7.1.0/810-arm-softfloat-libgcc.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/libgcc/config/arm/t-linux -+++ b/libgcc/config/arm/t-linux -@@ -1,6 +1,10 @@ - LIB1ASMSRC = arm/lib1funcs.S - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 -+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ -+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ -+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ -+ _arm_fixsfsi _arm_fixunssfsi - - # Just for these, we omit the frame pointer since it makes such a big - # difference. ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -58,8 +58,6 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" -- - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch b/toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch deleted file mode 100644 index cd539d865..000000000 --- a/toolchain-old/gcc/patches/7.1.0/820-libgcc_pic.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -920,11 +920,12 @@ $(libgcov-driver-objects): %$(objext): $ - - # Static libraries. - libgcc.a: $(libgcc-objects) -+libgcc_pic.a: $(libgcc-s-objects) - libgcov.a: $(libgcov-objects) - libunwind.a: $(libunwind-objects) - libgcc_eh.a: $(libgcc-eh-objects) - --libgcc.a libgcov.a libunwind.a libgcc_eh.a: -+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: - -rm -f $@ - - objects="$(objects)"; \ -@@ -945,7 +946,7 @@ all: libunwind.a - endif - - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1151,6 +1152,10 @@ install-shared: - chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a - -+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch deleted file mode 100644 index 9cae1c9d1..000000000 --- a/toolchain-old/gcc/patches/7.1.0/840-armv4_pass_fix-v4bx_to_ld.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -88,10 +88,15 @@ - #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" - -+/* For armv4 we pass --fix-v4bx to linker to support EABI */ -+#undef TARGET_FIX_V4BX_SPEC -+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ -+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" -+ - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ - #undef LINK_SPEC --#define LINK_SPEC EABI_LINK_SPEC \ -+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ - LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ - LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) - diff --git a/toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch deleted file mode 100644 index 5d09d6e2d..000000000 --- a/toolchain-old/gcc/patches/7.1.0/850-use_shared_libgcc.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -126,10 +126,6 @@ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ - LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) - --/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we -- do not use -lfloat. */ --#undef LIBGCC_SPEC -- - /* Clear the instruction cache from `beg' to `end'. This is - implemented in lib1funcs.S, so ensure an error if this definition - is used. */ ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI - builtin_assert ("system=posix"); \ - } while (0) - -+#ifndef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" -+#endif -+ - /* Determine which dynamic linker to use depending on whether GLIBC or - uClibc or Bionic or musl is the default C library and whether - -muclibc or -mglibc or -mbionic or -mmusl has been passed to change ---- a/libgcc/mkmap-symver.awk -+++ b/libgcc/mkmap-symver.awk -@@ -136,5 +136,5 @@ function output(lib) { - else if (inherit[lib]) - printf("} %s;\n", inherit[lib]); - else -- printf ("\n local:\n\t*;\n};\n"); -+ printf ("\n\t*;\n};\n"); - } ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -60,6 +60,9 @@ - #undef CPP_OS_DEFAULT_SPEC - #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" - -+#undef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" -+ - #undef LINK_SHLIB_SPEC - #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" - diff --git a/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch deleted file mode 100644 index 80c347684..000000000 --- a/toolchain-old/gcc/patches/7.1.0/851-libgcc_no_compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/libgcc/config/t-libunwind -+++ b/libgcc/config/t-libunwind -@@ -2,8 +2,7 @@ - - HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER - --LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ -- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - - # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch deleted file mode 100644 index 332b8b62a..000000000 --- a/toolchain-old/gcc/patches/7.1.0/870-ppc_no_crtsavres.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -26889,7 +26889,7 @@ rs6000_savres_strategy (rs6000_stack_t * - /* Define cutoff for using out-of-line functions to save registers. */ - if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) - { -- if (!optimize_size) -+ if (1) - { - strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; - strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch b/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch deleted file mode 100644 index fab5db3be..000000000 --- a/toolchain-old/gcc/patches/7.1.0/881-no_tm_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ - #endif - - #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) --# define USE_TM_CLONE_REGISTRY 1 -+# define USE_TM_CLONE_REGISTRY 0 - #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch deleted file mode 100644 index dd6e9dc88..000000000 --- a/toolchain-old/gcc/patches/7.1.0/900-bad-mips16-crt.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/libgcc/config/mips/t-mips16 -+++ b/libgcc/config/mips/t-mips16 -@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 - - # Version these symbols if building libgcc.so. - SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver -+ -+CRTSTUFF_T_CFLAGS += -mno-mips16 -+CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch b/toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch deleted file mode 100644 index 5b664ff22..000000000 --- a/toolchain-old/gcc/patches/7.1.0/910-mbsd_multi.patch +++ /dev/null @@ -1,140 +0,0 @@ - - This patch brings over a feature from MirBSD: - * -fhonour-copts - If this option is not given, it's warned (depending - on environment variables). This is to catch errors - of misbuilt packages which override CFLAGS themselves. - - This patch was authored by Thorsten Glaser - with copyright assignment to the FSF in effect. - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -108,6 +108,9 @@ static int class_dump_flags; - /* Whether any standard preincluded header has been preincluded. */ - static bool done_preinclude; - -+/* Check if a port honours COPTS. */ -+static int honour_copts = 0; -+ - static void handle_OPT_d (const char *); - static void set_std_cxx98 (int); - static void set_std_cxx11 (int); -@@ -456,6 +459,12 @@ c_common_handle_option (size_t scode, co - flag_no_builtin = !value; - break; - -+ case OPT_fhonour_copts: -+ if (c_language == clk_c) { -+ honour_copts++; -+ } -+ break; -+ - case OPT_fconstant_string_class_: - constant_string_class_name = arg; - break; -@@ -1084,6 +1093,47 @@ c_common_init (void) - return false; - } - -+ if (c_language == clk_c) { -+ char *ev = getenv ("GCC_HONOUR_COPTS"); -+ int evv; -+ if (ev == NULL) -+ evv = -1; -+ else if ((*ev == '0') || (*ev == '\0')) -+ evv = 0; -+ else if (*ev == '1') -+ evv = 1; -+ else if (*ev == '2') -+ evv = 2; -+ else if (*ev == 's') -+ evv = -1; -+ else { -+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); -+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ -+ } -+ if (evv == 1) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in lenient mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ warning (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } else if (evv == 2) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in strict mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ error ("someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ return false; -+ } -+ } else if (evv == 0) { -+ if (honour_copts != 1) -+ inform (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } -+ - return true; - } - ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -1412,6 +1412,9 @@ C++ ObjC++ Optimization Alias(fexception - fhonor-std - C++ ObjC++ Ignore Warn(switch %qs is no longer supported) - -+fhonour-copts -+C ObjC C++ ObjC++ RejectNegative -+ - fhosted - C ObjC - Assume normal C execution environment. ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -1510,6 +1510,9 @@ fguess-branch-probability - Common Report Var(flag_guess_branch_prob) Optimization - Enable guessing of branch probabilities. - -+fhonour-copts -+Common RejectNegative -+ - ; Nonzero means ignore `#ident' directives. 0 means handle them. - ; Generate position-independent code for executables if possible - ; On SVR4 targets, it also controls whether or not to emit a ---- a/gcc/opts.c -+++ b/gcc/opts.c -@@ -1921,6 +1921,9 @@ common_handle_option (struct gcc_options - opts, opts_set, loc, dc); - break; - -+ case OPT_fhonour_copts: -+ break; -+ - case OPT_Wlarger_than_: - opts->x_larger_than_size = value; - opts->x_warn_larger_than = value != -1; ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -6565,6 +6565,17 @@ This option is only supported for C and - @option{-Wall} and by @option{-Wpedantic}, which can be disabled with - @option{-Wno-pointer-sign}. - -+@item -fhonour-copts -+@opindex fhonour-copts -+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not -+given at least once, and warn if it is given more than once. -+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not -+given exactly once. -+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option -+is not given exactly once. -+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. -+This flag and environment variable only affect the C language. -+ - @item -Wstack-protector - @opindex Wstack-protector - @opindex Wno-stack-protector - diff --git a/toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch deleted file mode 100644 index 56dbe33c3..000000000 --- a/toolchain-old/gcc/patches/7.1.0/920-specs_nonfatal_getenv.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -9277,8 +9277,10 @@ getenv_spec_function (int argc, const ch - value = varname; - - if (!value) -- fatal_error (input_location, -- "environment variable %qs not defined", varname); -+ { -+ warning (input_location, "environment variable %qs not defined", varname); -+ value = ""; -+ } - - /* We have to escape every character of the environment variable so - they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch deleted file mode 100644 index 90d10f11e..000000000 --- a/toolchain-old/gcc/patches/7.1.0/930-fix-mips-noexecstack.patch +++ /dev/null @@ -1,111 +0,0 @@ -From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 -From: Andrew McDonnell -Date: Fri, 3 Oct 2014 19:09:00 +0930 -Subject: Add .note.GNU-stack section - -See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html -Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html - -Re: [Patch, MIPS] Add .note.GNU-stack section - - From: Steve Ellcey - -On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: -> -> -> On Wed, Sep 10, 2014 at 9:27 AM, wrote: - -> This works except you did not update the assembly files in -> libgcc or glibc. We (Cavium) have the same patch in our tree -> for a few released versions. - -> Mind just checking yours in then Andrew? - -> Thanks! -> -eric - -I talked to Andrew about what files he changed in GCC and created and -tested this new patch. Andrew also mentioned changing some assembly -files in glibc but I don't see any use of '.section .note.GNU-stack' in -any assembly files in glibc (for any platform) so I wasn't planning on -creating a glibc to add them to mips glibc assembly language files. - -OK to check in this patch? - -Steve Ellcey -sellcey@mips.com - - - -2014-09-26 Steve Ellcey ---- - gcc/config/mips/mips.c | 3 +++ - libgcc/config/mips/crti.S | 4 ++++ - libgcc/config/mips/crtn.S | 3 +++ - libgcc/config/mips/mips16.S | 4 ++++ - libgcc/config/mips/vr4120-div.S | 4 ++++ - 5 files changed, 18 insertions(+) - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -22561,6 +22561,9 @@ mips_promote_function_mode (const_tree t - #undef TARGET_CUSTOM_FUNCTION_DESCRIPTORS - #define TARGET_CUSTOM_FUNCTION_DESCRIPTORS 2 - -+#undef TARGET_ASM_FILE_END -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - struct gcc_target targetm = TARGET_INITIALIZER; - - #include "gt-mips.h" ---- a/libgcc/config/mips/crti.S -+++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+ -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/crtn.S -+++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/mips16.S -+++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI - values using the soft-float calling convention, but do the actual - operation using the hard floating point instructions. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) - - /* This file contains 32-bit assembly code. */ ---- a/libgcc/config/mips/vr4120-div.S -+++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI - -mfix-vr4120. div and ddiv do not give the correct result when one - of the operands is negative. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - .set nomips16 - - #define DIV \ diff --git a/toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch deleted file mode 100644 index 9e5e59970..000000000 --- a/toolchain-old/gcc/patches/7.1.0/940-no-clobber-stamp-bits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libstdc++-v3/include/Makefile.in -+++ b/libstdc++-v3/include/Makefile.in -@@ -1475,7 +1475,7 @@ stamp-bits: ${bits_headers} - @$(STAMP) stamp-bits - - stamp-bits-sup: stamp-bits ${bits_sup_headers} -- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null -+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null - @$(STAMP) stamp-bits-sup - - stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch deleted file mode 100644 index ac85c1d6a..000000000 --- a/toolchain-old/gcc/patches/7.1.0/950-cpp_file_path_translation.patch +++ /dev/null @@ -1,171 +0,0 @@ -Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -588,6 +588,10 @@ c_common_handle_option (size_t scode, co - add_path (xstrdup (arg), SYSTEM, 0, true); - break; - -+ case OPT_iremap: -+ add_cpp_remap_path (arg); -+ break; -+ - case OPT_iwithprefix: - add_prefixed_path (arg, SYSTEM); - break; ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -1825,6 +1825,10 @@ iquote - C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) - -iquote Add to the end of the quote include path. - -+iremap -+C ObjC C++ ObjC++ Joined Separate -+-iremap Convert to if it occurs as prefix in __FILE__. -+ - iwithprefix - C ObjC C++ ObjC++ Joined Separate - -iwithprefix Add to the end of the system include path. ---- a/gcc/doc/cpp.texi -+++ b/gcc/doc/cpp.texi -@@ -4272,6 +4272,7 @@ Refer to the GCC manual for full documen - @c man begin SYNOPSIS - cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] - [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] -+ [@option{-iremap}@var{src}:@var{dst}] - [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] - [@option{-MP}] [@option{-MQ} @var{target}@dots{}] - [@option{-MT} @var{target}@dots{}] ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -220,6 +220,12 @@ extensions @samp{.i}, @samp{.ii} or @sam - extensions that GCC uses for preprocessed files created by - @option{-save-temps}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -fdirectives-only - @opindex fdirectives-only - When preprocessing, handle directives, but do not expand macros. ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -11861,6 +11861,12 @@ by @option{-fplugin=@var{name}} instead - @option{-fplugin=@var{path}/@var{name}.so}. This option is not meant - to be used by the user, but only passed by the driver. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -L@var{dir} - @opindex L - Add directory @var{dir} to the list of directories to be searched ---- a/libcpp/include/cpplib.h -+++ b/libcpp/include/cpplib.h -@@ -820,6 +820,9 @@ extern void cpp_set_lang (cpp_reader *, - /* Set the include paths. */ - extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); - -+/* Provide src:dst pair for __FILE__ remapping. */ -+extern void add_cpp_remap_path (const char *); -+ - /* Call these to get pointers to the options, callback, and deps - structures for a given reader. These pointers are good until you - call cpp_finish on that reader. You can either edit the callbacks ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -227,6 +227,64 @@ static const char * const monthnames[] = - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - -+static size_t remap_pairs; -+static char **remap_src; -+static char **remap_dst; -+ -+void -+add_cpp_remap_path (const char *arg) -+{ -+ const char *arg_dst; -+ size_t len; -+ -+ arg_dst = strchr(arg, ':'); -+ if (arg_dst == NULL) -+ { -+ fprintf(stderr, "Invalid argument for -iremap\n"); -+ exit(1); -+ } -+ -+ len = arg_dst - arg; -+ ++arg_dst; -+ -+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); -+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); -+ -+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); -+ memcpy(remap_src[remap_pairs], arg, len); -+ remap_src[remap_pairs][len] = '\0'; -+ remap_dst[remap_pairs] = xstrdup(arg_dst); -+ ++remap_pairs; -+} -+ -+static const char * -+cpp_remap_file (const char *arg, char **tmp_name) -+{ -+ char *result; -+ size_t i, len; -+ -+ for (i = 0; i < remap_pairs; ++i) -+ { -+ len = strlen (remap_src[i]); -+ if (strncmp (remap_src[i], arg, len)) -+ continue; -+ if (arg[len] == '\0') -+ return xstrdup (remap_dst[i]); -+ if (arg[len] != '/') -+ continue; -+ arg += len; -+ len = strlen (remap_dst[i]); -+ result = (char *) xmalloc (len + strlen (arg) + 1); -+ memcpy(result, remap_dst[i], len); -+ strcpy(result + len, arg); -+ *tmp_name = result; -+ -+ return result; -+ } -+ -+ return arg; -+} -+ - /* Helper function for builtin_macro. Returns the text generated by - a builtin macro. */ - const uchar * -@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - { - unsigned int len; - const char *name; -+ char *tmp_name = NULL; - uchar *buf; - - if (node->value.builtin == BT_FILE) -@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - if (!name) - abort (); - } -+ name = cpp_remap_file (name, &tmp_name); - len = strlen (name); - buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); - result = buf; -@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); - *buf++ = '"'; - *buf = '\0'; -+ free (tmp_name); - } - break; - diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch b/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch deleted file mode 100644 index bd6fbdb4a..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/001-revert_register_mode_search.patch +++ /dev/null @@ -1,65 +0,0 @@ -Revert of: - -commit 275035b56823b26d5fb7e90fad945b998648edf2 -Author: bergner -Date: Thu Sep 5 14:09:07 2013 +0000 - - PR target/58139 - * reginfo.c (choose_hard_reg_mode): Scan through all mode classes - looking for widest mode. - - - git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202286 138bc75d-0d04-0410-961f-82ee72b054a4 - - ---- a/gcc/reginfo.c -+++ b/gcc/reginfo.c -@@ -625,35 +625,40 @@ choose_hard_reg_mode (unsigned int regno - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - -+ if (found_mode != VOIDmode) -+ return found_mode; -+ - for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT); - mode != VOIDmode; - mode = GET_MODE_WIDER_MODE (mode)) - if ((unsigned) hard_regno_nregs[regno][mode] == nregs - && HARD_REGNO_MODE_OK (regno, mode) -- && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)) -- && GET_MODE_SIZE (mode) > GET_MODE_SIZE (found_mode)) -+ && (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode))) - found_mode = mode; - - if (found_mode != VOIDmode) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch b/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch deleted file mode 100644 index b3d2dbe29..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/002-case_insensitive.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/include/filenames.h -+++ b/include/filenames.h -@@ -43,11 +43,6 @@ extern "C" { - # define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f) - #else /* not DOSish */ --# if defined(__APPLE__) --# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM --# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1 --# endif --# endif /* __APPLE__ */ - # define HAS_DRIVE_SPEC(f) (0) - # define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c) - # define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch b/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch deleted file mode 100644 index 2adb28c83..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/010-documentation.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- a/gcc/Makefile.in -+++ b/gcc/Makefile.in -@@ -3021,18 +3021,10 @@ doc/gcc.info: $(TEXI_GCC_FILES) - doc/gccint.info: $(TEXI_GCCINT_FILES) - doc/cppinternals.info: $(TEXI_CPPINT_FILES) - --doc/%.info: %.texi -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I . -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/%.info: - - # Duplicate entry to handle renaming of gccinstall.info --doc/gccinstall.info: $(TEXI_GCCINSTALL_FILES) -- if [ x$(BUILD_INFO) = xinfo ]; then \ -- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(gcc_docdir) \ -- -I $(gcc_docdir)/include -o $@ $<; \ -- fi -+doc/gccinstall.info: - - doc/cpp.dvi: $(TEXI_CPP_FILES) - doc/gcc.dvi: $(TEXI_GCC_FILES) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch b/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch deleted file mode 100644 index 8dfd1fc28..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/230-musl_libssp.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -858,7 +858,9 @@ proper position among the other output f - #endif - - #ifndef LINK_SSP_SPEC --#ifdef TARGET_LIBC_PROVIDES_SSP -+#if DEFAULT_LIBC == LIBC_MUSL -+#define LINK_SSP_SPEC "-lssp_nonshared" -+#elif defined(TARGET_LIBC_PROVIDES_SSP) - #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \ - "|fstack-protector-strong|fstack-protector-explicit:}" - #else diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch b/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch deleted file mode 100644 index df09e4f63..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/280-musl-disable-ifunc-by-default.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 450fb05e2a7510d37744f044009f8237d902f65c Mon Sep 17 00:00:00 2001 -From: nsz -Date: Tue, 30 Aug 2016 10:26:22 +0000 -Subject: [PATCH] disable ifunc on *-musl by default - -gcc/ - * config.gcc (*-*-*musl*): Disable gnu-indirect-function. - - - -git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239859 138bc75d-0d04-0410-961f-82ee72b054a4 ---- - gcc/ChangeLog | 4 ++++ - gcc/config.gcc | 4 ++-- - 2 files changed, 6 insertions(+), 2 deletions(-) - ---- a/gcc/config.gcc -+++ b/gcc/config.gcc -@@ -1495,7 +1495,7 @@ i[34567]86-*-linux* | i[34567]86-*-kfree - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes -@@ -1564,7 +1564,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu - extra_options="${extra_options} linux-android.opt" - # Assume modern glibc if not targeting Android nor uclibc. - case ${target} in -- *-*-*android*|*-*-*uclibc*) -+ *-*-*android*|*-*-*uclibc*|*-*-*musl*) - ;; - *) - default_gnu_indirect_function=yes diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch b/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch deleted file mode 100644 index d76bd8cb1..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/300-mips_Os_cpu_rtx_cost_model.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -17928,7 +17928,7 @@ mips_option_override (void) - flag_pcc_struct_return = 0; - - /* Decide which rtx_costs structure to use. */ -- if (optimize_size) -+ if (0 && optimize_size) - mips_cost = &mips_rtx_cost_optimize_size; - else - mips_cost = &mips_rtx_cost_data[mips_tune]; diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch b/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch deleted file mode 100644 index 2e7c23f85..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/800-arm_v5te_no_ldrd_strd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/arm/arm.h -+++ b/gcc/config/arm/arm.h -@@ -166,7 +166,7 @@ extern void (*arm_lang_output_object_att - /* Thumb-1 only. */ - #define TARGET_THUMB1_ONLY (TARGET_THUMB1 && !arm_arch_notm) - --#define TARGET_LDRD (arm_arch5e && ARM_DOUBLEWORD_ALIGN \ -+#define TARGET_LDRD (arm_arch6 && ARM_DOUBLEWORD_ALIGN \ - && !TARGET_THUMB1) - - #define TARGET_CRC32 (arm_arch_crc) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch b/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch deleted file mode 100644 index 1d06f5b2e..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/810-arm-softfloat-libgcc.patch +++ /dev/null @@ -1,25 +0,0 @@ ---- a/libgcc/config/arm/t-linux -+++ b/libgcc/config/arm/t-linux -@@ -1,6 +1,10 @@ - LIB1ASMSRC = arm/lib1funcs.S - LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ -- _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 -+ _ctzsi2 _arm_addsubdf3 _arm_addsubsf3 \ -+ _arm_negdf2 _arm_muldivdf3 _arm_cmpdf2 _arm_unorddf2 \ -+ _arm_fixdfsi _arm_fixunsdfsi _arm_truncdfsf2 \ -+ _arm_negsf2 _arm_muldivsf3 _arm_cmpsf2 _arm_unordsf2 \ -+ _arm_fixsfsi _arm_fixunssfsi - - # Just for these, we omit the frame pointer since it makes such a big - # difference. ---- a/gcc/config/arm/linux-elf.h -+++ b/gcc/config/arm/linux-elf.h -@@ -60,8 +60,6 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{mfloat-abi=soft*:-lfloat} -lgcc" -- - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" - - #define LINUX_TARGET_LINK_SPEC "%{h*} \ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch b/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch deleted file mode 100644 index f925d96f6..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/820-libgcc_pic.patch +++ /dev/null @@ -1,36 +0,0 @@ ---- a/libgcc/Makefile.in -+++ b/libgcc/Makefile.in -@@ -888,11 +888,12 @@ $(libgcov-driver-objects): %$(objext): $ - - # Static libraries. - libgcc.a: $(libgcc-objects) -+libgcc_pic.a: $(libgcc-s-objects) - libgcov.a: $(libgcov-objects) - libunwind.a: $(libunwind-objects) - libgcc_eh.a: $(libgcc-eh-objects) - --libgcc.a libgcov.a libunwind.a libgcc_eh.a: -+libgcc.a libgcov.a libunwind.a libgcc_eh.a libgcc_pic.a: - -rm -f $@ - - objects="$(objects)"; \ -@@ -913,7 +914,7 @@ all: libunwind.a - endif - - ifeq ($(enable_shared),yes) --all: libgcc_eh.a libgcc_s$(SHLIB_EXT) -+all: libgcc_eh.a libgcc_pic.a libgcc_s$(SHLIB_EXT) - ifneq ($(LIBUNWIND),) - all: libunwind$(SHLIB_EXT) - libgcc_s$(SHLIB_EXT): libunwind$(SHLIB_EXT) -@@ -1115,6 +1116,10 @@ install-shared: - chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_eh.a - $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_eh.a - -+ $(INSTALL_DATA) libgcc_pic.a $(mapfile) $(DESTDIR)$(inst_libdir)/ -+ chmod 644 $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ $(RANLIB) $(DESTDIR)$(inst_libdir)/libgcc_pic.a -+ - $(subst @multilib_dir@,$(MULTIDIR),$(subst \ - @shlib_base_name@,libgcc_s,$(subst \ - @shlib_slibdir_qual@,$(MULTIOSSUBDIR),$(SHLIB_INSTALL)))) diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch b/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch deleted file mode 100644 index 37f8f2a54..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/830-arm_unbreak_armv4t.patch +++ /dev/null @@ -1,13 +0,0 @@ -http://sourceware.org/ml/crossgcc/2008-05/msg00009.html - ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -45,7 +45,7 @@ - The ARM10TDMI core is the default for armv5t, so set - SUBTARGET_CPU_DEFAULT to achieve this. */ - #undef SUBTARGET_CPU_DEFAULT --#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm10tdmi -+#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm9tdmi - - /* TARGET_BIG_ENDIAN_DEFAULT is set in - config.gcc for big endian configurations. */ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch b/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch deleted file mode 100644 index cb1fb9823..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/840-armv4_pass_fix-v4bx_to_ld.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -94,10 +94,15 @@ - #define MUSL_DYNAMIC_LINKER \ - "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1" - -+/* For armv4 we pass --fix-v4bx to linker to support EABI */ -+#undef TARGET_FIX_V4BX_SPEC -+#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\ -+ "|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}" -+ - /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to - use the GNU/Linux version, not the generic BPABI version. */ - #undef LINK_SPEC --#define LINK_SPEC EABI_LINK_SPEC \ -+#define LINK_SPEC EABI_LINK_SPEC TARGET_FIX_V4BX_SPEC \ - LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \ - LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC) - diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch b/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch deleted file mode 100644 index cd20244c6..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/850-use_shared_libgcc.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/gcc/config/arm/linux-eabi.h -+++ b/gcc/config/arm/linux-eabi.h -@@ -132,10 +132,6 @@ - "%{Ofast|ffast-math|funsafe-math-optimizations:crtfastmath.o%s} " \ - LINUX_OR_ANDROID_LD (GNU_USER_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC) - --/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we -- do not use -lfloat. */ --#undef LIBGCC_SPEC -- - /* Clear the instruction cache from `beg' to `end'. This is - implemented in lib1funcs.S, so ensure an error if this definition - is used. */ ---- a/gcc/config/linux.h -+++ b/gcc/config/linux.h -@@ -53,6 +53,10 @@ see the files COPYING3 and COPYING.RUNTI - builtin_assert ("system=posix"); \ - } while (0) - -+#ifndef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{static|static-libgcc:-lgcc}%{!static:%{!static-libgcc:-lgcc_s}}" -+#endif -+ - /* Determine which dynamic linker to use depending on whether GLIBC or - uClibc or Bionic or musl is the default C library and whether - -muclibc or -mglibc or -mbionic or -mmusl has been passed to change ---- a/libgcc/mkmap-symver.awk -+++ b/libgcc/mkmap-symver.awk -@@ -132,5 +132,5 @@ function output(lib) { - else if (inherit[lib]) - printf("} %s;\n", inherit[lib]); - else -- printf ("\n local:\n\t*;\n};\n"); -+ printf ("\n\t*;\n};\n"); - } ---- a/gcc/config/rs6000/linux.h -+++ b/gcc/config/rs6000/linux.h -@@ -60,6 +60,9 @@ - #undef CPP_OS_DEFAULT_SPEC - #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" - -+#undef LIBGCC_SPEC -+#define LIBGCC_SPEC "%{!static:%{!static-libgcc:-lgcc_s}} -lgcc" -+ - #undef LINK_SHLIB_SPEC - #define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" - diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch b/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch deleted file mode 100644 index 80c347684..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/851-libgcc_no_compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/libgcc/config/t-libunwind -+++ b/libgcc/config/t-libunwind -@@ -2,8 +2,7 @@ - - HOST_LIBGCC2_CFLAGS += -DUSE_GAS_SYMVER - --LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c \ -- $(srcdir)/unwind-compat.c $(srcdir)/unwind-dw2-fde-compat.c -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - LIB2ADDEHSTATIC = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c - - # Override the default value from t-slibgcc-elf-ver and mention -lunwind diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch b/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch deleted file mode 100644 index 9e543a0fc..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/870-ppc_no_crtsavres.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/config/rs6000/rs6000.c -+++ b/gcc/config/rs6000/rs6000.c -@@ -24171,7 +24171,7 @@ rs6000_savres_strategy (rs6000_stack_t * - /* Define cutoff for using out-of-line functions to save registers. */ - if (DEFAULT_ABI == ABI_V4 || TARGET_ELF) - { -- if (!optimize_size) -+ if (1) - { - strategy |= SAVE_INLINE_FPRS | REST_INLINE_FPRS; - strategy |= SAVE_INLINE_GPRS | REST_INLINE_GPRS; diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch b/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch deleted file mode 100644 index 0fa9e627c..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/880-no_java_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gcc/defaults.h -+++ b/gcc/defaults.h -@@ -395,7 +395,7 @@ see the files COPYING3 and COPYING.RUNTI - /* If we have named section and we support weak symbols, then use the - .jcr section for recording java classes which need to be registered - at program start-up time. */ --#if defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK -+#if 0 && defined (TARGET_ASM_NAMED_SECTION) && SUPPORTS_WEAK - #ifndef JCR_SECTION_NAME - #define JCR_SECTION_NAME ".jcr" - #endif diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch b/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch deleted file mode 100644 index fab5db3be..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/881-no_tm_section.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libgcc/crtstuff.c -+++ b/libgcc/crtstuff.c -@@ -152,7 +152,7 @@ call_ ## FUNC (void) \ - #endif - - #if !defined(USE_TM_CLONE_REGISTRY) && defined(OBJECT_FORMAT_ELF) --# define USE_TM_CLONE_REGISTRY 1 -+# define USE_TM_CLONE_REGISTRY 0 - #endif - - /* We do not want to add the weak attribute to the declarations of these diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch b/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch deleted file mode 100644 index dd6e9dc88..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/900-bad-mips16-crt.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/libgcc/config/mips/t-mips16 -+++ b/libgcc/config/mips/t-mips16 -@@ -43,3 +43,6 @@ SYNC_CFLAGS = -mno-mips16 - - # Version these symbols if building libgcc.so. - SHLIB_MAPFILES += $(srcdir)/config/mips/libgcc-mips16.ver -+ -+CRTSTUFF_T_CFLAGS += -mno-mips16 -+CRTSTUFF_T_CFLAGS_S += -mno-mips16 diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch b/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch deleted file mode 100644 index 62203dfcf..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/910-mbsd_multi.patch +++ /dev/null @@ -1,222 +0,0 @@ - - This patch brings over a few features from MirBSD: - * -fhonour-copts - If this option is not given, it's warned (depending - on environment variables). This is to catch errors - of misbuilt packages which override CFLAGS themselves. - * -Werror-maybe-reset - Has the effect of -Wno-error if GCC_NO_WERROR is - set and not '0', a no-operation otherwise. This is - to be able to use -Werror in "make" but prevent - GNU autoconf generated configure scripts from - freaking out. - - This patch was authored by Thorsten Glaser - with copyright assignment to the FSF in effect. - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -107,6 +107,9 @@ static int class_dump_flags; - /* Whether any standard preincluded header has been preincluded. */ - static bool done_preinclude; - -+/* Check if a port honours COPTS. */ -+static int honour_copts = 0; -+ - static void handle_OPT_d (const char *); - static void set_std_cxx98 (int); - static void set_std_cxx11 (int); -@@ -442,6 +445,12 @@ c_common_handle_option (size_t scode, co - flag_no_builtin = !value; - break; - -+ case OPT_fhonour_copts: -+ if (c_language == clk_c) { -+ honour_copts++; -+ } -+ break; -+ - case OPT_fconstant_string_class_: - constant_string_class_name = arg; - break; -@@ -1041,6 +1050,47 @@ c_common_init (void) - return false; - } - -+ if (c_language == clk_c) { -+ char *ev = getenv ("GCC_HONOUR_COPTS"); -+ int evv; -+ if (ev == NULL) -+ evv = -1; -+ else if ((*ev == '0') || (*ev == '\0')) -+ evv = 0; -+ else if (*ev == '1') -+ evv = 1; -+ else if (*ev == '2') -+ evv = 2; -+ else if (*ev == 's') -+ evv = -1; -+ else { -+ warning (0, "unknown GCC_HONOUR_COPTS value, assuming 1"); -+ evv = 1; /* maybe depend this on something like MIRBSD_NATIVE? */ -+ } -+ if (evv == 1) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in lenient mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ warning (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } else if (evv == 2) { -+ if (honour_copts == 0) { -+ error ("someone does not honour COPTS at all in strict mode"); -+ return false; -+ } else if (honour_copts != 1) { -+ error ("someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ return false; -+ } -+ } else if (evv == 0) { -+ if (honour_copts != 1) -+ inform (0, "someone does not honour COPTS correctly, passed %d times", -+ honour_copts); -+ } -+ } -+ - return true; - } - ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -438,6 +438,10 @@ Wfloat-conversion - C ObjC C++ ObjC++ Var(warn_float_conversion) Warning LangEnabledBy(C ObjC C++ ObjC++,Wconversion) - Warn for implicit type conversions that cause loss of floating point precision. - -+Werror-maybe-reset -+C ObjC C++ ObjC++ -+; Documented in common.opt -+ - Wfloat-equal - C ObjC C++ ObjC++ Var(warn_float_equal) Warning - Warn if testing floating point numbers for equality. -@@ -1252,6 +1256,9 @@ C++ ObjC++ Optimization Alias(fexception - fhonor-std - C++ ObjC++ Ignore Warn(switch %qs is no longer supported) - -+fhonour-copts -+C ObjC C++ ObjC++ RejectNegative -+ - fhosted - C ObjC - Assume normal C execution environment. ---- a/gcc/common.opt -+++ b/gcc/common.opt -@@ -581,6 +581,10 @@ Werror= - Common Joined - Treat specified warning as error. - -+Werror-maybe-reset -+Common -+If environment variable GCC_NO_WERROR is set, act as -Wno-error -+ - Wextra - Common Var(extra_warnings) Warning - Print extra (possibly unwanted) warnings. -@@ -1432,6 +1436,9 @@ fguess-branch-probability - Common Report Var(flag_guess_branch_prob) Optimization - Enable guessing of branch probabilities. - -+fhonour-copts -+Common RejectNegative -+ - ; Nonzero means ignore `#ident' directives. 0 means handle them. - ; Generate position-independent code for executables if possible - ; On SVR4 targets, it also controls whether or not to emit a ---- a/gcc/opts.c -+++ b/gcc/opts.c -@@ -1783,6 +1783,17 @@ common_handle_option (struct gcc_options - opts, opts_set, loc, dc); - break; - -+ case OPT_Werror_maybe_reset: -+ { -+ char *ev = getenv ("GCC_NO_WERROR"); -+ if ((ev != NULL) && (*ev != '0')) -+ warnings_are_errors = 0; -+ } -+ break; -+ -+ case OPT_fhonour_copts: -+ break; -+ - case OPT_Wlarger_than_: - opts->x_larger_than_size = value; - opts->x_warn_larger_than = value != -1; ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -163,6 +163,11 @@ in older programs. This warning is on b - Make all warnings into hard errors. Source code which triggers warnings - will be rejected. - -+ at item -Werror-maybe-reset -+ at opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ - @item -Wsystem-headers - @opindex Wsystem-headers - Issue warnings for code in system headers. These are normally unhelpful ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -263,7 +263,7 @@ Objective-C and Objective-C++ Dialects}. - -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol - -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol - -Wempty-body -Wenum-compare -Wno-endif-labels @gol ---Werror -Werror=* -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol -+-Werror -Werror=* -Werror-maybe-reset -Wfatal-errors -Wfloat-equal -Wformat -Wformat=2 @gol - -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol - -Wformat-security -Wformat-signedness -Wformat-y2k -Wframe-address @gol - -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol -@@ -5737,6 +5737,22 @@ This option is only supported for C and - @option{-Wall} and by @option{-Wpedantic}, which can be disabled with - @option{-Wno-pointer-sign}. - -+ at item -Werror-maybe-reset -+ at opindex Werror-maybe-reset -+Act like @samp{-Wno-error} if the @env{GCC_NO_WERROR} environment -+variable is set to anything other than 0 or empty. -+ -+ at item -fhonour-copts -+ at opindex fhonour-copts -+If @env{GCC_HONOUR_COPTS} is set to 1, abort if this option is not -+given at least once, and warn if it is given more than once. -+If @env{GCC_HONOUR_COPTS} is set to 2, abort if this option is not -+given exactly once. -+If @env{GCC_HONOUR_COPTS} is set to 0 or unset, warn if this option -+is not given exactly once. -+The warning is quelled if @env{GCC_HONOUR_COPTS} is set to @samp{s}. -+This flag and environment variable only affect the C language. -+ - @item -Wstack-protector - @opindex Wstack-protector - @opindex Wno-stack-protector -@@ -6605,7 +6621,7 @@ so, the first branch is redirected to ei - second branch or a point immediately following it, depending on whether - the condition is known to be true or false. - --Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}. -+Enabled at levels @option{-O3}. - - @item -fsplit-wide-types - @opindex fsplit-wide-types ---- a/gcc/java/jvspec.c -+++ b/gcc/java/jvspec.c -@@ -629,6 +629,7 @@ lang_specific_pre_link (void) - class name. Append dummy `.c' that can be stripped by set_input so %b - is correct. */ - set_input (concat (main_class_name, "main.c", NULL)); -+ putenv ("GCC_HONOUR_COPTS=s"); /* XXX hack! */ - err = do_spec (jvgenmain_spec); - if (err == 0) - { diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch b/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch deleted file mode 100644 index dc0acb95a..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/920-specs_nonfatal_getenv.patch +++ /dev/null @@ -1,15 +0,0 @@ ---- a/gcc/gcc.c -+++ b/gcc/gcc.c -@@ -9198,8 +9198,10 @@ getenv_spec_function (int argc, const ch - value = varname; - - if (!value) -- fatal_error (input_location, -- "environment variable %qs not defined", varname); -+ { -+ warning (input_location, "environment variable %qs not defined", varname); -+ value = ""; -+ } - - /* We have to escape every character of the environment variable so - they are not interpreted as active spec characters. A diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch b/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch deleted file mode 100644 index 2a99840b6..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/930-fix-mips-noexecstack.patch +++ /dev/null @@ -1,111 +0,0 @@ -From da45b3fde60095756f5f6030f6012c23a3d34429 Mon Sep 17 00:00:00 2001 -From: Andrew McDonnell -Date: Fri, 3 Oct 2014 19:09:00 +0930 -Subject: Add .note.GNU-stack section - -See http://lists.busybox.net/pipermail/uclibc/2014-October/048671.html -Below copied from https://gcc.gnu.org/ml/gcc-patches/2014-09/msg02430.html - -Re: [Patch, MIPS] Add .note.GNU-stack section - - From: Steve Ellcey - -On Wed, 2014-09-10 at 10:15 -0700, Eric Christopher wrote: -> -> -> On Wed, Sep 10, 2014 at 9:27 AM, wrote: - -> This works except you did not update the assembly files in -> libgcc or glibc. We (Cavium) have the same patch in our tree -> for a few released versions. - -> Mind just checking yours in then Andrew? - -> Thanks! -> -eric - -I talked to Andrew about what files he changed in GCC and created and -tested this new patch. Andrew also mentioned changing some assembly -files in glibc but I don't see any use of '.section .note.GNU-stack' in -any assembly files in glibc (for any platform) so I wasn't planning on -creating a glibc to add them to mips glibc assembly language files. - -OK to check in this patch? - -Steve Ellcey -sellcey@mips.com - - - -2014-09-26 Steve Ellcey ---- - gcc/config/mips/mips.c | 3 +++ - libgcc/config/mips/crti.S | 4 ++++ - libgcc/config/mips/crtn.S | 3 +++ - libgcc/config/mips/mips16.S | 4 ++++ - libgcc/config/mips/vr4120-div.S | 4 ++++ - 5 files changed, 18 insertions(+) - ---- a/gcc/config/mips/mips.c -+++ b/gcc/config/mips/mips.c -@@ -20228,6 +20228,9 @@ mips_promote_function_mode (const_tree t - #undef TARGET_HARD_REGNO_SCRATCH_OK - #define TARGET_HARD_REGNO_SCRATCH_OK mips_hard_regno_scratch_ok - -+#undef TARGET_ASM_FILE_END -+#define TARGET_ASM_FILE_END file_end_indicate_exec_stack -+ - struct gcc_target targetm = TARGET_INITIALIZER; - - #include "gt-mips.h" ---- a/libgcc/config/mips/crti.S -+++ b/libgcc/config/mips/crti.S -@@ -21,6 +21,10 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+ -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/crtn.S -+++ b/libgcc/config/mips/crtn.S -@@ -21,6 +21,9 @@ a copy of the GCC Runtime Library Except - see the files COPYING3 and COPYING.RUNTIME respectively. If not, see - . */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ - /* 4 slots for argument spill area. 1 for cpreturn, 1 for stack. - Return spill offset of 40 and 20. Aligned to 16 bytes for n32. */ - ---- a/libgcc/config/mips/mips16.S -+++ b/libgcc/config/mips/mips16.S -@@ -48,6 +48,10 @@ see the files COPYING3 and COPYING.RUNTI - values using the soft-float calling convention, but do the actual - operation using the hard floating point instructions. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - #if defined _MIPS_SIM && (_MIPS_SIM == _ABIO32 || _MIPS_SIM == _ABIO64) - - /* This file contains 32-bit assembly code. */ ---- a/libgcc/config/mips/vr4120-div.S -+++ b/libgcc/config/mips/vr4120-div.S -@@ -26,6 +26,10 @@ see the files COPYING3 and COPYING.RUNTI - -mfix-vr4120. div and ddiv do not give the correct result when one - of the operands is negative. */ - -+/* An executable stack is *not* required for these functions. */ -+ .section .note.GNU-stack,"",%progbits -+ .previous -+ - .set nomips16 - - #define DIV \ diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch b/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch deleted file mode 100644 index 68e62865b..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/940-no-clobber-stamp-bits.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/libstdc++-v3/include/Makefile.in -+++ b/libstdc++-v3/include/Makefile.in -@@ -1459,7 +1459,7 @@ stamp-bits: ${bits_headers} - @$(STAMP) stamp-bits - - stamp-bits-sup: stamp-bits ${bits_sup_headers} -- @-cd ${bits_builddir} && $(LN_S) $? . 2>/dev/null -+ @-cd ${bits_builddir} && $(LN_S) $(filter-out stamp-bits,$?) . 2>/dev/null - @$(STAMP) stamp-bits-sup - - stamp-c_base: ${c_base_headers} diff --git a/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch b/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch deleted file mode 100644 index d467eb7c9..000000000 --- a/toolchain-old/gcc/patches/arc-2017.03-release/950-cpp_file_path_translation.patch +++ /dev/null @@ -1,182 +0,0 @@ -Forward ported from attachment to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47047 - ---- a/gcc/c-family/c-opts.c -+++ b/gcc/c-family/c-opts.c -@@ -574,6 +574,10 @@ c_common_handle_option (size_t scode, co - add_path (xstrdup (arg), SYSTEM, 0, true); - break; - -+ case OPT_iremap: -+ add_cpp_remap_path (arg); -+ break; -+ - case OPT_iwithprefix: - add_prefixed_path (arg, SYSTEM); - break; ---- a/gcc/c-family/c.opt -+++ b/gcc/c-family/c.opt -@@ -1632,6 +1632,10 @@ iquote - C ObjC C++ ObjC++ Joined Separate MissingArgError(missing path after %qs) - -iquote Add to the end of the quote include path. - -+iremap -+C ObjC C++ ObjC++ Joined Separate -+-iremap Convert to if it occurs as prefix in __FILE__. -+ - iwithprefix - C ObjC C++ ObjC++ Joined Separate - -iwithprefix Add to the end of the system include path. ---- a/gcc/doc/cpp.texi -+++ b/gcc/doc/cpp.texi -@@ -4444,6 +4444,7 @@ without notice. - @c man begin SYNOPSIS - cpp [@option{-D}@var{macro}[=@var{defn}]@dots{}] [@option{-U}@var{macro}] - [@option{-I}@var{dir}@dots{}] [@option{-iquote}@var{dir}@dots{}] -+ [@option{-iremap}@var{src}:@var{dst}] - [@option{-W}@var{warn}@dots{}] - [@option{-M}|@option{-MM}] [@option{-MG}] [@option{-MF} @var{filename}] - [@option{-MP}] [@option{-MQ} @var{target}@dots{}] ---- a/gcc/doc/cppopts.texi -+++ b/gcc/doc/cppopts.texi -@@ -532,6 +532,12 @@ Search @var{dir} only for header files r - If @var{dir} begins with @code{=}, then the @code{=} will be replaced - by the sysroot prefix; see @option{--sysroot} and @option{-isysroot}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -fdirectives-only - @opindex fdirectives-only - When preprocessing, handle directives, but do not expand macros. ---- a/gcc/doc/invoke.texi -+++ b/gcc/doc/invoke.texi -@@ -476,8 +476,8 @@ Objective-C and Objective-C++ Dialects}. - @item Directory Options - @xref{Directory Options,,Options for Directory Search}. - @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol ---iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol ----sysroot=@var{dir} --no-sysroot-suffix} -+-iquote@var{dir} -iremap@var{src}:@var{dst} -L@var{dir} -no-canonical-prefixes @gol -+-I- --sysroot=@var{dir} --no-sysroot-suffix} - - @item Code Generation Options - @xref{Code Gen Options,,Options for Code Generation Conventions}. -@@ -10861,6 +10861,12 @@ be searched for header files only for th - "@var{file}"}; they are not searched for @code{#include <@var{file}>}, - otherwise just like @option{-I}. - -+@item -iremap @var{src}:@var{dst} -+@opindex iremap -+Replace the prefix @var{src} in __FILE__ with @var{dst} at expansion time. -+This option can be specified more than once. Processing stops at the first -+match. -+ - @item -L@var{dir} - @opindex L - Add directory @var{dir} to the list of directories to be searched ---- a/libcpp/include/cpplib.h -+++ b/libcpp/include/cpplib.h -@@ -760,6 +760,9 @@ extern void cpp_set_lang (cpp_reader *, - /* Set the include paths. */ - extern void cpp_set_include_chains (cpp_reader *, cpp_dir *, cpp_dir *, int); - -+/* Provide src:dst pair for __FILE__ remapping. */ -+extern void add_cpp_remap_path (const char *); -+ - /* Call these to get pointers to the options, callback, and deps - structures for a given reader. These pointers are good until you - call cpp_finish on that reader. You can either edit the callbacks ---- a/libcpp/macro.c -+++ b/libcpp/macro.c -@@ -227,6 +227,64 @@ static const char * const monthnames[] = - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" - }; - -+static size_t remap_pairs; -+static char **remap_src; -+static char **remap_dst; -+ -+void -+add_cpp_remap_path (const char *arg) -+{ -+ const char *arg_dst; -+ size_t len; -+ -+ arg_dst = strchr(arg, ':'); -+ if (arg_dst == NULL) -+ { -+ fprintf(stderr, "Invalid argument for -iremap\n"); -+ exit(1); -+ } -+ -+ len = arg_dst - arg; -+ ++arg_dst; -+ -+ remap_src = (char **) xrealloc(remap_src, sizeof(char *) * (remap_pairs + 1)); -+ remap_dst = (char **) xrealloc(remap_dst, sizeof(char *) * (remap_pairs + 1)); -+ -+ remap_src[remap_pairs] = (char *) xmalloc(len + 1); -+ memcpy(remap_src[remap_pairs], arg, len); -+ remap_src[remap_pairs][len] = '\0'; -+ remap_dst[remap_pairs] = xstrdup(arg_dst); -+ ++remap_pairs; -+} -+ -+static const char * -+cpp_remap_file (const char *arg, char **tmp_name) -+{ -+ char *result; -+ size_t i, len; -+ -+ for (i = 0; i < remap_pairs; ++i) -+ { -+ len = strlen (remap_src[i]); -+ if (strncmp (remap_src[i], arg, len)) -+ continue; -+ if (arg[len] == '\0') -+ return xstrdup (remap_dst[i]); -+ if (arg[len] != '/') -+ continue; -+ arg += len; -+ len = strlen (remap_dst[i]); -+ result = (char *) xmalloc (len + strlen (arg) + 1); -+ memcpy(result, remap_dst[i], len); -+ strcpy(result + len, arg); -+ *tmp_name = result; -+ -+ return result; -+ } -+ -+ return arg; -+} -+ - /* Helper function for builtin_macro. Returns the text generated by - a builtin macro. */ - const uchar * -@@ -290,6 +348,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - { - unsigned int len; - const char *name; -+ char *tmp_name = NULL; - uchar *buf; - - if (node->value.builtin == BT_FILE) -@@ -301,6 +360,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - if (!name) - abort (); - } -+ name = cpp_remap_file (name, &tmp_name); - len = strlen (name); - buf = _cpp_unaligned_alloc (pfile, len * 2 + 3); - result = buf; -@@ -308,6 +368,7 @@ _cpp_builtin_macro_text (cpp_reader *pfi - buf = cpp_quote_string (buf + 1, (const unsigned char *) name, len); - *buf++ = '"'; - *buf = '\0'; -+ free (tmp_name); - } - break; - diff --git a/toolchain-old/gdb/Makefile b/toolchain-old/gdb/Makefile deleted file mode 100644 index 77e24f460..000000000 --- a/toolchain-old/gdb/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=gdb - -ifeq ($(CONFIG_arc),y) -PKG_VERSION:=arc-2017.03-gdb - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/arc-2017.03-gdb -PKG_HASH:=f47930161e9e99c46ab018dabbf56024739dda29c51f92495eaa0d4d7e3511f6 -GDB_DIR:=binutils-$(PKG_NAME)-$(PKG_VERSION) -PATCH_DIR:=./patches-arc -else -PKG_VERSION:=7.12.1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=4607680b973d3ec92c30ad029f1b7dbde3876869e6b3a117d8a7e90081113186 -GDB_DIR:=$(PKG_NAME)-$(PKG_VERSION) -endif - -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(GDB_DIR) - -HOST_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/toolchain-build.mk - -HOST_CONFIGURE_VARS += \ - gdb_cv_func_sigsetjmp=yes - -HOST_CONFIGURE_ARGS = \ - --prefix=$(TOOLCHAIN_DIR) \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --disable-werror \ - --without-uiout \ - --disable-tui --disable-gdbtk --without-x \ - --without-included-gettext \ - --enable-threads \ - --with-expat \ - --without-python \ - --disable-binutils \ - --disable-ld \ - --disable-gas \ - --disable-sim - -define Host/Install - mkdir -p $(TOOLCHAIN_DIR)/bin - $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb - ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb - strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \ - $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch b/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch deleted file mode 100644 index 8c18c6e2e..000000000 --- a/toolchain-old/gdb/patches-arc/100-no_extern_inline.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/sim/common/sim-arange.c -+++ b/sim/common/sim-arange.c -@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a - build_search_tree (ar); - } - --#endif /* DEFINE_NON_INLINE_P */ -- --#if DEFINE_INLINE_P -- --SIM_ARANGE_INLINE int -+int - sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) - { - ADDR_RANGE_TREE *t = ar->range_tree; -@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad - return 0; - } - --#endif /* DEFINE_INLINE_P */ -+#endif /* DEFINE_NON_INLINE_P */ ---- a/sim/common/sim-arange.h -+++ b/sim/common/sim-arange.h -@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ - - /* Return non-zero if ADDR is in range AR, traversing the entire tree. - If no range is specified, that is defined to mean "everything". */ --SIM_ARANGE_INLINE int -+extern int - sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); - #define ADDR_RANGE_HIT_P(ar, addr) \ - ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) diff --git a/toolchain-old/gdb/patches-arc/110-no_testsuite.patch b/toolchain-old/gdb/patches-arc/110-no_testsuite.patch deleted file mode 100644 index 1b284ea76..000000000 --- a/toolchain-old/gdb/patches-arc/110-no_testsuite.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/gdb/configure -+++ b/gdb/configure -@@ -870,8 +870,7 @@ MAKEINFOFLAGS - YACC - YFLAGS - XMKMF' --ac_subdirs_all='testsuite --gdbtk -+ac_subdirs_all='gdbtk - multi-ice - gdbserver' - -@@ -5610,7 +5610,7 @@ $as_echo "$with_auto_load_safe_path" >&6 - - - --subdirs="$subdirs testsuite" -+subdirs="$subdirs" - - - # Check whether to support alternative target configurations diff --git a/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch b/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch deleted file mode 100644 index c8b41f264..000000000 --- a/toolchain-old/gdb/patches-arc/120-fix-compile-flag-mismatch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gdb/gdbserver/configure -+++ b/gdb/gdbserver/configure -@@ -2468,7 +2468,7 @@ $as_echo "$as_me: error: \`$ac_var' was - ac_cache_corrupted=: ;; - ,);; - *) -- if test "x$ac_old_val" != "x$ac_new_val"; then -+ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` diff --git a/toolchain-old/gdb/patches/100-no_extern_inline.patch b/toolchain-old/gdb/patches/100-no_extern_inline.patch deleted file mode 100644 index 8c18c6e2e..000000000 --- a/toolchain-old/gdb/patches/100-no_extern_inline.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/sim/common/sim-arange.c -+++ b/sim/common/sim-arange.c -@@ -280,11 +280,7 @@ sim_addr_range_delete (ADDR_RANGE *ar, a - build_search_tree (ar); - } - --#endif /* DEFINE_NON_INLINE_P */ -- --#if DEFINE_INLINE_P -- --SIM_ARANGE_INLINE int -+int - sim_addr_range_hit_p (ADDR_RANGE *ar, address_word addr) - { - ADDR_RANGE_TREE *t = ar->range_tree; -@@ -301,4 +297,4 @@ sim_addr_range_hit_p (ADDR_RANGE *ar, ad - return 0; - } - --#endif /* DEFINE_INLINE_P */ -+#endif /* DEFINE_NON_INLINE_P */ ---- a/sim/common/sim-arange.h -+++ b/sim/common/sim-arange.h -@@ -73,7 +73,7 @@ extern void sim_addr_range_delete (ADDR_ - - /* Return non-zero if ADDR is in range AR, traversing the entire tree. - If no range is specified, that is defined to mean "everything". */ --SIM_ARANGE_INLINE int -+extern int - sim_addr_range_hit_p (ADDR_RANGE * /*ar*/, address_word /*addr*/); - #define ADDR_RANGE_HIT_P(ar, addr) \ - ((ar)->range_tree == NULL || sim_addr_range_hit_p ((ar), (addr))) diff --git a/toolchain-old/gdb/patches/110-no_testsuite.patch b/toolchain-old/gdb/patches/110-no_testsuite.patch deleted file mode 100644 index 68d1c9035..000000000 --- a/toolchain-old/gdb/patches/110-no_testsuite.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/gdb/configure -+++ b/gdb/configure -@@ -874,8 +874,7 @@ MAKEINFOFLAGS - YACC - YFLAGS - XMKMF' --ac_subdirs_all='testsuite --gdbtk -+ac_subdirs_all='gdbtk - multi-ice - gdbserver' - -@@ -5617,7 +5616,7 @@ $as_echo "$with_auto_load_safe_path" >&6 - - - --subdirs="$subdirs testsuite" -+subdirs="$subdirs" - - - # Check whether to support alternative target configurations diff --git a/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch b/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch deleted file mode 100644 index 562902c50..000000000 --- a/toolchain-old/gdb/patches/120-fix-compile-flag-mismatch.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/gdb/gdbserver/configure -+++ b/gdb/gdbserver/configure -@@ -2476,7 +2476,7 @@ $as_echo "$as_me: error: \`$ac_var' was - ac_cache_corrupted=: ;; - ,);; - *) -- if test "x$ac_old_val" != "x$ac_new_val"; then -+ if test "`echo x$ac_old_val`" != "`echo x$ac_new_val`"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` diff --git a/toolchain-old/glibc/Makefile b/toolchain-old/glibc/Makefile deleted file mode 100644 index 24526ceec..000000000 --- a/toolchain-old/glibc/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -PATH_PREFIX := . -VARIANT:=final -HOST_BUILD_PARALLEL:=1 - -include ./common.mk - -define Host/Compile - +$(MAKE) -C $(CUR_BUILD_DIR) \ - PARALLELMFLAGS="$(HOST_JOBS)" \ - BUILD_CFLAGS="$(HOST_CFLAGS)" \ - default-rpath="/lib:/usr/lib" \ - all -endef - -define Host/Install - $(call Host/SetToolchainInfo) - $(MAKE) -C $(CUR_BUILD_DIR) \ - BUILD_CFLAGS="$(HOST_CFLAGS)" \ - install_root="$(TOOLCHAIN_DIR)" \ - install - ( cd $(TOOLCHAIN_DIR) ; \ - for d in lib usr/lib ; do \ - for f in libc.so libpthread.so libgcc_s.so ; do \ - if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ - $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ - fi \ - done \ - done \ - ) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/glibc/common.mk b/toolchain-old/glibc/common.mk deleted file mode 100644 index 0ea166e77..000000000 --- a/toolchain-old/glibc/common.mk +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (C) 2006-2016 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=glibc -PKG_VERSION:=2.25 - -PKG_SOURCE_URL:=@GNU/libc -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=067bd9bb3390e79aa45911537d13c3721f1d9d3769931a30c2681bfee66f23a0 - -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_SOURCE_SUBDIR) -CUR_BUILD_DIR:=$(HOST_BUILD_DIR)-$(VARIANT) - -include $(INCLUDE_DIR)/toolchain-build.mk - -HOST_STAMP_PREPARED:=$(HOST_BUILD_DIR)/.prepared -HOST_STAMP_CONFIGURED:=$(CUR_BUILD_DIR)/.configured -HOST_STAMP_BUILT:=$(CUR_BUILD_DIR)/.built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.glibc_$(VARIANT)_installed - -ifeq ($(ARCH),mips64) - ifdef CONFIG_MIPS64_ABI_N64 - TARGET_CFLAGS += -mabi=64 - endif - ifdef CONFIG_MIPS64_ABI_N32 - TARGET_CFLAGS += -mabi=n32 - endif - ifdef CONFIG_MIPS64_ABI_O32 - TARGET_CFLAGS += -mabi=32 - endif -endif - - -# -Os miscompiles w. 2.24 gcc5/gcc6 -# only -O2 tested by upstream changeset -# "Optimize i386 syscall inlining for GCC 5" -GLIBC_CONFIGURE:= \ - BUILD_CC="$(HOSTCC)" \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="-O2 $(filter-out -Os,$(call qstrip,$(TARGET_CFLAGS)))" \ - libc_cv_slibdir="/lib" \ - use_ldconfig=no \ - $(HOST_BUILD_DIR)/$(GLIBC_PATH)configure \ - --prefix= \ - --build=$(GNU_HOST_NAME) \ - --host=$(REAL_GNU_TARGET_NAME) \ - --with-headers=$(TOOLCHAIN_DIR)/include \ - --disable-profile \ - --disable-werror \ - --without-gd \ - --without-cvs \ - --enable-add-ons \ - --$(if $(CONFIG_SOFT_FLOAT),without,with)-fp - -export libc_cv_ssp=no -export libc_cv_ssp_strong=no -export ac_cv_header_cpuid_h=yes -export HOST_CFLAGS := $(HOST_CFLAGS) -idirafter $(CURDIR)/$(PATH_PREFIX)/include - -define Host/SetToolchainInfo - $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.gnu.org/software/libc/,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -define Host/Configure - [ -f $(HOST_BUILD_DIR)/.autoconf ] || { \ - cd $(HOST_BUILD_DIR)/; \ - autoconf --force && \ - touch $(HOST_BUILD_DIR)/.autoconf; \ - } - mkdir -p $(CUR_BUILD_DIR) - ( cd $(CUR_BUILD_DIR); rm -f config.cache; \ - $(GLIBC_CONFIGURE) \ - ); -endef - -define Host/Prepare - $(call Host/Prepare/Default) - ln -snf $(PKG_SOURCE_SUBDIR) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -define Host/Clean - rm -rf $(CUR_BUILD_DIR)* \ - $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef diff --git a/toolchain-old/glibc/headers/Makefile b/toolchain-old/glibc/headers/Makefile deleted file mode 100644 index f1d8a8bc6..000000000 --- a/toolchain-old/glibc/headers/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -PATH_PREFIX:=.. -VARIANT:=headers - -include ../common.mk - -define Host/Compile - -endef - -define Host/Install - $(call Host/SetToolchainInfo) - mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib} - $(MAKE) -C $(CUR_BUILD_DIR) \ - BUILD_CFLAGS="$(HOST_CFLAGS)" \ - install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ - install-bootstrap-headers=yes \ - install-headers - $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ - $(MAKE) -C $(CUR_BUILD_DIR) \ - csu/subdir_lib - ( cd $(CUR_BUILD_DIR); \ - $(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \ - ) - $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ - -o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/glibc/include/libintl.h b/toolchain-old/glibc/include/libintl.h deleted file mode 100644 index 69cb887a2..000000000 --- a/toolchain-old/glibc/include/libintl.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __FAKE_LIBINTL_H -#define __FAKE_LIBINTL_H - -#define _(X) (X) - -#endif diff --git a/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch b/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch deleted file mode 100644 index 6a5e537b7..000000000 --- a/toolchain-old/glibc/patches/100-fix_cross_rpcgen.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/sunrpc/rpc/types.h -+++ b/sunrpc/rpc/types.h -@@ -75,18 +75,23 @@ typedef unsigned long rpcport_t; - #endif - - #ifndef __u_char_defined --typedef __u_char u_char; --typedef __u_short u_short; --typedef __u_int u_int; --typedef __u_long u_long; --typedef __quad_t quad_t; --typedef __u_quad_t u_quad_t; --typedef __fsid_t fsid_t; -+typedef unsigned char u_char; -+typedef unsigned short u_short; -+typedef unsigned int u_int; -+typedef unsigned long u_long; -+#if __WORDSIZE == 64 -+typedef long int quad_t; -+typedef unsigned long int u_quad_t; -+#elif defined __GLIBC_HAVE_LONG_LONG -+typedef long long int quad_t; -+typedef unsigned long long int u_quad_t; -+#endif -+typedef u_quad_t fsid_t; - # define __u_char_defined - #endif --#ifndef __daddr_t_defined --typedef __daddr_t daddr_t; --typedef __caddr_t caddr_t; -+#if !defined(__daddr_t_defined) && defined(linux) -+typedef long int daddr_t; -+typedef char *caddr_t; - # define __daddr_t_defined - #endif - ---- a/sunrpc/rpc_main.c -+++ b/sunrpc/rpc_main.c -@@ -958,9 +958,10 @@ mkfile_output (struct commandline *cmd) - abort (); - temp = rindex (cmd->infile, '.'); - cp = stpcpy (mkfilename, "Makefile."); -- if (temp != NULL) -- *((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0'; -- else -+ if (temp != NULL) { -+ strncpy(cp, cmd->infile, temp - cmd->infile); -+ cp[temp - cmd->infile - 1] = 0; -+ } else - stpcpy (cp, cmd->infile); - - } diff --git a/toolchain-old/glibc/patches/200-add-dl-search-paths.patch b/toolchain-old/glibc/patches/200-add-dl-search-paths.patch deleted file mode 100644 index 8f720cb9f..000000000 --- a/toolchain-old/glibc/patches/200-add-dl-search-paths.patch +++ /dev/null @@ -1,14 +0,0 @@ -add /usr/lib to default search path for the dynamic linker - ---- a/Makeconfig -+++ b/Makeconfig -@@ -571,6 +571,9 @@ else - default-rpath = $(libdir) - endif - -+# Add /usr/lib to default search path for the dynamic linker -+user-defined-trusted-dirs := /usr/lib -+ - ifndef link-extra-libs - link-extra-libs = $(LDLIBS-$(@F)) - link-extra-libs-static = $(link-extra-libs) diff --git a/toolchain-old/info.mk b/toolchain-old/info.mk deleted file mode 100644 index 4f311c550..000000000 --- a/toolchain-old/info.mk +++ /dev/null @@ -1,6 +0,0 @@ -TARGET_CROSS= -GCC_VERSION=unknown -LIBC_TYPE=unknown -LIBC_URL=unknown -LIBC_VERSION=unknown -LIBC_SO_VERSION=unknown diff --git a/toolchain-old/kernel-headers/Makefile b/toolchain-old/kernel-headers/Makefile deleted file mode 100644 index 1bf5598d6..000000000 --- a/toolchain-old/kernel-headers/Makefile +++ /dev/null @@ -1,102 +0,0 @@ -# -# Copyright (C) 2006-2009 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -KERNEL_BUILD_DIR := $(BUILD_DIR_TOOLCHAIN) -BUILD_DIR := $(KERNEL_BUILD_DIR) - -override QUILT:= -override HOST_QUILT:= - -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=linux -PKG_VERSION:=$(LINUX_VERSION) -PKG_SOURCE:=$(LINUX_SOURCE) -PKG_SOURCE_URL:=$(LINUX_SITE) -HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION) -PKG_HASH:=$(LINUX_KERNEL_HASH) -LINUX_DIR := $(HOST_BUILD_DIR) -FILES_DIR := -PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION)) - -include $(INCLUDE_DIR)/toolchain-build.mk -include $(INCLUDE_DIR)/kernel-defaults.mk - -ifeq ($(strip $(BOARD)),uml) - LINUX_KARCH:=$(subst x86_64,x86,$(subst i386,x86,$(ARCH))) -endif - -HOST_EXTRACFLAGS= - -LINUX_HAS_HEADERS_INSTALL:=y - -KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \ - HOSTCFLAGS="$(HOST_CFLAGS) -Wall -Wmissing-prototypes -Wstrict-prototypes" \ - ARCH=$(LINUX_KARCH) \ - CC="$(KERNEL_CC)" \ - CFLAGS="$(TARGET_CFLAGS)" \ - CROSS_COMPILE=$(TARGET_CROSS) \ - KBUILD_HAVE_NLS=no \ - CONFIG_SHELL=$(BASH) - -define Host/Configure/all - mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev - $(KMAKE) \ - INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \ - headers_install -endef - -# XXX: the following is needed to build lzma-loader -ifneq ($(CONFIG_mips)$(CONFIG_mipsel),) - define Host/Configure/lzma - $(CP) \ - $(HOST_BUILD_DIR)/arch/mips/include/asm/asm.h \ - $(HOST_BUILD_DIR)/arch/mips/include/asm/regdef.h \ - $(HOST_BUILD_DIR)/arch/mips/include/asm/asm-eva.h \ - $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/ - endef -endif - -define Host/Configure/post/mips - $(call Host/Configure/lzma) -endef - -define Host/Configure/post/mipsel - $(call Host/Configure/lzma) -endef - -define Host/Prepare - rm -rf $(BUILD_DIR_TOOLCHAIN)/linux-* - $(call Kernel/Prepare/Default) - rm -f $(BUILD_DIR_TOOLCHAIN)/linux - ln -s linux-$(LINUX_VERSION) $(BUILD_DIR_TOOLCHAIN)/linux - $(SED) 's/@expr length/@-expr length/' $(HOST_BUILD_DIR)/Makefile -endef - -define Host/Configure - env - yes '' | $(KMAKE) oldconfig - $(call Host/Configure/all) - $(call Host/Configure/post/$(ARCH)) -endef - -define Host/Compile -endef - -define Host/Install - $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(TOOLCHAIN_DIR)/ -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/linux \ - $(BUILD_DIR_TOOLCHAIN)/linux-dev -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/musl/Makefile b/toolchain-old/musl/Makefile deleted file mode 100644 index 2b9312bcb..000000000 --- a/toolchain-old/musl/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -PATH_PREFIX=. - -include ./common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed - -HOST_BUILD_PARALLEL:=1 - -MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \ - DESTDIR="$(TOOLCHAIN_DIR)/" \ - LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" - -define Host/SetToolchainInfo - $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -define Host/Compile - +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) all -endef - -define Host/Install - $(call Host/SetToolchainInfo) - +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) DESTDIR="$(TOOLCHAIN_DIR)/" install - $(CP) ./include $(TOOLCHAIN_DIR)/ -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/musl/common.mk b/toolchain-old/musl/common.mk deleted file mode 100644 index 0a45828f7..000000000 --- a/toolchain-old/musl/common.mk +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright (C) 2012-2013 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/target.mk - -PKG_NAME:=musl -PKG_VERSION:=1.1.16 -PKG_RELEASE=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=5f7efb87a28a311ad377dd26adf53715dedb096d -PKG_MIRROR_HASH:=da18ef24f270e5cae6bc4c440479da17bec1949ae5a1bc990352ca04f24c4378 -PKG_SOURCE_URL:=git://git.musl-libc.org/musl -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz - -LIBC_SO_VERSION:=$(PKG_VERSION) -PATCH_DIR:=$(PATH_PREFIX)/patches - -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/toolchain-build.mk -include $(INCLUDE_DIR)/hardening.mk - -MUSL_CONFIGURE:= \ - $(TARGET_CONFIGURE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - $(HOST_BUILD_DIR)/configure \ - --prefix=/ \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --disable-gcc-wrapper \ - --enable-debug - -define Host/Prepare - $(call Host/Prepare/Default) - $(if $(strip $(QUILT)), \ - cd $(HOST_BUILD_DIR); \ - if $(QUILT_CMD) next >/dev/null 2>&1; then \ - $(QUILT_CMD) push -a; \ - fi - ) - ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -define Host/Configure - ( cd $(HOST_BUILD_DIR); rm -f config.cache; \ - $(MUSL_CONFIGURE) \ - ); -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ - $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev -endef diff --git a/toolchain-old/musl/include/bits/wordsize.h b/toolchain-old/musl/include/bits/wordsize.h deleted file mode 100644 index 2d4cbe831..000000000 --- a/toolchain-old/musl/include/bits/wordsize.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/toolchain-old/musl/include/features.h b/toolchain-old/musl/include/features.h deleted file mode 100644 index edb8cc72d..000000000 --- a/toolchain-old/musl/include/features.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef _FEATURES_H -#define _FEATURES_H - -#ifdef _ALL_SOURCE -#define _GNU_SOURCE 1 -#endif - -#if !defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) \ - && !defined(_XOPEN_SOURCE) && !defined(_GNU_SOURCE) \ - && !defined(_BSD_SOURCE) && !defined(__STRICT_ANSI__) -#define _BSD_SOURCE 1 -#define _XOPEN_SOURCE 700 -#endif - -#if __STDC_VERSION__ >= 199901L -#define __restrict restrict -#elif !defined(__GNUC__) -#define __restrict -#endif - -#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) -#define __inline inline -#endif - -#if __STDC_VERSION__ >= 201112L -#elif defined(__GNUC__) -#define _Noreturn __attribute__((__noreturn__)) -#else -#define _Noreturn -#endif - -/* Convenience macros to test the versions of glibc and gcc. - Use them like this: - #if __GNUC_PREREQ (2,8) - ... code requiring gcc 2.8 or later ... - #endif - Note - they won't work for gcc1 or glibc1, since the _MINOR macros - were not defined then. */ -#if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -#else -# define __GNUC_PREREQ(maj, min) 0 -#endif - -#include - -#endif diff --git a/toolchain-old/musl/include/sgidefs.h b/toolchain-old/musl/include/sgidefs.h deleted file mode 100644 index 74509fdbd..000000000 --- a/toolchain-old/musl/include/sgidefs.h +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright (C) 1996, 1997, 1998, 2003, 2004 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Ralf Baechle . - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _SGIDEFS_H -#define _SGIDEFS_H 1 - -/* - * A crude hack to stop - */ -#undef __ASM_SGIDEFS_H -#define __ASM_SGIDEFS_H - -/* - * And remove any damage it might have already done - */ -#undef _MIPS_ISA_MIPS1 -#undef _MIPS_ISA_MIPS2 -#undef _MIPS_ISA_MIPS3 -#undef _MIPS_ISA_MIPS4 -#undef _MIPS_ISA_MIPS5 -#undef _MIPS_ISA_MIPS32 -#undef _MIPS_ISA_MIPS64 - -#undef _MIPS_SIM_ABI32 -#undef _MIPS_SIM_NABI32 -#undef _MIPS_SIM_ABI64 - -/* - * Definitions for the ISA level - */ -#define _MIPS_ISA_MIPS1 1 -#define _MIPS_ISA_MIPS2 2 -#define _MIPS_ISA_MIPS3 3 -#define _MIPS_ISA_MIPS4 4 -#define _MIPS_ISA_MIPS5 5 -#define _MIPS_ISA_MIPS32 6 -#define _MIPS_ISA_MIPS64 7 - -/* - * Subprogram calling convention - */ -#ifndef _ABIO32 -# define _ABIO32 1 -#endif -#define _MIPS_SIM_ABI32 _ABIO32 - -#ifndef _ABIN32 -# define _ABIN32 2 -#endif -#define _MIPS_SIM_NABI32 _ABIN32 - -#ifndef _ABI64 -# define _ABI64 3 -#endif -#define _MIPS_SIM_ABI64 _ABI64 - -#endif /* sgidefs.h */ diff --git a/toolchain-old/musl/include/sys/cdefs.h b/toolchain-old/musl/include/sys/cdefs.h deleted file mode 100644 index e9866700d..000000000 --- a/toolchain-old/musl/include/sys/cdefs.h +++ /dev/null @@ -1,378 +0,0 @@ -/* Copyright (C) 1992-2002, 2004, 2005, 2006, 2007, 2009, 2011, 2012 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - . */ - -#ifndef _SYS_CDEFS_H -#define _SYS_CDEFS_H 1 - -/* We are almost always included from features.h. */ -#ifndef _FEATURES_H -# include -#endif - -/* The GNU libc does not support any K&R compilers or the traditional mode - of ISO C compilers anymore. Check for some of the combinations not - anymore supported. */ -#if defined __GNUC__ && !defined __STDC__ -# error "You need a ISO C conforming compiler to use the glibc headers" -#endif - -/* Some user header file might have defined this before. */ -#undef __P -#undef __PMT - -#ifdef __GNUC__ - -/* All functions, except those with callbacks or those that - synchronize memory, are leaf functions. */ -# if __GNUC_PREREQ (4, 6) && !defined _LIBC -# define __LEAF , __leaf__ -# define __LEAF_ATTR __attribute__ ((__leaf__)) -# else -# define __LEAF -# define __LEAF_ATTR -# endif - -/* GCC can always grok prototypes. For C++ programs we add throw() - to help it optimize the function calls. But this works only with - gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions - as non-throwing using a function attribute since programs can use - the -fexceptions options for C code as well. */ -# if !defined __cplusplus && __GNUC_PREREQ (3, 3) -# define __THROW __attribute__ ((__nothrow__ __LEAF)) -# define __THROWNL __attribute__ ((__nothrow__)) -# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct -# else -# if defined __cplusplus && __GNUC_PREREQ (2,8) -# define __THROW throw () -# define __THROWNL throw () -# define __NTH(fct) __LEAF_ATTR fct throw () -# else -# define __THROW -# define __THROWNL -# define __NTH(fct) fct -# endif -# endif - -#else /* Not GCC. */ - -# define __inline /* No inline functions. */ - -# define __THROW -# define __THROWNL -# define __NTH(fct) fct - -#endif /* GCC. */ - -/* These two macros are not used in glibc anymore. They are kept here - only because some other projects expect the macros to be defined. */ -#define __P(args) args -#define __PMT(args) args - -/* For these things, GCC behaves the ANSI way normally, - and the non-ANSI way under -traditional. */ - -#define __CONCAT(x,y) x ## y -#define __STRING(x) #x - -/* This is not a typedef so `const __ptr_t' does the right thing. */ -#define __ptr_t void * -#define __long_double_t long double - - -/* C++ needs to know that types and declarations are C, not C++. */ -#ifdef __cplusplus -# define __BEGIN_DECLS extern "C" { -# define __END_DECLS } -#else -# define __BEGIN_DECLS -# define __END_DECLS -#endif - - -/* The standard library needs the functions from the ISO C90 standard - in the std namespace. At the same time we want to be safe for - future changes and we include the ISO C99 code in the non-standard - namespace __c99. The C++ wrapper header take case of adding the - definitions to the global namespace. */ -#if defined __cplusplus && defined _GLIBCPP_USE_NAMESPACES -# define __BEGIN_NAMESPACE_STD namespace std { -# define __END_NAMESPACE_STD } -# define __USING_NAMESPACE_STD(name) using std::name; -# define __BEGIN_NAMESPACE_C99 namespace __c99 { -# define __END_NAMESPACE_C99 } -# define __USING_NAMESPACE_C99(name) using __c99::name; -#else -/* For compatibility we do not add the declarations into any - namespace. They will end up in the global namespace which is what - old code expects. */ -# define __BEGIN_NAMESPACE_STD -# define __END_NAMESPACE_STD -# define __USING_NAMESPACE_STD(name) -# define __BEGIN_NAMESPACE_C99 -# define __END_NAMESPACE_C99 -# define __USING_NAMESPACE_C99(name) -#endif - - -/* Support for bounded pointers. */ -#ifndef __BOUNDED_POINTERS__ -# define __bounded /* nothing */ -# define __unbounded /* nothing */ -# define __ptrvalue /* nothing */ -#endif - - -/* Fortify support. */ -#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1) -#define __bos0(ptr) __builtin_object_size (ptr, 0) -#define __fortify_function __extern_always_inline __attribute_artificial__ - -#if __GNUC_PREREQ (4,3) -# define __warndecl(name, msg) \ - extern void name (void) __attribute__((__warning__ (msg))) -# define __warnattr(msg) __attribute__((__warning__ (msg))) -# define __errordecl(name, msg) \ - extern void name (void) __attribute__((__error__ (msg))) -#else -# define __warndecl(name, msg) extern void name (void) -# define __warnattr(msg) -# define __errordecl(name, msg) extern void name (void) -#endif - -/* Support for flexible arrays. */ -#if __GNUC_PREREQ (2,97) -/* GCC 2.97 supports C99 flexible array members. */ -# define __flexarr [] -#else -# ifdef __GNUC__ -# define __flexarr [0] -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __flexarr [] -# else -/* Some other non-C99 compiler. Approximate with [1]. */ -# define __flexarr [1] -# endif -# endif -#endif - - -/* __asm__ ("xyz") is used throughout the headers to rename functions - at the assembly language level. This is wrapped by the __REDIRECT - macro, in order to support compilers that can do this some other - way. When compilers don't support asm-names at all, we have to do - preprocessor tricks instead (which don't have exactly the right - semantics, but it's the best we can do). - - Example: - int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */ - -#if defined __GNUC__ && __GNUC__ >= 2 - -# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias)) -# ifdef __cplusplus -# define __REDIRECT_NTH(name, proto, alias) \ - name proto __THROW __asm__ (__ASMNAME (#alias)) -# define __REDIRECT_NTHNL(name, proto, alias) \ - name proto __THROWNL __asm__ (__ASMNAME (#alias)) -# else -# define __REDIRECT_NTH(name, proto, alias) \ - name proto __asm__ (__ASMNAME (#alias)) __THROW -# define __REDIRECT_NTHNL(name, proto, alias) \ - name proto __asm__ (__ASMNAME (#alias)) __THROWNL -# endif -# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname) -# define __ASMNAME2(prefix, cname) __STRING (prefix) cname - -/* -#elif __SOME_OTHER_COMPILER__ - -# define __REDIRECT(name, proto, alias) name proto; \ - _Pragma("let " #name " = " #alias) -*/ -#endif - -/* GCC has various useful declarations that can be made with the - `__attribute__' syntax. All of the ways we use this do fine if - they are omitted for compilers that don't understand it. */ -#if !defined __GNUC__ || __GNUC__ < 2 -# define __attribute__(xyz) /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `malloc' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_malloc__ __attribute__ ((__malloc__)) -#else -# define __attribute_malloc__ /* Ignore */ -#endif - -/* At some point during the gcc 2.96 development the `pure' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (2,96) -# define __attribute_pure__ __attribute__ ((__pure__)) -#else -# define __attribute_pure__ /* Ignore */ -#endif - -/* This declaration tells the compiler that the value is constant. */ -#if __GNUC_PREREQ (2,5) -# define __attribute_const__ __attribute__ ((__const__)) -#else -# define __attribute_const__ /* Ignore */ -#endif - -/* At some point during the gcc 3.1 development the `used' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. */ -#if __GNUC_PREREQ (3,1) -# define __attribute_used__ __attribute__ ((__used__)) -# define __attribute_noinline__ __attribute__ ((__noinline__)) -#else -# define __attribute_used__ __attribute__ ((__unused__)) -# define __attribute_noinline__ /* Ignore */ -#endif - -/* gcc allows marking deprecated functions. */ -#if __GNUC_PREREQ (3,2) -# define __attribute_deprecated__ __attribute__ ((__deprecated__)) -#else -# define __attribute_deprecated__ /* Ignore */ -#endif - -/* At some point during the gcc 2.8 development the `format_arg' attribute - for functions was introduced. We don't want to use it unconditionally - (although this would be possible) since it generates warnings. - If several `format_arg' attributes are given for the same function, in - gcc-3.0 and older, all but the last one are ignored. In newer gccs, - all designated arguments are considered. */ -#if __GNUC_PREREQ (2,8) -# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x))) -#else -# define __attribute_format_arg__(x) /* Ignore */ -#endif - -/* At some point during the gcc 2.97 development the `strfmon' format - attribute for functions was introduced. We don't want to use it - unconditionally (although this would be possible) since it - generates warnings. */ -#if __GNUC_PREREQ (2,97) -# define __attribute_format_strfmon__(a,b) \ - __attribute__ ((__format__ (__strfmon__, a, b))) -#else -# define __attribute_format_strfmon__(a,b) /* Ignore */ -#endif - -/* The nonull function attribute allows to mark pointer parameters which - must not be NULL. */ -#if __GNUC_PREREQ (3,3) -# define __nonnull(params) __attribute__ ((__nonnull__ params)) -#else -# define __nonnull(params) -#endif - -/* If fortification mode, we warn about unused results of certain - function calls which can lead to problems. */ -#if __GNUC_PREREQ (3,4) -# define __attribute_warn_unused_result__ \ - __attribute__ ((__warn_unused_result__)) -# if __USE_FORTIFY_LEVEL > 0 -# define __wur __attribute_warn_unused_result__ -# endif -#else -# define __attribute_warn_unused_result__ /* empty */ -#endif -#ifndef __wur -# define __wur /* Ignore */ -#endif - -/* Forces a function to be always inlined. */ -#if __GNUC_PREREQ (3,2) -# define __always_inline __inline __attribute__ ((__always_inline__)) -#else -# define __always_inline __inline -#endif - -/* Associate error messages with the source location of the call site rather - than with the source location inside the function. */ -#if __GNUC_PREREQ (4,3) -# define __attribute_artificial__ __attribute__ ((__artificial__)) -#else -# define __attribute_artificial__ /* Ignore */ -#endif - -/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 - inline semantics, unless -fgnu89-inline is used. */ -#if !defined __cplusplus || __GNUC_PREREQ (4,3) -# if defined __GNUC_STDC_INLINE__ || defined __cplusplus -# define __extern_inline extern __inline __attribute__ ((__gnu_inline__)) -# define __extern_always_inline \ - extern __always_inline __attribute__ ((__gnu_inline__)) -# else -# define __extern_inline extern __inline -# define __extern_always_inline extern __always_inline -# endif -#endif - -/* GCC 4.3 and above allow passing all anonymous arguments of an - __extern_always_inline function to some other vararg function. */ -#if __GNUC_PREREQ (4,3) -# define __va_arg_pack() __builtin_va_arg_pack () -# define __va_arg_pack_len() __builtin_va_arg_pack_len () -#endif - -/* It is possible to compile containing GCC extensions even if GCC is - run in pedantic mode if the uses are carefully marked using the - `__extension__' keyword. But this is not generally available before - version 2.8. */ -#if !__GNUC_PREREQ (2,8) -# define __extension__ /* Ignore */ -#endif - -/* __restrict is known in EGCS 1.2 and above. */ -#if !__GNUC_PREREQ (2,92) -# define __restrict /* Ignore */ -#endif - -/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is - array_name[restrict] - GCC 3.1 supports this. */ -#if __GNUC_PREREQ (3,1) && !defined __GNUG__ -# define __restrict_arr __restrict -#else -# ifdef __GNUC__ -# define __restrict_arr /* Not supported in old GCC. */ -# else -# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L -# define __restrict_arr restrict -# else -/* Some other non-C99 compiler. */ -# define __restrict_arr /* Not supported. */ -# endif -# endif -#endif - -#if __GNUC__ >= 3 -# define __glibc_unlikely(cond) __builtin_expect((cond), 0) -#else -# define __glibc_unlikely(cond) (cond) -#endif - -#endif /* sys/cdefs.h */ diff --git a/toolchain-old/musl/include/sys/glibc-types.h b/toolchain-old/musl/include/sys/glibc-types.h deleted file mode 100644 index fa0684ced..000000000 --- a/toolchain-old/musl/include/sys/glibc-types.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef __MUSL_GLIBC_TYPES_H -#define __MUSL_GLIBC_TYPES_H - -#include - -/* Convenience types. */ -typedef unsigned char __u_char; -typedef unsigned short int __u_short; -typedef unsigned int __u_int; -typedef unsigned long int __u_long; - -/* Fixed-size types, underlying types depend on word size and compiler. */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef signed short int __int16_t; -typedef unsigned short int __uint16_t; -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#if __WORDSIZE == 64 -typedef signed long int __int64_t; -typedef unsigned long int __uint64_t; -#else -__extension__ typedef signed long long int __int64_t; -__extension__ typedef unsigned long long int __uint64_t; -#endif - -#define __off64_t off_t -#define __loff_t off_t -typedef char *__caddr_t; -#define __locale_t locale_t - -#define __gid_t gid_t -#define __uid_t uid_t - -#endif diff --git a/toolchain-old/musl/include/sys/queue.h b/toolchain-old/musl/include/sys/queue.h deleted file mode 100644 index daf4553d3..000000000 --- a/toolchain-old/musl/include/sys/queue.h +++ /dev/null @@ -1,574 +0,0 @@ -/* - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -/* - * This file defines five types of data structures: singly-linked lists, - * lists, simple queues, tail queues, and circular queues. - * - * A singly-linked list is headed by a single forward pointer. The - * elements are singly linked for minimum space and pointer manipulation - * overhead at the expense of O(n) removal for arbitrary elements. New - * elements can be added to the list after an existing element or at the - * head of the list. Elements being removed from the head of the list - * should use the explicit macro for this purpose for optimum - * efficiency. A singly-linked list may only be traversed in the forward - * direction. Singly-linked lists are ideal for applications with large - * datasets and few or no removals or for implementing a LIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may only be traversed in the forward direction. - * - * A simple queue is headed by a pair of pointers, one the head of the - * list and the other to the tail of the list. The elements are singly - * linked to save space, so elements can only be removed from the - * head of the list. New elements can be added to the list after - * an existing element, at the head of the list, or at the end of the - * list. A simple queue may only be traversed in the forward direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * A circle queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or after - * an existing element, at the head of the list, or at the end of the list. - * A circle queue may be traversed in either direction, but has a more - * complex end of list detection. - * - * For details on the use of these macros, see the queue(3) manual page. - */ - -/* - * List definitions. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ -#define LIST_INIT(head) do { \ - (head)->lh_first = NULL; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \ - (listelm)->field.le_next->field.le_prev = \ - &(elm)->field.le_next; \ - (listelm)->field.le_next = (elm); \ - (elm)->field.le_prev = &(listelm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - (elm)->field.le_next = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &(elm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.le_next = (head)->lh_first) != NULL) \ - (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ - (head)->lh_first = (elm); \ - (elm)->field.le_prev = &(head)->lh_first; \ -} while (/*CONSTCOND*/0) - -#define LIST_REMOVE(elm, field) do { \ - if ((elm)->field.le_next != NULL) \ - (elm)->field.le_next->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = (elm)->field.le_next; \ -} while (/*CONSTCOND*/0) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = ((head)->lh_first); \ - (var); \ - (var) = ((var)->field.le_next)) - -/* - * List access methods. - */ -#define LIST_EMPTY(head) ((head)->lh_first == NULL) -#define LIST_FIRST(head) ((head)->lh_first) -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - - -/* - * Singly-linked List definitions. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_INIT(head) do { \ - (head)->slh_first = NULL; \ -} while (/*CONSTCOND*/0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - (elm)->field.sle_next = (slistelm)->field.sle_next; \ - (slistelm)->field.sle_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.sle_next = (head)->slh_first; \ - (head)->slh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - (head)->slh_first = (head)->slh_first->field.sle_next; \ -} while (/*CONSTCOND*/0) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - if ((head)->slh_first == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = (head)->slh_first; \ - while(curelm->field.sle_next != (elm)) \ - curelm = curelm->field.sle_next; \ - curelm->field.sle_next = \ - curelm->field.sle_next->field.sle_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define SLIST_FOREACH(var, head, field) \ - for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next) - -/* - * Singly-linked List access methods. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) -#define SLIST_FIRST(head) ((head)->slh_first) -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first; /* first element */ \ - struct type **stqh_last; /* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_INIT(head) do { \ - (head)->stqh_first = NULL; \ - (head)->stqh_last = &(head)->stqh_first; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ - (head)->stqh_last = &(elm)->field.stqe_next; \ - (head)->stqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.stqe_next = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &(elm)->field.stqe_next; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ - (head)->stqh_last = &(elm)->field.stqe_next; \ - (listelm)->field.stqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ - (head)->stqh_last = &(head)->stqh_first; \ -} while (/*CONSTCOND*/0) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - if ((head)->stqh_first == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } else { \ - struct type *curelm = (head)->stqh_first; \ - while (curelm->field.stqe_next != (elm)) \ - curelm = curelm->field.stqe_next; \ - if ((curelm->field.stqe_next = \ - curelm->field.stqe_next->field.stqe_next) == NULL) \ - (head)->stqh_last = &(curelm)->field.stqe_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define STAILQ_FOREACH(var, head, field) \ - for ((var) = ((head)->stqh_first); \ - (var); \ - (var) = ((var)->field.stqe_next)) - -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (/*CONSTCOND*/0) - -/* - * Singly-linked Tail queue access methods. - */ -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) -#define STAILQ_FIRST(head) ((head)->stqh_first) -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - - -/* - * Simple queue definitions. - */ -#define SIMPLEQ_HEAD(name, type) \ -struct name { \ - struct type *sqh_first; /* first element */ \ - struct type **sqh_last; /* addr of last next element */ \ -} - -#define SIMPLEQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).sqh_first } - -#define SIMPLEQ_ENTRY(type) \ -struct { \ - struct type *sqe_next; /* next element */ \ -} - -/* - * Simple queue functions. - */ -#define SIMPLEQ_INIT(head) do { \ - (head)->sqh_first = NULL; \ - (head)->sqh_last = &(head)->sqh_first; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ - (head)->sqh_last = &(elm)->field.sqe_next; \ - (head)->sqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.sqe_next = NULL; \ - *(head)->sqh_last = (elm); \ - (head)->sqh_last = &(elm)->field.sqe_next; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ - (head)->sqh_last = &(elm)->field.sqe_next; \ - (listelm)->field.sqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ - if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ - (head)->sqh_last = &(head)->sqh_first; \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ - if ((head)->sqh_first == (elm)) { \ - SIMPLEQ_REMOVE_HEAD((head), field); \ - } else { \ - struct type *curelm = (head)->sqh_first; \ - while (curelm->field.sqe_next != (elm)) \ - curelm = curelm->field.sqe_next; \ - if ((curelm->field.sqe_next = \ - curelm->field.sqe_next->field.sqe_next) == NULL) \ - (head)->sqh_last = &(curelm)->field.sqe_next; \ - } \ -} while (/*CONSTCOND*/0) - -#define SIMPLEQ_FOREACH(var, head, field) \ - for ((var) = ((head)->sqh_first); \ - (var); \ - (var) = ((var)->field.sqe_next)) - -/* - * Simple queue access methods. - */ -#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == NULL) -#define SIMPLEQ_FIRST(head) ((head)->sqh_first) -#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) - - -/* - * Tail queue definitions. - */ -#define _TAILQ_HEAD(name, type, qual) \ -struct name { \ - qual type *tqh_first; /* first element */ \ - qual type *qual *tqh_last; /* addr of last next element */ \ -} -#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first } - -#define _TAILQ_ENTRY(type, qual) \ -struct { \ - qual type *tqe_next; /* next element */ \ - qual type *qual *tqe_prev; /* address of previous next element */\ -} -#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) - -/* - * Tail queue functions. - */ -#define TAILQ_INIT(head) do { \ - (head)->tqh_first = NULL; \ - (head)->tqh_last = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \ - (head)->tqh_first->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (head)->tqh_first = (elm); \ - (elm)->field.tqe_prev = &(head)->tqh_first; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.tqe_next = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &(elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\ - (elm)->field.tqe_next->field.tqe_prev = \ - &(elm)->field.tqe_next; \ - else \ - (head)->tqh_last = &(elm)->field.tqe_next; \ - (listelm)->field.tqe_next = (elm); \ - (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - (elm)->field.tqe_next = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_REMOVE(head, elm, field) do { \ - if (((elm)->field.tqe_next) != NULL) \ - (elm)->field.tqe_next->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ -} while (/*CONSTCOND*/0) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = ((head)->tqh_first); \ - (var); \ - (var) = ((var)->field.tqe_next)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last)); \ - (var); \ - (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) - -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - } \ -} while (/*CONSTCOND*/0) - -/* - * Tail queue access methods. - */ -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) -#define TAILQ_FIRST(head) ((head)->tqh_first) -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - - -/* - * Circular queue definitions. - */ -#define CIRCLEQ_HEAD(name, type) \ -struct name { \ - struct type *cqh_first; /* first element */ \ - struct type *cqh_last; /* last element */ \ -} - -#define CIRCLEQ_HEAD_INITIALIZER(head) \ - { (void *)&head, (void *)&head } - -#define CIRCLEQ_ENTRY(type) \ -struct { \ - struct type *cqe_next; /* next element */ \ - struct type *cqe_prev; /* previous element */ \ -} - -/* - * Circular queue functions. - */ -#define CIRCLEQ_INIT(head) do { \ - (head)->cqh_first = (void *)(head); \ - (head)->cqh_last = (void *)(head); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ - (elm)->field.cqe_next = (listelm)->field.cqe_next; \ - (elm)->field.cqe_prev = (listelm); \ - if ((listelm)->field.cqe_next == (void *)(head)) \ - (head)->cqh_last = (elm); \ - else \ - (listelm)->field.cqe_next->field.cqe_prev = (elm); \ - (listelm)->field.cqe_next = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ - (elm)->field.cqe_next = (listelm); \ - (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ - if ((listelm)->field.cqe_prev == (void *)(head)) \ - (head)->cqh_first = (elm); \ - else \ - (listelm)->field.cqe_prev->field.cqe_next = (elm); \ - (listelm)->field.cqe_prev = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ - (elm)->field.cqe_next = (head)->cqh_first; \ - (elm)->field.cqe_prev = (void *)(head); \ - if ((head)->cqh_last == (void *)(head)) \ - (head)->cqh_last = (elm); \ - else \ - (head)->cqh_first->field.cqe_prev = (elm); \ - (head)->cqh_first = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ - (elm)->field.cqe_next = (void *)(head); \ - (elm)->field.cqe_prev = (head)->cqh_last; \ - if ((head)->cqh_first == (void *)(head)) \ - (head)->cqh_first = (elm); \ - else \ - (head)->cqh_last->field.cqe_next = (elm); \ - (head)->cqh_last = (elm); \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_REMOVE(head, elm, field) do { \ - if ((elm)->field.cqe_next == (void *)(head)) \ - (head)->cqh_last = (elm)->field.cqe_prev; \ - else \ - (elm)->field.cqe_next->field.cqe_prev = \ - (elm)->field.cqe_prev; \ - if ((elm)->field.cqe_prev == (void *)(head)) \ - (head)->cqh_first = (elm)->field.cqe_next; \ - else \ - (elm)->field.cqe_prev->field.cqe_next = \ - (elm)->field.cqe_next; \ -} while (/*CONSTCOND*/0) - -#define CIRCLEQ_FOREACH(var, head, field) \ - for ((var) = ((head)->cqh_first); \ - (var) != (const void *)(head); \ - (var) = ((var)->field.cqe_next)) - -#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ - for ((var) = ((head)->cqh_last); \ - (var) != (const void *)(head); \ - (var) = ((var)->field.cqe_prev)) - -/* - * Circular queue access methods. - */ -#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head)) -#define CIRCLEQ_FIRST(head) ((head)->cqh_first) -#define CIRCLEQ_LAST(head) ((head)->cqh_last) -#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) -#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) - -#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ - (((elm)->field.cqe_next == (void *)(head)) \ - ? ((head)->cqh_first) \ - : (elm->field.cqe_next)) -#define CIRCLEQ_LOOP_PREV(head, elm, field) \ - (((elm)->field.cqe_prev == (void *)(head)) \ - ? ((head)->cqh_last) \ - : (elm->field.cqe_prev)) - -#endif /* sys/queue.h */ diff --git a/toolchain-old/musl/patches/100-add_glob_onlydir.patch b/toolchain-old/musl/patches/100-add_glob_onlydir.patch deleted file mode 100644 index db0bc22af..000000000 --- a/toolchain-old/musl/patches/100-add_glob_onlydir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/glob.h -+++ b/include/glob.h -@@ -31,6 +31,8 @@ void globfree(glob_t *); - #define GLOB_NOESCAPE 0x40 - #define GLOB_PERIOD 0x80 - -+#define GLOB_ONLYDIR 0x100 -+ - #define GLOB_NOSPACE 1 - #define GLOB_ABORTED 2 - #define GLOB_NOMATCH 3 diff --git a/toolchain-old/musl/patches/110-read_timezone_from_fs.patch b/toolchain-old/musl/patches/110-read_timezone_from_fs.patch deleted file mode 100644 index b4349e736..000000000 --- a/toolchain-old/musl/patches/110-read_timezone_from_fs.patch +++ /dev/null @@ -1,28 +0,0 @@ ---- a/src/time/__tz.c -+++ b/src/time/__tz.c -@@ -23,6 +23,9 @@ static int r0[5], r1[5]; - static const unsigned char *zi, *trans, *index, *types, *abbrevs, *abbrevs_end; - static size_t map_size; - -+static const char *tzfile; -+static size_t tzfile_size; -+ - static char old_tz_buf[32]; - static char *old_tz = old_tz_buf; - static size_t old_tz_size = sizeof old_tz_buf; -@@ -125,6 +128,15 @@ static void do_tzset() - "/usr/share/zoneinfo/\0/share/zoneinfo/\0/etc/zoneinfo/\0"; - - s = getenv("TZ"); -+ -+ /* if TZ is empty try to read it from /etc/TZ */ -+ if (!s || !*s) { -+ if (tzfile) -+ __munmap((void*)tzfile, tzfile_size); -+ -+ s = tzfile = (void *)__map_file("/etc/TZ", &tzfile_size); -+ } -+ - if (!s) s = "/etc/localtime"; - if (!*s) s = __gmt; - diff --git a/toolchain-old/musl/patches/200-add_libssp_nonshared.patch b/toolchain-old/musl/patches/200-add_libssp_nonshared.patch deleted file mode 100644 index 218ca4140..000000000 --- a/toolchain-old/musl/patches/200-add_libssp_nonshared.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 7ec87fbbc3cac99b4173d082dd6195f47c9a32e7 Mon Sep 17 00:00:00 2001 -From: Steven Barth -Date: Mon, 22 Jun 2015 11:01:56 +0200 -Subject: [PATCH] Add libssp_nonshared.a so GCC's is not needed - -Signed-off-by: Steven Barth ---- - Makefile | 10 ++++++++-- - libssp_nonshared/__stack_chk_fail_local.c | 2 ++ - 2 files changed, 10 insertions(+), 2 deletions(-) - create mode 100644 libssp_nonshared/__stack_chk_fail_local.c - ---- a/Makefile -+++ b/Makefile -@@ -66,7 +66,7 @@ CRT_LIBS = $(addprefix lib/,$(notdir $(C - STATIC_LIBS = lib/libc.a - SHARED_LIBS = lib/libc.so - TOOL_LIBS = lib/musl-gcc.specs --ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) -+ALL_LIBS = $(CRT_LIBS) $(STATIC_LIBS) $(SHARED_LIBS) $(EMPTY_LIBS) $(TOOL_LIBS) lib/libssp_nonshared.a - ALL_TOOLS = obj/musl-gcc - - WRAPCC_GCC = gcc -@@ -129,7 +129,8 @@ NOSSP_SRCS = $(wildcard crt/*.c) \ - src/thread/__set_thread_area.c src/thread/$(ARCH)/__set_thread_area.c \ - src/string/memset.c src/string/$(ARCH)/memset.c \ - src/string/memcpy.c src/string/$(ARCH)/memcpy.c \ -- ldso/dlstart.c ldso/dynlink.c -+ ldso/dlstart.c ldso/dynlink.c \ -+ src/libssp_nonshared/__stack_chk_fail_local.c - $(NOSSP_SRCS:%.c=obj/%.o) $(NOSSP_SRCS:%.c=obj/%.lo): CFLAGS_ALL += $(CFLAGS_NOSSP) - - $(CRT_OBJS): CFLAGS_ALL += -DCRT -@@ -172,6 +173,11 @@ lib/libc.a: $(AOBJS) - $(AR) rc $@ $(AOBJS) - $(RANLIB) $@ - -+lib/libssp_nonshared.a: obj/src/libssp_nonshared/__stack_chk_fail_local.o -+ rm -f $@ -+ $(AR) rc $@ $< -+ $(RANLIB) $@ -+ - $(EMPTY_LIBS): - rm -f $@ - $(AR) rc $@ ---- /dev/null -+++ b/src/libssp_nonshared/__stack_chk_fail_local.c -@@ -0,0 +1,2 @@ -+#include "atomic.h" -+void __attribute__((visibility ("hidden"))) __stack_chk_fail_local(void) { a_crash(); } diff --git a/toolchain-old/musl/patches/300-relative.patch b/toolchain-old/musl/patches/300-relative.patch deleted file mode 100644 index 6e30e0a88..000000000 --- a/toolchain-old/musl/patches/300-relative.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -221,7 +221,7 @@ $(DESTDIR)$(includedir)/%: $(srcdir)/inc - $(INSTALL) -D -m 644 $< $@ - - $(DESTDIR)$(LDSO_PATHNAME): $(DESTDIR)$(libdir)/libc.so -- $(INSTALL) -D -l $(libdir)/libc.so $@ || true -+ $(INSTALL) -D -l libc.so $@ || true - - install-libs: $(ALL_LIBS:lib/%=$(DESTDIR)$(libdir)/%) $(if $(SHARED_LIBS),$(DESTDIR)$(LDSO_PATHNAME),) - diff --git a/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch b/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch deleted file mode 100644 index c495d67e0..000000000 --- a/toolchain-old/musl/patches/400-Add-format-attribute-to-some-function-declarations.patch +++ /dev/null @@ -1,197 +0,0 @@ -From e6683d001a95d7c3d4d992496f00f77e01fcd268 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 22 Nov 2015 15:04:23 +0100 -Subject: [PATCH v2] Add format attribute to some function declarations - -GCC and Clang are able to check the format arguments given to a -function and warn the user if there is a error in the format arguments -or if there is a potential uncontrolled format string security problem -in the code. GCC does this automatically for some functions like -printf(), but it is also possible to annotate other functions in a way -that it will check them too. This feature is used by glibc for many -functions. This patch adds the attribute to the some functions of musl -expect for these functions where gcc automatically adds it. - -GCC automatically adds checks for these functions: printf, fprintf, -sprintf, scanf, fscanf, sscanf, strftime, vprintf, vfprintf and -vsprintf. - -The documentation from gcc is here: -https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html - -The documentation from Clang is here: -http://clang.llvm.org/docs/AttributeReference.html#format-gnu-format - -Signed-off-by: Hauke Mehrtens ---- - include/err.h | 26 +++++++++++++++++--------- - include/monetary.h | 12 ++++++++++-- - include/stdio.h | 29 ++++++++++++++++++++--------- - include/syslog.h | 12 ++++++++++-- - 4 files changed, 57 insertions(+), 22 deletions(-) - ---- a/include/err.h -+++ b/include/err.h -@@ -8,15 +8,23 @@ - extern "C" { - #endif - --void warn(const char *, ...); --void vwarn(const char *, va_list); --void warnx(const char *, ...); --void vwarnx(const char *, va_list); -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#else -+#define __fp(x, y) -+#endif - --_Noreturn void err(int, const char *, ...); --_Noreturn void verr(int, const char *, va_list); --_Noreturn void errx(int, const char *, ...); --_Noreturn void verrx(int, const char *, va_list); -+void warn(const char *, ...) __fp(1, 2); -+void vwarn(const char *, va_list) __fp(1, 0); -+void warnx(const char *, ...) __fp(1, 2); -+void vwarnx(const char *, va_list) __fp(1, 0); -+ -+_Noreturn void err(int, const char *, ...) __fp(2, 3); -+_Noreturn void verr(int, const char *, va_list) __fp(2, 0); -+_Noreturn void errx(int, const char *, ...) __fp(2, 3); -+_Noreturn void verrx(int, const char *, va_list) __fp(2, 0); -+ -+#undef __fp - - #ifdef __cplusplus - } ---- a/include/monetary.h -+++ b/include/monetary.h -@@ -13,8 +13,16 @@ extern "C" { - - #include - --ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...); --ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...); -+#if __GNUC__ >= 3 -+#define __fsfm(x, y) __attribute__ ((__format__ (__strfmon__, x, y))) -+#else -+#define __fsfm(x, y) -+#endif -+ -+ssize_t strfmon(char *__restrict, size_t, const char *__restrict, ...) __fsfm(3, 4); -+ssize_t strfmon_l(char *__restrict, size_t, locale_t, const char *__restrict, ...) __fsfm(4, 5); -+ -+#undef __fsfm - - #ifdef __cplusplus - } ---- a/include/stdio.h -+++ b/include/stdio.h -@@ -21,6 +21,14 @@ extern "C" { - - #include - -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#define __fs(x, y) __attribute__ ((__format__ (__scanf__, x, y))) -+#else -+#define __fp(x, y) -+#define __fs(x, y) -+#endif -+ - #ifdef __cplusplus - #define NULL 0L - #else -@@ -102,19 +110,19 @@ int puts(const char *); - int printf(const char *__restrict, ...); - int fprintf(FILE *__restrict, const char *__restrict, ...); - int sprintf(char *__restrict, const char *__restrict, ...); --int snprintf(char *__restrict, size_t, const char *__restrict, ...); -+int snprintf(char *__restrict, size_t, const char *__restrict, ...) __fp(3, 4); - - int vprintf(const char *__restrict, __isoc_va_list); - int vfprintf(FILE *__restrict, const char *__restrict, __isoc_va_list); - int vsprintf(char *__restrict, const char *__restrict, __isoc_va_list); --int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list); -+int vsnprintf(char *__restrict, size_t, const char *__restrict, __isoc_va_list) __fp(3, 0); - - int scanf(const char *__restrict, ...); - int fscanf(FILE *__restrict, const char *__restrict, ...); - int sscanf(const char *__restrict, const char *__restrict, ...); --int vscanf(const char *__restrict, __isoc_va_list); --int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list); --int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list); -+int vscanf(const char *__restrict, __isoc_va_list) __fs(1, 0); -+int vfscanf(FILE *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); -+int vsscanf(const char *__restrict, const char *__restrict, __isoc_va_list) __fs(2, 0); - - void perror(const char *); - -@@ -135,8 +143,8 @@ int pclose(FILE *); - int fileno(FILE *); - int fseeko(FILE *, off_t, int); - off_t ftello(FILE *); --int dprintf(int, const char *__restrict, ...); --int vdprintf(int, const char *__restrict, __isoc_va_list); -+int dprintf(int, const char *__restrict, ...) __fp(2, 3); -+int vdprintf(int, const char *__restrict, __isoc_va_list) __fp(2, 0); - void flockfile(FILE *); - int ftrylockfile(FILE *); - void funlockfile(FILE *); -@@ -175,8 +183,8 @@ int fileno_unlocked(FILE *); - int getw(FILE *); - int putw(int, FILE *); - char *fgetln(FILE *, size_t *); --int asprintf(char **, const char *, ...); --int vasprintf(char **, const char *, __isoc_va_list); -+int asprintf(char **, const char *, ...) __fp(2, 3); -+int vasprintf(char **, const char *, __isoc_va_list) __fp(2, 0); - #endif - - #ifdef _GNU_SOURCE -@@ -184,6 +192,9 @@ char *fgets_unlocked(char *, int, FILE * - int fputs_unlocked(const char *, FILE *); - #endif - -+#undef __fp -+#undef __fs -+ - #if defined(_LARGEFILE64_SOURCE) || defined(_GNU_SOURCE) - #define tmpfile64 tmpfile - #define fopen64 fopen ---- a/include/syslog.h -+++ b/include/syslog.h -@@ -56,16 +56,22 @@ extern "C" { - #define LOG_NOWAIT 0x10 - #define LOG_PERROR 0x20 - -+#if __GNUC__ >= 3 -+#define __fp(x, y) __attribute__ ((__format__ (__printf__, x, y))) -+#else -+#define __fp(x, y) -+#endif -+ - void closelog (void); - void openlog (const char *, int, int); - int setlogmask (int); --void syslog (int, const char *, ...); -+void syslog (int, const char *, ...) __fp(2, 3); - - #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) - #define _PATH_LOG "/dev/log" - #define __NEED_va_list - #include --void vsyslog (int, const char *, va_list); -+void vsyslog (int, const char *, va_list) __fp(2, 0); - #if defined(SYSLOG_NAMES) - #define INTERNAL_NOPRI 0x10 - #define INTERNAL_MARK (LOG_NFACILITIES<<3) -@@ -93,6 +99,8 @@ typedef struct { - #endif - #endif - -+#undef __fp -+ - #ifdef __cplusplus - } - #endif diff --git a/toolchain-old/musl/patches/900-iconv_size_hack.patch b/toolchain-old/musl/patches/900-iconv_size_hack.patch deleted file mode 100644 index 343915fb0..000000000 --- a/toolchain-old/musl/patches/900-iconv_size_hack.patch +++ /dev/null @@ -1,68 +0,0 @@ ---- a/src/locale/iconv.c -+++ b/src/locale/iconv.c -@@ -39,6 +39,7 @@ static const unsigned char charmaps[] = - "ucs4\0ucs4be\0utf32\0utf32be\0\0\300" - "ucs4le\0utf32le\0\0\303" - "ascii\0usascii\0iso646\0iso646us\0\0\307" -+#ifdef FULL_ICONV - "eucjp\0\0\320" - "shiftjis\0sjis\0\0\321" - "gb18030\0\0\330" -@@ -46,6 +47,7 @@ static const unsigned char charmaps[] = - "gb2312\0\0\332" - "big5\0bigfive\0cp950\0big5hkscs\0\0\340" - "euckr\0ksc5601\0ksx1001\0cp949\0\0\350" -+#endif - #include "codepages.h" - ; - -@@ -53,6 +55,7 @@ static const unsigned short legacy_chars - #include "legacychars.h" - }; - -+#ifdef FULL_ICONV - static const unsigned short jis0208[84][94] = { - #include "jis0208.h" - }; -@@ -72,6 +75,7 @@ static const unsigned short hkscs[] = { - static const unsigned short ksc[93][94] = { - #include "ksc.h" - }; -+#endif - - static int fuzzycmp(const unsigned char *a, const unsigned char *b) - { -@@ -216,6 +220,7 @@ size_t iconv(iconv_t cd0, char **restric - c = ((c-0xd7c0)<<10) + (d-0xdc00); - } - break; -+#ifdef FULL_ICONV - case SHIFT_JIS: - if (c-0xa1 <= 0xdf-0xa1) { - c += 0xff61-0xa1; -@@ -362,6 +367,7 @@ size_t iconv(iconv_t cd0, char **restric - c = ksc[c][d]; - if (!c) goto ilseq; - break; -+#endif - default: - if (c < 128+type) break; - c -= 128+type; ---- a/src/locale/codepages.h -+++ b/src/locale/codepages.h -@@ -118,6 +118,7 @@ - "\0\0\0\100\15\0\344\0\0\0\0\0\0\0\0\0\0\0\0\0\103\270\1\0\0\0\340\1\200\40" - "\230\0\0\0\0\0\44\341\12\0" - -+#ifdef FULL_ICONV - "cp1250\0" - "windows1250\0" - "\0\0" -@@ -214,6 +215,7 @@ - "\0\0\0\0\0\0\0\0\0\15\0\0\0\0\0\0\0\0\0\0\266\0\0\0\0\102\0\220\13\0" - "\0\234\2\0\0\0\0\0\0\0\0\244\202\13\0\0\0\0\100\15\0\0\0\0\0\0\0\0\0\0" - "\267\0\0\0\0\103\0\240\13\0\0\240\2\0\0\0\0\0\0\0\0\250\62\45\0" -+#endif - - "koi8r\0" - "\0\0" diff --git a/toolchain-old/musl/patches/901-crypt_size_hack.patch b/toolchain-old/musl/patches/901-crypt_size_hack.patch deleted file mode 100644 index 8cd7b1989..000000000 --- a/toolchain-old/musl/patches/901-crypt_size_hack.patch +++ /dev/null @@ -1,60 +0,0 @@ ---- a/src/crypt/crypt_r.c -+++ b/src/crypt/crypt_r.c -@@ -19,12 +19,6 @@ char *__crypt_r(const char *key, const c - if (salt[0] == '$' && salt[1] && salt[2]) { - if (salt[1] == '1' && salt[2] == '$') - return __crypt_md5(key, salt, output); -- if (salt[1] == '2' && salt[3] == '$') -- return __crypt_blowfish(key, salt, output); -- if (salt[1] == '5' && salt[2] == '$') -- return __crypt_sha256(key, salt, output); -- if (salt[1] == '6' && salt[2] == '$') -- return __crypt_sha512(key, salt, output); - } - return __crypt_des(key, salt, output); - } ---- a/src/crypt/crypt_sha512.c -+++ b/src/crypt/crypt_sha512.c -@@ -12,6 +12,7 @@ - #include - #include - #include -+#if 0 - - /* public domain sha512 implementation based on fips180-3 */ - /* >=2^64 bits messages are not supported (about 2000 peta bytes) */ -@@ -369,3 +370,4 @@ char *__crypt_sha512(const char *key, co - return "*"; - return p; - } -+#endif ---- a/src/crypt/crypt_blowfish.c -+++ b/src/crypt/crypt_blowfish.c -@@ -50,6 +50,7 @@ - #include - #include - -+#if 0 - typedef uint32_t BF_word; - typedef int32_t BF_word_signed; - -@@ -796,3 +797,4 @@ char *__crypt_blowfish(const char *key, - - return "*"; - } -+#endif ---- a/src/crypt/crypt_sha256.c -+++ b/src/crypt/crypt_sha256.c -@@ -13,6 +13,7 @@ - #include - #include - -+#if 0 - /* public domain sha256 implementation based on fips180-3 */ - - struct sha256 { -@@ -320,3 +321,4 @@ char *__crypt_sha256(const char *key, co - return "*"; - return p; - } -+#endif diff --git a/toolchain-old/uClibc/Config.in b/toolchain-old/uClibc/Config.in deleted file mode 100644 index 3bcb0037e..000000000 --- a/toolchain-old/uClibc/Config.in +++ /dev/null @@ -1,6 +0,0 @@ -# Debug version. - -config UCLIBC_ENABLE_DEBUG - bool "Build with debug information" - depends on TOOLCHAINOPTS && USE_UCLIBC && !EXTERNAL_TOOLCHAIN - default n diff --git a/toolchain-old/uClibc/Makefile b/toolchain-old/uClibc/Makefile deleted file mode 100644 index 4764f2fa1..000000000 --- a/toolchain-old/uClibc/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -PATH_PREFIX=. - -include ./common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed - -HOST_BUILD_PARALLEL:=1 - -define Host/SetToolchainInfo - $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk - $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk -endef - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= all -endef - -define Host/Install - $(call Host/SetToolchainInfo) - $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev - $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/ - ( cd $(TOOLCHAIN_DIR) ; \ - for d in lib usr/lib ; do \ - for f in libc.so libgcc_s.so ; do \ - if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \ - $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \ - fi \ - done \ - done \ - ) -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/uClibc/common.mk b/toolchain-old/uClibc/common.mk deleted file mode 100644 index 384d73233..000000000 --- a/toolchain-old/uClibc/common.mk +++ /dev/null @@ -1,97 +0,0 @@ -# -# Copyright (C) 2006-2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/target.mk - -PKG_VERSION:=1.0.22 - -PKG_NAME:=uClibc-ng -PKG_SOURCE_URL = http://downloads.uclibc-ng.org/releases/$(PKG_VERSION)/ -PATCH_DIR:=$(PATH_PREFIX)/patches -CONFIG_DIR:=$(PATH_PREFIX)/config -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -LIBC_SO_VERSION:=$(PKG_VERSION) - -PKG_HASH:=f2004c85db8e07e9f1c2e8b7c513fa7c237bc9f9685d8e1bfc89535b8a85449b - -HOST_BUILD_DIR:=$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)-$(PKG_VERSION) - -include $(INCLUDE_DIR)/toolchain-build.mk - -UCLIBC_TARGET_ARCH:=$(shell echo $(ARCH) | sed -e s'/-.*//' \ - -e 's/arc.*/arc/' \ - -e 's/i.86/i386/' \ - -e 's/sparc.*/sparc/' \ - -e 's/arm.*/arm/g' \ - -e 's/m68k.*/m68k/' \ - -e 's/ppc/powerpc/g' \ - -e 's/v850.*/v850/g' \ - -e 's/sh64/sh/' \ - -e 's/sh[234].*/sh/' \ - -e 's/mips.*/mips/' \ - -e 's/mipsel.*/mips/' \ -) - -GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \ - $(if $(wildcard $(CONFIG_DIR)/common),'+' $(CONFIG_DIR)/common) \ - $(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \ - $(CONFIG_DIR)/$(ARCH)$(strip \ - $(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \ - $(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \ - $(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \ - $(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))) - -CPU_CFLAGS = \ - -funsigned-char -fno-builtin -fno-asm \ - --std=gnu99 -ffunction-sections -fdata-sections \ - -Wno-unused-but-set-variable \ - $(TARGET_CFLAGS) -ggdb - -UCLIBC_MAKE = PATH='$(TOOLCHAIN_DIR)/initial/bin:$(TARGET_PATH)' $(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) \ - $(TARGET_CONFIGURE_OPTS) \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX=/ \ - HOSTCC="$(HOSTCC)" \ - CPU_CFLAGS="$(CPU_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - LIBGCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))" \ - DOSTRIP="" - -define Host/Prepare - $(call Host/Prepare/Default) - $(if $(strip $(QUILT)), \ - cd $(HOST_BUILD_DIR); \ - if $(QUILT_CMD) next >/dev/null 2>&1; then \ - $(QUILT_CMD) push -a; \ - fi - ) - ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -define Host/Configure - $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config.new - $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \ - -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ - -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ - -e 's,^.*UCLIBC_HAS_LOCALE.*,UCLIBC_HAS_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_BUILD_ALL_LOCALE.*,UCLIBC_BUILD_ALL_LOCALE=$(if $(CONFIG_BUILD_NLS),y,n),g' \ - -e 's,^.*UCLIBC_HAS_SSP[^_].*,UCLIBC_HAS_SSP=$(if $(or $(CONFIG_PKG_CC_STACKPROTECTOR_REGULAR),$(CONFIG_PKG_CC_STACKPROTECTOR_STRONG)),y,n),g' \ - $(HOST_BUILD_DIR)/.config.new - cmp -s $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last || { \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config && \ - $(MAKE) -C $(HOST_BUILD_DIR) olddefconfig KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" && \ - cp $(HOST_BUILD_DIR)/.config.new $(HOST_BUILD_DIR)/.config.last; \ - } -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ - $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev -endef diff --git a/toolchain-old/uClibc/config/arc b/toolchain-old/uClibc/config/arc deleted file mode 100644 index de1ffc441..000000000 --- a/toolchain-old/uClibc/config/arc +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -CONFIG_ARC_CPU_700=y -# CONFIG_ARC_CPU_HS is not set -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain-old/uClibc/config/archs b/toolchain-old/uClibc/config/archs deleted file mode 100644 index 961628ed8..000000000 --- a/toolchain-old/uClibc/config/archs +++ /dev/null @@ -1,10 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -TARGET_ARCH="arc" -TARGET_arc=y -# CONFIG_ARC_CPU_700 is not set -CONFIG_ARC_CPU_HS=y -CONFIG_ARC_PAGE_SIZE_8K=y -# CONFIG_ARC_PAGE_SIZE_16K is not set -# CONFIG_ARC_PAGE_SIZE_4K is not set diff --git a/toolchain-old/uClibc/config/arm b/toolchain-old/uClibc/config/arm deleted file mode 100644 index 41a60b1c3..000000000 --- a/toolchain-old/uClibc/config/arm +++ /dev/null @@ -1,9 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# COMPILE_IN_THUMB_MODE is not set -TARGET_ARCH="arm" -TARGET_arm=y -# USE_BX is not set -CONFIG_ARM_EABI=y - diff --git a/toolchain-old/uClibc/config/armeb b/toolchain-old/uClibc/config/armeb deleted file mode 100644 index 2e46dd67d..000000000 --- a/toolchain-old/uClibc/config/armeb +++ /dev/null @@ -1,9 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_WANTS_BIG_ENDIAN=y -# COMPILE_IN_THUMB_MODE is not set -TARGET_ARCH="arm" -TARGET_arm=y -# USE_BX is not set -CONFIG_ARM_EABI=y - diff --git a/toolchain-old/uClibc/config/common b/toolchain-old/uClibc/config/common deleted file mode 100644 index b679c0a1e..000000000 --- a/toolchain-old/uClibc/config/common +++ /dev/null @@ -1,226 +0,0 @@ -# ARCH_ANY_ENDIAN is not set -ARCH_HAS_MMU=y -# ARCH_HAS_NO_LDSO is not set -# ARCH_HAS_NO_SHARED is not set -# ARCH_LITTLE_ENDIAN is not set -ARCH_USE_MMU=y -# ARCH_WANTS_BIG_ENDIAN is not set -# ARCH_WANTS_LITTLE_ENDIAN is not set -ASSUME_DEVPTS=y -# COMPAT_ATEXIT is not set -CROSS_COMPILER_PREFIX="" -DEVEL_PREFIX="/usr/" -# DOASSERTS is not set -# DODEBUG is not set -# DODEBUG_PT is not set -# DOMULTI is not set -DOPIC=y -DOSTRIP=y -DO_C99_MATH=y -# DO_XSI_MATH is not set -# EXTRA_WARNINGS is not set -FORCE_OPTIONS_FOR_ARCH=y -# FORCE_SHAREABLE_TEXT_SEGMENTS is not set -# HARDWIRED_ABSPATH is not set -# HAS_NO_THREADS is not set -HAVE_DOT_CONFIG=y -# HAVE_NO_PIC is not set -# HAVE_NO_SSP is not set -HAVE_SHARED=y -KERNEL_HEADERS="." -LDSO_BASE_FILENAME="ld.so" -LDSO_CACHE_SUPPORT=y -# LDSO_GNU_HASH_SUPPORT is not set -LDSO_LD_LIBRARY_PATH=y -LDSO_LDD_SUPPORT=y -# LDSO_NO_CLEANUP is not set -# LDSO_PRELINK_SUPPORT is not set -# LDSO_PRELOAD_FILE_SUPPORT is not set -LDSO_PRELOAD_ENV_SUPPORT=y -LDSO_RUNPATH=y -LDSO_SAFE_RUNPATH=y -# LDSO_RUNPATH_OF_EXECUTABLE is not set -# LDSO_SEARCH_INTERP_PATH is not set -# LDSO_STANDALONE_SUPPORT is not set -# LINUXTHREADS_NEW is not set -# LINUXTHREADS_OLD is not set -# UCLIBC_HAS_BACKTRACE is not set -UCLIBC_HAS_THREADS_NATIVE=y -# MALLOC is not set -MALLOC_GLIBC_COMPAT=y -# MALLOC_SIMPLE is not set -MALLOC_STANDARD=y -MULTILIB_DIR="lib" -PTHREADS_DEBUG_SUPPORT=y -RUNTIME_PREFIX="/" -# SUPPORT_LD_DEBUG is not set -# SUPPORT_LD_DEBUG_EARLY is not set -TARGET_SUBARCH="" -# TARGET_alpha is not set -# TARGET_arc is not set -# TARGET_arm is not set -# TARGET_avr32 is not set -# TARGET_bfin is not set -# TARGET_c6x is not set -# TARGET_cris is not set -# TARGET_e1 is not set -# TARGET_frv is not set -# TARGET_h8300 is not set -# TARGET_hppa is not set -# TARGET_i386 is not set -# TARGET_i960 is not set -# TARGET_ia64 is not set -# TARGET_lm32 is not set -# TARGET_m68k is not set -# TARGET_metag is not set -# TARGET_microblaze is not set -# TARGET_mips is not set -# TARGET_nios is not set -# TARGET_nios2 is not set -# TARGET_or1k is not set -# TARGET_powerpc is not set -# TARGET_sh is not set -# TARGET_sh64 is not set -# TARGET_sparc is not set -# TARGET_v850 is not set -# TARGET_vax is not set -# TARGET_x86_64 is not set -# TARGET_xtensa is not set -UCLIBC_BSD_SPECIFIC=y -UCLIBC_BUILD_NOEXECSTACK=y -# UCLIBC_BUILD_NOW is not set -# UCLIBC_BUILD_PIE is not set -UCLIBC_BUILD_RELRO=y -UCLIBC_CTOR_DTOR=y -UCLIBC_DYNAMIC_ATEXIT=y -UCLIBC_EXTRA_CFLAGS="" -UCLIBC_GRP_BUFFER_SIZE=256 -UCLIBC_HAS_ADVANCED_REALTIME=y -# UCLIBC_HAS_ARC4RANDOM is not set -# UCLIBC_HAS_ARGP is not set -UCLIBC_HAS_BSD_ERR=y -UCLIBC_HAS_BSD_RES_CLOSE=y -# UCLIBC_HAS_COMPAT_RES_STATE is not set -UCLIBC_HAS_CRYPT=y -UCLIBC_HAS_CRYPT_IMPL=y -UCLIBC_HAS_CTYPE_CHECKED=y -# UCLIBC_HAS_CTYPE_ENFORCED is not set -UCLIBC_HAS_CTYPE_SIGNED=y -UCLIBC_HAS_CTYPE_TABLES=y -# UCLIBC_HAS_CTYPE_UNSAFE is not set -UCLIBC_HAS_EPOLL=y -UCLIBC_HAS_ERRNO_MESSAGES=y -# UCLIBC_HAS_EXTRA_COMPAT_RES_STATE is not set -# UCLIBC_HAS_FENV is not set -UCLIBC_HAS_FLOATS=y -UCLIBC_HAS_FNMATCH=y -UCLIBC_HAS_FNMATCH_OLD=y -# UCLIBC_HAS_FOPEN_CLOSEEXEC_MODE is not set -UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE=y -# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set -# UCLIBC_HAS_FPU is not set -UCLIBC_HAS_FTS=y -UCLIBC_HAS_FTW=y -# UCLIBC_HAS_FULL_RPC is not set -UCLIBC_HAS_GETPT=y -UCLIBC_HAS_GLIBC_CUSTOM_PRINTF=y -UCLIBC_HAS_GLIBC_CUSTOM_STREAMS=y -# UCLIBC_HAS_GLIBC_DIGIT_GROUPING is not set -UCLIBC_HAS_GLOB=y -UCLIBC_HAS_GNU_ERROR=y -UCLIBC_HAS_GNU_GETOPT=y -UCLIBC_HAS_GNU_GETSUBOPT=y -UCLIBC_HAS_GNU_GLOB=y -UCLIBC_HAS_HEXADECIMAL_FLOATS=y -UCLIBC_HAS_IPV4=y -UCLIBC_HAS_IPV6=y -UCLIBC_HAS_LFS=y -UCLIBC_HAS_LIBNSL_STUB=y -UCLIBC_HAS_LIBRESOLV_STUB=y -UCLIBC_HAS_LIBUTIL=y -# UCLIBC_HAS_LOCALE is not set -# UCLIBC_BUILD_ALL_LOCALE is not set -# UCLIBC_BUILD_MINIMAL_LOCALE is not set -# UCLIBC_PREGENERATED_LOCALE_DATA is not set -UCLIBC_HAS_LONG_DOUBLE_MATH=y -UCLIBC_HAS_NETWORK_SUPPORT=y -UCLIBC_HAS_NFTW=y -UCLIBC_HAS_OBSOLETE_BSD_SIGNAL=y -# UCLIBC_HAS_OBSOLETE_SYSV_SIGNAL is not set -UCLIBC_HAS_PRINTF_M_SPEC=y -# UCLIBC_HAS_PROFILING is not set -UCLIBC_HAS_PROGRAM_INVOCATION_NAME=y -UCLIBC_HAS_PTY=y -UCLIBC_HAS_REALTIME=y -# UCLIBC_HAS_REENTRANT_RPC is not set -UCLIBC_HAS_REGEX=y -UCLIBC_HAS_REGEX_OLD=y -UCLIBC_HAS_RESOLVER_SUPPORT=y -# UCLIBC_HAS_RPC is not set -UCLIBC_HAS_SCANF_GLIBC_A_FLAG=y -# UCLIBC_HAS_SHA256_CRYPT_IMPL is not set -# UCLIBC_HAS_SHA512_CRYPT_IMPL is not set -UCLIBC_HAS_SHADOW=y -UCLIBC_HAS_SIGNUM_MESSAGES=y -UCLIBC_HAS_SOCKET=y -UCLIBC_HAS_SOFT_FLOAT=y -# UCLIBC_HAS_SSP is not set -# UCLIBC_HAS_SSP_COMPAT is not set -UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y -# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_256 is not set -UCLIBC_HAS_STDIO_BUFSIZ_4096=y -# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set -# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set -# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set -UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y -UCLIBC_HAS_STDIO_GETC_MACRO=y -UCLIBC_HAS_STDIO_PUTC_MACRO=y -# UCLIBC_HAS_STDIO_SHUTDOWN_ON_ABORT is not set -UCLIBC_HAS_STRING_ARCH_OPT=y -UCLIBC_HAS_STRING_GENERIC_OPT=y -# UCLIBC_HAS_STUBS is not set -UCLIBC_HAS_SYSLOG=y -# UCLIBC_HAS_SYS_ERRLIST is not set -# UCLIBC_HAS_SYS_SIGLIST is not set -UCLIBC_HAS_THREADS=y -UCLIBC_HAS_TM_EXTENSIONS=y -UCLIBC_HAS_TZ_CACHING=y -UCLIBC_HAS_TZ_FILE=y -UCLIBC_HAS_TZ_FILE_READ_MANY=y -UCLIBC_HAS_UTMPX=y -UCLIBC_HAS_UTMP=y -UCLIBC_HAS_WCHAR=y -UCLIBC_HAS_WORDEXP=y -UCLIBC_HAS_XATTR=y -# UCLIBC_HAS_XLOCALE is not set -UCLIBC_HAS___PROGNAME=y -# UCLIBC_LINUX_MODULE_24 is not set -UCLIBC_LINUX_MODULE_26=y -UCLIBC_LINUX_SPECIFIC=y -# UCLIBC_MALLOC_DEBUGGING is not set -# UCLIBC_MJN3_ONLY is not set -# UCLIBC_NTP_LEGACY is not set -# USE_OLD_VFPRINTF is not set -UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9 -UCLIBC_PWD_BUFFER_SIZE=256 -# UCLIBC_STATIC_LDCONFIG is not set -# UCLIBC_STRICT_HEADERS is not set -UCLIBC_SUPPORT_AI_ADDRCONFIG=y -UCLIBC_SUSV3_LEGACY=y -UCLIBC_SUSV3_LEGACY_MACROS=y -UCLIBC_SUSV4_LEGACY=y -# UCLIBC_SV4_DEPRECATED is not set -UCLIBC_TZ_FILE_PATH="/etc/TZ" -# UCLIBC_FALLBACK_TO_ETC_LOCALTIME is not set -UCLIBC_USE_NETLINK=y -# UNIX98PTY_ONLY is not set -USE_BX=y -WARNINGS="-Wall" -# UCLIBC_HAS_OBSTACK is not set -# UCLIBC_SUSV2_LEGACY is not set -# UCLIBC_HAS_CONTEXT_FUNCS is not set -UCLIBC_HAS_GETOPT_LONG=y diff --git a/toolchain-old/uClibc/config/debug b/toolchain-old/uClibc/config/debug deleted file mode 100644 index b366e66e3..000000000 --- a/toolchain-old/uClibc/config/debug +++ /dev/null @@ -1,6 +0,0 @@ -DODEBUG=y -DODEBUG_PT=y -PTHREADS_DEBUG_SUPPORT=y -SUPPORT_LD_DEBUG=y -SUPPORT_LD_DEBUG_EARLY=y -UCLIBC_MALLOC_DEBUGGING=y diff --git a/toolchain-old/uClibc/config/i386 b/toolchain-old/uClibc/config/i386 deleted file mode 100644 index 5ef264c27..000000000 --- a/toolchain-old/uClibc/config/i386 +++ /dev/null @@ -1,21 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -CONFIG_486=y -# CONFIG_586 is not set -# CONFIG_586MMX is not set -# CONFIG_686 is not set -# CONFIG_CRUSOE is not set -# CONFIG_CYRIXIII is not set -# CONFIG_ELAN is not set -# CONFIG_GENERIC_386 is not set -# CONFIG_K6 is not set -# CONFIG_K7 is not set -# CONFIG_NEHEMIAH is not set -# CONFIG_PENTIUM4 is not set -# CONFIG_PENTIUMII is not set -# CONFIG_PENTIUMIII is not set -# CONFIG_WINCHIP2 is not set -# CONFIG_WINCHIPC6 is not set -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/i686 b/toolchain-old/uClibc/config/i686 deleted file mode 100644 index ba615f6b8..000000000 --- a/toolchain-old/uClibc/config/i686 +++ /dev/null @@ -1,21 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# CONFIG_386 is not set -# CONFIG_486 is not set -# CONFIG_586 is not set -# CONFIG_586MMX is not set -CONFIG_686=y -# CONFIG_CRUSOE is not set -# CONFIG_CYRIXIII is not set -# CONFIG_ELAN is not set -# CONFIG_GENERIC_386 is not set -# CONFIG_K6 is not set -# CONFIG_K7 is not set -# CONFIG_NEHEMIAH is not set -# CONFIG_PENTIUM4 is not set -# CONFIG_PENTIUMII is not set -# CONFIG_PENTIUMIII is not set -# CONFIG_WINCHIP2 is not set -# CONFIG_WINCHIPC6 is not set -TARGET_ARCH="i386" -TARGET_i386=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/m68k b/toolchain-old/uClibc/config/m68k deleted file mode 100644 index 14ce5aef7..000000000 --- a/toolchain-old/uClibc/config/m68k +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -LINUXTHREADS_OLD=y -TARGET_ARCH="m68k" -TARGET_SUBARCH="" -TARGET_m68k=y -# UCLIBC_HAS_THREADS_NATIVE is not set diff --git a/toolchain-old/uClibc/config/mips b/toolchain-old/uClibc/config/mips deleted file mode 100644 index 8cec22f4d..000000000 --- a/toolchain-old/uClibc/config/mips +++ /dev/null @@ -1,18 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -CONFIG_MIPS_ISA_MIPS32=y -# CONFIG_MIPS_ISA_MIPS32R2 is not set -# CONFIG_MIPS_ISA_MIPS64 is not set -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64 b/toolchain-old/uClibc/config/mips64 deleted file mode 100644 index 566d87a6e..000000000 --- a/toolchain-old/uClibc/config/mips64 +++ /dev/null @@ -1,18 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.32 b/toolchain-old/uClibc/config/mips64.32 deleted file mode 100644 index b7ea8f457..000000000 --- a/toolchain-old/uClibc/config/mips64.32 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.64 b/toolchain-old/uClibc/config/mips64.64 deleted file mode 100644 index 2a0b755a7..000000000 --- a/toolchain-old/uClibc/config/mips64.64 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64.n32 b/toolchain-old/uClibc/config/mips64.n32 deleted file mode 100644 index f8def5837..000000000 --- a/toolchain-old/uClibc/config/mips64.n32 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_BIG_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_WANTS_BIG_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el b/toolchain-old/uClibc/config/mips64el deleted file mode 100644 index 53580787b..000000000 --- a/toolchain-old/uClibc/config/mips64el +++ /dev/null @@ -1,18 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.32 b/toolchain-old/uClibc/config/mips64el.32 deleted file mode 100644 index a10840bf9..000000000 --- a/toolchain-old/uClibc/config/mips64el.32 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.64 b/toolchain-old/uClibc/config/mips64el.64 deleted file mode 100644 index 8b90a54a5..000000000 --- a/toolchain-old/uClibc/config/mips64el.64 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -CONFIG_MIPS_N64_ABI=y -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mips64el.n32 b/toolchain-old/uClibc/config/mips64el.n32 deleted file mode 100644 index 4ac4d06c0..000000000 --- a/toolchain-old/uClibc/config/mips64el.n32 +++ /dev/null @@ -1,19 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -CONFIG_MIPS_ISA_MIPS64=y -# CONFIG_MIPS_ISA_MIPS64R2 is not set -CONFIG_MIPS_N32_ABI=y -# CONFIG_MIPS_N64_ABI is not set -# CONFIG_MIPS_O32_ABI is not set -TARGET_ARCH="mips" -TARGET_mips=y -TARGET_SUBARCH="mips64" -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mipsel b/toolchain-old/uClibc/config/mipsel deleted file mode 100644 index d9dedbb02..000000000 --- a/toolchain-old/uClibc/config/mipsel +++ /dev/null @@ -1,18 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -# CONFIG_MIPS_ISA_3 is not set -# CONFIG_MIPS_ISA_4 is not set -CONFIG_MIPS_ISA_MIPS32=y -# CONFIG_MIPS_ISA_MIPS32R2 is not set -# CONFIG_MIPS_ISA_MIPS64 is not set -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/mipsel.cobalt b/toolchain-old/uClibc/config/mipsel.cobalt deleted file mode 100644 index 1d42a70f2..000000000 --- a/toolchain-old/uClibc/config/mipsel.cobalt +++ /dev/null @@ -1,18 +0,0 @@ -ARCH_ANY_ENDIAN=y -ARCH_CFLAGS="-mno-split-addresses" -ARCH_LITTLE_ENDIAN=y -ARCH_WANTS_LITTLE_ENDIAN=y -# CONFIG_MIPS_ISA_1 is not set -# CONFIG_MIPS_ISA_2 is not set -CONFIG_MIPS_ISA_3=y -# CONFIG_MIPS_ISA_4 is not set -# CONFIG_MIPS_ISA_MIPS32 is not set -# CONFIG_MIPS_ISA_MIPS32R2 is not set -# CONFIG_MIPS_ISA_MIPS64 is not set -# CONFIG_MIPS_ISA_MIPS64R2 is not set -# CONFIG_MIPS_N32_ABI is not set -# CONFIG_MIPS_N64_ABI is not set -CONFIG_MIPS_O32_ABI=y -TARGET_ARCH="mips" -TARGET_mips=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/config/powerpc b/toolchain-old/uClibc/config/powerpc deleted file mode 100644 index 5b1292d12..000000000 --- a/toolchain-old/uClibc/config/powerpc +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -CONFIG_CLASSIC=y -# CONFIG_E500 is not set -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain-old/uClibc/config/powerpc.e500 b/toolchain-old/uClibc/config/powerpc.e500 deleted file mode 100644 index a835c3d5e..000000000 --- a/toolchain-old/uClibc/config/powerpc.e500 +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_CLASSIC is not set -CONFIG_E500=y -TARGET_ARCH="powerpc" -TARGET_SUBARCH="classic" -TARGET_powerpc=y diff --git a/toolchain-old/uClibc/config/sparc b/toolchain-old/uClibc/config/sparc deleted file mode 100644 index e1596c410..000000000 --- a/toolchain-old/uClibc/config/sparc +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -# CONFIG_SPARC_V8 is not set -CONFIG_SPARC_V9=y -# CONFIG_SPARC_V9B is not set -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain-old/uClibc/config/sparc.leon b/toolchain-old/uClibc/config/sparc.leon deleted file mode 100644 index eb725ac05..000000000 --- a/toolchain-old/uClibc/config/sparc.leon +++ /dev/null @@ -1,8 +0,0 @@ -ARCH_BIG_ENDIAN=y -# CONFIG_SPARC_V7 is not set -CONFIG_SPARC_V8=y -# CONFIG_SPARC_V9 is not set -# CONFIG_SPARC_V9B is not set -TARGET_ARCH="sparc" -TARGET_sparc=y -UCLIBC_HAS_LONG_DOUBLE_MATH=y diff --git a/toolchain-old/uClibc/config/x86_64 b/toolchain-old/uClibc/config/x86_64 deleted file mode 100644 index b6dc2c2af..000000000 --- a/toolchain-old/uClibc/config/x86_64 +++ /dev/null @@ -1,6 +0,0 @@ -ARCH_LITTLE_ENDIAN=y -# LINUXTHREADS_NEW is not set -TARGET_ARCH="x86_64" -TARGET_x86_64=y -UCLIBC_BSD_SPECIFIC=y -UCLIBC_HAS_FPU=y diff --git a/toolchain-old/uClibc/headers/Makefile b/toolchain-old/uClibc/headers/Makefile deleted file mode 100644 index abd3620d3..000000000 --- a/toolchain-old/uClibc/headers/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -PATH_PREFIX:=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.headers_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_headers_installed - -define Host/Compile - -endef - -define Host/Install - PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ - PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - DEVEL_PREFIX=/ \ - RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ - HOSTCC="$(HOSTCC)" \ - CC="$(TARGET_CC)" \ - CPU_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(CONFIG_ARCH)" \ - pregen \ - install_headers - $(CP) $(BUILD_DIR_TOOLCHAIN)/linux-dev/* $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/ -endef - -$(eval $(call HostBuild)) - diff --git a/toolchain-old/uClibc/utils/Makefile b/toolchain-old/uClibc/utils/Makefile deleted file mode 100644 index 83100d70c..000000000 --- a/toolchain-old/uClibc/utils/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -PATH_PREFIX=.. - -include ../common.mk - -HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.utils_built -HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_utils_installed - -define Host/Compile - $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak - $(UCLIBC_MAKE) PREFIX= utils -endef - -define Host/Install - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldd \ - $(TOOLCHAIN_DIR)/bin/ - $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin - $(INSTALL_BIN) \ - $(HOST_BUILD_DIR)/utils/ldconfig \ - $(TOOLCHAIN_DIR)/sbin/ -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/wrapper/Makefile b/toolchain-old/wrapper/Makefile deleted file mode 100644 index 3398e407c..000000000 --- a/toolchain-old/wrapper/Makefile +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright (C) 2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=wrapper -PKG_VERSION:=1 - -include $(INCLUDE_DIR)/toolchain-build.mk - - -# 1: args -define toolchain_util -$(strip $(SCRIPT_DIR)/ext-toolchain.sh --toolchain $(CONFIG_TOOLCHAIN_ROOT) \ - --cflags $(CONFIG_TARGET_OPTIMIZATION) \ - --cflags "$(if $(call qstrip,$(CONFIG_TOOLCHAIN_LIBC)),-m$(call qstrip,$(CONFIG_TOOLCHAIN_LIBC))) $(if $(CONFIG_SOFT_FLOAT),-msoft-float)" \ - --cflags "$(patsubst ./%,-I$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH)))" \ - --cflags "$(patsubst ./%,-L$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH)))" \ - $(1)) -endef - -# 1: config symbol -# 2: feature -define toolchain_test -$$(if $$($(1)), \ - @echo -n "Testing external toolchain for $(2) support ... "; \ - if $(call toolchain_util,--test "$(2)"); then \ - echo "ok"; exit 0; \ - else \ - echo "failed"; \ - echo "ERROR: $(1) is enabled but the external toolchain does not support it"; \ - exit 1; \ - fi) -endef - - -define Host/Prepare - $(call toolchain_test,CONFIG_SOFT_FLOAT,softfloat) - $(call toolchain_test,CONFIG_IPV6,ipv6) - $(call toolchain_test,CONFIG_NLS,wchar) - $(call toolchain_test,CONFIG_PACKAGE_libpthread,threads) -endef - -define Host/Configure -endef - -define Host/Compile -endef - -define Host/Install - $(call toolchain_util,--wrap "$(TOOLCHAIN_DIR)/bin") -endef - -define Host/Clean - rm -rf $(TOOLCHAIN_DIR)/bin -endef - -$(eval $(call HostBuild)) diff --git a/toolchain-old/yasm/Makefile b/toolchain-old/yasm/Makefile deleted file mode 100644 index e5cdac6fe..000000000 --- a/toolchain-old/yasm/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# -# Copyright (C) 2016 Daniel Golle -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# -include $(TOPDIR)/rules.mk - -PKG_NAME:=yasm -PKG_VERSION:=1.3.0 - -PKG_SOURCE_URL:=http://www.tortall.net/projects/yasm/releases/ -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz - -PKG_HASH:=3dce6601b495f5b3d45b59f7d2492a340ee7e84b5beca17e48f862502bd5603f - -HOST_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/toolchain-build.mk - -YASM_CONFIGURE:= \ - ./configure \ - --prefix=$(TOOLCHAIN_DIR) \ - --build=$(GNU_HOST_NAME) \ - --host=$(GNU_HOST_NAME) \ - --target=$(REAL_GNU_TARGET_NAME) \ - --with-sysroot=$(TOOLCHAIN_DIR) \ - --disable-multilib \ - --disable-werror \ - --disable-nls \ - --disable-sim \ - --disable-gdb \ - $(SOFT_FLOAT_CONFIG_OPTION) \ - -define Host/Prepare - $(call Host/Prepare/Default) - ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) - $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/ -endef - -define Host/Configure - (cd $(HOST_BUILD_DIR); \ - $(YASM_CONFIGURE) \ - ); -endef - -define Host/Compile - +$(MAKE) $(HOST_JOBS) -C $(HOST_BUILD_DIR) all -endef - -define Host/Install - $(MAKE) -C $(HOST_BUILD_DIR) \ - prefix=$(TOOLCHAIN_DIR) \ - install -endef - -define Host/Clean - rm -rf \ - $(HOST_BUILD_DIR) \ - $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) -endef - -$(eval $(call HostBuild)) diff --git a/tools/Makefile b/tools/Makefile index a95342f50..50bd552d7 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -29,7 +29,6 @@ tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf tools-y += mtools dosfstools libressl tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2 tools-$(CONFIG_TARGET_x86) += qemu -tools-$(CONFIG_EFI_IMAGES) += popt gptfdisk tools-$(CONFIG_TARGET_mxs) += elftosb sdimage tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs tools-$(CONFIG_USES_MINOR) += kernel2minor @@ -72,7 +71,6 @@ $(curdir)/libressl/compile := $(curdir)/pkg-config/compile $(curdir)/mkimage/compile += $(curdir)/libressl/compile $(curdir)/firmware-utils/compile += $(curdir)/libressl/compile $(curdir)/cmake/compile += $(curdir)/libressl/compile -$(curdir)/gptfdisk/compile += $(curdir)/popt/compile $(curdir)/e2fsprogs/compile ifneq ($(HOST_OS),Linux) tools-y += coreutils diff --git a/tools/automake/Makefile b/tools/automake/Makefile index 2e618f997..c016f1d76 100644 --- a/tools/automake/Makefile +++ b/tools/automake/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=automake +PKG_CPE_ID:=cpe:/a:gnu:automake PKG_VERSION:=1.15.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index a94942f84..22e5d3e85 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,12 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.8.1 +PKG_VERSION:=3.9.3 +PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://cmake.org/files/v3.8/ \ +PKG_SOURCE_URL:=https://cmake.org/files/v3.9/ \ https://fossies.org/linux/misc/ -PKG_HASH:=ce5d9161396e06501b00e52933783150a87c33080d4bdcef461b5b7fd24ac228 +PKG_HASH:=8eaf75e1e932159aae98ab5e7491499545554be62a08cbcbc7c75c84b999f28a HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/cmake/patches/010-backport-macos-fix.patch b/tools/cmake/patches/010-backport-macos-fix.patch new file mode 100644 index 000000000..76e92dcb0 --- /dev/null +++ b/tools/cmake/patches/010-backport-macos-fix.patch @@ -0,0 +1,15 @@ +--- a/Source/kwsys/kwsysPlatformTestsCXX.cxx ++++ b/Source/kwsys/kwsysPlatformTestsCXX.cxx +@@ -265,6 +265,12 @@ int main() + #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT + #include + #include ++#if defined(__APPLE__) ++#include ++#if MAC_OS_X_VERSION_MIN_REQUIRED < 101300 ++#error "utimensat not available on macOS < 10.13" ++#endif ++#endif + int main() + { + struct timespec times[2] = { { 0, UTIME_OMIT }, { 0, UTIME_NOW } }; diff --git a/tools/cmake/patches/100-disable_qt_tests.patch b/tools/cmake/patches/100-disable_qt_tests.patch index 54a75bc77..f8baafe33 100644 --- a/tools/cmake/patches/100-disable_qt_tests.patch +++ b/tools/cmake/patches/100-disable_qt_tests.patch @@ -1,6 +1,6 @@ --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt -@@ -244,15 +244,6 @@ add_RunCMake_test(no_install_prefix) +@@ -246,15 +246,6 @@ add_RunCMake_test(no_install_prefix) add_RunCMake_test(configure_file) add_RunCMake_test(CTestTimeoutAfterMatch) @@ -18,7 +18,7 @@ add_RunCMake_test(FindPkgConfig) --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt -@@ -398,10 +398,6 @@ if(BUILD_TESTING) +@@ -403,10 +403,6 @@ if(BUILD_TESTING) list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) diff --git a/tools/cmake/patches/120-alpine_musl-compat.patch b/tools/cmake/patches/110-alpine_musl-compat.patch similarity index 100% rename from tools/cmake/patches/120-alpine_musl-compat.patch rename to tools/cmake/patches/110-alpine_musl-compat.patch diff --git a/tools/cmake/patches/110-freebsd-compat.patch b/tools/cmake/patches/110-freebsd-compat.patch deleted file mode 100644 index 4f1107846..000000000 --- a/tools/cmake/patches/110-freebsd-compat.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 6eab64c3adc7a38c322cd4d9a1a1881f2d49cb9c Mon Sep 17 00:00:00 2001 -From: Raphael Kubo da Costa -Date: Tue, 15 Oct 2013 00:10:56 +0300 -Subject: [PATCH] SystemInformation: Include backtrace-related headers on - FreeBSD - -This was probably broken for a long while, but the problem was not apparent -because the check for execinfo.h would fail by default because --I/usr/local/include was not being passed to the compiler when making the -checks for the header's existence. - -Now that very recent FreeBSD versions (ie. 10-CURRENT) have NetBSD's -libexecinfo in base (and it is thus installed into /usr), the -backtrace-related checks would pass, but the required headers were not being -included in SystemInformation.cxx. - -Change-Id: I3b91ed7ac0e6878035aee202b3336c536cc6d2ff ---- - Source/kwsys/SystemInformation.cxx | 9 +++++++++ - 1 file changed, 9 insertions(+) - ---- a/Source/kwsys/SystemInformation.cxx -+++ b/Source/kwsys/SystemInformation.cxx -@@ -82,6 +82,15 @@ typedef int siginfo_t; - #include - #define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN - #endif -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -+# include -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -+# include -+# endif -+# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -+# include -+# endif -+# endif - #endif - - #if defined(KWSYS_SYS_HAS_MACHINE_CPU_H) diff --git a/tools/cmake/patches/130-libarchive-fix-libressl-compat.patch b/tools/cmake/patches/120-libarchive-fix-libressl-compat.patch similarity index 100% rename from tools/cmake/patches/130-libarchive-fix-libressl-compat.patch rename to tools/cmake/patches/120-libarchive-fix-libressl-compat.patch diff --git a/tools/cmake/patches/140-curl-fix-libressl-linking.patch b/tools/cmake/patches/130-curl-fix-libressl-linking.patch similarity index 69% rename from tools/cmake/patches/140-curl-fix-libressl-linking.patch rename to tools/cmake/patches/130-curl-fix-libressl-linking.patch index c16e927ff..b5ee61b58 100644 --- a/tools/cmake/patches/140-curl-fix-libressl-linking.patch +++ b/tools/cmake/patches/130-curl-fix-libressl-linking.patch @@ -17,16 +17,17 @@ Modify the cmcurl CMakeLists.txt to check for clock_gettime() in librt and unconditionally link the rt library when the symbol is found. Signed-off-by: Jo-Philipp Wich +--- --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt -@@ -374,6 +374,10 @@ set(HAVE_LIBSSL OFF) - if(CMAKE_USE_OPENSSL) - find_package(OpenSSL) - if(OPENSSL_FOUND) -+ check_library_exists("rt" clock_gettime "" HAVE_LIBRT) -+ if(HAVE_LIBRT) -+ list(APPEND OPENSSL_LIBRARIES rt) -+ endif() - list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) - set(USE_OPENSSL ON) - set(HAVE_LIBCRYPTO ON) +@@ -456,6 +456,10 @@ if(CMAKE_USE_OPENSSL) + set(USE_OPENSSL ON) + set(HAVE_LIBCRYPTO ON) + set(HAVE_LIBSSL ON) ++ check_library_exists("rt" clock_gettime "" HAVE_LIBRT) ++ if(HAVE_LIBRT) ++ list(APPEND OPENSSL_LIBRARIES rt) ++ endif() + list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) + include_directories(${OPENSSL_INCLUDE_DIR}) + set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) diff --git a/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/140-bootstrap_parallel_make_flag.patch similarity index 89% rename from tools/cmake/patches/150-bootstrap_parallel_make_flag.patch rename to tools/cmake/patches/140-bootstrap_parallel_make_flag.patch index 4d432dcc1..734e8cb1c 100644 --- a/tools/cmake/patches/150-bootstrap_parallel_make_flag.patch +++ b/tools/cmake/patches/140-bootstrap_parallel_make_flag.patch @@ -1,6 +1,6 @@ --- a/bootstrap +++ b/bootstrap -@@ -1046,7 +1046,10 @@ int main(){ printf("1%c", (char)0x0a); r +@@ -1094,7 +1094,10 @@ int main(){ printf("1%c", (char)0x0a); r ' > "test.c" cmake_original_make_flags="${cmake_make_flags}" if [ "x${cmake_parallel_make}" != "x" ]; then diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile index 1acdfb916..4109fd77b 100644 --- a/tools/coreutils/Makefile +++ b/tools/coreutils/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=coreutils +PKG_CPE_ID:=cpe:/a:gnu:coreutils PKG_VERSION:=8.27 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz @@ -15,14 +16,14 @@ PKG_HASH:=8891d349ee87b9ff7870f52b6d9312a9db672d2439d289bc57084771ca21656b HOST_BUILD_PARALLEL := 1 -BUILD_PROGRAMS = date +BUILD_PROGRAMS = date readlink include $(INCLUDE_DIR)/host-build.mk BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS)) HOST_CONFIGURE_ARGS += \ - --enable-install-program=date + --enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS))) HOST_MAKE_FLAGS += \ PROGRAMS="$(BUILD_BINS)" \ diff --git a/tools/dosfstools/Makefile b/tools/dosfstools/Makefile index 861dcbf1c..e34ceaf32 100644 --- a/tools/dosfstools/Makefile +++ b/tools/dosfstools/Makefile @@ -8,6 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dosfstools +PKG_CPE_ID:=cpe:/a:dosfstools_project:dosfstools PKG_VERSION:=4.1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile index 04befc9c8..36f5c547b 100644 --- a/tools/e2fsprogs/Makefile +++ b/tools/e2fsprogs/Makefile @@ -8,8 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.5 -PKG_HASH:=261f3d9ade383fbf032a19140c9c25e998cc0f71a1ae686614fb3ae0eb955a17 +PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/e2fsprogs/patches/005-darwin-compat.patch b/tools/e2fsprogs/patches/004-darwin-compat.patch similarity index 100% rename from tools/e2fsprogs/patches/005-darwin-compat.patch rename to tools/e2fsprogs/patches/004-darwin-compat.patch diff --git a/tools/e2fsprogs/patches/004-freebsd-compat.patch b/tools/e2fsprogs/patches/004-freebsd-compat.patch deleted file mode 100644 index d102e1cd9..000000000 --- a/tools/e2fsprogs/patches/004-freebsd-compat.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/lib/ext2fs/tdb.c -+++ b/lib/ext2fs/tdb.c -@@ -58,7 +58,9 @@ Last Changed Date: 2007-06-22 13:36:10 - - #include - #endif - #include -+#ifndef __FreeBSD__ - #include -+#endif - #include - - #ifdef HAVE_SYS_MMAN_H diff --git a/tools/e2fsprogs/patches/010-old-libmagic.patch b/tools/e2fsprogs/patches/010-old-libmagic.patch deleted file mode 100644 index 11a7e180b..000000000 --- a/tools/e2fsprogs/patches/010-old-libmagic.patch +++ /dev/null @@ -1,25 +0,0 @@ -From b482eb7af94885b6bbad9329e40702c958d5b448 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 30 Jun 2016 19:53:03 +0200 -Subject: [PATCH] fix build problem with very old libmagic - -The libmagic shipped with RedHat 5 does not define -MAGIC_NO_CHECK_ELF and MAGIC_NO_CHECK_COMPRESS. e2fsprogs should -check for that otherwise the build will fail. - -Signed-off-by: Hauke Mehrtens ---- - lib/support/plausible.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/lib/support/plausible.c -+++ b/lib/support/plausible.c -@@ -258,7 +258,7 @@ int check_plausibility(const char *devic - return 0; - } - --#ifdef HAVE_MAGIC_H -+#if defined(HAVE_MAGIC_H) && defined(MAGIC_NO_CHECK_ELF) && defined(MAGIC_NO_CHECK_COMPRESS) - if ((flags & CHECK_FS_EXIST) && - !getenv("E2FSPROGS_LIBMAGIC_SUPPRESS") && - magic_library_available()) { diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 1f856c911..fab04e011 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -8,10 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat -PKG_VERSION:=2.2.3 +PKG_CPE_ID:=cpe:/a:libexpat:expat +PKG_VERSION:=2.2.5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=b31890fb02f85c002a67491923f89bda5028a880fd6c374f707193ad81aace5f +PKG_HASH:=d9dc32efba7e74f788fcc4f212a43216fc37cf5f23f4c2339664d473353aedf6 PKG_SOURCE_URL:=@SF/expat HOST_BUILD_PARALLEL:=1 diff --git a/tools/findutils/Makefile b/tools/findutils/Makefile index b07c53d9f..c1c45eeaa 100644 --- a/tools/findutils/Makefile +++ b/tools/findutils/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=findutils +PKG_CPE_ID:=cpe:/a:gnu:findutils PKG_VERSION:=4.6.0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/tools/findutils/patches/100-include_sysmacros.patch b/tools/findutils/patches/100-include_sysmacros.patch new file mode 100644 index 000000000..82b1ee9a4 --- /dev/null +++ b/tools/findutils/patches/100-include_sysmacros.patch @@ -0,0 +1,13 @@ +--- a/gl/lib/mountlist.c ++++ b/gl/lib/mountlist.c +@@ -17,6 +17,10 @@ + + #include + ++#ifdef MAJOR_IN_SYSMACROS ++# include ++#endif ++ + #include "mountlist.h" + + #include diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 4f1f8d70f..ca41387b5 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -20,6 +20,7 @@ define Host/Compile $(call cc,addpattern) $(call cc,asustrx) $(call cc,trx) + $(call cc,otrx) $(call cc,motorola-bin) $(call cc,dgfirmware) $(call cc,mksenaofw md5) @@ -39,8 +40,8 @@ define Host/Compile $(call cc,encode_crc) $(call cc,nand_ecc) $(call cc,mkplanexfw sha1) - $(call cc,mktplinkfw md5, -Wall) - $(call cc,mktplinkfw2 md5) + $(call cc,mktplinkfw mktplinkfw-lib md5, -Wall -fgnu89-inline) + $(call cc,mktplinkfw2 mktplinkfw-lib md5, -fgnu89-inline) $(call cc,tplink-safeloader md5, -Wall) $(call cc,pc1crypt) $(call cc,osbridge-crc) diff --git a/tools/firmware-utils/src/mktplinkfw-lib.c b/tools/firmware-utils/src/mktplinkfw-lib.c new file mode 100644 index 000000000..e3213274c --- /dev/null +++ b/tools/firmware-utils/src/mktplinkfw-lib.c @@ -0,0 +1,265 @@ +/* + * Copyright (C) 2009 Gabor Juhos + * + * This tool was based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian + * + * 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 +#include +#include +#include +#include /* for unlink() */ +#include +#include /* for getopt() */ +#include +#include +#include +#include +#include + +#include +#include + +#include "mktplinkfw-lib.h" +#include "md5.h" + +extern char *ofname; +extern char *progname; +extern uint32_t kernel_len; +extern struct file_info kernel_info; +extern struct file_info rootfs_info; +extern struct flash_layout *layout; +extern uint32_t rootfs_ofs; +extern uint32_t rootfs_align; +extern int combined; +extern int strip_padding; +extern int add_jffs2_eof; + +static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; + +void fill_header(char *buf, int len); + +struct flash_layout *find_layout(struct flash_layout *layouts, const char *id) +{ + struct flash_layout *ret; + struct flash_layout *l; + + ret = NULL; + for (l = layouts; l->id != NULL; l++){ + if (strcasecmp(id, l->id) == 0) { + ret = l; + break; + } + }; + + return ret; +} + +void get_md5(const char *data, int size, uint8_t *md5) +{ + MD5_CTX ctx; + + MD5_Init(&ctx); + MD5_Update(&ctx, data, size); + MD5_Final(md5, &ctx); +} + +int get_file_stat(struct file_info *fdata) +{ + struct stat st; + int res; + + if (fdata->file_name == NULL) + return 0; + + res = stat(fdata->file_name, &st); + if (res){ + ERRS("stat failed on %s", fdata->file_name); + return res; + } + + fdata->file_size = st.st_size; + return 0; +} + +int read_to_buf(const struct file_info *fdata, char *buf) +{ + FILE *f; + int ret = EXIT_FAILURE; + + f = fopen(fdata->file_name, "r"); + if (f == NULL) { + ERRS("could not open \"%s\" for reading", fdata->file_name); + goto out; + } + + errno = 0; + fread(buf, fdata->file_size, 1, f); + if (errno != 0) { + ERRS("unable to read from file \"%s\"", fdata->file_name); + goto out_close; + } + + ret = EXIT_SUCCESS; + +out_close: + fclose(f); +out: + return ret; +} + +static int pad_jffs2(char *buf, int currlen, int maxlen) +{ + int len; + uint32_t pad_mask; + + len = currlen; + pad_mask = (4 * 1024) | (64 * 1024); /* EOF at 4KB and at 64KB */ + while ((len < maxlen) && (pad_mask != 0)) { + uint32_t mask; + int i; + + for (i = 10; i < 32; i++) { + mask = 1 << i; + if (pad_mask & mask) + break; + } + + len = ALIGN(len, mask); + + for (i = 10; i < 32; i++) { + mask = 1 << i; + if ((len & (mask - 1)) == 0) + pad_mask &= ~mask; + } + + for (i = 0; i < sizeof(jffs2_eof_mark); i++) + buf[len + i] = jffs2_eof_mark[i]; + + len += sizeof(jffs2_eof_mark); + } + + return len; +} + +int write_fw(const char *ofname, const char *data, int len) +{ + FILE *f; + int ret = EXIT_FAILURE; + + f = fopen(ofname, "w"); + if (f == NULL) { + ERRS("could not open \"%s\" for writing", ofname); + goto out; + } + + errno = 0; + fwrite(data, len, 1, f); + if (errno) { + ERRS("unable to write output file"); + goto out_flush; + } + + DBG("firmware file \"%s\" completed", ofname); + + ret = EXIT_SUCCESS; + +out_flush: + fflush(f); + fclose(f); + if (ret != EXIT_SUCCESS) { + unlink(ofname); + } +out: + return ret; +} + +/* Helper functions to inspect_fw() representing different output formats */ +inline void inspect_fw_pstr(const char *label, const char *str) +{ + printf("%-23s: %s\n", label, str); +} + +inline void inspect_fw_phex(const char *label, uint32_t val) +{ + printf("%-23s: 0x%08x\n", label, val); +} + +inline void inspect_fw_phexdec(const char *label, uint32_t val) +{ + printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); +} + +inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text) +{ + int i; + + printf("%-23s:", label); + for (i=0; ifw_max_len; + + buf = malloc(buflen); + if (!buf) { + ERR("no memory for buffer\n"); + goto out; + } + + memset(buf, 0xff, buflen); + p = buf + header_size; + ret = read_to_buf(&kernel_info, p); + if (ret) + goto out_free_buf; + + if (!combined) { + p = buf + rootfs_ofs; + + ret = read_to_buf(&rootfs_info, p); + if (ret) + goto out_free_buf; + + writelen = rootfs_ofs + rootfs_info.file_size; + + if (add_jffs2_eof) + writelen = pad_jffs2(buf, writelen, layout->fw_max_len); + } + + if (!strip_padding) + writelen = buflen; + + fill_header(buf, writelen); + ret = write_fw(ofname, buf, writelen); + if (ret) + goto out_free_buf; + + ret = EXIT_SUCCESS; + +out_free_buf: + free(buf); +out: + return ret; +} diff --git a/tools/firmware-utils/src/mktplinkfw-lib.h b/tools/firmware-utils/src/mktplinkfw-lib.h new file mode 100644 index 000000000..31e6d0b1e --- /dev/null +++ b/tools/firmware-utils/src/mktplinkfw-lib.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2009 Gabor Juhos + * + * This tool was based on: + * TP-Link WR941 V2 firmware checksum fixing tool. + * Copyright (C) 2008,2009 Wang Jian + * + * 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. + * + */ + + +#ifndef mktplinkfw_lib_h +#define mktplinkfw_lib_h + +#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + +#define MD5SUM_LEN 16 + +/* + * Message macros + */ +#define ERR(fmt, ...) do { \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt "\n", \ + progname, ## __VA_ARGS__ ); \ +} while (0) + +#define ERRS(fmt, ...) do { \ + int save = errno; \ + fflush(0); \ + fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ + progname, ## __VA_ARGS__, strerror(save)); \ +} while (0) + +#define DBG(fmt, ...) do { \ + fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ +} while (0) + + +struct file_info { + char *file_name; /* name of the file */ + uint32_t file_size; /* length of the file */ +}; + +struct flash_layout { + char *id; + uint32_t fw_max_len; + uint32_t kernel_la; + uint32_t kernel_ep; + uint32_t rootfs_ofs; +}; + +struct flash_layout *find_layout(struct flash_layout *layouts, const char *id); +void get_md5(const char *data, int size, uint8_t *md5); +int get_file_stat(struct file_info *fdata); +int read_to_buf(const struct file_info *fdata, char *buf); +int write_fw(const char *ofname, const char *data, int len); +inline void inspect_fw_pstr(const char *label, const char *str); +inline void inspect_fw_phex(const char *label, uint32_t val); +inline void inspect_fw_phexdec(const char *label, uint32_t val); +inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text); +int build_fw(size_t header_size); + +#endif /* mktplinkfw_lib_h */ diff --git a/tools/firmware-utils/src/mktplinkfw.c b/tools/firmware-utils/src/mktplinkfw.c index c53786205..ab5fd6d58 100644 --- a/tools/firmware-utils/src/mktplinkfw.c +++ b/tools/firmware-utils/src/mktplinkfw.c @@ -28,20 +28,11 @@ #include #include "md5.h" - -#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) -#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) +#include "mktplinkfw-lib.h" #define HEADER_VERSION_V1 0x01000000 #define HEADER_VERSION_V2 0x02000000 -#define MD5SUM_LEN 16 - -struct file_info { - char *file_name; /* name of the file */ - uint32_t file_size; /* length of the file */ -}; - struct fw_header { uint32_t version; /* header version */ char vendor_name[24]; @@ -71,14 +62,6 @@ struct fw_header { uint8_t pad2[160]; } __attribute__ ((packed)); -struct flash_layout { - char *id; - uint32_t fw_max_len; - uint32_t kernel_la; - uint32_t kernel_ep; - uint32_t rootfs_ofs; -}; - struct fw_region { char name[4]; uint32_t code; @@ -88,15 +71,15 @@ struct fw_region { /* * Globals */ -static char *ofname; -static char *progname; +char *ofname; +char *progname; static char *vendor = "TP-LINK Technologies"; static char *version = "ver. 1.0"; static char *fw_ver = "0.0.0"; static uint32_t hdr_ver = HEADER_VERSION_V1; static char *layout_id; -static struct flash_layout *layout; +struct flash_layout *layout; static char *opt_hw_id; static uint32_t hw_id; static char *opt_hw_rev; @@ -107,18 +90,17 @@ static const struct fw_region *region; static int fw_ver_lo; static int fw_ver_mid; static int fw_ver_hi; -static struct file_info kernel_info; +struct file_info kernel_info; static uint32_t kernel_la = 0; static uint32_t kernel_ep = 0; -static uint32_t kernel_len = 0; -static struct file_info rootfs_info; -static uint32_t rootfs_ofs = 0; -static uint32_t rootfs_align; +uint32_t kernel_len = 0; +struct file_info rootfs_info; +uint32_t rootfs_ofs = 0; +uint32_t rootfs_align; static struct file_info boot_info; -static int combined; -static int strip_padding; -static int add_jffs2_eof; -static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; +int combined; +int strip_padding; +int add_jffs2_eof; static uint32_t fw_max_len; static uint32_t reserved_space; @@ -188,44 +170,9 @@ static const struct fw_region regions[] = { /* Default region (universal) uses code 0 as well */ {"US", 1}, {"EU", 0}, + {"BR", 0}, }; -/* - * Message macros - */ -#define ERR(fmt, ...) do { \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ - progname, ## __VA_ARGS__ ); \ -} while (0) - -#define ERRS(fmt, ...) do { \ - int save = errno; \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ - progname, ## __VA_ARGS__, strerror(save)); \ -} while (0) - -#define DBG(fmt, ...) do { \ - fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ -} while (0) - -static struct flash_layout *find_layout(const char *id) -{ - struct flash_layout *ret; - struct flash_layout *l; - - ret = NULL; - for (l = layouts; l->id != NULL; l++){ - if (strcasecmp(id, l->id) == 0) { - ret = l; - break; - } - }; - - return ret; -} - static const struct fw_region * find_region(const char *country) { size_t i; @@ -271,59 +218,6 @@ static void usage(int status) exit(status); } -static void get_md5(const char *data, int size, uint8_t *md5) -{ - MD5_CTX ctx; - - MD5_Init(&ctx); - MD5_Update(&ctx, data, size); - MD5_Final(md5, &ctx); -} - -static int get_file_stat(struct file_info *fdata) -{ - struct stat st; - int res; - - if (fdata->file_name == NULL) - return 0; - - res = stat(fdata->file_name, &st); - if (res){ - ERRS("stat failed on %s", fdata->file_name); - return res; - } - - fdata->file_size = st.st_size; - return 0; -} - -static int read_to_buf(const struct file_info *fdata, char *buf) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(fdata->file_name, "r"); - if (f == NULL) { - ERRS("could not open \"%s\" for reading", fdata->file_name); - goto out; - } - - errno = 0; - fread(buf, fdata->file_size, 1, f); - if (errno != 0) { - ERRS("unable to read from file \"%s\"", fdata->file_name); - goto out_close; - } - - ret = EXIT_SUCCESS; - - out_close: - fclose(f); - out: - return ret; -} - static int check_options(void) { int ret; @@ -370,7 +264,7 @@ static int check_options(void) return -1; } } else { - layout = find_layout(layout_id); + layout = find_layout(layouts, layout_id); if (layout == NULL) { ERR("unknown flash layout \"%s\"", layout_id); return -1; @@ -414,10 +308,10 @@ static int check_options(void) if (rootfs_align) { kernel_len += sizeof(struct fw_header); - kernel_len = ALIGN(kernel_len, rootfs_align); + rootfs_ofs = ALIGN(kernel_len, rootfs_align); kernel_len -= sizeof(struct fw_header); - DBG("kernel length aligned to %u", kernel_len); + DBG("rootfs offset aligned to 0x%u", rootfs_ofs); exceed_bytes = kernel_len + rootfs_info.file_size - (fw_max_len - sizeof(struct fw_header)); if (exceed_bytes > 0) { @@ -462,7 +356,7 @@ static int check_options(void) return 0; } -static void fill_header(char *buf, int len) +void fill_header(char *buf, int len) { struct fw_header *hdr = (struct fw_header *)buf; @@ -515,161 +409,6 @@ static void fill_header(char *buf, int len) get_md5(buf, len, hdr->md5sum1); } -static int pad_jffs2(char *buf, int currlen) -{ - int len; - uint32_t pad_mask; - - len = currlen; - pad_mask = (64 * 1024); - while ((len < layout->fw_max_len) && (pad_mask != 0)) { - uint32_t mask; - int i; - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if (pad_mask & mask) - break; - } - - len = ALIGN(len, mask); - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if ((len & (mask - 1)) == 0) - pad_mask &= ~mask; - } - - for (i = 0; i < sizeof(jffs2_eof_mark); i++) - buf[len + i] = jffs2_eof_mark[i]; - - len += sizeof(jffs2_eof_mark); - } - - return len; -} - -static int write_fw(const char *data, int len) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(ofname, "w"); - if (f == NULL) { - ERRS("could not open \"%s\" for writing", ofname); - goto out; - } - - errno = 0; - fwrite(data, len, 1, f); - if (errno) { - ERRS("unable to write output file"); - goto out_flush; - } - - DBG("firmware file \"%s\" completed", ofname); - - ret = EXIT_SUCCESS; - - out_flush: - fflush(f); - fclose(f); - if (ret != EXIT_SUCCESS) { - unlink(ofname); - } - out: - return ret; -} - -static int build_fw(void) -{ - int buflen; - char *buf; - char *p; - int ret = EXIT_FAILURE; - int writelen = 0; - - writelen = sizeof(struct fw_header) + kernel_len; - - if (combined) - buflen = writelen; - else - buflen = layout->fw_max_len; - - buf = malloc(buflen); - if (!buf) { - ERR("no memory for buffer\n"); - goto out; - } - - memset(buf, 0xff, buflen); - p = buf + sizeof(struct fw_header); - ret = read_to_buf(&kernel_info, p); - if (ret) - goto out_free_buf; - - - if (!combined) { - if (rootfs_align) - p = buf + writelen; - else - p = buf + rootfs_ofs; - - ret = read_to_buf(&rootfs_info, p); - if (ret) - goto out_free_buf; - - if (rootfs_align) - writelen += rootfs_info.file_size; - else - writelen = rootfs_ofs + rootfs_info.file_size; - - if (add_jffs2_eof) - writelen = pad_jffs2(buf, writelen); - } - - if (!strip_padding) - writelen = buflen; - - fill_header(buf, writelen); - ret = write_fw(buf, writelen); - if (ret) - goto out_free_buf; - - ret = EXIT_SUCCESS; - - out_free_buf: - free(buf); - out: - return ret; -} - -/* Helper functions to inspect_fw() representing different output formats */ -static inline void inspect_fw_pstr(const char *label, const char *str) -{ - printf("%-23s: %s\n", label, str); -} - -static inline void inspect_fw_phex(const char *label, uint32_t val) -{ - printf("%-23s: 0x%08x\n", label, val); -} - -static inline void inspect_fw_phexdec(const char *label, uint32_t val) -{ - printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); -} - -static inline void inspect_fw_pmd5sum(const char *label, const uint8_t *val, const char *text) -{ - int i; - - printf("%-23s:", label); - for (i=0; i #include "md5.h" - -#define ALIGN(x,a) ({ typeof(a) __a = (a); (((x) + __a - 1) & ~(__a - 1)); }) - -#define MD5SUM_LEN 16 - -struct file_info { - char *file_name; /* name of the file */ - uint32_t file_size; /* length of the file */ -}; +#include "mktplinkfw-lib.h" struct fw_header { uint32_t version; /* 0x00: header version */ @@ -68,14 +60,6 @@ struct fw_header { uint8_t pad[364]; } __attribute__ ((packed)); -struct flash_layout { - char *id; - uint32_t fw_max_len; - uint32_t kernel_la; - uint32_t kernel_ep; - uint32_t rootfs_ofs; -}; - #define FLAG_LE_KERNEL_LA_EP 0x00000001 /* Little-endian used for kernel load address & entry point */ struct board_info { @@ -91,8 +75,8 @@ struct board_info { /* * Globals */ -static char *ofname; -static char *progname; +char *ofname; +char *progname; static char *vendor = "TP-LINK Technologies"; static char *version = "ver. 1.0"; static char *fw_ver = "0.0.0"; @@ -101,10 +85,9 @@ static uint32_t hdr_ver = 2; static struct board_info custom_board; -static char *board_id; static struct board_info *board; static char *layout_id; -static struct flash_layout *layout; +struct flash_layout *layout; static char *opt_hw_id; static char *opt_hw_rev; static char *opt_hw_ver_add; @@ -113,18 +96,17 @@ static int fw_ver_mid; static int fw_ver_hi; static int sver_lo; static int sver_hi; -static struct file_info kernel_info; +struct file_info kernel_info; static uint32_t kernel_la = 0; static uint32_t kernel_ep = 0; -static uint32_t kernel_len = 0; -static struct file_info rootfs_info; -static uint32_t rootfs_ofs = 0; -static uint32_t rootfs_align; +uint32_t kernel_len = 0; +struct file_info rootfs_info; +uint32_t rootfs_ofs = 0; +uint32_t rootfs_align; static struct file_info boot_info; -static int combined; -static int strip_padding; -static int add_jffs2_eof; -static unsigned char jffs2_eof_mark[4] = {0xde, 0xad, 0xc0, 0xde}; +int combined; +int strip_padding; +int add_jffs2_eof; static struct file_info inspect_info; static int extract = 0; @@ -141,6 +123,12 @@ char md5salt_boot[MD5SUM_LEN] = { static struct flash_layout layouts[] = { { + .id = "4Mmtk", + .fw_max_len = 0x3c0000, + .kernel_la = 0x80000000, + .kernel_ep = 0x80000000, + .rootfs_ofs = 0x140000, + }, { .id = "8Mltq", .fw_max_len = 0x7a0000, .kernel_la = 0x80002000, @@ -169,129 +157,6 @@ static struct flash_layout layouts[] = { } }; -static struct board_info boards[] = { - { - .id = "TD-W8970v1", - .hw_id = 0x89700001, - .hw_rev = 1, - .layout_id = "8Mltq", - }, { - .id = "TD-W8980v1", - .hw_id = 0x89800001, - .hw_rev = 14, - .layout_id = "8Mltq", - }, { - .id = "ArcherC20i", - .hw_id = 0xc2000001, - .hw_rev = 58, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "ArcherVR200V", - .hw_id = 0x73b70801, - .hw_rev = 0x2f, - .layout_id = "16Mltq", - .hdr_ver = 2, - }, { - .id = "ArcherC50", - .hw_id = 0xc7500001, - .hw_rev = 69, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "ArcherMR200", - .hw_id = 0xd7500001, - .hw_rev = 0x4a, - .layout_id = "8MLmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "TL-WR840NV4", - .hw_id = 0x08400004, - .hw_rev = 0x1, - .hw_ver_add = 0x4, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - .id = "TL-WR841NV13", - .hw_id = 0x08410013, - .hw_rev = 0x268, - .hw_ver_add = 0x13, - .layout_id = "8Mmtk", - .hdr_ver = 3, - .flags = FLAG_LE_KERNEL_LA_EP, - }, { - /* terminating entry */ - } -}; - -/* - * Message macros - */ -#define ERR(fmt, ...) do { \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt "\n", \ - progname, ## __VA_ARGS__ ); \ -} while (0) - -#define ERRS(fmt, ...) do { \ - int save = errno; \ - fflush(0); \ - fprintf(stderr, "[%s] *** error: " fmt ": %s\n", \ - progname, ## __VA_ARGS__, strerror(save)); \ -} while (0) - -#define DBG(fmt, ...) do { \ - fprintf(stderr, "[%s] " fmt "\n", progname, ## __VA_ARGS__ ); \ -} while (0) - -static struct board_info *find_board(char *id) -{ - struct board_info *ret; - struct board_info *board; - - ret = NULL; - for (board = boards; board->id != NULL; board++){ - if (strcasecmp(id, board->id) == 0) { - ret = board; - break; - } - }; - - return ret; -} - -static struct board_info *find_board_by_hwid(uint32_t hw_id) -{ - struct board_info *board; - - for (board = boards; board->id != NULL; board++) { - if (hw_id == board->hw_id) - return board; - }; - - return NULL; -} - -static struct flash_layout *find_layout(char *id) -{ - struct flash_layout *ret; - struct flash_layout *l; - - ret = NULL; - for (l = layouts; l->id != NULL; l++){ - if (strcasecmp(id, l->id) == 0) { - ret = l; - break; - } - }; - - return ret; -} - static void usage(int status) { FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; @@ -301,7 +166,6 @@ static void usage(int status) fprintf(stream, "\n" "Options:\n" -" -B create image for the board specified with \n" " -c use combined kernel image\n" " -e swap endianness in kernel load address and entry point\n" " -E overwrite kernel entry point with (hexval prefixed with 0x)\n" @@ -330,59 +194,6 @@ static void usage(int status) exit(status); } -static int get_md5(char *data, int size, char *md5) -{ - MD5_CTX ctx; - - MD5_Init(&ctx); - MD5_Update(&ctx, data, size); - MD5_Final(md5, &ctx); -} - -static int get_file_stat(struct file_info *fdata) -{ - struct stat st; - int res; - - if (fdata->file_name == NULL) - return 0; - - res = stat(fdata->file_name, &st); - if (res){ - ERRS("stat failed on %s", fdata->file_name); - return res; - } - - fdata->file_size = st.st_size; - return 0; -} - -static int read_to_buf(struct file_info *fdata, char *buf) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(fdata->file_name, "r"); - if (f == NULL) { - ERRS("could not open \"%s\" for reading", fdata->file_name); - goto out; - } - - errno = 0; - fread(buf, fdata->file_size, 1, f); - if (errno != 0) { - ERRS("unable to read from file \"%s\"", fdata->file_name); - goto out_close; - } - - ret = EXIT_SUCCESS; - - out_close: - fclose(f); - out: - return ret; -} - static int check_options(void) { int ret; @@ -398,42 +209,29 @@ static int check_options(void) return -1; } - if (board_id == NULL && opt_hw_id == NULL) { - ERR("either board or hardware id must be specified"); + if (opt_hw_id == NULL) { + ERR("hardware id must be specified"); return -1; } - if (board_id) { - board = find_board(board_id); - if (board == NULL) { - ERR("unknown/unsupported board id \"%s\"", board_id); - return -1; - } - if (layout_id == NULL) - layout_id = board->layout_id; + board = &custom_board; - if (board->hdr_ver) - hdr_ver = board->hdr_ver; - } else { - board = &custom_board; - - if (layout_id == NULL) { - ERR("flash layout is not specified"); - return -1; - } - - board->hw_id = strtoul(opt_hw_id, NULL, 0); - - board->hw_rev = 1; - board->hw_ver_add = 0; + if (layout_id == NULL) { + ERR("flash layout is not specified"); + return -1; } + board->hw_id = strtoul(opt_hw_id, NULL, 0); + + board->hw_rev = 1; + board->hw_ver_add = 0; + if (opt_hw_rev) board->hw_rev = strtoul(opt_hw_rev, NULL, 0); if (opt_hw_ver_add) board->hw_ver_add = strtoul(opt_hw_ver_add, NULL, 0); - layout = find_layout(layout_id); + layout = find_layout(layouts, layout_id); if (layout == NULL) { ERR("unknown flash layout \"%s\"", layout_id); return -1; @@ -475,10 +273,10 @@ static int check_options(void) if (rootfs_align) { kernel_len += sizeof(struct fw_header); - kernel_len = ALIGN(kernel_len, rootfs_align); + rootfs_ofs = ALIGN(kernel_len, rootfs_align); kernel_len -= sizeof(struct fw_header); - DBG("kernel length aligned to %u", kernel_len); + DBG("rootfs offset aligned to 0x%u", rootfs_ofs); if (kernel_len + rootfs_info.file_size > layout->fw_max_len - sizeof(struct fw_header)) { @@ -520,7 +318,7 @@ static int check_options(void) return 0; } -static void fill_header(char *buf, int len) +void fill_header(char *buf, int len) { struct fw_header *hdr = (struct fw_header *)buf; unsigned ver_len; @@ -582,196 +380,6 @@ static void fill_header(char *buf, int len) get_md5(buf, len, hdr->md5sum1); } -static int pad_jffs2(char *buf, int currlen) -{ - int len; - uint32_t pad_mask; - - len = currlen; - pad_mask = (64 * 1024); - while ((len < layout->fw_max_len) && (pad_mask != 0)) { - uint32_t mask; - int i; - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if (pad_mask & mask) - break; - } - - len = ALIGN(len, mask); - - for (i = 10; i < 32; i++) { - mask = 1 << i; - if ((len & (mask - 1)) == 0) - pad_mask &= ~mask; - } - - for (i = 0; i < sizeof(jffs2_eof_mark); i++) - buf[len + i] = jffs2_eof_mark[i]; - - len += sizeof(jffs2_eof_mark); - } - - return len; -} - -static int write_fw(char *data, int len) -{ - FILE *f; - int ret = EXIT_FAILURE; - - f = fopen(ofname, "w"); - if (f == NULL) { - ERRS("could not open \"%s\" for writing", ofname); - goto out; - } - - errno = 0; - fwrite(data, len, 1, f); - if (errno) { - ERRS("unable to write output file"); - goto out_flush; - } - - DBG("firmware file \"%s\" completed", ofname); - - ret = EXIT_SUCCESS; - - out_flush: - fflush(f); - fclose(f); - if (ret != EXIT_SUCCESS) { - unlink(ofname); - } - out: - return ret; -} - -static int build_fw(void) -{ - int buflen; - char *buf; - char *p; - int ret = EXIT_FAILURE; - int writelen = 0; - - buflen = layout->fw_max_len; - - buf = malloc(buflen); - if (!buf) { - ERR("no memory for buffer\n"); - goto out; - } - - memset(buf, 0xff, buflen); - p = buf + sizeof(struct fw_header); - ret = read_to_buf(&kernel_info, p); - if (ret) - goto out_free_buf; - - writelen = sizeof(struct fw_header) + kernel_len; - - if (!combined) { - if (rootfs_align) - p = buf + writelen; - else - p = buf + rootfs_ofs; - - ret = read_to_buf(&rootfs_info, p); - if (ret) - goto out_free_buf; - - if (rootfs_align) - writelen += rootfs_info.file_size; - else - writelen = rootfs_ofs + rootfs_info.file_size; - - if (add_jffs2_eof) - writelen = pad_jffs2(buf, writelen); - } - - if (!strip_padding) - writelen = buflen; - - fill_header(buf, writelen); - ret = write_fw(buf, writelen); - if (ret) - goto out_free_buf; - - ret = EXIT_SUCCESS; - - out_free_buf: - free(buf); - out: - return ret; -} - -/* Helper functions to inspect_fw() representing different output formats */ -static inline void inspect_fw_pstr(char *label, char *str) -{ - printf("%-23s: %s\n", label, str); -} - -static inline void inspect_fw_phex(char *label, uint32_t val) -{ - printf("%-23s: 0x%08x\n", label, val); -} - -static inline void inspect_fw_phexpost(char *label, - uint32_t val, char *post) -{ - printf("%-23s: 0x%08x (%s)\n", label, val, post); -} - -static inline void inspect_fw_phexdef(char *label, - uint32_t val, uint32_t defval) -{ - printf("%-23s: 0x%08x ", label, val); - - if (val == defval) - printf("(== OpenWrt default)\n"); - else - printf("(OpenWrt default: 0x%08x)\n", defval); -} - -static inline void inspect_fw_phexexp(char *label, - uint32_t val, uint32_t expval) -{ - printf("%-23s: 0x%08x ", label, val); - - if (val == expval) - printf("(ok)\n"); - else - printf("(expected: 0x%08x)\n", expval); -} - -static inline void inspect_fw_phexdec(char *label, uint32_t val) -{ - printf("%-23s: 0x%08x / %8u bytes\n", label, val, val); -} - -static inline void inspect_fw_phexdecdef(char *label, - uint32_t val, uint32_t defval) -{ - printf("%-23s: 0x%08x / %8u bytes ", label, val, val); - - if (val == defval) - printf("(== OpenWrt default)\n"); - else - printf("(OpenWrt default: 0x%08x)\n", defval); -} - -static inline void inspect_fw_pmd5sum(char *label, uint8_t *val, char *text) -{ - int i; - - printf("%-23s:", label); - for (i=0; ihw_id)); - if (!board) - board = &custom_board; + board = &custom_board; if (board->flags & FLAG_LE_KERNEL_LA_EP) { hdr->kernel_la = bswap_32(hdr->kernel_la); @@ -844,23 +450,11 @@ static int inspect_fw(void) printf("\n"); inspect_fw_pstr("Firmware version", hdr->fw_version); - - if (board != &custom_board) { - layout = find_layout(board->layout_id); - inspect_fw_phexpost("Hardware ID", - ntohl(hdr->hw_id), board->id); - inspect_fw_phexexp("Hardware Revision", - ntohl(hdr->hw_rev), board->hw_rev); - inspect_fw_phexexp("Additional HW Version", - ntohl(hdr->hw_ver_add), board->hw_ver_add); - } else { - inspect_fw_phexpost("Hardware ID", - ntohl(hdr->hw_id), "unknown"); - inspect_fw_phex("Hardware Revision", - ntohl(hdr->hw_rev)); - inspect_fw_phex("Additional HW Version", - ntohl(hdr->hw_ver_add)); - } + inspect_fw_phex("Hardware ID", ntohl(hdr->hw_id)); + inspect_fw_phex("Hardware Revision", + ntohl(hdr->hw_rev)); + inspect_fw_phex("Additional HW Version", + ntohl(hdr->hw_ver_add)); printf("%-23s: %d.%d.%d-%d.%d\n", "Software version", hdr->ver_hi, hdr->ver_mid, hdr->ver_lo, @@ -872,24 +466,12 @@ static int inspect_fw(void) ntohl(hdr->kernel_ofs)); inspect_fw_phexdec("Kernel data length", ntohl(hdr->kernel_len)); - if (board != &custom_board) { - inspect_fw_phexdef("Kernel load address", - ntohl(hdr->kernel_la), - layout ? layout->kernel_la : 0xffffffff); - inspect_fw_phexdef("Kernel entry point", - ntohl(hdr->kernel_ep), - layout ? layout->kernel_ep : 0xffffffff); - inspect_fw_phexdecdef("Rootfs data offset", - ntohl(hdr->rootfs_ofs), - layout ? layout->rootfs_ofs : 0xffffffff); - } else { - inspect_fw_phex("Kernel load address", - ntohl(hdr->kernel_la)); - inspect_fw_phex("Kernel entry point", - ntohl(hdr->kernel_ep)); - inspect_fw_phexdec("Rootfs data offset", - ntohl(hdr->rootfs_ofs)); - } + inspect_fw_phex("Kernel load address", + ntohl(hdr->kernel_la)); + inspect_fw_phex("Kernel entry point", + ntohl(hdr->kernel_ep)); + inspect_fw_phexdec("Rootfs data offset", + ntohl(hdr->rootfs_ofs)); inspect_fw_phexdec("Rootfs data length", ntohl(hdr->rootfs_len)); inspect_fw_phexdec("Boot loader data offset", @@ -945,16 +527,13 @@ static int inspect_fw(void) int main(int argc, char *argv[]) { int ret = EXIT_FAILURE; - int err; - - FILE *outfile; progname = basename(argv[0]); while ( 1 ) { int c; - c = getopt(argc, argv, "a:B:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e"); + c = getopt(argc, argv, "a:H:E:F:L:V:N:W:w:ci:k:r:R:o:xhsjv:y:T:e"); if (c == -1) break; @@ -962,9 +541,6 @@ int main(int argc, char *argv[]) case 'a': sscanf(optarg, "0x%x", &rootfs_align); break; - case 'B': - board_id = optarg; - break; case 'H': opt_hw_id = optarg; break; @@ -1042,7 +618,7 @@ int main(int argc, char *argv[]) goto out; if (!inspect_info.file_name) - ret = build_fw(); + ret = build_fw(sizeof(struct fw_header)); else ret = inspect_fw(); diff --git a/tools/firmware-utils/src/otrx.c b/tools/firmware-utils/src/otrx.c new file mode 100644 index 000000000..223e032f2 --- /dev/null +++ b/tools/firmware-utils/src/otrx.c @@ -0,0 +1,592 @@ +/* + * otrx + * + * Copyright (C) 2015-2017 RafaÅ‚ MiÅ‚ecki + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#if !defined(__BYTE_ORDER) +#error "Unknown byte order" +#endif + +#if __BYTE_ORDER == __BIG_ENDIAN +#define cpu_to_le32(x) bswap_32(x) +#define le32_to_cpu(x) bswap_32(x) +#elif __BYTE_ORDER == __LITTLE_ENDIAN +#define cpu_to_le32(x) (x) +#define le32_to_cpu(x) (x) +#else +#error "Unsupported endianness" +#endif + +#define TRX_MAGIC 0x30524448 +#define TRX_FLAGS_OFFSET 12 +#define TRX_MAX_PARTS 3 + +struct trx_header { + uint32_t magic; + uint32_t length; + uint32_t crc32; + uint16_t flags; + uint16_t version; + uint32_t offset[3]; +}; + +char *trx_path; +size_t trx_offset = 0; +char *partition[TRX_MAX_PARTS] = {}; + +static inline size_t otrx_min(size_t x, size_t y) { + return x < y ? x : y; +} + +/************************************************** + * CRC32 + **************************************************/ + +static const uint32_t crc32_tbl[] = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, +}; + +uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { + while (len) { + crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); + buf++; + len--; + } + + return crc; +} + +/************************************************** + * Check + **************************************************/ + +static void otrx_check_parse_options(int argc, char **argv) { + int c; + + while ((c = getopt(argc, argv, "o:")) != -1) { + switch (c) { + case 'o': + trx_offset = atoi(optarg); + break; + } + } +} + +static int otrx_check(int argc, char **argv) { + FILE *trx; + struct trx_header hdr; + size_t bytes, length; + uint8_t buf[1024]; + uint32_t crc32; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + optind = 3; + otrx_check_parse_options(argc, argv); + + trx = fopen(trx_path, "r"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + + fseek(trx, trx_offset, SEEK_SET); + bytes = fread(&hdr, 1, sizeof(hdr), trx); + if (bytes != sizeof(hdr)) { + fprintf(stderr, "Couldn't read %s header\n", trx_path); + err = -EIO; + goto err_close; + } + + if (le32_to_cpu(hdr.magic) != TRX_MAGIC) { + fprintf(stderr, "Invalid TRX magic: 0x%08x\n", le32_to_cpu(hdr.magic)); + err = -EINVAL; + goto err_close; + } + + length = le32_to_cpu(hdr.length); + if (length < sizeof(hdr)) { + fprintf(stderr, "Length read from TRX too low (%zu B)\n", length); + err = -EINVAL; + goto err_close; + } + + crc32 = 0xffffffff; + fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; + } + + if (length) { + fprintf(stderr, "Couldn't read last %zd B of data from %s\n", length, trx_path); + err = -EIO; + goto err_close; + } + + if (crc32 != le32_to_cpu(hdr.crc32)) { + fprintf(stderr, "Invalid data crc32: 0x%08x instead of 0x%08x\n", crc32, le32_to_cpu(hdr.crc32)); + err = -EINVAL; + goto err_close; + } + + printf("Found a valid TRX version %d\n", le32_to_cpu(hdr.version)); + +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Create + **************************************************/ + +static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { + FILE *in; + size_t bytes; + ssize_t length = 0; + uint8_t buf[1024]; + + in = fopen(in_path, "r"); + if (!in) { + fprintf(stderr, "Couldn't open %s\n", in_path); + return -EACCES; + } + + while ((bytes = fread(buf, 1, sizeof(buf), in)) > 0) { + if (fwrite(buf, 1, bytes, trx) != bytes) { + fprintf(stderr, "Couldn't write %zu B to %s\n", bytes, trx_path); + length = -EIO; + break; + } + length += bytes; + } + + fclose(in); + + return length; +} + +static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { + uint8_t *buf; + + buf = malloc(length); + if (!buf) + return -ENOMEM; + memset(buf, 0, length); + + if (fwrite(buf, 1, length, trx) != length) { + fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); + free(buf); + return -EIO; + } + + free(buf); + + return length; +} + +static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment) { + if (curr_offset & (alignment - 1)) { + size_t length = alignment - (curr_offset % alignment); + return otrx_create_append_zeros(trx, length); + } + + return 0; +} + +static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { + size_t bytes, length; + uint8_t buf[1024]; + uint32_t crc32; + + hdr->magic = cpu_to_le32(TRX_MAGIC); + hdr->version = 1; + + fseek(trx, 0, SEEK_SET); + bytes = fwrite(hdr, 1, sizeof(struct trx_header), trx); + if (bytes != sizeof(struct trx_header)) { + fprintf(stderr, "Couldn't write TRX header to %s\n", trx_path); + return -EIO; + } + + length = le32_to_cpu(hdr->length); + + crc32 = 0xffffffff; + fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; + } + hdr->crc32 = cpu_to_le32(crc32); + + fseek(trx, 0, SEEK_SET); + bytes = fwrite(hdr, 1, sizeof(struct trx_header), trx); + if (bytes != sizeof(struct trx_header)) { + fprintf(stderr, "Couldn't write TRX header to %s\n", trx_path); + return -EIO; + } + + return 0; +} + +static int otrx_create(int argc, char **argv) { + FILE *trx; + struct trx_header hdr = {}; + ssize_t sbytes; + size_t curr_idx = 0; + size_t curr_offset = sizeof(hdr); + int c; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + trx = fopen(trx_path, "w+"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + fseek(trx, curr_offset, SEEK_SET); + + optind = 3; + while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { + switch (c) { + case 'f': + if (curr_idx >= TRX_MAX_PARTS) { + err = -ENOSPC; + fprintf(stderr, "Reached TRX partitions limit, no place for %s\n", optarg); + goto err_close; + } + + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + hdr.offset[curr_idx++] = curr_offset; + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + + break; + case 'A': + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'a': + sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'b': + sbytes = strtol(optarg, NULL, 0) - curr_offset; + if (sbytes < 0) { + fprintf(stderr, "Current TRX length is 0x%zx, can't pad it with zeros to 0x%lx\n", curr_offset, strtol(optarg, NULL, 0)); + } else { + sbytes = otrx_create_append_zeros(trx, sbytes); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + } + break; + } + if (err) + break; + } + + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + + hdr.length = curr_offset; + otrx_create_write_hdr(trx, &hdr); +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Extract + **************************************************/ + +static void otrx_extract_parse_options(int argc, char **argv) { + int c; + + while ((c = getopt(argc, argv, "c:e:o:1:2:3:")) != -1) { + switch (c) { + case 'o': + trx_offset = atoi(optarg); + break; + case '1': + partition[0] = optarg; + break; + case '2': + partition[1] = optarg; + break; + case '3': + partition[2] = optarg; + break; + } + } +} + +static int otrx_extract_copy(FILE *trx, size_t offset, size_t length, char *out_path) { + FILE *out; + size_t bytes; + uint8_t *buf; + int err = 0; + + out = fopen(out_path, "w"); + if (!out) { + fprintf(stderr, "Couldn't open %s\n", out_path); + err = -EACCES; + goto out; + } + + buf = malloc(length); + if (!buf) { + fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); + err = -ENOMEM; + goto err_close; + } + + fseek(trx, offset, SEEK_SET); + bytes = fread(buf, 1, length, trx); + if (bytes != length) { + fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); + err = -ENOMEM; + goto err_free_buf; + }; + + bytes = fwrite(buf, 1, length, out); + if (bytes != length) { + fprintf(stderr, "Couldn't write %zu B to %s\n", length, out_path); + err = -ENOMEM; + goto err_free_buf; + } + + printf("Extracted 0x%zx bytes into %s\n", length, out_path); + +err_free_buf: + free(buf); +err_close: + fclose(out); +out: + return err; +} + +static int otrx_extract(int argc, char **argv) { + FILE *trx; + struct trx_header hdr; + size_t bytes; + int i; + int err = 0; + + if (argc < 3) { + fprintf(stderr, "No TRX file passed\n"); + err = -EINVAL; + goto out; + } + trx_path = argv[2]; + + optind = 3; + otrx_extract_parse_options(argc, argv); + + trx = fopen(trx_path, "r"); + if (!trx) { + fprintf(stderr, "Couldn't open %s\n", trx_path); + err = -EACCES; + goto out; + } + + fseek(trx, trx_offset, SEEK_SET); + bytes = fread(&hdr, 1, sizeof(hdr), trx); + if (bytes != sizeof(hdr)) { + fprintf(stderr, "Couldn't read %s header\n", trx_path); + err = -EIO; + goto err_close; + } + + if (le32_to_cpu(hdr.magic) != TRX_MAGIC) { + fprintf(stderr, "Invalid TRX magic: 0x%08x\n", le32_to_cpu(hdr.magic)); + err = -EINVAL; + goto err_close; + } + + for (i = 0; i < TRX_MAX_PARTS; i++) { + size_t length; + + if (!partition[i]) + continue; + if (!hdr.offset[i]) { + printf("TRX doesn't contain partition %d, can't extract %s\n", i + 1, partition[i]); + continue; + } + + if (i + 1 >= TRX_MAX_PARTS || !hdr.offset[i + 1]) + length = le32_to_cpu(hdr.length) - le32_to_cpu(hdr.offset[i]); + else + length = le32_to_cpu(hdr.offset[i + 1]) - le32_to_cpu(hdr.offset[i]); + + otrx_extract_copy(trx, trx_offset + le32_to_cpu(hdr.offset[i]), length, partition[i]); + } + +err_close: + fclose(trx); +out: + return err; +} + +/************************************************** + * Start + **************************************************/ + +static void usage() { + printf("Usage:\n"); + printf("\n"); + printf("Checking TRX file:\n"); + printf("\totrx check [options]\tcheck if file is a valid TRX\n"); + printf("\t-o offset\t\t\toffset of TRX data in file (default: 0)\n"); + printf("\n"); + printf("Creating new TRX file:\n"); + printf("\totrx create [options] [partitions]\n"); + printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); + printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); + printf("\t-a alignment\t\t\t[partition] align current partition\n"); + printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); + printf("\n"); + printf("Extracting from TRX file:\n"); + printf("\totrx extract [options]\textract partitions from TRX file\n"); + printf("\t-o offset\t\t\toffset of TRX data in file (default: 0)\n"); + printf("\t-1 file\t\t\t\tfile to extract 1st partition to (optional)\n"); + printf("\t-2 file\t\t\t\tfile to extract 2nd partition to (optional)\n"); + printf("\t-3 file\t\t\t\tfile to extract 3rd partition to (optional)\n"); +} + +int main(int argc, char **argv) { + if (argc > 1) { + if (!strcmp(argv[1], "check")) + return otrx_check(argc, argv); + else if (!strcmp(argv[1], "create")) + return otrx_create(argc, argv); + else if (!strcmp(argv[1], "extract")) + return otrx_extract(argc, argv); + } + + usage(); + return 0; +} diff --git a/tools/firmware-utils/src/ptgen.c b/tools/firmware-utils/src/ptgen.c index 8466d35bc..13e0eda62 100644 --- a/tools/firmware-utils/src/ptgen.c +++ b/tools/firmware-utils/src/ptgen.c @@ -1,4 +1,4 @@ -/* +/* * ptgen - partition table generator * Copyright (C) 2006 by Felix Fietkau * @@ -9,12 +9,12 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -63,25 +63,26 @@ struct partinfo parts[4]; char *filename = NULL; -/* +/* * parse the size argument, which is either * a simple number (K assumed) or * K, M or G * * returns the size in KByte */ -static long to_kbytes(const char *string) { +static long to_kbytes(const char *string) +{ int exp = 0; long result; char *end; result = strtoul(string, &end, 0); switch (tolower(*end)) { - case 'k' : - case '\0' : exp = 0; break; - case 'm' : exp = 1; break; - case 'g' : exp = 2; break; - default: return 0; + case 'k' : + case '\0' : exp = 0; break; + case 'm' : exp = 1; break; + case 'g' : exp = 2; break; + default: return 0; } if (*end) @@ -99,9 +100,10 @@ static long to_kbytes(const char *string) { } /* convert the sector number into a CHS value for the partition table */ -static void to_chs(long sect, unsigned char chs[3]) { +static void to_chs(long sect, unsigned char chs[3]) +{ int c,h,s; - + s = (sect % sectors) + 1; sect = sect / sectors; h = sect % heads; @@ -116,10 +118,11 @@ static void to_chs(long sect, unsigned char chs[3]) { } /* round the sector number up to the next cylinder */ -static inline unsigned long round_to_cyl(long sect) { +static inline unsigned long round_to_cyl(long sect) +{ int cyl_size = heads * sectors; - return sect + cyl_size - (sect % cyl_size); + return sect + cyl_size - (sect % cyl_size); } /* round the sector number up to the kb_align boundary */ @@ -131,7 +134,7 @@ static inline unsigned long round_to_kb(long sect) { static int gen_ptable(uint32_t signature, int nr) { struct pte pte[4]; - unsigned long sect = 0; + unsigned long sect = 0; int i, fd, ret = -1, start, len; memset(pte, 0, sizeof(struct pte) * 4); @@ -140,22 +143,27 @@ static int gen_ptable(uint32_t signature, int nr) fprintf(stderr, "Invalid size in partition %d!\n", i); return -1; } + pte[i].active = ((i + 1) == active) ? 0x80 : 0; pte[i].type = parts[i].type; + start = sect + sectors; if (kb_align != 0) start = round_to_kb(start); pte[i].start = cpu_to_le32(start); + sect = start + parts[i].size * 2; if (kb_align == 0) sect = round_to_cyl(sect); pte[i].length = cpu_to_le32(len = sect - start); + to_chs(start, pte[i].chs_start); to_chs(start + len - 1, pte[i].chs_end); + if (verbose) - fprintf(stderr, "Partition %d: start=%ld, end=%ld, size=%ld\n", i, (long) start * 512, ((long) start + (long) len) * 512, (long) len * 512); - printf("%ld\n", ((long) start * 512)); - printf("%ld\n", ((long) len * 512)); + fprintf(stderr, "Partition %d: start=%ld, end=%ld, size=%ld\n", i, (long)start * 512, ((long)start + (long)len) * 512, (long)len * 512); + printf("%ld\n", (long)start * 512); + printf("%ld\n", (long)len * 512); } if ((fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644)) < 0) { @@ -179,7 +187,7 @@ static int gen_ptable(uint32_t signature, int nr) fprintf(stderr, "write failed.\n"); goto fail; } - + ret = 0; fail: close(fd); @@ -188,8 +196,8 @@ fail: static void usage(char *prog) { - fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); - exit(1); + fprintf(stderr, "Usage: %s [-v] -h -s -o [-a 0..4] [-l ] [[-t ] -p ...] \n", prog); + exit(EXIT_FAILURE); } int main (int argc, char **argv) @@ -208,29 +216,29 @@ int main (int argc, char **argv) verbose++; break; case 'h': - heads = (int) strtoul(optarg, NULL, 0); + heads = (int)strtoul(optarg, NULL, 0); break; case 's': - sectors = (int) strtoul(optarg, NULL, 0); + sectors = (int)strtoul(optarg, NULL, 0); break; case 'p': if (part > 3) { fprintf(stderr, "Too many partitions\n"); - exit(1); + exit(EXIT_FAILURE); } parts[part].size = to_kbytes(optarg); parts[part++].type = type; break; case 't': - type = (char) strtoul(optarg, NULL, 16); + type = (char)strtoul(optarg, NULL, 16); break; case 'a': - active = (int) strtoul(optarg, NULL, 0); + active = (int)strtoul(optarg, NULL, 0); if ((active < 0) || (active > 4)) active = 0; break; case 'l': - kb_align = (int) strtoul(optarg, NULL, 0) * 2; + kb_align = (int)strtoul(optarg, NULL, 0) * 2; break; case 'S': signature = strtoul(optarg, NULL, 0); @@ -241,8 +249,8 @@ int main (int argc, char **argv) } } argc -= optind; - if (argc || (heads <= 0) || (sectors <= 0) || !filename) + if (argc || (heads <= 0) || (sectors <= 0) || !filename) usage(argv[0]); - return gen_ptable(signature, part); + return gen_ptable(signature, part) ? EXIT_FAILURE : EXIT_SUCCESS; } diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c index 219d1985a..88e2e88bd 100644 --- a/tools/firmware-utils/src/tplink-safeloader.c +++ b/tools/firmware-utils/src/tplink-safeloader.c @@ -365,8 +365,8 @@ static struct device_info boards[] = { {"profile", 0x11700, 0x03900}, {"default-config", 0x15000, 0x04000}, {"user-config", 0x19000, 0x04000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x678000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x648000}, {"certyficate", 0x7e8000, 0x08000}, {"radio", 0x7f0000, 0x10000}, {NULL, 0, 0} @@ -439,8 +439,8 @@ static struct device_info boards[] = { {"profile", 0x11700, 0x03900}, {"default-config", 0x15000, 0x04000}, {"user-config", 0x19000, 0x04000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x678000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x648000}, {"certyficate", 0x7e8000, 0x08000}, {"radio", 0x7f0000, 0x10000}, {NULL, 0, 0} @@ -490,7 +490,14 @@ static struct device_info boards[] = { .id = "ARCHER-C7-V4", .support_list = "SupportList:\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:00000000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:41550000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:45550000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:4B520000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:42520000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:4A500000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:52550000}\n" + "{product_name:Archer C7,product_ver:4.0.0,special_id:54570000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:55530000}\n" "{product_name:Archer C7,product_ver:4.0.0,special_id:43410000}\n", .support_trail = '\x00', @@ -676,6 +683,42 @@ static struct device_info boards[] = { .last_sysupgrade_partition = "file-system" }, + /** Firmware layout for the TL-WR1043 v5 */ + { + .id = "TLWR1043NV5", + .vendor = "", + .support_list = + "SupportList:\n" + "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:45550000}\n" + "{product_name:TL-WR1043N,product_ver:5.0.0,special_id:55530000}\n", + .support_trail = '\x00', + .soft_ver = "soft_ver:1.0.0\n", + .partitions = { + {"factory-boot", 0x00000, 0x20000}, + {"fs-uboot", 0x20000, 0x20000}, + {"os-image", 0x40000, 0x180000}, + {"file-system", 0x1c0000, 0xd40000}, + {"default-mac", 0xf00000, 0x00200}, + {"pin", 0xf00200, 0x00200}, + {"device-id", 0xf00400, 0x00100}, + {"product-info", 0xf00500, 0x0fb00}, + {"soft-version", 0xf10000, 0x01000}, + {"extra-para", 0xf11000, 0x01000}, + {"support-list", 0xf12000, 0x0a000}, + {"profile", 0xf1c000, 0x04000}, + {"default-config", 0xf20000, 0x10000}, + {"user-config", 0xf30000, 0x40000}, + {"qos-db", 0xf70000, 0x40000}, + {"certificate", 0xfb0000, 0x10000}, + {"partition-table", 0xfc0000, 0x10000}, + {"log", 0xfd0000, 0x20000}, + {"radio", 0xff0000, 0x10000}, + {NULL, 0, 0} + }, + .first_sysupgrade_partition = "os-image", + .last_sysupgrade_partition = "file-system" + }, + /** Firmware layout for the TL-WR1043 v4 */ { .id = "TLWR1043NDV4", @@ -730,8 +773,8 @@ static struct device_info boards[] = { */ .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x160000}, - {"file-system", 0x180000, 0x5d0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x5b0000}, {"default-mac", 0x750000, 0x00200}, {"pin", 0x750200, 0x00200}, {"product-info", 0x750400, 0x0fc00}, @@ -763,8 +806,8 @@ static struct device_info boards[] = { .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0xcd0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0xca0000}, {"default-mac", 0xe40000, 0x00200}, {"pin", 0xe40200, 0x00200}, {"product-info", 0xe40400, 0x0fc00}, @@ -852,8 +895,8 @@ static struct device_info boards[] = { */ .partitions = { {"fs-uboot", 0x00000, 0x20000}, - {"os-image", 0x20000, 0x150000}, - {"file-system", 0x170000, 0x4a0000}, + {"os-image", 0x20000, 0x180000}, + {"file-system", 0x1a0000, 0x460000}, {"partition-table", 0x600000, 0x02000}, {"default-mac", 0x610000, 0x00020}, {"pin", 0x610100, 0x00020}, @@ -1254,7 +1297,9 @@ static void build_image(const char *output, parts[3] = read_file("os-image", kernel_image, false); parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof); - if (strcasecmp(info->id, "ARCHER-C25-V1") == 0) { + /* Some devices need the extra-para partition to accept the firmware */ + if (strcasecmp(info->id, "ARCHER-C25-V1") == 0 || + strcasecmp(info->id, "TLWR1043NV5") == 0) { const char mdat[11] = {0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; parts[5] = put_data("extra-para", mdat, 11); } else if (strcasecmp(info->id, "ARCHER-C7-V4") == 0) { diff --git a/tools/flex/Makefile b/tools/flex/Makefile index 1398b1ae5..1eff81f34 100644 --- a/tools/flex/Makefile +++ b/tools/flex/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=flex +PKG_CPE_ID:=cpe:/a:flex_project:flex PKG_VERSION:=2.6.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz diff --git a/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch b/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch new file mode 100644 index 000000000..7c3645c47 --- /dev/null +++ b/tools/flex/patches/200-build-AC_USE_SYSTEM_EXTENSIONS-in-configure.ac.patch @@ -0,0 +1,27 @@ +From 24fd0551333e7eded87b64dd36062da3df2f6380 Mon Sep 17 00:00:00 2001 +From: Explorer09 +Date: Mon, 4 Sep 2017 10:47:33 +0800 +Subject: [PATCH] build: AC_USE_SYSTEM_EXTENSIONS in configure.ac. + +This would, e.g. define _GNU_SOURCE in config.h, enabling the +reallocarray() prototype in glibc 2.26+ on Linux systems with that +version of glibc. + +Fixes #241. +--- + configure.ac | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/configure.ac ++++ b/configure.ac +@@ -25,8 +25,10 @@ + # autoconf requirements and initialization + + AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex]) ++AC_PREREQ([2.60]) + AC_CONFIG_SRCDIR([src/scan.l]) + AC_CONFIG_AUX_DIR([build-aux]) ++AC_USE_SYSTEM_EXTENSIONS + LT_INIT + AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects]) + AC_CONFIG_HEADER([src/config.h]) diff --git a/tools/gptfdisk/Makefile b/tools/gptfdisk/Makefile deleted file mode 100644 index dc5a5eb0d..000000000 --- a/tools/gptfdisk/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=gptfdisk -PKG_VERSION:=1.0.1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.rodsbooks.com/gdisk/ -PKG_HASH:=864c8aee2efdda50346804d7e6230407d5f42a8ae754df70404dd8b2fdfaeac7 - -HOST_BUILD_PARALLEL := 1 - -include $(INCLUDE_DIR)/host-build.mk - -HOST_CONFIGURE_VARS += \ - MAKEFLAGS="$(HOST_JOBS)" \ - CXXFLAGS="$(HOST_CFLAGS)" - -HOST_CONFIGURE_ARGS := \ - $(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \ - --prefix=$(STAGING_DIR_HOST) - -define Host/Compile - $(MAKE) LDFLAGS="$(HOST_LDFLAGS)" CXXFLAGS="$(HOST_CFLAGS) -I$(STAGING_DIR_HOST)/include/e2fsprogs" -C $(HOST_BUILD_DIR) sgdisk -endef - -define Host/Install - $(INSTALL_BIN) $(HOST_BUILD_DIR)/sgdisk $(STAGING_DIR_HOST)/bin/ -endef - -define Host/Clean - rm -f $(STAGING_DIR_HOST)/bin/sgdisk -endef - -HOSTCC := $(HOSTCC_NOCACHE) -HOSTCXX := $(HOSTCXX_NOCACHE) - -$(eval $(call HostBuild)) diff --git a/tools/libtool/Makefile b/tools/libtool/Makefile index 6526b28b1..dd4a7f638 100644 --- a/tools/libtool/Makefile +++ b/tools/libtool/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libtool +PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_VERSION:=2.4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/m4/Makefile b/tools/m4/Makefile index aa3c382f5..a6d931b0f 100644 --- a/tools/m4/Makefile +++ b/tools/m4/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=m4 +PKG_CPE_ID:=cpe:/a:gnu:m4 PKG_VERSION:=1.4.18 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz diff --git a/tools/mm-macros/Makefile b/tools/mm-macros/Makefile index a8a7bc137..d8f4a520b 100644 --- a/tools/mm-macros/Makefile +++ b/tools/mm-macros/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mm-macros -PKG_VERSION:=0.9.10 +PKG_VERSION:=0.9.11 PKG_SOURCE_URL:=@GNOME/mm-common/0.9 PKG_SOURCE:=mm-common-$(PKG_VERSION).tar.xz -PKG_HASH:=16c0e2bc196b67fbc145edaecb5dbe5818386504fe5703de27002d77140fa217 +PKG_HASH:=20d1e7466ca4c83c92e29f9e8dfcc8e5721fdf1337f53157bed97be3b73b32a8 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/mm-common-$(PKG_VERSION) diff --git a/tools/mpfr/Makefile b/tools/mpfr/Makefile index 91b5986f6..f3e337ada 100644 --- a/tools/mpfr/Makefile +++ b/tools/mpfr/Makefile @@ -7,12 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mpfr -PKG_VERSION:=3.1.5 +PKG_VERSION:=3.1.6 +PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr PKG_SOURCE_URL:=http://www.mpfr.org/mpfr-$(PKG_VERSION) \ @GNU/mpfr PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_HASH:=015fde82b3979fbe5f83501986d328331ba8ddf008c1ff3da3c238f49ca062bc +PKG_HASH:=7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950 HOST_BUILD_PARALLEL:=1 HOST_FIXUP:=autoreconf diff --git a/tools/mtd-utils/patches/120-include_sysmacros.patch b/tools/mtd-utils/patches/120-include_sysmacros.patch new file mode 100644 index 000000000..81ba1cfb2 --- /dev/null +++ b/tools/mtd-utils/patches/120-include_sysmacros.patch @@ -0,0 +1,25 @@ +From 9a06f45ec71116d76ee4b268ebe1b33d45b06fc0 Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Sat, 16 Apr 2016 22:10:43 -0400 +Subject: [PATCH mtd-utils] include sys/sysmacros.h for major/minor/makedev + +These functions have always been defined in sys/sysmacros.h under +Linux C libraries. For some, including sys/types.h implicitly +includes that as well, but glibc wants to deprecate that, and some +others already have. Include the header explicitly for the funcs. + +Signed-off-by: Mike Frysinger +--- + include/common.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/common.h ++++ b/include/common.h +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + #include "version.h" + + #ifndef PROGRAM_NAME diff --git a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch index 46014e7a3..70e6a7e36 100644 --- a/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch +++ b/tools/mtd-utils/patches/320-mkfs.jffs2-SOURCE_DATE_EPOCH.patch @@ -1,7 +1,5 @@ -Index: mtd-utils-1.5.2/mkfs.jffs2.c -=================================================================== ---- mtd-utils-1.5.2.orig/mkfs.jffs2.c -+++ mtd-utils-1.5.2/mkfs.jffs2.c +--- a/mkfs.jffs2.c ++++ b/mkfs.jffs2.c @@ -108,7 +108,7 @@ static char *rootdir = default_rootdir; static int verbose = 0; static int squash_uids = 0; diff --git a/tools/popt/Makefile b/tools/popt/Makefile deleted file mode 100644 index 7d1a1f8ef..000000000 --- a/tools/popt/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=popt -PKG_VERSION:=1.16 -PKG_HASH:=e728ed296fe9f069a0e005003c3d6b2dde3d9cad453422a10d6558616d304cc8 -PKG_RELEASE:=1 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://rpm5.org/files/popt/ -PKG_LICENSE:=MIT - -HOST_BUILD_PARALLEL:=1 - -include $(INCLUDE_DIR)/host-build.mk - -HOST_CONFIGURE_ARGS += --disable-shared --disable-nls -HOST_CFLAGS += $(FPIC) - -$(eval $(call HostBuild)) - diff --git a/tools/qemu/Makefile b/tools/qemu/Makefile index 3eac66f01..d63ab3482 100644 --- a/tools/qemu/Makefile +++ b/tools/qemu/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qemu +PKG_CPE_ID:=cpe:/a:qemu:qemu PKG_VERSION:=0.14.1 PKG_RELEASE:=1 diff --git a/tools/squashfs/Makefile b/tools/squashfs/Makefile index 87f6e8fd9..385cf69d9 100644 --- a/tools/squashfs/Makefile +++ b/tools/squashfs/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squashfs +PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs PKG_VERSION:=3.0 PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tar.gz diff --git a/tools/squashfs/patches/130-include_sysmacros.patch b/tools/squashfs/patches/130-include_sysmacros.patch new file mode 100644 index 000000000..f0149d6f6 --- /dev/null +++ b/tools/squashfs/patches/130-include_sysmacros.patch @@ -0,0 +1,20 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -25,6 +25,7 @@ + #define FALSE 0 + #include + #include ++#include + #include + #include + #include diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile index e2c9fc91c..e9e2b7ca9 100644 --- a/tools/squashfs4/Makefile +++ b/tools/squashfs4/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=squashfs4 +PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs PKG_VERSION:=4.2 PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz diff --git a/tools/squashfs4/patches/130-include_sysmacros.patch b/tools/squashfs4/patches/130-include_sysmacros.patch new file mode 100644 index 000000000..e8845130e --- /dev/null +++ b/tools/squashfs4/patches/130-include_sysmacros.patch @@ -0,0 +1,20 @@ +--- a/squashfs-tools/mksquashfs.c ++++ b/squashfs-tools/mksquashfs.c +@@ -33,6 +33,7 @@ + #include + #include + #include ++#include + #include + #include + #include +--- a/squashfs-tools/unsquashfs.c ++++ b/squashfs-tools/unsquashfs.c +@@ -30,6 +30,7 @@ + #include "xattr.h" + + #include ++#include + + struct cache *fragment_cache, *data_cache; + struct queue *to_reader, *to_deflate, *to_writer, *from_writer; diff --git a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch index ad69b190e..bc7d6c7a4 100644 --- a/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch +++ b/tools/squashfs4/patches/170-add_support_for_LZMA_MAGIC_to_unsqashfs.patch @@ -16,7 +16,7 @@ #define SQUASHFS_METADATA_LOG 13 --- a/squashfs-tools/unsquashfs.c +++ b/squashfs-tools/unsquashfs.c -@@ -1463,10 +1463,12 @@ int read_super(char *source) +@@ -1464,10 +1464,12 @@ int read_super(char *source) */ read_fs_bytes(fd, SQUASHFS_START, sizeof(struct squashfs_super_block), &sBlk_4); @@ -31,7 +31,7 @@ sBlk_4.s_minor == 0) { s_ops.squashfs_opendir = squashfs_opendir_4; s_ops.read_fragment = read_fragment_4; -@@ -1479,7 +1481,11 @@ int read_super(char *source) +@@ -1480,7 +1482,11 @@ int read_super(char *source) /* * Check the compression type */ @@ -44,7 +44,7 @@ return TRUE; } -@@ -1494,8 +1500,10 @@ int read_super(char *source) +@@ -1495,8 +1501,10 @@ int read_super(char *source) * Check it is a SQUASHFS superblock */ swap = 0; @@ -57,7 +57,7 @@ squashfs_super_block_3 sblk; ERROR("Reading a different endian SQUASHFS filesystem " "on %s\n", source); -@@ -1573,7 +1581,11 @@ int read_super(char *source) +@@ -1574,7 +1582,11 @@ int read_super(char *source) /* * 1.x, 2.x and 3.x filesystems use gzip compression. */ diff --git a/tools/squashfs4/patches/180-openbsd_compat.patch b/tools/squashfs4/patches/180-openbsd_compat.patch index b9c1b5925..4f7afd89c 100644 --- a/tools/squashfs4/patches/180-openbsd_compat.patch +++ b/tools/squashfs4/patches/180-openbsd_compat.patch @@ -8,8 +8,8 @@ +#include +#endif #include + #include #include - #include --- a/squashfs-tools/unsquashfs.h +++ b/squashfs-tools/unsquashfs.h @@ -25,6 +25,9 @@ diff --git a/tools/squashfs4/patches/190-no_nonstatic_inline.patch b/tools/squashfs4/patches/190-no_nonstatic_inline.patch index 27ebc6a26..8cab12083 100644 --- a/tools/squashfs4/patches/190-no_nonstatic_inline.patch +++ b/tools/squashfs4/patches/190-no_nonstatic_inline.patch @@ -1,6 +1,6 @@ --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -735,13 +735,13 @@ void cache_block_put(struct file_buffer +@@ -736,13 +736,13 @@ void cache_block_put(struct file_buffer + (((char *)A) - data_cache))) @@ -16,7 +16,7 @@ { pthread_mutex_lock(&progress_mutex); pthread_cond_signal(&progress_wait); -@@ -749,7 +749,7 @@ inline void update_progress_bar() +@@ -750,7 +750,7 @@ inline void update_progress_bar() } @@ -25,7 +25,7 @@ { TRACE("Waiting for thread %d\n", i); while(thread[i] != 0) -@@ -3358,7 +3358,7 @@ struct inode_info *lookup_inode(struct s +@@ -3359,7 +3359,7 @@ struct inode_info *lookup_inode(struct s } diff --git a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch index 5cec51f7b..7411b9784 100644 --- a/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch +++ b/tools/squashfs4/patches/200-add-fixed-timestamp-option.patch @@ -1,6 +1,6 @@ --- a/squashfs-tools/mksquashfs.c +++ b/squashfs-tools/mksquashfs.c -@@ -175,6 +175,9 @@ unsigned int cache_bytes = 0, cache_size +@@ -176,6 +176,9 @@ unsigned int cache_bytes = 0, cache_size /* inode lookup table */ squashfs_inode *inode_lookup_table = NULL; @@ -10,7 +10,7 @@ /* in memory directory data */ #define I_COUNT_SIZE 128 #define DIR_ENTRIES 32 -@@ -2452,6 +2455,8 @@ again: +@@ -2453,6 +2456,8 @@ again: restat: fstat(file, &buf2); close(file); @@ -19,7 +19,7 @@ if(read_size != buf2.st_size) { memcpy(buf, &buf2, sizeof(struct stat)); file_buffer->error = 2; -@@ -3612,7 +3617,7 @@ void dir_scan(squashfs_inode *inode, cha +@@ -3613,7 +3618,7 @@ void dir_scan(squashfs_inode *inode, cha buf.st_mode = S_IRWXU | S_IRWXG | S_IRWXO | S_IFDIR; buf.st_uid = getuid(); buf.st_gid = getgid(); @@ -28,7 +28,7 @@ buf.st_dev = 0; buf.st_ino = 0; dir_ent->inode = lookup_inode(&buf); -@@ -3623,6 +3628,8 @@ void dir_scan(squashfs_inode *inode, cha +@@ -3624,6 +3629,8 @@ void dir_scan(squashfs_inode *inode, cha pathname, strerror(errno)); return; } @@ -37,7 +37,7 @@ dir_ent->inode = lookup_inode(&buf); } -@@ -3677,6 +3684,8 @@ struct dir_info *dir_scan1(char *pathnam +@@ -3678,6 +3685,8 @@ struct dir_info *dir_scan1(char *pathnam filename, strerror(errno)); continue; } @@ -46,7 +46,7 @@ if((buf.st_mode & S_IFMT) != S_IFREG && (buf.st_mode & S_IFMT) != S_IFDIR && -@@ -3795,7 +3804,7 @@ struct dir_info *dir_scan2(struct dir_in +@@ -3796,7 +3805,7 @@ struct dir_info *dir_scan2(struct dir_in buf.st_gid = pseudo_ent->dev->gid; buf.st_rdev = makedev(pseudo_ent->dev->major, pseudo_ent->dev->minor); @@ -55,7 +55,7 @@ buf.st_ino = pseudo_ino ++; if(pseudo_ent->dev->type == 'f') { -@@ -4674,6 +4683,15 @@ int main(int argc, char *argv[]) +@@ -4675,6 +4684,15 @@ int main(int argc, char *argv[]) progress = FALSE; else if(strcmp(argv[i], "-no-exports") == 0) exportable = FALSE; @@ -71,7 +71,7 @@ else if(strcmp(argv[i], "-processors") == 0) { if((++i == argc) || (processors = strtol(argv[i], &b, 10), *b != '\0')) { -@@ -5314,7 +5332,7 @@ printOptions: +@@ -5315,7 +5333,7 @@ printOptions: sBlk.flags = SQUASHFS_MKFLAGS(noI, noD, noF, noX, no_fragments, always_use_fragments, duplicate_checking, exportable, no_xattrs, comp_opts); diff --git a/tools/sstrip/src/sstrip.c b/tools/sstrip/src/sstrip.c index 0508aaac8..12cf12e09 100644 --- a/tools/sstrip/src/sstrip.c +++ b/tools/sstrip/src/sstrip.c @@ -59,6 +59,7 @@ #include #include #include +#include #ifndef TRUE #define TRUE 1 @@ -103,7 +104,7 @@ static int do_reverse_endian; } else if (sizeof(X) == 8) { \ __res = bswap_64((X)); \ } else { \ - fprintf(stderr, "%s: %s: EGET failed for size %d\n", \ + fprintf(stderr, "%s: %s: EGET failed for size %zu\n", \ progname, filename, sizeof(X)); \ exit(EXIT_FAILURE); \ } \ @@ -124,7 +125,7 @@ static int do_reverse_endian; } else if (sizeof(Y) == 8) { \ Y = bswap_64((uint64_t)(X)); \ } else { \ - fprintf(stderr, "%s: %s: ESET failed for size %d\n", \ + fprintf(stderr, "%s: %s: ESET failed for size %zu\n", \ progname, filename, sizeof(Y)); \ exit(EXIT_FAILURE); \ } while (0) @@ -197,7 +198,7 @@ static int getmemorysize ## CLASS (Elf ## CLASS ## _Ehdr const *ehdr, \ { \ Elf ## CLASS ## _Phdr const *phdr; \ unsigned long size, n; \ - int i; \ + size_t i; \ \ /* Start by setting the size to include the ELF header and the \ * complete program segment header table. \ @@ -230,7 +231,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \ unsigned long newsize) \ { \ Elf ## CLASS ## _Phdr *phdr; \ - int i; \ + size_t i; \ \ /* If the section header table is gone, then remove all references \ * to it in the ELF header. \ diff --git a/tools/tar/Makefile b/tools/tar/Makefile index 5cb695f8b..10a4a8978 100644 --- a/tools/tar/Makefile +++ b/tools/tar/Makefile @@ -7,6 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=tar +PKG_CPE_ID:=cpe:/a:gnu:tar PKG_VERSION:=1.29 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 From 001008e6dac80d05e319d333ae03a00785c7ca2f Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 14:42:15 +0800 Subject: [PATCH 58/95] remove Xunlei black list for Adbyby Plus --- package/lean/luci-app-adbyby-plus/Makefile | 2 +- .../luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile index 9670bf307..752afd8cf 100644 --- a/package/lean/luci-app-adbyby-plus/Makefile +++ b/package/lean/luci-app-adbyby-plus/Makefile @@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_NAME:=luci-app-adbyby-plus PKG_VERSION:=2.0 -PKG_RELEASE:=25 +PKG_RELEASE:=26 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf index 4a0b2b05c..a532f5825 100644 --- a/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf +++ b/package/lean/luci-app-adbyby-plus/root/usr/share/adbyby/adblack.conf @@ -1,8 +1,4 @@ gvod.aiseejapp.atianqi.com -home.xl9.xunlei.com -hub5btmain.sandai.net -hub5emu.sandai.net -upgrade.xl9.xunlei.com stat.pandora.xiaomi.com upgrade.mishop.pandora.xiaomi.com logonext.tv.kuyun.com From 57380ef084c06777d06e0ff042ab809d9a1cb0d8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 14:43:11 +0800 Subject: [PATCH 59/95] Update version to R7.5.2 --- package/lean/default-settings/Makefile | 2 +- package/lean/default-settings/files/zzz-default-settings | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index b1e4f1951..7a0e87071 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=28 +PKG_RELEASE:=29 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index 55868f54e..23ca2e27e 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -47,7 +47,7 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.5.1 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5.2 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release echo "DISTRIB_DESCRIPTION='OpenWrt 17.01.4'" >> /etc/openwrt_release From 079e30f1df29581a1685e4af0c2e3ebf1774d0a4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 15:27:29 +0800 Subject: [PATCH 60/95] add new Kconfig for 4.9.73 --- target/linux/generic/config-4.9 | 55 +++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 10 deletions(-) diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 6a703c0a0..5d63c75c3 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -19,6 +19,7 @@ CONFIG_32BIT=y # CONFIG_ACPI_CUSTOM_METHOD is not set # CONFIG_ACPI_EXTLOG is not set # CONFIG_ACPI_HED is not set +# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set # CONFIG_ACPI_TABLE_UPGRADE is not set # CONFIG_ACPI_VIDEO is not set @@ -90,7 +91,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFE4403 is not set @@ -310,6 +311,8 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_PATCH_PHYS_VIRT is not set # CONFIG_ARM_PSCI is not set # CONFIG_ARM_PTDUMP is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_ARM_SCPI_PROTOCOL is not set # CONFIG_ARM_TIMER_SP804 is not set # CONFIG_ARM_UNWIND is not set # CONFIG_ARM_VIRT_EXT is not set @@ -323,6 +326,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ASYNC_TX_DMA is not set # CONFIG_AT76C50X_USB is not set # CONFIG_AT803X_PHY is not set +# CONFIG_AT91_SAMA5D2_ADC is not set # CONFIG_ATA is not set # CONFIG_ATAGS is not set CONFIG_ATAGS_PROC=y @@ -999,8 +1003,7 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set -CONFIG_DEFAULT_BBR=y -# CONFIG_DEFAULT_CUBIC is not set +CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_IOSCHED="deadline" @@ -1009,8 +1012,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_RENO is not set CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="bbr" -# CONFIG_DEFAULT_VEGAS is not set +CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_RBTN is not set # CONFIG_DELL_SMO8800 is not set @@ -1324,6 +1326,7 @@ CONFIG_FRAME_WARN=1024 # CONFIG_FRONTSWAP is not set # CONFIG_FSCACHE is not set # CONFIG_FSL_EDMA is not set +# CONFIG_FSL_MC_BUS is not set # CONFIG_FSL_PQ_MDIO is not set # CONFIG_FSL_XGMAC_MDIO is not set CONFIG_FSNOTIFY=y @@ -1382,14 +1385,19 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_ALTERA is not set # CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_AMDPT is not set # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CS5535 is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EM is not set +# CONFIG_GPIO_F7188X is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_GPIO_MM is not set # CONFIG_GPIO_GRGPIO is not set # CONFIG_GPIO_ICH is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MAX732X is not set @@ -1415,6 +1423,7 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_VX855 is not set # CONFIG_GPIO_WATCHDOG is not set +# CONFIG_GPIO_WS16C48 is not set # CONFIG_GPIO_XGENE is not set # CONFIG_GPIO_XILINX is not set # CONFIG_GPIO_ZEVIO is not set @@ -1884,6 +1893,7 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_MATCH_RT is not set # CONFIG_IP6_NF_NAT is not set # CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set # CONFIG_IP6_NF_TARGET_HL is not set # CONFIG_IP6_NF_TARGET_REJECT is not set # CONFIG_IP6_NF_TARGET_SYNPROXY is not set @@ -2037,6 +2047,7 @@ CONFIG_JOLIET=y CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KCOV is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set @@ -2186,6 +2197,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LIBIPW_DEBUG is not set # CONFIG_LIBNVDIMM is not set # CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_LIQUIDIO is not set # CONFIG_LIRC_STAGING is not set # CONFIG_LIS3L02DQ is not set # CONFIG_LKDTM is not set @@ -2629,6 +2641,7 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_SPINAND_MT29F is not set # CONFIG_MTD_SPI_NOR is not set # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set # CONFIG_MTD_SPLIT_EVA_FW is not set @@ -2949,11 +2962,12 @@ CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_V4_1 is not set # CONFIG_NFTL is not set +# CONFIG_NFT_BRIDGE_META is not set +# CONFIG_NFT_BRIDGE_REJECT is not set # CONFIG_NFT_DUP_IPV4 is not set # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3116,6 +3130,7 @@ CONFIG_PACKET=y CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PALMAS_GPADC is not set # CONFIG_PANASONIC_LAPTOP is not set # CONFIG_PANEL is not set CONFIG_PANIC_ON_OOPS=y @@ -3207,6 +3222,8 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set # CONFIG_PCI_HERMES is not set # CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_IOV is not set # CONFIG_PCI_LAYERSCAPE is not set # CONFIG_PCI_MSI is not set @@ -3286,6 +3303,7 @@ CONFIG_PINMUX=y # CONFIG_POWERCAP is not set # CONFIG_POWER_AVS is not set # CONFIG_POWER_RESET is not set +# CONFIG_POWER_RESET_BRCMKONA is not set # CONFIG_POWER_RESET_BRCMSTB is not set # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -3902,6 +3920,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_W83795 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_XGENE is not set CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_ACCENT is not set # CONFIG_SERIAL_8250_BOCA is not set @@ -3929,6 +3948,7 @@ CONFIG_SERIAL_8250_NR_UARTS=2 CONFIG_SERIAL_8250_RUNTIME_UARTS=2 # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_AMBA_PL010 is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_BCM63XX is not set # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set @@ -3984,7 +4004,6 @@ CONFIG_SHMEM=y # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set # CONFIG_SH_TIMER_TMU is not set -# CONFIG_SHORTCUT_FE is not set # CONFIG_SI1145 is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -4068,6 +4087,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_ECHO3G is not set +# CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_EMU10K1_SEQ is not set @@ -4272,6 +4292,7 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_WM8804_I2C is not set # CONFIG_SND_SOC_WM8804_SPI is not set # CONFIG_SND_SOC_WM8903 is not set +# CONFIG_SND_SOC_WM8960 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -4339,6 +4360,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set # CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set # CONFIG_SPI_DESIGNWARE is not set # CONFIG_SPI_FSL_DSPI is not set @@ -4481,7 +4503,7 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_XEN is not set # CONFIG_TCIC is not set CONFIG_TCP_CONG_ADVANCED=y -CONFIG_TCP_CONG_BBR=y +# CONFIG_TCP_CONG_BBR is not set # CONFIG_TCP_CONG_BIC is not set # CONFIG_TCP_CONG_CDG is not set CONFIG_TCP_CONG_CUBIC=y @@ -4493,10 +4515,10 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_CONG_LP is not set # CONFIG_TCP_CONG_NV is not set # CONFIG_TCP_CONG_SCALABLE is not set -CONFIG_TCP_CONG_VEGAS=y +# CONFIG_TCP_CONG_VEGAS is not set # CONFIG_TCP_CONG_VENO is not set # CONFIG_TCP_CONG_WESTWOOD is not set -CONFIG_TCP_CONG_YEAH=y +# CONFIG_TCP_CONG_YEAH is not set # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set @@ -4537,6 +4559,10 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_THUNDER_NIC_VF is not set # CONFIG_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y @@ -4589,6 +4615,8 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set # CONFIG_TOUCHSCREEN_ELAN is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_FT6236 is not set @@ -4601,15 +4629,20 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set # CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MK712 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set # CONFIG_TOUCHSCREEN_S3C2410 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set # CONFIG_TOUCHSCREEN_ST1232 is not set # CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set # CONFIG_TOUCHSCREEN_SX8654 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set @@ -4729,6 +4762,7 @@ CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_EG20T is not set # CONFIG_USB_EHCI_ATH79 is not set # CONFIG_USB_EHCI_HCD_AT91 is not set +# CONFIG_USB_EHCI_HCD_OMAP is not set # CONFIG_USB_EHCI_HCD_PPC_OF is not set # CONFIG_USB_EHCI_MSM is not set # CONFIG_USB_EHCI_MV is not set @@ -5281,3 +5315,4 @@ CONFIG_ZONE_DMA=y # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set +# CONFIG_SHORTCUT_FE is not set \ No newline at end of file From d196cfe83107fc5ba5be23d328db87e7a78a6196 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 17:26:16 +0800 Subject: [PATCH 61/95] add ASUS RT-ACRH17 wireless support --- config/Config-images.in | 1 + .../ipq806x/base-files/etc/board.d/01_leds | 11 +- .../ipq806x/base-files/etc/board.d/02_network | 10 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 12 +- .../lib/preinit/06_set_iface_mac.sh | 19 ++ .../base-files/lib/upgrade/platform.sh | 12 +- .../arm/boot/dts/qcom-ipq4019-rt-acrh17.dts | 296 ++++++++++-------- target/linux/ipq806x/image/Makefile | 2 +- 8 files changed, 219 insertions(+), 144 deletions(-) create mode 100644 target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh diff --git a/config/Config-images.in b/config/Config-images.in index 607659114..1ea33182b 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -18,6 +18,7 @@ menu "Target Images" default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx + default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ipq806x default TARGET_INITRAMFS_COMPRESSION_NONE depends on TARGET_ROOTFS_INITRAMFS help diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index a5b6bfc03..3b22f8a67 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -35,7 +35,16 @@ nbg6817) ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ;; -rt-acrh17 |\ +rt-acrh17) + ucidef_set_led_default "status" "STATUS" "${board}:blue:status" "1" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "${board}:blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "${board}:blue:wlan5g" "phy1tpt" + ucidef_set_led_switch "wan" "WAN(blue)" "${board}:blue:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "${board}:blue:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "${board}:blue:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "${board}:blue:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "${board}:blue:lan4" "switch0" "0x10" + ;; rt-ac58u) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 9d5ba2d68..c1428f40b 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -53,7 +53,15 @@ nbg6817) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ;; -rt-acrh17 |\ +rt-acrh17) + CI_UBIPART=UBI_DEV + lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102) + wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 36870) + ucidef_add_switch "switch0" \ + "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + ucidef_set_interface_macaddr "lan" "$lan_mac_addr" + ucidef_set_interface_macaddr "wan" "$wan_mac_addr" + ;; rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9557b539a..055af39a7 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -62,7 +62,11 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in - rt-acrh17 |\ + rt-acrh17) + CI_UBIPART=UBI_DEV + . /lib/upgrade/nand.sh + ath10kcal_ubi_extract "Factory" 4096 12064 + ;; rt-ac58u) . /lib/upgrade/nand.sh @@ -76,7 +80,6 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in - rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -91,6 +94,11 @@ case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + rt-acrh17) + CI_UBIPART=UBI_DEV + . /lib/upgrade/nand.sh + ath10kcal_ubi_extract "Factory" 36864 12064 + ;; c2600) ath10kcal_extract "radio" 4096 12064 # ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1) diff --git a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh new file mode 100644 index 000000000..d08f26558 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh @@ -0,0 +1,19 @@ +# +# Copyright (C) 2014-2015 OpenWrt.org +# Copyright (C) 2016 LEDE-Project.org +# + +preinit_set_mac_address() { + local mac + + . /lib/functions.sh + + case $(board_name) in + rt-acrh17) + CI_UBIPART=UBI_DEV + mac=$(mtd_get_mac_binary_ubi Factory 4102) + ifconfig eth0 hw ether $mac 2>/dev/null + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index cf046800d..e25aeb533 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -8,7 +8,17 @@ platform_check_image() { local board=$(board_name) case "$board" in - rt-acrh17 |\ + rt-acrh17) + CI_UBIPART="UBI_DEV" + CI_KERNPART="linux" + + local ubidev=$(nand_find_ubi $CI_UBIPART) + local jffs2=$(nand_find_volume $ubidev jffs2) + local linux2=$(nand_find_volume $ubidev linux2) + [ -n "$jffs2" ] && ubirmvol /dev/$ubidev --name=jffs2 + [ -n "$linux2" ] && ubirmvol /dev/$ubidev --name=linux2 + nand_do_upgrade "$1" + ;; rt-ac58u) CI_UBIPART="UBI_DEV" local ubidev=$(nand_find_ubi $CI_UBIPART) diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts index c68cc0e9e..beace8ecf 100644 --- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -14,7 +14,7 @@ * */ -#include "qcom-ipq4019-ap.dk01.1.dtsi" +#include "qcom-ipq4019-ap.dk04.1.dtsi" #include "qcom-ipq4019-bus.dtsi" #include #include @@ -48,6 +48,91 @@ }; soc { + spi_0: spi@78b5000 { + status = "disabled"; + }; + + pcie0: qcom,pcie@80000 { + compatible = "qcom,msm_pcie"; + cell-index = <0>; + qcom,ctrl-amt = <1>; + + reg = <0x80000 0x2000>, + <0x99000 0x800>, + <0x40000000 0xf1d>, + <0x40000f20 0xa8>, + <0x40100000 0x1000>, + <0x40200000 0x100000>, + <0x40300000 0xd00000>; + reg-names = "parf", "phy", "dm_core", "elbi", + "conf", "io", "bars"; + + #address-cells = <0>; + interrupt-parent = <&pcie0>; + interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12>; + #interrupt-cells = <1>; + interrupt-map-mask = <0xffffffff>; + interrupt-map = <0 &intc 0 141 0 + 1 &intc 0 142 0 + 2 &intc 0 143 0 + 3 &intc 0 144 0 + 4 &intc 0 145 0 + 5 &intc 0 146 0 + 6 &intc 0 147 0 + 7 &intc 0 148 0 + 8 &intc 0 149 0 + 9 &intc 0 150 0 + 10 &intc 0 151 0 + 11 &intc 0 152 0 >; + + interrupt-names = "int_msi", "int_a", "int_b", "int_c", "int_d", + "int_pls_pme", "int_pme_legacy", "int_pls_err", + "int_aer_legacy", "int_pls_link_up", + "int_pls_link_down", "int_bridge_flush_n","int_wake"; + + qcom,ep-latency = <10>; + + clocks = <&gcc GCC_PCIE_AHB_CLK>, + <&gcc GCC_PCIE_AXI_M_CLK>, + <&gcc GCC_PCIE_AXI_S_CLK>; + + clock-names = "pcie_0_cfg_ahb_clk", + "pcie_0_mstr_axi_clk", + "pcie_0_slv_axi_clk"; + + max-clock-frequency-hz = <0>, <0>, <0>; + + resets = <&gcc PCIE_AXI_M_ARES>, + <&gcc PCIE_AXI_S_ARES>, + <&gcc PCIE_PIPE_ARES>, + <&gcc PCIE_AXI_M_VMIDMT_ARES>, + <&gcc PCIE_AXI_S_XPU_ARES>, + <&gcc PCIE_PARF_XPU_ARES>, + <&gcc PCIE_PHY_ARES>, + <&gcc PCIE_AXI_M_STICKY_ARES>, + <&gcc PCIE_PIPE_STICKY_ARES>, + <&gcc PCIE_PWR_ARES>, + <&gcc PCIE_AHB_ARES>, + <&gcc PCIE_PHY_AHB_ARES>; + + reset-names = "pcie_rst_axi_m_ares", + "pcie_rst_axi_s_ares", + "pcie_rst_pipe_ares", + "pcie_rst_axi_m_vmidmt_ares", + "pcie_rst_axi_s_xpu_ares", + "pcie_rst_parf_xpu_ares", + "pcie_rst_phy_ares", + "pcie_rst_axi_m_sticky_ares", + "pcie_rst_pipe_sticky_ares", + "pcie_rst_pwr_ares", + "pcie_rst_ahb_res", + "pcie_rst_phy_ahb_ares"; + + status = "ok"; + perst-gpio = <&tlmm 38 0>; + wake-gpio = <&tlmm 50 0>; + clkreq-gpio = <&tlmm 39 0>; + }; tcsr@194b000 { /* select hostmode */ @@ -63,7 +148,6 @@ qcom,ess-interface-select = ; }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -76,11 +160,6 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; - counter@4a1000 { - compatible = "qcom,qca-gcnt"; - reg = <0x4a1000 0x4>; - }; - mdio@90000 { status = "okay"; }; @@ -97,20 +176,20 @@ status = "okay"; }; - wifi@a000000 { - status = "okay"; + wifi0: wifi@a000000 { + status = "ok"; + core-id = <0x0>; + qca,msi_addr = <0x0b006040>; + qca,msi_base = <0x40>; + wifi_led_num = <2>; /* Wifi 2G */ + wifi_led_source = <0>; /* source id 0 */ + qcom,mtd-name = "0:ART"; + qcom,cal-offset = <0x1000>; + qcom,cal-len = <12064>; }; - wifi@a800000 { - status = "okay"; - }; - - cryptobam: dma@8e04000 { - status = "okay"; - }; - - crypto@8e3a000 { - status = "okay"; + wifi1: wifi@a800000 { + status = "disabled"; }; }; @@ -119,13 +198,13 @@ reset { label = "reset"; - gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; linux,code = ; }; wps { label = "wps"; - gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; linux,code = ; }; }; @@ -135,137 +214,78 @@ power: status { label = "rt-acrh17:blue:status"; - gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; }; - wan { + lan1 { + label = "rt-acrh17:blue:lan1"; + gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "rt-acrh17:blue:lan2"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "rt-acrh17:blue:lan3"; + gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "rt-acrh17:blue:lan4"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + }; + + wan_blue { label = "rt-acrh17:blue:wan"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; }; - wlan2G { - label = "rt-acrh17:blue:wlan2G"; - gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + wan_red { + label = "rt-acrh17:red:wan"; + gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; }; - wan5G { - label = "rt-acrh17:blue:wlan5G"; - gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + wlan2g { + label = "rt-acrh17:blue:wlan2g"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; }; - usb { - label = "rt-acrh17:blue:usb"; - gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; - }; - - lan { - label = "rt-acrh17:blue:lan"; - gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + wlan5g { + label = "rt-acrh17:blue:wlan5g"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; }; }; }; -&spi_0_pins { - pinmux_cs { - function = "gpio"; - pins = "gpio54", "gpio59"; +&nand_pins { + pullups { + pins = "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; }; - pinconf_cs { - pins = "gpio54", "gpio59"; - drive-strength = <2>; + + pulldowns { + pins = "gpio55", "gpio56", + "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio69"; + function = "qpic"; + bias-pull-down; + }; +}; + +&i2c_0_pins { + pinmux { + function = "blsp_i2c0"; + pins = "gpio10"; + }; + pinconf { + pins = "gpio10"; + drive-strength = <16>; bias-disable; - output-high; - }; -}; - - -&spi_0 { /* BLSP1 QUP1 */ - status = "ok"; - cs-gpios = <&tlmm 54 0>, - <&tlmm 59 0>; - - mx25l25635e@0 { - status = "disabled"; - }; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <0>; - /* - * U-boot looks for "n25q128a11" node, - * if we don't have it, it will spit out the following warning: - * "ipq: fdt fixup unable to find compatible node". - */ - compatible = "mx25l1606e", "n25q128a11", "jedec,spi-nor"; - reg = <0>; - linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "SBL1"; - reg = <0x00000000 0x00040000>; - read-only; - }; - partition1@40000 { - label = "MIBIB"; - reg = <0x00040000 0x00020000>; - read-only; - }; - partition2@60000 { - label = "QSEE"; - reg = <0x00060000 0x00060000>; - read-only; - }; - partition3@c0000 { - label = "CDT"; - reg = <0x000c0000 0x00010000>; - read-only; - }; - partition4@d0000 { - label = "DDRPARAMS"; - reg = <0x000d0000 0x00010000>; - read-only; - }; - partition5@e0000 { - label = "APPSBLENV"; /* uboot env*/ - reg = <0x000e0000 0x00010000>; - read-only; - }; - partition5@f0000 { - label = "APPSBL"; /* uboot */ - reg = <0x000f0000 0x00080000>; - read-only; - }; - partition5@170000 { - label = "ART"; - reg = <0x00170000 0x00010000>; - read-only; - }; - /* 0x00180000 - 0x00200000 unused */ - }; - }; - - mt29f@1 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "spinand,mt29f", "w25n01gv"; - reg = <1>; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "ubi"; - reg = <0x00000000 0x08000000>; - }; - }; }; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index c79afb9d7..a9353ec77 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -267,7 +267,7 @@ define Device/RT-ACRH17 IMAGES = sysupgrade.tar flash-factory.trx IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984 + DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ath10k-firmware-qca4019 ath10k-firmware-qca9984 endef define Device/NBG6817 From 8e8bb9903ef5ac0519eee66a3c042ab0984e36ca Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 20:42:13 +0800 Subject: [PATCH 62/95] review kernel settings --- target/linux/generic/config-4.4 | 1 + target/linux/generic/config-4.9 | 55 ++++++--------------------------- 2 files changed, 11 insertions(+), 45 deletions(-) diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index 980a7871e..99cc012e7 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -4855,3 +4855,4 @@ CONFIG_ZONE_DMA_FLAG=1 # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set +# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set \ No newline at end of file diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 5d63c75c3..6a703c0a0 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -19,7 +19,6 @@ CONFIG_32BIT=y # CONFIG_ACPI_CUSTOM_METHOD is not set # CONFIG_ACPI_EXTLOG is not set # CONFIG_ACPI_HED is not set -# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set # CONFIG_ACPI_TABLE_UPGRADE is not set # CONFIG_ACPI_VIDEO is not set @@ -91,7 +90,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -CONFIG_ADVISE_SYSCALLS=y +# CONFIG_ADVISE_SYSCALLS is not set # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFE4403 is not set @@ -311,8 +310,6 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_PATCH_PHYS_VIRT is not set # CONFIG_ARM_PSCI is not set # CONFIG_ARM_PTDUMP is not set -# CONFIG_ARM_SBSA_WATCHDOG is not set -# CONFIG_ARM_SCPI_PROTOCOL is not set # CONFIG_ARM_TIMER_SP804 is not set # CONFIG_ARM_UNWIND is not set # CONFIG_ARM_VIRT_EXT is not set @@ -326,7 +323,6 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ASYNC_TX_DMA is not set # CONFIG_AT76C50X_USB is not set # CONFIG_AT803X_PHY is not set -# CONFIG_AT91_SAMA5D2_ADC is not set # CONFIG_ATA is not set # CONFIG_ATAGS is not set CONFIG_ATAGS_PROC=y @@ -1003,7 +999,8 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set -CONFIG_DEFAULT_CUBIC=y +CONFIG_DEFAULT_BBR=y +# CONFIG_DEFAULT_CUBIC is not set CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_IOSCHED="deadline" @@ -1012,7 +1009,8 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_RENO is not set CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="cubic" +CONFIG_DEFAULT_TCP_CONG="bbr" +# CONFIG_DEFAULT_VEGAS is not set CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_RBTN is not set # CONFIG_DELL_SMO8800 is not set @@ -1326,7 +1324,6 @@ CONFIG_FRAME_WARN=1024 # CONFIG_FRONTSWAP is not set # CONFIG_FSCACHE is not set # CONFIG_FSL_EDMA is not set -# CONFIG_FSL_MC_BUS is not set # CONFIG_FSL_PQ_MDIO is not set # CONFIG_FSL_XGMAC_MDIO is not set CONFIG_FSNOTIFY=y @@ -1385,19 +1382,14 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_ALTERA is not set # CONFIG_GPIO_AMD8111 is not set -# CONFIG_GPIO_AMDPT is not set # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CS5535 is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EM is not set -# CONFIG_GPIO_F7188X is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set -# CONFIG_GPIO_GPIO_MM is not set # CONFIG_GPIO_GRGPIO is not set # CONFIG_GPIO_ICH is not set -# CONFIG_GPIO_IT87 is not set -# CONFIG_GPIO_LYNXPOINT is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MAX732X is not set @@ -1423,7 +1415,6 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_VX855 is not set # CONFIG_GPIO_WATCHDOG is not set -# CONFIG_GPIO_WS16C48 is not set # CONFIG_GPIO_XGENE is not set # CONFIG_GPIO_XILINX is not set # CONFIG_GPIO_ZEVIO is not set @@ -1893,7 +1884,6 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_MATCH_RT is not set # CONFIG_IP6_NF_NAT is not set # CONFIG_IP6_NF_RAW is not set -# CONFIG_IP6_NF_SECURITY is not set # CONFIG_IP6_NF_TARGET_HL is not set # CONFIG_IP6_NF_TARGET_REJECT is not set # CONFIG_IP6_NF_TARGET_SYNPROXY is not set @@ -2047,7 +2037,6 @@ CONFIG_JOLIET=y CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set -# CONFIG_KASAN is not set # CONFIG_KCOV is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set @@ -2197,7 +2186,6 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LIBIPW_DEBUG is not set # CONFIG_LIBNVDIMM is not set # CONFIG_LIDAR_LITE_V2 is not set -# CONFIG_LIQUIDIO is not set # CONFIG_LIRC_STAGING is not set # CONFIG_LIS3L02DQ is not set # CONFIG_LKDTM is not set @@ -2641,7 +2629,6 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_SPINAND_MT29F is not set # CONFIG_MTD_SPI_NOR is not set # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set -CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set # CONFIG_MTD_SPLIT_EVA_FW is not set @@ -2962,12 +2949,11 @@ CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_V4_1 is not set # CONFIG_NFTL is not set -# CONFIG_NFT_BRIDGE_META is not set -# CONFIG_NFT_BRIDGE_REJECT is not set # CONFIG_NFT_DUP_IPV4 is not set # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set +# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3130,7 +3116,6 @@ CONFIG_PACKET=y CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_PAGE_SIZE_8KB is not set -# CONFIG_PALMAS_GPADC is not set # CONFIG_PANASONIC_LAPTOP is not set # CONFIG_PANEL is not set CONFIG_PANIC_ON_OOPS=y @@ -3222,8 +3207,6 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set # CONFIG_PCI_HERMES is not set # CONFIG_PCI_HOST_GENERIC is not set -# CONFIG_PCI_HOST_THUNDER_ECAM is not set -# CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_IOV is not set # CONFIG_PCI_LAYERSCAPE is not set # CONFIG_PCI_MSI is not set @@ -3303,7 +3286,6 @@ CONFIG_PINMUX=y # CONFIG_POWERCAP is not set # CONFIG_POWER_AVS is not set # CONFIG_POWER_RESET is not set -# CONFIG_POWER_RESET_BRCMKONA is not set # CONFIG_POWER_RESET_BRCMSTB is not set # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -3920,7 +3902,6 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_W83795 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83L786NG is not set -# CONFIG_SENSORS_XGENE is not set CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_ACCENT is not set # CONFIG_SERIAL_8250_BOCA is not set @@ -3948,7 +3929,6 @@ CONFIG_SERIAL_8250_NR_UARTS=2 CONFIG_SERIAL_8250_RUNTIME_UARTS=2 # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set -# CONFIG_SERIAL_AMBA_PL010 is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_BCM63XX is not set # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set @@ -4004,6 +3984,7 @@ CONFIG_SHMEM=y # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set # CONFIG_SH_TIMER_TMU is not set +# CONFIG_SHORTCUT_FE is not set # CONFIG_SI1145 is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -4087,7 +4068,6 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_ECHO3G is not set -# CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_EMU10K1_SEQ is not set @@ -4292,7 +4272,6 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_WM8804_I2C is not set # CONFIG_SND_SOC_WM8804_SPI is not set # CONFIG_SND_SOC_WM8903 is not set -# CONFIG_SND_SOC_WM8960 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -4360,7 +4339,6 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set # CONFIG_SPI_CADENCE is not set -# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set # CONFIG_SPI_DESIGNWARE is not set # CONFIG_SPI_FSL_DSPI is not set @@ -4503,7 +4481,7 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_XEN is not set # CONFIG_TCIC is not set CONFIG_TCP_CONG_ADVANCED=y -# CONFIG_TCP_CONG_BBR is not set +CONFIG_TCP_CONG_BBR=y # CONFIG_TCP_CONG_BIC is not set # CONFIG_TCP_CONG_CDG is not set CONFIG_TCP_CONG_CUBIC=y @@ -4515,10 +4493,10 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_CONG_LP is not set # CONFIG_TCP_CONG_NV is not set # CONFIG_TCP_CONG_SCALABLE is not set -# CONFIG_TCP_CONG_VEGAS is not set +CONFIG_TCP_CONG_VEGAS=y # CONFIG_TCP_CONG_VENO is not set # CONFIG_TCP_CONG_WESTWOOD is not set -# CONFIG_TCP_CONG_YEAH is not set +CONFIG_TCP_CONG_YEAH=y # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set @@ -4559,10 +4537,6 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set -# CONFIG_THUNDER_NIC_BGX is not set -# CONFIG_THUNDER_NIC_PF is not set -# CONFIG_THUNDER_NIC_RGX is not set -# CONFIG_THUNDER_NIC_VF is not set # CONFIG_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y @@ -4615,8 +4589,6 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_EGALAX is not set -# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set -# CONFIG_TOUCHSCREEN_EKTF2127 is not set # CONFIG_TOUCHSCREEN_ELAN is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_FT6236 is not set @@ -4629,20 +4601,15 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set # CONFIG_TOUCHSCREEN_MCS5000 is not set -# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MK712 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_PIXCIR is not set -# CONFIG_TOUCHSCREEN_RM_TS is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set # CONFIG_TOUCHSCREEN_S3C2410 is not set -# CONFIG_TOUCHSCREEN_SILEAD is not set -# CONFIG_TOUCHSCREEN_SIS_I2C is not set # CONFIG_TOUCHSCREEN_ST1232 is not set # CONFIG_TOUCHSCREEN_SUR40 is not set -# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set # CONFIG_TOUCHSCREEN_SX8654 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set @@ -4762,7 +4729,6 @@ CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_EG20T is not set # CONFIG_USB_EHCI_ATH79 is not set # CONFIG_USB_EHCI_HCD_AT91 is not set -# CONFIG_USB_EHCI_HCD_OMAP is not set # CONFIG_USB_EHCI_HCD_PPC_OF is not set # CONFIG_USB_EHCI_MSM is not set # CONFIG_USB_EHCI_MV is not set @@ -5315,4 +5281,3 @@ CONFIG_ZONE_DMA=y # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file From f067e41e8ffed37cb14d849c8b89e285e2d7d642 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 20:43:48 +0800 Subject: [PATCH 63/95] Revert "add ASUS RT-ACRH17 wireless support" This reverts commit d196cfe83107fc5ba5be23d328db87e7a78a6196. --- config/Config-images.in | 1 - .../ipq806x/base-files/etc/board.d/01_leds | 11 +- .../ipq806x/base-files/etc/board.d/02_network | 10 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 12 +- .../lib/preinit/06_set_iface_mac.sh | 19 -- .../base-files/lib/upgrade/platform.sh | 12 +- .../arm/boot/dts/qcom-ipq4019-rt-acrh17.dts | 296 ++++++++---------- target/linux/ipq806x/image/Makefile | 2 +- 8 files changed, 144 insertions(+), 219 deletions(-) delete mode 100644 target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh diff --git a/config/Config-images.in b/config/Config-images.in index 1ea33182b..607659114 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -18,7 +18,6 @@ menu "Target Images" default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx - default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ipq806x default TARGET_INITRAMFS_COMPRESSION_NONE depends on TARGET_ROOTFS_INITRAMFS help diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index 3b22f8a67..a5b6bfc03 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -35,16 +35,7 @@ nbg6817) ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ;; -rt-acrh17) - ucidef_set_led_default "status" "STATUS" "${board}:blue:status" "1" - ucidef_set_led_wlan "wlan2g" "WLAN2G" "${board}:blue:wlan2g" "phy0tpt" - ucidef_set_led_wlan "wlan5g" "WLAN5G" "${board}:blue:wlan5g" "phy1tpt" - ucidef_set_led_switch "wan" "WAN(blue)" "${board}:blue:wan" "switch0" "0x20" - ucidef_set_led_switch "lan1" "LAN1" "${board}:blue:lan1" "switch0" "0x02" - ucidef_set_led_switch "lan2" "LAN2" "${board}:blue:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "LAN3" "${board}:blue:lan3" "switch0" "0x08" - ucidef_set_led_switch "lan4" "LAN4" "${board}:blue:lan4" "switch0" "0x10" - ;; +rt-acrh17 |\ rt-ac58u) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index c1428f40b..9d5ba2d68 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -53,15 +53,7 @@ nbg6817) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ;; -rt-acrh17) - CI_UBIPART=UBI_DEV - lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102) - wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 36870) - ucidef_add_switch "switch0" \ - "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" - ucidef_set_interface_macaddr "lan" "$lan_mac_addr" - ucidef_set_interface_macaddr "wan" "$wan_mac_addr" - ;; +rt-acrh17 |\ rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 055af39a7..9557b539a 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -62,11 +62,7 @@ board=$(board_name) case "$FIRMWARE" in "ath10k/pre-cal-ahb-a000000.wifi.bin") case "$board" in - rt-acrh17) - CI_UBIPART=UBI_DEV - . /lib/upgrade/nand.sh - ath10kcal_ubi_extract "Factory" 4096 12064 - ;; + rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -80,6 +76,7 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in + rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -94,11 +91,6 @@ case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in - rt-acrh17) - CI_UBIPART=UBI_DEV - . /lib/upgrade/nand.sh - ath10kcal_ubi_extract "Factory" 36864 12064 - ;; c2600) ath10kcal_extract "radio" 4096 12064 # ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1) diff --git a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh deleted file mode 100644 index d08f26558..000000000 --- a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac.sh +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2014-2015 OpenWrt.org -# Copyright (C) 2016 LEDE-Project.org -# - -preinit_set_mac_address() { - local mac - - . /lib/functions.sh - - case $(board_name) in - rt-acrh17) - CI_UBIPART=UBI_DEV - mac=$(mtd_get_mac_binary_ubi Factory 4102) - ifconfig eth0 hw ether $mac 2>/dev/null - esac -} - -boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index e25aeb533..cf046800d 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -8,17 +8,7 @@ platform_check_image() { local board=$(board_name) case "$board" in - rt-acrh17) - CI_UBIPART="UBI_DEV" - CI_KERNPART="linux" - - local ubidev=$(nand_find_ubi $CI_UBIPART) - local jffs2=$(nand_find_volume $ubidev jffs2) - local linux2=$(nand_find_volume $ubidev linux2) - [ -n "$jffs2" ] && ubirmvol /dev/$ubidev --name=jffs2 - [ -n "$linux2" ] && ubirmvol /dev/$ubidev --name=linux2 - nand_do_upgrade "$1" - ;; + rt-acrh17 |\ rt-ac58u) CI_UBIPART="UBI_DEV" local ubidev=$(nand_find_ubi $CI_UBIPART) diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts index beace8ecf..c68cc0e9e 100644 --- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -14,7 +14,7 @@ * */ -#include "qcom-ipq4019-ap.dk04.1.dtsi" +#include "qcom-ipq4019-ap.dk01.1.dtsi" #include "qcom-ipq4019-bus.dtsi" #include #include @@ -48,91 +48,6 @@ }; soc { - spi_0: spi@78b5000 { - status = "disabled"; - }; - - pcie0: qcom,pcie@80000 { - compatible = "qcom,msm_pcie"; - cell-index = <0>; - qcom,ctrl-amt = <1>; - - reg = <0x80000 0x2000>, - <0x99000 0x800>, - <0x40000000 0xf1d>, - <0x40000f20 0xa8>, - <0x40100000 0x1000>, - <0x40200000 0x100000>, - <0x40300000 0xd00000>; - reg-names = "parf", "phy", "dm_core", "elbi", - "conf", "io", "bars"; - - #address-cells = <0>; - interrupt-parent = <&pcie0>; - interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12>; - #interrupt-cells = <1>; - interrupt-map-mask = <0xffffffff>; - interrupt-map = <0 &intc 0 141 0 - 1 &intc 0 142 0 - 2 &intc 0 143 0 - 3 &intc 0 144 0 - 4 &intc 0 145 0 - 5 &intc 0 146 0 - 6 &intc 0 147 0 - 7 &intc 0 148 0 - 8 &intc 0 149 0 - 9 &intc 0 150 0 - 10 &intc 0 151 0 - 11 &intc 0 152 0 >; - - interrupt-names = "int_msi", "int_a", "int_b", "int_c", "int_d", - "int_pls_pme", "int_pme_legacy", "int_pls_err", - "int_aer_legacy", "int_pls_link_up", - "int_pls_link_down", "int_bridge_flush_n","int_wake"; - - qcom,ep-latency = <10>; - - clocks = <&gcc GCC_PCIE_AHB_CLK>, - <&gcc GCC_PCIE_AXI_M_CLK>, - <&gcc GCC_PCIE_AXI_S_CLK>; - - clock-names = "pcie_0_cfg_ahb_clk", - "pcie_0_mstr_axi_clk", - "pcie_0_slv_axi_clk"; - - max-clock-frequency-hz = <0>, <0>, <0>; - - resets = <&gcc PCIE_AXI_M_ARES>, - <&gcc PCIE_AXI_S_ARES>, - <&gcc PCIE_PIPE_ARES>, - <&gcc PCIE_AXI_M_VMIDMT_ARES>, - <&gcc PCIE_AXI_S_XPU_ARES>, - <&gcc PCIE_PARF_XPU_ARES>, - <&gcc PCIE_PHY_ARES>, - <&gcc PCIE_AXI_M_STICKY_ARES>, - <&gcc PCIE_PIPE_STICKY_ARES>, - <&gcc PCIE_PWR_ARES>, - <&gcc PCIE_AHB_ARES>, - <&gcc PCIE_PHY_AHB_ARES>; - - reset-names = "pcie_rst_axi_m_ares", - "pcie_rst_axi_s_ares", - "pcie_rst_pipe_ares", - "pcie_rst_axi_m_vmidmt_ares", - "pcie_rst_axi_s_xpu_ares", - "pcie_rst_parf_xpu_ares", - "pcie_rst_phy_ares", - "pcie_rst_axi_m_sticky_ares", - "pcie_rst_pipe_sticky_ares", - "pcie_rst_pwr_ares", - "pcie_rst_ahb_res", - "pcie_rst_phy_ahb_ares"; - - status = "ok"; - perst-gpio = <&tlmm 38 0>; - wake-gpio = <&tlmm 50 0>; - clkreq-gpio = <&tlmm 39 0>; - }; tcsr@194b000 { /* select hostmode */ @@ -148,6 +63,7 @@ qcom,ess-interface-select = ; }; + tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -160,6 +76,11 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + mdio@90000 { status = "okay"; }; @@ -176,20 +97,20 @@ status = "okay"; }; - wifi0: wifi@a000000 { - status = "ok"; - core-id = <0x0>; - qca,msi_addr = <0x0b006040>; - qca,msi_base = <0x40>; - wifi_led_num = <2>; /* Wifi 2G */ - wifi_led_source = <0>; /* source id 0 */ - qcom,mtd-name = "0:ART"; - qcom,cal-offset = <0x1000>; - qcom,cal-len = <12064>; + wifi@a000000 { + status = "okay"; }; - wifi1: wifi@a800000 { - status = "disabled"; + wifi@a800000 { + status = "okay"; + }; + + cryptobam: dma@8e04000 { + status = "okay"; + }; + + crypto@8e3a000 { + status = "okay"; }; }; @@ -198,13 +119,13 @@ reset { label = "reset"; - gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; linux,code = ; }; wps { label = "wps"; - gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; linux,code = ; }; }; @@ -214,78 +135,137 @@ power: status { label = "rt-acrh17:blue:status"; - gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; }; - lan1 { - label = "rt-acrh17:blue:lan1"; - gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; - }; - - lan2 { - label = "rt-acrh17:blue:lan2"; - gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; - }; - - lan3 { - label = "rt-acrh17:blue:lan3"; - gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; - }; - - lan4 { - label = "rt-acrh17:blue:lan4"; - gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; - }; - - wan_blue { + wan { label = "rt-acrh17:blue:wan"; - gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; }; - wan_red { - label = "rt-acrh17:red:wan"; - gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; + wlan2G { + label = "rt-acrh17:blue:wlan2G"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; }; - wlan2g { - label = "rt-acrh17:blue:wlan2g"; - gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; + wan5G { + label = "rt-acrh17:blue:wlan5G"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; }; - wlan5g { - label = "rt-acrh17:blue:wlan5g"; - gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; + usb { + label = "rt-acrh17:blue:usb"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + }; + + lan { + label = "rt-acrh17:blue:lan"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; }; }; }; -&nand_pins { - pullups { - pins = "gpio53", "gpio58", - "gpio59"; - function = "qpic"; - bias-pull-up; +&spi_0_pins { + pinmux_cs { + function = "gpio"; + pins = "gpio54", "gpio59"; }; - - pulldowns { - pins = "gpio55", "gpio56", - "gpio57", "gpio60", - "gpio62", "gpio63", "gpio64", - "gpio65", "gpio66", "gpio67", - "gpio69"; - function = "qpic"; - bias-pull-down; - }; -}; - -&i2c_0_pins { - pinmux { - function = "blsp_i2c0"; - pins = "gpio10"; - }; - pinconf { - pins = "gpio10"; - drive-strength = <16>; + pinconf_cs { + pins = "gpio54", "gpio59"; + drive-strength = <2>; bias-disable; + output-high; + }; +}; + + +&spi_0 { /* BLSP1 QUP1 */ + status = "ok"; + cs-gpios = <&tlmm 54 0>, + <&tlmm 59 0>; + + mx25l25635e@0 { + status = "disabled"; + }; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <0>; + /* + * U-boot looks for "n25q128a11" node, + * if we don't have it, it will spit out the following warning: + * "ipq: fdt fixup unable to find compatible node". + */ + compatible = "mx25l1606e", "n25q128a11", "jedec,spi-nor"; + reg = <0>; + linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "SBL1"; + reg = <0x00000000 0x00040000>; + read-only; + }; + partition1@40000 { + label = "MIBIB"; + reg = <0x00040000 0x00020000>; + read-only; + }; + partition2@60000 { + label = "QSEE"; + reg = <0x00060000 0x00060000>; + read-only; + }; + partition3@c0000 { + label = "CDT"; + reg = <0x000c0000 0x00010000>; + read-only; + }; + partition4@d0000 { + label = "DDRPARAMS"; + reg = <0x000d0000 0x00010000>; + read-only; + }; + partition5@e0000 { + label = "APPSBLENV"; /* uboot env*/ + reg = <0x000e0000 0x00010000>; + read-only; + }; + partition5@f0000 { + label = "APPSBL"; /* uboot */ + reg = <0x000f0000 0x00080000>; + read-only; + }; + partition5@170000 { + label = "ART"; + reg = <0x00170000 0x00010000>; + read-only; + }; + /* 0x00180000 - 0x00200000 unused */ + }; + }; + + mt29f@1 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "spinand,mt29f", "w25n01gv"; + reg = <1>; + spi-max-frequency = <24000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition0@0 { + label = "ubi"; + reg = <0x00000000 0x08000000>; + }; + }; }; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index a9353ec77..c79afb9d7 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -267,7 +267,7 @@ define Device/RT-ACRH17 IMAGES = sysupgrade.tar flash-factory.trx IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ath10k-firmware-qca4019 ath10k-firmware-qca9984 + DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984 endef define Device/NBG6817 From 096a7d6c4c4a95cab2cbba1f443d8cfc084a6453 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 21:42:40 +0800 Subject: [PATCH 64/95] sort kernel configurations --- target/linux/generic/config-4.4 | 8 ++--- target/linux/generic/config-4.9 | 56 +++++++++++++++++++++++++++------ 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index 99cc012e7..a343fa23b 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -82,7 +82,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFFS_FS is not set @@ -1821,6 +1821,7 @@ CONFIG_JOLIET=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set # CONFIG_KERNEL_GZIP is not set @@ -2682,7 +2683,6 @@ CONFIG_NFS_V3=y # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3651,7 +3651,6 @@ CONFIG_SHMEM=y # CONFIG_SH_ETH is not set # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set -# CONFIG_SHORTCUT_FE is not set # CONFIG_SH_TIMER_TMU is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -4855,4 +4854,5 @@ CONFIG_ZONE_DMA_FLAG=1 # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set \ No newline at end of file +# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set +# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 6a703c0a0..15b64d794 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -19,6 +19,7 @@ CONFIG_32BIT=y # CONFIG_ACPI_CUSTOM_METHOD is not set # CONFIG_ACPI_EXTLOG is not set # CONFIG_ACPI_HED is not set +# CONFIG_ACPI_NFIT is not set # CONFIG_ACPI_REDUCED_HARDWARE_ONLY is not set # CONFIG_ACPI_TABLE_UPGRADE is not set # CONFIG_ACPI_VIDEO is not set @@ -90,7 +91,7 @@ CONFIG_32BIT=y # CONFIG_ADM6996_PHY is not set # CONFIG_ADM8211 is not set # CONFIG_ADT7316 is not set -# CONFIG_ADVISE_SYSCALLS is not set +CONFIG_ADVISE_SYSCALLS=y # CONFIG_ADXRS450 is not set CONFIG_AEABI=y # CONFIG_AFE4403 is not set @@ -310,6 +311,8 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_PATCH_PHYS_VIRT is not set # CONFIG_ARM_PSCI is not set # CONFIG_ARM_PTDUMP is not set +# CONFIG_ARM_SBSA_WATCHDOG is not set +# CONFIG_ARM_SCPI_PROTOCOL is not set # CONFIG_ARM_TIMER_SP804 is not set # CONFIG_ARM_UNWIND is not set # CONFIG_ARM_VIRT_EXT is not set @@ -323,6 +326,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ASYNC_TX_DMA is not set # CONFIG_AT76C50X_USB is not set # CONFIG_AT803X_PHY is not set +# CONFIG_AT91_SAMA5D2_ADC is not set # CONFIG_ATA is not set # CONFIG_ATAGS is not set CONFIG_ATAGS_PROC=y @@ -999,8 +1003,7 @@ CONFIG_DEBUG_KERNEL=y # CONFIG_DEBUG_WX is not set # CONFIG_DEBUG_ZBOOT is not set # CONFIG_DECNET is not set -CONFIG_DEFAULT_BBR=y -# CONFIG_DEFAULT_CUBIC is not set +CONFIG_DEFAULT_CUBIC=y CONFIG_DEFAULT_DEADLINE=y CONFIG_DEFAULT_HOSTNAME="(none)" CONFIG_DEFAULT_IOSCHED="deadline" @@ -1009,8 +1012,7 @@ CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_DEFAULT_RENO is not set CONFIG_DEFAULT_SECURITY="" CONFIG_DEFAULT_SECURITY_DAC=y -CONFIG_DEFAULT_TCP_CONG="bbr" -# CONFIG_DEFAULT_VEGAS is not set +CONFIG_DEFAULT_TCP_CONG="cubic" CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" # CONFIG_DELL_RBTN is not set # CONFIG_DELL_SMO8800 is not set @@ -1324,6 +1326,7 @@ CONFIG_FRAME_WARN=1024 # CONFIG_FRONTSWAP is not set # CONFIG_FSCACHE is not set # CONFIG_FSL_EDMA is not set +# CONFIG_FSL_MC_BUS is not set # CONFIG_FSL_PQ_MDIO is not set # CONFIG_FSL_XGMAC_MDIO is not set CONFIG_FSNOTIFY=y @@ -1382,14 +1385,19 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_ADP5588 is not set # CONFIG_GPIO_ALTERA is not set # CONFIG_GPIO_AMD8111 is not set +# CONFIG_GPIO_AMDPT is not set # CONFIG_GPIO_BCM_KONA is not set # CONFIG_GPIO_BT8XX is not set # CONFIG_GPIO_CS5535 is not set # CONFIG_GPIO_DWAPB is not set # CONFIG_GPIO_EM is not set +# CONFIG_GPIO_F7188X is not set # CONFIG_GPIO_GENERIC_PLATFORM is not set +# CONFIG_GPIO_GPIO_MM is not set # CONFIG_GPIO_GRGPIO is not set # CONFIG_GPIO_ICH is not set +# CONFIG_GPIO_IT87 is not set +# CONFIG_GPIO_LYNXPOINT is not set # CONFIG_GPIO_MAX7300 is not set # CONFIG_GPIO_MAX7301 is not set # CONFIG_GPIO_MAX732X is not set @@ -1415,6 +1423,7 @@ CONFIG_GENERIC_NET_UTILS=y # CONFIG_GPIO_TS5500 is not set # CONFIG_GPIO_VX855 is not set # CONFIG_GPIO_WATCHDOG is not set +# CONFIG_GPIO_WS16C48 is not set # CONFIG_GPIO_XGENE is not set # CONFIG_GPIO_XILINX is not set # CONFIG_GPIO_ZEVIO is not set @@ -1884,6 +1893,7 @@ CONFIG_IO_STRICT_DEVMEM=y # CONFIG_IP6_NF_MATCH_RT is not set # CONFIG_IP6_NF_NAT is not set # CONFIG_IP6_NF_RAW is not set +# CONFIG_IP6_NF_SECURITY is not set # CONFIG_IP6_NF_TARGET_HL is not set # CONFIG_IP6_NF_TARGET_REJECT is not set # CONFIG_IP6_NF_TARGET_SYNPROXY is not set @@ -2037,6 +2047,7 @@ CONFIG_JOLIET=y CONFIG_KALLSYMS_BASE_RELATIVE=y # CONFIG_KALLSYMS_UNCOMPRESSED is not set # CONFIG_KARMA_PARTITION is not set +# CONFIG_KASAN is not set # CONFIG_KCOV is not set # CONFIG_KERNEL_BZIP2 is not set # CONFIG_KERNEL_CAT is not set @@ -2186,6 +2197,7 @@ CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LIBIPW_DEBUG is not set # CONFIG_LIBNVDIMM is not set # CONFIG_LIDAR_LITE_V2 is not set +# CONFIG_LIQUIDIO is not set # CONFIG_LIRC_STAGING is not set # CONFIG_LIS3L02DQ is not set # CONFIG_LKDTM is not set @@ -2629,6 +2641,7 @@ CONFIG_MTD_ROOTFS_ROOT_DEV=y # CONFIG_MTD_SPINAND_MT29F is not set # CONFIG_MTD_SPI_NOR is not set # CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set +CONFIG_MTD_SPI_NOR_USE_4K_SECTORS_LIMIT=4096 CONFIG_MTD_SPLIT=y # CONFIG_MTD_SPLIT_BRNIMAGE_FW is not set # CONFIG_MTD_SPLIT_EVA_FW is not set @@ -2949,11 +2962,12 @@ CONFIG_NFS_V3=y # CONFIG_NFS_V4 is not set # CONFIG_NFS_V4_1 is not set # CONFIG_NFTL is not set +# CONFIG_NFT_BRIDGE_META is not set +# CONFIG_NFT_BRIDGE_REJECT is not set # CONFIG_NFT_DUP_IPV4 is not set # CONFIG_NFT_DUP_IPV6 is not set # CONFIG_NF_CONNTRACK is not set # CONFIG_NF_CONNTRACK_AMANDA is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set # CONFIG_NF_CONNTRACK_EVENTS is not set # CONFIG_NF_CONNTRACK_FTP is not set # CONFIG_NF_CONNTRACK_H323 is not set @@ -3116,6 +3130,7 @@ CONFIG_PACKET=y CONFIG_PAGE_SIZE_4KB=y # CONFIG_PAGE_SIZE_64KB is not set # CONFIG_PAGE_SIZE_8KB is not set +# CONFIG_PALMAS_GPADC is not set # CONFIG_PANASONIC_LAPTOP is not set # CONFIG_PANEL is not set CONFIG_PANIC_ON_OOPS=y @@ -3207,6 +3222,8 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set # CONFIG_PCI_HERMES is not set # CONFIG_PCI_HOST_GENERIC is not set +# CONFIG_PCI_HOST_THUNDER_ECAM is not set +# CONFIG_PCI_HOST_THUNDER_PEM is not set # CONFIG_PCI_IOV is not set # CONFIG_PCI_LAYERSCAPE is not set # CONFIG_PCI_MSI is not set @@ -3286,6 +3303,7 @@ CONFIG_PINMUX=y # CONFIG_POWERCAP is not set # CONFIG_POWER_AVS is not set # CONFIG_POWER_RESET is not set +# CONFIG_POWER_RESET_BRCMKONA is not set # CONFIG_POWER_RESET_BRCMSTB is not set # CONFIG_POWER_RESET_GPIO is not set # CONFIG_POWER_RESET_GPIO_RESTART is not set @@ -3902,6 +3920,7 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_W83795 is not set # CONFIG_SENSORS_W83L785TS is not set # CONFIG_SENSORS_W83L786NG is not set +# CONFIG_SENSORS_XGENE is not set CONFIG_SERIAL_8250=y # CONFIG_SERIAL_8250_ACCENT is not set # CONFIG_SERIAL_8250_BOCA is not set @@ -3929,6 +3948,7 @@ CONFIG_SERIAL_8250_NR_UARTS=2 CONFIG_SERIAL_8250_RUNTIME_UARTS=2 # CONFIG_SERIAL_ALTERA_JTAGUART is not set # CONFIG_SERIAL_ALTERA_UART is not set +# CONFIG_SERIAL_AMBA_PL010 is not set # CONFIG_SERIAL_ARC is not set # CONFIG_SERIAL_BCM63XX is not set # CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set @@ -3984,7 +4004,6 @@ CONFIG_SHMEM=y # CONFIG_SH_TIMER_CMT is not set # CONFIG_SH_TIMER_MTU2 is not set # CONFIG_SH_TIMER_TMU is not set -# CONFIG_SHORTCUT_FE is not set # CONFIG_SI1145 is not set # CONFIG_SI7005 is not set # CONFIG_SI7020 is not set @@ -4068,6 +4087,7 @@ CONFIG_SND_DRIVERS=y # CONFIG_SND_DUMMY is not set # CONFIG_SND_DYNAMIC_MINORS is not set # CONFIG_SND_ECHO3G is not set +# CONFIG_SND_EDMA_SOC is not set # CONFIG_SND_EMU10K1 is not set # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_EMU10K1_SEQ is not set @@ -4272,6 +4292,7 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_WM8804_I2C is not set # CONFIG_SND_SOC_WM8804_SPI is not set # CONFIG_SND_SOC_WM8903 is not set +# CONFIG_SND_SOC_WM8960 is not set # CONFIG_SND_SOC_WM8962 is not set # CONFIG_SND_SOC_WM8974 is not set # CONFIG_SND_SOC_WM8978 is not set @@ -4339,6 +4360,7 @@ CONFIG_SND_VERBOSE_PROCFS=y # CONFIG_SPI_BITBANG is not set # CONFIG_SPI_BUTTERFLY is not set # CONFIG_SPI_CADENCE is not set +# CONFIG_SPI_CADENCE_QUADSPI is not set # CONFIG_SPI_DEBUG is not set # CONFIG_SPI_DESIGNWARE is not set # CONFIG_SPI_FSL_DSPI is not set @@ -4481,7 +4503,7 @@ CONFIG_SYSVIPC_SYSCTL=y # CONFIG_TCG_XEN is not set # CONFIG_TCIC is not set CONFIG_TCP_CONG_ADVANCED=y -CONFIG_TCP_CONG_BBR=y +# CONFIG_TCP_CONG_BBR is not set # CONFIG_TCP_CONG_BIC is not set # CONFIG_TCP_CONG_CDG is not set CONFIG_TCP_CONG_CUBIC=y @@ -4493,10 +4515,10 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_CONG_LP is not set # CONFIG_TCP_CONG_NV is not set # CONFIG_TCP_CONG_SCALABLE is not set -CONFIG_TCP_CONG_VEGAS=y +# CONFIG_TCP_CONG_VEGAS is not set # CONFIG_TCP_CONG_VENO is not set # CONFIG_TCP_CONG_WESTWOOD is not set -CONFIG_TCP_CONG_YEAH=y +# CONFIG_TCP_CONG_YEAH is not set # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set @@ -4537,6 +4559,10 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDER_NIC_BGX is not set +# CONFIG_THUNDER_NIC_PF is not set +# CONFIG_THUNDER_NIC_RGX is not set +# CONFIG_THUNDER_NIC_VF is not set # CONFIG_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y @@ -4589,6 +4615,8 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_EDT_FT5X06 is not set # CONFIG_TOUCHSCREEN_EETI is not set # CONFIG_TOUCHSCREEN_EGALAX is not set +# CONFIG_TOUCHSCREEN_EGALAX_SERIAL is not set +# CONFIG_TOUCHSCREEN_EKTF2127 is not set # CONFIG_TOUCHSCREEN_ELAN is not set # CONFIG_TOUCHSCREEN_ELO is not set # CONFIG_TOUCHSCREEN_FT6236 is not set @@ -4601,15 +4629,20 @@ CONFIG_TMPFS_XATTR=y # CONFIG_TOUCHSCREEN_INEXIO is not set # CONFIG_TOUCHSCREEN_MAX11801 is not set # CONFIG_TOUCHSCREEN_MCS5000 is not set +# CONFIG_TOUCHSCREEN_MELFAS_MIP4 is not set # CONFIG_TOUCHSCREEN_MK712 is not set # CONFIG_TOUCHSCREEN_MMS114 is not set # CONFIG_TOUCHSCREEN_MTOUCH is not set # CONFIG_TOUCHSCREEN_PENMOUNT is not set # CONFIG_TOUCHSCREEN_PIXCIR is not set +# CONFIG_TOUCHSCREEN_RM_TS is not set # CONFIG_TOUCHSCREEN_ROHM_BU21023 is not set # CONFIG_TOUCHSCREEN_S3C2410 is not set +# CONFIG_TOUCHSCREEN_SILEAD is not set +# CONFIG_TOUCHSCREEN_SIS_I2C is not set # CONFIG_TOUCHSCREEN_ST1232 is not set # CONFIG_TOUCHSCREEN_SUR40 is not set +# CONFIG_TOUCHSCREEN_SURFACE3_SPI is not set # CONFIG_TOUCHSCREEN_SX8654 is not set # CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 is not set # CONFIG_TOUCHSCREEN_TOUCHIT213 is not set @@ -4729,6 +4762,7 @@ CONFIG_USB_DEFAULT_PERSIST=y # CONFIG_USB_EG20T is not set # CONFIG_USB_EHCI_ATH79 is not set # CONFIG_USB_EHCI_HCD_AT91 is not set +# CONFIG_USB_EHCI_HCD_OMAP is not set # CONFIG_USB_EHCI_HCD_PPC_OF is not set # CONFIG_USB_EHCI_MSM is not set # CONFIG_USB_EHCI_MV is not set @@ -5281,3 +5315,5 @@ CONFIG_ZONE_DMA=y # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set +# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set +# CONFIG_SHORTCUT_FE is not set \ No newline at end of file From 31958513008d95cfea017f90ded6aba542fc3829 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Tue, 9 Jan 2018 21:50:45 +0800 Subject: [PATCH 65/95] update Adbyby Plus --- package/lean/luci-app-adbyby-plus/Makefile | 2 +- package/lean/luci-app-adbyby-plus/root/etc/config/adbyby | 2 +- package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package/lean/luci-app-adbyby-plus/Makefile b/package/lean/luci-app-adbyby-plus/Makefile index 752afd8cf..3a60dd9ab 100644 --- a/package/lean/luci-app-adbyby-plus/Makefile +++ b/package/lean/luci-app-adbyby-plus/Makefile @@ -10,7 +10,7 @@ LUCI_DEPENDS:=+adbyby +wget +ipset +coreutils +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_NAME:=luci-app-adbyby-plus PKG_VERSION:=2.0 -PKG_RELEASE:=26 +PKG_RELEASE:=27 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby index 7a11e0d77..384c018f6 100644 --- a/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/config/adbyby @@ -4,7 +4,7 @@ config adbyby option lan_mode '0' option cron_mode '1' option block_ios '1' - option enable '1' + option enable '0' option wan_mode '1' option mem_mode '1' option update_source '0' diff --git a/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby b/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby index cdf3be3d7..fb4b36f39 100755 --- a/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby +++ b/package/lean/luci-app-adbyby-plus/root/etc/uci-defaults/adbyby @@ -15,6 +15,7 @@ EOF mkdir -p /etc/dnsmasq.d +/etc/init.d/adbyby stop /etc/init.d/adbyby enable rm -f /tmp/luci-indexcache From cef216d6994b61e5d4eab958cafd2c76287d2b60 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jan 2018 14:58:23 +0800 Subject: [PATCH 66/95] unselect odhcpd-ipv6 by default --- include/target.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index 73a211c9f..40fa7c15c 100644 --- a/include/target.mk +++ b/include/target.mk @@ -21,7 +21,7 @@ luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule l # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets -DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall odhcpd-ipv6only odhcp6c +DEFAULT_PACKAGES.router:=dnsmasq-full iptables ip6tables ppp ppp-mod-pppoe firewall DEFAULT_PACKAGES.bootloader:= ifneq ($(DUMP),) From 72478019bb28f774db306189852f51f3ffbbb005 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jan 2018 16:09:30 +0800 Subject: [PATCH 67/95] fix x86/x64 vmdk boot --- config/Config-images.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config/Config-images.in b/config/Config-images.in index 607659114..03901ed94 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -219,7 +219,7 @@ menu "Target Images" config GRUB_TIMEOUT string "Seconds to wait before booting the default entry" depends on GRUB_IMAGES - default "5" + default "0" help If you don't know, 5 seconds is a reasonable default. @@ -233,6 +233,7 @@ menu "Target Images" config VMDK_IMAGES bool "Build VMware image files (VMDK)" depends on TARGET_x86 || TARGET_x86_64 + default y select GRUB_IMAGES select TARGET_IMAGES_PAD select PACKAGE_kmod-e1000 @@ -244,7 +245,7 @@ menu "Target Images" config TARGET_IMAGES_GZIP bool "GZip images" depends on TARGET_IMAGES_PAD || TARGET_ROOTFS_EXT4FS || TARGET_x86 - default y + default n comment "Image Options" @@ -258,7 +259,7 @@ menu "Target Images" config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MB)" depends on GRUB_IMAGES || TARGET_ROOTFS_EXT4FS || TARGET_rb532 || TARGET_mvebu || TARGET_uml - default 256 + default 90 help Select the root filesystem partition size. From 6d210c00b669cf5d345cc17aaaae392ac4a6bce0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jan 2018 16:34:02 +0800 Subject: [PATCH 68/95] revert netifd --- package/network/config/netifd/Makefile | 6 +++--- .../network/config/netifd/files/lib/netifd/dhcp.script | 10 ++++------ .../config/netifd/files/lib/netifd/proto/dhcp.sh | 1 - 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 4eb4737a3..fb0358640 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2018-01-04 -PKG_SOURCE_VERSION:=fd5c399c01ceb1bbede3ae8b0e1daaa7652a6fa1 -PKG_MIRROR_HASH:=0040f94d11d0039505328a90b2ff48968db873e9e7967307631bf40ef5679275 +PKG_SOURCE_DATE:=2017-01-25 +PKG_SOURCE_VERSION:=650758b16e5185505a3fbc1307949340af70b611 +PKG_MIRROR_HASH:=d09c740bc1bf6269678bd75c9af52ecd4be3d1d59402a543ceb9d4459cecfa2b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index 24f243c2c..e841f9185 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -18,12 +18,10 @@ setup_interface () { proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast - local i for i in $router; do proto_add_ipv4_route "$i" 32 "" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" - local r for r in $CUSTOMROUTES; do proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip" done @@ -33,11 +31,11 @@ setup_interface () { [ -n "$staticroutes" ] && set_classless_routes $staticroutes [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes - for i in $dns; do - proto_add_dns_server "$i" + for dns in $dns; do + proto_add_dns_server "$dns" done - for i in $domain; do - proto_add_dns_search "$i" + for domain in $domain; do + proto_add_dns_search "$domain" done proto_add_data diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index 143e4451b..ea02d68bb 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -40,7 +40,6 @@ proto_dhcp_setup() { append dhcpopts "-x $opt" done - [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)" [ "$broadcast" = 1 ] && broadcast="-B" || broadcast= [ "$release" = 1 ] && release="-R" || release= [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C" From b0f643aa87936c09faddc9af3f1ac85b2db1baf0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jan 2018 20:55:06 +0800 Subject: [PATCH 69/95] update to R7.5.3 stable to fix firewall freeze --- feeds.conf.default | 8 +- include/target.mk | 2 +- package/Makefile | 10 +- package/base-files/Makefile | 32 +- package/base-files/files/bin/config_generate | 10 +- package/base-files/files/etc/group | 1 - package/base-files/files/etc/init.d/led | 1 - package/base-files/files/etc/init.d/system | 2 +- package/base-files/files/etc/openwrt_release | 3 +- package/base-files/files/etc/rc.common | 21 +- package/base-files/files/etc/sysctl.conf | 1 - package/base-files/files/lib/functions.sh | 25 +- .../base-files/files/lib/functions/leds.sh | 12 - .../files/lib/functions/uci-defaults.sh | 318 +- .../files/lib/preinit/10_indicate_preinit | 2 +- .../lib/preinit/{02_sysinfo => 10_sysinfo} | 0 .../files/lib/preinit/40_run_failsafe_hook | 6 +- .../files/lib/preinit/99_10_failsafe_login | 11 +- .../base-files/files/lib/upgrade/common.sh | 192 +- package/base-files/files/lib/upgrade/stage2 | 150 - package/base-files/files/sbin/sysupgrade | 106 +- package/base-files/files/usr/lib/os-release | 6 +- package/base-files/image-config.in | 19 +- package/boot/apex/Makefile | 3 +- .../boot/arm-trusted-firmware-sunxi/Makefile | 52 - package/boot/at91bootstrap/Makefile | 94 - package/boot/at91bootstrap/at91bootstrap.mk | 88 - package/boot/grub2/Makefile | 1 - package/boot/kexec-tools/Config.in | 9 +- package/boot/kexec-tools/Makefile | 80 +- package/boot/kexec-tools/files/kdump.config | 7 - package/boot/kexec-tools/files/kdump.defaults | 11 - package/boot/kexec-tools/files/kdump.init | 182 - .../boot/kobs-ng/patches/001-compile.patch | 3 +- package/boot/rbcfg/Makefile | 2 +- package/boot/rbcfg/src/main.c | 137 +- package/boot/rbcfg/src/rbcfg.h | 10 - package/boot/uboot-ar71xx/Makefile | 84 +- .../board/zyxel/nbg460n/Makefile | 0 .../board/zyxel/nbg460n/config.mk | 0 .../board/zyxel/nbg460n/lowlevel_init.S | 0 .../board/zyxel/nbg460n/nbg460n.c | 0 .../board/zyxel/nbg460n/u-boot.lds | 0 .../{src => files}/cpu/mips/ar71xx_serial.c | 0 .../{src => files}/drivers/net/ag71xx.c | 0 .../{src => files}/drivers/net/ag71xx.h | 0 .../{src => files}/drivers/net/phy/rtl8366.h | 0 .../drivers/net/phy/rtl8366_mii.c | 0 .../{src => files}/drivers/spi/ar71xx_spi.c | 0 .../{src => files}/include/asm-mips/ar71xx.h | 0 .../include/asm-mips/ar71xx_gpio.h | 0 .../{src => files}/include/configs/nbg460n.h | 0 package/boot/uboot-at91/Makefile | 136 +- package/boot/uboot-envtools/Makefile | 6 +- package/boot/uboot-envtools/files/ar71xx | 13 +- package/boot/uboot-envtools/files/cns3xxx | 3 +- package/boot/uboot-envtools/files/imx6 | 3 +- package/boot/uboot-envtools/files/ipq | 24 +- package/boot/uboot-envtools/files/kirkwood | 5 +- package/boot/uboot-envtools/files/lantiq | 10 +- package/boot/uboot-envtools/files/mvebu | 3 +- package/boot/uboot-envtools/files/mxs | 3 +- package/boot/uboot-envtools/files/oxnas | 3 +- package/boot/uboot-envtools/files/pistachio | 27 - package/boot/uboot-envtools/files/ramips | 11 +- package/boot/uboot-fritz4040/Makefile | 54 - .../uboot-fritz4040/files/upload-to-f4040.sh | 41 - .../patches/100-private-libgcc.patch | 274 - .../patches/110-portability.patch | 32 - package/boot/uboot-imx6/Makefile | 117 +- package/boot/uboot-kirkwood/Makefile | 126 +- ...-add-CONFIG_SYS_GENERIC_BOARD-define.patch | 27 + ...r-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 + ...ome-add-CONFIG_SYS_GENERIC_BOARD-def.patch | 23 + ...t-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 + ...2-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 + ...lug-add-CONFIG_SYS_GENERIC_BOARD-def.patch | 23 + .../patches/007-nsa310-uboot-generic.patch | 697 -- .../patches/008-nsa325-uboot-generic.patch | 683 -- .../uboot-kirkwood/patches/110-dockstar.patch | 19 +- .../uboot-kirkwood/patches/120-iconnect.patch | 8 +- .../uboot-kirkwood/patches/130-ib62x0.patch | 2 +- .../patches/140-pogoplug_e02.patch | 2 +- .../patches/150-goflexhome.patch | 5 +- .../patches/200-openwrt-config.patch | 130 +- package/boot/uboot-lantiq/Makefile | 474 +- ...IPS-add-support-for-Lantiq-XWAY-SoCs.patch | 10 +- ...support-for-Lantiq-XWAY-ARX100-SoC-f.patch | 3 +- ...18-tools-lantiq-add-NAND-SPL-support.patch | 6 +- ...PS-lantiq-add-default-openwrt-config.patch | 3 +- .../patches/100-portability.patch | 18 - package/boot/uboot-layerscape-32b/Makefile | 98 + .../boot/uboot-layerscape-armv8_32b/Makefile | 53 - package/boot/uboot-layerscape/Makefile | 119 +- ...add-LEDE-boot-support-in-environment.patch | 51 - ...-add-LEDE-boot-support-in-environmen.patch | 57 - ...-add-LEDE-boot-support-in-environmen.patch | 51 - ...-add-LEDE-boot-support-in-environmen.patch | 58 - ...-add-LEDE-boot-support-in-environmen.patch | 54 - ...m-add-LEDE-boot-support-in-environme.patch | 49 - package/boot/uboot-mvebu/Makefile | 91 +- ...clearfog-generate-random-MAC-address.patch | 28 - ...003-clearfog-enable-distro-boot-code.patch | 97 - ...og-enable-setexpr-command-by-default.patch | 24 - .../patches/001-use-dtc-in-kernel.patch | 11 + ...011-rsa-Fix-build-with-OpenSSL-1.1.x.patch | 153 - ...wbimage-fix-build-with-OpenSSL-1.1.x.patch | 96 - .../patches/002-enable_random_mac_addr.patch | 10 + .../uboot-mvebu/patches/003-boot_script.patch | 32 + ...learfog-reset-usom-onboard-1512-phy.patch} | 9 +- package/boot/uboot-mxs/Makefile | 87 +- package/boot/uboot-omap/Makefile | 104 +- .../boot/uboot-omap/files/uEnv-default.txt | 8 - ...ream_image_c_fix_non_android_booting.patch | 33 + .../100-disable_thumb_unknown_errata.patch | 11 + .../patches/101-disable-thumb-omap3.patch | 14 - .../uboot-omap/patches/101-disable_ext.patch | 10 + .../uboot-omap/patches/102-minify-spl.patch | 44 - .../patches/103-disable-fat-write-spl.patch | 27 - .../104-omap3-overo-enable-thumb.patch | 18 - package/boot/uboot-oxnas/Makefile | 90 +- .../arch/arm/cpu/arm1136/nas782x/Makefile | 0 .../arch/arm/cpu/arm1136/nas782x/clock.c | 0 .../arch/arm/cpu/arm1136/nas782x/pinmux.c | 0 .../arch/arm/cpu/arm1136/nas782x/reset.c | 0 .../arch/arm/cpu/arm1136/nas782x/timer.c | 0 .../arch/arm/include/asm/arch-nas782x/clock.h | 0 .../arch/arm/include/asm/arch-nas782x/cpu.h | 0 .../arm/include/asm/arch-nas782x/hardware.h | 0 .../arm/include/asm/arch-nas782x/pinmux.h | 0 .../arch/arm/include/asm/arch-nas782x/spl.h | 0 .../arm/include/asm/arch-nas782x/sysctl.h | 0 .../arch/arm/include/asm/arch-nas782x/timer.h | 0 .../{src => files}/board/ox820/Kconfig | 0 .../{src => files}/board/ox820/MAINTAINERS | 0 .../{src => files}/board/ox820/Makefile | 0 .../{src => files}/board/ox820/ddr.c | 0 .../{src => files}/board/ox820/ddr.h | 0 .../board/ox820/lowlevel_init.S | 0 .../{src => files}/board/ox820/ox820.c | 0 .../{src => files}/board/ox820/spl_start.S | 0 .../{src => files}/board/ox820/u-boot-spl.lds | 0 .../{src => files}/common/env_ext4.c | 0 .../{src => files}/common/spl/spl_block.c | 0 .../{src => files}/configs/ox820_defconfig | 0 .../drivers/block/plxsata_ide.c | 0 .../drivers/usb/host/ehci-oxnas.c | 0 .../{src => files}/include/configs/ox820.h | 0 .../{src => files}/tools/mkox820crc.c | 0 package/boot/uboot-pxa/Makefile | 91 + .../001-squashfs_rootfstype_cmdline.patch | 13 + package/boot/uboot-sunxi/Makefile | 263 +- .../patches/001-use-dtc-in-kernel.patch | 11 + .../patches/002-add-olimex-a13-som.patch | 3 +- .../003-add-theobroma-a31-pangolin.patch | 22 +- .../010-dt-sync-files-with-kernel.patch | 1403 ++++ .../011-dt-sync-dts-files-with-kernel.patch | 7211 +++++++++++++++++ .../012-sun6i-fix-clock_twi_onoff.patch | 38 + .../patches/013-enable-realtek-phy.patch | 24 + .../patches/014-fix-gmac-init.patch | 127 + .../015-fix-2nd-usb-ctrler-on-sun47i.patch | 78 + .../patches/016-spl-print-mmc-slot.patch | 31 + ...17-usb-add-support-for-usb3-vbus-pin.patch | 39 + ...8-usb-specify-vbus-pins-on-orangepis.patch | 31 + ...19-sid-add-efuse-support-for-h3-a83t.patch | 33 + ...-boot-display-board-model-on-startup.patch | 23 + ...t-for-Olimex-A20-OLinuXino-LIME2-eMM.patch | 76 - ...ange-node-name-for-pwrseq-pin-on-Oli.patch | 31 - .../patches/062-A20-improve-gmac-upload.patch | 12 - ...1-sun6i-sync-PLL1-multdiv-with-Boot1.patch | 6 +- .../093-sun6i-fix-PLL-LDO-voltselect.patch | 15 +- .../100-sun6i-alternate-on-UART2.patch | 4 +- .../101-sun6i-support-console-on-UART2.patch | 8 +- ...2-sunxi-make_CONS_INDEX-configurable.patch | 6 +- ...-environment-for-dtc-binary-location.patch | 35 - ...ile-Build-python-libfdt-library-if-n.patch | 89 - ...akefile.lib-Always-have-.-u-boot.dts.patch | 26 - ...ert-Avoid-non-portable-sed-construct.patch | 21 - ...rt-sunxi-Use-binman-for-sunxi-boards.patch | 58 - ...d-device-tree-for-Orange-Pi-R1-board.patch | 182 - .../301-sunxi-add-orangepi-R1-defconfig.patch | 48 - ...nxi-Fix-CONFIG_SUNXI_GMAC-references.patch | 83 - package/boot/uboot-sunxi/uEnv-a64.txt | 5 - package/boot/uboot-zynq/Makefile | 115 +- package/devel/binutils/Makefile | 1 - package/devel/gdb-arc/Makefile | 6 +- package/devel/gdb/Makefile | 10 +- .../001-gdb-pr14523-mips-signal-number.patch | 2 +- package/devel/gdb/patches/100-musl_fix.patch | 2 +- .../devel/gdb/patches/110-shared_libgcc.patch | 76 - .../120-sigprocmask-invalid-call.patch | 38 - package/devel/perf/Makefile | 5 +- package/devel/strace/Makefile | 6 +- package/devel/valgrind/Makefile | 1 - package/lean/default-settings/Makefile | 2 +- .../files/zzz-default-settings | 5 +- .../lean/luci-app-shadowsocksr-pro/Makefile | 2 +- .../root/etc/uci-defaults/shadowsocksr | 3 - .../patches/001-throw-in-funcdef.patch | 16 +- package/libs/{wolfssl => cyassl}/Config.in | 26 +- package/libs/{wolfssl => cyassl}/Makefile | 49 +- .../patches/001-CVE-2017-13099.patch | 0 .../400-additional_compatibility.patch | 0 package/libs/elfutils/Makefile | 1 - package/libs/gettext-full/Makefile | 1 - .../patches/000-relocatable.patch | 8 +- package/libs/libevent2/Makefile | 1 - package/libs/libiconv-full/Makefile | 2 +- package/libs/libjson-c/Makefile | 3 +- package/libs/libnetfilter-conntrack/Makefile | 12 +- package/libs/libnetfilter-queue/Makefile | 8 +- .../patches/100-checksum_computation.patch | 18 +- package/libs/libnftnl/Makefile | 8 +- package/libs/libnl/Makefile | 16 +- ...-of-strerror_l-if-it-doesn-t-exist-i.patch | 105 + ...ivate-field-in-libnl-pkg-config-file.patch | 30 - ...workaround-to-the-libc-compat.h-copy.patch | 103 - ...ild-enable-building-cli-during-tests.patch | 115 - package/libs/libpcap/Makefile | 3 +- .../libs/{readline => libreadline}/Makefile | 3 - .../patches/001-install_perm.patch | 0 package/libs/libtool/Makefile | 1 - package/libs/libubox/Makefile | 4 +- package/libs/libunwind/Makefile | 1 - package/libs/libusb-compat/Makefile | 6 +- package/libs/lzo/Makefile | 4 + package/libs/mbedtls/Makefile | 1 - package/libs/mbedtls/patches/200-config.patch | 9 + package/libs/ncurses/Makefile | 20 - package/libs/nghttp2/Makefile | 45 - package/libs/openssl/Config.in | 5 - package/libs/openssl/Makefile | 23 +- .../patches/110-optimize-for-size.patch | 3 +- .../patches/160-disable_doc_tests.patch | 4 +- .../openssl/patches/200-parallel_build.patch | 10 +- package/libs/toolchain/Makefile | 51 +- package/libs/ustream-ssl/Makefile | 14 +- .../patches/100-disable-hardening-check.patch | 11 - package/network/config/firewall/Makefile | 6 +- package/network/config/gre/Makefile | 2 +- package/network/config/gre/files/gre.sh | 11 +- package/network/config/ltq-adsl-app/Makefile | 11 +- .../config/ltq-adsl-app/files/10-adsl_rename | 7 - .../config/ltq-adsl-app/files/10_atm.sh | 31 - .../config/ltq-adsl-app/files/10_ptm.sh | 29 - .../config/ltq-adsl-app/files/dsl_control | 19 +- .../100-add-more-script-notifications.patch | 42 - package/network/config/ltq-vdsl-app/Makefile | 8 +- .../config/ltq-vdsl-app/files/10-xdsl_rename | 7 - .../config/ltq-vdsl-app/files/10_atm.sh | 16 - .../config/ltq-vdsl-app/files/10_ptm.sh | 14 - .../config/ltq-vdsl-app/files/dsl_control | 48 +- .../files/vdsl_cpe_control_wrapper | 11 + package/network/config/qos-scripts/Makefile | 1 - package/network/config/vti/Makefile | 2 +- package/network/config/vti/files/vti.sh | 7 +- package/network/config/vxlan/Makefile | 32 - package/network/config/vxlan/files/vxlan.sh | 148 - package/network/ipv6/6rd/Makefile | 2 +- package/network/ipv6/6rd/files/6rd.sh | 8 +- package/network/ipv6/map/Makefile | 2 +- package/network/ipv6/map/files/map.sh | 17 +- package/network/ipv6/map/src/mapcalc.c | 2 +- package/network/ipv6/odhcp6c/Makefile | 13 +- .../network/ipv6/odhcp6c/files/dhcpv6.script | 17 - package/network/ipv6/odhcp6c/files/dhcpv6.sh | 7 +- package/network/services/dnsmasq/Makefile | 32 +- .../services/dnsmasq/files/dhcp-script.sh | 46 - .../network/services/dnsmasq/files/dhcp.conf | 2 +- .../services/dnsmasq/files/dnsmasq.init | 388 +- .../services/dnsmasq/files/dnsmasq_acl.json | 4 - .../services/dnsmasq/files/rfc6761.conf | 15 - .../services/dnsmasq/patches/240-ubus.patch | 128 - package/network/services/dropbear/Makefile | 3 +- .../patches/120-openwrt_options.patch | 6 +- package/network/services/hostapd/Makefile | 10 +- .../hostapd/files/hostapd-full.config | 262 +- .../hostapd/files/hostapd-mini.config | 256 +- .../network/services/hostapd/files/hostapd.sh | 66 +- .../hostapd/files/wpa_supplicant-full.config | 373 +- .../hostapd/files/wpa_supplicant-mini.config | 392 +- .../hostapd/files/wpa_supplicant-p2p.config | 369 +- ...on-between-AssocResp-callback-and-4a.patch | 83 + ...Reassociation-Request-frame-dropping.patch | 36 + ...-clearing-on-Authentication-frame-RX.patch | 40 + ...ibility-to-send-debug-messages-to-sy.patch | 145 + ...-key-reinstallation-in-FT-handshake.patch} | 60 +- ...ation-of-an-already-in-use-group-ke.patch} | 22 +- ...-of-GTK-IGTK-reinstallation-of-WNM-.patch} | 31 +- ...vent-installation-of-an-all-zero-TK.patch} | 16 +- ...K-rekeying-to-generate-a-new-ANonce.patch} | 4 +- ...-TDLS-Reject-TPK-TK-reconfiguration.patch} | 4 +- ...eep-Mode-Response-without-pending-r.patch} | 0 ...ultiple-Reassociation-Response-fram.patch} | 16 +- ...ons-wpa_group_update_count-and-wpa_p.patch | 305 + ...-against-PTK-reinstalls-in-4-way-ha.patch} | 0 ...and-check-for-this-when-deriving-PT.patch} | 0 ...workaround-for-key-reinstallation-a.patch} | 34 +- ...tentcy-checks-for-PTK-component-len.patch} | 22 +- ...mation-in-supplicant-state-machine-.patch} | 0 ...eep-Mode-Request-in-wnm_sleep_mode-.patch} | 0 .../hostapd/patches/100-daemonize_fix.patch | 2 +- .../hostapd/patches/110-no_eapol_fix.patch | 2 +- ...120-disable_bridge_packet_workaround.patch | 2 +- .../hostapd/patches/200-multicall.patch | 57 +- .../services/hostapd/patches/300-noscan.patch | 6 +- .../patches/310-rescan_immediately.patch | 2 +- .../patches/330-nl80211_fix_set_freq.patch | 2 +- .../patches/340-reload_freq_change.patch | 6 +- .../patches/350-nl80211_del_beacon_bss.patch | 46 +- .../patches/360-ctrl_iface_reload.patch | 8 +- .../hostapd/patches/370-ap_sta_support.patch | 20 +- .../patches/380-disable_ctrl_iface_mib.patch | 32 +- .../patches/390-wpa_ie_cap_workaround.patch | 4 +- .../patches/420-indicate-features.patch | 4 +- .../patches/430-hostapd_cli_ifdef.patch | 16 +- ...dd-new-config-params-to-be-used-with.patch | 16 +- ...-use-new-parameters-during-ibss-join.patch | 4 +- .../462-wpa_s-support-htmode-param.patch | 156 + .../patches/463-add-mcast_rate-to-11s.patch | 6 +- .../patches/464-fix-mesh-obss-check.patch | 19 - .../patches/470-survey_data_fallback.patch | 2 +- .../hostapd/patches/600-ubus_support.patch | 113 +- .../services/hostapd/src/src/ap/ubus.c | 220 - .../services/hostapd/src/src/ap/ubus.h | 5 - package/network/services/ipset-dns/Makefile | 6 +- .../patches/100-simultaneous-ipv4-ipv6.patch | 57 + package/network/services/lldpd/Makefile | 4 +- .../network/services/lldpd/files/lldpd.config | 2 +- .../network/services/lldpd/files/lldpd.init | 2 +- package/network/services/odhcpd/Makefile | 96 +- .../services/odhcpd/files/odhcpd.defaults | 1 - .../services/openvpn-easy-rsa/Makefile | 41 +- .../openvpn-easy-rsa/files/easy-rsa.index | 0 .../openvpn-easy-rsa/files/easy-rsa.serial | 1 + .../files/openvpn-easy-rsa.upgrade | 1 - .../patches/100-run-ootb.patch | 152 + package/network/services/openvpn/Makefile | 1 - package/network/services/ppp/Makefile | 2 +- package/network/services/ppp/files/ppp.sh | 9 - .../ppp/patches/140-pppoe_compile_fix.patch | 62 +- .../ppp/patches/500-add-pptp-plugin.patch | 3 +- .../services/ppp/patches/511-syncppp.patch | 214 - .../services/ppp/patches/520-uniq.patch | 12 +- package/network/services/samba36/Makefile | 34 +- .../services/samba36/files/samba.config | 4 +- .../network/services/samba36/files/samba.init | 6 +- package/network/services/shellsync/Makefile | 34 - .../services/shellsync/src/shellsync.c | 106 - package/network/services/uhttpd/Makefile | 19 +- .../services/uhttpd/files/uhttpd.config | 6 +- .../network/services/uhttpd/files/uhttpd.init | 2 +- package/network/services/umdns/Makefile | 6 +- .../network/utils/adb-enablemodem/Makefile | 26 - .../adb-enablemodem/files/adb-enablemodem | 64 - package/network/utils/arptables/Makefile | 2 +- package/network/utils/comgt/Makefile | 2 +- package/network/utils/comgt/files/ncm.json | 11 - package/network/utils/comgt/files/ncm.sh | 27 +- .../network/utils/conntrack-tools/Makefile | 13 +- package/network/utils/curl/Config.in | 8 +- package/network/utils/curl/Makefile | 28 +- .../patches/001-curl-https-openssl-fix.patch | 34 + .../curl/patches/100-CVE-2017-2629.patch | 33 + .../curl/patches/101-CVE-2017-7407.patch | 165 + .../curl/patches/102-CVE-2017-7468.patch | 264 + .../curl/patches/103-CVE-2017-1000100.patch | 41 + .../curl/patches/104-CVE-2017-1000101.patch | 33 + .../curl/patches/105-CVE-2017-8816.patch | 67 + .../curl/patches/106-CVE-2017-8817.patch | 141 + .../curl/patches/200-no_docs_tests.patch | 28 +- ...bedtls-disable-runtime-version-check.patch | 4 +- package/network/utils/ebtables/Makefile | 2 +- package/network/utils/iperf/Makefile | 13 +- package/network/utils/iperf3/Makefile | 40 +- .../010-iperf-3.3-fix-build-warnings.patch | 300 - package/network/utils/iproute2/Makefile | 83 +- .../utils/iproute2/patches/001-config.patch | 4 +- .../iproute2/patches/004-darwin_fixes.patch | 2 +- .../utils/iproute2/patches/006-no_sctp.patch | 4 +- .../utils/iproute2/patches/007-no_arpd.patch | 6 +- .../utils/iproute2/patches/008-no_netem.patch | 8 +- .../patches/009-keep_libmnl_optional.patch | 11 - .../iproute2/patches/010-type_fixes.patch | 396 + .../patches/100-allow_pfifo_fast.patch | 2 +- .../iproute2/patches/110-extra-ccopts.patch | 2 +- .../iproute2/patches/120-libnetlink-pic.patch | 7 +- .../patches/130-missing_include.patch | 20 + ...bc-compat.h-do-not-rely-on-__GLIBC__.patch | 107 - ...prevent-redefinition-of-struct-ethhd.patch | 67 - .../utils/iproute2/patches/300-ip_tiny.patch | 45 +- .../patches/900-drop_FAILED_POLICY.patch | 33 +- .../910-sanitize_headers_for_musl.patch | 10 + .../patches/911-fix_in_h_include.patch | 30 + .../iproute2/patches/950-add-cake-to-tc.patch | 10 +- ...-monitor-can-t-work-when-NET_NS-is-n.patch | 35 + package/network/utils/ipset/Makefile | 23 +- ...t-reference-to-u_int8_t-with-uint8_t.patch | 25 - package/network/utils/iptables/Makefile | 66 +- .../020-iptables-disable-modprobe.patch | 4 +- .../patches/030-no-libnfnetlink.patch | 94 + .../iptables/patches/050-optional-xml.patch | 2 +- .../iptables/patches/100-bash-location.patch | 8 + .../patches/200-configurable_builtin.patch | 45 +- .../iptables/patches/300-musl_fixes.patch | 127 + .../iptables/patches/600-shared-libext.patch | 60 +- .../700-disable-legacy-revisions.patch | 51 +- package/network/utils/iputils/Makefile | 1 - package/network/utils/iw/Makefile | 3 +- .../utils/iw/patches/001-nl80211_h_sync.patch | 407 +- package/network/utils/iwinfo/Makefile | 6 +- .../network/utils/layerscape/restool/Makefile | 38 - ...ripts-move-shebang-on-the-first-line.patch | 35 - ...ull-path-option-to-dprc-list-command.patch | 151 - ...03-scripts-remove-unnecessary-arrays.patch | 62 - ...scripts-use-restool-full-path-option.patch | 111 - ...e-proper-arithmetic-operation-syntax.patch | 26 - ...cripts-use-strings-instead-of-arrays.patch | 79 - ...-use-Bourne-shell-s-pattern-matching.patch | 126 - ...pts-use-Bourne-shell-instead-of-bash.patch | 32 - ...nd-for-a-improper-sed-substitution-T.patch | 36 - ...pts-use-proper-arithmetic-operations.patch | 44 - ...ompare-strings-with-regexp-expressio.patch | 27 - ...nproc-with-cross-platform-implementa.patch | 27 - package/network/utils/linux-atm/Makefile | 1 - package/network/utils/nftables/Makefile | 8 +- ...atement-fix-print-of-ip-dnat-address.patch | 76 - package/network/utils/tcpdump/Makefile | 1 - .../tcpdump/patches/100-tcpdump_mini.patch | 37 +- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 - package/network/utils/wpan-tools/Makefile | 1 - ...h-fix-compatibility-with-libnl-3.3.0.patch | 44 - package/network/utils/wwan/files/wwan.sh | 26 +- package/network/utils/xtables-addons/Makefile | 10 +- .../patches/201-fix-lua-packetscript.patch | 20 - package/system/fstools/Makefile | 21 +- package/system/fstools/files/blockd.init | 21 - package/system/fstools/files/snapshot | 16 +- package/system/mountd/Makefile | 45 + package/system/mountd/files/mountd.config | 3 + package/system/mountd/files/mountd.init | 22 + package/system/opkg/Makefile | 24 +- package/system/procd/Makefile | 51 +- .../system/procd/files/hotplug-preinit.json | 8 +- package/system/procd/files/hotplug.json | 22 +- package/system/procd/files/nand-preinit.sh | 21 + .../upgrade => system/procd/files}/nand.sh | 100 +- package/system/procd/files/procd.sh | 36 +- package/system/ubox/Makefile | 16 +- package/system/ubus/Makefile | 6 +- package/system/uci/Makefile | 4 +- package/system/uci/files/lib/config/uci.sh | 5 +- package/utils/adb/Makefile | 2 +- package/utils/busybox/Config-defaults.in | 1576 ++-- package/utils/busybox/Makefile | 92 +- package/utils/busybox/config/Config.in | 410 +- .../utils/busybox/config/archival/Config.in | 189 +- .../busybox/config/console-tools/Config.in | 153 +- .../utils/busybox/config/coreutils/Config.in | 1297 +-- .../busybox/config/debianutils/Config.in | 20 +- .../utils/busybox/config/editors/Config.in | 37 +- .../utils/busybox/config/findutils/Config.in | 40 +- package/utils/busybox/config/init/Config.in | 56 +- package/utils/busybox/config/libbb/Config.in | 179 +- .../utils/busybox/config/loginutils/Config.in | 36 +- .../utils/busybox/config/mailutils/Config.in | 18 +- .../utils/busybox/config/miscutils/Config.in | 971 ++- .../utils/busybox/config/modutils/Config.in | 239 +- .../utils/busybox/config/networking/Config.in | 1576 ++-- .../busybox/config/networking/udhcp/Config.in | 86 +- package/utils/busybox/config/procps/Config.in | 288 +- package/utils/busybox/config/runit/Config.in | 7 - .../utils/busybox/config/selinux/Config.in | 41 +- package/utils/busybox/config/shell/Config.in | 457 +- .../utils/busybox/config/sysklogd/Config.in | 3 +- .../utils/busybox/config/util-linux/Config.in | 1062 ++- .../config/util-linux/volume_id/Config.in | 137 +- ...om-do-not-require-that-to-should-hav.patch | 37 + .../patches/102-trylink_mktemp_fix.patch | 20 + .../patches/120-remove_uclibc_rpc_check.patch | 12 + .../patches/200-udhcpc_reduce_msgs.patch | 4 +- .../patches/201-udhcpc_changed_ifindex.patch | 2 +- .../203-udhcpc_renew_no_deconfig.patch | 2 +- .../busybox/patches/210-add_netmsg_util.patch | 54 +- .../busybox/patches/220-add_lock_util.patch | 54 +- .../patches/230-add_nslookup_lede.patch | 24 +- .../busybox/patches/240-telnetd_intr.patch | 2 +- .../busybox/patches/250-date-k-flag.patch | 12 +- .../301-ip-link-fix-netlink-msg-size.patch | 2 +- ...02-ip-rule-add-suppress-prefixlength.patch | 145 + .../patches/302-netlink-alignment.patch | 100 + .../303-ip-route-fix-high-table-ids.patch | 486 ++ ...ch-file-with-x-when-modified_count-0.patch | 100 + ...g-a-new-file-with-ZZ-when-no-editing.patch | 53 + .../500-move-traceroute-applets-to-bin.patch | 13 - .../510-move-passwd-applet-to-bin.patch | 11 - .../busybox/patches/600-cve-2017-16544.patch | 35 - package/utils/bzip2/Makefile | 1 - package/utils/ct-bugcheck/src/bugcheck.sh | 2 +- package/utils/e2fsprogs/Makefile | 24 +- package/utils/f2fs-tools/Makefile | 9 +- ...fs-f2fs-segment.c-718-update_sit_ent.patch | 66 + package/utils/fritz-tools/Makefile | 45 - package/utils/fritz-tools/README.md | 50 - package/utils/fritz-tools/src/CMakeLists.txt | 15 - .../utils/fritz-tools/src/fritz_cal_extract.c | 259 - .../utils/fritz-tools/src/fritz_tffs_read.c | 379 - package/utils/fuse/Makefile | 1 - .../010-lua-5.1.3-lnum-full-260308.patch | 47 +- ...2-lnum-fix-ltle-relational-operators.patch | 4 +- .../utils/lua/patches/020-shared_liblua.patch | 2 +- .../utils/lua/patches/050-honor-cflags.patch | 2 +- .../lua/patches/300-opcode_performance.patch | 32 +- package/utils/otrx/src/otrx.c | 73 +- package/utils/ugps/Makefile | 6 +- package/utils/usbmode/Makefile | 6 +- package/utils/util-linux/Makefile | 14 +- .../001-uclibc_add_libm_to_scriptreplay.patch | 24 + .../patches/003-fix_pkgconfig_files.patch | 4 +- .../util-linux/patches/100-use_urandom.patch | 14 - package/utils/xfsprogs/Makefile | 27 +- .../patches/001-automake-compat.patch | 78 + .../xfsprogs/patches/100-no-selftest.patch | 14 - .../utils/xfsprogs/patches/100-no_aio.patch | 19 + .../utils/xfsprogs/patches/110-subdirs.patch | 12 - .../patches/110-uclibc_no_ustat.patch | 32 + .../xfsprogs/patches/120-disable_assert.patch | 12 - .../xfsprogs/patches/120-portability.patch | 45 + .../patches/130-uclibc_no_xattr.patch | 32 + .../utils/xfsprogs/patches/140-no_po.patch | 19 + .../xfsprogs/patches/150-include_fixes.patch | 72 + .../patches/160-format-security.patch | 29 + 532 files changed, 21439 insertions(+), 17626 deletions(-) rename package/base-files/files/lib/preinit/{02_sysinfo => 10_sysinfo} (100%) delete mode 100755 package/base-files/files/lib/upgrade/stage2 delete mode 100644 package/boot/arm-trusted-firmware-sunxi/Makefile delete mode 100644 package/boot/at91bootstrap/Makefile delete mode 100644 package/boot/at91bootstrap/at91bootstrap.mk delete mode 100644 package/boot/kexec-tools/files/kdump.config delete mode 100644 package/boot/kexec-tools/files/kdump.defaults delete mode 100755 package/boot/kexec-tools/files/kdump.init rename package/boot/uboot-ar71xx/{src => files}/board/zyxel/nbg460n/Makefile (100%) rename package/boot/uboot-ar71xx/{src => files}/board/zyxel/nbg460n/config.mk (100%) rename package/boot/uboot-ar71xx/{src => files}/board/zyxel/nbg460n/lowlevel_init.S (100%) rename package/boot/uboot-ar71xx/{src => files}/board/zyxel/nbg460n/nbg460n.c (100%) rename package/boot/uboot-ar71xx/{src => files}/board/zyxel/nbg460n/u-boot.lds (100%) rename package/boot/uboot-ar71xx/{src => files}/cpu/mips/ar71xx_serial.c (100%) rename package/boot/uboot-ar71xx/{src => files}/drivers/net/ag71xx.c (100%) rename package/boot/uboot-ar71xx/{src => files}/drivers/net/ag71xx.h (100%) rename package/boot/uboot-ar71xx/{src => files}/drivers/net/phy/rtl8366.h (100%) rename package/boot/uboot-ar71xx/{src => files}/drivers/net/phy/rtl8366_mii.c (100%) rename package/boot/uboot-ar71xx/{src => files}/drivers/spi/ar71xx_spi.c (100%) rename package/boot/uboot-ar71xx/{src => files}/include/asm-mips/ar71xx.h (100%) rename package/boot/uboot-ar71xx/{src => files}/include/asm-mips/ar71xx_gpio.h (100%) rename package/boot/uboot-ar71xx/{src => files}/include/configs/nbg460n.h (100%) delete mode 100644 package/boot/uboot-envtools/files/pistachio delete mode 100644 package/boot/uboot-fritz4040/Makefile delete mode 100755 package/boot/uboot-fritz4040/files/upload-to-f4040.sh delete mode 100644 package/boot/uboot-fritz4040/patches/100-private-libgcc.patch delete mode 100644 package/boot/uboot-fritz4040/patches/110-portability.patch create mode 100644 package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch create mode 100644 package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch create mode 100644 package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch create mode 100644 package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch create mode 100644 package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch create mode 100644 package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch delete mode 100644 package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch delete mode 100644 package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch delete mode 100644 package/boot/uboot-lantiq/patches/100-portability.patch create mode 100644 package/boot/uboot-layerscape-32b/Makefile delete mode 100644 package/boot/uboot-layerscape-armv8_32b/Makefile delete mode 100644 package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch delete mode 100644 package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch delete mode 100644 package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch delete mode 100644 package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch delete mode 100644 package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch delete mode 100644 package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch delete mode 100644 package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch delete mode 100644 package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch delete mode 100644 package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch create mode 100644 package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch delete mode 100644 package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch delete mode 100644 package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch create mode 100644 package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch create mode 100644 package/boot/uboot-mvebu/patches/003-boot_script.patch rename package/boot/uboot-mvebu/patches/{0002-clearfog-reset-usom-onboard-1512-phy.patch => 200-clearfog-reset-usom-onboard-1512-phy.patch} (81%) delete mode 100644 package/boot/uboot-omap/files/uEnv-default.txt create mode 100644 package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch create mode 100644 package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch delete mode 100644 package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch create mode 100644 package/boot/uboot-omap/patches/101-disable_ext.patch delete mode 100644 package/boot/uboot-omap/patches/102-minify-spl.patch delete mode 100644 package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch delete mode 100644 package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch rename package/boot/uboot-oxnas/{src => files}/arch/arm/cpu/arm1136/nas782x/Makefile (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/cpu/arm1136/nas782x/clock.c (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/cpu/arm1136/nas782x/pinmux.c (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/cpu/arm1136/nas782x/reset.c (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/cpu/arm1136/nas782x/timer.c (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/clock.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/cpu.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/hardware.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/pinmux.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/spl.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/sysctl.h (100%) rename package/boot/uboot-oxnas/{src => files}/arch/arm/include/asm/arch-nas782x/timer.h (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/Kconfig (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/MAINTAINERS (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/Makefile (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/ddr.c (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/ddr.h (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/lowlevel_init.S (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/ox820.c (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/spl_start.S (100%) rename package/boot/uboot-oxnas/{src => files}/board/ox820/u-boot-spl.lds (100%) rename package/boot/uboot-oxnas/{src => files}/common/env_ext4.c (100%) rename package/boot/uboot-oxnas/{src => files}/common/spl/spl_block.c (100%) rename package/boot/uboot-oxnas/{src => files}/configs/ox820_defconfig (100%) rename package/boot/uboot-oxnas/{src => files}/drivers/block/plxsata_ide.c (100%) rename package/boot/uboot-oxnas/{src => files}/drivers/usb/host/ehci-oxnas.c (100%) rename package/boot/uboot-oxnas/{src => files}/include/configs/ox820.h (100%) rename package/boot/uboot-oxnas/{src => files}/tools/mkox820crc.c (100%) create mode 100644 package/boot/uboot-pxa/Makefile create mode 100644 package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch create mode 100644 package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch create mode 100644 package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch create mode 100644 package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch create mode 100644 package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch create mode 100644 package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch create mode 100644 package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch create mode 100644 package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch create mode 100644 package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch create mode 100644 package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch create mode 100644 package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch create mode 100644 package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch create mode 100644 package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch delete mode 100644 package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch delete mode 100644 package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch delete mode 100644 package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch delete mode 100644 package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch delete mode 100644 package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch delete mode 100644 package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch delete mode 100644 package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch delete mode 100644 package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch delete mode 100644 package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch delete mode 100644 package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch delete mode 100644 package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch delete mode 100644 package/boot/uboot-sunxi/uEnv-a64.txt delete mode 100644 package/devel/gdb/patches/110-shared_libgcc.patch delete mode 100644 package/devel/gdb/patches/120-sigprocmask-invalid-call.patch rename package/libs/{wolfssl => cyassl}/Config.in (63%) rename package/libs/{wolfssl => cyassl}/Makefile (69%) rename package/libs/{wolfssl => cyassl}/patches/001-CVE-2017-13099.patch (100%) rename package/libs/{wolfssl => cyassl}/patches/400-additional_compatibility.patch (100%) create mode 100644 package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch delete mode 100644 package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch delete mode 100644 package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch delete mode 100644 package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch rename package/libs/{readline => libreadline}/Makefile (95%) rename package/libs/{readline => libreadline}/patches/001-install_perm.patch (100%) delete mode 100644 package/libs/nghttp2/Makefile delete mode 100644 package/libs/wolfssl/patches/100-disable-hardening-check.patch delete mode 100644 package/network/config/ltq-adsl-app/files/10-adsl_rename delete mode 100755 package/network/config/ltq-adsl-app/files/10_atm.sh delete mode 100755 package/network/config/ltq-adsl-app/files/10_ptm.sh delete mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch delete mode 100644 package/network/config/ltq-vdsl-app/files/10-xdsl_rename delete mode 100755 package/network/config/ltq-vdsl-app/files/10_atm.sh delete mode 100755 package/network/config/ltq-vdsl-app/files/10_ptm.sh create mode 100644 package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper delete mode 100644 package/network/config/vxlan/Makefile delete mode 100755 package/network/config/vxlan/files/vxlan.sh delete mode 100755 package/network/services/dnsmasq/files/dhcp-script.sh delete mode 100644 package/network/services/dnsmasq/files/dnsmasq_acl.json delete mode 100644 package/network/services/dnsmasq/files/rfc6761.conf delete mode 100644 package/network/services/dnsmasq/patches/240-ubus.patch create mode 100644 package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch create mode 100644 package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch create mode 100644 package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch create mode 100644 package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch rename package/network/services/hostapd/patches/{000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch => 005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch} (84%) rename package/network/services/hostapd/patches/{001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch => 006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch} (91%) rename package/network/services/hostapd/patches/{002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch => 007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch} (84%) rename package/network/services/hostapd/patches/{003-Prevent-installation-of-an-all-zero-TK.patch => 008-Prevent-installation-of-an-all-zero-TK.patch} (76%) rename package/network/services/hostapd/patches/{004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch => 009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch} (94%) rename package/network/services/hostapd/patches/{005-TDLS-Reject-TPK-TK-reconfiguration.patch => 010-TDLS-Reject-TPK-TK-reconfiguration.patch} (97%) rename package/network/services/hostapd/patches/{006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch => 011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch} (100%) rename package/network/services/hostapd/patches/{007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch => 012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch} (84%) create mode 100644 package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch rename package/network/services/hostapd/patches/{008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch => 014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch} (100%) rename package/network/services/hostapd/patches/{009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch => 015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch} (100%) rename package/network/services/hostapd/patches/{010-Optional-AP-side-workaround-for-key-reinstallation-a.patch => 016-Optional-AP-side-workaround-for-key-reinstallation-a.patch} (90%) rename package/network/services/hostapd/patches/{011-Additional-consistentcy-checks-for-PTK-component-len.patch => 017-Additional-consistentcy-checks-for-PTK-component-len.patch} (81%) rename package/network/services/hostapd/patches/{012-Clear-BSSID-information-in-supplicant-state-machine-.patch => 018-Clear-BSSID-information-in-supplicant-state-machine-.patch} (100%) rename package/network/services/hostapd/patches/{013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch => 019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch} (100%) create mode 100644 package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch delete mode 100644 package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch create mode 100644 package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch create mode 100644 package/network/services/openvpn-easy-rsa/files/easy-rsa.index create mode 100644 package/network/services/openvpn-easy-rsa/files/easy-rsa.serial delete mode 100644 package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade create mode 100644 package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch delete mode 100644 package/network/services/ppp/patches/511-syncppp.patch delete mode 100644 package/network/services/shellsync/Makefile delete mode 100644 package/network/services/shellsync/src/shellsync.c delete mode 100644 package/network/utils/adb-enablemodem/Makefile delete mode 100644 package/network/utils/adb-enablemodem/files/adb-enablemodem create mode 100644 package/network/utils/curl/patches/001-curl-https-openssl-fix.patch create mode 100644 package/network/utils/curl/patches/100-CVE-2017-2629.patch create mode 100644 package/network/utils/curl/patches/101-CVE-2017-7407.patch create mode 100644 package/network/utils/curl/patches/102-CVE-2017-7468.patch create mode 100644 package/network/utils/curl/patches/103-CVE-2017-1000100.patch create mode 100644 package/network/utils/curl/patches/104-CVE-2017-1000101.patch create mode 100644 package/network/utils/curl/patches/105-CVE-2017-8816.patch create mode 100644 package/network/utils/curl/patches/106-CVE-2017-8817.patch delete mode 100644 package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch delete mode 100644 package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch create mode 100644 package/network/utils/iproute2/patches/010-type_fixes.patch create mode 100644 package/network/utils/iproute2/patches/130-missing_include.patch delete mode 100644 package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch delete mode 100644 package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch create mode 100644 package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch create mode 100644 package/network/utils/iproute2/patches/911-fix_in_h_include.patch create mode 100644 package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch delete mode 100644 package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch create mode 100644 package/network/utils/iptables/patches/030-no-libnfnetlink.patch create mode 100644 package/network/utils/iptables/patches/100-bash-location.patch create mode 100644 package/network/utils/iptables/patches/300-musl_fixes.patch delete mode 100644 package/network/utils/layerscape/restool/Makefile delete mode 100644 package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch delete mode 100644 package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch delete mode 100644 package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch delete mode 100644 package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch delete mode 100755 package/system/fstools/files/blockd.init create mode 100644 package/system/mountd/Makefile create mode 100644 package/system/mountd/files/mountd.config create mode 100755 package/system/mountd/files/mountd.init create mode 100644 package/system/procd/files/nand-preinit.sh rename package/{base-files/files/lib/upgrade => system/procd/files}/nand.sh (79%) create mode 100644 package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch create mode 100644 package/utils/busybox/patches/102-trylink_mktemp_fix.patch create mode 100644 package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch create mode 100644 package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch create mode 100644 package/utils/busybox/patches/302-netlink-alignment.patch create mode 100644 package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch create mode 100644 package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch create mode 100644 package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch delete mode 100644 package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch delete mode 100644 package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch delete mode 100644 package/utils/busybox/patches/600-cve-2017-16544.patch create mode 100644 package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch delete mode 100644 package/utils/fritz-tools/Makefile delete mode 100644 package/utils/fritz-tools/README.md delete mode 100644 package/utils/fritz-tools/src/CMakeLists.txt delete mode 100644 package/utils/fritz-tools/src/fritz_cal_extract.c delete mode 100644 package/utils/fritz-tools/src/fritz_tffs_read.c create mode 100644 package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch delete mode 100644 package/utils/util-linux/patches/100-use_urandom.patch create mode 100644 package/utils/xfsprogs/patches/001-automake-compat.patch delete mode 100644 package/utils/xfsprogs/patches/100-no-selftest.patch create mode 100644 package/utils/xfsprogs/patches/100-no_aio.patch delete mode 100644 package/utils/xfsprogs/patches/110-subdirs.patch create mode 100644 package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch delete mode 100644 package/utils/xfsprogs/patches/120-disable_assert.patch create mode 100644 package/utils/xfsprogs/patches/120-portability.patch create mode 100644 package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch create mode 100644 package/utils/xfsprogs/patches/140-no_po.patch create mode 100644 package/utils/xfsprogs/patches/150-include_fixes.patch create mode 100644 package/utils/xfsprogs/patches/160-format-security.patch diff --git a/feeds.conf.default b/feeds.conf.default index 040dbdc55..2327d961e 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,7 +1,7 @@ -src-git packages https://git.lede-project.org/feed/packages.git -src-git luci https://git.lede-project.org/project/luci.git -src-git routing https://git.lede-project.org/feed/routing.git -src-git telephony https://git.lede-project.org/feed/telephony.git +src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01 +src-git luci https://git.lede-project.org/project/luci.git;lede-17.01 +src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01 +src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01 #src-git video https://github.com/openwrt/video.git #src-git targets https://github.com/openwrt/targets.git #src-git management https://github.com/openwrt-management/packages.git diff --git a/include/target.mk b/include/target.mk index 40fa7c15c..5decd771f 100644 --- a/include/target.mk +++ b/include/target.mk @@ -13,7 +13,7 @@ __target_inc=1 DEVICE_TYPE?=router # Default packages - the really basic set -DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd \ +DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \ diff --git a/package/Makefile b/package/Makefile index 4fdf41504..cc1e9d4b6 100644 --- a/package/Makefile +++ b/package/Makefile @@ -10,8 +10,8 @@ curdir:=package include $(INCLUDE_DIR)/rootfs.mk -include $(TMP_DIR)/.packagedeps -$(curdir)/autoremove:=1 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m)) +$(curdir)/builddirs-install:=. $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m)) $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m)) ifdef CHECK_ALL @@ -56,14 +56,10 @@ $(curdir)/merge: $(curdir)/merge-index: $(curdir)/merge (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) -ifndef SDK - $(curdir)/compile: $(curdir)/system/opkg/host/compile -endif - -$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) +$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) - mkdir -p $(TARGET_DIR)/tmp + [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp $(call opkg,$(TARGET_DIR)) install \ $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null)) @for file in $(PACKAGE_INSTALL_FILES); do \ diff --git a/package/base-files/Makefile b/package/base-files/Makefile index a7cc4ca48..3fcf20a84 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -9,10 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk -include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=181 +PKG_RELEASE:=173.3 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -20,14 +19,7 @@ PKG_BUILD_DEPENDS:=usign/host PKG_LICENSE:=GPL-2.0 # Extend depends from version.mk -PKG_CONFIG_DEPENDS += \ - CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ - CONFIG_NAND_SUPPORT \ - CONFIG_CLEAN_IPKG \ - CONFIG_PER_FEED_REPO \ - CONFIG_PER_FEED_REPO_ADD_DISABLED \ - CONFIG_PER_FEED_REPO_ADD_COMMENTED \ - $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) +PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE include $(INCLUDE_DIR)/package.mk @@ -39,8 +31,8 @@ endif define Package/base-files SECTION:=base CATEGORY:=Base system - DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool - TITLE:=Base filesystem for OpenWrt + DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool + TITLE:=Base filesystem for Lede URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)-$(REVISION) endef @@ -115,16 +107,9 @@ ifdef CONFIG_SIGNED_PACKAGES endef endif -ifeq ($(CONFIG_NAND_SUPPORT),) - define Package/base-files/nand-support - rm -f $(1)/lib/upgrade/nand.sh - endef -endif - define Package/base-files/install $(CP) ./files/* $(1)/ $(Package/base-files/install-key) - $(Package/base-files/nand-support) if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ fi @@ -186,15 +171,6 @@ define Package/base-files/install echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \ fi \ done - - $(if $(CONFIG_INCLUDE_CONFIG), \ - echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \ - cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config) - - $(if $(CONFIG_CLEAN_IPKG),, \ - mkdir -p $(1)/etc/opkg; \ - $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \ - $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf) endef ifneq ($(DUMP),1) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index bbed567de..a8311fc59 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -223,7 +223,7 @@ generate_static_system() { uci -q batch <<-EOF delete system.@system[0] add system system - set system.@system[-1].hostname='OpenWrt' + set system.@system[-1].hostname='LEDE' set system.@system[-1].timezone='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='64' @@ -233,10 +233,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.openwrt.pool.ntp.org' - add_list system.ntp.server='1.openwrt.pool.ntp.org' - add_list system.ntp.server='2.openwrt.pool.ntp.org' - add_list system.ntp.server='3.openwrt.pool.ntp.org' + add_list system.ntp.server='0.lede.pool.ntp.org' + add_list system.ntp.server='1.lede.pool.ntp.org' + add_list system.ntp.server='2.lede.pool.ntp.org' + add_list system.ntp.server='3.lede.pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/etc/group b/package/base-files/files/etc/group index e8e2adf4a..d36685139 100644 --- a/package/base-files/files/etc/group +++ b/package/base-files/files/etc/group @@ -1,7 +1,6 @@ root:x:0: daemon:x:1: adm:x:4: -tty:x:5: mail:x:8: audio:x:29: www-data:x:33: diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index c790e3e18..7c2a18501 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -72,7 +72,6 @@ load_led() { [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name echo $mode > /sys/class/leds/${sysfs}/mode - echo $interval > /sys/class/leds/${sysfs}/interval } ;; diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 531aa8cbc..8c5f67729 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -7,7 +7,7 @@ USE_PROCD=1 validate_system_section() { uci_validate_section system system "${1}" \ - 'hostname:string:OpenWrt' \ + 'hostname:string:lede' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ 'timezone:string:UTC' \ diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release index d03400ca0..da86208f7 100644 --- a/package/base-files/files/etc/openwrt_release +++ b/package/base-files/files/etc/openwrt_release @@ -1,7 +1,8 @@ DISTRIB_ID='%D' DISTRIB_RELEASE='%V' DISTRIB_REVISION='%R' +DISTRIB_CODENAME='%n' DISTRIB_TARGET='%S' DISTRIB_ARCH='%A' -DISTRIB_DESCRIPTION='%D %V %C' +DISTRIB_DESCRIPTION='%D %N %V %C' DISTRIB_TAINTS='%t' diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index 3e237170b..e80af891e 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -41,15 +41,14 @@ disable() { } enable() { - err=1 name="$(basename "${initscript}")" - [ "$START" ] && \ - ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \ - err=0 - [ "$STOP" ] && \ - ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \ - err=0 - return $err + disable + [ -n "$START" -o -n "$STOP" ] || { + echo "/etc/init.d/$name does not have a START or STOP value" + return 1 + } + [ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" + [ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" } enabled() { @@ -89,10 +88,6 @@ service_triggers() { return 0 } -service_data() { - return 0 -} - service_running() { return 0 } @@ -127,14 +122,12 @@ ${INIT_TRACE:+set -x} } stop() { - procd_lock stop_service "$@" procd_kill "$(basename ${basescript:-$initscript})" "$1" } reload() { if eval "type reload_service" 2>/dev/null >/dev/null; then - procd_lock reload_service "$@" else start diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf index ddc7a9bf6..91a3ac9a0 100644 --- a/package/base-files/files/etc/sysctl.conf +++ b/package/base-files/files/etc/sysctl.conf @@ -1,6 +1,5 @@ kernel.panic=3 kernel.core_pattern=/tmp/%e.%t.%p.%s.core -fs.suid_dumpable=2 net.ipv4.conf.default.arp_ignore=1 net.ipv4.conf.all.arp_ignore=1 diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index dfadfdb2d..bea5f0f96 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -202,7 +202,7 @@ add_group_and_user() { if [ -n "$gname" ] && [ -n "$gid" ]; then group_exists "$gname" || group_add "$gname" "$gid" elif [ -n "$gname" ]; then - gid="$(group_add_next "$gname")" + group_add_next "$gname"; gid=$? fi if [ -n "$uname" ]; then @@ -235,10 +235,6 @@ default_postinst() { rm -fR $root/rootfs-overlay/ fi - if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then - kmodloader - fi - if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci @@ -296,7 +292,9 @@ group_add() { [ -f "${IPKG_INSTROOT}/etc/group" ] || return 1 [ -n "$IPKG_INSTROOT" ] || lock /var/lock/group echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group + rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group + return $rc } group_exists() { @@ -306,17 +304,14 @@ group_exists() { group_add_next() { local gid gids gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - if [ -n "$gid" ]; then - echo $gid - return - fi + [ -n "$gid" ] && return $gid gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - gid=65536 - while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do + gid=100 + while [ -n "$(echo $gids | grep $gid)" ] ; do gid=$((gid + 1)) done group_add $1 $gid - echo $gid + return $gid } group_add_user() { @@ -339,8 +334,8 @@ user_add() { local rc [ -z "$uid" ] && { uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3) - uid=65536 - while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do + uid=100 + while [ -n "$(echo $uids | grep $uid)" ] ; do uid=$((uid + 1)) done } @@ -349,7 +344,9 @@ user_add() { [ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow + rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd + return $rc } user_exists() { diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index 83e775fad..857e7e539 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -1,18 +1,6 @@ #!/bin/sh # Copyright (C) 2013 OpenWrt.org -get_dt_led() { - local label - local ledpath - local basepath="/proc/device-tree" - local nodepath="$basepath/aliases/led-$1" - - [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") - [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") - - echo "$label" -} - led_set_attr() { [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" } diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 82ac1d2a4..7cc63ffc8 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -160,7 +160,7 @@ _ucidef_finish_switch_roles() { json_select .. json_select .. - if [ ${need_tag:-0} -eq 1 -o ${want_untag:-0} -ne 1 ]; then + if [ $n_vlan -gt $n_cpu -o ${need_tag:-0} -eq 1 ]; then num="${num}t" device="${device}.${index}" fi @@ -358,59 +358,19 @@ ucidef_add_vdsl_modem() { json_select .. } -ucidef_set_led_ataport() { - _ucidef_set_led_trigger "$1" "$2" "$3" ata"$4" -} - -_ucidef_set_led_common() { +ucidef_set_led_netdev() { local cfg="led_$1" local name="$2" local sysfs="$3" + local dev="$4" + local mode="${5:-link tx rx}" json_select_object led json_select_object "$1" json_add_string name "$name" - json_add_string sysfs "$sysfs" -} - -ucidef_set_led_default() { - local default="$4" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string default "$default" - json_select .. - - json_select .. -} - -ucidef_set_led_gpio() { - local gpio="$4" - local inverted="$5" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string trigger "$trigger" - json_add_string type gpio - json_add_int gpio "$gpio" - json_add_boolean inverted "$inverted" - json_select .. - - json_select .. -} - -ucidef_set_led_ide() { - _ucidef_set_led_trigger "$1" "$2" "$3" ide-disk -} - -ucidef_set_led_netdev() { - local dev="$4" - local mode="${5:-link tx rx}" - - _ucidef_set_led_common "$1" "$2" "$3" - json_add_string type netdev + json_add_string sysfs "$sysfs" json_add_string device "$dev" json_add_string mode "$mode" json_select .. @@ -418,106 +378,24 @@ ucidef_set_led_netdev() { json_select .. } -ucidef_set_led_oneshot() { - _ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5 -} - -ucidef_set_led_portstate() { - local port_state="$4" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string trigger port_state - json_add_string type portstate - json_add_string port_state "$port_state" - json_select .. - - json_select .. -} - -ucidef_set_led_rssi() { - local iface="$4" - local minq="$5" - local maxq="$6" - local offset="${7:-0}" - local factor="${8:-1}" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string type rssi - json_add_string name "$name" - json_add_string iface "$iface" - json_add_string minq "$minq" - json_add_string maxq "$maxq" - json_add_string offset "$offset" - json_add_string factor "$factor" - json_select .. - - json_select .. -} - -ucidef_set_led_switch() { - local trigger_name="$4" - local port_mask="$5" - local speed_mask="$6" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string trigger "$trigger_name" - json_add_string type switch - json_add_string port_mask "$port_mask" - json_add_string speed_mask "$speed_mask" - json_select .. - - json_select .. -} - -_ucidef_set_led_timer() { - local trigger_name="$4" - local delayon="$5" - local delayoff="$6" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string trigger "$trigger_name" - json_add_int delayon "$delayon" - json_add_int delayoff "$delayoff" - json_select .. - - json_select .. -} - -ucidef_set_led_timer() { - _ucidef_set_led_timer $1 $2 $3 "timer" $4 $5 -} - -_ucidef_set_led_trigger() { - local trigger_name="$4" - - _ucidef_set_led_common "$1" "$2" "$3" - - json_add_string trigger "$trigger_name" - json_select .. - - json_select .. -} - ucidef_set_led_usbdev() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" local dev="$4" - _ucidef_set_led_common "$1" "$2" "$3" + json_select_object led + json_select_object "$1" + json_add_string name "$name" json_add_string type usb + json_add_string sysfs "$sysfs" json_add_string device "$dev" json_select .. json_select .. } -ucidef_set_led_usbhost() { - _ucidef_set_led_trigger "$1" "$2" "$3" usb-host -} - ucidef_set_led_usbport() { local obj="$1" local name="$2" @@ -526,9 +404,12 @@ ucidef_set_led_usbport() { shift shift - _ucidef_set_led_common "$obj" "$name" "$sysfs" + json_select_object led + json_select_object "$obj" + json_add_string name "$name" json_add_string type usbport + json_add_string sysfs "$sysfs" json_select_array ports for port in "$@"; do json_add_string port "$port" @@ -540,7 +421,171 @@ ucidef_set_led_usbport() { } ucidef_set_led_wlan() { - _ucidef_set_led_trigger "$1" "$2" "$3" "$4" + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local trigger="$4" + + json_select_object led + + json_select_object "$1" + json_add_string name "$name" + json_add_string type trigger + json_add_string sysfs "$sysfs" + json_add_string trigger "$trigger" + json_select .. + + json_select .. +} + +ucidef_set_led_switch() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local trigger="$4" + local port_mask="$5" + local speed_mask="$6" + + json_select_object led + + json_select_object "$1" + json_add_string name "$name" + json_add_string type switch + json_add_string sysfs "$sysfs" + json_add_string trigger "$trigger" + json_add_string port_mask "$port_mask" + json_add_string speed_mask "$speed_mask" + json_select .. + + json_select .. +} + +ucidef_set_led_portstate() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local port_state="$4" + + json_select_object led + + json_select_object "$1" + json_add_string name "$name" + json_add_string type portstate + json_add_string sysfs "$sysfs" + json_add_string trigger port_state + json_add_string port_state "$port_state" + json_select .. + + json_select .. +} + +ucidef_set_led_default() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local default="$4" + + json_select_object led + + json_select_object "$1" + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_string default "$default" + json_select .. + + json_select .. +} + +ucidef_set_led_gpio() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local gpio="$4" + local inverted="$5" + + json_select_object led + + json_select_object "$1" + json_add_string type gpio + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_string trigger "$trigger" + json_add_int gpio "$gpio" + json_add_boolean inverted "$inverted" + json_select .. + + json_select .. +} + +ucidef_set_led_ide() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + + json_select_object led + + json_select_object "$1" + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_string trigger ide-disk + json_select .. + + json_select .. +} + +__ucidef_set_led_timer() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local trigger="$4" + local delayon="$5" + local delayoff="$6" + + json_select_object led + + json_select_object "$1" + json_add_string type "$trigger" + json_add_string name "$name" + json_add_string sysfs "$sysfs" + json_add_int delayon "$delayon" + json_add_int delayoff "$delayoff" + json_select .. + + json_select .. +} + +ucidef_set_led_oneshot() { + __ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5 +} + +ucidef_set_led_timer() { + __ucidef_set_led_timer $1 $2 $3 "timer" $4 $5 +} + +ucidef_set_led_rssi() { + local cfg="led_$1" + local name="$2" + local sysfs="$3" + local iface="$4" + local minq="$5" + local maxq="$6" + local offset="$7" + local factor="$8" + + json_select_object led + + json_select_object "$1" + json_add_string type rssi + json_add_string name "$name" + json_add_string iface "$iface" + json_add_string sysfs "$sysfs" + json_add_string minq "$minq" + json_add_string maxq "$maxq" + json_add_string offset "$offset" + json_add_string factor "$factor" + json_select .. + + json_select .. } ucidef_set_rssimon() { @@ -556,6 +601,7 @@ ucidef_set_rssimon() { json_select .. json_select .. + } ucidef_add_gpio_switch() { diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index c3ec7bfdf..5442a749b 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -113,7 +113,7 @@ preinit_ip() { preinit_config_board fi - preinit_net_echo "Doing OpenWrt Preinit\n" + preinit_net_echo "Doing Lede Preinit\n" } preinit_ip_deconfig() { diff --git a/package/base-files/files/lib/preinit/02_sysinfo b/package/base-files/files/lib/preinit/10_sysinfo similarity index 100% rename from package/base-files/files/lib/preinit/02_sysinfo rename to package/base-files/files/lib/preinit/10_sysinfo diff --git a/package/base-files/files/lib/preinit/40_run_failsafe_hook b/package/base-files/files/lib/preinit/40_run_failsafe_hook index 533b0a977..7301f7734 100644 --- a/package/base-files/files/lib/preinit/40_run_failsafe_hook +++ b/package/base-files/files/lib/preinit/40_run_failsafe_hook @@ -5,12 +5,8 @@ run_failsafe_hook() { [ "$pi_preinit_no_failsafe" = "y" ] && return if [ "$FAILSAFE" = "true" ]; then - lock /tmp/.failsafe boot_run_hook failsafe - while [ ! -e /tmp/sysupgrade ]; do - lock -w /tmp/.failsafe - done - exit + lock -w /tmp/.failsafe fi } diff --git a/package/base-files/files/lib/preinit/99_10_failsafe_login b/package/base-files/files/lib/preinit/99_10_failsafe_login index 728c63b2e..3147cdc5a 100644 --- a/package/base-files/files/lib/preinit/99_10_failsafe_login +++ b/package/base-files/files/lib/preinit/99_10_failsafe_login @@ -8,13 +8,10 @@ failsafe_netlogin () { } failsafe_shell() { - local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')" - [ -n "$console" ] || console=console - [ -c "/dev/$console" ] || return 0 - while true; do - ash --login <"/dev/$console" >"/dev/$console" 2>"/dev/$console" - sleep 1 - done & + lock /tmp/.failsafe + ash --login + echo "Please reboot system when done with failsafe network logins" + while true; do sleep 1; done } boot_hook_add failsafe failsafe_netlogin diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 71cffc858..3ddd1e746 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -6,33 +6,143 @@ RAM_ROOT=/tmp/root libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; } install_file() { # [ ... ] - local target dest dir for file in "$@"; do - if [ -L "$file" ]; then - target="$(readlink -f "$file")" - dest="$RAM_ROOT/$file" - [ ! -f "$dest" ] && { - dir="$(dirname "$dest")" - mkdir -p "$dir" - ln -s "$target" "$dest" - } - file="$target" - fi dest="$RAM_ROOT/$file" - [ -f "$file" -a ! -f "$dest" ] && { - dir="$(dirname "$dest")" + [ -f $file -a ! -f $dest ] && { + dir="$(dirname $dest)" mkdir -p "$dir" - cp "$file" "$dest" + cp $file $dest } done } -install_bin() { - local src files +install_bin() { # [ ... ] src=$1 files=$1 [ -x "$src" ] && files="$src $(libs $src)" install_file $files + shift + for link in "$@"; do { + dest="$RAM_ROOT/$link" + dir="$(dirname $dest)" + mkdir -p "$dir" + [ -f "$dest" ] || ln -s $src $dest + }; done +} + +supivot() { # + /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1 + mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \ + /bin/mount -o noatime,move /proc $1/proc && \ + pivot_root $1 $1$2 || { + /bin/umount -l $1 $1 + return 1 + } + + /bin/mount -o noatime,move $2/sys /sys + /bin/mount -o noatime,move $2/dev /dev + /bin/mount -o noatime,move $2/tmp /tmp + /bin/mount -o noatime,move $2/overlay /overlay 2>&- + return 0 +} + +run_ramfs() { # [...] + install_bin /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \ + /sbin/pivot_root /sbin/reboot /bin/sync /bin/dd /bin/grep \ + /bin/cp /bin/mv /bin/tar /usr/bin/md5sum "/usr/bin/[" /bin/dd \ + /bin/vi /bin/ls /bin/cat /usr/bin/awk /usr/bin/hexdump \ + /bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc \ + /bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir \ + /bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/find \ + /bin/mknod + + install_bin /bin/uclient-fetch /bin/wget + install_bin /sbin/mtd + install_bin /sbin/mount_root + install_bin /sbin/snapshot + install_bin /sbin/snapshot_tool + install_bin /usr/sbin/ubiupdatevol + install_bin /usr/sbin/ubiattach + install_bin /usr/sbin/ubiblock + install_bin /usr/sbin/ubiformat + install_bin /usr/sbin/ubidetach + install_bin /usr/sbin/ubirsvol + install_bin /usr/sbin/ubirmvol + install_bin /usr/sbin/ubimkvol + install_bin /usr/sbin/partx + install_bin /usr/sbin/losetup + install_bin /usr/sbin/mkfs.ext4 + for file in $RAMFS_COPY_BIN; do + install_bin ${file//:/ } + done + install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA + + [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 + + supivot $RAM_ROOT /mnt || { + echo "Failed to switch over to ramfs. Please reboot." + exit 1 + } + + /bin/mount -o remount,ro /mnt + /bin/umount -l /mnt + + grep /overlay /proc/mounts > /dev/null && { + /bin/mount -o noatime,remount,ro /overlay + /bin/umount -l /overlay + } + + # spawn a new shell from ramdisk to reduce the probability of cache issues + exec /bin/busybox ash -c "$*" +} + +kill_remaining() { # [ ] + local sig="${1:-TERM}" + echo -n "Sending $sig to remaining processes ... " + + local my_pid=$$ + local my_ppid=$(cut -d' ' -f4 /proc/$my_pid/stat) + local my_ppisupgraded= + grep -q upgraded /proc/$my_ppid/cmdline >/dev/null && { + local my_ppisupgraded=1 + } + + local stat + for stat in /proc/[0-9]*/stat; do + [ -f "$stat" ] || continue + + local pid name state ppid rest + read pid name state ppid rest < $stat + name="${name#(}"; name="${name%)}" + + local cmdline + read cmdline < /proc/$pid/cmdline + + # Skip kernel threads + [ -n "$cmdline" ] || continue + + if [ $$ -eq 1 ] || [ $my_ppid -eq 1 ] && [ -n "$my_ppisupgraded" ]; then + # Running as init process, kill everything except me + if [ $pid -ne $$ ] && [ $pid -ne $my_ppid ]; then + echo -n "$name " + kill -$sig $pid 2>/dev/null + fi + else + case "$name" in + # Skip essential services + *procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*|*nas*|*relayd*) : ;; + + # Killable process + *) + if [ $pid -ne $$ ] && [ $ppid -ne $$ ]; then + echo -n "$name " + kill -$sig $pid 2>/dev/null + fi + ;; + esac + fi + done + echo "" } run_hooks() { @@ -65,31 +175,28 @@ v() { [ "$VERBOSE" -ge 1 ] && echo "$@" } -json_string() { - local v="$1" - v="${v//\\/\\\\}" - v="${v//\"/\\\"}" - echo "\"$v\"" -} - rootfs_type() { /bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }' } get_image() { # [ ] local from="$1" - local cat="$2" + local conc="$2" + local cmd - if [ -z "$cat" ]; then - local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" + case "$from" in + http://*|ftp://*) cmd="wget -O- -q";; + *) cmd="cat";; + esac + if [ -z "$conc" ]; then + local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" case "$magic" in - 1f8b) cat="zcat";; - 425a) cat="bzcat";; - *) cat="cat";; + 1f8b) conc="zcat";; + 425a) conc="bzcat";; esac fi - $cat "$from" 2>/dev/null + eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}" } get_magic_word() { @@ -221,14 +328,12 @@ default_do_upgrade() { fi } -do_upgrade_stage2() { +do_upgrade() { v "Performing system upgrade..." - if [ -n "$do_upgrade" ]; then - eval "$do_upgrade" - elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then - platform_do_upgrade "$IMAGE" + if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then + platform_do_upgrade "$ARGV" else - default_do_upgrade "$IMAGE" + default_do_upgrade "$ARGV" fi if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then @@ -236,11 +341,12 @@ do_upgrade_stage2() { fi v "Upgrade completed" - sleep 1 - - v "Rebooting system..." - umount -a - reboot -f - sleep 5 - echo b 2>/dev/null >/proc/sysrq-trigger + [ -n "$DELAY" ] && sleep "$DELAY" + ask_bool 1 "Reboot" && { + v "Rebooting system..." + umount -a + reboot -f + sleep 5 + echo b 2>/dev/null >/proc/sysrq-trigger + } } diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 deleted file mode 100755 index 3985d8fd7..000000000 --- a/package/base-files/files/lib/upgrade/stage2 +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh - -. /lib/functions.sh -. /lib/functions/system.sh - -export IMAGE="$1" -COMMAND="$2" - -export ARGV="$IMAGE" -export ARGC=1 - -export SAVE_CONFIG=1 -export SAVE_PARTITIONS=1 - -export INTERACTIVE=0 -export VERBOSE=1 -export CONFFILES=/tmp/sysupgrade.conffiles -export CONF_TAR=/tmp/sysupgrade.tgz - -RAMFS_COPY_BIN= # extra programs for temporary ramfs root -RAMFS_COPY_DATA= # extra data files - - -[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0 -[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0 - -include /lib/upgrade - - -supivot() { # - /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1 - mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \ - /bin/mount -o noatime,move /proc $1/proc && \ - pivot_root $1 $1$2 || { - /bin/umount -l $1 $1 - return 1 - } - - /bin/mount -o noatime,move $2/sys /sys - /bin/mount -o noatime,move $2/dev /dev - /bin/mount -o noatime,move $2/tmp /tmp - /bin/mount -o noatime,move $2/overlay /overlay 2>&- - return 0 -} - -switch_to_ramfs() { - for binary in \ - /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \ - pivot_root mount_root reboot sync kill sleep \ - md5sum hexdump cat zcat bzcat dd tar \ - ls basename find cp mv rm mkdir rmdir mknod touch chmod \ - '[' printf wc grep awk sed cut \ - mtd partx losetup mkfs.ext4 \ - ubiupdatevol ubiattach ubiblock ubiformat \ - ubidetach ubirsvol ubirmvol ubimkvol \ - snapshot snapshot_tool \ - $RAMFS_COPY_BIN - do - local file="$(which "$binary" 2>/dev/null)" - [ -n "$file" ] && install_bin "$file" - done - install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA - - [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 - - supivot $RAM_ROOT /mnt || { - echo "Failed to switch over to ramfs. Please reboot." - exit 1 - } - - /bin/mount -o remount,ro /mnt - /bin/umount -l /mnt - - grep /overlay /proc/mounts > /dev/null && { - /bin/mount -o noatime,remount,ro /overlay - /bin/umount -l /overlay - } -} - -kill_remaining() { # [ [ ] ] - local loop_limit=10 - - local sig="${1:-TERM}" - local loop="${2:-0}" - local run=true - local stat - local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) - - echo -n "Sending $sig to remaining processes ... " - - while $run; do - run=false - for stat in /proc/[0-9]*/stat; do - [ -f "$stat" ] || continue - - local pid name state ppid rest - read pid name state ppid rest < $stat - name="${name#(}"; name="${name%)}" - - # Skip PID1, our parent, ourself and our children - [ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue - - local cmdline - read cmdline < /proc/$pid/cmdline - - # Skip kernel threads - [ -n "$cmdline" ] || continue - - echo -n "$name " - kill -$sig $pid 2>/dev/null - - [ $loop -eq 1 ] && run=true - done - - let loop_limit-- - [ $loop_limit -eq 0 ] && { - echo - echo "Failed to kill all processes." - exit 1 - } - done - echo -} - - -killall -9 telnetd -killall -9 dropbear -killall -9 ash - -kill_remaining TERM -sleep 3 -kill_remaining KILL 1 - -sleep 1 - - -if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then - IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE" - - # Needs to be unset again because of busybox weirdness ... - IS_PRE_UPGRADE= -fi - -if [ -n "$(rootfs_type)" ]; then - echo "Switching to ramdisk..." - switch_to_ramfs -fi - -# Exec new shell from ramfs -exec /bin/busybox ash -c "$COMMAND" diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 3fd612c37..c095ca81c 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -1,15 +1,17 @@ #!/bin/sh - . /lib/functions.sh . /lib/functions/system.sh # initialize defaults +RAMFS_COPY_BIN="" # extra programs for temporary ramfs root +RAMFS_COPY_DATA="" # extra data files export MTD_CONFIG_ARGS="" export INTERACTIVE=0 export VERBOSE=1 export SAVE_CONFIG=1 export SAVE_OVERLAY=0 export SAVE_PARTITIONS=1 +export DELAY= export CONF_IMAGE= export CONF_BACKUP_LIST=0 export CONF_BACKUP= @@ -23,6 +25,7 @@ export TEST=0 while [ -n "$1" ]; do case "$1" in -i) export INTERACTIVE=1;; + -d) export DELAY="$2"; shift;; -v) export VERBOSE="$(($VERBOSE + 1))";; -q) export VERBOSE="$(($VERBOSE - 1))";; -n) export SAVE_CONFIG=0;; @@ -47,9 +50,10 @@ done export CONFFILES=/tmp/sysupgrade.conffiles export CONF_TAR=/tmp/sysupgrade.tgz -IMAGE="$1" +export ARGV="$*" +export ARGC="$#" -[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && { +[ -z "$ARGV" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && { cat <...] $0 [-q] [-i] @@ -86,7 +90,7 @@ EOF exit 1 } -[ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && { +[ -n "$ARGV" -a -n "$NEED_IMAGE" ] && { cat <<-EOF -b|--create-backup and -r|--restore-backup do not perform a firmware upgrade. Do not specify both -b|-r and a firmware image. @@ -108,8 +112,14 @@ add_uci_conffiles() { add_overlayfiles() { local file="$1" - find /overlay/upper/etc/ -type f -o -type l | sed \ + if [ -d /overlay/upper ]; then + local overlaydir="/overlay/upper" + else + local overlaydir="/overlay" + fi + find $overlaydir/etc/ -type f -o -type l | sed \ -e 's,^/overlay\/upper/,/,' \ + -e 's,^/overlay/,/,' \ -e '\,/META_[a-zA-Z0-9]*$,d' \ -e '\,/functions.sh$,d' \ -e '\,/[^/]*-opkg$,d' \ @@ -120,26 +130,20 @@ add_overlayfiles() { # hooks sysupgrade_image_check="fwtool_check_image platform_check_image" sysupgrade_pre_upgrade="fwtool_pre_upgrade" - -if [ $SAVE_OVERLAY = 1 ]; then - [ ! -d /overlay/upper/etc ] && { - echo "Cannot find '/overlay/upper/etc', required for '-c'" - exit 1 - } +[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \ + sysupgrade_init_conffiles="add_uci_conffiles" || \ sysupgrade_init_conffiles="add_overlayfiles" -else - sysupgrade_init_conffiles="add_uci_conffiles" -fi include /lib/upgrade +[ "$1" = "nand" ] && nand_upgrade_stage2 $@ + do_save_conffiles() { local conf_tar="${1:-$CONF_TAR}" [ -z "$(rootfs_type)" ] && { echo "Cannot save config while running from ramdisk." ask_bool 0 "Abort" && exit - rm -f "$conf_tar" return 0 } run_hooks "$CONFFILES" $sysupgrade_init_conffiles @@ -153,7 +157,7 @@ do_save_conffiles() { } if [ $CONF_BACKUP_LIST -eq 1 ]; then - run_hooks "$CONFFILES" $sysupgrade_init_conffiles + add_uci_conffiles "$CONFFILES" cat "$CONFFILES" rm -f "$CONFFILES" exit 0 @@ -180,33 +184,8 @@ type platform_check_image >/dev/null 2>/dev/null || { exit 1 } -case "$IMAGE" in - http://*) - wget -O/tmp/sysupgrade.img "$IMAGE" - IMAGE=/tmp/sysupgrade.img - ;; -esac - -IMAGE="$(readlink -f "$IMAGE")" - -case "$IMAGE" in - '') - echo "Image file not found." - exit 1 - ;; - /tmp/*) ;; - *) - v "Image not in /tmp, copying..." - cp -f "$IMAGE" /tmp/sysupgrade.img - IMAGE=/tmp/sysupgrade.img - ;; -esac - -export ARGV="$IMAGE" -export ARGC=1 - for check in $sysupgrade_image_check; do - ( $check "$IMAGE" ) || { + ( eval "$check \"\$ARGV\"" ) || { if [ $FORCE -eq 1 ]; then echo "Image check '$check' failed but --force given - will update anyway!" break @@ -232,7 +211,6 @@ elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then [ $TEST -eq 1 ] || do_save_conffiles export SAVE_CONFIG=1 else - [ $TEST -eq 1 ] || rm -f "$CONF_TAR" export SAVE_CONFIG=0 fi @@ -240,26 +218,28 @@ if [ $TEST -eq 1 ]; then exit 0 fi -if [ $SAVE_PARTITIONS -eq 0 ]; then - touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap -else - rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap -fi - run_hooks "" $sysupgrade_pre_upgrade -install_bin /sbin/upgraded -v "Commencing upgrade. All shell sessions will be closed now." - -COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2' - -if [ -n "$FAILSAFE" ]; then - printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade - lock -u /tmp/.failsafe -else - ubus call system sysupgrade "{ - \"prefix\": $(json_string "$RAM_ROOT"), - \"path\": $(json_string "$IMAGE"), - \"command\": $(json_string "$COMMAND") - }" +# Some platforms/devices may want different sysupgrade process, e.g. without +# killing processes yet or calling ubus system upgrade method. +# This is needed e.g. on NAND devices where we just want to trigger stage1 at +# this point. +if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then + platform_pre_upgrade "$ARGV" +fi + +ubus call system upgrade +touch /tmp/sysupgrade + +if [ ! -f /tmp/failsafe ] ; then + kill_remaining TERM + sleep 3 + kill_remaining KILL +fi + +if [ -n "$(rootfs_type)" ]; then + v "Switching to ramdisk..." + run_ramfs '. /lib/functions.sh; include /lib/upgrade; do_upgrade' +else + do_upgrade fi diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 82ade5940..21abf969e 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -1,8 +1,8 @@ NAME="%D" -VERSION="%V" +VERSION="%V, %N" ID="%d" ID_LIKE="lede openwrt" -PRETTY_NAME="%D %V" +PRETTY_NAME="%D %N %V" VERSION_ID="%v" HOME_URL="%m" BUG_URL="%b" @@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M" LEDE_DEVICE_MANUFACTURER_URL="%m" LEDE_DEVICE_PRODUCT="%P" LEDE_DEVICE_REVISION="%h" -LEDE_RELEASE="%D %V %C" +LEDE_RELEASE="%D %N %V %C" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index dbbd60b15..b60053046 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -158,11 +158,18 @@ if VERSIONOPT config VERSION_DIST string prompt "Release distribution" - default "OpenWrt" + default "LEDE" help This is the name of the release distribution. If unspecified, it defaults to OpenWrt. + config VERSION_NICK + string + prompt "Release version nickname" + help + This is the release codename embedded in the image. + If unspecified, it defaults to the name of source branch. + config VERSION_NUMBER string prompt "Release version number" @@ -183,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "http://downloads.lede-project.org/snapshots" + default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -192,13 +199,15 @@ if VERSIONOPT %v .. Configured release version number or "snapshot", lowercase %C .. Configured release revision code or value of %R, uppercase %c .. Configured release revision code or value of %R, lowercase - %D .. Distribution name or "OpenWrt", uppercase - %d .. Distribution name or "openwrt", lowercase + %N .. Release name, uppercase + %n .. Release name, lowercase + %D .. Distribution name or "Lede", uppercase + %d .. Distribution name or "lede", lowercase %T .. Target name %S .. Target/Subtarget name %A .. Package architecture %t .. Build taint flags, e.g. "no-all busybox" - %M .. Manufacturer name or "OpenWrt" + %M .. Manufacturer name or "Lede" %P .. Product name or "Generic" %h .. Hardware revision or "v0" diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile index d90df8e58..fb3c77c37 100644 --- a/package/boot/apex/Makefile +++ b/package/boot/apex/Makefile @@ -56,8 +56,7 @@ define Package/apex/install endef define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/ + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR) endef $(eval $(call BuildPackage,apex)) diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile deleted file mode 100644 index 88d4f6efa..000000000 --- a/package/boot/arm-trusted-firmware-sunxi/Makefile +++ /dev/null @@ -1,52 +0,0 @@ -# -# Copyright (C) 2017 Hauke Mehrtens -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=arm-trusted-firmware-sunxi -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware -PKG_SOURCE_DATE:=2016-07-12 -PKG_SOURCE_VERSION:=87e8aedd80e6448a55b2328768d956fcb5f5d410 -PKG_MIRROR_HASH:=4e71a7d4bc0613533854c646b0fa574b18503c0ab28621aac67c70b9827562d8 - -PKG_LICENSE:=BSD-3-Clause -PKG_LICENSE_FILES:=license.md - -PKG_MAINTAINER:=Hauke Mehrtens - -include $(INCLUDE_DIR)/package.mk - - -define Package/arm-trusted-firmware-sunxi - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=ARM Trusted Firmware for Allwinner - DEPENDS:=@TARGET_sunxi_cortexa53 -endef - -export GCC_HONOUR_COPTS=s - -MAKE_VARS = \ - CROSS_COMPILE="$(TARGET_CROSS)" - -MAKE_FLAGS += \ - PLAT=sun50iw1p1 \ - DEBUG=1 \ - bl31 - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/debug/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin -endef - -define Package/arm-trusted-firmware-sunxi/install -endef - -$(eval $(call BuildPackage,arm-trusted-firmware-sunxi)) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile deleted file mode 100644 index 4571fedc0..000000000 --- a/package/boot/at91bootstrap/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (C) 2016 Microchip Technology Inc. -# -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=at91bootstrap -PKG_VERSION:=v3.8.8 -PKG_RELEASE:= - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git -PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db - -PKG_BUILD_DIR = \ - $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -include at91bootstrap.mk -include $(INCLUDE_DIR)/package.mk - -define AT91Bootstrap/Default - BUILD_TARGET:=at91 - BUILD_SUBTARGET:=sama5 - AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin -endef - -define at91bootstrap/sama5d2_xplaineddf_uboot - TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained -endef - -define at91bootstrap/sama5d2_xplaineddf_qspi_uboot - TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (QSPI Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained -endef - -define at91bootstrap/sama5d2_xplainedsd_uboot - TITLE:=AT91Bootstrap for the SAMA5D2 Xplained board (SDcard/EMMC) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained -endef - -define at91bootstrap/sama5d3_xplainednf_uboot - TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (Nand Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained -endef - -define at91bootstrap/sama5d3_xplainedsd_uboot - TITLE:=AT91Bootstrap for the SAMA5D3 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained -endef - -define at91bootstrap/sama5d4_xplainednf_uboot - TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (Nand Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -define at91bootstrap/sama5d4_xplaineddf_uboot_secure - TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -define at91bootstrap/sama5d4_xplainedsd_uboot_secure - TITLE:=AT91Bootstrap for the SAMA5D4 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -AT91BOOTSTRAP_TARGETS := \ - sama5d2_xplaineddf_uboot \ - sama5d2_xplaineddf_qspi_uboot \ - sama5d2_xplainedsd_uboot \ - sama5d3_xplainednf_uboot \ - sama5d3_xplainedsd_uboot \ - sama5d4_xplainednf_uboot_secure \ - sama5d4_xplaineddf_uboot_secure \ - sama5d4_xplainedsd_uboot_secure - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -$(eval $(call BuildPackage/AT91Bootstrap)) diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk deleted file mode 100644 index dda5fa4e9..000000000 --- a/package/boot/at91bootstrap/at91bootstrap.mk +++ /dev/null @@ -1,88 +0,0 @@ - -PKG_TARGETS := bin -PKG_FLAGS:=nonshared - -export GCC_HONOUR_COPTS=s - -define Package/at91bootstrap/install/default - $(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/ -endef - -Package/at91bootstrap/install = $(Package/at91bootstrap/install/default) - -define AT91Bootstrap/Init - BUILD_TARGET:= - BUILD_SUBTARGET:= - BUILD_DEVICES:= - NAME:= - DEPENDS:= - HIDDEN:= - DEFAULT:= - VARIANT:=$(1) - AT91BOOTSTRAP_CONFIG:=$(1) -endef - -TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET)) - -AT91BOOTSTRAP_MAKE_FLAGS = \ - HOSTCC="$(HOSTCC)" \ - HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \ - HOSTLDFLAGS="" - -define Build/AT91Bootstrap/Target - $(eval $(call AT91Bootstrap/Init,$(1))) - $(eval $(call AT91Bootstrap/Default,$(1))) - $(eval $(call AT91Bootstrap/$(1),$(1))) - - define Package/at91bootstrap-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:= .$(NAME) - VARIANT:=$(VARIANT) - DEPENDS:=@!IN_SDK $(DEPENDS) - HIDDEN:=$(HIDDEN) - ifneq ($(BUILD_TARGET),) - DEPENDS += @$(TARGET_DEP) - ifneq ($(BUILD_DEVICES),) - DEFAULT := y if ($(TARGET_DEP)_Default \ - $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ - $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ - $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) - endif - endif - $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) - URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap - endef - - define Package/at91bootstrap-$(1)/install - $$(Package/at91bootstrap/install) - endef -endef - -define Build/Configure/AT91Bootstrap - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(AT91BOOTSTRAP_CONFIG)_defconfig -endef - - -define Build/Compile/AT91Bootstrap - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - $(AT91BOOTSTRAP_MAKE_FLAGS) -endef - -define BuildPackage/AT91Bootstrap/Defaults - Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) - Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) -endef - -define BuildPackage/AT91Bootstrap - $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) - $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ - $(eval $(call Build/AT91Bootstrap/Target,$(type))) - ) - $(eval $(call Build/DefaultTargets)) - $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ - $(call BuildPackage,at91bootstrap-$(type)) - ) -endef diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile index 8cfc0dcff..b9e79e102 100644 --- a/package/boot/grub2/Makefile +++ b/package/boot/grub2/Makefile @@ -9,7 +9,6 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=grub -PKG_CPE_ID:=cpe:/a:gnu:grub2 PKG_VERSION:=2.02 PKG_RELEASE:=1 diff --git a/package/boot/kexec-tools/Config.in b/package/boot/kexec-tools/Config.in index 068c27e41..03bc6ee80 100644 --- a/package/boot/kexec-tools/Config.in +++ b/package/boot/kexec-tools/Config.in @@ -1,5 +1,12 @@ menu "Configuration" - depends on PACKAGE_kexec + depends on PACKAGE_kexec-tools + +config KEXEC_TOOLS_kdump + bool + prompt "kdump support" + default n + help + Include the kdump utility. config KEXEC_ZLIB bool diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile index 1c686a254..ecd2a6ea1 100644 --- a/package/boot/kexec-tools/Makefile +++ b/package/boot/kexec-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kexec-tools -PKG_VERSION:=2.0.14 +PKG_VERSION:=2.0.14-rc1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec -PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6 +PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b PKG_FIXUP:=autoreconf @@ -21,49 +21,22 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA include $(INCLUDE_DIR)/package.mk -define Package/kexec-tools/Default +define Package/kexec-tools SECTION:=utils CATEGORY:=Utilities + DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma + TITLE:=Kernel boots kernel URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/ MAINTAINER:=Florian Fainelli -endef - -define Package/kexec-tools - $(call Package/kexec-tools/Default) - TITLE:=kexec-tools transition meta package - DEPENDS:=+kexec + MENU:=1 endef define Package/kexec-tools/description - kexec is a set of system calls that allows you to load + kexec is a set of systems call that allows you to load another kernel from the currently executing Linux kernel. - The kexec utility allows to load and boot another kernel. endef -define Package/kexec - $(call Package/kexec-tools/Default) - TITLE:=Kernel boots kernel - DEPENDS:=\ - @armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \ - +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC -endef - -define Package/kexec/description - The kexec utility allows to load and boot another kernel. -endef - -define Package/kdump - $(call Package/kexec-tools/Default) - TITLE:=Kernel crash analysis - DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP -endef - -define Package/kdump/description - The kdump package allows to automatically boot into a - special kernel for analyzing kernel crashes using kdump. -endef - -define Package/kexec/config +define Package/kexec-tools/config source "$(SOURCE)/Config.in" endef @@ -92,45 +65,24 @@ CONFIGURE_VARS += \ BUILD_CC="$(HOSTCC)" \ TARGET_CC="$(TARGET_CC)" +kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump + define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install endef define Package/kexec-tools/install - : -endef - -define Package/kexec/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin + $(INSTALL_BIN) \ + $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \ + $(kexec-extra-sbin-y)) \ + $(kexec-extra-bin-y) \ + $(PKG_INSTALL_DIR)/usr/sbin/kexec \ + $(1)/usr/sbin # make a link for compatability with other distros $(INSTALL_DIR) $(1)/sbin $(LN) ../usr/sbin/kexec $(1)/sbin/kexec endef -define Package/kdump/install - $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin - $(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump - $(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump - $(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump -endef - -define Package/kdump/prerm -#!/bin/sh - -case $$(uname -m) in - i?86|x86_64) - if grep -q " crashkernel=" /boot/grub/grub.cfg; then - mount /boot -o remount,rw - sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg - mount /boot -o remount,ro - fi - ;; -esac -endef - $(eval $(call BuildPackage,kexec-tools)) -$(eval $(call BuildPackage,kexec)) -$(eval $(call BuildPackage,kdump)) diff --git a/package/boot/kexec-tools/files/kdump.config b/package/boot/kexec-tools/files/kdump.config deleted file mode 100644 index dc6054ffd..000000000 --- a/package/boot/kexec-tools/files/kdump.config +++ /dev/null @@ -1,7 +0,0 @@ - -config kdump - option enabled '1' - option save_dmesg '1' - option save_vmcore '0' -# using an external partition to store vmcore is highly recommended! -# option path '/mnt/crashdump' diff --git a/package/boot/kexec-tools/files/kdump.defaults b/package/boot/kexec-tools/files/kdump.defaults deleted file mode 100644 index 2f15e757b..000000000 --- a/package/boot/kexec-tools/files/kdump.defaults +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -case $(uname -m) in - i?86|x86_64) - if ! grep -q crashkernel /boot/grub/grub.cfg; then - mount /boot -o remount,rw - sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg - mount /boot -o remount,ro - fi - ;; -esac diff --git a/package/boot/kexec-tools/files/kdump.init b/package/boot/kexec-tools/files/kdump.init deleted file mode 100755 index 057b8cc17..000000000 --- a/package/boot/kexec-tools/files/kdump.init +++ /dev/null @@ -1,182 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=41 -STOP=98 - -EXTRA_COMMANDS="status" -EXTRA_HELP=" status Print crashkernel status" - -verify_kdump() { - local cfg="$1" - local enabled - local path - local save_vmcore - local save_dmesg - - config_get_bool enabled "$cfg" enabled 1 - config_get_bool save_dmesg "$cfg" save_dmesg 1 - config_get_bool save_vmcore "$cfg" save_vmcore 0 - - [ "$enabled" -gt 0 ] || return 2 - - [ "$save_dmesg" -gt 0 ] || [ "$save_vmcore" -gt 0 ] || return 2 - - config_get path "$cfg" path "/" - - [ -d "$path" ] || mkdir -p "$path" 2>/dev/null || return 1 -} - -run_kdump() { - local cfg="$1" - local enabled - local path - local save_vmcore - local save_dmesg - - config_get_bool enabled "$cfg" enabled 1 - [ "$enabled" -gt 0 ] || return - - config_get_bool save_dmesg "$cfg" save_dmesg 1 - config_get_bool save_vmcore "$cfg" save_vmcore 0 - config_get path "$cfg" path "/" - - timestamp=$(date "+%Y%m%dT%H%M%S") - - if [ "$save_vmcore" -eq 1 ]; then - # would like 'sparse' but busybox doesn't support it - dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M - fi - - if [ "$save_dmesg" -eq 1 ]; then - vmcore-dmesg /proc/vmcore > "$path/dmesg-$timestamp" - fi - - sync - reboot -f -} - -find_kernel() { - . /lib/functions.sh - local kernel - - kernel="$BOOT_IMAGE" - if [ -r "$kernel" ]; then - echo $kernel - return 0 - fi - - kernel="$(find_mtd_part kernel)" - if [ -r "$kernel" ]; then - echo $kernel - return 0 - fi - - for voldir in /sys/class/ubi/ubi*_*; do - [ ! -e "$voldir" ] && continue - if [ "$(cat "${voldir}/name")" = "kernel" ]; then - kernel="/dev/$(basename "$voldir")" - echo $kernel - return 0 - fi - done - - return 1 -} - -load_crashkernel() { - local append_cmdline - local kernel - - kernel="$(find_kernel)" - [ $? -gt 0 ] && return 1 - - case "$(uname -m)" in - i?86|x86_64) - grep -q "crashkernel=" /proc/cmdline || return 1 - append_cmdline="1 irqpoll reset_devices maxcpus=1" - ;; - arm*) - append_cmdline="1 maxcpus=1 reset_devices" - ;; - esac - kexec -p "$kernel" --reuse-cmdline --append="$append_cmdline" - return $? -} - -start() { - local retval - - if [ ! -e /sys/kernel/kexec_crash_loaded ]; then - return 1 - fi - - if [ -e /proc/vmcore ]; then - config_load kdump - config_foreach run_kdump kdump - else - config_load kdump - config_foreach verify_kdump kdump - retval=$? - [ $retval = 1 ] && return 1 - [ $retval = 0 ] && load_crashkernel - return $? - fi -} - -stop() { - [ "$(cat /sys/kernel/kexec_crash_loaded)" = "1" ] || return - - if [ -e "$BOOT_IMAGE" ]; then - kexec -p -u "$BOOT_IMAGE" - fi -} - -status() { - local retval kernel - - if [ ! -e /sys/kernel/kexec_crash_loaded ]; then - echo "crashdump not supported by kernel" - return - fi - - if [ $(cat /sys/kernel/kexec_crash_size) -eq 0 ]; then - echo "memory for crashdump kernel not reserved!" - echo "check crashkernel= kernel cmdline parameter" - echo "(a reboot is required after installing kdump)" - return - fi - - kernel="$(find_kernel)" - if [ $? -gt 0 ]; then - echo "cannot find kernel image" - return - else - echo "using kernel image $kernel" - fi - - echo -n "kdump configuration is " - config_load kdump - retval=$? - if [ $retval = 0 ]; then - if [ "$(config_foreach echo kdump)" ]; then - config_foreach verify_kdump kdump - retval=$? - else - retval=1 - fi - fi - - if [ $retval = 0 ]; then - echo "valid" - elif [ $retval = 2 ]; then - echo "disabled" - else - echo "BROKEN" - fi - - echo -n "kexec crash kernel " - if [ "$(cat /sys/kernel/kexec_crash_loaded)" = "0" ]; then - echo -n "not " - fi - echo "loaded" -} diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch index 8648dc8b9..67da93a32 100644 --- a/package/boot/kobs-ng/patches/001-compile.patch +++ b/package/boot/kobs-ng/patches/001-compile.patch @@ -10,14 +10,13 @@ #include --- a/src/mtd.h +++ b/src/mtd.h -@@ -25,8 +25,11 @@ +@@ -25,8 +25,10 @@ #ifndef MTD_H #define MTD_H +#define _GNU_SOURCE #include #include -+#include +#include #include "BootControlBlocks.h" diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile index 9d9b97524..412f7ab11 100644 --- a/package/boot/rbcfg/Makefile +++ b/package/boot/rbcfg/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rbcfg -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c index 2acbfbd8c..b7cf79ffa 100644 --- a/package/boot/rbcfg/src/main.c +++ b/package/boot/rbcfg/src/main.c @@ -2,7 +2,6 @@ * RouterBOOT configuration utility * * Copyright (C) 2010 Gabor Juhos - * Copyright (C) 2017 Thibaut VARENE * * 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 @@ -30,7 +29,6 @@ #define RB_ERR_INVALID 2 #define RB_ERR_NOMEM 3 #define RB_ERR_IO 4 -#define RB_ERR_NOTWANTED 5 #define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) @@ -69,11 +67,6 @@ struct rbcfg_command { int (*exec)(int argc, const char *argv[]); }; -struct rbcfg_soc { - const char *needle; - const int type; -}; - static void usage(void); /* Globals */ @@ -108,10 +101,6 @@ static const struct rbcfg_value rbcfg_boot_device[] = { RB_BOOT_DEVICE_ETHONCE), CFG_U32("nand", "boot from NAND only", RB_BOOT_DEVICE_NANDONLY), - CFG_U32("flash", "boot in flash configuration mode", - RB_BOOT_DEVICE_FLASHCFG), - CFG_U32("flashnand", "boot in flash configuration mode once, then NAND", - RB_BOOT_DEVICE_FLSHONCE), }; static const struct rbcfg_value rbcfg_boot_key[] = { @@ -142,32 +131,12 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = { RB_CPU_MODE_REGULAR), }; -static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = { -}; - -static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = { - CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), - CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), - CFG_U32("0", "Factory", RB_CPU_FREQ_N0), - CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), - CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), -}; - -static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = { - CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), - CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), - CFG_U32("0", "Factory", RB_CPU_FREQ_N0), - CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), - CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), - CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3), -}; - static const struct rbcfg_value rbcfg_booter[] = { CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), }; -static struct rbcfg_env rbcfg_envs[] = { +static const struct rbcfg_env rbcfg_envs[] = { { .name = "boot_delay", .id = RB_ID_BOOT_DELAY, @@ -204,12 +173,6 @@ static struct rbcfg_env rbcfg_envs[] = { .type = RBCFG_ENV_TYPE_U32, .values = rbcfg_cpu_mode, .num_values = ARRAY_SIZE(rbcfg_cpu_mode), - }, { - .name = "cpu_freq", - .id = RB_ID_CPU_FREQ, - .type = RBCFG_ENV_TYPE_U32, - .values = rbcfg_cpu_freq_dummy, - .num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy), }, { .name = "uart_speed", .id = RB_ID_UART_SPEED, @@ -273,10 +236,8 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buf += 2; buflen -= 2; - if (id == RB_ID_TERMINATOR) { - ret = RB_ERR_NOTWANTED; + if (id == RB_ID_TERMINATOR) break; - } if (buflen < len) break; @@ -292,7 +253,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buflen -= len; } - if (RB_ERR_NOTFOUND == ret) + if (ret) fprintf(stderr, "no tag found with id=%u\n", tag_id); return ret; @@ -783,96 +744,6 @@ usage(void) fprintf(stderr, "\n"); } -#define RBCFG_SOC_UNKNOWN 0 -#define RBCFG_SOC_QCA953X 1 -#define RBCFG_SOC_AR9344 2 - -static const struct rbcfg_soc rbcfg_socs[] = { - { - .needle = "QCA953", - .type = RBCFG_SOC_QCA953X, - }, { - .needle = "AR9344", - .type = RBCFG_SOC_AR9344, - }, -}; - -#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */ - -static int cpuinfo_find_soc(void) -{ - FILE *fp; - char temp[CPUINFO_BUFSIZE]; - char *haystack, *needle; - int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN; - - fp = fopen("/proc/cpuinfo", "r"); - if (!fp) - goto end; - - /* first, extract the system type line */ - needle = "system type"; - while(fgets(temp, CPUINFO_BUFSIZE, fp)) { - if (!strncmp(temp, needle, strlen(needle))) { - found = 1; - break; - } - } - - fclose(fp); - - /* failsafe in case cpuinfo format changes */ - if (!found) - goto end; - - /* skip the field header */ - haystack = strchr(temp, ':'); - - /* then, try to identify known SoC, stop at first match */ - for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) { - if ((strstr(haystack, rbcfg_socs[i].needle))) { - soc_type = rbcfg_socs[i].type; - break; - } - } - -end: - return soc_type; -} - -static void fixup_rbcfg_envs(void) -{ - int i, num_val, soc_type; - const struct rbcfg_value * env_value; - - /* detect SoC */ - soc_type = cpuinfo_find_soc(); - - /* update rbcfg_envs */ - switch (soc_type) { - case RBCFG_SOC_QCA953X: - env_value = rbcfg_cpu_freq_qca953x; - num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x); - break; - case RBCFG_SOC_AR9344: - env_value = rbcfg_cpu_freq_ar9344; - num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344); - break; - } - - for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { - if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) { - if (RBCFG_SOC_UNKNOWN == soc_type) - rbcfg_envs[i].id = RB_ID_TERMINATOR; - else { - rbcfg_envs[i].values = env_value; - rbcfg_envs[i].num_values = num_val; - } - break; - } - } -} - int main(int argc, const char *argv[]) { const struct rbcfg_command *cmd = NULL; @@ -881,8 +752,6 @@ int main(int argc, const char *argv[]) rbcfg_name = (char *) argv[0]; - fixup_rbcfg_envs(); - if (argc < 2) { usage(); return EXIT_FAILURE; diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h index 88acc13dc..899161a10 100644 --- a/package/boot/rbcfg/src/rbcfg.h +++ b/package/boot/rbcfg/src/rbcfg.h @@ -32,7 +32,6 @@ #define RB_ID_BOOT_PROTOCOL 9 #define RB_ID_SOFT_10 10 #define RB_ID_SOFT_11 11 -#define RB_ID_CPU_FREQ 12 #define RB_ID_BOOTER 13 #define RB_UART_SPEED_115200 0 @@ -60,8 +59,6 @@ #define RB_BOOT_DEVICE_CFCARD 2 #define RB_BOOT_DEVICE_ETHONCE 3 #define RB_BOOT_DEVICE_NANDONLY 5 -#define RB_BOOT_DEVICE_FLASHCFG 7 -#define RB_BOOT_DEVICE_FLSHONCE 8 #define RB_BOOT_KEY_ANY 0 #define RB_BOOT_KEY_DEL 1 @@ -72,13 +69,6 @@ #define RB_BOOT_PROTOCOL_BOOTP 0 #define RB_BOOT_PROTOCOL_DHCP 1 -#define RB_CPU_FREQ_L2 (0 << 3) -#define RB_CPU_FREQ_L1 (1 << 3) -#define RB_CPU_FREQ_N0 (2 << 3) -#define RB_CPU_FREQ_H1 (3 << 3) -#define RB_CPU_FREQ_H2 (4 << 3) -#define RB_CPU_FREQ_H3 (5 << 3) - #define RB_BOOTER_REGULAR 0 #define RB_BOOTER_BACKUP 1 diff --git a/package/boot/uboot-ar71xx/Makefile b/package/boot/uboot-ar71xx/Makefile index e6e6cbbd4..70f96713e 100644 --- a/package/boot/uboot-ar71xx/Makefile +++ b/package/boot/uboot-ar71xx/Makefile @@ -6,28 +6,90 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk +PKG_NAME:=u-boot PKG_VERSION:=2010.03 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=902d1b2c15787df55186fae4033685fb0c5a5a12755a08383e97c4a3e255925b +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot +PKG_TARGETS:=bin + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=ar71xx - BUILD_SUBTARGET:=generic +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/nbg460n_550n_550nh - TITLE:=NBG460N/550N/550NH routers - BUILD_DEVICES:=NBG_460N_550N_550NH - HIDDEN:=y +define uboot/nbg460n_550n_550nh + TITLE:=U-boot for the NBG460N/550N/550NH routers + DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default) endef -UBOOT_MAKE_FLAGS := +UBOOTS:=nbg460n_550n_550nh -UBOOT_TARGETS:=nbg460n_550n_550nh +define Package/uboot/template +define Package/uboot-ar71xx-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=$(2) + DEPENDS:=@TARGET_ar71xx_generic + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) +endef +endef -$(eval $(call BuildPackage/U-Boot)) +define BuildUbootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) ./files/* $(PKG_BUILD_DIR) + find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf +endef + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/template +define Package/uboot-ar71xx-$(1)/install + $(INSTALL_DIR) $$(1) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUbootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \ +) diff --git a/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile b/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile similarity index 100% rename from package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile rename to package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile diff --git a/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk b/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk similarity index 100% rename from package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk rename to package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk diff --git a/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S b/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S similarity index 100% rename from package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S rename to package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S diff --git a/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c b/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c similarity index 100% rename from package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c rename to package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c diff --git a/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds b/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds similarity index 100% rename from package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds rename to package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds diff --git a/package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c b/package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c similarity index 100% rename from package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c rename to package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c diff --git a/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c b/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c similarity index 100% rename from package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c rename to package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c diff --git a/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h b/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h rename to package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h diff --git a/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h b/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h similarity index 100% rename from package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h rename to package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h diff --git a/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c b/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c similarity index 100% rename from package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c rename to package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c diff --git a/package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c b/package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c similarity index 100% rename from package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c rename to package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c diff --git a/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h b/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h rename to package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h diff --git a/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h b/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h similarity index 100% rename from package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h rename to package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h diff --git a/package/boot/uboot-ar71xx/src/include/configs/nbg460n.h b/package/boot/uboot-ar71xx/files/include/configs/nbg460n.h similarity index 100% rename from package/boot/uboot-ar71xx/src/include/configs/nbg460n.h rename to package/boot/uboot-ar71xx/files/include/configs/nbg460n.h diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index 7c420f126..cbce85967 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -7,83 +7,68 @@ include $(TOPDIR)/rules.mk +PKG_NAME:=u-boot PKG_VERSION:=2016.05 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171 -include $(INCLUDE_DIR)/u-boot.mk +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 + include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=at91 - UBOOT_IMAGE:=u-boot.bin boot.bin +define uboot/Default + TITLE:= endef -define U-Boot/at91sam9m10g45ek_nandflash - NAME:=AT91SAM9M10G45-EK board (NandFlash) - BUILD_SUBTARGET:=legacy - BUILD_DEVICES:=at91sam9m10g45ek +define uboot/at91sam9m10g45ek_nandflash + TITLE:=U-Boot for the AT91SAM9M10G45-EK board (NandFlash) endef -define U-Boot/at91sam9x5ek_nandflash - NAME:=AT91SAM9X5-EK board (NandFlash) - BUILD_SUBTARGET:=legacy - BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek +define uboot/at91sam9x5ek_nandflash + TITLE:=U-Boot for the AT91SAM9X5-EK board (NandFlash) endef -define U-Boot/sama5d3_xplained_nandflash - NAME:=SAMA5D3 Xplained board (NandFlash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained -endef - -define U-Boot/sama5d3_xplained_mmc - NAME:=SAMA5D3 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d3_xplained -endef - -define U-Boot/sama5d2_xplained_spiflash - NAME:=SAMA5D2 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained -endef - -define U-Boot/sama5d2_xplained_mmc - NAME:=SAMA5D2 Xplained board (SDcard/EMMC) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d2_xplained -endef - -define U-Boot/sama5d4_xplained_spiflash - NAME:=SAMA5D4 Xplained board (SPI Flash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -define U-Boot/sama5d4_xplained_mmc - NAME:=SAMA5D4 Xplained board (SDcard) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -define U-Boot/sama5d4_xplained_nandflash - NAME:=SAMA5D4 Xplained board (NandFlash) - BUILD_SUBTARGET:=sama5 - BUILD_DEVICES:=at91-sama5d4_xplained -endef - -UBOOT_TARGETS := \ +UBOOTS := \ at91sam9m10g45ek_nandflash \ - at91sam9x5ek_nandflash \ - sama5d3_xplained_nandflash \ - sama5d3_xplained_mmc \ - sama5d2_xplained_mmc \ - sama5d2_xplained_spiflash \ - sama5d4_xplained_mmc \ - sama5d4_xplained_spiflash \ - sama5d4_xplained_nandflash + at91sam9x5ek_nandflash + +define Package/uboot/template +define Package/uboot-at91-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_at91 + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Ben Whitten +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),lede-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ @@ -91,4 +76,27 @@ define Build/Compile KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))" endef -$(eval $(call BuildPackage/U-Boot)) +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.bin + + $(CP) $(PKG_BUILD_DIR)/boot.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin +endef + +define Package/uboot/install/template +define Package/uboot-at91-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-at91-$(u))) \ +) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 57a2ec539..784fc6423 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\ ftp://ftp.denx.de/pub/u-boot PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 -PKG_BUILD_DEPENDS:=fstools +PKG_BUILD_DEPENDS:=+fstools PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE_FILES:=Licenses/README @@ -112,10 +112,6 @@ ifneq ($(CONFIG_TARGET_oxnas),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools endif -ifneq ($(CONFIG_TARGET_pistachio),) - $(INSTALL_DIR) $(1)/etc/uci-defaults - $(INSTALL_DATA) ./files/pistachio $(1)/etc/uci-defaults/30_uboot-envtools -endif ifneq ($(CONFIG_TARGET_ramips),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 6acfa6969..25bec7eb3 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -7,10 +7,11 @@ touch /etc/config/ubootenv +. /lib/ar71xx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(ar71xx_board_name) case "$board" in a40|\ @@ -19,7 +20,6 @@ alfa-ap120c|\ all0258n|\ ap121f|\ ap90q|\ -arduino-yun|\ cap324|\ cap4200ag|\ carambola2|\ @@ -28,7 +28,6 @@ cpe870|\ cr3000|\ cr5000|\ eap300v2|\ -ens202ext|\ gl-ar300m|\ hornet-ub|\ hornet-ub-x2|\ @@ -66,20 +65,12 @@ dap-2695-a1|\ wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; -dr342|\ dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; -rambutan) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" - ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000" - ;; qihoo-c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; -wi2a-ac200i) - ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000" - ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/cns3xxx b/package/boot/uboot-envtools/files/cns3xxx index f998de463..a56be15c5 100644 --- a/package/boot/uboot-envtools/files/cns3xxx +++ b/package/boot/uboot-envtools/files/cns3xxx @@ -7,10 +7,11 @@ touch /etc/config/ubootenv +. /lib/cns3xxx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(cns3xxx_board_name) case "$board" in laguna) diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index fec8ce0aa..a78c4fbe5 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -7,10 +7,11 @@ touch /etc/config/ubootenv +. /lib/imx6.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(imx6_board_name) case "$board" in *gw5*) diff --git a/package/boot/uboot-envtools/files/ipq b/package/boot/uboot-envtools/files/ipq index b7162807f..16c7ba6bb 100644 --- a/package/boot/uboot-envtools/files/ipq +++ b/package/boot/uboot-envtools/files/ipq @@ -7,33 +7,13 @@ touch /etc/config/ubootenv +. /lib/ipq806x.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) - -ubootenv_mtdinfo () { - UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV) - mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//') - mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}') - mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}') - nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev}) - - if [ -n "$nor_flash" ]; then - ubootenv_size=$mtd_size - else - # size is fixed to 0x40000 in u-boot - ubootenv_size=0x40000 - fi - - sectors=$(( $ubootenv_size / $mtd_erase )) - echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors -} +board=$(ipq806x_board_name) case "$board" in -ap148 | db149) - ubootenv_add_uci_config $(ubootenv_mtdinfo) - ;; ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" ;; diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 3b770c12f..055e0eba4 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -7,18 +7,17 @@ touch /etc/config/ubootenv +. /lib/kirkwood.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(kirkwood_board_name) case "$board" in dockstar|\ guruplug-server-plus|\ ib62x0|\ linksys-viper|\ -nsa310b|\ -nsa325|\ pogo_e02|\ sheevaplug|\ sheevaplug-esata) diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq index f4541a559..d1a6668e8 100644 --- a/package/boot/uboot-envtools/files/lantiq +++ b/package/boot/uboot-envtools/files/lantiq @@ -13,19 +13,19 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -bt,homehub-v2b) +BTHOMEHUBV2B) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -bt,homehub-v3a) +BTHOMEHUBV3A) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1" ;; -siemens,gigaset-sx76x) +GIGASX76X) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -zyxel,p-2812hnu-f1) +P2812HNUF1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1" ;; -buffalo,wbmr-300hpd) +WBMR300) idx="$(find_mtd_index ubootconfig)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2" diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index e33830e0a..2bbbc2366 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -8,10 +8,11 @@ touch /etc/config/ubootenv +. /lib/mvebu.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(mvebu_board_name) case "$board" in armada-385-linksys-caiman|\ diff --git a/package/boot/uboot-envtools/files/mxs b/package/boot/uboot-envtools/files/mxs index 37d3c96ed..ab8b4ef93 100644 --- a/package/boot/uboot-envtools/files/mxs +++ b/package/boot/uboot-envtools/files/mxs @@ -7,10 +7,11 @@ touch /etc/config/ubootenv +. /lib/mxs.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(mxs_board_name) case "$board" in duckbill) diff --git a/package/boot/uboot-envtools/files/oxnas b/package/boot/uboot-envtools/files/oxnas index 70b0f1663..ac4744e3e 100644 --- a/package/boot/uboot-envtools/files/oxnas +++ b/package/boot/uboot-envtools/files/oxnas @@ -7,10 +7,11 @@ touch /etc/config/ubootenv +. /lib/oxnas.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(oxnas_board_name) case "$board" in akitio|\ diff --git a/package/boot/uboot-envtools/files/pistachio b/package/boot/uboot-envtools/files/pistachio deleted file mode 100644 index e4aa7b0cd..000000000 --- a/package/boot/uboot-envtools/files/pistachio +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2017 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -[ -e /etc/config/ubootenv ] && exit 0 - -touch /etc/config/ubootenv - -. /lib/uboot-envtools.sh -. /lib/functions.sh - -board=$(board_name) - -case "$board" in -img,pistachio-marduk) - ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000" - ;; -esac - -config_load ubootenv -config_foreach ubootenv_add_app_config ubootenv - -exit 0 diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index ce200a1ff..3216b300c 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -7,19 +7,21 @@ touch /etc/config/ubootenv +. /lib/ramips.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(board_name) +board=$(ramips_board_name) case "$board" in all0239-3g|\ -all0256n-4M|\ -all0256n-8M|\ +all0256n|\ all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; +br-6425|\ linkits7688|\ +linkits7688d|\ miwifi-nano|\ sk-wb8|\ wsr-1166|\ @@ -27,9 +29,6 @@ wsr-600|\ zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; -mir3g) - ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" - ;; esac config_load ubootenv diff --git a/package/boot/uboot-fritz4040/Makefile b/package/boot/uboot-fritz4040/Makefile deleted file mode 100644 index 9f9b4e05f..000000000 --- a/package/boot/uboot-fritz4040/Makefile +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (C) 2013-2014 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT -PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=6946ebbaf7b12a4a092d763c8f0c87a25984f103 -PKG_SOURCE_DATE:=2017-01-29 -PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b - -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/u-boot.mk -include $(INCLUDE_DIR)/package.mk - -define U-Boot/Default - BUILD_TARGET:=ipq806x - UBOOT_IMAGE:=uboot-fritz4040.bin -endef - -define U-Boot/fritz4040 - NAME:=FritzBox 4040 -endef - -UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes -UBOOT_MAKE_FLAGS += USE_PRIVATE_LIBGCC=yes -export DTC - -define Build/Configure - $(Build/Configure/U-Boot) - $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz - $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c - ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz -endef - -define Build/Compile - $(Build/Compile/U-Boot) - (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;) -endef - -define Package/u-boot/install - $(Package/u-boot/install/default) - $(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/ -endef - -UBOOT_TARGETS := fritz4040 - -$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-fritz4040/files/upload-to-f4040.sh b/package/boot/uboot-fritz4040/files/upload-to-f4040.sh deleted file mode 100755 index 64f493190..000000000 --- a/package/boot/uboot-fritz4040/files/upload-to-f4040.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -die() { - echo $1 - exit 1 -} - -FRITZBOX='192.168.178.1' -USER='adam2' -PASSWD='adam2' -FILE='uboot-fritz4040.bin' - -ping -q -4 -w 1 -c 1 "$FRITZBOX" &> /dev/null || die "Fritzbox at $FRITZBOX is not reachable. aborting" - -cat << EOS - -This will take ages (2 minutes)! If you want a -status bar: Attach a serial to the device and look there. - -Note: If this fails, you need to use AVM\' recover -utility to get your box back. However this step -should not damage your box.... - -Also it doesn't terminate.. :/ - -(Note: Make sure that you connected the router on -the yellow LAN ports and not the blue WAN). - -EOS - -ftp -n -4 "$FRITZBOX" << END_SCRIPT -quote USER $USER -quote PASS $PASSWD -quote MEDIA FLSH -binary -passive -put $FILE mtd1 -quote check mtd1 -bye -END_SCRIPT -exit 0 diff --git a/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch b/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch deleted file mode 100644 index 6fec563da..000000000 --- a/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch +++ /dev/null @@ -1,274 +0,0 @@ ---- a/arch/arm/lib/Makefile -+++ b/arch/arm/lib/Makefile -@@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk - LIB = $(obj)lib$(ARCH).o - LIBGCC = $(obj)libgcc.o - --ifndef CONFIG_SPL_BUILD - GLSOBJS += _ashldi3.o - GLSOBJS += _ashrdi3.o - GLSOBJS += _divsi3.o -@@ -34,9 +33,11 @@ GLSOBJS += _lshrdi3.o - GLSOBJS += _modsi3.o - GLSOBJS += _udivsi3.o - GLSOBJS += _umodsi3.o -+GLSOBJS += uldivmod.o - - GLCOBJS += div0.o - -+ifndef CONFIG_SPL_BUILD - COBJS-y += board.o - COBJS-y += bootm.o - COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o ---- /dev/null -+++ b/arch/arm/lib/uldivmod.S -@@ -0,0 +1,249 @@ -+/* -+ * Copyright 2010, Google Inc. -+ * -+ * Brought in from coreboot uldivmod.S -+ * -+ * SPDX-License-Identifier: GPL-2.0 -+ */ -+ -+#include -+#include -+ -+/* -+ * A, Q = r0 + (r1 << 32) -+ * B, R = r2 + (r3 << 32) -+ * A / B = Q ... R -+ */ -+ -+#define ARM(x...) x -+#define THUMB(x...) -+ -+A_0 .req r0 -+A_1 .req r1 -+B_0 .req r2 -+B_1 .req r3 -+C_0 .req r4 -+C_1 .req r5 -+D_0 .req r6 -+D_1 .req r7 -+ -+Q_0 .req r0 -+Q_1 .req r1 -+R_0 .req r2 -+R_1 .req r3 -+ -+THUMB( -+TMP .req r8 -+) -+ -+.pushsection .text.__aeabi_uldivmod, "ax" -+ENTRY(__aeabi_uldivmod) -+ -+ stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr} -+ @ Test if B == 0 -+ orrs ip, B_0, B_1 @ Z set -> B == 0 -+ beq L_div_by_0 -+ @ Test if B is power of 2: (B & (B - 1)) == 0 -+ subs C_0, B_0, #1 -+ sbc C_1, B_1, #0 -+ tst C_0, B_0 -+ tsteq B_1, C_1 -+ beq L_pow2 -+ @ Test if A_1 == B_1 == 0 -+ orrs ip, A_1, B_1 -+ beq L_div_32_32 -+ -+L_div_64_64: -+/* CLZ only exists in ARM architecture version 5 and above. */ -+#ifdef HAVE_CLZ -+ mov C_0, #1 -+ mov C_1, #0 -+ @ D_0 = clz A -+ teq A_1, #0 -+ clz D_0, A_1 -+ clzeq ip, A_0 -+ addeq D_0, D_0, ip -+ @ D_1 = clz B -+ teq B_1, #0 -+ clz D_1, B_1 -+ clzeq ip, B_0 -+ addeq D_1, D_1, ip -+ @ if clz B - clz A > 0 -+ subs D_0, D_1, D_0 -+ bls L_done_shift -+ @ B <<= (clz B - clz A) -+ subs D_1, D_0, #32 -+ rsb ip, D_0, #32 -+ movmi B_1, B_1, lsl D_0 -+ARM( orrmi B_1, B_1, B_0, lsr ip ) -+THUMB( lsrmi TMP, B_0, ip ) -+THUMB( orrmi B_1, B_1, TMP ) -+ movpl B_1, B_0, lsl D_1 -+ mov B_0, B_0, lsl D_0 -+ @ C = 1 << (clz B - clz A) -+ movmi C_1, C_1, lsl D_0 -+ARM( orrmi C_1, C_1, C_0, lsr ip ) -+THUMB( lsrmi TMP, C_0, ip ) -+THUMB( orrmi C_1, C_1, TMP ) -+ movpl C_1, C_0, lsl D_1 -+ mov C_0, C_0, lsl D_0 -+L_done_shift: -+ mov D_0, #0 -+ mov D_1, #0 -+ @ C: current bit; D: result -+#else -+ @ C: current bit; D: result -+ mov C_0, #1 -+ mov C_1, #0 -+ mov D_0, #0 -+ mov D_1, #0 -+L_lsl_4: -+ cmp B_1, #0x10000000 -+ cmpcc B_1, A_1 -+ cmpeq B_0, A_0 -+ bcs L_lsl_1 -+ @ B <<= 4 -+ mov B_1, B_1, lsl #4 -+ orr B_1, B_1, B_0, lsr #28 -+ mov B_0, B_0, lsl #4 -+ @ C <<= 4 -+ mov C_1, C_1, lsl #4 -+ orr C_1, C_1, C_0, lsr #28 -+ mov C_0, C_0, lsl #4 -+ b L_lsl_4 -+L_lsl_1: -+ cmp B_1, #0x80000000 -+ cmpcc B_1, A_1 -+ cmpeq B_0, A_0 -+ bcs L_subtract -+ @ B <<= 1 -+ mov B_1, B_1, lsl #1 -+ orr B_1, B_1, B_0, lsr #31 -+ mov B_0, B_0, lsl #1 -+ @ C <<= 1 -+ mov C_1, C_1, lsl #1 -+ orr C_1, C_1, C_0, lsr #31 -+ mov C_0, C_0, lsl #1 -+ b L_lsl_1 -+#endif -+L_subtract: -+ @ if A >= B -+ cmp A_1, B_1 -+ cmpeq A_0, B_0 -+ bcc L_update -+ @ A -= B -+ subs A_0, A_0, B_0 -+ sbc A_1, A_1, B_1 -+ @ D |= C -+ orr D_0, D_0, C_0 -+ orr D_1, D_1, C_1 -+L_update: -+ @ if A == 0: break -+ orrs ip, A_1, A_0 -+ beq L_exit -+ @ C >>= 1 -+ movs C_1, C_1, lsr #1 -+ movs C_0, C_0, rrx -+ @ if C == 0: break -+ orrs ip, C_1, C_0 -+ beq L_exit -+ @ B >>= 1 -+ movs B_1, B_1, lsr #1 -+ mov B_0, B_0, rrx -+ b L_subtract -+L_exit: -+ @ Note: A, B & Q, R are aliases -+ mov R_0, A_0 -+ mov R_1, A_1 -+ mov Q_0, D_0 -+ mov Q_1, D_1 -+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} -+ -+L_div_32_32: -+ @ Note: A_0 & r0 are aliases -+ @ Q_1 r1 -+ mov r1, B_0 -+ bl __aeabi_uidivmod -+ mov R_0, r1 -+ mov R_1, #0 -+ mov Q_1, #0 -+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} -+ -+L_pow2: -+#ifdef HAVE_CLZ -+ @ Note: A, B and Q, R are aliases -+ @ R = A & (B - 1) -+ and C_0, A_0, C_0 -+ and C_1, A_1, C_1 -+ @ Q = A >> log2(B) -+ @ Note: B must not be 0 here! -+ clz D_0, B_0 -+ add D_1, D_0, #1 -+ rsbs D_0, D_0, #31 -+ bpl L_1 -+ clz D_0, B_1 -+ rsb D_0, D_0, #31 -+ mov A_0, A_1, lsr D_0 -+ add D_0, D_0, #32 -+L_1: -+ movpl A_0, A_0, lsr D_0 -+ARM( orrpl A_0, A_0, A_1, lsl D_1 ) -+THUMB( lslpl TMP, A_1, D_1 ) -+THUMB( orrpl A_0, A_0, TMP ) -+ mov A_1, A_1, lsr D_0 -+ @ Mov back C to R -+ mov R_0, C_0 -+ mov R_1, C_1 -+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} -+#else -+ @ Note: A, B and Q, R are aliases -+ @ R = A & (B - 1) -+ and C_0, A_0, C_0 -+ and C_1, A_1, C_1 -+ @ Q = A >> log2(B) -+ @ Note: B must not be 0 here! -+ @ Count the leading zeroes in B. -+ mov D_0, #0 -+ orrs B_0, B_0, B_0 -+ @ If B is greater than 1 << 31, divide A and B by 1 << 32. -+ moveq A_0, A_1 -+ moveq A_1, #0 -+ moveq B_0, B_1 -+ @ Count the remaining leading zeroes in B. -+ movs B_1, B_0, lsl #16 -+ addeq D_0, #16 -+ moveq B_0, B_0, lsr #16 -+ tst B_0, #0xff -+ addeq D_0, #8 -+ moveq B_0, B_0, lsr #8 -+ tst B_0, #0xf -+ addeq D_0, #4 -+ moveq B_0, B_0, lsr #4 -+ tst B_0, #0x3 -+ addeq D_0, #2 -+ moveq B_0, B_0, lsr #2 -+ tst B_0, #0x1 -+ addeq D_0, #1 -+ @ Shift A to the right by the appropriate amount. -+ rsb D_1, D_0, #32 -+ mov Q_0, A_0, lsr D_0 -+ ARM( orr Q_0, Q_0, A_1, lsl D_1 ) -+ THUMB( lsl A_1, D_1 ) -+ THUMB( orr Q_0, A_1 ) -+ mov Q_1, A_1, lsr D_0 -+ @ Move C to R -+ mov R_0, C_0 -+ mov R_1, C_1 -+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} -+#endif -+ -+L_div_by_0: -+ bl __div0 -+ @ As wrong as it could be -+ mov Q_0, #0 -+ mov Q_1, #0 -+ mov R_0, #0 -+ mov R_1, #0 -+ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} -+ENDPROC(__aeabi_uldivmod) -+.popsection diff --git a/package/boot/uboot-fritz4040/patches/110-portability.patch b/package/boot/uboot-fritz4040/patches/110-portability.patch deleted file mode 100644 index 08ab88912..000000000 --- a/package/boot/uboot-fritz4040/patches/110-portability.patch +++ /dev/null @@ -1,32 +0,0 @@ -Index: u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh -=================================================================== ---- u-boot-2017-01-29-6946ebba.orig/fritz/fritzcreator.sh -+++ u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh -@@ -1,4 +1,4 @@ --#!/bin/sh -xe -+#!/bin/bash -xe - - # A helpful - # -@@ -11,6 +11,7 @@ UBOOT_FRITZ4040="uboot-fritz4040.bin" - FRITZ_DTS="fritz/fritz4040.dts" - FRITZ_DTB="fritz4040.dtb" - UBOOT_LOADADDR=0x841FFFF8 -+DTC="${DTC:-dtc}" - - rm -f "$UBOOT_FRITZ4040" - -@@ -44,11 +45,11 @@ printf "\x00\x00\x00\xea\xf8\x01\x33\xc4 - cat "$UBOOT_BIN" >> "$UBOOT_FRITZ4040" - - # Pad file to 1M --dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1M count=1 conv=sync -+dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1024k count=1 conv=sync - mv "$UBOOT_FRITZ4040.new" "$UBOOT_FRITZ4040" - - # Compile DTS --dtc "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 -+$DTC "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 - - # Append the compiled DTBs - cat "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" >> $UBOOT_FRITZ4040 diff --git a/package/boot/uboot-imx6/Makefile b/package/boot/uboot-imx6/Makefile index 8d422758d..884d8c034 100644 --- a/package/boot/uboot-imx6/Makefile +++ b/package/boot/uboot-imx6/Makefile @@ -7,63 +7,68 @@ include $(TOPDIR)/rules.mk +PKG_NAME:=u-boot PKG_VERSION:=2014.04 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot PKG_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31 -include $(INCLUDE_DIR)/u-boot.mk +PKG_BUILD_PARALLEL:=1 + include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=imx6 - UBOOT_IMAGE:=u-boot.imx +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/mx6qsabresd - NAME:=SABRE i.MX6Quad board +define uboot/mx6qsabresd + TITLE:=U-Boot for SABRE i.MX6Quad board endef -define U-Boot/nitrogen6dl - NAME:=Nitrogen6x i.MX6Dual-Lite 1GB board +define uboot/nitrogen6dl + TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board endef -define U-Boot/nitrogen6dl2g - NAME:=Nitrogen6x i.MX6Dual-Lite 2GB board +define uboot/nitrogen6dl2g + TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board endef -define U-Boot/nitrogen6q - NAME:=Nitrogen6x/SABRE Lite (MX6Q/1GB) +define uboot/nitrogen6q + TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB) endef -define U-Boot/nitrogen6q2g - NAME:=Nitrogen6x i.MX6Quad 2GB board +define uboot/nitrogen6q2g + TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board endef -define U-Boot/nitrogen6s - NAME:=Nitrogen6x i.MX6Solo 512MB board +define uboot/nitrogen6s + TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board endef -define U-Boot/nitrogen6s1g - NAME:=Nitrogen6x i.MX6Solo 1GB board +define uboot/nitrogen6s1g + TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board endef -define U-Boot/wandboard_dl - NAME:=Wandboard Dual Lite - BUILD_DEVICES:=wandboard +define uboot/wandboard_dl + TITLE:=U-Boot for the Wandboard Dual Lite endef -define U-Boot/wandboard_quad - NAME:=Wandboard Quad - BUILD_DEVICES:=wandboard +define uboot/wandboard_quad + TITLE:=U-Boot for the Wandboard Quad endef -define U-Boot/wandboard_solo - NAME:=Wandboard Solo - BUILD_DEVICES:=wandboard +define uboot/wandboard_solo + TITLE:=U-Boot for the Wandboard Solo endef -UBOOT_TARGETS := \ +UBOOTS := \ mx6qsabresd \ nitrogen6dl \ nitrogen6dl2g \ @@ -75,4 +80,58 @@ UBOOT_TARGETS := \ wandboard_quad \ wandboard_solo -$(eval $(call BuildPackage/U-Boot)) +define Package/uboot/template +define Package/uboot-imx6-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_imx6 + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Luka Perkov +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) \ + $(PKG_BUILD_DIR)/u-boot.imx \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx +endef + +define Package/uboot/install/template +define Package/uboot-imx6-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-imx6-$(u))) \ +) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 929fca6ae..74b9f0fde 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,77 +7,94 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2017.09 +PKG_NAME:=u-boot +PKG_VERSION:=2016.09.01 PKG_RELEASE:=1 -PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=\ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot +PKG_HASH:=95728e89dd476d17428f94080752ab48884be477b6a678941582aeef618b70bb +PKG_TARGETS:=bin + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=kirkwood - BUILD_DEVICES:=$(patsubst %_second_stage,%,$(1)) +define uboot/Default + TITLE:= endef -define U-Boot/dockstar - NAME:=Seagate DockStar +define uboot/dockstar + TITLE:=U-Boot for Seagate DockStar endef -define U-Boot/dockstar_second_stage - NAME:=Seagate DockStar (second stage) +define uboot/dockstar_second_stage + TITLE:=second stage U-Boot for Seagate DockStar endef -define U-Boot/goflexhome - NAME:=the Seagate GoFlexHome/GoFlexNet +define uboot/goflexhome + TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet endef -define U-Boot/ib62x0 - NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 +define uboot/ib62x0 + TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 endef -define U-Boot/ib62x0_second_stage - NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage) +define uboot/ib62x0_second_stage + TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 endef -define U-Boot/iconnect - NAME:=Iomega iConnect Wireless +define uboot/iconnect + TITLE:=U-Boot for Iomega iConnect Wireless endef -define U-Boot/iconnect_second_stage - NAME:=Iomega iConnect Wireless (second stage) +define uboot/iconnect_second_stage + TITLE:=second stage U-Boot for Iomega iConnect Wireless endef -define U-Boot/nsa310 - NAME:=Zyxel NSA310 +define uboot/pogo_e02 + TITLE:=U-Boot for Cloud Engines Pogoplug E02 endef -define U-Boot/nsa325 - NAME:=Zyxel NSA325v1 and v2 +define uboot/pogo_e02_second_stage + TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02 endef -define U-Boot/pogo_e02 - NAME:=Cloud Engines Pogoplug E02 +define uboot/sheevaplug + TITLE:=U-Boot for SheevaPlug endef -define U-Boot/pogo_e02_second_stage - NAME:=Cloud Engines Pogoplug E02 (second stage) -endef - -define U-Boot/sheevaplug - NAME:=SheevaPlug -endef - -UBOOT_TARGETS := \ +UBOOTS:= \ dockstar dockstar_second_stage \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ - nsa310 \ - nsa325 \ pogo_e02 pogo_e02_second_stage \ sheevaplug +define Package/uboot/template +define Package/uboot-kirkwood-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_kirkwood + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + define Build/Configure $(if $(findstring _second_stage,$(BUILD_VARIANT)), $(CP) \ @@ -95,21 +112,34 @@ define Build/Compile CROSS_COMPILE=$(TARGET_CROSS) mkimage -A $(ARCH) -O linux -T kernel -C none \ -a 0x600000 -e 0x600000 \ - -n 'U-Boot uImage' \ + -n 'OpenWrt Das U-Boot uImage' \ -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img endef -define Package/u-boot/install - $(CP) \ - $(PKG_BUILD_DIR)/u-boot.bin \ - $(PKG_BUILD_DIR)/u-boot.kwb \ - $(PKG_BUILD_DIR)/u-boot.img \ - $(1)/ +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin + $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb + $(CP) $(PKG_BUILD_DIR)/u-boot.img \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img + $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ + $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ + $(BIN_DIR)/u-boot-kwboot/ endef -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/ +define Package/uboot/install/template +define Package/uboot-kirkwood-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef endef -$(eval $(call BuildPackage/U-Boot)) +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \ +) diff --git a/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch b/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch new file mode 100644 index 000000000..65ae63f34 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch @@ -0,0 +1,27 @@ +From 280b03ba28b4287de677d4c4b097918364395b5e Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Wed, 2 Jul 2014 01:47:23 +0200 +Subject: [PATCH 4/9] kirkwood: ib62x0: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- +This is patch was sent already in July: + +http://lists.denx.de/pipermail/u-boot/2014-July/182900.html +--- + include/configs/ib62x0.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/ib62x0.h ++++ b/include/configs/ib62x0.h +@@ -9,6 +9,8 @@ + #ifndef _CONFIG_IB62x0_H + #define _CONFIG_IB62x0_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Version number information + */ diff --git a/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch new file mode 100644 index 000000000..6ec605229 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch @@ -0,0 +1,23 @@ +From 5f9e6f640098e6963ff9b470cd5d2ab9f6a3579e Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Sun, 30 Nov 2014 02:40:37 +0100 +Subject: [PATCH 5/9] kirkwood: dockstar: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- + include/configs/dockstar.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/dockstar.h ++++ b/include/configs/dockstar.h +@@ -12,6 +12,8 @@ + #ifndef _CONFIG_DOCKSTAR_H + #define _CONFIG_DOCKSTAR_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Version number information + */ diff --git a/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch new file mode 100644 index 000000000..ac0bc0d2a --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch @@ -0,0 +1,23 @@ +From 0d0a6606396f0cc1a4f2966d167ef9e85d533650 Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Sun, 30 Nov 2014 02:40:51 +0100 +Subject: [PATCH 6/9] kirkwood: goflexhome: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- + include/configs/goflexhome.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/goflexhome.h ++++ b/include/configs/goflexhome.h +@@ -15,6 +15,8 @@ + #ifndef _CONFIG_GOFLEXHOME_H + #define _CONFIG_GOFLEXHOME_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Version number information + */ diff --git a/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch new file mode 100644 index 000000000..ab23481f7 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch @@ -0,0 +1,23 @@ +From 45ba20427135e526cfa528773de0cfe215f4dc40 Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Sun, 30 Nov 2014 02:41:04 +0100 +Subject: [PATCH 7/9] kirkwood: iconnect: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- + include/configs/iconnect.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/iconnect.h ++++ b/include/configs/iconnect.h +@@ -9,6 +9,8 @@ + #ifndef _CONFIG_ICONNECT_H + #define _CONFIG_ICONNECT_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Version number information + */ diff --git a/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch new file mode 100644 index 000000000..40918d473 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch @@ -0,0 +1,23 @@ +From bd862f4e7a559e38763a5280e35bf7ff14b535f1 Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Sun, 30 Nov 2014 02:41:19 +0100 +Subject: [PATCH 8/9] kirkwood: pogo_e02: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- + include/configs/pogo_e02.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/pogo_e02.h ++++ b/include/configs/pogo_e02.h +@@ -13,6 +13,8 @@ + #ifndef _CONFIG_POGO_E02_H + #define _CONFIG_POGO_E02_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Machine type definition and ID + */ diff --git a/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch new file mode 100644 index 000000000..d976bbc02 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch @@ -0,0 +1,23 @@ +From 787e23179708ddad7ecd9dcd6c841546689864b0 Mon Sep 17 00:00:00 2001 +From: Luka Perkov +Date: Sun, 30 Nov 2014 02:41:49 +0100 +Subject: [PATCH 9/9] kirkwood: sheevaplug: add CONFIG_SYS_GENERIC_BOARD define + +Signed-off-by: Luka Perkov +CC: Prafulla Wadaskar +CC: Stefan Roese +--- + include/configs/sheevaplug.h | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/include/configs/sheevaplug.h ++++ b/include/configs/sheevaplug.h +@@ -10,6 +10,8 @@ + #ifndef _CONFIG_SHEEVAPLUG_H + #define _CONFIG_SHEEVAPLUG_H + ++#define CONFIG_SYS_GENERIC_BOARD ++ + /* + * Version number information + */ diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch deleted file mode 100644 index 10d8d4405..000000000 --- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch +++ /dev/null @@ -1,697 +0,0 @@ - -arm: kirkwood: add ZyXEL NSA310 device - -This patch add ZyXEL NSA310 1-Bay Media Server - -The ZyXEL NSA310 device is a Kirkwood based NAS: - -- SoC: Marvell 88F6702 1200Mhz -- SDRAM memory: 256MB DDR2 400Mhz -- Gigabit ethernet: PHY Realtek -- Flash memory: 128MB -- 1 Power button -- 1 Power LED (blue) -- 5 Status LED (green/red) -- 1 Copy/Sync button -- 1 Reset button -- 2 SATA II port (1 internal and 1 external eSata) -- 2 USB 2.0 ports (1 front and 1 back) -- Smart fan - -Signed-off-by: Alberto Bursi - -NOTE: this patch is ready for upstream, LEDE-specific parts are in - another patch - -diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig -index 9205b1e..819bd3b 100644 ---- a/arch/arm/mach-kirkwood/Kconfig -+++ b/arch/arm/mach-kirkwood/Kconfig -@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME - config TARGET_NAS220 - bool "BlackArmor NAS220" - -+config TARGET_NSA310 -+ bool "Zyxel NSA310 Board" -+ - config TARGET_NSA310S - bool "Zyxel NSA310S" - -@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig" - source "board/Seagate/dockstar/Kconfig" - source "board/Seagate/goflexhome/Kconfig" - source "board/Seagate/nas220/Kconfig" -+source "board/zyxel/nsa310/Kconfig" - source "board/zyxel/nsa310s/Kconfig" - - endif -diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig -new file mode 100644 -index 0000000..145ade6 ---- /dev/null -+++ b/board/zyxel/nsa310/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_NSA310 -+ -+config SYS_BOARD -+ default "nsa310" -+ -+config SYS_VENDOR -+ default "zyxel" -+ -+config SYS_CONFIG_NAME -+ default "nsa310" -+ -+endif -diff --git a/board/zyxel/nsa310/MAINTAINERS b/board/zyxel/nsa310/MAINTAINERS -new file mode 100644 -index 0000000..d09f1ab ---- /dev/null -+++ b/board/zyxel/nsa310/MAINTAINERS -@@ -0,0 +1,6 @@ -+NSA310 BOARD -+M: Alberto Bursi -+S: Maintained -+F: board/zyxel/nsa310/ -+F: include/configs/nsa310.h -+F: configs/nsa310_defconfig -diff --git a/board/zyxel/nsa310/Makefile b/board/zyxel/nsa310/Makefile -new file mode 100644 -index 0000000..dfe93cc ---- /dev/null -+++ b/board/zyxel/nsa310/Makefile -@@ -0,0 +1,12 @@ -+# -+# (C) Copyright 2015 bodhi -+# -+# Based on -+# (C) Copyright 2009 -+# Marvell Semiconductor -+# Written-by: Prafulla Wadaskar -+# -+# SPDX-License-Identifier: GPL-2.0+ -+# -+ -+obj-y := nsa310.o -diff --git a/board/zyxel/nsa310/kwbimage.cfg b/board/zyxel/nsa310/kwbimage.cfg -new file mode 100644 -index 0000000..f60e1d2 ---- /dev/null -+++ b/board/zyxel/nsa310/kwbimage.cfg -@@ -0,0 +1,166 @@ -+# -+# Copyright (C) 2013 Rafal Kazmierowski -+# -+# Based on guruplug.c originally written by -+# Siddarth Gore -+# (C) Copyright 2009 -+# Marvell Semiconductor -+# -+# See file CREDITS for list of people who contributed to this -+# project. -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU General Public License as -+# published by the Free Software Foundation; either version 2 of -+# the License, or (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+# MA 02110-1301 USA -+# -+# Refer docs/README.kwimage for more details about how-to configure -+# and create kirkwood boot image -+# -+ -+# Boot Media configurations -+BOOT_FROM nand -+#BOOT_FROM uart -+NAND_ECC_MODE default -+NAND_PAGE_SIZE 0x0800 -+ -+# SOC registers configuration using bootrom header extension -+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed -+ -+# Configure RGMII-0 interface pad voltage to 1.8V -+DATA 0xFFD100e0 0x1b1b1b9b -+ -+#Dram initalization for SINGLE x16 CL=5 @ 400MHz -+DATA 0xFFD01400 0x43010c30 # DDR Configuration register -+# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) -+# bit23-14: zero -+# bit24: 1= enable exit self refresh mode on DDR access -+# bit25: 1 required -+# bit29-26: zero -+# bit31-30: 01 -+ -+DATA 0xFFD01404 0x37543000 # DDR Controller Control Low -+# bit 4: 0=addr/cmd in smame cycle -+# bit 5: 0=clk is driven during self refresh, we don't care for APX -+# bit 6: 0=use recommended falling edge of clk for addr/cmd -+# bit14: 0=input buffer always powered up -+# bit18: 1=cpu lock transaction enabled -+# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 -+# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM -+# bit30-28: 3 required -+# bit31: 0=no additional STARTBURST delay -+ -+DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) -+# bit3-0: TRAS lsbs -+# bit7-4: TRCD -+# bit11- 8: TRP -+# bit15-12: TWR -+# bit19-16: TWTR -+# bit20: TRAS msb -+# bit23-21: 0x0 -+# bit27-24: TRRD -+# bit31-28: TRTP -+ -+DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) -+# bit6-0: TRFC -+# bit8-7: TR2R -+# bit10-9: TR2W -+# bit12-11: TW2W -+# bit31-13: zero required -+ -+DATA 0xFFD01410 0x0000000c # DDR Address Control -+# bit1-0: 01, Cs0width=x8 -+# bit3-2: 10, Cs0size=1Gb -+# bit5-4: 01, Cs1width=x8 -+# bit7-6: 10, Cs1size=1Gb -+# bit9-8: 00, Cs2width=nonexistent -+# bit11-10: 00, Cs2size =nonexistent -+# bit13-12: 00, Cs3width=nonexistent -+# bit15-14: 00, Cs3size =nonexistent -+# bit16: 0, Cs0AddrSel -+# bit17: 0, Cs1AddrSel -+# bit18: 0, Cs2AddrSel -+# bit19: 0, Cs3AddrSel -+# bit31-20: 0 required -+ -+DATA 0xFFD01414 0x00000000 # DDR Open Pages Control -+# bit0: 0, OpenPage enabled -+# bit31-1: 0 required -+ -+DATA 0xFFD01418 0x00000000 # DDR Operation -+# bit3-0: 0x0, DDR cmd -+# bit31-4: 0 required -+ -+DATA 0xFFD0141C 0x00000652 # DDR Mode -+# bit2-0: 2, BurstLen=2 required -+# bit3: 0, BurstType=0 required -+# bit6-4: 4, CL=5 -+# bit7: 0, TestMode=0 normal -+# bit8: 0, DLL reset=0 normal -+# bit11-9: 6, auto-precharge write recovery ???????????? -+# bit12: 0, PD must be zero -+# bit31-13: 0 required -+ -+DATA 0xFFD01420 0x00000004 # DDR Extended Mode -+# bit0: 0, DDR DLL enabled -+# bit1: 0, DDR drive strenght normal -+# bit2: 0, DDR ODT control lsd (disabled) -+# bit5-3: 000, required -+# bit6: 1, DDR ODT control msb, (disabled) -+# bit9-7: 000, required -+# bit10: 0, differential DQS enabled -+# bit11: 0, required -+# bit12: 0, DDR output buffer enabled -+# bit31-13: 0 required -+ -+DATA 0xFFD01424 0x0000F17F # DDR Controller Control High -+# bit2-0: 111, required -+# bit3 : 1 , MBUS Burst Chop disabled -+# bit6-4: 111, required -+# bit7 : 0 -+# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz -+# bit9 : 0 , no half clock cycle addition to dataout -+# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals -+# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh -+# bit15-12: 1111 required -+# bit31-16: 0 required -+ -+DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) -+DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) -+ -+ -+DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size -+#DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 -+# bit0: 1, Window enabled -+# bit1: 0, Write Protect disabled -+# bit3-2: 00, CS0 hit selected -+# bit23-4: ones, required -+# bit31-24: 0x0F, Size (i.e. 256MB) -+ -+DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb -+DATA 0xFFD0150C 0x00000000 # CS[2]n Size, window disabled KAZ z 400db -+DATA 0xFFD01514 0x00000000 # CS[3]n Size, window disabled -+ -+DATA 0xFFD0151C 0x00000000 # DDR ODT Control (Low) -+DATA 0xFFD01494 0x00120012 # DDR ODT Control (High) KAZ z nowy STATIC_SDRAM_ODT_CTRL_LOW -+# bit1-0: 00, ODT0 controlled by ODT Control (low) register above -+# bit3-2: 01, ODT1 active NEVER! -+# bit31-4: zero, required -+ -+DATA 0xFFD01498 0x00000000 # CPU ODT Control KAZ STATIC_SDRAM_ODT_CTRL_HI -+DATA 0xFFD0149C 0x0000E403 # DDR Initialization Control KAZ STATIC_SDRAM_DUNIT_ODT_CTRL -+DATA 0xFFD01480 0x00000001 # DDR Initialization Control -+#bit0=1, enable DDR init upon this register write -+ -+# End of Header extension -+DATA 0x0 0x0 -diff --git a/board/zyxel/nsa310/nsa310.c b/board/zyxel/nsa310/nsa310.c -new file mode 100644 -index 0000000..eee3f1a ---- /dev/null -+++ b/board/zyxel/nsa310/nsa310.c -@@ -0,0 +1,190 @@ -+/* -+ * Copyright (C) 2013 Rafal Kazmierowski -+ * -+ * Based on NSA320.c Peter Schildmann -+ * originally written by -+ * Marvell Semiconductor -+ * Written-by: Prafulla Wadaskar -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include "nsa310.h" -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+int board_early_init_f(void) -+{ -+ /* -+ * default gpio configuration -+ * There are maximum 64 gpios controlled through 2 sets of registers -+ * the below configuration configures mainly initial LED status -+ */ -+ mvebu_config_gpio(NSA310_VAL_LOW, NSA310_VAL_HIGH, -+ NSA310_OE_LOW, NSA310_OE_HIGH); -+ -+ /* Multi-Purpose Pins Functionality configuration */ -+ /* (all LEDs & power off active high) */ -+ static const u32 kwmpp_config[] = { -+ MPP0_NF_IO2, -+ MPP1_NF_IO3, -+ MPP2_NF_IO4, -+ MPP3_NF_IO5, -+ MPP4_NF_IO6, -+ MPP5_NF_IO7, -+ MPP6_SYSRST_OUTn, -+ MPP7_GPO, -+ MPP8_TW_SDA, /* PCF8563 RTC chip */ -+ MPP9_TW_SCK, /* connected to TWSI */ -+ MPP10_UART0_TXD, -+ MPP11_UART0_RXD, -+ MPP12_GPO, /* SATA2 LED (green) */ -+ MPP13_GPIO, /* SATA2 LED (red) */ -+ MPP14_GPIO, /* MCU DATA pin (in) */ -+ MPP15_GPIO, /* USB LED (green) */ -+ MPP16_GPIO, /* MCU CLK pin (out) */ -+ MPP17_GPIO, /* MCU ACT pin (out) */ -+ MPP18_NF_IO0, -+ MPP19_NF_IO1, -+ MPP20_GPIO, -+ MPP21_GPIO, /* USB LED (red)-Power*/ -+ MPP22_GPIO, -+ MPP23_GPIO, -+ MPP24_GPIO, -+ MPP25_GPIO, -+ MPP26_GPIO, -+ MPP27_GPIO, -+ MPP28_GPIO, /* SYS LED (green) */ -+ MPP29_GPIO, /* SYS LED (red) */ -+ MPP30_GPIO, -+ MPP31_GPIO, -+ MPP32_GPIO, -+ MPP33_GPIO, -+ MPP34_GPIO, -+ MPP35_GPIO, -+ MPP36_GPIO, /* Reset button */ -+ MPP37_GPIO, /* Copy button */ -+ MPP38_GPIO, /* VID B0 */ -+ MPP39_GPIO, /* COPY LED (green) */ -+ MPP40_GPIO, /* COPY LED (red) */ -+ MPP41_GPIO, /* SATA1 LED (green) */ -+ MPP42_GPIO, /* SATA1 LED (red) */ -+ MPP43_GPIO, /* HTP pin */ -+ MPP44_GPIO, /* Buzzer */ -+ MPP45_GPIO, /* VID B1 */ -+ MPP46_GPIO, /* Power button */ -+ MPP47_GPIO, /* Power resume data */ -+ MPP48_GPIO, /* Power off */ -+ MPP49_GPIO, /* Power resume clock */ -+ 0 -+ }; -+ kirkwood_mpp_conf(kwmpp_config,NULL); -+ return 0; -+} -+ -+int board_init(void) -+{ -+ /* address of boot parameters */ -+ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; -+ -+ return 0; -+} -+ -+#ifdef CONFIG_RESET_PHY_R -+/* Configure and enable MV88E1318 PHY */ -+void reset_phy(void) -+{ -+ u16 reg; -+ u16 devadr; -+ char *name = "egiga0"; -+ -+ if (miiphy_set_current_dev(name)) -+ return; -+ -+ /* command to read PHY dev address */ -+ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { -+ printf("Err..%s could not read PHY dev address\n", -+ __FUNCTION__); -+ return; -+ } -+ -+ /* Set RGMII delay */ -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 2); -+ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); -+ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); -+ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); -+ -+ /* reset the phy */ -+ miiphy_reset(name, devadr); -+ -+ printf("MV88E1318 PHY initialized on %s\n", name); -+} -+#endif /* CONFIG_RESET_PHY_R */ -+ -+#ifdef CONFIG_SHOW_BOOT_PROGRESS -+void show_boot_progress(int val) -+{ -+ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; -+ u32 dout0 = readl(&gpio0->dout); -+ u32 blen0 = readl(&gpio0->blink_en); -+ -+ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; -+ u32 dout1 = readl(&gpio1->dout); -+ u32 blen1 = readl(&gpio1->blink_en); -+ -+ switch (val) { -+ case BOOTSTAGE_ID_DECOMP_IMAGE: -+ writel(blen0 & ~(SYS_GREEN_LED | SYS_RED_LED), &gpio0->blink_en); -+ writel((dout0 & ~SYS_GREEN_LED) | SYS_RED_LED, &gpio0->dout); -+ break; -+ case BOOTSTAGE_ID_RUN_OS: -+ writel(dout0 & ~SYS_RED_LED, &gpio0->dout); -+ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); -+ break; -+ case BOOTSTAGE_ID_NET_START: -+ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); -+ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); -+ break; -+ case BOOTSTAGE_ID_NET_LOADED: -+ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); -+ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); -+ break; -+ case -BOOTSTAGE_ID_NET_NETLOOP_OK: -+ case -BOOTSTAGE_ID_NET_LOADED: -+ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); -+ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); -+ break; -+ default: -+ if (val < 0) { -+ /* error */ -+ printf("Error occured, error code = %d\n", -val); -+ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); -+ writel(blen0 | SYS_RED_LED, &gpio0->blink_en); -+ } -+ break; -+ } -+} -+#endif -diff --git a/board/zyxel/nsa310/nsa310.h b/board/zyxel/nsa310/nsa310.h -new file mode 100644 -index 0000000..6634a4f ---- /dev/null -+++ b/board/zyxel/nsa310/nsa310.h -@@ -0,0 +1,56 @@ -+/* -+ * Copyright (C) 2013 Rafal Kazmierowski -+ * -+ * Based on Peter Schildmann -+ * and guruplug.h originally written by -+ * Siddarth Gore -+ * (C) Copyright 2009 -+ * Marvell Semiconductor -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#ifndef __NSA310_H -+#define __NSA310_H -+ -+/* GPIO's */ -+#define SYS_GREEN_LED (1 << 28) -+#define SYS_RED_LED (1 << 29) -+#define SATA1_GREEN_LED (1 << 41) -+#define SATA1_RED_LED (1 << 42) -+#define SATA2_GREEN_LED (1 << 12) -+#define SATA2_RED_LED (1 << 13) -+#define USB_GREEN_LED (1 << 15) -+#define USB_RED_LED (1 << 21) -+#define COPY_GREEN_LED (1 << 39) -+#define COPY_RED_LED (1 << 40) -+ -+#define NSA310_OE_LOW (0) -+#define NSA310_VAL_LOW (SYS_GREEN_LED) -+#define NSA310_OE_HIGH ((COPY_GREEN_LED | COPY_RED_LED | \ -+ SATA1_GREEN_LED | SATA1_RED_LED)) -+#define NSA310_VAL_HIGH (0) -+ -+/* PHY related */ -+#define MV88E1318_MAC_CTRL_REG 21 -+#define MV88E1318_PGADR_REG 22 -+#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) -+#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) -+ -+#endif /* __NSA310_H */ -diff --git a/configs/nsa310_defconfig b/configs/nsa310_defconfig -new file mode 100644 -index 0000000..d26ef35 ---- /dev/null -+++ b/configs/nsa310_defconfig -@@ -0,0 +1,34 @@ -+CONFIG_ARM=y -+CONFIG_KIRKWOOD=y -+CONFIG_TARGET_NSA310=y -+CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server" -+CONFIG_BOOTDELAY=3 -+CONFIG_SYS_PROMPT="NSA310> " -+# CONFIG_CMD_IMLS is not set -+# CONFIG_CMD_FLASH is not set -+CONFIG_SYS_NS16550=y -+CONFIG_CMD_FDT=y -+CONFIG_OF_LIBFDT=y -+CONFIG_CMD_SETEXPR=y -+CONFIG_CMD_DHCP=y -+CONFIG_CMD_MII=y -+CONFIG_CMD_PING=y -+CONFIG_CMD_DNS=y -+CONFIG_CMD_SNTP=y -+CONFIG_CMD_USB=y -+CONFIG_CMD_DATE=y -+CONFIG_CMD_EXT2=y -+CONFIG_CMD_EXT4=y -+CONFIG_CMD_FAT=y -+CONFIG_CMD_JFFS2=y -+CONFIG_CMD_MTDPARTS=y -+CONFIG_CMD_ENV=y -+CONFIG_CMD_NAND=y -+CONFIG_EFI_PARTITION=y -+CONFIG_ENV_IS_IN_NAND=y -+CONFIG_CMD_UBI=y -+CONFIG_USB=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_STORAGE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y -diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h -new file mode 100644 -index 0000000..86ef825 ---- /dev/null -+++ b/include/configs/nsa310.h -@@ -0,0 +1,126 @@ -+/* Copyright (C) 2015-2016 bodhi -+ * -+ * Based on -+ * Copyright (C) 2012 Peter Schildmann -+ * -+ * Based on guruplug.h originally written by -+ * Siddarth Gore -+ * (C) Copyright 2009 -+ * Marvell Semiconductor -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#ifndef _CONFIG_NSA310_H -+#define _CONFIG_NSA310_H -+ -+/* -+ * High Level Configuration Options (easy to change) -+ */ -+#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ -+#define CONFIG_KW88F6281 /* SOC Name */ -+ -+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ -+ -+/* -+ * Misc Configuration Options -+ */ -+#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ -+ -+/* -+ * Commands configuration -+ */ -+#define CONFIG_SYS_LONGHELP -+#define CONFIG_PREBOOT -+ -+/* -+ * mv-common.h should be defined after CMD configs since it used them -+ * to enable certain macros -+ */ -+#include "mv-common.h" -+ -+/* -+ * Environment variables configurations -+ */ -+#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#endif -+ -+/* max 4k env size is enough, but in case of nand -+ * it has to be rounded to sector size -+ */ -+#define CONFIG_ENV_SIZE 0x20000 /* 128k */ -+#define CONFIG_ENV_ADDR 0xc0000 -+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ -+ -+/* -+ * Default environment variables -+ */ -+#define CONFIG_BOOTCOMMAND \ -+ "ubi part ubi; " \ -+ "ubi read 0x800000 kernel; " \ -+ "bootm 0x800000" -+ -+#define CONFIG_MTDPARTS \ -+ "mtdparts=orion_nand:" \ -+ "0x0c0000(uboot)," \ -+ "0x80000(uboot_env)," \ -+ "0x7ec0000(ubi)\0" -+ -+#define CONFIG_EXTRA_ENV_SETTINGS \ -+ "console=console=ttyS0,115200\0" \ -+ "mtdids=nand0=orion_nand\0" \ -+ "mtdparts="CONFIG_MTDPARTS \ -+ "bootargs_root=\0" -+ -+/* -+ * Ethernet Driver configuration -+ */ -+#ifdef CONFIG_CMD_NET -+#define CONFIG_NETCONSOLE -+#define CONFIG_NET_MULTI -+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -+#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_RESET_PHY_R -+#endif /* CONFIG_CMD_NET */ -+ -+/* -+ * SATA Driver configuration -+ */ -+#ifdef CONFIG_MVSATA_IDE -+#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET -+#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET -+#endif /* CONFIG_MVSATA_IDE */ -+ -+/* -+ * File system -+ */ -+#define CONFIG_JFFS2_NAND -+#define CONFIG_JFFS2_LZO -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS -+ -+/* -+ * Date Time -+ */ -+#ifdef CONFIG_CMD_DATE -+#define CONFIG_RTC_MV -+#endif /* CONFIG_CMD_DATE */ -+ -+#endif /* _CONFIG_NSA310_H */ diff --git a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch deleted file mode 100644 index 4b4356e5d..000000000 --- a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch +++ /dev/null @@ -1,683 +0,0 @@ -diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig -index 819bd3b..6a2d578 100644 ---- a/arch/arm/mach-kirkwood/Kconfig -+++ b/arch/arm/mach-kirkwood/Kconfig -@@ -62,6 +62,9 @@ config TARGET_NSA310 - config TARGET_NSA310S - bool "Zyxel NSA310S" - -+config TARGET_NSA325 -+ bool "Zyxel NSA325 board" -+ - endchoice - - config SYS_SOC -@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig - source "board/Seagate/nas220/Kconfig" - source "board/zyxel/nsa310/Kconfig" - source "board/zyxel/nsa310s/Kconfig" -+source "board/zyxel/nsa325/Kconfig" - - endif -diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig -new file mode 100644 -index 0000000..1fe5ead ---- /dev/null -+++ b/board/zyxel/nsa325/Kconfig -@@ -0,0 +1,12 @@ -+if TARGET_NSA325 -+ -+config SYS_BOARD -+ default "nsa325" -+ -+config SYS_VENDOR -+ default "zyxel" -+ -+config SYS_CONFIG_NAME -+ default "nsa325" -+ -+endif -diff --git a/board/zyxel/nsa325/MAINTAINERS b/board/zyxel/nsa325/MAINTAINERS -new file mode 100644 -index 0000000..130b4d9 ---- /dev/null -+++ b/board/zyxel/nsa325/MAINTAINERS -@@ -0,0 +1,6 @@ -+NSA325 BOARD -+M: Alberto Bursi -+S: Maintained -+F: board/zyxel/nsa325/ -+F: include/configs/nsa325.h -+F: configs/nsa325_defconfig -diff --git a/board/zyxel/nsa325/Makefile b/board/zyxel/nsa325/Makefile -new file mode 100644 -index 0000000..4ee953b ---- /dev/null -+++ b/board/zyxel/nsa325/Makefile -@@ -0,0 +1,13 @@ -+# -+# (C) Copyright 2015 bodhi -+# -+# Based on -+# (C) Copyright 2009 -+# Marvell Semiconductor -+# Written-by: Prafulla Wadaskar -+# -+# SPDX-License-Identifier: GPL-2.0+ -+# -+ -+obj-y := nsa325.o -+ -diff --git a/board/zyxel/nsa325/kwbimage.cfg b/board/zyxel/nsa325/kwbimage.cfg -new file mode 100644 -index 0000000..5a27d38 ---- /dev/null -+++ b/board/zyxel/nsa325/kwbimage.cfg -@@ -0,0 +1,78 @@ -+# Copyright (C) 2015 bodhi -+# -+# Extracted from Zyxel GPL source for u-boot-1.1.4_NSA325v2 -+# -+# See file CREDITS for list of people who contributed to this -+# project. -+# -+# This program is free software; you can redistribute it and/or -+# modify it under the terms of the GNU General Public License as -+# published by the Free Software Foundation; either version 2 of -+# the License, or (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+# MA 02110-1301 USA -+# -+# Refer docs/README.kwimage for more details about how-to configure -+# and create kirkwood boot image -+# -+ -+# Boot Media configurations -+#BOOT_FROM uart -+BOOT_FROM nand -+NAND_ECC_MODE default -+NAND_PAGE_SIZE 0x0800 -+ -+# SOC registers configuration using bootrom header extension -+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed -+ -+# Configure RGMII-0 interface pad voltage to 1.8V -+DATA 0xFFD100e0 0x1b1b1b9b -+ -+#Dram initalization -+DATA 0xFFD01400 0x4301503E # DDR Configuration register -+DATA 0xFFD01404 0xB9843000 # DDR Controller Control Low -+DATA 0xFFD01408 0x33137777 # DDR Timing (Low) -+DATA 0xFFD0140C 0x16000C55 # DDR Timing (High) -+DATA 0xFFD01410 0x04000000 # DDR Address Control -+DATA 0xFFD01414 0x00000000 # DDR Open Pages Control -+DATA 0xFFD01418 0x00000000 # DDR Operation -+DATA 0xFFD0141C 0x00000672 # DDR Mode -+DATA 0xFFD01420 0x00000004 # DDR Extended Mode -+DATA 0xFFD01424 0x0000F14F # DDR Controller Control High -+DATA 0xFFD01428 0x000D6720 # DDR3 ODT Read Timing -+DATA 0xFFD0147C 0x0000B571 # DDR2 ODT Write Timing -+DATA 0xFFD01504 0x1FFFFFF1 # CS[0]n Size -+DATA 0xFFD01508 0x20000000 # CS[1]n Base address to 512Mb -+DATA 0xFFD0150C 0x1FFFFFF4 # CS[1]n Size 512Mb Window enabled for CS1 -+DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled -+DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled -+DATA 0xFFD01494 0x00120000 # DDR ODT Control (Low) -+DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) -+DATA 0xFFD0149C 0x0000E803 # CPU ODT Control -+ -+DATA 0xFFD015D0 0x00000630 -+DATA 0xFFD015D4 0x00000046 -+DATA 0xFFD015D8 0x00000008 -+DATA 0xFFD015DC 0x00000000 -+DATA 0xFFD015E0 0x00000023 -+DATA 0xFFD015E4 0x00203C18 -+DATA 0xFFD01620 0x00384800 -+DATA 0xFFD01480 0x00000001 -+DATA 0xFFD20134 0x66666666 -+DATA 0xFFD20138 0x00066666 -+ -+#Disable nsa325 hardware watchdog to allow successful kwbooting -+DATA 0xFFD10100 0x00004000 # set GPIO 14 to high to disable the watchdog -+DATA 0xFFD10104 0xFFFFBFFF # set GPIO 14 to output (to block any other input to it) -+ -+# End of Header extension -+DATA 0x0 0x0 -+ -diff --git a/board/zyxel/nsa325/nsa325.c b/board/zyxel/nsa325/nsa325.c -new file mode 100644 -index 0000000..4cd1c0f ---- /dev/null -+++ b/board/zyxel/nsa325/nsa325.c -@@ -0,0 +1,265 @@ -+/* -+ * Copyright (C) 2015 bodhi -+ * -+ * Based on -+ * Copyright (C) 2014 Jason Plum -+ * -+ * Based on nsa320.c originall written by -+ * Copyright (C) 2012 Peter Schildmann -+ * -+ * Based on guruplug.c originally written by -+ * Siddarth Gore -+ * (C) Copyright 2009 -+ * Marvell Semiconductor -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include "nsa325.h" -+#include -+ -+DECLARE_GLOBAL_DATA_PTR; -+ -+int board_early_init_f(void) -+{ -+ /* -+ * default gpio configuration -+ * There are maximum 64 gpios controlled through 2 sets of registers -+ * the below configuration configures mainly initial LED status -+ */ -+ mvebu_config_gpio(NSA325_VAL_LOW, NSA325_VAL_HIGH, -+ NSA325_OE_LOW, NSA325_OE_HIGH); -+ -+ /* Multi-Purpose Pins Functionality configuration */ -+ /* (all LEDs & power off active high) */ -+ u32 kwmpp_config[] = { -+ MPP0_NF_IO2, -+ MPP1_NF_IO3, -+ MPP2_NF_IO4, -+ MPP3_NF_IO5, -+ MPP4_NF_IO6, -+ MPP5_NF_IO7, -+ MPP6_SYSRST_OUTn, -+ MPP7_GPO, -+ MPP8_TW_SDA, /* PCF8563 RTC chip */ -+ MPP9_TW_SCK, /* connected to TWSI */ -+ MPP10_UART0_TXD, -+ MPP11_UART0_RXD, -+ MPP12_GPO, /* HDD2 LED (green) */ -+ MPP13_GPIO, /* HDD2 LED (red) */ -+ MPP14_GPIO, /* MCU DATA pin (in) */ -+ MPP15_GPIO, /* USB LED (green) */ -+ MPP16_GPIO, /* MCU CLK pin (out) */ -+ MPP17_GPIO, /* MCU ACT pin (out) */ -+ MPP18_NF_IO0, -+ MPP19_NF_IO1, -+ MPP20_GPIO, -+ MPP21_GPIO, /* USB power */ -+ MPP22_GPIO, -+ MPP23_GPIO, -+ MPP24_GPIO, -+ MPP25_GPIO, -+ MPP26_GPIO, -+ MPP27_GPIO, -+ MPP28_GPIO, /* SYS LED (green) */ -+ MPP29_GPIO, /* SYS LED (orange) */ -+ MPP30_GPIO, -+ MPP31_GPIO, -+ MPP32_GPIO, -+ MPP33_GPIO, -+ MPP34_GPIO, -+ MPP35_GPIO, -+ MPP36_GPIO, /* reset button */ -+ MPP37_GPIO, /* copy button */ -+ MPP38_GPIO, /* VID B0 */ -+ MPP39_GPIO, /* COPY LED (green) */ -+ MPP40_GPIO, /* COPY LED (red) */ -+ MPP41_GPIO, /* HDD1 LED (green) */ -+ MPP42_GPIO, /* HDD1 LED (red) */ -+ MPP43_GPIO, /* HTP pin */ -+ MPP44_GPIO, /* buzzer */ -+ MPP45_GPIO, /* VID B1 */ -+ MPP46_GPIO, /* power button */ -+ MPP47_GPIO, /* HDD2 power */ -+ MPP48_GPIO, /* power off */ -+ 0 -+ }; -+ kirkwood_mpp_conf(kwmpp_config, NULL); -+ return 0; -+} -+ -+int board_init(void) -+{ -+ -+ /* address of boot parameters */ -+ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; -+ -+ /* This disables the hardware watchdog in the mcu on this board. */ -+ kw_gpio_set_valid(14, 1); -+ kw_gpio_direction_output(14, 0); -+ kw_gpio_set_value(14, 1); -+ -+ return 0; -+} -+ -+#ifdef CONFIG_RESET_PHY_R -+/* Configure and enable MV88E1318 PHY */ -+void reset_phy(void) -+{ -+ u16 reg; -+ u16 devadr; -+ char *name = "egiga0"; -+ -+ if (miiphy_set_current_dev(name)) -+ return; -+ -+ /* command to read PHY dev address */ -+ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { -+ printf("Err..%s could not read PHY dev address\n", -+ __FUNCTION__); -+ return; -+ } -+ -+ /* Set RGMII delay */ -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_MAC_CTRL_PG); -+ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); -+ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); -+ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); -+ -+ /* reset the phy */ -+ miiphy_reset(name, devadr); -+ -+ /* The ZyXEL NSA325 uses the 88E1310S Alaska (interface identical to 88E1318) */ -+ /* and has an MCU attached to the LED[2] via tristate interrupt */ -+ reg = 0; -+ -+ /* switch to LED register page */ -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_LED_PG); -+ /* read out LED polarity register */ -+ miiphy_read(name, devadr, MV88E1318_LED_POL_REG, ®); -+ /* clear 4, set 5 - LED2 low, tri-state */ -+ reg &= ~(MV88E1318_LED2_4); -+ reg |= (MV88E1318_LED2_5); -+ /* write back LED polarity register */ -+ miiphy_write(name, devadr, MV88E1318_LED_POL_REG, reg); -+ /* jump back to page 0, per the PHY chip documenation. */ -+ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); -+ -+ /* Set the phy back to auto-negotiation mode. Onboard mcu sets it as 10Mbits/s on poweroff for WoL function */ -+ miiphy_write(name, devadr, 0x4, 0x1e1); -+ miiphy_write(name, devadr, 0x9, 0x300); -+ /* Downshift */ -+ miiphy_write(name, devadr, 0x10, 0x3860); -+ miiphy_write(name, devadr, 0x0, 0x9140); -+ -+ printf("MV88E1318 PHY initialized on %s\n", name); -+ -+} -+#endif /* CONFIG_RESET_PHY_R */ -+ -+#ifdef CONFIG_SHOW_BOOT_PROGRESS -+void show_boot_progress(int val) -+{ -+ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; -+ u32 dout0 = readl(&gpio0->dout); -+ u32 blen0 = readl(&gpio0->blink_en); -+ -+ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; -+ u32 dout1 = readl(&gpio1->dout); -+ u32 blen1 = readl(&gpio1->blink_en); -+ -+ switch (val) { -+ case BOOTSTAGE_ID_DECOMP_IMAGE: -+ writel(blen0 & ~(SYS_GREEN_LED | SYS_ORANGE_LED), &gpio0->blink_en); -+ writel((dout0 & ~SYS_GREEN_LED) | SYS_ORANGE_LED, &gpio0->dout); -+ break; -+ case BOOTSTAGE_ID_RUN_OS: -+ writel(dout0 & ~SYS_ORANGE_LED, &gpio0->dout); -+ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); -+ break; -+ case BOOTSTAGE_ID_NET_START: -+ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); -+ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); -+ break; -+ case BOOTSTAGE_ID_NET_LOADED: -+ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); -+ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); -+ break; -+ case -BOOTSTAGE_ID_NET_NETLOOP_OK: -+ case -BOOTSTAGE_ID_NET_LOADED: -+ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); -+ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); -+ break; -+ default: -+ if (val < 0) { -+ /* error */ -+ printf("Error occured, error code = %d\n", -val); -+ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); -+ writel(blen0 | SYS_ORANGE_LED, &gpio0->blink_en); -+ } -+ break; -+ } -+} -+#endif -+ -+#if defined(CONFIG_KIRKWOOD_GPIO) -+/* Return GPIO button status */ -+/* -+un-pressed: -+ gpio-36 (Reset Button ) in hi (act lo) - IRQ edge (clear ) -+ gpio-37 (Copy Button ) in hi (act lo) - IRQ edge (clear ) -+ gpio-46 (Power Button ) in lo (act hi) - IRQ edge (clear ) -+pressed -+ gpio-36 (Reset Button ) in lo (act hi) - IRQ edge (clear ) -+ gpio-37 (Copy Button ) in lo (act hi) - IRQ edge (clear ) -+ gpio-46 (Power Button ) in hi (act lo) - IRQ edge (clear ) -+*/ -+ -+static int -+do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) -+{ -+ if (strcmp(argv[1], "power") == 0) { -+ kw_gpio_set_valid(BTN_POWER, GPIO_INPUT_OK); -+ kw_gpio_direction_input(BTN_POWER); -+ return !kw_gpio_get_value(BTN_POWER); -+ } -+ else if (strcmp(argv[1], "reset") == 0) -+ return kw_gpio_get_value(BTN_RESET); -+ else if (strcmp(argv[1], "copy") == 0) -+ return kw_gpio_get_value(BTN_COPY); -+ else -+ return -1; -+} -+ -+ -+U_BOOT_CMD(button, 2, 0, do_read_button, -+ "Return GPIO button status 0=off 1=on", -+ "- button power|reset|copy: test buttons states\n" -+); -+ -+#endif -+ -diff --git a/board/zyxel/nsa325/nsa325.h b/board/zyxel/nsa325/nsa325.h -new file mode 100644 -index 0000000..996653e ---- /dev/null -+++ b/board/zyxel/nsa325/nsa325.h -@@ -0,0 +1,77 @@ -+/* -+ * Copyright (C) 2014 Jason Plum -+ * -+ * Based on nsa320.h originall written by -+ * Copyright (C) 2012 Peter Schildmann -+ * -+ * Based on guruplug.h originally written by -+ * Siddarth Gore -+ * (C) Copyright 2009 -+ * Marvell Semiconductor -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#ifndef __NSA325_H -+#define __NSA325_H -+ -+/* low GPIO's */ -+#define HDD2_GREEN_LED (1 << 12) -+#define HDD2_RED_LED (1 << 13) -+#define USB_GREEN_LED (1 << 15) -+#define USB_POWER (1 << 21) -+#define SYS_GREEN_LED (1 << 28) -+#define SYS_ORANGE_LED (1 << 29) -+ -+#define PIN_USB_GREEN_LED 15 -+#define PIN_USB_POWER 21 -+ -+#define NSA325_OE_LOW (~(HDD2_GREEN_LED | HDD2_RED_LED | \ -+ USB_GREEN_LED | USB_POWER | \ -+ SYS_GREEN_LED | SYS_ORANGE_LED)) -+#define NSA325_VAL_LOW (SYS_GREEN_LED | USB_POWER) -+ -+/* high GPIO's */ -+#define COPY_GREEN_LED (1 << 7) -+#define COPY_RED_LED (1 << 8) -+#define HDD1_GREEN_LED (1 << 9) -+#define HDD1_RED_LED (1 << 10) -+#define HDD2_POWER (1 << 15) -+#define WATCHDOG_SIGNAL (1 << 14) -+ -+#define NSA325_OE_HIGH (~(COPY_GREEN_LED | COPY_RED_LED | \ -+ HDD1_GREEN_LED | HDD1_RED_LED | HDD2_POWER | WATCHDOG_SIGNAL )) -+#define NSA325_VAL_HIGH (WATCHDOG_SIGNAL | HDD2_POWER) -+ -+/* PHY related */ -+#define MV88E1318_PGADR_REG 22 -+#define MV88E1318_MAC_CTRL_PG 2 -+#define MV88E1318_MAC_CTRL_REG 21 -+#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) -+#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) -+#define MV88E1318_LED_PG 3 -+#define MV88E1318_LED_POL_REG 17 -+#define MV88E1318_LED2_4 (1 << 4) -+#define MV88E1318_LED2_5 (1 << 5) -+ -+#define BTN_POWER 46 -+#define BTN_RESET 36 -+#define BTN_COPY 37 -+ -+#endif /* __NSA325_H */ -diff --git a/configs/nsa325_defconfig b/configs/nsa325_defconfig -new file mode 100644 -index 0000000..48e09cc ---- /dev/null -+++ b/configs/nsa325_defconfig -@@ -0,0 +1,34 @@ -+CONFIG_ARM=y -+CONFIG_KIRKWOOD=y -+CONFIG_TARGET_NSA325=y -+CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server" -+CONFIG_BOOTDELAY=3 -+CONFIG_SYS_PROMPT="NSA325> " -+# CONFIG_CMD_IMLS is not set -+# CONFIG_CMD_FLASH is not set -+CONFIG_SYS_NS16550=y -+CONFIG_CMD_FDT=y -+CONFIG_OF_LIBFDT=y -+CONFIG_CMD_SETEXPR=y -+CONFIG_CMD_DHCP=y -+CONFIG_CMD_MII=y -+CONFIG_CMD_PING=y -+CONFIG_CMD_DNS=y -+CONFIG_CMD_SNTP=y -+CONFIG_CMD_USB=y -+CONFIG_USB=y -+CONFIG_CMD_DATE=y -+CONFIG_CMD_EXT2=y -+CONFIG_CMD_EXT4=y -+CONFIG_CMD_FAT=y -+CONFIG_CMD_JFFS2=y -+CONFIG_CMD_MTDPARTS=y -+CONFIG_CMD_ENV=y -+CONFIG_CMD_NAND=y -+CONFIG_EFI_PARTITION=y -+CONFIG_ENV_IS_IN_NAND=y -+CONFIG_CMD_UBI=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_STORAGE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y -diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h -new file mode 100644 -index 0000000..e5a8e2a ---- /dev/null -+++ b/include/configs/nsa325.h -@@ -0,0 +1,129 @@ -+/* -+ * (C) Copyright 2016 bodhi -+ * -+ * Based on -+ * Copyright (C) 2014 Jason Plum -+ * Based on -+ * Copyright (C) 2012 Peter Schildmann -+ * -+ * Based on guruplug.h originally written by -+ * Siddarth Gore -+ * (C) Copyright 2009 -+ * Marvell Semiconductor -+ * -+ * See file CREDITS for list of people who contributed to this -+ * project. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of -+ * the License, or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301 USA -+ */ -+ -+#ifndef _CONFIG_NSA325_H -+#define _CONFIG_NSA325_H -+ -+/* -+ * High Level Configuration Options (easy to change) -+ */ -+#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ -+#define CONFIG_KW88F6281 1 /* SOC Name */ -+ -+#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ -+ -+/* -+ * Misc Configuration Options -+ */ -+#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ -+ -+/* -+ * Commands configuration -+ */ -+#define CONFIG_SYS_LONGHELP -+#define CONFIG_PREBOOT -+ -+/* -+ * mv-common.h should be defined after CMD configs since it used them -+ * to enable certain macros -+ */ -+#include "mv-common.h" -+ -+/* -+ * Environment variables configurations -+ */ -+#ifdef CONFIG_CMD_NAND -+#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ -+#endif -+/* -+ * max 4k env size is enough, but in case of nand -+ * it has to be rounded to sector size -+ */ -+#define CONFIG_ENV_SIZE 0x20000 /* 128k */ -+#define CONFIG_ENV_ADDR 0xc0000 -+#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ -+ -+/* -+ * Default environment variables -+ */ -+#define CONFIG_BOOTCOMMAND \ -+ "ubi part ubi; " \ -+ "ubi read 0x800000 kernel; " \ -+ "bootm 0x800000" -+ -+#define CONFIG_MTDPARTS \ -+ "mtdparts=orion_nand:" \ -+ "0x0c0000(uboot)," \ -+ "0x80000(uboot_env)," \ -+ "0x7ec0000(ubi)\0" -+ -+#define CONFIG_EXTRA_ENV_SETTINGS \ -+ "console=console=ttyS0,115200\0" \ -+ "mtdids=nand0=orion_nand\0" \ -+ "mtdparts="CONFIG_MTDPARTS \ -+ "bootargs_root=\0" -+ -+/* -+ * Ethernet Driver configuration -+ */ -+#ifdef CONFIG_CMD_NET -+#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ -+#define CONFIG_PHY_BASE_ADR 0x1 -+#define CONFIG_NETCONSOLE -+#endif /* CONFIG_CMD_NET */ -+ -+/* -+ * SATA Driver configuration -+ */ -+#ifdef CONFIG_MVSATA_IDE -+#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET -+#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET -+#endif /* CONFIG_MVSATA_IDE */ -+ -+/* -+ * File system -+ */ -+#define CONFIG_JFFS2_NAND -+#define CONFIG_JFFS2_LZO -+#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ -+#define CONFIG_MTD_PARTITIONS -+ -+/* -+ * Date Time -+ */ -+#ifdef CONFIG_CMD_DATE -+#define CONFIG_RTC_MV -+#endif /* CONFIG_CMD_DATE */ -+ -+#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ -+ -+#endif /* _CONFIG_NSA325_H */ diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 94d62cee8..07d65de17 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,14 +1,14 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -19,6 +19,7 @@ - #define CONFIG_KW88F6281 1 /* SOC Name */ - #define CONFIG_MACH_DOCKSTAR /* Machine type */ - #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +@@ -31,6 +31,7 @@ + * Commands configuration + */ + #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +#define CONFIG_SYS_MVFS - + #define CONFIG_CMD_ENV + #define CONFIG_CMD_NAND /* - * mv-common.h should be defined after CMD configs since it used them -@@ -37,29 +38,29 @@ +@@ -53,29 +54,29 @@ * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ @@ -26,12 +26,11 @@ - "ubifsload 0x800000 ${kernel}; " \ - "ubifsload 0x1100000 ${initrd}; " \ - "bootm 0x800000 0x1100000" -- --#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ + "bootm 0x800000" -+ + +-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" +#define CONFIG_MTDPARTS \ + "mtdparts=orion_nand:" \ + "0xe0000@0x0(uboot)," \ diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index bd1dab818..102a147c2 100644 --- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch +++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch @@ -1,7 +1,7 @@ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -44,30 +44,29 @@ - #define CONFIG_ENV_SECT_SIZE 0x20000 +@@ -59,30 +59,29 @@ + #define CONFIG_ENV_IS_NOWHERE #endif #define CONFIG_ENV_SIZE 0x20000 -#define CONFIG_ENV_OFFSET 0x80000 @@ -42,8 +42,8 @@ * Ethernet driver configuration --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => " - CONFIG_CMD_NAND=y +@@ -7,6 +7,7 @@ CONFIG_SYS_PROMPT="iconnect => " + # CONFIG_CMD_FLASH is not set CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch index 58db8c8c8..f2ba8137a 100644 --- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch +++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch @@ -1,6 +1,6 @@ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -49,27 +49,22 @@ +@@ -62,27 +62,22 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch index 5c8ff35be..f80346773 100644 --- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -1,6 +1,6 @@ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -44,23 +44,30 @@ +@@ -54,23 +54,30 @@ #endif #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch index 88b833072..46a6ab561 100644 --- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch +++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch @@ -1,15 +1,16 @@ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -70,20 +70,18 @@ +@@ -87,20 +87,18 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ - "ubi part root; " \ - "ubifsmount ubi:root; " \ - "ubifsload 0x800000 ${kernel}; " \ +- "bootm 0x800000" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ - "bootm 0x800000" ++ "bootm 0x800000" #define CONFIG_MTDPARTS \ - "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index d6246dc93..37f30d0a5 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig" +@@ -74,4 +74,7 @@ source "board/Seagate/goflexhome/Kconfig + source "board/Seagate/nas220/Kconfig" source "board/zyxel/nsa310s/Kconfig" - source "board/zyxel/nsa325/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -10,16 +10,16 @@ endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -76,4 +76,6 @@ - #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ - #define CONFIG_MTD_PARTITIONS +@@ -98,4 +98,6 @@ + #define CONFIG_CMD_MTDPARTS + #define CONFIG_LZO +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_DOCKSTAR_H */ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -94,4 +94,6 @@ +@@ -108,4 +108,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ @@ -28,16 +28,16 @@ #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -83,4 +83,6 @@ - #define CONFIG_MTD_DEVICE +@@ -103,4 +103,6 @@ #define CONFIG_MTD_PARTITIONS + #define CONFIG_CMD_MTDPARTS +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h -@@ -0,0 +1,31 @@ +@@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -47,6 +47,9 @@ +#ifndef __OPENWRT_KIRKWOOD_COMMON_H +#define __OPENWRT_KIRKWOOD_COMMON_H + ++/* Commands */ ++#define CONFIG_CMD_BOOTZ ++ +/* Ethernet */ +#if defined(CONFIG_CMD_NET) +#define CONFIG_SERVERIP 192.168.1.2 @@ -60,8 +63,14 @@ +#define CONFIG_ENV_IS_NOWHERE +#endif + ++/* Flattened uImage Tree */ ++#define CONFIG_FIT 1 ++#define CONFIG_FIT_VERBOSE 1 ++ +/* Various */ +#define CONFIG_BZIP2 ++#define CONFIG_LZMA ++#define CONFIG_LZO + +/* Unnecessary */ +#undef CONFIG_BOOTM_NETBSD @@ -71,119 +80,28 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -83,4 +83,6 @@ - #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ - #define CONFIG_MTD_PARTITIONS +@@ -99,4 +99,6 @@ + #define CONFIG_CMD_MTDPARTS + #define CONFIG_LZO +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_POGO_E02_H */ --- a/include/configs/sheevaplug.h +++ b/include/configs/sheevaplug.h -@@ -96,4 +96,6 @@ +@@ -109,4 +109,6 @@ #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET - #endif /* CONFIG_IDE */ + #endif /* CONFIG_CMD_IDE */ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_SHEEVAPLUG_H */ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -105,4 +105,6 @@ +@@ -122,4 +122,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_GOFLEXHOME_H */ ---- a/include/configs/nsa310.h -+++ b/include/configs/nsa310.h -@@ -123,4 +123,6 @@ - #define CONFIG_RTC_MV - #endif /* CONFIG_CMD_DATE */ - -+#include "openwrt-kirkwood-common.h" -+ - #endif /* _CONFIG_NSA310_H */ ---- a/configs/dockstar_defconfig -+++ b/configs/dockstar_defconfig -@@ -25,3 +25,8 @@ CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y ---- a/configs/goflexhome_defconfig -+++ b/configs/goflexhome_defconfig -@@ -29,3 +29,8 @@ CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y ---- a/configs/ib62x0_defconfig -+++ b/configs/ib62x0_defconfig -@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y --CONFIG_LZMA=y - CONFIG_OF_LIBFDT=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y ---- a/configs/iconnect_defconfig -+++ b/configs/iconnect_defconfig -@@ -24,5 +24,9 @@ CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y --CONFIG_LZMA=y - CONFIG_OF_LIBFDT=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y ---- a/configs/nsa310_defconfig -+++ b/configs/nsa310_defconfig -@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y - CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y - CONFIG_LZMA=y - CONFIG_LZO=y ---- a/configs/pogo_e02_defconfig -+++ b/configs/pogo_e02_defconfig -@@ -25,3 +25,8 @@ CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y - CONFIG_OF_LIBFDT=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y ---- a/configs/sheevaplug_defconfig -+++ b/configs/sheevaplug_defconfig -@@ -28,5 +28,8 @@ CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_USB_EHCI_HCD=y - CONFIG_USB_STORAGE=y --CONFIG_LZMA=y - CONFIG_OF_LIBFDT=y -+CONFIG_FIT=y -+CONFIG_FIT_VERBOSE=y -+CONFIG_LZMA=y -+CONFIG_LZO=y diff --git a/package/boot/uboot-lantiq/Makefile b/package/boot/uboot-lantiq/Makefile index 5493737d3..cbebe91c2 100644 --- a/package/boot/uboot-lantiq/Makefile +++ b/package/boot/uboot-lantiq/Makefile @@ -11,328 +11,336 @@ PKG_NAME:=u-boot PKG_VERSION:=2013.10 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55 +PKG_TARGETS:=bin + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=lantiq +define uboot/Default + TITLE:= + SOC:= DDR_SETTINGS:= + IMAGE:= + DEPS:= endef -define U-Boot/arv4519pw_ram - NAME:=Arcadyan arv4519pw (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4519pw +define uboot/arv4519pw_ram + TITLE:=U-Boot for Arcadyan arv4519pw (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv4519pw_nor - NAME:=Arcadyan arv4519pw (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4519pw +define uboot/arv4519pw_nor + TITLE:=U-Boot for Arcadyan arv4519pw (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv4519pw_brn - NAME:=Arcadyan arv4519pw (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4519pw +define uboot/arv4519pw_brn + TITLE:=U-Boot for Arcadyan arv4519pw (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7506pw11_ram - NAME:=Arcadyan ARV7506PW11 (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7506pw11 +define uboot/arv7506pw11_ram + TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7506pw11_nor - NAME:=Arcadyan ARV7506PW11 (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7506pw11 +define uboot/arv7506pw11_nor + TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7506pw11_brn - NAME:=Arcadyan ARV7506PW11 (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7506pw11 +define uboot/arv7506pw11_brn + TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw_ram - NAME:=Arcadyan arv7510pw (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4510pw +define uboot/arv7510pw_ram + TITLE:=U-Boot for Arcadyan arv7510pw (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw_nor - NAME:=Arcadyan arv7510pw (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4510pw +define uboot/arv7510pw_nor + TITLE:=U-Boot for Arcadyan arv7510pw (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw_brn - NAME:=Arcadyan arv7510pw (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv4510pw +define uboot/arv7510pw_brn + TITLE:=U-Boot for Arcadyan arv7510pw (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw22_ram - NAME:=Arcadyan arv7510pw22 (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7510pw22 +define uboot/arv7510pw22_ram + TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw22_nor - NAME:=Arcadyan arv7510pw22 (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7510pw22 +define uboot/arv7510pw22_nor + TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7510pw22_brn - NAME:=Arcadyan arv7510pw22 (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7510pw22 +define uboot/arv7510pw22_brn + TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7518pw_ram - NAME:=Arcadyan arv7518pw (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7518pw +define uboot/arv7518pw_ram + TITLE:=U-Boot for Arcadyan arv7518pw (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7518pw_nor - NAME:=Arcadyan arv7518pw (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7518pw +define uboot/arv7518pw_nor + TITLE:=U-Boot for Arcadyan arv7518pw (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv7518pw_brn - NAME:=Arcadyan arv7518pw (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv7518pw +define uboot/arv7518pw_brn + TITLE:=U-Boot for Arcadyan arv7518pw (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw_ram - NAME:=Arcadyan arv752dpw (RAM) - BUILD_SUBTARGET:=xway +define uboot/arv752dpw_ram + TITLE:=U-Boot for Arcadyan arv752dpw (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h - BUILD_DEVICES:=arcadyan_arv752dpw + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw_nor - NAME:=Arcadyan arv752dpw (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv752dpw +define uboot/arv752dpw_nor + TITLE:=U-Boot for Arcadyan arv752dpw (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw_brn - NAME:=Arcadyan arv752dpw (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv752dpw +define uboot/arv752dpw_brn + TITLE:=U-Boot for Arcadyan arv752dpw (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw22_ram - NAME:=Arcadyan arv752dpw22 (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv752dpw22 +define uboot/arv752dpw22_ram + TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw22_nor - NAME:=Arcadyan arv752dpw22 (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv752dpw22 +define uboot/arv752dpw22_nor + TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv752dpw22_brn - NAME:=Arcadyan arv752dpw22 (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv752dpw22 +define uboot/arv752dpw22_brn + TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv8539pw22_ram - NAME:=Speedport W 504V Typ A (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv8539pw22 +define uboot/arv8539pw22_ram + TITLE:=U-Boot for Speedport W 504V Typ A (RAM) + SOC:=danube DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv8539pw22_nor - NAME:=Speedport W 504V Typ A (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv8539pw22 +define uboot/arv8539pw22_nor + TITLE:=U-Boot for Speedport W 504V Typ A (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/arv8539pw22_brn - NAME:=Speedport W 504V Typ A (BRN) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=arcadyan_arv8539pw22 +define uboot/arv8539pw22_brn + TITLE:=U-Boot for Speedport W 504V Typ A (BRN) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/gigasx76x_ram - NAME:=Siemens Gigaset sx76x (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=siemens_gigaset-sx76x +define uboot/gigasx76x_ram + TITLE:=U-Boot for Siemens Gigaset sx76x (RAM) + SOC:=danube DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/gigasx76x_nor - NAME:=Siemens Gigaset sx76x (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=siemens_gigaset-sx76x +define uboot/gigasx76x_nor + TITLE:=U-Boot for Siemens Gigaset sx76x (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/acmp252_ram - NAME:=AudioCodes MP-252 (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=audiocodes_mp-252 +define uboot/acmp252_ram + TITLE:=U-Boot for AudioCodes MP-252 (RAM) + SOC:=danube DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/acmp252_nor - NAME:=AudioCodes MP-252 (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=audiocodes_mp-252 +define uboot/acmp252_nor + TITLE:=U-Boot for AudioCodes MP-252 (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/bthomehubv5a_ram - NAME:=BT Home Hub 5A (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=bt_homehub-v5a +define uboot/bthomehubv5a_ram + TITLE:=U-Boot for BT Home Hub 5A (RAM) + SOC:=vr9 DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/easy50712_ram - NAME:=Lantiq EASY50712 (RAM) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=lantiq_easy50712 +define uboot/easy50712_ram + TITLE:=U-Boot for Lantiq EASY50712 (RAM) + SOC:=danube DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/easy50712_nor - NAME:=Lantiq EASY50712 (NOR) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=lantiq_easy50712 +define uboot/easy50712_nor + TITLE:=U-Boot for Lantiq EASY50712 (NOR) + SOC:=danube + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/easy50712_norspl - NAME:=Lantiq EASY50712 (NOR SPL) - BUILD_SUBTARGET:=xway - BUILD_DEVICES:=lantiq_easy50712 - UBOOT_IMAGE:=u-boot.ltq.lzo.norspl - DEPENDS+=@BROKEN +define uboot/easy50712_norspl + TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL) + SOC:=danube + IMAGE:=u-boot.ltq.lzo.norspl + DEPS:=@TARGET_lantiq_xway endef -define U-Boot/easy80920_ram - NAME:=Lantiq EASY80920 (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand +define uboot/easy80920_ram + TITLE:=U-Boot for Lantiq EASY80920 (RAM) + SOC:=vr9 DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/easy80920_nor - NAME:=Lantiq EASY80920 (NOR) - BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand - BUILD_SUBTARGET:=xrx200 +define uboot/easy80920_nor + TITLE:=U-Boot for Lantiq EASY80920 (NOR) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/easy80920_norspl - NAME:=Lantiq EASY80920 (NOR SPL) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand - UBOOT_IMAGE:=u-boot.ltq.lzo.norspl - DEPENDS+=@BROKEN +define uboot/easy80920_norspl + TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL) + SOC:=vr9 + IMAGE:=u-boot.ltq.lzo.norspl + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/easy80920_sfspl - NAME:=Lantiq EASY80920 (SPI SPL) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand - UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl - DEPENDS+=@BROKEN +define uboot/easy80920_sfspl + TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL) + SOC:=vr9 + IMAGE:=u-boot.ltq.lzo.sfspl + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/fb3370_eva - NAME:=AVM FRITZ3370 (EVA) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=avm_fritz3370 +define uboot/fb3370_eva + TITLE:=U-Boot for AVM FRITZ3370 (EVA) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/fb3370_ram - NAME:=AVM FRITZ3370 (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=avm_fritz3370 +define uboot/fb3370_ram + TITLE:=U-Boot for AVM FRITZ3370 (RAM) + SOC:=vr9 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/fb3370_sfspl - NAME:=AVM FRITZ3370 (SPI SPL) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=avm_fritz3370 - UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl - DEPENDS+=@BROKEN +define uboot/fb3370_sfspl + TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL) + SOC:=vr9 + IMAGE:=u-boot.ltq.lzo.sfspl + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/p2812hnufx_ram - NAME:=ZyXEL P-2812HNU-Fx (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=zyxel_p-2812hnu-f1 +define uboot/p2812hnufx_ram + TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM) + SOC:=vr9 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/p2812hnufx_nandspl - NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=zyxel_p-2812hnu-f1 - UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl - DEPENDS+=@BROKEN +define uboot/p2812hnufx_nandspl + TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL) + SOC:=vr9 + IMAGE:=u-boot.ltq.lzo.nandspl + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7510kw22_brn - NAME:=Arcadyan VGV7510KW22 (BRN) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7510kw22-nor +define uboot/vgv7510kw22_brn + TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7510kw22_nor - NAME:=Arcadyan VGV7510KW22 (NOR) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7510kw22-nor +define uboot/vgv7510kw22_nor + TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7510kw22_ram - NAME:=Arcadyan VGV7510KW22 (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7510kw22-nor +define uboot/vgv7510kw22_ram + TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM) + SOC:=vr9 DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7519_brn - NAME:=Arcadyan VGV7519 (BRN) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn +define uboot/vgv7519_brn + TITLE:=U-Boot for Arcadyan VGV7519 (BRN) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7519_nor - NAME:=Arcadyan VGV7519 (NOR) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn +define uboot/vgv7519_nor + TITLE:=U-Boot for Arcadyan VGV7519 (NOR) + SOC:=vr9 + DEPS:=@TARGET_lantiq_xrx200 endef -define U-Boot/vgv7519_ram - NAME:=Arcadyan VGV7519 (RAM) - BUILD_SUBTARGET:=xrx200 - BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn +define uboot/vgv7519_ram + TITLE:=U-Boot for Arcadyan VGV7519 (RAM) + SOC:=vr9 DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h + DEPS:=@TARGET_lantiq_xrx200 endef -UBOOT_TARGETS:= \ +UBOOTS:= \ arv4519pw_ram arv4519pw_nor arv4519pw_brn \ arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \ arv7510pw_ram arv7510pw_nor arv7510pw_brn \ @@ -351,6 +359,25 @@ UBOOT_TARGETS:= \ vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \ vgv7519_brn vgv7519_nor vgv7519_ram +define Package/uboot/template +define Package/uboot-lantiq-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=$(3) @!IN_SDK + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Luka Perkov +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + DEPS:=$(uboot/$(1)/DEPS) + $(call Package/uboot/template,$(1),$(TITLE),$(DEPS)) +endef + define CompressVR9Firmware $(STAGING_DIR_HOST)/bin/lzma e \ $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \ @@ -366,25 +393,40 @@ define Build/Prepare $(call CompressVR9Firmware,22f,2) endef -UBOOT_MAKE_FLAGS := +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config +endef -ifeq ($(SUBTARGET),xway) - SOC:=danube -else - SOC:=vr9 -endif +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) +endef -define Package/u-boot/install/uart +define Package/uboot/install/default + $(CP) \ + $(PKG_BUILD_DIR)/$(2) \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img +endef + +define Package/uboot/install/uart awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \ - -v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \ + -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \ > $(PKG_BUILD_DIR)/ddr_settings perl $(PKG_BUILD_DIR)/tools/gct.pl \ $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \ - $(1)/u-boot.asc + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc + endef + +define Package/uboot/install/template +define Package/uboot-lantiq-$(1)/install + $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin)) + $(if $(DDR_SETTINGS), \ + $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \ + ) +endef endef -define Package/u-boot/install - $(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default)) -endef - -$(eval $(call BuildPackage/U-Boot)) +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call Package/uboot/install/template,$(u))) \ + $(eval $(call BuildPackage,uboot-lantiq-$(u))) \ +) diff --git a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch index cb695ffe3..08133bb08 100644 --- a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch +++ b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch @@ -1419,7 +1419,7 @@ Signed-off-by: Daniel Schwierzeck + +static int spl_uncompress_lzo(struct spl_image *spl, unsigned long loadaddr) +{ -+ size_t len = CONFIG_SYS_LOAD_SIZE; ++ size_t len; + int ret; + + spl_puts("SPL: decompressing U-Boot with LZO\n"); @@ -3237,7 +3237,7 @@ Signed-off-by: Daniel Schwierzeck +} --- /dev/null +++ b/arch/mips/include/asm/arch-danube/config.h -@@ -0,0 +1,164 @@ +@@ -0,0 +1,163 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3296,7 +3296,6 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 -+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET 0x4000 + +/* SRAM */ @@ -3476,7 +3475,7 @@ Signed-off-by: Daniel Schwierzeck +#endif /* __DANUBE_SOC_H__ */ --- /dev/null +++ b/arch/mips/include/asm/arch-vrx200/config.h -@@ -0,0 +1,188 @@ +@@ -0,0 +1,187 @@ +/* + * Copyright (C) 2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3547,7 +3546,6 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 -+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ @@ -7259,7 +7257,7 @@ Signed-off-by: Daniel Schwierzeck +static struct phy_driver pef7071_driver = { + .name = "Lantiq XWAY PEF7071", + .uid = 0xd565a400, -+ .mask = 0xFFFFFFF8, ++ .mask = 0xFFFFFFFF, + .features = PHY_GBIT_FEATURES, + .config = ltq_phy_config, + .startup = ltq_phy_startup, diff --git a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch index a12d2ebff..acda83c27 100644 --- a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch +++ b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch @@ -903,7 +903,7 @@ Signed-off-by: Daniel Schwierzeck #define STATUS_LANTIQ (STATUS_MIPS34K | STATUS_MIPS32_64) --- /dev/null +++ b/arch/mips/include/asm/arch-arx100/config.h -@@ -0,0 +1,176 @@ +@@ -0,0 +1,175 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -967,7 +967,6 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 -+#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ diff --git a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch index 6d1b8dc69..471c902aa 100644 --- a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch +++ b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch @@ -21,7 +21,7 @@ Signed-off-by: Daniel Schwierzeck struct args { enum image_types type; __u32 entry_addr; -+ off_t uboot_offset; ++ loff_t uboot_offset; + unsigned int page_size; const char *uboot_bin; const char *spl_bin; @@ -121,10 +121,10 @@ Signed-off-by: Daniel Schwierzeck } -static int create_sfspl(const struct args *arg) -+static int pad_to_offset(int fd, off_t offset) ++static int pad_to_offset(int fd, loff_t offset) { - int out_fd, uboot_fd, spl_fd, ret; -+ off_t pos; ++ loff_t pos; + size_t size; + ssize_t n; + __u8 *buf; diff --git a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch index 20bff445d..3b50c981c 100644 --- a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch +++ b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Schwierzeck --- /dev/null +++ b/include/configs/openwrt-lantiq-common.h -@@ -0,0 +1,40 @@ +@@ -0,0 +1,39 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -21,7 +21,6 @@ Signed-off-by: Daniel Schwierzeck +/* Commands */ +#if defined(CONFIG_LTQ_SUPPORT_ETHERNET) +#define CONFIG_CMD_PING -+#define CONFIG_CMD_TFTPPUT +#endif + +/* Compression */ diff --git a/package/boot/uboot-lantiq/patches/100-portability.patch b/package/boot/uboot-lantiq/patches/100-portability.patch deleted file mode 100644 index 4539e3e88..000000000 --- a/package/boot/uboot-lantiq/patches/100-portability.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/include/image.h -+++ b/include/image.h -@@ -17,7 +17,6 @@ - #define __IMAGE_H__ - - #include "compiler.h" --#include - - /* Define this to avoid #ifdefs later on */ - struct lmb; -@@ -36,6 +35,7 @@ struct lmb; - - #include - #include -+#include - #include - - /* Take notice of the 'ignore' property for hashes */ diff --git a/package/boot/uboot-layerscape-32b/Makefile b/package/boot/uboot-layerscape-32b/Makefile new file mode 100644 index 000000000..8a338cdce --- /dev/null +++ b/package/boot/uboot-layerscape-32b/Makefile @@ -0,0 +1,98 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk + +PKG_NAME:=uboot-layerscape-32bit +PKG_VERSION:=v1.0 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7 +PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git +PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4 + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +include $(INCLUDE_DIR)/package.mk + +define uboot/Default + TITLE:= + CONFIG:= +endef + +define uboot/ls1043ardb + TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board + CONFIG=ls1043ardb-uboot.bin +endef + +define uboot/ls1046ardb + TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board + CONFIG=ls1046ardb-uboot.bin +endef + +define uboot/ls1012ardb + TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board + CONFIG=ls1012ardb-uboot.bin.swap +endef + +UBOOTS := \ + ls1043ardb \ + ls1046ardb \ + ls1012ardb + +define Package/uboot/template +define Package/uboot-layerscape-32b-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:= @TARGET_layerscape_32b + TITLE:=$(2) + URL:=https://github.com/fsl-jyt/uboot-ls-32b.git + VARIANT:=$(1) + MAINTAINER:=Jiang Yutang +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +endif + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/uboot/install/default + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin +endef + +define Package/uboot/install/template +define Package/uboot-layerscape-32b-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \ +) diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile deleted file mode 100644 index d1ca82917..000000000 --- a/package/boot/uboot-layerscape-armv8_32b/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=uboot-layerscape-armv8_32b -PKG_SOURCE_DATE:=2017-10-24 -PKG_RELEASE:=1 - -# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit -# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets, -# 64-bit u-boot images git tree is provided here whose source code actually is -# uboot-layerscape's source code. -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git -PKG_SOURCE_VERSION:=43cb4c0fcab237f8daa39c393cc1441b76b99fcf -PKG_MIRROR_HASH:=ff7d1fcb85dda2be6a9e3785821b5791c7189d2d412b160a9621bb2dcad24dea - -PKG_MAINTAINER:=Yangbo Lu - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/kernel.mk - -define Package/uboot-layerscape-armv8_32b - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_layerscape_armv8_32b - TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards - DEFAULT:=y - HIDDEN:=1 -endef - -define Build/Configure - -endef - -define Build/Compile - -endef - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin - $(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin -endef - -$(eval $(call BuildPackage,uboot-layerscape-armv8_32b)) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index c37b335b4..6cd35b8e8 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -6,71 +6,100 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/image.mk PKG_NAME:=uboot-layerscape -PKG_SOURCE_DATE:=2017-08-24 +PKG_VERSION:=v1.0 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git -PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af -PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d +PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768 +PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git +PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad + +PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=layerscape - BUILD_SUBTARGET:=armv8_64b - BUILD_DEVICES:=$(1) - UBOOT_IMAGE:=u-boot-dtb.bin - HIDDEN:=y +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/ls1043ardb - NAME:=NXP ls1043ardb 64b Dev Board +define uboot/ls1043ardb + TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board + CONFIG=ls1043ardb endef -define U-Boot/ls1046ardb - NAME:=NXP ls1046ardb 64b Dev Board - UBOOT_CONFIG:=ls1046ardb_qspi +define uboot/ls1046ardb + TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board + CONFIG=ls1046ardb_qspi endef -define U-Boot/ls1012ardb - NAME:=NXP ls1012ardb 64b Dev Board - UBOOT_CONFIG:=ls1012ardb_qspi +define uboot/ls1012ardb + TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board + CONFIG=ls1012ardb_qspi + IMAGE=u-boot-swap.bin endef -define U-Boot/ls1088ardb - NAME:=NXP ls1088ardb 64b Dev Board - UBOOT_CONFIG:=ls1088ardb_qspi -endef - -define U-Boot/ls2088ardb - NAME:=NXP ls2088ardb 64b Dev Board - UBOOT_CONFIG:=ls2080ardb -endef - -define U-Boot/ls1012afrdm - NAME:=NXP ls1012afrdm 64b Dev Board - UBOOT_CONFIG:=ls1012afrdm_qspi -endef - -UBOOT_TARGETS := \ +UBOOTS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb \ - ls1088ardb \ - ls2088ardb \ - ls1012afrdm + ls1012ardb -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin +define Package/uboot/template +define Package/uboot-layerscape-64b-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:= @TARGET_layerscape_64b + TITLE:=$(2) + URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot + VARIANT:=$(1) + MAINTAINER:=Jiang Yutang +endef endef -define Package/u-boot/install/default +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) endef -$(eval $(call BuildPackage/U-Boot)) +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin) +endif + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc +endef + +define Package/uboot/install/default + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin +endef + +define Package/uboot/install/template +define Package/uboot-layerscape-64b-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \ +) diff --git a/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch deleted file mode 100644 index 597383166..000000000 --- a/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Fri, 22 Sep 2017 11:00:12 +0800 -Subject: [PATCH 1/3] armv8: ls1043a: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls1043a_common.h | 20 +++++++++++++++++++- - 1 file changed, 19 insertions(+), 1 deletion(-) - -diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h -index 0b3fb4e..5c01111 100644 ---- a/include/configs/ls1043a_common.h -+++ b/include/configs/ls1043a_common.h -@@ -336,7 +336,19 @@ - "sd_bootcmd=echo Trying load from SD ..;" \ - "mmcinfo; mmc read $load_addr " \ - "$kernel_addr_sd $kernel_size_sd ;" \ -- " bootm $load_addr#$board\0" -+ " bootm $load_addr#$board\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock8 " \ -+ "rootfstype=squashfs,jffs2 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ -+ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ -+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ -+ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \ -+ "cp.b 61000000 $loadaddr 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - - #undef CONFIG_BOOTCOMMAND -@@ -351,6 +363,12 @@ - "env exists secureboot && esbc_halt;" - #endif - -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run lede_boot" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ - "earlycon=uart8250,mmio,0x21c0500 " \ - MTDPARTS_DEFAULT --- -2.7.4 - diff --git a/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch deleted file mode 100644 index 418f6287f..000000000 --- a/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch +++ /dev/null @@ -1,57 +0,0 @@ -From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Fri, 22 Sep 2017 11:36:43 +0800 -Subject: [PATCH 2/3] armv8: ls1046ardb: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls1046a_common.h | 15 ++++++++++++++- - include/configs/ls1046ardb.h | 6 ++++++ - 2 files changed, 20 insertions(+), 1 deletion(-) - -diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h -index 4fc2f94..53bd41b 100644 ---- a/include/configs/ls1046a_common.h -+++ b/include/configs/ls1046a_common.h -@@ -276,7 +276,20 @@ - "sd_bootcmd=echo Trying load from SD ..;" \ - "mmcinfo; mmc read $load_addr " \ - "$kernel_addr_sd $kernel_size_sd ;" \ -- " bootm $load_addr#$board\0" -+ " bootm $load_addr#$board\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock9 " \ -+ "rootfstype=ext4 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ -+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ -+ "16M(kernel),30M(ext4rfs),2M(user)\0" \ -+ "lede_run=sf probe 0:0 && " \ -+ "sf read $fdtaddr f00000 100000 && " \ -+ "sf read $loadaddr 1000000 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - - #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ -diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h -index f8c15a6..c3b50b1 100644 ---- a/include/configs/ls1046ardb.h -+++ b/include/configs/ls1046ardb.h -@@ -251,6 +251,12 @@ - "env exists secureboot && esbc_halt;" - #endif - -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run lede_boot" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \ - "15m(u-boot),48m(kernel.itb);" \ - "7e800000.flash:16m(nand_uboot)," \ --- -2.7.4 - diff --git a/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch deleted file mode 100644 index e8bbe7faa..000000000 --- a/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Thu, 28 Sep 2017 11:25:58 +0800 -Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls1012ardb.h | 21 ++++++++++++++++++++- - 1 file changed, 20 insertions(+), 1 deletion(-) - -diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h -index 5fe3218..242cdf0 100644 ---- a/include/configs/ls1012ardb.h -+++ b/include/configs/ls1012ardb.h -@@ -127,13 +127,32 @@ - "$kernel_addr $kernel_size; env exists secureboot " \ - "&& sf read $kernelheader_addr_r $kernelheader_addr " \ - "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ -- "bootm $load_addr#$board\0" -+ "bootm $load_addr#$board\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock8 " \ -+ "rootfstype=ext4 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ -+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ -+ "16M(kernel),30M(ext4rfs),2M(user)\0" \ -+ "lede_run=pfe stop && sf probe 0:0 && " \ -+ "sf read $fdtaddr f00000 100000 && " \ -+ "sf read $loadaddr 1000000 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - #undef CONFIG_BOOTCOMMAND - #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) - #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ - "env exists secureboot && esbc_halt;" - #endif -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run lede_boot" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - - #include - --- -2.7.4 - diff --git a/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch deleted file mode 100644 index eaf0da283..000000000 --- a/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 16 Oct 2017 11:57:36 +0800 -Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++- - 1 file changed, 26 insertions(+), 1 deletion(-) - -diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h -index 7bd152d..4cefa40 100644 ---- a/include/configs/ls1088ardb.h -+++ b/include/configs/ls1088ardb.h -@@ -404,7 +404,20 @@ - "env exists secureboot && mmc read $kernelheader_addr_r " \ - "$kernelhdr_addr_sd $kernelhdr_size_sd " \ - " && esbc_validate ${kernelheader_addr_r};" \ -- "bootm $load_addr#$BOARD\0" -+ "bootm $load_addr#$BOARD\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock10 " \ -+ "rootfstype=ext4 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ -+ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ -+ "16M(kernel),30M(ext4rfs),2M(user)\0" \ -+ "lede_run=sf probe 0:0 && " \ -+ "sf read $fdtaddr f00000 100000 && " \ -+ "sf read $loadaddr 1000000 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - #undef CONFIG_BOOTCOMMAND - #if defined(CONFIG_QSPI_BOOT) -@@ -429,6 +442,18 @@ - "run distro_bootcmd;run sd_bootcmd;" \ - "env exists secureboot && esbc_halt;" - #endif -+ -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND \ -+ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \ -+ "sf read 0x80300000 0xE00000 0x100000;" \ -+ "fsl_mc start mc 0x80000000 0x80300000;" \ -+ "sf read 0x80400000 0xd00000 0x100000;" \ -+ "fsl_mc apply dpl 0x80400000;" \ -+ "run lede_boot;" -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - /* MAC/PHY configuration */ - #ifdef CONFIG_FSL_MC_ENET - #define CONFIG_PHYLIB_10G --- -2.7.4 - diff --git a/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch deleted file mode 100644 index 6da256ab0..000000000 --- a/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Mon, 16 Oct 2017 12:37:05 +0800 -Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++- - 1 file changed, 22 insertions(+), 1 deletion(-) - -diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h -index 8a34990..8ae3944 100644 ---- a/include/configs/ls2080ardb.h -+++ b/include/configs/ls2080ardb.h -@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void); - "env exists secureboot && mmc read $kernelheader_addr_r " \ - "$kernelhdr_addr_sd $kernelhdr_size_sd " \ - " && esbc_validate ${kernelheader_addr_r};" \ -- "bootm $load_addr#$board\0" -+ "bootm $load_addr#$board\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock9 " \ -+ "rootfstype=squashfs,jffs2 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \ -+ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ -+ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ -+ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \ -+ "cp.b 581000000 $loadaddr 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - #undef CONFIG_BOOTCOMMAND - #ifdef CONFIG_QSPI_BOOT -@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void); - "env exists secureboot && esbc_halt;" - #endif - -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND \ -+ "fsl_mc start mc 0x580a00000 0x580e00000;" \ -+ "fsl_mc apply dpl 0x580d00000;" \ -+ "run lede_boot;" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - #undef CONFIG_BOOTARGS - #define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \ - "earlycon=uart8250,mmio,0x21c0600 " \ --- -2.7.4 - diff --git a/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch deleted file mode 100644 index 45010a210..000000000 --- a/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch +++ /dev/null @@ -1,49 +0,0 @@ -From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001 -From: Yangbo Lu -Date: Tue, 24 Oct 2017 17:48:08 +0800 -Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment - -Signed-off-by: Yangbo Lu ---- - include/configs/ls1012afrdm.h | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h -index a3f8824d27..36dff19bdd 100644 ---- a/include/configs/ls1012afrdm.h -+++ b/include/configs/ls1012afrdm.h -@@ -73,12 +73,31 @@ - "qspi_bootcmd=echo Trying load from qspi..;" \ - "sf probe && sf read $load_addr " \ - "$kernel_addr $kernel_size && bootm $load_addr#$board\0" \ -+ "lede_setenv=setenv loadaddr 82000000 && " \ -+ "setenv fdtaddr 8f000000 && " \ -+ "setenv bootargs root=/dev/mtdblock8 " \ -+ "rootfstype=ext4 noinitrd " \ -+ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ -+ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ -+ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ -+ "16M(kernel),30M(ext4rfs),2M(user)\0" \ -+ "lede_run=pfe stop && sf probe 0:0 && " \ -+ "sf read $fdtaddr f00000 100000 && " \ -+ "sf read $loadaddr 1000000 1000000 && " \ -+ "bootm $loadaddr - $fdtaddr\0" \ -+ "lede_boot=run lede_setenv;run lede_run\0" - - #undef CONFIG_BOOTCOMMAND - #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) - #define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd" - #endif - -+#undef CONFIG_BOOTCOMMAND -+#define CONFIG_BOOTCOMMAND "run lede_boot" -+ -+#undef CONFIG_BOOTDELAY -+#define CONFIG_BOOTDELAY 3 -+ - /* - * USB - */ --- -2.14.1 - diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index b29039cd8..024230946 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -8,33 +8,90 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2017.03 +PKG_NAME:=u-boot +PKG_VERSION:=2016.03 PKG_RELEASE:=1 -PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=\ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot +PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -UBOOT_MAKE_FLAGS:= - -define U-Boot/Default - BUILD_TARGET:=mvebu - HIDDEN:=1 +define uboot/Default + TITLE:= endef -define U-Boot/clearfog - NAME:=SolidRun ClearFog A1 - BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro - UBOOT_IMAGE:=u-boot-spl.kwb +define uboot/clearfog + TITLE:=U-Boot for SolidRun ClearFog A1 + DEVICE:=armada-388-clearfog endef -UBOOT_TARGETS:= \ +UBOOTS:= \ clearfog -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb +define Package/uboot/template +define Package/uboot-mvebu-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3)||TARGET_mvebu_Default) + DEFAULT:=m + HIDDEN:=1 + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Felix Fietkau +endef endef -$(eval $(call BuildPackage/U-Boot)) +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE),$(DEVICE)) +endef + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(BUILD_VARIANT)_config +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + DTC_DIR=$(LINUX_DIR)/scripts/dtc/ +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb + $(INSTALL_DIR) $(KERNEL_BUILD_DIR)/ + $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ + $(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb + $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ + $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ + $(BIN_DIR)/u-boot-kwboot/ +endef + +define Package/uboot/install/template +define Package/uboot-mvebu-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-mvebu-$(u))) \ +) diff --git a/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch b/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch deleted file mode 100644 index c34616292..000000000 --- a/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ee16ee20205ea374613c3ac7f50209451eb29068 Mon Sep 17 00:00:00 2001 -From: Josua Mayer -Date: Sun, 23 Apr 2017 18:02:40 +0200 -Subject: [PATCH 1/4] clearfog: generate random MAC address - -The Clearfog does not come with predetermined MACs. -Falling back to random ones ensures ethernet can still operate anyway. - -Signed-off-by: Josua Mayer >josua.mayer97@gmail.com> ---- - configs/clearfog_defconfig | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig -index 1264871e83..41e94e6daf 100644 ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -47,6 +47,7 @@ CONFIG_DEBUG_UART=y - CONFIG_DEBUG_UART_BASE=0xd0012000 - CONFIG_DEBUG_UART_CLOCK=250000000 - CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_NET_RANDOM_ETHADDR=y - CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_DM_USB=y --- -2.12.2 - diff --git a/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch b/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch deleted file mode 100644 index 97b2d1f25..000000000 --- a/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch +++ /dev/null @@ -1,97 +0,0 @@ -From 9653921eadd5d5268afbee6c928708158fc4e844 Mon Sep 17 00:00:00 2001 -From: Josua Mayer -Date: Tue, 22 Nov 2016 16:33:23 +0100 -Subject: [PATCH 3/4] clearfog: enable distro boot code - -load addresses start at 0x02000000, leaving enough space for fdt, -boot scripts and ramdisk at the end. -Only boot from mmc, the other options are not in working order. -Removed *_high variables in good faith. They can be re-added with sane -values when, and if required. - -Signed-off-by: Josua Mayer ---- - Kconfig | 1 + - include/configs/clearfog.h | 47 +++++++++++++++++++++++++++++++++++++++++----- - 2 files changed, 43 insertions(+), 5 deletions(-) - -diff --git a/Kconfig b/Kconfig -index 81b4226463..f7aec2255b 100644 ---- a/Kconfig -+++ b/Kconfig -@@ -59,6 +59,7 @@ config DISTRO_DEFAULTS - default y if ARCH_LS2080A - default y if ARCH_MESON - default y if ARCH_ROCKCHIP -+ default y if TARGET_CLEARFOG - default n - select CMD_BOOTZ if ARM && !ARM64 - select CMD_BOOTI if ARM64 -diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h -index 0c51d2a288..890dd84b5d 100644 ---- a/include/configs/clearfog.h -+++ b/include/configs/clearfog.h -@@ -79,11 +79,6 @@ - - #define CONFIG_SYS_ALT_MEMTEST - --/* Keep device tree and initrd in lower memory so the kernel can access them */ --#define CONFIG_EXTRA_ENV_SETTINGS \ -- "fdt_high=0x10000000\0" \ -- "initrd_high=0x10000000\0" -- - /* SPL */ - /* - * Select the boot device here -@@ -128,6 +123,48 @@ - #endif - #endif - -+#ifndef CONFIG_SPL_BUILD -+/* -+ * Add standard bootenv from distro boot code: -+ * Keep device tree and initrd in lower memory so the kernel can access them -+ * Set default load addresses: -+ * - 63MiB space for kernel -+ * - 1MiB space for fdt -+ * - 1MiB space for extlinux file, or boot script -+ * - remainder for ramdisk -+ * Keep device tree and initrd in lower memory so the kernel can access them -+ * Set name of fdt file (default to Clearfog Pro) -+ * specify console device -+ */ -+#define CONFIG_EXTRA_ENV_SETTINGS \ -+ "kernel_addr_r=0x02000000\0" \ -+ "fdt_addr_r=0x05f00000\0" \ -+ "pxefile_addr_r=0x06000000\0" \ -+ "scriptaddr=0x06000000\0" \ -+ "ramdisk_addr_r=0x06100000\0" \ -+ "fdt_high=0x10000000\0" \ -+ "initrd_high=0x10000000\0" \ -+ "fdtfile=armada-388-clearfog-pro.dtb\0" \ -+ "console=ttyS0," __stringify(CONFIG_BAUDRATE) "\0" \ -+ BOOTENV -+ -+/* include distro boot code defaults */ -+#include -+ -+/* -+ * specify boot order -+ * sdcard or emmc -> usb -> network -+ */ -+#define BOOT_TARGET_DEVICES(func) \ -+ func(MMC, mmc, 0) \ -+ func(USB, usb, 0) \ -+ func(PXE, pxe, na) \ -+ func(DHCP, dhcp, na) -+ -+/* include the actual distro boot code */ -+#include -+#endif -+ - /* - * mv-common.h should be defined after CMD configs since it used them - * to enable certain macros --- -2.12.2 - diff --git a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch deleted file mode 100644 index ca734660e..000000000 --- a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 7b53a0f5ddf0b1201a09c368b06cd5750d5fbe3a Mon Sep 17 00:00:00 2001 -From: Josua Mayer -Date: Sun, 23 Apr 2017 17:45:11 +0200 -Subject: [PATCH 4/4] clearfog: enable setexpr command by default - -Turns out this command is pretty useful in advanced boot-scripts. --> enable - -Signed-off-by: Josua Mayer ---- - configs/clearfog_defconfig | 1 + - 1 file changed, 1 insertion(+) - ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -23,7 +23,7 @@ CONFIG_CMD_SF=y - CONFIG_CMD_SPI=y - CONFIG_CMD_I2C=y - CONFIG_CMD_USB=y --# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_SETEXPR=y - CONFIG_CMD_TFTPPUT=y - CONFIG_CMD_DHCP=y - CONFIG_CMD_MII=y diff --git a/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch new file mode 100644 index 000000000..7e46084ad --- /dev/null +++ b/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump + AWK = awk + PERL = perl + PYTHON = python +-DTC = dtc ++DTC = $(DTC_DIR)dtc + CHECK = sparse + + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ diff --git a/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch deleted file mode 100644 index fbbfe462b..000000000 --- a/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 59be82ef7e7ec4be6e1597d8aef65dd3d8c3a0d9 Mon Sep 17 00:00:00 2001 -From: Jelle van der Waa -Date: Mon, 8 May 2017 21:31:19 +0200 -Subject: [PATCH 1/2] rsa: Fix build with OpenSSL 1.1.x - -The rsa_st struct has been made opaque in 1.1.x, add forward compatible -code to access the n, e, d members of rsa_struct. - -EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be -called to reinitialise an already created structure. ---- - lib/rsa/rsa-sign.c | 44 ++++++++++++++++++++++++++++++++++++++------ - 1 file changed, 38 insertions(+), 6 deletions(-) - ---- a/lib/rsa/rsa-sign.c -+++ b/lib/rsa/rsa-sign.c -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -20,6 +21,19 @@ - #define HAVE_ERR_REMOVE_THREAD_STATE - #endif - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+static void RSA_get0_key(const RSA *r, -+ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) -+{ -+ if (n != NULL) -+ *n = r->n; -+ if (e != NULL) -+ *e = r->e; -+ if (d != NULL) -+ *d = r->d; -+} -+#endif -+ - static int rsa_err(const char *msg) - { - unsigned long sslErr = ERR_get_error(); -@@ -286,16 +300,22 @@ static int rsa_init(void) - { - int ret; - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - ret = SSL_library_init(); -+#else -+ ret = OPENSSL_init_ssl(0, NULL); -+#endif - if (!ret) { - fprintf(stderr, "Failure to init SSL library\n"); - return -1; - } -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - SSL_load_error_strings(); - - OpenSSL_add_all_algorithms(); - OpenSSL_add_all_digests(); - OpenSSL_add_all_ciphers(); -+#endif - - return 0; - } -@@ -335,12 +355,15 @@ err_set_rsa: - err_engine_init: - ENGINE_free(e); - err_engine_by_id: -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - ENGINE_cleanup(); -+#endif - return ret; - } - - static void rsa_remove(void) - { -+#if OPENSSL_VERSION_NUMBER < 0x10100000L - CRYPTO_cleanup_all_ex_data(); - ERR_free_strings(); - #ifdef HAVE_ERR_REMOVE_THREAD_STATE -@@ -349,6 +372,7 @@ static void rsa_remove(void) - ERR_remove_state(0); - #endif - EVP_cleanup(); -+#endif - } - - static void rsa_engine_remove(ENGINE *e) -@@ -409,7 +433,11 @@ static int rsa_sign_with_key(RSA *rsa, s - ret = rsa_err("Could not obtain signature"); - goto err_sign; - } -- EVP_MD_CTX_cleanup(context); -+ #if OPENSSL_VERSION_NUMBER < 0x10100000L -+ EVP_MD_CTX_cleanup(context); -+ #else -+ EVP_MD_CTX_reset(context); -+ #endif - EVP_MD_CTX_destroy(context); - EVP_PKEY_free(key); - -@@ -479,6 +507,7 @@ static int rsa_get_exponent(RSA *key, ui - { - int ret; - BIGNUM *bn_te; -+ const BIGNUM *key_e; - uint64_t te; - - ret = -EINVAL; -@@ -487,17 +516,18 @@ static int rsa_get_exponent(RSA *key, ui - if (!e) - goto cleanup; - -- if (BN_num_bits(key->e) > 64) -+ RSA_get0_key(key, NULL, &key_e, NULL); -+ if (BN_num_bits(key_e) > 64) - goto cleanup; - -- *e = BN_get_word(key->e); -+ *e = BN_get_word(key_e); - -- if (BN_num_bits(key->e) < 33) { -+ if (BN_num_bits(key_e) < 33) { - ret = 0; - goto cleanup; - } - -- bn_te = BN_dup(key->e); -+ bn_te = BN_dup(key_e); - if (!bn_te) - goto cleanup; - -@@ -527,6 +557,7 @@ int rsa_get_params(RSA *key, uint64_t *e - { - BIGNUM *big1, *big2, *big32, *big2_32; - BIGNUM *n, *r, *r_squared, *tmp; -+ const BIGNUM *key_n; - BN_CTX *bn_ctx = BN_CTX_new(); - int ret = 0; - -@@ -548,7 +579,8 @@ int rsa_get_params(RSA *key, uint64_t *e - if (0 != rsa_get_exponent(key, exponent)) - ret = -1; - -- if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) || -+ RSA_get0_key(key, &key_n, NULL, NULL); -+ if (!BN_copy(n, key_n) || !BN_set_word(big1, 1L) || - !BN_set_word(big2, 2L) || !BN_set_word(big32, 32L)) - ret = -1; - diff --git a/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch deleted file mode 100644 index 882969905..000000000 --- a/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 65030804dc57f3488e4ffe21e72fc65cd245cb98 Mon Sep 17 00:00:00 2001 -From: Jelle van der Waa -Date: Mon, 8 May 2017 21:31:20 +0200 -Subject: [PATCH 2/2] tools: kwbimage fix build with OpenSSL 1.1.x - -The rsa_st struct has been made opaque in 1.1.x, add forward compatible -code to access the n, e, d members of rsa_struct. - -EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be -called to reinitialise an already created structure. - -Signed-off-by: Jelle van der Waa ---- - tools/kwbimage.c | 36 ++++++++++++++++++++++++++++++------ - 1 file changed, 30 insertions(+), 6 deletions(-) - ---- a/tools/kwbimage.c -+++ b/tools/kwbimage.c -@@ -18,10 +18,30 @@ - #include "kwbimage.h" - - #ifdef CONFIG_KWB_SECURE -+#include - #include - #include - #include - #include -+ -+#if OPENSSL_VERSION_NUMBER < 0x10100000L -+static void RSA_get0_key(const RSA *r, -+ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) -+{ -+ if (n != NULL) -+ *n = r->n; -+ if (e != NULL) -+ *e = r->e; -+ if (d != NULL) -+ *d = r->d; -+} -+ -+#else -+void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) -+{ -+ EVP_MD_CTX_reset(ctx); -+} -+#endif - #endif - - static struct image_cfg_element *image_cfg; -@@ -470,12 +490,16 @@ static int kwb_export_pubkey(RSA *key, s - char *keyname) - { - int size_exp, size_mod, size_seq; -+ const BIGNUM *key_e, *key_n; - uint8_t *cur; - char *errmsg = "Failed to encode %s\n"; - -- if (!key || !key->e || !key->n || !dst) { -+ RSA_get0_key(key, NULL, &key_e, NULL); -+ RSA_get0_key(key, &key_n, NULL, NULL); -+ -+ if (!key || !key_e || !key_n || !dst) { - fprintf(stderr, "export pk failed: (%p, %p, %p, %p)", -- key, key->e, key->n, dst); -+ key, key_e, key_n, dst); - fprintf(stderr, errmsg, keyname); - return -EINVAL; - } -@@ -490,8 +514,8 @@ static int kwb_export_pubkey(RSA *key, s - * do the encoding manually. - */ - -- size_exp = BN_num_bytes(key->e); -- size_mod = BN_num_bytes(key->n); -+ size_exp = BN_num_bytes(key_e); -+ size_mod = BN_num_bytes(key_n); - size_seq = 4 + size_mod + 4 + size_exp; - - if (size_mod > 256) { -@@ -520,14 +544,14 @@ static int kwb_export_pubkey(RSA *key, s - *cur++ = 0x82; - *cur++ = (size_mod >> 8) & 0xFF; - *cur++ = size_mod & 0xFF; -- BN_bn2bin(key->n, cur); -+ BN_bn2bin(key_n, cur); - cur += size_mod; - /* Exponent */ - *cur++ = 0x02; /* INTEGER */ - *cur++ = 0x82; - *cur++ = (size_exp >> 8) & 0xFF; - *cur++ = size_exp & 0xFF; -- BN_bn2bin(key->e, cur); -+ BN_bn2bin(key_e, cur); - - if (hashf) { - struct hash_v1 pk_hash; diff --git a/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch new file mode 100644 index 000000000..2dd9f2828 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch @@ -0,0 +1,10 @@ +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y + CONFIG_DEBUG_UART_BASE=0xd0012000 + CONFIG_DEBUG_UART_CLOCK=250000000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_NET_RANDOM_ETHADDR=y + CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_DM_USB=y diff --git a/package/boot/uboot-mvebu/patches/003-boot_script.patch b/package/boot/uboot-mvebu/patches/003-boot_script.patch new file mode 100644 index 000000000..2e156b7c8 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/003-boot_script.patch @@ -0,0 +1,32 @@ +--- a/include/configs/clearfog.h ++++ b/include/configs/clearfog.h +@@ -107,7 +107,18 @@ + /* Keep device tree and initrd in lower memory so the kernel can access them */ + #define CONFIG_EXTRA_ENV_SETTINGS \ + "fdt_high=0x10000000\0" \ +- "initrd_high=0x10000000\0" ++ "initrd_high=0x10000000\0" \ ++ "script=boot.scr\0" \ ++ "loadaddr=0x01000000\0" \ ++ "mmcdev=0\0" \ ++ "mmcpart=1\0" \ ++ "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ ++ "bootscript=echo Running bootscript from mmc ...; source ${loadaddr}\0" ++ ++#define CONFIG_BOOTCOMMAND \ ++ "if run loadbootscript; then " \ ++ "run bootscript; " \ ++ "fi" + + /* SPL */ + /* +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y + CONFIG_SYS_MALLOC_F_LEN=0x2000 + CONFIG_TARGET_CLEARFOG=y + CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog" ++CONFIG_HUSH_PARSER=y + CONFIG_SPL=y + # CONFIG_CMD_IMLS is not set + # CONFIG_CMD_FLASH is not set diff --git a/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch b/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch similarity index 81% rename from package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch rename to package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch index 164c6f3f2..3c470409e 100644 --- a/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch +++ b/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch @@ -1,7 +1,7 @@ -From 98848106b9558244ae36a85229caabcdb57d0f7b Mon Sep 17 00:00:00 2001 +From 15d52c4067b8d8a1d7a002aec41c5e6c0a8678cd Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Fri, 23 Sep 2016 13:58:14 +0200 -Subject: [PATCH 2/4] clearfog: reset usom onboard 1512 phy +Subject: [PATCH] clearfog: reset usom onboard 1512 phy Use GPIO19 which is wired to the uSOM phy reset signal in order to reset the uSOM's 88E81512 gigabit Ethernet phy. @@ -15,8 +15,6 @@ Signed-off-by: Jonas Gorski board/solidrun/clearfog/clearfog.c | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c -index 2773f5957e..3a8257cac3 100644 --- a/board/solidrun/clearfog/clearfog.c +++ b/board/solidrun/clearfog/clearfog.c @@ -131,8 +131,12 @@ int board_init(void) @@ -32,6 +30,3 @@ index 2773f5957e..3a8257cac3 100644 mdelay(10); /* Init I2C IO expanders */ --- -2.12.2 - diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile index 92cf9e6b2..d00940c54 100644 --- a/package/boot/uboot-mxs/Makefile +++ b/package/boot/uboot-mxs/Makefile @@ -6,40 +6,91 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk +PKG_NAME:=u-boot PKG_VERSION:=2016.01 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e5792fba9399d9804aa2ef667f14ff771e2cdece72367d340250265bf095a5d5 -include $(INCLUDE_DIR)/u-boot.mk +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=mxs - UBOOT_IMAGE:=u-boot.sb - DEFAULT:=y - HIDDEN:=1 +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/mx23_olinuxino - NAME:=Olinuxino i.MX233 +define uboot/mx23_olinuxino + TITLE:=U-Boot 2016.01 for the Olinuxino i.MX233 endef -define U-Boot/duckbill - NAME:=I2SE Duckbill +define uboot/duckbill + TITLE:=U-Boot 2016.01 for the I2SE Duckbill endef -UBOOT_TARGETS := \ +UBOOTS := \ mx23_olinuxino \ duckbill -UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) +define Package/uboot/template +define Package/uboot-mxs-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_mxs + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Zoltan HERPAI +endef endef -$(eval $(call BuildPackage/U-Boot)) +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb) +endif + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb +endef + +define Package/uboot/install/template +define Package/uboot-mxs-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-mxs-$(u))) \ +) diff --git a/package/boot/uboot-omap/Makefile b/package/boot/uboot-omap/Makefile index 9084f3740..547c6534c 100644 --- a/package/boot/uboot-omap/Makefile +++ b/package/boot/uboot-omap/Makefile @@ -6,52 +6,98 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2017.01 +PKG_NAME:=u-boot +PKG_VERSION:=2015.10 PKG_RELEASE:=1 -PKG_HASH:=6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot +PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=omap - UBOOT_IMAGE:=u-boot.img MLO - UENV:=default +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/omap4_panda - NAME:=Pandaboard - BUILD_DEVICES:=omap4-panda +define uboot/omap4_panda + TITLE:=U-Boot for the Pandaboard endef -define U-Boot/am335x_boneblack - NAME:=TI AM335x BeagleBone Black - BUILD_DEVICES:=am335x-boneblack +define uboot/am335x_evm + TITLE:=U-Boot for the AM335x EVM endef -define U-Boot/am335x_evm - NAME:=AM335x EVM - BUILD_DEVICES:=am335x-evm +define uboot/omap3_overo + TITLE:=U-Boot for the Gumstix Overo endef -define U-Boot/omap3_overo - NAME:=Gumstix Overo +define uboot/omap3_beagle + TITLE:=U-Boot for the BeagleBoard endef -define U-Boot/omap3_beagle - NAME:=BeagleBoard - BUILD_DEVICES:=omap3-beagle +UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle + +define Package/uboot/template +define Package/uboot-omap-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_omap + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + HIDDEN:=1 +endef endef -UBOOT_TARGETS:=omap4_panda am335x_evm omap3_overo omap3_beagle am335x_boneblack - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES) - $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/ - $(CP) ./files/uEnv-$(UENV).txt $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/uEnv.txt +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) endef -$(eval $(call BuildPackage/U-Boot)) +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img) +endif + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img + $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO +endef + +define Package/uboot/install/template +define Package/uboot-omap-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-omap-$(u))) \ +) diff --git a/package/boot/uboot-omap/files/uEnv-default.txt b/package/boot/uboot-omap/files/uEnv-default.txt deleted file mode 100644 index 3584e4379..000000000 --- a/package/boot/uboot-omap/files/uEnv-default.txt +++ /dev/null @@ -1,8 +0,0 @@ -bootpart=0:1 -bootdir=/ -bootfile=zImage -fdtdir=/dtbs -uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr} -loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile} -devtype=mmc -uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 diff --git a/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch b/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch new file mode 100644 index 000000000..b8e65b500 --- /dev/null +++ b/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch @@ -0,0 +1,33 @@ +From c139b5ff0999ec3d44a02ebdb623a92e5782e53e Mon Sep 17 00:00:00 2001 +From: Tom Rini +Date: Tue, 27 Oct 2015 19:04:40 -0400 +Subject: [PATCH] image.c: Fix non-Android booting with ramdisk and/or device + tree + +In 1fec3c5 I added a check that if we had an Android image we default to +trying the kernel address for a ramdisk. However when we don't have an +Android image buf is NULL and we oops here. Ensure that we have 'buf' +to check first. + +Reported-by: elipe Balbi +Signed-off-by: Tom Rini +--- + common/image.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/common/image.c b/common/image.c +index e607109..85c4f39 100644 +--- a/common/image.c ++++ b/common/image.c +@@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, + * Look for an Android boot image. + */ + buf = map_sysmem(images->os.start, 0); +- if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) ++ if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) + select = argv[0]; + #endif + +-- +1.7.10.4 + diff --git a/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch b/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch new file mode 100644 index 000000000..7b7bfa8fb --- /dev/null +++ b/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch @@ -0,0 +1,11 @@ +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -233,8 +233,6 @@ + #define CONFIG_SPL_EXT_SUPPORT + #endif + +-#define CONFIG_SYS_THUMB_BUILD +- + /* General parts of the framework, required. */ + #define CONFIG_SPL_I2C_SUPPORT + #define CONFIG_SPL_LIBCOMMON_SUPPORT diff --git a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch deleted file mode 100644 index 8a3b024fe..000000000 --- a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch +++ /dev/null @@ -1,14 +0,0 @@ -Index: u-boot-2017.01/include/configs/ti_omap3_common.h -=================================================================== ---- u-boot-2017.01.orig/include/configs/ti_omap3_common.h -+++ u-boot-2017.01/include/configs/ti_omap3_common.h -@@ -80,4 +80,9 @@ - /* Now bring in the rest of the common code. */ - #include - -+/* beagleboard doesnt boot with thumb */ -+#ifdef CONFIG_SYS_THUMB_BUILD -+#undef CONFIG_SYS_THUMB_BUILD -+#endif -+ - #endif /* __CONFIG_TI_OMAP3_COMMON_H__ */ diff --git a/package/boot/uboot-omap/patches/101-disable_ext.patch b/package/boot/uboot-omap/patches/101-disable_ext.patch new file mode 100644 index 000000000..9e0e47caf --- /dev/null +++ b/package/boot/uboot-omap/patches/101-disable_ext.patch @@ -0,0 +1,10 @@ +--- a/include/configs/ti_armv7_common.h ++++ b/include/configs/ti_armv7_common.h +@@ -230,7 +230,6 @@ + #define CONFIG_SPL_LIBDISK_SUPPORT + #define CONFIG_SPL_MMC_SUPPORT + #define CONFIG_SPL_FAT_SUPPORT +-#define CONFIG_SPL_EXT_SUPPORT + #endif + + /* General parts of the framework, required. */ diff --git a/package/boot/uboot-omap/patches/102-minify-spl.patch b/package/boot/uboot-omap/patches/102-minify-spl.patch deleted file mode 100644 index 66f6b6b59..000000000 --- a/package/boot/uboot-omap/patches/102-minify-spl.patch +++ /dev/null @@ -1,44 +0,0 @@ -Index: u-boot-2017.01/configs/omap3_beagle_defconfig -=================================================================== ---- u-boot-2017.01.orig/configs/omap3_beagle_defconfig -+++ u-boot-2017.01/configs/omap3_beagle_defconfig -@@ -7,7 +7,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y - CONFIG_VERSION_VARIABLE=y - CONFIG_SPL=y - CONFIG_SPL_MTD_SUPPORT=y --CONFIG_SPL_OS_BOOT=y -+# CONFIG_SPL_EXT_SUPPORT is not set - # CONFIG_CMD_IMLS is not set - CONFIG_CMD_ASKENV=y - # CONFIG_CMD_FLASH is not set -Index: u-boot-2017.01/common/Makefile -=================================================================== ---- u-boot-2017.01.orig/common/Makefile -+++ u-boot-2017.01/common/Makefile -@@ -174,8 +174,11 @@ obj-$(CONFIG_CMDLINE) += cli_simple.o - obj-y += cli.o - obj-$(CONFIG_CMDLINE) += cli_readline.o - obj-$(CONFIG_CMD_DFU) += dfu.o -+ -+ifndef CONFIG_SPL_BUILD - obj-y += command.o - obj-y += s_record.o - obj-y += xyzModem.o -+endif - - CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) -Index: u-boot-2017.01/cmd/Makefile -=================================================================== ---- u-boot-2017.01.orig/cmd/Makefile -+++ u-boot-2017.01/cmd/Makefile -@@ -161,7 +161,10 @@ endif # !CONFIG_SPL_BUILD - - obj-$(CONFIG_CMD_BLOB) += blob.o - -+ -+# ifndef CONFIG_SPL_BUILD - # core command - obj-y += nvedit.o -+# endif # !CONFIG_SPL_BUILD - - obj-$(CONFIG_ARCH_MVEBU) += mvebu/ diff --git a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch deleted file mode 100644 index 89b02044d..000000000 --- a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch +++ /dev/null @@ -1,27 +0,0 @@ -Index: u-boot-2017.01/fs/fat/Makefile -=================================================================== ---- u-boot-2017.01.orig/fs/fat/Makefile -+++ u-boot-2017.01/fs/fat/Makefile -@@ -4,8 +4,8 @@ - # - - obj-$(CONFIG_FS_FAT) := fat.o --obj-$(CONFIG_FAT_WRITE):= fat_write.o - - ifndef CONFIG_SPL_BUILD -+obj-$(CONFIG_FAT_WRITE):= fat_write.o - obj-$(CONFIG_FS_FAT) += file.o - endif -Index: u-boot-2017.01/fs/fat/fat.c -=================================================================== ---- u-boot-2017.01.orig/fs/fat/fat.c -+++ u-boot-2017.01/fs/fat/fat.c -@@ -163,7 +163,7 @@ static void get_name(dir_entry *dirent, - } - - static int flush_dirty_fat_buffer(fsdata *mydata); --#if !defined(CONFIG_FAT_WRITE) -+#if !defined(CONFIG_FAT_WRITE) || defined(CONFIG_SPL_BUILD) - /* Stub for read only operation */ - int flush_dirty_fat_buffer(fsdata *mydata) - { diff --git a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch deleted file mode 100644 index ca928c996..000000000 --- a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: u-boot-2017.01/include/configs/omap3_overo.h -=================================================================== ---- u-boot-2017.01.orig/include/configs/omap3_overo.h -+++ u-boot-2017.01/include/configs/omap3_overo.h -@@ -11,6 +11,13 @@ - #define CONFIG_NAND - - #include -+ -+/* try to enable thumb - unknown if it's working -+ * but otherwise it's too big for spl */ -+#ifndef CONFIG_SYS_THUMB_BUILD -+#define CONFIG_SYS_THUMB_BUILD -+#endif -+ - /* - * We are only ever GP parts and will utilize all of the "downloaded image" - * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB). diff --git a/package/boot/uboot-oxnas/Makefile b/package/boot/uboot-oxnas/Makefile index daa266ea8..d76af0ac1 100644 --- a/package/boot/uboot-oxnas/Makefile +++ b/package/boot/uboot-oxnas/Makefile @@ -8,29 +8,95 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk +PKG_NAME:=u-boot PKG_VERSION:=2014.10 PKG_RELEASE:=1 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot + PKG_HASH:=d3b132a7a9b3f3182b7aad71c2dfbd4fc15bea83e12c76134eb3ffefc07d1c71 -include $(INCLUDE_DIR)/u-boot.mk +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=oxnas - BUILD_DEVICES:=Default - HIDDEN:=y +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/ox820 - NAME:=Oxford/PLX NAS7820 +define uboot/ox820 + TITLE:=U-Boot for the Oxford/PLX NAS7820 endef -UBOOT_TARGETS:=ox820 +UBOOTS:=ox820 -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(STAGING_DIR_IMAGE)/u-boot.bin +define Package/uboot/template +define Package/uboot-oxnas-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_oxnas + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Daniel Golle +endef endef -$(eval $(call BuildPackage/U-Boot)) +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) ./files/* $(PKG_BUILD_DIR) + find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf +endef + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + u-boot.bin \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ + $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ + $(KERNEL_BUILD_DIR)/u-boot.bin +endef + +define Package/uboot/install/template +define Package/uboot-oxnas-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-oxnas-$(u))) \ +) diff --git a/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile b/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile rename to package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile diff --git a/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c b/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c rename to package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c diff --git a/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c b/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c rename to package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c diff --git a/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c b/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c rename to package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c diff --git a/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c b/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c rename to package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h diff --git a/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h b/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h similarity index 100% rename from package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h rename to package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h diff --git a/package/boot/uboot-oxnas/src/board/ox820/Kconfig b/package/boot/uboot-oxnas/files/board/ox820/Kconfig similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/Kconfig rename to package/boot/uboot-oxnas/files/board/ox820/Kconfig diff --git a/package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS b/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS rename to package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS diff --git a/package/boot/uboot-oxnas/src/board/ox820/Makefile b/package/boot/uboot-oxnas/files/board/ox820/Makefile similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/Makefile rename to package/boot/uboot-oxnas/files/board/ox820/Makefile diff --git a/package/boot/uboot-oxnas/src/board/ox820/ddr.c b/package/boot/uboot-oxnas/files/board/ox820/ddr.c similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/ddr.c rename to package/boot/uboot-oxnas/files/board/ox820/ddr.c diff --git a/package/boot/uboot-oxnas/src/board/ox820/ddr.h b/package/boot/uboot-oxnas/files/board/ox820/ddr.h similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/ddr.h rename to package/boot/uboot-oxnas/files/board/ox820/ddr.h diff --git a/package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S b/package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S rename to package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S diff --git a/package/boot/uboot-oxnas/src/board/ox820/ox820.c b/package/boot/uboot-oxnas/files/board/ox820/ox820.c similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/ox820.c rename to package/boot/uboot-oxnas/files/board/ox820/ox820.c diff --git a/package/boot/uboot-oxnas/src/board/ox820/spl_start.S b/package/boot/uboot-oxnas/files/board/ox820/spl_start.S similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/spl_start.S rename to package/boot/uboot-oxnas/files/board/ox820/spl_start.S diff --git a/package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds b/package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds similarity index 100% rename from package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds rename to package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds diff --git a/package/boot/uboot-oxnas/src/common/env_ext4.c b/package/boot/uboot-oxnas/files/common/env_ext4.c similarity index 100% rename from package/boot/uboot-oxnas/src/common/env_ext4.c rename to package/boot/uboot-oxnas/files/common/env_ext4.c diff --git a/package/boot/uboot-oxnas/src/common/spl/spl_block.c b/package/boot/uboot-oxnas/files/common/spl/spl_block.c similarity index 100% rename from package/boot/uboot-oxnas/src/common/spl/spl_block.c rename to package/boot/uboot-oxnas/files/common/spl/spl_block.c diff --git a/package/boot/uboot-oxnas/src/configs/ox820_defconfig b/package/boot/uboot-oxnas/files/configs/ox820_defconfig similarity index 100% rename from package/boot/uboot-oxnas/src/configs/ox820_defconfig rename to package/boot/uboot-oxnas/files/configs/ox820_defconfig diff --git a/package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c b/package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c similarity index 100% rename from package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c rename to package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c diff --git a/package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c b/package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c similarity index 100% rename from package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c rename to package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c diff --git a/package/boot/uboot-oxnas/src/include/configs/ox820.h b/package/boot/uboot-oxnas/files/include/configs/ox820.h similarity index 100% rename from package/boot/uboot-oxnas/src/include/configs/ox820.h rename to package/boot/uboot-oxnas/files/include/configs/ox820.h diff --git a/package/boot/uboot-oxnas/src/tools/mkox820crc.c b/package/boot/uboot-oxnas/files/tools/mkox820crc.c similarity index 100% rename from package/boot/uboot-oxnas/src/tools/mkox820crc.c rename to package/boot/uboot-oxnas/files/tools/mkox820crc.c diff --git a/package/boot/uboot-pxa/Makefile b/package/boot/uboot-pxa/Makefile new file mode 100644 index 000000000..9c12ad7ed --- /dev/null +++ b/package/boot/uboot-pxa/Makefile @@ -0,0 +1,91 @@ +# +# Copyright (C) 2012 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=u-boot +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git +PKG_SOURCE_DATE:=2011-08-25 +PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7 +PKG_MIRROR_HASH:=7c92525b6c7bc0b6f065a9bfdf64d58a61583709cb44acb62a157ad3efc7c491 + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +include $(INCLUDE_DIR)/package.mk + +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= +endef + +define uboot/gumstix + TITLE:=U-Boot for the Gumstix Verdex +endef + +UBOOTS:=gumstix + +define Package/uboot/template +define Package/uboot-pxa-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_pxa + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Florian Fainelli +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Configure + $(MAKE) -C $(PKG_BUILD_DIR) \ + $(UBOOT_CONFIG)_config +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + u-boot.bin \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ + $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin +endef + +define Package/uboot/install/template +define Package/uboot-pxa-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-pxa-$(u))) \ +) diff --git a/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch b/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch new file mode 100644 index 000000000..cfef66b8f --- /dev/null +++ b/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch @@ -0,0 +1,13 @@ +diff --git a/include/configs/gumstix.h b/include/configs/gumstix.h +index 319da63..5483993 100644 +--- a/include/configs/gumstix.h ++++ b/include/configs/gumstix.h +@@ -136,7 +136,7 @@ + #define CONFIG_MISC_INIT_R /* misc_init_r function in gumstix sets board serial number */ + + #define CONFIG_BOOTFILE boot/uImage +-#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard" ++#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=squashfs,jffs2 reboot=cold,hard" + #define CONFIG_BOOTCOMMAND "icache on; setenv stderr nulldev; setenv stdout nulldev; if pinit on && fatload ide 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on CF...; autoscr; else if mmcinit && fatload mmc 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on MMC...; autoscr; else setenv stdout serial; setenv stderr serial; katload 100000 && bootm; fi; fi" + #define CONFIG_BOOTDELAY 2 /* in seconds */ + #define CONFIG_EXTRA_ENV_SETTINGS "verify=no" diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index 056300e18..bc80dcfad 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,217 +9,90 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2017.07 - -PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff - +PKG_NAME:=u-boot +PKG_VERSION:=2016.03 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot +PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb PKG_MAINTAINER:=Zoltan HERPAI +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + +PKG_BUILD_PARALLEL:=1 + +PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=sunxi - UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin - UENV:=default - HIDDEN:=1 +define Package/uboot/template +define Package/uboot-sunxi-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_sunxi + TITLE:=U-Boot for $(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) endef -define U-Boot/A10-OLinuXino-Lime - BUILD_SUBTARGET:=cortexa8 - NAME:=A10 OLinuXino LIME - BUILD_DEVICES:=sun4i-a10-olinuxino-lime +define Package/uboot-sunxi-$(1)/install + $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \ + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin + mkimage -C none -A arm -T script -d uEnv-$(if $(3),$(3),default).txt \ + $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr endef -define U-Boot/A13-OLinuXino - BUILD_SUBTARGET:=cortexa8 - NAME:=A13 OlinuXino - BUILD_DEVICES:=sun5i-a13-olinuxino +UBOOT_SUNXI_PACKAGES += uboot-sunxi-$(1) + endef -define U-Boot/A20-OLinuXino-Lime - BUILD_SUBTARGET:=cortexa7 - NAME:=A20 OLinuXino LIME - BUILD_DEVICES:=sun7i-a20-olinuxino-lime +$(eval $(call Package/uboot/template,A10-OLinuXino-Lime,the A10 OLinuXino LIME)) +$(eval $(call Package/uboot/template,A13-OLinuXino,the A13 OlinuXino)) +$(eval $(call Package/uboot/template,A20-OLinuXino-Lime,the A20 OLinuXino LIME)) +$(eval $(call Package/uboot/template,A20-OLinuXino_MICRO,A20 OLinuXino MICRO)) +$(eval $(call Package/uboot/template,Bananapi,Bananapi)) +$(eval $(call Package/uboot/template,Bananapro,Bananapro)) +$(eval $(call Package/uboot/template,Cubieboard,Cubieboard)) +$(eval $(call Package/uboot/template,Cubieboard2,Cubieboard2)) +$(eval $(call Package/uboot/template,Cubietruck,Cubietruck)) +$(eval $(call Package/uboot/template,Hummingbird_A31,the Hummingbird A31 board)) +$(eval $(call Package/uboot/template,Mele_M9,the Mele M9 (A31))) +$(eval $(call Package/uboot/template,OLIMEX_A13_SOM,the Olimex A13 SOM)) +$(eval $(call Package/uboot/template,Linksprite_pcDuino,Linksprite pcDuino)) +$(eval $(call Package/uboot/template,Linksprite_pcDuino3,Linksprite pcDuino3)) +$(eval $(call Package/uboot/template,Lamobo_R1,Lamobo R1)) +$(eval $(call Package/uboot/template,orangepi_plus,Orange Pi Plus (H3))) +$(eval $(call Package/uboot/template,pangolin,Theobroma A31-yQ7 devboard,pangolin)) + +define Package/uboot-sunxi-all + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_sunxi + TITLE:=Meta package for selecting all variants of uboot-sunxi + URL:=http://www.denx.de/wiki/U-Boot + DEPENDS:=$(patsubst %,+%,$(UBOOT_SUNXI_PACKAGES)) endef -define U-Boot/A20-OLinuXino-Lime2 - BUILD_SUBTARGET:=cortexa7 - NAME:=A20 OLinuXino LIME2 - BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 +ifdef BUILD_VARIANT +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + USE_PRIVATE_LIBGCC=yes $(BUILD_VARIANT)_defconfig endef -define U-Boot/A20-OLinuXino-Lime2-eMMC - BUILD_SUBTARGET:=cortexa7 - NAME:=A20 OLinuXino LIME2 eMMC - BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + DTCDIR=$(LINUX_DIR)/scripts/dtc/ endef - -define U-Boot/A20-OLinuXino_MICRO - BUILD_SUBTARGET:=cortexa7 - NAME:=A20 OLinuXino MICRO - BUILD_DEVICES:=sun7i-a20-olinuxino-micro +else # BUILD_VARIANT +define Build/Prepare endef - -define U-Boot/Bananapi - BUILD_SUBTARGET:=cortexa7 - NAME:=Bananapi - BUILD_DEVICES:=sun7i-a20-bananapi +define Build/Configure endef - -define U-Boot/Bananapro - BUILD_SUBTARGET:=cortexa7 - NAME:=Bananapro - BUILD_DEVICES:=sun7i-a20-bananapro +define Build/Compile endef +endif # BUILD_VARIANT -define U-Boot/Cubieboard - BUILD_SUBTARGET:=cortexa8 - NAME:=Cubieboard - BUILD_DEVICES:=sun4i-a10-cubieboard -endef - -define U-Boot/Cubieboard2 - BUILD_SUBTARGET:=cortexa7 - NAME:=Cubieboard2 - BUILD_DEVICES:=sun7i-a20-cubieboard2 -endef - -define U-Boot/Cubietruck - BUILD_SUBTARGET:=cortexa7 - NAME:=Cubietruck - BUILD_DEVICES:=sun7i-a20-cubietruck -endef - -define U-Boot/Hummingbird_A31 - BUILD_SUBTARGET:=cortexa7 - NAME:=Hummingbird A31 board -endef - -define U-Boot/Marsboard_A10 - BUILD_SUBTARGET:=cortexa8 - NAME:=Marsboard - BUILD_DEVICES:=sun4i-a10-marsboard -endef - -define U-Boot/Mele_M9 - BUILD_SUBTARGET:=cortexa7 - NAME:=Mele M9 (A31) - BUILD_DEVICES:=sun6i-a31-m9 -endef - -define U-Boot/OLIMEX_A13_SOM - BUILD_SUBTARGET:=cortexa8 - NAME:=Olimex A13 SOM - BUILD_DEVICES:=sun5i-a13-olimex-som -endef - -define U-Boot/Linksprite_pcDuino - BUILD_SUBTARGET:=cortexa8 - NAME:=Linksprite pcDuino - BUILD_DEVICES:=sun4i-a10-pcduino -endef - -define U-Boot/Linksprite_pcDuino3 - BUILD_SUBTARGET:=cortexa7 - NAME:=Linksprite pcDuino3 - BUILD_DEVICES:=sun7i-a20-pcduino3 -endef - -define U-Boot/Lamobo_R1 - BUILD_SUBTARGET:=cortexa7 - NAME:=Lamobo R1 - BUILD_DEVICES:=sun7i-a20-lamobo-r1 -endef - -define U-Boot/nanopi_m1_plus - BUILD_SUBTARGET:=cortexa7 - NAME:=NanoPi M1 Plus (H3) - BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus -endef - -define U-Boot/nanopi_neo - BUILD_SUBTARGET:=cortexa7 - NAME:=U-Boot for NanoPi NEO (H3) - BUILD_DEVICES:=sun8i-h3-nanopi-neo -endef - -define U-Boot/orangepi_r1 - BUILD_SUBTARGET:=cortexa7 - NAME:=Orange Pi R1 (H2+) - BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1 -endef - -define U-Boot/orangepi_plus - BUILD_SUBTARGET:=cortexa7 - NAME:=Orange Pi Plus (H3) - BUILD_DEVICES:=sun8i-h3-orangepi-plus -endef - -define U-Boot/orangepi_2 - BUILD_SUBTARGET:=cortexa7 - NAME:=Orange Pi 2 (H3) - BUILD_DEVICES:=sun8i-h3-orangepi-2 -endef - -define U-Boot/pangolin - BUILD_SUBTARGET:=cortexa7 - NAME:=Theobroma A31-yQ7 devboard - UENV:=pangolin -endef - -define U-Boot/pine64_plus - BUILD_SUBTARGET:=cortexa53 - NAME:=Pine64 Plus A64 - BUILD_DEVICES:=sun50i-a64-pine64-plus - DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi - UENV:=a64 -endef - -UBOOT_TARGETS := \ - A10-OLinuXino-Lime \ - A13-OLinuXino \ - A20-OLinuXino-Lime \ - A20-OLinuXino-Lime2 \ - A20-OLinuXino-Lime2-eMMC \ - A20-OLinuXino_MICRO \ - Bananapi \ - Bananapro \ - Cubieboard \ - Cubieboard2 \ - Cubietruck \ - Hummingbird_A31 \ - Marsboard_A10 \ - Mele_M9 \ - OLIMEX_A13_SOM \ - Linksprite_pcDuino \ - Linksprite_pcDuino3 \ - Lamobo_R1 \ - nanopi_m1_plus \ - nanopi_neo \ - orangepi_r1 \ - orangepi_plus \ - orangepi_2 \ - pangolin \ - pine64_plus - -UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes - -UBOOT_MAKE_FLAGS += \ - BL31=$(STAGING_DIR_IMAGE)/bl31.bin - -define Build/InstallDev - $(INSTALL_DIR) $(STAGING_DIR_IMAGE) -ifeq ($(SUBTARGET),cortexa53) - cat $(PKG_BUILD_DIR)/spl/sunxi-spl.bin $(PKG_BUILD_DIR)/u-boot.itb > $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin -else - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin -endif - mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ - $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr -endef - -define Package/u-boot/install/default -endef - -$(eval $(call BuildPackage/U-Boot)) +$(foreach pkg,$(UBOOT_SUNXI_PACKAGES), \ + $(eval $(call BuildPackage,$(pkg))) \ +) +$(eval $(call BuildPackage,uboot-sunxi-all)) diff --git a/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch new file mode 100644 index 000000000..6471e7865 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump + AWK = awk + PERL = perl + PYTHON = python +-DTC = dtc ++DTC = $(DTCDIR)dtc + CHECK = sparse + + CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ diff --git a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch index c19f3781d..f29ad12b7 100644 --- a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch +++ b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch @@ -1,7 +1,8 @@ --- /dev/null +++ b/configs/OLIMEX_A13_SOM_defconfig -@@ -0,0 +1,17 @@ +@@ -0,0 +1,18 @@ +CONFIG_SPL=y ++CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2" +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y diff --git a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch index 2fce04828..e5a66d7eb 100644 --- a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch +++ b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch @@ -1,16 +1,16 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ +@@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-m9.dtb \ sun6i-a31-mele-a1000g-quad.dtb \ sun6i-a31-mixtile-loftq.dtb \ + sun6i-a31-pangolin.dtb \ - sun6i-a31s-colorfly-e708-q1.dtb \ sun6i-a31s-cs908.dtb \ - sun6i-a31s-inet-q972.dtb \ + sun6i-a31s-primo81.dtb \ + sun6i-a31s-sinovoip-bpi-m2.dtb --- a/arch/arm/dts/sun6i-a31.dtsi +++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -679,6 +679,13 @@ +@@ -643,6 +643,13 @@ allwinner,pull = ; }; @@ -358,9 +358,17 @@ +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SUNXI_SPI=y ---- a/arch/arm/mach-sunxi/Kconfig -+++ b/arch/arm/mach-sunxi/Kconfig -@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL +--- a/board/sunxi/Kconfig ++++ b/board/sunxi/Kconfig +@@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I + separate ahb reset control registers, custom pmic bus, new style + watchdog, etc. + +- + choice + prompt "Sunxi SoC Variant" + optional +@@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL Set the SCL pin for the LCD i2c interface. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. diff --git a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch new file mode 100644 index 000000000..d8fa52c7e --- /dev/null +++ b/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch @@ -0,0 +1,1403 @@ +From 4bb656e9dde2019cb42ac4c27b3a114a801ad127 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 16 Mar 2016 13:41:23 +0100 +Subject: [PATCH] include/dt-bindings: Sync some files with the kernel + +This commit syncs the dt-bindings/input/* headers with the kernel (v4.5) +and adds dt-bindings/clock/sun4i-a10-pll2.h, both are necessary for newer +sunxi dts files to build. + +Signed-off-by: Hans de Goede +Reviewed-by: Tom Rini +Acked-by: Ian Campbell +--- + include/dt-bindings/clock/sun4i-a10-pll2.h | 53 ++ + include/dt-bindings/input/input.h | 510 +--------------- + include/dt-bindings/input/linux-event-codes.h | 805 ++++++++++++++++++++++++++ + 3 files changed, 859 insertions(+), 509 deletions(-) + create mode 100644 include/dt-bindings/clock/sun4i-a10-pll2.h + create mode 100644 include/dt-bindings/input/linux-event-codes.h + +--- /dev/null ++++ b/include/dt-bindings/clock/sun4i-a10-pll2.h +@@ -0,0 +1,53 @@ ++/* ++ * Copyright 2015 Maxime Ripard ++ * ++ * Maxime Ripard ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#ifndef __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ ++#define __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ ++ ++#define SUN4I_A10_PLL2_1X 0 ++#define SUN4I_A10_PLL2_2X 1 ++#define SUN4I_A10_PLL2_4X 2 ++#define SUN4I_A10_PLL2_8X 3 ++ ++#endif /* __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ */ +--- a/include/dt-bindings/input/input.h ++++ b/include/dt-bindings/input/input.h +@@ -9,515 +9,7 @@ + #ifndef _DT_BINDINGS_INPUT_INPUT_H + #define _DT_BINDINGS_INPUT_INPUT_H + +-#define KEY_RESERVED 0 +-#define KEY_ESC 1 +-#define KEY_1 2 +-#define KEY_2 3 +-#define KEY_3 4 +-#define KEY_4 5 +-#define KEY_5 6 +-#define KEY_6 7 +-#define KEY_7 8 +-#define KEY_8 9 +-#define KEY_9 10 +-#define KEY_0 11 +-#define KEY_MINUS 12 +-#define KEY_EQUAL 13 +-#define KEY_BACKSPACE 14 +-#define KEY_TAB 15 +-#define KEY_Q 16 +-#define KEY_W 17 +-#define KEY_E 18 +-#define KEY_R 19 +-#define KEY_T 20 +-#define KEY_Y 21 +-#define KEY_U 22 +-#define KEY_I 23 +-#define KEY_O 24 +-#define KEY_P 25 +-#define KEY_LEFTBRACE 26 +-#define KEY_RIGHTBRACE 27 +-#define KEY_ENTER 28 +-#define KEY_LEFTCTRL 29 +-#define KEY_A 30 +-#define KEY_S 31 +-#define KEY_D 32 +-#define KEY_F 33 +-#define KEY_G 34 +-#define KEY_H 35 +-#define KEY_J 36 +-#define KEY_K 37 +-#define KEY_L 38 +-#define KEY_SEMICOLON 39 +-#define KEY_APOSTROPHE 40 +-#define KEY_GRAVE 41 +-#define KEY_LEFTSHIFT 42 +-#define KEY_BACKSLASH 43 +-#define KEY_Z 44 +-#define KEY_X 45 +-#define KEY_C 46 +-#define KEY_V 47 +-#define KEY_B 48 +-#define KEY_N 49 +-#define KEY_M 50 +-#define KEY_COMMA 51 +-#define KEY_DOT 52 +-#define KEY_SLASH 53 +-#define KEY_RIGHTSHIFT 54 +-#define KEY_KPASTERISK 55 +-#define KEY_LEFTALT 56 +-#define KEY_SPACE 57 +-#define KEY_CAPSLOCK 58 +-#define KEY_F1 59 +-#define KEY_F2 60 +-#define KEY_F3 61 +-#define KEY_F4 62 +-#define KEY_F5 63 +-#define KEY_F6 64 +-#define KEY_F7 65 +-#define KEY_F8 66 +-#define KEY_F9 67 +-#define KEY_F10 68 +-#define KEY_NUMLOCK 69 +-#define KEY_SCROLLLOCK 70 +-#define KEY_KP7 71 +-#define KEY_KP8 72 +-#define KEY_KP9 73 +-#define KEY_KPMINUS 74 +-#define KEY_KP4 75 +-#define KEY_KP5 76 +-#define KEY_KP6 77 +-#define KEY_KPPLUS 78 +-#define KEY_KP1 79 +-#define KEY_KP2 80 +-#define KEY_KP3 81 +-#define KEY_KP0 82 +-#define KEY_KPDOT 83 +- +-#define KEY_ZENKAKUHANKAKU 85 +-#define KEY_102ND 86 +-#define KEY_F11 87 +-#define KEY_F12 88 +-#define KEY_RO 89 +-#define KEY_KATAKANA 90 +-#define KEY_HIRAGANA 91 +-#define KEY_HENKAN 92 +-#define KEY_KATAKANAHIRAGANA 93 +-#define KEY_MUHENKAN 94 +-#define KEY_KPJPCOMMA 95 +-#define KEY_KPENTER 96 +-#define KEY_RIGHTCTRL 97 +-#define KEY_KPSLASH 98 +-#define KEY_SYSRQ 99 +-#define KEY_RIGHTALT 100 +-#define KEY_LINEFEED 101 +-#define KEY_HOME 102 +-#define KEY_UP 103 +-#define KEY_PAGEUP 104 +-#define KEY_LEFT 105 +-#define KEY_RIGHT 106 +-#define KEY_END 107 +-#define KEY_DOWN 108 +-#define KEY_PAGEDOWN 109 +-#define KEY_INSERT 110 +-#define KEY_DELETE 111 +-#define KEY_MACRO 112 +-#define KEY_MUTE 113 +-#define KEY_VOLUMEDOWN 114 +-#define KEY_VOLUMEUP 115 +-#define KEY_POWER 116 /* SC System Power Down */ +-#define KEY_KPEQUAL 117 +-#define KEY_KPPLUSMINUS 118 +-#define KEY_PAUSE 119 +-#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ +- +-#define KEY_KPCOMMA 121 +-#define KEY_HANGEUL 122 +-#define KEY_HANGUEL KEY_HANGEUL +-#define KEY_HANJA 123 +-#define KEY_YEN 124 +-#define KEY_LEFTMETA 125 +-#define KEY_RIGHTMETA 126 +-#define KEY_COMPOSE 127 +- +-#define KEY_STOP 128 /* AC Stop */ +-#define KEY_AGAIN 129 +-#define KEY_PROPS 130 /* AC Properties */ +-#define KEY_UNDO 131 /* AC Undo */ +-#define KEY_FRONT 132 +-#define KEY_COPY 133 /* AC Copy */ +-#define KEY_OPEN 134 /* AC Open */ +-#define KEY_PASTE 135 /* AC Paste */ +-#define KEY_FIND 136 /* AC Search */ +-#define KEY_CUT 137 /* AC Cut */ +-#define KEY_HELP 138 /* AL Integrated Help Center */ +-#define KEY_MENU 139 /* Menu (show menu) */ +-#define KEY_CALC 140 /* AL Calculator */ +-#define KEY_SETUP 141 +-#define KEY_SLEEP 142 /* SC System Sleep */ +-#define KEY_WAKEUP 143 /* System Wake Up */ +-#define KEY_FILE 144 /* AL Local Machine Browser */ +-#define KEY_SENDFILE 145 +-#define KEY_DELETEFILE 146 +-#define KEY_XFER 147 +-#define KEY_PROG1 148 +-#define KEY_PROG2 149 +-#define KEY_WWW 150 /* AL Internet Browser */ +-#define KEY_MSDOS 151 +-#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ +-#define KEY_SCREENLOCK KEY_COFFEE +-#define KEY_DIRECTION 153 +-#define KEY_CYCLEWINDOWS 154 +-#define KEY_MAIL 155 +-#define KEY_BOOKMARKS 156 /* AC Bookmarks */ +-#define KEY_COMPUTER 157 +-#define KEY_BACK 158 /* AC Back */ +-#define KEY_FORWARD 159 /* AC Forward */ +-#define KEY_CLOSECD 160 +-#define KEY_EJECTCD 161 +-#define KEY_EJECTCLOSECD 162 +-#define KEY_NEXTSONG 163 +-#define KEY_PLAYPAUSE 164 +-#define KEY_PREVIOUSSONG 165 +-#define KEY_STOPCD 166 +-#define KEY_RECORD 167 +-#define KEY_REWIND 168 +-#define KEY_PHONE 169 /* Media Select Telephone */ +-#define KEY_ISO 170 +-#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ +-#define KEY_HOMEPAGE 172 /* AC Home */ +-#define KEY_REFRESH 173 /* AC Refresh */ +-#define KEY_EXIT 174 /* AC Exit */ +-#define KEY_MOVE 175 +-#define KEY_EDIT 176 +-#define KEY_SCROLLUP 177 +-#define KEY_SCROLLDOWN 178 +-#define KEY_KPLEFTPAREN 179 +-#define KEY_KPRIGHTPAREN 180 +-#define KEY_NEW 181 /* AC New */ +-#define KEY_REDO 182 /* AC Redo/Repeat */ +- +-#define KEY_F13 183 +-#define KEY_F14 184 +-#define KEY_F15 185 +-#define KEY_F16 186 +-#define KEY_F17 187 +-#define KEY_F18 188 +-#define KEY_F19 189 +-#define KEY_F20 190 +-#define KEY_F21 191 +-#define KEY_F22 192 +-#define KEY_F23 193 +-#define KEY_F24 194 +- +-#define KEY_PLAYCD 200 +-#define KEY_PAUSECD 201 +-#define KEY_PROG3 202 +-#define KEY_PROG4 203 +-#define KEY_DASHBOARD 204 /* AL Dashboard */ +-#define KEY_SUSPEND 205 +-#define KEY_CLOSE 206 /* AC Close */ +-#define KEY_PLAY 207 +-#define KEY_FASTFORWARD 208 +-#define KEY_BASSBOOST 209 +-#define KEY_PRINT 210 /* AC Print */ +-#define KEY_HP 211 +-#define KEY_CAMERA 212 +-#define KEY_SOUND 213 +-#define KEY_QUESTION 214 +-#define KEY_EMAIL 215 +-#define KEY_CHAT 216 +-#define KEY_SEARCH 217 +-#define KEY_CONNECT 218 +-#define KEY_FINANCE 219 /* AL Checkbook/Finance */ +-#define KEY_SPORT 220 +-#define KEY_SHOP 221 +-#define KEY_ALTERASE 222 +-#define KEY_CANCEL 223 /* AC Cancel */ +-#define KEY_BRIGHTNESSDOWN 224 +-#define KEY_BRIGHTNESSUP 225 +-#define KEY_MEDIA 226 +- +-#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video +- outputs (Monitor/LCD/TV-out/etc) */ +-#define KEY_KBDILLUMTOGGLE 228 +-#define KEY_KBDILLUMDOWN 229 +-#define KEY_KBDILLUMUP 230 +- +-#define KEY_SEND 231 /* AC Send */ +-#define KEY_REPLY 232 /* AC Reply */ +-#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ +-#define KEY_SAVE 234 /* AC Save */ +-#define KEY_DOCUMENTS 235 +- +-#define KEY_BATTERY 236 +- +-#define KEY_BLUETOOTH 237 +-#define KEY_WLAN 238 +-#define KEY_UWB 239 +- +-#define KEY_UNKNOWN 240 +- +-#define KEY_VIDEO_NEXT 241 /* drive next video source */ +-#define KEY_VIDEO_PREV 242 /* drive previous video source */ +-#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ +-#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ +-#define KEY_DISPLAY_OFF 245 /* display device to off state */ +- +-#define KEY_WIMAX 246 +-#define KEY_RFKILL 247 /* Key that controls all radios */ +- +-#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ +- +-/* Code 255 is reserved for special needs of AT keyboard driver */ +- +-#define BTN_MISC 0x100 +-#define BTN_0 0x100 +-#define BTN_1 0x101 +-#define BTN_2 0x102 +-#define BTN_3 0x103 +-#define BTN_4 0x104 +-#define BTN_5 0x105 +-#define BTN_6 0x106 +-#define BTN_7 0x107 +-#define BTN_8 0x108 +-#define BTN_9 0x109 +- +-#define BTN_MOUSE 0x110 +-#define BTN_LEFT 0x110 +-#define BTN_RIGHT 0x111 +-#define BTN_MIDDLE 0x112 +-#define BTN_SIDE 0x113 +-#define BTN_EXTRA 0x114 +-#define BTN_FORWARD 0x115 +-#define BTN_BACK 0x116 +-#define BTN_TASK 0x117 +- +-#define BTN_JOYSTICK 0x120 +-#define BTN_TRIGGER 0x120 +-#define BTN_THUMB 0x121 +-#define BTN_THUMB2 0x122 +-#define BTN_TOP 0x123 +-#define BTN_TOP2 0x124 +-#define BTN_PINKIE 0x125 +-#define BTN_BASE 0x126 +-#define BTN_BASE2 0x127 +-#define BTN_BASE3 0x128 +-#define BTN_BASE4 0x129 +-#define BTN_BASE5 0x12a +-#define BTN_BASE6 0x12b +-#define BTN_DEAD 0x12f +- +-#define BTN_GAMEPAD 0x130 +-#define BTN_SOUTH 0x130 +-#define BTN_A BTN_SOUTH +-#define BTN_EAST 0x131 +-#define BTN_B BTN_EAST +-#define BTN_C 0x132 +-#define BTN_NORTH 0x133 +-#define BTN_X BTN_NORTH +-#define BTN_WEST 0x134 +-#define BTN_Y BTN_WEST +-#define BTN_Z 0x135 +-#define BTN_TL 0x136 +-#define BTN_TR 0x137 +-#define BTN_TL2 0x138 +-#define BTN_TR2 0x139 +-#define BTN_SELECT 0x13a +-#define BTN_START 0x13b +-#define BTN_MODE 0x13c +-#define BTN_THUMBL 0x13d +-#define BTN_THUMBR 0x13e +- +-#define BTN_DIGI 0x140 +-#define BTN_TOOL_PEN 0x140 +-#define BTN_TOOL_RUBBER 0x141 +-#define BTN_TOOL_BRUSH 0x142 +-#define BTN_TOOL_PENCIL 0x143 +-#define BTN_TOOL_AIRBRUSH 0x144 +-#define BTN_TOOL_FINGER 0x145 +-#define BTN_TOOL_MOUSE 0x146 +-#define BTN_TOOL_LENS 0x147 +-#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ +-#define BTN_TOUCH 0x14a +-#define BTN_STYLUS 0x14b +-#define BTN_STYLUS2 0x14c +-#define BTN_TOOL_DOUBLETAP 0x14d +-#define BTN_TOOL_TRIPLETAP 0x14e +-#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ +- +-#define BTN_WHEEL 0x150 +-#define BTN_GEAR_DOWN 0x150 +-#define BTN_GEAR_UP 0x151 +- +-#define KEY_OK 0x160 +-#define KEY_SELECT 0x161 +-#define KEY_GOTO 0x162 +-#define KEY_CLEAR 0x163 +-#define KEY_POWER2 0x164 +-#define KEY_OPTION 0x165 +-#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ +-#define KEY_TIME 0x167 +-#define KEY_VENDOR 0x168 +-#define KEY_ARCHIVE 0x169 +-#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ +-#define KEY_CHANNEL 0x16b +-#define KEY_FAVORITES 0x16c +-#define KEY_EPG 0x16d +-#define KEY_PVR 0x16e /* Media Select Home */ +-#define KEY_MHP 0x16f +-#define KEY_LANGUAGE 0x170 +-#define KEY_TITLE 0x171 +-#define KEY_SUBTITLE 0x172 +-#define KEY_ANGLE 0x173 +-#define KEY_ZOOM 0x174 +-#define KEY_MODE 0x175 +-#define KEY_KEYBOARD 0x176 +-#define KEY_SCREEN 0x177 +-#define KEY_PC 0x178 /* Media Select Computer */ +-#define KEY_TV 0x179 /* Media Select TV */ +-#define KEY_TV2 0x17a /* Media Select Cable */ +-#define KEY_VCR 0x17b /* Media Select VCR */ +-#define KEY_VCR2 0x17c /* VCR Plus */ +-#define KEY_SAT 0x17d /* Media Select Satellite */ +-#define KEY_SAT2 0x17e +-#define KEY_CD 0x17f /* Media Select CD */ +-#define KEY_TAPE 0x180 /* Media Select Tape */ +-#define KEY_RADIO 0x181 +-#define KEY_TUNER 0x182 /* Media Select Tuner */ +-#define KEY_PLAYER 0x183 +-#define KEY_TEXT 0x184 +-#define KEY_DVD 0x185 /* Media Select DVD */ +-#define KEY_AUX 0x186 +-#define KEY_MP3 0x187 +-#define KEY_AUDIO 0x188 /* AL Audio Browser */ +-#define KEY_VIDEO 0x189 /* AL Movie Browser */ +-#define KEY_DIRECTORY 0x18a +-#define KEY_LIST 0x18b +-#define KEY_MEMO 0x18c /* Media Select Messages */ +-#define KEY_CALENDAR 0x18d +-#define KEY_RED 0x18e +-#define KEY_GREEN 0x18f +-#define KEY_YELLOW 0x190 +-#define KEY_BLUE 0x191 +-#define KEY_CHANNELUP 0x192 /* Channel Increment */ +-#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ +-#define KEY_FIRST 0x194 +-#define KEY_LAST 0x195 /* Recall Last */ +-#define KEY_AB 0x196 +-#define KEY_NEXT 0x197 +-#define KEY_RESTART 0x198 +-#define KEY_SLOW 0x199 +-#define KEY_SHUFFLE 0x19a +-#define KEY_BREAK 0x19b +-#define KEY_PREVIOUS 0x19c +-#define KEY_DIGITS 0x19d +-#define KEY_TEEN 0x19e +-#define KEY_TWEN 0x19f +-#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ +-#define KEY_GAMES 0x1a1 /* Media Select Games */ +-#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ +-#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ +-#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ +-#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ +-#define KEY_EDITOR 0x1a6 /* AL Text Editor */ +-#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ +-#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ +-#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ +-#define KEY_DATABASE 0x1aa /* AL Database App */ +-#define KEY_NEWS 0x1ab /* AL Newsreader */ +-#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ +-#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ +-#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ +-#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ +-#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ +-#define KEY_LOGOFF 0x1b1 /* AL Logoff */ +- +-#define KEY_DOLLAR 0x1b2 +-#define KEY_EURO 0x1b3 +- +-#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ +-#define KEY_FRAMEFORWARD 0x1b5 +-#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ +-#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ +-#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ +-#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ +-#define KEY_IMAGES 0x1ba /* AL Image Browser */ +- +-#define KEY_DEL_EOL 0x1c0 +-#define KEY_DEL_EOS 0x1c1 +-#define KEY_INS_LINE 0x1c2 +-#define KEY_DEL_LINE 0x1c3 +- +-#define KEY_FN 0x1d0 +-#define KEY_FN_ESC 0x1d1 +-#define KEY_FN_F1 0x1d2 +-#define KEY_FN_F2 0x1d3 +-#define KEY_FN_F3 0x1d4 +-#define KEY_FN_F4 0x1d5 +-#define KEY_FN_F5 0x1d6 +-#define KEY_FN_F6 0x1d7 +-#define KEY_FN_F7 0x1d8 +-#define KEY_FN_F8 0x1d9 +-#define KEY_FN_F9 0x1da +-#define KEY_FN_F10 0x1db +-#define KEY_FN_F11 0x1dc +-#define KEY_FN_F12 0x1dd +-#define KEY_FN_1 0x1de +-#define KEY_FN_2 0x1df +-#define KEY_FN_D 0x1e0 +-#define KEY_FN_E 0x1e1 +-#define KEY_FN_F 0x1e2 +-#define KEY_FN_S 0x1e3 +-#define KEY_FN_B 0x1e4 +- +-#define KEY_BRL_DOT1 0x1f1 +-#define KEY_BRL_DOT2 0x1f2 +-#define KEY_BRL_DOT3 0x1f3 +-#define KEY_BRL_DOT4 0x1f4 +-#define KEY_BRL_DOT5 0x1f5 +-#define KEY_BRL_DOT6 0x1f6 +-#define KEY_BRL_DOT7 0x1f7 +-#define KEY_BRL_DOT8 0x1f8 +-#define KEY_BRL_DOT9 0x1f9 +-#define KEY_BRL_DOT10 0x1fa +- +-#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ +-#define KEY_NUMERIC_1 0x201 /* and other keypads */ +-#define KEY_NUMERIC_2 0x202 +-#define KEY_NUMERIC_3 0x203 +-#define KEY_NUMERIC_4 0x204 +-#define KEY_NUMERIC_5 0x205 +-#define KEY_NUMERIC_6 0x206 +-#define KEY_NUMERIC_7 0x207 +-#define KEY_NUMERIC_8 0x208 +-#define KEY_NUMERIC_9 0x209 +-#define KEY_NUMERIC_STAR 0x20a +-#define KEY_NUMERIC_POUND 0x20b +- +-#define KEY_CAMERA_FOCUS 0x210 +-#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ +- +-#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ +-#define KEY_TOUCHPAD_ON 0x213 +-#define KEY_TOUCHPAD_OFF 0x214 +- +-#define KEY_CAMERA_ZOOMIN 0x215 +-#define KEY_CAMERA_ZOOMOUT 0x216 +-#define KEY_CAMERA_UP 0x217 +-#define KEY_CAMERA_DOWN 0x218 +-#define KEY_CAMERA_LEFT 0x219 +-#define KEY_CAMERA_RIGHT 0x21a +- +-#define KEY_ATTENDANT_ON 0x21b +-#define KEY_ATTENDANT_OFF 0x21c +-#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ +-#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ +- +-#define BTN_DPAD_UP 0x220 +-#define BTN_DPAD_DOWN 0x221 +-#define BTN_DPAD_LEFT 0x222 +-#define BTN_DPAD_RIGHT 0x223 ++#include "linux-event-codes.h" + + #define MATRIX_KEY(row, col, code) \ + ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF)) +--- /dev/null ++++ b/include/dt-bindings/input/linux-event-codes.h +@@ -0,0 +1,805 @@ ++/* ++ * Input event codes ++ * ++ * *** IMPORTANT *** ++ * This file is not only included from C-code but also from devicetree source ++ * files. As such this file MUST only contain comments and defines. ++ * ++ * Copyright (c) 1999-2002 Vojtech Pavlik ++ * Copyright (c) 2015 Hans de Goede ++ * ++ * 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. ++ */ ++#ifndef _UAPI_INPUT_EVENT_CODES_H ++#define _UAPI_INPUT_EVENT_CODES_H ++ ++/* ++ * Device properties and quirks ++ */ ++ ++#define INPUT_PROP_POINTER 0x00 /* needs a pointer */ ++#define INPUT_PROP_DIRECT 0x01 /* direct input devices */ ++#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ ++#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ ++#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ ++#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ ++#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ ++ ++#define INPUT_PROP_MAX 0x1f ++#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) ++ ++/* ++ * Event types ++ */ ++ ++#define EV_SYN 0x00 ++#define EV_KEY 0x01 ++#define EV_REL 0x02 ++#define EV_ABS 0x03 ++#define EV_MSC 0x04 ++#define EV_SW 0x05 ++#define EV_LED 0x11 ++#define EV_SND 0x12 ++#define EV_REP 0x14 ++#define EV_FF 0x15 ++#define EV_PWR 0x16 ++#define EV_FF_STATUS 0x17 ++#define EV_MAX 0x1f ++#define EV_CNT (EV_MAX+1) ++ ++/* ++ * Synchronization events. ++ */ ++ ++#define SYN_REPORT 0 ++#define SYN_CONFIG 1 ++#define SYN_MT_REPORT 2 ++#define SYN_DROPPED 3 ++#define SYN_MAX 0xf ++#define SYN_CNT (SYN_MAX+1) ++ ++/* ++ * Keys and buttons ++ * ++ * Most of the keys/buttons are modeled after USB HUT 1.12 ++ * (see http://www.usb.org/developers/hidpage). ++ * Abbreviations in the comments: ++ * AC - Application Control ++ * AL - Application Launch Button ++ * SC - System Control ++ */ ++ ++#define KEY_RESERVED 0 ++#define KEY_ESC 1 ++#define KEY_1 2 ++#define KEY_2 3 ++#define KEY_3 4 ++#define KEY_4 5 ++#define KEY_5 6 ++#define KEY_6 7 ++#define KEY_7 8 ++#define KEY_8 9 ++#define KEY_9 10 ++#define KEY_0 11 ++#define KEY_MINUS 12 ++#define KEY_EQUAL 13 ++#define KEY_BACKSPACE 14 ++#define KEY_TAB 15 ++#define KEY_Q 16 ++#define KEY_W 17 ++#define KEY_E 18 ++#define KEY_R 19 ++#define KEY_T 20 ++#define KEY_Y 21 ++#define KEY_U 22 ++#define KEY_I 23 ++#define KEY_O 24 ++#define KEY_P 25 ++#define KEY_LEFTBRACE 26 ++#define KEY_RIGHTBRACE 27 ++#define KEY_ENTER 28 ++#define KEY_LEFTCTRL 29 ++#define KEY_A 30 ++#define KEY_S 31 ++#define KEY_D 32 ++#define KEY_F 33 ++#define KEY_G 34 ++#define KEY_H 35 ++#define KEY_J 36 ++#define KEY_K 37 ++#define KEY_L 38 ++#define KEY_SEMICOLON 39 ++#define KEY_APOSTROPHE 40 ++#define KEY_GRAVE 41 ++#define KEY_LEFTSHIFT 42 ++#define KEY_BACKSLASH 43 ++#define KEY_Z 44 ++#define KEY_X 45 ++#define KEY_C 46 ++#define KEY_V 47 ++#define KEY_B 48 ++#define KEY_N 49 ++#define KEY_M 50 ++#define KEY_COMMA 51 ++#define KEY_DOT 52 ++#define KEY_SLASH 53 ++#define KEY_RIGHTSHIFT 54 ++#define KEY_KPASTERISK 55 ++#define KEY_LEFTALT 56 ++#define KEY_SPACE 57 ++#define KEY_CAPSLOCK 58 ++#define KEY_F1 59 ++#define KEY_F2 60 ++#define KEY_F3 61 ++#define KEY_F4 62 ++#define KEY_F5 63 ++#define KEY_F6 64 ++#define KEY_F7 65 ++#define KEY_F8 66 ++#define KEY_F9 67 ++#define KEY_F10 68 ++#define KEY_NUMLOCK 69 ++#define KEY_SCROLLLOCK 70 ++#define KEY_KP7 71 ++#define KEY_KP8 72 ++#define KEY_KP9 73 ++#define KEY_KPMINUS 74 ++#define KEY_KP4 75 ++#define KEY_KP5 76 ++#define KEY_KP6 77 ++#define KEY_KPPLUS 78 ++#define KEY_KP1 79 ++#define KEY_KP2 80 ++#define KEY_KP3 81 ++#define KEY_KP0 82 ++#define KEY_KPDOT 83 ++ ++#define KEY_ZENKAKUHANKAKU 85 ++#define KEY_102ND 86 ++#define KEY_F11 87 ++#define KEY_F12 88 ++#define KEY_RO 89 ++#define KEY_KATAKANA 90 ++#define KEY_HIRAGANA 91 ++#define KEY_HENKAN 92 ++#define KEY_KATAKANAHIRAGANA 93 ++#define KEY_MUHENKAN 94 ++#define KEY_KPJPCOMMA 95 ++#define KEY_KPENTER 96 ++#define KEY_RIGHTCTRL 97 ++#define KEY_KPSLASH 98 ++#define KEY_SYSRQ 99 ++#define KEY_RIGHTALT 100 ++#define KEY_LINEFEED 101 ++#define KEY_HOME 102 ++#define KEY_UP 103 ++#define KEY_PAGEUP 104 ++#define KEY_LEFT 105 ++#define KEY_RIGHT 106 ++#define KEY_END 107 ++#define KEY_DOWN 108 ++#define KEY_PAGEDOWN 109 ++#define KEY_INSERT 110 ++#define KEY_DELETE 111 ++#define KEY_MACRO 112 ++#define KEY_MUTE 113 ++#define KEY_VOLUMEDOWN 114 ++#define KEY_VOLUMEUP 115 ++#define KEY_POWER 116 /* SC System Power Down */ ++#define KEY_KPEQUAL 117 ++#define KEY_KPPLUSMINUS 118 ++#define KEY_PAUSE 119 ++#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ ++ ++#define KEY_KPCOMMA 121 ++#define KEY_HANGEUL 122 ++#define KEY_HANGUEL KEY_HANGEUL ++#define KEY_HANJA 123 ++#define KEY_YEN 124 ++#define KEY_LEFTMETA 125 ++#define KEY_RIGHTMETA 126 ++#define KEY_COMPOSE 127 ++ ++#define KEY_STOP 128 /* AC Stop */ ++#define KEY_AGAIN 129 ++#define KEY_PROPS 130 /* AC Properties */ ++#define KEY_UNDO 131 /* AC Undo */ ++#define KEY_FRONT 132 ++#define KEY_COPY 133 /* AC Copy */ ++#define KEY_OPEN 134 /* AC Open */ ++#define KEY_PASTE 135 /* AC Paste */ ++#define KEY_FIND 136 /* AC Search */ ++#define KEY_CUT 137 /* AC Cut */ ++#define KEY_HELP 138 /* AL Integrated Help Center */ ++#define KEY_MENU 139 /* Menu (show menu) */ ++#define KEY_CALC 140 /* AL Calculator */ ++#define KEY_SETUP 141 ++#define KEY_SLEEP 142 /* SC System Sleep */ ++#define KEY_WAKEUP 143 /* System Wake Up */ ++#define KEY_FILE 144 /* AL Local Machine Browser */ ++#define KEY_SENDFILE 145 ++#define KEY_DELETEFILE 146 ++#define KEY_XFER 147 ++#define KEY_PROG1 148 ++#define KEY_PROG2 149 ++#define KEY_WWW 150 /* AL Internet Browser */ ++#define KEY_MSDOS 151 ++#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ ++#define KEY_SCREENLOCK KEY_COFFEE ++#define KEY_ROTATE_DISPLAY 153 /* Display orientation for e.g. tablets */ ++#define KEY_DIRECTION KEY_ROTATE_DISPLAY ++#define KEY_CYCLEWINDOWS 154 ++#define KEY_MAIL 155 ++#define KEY_BOOKMARKS 156 /* AC Bookmarks */ ++#define KEY_COMPUTER 157 ++#define KEY_BACK 158 /* AC Back */ ++#define KEY_FORWARD 159 /* AC Forward */ ++#define KEY_CLOSECD 160 ++#define KEY_EJECTCD 161 ++#define KEY_EJECTCLOSECD 162 ++#define KEY_NEXTSONG 163 ++#define KEY_PLAYPAUSE 164 ++#define KEY_PREVIOUSSONG 165 ++#define KEY_STOPCD 166 ++#define KEY_RECORD 167 ++#define KEY_REWIND 168 ++#define KEY_PHONE 169 /* Media Select Telephone */ ++#define KEY_ISO 170 ++#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ ++#define KEY_HOMEPAGE 172 /* AC Home */ ++#define KEY_REFRESH 173 /* AC Refresh */ ++#define KEY_EXIT 174 /* AC Exit */ ++#define KEY_MOVE 175 ++#define KEY_EDIT 176 ++#define KEY_SCROLLUP 177 ++#define KEY_SCROLLDOWN 178 ++#define KEY_KPLEFTPAREN 179 ++#define KEY_KPRIGHTPAREN 180 ++#define KEY_NEW 181 /* AC New */ ++#define KEY_REDO 182 /* AC Redo/Repeat */ ++ ++#define KEY_F13 183 ++#define KEY_F14 184 ++#define KEY_F15 185 ++#define KEY_F16 186 ++#define KEY_F17 187 ++#define KEY_F18 188 ++#define KEY_F19 189 ++#define KEY_F20 190 ++#define KEY_F21 191 ++#define KEY_F22 192 ++#define KEY_F23 193 ++#define KEY_F24 194 ++ ++#define KEY_PLAYCD 200 ++#define KEY_PAUSECD 201 ++#define KEY_PROG3 202 ++#define KEY_PROG4 203 ++#define KEY_DASHBOARD 204 /* AL Dashboard */ ++#define KEY_SUSPEND 205 ++#define KEY_CLOSE 206 /* AC Close */ ++#define KEY_PLAY 207 ++#define KEY_FASTFORWARD 208 ++#define KEY_BASSBOOST 209 ++#define KEY_PRINT 210 /* AC Print */ ++#define KEY_HP 211 ++#define KEY_CAMERA 212 ++#define KEY_SOUND 213 ++#define KEY_QUESTION 214 ++#define KEY_EMAIL 215 ++#define KEY_CHAT 216 ++#define KEY_SEARCH 217 ++#define KEY_CONNECT 218 ++#define KEY_FINANCE 219 /* AL Checkbook/Finance */ ++#define KEY_SPORT 220 ++#define KEY_SHOP 221 ++#define KEY_ALTERASE 222 ++#define KEY_CANCEL 223 /* AC Cancel */ ++#define KEY_BRIGHTNESSDOWN 224 ++#define KEY_BRIGHTNESSUP 225 ++#define KEY_MEDIA 226 ++ ++#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video ++ outputs (Monitor/LCD/TV-out/etc) */ ++#define KEY_KBDILLUMTOGGLE 228 ++#define KEY_KBDILLUMDOWN 229 ++#define KEY_KBDILLUMUP 230 ++ ++#define KEY_SEND 231 /* AC Send */ ++#define KEY_REPLY 232 /* AC Reply */ ++#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ ++#define KEY_SAVE 234 /* AC Save */ ++#define KEY_DOCUMENTS 235 ++ ++#define KEY_BATTERY 236 ++ ++#define KEY_BLUETOOTH 237 ++#define KEY_WLAN 238 ++#define KEY_UWB 239 ++ ++#define KEY_UNKNOWN 240 ++ ++#define KEY_VIDEO_NEXT 241 /* drive next video source */ ++#define KEY_VIDEO_PREV 242 /* drive previous video source */ ++#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ ++#define KEY_BRIGHTNESS_AUTO 244 /* Set Auto Brightness: manual ++ brightness control is off, ++ rely on ambient */ ++#define KEY_BRIGHTNESS_ZERO KEY_BRIGHTNESS_AUTO ++#define KEY_DISPLAY_OFF 245 /* display device to off state */ ++ ++#define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ ++#define KEY_WIMAX KEY_WWAN ++#define KEY_RFKILL 247 /* Key that controls all radios */ ++ ++#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ ++ ++/* Code 255 is reserved for special needs of AT keyboard driver */ ++ ++#define BTN_MISC 0x100 ++#define BTN_0 0x100 ++#define BTN_1 0x101 ++#define BTN_2 0x102 ++#define BTN_3 0x103 ++#define BTN_4 0x104 ++#define BTN_5 0x105 ++#define BTN_6 0x106 ++#define BTN_7 0x107 ++#define BTN_8 0x108 ++#define BTN_9 0x109 ++ ++#define BTN_MOUSE 0x110 ++#define BTN_LEFT 0x110 ++#define BTN_RIGHT 0x111 ++#define BTN_MIDDLE 0x112 ++#define BTN_SIDE 0x113 ++#define BTN_EXTRA 0x114 ++#define BTN_FORWARD 0x115 ++#define BTN_BACK 0x116 ++#define BTN_TASK 0x117 ++ ++#define BTN_JOYSTICK 0x120 ++#define BTN_TRIGGER 0x120 ++#define BTN_THUMB 0x121 ++#define BTN_THUMB2 0x122 ++#define BTN_TOP 0x123 ++#define BTN_TOP2 0x124 ++#define BTN_PINKIE 0x125 ++#define BTN_BASE 0x126 ++#define BTN_BASE2 0x127 ++#define BTN_BASE3 0x128 ++#define BTN_BASE4 0x129 ++#define BTN_BASE5 0x12a ++#define BTN_BASE6 0x12b ++#define BTN_DEAD 0x12f ++ ++#define BTN_GAMEPAD 0x130 ++#define BTN_SOUTH 0x130 ++#define BTN_A BTN_SOUTH ++#define BTN_EAST 0x131 ++#define BTN_B BTN_EAST ++#define BTN_C 0x132 ++#define BTN_NORTH 0x133 ++#define BTN_X BTN_NORTH ++#define BTN_WEST 0x134 ++#define BTN_Y BTN_WEST ++#define BTN_Z 0x135 ++#define BTN_TL 0x136 ++#define BTN_TR 0x137 ++#define BTN_TL2 0x138 ++#define BTN_TR2 0x139 ++#define BTN_SELECT 0x13a ++#define BTN_START 0x13b ++#define BTN_MODE 0x13c ++#define BTN_THUMBL 0x13d ++#define BTN_THUMBR 0x13e ++ ++#define BTN_DIGI 0x140 ++#define BTN_TOOL_PEN 0x140 ++#define BTN_TOOL_RUBBER 0x141 ++#define BTN_TOOL_BRUSH 0x142 ++#define BTN_TOOL_PENCIL 0x143 ++#define BTN_TOOL_AIRBRUSH 0x144 ++#define BTN_TOOL_FINGER 0x145 ++#define BTN_TOOL_MOUSE 0x146 ++#define BTN_TOOL_LENS 0x147 ++#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ ++#define BTN_TOUCH 0x14a ++#define BTN_STYLUS 0x14b ++#define BTN_STYLUS2 0x14c ++#define BTN_TOOL_DOUBLETAP 0x14d ++#define BTN_TOOL_TRIPLETAP 0x14e ++#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ ++ ++#define BTN_WHEEL 0x150 ++#define BTN_GEAR_DOWN 0x150 ++#define BTN_GEAR_UP 0x151 ++ ++#define KEY_OK 0x160 ++#define KEY_SELECT 0x161 ++#define KEY_GOTO 0x162 ++#define KEY_CLEAR 0x163 ++#define KEY_POWER2 0x164 ++#define KEY_OPTION 0x165 ++#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ ++#define KEY_TIME 0x167 ++#define KEY_VENDOR 0x168 ++#define KEY_ARCHIVE 0x169 ++#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ ++#define KEY_CHANNEL 0x16b ++#define KEY_FAVORITES 0x16c ++#define KEY_EPG 0x16d ++#define KEY_PVR 0x16e /* Media Select Home */ ++#define KEY_MHP 0x16f ++#define KEY_LANGUAGE 0x170 ++#define KEY_TITLE 0x171 ++#define KEY_SUBTITLE 0x172 ++#define KEY_ANGLE 0x173 ++#define KEY_ZOOM 0x174 ++#define KEY_MODE 0x175 ++#define KEY_KEYBOARD 0x176 ++#define KEY_SCREEN 0x177 ++#define KEY_PC 0x178 /* Media Select Computer */ ++#define KEY_TV 0x179 /* Media Select TV */ ++#define KEY_TV2 0x17a /* Media Select Cable */ ++#define KEY_VCR 0x17b /* Media Select VCR */ ++#define KEY_VCR2 0x17c /* VCR Plus */ ++#define KEY_SAT 0x17d /* Media Select Satellite */ ++#define KEY_SAT2 0x17e ++#define KEY_CD 0x17f /* Media Select CD */ ++#define KEY_TAPE 0x180 /* Media Select Tape */ ++#define KEY_RADIO 0x181 ++#define KEY_TUNER 0x182 /* Media Select Tuner */ ++#define KEY_PLAYER 0x183 ++#define KEY_TEXT 0x184 ++#define KEY_DVD 0x185 /* Media Select DVD */ ++#define KEY_AUX 0x186 ++#define KEY_MP3 0x187 ++#define KEY_AUDIO 0x188 /* AL Audio Browser */ ++#define KEY_VIDEO 0x189 /* AL Movie Browser */ ++#define KEY_DIRECTORY 0x18a ++#define KEY_LIST 0x18b ++#define KEY_MEMO 0x18c /* Media Select Messages */ ++#define KEY_CALENDAR 0x18d ++#define KEY_RED 0x18e ++#define KEY_GREEN 0x18f ++#define KEY_YELLOW 0x190 ++#define KEY_BLUE 0x191 ++#define KEY_CHANNELUP 0x192 /* Channel Increment */ ++#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ ++#define KEY_FIRST 0x194 ++#define KEY_LAST 0x195 /* Recall Last */ ++#define KEY_AB 0x196 ++#define KEY_NEXT 0x197 ++#define KEY_RESTART 0x198 ++#define KEY_SLOW 0x199 ++#define KEY_SHUFFLE 0x19a ++#define KEY_BREAK 0x19b ++#define KEY_PREVIOUS 0x19c ++#define KEY_DIGITS 0x19d ++#define KEY_TEEN 0x19e ++#define KEY_TWEN 0x19f ++#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ ++#define KEY_GAMES 0x1a1 /* Media Select Games */ ++#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ ++#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ ++#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ ++#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ ++#define KEY_EDITOR 0x1a6 /* AL Text Editor */ ++#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ ++#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ ++#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ ++#define KEY_DATABASE 0x1aa /* AL Database App */ ++#define KEY_NEWS 0x1ab /* AL Newsreader */ ++#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ ++#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ ++#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ ++#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ ++#define KEY_BRIGHTNESS_TOGGLE KEY_DISPLAYTOGGLE ++#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ ++#define KEY_LOGOFF 0x1b1 /* AL Logoff */ ++ ++#define KEY_DOLLAR 0x1b2 ++#define KEY_EURO 0x1b3 ++ ++#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ ++#define KEY_FRAMEFORWARD 0x1b5 ++#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ ++#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ ++#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ ++#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ ++#define KEY_IMAGES 0x1ba /* AL Image Browser */ ++ ++#define KEY_DEL_EOL 0x1c0 ++#define KEY_DEL_EOS 0x1c1 ++#define KEY_INS_LINE 0x1c2 ++#define KEY_DEL_LINE 0x1c3 ++ ++#define KEY_FN 0x1d0 ++#define KEY_FN_ESC 0x1d1 ++#define KEY_FN_F1 0x1d2 ++#define KEY_FN_F2 0x1d3 ++#define KEY_FN_F3 0x1d4 ++#define KEY_FN_F4 0x1d5 ++#define KEY_FN_F5 0x1d6 ++#define KEY_FN_F6 0x1d7 ++#define KEY_FN_F7 0x1d8 ++#define KEY_FN_F8 0x1d9 ++#define KEY_FN_F9 0x1da ++#define KEY_FN_F10 0x1db ++#define KEY_FN_F11 0x1dc ++#define KEY_FN_F12 0x1dd ++#define KEY_FN_1 0x1de ++#define KEY_FN_2 0x1df ++#define KEY_FN_D 0x1e0 ++#define KEY_FN_E 0x1e1 ++#define KEY_FN_F 0x1e2 ++#define KEY_FN_S 0x1e3 ++#define KEY_FN_B 0x1e4 ++ ++#define KEY_BRL_DOT1 0x1f1 ++#define KEY_BRL_DOT2 0x1f2 ++#define KEY_BRL_DOT3 0x1f3 ++#define KEY_BRL_DOT4 0x1f4 ++#define KEY_BRL_DOT5 0x1f5 ++#define KEY_BRL_DOT6 0x1f6 ++#define KEY_BRL_DOT7 0x1f7 ++#define KEY_BRL_DOT8 0x1f8 ++#define KEY_BRL_DOT9 0x1f9 ++#define KEY_BRL_DOT10 0x1fa ++ ++#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ ++#define KEY_NUMERIC_1 0x201 /* and other keypads */ ++#define KEY_NUMERIC_2 0x202 ++#define KEY_NUMERIC_3 0x203 ++#define KEY_NUMERIC_4 0x204 ++#define KEY_NUMERIC_5 0x205 ++#define KEY_NUMERIC_6 0x206 ++#define KEY_NUMERIC_7 0x207 ++#define KEY_NUMERIC_8 0x208 ++#define KEY_NUMERIC_9 0x209 ++#define KEY_NUMERIC_STAR 0x20a ++#define KEY_NUMERIC_POUND 0x20b ++#define KEY_NUMERIC_A 0x20c /* Phone key A - HUT Telephony 0xb9 */ ++#define KEY_NUMERIC_B 0x20d ++#define KEY_NUMERIC_C 0x20e ++#define KEY_NUMERIC_D 0x20f ++ ++#define KEY_CAMERA_FOCUS 0x210 ++#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ ++ ++#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ ++#define KEY_TOUCHPAD_ON 0x213 ++#define KEY_TOUCHPAD_OFF 0x214 ++ ++#define KEY_CAMERA_ZOOMIN 0x215 ++#define KEY_CAMERA_ZOOMOUT 0x216 ++#define KEY_CAMERA_UP 0x217 ++#define KEY_CAMERA_DOWN 0x218 ++#define KEY_CAMERA_LEFT 0x219 ++#define KEY_CAMERA_RIGHT 0x21a ++ ++#define KEY_ATTENDANT_ON 0x21b ++#define KEY_ATTENDANT_OFF 0x21c ++#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ ++#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ ++ ++#define BTN_DPAD_UP 0x220 ++#define BTN_DPAD_DOWN 0x221 ++#define BTN_DPAD_LEFT 0x222 ++#define BTN_DPAD_RIGHT 0x223 ++ ++#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ ++ ++#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ ++#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ ++#define KEY_JOURNAL 0x242 /* AL Log/Journal/Timecard */ ++#define KEY_CONTROLPANEL 0x243 /* AL Control Panel */ ++#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ ++#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ ++#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ ++ ++#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ ++#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ ++ ++#define KEY_KBDINPUTASSIST_PREV 0x260 ++#define KEY_KBDINPUTASSIST_NEXT 0x261 ++#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 ++#define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 ++#define KEY_KBDINPUTASSIST_ACCEPT 0x264 ++#define KEY_KBDINPUTASSIST_CANCEL 0x265 ++ ++#define BTN_TRIGGER_HAPPY 0x2c0 ++#define BTN_TRIGGER_HAPPY1 0x2c0 ++#define BTN_TRIGGER_HAPPY2 0x2c1 ++#define BTN_TRIGGER_HAPPY3 0x2c2 ++#define BTN_TRIGGER_HAPPY4 0x2c3 ++#define BTN_TRIGGER_HAPPY5 0x2c4 ++#define BTN_TRIGGER_HAPPY6 0x2c5 ++#define BTN_TRIGGER_HAPPY7 0x2c6 ++#define BTN_TRIGGER_HAPPY8 0x2c7 ++#define BTN_TRIGGER_HAPPY9 0x2c8 ++#define BTN_TRIGGER_HAPPY10 0x2c9 ++#define BTN_TRIGGER_HAPPY11 0x2ca ++#define BTN_TRIGGER_HAPPY12 0x2cb ++#define BTN_TRIGGER_HAPPY13 0x2cc ++#define BTN_TRIGGER_HAPPY14 0x2cd ++#define BTN_TRIGGER_HAPPY15 0x2ce ++#define BTN_TRIGGER_HAPPY16 0x2cf ++#define BTN_TRIGGER_HAPPY17 0x2d0 ++#define BTN_TRIGGER_HAPPY18 0x2d1 ++#define BTN_TRIGGER_HAPPY19 0x2d2 ++#define BTN_TRIGGER_HAPPY20 0x2d3 ++#define BTN_TRIGGER_HAPPY21 0x2d4 ++#define BTN_TRIGGER_HAPPY22 0x2d5 ++#define BTN_TRIGGER_HAPPY23 0x2d6 ++#define BTN_TRIGGER_HAPPY24 0x2d7 ++#define BTN_TRIGGER_HAPPY25 0x2d8 ++#define BTN_TRIGGER_HAPPY26 0x2d9 ++#define BTN_TRIGGER_HAPPY27 0x2da ++#define BTN_TRIGGER_HAPPY28 0x2db ++#define BTN_TRIGGER_HAPPY29 0x2dc ++#define BTN_TRIGGER_HAPPY30 0x2dd ++#define BTN_TRIGGER_HAPPY31 0x2de ++#define BTN_TRIGGER_HAPPY32 0x2df ++#define BTN_TRIGGER_HAPPY33 0x2e0 ++#define BTN_TRIGGER_HAPPY34 0x2e1 ++#define BTN_TRIGGER_HAPPY35 0x2e2 ++#define BTN_TRIGGER_HAPPY36 0x2e3 ++#define BTN_TRIGGER_HAPPY37 0x2e4 ++#define BTN_TRIGGER_HAPPY38 0x2e5 ++#define BTN_TRIGGER_HAPPY39 0x2e6 ++#define BTN_TRIGGER_HAPPY40 0x2e7 ++ ++/* We avoid low common keys in module aliases so they don't get huge. */ ++#define KEY_MIN_INTERESTING KEY_MUTE ++#define KEY_MAX 0x2ff ++#define KEY_CNT (KEY_MAX+1) ++ ++/* ++ * Relative axes ++ */ ++ ++#define REL_X 0x00 ++#define REL_Y 0x01 ++#define REL_Z 0x02 ++#define REL_RX 0x03 ++#define REL_RY 0x04 ++#define REL_RZ 0x05 ++#define REL_HWHEEL 0x06 ++#define REL_DIAL 0x07 ++#define REL_WHEEL 0x08 ++#define REL_MISC 0x09 ++#define REL_MAX 0x0f ++#define REL_CNT (REL_MAX+1) ++ ++/* ++ * Absolute axes ++ */ ++ ++#define ABS_X 0x00 ++#define ABS_Y 0x01 ++#define ABS_Z 0x02 ++#define ABS_RX 0x03 ++#define ABS_RY 0x04 ++#define ABS_RZ 0x05 ++#define ABS_THROTTLE 0x06 ++#define ABS_RUDDER 0x07 ++#define ABS_WHEEL 0x08 ++#define ABS_GAS 0x09 ++#define ABS_BRAKE 0x0a ++#define ABS_HAT0X 0x10 ++#define ABS_HAT0Y 0x11 ++#define ABS_HAT1X 0x12 ++#define ABS_HAT1Y 0x13 ++#define ABS_HAT2X 0x14 ++#define ABS_HAT2Y 0x15 ++#define ABS_HAT3X 0x16 ++#define ABS_HAT3Y 0x17 ++#define ABS_PRESSURE 0x18 ++#define ABS_DISTANCE 0x19 ++#define ABS_TILT_X 0x1a ++#define ABS_TILT_Y 0x1b ++#define ABS_TOOL_WIDTH 0x1c ++ ++#define ABS_VOLUME 0x20 ++ ++#define ABS_MISC 0x28 ++ ++#define ABS_MT_SLOT 0x2f /* MT slot being modified */ ++#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ ++#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ ++#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ ++#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ ++#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ ++#define ABS_MT_POSITION_X 0x35 /* Center X touch position */ ++#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */ ++#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ ++#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ ++#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ ++#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ ++#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ ++#define ABS_MT_TOOL_X 0x3c /* Center X tool position */ ++#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ ++ ++ ++#define ABS_MAX 0x3f ++#define ABS_CNT (ABS_MAX+1) ++ ++/* ++ * Switch events ++ */ ++ ++#define SW_LID 0x00 /* set = lid shut */ ++#define SW_TABLET_MODE 0x01 /* set = tablet mode */ ++#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ ++#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" ++ set = radio enabled */ ++#define SW_RADIO SW_RFKILL_ALL /* deprecated */ ++#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ ++#define SW_DOCK 0x05 /* set = plugged into dock */ ++#define SW_LINEOUT_INSERT 0x06 /* set = inserted */ ++#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ ++#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ ++#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ ++#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ ++#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ ++#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ ++#define SW_LINEIN_INSERT 0x0d /* set = inserted */ ++#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ ++#define SW_MAX 0x0f ++#define SW_CNT (SW_MAX+1) ++ ++/* ++ * Misc events ++ */ ++ ++#define MSC_SERIAL 0x00 ++#define MSC_PULSELED 0x01 ++#define MSC_GESTURE 0x02 ++#define MSC_RAW 0x03 ++#define MSC_SCAN 0x04 ++#define MSC_TIMESTAMP 0x05 ++#define MSC_MAX 0x07 ++#define MSC_CNT (MSC_MAX+1) ++ ++/* ++ * LEDs ++ */ ++ ++#define LED_NUML 0x00 ++#define LED_CAPSL 0x01 ++#define LED_SCROLLL 0x02 ++#define LED_COMPOSE 0x03 ++#define LED_KANA 0x04 ++#define LED_SLEEP 0x05 ++#define LED_SUSPEND 0x06 ++#define LED_MUTE 0x07 ++#define LED_MISC 0x08 ++#define LED_MAIL 0x09 ++#define LED_CHARGING 0x0a ++#define LED_MAX 0x0f ++#define LED_CNT (LED_MAX+1) ++ ++/* ++ * Autorepeat values ++ */ ++ ++#define REP_DELAY 0x00 ++#define REP_PERIOD 0x01 ++#define REP_MAX 0x01 ++#define REP_CNT (REP_MAX+1) ++ ++/* ++ * Sounds ++ */ ++ ++#define SND_CLICK 0x00 ++#define SND_BELL 0x01 ++#define SND_TONE 0x02 ++#define SND_MAX 0x07 ++#define SND_CNT (SND_MAX+1) ++ ++#endif diff --git a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch new file mode 100644 index 000000000..e36f9e3c5 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch @@ -0,0 +1,7211 @@ +From 80e5f83c0fc4bf42110cc55ce671ad7ddc7b08a4 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 14 Mar 2016 17:37:09 +0100 +Subject: [PATCH] sunxi: Sync dts files with the upstream kernel + +Sync dts files with the upstream kernel including +changes queued for 4.6: + +https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6 + +Note this adds a number of new unused board dts files. I've asked the +authors of the kernel commits adding these to submit a matching defconfig +to u-boot. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + arch/arm/dts/Makefile | 8 +- + arch/arm/dts/axp22x.dtsi | 145 ++++++++++++ + arch/arm/dts/sun4i-a10-a1000.dts | 4 + + arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 22 ++ + arch/arm/dts/sun4i-a10-cubieboard.dts | 4 + + arch/arm/dts/sun4i-a10-gemei-g9.dts | 63 +++++- + arch/arm/dts/sun4i-a10-inet1.dts | 48 ++++ + arch/arm/dts/sun4i-a10-inet97fv2.dts | 127 ++++++++++- + arch/arm/dts/sun4i-a10-inet9f-rev03.dts | 181 +++++++++++++++ + arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts | 86 +------ + arch/arm/dts/sun4i-a10-jesurun-q5.dts | 15 ++ + arch/arm/dts/sun4i-a10-marsboard.dts | 23 ++ + arch/arm/dts/sun4i-a10-mk802.dts | 37 +++ + arch/arm/dts/sun4i-a10-olinuxino-lime.dts | 12 + + arch/arm/dts/sun4i-a10-pcduino.dts | 58 ++++- + arch/arm/dts/sun4i-a10-pcduino2.dts | 78 +++++++ + arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts | 69 ++++++ + arch/arm/dts/sun4i-a10.dtsi | 153 +++++++++++-- + arch/arm/dts/sun5i-a10s-auxtek-t004.dts | 14 ++ + arch/arm/dts/sun5i-a10s-olinuxino-micro.dts | 2 +- + arch/arm/dts/sun5i-a13-empire-electronix-d709.dts | 19 +- + arch/arm/dts/sun5i-a13-inet-98v-rev2.dts | 26 +-- + arch/arm/dts/sun5i-a13-utoo-p66.dts | 30 +++ + arch/arm/dts/sun5i-q8-common.dtsi | 10 + + arch/arm/dts/sun5i-r8-chip.dts | 47 +++- + arch/arm/dts/sun5i.dtsi | 31 +++ + arch/arm/dts/sun6i-a31-colombus.dts | 24 ++ + arch/arm/dts/sun6i-a31-hummingbird.dts | 132 ++++++----- + arch/arm/dts/sun6i-a31.dtsi | 65 +++++- + arch/arm/dts/sun6i-a31s-primo81.dts | 247 ++++++++++++++++++++- + arch/arm/dts/sun6i-a31s-sina31s-core.dtsi | 142 ++++++++++++ + arch/arm/dts/sun6i-a31s-sina31s.dts | 153 +++++++++++++ + .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | 205 +++++++++++++++++ + arch/arm/dts/sun7i-a20-bananapi.dts | 78 ++++++- + arch/arm/dts/sun7i-a20-cubieboard2.dts | 23 ++ + arch/arm/dts/sun7i-a20-cubietruck.dts | 4 + + arch/arm/dts/sun7i-a20-icnova-swac.dts | 169 ++++++++++++++ + arch/arm/dts/sun7i-a20-itead-ibox.dts | 125 +++++++++++ + arch/arm/dts/sun7i-a20-lamobo-r1.dts | 10 - + arch/arm/dts/sun7i-a20-mk808c.dts | 39 ++++ + arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 95 ++++++-- + arch/arm/dts/sun7i-a20-olinuxino-lime.dts | 12 + + arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 47 ++++ + arch/arm/dts/sun7i-a20-olinuxino-micro.dts | 6 + + arch/arm/dts/sun7i-a20-orangepi-mini.dts | 33 +++ + arch/arm/dts/sun7i-a20-orangepi.dts | 29 +++ + arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 69 +++++- + arch/arm/dts/sun7i-a20-pcduino3.dts | 58 ++++- + arch/arm/dts/sun7i-a20-wexler-tab7200.dts | 90 +++++++- + arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 187 +++++++++++++++- + arch/arm/dts/sun7i-a20.dtsi | 113 +++++++++- + arch/arm/dts/sun8i-a23-a33.dtsi | 71 ++++-- + arch/arm/dts/sun8i-a23-gt90h-v4.dts | 120 +++++++++- + arch/arm/dts/sun8i-a23.dtsi | 25 +++ + arch/arm/dts/sun8i-a33-sinlinx-sina33.dts | 83 ++++++- + arch/arm/dts/sun8i-a33.dtsi | 45 ++++ + arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 65 ++++++ + arch/arm/dts/sun8i-a83t.dtsi | 125 +++++------ + arch/arm/dts/sun8i-h3-orangepi-pc.dts | 69 ++++++ + arch/arm/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++ + arch/arm/dts/sun8i-h3.dtsi | 189 +++++++++++----- + arch/arm/dts/sun8i-q8-common.dtsi | 96 +++++++- + arch/arm/dts/sun9i-a80-cubieboard4.dts | 36 +++ + arch/arm/dts/sun9i-a80-optimus.dts | 48 ++-- + arch/arm/dts/sun9i-a80.dtsi | 204 +++++++++++++++-- + arch/arm/dts/sunxi-itead-core-common.dtsi | 136 ++++++++++++ + arch/arm/dts/sunxi-q8-common.dtsi | 6 + + 67 files changed, 4351 insertions(+), 497 deletions(-) + create mode 100644 arch/arm/dts/axp22x.dtsi + create mode 100644 arch/arm/dts/sun4i-a10-pcduino2.dts + create mode 100644 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi + create mode 100644 arch/arm/dts/sun6i-a31s-sina31s.dts + create mode 100644 arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts + create mode 100644 arch/arm/dts/sun7i-a20-icnova-swac.dts + create mode 100644 arch/arm/dts/sun7i-a20-itead-ibox.dts + create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts + create mode 100644 arch/arm/dts/sunxi-itead-core-common.dtsi + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \ + sun4i-a10-mk802ii.dtb \ + sun4i-a10-olinuxino-lime.dtb \ + sun4i-a10-pcduino.dtb \ ++ sun4i-a10-pcduino2.dtb \ + sun4i-a10-pov-protab2-ips9.dtb + dtb-$(CONFIG_MACH_SUN5I) += \ + sun5i-a10s-auxtek-t003.dtb \ +@@ -155,7 +156,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \ + sun6i-a31-pangolin.dtb \ + sun6i-a31s-cs908.dtb \ + sun6i-a31s-primo81.dtb \ +- sun6i-a31s-sinovoip-bpi-m2.dtb ++ sun6i-a31s-sina31s.dtb \ ++ sun6i-a31s-sinovoip-bpi-m2.dtb \ ++ sun6i-a31s-yones-toptech-bs1078-v2.dtb + dtb-$(CONFIG_MACH_SUN7I) += \ + sun7i-a20-ainol-aw1.dtb \ + sun7i-a20-bananapi.dtb \ +@@ -164,6 +167,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ + sun7i-a20-cubietruck.dtb \ + sun7i-a20-hummingbird.dtb \ + sun7i-a20-i12-tvbox.dtb \ ++ sun7i-a20-icnova-swac.dtb \ ++ sun7i-a20-itead-ibox.dtb \ + sun7i-a20-lamobo-r1.dtb \ + sun7i-a20-m3.dtb \ + sun7i-a20-m5.dtb \ +@@ -190,6 +195,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ + sun8i-a33-sinlinx-sina33.dtb + dtb-$(CONFIG_MACH_SUN8I_A83T) += \ + sun8i-a83t-allwinner-h8homlet-v2.dtb \ ++ sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-sinovoip-bpi-m3.dtb + dtb-$(CONFIG_MACH_SUN8I_H3) += \ + sun8i-h3-orangepi-pc.dtb \ +--- /dev/null ++++ b/arch/arm/dts/axp22x.dtsi +@@ -0,0 +1,145 @@ ++/* ++ * Copyright 2015 Chen-Yu Tsai ++ * ++ * Chen-Yu Tsai ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * AXP221/221s/223 Integrated Power Management Chip ++ * http://www.x-powers.com/product/AXP22X.php ++ * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf ++ */ ++ ++&axp22x { ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ ++ regulators { ++ /* Default work frequency for buck regulators */ ++ x-powers,dcdc-freq = <3000>; ++ ++ reg_dcdc1: dcdc1 { ++ regulator-name = "dcdc1"; ++ }; ++ ++ reg_dcdc2: dcdc2 { ++ regulator-name = "dcdc2"; ++ }; ++ ++ reg_dcdc3: dcdc3 { ++ regulator-name = "dcdc3"; ++ }; ++ ++ reg_dcdc4: dcdc4 { ++ regulator-name = "dcdc4"; ++ }; ++ ++ reg_dcdc5: dcdc5 { ++ regulator-name = "dcdc5"; ++ }; ++ ++ reg_dc1sw: dc1sw { ++ regulator-name = "dc1sw"; ++ }; ++ ++ reg_dc5ldo: dc5ldo { ++ regulator-name = "dc5ldo"; ++ }; ++ ++ reg_aldo1: aldo1 { ++ regulator-name = "aldo1"; ++ }; ++ ++ reg_aldo2: aldo2 { ++ regulator-name = "aldo2"; ++ }; ++ ++ reg_aldo3: aldo3 { ++ regulator-name = "aldo3"; ++ }; ++ ++ reg_dldo1: dldo1 { ++ regulator-name = "dldo1"; ++ }; ++ ++ reg_dldo2: dldo2 { ++ regulator-name = "dldo2"; ++ }; ++ ++ reg_dldo3: dldo3 { ++ regulator-name = "dldo3"; ++ }; ++ ++ reg_dldo4: dldo4 { ++ regulator-name = "dldo4"; ++ }; ++ ++ reg_eldo1: eldo1 { ++ regulator-name = "eldo1"; ++ }; ++ ++ reg_eldo2: eldo2 { ++ regulator-name = "eldo2"; ++ }; ++ ++ reg_eldo3: eldo3 { ++ regulator-name = "eldo3"; ++ }; ++ ++ reg_ldo_io0: ldo_io0 { ++ regulator-name = "ldo_io0"; ++ status = "disabled"; ++ }; ++ ++ reg_ldo_io1: ldo_io1 { ++ regulator-name = "ldo_io1"; ++ status = "disabled"; ++ }; ++ ++ reg_rtc_ldo: rtc_ldo { ++ /* RTC_LDO is a fixed, always-on regulator */ ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "rtc_ldo"; ++ }; ++ }; ++}; +--- a/arch/arm/dts/sun4i-a10-a1000.dts ++++ b/arch/arm/dts/sun4i-a10-a1000.dts +@@ -93,6 +93,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &ehci0 { + status = "okay"; + }; +--- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts ++++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts +@@ -45,6 +45,7 @@ + #include "sunxi-common-regulators.dtsi" + #include + #include ++#include + + / { + model = "Chuwi V7 CW0825"; +@@ -78,6 +79,27 @@ + }; + }; + ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++ ++ ft5306de4: touchscreen@38 { ++ compatible = "edt,edt-ft5406"; ++ reg = <0x38>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; ++ touchscreen-size-x = <1024>; ++ touchscreen-size-y = <768>; ++ }; ++}; ++ + &lradc { + vref-supply = <®_vcc3v0>; + status = "okay"; +--- a/arch/arm/dts/sun4i-a10-cubieboard.dts ++++ b/arch/arm/dts/sun4i-a10-cubieboard.dts +@@ -83,6 +83,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +--- a/arch/arm/dts/sun4i-a10-gemei-g9.dts ++++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts +@@ -47,6 +47,7 @@ + #include "sunxi-common-regulators.dtsi" + #include + #include ++#include + + / { + model = "Gemei G9 Tablet"; +@@ -64,12 +65,22 @@ + /* + * TODO: + * 2x cameras via CSI +- * bma250 IRQs + * AXP battery management + * NAND + * OTG + * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48 + */ ++&codec { ++ /* PH15 controls power to external amplifier (ft2012q) */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&codec_pa_pin>; ++ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; + + &ehci0 { + status = "okay"; +@@ -85,15 +96,13 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupts = <0>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + ++#include "axp209.dtsi" ++ + &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; +@@ -103,17 +112,13 @@ + bma250@18 { + compatible = "bosch,bma250"; + reg = <0x18>; +- +- /* +- * TODO: interrupt pins: +- * int1 - PH00 +- * int2 - PI10 +- */ ++ interrupt-parent = <&pio>; ++ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */ + }; + }; + + &lradc { +- vref-supply = <®_vcc3v0>; ++ vref-supply = <®_ldo2>; + + status = "okay"; + +@@ -149,6 +154,40 @@ + status = "okay"; + }; + ++&pio { ++ codec_pa_pin: codec_pa_pin@0 { ++ allwinner,pins = "PH15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1250000>; ++ regulator-max-microvolt = <1250000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +--- a/arch/arm/dts/sun4i-a10-inet1.dts ++++ b/arch/arm/dts/sun4i-a10-inet1.dts +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + / { + model = "iNet-1"; +@@ -56,11 +57,25 @@ + serial0 = &uart0; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bl_en_pin_inet>; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +@@ -104,6 +119,19 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; ++ ++ ft5x: touchscreen@38 { ++ compatible = "edt,edt-ft5406"; ++ reg = <0x38>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&touchscreen_wake_pin>; ++ wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ ++ touchscreen-size-x = <600>; ++ touchscreen-size-y = <1024>; ++ touchscreen-swapped-x-y; ++ }; + }; + + &lradc { +@@ -151,6 +179,20 @@ + }; + + &pio { ++ bl_en_pin_inet: bl_en_pin@0 { ++ allwinner,pins = "PH7"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ touchscreen_wake_pin: touchscreen_wake_pin@0 { ++ allwinner,pins = "PB13"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb0_id_detect_pin: usb0_id_detect_pin@0 { + allwinner,pins = "PH4"; + allwinner,function = "gpio_in"; +@@ -166,6 +208,12 @@ + }; + }; + ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins_a>; ++ status = "okay"; ++}; ++ + ®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; +--- a/arch/arm/dts/sun4i-a10-inet97fv2.dts ++++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts +@@ -47,6 +47,8 @@ + #include "sunxi-common-regulators.dtsi" + + #include ++#include ++#include + + / { + model = "INet-97F Rev 02"; +@@ -61,8 +63,8 @@ + }; + }; + +-&ehci0 { +- status = "okay"; ++&cpu0 { ++ cpu-supply = <®_dcdc2>; + }; + + &ehci1 { +@@ -75,12 +77,71 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupts = <0>; ++ }; ++}; ++ ++#include "axp209.dtsi" ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++ ++ ft5406ee8: touchscreen@38 { ++ compatible = "edt,edt-ft5406"; ++ reg = <0x38>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; ++ touchscreen-size-x = <800>; ++ touchscreen-size-y = <480>; ++ }; ++}; ++ ++&lradc { ++ vref-supply = <®_ldo2>; ++ status = "okay"; ++ ++ button@200 { ++ label = "Menu"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <200000>; ++ }; ++ ++ button@600 { ++ label = "Volume Up"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <600000>; ++ }; + +- interrupt-controller; +- #interrupt-cells = <1>; ++ button@800 { ++ label = "Volume Down"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <800000>; ++ }; ++ ++ button@1000 { ++ label = "Home"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <1000000>; ++ }; ++ ++ button@1200 { ++ label = "Esc"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <1200000>; + }; + }; + +@@ -94,15 +155,52 @@ + status = "okay"; + }; + +-&ohci0 { ++&otg_sram { + status = "okay"; + }; + +-&ohci1 { +- status = "okay"; ++&pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { ++ allwinner,pins = "PH5"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; + }; + +-®_usb1_vbus { ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1250000>; ++ regulator-max-microvolt = <1250000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb0_vbus { + status = "okay"; + }; + +@@ -116,8 +214,17 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { +- usb1_vbus-supply = <®_usb1_vbus>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ ++ usb0_vbus-supply = <®_usb0_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; + }; +--- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts ++++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts +@@ -59,6 +59,159 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ gpio_keys { ++ compatible = "gpio-keys-polled"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&key_pins_inet9f>; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ poll-interval = <20>; ++ ++ button@0 { ++ label = "Left Joystick Left"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ ++ }; ++ ++ button@1 { ++ label = "Left Joystick Right"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ ++ }; ++ ++ button@2 { ++ label = "Left Joystick Up"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ ++ }; ++ ++ button@3 { ++ label = "Left Joystick Down"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ ++ }; ++ ++ button@4 { ++ label = "Right Joystick Left"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ ++ }; ++ ++ button@5 { ++ label = "Right Joystick Right"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ ++ }; ++ ++ button@6 { ++ label = "Right Joystick Up"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ ++ }; ++ ++ button@7 { ++ label = "Right Joystick Down"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ ++ }; ++ ++ button@8 { ++ label = "DPad Left"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */ ++ }; ++ ++ button@9 { ++ label = "DPad Right"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */ ++ }; ++ ++ button@10 { ++ label = "DPad Up"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <0xffffffff>; /* -1 */ ++ gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */ ++ }; ++ ++ button@11 { ++ label = "DPad Down"; ++ linux,code = ; ++ linux,input-type = ; ++ linux,input-value = <1>; ++ gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */ ++ }; ++ ++ button@12 { ++ label = "Button X"; ++ linux,code = ; ++ gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */ ++ }; ++ ++ button@13 { ++ label = "Button Y"; ++ linux,code = ; ++ gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */ ++ }; ++ ++ button@14 { ++ label = "Button A"; ++ linux,code = ; ++ gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */ ++ }; ++ ++ button@15 { ++ label = "Button B"; ++ linux,code = ; ++ gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */ ++ }; ++ ++ button@16 { ++ label = "Select Button"; ++ linux,code = ; ++ gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ ++ }; ++ ++ button@17 { ++ label = "Start Button"; ++ linux,code = ; ++ gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ ++ }; ++ ++ button@18 { ++ label = "Top Left Button"; ++ linux,code = ; ++ gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */ ++ }; ++ ++ button@19 { ++ label = "Top Right Button"; ++ linux,code = ; ++ gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */ ++ }; ++ }; + }; + + &cpu0 { +@@ -86,12 +239,29 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; ++ ++ /* Accelerometer */ ++ bma250@18 { ++ compatible = "bosch,bma250"; ++ reg = <0x18>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ ++ }; + }; + + &i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; ++ ++ ft5406ee8: touchscreen@38 { ++ compatible = "edt,edt-ft5406"; ++ reg = <0x38>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; ++ touchscreen-size-x = <800>; ++ touchscreen-size-y = <480>; ++ }; + }; + + &lradc { +@@ -149,6 +319,17 @@ + }; + + &pio { ++ key_pins_inet9f: key_pins@0 { ++ allwinner,pins = "PA0", "PA1", "PA3", "PA4", ++ "PA5", "PA6", "PA8", "PA9", ++ "PA11", "PA12", "PA13", ++ "PA14", "PA15", "PA16", "PA17", ++ "PH22", "PH23", "PH24", "PH25", "PH26"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb0_id_detect_pin: usb0_id_detect_pin@0 { + allwinner,pins = "PH4"; + allwinner,function = "gpio_in"; +--- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts ++++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts +@@ -1,5 +1,6 @@ + /* + * Copyright 2015 Josef Gajdusek ++ * Copyright 2015 - Marcus Cooper + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual +@@ -42,22 +43,11 @@ + + /dts-v1/; + #include "sun4i-a10.dtsi" +-#include "sunxi-common-regulators.dtsi" +- +-#include +-#include ++#include "sunxi-itead-core-common.dtsi" + + / { + model = "Iteaduino Plus A10"; + compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10"; +- +- aliases { +- serial0 = &uart0; +- }; +- +- chosen { +- stdout-path = "serial0:115200n8"; +- }; + }; + + &ahci { +@@ -65,18 +55,6 @@ + status = "okay"; + }; + +-&cpu0 { +- cpu-supply = <®_dcdc2>; +-}; +- +-&ehci0 { +- status = "okay"; +-}; +- +-&ehci1 { +- status = "okay"; +-}; +- + &emac { + pinctrl-names = "default"; + pinctrl-0 = <&emac_pins_a>; +@@ -89,12 +67,7 @@ + }; + + &i2c0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2c0_pins_a>; +- status = "okay"; +- + axp209: pmic@34 { +- reg = <0x34>; + interrupts = <0>; + }; + }; +@@ -135,68 +108,13 @@ + status = "okay"; + }; + +-&ohci0 { +- status = "okay"; +-}; +- +-&ohci1 { +- status = "okay"; +-}; +- + ®_ahci_5v { + status = "okay"; + }; + +-#include "axp209.dtsi" +- +-®_dcdc2 { +- regulator-always-on; +- regulator-min-microvolt = <1000000>; +- regulator-max-microvolt = <1450000>; +- regulator-name = "vdd-cpu"; +-}; +- +-®_dcdc3 { +- regulator-always-on; +- regulator-min-microvolt = <1000000>; +- regulator-max-microvolt = <1400000>; +- regulator-name = "vdd-int-dll"; +-}; +- +-®_ldo1 { +- regulator-name = "vdd-rtc"; +-}; +- +-®_ldo2 { +- regulator-always-on; +- regulator-min-microvolt = <3000000>; +- regulator-max-microvolt = <3000000>; +- regulator-name = "avcc"; +-}; +- +-®_usb1_vbus { +- status = "okay"; +-}; +- +-®_usb2_vbus { +- status = "okay"; +-}; +- + &spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_pins_a>, + <&spi0_cs0_pins_a>; + status = "okay"; + }; +- +-&uart0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart0_pins_a>; +- status = "okay"; +-}; +- +-&usbphy { +- usb1_vbus-supply = <®_usb1_vbus>; +- usb2_vbus-supply = <®_usb2_vbus>; +- status = "okay"; +-}; +--- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts ++++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts +@@ -156,6 +156,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + emac_power_pin_q5: emac_power_pin@0 { + allwinner,pins = "PH19"; +@@ -172,6 +176,11 @@ + }; + }; + ++®_usb0_vbus { ++ regulator-boot-on; ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -186,7 +195,13 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ + &usbphy { ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun4i-a10-marsboard.dts ++++ b/arch/arm/dts/sun4i-a10-marsboard.dts +@@ -91,6 +91,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -154,6 +158,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + led_pins_marsboard: led_pins@0 { + allwinner,pins = "PB5", "PB6", "PB7", "PB8"; +@@ -161,6 +169,13 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + ®_usb1_vbus { +@@ -184,7 +199,15 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun4i-a10-mk802.dts ++++ b/arch/arm/dts/sun4i-a10-mk802.dts +@@ -44,6 +44,7 @@ + #include "sun4i-a10.dtsi" + #include "sunxi-common-regulators.dtsi" + #include ++#include + + / { + model = "MK802"; +@@ -58,6 +59,10 @@ + }; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -80,7 +85,25 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { ++ allwinner,pins = "PH5"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb2_vbus_pin_mk802: usb2_vbus_pin@0 { + allwinner,pins = "PH12"; + allwinner,function = "gpio_out"; +@@ -89,6 +112,10 @@ + }; + }; + ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -105,7 +132,17 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; ++ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts ++++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts +@@ -124,6 +124,18 @@ + }; + }; + ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c16"; ++ reg = <0x50>; ++ pagesize = <16>; ++ }; ++}; ++ + &mdio { + status = "okay"; + +--- a/arch/arm/dts/sun4i-a10-pcduino.dts ++++ b/arch/arm/dts/sun4i-a10-pcduino.dts +@@ -104,6 +104,10 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -129,12 +133,8 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupts = <0>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -164,6 +164,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + led_pins_pcduino: led_pins@0 { + allwinner,pins = "PH15", "PH16"; +@@ -178,14 +182,40 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + +-®_usb1_vbus { +- status = "okay"; ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; + }; + +-®_usb2_vbus { +- status = "okay"; ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; + }; + + &uart0 { +@@ -194,8 +224,16 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { +- usb1_vbus-supply = <®_usb1_vbus>; +- usb2_vbus-supply = <®_usb2_vbus>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb1_vbus-supply = <®_vcc5v0>; /* USB1 VBUS is always on */ ++ usb2_vbus-supply = <®_vcc5v0>; /* USB2 VBUS is always on */ + status = "okay"; + }; +--- /dev/null ++++ b/arch/arm/dts/sun4i-a10-pcduino2.dts +@@ -0,0 +1,78 @@ ++/* ++ * Copyright 2015 Siarhei Siamashka ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* ++ * The LinkSprite pcDuino2 board is almost identical to the older ++ * LinkSprite pcDuino1 board. The only software visible difference ++ * is that the pcDuino2 board got a USB VBUS voltage regulator, which ++ * is controlled by the PD2 pin (pulled-up by default). Also one of ++ * the USB host ports has been replaced with a USB WIFI chip. ++ */ ++ ++#include "sun4i-a10-pcduino.dts" ++ ++/ { ++ model = "LinkSprite pcDuino2"; ++ compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10"; ++}; ++ ++&pio { ++ usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 { ++ allwinner,pins = "PD2"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_usb2_vbus { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb2_vbus_pin_pcduino2>; ++ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_vcc3v3>; /* USB WIFI is always on */ ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++}; +--- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts ++++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts +@@ -47,6 +47,7 @@ + #include + #include + #include ++#include + + / { + model = "Point of View Protab2-IPS9"; +@@ -56,11 +57,28 @@ + serial0 = &uart0; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bl_en_pin_protab>; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; + }; + ++&codec { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&codec_pa_pin>; ++ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +@@ -86,12 +104,36 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; ++ ++ /* Accelerometer */ ++ bma250@18 { ++ compatible = "bosch,bma250"; ++ reg = <0x18>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ ++ }; + }; + + &i2c2 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; ++ ++ pixcir_ts@5c { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&touchscreen_pins>; ++ compatible = "pixcir,pixcir_tangoc"; ++ reg = <0x5c>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ ++ attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */ ++ enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; ++ wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>; ++ touchscreen-size-x = <1024>; ++ touchscreen-size-y = <768>; ++ touchscreen-inverted-x; ++ touchscreen-inverted-y; ++ }; + }; + + &lradc { +@@ -128,6 +170,27 @@ + }; + + &pio { ++ bl_en_pin_protab: bl_en_pin@0 { ++ allwinner,pins = "PH7"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ codec_pa_pin: codec_pa_pin@0 { ++ allwinner,pins = "PH15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ touchscreen_pins: touchscreen_pins@0 { ++ allwinner,pins = "PA5", "PB13"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb0_id_detect_pin: usb0_id_detect_pin@0 { + allwinner,pins = "PH4"; + allwinner,function = "gpio_in"; +@@ -143,6 +206,12 @@ + }; + }; + ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins_a>; ++ status = "okay"; ++}; ++ + ®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; +--- a/arch/arm/dts/sun4i-a10.dtsi ++++ b/arch/arm/dts/sun4i-a10.dtsi +@@ -45,6 +45,7 @@ + + #include + ++#include + #include + #include + +@@ -65,7 +66,7 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, +- <&ahb_gates 44>; ++ <&ahb_gates 44>, <&dram_gates 26>; + status = "disabled"; + }; + +@@ -74,7 +75,8 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, +- <&ahb_gates 44>, <&ahb_gates 46>; ++ <&ahb_gates 44>, <&ahb_gates 46>, ++ <&dram_gates 25>, <&dram_gates 26>; + status = "disabled"; + }; + +@@ -83,7 +85,8 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_fe0-de_be0-lcd0"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, +- <&ahb_gates 46>; ++ <&ahb_gates 46>, <&dram_gates 25>, ++ <&dram_gates 26>; + status = "disabled"; + }; + +@@ -92,7 +95,8 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; + clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, +- <&ahb_gates 44>, <&ahb_gates 46>; ++ <&ahb_gates 44>, <&ahb_gates 46>, ++ <&dram_gates 25>, <&dram_gates 26>; + status = "disabled"; + }; + }; +@@ -195,6 +199,15 @@ + clock-output-names = "pll1"; + }; + ++ pll2: clk@01c20008 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun4i-a10-pll2-clk"; ++ reg = <0x01c20008 0x8>; ++ clocks = <&osc24M>; ++ clock-output-names = "pll2-1x", "pll2-2x", ++ "pll2-4x", "pll2-8x"; ++ }; ++ + pll4: clk@01c20018 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-pll1-clk"; +@@ -241,6 +254,7 @@ + compatible = "allwinner,sun4i-a10-axi-gates-clk"; + reg = <0x01c2005c 0x4>; + clocks = <&axi>; ++ clock-indices = <0>; + clock-output-names = "axi_dram"; + }; + +@@ -257,17 +271,36 @@ + compatible = "allwinner,sun4i-a10-ahb-gates-clk"; + reg = <0x01c20060 0x8>; + clocks = <&ahb>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, ++ <4>, <5>, <6>, ++ <7>, <8>, <9>, ++ <10>, <11>, <12>, ++ <13>, <14>, <16>, ++ <17>, <18>, <20>, ++ <21>, <22>, <23>, ++ <24>, <25>, <26>, ++ <32>, <33>, <34>, ++ <35>, <36>, <37>, ++ <40>, <41>, <43>, ++ <44>, <45>, ++ <46>, <47>, ++ <50>, <52>; + clock-output-names = "ahb_usb0", "ahb_ehci0", +- "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss", +- "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1", +- "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand", +- "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts", +- "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3", +- "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve", +- "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0", +- "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi", +- "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0", +- "ahb_de_fe1", "ahb_mp", "ahb_mali400"; ++ "ahb_ohci0", "ahb_ehci1", ++ "ahb_ohci1", "ahb_ss", "ahb_dma", ++ "ahb_bist", "ahb_mmc0", "ahb_mmc1", ++ "ahb_mmc2", "ahb_mmc3", "ahb_ms", ++ "ahb_nand", "ahb_sdram", "ahb_ace", ++ "ahb_emac", "ahb_ts", "ahb_spi0", ++ "ahb_spi1", "ahb_spi2", "ahb_spi3", ++ "ahb_pata", "ahb_sata", "ahb_gps", ++ "ahb_ve", "ahb_tvd", "ahb_tve0", ++ "ahb_tve1", "ahb_lcd0", "ahb_lcd1", ++ "ahb_csi0", "ahb_csi1", "ahb_hdmi", ++ "ahb_de_be0", "ahb_de_be1", ++ "ahb_de_fe0", "ahb_de_fe1", ++ "ahb_mp", "ahb_mali400"; + }; + + apb0: apb0@01c20054 { +@@ -283,9 +316,14 @@ + compatible = "allwinner,sun4i-a10-apb0-gates-clk"; + reg = <0x01c20068 0x4>; + clocks = <&apb0>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, ++ <5>, <6>, ++ <7>, <10>; + clock-output-names = "apb0_codec", "apb0_spdif", +- "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0", +- "apb0_ir1", "apb0_keypad"; ++ "apb0_ac97", "apb0_iis", ++ "apb0_pio", "apb0_ir0", ++ "apb0_ir1", "apb0_keypad"; + }; + + apb1: clk@01c20058 { +@@ -301,12 +339,22 @@ + compatible = "allwinner,sun4i-a10-apb1-gates-clk"; + reg = <0x01c2006c 0x4>; + clocks = <&apb1>; ++ clock-indices = <0>, <1>, ++ <2>, <4>, ++ <5>, <6>, ++ <7>, <16>, ++ <17>, <18>, ++ <19>, <20>, ++ <21>, <22>, ++ <23>; + clock-output-names = "apb1_i2c0", "apb1_i2c1", +- "apb1_i2c2", "apb1_can", "apb1_scr", +- "apb1_ps20", "apb1_ps21", "apb1_uart0", +- "apb1_uart1", "apb1_uart2", "apb1_uart3", +- "apb1_uart4", "apb1_uart5", "apb1_uart6", +- "apb1_uart7"; ++ "apb1_i2c2", "apb1_can", ++ "apb1_scr", "apb1_ps20", ++ "apb1_ps21", "apb1_uart0", ++ "apb1_uart1", "apb1_uart2", ++ "apb1_uart3", "apb1_uart4", ++ "apb1_uart5", "apb1_uart6", ++ "apb1_uart7"; + }; + + nand_clk: clk@01c20080 { +@@ -446,6 +494,48 @@ + clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; + clock-output-names = "spi3"; + }; ++ ++ dram_gates: clk@01c20100 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun4i-a10-dram-gates-clk"; ++ reg = <0x01c20100 0x4>; ++ clocks = <&pll5 0>; ++ clock-indices = <0>, ++ <1>, <2>, ++ <3>, ++ <4>, ++ <5>, <6>, ++ <15>, ++ <24>, <25>, ++ <26>, <27>, ++ <28>, <29>; ++ clock-output-names = "dram_ve", ++ "dram_csi0", "dram_csi1", ++ "dram_ts", ++ "dram_tvd", ++ "dram_tve0", "dram_tve1", ++ "dram_output", ++ "dram_de_fe1", "dram_de_fe0", ++ "dram_de_be0", "dram_de_be1", ++ "dram_de_mp", "dram_ace"; ++ }; ++ ++ ve_clk: clk@01c2013c { ++ #clock-cells = <0>; ++ #reset-cells = <0>; ++ compatible = "allwinner,sun4i-a10-ve-clk"; ++ reg = <0x01c2013c 0x4>; ++ clocks = <&pll4>; ++ clock-output-names = "ve"; ++ }; ++ ++ codec_clk: clk@01c20140 { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-codec-clk"; ++ reg = <0x01c20140 0x4>; ++ clocks = <&pll2 SUN4I_A10_PLL2_1X>; ++ clock-output-names = "codec"; ++ }; + }; + + soc@01c00000 { +@@ -656,6 +746,14 @@ + status = "disabled"; + }; + ++ crypto: crypto-engine@01c15000 { ++ compatible = "allwinner,sun4i-a10-crypto"; ++ reg = <0x01c15000 0x1000>; ++ interrupts = <86>; ++ clocks = <&ahb_gates 5>, <&ss_clk>; ++ clock-names = "ahb", "mod"; ++ }; ++ + spi2: spi@01c17000 { + compatible = "allwinner,sun4i-a10-spi"; + reg = <0x01c17000 0x1000>; +@@ -961,6 +1059,19 @@ + status = "disabled"; + }; + ++ codec: codec@01c22c00 { ++ #sound-dai-cells = <0>; ++ compatible = "allwinner,sun4i-a10-codec"; ++ reg = <0x01c22c00 0x40>; ++ interrupts = <30>; ++ clocks = <&apb0_gates 0>, <&codec_clk>; ++ clock-names = "apb", "codec"; ++ dmas = <&dma SUN4I_DMA_NORMAL 19>, ++ <&dma SUN4I_DMA_NORMAL 19>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ + sid: eeprom@01c23800 { + compatible = "allwinner,sun4i-a10-sid"; + reg = <0x01c23800 0x10>; +--- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts ++++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts +@@ -86,6 +86,20 @@ + status = "okay"; + }; + ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp152: pmic@30 { ++ compatible = "x-powers,axp152"; ++ reg = <0x30>; ++ interrupts = <0>; ++ interrupt-controller; ++ #interrupt-cells = <1>; ++ }; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>; +--- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts ++++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts +@@ -111,7 +111,7 @@ + status = "okay"; + + at24@50 { +- compatible = "at,24c16"; ++ compatible = "atmel,24c16"; + pagesize = <16>; + reg = <0x50>; + read-only; +--- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts ++++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts +@@ -123,7 +123,7 @@ + + &mmc0 { + pinctrl-names = "default"; +- pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>; + vmmc-supply = <®_vcc3v3>; + bus-width = <4>; + cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ +@@ -131,27 +131,12 @@ + status = "okay"; + }; + +-&mmc2 { +- pinctrl-names = "default"; +- pinctrl-0 = <&mmc2_pins_a>; +- vmmc-supply = <®_vcc3v3>; +- bus-width = <8>; +- non-removable; +- status = "okay"; +- +- mmccard: mmccard@0 { +- reg = <0>; +- compatible = "mmc-card"; +- broken-hpi; +- }; +-}; +- + &otg_sram { + status = "okay"; + }; + + &pio { +- mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 { ++ mmc0_cd_pin_d709: mmc0_cd_pin@0 { + allwinner,pins = "PG0"; + allwinner,function = "gpio_in"; + allwinner,drive = ; +--- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts ++++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts +@@ -123,21 +123,6 @@ + status = "okay"; + }; + +-&mmc2 { +- pinctrl-names = "default"; +- pinctrl-0 = <&mmc2_pins_a>; +- vmmc-supply = <®_vcc3v3>; +- bus-width = <8>; +- non-removable; +- status = "okay"; +- +- mmccard: mmccard@0 { +- reg = <0>; +- compatible = "mmc-card"; +- broken-hpi; +- }; +-}; +- + &otg_sram { + status = "okay"; + }; +@@ -201,11 +186,6 @@ + status = "okay"; + }; + +-®_usb1_vbus { +- gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ +- status = "okay"; +-}; +- + &uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins_b>; +@@ -221,16 +201,12 @@ + allwinner,pins = "PG12"; + }; + +-&usb1_vbus_pin_a { +- allwinner,pins = "PG11"; +-}; +- + &usbphy { + pinctrl-names = "default"; + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; + usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ + usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ + usb0_vbus-supply = <®_usb0_vbus>; +- usb1_vbus-supply = <®_usb1_vbus>; ++ usb1_vbus-supply = <®_ldo3>; + status = "okay"; + }; +--- a/arch/arm/dts/sun5i-a13-utoo-p66.dts ++++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts +@@ -47,11 +47,21 @@ + #include + #include + #include ++#include + + / { + model = "Utoo P66"; + compatible = "utoo,p66", "allwinner,sun5i-a13"; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ /* Note levels of 10 / 20% result in backlight off */ ++ brightness-levels = <0 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <6>; ++ /* TODO: backlight uses axp gpio1 as enable pin */ ++ }; ++ + i2c_lcd: i2c@0 { + /* The lcd panel i2c interface is hooked up via gpios */ + compatible = "i2c-gpio"; +@@ -63,6 +73,13 @@ + }; + }; + ++&codec { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&codec_pa_pin>; ++ allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +@@ -158,6 +175,13 @@ + }; + + &pio { ++ codec_pa_pin: codec_pa_pin@0 { ++ allwinner,pins = "PG3"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_p66: mmc0_cd_pin@0 { + allwinner,pins = "PG0"; + allwinner,function = "gpio_in"; +@@ -201,6 +225,12 @@ + }; + }; + ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins>; ++ status = "okay"; ++}; ++ + ®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; +--- a/arch/arm/dts/sun5i-q8-common.dtsi ++++ b/arch/arm/dts/sun5i-q8-common.dtsi +@@ -41,11 +41,21 @@ + */ + #include "sunxi-q8-common.dtsi" + ++#include ++ + / { + aliases { + serial0 = &uart1; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ /* TODO: backlight uses axp gpio1 as enable pin */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +--- a/arch/arm/dts/sun5i-r8-chip.dts ++++ b/arch/arm/dts/sun5i-r8-chip.dts +@@ -64,6 +64,26 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ wifi_reg_on: wifi_reg_on { ++ compatible = "regulator-fixed"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&chip_wifi_reg_on_pin>; ++ ++ regulator-name = "wifi-reg-on"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */ ++ enable-active-high; ++ }; ++}; ++ ++&codec { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; + }; + + &ehci0 { +@@ -109,10 +129,14 @@ + }; + }; + ++&mmc0_pins_a { ++ allwinner,pull = ; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>; +- vmmc-supply = <®_vcc3v3>; ++ vmmc-supply = <&wifi_reg_on>; + bus-width = <4>; + non-removable; + status = "okay"; +@@ -134,6 +158,13 @@ + allwinner,pull = ; + }; + ++ chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 { ++ allwinner,pins = "PC19"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + chip_id_det_pin: chip_id_det_pin@0 { + allwinner,pins = "PG2"; + allwinner,function = "gpio_in"; +@@ -167,6 +198,20 @@ + regulator-always-on; + }; + ++®_ldo3 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vdd-wifi1"; ++ regulator-always-on; ++}; ++ ++®_ldo4 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vdd-wifi2"; ++ regulator-always-on; ++}; ++ + ®_ldo5 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; +--- a/arch/arm/dts/sun5i.dtsi ++++ b/arch/arm/dts/sun5i.dtsi +@@ -44,6 +44,7 @@ + + #include "skeleton.dtsi" + ++#include + #include + #include + +@@ -102,6 +103,15 @@ + clock-output-names = "pll1"; + }; + ++ pll2: clk@01c20008 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun5i-a13-pll2-clk"; ++ reg = <0x01c20008 0x8>; ++ clocks = <&osc24M>; ++ clock-output-names = "pll2-1x", "pll2-2x", ++ "pll2-4x", "pll2-8x"; ++ }; ++ + pll4: clk@01c20018 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-pll1-clk"; +@@ -285,6 +295,14 @@ + clock-output-names = "usb_ohci0", "usb_phy"; + }; + ++ codec_clk: clk@01c20140 { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-codec-clk"; ++ reg = <0x01c20140 0x4>; ++ clocks = <&pll2 SUN4I_A10_PLL2_1X>; ++ clock-output-names = "codec"; ++ }; ++ + mbus_clk: clk@01c2015c { + #clock-cells = <0>; + compatible = "allwinner,sun5i-a13-mbus-clk"; +@@ -571,6 +589,19 @@ + status = "disabled"; + }; + ++ codec: codec@01c22c00 { ++ #sound-dai-cells = <0>; ++ compatible = "allwinner,sun4i-a10-codec"; ++ reg = <0x01c22c00 0x40>; ++ interrupts = <30>; ++ clocks = <&apb0_gates 0>, <&codec_clk>; ++ clock-names = "apb", "codec"; ++ dmas = <&dma SUN4I_DMA_NORMAL 19>, ++ <&dma SUN4I_DMA_NORMAL 19>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ + sid: eeprom@01c23800 { + compatible = "allwinner,sun4i-a10-sid"; + reg = <0x01c23800 0x10>; +--- a/arch/arm/dts/sun6i-a31-colombus.dts ++++ b/arch/arm/dts/sun6i-a31-colombus.dts +@@ -60,6 +60,16 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ i2c_lcd: i2c@0 { ++ /* The lcd panel i2c interface is hooked up via gpios */ ++ compatible = "i2c-gpio"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c_lcd_pins>; ++ gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */ ++ <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */ ++ i2c-gpio,delay-us = <5>; ++ }; + }; + + &ehci1 { +@@ -94,6 +104,13 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; ++ ++ mma8452: mma8452@1d { ++ compatible = "fsl,mma8452"; ++ reg = <0x1d>; ++ interrupt-parent = <&pio>; ++ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */ ++ }; + }; + + &mmc0 { +@@ -124,6 +141,13 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ i2c_lcd_pins: i2c_lcd_pin@0 { ++ allwinner,pins = "PA23", "PA24"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + ®_usb2_vbus { +--- a/arch/arm/dts/sun6i-a31-hummingbird.dts ++++ b/arch/arm/dts/sun6i-a31-hummingbird.dts +@@ -54,6 +54,8 @@ + compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31"; + + aliases { ++ rtc0 = &pcf8563; ++ rtc1 = &rtc; + serial0 = &uart0; + }; + +@@ -67,13 +69,17 @@ + }; + }; + ++&cpu0 { ++ cpu-supply = <®_dcdc3>; ++}; ++ + &ehci0 { + status = "okay"; + }; + + &gmac { + pinctrl-names = "default"; +- pinctrl-0 = <&gmac_pins_rgmii_a>; ++ pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>; + phy = <&phy1>; + phy-mode = "rgmii"; + snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; +@@ -119,7 +125,7 @@ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; +- vmmc-supply = <&vcc_3v0>; ++ vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ + cd-inverted; +@@ -134,7 +140,7 @@ + &mmc1 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>; +- vmmc-supply = <&vcc_wifi>; ++ vmmc-supply = <®_aldo1>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; +@@ -146,6 +152,13 @@ + }; + + &pio { ++ gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 { ++ allwinner,pins = "PA21"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 { + allwinner,pins = "PA8"; + allwinner,function = "gpio_in"; +@@ -164,70 +177,69 @@ + &p2wi { + status = "okay"; + +- axp221: pmic@68 { ++ axp22x: pmic@68 { + compatible = "x-powers,axp221"; + reg = <0x68>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; +- interrupt-controller; +- #interrupt-cells = <1>; +- dcdc1-supply = <&vcc_3v0>; +- dcdc5-supply = <&vcc_dram>; +- +- regulators { +- x-powers,dcdc-freq = <3000>; +- +- vcc_3v0: dcdc1 { +- regulator-always-on; +- regulator-min-microvolt = <3000000>; +- regulator-max-microvolt = <3000000>; +- regulator-name = "vcc-3v0"; +- }; +- +- vdd_cpu: dcdc2 { +- regulator-always-on; +- regulator-min-microvolt = <700000>; +- regulator-max-microvolt = <1320000>; +- regulator-name = "vdd-cpu"; +- }; +- +- vdd_gpu: dcdc3 { +- regulator-always-on; +- regulator-min-microvolt = <700000>; +- regulator-max-microvolt = <1320000>; +- regulator-name = "vdd-gpu"; +- }; +- +- vdd_sys_dll: dcdc4 { +- regulator-always-on; +- regulator-min-microvolt = <1100000>; +- regulator-max-microvolt = <1100000>; +- regulator-name = "vdd-sys-dll"; +- }; +- +- vcc_dram: dcdc5 { +- regulator-always-on; +- regulator-min-microvolt = <1500000>; +- regulator-max-microvolt = <1500000>; +- regulator-name = "vcc-dram"; +- }; +- +- vcc_wifi: aldo1 { +- regulator-min-microvolt = <3300000>; +- regulator-max-microvolt = <3300000>; +- regulator-name = "vcc_wifi"; +- }; +- +- avcc: aldo3 { +- regulator-always-on; +- regulator-min-microvolt = <3000000>; +- regulator-max-microvolt = <3000000>; +- regulator-name = "avcc"; +- }; +- }; + }; + }; + ++#include "axp22x.dtsi" ++ ++®_aldo1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "avcc"; ++}; ++ ++®_dc5ldo { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-gpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc4 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-sys-dll"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ + ®_usb1_vbus { + gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */ + status = "okay"; +--- a/arch/arm/dts/sun6i-a31.dtsi ++++ b/arch/arm/dts/sun6i-a31.dtsi +@@ -61,7 +61,7 @@ + #size-cells = <1>; + ranges; + +- framebuffer@0 { ++ simplefb_hdmi: framebuffer@0 { + compatible = "allwinner,simple-framebuffer", + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0-hdmi"; +@@ -69,7 +69,7 @@ + status = "disabled"; + }; + +- framebuffer@1 { ++ simplefb_lcd: framebuffer@1 { + compatible = "allwinner,simple-framebuffer", + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0"; +@@ -252,6 +252,20 @@ + compatible = "allwinner,sun6i-a31-ahb1-gates-clk"; + reg = <0x01c20060 0x8>; + clocks = <&ahb1>; ++ clock-indices = <1>, <5>, ++ <6>, <8>, <9>, ++ <10>, <11>, <12>, ++ <13>, <14>, ++ <17>, <18>, <19>, ++ <20>, <21>, <22>, ++ <23>, <24>, <26>, ++ <27>, <29>, ++ <30>, <31>, <32>, ++ <36>, <37>, <40>, ++ <43>, <44>, <45>, ++ <46>, <47>, <50>, ++ <52>, <55>, <56>, ++ <57>, <58>; + clock-output-names = "ahb1_mipidsi", "ahb1_ss", + "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1", + "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1", +@@ -281,6 +295,9 @@ + compatible = "allwinner,sun6i-a31-apb1-gates-clk"; + reg = <0x01c20068 0x4>; + clocks = <&apb1>; ++ clock-indices = <0>, <4>, ++ <5>, <12>, ++ <13>; + clock-output-names = "apb1_codec", "apb1_digital_mic", + "apb1_pio", "apb1_daudio0", + "apb1_daudio1"; +@@ -299,6 +316,10 @@ + compatible = "allwinner,sun6i-a31-apb2-gates-clk"; + reg = <0x01c2006c 0x4>; + clocks = <&apb2>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, <16>, ++ <17>, <18>, <19>, ++ <20>, <21>; + clock-output-names = "apb2_i2c0", "apb2_i2c1", + "apb2_i2c2", "apb2_i2c3", + "apb2_uart0", "apb2_uart1", +@@ -346,6 +367,14 @@ + "mmc3_sample"; + }; + ++ ss_clk: clk@01c2009c { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ reg = <0x01c2009c 0x4>; ++ clocks = <&osc24M>, <&pll6 0>; ++ clock-output-names = "ss"; ++ }; ++ + spi0_clk: clk@01c200a0 { + #clock-cells = <0>; + compatible = "allwinner,sun4i-a10-mod0-clk"; +@@ -384,6 +413,9 @@ + compatible = "allwinner,sun6i-a31-usb-clk"; + reg = <0x01c200cc 0x4>; + clocks = <&osc24M>; ++ clock-indices = <8>, <9>, <10>, ++ <16>, <17>, ++ <18>; + clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2", + "usb_ohci0", "usb_ohci1", + "usb_ohci2"; +@@ -684,6 +716,16 @@ + allwinner,pull = ; + }; + ++ mmc3_8bit_emmc_pins: mmc3@1 { ++ allwinner,pins = "PC6", "PC7", "PC8", "PC9", ++ "PC10", "PC11", "PC12", ++ "PC13", "PC14", "PC15", ++ "PC24"; ++ allwinner,function = "mmc3"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + gmac_pins_mii_a: gmac_mii@0 { + allwinner,pins = "PA0", "PA1", "PA2", "PA3", + "PA8", "PA9", "PA11", +@@ -761,6 +803,13 @@ + reg = <0x01c20ca0 0x20>; + }; + ++ lradc: lradc@01c22800 { ++ compatible = "allwinner,sun4i-a10-lradc-keys"; ++ reg = <0x01c22800 0x100>; ++ interrupts = ; ++ status = "disabled"; ++ }; ++ + rtp: rtp@01c25000 { + compatible = "allwinner,sun6i-a31-ts"; + reg = <0x01c25000 0x100>; +@@ -907,6 +956,16 @@ + #size-cells = <0>; + }; + ++ crypto: crypto-engine@01c15000 { ++ compatible = "allwinner,sun4i-a10-crypto"; ++ reg = <0x01c15000 0x1000>; ++ interrupts = ; ++ clocks = <&ahb1_gates 5>, <&ss_clk>; ++ clock-names = "ahb", "mod"; ++ resets = <&ahb1_rst 5>; ++ reset-names = "ahb"; ++ }; ++ + timer@01c60000 { + compatible = "allwinner,sun6i-a31-hstimer", + "allwinner,sun7i-a20-hstimer"; +@@ -1068,7 +1127,7 @@ + resets = <&apb0_rst 0>; + gpio-controller; + interrupt-controller; +- #interrupt-cells = <2>; ++ #interrupt-cells = <3>; + #size-cells = <0>; + #gpio-cells = <3>; + +--- a/arch/arm/dts/sun6i-a31s-primo81.dts ++++ b/arch/arm/dts/sun6i-a31s-primo81.dts +@@ -1,16 +1,57 @@ + /* +- * Copyright 2015 Hans de Goede ++ * Copyright 2014 Siarhei Siamashka ++ * Copyright 2015 Karsten Merker ++ * Copyright 2015 Chen-Yu Tsai + * +- * Minimal dts file for the MSI Primo81 for u-boot only ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. + * +- * SPDX-License-Identifier: GPL-2.0+ or X11 ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. + */ + + /dts-v1/; + #include "sun6i-a31s.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include + + / { +- model = "MSI Primo81"; ++ model = "MSI Primo81 tablet"; + compatible = "msi,primo81", "allwinner,sun6i-a31s"; + + aliases { +@@ -22,8 +63,202 @@ + }; + }; + +-&uart0 { ++&cpu0 { ++ cpu-supply = <®_dcdc3>; ++}; ++ ++&ehci0 { ++ /* rtl8188etv wifi is connected here */ ++ status = "okay"; ++}; ++ ++&i2c0 { ++ /* pull-ups and device VDDIO use AXP221 DLDO3 */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "failed"; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++ ++ ctp@5d { ++ pinctrl-names = "default"; ++ pinctrl-0 = <>911_int_primo81>; ++ compatible = "goodix,gt911"; ++ reg = <0x5d>; ++ interrupt-parent = <&pio>; ++ interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */ ++ touchscreen-swapped-x-y; ++ }; ++}; ++ ++&i2c2 { + pinctrl-names = "default"; +- pinctrl-0 = <&uart0_pins_a>; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++ ++ accelerometer@1c { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mma8452_int_primo81>; ++ compatible = "fsl,mma8452"; ++ reg = <0x1c>; ++ interrupt-parent = <&pio>; ++ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ ++ #io-channel-cells = <1>; ++ }; ++}; ++ ++&lradc { ++ vref-supply = <®_aldo3>; ++ status = "okay"; ++ ++ button@158 { ++ label = "Volume Up"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <158730>; ++ }; ++ ++ button@349 { ++ label = "Volume Down"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <349206>; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>; ++ vmmc-supply = <®_dcdc1>; ++ bus-width = <4>; ++ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&pio { ++ gt911_int_primo81: gt911_int_pin@0 { ++ allwinner,pins = "PA3"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ mma8452_int_primo81: mma8452_int_pin@0 { ++ allwinner,pins = "PA9"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ mmc0_cd_pin_primo81: mmc0_cd_pin@0 { ++ allwinner,pins = "PA8"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&p2wi { ++ status = "okay"; ++ ++ axp22x: pmic@68 { ++ compatible = "x-powers,axp221"; ++ reg = <0x68>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++#include "axp22x.dtsi" ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "avcc"; ++}; ++ ++®_dc1sw { ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-lcd"; ++}; ++ ++®_dc5ldo { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpus"; /* This is an educated guess */ ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-gpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc4 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-sys-dll"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_dldo1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++}; ++ ++®_dldo3 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "vddio-csi"; ++}; ++ ++®_eldo3 { ++ regulator-min-microvolt = <1080000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-mipi-bridge"; ++}; ++ ++&simplefb_lcd { ++ vcc-lcd-supply = <®_dc1sw>; ++ vdd-mipi-bridge-supply = <®_eldo3>; ++}; ++ ++&usb_otg { ++ /* otg support requires support for AXP221 usb-power-supply and GPIO */ ++ dr_mode = "host"; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_dldo1>; + status = "okay"; + }; +--- /dev/null ++++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi +@@ -0,0 +1,142 @@ ++/* ++ * Copyright 2015 Chen-Yu Tsai ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun6i-a31s.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "Sinlinx SinA31s Core Board"; ++ compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc3>; ++}; ++ ++/* eMMC on core board */ ++&mmc3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc3_8bit_emmc_pins>; ++ vmmc-supply = <®_dcdc1>; ++ vqmmc-supply = <®_dcdc1>; ++ bus-width = <8>; ++ non-removable; ++ cap-mmc-hw-reset; ++ status = "okay"; ++}; ++ ++/* AXP221s PMIC on core board */ ++&p2wi { ++ status = "okay"; ++ ++ axp22x: pmic@68 { ++ compatible = "x-powers,axp221"; ++ reg = <0x68>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++#include "axp22x.dtsi" ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "avcc"; ++}; ++ ++®_dc5ldo { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-gpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc4 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-sys-dll"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++/* UART0 pads available on core board */ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ +--- /dev/null ++++ b/arch/arm/dts/sun6i-a31s-sina31s.dts +@@ -0,0 +1,153 @@ ++/* ++ * Copyright 2015 Chen-Yu Tsai ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/* The SinA31s development board has the SinA31s core board soldered on */ ++#include "sun6i-a31s-sina31s-core.dtsi" ++ ++#include ++ ++/ { ++ model = "Sinlinx SinA31s Development Board"; ++ compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s"; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&led_pin_sina31s>; ++ ++ status { ++ label = "sina31s:status:usr"; ++ gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ ++ }; ++ }; ++}; ++ ++&ehci0 { ++ /* USB 2.0 4 port hub IC */ ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&gmac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_pins_mii_a>; ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ phy-supply = <®_dldo1>; ++ status = "okay"; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ir { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir_pins_a>; ++ status = "okay"; ++}; ++ ++&lradc { ++ vref-supply = <®_aldo3>; ++ status = "okay"; ++ ++ button@158 { ++ label = "Volume Up"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <158730>; ++ }; ++ ++ button@349 { ++ label = "Volume Down"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <349206>; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>; ++ vmmc-supply = <®_dcdc1>; ++ bus-width = <4>; ++ cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&pio { ++ led_pin_sina31s: led_pin@0 { ++ allwinner,pins = "PH13"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ mmc0_cd_pin_sina31s: mmc0_cd_pin@0 { ++ allwinner,pins = "PA4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_dldo1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-gmac-phy"; ++}; ++ ++&usbphy { ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts +@@ -0,0 +1,205 @@ ++/* ++ * Copyright 2015 Lawrence Yu ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun6i-a31s.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++ ++/ { ++ model = "Yones TopTech BS1078 v2 Tablet"; ++ compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s"; ++ ++ aliases { ++ serial0 = &uart0; ++ i2c1 = &i2c1; ++ i2c2 = &i2c2; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&pio { ++ mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 { ++ allwinner,pins = "PA8"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>; ++ vmmc-supply = <®_vcc3v0>; ++ bus-width = <4>; ++ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc0_pins_a { ++ allwinner,pull = ; ++}; ++ ++&p2wi { ++ status = "okay"; ++ ++ axp22x: pmic@68 { ++ compatible = "x-powers,axp221"; ++ reg = <0x68>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++#include "axp22x.dtsi" ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "avcc"; ++}; ++ ++®_dc1sw { ++ regulator-name = "vcc-lcd-usb2"; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++}; ++ ++®_dc5ldo { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-gpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc4 { ++ regulator-always-on; ++ regulator-min-microvolt = <700000>; ++ regulator-max-microvolt = <1320000>; ++ regulator-name = "vdd-sys-dll"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_dldo1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++}; ++ ++/* Voltage source for I2C pullup resistors for I2C Bus 0 */ ++®_dldo3 { ++ regulator-min-microvolt = <2800000>; ++ regulator-max-microvolt = <2800000>; ++ regulator-name = "vddio-csi"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_dldo1>; ++ usb2_vbus-supply = <®_dc1sw>; ++ status = "okay"; ++}; +--- a/arch/arm/dts/sun7i-a20-bananapi.dts ++++ b/arch/arm/dts/sun7i-a20-bananapi.dts +@@ -92,6 +92,24 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++ operating-points = < ++ /* kHz uV */ ++ 960000 1400000 ++ 912000 1400000 ++ 864000 1350000 ++ 720000 1250000 ++ 528000 1150000 ++ 312000 1100000 ++ 144000 1050000 ++ >; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -119,13 +137,9 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -159,7 +173,18 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_bananapi: mmc0_cd_pin@0 { + allwinner,pins = "PH10"; + allwinner,function = "gpio_in"; +@@ -182,6 +207,37 @@ + }; + }; + ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -216,7 +272,21 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-cubieboard2.dts ++++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts +@@ -84,6 +84,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +@@ -150,6 +154,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + led_pins_cubieboard2: led_pins@0 { + allwinner,pins = "PH20", "PH21"; +@@ -157,12 +165,24 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + ®_ahci_5v { + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + #include "axp209.dtsi" + + ®_dcdc2 { +@@ -205,6 +225,9 @@ + }; + + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-cubietruck.dts ++++ b/arch/arm/dts/sun7i-a20-cubietruck.dts +@@ -101,6 +101,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +--- /dev/null ++++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts +@@ -0,0 +1,169 @@ ++/* ++ * Copyright 2015 Stefan Roese ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun7i-a20.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "ICnova-A20 SWAC"; ++ compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&gmac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_pins_mii_a>; ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ status = "okay"; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp209: pmic@34 { ++ reg = <0x34>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb1_vbus { ++ status = "okay"; ++}; ++ ++®_usb2_vbus { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts +@@ -0,0 +1,125 @@ ++/* ++ * Copyright 2015 - Marcus Cooper ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun7i-a20.dtsi" ++#include "sunxi-itead-core-common.dtsi" ++ ++/ { ++ model = "Itead Ibox A20"; ++ compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20"; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&led_pins_itead_core>; ++ ++ green { ++ label = "itead_core:green:usr"; ++ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ blue { ++ label = "itead_core:blue:usr"; ++ gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++}; ++ ++&ahci { ++ target-supply = <®_ahci_5v>; ++ status = "okay"; ++}; ++ ++&codec { ++ status = "okay"; ++}; ++ ++&gmac { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&gmac_pins_mii_a>; ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ status = "okay"; ++ ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&i2c0 { ++ axp209: pmic@34 { ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++&ir0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir0_rx_pins_a>; ++ status = "okay"; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&pio { ++ led_pins_itead_core: led_pins@0 { ++ allwinner,pins = "PH20","PH21"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_ahci_5v { ++ status = "okay"; ++}; +--- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts ++++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts +@@ -97,16 +97,6 @@ + + &cpu0 { + cpu-supply = <®_dcdc2>; +- operating-points = < +- /* kHz uV */ +- 960000 1400000 +- 912000 1400000 +- 864000 1350000 +- 720000 1250000 +- 528000 1150000 +- 312000 1100000 +- 144000 1050000 +- >; + }; + + &ehci0 { +--- a/arch/arm/dts/sun7i-a20-mk808c.dts ++++ b/arch/arm/dts/sun7i-a20-mk808c.dts +@@ -53,6 +53,7 @@ + + #include + #include ++#include + + / { + model = "mk808c"; +@@ -68,6 +69,10 @@ + }; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -121,6 +126,30 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ ++&pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { ++ allwinner,pins = "PH5"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -141,7 +170,17 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; ++ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts ++++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts +@@ -1,5 +1,6 @@ + /* + * Copyright 2015 - Marcus Cooper ++ * Copyright 2015 - Karsten Merker + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual +@@ -45,6 +46,7 @@ + #include "sunxi-common-regulators.dtsi" + + #include ++#include + #include + #include + +@@ -71,14 +73,6 @@ + default-state = "on"; + }; + }; +- +- reg_axp_ipsout: axp_ipsout { +- compatible = "regulator-fixed"; +- regulator-name = "axp-ipsout"; +- regulator-min-microvolt = <5000000>; +- regulator-max-microvolt = <5000000>; +- regulator-always-on; +- }; + }; + + &ahci { +@@ -94,6 +88,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &gmac { + pinctrl-names = "default"; + pinctrl-0 = <&gmac_pins_rgmii_a>; +@@ -118,10 +116,58 @@ + }; + }; + +-&i2c1 { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2c1_pins_a>; ++&lradc { ++ vref-supply = <®_vcc3v0>; + status = "okay"; ++ ++ button@190 { ++ label = "Volume Up"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <190000>; ++ }; ++ ++ button@390 { ++ label = "Volume Down"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <390000>; ++ }; ++ ++ button@600 { ++ label = "Menu"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <600000>; ++ }; ++ ++ button@800 { ++ label = "Search"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <800000>; ++ }; ++ ++ button@980 { ++ label = "Home"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <980000>; ++ }; ++ ++ button@1180 { ++ label = "Esc"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <1180000>; ++ }; ++ ++ button@1400 { ++ label = "Enter"; ++ linux,code = ; ++ channel = <0>; ++ voltage = <1400000>; ++ }; + }; + + &mmc0 { +@@ -134,6 +180,16 @@ + status = "okay"; + }; + ++&mmc3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ + &ohci0 { + status = "okay"; + }; +@@ -161,15 +217,22 @@ + allwinner,pull = ; + }; + ++ mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 { ++ allwinner,pins = "PH0"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb0_id_detect_pin: usb0_id_detect_pin@0 { +- allwinner,pins = "PH04"; ++ allwinner,pins = "PH4"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; + }; + + usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { +- allwinner,pins = "PH05"; ++ allwinner,pins = "PH5"; + allwinner,function = "gpio_in"; + allwinner,drive = ; + allwinner,pull = ; +@@ -187,7 +250,7 @@ + ®_dcdc2 { + regulator-always-on; + regulator-min-microvolt = <1000000>; +- regulator-max-microvolt = <1425000>; ++ regulator-max-microvolt = <1400000>; + regulator-name = "vdd-cpu"; + }; + +@@ -235,8 +298,8 @@ + &usbphy { + pinctrl-names = "default"; + pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; +- usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */ +- usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */ ++ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */ ++ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */ + usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; +--- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts +@@ -117,6 +117,18 @@ + }; + }; + ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c16"; ++ reg = <0x50>; ++ pagesize = <16>; ++ }; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; +--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts +@@ -170,6 +170,12 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c16"; ++ reg = <0x50>; ++ pagesize = <16>; ++ }; + }; + + &mmc0 { +@@ -190,6 +196,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 { + allwinner,pins = "PC3"; +@@ -204,6 +214,27 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { ++ allwinner,pins = "PH5"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_vbus_pin_lime2: usb0_vbus_pin@0 { ++ allwinner,pins = "PC17"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + ®_ahci_5v { +@@ -212,6 +243,12 @@ + status = "okay"; + }; + ++®_usb0_vbus { ++ pinctrl-0 = <&usb0_vbus_pin_lime2>; ++ gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -226,7 +263,17 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts +@@ -125,6 +125,12 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; + status = "okay"; ++ ++ eeprom: eeprom@50 { ++ compatible = "atmel,24c16"; ++ reg = <0x50>; ++ pagesize = <16>; ++ }; + }; + + &i2c2 { +--- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts ++++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts +@@ -95,6 +95,10 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -156,7 +160,18 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { + allwinner,pins = "PH10"; + allwinner,function = "gpio_in"; +@@ -225,6 +240,10 @@ + regulator-name = "avcc"; + }; + ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + pinctrl-0 = <&usb1_vbus_pin_bananapro>; + gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ +@@ -243,7 +262,21 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-orangepi.dts ++++ b/arch/arm/dts/sun7i-a20-orangepi.dts +@@ -141,7 +141,18 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { + allwinner,pins = "PH10"; + allwinner,function = "gpio_in"; +@@ -203,6 +214,10 @@ + regulator-name = "avcc"; + }; + ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + pinctrl-0 = <&usb1_vbus_pin_bananapro>; + gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ +@@ -221,7 +236,21 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts ++++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts +@@ -82,6 +82,14 @@ + status = "okay"; + }; + ++&codec { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -108,13 +116,9 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + +@@ -142,6 +146,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 { + allwinner,pins = "PH2"; +@@ -157,8 +165,15 @@ + allwinner,pull = ; + }; + ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 { +- allwinner,pins = "PH11"; ++ allwinner,pins = "PD2"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; +@@ -171,13 +186,37 @@ + status = "okay"; + }; + +-®_usb1_vbus { +- pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; +- gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ +- status = "okay"; ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-pll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; + }; + +-®_usb2_vbus { ++/* A single regulator (U24) powers both USB host ports. */ ++®_usb1_vbus { ++ pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; ++ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */ + status = "okay"; + }; + +@@ -187,8 +226,16 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb1_vbus-supply = <®_usb1_vbus>; +- usb2_vbus-supply = <®_usb2_vbus>; ++ usb2_vbus-supply = <®_usb1_vbus>; + status = "okay"; + }; +--- a/arch/arm/dts/sun7i-a20-pcduino3.dts ++++ b/arch/arm/dts/sun7i-a20-pcduino3.dts +@@ -111,6 +111,14 @@ + allwinner,pins = "PH2"; + }; + ++&codec { ++ status = "okay"; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ + &ehci0 { + status = "okay"; + }; +@@ -137,16 +145,14 @@ + status = "okay"; + + axp209: pmic@34 { +- compatible = "x-powers,axp209"; + reg = <0x34>; + interrupt-parent = <&nmi_intc>; + interrupts = <0 IRQ_TYPE_LEVEL_LOW>; +- +- interrupt-controller; +- #interrupt-cells = <1>; + }; + }; + ++#include "axp209.dtsi" ++ + &ir0 { + pinctrl-names = "default"; + pinctrl-0 = <&ir0_rx_pins_a>; +@@ -171,6 +177,10 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ + &pio { + led_pins_pcduino3: led_pins@0 { + allwinner,pins = "PH15", "PH16"; +@@ -185,6 +195,13 @@ + allwinner,drive = ; + allwinner,pull = ; + }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + ®_ahci_5v { +@@ -192,6 +209,31 @@ + status = "okay"; + }; + ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-pll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -206,7 +248,15 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts ++++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts +@@ -48,6 +48,7 @@ + #include + #include + #include ++#include + + / { + model = "Wexler TAB7200"; +@@ -57,11 +58,28 @@ + serial0 = &uart0; + }; + ++ backlight { ++ compatible = "pwm-backlight"; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bl_enable_pin>; ++ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; + }; + ++&codec { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&codec_pa_pin>; ++ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ ++ status = "okay"; ++}; ++ + &cpu0 { + cpu-supply = <®_dcdc2>; + }; +@@ -86,6 +104,8 @@ + }; + }; + ++#include "axp209.dtsi" ++ + &i2c1 { + pinctrl-names = "default"; + pinctrl-0 = <&i2c1_pins_a>; +@@ -96,6 +116,18 @@ + pinctrl-names = "default"; + pinctrl-0 = <&i2c2_pins_a>; + status = "okay"; ++ ++ gt911: touchscreen@5d { ++ compatible = "goodix,gt911"; ++ reg = <0x5d>; ++ interrupt-parent = <&pio>; ++ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ts_reset_pin>; ++ irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */ ++ reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */ ++ touchscreen-swapped-x-y; ++ }; + }; + + &lradc { +@@ -135,7 +167,45 @@ + status = "okay"; + }; + +-#include "axp209.dtsi" ++&otg_sram { ++ status = "okay"; ++}; ++ ++&pio { ++ bl_enable_pin: bl_enable_pin@0 { ++ allwinner,pins = "PH7"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ codec_pa_pin: codec_pa_pin@0 { ++ allwinner,pins = "PH15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ ts_reset_pin: ts_reset_pin@0 { ++ allwinner,pins = "PB13"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins_a>; ++ status = "okay"; ++}; + + ®_dcdc2 { + regulator-always-on; +@@ -162,6 +232,10 @@ + regulator-name = "avcc"; + }; + ++®_usb0_vbus { ++ status = "okay"; ++}; ++ + ®_usb1_vbus { + status = "okay"; + }; +@@ -176,7 +250,21 @@ + status = "okay"; + }; + ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ + &usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; + usb1_vbus-supply = <®_usb1_vbus>; + usb2_vbus-supply = <®_usb2_vbus>; + status = "okay"; +--- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts ++++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts +@@ -1,13 +1,52 @@ + /* +- * Copyright 2015 Hans de Goede ++ * Copyright 2015 Jelle de Jong + * +- * Minimal dts file for the Wits Pro A20 DKT for u-boot only ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. + * +- * SPDX-License-Identifier: GPL-2.0+ or X11 ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. + */ + + /dts-v1/; + #include "sun7i-a20.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include + + / { + model = "Wits Pro A20 DKT"; +@@ -20,6 +59,17 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ mmc3_pwrseq: mmc3_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>; ++ reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */ ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; + }; + + &ehci0 { +@@ -42,6 +92,60 @@ + }; + }; + ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp209: pmic@34 { ++ reg = <0x34>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ }; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&i2c2 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c2_pins_a>; ++ status = "okay"; ++}; ++ ++#include "axp209.dtsi" ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc3 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc3_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ mmc-pwrseq = <&mmc3_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ brcmf: bcrmf@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ interrupt-parent = <&pio>; ++ interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */ ++ interrupt-names = "host-wake"; ++ }; ++}; ++ + &ohci0 { + status = "okay"; + }; +@@ -50,8 +154,85 @@ + status = "okay"; + }; + ++&otg_sram { ++ status = "okay"; ++}; ++ ++&pio { ++ vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 { ++ allwinner,pins = "PH9"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ usb0_id_detect_pin: usb0_id_detect_pin@0 { ++ allwinner,pins = "PH4"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1450000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb0_vbus { ++ status = "okay"; ++}; ++ ++®_usb1_vbus { ++ status = "okay"; ++}; ++ ++®_usb2_vbus { ++ status = "okay"; ++}; ++ + &uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; + status = "okay"; + }; ++ ++&usb_otg { ++ dr_mode = "otg"; ++ status = "okay"; ++}; ++ ++&usb_power_supply { ++ status = "okay"; ++}; ++ ++&usbphy { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb0_id_detect_pin>; ++ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ ++ usb0_vbus_power-supply = <&usb_power_supply>; ++ usb0_vbus-supply = <®_usb0_vbus>; ++ usb1_vbus-supply = <®_usb1_vbus>; ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++}; +--- a/arch/arm/dts/sun7i-a20.dtsi ++++ b/arch/arm/dts/sun7i-a20.dtsi +@@ -47,6 +47,7 @@ + #include + #include + ++#include + #include + #include + +@@ -67,7 +68,7 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0-hdmi"; + clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, +- <&ahb_gates 44>; ++ <&ahb_gates 44>, <&dram_gates 26>; + status = "disabled"; + }; + +@@ -75,7 +76,8 @@ + compatible = "allwinner,simple-framebuffer", + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0"; +- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; ++ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, ++ <&dram_gates 26>; + status = "disabled"; + }; + +@@ -84,7 +86,7 @@ + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0-tve0"; + clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, +- <&ahb_gates 44>; ++ <&ahb_gates 44>, <&dram_gates 26>; + status = "disabled"; + }; + }; +@@ -107,7 +109,7 @@ + 720000 1200000 + 528000 1100000 + 312000 1000000 +- 144000 900000 ++ 144000 1000000 + >; + #cooling-cells = <2>; + cooling-min-level = <0>; +@@ -199,6 +201,15 @@ + clock-output-names = "pll1"; + }; + ++ pll2: clk@01c20008 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun4i-a10-pll2-clk"; ++ reg = <0x01c20008 0x8>; ++ clocks = <&osc24M>; ++ clock-output-names = "pll2-1x", "pll2-2x", ++ "pll2-4x", "pll2-8x"; ++ }; ++ + pll4: clk@01c20018 { + #clock-cells = <0>; + compatible = "allwinner,sun7i-a20-pll4-clk"; +@@ -267,6 +278,19 @@ + compatible = "allwinner,sun7i-a20-ahb-gates-clk"; + reg = <0x01c20060 0x8>; + clocks = <&ahb>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, <4>, ++ <5>, <6>, <7>, <8>, ++ <9>, <10>, <11>, <12>, ++ <13>, <14>, <16>, ++ <17>, <18>, <20>, <21>, ++ <22>, <23>, <25>, ++ <28>, <32>, <33>, <34>, ++ <35>, <36>, <37>, <40>, ++ <41>, <42>, <43>, ++ <44>, <45>, <46>, ++ <47>, <49>, <50>, ++ <52>; + clock-output-names = "ahb_usb0", "ahb_ehci0", + "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", + "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0", +@@ -295,6 +319,10 @@ + compatible = "allwinner,sun7i-a20-apb0-gates-clk"; + reg = <0x01c20068 0x4>; + clocks = <&apb0>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, <4>, ++ <5>, <6>, <7>, ++ <8>, <10>; + clock-output-names = "apb0_codec", "apb0_spdif", + "apb0_ac97", "apb0_iis0", "apb0_iis1", + "apb0_pio", "apb0_ir0", "apb0_ir1", +@@ -314,6 +342,12 @@ + compatible = "allwinner,sun7i-a20-apb1-gates-clk"; + reg = <0x01c2006c 0x4>; + clocks = <&apb1>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, <4>, ++ <5>, <6>, <7>, ++ <15>, <16>, <17>, ++ <18>, <19>, <20>, ++ <21>, <22>, <23>; + clock-output-names = "apb1_i2c0", "apb1_i2c1", + "apb1_i2c2", "apb1_i2c3", "apb1_can", + "apb1_scr", "apb1_ps20", "apb1_ps21", +@@ -442,6 +476,14 @@ + clock-output-names = "ir1"; + }; + ++ keypad_clk: clk@01c200c4 { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ reg = <0x01c200c4 0x4>; ++ clocks = <&osc24M>; ++ clock-output-names = "keypad"; ++ }; ++ + usb_clk: clk@01c200cc { + #clock-cells = <1>; + #reset-cells = <1>; +@@ -460,6 +502,48 @@ + clock-output-names = "spi3"; + }; + ++ dram_gates: clk@01c20100 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun4i-a10-dram-gates-clk"; ++ reg = <0x01c20100 0x4>; ++ clocks = <&pll5 0>; ++ clock-indices = <0>, ++ <1>, <2>, ++ <3>, ++ <4>, ++ <5>, <6>, ++ <15>, ++ <24>, <25>, ++ <26>, <27>, ++ <28>, <29>; ++ clock-output-names = "dram_ve", ++ "dram_csi0", "dram_csi1", ++ "dram_ts", ++ "dram_tvd", ++ "dram_tve0", "dram_tve1", ++ "dram_output", ++ "dram_de_fe1", "dram_de_fe0", ++ "dram_de_be0", "dram_de_be1", ++ "dram_de_mp", "dram_ace"; ++ }; ++ ++ ve_clk: clk@01c2013c { ++ #clock-cells = <0>; ++ #reset-cells = <0>; ++ compatible = "allwinner,sun4i-a10-ve-clk"; ++ reg = <0x01c2013c 0x4>; ++ clocks = <&pll4>; ++ clock-output-names = "ve"; ++ }; ++ ++ codec_clk: clk@01c20140 { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-codec-clk"; ++ reg = <0x01c20140 0x4>; ++ clocks = <&pll2 SUN4I_A10_PLL2_1X>; ++ clock-output-names = "codec"; ++ }; ++ + mbus_clk: clk@01c2015c { + #clock-cells = <0>; + compatible = "allwinner,sun5i-a13-mbus-clk"; +@@ -744,6 +828,14 @@ + status = "disabled"; + }; + ++ crypto: crypto-engine@01c15000 { ++ compatible = "allwinner,sun4i-a10-crypto"; ++ reg = <0x01c15000 0x1000>; ++ interrupts = ; ++ clocks = <&ahb_gates 5>, <&ss_clk>; ++ clock-names = "ahb", "mod"; ++ }; ++ + spi2: spi@01c17000 { + compatible = "allwinner,sun4i-a10-spi"; + reg = <0x01c17000 0x1000>; +@@ -1159,6 +1251,19 @@ + status = "disabled"; + }; + ++ codec: codec@01c22c00 { ++ #sound-dai-cells = <0>; ++ compatible = "allwinner,sun7i-a20-codec"; ++ reg = <0x01c22c00 0x40>; ++ interrupts = ; ++ clocks = <&apb0_gates 0>, <&codec_clk>; ++ clock-names = "apb", "codec"; ++ dmas = <&dma SUN4I_DMA_NORMAL 19>, ++ <&dma SUN4I_DMA_NORMAL 19>; ++ dma-names = "rx", "tx"; ++ status = "disabled"; ++ }; ++ + sid: eeprom@01c23800 { + compatible = "allwinner,sun7i-a20-sid"; + reg = <0x01c23800 0x200>; +--- a/arch/arm/dts/sun8i-a23-a33.dtsi ++++ b/arch/arm/dts/sun8i-a23-a33.dtsi +@@ -56,7 +56,7 @@ + #size-cells = <1>; + ranges; + +- framebuffer@0 { ++ simplefb_lcd: framebuffer@0 { + compatible = "allwinner,simple-framebuffer", + "simple-framebuffer"; + allwinner,pipeline = "de_be0-lcd0"; +@@ -175,27 +175,13 @@ + clock-output-names = "apb1"; + }; + +- ahb1_gates: clk@01c20060 { +- #clock-cells = <1>; +- compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; +- reg = <0x01c20060 0x8>; +- clocks = <&ahb1>; +- clock-output-names = "ahb1_mipidsi", "ahb1_dma", +- "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", +- "ahb1_nand", "ahb1_sdram", +- "ahb1_hstimer", "ahb1_spi0", +- "ahb1_spi1", "ahb1_otg", "ahb1_ehci", +- "ahb1_ohci", "ahb1_ve", "ahb1_lcd", +- "ahb1_csi", "ahb1_be", "ahb1_fe", +- "ahb1_gpu", "ahb1_spinlock", +- "ahb1_drc"; +- }; +- + apb1_gates: clk@01c20068 { + #clock-cells = <1>; + compatible = "allwinner,sun8i-a23-apb1-gates-clk"; + reg = <0x01c20068 0x4>; + clocks = <&apb1>; ++ clock-indices = <0>, <5>, ++ <12>, <13>; + clock-output-names = "apb1_codec", "apb1_pio", + "apb1_daudio0", "apb1_daudio1"; + }; +@@ -213,6 +199,10 @@ + compatible = "allwinner,sun8i-a23-apb2-gates-clk"; + reg = <0x01c2006c 0x4>; + clocks = <&apb2>; ++ clock-indices = <0>, <1>, ++ <2>, <16>, ++ <17>, <18>, ++ <19>, <20>; + clock-output-names = "apb2_i2c0", "apb2_i2c1", + "apb2_i2c2", "apb2_uart0", + "apb2_uart1", "apb2_uart2", +@@ -391,12 +381,19 @@ + allwinner,pins = "PC5", "PC6", "PC8", + "PC9", "PC10", "PC11", + "PC12", "PC13", "PC14", +- "PC15"; ++ "PC15", "PC16"; + allwinner,function = "mmc2"; + allwinner,drive = ; + allwinner,pull = ; + }; + ++ pwm0_pins: pwm0 { ++ allwinner,pins = "PH0"; ++ allwinner,function = "pwm0"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + i2c0_pins_a: i2c0@0 { + allwinner,pins = "PH2", "PH3"; + allwinner,function = "i2c0"; +@@ -451,6 +448,14 @@ + interrupts = ; + }; + ++ pwm: pwm@01c21400 { ++ compatible = "allwinner,sun7i-a20-pwm"; ++ reg = <0x01c21400 0xc>; ++ clocks = <&osc24M>; ++ #pwm-cells = <3>; ++ status = "disabled"; ++ }; ++ + lradc: lradc@01c22800 { + compatible = "allwinner,sun4i-a10-lradc-keys"; + reg = <0x01c22800 0x100>; +@@ -574,6 +579,14 @@ + ; + }; + ++ nmi_intc: interrupt-controller@01f00c0c { ++ compatible = "allwinner,sun6i-a31-sc-nmi"; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ reg = <0x01f00c0c 0x38>; ++ interrupts = ; ++ }; ++ + prcm@01f01400 { + compatible = "allwinner,sun8i-a23-prcm"; + reg = <0x01f01400 0x200>; +@@ -642,10 +655,18 @@ + resets = <&apb0_rst 0>; + gpio-controller; + interrupt-controller; ++ #interrupt-cells = <3>; + #address-cells = <1>; + #size-cells = <0>; + #gpio-cells = <3>; + ++ r_rsb_pins: r_rsb { ++ allwinner,pins = "PL0", "PL1"; ++ allwinner,function = "s_rsb"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + r_uart_pins_a: r_uart@0 { + allwinner,pins = "PL2", "PL3"; + allwinner,function = "s_uart"; +@@ -653,5 +674,19 @@ + allwinner,pull = ; + }; + }; ++ ++ r_rsb: rsb@01f03400 { ++ compatible = "allwinner,sun8i-a23-rsb"; ++ reg = <0x01f03400 0x400>; ++ interrupts = ; ++ clocks = <&apb0_gates 3>; ++ clock-frequency = <3000000>; ++ resets = <&apb0_rst 3>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&r_rsb_pins>; ++ status = "disabled"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; + }; + }; +--- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts ++++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts +@@ -47,15 +47,26 @@ + #include + #include + #include ++#include + + / { +- model = "Allwinner GT90H Quad Core Tablet (v4)"; +- compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33"; ++ model = "Allwinner GT90H Dual Core Tablet (v4)"; ++ compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23"; + + aliases { + serial0 = &r_uart; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bl_en_pin_gt90h>; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -106,8 +117,7 @@ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>; +- /* FIXME this really is aldo1, correct once we've pmic support */ +- vmmc-supply = <®_vcc3v0>; ++ vmmc-supply = <®_aldo1>; + bus-width = <4>; + cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ + cd-inverted; +@@ -115,6 +125,13 @@ + }; + + &pio { ++ bl_en_pin_gt90h: bl_en_pin@0 { ++ allwinner,pins = "PH6"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_gt90h: mmc0_cd_pin@0 { + allwinner,pins = "PB4"; + allwinner,function = "gpio_in"; +@@ -123,12 +140,106 @@ + }; + }; + ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins>; ++ status = "okay"; ++}; ++ ++&r_rsb { ++ status = "okay"; ++ ++ axp22x: pmic@3a3 { ++ compatible = "x-powers,axp223"; ++ reg = <0x3a3>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ eldoin-supply = <®_dcdc1>; ++ }; ++}; ++ + &r_uart { + pinctrl-names = "default"; + pinctrl-0 = <&r_uart_pins_a>; + status = "okay"; + }; + ++#include "axp22x.dtsi" ++ ++®_aldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-io"; ++}; ++ ++®_aldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <2350000>; ++ regulator-max-microvolt = <2650000>; ++ regulator-name = "vdd-dll"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pll-avcc"; ++}; ++ ++®_dc1sw { ++ regulator-name = "vcc-lcd"; ++}; ++ ++®_dc5ldo { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-sys"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_dldo1 { ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++}; ++ ++®_rtc_ldo { ++ regulator-name = "vcc-rtc"; ++}; ++ ++&simplefb_lcd { ++ vcc-lcd-supply = <®_dc1sw>; ++}; ++ + /* + * FIXME for now we only support host mode and rely on u-boot to have + * turned on Vbus which is controlled by the axp223 pmic on the board. +@@ -141,5 +252,6 @@ + }; + + &usbphy { ++ usb1_vbus-supply = <®_dldo1>; + status = "okay"; + }; +--- a/arch/arm/dts/sun8i-a23.dtsi ++++ b/arch/arm/dts/sun8i-a23.dtsi +@@ -50,6 +50,31 @@ + }; + + clocks { ++ ahb1_gates: clk@01c20060 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; ++ reg = <0x01c20060 0x8>; ++ clocks = <&ahb1>; ++ clock-indices = <1>, <6>, ++ <8>, <9>, <10>, ++ <13>, <14>, ++ <19>, <20>, ++ <21>, <24>, <26>, ++ <29>, <32>, <36>, ++ <40>, <44>, <46>, ++ <52>, <53>, ++ <54>, <57>; ++ clock-output-names = "ahb1_mipidsi", "ahb1_dma", ++ "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", ++ "ahb1_nand", "ahb1_sdram", ++ "ahb1_hstimer", "ahb1_spi0", ++ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", ++ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", ++ "ahb1_csi", "ahb1_be", "ahb1_fe", ++ "ahb1_gpu", "ahb1_msgbox", ++ "ahb1_spinlock", "ahb1_drc"; ++ }; ++ + mbus_clk: clk@01c2015c { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a23-mbus-clk"; +--- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts ++++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts +@@ -68,7 +68,7 @@ + }; + + &lradc { +- vref-supply = <®_vcc3v0>; ++ vref-supply = <®_dcdc1>; + status = "okay"; + + button@200 { +@@ -96,7 +96,7 @@ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>; +- vmmc-supply = <®_vcc3v0>; ++ vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ + cd-inverted; +@@ -106,13 +106,16 @@ + &mmc2 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc2_8bit_pins>; +- vmmc-supply = <®_vcc3v0>; ++ vmmc-supply = <®_dcdc1>; + bus-width = <8>; + non-removable; ++ cap-mmc-hw-reset; + status = "okay"; + }; + + &mmc2_8bit_pins { ++ /* Increase drive strength for DDR modes */ ++ allwinner,drive = ; + /* eMMC is missing pull-ups */ + allwinner,pull = ; + }; +@@ -130,6 +133,80 @@ + }; + }; + ++&r_rsb { ++ status = "okay"; ++ ++ axp22x: pmic@3a3 { ++ compatible = "x-powers,axp223"; ++ reg = <0x3a3>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ eldoin-supply = <®_dcdc1>; ++ }; ++}; ++ ++#include "axp22x.dtsi" ++ ++®_aldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-io"; ++}; ++ ++®_aldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <2350000>; ++ regulator-max-microvolt = <2650000>; ++ regulator-name = "vdd-dll"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pll-avcc"; ++}; ++ ++®_dc5ldo { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-sys"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_rtc_ldo { ++ regulator-name = "vcc-rtc"; ++}; ++ + &uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_b>; +--- a/arch/arm/dts/sun8i-a33.dtsi ++++ b/arch/arm/dts/sun8i-a33.dtsi +@@ -72,6 +72,41 @@ + clock-output-names = "pll11"; + }; + ++ ahb1_gates: clk@01c20060 { ++ #clock-cells = <1>; ++ compatible = "allwinner,sun8i-a33-ahb1-gates-clk"; ++ reg = <0x01c20060 0x8>; ++ clocks = <&ahb1>; ++ clock-indices = <1>, <5>, ++ <6>, <8>, <9>, ++ <10>, <13>, <14>, ++ <19>, <20>, ++ <21>, <24>, <26>, ++ <29>, <32>, <36>, ++ <40>, <44>, <46>, ++ <52>, <53>, ++ <54>, <57>, ++ <58>; ++ clock-output-names = "ahb1_mipidsi", "ahb1_ss", ++ "ahb1_dma","ahb1_mmc0", "ahb1_mmc1", ++ "ahb1_mmc2", "ahb1_nand", "ahb1_sdram", ++ "ahb1_hstimer", "ahb1_spi0", ++ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", ++ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", ++ "ahb1_csi", "ahb1_be", "ahb1_fe", ++ "ahb1_gpu", "ahb1_msgbox", ++ "ahb1_spinlock", "ahb1_drc", ++ "ahb1_sat"; ++ }; ++ ++ ss_clk: clk@01c2009c { ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ reg = <0x01c2009c 0x4>; ++ clocks = <&osc24M>, <&pll6 0>; ++ clock-output-names = "ss"; ++ }; ++ + mbus_clk: clk@01c2015c { + #clock-cells = <0>; + compatible = "allwinner,sun8i-a23-mbus-clk"; +@@ -82,6 +117,16 @@ + }; + + soc@01c00000 { ++ crypto: crypto-engine@01c15000 { ++ compatible = "allwinner,sun4i-a10-crypto"; ++ reg = <0x01c15000 0x1000>; ++ interrupts = ; ++ clocks = <&ahb1_gates 5>, <&ss_clk>; ++ clock-names = "ahb", "mod"; ++ resets = <&ahb1_rst 5>; ++ reset-names = "ahb"; ++ }; ++ + usb_otg: usb@01c19000 { + compatible = "allwinner,sun8i-a33-musb"; + reg = <0x01c19000 0x0400>; +--- /dev/null ++++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts +@@ -0,0 +1,65 @@ ++/* ++ * Copyright 2015 Chen-Yu Tsai ++ * ++ * Chen-Yu Tsai ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun8i-a83t.dtsi" ++ ++/ { ++ model = "Cubietech Cubietruck Plus"; ++ compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t"; ++ ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_b>; ++ status = "okay"; ++}; +--- a/arch/arm/dts/sun8i-a83t.dtsi ++++ b/arch/arm/dts/sun8i-a83t.dtsi +@@ -52,12 +52,6 @@ + / { + interrupt-parent = <&gic>; + +- chosen { +- #address-cells = <1>; +- #size-cells = <1>; +- ranges; +- }; +- + cpus { + #address-cells = <1>; + #size-cells = <0>; +@@ -85,6 +79,7 @@ + device_type = "cpu"; + reg = <3>; + }; ++ + cpu@100 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; +@@ -96,6 +91,7 @@ + device_type = "cpu"; + reg = <0x101>; + }; ++ + cpu@102 { + compatible = "arm,cortex-a7"; + device_type = "cpu"; +@@ -109,18 +105,12 @@ + }; + }; + +- memory { +- reg = <0x40000000 0x80000000>; +- }; +- + timer { + compatible = "arm,armv7-timer"; +- interrupts = , +- , +- , +- ; +- clock-frequency = <24000000>; +- arm,cpu-registers-not-fw-configured; ++ interrupts = , ++ , ++ , ++ ; + }; + + clocks { +@@ -128,6 +118,7 @@ + #size-cells = <1>; + ranges; + ++ /* TODO: PRCM block has a mux for this. */ + osc24M: osc24M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; +@@ -135,36 +126,39 @@ + clock-output-names = "osc24M"; + }; + +- osc32k: osc32k_clk { ++ /* ++ * This is called "internal OSC" in some places. ++ * It is an internal RC-based oscillator. ++ * TODO: Its controls are in the PRCM block. ++ */ ++ osc16M: osc16M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; +- clock-frequency = <32768>; +- clock-output-names = "osc32k"; ++ clock-frequency = <16000000>; ++ clock-output-names = "osc16M"; ++ }; ++ ++ osc16Md512: osc16Md512_clk { ++ #clock-cells = <0>; ++ compatible = "fixed-factor-clock"; ++ clock-div = <512>; ++ clock-mult = <1>; ++ clocks = <&osc16M>; ++ clock-output-names = "osc16M-d512"; + }; + }; + +- soc@01c00000 { ++ soc { + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges; + +- gic: interrupt-controller@01c81000 { +- compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; +- reg = <0x01c81000 0x1000>, +- <0x01c82000 0x1000>, +- <0x01c84000 0x2000>, +- <0x01c86000 0x2000>; +- interrupt-controller; +- #interrupt-cells = <3>; +- interrupts = ; +- }; +- + pio: pinctrl@01c20800 { + compatible = "allwinner,sun8i-a83t-pinctrl"; + interrupts = , +- , +- ; ++ , ++ ; + reg = <0x01c20800 0x400>; + clocks = <&osc24M>; + gpio-controller; +@@ -172,27 +166,6 @@ + #interrupt-cells = <3>; + #gpio-cells = <3>; + +- i2c0_pins_a: i2c0@0 { +- allwinner,pins = "PH0", "PH1"; +- allwinner,function = "i2c0"; +- allwinner,drive = ; +- allwinner,pull = ; +- }; +- +- i2c1_pins_a: i2c1@0 { +- allwinner,pins = "PH2", "PH3"; +- allwinner,function = "i2c1"; +- allwinner,drive = ; +- allwinner,pull = ; +- }; +- +- i2c2_pins_a: i2c2@0 { +- allwinner,pins = "PH4", "PH5"; +- allwinner,function = "i2c2"; +- allwinner,drive = ; +- allwinner,pull = ; +- }; +- + mmc0_pins_a: mmc0@0 { + allwinner,pins = "PF0", "PF1", "PF2", + "PF3", "PF4", "PF5"; +@@ -201,24 +174,6 @@ + allwinner,pull = ; + }; + +- mmc1_pins_a: mmc1@0 { +- allwinner,pins = "PG0", "PG1", "PG2", +- "PG3", "PG4", "PG5"; +- allwinner,function = "mmc1"; +- allwinner,drive = ; +- allwinner,pull = ; +- }; +- +- mmc2_8bit_pins: mmc2_8bit { +- allwinner,pins = "PC5", "PC6", "PC8", +- "PC9", "PC10", "PC11", +- "PC12", "PC13", "PC14", +- "PC15"; +- allwinner,function = "mmc2"; +- allwinner,drive = ; +- allwinner,pull = ; +- }; +- + uart0_pins_a: uart0@0 { + allwinner,pins = "PF2", "PF4"; + allwinner,function = "uart0"; +@@ -234,6 +189,21 @@ + }; + }; + ++ timer@01c20c00 { ++ compatible = "allwinner,sun4i-a10-timer"; ++ reg = <0x01c20c00 0xa0>; ++ interrupts = , ++ ; ++ clocks = <&osc24M>; ++ }; ++ ++ watchdog@01c20ca0 { ++ compatible = "allwinner,sun6i-a31-wdt"; ++ reg = <0x01c20ca0 0x20>; ++ interrupts = ; ++ clocks = <&osc24M>; ++ }; ++ + uart0: serial@01c28000 { + compatible = "snps,dw-apb-uart"; + reg = <0x01c28000 0x400>; +@@ -243,5 +213,16 @@ + clocks = <&osc24M>; + status = "disabled"; + }; ++ ++ gic: interrupt-controller@01c81000 { ++ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; ++ reg = <0x01c81000 0x1000>, ++ <0x01c82000 0x1000>, ++ <0x01c84000 0x2000>, ++ <0x01c86000 0x2000>; ++ interrupt-controller; ++ #interrupt-cells = <3>; ++ interrupts = ; ++ }; + }; + }; +--- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts ++++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts +@@ -45,6 +45,7 @@ + #include "sunxi-common-regulators.dtsi" + + #include ++#include + #include + + / { +@@ -58,6 +59,43 @@ + chosen { + stdout-path = "serial0:115200n8"; + }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_opc>; ++ ++ status_led { ++ label = "status:red:user"; ++ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r_leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_r_opc>; ++ ++ tx { ++ label = "pwr:green:user"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++ ++ r_gpio_keys { ++ compatible = "gpio-keys"; ++ input-name = "sw4"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sw_r_opc>; ++ ++ sw4@0 { ++ label = "sw4"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; + }; + + &ehci1 { +@@ -72,6 +110,12 @@ + status = "okay"; + }; + ++&ir { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ir_pins_a>; ++ status = "okay"; ++}; ++ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; +@@ -94,6 +138,31 @@ + status = "okay"; + }; + ++&pio { ++ leds_opc: led_pins@0 { ++ allwinner,pins = "PA15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&r_pio { ++ leds_r_opc: led_pins@0 { ++ allwinner,pins = "PL10"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ sw_r_opc: key_pins@0 { ++ allwinner,pins = "PL03"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ + &uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_pins_a>; +--- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts ++++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts +@@ -45,6 +45,7 @@ + #include "sunxi-common-regulators.dtsi" + + #include ++#include + #include + + / { +@@ -70,6 +71,68 @@ + enable-active-high; + gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; + }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_opc>; ++ ++ status_led { ++ label = "status:red:user"; ++ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ r_leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&leds_r_opc>; ++ ++ tx { ++ label = "pwr:green:user"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ }; ++ ++ r_gpio_keys { ++ compatible = "gpio-keys"; ++ input-name = "sw4"; ++ ++ pinctrl-names = "default"; ++ pinctrl-0 = <&sw_r_opc>; ++ ++ sw4@0 { ++ label = "sw4"; ++ linux,code = ; ++ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++}; ++ ++&pio { ++ leds_opc: led_pins@0 { ++ allwinner,pins = "PA15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&r_pio { ++ leds_r_opc: led_pins@0 { ++ allwinner,pins = "PL10"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ sw_r_opc: key_pins@0 { ++ allwinner,pins = "PL03"; ++ allwinner,function = "gpio_in"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; + }; + + &ehci1 { +--- a/arch/arm/dts/sun8i-h3.dtsi ++++ b/arch/arm/dts/sun8i-h3.dtsi +@@ -83,12 +83,6 @@ + , + , + ; +- clock-frequency = <24000000>; +- arm,cpu-registers-not-fw-configured; +- }; +- +- memory { +- reg = <0x40000000 0x80000000>; + }; + + clocks { +@@ -131,15 +125,24 @@ + compatible = "allwinner,sun6i-a31-pll6-clk"; + reg = <0x01c20028 0x4>; + clocks = <&osc24M>; +- clock-output-names = "pll6", "pll6x2", "pll6d2"; ++ clock-output-names = "pll6", "pll6x2"; + }; + +- pll8: clk@01c20044 { +- #clock-cells = <1>; +- compatible = "allwinner,sun6i-a31-pll6-clk"; +- reg = <0x01c20044 0x4>; +- clocks = <&osc24M>; +- clock-output-names = "pll8", "pll8x2"; ++ pll6d2: pll6d2_clk { ++ #clock-cells = <0>; ++ compatible = "fixed-factor-clock"; ++ clock-div = <2>; ++ clock-mult = <1>; ++ clocks = <&pll6 0>; ++ clock-output-names = "pll6d2"; ++ }; ++ ++ /* dummy clock until pll6 can be reused */ ++ pll8: pll8_clk { ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-frequency = <1>; ++ clock-output-names = "pll8"; + }; + + cpu: cpu_clk@01c20050 { +@@ -170,7 +173,7 @@ + #clock-cells = <0>; + compatible = "allwinner,sun8i-h3-ahb2-clk"; + reg = <0x01c2005c 0x4>; +- clocks = <&ahb1>, <&pll6 2>; ++ clocks = <&ahb1>, <&pll6d2>; + clock-output-names = "ahb2"; + }; + +@@ -213,34 +216,34 @@ + <76>, <77>, <78>, + <96>, <97>, <98>, + <112>, <113>, +- <114>, <115>, <116>, +- <128>, <135>; +- clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0", +- "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand", +- "ahb1_sdram", "ahb2_gmac", "ahb1_ts", +- "ahb1_hstimer", "ahb1_spi0", +- "ahb1_spi1", "ahb1_otg", +- "ahb1_otg_ehci0", "ahb1_ehic1", +- "ahb1_ehic2", "ahb1_ehic3", +- "ahb1_otg_ohci0", "ahb2_ohic1", +- "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve", +- "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint", +- "ahb1_csi", "ahb1_tve", "ahb1_hdmi", +- "ahb1_de", "ahb1_gpu", "ahb1_msgbox", +- "ahb1_spinlock", "apb1_codec", +- "apb1_spdif", "apb1_pio", "apb1_ths", +- "apb1_i2s0", "apb1_i2s1", "apb1_i2s2", +- "apb2_i2c0", "apb2_i2c1", "apb2_i2c2", +- "apb2_uart0", "apb2_uart1", +- "apb2_uart2", "apb2_uart3", "apb2_scr", +- "ahb1_ephy", "ahb1_dbg"; ++ <114>, <115>, ++ <116>, <128>, <135>; ++ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", ++ "bus_mmc1", "bus_mmc2", "bus_nand", ++ "bus_sdram", "bus_gmac", "bus_ts", ++ "bus_hstimer", "bus_spi0", ++ "bus_spi1", "bus_otg", ++ "bus_otg_ehci0", "bus_ehci1", ++ "bus_ehci2", "bus_ehci3", ++ "bus_otg_ohci0", "bus_ohci1", ++ "bus_ohci2", "bus_ohci3", "bus_ve", ++ "bus_lcd0", "bus_lcd1", "bus_deint", ++ "bus_csi", "bus_tve", "bus_hdmi", ++ "bus_de", "bus_gpu", "bus_msgbox", ++ "bus_spinlock", "bus_codec", ++ "bus_spdif", "bus_pio", "bus_ths", ++ "bus_i2s0", "bus_i2s1", "bus_i2s2", ++ "bus_i2c0", "bus_i2c1", "bus_i2c2", ++ "bus_uart0", "bus_uart1", ++ "bus_uart2", "bus_uart3", ++ "bus_scr", "bus_ephy", "bus_dbg"; + }; + + mmc0_clk: clk@01c20088 { + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c20088 0x4>; +- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; ++ clocks = <&osc24M>, <&pll6 0>, <&pll8>; + clock-output-names = "mmc0", + "mmc0_output", + "mmc0_sample"; +@@ -250,7 +253,7 @@ + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c2008c 0x4>; +- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; ++ clocks = <&osc24M>, <&pll6 0>, <&pll8>; + clock-output-names = "mmc1", + "mmc1_output", + "mmc1_sample"; +@@ -260,7 +263,7 @@ + #clock-cells = <1>; + compatible = "allwinner,sun4i-a10-mmc-clk"; + reg = <0x01c20090 0x4>; +- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; ++ clocks = <&osc24M>, <&pll6 0>, <&pll8>; + clock-output-names = "mmc2", + "mmc2_output", + "mmc2_sample"; +@@ -285,6 +288,33 @@ + clocks = <&osc24M>, <&pll6 1>, <&pll5>; + clock-output-names = "mbus"; + }; ++ ++ apb0: apb0_clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clock-div = <1>; ++ clock-mult = <1>; ++ clocks = <&osc24M>; ++ clock-output-names = "apb0"; ++ }; ++ ++ apb0_gates: clk@01f01428 { ++ compatible = "allwinner,sun8i-h3-apb0-gates-clk", ++ "allwinner,sun4i-a10-gates-clk"; ++ reg = <0x01f01428 0x4>; ++ #clock-cells = <1>; ++ clocks = <&apb0>; ++ clock-indices = <0>, <1>; ++ clock-output-names = "apb0_pio", "apb0_ir"; ++ }; ++ ++ ir_clk: ir_clk@01f01454 { ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ reg = <0x01f01454 0x4>; ++ #clock-cells = <0>; ++ clocks = <&osc32k>, <&osc24M>; ++ clock-output-names = "ir"; ++ }; + }; + + soc { +@@ -298,7 +328,7 @@ + reg = <0x01c02000 0x1000>; + interrupts = ; + clocks = <&bus_gates 6>; +- resets = <&bus_rst 6>; ++ resets = <&ahb_rst 6>; + #dma-cells = <1>; + }; + +@@ -313,7 +343,7 @@ + "mmc", + "output", + "sample"; +- resets = <&bus_rst 8>; ++ resets = <&ahb_rst 8>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; +@@ -332,7 +362,7 @@ + "mmc", + "output", + "sample"; +- resets = <&bus_rst 9>; ++ resets = <&ahb_rst 9>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; +@@ -351,7 +381,7 @@ + "mmc", + "output", + "sample"; +- resets = <&bus_rst 10>; ++ resets = <&ahb_rst 10>; + reset-names = "ahb"; + interrupts = ; + status = "disabled"; +@@ -396,7 +426,7 @@ + reg = <0x01c1b000 0x100>; + interrupts = ; + clocks = <&bus_gates 25>, <&bus_gates 29>; +- resets = <&bus_rst 25>, <&bus_rst 29>; ++ resets = <&ahb_rst 25>, <&ahb_rst 29>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; +@@ -408,7 +438,7 @@ + interrupts = ; + clocks = <&bus_gates 29>, <&bus_gates 25>, + <&usb_clk 17>; +- resets = <&bus_rst 29>, <&bus_rst 25>; ++ resets = <&ahb_rst 29>, <&ahb_rst 25>; + phys = <&usbphy 1>; + phy-names = "usb"; + status = "disabled"; +@@ -419,7 +449,7 @@ + reg = <0x01c1c000 0x100>; + interrupts = ; + clocks = <&bus_gates 26>, <&bus_gates 30>; +- resets = <&bus_rst 26>, <&bus_rst 30>; ++ resets = <&ahb_rst 26>, <&ahb_rst 30>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; +@@ -431,7 +461,7 @@ + interrupts = ; + clocks = <&bus_gates 30>, <&bus_gates 26>, + <&usb_clk 18>; +- resets = <&bus_rst 30>, <&bus_rst 26>; ++ resets = <&ahb_rst 30>, <&ahb_rst 26>; + phys = <&usbphy 2>; + phy-names = "usb"; + status = "disabled"; +@@ -442,7 +472,7 @@ + reg = <0x01c1d000 0x100>; + interrupts = ; + clocks = <&bus_gates 27>, <&bus_gates 31>; +- resets = <&bus_rst 27>, <&bus_rst 31>; ++ resets = <&ahb_rst 27>, <&ahb_rst 31>; + phys = <&usbphy 3>; + phy-names = "usb"; + status = "disabled"; +@@ -454,7 +484,7 @@ + interrupts = ; + clocks = <&bus_gates 31>, <&bus_gates 27>, + <&usb_clk 19>; +- resets = <&bus_rst 31>, <&bus_rst 27>; ++ resets = <&ahb_rst 31>, <&ahb_rst 27>; + phys = <&usbphy 3>; + phy-names = "usb"; + status = "disabled"; +@@ -469,7 +499,7 @@ + gpio-controller; + #gpio-cells = <3>; + interrupt-controller; +- #interrupt-cells = <2>; ++ #interrupt-cells = <3>; + + uart0_pins_a: uart0@0 { + allwinner,pins = "PA4", "PA5"; +@@ -502,10 +532,22 @@ + }; + }; + +- bus_rst: reset@01c202c0 { ++ ahb_rst: reset@01c202c0 { + #reset-cells = <1>; +- compatible = "allwinner,sun8i-h3-bus-reset"; +- reg = <0x01c202c0 0x1c>; ++ compatible = "allwinner,sun6i-a31-ahb1-reset"; ++ reg = <0x01c202c0 0xc>; ++ }; ++ ++ apb1_rst: reset@01c202d0 { ++ #reset-cells = <1>; ++ compatible = "allwinner,sun6i-a31-clock-reset"; ++ reg = <0x01c202d0 0x4>; ++ }; ++ ++ apb2_rst: reset@01c202d8 { ++ #reset-cells = <1>; ++ compatible = "allwinner,sun6i-a31-clock-reset"; ++ reg = <0x01c202d8 0x4>; + }; + + timer@01c20c00 { +@@ -529,7 +571,7 @@ + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 112>; +- resets = <&bus_rst 144>; ++ resets = <&apb2_rst 16>; + dmas = <&dma 6>, <&dma 6>; + dma-names = "rx", "tx"; + status = "disabled"; +@@ -542,7 +584,7 @@ + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 113>; +- resets = <&bus_rst 145>; ++ resets = <&apb2_rst 17>; + dmas = <&dma 7>, <&dma 7>; + dma-names = "rx", "tx"; + status = "disabled"; +@@ -555,7 +597,7 @@ + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 114>; +- resets = <&bus_rst 146>; ++ resets = <&apb2_rst 18>; + dmas = <&dma 8>, <&dma 8>; + dma-names = "rx", "tx"; + status = "disabled"; +@@ -568,7 +610,7 @@ + reg-shift = <2>; + reg-io-width = <4>; + clocks = <&bus_gates 115>; +- resets = <&bus_rst 147>; ++ resets = <&apb2_rst 19>; + dmas = <&dma 9>, <&dma 9>; + dma-names = "rx", "tx"; + status = "disabled"; +@@ -591,5 +633,40 @@ + interrupts = , + ; + }; ++ ++ apb0_reset: reset@01f014b0 { ++ reg = <0x01f014b0 0x4>; ++ compatible = "allwinner,sun6i-a31-clock-reset"; ++ #reset-cells = <1>; ++ }; ++ ++ ir: ir@01f02000 { ++ compatible = "allwinner,sun5i-a13-ir"; ++ clocks = <&apb0_gates 1>, <&ir_clk>; ++ clock-names = "apb", "ir"; ++ resets = <&apb0_reset 1>; ++ interrupts = ; ++ reg = <0x01f02000 0x40>; ++ status = "disabled"; ++ }; ++ ++ r_pio: pinctrl@01f02c00 { ++ compatible = "allwinner,sun8i-h3-r-pinctrl"; ++ reg = <0x01f02c00 0x400>; ++ interrupts = ; ++ clocks = <&apb0_gates 0>; ++ resets = <&apb0_reset 0>; ++ gpio-controller; ++ #gpio-cells = <3>; ++ interrupt-controller; ++ #interrupt-cells = <3>; ++ ++ ir_pins_a: ir@0 { ++ allwinner,pins = "PL11"; ++ allwinner,function = "s_cir_rx"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ }; + }; + }; +--- a/arch/arm/dts/sun8i-q8-common.dtsi ++++ b/arch/arm/dts/sun8i-q8-common.dtsi +@@ -41,11 +41,23 @@ + */ + #include "sunxi-q8-common.dtsi" + ++#include ++ + / { + aliases { + serial0 = &r_uart; + }; + ++ backlight: backlight { ++ compatible = "pwm-backlight"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&bl_en_pin_q8>; ++ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; ++ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; ++ default-brightness-level = <8>; ++ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ ++ }; ++ + chosen { + stdout-path = "serial0:115200n8"; + }; +@@ -54,7 +66,7 @@ + &mmc0 { + pinctrl-names = "default"; + pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>; +- vmmc-supply = <®_vcc3v0>; ++ vmmc-supply = <®_dcdc1>; + bus-width = <4>; + cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ + cd-inverted; +@@ -77,8 +89,90 @@ + }; + }; + ++&r_rsb { ++ status = "okay"; ++ ++ axp22x: pmic@3a3 { ++ compatible = "x-powers,axp223"; ++ reg = <0x3a3>; ++ interrupt-parent = <&nmi_intc>; ++ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; ++ eldoin-supply = <®_dcdc1>; ++ }; ++}; ++ ++#include "axp22x.dtsi" ++ ++®_aldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-io"; ++}; ++ ++®_aldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <2350000>; ++ regulator-max-microvolt = <2650000>; ++ regulator-name = "vdd-dll"; ++}; ++ ++®_aldo3 { ++ regulator-always-on; ++ regulator-min-microvolt = <2700000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-pll-avcc"; ++}; ++ ++®_dc1sw { ++ regulator-name = "vcc-lcd"; ++}; ++ ++®_dc5ldo { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpus"; ++}; ++ ++®_dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "vcc-3v0"; ++}; ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-sys"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc5 { ++ regulator-always-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ regulator-name = "vcc-dram"; ++}; ++ ++®_rtc_ldo { ++ regulator-name = "vcc-rtc"; ++}; ++ + &r_uart { + pinctrl-names = "default"; + pinctrl-0 = <&r_uart_pins_a>; + status = "okay"; + }; ++ ++&simplefb_lcd { ++ vcc-lcd-supply = <®_dc1sw>; ++}; +--- a/arch/arm/dts/sun9i-a80-cubieboard4.dts ++++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts +@@ -62,9 +62,31 @@ + stdout-path = "serial0:115200n8"; + }; + ++ leds { ++ compatible = "gpio-leds"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&led_pins_cubieboard4>; ++ ++ green { ++ label = "cubieboard4:green:usr"; ++ gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */ ++ }; ++ ++ red { ++ label = "cubieboard4:red:usr"; ++ gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ ++ }; ++ }; + }; + + &pio { ++ led_pins_cubieboard4: led-pins@0 { ++ allwinner,pins = "PH6", "PH17"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ + mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 { + allwinner,pins = "PH18"; + allwinner,function = "gpio_in"; +@@ -89,6 +111,20 @@ + vmmc-supply = <®_vcc3v0>; + bus-width = <8>; + non-removable; ++ cap-mmc-hw-reset; ++ status = "okay"; ++}; ++ ++&mmc2_8bit_pins { ++ /* Increase drive strength for DDR modes */ ++ allwinner,drive = ; ++}; ++ ++&r_ir { ++ status = "okay"; ++}; ++ ++&r_rsb { + status = "okay"; + }; + +--- a/arch/arm/dts/sun9i-a80-optimus.dts ++++ b/arch/arm/dts/sun9i-a80-optimus.dts +@@ -65,7 +65,7 @@ + leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; +- pinctrl-0 = <&led_pins_optimus>; ++ pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>; + + /* The LED names match those found on the board */ + +@@ -74,7 +74,10 @@ + gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; + }; + +- /* led3 is on PM15, in R_PIO */ ++ led3 { ++ label = "optimus:led3:usr"; ++ gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */ ++ }; + + led4 { + label = "optimus:led4:usr"; +@@ -106,17 +109,6 @@ + status = "okay"; + }; + +-&i2c3 { +- pinctrl-names = "default"; +- pinctrl-0 = <&i2c3_pins_a>; +- status = "okay"; +-}; +- +-&i2c3_pins_a { +- /* Enable internal pull-up */ +- allwinner,pull = ; +-}; +- + &ohci0 { + status = "okay"; + }; +@@ -171,30 +163,42 @@ + vmmc-supply = <®_vcc3v0>; + bus-width = <8>; + non-removable; ++ cap-mmc-hw-reset; + status = "okay"; + }; + ++&mmc2_8bit_pins { ++ /* Increase drive strength for DDR modes */ ++ allwinner,drive = ; ++}; ++ + ®_usb1_vbus { + pinctrl-0 = <&usb1_vbus_pin_optimus>; + gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + status = "okay"; + }; + +-&uart0 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart0_pins_a>; ++&r_ir { + status = "okay"; + }; + +-&uart4 { +- pinctrl-names = "default"; +- pinctrl-0 = <&uart4_pins_a>; ++&r_pio { ++ led_r_pins_optimus: led-pins@1 { ++ allwinner,pins = "PM15"; ++ allwinner,function = "gpio_out"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++}; ++ ++&r_rsb { + status = "okay"; + }; + +-&uart4_pins_a { +- /* Enable internal pull-up */ +- allwinner,pull = ; ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; + }; + + &usbphy1 { +--- a/arch/arm/dts/sun9i-a80.dtsi ++++ b/arch/arm/dts/sun9i-a80.dtsi +@@ -128,6 +128,17 @@ + */ + ranges = <0 0 0 0x20000000>; + ++ /* ++ * This clock is actually configurable from the PRCM address ++ * space. The external 24M oscillator can be turned off, and ++ * the clock switched to an internal 16M RC oscillator. Under ++ * normal operation there's no reason to do this, and the ++ * default is to use the external good one, so just model this ++ * as a fixed clock. Also it is not entirely clear if the ++ * osc24M mux in the PRCM affects the entire clock tree, which ++ * would also throw all the PLL clock rates off, or just the ++ * downstream clocks in the PRCM. ++ */ + osc24M: osc24M_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; +@@ -135,6 +146,13 @@ + clock-output-names = "osc24M"; + }; + ++ /* ++ * The 32k clock is from an external source, normally the ++ * AC100 codec/RTC chip. This clock is by default enabled ++ * and clocked at 32768 Hz, from the oscillator connected ++ * to the AC100. It is configurable, but no such driver or ++ * bindings exist yet. ++ */ + osc32k: osc32k_clk { + #clock-cells = <0>; + compatible = "fixed-clock"; +@@ -164,6 +182,14 @@ + "usb_phy2", "usb_hsic_12M"; + }; + ++ pll3: clk@06000008 { ++ /* placeholder until implemented */ ++ #clock-cells = <0>; ++ compatible = "fixed-clock"; ++ clock-rate = <0>; ++ clock-output-names = "pll3"; ++ }; ++ + pll4: clk@0600000c { + #clock-cells = <0>; + compatible = "allwinner,sun9i-a80-pll4-clk"; +@@ -277,9 +303,12 @@ + compatible = "allwinner,sun9i-a80-ahb0-gates-clk"; + reg = <0x06000580 0x4>; + clocks = <&ahb0>; +- clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>, +- <14>, <15>, <16>, <18>, <20>, <21>, +- <22>, <23>; ++ clock-indices = <0>, <1>, <3>, ++ <5>, <8>, <12>, ++ <13>, <14>, ++ <15>, <16>, <18>, ++ <20>, <21>, <22>, ++ <23>; + clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu", + "ahb0_ss", "ahb0_sd", "ahb0_nand1", + "ahb0_nand0", "ahb0_sdram", +@@ -293,7 +322,10 @@ + compatible = "allwinner,sun9i-a80-ahb1-gates-clk"; + reg = <0x06000584 0x4>; + clocks = <&ahb1>; +- clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>; ++ clock-indices = <0>, <1>, ++ <17>, <21>, ++ <22>, <23>, ++ <24>; + clock-output-names = "ahb1_usbotg", "ahb1_usbhci", + "ahb1_gmac", "ahb1_msgbox", + "ahb1_spinlock", "ahb1_hstimer", +@@ -305,8 +337,9 @@ + compatible = "allwinner,sun9i-a80-ahb2-gates-clk"; + reg = <0x06000588 0x4>; + clocks = <&ahb2>; +- clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>, +- <11>; ++ clock-indices = <0>, <1>, ++ <2>, <4>, <5>, ++ <7>, <8>, <11>; + clock-output-names = "ahb2_lcd0", "ahb2_lcd1", + "ahb2_edp", "ahb2_csi", "ahb2_hdmi", + "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi"; +@@ -317,8 +350,10 @@ + compatible = "allwinner,sun9i-a80-apb0-gates-clk"; + reg = <0x06000590 0x4>; + clocks = <&apb0>; +- clock-indices = <1>, <5>, <11>, <12>, <13>, <15>, +- <17>, <18>, <19>; ++ clock-indices = <1>, <5>, ++ <11>, <12>, <13>, ++ <15>, <17>, <18>, ++ <19>; + clock-output-names = "apb0_spdif", "apb0_pio", + "apb0_ac97", "apb0_i2s0", "apb0_i2s1", + "apb0_lradc", "apb0_gpadc", "apb0_twd", +@@ -330,14 +365,79 @@ + compatible = "allwinner,sun9i-a80-apb1-gates-clk"; + reg = <0x06000594 0x4>; + clocks = <&apb1>; +- clock-indices = <0>, <1>, <2>, <3>, <4>, +- <16>, <17>, <18>, <19>, <20>, <21>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, <4>, ++ <16>, <17>, ++ <18>, <19>, ++ <20>, <21>; + clock-output-names = "apb1_i2c0", "apb1_i2c1", + "apb1_i2c2", "apb1_i2c3", "apb1_i2c4", + "apb1_uart0", "apb1_uart1", + "apb1_uart2", "apb1_uart3", + "apb1_uart4", "apb1_uart5"; + }; ++ ++ cpus_clk: clk@08001410 { ++ compatible = "allwinner,sun9i-a80-cpus-clk"; ++ reg = <0x08001410 0x4>; ++ #clock-cells = <0>; ++ clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>; ++ clock-output-names = "cpus"; ++ }; ++ ++ ahbs: ahbs_clk { ++ compatible = "fixed-factor-clock"; ++ #clock-cells = <0>; ++ clock-div = <1>; ++ clock-mult = <1>; ++ clocks = <&cpus_clk>; ++ clock-output-names = "ahbs"; ++ }; ++ ++ apbs: clk@0800141c { ++ compatible = "allwinner,sun8i-a23-apb0-clk"; ++ reg = <0x0800141c 0x4>; ++ #clock-cells = <0>; ++ clocks = <&ahbs>; ++ clock-output-names = "apbs"; ++ }; ++ ++ apbs_gates: clk@08001428 { ++ compatible = "allwinner,sun9i-a80-apbs-gates-clk"; ++ reg = <0x08001428 0x4>; ++ #clock-cells = <1>; ++ clocks = <&apbs>; ++ clock-indices = <0>, <1>, ++ <2>, <3>, ++ <4>, <5>, ++ <6>, <7>, ++ <12>, <13>, ++ <16>, <17>, ++ <18>, <20>; ++ clock-output-names = "apbs_pio", "apbs_ir", ++ "apbs_timer", "apbs_rsb", ++ "apbs_uart", "apbs_1wire", ++ "apbs_i2c0", "apbs_i2c1", ++ "apbs_ps2_0", "apbs_ps2_1", ++ "apbs_dma", "apbs_i2s0", ++ "apbs_i2s1", "apbs_twd"; ++ }; ++ ++ r_1wire_clk: clk@08001450 { ++ reg = <0x08001450 0x4>; ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ clocks = <&osc32k>, <&osc24M>; ++ clock-output-names = "r_1wire"; ++ }; ++ ++ r_ir_clk: clk@08001454 { ++ reg = <0x08001454 0x4>; ++ #clock-cells = <0>; ++ compatible = "allwinner,sun4i-a10-mod0-clk"; ++ clocks = <&osc32k>, <&osc24M>; ++ clock-output-names = "r_ir"; ++ }; + }; + + soc { +@@ -443,7 +543,7 @@ + }; + + mmc0: mmc@01c0f000 { +- compatible = "allwinner,sun5i-a13-mmc"; ++ compatible = "allwinner,sun9i-a80-mmc"; + reg = <0x01c0f000 0x1000>; + clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>, + <&mmc0_clk 1>, <&mmc0_clk 2>; +@@ -457,7 +557,7 @@ + }; + + mmc1: mmc@01c10000 { +- compatible = "allwinner,sun5i-a13-mmc"; ++ compatible = "allwinner,sun9i-a80-mmc"; + reg = <0x01c10000 0x1000>; + clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>, + <&mmc1_clk 1>, <&mmc1_clk 2>; +@@ -471,7 +571,7 @@ + }; + + mmc2: mmc@01c11000 { +- compatible = "allwinner,sun5i-a13-mmc"; ++ compatible = "allwinner,sun9i-a80-mmc"; + reg = <0x01c11000 0x1000>; + clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>, + <&mmc2_clk 1>, <&mmc2_clk 2>; +@@ -485,7 +585,7 @@ + }; + + mmc3: mmc@01c12000 { +- compatible = "allwinner,sun5i-a13-mmc"; ++ compatible = "allwinner,sun9i-a80-mmc"; + reg = <0x01c12000 0x1000>; + clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>, + <&mmc3_clk 1>, <&mmc3_clk 2>; +@@ -582,7 +682,7 @@ + clocks = <&apb0_gates 5>; + gpio-controller; + interrupt-controller; +- #interrupt-cells = <2>; ++ #interrupt-cells = <3>; + #size-cells = <0>; + #gpio-cells = <3>; + +@@ -604,7 +704,8 @@ + mmc2_8bit_pins: mmc2_8bit { + allwinner,pins = "PC6", "PC7", "PC8", "PC9", + "PC10", "PC11", "PC12", +- "PC13", "PC14", "PC15"; ++ "PC13", "PC14", "PC15", ++ "PC16"; + allwinner,function = "mmc2"; + allwinner,drive = ; + allwinner,pull = ; +@@ -752,14 +853,83 @@ + interrupts = ; + }; + ++ apbs_rst: reset@080014b0 { ++ reg = <0x080014b0 0x4>; ++ compatible = "allwinner,sun6i-a31-clock-reset"; ++ #reset-cells = <1>; ++ }; ++ ++ nmi_intc: interrupt-controller@080015a0 { ++ compatible = "allwinner,sun9i-a80-nmi"; ++ interrupt-controller; ++ #interrupt-cells = <2>; ++ reg = <0x080015a0 0xc>; ++ interrupts = ; ++ }; ++ ++ r_ir: ir@08002000 { ++ compatible = "allwinner,sun5i-a13-ir"; ++ interrupts = ; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&r_ir_pins>; ++ clocks = <&apbs_gates 1>, <&r_ir_clk>; ++ clock-names = "apb", "ir"; ++ resets = <&apbs_rst 1>; ++ reg = <0x08002000 0x40>; ++ status = "disabled"; ++ }; ++ + r_uart: serial@08002800 { + compatible = "snps,dw-apb-uart"; + reg = <0x08002800 0x400>; + interrupts = ; + reg-shift = <2>; + reg-io-width = <4>; +- clocks = <&osc24M>; ++ clocks = <&apbs_gates 4>; ++ resets = <&apbs_rst 4>; + status = "disabled"; + }; ++ ++ r_pio: pinctrl@08002c00 { ++ compatible = "allwinner,sun9i-a80-r-pinctrl"; ++ reg = <0x08002c00 0x400>; ++ interrupts = , ++ ; ++ clocks = <&apbs_gates 0>; ++ resets = <&apbs_rst 0>; ++ gpio-controller; ++ interrupt-controller; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ #gpio-cells = <3>; ++ ++ r_ir_pins: r_ir { ++ allwinner,pins = "PL6"; ++ allwinner,function = "s_cir_rx"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ ++ r_rsb_pins: r_rsb { ++ allwinner,pins = "PN0", "PN1"; ++ allwinner,function = "s_rsb"; ++ allwinner,drive = ; ++ allwinner,pull = ; ++ }; ++ }; ++ ++ r_rsb: i2c@08003400 { ++ compatible = "allwinner,sun8i-a23-rsb"; ++ reg = <0x08003400 0x400>; ++ interrupts = ; ++ clocks = <&apbs_gates 3>; ++ clock-frequency = <3000000>; ++ resets = <&apbs_rst 3>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&r_rsb_pins>; ++ status = "disabled"; ++ #address-cells = <1>; ++ #size-cells = <0>; ++ }; + }; + }; +--- /dev/null ++++ b/arch/arm/dts/sunxi-itead-core-common.dtsi +@@ -0,0 +1,136 @@ ++/* ++ * Copyright 2015 - Marcus Cooper ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#include "sunxi-common-regulators.dtsi" ++ ++/ { ++ aliases { ++ serial0 = &uart0; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++}; ++ ++&cpu0 { ++ cpu-supply = <®_dcdc2>; ++}; ++ ++&ehci0 { ++ status = "okay"; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&i2c0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c0_pins_a>; ++ status = "okay"; ++ ++ axp209: pmic@34 { ++ reg = <0x34>; ++ }; ++}; ++ ++&i2c1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&i2c1_pins_a>; ++ status = "okay"; ++}; ++ ++&ohci0 { ++ status = "okay"; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++#include "axp209.dtsi" ++ ++®_dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-cpu"; ++}; ++ ++®_dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1000000>; ++ regulator-max-microvolt = <1400000>; ++ regulator-name = "vdd-int-dll"; ++}; ++ ++®_ldo1 { ++ regulator-name = "vdd-rtc"; ++}; ++ ++®_ldo2 { ++ regulator-always-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ regulator-name = "avcc"; ++}; ++ ++®_usb1_vbus { ++ status = "okay"; ++}; ++ ++®_usb2_vbus { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ usb1_vbus-supply = <®_usb1_vbus>; ++ usb2_vbus-supply = <®_usb2_vbus>; ++ status = "okay"; ++}; +--- a/arch/arm/dts/sunxi-q8-common.dtsi ++++ b/arch/arm/dts/sunxi-q8-common.dtsi +@@ -75,3 +75,9 @@ + voltage = <400000>; + }; + }; ++ ++&pwm { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pwm0_pins>; ++ status = "okay"; ++}; diff --git a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch new file mode 100644 index 000000000..45416703a --- /dev/null +++ b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch @@ -0,0 +1,38 @@ +From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 16 Mar 2016 20:44:51 +0100 +Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i + +The clock_sun6i.c implementation was not deasserting the reset for +the regular i2c controllers, this commit fixes this. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c ++++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) + return 0; + } + +- /* set the apb clock gate for twi */ +- if (state) ++ /* set the apb clock gate and reset for twi */ ++ if (state) { + setbits_le32(&ccm->apb2_gate, + CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); +- else ++ setbits_le32(&ccm->apb2_reset_cfg, ++ 1 << (APB2_RESET_TWI_SHIFT + port)); ++ } else { ++ clrbits_le32(&ccm->apb2_reset_cfg, ++ 1 << (APB2_RESET_TWI_SHIFT + port)); + clrbits_le32(&ccm->apb2_gate, + CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); ++ } + + return 0; + } diff --git a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch b/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch new file mode 100644 index 000000000..47f825c57 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch @@ -0,0 +1,24 @@ +From 1eae8f66ff749409eb96e2f3f3387c56232d0b8a Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 16 Mar 2016 13:46:22 +0100 +Subject: [PATCH] sunxi: Enable realtek phy support + +Enable building of drivers/net/phy/realtek.c so that realtek phys +get properly initialized. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + include/configs/sunxi-common.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -314,6 +314,7 @@ extern int soft_i2c_gpio_scl; + #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ + #define CONFIG_PHY_ADDR 1 + #define CONFIG_MII /* MII PHY management */ ++#define CONFIG_PHY_REALTEK + #endif + + #ifdef CONFIG_USB_EHCI_HCD diff --git a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch b/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch new file mode 100644 index 000000000..cf511ce77 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch @@ -0,0 +1,127 @@ +From fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 17 Mar 2016 13:53:03 +0100 +Subject: [PATCH] sunxi: Fix gmac not working due to cpu_eth_init no longer + being called + +cpu_eth_init is no longer called for dm enabled eth drivers, this +was causing the sunxi gmac eth controller to no longer work in u-boot. + +This commit fixes this by calling the clock, reset and pinmux setup +function from s_init() and enabling the phy power pin (if any) from +board_init(). + +The enabling of phy power cannot be done from s_init because it uses dm +and dm is not ready yet at this point. + +Note that the mdelay is dropped as the phy gets enabled much earlier +now, so it is no longer needed. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +Tested-by: Karsten Merker +Tested-by: Michael Haas +--- + arch/arm/cpu/armv7/sunxi/board.c | 28 +--------------------------- + arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 +++++- + board/sunxi/board.c | 5 +++++ + board/sunxi/gmac.c | 14 +------------- + 4 files changed, 12 insertions(+), 41 deletions(-) + +--- a/arch/arm/cpu/armv7/sunxi/board.c ++++ b/arch/arm/cpu/armv7/sunxi/board.c +@@ -136,6 +136,7 @@ void s_init(void) + timer_init(); + gpio_init(); + i2c_init_board(); ++ eth_init_board(); + } + + #ifdef CONFIG_SPL_BUILD +@@ -243,30 +244,3 @@ void enable_caches(void) + dcache_enable(); + } + #endif +- +-#ifdef CONFIG_CMD_NET +-/* +- * Initializes on-chip ethernet controllers. +- * to override, implement board_eth_init() +- */ +-int cpu_eth_init(bd_t *bis) +-{ +- __maybe_unused int rc; +- +-#ifdef CONFIG_MACPWR +- gpio_request(CONFIG_MACPWR, "macpwr"); +- gpio_direction_output(CONFIG_MACPWR, 1); +- mdelay(200); +-#endif +- +-#ifdef CONFIG_SUNXI_GMAC +- rc = sunxi_gmac_initialize(bis); +- if (rc < 0) { +- printf("sunxi: failed to initialize gmac\n"); +- return rc; +- } +-#endif +- +- return 0; +-} +-#endif +--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h ++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h +@@ -24,6 +24,10 @@ void sdelay(unsigned long); + void return_to_fel(uint32_t lr, uint32_t sp); + + /* Board / SoC level designware gmac init */ +-int sunxi_gmac_initialize(bd_t *bis); ++#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC ++void eth_init_board(void); ++#else ++static inline void eth_init_board(void) {} ++#endif + + #endif +--- a/board/sunxi/board.c ++++ b/board/sunxi/board.c +@@ -90,6 +90,11 @@ int board_init(void) + if (ret) + return ret; + ++#ifdef CONFIG_MACPWR ++ gpio_request(CONFIG_MACPWR, "macpwr"); ++ gpio_direction_output(CONFIG_MACPWR, 1); ++#endif ++ + /* Uses dm gpio code so do this here and not in i2c_init_board() */ + return soft_i2c_board_init(); + } +--- a/board/sunxi/gmac.c ++++ b/board/sunxi/gmac.c +@@ -6,7 +6,7 @@ + #include + #include + +-int sunxi_gmac_initialize(bd_t *bis) ++void eth_init_board(void) + { + int pin; + struct sunxi_ccm_reg *const ccm = +@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis) + for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++) + sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC); + #endif +- +-#ifdef CONFIG_DM_ETH +- return 0; +-#else +-# ifdef CONFIG_RGMII +- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); +-# elif defined CONFIG_GMII +- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII); +-# else +- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII); +-# endif +-#endif + } diff --git a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch b/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch new file mode 100644 index 000000000..95a77c68d --- /dev/null +++ b/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch @@ -0,0 +1,78 @@ +From 948603d4d637a0e04a3214253b911cfc4ed11220 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 21 Mar 2016 14:44:35 +0100 +Subject: [PATCH] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer + working + +The 2nd usb controller on sun4i/sun7i has its base address 0x8000 +bytes from the 1st one, rather then 0x1000. Also the ahb clk gates +are interleaved with the ohci clk-gates introducing a hole between +the clks for usb1 and usb2. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + drivers/usb/host/ehci-sunxi.c | 13 +++++++++++-- + drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++--- + 2 files changed, 23 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/ehci-sunxi.c ++++ b/drivers/usb/host/ehci-sunxi.c +@@ -17,6 +17,14 @@ + #include + #include "ehci.h" + ++#ifdef CONFIG_SUNXI_GEN_SUN4I ++#define BASE_DIST 0x8000 ++#define AHB_CLK_DIST 2 ++#else ++#define BASE_DIST 0x1000 ++#define AHB_CLK_DIST 1 ++#endif ++ + struct ehci_sunxi_priv { + struct ehci_ctrl ehci; + int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ +@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice + #ifdef CONFIG_MACH_SUN8I_H3 + priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0; + #endif +- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1; +- priv->ahb_gate_mask <<= priv->phy_index - 1; ++ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST; ++ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; ++ priv->phy_index++; /* Non otg phys start at 1 */ + + setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); + #ifdef CONFIG_SUNXI_GEN_SUN6I +--- a/drivers/usb/host/ohci-sunxi.c ++++ b/drivers/usb/host/ohci-sunxi.c +@@ -17,6 +17,14 @@ + #include + #include "ohci.h" + ++#ifdef CONFIG_SUNXI_GEN_SUN4I ++#define BASE_DIST 0x8000 ++#define AHB_CLK_DIST 2 ++#else ++#define BASE_DIST 0x1000 ++#define AHB_CLK_DIST 1 ++#endif ++ + struct ohci_sunxi_priv { + ohci_t ohci; + int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ +@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice + priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0; + #endif + priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK; +- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1; +- priv->ahb_gate_mask <<= priv->phy_index - 1; +- priv->usb_gate_mask <<= priv->phy_index - 1; ++ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST; ++ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; ++ priv->usb_gate_mask <<= priv->phy_index; ++ priv->phy_index++; /* Non otg phys start at 1 */ + + setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); + setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask); diff --git a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch b/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch new file mode 100644 index 000000000..04a2af72e --- /dev/null +++ b/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch @@ -0,0 +1,31 @@ +From 8f10b5c65611e6c15a113bf63289b6696452f90d Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Sun, 20 Mar 2016 14:17:10 +0100 +Subject: [PATCH] spl: Print from which mmc slot spl is trying to boot + +On some sunxi boards (and presumably also non sunxi boards) u-boot can +be either loaded from a sdcard in a micro-sd slot, or from eMMC. + +Print which MMC spl tries to boot from, to help debugging. + +Signed-off-by: Hans de Goede +Reviewed-by: Tom Rini +--- + common/spl/spl.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/common/spl/spl.c ++++ b/common/spl/spl.c +@@ -210,9 +210,9 @@ struct boot_device_name boot_name_table[ + { BOOT_DEVICE_RAM, "RAM" }, + #endif + #ifdef CONFIG_SPL_MMC_SUPPORT +- { BOOT_DEVICE_MMC1, "MMC" }, +- { BOOT_DEVICE_MMC2, "MMC" }, +- { BOOT_DEVICE_MMC2_2, "MMC" }, ++ { BOOT_DEVICE_MMC1, "MMC1" }, ++ { BOOT_DEVICE_MMC2, "MMC2" }, ++ { BOOT_DEVICE_MMC2_2, "MMC2_2" }, + #endif + #ifdef CONFIG_SPL_NAND_SUPPORT + { BOOT_DEVICE_NAND, "NAND" }, diff --git a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch b/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch new file mode 100644 index 000000000..098fe7203 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch @@ -0,0 +1,39 @@ +From 60fa63012fcdc3c4ec1497bf5e358f0a90b40949 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 18 Mar 2016 08:42:01 +0100 +Subject: [PATCH] sunxi: Add support for USB vbus pin for USB3 + +The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 + + board/sunxi/Kconfig | 6 ++++++ + 2 files changed, 7 insertions(+) + +--- a/arch/arm/cpu/armv7/sunxi/usb_phy.c ++++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c +@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index) + case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN); + case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN); + case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN); ++ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN); + } + return -EINVAL; + } +--- a/board/sunxi/Kconfig ++++ b/board/sunxi/Kconfig +@@ -341,6 +341,12 @@ config USB2_VBUS_PIN + ---help--- + See USB1_VBUS_PIN help text. + ++config USB3_VBUS_PIN ++ string "Vbus enable pin for usb3 (ehci2)" ++ default "" ++ ---help--- ++ See USB1_VBUS_PIN help text. ++ + config I2C0_ENABLE + bool "Enable I2C/TWI controller 0" + default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I diff --git a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch b/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch new file mode 100644 index 000000000..a216bc9f1 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch @@ -0,0 +1,31 @@ +From ce0d0926758f631fdd655d438acd32d5935d43a4 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Fri, 18 Mar 2016 08:45:21 +0100 +Subject: [PATCH] sunxi: Specify USB vbus pins for orangepi boards + +This fixes the USB ports not working on the orangepi_plus and stops us +from messing with gpio-s which we should not touch on the orangepi_pc. + +Signed-off-by: Hans de Goede +Acked-by: Ian Campbell +--- + configs/orangepi_pc_defconfig | 3 +++ + configs/orangepi_plus_defconfig | 1 + + 2 files changed, 4 insertions(+) + +--- a/configs/orangepi_pc_defconfig ++++ b/configs/orangepi_pc_defconfig +@@ -14,3 +14,6 @@ CONFIG_SPL=y + CONFIG_CMD_GPIO=y + CONFIG_SY8106A_POWER=y + CONFIG_USB_EHCI_HCD=y ++CONFIG_USB1_VBUS_PIN="" ++CONFIG_USB2_VBUS_PIN="" ++CONFIG_USB3_VBUS_PIN="" +--- a/configs/orangepi_plus_defconfig ++++ b/configs/orangepi_plus_defconfig +@@ -14,3 +14,4 @@ CONFIG_SPL=y + CONFIG_CMD_GPIO=y + CONFIG_SY8106A_POWER=y + CONFIG_USB_EHCI_HCD=y ++CONFIG_USB1_VBUS_PIN="PG13" diff --git a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch b/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch new file mode 100644 index 000000000..e7b8cd73d --- /dev/null +++ b/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch @@ -0,0 +1,33 @@ +From 70fe24ed93fa90eb407d18a5fc9d9ad85ac9184c Mon Sep 17 00:00:00 2001 +From: Chen-Yu Tsai +Date: Wed, 27 Jan 2016 16:34:43 +0800 +Subject: [PATCH] sunxi: Support SID e-fuses on A83T and H3 + +On the A83T and H3, the SID block is at a different address. +Furthurmore, the e-fuses are at an offset of 0x200 within the +hardware's address space. + +Signed-off-by: Chen-Yu Tsai +Acked-by: Hans de Goede +Signed-off-by: Hans de Goede +--- + arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h ++++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h +@@ -82,7 +82,14 @@ + #define SUNXI_AD_DA_BASE 0x01c22c00 + #define SUNXI_KEYPAD_BASE 0x01c23000 + #define SUNXI_TZPC_BASE 0x01c23400 ++ ++#if defined(CONFIG_MACH_SUN8I_A83T) || defined(CONFIG_MACH_SUN8I_H3) ++/* SID address space starts at 0x01c1400, but e-fuse is at offset 0x200 */ ++#define SUNXI_SID_BASE 0x01c14200 ++#else + #define SUNXI_SID_BASE 0x01c23800 ++#endif ++ + #define SUNXI_SJTAG_BASE 0x01c23c00 + + #define SUNXI_TP_BASE 0x01c25000 diff --git a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch b/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch new file mode 100644 index 000000000..d49fc9737 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch @@ -0,0 +1,23 @@ +From 2af25b747340c6c8f6a6b9e27632db577bf4da52 Mon Sep 17 00:00:00 2001 +From: Simon Glass +Date: Mon, 22 Feb 2016 22:55:46 -0700 +Subject: [PATCH] sunxi: Display the board model on start-up + +It is useful to know which sunxi board you are booting. Display this on +start-up to avoid confusion. + +Signed-off-by: Simon Glass +--- + include/configs/sunxi-common.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -174,6 +174,7 @@ + + #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ + #define CONFIG_IDENT_STRING " Allwinner Technology" ++#define CONFIG_DISPLAY_BOARDINFO + + #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ + #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ diff --git a/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch deleted file mode 100644 index a7bfdd62d..000000000 --- a/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 335d30050b0d02444c9297f7a9b0cbf75dce847f Mon Sep 17 00:00:00 2001 -From: Olliver Schinagl -Date: Fri, 12 May 2017 11:38:54 +0200 -Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC - -This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash -storage. -https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ - -It is a assembly variant of the regular Lime2 but featuring eMMC for -storage. - -Signed-off-by: Olliver Schinagl -Signed-off-by: Jagan Teki -Acked-by: Maxime Ripard -Reviewed-by: Jagan Teki ---- - board/sunxi/MAINTAINERS | 5 +++++ - configs/A20-OLinuXino-Lime2-eMMC_defconfig | 36 ++++++++++++++++++++++++++++++ - 2 files changed, 41 insertions(+) - create mode 100644 configs/A20-OLinuXino-Lime2-eMMC_defconfig - ---- a/board/sunxi/MAINTAINERS -+++ b/board/sunxi/MAINTAINERS -@@ -88,6 +88,11 @@ M: Iain Paton - S: Maintained - F: configs/A20-OLinuXino-Lime2_defconfig - -+A20-OLINUXINO-LIME2-EMMC BOARD -+M: Olliver Schinagl -+S: Maintained -+F: configs/A20-OLinuXino-Lime2-eMMC_defconfig -+ - A33-OLINUXINO BOARD - M: Stefan Mavrodiev - S: Maintained ---- /dev/null -+++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig -@@ -0,0 +1,37 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_SUNXI=y -+CONFIG_MACH_SUN7I=y -+CONFIG_DRAM_CLK=384 -+CONFIG_MMC0_CD_PIN="PH1" -+CONFIG_MMC_SUNXI_SLOT_EXTRA=2 -+CONFIG_USB0_VBUS_PIN="PC17" -+CONFIG_USB0_VBUS_DET="PH5" -+CONFIG_I2C1_ENABLE=y -+CONFIG_SATAPWR="PC3" -+CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc" -+CONFIG_AHCI=y -+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -+CONFIG_SPL=y -+CONFIG_SPL_I2C_SUPPORT=y -+# CONFIG_CMD_IMLS is not set -+# CONFIG_CMD_FLASH is not set -+CONFIG_CMD_DFU=y -+CONFIG_CMD_USB_MASS_STORAGE=y -+# CONFIG_CMD_FPGA is not set -+# CONFIG_SPL_DOS_PARTITION is not set -+# CONFIG_SPL_ISO_PARTITION is not set -+# CONFIG_SPL_PARTITION_UUIDS is not set -+CONFIG_DFU_RAM=y -+CONFIG_ETH_DESIGNWARE=y -+CONFIG_RGMII=y -+CONFIG_SUN7I_GMAC=y -+CONFIG_GMAC_TX_DELAY=1 -+CONFIG_AXP_ALDO3_VOLT=2800 -+CONFIG_AXP_ALDO4_VOLT=2800 -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_MUSB_GADGET=y -+CONFIG_USB_GADGET=y -+CONFIG_USB_GADGET_DOWNLOAD=y -+CONFIG_G_DNL_MANUFACTURER="Allwinner Technology" -+CONFIG_G_DNL_VENDOR_NUM=0x1f3a -+CONFIG_G_DNL_PRODUCT_NUM=0x1010 diff --git a/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch deleted file mode 100644 index 8db3e67e5..000000000 --- a/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fb7fe04da2187b9853d713cb643d01bd56813e3d Mon Sep 17 00:00:00 2001 -From: Emmanuel Vadot -Date: Fri, 12 May 2017 11:38:53 +0200 -Subject: ARM: dts: sunxi: Change node name for pwrseq pin on - Olinuxino-lime2-emmc - -The node name for the power seq pin is mmc2@0 like the mmc2_pins_a one. -This makes the original node (mmc2_pins_a) scrapped out of the dtb and -result in a unusable eMMC if U-Boot didn't configured the pins to the -correct functions. - -Signed-off-by: Emmanuel Vadot -Signed-off-by: Maxime Ripard -Signed-off-by: Olliver Schinagl -Acked-by: Maxime Ripard -Reviewed-by: Jagan Teki ---- - arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts -@@ -56,7 +56,7 @@ - }; - - &pio { -- mmc2_pins_nrst: mmc2@0 { -+ mmc2_pins_nrst: mmc2-rst-pin { - allwinner,pins = "PC16"; - allwinner,function = "gpio_out"; - allwinner,drive = ; diff --git a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch deleted file mode 100644 index df2300194..000000000 --- a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch +++ /dev/null @@ -1,12 +0,0 @@ - GNU nano 2.7.4 File: 062-A20-improve-gmac-upload.patch - ---- a/configs/A20-OLinuXino-Lime2_defconfig -+++ b/configs/A20-OLinuXino-Lime2_defconfig -@@ -24,6 +24,7 @@ CONFIG_DFU_RAM=y - CONFIG_ETH_DESIGNWARE=y - CONFIG_RGMII=y - CONFIG_SUN7I_GMAC=y -+CONFIG_GMAC_TX_DELAY=1 - CONFIG_AXP_ALDO3_VOLT=2800 - CONFIG_AXP_ALDO4_VOLT=2800 - CONFIG_USB_EHCI_HCD=y diff --git a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch index 40d79878a..a402feb3c 100644 --- a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch +++ b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch @@ -12,9 +12,9 @@ More specifically, the following settings are now used: * up to 1152MHz: mul=3, div=2 (unchanged) * above 1152MHz: mul=4, div=2 (was: mul=2, div=1) ---- a/arch/arm/mach-sunxi/clock_sun6i.c -+++ b/arch/arm/mach-sunxi/clock_sun6i.c -@@ -107,11 +107,12 @@ void clock_set_pll1(unsigned int clk) +--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c ++++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +@@ -122,11 +122,12 @@ void clock_set_pll1(unsigned int clk) struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; const int p = 0; diff --git a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch index a8e03e2fb..d200633bc 100644 --- a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch +++ b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch @@ -16,9 +16,9 @@ order of magnitude as Boot1. Furthermore, a bit of documentation is added to clarify that the required setting for the PLL LDO is 1.37v as per the A31 manual. ---- a/arch/arm/mach-sunxi/clock_sun6i.c -+++ b/arch/arm/mach-sunxi/clock_sun6i.c -@@ -26,13 +26,26 @@ void clock_init_safe(void) +--- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c ++++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +@@ -24,14 +24,27 @@ void clock_init_safe(void) struct sunxi_prcm_reg * const prcm = (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE; @@ -34,9 +34,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. clrsetbits_le32(&prcm->pll_ctrl1, ~PRCM_PLL_CTRL_LDO_KEY_MASK, PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN | - PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140)); -+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370)); ++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370) ); clrbits_le32(&prcm->pll_ctrl1, PRCM_PLL_CTRL_LDO_KEY_MASK); -+ + + /* Give the PLL LDO voltage setting some time to take hold. + * Notes: + * 1) We need to use sdelay() as the timers aren't set up yet. @@ -44,9 +44,10 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. + * iterations through a loop. + */ + sdelay(100000); - #endif ++ + clock_set_pll1(408000000); - #if defined(CONFIG_MACH_SUN8I_R40) || defined(CONFIG_MACH_SUN50I) + writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg); --- a/arch/arm/include/asm/arch-sunxi/prcm.h +++ b/arch/arm/include/asm/arch-sunxi/prcm.h @@ -111,13 +111,13 @@ diff --git a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch index 8bab22051..bf5dc66e1 100644 --- a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch @@ -6,11 +6,11 @@ Subject: sun6i: define alternate-function for UART2 on GPG --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h -@@ -186,6 +186,7 @@ enum sunxi_gpio_number { +@@ -180,6 +180,7 @@ enum sunxi_gpio_number { #define SUN6I_GPG_SDC1 2 #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 +#define SUN6I_GPG_UART2 2 #define SUN5I_GPG_UART1 4 - #define SUN6I_GPH_PWM 2 + #define SUN4I_GPH_SDC1 5 diff --git a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch index d140f2d53..087074d0c 100644 --- a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:53:11 +0200 Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) ---- a/arch/arm/mach-sunxi/board.c -+++ b/arch/arm/mach-sunxi/board.c -@@ -126,6 +126,10 @@ static int gpio_init(void) +--- a/arch/arm/cpu/armv7/sunxi/board.c ++++ b/arch/arm/cpu/armv7/sunxi/board.c +@@ -88,6 +88,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); @@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h -@@ -259,6 +259,8 @@ extern int soft_i2c_gpio_scl; +@@ -260,6 +260,8 @@ extern int soft_i2c_gpio_scl; #endif #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" diff --git a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch index 41039796a..ee1e3c9bf 100644 --- a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch +++ b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:59:38 +0200 Subject: ARM: sunxi: Make CONS_INDEX configurable ---- a/arch/arm/mach-sunxi/Kconfig -+++ b/arch/arm/mach-sunxi/Kconfig -@@ -412,6 +412,14 @@ config SYS_BOARD +--- a/board/sunxi/Kconfig ++++ b/board/sunxi/Kconfig +@@ -229,6 +229,14 @@ config SYS_BOARD config SYS_SOC default "sunxi" diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch deleted file mode 100644 index d61895a3f..000000000 --- a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Wed, 19 Jul 2017 22:23:15 +0200 -Subject: [PATCH] mkimage: check environment for dtc binary location - -Currently mkimage assumes the dtc binary is in the path and fails -otherwise. This patch makes it check the DTC environment variable first -for the dtc binary and then fall back to the default path. This makes -it possible to call the u-boot build with make DTC=... and build a fit -image with the dtc binary not being the the default path. - -Signed-off-by: Hauke Mehrtens -Cc: Simon Glass ---- - tools/fit_image.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/tools/fit_image.c -+++ b/tools/fit_image.c -@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_ - } - *cmd = '\0'; - } else if (params->datafile) { -+ const char* dtc = getenv("DTC"); -+ -+ if (!dtc) -+ dtc = MKIMAGE_DTC; -+ - /* dtc -I dts -O dtb -p 500 datafile > tmpfile */ - snprintf(cmd, sizeof(cmd), "%s %s %s > %s", -- MKIMAGE_DTC, params->dtc, params->datafile, tmpfile); -+ dtc, params->dtc, params->datafile, tmpfile); - debug("Trying to execute \"%s\"\n", cmd); - } else { - snprintf(cmd, sizeof(cmd), "cp %s %s", diff --git a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch deleted file mode 100644 index 25edf5104..000000000 --- a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch +++ /dev/null @@ -1,89 +0,0 @@ -From eed65e5c25cbc4b6e893f140e9d7898f4624c114 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Wed, 19 Jul 2017 23:12:38 +0200 -Subject: [PATCH 210/213] Revert "fdt: Makefile: Build python libfdt library if - needed" - -This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5. ---- - Makefile | 17 ++--------------- - scripts/Makefile.spl | 17 ++++------------- - 2 files changed, 6 insertions(+), 28 deletions(-) - ---- a/Makefile -+++ b/Makefile -@@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ - - u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ - $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ -- $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE -+ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE - $(call if_changed,binman) - - OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec -@@ -1125,8 +1125,7 @@ u-boot-x86-16bit.bin: u-boot FORCE - endif - - ifneq ($(CONFIG_ARCH_SUNXI),) --u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ -- checkbinman FORCE -+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE - $(call if_changed,binman) - endif - -@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea - $(timestamp_h): $(srctree)/Makefile FORCE - $(call filechk,timestamp.h) - --checkbinman: tools -- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ -- echo >&2; \ -- echo >&2 '*** binman needs the Python libfdt library.'; \ -- echo >&2 '*** Either install it on your system, or try:'; \ -- echo >&2 '***'; \ -- echo >&2 '*** sudo apt-get install swig libpython-dev'; \ -- echo >&2 '***'; \ -- echo >&2 '*** to have U-Boot build its own version.'; \ -- false; \ -- fi -- - # --------------------------------------------------------------------------- - quiet_cmd_cpp_lds = LDS $@ - cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ ---- a/scripts/Makefile.spl -+++ b/scripts/Makefile.spl -@@ -257,12 +257,14 @@ PHONY += dts_dir - dts_dir: - $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) - --include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc -+include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc - $(call if_changed,dtoch) - --$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc -+$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc - $(call if_changed,dtocc) - -+dtoc: #$(objtree)/tools/_libfdt.so -+ - ifdef CONFIG_SAMSUNG - ifdef CONFIG_VAR_SIZE_SPL - VAR_SIZE_PARAM = --vs -@@ -355,17 +357,6 @@ ifneq ($(cmd_files),) - include $(cmd_files) - endif - --checkdtoc: tools -- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ -- echo '*** dtoc needs the Python libfdt library. Either '; \ -- echo '*** install it on your system, or try:'; \ -- echo '***'; \ -- echo '*** sudo apt-get install swig libpython-dev'; \ -- echo '***'; \ -- echo '*** to have U-Boot build its own version.'; \ -- false; \ -- fi -- - PHONY += FORCE - FORCE: - diff --git a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch deleted file mode 100644 index d40238d3a..000000000 --- a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch +++ /dev/null @@ -1,26 +0,0 @@ -From cdee74ad13e933631caf7f544c319d8e981c6063 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 20 Jul 2017 19:49:25 +0200 -Subject: [PATCH 211/213] Revert "scripts/Makefile.lib: Always have - ...-u-boot.dtsi be able to override" - -This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88. ---- - scripts/Makefile.lib | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb - - quiet_cmd_dtc = DTC $@ - # Modified for U-Boot --# Bring in any U-Boot-specific include at the end of the file -+# Bring in any U-Boot-specific include after the '/dts-v1/;' header - cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - cat $< $(if $(u_boot_dtsi),\ -- | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \ -+ | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ - $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ - $(DTC) -O dtb -o $@ -b 0 \ - -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch deleted file mode 100644 index 1a5603417..000000000 --- a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 53d123333fa0ddc64b2c55d48366f4582ac6922d Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 20 Jul 2017 19:50:52 +0200 -Subject: [PATCH 212/213] Revert "Avoid non-portable sed construct" - -This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9. ---- - scripts/Makefile.lib | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC $@ - # Bring in any U-Boot-specific include after the '/dts-v1/;' header - cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ - cat $< $(if $(u_boot_dtsi),\ -- | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ -+ | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ - $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ - $(DTC) -O dtb -o $@ -b 0 \ - -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch deleted file mode 100644 index 6f75259a7..000000000 --- a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch +++ /dev/null @@ -1,58 +0,0 @@ -From cf1defd80b7594f6f2721ab2dacffe48522abfca Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Thu, 20 Jul 2017 19:51:01 +0200 -Subject: [PATCH 213/213] Revert "sunxi: Use binman for sunxi boards" - -This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c. ---- - Makefile | 6 ++++-- - arch/arm/dts/sunxi-u-boot.dtsi | 14 -------------- - scripts/Makefile.lib | 4 ++-- - 3 files changed, 6 insertions(+), 18 deletions(-) - delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi - ---- a/Makefile -+++ b/Makefile -@@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE - endif - - ifneq ($(CONFIG_ARCH_SUNXI),) --u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE -- $(call if_changed,binman) -+OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ -+ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff -+u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE -+ $(call if_changed,pad_cat) - endif - - ifneq ($(CONFIG_TEGRA),) ---- a/arch/arm/dts/sunxi-u-boot.dtsi -+++ /dev/null -@@ -1,14 +0,0 @@ --#include -- --/ { -- binman { -- filename = "u-boot-sunxi-with-spl.bin"; -- pad-byte = <0xff>; -- blob { -- filename = "spl/sunxi-spl.bin"; -- }; -- u-boot-img { -- pos = ; -- }; -- }; --}; ---- a/scripts/Makefile.lib -+++ b/scripts/Makefile.lib -@@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC $@ - # Modified for U-Boot - # Bring in any U-Boot-specific include after the '/dts-v1/;' header - cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ -- cat $< $(if $(u_boot_dtsi),\ -- | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ -+ cat $< $(if $(u-boot-dtsi),\ -+ | sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%') | \ - $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ - $(DTC) -O dtb -o $@ -b 0 \ - -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch deleted file mode 100644 index 65ae63c64..000000000 --- a/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch +++ /dev/null @@ -1,182 +0,0 @@ -From 1f92596cc520f760589289059a5aa739366dd19c Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 26 Sep 2017 22:16:59 +0200 -Subject: sunxi: add device tree for Orange Pi R1 board - -Signed-off-by: Hauke Mehrtens ---- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 157 +++++++++++++++++++++++++++++ - 2 files changed, 158 insertions(+) - create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ - sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-sinovoip-bpi-m3.dtb - dtb-$(CONFIG_MACH_SUN8I_H3) += \ -+ sun8i-h2-plus-orangepi-r1.dtb \ - sun8i-h2-plus-orangepi-zero.dtb \ - sun8i-h3-bananapi-m2-plus.dtb \ - sun8i-h3-orangepi-2.dtb \ ---- /dev/null -+++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts -@@ -0,0 +1,157 @@ -+/* -+ * Copyright (C) 2017 Hauke Mehrtens -+ * -+ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: -+ * Copyright (C) 2016 Icenowy Zheng -+ * -+ * Based on sun8i-h3-orangepi-one.dts, which is: -+ * Copyright (C) 2016 Hans de Goede -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-h3.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "Xunlong Orange Pi R1"; -+ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; -+ -+ aliases { -+ serial0 = &uart0; -+ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ -+ ethernet1 = &xr819; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ -+ pwr_led { -+ label = "orangepi:green:pwr"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ -+ status_led { -+ label = "orangepi:red:status"; -+ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ reg_vcc_wifi: reg_vcc_wifi { -+ compatible = "regulator-fixed"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+ enable-active-high; -+ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; -+ }; -+ -+ wifi_pwrseq: wifi_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; -+ }; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&emac { -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ allwinner,use-internal-phy; -+ allwinner,leds-active-low; -+ status = "okay"; -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc1_pins_a>; -+ vmmc-supply = <®_vcc_wifi>; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ /* -+ * Explicitly define the sdio device, so that we can add an ethernet -+ * alias for it (which e.g. makes u-boot set a mac-address). -+ */ -+ xr819: sdio_wifi@1 { -+ reg = <1>; -+ }; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ /* USB VBUS is always on */ -+ status = "okay"; -+}; diff --git a/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch deleted file mode 100644 index 6240fe3f5..000000000 --- a/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 231201c71b902b5999ed9b143f2a54674cfae88a Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Tue, 26 Sep 2017 22:17:33 +0200 -Subject: sunxi: add orangepi R1 defconfig - -Signed-off-by: Hauke Mehrtens ---- - board/sunxi/MAINTAINERS | 5 +++++ - configs/orangepi_r1_defconfig | 19 +++++++++++++++++++ - 2 files changed, 24 insertions(+) - create mode 100644 configs/orangepi_r1_defconfig - ---- a/board/sunxi/MAINTAINERS -+++ b/board/sunxi/MAINTAINERS -@@ -302,6 +302,11 @@ M: Jagan Teki -+S: Maintained -+F: configs/orangepi_r1_defconfig -+ - PINE64 BOARDS - M: Andre Przywara - S: Maintained ---- /dev/null -+++ b/configs/orangepi_r1_defconfig -@@ -0,0 +1,19 @@ -+CONFIG_ARM=y -+CONFIG_ARCH_SUNXI=y -+CONFIG_SPL_SPI_FLASH_SUPPORT=y -+CONFIG_MACH_SUN8I_H3=y -+CONFIG_DRAM_CLK=624 -+CONFIG_DRAM_ZQ=3881979 -+CONFIG_DRAM_ODT_EN=y -+# CONFIG_VIDEO_DE2 is not set -+CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" -+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set -+CONFIG_CONSOLE_MUX=y -+CONFIG_SPL=y -+# CONFIG_CMD_IMLS is not set -+# CONFIG_CMD_FLASH is not set -+# CONFIG_CMD_FPGA is not set -+CONFIG_SPL_SPI_SUNXI=y -+CONFIG_SUN8I_EMAC=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch deleted file mode 100644 index d884173c4..000000000 --- a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch +++ /dev/null @@ -1,83 +0,0 @@ -From 6ff005cf19363382fc867d7876a75fd8a386e894 Mon Sep 17 00:00:00 2001 -From: Dave Prue -Date: Thu, 31 Aug 2017 19:21:01 +0200 -Subject: [PATCH] sunxi: Fix CONFIG_SUNXI_GMAC references - -SUNXI_GMAC was still used to configure the code where as the -same has been renamed and moved to Kconfig in below commit -"sunxi: Move SUNXI_GMAC to Kconfig" -(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb) - -Signed-off-by: Dave Prue -Reviewed-by: Simon Glass -Reviewed-by: Jagan Teki -Reviewed-by: Mark Kettenis -Tested-by: Mark Kettenis -[Tweek commit message, config_whitelist.txt, build-whitelist.sh] -Signed-off-by: Jagan Teki ---- - arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +- - board/sunxi/Makefile | 2 +- - include/configs/sunxi-common.h | 2 +- - scripts/build-whitelist.sh | 4 ++-- - scripts/config_whitelist.txt | 1 - - 5 files changed, 5 insertions(+), 6 deletions(-) - ---- a/arch/arm/include/asm/arch-sunxi/sys_proto.h -+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h -@@ -24,7 +24,7 @@ void sdelay(unsigned long); - void return_to_fel(uint32_t lr, uint32_t sp); - - /* Board / SoC level designware gmac init */ --#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC -+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC - void eth_init_board(void); - #else - static inline void eth_init_board(void) {} ---- a/board/sunxi/Makefile -+++ b/board/sunxi/Makefile -@@ -9,7 +9,7 @@ - # SPDX-License-Identifier: GPL-2.0+ - # - obj-y += board.o --obj-$(CONFIG_SUNXI_GMAC) += gmac.o -+obj-$(CONFIG_SUN7I_GMAC) += gmac.o - obj-$(CONFIG_SUNXI_AHCI) += ahci.o - obj-$(CONFIG_MACH_SUN4I) += dram_sun4i_auto.o - obj-$(CONFIG_MACH_SUN5I) += dram_sun5i_auto.o ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -302,7 +302,7 @@ extern int soft_i2c_gpio_scl; - #define CONFIG_PHYLIB - #endif - --#ifdef CONFIG_SUNXI_GMAC -+#ifdef CONFIG_SUN7I_GMAC - #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ - #define CONFIG_PHY_ADDR 1 - #define CONFIG_MII /* MII PHY management */ ---- a/scripts/build-whitelist.sh -+++ b/scripts/build-whitelist.sh -@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C - # There are two independent greps. The first pulls out the component parts - # of CONFIG_SYS_EXTRA_OPTIONS. An example is: - # --# SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) -+# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) - # - # We want this to produce: --# CONFIG_SUNXI_GMAC -+# CONFIG_SUN7I_GMAC - # CONFIG_AHCI - # CONFIG_SATAPWR - # ---- a/scripts/config_whitelist.txt -+++ b/scripts/config_whitelist.txt -@@ -2371,7 +2371,6 @@ CONFIG_STV0991_HZ_CLOCK - CONFIG_ST_SMI - CONFIG_SUNXI_AHCI - CONFIG_SUNXI_EMAC --CONFIG_SUNXI_GMAC - CONFIG_SUNXI_GPIO - CONFIG_SUNXI_MAX_FB_SIZE - CONFIG_SUNXI_USB_PHYS diff --git a/package/boot/uboot-sunxi/uEnv-a64.txt b/package/boot/uboot-sunxi/uEnv-a64.txt deleted file mode 100644 index 7a717fdc0..000000000 --- a/package/boot/uboot-sunxi/uEnv-a64.txt +++ /dev/null @@ -1,5 +0,0 @@ -setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage -setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb -setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait earlycon=uart,mmio32,0x01c28000 -setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r -run uenvcmd diff --git a/package/boot/uboot-zynq/Makefile b/package/boot/uboot-zynq/Makefile index d25ecfb4b..61bb99dda 100644 --- a/package/boot/uboot-zynq/Makefile +++ b/package/boot/uboot-zynq/Makefile @@ -6,40 +6,121 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/image.mk +PKG_NAME:=u-boot PKG_VERSION:=2016.03 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://mirror2.openwrt.org/sources \ + ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb -include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/u-boot.mk +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_LICENSE:=GPL-2.0 GPL-2.0+ +PKG_LICENSE_FILES:=Licenses/README + include $(INCLUDE_DIR)/package.mk -define U-Boot/Default - BUILD_TARGET:=zynq - UBOOT_IMAGE:=u-boot u-boot-dtb.bin u-boot.dtb u-boot-dtb.img spl/boot.bin spl/u-boot-spl spl/u-boot-spl-dtb.bin - UBOOT_CONFIG:=zynq_$(1) +define uboot/Default + TITLE:= + CONFIG:= + IMAGE:= endef -define U-Boot/zc702 - NAME:=Xilinx ZC702 Dev Board +define uboot/zc702 + TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC702 Dev Board endef -define U-Boot/zc706 - NAME:=Xilinx ZC706 Dev Board +define uboot/zc706 + TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC706 Dev Board endef -define U-Boot/zed - NAME:=Avnet Digilent ZedBoard Dev Board +define uboot/zed + TITLE:=U-Boot $(PKG_VERSION) for Avnet Digilent ZedBoard Dev Board endef -define U-Boot/zybo - NAME:=Digilent Zybo Dev Board +define uboot/zybo + TITLE:=U-Boot $(PKG_VERSION) for Digilent Zybo Dev Board endef -UBOOT_TARGETS := \ +UBOOTS := \ zc702 \ zed \ - zybo + zybo \ -$(eval $(call BuildPackage/U-Boot)) +define Package/uboot/template +define Package/uboot-zynq-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_zynq + TITLE:=$(2) + URL:=http://www.denx.de/wiki/U-Boot + VARIANT:=$(1) + MAINTAINER:=Jason Wu +endef +endef + +define BuildUBootPackage + $(eval $(uboot/Default)) + $(eval $(uboot/$(1))) + $(call Package/uboot/template,$(1),$(TITLE)) +endef + +ifdef BUILD_VARIANT +$(eval $(call uboot/$(BUILD_VARIANT))) +UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) +UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) +endif + +define Build/Configure + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(BOARD)_$(UBOOT_CONFIG)_config +endef + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc +endef + +define Package/uboot/install/default + $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) + + $(CP) $(PKG_BUILD_DIR)/u-boot \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.elf + + $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.bin + + $(CP) $(PKG_BUILD_DIR)/u-boot.dtb \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.dtb + + $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.img \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.img + + $(CP) $(PKG_BUILD_DIR)/spl/boot.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin + + $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl + + $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl-dtb.bin \ + $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl-dtb.bin +endef + +define Package/uboot/install/template +define Package/uboot-zynq-$(1)/install + $(call Package/uboot/install/default,$(2)) +endef +endef + +$(foreach u,$(UBOOTS), \ + $(eval $(call Package/uboot/install/template,$(u),$(u))) \ +) + +$(foreach u,$(UBOOTS), \ + $(eval $(call BuildUBootPackage,$(u))) \ + $(eval $(call BuildPackage,uboot-zynq-$(u))) \ +) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 291f45205..222922df2 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -23,7 +23,6 @@ PKG_INSTALL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0+ -PKG_CPE_ID:=cpe:/a:gnu:binutils PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/devel/gdb-arc/Makefile b/package/devel/gdb-arc/Makefile index 6cdf6bdf5..b19443753 100644 --- a/package/devel/gdb-arc/Makefile +++ b/package/devel/gdb-arc/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb-arc -PKG_VERSION:=arc-2017.03-gdb +PKG_VERSION:=arc-2016.03-gdb PKG_RELEASE:=1 -PKG_SOURCE:=gdb-arc-2017.03-gdb.tar.gz +PKG_SOURCE:=gdb-arc-2016.03-gdb.tar.gz PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION) PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9 -PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.03-gdb +PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2016.03-gdb PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 4cf2aaa87..5d2583aad 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,17 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=8.0.1 +PKG_VERSION:=7.11.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 +PKG_HASH:=e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_LICENSE:=GPL-3.0+ -PKG_CPE_ID:=cpe:/a:gnu:gdb include $(INCLUDE_DIR)/package.mk @@ -56,16 +55,11 @@ CONFIGURE_ARGS+= \ --with-system-readline \ --without-expat \ --without-lzma \ - --disable-sim \ --disable-werror CONFIGURE_VARS+= \ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" -TARGET_LDFLAGS+= \ - -static-libstdc++ \ - -Wl,--gc-sections - define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ DESTDIR="$(PKG_INSTALL_DIR)" \ diff --git a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch index 25ac86fd9..417142419 100644 --- a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch +++ b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch @@ -2,7 +2,7 @@ See http://sourceware.org/bugzilla/show_bug.cgi?id=14523 --- --- a/gdb/common/signals.c +++ b/gdb/common/signals.c -@@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig) +@@ -344,6 +344,11 @@ gdb_signal_from_host (int hostsig) else if (64 <= hostsig && hostsig <= 127) return (enum gdb_signal) (hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64); diff --git a/package/devel/gdb/patches/100-musl_fix.patch b/package/devel/gdb/patches/100-musl_fix.patch index b167fe6ec..09146c563 100644 --- a/package/devel/gdb/patches/100-musl_fix.patch +++ b/package/devel/gdb/patches/100-musl_fix.patch @@ -50,4 +50,4 @@ +#undef pt_regs #include "nat/ppc-linux.h" - #include "linux-ppc-tdesc.h" + diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch deleted file mode 100644 index 929a5ae97..000000000 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ /dev/null @@ -1,76 +0,0 @@ ---- a/configure.ac -+++ b/configure.ac -@@ -1300,13 +1300,13 @@ if test -z "$LD"; then - fi - fi - --# Check whether -static-libstdc++ -static-libgcc is supported. -+# Check whether -static-libstdc++ is supported. - have_static_libs=no - if test "$GCC" = yes; then - saved_LDFLAGS="$LDFLAGS" - -- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" -- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) -+ LDFLAGS="$LDFLAGS -static-libstdc++" -+ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++]) - AC_LANG_PUSH(C++) - AC_LINK_IFELSE([ - #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1632,7 +1632,7 @@ AC_ARG_WITH(stage1-ldflags, - # if supported. But if the user explicitly specified the libraries to use, - # trust that they are doing what they want. - if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then -- stage1_ldflags="-static-libstdc++ -static-libgcc" -+ stage1_ldflags="-static-libstdc++" - fi]) - AC_SUBST(stage1_ldflags) - -@@ -1661,7 +1661,7 @@ AC_ARG_WITH(boot-ldflags, - # statically. But if the user explicitly specified the libraries to - # use, trust that they are doing what they want. - if test "$poststage1_libs" = ""; then -- poststage1_ldflags="-static-libstdc++ -static-libgcc" -+ poststage1_ldflags="-static-libstdc++" - fi]) - AC_SUBST(poststage1_ldflags) - ---- a/configure -+++ b/configure -@@ -5005,14 +5005,14 @@ if test -z "$LD"; then - fi - fi - --# Check whether -static-libstdc++ -static-libgcc is supported. -+# Check whether -static-libstdc++ is supported. - have_static_libs=no - if test "$GCC" = yes; then - saved_LDFLAGS="$LDFLAGS" - -- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" -- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5 --$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; } -+ LDFLAGS="$LDFLAGS -static-libstdc++" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++" >&5 -+$as_echo_n "checking whether g++ accepts -static-libstdc++... " >&6; } - ac_ext=cpp - ac_cpp='$CXXCPP $CPPFLAGS' - ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -5795,7 +5795,7 @@ else - # if supported. But if the user explicitly specified the libraries to use, - # trust that they are doing what they want. - if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then -- stage1_ldflags="-static-libstdc++ -static-libgcc" -+ stage1_ldflags="-static-libstdc++" - fi - fi - -@@ -5831,7 +5831,7 @@ else - # statically. But if the user explicitly specified the libraries to - # use, trust that they are doing what they want. - if test "$poststage1_libs" = ""; then -- poststage1_ldflags="-static-libstdc++ -static-libgcc" -+ poststage1_ldflags="-static-libstdc++" - fi - fi - diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch deleted file mode 100644 index 8afa8ccf8..000000000 --- a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 24 Mar 2017 10:36:03 +0800 -Subject: [PATCH] Fix invalid sigprocmask call - -The POSIX document says - - The pthread_sigmask() and sigprocmask() functions shall fail if: - - [EINVAL] - The value of the how argument is not equal to one of the defined values. - -and this is how musl-libc is currently doing. Fix the call to be safe -and correct - - [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html - -gdb/ChangeLog: -2017-03-24 Yousong Zhou - - * common/signals-state-save-restore.c (save_original_signals_state): - Fix invalid sigprocmask call. ---- - gdb/ChangeLog | 5 +++++ - gdb/common/signals-state-save-restore.c | 2 +- - 2 files changed, 6 insertions(+), 1 deletion(-) - ---- a/gdb/common/signals-state-save-restore.c -+++ b/gdb/common/signals-state-save-restore.c -@@ -41,7 +41,7 @@ save_original_signals_state (void) - int i; - int res; - -- res = sigprocmask (0, NULL, &original_signal_mask); -+ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); - if (res == -1) - perror_with_name (("sigprocmask")); - diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index 5bfcaa699..8ff9bfa5e 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk define Package/perf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS + DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK TITLE:=Linux performance monitoring tool VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) URL:=http://www.kernel.org @@ -51,7 +51,6 @@ MAKE_FLAGS = \ NO_GTK2=1 \ NO_LIBAUDIT=1 \ NO_LIBCRYPTO=1 \ - NO_LIBUNWIND=1 \ CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ LD="$(TARGET_CROSS)ld" \ @@ -61,11 +60,9 @@ MAKE_FLAGS = \ WERROR=0 \ prefix=/usr -ifdef CONFIG_LINUX_4_4 ifdef CONFIG_USE_MUSL MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__" endif -endif define Build/Compile +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \ diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index 6209dc5a6..dae6aff15 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace -PKG_VERSION:=4.20 + +PKG_VERSION:=4.16 PKG_RELEASE:=1 +PKG_HASH:=98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/$(PKG_NAME) -PKG_HASH:=5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523 PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYRIGHT -PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace PKG_MAINTAINER:=Felix Fietkau diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index 6be2f9ec1..57ab75f96 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -17,7 +17,6 @@ PKG_HASH:=d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:valgrind:valgrind PKG_FIXUP = autoreconf PKG_INSTALL := 1 diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 7a0e87071..60ec005ac 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=29 +PKG_RELEASE:=30 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index 23ca2e27e..1829c279b 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -27,8 +27,7 @@ sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua -[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip -(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip +ln -sf /usr/sbin/ip /usr/bin/ip rm -rf /tmp/luci-modulecache/ rm -f /tmp/luci-indexcache @@ -47,7 +46,7 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.5.2 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5.3 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release echo "DISTRIB_DESCRIPTION='OpenWrt 17.01.4'" >> /etc/openwrt_release diff --git a/package/lean/luci-app-shadowsocksr-pro/Makefile b/package/lean/luci-app-shadowsocksr-pro/Makefile index 747a2dd80..4d18872ca 100644 --- a/package/lean/luci-app-shadowsocksr-pro/Makefile +++ b/package/lean/luci-app-shadowsocksr-pro/Makefile @@ -9,7 +9,7 @@ LUCI_TITLE:=LuCI support for Shadowsocksr LUCI_DEPENDS:=+iptables-mod-tproxy +kmod-ipt-tproxy +ip +ipset-lists +shadowsocksr-libev-alt +pdnsd-alt +coreutils +coreutils-base64 +coreutils-nohup +dnsmasq-full LUCI_PKGARCH:=all PKG_VERSION:=2.0 -PKG_RELEASE:=20 +PKG_RELEASE:=21 include $(TOPDIR)/feeds/luci/luci.mk diff --git a/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr b/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr index d77c729c8..86b57ce08 100755 --- a/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr +++ b/package/lean/luci-app-shadowsocksr-pro/root/etc/uci-defaults/shadowsocksr @@ -9,9 +9,6 @@ uci -q batch <<-EOF >/dev/null commit firewall EOF -[ ! -f /usr/bin/ip ] && ln -sf /sbin/ip /usr/bin/ip -(opkg list-installed | grep ip-full >/dev/null 2>&1) && ln -sf /usr/sbin/ip /usr/bin/ip - /etc/init.d/shadowsocksr stop /etc/init.d/shadowsocksr disable diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch index 2dcfe9c21..4a90751e1 100644 --- a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch +++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch @@ -18,9 +18,9 @@ No __THROW in function implementation. --jsaw ---- a/argp.h -+++ b/argp.h -@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a +--- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 ++++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 +@@ -560,17 +560,17 @@ # endif # ifndef ARGP_EI @@ -41,7 +41,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o +@@ -582,7 +582,7 @@ } ARGP_EI int @@ -50,9 +50,9 @@ No __THROW in function implementation. { return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; } ---- a/argp-parse.c -+++ b/argp-parse.c -@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input) +--- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 ++++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 +@@ -1290,13 +1290,13 @@ /* Defined here, in case a user is not inlining the definitions in * argp.h */ void @@ -68,7 +68,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o +@@ -1310,7 +1310,7 @@ } int diff --git a/package/libs/wolfssl/Config.in b/package/libs/cyassl/Config.in similarity index 63% rename from package/libs/wolfssl/Config.in rename to package/libs/cyassl/Config.in index 7e8a4b6ce..371bb564f 100644 --- a/package/libs/wolfssl/Config.in +++ b/package/libs/cyassl/Config.in @@ -1,47 +1,47 @@ -if PACKAGE_libwolfssl +if PACKAGE_libcyassl -config WOLFSSL_HAS_AES_CCM +config CYASSL_HAS_AES_CCM bool "Include AES-CCM support" default n -config WOLFSSL_HAS_AES_GCM +config CYASSL_HAS_AES_GCM bool "Include AES-GCM support" default n -config WOLFSSL_HAS_CHACHA +config CYASSL_HAS_CHACHA bool "Include ChaCha cipher suite support" default n -config WOLFSSL_HAS_ECC +config CYASSL_HAS_ECC bool "Include ECC (Elliptic Curve Cryptography) support" default y -config WOLFSSL_HAS_DH +config CYASSL_HAS_DH bool "Include DH (Diffie-Hellman) support" default n -config WOLFSSL_HAS_ARC4 +config CYASSL_HAS_ARC4 bool "Include ARC4 support" default n -config WOLFSSL_HAS_DES3 +config CYASSL_HAS_DES3 bool "Include DES3 (Tripple-DES) support" default n -config WOLFSSL_HAS_PSK +config CYASSL_HAS_PSK bool "Include PKS (Pre Share Key) support" default n -config WOLFSSL_HAS_DTLS +config CYASSL_HAS_DTLS bool "Include DTLS support" default n -config WOLFSSL_HAS_ECC25519 +config CYASSL_HAS_ECC25519 bool "Include ECC Curve 22519 support" - depends on WOLFSSL_HAS_ECC + depends on CYASSL_HAS_ECC default n -config WOLFSSL_HAS_POLY_1305 +config CYASSL_HAS_POLY_1305 bool "Include Poly-1305 support" default n diff --git a/package/libs/wolfssl/Makefile b/package/libs/cyassl/Makefile similarity index 69% rename from package/libs/wolfssl/Makefile rename to package/libs/cyassl/Makefile index 1d4b7f557..0212ff73d 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/cyassl/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2017 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -20,27 +20,24 @@ PKG_INSTALL:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:yassl:cyassl include $(INCLUDE_DIR)/package.mk -define Package/libwolfssl +define Package/libcyassl SECTION:=libs SUBMENU:=SSL CATEGORY:=Libraries - TITLE:=wolfSSL library + TITLE:=CyaSSL library URL:=http://www.wolfssl.com/ - MAINTAINER:=Alexandru Ardelean MENU:=1 - PROVIDES:=libcyassl endef -define Package/libwolfssl/description -wolfSSL (formerly CyaSSL) is an SSL library optimized for small -footprint, both on disk and for memory use. +define Package/libcyassl/description +CyaSSL is an SSL library optimized for small footprint, both on disk and for +memory use. endef -define Package/libwolfssl/config +define Package/libcyassl/config source "$(SOURCE)/Config.in" endef @@ -58,58 +55,58 @@ CONFIGURE_ARGS += \ --enable-ipv6 endif -ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y) +ifeq ($(CONFIG_CYASSL_HAS_AES_CCM),y) CONFIGURE_ARGS += \ --enable-aesccm endif -ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y) +ifeq ($(CONFIG_CYASSL_HAS_AES_GCM),y) CONFIGURE_ARGS += \ - --disable-aesgcm + --enable-aesgcm endif -ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y) +ifeq ($(CONFIG_CYASSL_HAS_CHACHA),y) CONFIGURE_ARGS += \ - --disable-chacha + --enable-chacha endif -ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y) +ifeq ($(CONFIG_CYASSL_HAS_ECC),y) CONFIGURE_ARGS += \ --enable-ecc \ --enable-supportedcurves endif -ifneq ($(CONFIG_WOLFSSL_HAS_DH),y) +ifeq ($(CONFIG_CYASSL_HAS_DH),y) CONFIGURE_ARGS += \ --enable-dh endif -ifeq ($(CONFIG_WOLFSSL_HAS_ARC4),n) +ifeq ($(CONFIG_CYASSL_HAS_ARC4),n) CONFIGURE_ARGS += \ --disable-arc4 endif -ifeq ($(CONFIG_WOLFSSL_HAS_DES3),y) +ifeq ($(CONFIG_CYASSL_HAS_DES3),y) CONFIGURE_ARGS += \ --disable-des3 endif -ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y) +ifeq ($(CONFIG_CYASSL_HAS_PSK),y) CONFIGURE_ARGS += \ --enable-psk endif -ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y) +ifeq ($(CONFIG_CYASSL_HAS_DTLS),y) CONFIGURE_ARGS += \ --enable-dtls endif -ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y) +ifeq ($(CONFIG_CYASSL_HAS_ECC25519),y) CONFIGURE_ARGS += \ - --enable-curve25519 + --enable-ecc25519 endif -ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y) +ifeq ($(CONFIG_CYASSL_HAS_POLY1305),y) CONFIGURE_ARGS += \ --enable-poly1305 endif @@ -133,10 +130,10 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endef -define Package/libwolfssl/install +define Package/libcyassl/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/ ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so endef -$(eval $(call BuildPackage,libwolfssl)) +$(eval $(call BuildPackage,libcyassl)) diff --git a/package/libs/wolfssl/patches/001-CVE-2017-13099.patch b/package/libs/cyassl/patches/001-CVE-2017-13099.patch similarity index 100% rename from package/libs/wolfssl/patches/001-CVE-2017-13099.patch rename to package/libs/cyassl/patches/001-CVE-2017-13099.patch diff --git a/package/libs/wolfssl/patches/400-additional_compatibility.patch b/package/libs/cyassl/patches/400-additional_compatibility.patch similarity index 100% rename from package/libs/wolfssl/patches/400-additional_compatibility.patch rename to package/libs/cyassl/patches/400-additional_compatibility.patch diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 07e1eb815..a726691d3 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -17,7 +17,6 @@ PKG_HASH:=9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0+ PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3 -PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils PKG_INSTALL:=1 PKG_USE_MIPS16:=0 diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index db6aee750..deb484010 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -19,7 +19,6 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-3.0+ -PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/gettext-full/patches/000-relocatable.patch b/package/libs/gettext-full/patches/000-relocatable.patch index a95c268f5..c14be7283 100644 --- a/package/libs/gettext-full/patches/000-relocatable.patch +++ b/package/libs/gettext-full/patches/000-relocatable.patch @@ -5,8 +5,8 @@ # Set variables # - gettext_datadir directory where the data files are stored. -prefix="@prefix@" -+if [ -n "$STAGING_DIR_HOSTPKG" ]; then -+ prefix="$STAGING_DIR_HOSTPKG" ++if [ -n "$STAGING_DIR" ]; then ++ prefix="$STAGING_DIR/host" +else + prefix="@prefix@" +fi @@ -20,8 +20,8 @@ # Set variables # - gettext_datadir directory where the data files are stored. -prefix="@prefix@" -+if [ -n "$STAGING_DIR_HOSTPKG" ]; then -+ prefix="$STAGING_DIR_HOSTPKG" ++if [ -n "$STAGING_DIR" ]; then ++ prefix="$STAGING_DIR/host" +else + prefix="@prefix@" +fi diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 5d56f37c5..99034bb22 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -17,7 +17,6 @@ PKG_SOURCE_URL:=@SF/levent PKG_HASH:=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=BSD-3-Clause -PKG_CPE_ID:=cpe:/a:libevent_project:libevent PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index ac7bfddf5..9776711a7 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -51,7 +51,7 @@ define Package/iconv TITLE+= utility endef -TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89 +TARGET_CFLAGS += $(FPIC) -DUSE_DOS CONFIGURE_ARGS += \ --enable-shared \ diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index eeb7870f0..87dbc4708 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -19,7 +19,6 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:json-c_project:json-c PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -28,7 +27,7 @@ PKG_MAINTAINER:=Felix Fietkau include $(INCLUDE_DIR)/package.mk -TARGET_CFLAGS += $(FPIC) -Wno-implicit-fallthrough +TARGET_CFLAGS += $(FPIC) define Package/libjson-c SECTION:=libs diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index be8228531..399aa6ce1 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_conntrack +PKG_VERSION:=1.0.6 PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack -PKG_SOURCE_DATE:=2017-07-25 -PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5 -PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57 - +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \ + ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/ +PKG_HASH:=efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb PKG_MAINTAINER:=Jo-Philipp Wich PKG_FIXUP:=autoreconf diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile index 8a11d0798..dd8fd9f09 100644 --- a/package/libs/libnetfilter-queue/Makefile +++ b/package/libs/libnetfilter-queue/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=libnetfilter_queue PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue -PKG_SOURCE_DATE:=2017-06-27 -PKG_SOURCE_VERSION:=601abd1c71ccdf90753cf294c120ad43fb25dc54 -PKG_MIRROR_HASH:=283b99cfe5856dc87fd6bab8f78c0c59b72462d6b4f2b13111f928cf33020eb3 +PKG_SOURCE_URL=http://git.netfilter.org/libnetfilter_queue +PKG_SOURCE_DATE:=2016-07-03 +PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098 +PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch index 92e750d51..81faffe82 100644 --- a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch +++ b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint +@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) sum += *buf++; size -= sizeof(uint16_t); } @@ -24,7 +24,7 @@ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >>16); -@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint +@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) return (uint16_t)(~sum); } @@ -33,7 +33,7 @@ { uint32_t sum = 0; uint32_t iph_len = iph->ihl*4; -@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct +@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph) sum += (iph->saddr) & 0xFFFF; sum += (iph->daddr >> 16) & 0xFFFF; sum += (iph->daddr) & 0xFFFF; @@ -49,7 +49,7 @@ { uint32_t sum = 0; uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h; -@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct +@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr) sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF; sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF; } @@ -58,9 +58,11 @@ sum += htons(ip6h->ip6_plen); return nfq_checksum(sum, (uint16_t *)payload, len); +diff --git a/src/extra/tcp.c b/src/extra/tcp.c +index d1cd79d..a66f392 100644 --- a/src/extra/tcp.c +++ b/src/extra/tcp.c -@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp +@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph) { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -69,7 +71,7 @@ } EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4); -@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp +@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h) { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -80,7 +82,7 @@ --- a/src/extra/udp.c +++ b/src/extra/udp.c -@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp +@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph) { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; @@ -89,7 +91,7 @@ } EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4); -@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp +@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h) { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index f4a1bb132..5b541f451 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.0.7 +PKG_VERSION:=1.0.6 PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://git.netfilter.org/libnftnl +PKG_SOURCE_URL:=git://git.netfilter.org/libnftnl PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=libnftnl-1.0.7 -PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9 +PKG_SOURCE_VERSION:=libnftnl-1.0.6 +PKG_MIRROR_HASH:=c9e066e3fd29951cbe96d2898b4d6cdcfe802b3a4f09f8273a508e7a0a20a357 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 67201cc7c..7916556c0 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -8,17 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.3.0 +PKG_VERSION:=3.2.29 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_3_0 -PKG_HASH:=705468b5ae4cd1eb099d2d1c476d6a3abe519bc2810becf12fb1e32de1e074e4 +PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_2_29 +PKG_HASH:=0beb593dc6abfffa18a5c787b27884979c1b7e7f1fd468c801e3cc938a685922 PKG_LICENSE:=LGPL-2.1 -PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf - include $(INCLUDE_DIR)/package.mk define Package/libnl/default @@ -80,6 +77,13 @@ endef TARGET_CFLAGS += -ffunction-sections $(FPIC) +define Build/Compile + $(call Build/Compile/Default) + make -C $(PKG_BUILD_DIR) \ + DESTDIR="$(PKG_INSTALL_DIR)" \ + install +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/ diff --git a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch b/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch new file mode 100644 index 000000000..a31ef4772 --- /dev/null +++ b/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch @@ -0,0 +1,105 @@ +From 098a4cc35b0da4438b8b67a914edecebef5bb6a9 Mon Sep 17 00:00:00 2001 +From: Alexey Brodkin +Date: Fri, 10 Mar 2017 13:22:14 +0300 +Subject: [PATCH] lib: Escape usage of strerror_l() if it doesn't exist in libc + +uClibc doesn't implement strerror_l() and thus libnl starting from +3.2.29 couldn't be compiled with it any longer. + +To work-around that problem we'll just do a check on strerror_l() +availability during configuration and if it's not there just fall back +to locale-less strerror(). + +Signed-off-by: Alexey Brodkin +Cc: Andre Draszik +Cc: Thomas Haller +--- + +This patch is now accepted upstream and will be a part of the next libnl +release, see +https://github.com/thom311/libnl/commit/e15966ac7f3b43df2acf869f98089762807d0568 + + configure.ac | 2 ++ + lib/utils.c | 8 +++++++- + src/lib/utils.c | 6 ++++++ + 3 files changed, 15 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 68b285e5b15c..2739b997ee3a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -121,6 +121,8 @@ fi + + AC_CONFIG_SUBDIRS([doc]) + ++AC_CHECK_FUNCS([strerror_l]) ++ + AC_CONFIG_FILES([ + Makefile + libnl-3.0.pc +diff --git a/lib/utils.c b/lib/utils.c +index fb350d13fd2f..06273c5b291e 100644 +--- a/lib/utils.c ++++ b/lib/utils.c +@@ -30,7 +30,9 @@ + #include + #include + #include /* exit() */ ++#ifdef HAVE_STRERROR_L + #include ++#endif + + /** + * Global variable indicating the desired level of debugging output. +@@ -123,9 +125,10 @@ int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *)) + + const char *nl_strerror_l(int err) + { ++ const char *buf; ++#ifdef HAVE_STRERROR_L + int errno_save = errno; + locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); +- const char *buf; + + if (loc == (locale_t)0) { + if (errno == ENOENT) +@@ -140,6 +143,9 @@ const char *nl_strerror_l(int err) + } + + errno = errno_save; ++#else ++ buf = strerror(err); ++#endif + return buf; + } + /** @endcond */ +diff --git a/src/lib/utils.c b/src/lib/utils.c +index 5878f279c364..feb1d4ef4056 100644 +--- a/src/lib/utils.c ++++ b/src/lib/utils.c +@@ -81,6 +81,7 @@ void nl_cli_fatal(int err, const char *fmt, ...) + fprintf(stderr, "\n"); + } else { + char *buf; ++#ifdef HAVE_STRERROR_L + locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); + if (loc == (locale_t)0) { + if (errno == ENOENT) +@@ -91,9 +92,14 @@ void nl_cli_fatal(int err, const char *fmt, ...) + } + if (loc != (locale_t)0) + buf = strerror_l(err, loc); ++#else ++ buf = strerror(err); ++#endif + fprintf(stderr, "%s\n", buf); ++#ifdef HAVE_STRERROR_L + if (loc != (locale_t)0) + freelocale(loc); ++#endif + } + + exit(abs(err)); +-- +2.7.4 + diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch deleted file mode 100644 index 845a59376..000000000 --- a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch +++ /dev/null @@ -1,30 +0,0 @@ -From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 7 Mar 2015 11:34:42 +0100 -Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file - -In order to support static linking, the libnl pkg-config file should -indicate in its Libs.private field the libraries that libnl-3.0.a -requires. The LIBS variable contains the appropriate list of -libraries: -lm in all cases, and -lpthread when pthread support is -enabled. This allows to statically link applications against libnl -properly. - -Signed-off-by: Thomas Petazzoni ---- - libnl-3.0.pc.in | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in -index b87e3dc..ddbc999 100644 ---- a/libnl-3.0.pc.in -+++ b/libnl-3.0.pc.in -@@ -7,4 +7,5 @@ Name: libnl - Description: Convenience library for netlink sockets - Version: @PACKAGE_VERSION@ - Libs: -L${libdir} -lnl-@MAJ_VERSION@ -+Libs.private: @LIBS@ - Cflags: -I${includedir}/libnl@MAJ_VERSION@ --- -2.1.0 - diff --git a/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch deleted file mode 100644 index 11dc75b89..000000000 --- a/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch +++ /dev/null @@ -1,103 +0,0 @@ -diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h ---- /include/linux-private/linux/if_ether.h 2017-03-08 19:56:31.824516933 -0800 -+++ /include/linux-private/linux/if_ether.h 2017-03-08 20:07:01.938237767 -0800 -@@ -22,6 +22,7 @@ - #define _LINUX_IF_ETHER_H - - #include -+#include - - /* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -117,10 +118,12 @@ - * This is an Ethernet frame header. - */ - -+#if __UAPI_DEF_ETHHDR - struct ethhdr { - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ - unsigned char h_source[ETH_ALEN]; /* source ether addr */ - __be16 h_proto; /* packet type ID field */ - } __attribute__((packed)); -+#endif - - #endif /* _LINUX_IF_ETHER_H */ -diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h ---- /include/linux-private/linux/libc-compat.h 2017-03-08 19:56:31.823516923 -0800 -+++ /include/linux-private/linux/libc-compat.h 2017-03-08 20:12:30.376843489 -0800 -@@ -48,10 +48,18 @@ - #ifndef _LIBC_COMPAT_H - #define _LIBC_COMPAT_H - --/* We have included glibc headers... */ --#if defined(__GLIBC__) -+/* We're used from userspace... */ -+#if !defined(__KERNEL__) - --/* Coordinate with glibc netinet/in.h header. */ -+/* Coordinate with libc netinet/if_ether.h */ -+#ifdef _NETINET_IF_ETHER_H /* musl */ -+#define __UAPI_DEF_ETHHDR 0 -+#else -+/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */ -+#define __UAPI_DEF_ETHHDR 1 -+#endif -+ -+/* Coordinate with libc netinet/in.h header. */ - #if defined(_NETINET_IN_H) - - /* GLIBC headers included first so don't define anything -@@ -64,15 +72,7 @@ - #define __UAPI_DEF_IN_CLASS 0 - - #define __UAPI_DEF_IN6_ADDR 0 --/* The exception is the in6_addr macros which must be defined -- * if the glibc code didn't define them. This guard matches -- * the guard in glibc/inet/netinet/in.h which defines the -- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ --#if defined(__USE_MISC) || defined (__USE_GNU) - #define __UAPI_DEF_IN6_ADDR_ALT 0 --#else --#define __UAPI_DEF_IN6_ADDR_ALT 1 --#endif - #define __UAPI_DEF_SOCKADDR_IN6 0 - #define __UAPI_DEF_IPV6_MREQ 0 - #define __UAPI_DEF_IPPROTO_V6 0 -@@ -83,7 +83,7 @@ - #else - - /* Linux headers included first, and we must define everything -- * we need. The expectation is that glibc will check the -+ * we need. The expectation is that libc will check the - * __UAPI_DEF_* defines and adjust appropriately. */ - #define __UAPI_DEF_IN_ADDR 1 - #define __UAPI_DEF_IN_IPPROTO 1 -@@ -93,7 +93,7 @@ - #define __UAPI_DEF_IN_CLASS 1 - - #define __UAPI_DEF_IN6_ADDR 1 --/* We unconditionally define the in6_addr macros and glibc must -+/* We unconditionally define the in6_addr macros and libc must - * coordinate. */ - #define __UAPI_DEF_IN6_ADDR_ALT 1 - #define __UAPI_DEF_SOCKADDR_IN6 1 -@@ -115,7 +115,10 @@ - /* If we did not see any headers from any supported C libraries, - * or we are being included in the kernel, then define everything - * that we need. */ --#else /* !defined(__GLIBC__) */ -+#else /* defined(__KERNEL__) */ -+ -+/* Definitions for if/ether.h */ -+#define __UAPI_DEF_ETHHDR 1 - - /* Definitions for in.h */ - #define __UAPI_DEF_IN_ADDR 1 -@@ -138,6 +141,6 @@ - /* Definitions for xattr.h */ - #define __UAPI_DEF_XATTR 1 - --#endif /* __GLIBC__ */ -+#endif /* defined(__KERNEL__) */ - - #endif /* _LIBC_COMPAT_H */ diff --git a/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch deleted file mode 100644 index f715bb83f..000000000 --- a/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 68f8393bd356a3d0598cf77e1044b7e8b98aa4d8 Mon Sep 17 00:00:00 2001 -Message-Id: <68f8393bd356a3d0598cf77e1044b7e8b98aa4d8.1493920165.git.baruch@tkos.co.il> -From: Baruch Siach -Date: Thu, 4 May 2017 15:56:14 +0300 -Subject: [PATCH] Revert "build: enable building cli during tests" - -This reverts commit 3cb28534d34392ceec4adead0cfa97039796ccb7. - -Contrary to what 3cb28534d commit log claims, the cli programs depend on -dynamic libraries support of the toolchain. Enabling cli programs -unconditionally breaks static build as follows: - -In file included from lib/cli/cls/basic.c:12:0: -./include/netlink/cli/utils.h:25:19: fatal error: dlfcn.h: No such file or directory -compilation terminated. -Makefile:3666: recipe for target 'lib/cli/cls/lib_cli_cls_basic_la-basic.lo' failed -make[1]: *** [lib/cli/cls/lib_cli_cls_basic_la-basic.lo] Error 1 - -Revert that commit to restore the ability of static only build of libnl, and -its dependencies. - -Signed-off-by: Baruch Siach ---- -Upstream status: https://github.com/thom311/libnl/pull/141 - - Makefile.am | 21 ++++++--------------- - 1 file changed, 6 insertions(+), 15 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 1b95a559304f..279548394650 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -3,8 +3,6 @@ - ACLOCAL_AMFLAGS = -I m4 - - lib_LTLIBRARIES = --noinst_LTLIBRARIES = --check_LTLIBRARIES = - - check_PROGRAMS = - check_programs = -@@ -500,6 +498,8 @@ EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \ - lib_libnl_xfrm_3_la_LIBADD = \ - lib/libnl-3.la - -+if ENABLE_CLI -+ - lib_cli_ltlibraries_cls = \ - lib/cli/cls/basic.la \ - lib/cli/cls/cgroup.la -@@ -513,15 +513,11 @@ lib_cli_ltlibraries_qdisc = \ - lib/cli/qdisc/pfifo.la \ - lib/cli/qdisc/plug.la - --if ENABLE_CLI - pkglib_clsdir = $(pkglibdir)/cli/cls - pkglib_qdiscdir = $(pkglibdir)/cli/qdisc - pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls) - pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc) --else --noinst_LTLIBRARIES += \ -- $(lib_cli_ltlibraries_cls) \ -- $(lib_cli_ltlibraries_qdisc) -+ - endif - - lib_cli_ldflags = \ -@@ -550,13 +546,8 @@ lib_cli_qdisc_plug_la_LDFLAGS = $(lib_cli_ldflags) - - ############################################################################### - --src_lib_ldflags = -- - if ENABLE_CLI - lib_LTLIBRARIES += src/lib/libnl-cli-3.la --src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) --else --check_LTLIBRARIES += src/lib/libnl-cli-3.la - endif - - src_lib_libnl_cli_3_la_SOURCES = \ -@@ -583,7 +574,7 @@ src_lib_libnl_cli_3_la_CPPFLAGS = \ - -I$(srcdir)/include \ - -I$(builddir)/include - src_lib_libnl_cli_3_la_LDFLAGS = \ -- $(src_lib_ldflags) \ -+ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ - -Wl,--version-script=$(srcdir)/libnl-cli-3.sym - src_lib_libnl_cli_3_la_LIBADD = \ - lib/libnl-3.la \ -@@ -668,8 +659,6 @@ else - noinst_PROGRAMS += $(cli_programs) - endif - endif --else --check_PROGRAMS += $(cli_programs) - endif - - src_genl_ctrl_list_CPPFLAGS = $(src_cppflags) -@@ -847,10 +836,12 @@ tests_test_complex_HTB_with_hash_filters_LDADD = $(tests_ldadd) - tests_test_u32_filter_with_actions_CPPFLAGS = $(tests_cppflags) - tests_test_u32_filter_with_actions_LDADD = $(tests_ldadd) - -+if ENABLE_CLI - check_PROGRAMS += \ - tests/test-cache-mngr \ - tests/test-genl \ - tests/test-nf-cache-mngr -+endif - - tests_cli_ldadd = \ - $(tests_ldadd) \ --- -2.11.0 - diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index e702d5c05..4d0ce4099 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -12,8 +12,7 @@ PKG_VERSION:=1.8.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ - http://www.tcpdump.org/release/ +PKG_SOURCE_URL:=http://www.tcpdump.org/release/ PKG_HASH:=673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e PKG_FIXUP:=patch-libtool diff --git a/package/libs/readline/Makefile b/package/libs/libreadline/Makefile similarity index 95% rename from package/libs/readline/Makefile rename to package/libs/libreadline/Makefile index ca3a46863..3c1b048fe 100644 --- a/package/libs/readline/Makefile +++ b/package/libs/libreadline/Makefile @@ -17,14 +17,12 @@ PKG_HASH:=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:gnu:readline PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/host-build.mk define Package/libreadline SECTION:=libs @@ -71,5 +69,4 @@ define Package/libreadline/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{so,so.7,so.7.0} $(1)/usr/lib/ endef -$(eval $(call HostBuild)) $(eval $(call BuildPackage,libreadline)) diff --git a/package/libs/readline/patches/001-install_perm.patch b/package/libs/libreadline/patches/001-install_perm.patch similarity index 100% rename from package/libs/readline/patches/001-install_perm.patch rename to package/libs/libreadline/patches/001-install_perm.patch diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 8cef09f78..5eb521a72 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -17,7 +17,6 @@ PKG_HASH:=afcce660d3dc54c63a0a5ba3cf05272239dc3c54bbeba20f6bad250f9dc007ae PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_BUILD_PARALLEL:=0 diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 36a3bbeb2..01b3a32b1 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -6,8 +6,8 @@ PKG_RELEASE=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git PKG_SOURCE_DATE:=2018-01-07 -PKG_SOURCE_VERSION:=1c08e80313fd487112c48346889cc57badeef751 -PKG_MIRROR_HASH:=58cad98de55d44d7791e5d49b809ac5c32d3e6c481dc385b10e02386853f2263 +PKG_SOURCE_VERSION:=1dafcd7813f147811a6bbdb00eec603fe732aac1 +PKG_MIRROR_HASH:=0bd0f0980cdb01950da4f10bffbb8089ffd76d442fc443b5f8e1aa860b429063 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile index 2e655ed6f..44f1ef256 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -20,7 +20,6 @@ PKG_INSTALL:=1 PKG_LICENSE:=X11 PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind PKG_MAINTAINER:=Yousong Zhou diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 0dc93941a..59c5a80bd 100644 --- a/package/libs/libusb-compat/Makefile +++ b/package/libs/libusb-compat/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb-compat -PKG_VERSION:=0.1.5 -PKG_RELEASE:=1 +PKG_VERSION:=0.1.4 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/libusb -PKG_HASH:=404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a +PKG_HASH:=ed5bdd160c7b01ef767fb931a81b454f46226d1e2cf58502ced758d3e5a9fdc4 PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index ef33619d8..8d85e4652 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -42,6 +42,10 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += $(FPIC) MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" +ifeq ($(CONFIG_i386)$(CONFIG_x86_64),) + TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1 +endif + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 3a2b29228..0e3383150 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -18,7 +18,6 @@ PKG_HASH:=a99959d7360def22f9108d2d487c9de384fe76c349697176b1f22370080d5810 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:arm:mbed_tls include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index 5fbd6b145..ce32be76a 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -269,3 +269,12 @@ /* \} name SECTION: mbed TLS modules */ +@@ -2681,7 +2681,7 @@ + * recommended because of it is possible to generte SHA-1 collisions, however + * this may be safe for legacy infrastructure where additional controls apply. + */ +-// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES ++#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES + + /** + * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 26fabeef7..60a8a176d 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -44,14 +44,6 @@ define Package/libncurses ABI_VERSION:=$(PKG_VERSION) endef -define Package/libncurses-dev - SECTION:=devel - CATEGORY:=Development - SUBMENU:=Libraries - DEPENDS:=zlib - TITLE:=Development files for the ncurses library -endef - TARGET_CFLAGS += $(FPIC) CONFIGURE_ARGS += \ @@ -132,17 +124,6 @@ define Package/libncurses/install done endef -define Package/libncurses-dev/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ - $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ -endef - define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/* $(1) for lib in ncurses panel menu form; do \ @@ -169,4 +150,3 @@ endef $(eval $(call HostBuild)) $(eval $(call BuildPackage,terminfo)) $(eval $(call BuildPackage,libncurses)) -$(eval $(call BuildPackage,libncurses-dev)) diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile deleted file mode 100644 index 3cc2a5543..000000000 --- a/package/libs/nghttp2/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=nghttp2 -PKG_VERSION:=1.29.0 -PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz - -PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2/releases/download/v$(PKG_VERSION) -PKG_HASH:=a7a1b18be57be6a53a7739988ea27d6ec9209e7b0e8372b8483cd911d7838739 - -PKG_LICENSE:=MIT -PKG_LICENSE_FILES:=COPYING -CMAKE_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/libnghttp2 - SECTION:=libs - CATEGORY:=Libraries - TITLE:=Library implementing the framing layer of HTTP/2 - MAINTAINER:=Hans Dedecker -endef - -define Package/libnghttp2/description - C library implementing the framing layer of the HTTP/2 protocol. It can be used to build a HTTP/2-capable HTTP client or server -endef - -CMAKE_OPTIONS += \ - -DENABLE_LIB_ONLY=ON - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/nghttp2 - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h $(1)/usr/include/nghttp2/ - $(INSTALL_DIR) $(1)/usr/lib/pkgconfig - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/ -endef - -define Package/libnghttp2/install - $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib -endef - -$(eval $(call BuildPackage,libnghttp2)) diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in index 96d3ba3e9..b949d3beb 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -55,11 +55,6 @@ config OPENSSL_HARDWARE_SUPPORT default n prompt "Enable hardware support" -config OPENSSL_OPTIMIZE_SPEED - bool - default n - prompt "Enable optimization for speed instead of size" - endif config OPENSSL_ENGINE_CRYPTO diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index b75aa45e8..4b70bc724 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -18,17 +18,15 @@ PKG_BUILD_PARALLEL:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:= \ - http://ftp.fi.muni.cz/pub/openssl/source/ \ - http://ftp.linux.hr/pub/openssl/source/ \ - http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ - http://www.openssl.org/source/ \ - http://www.openssl.org/source/old/$(PKG_BASE)/ +PKG_SOURCE_URL:=http://www.openssl.org/source/ \ + ftp://ftp.openssl.org/source/ \ + http://www.openssl.org/source/old/$(PKG_BASE)/ \ + ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ + ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ PKG_HASH:=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:openssl:openssl PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_ENGINE_CRYPTO \ CONFIG_OPENSSL_ENGINE_DIGEST \ @@ -41,8 +39,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_WITH_COMPRESSION \ CONFIG_OPENSSL_WITH_NPN \ CONFIG_OPENSSL_WITH_PSK \ - CONFIG_OPENSSL_WITH_SRP \ - CONFIG_OPENSSL_OPTIMIZE_SPEED + CONFIG_OPENSSL_WITH_SRP include $(INCLUDE_DIR)/package.mk @@ -156,10 +153,6 @@ ifndef CONFIG_OPENSSL_WITH_SRP OPENSSL_OPTIONS += no-srp endif -ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y) - TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3 -endif - ifeq ($(CONFIG_x86_64),y) OPENSSL_TARGET:=linux-x86_64-openwrt OPENSSL_MAKEFLAGS += LIBDIR=lib @@ -167,8 +160,6 @@ else OPENSSL_OPTIONS+=no-sse2 ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) OPENSSL_TARGET:=linux-mips-openwrt - else ifeq ($(CONFIG_aarch64),y) - OPENSSL_TARGET:=linux-aarch64-openwrt else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) OPENSSL_TARGET:=linux-armv4-openwrt else @@ -190,7 +181,7 @@ define Build/Configure --openssldir=/etc/ssl \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) -ldl \ - $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \ + -DOPENSSL_SMALL_FOOTPRINT \ $(OPENSSL_NO_CIPHERS) \ $(OPENSSL_OPTIONS) \ ) diff --git a/package/libs/openssl/patches/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch index d6d4a2111..0f174a346 100644 --- a/package/libs/openssl/patches/110-optimize-for-size.patch +++ b/package/libs/openssl/patches/110-optimize-for-size.patch @@ -1,12 +1,11 @@ --- a/Configure +++ b/Configure -@@ -470,6 +470,13 @@ my %table=( +@@ -470,6 +470,12 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", +# OpenWrt targets +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", -+"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-x86_64-openwrt", "gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", diff --git a/package/libs/openssl/patches/160-disable_doc_tests.patch b/package/libs/openssl/patches/160-disable_doc_tests.patch index e38d44a76..73459ff90 100644 --- a/package/libs/openssl/patches/160-disable_doc_tests.patch +++ b/package/libs/openssl/patches/160-disable_doc_tests.patch @@ -36,7 +36,7 @@ build_libs: build_libcrypto build_libssl openssl.pc -@@ -542,7 +542,7 @@ dist: +@@ -534,7 +534,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -47,7 +47,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ --- a/Makefile.org +++ b/Makefile.org -@@ -540,7 +540,7 @@ dist: +@@ -532,7 +532,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar diff --git a/package/libs/openssl/patches/200-parallel_build.patch b/package/libs/openssl/patches/200-parallel_build.patch index f2acc4a27..f1d9f0705 100644 --- a/package/libs/openssl/patches/200-parallel_build.patch +++ b/package/libs/openssl/patches/200-parallel_build.patch @@ -24,7 +24,7 @@ all_testapps: build_libs build_testapps build_testapps: -@@ -473,7 +473,7 @@ update: errors stacks util/libeay.num ut +@@ -465,7 +465,7 @@ update: errors stacks util/libeay.num ut @set -e; target=update; $(RECURSIVE_BUILD_CMD) depend: @@ -33,7 +33,7 @@ lint: @set -e; target=lint; $(RECURSIVE_BUILD_CMD) -@@ -535,9 +535,9 @@ dist: +@@ -527,9 +527,9 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -45,7 +45,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ -@@ -546,12 +546,19 @@ install_sw: +@@ -538,12 +538,19 @@ install_sw: $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private @@ -66,7 +66,7 @@ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ -@@ -635,12 +642,7 @@ install_html_docs: +@@ -627,12 +634,7 @@ install_html_docs: done; \ done @@ -173,7 +173,7 @@ apps: @(cd ..; $(MAKE) DIRS=apps all) -@@ -578,7 +578,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl +@@ -577,7 +577,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl # fi dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index ce0acd19b..58bd06cb5 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -275,32 +275,6 @@ define Package/libgfortran/config endmenu endef -define Package/libgomp -$(call Package/gcc/Default) - TITLE:=OpenMP support library -endef - -define Package/libgomp/config - menu "Configuration" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp - - config LIBGOMP_ROOT_DIR - string - prompt "libgomp shared library base directory" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp - default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN - default "/" if NATIVE_TOOLCHAIN - - config LIBGOMP_FILE_SPEC - string - prompt "libgomp shared library files (use wildcards)" - depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp - default "./lib/libgomp.so*" - - endmenu -endef - - define Package/ldd $(call Package/libc/Default) DEPENDS:=@!USE_MUSL @@ -369,6 +343,9 @@ LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) define Build/Compile/uClibc $(CP) \ $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \ + $(TOOLCHAIN_DIR)/lib/libcrypt-*.so \ + $(TOOLCHAIN_DIR)/lib/libm-*.so \ + $(TOOLCHAIN_DIR)/lib/libpthread-*.so \ $(PKG_BUILD_DIR)/ endef ifneq ($(LIBGCC_SO),) @@ -438,8 +415,17 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(TOOLCHAIN_DIR)/lib/libc.so.* \ $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ $(1)/lib/ + for file in libcrypt libdl libm libutil; do \ + $(CP) \ + $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ + $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ + $(1)/lib/; \ + done + $(CP) \ $(PKG_BUILD_DIR)/libuClibc-* \ + $(PKG_BUILD_DIR)/libm-* \ + $(PKG_BUILD_DIR)/libcrypt-* \ $(1)/lib/ endef @@ -471,7 +457,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libpthread/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \ @@ -496,7 +482,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/librt/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) + ifneq ($(CONFIG_USE_MUSL),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/librt.so.* \ $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \ @@ -587,14 +573,6 @@ else exit 0 endef - define Package/libgomp/install - for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \ - $(INSTALL_DIR) $(1)/lib ; \ - $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \ - done ; \ - exit 0 - endef - define Package/ldd/install for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \ dir=`dirname $$$$file` ; \ @@ -624,6 +602,5 @@ $(eval $(call BuildPackage,libpthread)) $(eval $(call BuildPackage,libthread-db)) $(eval $(call BuildPackage,librt)) $(eval $(call BuildPackage,libgfortran)) -$(eval $(call BuildPackage,libgomp)) $(eval $(call BuildPackage,ldd)) $(eval $(call BuildPackage,ldconfig)) diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index 7afbeeba6..ff6c4b7d0 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -35,11 +35,11 @@ define Package/libustream-openssl VARIANT:=openssl endef -define Package/libustream-wolfssl +define Package/libustream-cyassl $(Package/libustream/default) - TITLE += (wolfssl) - DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl - VARIANT:=wolfssl + TITLE += (cyassl) + DEPENDS += +PACKAGE_libustream-cyassl:libcyassl + VARIANT:=cyassl endef define Package/libustream-mbedtls @@ -50,7 +50,7 @@ define Package/libustream-mbedtls DEFAULT_VARIANT:=1 endef -ifeq ($(BUILD_VARIANT),wolfssl) +ifeq ($(BUILD_VARIANT),cyassl) TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/cyassl -DHAVE_SNI CMAKE_OPTIONS += -DCYASSL=on endif @@ -64,9 +64,9 @@ define Package/libustream/default/install endef Package/libustream-openssl/install = $(Package/libustream/default/install) -Package/libustream-wolfssl/install = $(Package/libustream/default/install) +Package/libustream-cyassl/install = $(Package/libustream/default/install) Package/libustream-mbedtls/install = $(Package/libustream/default/install) $(eval $(call BuildPackage,libustream-mbedtls)) -$(eval $(call BuildPackage,libustream-wolfssl)) +$(eval $(call BuildPackage,libustream-cyassl)) $(eval $(call BuildPackage,libustream-openssl)) diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch deleted file mode 100644 index 83d51b1d5..000000000 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/wolfssl/wolfcrypt/settings.h -+++ b/wolfssl/wolfcrypt/settings.h -@@ -1553,7 +1553,7 @@ extern void uITRON4_free(void *p) ; - #endif - - /* warning for not using harden build options (default with ./configure) */ --#ifndef WC_NO_HARDEN -+#if 0 - #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \ - (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \ - (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS)) diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index 06e67543b..e5fcb8c91 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2017-11-07 -PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68 -PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422 +PKG_SOURCE_DATE:=2017-05-27 +PKG_SOURCE_VERSION:=a4d98aea373e04f3fdc3c492c1688ba52ce490a9 +PKG_MIRROR_HASH:=55402b1e6bb471f6aed599c61c1c63b58212f5789f094d78247646fc0a7cf435 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index b191327f8..9193f5c9f 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=8 +PKG_RELEASE:=7 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index e604bfb25..3301cee00 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -31,16 +31,7 @@ gre_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - - json_add_object 'data' - [ -n "$ikey" ] && json_add_int ikey "$ikey" - [ -n "$okey" ] && json_add_int okey "$okey" - [ -n "$icsum" ] && json_add_boolean icsum "$icsum" - [ -n "$ocsum" ] && json_add_boolean ocsum "$ocsum" - [ -n "$iseqno" ] && json_add_boolean iseqno "$iseqno" - [ -n "$oseqno" ] && json_add_boolean oseqno "$oseqno" - json_close_object - + json_add_string info "${ikey:-0},${okey:-0},${icsum:-0},${ocsum:-0},${iseqno:-0},${oseqno:-0}" proto_close_tunnel proto_add_data diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index cf8eaf247..6e0b47f87 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=dsl_cpe_control_danube PKG_VERSION:=3.24.4.4 -PKG_RELEASE:=5 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION) PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ @@ -35,7 +35,7 @@ define Package/ltq-adsl-app CATEGORY:=Network TITLE:=Lantiq DSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread +ip + DEPENDS:=@(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy||TARGET_lantiq_ase) +libpthread MENU:=1 endef @@ -76,11 +76,10 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += -I$(LINUX_DIR)/include define Package/ltq-adsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(1)/etc/hotplug.d/net + $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl - $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl - $(INSTALL_BIN) ./files/10-adsl_rename $(1)/etc/hotplug.d/net + + $(INSTALL_DIR) $(1)/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin endef diff --git a/package/network/config/ltq-adsl-app/files/10-adsl_rename b/package/network/config/ltq-adsl-app/files/10-adsl_rename deleted file mode 100644 index f81a90a5f..000000000 --- a/package/network/config/ltq-adsl-app/files/10-adsl_rename +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ "$ACTION" = add ]; then - [ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit - - ip link set $DEVICENAME name dsl0 -fi diff --git a/package/network/config/ltq-adsl-app/files/10_atm.sh b/package/network/config/ltq-adsl-app/files/10_atm.sh deleted file mode 100755 index 898d8ec07..000000000 --- a/package/network/config/ltq-adsl-app/files/10_atm.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ -[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ -! grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules || exit 0 - -logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" - -if grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules ; then - logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." - exit -fi - -case "$(strings /proc/device-tree/compatible)" in -*lantiq,ar9*) - soc="ar9" - ;; -*lantiq,ase*) - soc="ase" - ;; -*lantiq,danube*) - soc="danube" - ;; -*) - logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" - exit -esac - -modprobe ltq_atm_${soc} - -/etc/init.d/br2684ctl reload diff --git a/package/network/config/ltq-adsl-app/files/10_ptm.sh b/package/network/config/ltq-adsl-app/files/10_ptm.sh deleted file mode 100755 index 8a76b926f..000000000 --- a/package/network/config/ltq-adsl-app/files/10_ptm.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ -[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ -! grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules || exit 0 - -logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" - -if grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules ; then - logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." - exit -fi - -case "$(strings /proc/device-tree/compatible)" in -*lantiq,ar9*) - soc="ar9" - ;; -*lantiq,ase*) - soc="ase" - ;; -*lantiq,danube*) - soc="danube" - ;; -*) - logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" - exit -esac - -modprobe ltq_ptm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control index d93d47808..dcde6b233 100644 --- a/package/network/config/ltq-adsl-app/files/dsl_control +++ b/package/network/config/ltq-adsl-app/files/dsl_control @@ -2,12 +2,14 @@ # Copyright (C) 2012 OpenWrt.org START=49 -USE_PROCD=1 EXTRA_COMMANDS="status lucistat" EXTRA_HELP=" status Get DSL status information lucistat Get status information if lua friendly format" +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh annex_b=10_00_10_00_00_04_00_00 @@ -26,11 +28,7 @@ annex_m2=00_00_00_00_40_00_00_00 annex_m2p=00_00_00_00_00_00_04_00 annex_j=10_00_10_40_00_04_01_00 -service_triggers() { - procd_add_reload_trigger network -} - -start_service() { +start() { local annex local firmware local xtu @@ -47,15 +45,14 @@ start_service() { return 1 } - procd_open_instance - procd_set_param command /sbin/dsl_cpe_control \ - -i${xtu} \ + esi $(printf '%012X' $((1+0x$(tr -d : -Date: Mon, 16 Oct 2017 21:08:26 +0200 -Subject: ltq-adsl-app: add more script notifications - -Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It -unifies the dsl led blinking pattern accross all subtargets and allows -to get the current line status from the dsl led. - -Signed-off-by: Mathias Kresin ---- - .../100-add-more-script-notifications.patch | 27 ++++++++++++++++++++++ - 1 file changed, 27 insertions(+) - create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch - ---- a/src/dsl_cpe_control.c -+++ b/src/dsl_cpe_control.c -@@ -3273,7 +3273,23 @@ DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S - #ifdef INCLUDE_SCRIPT_NOTIFICATION - if (g_sRcScript != DSL_NULL) - { -- if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && -+ if ( (nLineState == DSL_LINESTATE_HANDSHAKE) && -+ (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) ) -+ { -+ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS) -+ { -+ bExec = DSL_TRUE; -+ } -+ } -+ else if ( (nLineState == DSL_LINESTATE_FULL_INIT) && -+ (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) ) -+ { -+ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS) -+ { -+ bExec = DSL_TRUE; -+ } -+ } -+ else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && - (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) - { - if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS) diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile index baf63f9d1..1ddb83a0a 100644 --- a/package/network/config/ltq-vdsl-app/Makefile +++ b/package/network/config/ltq-vdsl-app/Makefile @@ -28,7 +28,7 @@ define Package/ltq-vdsl-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +ip + DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +atm-esi endef define Package/ltq-vdsl-app/description @@ -58,11 +58,9 @@ CONFIGURE_ARGS += \ #CONFIGURE_ARGS += --enable-model=debug define Package/ltq-vdsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(1)/etc/hotplug.d/net + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl - $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl - $(INSTALL_BIN) ./files/10-xdsl_rename $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/vdsl_cpe_control_wrapper $(1)/sbin/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin/vdsl_cpe_control $(INSTALL_BIN) ./files/dsl_cpe_pipe.sh $(1)/sbin/ diff --git a/package/network/config/ltq-vdsl-app/files/10-xdsl_rename b/package/network/config/ltq-vdsl-app/files/10-xdsl_rename deleted file mode 100644 index f81a90a5f..000000000 --- a/package/network/config/ltq-vdsl-app/files/10-xdsl_rename +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -if [ "$ACTION" = add ]; then - [ "$DEVICENAME" = "nas0" ] || [ "$DEVICENAME" = "ptm0" ] || exit - - ip link set $DEVICENAME name dsl0 -fi diff --git a/package/network/config/ltq-vdsl-app/files/10_atm.sh b/package/network/config/ltq-vdsl-app/files/10_atm.sh deleted file mode 100755 index abfb73592..000000000 --- a/package/network/config/ltq-vdsl-app/files/10_atm.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ -[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ -! grep -q "ltq_atm_vr9" /proc/modules || exit 0 - -logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" - -if grep -q "ltq_ptm_vr9" /proc/modules ; then - logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." - exit -fi - -modprobe ltq_atm_vr9 - -/etc/init.d/br2684ctl reload diff --git a/package/network/config/ltq-vdsl-app/files/10_ptm.sh b/package/network/config/ltq-vdsl-app/files/10_ptm.sh deleted file mode 100755 index 1c62617bb..000000000 --- a/package/network/config/ltq-vdsl-app/files/10_ptm.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ -[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ -! grep -q "ltq_ptm_vr9" /proc/modules || exit 0 - -logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" - -if grep -q "ltq_atm_vr9" /proc/modules ; then - logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." - exit -fi - -modprobe ltq_ptm_vr9 diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index 818990e57..d7980b411 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -180,7 +180,6 @@ start_service() { local xtse local xfer_mode local line_mode - local tc_layer local mode local lowlevel local snr @@ -195,44 +194,37 @@ start_service() { eval "xtse=\"\${xtse_xdsl_$annex}\"" + [ -z "${xfer_mode}" ] && xfer_mode=ptm + case "${xfer_mode}" in atm) - tc_layer="-T1:0x1:0x1_1:0x1:0x1" + LOAD=ltq_atm_vr9 + UNLOAD=ltq_ptm_vr9 + + # in most cases atm is used on top of adsl + [ -z "${line_mode}" ] && line_mode=adsl ;; - ptm) - tc_layer="-T2:0x1:0x1_2:0x1:0x1" + *) + LOAD=ltq_ptm_vr9 + UNLOAD=ltq_atm_vr9 + + # in most cases ptm is used on top of vdsl + [ -z "${line_mode}" ] && line_mode=vdsl ;; esac case "${line_mode}" in adsl) - mode="-M1" + mode=1 - # mask out VDSL bits when ADSL is requested + # mask out VDSL bits when ATM is requested xtse="${xtse%_*}_00" ;; - vdsl) - mode="-M2" - - # mask out ADSL bits when VDSL is requested - xtse="00_00_00_00_00_00_00_${xtse##*_}" + *) + mode=2 ;; esac - local annexgpio="/sys/class/gpio/annex" - if [ -d "${annexgpio}a" ] && [ -d "${annexgpio}b" ]; then - case "${annex}" in - a*|l*|m*) - echo 1 > "${annexgpio}a/value" - echo 0 > "${annexgpio}b/value" - ;; - b*|j*) - echo 0 > "${annexgpio}a/value" - echo 1 > "${annexgpio}b/value" - ;; - esac - fi - if [ -z "${firmware}" ]; then # search for the firmware provided by dsl-vrx200-firmware-xdsl-* if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then @@ -295,14 +287,14 @@ start_service() { } procd_open_instance - procd_set_param command /sbin/vdsl_cpe_control \ + procd_set_param command /sbin/vdsl_cpe_control_wrapper \ -i$xtse \ -n /sbin/dsl_notify.sh \ -f ${firmware} \ $lowlevel \ - ${mode} \ - ${tc_layer} \ + -M ${mode} \ $autoboot + procd_append_param env "LOAD=$LOAD" "UNLOAD=$UNLOAD" procd_close_instance } diff --git a/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper b/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper new file mode 100644 index 000000000..cc127f777 --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper @@ -0,0 +1,11 @@ +#!/bin/sh + +for mod in $UNLOAD; do + grep -q "$mod " /proc/modules && rmmod "$mod" +done +for mod in $LOAD; do + grep -q "$mod " /proc/modules || insmod "$mod" +done + +esi $(printf '%012X' $((1+0x$(tr -d : diff --git a/package/network/config/vti/Makefile b/package/network/config/vti/Makefile index 0a4657c94..bda2a9ab1 100644 --- a/package/network/config/vti/Makefile +++ b/package/network/config/vti/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vti PKG_VERSION:=1 -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/vti/files/vti.sh b/package/network/config/vti/files/vti.sh index 0443800a0..763fd4ee3 100755 --- a/package/network/config/vti/files/vti.sh +++ b/package/network/config/vti/files/vti.sh @@ -26,12 +26,7 @@ vti_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - - json_add_object 'data' - [ -n "$ikey" ] && json_add_int ikey "$ikey" - [ -n "$okey" ] && json_add_int okey "$okey" - json_close_object - + json_add_string info "${ikey:-0},${okey:-0}" proto_close_tunnel proto_add_data diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile deleted file mode 100644 index a471d4e90..000000000 --- a/package/network/config/vxlan/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=vxlan -PKG_VERSION:=1 -PKG_LICENSE:=GPL-2.0 - -include $(INCLUDE_DIR)/package.mk - -define Package/vxlan - SECTION:=net - CATEGORY:=Network - MAINTAINER:=Matthias Schiffer - TITLE:=Virtual eXtensible LAN config support - DEPENDS:=+kmod-vxlan -endef - -define Package/vxlan/description - Virtual eXtensible LAN config support in /etc/config/network. -endef - -define Build/Compile -endef - -define Build/Configure -endef - -define Package/vxlan/install - $(INSTALL_DIR) $(1)/lib/netifd/proto - $(INSTALL_BIN) ./files/vxlan.sh $(1)/lib/netifd/proto/vxlan.sh -endef - -$(eval $(call BuildPackage,vxlan)) diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh deleted file mode 100755 index 27ccd8f12..000000000 --- a/package/network/config/vxlan/files/vxlan.sh +++ /dev/null @@ -1,148 +0,0 @@ -#!/bin/sh - -[ -n "$INCLUDE_ONLY" ] || { - . /lib/functions.sh - . /lib/functions/network.sh - . ../netifd-proto.sh - init_proto "$@" -} - -vxlan_generic_setup() { - local cfg="$1" - local mode="$2" - local local="$3" - local remote="$4" - - local link="$cfg" - - local port vid ttl tos mtu macaddr zone - json_get_vars port vid ttl tos mtu macaddr zone - - - proto_init_update "$link" 1 - - proto_add_tunnel - json_add_string mode "$mode" - - [ -n "$tunlink" ] && json_add_string link "$tunlink" - [ -n "$local" ] && json_add_string local "$local" - [ -n "$remote" ] && json_add_string remote "$remote" - - [ -n "$ttl" ] && json_add_int ttl "$ttl" - [ -n "$tos" ] && json_add_string tos "$tos" - [ -n "$mtu" ] && json_add_int mtu "$mtu" - - json_add_object 'data' - [ -n "$port" ] && json_add_int port "$port" - [ -n "$vid" ] && json_add_int id "$vid" - [ -n "$macaddr" ] && json_add_string macaddr "$macaddr" - json_close_object - - proto_close_tunnel - - proto_add_data - [ -n "$zone" ] && json_add_string zone "$zone" - proto_close_data - - proto_send_update "$cfg" -} - -proto_vxlan_setup() { - local cfg="$1" - - local ipaddr peeraddr - json_get_vars ipaddr peeraddr tunlink - - [ -z "$peeraddr" ] && { - proto_notify_error "$cfg" "MISSING_ADDRESS" - proto_block_restart "$cfg" - exit - } - - ( proto_add_host_dependency "$cfg" '' "$tunlink" ) - - [ -z "$ipaddr" ] && { - local wanif="$tunlink" - if [ -z "$wanif" ] && ! network_find_wan wanif; then - proto_notify_error "$cfg" "NO_WAN_LINK" - exit - fi - - if ! network_get_ipaddr ipaddr "$wanif"; then - proto_notify_error "$cfg" "NO_WAN_LINK" - exit - fi - } - - vxlan_generic_setup "$cfg" 'vxlan' "$ipaddr" "$peeraddr" -} - -proto_vxlan6_setup() { - local cfg="$1" - - local ip6addr peer6addr - json_get_vars ip6addr peer6addr tunlink - - [ -z "$peer6addr" ] && { - proto_notify_error "$cfg" "MISSING_ADDRESS" - proto_block_restart "$cfg" - exit - } - - ( proto_add_host_dependency "$cfg" '' "$tunlink" ) - - [ -z "$ip6addr" ] && { - local wanif="$tunlink" - if [ -z "$wanif" ] && ! network_find_wan6 wanif; then - proto_notify_error "$cfg" "NO_WAN_LINK" - exit - fi - - if ! network_get_ipaddr6 ip6addr "$wanif"; then - proto_notify_error "$cfg" "NO_WAN_LINK" - exit - fi - } - - vxlan_generic_setup "$cfg" 'vxlan6' "$ip6addr" "$peer6addr" -} - -proto_vxlan_teardown() { - local cfg="$1" -} - -proto_vxlan6_teardown() { - local cfg="$1" -} - -vxlan_generic_init_config() { - no_device=1 - available=1 - - proto_config_add_string "tunlink" - proto_config_add_string "zone" - - proto_config_add_int "vid" - proto_config_add_int "port" - proto_config_add_int "ttl" - proto_config_add_int "tos" - proto_config_add_int "mtu" - proto_config_add_string "macaddr" -} - -proto_vxlan_init_config() { - vxlan_generic_init_config - proto_config_add_string "ipaddr" - proto_config_add_string "peeraddr" -} - -proto_vxlan6_init_config() { - vxlan_generic_init_config - proto_config_add_string "ip6addr" - proto_config_add_string "peer6addr" -} - -[ -n "$INCLUDE_ONLY" ] || { - add_protocol vxlan - add_protocol vxlan6 -} diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 5086fae69..899c0f13f 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd PKG_VERSION:=9 -PKG_RELEASE:=3 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 8b3441428..62d35b699 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -64,13 +64,9 @@ proto_6rd_setup() { json_add_int ttl "${ttl:-64}" [ -n "$tos" ] && json_add_string tos "$tos" json_add_string local "$ipaddr" + json_add_string 6rd-prefix "$ip6prefix/$ip6prefixlen" + json_add_string 6rd-relay-prefix "$ip4prefix/$ip4prefixlen" [ -n "$tunlink" ] && json_add_string link "$tunlink" - - json_add_object 'data' - json_add_string prefix "$ip6prefix/$ip6prefixlen" - json_add_string relay-prefix "$ip4prefix/$ip4prefixlen" - json_close_object - proto_close_tunnel proto_add_data diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index ce04235f2..fd8291d68 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map PKG_VERSION:=4 -PKG_RELEASE:=9 +PKG_RELEASE:=6 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index 42050183c..fe872828c 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -86,19 +86,15 @@ proto_map_setup() { json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") if [ "$type" = "map-e" ]; then - json_add_object "data" - json_add_array "fmrs" + json_add_array "fmrs" for i in $(seq $RULE_COUNT); do [ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue - json_add_object "" - json_add_string prefix6 "$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" - json_add_string prefix4 "$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" - json_add_int ealen $(eval "echo \$RULE_${i}_EALEN") - json_add_int offset $(eval "echo \$RULE_${i}_OFFSET") - json_close_object + fmr="$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" + fmr="$fmr,$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" + fmr="$fmr,$(eval "echo \$RULE_${i}_EALEN"),$(eval "echo \$RULE_${i}_OFFSET")" + json_add_string "" "$fmr" done - json_close_array - json_close_object + json_close_array fi proto_close_tunnel @@ -220,7 +216,6 @@ proto_map_init_config() { proto_config_add_string "ip6prefix" proto_config_add_int "ip6prefixlen" proto_config_add_string "peeraddr" - proto_config_add_int "ealen" proto_config_add_int "psidlen" proto_config_add_int "psid" proto_config_add_int "offset" diff --git a/package/network/ipv6/map/src/mapcalc.c b/package/network/ipv6/map/src/mapcalc.c index 6233bce73..648840d9b 100644 --- a/package/network/ipv6/map/src/mapcalc.c +++ b/package/network/ipv6/map/src/mapcalc.c @@ -118,7 +118,7 @@ static void match_prefix(int *pdlen, struct in6_addr *pd, struct blob_attr *cur, struct blob_attr *d; unsigned drem; - if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, false)) + if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, NULL)) return; blobmsg_for_each_attr(d, cur, drem) { diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 457a871ef..8b97e1fb2 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,22 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=4 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2017-09-05 -PKG_SOURCE_VERSION:=51733a6d3bfe0fb9e8c53aea22231e5b8a1f64c3 -PKG_MIRROR_HASH:=fdccfb9a6cb00d6dbf1a3160bd36622ee8e188a9d58bcd282c71a9368972e184 +PKG_SOURCE_URL:=$(LEDE_GIT)/project/odhcp6c.git +PKG_SOURCE_DATE:=2017-01-30 +PKG_SOURCE_VERSION:=c13b6a05dbd9174356cc4b7fd1edf39445efd982 +PKG_MIRROR_HASH:=001e58f1ab6eb8903d9e47060ae037a2e4f021f1fef5032347b767f56f4664f6 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += \ - -DUSE_LIBUBOX=on - ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_cer_id),0) CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcp6c_ext_cer_id) endif diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index 03efaf721..ab0b55675 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -81,23 +81,6 @@ setup_interface () { # RFC 7278 if [ "$mask" -eq 64 -a -z "$PREFIXES" -a -n "$EXTENDPREFIX" ]; then proto_add_ipv6_prefix "$addr/$mask,$preferred,$valid" - - local raroutes="" - for route in $RA_ROUTES; do - local prefix="${route%%/*}" - local entry="${route#*/}" - local pmask="${entry%%,*}" - entry="${entry#*,}" - local gw="${entry%%,*}" - - [ -z "$gw" -a "$mask" = "$pmask" ] && { - case "$addr" in - "${prefix%*::}"*) continue;; - esac - } - raroutes="$raroutes $route" - done - RA_ROUTES="$raroutes" fi done diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh index 56f75521e..9e3f66973 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -31,15 +31,14 @@ proto_dhcpv6_init_config() { proto_config_add_boolean fakeroutes proto_config_add_boolean sourcefilter proto_config_add_boolean keep_ra_dnslifetime - proto_config_add_int "ra_holdoff" } proto_dhcpv6_setup() { local config="$1" local iface="$2" - local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime # Configure @@ -65,8 +64,6 @@ proto_dhcpv6_setup() { [ "$keep_ra_dnslifetime" = "1" ] && append opts "-L" - [ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff" - for opt in $reqopts; do append opts "-r$opt" done diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 79c228aff..1a887beba 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.78 -PKG_RELEASE:=7 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/ @@ -17,14 +17,12 @@ PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:thekelleys:dnsmasq PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \ - CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \ @@ -39,7 +37,6 @@ define Package/dnsmasq/Default CATEGORY:=Base system TITLE:=DNS and DHCP server URL:=http://www.thekelleys.org.uk/dnsmasq/ - DEPENDS:=+libubus USERID:=dnsmasq=453:dnsmasq=453 endef @@ -51,14 +48,14 @@ endef define Package/dnsmasq-dhcpv6 $(call Package/dnsmasq/Default) TITLE += (with DHCPv6 support) - DEPENDS+=@IPV6 + DEPENDS:=@IPV6 VARIANT:=dhcpv6 endef define Package/dnsmasq-full $(call Package/dnsmasq/Default) TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default) - DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \ + DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \ +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \ +PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack VARIANT:=full @@ -77,8 +74,8 @@ endef define Package/dnsmasq-full/description $(call Package/dnsmasq/description) -This is a fully configurable variant with DHCPv4, DHCPv6, DNSSEC, Authoritative DNS -and IPset, Conntrack support & NO_ID enabled by default. +This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and +IPset, Conntrack support & NO_ID enabled by default. endef define Package/dnsmasq/conffiles @@ -88,12 +85,9 @@ endef define Package/dnsmasq-full/config if PACKAGE_dnsmasq-full - config PACKAGE_dnsmasq_full_dhcp - bool "Build with DHCP support." - default y config PACKAGE_dnsmasq_full_dhcpv6 bool "Build with DHCPv6 support." - depends on IPV6 && PACKAGE_dnsmasq_full_dhcp + depends on IPV6 default n config PACKAGE_dnsmasq_full_dnssec bool "Build with DNSSEC support." @@ -129,8 +123,7 @@ ifeq ($(BUILD_VARIANT),nodhcpv6) endif ifeq ($(BUILD_VARIANT),full) - COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp),,-DNO_DHCP) \ - $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ + COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \ @@ -157,17 +150,8 @@ define Package/dnsmasq/install $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq - $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp - $(INSTALL_DIR) $(1)/etc/hotplug.d/neigh $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp - $(INSTALL_DIR) $(1)/etc/hotplug.d/tftp $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec - $(INSTALL_DIR) $(1)/usr/share/dnsmasq - $(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/ - $(INSTALL_DIR) $(1)/usr/lib/dnsmasq - $(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh - $(INSTALL_DIR) $(1)/usr/share/acl.d - $(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/ endef Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install) diff --git a/package/network/services/dnsmasq/files/dhcp-script.sh b/package/network/services/dnsmasq/files/dhcp-script.sh deleted file mode 100755 index 86032694c..000000000 --- a/package/network/services/dnsmasq/files/dhcp-script.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -[ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@" - -case "$1" in - add) - export ACTION="add" - export MACADDR="$2" - export IPADDR="$3" - export HOSTNAME="$4" - exec /sbin/hotplug-call dhcp - ;; - del) - export ACTION="remove" - export MACADDR="$2" - export IPADDR="$3" - export HOSTNAME="$4" - exec /sbin/hotplug-call dhcp - ;; - old) - export ACTION="update" - export MACADDR="$2" - export IPADDR="$3" - export HOSTNAME="$4" - exec /sbin/hotplug-call dhcp - ;; - arp-add) - export ACTION="add" - export MACADDR="$2" - export IPADDR="$3" - exec /sbin/hotplug-call neigh - ;; - arp-del) - export ACTION="remove" - export MACADDR="$2" - export IPADDR="$3" - exec /sbin/hotplug-call neigh - ;; - tftp) - export ACTION="add" - export TFTP_SIZE="$2" - export TFTP_ADDR="$3" - export TFTP_PATH="$4" - exec /sbin/hotplug-call tftp - ;; -esac diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index 360c7d79e..362b90a29 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -15,7 +15,7 @@ config dnsmasq option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' - option nonwildcard 1 # bind to & keep track of interfaces + #option nonwildcard 1 #list interface br-lan #list notinterface lo #list bogusnxdomain '64.94.110.11' diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index dcc18e34d..34c35c2dc 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -8,18 +8,13 @@ PROG=/usr/sbin/dnsmasq ADD_LOCAL_DOMAIN=1 ADD_LOCAL_HOSTNAME=1 -ADD_WAN_FQDN=0 -ADD_LOCAL_FQDN="" BASECONFIGFILE="/var/etc/dnsmasq.conf" BASEHOSTFILE="/tmp/hosts/dhcp" +BASETIMESTAMPFILE="/etc/dnsmasq.time" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" BASEDHCPSTAMPFILE="/var/run/dnsmasq" -RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" -DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" - -DNSMASQ_DHCP_VER=4 xappend() { local value="$1" @@ -88,24 +83,12 @@ log_once() { logger -t dnsmasq "$@" } -has_handler() { - local file - - for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do - [ -f "$file" ] && return 0 - done - - return 1 -} - append_bool() { local section="$1" local option="$2" local value="$3" - local default="$4" local _loctmp - [ -z "$default" ] && default="0" - config_get_bool _loctmp "$section" "$option" "$default" + config_get_bool _loctmp "$section" "$option" 0 [ $_loctmp -gt 0 ] && xappend "$value" } @@ -124,10 +107,6 @@ append_server() { xappend "--server=$1" } -append_rev_server() { - xappend "--rev-server=$1" -} - append_address() { xappend "--address=$1" } @@ -141,10 +120,6 @@ append_interface() { xappend "--interface=$ifname" } -append_listenaddress() { - xappend "--listen-address=$1" -} - append_notinterface() { network_get_device ifname "$1" || ifname="$1" xappend "--except-interface=$ifname" @@ -162,10 +137,6 @@ append_pxe_service() { xappend "--pxe-service=$1" } -append_interface_name() { - xappend "--interface-name=$1,$2" -} - filter_dnsmasq() { local cfg="$1" func="$2" match_cfg="$3" found_cfg @@ -209,7 +180,6 @@ dhcp_remoteid_add() { } dhcp_circuitid_add() { - # TODO: DHCPV6 does not have circuitid; catch "option6:" local cfg="$1" config_get networkid "$cfg" networkid @@ -242,7 +212,6 @@ dhcp_userclass_add() { } dhcp_vendorclass_add() { - # TODO: DHCPV6 vendor class has stricter definitions; catch? fixup? local cfg="$1" config_get networkid "$cfg" networkid @@ -276,7 +245,6 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" - local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -288,113 +256,44 @@ dhcp_host_add() { config_get name "$cfg" name config_get ip "$cfg" ip - config_get hostid "$cfg" hostid - - [ -n "$ip" -o -n "$name" -o -n "$hostid" ] || return 0 + [ -n "$ip" -o -n "$name" ] || return 0 config_get_bool dns "$cfg" dns 0 [ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && { - echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP + echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE } config_get mac "$cfg" mac - config_get duid "$cfg" duid - config_get tag "$cfg" tag - if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap - # many MAC are possible to track a laptop ON/OFF dock + macs="" for m in $mac; do append macs "$m" ","; done - fi - - if [ $DNSMASQ_DHCP_VER -eq 6 -a -n "$duid" ]; then - # --dhcp-host=id:00:03:00:01:12:00:00:01:02:03,[::beef],lap - # one (virtual) machine gets one DUID per RFC3315 - duids="id:${duid// */}" - fi - - if [ -z "$macs" -a -z "$duids" ]; then - # --dhcp-host=lap,192.168.0.199,[::beef] + else + # --dhcp-host=lap,192.168.0.199 [ -n "$name" ] || return 0 macs="$name" name="" fi - if [ -n "$hostid" ]; then - hex_to_hostid hostid "$hostid" - fi + config_get tag "$cfg" tag - if [ -n "$tag" ]; then - for t in $tag; do append tags "$t" ",set:"; done + if [ "$DHCPv6CAPABLE" -eq 1 ]; then + config_get duid "$cfg" duid + config_get hostid "$cfg" hostid + if [ -n "$hostid" ]; then + hex_to_hostid hostid "$hostid" + fi fi config_get_bool broadcast "$cfg" broadcast 0 + [ "$broadcast" = "0" ] && broadcast= + config_get leasetime "$cfg" leasetime - [ "$broadcast" = "0" ] && broadcast= || broadcast=",set:needs-broadcast" - - hosttag="${networkid:+,set:${networkid}}${tags:+,set:${tags}}$broadcast" - nametime="${name:+,$name}${leasetime:+,$leasetime}" - - if [ $DNSMASQ_DHCP_VER -eq 6 ]; then - addrs="${ip:+,$ip}${hostid:+,[::$hostid]}" - xappend "--dhcp-host=$macs${duids:+,$duids}$hosttag$addrs$nametime" - else - xappend "--dhcp-host=$macs$hosttag${ip:+,$ip}$nametime" - fi -} - -dhcp_this_host_add() { - local net="$1" - local ifname="$2" - local mode="$3" - local routerstub routername ifdashname - local lanaddr lanaddr6 lanaddrs6 ulaprefix - - if [ "$mode" -gt 0 ] ; then - ifdashname="${ifname//./-}" - routerstub="$( md5sum /etc/os-release )" - routerstub="router-${routerstub// */}" - routername="$( uci_get system @system[0] hostname $routerstub )" - - if [ "$mode" -gt 1 ] ; then - if [ "$mode" -gt 2 ] ; then - if [ "$mode" -gt 3 ] ; then - append_interface_name "$ifdashname.$routername.$DOMAIN" "$ifname" - fi - - append_interface_name "$routername.$DOMAIN" "$ifname" - fi - - # All IP addresses discovered by dnsmasq will be labeled (except fe80::) - append_interface_name "$routername" "$ifname" - - else - # This uses a static host file entry for only limited addresses. - # Use dnsmasq option "--expandhosts" to enable FQDN on host files. - ulaprefix="$(uci_get network @globals[0] ula_prefix)" - network_get_ipaddr lanaddr "$net" - network_get_ipaddrs6 lanaddrs6 "$net" - - if [ -n "$lanaddr" ] ; then - dhcp_domain_add "" "$routername" "$lanaddr" - fi - - if [ -n "$ulaprefix" -a -n "$lanaddrs6" ] ; then - for lanaddr6 in $lanaddrs6 ; do - case "$lanaddr6" in - "${ulaprefix%%:/*}"*) - dhcp_domain_add "" "$routername" "$lanaddr6" - ;; - esac - done - fi - fi - fi + xappend "--dhcp-host=$macs${duid:+,id:$duid}${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}" } dhcp_tag_add() { - # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" tag="$cfg" @@ -425,7 +324,6 @@ dhcp_mac_add() { } dhcp_boot_add() { - # TODO: BOOTURL is different between DHCPv4 and DHCPv6 local cfg="$1" config_get networkid "$cfg" networkid @@ -448,30 +346,24 @@ dhcp_boot_add() { dhcp_add() { local cfg="$1" - local dhcp6range="::" - local nettag - local tags - config_get net "$cfg" interface [ -n "$net" ] || return 0 + config_get dhcpv4 "$cfg" dhcpv4 + [ "$dhcpv4" != "disabled" ] || return 0 + config_get networkid "$cfg" networkid [ -n "$networkid" ] || networkid="$net" + network_get_subnet subnet "$net" || return 0 network_get_device ifname "$net" || return 0 + network_get_protocol proto "$net" || return 0 [ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && { DNS_SERVERS="$DNS_SERVERS $dnsserver" } - append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && { - # Many ISP do not have useful names for DHCP customers (your WAN). - dhcp_this_host_add "$net" "$ifname" "$ADD_WAN_FQDN" - return 0 - } - - network_get_subnet subnet "$net" || return 0 - network_get_protocol proto "$net" || return 0 + append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0 # Do not support non-static interfaces for now [ static = "$proto" ] || return 0 @@ -483,107 +375,21 @@ dhcp_add() { config_get_bool force "$cfg" force 0 [ $force -gt 0 ] || dhcp_check "$ifname" || return 0 - config_get start "$cfg" start 100 - config_get limit "$cfg" limit 150 - config_get leasetime "$cfg" leasetime 12h + config_get start "$cfg" start + config_get limit "$cfg" limit + config_get leasetime "$cfg" leasetime config_get options "$cfg" options config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1 - config_get dhcpv4 "$cfg" dhcpv4 - config_get dhcpv6 "$cfg" dhcpv6 - - config_get ra "$cfg" ra - config_get ra_management "$cfg" ra_management - config_get ra_preference "$cfg" ra_preference - config_get dns "$cfg" dns - - config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname" - - # Put the router host name on this DHCP served interface address(es) - dhcp_this_host_add "$net" "$ifname" "$ADD_LOCAL_FQDN" - - start="$( dhcp_calc "$start" )" - - add_tag() { - tags="${tags}tag:$1," - } - config_list_foreach "$cfg" tag add_tag - - nettag="${networkid:+set:${networkid},}" - - if [ "$limit" -gt 0 ] ; then - limit=$((limit-1)) - fi - + leasetime="${leasetime:-12h}" + start="$(dhcp_calc "${start:-100}")" + limit="${limit:-150}" + [ "$limit" -gt 0 ] && limit=$((limit-1)) eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" + if [ "$dynamicdhcp" = "0" ]; then END="static"; fi + xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}" - if [ "$dynamicdhcp" = "0" ] ; then - END="static" - dhcp6range="::,static" - else - dhcp6range="::1000,::ffff" - fi - - - if [ "$dhcpv4" != "disabled" ] ; then - xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" - fi - - - if [ $DNSMASQ_DHCP_VER -eq 6 -a "$ra" = "server" ] ; then - # Note: dnsmasq cannot just be a DHCPv6 server (all-in-1) - # and let some other machine(s) send RA pointing to it. - - case $ra_preference in - *high*) - xappend "--ra-param=$ifname,high,0,7200" - ;; - *low*) - xappend "--ra-param=$ifname,low,0,7200" - ;; - *) - # Send UNSOLICITED RA at default interval and live for 2 hours. - # TODO: convert flexible lease time into route life time (only seconds). - xappend "--ra-param=$ifname,0,7200" - ;; - esac - - if [ "$dhcpv6" = "disabled" ] ; then - ra_management="3" - fi - - - case $ra_management in - 0) - # SLACC with DCHP for extended options - xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-stateless,ra-names" - ;; - 2) - # DHCP address and RA only for management redirection - xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,$leasetime" - ;; - 3) - # SLAAC only but dnsmasq attempts to link HOSTNAME, DHCPv4 MAC, and SLAAC - xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-only,ra-names" - ;; - *) - # SLAAC and full DHCP - xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,slaac,ra-names,$leasetime" - ;; - esac - - if [ -n "$dns" ]; then - dnss="" - for d in $dns; do append dnss "[$d]" ","; done - else - dnss="[::]" - fi - - dhcp_option_append "option6:dns-server,$dnss" "$networkid" - fi - - dhcp_option_add "$cfg" "$networkid" 0 - dhcp_option_add "$cfg" "$networkid" 2 + dhcp_option_add "$cfg" "$networkid" } dhcp_option_append() { @@ -595,24 +401,21 @@ dhcp_option_append() { } dhcp_option_add() { - # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" local networkid="$2" local force="$3" - local opt="dhcp_option" [ "$force" = "0" ] && force= - [ "$force" = "2" ] && opt="dhcp_option_force" local list_len - config_get list_len "$cfg" "${opt}_LENGTH" + config_get list_len "$cfg" dhcp_option_LENGTH if [ -n "$list_len" ]; then - config_list_foreach "$cfg" "$opt" dhcp_option_append "$networkid" "$force" + config_list_foreach "$cfg" dhcp_option dhcp_option_append "$networkid" "$force" else - config_get dhcp_option "$cfg" "$opt" + config_get dhcp_option "$cfg" dhcp_option - [ -n "$dhcp_option" ] && echo "Warning: the 'option $opt' syntax is deprecated, use 'list $opt'" >&2 + [ -n "$dhcp_option" ] && echo "Warning: the 'option dhcp_option' syntax is deprecated, use 'list dhcp_option'" >&2 local option for option in $dhcp_option; do @@ -635,7 +438,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE_TMP + echo "$ip $record" >> $HOSTFILE } dhcp_srv_add() { @@ -730,7 +533,7 @@ dhcp_relay_add() { dnsmasq_start() { - local cfg="$1" disabled resolvfile user_dhcpscript + local cfg="$1" disabled config_get_bool disabled "$cfg" disabled 0 [ "$disabled" -gt 0 ] && return 0 @@ -741,7 +544,7 @@ dnsmasq_start() CONFIGFILE="${BASECONFIGFILE}.${cfg}" CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" - HOSTFILE_TMP="${HOSTFILE}.$$" + TIMESTAMPFILE="${BASETIMESTAMPFILE}.${cfg}" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend @@ -751,8 +554,10 @@ dnsmasq_start() mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq + [ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE" + echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP - echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP + echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" if [ ! -r "$dnsmasqconffile" ]; then @@ -766,41 +571,6 @@ dnsmasq_start() $PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0 - - if [ -x /usr/sbin/odhcpd -a -x /etc/init.d/odhcpd ] ; then - local odhcpd_is_main odhcpd_is_enabled - config_get odhcpd_is_main odhcpd maindhcp 0 - /etc/init.d/odhcpd enabled && odhcpd_is_enabled=1 || odhcpd_is_enabled=0 - - - if [ "$odhcpd_is_enabled" -eq 0 -a "$DHCPv6CAPABLE" -eq 1 ] ; then - # DHCP V4 and V6 in DNSMASQ - DNSMASQ_DHCP_VER=6 - elif [ "$odhcpd_is_main" -gt 0 ] ; then - # ODHCPD is doing it all - DNSMASQ_DHCP_VER=0 - else - # You have ODHCPD but use DNSMASQ for DHCPV4 - DNSMASQ_DHCP_VER=4 - fi - - elif [ "$DHCPv6CAPABLE" -eq 1 ] ; then - # DHCP V4 and V6 in DNSMASQ - DNSMASQ_DHCP_VER=6 - else - DNSMASQ_DHCP_VER=4 - fi - - # Allow DHCP/DHCPv6 to be handled by ISC DHCPD - if [ -x /usr/sbin/dhcpd ] ; then - if [ -x /etc/init.d/dhcpd ] ; then - /etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0 - fi - if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then - /etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4 - fi - fi - append_bool "$cfg" authoritative "--dhcp-authoritative" append_bool "$cfg" nodaemon "--no-daemon" append_bool "$cfg" domainneeded "--domain-needed" @@ -813,11 +583,12 @@ dnsmasq_start() append_bool "$cfg" localise_queries "--localise-queries" append_bool "$cfg" readethers "--read-ethers" append_bool "$cfg" dbus "--enable-dbus" + append_bool "$cfg" boguspriv "--bogus-priv" append_bool "$cfg" expandhosts "--expand-hosts" config_get tftp_root "$cfg" "tftp_root" [ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp" append_bool "$cfg" tftp_no_fail "--tftp-no-fail" - append_bool "$cfg" nonwildcard "--bind-dynamic" 1 + append_bool "$cfg" nonwildcard "--bind-dynamic" append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" append_bool "$cfg" localservice "--local-service" @@ -828,7 +599,7 @@ dnsmasq_start() append_bool "$cfg" noping "--no-ping" append_parm "$cfg" logfacility "--log-facility" - + append_parm "$cfg" dhcpscript "--dhcp-script" append_parm "$cfg" cachesize "--cache-size" append_parm "$cfg" dnsforwardmax "--dns-forward-max" append_parm "$cfg" port "--port" @@ -839,9 +610,7 @@ dnsmasq_start() append_parm "$cfg" "maxport" "--max-port" append_parm "$cfg" "domain" "--domain" append_parm "$cfg" "local" "--server" - config_list_foreach "$cfg" "listen_address" append_listenaddress config_list_foreach "$cfg" "server" append_server - config_list_foreach "$cfg" "rev_server" append_rev_server config_list_foreach "$cfg" "address" append_address config_list_foreach "$cfg" "ipset" append_ipset config_list_foreach "$cfg" "interface" append_interface @@ -849,6 +618,7 @@ dnsmasq_start() config_list_foreach "$cfg" "addnhosts" append_addnhosts config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases" + append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto" append_parm "$cfg" "serversfile" "--servers-file" append_parm "$cfg" "tftp_root" "--tftp-root" append_parm "$cfg" "dhcp_boot" "--dhcp-boot" @@ -859,21 +629,12 @@ dnsmasq_start() config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1 config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1 - config_get ADD_LOCAL_FQDN "$cfg" add_local_fqdn "" - config_get ADD_WAN_FQDN "$cfg" add_wan_fqdn 0 - - if [ -z "$ADD_LOCAL_FQDN" ] ; then - # maintain support for previous UCI - ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME" - fi config_get_bool readethers "$cfg" readethers [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers - config_get user_dhcpscript $cfg dhcpscript - if has_handler || [ -n "$user_dhcpscript" ]; then - xappend "--dhcp-script=$DHCPSCRIPT" - fi + config_get resolvfile $cfg resolvfile + config_get dhcpscript $cfg dhcpscript config_get leasefile $cfg leasefile "/tmp/dhcp.leases" [ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile" @@ -886,8 +647,6 @@ dnsmasq_start() [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile" fi - [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile" - config_get hostsfile "$cfg" dhcphostsfile [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile" @@ -934,7 +693,6 @@ dnsmasq_start() } dhcp_option_add "$cfg" "" 0 - dhcp_option_add "$cfg" "" 2 xappend "--dhcp-broadcast=tag:needs-broadcast" @@ -968,38 +726,43 @@ dnsmasq_start() config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" + # add own hostname + [ $ADD_LOCAL_HOSTNAME -eq 1 ] && { + local lanaddr lanaddr6 + local ulaprefix="$(uci_get network @globals[0] ula_prefix)" + local hostname="$(uci_get system @system[0] hostname Lede)" + + network_get_ipaddr lanaddr "lan" && { + dhcp_domain_add "" "$hostname" "$lanaddr" + } + + [ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && { + for lanaddr6 in $lanaddr6; do + case "$lanaddr6" in + "${ulaprefix%%:/*}"*) + dhcp_domain_add "" "$hostname" "$lanaddr6" + ;; + esac + done + } + } + echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg" config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg" echo >> $CONFIGFILE_TMP - config_get_bool boguspriv "$cfg" boguspriv 1 - [ "$boguspriv" -gt 0 ] && { - xappend "--bogus-priv" - [ -r "$RFC6761FILE" ] && xappend "--conf-file=$RFC6761FILE" - } - - if [ "$DNSMASQ_DHCP_VER" -gt 4 ] ; then - # Enable RA feature for when/if it is constructed, - # and RA is selected per interface pool (RA, DHCP, or both), - # but no one (should) want RA broadcast in syslog - config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" - xappend "--enable-ra" - xappend "--quiet-ra" - append_bool "$cfg" quietdhcp "--quiet-dhcp6" - - elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then + config_get odhcpd_is_active odhcpd maindhcp + if [ "$odhcpd_is_active" != "1" ]; then config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" fi - echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" echo >> $CONFIGFILE_TMP echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE - mv -f $HOSTFILE_TMP $HOSTFILE [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && { rm -f /tmp/resolv.conf @@ -1015,11 +778,10 @@ dnsmasq_start() procd_open_instance $cfg procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid procd_set_param file $CONFIGFILE - [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn procd_add_jail dnsmasq ubus log - procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT + procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $dhcpscript /etc/hosts /etc/ethers $EXTRA_MOUNT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance @@ -1044,7 +806,7 @@ dnsmasq_stop() service_triggers() { - procd_add_reload_trigger "dhcp" "system" + procd_add_reload_trigger "dhcp" procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload } @@ -1084,7 +846,7 @@ start_service() { reload_service() { rc_procd start_service "$@" - procd_send_signal dnsmasq "$@" + return 0 } stop_service() { diff --git a/package/network/services/dnsmasq/files/dnsmasq_acl.json b/package/network/services/dnsmasq/files/dnsmasq_acl.json deleted file mode 100644 index 00ec7d0f0..000000000 --- a/package/network/services/dnsmasq/files/dnsmasq_acl.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "user": "dnsmasq", - "publish": [ "dnsmasq" ] -} diff --git a/package/network/services/dnsmasq/files/rfc6761.conf b/package/network/services/dnsmasq/files/rfc6761.conf deleted file mode 100644 index ebc1a1211..000000000 --- a/package/network/services/dnsmasq/files/rfc6761.conf +++ /dev/null @@ -1,15 +0,0 @@ -# RFC6761 included configuration file for dnsmasq -# -# includes a list of domains that should not be forwarded to Internet name servers -# to reduce burden on them, asking questions that they won't know the answer to. - -server=/bind/ -server=/example/ -server=/example.com/ -server=/example.org/ -server=/example.net/ -server=/invalid/ -server=/local/ -server=/localhost/ -server=/onion/ -server=/test/ diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch deleted file mode 100644 index d21ca0dba..000000000 --- a/package/network/services/dnsmasq/patches/240-ubus.patch +++ /dev/null @@ -1,128 +0,0 @@ ---- a/src/dnsmasq.c -+++ b/src/dnsmasq.c -@@ -19,6 +19,8 @@ - - #include "dnsmasq.h" - -+#include -+ - struct daemon *daemon; - - static volatile pid_t pid = 0; -@@ -32,6 +34,64 @@ static void fatal_event(struct event_des - static int read_event(int fd, struct event_desc *evp, char **msg); - static void poll_resolv(int force, int do_reload, time_t now); - -+static struct ubus_context *ubus; -+static struct blob_buf b; -+ -+static struct ubus_object_type ubus_object_type = { -+ .name = "dnsmasq", -+}; -+ -+static struct ubus_object ubus_object = { -+ .name = "dnsmasq", -+ .type = &ubus_object_type, -+}; -+ -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface) -+{ -+ if (!ubus || !ubus_object.has_subscribers) -+ return; -+ -+ blob_buf_init(&b, 0); -+ if (mac) -+ blobmsg_add_string(&b, "mac", mac); -+ if (ip) -+ blobmsg_add_string(&b, "ip", ip); -+ if (name) -+ blobmsg_add_string(&b, "name", name); -+ if (interface) -+ blobmsg_add_string(&b, "interface", interface); -+ ubus_notify(ubus, &ubus_object, type, b.head, -1); -+} -+ -+static void set_ubus_listeners(void) -+{ -+ if (!ubus) -+ return; -+ -+ poll_listen(ubus->sock.fd, POLLIN); -+ poll_listen(ubus->sock.fd, POLLERR); -+ poll_listen(ubus->sock.fd, POLLHUP); -+} -+ -+static void check_ubus_listeners() -+{ -+ if (!ubus) { -+ ubus = ubus_connect(NULL); -+ if (ubus) -+ ubus_add_object(ubus, &ubus_object); -+ else -+ return; -+ } -+ -+ if (poll_check(ubus->sock.fd, POLLIN)) -+ ubus_handle_event(ubus); -+ -+ if (poll_check(ubus->sock.fd, POLLHUP)) { -+ ubus_free(ubus); -+ ubus = NULL; -+ } -+} -+ - int main (int argc, char **argv) - { - int bind_fallback = 0; -@@ -911,6 +971,7 @@ int main (int argc, char **argv) - set_dbus_listeners(); - #endif - -+ set_ubus_listeners(); - #ifdef HAVE_DHCP - if (daemon->dhcp || daemon->relay4) - { -@@ -1041,6 +1102,8 @@ int main (int argc, char **argv) - check_dbus_listeners(); - #endif - -+ check_ubus_listeners(); -+ - check_dns_listeners(now); - - #ifdef HAVE_TFTP ---- a/Makefile -+++ b/Makefile -@@ -85,7 +85,7 @@ all : $(BUILDDIR) - @cd $(BUILDDIR) && $(MAKE) \ - top="$(top)" \ - build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ -- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \ -+ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \ - -f $(top)/Makefile dnsmasq - - mostly_clean : ---- a/src/dnsmasq.h -+++ b/src/dnsmasq.h -@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct - # endif - #endif - -+void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); -+ - /* ipset.c */ - #ifdef HAVE_IPSET - void ipset_init(void); ---- a/src/rfc2131.c -+++ b/src/rfc2131.c -@@ -1621,6 +1621,10 @@ static void log_packet(char *type, void - daemon->namebuff, - string ? string : "", - err ? err : ""); -+ if (!strcmp(type, "DHCPACK")) -+ ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); -+ else if (!strcmp(type, "DHCPRELEASE")) -+ ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); - } - - static void log_options(unsigned char *start, u32 xid) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 21ac09f72..2db2f81a4 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=5 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -19,7 +19,6 @@ PKG_HASH:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE -PKG_CPE_ID:=cpe:/a:matt_johnston:dropbear_ssh_server PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index 7f47a7430..b49a95ce9 100644 --- a/package/network/services/dropbear/patches/120-openwrt_options.patch +++ b/package/network/services/dropbear/patches/120-openwrt_options.patch @@ -39,7 +39,7 @@ /* Enable "Counter Mode" for ciphers. This is more secure than normal * CBC mode against certain attacks. It is recommended for security -@@ -131,10 +131,10 @@ If you test it please contact the Dropbe +@@ -131,9 +131,9 @@ If you test it please contact the Dropbe * If you disable MD5, Dropbear will fall back to SHA1 fingerprints, * which are not the standard form. */ #define DROPBEAR_SHA1_HMAC @@ -47,12 +47,10 @@ +/*#define DROPBEAR_SHA1_96_HMAC*/ #define DROPBEAR_SHA2_256_HMAC -#define DROPBEAR_SHA2_512_HMAC --#define DROPBEAR_MD5_HMAC +/*#define DROPBEAR_SHA2_512_HMAC*/ -+/*#define DROPBEAR_MD5_HMAC*/ + #define DROPBEAR_MD5_HMAC /* You can also disable integrity. Don't bother disabling this if you're - * still using a cipher, it's relatively cheap. If you disable this it's dead @@ -146,7 +146,7 @@ If you test it please contact the Dropbe * Removing either of these won't save very much space. * SSH2 RFC Draft requires dss, recommends rsa */ diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 51f169293..c9de3c05b 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,17 +7,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-08-24 -PKG_SOURCE_VERSION:=c2d4f2eb5dba0b5c5a8c5805823084da958a9b52 -PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e74 +PKG_SOURCE_DATE:=2016-12-19 +PKG_SOURCE_VERSION:=ad02e79d12fd70ed6bd5fbaf64001a2851e5bb7b +PKG_MIRROR_HASH:=7a0983f004b156d46911765c113754a4c00f56fb889430620bbd061b3b1fcf33 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause -PKG_CPE_ID:=cpe:/a:w1.fi:hostapd PKG_BUILD_PARALLEL:=1 @@ -300,7 +299,6 @@ define Build/Compile/wpad $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \ sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \ ` > $(PKG_BUILD_DIR)/.cflags - sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags +$(call Build/RunMake,hostapd, \ CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \ MULTICALL=1 \ diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index fe627676d..4a2e87c2e 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -15,31 +15,22 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y +# Driver interface for Prism54 driver +#CONFIG_DRIVER_PRISM54=y + # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y - -# QCA vendor extensions to nl80211 -#CONFIG_DRIVER_NL80211_QCA=y - -# driver_nl80211.c requires libnl. If you are compiling it yourself -# you may need to point hostapd to your version of libnl. -# -#CFLAGS += -I$ -#LIBS += -L$ - -# Use libnl v2.0 (or 3.0) libraries. -#CONFIG_LIBNL20=y - -# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) -#CONFIG_LIBNL32=y - +# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be +# shipped with your distribution yet. If that is the case, you need to build +# newer libnl version and point the hostapd build to use it. +#LIBNL=/usr/src/libnl +#CFLAGS += -I$(LIBNL)/include +#LIBS += -L$(LIBNL)/lib # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib -#LIBS_p += -L/usr/local/lib -#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y @@ -54,14 +45,16 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server CONFIG_EAP=y -# EAP Re-authentication Protocol (ERP) in integrated EAP server -#CONFIG_ERP=y +# EAP-FAST for the integrated EAP server +CONFIG_EAP_FAST=y # EAP-MD5 for the integrated EAP server CONFIG_EAP_MD5=y @@ -97,9 +90,6 @@ CONFIG_EAP_TTLS=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y -# EAP-pwd for the integrated EAP server (secure authentication with a password) -#CONFIG_EAP_PWD=y - # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -109,17 +99,17 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. -CONFIG_EAP_FAST=y +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) +# to add the needed functions. +#CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y +CONFIG_WPS2=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y -# Enable WPS support with NFC config method -#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -127,9 +117,6 @@ CONFIG_WPS=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y -# EAP-EKE for the integrated EAP server -#CONFIG_EAP_EKE=y - # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -145,43 +132,23 @@ CONFIG_IPV6=y CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y -# Wireless Network Management (IEEE Std 802.11v-2011) -# Note: This is experimental and not complete implementation. -#CONFIG_WNM=y - # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y -# IEEE 802.11ax HE support -# Note: This is experimental and work in progress. The definitions are still -# subject to change and this should not be expected to interoperate with the -# final IEEE 802.11ax version. -#CONFIG_IEEE80211AX=y - # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y -# Add support for writing debug log to a file: -f /tmp/hostapd.log -# Disabled by default. -#CONFIG_DEBUG_FILE=y - # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y -# Add support for sending all debug messages (regardless of debug verbosity) -# to the Linux kernel tracing facility. This helps debug the entire stack by -# making it easy to record everything happening from the driver up into the -# same file, e.g., using trace-cmd. -#CONFIG_DEBUG_LINUX_TRACING=y - # Remove support for RADIUS accounting #CONFIG_NO_ACCOUNTING=y @@ -191,190 +158,15 @@ CONFIG_DEBUG_SYSLOG=y # Remove support for VLANs #CONFIG_NO_VLAN=y -# Enable support for fully dynamic VLANs. This enables hostapd to -# automatically create bridge and VLAN interfaces if necessary. -CONFIG_FULL_DYNAMIC_VLAN=y +CONFIG_TLS=internal +CONFIG_INTERNAL_LIBTOMMATH=y +CONFIG_INTERNAL_AES=y +NEED_AES_DEC=y -# Use netlink-based kernel API for VLAN operations instead of ioctl() -# Note: This requires libnl 3.1 or newer. -#CONFIG_VLAN_NETLINK=y - -# Remove support for dumping internal state through control interface commands -# This can be used to reduce binary size at the cost of disabling a debugging -# option. +CONFIG_NO_RANDOM_POOL=y CONFIG_NO_DUMP_STATE=y -# Enable tracing code for developer debugging -# This tracks use of memory allocations and other registrations and reports -# incorrect use with a backtrace of call (or allocation) location. -#CONFIG_WPA_TRACE=y -# For BSD, comment out these. -#LIBS += -lexecinfo -#LIBS_p += -lexecinfo -#LIBS_c += -lexecinfo +CONFIG_WPS=y +CONFIG_FULL_DYNAMIC_VLAN=y -# Use libbfd to get more details for developer debugging -# This enables use of libbfd to get more detailed symbols for the backtraces -# generated by CONFIG_WPA_TRACE=y. -#CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. -#LIBS += -lbfd -liberty -lz -#LIBS_p += -lbfd -liberty -lz -#LIBS_c += -lbfd -liberty -lz - -# hostapd depends on strong random number generation being available from the -# operating system. os_get_random() function is used to fetch random data when -# needed, e.g., for key generation. On Linux and BSD systems, this works by -# reading /dev/urandom. It should be noted that the OS entropy pool needs to be -# properly initialized before hostapd is started. This is important especially -# on embedded devices that do not have a hardware random number generator and -# may by default start up with minimal entropy available for random number -# generation. -# -# As a safety net, hostapd is by default trying to internally collect -# additional entropy for generating random data to mix in with the data -# fetched from the OS. This by itself is not considered to be very strong, but -# it may help in cases where the system pool is not initialized properly. -# However, it is very strongly recommended that the system pool is initialized -# with enough entropy either by using hardware assisted random number -# generator or by storing state over device reboots. -# -# hostapd can be configured to maintain its own entropy store over restarts to -# enhance random number generation. This is not perfect, but it is much more -# secure than using the same sequence of random numbers after every reboot. -# This can be enabled with -e command line option. The specified -# file needs to be readable and writable by hostapd. -# -# If the os_get_random() is known to provide strong random data (e.g., on -# Linux/BSD, the board in question is known to have reliable source of random -# data from /dev/urandom), the internal hostapd random pool can be disabled. -# This will save some in binary size and CPU use. However, this should only be -# considered for builds that are known to be used on devices that meet the -# requirements described above. -CONFIG_NO_RANDOM_POOL=y - -# Should we use poll instead of select? Select is used by default. -#CONFIG_ELOOP_POLL=y - -# Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y - -# Should we use kqueue instead of select? Select is used by default. -#CONFIG_ELOOP_KQUEUE=y - -# Select TLS implementation -# openssl = OpenSSL (default) -# gnutls = GnuTLS -# internal = Internal TLSv1 implementation (experimental) -# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) -# none = Empty template -CONFIG_TLS=internal - -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) -# can be enabled to get a stronger construction of messages when block ciphers -# are used. -#CONFIG_TLSV11=y - -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) -# can be enabled to enable use of stronger crypto algorithms. -#CONFIG_TLSV12=y - -# Select which ciphers to use by default with OpenSSL if the user does not -# specify them. -#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" - -# If CONFIG_TLS=internal is used, additional library and include paths are -# needed for LibTomMath. Alternatively, an integrated, minimal version of -# LibTomMath can be used. See beginning of libtommath.c for details on benefits -# and drawbacks of this option. -CONFIG_INTERNAL_LIBTOMMATH=y -#ifndef CONFIG_INTERNAL_LIBTOMMATH -#LTM_PATH=/usr/src/libtommath-0.39 -#CFLAGS += -I$(LTM_PATH) -#LIBS += -L$(LTM_PATH) -#LIBS_p += -L$(LTM_PATH) -#endif -# At the cost of about 4 kB of additional binary size, the internal LibTomMath -# can be configured to include faster routines for exptmod, sqr, and div to -# speed up DH and RSA calculation considerably -#CONFIG_INTERNAL_LIBTOMMATH_FAST=y - -# Interworking (IEEE 802.11u) -# This can be used to enable functionality to improve interworking with -# external networks. -#CONFIG_INTERWORKING=y - -# Hotspot 2.0 -#CONFIG_HS20=y - -# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file -#CONFIG_SQLITE=y - -# Enable Fast Session Transfer (FST) -#CONFIG_FST=y - -# Enable CLI commands for FST testing -#CONFIG_FST_TEST=y - -# Testing options -# This can be used to enable some testing options (see also the example -# configuration file) that are really useful only for testing clients that -# connect to this hostapd. These options allow, for example, to drop a -# certain percentage of probe requests or auth/(re)assoc frames. -# -#CONFIG_TESTING_OPTIONS=y - -# Automatic Channel Selection -# This will allow hostapd to pick the channel automatically when channel is set -# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in -# similar way. -# -# Automatic selection is currently only done through initialization, later on -# we hope to do background checks to keep us moving to more ideal channels as -# time goes by. ACS is currently only supported through the nl80211 driver and -# your driver must have survey dump capability that is filled by the driver -# during scanning. -# -# You can customize the ACS survey algorithm with the hostapd.conf variable -# acs_num_scans. -# -# Supported ACS drivers: -# * ath9k -# * ath5k -# * ath10k -# -# For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs -# -#CONFIG_ACS=y - -# Multiband Operation support -# These extentions facilitate efficient use of multiple frequency bands -# available to the AP and the devices that may associate with it. -#CONFIG_MBO=y - -# Client Taxonomy -# Has the AP retain the Probe Request and (Re)Association Request frames from -# a client, from which a signature can be produced which can identify the model -# of client device like "Nexus 6P" or "iPhone 5s". -#CONFIG_TAXONOMY=y - -# Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. -#CONFIG_FILS=y -# FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y - -# Include internal line edit mode in hostapd_cli. This can be used to provide -# limited command line editing and history support. -#CONFIG_WPA_CLI_EDIT=y - -# Opportunistic Wireless Encryption (OWE) -# Experimental implementation of draft-harkins-owe-07.txt -#CONFIG_OWE=y - -# uBus IPC/RPC System -# Services can connect to the bus and provide methods -# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config index 661983a94..2bd7d239c 100644 --- a/package/network/services/hostapd/files/hostapd-mini.config +++ b/package/network/services/hostapd/files/hostapd-mini.config @@ -15,37 +15,28 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y +# Driver interface for Prism54 driver +#CONFIG_DRIVER_PRISM54=y + # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y - -# QCA vendor extensions to nl80211 -#CONFIG_DRIVER_NL80211_QCA=y - -# driver_nl80211.c requires libnl. If you are compiling it yourself -# you may need to point hostapd to your version of libnl. -# -#CFLAGS += -I$ -#LIBS += -L$ - -# Use libnl v2.0 (or 3.0) libraries. -#CONFIG_LIBNL20=y - -# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) -#CONFIG_LIBNL32=y - +# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be +# shipped with your distribution yet. If that is the case, you need to build +# newer libnl version and point the hostapd build to use it. +#LIBNL=/usr/src/libnl +#CFLAGS += -I$(LIBNL)/include +#LIBS += -L$(LIBNL)/lib # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib -#LIBS_p += -L/usr/local/lib -#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y # IEEE 802.11F/IAPP -#CONFIG_IAPP=y +# CONFIG_IAPP=y # WPA2/IEEE 802.11i RSN pre-authentication CONFIG_RSN_PREAUTH=y @@ -54,15 +45,14 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server #CONFIG_EAP=y -# EAP Re-authentication Protocol (ERP) in integrated EAP server -#CONFIG_ERP=y - # EAP-MD5 for the integrated EAP server #CONFIG_EAP_MD5=y @@ -97,9 +87,6 @@ CONFIG_PEERKEY=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y -# EAP-pwd for the integrated EAP server (secure authentication with a password) -#CONFIG_EAP_PWD=y - # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -109,17 +96,16 @@ CONFIG_PEERKEY=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) +# to add the needed functions. #CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y -# Enable WPS support with NFC config method -#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -127,9 +113,6 @@ CONFIG_PEERKEY=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y -# EAP-EKE for the integrated EAP server -#CONFIG_EAP_EKE=y - # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) #CONFIG_PKCS12=y @@ -145,43 +128,23 @@ CONFIG_PEERKEY=y #CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y -# Wireless Network Management (IEEE Std 802.11v-2011) -# Note: This is experimental and not complete implementation. -#CONFIG_WNM=y - # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y -# IEEE 802.11ax HE support -# Note: This is experimental and work in progress. The definitions are still -# subject to change and this should not be expected to interoperate with the -# final IEEE 802.11ax version. -#CONFIG_IEEE80211AX=y - # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y -# Add support for writing debug log to a file: -f /tmp/hostapd.log -# Disabled by default. -#CONFIG_DEBUG_FILE=y - # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y -# Add support for sending all debug messages (regardless of debug verbosity) -# to the Linux kernel tracing facility. This helps debug the entire stack by -# making it easy to record everything happening from the driver up into the -# same file, e.g., using trace-cmd. -#CONFIG_DEBUG_LINUX_TRACING=y - # Remove support for RADIUS accounting CONFIG_NO_ACCOUNTING=y @@ -191,190 +154,9 @@ CONFIG_NO_RADIUS=y # Remove support for VLANs #CONFIG_NO_VLAN=y -# Enable support for fully dynamic VLANs. This enables hostapd to -# automatically create bridge and VLAN interfaces if necessary. -#CONFIG_FULL_DYNAMIC_VLAN=y - -# Use netlink-based kernel API for VLAN operations instead of ioctl() -# Note: This requires libnl 3.1 or newer. -#CONFIG_VLAN_NETLINK=y - -# Remove support for dumping internal state through control interface commands -# This can be used to reduce binary size at the cost of disabling a debugging -# option. -CONFIG_NO_DUMP_STATE=y - -# Enable tracing code for developer debugging -# This tracks use of memory allocations and other registrations and reports -# incorrect use with a backtrace of call (or allocation) location. -#CONFIG_WPA_TRACE=y -# For BSD, comment out these. -#LIBS += -lexecinfo -#LIBS_p += -lexecinfo -#LIBS_c += -lexecinfo - -# Use libbfd to get more details for developer debugging -# This enables use of libbfd to get more detailed symbols for the backtraces -# generated by CONFIG_WPA_TRACE=y. -#CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. -#LIBS += -lbfd -liberty -lz -#LIBS_p += -lbfd -liberty -lz -#LIBS_c += -lbfd -liberty -lz - -# hostapd depends on strong random number generation being available from the -# operating system. os_get_random() function is used to fetch random data when -# needed, e.g., for key generation. On Linux and BSD systems, this works by -# reading /dev/urandom. It should be noted that the OS entropy pool needs to be -# properly initialized before hostapd is started. This is important especially -# on embedded devices that do not have a hardware random number generator and -# may by default start up with minimal entropy available for random number -# generation. -# -# As a safety net, hostapd is by default trying to internally collect -# additional entropy for generating random data to mix in with the data -# fetched from the OS. This by itself is not considered to be very strong, but -# it may help in cases where the system pool is not initialized properly. -# However, it is very strongly recommended that the system pool is initialized -# with enough entropy either by using hardware assisted random number -# generator or by storing state over device reboots. -# -# hostapd can be configured to maintain its own entropy store over restarts to -# enhance random number generation. This is not perfect, but it is much more -# secure than using the same sequence of random numbers after every reboot. -# This can be enabled with -e command line option. The specified -# file needs to be readable and writable by hostapd. -# -# If the os_get_random() is known to provide strong random data (e.g., on -# Linux/BSD, the board in question is known to have reliable source of random -# data from /dev/urandom), the internal hostapd random pool can be disabled. -# This will save some in binary size and CPU use. However, this should only be -# considered for builds that are known to be used on devices that meet the -# requirements described above. -CONFIG_NO_RANDOM_POOL=y - -# Should we use poll instead of select? Select is used by default. -#CONFIG_ELOOP_POLL=y - -# Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y - -# Should we use kqueue instead of select? Select is used by default. -#CONFIG_ELOOP_KQUEUE=y - -# Select TLS implementation -# openssl = OpenSSL (default) -# gnutls = GnuTLS -# internal = Internal TLSv1 implementation (experimental) -# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) -# none = Empty template CONFIG_TLS=internal -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) -# can be enabled to get a stronger construction of messages when block ciphers -# are used. -#CONFIG_TLSV11=y +CONFIG_NO_RANDOM_POOL=y +CONFIG_NO_DUMP_STATE=y -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) -# can be enabled to enable use of stronger crypto algorithms. -#CONFIG_TLSV12=y - -# Select which ciphers to use by default with OpenSSL if the user does not -# specify them. -#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" - -# If CONFIG_TLS=internal is used, additional library and include paths are -# needed for LibTomMath. Alternatively, an integrated, minimal version of -# LibTomMath can be used. See beginning of libtommath.c for details on benefits -# and drawbacks of this option. -#CONFIG_INTERNAL_LIBTOMMATH=y -#ifndef CONFIG_INTERNAL_LIBTOMMATH -#LTM_PATH=/usr/src/libtommath-0.39 -#CFLAGS += -I$(LTM_PATH) -#LIBS += -L$(LTM_PATH) -#LIBS_p += -L$(LTM_PATH) -#endif -# At the cost of about 4 kB of additional binary size, the internal LibTomMath -# can be configured to include faster routines for exptmod, sqr, and div to -# speed up DH and RSA calculation considerably -#CONFIG_INTERNAL_LIBTOMMATH_FAST=y - -# Interworking (IEEE 802.11u) -# This can be used to enable functionality to improve interworking with -# external networks. -#CONFIG_INTERWORKING=y - -# Hotspot 2.0 -#CONFIG_HS20=y - -# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file -#CONFIG_SQLITE=y - -# Enable Fast Session Transfer (FST) -#CONFIG_FST=y - -# Enable CLI commands for FST testing -#CONFIG_FST_TEST=y - -# Testing options -# This can be used to enable some testing options (see also the example -# configuration file) that are really useful only for testing clients that -# connect to this hostapd. These options allow, for example, to drop a -# certain percentage of probe requests or auth/(re)assoc frames. -# -#CONFIG_TESTING_OPTIONS=y - -# Automatic Channel Selection -# This will allow hostapd to pick the channel automatically when channel is set -# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in -# similar way. -# -# Automatic selection is currently only done through initialization, later on -# we hope to do background checks to keep us moving to more ideal channels as -# time goes by. ACS is currently only supported through the nl80211 driver and -# your driver must have survey dump capability that is filled by the driver -# during scanning. -# -# You can customize the ACS survey algorithm with the hostapd.conf variable -# acs_num_scans. -# -# Supported ACS drivers: -# * ath9k -# * ath5k -# * ath10k -# -# For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs -# -#CONFIG_ACS=y - -# Multiband Operation support -# These extentions facilitate efficient use of multiple frequency bands -# available to the AP and the devices that may associate with it. -#CONFIG_MBO=y - -# Client Taxonomy -# Has the AP retain the Probe Request and (Re)Association Request frames from -# a client, from which a signature can be produced which can identify the model -# of client device like "Nexus 6P" or "iPhone 5s". -#CONFIG_TAXONOMY=y - -# Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. -#CONFIG_FILS=y -# FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y - -# Include internal line edit mode in hostapd_cli. This can be used to provide -# limited command line editing and history support. -#CONFIG_WPA_CLI_EDIT=y - -# Opportunistic Wireless Encryption (OWE) -# Experimental implementation of draft-harkins-owe-07.txt -#CONFIG_OWE=y - -# uBus IPC/RPC System -# Services can connect to the bus and provide methods -# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 36aee85f1..1f2866111 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -66,9 +66,6 @@ hostapd_common_add_device_config() { config_add_string require_mode config_add_boolean legacy_rates - config_add_string acs_chan_bias - config_add_array hostapd_options - hostapd_add_log_config } @@ -79,7 +76,7 @@ hostapd_prepare_device_config() { local base="${config%%.conf}" local base_cfg= - json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias + json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates hostapd_set_log_options base_cfg @@ -96,8 +93,6 @@ hostapd_prepare_device_config() { [ "$hwmode" = "a" -a "$doth" -gt 0 ] && append base_cfg "ieee80211h=1" "$N" } - [ -n "$acs_chan_bias" ] && append base_cfg "acs_chan_bias=$acs_chan_bias" "$N" - local brlist= br json_get_values basic_rate_list basic_rate local rlist= r @@ -128,11 +123,6 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" - json_get_values opts hostapd_options - for val in $opts; do - append base_cfg "$val" "$N" - done - cat > "$config" < allow management frame protection case "$ieee80211w" in [012]) - json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout + json_get_vars ieee80211w_max_timeout ieee80211w_retry_timeout append bss_conf "ieee80211w=$ieee80211w" "$N" [ "$ieee80211w" -gt "0" ] && { - append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N" [ -n "$ieee80211w_max_timeout" ] && \ append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" [ -n "$ieee80211w_retry_timeout" ] && \ @@ -601,31 +586,8 @@ EOF return 0 } -wpa_supplicant_set_fixed_freq() { - local freq="$1" - local htmode="$2" - - append network_data "fixed_freq=1" "$N$T" - append network_data "frequency=$freq" "$N$T" - case "$htmode" in - NOHT) append network_data "disable_ht=1" "$N$T";; - HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; - HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; - esac - case "$htmode" in - VHT*) append network_data "vht=1" "$N$T";; - esac - case "$htmode" in - VHT80) append network_data "max_oper_chwidth=1" "$N$T";; - VHT160) append network_data "max_oper_chwidth=2" "$N$T";; - *) append network_data "max_oper_chwidth=0" "$N$T";; - esac -} - wpa_supplicant_add_network() { local ifname="$1" - local freq="$2" - local htmode="$3" _wpa_supplicant_common "$1" wireless_vif_parse_encryption @@ -647,7 +609,11 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" + [ -n "$channel" ] && { + freq="$(get_freq "$phy" "$channel")" + append network_data "fixed_freq=1" "$N$T" + append network_data "frequency=$freq" "$N$T" + } scan_ssid="scan_ssid=0" @@ -659,7 +625,10 @@ wpa_supplicant_add_network() { ssid="${mesh_id}" append network_data "mode=5" "$N$T" - [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" + [ -n "$channel" ] && { + freq="$(get_freq "$phy" "$channel")" + append network_data "frequency=$freq" "$N$T" + } append wpa_key_mgmt "SAE" scan_ssid="" } @@ -752,6 +721,7 @@ wpa_supplicant_add_network() { ;; esac } + local beacon_int brates mrate [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index 81fa8f539..18c3f9a5c 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# wpa_supplicant binary. All lines starting with # are ignored. Configuration -# option lines must be commented out complete, if they are not to be included, -# i.e., just setting VARIABLE=n is not disabling that variable. +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,33 +20,63 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos +# Example configuration for various cross-compilation platforms + +#### sveasoft (e.g., for Linksys WRT54G) ###################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS += -I../src/include -I../../src/router/openssl/include +#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl +############################################################################### + +#### openwrt (e.g., for Linksys WRT54G) ####################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ +# -I../WRT54GS/release/src/include +#LIBS = -lssl +############################################################################### + + +# Driver interface for Host AP driver +#CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=y +# Change include directories to match with the local setup +#CFLAGS += -I../../hcf -I../../include -I../../include/hcf +#CFLAGS += -I../../include/wireless + +# Driver interface for ndiswrapper +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +# CONFIG_DRIVER_ATMEL=y + +# Driver interface for old Broadcom driver +# Please note that the newer Broadcom driver ("hybrid Linux driver") supports +# Linux wireless extensions and does not need (or even work) with the old +# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. +#CONFIG_DRIVER_BROADCOM=y +# Example path for wlioctl.h; change to match your configuration +#CFLAGS += -I/opt/WRT54GS/release/src/include + +# Driver interface for Intel ipw2100/2200 driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_IPW=y + +# Driver interface for Ralink driver +#CONFIG_DRIVER_RALINK=y + # Driver interface for generic Linux wireless extensions -# Note: WEXT is deprecated in the current Linux kernel version and no new -# functionality is added to it. nl80211-based interface is the new -# replacement for WEXT and its use allows wpa_supplicant to properly control -# the driver to improve existing functionality like roaming and to support new -# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# QCA vendor extensions to nl80211 -#CONFIG_DRIVER_NL80211_QCA=y - -# driver_nl80211.c requires libnl. If you are compiling it yourself -# you may need to point hostapd to your version of libnl. -# -#CFLAGS += -I$ -#LIBS += -L$ - -# Use libnl v2.0 (or 3.0) libraries. -#CONFIG_LIBNL20=y - -# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) -#CONFIG_LIBNL32=y - - # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -70,6 +100,14 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Include client MLME (management frame processing) for test driver +# This can be used to test MLME operations in hostapd with the test interface. +# space. +#CONFIG_CLIENT_MLME=y + # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -79,14 +117,13 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y -# Solaris libraries -#LIBS += -lsocket -ldlpi -lnsl -#LIBS_c += -lsocket - # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y +# EAP-FAST +CONFIG_EAP_FAST=y + # EAP-MD5 CONFIG_EAP_MD5=y @@ -103,10 +140,11 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. -CONFIG_EAP_FAST=y +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) +# to add the needed functions. +#CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -120,9 +158,6 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y -# EAP-pwd (secure authentication using only a password) -#CONFIG_EAP_PWD=y - # EAP-PAX #CONFIG_EAP_PAX=y @@ -152,20 +187,10 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y -# Enable WPS external registrar functionality -#CONFIG_WPS_ER=y -# Disable credentials for an open network by default when acting as a WPS -# registrar. -#CONFIG_WPS_REG_DISABLE_OPEN=y -# Enable WPS support with NFC config method -#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y -# EAP-EKE -#CONFIG_EAP_EKE=y - # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -178,22 +203,13 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y -# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -CONFIG_HT_OVERRIDES=y - -# Support VHT overrides (disable VHT, mask MCS rates, etc.) -CONFIG_VHT_OVERRIDES=y - # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) -# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) -# udp-remote = UDP sockets with remote access (only for tests systems/purpose) -# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -205,10 +221,6 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y -# Include internal line edit mode in wpa_cli. This can be used as a replacement -# for GNU Readline to provide limited command line editing and history support. -#CONFIG_WPA_CLI_EDIT=y - # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -219,6 +231,11 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y +# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to +# save about 1 kB in code size when building only WPA-Personal (no EAP support) +# or 6 kB if building for WPA-Enterprise. +#CONFIG_NO_WPA2=y + # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -253,7 +270,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operating system and C library specific functions +# Select wrapper for operatins system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -262,17 +279,9 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template #CONFIG_ELOOP=eloop -# Should we use poll instead of select? Select is used by default. -#CONFIG_ELOOP_POLL=y - -# Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y - -# Should we use kqueue instead of select? Select is used by default. -#CONFIG_ELOOP_KQUEUE=y - # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -282,44 +291,29 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux -# Disable Linux packet socket workaround applicable for station interface -# in a bridge for EAPOL frames. This should be uncommented only if the kernel -# is known to not have the regression issue in packet socket behavior with -# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). -#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y - # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection), also known as PMF +# IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. -#CONFIG_IEEE80211W=y +CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) # internal = Internal TLSv1 implementation (experimental) -# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) -# can be enabled to get a stronger construction of messages when block ciphers -# are used. It should be noted that some existing TLS v1.0 -based -# implementation may not be compatible with TLS v1.1 message (ClientHello is -# sent prior to negotiating which version will be used) -#CONFIG_TLSV11=y - -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) -# can be enabled to enable use of stronger crypto algorithms. It should be -# noted that some existing TLS v1.0 -based implementation may not be compatible -# with TLS v1.2 message (ClientHello is sent prior to negotiating which version -# will be used) -#CONFIG_TLSV12=y - -# Select which ciphers to use by default with OpenSSL if the user does not -# specify them. -#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +#CONFIG_GNUTLS_EXTRA=y # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -375,31 +369,12 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode +# IEEE Std 802.11r-2008 (Fast BSS Transition) CONFIG_IEEE80211R=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies -# CONFIG_IEEE80211R). -#CONFIG_IEEE80211R_AP=y - # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y -# Send debug messages to syslog instead of stdout -#CONFIG_DEBUG_SYSLOG=y -# Set syslog facility for debug messages -#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON - -# Add support for sending all debug messages (regardless of debug verbosity) -# to the Linux kernel tracing facility. This helps debug the entire stack by -# making it easy to record everything happening from the driver up into the -# same file, e.g., using trace-cmd. -#CONFIG_DEBUG_LINUX_TRACING=y - -# Add support for writing debug log to Android logcat instead of standard -# output -#CONFIG_ANDROID_LOG=y - # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -411,7 +386,7 @@ CONFIG_IEEE80211R=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -420,174 +395,12 @@ CONFIG_IEEE80211R=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz -# wpa_supplicant depends on strong random number generation being available -# from the operating system. os_get_random() function is used to fetch random -# data when needed, e.g., for key generation. On Linux and BSD systems, this -# works by reading /dev/urandom. It should be noted that the OS entropy pool -# needs to be properly initialized before wpa_supplicant is started. This is -# important especially on embedded devices that do not have a hardware random -# number generator and may by default start up with minimal entropy available -# for random number generation. -# -# As a safety net, wpa_supplicant is by default trying to internally collect -# additional entropy for generating random data to mix in with the data fetched -# from the OS. This by itself is not considered to be very strong, but it may -# help in cases where the system pool is not initialized properly. However, it -# is very strongly recommended that the system pool is initialized with enough -# entropy either by using hardware assisted random number generator or by -# storing state over device reboots. -# -# wpa_supplicant can be configured to maintain its own entropy store over -# restarts to enhance random number generation. This is not perfect, but it is -# much more secure than using the same sequence of random numbers after every -# reboot. This can be enabled with -e command line option. The -# specified file needs to be readable and writable by wpa_supplicant. -# -# If the os_get_random() is known to provide strong random data (e.g., on -# Linux/BSD, the board in question is known to have reliable source of random -# data from /dev/urandom), the internal wpa_supplicant random pool can be -# disabled. This will save some in binary size and CPU use. However, this -# should only be considered for builds that are known to be used on devices -# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y +NEED_80211_COMMON=y -# IEEE 802.11n (High Throughput) support (mainly for AP mode) -#CONFIG_IEEE80211N=y - -# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) -# (depends on CONFIG_IEEE80211N) -#CONFIG_IEEE80211AC=y - -# Wireless Network Management (IEEE Std 802.11v-2011) -# Note: This is experimental and not complete implementation. -#CONFIG_WNM=y - -# Interworking (IEEE 802.11u) -# This can be used to enable functionality to improve interworking with -# external networks (GAS/ANQP to learn more about the networks and network -# selection based on available credentials). -#CONFIG_INTERWORKING=y - -# Hotspot 2.0 -#CONFIG_HS20=y - -# Enable interface matching in wpa_supplicant -#CONFIG_MATCH_IFACE=y - -# Disable roaming in wpa_supplicant -#CONFIG_NO_ROAMING=y - -# AP mode operations with wpa_supplicant -# This can be used for controlling AP mode operations with wpa_supplicant. It -# should be noted that this is mainly aimed at simple cases like -# WPA2-Personal while more complex configurations like WPA2-Enterprise with an -# external RADIUS server can be supported with hostapd. -#CONFIG_AP=y - -# P2P (Wi-Fi Direct) -# This can be used to enable P2P support in wpa_supplicant. See README-P2P for -# more information on P2P operations. -#CONFIG_P2P=y - -# Enable TDLS support -#CONFIG_TDLS=y - -# Wi-Fi Direct -# This can be used to enable Wi-Fi Direct extensions for P2P using an external -# program to control the additional information exchanges in the messages. -#CONFIG_WIFI_DISPLAY=y - -# Autoscan -# This can be used to enable automatic scan support in wpa_supplicant. -# See wpa_supplicant.conf for more information on autoscan usage. -# -# Enabling directly a module will enable autoscan support. -# For exponential module: -#CONFIG_AUTOSCAN_EXPONENTIAL=y -# For periodic module: -#CONFIG_AUTOSCAN_PERIODIC=y - -# Password (and passphrase, etc.) backend for external storage -# These optional mechanisms can be used to add support for storing passwords -# and other secrets in external (to wpa_supplicant) location. This allows, for -# example, operating system specific key storage to be used -# -# External password backend for testing purposes (developer use) -#CONFIG_EXT_PASSWORD_TEST=y - -# Enable Fast Session Transfer (FST) -#CONFIG_FST=y - -# Enable CLI commands for FST testing -#CONFIG_FST_TEST=y - -# OS X builds. This is only for building eapol_test. -#CONFIG_OSX=y - -# Automatic Channel Selection -# This will allow wpa_supplicant to pick the channel automatically when channel -# is set to "0". -# -# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative -# to "channel=0". This would enable us to eventually add other ACS algorithms in -# similar way. -# -# Automatic selection is currently only done through initialization, later on -# we hope to do background checks to keep us moving to more ideal channels as -# time goes by. ACS is currently only supported through the nl80211 driver and -# your driver must have survey dump capability that is filled by the driver -# during scanning. -# -# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with -# a newly to create wpa_supplicant.conf variable acs_num_scans. -# -# Supported ACS drivers: -# * ath9k -# * ath5k -# * ath10k -# -# For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs -#CONFIG_ACS=y - -# Support Multi Band Operation -#CONFIG_MBO=y - -# Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. -#CONFIG_FILS=y -# FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y - -# Support RSN on IBSS networks -# This is needed to be able to use mode=1 network profile with proto=RSN and -# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y - -# External PMKSA cache control -# This can be used to enable control interface commands that allow the current -# PMKSA cache entries to be fetched and new entries to be added. -#CONFIG_PMKSA_CACHE_EXTERNAL=y - -# Mesh Networking (IEEE 802.11s) -#CONFIG_MESH=y - -# Background scanning modules -# These can be used to request wpa_supplicant to perform background scanning -# operations for roaming within an ESS (same SSID). See the bgscan parameter in -# the wpa_supplicant.conf file for more details. -# Periodic background scans based on signal strength -#CONFIG_BGSCAN_SIMPLE=y -# Learn channels used by the network and try to avoid bgscans on other -# channels (experimental) -#CONFIG_BGSCAN_LEARN=y - -# Opportunistic Wireless Encryption (OWE) -# Experimental implementation of draft-harkins-owe-07.txt -#CONFIG_OWE=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-mini.config b/package/network/services/hostapd/files/wpa_supplicant-mini.config index 3e088715c..c272153b3 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-mini.config +++ b/package/network/services/hostapd/files/wpa_supplicant-mini.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# wpa_supplicant binary. All lines starting with # are ignored. Configuration -# option lines must be commented out complete, if they are not to be included, -# i.e., just setting VARIABLE=n is not disabling that variable. +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,33 +20,63 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos +# Example configuration for various cross-compilation platforms + +#### sveasoft (e.g., for Linksys WRT54G) ###################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS += -I../src/include -I../../src/router/openssl/include +#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl +############################################################################### + +#### openwrt (e.g., for Linksys WRT54G) ####################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ +# -I../WRT54GS/release/src/include +#LIBS = -lssl +############################################################################### + + +# Driver interface for Host AP driver +#CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=y +# Change include directories to match with the local setup +#CFLAGS += -I../../hcf -I../../include -I../../include/hcf +#CFLAGS += -I../../include/wireless + +# Driver interface for ndiswrapper +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +# CONFIG_DRIVER_ATMEL=y + +# Driver interface for old Broadcom driver +# Please note that the newer Broadcom driver ("hybrid Linux driver") supports +# Linux wireless extensions and does not need (or even work) with the old +# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. +#CONFIG_DRIVER_BROADCOM=y +# Example path for wlioctl.h; change to match your configuration +#CFLAGS += -I/opt/WRT54GS/release/src/include + +# Driver interface for Intel ipw2100/2200 driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_IPW=y + +# Driver interface for Ralink driver +#CONFIG_DRIVER_RALINK=y + # Driver interface for generic Linux wireless extensions -# Note: WEXT is deprecated in the current Linux kernel version and no new -# functionality is added to it. nl80211-based interface is the new -# replacement for WEXT and its use allows wpa_supplicant to properly control -# the driver to improve existing functionality like roaming and to support new -# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# QCA vendor extensions to nl80211 -#CONFIG_DRIVER_NL80211_QCA=y - -# driver_nl80211.c requires libnl. If you are compiling it yourself -# you may need to point hostapd to your version of libnl. -# -#CFLAGS += -I$ -#LIBS += -L$ - -# Use libnl v2.0 (or 3.0) libraries. -#CONFIG_LIBNL20=y - -# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) -#CONFIG_LIBNL32=y - - # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -70,6 +100,14 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Include client MLME (management frame processing) for test driver +# This can be used to test MLME operations in hostapd with the test interface. +# space. +#CONFIG_CLIENT_MLME=y + # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -79,40 +117,37 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y -# Solaris libraries -#LIBS += -lsocket -ldlpi -lnsl -#LIBS_c += -lsocket - # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) -#CONFIG_IEEE8021X_EAPOL=y +# CONFIG_IEEE8021X_EAPOL=y # EAP-MD5 -#CONFIG_EAP_MD5=y +# CONFIG_EAP_MD5=y # EAP-MSCHAPv2 -#CONFIG_EAP_MSCHAPV2=y +# CONFIG_EAP_MSCHAPV2=y # EAP-TLS -#CONFIG_EAP_TLS=y +# CONFIG_EAP_TLS=y # EAL-PEAP -#CONFIG_EAP_PEAP=y +# CONFIG_EAP_PEAP=y # EAP-TTLS -#CONFIG_EAP_TTLS=y +# CONFIG_EAP_TTLS=y # EAP-FAST -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) +# to add the needed functions. #CONFIG_EAP_FAST=y # EAP-GTC -#CONFIG_EAP_GTC=y +# CONFIG_EAP_GTC=y # EAP-OTP -#CONFIG_EAP_OTP=y +# CONFIG_EAP_OTP=y # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) #CONFIG_EAP_SIM=y @@ -120,14 +155,11 @@ CONFIG_DRIVER_WIRED=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y -# EAP-pwd (secure authentication using only a password) -#CONFIG_EAP_PWD=y - # EAP-PAX #CONFIG_EAP_PAX=y # LEAP -#CONFIG_EAP_LEAP=y +# CONFIG_EAP_LEAP=y # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) #CONFIG_EAP_AKA=y @@ -152,48 +184,29 @@ CONFIG_DRIVER_WIRED=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y -# Enable WPS external registrar functionality -#CONFIG_WPS_ER=y -# Disable credentials for an open network by default when acting as a WPS -# registrar. -#CONFIG_WPS_REG_DISABLE_OPEN=y -# Enable WPS support with NFC config method -#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y -# EAP-EKE -#CONFIG_EAP_EKE=y - # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) -#CONFIG_PKCS12=y +# CONFIG_PKCS12=y # Smartcard support (i.e., private key on a smartcard), e.g., with openssl # engine. -#CONFIG_SMARTCARD=y +# CONFIG_SMARTCARD=y # PC/SC interface for smartcards (USIM, GSM SIM) # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y -# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -CONFIG_HT_OVERRIDES=y - -# Support VHT overrides (disable VHT, mask MCS rates, etc.) -CONFIG_VHT_OVERRIDES=y - # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) -# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) -# udp-remote = UDP sockets with remote access (only for tests systems/purpose) -# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -205,10 +218,6 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y -# Include internal line edit mode in wpa_cli. This can be used as a replacement -# for GNU Readline to provide limited command line editing and history support. -#CONFIG_WPA_CLI_EDIT=y - # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -219,6 +228,11 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y +# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to +# save about 1 kB in code size when building only WPA-Personal (no EAP support) +# or 6 kB if building for WPA-Enterprise. +#CONFIG_NO_WPA2=y + # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -253,7 +267,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operating system and C library specific functions +# Select wrapper for operatins system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -262,17 +276,9 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template #CONFIG_ELOOP=eloop -# Should we use poll instead of select? Select is used by default. -#CONFIG_ELOOP_POLL=y - -# Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y - -# Should we use kqueue instead of select? Select is used by default. -#CONFIG_ELOOP_KQUEUE=y - # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -282,44 +288,29 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux -# Disable Linux packet socket workaround applicable for station interface -# in a bridge for EAPOL frames. This should be uncommented only if the kernel -# is known to not have the regression issue in packet socket behavior with -# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). -#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y - # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) -#CONFIG_PEERKEY=y +# CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection), also known as PMF +# IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) # internal = Internal TLSv1 implementation (experimental) -# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) -# can be enabled to get a stronger construction of messages when block ciphers -# are used. It should be noted that some existing TLS v1.0 -based -# implementation may not be compatible with TLS v1.1 message (ClientHello is -# sent prior to negotiating which version will be used) -#CONFIG_TLSV11=y - -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) -# can be enabled to enable use of stronger crypto algorithms. It should be -# noted that some existing TLS v1.0 -based implementation may not be compatible -# with TLS v1.2 message (ClientHello is sent prior to negotiating which version -# will be used) -#CONFIG_TLSV12=y - -# Select which ciphers to use by default with OpenSSL if the user does not -# specify them. -#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +#CONFIG_GNUTLS_EXTRA=y # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -375,31 +366,12 @@ CONFIG_TLS=internal # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode +# IEEE Std 802.11r-2008 (Fast BSS Transition) #CONFIG_IEEE80211R=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies -# CONFIG_IEEE80211R). -#CONFIG_IEEE80211R_AP=y - # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y -# Send debug messages to syslog instead of stdout -#CONFIG_DEBUG_SYSLOG=y -# Set syslog facility for debug messages -#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON - -# Add support for sending all debug messages (regardless of debug verbosity) -# to the Linux kernel tracing facility. This helps debug the entire stack by -# making it easy to record everything happening from the driver up into the -# same file, e.g., using trace-cmd. -#CONFIG_DEBUG_LINUX_TRACING=y - -# Add support for writing debug log to Android logcat instead of standard -# output -#CONFIG_ANDROID_LOG=y - # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -411,7 +383,7 @@ CONFIG_TLS=internal # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -420,174 +392,10 @@ CONFIG_TLS=internal # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz -# wpa_supplicant depends on strong random number generation being available -# from the operating system. os_get_random() function is used to fetch random -# data when needed, e.g., for key generation. On Linux and BSD systems, this -# works by reading /dev/urandom. It should be noted that the OS entropy pool -# needs to be properly initialized before wpa_supplicant is started. This is -# important especially on embedded devices that do not have a hardware random -# number generator and may by default start up with minimal entropy available -# for random number generation. -# -# As a safety net, wpa_supplicant is by default trying to internally collect -# additional entropy for generating random data to mix in with the data fetched -# from the OS. This by itself is not considered to be very strong, but it may -# help in cases where the system pool is not initialized properly. However, it -# is very strongly recommended that the system pool is initialized with enough -# entropy either by using hardware assisted random number generator or by -# storing state over device reboots. -# -# wpa_supplicant can be configured to maintain its own entropy store over -# restarts to enhance random number generation. This is not perfect, but it is -# much more secure than using the same sequence of random numbers after every -# reboot. This can be enabled with -e command line option. The -# specified file needs to be readable and writable by wpa_supplicant. -# -# If the os_get_random() is known to provide strong random data (e.g., on -# Linux/BSD, the board in question is known to have reliable source of random -# data from /dev/urandom), the internal wpa_supplicant random pool can be -# disabled. This will save some in binary size and CPU use. However, this -# should only be considered for builds that are known to be used on devices -# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y - -# IEEE 802.11n (High Throughput) support (mainly for AP mode) -#CONFIG_IEEE80211N=y - -# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) -# (depends on CONFIG_IEEE80211N) -#CONFIG_IEEE80211AC=y - -# Wireless Network Management (IEEE Std 802.11v-2011) -# Note: This is experimental and not complete implementation. -#CONFIG_WNM=y - -# Interworking (IEEE 802.11u) -# This can be used to enable functionality to improve interworking with -# external networks (GAS/ANQP to learn more about the networks and network -# selection based on available credentials). -#CONFIG_INTERWORKING=y - -# Hotspot 2.0 -#CONFIG_HS20=y - -# Enable interface matching in wpa_supplicant -#CONFIG_MATCH_IFACE=y - -# Disable roaming in wpa_supplicant -#CONFIG_NO_ROAMING=y - -# AP mode operations with wpa_supplicant -# This can be used for controlling AP mode operations with wpa_supplicant. It -# should be noted that this is mainly aimed at simple cases like -# WPA2-Personal while more complex configurations like WPA2-Enterprise with an -# external RADIUS server can be supported with hostapd. -#CONFIG_AP=y - -# P2P (Wi-Fi Direct) -# This can be used to enable P2P support in wpa_supplicant. See README-P2P for -# more information on P2P operations. -#CONFIG_P2P=y - -# Enable TDLS support -#CONFIG_TDLS=y - -# Wi-Fi Direct -# This can be used to enable Wi-Fi Direct extensions for P2P using an external -# program to control the additional information exchanges in the messages. -#CONFIG_WIFI_DISPLAY=y - -# Autoscan -# This can be used to enable automatic scan support in wpa_supplicant. -# See wpa_supplicant.conf for more information on autoscan usage. -# -# Enabling directly a module will enable autoscan support. -# For exponential module: -#CONFIG_AUTOSCAN_EXPONENTIAL=y -# For periodic module: -#CONFIG_AUTOSCAN_PERIODIC=y - -# Password (and passphrase, etc.) backend for external storage -# These optional mechanisms can be used to add support for storing passwords -# and other secrets in external (to wpa_supplicant) location. This allows, for -# example, operating system specific key storage to be used -# -# External password backend for testing purposes (developer use) -#CONFIG_EXT_PASSWORD_TEST=y - -# Enable Fast Session Transfer (FST) -#CONFIG_FST=y - -# Enable CLI commands for FST testing -#CONFIG_FST_TEST=y - -# OS X builds. This is only for building eapol_test. -#CONFIG_OSX=y - -# Automatic Channel Selection -# This will allow wpa_supplicant to pick the channel automatically when channel -# is set to "0". -# -# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative -# to "channel=0". This would enable us to eventually add other ACS algorithms in -# similar way. -# -# Automatic selection is currently only done through initialization, later on -# we hope to do background checks to keep us moving to more ideal channels as -# time goes by. ACS is currently only supported through the nl80211 driver and -# your driver must have survey dump capability that is filled by the driver -# during scanning. -# -# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with -# a newly to create wpa_supplicant.conf variable acs_num_scans. -# -# Supported ACS drivers: -# * ath9k -# * ath5k -# * ath10k -# -# For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs -#CONFIG_ACS=y - -# Support Multi Band Operation -#CONFIG_MBO=y - -# Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. -#CONFIG_FILS=y -# FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y - -# Support RSN on IBSS networks -# This is needed to be able to use mode=1 network profile with proto=RSN and -# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). -#CONFIG_IBSS_RSN=y - -# External PMKSA cache control -# This can be used to enable control interface commands that allow the current -# PMKSA cache entries to be fetched and new entries to be added. -#CONFIG_PMKSA_CACHE_EXTERNAL=y - -# Mesh Networking (IEEE 802.11s) -#CONFIG_MESH=y - -# Background scanning modules -# These can be used to request wpa_supplicant to perform background scanning -# operations for roaming within an ESS (same SSID). See the bgscan parameter in -# the wpa_supplicant.conf file for more details. -# Periodic background scans based on signal strength -#CONFIG_BGSCAN_SIMPLE=y -# Learn channels used by the network and try to avoid bgscans on other -# channels (experimental) -#CONFIG_BGSCAN_LEARN=y - -# Opportunistic Wireless Encryption (OWE) -# Experimental implementation of draft-harkins-owe-07.txt -#CONFIG_OWE=y +NEED_80211_COMMON=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config index 420aebcf9..563dace35 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config +++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# wpa_supplicant binary. All lines starting with # are ignored. Configuration -# option lines must be commented out complete, if they are not to be included, -# i.e., just setting VARIABLE=n is not disabling that variable. +# hostapd binary. All lines starting with # are ignored. Configuration option +# lines must be commented out complete, if they are not to be included, i.e., +# just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,33 +20,63 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos +# Example configuration for various cross-compilation platforms + +#### sveasoft (e.g., for Linksys WRT54G) ###################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS += -I../src/include -I../../src/router/openssl/include +#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl +############################################################################### + +#### openwrt (e.g., for Linksys WRT54G) ####################################### +#CC=mipsel-uclibc-gcc +#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc +#CFLAGS += -Os +#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ +# -I../WRT54GS/release/src/include +#LIBS = -lssl +############################################################################### + + +# Driver interface for Host AP driver +#CONFIG_DRIVER_HOSTAP=y + +# Driver interface for Agere driver +#CONFIG_DRIVER_HERMES=y +# Change include directories to match with the local setup +#CFLAGS += -I../../hcf -I../../include -I../../include/hcf +#CFLAGS += -I../../include/wireless + +# Driver interface for ndiswrapper +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_NDISWRAPPER=y + +# Driver interface for Atmel driver +# CONFIG_DRIVER_ATMEL=y + +# Driver interface for old Broadcom driver +# Please note that the newer Broadcom driver ("hybrid Linux driver") supports +# Linux wireless extensions and does not need (or even work) with the old +# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. +#CONFIG_DRIVER_BROADCOM=y +# Example path for wlioctl.h; change to match your configuration +#CFLAGS += -I/opt/WRT54GS/release/src/include + +# Driver interface for Intel ipw2100/2200 driver +# Deprecated; use CONFIG_DRIVER_WEXT=y instead. +#CONFIG_DRIVER_IPW=y + +# Driver interface for Ralink driver +#CONFIG_DRIVER_RALINK=y + # Driver interface for generic Linux wireless extensions -# Note: WEXT is deprecated in the current Linux kernel version and no new -# functionality is added to it. nl80211-based interface is the new -# replacement for WEXT and its use allows wpa_supplicant to properly control -# the driver to improve existing functionality like roaming and to support new -# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# QCA vendor extensions to nl80211 -#CONFIG_DRIVER_NL80211_QCA=y - -# driver_nl80211.c requires libnl. If you are compiling it yourself -# you may need to point hostapd to your version of libnl. -# -#CFLAGS += -I$ -#LIBS += -L$ - -# Use libnl v2.0 (or 3.0) libraries. -#CONFIG_LIBNL20=y - -# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) -#CONFIG_LIBNL32=y - - # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -70,6 +100,14 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y +# Driver interface for development testing +#CONFIG_DRIVER_TEST=y + +# Include client MLME (management frame processing) for test driver +# This can be used to test MLME operations in hostapd with the test interface. +# space. +#CONFIG_CLIENT_MLME=y + # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -79,10 +117,6 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y -# Solaris libraries -#LIBS += -lsocket -ldlpi -lnsl -#LIBS_c += -lsocket - # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y @@ -103,10 +137,11 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed -# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., -# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. -CONFIG_EAP_FAST=y +# Note: Default OpenSSL package does not include support for all the +# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, +# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) +# to add the needed functions. +#CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -120,9 +155,6 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y -# EAP-pwd (secure authentication using only a password) -#CONFIG_EAP_PWD=y - # EAP-PAX #CONFIG_EAP_PAX=y @@ -152,20 +184,10 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y -# Enable WPS external registrar functionality -#CONFIG_WPS_ER=y -# Disable credentials for an open network by default when acting as a WPS -# registrar. -#CONFIG_WPS_REG_DISABLE_OPEN=y -# Enable WPS support with NFC config method -#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y -# EAP-EKE -#CONFIG_EAP_EKE=y - # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -178,22 +200,13 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y -# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) -CONFIG_HT_OVERRIDES=y - -# Support VHT overrides (disable VHT, mask MCS rates, etc.) -CONFIG_VHT_OVERRIDES=y - # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) -# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) -# udp-remote = UDP sockets with remote access (only for tests systems/purpose) -# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -205,10 +218,6 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y -# Include internal line edit mode in wpa_cli. This can be used as a replacement -# for GNU Readline to provide limited command line editing and history support. -#CONFIG_WPA_CLI_EDIT=y - # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -219,6 +228,11 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y +# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to +# save about 1 kB in code size when building only WPA-Personal (no EAP support) +# or 6 kB if building for WPA-Enterprise. +#CONFIG_NO_WPA2=y + # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -253,7 +267,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operating system and C library specific functions +# Select wrapper for operatins system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -262,17 +276,9 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop +# eloop_none = Empty template #CONFIG_ELOOP=eloop -# Should we use poll instead of select? Select is used by default. -#CONFIG_ELOOP_POLL=y - -# Should we use epoll instead of select? Select is used by default. -#CONFIG_ELOOP_EPOLL=y - -# Should we use kqueue instead of select? Select is used by default. -#CONFIG_ELOOP_KQUEUE=y - # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -282,44 +288,29 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux -# Disable Linux packet socket workaround applicable for station interface -# in a bridge for EAPOL frames. This should be uncommented only if the kernel -# is known to not have the regression issue in packet socket behavior with -# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). -#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y - # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection), also known as PMF +# IEEE 802.11w (management frame protection) +# This version is an experimental implementation based on IEEE 802.11w/D1.0 +# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS +# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) # internal = Internal TLSv1 implementation (experimental) -# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) -# can be enabled to get a stronger construction of messages when block ciphers -# are used. It should be noted that some existing TLS v1.0 -based -# implementation may not be compatible with TLS v1.1 message (ClientHello is -# sent prior to negotiating which version will be used) -#CONFIG_TLSV11=y - -# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) -# can be enabled to enable use of stronger crypto algorithms. It should be -# noted that some existing TLS v1.0 -based implementation may not be compatible -# with TLS v1.2 message (ClientHello is sent prior to negotiating which version -# will be used) -#CONFIG_TLSV12=y - -# Select which ciphers to use by default with OpenSSL if the user does not -# specify them. -#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" +# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. +# You need CONFIG_TLS=gnutls for this to have any effect. Please note that +# even though the core GnuTLS library is released under LGPL, this extra +# library uses GPL and as such, the terms of GPL apply to the combination +# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not +# apply for distribution of the resulting binary. +#CONFIG_GNUTLS_EXTRA=y # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -375,31 +366,12 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode +# IEEE Std 802.11r-2008 (Fast BSS Transition) #CONFIG_IEEE80211R=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies -# CONFIG_IEEE80211R). -#CONFIG_IEEE80211R_AP=y - # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y -# Send debug messages to syslog instead of stdout -#CONFIG_DEBUG_SYSLOG=y -# Set syslog facility for debug messages -#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON - -# Add support for sending all debug messages (regardless of debug verbosity) -# to the Linux kernel tracing facility. This helps debug the entire stack by -# making it easy to record everything happening from the driver up into the -# same file, e.g., using trace-cmd. -#CONFIG_DEBUG_LINUX_TRACING=y - -# Add support for writing debug log to Android logcat instead of standard -# output -#CONFIG_ANDROID_LOG=y - # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -411,7 +383,7 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -420,174 +392,15 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, uncomment these. +# For BSD, comment out these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz -# wpa_supplicant depends on strong random number generation being available -# from the operating system. os_get_random() function is used to fetch random -# data when needed, e.g., for key generation. On Linux and BSD systems, this -# works by reading /dev/urandom. It should be noted that the OS entropy pool -# needs to be properly initialized before wpa_supplicant is started. This is -# important especially on embedded devices that do not have a hardware random -# number generator and may by default start up with minimal entropy available -# for random number generation. -# -# As a safety net, wpa_supplicant is by default trying to internally collect -# additional entropy for generating random data to mix in with the data fetched -# from the OS. This by itself is not considered to be very strong, but it may -# help in cases where the system pool is not initialized properly. However, it -# is very strongly recommended that the system pool is initialized with enough -# entropy either by using hardware assisted random number generator or by -# storing state over device reboots. -# -# wpa_supplicant can be configured to maintain its own entropy store over -# restarts to enhance random number generation. This is not perfect, but it is -# much more secure than using the same sequence of random numbers after every -# reboot. This can be enabled with -e command line option. The -# specified file needs to be readable and writable by wpa_supplicant. -# -# If the os_get_random() is known to provide strong random data (e.g., on -# Linux/BSD, the board in question is known to have reliable source of random -# data from /dev/urandom), the internal wpa_supplicant random pool can be -# disabled. This will save some in binary size and CPU use. However, this -# should only be considered for builds that are known to be used on devices -# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y +NEED_80211_COMMON=y -# IEEE 802.11n (High Throughput) support (mainly for AP mode) -#CONFIG_IEEE80211N=y - -# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) -# (depends on CONFIG_IEEE80211N) -#CONFIG_IEEE80211AC=y - -# Wireless Network Management (IEEE Std 802.11v-2011) -# Note: This is experimental and not complete implementation. -#CONFIG_WNM=y - -# Interworking (IEEE 802.11u) -# This can be used to enable functionality to improve interworking with -# external networks (GAS/ANQP to learn more about the networks and network -# selection based on available credentials). -#CONFIG_INTERWORKING=y - -# Hotspot 2.0 -#CONFIG_HS20=y - -# Enable interface matching in wpa_supplicant -#CONFIG_MATCH_IFACE=y - -# Disable roaming in wpa_supplicant -#CONFIG_NO_ROAMING=y - -# AP mode operations with wpa_supplicant -# This can be used for controlling AP mode operations with wpa_supplicant. It -# should be noted that this is mainly aimed at simple cases like -# WPA2-Personal while more complex configurations like WPA2-Enterprise with an -# external RADIUS server can be supported with hostapd. -CONFIG_AP=y - -# P2P (Wi-Fi Direct) -# This can be used to enable P2P support in wpa_supplicant. See README-P2P for -# more information on P2P operations. -CONFIG_P2P=y - -# Enable TDLS support -#CONFIG_TDLS=y - -# Wi-Fi Direct -# This can be used to enable Wi-Fi Direct extensions for P2P using an external -# program to control the additional information exchanges in the messages. -#CONFIG_WIFI_DISPLAY=y - -# Autoscan -# This can be used to enable automatic scan support in wpa_supplicant. -# See wpa_supplicant.conf for more information on autoscan usage. -# -# Enabling directly a module will enable autoscan support. -# For exponential module: -#CONFIG_AUTOSCAN_EXPONENTIAL=y -# For periodic module: -#CONFIG_AUTOSCAN_PERIODIC=y - -# Password (and passphrase, etc.) backend for external storage -# These optional mechanisms can be used to add support for storing passwords -# and other secrets in external (to wpa_supplicant) location. This allows, for -# example, operating system specific key storage to be used -# -# External password backend for testing purposes (developer use) -#CONFIG_EXT_PASSWORD_TEST=y - -# Enable Fast Session Transfer (FST) -#CONFIG_FST=y - -# Enable CLI commands for FST testing -#CONFIG_FST_TEST=y - -# OS X builds. This is only for building eapol_test. -#CONFIG_OSX=y - -# Automatic Channel Selection -# This will allow wpa_supplicant to pick the channel automatically when channel -# is set to "0". -# -# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative -# to "channel=0". This would enable us to eventually add other ACS algorithms in -# similar way. -# -# Automatic selection is currently only done through initialization, later on -# we hope to do background checks to keep us moving to more ideal channels as -# time goes by. ACS is currently only supported through the nl80211 driver and -# your driver must have survey dump capability that is filled by the driver -# during scanning. -# -# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with -# a newly to create wpa_supplicant.conf variable acs_num_scans. -# -# Supported ACS drivers: -# * ath9k -# * ath5k -# * ath10k -# -# For more details refer to: -# http://wireless.kernel.org/en/users/Documentation/acs -#CONFIG_ACS=y - -# Support Multi Band Operation -#CONFIG_MBO=y - -# Fast Initial Link Setup (FILS) (IEEE 802.11ai) -# Note: This is an experimental and not yet complete implementation. This -# should not be enabled for production use. -#CONFIG_FILS=y -# FILS shared key authentication with PFS -#CONFIG_FILS_SK_PFS=y - -# Support RSN on IBSS networks -# This is needed to be able to use mode=1 network profile with proto=RSN and -# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y -# External PMKSA cache control -# This can be used to enable control interface commands that allow the current -# PMKSA cache entries to be fetched and new entries to be added. -#CONFIG_PMKSA_CACHE_EXTERNAL=y - -# Mesh Networking (IEEE 802.11s) -#CONFIG_MESH=y - -# Background scanning modules -# These can be used to request wpa_supplicant to perform background scanning -# operations for roaming within an ESS (same SSID). See the bgscan parameter in -# the wpa_supplicant.conf file for more details. -# Periodic background scans based on signal strength -#CONFIG_BGSCAN_SIMPLE=y -# Learn channels used by the network and try to avoid bgscans on other -# channels (experimental) -#CONFIG_BGSCAN_LEARN=y - -# Opportunistic Wireless Encryption (OWE) -# Experimental implementation of draft-harkins-owe-07.txt -#CONFIG_OWE=y +CONFIG_P2P=y +CONFIG_AP=y diff --git a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch new file mode 100644 index 000000000..bf54e9df3 --- /dev/null +++ b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch @@ -0,0 +1,83 @@ +From: Jouni Malinen +Date: Tue, 20 Dec 2016 01:30:09 +0200 +Subject: [PATCH] Fix race condition between AssocResp callback and 4addr event + +It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME +event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS +event for (Re)Association Response frame. This resulted in the 4-address +WDS mode not getting enabled for a STA. This could occur in particular +when operating under heavy load and the STA is reconnecting to the same +AP in a sequence where Deauthentication frame is followed immediately by +Authentication frame and the driver event processing gets delayed due to +removal of the previous netdev taking time in the middle of this +sequence. + +Fix this by recording a pending item for 4-address WDS enabling if the +NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to +incompleted association and then process this pending item if the TX +status for the (Re)Association Response frame is received and it shows +that the frame was acknowledged. + +Signed-off-by: Jouni Malinen +--- + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -2634,6 +2634,8 @@ static void handle_assoc(struct hostapd_ + taxonomy_sta_info_assoc_req(hapd, sta, pos, left); + #endif /* CONFIG_TAXONOMY */ + ++ sta->pending_wds_enable = 0; ++ + fail: + /* + * In case of a successful response, add the station to the driver. +@@ -3248,6 +3250,14 @@ static void handle_assoc_cb(struct hosta + + hostapd_set_sta_flags(hapd, sta); + ++ if (!(sta->flags & WLAN_STA_WDS) && sta->pending_wds_enable) { ++ wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for STA " ++ MACSTR " based on pending request", ++ MAC2STR(sta->addr)); ++ sta->pending_wds_enable = 0; ++ sta->flags |= WLAN_STA_WDS; ++ } ++ + if (sta->flags & WLAN_STA_WDS) { + int ret; + char ifname_wds[IFNAMSIZ + 1]; +@@ -3512,10 +3522,22 @@ void ieee802_11_rx_from_unknown(struct h + struct sta_info *sta; + + sta = ap_get_sta(hapd, src); +- if (sta && (sta->flags & WLAN_STA_ASSOC)) { ++ if (sta && ++ ((sta->flags & WLAN_STA_ASSOC) || ++ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) { + if (!hapd->conf->wds_sta) + return; + ++ if ((sta->flags & (WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK)) == ++ WLAN_STA_ASSOC_REQ_OK) { ++ wpa_printf(MSG_DEBUG, ++ "Postpone 4-address WDS mode enabling for STA " ++ MACSTR " since TX status for AssocResp is not yet known", ++ MAC2STR(sta->addr)); ++ sta->pending_wds_enable = 1; ++ return; ++ } ++ + if (wds && !(sta->flags & WLAN_STA_WDS)) { + int ret; + char ifname_wds[IFNAMSIZ + 1]; +--- a/src/ap/sta_info.h ++++ b/src/ap/sta_info.h +@@ -115,6 +115,7 @@ struct sta_info { + unsigned int radius_das_match:1; + unsigned int ecsa_supported:1; + unsigned int added_unassoc:1; ++ unsigned int pending_wds_enable:1; + + u16 auth_alg; + diff --git a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch new file mode 100644 index 000000000..6db1e9b34 --- /dev/null +++ b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch @@ -0,0 +1,36 @@ +From: Jouni Malinen +Date: Sat, 14 Jan 2017 01:04:31 +0200 +Subject: [PATCH] Fix duplicate Reassociation Request frame dropping + +Relational operators (==) have higher precedence than the ternary +conditional in C. The last_subtype check for association/reassociation +was broken due to incorrect assumption about the precedence. Fix this by +adding parenthesis around the ternary conditional. + +The previous implementation worked for Association Request frames by +accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when +the last receive frame was an Association Request frame, the +sta->last_subtype == reassoc check was true and non-zero +WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was +broken for Reassociation Request frame. reassoc == 1 in that case could +have matched received Association Response frame (subtype == 1), but +those are not received in AP mode and as such, this did not break other +behavior apart from not being able to drop duplicated Reassociation +Request frames. + +Signed-off-by: Jouni Malinen +--- + +--- a/src/ap/ieee802_11.c ++++ b/src/ap/ieee802_11.c +@@ -2485,8 +2485,8 @@ static void handle_assoc(struct hostapd_ + if ((fc & WLAN_FC_RETRY) && + sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ && + sta->last_seq_ctrl == seq_ctrl && +- sta->last_subtype == reassoc ? WLAN_FC_STYPE_REASSOC_REQ : +- WLAN_FC_STYPE_ASSOC_REQ) { ++ sta->last_subtype == (reassoc ? WLAN_FC_STYPE_REASSOC_REQ : ++ WLAN_FC_STYPE_ASSOC_REQ)) { + hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, + HOSTAPD_LEVEL_DEBUG, + "Drop repeated association frame seq_ctrl=0x%x", diff --git a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch new file mode 100644 index 000000000..0a3c27f89 --- /dev/null +++ b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch @@ -0,0 +1,40 @@ +From: Jouni Malinen +Date: Sat, 14 Jan 2017 13:56:18 +0200 +Subject: [PATCH] RSN IBSS: Fix TK clearing on Authentication frame RX + +When wpa_supplicant was processing a received Authentication frame (seq +1) from a peer STA for which there was already a TK configured to the +driver, debug log claimed that the PTK gets cleared, but the actual +call to clear the key was actually dropped due to AUTH vs. SUPP set_key +selection. Fix this by explicitly clearing the TK in case it was set +and an Authentication frame (seq 1) is received. + +This fixes some cases where EAPOL-Key frames were sent encrypted using +the old key when a peer STA restarted itself and lost the key and had to +re-join the IBSS. Previously, that state required timing out the 4-way +handshake and Deauthentication frame exchange to recover. + +Signed-off-by: Jouni Malinen +--- + +--- a/wpa_supplicant/ibss_rsn.c ++++ b/wpa_supplicant/ibss_rsn.c +@@ -838,6 +838,18 @@ static void ibss_rsn_handle_auth_1_of_2( + MAC2STR(addr)); + + if (peer && ++ peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP | ++ IBSS_RSN_SET_PTK_AUTH)) { ++ /* Clear the TK for this pair to allow recovery from the case ++ * where the peer STA has restarted and lost its key while we ++ * still have a pairwise key configured. */ ++ wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer " ++ MACSTR, MAC2STR(addr)); ++ wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0, ++ NULL, 0, NULL, 0); ++ } ++ ++ if (peer && + peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) { + if (peer->own_auth_tx.sec) { + struct os_reltime now, diff; diff --git a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch new file mode 100644 index 000000000..3417b5ac3 --- /dev/null +++ b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch @@ -0,0 +1,145 @@ +From cc3dae85bd694506cdea66ae532d452fb8716297 Mon Sep 17 00:00:00 2001 +From: Wojciech Dubowik +Date: Mon, 23 Jan 2017 13:55:04 +0100 +Subject: [PATCH] hostapd: Add possibility to send debug messages to syslog + +We can only send module specific messages to syslog and not debug +messages printed with wpa_printf. Add an extra command line parameter +'-s' to allow it. The feature is enabled with compile flag +CONFIG_DEBUG_SYSLOG as for wpa_supplicant and behaves in the same manner +as the wpa_supplicant -s command line argument. + +Signed-off-by: Wojciech Dubowik +--- + hostapd/Android.mk | 4 ++++ + hostapd/Makefile | 4 ++++ + hostapd/defconfig | 3 +++ + hostapd/main.c | 19 ++++++++++++++++++- + src/utils/wpa_debug.c | 2 +- + src/utils/wpa_debug.h | 3 +++ + 6 files changed, 33 insertions(+), 2 deletions(-) + +--- a/hostapd/Android.mk ++++ b/hostapd/Android.mk +@@ -952,6 +952,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG + L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG + endif + ++ifdef CONFIG_DEBUG_SYSLOG ++L_CFLAGS += -DCONFIG_DEBUG_SYSLOG ++endif ++ + ifdef CONFIG_DEBUG_LINUX_TRACING + L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING + endif +--- a/hostapd/Makefile ++++ b/hostapd/Makefile +@@ -997,6 +997,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG + CFLAGS += -DCONFIG_NO_STDOUT_DEBUG + endif + ++ifdef CONFIG_DEBUG_SYSLOG ++CFLAGS += -DCONFIG_DEBUG_SYSLOG ++endif ++ + ifdef CONFIG_DEBUG_LINUX_TRACING + CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING + endif +--- a/hostapd/defconfig ++++ b/hostapd/defconfig +@@ -166,6 +166,9 @@ CONFIG_IPV6=y + # Disabled by default. + #CONFIG_DEBUG_FILE=y + ++# Send debug messages to syslog instead of stdout ++#CONFIG_DEBUG_SYSLOG=y ++ + # Add support for sending all debug messages (regardless of debug verbosity) + # to the Linux kernel tracing facility. This helps debug the entire stack by + # making it easy to record everything happening from the driver up into the +--- a/hostapd/main.c ++++ b/hostapd/main.c +@@ -108,6 +108,10 @@ static void hostapd_logger_cb(void *ctx, + module_str ? module_str : "", + module_str ? ": " : "", txt); + ++#ifdef CONFIG_DEBUG_SYSLOG ++ if (wpa_debug_syslog) ++ conf_stdout = 0; ++#endif /* CONFIG_DEBUG_SYSLOG */ + if ((conf_stdout & module) && level >= conf_stdout_level) { + wpa_debug_print_timestamp(); + wpa_printf(MSG_INFO, "%s", format); +@@ -484,6 +488,9 @@ static void usage(void) + " (records all messages regardless of debug verbosity)\n" + #endif /* CONFIG_DEBUG_LINUX_TRACING */ + " -i list of interface names to use\n" ++#ifdef CONFIG_DEBUG_SYSLOG ++ " -s log output to syslog instead of stdout\n" ++#endif /* CONFIG_DEBUG_SYSLOG */ + " -S start all the interfaces synchronously\n" + " -t include timestamps in some debug messages\n" + " -v show hostapd version\n"); +@@ -661,7 +668,7 @@ int main(int argc, char *argv[]) + dl_list_init(&interfaces.global_ctrl_dst); + + for (;;) { +- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); ++ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); + if (c < 0) + break; + switch (c) { +@@ -718,6 +725,11 @@ int main(int argc, char *argv[]) + bss_config = tmp_bss; + bss_config[num_bss_configs++] = optarg; + break; ++#ifdef CONFIG_DEBUG_SYSLOG ++ case 's': ++ wpa_debug_syslog = 1; ++ break; ++#endif /* CONFIG_DEBUG_SYSLOG */ + case 'S': + start_ifaces_in_sync = 1; + break; +@@ -746,6 +758,10 @@ int main(int argc, char *argv[]) + wpa_debug_open_file(log_file); + else + wpa_debug_setup_stdout(); ++#ifdef CONFIG_DEBUG_SYSLOG ++ if (wpa_debug_syslog) ++ wpa_debug_open_syslog(); ++#endif /* CONFIG_DEBUG_SYSLOG */ + #ifdef CONFIG_DEBUG_LINUX_TRACING + if (enable_trace_dbg) { + int tret = wpa_debug_open_linux_tracing(); +@@ -882,6 +898,7 @@ int main(int argc, char *argv[]) + hostapd_global_deinit(pid_file, interfaces.eloop_initialized); + os_free(pid_file); + ++ wpa_debug_close_syslog(); + if (log_file) + wpa_debug_close_file(); + wpa_debug_close_linux_tracing(); +--- a/src/utils/wpa_debug.c ++++ b/src/utils/wpa_debug.c +@@ -13,7 +13,7 @@ + #ifdef CONFIG_DEBUG_SYSLOG + #include + +-static int wpa_debug_syslog = 0; ++int wpa_debug_syslog = 0; + #endif /* CONFIG_DEBUG_SYSLOG */ + + #ifdef CONFIG_DEBUG_LINUX_TRACING +--- a/src/utils/wpa_debug.h ++++ b/src/utils/wpa_debug.h +@@ -14,6 +14,9 @@ + extern int wpa_debug_level; + extern int wpa_debug_show_keys; + extern int wpa_debug_timestamp; ++#ifdef CONFIG_DEBUG_SYSLOG ++extern int wpa_debug_syslog; ++#endif /* CONFIG_DEBUG_SYSLOG */ + + /* Debugging function - conditional printf and hex dump. Driver wrappers can + * use these for debugging purposes. */ diff --git a/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch similarity index 84% rename from package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch rename to package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch index 14b2d7c71..2136bb9d4 100644 --- a/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch +++ b/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch @@ -21,7 +21,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2522,6 +2522,7 @@ static int add_associated_sta(struct hos +@@ -2154,6 +2154,7 @@ static int add_associated_sta(struct hos { struct ieee80211_ht_capabilities ht_cap; struct ieee80211_vht_capabilities vht_cap; @@ -29,7 +29,7 @@ Signed-off-by: Mathy Vanhoef /* * Remove the STA entry to ensure the STA PS state gets cleared and -@@ -2529,9 +2530,18 @@ static int add_associated_sta(struct hos +@@ -2161,9 +2162,18 @@ static int add_associated_sta(struct hos * FT-over-the-DS, where a station re-associates back to the same AP but * skips the authentication flow, or if working with a driver that * does not support full AP client state. @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211N if (sta->flags & WLAN_STA_HT) -@@ -2554,11 +2564,11 @@ static int add_associated_sta(struct hos +@@ -2186,11 +2196,11 @@ static int add_associated_sta(struct hos sta->flags & WLAN_STA_VHT ? &vht_cap : NULL, sta->flags | WLAN_STA_ASSOC, sta->qosinfo, sta->vht_opmode, sta->p2p_ie ? 1 : 0, @@ -65,17 +65,17 @@ Signed-off-by: Mathy Vanhoef hostapd_drv_sta_remove(hapd, sta->addr); --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1783,6 +1783,9 @@ int wpa_auth_sm_event(struct wpa_state_m - #else /* CONFIG_FILS */ +@@ -1751,6 +1751,9 @@ int wpa_auth_sm_event(struct wpa_state_m + #else /* CONFIG_IEEE80211R_AP */ break; - #endif /* CONFIG_FILS */ + #endif /* CONFIG_IEEE80211R_AP */ + case WPA_DRV_STA_REMOVED: + sm->tk_already_set = FALSE; + return 0; } #ifdef CONFIG_IEEE80211R_AP -@@ -3922,6 +3925,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ +@@ -3725,6 +3728,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ } @@ -90,28 +90,9 @@ Signed-off-by: Mathy Vanhoef int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry) { ---- a/src/ap/wpa_auth.h -+++ b/src/ap/wpa_auth.h -@@ -300,7 +300,7 @@ void wpa_receive(struct wpa_authenticato - u8 *data, size_t data_len); - enum wpa_event { - WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, -- WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS -+ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED - }; - void wpa_remove_ptk(struct wpa_state_machine *sm); - int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); -@@ -313,6 +313,7 @@ int wpa_auth_pairwise_set(struct wpa_sta - int wpa_auth_get_pairwise(struct wpa_state_machine *sm); - int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); - int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); -+int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); - int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, - struct rsn_pmksa_cache_entry *entry); - struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c -@@ -1937,6 +1937,14 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -794,6 +794,14 @@ void wpa_ft_install_ptk(struct wpa_state return; } @@ -126,7 +107,7 @@ Signed-off-by: Mathy Vanhoef /* FIX: add STA entry to kernel/driver here? The set_key will fail * most likely without this.. At the moment, STA entry is added only * after association has been completed. This function will be called -@@ -1949,6 +1957,7 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -806,6 +814,7 @@ void wpa_ft_install_ptk(struct wpa_state /* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */ sm->pairwise_set = TRUE; @@ -134,7 +115,7 @@ Signed-off-by: Mathy Vanhoef } -@@ -2152,6 +2161,7 @@ static int wpa_ft_process_auth_req(struc +@@ -1002,6 +1011,7 @@ static int wpa_ft_process_auth_req(struc sm->pairwise = pairwise; sm->PTK_valid = TRUE; @@ -142,9 +123,28 @@ Signed-off-by: Mathy Vanhoef wpa_ft_install_ptk(sm); buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + +--- a/src/ap/wpa_auth.h ++++ b/src/ap/wpa_auth.h +@@ -268,7 +268,7 @@ void wpa_receive(struct wpa_authenticato + u8 *data, size_t data_len); + enum wpa_event { + WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, +- WPA_REAUTH_EAPOL, WPA_ASSOC_FT ++ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED + }; + void wpa_remove_ptk(struct wpa_state_machine *sm); + int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); +@@ -281,6 +281,7 @@ int wpa_auth_pairwise_set(struct wpa_sta + int wpa_auth_get_pairwise(struct wpa_state_machine *sm); + int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); + int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); ++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); + int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, + struct rsn_pmksa_cache_entry *entry); + struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_i.h +++ b/src/ap/wpa_auth_i.h -@@ -61,6 +61,7 @@ struct wpa_state_machine { +@@ -65,6 +65,7 @@ struct wpa_state_machine { struct wpa_ptk PTK; Boolean PTK_valid; Boolean pairwise_set; diff --git a/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch similarity index 91% rename from package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch rename to package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch index b283bf887..71c681e29 100644 --- a/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch +++ b/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch @@ -13,7 +13,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -218,6 +218,17 @@ struct wpa_ptk { +@@ -207,6 +207,17 @@ struct wpa_ptk { size_t tk_len; }; @@ -33,7 +33,7 @@ Signed-off-by: Mathy Vanhoef * 00-50-f2:1 (OUI:OUI type) --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -800,6 +800,15 @@ static int wpa_supplicant_install_gtk(st +@@ -785,6 +785,15 @@ static int wpa_supplicant_install_gtk(st const u8 *_gtk = gd->gtk; u8 gtk_buf[32]; @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len); wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)", -@@ -834,6 +843,9 @@ static int wpa_supplicant_install_gtk(st +@@ -819,6 +828,9 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -59,7 +59,7 @@ Signed-off-by: Mathy Vanhoef return 0; } -@@ -940,6 +952,48 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -925,6 +937,48 @@ static int wpa_supplicant_pairwise_gtk(s } @@ -108,7 +108,7 @@ Signed-off-by: Mathy Vanhoef static int ieee80211w_set_keys(struct wpa_sm *sm, struct wpa_eapol_ie_parse *ie) { -@@ -950,30 +1004,14 @@ static int ieee80211w_set_keys(struct wp +@@ -935,30 +989,14 @@ static int ieee80211w_set_keys(struct wp if (ie->igtk) { size_t len; const struct wpa_igtk_kde *igtk; @@ -142,7 +142,7 @@ Signed-off-by: Mathy Vanhoef } return 0; -@@ -2491,7 +2529,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) +@@ -2451,7 +2489,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) */ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) { @@ -151,7 +151,7 @@ Signed-off-by: Mathy Vanhoef if (sm == NULL) return; -@@ -2517,7 +2555,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2477,7 +2515,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * /* Prepare for the next transition */ wpa_ft_prepare_auth_request(sm, NULL); @@ -160,7 +160,7 @@ Signed-off-by: Mathy Vanhoef } #endif /* CONFIG_IEEE80211R */ #ifdef CONFIG_FILS -@@ -2527,11 +2565,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2487,11 +2525,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * * AUTHENTICATED state to get the EAPOL port Authorized. */ wpa_supplicant_key_neg_complete(sm, sm->bssid, 1); @@ -174,7 +174,7 @@ Signed-off-by: Mathy Vanhoef /* * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if * this is not part of a Fast BSS Transition. -@@ -2541,6 +2579,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2501,6 +2539,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * os_memset(&sm->ptk, 0, sizeof(sm->ptk)); sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -185,7 +185,7 @@ Signed-off-by: Mathy Vanhoef } #ifdef CONFIG_TDLS -@@ -3117,6 +3159,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3052,6 +3094,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(sm->pmk, 0, sizeof(sm->pmk)); os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -196,7 +196,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0)); -@@ -3189,29 +3235,11 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3124,29 +3170,11 @@ int wpa_wnmsleep_install_key(struct wpa_ os_memset(&gd, 0, sizeof(gd)); #ifdef CONFIG_IEEE80211W } else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) { diff --git a/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch similarity index 84% rename from package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch rename to package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch index 2093d25e9..650bf43e9 100644 --- a/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch +++ b/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch @@ -14,7 +14,7 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -795,14 +795,17 @@ struct wpa_gtk_data { +@@ -780,14 +780,17 @@ struct wpa_gtk_data { static int wpa_supplicant_install_gtk(struct wpa_sm *sm, const struct wpa_gtk_data *gd, @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)", gd->keyidx, gd->tx, gd->gtk_len); -@@ -843,8 +846,14 @@ static int wpa_supplicant_install_gtk(st +@@ -828,8 +831,14 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -52,7 +52,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -938,7 +947,7 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -923,7 +932,7 @@ static int wpa_supplicant_pairwise_gtk(s (wpa_supplicant_check_group_cipher(sm, sm->group_cipher, gtk_len, gtk_len, &gd.key_rsc_len, &gd.alg) || @@ -61,7 +61,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: Failed to install GTK"); os_memset(&gd, 0, sizeof(gd)); -@@ -954,14 +963,18 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -939,14 +948,18 @@ static int wpa_supplicant_pairwise_gtk(s #ifdef CONFIG_IEEE80211W static int wpa_supplicant_install_igtk(struct wpa_sm *sm, @@ -83,7 +83,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)", keyidx); -@@ -986,8 +999,14 @@ static int wpa_supplicant_install_igtk(s +@@ -971,8 +984,14 @@ static int wpa_supplicant_install_igtk(s return -1; } @@ -100,7 +100,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -1010,7 +1029,7 @@ static int ieee80211w_set_keys(struct wp +@@ -995,7 +1014,7 @@ static int ieee80211w_set_keys(struct wp return -1; igtk = (const struct wpa_igtk_kde *) ie->igtk; @@ -109,7 +109,7 @@ Signed-off-by: Jouni Malinen return -1; } -@@ -1659,7 +1678,7 @@ static void wpa_supplicant_process_1_of_ +@@ -1641,7 +1660,7 @@ static void wpa_supplicant_process_1_of_ if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc)) key_rsc = null_rsc; @@ -118,7 +118,7 @@ Signed-off-by: Jouni Malinen wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0) goto failed; os_memset(&gd, 0, sizeof(gd)); -@@ -2580,8 +2599,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2540,8 +2559,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -129,7 +129,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ } -@@ -3160,8 +3181,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3095,8 +3116,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -140,7 +140,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); -@@ -3226,7 +3249,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3161,7 +3184,7 @@ int wpa_wnmsleep_install_key(struct wpa_ wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)", gd.gtk, gd.gtk_len); @@ -149,7 +149,7 @@ Signed-off-by: Jouni Malinen os_memset(&gd, 0, sizeof(gd)); wpa_printf(MSG_DEBUG, "Failed to install the GTK in " "WNM mode"); -@@ -3238,7 +3261,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3173,7 +3196,7 @@ int wpa_wnmsleep_install_key(struct wpa_ const struct wpa_igtk_kde *igtk; igtk = (const struct wpa_igtk_kde *) (buf + 2); @@ -158,15 +158,6 @@ Signed-off-by: Jouni Malinen return -1; #endif /* CONFIG_IEEE80211W */ } else { -@@ -4121,7 +4144,7 @@ int fils_process_assoc_resp(struct wpa_s - os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2); - - wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver"); -- if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) { -+ if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery, 0) < 0) { - wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK"); - goto fail; - } --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -32,8 +32,10 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch similarity index 76% rename from package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch rename to package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch index 30679e25c..e0f1773f2 100644 --- a/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch +++ b/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch @@ -17,7 +17,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -216,6 +216,7 @@ struct wpa_ptk { +@@ -205,6 +205,7 @@ struct wpa_ptk { size_t kck_len; size_t kek_len; size_t tk_len; @@ -27,7 +27,7 @@ Signed-off-by: Mathy Vanhoef struct wpa_gtk { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -594,7 +594,6 @@ static void wpa_supplicant_process_1_of_ +@@ -581,7 +581,6 @@ static void wpa_supplicant_process_1_of_ os_memset(buf, 0, sizeof(buf)); } sm->tptk_set = 1; @@ -35,7 +35,7 @@ Signed-off-by: Mathy Vanhoef kde = sm->assoc_wpa_ie; kde_len = sm->assoc_wpa_ie_len; -@@ -701,7 +700,7 @@ static int wpa_supplicant_install_ptk(st +@@ -686,7 +685,7 @@ static int wpa_supplicant_install_ptk(st enum wpa_alg alg; const u8 *key_rsc; @@ -44,7 +44,7 @@ Signed-off-by: Mathy Vanhoef wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Do not re-install same PTK to the driver"); return 0; -@@ -745,7 +744,7 @@ static int wpa_supplicant_install_ptk(st +@@ -730,7 +729,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -53,14 +53,6 @@ Signed-off-by: Mathy Vanhoef if (sm->wpa_ptk_rekey) { eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL); -@@ -4172,6 +4171,7 @@ int fils_process_assoc_resp(struct wpa_s - * takes care of association frame encryption/decryption. */ - /* TK is not needed anymore in supplicant */ - os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); -+ sm->ptk.installed = 1; - - /* FILS HLP Container */ - fils_process_hlp_container(sm, ie_start, end - ie_start); --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -24,7 +24,6 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch similarity index 94% rename from package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch rename to package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch index 6f28e7431..8d9bd42ac 100644 --- a/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch +++ b/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch @@ -16,7 +16,7 @@ Signed-off-by: Jouni Malinen --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1951,6 +1951,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) +@@ -1912,6 +1912,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) } @@ -38,7 +38,7 @@ Signed-off-by: Jouni Malinen SM_STATE(WPA_PTK, INITPMK) { u8 msk[2 * PMK_LEN]; -@@ -3116,9 +3131,12 @@ SM_STEP(WPA_PTK) +@@ -2932,9 +2947,12 @@ SM_STEP(WPA_PTK) SM_ENTER(WPA_PTK, AUTHENTICATION); else if (sm->ReAuthenticationRequest) SM_ENTER(WPA_PTK, AUTHENTICATION2); diff --git a/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch similarity index 97% rename from package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch rename to package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch index 2ca05dd64..d6e500b11 100644 --- a/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch +++ b/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch @@ -67,7 +67,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -695,7 +713,7 @@ static void wpa_tdls_peer_clear(struct w +@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct w peer->cipher = 0; peer->qos_info = 0; peer->wmm_capable = 0; @@ -76,7 +76,7 @@ Signed-off-by: Jouni Malinen peer->chan_switch_enabled = 0; os_memset(&peer->tpk, 0, sizeof(peer->tpk)); os_memset(peer->inonce, 0, WPA_NONCE_LEN); -@@ -1158,6 +1176,7 @@ skip_rsnie: +@@ -1159,6 +1177,7 @@ skip_rsnie: wpa_tdls_peer_free(sm, peer); return -1; } diff --git a/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch similarity index 100% rename from package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch rename to package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch diff --git a/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch similarity index 84% rename from package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch rename to package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch index 7712ce519..12904faf1 100644 --- a/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch +++ b/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch @@ -15,16 +15,16 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s - #ifdef CONFIG_FILS - sm->fils_completed = 0; - #endif /* CONFIG_FILS */ +@@ -2568,6 +2568,9 @@ void wpa_sm_notify_assoc(struct wpa_sm * + #ifdef CONFIG_TDLS + wpa_tdls_assoc(sm); + #endif /* CONFIG_TDLS */ +#ifdef CONFIG_IEEE80211R + sm->ft_reassoc_completed = 0; +#endif /* CONFIG_IEEE80211R */ - /* Keys are not needed in the WPA state machine anymore */ - wpa_sm_drop_sa(sm); + #ifdef CONFIG_P2P + os_memset(sm->p2p_ip_addr, 0, sizeof(sm->p2p_ip_addr)); --- a/src/rsn_supp/wpa_ft.c +++ b/src/rsn_supp/wpa_ft.c @@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + 2 + sm->r0kh_id_len + ric_ies_len + 100; -@@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } @@ -47,7 +47,7 @@ Signed-off-by: Jouni Malinen if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) { wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs"); return -1; -@@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } diff --git a/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch b/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch new file mode 100644 index 000000000..623c2be34 --- /dev/null +++ b/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch @@ -0,0 +1,305 @@ +From 41f140d38617e1fd3fa88c1667c1bce0cad79224 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?G=C3=BCnther=20Kelleter?= +Date: Thu, 5 Jan 2017 17:00:33 +0100 +Subject: [PATCH] Add hostapd options wpa_group_update_count and + wpa_pairwise_update_count +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +wpa_group_update_count and wpa_pairwise_update_count can now be used to +set the GTK and PTK rekey retry limits (dot11RSNAConfigGroupUpdateCount +and dot11RSNAConfigPairwiseUpdateCount). Defaults set to current +hardcoded value (4). + +Some stations may suffer from frequent deauthentications due to GTK +rekey failures: EAPOL 1/2 frame is not answered during the total timeout +period of currently ~3.5 seconds. For example, a Galaxy S6 with Android +6.0.1 appears to go into power save mode for up to 5 seconds. Increasing +wpa_group_update_count to 6 fixed this issue. + +Signed-off-by: Günther Kelleter +--- + hostapd/config_file.c | 22 ++++++++++++++++++++++ + hostapd/hostapd.conf | 11 +++++++++++ + src/ap/ap_config.c | 2 ++ + src/ap/ap_config.h | 2 ++ + src/ap/wpa_auth.c | 37 ++++++++++++++++++------------------- + src/ap/wpa_auth.h | 2 ++ + src/ap/wpa_auth_glue.c | 2 ++ + src/ap/wpa_auth_i.h | 4 ++-- + wpa_supplicant/ibss_rsn.c | 2 ++ + wpa_supplicant/mesh_rsn.c | 2 ++ + 10 files changed, 65 insertions(+), 21 deletions(-) + +diff --git a/hostapd/config_file.c b/hostapd/config_file.c +index 8cfa198c3..02693a5b1 100644 +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -2489,6 +2489,28 @@ static int hostapd_config_fill(struct hostapd_config *conf, + bss->wpa_gmk_rekey = atoi(pos); + } else if (os_strcmp(buf, "wpa_ptk_rekey") == 0) { + bss->wpa_ptk_rekey = atoi(pos); ++ } else if (os_strcmp(buf, "wpa_group_update_count") == 0) { ++ char *endp; ++ unsigned long val = strtoul(pos, &endp, 0); ++ ++ if (*endp || val < 1 || val > (u32) -1) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: Invalid wpa_group_update_count=%lu; allowed range 1..4294967295", ++ line, val); ++ return 1; ++ } ++ bss->wpa_group_update_count = (u32) val; ++ } else if (os_strcmp(buf, "wpa_pairwise_update_count") == 0) { ++ char *endp; ++ unsigned long val = strtoul(pos, &endp, 0); ++ ++ if (*endp || val < 1 || val > (u32) -1) { ++ wpa_printf(MSG_ERROR, ++ "Line %d: Invalid wpa_pairwise_update_count=%lu; allowed range 1..4294967295", ++ line, val); ++ return 1; ++ } ++ bss->wpa_pairwise_update_count = (u32) val; + } else if (os_strcmp(buf, "wpa_passphrase") == 0) { + int len = os_strlen(pos); + if (len < 8 || len > 63) { +diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf +index 314f3842b..1fb1bd987 100644 +--- a/hostapd/hostapd.conf ++++ b/hostapd/hostapd.conf +@@ -1221,6 +1221,11 @@ own_ip_addr=127.0.0.1 + # (dot11RSNAConfigGroupRekeyStrict) + #wpa_strict_rekey=1 + ++# The number of times EAPOL-Key Message 1/2 in the RSN Group Key Handshake is ++#retried per GTK Handshake attempt. (dot11RSNAConfigGroupUpdateCount) ++# Range 1..4294967295; default: 4 ++#wpa_group_update_count=4 ++ + # Time interval for rekeying GMK (master key used internally to generate GTKs + # (in seconds). + #wpa_gmk_rekey=86400 +@@ -1229,6 +1234,12 @@ own_ip_addr=127.0.0.1 + # PTK to mitigate some attacks against TKIP deficiencies. + #wpa_ptk_rekey=600 + ++# The number of times EAPOL-Key Message 1/4 and Message 3/4 in the RSN 4-Way ++# Handshake are retried per 4-Way Handshake attempt. ++# (dot11RSNAConfigPairwiseUpdateCount) ++# Range 1..4294967295; default: 4 ++#wpa_pairwise_update_count=4 ++ + # Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up + # roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN + # authentication and key handshake before actually associating with a new AP. +diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c +index c2b80ad97..9abcab7fb 100644 +--- a/src/ap/ap_config.c ++++ b/src/ap/ap_config.c +@@ -56,6 +56,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) + + bss->wpa_group_rekey = 600; + bss->wpa_gmk_rekey = 86400; ++ bss->wpa_group_update_count = 4; ++ bss->wpa_pairwise_update_count = 4; + bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK; + bss->wpa_pairwise = WPA_CIPHER_TKIP; + bss->wpa_group = WPA_CIPHER_TKIP; +diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h +index 31b1e7762..7495dc96f 100644 +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -330,6 +330,8 @@ struct hostapd_bss_config { + int wpa_strict_rekey; + int wpa_gmk_rekey; + int wpa_ptk_rekey; ++ u32 wpa_group_update_count; ++ u32 wpa_pairwise_update_count; + int rsn_pairwise; + int rsn_preauth; + char *rsn_preauth_interfaces; +diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c +index 0bd901fbf..8c082f426 100644 +--- a/src/ap/wpa_auth.c ++++ b/src/ap/wpa_auth.c +@@ -60,8 +60,6 @@ static void wpa_group_put(struct wpa_authenticator *wpa_auth, + struct wpa_group *group); + static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos); + +-static const u32 dot11RSNAConfigGroupUpdateCount = 4; +-static const u32 dot11RSNAConfigPairwiseUpdateCount = 4; + static const u32 eapol_key_timeout_first = 100; /* ms */ + static const u32 eapol_key_timeout_subseq = 1000; /* ms */ + static const u32 eapol_key_timeout_first_group = 500; /* ms */ +@@ -1623,7 +1621,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, + { + int timeout_ms; + int pairwise = key_info & WPA_KEY_INFO_KEY_TYPE; +- int ctr; ++ u32 ctr; + + if (sm == NULL) + return; +@@ -1640,7 +1638,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, + if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) + sm->pending_1_of_4_timeout = 1; + wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " +- "counter %d)", timeout_ms, ctr); ++ "counter %u)", timeout_ms, ctr); + eloop_register_timeout(timeout_ms / 1000, (timeout_ms % 1000) * 1000, + wpa_send_eapol_timeout, wpa_auth, sm); + } +@@ -2002,7 +2000,7 @@ SM_STATE(WPA_PTK, PTKSTART) + sm->alt_snonce_valid = FALSE; + + sm->TimeoutCtr++; +- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { ++ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { + /* No point in sending the EAPOL-Key - we will disconnect + * immediately following this. */ + return; +@@ -2693,7 +2691,7 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) + sm->TimeoutEvt = FALSE; + + sm->TimeoutCtr++; +- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { ++ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { + /* No point in sending the EAPOL-Key - we will disconnect + * immediately following this. */ + return; +@@ -2988,11 +2986,12 @@ SM_STEP(WPA_PTK) + sm->EAPOLKeyPairwise) + SM_ENTER(WPA_PTK, PTKCALCNEGOTIATING); + else if (sm->TimeoutCtr > +- (int) dot11RSNAConfigPairwiseUpdateCount) { ++ sm->wpa_auth->conf.wpa_pairwise_update_count) { + wpa_auth->dot11RSNA4WayHandshakeFailures++; +- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, +- "PTKSTART: Retry limit %d reached", +- dot11RSNAConfigPairwiseUpdateCount); ++ wpa_auth_vlogger( ++ sm->wpa_auth, sm->addr, LOGGER_DEBUG, ++ "PTKSTART: Retry limit %u reached", ++ sm->wpa_auth->conf.wpa_pairwise_update_count); + SM_ENTER(WPA_PTK, DISCONNECT); + } else if (sm->TimeoutEvt) + SM_ENTER(WPA_PTK, PTKSTART); +@@ -3016,12 +3015,12 @@ SM_STEP(WPA_PTK) + sm->EAPOLKeyPairwise && sm->MICVerified) + SM_ENTER(WPA_PTK, PTKINITDONE); + else if (sm->TimeoutCtr > +- (int) dot11RSNAConfigPairwiseUpdateCount) { ++ sm->wpa_auth->conf.wpa_pairwise_update_count) { + wpa_auth->dot11RSNA4WayHandshakeFailures++; +- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, +- "PTKINITNEGOTIATING: Retry limit %d " +- "reached", +- dot11RSNAConfigPairwiseUpdateCount); ++ wpa_auth_vlogger( ++ sm->wpa_auth, sm->addr, LOGGER_DEBUG, ++ "PTKINITNEGOTIATING: Retry limit %u reached", ++ sm->wpa_auth->conf.wpa_pairwise_update_count); + SM_ENTER(WPA_PTK, DISCONNECT); + } else if (sm->TimeoutEvt) + SM_ENTER(WPA_PTK, PTKINITNEGOTIATING); +@@ -3056,7 +3055,7 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING) + SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); + + sm->GTimeoutCtr++; +- if (sm->GTimeoutCtr > (int) dot11RSNAConfigGroupUpdateCount) { ++ if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { + /* No point in sending the EAPOL-Key - we will disconnect + * immediately following this. */ + return; +@@ -3154,7 +3153,7 @@ SM_STEP(WPA_PTK_GROUP) + !sm->EAPOLKeyPairwise && sm->MICVerified) + SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); + else if (sm->GTimeoutCtr > +- (int) dot11RSNAConfigGroupUpdateCount) ++ sm->wpa_auth->conf.wpa_group_update_count) + SM_ENTER(WPA_PTK_GROUP, KEYERROR); + else if (sm->TimeoutEvt) + SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); +@@ -3614,8 +3613,8 @@ int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen) + "dot11RSNAConfigNumberOfGTKSAReplayCounters=0\n", + RSN_VERSION, + !!wpa_auth->conf.wpa_strict_rekey, +- dot11RSNAConfigGroupUpdateCount, +- dot11RSNAConfigPairwiseUpdateCount, ++ wpa_auth->conf.wpa_group_update_count, ++ wpa_auth->conf.wpa_pairwise_update_count, + wpa_cipher_key_len(wpa_auth->conf.wpa_group) * 8, + dot11RSNAConfigPMKLifetime, + dot11RSNAConfigPMKReauthThreshold, +diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h +index 9cbe3889b..0920a169d 100644 +--- a/src/ap/wpa_auth.h ++++ b/src/ap/wpa_auth.h +@@ -144,6 +144,8 @@ struct wpa_auth_config { + int wpa_strict_rekey; + int wpa_gmk_rekey; + int wpa_ptk_rekey; ++ u32 wpa_group_update_count; ++ u32 wpa_pairwise_update_count; + int rsn_pairwise; + int rsn_preauth; + int eapol_version; +diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c +index 22518a1f1..394f77a66 100644 +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -41,6 +41,8 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, + wconf->wpa_strict_rekey = conf->wpa_strict_rekey; + wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; + wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; ++ wconf->wpa_group_update_count = conf->wpa_group_update_count; ++ wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count; + wconf->rsn_pairwise = conf->rsn_pairwise; + wconf->rsn_preauth = conf->rsn_preauth; + wconf->eapol_version = conf->eapol_version; +diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h +index 065a624ad..cda2c5065 100644 +--- a/src/ap/wpa_auth_i.h ++++ b/src/ap/wpa_auth_i.h +@@ -48,8 +48,8 @@ struct wpa_state_machine { + Boolean AuthenticationRequest; + Boolean ReAuthenticationRequest; + Boolean Disconnect; +- int TimeoutCtr; +- int GTimeoutCtr; ++ u32 TimeoutCtr; ++ u32 GTimeoutCtr; + Boolean TimeoutEvt; + Boolean EAPOLKeyReceived; + Boolean EAPOLKeyPairwise; +diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c +index 521a692ba..954061ae4 100644 +--- a/wpa_supplicant/ibss_rsn.c ++++ b/wpa_supplicant/ibss_rsn.c +@@ -428,6 +428,8 @@ static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, + conf.wpa_group = WPA_CIPHER_CCMP; + conf.eapol_version = 2; + conf.wpa_group_rekey = ssid->group_rekey ? ssid->group_rekey : 600; ++ conf.wpa_group_update_count = 4; ++ conf.wpa_pairwise_update_count = 4; + + ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb, ibss_rsn); + if (ibss_rsn->auth_group == NULL) { +diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c +index 33040f30b..628382cbf 100644 +--- a/wpa_supplicant/mesh_rsn.c ++++ b/wpa_supplicant/mesh_rsn.c +@@ -158,6 +158,8 @@ static int __mesh_rsn_auth_init(struct mesh_rsn *rsn, const u8 *addr, + conf.wpa_group = rsn->group_cipher; + conf.eapol_version = 0; + conf.wpa_group_rekey = -1; ++ conf.wpa_group_update_count = 4; ++ conf.wpa_pairwise_update_count = 4; + #ifdef CONFIG_IEEE80211W + conf.ieee80211w = ieee80211w; + if (ieee80211w != NO_MGMT_FRAME_PROTECTION) +-- +2.13.6 + diff --git a/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch b/package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch similarity index 100% rename from package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch rename to package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch diff --git a/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch b/package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch similarity index 100% rename from package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch rename to package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch diff --git a/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch b/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch similarity index 90% rename from package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch rename to package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch index 19165cce2..e413521cd 100644 --- a/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch +++ b/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch @@ -48,7 +48,7 @@ Signed-off-by: Jouni Malinen --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho +@@ -2515,6 +2515,8 @@ static int hostapd_config_fill(struct ho return 1; } bss->wpa_pairwise_update_count = (u32) val; @@ -59,17 +59,17 @@ Signed-off-by: Jouni Malinen if (len < 8 || len > 63) { --- a/hostapd/defconfig +++ b/hostapd/defconfig -@@ -372,3 +372,7 @@ CONFIG_IPV6=y - # Opportunistic Wireless Encryption (OWE) - # Experimental implementation of draft-harkins-owe-07.txt - #CONFIG_OWE=y +@@ -355,3 +355,7 @@ CONFIG_IPV6=y + # Include internal line edit mode in hostapd_cli. This can be used to provide + # limited command line editing and history support. + #CONFIG_WPA_CLI_EDIT=y + +# Override default value for the wpa_disable_eapol_key_retries configuration +# parameter. See that parameter in hostapd.conf for more details. +#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1 +@@ -1240,6 +1240,30 @@ own_ip_addr=127.0.0.1 # Range 1..4294967295; default: 4 #wpa_pairwise_update_count=4 @@ -102,7 +102,7 @@ Signed-off-by: Jouni Malinen # authentication and key handshake before actually associating with a new AP. --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str +@@ -36,6 +36,10 @@ static void hostapd_config_free_vlan(str } @@ -113,7 +113,7 @@ Signed-off-by: Jouni Malinen void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) { dl_list_init(&bss->anqp_elem); -@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct +@@ -57,6 +61,8 @@ void hostapd_config_defaults_bss(struct bss->wpa_gmk_rekey = 86400; bss->wpa_group_update_count = 4; bss->wpa_pairwise_update_count = 4; @@ -124,7 +124,7 @@ Signed-off-by: Jouni Malinen bss->wpa_group = WPA_CIPHER_TKIP; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -333,6 +333,7 @@ struct hostapd_bss_config { +@@ -332,6 +332,7 @@ struct hostapd_bss_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -134,7 +134,7 @@ Signed-off-by: Jouni Malinen char *rsn_preauth_interfaces; --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp +@@ -63,6 +63,7 @@ static u8 * ieee80211w_kde_add(struct wp static const u32 eapol_key_timeout_first = 100; /* ms */ static const u32 eapol_key_timeout_subseq = 1000; /* ms */ static const u32 eapol_key_timeout_first_group = 500; /* ms */ @@ -142,7 +142,7 @@ Signed-off-by: Jouni Malinen /* TODO: make these configurable */ static const int dot11RSNAConfigPMKLifetime = 43200; -@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au +@@ -1629,6 +1630,9 @@ static void wpa_send_eapol(struct wpa_au eapol_key_timeout_first_group; else timeout_ms = eapol_key_timeout_subseq; @@ -152,7 +152,7 @@ Signed-off-by: Jouni Malinen if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) sm->pending_1_of_4_timeout = 1; wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " -@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) +@@ -2700,6 +2704,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) sm->TimeoutEvt = FALSE; sm->TimeoutCtr++; @@ -164,7 +164,7 @@ Signed-off-by: Jouni Malinen if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK) +@@ -3027,7 +3036,9 @@ SM_STEP(WPA_PTK) sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK, PTKINITDONE); else if (sm->TimeoutCtr > @@ -175,7 +175,7 @@ Signed-off-by: Jouni Malinen wpa_auth->dot11RSNA4WayHandshakeFailures++; wpa_auth_vlogger( sm->wpa_auth, sm->addr, LOGGER_DEBUG, -@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING +@@ -3067,6 +3078,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); sm->GTimeoutCtr++; @@ -187,7 +187,7 @@ Signed-off-by: Jouni Malinen if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP) +@@ -3165,7 +3181,9 @@ SM_STEP(WPA_PTK_GROUP) !sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); else if (sm->GTimeoutCtr > @@ -200,7 +200,7 @@ Signed-off-by: Jouni Malinen SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); --- a/src/ap/wpa_auth.h +++ b/src/ap/wpa_auth.h -@@ -165,6 +165,7 @@ struct wpa_auth_config { +@@ -146,6 +146,7 @@ struct wpa_auth_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -210,7 +210,7 @@ Signed-off-by: Jouni Malinen int eapol_version; --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct +@@ -42,6 +42,8 @@ static void hostapd_wpa_auth_conf(struct wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; wconf->wpa_group_update_count = conf->wpa_group_update_count; diff --git a/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch b/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch similarity index 81% rename from package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch rename to package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch index 5cc2f7b17..9655b5cb1 100644 --- a/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch +++ b/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch @@ -15,9 +15,9 @@ Signed-off-by: Jouni Malinen --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz +@@ -93,6 +93,12 @@ int wpa_eapol_key_mic(const u8 *key, siz { - u8 hash[SHA512_MAC_LEN]; + u8 hash[SHA384_MAC_LEN]; + if (key_len == 0) { + wpa_printf(MSG_DEBUG, @@ -30,7 +30,7 @@ Signed-off-by: Jouni Malinen case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4: --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st +@@ -710,6 +710,11 @@ static int wpa_supplicant_install_ptk(st alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -42,7 +42,7 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) { -@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st +@@ -730,6 +735,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -50,7 +50,7 @@ Signed-off-by: Jouni Malinen sm->ptk.installed = 1; if (sm->wpa_ptk_rekey) { -@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1699,9 +1705,10 @@ static int wpa_supplicant_verify_eapol_k os_memcpy(mic, key + 1, mic_len); if (sm->tptk_set) { os_memset(key + 1, 0, mic_len); @@ -64,7 +64,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC " "when using TPTK - ignoring TPTK"); -@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1724,9 +1731,10 @@ static int wpa_supplicant_verify_eapol_k if (!ok && sm->ptk_set) { os_memset(key + 1, 0, mic_len); @@ -78,7 +78,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC - " "dropping packet"); -@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s +@@ -3689,6 +3697,11 @@ int fils_process_assoc_resp(struct wpa_s alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -90,11 +90,3 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver", sm->ptk.tk, keylen); -@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s - * takes care of association frame encryption/decryption. */ - /* TK is not needed anymore in supplicant */ - os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); -+ sm->ptk.tk_len = 0; - sm->ptk.installed = 1; - - /* FILS HLP Container */ diff --git a/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch b/package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch similarity index 100% rename from package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch rename to package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch diff --git a/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch b/package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch similarity index 100% rename from package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch rename to package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch diff --git a/package/network/services/hostapd/patches/100-daemonize_fix.patch b/package/network/services/hostapd/patches/100-daemonize_fix.patch index 43057ef9f..fad84669a 100644 --- a/package/network/services/hostapd/patches/100-daemonize_fix.patch +++ b/package/network/services/hostapd/patches/100-daemonize_fix.patch @@ -8,7 +8,7 @@ #ifdef ANDROID #include -@@ -182,59 +183,46 @@ int os_gmtime(os_time_t t, struct os_tm +@@ -179,59 +180,46 @@ int os_gmtime(os_time_t t, struct os_tm return 0; } diff --git a/package/network/services/hostapd/patches/110-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch index 3a48a7a95..5181721e3 100644 --- a/package/network/services/hostapd/patches/110-no_eapol_fix.patch +++ b/package/network/services/hostapd/patches/110-no_eapol_fix.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -265,9 +265,10 @@ void wpa_supplicant_cancel_auth_timeout( +@@ -259,9 +259,10 @@ void wpa_supplicant_cancel_auth_timeout( */ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s) { diff --git a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch index 4a5b63716..fdd5da9bf 100644 --- a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch +++ b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch @@ -1,6 +1,6 @@ --- a/src/l2_packet/l2_packet_linux.c +++ b/src/l2_packet/l2_packet_linux.c -@@ -340,8 +340,7 @@ struct l2_packet_data * l2_packet_init_b +@@ -337,8 +337,7 @@ struct l2_packet_data * l2_packet_init_b l2 = l2_packet_init(br_ifname, own_addr, protocol, rx_callback, rx_callback_ctx, l2_hdr); diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index 0d289d53a..f0348201f 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO +@@ -330,10 +332,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1204,6 +1210,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1077,6 +1083,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) BCHECK=../src/drivers/build.hostapd @@ -49,8 +49,8 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1248,6 +1260,12 @@ ifeq ($(CONFIG_TLS), linux) - HOBJS += ../src/crypto/crypto_linux.o +@@ -1118,6 +1130,12 @@ HOBJS += ../src/crypto/aes-internal.o + HOBJS += ../src/crypto/aes-internal-enc.o endif +dump_cflags: @@ -72,7 +72,7 @@ ifndef CONFIG_NO_GITVER # Add VERSION_STR postfix for builds from a git repository -@@ -357,7 +358,9 @@ endif +@@ -329,7 +330,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -861,6 +864,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -820,6 +823,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -92,8 +92,8 @@ + endif endif - ifdef CONFIG_AP -@@ -868,9 +875,11 @@ NEED_EAP_COMMON=y + ifdef CONFIG_MACSEC +@@ -840,9 +847,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -952,6 +961,12 @@ endif +@@ -910,6 +919,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -960,7 +975,9 @@ CFLAGS += -DCONFIG_MBO +@@ -918,7 +933,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1835,6 +1852,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1706,6 +1723,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1937,6 +1960,12 @@ endif +@@ -1808,6 +1831,12 @@ endif -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -5317,8 +5317,8 @@ union wpa_event_data { +@@ -4968,8 +4968,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -5330,7 +5330,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4981,7 +4981,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1375,8 +1375,8 @@ static void hostapd_event_dfs_cac_starte +@@ -1163,8 +1163,8 @@ static void hostapd_event_dfs_cac_starte #endif /* NEED_AP_MLME */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -1590,7 +1590,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -1373,7 +1373,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -3709,8 +3709,8 @@ static void wpa_supplicant_event_assoc_a +@@ -3610,8 +3610,8 @@ static void wpa_supplicant_event_assoc_a } @@ -242,7 +242,16 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -4466,7 +4466,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4315,7 +4315,7 @@ void wpa_supplicant_event(void *ctx, enu + #endif /* CONFIG_AP */ + break; + case EVENT_ACS_CHANNEL_SELECTED: +-#ifdef CONFIG_ACS ++#if defined(CONFIG_ACS) && defined(CONFIG_AP) + if (!wpa_s->ap_iface) + break; + hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0], +@@ -4337,7 +4337,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -253,7 +262,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5457,7 +5457,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5136,7 +5136,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -261,7 +270,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5494,6 +5493,11 @@ static int wpa_supplicant_match_existing +@@ -5173,6 +5172,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -273,7 +282,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -5750,6 +5754,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -5428,6 +5432,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -296,9 +305,9 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -670,6 +675,8 @@ int main(int argc, char *argv[]) - dl_list_init(&interfaces.eth_p_oui); - #endif /* CONFIG_ETH_P_OUI */ +@@ -667,6 +672,8 @@ int main(int argc, char *argv[]) + interfaces.global_ctrl_sock = -1; + dl_list_init(&interfaces.global_ctrl_dst); + wpa_supplicant_event = hostapd_wpa_event; + wpa_supplicant_event_global = hostapd_wpa_event_global; diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index c8ca3694c..9dc0f2c39 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho +@@ -2953,6 +2953,10 @@ static int hostapd_config_fill(struct ho } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -735,6 +735,8 @@ struct hostapd_config { +@@ -681,6 +681,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -480,7 +480,8 @@ static int ieee80211n_check_40mhz(struct +@@ -474,7 +474,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index 6846db275..ccc9781fa 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3927,7 +3927,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -3696,7 +3696,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch index 3bc916b6b..ebb12f69f 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4152,7 +4152,7 @@ static int nl80211_set_channel(struct i8 +@@ -4104,7 +4104,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index f05b9147b..0dcd7c913 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -87,6 +87,25 @@ static void hostapd_reload_bss(struct ho +@@ -80,6 +80,25 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -26,7 +26,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -165,6 +184,7 @@ int hostapd_reload_config(struct hostapd +@@ -158,6 +177,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -34,7 +34,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -186,21 +206,20 @@ int hostapd_reload_config(struct hostapd +@@ -179,21 +199,20 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index 92e6ae9ae..be10a413e 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,54 +1,72 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2536,10 +2536,15 @@ static int wpa_driver_nl80211_del_beacon +@@ -2490,13 +2490,18 @@ wpa_driver_nl80211_finish_drv_init(struc + } + + +-static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv) ++static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) + { ++ struct wpa_driver_nl80211_data *drv = bss->drv; struct nl_msg *msg; - struct wpa_driver_nl80211_data *drv = bss->drv; + if (!bss->beacon_set) + return 0; + + bss->beacon_set = 0; -+ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", - drv->ifindex); -+ bss->ifindex); - nl80211_put_wiphy_data_ap(bss); - msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); ++ bss->ifindex); + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); return send_and_recv_msgs(drv, msg, NULL, NULL); } -@@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i - nl80211_mgmt_unsubscribe(bss, "AP teardown"); +@@ -2548,7 +2553,7 @@ static void wpa_driver_nl80211_deinit(st + nl80211_remove_monitor_interface(drv); - nl80211_put_wiphy_data_ap(bss); + if (is_ap_interface(drv->nlmode)) +- wpa_driver_nl80211_del_beacon(drv); ++ wpa_driver_nl80211_del_beacon(bss); + + if (drv->eapol_sock >= 0) { + eloop_unregister_read_sock(drv->eapol_sock); +@@ -4703,8 +4708,7 @@ static void nl80211_teardown_ap(struct i + nl80211_remove_monitor_interface(drv); + else + nl80211_mgmt_unsubscribe(bss, "AP teardown"); +- - bss->beacon_set = 0; + wpa_driver_nl80211_del_beacon(bss); } -@@ -6853,8 +6858,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -6728,8 +6732,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); - if (!bss->added_if && !drv->first_bss->next) -- wpa_driver_nl80211_del_beacon(bss); +- wpa_driver_nl80211_del_beacon(drv); nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap( +@@ -7091,8 +7093,7 @@ static int wpa_driver_nl80211_deinit_ap( + struct wpa_driver_nl80211_data *drv = bss->drv; if (!is_ap_interface(drv->nlmode)) return -1; - wpa_driver_nl80211_del_beacon(bss); +- wpa_driver_nl80211_del_beacon(drv); - bss->beacon_set = 0; ++ wpa_driver_nl80211_del_beacon(bss); /* * If the P2P GO interface was dynamically added, then it is -@@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo +@@ -7111,8 +7112,7 @@ static int wpa_driver_nl80211_stop_ap(vo + struct wpa_driver_nl80211_data *drv = bss->drv; if (!is_ap_interface(drv->nlmode)) return -1; - wpa_driver_nl80211_del_beacon(bss); +- wpa_driver_nl80211_del_beacon(drv); - bss->beacon_set = 0; ++ wpa_driver_nl80211_del_beacon(bss); return 0; } diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index 043ddbf88..83bec2a25 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -56,6 +56,7 @@ +@@ -55,6 +55,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -74,6 +75,7 @@ static void hostapd_ctrl_iface_send(stru +@@ -73,6 +74,7 @@ static void hostapd_ctrl_iface_send(stru enum wpa_msg_type type, const char *buf, size_t len); @@ -16,7 +16,7 @@ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -125,6 +127,61 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -78,7 +78,7 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -2607,6 +2664,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2620,6 +2677,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index a37b193b6..03819b337 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -101,6 +101,11 @@ struct wpa_interface { +@@ -100,6 +100,11 @@ struct wpa_interface { const char *ifname; /** @@ -12,7 +12,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -512,6 +517,8 @@ struct wpa_supplicant { +@@ -484,6 +489,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -34,7 +34,7 @@ -include .config -include $(if $(MULTICALL),../hostapd/.config) -@@ -117,6 +121,8 @@ OBJS_c += ../src/utils/common.o +@@ -115,6 +119,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -45,9 +45,9 @@ CONFIG_OS=win32 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -118,6 +118,55 @@ const char *const wpa_supplicant_full_li - static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx); - +@@ -112,6 +112,55 @@ const char *const wpa_supplicant_full_li + "\n"; + #endif /* CONFIG_NO_STDOUT_DEBUG */ +static int hostapd_stop(struct wpa_supplicant *wpa_s) +{ @@ -101,7 +101,7 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -883,8 +932,12 @@ void wpa_supplicant_set_state(struct wpa +@@ -819,8 +868,12 @@ void wpa_supplicant_set_state(struct wpa wpas_p2p_completed(wpa_s); sme_sched_obss_scan(wpa_s, 1); @@ -114,7 +114,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -5080,6 +5133,20 @@ static int wpa_supplicant_init_iface(str +@@ -4790,6 +4843,20 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -135,7 +135,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5404,6 +5471,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5083,6 +5150,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -157,7 +157,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -290,6 +291,10 @@ void calculate_update_time(const struct +@@ -290,6 +291,10 @@ static void calculate_update_time(const static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index e977f00a2..b4729581c 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2458,6 +2458,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2471,6 +2471,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -2499,6 +2500,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2512,6 +2513,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,8 +30,8 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -926,6 +926,9 @@ ifdef CONFIG_FILS - OBJS += ../src/ap/fils_hlp.o +@@ -891,6 +891,9 @@ ifdef CONFIG_MBO + OBJS += ../src/ap/mbo_ap.o endif ifdef CONFIG_CTRL_IFACE +ifdef CONFIG_CTRL_IFACE_MIB @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -2070,7 +2070,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -1907,7 +1907,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -9631,6 +9631,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9032,6 +9032,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -9638,6 +9639,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9039,6 +9040,7 @@ char * wpa_supplicant_ctrl_iface_process reply + reply_len, reply_size - reply_len); } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -10124,6 +10126,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9517,6 +9519,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -10132,12 +10135,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9525,12 +9528,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -111,7 +111,7 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2492,6 +2492,7 @@ static const char * bool_txt(Boolean val +@@ -2490,6 +2490,7 @@ static const char * bool_txt(Boolean val return val ? "TRUE" : "FALSE"; } @@ -119,7 +119,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2667,6 +2668,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2665,6 +2666,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -129,7 +129,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val +@@ -3565,6 +3565,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -137,7 +137,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -3709,7 +3710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -148,7 +148,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2308,6 +2308,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -157,7 +157,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2391,6 +2393,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -167,7 +167,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1139,7 +1139,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1119,7 +1119,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 8f7a6879c..7f147aec1 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -1445,6 +1445,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -1452,8 +1477,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index 2b529ca3e..ac699f4e4 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -8,7 +8,7 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -678,7 +679,7 @@ int main(int argc, char *argv[]) +@@ -675,7 +676,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -17,7 +17,7 @@ if (c < 0) break; switch (c) { -@@ -715,6 +716,8 @@ int main(int argc, char *argv[]) +@@ -712,6 +713,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch index 32cab7ff6..eba79d28c 100644 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -1,6 +1,6 @@ --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -417,7 +417,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -447,7 +447,6 @@ static int hostapd_cli_cmd_sa_query(stru #endif /* CONFIG_IEEE80211W */ @@ -8,7 +8,7 @@ static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) { -@@ -643,7 +642,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -673,7 +672,6 @@ static int hostapd_cli_cmd_wps_config(st ssid_hex, argv[1]); return wpa_ctrl_command(ctrl, buf); } @@ -16,19 +16,19 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1476,7 +1474,6 @@ static const struct hostapd_cli_cmd host - { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, +@@ -1367,7 +1365,6 @@ static const struct hostapd_cli_cmd host + { "sa_query", hostapd_cli_cmd_sa_query, NULL, " = send SA Query to a station" }, #endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_WPS { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1501,7 +1498,6 @@ static const struct hostapd_cli_cmd host +@@ -1392,7 +1389,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, -#endif /* CONFIG_WPS */ - { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, - "= send Disassociation Imminent notification" }, - { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, + { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, NULL }, + { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, NULL }, + { "bss_tm_req", hostapd_cli_cmd_bss_tm_req, NULL, NULL }, diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 213ee6d72..1aeec5d05 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -21,8 +21,8 @@ Signed-hostap: Antonio Quartulli +#include "ap/sta_info.h" #include "common/defs.h" #include "common/ieee802_11_defs.h" - #include "common/wpa_common.h" -@@ -762,6 +763,9 @@ struct wpa_driver_associate_params { + #ifdef CONFIG_MACSEC +@@ -605,6 +606,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -34,7 +34,7 @@ Signed-hostap: Antonio Quartulli * --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -17,6 +17,7 @@ +@@ -16,6 +16,7 @@ #include "eap_peer/eap.h" #include "p2p/p2p.h" #include "fst/fst.h" @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -1985,6 +1986,97 @@ static char * wpa_config_write_mka_ckn(c +@@ -1891,6 +1892,97 @@ static char * wpa_config_write_mka_ckn(c #endif /* CONFIG_MACSEC */ @@ -140,10 +140,11 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2224,6 +2316,8 @@ static const struct parse_data ssid_fiel +@@ -2123,6 +2215,9 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, ++ { INT_RANGE(fixed_freq, 0, 1) }, + { FUNC(rates) }, + { FUNC(mcast_rate) }, #ifdef CONFIG_MACSEC @@ -162,7 +163,7 @@ Signed-hostap: Antonio Quartulli #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -735,6 +737,9 @@ struct wpa_ssid { +@@ -719,6 +721,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -174,10 +175,11 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2781,6 +2781,12 @@ static void wpas_start_assoc_cb(struct w +@@ -2561,6 +2561,13 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; ++ params.fixed_freq = ssid->fixed_freq; + i = 0; + while (i < WLAN_SUPP_RATES_MAX) { + params.rates[i] = ssid->rates[i]; diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 11822366d..6db61333e 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -5012,7 +5012,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -4962,7 +4962,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -5039,6 +5039,37 @@ retry: +@@ -4989,6 +4989,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch new file mode 100644 index 000000000..c4b48a938 --- /dev/null +++ b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch @@ -0,0 +1,156 @@ +From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001 +From: Antonio Quartulli +Date: Tue, 3 Jul 2012 00:36:24 +0200 +Subject: [PATCH] wpa_s: support htmode param + +possible values are HT20, HT40-, HT40+ and NOHT + +Signed-off-by: Antonio Quartulli +--- + src/drivers/driver.h | 2 ++ + src/drivers/driver_nl80211.c | 16 ++++++++++ + wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++ + wpa_supplicant/config_ssid.h | 2 ++ + wpa_supplicant/wpa_supplicant.c | 2 ++ + 5 files changed, 88 insertions(+) + +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -608,6 +608,8 @@ struct wpa_driver_associate_params { + + unsigned char rates[WLAN_SUPP_RATES_MAX]; + int mcast_rate; ++ int ht_set; ++ unsigned int htmode; + + /** + * bssid_hint - BSSID of a proposed AP +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -5020,6 +5020,22 @@ retry: + nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); + } + ++ if (params->ht_set) { ++ switch(params->htmode) { ++ case NL80211_CHAN_HT20: ++ wpa_printf(MSG_DEBUG, " * ht=HT20"); ++ break; ++ case NL80211_CHAN_HT40PLUS: ++ wpa_printf(MSG_DEBUG, " * ht=HT40+"); ++ break; ++ case NL80211_CHAN_HT40MINUS: ++ wpa_printf(MSG_DEBUG, " * ht=HT40-"); ++ break; ++ } ++ nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, ++ params->htmode); ++ } ++ + ret = nl80211_set_conn_keys(params, msg); + if (ret) + goto fail; +--- a/wpa_supplicant/config.c ++++ b/wpa_supplicant/config.c +@@ -1923,6 +1923,71 @@ static char * wpa_config_write_mcast_rat + } + #endif /* NO_CONFIG_WRITE */ + ++static int wpa_config_parse_htmode(const struct parse_data *data, ++ struct wpa_ssid *ssid, int line, ++ const char *value) ++{ ++ int i; ++ static const struct { ++ const char *name; ++ unsigned int val; ++ } htmap[] = { ++ { .name = "HT20", .val = NL80211_CHAN_HT20, }, ++ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, }, ++ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, }, ++ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, }, ++ }; ++ ssid->ht_set = 0;; ++ for (i = 0; i < 4; i++) { ++ if (strcasecmp(htmap[i].name, value) == 0) { ++ ssid->htmode = htmap[i].val; ++ ssid->ht_set = 1; ++ break; ++ } ++ } ++ ++ return 0; ++} ++ ++#ifndef NO_CONFIG_WRITE ++static char * wpa_config_write_htmode(const struct parse_data *data, ++ struct wpa_ssid *ssid) ++{ ++ char *value; ++ int res; ++ ++ value = os_malloc(6); /* longest: HT40+ */ ++ if (value == NULL) ++ return NULL; ++ ++ switch(ssid->htmode) { ++ case NL80211_CHAN_HT20: ++ res = os_snprintf(value, 4, "HT20"); ++ break; ++ case NL80211_CHAN_HT40PLUS: ++ res = os_snprintf(value, 5, "HT40+"); ++ break; ++ case NL80211_CHAN_HT40MINUS: ++ res = os_snprintf(value, 5, "HT40-"); ++ break; ++ case NL80211_CHAN_NO_HT: ++ res = os_snprintf(value, 4, "NOHT"); ++ break; ++ default: ++ os_free(value); ++ return NULL; ++ } ++ ++ if (res < 0) { ++ os_free(value); ++ return NULL; ++ } ++ ++ return value; ++} ++#endif /* NO_CONFIG_WRITE */ ++ ++ + static int wpa_config_parse_rates(const struct parse_data *data, + struct wpa_ssid *ssid, int line, + const char *value) +@@ -2218,6 +2283,7 @@ static const struct parse_data ssid_fiel + { INT_RANGE(fixed_freq, 0, 1) }, + { FUNC(rates) }, + { FUNC(mcast_rate) }, ++ { FUNC(htmode) }, + #ifdef CONFIG_MACSEC + { INT_RANGE(macsec_policy, 0, 1) }, + { INT_RANGE(macsec_integ_only, 0, 1) }, +--- a/wpa_supplicant/config_ssid.h ++++ b/wpa_supplicant/config_ssid.h +@@ -723,6 +723,8 @@ struct wpa_ssid { + + unsigned char rates[WLAN_SUPP_RATES_MAX]; + double mcast_rate; ++ int ht_set; ++ unsigned int htmode; + + #ifdef CONFIG_MACSEC + /** +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2568,6 +2568,8 @@ static void wpas_start_assoc_cb(struct w + i++; + } + params.mcast_rate = ssid->mcast_rate; ++ params.ht_set = ssid->ht_set; ++ params.htmode = ssid->htmode; + } + + params.wpa_ie = wpa_ie; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index 9b5ee4bbb..da146ba55 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1424,6 +1424,7 @@ struct wpa_driver_mesh_join_params { +@@ -1426,6 +1426,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -8997,6 +8997,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9039,6 +9051,7 @@ static int nl80211_join_mesh(struct i802 +@@ -9055,6 +9067,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch deleted file mode 100644 index 383353948..000000000 --- a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2010,11 +2010,13 @@ void ibss_mesh_setup_freq(struct wpa_sup - for (j = 0; j < wpa_s->last_scan_res_used; j++) { - struct wpa_bss *bss = wpa_s->last_scan_res[j]; - -- if (ssid->mode != WPAS_MODE_IBSS) -+ /* Don't adjust control freq in case of fixed_freq */ -+ if (ssid->fixed_freq) { -+ obss_scan = 0; - break; -+ } - -- /* Don't adjust control freq in case of fixed_freq */ -- if (ssid->fixed_freq) -+ if (ssid->mode != WPAS_MODE_IBSS) - break; - - if (!bss_is_ibss(bss)) diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch index 1c094bed2..4e40a8755 100644 --- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch +++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -392,20 +386,19 @@ static int acs_usable_vht80_chan(struct +@@ -395,20 +389,19 @@ static int acs_usable_vht80_chan(struct static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index 8f14f125d..dd962b47a 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -22,7 +22,7 @@ struct wpa_ctrl_dst; struct radius_server_data; -@@ -122,6 +123,7 @@ struct hostapd_data { +@@ -119,6 +120,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -30,7 +30,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -370,6 +372,8 @@ struct hostapd_iface { +@@ -328,6 +330,8 @@ struct hostapd_iface { struct hostapd_config *conf; char phy[16]; /* Name of the PHY (radio) */ @@ -41,7 +41,7 @@ HAPD_IFACE_DISABLED, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc +@@ -302,6 +302,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -49,7 +49,7 @@ iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); -@@ -1186,6 +1187,8 @@ static int hostapd_setup_bss(struct host +@@ -1160,6 +1161,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -58,7 +58,7 @@ return 0; } -@@ -1711,6 +1714,7 @@ static int hostapd_setup_interface_compl +@@ -1683,6 +1686,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -66,7 +66,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME -@@ -1890,6 +1894,7 @@ dfs_offload: +@@ -1862,6 +1866,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -74,7 +74,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2344,6 +2349,7 @@ void hostapd_interface_deinit_free(struc +@@ -2310,6 +2315,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -84,7 +84,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap +@@ -1293,7 +1293,8 @@ void ieee802_11_finish_fils_auth(struct static void handle_auth(struct hostapd_data *hapd, @@ -94,7 +94,7 @@ { u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; -@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d +@@ -1309,6 +1310,11 @@ static void handle_auth(struct hostapd_d char *identity = NULL; char *radius_cui = NULL; u16 seq_ctrl; @@ -104,22 +104,24 @@ + .frame_info = fi, + }; - if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { - wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", -@@ -1757,6 +1763,12 @@ static void handle_auth(struct hostapd_d + os_memset(&vlan_id, 0, sizeof(vlan_id)); + +@@ -1466,6 +1472,14 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } ++ + if (hostapd_ubus_handle_event(hapd, &req)) { + wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n", -+ MAC2STR(mgmt->sa)); ++ MAC2STR(mgmt->sa)); + resp = WLAN_STATUS_UNSPECIFIED_FAILURE; + goto fail; + } - if (res == HOSTAPD_ACL_PENDING) - return; - -@@ -2870,7 +2882,7 @@ void fils_hlp_timeout(void *eloop_ctx, v ++ + if (res == HOSTAPD_ACL_PENDING) { + wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR + " waiting for an external authentication", +@@ -2401,7 +2415,7 @@ static u16 send_assoc_resp(struct hostap static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -128,10 +130,10 @@ { u16 capab_info, listen_interval, seq_ctrl, fc; u16 resp = WLAN_STATUS_SUCCESS, reply_res; -@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_ - #ifdef CONFIG_FILS - int delay_assoc = 0; - #endif /* CONFIG_FILS */ +@@ -2409,6 +2423,11 @@ static void handle_assoc(struct hostapd_ + int left, i; + struct sta_info *sta; + u8 *tmp = NULL; + struct hostapd_ubus_request req = { + .type = HOSTAPD_UBUS_ASSOC_REQ, + .mgmt_frame = mgmt, @@ -140,7 +142,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -3051,6 +3068,13 @@ static void handle_assoc(struct hostapd_ +@@ -2528,6 +2547,13 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_MBO */ @@ -154,24 +156,7 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3258,6 +3282,7 @@ static void handle_disassoc(struct hosta - wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", - MAC2STR(mgmt->sa), - le_to_host16(mgmt->u.disassoc.reason_code)); -+ hostapd_ubus_notify(hapd, "disassoc", mgmt->sa); - - sta = ap_get_sta(hapd, mgmt->sa); - if (sta == NULL) { -@@ -3323,6 +3348,8 @@ static void handle_deauth(struct hostapd - " reason_code=%d", - MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); - -+ hostapd_ubus_notify(hapd, "deauth", mgmt->sa); -+ - sta = ap_get_sta(hapd, mgmt->sa); - if (sta == NULL) { - wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " -@@ -3637,7 +3664,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3035,7 +3061,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -180,7 +165,7 @@ return 1; } -@@ -3657,17 +3684,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3053,17 +3079,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); @@ -203,7 +188,7 @@ case WLAN_FC_STYPE_DISASSOC: --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc +@@ -702,7 +702,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -212,7 +197,7 @@ { u8 *resp; struct ieee802_11_elems elems; -@@ -725,9 +725,15 @@ void handle_probe_req(struct hostapd_dat +@@ -711,9 +711,15 @@ void handle_probe_req(struct hostapd_dat size_t i, resp_len; int noack; enum ssid_match_result res; @@ -228,7 +213,7 @@ if (len < IEEE80211_HDRLEN) return; -@@ -894,6 +900,12 @@ void handle_probe_req(struct hostapd_dat +@@ -880,6 +886,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -254,7 +239,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface); --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -52,6 +52,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -265,7 +250,7 @@ if (addr == NULL) { /* -@@ -195,6 +199,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -131,6 +135,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -278,39 +263,3 @@ #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); ---- a/src/ap/sta_info.c -+++ b/src/ap/sta_info.c -@@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo - HOSTAPD_LEVEL_INFO, "deauthenticated due to " - "local deauth request"); - ap_free_sta(hapd, sta); -+ hostapd_ubus_notify(hapd, "local-deauth", sta->addr); - return; - } - -@@ -551,6 +552,7 @@ skip_poll: - hapd, sta, - WLAN_REASON_PREV_AUTH_NOT_VALID); - ap_free_sta(hapd, sta); -+ hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr); - break; - } - } -@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap - buf, ip_addr); - } else { - wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); -+ hostapd_ubus_notify(hapd, "disassoc", sta->addr); - - if (hapd->msg_ctx_parent && - hapd->msg_ctx_parent != hapd->msg_ctx) ---- a/src/ap/wpa_auth_glue.c -+++ b/src/ap/wpa_auth_glue.c -@@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure - struct hostapd_data *hapd = ctx; - wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, - MAC2STR(addr)); -+ hostapd_ubus_notify(hapd, "key-mismatch", addr); - } - - diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index beb4388f7..c24f63fd8 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -9,10 +9,8 @@ #include "utils/includes.h" #include "utils/common.h" #include "utils/eloop.h" -#include "utils/wpabuf.h" #include "common/ieee802_11_defs.h" #include "hostapd.h" -#include "neighbor_db.h" #include "wps_hostapd.h" #include "sta_info.h" #include "ubus.h" @@ -184,37 +182,6 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, return 0; } -enum { - NOTIFY_RESPONSE, - __NOTIFY_MAX -}; - -static const struct blobmsg_policy notify_policy[__NOTIFY_MAX] = { - [NOTIFY_RESPONSE] = { "notify_response", BLOBMSG_TYPE_INT32 }, -}; - -static int -hostapd_notify_response(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct blob_attr *tb[__NOTIFY_MAX]; - struct hostapd_data *hapd = get_hapd_from_object(obj); - struct wpabuf *elems; - const char *pos; - size_t len; - - blobmsg_parse(notify_policy, __NOTIFY_MAX, tb, - blob_data(msg), blob_len(msg)); - - if (!tb[NOTIFY_RESPONSE]) - return UBUS_STATUS_INVALID_ARGUMENT; - - hapd->ubus.notify_response = blobmsg_get_u32(tb[NOTIFY_RESPONSE]); - - return UBUS_STATUS_OK; -} - enum { DEL_CLIENT_ADDR, DEL_CLIENT_REASON, @@ -449,170 +416,6 @@ hostapd_vendor_elements(struct ubus_context *ctx, struct ubus_object *obj, return UBUS_STATUS_OK; } -static void -hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr) -{ - const u8 *data; - char *str; - int len; - - blobmsg_printf(&b, "", MACSTR, MAC2STR(nr->bssid)); - - str = blobmsg_alloc_string_buffer(&b, "", nr->ssid.ssid_len + 1); - memcpy(str, nr->ssid.ssid, nr->ssid.ssid_len); - str[nr->ssid.ssid_len] = 0; - blobmsg_add_string_buffer(&b); - - len = wpabuf_len(nr->nr); - str = blobmsg_alloc_string_buffer(&b, "", 2 * len + 1); - wpa_snprintf_hex(str, 2 * len + 1, wpabuf_head_u8(nr->nr), len); - blobmsg_add_string_buffer(&b); -} - -static int -hostapd_rrm_nr_get_own(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct hostapd_data *hapd = get_hapd_from_object(obj); - struct hostapd_neighbor_entry *nr; - void *c; - - if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) - return UBUS_STATUS_NOT_SUPPORTED; - - nr = hostapd_neighbor_get(hapd, hapd->own_addr, NULL); - if (!nr) - return UBUS_STATUS_NOT_FOUND; - - blob_buf_init(&b, 0); - - c = blobmsg_open_array(&b, "value"); - hostapd_rrm_print_nr(nr); - blobmsg_close_array(&b, c); - - ubus_send_reply(ctx, req, b.head); - - return 0; -} - -static int -hostapd_rrm_nr_list(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - struct hostapd_data *hapd = get_hapd_from_object(obj); - struct hostapd_neighbor_entry *nr; - void *c; - - if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) - return UBUS_STATUS_NOT_SUPPORTED; - - blob_buf_init(&b, 0); - - c = blobmsg_open_array(&b, "list"); - dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { - void *cur; - - if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) - continue; - - cur = blobmsg_open_array(&b, NULL); - hostapd_rrm_print_nr(nr); - blobmsg_close_array(&b, cur); - } - blobmsg_close_array(&b, c); - - ubus_send_reply(ctx, req, b.head); - - return 0; -} - -enum { - NR_SET_LIST, - __NR_SET_LIST_MAX -}; - -static const struct blobmsg_policy nr_set_policy[__NR_SET_LIST_MAX] = { - [NR_SET_LIST] = { "list", BLOBMSG_TYPE_ARRAY }, -}; - - -static void -hostapd_rrm_nr_clear(struct hostapd_data *hapd) -{ - struct hostapd_neighbor_entry *nr; - -restart: - dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { - if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) - continue; - - hostapd_neighbor_remove(hapd, nr->bssid, &nr->ssid); - goto restart; - } -} - -static int -hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, - struct ubus_request_data *req, const char *method, - struct blob_attr *msg) -{ - static const struct blobmsg_policy nr_e_policy[] = { - { .type = BLOBMSG_TYPE_STRING }, - { .type = BLOBMSG_TYPE_STRING }, - { .type = BLOBMSG_TYPE_STRING }, - }; - struct hostapd_data *hapd = get_hapd_from_object(obj); - struct blob_attr *tb_l[__NR_SET_LIST_MAX]; - struct blob_attr *tb[ARRAY_SIZE(nr_e_policy)]; - struct blob_attr *cur; - int ret = 0; - int rem; - - if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) - return UBUS_STATUS_NOT_SUPPORTED; - - blobmsg_parse(nr_set_policy, __NR_SET_LIST_MAX, tb_l, blob_data(msg), blob_len(msg)); - if (!tb_l[NR_SET_LIST]) - return UBUS_STATUS_INVALID_ARGUMENT; - - hostapd_rrm_nr_clear(hapd); - blobmsg_for_each_attr(cur, tb_l[NR_SET_LIST], rem) { - struct wpa_ssid_value ssid; - struct wpabuf *data; - u8 bssid[ETH_ALEN]; - char *s; - - blobmsg_parse_array(nr_e_policy, ARRAY_SIZE(nr_e_policy), tb, blobmsg_data(cur), blobmsg_data_len(cur)); - if (!tb[0] || !tb[1] || !tb[2]) - goto invalid; - - s = blobmsg_get_string(tb[0]); - if (hwaddr_aton(s, bssid)) - goto invalid; - - s = blobmsg_get_string(tb[1]); - ssid.ssid_len = strlen(s); - if (ssid.ssid_len > sizeof(ssid.ssid)) - goto invalid; - - memcpy(&ssid, s, ssid.ssid_len); - data = wpabuf_parse_bin(blobmsg_get_string(tb[2])); - if (!data) - goto invalid; - - hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0); - wpabuf_free(data); - continue; - -invalid: - ret = UBUS_STATUS_INVALID_ARGUMENT; - } - - return 0; -} - static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("get_clients", hostapd_bss_get_clients), UBUS_METHOD("del_client", hostapd_bss_del_client, del_policy), @@ -624,10 +427,6 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD("switch_chan", hostapd_switch_chan, csa_policy), #endif UBUS_METHOD("set_vendor_elements", hostapd_vendor_elements, ve_policy), - UBUS_METHOD("notify_response", hostapd_notify_response, notify_policy), - UBUS_METHOD_NOARG("rrm_nr_get_own", hostapd_rrm_nr_get_own), - UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list), - UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy), }; static struct ubus_object_type bss_object_type = @@ -724,11 +523,6 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req blobmsg_add_u32(&b, "signal", req->frame_info->ssi_signal); blobmsg_add_u32(&b, "freq", hapd->iface->freq); - if (!hapd->ubus.notify_response) { - ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); - return 0; - } - if (ubus_notify_async(ctx, &hapd->ubus.obj, type, b.head, &ureq.nreq)) return 0; @@ -740,17 +534,3 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req return 0; } - -void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr) -{ - if (!hapd->ubus.obj.has_subscribers) - return; - - if (!addr) - return; - - blob_buf_init(&b, 0); - blobmsg_add_macaddr(&b, "address", addr); - - ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); -} diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index e3ff981c7..479ddfca7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -37,7 +37,6 @@ struct hostapd_ubus_iface { struct hostapd_ubus_bss { struct ubus_object obj; struct avl_tree banned; - int notify_response; }; void hostapd_ubus_add_iface(struct hostapd_iface *iface); @@ -46,7 +45,6 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd); void hostapd_ubus_free_bss(struct hostapd_data *hapd); int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req); -void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac); #else @@ -75,9 +73,6 @@ static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct ho return 0; } -static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac) -{ -} #endif #endif diff --git a/package/network/services/ipset-dns/Makefile b/package/network/services/ipset-dns/Makefile index 3f21d04c4..2adc9fe03 100644 --- a/package/network/services/ipset-dns/Makefile +++ b/package/network/services/ipset-dns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=http://git.zx2c4.com/ipset-dns -PKG_SOURCE_DATE:=2017-10-08 -PKG_SOURCE_VERSION:=ade2cf88e933f4f90451e0a6171f0aa4a523f989 -PKG_MIRROR_HASH:=34ad1f5c7d2eab90b795f2a512102891428216e3d439d918a8992846550e9697 +PKG_SOURCE_DATE:=2013-05-03 +PKG_SOURCE_VERSION:=6be3afd819a86136b51c5ae722ab48266187155b +PKG_MIRROR_HASH:=4e34943b547babe705c2fad295ee24a5ee0c93ca03e2a9cdeaf323150f97e60b PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch b/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch new file mode 100644 index 000000000..19669a05b --- /dev/null +++ b/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch @@ -0,0 +1,57 @@ +--- a/ipset-dns.c ++++ b/ipset-dns.c +@@ -307,19 +307,20 @@ int main(int argc, char *argv[]) + struct timeval tv; + char msg[512]; + char ip[INET6_ADDRSTRLEN]; +- char *ipset; ++ char *ipset, *ipset6; + int listen_sock, upstream_sock; + int pos, i, size, af; + socklen_t len; + size_t received; + pid_t child; + +- if (argc != 4) { +- fprintf(stderr, "Usage: %s ipset port upstream\n", argv[0]); ++ if (argc != 5) { ++ fprintf(stderr, "Usage: %s ipv4-ipset ipv6-ipset port upstream\n", argv[0]); + return 1; + } + + ipset = argv[1]; ++ ipset6 = argv[2]; + + listen_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); + if (listen_sock < 0) { +@@ -329,7 +330,7 @@ int main(int argc, char *argv[]) + + memset(&listen_addr, 0, sizeof(listen_addr)); + listen_addr.sin_family = AF_INET; +- listen_addr.sin_port = htons(atoi(argv[2])); ++ listen_addr.sin_port = htons(atoi(argv[3])); + listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); + i = 1; + setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)); +@@ -341,7 +342,7 @@ int main(int argc, char *argv[]) + memset(&upstream_addr, 0, sizeof(upstream_addr)); + upstream_addr.sin_family = AF_INET; + upstream_addr.sin_port = htons(53); +- inet_aton(argv[3], &upstream_addr.sin_addr); ++ inet_aton(argv[4], &upstream_addr.sin_addr); + + /* TODO: Put all of the below code in several forks all listening on the same sock. */ + +@@ -434,8 +435,11 @@ int main(int argc, char *argv[]) + continue; + } + ++ if ((af == AF_INET && !*ipset) || (af == AF_INET6 && !*ipset6)) ++ continue; ++ + printf("%s: %s\n", answer.dotted, ip); +- if (add_to_ipset(ipset, answer.rdata, af) < 0) ++ if (add_to_ipset((af == AF_INET) ? ipset : ipset6, answer.rdata, af) < 0) + perror("add_to_ipset"); + } + diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index cdd8f99d5..344d682ad 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=0.9.9 +PKG_VERSION:=0.9.7 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd -PKG_HASH:=5e9e08f500d21376631cbc9f8e19a4b167cd38eb2d8fd9e660b8e80507f802db +PKG_HASH:=b9360355c30a3c06fd5c0a6e658f2ad8bf77037d5a17c6fcabf20e62882e0db8 PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=ISC diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config index 36b43c89d..d2b3d1545 100644 --- a/package/network/services/lldpd/files/lldpd.config +++ b/package/network/services/lldpd/files/lldpd.config @@ -10,7 +10,7 @@ config lldpd config option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" # if empty, the distribution description is sent - #option lldp_description "OpenWrt System" + #option lldp_description "Lede System" # interfaces to listen on list interface "loopback" diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index c3d9ba050..39bce989b 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -16,7 +16,7 @@ find_release_info() [ -z "$PRETTY_NAME" ] && [ -s /etc/openwrt_version ] && \ PRETTY_NAME="$(cat /etc/openwrt_version)" - echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)" + echo "${PRETTY_NAME:-Unknown Lede release} @ $(cat /proc/sys/kernel/hostname)" } write_lldpd_conf() diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 2a22cd874..5ba9e7c7e 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -8,95 +8,54 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd -PKG_RELEASE:=1 -PKG_VERSION:=1.3 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2017-12-22 -PKG_SOURCE_VERSION:=7aa2594c5a127d92fa8f04328ac7b43e595bcaa7 -PKG_MIRROR_HASH:=67ce9303ce2f7a47ca9c54e1ebd984f108066ab0fa4e0d81f39a9cfc2431f90b +PKG_SOURCE_DATE:=2017-10-02 +PKG_SOURCE_VERSION:=c6f3d5d4ea5154e5971fa0b1b1e9a9c07119429f +PKG_MIRROR_HASH:=5ce8f52b5c6acea27d9733918e9c3bc8a154d516a02eef9b172c5e3d459f494c PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_INSTALL:=1 -PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -define Package/odhcpd/default +CMAKE_OPTIONS += -DUBUS=1 + +ifneq ($(CONFIG_PACKAGE_odhcpd_ext_cer_id),0) + CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_ext_cer_id) +endif + + +define Package/odhcpd SECTION:=net CATEGORY:=Network - TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay + TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay DEPENDS:=+libubox +libuci +libubus +libnl-tiny endef -define Package/odhcpd/default/description +define Package/odhcpd/config + config PACKAGE_odhcpd_ext_cer_id + int "CER-ID Extension ID (0 = disabled)" + depends on PACKAGE_odhcpd + default 0 +endef + +define Package/odhcpd/description odhcpd is a daemon for serving and relaying IP management protocols to configure clients and downstream routers. It tries to follow the RFC 6204 requirements for IPv6 home routers. + + odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6, + prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed + (non-bridged) interfaces in case no delegated prefixes are available. endef -define Package/odhcpd/default/config -menu "Configuration" - depends on PACKAGE_$(1) - -config PACKAGE_odhcpd_$(2)_ext_cer_id - int - default 0 - prompt "CER-ID Extension ID (0 = disabled)" -endmenu -endef - -define Package/odhcpd - $(call Package/odhcpd/default) - TITLE += and DHCPv4 server - VARIANT:=full -endef - -Package/odhcpd/config=$(call Package/odhcpd/default/config,odhcpd,full) - -define Package/odhcpd/description - $(call Package/odhcpd/default/description) - - This is a variant providing server services for DHCPv4, RA, stateless and - stateful DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and - NDP between routed (non-bridged) interfaces in case no delegated prefixes - are available. -endef - -define Package/odhcpd-ipv6only - $(call Package/odhcpd/default) - VARIANT:=ipv6only -endef - -Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only) - -define Package/odhcpd-ipv6only/description - $(call Package/odhcpd/default/description) - - This is a variant providing server services for RA, stateless and stateful - DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and NDP between - routed (non-bridged) interfaces in case no delegated prefixes are available. -endef - -CMAKE_OPTIONS += -DUBUS=1 - -ifeq ($(BUILD_VARIANT),full) - CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1 -endif - -ifneq ($(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id),0) - CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id) -endif - define Package/odhcpd/install $(INSTALL_DIR) $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcpd $(1)/usr/sbin/ $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd @@ -104,7 +63,4 @@ define Package/odhcpd/install $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults endef -Package/odhcpd-ipv6only/install = $(Package/odhcpd/install) - $(eval $(call BuildPackage,odhcpd)) -$(eval $(call BuildPackage,odhcpd-ipv6only)) diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index cecbdd4a8..175e56e9b 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -22,7 +22,6 @@ set dhcp.odhcpd=odhcpd set dhcp.odhcpd.maindhcp=0 set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update -set dhcp.odhcpd.loglevel=4 set dhcp.lan.dhcpv6=$MODE set dhcp.lan.ra=$MODE commit dhcp diff --git a/package/network/services/openvpn-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile index f4b479986..5b7d9be21 100644 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ b/package/network/services/openvpn-easy-rsa/Makefile @@ -9,18 +9,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn-easy-rsa -PKG_VERSION:=3.0.1 -PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/$(PKG_VERSION)/ -PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz -PKG_HASH:=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e +PKG_RELEASE=2 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa.git +PKG_SOURCE_DATE:=2013-01-30 +PKG_SOURCE_VERSION:=ff5bfd1dd8e548cb24d302742af3894f893ef92f +PKG_MIRROR_HASH:=c87704b3906a0c14f51c6677151a9389f698523c7ec07f7c75489ca31786f128 PKG_LICENSE:=GPL-2.0 -PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk define Package/openvpn-easy-rsa - TITLE:=CLI utility to build and manage a PKI CA. + TITLE:=Simple shell scripts to manage a Certificate Authority SECTION:=net CATEGORY:=Network URL:=http://openvpn.net @@ -29,8 +30,9 @@ define Package/openvpn-easy-rsa endef define Package/openvpn-easy-rsa/conffiles +/etc/easy-rsa/keys/serial +/etc/easy-rsa/keys/index.txt /etc/easy-rsa/vars -/etc/easy-rsa/openssl-1.0.cnf endef define Build/Configure @@ -43,24 +45,13 @@ endef define Package/openvpn-easy-rsa/install $(INSTALL_DIR) $(1)/usr/sbin - - $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/sbin/ + $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars - - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki - chmod 700 $(1)/etc/easy-rsa/pki - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/private - chmod 700 $(1)/etc/easy-rsa/pki/private - $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/reqs - chmod 700 $(1)/etc/easy-rsa/pki/reqs - - $(INSTALL_DIR) $(1)/etc/easy-rsa/x509-types - $(INSTALL_DATA) $(PKG_BUILD_DIR)/x509-types/* $(1)/etc/easy-rsa/x509-types/ - - $(INSTALL_DIR) $(1)/lib/upgrade/keep.d - $(INSTALL_DATA) files/openvpn-easy-rsa.upgrade $(1)/lib/upgrade/keep.d/$(PKG_NAME) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars + $(INSTALL_DIR) $(1)/etc/easy-rsa/keys + $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt + $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial endef $(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.index b/package/network/services/openvpn-easy-rsa/files/easy-rsa.index new file mode 100644 index 000000000..e69de29bb diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial b/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial new file mode 100644 index 000000000..8a0f05e16 --- /dev/null +++ b/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial @@ -0,0 +1 @@ +01 diff --git a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade deleted file mode 100644 index 8110b81a4..000000000 --- a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade +++ /dev/null @@ -1 +0,0 @@ -/etc/easy-rsa/pki/ diff --git a/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch b/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch new file mode 100644 index 000000000..4c1b889e3 --- /dev/null +++ b/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch @@ -0,0 +1,152 @@ +--- a/easy-rsa/2.0/build-ca ++++ b/easy-rsa/2.0/build-ca +@@ -5,4 +5,4 @@ + # + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --initca $* ++"/usr/sbin/pkitool" --interact --initca $* +--- a/easy-rsa/2.0/build-dh ++++ b/easy-rsa/2.0/build-dh +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Build Diffie-Hellman parameters for the server side + # of an SSL/TLS connection. + +--- a/easy-rsa/2.0/build-inter ++++ b/easy-rsa/2.0/build-inter +@@ -4,4 +4,4 @@ + # root certificate. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --inter $* ++"/usr/sbin/pkitool" --interact --inter $* +--- a/easy-rsa/2.0/build-key ++++ b/easy-rsa/2.0/build-key +@@ -4,4 +4,4 @@ + # root certificate. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact $* ++"/usr/sbin/pkitool" --interact $* +--- a/easy-rsa/2.0/build-key-pass ++++ b/easy-rsa/2.0/build-key-pass +@@ -4,4 +4,4 @@ + # with a password. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --pass $* ++"/usr/sbin/pkitool" --interact --pass $* +--- a/easy-rsa/2.0/build-key-pkcs12 ++++ b/easy-rsa/2.0/build-key-pkcs12 +@@ -5,4 +5,4 @@ + # the CA certificate as well. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --pkcs12 $* ++"/usr/sbin/pkitool" --interact --pkcs12 $* +--- a/easy-rsa/2.0/build-key-server ++++ b/easy-rsa/2.0/build-key-server +@@ -7,4 +7,4 @@ + # extension in the openssl.cnf file. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --server $* ++"/usr/sbin/pkitool" --interact --server $* +--- a/easy-rsa/2.0/build-req ++++ b/easy-rsa/2.0/build-req +@@ -4,4 +4,4 @@ + # when your root certificate and key is not available locally. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --csr $* ++"/usr/sbin/pkitool" --interact --csr $* +--- a/easy-rsa/2.0/build-req-pass ++++ b/easy-rsa/2.0/build-req-pass +@@ -4,4 +4,4 @@ + # with a password. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --csr --pass $* ++"/usr/sbin/pkitool" --interact --csr --pass $* +--- a/easy-rsa/2.0/clean-all ++++ b/easy-rsa/2.0/clean-all +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Initialize the $KEY_DIR directory. + # Note that this script does a + # rm -rf on $KEY_DIR so be careful! +--- a/easy-rsa/2.0/inherit-inter ++++ b/easy-rsa/2.0/inherit-inter +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # Build a new PKI which is rooted on an intermediate certificate generated + # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should + # have independent vars settings, and must use a different KEY_DIR directory +--- a/easy-rsa/2.0/list-crl ++++ b/easy-rsa/2.0/list-crl +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # list revoked certificates + + CRL="${1:-crl.pem}" +--- a/easy-rsa/2.0/pkitool ++++ b/easy-rsa/2.0/pkitool +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # OpenVPN -- An application to securely tunnel IP networks + # over a single TCP/UDP port, with support for SSL/TLS-based + # session authentication and key exchange, +--- a/easy-rsa/2.0/revoke-full ++++ b/easy-rsa/2.0/revoke-full +@@ -1,5 +1,7 @@ + #!/bin/sh + ++. /etc/easy-rsa/vars ++ + # revoke a certificate, regenerate CRL, + # and verify revocation + +--- a/easy-rsa/2.0/sign-req ++++ b/easy-rsa/2.0/sign-req +@@ -4,4 +4,4 @@ + # with a local root certificate and key. + + export EASY_RSA="${EASY_RSA:-.}" +-"$EASY_RSA/pkitool" --interact --sign $* ++"/usr/sbin/pkitool" --interact --sign $* +--- a/easy-rsa/2.0/vars ++++ b/easy-rsa/2.0/vars +@@ -12,7 +12,7 @@ + # This variable should point to + # the top level of the easy-rsa + # tree. +-export EASY_RSA="`pwd`" ++export EASY_RSA="/etc/easy-rsa" + + # + # This variable should point to +@@ -26,7 +26,7 @@ + # This variable should point to + # the openssl.cnf file included + # with easy-rsa. +-export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA` ++export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA` + + # Edit this variable to point to + # your soon-to-be-created key diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index ec48e734f..fee0296ed 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -25,7 +25,6 @@ PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:openvpn:openvpn include $(INCLUDE_DIR)/package.mk diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 282e8f17f..6c615cab0 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -35,7 +35,7 @@ endef define Package/ppp $(call Package/ppp/Default) - DEPENDS:=+kmod-ppp +libpthread +shellsync + DEPENDS:=+kmod-ppp TITLE:=PPP daemon VARIANT:=default endef diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 875714b35..73bc3161c 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -223,16 +223,7 @@ proto_pppoe_setup() { json_get_var service service json_get_var host_uniq host_uniq -#By èˆèˆï¼šå¹¶å‘拨å·åŒæ­¥çš„å‰æœŸå‡†å¤‡ - syncppp_option="" - [ "$(uci get syncdial.config.enabled)" == "1" ] && { - ppp_if_cnt=$(cat /etc/config/network | grep -c "proto 'pppoe'") - syncppp_option="syncppp $ppp_if_cnt" - shellsync $ppp_if_cnt 10 - } - ppp_generic_setup "$config" \ - $syncppp_option \ plugin rp-pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \ diff --git a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch index d9c9b83a3..2983a75c4 100644 --- a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch +++ b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch @@ -1,27 +1,23 @@ +--- a/pppd/plugins/rp-pppoe/plugin.c ++++ b/pppd/plugins/rp-pppoe/plugin.c +@@ -46,10 +46,10 @@ static char const RCSID[] = + #include + #include + #include +-#include + #include + #include + #include ++#include + + #ifndef _ROOT_PATH + #define _ROOT_PATH "" --- a/pppd/plugins/rp-pppoe/pppoe.h +++ b/pppd/plugins/rp-pppoe/pppoe.h -@@ -48,11 +48,7 @@ - #endif +@@ -86,17 +86,6 @@ typedef unsigned long UINT32_t; - /* Ugly header files on some Linux boxes... */ --#if defined(HAVE_LINUX_IF_H) --#include --#elif defined(HAVE_NET_IF_H) - #include --#endif - - #ifdef HAVE_NET_IF_TYPES_H - #include -@@ -80,22 +76,8 @@ typedef unsigned long UINT32_t; - #error Could not find a 32-bit integer type - #endif - --#ifdef HAVE_LINUX_IF_ETHER_H --#include --#endif -- #include -- + -#ifdef HAVE_NETINET_IF_ETHER_H -#include - @@ -32,10 +28,21 @@ -#include -#endif -#endif -+#include +- + /* Ethernet frame types according to RFC 2516 */ +--- a/pppd/plugins/rp-pppoe/if.c ++++ b/pppd/plugins/rp-pppoe/if.c +@@ -31,7 +31,7 @@ static char const RCSID[] = + #endif + #ifdef HAVE_NET_ETHERNET_H +-#include ++#include + #endif + + #ifdef HAVE_ASM_TYPES_H --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c @@ -16,6 +16,7 @@ @@ -46,7 +53,18 @@ #ifdef HAVE_UNISTD_H #include -@@ -717,6 +718,23 @@ char *xstrdup(const char *s) +@@ -27,10 +28,6 @@ + #include + #endif + +-#ifdef HAVE_NET_ETHERNET_H +-#include +-#endif +- + #ifdef HAVE_ASM_TYPES_H + #include + #endif +@@ -717,6 +714,23 @@ char *xstrdup(const char *s) return ret; } diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index d984e1b16..5ed861d54 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1064,7 +1064,7 @@ + struct in_addr localbind); --- /dev/null +++ b/pppd/plugins/pptp/pptp_ctrl.c -@@ -0,0 +1,1077 @@ +@@ -0,0 +1,1078 @@ +/* pptp_ctrl.c ... handle PPTP control connection. + * C. Scott Ananian + * @@ -1083,6 +1083,7 @@ +#include +#include +#include ++#include "pppd.h" +#include "pptp_msg.h" +#include "pptp_ctrl.h" +#include "pptp_options.h" diff --git a/package/network/services/ppp/patches/511-syncppp.patch b/package/network/services/ppp/patches/511-syncppp.patch deleted file mode 100644 index fe58b8cc8..000000000 --- a/package/network/services/ppp/patches/511-syncppp.patch +++ /dev/null @@ -1,214 +0,0 @@ -diff -Naur ppp-2.4.5.0/pppd/chap-new.c ppp-2.4.5/pppd/chap-new.c ---- ppp-2.4.5.0/pppd/chap-new.c 2012-04-18 15:44:46.000000000 +0800 -+++ ppp-2.4.5/pppd/chap-new.c 2012-04-19 20:24:28.000000000 +0800 -@@ -37,6 +37,8 @@ - #include "chap-new.h" - #include "chap-md5.h" - -+#include "syncppp.h" -+ - #ifdef CHAPMS - #include "chap_ms.h" - #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) -@@ -481,6 +483,19 @@ - p[2] = len >> 8; - p[3] = len; - -+ if (npppd > 1) { -+ if (syncppp(npppd) < 0) { -+ error("syncppp sync fail"); -+ sem_unlink(SEM_COUNT_NAME); -+ sem_unlink(SEM_BLOCK_NAME); -+ } else { -+ info("syncppp sync succeeded"); -+ } -+ } else { -+ info("syncppp not active"); -+ } -+ -+ - output(0, response, PPP_HDRLEN + len); - } - -diff -Naur ppp-2.4.5.0/pppd/Makefile.linux ppp-2.4.5/pppd/Makefile.linux ---- ppp-2.4.5.0/pppd/Makefile.linux 2012-04-18 15:44:46.000000000 +0800 -+++ ppp-2.4.5/pppd/Makefile.linux 2012-04-19 20:01:05.000000000 +0800 -@@ -13,16 +13,16 @@ - - PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \ - ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \ -- demand.c utils.c tty.c eap.c chap-md5.c session.c -+ demand.c utils.c tty.c eap.c chap-md5.c session.c syncppp.c - - HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \ - ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \ -- upap.h eap.h -+ upap.h eap.h syncppp.h - - MANPAGES = pppd.8 - PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \ - ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \ -- eap.o chap-md5.o session.o -+ eap.o chap-md5.o session.o syncppp.o - - # - # include dependencies if present -@@ -33,7 +33,7 @@ - # CC = gcc - # - COPTS = -O2 -pipe -Wall -g --LIBS = -+LIBS = -lpthread - - # Uncomment the next 2 lines to include support for Microsoft's - # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. -diff -Naur ppp-2.4.5.0/pppd/options.c ppp-2.4.5/pppd/options.c ---- ppp-2.4.5.0/pppd/options.c 2012-04-18 15:44:46.000000000 +0800 -+++ ppp-2.4.5/pppd/options.c 2012-04-19 20:24:49.000000000 +0800 -@@ -126,6 +126,7 @@ - bool dryrun; /* print out option values and exit */ - char *domain; /* domain name set by domain option */ - int child_wait = 5; /* # seconds to wait for children at exit */ -+int npppd = 0; /* synchronize between multiple pppd */ - struct userenv *userenv_list; /* user environment variables */ - - #ifdef MAXOCTETS -@@ -311,6 +312,10 @@ - "Set pathname of ipv6-down script", - OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, - -+ { "syncppp", o_int, &npppd, -+ "sync among multiple pppd when sending chap/pap respond", OPT_PRIO }, -+ -+ - #ifdef HAVE_MULTILINK - { "multilink", o_bool, &multilink, - "Enable multilink operation", OPT_PRIO | 1 }, -diff -Naur ppp-2.4.5.0/pppd/pppd.h ppp-2.4.5/pppd/pppd.h ---- ppp-2.4.5.0/pppd/pppd.h 2012-04-18 15:44:46.000000000 +0800 -+++ ppp-2.4.5/pppd/pppd.h 2012-04-19 20:25:02.000000000 +0800 -@@ -327,6 +327,7 @@ - extern bool dump_options; /* print out option values */ - extern bool dryrun; /* check everything, print options, exit */ - extern int child_wait; /* # seconds to wait for children at end */ -+extern int npppd; /* synchronize between multiple pppd */ - - #ifdef MAXOCTETS - extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ -diff -Naur ppp-2.4.5.0/pppd/syncppp.c ppp-2.4.5/pppd/syncppp.c ---- ppp-2.4.5.0/pppd/syncppp.c 1970-01-01 08:00:00.000000000 +0800 -+++ ppp-2.4.5/pppd/syncppp.c 2012-04-18 15:46:59.000000000 +0800 -@@ -0,0 +1,75 @@ -+#include -+#include -+#include -+#include -+#include -+#include -+#include "pppd.h" -+#include "syncppp.h" -+ -+int syncppp(int nproc) -+{ -+ int flags; -+ int value; -+ sem_t *block; -+ sem_t *count; -+ struct timespec ts; -+ -+ if (nproc <= 1) { -+ error("syncppp: number of pppd should be larger than 1"); -+ return -1; -+ } -+ -+ if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { -+ error("clock_gettime error"); -+ return -1; -+ } -+ ts.tv_sec += SYNCPPP_TIMEOUT; -+ -+ -+ flags = O_RDWR | O_CREAT; -+ block = sem_open(SEM_BLOCK_NAME, flags, 0644, 0); -+ count = sem_open(SEM_COUNT_NAME, flags, 0644, 0); -+ if (block == SEM_FAILED || count == SEM_FAILED) { -+ error("syncppp: sem_open failed"); -+ return -1; -+ } -+ -+ if (sem_post(count) < 0) { -+ error("syncppp: sem_post failed"); -+ return -1; -+ } -+ if (sem_getvalue(count, &value) < 0) { -+ error("syncppp: sem_getvalue failed"); -+ return -1; -+ } -+ info("%d pppd have arrived, waiting for the left %d", value, nproc-value); -+ if (value >= nproc) { -+ while (nproc-1 > 0) { -+ if (sem_post(block) < 0) { -+ error("syncppp: sem_post failed"); -+ return -1; -+ } -+ nproc--; -+ } -+ } else { -+ if (sem_timedwait(block, &ts) < 0) { -+ if (errno == ETIMEDOUT) { -+ error("syncppp: sem_timewait time out"); -+ } else { -+ error("syncppp: sem_timewait error"); -+ } -+ return -1; -+ } -+ -+ } -+ -+ sem_close(count); -+ sem_close(block); -+ -+ sem_unlink(SEM_COUNT_NAME); -+ sem_unlink(SEM_BLOCK_NAME); -+ -+ return 0; -+} -+ -diff -Naur ppp-2.4.5.0/pppd/syncppp.h ppp-2.4.5/pppd/syncppp.h ---- ppp-2.4.5.0/pppd/syncppp.h 1970-01-01 08:00:00.000000000 +0800 -+++ ppp-2.4.5/pppd/syncppp.h 2012-04-18 15:46:59.000000000 +0800 -@@ -0,0 +1,3 @@ -+#define SEM_BLOCK_NAME "block" -+#define SEM_COUNT_NAME "count" -+#define SYNCPPP_TIMEOUT 5 -diff -Naur ppp-2.4.5.0/pppd/upap.c ppp-2.4.5/pppd/upap.c ---- ppp-2.4.5.0/pppd/upap.c 2012-04-18 15:44:46.000000000 +0800 -+++ ppp-2.4.5/pppd/upap.c 2012-04-19 20:26:22.000000000 +0800 -@@ -52,6 +52,8 @@ - #include "pppd.h" - #include "upap.h" - -+#include "syncppp.h" -+ - static const char rcsid[] = RCSID; - - static bool hide_password = 1; -@@ -568,6 +570,18 @@ - PUTCHAR(u->us_passwdlen, outp); - BCOPY(u->us_passwd, outp, u->us_passwdlen); - -+ if (npppd > 1) { -+ if (syncppp(npppd) < 0) { -+ error("syncppp sync fail"); -+ sem_unlink(SEM_COUNT_NAME); -+ sem_unlink(SEM_BLOCK_NAME); -+ } else { -+ info("syncppp sync succeeded"); -+ } -+ } else { -+ info("syncppp not active"); -+ } -+ - output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN); - - TIMEOUT(upap_timeout, u, u->us_timeouttime); diff --git a/package/network/services/ppp/patches/520-uniq.patch b/package/network/services/ppp/patches/520-uniq.patch index 65d0e96bc..54c0d6271 100644 --- a/package/network/services/ppp/patches/520-uniq.patch +++ b/package/network/services/ppp/patches/520-uniq.patch @@ -147,7 +147,7 @@ strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c -@@ -348,7 +348,7 @@ packetIsForMe(PPPoEConnection *conn, PPP +@@ -344,7 +344,7 @@ packetIsForMe(PPPoEConnection *conn, PPP if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0; /* If we're not using the Host-Unique tag, then accept the packet */ @@ -156,7 +156,7 @@ parsePacket(packet, parseForHostUniq, &forMe); return forMe; -@@ -474,16 +474,12 @@ sendPADI(PPPoEConnection *conn) +@@ -470,16 +470,12 @@ sendPADI(PPPoEConnection *conn) cursor += namelen + TAG_HDR_SIZE; /* If we're using Host-Uniq, copy it over */ @@ -179,7 +179,7 @@ } packet.length = htons(plen); -@@ -645,7 +641,7 @@ int main(int argc, char *argv[]) +@@ -641,7 +637,7 @@ int main(int argc, char *argv[]) memset(conn, 0, sizeof(PPPoEConnection)); @@ -188,7 +188,7 @@ switch(opt) { case 'S': conn->serviceName = xstrdup(optarg); -@@ -654,7 +650,23 @@ int main(int argc, char *argv[]) +@@ -650,7 +646,23 @@ int main(int argc, char *argv[]) conn->acName = xstrdup(optarg); break; case 'U': @@ -224,7 +224,7 @@ /* How do we access raw Ethernet devices? */ #undef USE_LINUX_PACKET -@@ -217,7 +219,7 @@ typedef struct PPPoEConnectionStruct { +@@ -224,7 +226,7 @@ typedef struct PPPoEConnectionStruct { char *serviceName; /* Desired service name, if any */ char *acName; /* Desired AC name, if any */ int synchronous; /* Use synchronous PPP */ @@ -233,7 +233,7 @@ int printACNames; /* Just print AC names */ FILE *debugFile; /* Debug file for dumping packets */ int numPADOs; /* Number of PADO packets received */ -@@ -273,6 +275,33 @@ void pppoe_printpkt(PPPoEPacket *packet, +@@ -280,6 +282,33 @@ void pppoe_printpkt(PPPoEPacket *packet, void (*printer)(void *, char *, ...), void *arg); void pppoe_log_packet(const char *prefix, PPPoEPacket *packet); diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index 42c23b4e8..beb5f309c 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=9 +PKG_RELEASE:=8 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable @@ -18,7 +18,8 @@ PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:samba:samba + +PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=1 @@ -29,29 +30,19 @@ CONFIGURE_PATH:=source3 PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin -define Package/samba/Default +define Package/samba36-server SECTION:=net CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS + TITLE:=Samba 3.6 SMB/CIFS server URL:=https://www.samba.org/ - MAINTAINER:=Felix Fietkau -endef - -define Package/samba36-server - $(call Package/samba/Default) - TITLE+= server DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS) endef define Package/samba36-client - $(call Package/samba/Default) - TITLE+= client - DEPENDS:=+libreadline +libncurses -endef - -define Package/samba36-net - $(call Package/samba/Default) - TITLE+= net commands + SECTION:=net + CATEGORY:=Network + TITLE:=Samba 3.6 SMB/CIFS client + URL:=https://www.samba.org/ DEPENDS:=+libreadline +libncurses endef @@ -60,6 +51,7 @@ define Package/samba36-server/config int "Maximum level of compiled-in debug messages" depends on PACKAGE_samba36-server || PACKAGE_samba36-client default -1 + endef define Package/samba36-server/description @@ -164,12 +156,6 @@ define Package/samba36-client/install $(INSTALL_BIN) $(PKG_BUILD_BIN)/nmblookup $(1)/usr/sbin endef -define Package/samba36-net/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_BIN)/net $(1)/usr/sbin -endef - $(eval $(call BuildPackage,samba36-client)) $(eval $(call BuildPackage,samba36-server)) -$(eval $(call BuildPackage,samba36-net)) diff --git a/package/network/services/samba36/files/samba.config b/package/network/services/samba36/files/samba.config index c79db0d32..b34a8dcaa 100644 --- a/package/network/services/samba36/files/samba.config +++ b/package/network/services/samba36/files/samba.config @@ -1,6 +1,6 @@ config samba - option 'name' 'OpenWrt' + option 'name' 'Lede' option 'workgroup' 'WORKGROUP' - option 'description' 'OpenWrt' + option 'description' 'Lede' option 'homes' '1' diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index ae0e0e230..28b0064df 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -23,9 +23,9 @@ smb_header() { local name workgroup description charset local hostname="$(uci_get system.@system[0].hostname)" - config_get name $1 name "${hostname:-OpenWrt}" - config_get workgroup $1 workgroup "${hostname:-OpenWrt}" - config_get description $1 description "Samba on ${hostname:-OpenWrt}" + config_get name $1 name "${hostname:-Lede}" + config_get workgroup $1 workgroup "${hostname:-Lede}" + config_get description $1 description "Samba on ${hostname:-Lede}" config_get charset $1 charset "UTF-8" mkdir -p /var/etc diff --git a/package/network/services/shellsync/Makefile b/package/network/services/shellsync/Makefile deleted file mode 100644 index 6dce14b35..000000000 --- a/package/network/services/shellsync/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=shellsync -PKG_VERSION:=0.2 -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/shellsync - CATEGORY:=Utilities - TITLE:=shellsync - DEPENDS:=+libpthread -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(CP) ./src/* $(PKG_BUILD_DIR)/ -endef - -define Package/shellsync/description -A tool to sync different shell scripts.Based on syncppp patch by morfast. -endef - -define Build/Compile - $(TARGET_CROSS)gcc -pthread -o $(PKG_BUILD_DIR)/shellsync $(PKG_BUILD_DIR)/shellsync.c -endef - -define Package/shellsync/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/shellsync $(1)/usr/bin -endef - - -$(eval $(call BuildPackage,shellsync)) diff --git a/package/network/services/shellsync/src/shellsync.c b/package/network/services/shellsync/src/shellsync.c deleted file mode 100644 index 4aef1e9ba..000000000 --- a/package/network/services/shellsync/src/shellsync.c +++ /dev/null @@ -1,106 +0,0 @@ -/************************************************************************* - > File Name: shellsync.c - > Author: GuoGuo - > Mail: gch981213@gmail.com - > Created Time: 2014å¹´11月06æ—¥ 星期四 19æ—¶15分30秒 - ************************************************************************/ -#include -#include -#include -#include -#include -#include -#define SEM_BLOCK_NAME "SYNCSHELL_block" -#define SEM_COUNT_NAME "SYNCSHELL_count" -int wait_timeout; -int sync_wait(int nproc) -{ - int flags; - int value; - sem_t *block; - sem_t *count; - struct timespec ts; - - if (nproc <= 1) { - printf("sync_wait: number of processes should be larger than 1\n"); - return -1; - } - - if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { - printf("clock_gettime error\n"); - return -1; - } - ts.tv_sec += wait_timeout; - - - flags = O_RDWR | O_CREAT; - block = sem_open(SEM_BLOCK_NAME, flags, 0644, 0); - count = sem_open(SEM_COUNT_NAME, flags, 0644, 0); - if (block == SEM_FAILED || count == SEM_FAILED) { - printf("sync_wait: sem_open failed\n"); - return -1; - } - - if (sem_post(count) < 0) { - printf("sync_wait: sem_post failed\n"); - return -1; - } - if (sem_getvalue(count, &value) < 0) { - printf("sync_wait: sem_getvalue failed\n"); - return -1; - } - printf("%d processes have arrived, waiting for the left %d\n", value, nproc-value); - if (value >= nproc) { - while (nproc-1 > 0) { - if (sem_post(block) < 0) { - printf("sync_wait: sem_post failed\n"); - return -1; - } - nproc--; - } - } else { - if (sem_timedwait(block, &ts) < 0) { - if (errno == ETIMEDOUT) { - printf("sync_wait: sem_timewait time out\n"); - } else { - printf("sync_wait: sem_timewait error\n"); - } - return -1; - } - - } - - sem_close(count); - sem_close(block); - - sem_unlink(SEM_COUNT_NAME); - sem_unlink(SEM_BLOCK_NAME); - - return 0; -} - -int main(int argc,char *argv[]) -{ - if(argc!=3) - { - printf("Usage: shellsync \n"); - } - else - { - int proc_num; - sscanf(argv[1],"%d",&proc_num); - sscanf(argv[2],"%d",&wait_timeout); - if(sync_wait(proc_num)<0) - { - printf("Processes sync failed.\n"); - sem_unlink(SEM_COUNT_NAME); - sem_unlink(SEM_BLOCK_NAME); - return 1; - } - else - { - printf("Processes sync succeed.\n"); - return 0; - } - } -} diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index f2d061c09..465e54349 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -19,7 +19,6 @@ PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC PKG_BUILD_DEPENDS = ustream-ssl -PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -44,12 +43,12 @@ define Package/uhttpd/description endef define Package/uhttpd/config - config uhttpd_lua - depends on PACKAGE_uhttpd-mod-lua - bool "Enable Integrated Lua interpreter" - default y + config PACKAGE_uhttpd_debug + bool "Build with debug messages" + default n endef + define Package/uhttpd-mod-lua $(Package/uhttpd/default) TITLE+= (Lua plugin) @@ -107,16 +106,6 @@ define Package/uhttpd-mod-ubus/install $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus endef -define Package/uhttpd-mod-lua/postinst - $(if $(CONFIG_uhttpd_lua), - #!/bin/sh - if [ -f $${IPKG_INSTROOT}/www/index.html ] - then - sed -e 's:/cgi-bin::g' -i $${IPKG_INSTROOT}/www/index.html - fi - ,) -endef - $(eval $(call BuildPackage,uhttpd)) $(eval $(call BuildPackage,uhttpd-mod-lua)) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index a7d769e18..89f99aaee 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -51,8 +51,8 @@ config uhttpd main # Lua url prefix and handler script. # Lua support is disabled if no prefix given. - option lua_prefix /luci - option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua +# option lua_prefix /luci +# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua # Specify the ubus-rpc prefix and socket path. # option ubus_prefix /ubus @@ -83,7 +83,7 @@ config uhttpd main option tcp_keepalive 1 # Basic auth realm, defaults to local hostname -# option realm OpenWrt +# option realm Lede # Configuration file in busybox httpd format # option config /etc/httpd.conf diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 47270bcc1..6b8be1c7e 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -52,7 +52,7 @@ generate_keys() { [ -n "$GENKEY_CMD" ] && { $GENKEY_CMD \ -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \ - -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}" + -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/O="${commonname:-Lede}$UNIQUEID"/CN="${commonname:-Lede}" sync mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}" mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}" diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index 7fae197fe..cdafa5be1 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2018-01-02 -PKG_SOURCE_VERSION:=78974417e182a3de8f78b7d73366ec0c98396b6c -PKG_MIRROR_HASH:=a60f9eb9428ac3256cd7c3c6d4207c116cedf4d212b82e2f86c1bf7c7898fcbb +PKG_SOURCE_DATE:=2017-05-22 +PKG_SOURCE_VERSION:=0e8b948ff8dd1cb1763180c99b522390529c7841 +PKG_MIRROR_HASH:=1cdd25464e1be69bef56092bc8547ba254ffc2d7c32f13cf02a80c8742876f1b PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 diff --git a/package/network/utils/adb-enablemodem/Makefile b/package/network/utils/adb-enablemodem/Makefile deleted file mode 100644 index 3ffc64af0..000000000 --- a/package/network/utils/adb-enablemodem/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=adb-enablemodem -PKG_VERSION:=2017-03-05 -PKG_RELEASE:=1 - -include $(INCLUDE_DIR)/package.mk - -define Package/adb-enablemodem - SECTION:=net - CATEGORY:=Network - SUBMENU:=WWAN - TITLE:=Enable modem via adb - DEPENDS:=+adb -endef - -define Build/Compile - true -endef - -define Package/adb-enablemodem/install - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) ./files/adb-enablemodem $(1)/etc/init.d/adb-enablemodem -endef - -$(eval $(call BuildPackage,adb-enablemodem)) diff --git a/package/network/utils/adb-enablemodem/files/adb-enablemodem b/package/network/utils/adb-enablemodem/files/adb-enablemodem deleted file mode 100644 index ddfc681a0..000000000 --- a/package/network/utils/adb-enablemodem/files/adb-enablemodem +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -adb_exec() { - adb -s "$serial" shell "( $1 ) >/dev/null 2>&1"'; printf "\nEXIT_CODE: %i\n" $?' | head -c 64 | grep -qx 'EXIT_CODE: 0\r\?' -} - -enablemodem_do() { - logger -t adb-enablemodem 'INFO: waiting for device' - adb wait-for-device - serial="$(adb get-serialno)" - - vendor_id="$(adb -s "$serial" shell 'uci get product.usb.vid' | head -c 16 | tr -d '\r\n')" - product_id="$(adb -s "$serial" shell 'uci get product.usb.pid' | head -c 16 | tr -d '\r\n')" - - case "$vendor_id:$product_id" in - "0x2357:0x000D") # TP-LINK LTE MODULE - case "$1" in - start) - if adb_exec ' - chmod +x /WEBSERVER/www/cgi-bin/* - fds="$(ls /proc/$$/fd | grep -v "^[012]$")" - for fd in $fds; do - eval "exec $fd>&-" - done - start-stop-daemon -x httpd -S -- -h /WEBSERVER/www/ - '; then - logger -t adb-enablemodem 'INFO: httpd on modem started' - else - logger -t adb-enablemodem 'ERROR: failed to start httpd on modem' - fi - option_newid='/sys/bus/usb-serial/drivers/option1/new_id' - if [ -e "$option_newid" ]; then - printf '%s %s' "$vendor_id" "$product_id" > "$option_newid" - fi - ;; - stop) - if adb_exec 'start-stop-daemon -x httpd -K'; then - logger -t adb-enablemodem 'INFO: httpd on modem stopped' - else - logger -t adb-enablemodem 'ERROR: failed to stop httpd on modem' - fi - ;; - esac - ;; - *) - logger -t adb-enablemodem "ERROR: unknown device $vendor_id:$product_id" - ;; - esac -} - -start() { - ( enablemodem_do start ) & -} - -stop() { - ( enablemodem_do stop ) & -} - -restart() { - ( enablemodem_do stop; enablemodem_do start ) & -} - diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile index d1168ae68..d2fd2593a 100644 --- a/package/network/utils/arptables/Makefile +++ b/package/network/utils/arptables/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arptables PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://git.netfilter.org/arptables +PKG_SOURCE_URL:=git://git.netfilter.org/arptables PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2015-05-20 PKG_SOURCE_VERSION:=f4ab8f63f11a72f14687a6646d04ae1bae3fa45f diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index 3b7f4b902..ce99a2a68 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=30 +PKG_RELEASE:=29 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index bbdb30c5e..8f74e173d 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -63,16 +63,5 @@ }, "connect": "AT*ENAP=1,${profile}", "disconnect": "AT*ENAP=0" - }, - "mtk1": { - "initialize": [ - "AT+CFUN=1" - ], - "configure": [ - "AT+CGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",0,0" - ], - "connect": "AT+CGACT=1,${profile}", - "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", - "disconnect": "AT+CGACT=0,${profile}" } } diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 60b39655e..73d1e05e3 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -25,7 +25,7 @@ proto_ncm_init_config() { proto_ncm_setup() { local interface="$1" - local manufacturer initialize setmode connect finalize ifname devname devpath + local manufacturer initialize setmode connect ifname devname devpath local device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS json_get_vars device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS @@ -105,21 +105,9 @@ proto_ncm_setup() { return 1 } } - - json_get_values configure configure - echo "Configuring modem" - for i in $configure; do - eval COMMAND="$i" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { - echo "Failed to configure modem" - proto_notify_error "$interface" CONFIGURE_FAILED - return 1 - } - done - [ -n "$mode" ] && { json_select modes json_get_var setmode "$mode" - echo "Setting mode" eval COMMAND="$setmode" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to set operating mode" proto_notify_error "$interface" SETMODE_FAILED @@ -130,16 +118,14 @@ proto_ncm_setup() { echo "Starting network $interface" json_get_vars connect - echo "Connecting modem" eval COMMAND="$connect" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to connect" proto_notify_error "$interface" CONNECT_FAILED return 1 } - json_get_vars finalize - echo "Setting up $ifname" + proto_init_update "$ifname" 1 proto_add_data json_add_string "manufacturer" "$manufacturer" @@ -164,15 +150,6 @@ proto_ncm_setup() { proto_add_dynamic_defaults ubus call network add_dynamic "$(json_dump)" } - - [ -n "$finalize" ] && { - eval COMMAND="$finalize" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { - echo "Failed to configure modem" - proto_notify_error "$interface" FINALIZE_FAILED - return 1 - } - } - } proto_ncm_teardown() { diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile index f04ac69d2..128fa9e6f 100644 --- a/package/network/utils/conntrack-tools/Makefile +++ b/package/network/utils/conntrack-tools/Makefile @@ -8,17 +8,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=conntrack-tools +PKG_VERSION:=1.4.4 PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools -PKG_SOURCE_DATE:=2017-09-27 -PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c -PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:= \ + http://www.netfilter.org/projects/conntrack-tools/files \ + ftp://ftp.netfilter.org/pub/conntrack-tools \ + http://mirrors.evolva.ro/netfilter.org/conntrack-tools +PKG_HASH:=b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:conntrack-tools_project:conntrack-tools PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in index 973da3d96..6fa10b678 100644 --- a/package/network/utils/curl/Config.in +++ b/package/network/utils/curl/Config.in @@ -9,8 +9,8 @@ choice config LIBCURL_MBEDTLS bool "mbed TLS" - config LIBCURL_WOLFSSL - bool "wolfSSL" + config LIBCURL_CYASSL + bool "CyaSSL" config LIBCURL_OPENSSL bool "OpenSSL" @@ -101,10 +101,6 @@ config LIBCURL_TFTP bool "TFTP protocol" default n -config LIBCURL_NGHTTP2 - bool "HTTP2 protocol" - default n - comment "Miscellaneous" config LIBCURL_PROXY diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 17fcf704d..5d829547a 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -8,19 +8,20 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl -PKG_VERSION:=7.57.0 -PKG_RELEASE:=1 +PKG_VERSION:=7.52.1 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ - http://curl.mirror.anstey.ca/ \ - http://curl.askapache.com/download/ \ - https://curl.haxx.se/download/ -PKG_HASH:=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 +PKG_SOURCE_URL:=http://curl.haxx.se/download/ \ + http://www.mirrorspace.org/curl/ \ + ftp://ftp.sunet.se/pub/www/utilities/curl/ \ + ftp://ftp.planetmirror.com/pub/curl/ \ + http://www.mirrormonster.com/curl/download/ \ + http://curl.mirrors.cyberservers.net/download/ +PKG_HASH:=d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING -PKG_CPE_ID:=cpe:/a:haxx:libcurl PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -28,7 +29,7 @@ PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:= \ CONFIG_IPV6 \ \ - CONFIG_LIBCURL_WOLFSSL \ + CONFIG_LIBCURL_CYASSL \ CONFIG_LIBCURL_GNUTLS \ CONFIG_LIBCURL_OPENSSL \ CONFIG_LIBCURL_MBEDTLS \ @@ -54,7 +55,6 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_LIBCURL_SMTP \ CONFIG_LIBCURL_TELNET \ CONFIG_LIBCURL_TFTP \ - CONFIG_LIBCURL_NGHTTP2 \ \ CONFIG_LIBCURL_COOKIES \ CONFIG_LIBCURL_CRYPTO_AUTH \ @@ -86,9 +86,8 @@ define Package/libcurl $(call Package/curl/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls - DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn - DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 + DEPENDS:= +LIBCURL_CYASSL:libcyassl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls + DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2 TITLE:=A client-side URL transfer library MENU:=1 endef @@ -114,7 +113,7 @@ CONFIGURE_ARGS += \ \ $(call autoconf_bool,CONFIG_IPV6,ipv6) \ \ - $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ + $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \ $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \ $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \ @@ -122,7 +121,6 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \ $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ - $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ \ $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ diff --git a/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch new file mode 100644 index 000000000..9658ef554 --- /dev/null +++ b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch @@ -0,0 +1,34 @@ +From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Mon, 26 Dec 2016 00:06:33 +0100 +Subject: [PATCH] vtls: s/SSLEAY/OPENSSL + +Fixed an old leftover use of the USE_SSLEAY define which would make a +socket get removed from the applications sockets to monitor when the +multi_socket API was used, leading to timeouts. + +Bug: #1174 +--- + lib/vtls/vtls.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy + curlssl_close_all(data); + } + +-#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ ++#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ + defined(USE_DARWINSSL) || defined(USE_NSS) + /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */ + int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks, +@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata + (void)numsocks; + return GETSOCK_BLANK; + } +-/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ ++/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ + #endif + + void Curl_ssl_close(struct connectdata *conn, int sockindex) diff --git a/package/network/utils/curl/patches/100-CVE-2017-2629.patch b/package/network/utils/curl/patches/100-CVE-2017-2629.patch new file mode 100644 index 000000000..f2cd869c5 --- /dev/null +++ b/package/network/utils/curl/patches/100-CVE-2017-2629.patch @@ -0,0 +1,33 @@ +From a00a42b4abe8363a46071bb3b43b1b7138f5259b Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Sun, 22 Jan 2017 18:11:55 +0100 +Subject: [PATCH] TLS: make SSL_VERIFYSTATUS work again + +The CURLOPT_SSL_VERIFYSTATUS option was not properly handled by libcurl +and thus even if the status couldn't be verified, the connection would +be allowed and the user would not be told about the failed verification. + +Regression since cb4e2be7c6d42ca + +CVE-2017-2629 +Bug: https://curl.haxx.se/docs/adv_20170222.html + +Reported-by: Marcus Hoffmann +--- + lib/url.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/lib/url.c ++++ b/lib/url.c +@@ -4141,8 +4141,11 @@ static struct connectdata *allocate_conn + conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; + conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; + ++ conn->ssl_config.verifystatus = data->set.ssl.primary.verifystatus; + conn->ssl_config.verifypeer = data->set.ssl.primary.verifypeer; + conn->ssl_config.verifyhost = data->set.ssl.primary.verifyhost; ++ conn->proxy_ssl_config.verifystatus = ++ data->set.proxy_ssl.primary.verifystatus; + conn->proxy_ssl_config.verifypeer = data->set.proxy_ssl.primary.verifypeer; + conn->proxy_ssl_config.verifyhost = data->set.proxy_ssl.primary.verifyhost; + diff --git a/package/network/utils/curl/patches/101-CVE-2017-7407.patch b/package/network/utils/curl/patches/101-CVE-2017-7407.patch new file mode 100644 index 000000000..ba8097b0e --- /dev/null +++ b/package/network/utils/curl/patches/101-CVE-2017-7407.patch @@ -0,0 +1,165 @@ +From 6019f1795b4e3b72507b84b0e02dc8c32024f562 Mon Sep 17 00:00:00 2001 +From: Dan Fandrich +Date: Sat, 11 Mar 2017 10:59:34 +0100 +Subject: [PATCH] CVE-2017-7407: fixed + +Bug: https://curl.haxx.se/docs/adv_20170403.html + +Reported-by: Brian Carpenter +--- + src/tool_writeout.c | 6 +++--- + tests/data/Makefile.inc | 2 +- + tests/data/test1440 | 31 +++++++++++++++++++++++++++++++ + tests/data/test1441 | 31 +++++++++++++++++++++++++++++++ + tests/data/test1442 | 35 +++++++++++++++++++++++++++++++++++ + 5 files changed, 101 insertions(+), 4 deletions(-) + create mode 100644 tests/data/test1440 + create mode 100644 tests/data/test1441 + create mode 100644 tests/data/test1442 + +--- a/src/tool_writeout.c ++++ b/src/tool_writeout.c +@@ -5,7 +5,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -113,7 +113,7 @@ void ourWriteOut(CURL *curl, struct OutS + double doubleinfo; + + while(ptr && *ptr) { +- if('%' == *ptr) { ++ if('%' == *ptr && ptr[1]) { + if('%' == ptr[1]) { + /* an escaped %-letter */ + fputc('%', stream); +@@ -341,7 +341,7 @@ void ourWriteOut(CURL *curl, struct OutS + } + } + } +- else if('\\' == *ptr) { ++ else if('\\' == *ptr && ptr[1]) { + switch(ptr[1]) { + case 'r': + fputc('\r', stream); +--- a/tests/data/Makefile.inc ++++ b/tests/data/Makefile.inc +@@ -150,7 +150,7 @@ test1408 test1409 test1410 test1411 test + test1416 test1417 test1418 test1419 test1420 test1421 test1422 test1423 \ + test1424 \ + test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ +-test1436 test1437 test1438 test1439 \ ++test1436 test1437 test1438 test1439 test1440 test1441 test1442 \ + \ + test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ + test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ +--- /dev/null ++++ b/tests/data/test1440 +@@ -0,0 +1,31 @@ ++ ++ ++ ++--write-out ++ ++ ++# Server-side ++ ++ ++ ++# Client-side ++ ++ ++file ++ ++ ++ ++Check --write-out with trailing %{ ++ ++ ++file://localhost/%PWD/log/ --write-out '%{' ++ ++ ++ ++# Verify data ++ ++ ++%{ ++ ++ ++ +--- /dev/null ++++ b/tests/data/test1441 +@@ -0,0 +1,31 @@ ++ ++ ++ ++--write-out ++ ++ ++# Server-side ++ ++ ++ ++# Client-side ++ ++ ++file ++ ++ ++ ++Check --write-out with trailing % ++ ++ ++file://localhost/%PWD/log/ --write-out '%' ++ ++ ++ ++# Verify data ++ ++ ++% ++ ++ ++ +--- /dev/null ++++ b/tests/data/test1442 +@@ -0,0 +1,35 @@ ++ ++ ++ ++--write-out ++FILE ++ ++ ++# Server-side ++ ++ ++ ++# Client-side ++ ++ ++file ++ ++ ++ ++Check --write-out with trailing \ ++ ++ ++file://localhost/%PWD/log/non-existent-file.txt --write-out '\' ++ ++ ++ ++# Verify data ++ ++ ++37 ++ ++ ++\ ++ ++ ++ diff --git a/package/network/utils/curl/patches/102-CVE-2017-7468.patch b/package/network/utils/curl/patches/102-CVE-2017-7468.patch new file mode 100644 index 000000000..72f51455d --- /dev/null +++ b/package/network/utils/curl/patches/102-CVE-2017-7468.patch @@ -0,0 +1,264 @@ +From 8166b637bce299f4ac64d371c20cd5afea72c364 Mon Sep 17 00:00:00 2001 +From: Jay Satiro +Date: Wed, 22 Mar 2017 01:59:49 -0400 +Subject: [PATCH] TLS: Fix switching off SSL session id when client cert is + used + +- Move the sessionid flag to ssl_primary_config so that ssl and + proxy_ssl will each have their own sessionid flag. + +Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that +this issue had been fixed in 247d890, CVE-2016-5419. + +Bug: https://github.com/curl/curl/issues/1341 +Reported-by: lijian996@users.noreply.github.com +--- + lib/url.c | 5 +++-- + lib/urldata.h | 2 +- + lib/vtls/axtls.c | 4 ++-- + lib/vtls/cyassl.c | 4 ++-- + lib/vtls/darwinssl.c | 2 +- + lib/vtls/gtls.c | 4 ++-- + lib/vtls/mbedtls.c | 4 ++-- + lib/vtls/nss.c | 2 +- + lib/vtls/openssl.c | 4 ++-- + lib/vtls/polarssl.c | 4 ++-- + lib/vtls/schannel.c | 4 ++-- + lib/vtls/vtls.c | 9 ++++++--- + 12 files changed, 26 insertions(+), 22 deletions(-) + +--- a/lib/url.c ++++ b/lib/url.c +@@ -548,7 +548,7 @@ CURLcode Curl_init_userdefined(struct Us + #endif + set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth + type */ +- set->general_ssl.sessionid = TRUE; /* session ID caching enabled by ++ set->ssl.primary.sessionid = TRUE; /* session ID caching enabled by + default */ + set->proxy_ssl = set->ssl; + +@@ -2470,8 +2470,9 @@ CURLcode Curl_setopt(struct Curl_easy *d + break; + + case CURLOPT_SSL_SESSIONID_CACHE: +- data->set.general_ssl.sessionid = (0 != va_arg(param, long)) ? ++ data->set.ssl.primary.sessionid = (0 != va_arg(param, long)) ? + TRUE : FALSE; ++ data->set.proxy_ssl.primary.sessionid = data->set.ssl.primary.sessionid; + break; + + #ifdef USE_LIBSSH2 +--- a/lib/urldata.h ++++ b/lib/urldata.h +@@ -354,6 +354,7 @@ struct ssl_primary_config { + char *random_file; /* path to file containing "random" data */ + char *egdsocket; /* path to file containing the EGD daemon socket */ + char *cipher_list; /* list of ciphers to use */ ++ bool sessionid; /* cache session IDs or not */ + }; + + struct ssl_config_data { +@@ -383,7 +384,6 @@ struct ssl_config_data { + }; + + struct ssl_general_config { +- bool sessionid; /* cache session IDs or not */ + size_t max_ssl_sessions; /* SSL session id cache size */ + }; + +--- a/lib/vtls/axtls.c ++++ b/lib/vtls/axtls.c +@@ -256,7 +256,7 @@ static CURLcode connect_prep(struct conn + * 2) setting up callbacks. these seem gnutls specific + */ + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + const uint8_t *ssl_sessionid; + size_t ssl_idsize; + +@@ -386,7 +386,7 @@ static CURLcode connect_finish(struct co + conn->send[sockindex] = axtls_send; + + /* Put our freshly minted SSL session in cache */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + const uint8_t *ssl_sessionid = ssl_get_session_id_size(ssl); + size_t ssl_idsize = ssl_get_session_id(ssl); + Curl_ssl_sessionid_lock(conn); +--- a/lib/vtls/cyassl.c ++++ b/lib/vtls/cyassl.c +@@ -383,7 +383,7 @@ cyassl_connect_step1(struct connectdata + #endif /* HAVE_ALPN */ + + /* Check if there's a cached ID we can/should use here! */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + void *ssl_sessionid = NULL; + + Curl_ssl_sessionid_lock(conn); +@@ -597,7 +597,7 @@ cyassl_connect_step3(struct connectdata + + DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + bool incache; + SSL_SESSION *our_ssl_sessionid; + void *old_ssl_sessionid = NULL; +--- a/lib/vtls/darwinssl.c ++++ b/lib/vtls/darwinssl.c +@@ -1541,7 +1541,7 @@ static CURLcode darwinssl_connect_step1( + #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ + + /* Check if there's a cached ID we can/should use here! */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + char *ssl_sessionid; + size_t ssl_sessionid_len; + +--- a/lib/vtls/gtls.c ++++ b/lib/vtls/gtls.c +@@ -782,7 +782,7 @@ gtls_connect_step1(struct connectdata *c + + /* This might be a reconnect, so we check for a session ID in the cache + to speed up things */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + void *ssl_sessionid; + size_t ssl_idsize; + +@@ -1311,7 +1311,7 @@ gtls_connect_step3(struct connectdata *c + conn->recv[sockindex] = gtls_recv; + conn->send[sockindex] = gtls_send; + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + /* we always unconditionally get the session id here, as even if we + already got it from the cache and asked to use it in the connection, it + might've been rejected and then a new one is in use now and we need to +--- a/lib/vtls/mbedtls.c ++++ b/lib/vtls/mbedtls.c +@@ -374,7 +374,7 @@ mbed_connect_step1(struct connectdata *c + mbedtls_ssl_list_ciphersuites()); + + /* Check if there's a cached ID we can/should use here! */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + void *old_session = NULL; + + Curl_ssl_sessionid_lock(conn); +@@ -618,7 +618,7 @@ mbed_connect_step3(struct connectdata *c + + DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + int ret; + mbedtls_ssl_session *our_ssl_sessionid; + void *old_ssl_sessionid = NULL; +--- a/lib/vtls/nss.c ++++ b/lib/vtls/nss.c +@@ -1696,7 +1696,7 @@ static CURLcode nss_setup_connect(struct + goto error; + + /* do not use SSL cache if disabled or we are not going to verify peer */ +- ssl_no_cache = (data->set.general_ssl.sessionid ++ ssl_no_cache = (SSL_SET_OPTION(primary.sessionid) + && SSL_CONN_CONFIG(verifypeer)) ? PR_FALSE : PR_TRUE; + if(SSL_OptionSet(model, SSL_NO_CACHE, ssl_no_cache) != SECSuccess) + goto error; +--- a/lib/vtls/openssl.c ++++ b/lib/vtls/openssl.c +@@ -2161,7 +2161,7 @@ static CURLcode ossl_connect_step1(struc + #endif + + /* Check if there's a cached ID we can/should use here! */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + void *ssl_sessionid = NULL; + + Curl_ssl_sessionid_lock(conn); +@@ -2915,7 +2915,7 @@ static CURLcode ossl_connect_step3(struc + + DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + bool incache; + SSL_SESSION *our_ssl_sessionid; + void *old_ssl_sessionid = NULL; +--- a/lib/vtls/polarssl.c ++++ b/lib/vtls/polarssl.c +@@ -327,7 +327,7 @@ polarssl_connect_step1(struct connectdat + ssl_set_ciphersuites(&connssl->ssl, ssl_list_ciphersuites()); + + /* Check if there's a cached ID we can/should use here! */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + void *old_session = NULL; + + Curl_ssl_sessionid_lock(conn); +@@ -555,7 +555,7 @@ polarssl_connect_step3(struct connectdat + + DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); + +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + int ret; + ssl_session *our_ssl_sessionid; + void *old_ssl_sessionid = NULL; +--- a/lib/vtls/schannel.c ++++ b/lib/vtls/schannel.c +@@ -145,7 +145,7 @@ schannel_connect_step1(struct connectdat + connssl->cred = NULL; + + /* check for an existing re-usable credential handle */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + Curl_ssl_sessionid_lock(conn); + if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL, sockindex)) { + connssl->cred = old_cred; +@@ -714,7 +714,7 @@ schannel_connect_step3(struct connectdat + #endif + + /* save the current session data for possible re-use */ +- if(data->set.general_ssl.sessionid) { ++ if(SSL_SET_OPTION(primary.sessionid)) { + bool incache; + struct curl_schannel_cred *old_cred = NULL; + +--- a/lib/vtls/vtls.c ++++ b/lib/vtls/vtls.c +@@ -120,6 +120,9 @@ Curl_clone_primary_ssl_config(struct ssl + CLONE_STRING(egdsocket); + CLONE_STRING(random_file); + CLONE_STRING(clientcert); ++ ++ /* Disable dest sessionid cache if a client cert is used, CVE-2016-5419. */ ++ dest->sessionid = (dest->clientcert ? false : source->sessionid); + return TRUE; + } + +@@ -293,9 +296,9 @@ bool Curl_ssl_getsessionid(struct connec + int port = isProxy ? (int)conn->port : conn->remote_port; + *ssl_sessionid = NULL; + +- DEBUGASSERT(data->set.general_ssl.sessionid); ++ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); + +- if(!data->set.general_ssl.sessionid) ++ if(!SSL_SET_OPTION(primary.sessionid)) + /* session ID re-use is disabled */ + return TRUE; + +@@ -397,7 +400,7 @@ CURLcode Curl_ssl_addsessionid(struct co + &conn->proxy_ssl_config : + &conn->ssl_config; + +- DEBUGASSERT(data->set.general_ssl.sessionid); ++ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); + + clone_host = strdup(isProxy ? conn->http_proxy.host.name : conn->host.name); + if(!clone_host) diff --git a/package/network/utils/curl/patches/103-CVE-2017-1000100.patch b/package/network/utils/curl/patches/103-CVE-2017-1000100.patch new file mode 100644 index 000000000..93ab97bd1 --- /dev/null +++ b/package/network/utils/curl/patches/103-CVE-2017-1000100.patch @@ -0,0 +1,41 @@ +From 358b2b131ad6c095696f20dcfa62b8305263f898 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Tue, 1 Aug 2017 17:16:46 +0200 +Subject: [PATCH] tftp: reject file name lengths that don't fit + +... and thereby avoid telling send() to send off more bytes than the +size of the buffer! + +CVE-2017-1000100 + +Bug: https://curl.haxx.se/docs/adv_20170809B.html +Reported-by: Even Rouault + +Credit to OSS-Fuzz for the discovery +--- + lib/tftp.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/lib/tftp.c ++++ b/lib/tftp.c +@@ -5,7 +5,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -490,6 +490,11 @@ static CURLcode tftp_send_first(tftp_sta + if(result) + return result; + ++ if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { ++ failf(data, "TFTP file name too long\n"); ++ return CURLE_TFTP_ILLEGAL; /* too long file name field */ ++ } ++ + snprintf((char *)state->spacket.data+2, + state->blksize, + "%s%c%s%c", filename, '\0', mode, '\0'); diff --git a/package/network/utils/curl/patches/104-CVE-2017-1000101.patch b/package/network/utils/curl/patches/104-CVE-2017-1000101.patch new file mode 100644 index 000000000..835b73eef --- /dev/null +++ b/package/network/utils/curl/patches/104-CVE-2017-1000101.patch @@ -0,0 +1,33 @@ +From 453e7a7a03a2cec749abd3878a48e728c515cca7 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Tue, 1 Aug 2017 17:16:07 +0200 +Subject: [PATCH] glob: do not continue parsing after a strtoul() overflow + range + +Added test 1289 to verify. + +CVE-2017-1000101 + +Bug: https://curl.haxx.se/docs/adv_20170809A.html +Reported-by: Brian Carpenter +--- + src/tool_urlglob.c | 5 ++++- + tests/data/Makefile.inc | 2 +- + tests/data/test1289 | 35 +++++++++++++++++++++++++++++++++++ + 3 files changed, 40 insertions(+), 2 deletions(-) + create mode 100644 tests/data/test1289 + +--- a/src/tool_urlglob.c ++++ b/src/tool_urlglob.c +@@ -272,7 +272,10 @@ static CURLcode glob_range(URLGlob *glob + } + errno = 0; + max_n = strtoul(pattern, &endp, 10); +- if(errno || (*endp == ':')) { ++ if(errno) ++ /* overflow */ ++ endp = NULL; ++ else if(*endp == ':') { + pattern = endp+1; + errno = 0; + step_n = strtoul(pattern, &endp, 10); diff --git a/package/network/utils/curl/patches/105-CVE-2017-8816.patch b/package/network/utils/curl/patches/105-CVE-2017-8816.patch new file mode 100644 index 000000000..4d2b3162a --- /dev/null +++ b/package/network/utils/curl/patches/105-CVE-2017-8816.patch @@ -0,0 +1,67 @@ +From 7947c50bcd09cf471c95511739bc66d2cb506ee2 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Mon, 6 Nov 2017 23:51:52 +0100 +Subject: [PATCH] ntlm: avoid integer overflow for malloc size + +Reported-by: Alex Nichols +Assisted-by: Kamil Dudka and Max Dymond + +CVE-2017-8816 + +Bug: https://curl.haxx.se/docs/adv_2017-11e7.html +--- + lib/curl_ntlm_core.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c +index 1309bf0d9..e8962769c 100644 +--- a/lib/curl_ntlm_core.c ++++ b/lib/curl_ntlm_core.c +@@ -616,23 +616,42 @@ CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, + Curl_HMAC_final(ctxt, output); + + return CURLE_OK; + } + ++#ifndef SIZE_T_MAX ++/* some limits.h headers have this defined, some don't */ ++#if defined(_LP64) || defined(_I32LPx) ++#define SIZE_T_MAX 18446744073709551615U ++#else ++#define SIZE_T_MAX 4294967295U ++#endif ++#endif ++ + /* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode + * (uppercase UserName + Domain) as the data + */ + CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, + const char *domain, size_t domlen, + unsigned char *ntlmhash, + unsigned char *ntlmv2hash) + { + /* Unicode representation */ +- size_t identity_len = (userlen + domlen) * 2; +- unsigned char *identity = malloc(identity_len); ++ size_t identity_len; ++ unsigned char *identity; + CURLcode result = CURLE_OK; + ++ /* we do the length checks below separately to avoid integer overflow risk ++ on extreme data lengths */ ++ if((userlen > SIZE_T_MAX/2) || ++ (domlen > SIZE_T_MAX/2) || ++ ((userlen + domlen) > SIZE_T_MAX/2)) ++ return CURLE_OUT_OF_MEMORY; ++ ++ identity_len = (userlen + domlen) * 2; ++ identity = malloc(identity_len); ++ + if(!identity) + return CURLE_OUT_OF_MEMORY; + + ascii_uppercase_to_unicode_le(identity, user, userlen); + ascii_to_unicode_le(identity + (userlen << 1), domain, domlen); +-- +2.15.0 + diff --git a/package/network/utils/curl/patches/106-CVE-2017-8817.patch b/package/network/utils/curl/patches/106-CVE-2017-8817.patch new file mode 100644 index 000000000..9e904f0b4 --- /dev/null +++ b/package/network/utils/curl/patches/106-CVE-2017-8817.patch @@ -0,0 +1,141 @@ +From 0acc0c7c120afa6d60bfc7932c04361720b6e74d Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Fri, 10 Nov 2017 08:52:45 +0100 +Subject: [PATCH] wildcardmatch: fix heap buffer overflow in setcharset + +The code would previous read beyond the end of the pattern string if the +match pattern ends with an open bracket when the default pattern +matching function is used. + +Detected by OSS-Fuzz: +https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4161 + +CVE-2017-8817 + +Bug: https://curl.haxx.se/docs/adv_2017-ae72.html +--- + lib/curl_fnmatch.c | 9 +++------ + tests/data/Makefile.inc | 2 +- + tests/data/test1163 | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 56 insertions(+), 7 deletions(-) + create mode 100644 tests/data/test1163 + +diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c +index da83393b4..8a1e106c4 100644 +--- a/lib/curl_fnmatch.c ++++ b/lib/curl_fnmatch.c +@@ -131,10 +131,13 @@ static int setcharset(unsigned char **p, unsigned char *charset) + unsigned char lastchar = 0; + bool something_found = FALSE; + unsigned char c; + for(;;) { + c = **p; ++ if(!c) ++ return SETCHARSET_FAIL; ++ + switch(state) { + case CURLFNM_SCHS_DEFAULT: + if(ISALNUM(c)) { /* ASCII value */ + rangestart = c; + charset[c] = 1; +@@ -195,13 +198,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) + (*p)++; + } + else + return SETCHARSET_FAIL; + } +- else if(c == '\0') { +- return SETCHARSET_FAIL; +- } + else { + charset[c] = 1; + (*p)++; + something_found = TRUE; + } +@@ -276,13 +276,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) + (*p)++; + } + else if(c == ']') { + return SETCHARSET_OK; + } +- else if(c == '\0') { +- return SETCHARSET_FAIL; +- } + else if(ISPRINT(c)) { + charset[c] = 1; + (*p)++; + state = CURLFNM_SCHS_DEFAULT; + } +diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc +index dc1cc03bc..6eb37d81d 100644 +--- a/tests/data/Makefile.inc.1 2017-11-29 20:00:26.126452486 +0000 ++++ b/tests/data/Makefile.inc 2017-11-29 20:01:13.057783732 +0000 +@@ -121,6 +121,7 @@ + test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \ + test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \ + test1144 \ ++test1163 \ + test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ + test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ + test1216 test1217 test1218 test1219 \ +diff --git a/tests/data/test1163 b/tests/data/test1163 +new file mode 100644 +index 000000000..a109b511b +--- /dev/null ++++ b/tests/data/test1163 +@@ -0,0 +1,52 @@ ++ ++ ++ ++FTP ++RETR ++LIST ++wildcardmatch ++ftplistparser ++flaky ++ ++ ++ ++# ++# Server-side ++ ++ ++ ++ ++ ++# Client-side ++ ++ ++ftp ++ ++ ++lib576 ++ ++ ++FTP wildcard with pattern ending with an open-bracket ++ ++ ++"ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*[][" ++ ++ ++ ++ ++USER anonymous ++PASS ftp@example.com ++PWD ++CWD fully_simulated ++CWD DOS ++EPSV ++TYPE A ++LIST ++QUIT ++ ++# 78 == CURLE_REMOTE_FILE_NOT_FOUND ++ ++78 ++ ++ ++ +-- +2.15.0 + diff --git a/package/network/utils/curl/patches/200-no_docs_tests.patch b/package/network/utils/curl/patches/200-no_docs_tests.patch index a2a685125..139c05e64 100644 --- a/package/network/utils/curl/patches/200-no_docs_tests.patch +++ b/package/network/utils/curl/patches/200-no_docs_tests.patch @@ -1,22 +1,22 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -156,7 +156,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) +@@ -153,7 +153,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) bin_SCRIPTS = curl-config - SUBDIRS = lib src --DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs -+DIST_SUBDIRS = $(SUBDIRS) packages include + SUBDIRS = lib src include +-DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts ++DIST_SUBDIRS = $(SUBDIRS) packages pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc -@@ -267,8 +267,8 @@ cygwinbin: - # We extend the standard install with a custom hook: - install-data-hook: - cd include && $(MAKE) install -- cd docs && $(MAKE) install -- cd docs/libcurl && $(MAKE) install -+ #cd docs && $(MAKE) install -+ #cd docs/libcurl && $(MAKE) install +--- a/Makefile.in ++++ b/Makefile.in +@@ -613,7 +613,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) - # We extend the standard uninstall with a custom hook: - uninstall-hook: + bin_SCRIPTS = curl-config + SUBDIRS = lib src include +-DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts ++DIST_SUBDIRS = $(SUBDIRS) packages + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = libcurl.pc + LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c \ diff --git a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch index aabf274ac..22b838daa 100644 --- a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch +++ b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch @@ -1,8 +1,8 @@ --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c -@@ -814,7 +814,7 @@ static void Curl_mbedtls_session_free(vo +@@ -724,7 +724,7 @@ void Curl_mbedtls_session_free(void *ptr - static size_t Curl_mbedtls_version(char *buffer, size_t size) + size_t Curl_mbedtls_version(char *buffer, size_t size) { - unsigned int version = mbedtls_version_get_number(); + unsigned int version = MBEDTLS_VERSION_NUMBER; diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index 7a3a82569..da7b7416a 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=ebtables PKG_SOURCE_DATE:=2015-10-28 PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://git.netfilter.org/ebtables +PKG_SOURCE_URL:=git://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index 2f420a2e2..ea8f02631 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -8,12 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=2.0.10 +PKG_VERSION:=2.0.9 +PKG_VERSION_SUFFIX:=a PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=7fe4348dcca313b74e0aa9c34a8ccd713b84a5615b8578f4aa94cedce9891ef2 -PKG_SOURCE_URL:=@SF/iperf2 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VERSION_SUFFIX).tar.gz +# Temporary URL change - iperf upstream altered the already released target +# without bumping the version number. The new tarball is renamed to avoid +# conflicts with existing mirrored files. +# PKG_SOURCE_URL:=@SF/iperf2 +PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources +PKG_HASH:=db02911f35686e808ed247160dfa766e08ae3f59d1e7dcedef0ffb2a6643f0bf PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/Makefile b/package/network/utils/iperf3/Makefile index a64d7396a..56782ea52 100644 --- a/package/network/utils/iperf3/Makefile +++ b/package/network/utils/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.3 +PKG_VERSION:=3.1.4 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.es.net/pub/iperf -PKG_HASH:=6f596271251056bffc11bbb8f17d4244ad9a7d4a317c2459fdbb853ae51284d8 +PKG_HASH:=db61d70ac62003ebe0bf15496bd8c4b3c4b728578a44d0a1a88fcf8afc0e8f76 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -21,40 +21,18 @@ PKG_LICENSE:=BSD-3-Clause PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf - include $(INCLUDE_DIR)/package.mk -DISABLE_NLS:= - -define Package/iperf3/default +define Package/iperf3 SECTION:=net CATEGORY:=Network TITLE:=Internet Protocol bandwidth measuring tool URL:=https://github.com/esnet/iperf endef -define Package/iperf3 -$(call Package/iperf3/default) - VARIANT:=nossl -endef - -define Package/iperf3-ssl -$(call Package/iperf3/default) - TITLE+= with iperf_auth support - VARIANT:=ssl - DEPENDS:= +libopenssl -endef - TARGET_CFLAGS += -D_GNU_SOURCE CONFIGURE_ARGS += --disable-shared -ifeq ($(BUILD_VARIANT),ssl) - CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" -else - CONFIGURE_ARGS += --without-openssl -endif - MAKE_FLAGS += noinst_PROGRAMS= define Package/iperf3/description @@ -63,21 +41,9 @@ define Package/iperf3/description characteristics. endef -# autoreconf fails if the README file isn't present -define Build/Prepare - $(call Build/Prepare/Default) - touch $(PKG_BUILD_DIR)/README -endef - define Package/iperf3/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ endef -define Package/iperf3-ssl/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ -endef - $(eval $(call BuildPackage,iperf3)) -$(eval $(call BuildPackage,iperf3-ssl)) diff --git a/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch deleted file mode 100644 index d617ba9f4..000000000 --- a/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch +++ /dev/null @@ -1,300 +0,0 @@ -The following patches are taken directly from: - -https://github.com/esnet/iperf/pull/664 - -as an upstream submission. - -commit b63d41b25f49a76d0be66edfb61bd4cb68921d55 -Author: Philip Prindeville -Date: Tue Oct 31 13:41:08 2017 -0600 - - Fix warnings about _GNU_SOURCE being redefined. - - Signed-off-by: Philip Prindeville - -diff --git a/src/iperf.h b/src/iperf.h -index bb951dc..b656784 100755 ---- a/src/iperf.h -+++ b/src/iperf.h -@@ -36,7 +36,9 @@ - #endif - #include - #include --#define _GNU_SOURCE -+#ifndef _GNU_SOURCE -+# define _GNU_SOURCE -+#endif - #include - - #if defined(HAVE_CPUSET_SETAFFINITY) -diff --git a/src/iperf_api.c b/src/iperf_api.c -index ab30b93..9e41238 100755 ---- a/src/iperf_api.c -+++ b/src/iperf_api.c -@@ -24,7 +24,9 @@ - * This code is distributed under a BSD style license, see the LICENSE file - * for complete information. - */ --#define _GNU_SOURCE -+#ifndef _GNU_SOURCE -+# define _GNU_SOURCE -+#endif - #define __USE_GNU - - #include "iperf_config.h" - -commit 315254cfc5f5682627f4a46ade3100bc3c64cfcc -Author: Philip Prindeville -Date: Tue Oct 31 13:42:58 2017 -0600 - - Fix warnings of format-specified mismatching type - - Signed-off-by: Philip Prindeville - -diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c -index 91cf032..6f86d5d 100644 ---- a/src/iperf_tcp.c -+++ b/src/iperf_tcp.c -@@ -24,8 +24,6 @@ - * This code is distributed under a BSD style license, see the LICENSE - * file for complete information. - */ --#include "iperf_config.h" -- - #include - #include - #include -@@ -44,6 +42,12 @@ - #include "net.h" - #include "cjson.h" - -+#if defined(HAVE_INTTYPES_H) -+# include -+#else -+# define PRIu64 "llu" -+#endif -+ - #if defined(HAVE_FLOWLABEL) - #include "flowlabel.h" - #endif /* HAVE_FLOWLABEL */ -@@ -90,7 +94,7 @@ iperf_tcp_send(struct iperf_stream *sp) - sp->result->bytes_sent_this_interval += r; - - if (sp->test->debug) -- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); -+ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); - - return r; - } -diff --git a/src/iperf_udp.c b/src/iperf_udp.c -index a2ea6d0..d04ae44 100644 ---- a/src/iperf_udp.c -+++ b/src/iperf_udp.c -@@ -48,6 +48,12 @@ - #include "cjson.h" - #include "portable_endian.h" - -+#if defined(HAVE_INTTYPES_H) -+# include -+#else -+# define PRIu64 "llu" -+#endif -+ - /* iperf_udp_recv - * - * receives the data for UDP -@@ -98,7 +104,7 @@ iperf_udp_recv(struct iperf_stream *sp) - } - - if (sp->test->debug) -- fprintf(stderr, "pcount %llu packet_count %d\n", pcount, sp->packet_count); -+ fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); - - /* - * Try to handle out of order packets. The way we do this -@@ -141,7 +147,7 @@ iperf_udp_recv(struct iperf_stream *sp) - - /* Log the out-of-order packet */ - if (sp->test->debug) -- fprintf(stderr, "OUT OF ORDER - incoming packet sequence %llu but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); -+ fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); - } - - /* -@@ -220,7 +226,7 @@ iperf_udp_send(struct iperf_stream *sp) - sp->result->bytes_sent_this_interval += r; - - if (sp->test->debug) -- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); -+ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); - - return r; - } - -commit 9a66b3b0349e0a158bb4940b668a5cbc7c245762 -Author: Philip Prindeville -Date: Tue Oct 31 13:44:34 2017 -0600 - - Simplify endianness checks - - Linux can be built with too many types of C run-time library and it's - not reasonable to have to enumerate all of them, especially since at - least one of them (MUSL) goes out of its way to not be easily - detectable. - - Instead, leverage autoconf better for Linux/BSD to detect either - or directly. - - Signed-off-by: Philip Prindeville - -diff --git a/configure.ac b/configure.ac -index f57e83f..cfb42ac 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -101,6 +101,14 @@ AC_CHECK_HEADERS([netinet/sctp.h], - #endif - ]) - -+AC_CHECK_HEADER([endian.h], -+ AC_DEFINE([HAVE_ENDIAN_H], [1], [Define to 1 if you have the header file.]), -+ AC_CHECK_HEADER([sys/endian.h], -+ AC_DEFINE([HAVE_SYS_ENDIAN_H], [1], [Define to 1 if you have the header file.]), -+ AC_MSG_WARN([Couldn't find endian.h or sys/endian.h files: doing compile-time tests.]) -+ ) -+ ) -+ - if test "x$with_openssl" = "xno"; then - AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) - else -diff --git a/src/iperf_config.h.in b/src/iperf_config.h.in -index bd03935..a9e51ec 100644 ---- a/src/iperf_config.h.in -+++ b/src/iperf_config.h.in -@@ -9,6 +9,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_DLFCN_H - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_ENDIAN_H -+ - /* Have IPv6 flowlabel support. */ - #undef HAVE_FLOWLABEL - -@@ -54,6 +57,9 @@ - /* Define to 1 if the system has the type `struct sctp_assoc_value'. */ - #undef HAVE_STRUCT_SCTP_ASSOC_VALUE - -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_ENDIAN_H -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_SYS_SOCKET_H - -diff --git a/src/portable_endian.h b/src/portable_endian.h -index b86d37a..5dbc6e5 100644 ---- a/src/portable_endian.h -+++ b/src/portable_endian.h -@@ -10,14 +10,33 @@ - - #endif - --// GLIBC / Linux with endian(3) support, which was added in glibc 2.9. --// Intended to support CentOS 6 and newer. --#if defined(__linux__) && \ -- ((__GLIBC__ > 3) || \ -- (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9)) -- -+#if defined(HAVE_ENDIAN_H) - # include - -+#elif defined(HAVE_SYS_ENDIAN_H) -+# include -+ -+# if defined(__OpenBSD__) -+ -+# define be16toh(x) betoh16(x) -+# define le16toh(x) letoh16(x) -+ -+# define be32toh(x) betoh32(x) -+# define le32toh(x) letoh32(x) -+ -+# define be64toh(x) betoh64(x) -+# define le64toh(x) letoh64(x) -+ -+# elif defined(__sgi) -+ -+# include -+# include -+ -+# define be64toh(x) (x) -+# define htobe64(x) (x) -+ -+# endif -+ - #elif defined(__CYGWIN__) - - # include -@@ -46,32 +65,6 @@ - # define __LITTLE_ENDIAN LITTLE_ENDIAN - # define __PDP_ENDIAN PDP_ENDIAN - --#elif defined(__OpenBSD__) -- --# include -- --# define be16toh(x) betoh16(x) --# define le16toh(x) letoh16(x) -- --# define be32toh(x) betoh32(x) --# define le32toh(x) letoh32(x) -- --# define be64toh(x) betoh64(x) --# define le64toh(x) letoh64(x) -- --#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) -- --# include -- --#elif defined(__sgi) -- --# include --# include --# include -- --# define be64toh(x) (x) --# define htobe64(x) (x) -- - #elif defined(__sun) && defined(__SVR4) - - # include - -commit 7e7285d0daf92ef7beda8f78a6f63cc647a77f38 -Author: Philip Prindeville -Date: Tue Oct 31 13:48:06 2017 -0600 - - Sys headers should not be included directly - - There's usually a top-level header which then includes the sys/ - descendent. - - Signed-off-by: Philip Prindeville - -diff --git a/src/net.c b/src/net.c -index af456cb..afd0022 100644 ---- a/src/net.c -+++ b/src/net.c -@@ -31,13 +31,12 @@ - #include - #include - #include --#include - #include - #include - #include - #include - #include --#include -+#include - - #ifdef HAVE_SENDFILE - #ifdef linux diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 5f718748d..1f566f0c4 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,122 +8,87 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=4.14.1 -PKG_RELEASE:=2 +PKG_VERSION:=4.4.0 +PKG_RELEASE:=10 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=d43ac068afcc350a448f4581b6e292331ef7e4e7aa746e34981582d5fdb10067 +PKG_HASH:=bc91c367288a19f78ef800cd6840363be1f22da8436fbae88e1a7250490d6514 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/iproute2/Default + TITLE:=Routing control utility ($(2)) SECTION:=net CATEGORY:=Network URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 SUBMENU:=Routing and Redirection MAINTAINER:=Russell Senior + DEPENDS:= +libnl-tiny + VARIANT:=$(1) + PROVIDES:=$(3) endef define Package/ip-tiny -$(call Package/iproute2/Default) - TITLE:=Routing control utility (Minimal) - VARIANT:=tiny - PROVIDES:=ip - ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +$(call Package/iproute2/Default,tiny,Minimal,ip) + CONFLICTS:=ip-full endef -define Package/ip-full -$(call Package/iproute2/Default) - TITLE:=Routing control utility (Full) - VARIANT:=full - PROVIDES:=ip - ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl -endef +Package/ip-full:=$(call Package/iproute2/Default,full,Full,ip) define Package/tc $(call Package/iproute2/Default) TITLE:=Traffic control utility - DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl + DEPENDS:=+kmod-sched-core endef define Package/genl $(call Package/iproute2/Default) TITLE:=General netlink utility frontend - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-bridge $(call Package/iproute2/Default) TITLE:=Bridge configuration utility from iproute2 - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ss $(call Package/iproute2/Default) TITLE:=Socket statistics utility - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/nstat $(call Package/iproute2/Default) TITLE:=Network statistics utility - DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl -endef - -define Package/devlink -$(call Package/iproute2/Default) - TITLE:=Network devlink utility - DEPENDS:=+libmnl -endef - -define Package/rdma -$(call Package/iproute2/Default) - TITLE:=Network rdma utility - DEPENDS:=+libmnl endef ifeq ($(BUILD_VARIANT),tiny) IP_CONFIG_TINY:=y endif -ifdef CONFIG_PACKAGE_devlink - HAVE_MNL:=y -endif - -ifdef CONFIG_PACKAGE_rdma - HAVE_MNL:=y -endif - define Build/Configure $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile - echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \ + echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-lede\";" \ > $(PKG_BUILD_DIR)/include/SNAPSHOT.h endef +TARGET_CFLAGS += -DHAVE_SETNS TARGET_CFLAGS += -ffunction-sections -fdata-sections MAKE_FLAGS += \ - EXTRA_CCOPTS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \ + EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \ KERNEL_INCLUDE="$(LINUX_DIR)/include" \ SHARED_LIBS="" \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ IP_CONFIG_TINY=$(IP_CONFIG_TINY) \ - HAVE_MNL=$(HAVE_MNL) \ - IPT_LIB_DIR=/usr/lib/iptables \ FPIC="$(FPIC)" define Build/Compile @@ -138,13 +103,13 @@ define Build/InstallDev endef define Package/ip-tiny/install - $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-tiny + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/ endef define Package/ip-full/install - $(INSTALL_DIR) $(1)/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-full + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/ endef define Package/tc/install @@ -174,16 +139,6 @@ define Package/nstat/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/nstat $(1)/usr/sbin/ endef -define Package/devlink/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/ -endef - -define Package/rdma/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/ -endef - $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) $(eval $(call BuildPackage,tc)) @@ -191,5 +146,3 @@ $(eval $(call BuildPackage,genl)) $(eval $(call BuildPackage,ip-bridge)) $(eval $(call BuildPackage,ss)) $(eval $(call BuildPackage,nstat)) -$(eval $(call BuildPackage,devlink)) -$(eval $(call BuildPackage,rdma)) diff --git a/package/network/utils/iproute2/patches/001-config.patch b/package/network/utils/iproute2/patches/001-config.patch index 7f23cfc35..ece865299 100644 --- a/package/network/utils/iproute2/patches/001-config.patch +++ b/package/network/utils/iproute2/patches/001-config.patch @@ -2,6 +2,6 @@ +++ b/Config @@ -0,0 +1,4 @@ +# Fixed config to disable ATM support even if present on host system -+IP_CONFIG_SETNS:=y +TC_CONFIG_ATM:=n -+TC_CONFIG_XT:=y ++TC_CONFIG_ACTION_GACT=y ++TC_CONFIG_ACTION_PROB=y diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch index 1f3eb101e..e1a5e9756 100644 --- a/package/network/utils/iproute2/patches/004-darwin_fixes.patch +++ b/package/network/utils/iproute2/patches/004-darwin_fixes.patch @@ -42,7 +42,7 @@ #define TABLESIZE 16384 --- a/netem/paretonormal.c +++ b/netem/paretonormal.c -@@ -14,10 +14,13 @@ +@@ -15,10 +15,13 @@ #include #include #include diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch index e23fbcd77..6805468d8 100644 --- a/package/network/utils/iproute2/patches/006-no_sctp.patch +++ b/package/network/utils/iproute2/patches/006-no_sctp.patch @@ -1,6 +1,6 @@ --- a/ip/ipxfrm.c +++ b/ip/ipxfrm.c -@@ -454,7 +454,6 @@ void xfrm_selector_print(struct xfrm_sel +@@ -470,7 +470,6 @@ void xfrm_selector_print(struct xfrm_sel switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: @@ -8,7 +8,7 @@ case IPPROTO_DCCP: default: /* XXX */ if (sel->sport_mask) -@@ -1329,7 +1328,6 @@ static int xfrm_selector_upspec_parse(st +@@ -1341,7 +1340,6 @@ static int xfrm_selector_upspec_parse(st switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: diff --git a/package/network/utils/iproute2/patches/007-no_arpd.patch b/package/network/utils/iproute2/patches/007-no_arpd.patch index ac216ba82..94fb197a4 100644 --- a/package/network/utils/iproute2/patches/007-no_arpd.patch +++ b/package/network/utils/iproute2/patches/007-no_arpd.patch @@ -2,7 +2,7 @@ +++ b/misc/Makefile @@ -5,9 +5,9 @@ TARGETS=ss nstat ifstat rtacct lnstat - include ../config.mk + include ../Config -ifeq ($(HAVE_BERKELEY_DB),y) - TARGETS += arpd @@ -11,5 +11,5 @@ +# TARGETS += arpd +#endif - all: $(TARGETS) - + ifeq ($(HAVE_SELINUX),y) + LDLIBS += $(shell $(PKG_CONFIG) --libs libselinux) diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch index 2e088f199..fce16e02d 100644 --- a/package/network/utils/iproute2/patches/008-no_netem.patch +++ b/package/network/utils/iproute2/patches/008-no_netem.patch @@ -1,11 +1,11 @@ --- a/Makefile +++ b/Makefile -@@ -49,7 +49,7 @@ WFLAGS += -Wmissing-declarations -Wold-s - CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) +@@ -41,7 +41,7 @@ WFLAGS += -Wmissing-declarations -Wold-s + CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v --SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man -+SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man +-SUBDIRS=lib ip tc bridge misc netem genl tipc man ++SUBDIRS=lib ip tc bridge misc genl tipc man LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a LDLIBS += $(LIBNETLINK) diff --git a/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch deleted file mode 100644 index 7a5a70223..000000000 --- a/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/configure -+++ b/configure -@@ -292,7 +292,7 @@ check_selinux() - - check_mnl() - { -- if ${PKG_CONFIG} libmnl --exists -+ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists - then - echo "HAVE_MNL:=y" >>$CONFIG - echo "yes" diff --git a/package/network/utils/iproute2/patches/010-type_fixes.patch b/package/network/utils/iproute2/patches/010-type_fixes.patch new file mode 100644 index 000000000..e0055fce7 --- /dev/null +++ b/package/network/utils/iproute2/patches/010-type_fixes.patch @@ -0,0 +1,396 @@ +--- a/include/iptables_common.h ++++ b/include/iptables_common.h +@@ -2,6 +2,8 @@ + #define _IPTABLES_COMMON_H + /* Shared definitions between ipv4 and ipv6. */ + ++#include ++ + enum exittype { + OTHER_PROBLEM = 1, + PARAMETER_PROBLEM, +@@ -43,9 +45,9 @@ extern char *lib_dir; + extern void init_extensions(void); + #endif + +-#define __be32 u_int32_t +-#define __le32 u_int32_t +-#define __be16 u_int16_t +-#define __le16 u_int16_t ++#define __be32 uint32_t ++#define __le32 uint32_t ++#define __be16 uint16_t ++#define __le16 uint16_t + + #endif /*_IPTABLES_COMMON_H*/ +--- a/include/netinet/tcp.h ++++ /dev/null +@@ -1,231 +0,0 @@ +-/* +- * Copyright (c) 1982, 1986, 1993 +- * The Regents of the University of California. All rights reserved. +- * +- * Redistribution and use in source and binary forms, with or without +- * modification, are permitted provided that the following conditions +- * are met: +- * 1. Redistributions of source code must retain the above copyright +- * notice, this list of conditions and the following disclaimer. +- * 2. Redistributions in binary form must reproduce the above copyright +- * notice, this list of conditions and the following disclaimer in the +- * documentation and/or other materials provided with the distribution. +- * 4. Neither the name of the University nor the names of its contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +- * SUCH DAMAGE. +- * +- * @(#)tcp.h 8.1 (Berkeley) 6/10/93 +- */ +- +-#ifndef _NETINET_TCP_H +-#define _NETINET_TCP_H 1 +- +-#include +- +-/* +- * User-settable options (used with setsockopt). +- */ +-#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ +-#define TCP_MAXSEG 2 /* Set maximum segment size */ +-#define TCP_CORK 3 /* Control sending of partial frames */ +-#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ +-#define TCP_KEEPINTVL 5 /* Interval between keepalives */ +-#define TCP_KEEPCNT 6 /* Number of keepalives before death */ +-#define TCP_SYNCNT 7 /* Number of SYN retransmits */ +-#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ +-#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ +-#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ +-#define TCP_INFO 11 /* Information about this connection. */ +-#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ +-#define TCP_CONGESTION 13 /* Congestion control algorithm. */ +- +-#ifdef __USE_MISC +-# include +- +-# ifdef __FAVOR_BSD +-typedef u_int32_t tcp_seq; +-/* +- * TCP header. +- * Per RFC 793, September, 1981. +- */ +-struct tcphdr +- { +- u_int16_t th_sport; /* source port */ +- u_int16_t th_dport; /* destination port */ +- tcp_seq th_seq; /* sequence number */ +- tcp_seq th_ack; /* acknowledgement number */ +-# if __BYTE_ORDER == __LITTLE_ENDIAN +- u_int8_t th_x2:4; /* (unused) */ +- u_int8_t th_off:4; /* data offset */ +-# endif +-# if __BYTE_ORDER == __BIG_ENDIAN +- u_int8_t th_off:4; /* data offset */ +- u_int8_t th_x2:4; /* (unused) */ +-# endif +- u_int8_t th_flags; +-# define TH_FIN 0x01 +-# define TH_SYN 0x02 +-# define TH_RST 0x04 +-# define TH_PUSH 0x08 +-# define TH_ACK 0x10 +-# define TH_URG 0x20 +- u_int16_t th_win; /* window */ +- u_int16_t th_sum; /* checksum */ +- u_int16_t th_urp; /* urgent pointer */ +-}; +- +-# else /* !__FAVOR_BSD */ +-struct tcphdr +- { +- u_int16_t source; +- u_int16_t dest; +- u_int32_t seq; +- u_int32_t ack_seq; +-# if __BYTE_ORDER == __LITTLE_ENDIAN +- u_int16_t res1:4; +- u_int16_t doff:4; +- u_int16_t fin:1; +- u_int16_t syn:1; +- u_int16_t rst:1; +- u_int16_t psh:1; +- u_int16_t ack:1; +- u_int16_t urg:1; +- u_int16_t res2:2; +-# elif __BYTE_ORDER == __BIG_ENDIAN +- u_int16_t doff:4; +- u_int16_t res1:4; +- u_int16_t res2:2; +- u_int16_t urg:1; +- u_int16_t ack:1; +- u_int16_t psh:1; +- u_int16_t rst:1; +- u_int16_t syn:1; +- u_int16_t fin:1; +-# else +-# error "Adjust your defines" +-# endif +- u_int16_t window; +- u_int16_t check; +- u_int16_t urg_ptr; +-}; +-# endif /* __FAVOR_BSD */ +- +-enum +-{ +- TCP_ESTABLISHED = 1, +- TCP_SYN_SENT, +- TCP_SYN_RECV, +- TCP_FIN_WAIT1, +- TCP_FIN_WAIT2, +- TCP_TIME_WAIT, +- TCP_CLOSE, +- TCP_CLOSE_WAIT, +- TCP_LAST_ACK, +- TCP_LISTEN, +- TCP_CLOSING /* now a valid state */ +-}; +- +-# define TCPOPT_EOL 0 +-# define TCPOPT_NOP 1 +-# define TCPOPT_MAXSEG 2 +-# define TCPOLEN_MAXSEG 4 +-# define TCPOPT_WINDOW 3 +-# define TCPOLEN_WINDOW 3 +-# define TCPOPT_SACK_PERMITTED 4 /* Experimental */ +-# define TCPOLEN_SACK_PERMITTED 2 +-# define TCPOPT_SACK 5 /* Experimental */ +-# define TCPOPT_TIMESTAMP 8 +-# define TCPOLEN_TIMESTAMP 10 +-# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ +- +-# define TCPOPT_TSTAMP_HDR \ +- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) +- +-/* +- * Default maximum segment size for TCP. +- * With an IP MSS of 576, this is 536, +- * but 512 is probably more convenient. +- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). +- */ +-# define TCP_MSS 512 +- +-# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ +- +-# define TCP_MAX_WINSHIFT 14 /* maximum window shift */ +- +-# define SOL_TCP 6 /* TCP level */ +- +- +-# define TCPI_OPT_TIMESTAMPS 1 +-# define TCPI_OPT_SACK 2 +-# define TCPI_OPT_WSCALE 4 +-# define TCPI_OPT_ECN 8 +-# define TCPI_OPT_ECN_SEEN 16 +- +-/* Values for tcpi_state. */ +-enum tcp_ca_state +-{ +- TCP_CA_Open = 0, +- TCP_CA_Disorder = 1, +- TCP_CA_CWR = 2, +- TCP_CA_Recovery = 3, +- TCP_CA_Loss = 4 +-}; +- +-struct tcp_info +-{ +- u_int8_t tcpi_state; +- u_int8_t tcpi_ca_state; +- u_int8_t tcpi_retransmits; +- u_int8_t tcpi_probes; +- u_int8_t tcpi_backoff; +- u_int8_t tcpi_options; +- u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; +- +- u_int32_t tcpi_rto; +- u_int32_t tcpi_ato; +- u_int32_t tcpi_snd_mss; +- u_int32_t tcpi_rcv_mss; +- +- u_int32_t tcpi_unacked; +- u_int32_t tcpi_sacked; +- u_int32_t tcpi_lost; +- u_int32_t tcpi_retrans; +- u_int32_t tcpi_fackets; +- +- /* Times. */ +- u_int32_t tcpi_last_data_sent; +- u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ +- u_int32_t tcpi_last_data_recv; +- u_int32_t tcpi_last_ack_recv; +- +- /* Metrics. */ +- u_int32_t tcpi_pmtu; +- u_int32_t tcpi_rcv_ssthresh; +- u_int32_t tcpi_rtt; +- u_int32_t tcpi_rttvar; +- u_int32_t tcpi_snd_ssthresh; +- u_int32_t tcpi_snd_cwnd; +- u_int32_t tcpi_advmss; +- u_int32_t tcpi_reordering; +- u_int32_t tcpi_rcv_rtt; +- u_int32_t tcpi_rcv_space; +- u_int32_t tcpi_total_retrans; +- +-}; +- +-#endif /* Misc. */ +- +-#endif /* netinet/tcp.h */ +--- a/include/iptables.h ++++ b/include/iptables.h +@@ -20,7 +20,7 @@ struct ipt_get_revision + { + char name[IPT_FUNCTION_MAXNAMELEN-1]; + +- u_int8_t revision; ++ uint8_t revision; + }; + #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */ + +@@ -39,7 +39,7 @@ struct iptables_match + ipt_chainlabel name; + + /* Revision of match (0 by default). */ +- u_int8_t revision; ++ uint8_t revision; + + const char *version; + +@@ -92,7 +92,7 @@ struct iptables_target + ipt_chainlabel name; + + /* Revision of target (0 by default). */ +- u_int8_t revision; ++ uint8_t revision; + + const char *version; + +@@ -153,7 +153,7 @@ extern char *mask_to_dotted(const struct + + extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp, + struct in_addr *maskp, unsigned int *naddrs); +-extern u_int16_t parse_protocol(const char *s); ++extern uint16_t parse_protocol(const char *s); + + extern int do_command(int argc, char *argv[], char **table, + iptc_handle_t *handle); +--- a/lib/dnet_ntop.c ++++ b/lib/dnet_ntop.c +@@ -1,24 +1,25 @@ + #include + #include ++#include + #include + #include + + #include "utils.h" + +-static __inline__ u_int16_t dn_ntohs(u_int16_t addr) ++static __inline__ uint16_t dn_ntohs(uint16_t addr) + { + union { +- u_int8_t byte[2]; +- u_int16_t word; ++ uint8_t byte[2]; ++ uint16_t word; + } u; + + u.word = addr; +- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); ++ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); + } + +-static __inline__ int do_digit(char *str, u_int16_t *addr, u_int16_t scale, size_t *pos, size_t len, int *started) ++static __inline__ int do_digit(char *str, uint16_t *addr, uint16_t scale, size_t *pos, size_t len, int *started) + { +- u_int16_t tmp = *addr / scale; ++ uint16_t tmp = *addr / scale; + + if (*pos == len) + return 1; +@@ -36,7 +37,7 @@ static __inline__ int do_digit(char *str + + static const char *dnet_ntop1(const struct dn_naddr *dna, char *str, size_t len) + { +- u_int16_t addr, area; ++ uint16_t addr, area; + size_t pos = 0; + int started = 0; + +--- a/lib/dnet_pton.c ++++ b/lib/dnet_pton.c +@@ -1,23 +1,24 @@ + #include + #include ++#include + #include + #include + + #include "utils.h" + +-static __inline__ u_int16_t dn_htons(u_int16_t addr) ++static __inline__ uint16_t dn_htons(uint16_t addr) + { + union { +- u_int8_t byte[2]; +- u_int16_t word; ++ uint8_t byte[2]; ++ uint16_t word; + } u; + + u.word = addr; +- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); ++ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); + } + + +-static int dnet_num(const char *src, u_int16_t * dst) ++static int dnet_num(const char *src, uint16_t * dst) + { + int rv = 0; + int tmp; +@@ -38,9 +39,9 @@ static int dnet_num(const char *src, u_i + + static int dnet_pton1(const char *src, struct dn_naddr *dna) + { +- u_int16_t addr; +- u_int16_t area = 0; +- u_int16_t node = 0; ++ uint16_t addr; ++ uint16_t area = 0; ++ uint16_t node = 0; + int pos; + + pos = dnet_num(src, &area); +--- a/include/libiptc/ipt_kernel_headers.h ++++ b/include/libiptc/ipt_kernel_headers.h +@@ -5,7 +5,7 @@ + + #include + +-#if defined(__GLIBC__) && __GLIBC__ == 2 ++#if 1 + #include + #include + #include diff --git a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch index caf889e12..ce958a934 100644 --- a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch +++ b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch @@ -1,6 +1,6 @@ --- a/tc/q_fifo.c +++ b/tc/q_fifo.c -@@ -97,5 +97,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ +@@ -98,5 +98,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt); struct qdisc_util pfifo_fast_qdisc_util = { .id = "pfifo_fast", diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch index e779934d7..3cb5a7940 100644 --- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch +++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -42,7 +42,7 @@ HOSTCC ?= $(CC) +@@ -34,7 +34,7 @@ HOSTCC = gcc DEFINES += -D_GNU_SOURCE # Turn on transparent support for LFS DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch index 83ce66d97..1f397f71b 100644 --- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch +++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch @@ -1,10 +1,11 @@ --- a/lib/Makefile +++ b/lib/Makefile -@@ -1,6 +1,6 @@ - include ../config.mk +@@ -4,7 +4,7 @@ ifeq ($(IP_CONFIG_SETNS),y) + CFLAGS += -DHAVE_SETNS + endif -CFLAGS += -fPIC +CFLAGS += $(FPIC) UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ - inet_proto.o namespace.o json_writer.o json_print.o \ + inet_proto.o namespace.o json_writer.o \ diff --git a/package/network/utils/iproute2/patches/130-missing_include.patch b/package/network/utils/iproute2/patches/130-missing_include.patch new file mode 100644 index 000000000..8759a6259 --- /dev/null +++ b/package/network/utils/iproute2/patches/130-missing_include.patch @@ -0,0 +1,20 @@ +--- a/lib/namespace.c ++++ b/lib/namespace.c +@@ -10,6 +10,7 @@ + #include + #include + #include ++#include + + #include "utils.h" + #include "namespace.h" +--- a/lib/rt_names.c ++++ b/lib/rt_names.c +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include + #include diff --git a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch deleted file mode 100644 index e3364ad05..000000000 --- a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch +++ /dev/null @@ -1,107 +0,0 @@ -From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001 -From: David Heidelberger -Date: Mon, 29 Jun 2015 16:50:40 +0200 -Subject: [PATCH 2/3] uapi/libc-compat.h: do not rely on __GLIBC__ - -Musl provides the same structs as glibc, but does not provide a define to -allow its detection. Since the absence of __GLIBC__ also can mean that it -is included from the kernel, change the __GLIBC__ detection to -!__KERNEL__, which should always be true when included from userspace. - -Signed-off-by: John Spencer -Tested-by: David Heidelberger -Signed-off-by: Jonas Gorski ---- - include/uapi/linux/libc-compat.h | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - ---- a/include/uapi/linux/libc-compat.h -+++ b/include/uapi/linux/libc-compat.h -@@ -49,13 +49,13 @@ - #ifndef _LIBC_COMPAT_H - #define _LIBC_COMPAT_H - --/* We have included glibc headers... */ --#if defined(__GLIBC__) -+/* We have included libc headers... */ -+#if !defined(__KERNEL__) - --/* Coordinate with glibc net/if.h header. */ --#if defined(_NET_IF_H) && defined(__USE_MISC) -+/* Coordinate with libc net/if.h header. */ -+#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) - --/* GLIBC headers included first so don't define anything -+/* LIBC headers included first so don't define anything - * that would already be defined. */ - - #define __UAPI_DEF_IF_IFCONF 0 -@@ -66,7 +66,11 @@ - #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 - /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ - #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO -+#ifdef __GLIBC__ - #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 -+#else -+#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 -+#endif - #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ - - #else /* _NET_IF_H */ -@@ -86,10 +90,10 @@ - - #endif /* _NET_IF_H */ - --/* Coordinate with glibc netinet/in.h header. */ -+/* Coordinate with libc netinet/in.h header. */ - #if defined(_NETINET_IN_H) - --/* GLIBC headers included first so don't define anything -+/* LIBC headers included first so don't define anything - * that would already be defined. */ - #define __UAPI_DEF_IN_ADDR 0 - #define __UAPI_DEF_IN_IPPROTO 0 -@@ -103,7 +107,7 @@ - * if the glibc code didn't define them. This guard matches - * the guard in glibc/inet/netinet/in.h which defines the - * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ --#if defined(__USE_MISC) || defined (__USE_GNU) -+#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU) - #define __UAPI_DEF_IN6_ADDR_ALT 0 - #else - #define __UAPI_DEF_IN6_ADDR_ALT 1 -@@ -118,7 +122,7 @@ - #else - - /* Linux headers included first, and we must define everything -- * we need. The expectation is that glibc will check the -+ * we need. The expectation is that the libc will check the - * __UAPI_DEF_* defines and adjust appropriately. */ - #define __UAPI_DEF_IN_ADDR 1 - #define __UAPI_DEF_IN_IPPROTO 1 -@@ -128,7 +132,7 @@ - #define __UAPI_DEF_IN_CLASS 1 - - #define __UAPI_DEF_IN6_ADDR 1 --/* We unconditionally define the in6_addr macros and glibc must -+/* We unconditionally define the in6_addr macros and the libc must - * coordinate. */ - #define __UAPI_DEF_IN6_ADDR_ALT 1 - #define __UAPI_DEF_SOCKADDR_IN6 1 -@@ -169,7 +173,7 @@ - /* If we did not see any headers from any supported C libraries, - * or we are being included in the kernel, then define everything - * that we need. */ --#else /* !defined(__GLIBC__) */ -+#else /* defined(__KERNEL__) */ - - /* Definitions for if.h */ - #define __UAPI_DEF_IF_IFCONF 1 -@@ -209,6 +213,6 @@ - /* Definitions for xattr.h */ - #define __UAPI_DEF_XATTR 1 - --#endif /* __GLIBC__ */ -+#endif /* __KERNEL__ */ - - #endif /* _LIBC_COMPAT_H */ diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch deleted file mode 100644 index abd1f7eac..000000000 --- a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch +++ /dev/null @@ -1,67 +0,0 @@ -From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001 -From: David Heidelberger -Date: Mon, 29 Jun 2015 16:53:03 +0200 -Subject: [PATCH 3/3] uapi/if_ether.h: prevent redefinition of struct ethhdr - -Musl provides its own ethhdr struct definition. Add a guard to prevent -its definition of the appropriate musl header has already been included. - -Signed-off-by: John Spencer -Tested-by: David Heidelberger -Signed-off-by: Jonas Gorski ---- - include/uapi/linux/if_ether.h | 3 +++ - include/uapi/linux/libc-compat.h | 11 +++++++++++ - 2 files changed, 14 insertions(+) - ---- a/include/uapi/linux/if_ether.h -+++ b/include/uapi/linux/if_ether.h -@@ -23,6 +23,7 @@ - #define _LINUX_IF_ETHER_H - - #include -+#include - - /* - * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble -@@ -149,11 +150,13 @@ - * This is an Ethernet frame header. - */ - -+#if __UAPI_DEF_ETHHDR - struct ethhdr { - unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ - unsigned char h_source[ETH_ALEN]; /* source ether addr */ - __be16 h_proto; /* packet type ID field */ - } __attribute__((packed)); -+#endif - - - #endif /* _LINUX_IF_ETHER_H */ ---- a/include/uapi/linux/libc-compat.h -+++ b/include/uapi/linux/libc-compat.h -@@ -90,6 +90,14 @@ - - #endif /* _NET_IF_H */ - -+/* musl defines the ethhdr struct itself in its netinet/if_ether.h. -+ * Glibc just includes the kernel header and uses a different guard. */ -+#if defined(_NETINET_IF_ETHER_H) -+#define __UAPI_DEF_ETHHDR 0 -+#else -+#define __UAPI_DEF_ETHHDR 1 -+#endif -+ - /* Coordinate with libc netinet/in.h header. */ - #if defined(_NETINET_IN_H) - -@@ -185,6 +193,9 @@ - /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ - #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 - -+/* Definitions for if_ether.h */ -+#define __UAPI_DEF_ETHHDR 1 -+ - /* Definitions for in.h */ - #define __UAPI_DEF_IN_ADDR 1 - #define __UAPI_DEF_IN_IPPROTO 1 diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch index 35b588f7e..290adbe5f 100644 --- a/package/network/utils/iproute2/patches/300-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch @@ -1,8 +1,8 @@ --- a/ip/Makefile +++ b/ip/Makefile -@@ -15,6 +15,13 @@ RTMONOBJ=rtmon.o - - include ../config.mk +@@ -17,6 +17,13 @@ ifeq ($(IP_CONFIG_SETNS),y) + CFLAGS += -DHAVE_SETNS + endif +STATIC_SYM_FILTER:= +ifeq ($(IP_CONFIG_TINY),y) @@ -25,24 +25,7 @@ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ --- a/ip/ip.c +++ b/ip/ip.c -@@ -49,10 +49,16 @@ static void usage(void) - fprintf(stderr, - "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" - " ip [ -force ] -batch filename\n" -+#ifndef IPROUTE2_TINY - "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" - " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" - " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" - " vrf | sr }\n" -+#else -+"where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n" -+" mroute | mrule | monitor | netns | macsec | token | ila |\n" -+" vrf | sr }\n" -+#endif - " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" - " -h[uman-readable] | -iec |\n" - " -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n" -@@ -74,32 +80,44 @@ static const struct cmd { +@@ -73,30 +73,42 @@ static const struct cmd { int (*func)(int argc, char **argv); } cmds[] = { { "address", do_ipaddr }, @@ -63,8 +46,6 @@ { "l2tp", do_ipl2tp }, { "fou", do_ipfou }, +#endif - { "ila", do_ipila }, - { "macsec", do_ipmacsec }, { "tunnel", do_iptunnel }, { "tunl", do_iptunnel }, +#ifndef IPROUTE2_TINY @@ -84,12 +65,12 @@ +#ifndef IPROUTE2_TINY { "netconf", do_ipnetconf }, +#endif - { "vrf", do_ipvrf}, - { "sr", do_seg6 }, { "help", do_help }, + { 0 } + }; --- a/lib/utils.c +++ b/lib/utils.c -@@ -817,6 +817,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -710,6 +710,7 @@ const char *rt_addr_n2a(int af, int len, return inet_ntop(af, addr, buf, buflen); case AF_MPLS: return mpls_ntop(af, addr, buf, buflen); @@ -97,7 +78,7 @@ case AF_IPX: return ipx_ntop(af, addr, buf, buflen); case AF_DECnet: -@@ -826,6 +827,7 @@ const char *rt_addr_n2a_r(int af, int le +@@ -718,6 +719,7 @@ const char *rt_addr_n2a(int af, int len, memcpy(dna.a_addr, addr, 2); return dnet_ntop(af, &dna, buf, buflen); } @@ -107,14 +88,14 @@ default: --- a/lib/Makefile +++ b/lib/Makefile -@@ -2,6 +2,10 @@ include ../config.mk - - CFLAGS += $(FPIC) +@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y) + CFLAGS += -DHAVE_SETNS + endif +ifeq ($(IP_CONFIG_TINY),y) + CFLAGS += -DIPROUTE2_TINY +endif + + CFLAGS += $(FPIC) + UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ - inet_proto.o namespace.o json_writer.o json_print.o \ - names.o color.o bpf.o exec.o fs.o diff --git a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch index 1980f8710..ff2e0aa1e 100644 --- a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch +++ b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch @@ -9,6 +9,29 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY ip/rtm_map.c | 4 ++++ 3 files changed, 9 insertions(+) +--- a/include/linux/fib_rules.h ++++ b/include/linux/fib_rules.h +@@ -64,6 +64,10 @@ enum { + FR_ACT_BLACKHOLE, /* Drop without notification */ + FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ + FR_ACT_PROHIBIT, /* Drop with EACCES */ ++ FR_ACT_RES8, ++ FR_ACT_RES9, ++ FR_ACT_RES10, ++ FR_ACT_FAILED_POLICY, /* Drop with EPERM */ + __FR_ACT_MAX, + }; + +--- a/include/linux/rtnetlink.h ++++ b/include/linux/rtnetlink.h +@@ -210,6 +210,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_FAILED_POLICY, /* Source address failed policy */ + __RTN_MAX + }; + --- a/ip/rtm_map.c +++ b/ip/rtm_map.c @@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf @@ -29,13 +52,3 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY else { res = strtoul(arg, &end, 0); if (!end || end == arg || *end || res > 255) ---- a/include/uapi/linux/rtnetlink.h -+++ b/include/uapi/linux/rtnetlink.h -@@ -221,6 +221,7 @@ enum { - RTN_THROW, /* Not in this table */ - RTN_NAT, /* Translate this address */ - RTN_XRESOLVE, /* Use external resolver */ -+ RTN_FAILED_POLICY, /* Source address failed policy */ - __RTN_MAX - }; - diff --git a/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch b/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch new file mode 100644 index 000000000..ca1125d1d --- /dev/null +++ b/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch @@ -0,0 +1,10 @@ +--- a/include/linux/if_bridge.h ++++ b/include/linux/if_bridge.h +@@ -15,7 +15,6 @@ + + #include + #include +-#include + + #define SYSFS_BRIDGE_ATTR "bridge" + #define SYSFS_BRIDGE_FDB "brforward" diff --git a/package/network/utils/iproute2/patches/911-fix_in_h_include.patch b/package/network/utils/iproute2/patches/911-fix_in_h_include.patch new file mode 100644 index 000000000..42a7b24bb --- /dev/null +++ b/package/network/utils/iproute2/patches/911-fix_in_h_include.patch @@ -0,0 +1,30 @@ +--- a/include/linux/in.h ++++ b/include/linux/in.h +@@ -15,6 +15,7 @@ + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ ++#ifndef _NETINET_IN_H + #ifndef _LINUX_IN_H + #define _LINUX_IN_H + +@@ -297,3 +298,4 @@ struct sockaddr_in { + + + #endif /* _LINUX_IN_H */ ++#endif /* _NETINET_IN_H */ +--- a/include/linux/in6.h ++++ b/include/linux/in6.h +@@ -18,6 +18,7 @@ + * 2 of the License, or (at your option) any later version. + */ + ++#ifndef _NETINET_IN_H + #ifndef _LINUX_IN6_H + #define _LINUX_IN6_H + +@@ -291,3 +292,4 @@ struct in6_flowlabel_req { + * MRT6_MAX + */ + #endif /* _LINUX_IN6_H */ ++#endif /* _NETINET_IN_H */ diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 5e91cd7ed..882db8af1 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -1,6 +1,6 @@ ---- a/include/uapi/linux/pkt_sched.h -+++ b/include/uapi/linux/pkt_sched.h -@@ -872,4 +872,63 @@ struct tc_pie_xstats { +--- a/include/linux/pkt_sched.h ++++ b/include/linux/pkt_sched.h +@@ -850,4 +850,63 @@ struct tc_pie_xstats { __u32 maxq; /* maximum queue size */ __u32 ecn_mark; /* packets marked with ecn*/ }; @@ -66,14 +66,14 @@ #endif --- a/tc/Makefile +++ b/tc/Makefile -@@ -65,6 +65,7 @@ TCMODULES += q_codel.o +@@ -63,6 +63,7 @@ TCMODULES += q_codel.o TCMODULES += q_fq_codel.o TCMODULES += q_fq.o TCMODULES += q_pie.o +TCMODULES += q_cake.o TCMODULES += q_hhf.o - TCMODULES += q_clsact.o TCMODULES += e_bpf.o + --- /dev/null +++ b/tc/q_cake.c @@ -0,0 +1,771 @@ diff --git a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch new file mode 100644 index 000000000..610fb525a --- /dev/null +++ b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch @@ -0,0 +1,35 @@ +From c44003f7e7254ac972eaa1b22a686471ea4ce2d7 Mon Sep 17 00:00:00 2001 +From: Liping Zhang +Date: Tue, 20 Sep 2016 02:09:02 -0700 +Subject: [PATCH] ipmonitor: fix ip monitor can't work when NET_NS is not + enabled + +In ip monitor, netns_map_init will check getnsid is supported or not. +But when /proc/self/ns/net does not exist, we just print out error +messages and exit. So user cannot use ip monitor anymore when +CONFIG_NET_NS is disabled: + # ip monitor + open("/proc/self/ns/net"): No such file or directory + +If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false. + +Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid") +Signed-off-by: Liping Zhang +Acked-by: Nicolas Dichtel +--- + ip/ipnetns.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/ip/ipnetns.c ++++ b/ip/ipnetns.c +@@ -73,8 +73,8 @@ static int ipnetns_have_nsid(void) + + fd = open("/proc/self/ns/net", O_RDONLY); + if (fd < 0) { +- perror("open(\"/proc/self/ns/net\")"); +- exit(1); ++ have_rtnl_getnsid = 0; ++ return 0; + } + + addattr32(&req.n, 1024, NETNSA_FD, fd); diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 55b7c493d..f44c1de23 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset -PKG_VERSION:=6.34 +PKG_VERSION:=6.32 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org -PKG_HASH:=d70e831b670b7aa25dde81fd994d3a7ce0c0e801559a557105576df66cd8d680 +PKG_HASH:=d9cbb49a4ae9e32d7808a604f1a37f359f9fc9064c210c4c5f35d629d49fb9fe PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 @@ -24,7 +24,7 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -define Package/ipset/Default +define Package/ipset SECTION:=net CATEGORY:=Network DEPENDS+= +kmod-ipt-ipset +libmnl @@ -32,15 +32,6 @@ define Package/ipset/Default URL:=http://ipset.netfilter.org/ endef -define Package/ipset -$(call Package/ipset/Default) - DEPENDS+= +libipset -endef - -define Package/libipset -$(call Package/ipset/Default) -endef - CONFIGURE_ARGS += \ --with-kbuild="$(LINUX_DIR)" @@ -48,6 +39,10 @@ MAKE_FLAGS += \ ARCH="$(LINUX_KARCH)" \ SHELL="$(BASH)" +define Build/Compile + $(call Build/Compile/Default) +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libipset $(1)/usr/include/ @@ -58,12 +53,8 @@ endef define Package/ipset/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/ -endef - -define Package/libipset/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipset*.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,ipset)) -$(eval $(call BuildPackage,libipset)) diff --git a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch deleted file mode 100644 index 745e9fa3b..000000000 --- a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch +++ /dev/null @@ -1,25 +0,0 @@ -From a4212bf911026740afc7fce98d9100e2ef5dcea0 Mon Sep 17 00:00:00 2001 -From: Jozsef Kadlecsik -Date: Tue, 26 Sep 2017 07:00:13 +0200 -Subject: [PATCH] Replace the last reference to u_int8_t with uint8_t. - ---- - src/ipset.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/ipset.c b/src/ipset.c -index 79f56b8..df0778a 100644 ---- a/src/ipset.c -+++ b/src/ipset.c -@@ -282,7 +282,7 @@ call_parser(int *argc, char *argv[], const struct ipset_type *type, - const struct ipset_arg *arg; - const char *optstr; - const struct ipset_type *t = type; -- u_int8_t revision = type->revision; -+ uint8_t revision = type->revision; - int ret = 0, i = 1; - - /* Currently CREATE and ADT may have got additional arguments */ --- -2.13.5 - diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index e09c35c69..bf1a792c0 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables -PKG_VERSION:=1.6.1 -PKG_RELEASE:=1 +PKG_VERSION:=1.4.21 +PKG_RELEASE:=2 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.netfilter.org/iptables -PKG_SOURCE_VERSION:=7df66f1c13563cfbab75246b009ce36f69ee4487 -PKG_MIRROR_HASH:=22f15ef41fd8e3724bedcee666b7b6a3491d2d038d580ef1fb032718dcb73f14 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 +PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \ + ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \ + ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \ + ftp://ftp.no.netfilter.org/pub/netfilter/iptables/ +PKG_HASH:=52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0 PKG_FIXUP:=autoreconf - PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables include $(INCLUDE_DIR)/package.mk ifeq ($(DUMP),) @@ -51,20 +51,6 @@ $(call Package/iptables/Default) DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables endef -define Package/iptables/config - config IPTABLES_CONNLABEL - bool "Enable Connlabel support" - default n - help - This enable connlabel support in iptables. - - config IPTABLES_NFTABLES - bool "Enable Nftables support" - default n - help - This enable nftables support in iptables. -endef - define Package/iptables/description IP firewall administration tool. @@ -217,20 +203,6 @@ define Package/iptables-mod-nflog/description endef -define Package/iptables-mod-trace -$(call Package/iptables/Module, +kmod-ipt-debug +kmod-ipt-raw) - TITLE:=Netfilter TRACE target -endef - -define Package/iptables-mod-trace/description - iptables extension for TRACE target - - Includes: - - libxt_TRACE - -endef - - define Package/iptables-mod-nfqueue $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue) TITLE:=Netfilter NFQUEUE target @@ -396,15 +368,6 @@ U32 iptables extensions. endef -define Package/iptables-mod-checksum -$(call Package/iptables/Module, +kmod-ipt-checksum) - TITLE:=IP CHECKSUM target extension -endef - -define Package/iptables-mod-checksum/description -iptables extension for the CHECKSUM calculation target -endef - define Package/ip6tables $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables @@ -439,7 +402,6 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libip4tc +libip6tc +libxtables - ABI_VERSION:=$(PKG_VERSION) TITLE:=IPv4/IPv6 firewall - shared libiptc library (compatibility stub) endef @@ -448,7 +410,6 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4 firewall - shared libiptc library - ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -457,7 +418,6 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library - ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -466,10 +426,6 @@ define Package/libxtables SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables library - ABI_VERSION:=$(PKG_VERSION) - DEPENDS:= \ - +IPTABLES_CONNLABEL:libnetfilter-conntrack \ - +IPTABLES_NFTABLES:libnftnl endef TARGET_CPPFLAGS := \ @@ -488,12 +444,10 @@ TARGET_LDFLAGS += \ CONFIGURE_ARGS += \ --enable-shared \ - --enable-static \ --enable-devel \ --with-kernel="$(LINUX_DIR)/user_headers" \ --with-xtlibdir=/usr/lib/iptables \ - $(if $(CONFIG_IPTABLES_CONNLABEL),,--disable-connlabel) \ - $(if $(CONFIG_IPTABLES_NFTABLES),,--disable-nftables) \ + --enable-static \ $(if $(CONFIG_IPV6),,--disable-ipv6) MAKE_FLAGS := \ @@ -608,9 +562,7 @@ $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m))) $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m))) $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) -$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) -$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) $(eval $(call BuildPackage,ip6tables)) $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) diff --git a/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch index 4add4ea5f..2b6c57ec9 100644 --- a/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch +++ b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch @@ -1,6 +1,6 @@ --- a/libxtables/xtables.c +++ b/libxtables/xtables.c -@@ -355,6 +355,7 @@ static char *get_modprobe(void) +@@ -336,6 +336,7 @@ static char *get_modprobe(void) int xtables_insmod(const char *modname, const char *modprobe, bool quiet) { @@ -8,7 +8,7 @@ char *buf = NULL; char *argv[4]; int status; -@@ -395,6 +396,7 @@ int xtables_insmod(const char *modname, +@@ -380,6 +381,7 @@ int xtables_insmod(const char *modname, free(buf); if (WIFEXITED(status) && WEXITSTATUS(status) == 0) return 0; diff --git a/package/network/utils/iptables/patches/030-no-libnfnetlink.patch b/package/network/utils/iptables/patches/030-no-libnfnetlink.patch new file mode 100644 index 000000000..50542ac0b --- /dev/null +++ b/package/network/utils/iptables/patches/030-no-libnfnetlink.patch @@ -0,0 +1,94 @@ +--- a/configure ++++ b/configure +@@ -12367,77 +12367,7 @@ fi + fi + + +-pkg_failed=no +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnfnetlink" >&5 +-$as_echo_n "checking for libnfnetlink... " >&6; } +- +-if test -n "$libnfnetlink_CFLAGS"; then +- pkg_cv_libnfnetlink_CFLAGS="$libnfnetlink_CFLAGS" +- elif test -n "$PKG_CONFIG"; then +- if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then +- pkg_cv_libnfnetlink_CFLAGS=`$PKG_CONFIG --cflags "libnfnetlink >= 1.0" 2>/dev/null` +- test "x$?" != "x0" && pkg_failed=yes +-else +- pkg_failed=yes +-fi +- else +- pkg_failed=untried +-fi +-if test -n "$libnfnetlink_LIBS"; then +- pkg_cv_libnfnetlink_LIBS="$libnfnetlink_LIBS" +- elif test -n "$PKG_CONFIG"; then +- if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 +- ac_status=$? +- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 +- test $ac_status = 0; }; then +- pkg_cv_libnfnetlink_LIBS=`$PKG_CONFIG --libs "libnfnetlink >= 1.0" 2>/dev/null` +- test "x$?" != "x0" && pkg_failed=yes +-else +- pkg_failed=yes +-fi +- else +- pkg_failed=untried +-fi +- +- +- +-if test $pkg_failed = yes; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- +-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then +- _pkg_short_errors_supported=yes +-else +- _pkg_short_errors_supported=no +-fi +- if test $_pkg_short_errors_supported = yes; then +- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` +- else +- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` +- fi +- # Put the nasty error message in config.log where it belongs +- echo "$libnfnetlink_PKG_ERRORS" >&5 +- +- nfnetlink=0 +-elif test $pkg_failed = untried; then +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +-$as_echo "no" >&6; } +- nfnetlink=0 +-else +- libnfnetlink_CFLAGS=$pkg_cv_libnfnetlink_CFLAGS +- libnfnetlink_LIBS=$pkg_cv_libnfnetlink_LIBS +- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +-$as_echo "yes" >&6; } +- nfnetlink=1 +-fi +- if test "$nfnetlink" = 1; then ++if false; then + HAVE_LIBNFNETLINK_TRUE= + HAVE_LIBNFNETLINK_FALSE='#' + else +--- a/configure.ac ++++ b/configure.ac +@@ -111,9 +111,7 @@ if test "x$enable_bpfc" = "xyes" || test + AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool)) + fi + +-PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], +- [nfnetlink=1], [nfnetlink=0]) +-AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) ++AM_CONDITIONAL([HAVE_LIBNFNETLINK], [false]) + + regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ + -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ diff --git a/package/network/utils/iptables/patches/050-optional-xml.patch b/package/network/utils/iptables/patches/050-optional-xml.patch index b782bbf13..11311ddb4 100644 --- a/package/network/utils/iptables/patches/050-optional-xml.patch +++ b/package/network/utils/iptables/patches/050-optional-xml.patch @@ -1,6 +1,6 @@ --- a/iptables/xtables-multi.c +++ b/iptables/xtables-multi.c -@@ -26,8 +26,10 @@ static const struct subcommand multi_sub +@@ -22,8 +22,10 @@ static const struct subcommand multi_sub {"iptables-restore", iptables_restore_main}, {"restore4", iptables_restore_main}, #endif diff --git a/package/network/utils/iptables/patches/100-bash-location.patch b/package/network/utils/iptables/patches/100-bash-location.patch new file mode 100644 index 000000000..02ee45ba1 --- /dev/null +++ b/package/network/utils/iptables/patches/100-bash-location.patch @@ -0,0 +1,8 @@ +--- a/iptables/iptables-apply ++++ b/iptables/iptables-apply +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/usr/bin/env bash + # + # iptables-apply -- a safer way to update iptables remotely + # diff --git a/package/network/utils/iptables/patches/200-configurable_builtin.patch b/package/network/utils/iptables/patches/200-configurable_builtin.patch index 9c53c2bfe..d35bc5a85 100644 --- a/package/network/utils/iptables/patches/200-configurable_builtin.patch +++ b/package/network/utils/iptables/patches/200-configurable_builtin.patch @@ -1,75 +1,58 @@ --- a/extensions/GNUmakefile.in +++ b/extensions/GNUmakefile.in -@@ -50,11 +50,31 @@ pfb_build_mod := $(filter-out @blacklist - pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod}) - pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod}) - pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod}) +@@ -45,9 +45,24 @@ pfx_symlinks := NOTRACK state + pfx_build_mod := $(filter-out @blacklist_modules@,${pfx_build_mod}) + pf4_build_mod := $(filter-out @blacklist_modules@,${pf4_build_mod}) + pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod}) -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod}) --pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod}) --pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod}) -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod}) -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod}) ++ +ifdef BUILTIN_MODULES +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod}) -+pfb_build_static := $(filter $(BUILTIN_MODULES),${pfb_build_mod}) -+pfa_build_static := $(filter $(BUILTIN_MODULES),${pfa_build_mod}) +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod}) +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod}) +else +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod) -+@ENABLE_STATIC_TRUE@ pfb_build_static := $(pfb_build_mod) -+@ENABLE_STATIC_TRUE@ pfa_build_static := $(pfa_build_mod) +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod) +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod) +endif + +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod)) -+pfb_build_mod := $(filter-out $(pfb_build_static),$(pfb_build_mod)) -+pfa_build_mod := $(filter-out $(pfa_build_static),$(pfa_build_mod)) +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod)) +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod)) + +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static}) -+pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_static}) -+pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_static}) +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static}) +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static}) pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks}) - pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod}) - pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod}) -@@ -67,13 +87,13 @@ pf6_solibs := $(patsubst %,libip6t_%. + pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod}) + pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod}) +@@ -58,11 +73,11 @@ pf6_solibs := $(patsubst %,libip6t_%. # - targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man + targets := libext.a libext4.a libext6.a matches.man targets.man targets_install := -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs} --@ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs} --@ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs} -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs} -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs} --@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} --@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +-@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} +-@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} +libext_objs := ${pfx_objs} -+libext_ebt_objs := ${pfb_objs} -+libext_arpt_objs := ${pfa_objs} +libext4_objs := ${pf4_objs} +libext6_objs := ${pf6_objs} -+targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} -+targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}) ++targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} ++targets_install := $(strip ${targets_install} ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}) .SECONDARY: -@@ -141,11 +161,11 @@ libext4.a: initext4.o ${libext4_objs} +@@ -126,9 +141,9 @@ libext4.a: initext4.o ${libext4_objs} libext6.a: initext6.o ${libext6_objs} ${AM_VERBOSE_AR} ${AR} crs $@ $^; -initext_func := $(addprefix xt_,${pfx_build_mod}) --initextb_func := $(addprefix ebt_,${pfb_build_mod}) --initexta_func := $(addprefix arpt_,${pfa_build_mod}) -initext4_func := $(addprefix ipt_,${pf4_build_mod}) -initext6_func := $(addprefix ip6t_,${pf6_build_mod}) +initext_func := $(addprefix xt_,${pfx_build_static}) -+initextb_func := $(addprefix ebt_,${pfb_build_static}) -+initexta_func := $(addprefix arpt_,${pfa_build_static}) +initext4_func := $(addprefix ipt_,${pf4_build_static}) +initext6_func := $(addprefix ip6t_,${pf6_build_static}) diff --git a/package/network/utils/iptables/patches/300-musl_fixes.patch b/package/network/utils/iptables/patches/300-musl_fixes.patch new file mode 100644 index 000000000..a78eda775 --- /dev/null +++ b/package/network/utils/iptables/patches/300-musl_fixes.patch @@ -0,0 +1,127 @@ +--- a/extensions/libip6t_ipv6header.c ++++ b/extensions/libip6t_ipv6header.c +@@ -10,6 +10,9 @@ on whether they contain certain headers + #include + #include + #include ++#ifndef IPPROTO_HOPOPTS ++# define IPPROTO_HOPOPTS 0 ++#endif + + enum { + O_HEADER = 0, +--- a/extensions/libxt_TCPOPTSTRIP.c ++++ b/extensions/libxt_TCPOPTSTRIP.c +@@ -12,6 +12,21 @@ + #ifndef TCPOPT_MD5SIG + # define TCPOPT_MD5SIG 19 + #endif ++#ifndef TCPOPT_MAXSEG ++# define TCPOPT_MAXSEG 2 ++#endif ++#ifndef TCPOPT_WINDOW ++# define TCPOPT_WINDOW 3 ++#endif ++#ifndef TCPOPT_SACK_PERMITTED ++# define TCPOPT_SACK_PERMITTED 4 ++#endif ++#ifndef TCPOPT_SACK ++# define TCPOPT_SACK 5 ++#endif ++#ifndef TCPOPT_TIMESTAMP ++# define TCPOPT_TIMESTAMP 8 ++#endif + + enum { + O_STRIP_OPTION = 0, +--- a/include/libiptc/ipt_kernel_headers.h ++++ b/include/libiptc/ipt_kernel_headers.h +@@ -5,7 +5,6 @@ + + #include + +-#if defined(__GLIBC__) && __GLIBC__ == 2 + #include + #include + #include +@@ -13,15 +12,4 @@ + #include + #include + #include +-#else /* libc5 */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#endif + #endif +--- a/include/linux/netfilter_ipv4/ip_tables.h ++++ b/include/linux/netfilter_ipv4/ip_tables.h +@@ -16,6 +16,7 @@ + #define _IPTABLES_H + + #include ++#include + + #include + +--- a/iptables/ip6tables-restore.c ++++ b/iptables/ip6tables-restore.c +@@ -9,7 +9,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include +--- a/iptables/ip6tables-save.c ++++ b/iptables/ip6tables-save.c +@@ -6,7 +6,7 @@ + * This code is distributed under the terms of GNU GPL v2 + */ + #include +-#include ++#include + #include + #include + #include +--- a/iptables/iptables-restore.c ++++ b/iptables/iptables-restore.c +@@ -6,7 +6,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include +--- a/iptables/iptables-save.c ++++ b/iptables/iptables-save.c +@@ -6,7 +6,7 @@ + * + */ + #include +-#include ++#include + #include + #include + #include +--- a/iptables/iptables-xml.c ++++ b/iptables/iptables-xml.c +@@ -7,7 +7,7 @@ + */ + + #include +-#include ++#include + #include + #include + #include diff --git a/package/network/utils/iptables/patches/600-shared-libext.patch b/package/network/utils/iptables/patches/600-shared-libext.patch index a906d4060..92f548539 100644 --- a/package/network/utils/iptables/patches/600-shared-libext.patch +++ b/package/network/utils/iptables/patches/600-shared-libext.patch @@ -1,15 +1,17 @@ ---- a/extensions/GNUmakefile.in -+++ b/extensions/GNUmakefile.in -@@ -85,7 +85,7 @@ pf6_solibs := $(patsubst %,libip6t_%. +Index: iptables-1.4.21/extensions/GNUmakefile.in +=================================================================== +--- iptables-1.4.21.orig/extensions/GNUmakefile.in ++++ iptables-1.4.21/extensions/GNUmakefile.in +@@ -71,7 +71,7 @@ pf6_solibs := $(patsubst %,libip6t_%. # # Building blocks # --targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man -+targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man +-targets := libext.a libext4.a libext6.a matches.man targets.man ++targets := libiptext.so libiptext4.so libiptext6.so matches.man targets.man targets_install := libext_objs := ${pfx_objs} - libext_ebt_objs := ${pfb_objs} -@@ -112,7 +112,7 @@ clean: + libext4_objs := ${pf4_objs} +@@ -96,7 +96,7 @@ clean: distclean: clean init%.o: init%.c @@ -18,7 +20,7 @@ -include .*.d -@@ -144,22 +144,22 @@ xt_connlabel_LIBADD = @libnetfilter_conn +@@ -130,16 +130,16 @@ xt_statistic_LIBADD = -lm # handling code in the Makefiles. # lib%.o: ${srcdir}/lib%.c @@ -30,16 +32,6 @@ +libiptext.so: initext.o ${libext_objs} + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; --libext_ebt.a: initextb.o ${libext_ebt_objs} -- ${AM_VERBOSE_AR} ${AR} crs $@ $^; -+libiptext_ebt.so: initextb.o ${libext_ebt_objs} -+ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; - --libext_arpt.a: initexta.o ${libext_arpt_objs} -- ${AM_VERBOSE_AR} ${AR} crs $@ $^; -+libiptext_arpt.so: initexta.o ${libext_arpt_objs} -+ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; - -libext4.a: initext4.o ${libext4_objs} - ${AM_VERBOSE_AR} ${AR} crs $@ $^; +libiptext4.so: initext4.o ${libext4_objs} @@ -51,10 +43,12 @@ + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; initext_func := $(addprefix xt_,${pfx_build_static}) - initextb_func := $(addprefix ebt_,${pfb_build_static}) ---- a/iptables/Makefile.am -+++ b/iptables/Makefile.am -@@ -8,7 +8,8 @@ BUILT_SOURCES = + initext4_func := $(addprefix ipt_,${pf4_build_static}) +Index: iptables-1.4.21/iptables/Makefile.am +=================================================================== +--- iptables-1.4.21.orig/iptables/Makefile.am ++++ iptables-1.4.21/iptables/Makefile.am +@@ -5,7 +5,8 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} - xtables_multi_SOURCES = xtables-multi.c iptables-xml.c xtables_multi_CFLAGS = ${AM_CFLAGS} @@ -64,7 +58,7 @@ if ENABLE_STATIC xtables_multi_CFLAGS += -DALL_INCLUSIVE endif -@@ -16,13 +17,15 @@ if ENABLE_IPV4 +@@ -13,13 +14,15 @@ if ENABLE_IPV4 xtables_multi_SOURCES += iptables-save.c iptables-restore.c \ iptables-standalone.c iptables.c xtables_multi_CFLAGS += -DENABLE_IPV4 @@ -82,23 +76,3 @@ endif xtables_multi_SOURCES += xshared.c xtables_multi_LDADD += ../libxtables/libxtables.la -lm -@@ -32,7 +35,8 @@ if ENABLE_NFTABLES - BUILT_SOURCES += xtables-config-parser.h - xtables_compat_multi_SOURCES = xtables-compat-multi.c iptables-xml.c - xtables_compat_multi_CFLAGS = ${AM_CFLAGS} --xtables_compat_multi_LDADD = ../extensions/libext.a ../extensions/libext_ebt.a -+xtables_compat_multi_LDADD = -+xtables_compat_multi_LDFLAGS = -L../extensions/ -liptext -liptext_ebt - if ENABLE_STATIC - xtables_compat_multi_CFLAGS += -DALL_INCLUSIVE - endif -@@ -45,7 +49,8 @@ xtables_compat_multi_SOURCES += xtables- - getethertype.c nft-bridge.c \ - xtables-eb-standalone.c xtables-eb.c \ - xtables-translate.c --xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a -+xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} -+xtables_compat_multi_LDFLAGS += -liptext4 -liptext6 -liptext_arpt - # yacc and lex generate dirty code - xtables_compat_multi-xtables-config-parser.o xtables_compat_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls - xtables_compat_multi_SOURCES += xshared.c diff --git a/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch index 6800ca5ec..342c3b013 100644 --- a/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch +++ b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch @@ -1,6 +1,8 @@ ---- a/extensions/libxt_conntrack.c -+++ b/extensions/libxt_conntrack.c -@@ -1397,6 +1397,7 @@ static int conntrack3_mt6_xlate(struct x +Index: iptables-1.4.21/extensions/libxt_conntrack.c +=================================================================== +--- iptables-1.4.21.orig/extensions/libxt_conntrack.c ++++ iptables-1.4.21/extensions/libxt_conntrack.c +@@ -1157,6 +1157,7 @@ static void state_save(const void *ip, c } static struct xtables_match conntrack_mt_reg[] = { @@ -8,7 +10,7 @@ { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1472,6 +1473,7 @@ static struct xtables_match conntrack_mt +@@ -1232,6 +1233,7 @@ static struct xtables_match conntrack_mt .alias = conntrack_print_name_alias, .x6_options = conntrack2_mt_opts, }, @@ -16,24 +18,31 @@ { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1504,6 +1506,7 @@ static struct xtables_match conntrack_mt +@@ -1262,6 +1264,7 @@ static struct xtables_match conntrack_mt + .alias = conntrack_print_name_alias, .x6_options = conntrack3_mt_opts, - .xlate = conntrack3_mt6_xlate, }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1534,6 +1537,8 @@ static struct xtables_match conntrack_mt +@@ -1292,6 +1295,7 @@ static struct xtables_match conntrack_mt .x6_parse = state_ct23_parse, .x6_options = state_opts, }, +#endif + { + .family = NFPROTO_UNSPEC, + .name = "state", +@@ -1307,6 +1311,7 @@ static struct xtables_match conntrack_mt + .x6_parse = state_ct23_parse, + .x6_options = state_opts, + }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1563,6 +1568,7 @@ static struct xtables_match conntrack_mt +@@ -1320,6 +1325,7 @@ static struct xtables_match conntrack_mt .x6_parse = state_parse, .x6_options = state_opts, }, @@ -41,9 +50,11 @@ }; void _init(void) ---- a/extensions/libxt_CT.c -+++ b/extensions/libxt_CT.c -@@ -349,6 +349,7 @@ static void notrack_ct2_tg_init(struct x +Index: iptables-1.4.21/extensions/libxt_CT.c +=================================================================== +--- iptables-1.4.21.orig/extensions/libxt_CT.c ++++ iptables-1.4.21/extensions/libxt_CT.c +@@ -290,6 +290,7 @@ static void notrack_ct2_tg_init(struct x } static struct xtables_target ct_target_reg[] = { @@ -51,7 +62,7 @@ { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -374,6 +375,7 @@ static struct xtables_target ct_target_r +@@ -315,6 +316,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -59,7 +70,7 @@ { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -388,6 +390,7 @@ static struct xtables_target ct_target_r +@@ -329,6 +331,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -67,7 +78,7 @@ { .family = NFPROTO_UNSPEC, .name = "NOTRACK", -@@ -425,6 +428,7 @@ static struct xtables_target ct_target_r +@@ -366,6 +369,7 @@ static struct xtables_target ct_target_r .revision = 0, .version = XTABLES_VERSION, }, @@ -75,9 +86,11 @@ }; void _init(void) ---- a/extensions/libxt_multiport.c -+++ b/extensions/libxt_multiport.c -@@ -571,6 +571,7 @@ static int multiport_xlate6_v1(struct xt +Index: iptables-1.4.21/extensions/libxt_multiport.c +=================================================================== +--- iptables-1.4.21.orig/extensions/libxt_multiport.c ++++ iptables-1.4.21/extensions/libxt_multiport.c +@@ -469,6 +469,7 @@ static void multiport_save6_v1(const voi } static struct xtables_match multiport_mt_reg[] = { @@ -85,9 +98,9 @@ { .family = NFPROTO_IPV4, .name = "multiport", -@@ -601,6 +602,7 @@ static struct xtables_match multiport_mt +@@ -497,6 +498,7 @@ static struct xtables_match multiport_mt + .save = multiport_save6, .x6_options = multiport_opts, - .xlate = multiport_xlate6, }, +#endif { diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile index 344af07af..b6799e68b 100644 --- a/package/network/utils/iputils/Makefile +++ b/package/network/utils/iputils/Makefile @@ -17,7 +17,6 @@ PKG_HASH:=fd3af46c80ebb99607c2ca1f2a3608b6fe828e25bbec6e54f2afd25f6ddb6ee7 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:skbuff:iputils PKG_BUILD_DEPENDS:=sysfsutils PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index 9b3c12bec..a578ddc98 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -30,7 +30,8 @@ endef define Build/Configure echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c - echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh + rm -f $(PKG_BUILD_DIR)/version.sh + touch $(PKG_BUILD_DIR)/version.sh chmod +x $(PKG_BUILD_DIR)/version.sh endef diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 25ec1263a..88e47cce8 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,81 +1,6 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -10,7 +10,7 @@ - * Copyright 2008, 2009 Luis R. Rodriguez - * Copyright 2008 Jouni Malinen - * Copyright 2008 Colin McCabe -- * Copyright 2015 Intel Deutschland GmbH -+ * Copyright 2015-2017 Intel Deutschland GmbH - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above -@@ -173,6 +173,65 @@ - */ - - /** -+ * DOC: WPA/WPA2 EAPOL handshake offload -+ * -+ * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers -+ * can indicate they support offloading EAPOL handshakes for WPA/WPA2 -+ * preshared key authentication. In %NL80211_CMD_CONNECT the preshared -+ * key should be specified using %NL80211_ATTR_PMK. Drivers supporting -+ * this offload may reject the %NL80211_CMD_CONNECT when no preshared -+ * key material is provided, for example when that driver does not -+ * support setting the temporal keys through %CMD_NEW_KEY. -+ * -+ * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be -+ * set by drivers indicating offload support of the PTK/GTK EAPOL -+ * handshakes during 802.1X authentication. In order to use the offload -+ * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS -+ * attribute flag. Drivers supporting this offload may reject the -+ * %NL80211_CMD_CONNECT when the attribute flag is not present. -+ * -+ * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK -+ * using %NL80211_CMD_SET_PMK. For offloaded FT support also -+ * %NL80211_ATTR_PMKR0_NAME must be provided. -+ */ -+ -+/** -+ * DOC: FILS shared key authentication offload -+ * -+ * FILS shared key authentication offload can be advertized by drivers by -+ * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support -+ * FILS shared key authentication offload should be able to construct the -+ * authentication and association frames for FILS shared key authentication and -+ * eventually do a key derivation as per IEEE 802.11ai. The below additional -+ * parameters should be given to driver in %NL80211_CMD_CONNECT. -+ * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai -+ * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai -+ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message -+ * %NL80211_ATTR_FILS_ERP_RRK - used to generate the rIK and rMSK -+ * rIK should be used to generate an authentication tag on the ERP message and -+ * rMSK should be used to derive a PMKSA. -+ * rIK, rMSK should be generated and keyname_nai, sequence number should be used -+ * as specified in IETF RFC 6696. -+ * -+ * When FILS shared key authentication is completed, driver needs to provide the -+ * below additional parameters to userspace. -+ * %NL80211_ATTR_FILS_KEK - used for key renewal -+ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges -+ * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated -+ * %Nl80211_ATTR_PMK - used to update PMKSA cache in userspace -+ * The PMKSA can be maintained in userspace persistently so that it can be used -+ * later after reboots or wifi turn off/on also. -+ * -+ * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS -+ * capable AP supporting PMK caching. It specifies the scope within which the -+ * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and -+ * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based -+ * on FILS cache identifier. Additionally %NL80211_ATTR_PMK is used with -+ * %NL80211_SET_PMKSA to specify the PMK corresponding to a PMKSA for driver to -+ * use in a FILS shared key connection with PMKSA caching. -+ */ -+ -+/** - * enum nl80211_commands - supported nl80211 commands - * - * @NL80211_CMD_UNSPEC: unspecified command to catch errors -@@ -323,7 +382,7 @@ +@@ -323,7 +323,7 @@ * @NL80211_CMD_GET_SCAN: get scan results * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the @@ -84,56 +9,7 @@ * specify a BSSID to scan for; if not included, the wildcard BSSID will * be used. * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to -@@ -351,7 +410,9 @@ - * are used. Extra IEs can also be passed from the userspace by - * using the %NL80211_ATTR_IE attribute. The first cycle of the - * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY -- * is supplied. -+ * is supplied. If the device supports multiple concurrent scheduled -+ * scans, it will allow such when the caller provides the flag attribute -+ * %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it. - * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if - * scheduled scan is not running. The caller may assume that as soon - * as the call returns, it is safe to start a new scheduled scan again. -@@ -370,10 +431,18 @@ - * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to - * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) - * -- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC -- * (for the BSSID) and %NL80211_ATTR_PMKID. -+ * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry using %NL80211_ATTR_MAC -+ * (for the BSSID), %NL80211_ATTR_PMKID, and optionally %NL80211_ATTR_PMK -+ * (PMK is used for PTKSA derivation in case of FILS shared key offload) or -+ * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID, -+ * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS -+ * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier -+ * advertized by a FILS capable AP identifying the scope of PMKSA in an -+ * ESS. - * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC -- * (for the BSSID) and %NL80211_ATTR_PMKID. -+ * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID, -+ * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS -+ * authentication. - * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. - * - * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain -@@ -500,8 +569,13 @@ - * authentication/association or not receiving a response from the AP. - * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as - * well to remain backwards compatible. -- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), -- * sent as an event when the card/driver roamed by itself. -+ * @NL80211_CMD_ROAM: notifcation indicating the card/driver roamed by itself. -+ * When the driver roamed in a network that requires 802.1X authentication, -+ * %NL80211_ATTR_PORT_AUTHORIZED should be set if the 802.1X authentication -+ * was done by the driver or if roaming was done using Fast Transition -+ * protocol (in which case 802.1X authentication is not needed). If -+ * %NL80211_ATTR_PORT_AUTHORIZED is not set, user space is responsible for -+ * the 802.1X authentication. - * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify - * userspace that a connection was dropped by the AP or due to other - * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and -@@ -600,6 +674,20 @@ +@@ -600,6 +600,20 @@ * * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. * @@ -154,45 +30,7 @@ * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial * mesh config parameters may be given. * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the -@@ -840,12 +928,15 @@ - * cfg80211_scan_done(). - * - * @NL80211_CMD_START_NAN: Start NAN operation, identified by its -- * %NL80211_ATTR_WDEV interface. This interface must have been previously -- * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the -- * NAN interface will create or join a cluster. This command must have a -- * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional -- * %NL80211_ATTR_NAN_DUAL attributes. -- * After this command NAN functions can be added. -+ * %NL80211_ATTR_WDEV interface. This interface must have been -+ * previously created with %NL80211_CMD_NEW_INTERFACE. After it -+ * has been started, the NAN interface will create or join a -+ * cluster. This command must have a valid -+ * %NL80211_ATTR_NAN_MASTER_PREF attribute and optional -+ * %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is -+ * omitted or set to 0, it means don't-care and the device will -+ * decide what to use. After this command NAN functions can be -+ * added. - * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by - * its %NL80211_ATTR_WDEV interface. - * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined -@@ -866,14 +957,32 @@ - * This command is also used as a notification sent when a NAN function is - * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID - * and %NL80211_ATTR_COOKIE attributes. -- * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN -- * must be operational (%NL80211_CMD_START_NAN was executed). -- * It must contain at least one of the following attributes: -- * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL. -+ * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN -+ * configuration. NAN must be operational (%NL80211_CMD_START_NAN -+ * was executed). It must contain at least one of the following -+ * attributes: %NL80211_ATTR_NAN_MASTER_PREF, -+ * %NL80211_ATTR_BANDS. If %NL80211_ATTR_BANDS is omitted, the -+ * current configuration is not changed. If it is present but -+ * set to zero, the configuration is changed to don't-care -+ * (i.e. the device can decide what to do). - * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported. +@@ -874,6 +888,12 @@ * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and * %NL80211_ATTR_COOKIE. * @@ -201,33 +39,22 @@ + * BSS selection. This command can be issued only while connected and it + * does not result in a change for the current association. Currently, + * only the %NL80211_ATTR_IE data is used and updated with this command. -+ * -+ * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 -+ * for the given authenticator address (specified with &NL80211_ATTR_MAC). -+ * When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the -+ * PMK-R0, otherwise it specifies the PMK. -+ * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously -+ * configured PMK for the authenticator address identified by -+ * &NL80211_ATTR_MAC. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1069,6 +1178,13 @@ enum nl80211_commands { +@@ -1069,6 +1089,10 @@ enum nl80211_commands { NL80211_CMD_CHANGE_NAN_CONFIG, NL80211_CMD_NAN_MATCH, + NL80211_CMD_SET_MULTICAST_TO_UNICAST, + + NL80211_CMD_UPDATE_CONNECT_PARAMS, -+ -+ NL80211_CMD_SET_PMK, -+ NL80211_CMD_DEL_PMK, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -1638,8 +1754,16 @@ enum nl80211_commands { +@@ -1638,8 +1662,16 @@ enum nl80211_commands { * the connection request from a station. nl80211_connect_failed_reason * enum has different reasons of connection failure. * @@ -246,7 +73,7 @@ * * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from * association request when used with NL80211_CMD_NEW_STATION) -@@ -1740,7 +1864,9 @@ enum nl80211_commands { +@@ -1740,7 +1772,9 @@ enum nl80211_commands { * * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode * Notification Element based on association request when used with @@ -257,41 +84,16 @@ * * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) -@@ -1783,11 +1909,12 @@ enum nl80211_commands { - * that configured the indoor setting, and the indoor operation would be - * cleared when the socket is closed. - * If set during NAN interface creation, the interface will be destroyed -- * if the socket is closed just like any other interface. Moreover, only -- * the netlink socket that created the interface will be allowed to add -- * and remove functions. NAN notifications will be sent in unicast to that -- * socket. Without this attribute, any socket can add functions and the -- * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. -+ * if the socket is closed just like any other interface. Moreover, NAN -+ * notifications will be sent in unicast to that socket. Without this -+ * attribute, the notifications will be sent to the %NL80211_MCGRP_NAN -+ * multicast group. +@@ -1788,6 +1822,8 @@ enum nl80211_commands { + * and remove functions. NAN notifications will be sent in unicast to that + * socket. Without this attribute, any socket can add functions and the + * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. + * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the + * station will deauthenticate when the socket is closed. * * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is * the TDLS link initiator. -@@ -1927,15 +2054,93 @@ enum nl80211_commands { - * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0. - * Also, values 1 and 255 are reserved for certification purposes and - * should not be used during a normal device operation. -- * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see -- * &enum nl80211_nan_dual_band_conf). This attribute is used with -- * %NL80211_CMD_START_NAN and optionally with -- * %NL80211_CMD_CHANGE_NAN_CONFIG. -+ * @NL80211_ATTR_BANDS: operating bands configuration. This is a u32 -+ * bitmask of BIT(NL80211_BAND_*) as described in %enum -+ * nl80211_band. For instance, for NL80211_BAND_2GHZ, bit 0 -+ * would be set. This attribute is used with -+ * %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG, and -+ * it is optional. If no bands are set, it means don't-care and -+ * the device will decide what to use. - * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See - * &enum nl80211_nan_func_attributes for description of this nested +@@ -1936,6 +1972,38 @@ enum nl80211_commands { * attribute. * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. * See &enum nl80211_nan_match_attributes. @@ -325,55 +127,12 @@ + * u32 attribute with an &enum nl80211_timeout_reason value. This is used, + * e.g., with %NL80211_CMD_CONNECT event. + * -+ * @NL80211_ATTR_FILS_ERP_USERNAME: EAP Re-authentication Protocol (ERP) -+ * username part of NAI used to refer keys rRK and rIK. This is used with -+ * %NL80211_CMD_CONNECT. -+ * -+ * @NL80211_ATTR_FILS_ERP_REALM: EAP Re-authentication Protocol (ERP) realm part -+ * of NAI specifying the domain name of the ER server. This is used with -+ * %NL80211_CMD_CONNECT. -+ * -+ * @NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM: Unsigned 16-bit ERP next sequence number -+ * to use in ERP messages. This is used in generating the FILS wrapped data -+ * for FILS authentication and is used with %NL80211_CMD_CONNECT. -+ * -+ * @NL80211_ATTR_FILS_ERP_RRK: ERP re-authentication Root Key (rRK) for the -+ * NAI specified by %NL80211_ATTR_FILS_ERP_USERNAME and -+ * %NL80211_ATTR_FILS_ERP_REALM. This is used for generating rIK and rMSK -+ * from successful FILS authentication and is used with -+ * %NL80211_CMD_CONNECT. -+ * -+ * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP -+ * identifying the scope of PMKSAs. This is used with -+ * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA. -+ * -+ * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with -+ * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID. -+ * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way -+ * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is -+ * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute -+ * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well. -+ * -+ * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to -+ * indicate that it supports multiple active scheduled scan requests. -+ * @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled -+ * scan request that may be active for the device (u32). -+ * -+ * @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include -+ * in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it -+ * wants to use the supported offload of the 4-way handshake. -+ * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. -+ * @NL80211_ATTR_PORT_AUTHORIZED: flag attribute used in %NL80211_CMD_ROAMED -+ * notification indicating that that 802.1X authentication was done by -+ * the driver or is not needed (because roaming used the Fast Transition -+ * protocol). -+ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined -@@ -2195,7 +2400,7 @@ enum nl80211_attrs { +@@ -2195,7 +2263,7 @@ enum nl80211_attrs { NL80211_ATTR_CONN_FAILED_REASON, @@ -382,12 +141,7 @@ NL80211_ATTR_VHT_CAPABILITY, -@@ -2332,10 +2537,39 @@ enum nl80211_attrs { - NL80211_ATTR_MESH_PEER_AID, - - NL80211_ATTR_NAN_MASTER_PREF, -- NL80211_ATTR_NAN_DUAL, -+ NL80211_ATTR_BANDS, +@@ -2336,6 +2404,20 @@ enum nl80211_attrs { NL80211_ATTR_NAN_FUNC, NL80211_ATTR_NAN_MATCH, @@ -403,27 +157,12 @@ + + NL80211_ATTR_TIMEOUT_REASON, + -+ NL80211_ATTR_FILS_ERP_USERNAME, -+ NL80211_ATTR_FILS_ERP_REALM, -+ NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, -+ NL80211_ATTR_FILS_ERP_RRK, -+ NL80211_ATTR_FILS_CACHE_ID, -+ -+ NL80211_ATTR_PMK, -+ -+ NL80211_ATTR_SCHED_SCAN_MULTI, -+ NL80211_ATTR_SCHED_SCAN_MAX_REQS, -+ -+ NL80211_ATTR_WANT_1X_4WAY_HS, -+ NL80211_ATTR_PMKR0_NAME, -+ NL80211_ATTR_PORT_AUTHORIZED, -+ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -2347,6 +2581,7 @@ enum nl80211_attrs { +@@ -2347,6 +2429,7 @@ enum nl80211_attrs { #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER @@ -431,15 +170,7 @@ /* * Allow user space programs to use #ifdef on new attributes by defining them -@@ -3019,6 +3254,7 @@ enum nl80211_reg_rule_attr { - * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved - * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, - * only report BSS with matching SSID. -+ * (This cannot be used together with BSSID.) - * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a - * BSS in scan results. Filtering is turned off if not specified. Note that - * if this attribute is in a match set of its own, then it is treated as -@@ -3027,6 +3263,15 @@ enum nl80211_reg_rule_attr { +@@ -3027,6 +3110,13 @@ enum nl80211_reg_rule_attr { * how this API was implemented in the past. Also, due to the same problem, * the only way to create a matchset with only an RSSI filter (with this * attribute) is if there's only a single matchset with the RSSI attribute. @@ -450,22 +181,19 @@ + * BSS-es in the specified band is to be adjusted before doing + * RSSI-based BSS selection. The attribute value is a packed structure + * value as specified by &struct nl80211_bss_select_rssi_adjust. -+ * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching -+ * (this cannot be used together with SSID). * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter * attribute number currently defined * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use -@@ -3036,6 +3281,9 @@ enum nl80211_sched_scan_match_attr { +@@ -3036,6 +3126,8 @@ enum nl80211_sched_scan_match_attr { NL80211_SCHED_SCAN_MATCH_ATTR_SSID, NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST, -+ NL80211_SCHED_SCAN_MATCH_ATTR_BSSID, /* keep last */ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, -@@ -3660,6 +3908,9 @@ enum nl80211_bss_status { +@@ -3660,6 +3752,9 @@ enum nl80211_bss_status { * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals @@ -475,7 +203,7 @@ * @__NL80211_AUTHTYPE_NUM: internal * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by -@@ -3672,6 +3923,9 @@ enum nl80211_auth_type { +@@ -3672,6 +3767,9 @@ enum nl80211_auth_type { NL80211_AUTHTYPE_FT, NL80211_AUTHTYPE_NETWORK_EAP, NL80211_AUTHTYPE_SAE, @@ -485,36 +213,7 @@ /* keep last */ __NL80211_AUTHTYPE_NUM, -@@ -3839,7 +4093,10 @@ enum nl80211_ps_state { - * @__NL80211_ATTR_CQM_INVALID: invalid - * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies - * the threshold for the RSSI level at which an event will be sent. Zero -- * to disable. -+ * to disable. Alternatively, if %NL80211_EXT_FEATURE_CQM_RSSI_LIST is -+ * set, multiple values can be supplied as a low-to-high sorted array of -+ * threshold values in dBm. Events will be sent when the RSSI value -+ * crosses any of the thresholds. - * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies - * the minimum amount the RSSI level must change after an event before a - * new event may be issued (to reduce effects of RSSI oscillation). -@@ -3859,6 +4116,8 @@ enum nl80211_ps_state { - * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. - * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon - * loss event -+ * @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the -+ * RSSI threshold event. - * @__NL80211_ATTR_CQM_AFTER_LAST: internal - * @NL80211_ATTR_CQM_MAX: highest key attribute - */ -@@ -3872,6 +4131,7 @@ enum nl80211_attr_cqm { - NL80211_ATTR_CQM_TXE_PKTS, - NL80211_ATTR_CQM_TXE_INTVL, - NL80211_ATTR_CQM_BEACON_LOSS_EVENT, -+ NL80211_ATTR_CQM_RSSI_LEVEL, - - /* keep last */ - __NL80211_ATTR_CQM_AFTER_LAST, -@@ -4280,6 +4540,9 @@ enum nl80211_iface_limit_attrs { +@@ -4280,6 +4378,9 @@ enum nl80211_iface_limit_attrs { * of supported channel widths for radar detection. * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap * of supported regulatory regions for radar detection. @@ -524,7 +223,7 @@ * @NUM_NL80211_IFACE_COMB: number of attributes * @MAX_NL80211_IFACE_COMB: highest attribute number * -@@ -4287,8 +4550,8 @@ enum nl80211_iface_limit_attrs { +@@ -4287,8 +4388,8 @@ enum nl80211_iface_limit_attrs { * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 * => allows an AP and a STA that must match BIs * @@ -535,7 +234,7 @@ * * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 * => allows two STAs on different channels -@@ -4314,6 +4577,7 @@ enum nl80211_if_combination_attrs { +@@ -4314,6 +4415,7 @@ enum nl80211_if_combination_attrs { NL80211_IFACE_COMB_NUM_CHANNELS, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, @@ -543,7 +242,7 @@ /* keep last */ NUM_NL80211_IFACE_COMB, -@@ -4634,6 +4898,27 @@ enum nl80211_feature_flags { +@@ -4634,6 +4736,15 @@ enum nl80211_feature_flags { * configuration (AP/mesh) with HT rates. * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate * configuration (AP/mesh) with VHT rates. @@ -556,22 +255,10 @@ + * @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan + * for reporting BSSs with better RSSI than the current connected BSS + * (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI). -+ * @NL80211_EXT_FEATURE_CQM_RSSI_LIST: With this driver the -+ * %NL80211_ATTR_CQM_RSSI_THOLD attribute accepts a list of zero or more -+ * RSSI threshold values to monitor rather than exactly one threshold. -+ * @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key -+ * authentication with %NL80211_CMD_CONNECT. -+ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way -+ * handshake with PSK in station mode (PSK is passed as part of the connect -+ * and associate commands), doing it in the host might not be supported. -+ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way -+ * handshake with 802.1X in station mode (will pass EAP frames to the host -+ * and accept the set_pmk/del_pmk commands), doing it in the host might not -+ * be supported. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. -@@ -4648,6 +4933,14 @@ enum nl80211_ext_feature_index { +@@ -4648,6 +4759,10 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, NL80211_EXT_FEATURE_BEACON_RATE_HT, NL80211_EXT_FEATURE_BEACON_RATE_VHT, @@ -579,14 +266,10 @@ + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, + NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, -+ NL80211_EXT_FEATURE_CQM_RSSI_LIST, -+ NL80211_EXT_FEATURE_FILS_SK_OFFLOAD, -+ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK, -+ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -@@ -4687,6 +4980,21 @@ enum nl80211_connect_failed_reason { +@@ -4687,6 +4802,21 @@ enum nl80211_connect_failed_reason { }; /** @@ -608,25 +291,7 @@ * enum nl80211_scan_flags - scan request control flags * * Scan request control flags are used to control the handling -@@ -4768,12 +5076,17 @@ enum nl80211_smps_mode { - * change to the channel status. - * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is - * over, channel becomes usable. -+ * @NL80211_RADAR_PRE_CAC_EXPIRED: Channel Availability Check done on this -+ * non-operating channel is expired and no longer valid. New CAC must -+ * be done on this channel before starting the operation. This is not -+ * applicable for ETSI dfs domain where pre-CAC is valid for ever. - */ - enum nl80211_radar_event { - NL80211_RADAR_DETECTED, - NL80211_RADAR_CAC_FINISHED, - NL80211_RADAR_CAC_ABORTED, - NL80211_RADAR_NOP_FINISHED, -+ NL80211_RADAR_PRE_CAC_EXPIRED, - }; - - /** -@@ -4900,8 +5213,9 @@ enum nl80211_sched_scan_plan { +@@ -4900,8 +5030,9 @@ enum nl80211_sched_scan_plan { /** * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. * @@ -638,25 +303,3 @@ */ struct nl80211_bss_select_rssi_adjust { __u8 band; -@@ -4942,21 +5256,6 @@ enum nl80211_bss_select_attr { - }; - - /** -- * enum nl80211_nan_dual_band_conf - NAN dual band configuration -- * -- * Defines the NAN dual band mode of operation -- * -- * @NL80211_NAN_BAND_DEFAULT: device default mode -- * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode -- * @NL80211_NAN_BAND_5GHZ: 5GHz mode -- */ --enum nl80211_nan_dual_band_conf { -- NL80211_NAN_BAND_DEFAULT = 1 << 0, -- NL80211_NAN_BAND_2GHZ = 1 << 1, -- NL80211_NAN_BAND_5GHZ = 1 << 2, --}; -- --/** - * enum nl80211_nan_function_type - NAN function type - * - * Defines the function type of a NAN function diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 1b8a3ad2b..00332b035 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2017-08-23 -PKG_SOURCE_VERSION:=c1a03e8231a5d8b348b70a182d256725c98a3b0b -PKG_MIRROR_HASH:=7bd294f50f8ec8c0497c5fbe5527f3ae098814cdfeecf4ccf78a2a8937611664 +PKG_SOURCE_DATE:=2016-09-21 +PKG_SOURCE_VERSION:=fd9e17be0c43bd6b8df5371f0b353747bc563874 +PKG_MIRROR_HASH:=c58490d9b5c2179f6a3edc67aae2f00ae6007daee0d52fa7e5b4c0ea923f1e37 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile deleted file mode 100644 index 988bc8075..000000000 --- a/package/network/utils/layerscape/restool/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright 2017 NXP -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=restool -PKG_SOURCE_DATE:=2017-10-23 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/qoriq-open-source/restool.git -PKG_SOURCE_VERSION:=8f08b9d499e84f9057784c2036f0ddf75ae3fc70 -PKG_MIRROR_HASH:=29f70ad27c7ab20bc018f0d0b11c680fcf8b829d10e5af5c30af4a3f9228a2fc - -include $(INCLUDE_DIR)/package.mk - -define Package/restool - SECTION:=net - CATEGORY:=Network - DEPENDS:=@TARGET_layerscape - TITLE:=Layerscape DPAA2 dynamical management tool -endef - -MAKE_FLAGS += \ - DESTDIR="$(PKG_BUILD_DIR)"/output/ \ - install - -define Package/restool/install - $(INSTALL_DIR) $(1)/usr/bin/ - $(CP) $(PKG_BUILD_DIR)/output/usr/local/bin/* $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,restool)) diff --git a/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch deleted file mode 100644 index 691e3bba5..000000000 --- a/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 978f00c0a9f17de9cf17b205a741222084261d3a Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:17 +0000 -Subject: [PATCH 01/12] scripts: move shebang on the first line - -If the shebang is not placed on the first line of the shell script -it will be accounted only as a comment. - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 588c736..09bef5a 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -1,3 +1,5 @@ -+#!/bin/bash -+ - # Copyright 2013-2016 Freescale Semiconductor Inc. - # Copyright 2017 NXP - -@@ -30,8 +32,6 @@ - # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - # POSSIBILITY OF SUCH DAMAGE. - --#!/bin/bash -- - ## Restool wrapper script - # - # Prerequisites: --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch deleted file mode 100644 index 0e39ef724..000000000 --- a/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 6039bd1b7e5e71a0a171406cf980d2d61a6e79d4 Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:37 +0000 -Subject: [PATCH 02/12] dprc: add --full-path option to dprc list command - -Instead of printing an indented dprc list, activating -the --full-path option restool will print the entire path -of the dprc. -Example: - -root@rodos:~# restool dprc list --full-path -dprc.1 -dprc.1/dprc.3 -dprc.1/dprc.2 -dprc.1/dprc.2/dprc.4 - -Signed-off-by: Ioana Ciornei ---- - dprc_commands.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----------- - 1 file changed, 50 insertions(+), 11 deletions(-) - -diff --git a/dprc_commands.c b/dprc_commands.c -index e1a8f16..8de2f0e 100644 ---- a/dprc_commands.c -+++ b/dprc_commands.c -@@ -76,13 +76,16 @@ C_ASSERT(ARRAY_SIZE(dprc_sync_options) <= MAX_NUM_CMD_LINE_OPTIONS + 1); - */ - enum dprc_list_options { - LIST_OPT_HELP = 0, -+ LIST_OPT_FULL_PATH, - }; - - static struct option dprc_list_options[] = { - [LIST_OPT_HELP] = { - .name = "help", - }, -- -+ [LIST_OPT_FULL_PATH] = { -+ .name = "full-path", -+ }, - { 0 }, - }; - -@@ -421,17 +424,33 @@ static int cmd_dprc_sync(void) - * Lists nested DPRCs inside a given DPRC, recursively - */ - static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, -- int nesting_level, bool show_non_dprc_objects) -+ int nesting_level, bool show_non_dprc_objects, -+ char *full_path) - { -+ char *updated_full_path = NULL; - int num_child_devices; - int error = 0; -+ int full_path_len; - - assert(nesting_level <= MAX_DPRC_NESTING); - -- for (int i = 0; i < nesting_level; i++) -- printf(" "); -- -- printf("dprc.%u\n", dprc_id); -+ if (full_path) { -+ full_path_len = strlen(full_path); -+ updated_full_path = malloc(full_path_len + 10); -+ if (!updated_full_path) { -+ ERROR_PRINTF("Could not alloc memory for full-path!\n"); -+ return -ENOMEM; -+ } -+ if (full_path_len != 0) -+ sprintf(updated_full_path, "%s/dprc.%d", full_path, dprc_id); -+ else -+ sprintf(updated_full_path, "dprc.%d", dprc_id); -+ printf("%s\n", updated_full_path); -+ } else { -+ for (int i = 0; i < nesting_level; i++) -+ printf(" "); -+ printf("dprc.%u\n", dprc_id); -+ } - - error = dprc_get_obj_count(&restool.mc_io, 0, - dprc_handle, -@@ -475,8 +494,11 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, - if (error < 0) - goto out; - -- error = list_dprc(obj_desc.id, child_dprc_handle, -- nesting_level + 1, show_non_dprc_objects); -+ error = list_dprc(obj_desc.id, -+ child_dprc_handle, -+ nesting_level + 1, -+ show_non_dprc_objects, -+ updated_full_path); - - error2 = dprc_close(&restool.mc_io, 0, child_dprc_handle); - if (error2 < 0) { -@@ -491,6 +513,9 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, - } - - out: -+ if (full_path) -+ free(updated_full_path); -+ - return error; - } - -@@ -498,8 +523,14 @@ static int cmd_dprc_list(void) - { - static const char usage_msg[] = - "\n" -- "Usage: restool dprc list\n" -+ "Usage: restool dprc list [OPTIONS]\n" -+ "\n" -+ "OPTIONS:\n" -+ "--full-path\n" -+ " prints the dprc list in a full-path\n" -+ " format like: dprc.1/dprc.2\n" - "\n"; -+ bool full_path = false; - - if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_HELP)) { - puts(usage_msg); -@@ -507,6 +538,12 @@ static int cmd_dprc_list(void) - return 0; - } - -+ -+ if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_FULL_PATH)) { -+ restool.cmd_option_mask &= ~ONE_BIT_MASK(LIST_OPT_FULL_PATH); -+ full_path = true; -+ } -+ - if (restool.obj_name != NULL) { - ERROR_PRINTF( - "Unexpected argument: \'%s\'\n\n", restool.obj_name); -@@ -514,8 +551,10 @@ static int cmd_dprc_list(void) - return -EINVAL; - } - -- return list_dprc( -- restool.root_dprc_id, restool.root_dprc_handle, 0, false); -+ return list_dprc(restool.root_dprc_id, -+ restool.root_dprc_handle, -+ 0, false, -+ full_path ? "" : NULL); - } - - static int show_one_resource_type(uint16_t dprc_handle, --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch deleted file mode 100644 index c846fbab5..000000000 --- a/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e316b4c7d421afa6ca5f6b6ae86d0a8219a9bd56 Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:42 +0000 -Subject: [PATCH 03/12] scripts: remove unnecessary arrays - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 22 ++-------------------- - 1 file changed, 2 insertions(+), 20 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 09bef5a..ea0df92 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -87,8 +87,6 @@ root_c= - # Type of endpoint object - toe= - --dpnis=() --dpmacs=() - containers=() - # Full path containers - fpc=() -@@ -944,16 +942,8 @@ process_listni() { - fi - fi - -- dpnis+=("$dpni $details") -+ echo "${i}/${dpni} ${details}" - done -- -- if [ -n "$dpnis" ]; then -- for j in "${dpnis[@]}"; do -- echo "$i/$j" -- done -- -- dpnis=() -- fi - done - } - -@@ -984,16 +974,8 @@ process_listmac() { - fi - fi - -- dpmacs+=("$dpmac $details") -+ echo "${i}/${dpmac} ${details}" - done -- -- if [ -n "$dpmacs" ]; then -- for j in "${dpmacs[@]}"; do -- echo "$i/$j" -- done -- -- dpmacs=() -- fi - done - } - --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch deleted file mode 100644 index e1cc38f48..000000000 --- a/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 09f840049d155fa4b681ece749feeff9a269ecde Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:45 +0000 -Subject: [PATCH 04/12] scripts: use restool --full-path option - -Instead of constructing the the full path container list by -hand use the restool option newly added. - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 54 +++++++----------------------------------------------- - 1 file changed, 7 insertions(+), 47 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index ea0df92..72f6c77 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -73,7 +73,6 @@ - ## - - shopt -s extglob --shopt -s lastpipe - - # Intercept the Ctrl+C command but do not interrupt execution - trap ' ' INT -@@ -87,11 +86,6 @@ root_c= - # Type of endpoint object - toe= - --containers=() --# Full path containers --fpc=() --idx=0 -- - SYS_DPRC="/sys/bus/fsl-mc/drivers/fsl_mc_dprc" - - set -e -@@ -220,42 +214,6 @@ get_container() { - echo $(echo "$i" | sed "s/\(dprc.[0-9]*\/\)*//g") - } - --build_fpc_list() { -- $restool dprc list | -- while IFS= read -r line -- do -- containers+=("$line") -- done -- -- for i in "${containers[@]}" -- do -- cnt=$(count_spaces "$i") -- -- if [ "$cnt" -gt 0 ]; then -- # Get index of the upper level container -- idx2=$((idx-1)) -- crt_ct="$i" -- -- while [ "$idx2" -ge 0 ] -- do -- cntp=$(count_spaces "${containers[idx2]}") -- -- if [ "$cntp" -lt "$cnt" ]; then -- upc=$(echo "${containers[idx2]}" | sed "s/ *$//") -- crt_ct=$upc"/""$(echo $crt_ct | sed 's/ *$//')" -- fi -- idx2=$((idx2-1)) -- done -- -- fpc+=($crt_ct) -- else -- fpc+=("$i") -- fi -- -- idx=$((idx+1)) -- done --} -- - get_label() { - # Retrieve the type of the object - too=$(echo "$1" | sed "s/\(\.[0-9]*\)\(\.[0-9]*\)*$//g") -@@ -897,9 +855,9 @@ process_addni() { - } - - process_listni() { -- build_fpc_list -- -- for i in "${fpc[@]}" -+ dprc_list="$($restool dprc list --full-path)" -+ echo "${dprc_list}" | -+ while read -r i - do - crt_c=$(get_container "$i") - $restool dprc show "$crt_c" | grep dpni | -@@ -948,10 +906,12 @@ process_listni() { - } - - process_listmac() { -- build_fpc_list -+ dprc_list="$($restool dprc list --full-path)" - -- for i in "${fpc[@]}" -+ echo "${dprc_list}" | -+ while read -r i - do -+ - crt_c=$(get_container "$i") - $restool dprc show "$crt_c" | grep dpmac | - while IFS= read -r line --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch deleted file mode 100644 index b34c6a31a..000000000 --- a/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 899d6c74286cbc672e1bad1abd7eff15b1b7298d Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:49 +0000 -Subject: [PATCH 05/12] scripts: use proper arithmetic operation syntax - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 72f6c77..a39df2c 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -966,7 +966,7 @@ fi - - # Check compatibility with MC version - mc_major=$($restool --mc-version | cut -f2 -d':' | cut -f1 -d'.' | tr -d ' ') --if (( $mc_major != 10 )); then -+if [ $mc_major != 10 ]; then - echo "Restool wrapper scripts only support the latest major MC version\n" - echo "that currently is MC10.x. Use with caution." - fi --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch deleted file mode 100644 index a1217668f..000000000 --- a/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 2127850302de2bd8dccff0e31415ce0218750773 Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:53 +0000 -Subject: [PATCH 06/12] scripts: use strings instead of arrays - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 21 ++++++++++++++------- - 1 file changed, 14 insertions(+), 7 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index a39df2c..b0c742e 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -485,7 +485,9 @@ create_dpsw() { - - # Make a link in case there is an end point specified - index=0 -- for i in "${endpoint[@]}"; do -+ echo "${endpoint}" | -+ while read -r i -+ do - connect $root_c "$dpsw.$index" "$i" - index=$((index + 1)) - done -@@ -519,8 +521,8 @@ process_addsw() { - max_fdb_mc_groups=32 - # dpsw object label - label= -- #Endpoint objects provided as argument -- endpoint=() -+ # Endpoint objects provided as argument -+ endpoint= - ifcnt=0 - container=$root_c - -@@ -559,7 +561,7 @@ process_addsw() { - container="${i#*=}" - ;; - @(dpni|dpmac).+([0-9])) -- endpoint[$ifcnt]="$(echo ${i#*=} | tr -d ,)" -+ endpoint="${endpoint}"$'\n'"${i}" - ifcnt=$((ifcnt + 1)) - ;; - *) -@@ -571,14 +573,19 @@ process_addsw() { - done - - # Check if there are more endpoints provided than the number of the interfaces -- if [ $num_ifs -lt ${#endpoint[@]} ]; then -+ if [ $num_ifs -lt $ifcnt ]; then - echo "Error: there are more endpoints provided than the number of the interfaces" - usage_addsw - exit 1 - fi - -+ # Delete first empty line from the endpoint string -+ endpoint="$(echo "${endpoint}" | tail -n +2)" -+ - # Check if the endpoints are valid -- for i in "${endpoint[@]}"; do -+ echo "${endpoint}" | -+ while read -r i -+ do - type_of_endpoint "$i" - check_endpoint "$i" - has_endpoint "$i" -@@ -592,7 +599,7 @@ process_addsw() { - if (( $object_exists_status == 1 )); then - echo "Created ETHSW object $dpsw with ${num_ifs} ports" - -- if [ $num_ifs -gt ${#endpoint[@]} ]; then -+ if [ $num_ifs -gt $ifcnt ]; then - echo "Do not forget to connect devices to interface(s)." - fi - fi --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch deleted file mode 100644 index ed9d76d45..000000000 --- a/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch +++ /dev/null @@ -1,126 +0,0 @@ -From e1036011baf9204d5fe6dd74e5a65f95b9681ebd Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:29:56 +0000 -Subject: [PATCH 07/12] scripts: use Bourne shell's pattern matching - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 71 ++++++++++++++++++++++++++++----------------------------- - 1 file changed, 35 insertions(+), 36 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index b0c742e..a8b9573 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -72,8 +72,6 @@ - # - ## - --shopt -s extglob -- - # Intercept the Ctrl+C command but do not interrupt execution - trap ' ' INT - -@@ -370,15 +368,16 @@ process_addmux() { - -c=* | --container=*) - container="${i#*=}" - ;; -- *(dprc.+([0-9])/)dpmac.+([0-9])) -- endpoint="${i#*=}" -- ;; -- *(dprc.+([0-9])/)dpni.+([0-9])) -- endpoint="${i#*=}" -- ;; - *) -- usage_addmux -- exit 1 -+ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" -+ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" -+ if [ "$i" = "$arg_dpmac" ] || -+ [ "$i" = "$arg_dpni" ]; then -+ endpoint="$i" -+ else -+ usage_addmux -+ exit 1 -+ fi - ;; - esac - done -@@ -560,14 +559,17 @@ process_addsw() { - -c=* | --container=*) - container="${i#*=}" - ;; -- @(dpni|dpmac).+([0-9])) -- endpoint="${endpoint}"$'\n'"${i}" -- ifcnt=$((ifcnt + 1)) -- ;; - *) -- echo "Error: $i argument is invalid" -- usage_addsw -- exit 1 -+ arg_dpmac="$(echo $i | grep -x -E "dpmac.[0-9]+" || true )" -+ arg_dpni="$(echo $i | grep -x -E "dpni.[0-9]+" || true )" -+ if [ "$i" = "$arg_dpmac" ] || -+ [ "$i" = "$arg_dpni" ]; then -+ endpoint="$i" -+ else -+ echo "Error: $i argument is invalid" -+ usage_addsw -+ exit 1 -+ fi - ;; - esac - done -@@ -704,7 +706,8 @@ process_addni() { - ;; - --mac-addr=*) - mac_addr="${i#*=}" -- if [[ ! "$mac_addr" =~ ^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$ ]]; then -+ mac_addr_valid="$(echo $mac_addr | grep -x -E "^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$" || true )" -+ if [ "$mac_addr" != "$mac_addr_valid" ]; then - echo "Invalid MAC address: $mac_addr" - exit 1 - fi -@@ -776,25 +779,21 @@ process_addni() { - -o=* | --options=*) - options="${i#*=}" - ;; -- *(dprc.+([0-9])/)dpmac.+([0-9])) -- no_link=0 -- endpoint="${i#*=}" -- ;; -- *(dprc.+([0-9])/)dpni.+([0-9])) -- no_link=0 -- endpoint="${i#*=}" -- ;; -- *(dprc.+([0-9])/)dpdmux.+([0-9]).+([0-9])) -- no_link=0 -- endpoint="${i#*=}" -- ;; -- *(dprc.+([0-9])/)dpsw.+([0-9]).+([0-9])) -- no_link=0 -- endpoint="${i#*=}" -- ;; - *) -- usage_addni -- exit 1 -+ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" -+ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" -+ arg_dpdmux="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpdmux.[0-9]+.[0-9]+" || true )" -+ arg_dpsw="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpsw.[0-9]+.[0-9]+" || true )" -+ if [ "$i" = "$arg_dpmac" ] || -+ [ "$i" = "$arg_dpni" ] || -+ [ "$i" = "$arg_dpdmux" ] || -+ [ "$i" = "$arg_dpsw" ]; then -+ no_link=0 -+ endpoint="$i" -+ else -+ usage_addni -+ exit 1 -+ fi - ;; - esac - done --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch deleted file mode 100644 index 4921f63c9..000000000 --- a/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 4a1df345edc59a7407b955529955d6799d974b70 Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Tue, 24 Oct 2017 16:30:00 +0000 -Subject: [PATCH 08/12] scripts: use Bourne shell instead of bash - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index a8b9573..bd79295 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/bin/sh - - # Copyright 2013-2016 Freescale Semiconductor Inc. - # Copyright 2017 NXP -@@ -37,7 +37,7 @@ - # Prerequisites: - # - Management Complex version 10.x - # - restool version 1.4 or newer --# - bash shell -+# - Bourne Shell (sh) - # - # - # The purpose of this script is to offer a user friendly way to create --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch deleted file mode 100644 index c642afcaf..000000000 --- a/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch +++ /dev/null @@ -1,36 +0,0 @@ -From ac387de9688099bca1fbdb587d078b369aaf2dab Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Wed, 25 Oct 2017 11:23:42 +0000 -Subject: [PATCH 09/12] scripts: workaround for a improper sed substitution - (TODO) - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index bd79295..7ce73f0 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -197,7 +197,7 @@ has_endpoint() { - ep=$($restool "$toe" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") - fi - -- if [[ "$ep" != *"No object associated"* && "$ep" != *"none"* ]]; then -+ if [[ "$ep" != "endpoint: No object associated" && "$ep" != *"none"* ]]; then - echo "$1 is already linked to $ep" - exit 1 - fi -@@ -230,7 +230,7 @@ get_endpoint() { - end_point=$($restool "$too" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") - fi - -- if [[ "$end_point" != *"No object associated"* && "$end_point" != *"none"* ]]; then -+ if [[ "$end_point" != "endpoint: No object associated" && "$end_point" != *"none"* ]]; then - echo "$end_point" - fi - } --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch deleted file mode 100644 index 9945cd438..000000000 --- a/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 66ae6e5313da8be5742a502c0d7027689e84a17d Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Wed, 25 Oct 2017 11:30:08 +0000 -Subject: [PATCH 10/12] scripts: use proper arithmetic operations - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 7ce73f0..0dcd2fa 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -409,7 +409,7 @@ process_addmux() { - - # check the status - object_exists $container $dpdmux -- if (( $object_exists_status == 1 )); then -+ if [ $object_exists_status == 1 ]; then - - if [ "$root_c" == "$container" ]; then - evb=$(ls $SYS_DPRC/"$root_c"/"$dpdmux"/net/ | grep -v "p") -@@ -598,7 +598,7 @@ process_addsw() { - - # check the status - object_exists $container $dpsw -- if (( $object_exists_status == 1 )); then -+ if [ $object_exists_status == 1 ]; then - echo "Created ETHSW object $dpsw with ${num_ifs} ports" - - if [ $num_ifs -gt $ifcnt ]; then -@@ -850,7 +850,7 @@ process_addni() { - - # check the status - object_exists $container $dpni -- if (( $object_exists_status == 1 )); then -+ if [ $object_exists_status == 1 ]; then - if [ "$root_c" == "$container" ]; then - ni=$(ls $SYS_DPRC/"$root_c"/"$dpni"/net/) - fi --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch deleted file mode 100644 index 1b6cc46a3..000000000 --- a/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 6af86a65f2dcfd42f572e04207eef45da3573b92 Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Wed, 25 Oct 2017 11:30:33 +0000 -Subject: [PATCH 11/12] scripts: do not compare strings with regexp expressions - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 0dcd2fa..526c052 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -805,7 +805,8 @@ process_addni() { - fi - - # if no --num-queues is specified then set it to number of cores -- if [[ $dpni_args != *"--num-queues"* ]]; then -+ num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) -+ if [[ -z "$num_queues_present" ]]; then - dpni_args=$dpni_args" --num-queues="$(nproc) - fi - --- -2.14.1 - diff --git a/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch deleted file mode 100644 index 3acb3b5d8..000000000 --- a/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 0e5f9f0a7f0ef1947984cd82ade9dbc14ba2c80d Mon Sep 17 00:00:00 2001 -From: Ioana Ciornei -Date: Wed, 25 Oct 2017 12:48:04 +0000 -Subject: [PATCH 12/12] scripts: replace 'nproc' with cross-platform - implementation - -Signed-off-by: Ioana Ciornei ---- - scripts/ls-main | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/ls-main b/scripts/ls-main -index 526c052..7d127f6 100755 ---- a/scripts/ls-main -+++ b/scripts/ls-main -@@ -807,7 +807,7 @@ process_addni() { - # if no --num-queues is specified then set it to number of cores - num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) - if [[ -z "$num_queues_present" ]]; then -- dpni_args=$dpni_args" --num-queues="$(nproc) -+ dpni_args=$dpni_args" --num-queues="$(grep -c ^processor /proc/cpuinfo) - fi - - # Check if --no-link the endpoint have been provided otherwise display the usage --- -2.14.1 - diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index 532a02821..3d3662264 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -19,7 +19,6 @@ PKG_HASH:=9645481a2b16476b59220aa2d6bc5bc41043f291326c9b37581018fbd16dd53a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ -PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 5aaa1cbf4..4fdd58265 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.7 +PKG_VERSION:=0.4+2015-04-09 PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://git.netfilter.org/nftables +PKG_SOURCE_URL:=git://git.netfilter.org/nftables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7 -PKG_MIRROR_HASH:=2c0af691948519556952097673ad1b57f888c8314b8eb15e83066951de01fc82 +PKG_SOURCE_VERSION:=3ed296118a065caff5600e60d4f7ef18e137f9a0 +PKG_MIRROR_HASH:=7f6f6162592c848b8047e75374f01a93d2d269dabe013a0150767027049b1e41 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch b/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch deleted file mode 100644 index 99f968435..000000000 --- a/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch +++ /dev/null @@ -1,76 +0,0 @@ -From patchwork Fri Feb 3 14:25:45 2017 -Content-Type: text/plain; charset="utf-8" -MIME-Version: 1.0 -Content-Transfer-Encoding: 7bit -Subject: [nftables] statement: fix print of ip dnat address -From: Florian Westphal -X-Patchwork-Id: 723692 -X-Patchwork-Delegate: pablo@netfilter.org -Message-Id: <20170203142545.13724-1-fw@strlen.de> -To: -Cc: Florian Westphal -Date: Fri, 3 Feb 2017 15:25:45 +0100 - -the change causes non-ipv6 addresses to not be printed at all in case -a nfproto was given. - -Also add a test case to catch this. - -Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1117 -Fixes: 5ab0e10fc6e2c22363a ("src: support for RFC2732 IPv6 address format with brackets") -Signed-off-by: Florian Westphal -Acked-by: Pablo Neira Ayuso ---- - src/statement.c | 2 ++ - tests/py/ip/dnat.t | 1 + - tests/py/ip/dnat.t.payload.ip | 12 ++++++++++++ - 3 files changed, 15 insertions(+) - -diff --git a/src/statement.c b/src/statement.c -index 9cdabbb979e8..3beb86ab4263 100644 ---- a/src/statement.c -+++ b/src/statement.c -@@ -508,6 +508,8 @@ static void nat_stmt_print(const struct stmt *stmt) - printf("]-["); - expr_print(stmt->nat.addr->right); - printf("]"); -+ } else { -+ expr_print(stmt->nat.addr); - } - } else { - expr_print(stmt->nat.addr); -diff --git a/tests/py/ip/dnat.t b/tests/py/ip/dnat.t -index da00106edbb4..089017c84704 100644 ---- a/tests/py/ip/dnat.t -+++ b/tests/py/ip/dnat.t -@@ -7,6 +7,7 @@ iifname "eth0" tcp dport != 80-90 dnat to 192.168.3.2;ok - iifname "eth0" tcp dport {80, 90, 23} dnat to 192.168.3.2;ok - iifname "eth0" tcp dport != {80, 90, 23} dnat to 192.168.3.2;ok - iifname "eth0" tcp dport != 23-34 dnat to 192.168.3.2;ok -+iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080;ok - - dnat to ct mark map { 0x00000014 : 1.2.3.4};ok - dnat to ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4};ok -diff --git a/tests/py/ip/dnat.t.payload.ip b/tests/py/ip/dnat.t.payload.ip -index 66926990d880..7a7f5a82dd5a 100644 ---- a/tests/py/ip/dnat.t.payload.ip -+++ b/tests/py/ip/dnat.t.payload.ip -@@ -60,6 +60,18 @@ ip test-ip4 prerouting - [ immediate reg 1 0x0203a8c0 ] - [ nat dnat ip addr_min reg 1 addr_max reg 0 ] - -+# iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080 -+ip test-ip4 prerouting -+ [ meta load iifname => reg 1 ] -+ [ cmp eq reg 1 0x30687465 0x00000000 0x00000000 0x00000000 ] -+ [ payload load 1b @ network header + 9 => reg 1 ] -+ [ cmp eq reg 1 0x00000006 ] -+ [ payload load 2b @ transport header + 2 => reg 1 ] -+ [ cmp eq reg 1 0x00005100 ] -+ [ immediate reg 1 0x0203a8c0 ] -+ [ immediate reg 2 0x0000901f ] -+ [ nat dnat ip addr_min reg 1 addr_max reg 0 proto_min reg 2 proto_max reg 0 ] -+ - # dnat to ct mark map { 0x00000014 : 1.2.3.4} - __map%d test-ip4 b - __map%d test-ip4 0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index 50919819b..bb04369b5 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -21,7 +21,6 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause -PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index 48cc470bf..593d42894 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -1,13 +1,15 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -72,6 +72,80 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ - - CSRC = setsignal.c tcpdump.c +@@ -70,6 +70,82 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ + @rm -f $@ + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c +ifdef TCPDUMP_MINI + -+LIBNETDISSECT_SRC=\ ++CSRC=\ ++ tcpdump.c \ + netdissect.c \ ++ setsignal.c \ + addrtoname.c \ + addrtostr.c \ + af.c \ @@ -78,10 +80,10 @@ + +else + + CSRC = setsignal.c tcpdump.c + LIBNETDISSECT_SRC=\ - addrtoname.c \ - addrtostr.c \ -@@ -237,6 +311,8 @@ LIBNETDISSECT_SRC=\ +@@ -237,12 +313,16 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c @@ -90,6 +92,27 @@ LOCALSRC = @LOCALSRC@ GENSRC = version.c LIBOBJS = @LIBOBJS@ + ++ifndef TCPDUMP_MINI + LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS} + LIBNETDISSECT=libnetdissect.a ++endif + + + SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) +@@ -373,10 +453,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ + @rm -f $@ + $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) + ++ifndef TCPDUMP_MINI + $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) + @rm -f $@ + $(AR) cr $@ $(LIBNETDISSECT_OBJ) + $(RANLIB) $@ ++endif + + datalinks.o: $(srcdir)/missing/datalinks.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c --- a/addrtoname.c +++ b/addrtoname.c @@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo, diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 9c953ea69..6f11933a9 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -65,7 +65,6 @@ proto_qmi_setup() { [ -n "$delay" ] && sleep "$delay" while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do - [ -e "$device" ] || return 1 sleep 1; done @@ -103,7 +102,6 @@ proto_qmi_setup() { echo "Waiting for network registration" while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do - [ -e "$device" ] || return 1 sleep 5; done diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index e57223dee..ff6537572 100644 --- a/package/network/utils/wpan-tools/Makefile +++ b/package/network/utils/wpan-tools/Makefile @@ -31,7 +31,6 @@ endef define Package/wpan-tools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iwpan $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpan-ping/wpan-ping $(1)/usr/sbin/ endef $(eval $(call BuildPackage,wpan-tools)) diff --git a/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch deleted file mode 100644 index 1370854b6..000000000 --- a/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch +++ /dev/null @@ -1,44 +0,0 @@ -From bb522bd584f05e6658d5dba97f48ca018f46394c Mon Sep 17 00:00:00 2001 -From: Thomas Petazzoni -Date: Sat, 6 May 2017 14:36:08 +0200 -Subject: [PATCH] src/nl_extras.h: fix compatibility with libnl 3.3.0 - -nl_extras.h defines a set of nla_set_s*() functions if not provided by -libnl. They are provided by libnl since version 3.2.26. The test -(LIBNL_VER_MIC <= 26) was working fine while libnl was in the 3.2.x -series, but now that they have incremented the minor version, the -micro version was reset to 0, with the latest libnl version being -3.3.0. - -Due to this, the condition (LIBNL_VER_MIC <= 26) is true, and we get -redefinition errors because nl_extras.h redefines functions already -provided by libnl. - -This commit improves the condition so that nl_extras.h provides the -missing functions only if the minor version is < 2, or if minor is 2 -and micro is < 26. - -Signed-off-by: Thomas Petazzoni ---- - src/nl_extras.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/src/nl_extras.h -+++ b/src/nl_extras.h -@@ -1,7 +1,7 @@ - #ifndef __NL_EXTRAS_H - #define __NL_EXTRAS_H - --#if LIBNL_VER_MIC <= 26 -+#if (LIBNL_VER_MIN < 2) || (LIBNL_VER_MIN == 2) && (LIBNL_VER_MIC <= 26) - - #ifndef NLA_S8 - -@@ -45,6 +45,6 @@ static inline int32_t nla_get_s32(struct - - #endif /* NLA_S64 */ - --#endif /* LIBNL_VER_MIC */ -+#endif /* LIBNL_VER_* */ - - #endif /* __NL_EXTRAS_H */ diff --git a/package/network/utils/wwan/files/wwan.sh b/package/network/utils/wwan/files/wwan.sh index 2e9d73f1e..6b33600b3 100755 --- a/package/network/utils/wwan/files/wwan.sh +++ b/package/network/utils/wwan/files/wwan.sh @@ -66,15 +66,15 @@ proto_wwan_setup() { } } - [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep -e wwan -e usb); do + [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep wwan); do [ -z "$ctl_device" ] || continue driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2) case "$driver" in qmi_wwan|cdc_mbim) ctl_device=/dev/$(ls /sys/class/net/$net/device/usbmisc) ;; - sierra_net|cdc_ether|*cdc_ncm) - ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs -n1 basename | head -n1) + sierra_net|*cdc_ncm) + ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs basename | head -n1) ;; *) continue;; esac @@ -93,11 +93,11 @@ proto_wwan_setup() { uci_set_state network $interface dat_device "$dat_device" case $driver in - qmi_wwan) proto_qmi_setup $@ ;; - cdc_mbim) proto_mbim_setup $@ ;; - sierra_net) proto_directip_setup $@ ;; - comgt) proto_3g_setup $@ ;; - cdc_ether|*cdc_ncm) proto_ncm_setup $@ ;; + qmi_wwan) proto_qmi_setup $@ ;; + cdc_mbim) proto_mbim_setup $@ ;; + sierra_net) proto_directip_setup $@ ;; + comgt) proto_3g_setup $@ ;; + *cdc_ncm) proto_ncm_setup $@ ;; esac } @@ -108,11 +108,11 @@ proto_wwan_teardown() { dat_device=$(uci_get_state network $interface dat_device) case $driver in - qmi_wwan) proto_qmi_teardown $@ ;; - cdc_mbim) proto_mbim_teardown $@ ;; - sierra_net) proto_mbim_teardown $@ ;; - comgt) proto_3g_teardown $@ ;; - cdc_ether|*cdc_ncm) proto_ncm_teardown $@ ;; + qmi_wwan) proto_qmi_teardown $@ ;; + cdc_mbim) proto_mbim_teardown $@ ;; + sierra_net) proto_mbim_teardown $@ ;; + comgt) proto_3g_teardown $@ ;; + *cdc_ncm) proto_ncm_teardown $@ ;; esac } diff --git a/package/network/utils/xtables-addons/Makefile b/package/network/utils/xtables-addons/Makefile index 0c12d7464..50d1287ba 100644 --- a/package/network/utils/xtables-addons/Makefile +++ b/package/network/utils/xtables-addons/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=2.14 +PKG_VERSION:=2.11 PKG_RELEASE:=1 -PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152 +PKG_HASH:=f14f8953a9d3a70157a82883886ff6ec866c61dbea1585edb421478107279921 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/xtables-addons @@ -43,7 +43,8 @@ CONFIGURE_ARGS+= \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(KERNEL_MAKE_FLAGS) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ all @@ -51,7 +52,8 @@ endef define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ - $(KERNEL_MAKE_FLAGS) \ + ARCH="$(LINUX_KARCH)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ install diff --git a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch index a9fb796d0..02250ec20 100644 --- a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch +++ b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch @@ -1,14 +1,5 @@ --- a/extensions/LUA/xt_LUA_target.c +++ b/extensions/LUA/xt_LUA_target.c -@@ -19,7 +19,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include "xt_LUA.h" @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY * XT_CONTINUE inside the *register_lua_packet_lib* function. */ @@ -114,14 +105,3 @@ #endif #if defined(__cplusplus) ---- a/extensions/LUA/lua/llex.h -+++ b/extensions/LUA/lua/llex.h -@@ -10,6 +10,8 @@ - #include "lobject.h" - #include "lzio.h" - -+/* prevent conflict with definition from asm/current.h */ -+#undef current - - #define FIRST_RESERVED 257 - diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 61fc5daa8..16f2f7e77 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -12,9 +12,10 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-01-02 -PKG_SOURCE_VERSION:=11efbf3b90f031ce634fc38cad07a4aef2985777 -PKG_MIRROR_HASH:=35f14ea0ed799d2eb972f4901116a0e447d4bc1e37fb0edb239c44b270aeae18 +PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_VERSION:=37762ff488752c1686b359816aec75831b49c55f +PKG_MIRROR_HASH:=fe619019e0fd680ea32786cad80305250b776d51969de57a8f0feb729f7639e5 +PKG_RELEASE:=1 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -66,13 +67,6 @@ define Package/block-mount DEPENDS:=+ubox +libubox +libuci endef -define Package/blockd - SECTION:=base - CATEGORY:=Base system - TITLE:=Block device automounting - DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 -endef - define Package/fstools/install $(INSTALL_DIR) $(1)/sbin $(1)/lib @@ -102,12 +96,6 @@ define Package/block-mount/install endef -define Package/blockd/install - $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/ - $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ @@ -118,4 +106,3 @@ endef $(eval $(call BuildPackage,fstools)) $(eval $(call BuildPackage,snapshot-tool)) $(eval $(call BuildPackage,block-mount)) -$(eval $(call BuildPackage,blockd)) diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init deleted file mode 100755 index a4ce57d40..000000000 --- a/package/system/fstools/files/blockd.init +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=80 - -USE_PROCD=1 -PROG=/sbin/blockd - -service_triggers() { - procd_add_reload_trigger "fstab" -} - -reload_service() { - block autofs start -} - -start_service() { - procd_open_instance - procd_set_param command "$PROG" - procd_set_param respawn - procd_close_instance -} diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot index a495e3434..c1a5b733f 100644 --- a/package/system/fstools/files/snapshot +++ b/package/system/fstools/files/snapshot @@ -42,7 +42,7 @@ do_snapshot_upgrade() { opkg list-upgradable [ $? -eq 0 ] || exit 2 - + UPDATES=`opkg list-upgradable | cut -d" " -f1` [ -z "${UPDATES}" ] && exit 0 @@ -64,16 +64,14 @@ do_convert_jffs2() { do_convert() { . /lib/functions.sh . /lib/upgrade/common.sh - + ubus call system upgrade + touch /tmp/sysupgrade cd /overlay/upper tar czf /tmp/snapshot.tar.gz * - - install_bin /sbin/upgraded - ubus call system sysupgrade "{ - \"prefix\": \"$RAM_ROOT\", - \"path\": \"\", - \"command\": \". /sbin/snapshot; do_convert_jffs2\" - }" + kill_remaining TERM + sleep 3 + kill_remaining KILL + run_ramfs '. /sbin/snapshot; do_convert_jffs2' } [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && { diff --git a/package/system/mountd/Makefile b/package/system/mountd/Makefile new file mode 100644 index 000000000..37367abd0 --- /dev/null +++ b/package/system/mountd/Makefile @@ -0,0 +1,45 @@ +# Copyright (C) 2009-2012 OpenWrt.org +# All rights reserved. + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mountd +PKG_RELEASE:=3 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=$(LEDE_GIT)/project/mountd.git +PKG_SOURCE_DATE:=2017-11-09 +PKG_SOURCE_VERSION:=7826ca5d6aca691dcb6f98ab203a090d42e79337 +PKG_MIRROR_HASH:=6fda7666a99974ac9179b102f6e8027f6c4091be9b49e1eed49dee7442d83206 +CMAKE_INSTALL:=1 + +PKG_MAINTAINER:=John Crispin +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/mountd + SECTION:=utils + CATEGORY:=Utilities + TITLE:=OpenWrt automount daemon + DEPENDS:=+uci +kmod-fs-autofs4 + URL:=http://www.openwrt.org +endef + +define Package/mountd/description + openwrt automount daemon +endef + +define Package/mountd/conffiles +/etc/config/mountd +endef + +define Package/mountd/install + $(INSTALL_DIR) $(1)/sbin/ $(1)/etc/config/ $(1)/etc/init.d/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/mountd $(1)/sbin/ + $(INSTALL_DATA) ./files/mountd.config $(1)/etc/config/mountd + $(INSTALL_BIN) ./files/mountd.init $(1)/etc/init.d/mountd +endef + +$(eval $(call BuildPackage,mountd)) diff --git a/package/system/mountd/files/mountd.config b/package/system/mountd/files/mountd.config new file mode 100644 index 000000000..561012950 --- /dev/null +++ b/package/system/mountd/files/mountd.config @@ -0,0 +1,3 @@ +config mountd mountd + option timeout 60 + option path /tmp/mounts/ diff --git a/package/system/mountd/files/mountd.init b/package/system/mountd/files/mountd.init new file mode 100755 index 000000000..772bd6ed5 --- /dev/null +++ b/package/system/mountd/files/mountd.init @@ -0,0 +1,22 @@ +#!/bin/sh /etc/rc.common + +START=80 + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 +SERVICE_PID_FILE=/var/run/mountd.pid + +MOUNTD_BIN=/sbin/mountd + +start() +{ + P="$(uci get mountd.mountd.path)" + [ -n "$P" -a ! -f "$P" ] && mkdir -p $P + + service_start $MOUNTD_BIN -f +} + +stop() +{ + service_stop $MOUNTD_BIN +} diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index f00e574de..876a72d01 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -1,32 +1,32 @@ # # Copyright (C) 2006-2015 OpenWrt.org -# Copyright (C) 2016-2017 LEDE Project +# Copyright (C) 2016 LEDE Project # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2017-12-07 -PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c -PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3 +PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git +PKG_SOURCE_DATE:=2017-12-08 +PKG_SOURCE_VERSION:=9f61f7acf3845d2e09675b49fec5d783d57eb780 +PKG_MIRROR_HASH:=3e70d78e92f73e0848a75cfd74762656a4172b6d71369b9e2717dc57acf39cbf PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Jo-Philipp Wich -# Extend depends from version.mk -PKG_CONFIG_DEPENDS += \ - CONFIG_SIGNED_PACKAGES \ - CONFIG_TARGET_INIT_PATH +PKG_FLAGS := nonshared +PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH PKG_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1 @@ -43,7 +43,7 @@ define Package/opkg CATEGORY:=Base system TITLE:=opkg package manager DEPENDS:=+uclient-fetch +libpthread +libubox - URL:=$(PKG_SOURCE_URL) + URL:=https://git.lede-project.org/?p=project/opkg-lede.git MENU:=1 endef @@ -86,6 +86,8 @@ define Package/opkg/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf + $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf) + $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg ifneq ($(CONFIG_SIGNED_PACKAGES),) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7c8a1669b..c260a371a 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git -PKG_SOURCE_DATE:=2018-12-02 -PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e -PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 +PKG_SOURCE_DATE:=2018-01-04 +PKG_SOURCE_VERSION:=188353099cf6fc88f145cfcb84a4db3f6523528a +PKG_MIRROR_HASH:=52605b2a3caf59cdbf88ba218c6288cbe075749422efd69e985ae75bb1001488 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -22,9 +22,11 @@ PKG_LICENSE_FILES:= PKG_MAINTAINER:=John Crispin +PKG_FLAGS:=nonshared + PKG_CONFIG_DEPENDS:= \ CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \ - CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \ + CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \ CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp include $(INCLUDE_DIR)/package.mk @@ -40,7 +42,7 @@ TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt) define Package/procd SECTION:=base CATEGORY:=Base system - DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus + DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand TITLE:=OpenWrt system process manager endef @@ -58,6 +60,20 @@ define Package/procd-seccomp TITLE:=OpenWrt process seccomp helper + utrace endef +define Package/procd-nand + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@NAND_SUPPORT +ubi-utils + TITLE:=OpenWrt sysupgrade nand helper +endef + +define Package/procd-nand-firstboot + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=procd-nand + TITLE:=OpenWrt firstboot nand helper +endef + define Package/procd/config menu "Configuration" depends on PACKAGE_procd @@ -75,6 +91,10 @@ endmenu endef +ifeq ($(CONFIG_NAND_SUPPORT),y) + CMAKE_OPTIONS += -DBUILD_UPGRADED=1 +endif + ifeq ($(CONFIG_PROCD_SHOW_BOOT),y) CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1 endif @@ -93,7 +113,7 @@ CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP) define Package/procd/install $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib $(INSTALL_BIN) ./files/reload_config $(1)/sbin/ $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/ @@ -109,10 +129,25 @@ define Package/procd-seccomp/install $(INSTALL_DIR) $(1)/sbin $(1)/lib $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/ - $(LN) utrace $(1)/sbin/seccomp-trace + ln -s utrace $(1)/sbin/seccomp-trace $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef +define Package/procd-nand/install + $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade + + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/ + $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/ +endef + +define Package/procd-nand-firstboot/install + $(INSTALL_DIR) $(1)/lib/preinit + + $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh +endef + $(eval $(call BuildPackage,procd)) $(eval $(call BuildPackage,procd-ujail)) $(eval $(call BuildPackage,procd-seccomp)) +$(eval $(call BuildPackage,procd-nand)) +$(eval $(call BuildPackage,procd-nand-firstboot)) diff --git a/package/system/procd/files/hotplug-preinit.json b/package/system/procd/files/hotplug-preinit.json index 658c68547..58afc6c69 100644 --- a/package/system/procd/files/hotplug-preinit.json +++ b/package/system/procd/files/hotplug-preinit.json @@ -8,11 +8,11 @@ [ "load-firmware", "/lib/firmware" ], [ "return" ] ] - ] - ] - } ], + ], + ], + }, ], [ "if", [ "eq", "SUBSYSTEM", "button" ], [ "exec", "/etc/rc.button/failsafe" ] - ] + ], ] diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index 1c949bbea..e5f8d967e 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -4,27 +4,27 @@ [ "if", [ "and", [ "has", "MAJOR" ], - [ "has", "MINOR" ] + [ "has", "MINOR" ], ], [ [ "if", [ "eq", "DEVNAME", - [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] + [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ], ], [ [ "makedev", "/dev/%DEVNAME%", "0666" ], - [ "return" ] + [ "return" ], ] ], [ "if", [ "regex", "DEVNAME", "^snd" ], - [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ] + [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ], ], [ "if", [ "has", "DEVNAME" ], - [ "makedev", "/dev/%DEVNAME%", "0600" ] - ] - ] + [ "makedev", "/dev/%DEVNAME%", "0600" ], + ], + ], ], [ "if", [ "has", "FIRMWARE" ], @@ -33,14 +33,14 @@ [ "load-firmware", "/lib/firmware" ], [ "return" ] ] - ] + ], ], "remove" : [ [ "if", [ "and", [ "has", "DEVNAME" ], [ "has", "MAJOR" ], - [ "has", "MINOR" ] + [ "has", "MINOR" ], ], [ "rm", "/dev/%DEVNAME%" ] ] @@ -49,7 +49,7 @@ [ "if", [ "and", [ "has", "BUTTON" ], - [ "eq", "SUBSYSTEM", "button" ] + [ "eq", "SUBSYSTEM", "button" ], ], [ "button", "/etc/rc.button/%BUTTON%" ] ], @@ -65,5 +65,5 @@ [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ], [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ] ] - ] + ], ] diff --git a/package/system/procd/files/nand-preinit.sh b/package/system/procd/files/nand-preinit.sh new file mode 100644 index 000000000..cf596246d --- /dev/null +++ b/package/system/procd/files/nand-preinit.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# Copyright (C) 2014 OpenWrt.org + +nand_takeover() { + . /lib/upgrade/nand.sh + mtd=$(find_mtd_index "$CI_UBIPART") + esize=$(cat /proc/mtd | grep mtd$mtd |cut -d" " -f 3) + [ -z "$esize" ] && return 1 + esize=$(printf "%d" 0x$esize) + for a in `seq 0 64`; do + mtd -o $((a * esize)) -l 400 dump /dev/mtd$mtd > /tmp/takeover.hdr + MAGIC=$(dd if=/tmp/takeover.hdr bs=1 skip=261 count=5 2> /dev/null) + SIZE=$(printf "%d" 0x$(dd if=/tmp/takeover.hdr bs=4 count=1 2> /dev/null | hexdump -v -n 4 -e '1/1 "%02x"')) + [ "$MAGIC" = "ustar" ] && { + mtd -o $((a * esize)) -l $((SIZE + 4)) dump /dev/mtd$mtd | dd bs=1 skip=4 of=/tmp/sysupgrade.tar + nand_do_upgrade_stage2 /tmp/sysupgrade.tar + } + done +} + +boot_hook_add initramfs nand_takeover diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/system/procd/files/nand.sh similarity index 79% rename from package/base-files/files/lib/upgrade/nand.sh rename to package/system/procd/files/nand.sh index 42f488c11..ebaaf2aa1 100644 --- a/package/base-files/files/lib/upgrade/nand.sh +++ b/package/system/procd/files/nand.sh @@ -5,10 +5,10 @@ . /lib/functions.sh # 'kernel' partition on NAND contains the kernel -CI_KERNPART="${CI_KERNPART:-kernel}" +CI_KERNPART="kernel" # 'ubi' partition on NAND contains UBI -CI_UBIPART="${CI_UBIPART:-ubi}" +CI_UBIPART="ubi" ubi_mknod() { local dir="$1" @@ -142,7 +142,7 @@ nand_upgrade_prepare_ubi() { } fi - local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" + local kern_ubivol="$( nand_find_volume $ubidev kernel )" local root_ubivol="$( nand_find_volume $ubidev rootfs )" local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" @@ -157,13 +157,13 @@ nand_upgrade_prepare_ubi() { fi # kill volumes - [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true + [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N kernel || true [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs || true [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true # update kernel if [ "$has_kernel" = "1" ]; then - if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then + if ! ubimkvol /dev/$ubidev -N kernel -s $kernel_length; then echo "cannot create kernel volume" return 1; fi @@ -194,7 +194,7 @@ nand_upgrade_prepare_ubi() { nand_do_upgrade_success() { local conf_tar="/tmp/sysupgrade.tgz" - + sync [ -f "$conf_tar" ] && nand_restore_config "$conf_tar" echo "sysupgrade successful" @@ -231,7 +231,7 @@ nand_upgrade_ubifs() { local rootfs_length=`(cat $1 | wc -c) 2> /dev/null` nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" - + local ubidev="$( nand_find_ubi "$CI_UBIPART" )" local root_ubivol="$(nand_find_volume $ubidev rootfs)" ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1 @@ -239,23 +239,30 @@ nand_upgrade_ubifs() { nand_do_upgrade_success } +nand_board_name() { + if type 'platform_nand_board_name' >/dev/null 2>/dev/null; then + platform_nand_board_name + return + fi + + cat /tmp/sysinfo/board_name +} + nand_upgrade_tar() { local tar_file="$1" + local board_name="$(nand_board_name)" local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') - board_dir=${board_dir%/} + local kernel_length=`(tar xf $tar_file sysupgrade-$board_name/kernel -O | wc -c) 2> /dev/null` + local rootfs_length=`(tar xf $tar_file sysupgrade-$board_name/root -O | wc -c) 2> /dev/null` - local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` - - local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" + local rootfs_type="$(identify_tar "$tar_file" sysupgrade-$board_name/root)" local has_kernel=1 local has_env=0 [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART + tar xf $tar_file sysupgrade-$board_name/kernel -O | mtd write - $CI_KERNPART } [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 @@ -263,29 +270,20 @@ nand_upgrade_tar() { local ubidev="$( nand_find_ubi "$CI_UBIPART" )" [ "$has_kernel" = "1" ] && { - local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" - tar xf $tar_file ${board_dir}/kernel -O | \ + local kern_ubivol="$(nand_find_volume $ubidev kernel)" + tar xf $tar_file sysupgrade-$board_name/kernel -O | \ ubiupdatevol /dev/$kern_ubivol -s $kernel_length - } local root_ubivol="$(nand_find_volume $ubidev rootfs)" - tar xf $tar_file ${board_dir}/root -O | \ + tar xf $tar_file sysupgrade-$board_name/root -O | \ ubiupdatevol /dev/$root_ubivol -s $rootfs_length - nand_do_upgrade_success } # Recognize type of passed file and start the upgrade process -nand_do_upgrade() { - if [ -n "$IS_PRE_UPGRADE" ]; then - # Previously, nand_do_upgrade was called from the platform_pre_upgrade - # hook; this piece of code handles scripts that haven't been - # updated. All scripts should gradually move to call nand_do_upgrade - # from platform_do_upgrade instead. - export do_upgrade="nand_do_upgrade '$1'" - return - fi - +nand_do_upgrade_stage2() { local file_type=$(identify $1) if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then @@ -301,6 +299,45 @@ nand_do_upgrade() { esac } +nand_upgrade_stage2() { + [ $1 = "nand" ] && { + [ -f "$2" ] && { + touch /tmp/sysupgrade + + killall -9 telnetd + killall -9 dropbear + killall -9 ash + + kill_remaining TERM + sleep 3 + kill_remaining KILL + + sleep 1 + + if [ -n "$(rootfs_type)" ]; then + v "Switching to ramdisk..." + run_ramfs ". /lib/functions.sh; include /lib/upgrade; nand_do_upgrade_stage2 $2" + else + nand_do_upgrade_stage2 $2 + fi + return 0 + } + echo "Nand upgrade failed" + exit 1 + } +} + +nand_upgrade_stage1() { + [ -f /tmp/sysupgrade-nand-path ] && { + path="$(cat /tmp/sysupgrade-nand-path)" + [ "$SAVE_CONFIG" != 1 -a -f "$CONF_TAR" ] && + rm $CONF_TAR + + ubus call system nandupgrade "{\"path\": \"$path\" }" + exit 0 + } +} + # Check if passed file is a valid one for NAND sysupgrade. Currently it accepts # 3 types of files: # 1) UBI - should contain an ubinized image, header is checked for the proper @@ -327,3 +364,12 @@ nand_do_platform_check() { return 0 } + +# Start NAND upgrade process +# +# $(1): file to be used for upgrade +nand_do_upgrade() { + echo -n $1 > /tmp/sysupgrade-nand-path + cp /sbin/upgraded /tmp/ + nand_upgrade_stage1 +} diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index b4b6faa66..e6ca8a6bc 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -38,20 +38,6 @@ PROCD_RELOAD_DELAY=1000 _PROCD_SERVICE= -procd_lock() { - local basescript=$(readlink "$initscript") - local service_name="$(basename ${basescript:-$initscript})" - - flock -n 1000 &> /dev/null - if [ "$?" != "0" ]; then - exec 1000>/var/lock/procd_${service_name}.lock - flock 1000 - if [ "$?" != "0" ]; then - logger "warning: procd flock for $service_name failed" - fi - fi -} - _procd_call() { local old_cb @@ -61,7 +47,6 @@ _procd_call() { } _procd_wrapper() { - procd_lock while [ -n "$1" ]; do eval "$1() { _procd_call _$1 \"\$@\"; }" shift @@ -94,9 +79,6 @@ _procd_close_service() { _procd_open_trigger service_triggers _procd_close_trigger - _procd_open_data - service_data - _procd_close_data _procd_ubus_call ${1:-set} } @@ -152,18 +134,6 @@ _procd_close_trigger() { json_close_array } -_procd_open_data() { - let '_procd_data_open = _procd_data_open + 1' - [ "$_procd_data_open" -gt 1 ] && return - json_add_object "data" -} - -_procd_close_data() { - let '_procd_data_open = _procd_data_open - 1' - [ "$_procd_data_open" -lt 1 ] || return - json_close_object -} - _procd_open_validate() { json_select .. json_add_array "validate" @@ -243,7 +213,7 @@ _procd_set_param() { json_add_string "" "$@" json_close_array ;; - nice|term_timeout) + nice) json_add_int "$type" "$1" ;; reload_signal) @@ -413,10 +383,6 @@ _procd_send_signal() { local instance="$2" local signal="$3" - case "$signal" in - [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;; - esac - json_init json_add_string name "$service" [ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance" diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 21119ee6d..3c9b4aa51 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2017-11-06 -PKG_SOURCE_VERSION:=2c0d9cfe05e9712d44622c6bb4558e97359bfb76 -PKG_MIRROR_HASH:=e545a29959a310fd7243ee2e799bf9f759894ea4e872010a781c3a65290377b6 +PKG_SOURCE_DATE:=2017-03-10 +PKG_SOURCE_VERSION:=16f7e16181e2f3e9cf3e2ce56a7e291844900d09 +PKG_MIRROR_HASH:=5f10f3df134eb8a69d281a73d39f5d2e2fc96af531a2f3960b0c6116ff11a707 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -41,11 +41,11 @@ define Package/ubox/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib - $(LN) kmodloader $(1)/sbin/rmmod - $(LN) kmodloader $(1)/sbin/insmod - $(LN) kmodloader $(1)/sbin/lsmod - $(LN) kmodloader $(1)/sbin/modinfo - $(LN) kmodloader $(1)/sbin/modprobe + $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod + $(LN) ../../sbin/kmodloader $(1)/usr/sbin/insmod + $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod + $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo + $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe endef define Package/logd/install diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index ce8b054b4..4f3d4e830 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2017-11-13 -PKG_SOURCE_VERSION:=5f87f5480ebf004d735dbf44259d08cf8affd305 -PKG_MIRROR_HASH:=a490348da86c6cdf0cbc8cc01b77fa6f708d86b94674fd312e0c822ca3d7eba0 +PKG_SOURCE_DATE:=2017-02-18 +PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692 +PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index d4718ee90..04dfd8335 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -14,8 +14,8 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE=2018-01-01 -PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6 -PKG_MIRROR_HASH:=123c5d3ed8f86db76ab52584e952c8e870891bca4dab682b753ca384d7d067bf +PKG_SOURCE_VERSION:=141b64ef84f43c954e665865b1bbf216fbf7c05f +PKG_MIRROR_HASH:=fbd837a16cfa6b0d80f5a4b332b86a105a2b9d37480bcc777931fdea7ce601c9 PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 78ec27766..50891a64e 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -118,10 +118,9 @@ uci_add() { uci_rename() { local PACKAGE="$1" local CONFIG="$2" - local OPTION="$3" - local VALUE="$4" + local VALUE="$3" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}" + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE" } uci_remove() { diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index c42c94d3a..086169652 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -28,7 +28,7 @@ define Package/adb DEPENDS:=+zlib +libopenssl +libpthread endef -define Package/adb/description +define Package/bridge/description Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. endef diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 4e429f437..1977e7ff4 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -7,9 +7,6 @@ config BUSYBOX_DEFAULT_DESKTOP config BUSYBOX_DEFAULT_EXTRA_COMPAT bool default n -config BUSYBOX_DEFAULT_FEDORA_COMPAT - bool - default n config BUSYBOX_DEFAULT_INCLUDE_SUSv2 bool default y @@ -19,6 +16,15 @@ config BUSYBOX_DEFAULT_USE_PORTABLE_CODE config BUSYBOX_DEFAULT_PLATFORM_LINUX bool default y +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK + bool + default y +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS + bool + default n config BUSYBOX_DEFAULT_SHOW_USAGE bool default y @@ -37,9 +43,45 @@ config BUSYBOX_DEFAULT_FEATURE_INSTALLER config BUSYBOX_DEFAULT_INSTALL_NO_USR bool default n +config BUSYBOX_DEFAULT_LOCALE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + bool + default n +config BUSYBOX_DEFAULT_SUBST_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + bool + default n +config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + bool + default n config BUSYBOX_DEFAULT_PAM bool default n +config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + bool + default n config BUSYBOX_DEFAULT_LONG_OPTS bool default y @@ -121,30 +163,6 @@ config BUSYBOX_DEFAULT_EXTRA_LDFLAGS config BUSYBOX_DEFAULT_EXTRA_LDLIBS string default "" -config BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS - bool - default y -config BUSYBOX_DEFAULT_INSTALL_APPLET_HARDLINKS - bool - default n -config BUSYBOX_DEFAULT_INSTALL_APPLET_SCRIPT_WRAPPERS - bool - default n -config BUSYBOX_DEFAULT_INSTALL_APPLET_DONT - bool - default n -config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SYMLINK - bool - default n -config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_HARDLINK - bool - default n -config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER - bool - default n -config BUSYBOX_DEFAULT_PREFIX - string - default "./_install" config BUSYBOX_DEFAULT_DEBUG bool default n @@ -169,21 +187,36 @@ config BUSYBOX_DEFAULT_DMALLOC config BUSYBOX_DEFAULT_EFENCE bool default n +config BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS + bool + default y +config BUSYBOX_DEFAULT_INSTALL_APPLET_HARDLINKS + bool + default n +config BUSYBOX_DEFAULT_INSTALL_APPLET_SCRIPT_WRAPPERS + bool + default n +config BUSYBOX_DEFAULT_INSTALL_APPLET_DONT + bool + default n +config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SYMLINK + bool + default n +config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_HARDLINK + bool + default n +config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER + bool + default n +config BUSYBOX_DEFAULT_PREFIX + string + default "./_install" config BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL bool default n config BUSYBOX_DEFAULT_FEATURE_RTMINMAX bool default n -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK - bool - default y -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS - bool - default n config BUSYBOX_DEFAULT_PASSWORD_MINLEN int default 6 @@ -199,6 +232,9 @@ config BUSYBOX_DEFAULT_FEATURE_FAST_TOP config BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS bool default n +config BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS + bool + default n config BUSYBOX_DEFAULT_FEATURE_EDITING bool default y @@ -232,48 +268,12 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_FANCY_PROMPT config BUSYBOX_DEFAULT_FEATURE_EDITING_ASK_TERMINAL bool default n -config BUSYBOX_DEFAULT_LOCALE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - bool - default n -config BUSYBOX_DEFAULT_SUBST_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - bool - default n -config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - bool - default n config BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP bool default y config BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE bool default n -config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - bool - default y config BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB int default 4 @@ -319,34 +319,22 @@ config BUSYBOX_DEFAULT_UNCOMPRESS config BUSYBOX_DEFAULT_GUNZIP bool default y -config BUSYBOX_DEFAULT_ZCAT - bool - default y config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS bool default n config BUSYBOX_DEFAULT_BUNZIP2 bool default y -config BUSYBOX_DEFAULT_BZCAT - bool - default y config BUSYBOX_DEFAULT_UNLZMA bool default n -config BUSYBOX_DEFAULT_LZCAT - bool - default n -config BUSYBOX_DEFAULT_LZMA - bool - default n config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST bool default n -config BUSYBOX_DEFAULT_UNXZ +config BUSYBOX_DEFAULT_LZMA bool default n -config BUSYBOX_DEFAULT_XZCAT +config BUSYBOX_DEFAULT_UNXZ bool default n config BUSYBOX_DEFAULT_XZ @@ -355,9 +343,6 @@ config BUSYBOX_DEFAULT_XZ config BUSYBOX_DEFAULT_BZIP2 bool default n -config BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS - bool - default y config BUSYBOX_DEFAULT_CPIO bool default n @@ -373,6 +358,9 @@ config BUSYBOX_DEFAULT_DPKG config BUSYBOX_DEFAULT_DPKG_DEB bool default n +config BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY + bool + default n config BUSYBOX_DEFAULT_GZIP bool default y @@ -385,18 +373,9 @@ config BUSYBOX_DEFAULT_GZIP_FAST config BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS bool default n -config BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS - bool - default y config BUSYBOX_DEFAULT_LZOP bool default n -config BUSYBOX_DEFAULT_UNLZOP - bool - default n -config BUSYBOX_DEFAULT_LZOPCAT - bool - default n config BUSYBOX_DEFAULT_LZOP_COMPR_HIGH bool default n @@ -445,25 +424,109 @@ config BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX config BUSYBOX_DEFAULT_UNZIP bool default n -config BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ - bool - default n config BUSYBOX_DEFAULT_BASENAME bool default y config BUSYBOX_DEFAULT_CAT bool default y -config BUSYBOX_DEFAULT_FEATURE_CATV +config BUSYBOX_DEFAULT_DATE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_NANO + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT + bool + default n +config BUSYBOX_DEFAULT_DD + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_STATUS + bool + default n +config BUSYBOX_DEFAULT_HOSTID + bool + default n +config BUSYBOX_DEFAULT_ID + bool + default y +config BUSYBOX_DEFAULT_GROUPS + bool + default n +config BUSYBOX_DEFAULT_SHUF + bool + default n +config BUSYBOX_DEFAULT_STAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM + bool + default n +config BUSYBOX_DEFAULT_SYNC + bool + default y +config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY + bool + default n +config BUSYBOX_DEFAULT_TEST + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TEST_64 + bool + default y +config BUSYBOX_DEFAULT_TOUCH + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 + bool + default y +config BUSYBOX_DEFAULT_TR + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV + bool + default n +config BUSYBOX_DEFAULT_TRUNCATE + bool + default n +config BUSYBOX_DEFAULT_UNLINK + bool + default n +config BUSYBOX_DEFAULT_BASE64 + bool + default n +config BUSYBOX_DEFAULT_WHO + bool + default n +config BUSYBOX_DEFAULT_USERS + bool + default n +config BUSYBOX_DEFAULT_CAL + bool + default n +config BUSYBOX_DEFAULT_CATV bool default n config BUSYBOX_DEFAULT_CHGRP @@ -496,33 +559,6 @@ config BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS config BUSYBOX_DEFAULT_CUT bool default y -config BUSYBOX_DEFAULT_DATE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_NANO - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT - bool - default n -config BUSYBOX_DEFAULT_DD - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_STATUS - bool - default n config BUSYBOX_DEFAULT_DF bool default y @@ -562,21 +598,12 @@ config BUSYBOX_DEFAULT_EXPAND config BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS bool default n -config BUSYBOX_DEFAULT_UNEXPAND - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - bool - default n config BUSYBOX_DEFAULT_EXPR bool default y config BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 bool default y -config BUSYBOX_DEFAULT_FACTOR - bool - default n config BUSYBOX_DEFAULT_FALSE bool default y @@ -592,24 +619,12 @@ config BUSYBOX_DEFAULT_HEAD config BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD bool default y -config BUSYBOX_DEFAULT_HOSTID - bool - default n -config BUSYBOX_DEFAULT_ID - bool - default y -config BUSYBOX_DEFAULT_GROUPS - bool - default n config BUSYBOX_DEFAULT_INSTALL bool default n config BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS bool default n -config BUSYBOX_DEFAULT_LINK - bool - default n config BUSYBOX_DEFAULT_LN bool default y @@ -628,9 +643,6 @@ config BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS config BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE bool default y -config BUSYBOX_DEFAULT_FEATURE_LS_WIDTH - bool - default y config BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES bool default y @@ -649,21 +661,6 @@ config BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT config BUSYBOX_DEFAULT_MD5SUM bool default y -config BUSYBOX_DEFAULT_SHA1SUM - bool - default n -config BUSYBOX_DEFAULT_SHA256SUM - bool - default y -config BUSYBOX_DEFAULT_SHA512SUM - bool - default n -config BUSYBOX_DEFAULT_SHA3SUM - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - bool - default y config BUSYBOX_DEFAULT_MKDIR bool default y @@ -685,21 +682,12 @@ config BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS config BUSYBOX_DEFAULT_NICE bool default y -config BUSYBOX_DEFAULT_NL - bool - default n config BUSYBOX_DEFAULT_NOHUP bool default n -config BUSYBOX_DEFAULT_NPROC - bool - default n config BUSYBOX_DEFAULT_OD bool default n -config BUSYBOX_DEFAULT_PASTE - bool - default n config BUSYBOX_DEFAULT_PRINTENV bool default n @@ -730,10 +718,16 @@ config BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS config BUSYBOX_DEFAULT_SEQ bool default y -config BUSYBOX_DEFAULT_SHRED +config BUSYBOX_DEFAULT_SHA1SUM bool default n -config BUSYBOX_DEFAULT_SHUF +config BUSYBOX_DEFAULT_SHA256SUM + bool + default y +config BUSYBOX_DEFAULT_SHA512SUM + bool + default n +config BUSYBOX_DEFAULT_SHA3SUM bool default n config BUSYBOX_DEFAULT_SLEEP @@ -757,27 +751,12 @@ config BUSYBOX_DEFAULT_SPLIT config BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY bool default n -config BUSYBOX_DEFAULT_STAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM - bool - default n config BUSYBOX_DEFAULT_STTY bool default n config BUSYBOX_DEFAULT_SUM bool default n -config BUSYBOX_DEFAULT_SYNC - bool - default y -config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY - bool - default n config BUSYBOX_DEFAULT_TAC bool default n @@ -793,42 +772,9 @@ config BUSYBOX_DEFAULT_TEE config BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO bool default y -config BUSYBOX_DEFAULT_TEST - bool - default y -config BUSYBOX_DEFAULT_TEST1 - bool - default y -config BUSYBOX_DEFAULT_TEST2 - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TEST_64 - bool - default y -config BUSYBOX_DEFAULT_TOUCH - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 - bool - default y -config BUSYBOX_DEFAULT_TR - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV - bool - default n config BUSYBOX_DEFAULT_TRUE bool default y -config BUSYBOX_DEFAULT_TRUNCATE - bool - default n config BUSYBOX_DEFAULT_TTY bool default n @@ -838,21 +784,21 @@ config BUSYBOX_DEFAULT_UNAME config BUSYBOX_DEFAULT_UNAME_OSNAME string default "GNU/Linux" +config BUSYBOX_DEFAULT_UNEXPAND + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + bool + default n config BUSYBOX_DEFAULT_UNIQ bool default y -config BUSYBOX_DEFAULT_UNLINK - bool - default n config BUSYBOX_DEFAULT_USLEEP bool default n config BUSYBOX_DEFAULT_UUDECODE bool default n -config BUSYBOX_DEFAULT_BASE64 - bool - default n config BUSYBOX_DEFAULT_UUENCODE bool default n @@ -862,15 +808,6 @@ config BUSYBOX_DEFAULT_WC config BUSYBOX_DEFAULT_FEATURE_WC_LARGE bool default n -config BUSYBOX_DEFAULT_WHO - bool - default n -config BUSYBOX_DEFAULT_W - bool - default n -config BUSYBOX_DEFAULT_USERS - bool - default n config BUSYBOX_DEFAULT_WHOAMI bool default n @@ -883,12 +820,21 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE config BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS bool default y +config BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH + bool + default y config BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE bool default y +config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + bool + default y config BUSYBOX_DEFAULT_CHVT bool default n +config BUSYBOX_DEFAULT_FGCONSOLE + bool + default n config BUSYBOX_DEFAULT_CLEAR bool default y @@ -898,30 +844,12 @@ config BUSYBOX_DEFAULT_DEALLOCVT config BUSYBOX_DEFAULT_DUMPKMAP bool default n -config BUSYBOX_DEFAULT_FGCONSOLE - bool - default n config BUSYBOX_DEFAULT_KBD_MODE bool default n config BUSYBOX_DEFAULT_LOADFONT bool default n -config BUSYBOX_DEFAULT_SETFONT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP - bool - default n -config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR - string - default "" -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - bool - default n config BUSYBOX_DEFAULT_LOADKMAP bool default n @@ -943,6 +871,15 @@ config BUSYBOX_DEFAULT_SETCONSOLE config BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_SETFONT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP + bool + default n +config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR + string + default "" config BUSYBOX_DEFAULT_SETKEYCODES bool default n @@ -952,6 +889,12 @@ config BUSYBOX_DEFAULT_SETLOGCONS config BUSYBOX_DEFAULT_SHOWKEY bool default n +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + bool + default n config BUSYBOX_DEFAULT_MKTEMP bool default y @@ -1089,7 +1032,7 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH default y config BUSYBOX_DEFAULT_FEATURE_FIND_NEWER bool - default y + default n config BUSYBOX_DEFAULT_FEATURE_FIND_INUM bool default n @@ -1138,10 +1081,10 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_LINKS config BUSYBOX_DEFAULT_GREP bool default y -config BUSYBOX_DEFAULT_EGREP +config BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS bool default y -config BUSYBOX_DEFAULT_FGREP +config BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS bool default y config BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT @@ -1177,12 +1120,6 @@ config BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_CONFIG_FILE config BUSYBOX_DEFAULT_HALT bool default y -config BUSYBOX_DEFAULT_POWEROFF - bool - default y -config BUSYBOX_DEFAULT_REBOOT - bool - default y config BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT bool default n @@ -1210,7 +1147,7 @@ config BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY config BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG bool default n -config BUSYBOX_DEFAULT_FEATURE_INIT_QUIET +config BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET bool default n config BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS @@ -1330,9 +1267,6 @@ config BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG config BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS bool default n -config BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY - bool - default n config BUSYBOX_DEFAULT_SULOGIN bool default n @@ -1351,42 +1285,45 @@ config BUSYBOX_DEFAULT_LSATTR config BUSYBOX_DEFAULT_TUNE2FS bool default n +config BUSYBOX_DEFAULT_MODINFO + bool + default n config BUSYBOX_DEFAULT_MODPROBE_SMALL bool default n -config BUSYBOX_DEFAULT_DEPMOD +config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED bool default n config BUSYBOX_DEFAULT_INSMOD bool default n +config BUSYBOX_DEFAULT_RMMOD + bool + default n config BUSYBOX_DEFAULT_LSMOD bool default n config BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool default n -config BUSYBOX_DEFAULT_MODINFO - bool - default n config BUSYBOX_DEFAULT_MODPROBE bool default n config BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST bool default n -config BUSYBOX_DEFAULT_RMMOD - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED +config BUSYBOX_DEFAULT_DEPMOD bool default n config BUSYBOX_DEFAULT_FEATURE_2_4_MODULES bool default n +config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP + bool + default n config BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING bool default n @@ -1405,9 +1342,6 @@ config BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL config BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE bool default n -config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - bool - default n config BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS bool default n @@ -1420,141 +1354,18 @@ config BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR config BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE string default "" -config BUSYBOX_DEFAULT_ACPID - bool - default n -config BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT - bool - default n config BUSYBOX_DEFAULT_BLKDISCARD bool default n -config BUSYBOX_DEFAULT_BLKID - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE - bool - default n config BUSYBOX_DEFAULT_BLOCKDEV bool default n -config BUSYBOX_DEFAULT_CAL - bool - default n -config BUSYBOX_DEFAULT_DMESG - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY - bool - default y -config BUSYBOX_DEFAULT_FALLOCATE - bool - default n config BUSYBOX_DEFAULT_FATATTR bool default n -config BUSYBOX_DEFAULT_FBSET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY - bool - default n -config BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE - bool - default n -config BUSYBOX_DEFAULT_FDFORMAT - bool - default n -config BUSYBOX_DEFAULT_FDISK - bool - default n -config BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_AIX_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SGI_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SUN_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_OSF_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_GPT_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED - bool - default n -config BUSYBOX_DEFAULT_FINDFS - bool - default n -config BUSYBOX_DEFAULT_FLOCK - bool - default y -config BUSYBOX_DEFAULT_FDFLUSH - bool - default n -config BUSYBOX_DEFAULT_FREERAMDISK - bool - default n -config BUSYBOX_DEFAULT_FSCK_MINIX - bool - default n -config BUSYBOX_DEFAULT_FSFREEZE - bool - default n config BUSYBOX_DEFAULT_FSTRIM bool default n -config BUSYBOX_DEFAULT_GETOPT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG - bool - default n -config BUSYBOX_DEFAULT_HEXDUMP - bool - default y -config BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE - bool - default n -config BUSYBOX_DEFAULT_HD - bool - default n -config BUSYBOX_DEFAULT_XXD - bool - default n -config BUSYBOX_DEFAULT_HWCLOCK - bool - default y -config BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS - bool - default n -config BUSYBOX_DEFAULT_IPCRM - bool - default n -config BUSYBOX_DEFAULT_IPCS - bool - default n -config BUSYBOX_DEFAULT_LOSETUP - bool - default n -config BUSYBOX_DEFAULT_LSPCI - bool - default n -config BUSYBOX_DEFAULT_LSUSB - bool - default n config BUSYBOX_DEFAULT_MDEV bool default n @@ -1573,36 +1384,6 @@ config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE bool default n -config BUSYBOX_DEFAULT_MKE2FS - bool - default n -config BUSYBOX_DEFAULT_MKFS_EXT2 - bool - default n -config BUSYBOX_DEFAULT_MKFS_MINIX - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MINIX2 - bool - default n -config BUSYBOX_DEFAULT_MKFS_REISER - bool - default n -config BUSYBOX_DEFAULT_MKDOSFS - bool - default n -config BUSYBOX_DEFAULT_MKFS_VFAT - bool - default n -config BUSYBOX_DEFAULT_MKSWAP - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID - bool - default n -config BUSYBOX_DEFAULT_MORE - bool - default n config BUSYBOX_DEFAULT_MOUNT bool default y @@ -1639,6 +1420,153 @@ config BUSYBOX_DEFAULT_NSENTER config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS bool default n +config BUSYBOX_DEFAULT_REV + bool + default n +config BUSYBOX_DEFAULT_SETARCH + bool + default n +config BUSYBOX_DEFAULT_UEVENT + bool + default n +config BUSYBOX_DEFAULT_UNSHARE + bool + default n +config BUSYBOX_DEFAULT_ACPID + bool + default n +config BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT + bool + default n +config BUSYBOX_DEFAULT_BLKID + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE + bool + default n +config BUSYBOX_DEFAULT_DMESG + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY + bool + default y +config BUSYBOX_DEFAULT_FBSET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY + bool + default n +config BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE + bool + default n +config BUSYBOX_DEFAULT_FDFLUSH + bool + default n +config BUSYBOX_DEFAULT_FDFORMAT + bool + default n +config BUSYBOX_DEFAULT_FDISK + bool + default n +config BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_AIX_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SGI_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SUN_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_OSF_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_GPT_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED + bool + default n +config BUSYBOX_DEFAULT_FINDFS + bool + default n +config BUSYBOX_DEFAULT_FLOCK + bool + default n +config BUSYBOX_DEFAULT_FREERAMDISK + bool + default n +config BUSYBOX_DEFAULT_FSCK_MINIX + bool + default n +config BUSYBOX_DEFAULT_MKFS_EXT2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_MINIX + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MINIX2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_REISER + bool + default n +config BUSYBOX_DEFAULT_MKFS_VFAT + bool + default n +config BUSYBOX_DEFAULT_GETOPT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG + bool + default n +config BUSYBOX_DEFAULT_HEXDUMP + bool + default y +config BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE + bool + default n +config BUSYBOX_DEFAULT_HD + bool + default n +config BUSYBOX_DEFAULT_HWCLOCK + bool + default y +config BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS + bool + default n +config BUSYBOX_DEFAULT_IPCRM + bool + default n +config BUSYBOX_DEFAULT_IPCS + bool + default n +config BUSYBOX_DEFAULT_LOSETUP + bool + default n +config BUSYBOX_DEFAULT_LSPCI + bool + default n +config BUSYBOX_DEFAULT_LSUSB + bool + default n +config BUSYBOX_DEFAULT_MKSWAP + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID + bool + default n +config BUSYBOX_DEFAULT_MORE + bool + default n config BUSYBOX_DEFAULT_PIVOT_ROOT bool default y @@ -1651,9 +1579,6 @@ config BUSYBOX_DEFAULT_RDEV config BUSYBOX_DEFAULT_READPROFILE bool default n -config BUSYBOX_DEFAULT_REV - bool - default n config BUSYBOX_DEFAULT_RTCWAKE bool default n @@ -1663,19 +1588,7 @@ config BUSYBOX_DEFAULT_SCRIPT config BUSYBOX_DEFAULT_SCRIPTREPLAY bool default n -config BUSYBOX_DEFAULT_SETARCH - bool - default n -config BUSYBOX_DEFAULT_LINUX32 - bool - default n -config BUSYBOX_DEFAULT_LINUX64 - bool - default n -config BUSYBOX_DEFAULT_SETPRIV - bool - default n -config BUSYBOX_DEFAULT_SWAPON +config BUSYBOX_DEFAULT_SWAPONOFF bool default n config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD @@ -1684,24 +1597,15 @@ config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD config BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI bool default n -config BUSYBOX_DEFAULT_SWAPOFF - bool - default n config BUSYBOX_DEFAULT_SWITCH_ROOT bool default y -config BUSYBOX_DEFAULT_UEVENT - bool - default n config BUSYBOX_DEFAULT_UMOUNT bool default y config BUSYBOX_DEFAULT_FEATURE_UMOUNT_ALL bool default y -config BUSYBOX_DEFAULT_UNSHARE - bool - default n config BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP bool default y @@ -1774,15 +1678,114 @@ config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV bool default n -config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS - bool - default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF bool default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS bool default n +config BUSYBOX_DEFAULT_CONSPY + bool + default n +config BUSYBOX_DEFAULT_CROND + bool + default y +config BUSYBOX_DEFAULT_FEATURE_CROND_D + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_DIR + string + default "/etc" +config BUSYBOX_DEFAULT_I2CGET + bool + default n +config BUSYBOX_DEFAULT_I2CSET + bool + default n +config BUSYBOX_DEFAULT_I2CDUMP + bool + default n +config BUSYBOX_DEFAULT_I2CDETECT + bool + default n +config BUSYBOX_DEFAULT_LESS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES + int + default 9999999 +config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS + bool + default n +config BUSYBOX_DEFAULT_NANDWRITE + bool + default n +config BUSYBOX_DEFAULT_NANDDUMP + bool + default n +config BUSYBOX_DEFAULT_RFKILL + bool + default n +config BUSYBOX_DEFAULT_SETSERIAL + bool + default n +config BUSYBOX_DEFAULT_TASKSET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + bool + default n +config BUSYBOX_DEFAULT_UBIATTACH + bool + default n +config BUSYBOX_DEFAULT_UBIDETACH + bool + default n +config BUSYBOX_DEFAULT_UBIMKVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRMVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRSVOL + bool + default n +config BUSYBOX_DEFAULT_UBIUPDATEVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRENAME + bool + default n +config BUSYBOX_DEFAULT_WALL + bool + default n config BUSYBOX_DEFAULT_ADJTIMEX bool default n @@ -1828,21 +1831,6 @@ config BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT config BUSYBOX_DEFAULT_CHRT bool default n -config BUSYBOX_DEFAULT_CONSPY - bool - default n -config BUSYBOX_DEFAULT_CROND - bool - default y -config BUSYBOX_DEFAULT_FEATURE_CROND_D - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_DIR - string - default "/etc" config BUSYBOX_DEFAULT_CRONTAB bool default y @@ -1879,7 +1867,7 @@ config BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI config BUSYBOX_DEFAULT_FBSPLASH bool default n -config BUSYBOX_DEFAULT_FLASH_ERASEALL +config BUSYBOX_DEFAULT_FLASHCP bool default n config BUSYBOX_DEFAULT_FLASH_LOCK @@ -1888,7 +1876,19 @@ config BUSYBOX_DEFAULT_FLASH_LOCK config BUSYBOX_DEFAULT_FLASH_UNLOCK bool default n -config BUSYBOX_DEFAULT_FLASHCP +config BUSYBOX_DEFAULT_FLASH_ERASEALL + bool + default n +config BUSYBOX_DEFAULT_IONICE + bool + default n +config BUSYBOX_DEFAULT_INOTIFYD + bool + default n +config BUSYBOX_DEFAULT_LAST + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY bool default n config BUSYBOX_DEFAULT_HDPARM @@ -1912,69 +1912,9 @@ config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA bool default n -config BUSYBOX_DEFAULT_I2CGET - bool - default n -config BUSYBOX_DEFAULT_I2CSET - bool - default n -config BUSYBOX_DEFAULT_I2CDUMP - bool - default n -config BUSYBOX_DEFAULT_I2CDETECT - bool - default n -config BUSYBOX_DEFAULT_INOTIFYD - bool - default n -config BUSYBOX_DEFAULT_IONICE - bool - default n -config BUSYBOX_DEFAULT_LAST - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY - bool - default n -config BUSYBOX_DEFAULT_LESS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES - int - default 9999999 -config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS - bool - default n config BUSYBOX_DEFAULT_LOCK bool default y -config BUSYBOX_DEFAULT_LSSCSI - bool - default n config BUSYBOX_DEFAULT_MAKEDEVS bool default n @@ -1996,45 +1936,24 @@ config BUSYBOX_DEFAULT_MOUNTPOINT config BUSYBOX_DEFAULT_MT bool default n -config BUSYBOX_DEFAULT_NANDWRITE - bool - default n -config BUSYBOX_DEFAULT_NANDDUMP - bool - default n -config BUSYBOX_DEFAULT_PARTPROBE - bool - default n config BUSYBOX_DEFAULT_RAIDAUTORUN bool default n config BUSYBOX_DEFAULT_READAHEAD bool default n -config BUSYBOX_DEFAULT_RFKILL - bool - default n config BUSYBOX_DEFAULT_RUNLEVEL bool default n config BUSYBOX_DEFAULT_RX bool default n -config BUSYBOX_DEFAULT_SETSERIAL - bool - default n config BUSYBOX_DEFAULT_SETSID bool default n config BUSYBOX_DEFAULT_STRINGS bool default y -config BUSYBOX_DEFAULT_TASKSET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - bool - default n config BUSYBOX_DEFAULT_TIME bool default y @@ -2044,34 +1963,64 @@ config BUSYBOX_DEFAULT_TIMEOUT config BUSYBOX_DEFAULT_TTYSIZE bool default n -config BUSYBOX_DEFAULT_UBIATTACH - bool - default n -config BUSYBOX_DEFAULT_UBIDETACH - bool - default n -config BUSYBOX_DEFAULT_UBIMKVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRMVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRSVOL - bool - default n -config BUSYBOX_DEFAULT_UBIUPDATEVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRENAME - bool - default n config BUSYBOX_DEFAULT_VOLNAME bool default n -config BUSYBOX_DEFAULT_WALL +config BUSYBOX_DEFAULT_WATCHDOG bool default n -config BUSYBOX_DEFAULT_WATCHDOG +config BUSYBOX_DEFAULT_NAMEIF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED + bool + default n +config BUSYBOX_DEFAULT_NBDCLIENT + bool + default n +config BUSYBOX_DEFAULT_NC + bool + default y +config BUSYBOX_DEFAULT_NC_SERVER + bool + default n +config BUSYBOX_DEFAULT_NC_EXTRA + bool + default n +config BUSYBOX_DEFAULT_NC_110_COMPAT + bool + default n +config BUSYBOX_DEFAULT_PING + bool + default y +config BUSYBOX_DEFAULT_PING6 + bool + default y +config BUSYBOX_DEFAULT_FEATURE_FANCY_PING + bool + default y +config BUSYBOX_DEFAULT_WGET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER + bool + default n +config BUSYBOX_DEFAULT_WHOIS bool default n config BUSYBOX_DEFAULT_FEATURE_IPV6 @@ -2107,16 +2056,19 @@ config BUSYBOX_DEFAULT_DNSD config BUSYBOX_DEFAULT_ETHER_WAKE bool default n +config BUSYBOX_DEFAULT_FAKEIDENTD + bool + default n config BUSYBOX_DEFAULT_FTPD bool default n -config BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE +config BUSYBOX_DEFAULT_FEATURE_FTP_WRITE bool default n config BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST bool default n -config BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION +config BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION bool default n config BUSYBOX_DEFAULT_FTPGET @@ -2131,9 +2083,6 @@ config BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS config BUSYBOX_DEFAULT_HOSTNAME bool default n -config BUSYBOX_DEFAULT_DNSDOMAINNAME - bool - default n config BUSYBOX_DEFAULT_HTTPD bool default n @@ -2194,10 +2143,7 @@ config BUSYBOX_DEFAULT_IFENSLAVE config BUSYBOX_DEFAULT_IFPLUGD bool default n -config BUSYBOX_DEFAULT_IFUP - bool - default n -config BUSYBOX_DEFAULT_IFDOWN +config BUSYBOX_DEFAULT_IFUPDOWN bool default n config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH @@ -2206,6 +2152,12 @@ config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP bool default n +config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN + bool + default n +config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN + bool + default n config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 bool default n @@ -2242,24 +2194,6 @@ config BUSYBOX_DEFAULT_FEATURE_INETD_RPC config BUSYBOX_DEFAULT_IP bool default y -config BUSYBOX_DEFAULT_IPADDR - bool - default n -config BUSYBOX_DEFAULT_IPLINK - bool - default n -config BUSYBOX_DEFAULT_IPROUTE - bool - default n -config BUSYBOX_DEFAULT_IPTUNNEL - bool - default n -config BUSYBOX_DEFAULT_IPRULE - bool - default n -config BUSYBOX_DEFAULT_IPNEIGH - bool - default n config BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS bool default y @@ -2280,10 +2214,31 @@ config BUSYBOX_DEFAULT_FEATURE_IP_RULE default y config BUSYBOX_DEFAULT_FEATURE_IP_NEIGH bool - default y + default n +config BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS + bool + default n config BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS bool default n +config BUSYBOX_DEFAULT_IPADDR + bool + default n +config BUSYBOX_DEFAULT_IPLINK + bool + default n +config BUSYBOX_DEFAULT_IPROUTE + bool + default n +config BUSYBOX_DEFAULT_IPTUNNEL + bool + default n +config BUSYBOX_DEFAULT_IPRULE + bool + default n +config BUSYBOX_DEFAULT_IPNEIGH + bool + default n config BUSYBOX_DEFAULT_IPCALC bool default n @@ -2293,30 +2248,6 @@ config BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY config BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS bool default n -config BUSYBOX_DEFAULT_FAKEIDENTD - bool - default n -config BUSYBOX_DEFAULT_NAMEIF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED - bool - default n -config BUSYBOX_DEFAULT_NBDCLIENT - bool - default n -config BUSYBOX_DEFAULT_NC - bool - default y -config BUSYBOX_DEFAULT_NC_SERVER - bool - default n -config BUSYBOX_DEFAULT_NC_EXTRA - bool - default n -config BUSYBOX_DEFAULT_NC_110_COMPAT - bool - default n config BUSYBOX_DEFAULT_NETMSG bool default y @@ -2332,12 +2263,9 @@ config BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG config BUSYBOX_DEFAULT_NSLOOKUP bool default n -config BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT +config BUSYBOX_DEFAULT_NSLOOKUP_LEDE bool default y -config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS - bool - default n config BUSYBOX_DEFAULT_NTPD bool default y @@ -2347,15 +2275,6 @@ config BUSYBOX_DEFAULT_FEATURE_NTPD_SERVER config BUSYBOX_DEFAULT_FEATURE_NTPD_CONF bool default n -config BUSYBOX_DEFAULT_PING - bool - default y -config BUSYBOX_DEFAULT_PING6 - bool - default y -config BUSYBOX_DEFAULT_FEATURE_FANCY_PING - bool - default y config BUSYBOX_DEFAULT_PSCAN bool default n @@ -2365,15 +2284,9 @@ config BUSYBOX_DEFAULT_ROUTE config BUSYBOX_DEFAULT_SLATTACH bool default n -config BUSYBOX_DEFAULT_SSL_CLIENT - bool - default n config BUSYBOX_DEFAULT_TCPSVD bool default n -config BUSYBOX_DEFAULT_UDPSVD - bool - default n config BUSYBOX_DEFAULT_TELNET bool default n @@ -2383,9 +2296,6 @@ config BUSYBOX_DEFAULT_FEATURE_TELNET_TTYPE config BUSYBOX_DEFAULT_FEATURE_TELNET_AUTOLOGIN bool default n -config BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH - bool - default n config BUSYBOX_DEFAULT_TELNETD bool default n @@ -2416,9 +2326,6 @@ config BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR config BUSYBOX_DEFAULT_TFTP_DEBUG bool default n -config BUSYBOX_DEFAULT_TLS - bool - default n config BUSYBOX_DEFAULT_TRACEROUTE bool default y @@ -2428,6 +2335,9 @@ config BUSYBOX_DEFAULT_TRACEROUTE6 config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE bool default y +config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE + bool + default n config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP bool default n @@ -2437,51 +2347,18 @@ config BUSYBOX_DEFAULT_TUNCTL config BUSYBOX_DEFAULT_FEATURE_TUNCTL_UG bool default n -config BUSYBOX_DEFAULT_VCONFIG - bool - default n -config BUSYBOX_DEFAULT_WGET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - bool - default n -config BUSYBOX_DEFAULT_WHOIS - bool - default n -config BUSYBOX_DEFAULT_ZCIP - bool - default n config BUSYBOX_DEFAULT_UDHCPC6 bool default n -config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 - bool - default n config BUSYBOX_DEFAULT_UDHCPD bool default n +config BUSYBOX_DEFAULT_DHCPRELAY + bool + default n +config BUSYBOX_DEFAULT_DUMPLEASES + bool + default n config BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool default n @@ -2491,12 +2368,6 @@ config BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC config BUSYBOX_DEFAULT_DHCPD_LEASES_FILE string default "" -config BUSYBOX_DEFAULT_DUMPLEASES - bool - default n -config BUSYBOX_DEFAULT_DHCPRELAY - bool - default n config BUSYBOX_DEFAULT_UDHCPC bool default y @@ -2527,6 +2398,15 @@ config BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS config BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS string default "" +config BUSYBOX_DEFAULT_UDPSVD + bool + default n +config BUSYBOX_DEFAULT_VCONFIG + bool + default n +config BUSYBOX_DEFAULT_ZCIP + bool + default n config BUSYBOX_DEFAULT_LPD bool default n @@ -2539,6 +2419,9 @@ config BUSYBOX_DEFAULT_LPQ config BUSYBOX_DEFAULT_MAKEMIME bool default n +config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + string + default "" config BUSYBOX_DEFAULT_POPMAILDIR bool default n @@ -2554,27 +2437,9 @@ config BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT config BUSYBOX_DEFAULT_SENDMAIL bool default n -config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - string - default "" -config BUSYBOX_DEFAULT_FREE - bool - default y -config BUSYBOX_DEFAULT_FUSER - bool - default n config BUSYBOX_DEFAULT_IOSTAT bool default n -config BUSYBOX_DEFAULT_KILL - bool - default y -config BUSYBOX_DEFAULT_KILLALL - bool - default y -config BUSYBOX_DEFAULT_KILLALL5 - bool - default n config BUSYBOX_DEFAULT_LSOF bool default n @@ -2584,69 +2449,24 @@ config BUSYBOX_DEFAULT_MPSTAT config BUSYBOX_DEFAULT_NMETER bool default n -config BUSYBOX_DEFAULT_PGREP - bool - default y -config BUSYBOX_DEFAULT_PKILL - bool - default n -config BUSYBOX_DEFAULT_PIDOF - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - bool - default n config BUSYBOX_DEFAULT_PMAP bool default n config BUSYBOX_DEFAULT_POWERTOP bool default n -config BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE - bool - default n -config BUSYBOX_DEFAULT_PS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_WIDE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_LONG - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_TIME - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - bool - default n config BUSYBOX_DEFAULT_PSTREE bool default n config BUSYBOX_DEFAULT_PWDX bool default n -config BUSYBOX_DEFAULT_RENICE - bool - default n config BUSYBOX_DEFAULT_SMEMCAP bool default n -config BUSYBOX_DEFAULT_BB_SYSCTL - bool - default y config BUSYBOX_DEFAULT_TOP bool default y -config BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE - bool - default n config BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool default y @@ -2671,12 +2491,66 @@ config BUSYBOX_DEFAULT_UPTIME config BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT bool default n -config BUSYBOX_DEFAULT_WATCH +config BUSYBOX_DEFAULT_FREE + bool + default y +config BUSYBOX_DEFAULT_FUSER bool default n +config BUSYBOX_DEFAULT_KILL + bool + default y +config BUSYBOX_DEFAULT_KILLALL + bool + default y +config BUSYBOX_DEFAULT_KILLALL5 + bool + default n +config BUSYBOX_DEFAULT_PGREP + bool + default y +config BUSYBOX_DEFAULT_PIDOF + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + bool + default n +config BUSYBOX_DEFAULT_PKILL + bool + default n +config BUSYBOX_DEFAULT_PS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_WIDE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_LONG + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_TIME + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + bool + default n +config BUSYBOX_DEFAULT_RENICE + bool + default n +config BUSYBOX_DEFAULT_BB_SYSCTL + bool + default y config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS bool default n +config BUSYBOX_DEFAULT_WATCH + bool + default n config BUSYBOX_DEFAULT_CHPST bool default n @@ -2707,9 +2581,6 @@ config BUSYBOX_DEFAULT_SV config BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR string default "" -config BUSYBOX_DEFAULT_SVC - bool - default n config BUSYBOX_DEFAULT_SVLOGD bool default n @@ -2731,6 +2602,9 @@ config BUSYBOX_DEFAULT_LOAD_POLICY config BUSYBOX_DEFAULT_MATCHPATHCON bool default n +config BUSYBOX_DEFAULT_RESTORECON + bool + default n config BUSYBOX_DEFAULT_RUNCON bool default n @@ -2740,9 +2614,6 @@ config BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS config BUSYBOX_DEFAULT_SELINUXENABLED bool default n -config BUSYBOX_DEFAULT_SESTATUS - bool - default n config BUSYBOX_DEFAULT_SETENFORCE bool default n @@ -2752,76 +2623,55 @@ config BUSYBOX_DEFAULT_SETFILES config BUSYBOX_DEFAULT_FEATURE_SETFILES_CHECK_OPTION bool default n -config BUSYBOX_DEFAULT_RESTORECON - bool - default n config BUSYBOX_DEFAULT_SETSEBOOL bool default n -config BUSYBOX_DEFAULT_SH_IS_ASH - bool - default y -config BUSYBOX_DEFAULT_SH_IS_HUSH +config BUSYBOX_DEFAULT_SESTATUS bool default n -config BUSYBOX_DEFAULT_SH_IS_NONE - bool - default n -config BUSYBOX_DEFAULT_BASH_IS_ASH - bool - default n -config BUSYBOX_DEFAULT_BASH_IS_HUSH - bool - default n -config BUSYBOX_DEFAULT_BASH_IS_NONE - bool - default y config BUSYBOX_DEFAULT_ASH bool default y -config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - bool - default n -config BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB - bool - default y config BUSYBOX_DEFAULT_ASH_BASH_COMPAT bool default y +config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + bool + default n config BUSYBOX_DEFAULT_ASH_JOB_CONTROL bool default y config BUSYBOX_DEFAULT_ASH_ALIAS bool default y -config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT +config BUSYBOX_DEFAULT_ASH_GETOPTS bool default y -config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - bool - default n -config BUSYBOX_DEFAULT_ASH_MAIL - bool - default n -config BUSYBOX_DEFAULT_ASH_ECHO +config BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO bool default y -config BUSYBOX_DEFAULT_ASH_PRINTF +config BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF bool default y -config BUSYBOX_DEFAULT_ASH_TEST +config BUSYBOX_DEFAULT_ASH_BUILTIN_TEST bool default y config BUSYBOX_DEFAULT_ASH_HELP bool default n -config BUSYBOX_DEFAULT_ASH_GETOPTS +config BUSYBOX_DEFAULT_ASH_CMDCMD bool default y -config BUSYBOX_DEFAULT_ASH_CMDCMD +config BUSYBOX_DEFAULT_ASH_MAIL + bool + default n +config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE + bool + default n +config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT bool default y config BUSYBOX_DEFAULT_CTTYHACK @@ -2869,61 +2719,37 @@ config BUSYBOX_DEFAULT_HUSH_LOCAL config BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT bool default n -config BUSYBOX_DEFAULT_HUSH_MODE_X - bool - default n -config BUSYBOX_DEFAULT_HUSH_ECHO - bool - default n -config BUSYBOX_DEFAULT_HUSH_PRINTF - bool - default n -config BUSYBOX_DEFAULT_HUSH_TEST - bool - default n -config BUSYBOX_DEFAULT_HUSH_EXPORT - bool - default n config BUSYBOX_DEFAULT_HUSH_EXPORT_N bool default n -config BUSYBOX_DEFAULT_HUSH_KILL - bool - default n -config BUSYBOX_DEFAULT_HUSH_WAIT - bool - default n -config BUSYBOX_DEFAULT_HUSH_TRAP - bool - default n -config BUSYBOX_DEFAULT_HUSH_TYPE - bool - default n -config BUSYBOX_DEFAULT_HUSH_READ - bool - default n -config BUSYBOX_DEFAULT_HUSH_SET - bool - default n -config BUSYBOX_DEFAULT_HUSH_UNSET - bool - default n -config BUSYBOX_DEFAULT_HUSH_ULIMIT - bool - default n -config BUSYBOX_DEFAULT_HUSH_UMASK - bool - default n -config BUSYBOX_DEFAULT_HUSH_MEMLEAK +config BUSYBOX_DEFAULT_HUSH_MODE_X bool default n config BUSYBOX_DEFAULT_MSH bool default n -config BUSYBOX_DEFAULT_FEATURE_SH_MATH +config BUSYBOX_DEFAULT_FEATURE_SH_IS_ASH bool default y -config BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 +config BUSYBOX_DEFAULT_FEATURE_SH_IS_HUSH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SH_IS_NONE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BASH_IS_ASH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BASH_IS_HUSH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BASH_IS_NONE + bool + default y +config BUSYBOX_DEFAULT_SH_MATH_SUPPORT + bool + default y +config BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 bool default y config BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 8866756ae..0d3708636 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -8,23 +8,21 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.27.2 -PKG_RELEASE:=3 +PKG_VERSION:=1.25.1 +PKG_RELEASE:=4 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df +PKG_HASH:=27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 -PKG_INSTALL:=1 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE -PKG_CPE_ID:=cpe:/a:busybox:busybox include $(INCLUDE_DIR)/package.mk @@ -32,8 +30,11 @@ ifeq ($(DUMP),) STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5) endif -BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) -BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) +ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) + BB_MAKE_VERBOSE := V=1 +else + BB_MAKE_VERBOSE := +endif define Package/busybox SECTION:=base @@ -43,20 +44,6 @@ define Package/busybox URL:=http://busybox.net/ DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter MENU:=1 - PROVIDES:=ip - ALTERNATIVES:=\ - $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,WATCH, 100:/bin/watch:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,IP, 100:/sbin/ip:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,FREE, 100:/usr/bin/free:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,PGREP, 100:/usr/bin/pgrep:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,PKILL, 100:/usr/bin/pkill:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,PMAP, 100:/usr/bin/pmap:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,PWDX, 100:/usr/bin/pwdx:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,TOP, 100:/usr/bin/top:/bin/busybox) \ - $(call BUSYBOX_IF_ENABLED,UPTIME, 100:/usr/bin/uptime:/bin/busybox) \ - endef define Package/busybox/description @@ -68,35 +55,64 @@ define Package/busybox/config source "$(SOURCE)/Config.in" endef +BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) + # don't create a version string containing the actual timestamp export KCONFIG_NOTIMESTAMP=1 +define Build/Configure + rm -f $(PKG_BUILD_DIR)/.configured* + grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config + yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + KBUILD_HAVE_NLS=no \ + ARCH="$(ARCH)" \ + $(BB_MAKE_VERBOSE) \ + oldconfig +endef LDLIBS:=m crypt -LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread) ifdef CONFIG_BUSYBOX_USE_LIBRPC + TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include + export LDFLAGS=$(TARGET_LDFLAGS) LDLIBS += rpc endif -ifeq ($(CONFIG_USE_GLIBC),y) - LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv) + +ifdef CONFIG_BUSYBOX_CONFIG_PAM + TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include + export LDFLAGS=$(TARGET_LDFLAGS) + LDLIBS += pam pam_misc pthread endif -MAKE_VARS := -MAKE_FLAGS += \ - EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ - EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ - LDLIBS="$(LDLIBS)" \ - SKIP_STRIP=y -ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) - MAKE_FLAGS += V=1 +ifdef CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE + ifeq ($(CONFIG_USE_GLIBC),y) + LDLIBS += resolv + endif endif -MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)" - - -define Build/Configure - grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config - yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + KBUILD_HAVE_NLS=no \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + ARCH="$(ARCH)" \ + SKIP_STRIP=y \ + LDLIBS="$(LDLIBS)" \ + $(BB_MAKE_VERBOSE) \ + all + rm -rf $(PKG_INSTALL_DIR) + $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \; + $(MAKE) -C $(PKG_BUILD_DIR) \ + CC="$(TARGET_CC)" \ + CROSS_COMPILE="$(TARGET_CROSS)" \ + EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ + ARCH="$(ARCH)" \ + CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \ + LDLIBS="$(LDLIBS)" \ + $(BB_MAKE_VERBOSE) \ + install endef define Package/busybox/install diff --git a/package/utils/busybox/config/Config.in b/package/utils/busybox/config/Config.in index c66aa08e7..3bf67c5cf 100644 --- a/package/utils/busybox/config/Config.in +++ b/package/utils/busybox/config/Config.in @@ -10,18 +10,15 @@ config BUSYBOX_CONFIG_HAVE_DOT_CONFIG menu "Busybox Settings" +menu "General Configuration" + config BUSYBOX_CONFIG_DESKTOP bool "Enable options for full-blown desktop systems" default BUSYBOX_DEFAULT_DESKTOP help Enable options and features which are not essential. - Select this if you plan to use busybox on full-blown desktop machine - with common Linux distro, which needs higher level of command-line - compatibility. - - If you are preparing your build to be used on an embedded box - where you have tighter control over the entire set of userspace - tools, you can unselect this option for smaller code size. + Select this only if you plan to use busybox on full-blown + desktop machine with common Linux distro, not on an embedded box. config BUSYBOX_CONFIG_EXTRA_COMPAT bool "Provide compatible behavior for rare corner cases (bigger code)" @@ -32,19 +29,6 @@ config BUSYBOX_CONFIG_EXTRA_COMPAT some GNU extensions in libc. You probably only need this option if you plan to run busybox on desktop. -config BUSYBOX_CONFIG_FEDORA_COMPAT - bool "Building for Fedora distribution" - default BUSYBOX_DEFAULT_FEDORA_COMPAT - help - This option makes some tools behave like they do on Fedora. - - At the time of this writing (2017-08) this only affects uname: - normally, uname -p (processor) and uname -i (platform) - are shown as "unknown", but with this option uname -p - shows the same string as uname -m (machine type), - and so does uname -i unless machine type is i486/i586/i686 - - then uname -i shows "i386". - config BUSYBOX_CONFIG_INCLUDE_SUSv2 bool "Enable obsolete features removed before SUSv3" default BUSYBOX_DEFAULT_INCLUDE_SUSv2 @@ -62,6 +46,41 @@ config BUSYBOX_CONFIG_USE_PORTABLE_CODE compiler other than gcc. If you do use gcc, this option may needlessly increase code size. +config BUSYBOX_CONFIG_PLATFORM_LINUX + bool "Enable Linux-specific applets and features" + default BUSYBOX_DEFAULT_PLATFORM_LINUX + help + For the most part, busybox requires only POSIX compatibility + from the target system, but some applets and features use + Linux-specific interfaces. + + Answering 'N' here will disable such applets and hide the + corresponding configuration options. + +choice + prompt "Buffer allocation policy" + default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + help + There are 3 ways BusyBox can handle buffer allocations: + - Use malloc. This costs code size for the call to xmalloc. + - Put them on stack. For some very small machines with limited stack + space, this can be deadly. For most folks, this works just fine. + - Put them in BSS. This works beautifully for computers with a real + MMU (and OS support), but wastes runtime RAM for uCLinux. This + behavior was the only one available for BusyBox versions 0.48 and + earlier. + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC + bool "Allocate with Malloc" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + bool "Allocate on the Stack" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS + bool "Allocate in the .bss section" + +endchoice + config BUSYBOX_CONFIG_SHOW_USAGE bool "Show applet usage messages" default BUSYBOX_DEFAULT_SHOW_USAGE @@ -124,15 +143,153 @@ config BUSYBOX_CONFIG_INSTALL_NO_USR will install applets only to /bin and /sbin, never to /usr/bin or /usr/sbin. +config BUSYBOX_CONFIG_LOCALE_SUPPORT + bool "Enable locale support (system needs locale for this to work)" + default BUSYBOX_DEFAULT_LOCALE_SUPPORT + help + Enable this if your system has locale support and you would like + busybox to support locale settings. + +config BUSYBOX_CONFIG_UNICODE_SUPPORT + bool "Support Unicode" + default BUSYBOX_DEFAULT_UNICODE_SUPPORT + help + This makes various applets aware that one byte is not + one character on screen. + + Busybox aims to eventually work correctly with Unicode displays. + Any older encodings are not guaranteed to work. + Probably by the time when busybox will be fully Unicode-clean, + other encodings will be mainly of historic interest. + +config BUSYBOX_CONFIG_UNICODE_USING_LOCALE + bool "Use libc routines for Unicode (else uses internal ones)" + default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT + help + With this option on, Unicode support is implemented using libc + routines. Otherwise, internal implementation is used. + Internal implementation is smaller. + +config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV + bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" + default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, Unicode support is activated + only if locale-related variables have the value of the form + "xxxx.utf8" + + Otherwise, Unicode support will be always enabled and active. + +config BUSYBOX_CONFIG_SUBST_WCHAR + int "Character code to substitute unprintable characters with" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_SUBST_WCHAR + help + Typical values are 63 for '?' (works with any output device), + 30 for ASCII substitute control code, + 65533 (0xfffd) for Unicode replacement character. + +config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR + int "Range of supported Unicode characters" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + help + Any character with Unicode value bigger than this is assumed + to be non-printable on output device. Many applets replace + such chars with substitution character. + + The idea is that many valid printable Unicode chars are + nevertheless are not displayed correctly. Think about + combining charachers, double-wide hieroglyphs, obscure + characters in dozens of ancient scripts... + Many terminals, terminal emulators, xterms etc will fail + to handle them correctly. Choose the smallest value + which suits your needs. + + Typical values are: + 126 - ASCII only + 767 (0x2ff) - there are no combining chars in [0..767] range + (the range includes Latin 1, Latin Ext. A and B), + code is ~700 bytes smaller for this case. + 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, + code is ~300 bytes smaller for this case. + 12799 (0x31ff) - nearly all non-ideographic characters are + available in [0..12799] range, including + East Asian scripts like katakana, hiragana, hangul, + bopomofo... + 0 - off, any valid printable Unicode character will be printed. + +config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS + bool "Allow zero-width Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width of 0 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS + bool "Allow wide Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width > 1 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + bool "Bidirectional character-aware line input" + default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, right-to-left Unicode characters + are treated differently on input (e.g. cursor movement). + +config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE + bool "In bidi input, support non-ASCII neutral chars too" + default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + help + In most cases it's enough to treat only ASCII non-letters + (i.e. punctuation, numbers and space) as characters + with neutral directionality. + With this option on, more extensive (and bigger) table + of neutral chars will be used. + +config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN + bool "Make it possible to enter sequences of chars which are not Unicode" + default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option on, on line-editing input (such as used by shells) + invalid UTF-8 bytes are not substituted with the selected + substitution character. + For example, this means that entering 'l', 's', ' ', 0xff, [Enter] + at shell prompt will list file named 0xff (single char name + with char value 255), not file named '?'. + config BUSYBOX_CONFIG_PAM - bool "Support PAM (Pluggable Authentication Modules)" + bool "Support for PAM (Pluggable Authentication Modules)" default BUSYBOX_DEFAULT_PAM help Use PAM in some busybox applets (currently login and httpd) instead of direct access to password database. +config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE + bool "Use sendfile system call" + default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + When enabled, busybox will use the kernel sendfile() function + instead of read/write loops to copy data between file descriptors + (for example, cp command does this a lot). + If sendfile() doesn't work, copying code falls back to read/write + loop. sendfile() was originally implemented for faster I/O + from files to sockets, but since Linux 2.6.33 it was extended + to work for many more file types. + config BUSYBOX_CONFIG_LONG_OPTS - bool "Support --long-options" + bool "Support for --long-options" default BUSYBOX_DEFAULT_LONG_OPTS help Enable this if you want busybox applets to use the gnu --long-option @@ -199,7 +356,7 @@ config BUSYBOX_CONFIG_PID_FILE_PATH specify a pidfile path. config BUSYBOX_CONFIG_FEATURE_SUID - bool "Support SUID/SGID handling" + bool "Support for SUID/SGID handling" default BUSYBOX_DEFAULT_FEATURE_SUID help With this option you can install the busybox binary belonging @@ -339,18 +496,9 @@ config BUSYBOX_CONFIG_FEATURE_HAVE_RPC # This is automatically selected if any of enabled applets need it. # You do not need to select it manually. -config BUSYBOX_CONFIG_PLATFORM_LINUX - bool #No description makes it a hidden option - default BUSYBOX_DEFAULT_PLATFORM_LINUX - #help - # For the most part, busybox requires only POSIX compatibility - # from the target system, but some applets and features use - # Linux-specific interfaces. - # - # This is automatically selected if any applet or feature requires - # Linux-specific interfaces. You do not need to select it manually. +endmenu -comment 'Build Options' +menu 'Build Options' config BUSYBOX_CONFIG_STATIC bool "Build BusyBox as a static binary (no shared libs)" @@ -525,7 +673,103 @@ config BUSYBOX_CONFIG_EXTRA_LDLIBS help Additional LDLIBS to pass to the linker with -l. -comment 'Installation Options ("make install" behavior)' +endmenu + +menu 'Debugging Options' + +config BUSYBOX_CONFIG_DEBUG + bool "Build BusyBox with extra Debugging symbols" + default BUSYBOX_DEFAULT_DEBUG + help + Say Y here if you wish to examine BusyBox internals while applets are + running. This increases the size of the binary considerably, and + should only be used when doing development. If you are doing + development and want to debug BusyBox, answer Y. + + Most people should answer N. + +config BUSYBOX_CONFIG_DEBUG_PESSIMIZE + bool "Disable compiler optimizations" + default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE + depends on BUSYBOX_CONFIG_DEBUG + help + The compiler's optimization of source code can eliminate and reorder + code, resulting in an executable that's hard to understand when + stepping through it with a debugger. This switches it off, resulting + in a much bigger executable that more closely matches the source + code. + +config BUSYBOX_CONFIG_DEBUG_SANITIZE + bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" + default BUSYBOX_DEFAULT_DEBUG_SANITIZE + help + Say Y here if you want to enable runtime sanitizers. These help + catch bad memory accesses (e.g. buffer overflows), but will make + the executable larger and slow down runtime a bit. + + If you aren't developing/testing busybox, say N here. + +config BUSYBOX_CONFIG_UNIT_TEST + bool "Build unit tests" + default BUSYBOX_DEFAULT_UNIT_TEST + help + Say Y here if you want to build unit tests (both the framework and + test cases) as a Busybox applet. This results in bigger code, so you + probably don't want this option in production builds. + +config BUSYBOX_CONFIG_WERROR + bool "Abort compilation on any warning" + default BUSYBOX_DEFAULT_WERROR + help + Selecting this will add -Werror to gcc command line. + + Most people should answer N. + +choice + prompt "Additional debugging library" + default BUSYBOX_CONFIG_NO_DEBUG_LIB + help + Using an additional debugging library will make BusyBox become + considerable larger and will cause it to run more slowly. You + should always leave this option disabled for production use. + + dmalloc support: + ---------------- + This enables compiling with dmalloc ( http://dmalloc.com/ ) + which is an excellent public domain mem leak and malloc problem + detector. To enable dmalloc, before running busybox you will + want to properly set your environment, for example: + export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile + The 'debug=' value is generated using the following command + dmalloc -p log-stats -p log-non-free -p log-bad-space \ + -p log-elapsed-time -p check-fence -p check-heap \ + -p check-lists -p check-blank -p check-funcs -p realloc-copy \ + -p allow-free-null + + Electric-fence support: + ----------------------- + This enables compiling with Electric-fence support. Electric + fence is another very useful malloc debugging library which uses + your computer's virtual memory hardware to detect illegal memory + accesses. This support will make BusyBox be considerable larger + and run slower, so you should leave this option disabled unless + you are hunting a hard to find memory problem. + + +config BUSYBOX_CONFIG_NO_DEBUG_LIB + bool "None" + +config BUSYBOX_CONFIG_DMALLOC + bool "Dmalloc" + +config BUSYBOX_CONFIG_EFENCE + bool "Electric-fence" + +endchoice + +endmenu + +menu 'Installation Options ("make install" behavior)' choice prompt "What kind of applet links to install" @@ -591,104 +835,12 @@ config BUSYBOX_CONFIG_PREFIX help Define your directory to install BusyBox files/subdirs in. -comment 'Debugging Options' - -config BUSYBOX_CONFIG_DEBUG - bool "Build BusyBox with extra Debugging symbols" - default BUSYBOX_DEFAULT_DEBUG - help - Say Y here if you wish to examine BusyBox internals while applets are - running. This increases the size of the binary considerably, and - should only be used when doing development. If you are doing - development and want to debug BusyBox, answer Y. - - Most people should answer N. - -config BUSYBOX_CONFIG_DEBUG_PESSIMIZE - bool "Disable compiler optimizations" - default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE - depends on BUSYBOX_CONFIG_DEBUG - help - The compiler's optimization of source code can eliminate and reorder - code, resulting in an executable that's hard to understand when - stepping through it with a debugger. This switches it off, resulting - in a much bigger executable that more closely matches the source - code. - -config BUSYBOX_CONFIG_DEBUG_SANITIZE - bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" - default BUSYBOX_DEFAULT_DEBUG_SANITIZE - help - Say Y here if you want to enable runtime sanitizers. These help - catch bad memory accesses (e.g. buffer overflows), but will make - the executable larger and slow down runtime a bit. - - This adds -fsanitize=foo options to gcc command line. - - If you aren't developing/testing busybox, say N here. - -config BUSYBOX_CONFIG_UNIT_TEST - bool "Build unit tests" - default BUSYBOX_DEFAULT_UNIT_TEST - help - Say Y here if you want to build unit tests (both the framework and - test cases) as a Busybox applet. This results in bigger code, so you - probably don't want this option in production builds. - -config BUSYBOX_CONFIG_WERROR - bool "Abort compilation on any warning" - default BUSYBOX_DEFAULT_WERROR - help - This adds -Werror to gcc command line. - - Most people should answer N. - -choice - prompt "Additional debugging library" - default BUSYBOX_CONFIG_NO_DEBUG_LIB - help - Using an additional debugging library will make BusyBox become - considerable larger and will cause it to run more slowly. You - should always leave this option disabled for production use. - - dmalloc support: - ---------------- - This enables compiling with dmalloc ( http://dmalloc.com/ ) - which is an excellent public domain mem leak and malloc problem - detector. To enable dmalloc, before running busybox you will - want to properly set your environment, for example: - export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile - The 'debug=' value is generated using the following command - dmalloc -p log-stats -p log-non-free -p log-bad-space \ - -p log-elapsed-time -p check-fence -p check-heap \ - -p check-lists -p check-blank -p check-funcs -p realloc-copy \ - -p allow-free-null - - Electric-fence support: - ----------------------- - This enables compiling with Electric-fence support. Electric - fence is another very useful malloc debugging library which uses - your computer's virtual memory hardware to detect illegal memory - accesses. This support will make BusyBox be considerable larger - and run slower, so you should leave this option disabled unless - you are hunting a hard to find memory problem. - - -config BUSYBOX_CONFIG_NO_DEBUG_LIB - bool "None" - -config BUSYBOX_CONFIG_DMALLOC - bool "Dmalloc" - -config BUSYBOX_CONFIG_EFENCE - bool "Electric-fence" - -endchoice - endmenu source libbb/Config.in +endmenu + comment "Applets" source archival/Config.in diff --git a/package/utils/busybox/config/archival/Config.in b/package/utils/busybox/config/archival/Config.in index ccfb828a8..ff4c2cf6b 100644 --- a/package/utils/busybox/config/archival/Config.in +++ b/package/utils/busybox/config/archival/Config.in @@ -9,22 +9,32 @@ menu "Archival Utilities" config BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ bool "Make tar, rpm, modprobe etc understand .xz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ + help + Make tar, rpm, modprobe etc understand .xz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_LZMA bool "Make tar, rpm, modprobe etc understand .lzma data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_LZMA + help + Make tar, rpm, modprobe etc understand .lzma data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_BZ2 bool "Make tar, rpm, modprobe etc understand .bz2 data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_BZ2 + help + Make tar, rpm, modprobe etc understand .bz2 data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ bool "Make tar, rpm, modprobe etc understand .gz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_GZ + help + Make tar, rpm, modprobe etc understand .gz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z - bool "Make tar, rpm, modprobe etc understand .Z data" + bool "tar, rpm, modprobe etc understand .Z data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z # it is ancient + help + Make tar, rpm, modprobe etc understand .Z data. config BUSYBOX_CONFIG_AR bool "ar" @@ -40,7 +50,7 @@ config BUSYBOX_CONFIG_AR probably say N here: most compilers come with their own ar utility. config BUSYBOX_CONFIG_FEATURE_AR_LONG_FILENAMES - bool "Support long filenames (not needed for debs)" + bool "Support for long filenames (not needed for debs)" default BUSYBOX_DEFAULT_FEATURE_AR_LONG_FILENAMES depends on BUSYBOX_CONFIG_AR help @@ -64,27 +74,20 @@ config BUSYBOX_CONFIG_UNCOMPRESS config BUSYBOX_CONFIG_GUNZIP bool "gunzip" default BUSYBOX_DEFAULT_GUNZIP - select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS help gunzip is used to decompress archives created by gzip. You can use the `-t' option to test the integrity of an archive, without decompressing it. -config BUSYBOX_CONFIG_ZCAT - bool "zcat" - default BUSYBOX_DEFAULT_ZCAT - select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS - help - Alias to "gunzip -c". - config BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS - depends on (BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT) && BUSYBOX_CONFIG_LONG_OPTS + depends on BUSYBOX_CONFIG_GUNZIP && BUSYBOX_CONFIG_LONG_OPTS + help + Enable use of long options. config BUSYBOX_CONFIG_BUNZIP2 bool "bunzip2" default BUSYBOX_DEFAULT_BUNZIP2 - select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS help bunzip2 is a compression utility using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression @@ -94,13 +97,6 @@ config BUSYBOX_CONFIG_BUNZIP2 Unless you have a specific application which requires bunzip2, you should probably say N here. - -config BUSYBOX_CONFIG_BZCAT - bool "bzcat" - default BUSYBOX_DEFAULT_BZCAT - select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS - help - Alias to "bunzip2 -c". config BUSYBOX_CONFIG_UNLZMA bool "unlzma" default BUSYBOX_DEFAULT_UNLZMA @@ -113,47 +109,31 @@ config BUSYBOX_CONFIG_UNLZMA The BusyBox unlzma applet is limited to decompression only. On an x86 system, this applet adds about 4K. -config BUSYBOX_CONFIG_LZCAT - bool "lzcat" - default BUSYBOX_DEFAULT_LZCAT - help - unlzma is a compression utility using the Lempel-Ziv-Markov chain - compression algorithm, and range coding. Compression - is generally considerably better than that achieved by the bzip2 - compressors. - - The BusyBox unlzma applet is limited to decompression only. - On an x86 system, this applet adds about 4K. - -config BUSYBOX_CONFIG_LZMA - bool "lzma -d" - default BUSYBOX_DEFAULT_LZMA - help - Enable this option if you want commands like "lzma -d" to work. - IOW: you'll get lzma applet, but it will always require -d option. - config BUSYBOX_CONFIG_FEATURE_LZMA_FAST - bool "Optimize for speed" + bool "Optimize unlzma for speed" default BUSYBOX_DEFAULT_FEATURE_LZMA_FAST - depends on BUSYBOX_CONFIG_UNLZMA || BUSYBOX_CONFIG_LZCAT || BUSYBOX_CONFIG_LZMA + depends on BUSYBOX_CONFIG_UNLZMA help This option reduces decompression time by about 25% at the cost of a 1K bigger binary. + +config BUSYBOX_CONFIG_LZMA + bool "Provide lzma alias which supports only unpacking" + default BUSYBOX_DEFAULT_LZMA + depends on BUSYBOX_CONFIG_UNLZMA + help + Enable this option if you want commands like "lzma -d" to work. + IOW: you'll get lzma applet, but it will always require -d option. config BUSYBOX_CONFIG_UNXZ bool "unxz" default BUSYBOX_DEFAULT_UNXZ help unxz is a unlzma successor. -config BUSYBOX_CONFIG_XZCAT - bool "xzcat" - default BUSYBOX_DEFAULT_XZCAT - help - Alias to "unxz -c". - config BUSYBOX_CONFIG_XZ - bool "xz -d" + bool "Provide xz alias which supports only unpacking" default BUSYBOX_DEFAULT_XZ + depends on BUSYBOX_CONFIG_UNXZ help Enable this option if you want commands like "xz -d" to work. IOW: you'll get xz applet, but it will always require -d option. @@ -169,15 +149,6 @@ config BUSYBOX_CONFIG_BZIP2 Unless you have a specific application which requires bzip2, you should probably say N here. - -config BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS - bool "Enable decompression" - default BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS - depends on BUSYBOX_CONFIG_BZIP2 || BUSYBOX_CONFIG_BUNZIP2 || BUSYBOX_CONFIG_BZCAT - help - Enable -d (--decompress) and -t (--test) options for bzip2. - This will be automatically selected if bunzip2 or bzcat is - enabled. config BUSYBOX_CONFIG_CPIO bool "cpio" default BUSYBOX_DEFAULT_CPIO @@ -187,13 +158,13 @@ config BUSYBOX_CONFIG_CPIO cpio has 110 bytes of overheads for every stored file. This implementation of cpio can extract cpio archives created in the - "newc" or "crc" format. + "newc" or "crc" format, it cannot create or modify them. Unless you have a specific application which requires cpio, you should probably say N here. config BUSYBOX_CONFIG_FEATURE_CPIO_O - bool "Support archive creation" + bool "Support for archive creation" default BUSYBOX_DEFAULT_FEATURE_CPIO_O depends on BUSYBOX_CONFIG_CPIO help @@ -201,7 +172,7 @@ config BUSYBOX_CONFIG_FEATURE_CPIO_O format only. config BUSYBOX_CONFIG_FEATURE_CPIO_P - bool "Support passthrough mode" + bool "Support for passthrough mode" default BUSYBOX_DEFAULT_FEATURE_CPIO_P depends on BUSYBOX_CONFIG_FEATURE_CPIO_O help @@ -227,6 +198,16 @@ config BUSYBOX_CONFIG_DPKG_DEB Unless you have a specific application which requires dpkg-deb, say N here. + +config BUSYBOX_CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY + bool "Extract only (-x)" + default BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY + depends on BUSYBOX_CONFIG_DPKG_DEB + help + This reduces dpkg-deb to the equivalent of + "ar -p data.tar.gz | tar -zx". However it saves space as none + of the extra dpkg-deb, ar or tar options are needed, they are linked + to internally. config BUSYBOX_CONFIG_GZIP bool "gzip" default BUSYBOX_DEFAULT_GZIP @@ -238,9 +219,11 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS depends on BUSYBOX_CONFIG_GZIP && BUSYBOX_CONFIG_LONG_OPTS + help + Enable use of long options, increases size by about 106 Bytes config BUSYBOX_CONFIG_GZIP_FAST - int "Trade memory for speed (0:small,slow - 2:fast,big)" + int "Trade memory for gzip speed (0:small,slow - 2:fast,big)" default BUSYBOX_DEFAULT_GZIP_FAST range 0 2 depends on BUSYBOX_CONFIG_GZIP @@ -260,37 +243,16 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS is 6. If levels 1-3 are specified, 4 is used. If this option is not selected, -N options are ignored and -9 is used. - -config BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS - bool "Enable decompression" - default BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS - depends on BUSYBOX_CONFIG_GZIP || BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT - help - Enable -d (--decompress) and -t (--test) options for gzip. - This will be automatically selected if gunzip or zcat is - enabled. config BUSYBOX_CONFIG_LZOP bool "lzop" default BUSYBOX_DEFAULT_LZOP help Lzop compression/decompresion. -config BUSYBOX_CONFIG_UNLZOP - bool "unlzop" - default BUSYBOX_DEFAULT_UNLZOP # INCOMPAT: upstream lzop does not provide such tool - help - Lzop decompresion. - -config BUSYBOX_CONFIG_LZOPCAT - bool "lzopcat" - default BUSYBOX_DEFAULT_LZOPCAT # INCOMPAT: upstream lzop does not provide such tool - help - Alias to "unlzop -c". - config BUSYBOX_CONFIG_LZOP_COMPR_HIGH bool "lzop compression levels 7,8,9 (not very useful)" default BUSYBOX_DEFAULT_LZOP_COMPR_HIGH - depends on BUSYBOX_CONFIG_LZOP || BUSYBOX_CONFIG_UNLZOP || BUSYBOX_CONFIG_LZOPCAT + depends on BUSYBOX_CONFIG_LZOP help High levels (7,8,9) of lzop compression. These levels are actually slower than gzip at equivalent compression ratios @@ -313,15 +275,13 @@ config BUSYBOX_CONFIG_TAR create compressed archives. It's probably the most widely used UNIX archive program. -config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS - config BUSYBOX_CONFIG_FEATURE_TAR_CREATE - bool "Enable -c (archive creation)" + bool "Enable archive creation" default BUSYBOX_DEFAULT_FEATURE_TAR_CREATE depends on BUSYBOX_CONFIG_TAR + help + If you enable this option you'll be able to create + tar archives using the `-c' option. config BUSYBOX_CONFIG_FEATURE_TAR_AUTODETECT bool "Autodetect compressed tarballs" @@ -340,7 +300,7 @@ config BUSYBOX_CONFIG_FEATURE_TAR_FROM a list of files to include or exclude from an archive. config BUSYBOX_CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY - bool "Support old tar header format" + bool "Support for old tar header format" default BUSYBOX_DEFAULT_FEATURE_TAR_OLDGNU_COMPATIBILITY depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG help @@ -359,12 +319,22 @@ config BUSYBOX_CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY tarballs still exist. config BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS - bool "Support GNU tar extensions (long filenames)" + bool "Support for GNU tar extensions (long filenames)" default BUSYBOX_DEFAULT_FEATURE_TAR_GNU_EXTENSIONS depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG + help + With this option busybox supports GNU long filenames and + linknames. + +config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS + help + Enable use of long options, increases size by about 400 Bytes config BUSYBOX_CONFIG_FEATURE_TAR_TO_COMMAND - bool "Support writing to an external program (--to-command)" + bool "Support for writing to an external program" default BUSYBOX_DEFAULT_FEATURE_TAR_TO_COMMAND depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS help @@ -377,17 +347,20 @@ config BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME default BUSYBOX_DEFAULT_FEATURE_TAR_UNAME_GNAME depends on BUSYBOX_CONFIG_TAR help - Enable use of user and group names in tar. This affects contents + Enables use of user and group names in tar. This affects contents listings (-t) and preserving permissions when unpacking (-p). +200 bytes. config BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME - bool "Enable -m (do not preserve time) GNU option" + bool "Enable -m (do not preserve time) option" default BUSYBOX_DEFAULT_FEATURE_TAR_NOPRESERVE_TIME depends on BUSYBOX_CONFIG_TAR + help + With this option busybox supports GNU tar -m + (do not preserve time) option. config BUSYBOX_CONFIG_FEATURE_TAR_SELINUX - bool "Support extracting SELinux labels" + bool "Support for extracting SELinux labels" default BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_SELINUX help @@ -400,31 +373,7 @@ config BUSYBOX_CONFIG_UNZIP unzip will list or extract files from a ZIP archive, commonly found on DOS/WIN systems. The default behavior (with no options) is to extract the archive into the - current directory. - -config BUSYBOX_CONFIG_FEATURE_UNZIP_CDF - bool "Read and use Central Directory data" - default BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF - depends on BUSYBOX_CONFIG_UNZIP - help - If you know that you only need to deal with simple - ZIP files without deleted/updated files, SFX archives etc, - you can reduce code size by unselecting this option. - To support less trivial ZIPs, say Y. - -config BUSYBOX_CONFIG_FEATURE_UNZIP_BZIP2 - bool "Support compression method 12 (bzip2)" - default BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 - depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP - -config BUSYBOX_CONFIG_FEATURE_UNZIP_LZMA - bool "Support compression method 14 (lzma)" - default BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA - depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP - -config BUSYBOX_CONFIG_FEATURE_UNZIP_XZ - bool "Support compression method 95 (xz)" - default BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ - depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP + current directory. Use the `-d' option to extract to a + directory of your choice. endmenu diff --git a/package/utils/busybox/config/console-tools/Config.in b/package/utils/busybox/config/console-tools/Config.in index dcc19a567..53937d2b5 100644 --- a/package/utils/busybox/config/console-tools/Config.in +++ b/package/utils/busybox/config/console-tools/Config.in @@ -6,6 +6,7 @@ menu "Console Utilities" + config BUSYBOX_CONFIG_CHVT bool "chvt" default BUSYBOX_DEFAULT_CHVT @@ -13,17 +14,27 @@ config BUSYBOX_CONFIG_CHVT help This program is used to change to another terminal. Example: chvt 4 (change to terminal /dev/tty4) + +config BUSYBOX_CONFIG_FGCONSOLE + bool "fgconsole" + default BUSYBOX_DEFAULT_FGCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program prints active (foreground) console number. + config BUSYBOX_CONFIG_CLEAR bool "clear" default BUSYBOX_DEFAULT_CLEAR help This program clears the terminal screen. + config BUSYBOX_CONFIG_DEALLOCVT bool "deallocvt" default BUSYBOX_DEFAULT_DEALLOCVT select BUSYBOX_CONFIG_PLATFORM_LINUX help This program deallocates unused virtual consoles. + config BUSYBOX_CONFIG_DUMPKMAP bool "dumpkmap" default BUSYBOX_DEFAULT_DUMPKMAP @@ -31,18 +42,14 @@ config BUSYBOX_CONFIG_DUMPKMAP help This program dumps the kernel's keyboard translation table to stdout, in binary format. You can then use loadkmap to load it. -config BUSYBOX_CONFIG_FGCONSOLE - bool "fgconsole" - default BUSYBOX_DEFAULT_FGCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program prints active (foreground) console number. + config BUSYBOX_CONFIG_KBD_MODE bool "kbd_mode" default BUSYBOX_DEFAULT_KBD_MODE select BUSYBOX_CONFIG_PLATFORM_LINUX help This program reports and sets keyboard mode. + config BUSYBOX_CONFIG_LOADFONT bool "loadfont" default BUSYBOX_DEFAULT_LOADFONT @@ -50,6 +57,61 @@ config BUSYBOX_CONFIG_LOADFONT help This program loads a console font from standard input. +config BUSYBOX_CONFIG_LOADKMAP + bool "loadkmap" + default BUSYBOX_DEFAULT_LOADKMAP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program loads a keyboard translation table from + standard input. + +config BUSYBOX_CONFIG_OPENVT + bool "openvt" + default BUSYBOX_DEFAULT_OPENVT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program is used to start a command on an unused + virtual terminal. + +config BUSYBOX_CONFIG_RESET + bool "reset" + default BUSYBOX_DEFAULT_RESET + help + This program is used to reset the terminal screen, if it + gets messed up. + +config BUSYBOX_CONFIG_RESIZE + bool "resize" + default BUSYBOX_DEFAULT_RESIZE + help + This program is used to (re)set the width and height of your current + terminal. + +config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT + bool "Print environment variables" + default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT + depends on BUSYBOX_CONFIG_RESIZE + help + Prints the newly set size (number of columns and rows) of + the terminal. + E.g.: + COLUMNS=80;LINES=44;export COLUMNS LINES; + +config BUSYBOX_CONFIG_SETCONSOLE + bool "setconsole" + default BUSYBOX_DEFAULT_SETCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program redirects the system console to another device, + like the current tty while logged in via telnet. + +config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS + depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the setconsole applet. + config BUSYBOX_CONFIG_SETFONT bool "setfont" default BUSYBOX_DEFAULT_SETFONT @@ -72,66 +134,6 @@ config BUSYBOX_CONFIG_DEFAULT_SETFONT_DIR Directory to use if setfont's params are simple filenames (not /path/to/file or ./file). Default is "" (no default directory). -comment "Common options for loadfont and setfont" - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 - bool "Support PSF2 console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW - bool "Support old (raw) console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT -config BUSYBOX_CONFIG_LOADKMAP - bool "loadkmap" - default BUSYBOX_DEFAULT_LOADKMAP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program loads a keyboard translation table from - standard input. -config BUSYBOX_CONFIG_OPENVT - bool "openvt" - default BUSYBOX_DEFAULT_OPENVT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program is used to start a command on an unused - virtual terminal. -config BUSYBOX_CONFIG_RESET - bool "reset" - default BUSYBOX_DEFAULT_RESET - help - This program is used to reset the terminal screen, if it - gets messed up. -config BUSYBOX_CONFIG_RESIZE - bool "resize" - default BUSYBOX_DEFAULT_RESIZE - help - This program is used to (re)set the width and height of your current - terminal. - -config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT - bool "Print environment variables" - default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT - depends on BUSYBOX_CONFIG_RESIZE - help - Prints the newly set size (number of columns and rows) of - the terminal. - E.g.: - COLUMNS=80;LINES=44;export COLUMNS LINES; -config BUSYBOX_CONFIG_SETCONSOLE - bool "setconsole" - default BUSYBOX_DEFAULT_SETCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program redirects the system console to another device, - like the current tty while logged in via telnet. - -config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_SETKEYCODES bool "setkeycodes" default BUSYBOX_DEFAULT_SETKEYCODES @@ -139,12 +141,14 @@ config BUSYBOX_CONFIG_SETKEYCODES help This program loads entries into the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. + config BUSYBOX_CONFIG_SETLOGCONS bool "setlogcons" default BUSYBOX_DEFAULT_SETLOGCONS select BUSYBOX_CONFIG_PLATFORM_LINUX help This program redirects the output console of kernel messages. + config BUSYBOX_CONFIG_SHOWKEY bool "showkey" default BUSYBOX_DEFAULT_SHOWKEY @@ -152,4 +156,21 @@ config BUSYBOX_CONFIG_SHOWKEY help Shows keys pressed. +comment "Common options for loadfont and setfont" + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 + bool "Support for PSF2 console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + help + Support PSF2 console fonts. + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW + bool "Support for old (raw) console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + help + Support old (raw) console fonts. + endmenu diff --git a/package/utils/busybox/config/coreutils/Config.in b/package/utils/busybox/config/coreutils/Config.in index c4ef1f4fb..ec5611bdf 100644 --- a/package/utils/busybox/config/coreutils/Config.in +++ b/package/utils/busybox/config/coreutils/Config.in @@ -19,70 +19,6 @@ config BUSYBOX_CONFIG_CAT help cat is used to concatenate files and print them to the standard output. Enable this option if you wish to enable the 'cat' utility. - -config BUSYBOX_CONFIG_FEATURE_CATV - bool "cat -v[etA]" - default BUSYBOX_DEFAULT_FEATURE_CATV - depends on BUSYBOX_CONFIG_CAT - help - Display nonprinting characters as escape sequences -config BUSYBOX_CONFIG_CHGRP - bool "chgrp" - default BUSYBOX_DEFAULT_CHGRP - help - chgrp is used to change the group ownership of files. -config BUSYBOX_CONFIG_CHMOD - bool "chmod" - default BUSYBOX_DEFAULT_CHMOD - help - chmod is used to change the access permission of files. -config BUSYBOX_CONFIG_CHOWN - bool "chown" - default BUSYBOX_DEFAULT_CHOWN - help - chown is used to change the user and/or group ownership - of files. - -config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_CHROOT - bool "chroot" - default BUSYBOX_DEFAULT_CHROOT - help - chroot is used to change the root directory and run a command. - The default command is `/bin/sh'. -config BUSYBOX_CONFIG_CKSUM - bool "cksum" - default BUSYBOX_DEFAULT_CKSUM - help - cksum is used to calculate the CRC32 checksum of a file. -config BUSYBOX_CONFIG_COMM - bool "comm" - default BUSYBOX_DEFAULT_COMM - help - comm is used to compare two files line by line and return - a three-column output. -config BUSYBOX_CONFIG_CP - bool "cp" - default BUSYBOX_DEFAULT_CP - help - cp is used to copy files and directories. - -config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable long options. - Also add support for --parents option. -config BUSYBOX_CONFIG_CUT - bool "cut" - default BUSYBOX_DEFAULT_CUT - help - cut is used to print selected parts of lines from - each file to stdout. config BUSYBOX_CONFIG_DATE bool "date" default BUSYBOX_DEFAULT_DATE @@ -157,7 +93,7 @@ config BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS default BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS depends on BUSYBOX_CONFIG_DD help - Enable support for writing a certain number of bytes in and out, + Enables support for writing a certain number of bytes in and out, at a time, and performing conversions on the data stream. config BUSYBOX_CONFIG_FEATURE_DD_STATUS @@ -165,144 +101,7 @@ config BUSYBOX_CONFIG_FEATURE_DD_STATUS default BUSYBOX_DEFAULT_FEATURE_DD_STATUS depends on BUSYBOX_CONFIG_DD help - Enable support for status=noxfer/none option. -config BUSYBOX_CONFIG_DF - bool "df" - default BUSYBOX_DEFAULT_DF - help - df reports the amount of disk space used and available - on filesystems. - -config BUSYBOX_CONFIG_FEATURE_DF_FANCY - bool "Enable -a, -i, -B" - default BUSYBOX_DEFAULT_FEATURE_DF_FANCY - depends on BUSYBOX_CONFIG_DF - help - -a Show all filesystems - -i Inodes - -B Blocksize -config BUSYBOX_CONFIG_DIRNAME - bool "dirname" - default BUSYBOX_DEFAULT_DIRNAME - help - dirname is used to strip a non-directory suffix from - a file name. -config BUSYBOX_CONFIG_DOS2UNIX - bool "dos2unix" - default BUSYBOX_DEFAULT_DOS2UNIX - help - dos2unix is used to convert a text file from DOS format to - UNIX format, and vice versa. - -config BUSYBOX_CONFIG_UNIX2DOS - bool "unix2dos" - default BUSYBOX_DEFAULT_UNIX2DOS - help - unix2dos is used to convert a text file from UNIX format to - DOS format, and vice versa. -config BUSYBOX_CONFIG_DU - bool "du (default blocksize of 512 bytes)" - default BUSYBOX_DEFAULT_DU - help - du is used to report the amount of disk space used - for specified files. - -config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - bool "Use a default blocksize of 1024 bytes (1K)" - default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - depends on BUSYBOX_CONFIG_DU - help - Use a blocksize of (1K) instead of the default 512b. -config BUSYBOX_CONFIG_ECHO - bool "echo (basic SuSv3 version taking no options)" - default BUSYBOX_DEFAULT_ECHO - help - echo is used to print a specified string to stdout. - -# this entry also appears in shell/Config.in, next to the echo builtin -config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO - bool "Enable -n and -e options" - default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO - depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_ECHO || BUSYBOX_CONFIG_HUSH_ECHO -config BUSYBOX_CONFIG_ENV - bool "env" - default BUSYBOX_DEFAULT_ENV - help - env is used to set an environment variable and run - a command; without options it displays the current - environment. - -config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_EXPAND - bool "expand" - default BUSYBOX_DEFAULT_EXPAND - help - By default, convert all tabs to spaces. - -config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS - -config BUSYBOX_CONFIG_UNEXPAND - bool "unexpand" - default BUSYBOX_DEFAULT_UNEXPAND - help - By default, convert only leading sequences of blanks to tabs. - -config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_EXPR - bool "expr" - default BUSYBOX_DEFAULT_EXPR - help - expr is used to calculate numbers and print the result - to standard output. - -config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 - bool "Extend Posix numbers support to 64 bit" - default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 - depends on BUSYBOX_CONFIG_EXPR - help - Enable 64-bit math support in the expr applet. This will make - the applet slightly larger, but will allow computation with very - large numbers. -config BUSYBOX_CONFIG_FACTOR - bool "factor" - default BUSYBOX_DEFAULT_FACTOR - help - factor factorizes integers -config BUSYBOX_CONFIG_FALSE - bool "false" - default BUSYBOX_DEFAULT_FALSE - help - false returns an exit code of FALSE (1). -config BUSYBOX_CONFIG_FOLD - bool "fold" - default BUSYBOX_DEFAULT_FOLD - help - Wrap text to fit a specific width. -config BUSYBOX_CONFIG_FSYNC - bool "fsync" - default BUSYBOX_DEFAULT_FSYNC - help - fsync is used to flush file-related cached blocks to disk. -config BUSYBOX_CONFIG_HEAD - bool "head" - default BUSYBOX_DEFAULT_HEAD - help - head is used to print the first specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD - bool "Enable -c, -q, and -v" - default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD - depends on BUSYBOX_CONFIG_HEAD + Enables support for status=noxfer/none option. config BUSYBOX_CONFIG_HOSTID bool "hostid" default BUSYBOX_DEFAULT_HOSTID @@ -314,336 +113,16 @@ config BUSYBOX_CONFIG_ID default BUSYBOX_DEFAULT_ID help id displays the current user and group ID names. - config BUSYBOX_CONFIG_GROUPS bool "groups" default BUSYBOX_DEFAULT_GROUPS help Print the group names associated with current user id. -config BUSYBOX_CONFIG_INSTALL - bool "install" - default BUSYBOX_DEFAULT_INSTALL - help - Copy files and set attributes. - -config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS - depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_LINK - bool "link" - default BUSYBOX_DEFAULT_LINK - help - link creates hard links between files. -config BUSYBOX_CONFIG_LN - bool "ln" - default BUSYBOX_DEFAULT_LN - help - ln is used to create hard or soft links between files. -config BUSYBOX_CONFIG_LOGNAME - bool "logname" - default BUSYBOX_DEFAULT_LOGNAME - help - logname is used to print the current user's login name. -config BUSYBOX_CONFIG_LS - bool "ls" - default BUSYBOX_DEFAULT_LS - help - ls is used to list the contents of directories. - -config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES - bool "Enable filetyping options (-p and -F)" - default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES - depends on BUSYBOX_CONFIG_LS - -config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS - bool "Enable symlinks dereferencing (-L)" - default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS - depends on BUSYBOX_CONFIG_LS - -config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE - bool "Enable recursion (-R)" - default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE - depends on BUSYBOX_CONFIG_LS - -config BUSYBOX_CONFIG_FEATURE_LS_WIDTH - bool "Enable -w WIDTH and window size autodetection" - default BUSYBOX_DEFAULT_FEATURE_LS_WIDTH - depends on BUSYBOX_CONFIG_LS - -config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES - bool "Sort the file names" - default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES - depends on BUSYBOX_CONFIG_LS - help - Allow ls to sort file names alphabetically. - -config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS - bool "Show file timestamps" - default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display timestamps for files. - -config BUSYBOX_CONFIG_FEATURE_LS_USERNAME - bool "Show username/groupnames" - default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display username/groupname for files. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR - bool "Allow use of color to identify file types" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR - depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS - help - This enables the --color option to ls. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT - bool "Produce colored ls output by default" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT - depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR - help - Saying yes here will turn coloring on by default, - even if no "--color" option is given to the ls command. - This is not recommended, since the colors are not - configurable, and the output may not be legible on - many output screens. -config BUSYBOX_CONFIG_MD5SUM - bool "md5sum" - default BUSYBOX_DEFAULT_MD5SUM - help - md5sum is used to print or check MD5 checksums. - -config BUSYBOX_CONFIG_SHA1SUM - bool "sha1sum" - default BUSYBOX_DEFAULT_SHA1SUM - help - Compute and check SHA1 message digest - -config BUSYBOX_CONFIG_SHA256SUM - bool "sha256sum" - default BUSYBOX_DEFAULT_SHA256SUM - help - Compute and check SHA256 message digest - -config BUSYBOX_CONFIG_SHA512SUM - bool "sha512sum" - default BUSYBOX_DEFAULT_SHA512SUM - help - Compute and check SHA512 message digest - -config BUSYBOX_CONFIG_SHA3SUM - bool "sha3sum" - default BUSYBOX_DEFAULT_SHA3SUM - help - Compute and check SHA3 message digest - -comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - -config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK - bool "Enable -c, -s and -w options" - default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - help - Enabling the -c options allows files to be checked - against pre-calculated hash values. - -s and -w are useful options when verifying checksums. -config BUSYBOX_CONFIG_MKDIR - bool "mkdir" - default BUSYBOX_DEFAULT_MKDIR - help - mkdir is used to create directories with the specified names. - -config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_MKFIFO - bool "mkfifo" - default BUSYBOX_DEFAULT_MKFIFO - help - mkfifo is used to create FIFOs (named pipes). - The 'mknod' program can also create FIFOs. -config BUSYBOX_CONFIG_MKNOD - bool "mknod" - default BUSYBOX_DEFAULT_MKNOD - help - mknod is used to create FIFOs or block/character special - files with the specified names. -config BUSYBOX_CONFIG_MKTEMP - bool "mktemp" - default BUSYBOX_DEFAULT_MKTEMP - help - mktemp is used to create unique temporary files -config BUSYBOX_CONFIG_MV - bool "mv" - default BUSYBOX_DEFAULT_MV - help - mv is used to move or rename files or directories. - -config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS -config BUSYBOX_CONFIG_NICE - bool "nice" - default BUSYBOX_DEFAULT_NICE - help - nice runs a program with modified scheduling priority. -config BUSYBOX_CONFIG_NL - bool "nl" - default BUSYBOX_DEFAULT_NL - help - nl is used to number lines of files. -config BUSYBOX_CONFIG_NOHUP - bool "nohup" - default BUSYBOX_DEFAULT_NOHUP - help - run a command immune to hangups, with output to a non-tty. -config BUSYBOX_CONFIG_NPROC - bool "nproc" - default BUSYBOX_DEFAULT_NPROC - help - Print number of CPUs -config BUSYBOX_CONFIG_OD - bool "od" - default BUSYBOX_DEFAULT_OD - help - od is used to dump binary files in octal and other formats. -config BUSYBOX_CONFIG_PASTE - bool "paste" - default BUSYBOX_DEFAULT_PASTE - help - paste is used to paste lines of different files together - and write the result to stdout -config BUSYBOX_CONFIG_PRINTENV - bool "printenv" - default BUSYBOX_DEFAULT_PRINTENV - help - printenv is used to print all or part of environment. -config BUSYBOX_CONFIG_PRINTF - bool "printf" - default BUSYBOX_DEFAULT_PRINTF - help - printf is used to format and print specified strings. - It's similar to `echo' except it has more options. -config BUSYBOX_CONFIG_PWD - bool "pwd" - default BUSYBOX_DEFAULT_PWD - help - pwd is used to print the current directory. -config BUSYBOX_CONFIG_READLINK - bool "readlink" - default BUSYBOX_DEFAULT_READLINK - help - This program reads a symbolic link and returns the name - of the file it points to - -config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW - bool "Enable canonicalization by following all symlinks (-f)" - default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW - depends on BUSYBOX_CONFIG_READLINK - help - Enable the readlink option (-f). -config BUSYBOX_CONFIG_REALPATH - bool "realpath" - default BUSYBOX_DEFAULT_REALPATH - help - Return the canonicalized absolute pathname. - This isn't provided by GNU shellutils, but where else does it belong. -config BUSYBOX_CONFIG_RM - bool "rm" - default BUSYBOX_DEFAULT_RM - help - rm is used to remove files or directories. -config BUSYBOX_CONFIG_RMDIR - bool "rmdir" - default BUSYBOX_DEFAULT_RMDIR - help - rmdir is used to remove empty directories. - -config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the rmdir applet, including - --ignore-fail-on-non-empty for compatibility with GNU rmdir. -config BUSYBOX_CONFIG_SEQ - bool "seq" - default BUSYBOX_DEFAULT_SEQ - help - print a sequence of numbers -config BUSYBOX_CONFIG_SHRED - bool "shred" - default BUSYBOX_DEFAULT_SHRED - help - Overwrite a file to hide its contents, and optionally delete it config BUSYBOX_CONFIG_SHUF bool "shuf" default BUSYBOX_DEFAULT_SHUF help Generate random permutations -config BUSYBOX_CONFIG_SLEEP - bool "sleep" - default BUSYBOX_DEFAULT_SLEEP - help - sleep is used to pause for a specified number of seconds. - It comes in 3 versions: - - small: takes one integer parameter - - fancy: takes multiple integer arguments with suffixes: - sleep 1d 2h 3m 15s - - fancy with fractional numbers: - sleep 2.3s 4.5h sleeps for 16202.3 seconds - Last one is "the most compatible" with coreutils sleep, - but it adds around 1k of code. - -config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - bool "Enable multiple arguments and s/m/h/d suffixes" - default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP - depends on BUSYBOX_CONFIG_SLEEP - help - Allow sleep to pause for specified minutes, hours, and days. - -config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP - bool "Enable fractional arguments" - default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP - depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - help - Allow for fractional numeric parameters. -config BUSYBOX_CONFIG_SORT - bool "sort" - default BUSYBOX_DEFAULT_SORT - help - sort is used to sort lines of text in specified files. - -config BUSYBOX_CONFIG_FEATURE_SORT_BIG - bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" - default BUSYBOX_DEFAULT_FEATURE_SORT_BIG - depends on BUSYBOX_CONFIG_SORT - help - Without this, sort only supports -r, -u, and an integer version - of -n. Selecting this adds sort keys, floating point support, and - more. This adds a little over 3k to a nonstatic build on x86. - - The SuSv3 sort standard is available at: - http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html -config BUSYBOX_CONFIG_SPLIT - bool "split" - default BUSYBOX_DEFAULT_SPLIT - help - Split a file into pieces. - -config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY - bool "Fancy extensions" - default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY - depends on BUSYBOX_CONFIG_SPLIT - help - Add support for features not required by SUSv3. - Supports additional suffixes 'b' for 512 bytes, - 'g' for 1GiB for the -b option. config BUSYBOX_CONFIG_STAT bool "stat" default BUSYBOX_DEFAULT_STAT @@ -667,64 +146,18 @@ config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM help Without this, stat will not support the '-f' option to display information about filesystem status. -config BUSYBOX_CONFIG_STTY - bool "stty" - default BUSYBOX_DEFAULT_STTY - help - stty is used to change and print terminal line settings. -config BUSYBOX_CONFIG_SUM - bool "sum" - default BUSYBOX_DEFAULT_SUM - help - checksum and count the blocks in a file config BUSYBOX_CONFIG_SYNC bool "sync" default BUSYBOX_DEFAULT_SYNC help sync is used to flush filesystem buffers. config BUSYBOX_CONFIG_FEATURE_SYNC_FANCY - bool "Enable -d and -f flags (requires syncfs(2) in libc)" + bool "Enable -d and -f flags (requres syncfs(2) in libc)" default BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY depends on BUSYBOX_CONFIG_SYNC help sync -d FILE... executes fdatasync() on each FILE. sync -f FILE... executes syncfs() on each FILE. -config BUSYBOX_CONFIG_TAC - bool "tac" - default BUSYBOX_DEFAULT_TAC - help - tac is used to concatenate and print files in reverse. -config BUSYBOX_CONFIG_TAIL - bool "tail" - default BUSYBOX_DEFAULT_TAIL - help - tail is used to print the last specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL - bool "Enable -q, -s, -v, and -F options" - default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL - depends on BUSYBOX_CONFIG_TAIL - help - These options are provided by GNU tail, but - are not specific in the SUSv3 standard: - -q Never output headers giving file names - -s SEC Wait SEC seconds between reads with -f - -v Always output headers giving file names - -F Same as -f, but keep retrying -config BUSYBOX_CONFIG_TEE - bool "tee" - default BUSYBOX_DEFAULT_TEE - help - tee is used to read from standard input and write - to standard output and files. - -config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO - bool "Enable block I/O (larger/faster) instead of byte I/O" - default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO - depends on BUSYBOX_CONFIG_TEE - help - Enable this option for a faster tee, at expense of size. config BUSYBOX_CONFIG_TEST bool "test" default BUSYBOX_DEFAULT_TEST @@ -733,30 +166,12 @@ config BUSYBOX_CONFIG_TEST returning an appropriate exit code. The bash shell has test built in, ash can build it in optionally. -config BUSYBOX_CONFIG_TEST1 - bool "test as [" - default BUSYBOX_DEFAULT_TEST1 - help - Provide test command in the "[ EXPR ]" form - -config BUSYBOX_CONFIG_TEST2 - bool "test as [[" - default BUSYBOX_DEFAULT_TEST2 - help - Provide test command in the "[[ EXPR ]]" form - config BUSYBOX_CONFIG_FEATURE_TEST_64 bool "Extend test to 64 bit" default BUSYBOX_DEFAULT_FEATURE_TEST_64 - depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_TEST1 || BUSYBOX_CONFIG_TEST2 || BUSYBOX_CONFIG_ASH_TEST || BUSYBOX_CONFIG_HUSH_TEST + depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_ASH_BUILTIN_TEST || BUSYBOX_CONFIG_HUSH help Enable 64-bit support in test. -config BUSYBOX_CONFIG_TIMEOUT - bool "timeout" - default BUSYBOX_DEFAULT_TIMEOUT - help - Runs a program and watches it. If it does not terminate in - specified number of seconds, it is sent a signal. config BUSYBOX_CONFIG_TOUCH bool "touch" default BUSYBOX_DEFAULT_TOUCH @@ -803,23 +218,636 @@ config BUSYBOX_CONFIG_FEATURE_TR_EQUIV replace all instances of 'a' with 'xyz'. This option is mainly useful for cases when no other way of expressing a character is possible. -config BUSYBOX_CONFIG_TRUE - bool "true" - default BUSYBOX_DEFAULT_TRUE - help - true returns an exit code of TRUE (0). config BUSYBOX_CONFIG_TRUNCATE bool "truncate" default BUSYBOX_DEFAULT_TRUNCATE help truncate truncates files to a given size. If a file does not exist, it is created unless told otherwise. +config BUSYBOX_CONFIG_UNLINK + bool "unlink" + default BUSYBOX_DEFAULT_UNLINK + help + unlink deletes a file by calling unlink() +config BUSYBOX_CONFIG_BASE64 + bool "base64" + default BUSYBOX_DEFAULT_BASE64 + help + Base64 encode and decode +config BUSYBOX_CONFIG_WHO + bool "who" + default BUSYBOX_DEFAULT_WHO + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + who is used to show who is logged on. +config BUSYBOX_CONFIG_USERS + bool "users" + default BUSYBOX_DEFAULT_USERS + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Print users currently logged on. + +config BUSYBOX_CONFIG_CAL + bool "cal" + default BUSYBOX_DEFAULT_CAL + help + cal is used to display a monthly calendar. + +config BUSYBOX_CONFIG_CATV + bool "catv" + default BUSYBOX_DEFAULT_CATV + help + Display nonprinting characters as escape sequences (like some + implementations' cat -v option). + +config BUSYBOX_CONFIG_CHGRP + bool "chgrp" + default BUSYBOX_DEFAULT_CHGRP + help + chgrp is used to change the group ownership of files. + +config BUSYBOX_CONFIG_CHMOD + bool "chmod" + default BUSYBOX_DEFAULT_CHMOD + help + chmod is used to change the access permission of files. + +config BUSYBOX_CONFIG_CHOWN + bool "chown" + default BUSYBOX_DEFAULT_CHOWN + help + chown is used to change the user and/or group ownership + of files. + +config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS + help + Enable use of long options + +config BUSYBOX_CONFIG_CHROOT + bool "chroot" + default BUSYBOX_DEFAULT_CHROOT + help + chroot is used to change the root directory and run a command. + The default command is `/bin/sh'. + +config BUSYBOX_CONFIG_CKSUM + bool "cksum" + default BUSYBOX_DEFAULT_CKSUM + help + cksum is used to calculate the CRC32 checksum of a file. + +config BUSYBOX_CONFIG_COMM + bool "comm" + default BUSYBOX_DEFAULT_COMM + help + comm is used to compare two files line by line and return + a three-column output. + +config BUSYBOX_CONFIG_CP + bool "cp" + default BUSYBOX_DEFAULT_CP + help + cp is used to copy files and directories. + +config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS + bool "Enable long options for cp" + default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS + help + Enable long options for cp. + Also add support for --parents option. + +config BUSYBOX_CONFIG_CUT + bool "cut" + default BUSYBOX_DEFAULT_CUT + help + cut is used to print selected parts of lines from + each file to stdout. + +config BUSYBOX_CONFIG_DF + bool "df" + default BUSYBOX_DEFAULT_DF + help + df reports the amount of disk space used and available + on filesystems. + +config BUSYBOX_CONFIG_FEATURE_DF_FANCY + bool "Enable -a, -i, -B" + default BUSYBOX_DEFAULT_FEATURE_DF_FANCY + depends on BUSYBOX_CONFIG_DF + help + This option enables -a, -i and -B. + + -a Show all filesystems + -i Inodes + -B Blocksize + +config BUSYBOX_CONFIG_DIRNAME + bool "dirname" + default BUSYBOX_DEFAULT_DIRNAME + help + dirname is used to strip a non-directory suffix from + a file name. + +config BUSYBOX_CONFIG_DOS2UNIX + bool "dos2unix/unix2dos" + default BUSYBOX_DEFAULT_DOS2UNIX + help + dos2unix is used to convert a text file from DOS format to + UNIX format, and vice versa. + +config BUSYBOX_CONFIG_UNIX2DOS + bool + default BUSYBOX_DEFAULT_UNIX2DOS + depends on BUSYBOX_CONFIG_DOS2UNIX + help + unix2dos is used to convert a text file from UNIX format to + DOS format, and vice versa. + +config BUSYBOX_CONFIG_DU + bool "du (default blocksize of 512 bytes)" + default BUSYBOX_DEFAULT_DU + help + du is used to report the amount of disk space used + for specified files. + +config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + bool "Use a default blocksize of 1024 bytes (1K)" + default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + depends on BUSYBOX_CONFIG_DU + help + Use a blocksize of (1K) instead of the default 512b. + +config BUSYBOX_CONFIG_ECHO + bool "echo (basic SuSv3 version taking no options)" + default BUSYBOX_DEFAULT_ECHO + help + echo is used to print a specified string to stdout. + +# this entry also appears in shell/Config.in, next to the echo builtin +config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO + bool "Enable echo options (-n and -e)" + default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO + depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_BUILTIN_ECHO || BUSYBOX_CONFIG_HUSH + help + This adds options (-n and -e) to echo. + +config BUSYBOX_CONFIG_ENV + bool "env" + default BUSYBOX_DEFAULT_ENV + help + env is used to set an environment variable and run + a command; without options it displays the current + environment. + +config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the env applet. + +config BUSYBOX_CONFIG_EXPAND + bool "expand" + default BUSYBOX_DEFAULT_EXPAND + help + By default, convert all tabs to spaces. + +config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the expand applet. + +config BUSYBOX_CONFIG_EXPR + bool "expr" + default BUSYBOX_DEFAULT_EXPR + help + expr is used to calculate numbers and print the result + to standard output. + +config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 + bool "Extend Posix numbers support to 64 bit" + default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 + depends on BUSYBOX_CONFIG_EXPR + help + Enable 64-bit math support in the expr applet. This will make + the applet slightly larger, but will allow computation with very + large numbers. + +config BUSYBOX_CONFIG_FALSE + bool "false" + default BUSYBOX_DEFAULT_FALSE + help + false returns an exit code of FALSE (1). + +config BUSYBOX_CONFIG_FOLD + bool "fold" + default BUSYBOX_DEFAULT_FOLD + help + Wrap text to fit a specific width. + +config BUSYBOX_CONFIG_FSYNC + bool "fsync" + default BUSYBOX_DEFAULT_FSYNC + help + fsync is used to flush file-related cached blocks to disk. + +config BUSYBOX_CONFIG_HEAD + bool "head" + default BUSYBOX_DEFAULT_HEAD + help + head is used to print the first specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD + bool "Enable head options (-c, -q, and -v)" + default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD + depends on BUSYBOX_CONFIG_HEAD + help + This enables the head options (-c, -q, and -v). + +config BUSYBOX_CONFIG_INSTALL + bool "install" + default BUSYBOX_DEFAULT_INSTALL + help + Copy files and set attributes. + +config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS + depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the install applet. + +####config LENGTH +#### bool "length" +#### default y +#### help +#### length is used to print out the length of a specified string. + +config BUSYBOX_CONFIG_LN + bool "ln" + default BUSYBOX_DEFAULT_LN + help + ln is used to create hard or soft links between files. + +config BUSYBOX_CONFIG_LOGNAME + bool "logname" + default BUSYBOX_DEFAULT_LOGNAME + help + logname is used to print the current user's login name. + +config BUSYBOX_CONFIG_LS + bool "ls" + default BUSYBOX_DEFAULT_LS + help + ls is used to list the contents of directories. + +config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES + bool "Enable filetyping options (-p and -F)" + default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES + depends on BUSYBOX_CONFIG_LS + help + Enable the ls options (-p and -F). + +config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS + bool "Enable symlinks dereferencing (-L)" + default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS + depends on BUSYBOX_CONFIG_LS + help + Enable the ls option (-L). + +config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE + bool "Enable recursion (-R)" + default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE + depends on BUSYBOX_CONFIG_LS + help + Enable the ls option (-R). + +config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES + bool "Sort the file names" + default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES + depends on BUSYBOX_CONFIG_LS + help + Allow ls to sort file names alphabetically. + +config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS + bool "Show file timestamps" + default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display timestamps for files. + +config BUSYBOX_CONFIG_FEATURE_LS_USERNAME + bool "Show username/groupnames" + default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display username/groupname for files. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR + bool "Allow use of color to identify file types" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR + depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS + help + This enables the --color option to ls. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT + bool "Produce colored ls output by default" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT + depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR + help + Saying yes here will turn coloring on by default, + even if no "--color" option is given to the ls command. + This is not recommended, since the colors are not + configurable, and the output may not be legible on + many output screens. + +config BUSYBOX_CONFIG_MD5SUM + bool "md5sum" + default BUSYBOX_DEFAULT_MD5SUM + help + md5sum is used to print or check MD5 checksums. + +config BUSYBOX_CONFIG_MKDIR + bool "mkdir" + default BUSYBOX_DEFAULT_MKDIR + help + mkdir is used to create directories with the specified names. + +config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the mkdir applet. + +config BUSYBOX_CONFIG_MKFIFO + bool "mkfifo" + default BUSYBOX_DEFAULT_MKFIFO + help + mkfifo is used to create FIFOs (named pipes). + The `mknod' program can also create FIFOs. + +config BUSYBOX_CONFIG_MKNOD + bool "mknod" + default BUSYBOX_DEFAULT_MKNOD + help + mknod is used to create FIFOs or block/character special + files with the specified names. + +config BUSYBOX_CONFIG_MV + bool "mv" + default BUSYBOX_DEFAULT_MV + help + mv is used to move or rename files or directories. + +config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the mv applet. + +config BUSYBOX_CONFIG_NICE + bool "nice" + default BUSYBOX_DEFAULT_NICE + help + nice runs a program with modified scheduling priority. + +config BUSYBOX_CONFIG_NOHUP + bool "nohup" + default BUSYBOX_DEFAULT_NOHUP + help + run a command immune to hangups, with output to a non-tty. + +config BUSYBOX_CONFIG_OD + bool "od" + default BUSYBOX_DEFAULT_OD + help + od is used to dump binary files in octal and other formats. + +config BUSYBOX_CONFIG_PRINTENV + bool "printenv" + default BUSYBOX_DEFAULT_PRINTENV + help + printenv is used to print all or part of environment. + +config BUSYBOX_CONFIG_PRINTF + bool "printf" + default BUSYBOX_DEFAULT_PRINTF + help + printf is used to format and print specified strings. + It's similar to `echo' except it has more options. + +config BUSYBOX_CONFIG_PWD + bool "pwd" + default BUSYBOX_DEFAULT_PWD + help + pwd is used to print the current directory. + +config BUSYBOX_CONFIG_READLINK + bool "readlink" + default BUSYBOX_DEFAULT_READLINK + help + This program reads a symbolic link and returns the name + of the file it points to + +config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW + bool "Enable canonicalization by following all symlinks (-f)" + default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW + depends on BUSYBOX_CONFIG_READLINK + help + Enable the readlink option (-f). + +config BUSYBOX_CONFIG_REALPATH + bool "realpath" + default BUSYBOX_DEFAULT_REALPATH + help + Return the canonicalized absolute pathname. + This isn't provided by GNU shellutils, but where else does it belong. + +config BUSYBOX_CONFIG_RM + bool "rm" + default BUSYBOX_DEFAULT_RM + help + rm is used to remove files or directories. + +config BUSYBOX_CONFIG_RMDIR + bool "rmdir" + default BUSYBOX_DEFAULT_RMDIR + help + rmdir is used to remove empty directories. + +config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the rmdir applet, including + --ignore-fail-on-non-empty for compatibility with GNU rmdir. + +config BUSYBOX_CONFIG_SEQ + bool "seq" + default BUSYBOX_DEFAULT_SEQ + help + print a sequence of numbers + +config BUSYBOX_CONFIG_SHA1SUM + bool "sha1sum" + default BUSYBOX_DEFAULT_SHA1SUM + help + Compute and check SHA1 message digest + +config BUSYBOX_CONFIG_SHA256SUM + bool "sha256sum" + default BUSYBOX_DEFAULT_SHA256SUM + help + Compute and check SHA256 message digest + +config BUSYBOX_CONFIG_SHA512SUM + bool "sha512sum" + default BUSYBOX_DEFAULT_SHA512SUM + help + Compute and check SHA512 message digest + +config BUSYBOX_CONFIG_SHA3SUM + bool "sha3sum" + default BUSYBOX_DEFAULT_SHA3SUM + help + Compute and check SHA3 (512-bit) message digest + +config BUSYBOX_CONFIG_SLEEP + bool "sleep" + default BUSYBOX_DEFAULT_SLEEP + help + sleep is used to pause for a specified number of seconds. + It comes in 3 versions: + - small: takes one integer parameter + - fancy: takes multiple integer arguments with suffixes: + sleep 1d 2h 3m 15s + - fancy with fractional numbers: + sleep 2.3s 4.5h sleeps for 16202.3 seconds + Last one is "the most compatible" with coreutils sleep, + but it adds around 1k of code. + +config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + bool "Enable multiple arguments and s/m/h/d suffixes" + default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP + depends on BUSYBOX_CONFIG_SLEEP + help + Allow sleep to pause for specified minutes, hours, and days. + +config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP + bool "Enable fractional arguments" + default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP + depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + help + Allow for fractional numeric parameters. + +config BUSYBOX_CONFIG_SORT + bool "sort" + default BUSYBOX_DEFAULT_SORT + help + sort is used to sort lines of text in specified files. + +config BUSYBOX_CONFIG_FEATURE_SORT_BIG + bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" + default BUSYBOX_DEFAULT_FEATURE_SORT_BIG + depends on BUSYBOX_CONFIG_SORT + help + Without this, sort only supports -r, -u, and an integer version + of -n. Selecting this adds sort keys, floating point support, and + more. This adds a little over 3k to a nonstatic build on x86. + + The SuSv3 sort standard is available at: + http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html + +config BUSYBOX_CONFIG_SPLIT + bool "split" + default BUSYBOX_DEFAULT_SPLIT + help + split a file into pieces. + +config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY + bool "Fancy extensions" + default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY + depends on BUSYBOX_CONFIG_SPLIT + help + Add support for features not required by SUSv3. + Supports additional suffixes 'b' for 512 bytes, + 'g' for 1GiB for the -b option. + +config BUSYBOX_CONFIG_STTY + bool "stty" + default BUSYBOX_DEFAULT_STTY + help + stty is used to change and print terminal line settings. + +config BUSYBOX_CONFIG_SUM + bool "sum" + default BUSYBOX_DEFAULT_SUM + help + checksum and count the blocks in a file + +config BUSYBOX_CONFIG_TAC + bool "tac" + default BUSYBOX_DEFAULT_TAC + help + tac is used to concatenate and print files in reverse. + +config BUSYBOX_CONFIG_TAIL + bool "tail" + default BUSYBOX_DEFAULT_TAIL + help + tail is used to print the last specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL + bool "Enable extra tail options (-q, -s, -v, and -F)" + default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL + depends on BUSYBOX_CONFIG_TAIL + help + The options (-q, -s, -v and -F) are provided by GNU tail, but + are not specific in the SUSv3 standard. + + -q Never output headers giving file names + -s SEC Wait SEC seconds between reads with -f + -v Always output headers giving file names + -F Same as -f, but keep retrying + +config BUSYBOX_CONFIG_TEE + bool "tee" + default BUSYBOX_DEFAULT_TEE + help + tee is used to read from standard input and write + to standard output and files. + +config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO + bool "Enable block I/O (larger/faster) instead of byte I/O" + default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO + depends on BUSYBOX_CONFIG_TEE + help + Enable this option for a faster tee, at expense of size. + +config BUSYBOX_CONFIG_TRUE + bool "true" + default BUSYBOX_DEFAULT_TRUE + help + true returns an exit code of TRUE (0). + config BUSYBOX_CONFIG_TTY bool "tty" default BUSYBOX_DEFAULT_TTY help tty is used to print the name of the current terminal to standard output. + config BUSYBOX_CONFIG_UNAME bool "uname" default BUSYBOX_DEFAULT_UNAME @@ -833,36 +861,44 @@ config BUSYBOX_CONFIG_UNAME_OSNAME help Sets the operating system name reported by uname -o. The default BUSYBOX_DEFAULT_UNAME_OSNAME "GNU/Linux". + +config BUSYBOX_CONFIG_UNEXPAND + bool "unexpand" + default BUSYBOX_DEFAULT_UNEXPAND + help + By default, convert only leading sequences of blanks to tabs. + +config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the unexpand applet. + config BUSYBOX_CONFIG_UNIQ bool "uniq" default BUSYBOX_DEFAULT_UNIQ help uniq is used to remove duplicate lines from a sorted file. -config BUSYBOX_CONFIG_UNLINK - bool "unlink" - default BUSYBOX_DEFAULT_UNLINK - help - unlink deletes a file by calling unlink() + config BUSYBOX_CONFIG_USLEEP bool "usleep" default BUSYBOX_DEFAULT_USLEEP help usleep is used to pause for a specified number of microseconds. + config BUSYBOX_CONFIG_UUDECODE bool "uudecode" default BUSYBOX_DEFAULT_UUDECODE help uudecode is used to decode a uuencoded file. -config BUSYBOX_CONFIG_BASE64 - bool "base64" - default BUSYBOX_DEFAULT_BASE64 - help - Base64 encode and decode + config BUSYBOX_CONFIG_UUENCODE bool "uuencode" default BUSYBOX_DEFAULT_UUENCODE help uuencode is used to uuencode a file. + config BUSYBOX_CONFIG_WC bool "wc" default BUSYBOX_DEFAULT_WC @@ -871,37 +907,19 @@ config BUSYBOX_CONFIG_WC in specified files. config BUSYBOX_CONFIG_FEATURE_WC_LARGE - bool "Support very large counts" + bool "Support very large files in wc" default BUSYBOX_DEFAULT_FEATURE_WC_LARGE depends on BUSYBOX_CONFIG_WC help - Use "unsigned long long" for counter variables. -config BUSYBOX_CONFIG_WHO - bool "who" - default BUSYBOX_DEFAULT_WHO - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - who is used to show who is logged on. + Use "unsigned long long" in wc for counter variables. -config BUSYBOX_CONFIG_W - bool "w" - default BUSYBOX_DEFAULT_W - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - w is used to show who is logged on. - -config BUSYBOX_CONFIG_USERS - bool "users" - default BUSYBOX_DEFAULT_USERS - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Print users currently logged on. config BUSYBOX_CONFIG_WHOAMI bool "whoami" default BUSYBOX_DEFAULT_WHOAMI help whoami is used to print the username of the current user id (same as id -un). + config BUSYBOX_CONFIG_YES bool "yes" default BUSYBOX_DEFAULT_YES @@ -929,14 +947,41 @@ config BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS help Allow cp and mv to preserve hard links. +comment "Common options for ls, more and telnet" + depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET + +config BUSYBOX_CONFIG_FEATURE_AUTOWIDTH + bool "Calculate terminal & column widths" + default BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH + depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET + help + This option allows utilities such as 'ls', 'more' and 'telnet' + to determine the width of the screen, which can allow them to + display additional text or avoid wrapping text onto the next line. + If you leave this disabled, your utilities will be especially + primitive and will be unable to determine the current screen width. + comment "Common options for df, du, ls" depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE - bool "Support human readable output (example 13k, 23M, 235G)" + bool "Support for human readable output (example 13k, 23M, 235G)" default BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS help Allow df, du, and ls to have human readable output. +comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + +config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK + bool "Enable -c, -s and -w options" + default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + help + Enabling the -c options allows files to be checked + against pre-calculated hash values. + + -s and -w are useful options when verifying checksums. + endmenu diff --git a/package/utils/busybox/config/debianutils/Config.in b/package/utils/busybox/config/debianutils/Config.in index 6b9de0de5..d39c60f43 100644 --- a/package/utils/busybox/config/debianutils/Config.in +++ b/package/utils/busybox/config/debianutils/Config.in @@ -6,6 +6,11 @@ menu "Debian Utilities" +config BUSYBOX_CONFIG_MKTEMP + bool "mktemp" + default BUSYBOX_DEFAULT_MKTEMP + help + mktemp is used to create unique temporary files config BUSYBOX_CONFIG_PIPE_PROGRESS bool "pipe_progress" default BUSYBOX_DEFAULT_PIPE_PROGRESS @@ -30,6 +35,8 @@ config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUN_PARTS && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the run-parts applet. config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY bool "Support additional arguments" @@ -47,19 +54,22 @@ config BUSYBOX_CONFIG_START_STOP_DAEMON termination of system-level processes, usually the ones started during the startup of the system. -config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS - config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY bool "Support additional arguments" default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY depends on BUSYBOX_CONFIG_START_STOP_DAEMON help + Support additional arguments. -o|--oknodo ignored since we exit with 0 anyway -v|--verbose -N|--nicelevel N + +config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the start-stop-daemon applet. config BUSYBOX_CONFIG_WHICH bool "which" default BUSYBOX_DEFAULT_WHICH diff --git a/package/utils/busybox/config/editors/Config.in b/package/utils/busybox/config/editors/Config.in index da4eaedd7..6ae361f7f 100644 --- a/package/utils/busybox/config/editors/Config.in +++ b/package/utils/busybox/config/editors/Config.in @@ -49,6 +49,8 @@ config BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_DIFF_LONG_OPTIONS depends on BUSYBOX_CONFIG_DIFF && BUSYBOX_CONFIG_LONG_OPTS + help + Enable use of long options. config BUSYBOX_CONFIG_FEATURE_DIFF_DIR bool "Enable directory support" @@ -85,7 +87,7 @@ config BUSYBOX_CONFIG_VI you may wish to use something else. config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN - int "Maximum screen width" + int "Maximum screen width in vi" range 256 16384 default BUSYBOX_DEFAULT_FEATURE_VI_MAX_LEN depends on BUSYBOX_CONFIG_VI @@ -94,7 +96,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN Make it smaller than 4k only if you are very limited on memory. config BUSYBOX_CONFIG_FEATURE_VI_8BIT - bool "Allow to display 8-bit chars (otherwise shows dots)" + bool "Allow vi to display 8-bit chars (otherwise shows dots)" default BUSYBOX_DEFAULT_FEATURE_VI_8BIT depends on BUSYBOX_CONFIG_VI help @@ -108,7 +110,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_COLON default BUSYBOX_DEFAULT_FEATURE_VI_COLON depends on BUSYBOX_CONFIG_VI help - Enable a limited set of colon commands. This does not + Enable a limited set of colon commands for vi. This does not provide an "ex" mode. config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK @@ -116,14 +118,16 @@ config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK default BUSYBOX_DEFAULT_FEATURE_VI_YANKMARK depends on BUSYBOX_CONFIG_VI help - This will enable you to use yank and put, as well as mark. + This will enable you to use yank and put, as well as mark in + busybox vi. config BUSYBOX_CONFIG_FEATURE_VI_SEARCH bool "Enable search and replace cmds" default BUSYBOX_DEFAULT_FEATURE_VI_SEARCH depends on BUSYBOX_CONFIG_VI help - Select this if you wish to be able to do search and replace. + Select this if you wish to be able to do search and replace in + busybox vi. config BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH bool "Enable regex in search and replace" @@ -137,15 +141,16 @@ config BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS default BUSYBOX_DEFAULT_FEATURE_VI_USE_SIGNALS depends on BUSYBOX_CONFIG_VI help - Selecting this option will make vi signal aware. This will support - SIGWINCH to deal with Window Changes, catch ^Z and ^C and alarms. + Selecting this option will make busybox vi signal aware. This will + make busybox vi support SIGWINCH to deal with Window Changes, catch + Ctrl-Z and Ctrl-C and alarms. config BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD bool "Remember previous cmd and \".\" cmd" default BUSYBOX_DEFAULT_FEATURE_VI_DOT_CMD depends on BUSYBOX_CONFIG_VI help - Make vi remember the last command and be able to repeat it. + Make busybox vi remember the last command and be able to repeat it. config BUSYBOX_CONFIG_FEATURE_VI_READONLY bool "Enable -R option and \"view\" mode" @@ -156,23 +161,25 @@ config BUSYBOX_CONFIG_FEATURE_VI_READONLY open a file in read-only mode. config BUSYBOX_CONFIG_FEATURE_VI_SETOPTS - bool "Enable settable options, ai ic showmatch" + bool "Enable set-able options, ai ic showmatch" default BUSYBOX_DEFAULT_FEATURE_VI_SETOPTS depends on BUSYBOX_CONFIG_VI help Enable the editor to set some (ai, ic, showmatch) options. config BUSYBOX_CONFIG_FEATURE_VI_SET - bool "Support :set" + bool "Support for :set" default BUSYBOX_DEFAULT_FEATURE_VI_SET depends on BUSYBOX_CONFIG_VI + help + Support for ":set". config BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE bool "Handle window resize" default BUSYBOX_DEFAULT_FEATURE_VI_WIN_RESIZE depends on BUSYBOX_CONFIG_VI help - Behave nicely with terminals that get resized. + Make busybox vi behave nicely with terminals that get resized. config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL bool "Use 'tell me cursor position' ESC sequence to measure window" @@ -183,16 +190,15 @@ config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL this option makes vi perform a last-ditch effort to find it: position cursor to 999,999 and ask terminal to report real cursor position using "ESC [ 6 n" escape sequence, then read stdin. - This is not clean but helps a lot on serial lines and such. + This is not clean but helps a lot on serial lines and such. config BUSYBOX_CONFIG_FEATURE_VI_UNDO - bool "Support undo command \"u\"" + bool "Support undo command 'u'" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO depends on BUSYBOX_CONFIG_VI help Support the 'u' command to undo insertion, deletion, and replacement of text. - config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE bool "Enable undo operation queuing" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE @@ -203,7 +209,6 @@ config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE reached, the contents of the queue are committed to the undo stack. This increases the size of the undo code and allows some undo operations (especially un-typing/backspacing) to be far more useful. - config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE_MAX int "Maximum undo character queue size" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE_MAX @@ -223,7 +228,7 @@ config BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC default BUSYBOX_DEFAULT_FEATURE_ALLOW_EXEC depends on BUSYBOX_CONFIG_VI || BUSYBOX_CONFIG_AWK help - Enables vi and awk features which allow user to execute + Enables vi and awk features which allows user to execute shell commands (using system() C call). endmenu diff --git a/package/utils/busybox/config/findutils/Config.in b/package/utils/busybox/config/findutils/Config.in index 3393adbe3..85ee1db2c 100644 --- a/package/utils/busybox/config/findutils/Config.in +++ b/package/utils/busybox/config/findutils/Config.in @@ -42,6 +42,8 @@ config BUSYBOX_CONFIG_FEATURE_FIND_PERM bool "Enable -perm: permissions matching" default BUSYBOX_DEFAULT_FEATURE_FIND_PERM depends on BUSYBOX_CONFIG_FIND + help + Enable searching based on file permissions. config BUSYBOX_CONFIG_FEATURE_FIND_TYPE bool "Enable -type: file type matching (file/dir/link/...)" @@ -55,11 +57,15 @@ config BUSYBOX_CONFIG_FEATURE_FIND_XDEV bool "Enable -xdev: 'stay in filesystem'" default BUSYBOX_DEFAULT_FEATURE_FIND_XDEV depends on BUSYBOX_CONFIG_FIND + help + This option allows find to restrict searches to a single filesystem. config BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH bool "Enable -mindepth N and -maxdepth N" default BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH depends on BUSYBOX_CONFIG_FIND + help + This option enables -mindepth N and -maxdepth N option. config BUSYBOX_CONFIG_FEATURE_FIND_NEWER bool "Enable -newer: compare file modification times" @@ -73,6 +79,8 @@ config BUSYBOX_CONFIG_FEATURE_FIND_INUM bool "Enable -inum: inode number matching" default BUSYBOX_DEFAULT_FEATURE_FIND_INUM depends on BUSYBOX_CONFIG_FIND + help + Support the 'find -inum' option for searching by inode number. config BUSYBOX_CONFIG_FEATURE_FIND_EXEC bool "Enable -exec: execute commands" @@ -96,11 +104,15 @@ config BUSYBOX_CONFIG_FEATURE_FIND_USER bool "Enable -user: username/uid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_USER depends on BUSYBOX_CONFIG_FIND + help + Support the 'find -user' option for searching by username or uid. config BUSYBOX_CONFIG_FEATURE_FIND_GROUP bool "Enable -group: group/gid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_GROUP depends on BUSYBOX_CONFIG_FIND + help + Support the 'find -group' option for searching by group name or gid. config BUSYBOX_CONFIG_FEATURE_FIND_NOT bool "Enable the 'not' (!) operator" @@ -129,13 +141,15 @@ config BUSYBOX_CONFIG_FEATURE_FIND_SIZE bool "Enable -size: file size matching" default BUSYBOX_DEFAULT_FEATURE_FIND_SIZE depends on BUSYBOX_CONFIG_FIND + help + Support the 'find -size' option for searching by file size. config BUSYBOX_CONFIG_FEATURE_FIND_PRUNE bool "Enable -prune: exclude subdirectories" default BUSYBOX_DEFAULT_FEATURE_FIND_PRUNE depends on BUSYBOX_CONFIG_FIND help - If the file is a directory, don't descend into it. Useful for + If the file is a directory, dont descend into it. Useful for exclusion .svn and CVS directories. config BUSYBOX_CONFIG_FEATURE_FIND_DELETE @@ -180,22 +194,28 @@ config BUSYBOX_CONFIG_GREP help grep is used to search files for a specified pattern. -config BUSYBOX_CONFIG_EGREP - bool "egrep" - default BUSYBOX_DEFAULT_EGREP +config BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS + bool "Enable extended regular expressions (egrep & grep -E)" + default BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS + depends on BUSYBOX_CONFIG_GREP help - Alias to "grep -E" + Enabled support for extended regular expressions. Extended + regular expressions allow for alternation (foo|bar), grouping, + and various repetition operators. -config BUSYBOX_CONFIG_FGREP - bool "fgrep" - default BUSYBOX_DEFAULT_FGREP +config BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS + bool "Alias fgrep to grep -F" + default BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS + depends on BUSYBOX_CONFIG_GREP help - Alias to "grep -F" + fgrep sees the search pattern as a normal string rather than + regular expressions. + grep -F always works, this just creates the fgrep alias. config BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT bool "Enable before and after context flags (-A, -B and -C)" default BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT - depends on BUSYBOX_CONFIG_GREP || BUSYBOX_CONFIG_EGREP || BUSYBOX_CONFIG_FGREP + depends on BUSYBOX_CONFIG_GREP help Print the specified number of leading (-B) and/or trailing (-A) context surrounding our matching lines. diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in index 072df3389..021656d3f 100644 --- a/package/utils/busybox/config/init/Config.in +++ b/package/utils/busybox/config/init/Config.in @@ -45,27 +45,15 @@ config BUSYBOX_CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE Enable reading and parsing of $PWD/bootchartd.conf and /etc/bootchartd.conf files. config BUSYBOX_CONFIG_HALT - bool "halt" + bool "poweroff, halt, and reboot" default BUSYBOX_DEFAULT_HALT help - Stop all processes and halt the system. - -config BUSYBOX_CONFIG_POWEROFF - bool "poweroff" - default BUSYBOX_DEFAULT_POWEROFF - help - Stop all processes and power off the system. - -config BUSYBOX_CONFIG_REBOOT - bool "reboot" - default BUSYBOX_DEFAULT_REBOOT - help - Stop all processes and reboot the system. + Stop all processes and either halt, reboot, or power off the system. config BUSYBOX_CONFIG_FEATURE_CALL_TELINIT bool "Call telinit on shutdown and reboot" default BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT - depends on (BUSYBOX_CONFIG_HALT || BUSYBOX_CONFIG_POWEROFF || BUSYBOX_CONFIG_REBOOT) && !BUSYBOX_CONFIG_INIT + depends on BUSYBOX_CONFIG_HALT && !BUSYBOX_CONFIG_INIT help Call an external program (normally telinit) to facilitate a switch to a proper runlevel. @@ -89,7 +77,7 @@ config BUSYBOX_CONFIG_INIT init is the first program run when the system boots. config BUSYBOX_CONFIG_LINUXRC - bool "linuxrc: support running init from initrd (not initramfs)" + bool "Support running init from within an initrd (not initramfs)" default BUSYBOX_DEFAULT_LINUXRC select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -145,19 +133,17 @@ config BUSYBOX_CONFIG_FEATURE_INIT_SYSLOG bool "Enable init to write to syslog" default BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC - help - If selected, some init messages are sent to syslog. - Otherwise, they are sent to VT #5 if linux virtual tty is detected - (if not, no separate logging is done). -config BUSYBOX_CONFIG_FEATURE_INIT_QUIET - bool "Be quiet on boot (no 'init started:' message)" - default BUSYBOX_DEFAULT_FEATURE_INIT_QUIET +config BUSYBOX_CONFIG_FEATURE_EXTRA_QUIET + bool "Be _extra_ quiet on boot" + default BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC + help + Prevent init from logging some messages to the console during boot. config BUSYBOX_CONFIG_FEATURE_INIT_COREDUMPS bool "Support dumping core for child processes (debugging only)" - default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS # not Y because this is a debug option + default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help If this option is enabled and the file /.init_enable_core @@ -178,18 +164,36 @@ config BUSYBOX_CONFIG_INIT_TERMINAL_TYPE sets TERM to "vt102" if one is found. config BUSYBOX_CONFIG_FEATURE_INIT_MODIFY_CMDLINE - bool "Clear init's command line" + bool "Modify the command-line to \"init\"" default BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help When launched as PID 1 and after parsing its arguments, init wipes all the arguments but argv[0] and rewrites argv[0] to - contain only "init", so that its command line appears solely as + contain only "init", so that its command-line appears solely as "init" in tools such as ps. If this option is set to Y, init will keep its original behavior, otherwise, all the arguments including argv[0] will be preserved, be they parsed or ignored by init. The original command-line used to launch init can then be retrieved in /proc/1/cmdline on Linux, for example. +config BUSYBOX_CONFIG_MESG + bool "mesg" + default BUSYBOX_DEFAULT_MESG + help + Mesg controls access to your terminal by others. It is typically + used to allow or disallow other users to write to your terminal + +config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP + bool "Enable writing to tty only by group, not by everybody" + default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP + depends on BUSYBOX_CONFIG_MESG + help + Usually, ttys are owned by group "tty", and "write" tool is + setgid to this group. This way, "mesg y" only needs to enable + "write by owning group" bit in tty mode. + + If you set this option to N, "mesg y" will enable writing + by anybody at all. This is not recommended. endmenu diff --git a/package/utils/busybox/config/libbb/Config.in b/package/utils/busybox/config/libbb/Config.in index 1687ed5c7..0695f9ba3 100644 --- a/package/utils/busybox/config/libbb/Config.in +++ b/package/utils/busybox/config/libbb/Config.in @@ -45,30 +45,6 @@ config BUSYBOX_CONFIG_FEATURE_RTMINMAX Support RTMIN[+n] and RTMAX[-n] signal names in kill, killall etc. This costs ~250 bytes. -choice - prompt "Buffer allocation policy" - default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - help - There are 3 ways BusyBox can handle buffer allocations: - - Use malloc. This costs code size for the call to xmalloc. - - Put them on stack. For some very small machines with limited stack - space, this can be deadly. For most folks, this works just fine. - - Put them in BSS. This works beautifully for computers with a real - MMU (and OS support), but wastes runtime RAM for uCLinux. This - behavior was the only one available for BusyBox versions 0.48 and - earlier. - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC - bool "Allocate with Malloc" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - bool "Allocate on the Stack" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS - bool "Allocate in the .bss section" - -endchoice - config BUSYBOX_CONFIG_PASSWORD_MINLEN int "Minimum password length" default BUSYBOX_DEFAULT_PASSWORD_MINLEN @@ -108,13 +84,24 @@ config BUSYBOX_CONFIG_FEATURE_FAST_TOP but code size is slightly bigger. config BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS - bool "Support /etc/networks" + bool "Support for /etc/networks" default BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS help Enable support for network names in /etc/networks. This is a rarely used feature which allows you to use names instead of IP/mask pairs in route command. +config BUSYBOX_CONFIG_FEATURE_USE_TERMIOS + bool "Use termios to manipulate the screen" + default BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS + depends on BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_POWERTOP + help + This option allows utilities such as 'more' and 'top' to determine + the size of the screen. If you leave this disabled, your utilities + that display things on the screen will be especially primitive and + will be unable to determine the current screen size, and will be + unable to move the cursor. + config BUSYBOX_CONFIG_FEATURE_EDITING bool "Command line editing" default BUSYBOX_DEFAULT_FEATURE_EDITING @@ -174,11 +161,15 @@ config BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION bool "Tab completion" default BUSYBOX_DEFAULT_FEATURE_TAB_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_EDITING + help + Enable tab completion. config BUSYBOX_CONFIG_FEATURE_USERNAME_COMPLETION bool "Username completion" default BUSYBOX_DEFAULT_FEATURE_USERNAME_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION + help + Enable username completion. config BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT bool "Fancy shell prompts" @@ -200,131 +191,6 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL correctly, or want to save on code size (about 400 bytes), then do not turn this option on. -config BUSYBOX_CONFIG_LOCALE_SUPPORT - bool "Enable locale support (system needs locale for this to work)" - default BUSYBOX_DEFAULT_LOCALE_SUPPORT - help - Enable this if your system has locale support and you would like - busybox to support locale settings. - -config BUSYBOX_CONFIG_UNICODE_SUPPORT - bool "Support Unicode" - default BUSYBOX_DEFAULT_UNICODE_SUPPORT - help - This makes various applets aware that one byte is not - one character on screen. - - Busybox aims to eventually work correctly with Unicode displays. - Any older encodings are not guaranteed to work. - Probably by the time when busybox will be fully Unicode-clean, - other encodings will be mainly of historic interest. - -config BUSYBOX_CONFIG_UNICODE_USING_LOCALE - bool "Use libc routines for Unicode (else uses internal ones)" - default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT - help - With this option on, Unicode support is implemented using libc - routines. Otherwise, internal implementation is used. - Internal implementation is smaller. - -config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV - bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" - default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, Unicode support is activated - only if locale-related variables have the value of the form - "xxxx.utf8" - - Otherwise, Unicode support will be always enabled and active. - -config BUSYBOX_CONFIG_SUBST_WCHAR - int "Character code to substitute unprintable characters with" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_SUBST_WCHAR - help - Typical values are 63 for '?' (works with any output device), - 30 for ASCII substitute control code, - 65533 (0xfffd) for Unicode replacement character. - -config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR - int "Range of supported Unicode characters" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - help - Any character with Unicode value bigger than this is assumed - to be non-printable on output device. Many applets replace - such characters with substitution character. - - The idea is that many valid printable Unicode chars - nevertheless are not displayed correctly. Think about - combining charachers, double-wide hieroglyphs, obscure - characters in dozens of ancient scripts... - Many terminals, terminal emulators, xterms etc will fail - to handle them correctly. Choose the smallest value - which suits your needs. - - Typical values are: - 126 - ASCII only - 767 (0x2ff) - there are no combining chars in [0..767] range - (the range includes Latin 1, Latin Ext. A and B), - code is ~700 bytes smaller for this case. - 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, - code is ~300 bytes smaller for this case. - 12799 (0x31ff) - nearly all non-ideographic characters are - available in [0..12799] range, including - East Asian scripts like katakana, hiragana, hangul, - bopomofo... - 0 - off, any valid printable Unicode character will be printed. - -config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS - bool "Allow zero-width Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width of 0 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS - bool "Allow wide Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width > 1 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - bool "Bidirectional character-aware line input" - default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, right-to-left Unicode characters - are treated differently on input (e.g. cursor movement). - -config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE - bool "In bidi input, support non-ASCII neutral chars too" - default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - help - In most cases it's enough to treat only ASCII non-letters - (i.e. punctuation, numbers and space) as characters - with neutral directionality. - With this option on, more extensive (and bigger) table - of neutral chars will be used. - -config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN - bool "Make it possible to enter sequences of chars which are not Unicode" - default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option on, on line-editing input (such as used by shells) - invalid UTF-8 bytes are not substituted with the selected - substitution character. - For example, this means that entering 'l', 's', ' ', 0xff, [Enter] - at shell prompt will list file named 0xff (single char name - with char value 255), not file named '?'. - config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP bool "Non-POSIX, but safer, copying to special nodes" default BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP @@ -349,19 +215,6 @@ config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE cp: cannot stat '/vmlinuz/file': Not a directory This will cost you ~60 bytes. -config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE - bool "Use sendfile system call" - default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - When enabled, busybox will use the kernel sendfile() function - instead of read/write loops to copy data between file descriptors - (for example, cp command does this a lot). - If sendfile() doesn't work, copying code falls back to read/write - loop. sendfile() was originally implemented for faster I/O - from files to sockets, but since Linux 2.6.33 it was extended - to work for many more file types. - config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB int "Copy buffer size, in kilobytes" range 1 1024 diff --git a/package/utils/busybox/config/loginutils/Config.in b/package/utils/busybox/config/loginutils/Config.in index fa0059587..956115c7f 100644 --- a/package/utils/busybox/config/loginutils/Config.in +++ b/package/utils/busybox/config/loginutils/Config.in @@ -7,7 +7,7 @@ menu "Login/Password Management Utilities" config BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS - bool "Support shadow passwords" + bool "Support for shadow passwords" default BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS help Build support for shadow password in /etc/shadow. This file is only @@ -113,13 +113,15 @@ config BUSYBOX_CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDGROUP && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the addgroup applet. config BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP - bool "Support adding users to groups" + bool "Support for adding users to groups" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP depends on BUSYBOX_CONFIG_ADDGROUP help - If called with two non-option arguments, + If called with two non-option arguments, addgroup will add an existing user to an existing group. config BUSYBOX_CONFIG_ADDUSER @@ -132,6 +134,8 @@ config BUSYBOX_CONFIG_FEATURE_ADDUSER_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDUSER && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the adduser applet. config BUSYBOX_CONFIG_FEATURE_CHECK_NAMES bool "Enable sanity check on user/group names in adduser and addgroup" @@ -175,9 +179,9 @@ config BUSYBOX_CONFIG_CHPASSWD and uses this information to update a group of existing users. config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO - string "Default encryption method (passwd -a, cryptpw -m, chpasswd -c ALG)" + string "Default password encryption method (passwd -a, cryptpw -m parameter)" default BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO - depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW || BUSYBOX_CONFIG_CHPASSWD + depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW help Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512". config BUSYBOX_CONFIG_CRYPTPW @@ -207,7 +211,7 @@ config BUSYBOX_CONFIG_DELGROUP Utility for deleting a group account. config BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP - bool "Support removing users from groups" + bool "Support for removing users from groups" default BUSYBOX_DEFAULT_FEATURE_DEL_USER_FROM_GROUP depends on BUSYBOX_CONFIG_DELGROUP help @@ -253,7 +257,7 @@ config BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD will not be cleaned up. config BUSYBOX_CONFIG_LOGIN_SCRIPTS - bool "Support login scripts" + bool "Support for login scripts" depends on BUSYBOX_CONFIG_LOGIN default BUSYBOX_DEFAULT_LOGIN_SCRIPTS help @@ -261,7 +265,7 @@ config BUSYBOX_CONFIG_LOGIN_SCRIPTS just prior to switching from root to logged-in user. config BUSYBOX_CONFIG_FEATURE_NOLOGIN - bool "Support /etc/nologin" + bool "Support for /etc/nologin" default BUSYBOX_DEFAULT_FEATURE_NOLOGIN depends on BUSYBOX_CONFIG_LOGIN help @@ -269,7 +273,7 @@ config BUSYBOX_CONFIG_FEATURE_NOLOGIN If it exists, non-root logins are prohibited. config BUSYBOX_CONFIG_FEATURE_SECURETTY - bool "Support /etc/securetty" + bool "Support for /etc/securetty" default BUSYBOX_DEFAULT_FEATURE_SECURETTY depends on BUSYBOX_CONFIG_LOGIN help @@ -302,23 +306,19 @@ config BUSYBOX_CONFIG_SU help su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. - Note that busybox binary must be setuid root for this applet to + + Note that Busybox binary must be setuid root for this applet to work properly. config BUSYBOX_CONFIG_FEATURE_SU_SYSLOG - bool "Log to syslog all attempts to use su" + bool "Enable su to write to syslog" default BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_FEATURE_SU_CHECKS_SHELLS - bool "If user's shell is not in /etc/shells, disallow -s PROG" + bool "Enable su to check user's shell to be listed in /etc/shells" + depends on BUSYBOX_CONFIG_SU default BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS - depends on BUSYBOX_CONFIG_SU - -config BUSYBOX_CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY - bool "Allow blank passwords only on TTYs in /etc/securetty" - default BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY - depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_SULOGIN bool "sulogin" default BUSYBOX_DEFAULT_SULOGIN diff --git a/package/utils/busybox/config/mailutils/Config.in b/package/utils/busybox/config/mailutils/Config.in index 7e7740786..64b9a2baa 100644 --- a/package/utils/busybox/config/mailutils/Config.in +++ b/package/utils/busybox/config/mailutils/Config.in @@ -1,11 +1,20 @@ # DO NOT EDIT. This file is generated from Config.src menu "Mail Utilities" + config BUSYBOX_CONFIG_MAKEMIME bool "makemime" default BUSYBOX_DEFAULT_MAKEMIME help Create MIME-formatted messages. + +config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET + string "Default charset" + default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL + help + Default charset of the message. + config BUSYBOX_CONFIG_POPMAILDIR bool "popmaildir" default BUSYBOX_DEFAULT_POPMAILDIR @@ -22,6 +31,7 @@ config BUSYBOX_CONFIG_FEATURE_POPMAILDIR_DELIVERY of the message before actual delivery (-F "prog [args...]"). Allow to use a custom program for message actual delivery (-M "prog [args...]"). + config BUSYBOX_CONFIG_REFORMIME bool "reformime" default BUSYBOX_DEFAULT_REFORMIME @@ -35,17 +45,11 @@ config BUSYBOX_CONFIG_FEATURE_REFORMIME_COMPAT help Accept (for compatibility only) and ignore options other than -x and -X. + config BUSYBOX_CONFIG_SENDMAIL bool "sendmail" default BUSYBOX_DEFAULT_SENDMAIL help Barebones sendmail. -config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET - string "Default charset" - default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL - help - Default charset of the message. - endmenu diff --git a/package/utils/busybox/config/miscutils/Config.in b/package/utils/busybox/config/miscutils/Config.in index 61c5458b6..3465df40a 100644 --- a/package/utils/busybox/config/miscutils/Config.in +++ b/package/utils/busybox/config/miscutils/Config.in @@ -6,121 +6,6 @@ menu "Miscellaneous Utilities" -config BUSYBOX_CONFIG_ADJTIMEX - bool "adjtimex" - default BUSYBOX_DEFAULT_ADJTIMEX - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Adjtimex reads and optionally sets adjustment parameters for - the Linux clock adjustment algorithm. -config BUSYBOX_CONFIG_BBCONFIG - bool "bbconfig" - default BUSYBOX_DEFAULT_BBCONFIG - help - The bbconfig applet will print the config file with which - busybox was built. - -config BUSYBOX_CONFIG_FEATURE_COMPRESS_BBCONFIG - bool "Compress bbconfig data" - default BUSYBOX_DEFAULT_FEATURE_COMPRESS_BBCONFIG - depends on BUSYBOX_CONFIG_BBCONFIG - help - Store bbconfig data in compressed form, uncompress them on-the-fly - before output. - - If you have a really tiny busybox with few applets enabled (and - bunzip2 isn't one of them), the overhead of the decompressor might - be noticeable. Also, if you run executables directly from ROM - and have very little memory, this might not be a win. Otherwise, - you probably want this. -config BUSYBOX_CONFIG_BEEP - bool "beep" - default BUSYBOX_DEFAULT_BEEP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The beep applets beeps in a given freq/Hz. - -config BUSYBOX_CONFIG_FEATURE_BEEP_FREQ - int "default frequency" - range 20 50000 # allowing 0 here breaks the build - default BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ - depends on BUSYBOX_CONFIG_BEEP - help - Frequency for default beep. - -config BUSYBOX_CONFIG_FEATURE_BEEP_LENGTH_MS - int "default length" - range 0 2147483647 - default BUSYBOX_DEFAULT_FEATURE_BEEP_LENGTH_MS - depends on BUSYBOX_CONFIG_BEEP - help - Length in ms for default beep. -config BUSYBOX_CONFIG_CHAT - bool "chat" - default BUSYBOX_DEFAULT_CHAT - help - Simple chat utility. - -config BUSYBOX_CONFIG_FEATURE_CHAT_NOFAIL - bool "Enable NOFAIL expect strings" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_NOFAIL - help - When enabled expect strings which are started with a dash trigger - no-fail mode. That is when expectation is not met within timeout - the script is not terminated but sends next SEND string and waits - for next EXPECT string. This allows to compose far more flexible - scripts. - -config BUSYBOX_CONFIG_FEATURE_CHAT_TTY_HIFI - bool "Force STDIN to be a TTY" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_TTY_HIFI - help - Original chat always treats STDIN as a TTY device and sets for it - so-called raw mode. This option turns on such behaviour. - -config BUSYBOX_CONFIG_FEATURE_CHAT_IMPLICIT_CR - bool "Enable implicit Carriage Return" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_IMPLICIT_CR - help - When enabled make chat to terminate all SEND strings with a "\r" - unless "\c" is met anywhere in the string. - -config BUSYBOX_CONFIG_FEATURE_CHAT_SWALLOW_OPTS - bool "Swallow options" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_SWALLOW_OPTS - help - Busybox chat require no options. To make it not fail when used - in place of original chat (which has a bunch of options) turn - this on. - -config BUSYBOX_CONFIG_FEATURE_CHAT_SEND_ESCAPES - bool "Support weird SEND escapes" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_SEND_ESCAPES - help - Original chat uses some escape sequences in SEND arguments which - are not sent to device but rather performs special actions. - E.g. "\K" means to send a break sequence to device. - "\d" delays execution for a second, "\p" -- for a 1/100 of second. - Before turning this option on think twice: do you really need them? - -config BUSYBOX_CONFIG_FEATURE_CHAT_VAR_ABORT_LEN - bool "Support variable-length ABORT conditions" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_VAR_ABORT_LEN - help - Original chat uses fixed 50-bytes length ABORT conditions. Say N here. - -config BUSYBOX_CONFIG_FEATURE_CHAT_CLR_ABORT - bool "Support revoking of ABORT conditions" - depends on BUSYBOX_CONFIG_CHAT - default BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT - help - Support CLR_ABORT directive. config BUSYBOX_CONFIG_CONSPY bool "conspy" default BUSYBOX_DEFAULT_CONSPY @@ -163,194 +48,6 @@ config BUSYBOX_CONFIG_FEATURE_CROND_DIR depends on BUSYBOX_CONFIG_CROND || BUSYBOX_CONFIG_CRONTAB help Location of crond spool. -config BUSYBOX_CONFIG_CRONTAB - bool "crontab" - default BUSYBOX_DEFAULT_CRONTAB - help - Crontab manipulates the crontab for a particular user. Only - the superuser may specify a different user and/or crontab directory. - Note that Busybox binary must be setuid root for this applet to - work properly. -config BUSYBOX_CONFIG_DC - bool "dc" - default BUSYBOX_DEFAULT_DC - help - Dc is a reverse-polish desk calculator which supports unlimited - precision arithmetic. - -config BUSYBOX_CONFIG_FEATURE_DC_LIBM - bool "Enable power and exp functions (requires libm)" - default BUSYBOX_DEFAULT_FEATURE_DC_LIBM - depends on BUSYBOX_CONFIG_DC - help - Enable power and exp functions. - NOTE: This will require libm to be present for linking. -config BUSYBOX_CONFIG_DEVFSD - bool "devfsd (obsolete)" - default BUSYBOX_DEFAULT_DEVFSD - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - This is deprecated and should NOT be used anymore. - Use linux >= 2.6 (optionally with hotplug) and mdev instead! - See docs/mdev.txt for detailed instructions on how to use mdev - instead. - - Provides compatibility with old device names on a devfs systems. - You should set it to true if you have devfs enabled. - The following keywords in devsfd.conf are supported: - "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE", - "PERMISSIONS", "EXECUTE", "COPY", "IGNORE", - "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT". - - But only if they are written UPPERCASE!!!!!!!! - -config BUSYBOX_CONFIG_DEVFSD_MODLOAD - bool "Adds support for MODLOAD keyword in devsfd.conf" - default BUSYBOX_DEFAULT_DEVFSD_MODLOAD - depends on BUSYBOX_CONFIG_DEVFSD - help - This actually doesn't work with busybox modutils but needs - the external modutils. - -config BUSYBOX_CONFIG_DEVFSD_FG_NP - bool "Enable the -fg and -np options" - default BUSYBOX_DEFAULT_DEVFSD_FG_NP - depends on BUSYBOX_CONFIG_DEVFSD - help - -fg Run the daemon in the foreground. - -np Exit after parsing the configuration file. - Do not poll for events. - -config BUSYBOX_CONFIG_DEVFSD_VERBOSE - bool "Increases logging (and size)" - default BUSYBOX_DEFAULT_DEVFSD_VERBOSE - depends on BUSYBOX_CONFIG_DEVFSD - help - Increases logging to stderr or syslog. - -config BUSYBOX_CONFIG_FEATURE_DEVFS - bool "Use devfs names for all devices (obsolete)" - default BUSYBOX_DEFAULT_FEATURE_DEVFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This is obsolete and should NOT be used anymore. - Use linux >= 2.6 (optionally with hotplug) and mdev instead! - - For legacy systems -- if there is no way around devfsd -- this - tells busybox to look for names like /dev/loop/0 instead of - /dev/loop0. If your /dev directory has normal names instead of - devfs names, you don't want this. -config BUSYBOX_CONFIG_DEVMEM - bool "devmem" - default BUSYBOX_DEFAULT_DEVMEM - help - devmem is a small program that reads and writes from physical - memory using /dev/mem. -config BUSYBOX_CONFIG_FBSPLASH - bool "fbsplash" - default BUSYBOX_DEFAULT_FBSPLASH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Shows splash image and progress bar on framebuffer device. - Can be used during boot phase of an embedded device. ~2kb. - Usage: - - use kernel option 'vga=xxx' or otherwise enable fb device. - - put somewhere fbsplash.cfg file and an image in .ppm format. - - $ setsid fbsplash [params] & - -c: hide cursor - -d /dev/fbN: framebuffer device (if not /dev/fb0) - -s path_to_image_file (can be "-" for stdin) - -i path_to_cfg_file (can be "-" for stdin) - -f path_to_fifo (can be "-" for stdin) - - if you want to run it only in presence of kernel parameter: - grep -q "fbsplash=on" = 2.6.13 config BUSYBOX_CONFIG_LESS bool "less" default BUSYBOX_DEFAULT_LESS @@ -451,6 +142,7 @@ config BUSYBOX_CONFIG_FEATURE_LESS_ASK_TERMINAL this option makes less perform a last-ditch effort to find it: position cursor to 999,999 and ask terminal to report real cursor position using "ESC [ 6 n" escape sequence, then read stdin. + This is not clean but helps a lot on serial lines and such. config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD @@ -462,71 +154,11 @@ config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD less itself ('-' keyboard command). config BUSYBOX_CONFIG_FEATURE_LESS_LINENUMS - bool "Enable -N (dynamic switching of line numbers)" + bool "Enable dynamic switching of line numbers" default BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS depends on BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD -config BUSYBOX_CONFIG_LOCK - bool "lock" - default BUSYBOX_DEFAULT_LOCK help - Small utility for using locks in scripts -config BUSYBOX_CONFIG_LSSCSI - bool "lsscsi" - default BUSYBOX_DEFAULT_LSSCSI - #select PLATFORM_LINUX - help - lsscsi is a utility for displaying information about SCSI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/scsi/devices) only. -config BUSYBOX_CONFIG_MAKEDEVS - bool "makedevs" - default BUSYBOX_DEFAULT_MAKEDEVS - help - 'makedevs' is a utility used to create a batch of devices with - one command. - - There are two choices for command line behaviour, the interface - as used by LEAF/Linux Router Project, or a device table file. - - 'leaf' is traditionally what busybox follows, it allows multiple - devices of a particluar type to be created per command. - e.g. /dev/hda[0-9] - Device properties are passed as command line arguments. - - 'table' reads device properties from a file or stdin, allowing - a batch of unrelated devices to be made with one command. - User/group names are allowed as an alternative to uid/gid. - -choice - prompt "Choose makedevs behaviour" - depends on BUSYBOX_CONFIG_MAKEDEVS - default BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE - -config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_LEAF - bool "leaf" - -config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE - bool "table" - -endchoice -config BUSYBOX_CONFIG_MAN - bool "man" - default BUSYBOX_DEFAULT_MAN - help - Format and display manual pages. -config BUSYBOX_CONFIG_MICROCOM - bool "microcom" - default BUSYBOX_DEFAULT_MICROCOM - help - The poor man's minicom utility for chatting with serial port devices. -config BUSYBOX_CONFIG_MT - bool "mt" - default BUSYBOX_DEFAULT_MT - help - mt is used to control tape devices. You can use the mt utility - to advance or rewind a tape past a specified number of archive - files on the tape. + Enables "-N" command. config BUSYBOX_CONFIG_NANDWRITE bool "nandwrite" default BUSYBOX_DEFAULT_NANDWRITE @@ -540,36 +172,6 @@ config BUSYBOX_CONFIG_NANDDUMP select BUSYBOX_CONFIG_PLATFORM_LINUX help Dump the content of raw NAND chip -config BUSYBOX_CONFIG_PARTPROBE - bool "partprobe" - default BUSYBOX_DEFAULT_PARTPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ask kernel to rescan partition table. -config BUSYBOX_CONFIG_RAIDAUTORUN - bool "raidautorun" - default BUSYBOX_DEFAULT_RAIDAUTORUN - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - raidautorun tells the kernel md driver to - search and start RAID arrays. -config BUSYBOX_CONFIG_READAHEAD - bool "readahead" - default BUSYBOX_DEFAULT_READAHEAD - depends on BUSYBOX_CONFIG_LFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Preload the files listed on the command line into RAM cache so that - subsequent reads on these files will not block on disk I/O. - - This applet just calls the readahead(2) system call on each file. - It is mainly useful in system startup scripts to preload files - or executables before they are used. When used at the right time - (in particular when a CPU bound process is running) it can - significantly speed up system startup. - - As readahead(2) blocks until each file has been read, it is best to - run this applet as a background job. config BUSYBOX_CONFIG_RFKILL bool "rfkill" default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04 @@ -582,48 +184,27 @@ config BUSYBOX_CONFIG_RFKILL rfkill list 1 : list device corresponding to the given index rfkill block|unblock wlan : block/unblock all wlan(wifi) devices -config BUSYBOX_CONFIG_RUNLEVEL - bool "runlevel" - default BUSYBOX_DEFAULT_RUNLEVEL - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - find the current and previous system runlevel. - - This applet uses utmp but does not rely on busybox supporing - utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. -config BUSYBOX_CONFIG_RX - bool "rx" - default BUSYBOX_DEFAULT_RX - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Receive files using the Xmodem protocol. config BUSYBOX_CONFIG_SETSERIAL bool "setserial" default BUSYBOX_DEFAULT_SETSERIAL select BUSYBOX_CONFIG_PLATFORM_LINUX help Retrieve or set Linux serial port. -config BUSYBOX_CONFIG_STRINGS - bool "strings" - default BUSYBOX_DEFAULT_STRINGS +config BUSYBOX_CONFIG_TASKSET + bool "taskset" + default BUSYBOX_DEFAULT_TASKSET # doesn't build on some non-x86 targets (m68k) help - strings prints the printable character sequences for each file - specified. -config BUSYBOX_CONFIG_TIME - bool "time" - default BUSYBOX_DEFAULT_TIME + Retrieve or set a processes's CPU affinity. + This requires sched_{g,s}etaffinity support in your libc. + +config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY + bool "Fancy output" + default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + depends on BUSYBOX_CONFIG_TASKSET help - The time command runs the specified program with the given arguments. - When the command finishes, time writes a message to standard output - giving timing statistics about this program run. -config BUSYBOX_CONFIG_TTYSIZE - bool "ttysize" - default BUSYBOX_DEFAULT_TTYSIZE - help - A replacement for "stty size". Unlike stty, can report only width, - only height, or both, in any order. It also does not complain on - error, but returns default 80x24. - Usage in shell scripts: width=`ttysize w`. + Add code for fancy output. This merely silences a compiler-warning + and adds about 135 Bytes. May be needed for machines with alot + of CPUs. config BUSYBOX_CONFIG_UBIATTACH bool "ubiattach" default BUSYBOX_DEFAULT_UBIATTACH @@ -671,11 +252,531 @@ config BUSYBOX_CONFIG_UBIRENAME select BUSYBOX_CONFIG_PLATFORM_LINUX help Utility to rename UBI volumes +config BUSYBOX_CONFIG_WALL + bool "wall" + default BUSYBOX_DEFAULT_WALL + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Write a message to all users that are logged in. + +config BUSYBOX_CONFIG_ADJTIMEX + bool "adjtimex" + default BUSYBOX_DEFAULT_ADJTIMEX + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Adjtimex reads and optionally sets adjustment parameters for + the Linux clock adjustment algorithm. + +config BUSYBOX_CONFIG_BBCONFIG + bool "bbconfig" + default BUSYBOX_DEFAULT_BBCONFIG + help + The bbconfig applet will print the config file with which + busybox was built. + +config BUSYBOX_CONFIG_FEATURE_COMPRESS_BBCONFIG + bool "Compress bbconfig data" + default BUSYBOX_DEFAULT_FEATURE_COMPRESS_BBCONFIG + depends on BUSYBOX_CONFIG_BBCONFIG + help + Store bbconfig data in compressed form, uncompress them on-the-fly + before output. + + If you have a really tiny busybox with few applets enabled (and + bunzip2 isn't one of them), the overhead of the decompressor might + be noticeable. Also, if you run executables directly from ROM + and have very little memory, this might not be a win. Otherwise, + you probably want this. + +config BUSYBOX_CONFIG_BEEP + bool "beep" + default BUSYBOX_DEFAULT_BEEP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The beep applets beeps in a given freq/Hz. + +config BUSYBOX_CONFIG_FEATURE_BEEP_FREQ + int "default frequency" + range 0 2147483647 + default BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ + depends on BUSYBOX_CONFIG_BEEP + help + Frequency for default beep. + +config BUSYBOX_CONFIG_FEATURE_BEEP_LENGTH_MS + int "default length" + range 0 2147483647 + default BUSYBOX_DEFAULT_FEATURE_BEEP_LENGTH_MS + depends on BUSYBOX_CONFIG_BEEP + help + Length in ms for default beep. + +config BUSYBOX_CONFIG_CHAT + bool "chat" + default BUSYBOX_DEFAULT_CHAT + help + Simple chat utility. + +config BUSYBOX_CONFIG_FEATURE_CHAT_NOFAIL + bool "Enable NOFAIL expect strings" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_NOFAIL + help + When enabled expect strings which are started with a dash trigger + no-fail mode. That is when expectation is not met within timeout + the script is not terminated but sends next SEND string and waits + for next EXPECT string. This allows to compose far more flexible + scripts. + +config BUSYBOX_CONFIG_FEATURE_CHAT_TTY_HIFI + bool "Force STDIN to be a TTY" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_TTY_HIFI + help + Original chat always treats STDIN as a TTY device and sets for it + so-called raw mode. This option turns on such behaviour. + +config BUSYBOX_CONFIG_FEATURE_CHAT_IMPLICIT_CR + bool "Enable implicit Carriage Return" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_IMPLICIT_CR + help + When enabled make chat to terminate all SEND strings with a "\r" + unless "\c" is met anywhere in the string. + +config BUSYBOX_CONFIG_FEATURE_CHAT_SWALLOW_OPTS + bool "Swallow options" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_SWALLOW_OPTS + help + Busybox chat require no options. To make it not fail when used + in place of original chat (which has a bunch of options) turn + this on. + +config BUSYBOX_CONFIG_FEATURE_CHAT_SEND_ESCAPES + bool "Support weird SEND escapes" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_SEND_ESCAPES + help + Original chat uses some escape sequences in SEND arguments which + are not sent to device but rather performs special actions. + E.g. "\K" means to send a break sequence to device. + "\d" delays execution for a second, "\p" -- for a 1/100 of second. + Before turning this option on think twice: do you really need them? + +config BUSYBOX_CONFIG_FEATURE_CHAT_VAR_ABORT_LEN + bool "Support variable-length ABORT conditions" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_VAR_ABORT_LEN + help + Original chat uses fixed 50-bytes length ABORT conditions. Say N here. + +config BUSYBOX_CONFIG_FEATURE_CHAT_CLR_ABORT + bool "Support revoking of ABORT conditions" + depends on BUSYBOX_CONFIG_CHAT + default BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT + help + Support CLR_ABORT directive. + +config BUSYBOX_CONFIG_CHRT + bool "chrt" + default BUSYBOX_DEFAULT_CHRT + help + manipulate real-time attributes of a process. + This requires sched_{g,s}etparam support in your libc. + +config BUSYBOX_CONFIG_CRONTAB + bool "crontab" + default BUSYBOX_DEFAULT_CRONTAB + help + Crontab manipulates the crontab for a particular user. Only + the superuser may specify a different user and/or crontab directory. + Note that Busybox binary must be setuid root for this applet to + work properly. + +config BUSYBOX_CONFIG_DC + bool "dc" + default BUSYBOX_DEFAULT_DC + help + Dc is a reverse-polish desk calculator which supports unlimited + precision arithmetic. + +config BUSYBOX_CONFIG_FEATURE_DC_LIBM + bool "Enable power and exp functions (requires libm)" + default BUSYBOX_DEFAULT_FEATURE_DC_LIBM + depends on BUSYBOX_CONFIG_DC + help + Enable power and exp functions. + NOTE: This will require libm to be present for linking. + +config BUSYBOX_CONFIG_DEVFSD + bool "devfsd (obsolete)" + default BUSYBOX_DEFAULT_DEVFSD + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + This is deprecated and should NOT be used anymore. + Use linux >= 2.6 (optionally with hotplug) and mdev instead! + See docs/mdev.txt for detailed instructions on how to use mdev + instead. + + Provides compatibility with old device names on a devfs systems. + You should set it to true if you have devfs enabled. + The following keywords in devsfd.conf are supported: + "CLEAR_CONFIG", "INCLUDE", "OPTIONAL_INCLUDE", "RESTORE", + "PERMISSIONS", "EXECUTE", "COPY", "IGNORE", + "MKOLDCOMPAT", "MKNEWCOMPAT","RMOLDCOMPAT", "RMNEWCOMPAT". + + But only if they are written UPPERCASE!!!!!!!! + +config BUSYBOX_CONFIG_DEVFSD_MODLOAD + bool "Adds support for MODLOAD keyword in devsfd.conf" + default BUSYBOX_DEFAULT_DEVFSD_MODLOAD + depends on BUSYBOX_CONFIG_DEVFSD + help + This actually doesn't work with busybox modutils but needs + the external modutils. + +config BUSYBOX_CONFIG_DEVFSD_FG_NP + bool "Enables the -fg and -np options" + default BUSYBOX_DEFAULT_DEVFSD_FG_NP + depends on BUSYBOX_CONFIG_DEVFSD + help + -fg Run the daemon in the foreground. + -np Exit after parsing the configuration file. + Do not poll for events. + +config BUSYBOX_CONFIG_DEVFSD_VERBOSE + bool "Increases logging (and size)" + default BUSYBOX_DEFAULT_DEVFSD_VERBOSE + depends on BUSYBOX_CONFIG_DEVFSD + help + Increases logging to stderr or syslog. + +config BUSYBOX_CONFIG_FEATURE_DEVFS + bool "Use devfs names for all devices (obsolete)" + default BUSYBOX_DEFAULT_FEATURE_DEVFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This is obsolete and should NOT be used anymore. + Use linux >= 2.6 (optionally with hotplug) and mdev instead! + + For legacy systems -- if there is no way around devfsd -- this + tells busybox to look for names like /dev/loop/0 instead of + /dev/loop0. If your /dev directory has normal names instead of + devfs names, you don't want this. + +config BUSYBOX_CONFIG_DEVMEM + bool "devmem" + default BUSYBOX_DEFAULT_DEVMEM + help + devmem is a small program that reads and writes from physical + memory using /dev/mem. + +config BUSYBOX_CONFIG_EJECT + bool "eject" + default BUSYBOX_DEFAULT_EJECT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Used to eject cdroms. (defaults to /dev/cdrom) + +config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI + bool "SCSI support" + default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI + depends on BUSYBOX_CONFIG_EJECT + help + Add the -s option to eject, this allows to eject SCSI-Devices and + usb-storage devices. + +config BUSYBOX_CONFIG_FBSPLASH + bool "fbsplash" + default BUSYBOX_DEFAULT_FBSPLASH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Shows splash image and progress bar on framebuffer device. + Can be used during boot phase of an embedded device. ~2kb. + Usage: + - use kernel option 'vga=xxx' or otherwise enable fb device. + - put somewhere fbsplash.cfg file and an image in .ppm format. + - $ setsid fbsplash [params] & + -c: hide cursor + -d /dev/fbN: framebuffer device (if not /dev/fb0) + -s path_to_image_file (can be "-" for stdin) + -i path_to_cfg_file (can be "-" for stdin) + -f path_to_fifo (can be "-" for stdin) + - if you want to run it only in presence of kernel parameter: + grep -q "fbsplash=on" = 2.6.13 + +config BUSYBOX_CONFIG_INOTIFYD + bool "inotifyd" + default BUSYBOX_DEFAULT_INOTIFYD # doesn't build on Knoppix 5 + help + Simple inotify daemon. Reports filesystem changes. Requires + kernel >= 2.6.13 + +config BUSYBOX_CONFIG_LAST + bool "last" + default BUSYBOX_DEFAULT_LAST + depends on BUSYBOX_CONFIG_FEATURE_WTMP + help + 'last' displays a list of the last users that logged into the system. + +config BUSYBOX_CONFIG_FEATURE_LAST_FANCY + bool "Turn on output of extra information" + default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY + depends on BUSYBOX_CONFIG_LAST + help + 'last' displays detailed information about the last users that + logged into the system (mimics sysvinit last). +900 bytes. + +config BUSYBOX_CONFIG_HDPARM + bool "hdparm" + default BUSYBOX_DEFAULT_HDPARM + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Get/Set hard drive parameters. Primarily intended for ATA + drives. Adds about 13k (or around 30k if you enable the + FEATURE_HDPARM_GET_IDENTITY option).... + +config BUSYBOX_CONFIG_FEATURE_HDPARM_GET_IDENTITY + bool "Support obtaining detailed information directly from drives" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_GET_IDENTITY + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the -I and -i options to obtain detailed information + directly from drives about their capabilities and supported ATA + feature set. If no device name is specified, hdparm will read + identify data from stdin. Enabling this option will add about 16k... + +config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF + bool "Register an IDE interface (DANGEROUS)" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_SCAN_HWIF + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the 'hdparm -R' option to register an IDE interface. + This is dangerous stuff, so you should probably say N. + +config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF + bool "Un-register an IDE interface (DANGEROUS)" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the 'hdparm -U' option to un-register an IDE interface. + This is dangerous stuff, so you should probably say N. + +config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET + bool "Perform device reset (DANGEROUS)" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_DRIVE_RESET + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the 'hdparm -w' option to perform a device reset. + This is dangerous stuff, so you should probably say N. + +config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF + bool "Tristate device for hotswap (DANGEROUS)" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the 'hdparm -x' option to tristate device for hotswap, + and the '-b' option to get/set bus state. This is dangerous + stuff, so you should probably say N. + +config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA + bool "Get/set using_dma flag" + default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA + depends on BUSYBOX_CONFIG_HDPARM + help + Enables the 'hdparm -d' option to get/set using_dma flag. + +config BUSYBOX_CONFIG_LOCK + bool "lock" + default BUSYBOX_DEFAULT_LOCK + help + Small utility for using locks in scripts + +config BUSYBOX_CONFIG_MAKEDEVS + bool "makedevs" + default BUSYBOX_DEFAULT_MAKEDEVS + help + 'makedevs' is a utility used to create a batch of devices with + one command. + + There are two choices for command line behaviour, the interface + as used by LEAF/Linux Router Project, or a device table file. + + 'leaf' is traditionally what busybox follows, it allows multiple + devices of a particluar type to be created per command. + e.g. /dev/hda[0-9] + Device properties are passed as command line arguments. + + 'table' reads device properties from a file or stdin, allowing + a batch of unrelated devices to be made with one command. + User/group names are allowed as an alternative to uid/gid. + +choice + prompt "Choose makedevs behaviour" + depends on BUSYBOX_CONFIG_MAKEDEVS + default BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE + +config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_LEAF + bool "leaf" + +config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE + bool "table" + +endchoice + +config BUSYBOX_CONFIG_MAN + bool "man" + default BUSYBOX_DEFAULT_MAN + help + Format and display manual pages. + +config BUSYBOX_CONFIG_MICROCOM + bool "microcom" + default BUSYBOX_DEFAULT_MICROCOM + help + The poor man's minicom utility for chatting with serial port devices. + +config BUSYBOX_CONFIG_MOUNTPOINT + bool "mountpoint" + default BUSYBOX_DEFAULT_MOUNTPOINT + help + mountpoint checks if the directory is a mountpoint. + +config BUSYBOX_CONFIG_MT + bool "mt" + default BUSYBOX_DEFAULT_MT + help + mt is used to control tape devices. You can use the mt utility + to advance or rewind a tape past a specified number of archive + files on the tape. + +config BUSYBOX_CONFIG_RAIDAUTORUN + bool "raidautorun" + default BUSYBOX_DEFAULT_RAIDAUTORUN + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + raidautorun tells the kernel md driver to + search and start RAID arrays. + +config BUSYBOX_CONFIG_READAHEAD + bool "readahead" + default BUSYBOX_DEFAULT_READAHEAD + depends on BUSYBOX_CONFIG_LFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Preload the files listed on the command line into RAM cache so that + subsequent reads on these files will not block on disk I/O. + + This applet just calls the readahead(2) system call on each file. + It is mainly useful in system startup scripts to preload files + or executables before they are used. When used at the right time + (in particular when a CPU bound process is running) it can + significantly speed up system startup. + + As readahead(2) blocks until each file has been read, it is best to + run this applet as a background job. + +config BUSYBOX_CONFIG_RUNLEVEL + bool "runlevel" + default BUSYBOX_DEFAULT_RUNLEVEL + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + find the current and previous system runlevel. + + This applet uses utmp but does not rely on busybox supporing + utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. + +config BUSYBOX_CONFIG_RX + bool "rx" + default BUSYBOX_DEFAULT_RX + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Receive files using the Xmodem protocol. + +config BUSYBOX_CONFIG_SETSID + bool "setsid" + default BUSYBOX_DEFAULT_SETSID + help + setsid runs a program in a new session + +config BUSYBOX_CONFIG_STRINGS + bool "strings" + default BUSYBOX_DEFAULT_STRINGS + help + strings prints the printable character sequences for each file + specified. + +config BUSYBOX_CONFIG_TIME + bool "time" + default BUSYBOX_DEFAULT_TIME + help + The time command runs the specified program with the given arguments. + When the command finishes, time writes a message to standard output + giving timing statistics about this program run. + +config BUSYBOX_CONFIG_TIMEOUT + bool "timeout" + default BUSYBOX_DEFAULT_TIMEOUT + help + Runs a program and watches it. If it does not terminate in + specified number of seconds, it is sent a signal. + +config BUSYBOX_CONFIG_TTYSIZE + bool "ttysize" + default BUSYBOX_DEFAULT_TTYSIZE + help + A replacement for "stty size". Unlike stty, can report only width, + only height, or both, in any order. It also does not complain on + error, but returns default 80x24. + Usage in shell scripts: width=`ttysize w`. + config BUSYBOX_CONFIG_VOLNAME bool "volname" default BUSYBOX_DEFAULT_VOLNAME help Prints a CD-ROM volume name. + config BUSYBOX_CONFIG_WATCHDOG bool "watchdog" default BUSYBOX_DEFAULT_WATCHDOG diff --git a/package/utils/busybox/config/modutils/Config.in b/package/utils/busybox/config/modutils/Config.in index 9791af65a..8e0e2af9e 100644 --- a/package/utils/busybox/config/modutils/Config.in +++ b/package/utils/busybox/config/modutils/Config.in @@ -6,14 +6,19 @@ menu "Linux Module Utilities" +config BUSYBOX_CONFIG_MODINFO + bool "modinfo" + default BUSYBOX_DEFAULT_MODINFO + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Show information about a Linux Kernel module + config BUSYBOX_CONFIG_MODPROBE_SMALL bool "Simplified modutils" default BUSYBOX_DEFAULT_MODPROBE_SMALL + select BUSYBOX_CONFIG_PLATFORM_LINUX help - Build smaller (~1.5 kbytes), simplified module tools. - - This option by itself does not enable any applets - - you need to select applets individually below. + Simplified modutils. With this option modprobe does not require modules.dep file and does not use /etc/modules.conf file. @@ -34,23 +39,46 @@ config BUSYBOX_CONFIG_MODPROBE_SMALL Additional module parameters can be stored in /etc/modules/$module_name files. -config BUSYBOX_CONFIG_DEPMOD - bool "depmod" - default BUSYBOX_DEFAULT_DEPMOD + Apart from modprobe, other utilities are also provided: + - insmod is an alias to modprobe + - rmmod is an alias to modprobe -r + - depmod generates modules.dep.bb + +config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE + bool "Accept module options on modprobe command line" + default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE + depends on BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help - depmod generates modules.dep (and potentially modules.alias - and modules.symbols) that contain dependency information - for modprobe. + Allow insmod and modprobe take module options from command line. + +config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + bool "Skip loading of already loaded modules" + default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + depends on BUSYBOX_CONFIG_MODPROBE_SMALL + help + Check if the module is already loaded. + config BUSYBOX_CONFIG_INSMOD bool "insmod" default BUSYBOX_DEFAULT_INSMOD + depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help insmod is used to load specified modules in the running kernel. + +config BUSYBOX_CONFIG_RMMOD + bool "rmmod" + default BUSYBOX_DEFAULT_RMMOD + depends on !BUSYBOX_CONFIG_MODPROBE_SMALL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + rmmod is used to unload specified modules from the kernel. + config BUSYBOX_CONFIG_LSMOD bool "lsmod" default BUSYBOX_DEFAULT_LSMOD + depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help lsmod is used to display a list of loaded modules. @@ -58,20 +86,17 @@ config BUSYBOX_CONFIG_LSMOD config BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool "Pretty output" default BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT - depends on BUSYBOX_CONFIG_LSMOD && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_LSMOD + select BUSYBOX_CONFIG_PLATFORM_LINUX help This option makes output format of lsmod adjusted to the format of module-init-tools for Linux kernel 2.6. Increases size somewhat. -config BUSYBOX_CONFIG_MODINFO - bool "modinfo" - default BUSYBOX_DEFAULT_MODINFO - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Show information about a Linux Kernel module + config BUSYBOX_CONFIG_MODPROBE bool "modprobe" default BUSYBOX_DEFAULT_MODPROBE + depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help Handle the loading of modules, and their dependencies on a high @@ -80,109 +105,42 @@ config BUSYBOX_CONFIG_MODPROBE config BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST bool "Blacklist support" default BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST - depends on BUSYBOX_CONFIG_MODPROBE && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_MODPROBE + select BUSYBOX_CONFIG_PLATFORM_LINUX help Say 'y' here to enable support for the 'blacklist' command in modprobe.conf. This prevents the alias resolver to resolve blacklisted modules. This is useful if you want to prevent your hardware autodetection scripts to load modules like evdev, frame buffer drivers etc. -config BUSYBOX_CONFIG_RMMOD - bool "rmmod" - default BUSYBOX_DEFAULT_RMMOD + +config BUSYBOX_CONFIG_DEPMOD + bool "depmod" + default BUSYBOX_DEFAULT_DEPMOD + depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help - rmmod is used to unload specified modules from the kernel. + depmod generates modules.dep (and potentially modules.alias + and modules.symbols) that contain dependency information + for modprobe. comment "Options common to multiple modutils" -config BUSYBOX_CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS - bool "Accept module options on modprobe command line" - default BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE - help - Allow insmod and modprobe take module options from the applets' - command line. - -config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - bool "Skip loading of already loaded modules" - default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - depends on BUSYBOX_CONFIG_MODPROBE_SMALL && (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - help - Check if the module is already loaded. - config BUSYBOX_CONFIG_FEATURE_2_4_MODULES bool "Support version 2.2/2.4 Linux kernels" default BUSYBOX_DEFAULT_FEATURE_2_4_MODULES - depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_RMMOD) && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_RMMOD || BUSYBOX_CONFIG_LSMOD + select BUSYBOX_CONFIG_PLATFORM_LINUX help Support module loading for 2.2.x and 2.4.x Linux kernels. This increases size considerably. Say N unless you plan to run ancient kernels. -config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING - bool "Enable module version checking" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - help - Support checking of versions for modules. This is used to - ensure that the kernel and module are made for each other. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - bool "Add module symbols to kernel symbol table" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - help - By adding module symbols to the kernel symbol table, Oops messages - occurring within kernel modules can be properly debugged. By enabling - this feature, module symbols will always be added to the kernel symbol - table for proper debugging support. If you are not interested in - Oops messages from kernel modules, say N. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM - bool "In kernel memory optimization (uClinux only)" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - help - This is a special uClinux only memory optimization that lets insmod - load the specified kernel module directly into kernel space, reducing - memory usage by preventing the need for two copies of the module - being loaded into memory. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP - bool "Enable insmod load map (-m) option" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD - help - Enabling this, one would be able to get a load map - output on stdout. This makes kernel module debugging - easier. - If you don't plan to debug kernel modules, you - don't need this option. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL - bool "Symbols in load map" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL - depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP - help - Without this option, -m will only output section - load map. With this option, -m will also output - symbols load map. - -config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE - bool "Support tainted module checking with new kernels" - default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE - depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL - help - Support checking for tainted modules. These are usually binary - only modules that will make the linux-kernel list ignore your - support request. - This option is required to support GPLONLY modules. - config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP bool "Try to load module from a mmap'ed area" default BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE_SMALL + select BUSYBOX_CONFIG_PLATFORM_LINUX help This option causes module loading code to try to mmap module first. If it does not work (for example, @@ -195,10 +153,76 @@ config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP Choosing N saves about 250 bytes of code (on 32-bit x86). +config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING + bool "Enable module version checking" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support checking of versions for modules. This is used to + ensure that the kernel and module are made for each other. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + bool "Add module symbols to kernel symbol table" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + By adding module symbols to the kernel symbol table, Oops messages + occuring within kernel modules can be properly debugged. By enabling + this feature, module symbols will always be added to the kernel symbol + table for proper debugging support. If you are not interested in + Oops messages from kernel modules, say N. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM + bool "In kernel memory optimization (uClinux only)" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This is a special uClinux only memory optimization that lets insmod + load the specified kernel module directly into kernel space, reducing + memory usage by preventing the need for two copies of the module + being loaded into memory. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP + bool "Enable insmod load map (-m) option" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Enabling this, one would be able to get a load map + output on stdout. This makes kernel module debugging + easier. + If you don't plan to debug kernel modules, you + don't need this option. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL + bool "Symbols in load map" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL + depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP && !BUSYBOX_CONFIG_MODPROBE_SMALL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Without this option, -m will only output section + load map. With this option, -m will also output + symbols load map. + +config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE + bool "Support tainted module checking with new kernels" + default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE + depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support checking for tainted modules. These are usually binary + only modules that will make the linux-kernel list ignore your + support request. + This option is required to support GPLONLY modules. + config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS - bool "Support module.aliases file" + bool "Support for module.aliases file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS - depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE + select BUSYBOX_CONFIG_PLATFORM_LINUX help Generate and parse modules.alias containing aliases for bus identifiers: @@ -212,9 +236,10 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS Say Y if unsure. config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS - bool "Support module.symbols file" + bool "Support for module.symbols file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_SYMBOLS - depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE + select BUSYBOX_CONFIG_PLATFORM_LINUX help Generate and parse modules.symbols containing aliases for symbol_request() kernel calls, such as: @@ -225,7 +250,7 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR string "Default directory containing modules" default BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO help Directory that contains kernel modules. Defaults to "/lib/modules" @@ -233,13 +258,9 @@ config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR config BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE string "Default name of modules.dep" default BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO help Filename that contains kernel modules dependencies. - Defaults to "modules.dep". - If you configured the "simplified modutils" (MODPROBE_SMALL), a - ".bb" suffix will be added after this name. Do not specify ".bb" - here unless you intend your depmod or modprobe to work on - "modules.dep.bb.bb" or such. + Defaults to "modules.dep" endmenu diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index 2d2a1c4a9..e58746bdd 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -6,602 +6,6 @@ menu "Networking Utilities" -config BUSYBOX_CONFIG_FEATURE_IPV6 - bool "Enable IPv6 support" - default BUSYBOX_DEFAULT_FEATURE_IPV6 - help - Enable IPv6 support in busybox. - This adds IPv6 support in the networking applets. - -config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL - bool "Enable Unix domain socket support (usually not needed)" - default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL - help - Enable Unix domain socket support in all busybox networking - applets. Address of the form local:/path/to/unix/socket - will be recognized. - - This extension is almost never used in real world usage. - You most likely want to say N. - -config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS - bool "Prefer IPv4 addresses from DNS queries" - default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS - depends on BUSYBOX_CONFIG_FEATURE_IPV6 - help - Use IPv4 address of network host if it has one. - - If this option is off, the first returned address will be used. - This may cause problems when your DNS server is IPv6-capable and - is returning IPv6 host addresses too. If IPv6 address - precedes IPv4 one in DNS reply, busybox network applets - (e.g. wget) will use IPv6 address. On an IPv6-incapable host - or network applets will fail to connect to the host - using IPv6 address. - -config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS - bool "Verbose resolution errors" - default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS - help - Enable if you are not satisfied with simplistic - "can't resolve 'hostname.com'" and want to know more. - This may increase size of your executable a bit. - -config BUSYBOX_CONFIG_ARP - bool "arp" - default BUSYBOX_DEFAULT_ARP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manipulate the system ARP cache. -config BUSYBOX_CONFIG_ARPING - bool "arping" - default BUSYBOX_DEFAULT_ARPING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ping hosts by ARP packets. - -config BUSYBOX_CONFIG_BRCTL - bool "brctl" - default BUSYBOX_DEFAULT_BRCTL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manage ethernet bridges. - Supports addbr/delbr and addif/delif. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - bool "Fancy options" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY - depends on BUSYBOX_CONFIG_BRCTL - help - Add support for extended option like: - setageing, setfd, sethello, setmaxage, - setpathcost, setportprio, setbridgeprio, - stp - This adds about 600 bytes. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW - bool "Support show" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW - depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - help - Add support for option which prints the current config: - show -config BUSYBOX_CONFIG_DNSD - bool "dnsd" - default BUSYBOX_DEFAULT_DNSD - help - Small and static DNS server daemon. -config BUSYBOX_CONFIG_ETHER_WAKE - bool "ether-wake" - default BUSYBOX_DEFAULT_ETHER_WAKE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Send a magic packet to wake up sleeping machines. -config BUSYBOX_CONFIG_FTPD - bool "ftpd" - default BUSYBOX_DEFAULT_FTPD - help - Simple FTP daemon. You have to run it via inetd. - -config BUSYBOX_CONFIG_FEATURE_FTPD_WRITE - bool "Enable upload commands" - default BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE - depends on BUSYBOX_CONFIG_FTPD - help - Enable all kinds of FTP upload commands (-w option) - -config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST - bool "Enable workaround for RFC-violating clients" - default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST - depends on BUSYBOX_CONFIG_FTPD - help - Some ftp clients (among them KDE's Konqueror) issue illegal - "LIST -l" requests. This option works around such problems. - It might prevent you from listing files starting with "-" and - it increases the code size by ~40 bytes. - Most other ftp servers seem to behave similar to this. - -config BUSYBOX_CONFIG_FEATURE_FTPD_AUTHENTICATION - bool "Enable authentication" - default BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION - depends on BUSYBOX_CONFIG_FTPD - help - Enable basic system login as seen in telnet etc. -config BUSYBOX_CONFIG_FTPGET - bool "ftpget" - default BUSYBOX_DEFAULT_FTPGET - help - Retrieve a remote file via FTP. - -config BUSYBOX_CONFIG_FTPPUT - bool "ftpput" - default BUSYBOX_DEFAULT_FTPPUT - help - Store a remote file via FTP. - -config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS - bool "Enable long options in ftpget/ftpput" - default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS - depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) -config BUSYBOX_CONFIG_HOSTNAME - bool "hostname" - default BUSYBOX_DEFAULT_HOSTNAME - help - Show or set the system's host name. - -config BUSYBOX_CONFIG_DNSDOMAINNAME - bool "dnsdomainname" - default BUSYBOX_DEFAULT_DNSDOMAINNAME - help - Alias to "hostname -d". -config BUSYBOX_CONFIG_HTTPD - bool "httpd" - default BUSYBOX_DEFAULT_HTTPD - help - HTTP server. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES - bool "Support 'Ranges:' header" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd emit "Accept-Ranges: bytes" header and understand - "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted - downloads, seeking in multimedia players etc. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID - bool "Enable -u option" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows the server to run as a specific user - rather than defaulting to the user that starts the server. - Use of this option requires special privileges to change to a - different user. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - bool "Enable Basic http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH - depends on BUSYBOX_CONFIG_HTTPD - help - Utilizes password settings from /etc/httpd.conf for basic - authentication on a per url basis. - Example for httpd.conf file: - /adm:toor:PaSsWd - -config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 - bool "Support MD5 crypted passwords for http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - help - Enables encrypted passwords, and wildcard user/passwords - in httpd.conf file. - User '*' means 'any system user name is ok', - password of '*' means 'use system password for this user' - Examples: - /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 - /adm:root:* - /wiki:*:* - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - bool "Support Common Gateway Interface (CGI)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows scripts and executables to be invoked - when specific URLs are requested. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - bool "Support running scripts through an interpreter" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - This option enables support for running scripts through an - interpreter. Turn this on if you want PHP scripts to work - properly. You need to supply an additional line in your - httpd.conf file: - *.php:/path/to/your/php - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - bool "Set REMOTE_PORT environment variable for CGI" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - Use of this option can assist scripts in generating - references that contain a unique port number. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR - bool "Enable -e option (useful for CGIs written as shell scripts)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows html encoding of arbitrary strings for display - by the browser. Output goes to stdout. - For example, httpd -e "" produces - "<Hello World>". - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES - bool "Support custom error pages" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define custom error pages in - the configuration file instead of the default HTTP status - error pages. For instance, if you add the line: - E404:/path/e404.html - in the config file, the server will respond the specified - '/path/e404.html' file instead of the terse '404 NOT FOUND' - message. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY - bool "Support reverse proxy" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define URLs that will be forwarded - to another HTTP server. To setup add the following line to the - configuration file - P:/url/:http://hostname[:port]/new/path/ - Then a request to /url/myfile will be forwarded to - http://hostname[:port]/new/path/myfile. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP - bool "Support GZIP content encoding" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd send files using GZIP content encoding if the - client supports it and a pre-compressed .gz exists. -config BUSYBOX_CONFIG_IFCONFIG - bool "ifconfig" - default BUSYBOX_DEFAULT_IFCONFIG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ifconfig is used to configure the kernel-resident network interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS - bool "Enable status reporting output (+7k)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - If ifconfig is called with no arguments it will display the status - of the currently active interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP - bool "Enable slip-specific options \"keepalive\" and \"outfill\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow "keepalive" and "outfill" support for SLIP. If you're not - planning on using serial lines, leave this unchecked. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow the start address for shared memory, start address for I/O, - and/or the interrupt line used by the specified device. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW - bool "Enable option \"hw\" (ether only)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW - depends on BUSYBOX_CONFIG_IFCONFIG - help - Set the hardware address of this interface, if the device driver - supports this operation. Currently, we only support the 'ether' - class. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS - bool "Set the broadcast automatically" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - Setting this will make ifconfig attempt to find the broadcast - automatically if the value '+' is used. -config BUSYBOX_CONFIG_IFENSLAVE - bool "ifenslave" - default BUSYBOX_DEFAULT_IFENSLAVE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Userspace application to bind several interfaces - to a logical interface (use with kernel bonding driver). -config BUSYBOX_CONFIG_IFPLUGD - bool "ifplugd" - default BUSYBOX_DEFAULT_IFPLUGD - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Network interface plug detection daemon. -config BUSYBOX_CONFIG_IFUP - bool "ifup" - default BUSYBOX_DEFAULT_IFUP - help - Activate the specified interfaces. This applet makes use - of either "ifconfig" and "route" or the "ip" command to actually - configure network interfaces. Therefore, you will probably also want - to enable either IFCONFIG and ROUTE, or enable - FEATURE_IFUPDOWN_IP and the various IP options. Of - course you could use non-busybox versions of these programs, so - against my better judgement (since this will surely result in plenty - of support questions on the mailing list), I do not force you to - enable these additional options. It is up to you to supply either - "ifconfig", "route" and "run-parts" or the "ip" command, either - via busybox or via standalone utilities. - -config BUSYBOX_CONFIG_IFDOWN - bool "ifdown" - default BUSYBOX_DEFAULT_IFDOWN - help - Deactivate the specified interfaces. - -config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH - string "Absolute path to ifstate file" - default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - ifupdown keeps state information in a file called ifstate. - Typically it is located in /var/run/ifstate, however - some distributions tend to put it in other places - (debian, for example, uses /etc/network/run/ifstate). - This config option defines location of ifstate. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - bool "Use ip tool (else ifconfig/route is used)" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - Use the iproute "ip" command to implement "ifup" and "ifdown", rather - than the default of using the older "ifconfig" and "route" utilities. - - If Y: you must install either the full-blown iproute2 package - or enable "ip" applet in Busybox, or the "ifup" and "ifdown" applets - will not work. - - If N: you must install either the full-blown ifconfig and route - utilities, or enable these applets in Busybox. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 - bool "Support IPv4" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - If you want ifup/ifdown to talk IPv4, leave this on. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 - bool "Support IPv6" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 - depends on (BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN) && BUSYBOX_CONFIG_FEATURE_IPV6 - help - If you need support for IPv6, turn this option on. - - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING - bool "Enable mapping support" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - This enables support for the "mapping" stanza, unless you have - a weird network setup you don't need it. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP - bool "Support external DHCP clients" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - This enables support for the external dhcp clients. Clients are - tried in the following order: dhcpcd, dhclient, pump and udhcpc. - Otherwise, if udhcpc applet is enabled, it is used. - Otherwise, ifup/ifdown will have no support for DHCP. -config BUSYBOX_CONFIG_INETD - bool "inetd" - default BUSYBOX_DEFAULT_INETD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - Internet superserver daemon - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - bool "Support echo service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - depends on BUSYBOX_CONFIG_INETD - help - Echo received data internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - bool "Support discard service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - depends on BUSYBOX_CONFIG_INETD - help - Internet /dev/null internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME - bool "Support time service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME - depends on BUSYBOX_CONFIG_INETD - help - Return 32 bit time since 1900 internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - bool "Support daytime service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - depends on BUSYBOX_CONFIG_INETD - help - Return human-readable time internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - bool "Support chargen service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - depends on BUSYBOX_CONFIG_INETD - help - Familiar character generator internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_RPC - bool "Support RPC services" - default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc - depends on BUSYBOX_CONFIG_INETD - select BUSYBOX_CONFIG_FEATURE_HAVE_RPC - help - Support Sun-RPC based services -config BUSYBOX_CONFIG_IP - bool "ip" - default BUSYBOX_DEFAULT_IP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The "ip" applet is a TCP/IP interface configuration and routing - utility. You generally don't need "ip" to use busybox with - TCP/IP. - -config BUSYBOX_CONFIG_IPADDR - bool "ipaddr" - default BUSYBOX_DEFAULT_IPADDR - select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip addr: ipaddr - -config BUSYBOX_CONFIG_IPLINK - bool "iplink" - default BUSYBOX_DEFAULT_IPLINK - select BUSYBOX_CONFIG_FEATURE_IP_LINK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip link: iplink - -config BUSYBOX_CONFIG_IPROUTE - bool "iproute" - default BUSYBOX_DEFAULT_IPROUTE - select BUSYBOX_CONFIG_FEATURE_IP_ROUTE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip route: iproute - -config BUSYBOX_CONFIG_IPTUNNEL - bool "iptunnel" - default BUSYBOX_DEFAULT_IPTUNNEL - select BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip tunnel: iptunnel - -config BUSYBOX_CONFIG_IPRULE - bool "iprule" - default BUSYBOX_DEFAULT_IPRULE - select BUSYBOX_CONFIG_FEATURE_IP_RULE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip rule: iprule - -config BUSYBOX_CONFIG_IPNEIGH - bool "ipneigh" - default BUSYBOX_DEFAULT_IPNEIGH - select BUSYBOX_CONFIG_FEATURE_IP_NEIGH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support short form of ip neigh: ipneigh - -config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - bool "ip address" - default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR - help - Address manipulation support for the "ip" applet. - -config BUSYBOX_CONFIG_FEATURE_IP_LINK - bool "ip link" - default BUSYBOX_DEFAULT_FEATURE_IP_LINK - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPLINK - help - Configure network devices with "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE - bool "ip route" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPROUTE - help - Add support for routing table management to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR - string "ip route configuration directory" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR - depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE - help - Location of the "ip" applet routing configuration. - -config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - bool "ip tunnel" - default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPTUNNEL - help - Add support for tunneling commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_RULE - bool "ip rule" - default BUSYBOX_DEFAULT_FEATURE_IP_RULE - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPRULE - help - Add support for rule commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_NEIGH - bool "ip neighbor" - default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPNEIGH - help - Add support for neighbor commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS - bool "Support displaying rarely used link types" - default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS - depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR || BUSYBOX_CONFIG_IPLINK || BUSYBOX_CONFIG_IPROUTE || BUSYBOX_CONFIG_IPTUNNEL || BUSYBOX_CONFIG_IPRULE || BUSYBOX_CONFIG_IPNEIGH - help - If you are not going to use links of type "frad", "econet", - "bif" etc, you probably don't need to enable this. - Ethernet, wireless, infrared, ppp/slip, ip tunnelling - link types are supported without this option selected. -config BUSYBOX_CONFIG_IPCALC - bool "ipcalc" - default BUSYBOX_DEFAULT_IPCALC - help - ipcalc takes an IP address and netmask and calculates the - resulting broadcast, network, and host range. - -config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS - depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS - -config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY - bool "Fancy IPCALC, more options, adds 1 kbyte" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY - depends on BUSYBOX_CONFIG_IPCALC - help - Adds the options hostname, prefix and silent to the output of - "ipcalc". -config BUSYBOX_CONFIG_FAKEIDENTD - bool "fakeidentd" - default BUSYBOX_DEFAULT_FAKEIDENTD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - fakeidentd listens on the ident port and returns a predefined - fake value on any query. config BUSYBOX_CONFIG_NAMEIF bool "nameif" default BUSYBOX_DEFAULT_NAMEIF @@ -668,11 +72,755 @@ config BUSYBOX_CONFIG_NC_110_COMPAT The code is about 2.5k bigger. It enables -s ADDR, -n, -u, -v, -o FILE, -z options, but loses busybox-specific extensions: -f FILE. +config BUSYBOX_CONFIG_PING + bool "ping" + default BUSYBOX_DEFAULT_PING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to + elicit an ICMP ECHO_RESPONSE from a host or gateway. + +config BUSYBOX_CONFIG_PING6 + bool "ping6" + default BUSYBOX_DEFAULT_PING6 + depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_PING + help + This will give you a ping that can talk IPv6. + +config BUSYBOX_CONFIG_FEATURE_FANCY_PING + bool "Enable fancy ping output" + default BUSYBOX_DEFAULT_FEATURE_FANCY_PING + depends on BUSYBOX_CONFIG_PING + help + Make the output from the ping applet include statistics, and at the + same time provide full support for ICMP packets. +config BUSYBOX_CONFIG_WGET + bool "wget" + default BUSYBOX_DEFAULT_WGET + help + wget is a utility for non-interactive download of files from HTTP + and FTP servers. + +config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR + bool "Enable a nifty process meter (+2k)" + default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + depends on BUSYBOX_CONFIG_WGET + help + Enable the transfer progress bar for wget transfers. + +config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION + bool "Enable HTTP authentication" + default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + depends on BUSYBOX_CONFIG_WGET + help + Support authenticated HTTP transfers. + +config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the wget applet. + +config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT + bool "Enable timeout option -T SEC" + default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + depends on BUSYBOX_CONFIG_WGET + help + Supports network read and connect timeouts for wget, + so that wget will give up and timeout, through the -T + command line option. + + Currently only connect and network data read timeout are + supported (i.e., timeout is not applied to the DNS query). When + FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option + will work in addition to -T. + +config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL + bool "Try to connect to HTTPS using openssl" + default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + depends on BUSYBOX_CONFIG_WGET + help + Choose how wget establishes SSL connection for https:// URLs. + + Busybox itself contains no SSL code. wget will spawn + a helper program to talk over HTTPS. + + OpenSSL has a simple SSL client for debug purposes. + If you select "openssl" helper, wget will effectively call + "openssl s_client -quiet -connect IP:443 2>/dev/null" + and pipe its data through it. + Note inconvenient API: host resolution is done twice, + and there is no guarantee openssl's idea of IPv6 address + format is the same as ours. + Another problem is that s_client prints debug information + to stderr, and it needs to be suppressed. This means + all error messages get suppressed too. + openssl is also a big binary, often dynamically linked + against ~15 libraries. + +config BUSYBOX_CONFIG_FEATURE_WGET_SSL_HELPER + bool "Try to connect to HTTPS using ssl_helper" + default BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER + depends on BUSYBOX_CONFIG_WGET + help + Choose how wget establishes SSL connection for https:// URLs. + + Busybox itself contains no SSL code. wget will spawn + a helper program to talk over HTTPS. + + ssl_helper is a tool which can be built statically + from busybox sources against a small embedded SSL library. + Please see networking/ssl_helper/README. + It does not require double host resolution and emits + error messages to stderr. + + Precompiled static binary may be available at + http://busybox.net/downloads/binaries/ +config BUSYBOX_CONFIG_WHOIS + bool "whois" + default BUSYBOX_DEFAULT_WHOIS + help + whois is a client for the whois directory service + +config BUSYBOX_CONFIG_FEATURE_IPV6 + bool "Enable IPv6 support" + default BUSYBOX_DEFAULT_FEATURE_IPV6 + help + Enable IPv6 support in busybox. + This adds IPv6 support in the networking applets. + +config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL + bool "Enable Unix domain socket support (usually not needed)" + default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL + help + Enable Unix domain socket support in all busybox networking + applets. Address of the form local:/path/to/unix/socket + will be recognized. + + This extension is almost never used in real world usage. + You most likely want to say N. + +config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS + bool "Prefer IPv4 addresses from DNS queries" + default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS + depends on BUSYBOX_CONFIG_FEATURE_IPV6 + help + Use IPv4 address of network host if it has one. + + If this option is off, the first returned address will be used. + This may cause problems when your DNS server is IPv6-capable and + is returning IPv6 host addresses too. If IPv6 address + precedes IPv4 one in DNS reply, busybox network applets + (e.g. wget) will use IPv6 address. On an IPv6-incapable host + or network applets will fail to connect to the host + using IPv6 address. + +config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS + bool "Verbose resolution errors" + default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS + help + Enable if you are not satisfied with simplistic + "can't resolve 'hostname.com'" and want to know more. + This may increase size of your executable a bit. + +config BUSYBOX_CONFIG_ARP + bool "arp" + default BUSYBOX_DEFAULT_ARP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manipulate the system ARP cache. + +config BUSYBOX_CONFIG_ARPING + bool "arping" + default BUSYBOX_DEFAULT_ARPING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ping hosts by ARP packets. + +config BUSYBOX_CONFIG_BRCTL + bool "brctl" + default BUSYBOX_DEFAULT_BRCTL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manage ethernet bridges. + Supports addbr/delbr and addif/delif. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + bool "Fancy options" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY + depends on BUSYBOX_CONFIG_BRCTL + help + Add support for extended option like: + setageing, setfd, sethello, setmaxage, + setpathcost, setportprio, setbridgeprio, + stp + This adds about 600 bytes. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW + bool "Support show" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW + depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + help + Add support for option which prints the current config: + show + +config BUSYBOX_CONFIG_DNSD + bool "dnsd" + default BUSYBOX_DEFAULT_DNSD + help + Small and static DNS server daemon. + +config BUSYBOX_CONFIG_ETHER_WAKE + bool "ether-wake" + default BUSYBOX_DEFAULT_ETHER_WAKE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Send a magic packet to wake up sleeping machines. + +config BUSYBOX_CONFIG_FAKEIDENTD + bool "fakeidentd" + default BUSYBOX_DEFAULT_FAKEIDENTD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + fakeidentd listens on the ident port and returns a predefined + fake value on any query. + +config BUSYBOX_CONFIG_FTPD + bool "ftpd" + default BUSYBOX_DEFAULT_FTPD + help + simple FTP daemon. You have to run it via inetd. + +config BUSYBOX_CONFIG_FEATURE_FTP_WRITE + bool "Enable upload commands" + default BUSYBOX_DEFAULT_FEATURE_FTP_WRITE + depends on BUSYBOX_CONFIG_FTPD + help + Enable all kinds of FTP upload commands (-w option) + +config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST + bool "Enable workaround for RFC-violating clients" + default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST + depends on BUSYBOX_CONFIG_FTPD + help + Some ftp clients (among them KDE's Konqueror) issue illegal + "LIST -l" requests. This option works around such problems. + It might prevent you from listing files starting with "-" and + it increases the code size by ~40 bytes. + Most other ftp servers seem to behave similar to this. + +config BUSYBOX_CONFIG_FEATURE_FTP_AUTHENTICATION + bool "Enable authentication" + default BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION + depends on BUSYBOX_CONFIG_FTPD + help + Enable basic system login as seen in telnet etc. + +config BUSYBOX_CONFIG_FTPGET + bool "ftpget" + default BUSYBOX_DEFAULT_FTPGET + help + Retrieve a remote file via FTP. + +config BUSYBOX_CONFIG_FTPPUT + bool "ftpput" + default BUSYBOX_DEFAULT_FTPPUT + help + Store a remote file via FTP. + +config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS + bool "Enable long options in ftpget/ftpput" + default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) + help + Support long options for the ftpget/ftpput applet. + +config BUSYBOX_CONFIG_HOSTNAME + bool "hostname" + default BUSYBOX_DEFAULT_HOSTNAME + help + Show or set the system's host name. + +config BUSYBOX_CONFIG_HTTPD + bool "httpd" + default BUSYBOX_DEFAULT_HTTPD + help + Serve web pages via an HTTP server. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES + bool "Support 'Ranges:' header" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd emit "Accept-Ranges: bytes" header and understand + "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted + downloads, seeking in multimedia players etc. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID + bool "Enable -u option" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows the server to run as a specific user + rather than defaulting to the user that starts the server. + Use of this option requires special privileges to change to a + different user. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + bool "Enable Basic http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH + depends on BUSYBOX_CONFIG_HTTPD + help + Utilizes password settings from /etc/httpd.conf for basic + authentication on a per url basis. + Example for httpd.conf file: + /adm:toor:PaSsWd + +config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 + bool "Support MD5 crypted passwords for http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + help + Enables encrypted passwords, and wildcard user/passwords + in httpd.conf file. + User '*' means 'any system user name is ok', + password of '*' means 'use system password for this user' + Examples: + /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 + /adm:root:* + /wiki:*:* + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + bool "Support Common Gateway Interface (CGI)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows scripts and executables to be invoked + when specific URLs are requested. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + bool "Support for running scripts through an interpreter" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + This option enables support for running scripts through an + interpreter. Turn this on if you want PHP scripts to work + properly. You need to supply an additional line in your + httpd.conf file: + *.php:/path/to/your/php + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + bool "Set REMOTE_PORT environment variable for CGI" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + Use of this option can assist scripts in generating + references that contain a unique port number. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR + bool "Enable -e option (useful for CGIs written as shell scripts)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows html encoding of arbitrary strings for display + by the browser. Output goes to stdout. + For example, httpd -e "" produces + "<Hello World>". + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES + bool "Support for custom error pages" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define custom error pages in + the configuration file instead of the default HTTP status + error pages. For instance, if you add the line: + E404:/path/e404.html + in the config file, the server will respond the specified + '/path/e404.html' file instead of the terse '404 NOT FOUND' + message. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY + bool "Support for reverse proxy" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define URLs that will be forwarded + to another HTTP server. To setup add the following line to the + configuration file + P:/url/:http://hostname[:port]/new/path/ + Then a request to /url/myfile will be forwarded to + http://hostname[:port]/new/path/myfile. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP + bool "Support for GZIP content encoding" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd send files using GZIP content encoding if the + client supports it and a pre-compressed .gz exists. + +config BUSYBOX_CONFIG_IFCONFIG + bool "ifconfig" + default BUSYBOX_DEFAULT_IFCONFIG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ifconfig is used to configure the kernel-resident network interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS + bool "Enable status reporting output (+7k)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + If ifconfig is called with no arguments it will display the status + of the currently active interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP + bool "Enable slip-specific options \"keepalive\" and \"outfill\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow "keepalive" and "outfill" support for SLIP. If you're not + planning on using serial lines, leave this unchecked. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow the start address for shared memory, start address for I/O, + and/or the interrupt line used by the specified device. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW + bool "Enable option \"hw\" (ether only)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW + depends on BUSYBOX_CONFIG_IFCONFIG + help + Set the hardware address of this interface, if the device driver + supports this operation. Currently, we only support the 'ether' + class. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS + bool "Set the broadcast automatically" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + Setting this will make ifconfig attempt to find the broadcast + automatically if the value '+' is used. + +config BUSYBOX_CONFIG_IFENSLAVE + bool "ifenslave" + default BUSYBOX_DEFAULT_IFENSLAVE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Userspace application to bind several interfaces + to a logical interface (use with kernel bonding driver). + +config BUSYBOX_CONFIG_IFPLUGD + bool "ifplugd" + default BUSYBOX_DEFAULT_IFPLUGD + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Network interface plug detection daemon. + +config BUSYBOX_CONFIG_IFUPDOWN + bool "ifupdown" + default BUSYBOX_DEFAULT_IFUPDOWN + help + Activate or deactivate the specified interfaces. This applet makes + use of either "ifconfig" and "route" or the "ip" command to actually + configure network interfaces. Therefore, you will probably also want + to enable either IFCONFIG and ROUTE, or enable + FEATURE_IFUPDOWN_IP and the various IP options. Of + course you could use non-busybox versions of these programs, so + against my better judgement (since this will surely result in plenty + of support questions on the mailing list), I do not force you to + enable these additional options. It is up to you to supply either + "ifconfig", "route" and "run-parts" or the "ip" command, either + via busybox or via standalone utilities. + +config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH + string "Absolute path to ifstate file" + default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH + depends on BUSYBOX_CONFIG_IFUPDOWN + help + ifupdown keeps state information in a file called ifstate. + Typically it is located in /var/run/ifstate, however + some distributions tend to put it in other places + (debian, for example, uses /etc/network/run/ifstate). + This config option defines location of ifstate. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP + bool "Use ip applet" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP + depends on BUSYBOX_CONFIG_IFUPDOWN + help + Use the iproute "ip" command to implement "ifup" and "ifdown", rather + than the default of using the older 'ifconfig' and 'route' utilities. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN + bool "Use busybox ip applet" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN + depends on BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_IP + select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + select BUSYBOX_CONFIG_FEATURE_IP_LINK + select BUSYBOX_CONFIG_FEATURE_IP_ROUTE + help + Use the busybox iproute "ip" applet to implement "ifupdown". + + If left disabled, you must install the full-blown iproute2 + utility or the "ifup" and "ifdown" applets will not work. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN + bool "Use busybox ifconfig and route applets" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN + depends on BUSYBOX_CONFIG_IFUPDOWN && !BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP + select BUSYBOX_CONFIG_IFCONFIG + select BUSYBOX_CONFIG_ROUTE + help + Use the busybox iproute "ifconfig" and "route" applets to + implement the "ifup" and "ifdown" utilities. + + If left disabled, you must install the full-blown ifconfig + and route utilities, or the "ifup" and "ifdown" applets will not + work. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 + bool "Support for IPv4" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 + depends on BUSYBOX_CONFIG_IFUPDOWN + help + If you want ifup/ifdown to talk IPv4, leave this on. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 + bool "Support for IPv6" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 + depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_FEATURE_IPV6 + help + If you need support for IPv6, turn this option on. + +### UNUSED +###config FEATURE_IFUPDOWN_IPX +### bool "Support for IPX" +### default y +### depends on IFUPDOWN +### help +### If this option is selected you can use busybox to work with IPX +### networks. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING + bool "Enable mapping support" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING + depends on BUSYBOX_CONFIG_IFUPDOWN + help + This enables support for the "mapping" stanza, unless you have + a weird network setup you don't need it. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP + bool "Support for external dhcp clients" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP + depends on BUSYBOX_CONFIG_IFUPDOWN + help + This enables support for the external dhcp clients. Clients are + tried in the following order: dhcpcd, dhclient, pump and udhcpc. + Otherwise, if udhcpc applet is enabled, it is used. + Otherwise, ifup/ifdown will have no support for DHCP. + +config BUSYBOX_CONFIG_INETD + bool "inetd" + default BUSYBOX_DEFAULT_INETD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + Internet superserver daemon + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + bool "Support echo service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + depends on BUSYBOX_CONFIG_INETD + help + Echo received data internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + bool "Support discard service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + depends on BUSYBOX_CONFIG_INETD + help + Internet /dev/null internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME + bool "Support time service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME + depends on BUSYBOX_CONFIG_INETD + help + Return 32 bit time since 1900 internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + bool "Support daytime service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + depends on BUSYBOX_CONFIG_INETD + help + Return human-readable time internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + bool "Support chargen service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + depends on BUSYBOX_CONFIG_INETD + help + Familiar character generator internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_RPC + bool "Support RPC services" + default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc + depends on BUSYBOX_CONFIG_INETD + select BUSYBOX_CONFIG_FEATURE_HAVE_RPC + help + Support Sun-RPC based services + +config BUSYBOX_CONFIG_IP + bool "ip" + default BUSYBOX_DEFAULT_IP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The "ip" applet is a TCP/IP interface configuration and routing + utility. You generally don't need "ip" to use busybox with + TCP/IP. + +config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + bool "ip address" + default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS + depends on BUSYBOX_CONFIG_IP + help + Address manipulation support for the "ip" applet. + +config BUSYBOX_CONFIG_FEATURE_IP_LINK + bool "ip link" + default BUSYBOX_DEFAULT_FEATURE_IP_LINK + depends on BUSYBOX_CONFIG_IP + help + Configure network devices with "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE + bool "ip route" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE + depends on BUSYBOX_CONFIG_IP + help + Add support for routing table management to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR + string "ip route configuration directory" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR + depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE + help + Location of the "ip" applet routing configuration. + +config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + bool "ip tunnel" + default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL + depends on BUSYBOX_CONFIG_IP + help + Add support for tunneling commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_RULE + bool "ip rule" + default BUSYBOX_DEFAULT_FEATURE_IP_RULE + depends on BUSYBOX_CONFIG_IP + help + Add support for rule commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_NEIGH + bool "ip neighbor" + default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH + depends on BUSYBOX_CONFIG_IP + help + Add support for neighbor commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS + bool "Support short forms of ip commands" + default BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS + depends on BUSYBOX_CONFIG_IP + help + Also support short-form of ip commands: + ip addr -> ipaddr + ip link -> iplink + ip route -> iproute + ip tunnel -> iptunnel + ip rule -> iprule + ip neigh -> ipneigh + + Say N unless you desparately need the short form of the ip + object commands. + +config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS + bool "Support displaying rarely used link types" + default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS + depends on BUSYBOX_CONFIG_IP + help + If you are not going to use links of type "frad", "econet", + "bif" etc, you probably don't need to enable this. + Ethernet, wireless, infrared, ppp/slip, ip tunnelling + link types are supported without this option selected. + +config BUSYBOX_CONFIG_IPADDR + bool + default BUSYBOX_DEFAULT_IPADDR + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + +config BUSYBOX_CONFIG_IPLINK + bool + default BUSYBOX_DEFAULT_IPLINK + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_LINK + +config BUSYBOX_CONFIG_IPROUTE + bool + default BUSYBOX_DEFAULT_IPROUTE + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ROUTE + +config BUSYBOX_CONFIG_IPTUNNEL + bool + default BUSYBOX_DEFAULT_IPTUNNEL + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + +config BUSYBOX_CONFIG_IPRULE + bool + default BUSYBOX_DEFAULT_IPRULE + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_RULE + +config BUSYBOX_CONFIG_IPNEIGH + bool + default BUSYBOX_DEFAULT_IPNEIGH + depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_NEIGH + +config BUSYBOX_CONFIG_IPCALC + bool "ipcalc" + default BUSYBOX_DEFAULT_IPCALC + help + ipcalc takes an IP address and netmask and calculates the + resulting broadcast, network, and host range. + +config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY + bool "Fancy IPCALC, more options, adds 1 kbyte" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY + depends on BUSYBOX_CONFIG_IPCALC + help + Adds the options hostname, prefix and silent to the output of + "ipcalc". + +config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS + depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the ipcalc applet. + config BUSYBOX_CONFIG_NETMSG bool "netmsg" default BUSYBOX_DEFAULT_NETMSG help simple program for sending udp broadcast messages + config BUSYBOX_CONFIG_NETSTAT bool "netstat" default BUSYBOX_DEFAULT_NETSTAT @@ -681,7 +829,7 @@ config BUSYBOX_CONFIG_NETSTAT netstat prints information about the Linux networking subsystem. config BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE - bool "Enable wide output" + bool "Enable wide netstat output" default BUSYBOX_DEFAULT_FEATURE_NETSTAT_WIDE depends on BUSYBOX_CONFIG_NETSTAT help @@ -695,24 +843,27 @@ config BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG help Add support for -p flag to print out PID and program name. +700 bytes of code. + config BUSYBOX_CONFIG_NSLOOKUP bool "nslookup" default BUSYBOX_DEFAULT_NSLOOKUP help nslookup is a tool to query Internet name servers. -config BUSYBOX_CONFIG_NSLOOKUP_OPENWRT + +config BUSYBOX_CONFIG_NSLOOKUP_LEDE bool "nslookup_lede" depends on !BUSYBOX_CONFIG_NSLOOKUP - default BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT + default BUSYBOX_DEFAULT_NSLOOKUP_LEDE help - nslookup is a tool to query Internet name servers (OpenWrt flavor). + nslookup is a tool to query Internet name servers (LEDE flavor). -config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS - depends on BUSYBOX_CONFIG_NSLOOKUP_OPENWRT && BUSYBOX_CONFIG_LONG_OPTS + default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS + depends on BUSYBOX_CONFIG_NSLOOKUP_LEDE && BUSYBOX_CONFIG_LONG_OPTS help Support long options for the nslookup applet. + config BUSYBOX_CONFIG_NTPD bool "ntpd" default BUSYBOX_DEFAULT_NTPD @@ -735,39 +886,20 @@ config BUSYBOX_CONFIG_FEATURE_NTPD_CONF help Make ntpd look in /etc/ntp.conf for peers. Only "server address" is supported. -config BUSYBOX_CONFIG_PING - bool "ping" - default BUSYBOX_DEFAULT_PING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to - elicit an ICMP ECHO_RESPONSE from a host or gateway. -config BUSYBOX_CONFIG_PING6 - bool "ping6" - default BUSYBOX_DEFAULT_PING6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 - help - This will give you a ping that can talk IPv6. - -config BUSYBOX_CONFIG_FEATURE_FANCY_PING - bool "Enable fancy ping output" - default BUSYBOX_DEFAULT_FEATURE_FANCY_PING - depends on BUSYBOX_CONFIG_PING || BUSYBOX_CONFIG_PING6 - help - Make the output from the ping applet include statistics, and at the - same time provide full support for ICMP packets. config BUSYBOX_CONFIG_PSCAN bool "pscan" default BUSYBOX_DEFAULT_PSCAN help Simple network port scanner. + config BUSYBOX_CONFIG_ROUTE bool "route" default BUSYBOX_DEFAULT_ROUTE select BUSYBOX_CONFIG_PLATFORM_LINUX help Route displays or manipulates the kernel's IP routing tables. + config BUSYBOX_CONFIG_SLATTACH bool "slattach" default BUSYBOX_DEFAULT_SLATTACH @@ -775,12 +907,17 @@ config BUSYBOX_CONFIG_SLATTACH help slattach is a small utility to attach network interfaces to serial lines. -config BUSYBOX_CONFIG_SSL_CLIENT - bool "ssl_client" - default BUSYBOX_DEFAULT_SSL_CLIENT - select BUSYBOX_CONFIG_TLS - help - This tool pipes data to/from a socket, TLS-encrypting it. + +#config TC +# bool "tc" +# default y +# help +# show / manipulate traffic control settings +# +#config FEATURE_TC_INGRESS +# def_bool n +# depends on TC + config BUSYBOX_CONFIG_TCPSVD bool "tcpsvd" default BUSYBOX_DEFAULT_TCPSVD @@ -788,12 +925,6 @@ config BUSYBOX_CONFIG_TCPSVD tcpsvd listens on a TCP port and runs a program for each new connection. -config BUSYBOX_CONFIG_UDPSVD - bool "udpsvd" - default BUSYBOX_DEFAULT_UDPSVD - help - udpsvd listens on an UDP port and runs a program for each new - connection. config BUSYBOX_CONFIG_TELNET bool "telnet" default BUSYBOX_DEFAULT_TELNET @@ -820,10 +951,6 @@ config BUSYBOX_CONFIG_FEATURE_TELNET_AUTOLOGIN log into a machine without telling the username (autologin). This option enables `-a' and `-l USER' arguments. -config BUSYBOX_CONFIG_FEATURE_TELNET_WIDTH - bool "Enable window size autodetection" - default BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH - depends on BUSYBOX_CONFIG_TELNET config BUSYBOX_CONFIG_TELNETD bool "telnetd" default BUSYBOX_DEFAULT_TELNETD @@ -865,6 +992,7 @@ config BUSYBOX_CONFIG_TELNETD with all that done, telnetd _should_ work.... + config BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE bool "Support standalone telnetd (not inetd only)" default BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE @@ -892,6 +1020,7 @@ config BUSYBOX_CONFIG_FEATURE_TELNETD_INETD_WAIT This option is rarely used. "tcp nowait" is much more usual way of running tcp services, including telnetd. You most probably want to say N here. + config BUSYBOX_CONFIG_TFTP bool "tftp" default BUSYBOX_DEFAULT_TFTP @@ -943,9 +1072,11 @@ config BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE "blksize" and "tsize" options. config BUSYBOX_CONFIG_FEATURE_TFTP_PROGRESS_BAR - bool "Enable progress bar" + bool "Enable tftp progress meter" default BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR depends on BUSYBOX_CONFIG_TFTP && BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE + help + Show progress bar. config BUSYBOX_CONFIG_TFTP_DEBUG bool "Enable debug" @@ -954,9 +1085,7 @@ config BUSYBOX_CONFIG_TFTP_DEBUG help Make tftp[d] print debugging messages on stderr. This is useful if you are diagnosing a bug in tftp[d]. -config BUSYBOX_CONFIG_TLS - bool #No description makes it a hidden option - default BUSYBOX_DEFAULT_TLS + config BUSYBOX_CONFIG_TRACEROUTE bool "traceroute" default BUSYBOX_DEFAULT_TRACEROUTE @@ -967,22 +1096,33 @@ config BUSYBOX_CONFIG_TRACEROUTE config BUSYBOX_CONFIG_TRACEROUTE6 bool "traceroute6" default BUSYBOX_DEFAULT_TRACEROUTE6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 + depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_TRACEROUTE help Utility to trace the route of IPv6 packets. config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE bool "Enable verbose output" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE - depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 + depends on BUSYBOX_CONFIG_TRACEROUTE help Add some verbosity to traceroute. This includes among other things hostnames and ICMP response types. +config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE + bool "Enable loose source route" + default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE + depends on BUSYBOX_CONFIG_TRACEROUTE + help + Add option to specify a loose source route gateway + (8 maximum). + config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP - bool "Enable -I option (use ICMP instead of UDP)" + bool "Use ICMP instead of UDP" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP - depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 + depends on BUSYBOX_CONFIG_TRACEROUTE + help + Add option -I to use ICMP ECHO instead of UDP datagrams. + config BUSYBOX_CONFIG_TUNCTL bool "tunctl" default BUSYBOX_DEFAULT_TUNCTL @@ -997,123 +1137,32 @@ config BUSYBOX_CONFIG_FEATURE_TUNCTL_UG help Allow to specify owner and group of newly created interface. 340 bytes of pure bloat. Say no here. + +source udhcp/Config.in + +config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS + string "ifup udhcpc command line options" + default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS + depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_UDHCPC + help + Command line options to pass to udhcpc from ifup. + Intended to alter options not available in /etc/network/interfaces. + (IE: --syslog --background etc...) + +config BUSYBOX_CONFIG_UDPSVD + bool "udpsvd" + default BUSYBOX_DEFAULT_UDPSVD + help + udpsvd listens on an UDP port and runs a program for each new + connection. + config BUSYBOX_CONFIG_VCONFIG bool "vconfig" default BUSYBOX_DEFAULT_VCONFIG select BUSYBOX_CONFIG_PLATFORM_LINUX help Creates, removes, and configures VLAN interfaces -config BUSYBOX_CONFIG_WGET - bool "wget" - default BUSYBOX_DEFAULT_WGET - help - wget is a utility for non-interactive download of files from HTTP - and FTP servers. -config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS - -config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR - bool "Enable progress bar (+2k)" - default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - depends on BUSYBOX_CONFIG_WGET - -config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION - bool "Enable HTTP authentication" - default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - depends on BUSYBOX_CONFIG_WGET - help - Support authenticated HTTP transfers. - -config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT - bool "Enable timeout option -T SEC" - default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - depends on BUSYBOX_CONFIG_WGET - help - Supports network read and connect timeouts for wget, - so that wget will give up and timeout, through the -T - command line option. - - Currently only connect and network data read timeout are - supported (i.e., timeout is not applied to the DNS query). When - FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option - will work in addition to -T. - -config BUSYBOX_CONFIG_FEATURE_WGET_HTTPS - bool "Support HTTPS using internal TLS code" - default BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS - depends on BUSYBOX_CONFIG_WGET - select BUSYBOX_CONFIG_TLS - help - wget will use internal TLS code to connect to https:// URLs. - Note: - On NOMMU machines, ssl_helper applet should be available - in the $PATH for this to work. Make sure to select that applet. - - Note: currently, TLS code only makes TLS I/O work, it - does *not* check that the peer is who it claims to be, etc. - IOW: it uses peer-supplied public keys to establish encryption - and signing keys, then encrypts and signs outgoing data and - decrypts incoming data. - It does not check signature hashes on the incoming data: - this means that attackers manipulating TCP packets can - send altered data and we unknowingly receive garbage. - (This check might be relatively easy to add). - It does not check public key's certificate: - this means that the peer may be an attacker impersonating - the server we think we are talking to. - - If you think this is unacceptable, consider this. As more and more - servers switch to HTTPS-only operation, without such "crippled" - TLS code it is *impossible* to simply download a kernel source - from kernel.org. Which can in real world translate into - "my small automatic tooling to build cross-compilers from sources - no longer works, I need to additionally keep a local copy - of ~4 megabyte source tarball of a SSL library and ~2 megabyte - source of wget, need to compile and built both before I can - download anything. All this despite the fact that the build - is done in a QEMU sandbox on a machine with absolutely nothing - worth stealing, so I don't care if someone would go to a lot - of trouble to intercept my HTTPS download to send me an altered - kernel tarball". - - If you still think this is unacceptable, send patches. - - If you still think this is unacceptable, do not want to send - patches, but do want to waste bandwidth expaining how wrong - it is, you will be ignored. - -config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL - bool "Try to connect to HTTPS using openssl" - default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - depends on BUSYBOX_CONFIG_WGET - help - Try to use openssl to handle HTTPS. - - OpenSSL has a simple SSL client for debug purposes. - If you select this option, wget will effectively run: - "openssl s_client -quiet -connect hostname:443 - -servername hostname 2>/dev/null" and pipe its data - through it. -servername is not used if hostname is numeric. - Note inconvenient API: host resolution is done twice, - and there is no guarantee openssl's idea of IPv6 address - format is the same as ours. - Another problem is that s_client prints debug information - to stderr, and it needs to be suppressed. This means - all error messages get suppressed too. - openssl is also a big binary, often dynamically linked - against ~15 libraries. - - If openssl can't be executed, internal TLS code will be used - (if you enabled it); if openssl can be executed but fails later, - wget can't detect this, and download will fail. -config BUSYBOX_CONFIG_WHOIS - bool "whois" - default BUSYBOX_DEFAULT_WHOIS - help - whois is a client for the whois directory service config BUSYBOX_CONFIG_ZCIP bool "zcip" default BUSYBOX_DEFAULT_ZCIP @@ -1127,15 +1176,4 @@ config BUSYBOX_CONFIG_ZCIP See http://www.zeroconf.org for further details, and "zcip.script" in the busybox examples. -source udhcp/Config.in - -config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS - string "ifup udhcpc command line options" - default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS - depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN - help - Command line options to pass to udhcpc from ifup. - Intended to alter options not available in /etc/network/interfaces. - (IE: --syslog --background etc...) - endmenu diff --git a/package/utils/busybox/config/networking/udhcp/Config.in b/package/utils/busybox/config/networking/udhcp/Config.in index e7a98750d..4f4840022 100644 --- a/package/utils/busybox/config/networking/udhcp/Config.in +++ b/package/utils/busybox/config/networking/udhcp/Config.in @@ -5,44 +5,38 @@ # config BUSYBOX_CONFIG_UDHCPC6 - bool "udhcpc6 (DHCPv6 client, EXPERIMENTAL)" + bool "udhcp client for DHCPv6 (udhcpc6)" default BUSYBOX_DEFAULT_UDHCPC6 # not yet ready depends on BUSYBOX_CONFIG_FEATURE_IPV6 help udhcpc6 is a DHCPv6 client -config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC3646 - bool "Support RFC 3646 (DNS server and search list)" - default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 - depends on BUSYBOX_CONFIG_UDHCPC6 - help - List of DNS servers and domain search list can be requested with - "-O dns" and "-O search". If server gives these values, - they will be set in environment variables "dns" and "search". - -config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4704 - bool "Support RFC 4704 (Client FQDN)" - default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 - depends on BUSYBOX_CONFIG_UDHCPC6 - help - You can request FQDN to be given by server using "-O fqdn". - -config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4833 - bool "Support RFC 4833 (Timezones)" - default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 - depends on BUSYBOX_CONFIG_UDHCPC6 - help - You can request POSIX timezone with "-O tz" and timezone name - with "-O timezone". - config BUSYBOX_CONFIG_UDHCPD - bool "udhcpd (DHCP server)" + bool "udhcp server (udhcpd)" default BUSYBOX_DEFAULT_UDHCPD select BUSYBOX_CONFIG_PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. +config BUSYBOX_CONFIG_DHCPRELAY + bool "dhcprelay" + default BUSYBOX_DEFAULT_DHCPRELAY + depends on BUSYBOX_CONFIG_UDHCPD + help + dhcprelay listens for dhcp requests on one or more interfaces + and forwards these requests to a different interface or dhcp + server. + +config BUSYBOX_CONFIG_DUMPLEASES + bool "Lease display utility (dumpleases)" + default BUSYBOX_DEFAULT_DUMPLEASES + depends on BUSYBOX_CONFIG_UDHCPD + help + dumpleases displays the leases written out by the udhcpd server. + Lease times are stored in the file by time remaining in lease, or + by the absolute time that it expires in seconds from epoch. + config BUSYBOX_CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool "Rewrite the lease file at every new acknowledge" default BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY @@ -75,24 +69,8 @@ config BUSYBOX_CONFIG_DHCPD_LEASES_FILE udhcpd stores addresses in a lease file. This is the absolute path of the file. Normally it is safe to leave it untouched. -config BUSYBOX_CONFIG_DUMPLEASES - bool "dumpleases" - default BUSYBOX_DEFAULT_DUMPLEASES - help - dumpleases displays the leases written out by the udhcpd. - Lease times are stored in the file by time remaining in lease, or - by the absolute time that it expires in seconds from epoch. - -config BUSYBOX_CONFIG_DHCPRELAY - bool "dhcprelay" - default BUSYBOX_DEFAULT_DHCPRELAY - help - dhcprelay listens for dhcp requests on one or more interfaces - and forwards these requests to a different interface or dhcp - server. - config BUSYBOX_CONFIG_UDHCPC - bool "udhcpc (DHCP client)" + bool "udhcp client (udhcpc)" default BUSYBOX_DEFAULT_UDHCPC select BUSYBOX_CONFIG_PLATFORM_LINUX help @@ -123,15 +101,6 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT they will be replaced with string "bad" when exporting to the environment. -config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT - string "Absolute path to config script" - default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT - depends on BUSYBOX_CONFIG_UDHCPC - help - This script is called after udhcpc receives an answer. See - examples/udhcp for a working example. Normally it is safe - to leave this untouched. - config BUSYBOX_CONFIG_FEATURE_UDHCP_PORT bool "Enable '-P port' option for udhcpd and udhcpc" default BUSYBOX_DEFAULT_FEATURE_UDHCP_PORT @@ -153,7 +122,7 @@ config BUSYBOX_CONFIG_UDHCP_DEBUG are very verbose and useful for debugging only. config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 - bool "Support RFC3397 domain search (experimental)" + bool "Support for RFC3397 domain search (experimental)" default BUSYBOX_DEFAULT_FEATURE_UDHCP_RFC3397 depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help @@ -162,13 +131,22 @@ config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 and SIP servers option 120, specified in RFC 3361. config BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q - bool "Support 802.1Q VLAN parameters" + bool "Support for 802.1Q VLAN parameters" default BUSYBOX_DEFAULT_FEATURE_UDHCP_8021Q depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help If selected, both client and server will support passing of VLAN ID and priority via options 132 and 133 as per 802.1Q. +config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT + string "Absolute path to config script" + default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT + depends on BUSYBOX_CONFIG_UDHCPC + help + This script is called after udhcpc receives an answer. See + examples/udhcp for a working example. Normally it is safe + to leave this untouched. + config BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS int "DHCP options slack buffer size" default BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS diff --git a/package/utils/busybox/config/procps/Config.in b/package/utils/busybox/config/procps/Config.in index acd4ed882..6eafbda0f 100644 --- a/package/utils/busybox/config/procps/Config.in +++ b/package/utils/busybox/config/procps/Config.in @@ -6,50 +6,11 @@ menu "Process Utilities" -config BUSYBOX_CONFIG_FREE - bool "free" - default BUSYBOX_DEFAULT_FREE - select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() - help - free displays the total amount of free and used physical and swap - memory in the system, as well as the buffers used by the kernel. - The shared memory column should be ignored; it is obsolete. -config BUSYBOX_CONFIG_FUSER - bool "fuser" - default BUSYBOX_DEFAULT_FUSER - help - fuser lists all PIDs (Process IDs) that currently have a given - file open. fuser can also list all PIDs that have a given network - (TCP or UDP) port open. config BUSYBOX_CONFIG_IOSTAT bool "iostat" default BUSYBOX_DEFAULT_IOSTAT help Report CPU and I/O statistics -config BUSYBOX_CONFIG_KILL - bool "kill" - default BUSYBOX_DEFAULT_KILL - help - The command kill sends the specified signal to the specified - process or process group. If no signal is specified, the TERM - signal is sent. - -config BUSYBOX_CONFIG_KILLALL - bool "killall" - default BUSYBOX_DEFAULT_KILLALL - help - killall sends a signal to all processes running any of the - specified commands. If no signal name is specified, SIGTERM is - sent. - -config BUSYBOX_CONFIG_KILLALL5 - bool "killall5" - default BUSYBOX_DEFAULT_KILLALL5 - help - The SystemV killall command. killall5 sends a signal - to all processes except kernel threads and the processes - in its own session, so it won't kill the shell that is running - the script it was called from. config BUSYBOX_CONFIG_LSOF bool "lsof" default BUSYBOX_DEFAULT_LSOF @@ -66,39 +27,6 @@ config BUSYBOX_CONFIG_NMETER default BUSYBOX_DEFAULT_NMETER help Prints selected system stats continuously, one line per update. -config BUSYBOX_CONFIG_PGREP - bool "pgrep" - default BUSYBOX_DEFAULT_PGREP - help - Look for processes by name. - -config BUSYBOX_CONFIG_PKILL - bool "pkill" - default BUSYBOX_DEFAULT_PKILL - help - Send signals to processes by name. -config BUSYBOX_CONFIG_PIDOF - bool "pidof" - default BUSYBOX_DEFAULT_PIDOF - help - Pidof finds the process id's (pids) of the named programs. It prints - those id's on the standard output. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE - bool "Enable single shot (-s)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - depends on BUSYBOX_CONFIG_PIDOF - help - Support '-s' for returning only the first pid found. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT - bool "Enable omitting pids (-o PID)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - depends on BUSYBOX_CONFIG_PIDOF - help - Support '-o PID' for omitting the given pid(s) in output. - The special pid %PPID can be used to name the parent process - of the pidof, in other words the calling shell or shell script. config BUSYBOX_CONFIG_PMAP bool "pmap" default BUSYBOX_DEFAULT_PMAP @@ -109,55 +37,6 @@ config BUSYBOX_CONFIG_POWERTOP default BUSYBOX_DEFAULT_POWERTOP help Analyze power consumption on Intel-based laptops - -config BUSYBOX_CONFIG_FEATURE_POWERTOP_INTERACTIVE - bool "Accept keyboard commands" - default BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE - depends on BUSYBOX_CONFIG_POWERTOP - help - Without this, powertop will only refresh display every 10 seconds. - No keyboard commands will work, only ^C to terminate. -config BUSYBOX_CONFIG_PS - bool "ps" - default BUSYBOX_DEFAULT_PS - help - ps gives a snapshot of the current processes. - -config BUSYBOX_CONFIG_FEATURE_PS_WIDE - bool "Enable wide output option (-w)" - default BUSYBOX_DEFAULT_FEATURE_PS_WIDE - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'w' for wide output. - If given once, 132 chars are printed, and if given more - than once, the length is unlimited. - -config BUSYBOX_CONFIG_FEATURE_PS_LONG - bool "Enable long output option (-l)" - default BUSYBOX_DEFAULT_FEATURE_PS_LONG - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'l' for long output. - Adds fields PPID, RSS, START, TIME & TTY - -config BUSYBOX_CONFIG_FEATURE_PS_TIME - bool "Support -o time and -o etime output specifiers" - default BUSYBOX_DEFAULT_FEATURE_PS_TIME - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP - select BUSYBOX_CONFIG_PLATFORM_LINUX - -config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS - bool "Support Linux prior to 2.4.0 and non-ELF systems" - default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - depends on BUSYBOX_CONFIG_FEATURE_PS_TIME - help - Include support for measuring HZ on old kernels and non-ELF systems - (if you are on Linux 2.4.0+ and use ELF, you don't need this) - -config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS - bool "Support -o rgroup, -o ruser, -o nice specifiers" - default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP config BUSYBOX_CONFIG_PSTREE bool "pstree" default BUSYBOX_DEFAULT_PSTREE @@ -174,11 +53,6 @@ config BUSYBOX_CONFIG_SMEMCAP help smemcap is a tool for capturing process data for smem, a memory usage statistic tool. -config BUSYBOX_CONFIG_BB_SYSCTL - bool "sysctl" - default BUSYBOX_DEFAULT_BB_SYSCTL - help - Configure kernel parameters at runtime. config BUSYBOX_CONFIG_TOP bool "top" default BUSYBOX_DEFAULT_TOP @@ -186,14 +60,6 @@ config BUSYBOX_CONFIG_TOP The top program provides a dynamic real-time view of a running system. -config BUSYBOX_CONFIG_FEATURE_TOP_INTERACTIVE - bool "Accept keyboard commands" - default BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE - depends on BUSYBOX_CONFIG_TOP - help - Without this, top will only refresh display every 5 seconds. - No keyboard commands will work, only ^C to terminate. - config BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool "Show CPU per-process usage percentage" default BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE @@ -250,11 +116,153 @@ config BUSYBOX_CONFIG_UPTIME on, and the system load averages for the past 1, 5, and 15 minutes. config BUSYBOX_CONFIG_FEATURE_UPTIME_UTMP_SUPPORT - bool "Show the number of users" + bool "Support for showing the number of users" default BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT depends on BUSYBOX_CONFIG_UPTIME && BUSYBOX_CONFIG_FEATURE_UTMP help - Display the number of users currently logged on. + Makes uptime display the number of users currently logged on. + +config BUSYBOX_CONFIG_FREE + bool "free" + default BUSYBOX_DEFAULT_FREE + select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() + help + free displays the total amount of free and used physical and swap + memory in the system, as well as the buffers used by the kernel. + The shared memory column should be ignored; it is obsolete. + +config BUSYBOX_CONFIG_FUSER + bool "fuser" + default BUSYBOX_DEFAULT_FUSER + help + fuser lists all PIDs (Process IDs) that currently have a given + file open. fuser can also list all PIDs that have a given network + (TCP or UDP) port open. + +config BUSYBOX_CONFIG_KILL + bool "kill" + default BUSYBOX_DEFAULT_KILL + help + The command kill sends the specified signal to the specified + process or process group. If no signal is specified, the TERM + signal is sent. + +config BUSYBOX_CONFIG_KILLALL + bool "killall" + default BUSYBOX_DEFAULT_KILLALL + depends on BUSYBOX_CONFIG_KILL + help + killall sends a signal to all processes running any of the + specified commands. If no signal name is specified, SIGTERM is + sent. + +config BUSYBOX_CONFIG_KILLALL5 + bool "killall5" + default BUSYBOX_DEFAULT_KILLALL5 + depends on BUSYBOX_CONFIG_KILL + +config BUSYBOX_CONFIG_PGREP + bool "pgrep" + default BUSYBOX_DEFAULT_PGREP + help + Look for processes by name. + +config BUSYBOX_CONFIG_PIDOF + bool "pidof" + default BUSYBOX_DEFAULT_PIDOF + help + Pidof finds the process id's (pids) of the named programs. It prints + those id's on the standard output. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE + bool "Enable argument for single shot (-s)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + depends on BUSYBOX_CONFIG_PIDOF + help + Support argument '-s' for returning only the first pid found. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT + bool "Enable argument for omitting pids (-o)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + depends on BUSYBOX_CONFIG_PIDOF + help + Support argument '-o' for omitting the given pids in output. + The special pid %PPID can be used to name the parent process + of the pidof, in other words the calling shell or shell script. + +config BUSYBOX_CONFIG_PKILL + bool "pkill" + default BUSYBOX_DEFAULT_PKILL + help + Send signals to processes by name. + +config BUSYBOX_CONFIG_PS + bool "ps" + default BUSYBOX_DEFAULT_PS + help + ps gives a snapshot of the current processes. + +config BUSYBOX_CONFIG_FEATURE_PS_WIDE + bool "Enable wide output option (-w)" + default BUSYBOX_DEFAULT_FEATURE_PS_WIDE + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'w' for wide output. + If given once, 132 chars are printed, and if given more + than once, the length is unlimited. + +config BUSYBOX_CONFIG_FEATURE_PS_LONG + bool "Enable long output option (-l)" + default BUSYBOX_DEFAULT_FEATURE_PS_LONG + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'l' for long output. + Adds fields PPID, RSS, START, TIME & TTY + +config BUSYBOX_CONFIG_FEATURE_PS_TIME + bool "Enable time and elapsed time output" + default BUSYBOX_DEFAULT_FEATURE_PS_TIME + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support -o time and -o etime output specifiers. + +config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS + bool "Enable additional ps columns" + default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP + help + Support -o rgroup, -o ruser, -o nice output specifiers. + +config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS + bool "Support Linux prior to 2.4.0 and non-ELF systems" + default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + depends on BUSYBOX_CONFIG_FEATURE_PS_TIME + help + Include support for measuring HZ on old kernels and non-ELF systems + (if you are on Linux 2.4.0+ and use ELF, you don't need this) + +config BUSYBOX_CONFIG_RENICE + bool "renice" + default BUSYBOX_DEFAULT_RENICE + help + Renice alters the scheduling priority of one or more running + processes. + +config BUSYBOX_CONFIG_BB_SYSCTL + bool "sysctl" + default BUSYBOX_DEFAULT_BB_SYSCTL + help + Configure kernel parameters at runtime. + +config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS + bool "Support for showing threads in ps/pstree/top" + default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS + depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE + help + Enables the ps -T option, showing of threads in pstree, + and 'h' command in top. + config BUSYBOX_CONFIG_WATCH bool "watch" default BUSYBOX_DEFAULT_WATCH @@ -262,12 +270,4 @@ config BUSYBOX_CONFIG_WATCH watch is used to execute a program periodically, showing output to the screen. -config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS - bool "Support thread display in ps/pstree/top" - default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS - depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE - help - Enables the ps -T option, showing of threads in pstree, - and 'h' command in top. - endmenu diff --git a/package/utils/busybox/config/runit/Config.in b/package/utils/busybox/config/runit/Config.in index 8750b597e..a322a2cd8 100644 --- a/package/utils/busybox/config/runit/Config.in +++ b/package/utils/busybox/config/runit/Config.in @@ -73,13 +73,6 @@ config BUSYBOX_CONFIG_SV_DEFAULT_SERVICE_DIR help Default directory for services. Defaults to "/var/service" - -config BUSYBOX_CONFIG_SVC - bool "svc" - default BUSYBOX_DEFAULT_SVC - help - svc controls the state of services monitored by the runsv supervisor. - It is comaptible with daemontools command with the same name. config BUSYBOX_CONFIG_SVLOGD bool "svlogd" default BUSYBOX_DEFAULT_SVLOGD diff --git a/package/utils/busybox/config/selinux/Config.in b/package/utils/busybox/config/selinux/Config.in index 71eb0dcd7..1d23f7de4 100644 --- a/package/utils/busybox/config/selinux/Config.in +++ b/package/utils/busybox/config/selinux/Config.in @@ -7,6 +7,7 @@ menu "SELinux Utilities" depends on BUSYBOX_CONFIG_SELINUX + config BUSYBOX_CONFIG_CHCON bool "chcon" default BUSYBOX_DEFAULT_CHCON @@ -18,24 +19,30 @@ config BUSYBOX_CONFIG_FEATURE_CHCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_CHCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_CHCON && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the chcon applet. + config BUSYBOX_CONFIG_GETENFORCE bool "getenforce" default BUSYBOX_DEFAULT_GETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to get the current mode of SELinux. + config BUSYBOX_CONFIG_GETSEBOOL bool "getsebool" default BUSYBOX_DEFAULT_GETSEBOOL depends on BUSYBOX_CONFIG_SELINUX help Enable support to get SELinux boolean values. + config BUSYBOX_CONFIG_LOAD_POLICY bool "load_policy" default BUSYBOX_DEFAULT_LOAD_POLICY depends on BUSYBOX_CONFIG_SELINUX help Enable support to load SELinux policy. + config BUSYBOX_CONFIG_MATCHPATHCON bool "matchpathcon" default BUSYBOX_DEFAULT_MATCHPATHCON @@ -43,6 +50,15 @@ config BUSYBOX_CONFIG_MATCHPATHCON help Enable support to get default security context of the specified path from the file contexts configuration. + +config BUSYBOX_CONFIG_RESTORECON + bool "restorecon" + default BUSYBOX_DEFAULT_RESTORECON + depends on BUSYBOX_CONFIG_SELINUX + help + Enable support to relabel files. The feature is almost + the same as setfiles, but usage is a little different. + config BUSYBOX_CONFIG_RUNCON bool "runcon" default BUSYBOX_DEFAULT_RUNCON @@ -54,6 +70,9 @@ config BUSYBOX_CONFIG_FEATURE_RUNCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUNCON && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the runcon applet. + config BUSYBOX_CONFIG_SELINUXENABLED bool "selinuxenabled" default BUSYBOX_DEFAULT_SELINUXENABLED @@ -61,18 +80,14 @@ config BUSYBOX_CONFIG_SELINUXENABLED help Enable support for this command to be used within shell scripts to determine if selinux is enabled. -config BUSYBOX_CONFIG_SESTATUS - bool "sestatus" - default BUSYBOX_DEFAULT_SESTATUS - depends on BUSYBOX_CONFIG_SELINUX - help - Displays the status of SELinux. + config BUSYBOX_CONFIG_SETENFORCE bool "setenforce" default BUSYBOX_DEFAULT_SETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to modify the mode SELinux is running in. + config BUSYBOX_CONFIG_SETFILES bool "setfiles" default BUSYBOX_DEFAULT_SETFILES @@ -91,13 +106,6 @@ config BUSYBOX_CONFIG_FEATURE_SETFILES_CHECK_OPTION Support "-c" option (check the validity of the contexts against the specified binary policy) for setfiles. Requires libsepol. -config BUSYBOX_CONFIG_RESTORECON - bool "restorecon" - default BUSYBOX_DEFAULT_RESTORECON - depends on BUSYBOX_CONFIG_SELINUX - help - Enable support to relabel files. The feature is almost - the same as setfiles, but usage is a little different. config BUSYBOX_CONFIG_SETSEBOOL bool "setsebool" default BUSYBOX_DEFAULT_SETSEBOOL @@ -106,4 +114,11 @@ config BUSYBOX_CONFIG_SETSEBOOL Enable support for change boolean. semanage and -P option is not supported yet. +config BUSYBOX_CONFIG_SESTATUS + bool "sestatus" + default BUSYBOX_DEFAULT_SESTATUS + depends on BUSYBOX_CONFIG_SELINUX + help + Displays the status of SELinux. + endmenu diff --git a/package/utils/busybox/config/shell/Config.in b/package/utils/busybox/config/shell/Config.in index e455d3832..69ecf145e 100644 --- a/package/utils/busybox/config/shell/Config.in +++ b/package/utils/busybox/config/shell/Config.in @@ -6,78 +6,6 @@ menu "Shells" - -choice - prompt "Choose which shell is aliased to 'sh' name" - default BUSYBOX_CONFIG_SH_IS_ASH - help - Choose which shell you want to be executed by 'sh' alias. - The ash shell is the most bash compatible and full featured one. - -# note: cannot use "select ASH" here, it breaks "make allnoconfig" -config BUSYBOX_CONFIG_SH_IS_ASH - depends on !BUSYBOX_CONFIG_NOMMU - bool "ash" - help - Choose ash to be the shell executed by 'sh' name. - The ash code will be built into busybox. If you don't select - "ash" choice (CONFIG_ASH), this shell may only be invoked by - the name 'sh' (and not 'ash'). - -config BUSYBOX_CONFIG_SH_IS_HUSH - bool "hush" - help - Choose hush to be the shell executed by 'sh' name. - The hush code will be built into busybox. If you don't select - "hush" choice (CONFIG_HUSH), this shell may only be invoked by - the name 'sh' (and not 'hush'). - -config BUSYBOX_CONFIG_SH_IS_NONE - bool "none" - -endchoice - -choice - prompt "Choose which shell is aliased to 'bash' name" - default BUSYBOX_CONFIG_BASH_IS_NONE - help - Choose which shell you want to be executed by 'bash' alias. - The ash shell is the most bash compatible and full featured one, - although compatibility is far from being complete. - - Note that selecting this option does not switch on any bash - compatibility code. It merely makes it possible to install - /bin/bash (sym)link and run scripts which start with - #!/bin/bash line. - - Many systems use it in scripts which use bash-specific features, - even simple ones like $RANDOM. Without this option, busybox - can't be used for running them because it won't recongnize - "bash" as a supported applet name. - -config BUSYBOX_CONFIG_BASH_IS_ASH - depends on !BUSYBOX_CONFIG_NOMMU - bool "ash" - help - Choose ash to be the shell executed by 'bash' name. - The ash code will be built into busybox. If you don't select - "ash" choice (CONFIG_ASH), this shell may only be invoked by - the name 'bash' (and not 'ash'). - -config BUSYBOX_CONFIG_BASH_IS_HUSH - bool "hush" - help - Choose hush to be the shell executed by 'bash' name. - The hush code will be built into busybox. If you don't select - "hush" choice (CONFIG_HUSH), this shell may only be invoked by - the name 'bash' (and not 'hush'). - -config BUSYBOX_CONFIG_BASH_IS_NONE - bool "none" - -endchoice - - config BUSYBOX_CONFIG_ASH bool "ash" default BUSYBOX_DEFAULT_ASH @@ -89,46 +17,96 @@ config BUSYBOX_CONFIG_ASH shell (by Herbert Xu), which was created by porting the 'ash' shell (written by Kenneth Almquist) from NetBSD. -# ash options -# note: Don't remove !NOMMU part in the next line; it would break -# menuconfig's indenting. -if !NOMMU && (BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH) - -config BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE - bool "Optimize for size instead of speed" - default BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_INTERNAL_GLOB - bool "Use internal glob() implementation" - default BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB # Y is bigger, but because of uclibc glob() bug, let Y be default for now - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - help - Do not use glob() function from libc, use internal implementation. - Use this if you are getting "glob.h: No such file or directory" - or similar build errors. - Note that as of now (2017-01), uclibc and musl glob() both have bugs - which would break ash if you select N here. - config BUSYBOX_CONFIG_ASH_BASH_COMPAT bool "bash-compatible extensions" default BUSYBOX_DEFAULT_ASH_BASH_COMPAT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH + help + Enable bash-compatible extensions. + +config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT + bool "Idle timeout variable" + default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + depends on BUSYBOX_CONFIG_ASH + help + Enables bash-like auto-logout after $TMOUT seconds of idle time. config BUSYBOX_CONFIG_ASH_JOB_CONTROL bool "Job control" default BUSYBOX_DEFAULT_ASH_JOB_CONTROL - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH + help + Enable job control in the ash shell. config BUSYBOX_CONFIG_ASH_ALIAS bool "Alias support" default BUSYBOX_DEFAULT_ASH_ALIAS - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH + help + Enable alias support in the ash shell. + +config BUSYBOX_CONFIG_ASH_GETOPTS + bool "Builtin getopt to parse positional parameters" + default BUSYBOX_DEFAULT_ASH_GETOPTS + depends on BUSYBOX_CONFIG_ASH + help + Enable support for getopts builtin in ash. + +config BUSYBOX_CONFIG_ASH_BUILTIN_ECHO + bool "Builtin version of 'echo'" + default BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO + depends on BUSYBOX_CONFIG_ASH + help + Enable support for echo builtin in ash. + +config BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF + bool "Builtin version of 'printf'" + default BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF + depends on BUSYBOX_CONFIG_ASH + help + Enable support for printf builtin in ash. + +config BUSYBOX_CONFIG_ASH_BUILTIN_TEST + bool "Builtin version of 'test'" + default BUSYBOX_DEFAULT_ASH_BUILTIN_TEST + depends on BUSYBOX_CONFIG_ASH + help + Enable support for test builtin in ash. + +config BUSYBOX_CONFIG_ASH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_ASH_HELP + depends on BUSYBOX_CONFIG_ASH + help + Enable help builtin in ash. + +config BUSYBOX_CONFIG_ASH_CMDCMD + bool "'command' command to override shell builtins" + default BUSYBOX_DEFAULT_ASH_CMDCMD + depends on BUSYBOX_CONFIG_ASH + help + Enable support for the ash 'command' builtin, which allows + you to run the specified command with the specified arguments, + even when there is an ash builtin command with the same name. + +config BUSYBOX_CONFIG_ASH_MAIL + bool "Check for new mail on interactive shells" + default BUSYBOX_DEFAULT_ASH_MAIL + depends on BUSYBOX_CONFIG_ASH + help + Enable "check for new mail" function in the ash shell. + +config BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE + bool "Optimize for size instead of speed" + default BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE + depends on BUSYBOX_CONFIG_ASH + help + Compile ash for reduced size at the price of speed. config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. @@ -139,64 +117,12 @@ config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT config BUSYBOX_CONFIG_ASH_EXPAND_PRMT bool "Expand prompt string" default BUSYBOX_DEFAULT_ASH_EXPAND_PRMT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH help - $PS# may contain volatile content, such as backquote commands. + "PS#" may contain volatile content, such as backquote commands. This option recreates the prompt string from the environment variable each time it is displayed. -config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT - bool "Idle timeout variable $TMOUT" - default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - help - Enable bash-like auto-logout after $TMOUT seconds of idle time. - -config BUSYBOX_CONFIG_ASH_MAIL - bool "Check for new mail in interactive shell" - default BUSYBOX_DEFAULT_ASH_MAIL - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - help - Enable "check for new mail" function: - if set, $MAIL file and $MAILPATH list of files - are checked for mtime changes, and "you have mail" - message is printed if change is detected. - -config BUSYBOX_CONFIG_ASH_ECHO - bool "echo builtin" - default BUSYBOX_DEFAULT_ASH_ECHO - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_PRINTF - bool "printf builtin" - default BUSYBOX_DEFAULT_ASH_PRINTF - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_TEST - bool "test builtin" - default BUSYBOX_DEFAULT_ASH_TEST - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_ASH_HELP - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_GETOPTS - bool "getopts builtin" - default BUSYBOX_DEFAULT_ASH_GETOPTS - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - -config BUSYBOX_CONFIG_ASH_CMDCMD - bool "command builtin" - default BUSYBOX_DEFAULT_ASH_CMDCMD - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH - help - Enable support for the 'command' builtin, which allows - you to run the specified command or builtin, - even when there is a function with the same name. - -endif # ash options config BUSYBOX_CONFIG_CTTYHACK bool "cttyhack" default BUSYBOX_DEFAULT_CTTYHACK @@ -257,7 +183,9 @@ config BUSYBOX_CONFIG_HUSH config BUSYBOX_CONFIG_HUSH_BASH_COMPAT bool "bash-compatible extensions" default BUSYBOX_DEFAULT_HUSH_BASH_COMPAT - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH + help + Enable bash-compatible extensions. config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION bool "Brace expansion" @@ -266,10 +194,17 @@ config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION help Enable {abc,def} extension. +config BUSYBOX_CONFIG_HUSH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_HUSH_HELP + depends on BUSYBOX_CONFIG_HUSH + help + Enable help builtin in hush. Code size + ~1 kbyte. + config BUSYBOX_CONFIG_HUSH_INTERACTIVE bool "Interactive mode" default BUSYBOX_DEFAULT_HUSH_INTERACTIVE - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH help Enable interactive mode (prompt and command editing). Without this, hush simply reads and executes commands @@ -280,6 +215,8 @@ config BUSYBOX_CONFIG_HUSH_SAVEHISTORY bool "Save command history to .hush_history" default BUSYBOX_DEFAULT_HUSH_SAVEHISTORY depends on BUSYBOX_CONFIG_HUSH_INTERACTIVE && BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY + help + Enable history saving in hush. config BUSYBOX_CONFIG_HUSH_JOB bool "Job control" @@ -293,38 +230,42 @@ config BUSYBOX_CONFIG_HUSH_JOB but no separate process group is formed. config BUSYBOX_CONFIG_HUSH_TICK - bool "Support process substitution" + bool "Process substitution" default BUSYBOX_DEFAULT_HUSH_TICK - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH help - Enable `command` and $(command). + Enable process substitution `command` and $(command) in hush. config BUSYBOX_CONFIG_HUSH_IF bool "Support if/then/elif/else/fi" default BUSYBOX_DEFAULT_HUSH_IF - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH + help + Enable if/then/elif/else/fi in hush. config BUSYBOX_CONFIG_HUSH_LOOPS bool "Support for, while and until loops" default BUSYBOX_DEFAULT_HUSH_LOOPS - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH + help + Enable for, while and until loops in hush. config BUSYBOX_CONFIG_HUSH_CASE bool "Support case ... esac statement" default BUSYBOX_DEFAULT_HUSH_CASE - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH help - Enable case ... esac statement. +400 bytes. + Enable case ... esac statement in hush. +400 bytes. config BUSYBOX_CONFIG_HUSH_FUNCTIONS bool "Support funcname() { commands; } syntax" default BUSYBOX_DEFAULT_HUSH_FUNCTIONS - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH help - Enable support for shell functions. +800 bytes. + Enable support for shell functions in hush. +800 bytes. config BUSYBOX_CONFIG_HUSH_LOCAL - bool "local builtin" + bool "Support local builtin" default BUSYBOX_DEFAULT_HUSH_LOCAL depends on BUSYBOX_CONFIG_HUSH_FUNCTIONS help @@ -333,100 +274,25 @@ config BUSYBOX_CONFIG_HUSH_LOCAL config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. -config BUSYBOX_CONFIG_HUSH_MODE_X - bool "Support 'hush -x' option and 'set -x' command" - default BUSYBOX_DEFAULT_HUSH_MODE_X - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - help - This instructs hush to print commands before execution. - Adds ~300 bytes. - -config BUSYBOX_CONFIG_HUSH_ECHO - bool "echo builtin" - default BUSYBOX_DEFAULT_HUSH_ECHO - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_PRINTF - bool "printf builtin" - default BUSYBOX_DEFAULT_HUSH_PRINTF - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_TEST - bool "test builtin" - default BUSYBOX_DEFAULT_HUSH_TEST - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_HUSH_HELP - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_EXPORT - bool "export builtin" - default BUSYBOX_DEFAULT_HUSH_EXPORT - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - config BUSYBOX_CONFIG_HUSH_EXPORT_N bool "Support 'export -n' option" default BUSYBOX_DEFAULT_HUSH_EXPORT_N - depends on BUSYBOX_CONFIG_HUSH_EXPORT + depends on BUSYBOX_CONFIG_HUSH help export -n unexports variables. It is a bash extension. -config BUSYBOX_CONFIG_HUSH_KILL - bool "kill builtin (supports kill %jobspec)" - default BUSYBOX_DEFAULT_HUSH_KILL - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_WAIT - bool "wait builtin" - default BUSYBOX_DEFAULT_HUSH_WAIT - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_TRAP - bool "trap builtin" - default BUSYBOX_DEFAULT_HUSH_TRAP - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_TYPE - bool "type builtin" - default BUSYBOX_DEFAULT_HUSH_TYPE - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_READ - bool "read builtin" - default BUSYBOX_DEFAULT_HUSH_READ - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_SET - bool "set builtin" - default BUSYBOX_DEFAULT_HUSH_SET - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_UNSET - bool "unset builtin" - default BUSYBOX_DEFAULT_HUSH_UNSET - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_ULIMIT - bool "ulimit builtin" - default BUSYBOX_DEFAULT_HUSH_ULIMIT - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_UMASK - bool "umask builtin" - default BUSYBOX_DEFAULT_HUSH_UMASK - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH - -config BUSYBOX_CONFIG_HUSH_MEMLEAK - bool "memleak builtin (debugging)" - default BUSYBOX_DEFAULT_HUSH_MEMLEAK - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH +config BUSYBOX_CONFIG_HUSH_MODE_X + bool "Support 'hush -x' option and 'set -x' command" + default BUSYBOX_DEFAULT_HUSH_MODE_X + depends on BUSYBOX_CONFIG_HUSH + help + This instructs hush to print commands before execution. + Adds ~300 bytes. config BUSYBOX_CONFIG_MSH bool "msh (deprecated: aliased to hush)" @@ -436,20 +302,72 @@ config BUSYBOX_CONFIG_MSH msh is deprecated and will be removed, please migrate to hush. -comment "Options common to all shells" -if ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH -config BUSYBOX_CONFIG_FEATURE_SH_MATH +choice + prompt "Choose which shell is aliased to 'sh' name" + default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH + help + Choose which shell you want to be executed by 'sh' alias. + The ash shell is the most bash compatible and full featured one. + +# note: cannot use "select ASH" here, it breaks "make allnoconfig" +config BUSYBOX_CONFIG_FEATURE_SH_IS_ASH + depends on BUSYBOX_CONFIG_ASH + bool "ash" + depends on !BUSYBOX_CONFIG_NOMMU + +config BUSYBOX_CONFIG_FEATURE_SH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH + bool "hush" + +config BUSYBOX_CONFIG_FEATURE_SH_IS_NONE + bool "none" + +endchoice + +choice + prompt "Choose which shell is aliased to 'bash' name" + default BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE + help + Choose which shell you want to be executed by 'bash' alias. + The ash shell is the most bash compatible and full featured one. + + Note that selecting this option does not switch on any bash + compatibility code. It merely makes it possible to install + /bin/bash (sym)link and run scripts which start with + #!/bin/bash line. + + Many systems use it in scripts which use bash-specific features, + even simple ones like $RANDOM. Without this option, busybox + can't be used for running them because it won't recongnize + "bash" as a supported applet name. + +config BUSYBOX_CONFIG_FEATURE_BASH_IS_ASH + depends on BUSYBOX_CONFIG_ASH + bool "ash" + depends on !BUSYBOX_CONFIG_NOMMU + +config BUSYBOX_CONFIG_FEATURE_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH + bool "hush" + +config BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE + bool "none" + +endchoice + + +config BUSYBOX_CONFIG_SH_MATH_SUPPORT bool "POSIX math support" - default BUSYBOX_DEFAULT_FEATURE_SH_MATH - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + default BUSYBOX_DEFAULT_SH_MATH_SUPPORT + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH help Enable math support in the shell via $((...)) syntax. -config BUSYBOX_CONFIG_FEATURE_SH_MATH_64 +config BUSYBOX_CONFIG_SH_MATH_SUPPORT_64 bool "Extend POSIX math support to 64 bit" - default BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 - depends on BUSYBOX_CONFIG_FEATURE_SH_MATH + default BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 + depends on BUSYBOX_CONFIG_SH_MATH_SUPPORT help Enable 64-bit math support in the shell. This will make the shell slightly larger, but will allow computation with very large numbers. @@ -458,14 +376,14 @@ config BUSYBOX_CONFIG_FEATURE_SH_MATH_64 config BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET bool "Hide message on interactive shell startup" default BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH help Remove the busybox introduction when starting a shell. config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE bool "Standalone shell" default BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS help This option causes busybox shells to use busybox applets in preference to executables in the PATH whenever possible. For @@ -477,16 +395,28 @@ config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE for use as a rescue shell, in the event that you screw up your system. This is implemented by re-execing /proc/self/exe (typically) - with right parameters. + with right parameters. Some selected applets ("NOFORK" applets) + can even be executed without creating new process. + Instead, busybox will call _main() internally. - However, there are drawbacks: it is problematic in chroot jails - without mounted /proc, and ps/top may show command name as 'exe' - for applets started this way. + However, this causes problems in chroot jails without mounted /proc + and with ps/top (command name can be shown as 'exe' for applets + started this way). +# untrue? +# Note that this will *also* cause applets to take precedence +# over shell builtins of the same name. So turning this on will +# eliminate any performance gained by turning on the builtin "echo" +# and "test" commands in ash. +# untrue? +# Note that when using this option, the shell will attempt to directly +# run '/bin/busybox'. If you do not have the busybox binary sitting in +# that exact location with that exact name, this option will not work at +# all. config BUSYBOX_CONFIG_FEATURE_SH_NOFORK bool "Run 'nofork' applets directly" default BUSYBOX_DEFAULT_FEATURE_SH_NOFORK - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS help This option causes busybox shells to not execute typical fork/exec/wait sequence, but call _main directly, @@ -504,12 +434,11 @@ config BUSYBOX_CONFIG_FEATURE_SH_NOFORK config BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE bool "Use $HISTFILESIZE" default BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH help This option makes busybox shells to use $HISTFILESIZE variable to set shell history size. Note that its max value is capped by "History size" setting in library tuning section. -endif # Options common to all shells endmenu diff --git a/package/utils/busybox/config/sysklogd/Config.in b/package/utils/busybox/config/sysklogd/Config.in index 2045a7ae3..5fcee2c7f 100644 --- a/package/utils/busybox/config/sysklogd/Config.in +++ b/package/utils/busybox/config/sysklogd/Config.in @@ -47,6 +47,7 @@ config BUSYBOX_CONFIG_LOGGER config BUSYBOX_CONFIG_LOGREAD bool "logread" default BUSYBOX_DEFAULT_LOGREAD + depends on BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG help If you enabled Circular Buffer support, you almost certainly want to enable this feature as well. This @@ -58,7 +59,7 @@ config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING default BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING depends on BUSYBOX_CONFIG_LOGREAD help - 'logread' output to slow serial terminals can have + 'logread' ouput to slow serial terminals can have side effects on syslog because of the semaphore. This option make logread to double buffer copy from circular buffer, minimizing semaphore diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in index 74a49d00c..08bddf819 100644 --- a/package/utils/busybox/config/util-linux/Config.in +++ b/package/utils/busybox/config/util-linux/Config.in @@ -6,424 +6,28 @@ menu "Linux System Utilities" -config BUSYBOX_CONFIG_ACPID - bool "acpid" - default BUSYBOX_DEFAULT_ACPID - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - acpid listens to ACPI events coming either in textual form from - /proc/acpi/event (though it is marked deprecated it is still widely - used and _is_ a standard) or in binary form from specified evdevs - (just use /dev/input/event*). - - It parses the event to retrieve ACTION and a possible PARAMETER. - It then spawns /etc/acpi/[/] either via run-parts - (if the resulting path is a directory) or directly as an executable. - - N.B. acpid relies on run-parts so have the latter installed. - -config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT - bool "Accept and ignore redundant options" - default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT - depends on BUSYBOX_CONFIG_ACPID - help - Accept and ignore compatibility options -g -m -s -S -v. config BUSYBOX_CONFIG_BLKDISCARD bool "blkdiscard" default BUSYBOX_DEFAULT_BLKDISCARD help blkdiscard discards sectors on a given device. -config BUSYBOX_CONFIG_BLKID - bool "blkid" - default BUSYBOX_DEFAULT_BLKID - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Lists labels and UUIDs of all filesystems. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE - bool "Print filesystem type" - default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE - depends on BUSYBOX_CONFIG_BLKID - help - Show TYPE="filesystem type" config BUSYBOX_CONFIG_BLOCKDEV bool "blockdev" default BUSYBOX_DEFAULT_BLOCKDEV help Performs some ioctls with block devices. -config BUSYBOX_CONFIG_CAL - bool "cal" - default BUSYBOX_DEFAULT_CAL - help - cal is used to display a monthly calendar. -config BUSYBOX_CONFIG_CHRT - bool "chrt" - default BUSYBOX_DEFAULT_CHRT - help - manipulate real-time attributes of a process. - This requires sched_{g,s}etparam support in your libc. -config BUSYBOX_CONFIG_DMESG - bool "dmesg" - default BUSYBOX_DEFAULT_DMESG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - dmesg is used to examine or control the kernel ring buffer. When the - Linux kernel prints messages to the system log, they are stored in - the kernel ring buffer. You can use dmesg to print the kernel's ring - buffer, clear the kernel ring buffer, change the size of the kernel - ring buffer, and change the priority level at which kernel messages - are also logged to the system console. Enable this option if you - wish to enable the 'dmesg' utility. - -config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY - bool "Pretty output" - default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY - depends on BUSYBOX_CONFIG_DMESG - help - If you wish to scrub the syslog level from the output, say 'Y' here. - The syslog level is a string prefixed to every line with the form - "<#>". - - With this option you will see: - # dmesg - Linux version 2.6.17.4 ..... - BIOS-provided physical RAM map: - BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - - Without this option you will see: - # dmesg - <5>Linux version 2.6.17.4 ..... - <6>BIOS-provided physical RAM map: - <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) -config BUSYBOX_CONFIG_EJECT - bool "eject" - default BUSYBOX_DEFAULT_EJECT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Used to eject cdroms. (defaults to /dev/cdrom) - -config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI - bool "SCSI support" - default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI - depends on BUSYBOX_CONFIG_EJECT - help - Add the -s option to eject, this allows to eject SCSI-Devices and - usb-storage devices. -config BUSYBOX_CONFIG_FALLOCATE - bool "fallocate" - default BUSYBOX_DEFAULT_FALLOCATE - help - Preallocate space for files. config BUSYBOX_CONFIG_FATATTR bool "fatattr" default BUSYBOX_DEFAULT_FATATTR select BUSYBOX_CONFIG_PLATFORM_LINUX help fatattr lists or changes the file attributes on a fat file system. -config BUSYBOX_CONFIG_FBSET - bool "fbset" - default BUSYBOX_DEFAULT_FBSET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fbset is used to show or change the settings of a Linux frame buffer - device. The frame buffer device provides a simple and unique - interface to access a graphics display. Enable this option - if you wish to enable the 'fbset' utility. - -config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY - bool "Enable extra options" - default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY - depends on BUSYBOX_CONFIG_FBSET - help - This option enables extended fbset options, allowing one to set the - framebuffer size, color depth, etc. interface to access a graphics - display. Enable this option if you wish to enable extended fbset - options. - -config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE - bool "Enable readmode support" - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE - depends on BUSYBOX_CONFIG_FBSET - help - This option allows fbset to read the video mode database stored by - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer - device to pre-defined video modes. -config BUSYBOX_CONFIG_FDFORMAT - bool "fdformat" - default BUSYBOX_DEFAULT_FDFORMAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdformat is used to low-level format a floppy disk. -config BUSYBOX_CONFIG_FDISK - bool "fdisk" - default BUSYBOX_DEFAULT_FDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The fdisk utility is used to divide hard disks into one or more - logical disks, which are generally called partitions. This utility - can be used to list and edit the set of partitions or BSD style - 'disk slices' that are defined on a hard drive. - -config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS - bool "Support over 4GB disks" - default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS - depends on BUSYBOX_CONFIG_FDISK - depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed - -config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - bool "Write support" - default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE - depends on BUSYBOX_CONFIG_FDISK - help - Enabling this option allows you to create or change a partition table - and write those changes out to disk. If you leave this option - disabled, you will only be able to view the partition table. - -config BUSYBOX_CONFIG_FEATURE_AIX_LABEL - bool "Support AIX disklabels" - default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change AIX disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SGI_LABEL - bool "Support SGI disklabels" - default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SGI disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SUN_LABEL - bool "Support SUN disklabels" - default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SUN disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_OSF_LABEL - bool "Support BSD disklabels" - default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change BSD disklabels - and define and edit BSD disk slices. - -config BUSYBOX_CONFIG_FEATURE_GPT_LABEL - bool "Support GPT disklabels" - default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to view GUID Partition Table - disklabels. - -config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED - bool "Support expert mode" - default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to do terribly unsafe things like - define arbitrary drive geometry, move the beginning of data in a - partition, and similarly evil things. Unless you have a very good - reason you would be wise to leave this disabled. -config BUSYBOX_CONFIG_FINDFS - bool "findfs" - default BUSYBOX_DEFAULT_FINDFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Prints the name of a filesystem with given label or UUID. - WARNING: - With all submodules selected, it will add ~8k to busybox. -config BUSYBOX_CONFIG_FLOCK - bool "flock" - default BUSYBOX_DEFAULT_FLOCK - help - Manage locks from shell scripts -config BUSYBOX_CONFIG_FDFLUSH - bool "fdflush" - default BUSYBOX_DEFAULT_FDFLUSH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdflush is only needed when changing media on slightly-broken - removable media drives. It is used to make Linux believe that a - hardware disk-change switch has been actuated, which causes Linux to - forget anything it has cached from the previous media. If you have - such a slightly-broken drive, you will need to run fdflush every time - you change a disk. Most people have working hardware and can safely - leave this disabled. - -config BUSYBOX_CONFIG_FREERAMDISK - bool "freeramdisk" - default BUSYBOX_DEFAULT_FREERAMDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Linux allows you to create ramdisks. This utility allows you to - delete them and completely free all memory that was used for the - ramdisk. For example, if you boot Linux into a ramdisk and later - pivot_root, you may want to free the memory that is allocated to the - ramdisk. If you have no use for freeing memory from a ramdisk, leave - this disabled. -config BUSYBOX_CONFIG_FSCK_MINIX - bool "fsck_minix" - default BUSYBOX_DEFAULT_FSCK_MINIX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. It is not a journaling filesystem however and - can experience corruption if it is not properly unmounted or if the - power goes off in the middle of a write. This utility allows you to - check for and attempt to repair any corruption that occurs to a minix - filesystem. -config BUSYBOX_CONFIG_FSFREEZE - bool "fsfreeze" - default BUSYBOX_DEFAULT_FSFREEZE - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_LONG_OPTS - help - Halt new accesses and flush writes on a mounted filesystem. config BUSYBOX_CONFIG_FSTRIM bool "fstrim" default BUSYBOX_DEFAULT_FSTRIM select BUSYBOX_CONFIG_PLATFORM_LINUX help Discard unused blocks on a mounted filesystem. -config BUSYBOX_CONFIG_GETOPT - bool "getopt" - default BUSYBOX_DEFAULT_GETOPT - help - The getopt utility is used to break up (parse) options in command - lines to make it easy to write complex shell scripts that also check - for legal (and illegal) options. If you want to write horribly - complex shell scripts, or use some horribly complex shell script - written by others, this utility may be for you. Most people will - wisely leave this disabled. - -config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG - bool "Support option -l" - default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS - depends on BUSYBOX_CONFIG_GETOPT - help - Enable support for long options (option -l). -config BUSYBOX_CONFIG_HEXDUMP - bool "hexdump" - default BUSYBOX_DEFAULT_HEXDUMP - help - The hexdump utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. - -config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE - bool "Support -R, reverse of 'hexdump -Cv'" - default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE - depends on BUSYBOX_CONFIG_HEXDUMP - help - The hexdump utility is used to display binary data in an ascii - readable way. This option creates binary data from an ascii input. - NB: this option is non-standard. It's unwise to use it in scripts - aimed to be portable. - -config BUSYBOX_CONFIG_HD - bool "hd" - default BUSYBOX_DEFAULT_HD - help - hd is an alias to hexdump -C. -config BUSYBOX_CONFIG_XXD - bool "xxd" - default BUSYBOX_DEFAULT_XXD - help - The xxd utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. -config BUSYBOX_CONFIG_HWCLOCK - bool "hwclock" - default BUSYBOX_DEFAULT_HWCLOCK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The hwclock utility is used to read and set the hardware clock - on a system. This is primarily used to set the current time on - shutdown in the hardware clock, so the hardware will keep the - correct time when Linux is _not_ running. - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS - bool "Support long options (--hctosys,...)" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS - depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS - bool "Use FHS /var/lib/hwclock/adjtime" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime - depends on BUSYBOX_CONFIG_HWCLOCK - help - Starting with FHS 2.3, the adjtime state file is supposed to exist - at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish - to use the FHS behavior, answer Y here, otherwise answer N for the - classic /etc/adjtime path. - - pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO -config BUSYBOX_CONFIG_IONICE - bool "ionice" - default BUSYBOX_DEFAULT_IONICE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Set/set program io scheduling class and priority - Requires kernel >= 2.6.13 -config BUSYBOX_CONFIG_IPCRM - bool "ipcrm" - default BUSYBOX_DEFAULT_IPCRM - help - The ipcrm utility allows the removal of System V interprocess - communication (IPC) objects and the associated data structures - from the system. -config BUSYBOX_CONFIG_IPCS - bool "ipcs" - default BUSYBOX_DEFAULT_IPCS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The ipcs utility is used to provide information on the currently - allocated System V interprocess (IPC) objects in the system. -config BUSYBOX_CONFIG_LAST - bool "last" - default BUSYBOX_DEFAULT_LAST - depends on BUSYBOX_CONFIG_FEATURE_WTMP - help - 'last' displays a list of the last users that logged into the system. - -config BUSYBOX_CONFIG_FEATURE_LAST_FANCY - bool "Output extra information" - default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY - depends on BUSYBOX_CONFIG_LAST - help - 'last' displays detailed information about the last users that - logged into the system (mimics sysvinit last). +900 bytes. -config BUSYBOX_CONFIG_LOSETUP - bool "losetup" - default BUSYBOX_DEFAULT_LOSETUP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - losetup is used to associate or detach a loop device with a regular - file or block device, and to query the status of a loop device. This - version does not currently support enabling data encryption. -config BUSYBOX_CONFIG_LSPCI - bool "lspci" - default BUSYBOX_DEFAULT_LSPCI - #select PLATFORM_LINUX - help - lspci is a utility for displaying information about PCI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/pci/devices) only. -config BUSYBOX_CONFIG_LSUSB - bool "lsusb" - default BUSYBOX_DEFAULT_LSUSB - #select PLATFORM_LINUX - help - lsusb is a utility for displaying information about USB buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/usb/devices) only. config BUSYBOX_CONFIG_MDEV bool "mdev" default BUSYBOX_DEFAULT_MDEV @@ -481,102 +85,6 @@ config BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE These devices will request userspace look up the files in /lib/firmware/ and if it exists, send it to the kernel for loading into the hardware. -config BUSYBOX_CONFIG_MESG - bool "mesg" - default BUSYBOX_DEFAULT_MESG - help - Mesg controls access to your terminal by others. It is typically - used to allow or disallow other users to write to your terminal - -config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP - bool "Enable writing to tty only by group, not by everybody" - default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP - depends on BUSYBOX_CONFIG_MESG - help - Usually, ttys are owned by group "tty", and "write" tool is - setgid to this group. This way, "mesg y" only needs to enable - "write by owning group" bit in tty mode. - - If you set this option to N, "mesg y" will enable writing - by anybody at all. This is not recommended. -config BUSYBOX_CONFIG_MKE2FS - bool "mke2fs" - default BUSYBOX_DEFAULT_MKE2FS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create EXT2 filesystems. - -config BUSYBOX_CONFIG_MKFS_EXT2 - bool "mkfs.ext2" - default BUSYBOX_DEFAULT_MKFS_EXT2 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Alias to "mke2fs". -config BUSYBOX_CONFIG_MKFS_MINIX - bool "mkfs_minix" - default BUSYBOX_DEFAULT_MKFS_MINIX - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. If you wish to be able to create minix - filesystems this utility will do the job for you. - -config BUSYBOX_CONFIG_FEATURE_MINIX2 - bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" - default BUSYBOX_DEFAULT_FEATURE_MINIX2 - depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX - help - If you wish to be able to create version 2 minix filesystems, enable - this. If you enabled 'mkfs_minix' then you almost certainly want to - be using the version 2 filesystem support. -config BUSYBOX_CONFIG_MKFS_REISER - bool "mkfs_reiser" - default BUSYBOX_DEFAULT_MKFS_REISER - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create ReiserFS filesystems. - Note: this applet needs a lot of testing and polishing. -config BUSYBOX_CONFIG_MKDOSFS - bool "mkdosfs" - default BUSYBOX_DEFAULT_MKDOSFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create FAT32 filesystems. - -config BUSYBOX_CONFIG_MKFS_VFAT - bool "mkfs.vfat" - default BUSYBOX_DEFAULT_MKFS_VFAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Alias to "mkdosfs". -config BUSYBOX_CONFIG_MKSWAP - bool "mkswap" - default BUSYBOX_DEFAULT_MKSWAP - help - The mkswap utility is used to configure a file or disk partition as - Linux swap space. This allows Linux to use the entire file or - partition as if it were additional RAM, which can greatly increase - the capability of low-memory machines. This additional memory is - much slower than real RAM, but can be very helpful at preventing your - applications being killed by the Linux out of memory (OOM) killer. - Once you have created swap space using 'mkswap' you need to enable - the swap space using the 'swapon' utility. - -config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID - bool "UUID support" - default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID - depends on BUSYBOX_CONFIG_MKSWAP - help - Generate swap spaces with universally unique identifiers. -config BUSYBOX_CONFIG_MORE - bool "more" - default BUSYBOX_DEFAULT_MORE - help - more is a simple utility which allows you to read text one screen - sized page at a time. If you want to read text that is larger than - the screen, and you are using anything faster than a 300 baud modem, - you will probably find this utility very helpful. If you don't have - any need to reading text files, you can leave this disabled. config BUSYBOX_CONFIG_MOUNT bool "mount" default BUSYBOX_DEFAULT_MOUNT @@ -650,7 +158,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS config BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS depends on BUSYBOX_CONFIG_MOUNT - bool "Support lots of -o flags" + bool "Support lots of -o flags in mount" default BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS help Without this, mount only supports ro/rw/remount. With this, it @@ -671,11 +179,6 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB default BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB help Support mount -T (specifying an alternate fstab) -config BUSYBOX_CONFIG_MOUNTPOINT - bool "mountpoint" - default BUSYBOX_DEFAULT_MOUNTPOINT - help - mountpoint checks if the directory is a mountpoint. config BUSYBOX_CONFIG_NSENTER bool "nsenter" default BUSYBOX_DEFAULT_NSENTER @@ -690,6 +193,462 @@ config BUSYBOX_CONFIG_FEATURE_NSENTER_LONG_OPTS help Support long options for the nsenter applet. This makes the busybox implementation more compatible with upstream. +config BUSYBOX_CONFIG_REV + bool "rev" + default BUSYBOX_DEFAULT_REV + help + Reverse lines of a file or files. +config BUSYBOX_CONFIG_SETARCH + bool "setarch" + default BUSYBOX_DEFAULT_SETARCH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The linux32 utility is used to create a 32bit environment for the + specified program (usually a shell). It only makes sense to have + this util on a system that supports both 64bit and 32bit userland + (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). +config BUSYBOX_CONFIG_UEVENT + bool "uevent" + default BUSYBOX_DEFAULT_UEVENT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + uevent is a netlink listener for kernel uevent notifications + sent via netlink. It is usually used for dynamic device creation. +config BUSYBOX_CONFIG_UNSHARE + bool "unshare" + default BUSYBOX_DEFAULT_UNSHARE + depends on BUSYBOX_CONFIG_LONG_OPTS && !BUSYBOX_CONFIG_NOMMU + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Run program with some namespaces unshared from parent. + +config BUSYBOX_CONFIG_ACPID + bool "acpid" + default BUSYBOX_DEFAULT_ACPID + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + acpid listens to ACPI events coming either in textual form from + /proc/acpi/event (though it is marked deprecated it is still widely + used and _is_ a standard) or in binary form from specified evdevs + (just use /dev/input/event*). + + It parses the event to retrieve ACTION and a possible PARAMETER. + It then spawns /etc/acpi/[/] either via run-parts + (if the resulting path is a directory) or directly as an executable. + + N.B. acpid relies on run-parts so have the latter installed. + +config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT + bool "Accept and ignore redundant options" + default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT + depends on BUSYBOX_CONFIG_ACPID + help + Accept and ignore compatibility options -g -m -s -S -v. + +config BUSYBOX_CONFIG_BLKID + bool "blkid" + default BUSYBOX_DEFAULT_BLKID + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Lists labels and UUIDs of all filesystems. + WARNING: + With all submodules selected, it will add ~8k to busybox. + +config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE + bool "Print filesystem type" + default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE + depends on BUSYBOX_CONFIG_BLKID + help + Show TYPE="filesystem type" + +config BUSYBOX_CONFIG_DMESG + bool "dmesg" + default BUSYBOX_DEFAULT_DMESG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + dmesg is used to examine or control the kernel ring buffer. When the + Linux kernel prints messages to the system log, they are stored in + the kernel ring buffer. You can use dmesg to print the kernel's ring + buffer, clear the kernel ring buffer, change the size of the kernel + ring buffer, and change the priority level at which kernel messages + are also logged to the system console. Enable this option if you + wish to enable the 'dmesg' utility. + +config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY + bool "Pretty dmesg output" + default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY + depends on BUSYBOX_CONFIG_DMESG + help + If you wish to scrub the syslog level from the output, say 'Y' here. + The syslog level is a string prefixed to every line with the form + "<#>". + + With this option you will see: + # dmesg + Linux version 2.6.17.4 ..... + BIOS-provided physical RAM map: + BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + + Without this option you will see: + # dmesg + <5>Linux version 2.6.17.4 ..... + <6>BIOS-provided physical RAM map: + <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + +config BUSYBOX_CONFIG_FBSET + bool "fbset" + default BUSYBOX_DEFAULT_FBSET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fbset is used to show or change the settings of a Linux frame buffer + device. The frame buffer device provides a simple and unique + interface to access a graphics display. Enable this option + if you wish to enable the 'fbset' utility. + +config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY + bool "Turn on extra fbset options" + default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY + depends on BUSYBOX_CONFIG_FBSET + help + This option enables extended fbset options, allowing one to set the + framebuffer size, color depth, etc. interface to access a graphics + display. Enable this option if you wish to enable extended fbset + options. + +config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE + bool "Turn on fbset readmode support" + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE + depends on BUSYBOX_CONFIG_FBSET + help + This option allows fbset to read the video mode database stored by + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer + device to pre-defined video modes. + +config BUSYBOX_CONFIG_FDFLUSH + bool "fdflush" + default BUSYBOX_DEFAULT_FDFLUSH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdflush is only needed when changing media on slightly-broken + removable media drives. It is used to make Linux believe that a + hardware disk-change switch has been actuated, which causes Linux to + forget anything it has cached from the previous media. If you have + such a slightly-broken drive, you will need to run fdflush every time + you change a disk. Most people have working hardware and can safely + leave this disabled. + +config BUSYBOX_CONFIG_FDFORMAT + bool "fdformat" + default BUSYBOX_DEFAULT_FDFORMAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdformat is used to low-level format a floppy disk. + +config BUSYBOX_CONFIG_FDISK + bool "fdisk" + default BUSYBOX_DEFAULT_FDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The fdisk utility is used to divide hard disks into one or more + logical disks, which are generally called partitions. This utility + can be used to list and edit the set of partitions or BSD style + 'disk slices' that are defined on a hard drive. + +config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS + bool "Support over 4GB disks" + default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS + depends on BUSYBOX_CONFIG_FDISK + depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed + help + Enable this option to support large disks > 4GB. + +config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + bool "Write support" + default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE + depends on BUSYBOX_CONFIG_FDISK + help + Enabling this option allows you to create or change a partition table + and write those changes out to disk. If you leave this option + disabled, you will only be able to view the partition table. + +config BUSYBOX_CONFIG_FEATURE_AIX_LABEL + bool "Support AIX disklabels" + default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change AIX disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SGI_LABEL + bool "Support SGI disklabels" + default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SGI disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SUN_LABEL + bool "Support SUN disklabels" + default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SUN disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_OSF_LABEL + bool "Support BSD disklabels" + default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change BSD disklabels + and define and edit BSD disk slices. + +config BUSYBOX_CONFIG_FEATURE_GPT_LABEL + bool "Support GPT disklabels" + default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to view GUID Partition Table + disklabels. + +config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED + bool "Support expert mode" + default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to do terribly unsafe things like + define arbitrary drive geometry, move the beginning of data in a + partition, and similarly evil things. Unless you have a very good + reason you would be wise to leave this disabled. + +config BUSYBOX_CONFIG_FINDFS + bool "findfs" + default BUSYBOX_DEFAULT_FINDFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Prints the name of a filesystem with given label or UUID. + WARNING: + With all submodules selected, it will add ~8k to busybox. + +config BUSYBOX_CONFIG_FLOCK + bool "flock" + default BUSYBOX_DEFAULT_FLOCK + help + Manage locks from shell scripts + +config BUSYBOX_CONFIG_FREERAMDISK + bool "freeramdisk" + default BUSYBOX_DEFAULT_FREERAMDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Linux allows you to create ramdisks. This utility allows you to + delete them and completely free all memory that was used for the + ramdisk. For example, if you boot Linux into a ramdisk and later + pivot_root, you may want to free the memory that is allocated to the + ramdisk. If you have no use for freeing memory from a ramdisk, leave + this disabled. + +config BUSYBOX_CONFIG_FSCK_MINIX + bool "fsck_minix" + default BUSYBOX_DEFAULT_FSCK_MINIX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. It is not a journaling filesystem however and + can experience corruption if it is not properly unmounted or if the + power goes off in the middle of a write. This utility allows you to + check for and attempt to repair any corruption that occurs to a minix + filesystem. + +config BUSYBOX_CONFIG_MKFS_EXT2 + bool "mkfs_ext2" + default BUSYBOX_DEFAULT_MKFS_EXT2 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create EXT2 filesystems. + +config BUSYBOX_CONFIG_MKFS_MINIX + bool "mkfs_minix" + default BUSYBOX_DEFAULT_MKFS_MINIX + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. If you wish to be able to create minix + filesystems this utility will do the job for you. + +config BUSYBOX_CONFIG_FEATURE_MINIX2 + bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" + default BUSYBOX_DEFAULT_FEATURE_MINIX2 + depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX + help + If you wish to be able to create version 2 minix filesystems, enable + this. If you enabled 'mkfs_minix' then you almost certainly want to + be using the version 2 filesystem support. + +config BUSYBOX_CONFIG_MKFS_REISER + bool "mkfs_reiser" + default BUSYBOX_DEFAULT_MKFS_REISER + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create ReiserFS filesystems. + Note: this applet needs a lot of testing and polishing. + +config BUSYBOX_CONFIG_MKFS_VFAT + bool "mkfs_vfat" + default BUSYBOX_DEFAULT_MKFS_VFAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create FAT32 filesystems. + +config BUSYBOX_CONFIG_GETOPT + bool "getopt" + default BUSYBOX_DEFAULT_GETOPT + help + The getopt utility is used to break up (parse) options in command + lines to make it easy to write complex shell scripts that also check + for legal (and illegal) options. If you want to write horribly + complex shell scripts, or use some horribly complex shell script + written by others, this utility may be for you. Most people will + wisely leave this disabled. + +config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG + bool "Support option -l" + default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS + depends on BUSYBOX_CONFIG_GETOPT + help + Enable support for long options (option -l). + +config BUSYBOX_CONFIG_HEXDUMP + bool "hexdump" + default BUSYBOX_DEFAULT_HEXDUMP + help + The hexdump utility is used to display binary data in a readable + way that is comparable to the output from most hex editors. + +config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE + bool "Support -R, reverse of 'hexdump -Cv'" + default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE + depends on BUSYBOX_CONFIG_HEXDUMP + help + The hexdump utility is used to display binary data in an ascii + readable way. This option creates binary data from an ascii input. + NB: this option is non-standard. It's unwise to use it in scripts + aimed to be portable. + +config BUSYBOX_CONFIG_HD + bool "hd" + default BUSYBOX_DEFAULT_HD + depends on BUSYBOX_CONFIG_HEXDUMP + help + hd is an alias to hexdump -C. + +config BUSYBOX_CONFIG_HWCLOCK + bool "hwclock" + default BUSYBOX_DEFAULT_HWCLOCK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The hwclock utility is used to read and set the hardware clock + on a system. This is primarily used to set the current time on + shutdown in the hardware clock, so the hardware will keep the + correct time when Linux is _not_ running. + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS + bool "Support long options (--hctosys,...)" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS + depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS + help + By default, the hwclock utility only uses short options. If you + are overly fond of its long options, such as --hctosys, --utc, etc) + then enable this option. + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS + bool "Use FHS /var/lib/hwclock/adjtime" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime + depends on BUSYBOX_CONFIG_HWCLOCK + help + Starting with FHS 2.3, the adjtime state file is supposed to exist + at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish + to use the FHS behavior, answer Y here, otherwise answer N for the + classic /etc/adjtime path. + + pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO + +config BUSYBOX_CONFIG_IPCRM + bool "ipcrm" + default BUSYBOX_DEFAULT_IPCRM + help + The ipcrm utility allows the removal of System V interprocess + communication (IPC) objects and the associated data structures + from the system. + +config BUSYBOX_CONFIG_IPCS + bool "ipcs" + default BUSYBOX_DEFAULT_IPCS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The ipcs utility is used to provide information on the currently + allocated System V interprocess (IPC) objects in the system. + +config BUSYBOX_CONFIG_LOSETUP + bool "losetup" + default BUSYBOX_DEFAULT_LOSETUP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + losetup is used to associate or detach a loop device with a regular + file or block device, and to query the status of a loop device. This + version does not currently support enabling data encryption. + +config BUSYBOX_CONFIG_LSPCI + bool "lspci" + default BUSYBOX_DEFAULT_LSPCI + #select PLATFORM_LINUX + help + lspci is a utility for displaying information about PCI buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/pci/devices) only. + +config BUSYBOX_CONFIG_LSUSB + bool "lsusb" + default BUSYBOX_DEFAULT_LSUSB + #select PLATFORM_LINUX + help + lsusb is a utility for displaying information about USB buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/usb/devices) only. + +config BUSYBOX_CONFIG_MKSWAP + bool "mkswap" + default BUSYBOX_DEFAULT_MKSWAP + help + The mkswap utility is used to configure a file or disk partition as + Linux swap space. This allows Linux to use the entire file or + partition as if it were additional RAM, which can greatly increase + the capability of low-memory machines. This additional memory is + much slower than real RAM, but can be very helpful at preventing your + applications being killed by the Linux out of memory (OOM) killer. + Once you have created swap space using 'mkswap' you need to enable + the swap space using the 'swapon' utility. + +config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID + bool "UUID support" + default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID + depends on BUSYBOX_CONFIG_MKSWAP + help + Generate swap spaces with universally unique identifiers. + +config BUSYBOX_CONFIG_MORE + bool "more" + default BUSYBOX_DEFAULT_MORE + help + more is a simple utility which allows you to read text one screen + sized page at a time. If you want to read text that is larger than + the screen, and you are using anything faster than a 300 baud modem, + you will probably find this utility very helpful. If you don't have + any need to reading text files, you can leave this disabled. + config BUSYBOX_CONFIG_PIVOT_ROOT bool "pivot_root" default BUSYBOX_DEFAULT_PIVOT_ROOT @@ -702,6 +661,7 @@ config BUSYBOX_CONFIG_PIVOT_ROOT Note: This is for initrd in linux 2.4. Under initramfs (introduced in linux 2.6) use switch_root instead. + config BUSYBOX_CONFIG_RDATE bool "rdate" default BUSYBOX_DEFAULT_RDATE @@ -710,87 +670,46 @@ config BUSYBOX_CONFIG_RDATE system clock with the date and time of a remote networked system using the RFC868 protocol, which is built into the inetd daemon on most systems. + config BUSYBOX_CONFIG_RDEV bool "rdev" default BUSYBOX_DEFAULT_RDEV help Print the device node associated with the filesystem mounted at '/'. + config BUSYBOX_CONFIG_READPROFILE bool "readprofile" default BUSYBOX_DEFAULT_READPROFILE #select PLATFORM_LINUX help This allows you to parse /proc/profile for basic profiling. -config BUSYBOX_CONFIG_RENICE - bool "renice" - default BUSYBOX_DEFAULT_RENICE - help - Renice alters the scheduling priority of one or more running - processes. -config BUSYBOX_CONFIG_REV - bool "rev" - default BUSYBOX_DEFAULT_REV - help - Reverse lines of a file or files. + config BUSYBOX_CONFIG_RTCWAKE bool "rtcwake" default BUSYBOX_DEFAULT_RTCWAKE select BUSYBOX_CONFIG_PLATFORM_LINUX help Enter a system sleep state until specified wakeup time. + config BUSYBOX_CONFIG_SCRIPT bool "script" default BUSYBOX_DEFAULT_SCRIPT help The script makes typescript of terminal session. + config BUSYBOX_CONFIG_SCRIPTREPLAY bool "scriptreplay" default BUSYBOX_DEFAULT_SCRIPTREPLAY help This program replays a typescript, using timing information given by script -t. -config BUSYBOX_CONFIG_SETARCH - bool "setarch" - default BUSYBOX_DEFAULT_SETARCH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The linux32 utility is used to create a 32bit environment for the - specified program (usually a shell). It only makes sense to have - this util on a system that supports both 64bit and 32bit userland - (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). -config BUSYBOX_CONFIG_LINUX32 - bool "linux32" - default BUSYBOX_DEFAULT_LINUX32 +config BUSYBOX_CONFIG_SWAPONOFF + bool "swaponoff" + default BUSYBOX_DEFAULT_SWAPONOFF select BUSYBOX_CONFIG_PLATFORM_LINUX help - Alias to "setarch linux32". - -config BUSYBOX_CONFIG_LINUX64 - bool "linux64" - default BUSYBOX_DEFAULT_LINUX64 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Alias to "setarch linux64". -config BUSYBOX_CONFIG_SETPRIV - bool "setpriv" - default BUSYBOX_DEFAULT_SETPRIV - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_LONG_OPTS - help - Run a program with different Linux privilege settings. - Requires kernel >= 3.5 -config BUSYBOX_CONFIG_SETSID - bool "setsid" - default BUSYBOX_DEFAULT_SETSID - help - setsid runs a program in a new session -config BUSYBOX_CONFIG_SWAPON - bool "swapon" - default BUSYBOX_DEFAULT_SWAPON - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This option enables the 'swapon' utility. + This option enables both the 'swapon' and the 'swapoff' utilities. Once you have created some swap space using 'mkswap', you also need to enable your swap space with the 'swapon' utility. The 'swapoff' utility is used, typically at system shutdown, to disable any swap @@ -800,7 +719,7 @@ config BUSYBOX_CONFIG_SWAPON config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD bool "Support discard option -d" default BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD - depends on BUSYBOX_CONFIG_SWAPON + depends on BUSYBOX_CONFIG_SWAPONOFF help Enable support for discarding swap area blocks at swapon and/or as the kernel frees them. This option enables both the -d option on @@ -809,16 +728,10 @@ config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD config BUSYBOX_CONFIG_FEATURE_SWAPON_PRI bool "Support priority option -p" default BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI - depends on BUSYBOX_CONFIG_SWAPON + depends on BUSYBOX_CONFIG_SWAPONOFF help Enable support for setting swap device priority in swapon. -config BUSYBOX_CONFIG_SWAPOFF - bool "swapoff" - default BUSYBOX_DEFAULT_SWAPOFF - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This option enables the 'swapoff' utility. config BUSYBOX_CONFIG_SWITCH_ROOT bool "switch_root" default BUSYBOX_DEFAULT_SWITCH_ROOT @@ -838,28 +751,7 @@ config BUSYBOX_CONFIG_SWITCH_ROOT * Because the Linux kernel uses rootfs internally as the starting and ending point for searching through the kernel's doubly linked list of active mount points. That's why. -config BUSYBOX_CONFIG_TASKSET - bool "taskset" - default BUSYBOX_DEFAULT_TASKSET - help - Retrieve or set a processes's CPU affinity. - This requires sched_{g,s}etaffinity support in your libc. -config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY - bool "Fancy output" - default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - depends on BUSYBOX_CONFIG_TASKSET - help - Needed for machines with more than 32-64 CPUs: - affinity parameter 0xHHHHHHHHHHHHHHHHHHHH can be arbitrarily long - in this case. Otherwise, it is limited to sizeof(long). -config BUSYBOX_CONFIG_UEVENT - bool "uevent" - default BUSYBOX_DEFAULT_UEVENT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - uevent is a netlink listener for kernel uevent notifications - sent via netlink. It is usually used for dynamic device creation. config BUSYBOX_CONFIG_UMOUNT bool "umount" default BUSYBOX_DEFAULT_UMOUNT @@ -876,20 +768,6 @@ config BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL depends on BUSYBOX_CONFIG_UMOUNT help Support -a option to unmount all currently mounted filesystems. -config BUSYBOX_CONFIG_UNSHARE - bool "unshare" - default BUSYBOX_DEFAULT_UNSHARE - depends on !BUSYBOX_CONFIG_NOMMU - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_LONG_OPTS - help - Run program with some namespaces unshared from parent. -config BUSYBOX_CONFIG_WALL - bool "wall" - default BUSYBOX_DEFAULT_WALL - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Write a message to all users that are logged in. comment "Common options for mount/umount" depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT @@ -924,7 +802,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP_CREATE if it does not find a free one. config BUSYBOX_CONFIG_FEATURE_MTAB_SUPPORT - bool "Support old /etc/mtab file" + bool "Support for the old /etc/mtab file" default BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT select BUSYBOX_CONFIG_FEATURE_MOUNT_FAKE diff --git a/package/utils/busybox/config/util-linux/volume_id/Config.in b/package/utils/busybox/config/util-linux/volume_id/Config.in index afbfa4ae5..6153314d6 100644 --- a/package/utils/busybox/config/util-linux/volume_id/Config.in +++ b/package/utils/busybox/config/util-linux/volume_id/Config.in @@ -11,18 +11,31 @@ config BUSYBOX_CONFIG_VOLUMEID menu "Filesystem/Volume identification" depends on BUSYBOX_CONFIG_VOLUMEID + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BCACHE bool "bcache filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS bool "btrfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_CRAMFS bool "cramfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT bool "exFAT filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT @@ -31,10 +44,16 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT exFAT (extended FAT) is a proprietary file system designed especially for flash drives. It has many features from NTFS, but with less overhead. exFAT is used on most SDXC cards for consumer electronics. + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXT bool "Ext filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXT depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS bool "f2fs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_F2FS @@ -44,34 +63,64 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS which is adapted to newer forms of storage. F2FS also remedies some known issues of the older log structured file systems, such as high cleaning overhead. + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_FAT bool "fat filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_FAT depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_HFS bool "hfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_HFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ISO9660 bool "iso9660 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ISO9660 depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_JFS bool "jfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_JFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXRAID bool "linuxraid" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXRAID depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP bool "linux swap filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXSWAP depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LUKS bool "luks filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LUKS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS bool "nilfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NILFS @@ -87,22 +136,40 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS SOX compliance logging, and so forth. It can serve as an alternative filesystem for Linux desktop environment, or as a basis of advanced storage appliances. + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NTFS bool "ntfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NTFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_OCFS2 bool "ocfs2 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_OCFS2 depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_REISERFS bool "Reiser filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_REISERFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ROMFS bool "romfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ROMFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS bool "SquashFS filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS @@ -112,76 +179,134 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS intended for general read-only filesystem use and in constrained block device/memory systems (e.g. embedded systems) where low overhead is needed. + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SYSV bool "sysv filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV depends on BUSYBOX_CONFIG_VOLUMEID -config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS - bool "UBIFS filesystem" - default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS - depends on BUSYBOX_CONFIG_VOLUMEID help - UBIFS (Unsorted Block Image File System) is a file - system for use with raw flash memory media. + TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UDF bool "udf filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + + ### config FEATURE_VOLUMEID_HIGHPOINTRAID ### bool "highpoint raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_HPFS ### bool "hpfs filesystem" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_ISWRAID ### bool "intel raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_LSIRAID ### bool "lsi raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_LVM ### bool "lvm" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_MAC ### bool "mac filesystem" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_MINIX ### bool "minix filesystem" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_MSDOS ### bool "msdos filesystem" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_NVIDIARAID ### bool "nvidia raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_PROMISERAID ### bool "promise raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_SILICONRAID ### bool "silicon raid" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_UFS ### bool "ufs filesystem" ### default y ### depends on VOLUMEID +### help +### TODO + + ### config FEATURE_VOLUMEID_VIARAID ### bool "via raid" ### default y ### depends on VOLUMEID +### help +### TODO + + config BUSYBOX_CONFIG_FEATURE_VOLUMEID_XFS bool "xfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS depends on BUSYBOX_CONFIG_VOLUMEID + help + TODO + endmenu diff --git a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch new file mode 100644 index 000000000..f33c3b22e --- /dev/null +++ b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch @@ -0,0 +1,37 @@ +From 7cef4817d6d6d61a1166ed7dfc13537b95c65970 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Thu, 15 Sep 2016 13:20:51 +0200 +Subject: [PATCH] libbb:/send_to_from: do not require that "to" should have the + same AF. Closes 9146 + +Signed-off-by: Denys Vlasenko +--- + libbb/udp_io.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/libbb/udp_io.c ++++ b/libbb/udp_io.c +@@ -70,7 +70,13 @@ send_to_from(int fd, void *buf, size_t l + msg.msg_flags = flags; + + cmsgptr = CMSG_FIRSTHDR(&msg); +- if (to->sa_family == AF_INET && from->sa_family == AF_INET) { ++ /* ++ * Users report that to->sa_family can be AF_INET6 too, ++ * if "to" was acquired by recv_from_to(). IOW: recv_from_to() ++ * was seen showing IPv6 "from" even when the destination ++ * of received packet (our local address) was IPv4. ++ */ ++ if (/* to->sa_family == AF_INET && */ from->sa_family == AF_INET) { + struct in_pktinfo *pktptr; + cmsgptr->cmsg_level = IPPROTO_IP; + cmsgptr->cmsg_type = IP_PKTINFO; +@@ -86,7 +92,7 @@ send_to_from(int fd, void *buf, size_t l + pktptr->ipi_spec_dst = ((struct sockaddr_in*)from)->sin_addr; + } + # if ENABLE_FEATURE_IPV6 && defined(IPV6_PKTINFO) +- else if (to->sa_family == AF_INET6 && from->sa_family == AF_INET6) { ++ else if (/* to->sa_family == AF_INET6 && */ from->sa_family == AF_INET6) { + struct in6_pktinfo *pktptr; + cmsgptr->cmsg_level = IPPROTO_IPV6; + cmsgptr->cmsg_type = IPV6_PKTINFO; diff --git a/package/utils/busybox/patches/102-trylink_mktemp_fix.patch b/package/utils/busybox/patches/102-trylink_mktemp_fix.patch new file mode 100644 index 000000000..ed1dcbb66 --- /dev/null +++ b/package/utils/busybox/patches/102-trylink_mktemp_fix.patch @@ -0,0 +1,20 @@ +--- a/scripts/trylink ++++ b/scripts/trylink +@@ -46,7 +46,7 @@ try() { + } + + check_cc() { +- local tempname="$(mktemp)" ++ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" + local r + echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c + # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( +@@ -61,7 +61,7 @@ check_cc() { + } + + check_libc_is_glibc() { +- local tempname="$(mktemp)" ++ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" + local r + echo "\ + #include diff --git a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch new file mode 100644 index 000000000..4825bc8a6 --- /dev/null +++ b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch @@ -0,0 +1,12 @@ +--- a/util-linux/mount.c ++++ b/util-linux/mount.c +@@ -237,9 +237,6 @@ + #if ENABLE_FEATURE_MOUNT_NFS + /* This is just a warning of a common mistake. Possibly this should be a + * uclibc faq entry rather than in busybox... */ +-# if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__) +-# error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support" +-# endif + # include + # include + # include diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch index 5f64c19d0..0fdaed502 100644 --- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch +++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -706,6 +706,7 @@ static int bcast_or_ucast(struct dhcp_pa +@@ -697,6 +697,7 @@ static int bcast_or_ucast(struct dhcp_pa static NOINLINE int send_discover(uint32_t xid, uint32_t requested) { struct dhcp_packet packet; @@ -8,7 +8,7 @@ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), -@@ -723,6 +724,7 @@ static NOINLINE int send_discover(uint32 +@@ -714,6 +715,7 @@ static NOINLINE int send_discover(uint32 */ add_client_options(&packet); diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch index 727f69409..4a9ae9813 100644 --- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch +++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1442,6 +1442,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c +@@ -1422,6 +1422,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c /* silence "uninitialized!" warning */ unsigned timestamp_before_wait = timestamp_before_wait; diff --git a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch index 7b77d2970..1e44552c1 100644 --- a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch +++ b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1112,7 +1112,6 @@ static void perform_renew(void) +@@ -1103,7 +1103,6 @@ static void perform_renew(void) state = RENEW_REQUESTED; break; case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ diff --git a/package/utils/busybox/patches/210-add_netmsg_util.patch b/package/utils/busybox/patches/210-add_netmsg_util.patch index d7b2ae7c4..2382698d0 100644 --- a/package/utils/busybox/patches/210-add_netmsg_util.patch +++ b/package/utils/busybox/patches/210-add_netmsg_util.patch @@ -1,25 +1,46 @@ +--- a/include/applets.src.h ++++ b/include/applets.src.h +@@ -229,6 +229,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO + IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) + IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) + IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) ++IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) + IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) + IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) + IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) +--- a/networking/Config.src ++++ b/networking/Config.src +@@ -639,6 +639,12 @@ config FEATURE_IPCALC_LONG_OPTIONS + help + Support long options for the ipcalc applet. + ++config NETMSG ++ bool "netmsg" ++ default n ++ help ++ simple program for sending udp broadcast messages ++ + config NETSTAT + bool "netstat" + default y +--- a/networking/Kbuild.src ++++ b/networking/Kbuild.src +@@ -27,6 +27,7 @@ lib-$(CONFIG_IP) += ip.o + lib-$(CONFIG_IPCALC) += ipcalc.o + lib-$(CONFIG_NAMEIF) += nameif.o + lib-$(CONFIG_NC) += nc.o ++lib-$(CONFIG_NETMSG) += netmsg.o + lib-$(CONFIG_NETSTAT) += netstat.o + lib-$(CONFIG_NSLOOKUP) += nslookup.o + lib-$(CONFIG_NTPD) += ntpd.o --- /dev/null +++ b/networking/netmsg.c -@@ -0,0 +1,76 @@ +@@ -0,0 +1,65 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ -+ -+//config:config NETMSG -+//config: bool "netmsg" -+//config: default n -+//config: help -+//config: simple program for sending udp broadcast messages -+ -+//applet:IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) -+ -+//kbuild:lib-$(CONFIG_NETMSG) += netmsg.o -+ -+//usage:#define netmsg_trivial_usage NOUSAGE_STR -+//usage:#define netmsg_full_usage "" -+ +#include +#include +#include @@ -29,6 +50,9 @@ +#include +#include "busybox.h" + ++//usage:#define netmsg_trivial_usage NOUSAGE_STR ++//usage:#define netmsg_full_usage "" ++ +#ifndef CONFIG_NETMSG +int main(int argc, char **argv) +#else diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch index 4e46b74f0..c60f5db39 100644 --- a/package/utils/busybox/patches/220-add_lock_util.patch +++ b/package/utils/busybox/patches/220-add_lock_util.patch @@ -1,25 +1,46 @@ +--- a/include/applets.src.h ++++ b/include/applets.src.h +@@ -196,6 +196,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, + IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) + IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) + IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) ++IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) + IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) + IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) + IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) +--- a/miscutils/Config.src ++++ b/miscutils/Config.src +@@ -375,6 +375,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA + help + Enables the 'hdparm -d' option to get/set using_dma flag. + ++config LOCK ++ bool "lock" ++ default n ++ help ++ Small utility for using locks in scripts ++ + config MAKEDEVS + bool "makedevs" + default y +--- a/miscutils/Kbuild.src ++++ b/miscutils/Kbuild.src +@@ -33,6 +33,7 @@ lib-$(CONFIG_LAST) += last.o + endif + + lib-$(CONFIG_LESS) += less.o ++lib-$(CONFIG_LOCK) += lock.o + lib-$(CONFIG_MAKEDEVS) += makedevs.o + lib-$(CONFIG_MAN) += man.o + lib-$(CONFIG_MICROCOM) += microcom.o --- /dev/null +++ b/miscutils/lock.c -@@ -0,0 +1,155 @@ +@@ -0,0 +1,144 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ -+ -+//config:config LOCK -+//config: bool "lock" -+//config: default n -+//config: help -+//config: Small utility for using locks in scripts -+ -+//applet:IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) -+ -+//kbuild:lib-$(CONFIG_LOCK) += lock.o -+ -+//usage:#define lock_trivial_usage NOUSAGE_STR -+//usage:#define lock_full_usage "" -+ +#include +#include +#include @@ -29,6 +50,9 @@ +#include +#include "busybox.h" + ++//usage:#define lock_trivial_usage NOUSAGE_STR ++//usage:#define lock_full_usage "" ++ +static int unlock = 0; +static int shared = 0; +static int waitonly = 0; diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch index 14c0e87b3..976960cf1 100644 --- a/package/utils/busybox/patches/230-add_nslookup_lede.patch +++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch @@ -17,6 +17,8 @@ Signed-off-by: Jo-Philipp Wich 2 files changed, 921 insertions(+) create mode 100644 networking/nslookup_lede.c +diff --git a/Makefile.flags b/Makefile.flags +index 65021de25..096ab7756 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -134,6 +134,12 @@ else @@ -32,6 +34,9 @@ Signed-off-by: Jo-Philipp Wich # libpam may use libpthread, libdl and/or libaudit. # On some platforms that requires an explicit -lpthread, -ldl, -laudit. # However, on *other platforms* it fails when some of those flags +diff --git a/networking/nslookup_lede.c b/networking/nslookup_lede.c +new file mode 100644 +index 000000000..c6c90ddf3 --- /dev/null +++ b/networking/nslookup_lede.c @@ -0,0 +1,915 @@ @@ -53,23 +58,23 @@ Signed-off-by: Jo-Philipp Wich + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + -+//config:config NSLOOKUP_OPENWRT -+//config: bool "nslookup_openwrt" ++//config:config NSLOOKUP_LEDE ++//config: bool "nslookup_lede" +//config: depends on !NSLOOKUP +//config: default y +//config: help +//config: nslookup is a tool to query Internet name servers (LEDE flavor). +//config: -+//config:config FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS ++//config:config FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y -+//config: depends on NSLOOKUP_OPENWRT && LONG_OPTS ++//config: depends on NSLOOKUP_LEDE && LONG_OPTS +//config: help +//config: Support long options for the nslookup applet. + -+//applet:IF_NSLOOKUP_OPENWRT(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) ++//applet:IF_NSLOOKUP_LEDE(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) + -+//kbuild:lib-$(CONFIG_NSLOOKUP_OPENWRT) += nslookup_lede.o ++//kbuild:lib-$(CONFIG_NSLOOKUP_LEDE) += nslookup_lede.o + +//usage:#define nslookup_lede_trivial_usage +//usage: "[HOST] [SERVER]" @@ -753,7 +758,7 @@ Signed-off-by: Jo-Philipp Wich +} + + -+#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +static const char nslookup_longopts[] ALIGN1 = + "type\0" Required_argument "q" + "querytype\0" Required_argument "q" @@ -778,7 +783,7 @@ Signed-off-by: Jo-Philipp Wich + unsigned int types = 0; + HEADER *header; + -+#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS + applet_long_options = nslookup_longopts; +#endif + @@ -950,3 +955,6 @@ Signed-off-by: Jo-Philipp Wich + + return rc; +} +-- +2.11.0 + diff --git a/package/utils/busybox/patches/240-telnetd_intr.patch b/package/utils/busybox/patches/240-telnetd_intr.patch index fec2a3a5d..d52ea3fcc 100644 --- a/package/utils/busybox/patches/240-telnetd_intr.patch +++ b/package/utils/busybox/patches/240-telnetd_intr.patch @@ -1,6 +1,6 @@ --- a/networking/telnetd.c +++ b/networking/telnetd.c -@@ -497,6 +497,7 @@ make_new_session( +@@ -333,6 +333,7 @@ make_new_session( /* Restore default signal handling ASAP */ bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); diff --git a/package/utils/busybox/patches/250-date-k-flag.patch b/package/utils/busybox/patches/250-date-k-flag.patch index 476440f62..b2681a17f 100644 --- a/package/utils/busybox/patches/250-date-k-flag.patch +++ b/package/utils/busybox/patches/250-date-k-flag.patch @@ -1,6 +1,6 @@ --- a/coreutils/date.c +++ b/coreutils/date.c -@@ -122,6 +122,7 @@ +@@ -123,6 +123,7 @@ //usage: IF_FEATURE_DATE_ISOFMT( //usage: "\n -D FMT Use FMT for -d TIME conversion" //usage: ) @@ -8,7 +8,7 @@ //usage: "\n" //usage: "\nRecognized TIME formats:" //usage: "\n hh:mm[:ss]" -@@ -138,9 +139,8 @@ +@@ -139,9 +140,8 @@ #include "libbb.h" #include "common_bufsiz.h" @@ -20,7 +20,7 @@ enum { OPT_RFC2822 = (1 << 0), /* R */ -@@ -148,8 +148,9 @@ enum { +@@ -149,8 +149,9 @@ enum { OPT_UTC = (1 << 2), /* u */ OPT_DATE = (1 << 3), /* d */ OPT_REFERENCE = (1 << 4), /* r */ @@ -32,7 +32,7 @@ }; static void maybe_set_utc(int opt) -@@ -167,12 +168,15 @@ static const char date_longopts[] ALIGN1 +@@ -168,12 +169,15 @@ static const char date_longopts[] ALIGN1 /* "universal\0" No_argument "u" */ "date\0" Required_argument "d" "reference\0" Required_argument "r" @@ -48,7 +48,7 @@ struct timespec ts; struct tm tm_time; char buf_fmt_dt2str[64]; -@@ -187,7 +191,7 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -188,7 +192,7 @@ int date_main(int argc UNUSED_PARAM, cha opt_complementary = "d--s:s--d" IF_FEATURE_DATE_ISOFMT(":R--I:I--R"); IF_LONG_OPTS(applet_long_options = date_longopts;) @@ -57,7 +57,7 @@ IF_FEATURE_DATE_ISOFMT("I::D:"), &date_str, &date_str, &filename IF_FEATURE_DATE_ISOFMT(, &isofmt_arg, &fmt_str2dt)); -@@ -244,6 +248,31 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -245,6 +249,31 @@ int date_main(int argc UNUSED_PARAM, cha if (*argv) bb_show_usage(); diff --git a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch index ca76c44cc..360324bf7 100644 --- a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch +++ b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch @@ -1,6 +1,6 @@ --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c -@@ -598,7 +598,7 @@ static int do_add_or_delete(char **argv, +@@ -470,7 +470,7 @@ static int do_add_or_delete(char **argv, } xrtnl_open(&rth); ll_init_map(&rth); diff --git a/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch b/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch new file mode 100644 index 000000000..7b4797505 --- /dev/null +++ b/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch @@ -0,0 +1,145 @@ +From dbac30c3784c267bbe44a2a3ebed4e827c8fe82a Mon Sep 17 00:00:00 2001 +From: Stefan Tomanek +Date: Tue, 13 Jun 2017 19:06:09 +0200 +Subject: [PATCH] ip rule: add suppress_{prefixlength,ifgroup} options + +(cherry-picked from 192dce4b84fb32346ebc5194de7daa5da3b8d1b4) + +function old new delta +iprule_modify 816 887 +71 +print_rule 610 680 +70 +------------------------------------------------------------------------------ +(add/remove: 0/0 grow/shrink: 2/0 up/down: 141/0) Total: 141 bytes + +Signed-off-by: Stefan Tomanek +Signed-off-by: Denys Vlasenko +--- + networking/libiproute/iprule.c | 73 ++++++++++++++++++++++++++---------------- + 1 file changed, 46 insertions(+), 27 deletions(-) + +--- a/networking/libiproute/iprule.c ++++ b/networking/libiproute/iprule.c +@@ -17,25 +17,32 @@ + #include + #include + ++/* from : */ ++#define FRA_SUPPRESS_IFGROUP 13 ++#define FRA_SUPPRESS_PREFIXLEN 14 ++ + #include "ip_common.h" /* #include "libbb.h" is inside */ + #include "rt_names.h" + #include "utils.h" + +-/* +-static void usage(void) __attribute__((noreturn)); +- +-static void usage(void) +-{ +- fprintf(stderr, "Usage: ip rule [ list | add | del ] SELECTOR ACTION\n"); +- fprintf(stderr, "SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK ]\n"); +- fprintf(stderr, " [ dev STRING ] [ pref NUMBER ]\n"); +- fprintf(stderr, "ACTION := [ table TABLE_ID ] [ nat ADDRESS ]\n"); +- fprintf(stderr, " [ prohibit | reject | unreachable ]\n"); +- fprintf(stderr, " [ realms [SRCREALM/]DSTREALM ]\n"); +- fprintf(stderr, "TABLE_ID := [ local | main | default | NUMBER ]\n"); +- exit(-1); +-} +-*/ ++/* If you add stuff here, update iprule_full_usage */ ++static const char keywords[] ALIGN1 = ++ "from\0""to\0""preference\0""order\0""priority\0" ++ "tos\0""fwmark\0""realms\0""table\0""lookup\0" ++ "suppress_prefixlength\0""suppress_ifgroup\0" ++ "dev\0""iif\0""nat\0""map-to\0""type\0""help\0" ++ ; ++#define keyword_preference (keywords + sizeof("from") + sizeof("to")) ++#define keyword_fwmark (keyword_preference + sizeof("preference") + sizeof("order") + sizeof("priority") + sizeof("tos")) ++#define keyword_realms (keyword_fwmark + sizeof("fwmark")) ++#define keyword_suppress_prefixlength (keyword_realms + sizeof("realms") + sizeof("table") + sizeof("lookup")) ++#define keyword_suppress_ifgroup (keyword_suppress_prefixlength + sizeof("suppress_prefixlength")) ++enum { ++ ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, ++ ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, ++ ARG_suppress_prefixlength, ARG_suppress_ifgroup, ++ ARG_dev, ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help, ++}; + + static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, + struct nlmsghdr *n, void *arg UNUSED_PARAM) +@@ -119,6 +126,17 @@ static int FAST_FUNC print_rule(const st + else if (r->rtm_table) + printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); + ++ if (tb[FRA_SUPPRESS_PREFIXLEN]) { ++ int pl = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_PREFIXLEN]); ++ if (pl != -1) ++ printf("%s %d ", keyword_suppress_prefixlength, pl); ++ } ++ if (tb[FRA_SUPPRESS_IFGROUP]) { ++ int grp = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_IFGROUP]); ++ if (grp != -1) ++ printf("%s %d ", keyword_suppress_ifgroup, grp); ++ } ++ + if (tb[RTA_FLOW]) { + uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]); + uint32_t from = to>>16; +@@ -174,15 +192,6 @@ static int iprule_list(char **argv) + /* Return value becomes exitcode. It's okay to not return at all */ + static int iprule_modify(int cmd, char **argv) + { +- static const char keywords[] ALIGN1 = +- "from\0""to\0""preference\0""order\0""priority\0" +- "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" +- "iif\0""nat\0""map-to\0""type\0""help\0"; +- enum { +- ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, +- ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, ARG_dev, +- ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help +- }; + bool table_ok = 0; + struct rtnl_handle rth; + struct { +@@ -232,7 +241,7 @@ static int iprule_modify(int cmd, char * + ) { + uint32_t pref; + NEXT_ARG(); +- pref = get_u32(*argv, "preference"); ++ pref = get_u32(*argv, keyword_preference); + addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref); + } else if (key == ARG_tos) { + uint32_t tos; +@@ -243,13 +252,13 @@ static int iprule_modify(int cmd, char * + } else if (key == ARG_fwmark) { + uint32_t fwmark; + NEXT_ARG(); +- fwmark = get_u32(*argv, "fwmark"); ++ fwmark = get_u32(*argv, keyword_fwmark); + addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark); + } else if (key == ARG_realms) { + uint32_t realm; + NEXT_ARG(); + if (get_rt_realms(&realm, *argv)) +- invarg_1_to_2(*argv, "realms"); ++ invarg_1_to_2(*argv, keyword_realms); + addattr32(&req.n, sizeof(req), RTA_FLOW, realm); + } else if (key == ARG_table || + key == ARG_lookup +@@ -265,6 +274,16 @@ static int iprule_modify(int cmd, char * + addattr32(&req.n, sizeof(req), RTA_TABLE, tid); + } + table_ok = 1; ++ } else if (key == ARG_suppress_prefixlength) { ++ int prefix_length; ++ NEXT_ARG(); ++ prefix_length = get_u32(*argv, keyword_suppress_prefixlength); ++ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_PREFIXLEN, prefix_length); ++ } else if (key == ARG_suppress_ifgroup) { ++ int grp; ++ NEXT_ARG(); ++ grp = get_u32(*argv, keyword_suppress_ifgroup); ++ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_IFGROUP, grp); + } else if (key == ARG_dev || + key == ARG_iif + ) { diff --git a/package/utils/busybox/patches/302-netlink-alignment.patch b/package/utils/busybox/patches/302-netlink-alignment.patch new file mode 100644 index 000000000..4cd25b187 --- /dev/null +++ b/package/utils/busybox/patches/302-netlink-alignment.patch @@ -0,0 +1,100 @@ +From a843f09a4d4428cf11ca02307e60058251b05743 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Fri, 16 Sep 2016 21:52:03 +0200 +Subject: [PATCH] libnetlink: fix alignment of netlink messages + +An padding to align a message should not only be added between +different attributes of a netlink message, but also at the end of the +message to pad it to the correct size. + +Without this patch the following command does not work and returns an +error code: +ip link add type nlmon + +Without this ip from busybox sends this: +sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=45, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1474057401, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45 +return value: 2 + +The normal ip utile from iproute2 sends this: +sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716938, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 +return value: 0 + +With this patch ip from busybox sends this: +sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716908, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 +return value: 0 + +Signed-off-by: Hauke Mehrtens +--- + networking/libiproute/libnetlink.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/networking/libiproute/libnetlink.c ++++ b/networking/libiproute/libnetlink.c +@@ -338,14 +338,14 @@ int FAST_FUNC addattr32(struct nlmsghdr + int len = RTA_LENGTH(4); + struct rtattr *rta; + +- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { ++ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { + return -1; + } + rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); + rta->rta_type = type; + rta->rta_len = len; + move_to_unaligned32(RTA_DATA(rta), data); +- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; ++ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); + return 0; + } + +@@ -354,14 +354,14 @@ int FAST_FUNC addattr_l(struct nlmsghdr + int len = RTA_LENGTH(alen); + struct rtattr *rta; + +- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { ++ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { + return -1; + } + rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); + rta->rta_type = type; + rta->rta_len = len; + memcpy(RTA_DATA(rta), data, alen); +- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; ++ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); + return 0; + } + +@@ -370,14 +370,14 @@ int FAST_FUNC rta_addattr32(struct rtatt + int len = RTA_LENGTH(4); + struct rtattr *subrta; + +- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { ++ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { + return -1; + } + subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); + subrta->rta_type = type; + subrta->rta_len = len; + move_to_unaligned32(RTA_DATA(subrta), data); +- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; ++ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); + return 0; + } + +@@ -386,14 +386,14 @@ int FAST_FUNC rta_addattr_l(struct rtatt + struct rtattr *subrta; + int len = RTA_LENGTH(alen); + +- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { ++ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { + return -1; + } + subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); + subrta->rta_type = type; + subrta->rta_len = len; + memcpy(RTA_DATA(subrta), data, alen); +- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; ++ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); + return 0; + } + diff --git a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch new file mode 100644 index 000000000..d7a38f632 --- /dev/null +++ b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch @@ -0,0 +1,486 @@ +From 485fcc89b99eae9cc7501eaff344b104e52ab7bf Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Mon, 26 Sep 2016 17:48:22 +0200 +Subject: [PATCH] iproute: properly support high routing table IDs + +The Linux kernel uses two distinct fields to denote the routing table ID in +use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the +32 bit `RTA_TABLE` netlink attribute. + +If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used +and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value. + +This commit ... + - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically + sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in + order to support IDs up to 65535 + - adds proper handling of high table IDs to iprule.c and iproute.c when + adding, removing and dumping ip rules and network routes + +After this change, the Busybox ip applet fully supports IP rules with high ID +numbers, using the same logic as the full iproute2. + +Signed-off-by: Jo-Philipp Wich +--- + networking/libiproute/iproute.c | 75 ++++++++------ + networking/libiproute/iprule.c | 4 +- + networking/libiproute/rt_names.c | 204 +++++++++++++++++++++++---------------- + 3 files changed, 169 insertions(+), 114 deletions(-) + +--- a/networking/libiproute/iproute.c ++++ b/networking/libiproute/iproute.c +@@ -66,6 +66,7 @@ static int FAST_FUNC print_route(const s + inet_prefix dst; + inet_prefix src; + int host_len = -1; ++ uint32_t rtable; + + if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { + fprintf(stderr, "Not a route: %08x %08x %08x\n", +@@ -83,34 +84,6 @@ static int FAST_FUNC print_route(const s + else if (r->rtm_family == AF_INET) + host_len = 32; + +- if (r->rtm_family == AF_INET6) { +- if (G_filter.tb) { +- if (G_filter.tb < 0) { +- if (!(r->rtm_flags & RTM_F_CLONED)) { +- return 0; +- } +- } else { +- if (r->rtm_flags & RTM_F_CLONED) { +- return 0; +- } +- if (G_filter.tb == RT_TABLE_LOCAL) { +- if (r->rtm_type != RTN_LOCAL) { +- return 0; +- } +- } else if (G_filter.tb == RT_TABLE_MAIN) { +- if (r->rtm_type == RTN_LOCAL) { +- return 0; +- } +- } else { +- return 0; +- } +- } +- } +- } else { +- if (G_filter.tb > 0 && G_filter.tb != r->rtm_table) { +- return 0; +- } +- } + if (G_filter.rdst.family + && (r->rtm_family != G_filter.rdst.family || G_filter.rdst.bitlen > r->rtm_dst_len) + ) { +@@ -141,6 +114,37 @@ static int FAST_FUNC print_route(const s + memset(&dst, 0, sizeof(dst)); + parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); + ++ rtable = tb[RTA_TABLE] ? *(uint32_t*)RTA_DATA(tb[RTA_TABLE]) : r->rtm_table; ++ ++ if (G_filter.tb) { ++ if (r->rtm_family == AF_INET6) { ++ if (G_filter.tb < 0) { ++ if (!(r->rtm_flags & RTM_F_CLONED)) { ++ return 0; ++ } ++ } else { ++ if (r->rtm_flags & RTM_F_CLONED) { ++ return 0; ++ } ++ if (G_filter.tb == RT_TABLE_LOCAL) { ++ if (r->rtm_type != RTN_LOCAL) { ++ return 0; ++ } ++ } else if (G_filter.tb == RT_TABLE_MAIN) { ++ if (r->rtm_type == RTN_LOCAL) { ++ return 0; ++ } ++ } else if (G_filter.tb != rtable) { ++ return 0; ++ } ++ } ++ } else { ++ if (G_filter.tb != rtable) { ++ return 0; ++ } ++ } ++ } ++ + if (tb[RTA_SRC]) { + src.bitlen = r->rtm_src_len; + src.bytelen = (r->rtm_family == AF_INET6 ? 16 : 4); +@@ -349,7 +353,9 @@ IF_FEATURE_IP_RULE(ARG_table,) + smalluint ok = 0; + smalluint scope_ok = 0; + int arg; +- ++#if ENABLE_FEATURE_IP_RULE ++ uint32_t rtable = 0; ++#endif + memset(&req, 0, sizeof(req)); + + req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); +@@ -419,7 +425,7 @@ IF_FEATURE_IP_RULE(ARG_table,) + NEXT_ARG(); + if (rtnl_rttable_a2n(&tid, *argv)) + invarg_1_to_2(*argv, "table"); +- req.r.rtm_table = tid; ++ rtable = tid; + #endif + } else if (arg == ARG_dev || arg == ARG_oif) { + NEXT_ARG(); +@@ -475,6 +481,15 @@ IF_FEATURE_IP_RULE(ARG_table,) + } + } + ++#if ENABLE_FEATURE_IP_RULE ++ if (rtable >= 256) { ++ addattr32(&req.n, sizeof(req), RTA_TABLE, rtable); ++ req.r.rtm_table = RT_TABLE_UNSPEC; ++ } else if (rtable > 0) { ++ req.r.rtm_table = rtable; ++ } ++#endif ++ + if (mxrta->rta_len > RTA_LENGTH(0)) { + if (mxlock) { + rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock); +--- a/networking/libiproute/iprule.c ++++ b/networking/libiproute/iprule.c +@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st + printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); + } + +- if (r->rtm_table) ++ if (tb[RTA_TABLE]) ++ printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE]))); ++ else if (r->rtm_table) + printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); + + if (tb[RTA_FLOW]) { +--- a/networking/libiproute/rt_names.c ++++ b/networking/libiproute/rt_names.c +@@ -11,21 +11,26 @@ + #include "rt_names.h" + + #define CONFDIR CONFIG_FEATURE_IP_ROUTE_DIR ++#define RT_TABLE_MAX 65535 ++ ++struct rtnl_tab_entry { ++ unsigned int id; ++ const char *name; ++}; + + typedef struct rtnl_tab_t { +- const char *cached_str; +- unsigned cached_result; +- /* upstream version switched to a hash table and removed +- * id < 256 limit. For now bbox bumps this array size from 256 +- * to 1024. If you plan to change this to a hash table, +- * consider merging several hash tables we have (for example, +- * awk has resizable one! +- */ +-#define RT_TABLE_MAX 1023 +- const char *tab[RT_TABLE_MAX+1]; ++ struct rtnl_tab_entry *tab; ++ size_t length; + } rtnl_tab_t; + +-static void rtnl_tab_initialize(const char *file, const char **tab) ++static int tabcmp(const void *p1, const void *p2) ++{ ++ const struct rtnl_tab_entry *e1 = p1; ++ const struct rtnl_tab_entry *e2 = p2; ++ return strcmp(e1->name, e2->name); ++} ++ ++static void rtnl_tab_initialize(const char *file, rtnl_tab_t *tab) + { + char *token[2]; + char fullname[sizeof(CONFDIR"/rt_dsfield") + 8]; +@@ -40,34 +45,42 @@ static void rtnl_tab_initialize(const ch + file, parser->lineno); + break; + } +- tab[id] = xstrdup(token[1]); ++ ++ tab->tab = xrealloc(tab->tab, (tab->length + 1) * sizeof(*tab->tab)); ++ tab->tab[tab->length].id = id; ++ tab->tab[tab->length].name = xstrdup(token[1]); ++ tab->length++; + } + config_close(parser); ++ qsort(tab->tab, tab->length, sizeof(*tab->tab), tabcmp); + } + + static int rtnl_a2n(rtnl_tab_t *tab, uint32_t *id, const char *arg, int base) + { +- unsigned i; +- +- if (tab->cached_str && strcmp(tab->cached_str, arg) == 0) { +- *id = tab->cached_result; +- return 0; +- } ++ int delta; ++ ssize_t l = 0; ++ ssize_t r = tab->length - 1; ++ ssize_t m; ++ uint32_t i; ++ ++ while (l <= r) { ++ m = l + (r - l) / 2; ++ delta = strcmp(tab->tab[m].name, arg); + +- for (i = 0; i <= RT_TABLE_MAX; i++) { +- if (tab->tab[i] +- && strcmp(tab->tab[i], arg) == 0 +- ) { +- tab->cached_str = tab->tab[i]; +- tab->cached_result = i; +- *id = i; ++ if (delta == 0) { ++ *id = tab->tab[m].id; + return 0; ++ } else if (delta < 0) { ++ l = m + 1; ++ } else { ++ r = m - 1; + } + } + + i = bb_strtou(arg, NULL, base); + if (i > RT_TABLE_MAX) + return -1; ++ + *id = i; + return 0; + } +@@ -77,40 +90,39 @@ static rtnl_tab_t *rtnl_rtprot_tab; + + static void rtnl_rtprot_initialize(void) + { +- static const char *const init_tab[] = { +- "none", +- "redirect", +- "kernel", +- "boot", +- "static", +- NULL, +- NULL, +- NULL, +- "gated", +- "ra", +- "mrt", +- "zebra", +- "bird", ++ static const struct rtnl_tab_entry init_tab[] = { ++ { 0, "none" }, ++ { 1, "redirect" }, ++ { 2, "kernel" }, ++ { 3, "boot" }, ++ { 4, "static" }, ++ { 8, "gated" }, ++ { 9, "ra" }, ++ { 10, "mrt" }, ++ { 11, "zebra" }, ++ { 12, "bird" } + }; + + if (rtnl_rtprot_tab) + return; + rtnl_rtprot_tab = xzalloc(sizeof(*rtnl_rtprot_tab)); ++ rtnl_rtprot_tab->tab = xzalloc(sizeof(init_tab)); ++ rtnl_rtprot_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); + memcpy(rtnl_rtprot_tab->tab, init_tab, sizeof(init_tab)); +- rtnl_tab_initialize("protos", rtnl_rtprot_tab->tab); ++ rtnl_tab_initialize("protos", rtnl_rtprot_tab); + } + + #if 0 /* UNUSED */ + const char* FAST_FUNC rtnl_rtprot_n2a(int id) + { +- if (id < 0 || id > RT_TABLE_MAX) { +- return itoa(id); +- } ++ size_t i; + + rtnl_rtprot_initialize(); + +- if (rtnl_rtprot_tab->tab[id]) +- return rtnl_rtprot_tab->tab[id]; ++ for (i = 0; i < rtnl_rtprot_tab->length; i++) ++ if (rtnl_rtprot_tab->tab[i].id == id) ++ return rtnl_rtprot_tab->tab[i].name; ++ + return itoa(id); + } + #endif +@@ -126,27 +138,33 @@ static rtnl_tab_t *rtnl_rtscope_tab; + + static void rtnl_rtscope_initialize(void) + { ++ static const struct rtnl_tab_entry init_tab[] = { ++ { 0, "global" }, ++ { 200, "site" }, ++ { 253, "link" }, ++ { 254, "host" }, ++ { 255, "nowhere" } ++ }; ++ + if (rtnl_rtscope_tab) + return; + rtnl_rtscope_tab = xzalloc(sizeof(*rtnl_rtscope_tab)); +- rtnl_rtscope_tab->tab[0] = "global"; +- rtnl_rtscope_tab->tab[255] = "nowhere"; +- rtnl_rtscope_tab->tab[254] = "host"; +- rtnl_rtscope_tab->tab[253] = "link"; +- rtnl_rtscope_tab->tab[200] = "site"; +- rtnl_tab_initialize("scopes", rtnl_rtscope_tab->tab); ++ rtnl_rtscope_tab->tab = xzalloc(sizeof(init_tab)); ++ rtnl_rtscope_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); ++ memcpy(rtnl_rtscope_tab->tab, init_tab, sizeof(init_tab)); ++ rtnl_tab_initialize("scopes", rtnl_rtscope_tab); + } + + const char* FAST_FUNC rtnl_rtscope_n2a(int id) + { +- if (id < 0 || id > RT_TABLE_MAX) { +- return itoa(id); +- } ++ size_t i; + + rtnl_rtscope_initialize(); + +- if (rtnl_rtscope_tab->tab[id]) +- return rtnl_rtscope_tab->tab[id]; ++ for (i = 0; i < rtnl_rtscope_tab->length; i++) ++ if (rtnl_rtscope_tab->tab[i].id == id) ++ return rtnl_rtscope_tab->tab[i].name; ++ + return itoa(id); + } + +@@ -161,10 +179,17 @@ static rtnl_tab_t *rtnl_rtrealm_tab; + + static void rtnl_rtrealm_initialize(void) + { +- if (rtnl_rtrealm_tab) return; ++ static const struct rtnl_tab_entry init_tab[] = { ++ { 0, "unknown" } ++ }; ++ ++ if (rtnl_rtrealm_tab) ++ return; + rtnl_rtrealm_tab = xzalloc(sizeof(*rtnl_rtrealm_tab)); +- rtnl_rtrealm_tab->tab[0] = "unknown"; +- rtnl_tab_initialize("realms", rtnl_rtrealm_tab->tab); ++ rtnl_rtrealm_tab->tab = xzalloc(sizeof(init_tab)); ++ rtnl_rtrealm_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); ++ memcpy(rtnl_rtrealm_tab->tab, init_tab, sizeof(init_tab)); ++ rtnl_tab_initialize("realms", rtnl_rtrealm_tab); + } + + int FAST_FUNC rtnl_rtrealm_a2n(uint32_t *id, char *arg) +@@ -176,14 +201,14 @@ int FAST_FUNC rtnl_rtrealm_a2n(uint32_t + #if ENABLE_FEATURE_IP_RULE + const char* FAST_FUNC rtnl_rtrealm_n2a(int id) + { +- if (id < 0 || id > RT_TABLE_MAX) { +- return itoa(id); +- } ++ size_t i; + + rtnl_rtrealm_initialize(); + +- if (rtnl_rtrealm_tab->tab[id]) +- return rtnl_rtrealm_tab->tab[id]; ++ for (i = 0; i < rtnl_rtrealm_tab->length; i++) ++ if (rtnl_rtrealm_tab->tab[i].id == id) ++ return rtnl_rtrealm_tab->tab[i].name; ++ + return itoa(id); + } + #endif +@@ -193,22 +218,29 @@ static rtnl_tab_t *rtnl_rtdsfield_tab; + + static void rtnl_rtdsfield_initialize(void) + { +- if (rtnl_rtdsfield_tab) return; ++ static const struct rtnl_tab_entry init_tab[] = { ++ { 0, "0" } ++ }; ++ ++ if (rtnl_rtdsfield_tab) ++ return; + rtnl_rtdsfield_tab = xzalloc(sizeof(*rtnl_rtdsfield_tab)); +- rtnl_rtdsfield_tab->tab[0] = "0"; +- rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab->tab); ++ rtnl_rtdsfield_tab->tab = xzalloc(sizeof(init_tab)); ++ rtnl_rtdsfield_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); ++ memcpy(rtnl_rtdsfield_tab->tab, init_tab, sizeof(init_tab)); ++ rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab); + } + + const char* FAST_FUNC rtnl_dsfield_n2a(int id) + { +- if (id < 0 || id > RT_TABLE_MAX) { +- return itoa(id); +- } ++ size_t i; + + rtnl_rtdsfield_initialize(); + +- if (rtnl_rtdsfield_tab->tab[id]) +- return rtnl_rtdsfield_tab->tab[id]; ++ for (i = 0; i < rtnl_rtdsfield_tab->length; i++) ++ if (rtnl_rtdsfield_tab->tab[i].id == id) ++ return rtnl_rtdsfield_tab->tab[i].name; ++ + return itoa(id); + } + +@@ -224,27 +256,33 @@ static rtnl_tab_t *rtnl_rttable_tab; + + static void rtnl_rttable_initialize(void) + { ++ static const struct rtnl_tab_entry tab_init[] = { ++ { 0, "unspec" }, ++ { 253, "default" }, ++ { 254, "main" }, ++ { 255, "local" } ++ }; ++ + if (rtnl_rttable_tab) + return; + + rtnl_rttable_tab = xzalloc(sizeof(*rtnl_rttable_tab)); +- rtnl_rttable_tab->tab[0] = "unspec"; +- rtnl_rttable_tab->tab[255] = "local"; +- rtnl_rttable_tab->tab[254] = "main"; +- rtnl_rttable_tab->tab[253] = "default"; +- rtnl_tab_initialize("tables", rtnl_rttable_tab->tab); ++ rtnl_rttable_tab->tab = xzalloc(sizeof(tab_init)); ++ rtnl_rttable_tab->length = sizeof(tab_init) / sizeof(tab_init[0]); ++ memcpy(rtnl_rttable_tab->tab, tab_init, sizeof(tab_init)); ++ rtnl_tab_initialize("tables", rtnl_rttable_tab); + } + + const char* FAST_FUNC rtnl_rttable_n2a(int id) + { +- if (id < 0 || id > RT_TABLE_MAX) { +- return itoa(id); +- } ++ size_t i; + + rtnl_rttable_initialize(); + +- if (rtnl_rttable_tab->tab[id]) +- return rtnl_rttable_tab->tab[id]; ++ for (i = 0; i < rtnl_rttable_tab->length; i++) ++ if (rtnl_rttable_tab->tab[i].id == id) ++ return rtnl_rttable_tab->tab[i].name; ++ + return itoa(id); + } + diff --git a/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch b/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch new file mode 100644 index 000000000..e83999d30 --- /dev/null +++ b/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch @@ -0,0 +1,100 @@ +From e88608eae24ae5934034e1ecb6c494fefbf1b9ae Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Mon, 13 Mar 2017 20:50:42 +0100 +Subject: [PATCH 1/2] vi: don't touch file with :x when modified_count == 0 + +Along with it, there are other changes + + - Check for uppercase X is removed as the expression will be always false and + :X itself is another totally different command in standard vim + - The status line will show number of written lines instead of lines requested + by the colon command. This is also how the standard vim is doing, though + the difference is that '!' has to be explicitly specified in vim to allow + partial writes + +Signed-off-by: Yousong Zhou +Signed-off-by: Denys Vlasenko +--- + editors/vi.c | 43 ++++++++++++++++++++++++++----------------- + 1 file changed, 26 insertions(+), 17 deletions(-) + +--- a/editors/vi.c ++++ b/editors/vi.c +@@ -1038,7 +1038,9 @@ static void colon(char *buf) + || strncmp(p, "wn", cnt) == 0 + || (p[0] == 'x' && !p[1]) + ) { +- cnt = file_write(current_filename, text, end - 1); ++ if (modified_count != 0 || p[0] != 'x') { ++ cnt = file_write(current_filename, text, end - 1); ++ } + if (cnt < 0) { + if (cnt == -1) + status_line_bold("Write error: %s", strerror(errno)); +@@ -1049,8 +1051,9 @@ static void colon(char *buf) + current_filename, + count_lines(text, end - 1), cnt + ); +- if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' +- || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' ++ if (p[0] == 'x' ++ || p[1] == 'q' || p[1] == 'n' ++ || p[1] == 'Q' || p[1] == 'N' + ) { + editing = 0; + } +@@ -1480,16 +1483,19 @@ static void colon(char *buf) + goto ret; + } + #endif +- // how many lines in text[]? +- li = count_lines(q, r); +- size = r - q + 1; + //if (useforce) { + // if "fn" is not write-able, chmod u+w + // sprintf(syscmd, "chmod u+w %s", fn); + // system(syscmd); + // forced = TRUE; + //} +- l = file_write(fn, q, r); ++ if (modified_count != 0 || cmd[0] != 'x') { ++ size = r - q + 1; ++ l = file_write(fn, q, r); ++ } else { ++ size = 0; ++ l = 0; ++ } + //if (useforce && forced) { + // chmod u-w + // sprintf(syscmd, "chmod u-w %s", fn); +@@ -1500,17 +1506,20 @@ static void colon(char *buf) + if (l == -1) + status_line_bold_errno(fn); + } else { ++ // how many lines written ++ li = count_lines(q, q + l - 1); + status_line("'%s' %dL, %dC", fn, li, l); +- if (q == text && r == end - 1 && l == size) { +- modified_count = 0; +- last_modified_count = -1; +- } +- if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n' +- || cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N' +- ) +- && l == size +- ) { +- editing = 0; ++ if (l == size) { ++ if (q == text && q + l == end) { ++ modified_count = 0; ++ last_modified_count = -1; ++ } ++ if (cmd[0] == 'x' ++ || cmd[1] == 'q' || cmd[1] == 'n' ++ || cmd[1] == 'Q' || cmd[1] == 'N' ++ ) { ++ editing = 0; ++ } + } + } + #if ENABLE_FEATURE_VI_YANKMARK diff --git a/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch b/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch new file mode 100644 index 000000000..b56cf735c --- /dev/null +++ b/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch @@ -0,0 +1,53 @@ +From 8f3bf4f0d3605b50a8e4c48c89aeabc455f04884 Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Fri, 24 Mar 2017 21:13:10 +0100 +Subject: [PATCH 2/2] vi: avoid touching a new file with ZZ when no editing has + been done + +This is the behaviour observed with standard vim and busybox vi of at +least 1.22.1. It was changed with commit "32afd3a vi: some +simplifications" which happened before 1.23.0. + +Mistyping filename on command line happens fairly often and it's better +we restore the old behaviour to avoid a few unnecessary flash writes and +sometimes efforts of debugging bugs caused by those unneeded stray +files. + +Signed-off-by: Yousong Zhou +Signed-off-by: Denys Vlasenko +--- + editors/vi.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/editors/vi.c ++++ b/editors/vi.c +@@ -719,14 +719,6 @@ static int init_text_buffer(char *fn) + { + int rc; + +- flush_undo_data(); +- modified_count = 0; +- last_modified_count = -1; +-#if ENABLE_FEATURE_VI_YANKMARK +- /* init the marks */ +- memset(mark, 0, sizeof(mark)); +-#endif +- + /* allocate/reallocate text buffer */ + free(text); + text_size = 10240; +@@ -741,6 +733,14 @@ static int init_text_buffer(char *fn) + // file doesnt exist. Start empty buf with dummy line + char_insert(text, '\n', NO_UNDO); + } ++ ++ flush_undo_data(); ++ modified_count = 0; ++ last_modified_count = -1; ++#if ENABLE_FEATURE_VI_YANKMARK ++ /* init the marks */ ++ memset(mark, 0, sizeof(mark)); ++#endif + return rc; + } + diff --git a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch deleted file mode 100644 index 3741e25c3..000000000 --- a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/networking/traceroute.c -+++ b/networking/traceroute.c -@@ -237,8 +237,8 @@ - //config: depends on TRACEROUTE || TRACEROUTE6 - - /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ --//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) --//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) -+//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_BIN, BB_SUID_MAYBE)) -+//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_BIN, BB_SUID_MAYBE)) - - //kbuild:lib-$(CONFIG_TRACEROUTE) += traceroute.o - //kbuild:lib-$(CONFIG_TRACEROUTE6) += traceroute.o diff --git a/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch b/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch deleted file mode 100644 index b19d1c9a3..000000000 --- a/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/loginutils/passwd.c -+++ b/loginutils/passwd.c -@@ -23,7 +23,7 @@ - //config: With this option passwd will refuse new passwords which are "weak". - - //applet:/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */ --//applet:IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) -+//applet:IF_PASSWD(APPLET(passwd, BB_DIR_BIN, BB_SUID_REQUIRE)) - - //kbuild:lib-$(CONFIG_PASSWD) += passwd.o - diff --git a/package/utils/busybox/patches/600-cve-2017-16544.patch b/package/utils/busybox/patches/600-cve-2017-16544.patch deleted file mode 100644 index 3b142bdd6..000000000 --- a/package/utils/busybox/patches/600-cve-2017-16544.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c3797d40a1c57352192c6106cc0f435e7d9c11e8 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Tue, 7 Nov 2017 18:09:29 +0100 -Subject: lineedit: do not tab-complete any strings which have control - characters - -function old new delta -add_match 41 68 +27 - -Signed-off-by: Denys Vlasenko ---- - libbb/lineedit.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - ---- a/libbb/lineedit.c -+++ b/libbb/lineedit.c -@@ -633,6 +633,18 @@ static void free_tab_completion_data(voi - - static void add_match(char *matched) - { -+ unsigned char *p = (unsigned char*)matched; -+ while (*p) { -+ /* ESC attack fix: drop any string with control chars */ -+ if (*p < ' ' -+ || (!ENABLE_UNICODE_SUPPORT && *p >= 0x7f) -+ || (ENABLE_UNICODE_SUPPORT && *p == 0x7f) -+ ) { -+ free(matched); -+ return; -+ } -+ p++; -+ } - matches = xrealloc_vector(matches, 4, num_matches); - matches[num_matches] = matched; - num_matches++; diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile index 4c8b360de..62c255a90 100644 --- a/package/utils/bzip2/Makefile +++ b/package/utils/bzip2/Makefile @@ -18,7 +18,6 @@ PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=BZIP2 PKG_LICENSE_FILES:=LICENSE -PKG_CPE_ID:=cpe:/a:bzip:bzip2 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 389e10ccf..85f70c5e7 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -11,7 +11,7 @@ FOUND_BUG=0 bugcheck_generic() { - echo "OpenWrt crashlog report" > $CRASHDIR/info.txt + echo "LEDE crashlog report" > $CRASHDIR/info.txt date >> $CRASHDIR/info.txt echo >> $CRASHDIR/info.txt echo "uname" >> $CRASHDIR/info.txt diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index 068ce3ede..8c003639a 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -8,14 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.7 -PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 -PKG_RELEASE:=1 +PKG_VERSION:=1.43.3 +PKG_HASH:=ce8ef1bbb0d4730f170167284fda156ac9d6bf18db2750eb94af619a81b19927 +PKG_RELEASE:=2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ -PKG_LICENSE:=GPL-2.0 -PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=@SF/e2fsprogs PKG_BUILD_DEPENDS:=util-linux PKG_INSTALL:=1 @@ -46,7 +44,7 @@ define Package/libext2fs $(call Package/e2fsprogs/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libuuid +libblkid + DEPENDS:=+libuuid TITLE:=ext2/3/4 filesystem library endef @@ -110,17 +108,18 @@ endef TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections +CONFIGURE_VARS += \ + ac_cv_lib_pthread_sem_init=no + CONFIGURE_ARGS += \ --disable-testio-debug \ --enable-elf-shlibs \ --disable-libuuid \ - --disable-libblkid \ + --enable-libblkid \ --disable-uuidd \ --disable-tls \ --disable-nls \ - --disable-rpath \ - --disable-threads \ - --disable-fuse2fs + --disable-rpath define Build/Prepare $(call Build/Prepare/Default) @@ -139,6 +138,7 @@ define Build/Compile LDFLAGS=-Wl,--gc-sections \ BUILDCC="$(HOSTCC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ + LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \ ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \ SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \ V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 3e8bf63f0..8a27c47ad 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.9.0 -PKG_RELEASE:=1 +PKG_VERSION:=1.8.0 +PKG_RELEASE:=3 PKG_LICENSE:=GPLv2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=77217562ae7011a6d81b7b3c43c42623db1796a57596408d6c8037def70d6cc7 +PKG_HASH:=d4dbecf55560c548bf0758c9f641d1beec1e960b38cbbc19951195d5144d39ae PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -57,8 +57,7 @@ define Package/libf2fs endef CONFIGURE_ARGS += \ - --without-selinux \ - --without-blkid + --without-selinux CONFIGURE_VARS += \ ac_cv_file__git=no diff --git a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch b/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch new file mode 100644 index 000000000..d4e25397a --- /dev/null +++ b/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch @@ -0,0 +1,66 @@ +From 31873d5cdf8a97d5f7921451c54f6d293293c6cc Mon Sep 17 00:00:00 2001 +From: Jaegeuk Kim +Date: Wed, 23 Aug 2017 13:33:00 -0700 +Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version + +The error on mips was reported by Stijn as follow. + +Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools +("mkfs.f2fs: give random checkpoint version") causes a bug when mounting +a filesystem created with it on a MIPS64 device running a 4.4(.83) +kernel. The following kernel warning appears several times per second, +for 30 seconds: + +[ 23.837262] ------------[ cut here ]------------ +[ 23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718 +update_sit_entry+0x1c0/0x2b0() +[ 23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat +[ 24.174064] Call Trace: +[ 24.176527] [] show_stack+0x68/0xb4 +[ 24.181595] [] dump_stack+0x8c/0xc4 +[ 24.186660] [] warn_slowpath_common+0xa0/0xd0 +[ 24.192597] [] update_sit_entry+0x1c0/0x2b0 +[ 24.198353] [] refresh_sit_entry+0x70/0xf8 +[ 24.204022] [] allocate_data_block+0x1f0/0x310 +[ 24.210038] [] do_write_page+0x29c/0x2bc +[ 24.215532] [] write_data_page+0xa0/0xd8 +[ 24.221028] [] do_write_data_page+0xe4/0x384 +[ 24.226870] [] f2fs_write_data_page+0x208/0x464 +[ 24.232972] [] __f2fs_writepage+0x1c/0x74 +[ 24.238553] [] +f2fs_write_cache_pages.constprop.7+0x250/0x394 +[ 24.245869] [] f2fs_write_data_pages+0x130/0x1b0 +[ 24.252066] [] __filemap_fdatawrite_range+0xa0/0xd4 +[ 24.258515] [] sync_dirty_dir_inodes+0x94/0xd8 +[ 24.264530] [] write_checkpoint+0x108/0xb9c +[ 24.270283] [] f2fs_sync_fs+0x68/0xb0 +[ 24.275526] [] f2fs_sync_file+0x2e8/0x518 +[ 24.281107] [] do_fsync+0x38/0x70 +[ 24.285992] [] SyS_fsync+0x14/0x20 +[ 24.290972] [] syscall_common+0x34/0x58 +[ 24.296372] +[ 24.298096] ---[ end trace fd3ac44449b218ab ]--- + +Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version") +Reported-And-Tested-by: Stijn Tintel +Signed-off-by: Jaegeuk Kim +--- + mkfs/f2fs_format.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c +index 92876b8..b379e80 100644 +--- a/mkfs/f2fs_format.c ++++ b/mkfs/f2fs_format.c +@@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void) + } + + /* 1. cp page 1 of checkpoint pack 1 */ +- cp->checkpoint_ver = rand() | 0x1; ++ cp->checkpoint_ver = cpu_to_le64(rand() | 0x1); + set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]); + set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]); + set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]); +-- +2.13.5 + diff --git a/package/utils/fritz-tools/Makefile b/package/utils/fritz-tools/Makefile deleted file mode 100644 index 7c547e6f9..000000000 --- a/package/utils/fritz-tools/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -include $(TOPDIR)/rules.mk - -PKG_NAME:=fritz-tools -PKG_RELEASE:=1 -CMAKE_INSTALL:=1 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/fritz-tools/Default - SECTION:=utils - CATEGORY:=Utilities -endef - -define Package/fritz-tffs - $(call Package/fritz-tools/Default) - TITLE:=Utility to partially read the TFFS filesystems -endef - -define Package/fritz-tffs/description - Utility to partially read the TFFS filesystems. -endef - -define Package/fritz-caldata - $(call Package/fritz-tools/Default) - DEPENDS:=+zlib - TITLE:=Utility to extract WLAN calibration data -endef - -define Package/fritz-caldata/description - Utility to extract the zlib compress calibration data from flash. -endef - -define Package/fritz-tffs/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_tffs_read $(1)/usr/bin/fritz_tffs -endef - -define Package/fritz-caldata/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_cal_extract $(1)/usr/bin/ -endef - -$(eval $(call BuildPackage,fritz-tffs)) -$(eval $(call BuildPackage,fritz-caldata)) diff --git a/package/utils/fritz-tools/README.md b/package/utils/fritz-tools/README.md deleted file mode 100644 index def237b17..000000000 --- a/package/utils/fritz-tools/README.md +++ /dev/null @@ -1,50 +0,0 @@ -Userspace utilties for accessing TFFS (a name-value storage usually found in AVM Fritz!Box based devices) - -## Building - -``` -mkdir build -cd build -cmake /path/to/fritz_tffs_tools -make -``` - -## Usage - -All command line parameters are documented: -``` -fritz_tffs_read -h -``` - -Show all entries from a TFFS partition dump (in the format: name=value): -``` -fritz_tffs_read -i /path/to/tffs.dump -a -``` - -Read a TFFS partition and show all entries (in the format: name=value): -``` -fritz_tffs_read -i /dev/mtdX -a -``` - -Output only the value of a specific key (this will only show the value): -``` -fritz_tffs_read -i /dev/mtdX -n my_ipaddress -``` - -## LICENSE - -See `LICENSE`: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/package/utils/fritz-tools/src/CMakeLists.txt b/package/utils/fritz-tools/src/CMakeLists.txt deleted file mode 100644 index 021dc7733..000000000 --- a/package/utils/fritz-tools/src/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -cmake_minimum_required(VERSION 2.6) - -PROJECT(fritz-tools C) -ADD_DEFINITIONS(-Wall -Werror --std=gnu99 -Wmissing-declarations) - -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") - -FIND_PATH(zlib_include_dir zlib.h) -INCLUDE_DIRECTORIES(${zlib_include_dir}) - -ADD_EXECUTABLE(fritz_tffs_read fritz_tffs_read.c) -ADD_EXECUTABLE(fritz_cal_extract fritz_cal_extract.c) -TARGET_LINK_LIBRARIES(fritz_cal_extract z) - -INSTALL(TARGETS fritz_tffs_read fritz_cal_extract RUNTIME DESTINATION bin) diff --git a/package/utils/fritz-tools/src/fritz_cal_extract.c b/package/utils/fritz-tools/src/fritz_cal_extract.c deleted file mode 100644 index 8156dfd1a..000000000 --- a/package/utils/fritz-tools/src/fritz_cal_extract.c +++ /dev/null @@ -1,259 +0,0 @@ -/* - * A tool for reading the zlib compressed calibration data - * found in AVM Fritz!Box based devices). - * - * Copyright (c) 2017 Christian Lamparter - * - * Based on zpipe, which is an example of proper use of zlib's inflate(). - * that is Not copyrighted -- provided to the public domain - * Version 1.4 11 December 2005 Mark Adler - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "zlib.h" - -#define CHUNK 1024 - -static inline size_t special_min(size_t a, size_t b) -{ - return a == 0 ? b : (a < b ? a : b); -} - -/* Decompress from file source to file dest until stream ends or EOF. - inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be - allocated for processing, Z_DATA_ERROR if the deflate data is - invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and - the version of the library linked do not match, or Z_ERRNO if there - is an error reading or writing the files. */ -static int inf(FILE *source, FILE *dest, size_t limit, size_t skip) -{ - int ret; - size_t have; - z_stream strm; - unsigned char in[CHUNK]; - unsigned char out[CHUNK]; - - /* allocate inflate state */ - strm.zalloc = Z_NULL; - strm.zfree = Z_NULL; - strm.opaque = Z_NULL; - strm.avail_in = 0; - strm.next_in = Z_NULL; - ret = inflateInit(&strm); - if (ret != Z_OK) - return ret; - - /* decompress until deflate stream ends or end of file */ - do { - strm.avail_in = fread(in, 1, CHUNK, source); - if (ferror(source)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - if (strm.avail_in == 0) - break; - strm.next_in = in; - - /* run inflate() on input until output buffer not full */ - do { - strm.avail_out = CHUNK; - strm.next_out = out; - ret = inflate(&strm, Z_NO_FLUSH); - assert(ret != Z_STREAM_ERROR); /* state not clobbered */ - switch (ret) { - case Z_NEED_DICT: - ret = Z_DATA_ERROR; /* and fall through */ - case Z_DATA_ERROR: - case Z_MEM_ERROR: - (void)inflateEnd(&strm); - return ret; - } - have = special_min(limit, CHUNK - strm.avail_out) - skip; - if (fwrite(&out[skip], have, 1, dest) != 1 || ferror(dest)) { - (void)inflateEnd(&strm); - return Z_ERRNO; - } - skip = 0; - limit -= have; - } while (strm.avail_out == 0 && limit > 0); - - /* done when inflate() says it's done */ - } while (ret != Z_STREAM_END && limit > 0); - - /* clean up and return */ - (void)inflateEnd(&strm); - return (limit == 0 ? Z_OK : (ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR)); -} - -/* report a zlib or i/o error */ -static void zerr(int ret) -{ - switch (ret) { - case Z_ERRNO: - if (ferror(stdin)) - fputs("error reading stdin\n", stderr); - if (ferror(stdout)) - fputs("error writing stdout\n", stderr); - break; - case Z_STREAM_ERROR: - fputs("invalid compression level\n", stderr); - break; - case Z_DATA_ERROR: - fputs("invalid or incomplete deflate data\n", stderr); - break; - case Z_MEM_ERROR: - fputs("out of memory\n", stderr); - break; - case Z_VERSION_ERROR: - fputs("zlib version mismatch!\n", stderr); - } -} - -static unsigned int get_num(char *str) -{ - if (!strncmp("0x", str, 2)) - return strtoul(str+2, NULL, 16); - else - return strtoul(str, NULL, 10); -} - -static void usage(void) -{ - fprintf(stderr, "Usage: fritz_cal_extract [-s seek offset] [-i skip] [-o output file] [-l limit] [infile] -e entry_id\n" - "Finds and extracts zlib compressed calibration data in the EVA loader\n"); - exit(EXIT_FAILURE); -} - -struct cal_entry { - uint16_t id; - uint16_t len; -} __attribute__((packed)); - -/* compress or decompress from stdin to stdout */ -int main(int argc, char **argv) -{ - struct cal_entry cal = { .len = 0 }; - FILE *in = stdin; - FILE *out = stdout; - size_t limit = 0, skip = 0; - int initial_offset = 0; - int entry = -1; - int ret; - int opt; - - while ((opt = getopt(argc, argv, "s:e:o:l:i:")) != -1) { - switch (opt) { - case 's': - initial_offset = (int)get_num(optarg); - if (errno) { - perror("Failed to parse seek offset"); - goto out_bad; - } - break; - case 'e': - entry = (int) htobe16(get_num(optarg)); - if (errno) { - perror("Failed to entry id"); - goto out_bad; - } - break; - case 'o': - out = fopen(optarg, "w"); - if (!out) { - perror("Failed to create output file"); - goto out_bad; - } - break; - case 'l': - limit = (size_t)get_num(optarg); - if (errno) { - perror("Failed to parse limit"); - goto out_bad; - } - break; - case 'i': - skip = (size_t)get_num(optarg); - if (errno) { - perror("Failed to parse skip"); - goto out_bad; - } - break; - default: /* '?' */ - usage(); - } - } - - if (entry == -1) - usage(); - - if (argc > 1 && optind <= argc) { - in = fopen(argv[optind], "r"); - if (!in) { - perror("Failed to create output file"); - goto out_bad; - } - } - - if (initial_offset) { - ret = fseek(in, initial_offset, SEEK_CUR); - if (ret) { - perror("Failed to seek to calibration table"); - goto out_bad; - } - } - - do { - ret = fseek(in, be16toh(cal.len), SEEK_CUR); - if (feof(in)) { - fprintf(stderr, "Reached end of file, but didn't find the matching entry\n"); - goto out_bad; - } else if (ferror(in)) { - perror("Failure during seek"); - goto out_bad; - } - - ret = fread(&cal, 1, sizeof cal, in); - if (ret != sizeof cal) - goto out_bad; - } while (entry != cal.id || cal.id == 0xffff); - - if (cal.id == 0xffff) { - fprintf(stderr, "Reached end of filesystem, but didn't find the matching entry\n"); - goto out_bad; - } - - ret = inf(in, out, limit, skip); - if (ret == Z_OK) - goto out; - - zerr(ret); - -out_bad: - ret = EXIT_FAILURE; - -out: - fclose(in); - fclose(out); - return ret; -} diff --git a/package/utils/fritz-tools/src/fritz_tffs_read.c b/package/utils/fritz-tools/src/fritz_tffs_read.c deleted file mode 100644 index d1b3038e6..000000000 --- a/package/utils/fritz-tools/src/fritz_tffs_read.c +++ /dev/null @@ -1,379 +0,0 @@ -/* - * A tool for reading the TFFS partitions (a name-value storage usually - * found in AVM Fritz!Box based devices). - * - * Copyright (c) 2015-2016 Martin Blumenstingl - * - * Based on the TFFS 2.0 kernel driver from AVM: - * Copyright (c) 2004-2007 AVM GmbH - * and the OpenWrt TFFS kernel driver: - * Copyright (c) 2013 John Crispin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define TFFS_ID_END 0xffff -#define TFFS_ID_TABLE_NAME 0x01ff - -static char *progname; -static char *input_file; -static unsigned long tffs_size; -static char *name_filter = NULL; -static bool show_all = false; -static bool print_all_key_names = false; -static bool swap_bytes = false; - -struct tffs_entry_header { - uint16_t id; - uint16_t len; -}; - -struct tffs_entry { - const struct tffs_entry_header *header; - char *name; - uint8_t *val; -}; - -struct tffs_name_table_entry { - const uint32_t *id; - const char *val; -}; - -struct tffs_key_name_table { - uint32_t size; - struct tffs_name_table_entry *entries; -}; - -static inline uint16_t get_header_len(const struct tffs_entry_header *header) -{ - if (swap_bytes) - return ntohs(header->len); - - return header->len; -} - -static inline uint16_t get_header_id(const struct tffs_entry_header *header) -{ - if (swap_bytes) - return ntohs(header->id); - - return header->id; -} - -static inline uint16_t to_entry_header_id(uint32_t name_id) -{ - if (swap_bytes) - return ntohl(name_id) & 0xffff; - - return name_id & 0xffff; -} - -static inline uint32_t get_walk_size(uint32_t entry_len) -{ - return (entry_len + 3) & ~0x03; -} - -static void print_entry_value(const struct tffs_entry *entry) -{ - int i; - - /* These are NOT NULL terminated. */ - for (i = 0; i < get_header_len(entry->header); i++) - fprintf(stdout, "%c", entry->val[i]); -} - -static void parse_entry(uint8_t *buffer, uint32_t pos, - struct tffs_entry *entry) -{ - entry->header = (struct tffs_entry_header *) &buffer[pos]; - entry->val = &buffer[pos + sizeof(struct tffs_entry_header)]; -} - -static int find_entry(uint8_t *buffer, uint16_t id, struct tffs_entry *entry) -{ - uint32_t pos = 0; - - do { - parse_entry(buffer, pos, entry); - - if (get_header_id(entry->header) == id) - return 1; - - pos += sizeof(struct tffs_entry_header); - pos += get_walk_size(get_header_len(entry->header)); - } while (pos < tffs_size && entry->header->id != TFFS_ID_END); - - return 0; -} - -static void parse_key_names(struct tffs_entry *names_entry, - struct tffs_key_name_table *key_names) -{ - uint32_t pos = 0, i = 0; - struct tffs_name_table_entry *name_item; - - key_names->entries = calloc(sizeof(*name_item), 1); - - do { - name_item = &key_names->entries[i]; - - name_item->id = (uint32_t *) &names_entry->val[pos]; - pos += sizeof(*name_item->id); - name_item->val = (const char *) &names_entry->val[pos]; - - /* - * There is no "length" field because the string values are - * simply NULL-terminated -> strlen() gives us the size. - */ - pos += get_walk_size(strlen(name_item->val) + 1); - - ++i; - key_names->entries = realloc(key_names->entries, - sizeof(*name_item) * (i + 1)); - } while (pos < get_header_len(names_entry->header)); - - key_names->size = i; -} - -static void show_all_key_names(struct tffs_key_name_table *key_names) -{ - int i; - - for (i = 0; i < key_names->size; i++) - printf("%s\n", key_names->entries[i].val); -} - -static int show_all_key_value_pairs(uint8_t *buffer, - struct tffs_key_name_table *key_names) -{ - int i, has_value = 0; - uint16_t id; - struct tffs_entry tmp; - - for (i = 0; i < key_names->size; i++) { - id = to_entry_header_id(*key_names->entries[i].id); - - if (find_entry(buffer, id, &tmp)) { - printf("%s=", key_names->entries[i].val); - print_entry_value(&tmp); - printf("\n"); - has_value++; - } - } - - if (!has_value) { - fprintf(stderr, "ERROR: no values found!\n"); - return EXIT_FAILURE; - } - - return EXIT_SUCCESS; -} - -static int show_matching_key_value(uint8_t *buffer, - struct tffs_key_name_table *key_names) -{ - int i; - uint16_t id; - struct tffs_entry tmp; - const char *name; - - for (i = 0; i < key_names->size; i++) { - name = key_names->entries[i].val; - - if (strncmp(name, name_filter, strlen(name)) == 0) { - id = to_entry_header_id(*key_names->entries[i].id); - - if (find_entry(buffer, id, &tmp)) { - print_entry_value(&tmp); - printf("\n"); - return EXIT_SUCCESS; - } else { - fprintf(stderr, - "ERROR: no value found for name %s!\n", - name); - return EXIT_FAILURE; - } - } - } - - fprintf(stderr, "ERROR: Unknown key name %s!\n", name_filter); - return EXIT_FAILURE; -} - -static void usage(int status) -{ - FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; - - fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); - fprintf(stream, - "\n" - "Options:\n" - " -a list all key value pairs found in the TFFS file/device\n" - " -b swap bytes while parsing the TFFS file/device\n" - " -h show this screen\n" - " -i inspect the given TFFS file/device \n" - " -l list all supported keys\n" - " -n display the value of the given key\n" - " -s the (max) size of the TFFS file/device \n" - ); - - exit(status); -} - -static int file_exist(char *filename) -{ - struct stat buffer; - - return stat(filename, &buffer) == 0; -} - -static void parse_options(int argc, char *argv[]) -{ - while (1) - { - int c; - - c = getopt(argc, argv, "abhi:ln:s:"); - if (c == -1) - break; - - switch (c) { - case 'a': - show_all = true; - name_filter = NULL; - print_all_key_names = false; - break; - case 'b': - swap_bytes = 1; - break; - case 'h': - usage(EXIT_SUCCESS); - break; - case 'i': - input_file = optarg; - break; - case 'l': - print_all_key_names = true; - show_all = false; - name_filter = NULL; - break; - case 'n': - name_filter = optarg; - show_all = false; - print_all_key_names = false; - break; - case 's': - tffs_size = strtoul(optarg, NULL, 0); - break; - default: - usage(EXIT_FAILURE); - break; - } - } - - if (!input_file) { - fprintf(stderr, "ERROR: No input file (-i ) given!\n"); - exit(EXIT_FAILURE); - } - - if (!file_exist(input_file)) { - fprintf(stderr, "ERROR: %s does not exist\n", input_file); - exit(EXIT_FAILURE); - } - - if (!show_all && !name_filter && !print_all_key_names) { - fprintf(stderr, - "ERROR: either -l, -a or -n is required!\n"); - exit(EXIT_FAILURE); - } -} - -int main(int argc, char *argv[]) -{ - int ret = EXIT_FAILURE; - uint8_t *buffer; - FILE *fp; - struct tffs_entry name_table; - struct tffs_key_name_table key_names; - - progname = basename(argv[0]); - - parse_options(argc, argv); - - fp = fopen(input_file, "r"); - - if (!fp) { - fprintf(stderr, "ERROR: Failed to open tffs input file %s\n", - input_file); - goto out; - } - - if (tffs_size == 0) { - fseek(fp, 0L, SEEK_END); - tffs_size = ftell(fp); - fseek(fp, 0L, SEEK_SET); - } - - buffer = malloc(tffs_size); - - if (fread(buffer, 1, tffs_size, fp) != tffs_size) { - fprintf(stderr, "ERROR: Failed read tffs file %s\n", - input_file); - goto out_free; - } - - if (!find_entry(buffer, TFFS_ID_TABLE_NAME, &name_table)) { - fprintf(stderr,"ERROR: No name table found in tffs file %s\n", - input_file); - fprintf(stderr," Is byte-swapping (-b) required?\n"); - goto out_free; - } - - parse_key_names(&name_table, &key_names); - if (key_names.size < 1) { - fprintf(stderr, "ERROR: No name table found in tffs file %s\n", - input_file); - goto out_free_names; - } - - if (print_all_key_names) { - show_all_key_names(&key_names); - ret = EXIT_SUCCESS; - } else if (show_all) { - ret = show_all_key_value_pairs(buffer, &key_names); - } else { - ret = show_matching_key_value(buffer, &key_names); - } - -out_free_names: - free(key_names.entries); -out_free: - fclose(fp); - free(buffer); -out: - return ret; -} diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index e853a8e04..d0cefff1a 100644 --- a/package/utils/fuse/Makefile +++ b/package/utils/fuse/Makefile @@ -18,7 +18,6 @@ PKG_HASH:=832432d1ad4f833c20e13b57cf40ce5277a9d33e483205fc63c78111b3358874 PKG_LICENSE:=LGPLv2.1 GPLv2 PKG_LICENSE_FILES:=COPYING.LIB COPYING -PKG_CPE_ID:=cpe:/a:fuse_project:fuse PKG_INSTALL:=1 diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch index ac0722c70..74b8c6f8f 100644 --- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch +++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch @@ -62,7 +62,7 @@ return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; } -@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, +@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, } @@ -77,7 +77,7 @@ LUA_API int lua_isstring (lua_State *L, int idx) { int t = lua_type(L, idx); return (t == LUA_TSTRING || t == LUA_TNUMBER); -@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, +@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, } @@ -162,7 +162,7 @@ case LUA_TNUMBER: { size_t l; lua_lock(L); /* `luaV_tostring' may create a new string */ -@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) +@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) } @@ -196,7 +196,7 @@ LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { -@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, +@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, lua_lock(L); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -205,7 +205,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State +@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State case LUA_TUSERDATA: mt = uvalue(obj)->metatable; break; @@ -215,7 +215,7 @@ default: mt = G(L)->mt[ttype(obj)]; break; -@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, +@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, api_checknelems(L, 1); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -224,7 +224,7 @@ luaC_barriert(L, hvalue(o), L->top-1); L->top--; lua_unlock(L); -@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State +@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State break; } default: { @@ -286,7 +286,7 @@ #define FREELIST_REF 0 /* free list of references */ -@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State +@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State static void tag_error (lua_State *L, int narg, int tag) { @@ -351,7 +351,7 @@ -@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) +@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) int base = luaL_optint(L, 2, 10); if (base == 10) { /* standard conversion */ luaL_checkany(L, 1); @@ -503,7 +503,7 @@ case VKNUM: case VTRUE: case VFALSE: -@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc +@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ e->u.s.info = (e->k == VNIL) ? nilK(fs) : (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : @@ -896,7 +896,7 @@ lua_assert(isdigit(ls->current)); do { save_and_next(ls); -@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, +@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, save_and_next(ls); save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ @@ -1009,7 +1009,6 @@ -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - -- +#ifdef LNUM_FLOAT +# define PI (3.14159265358979323846F) +#elif defined(M_PI) @@ -1018,7 +1017,7 @@ +# define PI (3.14159265358979323846264338327950288) +#endif +#define RADIANS_PER_DEGREE (PI/180) -+ + +#undef HUGE +#ifdef LNUM_FLOAT +# define HUGE HUGE_VALF @@ -2104,7 +2103,7 @@ case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ case LUA_TLIGHTUSERDATA: -@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, +@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, } } @@ -2607,7 +2606,7 @@ nums[ceillog2(k)]++; /* count as such */ return 1; } -@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table +@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table /* re-insert elements from vanishing slice */ for (i=nasize; iarray[i])) @@ -2651,7 +2650,7 @@ } while (n); return luaO_nilobject; } -@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const +@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const switch (ttype(key)) { case LUA_TNIL: return luaO_nilobject; case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); @@ -3062,7 +3061,7 @@ /* @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. ** CHANGE it if your system requires alignments larger than double. (For -@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; +@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; #define luai_userstateyield(L,n) ((void)L) @@ -3093,7 +3092,7 @@ /* --- a/src/lundump.c +++ b/src/lundump.c -@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* +@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* return x; } @@ -3107,7 +3106,7 @@ static TString* LoadString(LoadState* S) { size_t size; -@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, +@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; @@ -3199,7 +3198,7 @@ setsvalue2s(L, obj, luaS_new(L, s)); return 1; } -@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, +@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, } @@ -3422,10 +3421,10 @@ + case TM_POW: if (try_powint( ri, ib, ic)) return; break; + case TM_UNM: if (try_unmint( ri, ib)) return; break; + default: lua_assert(0); - } ++ } + } + /* Fallback to floating point, when leaving range. */ - ++ +#ifdef LNUM_COMPLEX + if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) { + lua_Complex r; @@ -3445,7 +3444,7 @@ + default: lua_assert(0); r=0; + } + setnvalue_complex( ra, r ); -+ } + } + return; + } +#endif @@ -3466,7 +3465,7 @@ + if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} -+ + +/* Helper macro to sort arithmetic operations into four categories: + * TK_INT: integer - integer operands + * TK_NUMBER: number - number (non complex, either may be integer) diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch index 3d3d6850e..937fc137e 100644 --- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch +++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch @@ -1,6 +1,6 @@ --- a/src/lvm.c +++ b/src/lvm.c -@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T +@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T else return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) ); @@ -10,7 +10,7 @@ return res; return luaG_ordererror(L, l, r); -@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons +@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons else return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) ); diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch index 64f683ddb..bcd410f69 100644 --- a/package/utils/lua/patches/020-shared_liblua.patch +++ b/package/utils/lua/patches/020-shared_liblua.patch @@ -21,7 +21,7 @@ ranlib: --- a/src/ldo.h +++ b/src/ldo.h -@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, +@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch index d221c4ee9..dd6579148 100644 --- a/package/utils/lua/patches/050-honor-cflags.patch +++ b/package/utils/lua/patches/050-honor-cflags.patch @@ -8,4 +8,4 @@ + $(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $? ln -fs $@.$(PKG_VERSION) $@ - $(LUA_T): $(LUA_O) $(LUA_SO) + diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch index b971e0975..5fbb87388 100644 --- a/package/utils/lua/patches/300-opcode_performance.patch +++ b/package/utils/lua/patches/300-opcode_performance.patch @@ -10,7 +10,7 @@ /* * If 'obj' is a string, it is tried to be interpreted as a number. -@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal +@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal ARITH_OP1_END #endif @@ -74,7 +74,7 @@ reentry: /* entry point */ lua_assert(isLua(L->ci)); pc = L->savedpc; -@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex +@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex lua_assert(base == L->base && L->base == L->ci->base); lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); @@ -115,7 +115,7 @@ TValue g; TValue *rb = KBx(i); sethvalue(L, &g, cl->env); -@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex +@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex Protect(luaV_gettable(L, &g, rb, ra)); continue; } @@ -219,7 +219,7 @@ const TValue *rb = RB(i); switch (ttype(rb)) { case LUA_TTABLE: { -@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex +@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -241,7 +241,7 @@ TValue *rb = RKB(i); TValue *rc = RKC(i); Protect( -@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex +@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -250,7 +250,7 @@ Protect( if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex +@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -259,7 +259,7 @@ Protect( if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex +@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -275,7 +275,7 @@ TValue *rb = RB(i); if (l_isfalse(rb) != GETARG_C(i)) { setobjs2s(L, ra, rb); -@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex +@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -284,7 +284,7 @@ int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ -@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex +@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -293,7 +293,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b; /* else previous instruction set top */ L->savedpc = pc; -@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex +@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -302,7 +302,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); -@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex +@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex goto reentry; } } @@ -311,7 +311,7 @@ /* If start,step and limit are all integers, we don't need to check * against overflow in the looping. */ -@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex +@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -320,7 +320,7 @@ const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; -@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex +@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex dojump(L, pc, GETARG_sBx(i)); continue; } @@ -329,7 +329,7 @@ StkId cb = ra + 3; /* call base */ setobjs2s(L, cb+2, ra+2); setobjs2s(L, cb+1, ra+1); -@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex +@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -338,7 +338,7 @@ int n = GETARG_B(i); int c = GETARG_C(i); int last; -@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex +@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -352,7 +352,7 @@ Proto *p; Closure *ncl; int nup, j; -@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex +@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex Protect(luaC_checkGC(L)); continue; } diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 223e032f2..101a31004 100644 --- a/package/utils/otrx/src/otrx.c +++ b/package/utils/otrx/src/otrx.c @@ -1,7 +1,7 @@ /* * otrx * - * Copyright (C) 2015-2017 RafaÅ‚ MiÅ‚ecki + * Copyright (C) 2015 RafaÅ‚ MiÅ‚ecki * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -124,7 +124,9 @@ static const uint32_t crc32_tbl[] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { +uint32_t otrx_crc32(uint8_t *buf, size_t len) { + uint32_t crc = 0xffffffff; + while (len) { crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); buf++; @@ -156,6 +158,7 @@ static int otrx_check(int argc, char **argv) { size_t bytes, length; uint8_t buf[1024]; uint32_t crc32; + int i; int err = 0; if (argc < 3) { @@ -200,7 +203,8 @@ static int otrx_check(int argc, char **argv) { fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); length -= TRX_FLAGS_OFFSET; while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { - crc32 = otrx_crc32(crc32, buf, bytes); + for (i = 0; i < bytes; i++) + crc32 = crc32_tbl[(crc32 ^ buf[i]) & 0xff] ^ (crc32 >> 8); length -= bytes; } @@ -228,11 +232,14 @@ out: * Create **************************************************/ +static void otrx_create_parse_options(int argc, char **argv) { +} + static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { FILE *in; size_t bytes; ssize_t length = 0; - uint8_t buf[1024]; + uint8_t buf[128]; in = fopen(in_path, "r"); if (!in) { @@ -264,12 +271,9 @@ static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { if (fwrite(buf, 1, length, trx) != length) { fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); - free(buf); return -EIO; } - free(buf); - return length; } @@ -284,7 +288,7 @@ static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { size_t bytes, length; - uint8_t buf[1024]; + uint8_t *buf; uint32_t crc32; hdr->magic = cpu_to_le32(TRX_MAGIC); @@ -299,13 +303,20 @@ static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { length = le32_to_cpu(hdr->length); - crc32 = 0xffffffff; - fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); - length -= TRX_FLAGS_OFFSET; - while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { - crc32 = otrx_crc32(crc32, buf, bytes); - length -= bytes; + buf = malloc(length); + if (!buf) { + fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); + return -ENOMEM; } + + fseek(trx, 0, SEEK_SET); + bytes = fread(buf, 1, length, trx); + if (bytes != length) { + fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); + return -ENOMEM; + } + + crc32 = otrx_crc32(buf + TRX_FLAGS_OFFSET, length - TRX_FLAGS_OFFSET); hdr->crc32 = cpu_to_le32(crc32); fseek(trx, 0, SEEK_SET); @@ -334,6 +345,9 @@ static int otrx_create(int argc, char **argv) { } trx_path = argv[2]; + optind = 3; + otrx_create_parse_options(argc, argv); + trx = fopen(trx_path, "w+"); if (!trx) { fprintf(stderr, "Couldn't open %s\n", trx_path); @@ -343,7 +357,7 @@ static int otrx_create(int argc, char **argv) { fseek(trx, curr_offset, SEEK_SET); optind = 3; - while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { + while ((c = getopt(argc, argv, "f:b:")) != -1) { switch (c) { case 'f': if (curr_idx >= TRX_MAX_PARTS) { @@ -367,27 +381,6 @@ static int otrx_create(int argc, char **argv) { curr_offset += sbytes; break; - case 'A': - sbytes = otrx_create_append_file(trx, optarg); - if (sbytes < 0) { - fprintf(stderr, "Failed to append file %s\n", optarg); - } else { - curr_offset += sbytes; - } - - sbytes = otrx_create_align(trx, curr_offset, 4); - if (sbytes < 0) - fprintf(stderr, "Failed to append zeros\n"); - else - curr_offset += sbytes; - break; - case 'a': - sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); - if (sbytes < 0) - fprintf(stderr, "Failed to append zeros\n"); - else - curr_offset += sbytes; - break; case 'b': sbytes = strtol(optarg, NULL, 0) - curr_offset; if (sbytes < 0) { @@ -405,12 +398,6 @@ static int otrx_create(int argc, char **argv) { break; } - sbytes = otrx_create_align(trx, curr_offset, 0x1000); - if (sbytes < 0) - fprintf(stderr, "Failed to append zeros\n"); - else - curr_offset += sbytes; - hdr.length = curr_offset; otrx_create_write_hdr(trx, &hdr); err_close: @@ -565,8 +552,6 @@ static void usage() { printf("Creating new TRX file:\n"); printf("\totrx create [options] [partitions]\n"); printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); - printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); - printf("\t-a alignment\t\t\t[partition] align current partition\n"); printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); printf("\n"); printf("Extracting from TRX file:\n"); diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 1dad863fd..0243b773e 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=3 PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-02-11 -PKG_SOURCE_VERSION:=c30055a685bca1e81ccc8f4bd3bb08d780a7d762 -PKG_MIRROR_HASH:=a618f9a15d3a585453550190eed2bb0a308ddba0ab37f2f6b76dd3c87fd80e8b +PKG_SOURCE_DATE:=2016-10-24 +PKG_SOURCE_VERSION:=32a6b2b702c3b9f8c425f3d9dc9f4273e276029c +PKG_MIRROR_HASH:=41d24ef335e9b2847895b04cee4d1c7efa56fc207798f5858e7a1f229a33c5eb PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index 2560f1c40..1b1ef147b 100644 --- a/package/utils/usbmode/Makefile +++ b/package/utils/usbmode/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git -PKG_SOURCE_DATE:=2017-12-19 -PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26 -PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83 +PKG_SOURCE_DATE:=2017-05-24 +PKG_SOURCE_VERSION:=453da8e540b1c53d357b897d6c70372cd4633390 +PKG_MIRROR_HASH:=b4a7132b940192f2e9a74bd890bd7008ede701e1d52284c3ade0cdc7d663929f CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index 88cb31477..aea13ac8d 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,13 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.30.2 +PKG_VERSION:=2.29.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.30 -PKG_HASH:=7b5be5489e9b5b7177832836467aba1c87bf0e9bcbcb5a6f35d76cd4782589dc -PKG_CPE_ID:=cpe:/a:kernel:util-linux +PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.29 +PKG_HASH:=accea4d678209f97f634f40a93b7e9fcad5915d1f4749f6c47bee6bf110fe8e3 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= COPYING \ @@ -31,8 +30,6 @@ PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 -DISABLE_NLS:=--disable-nls - include $(INCLUDE_DIR)/package.mk define Package/util-linux/Default @@ -166,7 +163,6 @@ endef define Package/dmesg $(call Package/util-linux/Default) TITLE:=print or control the kernel ring buffer - DEPENDS:= +libncursesw endef define Package/dmesg/description @@ -176,7 +172,7 @@ endef define Package/fdisk $(call Package/util-linux/Default) TITLE:=manipulate disk partition table - DEPENDS:= +libblkid +libsmartcols +libfdisk +libncursesw + DEPENDS:= +libblkid +libsmartcols +libfdisk SUBMENU=Disc endef @@ -353,7 +349,7 @@ define Package/sfdisk $(call Package/util-linux/Default) TITLE:=partition table manipulator for Linux SUBMENU=Disc - DEPENDS:= +libblkid +libfdisk +libsmartcols +libncursesw + DEPENDS:= +libblkid +libfdisk +libsmartcols endef define Package/sfdisk/description diff --git a/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch b/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch new file mode 100644 index 000000000..a291f6ac8 --- /dev/null +++ b/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch @@ -0,0 +1,24 @@ +From feda4342df1ced25df3d200ed23469e740196c86 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 18 Jan 2017 13:17:21 +0100 +Subject: build-sys: use -lm for scriptreplay if necessary + +Reported-by: Bert van Hall +Addresses: https://github.com/karelzak/util-linux/pull/397 +Signed-off-by: Karel Zak +--- + configure.ac | 7 +++++++ + term-utils/Makemodule.am | 2 +- + 2 files changed, 8 insertions(+), 1 deletion(-) + +--- a/term-utils/Makemodule.am ++++ b/term-utils/Makemodule.am +@@ -21,7 +21,7 @@ if BUILD_SCRIPTREPLAY + usrbin_exec_PROGRAMS += scriptreplay + dist_man_MANS += term-utils/scriptreplay.1 + scriptreplay_SOURCES = term-utils/scriptreplay.c +-scriptreplay_LDADD = $(LDADD) libcommon.la ++scriptreplay_LDADD = $(LDADD) libcommon.la $(MATH_LIBS) + endif # BUILD_SCRIPTREPLAY + + diff --git a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch index c79813b1b..16ba14ae3 100644 --- a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch +++ b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch @@ -10,7 +10,7 @@ endif # BUILD_LIBUUID --- a/configure.ac +++ b/configure.ac -@@ -2255,18 +2255,23 @@ AC_CONFIG_HEADERS([config.h]) +@@ -2165,18 +2165,23 @@ AC_CONFIG_HEADERS([config.h]) # AC_CONFIG_FILES([ Makefile @@ -66,7 +66,7 @@ endif # BUILD_LIBSMARTCOLS --- a/libfdisk/Makemodule.am +++ b/libfdisk/Makemodule.am -@@ -9,7 +9,6 @@ SUBDIRS += libfdisk/docs +@@ -8,7 +8,6 @@ SUBDIRS += libfdisk/docs endif pkgconfig_DATA += libfdisk/fdisk.pc diff --git a/package/utils/util-linux/patches/100-use_urandom.patch b/package/utils/util-linux/patches/100-use_urandom.patch deleted file mode 100644 index 848f2f40c..000000000 --- a/package/utils/util-linux/patches/100-use_urandom.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/lib/randutils.c -+++ b/lib/randutils.c -@@ -25,6 +25,11 @@ - #define THREAD_LOCAL static - #endif - -+/* force /dev/urandom to avoid hanging on early boot */ -+#undef HAVE_GETRANDOM -+#undef SYS_getrandom -+#undef __NR_getrandom -+ - #ifdef HAVE_GETRANDOM - # include - #elif defined (__linux__) diff --git a/package/utils/xfsprogs/Makefile b/package/utils/xfsprogs/Makefile index 5cf1da240..fb350993f 100644 --- a/package/utils/xfsprogs/Makefile +++ b/package/utils/xfsprogs/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfsprogs -PKG_CPE_ID:=cpe:/a:sgi:xfsprogs PKG_RELEASE:=1 -PKG_VERSION:=4.11.0 -PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs -PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2 +PKG_VERSION:=3.1.7 +PKG_SOURCE_URL:=ftp://oss.sgi.com/projects/xfs/previous/ +PKG_HASH:=e150914210ac5fd29c098ef0fd94bdec51d2fb231cf9faa765c16ec6d75c8eaa -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_INSTALL:=1 -PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/nls.mk define Package/xfsprogs/default SECTION:=utils @@ -58,12 +58,15 @@ MAKE_FLAGS += \ DEBUG= Q= \ PCFLAGS="-Wall" \ PKG_PLATFORM=linux \ - ENABLE_GETTEXT=no - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR)/libxfs crc32table.h CFLAGS="$(HOST_CFLAGS) -I$(PKG_BUILD_DIR)/include" - $(call Build/Compile/Default) -endef + ENABLE_GETTEXT=no \ + prefix=$(PKG_INSTALL_DIR)/usr \ + exec_prefix=$(PKG_INSTALL_DIR)/usr \ + PKG_SBIN_DIR=$(PKG_INSTALL_DIR)/usr/sbin \ + PKG_ROOT_SBIN_DIR=$(PKG_INSTALL_DIR)/sbin \ + PKG_MAN_DIR=$(PKG_INSTALL_DIR)/usr/man \ + PKG_LOCALE_DIR=$(PKG_INSTALL_DIR)/usr/share/locale \ + PKG_ROOT_LIB_DIR=$(PKG_INSTALL_DIR)/lib \ + PKG_DOC_DIR=$(PKG_INSTALL_DIR)/usr/share/doc/xfsprogs define Package/xfs-mkfs/install mkdir -p $(1)/usr/sbin diff --git a/package/utils/xfsprogs/patches/001-automake-compat.patch b/package/utils/xfsprogs/patches/001-automake-compat.patch new file mode 100644 index 000000000..ce9289a4a --- /dev/null +++ b/package/utils/xfsprogs/patches/001-automake-compat.patch @@ -0,0 +1,78 @@ +commit 2222aa77e11b959e0e5a0ded3482e56799593bc2 +Author: Jens Muecke +Date: Thu Jan 26 00:34:15 2012 +0100 + + 001-automake-compat + +--- a/configure.in ++++ b/configure.in +@@ -2,7 +2,8 @@ AC_INIT(include/libxfs.h) + AC_PREREQ(2.50) + AC_CONFIG_AUX_DIR([.]) + AC_CONFIG_MACRO_DIR([m4]) +-AC_CONFIG_HEADER(include/platform_defs.h) ++# Put a dummy here (http://www.mail-archive.com/automake@gnu.org/msg09241.html) ++AC_CONFIG_HEADERS([doesnotexist.h include/platform_defs.h]) + AC_PREFIX_DEFAULT(/usr) + + AC_PROG_LIBTOOL +--- a/include/builddefs.in ++++ b/include/builddefs.in +@@ -20,6 +20,8 @@ + ifndef _BUILDDEFS_INCLUDED_ + _BUILDDEFS_INCLUDED_ = 1 + ++SHELL = @SHELL@ ++ + DEBUG = @debug_build@ + OPTIMIZER = @opt_build@ + MALLOCLIB = @malloc_lib@ +--- a/m4/package_types.m4 ++++ b/m4/package_types.m4 +@@ -9,7 +9,7 @@ AC_DEFUN([AC_TYPE_PSINT], + #include + ], [ + __psint_t psint; +- ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) ++ ], AC_DEFINE([HAVE___PSINT_T], [1], [Define if __psint_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) + ]) + + # +@@ -23,7 +23,7 @@ AC_DEFUN([AC_TYPE_PSUNSIGNED], + #include + ], [ + __psunsigned_t psuint; +- ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) ++ ], AC_DEFINE([HAVE___PSUNSIGNED_T], [1], [Define if __psunsigned_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) + ]) + + # +@@ -37,7 +37,7 @@ AC_DEFUN([AC_TYPE_U32], + #include + ], [ + __u32 u32; +- ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) ++ ], AC_DEFINE([HAVE___U32], [1], [Define if __u32 exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) + ]) + + # +@@ -50,15 +50,15 @@ AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG], + AC_CHECK_SIZEOF(long, 4) + AC_CHECK_SIZEOF(char *, 4) + if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then +- AC_DEFINE(HAVE_32BIT_LONG) ++ AC_DEFINE([HAVE_32BIT_LONG], [1], [Define if long is 32bit]) + fi + if test $ac_cv_sizeof_long -eq 8; then +- AC_DEFINE(HAVE_64BIT_LONG) ++ AC_DEFINE([HAVE_64BIT_LONG], [1], [Define if long is 64bit]) + fi + if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then +- AC_DEFINE(HAVE_32BIT_PTR) ++ AC_DEFINE([HAVE_32BIT_PTR], [1], [Define if char* is 32bit]) + fi + if test $ac_cv_sizeof_char_p -eq 8; then +- AC_DEFINE(HAVE_64BIT_PTR) ++ AC_DEFINE([HAVE_64BIT_PTR], [1], [Define if char* is 64bit]) + fi + ]) diff --git a/package/utils/xfsprogs/patches/100-no-selftest.patch b/package/utils/xfsprogs/patches/100-no-selftest.patch deleted file mode 100644 index 227016675..000000000 --- a/package/utils/xfsprogs/patches/100-no-selftest.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/libxfs/Makefile -+++ b/libxfs/Makefile -@@ -118,9 +118,9 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT) - # don't try linking xfs_repair with a debug libxfs. - DEBUG = -DNDEBUG - --LDIRT = gen_crc32table crc32table.h crc32selftest -+LDIRT = gen_crc32table crc32table.h - --default: crc32selftest ltdepend $(LTLIBRARY) -+default: ltdepend $(LTLIBRARY) - - crc32table.h: gen_crc32table.c - @echo " [CC] gen_crc32table" diff --git a/package/utils/xfsprogs/patches/100-no_aio.patch b/package/utils/xfsprogs/patches/100-no_aio.patch new file mode 100644 index 000000000..4cc85d7de --- /dev/null +++ b/package/utils/xfsprogs/patches/100-no_aio.patch @@ -0,0 +1,19 @@ +commit e72b7bd12fdef06c3494b919376bfe886aa8bb4d +Author: Jens Muecke +Date: Thu Jan 26 00:35:43 2012 +0100 + + 100-no_aio + +--- a/configure.in ++++ b/configure.in +@@ -92,8 +92,8 @@ AC_PACKAGE_GLOBALS(xfsprogs) + AC_PACKAGE_UTILITIES(xfsprogs) + AC_MULTILIB($enable_lib64) + +-AC_PACKAGE_NEED_AIO_H +-AC_PACKAGE_NEED_LIO_LISTIO ++librt="-lrt" ++AC_SUBST(librt) + + AC_PACKAGE_NEED_UUID_H + AC_PACKAGE_NEED_UUIDCOMPARE diff --git a/package/utils/xfsprogs/patches/110-subdirs.patch b/package/utils/xfsprogs/patches/110-subdirs.patch deleted file mode 100644 index 53a6b09ce..000000000 --- a/package/utils/xfsprogs/patches/110-subdirs.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -46,8 +46,7 @@ HDR_SUBDIRS = include libxfs - - DLIB_SUBDIRS = libxlog libxcmd libhandle - LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) --TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \ -- mdrestore repair rtcp m4 man doc debian -+TOOL_SUBDIRS = db fsck growfs io mkfs repair - - ifneq ("$(PKG_PLATFORM)","darwin") - TOOL_SUBDIRS += fsr diff --git a/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch b/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch new file mode 100644 index 000000000..5d5d08c8d --- /dev/null +++ b/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch @@ -0,0 +1,32 @@ +commit 7b1d0a98e779170232c0a81b4749ab934ec67a7e +Author: Jens Muecke +Date: Thu Jan 26 00:36:42 2012 +0100 + + 110-uclibc_no_ustat + +--- a/libxfs/linux.c ++++ b/libxfs/linux.c +@@ -21,7 +21,6 @@ + #include + #include + #undef ustat +-#include + #include + #include + #include +@@ -49,6 +48,7 @@ static int max_block_alignment; + int + platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) + { ++#if 0 + /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ + struct ustat ust[2]; + struct stat64 st; +@@ -68,6 +68,7 @@ platform_check_ismounted(char *name, cha + progname, name); + return 1; + } ++#endif + return 0; + } + diff --git a/package/utils/xfsprogs/patches/120-disable_assert.patch b/package/utils/xfsprogs/patches/120-disable_assert.patch deleted file mode 100644 index 9a970d27a..000000000 --- a/package/utils/xfsprogs/patches/120-disable_assert.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/libxfs/libxfs_priv.h -+++ b/libxfs/libxfs_priv.h -@@ -84,9 +84,6 @@ extern uint32_t crc32c_le(uint32_t crc, - /* for all the support code that uses progname in error messages */ - extern char *progname; - --#undef ASSERT --#define ASSERT(ex) assert(ex) -- - #ifndef EWRONGFS - #define EWRONGFS EINVAL - #endif diff --git a/package/utils/xfsprogs/patches/120-portability.patch b/package/utils/xfsprogs/patches/120-portability.patch new file mode 100644 index 000000000..1d5905a67 --- /dev/null +++ b/package/utils/xfsprogs/patches/120-portability.patch @@ -0,0 +1,45 @@ +commit d2aef8b3967e53fe58178f5af50fef488ee0faed +Author: Jens Muecke +Date: Thu Jan 26 00:37:52 2012 +0100 + + 120-portability + +--- a/copy/xfs_copy.c ++++ b/copy/xfs_copy.c +@@ -463,6 +463,15 @@ read_ag_header(int fd, xfs_agnumber_t ag + } + + ++static void sig_mask(int type) ++{ ++ sigset_t mask; ++ sigemptyset(&mask); ++ sigaddset(&mask, SIGCHLD); ++ sigprocmask(type, &mask, NULL); ++} ++ ++ + void + write_wbuf(void) + { +@@ -478,9 +487,9 @@ write_wbuf(void) + if (target[i].state != INACTIVE) + pthread_mutex_unlock(&targ[i].wait); /* wake up */ + +- sigrelse(SIGCHLD); ++ sig_mask(SIG_UNBLOCK); + pthread_mutex_lock(&mainwait); +- sighold(SIGCHLD); ++ sig_mask(SIG_BLOCK); + } + + +@@ -847,7 +856,7 @@ main(int argc, char **argv) + /* set up sigchild signal handler */ + + signal(SIGCHLD, handler); +- sighold(SIGCHLD); ++ sig_mask(SIG_BLOCK); + + /* make children */ + diff --git a/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch b/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch new file mode 100644 index 000000000..c5c4a2a2a --- /dev/null +++ b/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch @@ -0,0 +1,32 @@ +commit 10d6058b24f18cb31889154f830b191849f45106 +Author: Jens Muecke +Date: Thu Jan 26 00:38:27 2012 +0100 + + 130-uclibc_no_xattr + +--- a/fsr/xfs_fsr.c ++++ b/fsr/xfs_fsr.c +@@ -35,7 +35,6 @@ + #include + #include + #include +-#include + + + #ifndef XFS_XFLAG_NODEFRAG +@@ -990,6 +989,7 @@ fsr_setup_attr_fork( + int tfd, + xfs_bstat_t *bstatp) + { ++#if 0 + struct stat64 tstatbuf; + int i; + int last_forkoff = 0; +@@ -1108,6 +1108,7 @@ fsr_setup_attr_fork( + out: + if (dflag) + fsrprintf(_("set temp attr\n")); ++#endif + return 0; + } + diff --git a/package/utils/xfsprogs/patches/140-no_po.patch b/package/utils/xfsprogs/patches/140-no_po.patch new file mode 100644 index 000000000..640774453 --- /dev/null +++ b/package/utils/xfsprogs/patches/140-no_po.patch @@ -0,0 +1,19 @@ +--- a/Makefile ++++ b/Makefile +@@ -41,7 +41,7 @@ endif + + LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk + TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ +- mdrestore repair rtcp m4 man doc po debian ++ mdrestore repair rtcp m4 man doc debian + + SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS) + +@@ -135,7 +135,6 @@ ifeq ($(HAVE_BUILDDEFS), no) + $(Q)$(MAKE) $(MAKEOPTS) -C . $@ + else + $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) +- $(Q)$(MAKE) $(MAKEOPTS) -C po + $(Q)$(MAKE) $(MAKEOPTS) source-link + $(Q)cd $(SRCDIR) && dpkg-buildpackage + endif diff --git a/package/utils/xfsprogs/patches/150-include_fixes.patch b/package/utils/xfsprogs/patches/150-include_fixes.patch new file mode 100644 index 000000000..793622a16 --- /dev/null +++ b/package/utils/xfsprogs/patches/150-include_fixes.patch @@ -0,0 +1,72 @@ +--- a/libhandle/handle.c ++++ b/libhandle/handle.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + /* just pick a value we know is more than big enough */ + #define MAXHANSIZ 64 +--- a/libhandle/jdm.c ++++ b/libhandle/jdm.c +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + /* internal fshandle - typecast to a void for external use */ + #define FSHANDLE_SZ 8 +--- a/libdisk/evms.c ++++ b/libdisk/evms.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include "evms.h" + +--- a/libdisk/evms.h ++++ b/libdisk/evms.h +@@ -16,6 +16,8 @@ + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + ++#include ++ + #define EVMS_MAJOR 117 + #define EVMS_GET_VOL_STRIPE_INFO \ + _IOR(EVMS_MAJOR, 0xF0, struct evms_vol_stripe_info_s) +--- a/libdisk/fstype.h ++++ b/libdisk/fstype.h +@@ -192,7 +192,7 @@ struct adfs_super_block { + char s_dummy2[62]; + char s_checksum[1]; + }; +-#define adfsblksize(s) ((uint) s.s_blksize[0]) ++#define adfsblksize(s) ((unsigned int) s.s_blksize[0]) + + /* found in first 4 bytes of block 1 */ + struct vxfs_super_block { +--- a/fsr/xfs_fsr.c ++++ b/fsr/xfs_fsr.c +@@ -25,6 +25,7 @@ + #include + #include + ++#include + #include + #include + #include +--- a/libdisk/xvm.c ++++ b/libdisk/xvm.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + #include "xvm.h" + diff --git a/package/utils/xfsprogs/patches/160-format-security.patch b/package/utils/xfsprogs/patches/160-format-security.patch new file mode 100644 index 000000000..5ae627d4a --- /dev/null +++ b/package/utils/xfsprogs/patches/160-format-security.patch @@ -0,0 +1,29 @@ +From: Ben Myers +Date: Fri, 1 Feb 2013 21:50:22 +0000 (-0600) +Subject: xfsprogs: fix warning in libxcmd/input.c +X-Git-Tag: v3.1.11~25 +X-Git-Url: http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs%2Fcmds%2Fxfsprogs.git;a=commitdiff_plain;h=50a3aa8977821ad072f3aa5b63645827f9b8ca1d + +xfsprogs: fix warning in libxcmd/input.c + +Fix an error when building with -Werror=format-security. + +input.c: In function 'fetchline': +input.c:91:2: error: format not a string literal and no format arguments [-Werror=format-security] + +Signed-off-by: Ben Myers +Reported by: Arkadiusz MiÅ›kiewicz +Reviewed-by: Mark Tinguely +--- + +--- a/libxcmd/input.c ++++ b/libxcmd/input.c +@@ -88,7 +88,7 @@ fetchline(void) + + if (!line) + return NULL; +- printf(get_prompt()); ++ printf("%s", get_prompt()); + fflush(stdout); + if (!fgets(line, MAXREADLINESZ, stdin)) { + free(line); From adf2b2271359cd273ec8583805f999d5bb785b66 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 10 Jan 2018 21:40:26 +0800 Subject: [PATCH 70/95] add ppp-sync and shellsync --- package/network/services/ppp/Makefile | 2 +- package/network/services/ppp/files/ppp.sh | 9 + .../ppp/patches/140-pppoe_compile_fix.patch | 62 ++--- .../ppp/patches/500-add-pptp-plugin.patch | 3 +- .../services/ppp/patches/511-syncppp.patch | 214 ++++++++++++++++++ .../services/ppp/patches/520-uniq.patch | 12 +- package/network/services/shellsync/Makefile | 34 +++ .../services/shellsync/src/shellsync.c | 106 +++++++++ 8 files changed, 393 insertions(+), 49 deletions(-) create mode 100644 package/network/services/ppp/patches/511-syncppp.patch create mode 100644 package/network/services/shellsync/Makefile create mode 100644 package/network/services/shellsync/src/shellsync.c diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile index 6c615cab0..282e8f17f 100644 --- a/package/network/services/ppp/Makefile +++ b/package/network/services/ppp/Makefile @@ -35,7 +35,7 @@ endef define Package/ppp $(call Package/ppp/Default) - DEPENDS:=+kmod-ppp + DEPENDS:=+kmod-ppp +libpthread +shellsync TITLE:=PPP daemon VARIANT:=default endef diff --git a/package/network/services/ppp/files/ppp.sh b/package/network/services/ppp/files/ppp.sh index 73bc3161c..875714b35 100755 --- a/package/network/services/ppp/files/ppp.sh +++ b/package/network/services/ppp/files/ppp.sh @@ -223,7 +223,16 @@ proto_pppoe_setup() { json_get_var service service json_get_var host_uniq host_uniq +#By èˆèˆï¼šå¹¶å‘拨å·åŒæ­¥çš„å‰æœŸå‡†å¤‡ + syncppp_option="" + [ "$(uci get syncdial.config.enabled)" == "1" ] && { + ppp_if_cnt=$(cat /etc/config/network | grep -c "proto 'pppoe'") + syncppp_option="syncppp $ppp_if_cnt" + shellsync $ppp_if_cnt 10 + } + ppp_generic_setup "$config" \ + $syncppp_option \ plugin rp-pppoe.so \ ${ac:+rp_pppoe_ac "$ac"} \ ${service:+rp_pppoe_service "$service"} \ diff --git a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch index 2983a75c4..d9c9b83a3 100644 --- a/package/network/services/ppp/patches/140-pppoe_compile_fix.patch +++ b/package/network/services/ppp/patches/140-pppoe_compile_fix.patch @@ -1,23 +1,27 @@ ---- a/pppd/plugins/rp-pppoe/plugin.c -+++ b/pppd/plugins/rp-pppoe/plugin.c -@@ -46,10 +46,10 @@ static char const RCSID[] = - #include - #include - #include --#include - #include - #include - #include -+#include - - #ifndef _ROOT_PATH - #define _ROOT_PATH "" --- a/pppd/plugins/rp-pppoe/pppoe.h +++ b/pppd/plugins/rp-pppoe/pppoe.h -@@ -86,17 +86,6 @@ typedef unsigned long UINT32_t; +@@ -48,11 +48,7 @@ + #endif + /* Ugly header files on some Linux boxes... */ +-#if defined(HAVE_LINUX_IF_H) +-#include +-#elif defined(HAVE_NET_IF_H) + #include +-#endif + + #ifdef HAVE_NET_IF_TYPES_H + #include +@@ -80,22 +76,8 @@ typedef unsigned long UINT32_t; + #error Could not find a 32-bit integer type + #endif + +-#ifdef HAVE_LINUX_IF_ETHER_H +-#include +-#endif +- #include - +- -#ifdef HAVE_NETINET_IF_ETHER_H -#include - @@ -28,21 +32,10 @@ -#include -#endif -#endif -- ++#include - /* Ethernet frame types according to RFC 2516 */ ---- a/pppd/plugins/rp-pppoe/if.c -+++ b/pppd/plugins/rp-pppoe/if.c -@@ -31,7 +31,7 @@ static char const RCSID[] = - #endif - #ifdef HAVE_NET_ETHERNET_H --#include -+#include - #endif - - #ifdef HAVE_ASM_TYPES_H --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c @@ -16,6 +16,7 @@ @@ -53,18 +46,7 @@ #ifdef HAVE_UNISTD_H #include -@@ -27,10 +28,6 @@ - #include - #endif - --#ifdef HAVE_NET_ETHERNET_H --#include --#endif -- - #ifdef HAVE_ASM_TYPES_H - #include - #endif -@@ -717,6 +714,23 @@ char *xstrdup(const char *s) +@@ -717,6 +718,23 @@ char *xstrdup(const char *s) return ret; } diff --git a/package/network/services/ppp/patches/500-add-pptp-plugin.patch b/package/network/services/ppp/patches/500-add-pptp-plugin.patch index 5ed861d54..d984e1b16 100644 --- a/package/network/services/ppp/patches/500-add-pptp-plugin.patch +++ b/package/network/services/ppp/patches/500-add-pptp-plugin.patch @@ -1064,7 +1064,7 @@ + struct in_addr localbind); --- /dev/null +++ b/pppd/plugins/pptp/pptp_ctrl.c -@@ -0,0 +1,1078 @@ +@@ -0,0 +1,1077 @@ +/* pptp_ctrl.c ... handle PPTP control connection. + * C. Scott Ananian + * @@ -1083,7 +1083,6 @@ +#include +#include +#include -+#include "pppd.h" +#include "pptp_msg.h" +#include "pptp_ctrl.h" +#include "pptp_options.h" diff --git a/package/network/services/ppp/patches/511-syncppp.patch b/package/network/services/ppp/patches/511-syncppp.patch new file mode 100644 index 000000000..fe58b8cc8 --- /dev/null +++ b/package/network/services/ppp/patches/511-syncppp.patch @@ -0,0 +1,214 @@ +diff -Naur ppp-2.4.5.0/pppd/chap-new.c ppp-2.4.5/pppd/chap-new.c +--- ppp-2.4.5.0/pppd/chap-new.c 2012-04-18 15:44:46.000000000 +0800 ++++ ppp-2.4.5/pppd/chap-new.c 2012-04-19 20:24:28.000000000 +0800 +@@ -37,6 +37,8 @@ + #include "chap-new.h" + #include "chap-md5.h" + ++#include "syncppp.h" ++ + #ifdef CHAPMS + #include "chap_ms.h" + #define MDTYPE_ALL (MDTYPE_MICROSOFT_V2 | MDTYPE_MICROSOFT | MDTYPE_MD5) +@@ -481,6 +483,19 @@ + p[2] = len >> 8; + p[3] = len; + ++ if (npppd > 1) { ++ if (syncppp(npppd) < 0) { ++ error("syncppp sync fail"); ++ sem_unlink(SEM_COUNT_NAME); ++ sem_unlink(SEM_BLOCK_NAME); ++ } else { ++ info("syncppp sync succeeded"); ++ } ++ } else { ++ info("syncppp not active"); ++ } ++ ++ + output(0, response, PPP_HDRLEN + len); + } + +diff -Naur ppp-2.4.5.0/pppd/Makefile.linux ppp-2.4.5/pppd/Makefile.linux +--- ppp-2.4.5.0/pppd/Makefile.linux 2012-04-18 15:44:46.000000000 +0800 ++++ ppp-2.4.5/pppd/Makefile.linux 2012-04-19 20:01:05.000000000 +0800 +@@ -13,16 +13,16 @@ + + PPPDSRCS = main.c magic.c fsm.c lcp.c ipcp.c upap.c chap-new.c md5.c ccp.c \ + ecp.c ipxcp.c auth.c options.c sys-linux.c md4.c chap_ms.c \ +- demand.c utils.c tty.c eap.c chap-md5.c session.c ++ demand.c utils.c tty.c eap.c chap-md5.c session.c syncppp.c + + HEADERS = ccp.h session.h chap-new.h ecp.h fsm.h ipcp.h \ + ipxcp.h lcp.h magic.h md5.h patchlevel.h pathnames.h pppd.h \ +- upap.h eap.h ++ upap.h eap.h syncppp.h + + MANPAGES = pppd.8 + PPPDOBJS = main.o magic.o fsm.o lcp.o ipcp.o upap.o chap-new.o md5.o ccp.o \ + ecp.o auth.o options.o demand.o utils.o sys-linux.o ipxcp.o tty.o \ +- eap.o chap-md5.o session.o ++ eap.o chap-md5.o session.o syncppp.o + + # + # include dependencies if present +@@ -33,7 +33,7 @@ + # CC = gcc + # + COPTS = -O2 -pipe -Wall -g +-LIBS = ++LIBS = -lpthread + + # Uncomment the next 2 lines to include support for Microsoft's + # MS-CHAP authentication protocol. Also, edit plugins/radius/Makefile.linux. +diff -Naur ppp-2.4.5.0/pppd/options.c ppp-2.4.5/pppd/options.c +--- ppp-2.4.5.0/pppd/options.c 2012-04-18 15:44:46.000000000 +0800 ++++ ppp-2.4.5/pppd/options.c 2012-04-19 20:24:49.000000000 +0800 +@@ -126,6 +126,7 @@ + bool dryrun; /* print out option values and exit */ + char *domain; /* domain name set by domain option */ + int child_wait = 5; /* # seconds to wait for children at exit */ ++int npppd = 0; /* synchronize between multiple pppd */ + struct userenv *userenv_list; /* user environment variables */ + + #ifdef MAXOCTETS +@@ -311,6 +312,10 @@ + "Set pathname of ipv6-down script", + OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, + ++ { "syncppp", o_int, &npppd, ++ "sync among multiple pppd when sending chap/pap respond", OPT_PRIO }, ++ ++ + #ifdef HAVE_MULTILINK + { "multilink", o_bool, &multilink, + "Enable multilink operation", OPT_PRIO | 1 }, +diff -Naur ppp-2.4.5.0/pppd/pppd.h ppp-2.4.5/pppd/pppd.h +--- ppp-2.4.5.0/pppd/pppd.h 2012-04-18 15:44:46.000000000 +0800 ++++ ppp-2.4.5/pppd/pppd.h 2012-04-19 20:25:02.000000000 +0800 +@@ -327,6 +327,7 @@ + extern bool dump_options; /* print out option values */ + extern bool dryrun; /* check everything, print options, exit */ + extern int child_wait; /* # seconds to wait for children at end */ ++extern int npppd; /* synchronize between multiple pppd */ + + #ifdef MAXOCTETS + extern unsigned int maxoctets; /* Maximum octetes per session (in bytes) */ +diff -Naur ppp-2.4.5.0/pppd/syncppp.c ppp-2.4.5/pppd/syncppp.c +--- ppp-2.4.5.0/pppd/syncppp.c 1970-01-01 08:00:00.000000000 +0800 ++++ ppp-2.4.5/pppd/syncppp.c 2012-04-18 15:46:59.000000000 +0800 +@@ -0,0 +1,75 @@ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "pppd.h" ++#include "syncppp.h" ++ ++int syncppp(int nproc) ++{ ++ int flags; ++ int value; ++ sem_t *block; ++ sem_t *count; ++ struct timespec ts; ++ ++ if (nproc <= 1) { ++ error("syncppp: number of pppd should be larger than 1"); ++ return -1; ++ } ++ ++ if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { ++ error("clock_gettime error"); ++ return -1; ++ } ++ ts.tv_sec += SYNCPPP_TIMEOUT; ++ ++ ++ flags = O_RDWR | O_CREAT; ++ block = sem_open(SEM_BLOCK_NAME, flags, 0644, 0); ++ count = sem_open(SEM_COUNT_NAME, flags, 0644, 0); ++ if (block == SEM_FAILED || count == SEM_FAILED) { ++ error("syncppp: sem_open failed"); ++ return -1; ++ } ++ ++ if (sem_post(count) < 0) { ++ error("syncppp: sem_post failed"); ++ return -1; ++ } ++ if (sem_getvalue(count, &value) < 0) { ++ error("syncppp: sem_getvalue failed"); ++ return -1; ++ } ++ info("%d pppd have arrived, waiting for the left %d", value, nproc-value); ++ if (value >= nproc) { ++ while (nproc-1 > 0) { ++ if (sem_post(block) < 0) { ++ error("syncppp: sem_post failed"); ++ return -1; ++ } ++ nproc--; ++ } ++ } else { ++ if (sem_timedwait(block, &ts) < 0) { ++ if (errno == ETIMEDOUT) { ++ error("syncppp: sem_timewait time out"); ++ } else { ++ error("syncppp: sem_timewait error"); ++ } ++ return -1; ++ } ++ ++ } ++ ++ sem_close(count); ++ sem_close(block); ++ ++ sem_unlink(SEM_COUNT_NAME); ++ sem_unlink(SEM_BLOCK_NAME); ++ ++ return 0; ++} ++ +diff -Naur ppp-2.4.5.0/pppd/syncppp.h ppp-2.4.5/pppd/syncppp.h +--- ppp-2.4.5.0/pppd/syncppp.h 1970-01-01 08:00:00.000000000 +0800 ++++ ppp-2.4.5/pppd/syncppp.h 2012-04-18 15:46:59.000000000 +0800 +@@ -0,0 +1,3 @@ ++#define SEM_BLOCK_NAME "block" ++#define SEM_COUNT_NAME "count" ++#define SYNCPPP_TIMEOUT 5 +diff -Naur ppp-2.4.5.0/pppd/upap.c ppp-2.4.5/pppd/upap.c +--- ppp-2.4.5.0/pppd/upap.c 2012-04-18 15:44:46.000000000 +0800 ++++ ppp-2.4.5/pppd/upap.c 2012-04-19 20:26:22.000000000 +0800 +@@ -52,6 +52,8 @@ + #include "pppd.h" + #include "upap.h" + ++#include "syncppp.h" ++ + static const char rcsid[] = RCSID; + + static bool hide_password = 1; +@@ -568,6 +570,18 @@ + PUTCHAR(u->us_passwdlen, outp); + BCOPY(u->us_passwd, outp, u->us_passwdlen); + ++ if (npppd > 1) { ++ if (syncppp(npppd) < 0) { ++ error("syncppp sync fail"); ++ sem_unlink(SEM_COUNT_NAME); ++ sem_unlink(SEM_BLOCK_NAME); ++ } else { ++ info("syncppp sync succeeded"); ++ } ++ } else { ++ info("syncppp not active"); ++ } ++ + output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN); + + TIMEOUT(upap_timeout, u, u->us_timeouttime); diff --git a/package/network/services/ppp/patches/520-uniq.patch b/package/network/services/ppp/patches/520-uniq.patch index 54c0d6271..65d0e96bc 100644 --- a/package/network/services/ppp/patches/520-uniq.patch +++ b/package/network/services/ppp/patches/520-uniq.patch @@ -147,7 +147,7 @@ strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); --- a/pppd/plugins/rp-pppoe/pppoe-discovery.c +++ b/pppd/plugins/rp-pppoe/pppoe-discovery.c -@@ -344,7 +344,7 @@ packetIsForMe(PPPoEConnection *conn, PPP +@@ -348,7 +348,7 @@ packetIsForMe(PPPoEConnection *conn, PPP if (memcmp(packet->ethHdr.h_dest, conn->myEth, ETH_ALEN)) return 0; /* If we're not using the Host-Unique tag, then accept the packet */ @@ -156,7 +156,7 @@ parsePacket(packet, parseForHostUniq, &forMe); return forMe; -@@ -470,16 +470,12 @@ sendPADI(PPPoEConnection *conn) +@@ -474,16 +474,12 @@ sendPADI(PPPoEConnection *conn) cursor += namelen + TAG_HDR_SIZE; /* If we're using Host-Uniq, copy it over */ @@ -179,7 +179,7 @@ } packet.length = htons(plen); -@@ -641,7 +637,7 @@ int main(int argc, char *argv[]) +@@ -645,7 +641,7 @@ int main(int argc, char *argv[]) memset(conn, 0, sizeof(PPPoEConnection)); @@ -188,7 +188,7 @@ switch(opt) { case 'S': conn->serviceName = xstrdup(optarg); -@@ -650,7 +646,23 @@ int main(int argc, char *argv[]) +@@ -654,7 +650,23 @@ int main(int argc, char *argv[]) conn->acName = xstrdup(optarg); break; case 'U': @@ -224,7 +224,7 @@ /* How do we access raw Ethernet devices? */ #undef USE_LINUX_PACKET -@@ -224,7 +226,7 @@ typedef struct PPPoEConnectionStruct { +@@ -217,7 +219,7 @@ typedef struct PPPoEConnectionStruct { char *serviceName; /* Desired service name, if any */ char *acName; /* Desired AC name, if any */ int synchronous; /* Use synchronous PPP */ @@ -233,7 +233,7 @@ int printACNames; /* Just print AC names */ FILE *debugFile; /* Debug file for dumping packets */ int numPADOs; /* Number of PADO packets received */ -@@ -280,6 +282,33 @@ void pppoe_printpkt(PPPoEPacket *packet, +@@ -273,6 +275,33 @@ void pppoe_printpkt(PPPoEPacket *packet, void (*printer)(void *, char *, ...), void *arg); void pppoe_log_packet(const char *prefix, PPPoEPacket *packet); diff --git a/package/network/services/shellsync/Makefile b/package/network/services/shellsync/Makefile new file mode 100644 index 000000000..6dce14b35 --- /dev/null +++ b/package/network/services/shellsync/Makefile @@ -0,0 +1,34 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=shellsync +PKG_VERSION:=0.2 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/shellsync + CATEGORY:=Utilities + TITLE:=shellsync + DEPENDS:=+libpthread +endef + +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) ./src/* $(PKG_BUILD_DIR)/ +endef + +define Package/shellsync/description +A tool to sync different shell scripts.Based on syncppp patch by morfast. +endef + +define Build/Compile + $(TARGET_CROSS)gcc -pthread -o $(PKG_BUILD_DIR)/shellsync $(PKG_BUILD_DIR)/shellsync.c +endef + +define Package/shellsync/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/shellsync $(1)/usr/bin +endef + + +$(eval $(call BuildPackage,shellsync)) diff --git a/package/network/services/shellsync/src/shellsync.c b/package/network/services/shellsync/src/shellsync.c new file mode 100644 index 000000000..4aef1e9ba --- /dev/null +++ b/package/network/services/shellsync/src/shellsync.c @@ -0,0 +1,106 @@ +/************************************************************************* + > File Name: shellsync.c + > Author: GuoGuo + > Mail: gch981213@gmail.com + > Created Time: 2014å¹´11月06æ—¥ 星期四 19æ—¶15分30秒 + ************************************************************************/ +#include +#include +#include +#include +#include +#include +#define SEM_BLOCK_NAME "SYNCSHELL_block" +#define SEM_COUNT_NAME "SYNCSHELL_count" +int wait_timeout; +int sync_wait(int nproc) +{ + int flags; + int value; + sem_t *block; + sem_t *count; + struct timespec ts; + + if (nproc <= 1) { + printf("sync_wait: number of processes should be larger than 1\n"); + return -1; + } + + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { + printf("clock_gettime error\n"); + return -1; + } + ts.tv_sec += wait_timeout; + + + flags = O_RDWR | O_CREAT; + block = sem_open(SEM_BLOCK_NAME, flags, 0644, 0); + count = sem_open(SEM_COUNT_NAME, flags, 0644, 0); + if (block == SEM_FAILED || count == SEM_FAILED) { + printf("sync_wait: sem_open failed\n"); + return -1; + } + + if (sem_post(count) < 0) { + printf("sync_wait: sem_post failed\n"); + return -1; + } + if (sem_getvalue(count, &value) < 0) { + printf("sync_wait: sem_getvalue failed\n"); + return -1; + } + printf("%d processes have arrived, waiting for the left %d\n", value, nproc-value); + if (value >= nproc) { + while (nproc-1 > 0) { + if (sem_post(block) < 0) { + printf("sync_wait: sem_post failed\n"); + return -1; + } + nproc--; + } + } else { + if (sem_timedwait(block, &ts) < 0) { + if (errno == ETIMEDOUT) { + printf("sync_wait: sem_timewait time out\n"); + } else { + printf("sync_wait: sem_timewait error\n"); + } + return -1; + } + + } + + sem_close(count); + sem_close(block); + + sem_unlink(SEM_COUNT_NAME); + sem_unlink(SEM_BLOCK_NAME); + + return 0; +} + +int main(int argc,char *argv[]) +{ + if(argc!=3) + { + printf("Usage: shellsync \n"); + } + else + { + int proc_num; + sscanf(argv[1],"%d",&proc_num); + sscanf(argv[2],"%d",&wait_timeout); + if(sync_wait(proc_num)<0) + { + printf("Processes sync failed.\n"); + sem_unlink(SEM_COUNT_NAME); + sem_unlink(SEM_BLOCK_NAME); + return 1; + } + else + { + printf("Processes sync succeed.\n"); + return 0; + } + } +} From f09c4d358773e212d80f186b51273b1332e35de8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 11 Jan 2018 12:09:31 +0800 Subject: [PATCH 71/95] update kernel to 4.4.110 and 4.9.75 to fix CVE-2017-5754 aka Meltdown --- include/kernel-version.mk | 8 +-- ...mware-loader-for-uPD720201-and-uPD72.patch | 6 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 4 +- .../910-unaligned_access_hacks.patch | 2 +- .../910-unaligned_access_hacks.patch | 4 +- ...024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch | 4 +- ...90-net-generalize-napi_complete_done.patch | 2 +- .../hack-4.9/207-disable-modorder.patch | 4 +- .../generic/hack-4.9/902-debloat_proc.patch | 2 +- .../pending-4.4/208-disable-modorder.patch | 4 +- .../653-disable_netlink_trim.patch | 2 +- .../pending-4.4/902-debloat_proc.patch | 2 +- .../pending-4.4/921-use_preinit_as_init.patch | 2 +- .../pending-4.4/995-mangle_bootargs.patch | 4 +- .../pending-4.9/920-mangle_bootargs.patch | 4 +- ...Mangle-bootloader-s-kernel-arguments.patch | 4 +- ...-mvneta-consolidate-autoneg-enabling.patch | 4 +- ...ment-ethtool-autonegotiation-control.patch | 6 +- ...the-default-queue-related-for-each-p.patch | 16 ++--- ...ta-Associate-RX-queues-with-each-CPU.patch | 22 +++---- ...034-net-mvneta-Add-naive-RSS-support.patch | 10 +-- ...035-net-mvneta-Configure-XPS-support.patch | 8 +-- ...rivial-cut-off-issue-in-mvneta_ethto.patch | 2 +- ...he-CPU-choice-in-mvneta_percpu_elect.patch | 6 +- ...mvneta-Use-on_each_cpu-when-possible.patch | 10 +-- ...y-the-queue-related-fields-from-each.patch | 16 ++--- ...vneta_percpu_elect-function-should-b.patch | 6 +- ...a-Fix-race-condition-during-stopping.patch | 16 ++--- ...d-support-for-hardware-buffer-manage.patch | 32 ++++----- ...et-mvneta-Use-the-new-hwbm-framework.patch | 2 +- .../047-net-mvneta-Fix-spinlock-usage.patch | 4 +- ...ce-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch | 4 +- ...hanging-MTU-when-using-per-cpu-proce.patch | 8 +-- .../134-net-mvneta-convert-to-phylink.patch | 65 +++++++++++-------- ...le-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch | 8 +-- ...22-net-mvneta-add-nway_reset-support.patch | 4 +- ...add-flow-control-support-via-phylink.patch | 10 +-- ...ble-flow-control-for-PHY-connections.patch | 2 +- ...e-flow-control-for-fixed-connections.patch | 4 +- .../427-phylink-add-EEE-support.patch | 2 +- .../428-net-mvneta-add-EEE-support.patch | 12 ++-- ...ta-add-module-EEPROM-reading-support.patch | 4 +- .../996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch | 4 +- .../200-pcengines-apu2-reboot.patch | 2 +- 44 files changed, 179 insertions(+), 168 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index ff6ba2a70..2b1b0b9fb 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,13 +3,13 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .108 -LINUX_VERSION-4.9 = .73 +LINUX_VERSION-4.4 = .110 +LINUX_VERSION-4.9 = .75 LINUX_VERSION-4.14 = .12 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.108 = 5a001198625ce9f7b0ef1e4b43e033aea859e1ef3509532412cce8f0375ba51a -LINUX_KERNEL_HASH-4.9.73 = 558b65c53f6d6c421d897ad4b651e51ba341fe4dd97122ec922e23ebd2c16e2b +LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58 +LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af ifdef KERNEL_PATCHVER diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index 96a5940e7..b30511d75 100644 --- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -236,6 +238,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -239,6 +241,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -275,6 +729,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -278,6 +732,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -526,7 +526,7 @@ Signed-off-by: Christian Lamparter driver = (struct hc_driver *)id->driver_data; /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -332,6 +802,16 @@ static void xhci_pci_remove(struct pci_d +@@ -335,6 +805,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch index 4d7c68661..354857105 100644 --- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch @@ -13,8 +13,8 @@ produce a noisy warning. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -193,7 +193,7 @@ static void xhci_pci_quirks(struct devic - } +@@ -196,7 +196,7 @@ static void xhci_pci_quirks(struct devic + xhci->quirks |= XHCI_TRUST_TX_LENGTH; if (pdev->vendor == PCI_VENDOR_ID_RENESAS && pdev->device == 0x0015) - xhci->quirks |= XHCI_RESET_ON_RESUME; diff --git a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch index 8789b644a..8882b1758 100644 --- a/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.4/910-unaligned_access_hacks.patch @@ -491,7 +491,7 @@ memcpy(p, foc->val, foc->len); --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c -@@ -505,7 +505,7 @@ static struct sk_buff *add_grec(struct s +@@ -529,7 +529,7 @@ static struct sk_buff *add_grec(struct s if (!skb) return NULL; psrc = (__be32 *)skb_put(skb, sizeof(__be32)); diff --git a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch index 21ceca156..92f0a6765 100644 --- a/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch +++ b/target/linux/ar71xx/patches-4.9/910-unaligned_access_hacks.patch @@ -448,7 +448,7 @@ memcpy(p, foc->val, foc->len); --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c -@@ -509,7 +509,7 @@ static struct sk_buff *add_grec(struct s +@@ -533,7 +533,7 @@ static struct sk_buff *add_grec(struct s if (!skb) return NULL; psrc = (__be32 *)skb_put(skb, sizeof(__be32)); @@ -795,7 +795,7 @@ --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -3886,14 +3886,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -3892,14 +3892,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch index 20311498a..7bf4fd47d 100644 --- a/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch +++ b/target/linux/generic/backport-4.9/024-1-tcp-tsq-add-tsq_flags-tsq_enum.patch @@ -18,7 +18,7 @@ Signed-off-by: David S. Miller --- a/include/linux/tcp.h +++ b/include/linux/tcp.h -@@ -367,7 +367,7 @@ struct tcp_sock { +@@ -368,7 +368,7 @@ struct tcp_sock { u32 *saved_syn; }; @@ -27,7 +27,7 @@ Signed-off-by: David S. Miller TSQ_THROTTLED, TSQ_QUEUED, TCP_TSQ_DEFERRED, /* tcp_tasklet_func() found socket was owned */ -@@ -378,6 +378,15 @@ enum tsq_flags { +@@ -379,6 +379,15 @@ enum tsq_flags { */ }; diff --git a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch index aa7c857b1..aaa743519 100644 --- a/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch +++ b/target/linux/generic/backport-4.9/090-net-generalize-napi_complete_done.patch @@ -615,7 +615,7 @@ Signed-off-by: David S. Miller buf_int_enable_value |= NPS_ENET_ENABLE << RX_RDY_SHIFT; --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c -@@ -1615,7 +1615,7 @@ static int fec_enet_rx_napi(struct napi_ +@@ -1623,7 +1623,7 @@ static int fec_enet_rx_napi(struct napi_ fec_enet_tx(ndev); if (pkts < budget) { diff --git a/target/linux/generic/hack-4.9/207-disable-modorder.patch b/target/linux/generic/hack-4.9/207-disable-modorder.patch index 1b0262a06..d52ca36c1 100644 --- a/target/linux/generic/hack-4.9/207-disable-modorder.patch +++ b/target/linux/generic/hack-4.9/207-disable-modorder.patch @@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau --- a/Makefile +++ b/Makefile -@@ -1197,7 +1197,6 @@ all: modules +@@ -1200,7 +1200,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1227,7 +1226,6 @@ _modinst_: +@@ -1230,7 +1229,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/hack-4.9/902-debloat_proc.patch b/target/linux/generic/hack-4.9/902-debloat_proc.patch index 7074c9e63..6216c2d4f 100644 --- a/target/linux/generic/hack-4.9/902-debloat_proc.patch +++ b/target/linux/generic/hack-4.9/902-debloat_proc.patch @@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1791,10 +1791,12 @@ static int __init setup_vmstat(void) +@@ -1792,10 +1792,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/pending-4.4/208-disable-modorder.patch b/target/linux/generic/pending-4.4/208-disable-modorder.patch index 7ea91f295..00d6e4195 100644 --- a/target/linux/generic/pending-4.4/208-disable-modorder.patch +++ b/target/linux/generic/pending-4.4/208-disable-modorder.patch @@ -5,7 +5,7 @@ Signed-off-by: Felix Fietkau --- --- a/Makefile +++ b/Makefile -@@ -1118,7 +1118,6 @@ all: modules +@@ -1121,7 +1121,6 @@ all: modules PHONY += modules modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau @$(kecho) ' Building modules, stage 2.'; $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild -@@ -1148,7 +1147,6 @@ _modinst_: +@@ -1151,7 +1150,6 @@ _modinst_: rm -f $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \ fi diff --git a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch index 5f4688570..b11104be9 100644 --- a/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch +++ b/target/linux/generic/pending-4.4/653-disable_netlink_trim.patch @@ -1,6 +1,6 @@ --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c -@@ -1228,24 +1228,7 @@ void netlink_detachskb(struct sock *sk, +@@ -1231,24 +1231,7 @@ void netlink_detachskb(struct sock *sk, static struct sk_buff *netlink_trim(struct sk_buff *skb, gfp_t allocation) { diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 5aada68e3..248ba8f67 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -133,7 +133,7 @@ } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1555,10 +1555,12 @@ static int __init setup_vmstat(void) +@@ -1556,10 +1556,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch index 1f4e6322b..3aba9d63b 100644 --- a/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch +++ b/target/linux/generic/pending-4.4/921-use_preinit_as_init.patch @@ -1,6 +1,6 @@ --- a/init/main.c +++ b/init/main.c -@@ -964,7 +964,8 @@ static int __ref kernel_init(void *unuse +@@ -966,7 +966,8 @@ static int __ref kernel_init(void *unuse panic("Requested init %s failed (error %d).", execute_command, ret); } diff --git a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch index 2483e1bb9..e008dd909 100644 --- a/target/linux/generic/pending-4.4/995-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.4/995-mangle_bootargs.patch @@ -1,6 +1,6 @@ --- a/init/main.c +++ b/init/main.c -@@ -355,6 +355,29 @@ static inline void setup_nr_cpu_ids(void +@@ -356,6 +356,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -30,7 +30,7 @@ /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -527,6 +550,7 @@ asmlinkage __visible void __init start_k +@@ -529,6 +552,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm); diff --git a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch index a985a7c95..bdf8c0d38 100644 --- a/target/linux/generic/pending-4.9/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-4.9/920-mangle_bootargs.patch @@ -31,7 +31,7 @@ Signed-off-by: Imre Kaloz help --- a/init/main.c +++ b/init/main.c -@@ -351,6 +351,29 @@ static inline void setup_nr_cpu_ids(void +@@ -352,6 +352,29 @@ static inline void setup_nr_cpu_ids(void static inline void smp_prepare_cpus(unsigned int maxcpus) { } #endif @@ -61,7 +61,7 @@ Signed-off-by: Imre Kaloz /* * We need to store the untouched command line for future reference. * We also need to store the touched command line since the parameter -@@ -503,6 +526,7 @@ asmlinkage __visible void __init start_k +@@ -505,6 +528,7 @@ asmlinkage __visible void __init start_k pr_notice("%s", linux_banner); setup_arch(&command_line); mm_init_cpumask(&init_mm); diff --git a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch index 467ffbf22..478dad786 100644 --- a/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch +++ b/target/linux/ipq806x/patches-4.9/0067-generic-Mangle-bootloader-s-kernel-arguments.patch @@ -157,7 +157,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -87,6 +87,10 @@ +@@ -88,6 +88,10 @@ #include #include @@ -168,7 +168,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -537,6 +541,18 @@ asmlinkage __visible void __init start_k +@@ -539,6 +543,18 @@ asmlinkage __visible void __init start_k page_alloc_init(); pr_notice("Kernel command line: %s\n", boot_command_line); diff --git a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch index c398a4734..fbee3d288 100644 --- a/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch +++ b/target/linux/mvebu/patches-4.4/030-mvneta-consolidate-autoneg-enabling.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1067,15 +1067,28 @@ static void mvneta_defaults_set(struct m +@@ -1071,15 +1071,28 @@ static void mvneta_defaults_set(struct m MVNETA_GMAC_AN_SPEED_EN | MVNETA_GMAC_AN_DUPLEX_EN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller } mvneta_set_ucast_table(pp, -1); -@@ -3228,9 +3241,6 @@ static int mvneta_port_power_up(struct m +@@ -3232,9 +3245,6 @@ static int mvneta_port_power_up(struct m return -EINVAL; } diff --git a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch index dc4a224b7..3154d7cfb 100644 --- a/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch +++ b/target/linux/mvebu/patches-4.4/031-mvneta-implement-ethtool-autonegotiation-control.patch @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; }; -@@ -973,6 +973,44 @@ static void mvneta_set_other_mcast_table +@@ -977,6 +977,44 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -77,7 +77,7 @@ Signed-off-by: David S. Miller /* This method sets defaults to the NETA port: * Clears interrupt Cause and Mask registers. * Clears all MAC tables. -@@ -1058,39 +1096,7 @@ static void mvneta_defaults_set(struct m +@@ -1062,39 +1100,7 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -118,7 +118,7 @@ Signed-off-by: David S. Miller mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2954,10 +2960,43 @@ int mvneta_ethtool_get_settings(struct n +@@ -2958,10 +2964,43 @@ int mvneta_ethtool_get_settings(struct n int mvneta_ethtool_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) { struct mvneta_port *pp = netdev_priv(dev); diff --git a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch index 83782a0b4..3be47abc8 100644 --- a/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch +++ b/target/linux/mvebu/patches-4.4/032-net-mvneta-Make-the-default-queue-related-for-each-p.patch @@ -28,7 +28,7 @@ Signed-off-by: David S. Miller } /* Stop the Ethernet port activity */ -@@ -1067,7 +1068,7 @@ static void mvneta_defaults_set(struct m +@@ -1071,7 +1072,7 @@ static void mvneta_defaults_set(struct m mvreg_write(pp, MVNETA_ACC_MODE, val); /* Update val of portCfg register accordingly with all RxQueue types */ @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_PORT_CONFIG, val); val = 0; -@@ -2101,19 +2102,19 @@ static void mvneta_set_rx_mode(struct ne +@@ -2105,19 +2106,19 @@ static void mvneta_set_rx_mode(struct ne if (dev->flags & IFF_PROMISC) { /* Accept all: Multicast + Unicast */ mvneta_rx_unicast_promisc_set(pp, 1); @@ -63,7 +63,7 @@ Signed-off-by: David S. Miller } else { /* Accept only initialized multicast */ mvneta_set_special_mcast_table(pp, -1); -@@ -2122,7 +2123,7 @@ static void mvneta_set_rx_mode(struct ne +@@ -2126,7 +2127,7 @@ static void mvneta_set_rx_mode(struct ne if (!netdev_mc_empty(dev)) { netdev_for_each_mc_addr(ha, dev) { mvneta_mcast_addr_set(pp, ha->addr, @@ -72,7 +72,7 @@ Signed-off-by: David S. Miller } } } -@@ -2205,7 +2206,7 @@ static int mvneta_poll(struct napi_struc +@@ -2209,7 +2210,7 @@ static int mvneta_poll(struct napi_struc * RX packets */ cause_rx_tx |= port->cause_rx_tx; @@ -81,7 +81,7 @@ Signed-off-by: David S. Miller budget -= rx_done; if (budget > 0) { -@@ -2418,17 +2419,17 @@ static void mvneta_cleanup_txqs(struct m +@@ -2422,17 +2423,17 @@ static void mvneta_cleanup_txqs(struct m /* Cleanup all Rx queues */ static void mvneta_cleanup_rxqs(struct mvneta_port *pp) { @@ -102,7 +102,7 @@ Signed-off-by: David S. Miller mvneta_cleanup_rxqs(pp); return err; } -@@ -2634,7 +2635,7 @@ static int mvneta_set_mac_addr(struct ne +@@ -2638,7 +2639,7 @@ static int mvneta_set_mac_addr(struct ne mvneta_mac_addr_set(pp, dev->dev_addr, -1); /* Set new addr in hw */ @@ -111,7 +111,7 @@ Signed-off-by: David S. Miller eth_commit_mac_addr_change(dev, addr); return 0; -@@ -2753,7 +2754,7 @@ static void mvneta_percpu_elect(struct m +@@ -2757,7 +2758,7 @@ static void mvneta_percpu_elect(struct m { int online_cpu_idx, cpu, i = 0; @@ -120,7 +120,7 @@ Signed-off-by: David S. Miller for_each_online_cpu(cpu) { if (i == online_cpu_idx) -@@ -3361,6 +3362,8 @@ static int mvneta_probe(struct platform_ +@@ -3365,6 +3366,8 @@ static int mvneta_probe(struct platform_ strcmp(managed, "in-band-status") == 0); pp->cpu_notifier.notifier_call = mvneta_percpu_notifier; diff --git a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch index 636c6cf36..a08d5fdcb 100644 --- a/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch +++ b/target/linux/mvebu/patches-4.4/033-net-mvneta-Associate-RX-queues-with-each-CPU.patch @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller } /* Stop the Ethernet port activity */ -@@ -1026,6 +1039,7 @@ static void mvneta_defaults_set(struct m +@@ -1030,6 +1043,7 @@ static void mvneta_defaults_set(struct m int cpu; int queue; u32 val; @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller /* Clear all Cause registers */ mvreg_write(pp, MVNETA_INTR_NEW_CAUSE, 0); -@@ -1041,13 +1055,23 @@ static void mvneta_defaults_set(struct m +@@ -1045,13 +1059,23 @@ static void mvneta_defaults_set(struct m /* Enable MBUS Retry bit16 */ mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20); @@ -85,7 +85,7 @@ Signed-off-by: David S. Miller /* Reset RX and TX DMAs */ mvreg_write(pp, MVNETA_PORT_RX_RESET, MVNETA_PORT_RX_DMA_RESET); -@@ -2174,6 +2198,7 @@ static int mvneta_poll(struct napi_struc +@@ -2178,6 +2202,7 @@ static int mvneta_poll(struct napi_struc { int rx_done = 0; u32 cause_rx_tx; @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller struct mvneta_port *pp = netdev_priv(napi->dev); struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); -@@ -2205,8 +2230,15 @@ static int mvneta_poll(struct napi_struc +@@ -2209,8 +2234,15 @@ static int mvneta_poll(struct napi_struc /* For the case where the last mvneta_poll did not process all * RX packets */ @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller budget -= rx_done; if (budget > 0) { -@@ -2419,19 +2451,27 @@ static void mvneta_cleanup_txqs(struct m +@@ -2423,19 +2455,27 @@ static void mvneta_cleanup_txqs(struct m /* Cleanup all Rx queues */ static void mvneta_cleanup_rxqs(struct mvneta_port *pp) { @@ -145,7 +145,7 @@ Signed-off-by: David S. Miller } return 0; -@@ -2455,6 +2495,19 @@ static int mvneta_setup_txqs(struct mvne +@@ -2459,6 +2499,19 @@ static int mvneta_setup_txqs(struct mvne return 0; } @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { unsigned int cpu; -@@ -2472,11 +2525,10 @@ static void mvneta_start_dev(struct mvne +@@ -2476,11 +2529,10 @@ static void mvneta_start_dev(struct mvne napi_enable(&port->napi); } @@ -181,7 +181,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2752,22 +2804,35 @@ static void mvneta_percpu_disable(void * +@@ -2756,22 +2808,35 @@ static void mvneta_percpu_disable(void * static void mvneta_percpu_elect(struct mvneta_port *pp) { @@ -227,7 +227,7 @@ Signed-off-by: David S. Miller } }; -@@ -2802,12 +2867,22 @@ static int mvneta_percpu_notifier(struct +@@ -2806,12 +2871,22 @@ static int mvneta_percpu_notifier(struct mvreg_write(pp, MVNETA_INTR_MISC_MASK, 0); napi_enable(&port->napi); @@ -251,7 +251,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_NEW_MASK, MVNETA_RX_INTR_MASK(rxq_number) | MVNETA_TX_INTR_MASK(txq_number) | -@@ -2858,7 +2933,7 @@ static int mvneta_percpu_notifier(struct +@@ -2862,7 +2937,7 @@ static int mvneta_percpu_notifier(struct static int mvneta_open(struct net_device *dev) { struct mvneta_port *pp = netdev_priv(dev); @@ -260,7 +260,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + -@@ -2888,8 +2963,13 @@ static int mvneta_open(struct net_device +@@ -2892,8 +2967,13 @@ static int mvneta_open(struct net_device */ mvneta_percpu_disable(pp); diff --git a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch index 9d729b50b..ee2c71b5e 100644 --- a/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch +++ b/target/linux/mvebu/patches-4.4/034-net-mvneta-Add-naive-RSS-support.patch @@ -34,7 +34,7 @@ Signed-off-by: David S. Miller }; /* The mvneta_tx_desc and mvneta_rx_desc structures describe the -@@ -1067,7 +1074,7 @@ static void mvneta_defaults_set(struct m +@@ -1071,7 +1078,7 @@ static void mvneta_defaults_set(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller txq_map = MVNETA_CPU_TXQ_ACCESS_ALL_MASK; mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map); -@@ -2508,6 +2515,18 @@ static void mvneta_percpu_unmask_interru +@@ -2512,6 +2519,18 @@ static void mvneta_percpu_unmask_interru MVNETA_MISCINTR_INTR_MASK); } @@ -62,7 +62,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { unsigned int cpu; -@@ -3229,6 +3248,106 @@ static int mvneta_ethtool_get_sset_count +@@ -3233,6 +3252,106 @@ static int mvneta_ethtool_get_sset_count return -EOPNOTSUPP; } @@ -169,7 +169,7 @@ Signed-off-by: David S. Miller static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3253,6 +3372,10 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3257,6 +3376,10 @@ const struct ethtool_ops mvneta_eth_tool .get_strings = mvneta_ethtool_get_strings, .get_ethtool_stats = mvneta_ethtool_get_stats, .get_sset_count = mvneta_ethtool_get_sset_count, @@ -180,7 +180,7 @@ Signed-off-by: David S. Miller }; /* Initialize hw */ -@@ -3444,6 +3567,8 @@ static int mvneta_probe(struct platform_ +@@ -3448,6 +3571,8 @@ static int mvneta_probe(struct platform_ pp->rxq_def = rxq_def; diff --git a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch index 5b35b6442..7389466b6 100644 --- a/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch +++ b/target/linux/mvebu/patches-4.4/035-net-mvneta-Configure-XPS-support.patch @@ -32,7 +32,7 @@ Signed-off-by: David S. Miller }; struct mvneta_rx_queue { -@@ -1062,20 +1066,30 @@ static void mvneta_defaults_set(struct m +@@ -1066,20 +1070,30 @@ static void mvneta_defaults_set(struct m /* Enable MBUS Retry bit16 */ mvreg_write(pp, MVNETA_MBUS_RETRY, 0x20); @@ -69,7 +69,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_CPU_MAP(cpu), rxq_map | txq_map); } -@@ -2362,6 +2376,8 @@ static void mvneta_rxq_deinit(struct mvn +@@ -2366,6 +2380,8 @@ static void mvneta_rxq_deinit(struct mvn static int mvneta_txq_init(struct mvneta_port *pp, struct mvneta_tx_queue *txq) { @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller txq->size = pp->tx_ring_size; /* A queue must always have room for at least one skb. -@@ -2414,6 +2430,14 @@ static int mvneta_txq_init(struct mvneta +@@ -2418,6 +2434,14 @@ static int mvneta_txq_init(struct mvneta } mvneta_tx_done_pkts_coal_set(pp, txq, txq->done_pkts_coal); @@ -93,7 +93,7 @@ Signed-off-by: David S. Miller return 0; } -@@ -2836,13 +2860,23 @@ static void mvneta_percpu_elect(struct m +@@ -2840,13 +2864,23 @@ static void mvneta_percpu_elect(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); diff --git a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch index d88336701..e79a11a4f 100644 --- a/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch +++ b/target/linux/mvebu/patches-4.4/036-net-mvneta-fix-trivial-cut-off-issue-in-mvneta_ethto.patch @@ -13,7 +13,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3240,26 +3240,25 @@ static void mvneta_ethtool_update_stats( +@@ -3244,26 +3244,25 @@ static void mvneta_ethtool_update_stats( const struct mvneta_statistic *s; void __iomem *base = pp->base; u32 high, low, val; diff --git a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch index 4fc9ccc76..3423307c1 100644 --- a/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch +++ b/target/linux/mvebu/patches-4.4/038-net-mvneta-Fix-the-CPU-choice-in-mvneta_percpu_elect.patch @@ -20,7 +20,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2847,9 +2847,14 @@ static void mvneta_percpu_disable(void * +@@ -2851,9 +2851,14 @@ static void mvneta_percpu_disable(void * static void mvneta_percpu_elect(struct mvneta_port *pp) { @@ -37,7 +37,7 @@ Signed-off-by: David S. Miller max_cpu = num_present_cpus(); for_each_online_cpu(cpu) { -@@ -2860,7 +2865,7 @@ static void mvneta_percpu_elect(struct m +@@ -2864,7 +2869,7 @@ static void mvneta_percpu_elect(struct m if ((rxq % max_cpu) == cpu) rxq_map |= MVNETA_CPU_RXQ_ACCESS(rxq); @@ -46,7 +46,7 @@ Signed-off-by: David S. Miller /* Map the default receive queue queue to the * elected CPU */ -@@ -2871,7 +2876,7 @@ static void mvneta_percpu_elect(struct m +@@ -2875,7 +2880,7 @@ static void mvneta_percpu_elect(struct m * the CPU bound to the default RX queue */ if (txq_number == 1) diff --git a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch index 76257a2a7..8d22df0f9 100644 --- a/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch +++ b/target/linux/mvebu/patches-4.4/039-net-mvneta-Use-on_each_cpu-when-possible.patch @@ -14,7 +14,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2553,7 +2553,7 @@ static void mvneta_percpu_mask_interrupt +@@ -2557,7 +2557,7 @@ static void mvneta_percpu_mask_interrupt static void mvneta_start_dev(struct mvneta_port *pp) { @@ -23,7 +23,7 @@ Signed-off-by: David S. Miller mvneta_max_rx_size_set(pp, pp->pkt_size); mvneta_txq_max_tx_size_set(pp, pp->pkt_size); -@@ -2569,9 +2569,8 @@ static void mvneta_start_dev(struct mvne +@@ -2573,9 +2573,8 @@ static void mvneta_start_dev(struct mvne } /* Unmask interrupts. It has to be done from each CPU */ @@ -35,7 +35,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2991,7 +2990,7 @@ static int mvneta_percpu_notifier(struct +@@ -2995,7 +2994,7 @@ static int mvneta_percpu_notifier(struct static int mvneta_open(struct net_device *dev) { struct mvneta_port *pp = netdev_priv(dev); @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(pp->dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + -@@ -3024,9 +3023,7 @@ static int mvneta_open(struct net_device +@@ -3028,9 +3027,7 @@ static int mvneta_open(struct net_device /* Enable per-CPU interrupt on all the CPU to handle our RX * queue interrupts */ @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller /* Register a CPU notifier to handle the case where our CPU -@@ -3313,9 +3310,7 @@ static int mvneta_config_rss(struct mvn +@@ -3317,9 +3314,7 @@ static int mvneta_config_rss(struct mvn netif_tx_stop_all_queues(pp->dev); diff --git a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch index b025777df..acb6c94bb 100644 --- a/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch +++ b/target/linux/mvebu/patches-4.4/040-net-mvneta-Modify-the-queue-related-fields-from-each.patch @@ -17,7 +17,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -1036,6 +1036,43 @@ static void mvneta_set_autoneg(struct mv +@@ -1040,6 +1040,43 @@ static void mvneta_set_autoneg(struct mv } } @@ -61,7 +61,7 @@ Signed-off-by: David S. Miller /* This method sets defaults to the NETA port: * Clears interrupt Cause and Mask registers. * Clears all MAC tables. -@@ -1053,14 +1090,10 @@ static void mvneta_defaults_set(struct m +@@ -1057,14 +1094,10 @@ static void mvneta_defaults_set(struct m int max_cpu = num_present_cpus(); /* Clear all Cause registers */ @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_ENABLE, 0); /* Enable MBUS Retry bit16 */ -@@ -2526,31 +2559,6 @@ static int mvneta_setup_txqs(struct mvne +@@ -2530,31 +2563,6 @@ static int mvneta_setup_txqs(struct mvne return 0; } @@ -110,7 +110,7 @@ Signed-off-by: David S. Miller static void mvneta_start_dev(struct mvneta_port *pp) { int cpu; -@@ -2601,13 +2609,10 @@ static void mvneta_stop_dev(struct mvnet +@@ -2605,13 +2613,10 @@ static void mvneta_stop_dev(struct mvnet mvneta_port_disable(pp); /* Clear all ethernet port interrupts */ @@ -126,7 +126,7 @@ Signed-off-by: David S. Miller mvneta_tx_reset(pp); mvneta_rx_reset(pp); -@@ -2919,9 +2924,7 @@ static int mvneta_percpu_notifier(struct +@@ -2923,9 +2928,7 @@ static int mvneta_percpu_notifier(struct } /* Mask all ethernet port interrupts */ @@ -137,7 +137,7 @@ Signed-off-by: David S. Miller napi_enable(&port->napi); -@@ -2936,14 +2939,8 @@ static int mvneta_percpu_notifier(struct +@@ -2940,14 +2943,8 @@ static int mvneta_percpu_notifier(struct */ mvneta_percpu_elect(pp); @@ -154,7 +154,7 @@ Signed-off-by: David S. Miller mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | MVNETA_CAUSE_LINK_CHANGE | -@@ -2954,9 +2951,7 @@ static int mvneta_percpu_notifier(struct +@@ -2958,9 +2955,7 @@ static int mvneta_percpu_notifier(struct case CPU_DOWN_PREPARE_FROZEN: netif_tx_stop_all_queues(pp->dev); /* Mask all ethernet port interrupts */ @@ -165,7 +165,7 @@ Signed-off-by: David S. Miller napi_synchronize(&port->napi); napi_disable(&port->napi); -@@ -2972,10 +2967,7 @@ static int mvneta_percpu_notifier(struct +@@ -2976,10 +2971,7 @@ static int mvneta_percpu_notifier(struct /* Check if a new CPU must be elected now this on is down */ mvneta_percpu_elect(pp); /* Unmask all ethernet port interrupts */ diff --git a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch index a77bef44e..1d3d6aaf1 100644 --- a/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch +++ b/target/linux/mvebu/patches-4.4/041-net-mvneta-The-mvneta_percpu_elect-function-should-b.patch @@ -31,7 +31,7 @@ Signed-off-by: David S. Miller /* Core clock */ struct clk *clk; -@@ -2853,6 +2857,12 @@ static void mvneta_percpu_elect(struct m +@@ -2857,6 +2861,12 @@ static void mvneta_percpu_elect(struct m { int elected_cpu = 0, max_cpu, cpu, i = 0; @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller /* Use the cpu associated to the rxq when it is online, in all * the other cases, use the cpu 0 which can't be offline. */ -@@ -2896,6 +2906,7 @@ static void mvneta_percpu_elect(struct m +@@ -2900,6 +2910,7 @@ static void mvneta_percpu_elect(struct m i++; } @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller }; static int mvneta_percpu_notifier(struct notifier_block *nfb, -@@ -2950,8 +2961,13 @@ static int mvneta_percpu_notifier(struct +@@ -2954,8 +2965,13 @@ static int mvneta_percpu_notifier(struct case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE_FROZEN: netif_tx_stop_all_queues(pp->dev); diff --git a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch index 9936ebf32..878229cbf 100644 --- a/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch +++ b/target/linux/mvebu/patches-4.4/042-net-mvneta-Fix-race-condition-during-stopping.patch @@ -26,7 +26,7 @@ Signed-off-by: David S. Miller /* Core clock */ struct clk *clk; -@@ -2853,16 +2854,14 @@ static void mvneta_percpu_disable(void * +@@ -2857,16 +2858,14 @@ static void mvneta_percpu_disable(void * disable_percpu_irq(pp->dev->irq); } @@ -47,7 +47,7 @@ Signed-off-by: David S. Miller /* Use the cpu associated to the rxq when it is online, in all * the other cases, use the cpu 0 which can't be offline. */ -@@ -2906,7 +2905,6 @@ static void mvneta_percpu_elect(struct m +@@ -2910,7 +2909,6 @@ static void mvneta_percpu_elect(struct m i++; } @@ -55,7 +55,7 @@ Signed-off-by: David S. Miller }; static int mvneta_percpu_notifier(struct notifier_block *nfb, -@@ -2920,6 +2918,14 @@ static int mvneta_percpu_notifier(struct +@@ -2924,6 +2922,14 @@ static int mvneta_percpu_notifier(struct switch (action) { case CPU_ONLINE: case CPU_ONLINE_FROZEN: @@ -70,7 +70,7 @@ Signed-off-by: David S. Miller netif_tx_stop_all_queues(pp->dev); /* We have to synchronise on tha napi of each CPU -@@ -2957,6 +2963,7 @@ static int mvneta_percpu_notifier(struct +@@ -2961,6 +2967,7 @@ static int mvneta_percpu_notifier(struct MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); netif_tx_start_all_queues(pp->dev); @@ -78,7 +78,7 @@ Signed-off-by: David S. Miller break; case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE_FROZEN: -@@ -2981,7 +2988,9 @@ static int mvneta_percpu_notifier(struct +@@ -2985,7 +2992,9 @@ static int mvneta_percpu_notifier(struct case CPU_DEAD: case CPU_DEAD_FROZEN: /* Check if a new CPU must be elected now this on is down */ @@ -88,7 +88,7 @@ Signed-off-by: David S. Miller /* Unmask all ethernet port interrupts */ on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, -@@ -3033,7 +3042,7 @@ static int mvneta_open(struct net_device +@@ -3037,7 +3046,7 @@ static int mvneta_open(struct net_device */ on_each_cpu(mvneta_percpu_enable, pp, true); @@ -97,7 +97,7 @@ Signed-off-by: David S. Miller /* Register a CPU notifier to handle the case where our CPU * might be taken offline. */ -@@ -3066,9 +3075,18 @@ static int mvneta_stop(struct net_device +@@ -3070,9 +3079,18 @@ static int mvneta_stop(struct net_device { struct mvneta_port *pp = netdev_priv(dev); @@ -116,7 +116,7 @@ Signed-off-by: David S. Miller on_each_cpu(mvneta_percpu_disable, pp, true); free_percpu_irq(dev->irq, pp->ports); mvneta_cleanup_rxqs(pp); -@@ -3339,7 +3357,9 @@ static int mvneta_config_rss(struct mvn +@@ -3343,7 +3361,9 @@ static int mvneta_config_rss(struct mvn mvreg_write(pp, MVNETA_PORT_CONFIG, val); /* Update the elected CPU matching the new rxq_def */ diff --git a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch index d343b3983..a1b5ca8c6 100644 --- a/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch +++ b/target/linux/mvebu/patches-4.4/045-net-mvneta-bm-add-support-for-hardware-buffer-manage.patch @@ -495,7 +495,7 @@ Signed-off-by: David S. Miller /* Start the Ethernet port RX and TX activity */ static void mvneta_port_up(struct mvneta_port *pp) { -@@ -1147,9 +1379,17 @@ static void mvneta_defaults_set(struct m +@@ -1151,9 +1383,17 @@ static void mvneta_defaults_set(struct m mvreg_write(pp, MVNETA_PORT_RX_RESET, 0); /* Set Port Acceleration Mode */ @@ -514,7 +514,7 @@ Signed-off-by: David S. Miller /* Update val of portCfg register accordingly with all RxQueue types */ val = MVNETA_PORT_CONFIG_DEFL_VALUE(pp->rxq_def); mvreg_write(pp, MVNETA_PORT_CONFIG, val); -@@ -1516,23 +1756,25 @@ static void mvneta_txq_done(struct mvnet +@@ -1520,23 +1760,25 @@ static void mvneta_txq_done(struct mvnet } } @@ -547,7 +547,7 @@ Signed-off-by: David S. Miller static int mvneta_rx_refill(struct mvneta_port *pp, struct mvneta_rx_desc *rx_desc) -@@ -1540,7 +1782,7 @@ static int mvneta_rx_refill(struct mvnet +@@ -1544,7 +1786,7 @@ static int mvneta_rx_refill(struct mvnet dma_addr_t phys_addr; void *data; @@ -556,7 +556,7 @@ Signed-off-by: David S. Miller if (!data) return -ENOMEM; -@@ -1548,7 +1790,7 @@ static int mvneta_rx_refill(struct mvnet +@@ -1552,7 +1794,7 @@ static int mvneta_rx_refill(struct mvnet MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE); if (unlikely(dma_mapping_error(pp->dev->dev.parent, phys_addr))) { @@ -565,7 +565,7 @@ Signed-off-by: David S. Miller return -ENOMEM; } -@@ -1594,22 +1836,156 @@ static void mvneta_rxq_drop_pkts(struct +@@ -1598,22 +1840,156 @@ static void mvneta_rxq_drop_pkts(struct int rx_done, i; rx_done = mvneta_rxq_busy_desc_num_get(pp, rxq); @@ -728,7 +728,7 @@ Signed-off-by: David S. Miller { struct mvneta_pcpu_port *port = this_cpu_ptr(pp->ports); struct net_device *dev = pp->dev; -@@ -1628,21 +2004,29 @@ static int mvneta_rx(struct mvneta_port +@@ -1632,21 +2008,29 @@ static int mvneta_rx(struct mvneta_port /* Fairness NAPI loop */ while (rx_done < rx_todo) { struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq); @@ -760,7 +760,7 @@ Signed-off-by: David S. Miller dev->stats.rx_errors++; mvneta_rx_error(pp, rx_desc); /* leave the descriptor untouched */ -@@ -1653,7 +2037,7 @@ static int mvneta_rx(struct mvneta_port +@@ -1657,7 +2041,7 @@ static int mvneta_rx(struct mvneta_port /* better copy a small frame and not unmap the DMA region */ skb = netdev_alloc_skb_ip_align(dev, rx_bytes); if (unlikely(!skb)) @@ -769,7 +769,7 @@ Signed-off-by: David S. Miller dma_sync_single_range_for_cpu(dev->dev.parent, rx_desc->buf_phys_addr, -@@ -1671,26 +2055,31 @@ static int mvneta_rx(struct mvneta_port +@@ -1675,26 +2059,31 @@ static int mvneta_rx(struct mvneta_port rcvd_pkts++; rcvd_bytes += rx_bytes; @@ -807,7 +807,7 @@ Signed-off-by: David S. Miller if (!skb) goto err_drop_frame; -@@ -2295,7 +2684,10 @@ static int mvneta_poll(struct napi_struc +@@ -2299,7 +2688,10 @@ static int mvneta_poll(struct napi_struc if (rx_queue) { rx_queue = rx_queue - 1; @@ -819,7 +819,7 @@ Signed-off-by: David S. Miller } budget -= rx_done; -@@ -2384,9 +2776,17 @@ static int mvneta_rxq_init(struct mvneta +@@ -2388,9 +2780,17 @@ static int mvneta_rxq_init(struct mvneta mvneta_rx_pkts_coal_set(pp, rxq, rxq->pkts_coal); mvneta_rx_time_coal_set(pp, rxq, rxq->time_coal); @@ -840,7 +840,7 @@ Signed-off-by: David S. Miller mvneta_rxq_fill(pp, rxq, rxq->size); return 0; -@@ -2659,6 +3059,9 @@ static int mvneta_change_mtu(struct net_ +@@ -2663,6 +3063,9 @@ static int mvneta_change_mtu(struct net_ dev->mtu = mtu; if (!netif_running(dev)) { @@ -850,7 +850,7 @@ Signed-off-by: David S. Miller netdev_update_features(dev); return 0; } -@@ -2671,6 +3074,9 @@ static int mvneta_change_mtu(struct net_ +@@ -2675,6 +3078,9 @@ static int mvneta_change_mtu(struct net_ mvneta_cleanup_txqs(pp); mvneta_cleanup_rxqs(pp); @@ -860,7 +860,7 @@ Signed-off-by: David S. Miller pp->pkt_size = MVNETA_RX_PKT_SIZE(dev->mtu); pp->frag_size = SKB_DATA_ALIGN(MVNETA_RX_BUF_SIZE(pp->pkt_size)) + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); -@@ -3563,6 +3969,7 @@ static int mvneta_probe(struct platform_ +@@ -3567,6 +3973,7 @@ static int mvneta_probe(struct platform_ struct resource *res; struct device_node *dn = pdev->dev.of_node; struct device_node *phy_node; @@ -868,7 +868,7 @@ Signed-off-by: David S. Miller struct mvneta_port *pp; struct net_device *dev; const char *dt_mac_addr; -@@ -3690,26 +4097,39 @@ static int mvneta_probe(struct platform_ +@@ -3694,26 +4101,39 @@ static int mvneta_probe(struct platform_ pp->tx_csum_limit = tx_csum_limit; @@ -914,7 +914,7 @@ Signed-off-by: David S. Miller for_each_present_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3744,6 +4164,13 @@ static int mvneta_probe(struct platform_ +@@ -3748,6 +4168,13 @@ static int mvneta_probe(struct platform_ return 0; @@ -928,7 +928,7 @@ Signed-off-by: David S. Miller err_free_stats: free_percpu(pp->stats); err_free_ports: -@@ -3773,6 +4200,12 @@ static int mvneta_remove(struct platform +@@ -3777,6 +4204,12 @@ static int mvneta_remove(struct platform of_node_put(pp->phy_node); free_netdev(dev); diff --git a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch index 210504c39..fb9859c5d 100644 --- a/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch +++ b/target/linux/mvebu/patches-4.4/046-net-mvneta-Use-the-new-hwbm-framework.patch @@ -64,7 +64,7 @@ Signed-off-by: David S. Miller goto bm_mtu_err; } mvneta_bm_pool_bufsize_set(pp, bm_pool->buf_size, bm_pool->id); -@@ -2064,14 +2066,14 @@ err_drop_frame: +@@ -2068,14 +2070,14 @@ err_drop_frame: } /* Refill processing */ diff --git a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch index a8e78df2e..7058686c2 100644 --- a/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch +++ b/target/linux/mvebu/patches-4.4/047-net-mvneta-Fix-spinlock-usage.patch @@ -19,7 +19,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3484,17 +3484,17 @@ static int mvneta_stop(struct net_device +@@ -3488,17 +3488,17 @@ static int mvneta_stop(struct net_device struct mvneta_port *pp = netdev_priv(dev); /* Inform that we are stopping so we don't want to setup the @@ -42,7 +42,7 @@ Signed-off-by: David S. Miller on_each_cpu(mvneta_percpu_disable, pp, true); free_percpu_irq(dev->irq, pp->ports); mvneta_cleanup_rxqs(pp); -@@ -4027,6 +4027,7 @@ static int mvneta_probe(struct platform_ +@@ -4031,6 +4031,7 @@ static int mvneta_probe(struct platform_ dev->ethtool_ops = &mvneta_eth_tool_ops; pp = netdev_priv(dev); diff --git a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch index c12d98a4e..4b319e26a 100644 --- a/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch +++ b/target/linux/mvebu/patches-4.4/049-net-mvneta-replace-MVNETA_CPU_D_CACHE_LINE_SIZE-with.patch @@ -33,7 +33,7 @@ Signed-off-by: David S. Miller #define IS_TSO_HEADER(txq, addr) \ ((addr >= txq->tso_hdrs_phys) && \ -@@ -2762,9 +2761,6 @@ static int mvneta_rxq_init(struct mvneta +@@ -2766,9 +2765,6 @@ static int mvneta_rxq_init(struct mvneta if (rxq->descs == NULL) return -ENOMEM; @@ -43,7 +43,7 @@ Signed-off-by: David S. Miller rxq->last_desc = rxq->size - 1; /* Set Rx descriptors queue starting address */ -@@ -2835,10 +2831,6 @@ static int mvneta_txq_init(struct mvneta +@@ -2839,10 +2835,6 @@ static int mvneta_txq_init(struct mvneta if (txq->descs == NULL) return -ENOMEM; diff --git a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch index 07862008a..fdc566351 100644 --- a/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch +++ b/target/linux/mvebu/patches-4.4/050-net-mvneta-fix-changing-MTU-when-using-per-cpu-proce.patch @@ -15,7 +15,7 @@ Signed-off-by: David S. Miller --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3040,6 +3040,20 @@ static int mvneta_check_mtu_valid(struct +@@ -3044,6 +3044,20 @@ static int mvneta_check_mtu_valid(struct return mtu; } @@ -36,7 +36,7 @@ Signed-off-by: David S. Miller /* Change the device mtu */ static int mvneta_change_mtu(struct net_device *dev, int mtu) { -@@ -3064,6 +3078,7 @@ static int mvneta_change_mtu(struct net_ +@@ -3068,6 +3082,7 @@ static int mvneta_change_mtu(struct net_ * reallocation of the queues */ mvneta_stop_dev(pp); @@ -44,7 +44,7 @@ Signed-off-by: David S. Miller mvneta_cleanup_txqs(pp); mvneta_cleanup_rxqs(pp); -@@ -3087,6 +3102,7 @@ static int mvneta_change_mtu(struct net_ +@@ -3091,6 +3106,7 @@ static int mvneta_change_mtu(struct net_ return ret; } @@ -52,7 +52,7 @@ Signed-off-by: David S. Miller mvneta_start_dev(pp); mvneta_port_up(pp); -@@ -3240,20 +3256,6 @@ static void mvneta_mdio_remove(struct mv +@@ -3244,20 +3260,6 @@ static void mvneta_mdio_remove(struct mv pp->phy_dev = NULL; } diff --git a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch index fac283f3e..3bfaf1582 100644 --- a/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch +++ b/target/linux/mvebu/patches-4.4/134-net-mvneta-convert-to-phylink.patch @@ -79,7 +79,18 @@ Signed-off-by: Russell King struct mvneta_bm *bm_priv; struct mvneta_bm_pool *pool_long; -@@ -1236,44 +1238,6 @@ static void mvneta_set_other_mcast_table +@@ -1177,10 +1179,6 @@ static void mvneta_port_disable(struct m + val &= ~MVNETA_GMAC0_PORT_ENABLE; + mvreg_write(pp, MVNETA_GMAC_CTRL_0, val); + +- pp->link = 0; +- pp->duplex = -1; +- pp->speed = 0; +- + udelay(200); + } + +@@ -1240,44 +1238,6 @@ static void mvneta_set_other_mcast_table mvreg_write(pp, MVNETA_DA_FILT_OTH_MCAST + offset, val); } @@ -124,7 +135,7 @@ Signed-off-by: Russell King static void mvneta_percpu_unmask_interrupt(void *arg) { struct mvneta_port *pp = arg; -@@ -1421,7 +1385,6 @@ static void mvneta_defaults_set(struct m +@@ -1425,7 +1385,6 @@ static void mvneta_defaults_set(struct m val &= ~MVNETA_PHY_POLLING_ENABLE; mvreg_write(pp, MVNETA_UNIT_CONTROL, val); @@ -132,7 +143,7 @@ Signed-off-by: Russell King mvneta_set_ucast_table(pp, -1); mvneta_set_special_mcast_table(pp, -1); mvneta_set_other_mcast_table(pp, -1); -@@ -2614,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v +@@ -2618,26 +2577,11 @@ static irqreturn_t mvneta_isr(int irq, v return IRQ_HANDLED; } @@ -161,7 +172,7 @@ Signed-off-by: Russell King } /* NAPI handler -@@ -2662,12 +2610,11 @@ static int mvneta_poll(struct napi_struc +@@ -2666,12 +2610,11 @@ static int mvneta_poll(struct napi_struc u32 cause_misc = mvreg_read(pp, MVNETA_INTR_MISC_CAUSE); mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); @@ -179,7 +190,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2983,7 +2930,7 @@ static void mvneta_start_dev(struct mvne +@@ -2987,7 +2930,7 @@ static void mvneta_start_dev(struct mvne MVNETA_CAUSE_LINK_CHANGE | MVNETA_CAUSE_PSC_SYNC_CHANGE); @@ -188,7 +199,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); } -@@ -2991,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet +@@ -2995,7 +2938,7 @@ static void mvneta_stop_dev(struct mvnet { unsigned int cpu; @@ -197,7 +208,7 @@ Signed-off-by: Russell King for_each_online_cpu(cpu) { struct mvneta_pcpu_port *port = per_cpu_ptr(pp->ports, cpu); -@@ -3161,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne +@@ -3165,99 +3108,219 @@ static int mvneta_set_mac_addr(struct ne return 0; } @@ -438,13 +449,6 @@ Signed-off-by: Russell King - struct phy_device *phy_dev; + struct mvneta_port *pp = netdev_priv(ndev); + u32 val; -+ -+ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) { -+ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); -+ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN; -+ val |= MVNETA_GMAC_FORCE_LINK_PASS; -+ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); -+ } - phy_dev = of_phy_connect(pp->dev, pp->phy_node, mvneta_adjust_link, 0, - pp->phy_interface); @@ -460,10 +464,17 @@ Signed-off-by: Russell King - pp->link = 0; - pp->duplex = 0; - pp->speed = 0; -+ mvneta_port_up(pp); -+} ++ if (mode == MLO_AN_PHY || mode == MLO_AN_FIXED) { ++ val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG); ++ val &= ~MVNETA_GMAC_FORCE_LINK_DOWN; ++ val |= MVNETA_GMAC_FORCE_LINK_PASS; ++ mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); ++ } - return 0; ++ mvneta_port_up(pp); ++} ++ +static const struct phylink_mac_ops mvneta_phylink_ops = { + .mac_get_support = mvneta_mac_support, + .mac_link_state = mvneta_mac_link_state, @@ -490,7 +501,7 @@ Signed-off-by: Russell King } /* Electing a CPU must be done in an atomic way: it should be done -@@ -3501,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic +@@ -3505,10 +3568,7 @@ static int mvneta_ioctl(struct net_devic { struct mvneta_port *pp = netdev_priv(dev); @@ -502,7 +513,7 @@ Signed-off-by: Russell King } /* Ethtool methods */ -@@ -3514,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n +@@ -3518,54 +3578,15 @@ int mvneta_ethtool_get_settings(struct n { struct mvneta_port *pp = netdev_priv(dev); @@ -559,7 +570,7 @@ Signed-off-by: Russell King } /* Set interrupt coalescing for ethtools */ -@@ -3669,7 +3694,8 @@ static void mvneta_ethtool_update_stats( +@@ -3673,7 +3694,8 @@ static void mvneta_ethtool_update_stats( { const struct mvneta_statistic *s; void __iomem *base = pp->base; @@ -569,7 +580,7 @@ Signed-off-by: Russell King u64 val64; int i; -@@ -3964,14 +3990,13 @@ static int mvneta_probe(struct platform_ +@@ -3968,14 +3990,13 @@ static int mvneta_probe(struct platform_ const struct mbus_dram_target_info *dram_target_info; struct resource *res; struct device_node *dn = pdev->dev.of_node; @@ -585,7 +596,7 @@ Signed-off-by: Russell King int tx_csum_limit; int phy_mode; int err; -@@ -3987,31 +4012,11 @@ static int mvneta_probe(struct platform_ +@@ -3991,31 +4012,11 @@ static int mvneta_probe(struct platform_ goto err_free_netdev; } @@ -618,7 +629,7 @@ Signed-off-by: Russell King } dev->tx_queue_len = MVNETA_MAX_TXD; -@@ -4022,12 +4027,7 @@ static int mvneta_probe(struct platform_ +@@ -4026,12 +4027,7 @@ static int mvneta_probe(struct platform_ pp = netdev_priv(dev); spin_lock_init(&pp->lock); @@ -632,7 +643,7 @@ Signed-off-by: Russell King pp->cpu_notifier.notifier_call = mvneta_percpu_notifier; pp->rxq_def = rxq_def; -@@ -4037,7 +4037,7 @@ static int mvneta_probe(struct platform_ +@@ -4041,7 +4037,7 @@ static int mvneta_probe(struct platform_ pp->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pp->clk)) { err = PTR_ERR(pp->clk); @@ -641,7 +652,7 @@ Signed-off-by: Russell King } clk_prepare_enable(pp->clk); -@@ -4140,6 +4140,14 @@ static int mvneta_probe(struct platform_ +@@ -4144,6 +4140,14 @@ static int mvneta_probe(struct platform_ dev->priv_flags |= IFF_UNICAST_FLT | IFF_LIVE_ADDR_CHANGE; dev->gso_max_segs = MVNETA_MAX_TSO_SEGS; @@ -656,7 +667,7 @@ Signed-off-by: Russell King err = register_netdev(dev); if (err < 0) { dev_err(&pdev->dev, "failed to register\n"); -@@ -4151,13 +4159,6 @@ static int mvneta_probe(struct platform_ +@@ -4155,13 +4159,6 @@ static int mvneta_probe(struct platform_ platform_set_drvdata(pdev, pp->dev); @@ -670,7 +681,7 @@ Signed-off-by: Russell King return 0; -@@ -4169,13 +4170,13 @@ err_netdev: +@@ -4173,13 +4170,13 @@ err_netdev: 1 << pp->id); } err_free_stats: @@ -686,7 +697,7 @@ Signed-off-by: Russell King err_free_irq: irq_dispose_mapping(dev->irq); err_free_netdev: -@@ -4194,7 +4195,7 @@ static int mvneta_remove(struct platform +@@ -4198,7 +4195,7 @@ static int mvneta_remove(struct platform free_percpu(pp->ports); free_percpu(pp->stats); irq_dispose_mapping(dev->irq); diff --git a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch index f6e6df3de..6d35b5005 100644 --- a/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch +++ b/target/linux/mvebu/patches-4.9/420-net-mvneta-disable-MVNETA_CAUSE_PSC_SYNC_CHANGE-inte.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -2634,9 +2634,11 @@ static int mvneta_poll(struct napi_struc +@@ -2630,9 +2630,11 @@ static int mvneta_poll(struct napi_struc mvreg_write(pp, MVNETA_INTR_MISC_CAUSE, 0); if (cause_misc & (MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -26,7 +26,7 @@ Signed-off-by: Russell King } /* Release Tx descriptors */ -@@ -2951,8 +2953,7 @@ static void mvneta_start_dev(struct mvne +@@ -2947,8 +2949,7 @@ static void mvneta_start_dev(struct mvne mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -36,7 +36,7 @@ Signed-off-by: Russell King phylink_start(pp->phylink); netif_tx_start_all_queues(pp->dev); -@@ -3443,8 +3444,7 @@ static int mvneta_cpu_online(unsigned in +@@ -3439,8 +3440,7 @@ static int mvneta_cpu_online(unsigned in on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | @@ -46,7 +46,7 @@ Signed-off-by: Russell King netif_tx_start_all_queues(pp->dev); spin_unlock(&pp->lock); return 0; -@@ -3485,8 +3485,7 @@ static int mvneta_cpu_dead(unsigned int +@@ -3481,8 +3481,7 @@ static int mvneta_cpu_dead(unsigned int on_each_cpu(mvneta_percpu_unmask_interrupt, pp, true); mvreg_write(pp, MVNETA_INTR_MISC_MASK, MVNETA_CAUSE_PHY_STATUS_CHANGE | diff --git a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch index d2bbb26ab..20c23ba2a 100644 --- a/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch +++ b/target/linux/mvebu/patches-4.9/422-net-mvneta-add-nway_reset-support.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3619,6 +3619,13 @@ mvneta_ethtool_get_link_ksettings(struct +@@ -3615,6 +3615,13 @@ mvneta_ethtool_get_link_ksettings(struct return phylink_ethtool_ksettings_get(pp->phylink, cmd); } @@ -25,7 +25,7 @@ Signed-off-by: Russell King /* Set interrupt coalescing for ethtools */ static int mvneta_ethtool_set_coalesce(struct net_device *dev, struct ethtool_coalesce *c) -@@ -3892,6 +3899,7 @@ static const struct net_device_ops mvnet +@@ -3888,6 +3895,7 @@ static const struct net_device_ops mvnet }; const struct ethtool_ops mvneta_eth_tool_ops = { diff --git a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch index cb4cebe0e..3f778953e 100644 --- a/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch +++ b/target/linux/mvebu/patches-4.9/424-net-mvneta-add-flow-control-support-via-phylink.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3183,6 +3183,12 @@ static int mvneta_mac_link_state(struct +@@ -3179,6 +3179,12 @@ static int mvneta_mac_link_state(struct state->link = !!(gmac_stat & MVNETA_GMAC_LINK_UP); state->duplex = !!(gmac_stat & MVNETA_GMAC_FULL_DUPLEX); @@ -24,7 +24,7 @@ Signed-off-by: Russell King return 1; } -@@ -3225,6 +3231,8 @@ static void mvneta_mac_config(struct net +@@ -3221,6 +3227,8 @@ static void mvneta_mac_config(struct net if (phylink_test(state->advertising, Pause)) new_an |= MVNETA_GMAC_ADVERT_SYM_FLOW_CTRL; @@ -33,7 +33,7 @@ Signed-off-by: Russell King switch (mode) { case MLO_AN_SGMII: -@@ -3249,7 +3257,7 @@ static void mvneta_mac_config(struct net +@@ -3245,7 +3253,7 @@ static void mvneta_mac_config(struct net /* The MAC only supports FD mode */ MVNETA_GMAC_CONFIG_FULL_DUPLEX; @@ -42,7 +42,7 @@ Signed-off-by: Russell King new_an |= MVNETA_GMAC_AN_FLOW_CTRL_EN; break; -@@ -3715,6 +3723,22 @@ static int mvneta_ethtool_set_ringparam( +@@ -3711,6 +3719,22 @@ static int mvneta_ethtool_set_ringparam( return 0; } @@ -65,7 +65,7 @@ Signed-off-by: Russell King static void mvneta_ethtool_get_strings(struct net_device *netdev, u32 sset, u8 *data) { -@@ -3906,6 +3930,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3902,6 +3926,8 @@ const struct ethtool_ops mvneta_eth_tool .get_drvinfo = mvneta_ethtool_get_drvinfo, .get_ringparam = mvneta_ethtool_get_ringparam, .set_ringparam = mvneta_ethtool_set_ringparam, diff --git a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch index 3c2511d26..f2d14afda 100644 --- a/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch +++ b/target/linux/mvebu/patches-4.9/425-net-mvneta-enable-flow-control-for-PHY-connections.patch @@ -12,7 +12,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3157,10 +3157,11 @@ static void mvneta_validate_support(stru +@@ -3153,10 +3153,11 @@ static void mvneta_validate_support(stru phylink_set(mask, 10baseT_Full); phylink_set(mask, 100baseT_Half); phylink_set(mask, 100baseT_Full); diff --git a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch index 8bd6cec5c..bac74ca4e 100644 --- a/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch +++ b/target/linux/mvebu/patches-4.9/426-net-mvneta-enable-flow-control-for-fixed-connections.patch @@ -11,7 +11,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3147,6 +3147,8 @@ static void mvneta_validate_support(stru +@@ -3143,6 +3143,8 @@ static void mvneta_validate_support(stru phylink_set(mask, BNC); phylink_set(mask, Backplane); @@ -20,7 +20,7 @@ Signed-off-by: Russell King /* Half-duplex at speeds higher than 100Mbit is unsupported */ phylink_set(mask, 1000baseT_Full); phylink_set(mask, 1000baseX_Full); -@@ -3159,9 +3161,6 @@ static void mvneta_validate_support(stru +@@ -3155,9 +3157,6 @@ static void mvneta_validate_support(stru phylink_set(mask, 100baseT_Full); } diff --git a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch index 8451e1ef1..bc7e5eeeb 100644 --- a/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/427-phylink-add-EEE-support.patch @@ -10,7 +10,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3309,7 +3309,8 @@ static void mvneta_mac_link_down(struct +@@ -3305,7 +3305,8 @@ static void mvneta_mac_link_down(struct } } diff --git a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch index 9cffde54d..3a20a06be 100644 --- a/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch +++ b/target/linux/mvebu/patches-4.9/428-net-mvneta-add-EEE-support.patch @@ -65,7 +65,7 @@ Signed-off-by: Russell King u64 ethtool_stats[ARRAY_SIZE(mvneta_statistics)]; u32 indir[MVNETA_RSS_LU_TABLE_SIZE]; -@@ -3294,6 +3311,18 @@ static void mvneta_mac_config(struct net +@@ -3290,6 +3307,18 @@ static void mvneta_mac_config(struct net mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, new_an); } @@ -84,7 +84,7 @@ Signed-off-by: Russell King static void mvneta_mac_link_down(struct net_device *ndev, unsigned int mode) { struct mvneta_port *pp = netdev_priv(ndev); -@@ -3307,6 +3336,9 @@ static void mvneta_mac_link_down(struct +@@ -3303,6 +3332,9 @@ static void mvneta_mac_link_down(struct val |= MVNETA_GMAC_FORCE_LINK_DOWN; mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val); } @@ -94,7 +94,7 @@ Signed-off-by: Russell King } static void mvneta_mac_link_up(struct net_device *ndev, unsigned int mode, -@@ -3323,6 +3355,11 @@ static void mvneta_mac_link_up(struct ne +@@ -3319,6 +3351,11 @@ static void mvneta_mac_link_up(struct ne } mvneta_port_up(pp); @@ -106,7 +106,7 @@ Signed-off-by: Russell King } static const struct phylink_mac_ops mvneta_phylink_ops = { -@@ -3775,6 +3812,13 @@ static void mvneta_ethtool_update_stats( +@@ -3771,6 +3808,13 @@ static void mvneta_ethtool_update_stats( high = readl_relaxed(base + s->offset + 4); val = (u64)high << 32 | low; break; @@ -120,7 +120,7 @@ Signed-off-by: Russell King } pp->ethtool_stats[i] += val; -@@ -3910,6 +3954,47 @@ static u16 mvneta_select_queue(struct ne +@@ -3906,6 +3950,47 @@ static u16 mvneta_select_queue(struct ne } @@ -168,7 +168,7 @@ Signed-off-by: Russell King static const struct net_device_ops mvneta_netdev_ops = { .ndo_open = mvneta_open, .ndo_stop = mvneta_stop, -@@ -3942,6 +4027,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -3938,6 +4023,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch index da98c1cbb..834bbe9a3 100644 --- a/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch +++ b/target/linux/mvebu/patches-4.9/430-net-mvneta-add-module-EEPROM-reading-support.patch @@ -7,7 +7,7 @@ Signed-off-by: Russell King --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c -@@ -3954,6 +3954,22 @@ static u16 mvneta_select_queue(struct ne +@@ -3950,6 +3950,22 @@ static u16 mvneta_select_queue(struct ne } @@ -30,7 +30,7 @@ Signed-off-by: Russell King static int mvneta_ethtool_get_eee(struct net_device *dev, struct ethtool_eee *eee) { -@@ -4027,6 +4043,8 @@ const struct ethtool_ops mvneta_eth_tool +@@ -4023,6 +4039,8 @@ const struct ethtool_ops mvneta_eth_tool .set_rxfh = mvneta_ethtool_set_rxfh, .get_link_ksettings = mvneta_ethtool_get_link_ksettings, .set_link_ksettings = mvneta_ethtool_set_link_ksettings, diff --git a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch index 2a607c6c6..6bffa6fe6 100644 --- a/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch +++ b/target/linux/oxnas/patches-4.4/996-ATAG_DTB_COMPAT_CMDLINE_MANGLE.patch @@ -153,7 +153,7 @@ Signed-off-by: Adrian Panella } --- a/init/main.c +++ b/init/main.c -@@ -88,6 +88,10 @@ +@@ -89,6 +89,10 @@ #include #include @@ -164,7 +164,7 @@ Signed-off-by: Adrian Panella static int kernel_init(void *); extern void init_IRQ(void); -@@ -560,6 +564,18 @@ asmlinkage __visible void __init start_k +@@ -562,6 +566,18 @@ asmlinkage __visible void __init start_k page_alloc_init(); pr_notice("Kernel command line: %s\n", boot_command_line); diff --git a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch index f4f4860e5..21a8eeff9 100644 --- a/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch +++ b/target/linux/x86/patches-4.9/200-pcengines-apu2-reboot.patch @@ -1,6 +1,6 @@ --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c -@@ -443,6 +443,16 @@ static struct dmi_system_id __initdata r +@@ -447,6 +447,16 @@ static struct dmi_system_id __initdata r }, }, From 1f3705575d96a60529c966883078ad905d962c98 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 11 Jan 2018 19:05:20 +0800 Subject: [PATCH 72/95] add missing k3screenctrl --- package/lean/k3screenctrl/Makefile | 47 +++++++++++++++++++ .../lean/k3screenctrl/files/k3screenctrl.init | 14 ++++++ 2 files changed, 61 insertions(+) create mode 100644 package/lean/k3screenctrl/Makefile create mode 100755 package/lean/k3screenctrl/files/k3screenctrl.init diff --git a/package/lean/k3screenctrl/Makefile b/package/lean/k3screenctrl/Makefile new file mode 100644 index 000000000..6f862cec0 --- /dev/null +++ b/package/lean/k3screenctrl/Makefile @@ -0,0 +1,47 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=k3screenctrl +PKG_VERSION:=0.10 +PKG_RELEASE:=2 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/updateing/k3screenctrl.git +PKG_SOURCE_VERSION:=dd05ce9a5cb0cb6cebfc6b3b5823c7f6d75796ff +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION) +PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.xz +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) +PKG_MAINTAINER:=Hamster Tian + +include $(INCLUDE_DIR)/package.mk + +TARGET_CFLAGS+= -D_GNU_SOURCE + +define Package/k3screenctrl + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=@TARGET_bcm53xx_DEVICE_phicomm-k3 +@KERNEL_DEVMEM + TITLE:=LCD screen controller on PHICOMM K3 + URL:=https://github.com/updateing/k3-screen-ctrl +endef + +define Package/k3screenctrl/description + K3 Screen Controller (k3screenctrl) is a program utilizing +the LCD screen on PHICOMM K3 to display some stats. +endef + +define Package/k3screenctrl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_DIR) $(1)/lib/k3screenctrl + $(INSTALL_DIR) $(1)/etc/init.d + + $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/k3screenctrl $(1)/usr/bin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wan.sh $(1)/lib/k3screenctrl/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/wifi.sh $(1)/lib/k3screenctrl/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/port.sh $(1)/lib/k3screenctrl/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/basic.sh $(1)/lib/k3screenctrl/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/lib/k3screenctrl/host.sh $(1)/lib/k3screenctrl/ + + $(INSTALL_BIN) ./files/k3screenctrl.init $(1)/etc/init.d/k3screenctrl +endef + +$(eval $(call BuildPackage,k3screenctrl)) diff --git a/package/lean/k3screenctrl/files/k3screenctrl.init b/package/lean/k3screenctrl/files/k3screenctrl.init new file mode 100755 index 000000000..5d3d190a2 --- /dev/null +++ b/package/lean/k3screenctrl/files/k3screenctrl.init @@ -0,0 +1,14 @@ +#!/bin/sh /etc/rc.common + +START=99 +STOP=99 + +SCRIPTS_BASE=/lib/k3screenctrl/ + +start() { + /usr/bin/k3screenctrl & +} + +stop() { + killall k3screenctrl +} From 5d5ba500e61040274ce76e2069c6e2e7f79f816a Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Thu, 11 Jan 2018 21:19:53 +0800 Subject: [PATCH 73/95] fix gettext path for gdbm --- package/libs/gettext-full/Makefile | 1 + package/libs/gettext-full/patches/000-relocatable.patch | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package/libs/gettext-full/Makefile b/package/libs/gettext-full/Makefile index deb484010..db6aee750 100644 --- a/package/libs/gettext-full/Makefile +++ b/package/libs/gettext-full/Makefile @@ -19,6 +19,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/gettext-$(PKG_VERSION) PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gettext PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/gettext-full/patches/000-relocatable.patch b/package/libs/gettext-full/patches/000-relocatable.patch index c14be7283..a95c268f5 100644 --- a/package/libs/gettext-full/patches/000-relocatable.patch +++ b/package/libs/gettext-full/patches/000-relocatable.patch @@ -5,8 +5,8 @@ # Set variables # - gettext_datadir directory where the data files are stored. -prefix="@prefix@" -+if [ -n "$STAGING_DIR" ]; then -+ prefix="$STAGING_DIR/host" ++if [ -n "$STAGING_DIR_HOSTPKG" ]; then ++ prefix="$STAGING_DIR_HOSTPKG" +else + prefix="@prefix@" +fi @@ -20,8 +20,8 @@ # Set variables # - gettext_datadir directory where the data files are stored. -prefix="@prefix@" -+if [ -n "$STAGING_DIR" ]; then -+ prefix="$STAGING_DIR/host" ++if [ -n "$STAGING_DIR_HOSTPKG" ]; then ++ prefix="$STAGING_DIR_HOSTPKG" +else + prefix="@prefix@" +fi From fe6ba738d5ac6abcf9f553f76e66968f10a185b0 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 11:20:10 +0800 Subject: [PATCH 74/95] kernel update to 4.4.111/4.9.76/4.14.13 --- include/kernel-version.mk | 12 +++++----- .../pending-4.4/204-module_strip.patch | 4 ++-- .../pending-4.4/902-debloat_proc.patch | 2 +- .../810-iommu-support-layerscape.patch | 24 +++++++++---------- .../110-pxa3xxx_revert_irq_thread.patch | 2 +- .../110-er200-ethernet_probe_order.patch | 6 ++--- .../patches-4.14/160-cmdline-hack.patch | 8 +++---- .../octeon/patches-4.14/170-cisco-hack.patch | 2 +- 8 files changed, 30 insertions(+), 30 deletions(-) diff --git a/include/kernel-version.mk b/include/kernel-version.mk index 2b1b0b9fb..87d3ff172 100644 --- a/include/kernel-version.mk +++ b/include/kernel-version.mk @@ -3,14 +3,14 @@ LINUX_RELEASE?=1 LINUX_VERSION-3.18 = .71 -LINUX_VERSION-4.4 = .110 -LINUX_VERSION-4.9 = .75 -LINUX_VERSION-4.14 = .12 +LINUX_VERSION-4.4 = .111 +LINUX_VERSION-4.9 = .76 +LINUX_VERSION-4.14 = .13 LINUX_KERNEL_HASH-3.18.71 = 5abc9778ad44ce02ed6c8ab52ece8a21c6d20d21f6ed8a19287b4a38a50c1240 -LINUX_KERNEL_HASH-4.4.110 = d099175aac5678e6cad2f23cd56ed22a2857143c0c18489390c95ba8c441db58 -LINUX_KERNEL_HASH-4.9.75 = de6c31b7668d4047e370f4625362a02b9ebf7da56d5c0879a4961f620ab1cadf -LINUX_KERNEL_HASH-4.14.12 = 6608f7d480efc5c1078888e9344f4e0b0cd9bef0b6541cbdaec7d138e03856af +LINUX_KERNEL_HASH-4.4.111 = a201282e8eaf62b4f51edb2241e98ff805fe2d1b04a72a2328c5a6e2d77ec008 +LINUX_KERNEL_HASH-4.9.76 = b82b94332cffaaeade74495264c989dafb96d4748503f87a5b7c436f5de887de +LINUX_KERNEL_HASH-4.14.13 = 4ab46d1b5a0f8ef83b80760f89ae4f5c88431b19b3cf79ffa0c66d6b33e45772 ifdef KERNEL_PATCHVER LINUX_VERSION:=$(KERNEL_PATCHVER)$(strip $(LINUX_VERSION-$(KERNEL_PATCHVER))) diff --git a/target/linux/generic/pending-4.4/204-module_strip.patch b/target/linux/generic/pending-4.4/204-module_strip.patch index 85805b3ea..d4c8039f7 100644 --- a/target/linux/generic/pending-4.4/204-module_strip.patch +++ b/target/linux/generic/pending-4.4/204-module_strip.patch @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau config MODULES_TREE_LOOKUP --- a/kernel/module.c +++ b/kernel/module.c -@@ -2864,6 +2864,7 @@ static struct module *setup_load_info(st +@@ -2871,6 +2871,7 @@ static struct module *setup_load_info(st static int check_modinfo(struct module *mod, struct load_info *info, int flags) { @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau const char *modmagic = get_modinfo(info, "vermagic"); int err; -@@ -2889,6 +2890,7 @@ static int check_modinfo(struct module * +@@ -2900,6 +2901,7 @@ static int check_modinfo(struct module * pr_warn("%s: module is from the staging directory, the quality " "is unknown, you have been warned.\n", mod->name); } diff --git a/target/linux/generic/pending-4.4/902-debloat_proc.patch b/target/linux/generic/pending-4.4/902-debloat_proc.patch index 248ba8f67..f7718bc5b 100644 --- a/target/linux/generic/pending-4.4/902-debloat_proc.patch +++ b/target/linux/generic/pending-4.4/902-debloat_proc.patch @@ -133,7 +133,7 @@ } --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -1556,10 +1556,12 @@ static int __init setup_vmstat(void) +@@ -1558,10 +1558,12 @@ static int __init setup_vmstat(void) cpu_notifier_register_done(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch index 7773e70e9..71ef5d87a 100644 --- a/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch +++ b/target/linux/layerscape/patches-4.9/810-iommu-support-layerscape.patch @@ -246,16 +246,16 @@ Signed-off-by: Yangbo Lu /* Restrict the stage to what we can actually support */ if (!(smmu->features & ARM_SMMU_FEAT_TRANS_S1)) smmu_domain->stage = ARM_SMMU_DOMAIN_S2; -@@ -1578,7 +1593,7 @@ static __le64 *arm_smmu_get_step_for_sid +@@ -1580,7 +1595,7 @@ static __le64 *arm_smmu_get_step_for_sid return step; } -static int arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) +static void arm_smmu_install_ste_for_dev(struct iommu_fwspec *fwspec) { - int i; + int i, j; struct arm_smmu_master_data *master = fwspec->iommu_priv; -@@ -1590,17 +1605,14 @@ static int arm_smmu_install_ste_for_dev( +@@ -1599,17 +1614,14 @@ static int arm_smmu_install_ste_for_dev( arm_smmu_write_strtab_ent(smmu, sid, step, &master->ste); } @@ -275,7 +275,7 @@ Signed-off-by: Yangbo Lu } static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev) -@@ -1619,7 +1631,7 @@ static int arm_smmu_attach_dev(struct io +@@ -1628,7 +1640,7 @@ static int arm_smmu_attach_dev(struct io ste = &master->ste; /* Already attached to a different domain? */ @@ -284,7 +284,7 @@ Signed-off-by: Yangbo Lu arm_smmu_detach_dev(dev); mutex_lock(&smmu_domain->init_mutex); -@@ -1640,10 +1652,12 @@ static int arm_smmu_attach_dev(struct io +@@ -1649,10 +1661,12 @@ static int arm_smmu_attach_dev(struct io goto out_unlock; } @@ -300,7 +300,7 @@ Signed-off-by: Yangbo Lu ste->s1_cfg = &smmu_domain->s1_cfg; ste->s2_cfg = NULL; arm_smmu_write_ctx_desc(smmu, ste->s1_cfg); -@@ -1652,10 +1666,7 @@ static int arm_smmu_attach_dev(struct io +@@ -1661,10 +1675,7 @@ static int arm_smmu_attach_dev(struct io ste->s2_cfg = &smmu_domain->s2_cfg; } @@ -312,7 +312,7 @@ Signed-off-by: Yangbo Lu out_unlock: mutex_unlock(&smmu_domain->init_mutex); return ret; -@@ -1703,6 +1714,9 @@ arm_smmu_iova_to_phys(struct iommu_domai +@@ -1712,6 +1723,9 @@ arm_smmu_iova_to_phys(struct iommu_domai struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); struct io_pgtable_ops *ops = smmu_domain->pgtbl_ops; @@ -322,7 +322,7 @@ Signed-off-by: Yangbo Lu if (!ops) return 0; -@@ -1801,7 +1815,7 @@ static void arm_smmu_remove_device(struc +@@ -1810,7 +1824,7 @@ static void arm_smmu_remove_device(struc return; master = fwspec->iommu_priv; @@ -331,7 +331,7 @@ Signed-off-by: Yangbo Lu arm_smmu_detach_dev(dev); iommu_group_remove_device(dev); kfree(master); -@@ -1830,6 +1844,9 @@ static int arm_smmu_domain_get_attr(stru +@@ -1839,6 +1853,9 @@ static int arm_smmu_domain_get_attr(stru { struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -341,7 +341,7 @@ Signed-off-by: Yangbo Lu switch (attr) { case DOMAIN_ATTR_NESTING: *(int *)data = (smmu_domain->stage == ARM_SMMU_DOMAIN_NESTED); -@@ -1845,6 +1862,9 @@ static int arm_smmu_domain_set_attr(stru +@@ -1854,6 +1871,9 @@ static int arm_smmu_domain_set_attr(stru int ret = 0; struct arm_smmu_domain *smmu_domain = to_smmu_domain(domain); @@ -351,7 +351,7 @@ Signed-off-by: Yangbo Lu mutex_lock(&smmu_domain->init_mutex); switch (attr) { -@@ -1874,6 +1894,31 @@ static int arm_smmu_of_xlate(struct devi +@@ -1883,6 +1903,31 @@ static int arm_smmu_of_xlate(struct devi return iommu_fwspec_add_ids(dev, args->args, 1); } @@ -383,7 +383,7 @@ Signed-off-by: Yangbo Lu static struct iommu_ops arm_smmu_ops = { .capable = arm_smmu_capable, .domain_alloc = arm_smmu_domain_alloc, -@@ -1889,6 +1934,8 @@ static struct iommu_ops arm_smmu_ops = { +@@ -1898,6 +1943,8 @@ static struct iommu_ops arm_smmu_ops = { .domain_get_attr = arm_smmu_domain_get_attr, .domain_set_attr = arm_smmu_domain_set_attr, .of_xlate = arm_smmu_of_xlate, diff --git a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch index 419306ed9..299f07966 100644 --- a/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch +++ b/target/linux/mvebu/patches-4.9/110-pxa3xxx_revert_irq_thread.patch @@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau } static inline int is_buf_blank(uint8_t *buf, size_t len) -@@ -1856,9 +1842,7 @@ static int alloc_nand_resource(struct pl +@@ -1857,9 +1843,7 @@ static int alloc_nand_resource(struct pl /* initialize all interrupts to be disabled */ disable_int(info, NDSR_MASK); diff --git a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch index 1df3f6a67..6b1eaf92a 100644 --- a/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch +++ b/target/linux/octeon/patches-4.14/110-er200-ethernet_probe_order.patch @@ -1,14 +1,14 @@ --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c -@@ -684,6 +684,7 @@ static int cvm_oct_probe(struct platform +@@ -673,6 +673,7 @@ static int cvm_oct_probe(struct platform int interface; int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE; int qos; + int i; struct device_node *pip; + int mtu_overhead = ETH_HLEN + ETH_FCS_LEN; - octeon_mdiobus_force_mod_depencency(); -@@ -800,13 +801,19 @@ static int cvm_oct_probe(struct platform +@@ -796,13 +797,19 @@ static int cvm_oct_probe(struct platform } num_interfaces = cvmx_helper_get_number_of_interfaces(); diff --git a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch index 2a4ad1dc7..e902e853e 100644 --- a/target/linux/octeon/patches-4.14/160-cmdline-hack.patch +++ b/target/linux/octeon/patches-4.14/160-cmdline-hack.patch @@ -1,6 +1,6 @@ --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c -@@ -656,6 +656,35 @@ void octeon_user_io_init(void) +@@ -650,6 +650,35 @@ void octeon_user_io_init(void) write_c0_derraddr1(0); } @@ -36,12 +36,12 @@ /** * Early entry point for arch setup */ -@@ -900,6 +929,8 @@ void __init prom_init(void) +@@ -894,6 +923,8 @@ void __init prom_init(void) } } + octeon_use_image_cmdline(); + if (strstr(arcs_cmdline, "console=") == NULL) { - #ifdef CONFIG_CAVIUM_OCTEON_2ND_KERNEL - strcat(arcs_cmdline, " console=ttyS0,115200"); + if (octeon_uart == 1) + strcat(arcs_cmdline, " console=ttyS1,115200"); diff --git a/target/linux/octeon/patches-4.14/170-cisco-hack.patch b/target/linux/octeon/patches-4.14/170-cisco-hack.patch index 124bcfd7a..72774209d 100644 --- a/target/linux/octeon/patches-4.14/170-cisco-hack.patch +++ b/target/linux/octeon/patches-4.14/170-cisco-hack.patch @@ -18,7 +18,7 @@ Signed-off-by: MichaÅ‚ Osowiecki --- a/arch/mips/cavium-octeon/setup.c +++ b/arch/mips/cavium-octeon/setup.c -@@ -1005,6 +1005,10 @@ void __init plat_mem_setup(void) +@@ -1018,6 +1018,10 @@ void __init plat_mem_setup(void) if (mem_alloc_size > max_memory) mem_alloc_size = max_memory; From 16c2522ec28a0eb9fe13c577c72e656306ebda93 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 11:21:45 +0800 Subject: [PATCH 75/95] kmod-sched-cake: bump to latest cake bake --- package/kernel/kmod-sched-cake/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/kernel/kmod-sched-cake/Makefile b/package/kernel/kmod-sched-cake/Makefile index ff27e9517..f9bcd65f1 100644 --- a/package/kernel/kmod-sched-cake/Makefile +++ b/package/kernel/kmod-sched-cake/Makefile @@ -13,9 +13,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/dtaht/sch_cake.git -PKG_SOURCE_DATE:=2017-12-22 -PKG_SOURCE_VERSION:=5bf0b6596721e18269ee4bae6e3549c75cba923a -PKG_MIRROR_HASH:=95c0f886a3ad8ccfd7b35fa19af8b5ecbf0b2f74caea73fbabd6574f1c3be2db +PKG_SOURCE_DATE:=2018-01-07 +PKG_SOURCE_VERSION:=568ed96467f41aad37556b0db11fc008e05941e9 +PKG_MIRROR_HASH:=8f3f962824826d07b1029379d91e01bf97fe0bfce1233af5cfa7a54cb1c3632c include $(INCLUDE_DIR)/package.mk From 8e2184a58d1b951317813f8257376f499973bf73 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 15:43:10 +0800 Subject: [PATCH 76/95] replace kuainiao with xlnetacc from sensel --- package/lean/luci-app-kuainiao/Makefile | 17 - .../luasrc/controller/kuainiao.lua | 34 - .../luasrc/model/cbi/kuainiao.lua | 59 -- .../luasrc/view/kuainiao/kuainiao_rsa.htm | 25 - .../luasrc/view/kuainiao/kuainiao_status.htm | 38 -- .../luci-app-kuainiao/po/zh-cn/kuainiao.po | 4 - .../root/etc/config/kuainiao | 8 - .../root/etc/hotplug.d/iface/99-kuainiao | 15 - .../root/etc/init.d/kuainiao | 45 -- .../root/etc/uci-defaults/luci-kuainiao | 9 - .../luci-app-kuainiao/root/usr/bin/kuainiao | 606 ------------------ .../root/usr/bin/luci_kuainiao_apply | 12 - .../usr/share/kuainiao/kuainiao_down_state | 1 - .../root/usr/share/kuainiao/kuainiao_up_state | 1 - .../root/www/luci-static/resources/md5.js | 1 - .../root/www/luci-static/resources/sha1.js | 202 ------ package/lean/luci-app-xlnetacc/Makefile | 71 ++ .../files/luci/controller/xlnetacc.lua | 47 ++ .../files/luci/i18n/xlnetacc.zh-cn.lmo | Bin 0 -> 1188 bytes .../files/luci/i18n/xlnetacc.zh-cn.po | 92 +++ .../luci-static/resources/xlnetacc/md5-min.js | 9 + .../luci-static/resources/xlnetacc}/rsa.js | 0 .../resources/xlnetacc/sha1-min.js | 9 + .../files/luci/model/cbi/xlnetacc.lua | 40 ++ .../files/luci/view/xlnetacc/logview.htm | 49 ++ .../files/luci/view/xlnetacc/rsa.htm | 41 ++ .../files/luci/view/xlnetacc/status.htm | 21 + .../files/root/etc/config/xlnetacc | 5 + .../files/root/etc/init.d/xlnetacc | 44 ++ .../files/root/etc/uci-defaults/luci-xlnetacc | 22 + .../files/root/usr/bin/xlnetacc.sh | 512 +++++++++++++++ .../luci-app-xlnetacc/tools/po2lmo/Makefile | 12 + .../tools/po2lmo/src/po2lmo.c | 247 +++++++ .../tools/po2lmo/src/template_lmo.c | 328 ++++++++++ .../tools/po2lmo/src/template_lmo.h | 92 +++ 35 files changed, 1641 insertions(+), 1077 deletions(-) delete mode 100644 package/lean/luci-app-kuainiao/Makefile delete mode 100644 package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua delete mode 100644 package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua delete mode 100644 package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm delete mode 100644 package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm delete mode 100644 package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po delete mode 100644 package/lean/luci-app-kuainiao/root/etc/config/kuainiao delete mode 100755 package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao delete mode 100755 package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao delete mode 100755 package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao delete mode 100755 package/lean/luci-app-kuainiao/root/usr/bin/kuainiao delete mode 100755 package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply delete mode 100644 package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state delete mode 100644 package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state delete mode 100644 package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js delete mode 100644 package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js create mode 100644 package/lean/luci-app-xlnetacc/Makefile create mode 100644 package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua create mode 100644 package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo create mode 100644 package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.po create mode 100644 package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/md5-min.js rename package/lean/{luci-app-kuainiao/root/www/luci-static/resources => luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc}/rsa.js (100%) create mode 100644 package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js create mode 100644 package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua create mode 100644 package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm create mode 100644 package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm create mode 100644 package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm create mode 100644 package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc create mode 100755 package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc create mode 100755 package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc create mode 100644 package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh create mode 100644 package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile create mode 100644 package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c create mode 100644 package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c create mode 100644 package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h diff --git a/package/lean/luci-app-kuainiao/Makefile b/package/lean/luci-app-kuainiao/Makefile deleted file mode 100644 index 6e8319b3f..000000000 --- a/package/lean/luci-app-kuainiao/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2016 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI support for Kuainiao -LUCI_DEPENDS:=+kmod-ppp +openssl-util +wget +kmod-mppe -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=3 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature - diff --git a/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua b/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua deleted file mode 100644 index 378517c42..000000000 --- a/package/lean/luci-app-kuainiao/luasrc/controller/kuainiao.lua +++ /dev/null @@ -1,34 +0,0 @@ -module("luci.controller.kuainiao", package.seeall) - -function index() - local fs = luci.fs or nixio.fs - if not fs.access("/etc/config/kuainiao") then - return - end - - local page = entry({"admin", "services", "kuainiao"}, cbi("kuainiao"), _("Kuai Niao"),201) - page.dependent = true - entry({"admin","services","kuainiao","status"},call("kuainiao_status")).leaf=true - entry({"admin","services","kuainiao","dwonstatus"},call("down_status")).leaf=true - entry({"admin","services","kuainiao","upstatus"},call("up_status")).leaf=true -end - -function kuainiao_status() -local e={} -e.running=luci.sys.exec("ps |grep -v grep |grep -w '/usr/bin/kuainiao' ") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end - -function up_status() -local e={} -e.upstatus=luci.sys.exec("cat /usr/share/kuainiao/kuainiao_up_state") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end -function down_status() -local e={} -e.dwonstatus=luci.sys.exec("cat /usr/share/kuainiao/kuainiao_down_state") -luci.http.prepare_content("application/json") -luci.http.write_json(e) -end diff --git a/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua b/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua deleted file mode 100644 index 3fec7cd00..000000000 --- a/package/lean/luci-app-kuainiao/luasrc/model/cbi/kuainiao.lua +++ /dev/null @@ -1,59 +0,0 @@ -#fork from https://github.com/zz090923610/thunder-fastNiao,thanks to zz090923610 -require("luci.sys") -require("luci.sys.zoneinfo") -require("luci.config") -local fs = require "nixio.fs" -local ut = require "luci.util" -local o=require"luci.model.network".init() -local sys = require "luci.sys" -local m,t,e -m = Map("kuainiao", translate("迅雷快鸟"),translate("迅雷快鸟是迅雷è”åˆå®½å¸¦è¿è¥å•†æŽ¨å‡ºçš„一款致力于帮助用户解决宽带低ã€ç½‘速慢ã€ä¸Šç½‘体验差的专业级宽带加速软件。")) -m:section(SimpleSection).template = "kuainiao/kuainiao_status" -s = m:section(NamedSection, "base", "kuainiao", translate("首次使用请填写完å¸å·å¯†ç ä¿å­˜æ交一次,之åŽå†å¯ç”¨ã€‚")) -s.addremove = false -s:tab("base",translate("Basic Settings")) -s:tab("log",translate("快鸟日志")) -enabled = s:taboption("base",Flag, "enabled", translate("Enable")) -enabled.default=0 -enabled.rmempty = false -enable_down = s:taboption("base",Flag, "enable_down", translate("å¼€å¯ä¸‹è¡ŒåŠ é€Ÿ")) -enable_down.default=1 -enabled.rmempty = false -enable_down:depends("enabled",1) - -enable_up = s:taboption("base",Flag, "enable_up", translate("å¼€å¯ä¸Šè¡ŒåŠ é€Ÿ")) -enable_up.default=0 -enabled.rmempty = false -enable_up:depends("enabled",1) -local a -speed_wan=s:taboption("base",ListValue,"speed_wan",translate("指定加速的接å£")) -for a,s in ipairs(o:get_networks())do -if s:name()~="loopback" and s:name()~="lan" then speed_wan:value(s:name())end -end -username = s:taboption("base",Value, "kuainiao_name", translate("迅雷快鸟å¸å·")) -username.datatype = "minlength(1)" -username.rmempty = false -password = s:taboption("base",Value, "kuainiao_passwd", translate("迅雷快鸟密ç ")) -password.password = true -password.datatype = "minlength(1)" -password.rmempty = false -kuainiao_config_pwd = s:taboption("base",Value, "kuainiao_config_pwd", translate("加密åŽå¯†ç (自动生æˆ,勿修改)")) -kuainiao_config_pwd.password = true -kuainiao_config_pwd.datatype = "minlength(1)" -kuainiao_config_pwd.rmempty = true ---kuainiao_config_pwd.readonly=true -log=s:taboption("log",TextValue,"log") -log.rows=26 -log.wrap="off" -log.readonly=true -log.cfgvalue=function(t,t) -return nixio.fs.readfile("/var/log/kuainiao.log")or"" -end -log.write=function(log,log,log) -end -m:section(SimpleSection).template = "kuainiao/kuainiao_rsa" -local apply = luci.http.formvalue("cbi.apply") -if apply then - io.popen("luci_kuainiao_apply") -end -return m diff --git a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm b/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm deleted file mode 100644 index 9d8c45871..000000000 --- a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_rsa.htm +++ /dev/null @@ -1,25 +0,0 @@ -<%# - Copyright (C) 2017 Jian Chang - Licensed to the public under the GNU General Public License v3. --%> - - - - -<% include("cbi/map") %> - - diff --git a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm b/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm deleted file mode 100644 index 93c28e579..000000000 --- a/package/lean/luci-app-kuainiao/luasrc/view/kuainiao/kuainiao_status.htm +++ /dev/null @@ -1,38 +0,0 @@ -<%# - Copyright 2017 Lede by stones --%> - -<% include("cbi/map") %> - - -
- <%:快鸟è¿è¡ŒçŠ¶æ€ï¼š%><%:Collecting data...%> - - - <%:下行æ速状æ€ï¼š%><%:Collecting data...%> - - <%:上行æ速状æ€ï¼š%><%:Collecting data...%> -
\ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po b/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po deleted file mode 100644 index fc29d8849..000000000 --- a/package/lean/luci-app-kuainiao/po/zh-cn/kuainiao.po +++ /dev/null @@ -1,4 +0,0 @@ -msgid "Kuai Niao" -msgstr "迅雷快鸟" - - diff --git a/package/lean/luci-app-kuainiao/root/etc/config/kuainiao b/package/lean/luci-app-kuainiao/root/etc/config/kuainiao deleted file mode 100644 index 0c4db8d66..000000000 --- a/package/lean/luci-app-kuainiao/root/etc/config/kuainiao +++ /dev/null @@ -1,8 +0,0 @@ - -config kuainiao 'base' - option kuainiao_name '' - option kuainiao_passwd '' - option speed_wan 'wan' - option enabled '0' - option enable_down '1' - option enable_up '0' diff --git a/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao b/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao deleted file mode 100755 index 2f42f3093..000000000 --- a/package/lean/luci-app-kuainiao/root/etc/hotplug.d/iface/99-kuainiao +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -. /lib/functions.sh - -enabled=`uci -q get kuainiao.base.enabled` -[ "enabled" -eq 1 ] || exit 0 -[ "$ACTION" = ifup ] && { - logger -t Thunder kuainiao has reloaded due to Device: $DEVICE Action: $ACTION ; - /etc/init.d/kuainiao stop && sleep 2; - /etc/init.d/kuainiao start; -} - -[ "$ACTION" = ifdown ] && { - logger -t Thunder KuaiNiao has stoped due to Device: $DEVICE Action: $ACTION ; - /etc/init.d/kuainiao stop; -} \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao b/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao deleted file mode 100755 index 29f7c8adb..000000000 --- a/package/lean/luci-app-kuainiao/root/etc/init.d/kuainiao +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=99 -STOP=15 -SERVICE_WRITE_PID=1 -SERVICE_DAEMONIZE=1 -LOGFILE=/var/log/kuainiao.log - -start_service() -{ - procd_open_instance - procd_set_param command /usr/bin/kuainiao - procd_set_param respawn ${respawn_threshold:-5} ${respawn_timeout:-300} ${respawn_retry:-10} - procd_close_instance -} - -stop_service(){ - clean_log - pid_kuainiao=`ps | grep -v grep | grep -w "/usr/bin/kuainiao" |awk '{print $1}' 2>/dev/null` - [ -n "$pid_kuainiao" ] && { - for pid in $pid_kuainiao - do - echo "Stop service kuainiao PID: $pid" - kill $pid 2>/dev/null - for spid in `pgrep sleep` - do - ppid=`cat /proc/$spid/status | grep -w "PPid" | awk '{print $2}'` - [ "$ppid" -eq "$pid" ] && kill $spid 2>/dev/null && echo "Stop service kuainiao SPID: $spid" - done - done - } - echo "暂无加速信æ¯" > /usr/share/kuainiao/kuainiao_down_state - echo "暂无加速信æ¯" > /usr/share/kuainiao/kuainiao_up_state -} - -clean_log() { - [ -f "$LOGFILE" ] && { - logsnum=$(cat $LOGFILE | grep -c .) - if [ $logsnum -gt 300 ];then - rm -f $LOGFILE >/dev/null 2>&1 & - echo "$(date): 日志文件过长,清空处ç†ï¼" >> $LOGFILE - fi - } -} diff --git a/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao b/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao deleted file mode 100755 index b8b12cac8..000000000 --- a/package/lean/luci-app-kuainiao/root/etc/uci-defaults/luci-kuainiao +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@kuainiao[-1] - add ucitrack kuainiao - set ucitrack.@kuainiao[-1].init=kuainiao - commit ucitrack -EOF -exit 0 \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao b/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao deleted file mode 100755 index f5e520540..000000000 --- a/package/lean/luci-app-kuainiao/root/usr/bin/kuainiao +++ /dev/null @@ -1,606 +0,0 @@ -#!/bin/sh -#2017/05/01 by kenney -#2017/07/19 update for lede by stones -. /lib/functions.sh - -LOGFILE=/var/log/kuainiao.log -down_state_file=/usr/share/kuainiao/kuainiao_down_state -up_state_file=/usr/share/kuainiao/kuainiao_up_state -version="0.4" -app_version="2.0.3.4" -protocolVersion=108 -sdkVersion=17550 -logmore=0 #打å°æ›´è¯¦ç»†æ—¥å¿—排查 - - -logmore(){ - data=$1 - [ "$logmore" -eq 1 ] && { - echo $(date): $data >> $LOGFILE - } -} - -log_down(){ - kuainiao_down_state=$1 - status=$2 - if [ "$status" -eq 1 ]; then - echo "$kuainiao_down_state" > $down_state_file - else - echo "$kuainiao_down_state" > $down_state_file - fi -} - -log_up(){ - kuainiao_up_state=$1 - status=$2 - if [ "$status" -eq 1 ]; then - echo "$kuainiao_up_state" > $up_state_file - else - echo "$kuainiao_up_state" > $up_state_file - fi -} - -#WAN接å£IP判断 -get_bind_address(){ - ifname=$(uci -P /var/state get network.$kuainiao_config_wan.ifname 2>/dev/null) - [ $? -eq 1 ] && echo $(date): "获å–网络 $kuainiao_config_wan ä¿¡æ¯å‡ºé”™" >>$LOGFILE && echo >>$LOGFILE && return - logmore "ifname is $ifname" - ##wan_selected 所选接å£IP - wan_selected=$(ifconfig $ifname 2>/dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) - [ -z "$wan_selected" ] && echo $(date): "获å–网络 $kuainiao_config_wan æŽ¥å£ $ifname ä¿¡æ¯å‡ºé”™" >>$LOGFILE && echo >>$LOGFILE && return - if [ "$wan_selected" != "0.0.0.0" ]; then - bind_address=$wan_selected - else - bind_address="" - fi -} - -#定义请求函数 -#bind_address='113.248.3.11' -get_http_req(){ - if [ -n "$bind_address" ]; then - HTTP_REQ="wget --bind-address=$bind_address --no-check-certificate -O - " - POST_ARG="--post-data=" - else - HTTP_REQ="wget --no-check-certificate -O - " - POST_ARG="--post-data=" - fi - kuainiao_HTTP_REQ=$HTTP_REQ - kuainiao_POST_ARG=$POST_ARG -} - -#æ•°æ®mock - -generate_pwd_rsa_hex() -{ - # calculate passwd_md5 - logmore "Generating passwd md5" - passwd_md5=`echo -n "$kuainiao_config_pwd" | md5sum | tr -d " -"` - - if [ `echo -n "$passwd_md5" | wc -c` -ne 32 ]; then - logmore "md5sum should be 32 chars, exit." - exit 1 - fi - - logmore "Generating PWD RSA HEX" - #first, encoding passwd using rsa - a=`echo "$passwd_md5" | openssl rsautl -raw -pubin -inkey /etc/thunder.key -hexdump | tr [a-z] [A-Z]` - a=`echo $a | grep -o '00[0-9]0 \- \([A-Z0-9]\{2\}[- ]\)\{16\}' | sed 's/00[0-9]0 - //g' | tr -d " \-\n"` - echo -n "$a" - -} - -#pwd='702CFAF5824E4306516F488DEAFC2D24F76C82FA53BA3396F5615FDD32E4430E45B254E136056ED5F3C5B404A08E2178B51330999A4EC3C2D2989D554D7863BDE8F058F44808E6B65F4D071B5D5C7210210DA9ED8D729312CECA39E0F4516143E33C089F616ABE93E14D3224BEB311D3D6EF65A6CE265D3E4ABA285523F14320' - -get_device_sign(){ - ifname=$(uci get network.$kuainiao_config_wan.ifname 2>/dev/null) - wan_mac=$(ifconfig $ifname | grep 'HWaddr' | awk '{print $5}') - fake_device_id=$(echo -n "$wan_mac" | md5sum | cut -d ' ' -f1) - fake_device_id_tmp1=$(echo -n "$fake_device_id"com.xunlei.vip.swjsq68700d1872b772946a6940e4b51827e8af"" | openssl sha1 -hmac | awk '{print $2}') - devicesign="div100."${fake_device_id}$(echo -n "$fake_device_id_tmp1" | md5sum | cut -d ' ' -f1) -} - - -#verifyCode=$kuainiao_config_verifyCode -#verifyKey=$kuainiao_verifyKey - -#获å–用户真实MACåœ°å€ -get_mac_addr(){ - if [ -n "$bind_address" ]; then - ifname=$(uci get network.$kuainiao_config_wan.ifname 2>/dev/null) - peerid=$(ifconfig $ifname | grep 'HWaddr' | awk '{print $5}' | awk 'gsub(/:/, "")')004V - fi - #peerid='000C29212478004V' -} - - -#获å–迅雷用户uid -get_xunlei_uid(){ - get_http_req - logmore "HTTP_REQ is $HTTP_REQ" - logmore "POST_ARG is $POST_ARG" - uname=$kuainiao_config_uname - #get_mac_addr - logmore "peerid is $peerid" - [ -z "$peerid" ] && exit 0 - #pwd=$generate_pwd_rsa_hex - pwd=$kuainiao_config_pwd - get_device_sign - logmore "devicesign is $devicesign" - ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.6.1.177600" https://login.mobile.reg2t.sandai.net:443/ $POST_ARG"{\"userName\":\""$uname"\",\"businessType\":68,\"clientVersion\":\"$app_version\",\"appName\":\"ANDROID-com.xunlei.vip.swjsq\",\"isCompressed\":0,\"sequenceNo\":1000001,\"sessionID\":\"\",\"loginType\":0,\"rsaKey\":{\"e\":\"010001\",\"n\":\"AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD\"},\"cmdID\":1,\"verifyCode\":\"$verifyCode\",\"peerID\":\""$peerid"\",\"protocolVersion\":$protocolVersion,\"platformVersion\":1,\"passWord\":\""$pwd"\",\"extensionList\":\"\",\"verifyKey\":\"$verifyKey\",\"sdkVersion\":$sdkVersion,\"devicesign\":\""$devicesign"\"}"` - #判断是å¦ç™»é™†æˆåŠŸ - #echo $ret >>test.txt - logmore "........................" - logmore "ret is $ret" - logmore "........................" - session=`echo $ret|awk -F '"sessionID":' '{print $2}'|awk -F '[,}]' '{print $1}'|grep -oE "[A-F,0-9]{32}"` - logmore "session is $session" - #vcode=`echo $ret|awk -F '"errorDescUrl":' '{print $2}'|awk -F '}' '{print $1}'` - #vcode=`echo $vcode|sed 's/\\//g'` - errcode=`echo $ret|awk -F '"errorCode":' '{print $2}'|awk -F '[,}]' '{print $1}'` - logmore "errcode is $errcode" - if [ -z "$session" ]; then - if [ $errcode == 6 ];then - #kuainiao_vcodeimg_url="$vcode" - #kuainiao_verifyKey='F9F6FBE928911784D809EBF046ABE0A6A467583F3944507099EA54BC9B5DA7BD' - kuainiao_last_act="您的账å·ä¸å®‰å…¨ï¼Œéœ€è¦è¾“入验è¯ç ! $(date "+%Y-%m-%d %H:%M:%S")" - - elif [ $errcode == 12 ];then - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="登陆å议无效,请更新ï¼$(date "+%Y-%m-%d %H:%M:%S")" - - elif [ $errcode == 3 ];then - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="用户å密ç é”™è¯¯ï¼Œè¯·æ£€æŸ¥ï¼$(date "+%Y-%m-%d %H:%M:%S")" - - else - #kuainiao_vcodeimg_url="" - #kuainiao_verifyKey='' - kuainiao_last_act="è¿…é›·è´¦å·ç™»é™†å¤±è´¥ï¼Œè¯·æ£€æŸ¥è¾“入的用户å密ç ! $(date "+%Y-%m-%d %H:%M:%S")" - - fi - #echo "è¿…é›·è´¦å·ç™»é™†å¤±è´¥ï¼Œè¯·æ£€æŸ¥è¾“入的用户å密ç !" - log_down "$kuainiao_last_act" 0 - - else - uid=`echo $ret|awk -F '"userID":' '{print $2}'|awk -F '[,}]' '{print $1}'` - kuainiao_config_uid=$uid - kuainiao_config_session=$session - kuainiao_last_act="迅雷快鸟已登陆æˆåŠŸ!" - log_down "$kuainiao_last_act" 1 - fi - echo $(date): "$kuainiao_last_act" >> $LOGFILE -} - -#获å–加速API -get_kuainiao_api(){ - portal=`$HTTP_REQ http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal` - portal_ip=`echo $portal|grep -oE '([0-9]{1,3}[\.]){3}[0-9]{1,3}'` - portal_port_temp=`echo $portal|grep -oE "port...[0-9]{1,5}"` - portal_port=`echo $portal_port_temp|grep -oE '[0-9]{1,5}'` - - logmore "portal is $portal" >> $LOGFILE - logmore "portal_ip is $portal_ip" >> $LOGFILE - logmore "portal_port_temp is $portal_port_temp" >> $LOGFILE - logmore "portal_port is $portal_port" >> $LOGFILE - - if [ -z "$portal_ip" ]; then - kuainiao_down_state="迅雷快鸟下行API获å–失败,请检查网络环境,或ç¨åŽå†è¯•!" - echo $(date): "$kuainiao_down_state" >> $LOGFILE - log_down "$kuainiao_down_state" 0 - else - api_url="http://$portal_ip:$portal_port/v2" - kuainiao_config_api=$api_url - fi -} - -#获å–上行加速API -get_kuainiao_upapi(){ - upportal=`$HTTP_REQ http://api.upportal.swjsq.vip.xunlei.com/v2/queryportal` - upportal_ip=`echo $upportal|grep -oE '([0-9]{1,3}[\.]){3}[0-9]{1,3}'` - upportal_port_temp=`echo $upportal|grep -oE "port...[0-9]{1,5}"` - upportal_port=`echo $upportal_port_temp|grep -oE '[0-9]{1,5}'` - - logmore "upportal is $upportal" - logmore "upportal_ip is $upportal_ip" - logmore "upportal_port_temp is $upportal_port_temp" - logmore "upportal_port is $upportal_port" - - if [ -z "$upportal_ip" ]; then - kuainiao_up_state="迅雷快鸟上行API获å–失败,请检查网络环境,或ç¨åŽå†è¯•!" - #echo "迅雷快鸟æœåŠ¡API获å–失败,请检查网络环境,或ç¨åŽå†è¯•!" - echo $(date): "$kuainiao_up_state" >> $LOGFILE - log_up "$kuainiao_up_state" 0 - else - upapi_url="http://$upportal_ip:$upportal_port/v2" - kuainiao_config_upapi=$upapi_url - fi - logmore "$(date): upapi_url is $upapi_url" -} - - -#æ£€æµ‹å¿«é¸ŸåŠ é€Ÿä¿¡æ¯ -get_bandwidth(){ - - logmore "api_url is $api_url" - logmore "peerid is $peerid" - if [ -n "$api_url" ]; then - [ -n "$portal_port_temp" ] && [ -n "$portal_port" ] && bandwidth - band=$width - logmore "band is $band" - can_upgrade=`echo $band|awk -F '"can_upgrade":' '{print $2}'|awk -F '[,}]' '{print $1}'` - logmore "can_upgrade is $can_upgrade" - kuainiao_can_upgrade=$can_upgrade - logmore "kuainiao_can_upgrade is $kuainiao_can_upgrade" - dial_account=`echo $band|awk -F '"dial_account":"' '{print $2}'|awk -F '[,}"]' '{print $1}'` - kuainiao_dial_account=$dial_account - logmore "kuainiao_dial_account is $kuainiao_dial_account" - #判断是å¦æ»¡è¶³åŠ é€Ÿæ¡ä»¶ - if [ "$can_upgrade" -eq 1 ]; then - #echo "迅雷快鸟å¯ä»¥åŠ é€Ÿ~~~愉快的开始加速å§~~" - #获å–åŠ é€Ÿè¯¦ç»†ä¿¡æ¯ - old_downstream=`echo $band|awk -F '"bandwidth":' '{print $2}'|awk -F '"downstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - max_downstream=`echo $band|awk -F '"max_bandwidth":' '{print $2}'|awk -F '"downstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - down_state="下行å¯ä»¥åŠ é€Ÿ" - kuainiao_old_downstream=$(expr $old_downstream / 1024) - kuainiao_max_downstream=$(expr $max_downstream / 1024) - logmore "kuainiao_old_downstream is $kuainiao_old_downstream" - logmore "kuainiao_max_downstream is $kuainiao_max_downstream" - else - down_state="下行ä¸æ»¡è¶³åŠ é€Ÿæ¡ä»¶" - #echo "T_T ä¸èƒ½åŠ é€Ÿå•Šï¼Œä¸æ»¡è¶³åŠ é€Ÿæ¡ä»¶å“¦~~" - log_down "$down_state" 0 - fi - echo $(date): "$down_state" >> $LOGFILE - # kuainiao_down_state=$down_state - - fi -} - -#æ£€æµ‹å¿«é¸Ÿä¸Šè¡ŒåŠ é€Ÿä¿¡æ¯ -get_upbandwidth(){ - logmore "upapi_url is $upapi_url" - if [ -n "$upapi_url" ]; then - [ -n "$upportal_port_temp" ] && [ -n "$upportal_port" ] && upbandwidth - band=$upwidth - logmore "upwidth is $upwidth" - can_upgrade=`echo $band|awk -F '"can_upgrade":' '{print $2}'|awk -F '[,}]' '{print $1}'` - kuainiao_can_upupgrade=$can_upgrade - updial_account=`echo $band|awk -F '"dial_account":"' '{print $2}'|awk -F '[,}"]' '{print $1}'` - kuainiao_dial_upaccount=$updial_account - logmore "can_upgrade is $can_upgrade" - logmore "kuainiao_can_upupgrade is $kuainiao_can_upupgrade" - logmore "updial_account is $updial_account" - logmore "kuainiao_dial_upaccount is $kuainiao_dial_upaccount" - #判断是å¦æ»¡è¶³åŠ é€Ÿæ¡ä»¶ - if [ "$can_upgrade" -eq 1 ]; then - #echo "迅雷快鸟å¯ä»¥åŠ é€Ÿ~~~愉快的开始加速å§~~" - #获å–åŠ é€Ÿè¯¦ç»†ä¿¡æ¯ - old_upstream=`echo $band|awk -F '"bandwidth":' '{print $2}'|awk -F '"upstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - max_upstream=`echo $band|awk -F '"max_bandwidth":' '{print $2}'|awk -F '"upstream":' '{print $2}'|awk -F '[,}]' '{print $1}'` - up_state="上行å¯ä»¥åŠ é€Ÿ" - kuainiao_old_upstream=$(expr $old_upstream / 1024) - kuainiao_max_upstream=$(expr $max_upstream / 1024) - logmore "kuainiao_old_upstream is $kuainiao_old_upstream" - logmore "kuainiao_max_upstream is $kuainiao_max_upstream" - else - up_state="上行ä¸æ»¡è¶³åŠ é€Ÿæ¡ä»¶" - log_up "$up_state" 0 - fi - echo "$(date): $up_state" >> $LOGFILE - kuainiao_up_state=$up_state - - fi -} - - -#æ£€æµ‹è¯•ç”¨åŠ é€Ÿä¿¡æ¯ -query_try_info(){ - info=`$HTTP_REQ "$api_url/query_try_info?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session"` - echo $info -} -##{"errno":0,"message":"","number_of_try":0,"richmessage":"","sequence":0,"timestamp":1455936922,"try_duration":10} - -query_try_upinfo(){ - info=`$HTTP_REQ "$upapi_url/query_try_info?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session"` - echo $info -} -##{"errno":0,"exp_day_len":0,"is_exp_day":0,"message":"","number_of_try":1,"richmessage":"","sequence":268435461,"timestamp":1493469390,"try_duration":10} - -get_upgrade_down(){ - _ts=`date +%s`000 - ret=`$HTTP_REQ "$api_url/upgrade?peerid=$peerid&userid=$uid&user_type=1&sessionid=$kuainiao_config_session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - errcode=`echo $ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" == "0" ]; then - down_state="$down_state (您的下行带宽已从$kuainiao_old_downstream Mæå‡åˆ°$kuainiao_max_downstream M)" - log_down "$down_state" 1 - else - down_state="$down_state 下行带宽æå‡å¤±è´¥ï¼Œè¯·æ£€æŸ¥å®½å¸¦è´¦å·æ˜¯å¦ç»‘定正确" - log_down "$down_state" 0 - fi - echo $(date): "$down_state" >> $LOGFILE - # kuainiao_down_state=$down_state -} - -get_upgrade_up(){ - _ts=`date +%s`000 - up_ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.0.0.1" "$upapi_url/upgrade?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$updial_account"` - errcode=`echo $up_ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" == "0" ] || [ "$errcode" == "812" ];then - up_state="$up_state (您的上行带宽已从$kuainiao_old_upstream Mæå‡åˆ°$kuainiao_max_upstream M)" - log_up "$up_state" 1 - else - up_state="$up_state 上行带宽æå‡å¤±è´¥ï¼Œè¯·æ£€æŸ¥å®½å¸¦è´¦å·æ˜¯å¦ç»‘定正确" - log_up "$up_state" 0 - fi - echo $(date): "$up_state" >> $LOGFILE - # kuainiao_up_state=$up_state - # echo "$kuainiao_up_state" > $up_state_file -} - -#迅雷快鸟上行加速心跳包 -keepalive_up(){ - _ts=`date +%s`000 - up_ret=`$HTTP_REQ --header "User-Agent:android-async-http/xl-acc-sdk/version-1.0.0.1" "$upapi_url/keepalive?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$kuainiao_dial_upaccount"` - errcode=`echo $up_ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" != "0" ];then - #kuainiao_run_upid=0 - kuainiao_up_state="迅雷上行æ速失效ï¼$(date '+%Y-%m-%d %H:%M:%S')" - kuainiao_run_upstatus=0 - log_up "$kuainiao_up_state" 0 - else - #kuainiao_run_upid=$(expr $kuainiao_run_upid + 1) - kuainiao_up_state="您的上行带宽已从${kuainiao_old_upstream}Mæå‡åˆ°${kuainiao_max_upstream}M $(date '+%Y-%m-%d %H:%M:%S')" - kuainiao_run_upstatus=1 - log_up "$kuainiao_up_state" 1 - fi -} - - -#检测æ速带宽 -bandwidth(){ - [ "$logmore" -eq 1 ] && { - echo $(date): "bandwidth start" >> $LOGFILE - echo $(date): "peerid is $peerid" >> $LOGFILE - echo $(date): "uid is $uid" >> $LOGFILE - echo $(date): "session is $session" >> $LOGFILE - } - _ts=`date +%s`000 - width=`$HTTP_REQ "$api_url/bandwidth?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $width -} -##{"bandwidth":{"downstream":51200,"upstream":0},"can_upgrade":1,"dial_account":"100001318645","errno":0,"max_bandwidth":{"downstream":102400,"upstream":0},"message":"","province":"bei_jing","province_name":"北京","richmessage":"","sequence":0,"sp":"cnc","sp_name":"è”通","timestamp":1455936922} - -upbandwidth(){ - _ts=`date +%s`000 - upwidth=`$HTTP_REQ "$upapi_url/bandwidth?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $upwidth -} - - -#迅雷快鸟下行加速心跳包 -keepalive_down(){ - _ts=`date +%s`000 - ret=`$HTTP_REQ "$api_url/keepalive?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - errcode=`echo $ret|awk -F '"errno":' '{print $2}'|awk -F '[,}"]' '{print $1}'` - if [ "$errcode" != "0" ];then - #kuainiao_run_upid=0 - kuainiao_down_state="迅雷下行æ速失效ï¼"$(date "+%Y-%m-%d %H:%M:%S") - log_down "$kuainiao_down_state" 0 - kuainiao_run_status=0 - else - #kuainiao_run_upid=$(expr $kuainiao_run_upid + 1) - kuainiao_down_state="您的下行带宽已从${kuainiao_old_downstream}Mæå‡åˆ°${kuainiao_max_downstream}M $(date '+%Y-%m-%d %H:%M:%S')" - log_down "$kuainiao_down_state" 1 - kuainiao_run_status=1 - - fi - echo $(date): "$kuainiao_down_state" >> $LOGFILE -} - -sigterm(){ - - [ "$kuainiao_can_upgrade" -eq 1 ] && kuainiao_recover - [ "$kuainiao_can_upupgrade" -eq 1 ] && kuainiao_uprecover - logmore "trap sigterm exit" - exit 0 - -} - -#快鸟加速注销 -kuainiao_recover(){ - _ts=`date +%s`000 - recover=`$HTTP_REQ "$api_url/recover?peerid=$peerid&userid=$uid&user_type=1&sessionid=$session&dial_account=$dial_account&client_type=android-swjsq-$app_version&client_version=androidswjsq-$app_version&os=android-5.0.1.24SmallRice&time_and=$_ts"` - #echo $recover - echo $(date): "快鸟下行带宽加速已注销" >> $LOGFILE -} - -kuainiao_uprecover(){ - _ts=`date +%s`000 - recover=`$HTTP_REQ "$upapi_url/recover?peerid=$peerid&userid=$uid&client_type=android-uplink-2.3.3.9&client_version=andrioduplink-2.3.3.9&os=android-7.0.24DUK-AL20&sessionid=$session&user_type=1&dial_account=$updial_account"` - #echo $recover - echo $(date): "快鸟上行带宽加速已注销" >> $LOGFILE -} - -#执行åˆå§‹åŒ– -kuainiao_init(){ - local kuainiao_last_act="" - local kuainiao_can_upgrade=0 - local kuainiao_can_upupgrade=0 - local kuainiao_down_state="" - local kuainiao_up_state="" -} - -##主逻辑 -trap 'sigterm' TERM -trap 'sigterm' INT - -kuainiao_init -config_load kuainiao -config_get_bool enabled base enabled 0 -config_get_bool kuainiao_downenable base enable_down 0 -config_get_bool kuainiao_upenable base enable_up 0 -config_get kuainiao_config_wan base speed_wan -config_get kuainiao_config_uname base kuainiao_name -config_get kuainiao_config_pwd base kuainiao_config_pwd - -[ "$enabled" -eq 0 ] || [ -z "$kuainiao_config_pwd" ] && exit 0 -[ "$kuainiao_downenable" -eq 0 ] && [ "$kuainiao_upenable" -eq 0 ] && exit 0 -[ -z "$kuainiao_config_uname" ] && exit 0 - -logmore "enabled is $enabled" -logmore "kuainiao_downenable is $kuainiao_downenable" -logmore "kuainiao_upenable is $kuainiao_upenable" -logmore "kuainiao_config_wan is $kuainiao_config_wan" -logmore "kuainiao_config_uname is $kuainiao_config_uname" -logmore "kuainiao_config_pwd is $kuainiao_config_pwd" - -if [ "$kuainiao_downenable" -eq 1 ] || [ "$kuainiao_upenable" -eq 1 ]; then - - logmore "å¯åŠ¨å»¶æ—¶ 7s" - sleep 7s - - #登陆迅雷获å–uid - logmore "get_bind_address start" - get_bind_address - logmore "bind_address is $bind_address" - logmore "get_mac_addr start" - get_mac_addr - logmore "peerid is $peerid" - logmore "get_xunlei_uid start" - get_xunlei_uid - logmore "get_xunlei_uid is done" - logmore "id is $uid" - #判断是å¦ç™»é™†æˆåŠŸ - if [ -n "$uid" ]; then - if [ "$kuainiao_downenable" -eq 1 ]; then - logmore "get_kuainiao_api is started......." - get_kuainiao_api - logmore "get_bandwidth is started......." - get_bandwidth - kuainiao_config_downstream=$(expr $old_downstream / 1024) - kuainiao_config_max_downstream=$(expr $max_downstream / 1024) - logmore "kuainiao_config_downstream is $kuainiao_config_downstream" - logmore "kuainiao_config_max_downstream is $kuainiao_config_max_downstream" - logmore "kuainiao_can_upgrade is $kuainiao_can_upgrade" - - if [ "$kuainiao_can_upgrade" -eq 1 ]; then - logmore "get_upgrade_down is started......." - get_upgrade_down - logmore "get_upgrade_down is done......." - sleep 1s - #keepalive_down - fi - fi - if [ "$kuainiao_upenable" -eq 1 ]; then - logmore "get_kuainiao_upapi start" - get_kuainiao_upapi - logmore "get_upbandwidth start" - get_upbandwidth - kuainiao_config_upstream=$(expr $old_upstream / 1024) - kuainiao_config_max_upstream=$(expr $max_upstream / 1024) - logmore "kuainiao_config_upstream is $kuainiao_config_upstream" - logmore "kuainiao_config_max_upstream is $kuainiao_config_max_upstream" - logmore "kuainiao_can_upupgrade is $kuainiao_can_upupgrade" - - if [ "$kuainiao_can_upupgrade" -eq 1 ]; then - logmore "get_upgrade_up start" - get_upgrade_up - sleep 1s - #keepalive_up - fi - fi - fi -fi - -# [ -z "$kuainiao_can_upgrade" ] && [ -z "$kuainiao_can_upupgrade" ] && { - # logmore "exit kuainiao...." - # sleep 7s - # echo "暂无加速信æ¯" > $down_state_file - # echo "暂无加速信æ¯" > $up_state_file - # exit 0 - -# } -while true; -do - sleep 295s - if [ "$kuainiao_downenable" -eq 1 ] && [ "$kuainiao_can_upgrade" -eq 1 ];then - keepalive_down - [ "$kuainiao_run_status" -eq 0 ] && restart_kuainiao - fi - if [ "$kuainiao_upenable" -eq 1 ] && [ "$kuainiao_can_upupgrade" -eq 1 ];then - keepalive_up - [ "$kuainiao_run_upstatus" -eq 0 ] && restart_kuainiao - fi -done - - -restart_kuainiao(){ - kuainiao_init - config_load kuainiao - config_get_bool enabled base enabled 0 - config_get_bool kuainiao_downenable base enable_down 0 - config_get_bool kuainiao_upenable base enable_up 0 - config_get kuainiao_config_wan base speed_wan - config_get kuainiao_config_uname base kuainiao_name - config_get kuainiao_config_pwd base kuainiao_config_pwd - - if [ "$kuainiao_downenable" -eq 1 ] || [ "$kuainiao_upenable" -eq 1 ]; then - logmore "å¯åŠ¨å»¶æ—¶ 7s" - sleep 7s - - #登陆迅雷获å–uid - logmore "get_bind_address start" - get_bind_address - logmore "bind_address is $bind_address" - logmore "get_mac_addr start" - get_mac_addr - logmore "peerid is $peerid" - logmore "get_xunlei_uid start" - get_xunlei_uid - logmore "get_xunlei_uid is done" - logmore "id is $uid" - #判断是å¦ç™»é™†æˆåŠŸ - if [ -n "$uid" ]; then - if [ "$kuainiao_downenable" -eq 1 ]; then - logmore "get_kuainiao_api is started......." - get_kuainiao_api - logmore "get_bandwidth is started......." - get_bandwidth - kuainiao_config_downstream=$(expr $old_downstream / 1024) - kuainiao_config_max_downstream=$(expr $max_downstream / 1024) - if [ "$kuainiao_can_upgrade" -eq 1 ]; then - [ "$logmore" -eq 1 ] && logmore "get_upgrade_down is started......." - get_upgrade_down - logmore "get_upgrade_down is done......." - sleep 1s - #keepalive_down - fi - fi - if [ "$kuainiao_upenable" -eq 1 ]; then - logmore "get_kuainiao_upapi start" - get_kuainiao_upapi - logmore "get_upbandwidth start" - get_upbandwidth - kuainiao_config_upstream=$(expr $old_upstream / 1024) - kuainiao_config_max_upstream=$(expr $max_upstream / 1024) - if [ "$kuainiao_can_upupgrade" -eq 1 ]; then - logmore "get_upgrade_up start" - get_upgrade_up - sleep 1s - #keepalive_up - fi - fi - fi - #add_kuainiao_cru - fi - [ -z "$kuainiao_can_upgrade" ] && [ -z "$kuainiao_can_upupgrade" ] && { - logmore "exit kuainiao...." - sleep 7s - echo "暂无加速信æ¯" > $down_state_file - echo "暂无加速信æ¯" > $up_state_file - exit 0 - } -} diff --git a/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply b/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply deleted file mode 100755 index ce48ef893..000000000 --- a/package/lean/luci-app-kuainiao/root/usr/bin/luci_kuainiao_apply +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -enabled=`uci get kuainiao.base.enabled` - -if [ "$enabled" -eq 0 ]; then - /etc/init.d/kuainiao stop - /etc/init.d/kuainiao disable -else - /etc/init.d/kuainiao stop - /etc/init.d/kuainiao start - /etc/init.d/kuainiao enable -fi \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state b/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state deleted file mode 100644 index f01ccd0f0..000000000 --- a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_down_state +++ /dev/null @@ -1 +0,0 @@ -æš‚æ— åŠ é€Ÿä¿¡æ¯ \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state b/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state deleted file mode 100644 index f01ccd0f0..000000000 --- a/package/lean/luci-app-kuainiao/root/usr/share/kuainiao/kuainiao_up_state +++ /dev/null @@ -1 +0,0 @@ -æš‚æ— åŠ é€Ÿä¿¡æ¯ \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js b/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js deleted file mode 100644 index c1d09a94d..000000000 --- a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/md5.js +++ /dev/null @@ -1 +0,0 @@ -var md5; md5 || (md5 = function(){function i(a,b){a[b>>5]|=128<>>9<<4)+14]=b;for(var c=1732584193,d=-271733879,e=-1732584194,f=271733878,g=0;a.length>g;g+=16){var h=c,i=d,j=e,o=f;c=k(c,d,e,f,a[g+0],7,-680876936),f=k(f,c,d,e,a[g+1],12,-389564586),e=k(e,f,c,d,a[g+2],17,606105819),d=k(d,e,f,c,a[g+3],22,-1044525330),c=k(c,d,e,f,a[g+4],7,-176418897),f=k(f,c,d,e,a[g+5],12,1200080426),e=k(e,f,c,d,a[g+6],17,-1473231341),d=k(d,e,f,c,a[g+7],22,-45705983),c=k(c,d,e,f,a[g+8],7,1770035416),f=k(f,c,d,e,a[g+9],12,-1958414417),e=k(e,f,c,d,a[g+10],17,-42063),d=k(d,e,f,c,a[g+11],22,-1990404162),c=k(c,d,e,f,a[g+12],7,1804603682),f=k(f,c,d,e,a[g+13],12,-40341101),e=k(e,f,c,d,a[g+14],17,-1502002290),d=k(d,e,f,c,a[g+15],22,1236535329),c=l(c,d,e,f,a[g+1],5,-165796510),f=l(f,c,d,e,a[g+6],9,-1069501632),e=l(e,f,c,d,a[g+11],14,643717713),d=l(d,e,f,c,a[g+0],20,-373897302),c=l(c,d,e,f,a[g+5],5,-701558691),f=l(f,c,d,e,a[g+10],9,38016083),e=l(e,f,c,d,a[g+15],14,-660478335),d=l(d,e,f,c,a[g+4],20,-405537848),c=l(c,d,e,f,a[g+9],5,568446438),f=l(f,c,d,e,a[g+14],9,-1019803690),e=l(e,f,c,d,a[g+3],14,-187363961),d=l(d,e,f,c,a[g+8],20,1163531501),c=l(c,d,e,f,a[g+13],5,-1444681467),f=l(f,c,d,e,a[g+2],9,-51403784),e=l(e,f,c,d,a[g+7],14,1735328473),d=l(d,e,f,c,a[g+12],20,-1926607734),c=m(c,d,e,f,a[g+5],4,-378558),f=m(f,c,d,e,a[g+8],11,-2022574463),e=m(e,f,c,d,a[g+11],16,1839030562),d=m(d,e,f,c,a[g+14],23,-35309556),c=m(c,d,e,f,a[g+1],4,-1530992060),f=m(f,c,d,e,a[g+4],11,1272893353),e=m(e,f,c,d,a[g+7],16,-155497632),d=m(d,e,f,c,a[g+10],23,-1094730640),c=m(c,d,e,f,a[g+13],4,681279174),f=m(f,c,d,e,a[g+0],11,-358537222),e=m(e,f,c,d,a[g+3],16,-722521979),d=m(d,e,f,c,a[g+6],23,76029189),c=m(c,d,e,f,a[g+9],4,-640364487),f=m(f,c,d,e,a[g+12],11,-421815835),e=m(e,f,c,d,a[g+15],16,530742520),d=m(d,e,f,c,a[g+2],23,-995338651),c=n(c,d,e,f,a[g+0],6,-198630844),f=n(f,c,d,e,a[g+7],10,1126891415),e=n(e,f,c,d,a[g+14],15,-1416354905),d=n(d,e,f,c,a[g+5],21,-57434055),c=n(c,d,e,f,a[g+12],6,1700485571),f=n(f,c,d,e,a[g+3],10,-1894986606),e=n(e,f,c,d,a[g+10],15,-1051523),d=n(d,e,f,c,a[g+1],21,-2054922799),c=n(c,d,e,f,a[g+8],6,1873313359),f=n(f,c,d,e,a[g+15],10,-30611744),e=n(e,f,c,d,a[g+6],15,-1560198380),d=n(d,e,f,c,a[g+13],21,1309151649),c=n(c,d,e,f,a[g+4],6,-145523070),f=n(f,c,d,e,a[g+11],10,-1120210379),e=n(e,f,c,d,a[g+2],15,718787259),d=n(d,e,f,c,a[g+9],21,-343485551),c=p(c,h),d=p(d,i),e=p(e,j),f=p(f,o)}return[c,d,e,f]}function j(a,b,c,d,e,f){return p(q(p(p(b,a),p(d,f)),e),c)}function k(a,b,c,d,e,f,g){return j(b&c|~b&d,a,b,e,f,g)}function l(a,b,c,d,e,f,g){return j(b&d|c&~d,a,b,e,f,g)}function m(a,b,c,d,e,f,g){return j(b^c^d,a,b,e,f,g)}function n(a,b,c,d,e,f,g){return j(c^(b|~d),a,b,e,f,g)}function p(a,b){var c=(a&65535)+(b&65535),d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535}function q(a,b){return a<>>32-b}function r(a){for(var b=[],d=(1<e;e+=c)b[e>>5]|=(a.charCodeAt(e/c)&d)<e;e++)d+=c.charAt(b[e>>2]>>e%4*8+4&15)+c.charAt(b[e>>2]>>e%4*8&15);return d}var a=0,c=8;return function(a){return t(i(r(a),a.length*c))}}()); \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js b/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js deleted file mode 100644 index 11014f81d..000000000 --- a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/sha1.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined - * in FIPS PUB 180-1 - * Version 2.1a Copyright Paul Johnston 2000 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * See http://pajhome.org.uk/crypt/md5 for details. - */ - -/* - * Configurable variables. You may need to tweak these to be compatible with - * the server-side, but the defaults work in most cases. - */ -var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */ -var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */ -var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */ - -/* - * These are the functions you'll usually want to call - * They take string arguments and return either hex or base-64 encoded strings - */ -function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));} -function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));} -function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));} -function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));} -function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));} -function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));} - -/* - * Perform a simple self-test to see if the VM is working - */ -function sha1_vm_test() -{ - return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d"; -} - -/* - * Calculate the SHA-1 of an array of big-endian words, and a bit length - */ -function core_sha1(x, len) -{ - /* append padding */ - x[len >> 5] |= 0x80 << (24 - len % 32); - x[((len + 64 >> 9) << 4) + 15] = len; - - var w = Array(80); - var a = 1732584193; - var b = -271733879; - var c = -1732584194; - var d = 271733878; - var e = -1009589776; - - for(var i = 0; i < x.length; i += 16) - { - var olda = a; - var oldb = b; - var oldc = c; - var oldd = d; - var olde = e; - - for(var j = 0; j < 80; j++) - { - if(j < 16) w[j] = x[i + j]; - else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1); - var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)), - safe_add(safe_add(e, w[j]), sha1_kt(j))); - e = d; - d = c; - c = rol(b, 30); - b = a; - a = t; - } - - a = safe_add(a, olda); - b = safe_add(b, oldb); - c = safe_add(c, oldc); - d = safe_add(d, oldd); - e = safe_add(e, olde); - } - return Array(a, b, c, d, e); - -} - -/* - * Perform the appropriate triplet combination function for the current - * iteration - */ -function sha1_ft(t, b, c, d) -{ - if(t < 20) return (b & c) | ((~b) & d); - if(t < 40) return b ^ c ^ d; - if(t < 60) return (b & c) | (b & d) | (c & d); - return b ^ c ^ d; -} - -/* - * Determine the appropriate additive constant for the current iteration - */ -function sha1_kt(t) -{ - return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 : - (t < 60) ? -1894007588 : -899497514; -} - -/* - * Calculate the HMAC-SHA1 of a key and some data - */ -function core_hmac_sha1(key, data) -{ - var bkey = str2binb(key); - if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz); - - var ipad = Array(16), opad = Array(16); - for(var i = 0; i < 16; i++) - { - ipad[i] = bkey[i] ^ 0x36363636; - opad[i] = bkey[i] ^ 0x5C5C5C5C; - } - - var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz); - return core_sha1(opad.concat(hash), 512 + 160); -} - -/* - * Add integers, wrapping at 2^32. This uses 16-bit operations internally - * to work around bugs in some JS interpreters. - */ -function safe_add(x, y) -{ - var lsw = (x & 0xFFFF) + (y & 0xFFFF); - var msw = (x >> 16) + (y >> 16) + (lsw >> 16); - return (msw << 16) | (lsw & 0xFFFF); -} - -/* - * Bitwise rotate a 32-bit number to the left. - */ -function rol(num, cnt) -{ - return (num << cnt) | (num >>> (32 - cnt)); -} - -/* - * Convert an 8-bit or 16-bit string to an array of big-endian words - * In 8-bit function, characters >255 have their hi-byte silently ignored. - */ -function str2binb(str) -{ - var bin = Array(); - var mask = (1 << chrsz) - 1; - for(var i = 0; i < str.length * chrsz; i += chrsz) - bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (32 - chrsz - i%32); - return bin; -} - -/* - * Convert an array of big-endian words to a string - */ -function binb2str(bin) -{ - var str = ""; - var mask = (1 << chrsz) - 1; - for(var i = 0; i < bin.length * 32; i += chrsz) - str += String.fromCharCode((bin[i>>5] >>> (32 - chrsz - i%32)) & mask); - return str; -} - -/* - * Convert an array of big-endian words to a hex string. - */ -function binb2hex(binarray) -{ - var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i++) - { - str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + - hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF); - } - return str; -} - -/* - * Convert an array of big-endian words to a base-64 string - */ -function binb2b64(binarray) -{ - var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - var str = ""; - for(var i = 0; i < binarray.length * 4; i += 3) - { - var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16) - | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 ) - | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF); - for(var j = 0; j < 4; j++) - { - if(i * 8 + j * 6 > binarray.length * 32) str += b64pad; - else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F); - } - } - return str; -} diff --git a/package/lean/luci-app-xlnetacc/Makefile b/package/lean/luci-app-xlnetacc/Makefile new file mode 100644 index 000000000..95626f913 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/Makefile @@ -0,0 +1,71 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=luci-app-xlnetacc +PKG_VERSION:=1.0.0 +PKG_RELEASE:=3 + +PKG_LICENSE:=GPLv2 +PKG_MAINTAINER:=Sense + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=LuCI Support for XLNetAcc + PKGARCH:=all + DEPENDS:=+wget +openssl-util +endef + +define Package/$(PKG_NAME)/description + LuCI Support for XLNetAcc. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/$(PKG_NAME)/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + ( . /etc/uci-defaults/luci-xlnetacc ) && rm -f /etc/uci-defaults/luci-xlnetacc +fi +exit 0 +endef + +define Package/$(PKG_NAME)/conffiles + /etc/config/xlnetacc +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/xlnetacc.*.lmo $(1)/usr/lib/lua/luci/i18n/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/*.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/view/xlnetacc + $(INSTALL_DATA) ./files/luci/view/xlnetacc/*.htm $(1)/usr/lib/lua/luci/view/xlnetacc/ + $(INSTALL_DIR) $(1)/www/luci-static/resources/xlnetacc + $(INSTALL_DATA) ./files/luci/luci-static/resources/xlnetacc/*.js $(1)/www/luci-static/resources/xlnetacc/ + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_CONF) ./files/root/etc/config/xlnetacc $(1)/etc/config/xlnetacc + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/root/etc/init.d/xlnetacc $(1)/etc/init.d/xlnetacc + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_BIN) ./files/root/etc/uci-defaults/luci-xlnetacc $(1)/etc/uci-defaults/luci-xlnetacc + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/root/usr/bin/xlnetacc.sh $(1)/usr/bin/xlnetacc.sh +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua b/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua new file mode 100644 index 000000000..65fbcb921 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/controller/xlnetacc.lua @@ -0,0 +1,47 @@ +module("luci.controller.xlnetacc", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/xlnetacc") then + return + end + + entry({"admin", "services", "xlnetacc"}, + firstchild(), _("XLNetAcc")).dependent = false + + entry({"admin", "services", "xlnetacc", "general"}, + cbi("xlnetacc"), _("Settings"), 1) + + entry({"admin", "services", "xlnetacc", "log"}, + template("xlnetacc/logview"), _("Log"), 2) + + entry({"admin", "services", "xlnetacc", "status"}, call("action_status")) + entry({"admin", "services", "xlnetacc", "logdata"}, call("action_log")) +end + +local function is_running(name) + return luci.sys.call("pidof %s >/dev/null" %{name}) == 0 +end + +function action_status() + luci.http.prepare_content("application/json") + luci.http.write_json({ + run_state = is_running("xlnetacc.sh"), + down_state = nixio.fs.readfile("/var/state/xlnetacc_down_state") or "", + up_state = nixio.fs.readfile("/var/state/xlnetacc_up_state") or "" + }) +end + +function action_log() + local uci = require "luci.model.uci".cursor() + local util = require "luci.util" + local log_data = { } + + log_data.syslog = util.trim(util.exec("logread | grep xlnetacc")) + if uci:get("xlnetacc", "general", "logging") ~= "0" then + log_data.client = nixio.fs.readfile("/var/log/xlnetacc.log") or "" + end + uci:unload("xlnetacc") + + luci.http.prepare_content("application/json") + luci.http.write_json(log_data) +end diff --git a/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo b/package/lean/luci-app-xlnetacc/files/luci/i18n/xlnetacc.zh-cn.lmo new file mode 100644 index 0000000000000000000000000000000000000000..b0598e96332e5d7e96c38bcafdeae3497e9f721e GIT binary patch literal 1188 zcmZWnZ)j6j9KG2johD3)jEUkXqLe|cewmIcwF<6oY)tH?So=W{w4#VqP{D2{#U|Nn zn>?2^?b1S0W7=5ld+Bt|GtD!_Rj{^9LV&q}gCY#i71*zzzl1h~>BP$wWoVK``FF`$NJ$zbIob2LN!*iJm z?ONJL6^RPx^1@)4e&%$|Og|eTL{l1}n?+0)j|uO^ z%sQIVOHjL`$D|yG>sf2m%-6D=%q0^-BWc!g(VT>eGS);a;{?p_HXEDmhFH#TPH#v_ zs^y>+Bm*MWp`JJ2Ba0E>l3Wa$3h;O z3r}a7(3=VgD*6mh4**jd^z&)lDHWpdAdcHN&DcA7g*8k01F4gY+&nh?t(JeyOx*dG(0;bxQ{yVe>`nTZo9R-2!j}88|3;H?kU--w` zbX{hu0J@XwD@y0M`iD2Khh7YBFM1I@sTM3R1OF1-T5KI(^;O-=I{3@M?ca%A`{OG@ zpMZmH`iO9$QlOq)}S$h5kd1uiID} z_|emec@}`Lj@^4x-u`**7U;S8r0Q4K_l#5)LgV+-F;X-(T%6d#?{k#<{~B{I6DA*g z27DjKare`&PZX}XRs16){e=binl_md5(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binl_md5(a.concat(rstr2binl(f)),512+f.length*8);return binl2rstr(binl_md5(d.concat(g),512+128))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binl(b){var a=Array(b.length>>2);for(var c=0;c>5]|=(b.charCodeAt(c/8)&255)<<(c%32)}return a}function binl2rstr(b){var a="";for(var c=0;c>5]>>>(c%32))&255)}return a}function binl_md5(p,k){p[k>>5]|=128<<((k)%32);p[(((k+64)>>>9)<<4)+14]=k;var o=1732584193;var n=-271733879;var m=-1732584194;var l=271733878;for(var g=0;g>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<>>(32-b))}; \ No newline at end of file diff --git a/package/lean/luci-app-kuainiao/root/www/luci-static/resources/rsa.js b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/rsa.js similarity index 100% rename from package/lean/luci-app-kuainiao/root/www/luci-static/resources/rsa.js rename to package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/rsa.js diff --git a/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js new file mode 100644 index 000000000..cb5544618 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/luci-static/resources/xlnetacc/sha1-min.js @@ -0,0 +1,9 @@ +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS 180-1 + * Version 2.2 Copyright Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ +var hexcase=0;var b64pad="";function hex_sha1(a){return rstr2hex(rstr_sha1(str2rstr_utf8(a)))}function hex_hmac_sha1(a,b){return rstr2hex(rstr_hmac_sha1(str2rstr_utf8(a),str2rstr_utf8(b)))}function sha1_vm_test(){return hex_sha1("abc").toLowerCase()=="a9993e364706816aba3e25717850c26c9cd0d89d"}function rstr_sha1(a){return binb2rstr(binb_sha1(rstr2binb(a),a.length*8))}function rstr_hmac_sha1(c,f){var e=rstr2binb(c);if(e.length>16){e=binb_sha1(e,c.length*8)}var a=Array(16),d=Array(16);for(var b=0;b<16;b++){a[b]=e[b]^909522486;d[b]=e[b]^1549556828}var g=binb_sha1(a.concat(rstr2binb(f)),512+f.length*8);return binb2rstr(binb_sha1(d.concat(g),512+160))}function rstr2hex(c){try{hexcase}catch(g){hexcase=0}var f=hexcase?"0123456789ABCDEF":"0123456789abcdef";var b="";var a;for(var d=0;d>>4)&15)+f.charAt(a&15)}return b}function str2rstr_utf8(c){var b="";var d=-1;var a,e;while(++d>>6)&31),128|(a&63))}else{if(a<=65535){b+=String.fromCharCode(224|((a>>>12)&15),128|((a>>>6)&63),128|(a&63))}else{if(a<=2097151){b+=String.fromCharCode(240|((a>>>18)&7),128|((a>>>12)&63),128|((a>>>6)&63),128|(a&63))}}}}}return b}function rstr2binb(b){var a=Array(b.length>>2);for(var c=0;c>5]|=(b.charCodeAt(c/8)&255)<<(24-c%32)}return a}function binb2rstr(b){var a="";for(var c=0;c>5]>>>(24-c%32))&255)}return a}function binb_sha1(v,o){v[o>>5]|=128<<(24-o%32);v[((o+64>>9)<<4)+15]=o;var y=Array(80);var u=1732584193;var s=-271733879;var r=-1732584194;var q=271733878;var p=-1009589776;for(var l=0;l>16)+(d>>16)+(c>>16);return(b<<16)|(c&65535)}function bit_rol(a,b){return(a<>>(32-b))}; \ No newline at end of file diff --git a/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua b/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua new file mode 100644 index 000000000..3408a1ff9 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/model/cbi/xlnetacc.lua @@ -0,0 +1,40 @@ +local m, s, o +local uci = luci.model.uci.cursor() + +m = Map("xlnetacc", "%s - %s" %{translate("XLNetAcc"), translate("Settings")}, translate("XLNetAcc is a Thunder joint broadband operators launched a commitment to help users solve the low broadband, slow Internet access, poor Internet experience of professional-grade broadband upgrade software.")) +m:append(Template("xlnetacc/status")) + +s = m:section(NamedSection, "general", "general", translate("General Settings")) +s.anonymous = true +s.addremove = false + +o = s:option(Flag, "enabled", translate("Enabled")) +o.rmempty = false + +o = s:option(Flag, "down_acc", translate("Enable DownLink Upgrade")) + +o = s:option(Flag, "up_acc", translate("Enable UpLink Upgrade")) + +o = s:option(Flag, "logging", translate("Enable Logging")) +o.default = "1" + +o = s:option(Flag, "verbose", translate("Enable verbose logging")) +o:depends("logging", "1") + +o = s:option(ListValue, "network", translate("Upgrade interface")) +uci:foreach("network", "interface", function(section) + if section[".name"] ~= "loopback" and section[".name"] ~= "lan" then + o:value(section[".name"]) + end +end) + +o = s:option(Value, "account", translate("XLNetAcc account")) + +o = s:option(Value, "password", translate("XLNetAcc password"), translate("Does not store the plaintext password, automatically emptied after start.")) +o.password = true +o.template = "xlnetacc/rsa" + +o = s:option(Value, "encrypt", translate("Encrypted password"), translate("Auto-generate in accordance with the plaintext password, do not modify it!")) +--o.readonly = true + +return m diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm new file mode 100644 index 000000000..a07a27112 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/logview.htm @@ -0,0 +1,49 @@ +<% css = [[ + #log_text { + padding: 10px; + text-align: left; + height: 500px; + overflow: auto; + } + #log_text pre { + word-break: break-all; + margin: 0; + } + .description { + color: #ffffff; + background-color: #0099ff; + } +]] +%> + +<%+header%> + +
+

<%:XLNetAcc%> - <%:Log Data%>

+
+
+
<%:Loading...%><%:Collecting data...%>
+
<%:Refresh every 5 seconds.%>
+
+
+
+ + + + +<%+footer%> diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm new file mode 100644 index 000000000..b79dbf11a --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/rsa.htm @@ -0,0 +1,41 @@ + + + + + + +<%+cbi/valueheader%> + 0, "data-choices", { self.keylist, self.vallist }) + %> onchange="onchange_rsa(this.id)" /> + <% if self.password then %><% end %> +<%+cbi/valuefooter%> diff --git a/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm new file mode 100644 index 000000000..4af0731d0 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/luci/view/xlnetacc/status.htm @@ -0,0 +1,21 @@ +
+ <%:Running Status%> + + + + +
<%:XLNetAcc Running Status%><%:Collecting data...%>
<%:DownLink Upgrade Status%><%:Collecting data...%>
<%:UpLink Upgrade Status%><%:Collecting data...%>
+
+ + diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc new file mode 100644 index 000000000..4345070c4 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/config/xlnetacc @@ -0,0 +1,5 @@ + +config general 'general' + option enabled '0' + option network 'wan' + diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc new file mode 100755 index 000000000..f4ffef0a2 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/init.d/xlnetacc @@ -0,0 +1,44 @@ +#!/bin/sh /etc/rc.common + +START=95 +STOP=10 +SERVICE_DAEMONIZE=1 + +NAME=xlnetacc + +start() { + pidof "${NAME}.sh" >/dev/null 2>&1 && return + + config_load "$NAME" + config_get_bool enabled "general" "enabled" 0 + config_get_bool down_acc "general" "down_acc" 0 + config_get_bool up_acc "general" "up_acc" 0 + config_get network "general" "network" + config_get account "general" "account" + config_get encrypt "general" "encrypt" + ( [ $enabled -eq 0 ] || [ $down_acc -eq 0 -a $up_acc -eq 0 ] || [ -z "$account" -o -z "$encrypt" -o -z "$network" ] ) && return + + logger -p "daemon.notice" -t "$NAME" "XLNetAcc is starting ..." + service_start /usr/bin/${NAME}.sh --start +} + +stop() { + pidof "${NAME}.sh" >/dev/null 2>&1 || return + + local pid spid + for pid in $(pidof "${NAME}.sh"); do + kill $pid >/dev/null 2>&1 + echo "Stop XLNetAcc process PID: $pid" + for spid in $(pgrep -P $pid "sleep"); do + kill $spid >/dev/null 2>&1 + echo "Stop XLNetAcc process SPID: $spid" + done + done + logger -p "daemon.notice" -t "$NAME" "XLNetAcc has stoped." +} + +restart() { + stop + sleep 1 + start +} diff --git a/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc b/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc new file mode 100755 index 000000000..632c02678 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/etc/uci-defaults/luci-xlnetacc @@ -0,0 +1,22 @@ +#!/bin/sh + +uci -q batch <<-EOF >/dev/null + delete ucitrack.@xlnetacc[-1] + add ucitrack xlnetacc + set ucitrack.@xlnetacc[-1].init=xlnetacc + commit ucitrack +EOF + +general=$(uci -q get xlnetacc.@general[-1]) +if [ -z "$general" ]; then + uci -q add xlnetacc general +fi +if [ "$general"x != "general"x ]; then + uci -q batch <<-EOF >/dev/null + rename xlnetacc.@general[-1]="general" + commit xlnetacc + EOF +fi + +rm -rf /tmp/luci-indexcache /tmp/luci-modulecache +exit 0 diff --git a/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh b/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh new file mode 100644 index 000000000..61e938e9f --- /dev/null +++ b/package/lean/luci-app-xlnetacc/files/root/usr/bin/xlnetacc.sh @@ -0,0 +1,512 @@ +#!/bin/sh + +# å£°æ˜Žå¸¸é‡ +readonly appName='com.xunlei.vip.swjsq' +readonly protocolVersion=108 +readonly sdkVersion=17550 +readonly agentVersion='1.6.1.177600' +readonly client_type_down='android-swjsq' +readonly client_version_down='2.0.3.4' +readonly client_type_up='android-uplink' +readonly client_version_up='2.3.3.9' +readonly client_os='android-7.0.24DUK-AL20' + +# 声明全局å˜é‡ +_http_cmd= +_http_args= +_devicesign= +_peerid= +_userid= +_sessionid= +_api_url_down= +_api_url_up= +_dial_account_down= +_dial_account_up= +_cur_down= +_max_down= +_cur_up= +_max_up= +access_url= +msg_to_en= +msg_to_cn= + +# 包å«ç”¨äºŽè§£æž JSON æ ¼å¼è¿”回值的函数 +. /usr/share/libubox/jshn.sh + +# è¯»å– UCI 设置相关函数 +uci_get_by_name() { + local ret=$(uci get $NAME.$1.$2 2> /dev/null) + echo -n ${ret:=$3} +} +uci_get_by_type() { + local ret=$(uci get $NAME.@$1[-1].$2 2> /dev/null) + echo -n ${ret:=$3} +} +uci_get_by_bool() { + case $(uci_get_by_name "$1" "$2" "$3") in + 1|on|true|yes|enabled) echo -n 1;; + *) echo -n 0;; + esac +} + +# 日志和状æ€æ è¾“出。1 日志文件, 2 系统日志, 4 详细模å¼, 8 下行状æ€æ , 16 上行状æ€æ , 32 å¤±è´¥çŠ¶æ€ +_log() { + local msg=$1 + local flag=$2 + [ -z "$msg" ] && return + [ -z "$flag" ] && flag=1 + local timestamp=$(date +'%Y/%m/%d %H:%M:%S') + + [ $logging -eq 0 -a $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 )) + if [ $verbose -eq 0 -a $(( $flag & 4 )) -ne 0 ]; then + [ $(( $flag & 1 )) -ne 0 ] && flag=$(( $flag ^ 1 )) + [ $(( $flag & 2 )) -ne 0 ] && flag=$(( $flag ^ 2 )) + fi + if [ $down_acc -eq 0 -a $(( $flag & 8 )) -ne 0 ]; then + flag=$(( $flag ^ 8 )) + [ $up_acc -ne 0 ] && flag=$(( $flag | 16 )) + fi + if [ $up_acc -eq 0 -a $(( $flag & 16 )) -ne 0 ]; then + flag=$(( $flag ^ 16 )) + [ $down_acc -ne 0 ] && flag=$(( $flag | 8 )) + fi + + [ $(( $flag & 1 )) -ne 0 ] && echo "$timestamp $msg" >> $LOGFILE 2> /dev/null + [ $(( $flag & 2 )) -ne 0 ] && logger -p "daemon.info" -t "$NAME" "$msg" + + [ $(( $flag & 32 )) -eq 0 ] && local color="green" || local color="red" + [ $(( $flag & 8 )) -ne 0 ] && echo -n "$timestamp $msg" > $down_state_file 2> /dev/null + [ $(( $flag & 16 )) -ne 0 ] && echo -n "$timestamp $msg" > $up_state_file 2> /dev/null +} + +# 清ç†æ—¥å¿— +clean_log() { + [ $logging -eq 1 -a -f "$LOGFILE" ] || return + if [ $(wc -l "$LOGFILE" | awk '{print $1}') -gt 500 ]; then + _log "清ç†æ—¥å¿—文件" + local logdata=$(tail -n 300 "$LOGFILE") + echo "$logdata" > $LOGFILE 2> /dev/null + unset logdata + fi +} + +# 获å–接å£IPåœ°å€ +get_acc_ip() { + local acc_ipaddr + json_cleanup; json_load "$(ubus call network.interface.$network status 2> /dev/null)" >/dev/null 2>&1 + json_select "ipv4-address" >/dev/null 2>&1; json_select 1 >/dev/null 2>&1 + json_get_var acc_ipaddr "address" + [ -z "$acc_ipaddr" ] && { _log "获å–网络 $network IP地å€å‡ºé”™"; return; } + _log "acc_ipaddr is $acc_ipaddr" $(( 1 | 4 )) + + if [ "$acc_ipaddr" != "0.0.0.0" ]; then + _log "绑定IP地å€: $acc_ipaddr" + echo -n "$acc_ipaddr" + fi +} + +# 定义基本 HTTP 命令和å‚æ•° +gen_http_cmd() { + _http_cmd="wget-ssl -nv -t 1 -O - --no-check-certificate" + _http_cmd="$_http_cmd --bind-address=$1" + _http_cmd="$_http_cmd --user-agent=android-async-http/xl-acc-sdk/version-$agentVersion" + _log "_http_cmd is $_http_cmd" $(( 1 | 4 )) +} + +# 生æˆè®¾å¤‡ç­¾å +gen_device_sign() { + local ifname macaddr + while : ; do + ifname=$(uci get "network.$network.ifname" 2> /dev/null) + [ "${ifname:0:1}" == "@" ] && network="${ifname:1}" || break + done + [ -z "$ifname" ] && { _log "获å–网络 $network ä¿¡æ¯å‡ºé”™"; return; } + json_cleanup; json_load "$(ubus call network.device status {\"name\":\"$ifname\"} 2> /dev/null)" >/dev/null 2>&1 + json_get_var macaddr "macaddr" + [ -z "$macaddr" ] && { _log "获å–网络 $network MAC地å€å‡ºé”™"; return; } + macaddr=$(echo -n "$macaddr" | awk '{print toupper($0)}') + + # æ ¹æ®MAC地å€ç”Ÿæˆpeerid + readonly _peerid="${macaddr//:/}004V" + _log "_peerid is $_peerid" $(( 1 | 4 )) + + # æ ¹æ®MAC地å€ç”Ÿæˆdevicesign + local xlnetacc_vip="${appName}68700d1872b772946a6940e4b51827e8af" + local fake_device_id_md5=$(echo -n "$macaddr" | md5sum | awk '{print $1}') + local fake_device_id_sha1=$(echo -n "$fake_device_id_md5$xlnetacc_vip" | openssl sha1 -hmac | awk '{print $2}') + readonly _devicesign="div100.$fake_device_id_md5"$(echo -n "$fake_device_id_sha1" | md5sum | awk '{print $1}') + _log "_devicesign is $_devicesign" $(( 1 | 4 )) +} + +# å¸å·ç™»å½• +xlnetacc_login() { + # 生æˆPOSTæ•°æ® + json_init + json_add_string userName "$account" + json_add_int businessType 68 + json_add_string clientVersion "$client_version_down" + json_add_string appName "ANDROID-$appName" + json_add_int isCompressed 0 + json_add_int sequenceNo 1000001 + json_add_string sessionID + json_add_int loginType 0 + json_add_object rsaKey + json_add_string e '010001' + json_add_string n 'AC69F5CCC8BDE47CD3D371603748378C9CFAD2938A6B021E0E191013975AD683F5CBF9ADE8BD7D46B4D2EC2D78AF146F1DD2D50DC51446BB8880B8CE88D476694DFC60594393BEEFAA16F5DBCEBE22F89D640F5336E42F587DC4AFEDEFEAC36CF007009CCCE5C1ACB4FF06FBA69802A8085C2C54BADD0597FC83E6870F1E36FD' + json_close_object + json_add_int cmdID 1 + json_add_string verifyCode + json_add_string peerID "$_peerid" + json_add_int protocolVersion $protocolVersion + json_add_int platformVersion 1 + json_add_string passWord "$encrypt" + json_add_string extensionList + json_add_string verifyKey + json_add_int sdkVersion $sdkVersion + json_add_string devicesign "$_devicesign" + json_close_object + + local ret=$($_http_cmd 'https://login.mobile.reg2t.sandai.net:443/' --post-data="$(json_dump)") + _log "ret is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errorCode" + json_get_var _userid "userID" + _log "_userid is $_userid" $(( 1 | 4 )) + json_get_var _sessionid "sessionID" + _log "_sessionid is $_sessionid" $(( 1 | 4 )) + + if [ ${errno:=-1} -ne 0 ] || [ -z "$_userid" -o -z "$_sessionid" ]; then + local errorDesc + json_get_var errorDesc "errorDesc" + local outmsg="å¸å·ç™»å½•å¤±è´¥ã€‚错误代ç : ${errno}"; \ + [ -n "$errorDesc" ] && outmsg="${outmsg},原因: $errorDesc"; _log "$outmsg" $(( 1 | 8 | 16 | 32 )) + else + local outmsg="å¸å·ç™»å½•æˆåŠŸ"; _log "$outmsg" $(( 1 | 8 | 16 )) + fi + + return $errno +} + +# 获å–æ速API +xlnetacc_portal() { + xlnetacc_var $1 + + [ $1 -eq 1 ] && access_url='http://api.portal.swjsq.vip.xunlei.com:81/v2/queryportal' || \ + access_url='http://api.upportal.swjsq.vip.xunlei.com/v2/queryportal' + local ret=$($_http_cmd "$access_url") + _log "$msg_to_en portal is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno portal_ip portal_port + json_get_var errno "errno" + json_get_var portal_ip "interface_ip" + json_get_var portal_port "interface_port" + + if [ ${errno:=-1} -ne 0 ] || [ -z "$portal_ip" -o -z "$portal_port" ]; then + local message + json_get_var message "message" + local outmsg="获å–${msg_to_cn}API失败。错误代ç : ${errno}"; \ + [ -n "$message" ] && outmsg="${outmsg},原因: $message"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + else + local outmsg="获å–${msg_to_cn}APIæˆåŠŸ"; _log "$outmsg" $(( 1 | $1 * 8 )) + if [ $1 -eq 1 ]; then + _api_url_down="http://$portal_ip:$portal_port/v2" + _log "_api_url_down is $_api_url_down" $(( 1 | 4 )) + else + _api_url_up="http://$portal_ip:$portal_port/v2" + _log "_api_url_up is $_api_url_up" $(( 1 | 4 )) + fi + fi + + return $errno +} + +# 获å–ç½‘ç»œå¸¦å®½ä¿¡æ¯ +xlnetacc_bandwidth() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/bandwidth?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en bandwidth is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno can_upgrade dial_account richmessage + json_get_var errno "errno" + json_get_var can_upgrade "can_upgrade" + json_get_var dial_account "dial_account" + json_get_var richmessage "richmessage" + + # 获å–å¸¦å®½æ•°æ® + local cur_bandwidth max_bandwidth flag + [ $1 -eq 1 ] && flag="downstream" || flag="upstream" + json_select "bandwidth" >/dev/null 2>&1 + json_get_var cur_bandwidth "$flag" + json_select; json_select "max_bandwidth" >/dev/null 2>&1 + json_get_var max_bandwidth "$flag" + cur_bandwidth=$(expr $cur_bandwidth / 1024 2> /dev/null) + max_bandwidth=$(expr $max_bandwidth / 1024 2> /dev/null) + + if [ ${errno:=-1} -ne 0 ]; then + local outmsg="获å–${msg_to_cn}带宽信æ¯å¤±è´¥ã€‚错误代ç : ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + elif [ "$can_upgrade" -eq 0 ]; then + local outmsg="${msg_to_cn}无法æ速"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $1 -eq 1 ] && down_acc=0 || up_acc=0 + errno=-2 + elif [ "$cur_bandwidth" -ge "$max_bandwidth" ]; then + local outmsg="${msg_to_cn}无需æ速。当å‰å¸¦å®½ ${cur_bandwidth}M,超过最大å¯æå‡å¸¦å®½ ${max_bandwidth}M"; \ + _log "$outmsg" $(( 1 | $1 * 8 )) + [ $1 -eq 1 ] && down_acc=0 || up_acc=0 + errno=-3 + else + local outmsg="${msg_to_cn}å¯ä»¥æ速。当å‰å¸¦å®½ ${cur_bandwidth}M,å¯æå‡è‡³ ${max_bandwidth}M"; _log "$outmsg" $(( 1 | $1 * 8 )) + if [ $1 -eq 1 ]; then + _dial_account_down=$dial_account + _log "_dial_account_down is $_dial_account_down" $(( 1 | 4 )) + _cur_down=$cur_bandwidth + _log "_cur_down is $_cur_down" $(( 1 | 4 )) + _max_down=$max_bandwidth + _log "_max_down is $_max_down" $(( 1 | 4 )) + else + _dial_account_up=$dial_account + _log "_dial_account_up is $_dial_account_up" $(( 1 | 4 )) + _cur_up=$cur_bandwidth + _log "_cur_up is $_cur_up" $(( 1 | 4 )) + _max_up=$max_bandwidth + _log "_max_up is $_max_up" $(( 1 | 4 )) + fi + fi + + return $errno +} + +# å‘é€å¸¦å®½æé€Ÿä¿¡å· +xlnetacc_upgrade() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/upgrade?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en upgrade is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}æ速失败。错误代ç : ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $errno -ne -1 ] && { [ $1 -eq 1 ] && down_acc=0 || up_acc=0; } + else + [ $1 -eq 1 ] && local cur_bandwidth=$_cur_down || local cur_bandwidth=$_cur_up + [ $1 -eq 1 ] && local max_bandwidth=$_max_down || local max_bandwidth=$_max_up + local outmsg="${msg_to_cn}æ速æˆåŠŸï¼Œå¸¦å®½å·²ä»Ž ${cur_bandwidth}M æå‡åˆ° ${max_bandwidth}M"; _log "$outmsg" $(( 1 | $1 * 8 )) + [ $1 -eq 1 ] && down_acc=2 || up_acc=2 + fi + + return $errno +} + +# å‘é€æé€Ÿå¿ƒè·³ä¿¡å· +xlnetacc_keepalive() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/keepalive?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en keepalive is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}æ速失效。错误代ç : ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + [ $1 -eq 1 ] && down_acc=1 || up_acc=1 + else + _log "${msg_to_cn}心跳信å·è¿”回正常" + fi + + return $errno +} + +# å‘é€å¸¦å®½æ¢å¤ä¿¡å· +xlnetacc_recover() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/recover?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en recover is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + if [ ${errno:=-1} -ne 0 ]; then + local richmessage + json_get_var richmessage "richmessage" + local outmsg="${msg_to_cn}带宽æ¢å¤å¤±è´¥ã€‚错误代ç : ${errno}"; \ + [ -n "$richmessage" ] && outmsg="${outmsg},原因: $richmessage"; _log "$outmsg" $(( 1 | $1 * 8 | 32 )) + else + _log "${msg_to_cn}带宽已æ¢å¤" + [ $1 -eq 1 ] && down_acc=1 || up_acc=1 + fi + + return $errno +} + +# 查询æ速信æ¯ï¼Œæœªä½¿ç”¨ +xlnetacc_query() { + xlnetacc_var $1 + + local ret=$($_http_cmd "$access_url/query_try_info?${_http_args}&time_and=$(date +%s)000") + _log "$msg_to_en query_try_info is $ret" $(( 1 | 4 )) + json_cleanup; json_load "$ret" >/dev/null 2>&1 + local errno + json_get_var errno "errno" + + return $errno +} + +# 带宽æé€Ÿå¤„ç† +xlnetacc_acc() { + _api_url_down=; _api_url_up= + _dial_account_down=; _dial_account_up= + _cur_down=0; _max_down=0; _cur_up=0; _max_up=0 + + xlnetacc_portal $1 || return + xlnetacc_bandwidth $1 || return + xlnetacc_upgrade $1 +} + +# 设置å‚æ•°å˜é‡ +xlnetacc_var() { + if [ $1 -eq 1 ]; then + access_url=$_api_url_down + _http_args="peerid=${_peerid}&userid=${_userid}&user_type=1&sessionid=${_sessionid}&dial_account=${_dial_account_down}&client_type=${client_type_down}-${client_version_down}&client_version=${client_type_down//-/}-${client_version_down}&os=${client_os}" + msg_to_en="DownLink" + msg_to_cn="下行" + else + access_url=$_api_url_up + _http_args="peerid=${_peerid}&userid=${_userid}&user_type=1&sessionid=${_sessionid}&dial_account=${_dial_account_up}&client_type=${client_type_up}-${client_version_up}&client_version=${client_type_up//-/}-${client_version_up}&os=${client_os}" + msg_to_en="UpLink" + msg_to_cn="上行" + fi +} + +# 中止信å·å¤„ç† +sigterm() { + _log "trap sigterm, exit" $(( 1 | 4 )) + [ $down_acc -eq 2 ] && xlnetacc_recover 1 + [ $up_acc -eq 2 ] && xlnetacc_recover 2 + rm -f "$down_state_file" "$up_state_file" + exit 0 +} + +# åˆå§‹åŒ– +xlnetacc_init() { + [ "$1" != "--start" ] && return 1 + + # 防止é‡å¤å¯åŠ¨ + local pid + for pid in $(pidof "${0##*/}"); do + [ $pid -ne $$ ] && return 1 + done + + # 读å–设置 + readonly NAME=xlnetacc + readonly LOGFILE=/var/log/${NAME}.log + readonly down_state_file=/var/state/${NAME}_down_state + readonly up_state_file=/var/state/${NAME}_up_state + down_acc=$(uci_get_by_bool "general" "down_acc" 0) + up_acc=$(uci_get_by_bool "general" "up_acc" 0) + readonly logging=$(uci_get_by_bool "general" "logging" 1) + readonly verbose=$(uci_get_by_bool "general" "verbose" 0) + readonly network=$(uci_get_by_name "general" "network" "wan") + readonly account=$(uci_get_by_name "general" "account") + readonly encrypt=$(uci_get_by_name "general" "encrypt") + local enabled=$(uci_get_by_bool "general" "enabled" 0) + local password=$(uci_get_by_name "general" "password") + ( [ $enabled -eq 0 ] || [ $down_acc -eq 0 -a $up_acc -eq 0 ] || [ -z "$account" -o -z "$encrypt" -o -z "$network" ] ) && return 2 + + [ $logging -eq 1 ] && [ ! -d /var/log ] && mkdir -p /var/log + _log "------------------------------" + _log "迅雷快鸟正在å¯åŠ¨..." + _log "down_acc is $down_acc" $(( 1 | 4 )) + _log "up_acc is $up_acc" $(( 1 | 4 )) + _log "network is $network" $(( 1 | 4 )) + _log "account is $account" $(( 1 | 4 )) + _log "encrypt is $encrypt" $(( 1 | 4 )) + + # 检查外部调用工具 + command -v wget-ssl >/dev/null || { _log "GNU Wget 工具ä¸å­˜åœ¨"; return 3; } + command -v md5sum >/dev/null || { _log "md5sum 工具ä¸å­˜åœ¨"; return 3; } + command -v openssl >/dev/null || { _log "openssl 工具ä¸å­˜åœ¨"; return 3; } + + # æ£€æŸ¥æ˜Žæ–‡å¯†ç  + if [ -n "$password" ]; then + _log "移除已ä¿å­˜çš„明文密ç " + uci delete "${NAME}.general.password" + uci commit "$NAME" + fi + + # æ•èŽ·ä¸­æ­¢ä¿¡å· + trap "sigterm" INT + trap "sigterm" TERM + + # 生æˆè®¾å¤‡ç­¾å + gen_device_sign + [ -z "$_peerid" -o -z "$_devicesign" ] && return 4 + + clean_log + [ -d /var/state ] || mkdir -p /var/state + return 0 +} + +# 程åºä¸»ä½“ +xlnetacc_main() { + while : ; do + # 获å–外网IPåœ°å€ + while : ; do + local bind_ip=$(get_acc_ip) + if [ -z "$bind_ip" ]; then + sleep 5s # 获å–失败 + else + gen_http_cmd "$bind_ip" + break + fi + done + + # å¸å·ç™»å½• + while : ; do + xlnetacc_login + case $? in + 0) break;; # 登录æˆåŠŸ + 6) sleep 30m;; # 需è¦è¾“入验è¯ç ï¼Œç­‰å¾…30分钟åŽé‡è¯• + -1) sleep 3m;; # 未返回有效数æ®ï¼Œç­‰å¾…3分钟åŽé‡è¯• + *) return 5;; # 登录失败 + esac + done + + # 10秒检查æ速状æ€ï¼Œ300秒å‘é€å¿ƒè·³åŒ… + local timer_begin=$(date +%s); local timer_count= + while : ; do + [ $down_acc -eq 0 -a $up_acc -eq 0 ] && break 2 + [ $down_acc -eq 1 ] && xlnetacc_acc 1 + [ $up_acc -eq 1 ] && xlnetacc_acc 2 + + sleep 10s + timer_count=$(( $(date +%s) - $timer_begin )) + [ $timer_count -lt 300 ] && continue + timer_begin=$(date +%s) + clean_log # 清ç†æ—¥å¿— + + [ $down_acc -eq 2 ] && { xlnetacc_keepalive 1; [ $? -eq -1 ] && break; } + [ $up_acc -eq 2 ] && { xlnetacc_keepalive 2; [ $? -eq -1 ] && break; } + done + [ $down_acc -eq 2 ] && { xlnetacc_recover 1; down_acc=1; } + [ $up_acc -eq 2 ] && { xlnetacc_recover 2; up_acc=1; } + done + _log "程åºå¼‚常,迅雷快鸟已åœæ­¢ã€‚" +} + +# 程åºå…¥å£ +xlnetacc_init $* +[ $? -eq 0 ] && xlnetacc_main +exit $? diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile b/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile new file mode 100644 index 000000000..ad2c13320 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/Makefile @@ -0,0 +1,12 @@ + +INSTALL = install +PREFIX = /usr/bin + +po2lmo: src/po2lmo.o src/template_lmo.o + $(CC) $(LDFLAGS) -o src/po2lmo src/po2lmo.o src/template_lmo.o + +install: + $(INSTALL) -m 755 src/po2lmo $(PREFIX) + +clean: + $(RM) src/po2lmo src/*.o diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c new file mode 100644 index 000000000..0da792b68 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/po2lmo.c @@ -0,0 +1,247 @@ +/* + * lmo - Lua Machine Objects - PO to LMO conversion tool + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +static void die(const char *msg) +{ + fprintf(stderr, "Error: %s\n", msg); + exit(1); +} + +static void usage(const char *name) +{ + fprintf(stderr, "Usage: %s input.po output.lmo\n", name); + exit(1); +} + +static void print(const void *ptr, size_t size, size_t nmemb, FILE *stream) +{ + if( fwrite(ptr, size, nmemb, stream) == 0 ) + die("Failed to write stdout"); +} + +static int extract_string(const char *src, char *dest, int len) +{ + int pos = 0; + int esc = 0; + int off = -1; + + for( pos = 0; (pos < strlen(src)) && (pos < len); pos++ ) + { + if( (off == -1) && (src[pos] == '"') ) + { + off = pos + 1; + } + else if( off >= 0 ) + { + if( esc == 1 ) + { + switch (src[pos]) + { + case '"': + case '\\': + off++; + break; + } + dest[pos-off] = src[pos]; + esc = 0; + } + else if( src[pos] == '\\' ) + { + dest[pos-off] = src[pos]; + esc = 1; + } + else if( src[pos] != '"' ) + { + dest[pos-off] = src[pos]; + } + else + { + dest[pos-off] = '\0'; + break; + } + } + } + + return (off > -1) ? strlen(dest) : -1; +} + +static int cmp_index(const void *a, const void *b) +{ + uint32_t x = ((const lmo_entry_t *)a)->key_id; + uint32_t y = ((const lmo_entry_t *)b)->key_id; + + if (x < y) + return -1; + else if (x > y) + return 1; + + return 0; +} + +static void print_uint32(uint32_t x, FILE *out) +{ + uint32_t y = htonl(x); + print(&y, sizeof(uint32_t), 1, out); +} + +static void print_index(void *array, int n, FILE *out) +{ + lmo_entry_t *e; + + qsort(array, n, sizeof(*e), cmp_index); + + for (e = array; n > 0; n--, e++) + { + print_uint32(e->key_id, out); + print_uint32(e->val_id, out); + print_uint32(e->offset, out); + print_uint32(e->length, out); + } +} + +int main(int argc, char *argv[]) +{ + char line[4096]; + char key[4096]; + char val[4096]; + char tmp[4096]; + int state = 0; + int offset = 0; + int length = 0; + int n_entries = 0; + void *array = NULL; + lmo_entry_t *entry = NULL; + uint32_t key_id, val_id; + + FILE *in; + FILE *out; + + if( (argc != 3) || ((in = fopen(argv[1], "r")) == NULL) || ((out = fopen(argv[2], "w")) == NULL) ) + usage(argv[0]); + + memset(line, 0, sizeof(key)); + memset(key, 0, sizeof(val)); + memset(val, 0, sizeof(val)); + + while( (NULL != fgets(line, sizeof(line), in)) || (state >= 2 && feof(in)) ) + { + if( state == 0 && strstr(line, "msgid \"") == line ) + { + switch(extract_string(line, key, sizeof(key))) + { + case -1: + die("Syntax error in msgid"); + case 0: + state = 1; + break; + default: + state = 2; + } + } + else if( state == 1 || state == 2 ) + { + if( strstr(line, "msgstr \"") == line || state == 2 ) + { + switch(extract_string(line, val, sizeof(val))) + { + case -1: + state = 4; + break; + default: + state = 3; + } + } + else + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 2; + break; + default: + strcat(key, tmp); + } + } + } + else if( state == 3 ) + { + switch(extract_string(line, tmp, sizeof(tmp))) + { + case -1: + state = 4; + break; + default: + strcat(val, tmp); + } + } + + if( state == 4 ) + { + if( strlen(key) > 0 && strlen(val) > 0 ) + { + key_id = sfh_hash(key, strlen(key)); + val_id = sfh_hash(val, strlen(val)); + + if( key_id != val_id ) + { + n_entries++; + array = realloc(array, n_entries * sizeof(lmo_entry_t)); + entry = (lmo_entry_t *)array + n_entries - 1; + + if (!array) + die("Out of memory"); + + entry->key_id = key_id; + entry->val_id = val_id; + entry->offset = offset; + entry->length = strlen(val); + + length = strlen(val) + ((4 - (strlen(val) % 4)) % 4); + + print(val, length, 1, out); + offset += length; + } + } + + state = 0; + memset(key, 0, sizeof(key)); + memset(val, 0, sizeof(val)); + } + + memset(line, 0, sizeof(line)); + } + + print_index(array, n_entries, out); + + if( offset > 0 ) + { + print_uint32(offset, out); + fsync(fileno(out)); + fclose(out); + } + else + { + fclose(out); + unlink(argv[2]); + } + + fclose(in); + return(0); +} diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c new file mode 100644 index 000000000..27205a722 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.c @@ -0,0 +1,328 @@ +/* + * lmo - Lua Machine Objects - Base functions + * + * Copyright (C) 2009-2010 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "template_lmo.h" + +/* + * Hash function from http://www.azillionmonkeys.com/qed/hash.html + * Copyright (C) 2004-2008 by Paul Hsieh + */ + +uint32_t sfh_hash(const char *data, int len) +{ + uint32_t hash = len, tmp; + int rem; + + if (len <= 0 || data == NULL) return 0; + + rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) { + hash += sfh_get16(data); + tmp = (sfh_get16(data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof(uint16_t); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) { + case 3: hash += sfh_get16(data); + hash ^= hash << 16; + hash ^= data[sizeof(uint16_t)] << 18; + hash += hash >> 11; + break; + case 2: hash += sfh_get16(data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; +} + +uint32_t lmo_canon_hash(const char *str, int len) +{ + char res[4096]; + char *ptr, prev; + int off; + + if (!str || len >= sizeof(res)) + return 0; + + for (prev = ' ', ptr = res, off = 0; off < len; prev = *str, off++, str++) + { + if (isspace(*str)) + { + if (!isspace(prev)) + *ptr++ = ' '; + } + else + { + *ptr++ = *str; + } + } + + if ((ptr > res) && isspace(*(ptr-1))) + ptr--; + + return sfh_hash(res, ptr - res); +} + +lmo_archive_t * lmo_open(const char *file) +{ + int in = -1; + uint32_t idx_offset = 0; + struct stat s; + + lmo_archive_t *ar = NULL; + + if (stat(file, &s) == -1) + goto err; + + if ((in = open(file, O_RDONLY)) == -1) + goto err; + + if ((ar = (lmo_archive_t *)malloc(sizeof(*ar))) != NULL) + { + memset(ar, 0, sizeof(*ar)); + + ar->fd = in; + ar->size = s.st_size; + + fcntl(ar->fd, F_SETFD, fcntl(ar->fd, F_GETFD) | FD_CLOEXEC); + + if ((ar->mmap = mmap(NULL, ar->size, PROT_READ, MAP_SHARED, ar->fd, 0)) == MAP_FAILED) + goto err; + + idx_offset = ntohl(*((const uint32_t *) + (ar->mmap + ar->size - sizeof(uint32_t)))); + + if (idx_offset >= ar->size) + goto err; + + ar->index = (lmo_entry_t *)(ar->mmap + idx_offset); + ar->length = (ar->size - idx_offset - sizeof(uint32_t)) / sizeof(lmo_entry_t); + ar->end = ar->mmap + ar->size; + + return ar; + } + +err: + if (in > -1) + close(in); + + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + free(ar); + } + + return NULL; +} + +void lmo_close(lmo_archive_t *ar) +{ + if (ar != NULL) + { + if ((ar->mmap != NULL) && (ar->mmap != MAP_FAILED)) + munmap(ar->mmap, ar->size); + + close(ar->fd); + free(ar); + + ar = NULL; + } +} + + +lmo_catalog_t *_lmo_catalogs = NULL; +lmo_catalog_t *_lmo_active_catalog = NULL; + +int lmo_load_catalog(const char *lang, const char *dir) +{ + DIR *dh = NULL; + char pattern[16]; + char path[PATH_MAX]; + struct dirent *de = NULL; + + lmo_archive_t *ar = NULL; + lmo_catalog_t *cat = NULL; + + if (!lmo_change_catalog(lang)) + return 0; + + if (!dir || !(dh = opendir(dir))) + goto err; + + if (!(cat = malloc(sizeof(*cat)))) + goto err; + + memset(cat, 0, sizeof(*cat)); + + snprintf(cat->lang, sizeof(cat->lang), "%s", lang); + snprintf(pattern, sizeof(pattern), "*.%s.lmo", lang); + + while ((de = readdir(dh)) != NULL) + { + if (!fnmatch(pattern, de->d_name, 0)) + { + snprintf(path, sizeof(path), "%s/%s", dir, de->d_name); + ar = lmo_open(path); + + if (ar) + { + ar->next = cat->archives; + cat->archives = ar; + } + } + } + + closedir(dh); + + cat->next = _lmo_catalogs; + _lmo_catalogs = cat; + + if (!_lmo_active_catalog) + _lmo_active_catalog = cat; + + return 0; + +err: + if (dh) closedir(dh); + if (cat) free(cat); + + return -1; +} + +int lmo_change_catalog(const char *lang) +{ + lmo_catalog_t *cat; + + for (cat = _lmo_catalogs; cat; cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + _lmo_active_catalog = cat; + return 0; + } + } + + return -1; +} + +static lmo_entry_t * lmo_find_entry(lmo_archive_t *ar, uint32_t hash) +{ + unsigned int m, l, r; + uint32_t k; + + l = 0; + r = ar->length - 1; + + while (1) + { + m = l + ((r - l) / 2); + + if (r < l) + break; + + k = ntohl(ar->index[m].key_id); + + if (k == hash) + return &ar->index[m]; + + if (k > hash) + { + if (!m) + break; + + r = m - 1; + } + else + { + l = m + 1; + } + } + + return NULL; +} + +int lmo_translate(const char *key, int keylen, char **out, int *outlen) +{ + uint32_t hash; + lmo_entry_t *e; + lmo_archive_t *ar; + + if (!key || !_lmo_active_catalog) + return -2; + + hash = lmo_canon_hash(key, keylen); + + for (ar = _lmo_active_catalog->archives; ar; ar = ar->next) + { + if ((e = lmo_find_entry(ar, hash)) != NULL) + { + *out = ar->mmap + ntohl(e->offset); + *outlen = ntohl(e->length); + return 0; + } + } + + return -1; +} + +void lmo_close_catalog(const char *lang) +{ + lmo_archive_t *ar, *next; + lmo_catalog_t *cat, *prev; + + for (prev = NULL, cat = _lmo_catalogs; cat; prev = cat, cat = cat->next) + { + if (!strncmp(cat->lang, lang, sizeof(cat->lang))) + { + if (prev) + prev->next = cat->next; + else + _lmo_catalogs = cat->next; + + for (ar = cat->archives; ar; ar = next) + { + next = ar->next; + lmo_close(ar); + } + + free(cat); + break; + } + } +} diff --git a/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h new file mode 100644 index 000000000..57f59aa56 --- /dev/null +++ b/package/lean/luci-app-xlnetacc/tools/po2lmo/src/template_lmo.h @@ -0,0 +1,92 @@ +/* + * lmo - Lua Machine Objects - General header + * + * Copyright (C) 2009-2012 Jo-Philipp Wich + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _TEMPLATE_LMO_H_ +#define _TEMPLATE_LMO_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if (defined(__GNUC__) && defined(__i386__)) +#define sfh_get16(d) (*((const uint16_t *) (d))) +#else +#define sfh_get16(d) ((((uint32_t)(((const uint8_t *)(d))[1])) << 8)\ + +(uint32_t)(((const uint8_t *)(d))[0]) ) +#endif + + +struct lmo_entry { + uint32_t key_id; + uint32_t val_id; + uint32_t offset; + uint32_t length; +} __attribute__((packed)); + +typedef struct lmo_entry lmo_entry_t; + + +struct lmo_archive { + int fd; + int length; + uint32_t size; + lmo_entry_t *index; + char *mmap; + char *end; + struct lmo_archive *next; +}; + +typedef struct lmo_archive lmo_archive_t; + + +struct lmo_catalog { + char lang[6]; + struct lmo_archive *archives; + struct lmo_catalog *next; +}; + +typedef struct lmo_catalog lmo_catalog_t; + + +uint32_t sfh_hash(const char *data, int len); +uint32_t lmo_canon_hash(const char *data, int len); + +lmo_archive_t * lmo_open(const char *file); +void lmo_close(lmo_archive_t *ar); + + +extern lmo_catalog_t *_lmo_catalogs; +extern lmo_catalog_t *_lmo_active_catalog; + +int lmo_load_catalog(const char *lang, const char *dir); +int lmo_change_catalog(const char *lang); +int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_close_catalog(const char *lang); + +#endif From c63331bbccf7911252754986ee8baf13db06f76b Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 15:45:38 +0800 Subject: [PATCH 77/95] replace aliddns to ddns-scripts_aliyun by sensel --- package/lean/ddns-scripts_aliyun/Makefile | 72 ++++++ .../ddns-scripts_aliyun/update_aliyun_com.sh | 233 ++++++++++++++++++ package/lean/luci-app-aliddns/Makefile | 19 -- .../luasrc/controller/aliddns.lua | 4 - .../luasrc/model/cbi/aliddns.lua | 52 ---- .../lean/luci-app-aliddns/po/zh-cn/aliddns.po | 4 - .../luci-app-aliddns/root/etc/config/aliddns | 10 - .../luci-app-aliddns/root/etc/init.d/aliddns | 18 -- .../root/etc/uci-defaults/luci-app-aliddns | 5 - .../luci-app-aliddns/root/usr/sbin/aliddns | 128 ---------- 10 files changed, 305 insertions(+), 240 deletions(-) create mode 100644 package/lean/ddns-scripts_aliyun/Makefile create mode 100755 package/lean/ddns-scripts_aliyun/update_aliyun_com.sh delete mode 100644 package/lean/luci-app-aliddns/Makefile delete mode 100644 package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua delete mode 100644 package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua delete mode 100644 package/lean/luci-app-aliddns/po/zh-cn/aliddns.po delete mode 100644 package/lean/luci-app-aliddns/root/etc/config/aliddns delete mode 100755 package/lean/luci-app-aliddns/root/etc/init.d/aliddns delete mode 100755 package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns delete mode 100755 package/lean/luci-app-aliddns/root/usr/sbin/aliddns diff --git a/package/lean/ddns-scripts_aliyun/Makefile b/package/lean/ddns-scripts_aliyun/Makefile new file mode 100644 index 000000000..e35cef5a4 --- /dev/null +++ b/package/lean/ddns-scripts_aliyun/Makefile @@ -0,0 +1,72 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=ddns-scripts_aliyun +PKG_VERSION:=1.0.0 +PKG_RELEASE:=1 + +PKG_LICENSE:=GPLv2 +PKG_MAINTAINER:=Sense + +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/$(PKG_NAME) + SECTION:=net + CATEGORY:=Network + SUBMENU:=IP Addresses and Names + TITLE:=DDNS extension for AliYun.com + PKGARCH:=all + DEPENDS:=+ddns-scripts +wget +openssl-util +endef + +define Package/$(PKG_NAME)/description + Dynamic DNS Client scripts extension for AliYun.com +endef + +define Build/Configure +endef + +define Build/Compile + $(CP) ./*.sh $(PKG_BUILD_DIR) +endef + +define Package/$(PKG_NAME)/preinst + #!/bin/sh + # if NOT run buildroot then stop service + [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 + exit 0 # suppress errors +endef + +define Package/$(PKG_NAME)/install + $(INSTALL_DIR) $(1)/usr/lib/ddns + $(INSTALL_BIN) $(PKG_BUILD_DIR)/update_aliyun_com.sh $(1)/usr/lib/ddns +endef + +define Package/$(PKG_NAME)/postinst + #!/bin/sh + # remove old services file entries + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 + # and create new + printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services + printf "%s\\t\\t%s\\n" '"aliyun.com"' '"update_aliyun_com.sh"' >> $${IPKG_INSTROOT}/etc/ddns/services_ipv6 + # on real system restart service if enabled + [ -z "$${IPKG_INSTROOT}" ] && { + /etc/init.d/ddns enabled && \ + /etc/init.d/ddns start >/dev/null 2>&1 + } + exit 0 # suppress errors +endef + +define Package/$(PKG_NAME)/prerm + #!/bin/sh + # if NOT run buildroot then stop service + [ -z "$${IPKG_INSTROOT}" ] && /etc/init.d/ddns stop >/dev/null 2>&1 + # remove services file entries + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services >/dev/null 2>&1 + /bin/sed -i '/aliyun\.com/d' $${IPKG_INSTROOT}/etc/ddns/services_ipv6 >/dev/null 2>&1 + exit 0 # suppress errors +endef + +$(eval $(call BuildPackage,$(PKG_NAME))) diff --git a/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh b/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh new file mode 100755 index 000000000..89ee909ce --- /dev/null +++ b/package/lean/ddns-scripts_aliyun/update_aliyun_com.sh @@ -0,0 +1,233 @@ +#!/bin/sh +# +# 用于阿里云解æžçš„DNS更新脚本 +# 2017-2018 Sense +# 阿里云解æžAPI文档 https://help.aliyun.com/document_detail/29739.html +# +# 本脚本由 dynamic_dns_functions.sh 内的函数 send_update() 调用 +# +# 需è¦åœ¨ /etc/config/ddns 中设置的选项 +# option username - 阿里云APIè®¿é—®è´¦å· Access Key ID。å¯é€šè¿‡ aliyun.com å¸å·ç®¡ç†çš„ accesskeys 获å–, 或者访问 https://ak-console.aliyun.com +# option password - 阿里云API访问密钥 Access Key Secret +# option domain - 完整的域å。建议主机与域å之间使用 @ç¬¦å· åˆ†éš”ï¼Œå¦åˆ™å°†ä»¥ç¬¬ä¸€ä¸ª .ç¬¦å· ä¹‹å‰çš„内容作为主机å +# + +# 检查传入å‚æ•° +[ -z "$username" ] && write_log 14 "é…置错误ï¼ä¿å­˜é˜¿é‡Œäº‘API访问账å·çš„'用户å'ä¸èƒ½ä¸ºç©º" +[ -z "$password" ] && write_log 14 "é…置错误ï¼ä¿å­˜é˜¿é‡Œäº‘API访问密钥的'密ç 'ä¸èƒ½ä¸ºç©º" + +# 检查外部调用工具 +[ -n "$WGET_SSL" ] || write_log 13 "使用阿里云APIéœ€è¦ GNU Wget 支æŒï¼Œè¯·å…ˆå®‰è£…" +command -v sed >/dev/null 2>&1 || write_log 13 "使用阿里云APIéœ€è¦ sed 支æŒï¼Œè¯·å…ˆå®‰è£…" +command -v openssl >/dev/null 2>&1 || write_log 13 "使用阿里云APIéœ€è¦ openssl-util 支æŒï¼Œè¯·å…ˆå®‰è£…" + +# 包å«ç”¨äºŽè§£æž JSON æ ¼å¼è¿”回值的函数 +. /usr/share/libubox/jshn.sh + +# å˜é‡å£°æ˜Ž +local __HOST __DOMAIN __TYPE __URLBASE __CMDBASE __URLARGS __SEPARATOR __RECID +[ $use_https -eq 0 ] && __URLBASE="http://alidns.aliyuncs.com/" || __URLBASE="https://alidns.aliyuncs.com/" +__SEPARATOR="&" + +# 从 $domain 分离主机和域å +[ "${domain:0:2}" == "@." ] && domain="${domain/./}" # 主域åå¤„ç† +[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域åæ ¼å¼ +__HOST="${domain%%@*}" +__DOMAIN="${domain#*@}" +[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@" + +# 设置记录类型 +[ $use_ipv6 -eq 0 ] && __TYPE="A" || __TYPE="AAAA" + +# 构造基本通信命令 +build_command() { + __CMDBASE="$WGET_SSL -nv -t 1 -O $DATFILE -o $ERRFILE" + # 绑定用于通信的主机/IP + if [ -n "$bind_network" ]; then + local bind_ip run_prog + [ $use_ipv6 -eq 0 ] && run_prog="network_get_ipaddr" || run_prog="network_get_ipaddr6" + eval "$run_prog bind_ip $bind_network" || \ + write_log 13 "无法使用 '$run_prog $bind_network' 获å–本地IPåœ°å€ - 错误代ç : '$?'" + write_log 7 "强制使用IP '$bind_ip' 通信" + __CMDBASE="$__CMDBASE --bind-address=$bind_ip" + fi + # 强制设定IP版本 + if [ $force_ipversion -eq 1 ]; then + [ $use_ipv6 -eq 0 ] && __CMDBASE="$__CMDBASE -4" || __CMDBASE="$__CMDBASE -6" + fi + # 设置CAè¯ä¹¦å‚æ•° + if [ $use_https -eq 1 ]; then + if [ "$cacert" = "IGNORE" ]; then + __CMDBASE="$__CMDBASE --no-check-certificate" + elif [ -f "$cacert" ]; then + __CMDBASE="$__CMDBASE --ca-certificate=${cacert}" + elif [ -d "$cacert" ]; then + __CMDBASE="$__CMDBASE --ca-directory=${cacert}" + elif [ -n "$cacert" ]; then + write_log 14 "在 '$cacert' 中未找到用于 HTTPS 通信的有效è¯ä¹¦" + fi + fi + # 如果没有设置,ç¦ç”¨ä»£ç† (è¿™å¯èƒ½æ˜¯ .wgetrc 或环境设置错误) + [ -z "$proxy" ] && __CMDBASE="$__CMDBASE --no-proxy" +} + +# 用于阿里云API的通信函数 +aliyun_transfer() { + local __PARAM=$* + local __CNT=0 + local __RUNPROG __ERR PID_SLEEP + + [ $# -eq 0 ] && write_log 12 "'aliyun_transfer()' 出错 - å‚æ•°æ•°é‡é”™è¯¯" + + while : ; do + build_Request $__PARAM + __RUNPROG="$__CMDBASE '${__URLBASE}?${__URLARGS}'" + + write_log 7 "#> $__RUNPROG" + eval $__RUNPROG + __ERR=$? + [ $__ERR -eq 0 ] && return 0 + + write_log 3 "wget 错误代ç : '$__ERR'" + write_log 7 "$(cat $ERRFILE)" + + if [ $VERBOSE -gt 1 ]; then + write_log 4 "传输失败 - 详细模å¼: $VERBOSE - 出错åŽä¸å†é‡è¯•" + return 1 + fi + + __CNT=$(( $__CNT + 1 )) + [ $retry_count -gt 0 -a $__CNT -gt $retry_count ] && \ + write_log 14 "$retry_count 次é‡è¯•åŽä¼ è¾“还是失败" + + write_log 4 "传输失败 - $__CNT/$retry_count 在 $RETRY_SECONDS 秒åŽé‡è¯•" + sleep $RETRY_SECONDS & + PID_SLEEP=$! + wait $PID_SLEEP + PID_SLEEP=0 + done +} + +# 百分å·ç¼–ç  +percentEncode() { + if [ -z "${1//[A-Za-z0-9_.~-]/}" ]; then + echo -n "$1" + else + local string=$1; local i=0; local ret chr + while [ $i -lt ${#string} ]; do + chr=${string:$i:1} + [ -z "${chr#[^A-Za-z0-9_.~-]}" ] && chr=$(printf '%%%02X' "'$chr") + ret="$ret$chr" + i=$(( $i + 1 )) + done + echo -n "$ret" + fi +} + +# 构造阿里云解æžè¯·æ±‚å‚æ•° +build_Request() { + local args=$*; local string + local HTTP_METHOD="GET" + + # 添加请求å‚æ•° + __URLARGS= + for string in $args; do + case "${string%%=*}" in + Format|Version|AccessKeyId|SignatureMethod|Timestamp|SignatureVersion|SignatureNonce|Signature) ;; # 过滤公共å‚æ•° + *) __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}");; + esac + done + __URLARGS="${__URLARGS:1}" + + # 附加公共å‚æ•° + string="Format=JSON"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="Version=2015-01-09"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="AccessKeyId=$username"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureMethod=HMAC-SHA1"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="Timestamp="$(date -u '+%Y-%m-%dT%H:%M:%SZ'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureVersion=1.0"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + string="SignatureNonce="$(cat '/proc/sys/kernel/random/uuid'); __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") + + # 对请求å‚数进行排åºï¼Œç”¨äºŽç”Ÿæˆç­¾å + string=$(echo -n "$__URLARGS" | sed 's/\'"${__SEPARATOR}"'/\n/g' | sort | sed ':label; N; s/\n/\'"${__SEPARATOR}"'/g; b label') + # 构造用于计算签å的字符串 + string="${HTTP_METHOD}${__SEPARATOR}"$(percentEncode "/")"${__SEPARATOR}"$(percentEncode "$string") + # 字符串计算签åHMAC值 + local signature=$(echo -n "$string" | openssl dgst -sha1 -hmac "${password}&" -binary) + # HMAC值编ç æˆå­—符串,得到签å值 + signature=$(echo -n "$signature" | openssl base64) + + # 附加签åå‚æ•° + string="Signature=$signature"; __URLARGS="$__URLARGS${__SEPARATOR}"$(percentEncode "${string%%=*}")"="$(percentEncode "${string#*=}") +} + +# 添加解æžè®°å½• +add_domain() { + local value + aliyun_transfer "Action=AddDomainRecord" "DomainName=${__DOMAIN}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "æœåŠ¡å™¨é€šä¿¡å¤±è´¥" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "RecordId" + [ -z "$value" ] && write_log 14 "添加新解æžè®°å½•å¤±è´¥" + write_log 7 "添加新解æžè®°å½•æˆåŠŸ" + return 0 +} + +# 修改解æžè®°å½• +update_domain() { + local value + aliyun_transfer "Action=UpdateDomainRecord" "RecordId=${__RECID}" "RR=${__HOST}" "Type=${__TYPE}" "Value=${__IP}" || write_log 14 "æœåŠ¡å™¨é€šä¿¡å¤±è´¥" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "RecordId" + [ -z "$value" ] && write_log 14 "修改解æžè®°å½•å¤±è´¥" + write_log 7 "修改解æžè®°å½•æˆåŠŸ" + return 0 +} + +# å¯ç”¨è§£æžè®°å½• +enable_domain() { + local value + aliyun_transfer "Action=SetDomainRecordStatus" "RecordId=${__RECID}" "Status=Enable" || write_log 14 "æœåŠ¡å™¨é€šä¿¡å¤±è´¥" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "Status" + [ "$value" != "Enable" ] && write_log 14 "å¯ç”¨è§£æžè®°å½•å¤±è´¥" + write_log 7 "å¯ç”¨è§£æžè®°å½•æˆåŠŸ" + return 0 +} + +# 获å–å­åŸŸå解æžè®°å½•åˆ—表 +describe_domain() { + local value type; local ret=0 + aliyun_transfer "Action=DescribeSubDomainRecords" "SubDomain=${__HOST}.${__DOMAIN}" || write_log 14 "æœåŠ¡å™¨é€šä¿¡å¤±è´¥" + json_cleanup; json_load "$(cat "$DATFILE" 2> /dev/null)" >/dev/null 2>&1 + json_get_var value "TotalCount" + if [ $value -eq 0 ]; then + write_log 7 "解æžè®°å½•ä¸å­˜åœ¨" + ret=1 + else + json_select "DomainRecords" >/dev/null 2>&1 + json_select "Record" >/dev/null 2>&1 + json_select 1 >/dev/null 2>&1 + json_get_var value "Locked" + [ $value -ne 0 ] && write_log 14 "解æžè®°å½•è¢«é”定" + json_get_var __RECID "RecordId" + write_log 7 "获得解æžè®°å½•ID: ${__RECID}" + json_get_var value "Status" + [ "$value" != "ENABLE" ] && ret=$(( $ret | 2 )) && write_log 7 "解æžè®°å½•è¢«ç¦ç”¨" + json_get_var type "Type" + json_get_var value "Value" + [ "$type" != "${__TYPE}" -o "$value" != "${__IP}" ] && ret=$(( $ret | 4 )) && write_log 7 "地å€æˆ–类型需è¦ä¿®æ”¹" + fi + return $ret +} + +build_command +describe_domain +ret=$? +if [ $ret -eq 1 ]; then + sleep 3 && add_domain +else + [ $(( $ret & 2 )) -ne 0 ] && sleep 3 && enable_domain + [ $(( $ret & 4 )) -ne 0 ] && sleep 3 && update_domain +fi + +return 0 diff --git a/package/lean/luci-app-aliddns/Makefile b/package/lean/luci-app-aliddns/Makefile deleted file mode 100644 index e3f10e5d2..000000000 --- a/package/lean/luci-app-aliddns/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2008-2014 The LuCI Team -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI for Aliddns -LUCI_DEPENDS:=+wget +openssl-util -LUCI_PKGARCH:=all -PKG_VERSION:=1.0 -PKG_RELEASE:=1 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature - - diff --git a/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua b/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua deleted file mode 100644 index c62864560..000000000 --- a/package/lean/luci-app-aliddns/luasrc/controller/aliddns.lua +++ /dev/null @@ -1,4 +0,0 @@ -module("luci.controller.aliddns",package.seeall) -function index() -entry({"admin","services","aliddns"},cbi("aliddns"),_("Aliddns Client"),101) -end diff --git a/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua b/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua deleted file mode 100644 index 76b386ef8..000000000 --- a/package/lean/luci-app-aliddns/luasrc/model/cbi/aliddns.lua +++ /dev/null @@ -1,52 +0,0 @@ -local a=require"luci.sys" -local e=luci.model.uci.cursor() -local e=require"nixio.fs" -require("luci.sys") -local t,e,o -local m,s -t=Map("aliddns",translate("阿里DDNS客户端"),translate("基于阿里云解æžçš„ç§äººDDNS解决方案")) - -e=t:section(TypedSection,"base") -e.anonymous=true - -e:tab("basic", translate("设置")) - -enable=e:taboption("basic",Flag,"enable",translate("å¼€å¯"),translate("å¼€å¯æˆ–关闭aliddns动æ€åŸŸå")) -enable.rmempty=false -token=e:taboption("basic",Value,"app_key",translate("APP KEY")) -email=e:taboption("basic",Value,"app_secret",translate("APP SECRET")) -iface=e:taboption("basic",ListValue,"interface",translate("选择外网接å£"),translate("é™å®šè¦åŠ¨æ€aliddns的外网接å£ï¼Œå¦‚pppoe-wan")) -iface:value("",translate("选择è¦åŠ¨æ€æ›´æ–°çš„外网接å£")) -for t,e in ipairs(a.net.devices())do -if e~="lo"then iface:value(e)end -end -iface.rmempty=false -main=e:taboption("basic",Value,"main_domain",translate("主域å"),"想è¦è§£æžçš„主域å,例如:baidu.com") -main.rmempty=false -sub=e:taboption("basic",Value,"sub_domain",translate("å­åŸŸå"),"想è¦è§£æžçš„å­åŸŸå,例如:test hehe") -sub.rmempty=false -time=e:taboption("basic",Value,"time",translate("检查时间"),"域å检查时间,å•ä½åˆ†é’Ÿï¼ŒèŒƒå›´1-59") -time.rmempty=false - -e:tab("log", translate("更新记录")) ---e=t:section(TypedSection,"base",translate("更新记录")) -e.anonymous=true -local a="/var/log/aliddns.log" -tvlog=e:taboption("log",TextValue,"sylogtext") -tvlog.rows=14 -tvlog.readonly="readonly" -tvlog.wrap="off" -function tvlog.cfgvalue(e,e) -sylogtext="" -if a and nixio.fs.access(a)then -sylogtext=luci.sys.exec("tail -n 100 %s"%a) -end -return sylogtext -end -tvlog.write=function(e,e,e) -end -local e=luci.http.formvalue("cbi.apply") -if e then -io.popen("/etc/init.d/aliddns restart") -end -return t diff --git a/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po b/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po deleted file mode 100644 index 211e10d2c..000000000 --- a/package/lean/luci-app-aliddns/po/zh-cn/aliddns.po +++ /dev/null @@ -1,4 +0,0 @@ -msgid "Aliddns Client" -msgstr "阿里DDNS客户端" - - diff --git a/package/lean/luci-app-aliddns/root/etc/config/aliddns b/package/lean/luci-app-aliddns/root/etc/config/aliddns deleted file mode 100644 index 3dcd7e75a..000000000 --- a/package/lean/luci-app-aliddns/root/etc/config/aliddns +++ /dev/null @@ -1,10 +0,0 @@ - -config base 'base' - option time '30' - option enable '0' - option app_key '1' - option app_secret '1' - option interface 'br-lan' - option main_domain '1.com' - option sub_domain '2' - diff --git a/package/lean/luci-app-aliddns/root/etc/init.d/aliddns b/package/lean/luci-app-aliddns/root/etc/init.d/aliddns deleted file mode 100755 index 93bb659e6..000000000 --- a/package/lean/luci-app-aliddns/root/etc/init.d/aliddns +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=80 - -restart() -{ - /usr/sbin/aliddns -} - -start() -{ - /usr/sbin/aliddns -} - -stop() -{ - /usr/sbin/aliddns -} diff --git a/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns b/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns deleted file mode 100755 index c8dcb1e17..000000000 --- a/package/lean/luci-app-aliddns/root/etc/uci-defaults/luci-app-aliddns +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns b/package/lean/luci-app-aliddns/root/usr/sbin/aliddns deleted file mode 100755 index 7de6d904b..000000000 --- a/package/lean/luci-app-aliddns/root/usr/sbin/aliddns +++ /dev/null @@ -1,128 +0,0 @@ -#!/bin/sh - -aliddns_ak=`uci get aliddns.base.app_key 2>/dev/null` -aliddns_sk=`uci get aliddns.base.app_secret 2>/dev/null` -aliddns_record_id=`uci get aliddns.base.record_id 2>/dev/null` -time=`uci get aliddns.base.time 2>/dev/null` -aliddns_enable=`uci get aliddns.base.enable` -aliddns_domain=`uci get aliddns.base.main_domain 2>/dev/null` -aliddns_name=`uci get aliddns.base.sub_domain 2>/dev/null` -interface=`uci get aliddns.base.interface 2>/dev/null` -DATE=$(date +'%Y-%m-%d %H:%M:%S') -timestamp=`date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ"` -ip=$(ifconfig $interface 2> /dev/null | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 2>/dev/null) - -check_aliddns() { -#ip=`wget -qO- http://whatismyip.akamai.com/ 2>/dev/null` -#current_ip=`nslookup $aliddns_name.$aliddns_domain | grep "Address 1"|tail -n1|cut -d' ' -f3 2>/dev/null` -current_ip=`echo $query_result | sed 's/.*,"Value":"\([0-9\.]*\)",.*/\1/'` -echo "$DATE 当å‰è·¯ç”±IP: ${ip}" >> /var/log/aliddns.log -echo "$DATE 远程解æžIP: ${current_ip}" >> /var/log/aliddns.log -if [ "$ip" = "$current_ip" ] -then - echo "$DATE IP未改å˜ï¼Œæ— éœ€æ›´æ–°" >> /var/log/aliddns.log - exit 0 - else - echo "$DATE 更新中..." >> /var/log/aliddns.log -fi -} - -urlencode() { - # urlencode - - local length="${#1}" - i=0 - out="" - for i in $(awk "BEGIN { for ( i=0; i<$length; i++ ) { print i; } }") - do - local c="${1:$i:1}" - case $c in - [a-zA-Z0-9._-]) out="$out$c" ;; - *) out="$out`printf '%%%02X' "'$c"`" ;; - esac - i=$(($i + 1)) - done - echo -n $out -} - -send_request() { - local args="AccessKeyId=$aliddns_ak&Action=$1&Format=json&$2&Version=2015-01-09" - local hash=$(urlencode $(echo -n "GET&%2F&$(urlencode $args)" | openssl dgst -sha1 -hmac "$aliddns_sk&" -binary | openssl base64)) - wget -qO- "http://alidns.aliyuncs.com/?$args&Signature=$hash" 2> /dev/null -} - -get_recordid() { - grep -Eo '"RecordId":"[0-9]+"' | cut -d':' -f2 | tr -d '"' -} - -query_recordid() { - send_request "DescribeSubDomainRecords" "SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&SubDomain=$(urlencode "$aliddns_name").$aliddns_domain&Timestamp=$timestamp" -} - -update_record() { - send_request "UpdateDomainRecord" "RR=$(urlencode "$aliddns_name")&RecordId=$1&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" -} - -add_record() { - send_request "AddDomainRecord&DomainName=$aliddns_domain" "RR=$(urlencode "$aliddns_name")&SignatureMethod=HMAC-SHA1&SignatureNonce=$timestamp&SignatureVersion=1.0&Timestamp=$timestamp&Type=A&Value=$ip" -} - -go_record() { -if [ "$aliddns_record_id" = "" ] -then - aliddns_record_id=`echo $query_result | get_recordid` -fi -if [ "$aliddns_record_id" = "" ] -then - aliddns_record_id=`add_record | get_recordid` - echo "$DATE 添加 record $aliddns_record_id" >> /var/log/aliddns.log -else - update_record $aliddns_record_id - echo "$DATE æ›´æ–° record $aliddns_record_id" >> /var/log/aliddns.log -fi -# save to file -if [ "$aliddns_record_id" = "" ]; then - # failed - echo "$DATE : 更新出错,请检查设置ï¼" >> /var/log/aliddns.log - exit 0 -else - uci set aliddns.base.record_id=$aliddns_record_id - uci commit - echo "$DATE : æ›´æ–°æˆåŠŸï¼($ip)" >> /var/log/aliddns.log -fi -} -#将执行脚本写入crontab定时è¿è¡Œ -add_aliddns_cru(){ -wirtecron=$(cat /etc/crontabs/root | grep "$time * * * *" | grep aliddns) -if [ -z "$wirtecron" ];then - sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1 - echo "*/$time * * * * /usr/sbin/aliddns" >> /etc/crontabs/root -fi -} - -#清除过多记录 -clean_log(){ -logrow=$(grep -c "" /var/log/aliddns.log) -if [ $logrow -ge 15 ];then - cat /dev/null > /var/log/aliddns.log - echo "$DATE Logæ¡æ•°è¶…é™ï¼Œæ¸…空处ç†ï¼" >> /var/log/aliddns.log -fi -} - -#åœæ­¢æœåŠ¡ -stop_aliddns(){ - #åœæŽ‰cru里的任务 - sed -i '/aliddns/d' /etc/crontabs/root >/dev/null 2>&1 -} - -if [ "$aliddns_enable" != "1" ]; then - stop_aliddns - echo "$DATE : aliddns没有开å¯ï¼" >> /var/log/aliddns.log - else - clean_log - query_result=$(query_recordid) - check_aliddns - go_record - add_aliddns_cru -fi - From 05d0a7b6cd03858351d4656ddebc9fc1be42acf3 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 17:07:02 +0800 Subject: [PATCH 78/95] add aliyun-ddns luci-app-xlnetacc luci-app-nlbwmon by default --- include/target.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/target.mk b/include/target.mk index 5decd771f..cefb19b24 100644 --- a/include/target.mk +++ b/include/target.mk @@ -16,8 +16,8 @@ DEVICE_TYPE?=router DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \ iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ -luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd \ -luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe +luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \ +luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-nlbwmon # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets From 1b12dbb6920166e391af50bab82fffa196a98396 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Fri, 12 Jan 2018 18:41:53 +0800 Subject: [PATCH 79/95] add kernel 4.4.111 support for mvebu --- ...hy-MII-register-generation-to-a-libr.patch | 2 +- .../129-phy-add-I2C-mdio-bus.patch | 2 +- ...add-phylink-based-SFP-module-support.patch | 4 +- .../470-ClearFog-renamed-upstream.patch | 80 +++ ...-add-ClearFog-Base-device-tree-files.patch | 540 ++++++++++++++++++ 5 files changed, 624 insertions(+), 4 deletions(-) create mode 100644 target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch create mode 100644 target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch diff --git a/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch index 0b5042afd..00745f1c9 100644 --- a/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch +++ b/target/linux/mvebu/patches-4.4/120-phy-move-fixed_phy-MII-register-generation-to-a-libr.patch @@ -31,7 +31,7 @@ Signed-off-by: Russell King comment "MII PHY device drivers" config AQUANTIA_PHY -@@ -210,6 +213,7 @@ config RTL8306_PHY +@@ -205,6 +208,7 @@ config RTL8306_PHY config FIXED_PHY tristate "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" depends on PHYLIB diff --git a/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch index ad26e6b45..13f8ecfcd 100644 --- a/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch +++ b/target/linux/mvebu/patches-4.4/129-phy-add-I2C-mdio-bus.patch @@ -19,7 +19,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -238,6 +238,16 @@ config MDIO_GPIO +@@ -233,6 +233,16 @@ config MDIO_GPIO To compile this driver as a module, choose M here: the module will be called mdio-gpio. diff --git a/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch index dbfcaccac..07b1766b0 100644 --- a/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch +++ b/target/linux/mvebu/patches-4.4/132-sfp-add-phylink-based-SFP-module-support.patch @@ -30,7 +30,7 @@ Signed-off-by: Russell King --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig -@@ -230,6 +230,11 @@ config FIXED_PHY +@@ -225,6 +225,11 @@ config FIXED_PHY Currently tested with mpc866ads and mpc8349e-mitx. @@ -44,7 +44,7 @@ Signed-off-by: Russell King help --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile -@@ -62,3 +62,4 @@ obj-$(CONFIG_MDIO_MOXART) += mdio-moxart +@@ -61,3 +61,4 @@ obj-$(CONFIG_MDIO_MOXART) += mdio-moxart obj-$(CONFIG_MDIO_BCM_UNIMAC) += mdio-bcm-unimac.o obj-$(CONFIG_MICROCHIP_PHY) += microchip.o obj-$(CONFIG_MDIO_BCM_IPROC) += mdio-bcm-iproc.o diff --git a/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch b/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch new file mode 100644 index 000000000..3eeda9fd3 --- /dev/null +++ b/target/linux/mvebu/patches-4.4/470-ClearFog-renamed-upstream.patch @@ -0,0 +1,80 @@ +From b0db8cc1fe7eab722bc1f7c386132b3905d67f30 Mon Sep 17 00:00:00 2001 +From: Marko Ratkaj +Date: Fri, 7 Apr 2017 11:01:26 +0200 +Subject: [PATCH 1/2] ClearFog renamed upstream + +Signed-off-by: Marko Ratkaj +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-388-clearfog-pro.dts | 55 +++++++++++++++++++++++++++ + 2 files changed, 56 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-388-clearfog-pro.dts + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -924,6 +924,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \ + armada-385-linksys-rango.dtb \ + armada-385-linksys-shelby.dtb \ + armada-388-clearfog.dtb \ ++ armada-388-clearfog-pro.dtb \ + armada-388-db.dtb \ + armada-388-gp.dtb \ + armada-388-rd.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog-pro.dts +@@ -0,0 +1,55 @@ ++/* ++ * Device Tree file for SolidRun Clearfog Pro revision A1 rev 2.0 (88F6828) ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++#include "armada-388-clearfog.dts" ++ ++/ { ++ model = "SolidRun Clearfog Pro A1"; ++ compatible = "solidrun,clearfog-pro-a1", ++ "solidrun,clearfog-a1", "marvell,armada388", ++ "marvell,armada385", "marvell,armada380"; ++}; diff --git a/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch b/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch new file mode 100644 index 000000000..aa442d256 --- /dev/null +++ b/target/linux/mvebu/patches-4.4/471-add-ClearFog-Base-device-tree-files.patch @@ -0,0 +1,540 @@ +From b4ac5820bdc98ee24a2f73b8bd7fdf7f82db3a46 Mon Sep 17 00:00:00 2001 +From: Marko Ratkaj +Date: Fri, 7 Apr 2017 11:02:30 +0200 +Subject: [PATCH 2/2] add ClearFog Base device tree files + +Signed-off-by: Marko Ratkaj +--- + arch/arm/boot/dts/Makefile | 1 + + arch/arm/boot/dts/armada-388-clearfog-base.dts | 161 ++++++++++++ + arch/arm/boot/dts/armada-388-clearfog.dtsi | 282 +++++++++++++++++++++ + .../dts/armada-38x-solidrun-microsom-emmc.dtsi | 62 +++++ + 4 files changed, 506 insertions(+) + create mode 100644 arch/arm/boot/dts/armada-388-clearfog-base.dts + create mode 100644 arch/arm/boot/dts/armada-388-clearfog.dtsi + create mode 100644 arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi + +--- a/arch/arm/boot/dts/Makefile ++++ b/arch/arm/boot/dts/Makefile +@@ -925,6 +925,7 @@ dtb-$(CONFIG_MACH_ARMADA_38X) += \ + armada-385-linksys-shelby.dtb \ + armada-388-clearfog.dtb \ + armada-388-clearfog-pro.dtb \ ++ armada-388-clearfog-base.dtb \ + armada-388-db.dtb \ + armada-388-gp.dtb \ + armada-388-rd.dtb +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog-base.dts +@@ -0,0 +1,161 @@ ++/* ++ * Device Tree file for SolidRun Clearfog Base revision A1 rev 2.0 (88F6828) ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "armada-388-clearfog.dtsi" ++#include "armada-38x-solidrun-microsom-emmc.dtsi" ++ ++/ { ++ model = "SolidRun Clearfog Base A1"; ++ compatible = "solidrun,clearfog-base-a1", ++ "solidrun,clearfog-a1", "marvell,armada388", ++ "marvell,armada385", "marvell,armada380"; ++ ++ gpio-keys { ++ compatible = "gpio-keys"; ++ pinctrl-0 = <&rear_button_pins>; ++ pinctrl-names = "default"; ++ ++ button_0 { ++ /* The rear SW3 button */ ++ label = "Rear Button"; ++ gpios = <&gpio1 12 GPIO_ACTIVE_LOW>; ++ linux,can-disable; ++ linux,code = ; ++ }; ++ }; ++}; ++ ++ð1 { ++ phy = <&phy1>; ++}; ++ ++&gpio0 { ++ phy1_reset { ++ gpio-hog; ++ gpios = <19 GPIO_ACTIVE_LOW>; ++ output-low; ++ line-name = "phy1-reset"; ++ }; ++}; ++ ++&mdio { ++ pinctrl-0 = <&mdio_pins µsom_phy_clk_pins &clearfog_phy_pins>; ++ phy1: ethernet-phy@1 { ++ /* ++ * Annoyingly, the marvell phy driver configures the LED ++ * register, rather than preserving reset-loaded setting. ++ * We undo that rubbish here. ++ */ ++ marvell,reg-init = <3 16 0 0x101e>; ++ reg = <1>; ++ }; ++}; ++ ++&pinctrl { ++ /* phy1 reset */ ++ clearfog_phy_pins: clearfog-phy-pins { ++ marvell,pins = "mpp19"; ++ marvell,function = "gpio"; ++ }; ++ rear_button_pins: rear-button-pins { ++ marvell,pins = "mpp44"; ++ marvell,function = "gpio"; ++ }; ++}; ++ ++/* ++MPP ++18: pu gpio pca9655 int ++19: gpio phy reset ++20: pu gpio sd0 detect ++21: sd0:cmd ++22: pd gpio mikro int ++23: ++ ++24: ua1:rxd mikro rx ++25: ua1:txd mikro tx ++26: pu i2c1:sck ++27: pu i2c1:sda ++28: sd0:clk ++29: pd gpio mikro rst ++30: ++31: ++ ++32: ++33: ++34: ++35: ++36: ++37: sd0:d3 ++38: sd0:d0 ++39: sd0:d1 ++ ++40: sd0:d2 ++41: ++42: ++43: spi1:cs2 mikro cs ++44: gpio rear button sw3 ++45: ref:clk_out0 phy#0 clock ++46: ref:clk_out1 phy#1 clock ++47: ++ ++48: gpio J18 spare gpio ++49: gpio U10 I2C_IRQ(GNSS) ++50: gpio board id? ++51: ++52: ++53: ++54: gpio mikro pwm ++55: ++ ++56: pu spi1:mosi mikro mosi ++57: pd spi1:sck mikro sck ++58: spi1:miso mikro miso ++59: ++*/ +--- /dev/null ++++ b/arch/arm/boot/dts/armada-388-clearfog.dtsi +@@ -0,0 +1,282 @@ ++/* ++ * Device Tree include file for SolidRun Clearfog 88F6828 based boards ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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. ++ * ++ * This file is distributed in the hope that it will be useful ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++#include "armada-388.dtsi" ++#include "armada-38x-solidrun-microsom.dtsi" ++ ++/ { ++ aliases { ++ /* So that mvebu u-boot can update the MAC addresses */ ++ ethernet1 = ð0; ++ ethernet2 = ð1; ++ ethernet3 = ð2; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ reg_3p3v: regulator-3p3v { ++ compatible = "regulator-fixed"; ++ regulator-name = "3P3V"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-always-on; ++ }; ++ ++ soc { ++ internal-regs { ++ sata@a8000 { ++ /* pinctrl? */ ++ status = "okay"; ++ }; ++ ++ sata@e0000 { ++ /* pinctrl? */ ++ status = "okay"; ++ }; ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ usb@58000 { ++ /* CON3, nearest power. */ ++ status = "okay"; ++ }; ++ ++ usb3@f8000 { ++ /* CON7 */ ++ status = "okay"; ++ }; ++ }; ++ ++ pcie-controller { ++ status = "okay"; ++ /* ++ * The two PCIe units are accessible through ++ * the mini-PCIe connectors on the board. ++ */ ++ pcie@2,0 { ++ /* Port 1, Lane 0. CON3, nearest power. */ ++ reset-gpios = <&expander0 1 GPIO_ACTIVE_LOW>; ++ status = "okay"; ++ }; ++ }; ++ }; ++ ++ sfp: sfp { ++ compatible = "sff,sfp"; ++ i2c-bus = <&i2c1>; ++ los-gpio = <&expander0 12 GPIO_ACTIVE_HIGH>; ++ moddef0-gpio = <&expander0 15 GPIO_ACTIVE_LOW>; ++ sfp,ethernet = <ð2>; ++ tx-disable-gpio = <&expander0 14 GPIO_ACTIVE_HIGH>; ++ tx-fault-gpio = <&expander0 13 GPIO_ACTIVE_HIGH>; ++ }; ++}; ++ ++ð1 { ++ /* ethernet@30000 */ ++ bm,pool-long = <2>; ++ bm,pool-short = <1>; ++ buffer-manager = <&bm>; ++ phy-mode = "sgmii"; ++ status = "okay"; ++}; ++ ++ð2 { ++ /* ethernet@34000 */ ++ bm,pool-long = <3>; ++ bm,pool-short = <1>; ++ buffer-manager = <&bm>; ++ managed = "in-band-status"; ++ phy-mode = "sgmii"; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ clock-frequency = <400000>; ++ pinctrl-0 = <&i2c0_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++ ++ /* ++ * PCA9655 GPIO expander, up to 1MHz clock. ++ * 0-CON3 CLKREQ# ++ * 1-CON3 PERST# ++ * 2- ++ * 3-CON3 W_DISABLE ++ * 4- ++ * 5-USB3 overcurrent ++ * 6-USB3 power ++ * 7- ++ * 8-JP4 P1 ++ * 9-JP4 P4 ++ * 10-JP4 P5 ++ * 11-m.2 DEVSLP ++ * 12-SFP_LOS ++ * 13-SFP_TX_FAULT ++ * 14-SFP_TX_DISABLE ++ * 15-SFP_MOD_DEF0 ++ */ ++ expander0: gpio-expander@20 { ++ /* ++ * This is how it should be: ++ * compatible = "onnn,pca9655", "nxp,pca9555"; ++ * but you can't do this because of the way I2C works. ++ */ ++ compatible = "nxp,pca9555"; ++ gpio-controller; ++ #gpio-cells = <2>; ++ reg = <0x20>; ++ ++ pcie1_0_clkreq { ++ gpio-hog; ++ gpios = <0 GPIO_ACTIVE_LOW>; ++ input; ++ line-name = "pcie1.0-clkreq"; ++ }; ++ pcie1_0_w_disable { ++ gpio-hog; ++ gpios = <3 GPIO_ACTIVE_LOW>; ++ output-low; ++ line-name = "pcie1.0-w-disable"; ++ }; ++ usb3_ilimit { ++ gpio-hog; ++ gpios = <5 GPIO_ACTIVE_LOW>; ++ input; ++ line-name = "usb3-current-limit"; ++ }; ++ usb3_power { ++ gpio-hog; ++ gpios = <6 GPIO_ACTIVE_HIGH>; ++ output-high; ++ line-name = "usb3-power"; ++ }; ++ m2_devslp { ++ gpio-hog; ++ gpios = <11 GPIO_ACTIVE_HIGH>; ++ output-low; ++ line-name = "m.2 devslp"; ++ }; ++ }; ++ ++ /* The MCP3021 supports standard and fast modes */ ++ mikrobus_adc: mcp3021@4c { ++ compatible = "microchip,mcp3021"; ++ reg = <0x4c>; ++ }; ++}; ++ ++&i2c1 { ++ /* ++ * Routed to SFP, mikrobus, and PCIe. ++ * SFP limits this to 100kHz, and requires an AT24C01A/02/04 with ++ * address pins tied low, which takes addresses 0x50 and 0x51. ++ * Mikrobus doesn't specify beyond an I2C bus being present. ++ * PCIe uses ARP to assign addresses, or 0x63-0x64. ++ */ ++ clock-frequency = <100000>; ++ pinctrl-0 = <&clearfog_i2c1_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&pinctrl { ++ clearfog_i2c1_pins: i2c1-pins { ++ /* SFP, PCIe, mSATA, mikrobus */ ++ marvell,pins = "mpp26", "mpp27"; ++ marvell,function = "i2c1"; ++ }; ++ clearfog_sdhci_cd_pins: clearfog-sdhci-cd-pins { ++ marvell,pins = "mpp20"; ++ marvell,function = "gpio"; ++ }; ++ mikro_pins: mikro-pins { ++ /* int: mpp22 rst: mpp29 */ ++ marvell,pins = "mpp22", "mpp29"; ++ marvell,function = "gpio"; ++ }; ++ mikro_spi_pins: mikro-spi-pins { ++ marvell,pins = "mpp43"; ++ marvell,function = "spi1"; ++ }; ++ mikro_uart_pins: mikro-uart-pins { ++ marvell,pins = "mpp24", "mpp25"; ++ marvell,function = "ua1"; ++ }; ++}; ++ ++&spi1 { ++ /* ++ * Add SPI CS pins for clearfog: ++ * CS0: W25Q32 (not populated on uSOM) ++ * CS1: PIC microcontroller (Pro models) ++ * CS2: mikrobus ++ */ ++ pinctrl-0 = <&spi1_pins &mikro_spi_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; ++ ++&uart1 { ++ /* mikrobus uart */ ++ pinctrl-0 = <&mikro_uart_pins>; ++ pinctrl-names = "default"; ++ status = "okay"; ++}; +--- /dev/null ++++ b/arch/arm/boot/dts/armada-38x-solidrun-microsom-emmc.dtsi +@@ -0,0 +1,62 @@ ++/* ++ * Device Tree file for SolidRun Armada 38x Microsom add-on for eMMC ++ * ++ * Copyright (C) 2015 Russell King ++ * ++ * This board is in development; the contents of this file work with ++ * the A1 rev 2.0 of the board, which does not represent final ++ * production board. Things will change, don't expect this file to ++ * remain compatible info the future. ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file 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. ++ * ++ * This file is distributed in the hope that it will be useful ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++/ { ++ soc { ++ internal-regs { ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ }; ++ }; ++}; From f3a78b4484ce74fdd709b861d0c08384186f5921 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 14:21:52 +0800 Subject: [PATCH 80/95] fix AC58U upgrade issue --- package/system/procd/Makefile | 51 +-- .../system/procd/files/hotplug-preinit.json | 8 +- package/system/procd/files/hotplug.json | 22 +- package/system/procd/files/nand-preinit.sh | 21 - package/system/procd/files/nand.sh | 375 ------------------ package/system/procd/files/procd.sh | 36 +- 6 files changed, 58 insertions(+), 455 deletions(-) delete mode 100644 package/system/procd/files/nand-preinit.sh delete mode 100644 package/system/procd/files/nand.sh diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index c260a371a..7c8a1669b 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=procd -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git -PKG_SOURCE_DATE:=2018-01-04 -PKG_SOURCE_VERSION:=188353099cf6fc88f145cfcb84a4db3f6523528a -PKG_MIRROR_HASH:=52605b2a3caf59cdbf88ba218c6288cbe075749422efd69e985ae75bb1001488 +PKG_SOURCE_DATE:=2018-12-02 +PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e +PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -22,11 +22,9 @@ PKG_LICENSE_FILES:= PKG_MAINTAINER:=John Crispin -PKG_FLAGS:=nonshared - PKG_CONFIG_DEPENDS:= \ CONFIG_TARGET_INIT_PATH CONFIG_KERNEL_SECCOMP \ - CONFIG_NAND_SUPPORT CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \ + CONFIG_PROCD_SHOW_BOOT CONFIG_PROCD_ZRAM_TMPFS \ CONFIG_KERNEL_NAMESPACES CONFIG_PACKAGE_procd-ujail CONFIG_PACKAGE_procd-seccomp include $(INCLUDE_DIR)/package.mk @@ -42,7 +40,7 @@ TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lrt) define Package/procd SECTION:=base CATEGORY:=Base system - DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus +NAND_SUPPORT:procd-nand + DEPENDS:=+ubusd +ubus +libjson-script +ubox +USE_GLIBC:librt +libubox +libubus TITLE:=OpenWrt system process manager endef @@ -60,20 +58,6 @@ define Package/procd-seccomp TITLE:=OpenWrt process seccomp helper + utrace endef -define Package/procd-nand - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=@NAND_SUPPORT +ubi-utils - TITLE:=OpenWrt sysupgrade nand helper -endef - -define Package/procd-nand-firstboot - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=procd-nand - TITLE:=OpenWrt firstboot nand helper -endef - define Package/procd/config menu "Configuration" depends on PACKAGE_procd @@ -91,10 +75,6 @@ endmenu endef -ifeq ($(CONFIG_NAND_SUPPORT),y) - CMAKE_OPTIONS += -DBUILD_UPGRADED=1 -endif - ifeq ($(CONFIG_PROCD_SHOW_BOOT),y) CMAKE_OPTIONS += -DSHOW_BOOT_ON_CONSOLE=1 endif @@ -113,7 +93,7 @@ CMAKE_OPTIONS += -DSECCOMP_SUPPORT=$(SECCOMP) -DUTRACE_SUPPORT=$(SECCOMP) define Package/procd/install $(INSTALL_DIR) $(1)/sbin $(1)/etc $(1)/lib/functions - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger} $(1)/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{init,procd,askfirst,udevtrigger,upgraded} $(1)/sbin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsetlbf.so $(1)/lib $(INSTALL_BIN) ./files/reload_config $(1)/sbin/ $(INSTALL_DATA) ./files/hotplug*.json $(1)/etc/ @@ -129,25 +109,10 @@ define Package/procd-seccomp/install $(INSTALL_DIR) $(1)/sbin $(1)/lib $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-seccomp.so $(1)/lib $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/utrace $(1)/sbin/ - ln -s utrace $(1)/sbin/seccomp-trace + $(LN) utrace $(1)/sbin/seccomp-trace $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libpreload-trace.so $(1)/lib endef -define Package/procd-nand/install - $(INSTALL_DIR) $(1)/sbin $(1)/lib/upgrade - - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upgraded $(1)/sbin/ - $(INSTALL_DATA) ./files/nand.sh $(1)/lib/upgrade/ -endef - -define Package/procd-nand-firstboot/install - $(INSTALL_DIR) $(1)/lib/preinit - - $(INSTALL_DATA) ./files/nand-preinit.sh $(1)/lib/preinit/60-nand-firstboot.sh -endef - $(eval $(call BuildPackage,procd)) $(eval $(call BuildPackage,procd-ujail)) $(eval $(call BuildPackage,procd-seccomp)) -$(eval $(call BuildPackage,procd-nand)) -$(eval $(call BuildPackage,procd-nand-firstboot)) diff --git a/package/system/procd/files/hotplug-preinit.json b/package/system/procd/files/hotplug-preinit.json index 58afc6c69..658c68547 100644 --- a/package/system/procd/files/hotplug-preinit.json +++ b/package/system/procd/files/hotplug-preinit.json @@ -8,11 +8,11 @@ [ "load-firmware", "/lib/firmware" ], [ "return" ] ] - ], - ], - }, ], + ] + ] + } ], [ "if", [ "eq", "SUBSYSTEM", "button" ], [ "exec", "/etc/rc.button/failsafe" ] - ], + ] ] diff --git a/package/system/procd/files/hotplug.json b/package/system/procd/files/hotplug.json index e5f8d967e..1c949bbea 100644 --- a/package/system/procd/files/hotplug.json +++ b/package/system/procd/files/hotplug.json @@ -4,27 +4,27 @@ [ "if", [ "and", [ "has", "MAJOR" ], - [ "has", "MINOR" ], + [ "has", "MINOR" ] ], [ [ "if", [ "eq", "DEVNAME", - [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ], + [ "null", "full", "ptmx", "zero", "tty", "net", "random", "urandom" ] ], [ [ "makedev", "/dev/%DEVNAME%", "0666" ], - [ "return" ], + [ "return" ] ] ], [ "if", [ "regex", "DEVNAME", "^snd" ], - [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ], + [ "makedev", "/dev/%DEVNAME%", "0660", "audio" ] ], [ "if", [ "has", "DEVNAME" ], - [ "makedev", "/dev/%DEVNAME%", "0600" ], - ], - ], + [ "makedev", "/dev/%DEVNAME%", "0600" ] + ] + ] ], [ "if", [ "has", "FIRMWARE" ], @@ -33,14 +33,14 @@ [ "load-firmware", "/lib/firmware" ], [ "return" ] ] - ], + ] ], "remove" : [ [ "if", [ "and", [ "has", "DEVNAME" ], [ "has", "MAJOR" ], - [ "has", "MINOR" ], + [ "has", "MINOR" ] ], [ "rm", "/dev/%DEVNAME%" ] ] @@ -49,7 +49,7 @@ [ "if", [ "and", [ "has", "BUTTON" ], - [ "eq", "SUBSYSTEM", "button" ], + [ "eq", "SUBSYSTEM", "button" ] ], [ "button", "/etc/rc.button/%BUTTON%" ] ], @@ -65,5 +65,5 @@ [ "isdir", "/etc/hotplug.d/%SUBSYSTEM%" ], [ "exec", "/sbin/hotplug-call", "%SUBSYSTEM%" ] ] - ], + ] ] diff --git a/package/system/procd/files/nand-preinit.sh b/package/system/procd/files/nand-preinit.sh deleted file mode 100644 index cf596246d..000000000 --- a/package/system/procd/files/nand-preinit.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 OpenWrt.org - -nand_takeover() { - . /lib/upgrade/nand.sh - mtd=$(find_mtd_index "$CI_UBIPART") - esize=$(cat /proc/mtd | grep mtd$mtd |cut -d" " -f 3) - [ -z "$esize" ] && return 1 - esize=$(printf "%d" 0x$esize) - for a in `seq 0 64`; do - mtd -o $((a * esize)) -l 400 dump /dev/mtd$mtd > /tmp/takeover.hdr - MAGIC=$(dd if=/tmp/takeover.hdr bs=1 skip=261 count=5 2> /dev/null) - SIZE=$(printf "%d" 0x$(dd if=/tmp/takeover.hdr bs=4 count=1 2> /dev/null | hexdump -v -n 4 -e '1/1 "%02x"')) - [ "$MAGIC" = "ustar" ] && { - mtd -o $((a * esize)) -l $((SIZE + 4)) dump /dev/mtd$mtd | dd bs=1 skip=4 of=/tmp/sysupgrade.tar - nand_do_upgrade_stage2 /tmp/sysupgrade.tar - } - done -} - -boot_hook_add initramfs nand_takeover diff --git a/package/system/procd/files/nand.sh b/package/system/procd/files/nand.sh deleted file mode 100644 index ebaaf2aa1..000000000 --- a/package/system/procd/files/nand.sh +++ /dev/null @@ -1,375 +0,0 @@ -#!/bin/sh -# Copyright (C) 2014 OpenWrt.org -# - -. /lib/functions.sh - -# 'kernel' partition on NAND contains the kernel -CI_KERNPART="kernel" - -# 'ubi' partition on NAND contains UBI -CI_UBIPART="ubi" - -ubi_mknod() { - local dir="$1" - local dev="/dev/$(basename $dir)" - - [ -e "$dev" ] && return 0 - - local devid="$(cat $dir/dev)" - local major="${devid%%:*}" - local minor="${devid##*:}" - mknod "$dev" c $major $minor -} - -nand_find_volume() { - local ubidevdir ubivoldir - ubidevdir="/sys/devices/virtual/ubi/$1" - [ ! -d "$ubidevdir" ] && return 1 - for ubivoldir in $ubidevdir/${1}_*; do - [ ! -d "$ubivoldir" ] && continue - if [ "$( cat $ubivoldir/name )" = "$2" ]; then - basename $ubivoldir - ubi_mknod "$ubivoldir" - return 0 - fi - done -} - -nand_find_ubi() { - local ubidevdir ubidev mtdnum - mtdnum="$( find_mtd_index $1 )" - [ ! "$mtdnum" ] && return 1 - for ubidevdir in /sys/devices/virtual/ubi/ubi*; do - [ ! -d "$ubidevdir" ] && continue - cmtdnum="$( cat $ubidevdir/mtd_num )" - [ ! "$mtdnum" ] && continue - if [ "$mtdnum" = "$cmtdnum" ]; then - ubidev=$( basename $ubidevdir ) - ubi_mknod "$ubidevdir" - echo $ubidev - return 0 - fi - done -} - -nand_get_magic_long() { - dd if="$1" skip=$2 bs=4 count=1 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' -} - -get_magic_long_tar() { - ( tar xf $1 $2 -O | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null -} - -identify_magic() { - local magic=$1 - case "$magic" in - "55424923") - echo "ubi" - ;; - "31181006") - echo "ubifs" - ;; - "68737173") - echo "squashfs" - ;; - "d00dfeed") - echo "fit" - ;; - "4349"*) - echo "combined" - ;; - *) - echo "unknown $magic" - ;; - esac -} - - -identify() { - identify_magic $(nand_get_magic_long "$1" "${2:-0}") -} - -identify_tar() { - identify_magic $(get_magic_long_tar "$1" "$2") -} - -nand_restore_config() { - sync - local ubidev=$( nand_find_ubi $CI_UBIPART ) - local ubivol="$( nand_find_volume $ubidev rootfs_data )" - [ ! "$ubivol" ] && - ubivol="$( nand_find_volume $ubidev rootfs )" - mkdir /tmp/new_root - if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then - echo "mounting ubifs $ubivol failed" - rmdir /tmp/new_root - return 1 - fi - mv "$1" "/tmp/new_root/sysupgrade.tgz" - umount /tmp/new_root - sync - rmdir /tmp/new_root -} - -nand_upgrade_prepare_ubi() { - local rootfs_length="$1" - local rootfs_type="$2" - local has_kernel="${3:-0}" - local has_env="${4:-0}" - - local mtdnum="$( find_mtd_index "$CI_UBIPART" )" - if [ ! "$mtdnum" ]; then - echo "cannot find ubi mtd partition $CI_UBIPART" - return 1 - fi - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - if [ ! "$ubidev" ]; then - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - fi - - if [ ! "$ubidev" ]; then - ubiformat /dev/mtd$mtdnum -y - ubiattach -m "$mtdnum" - sync - ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_env" -gt 0 ] && { - ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB - ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB - } - fi - - local kern_ubivol="$( nand_find_volume $ubidev kernel )" - local root_ubivol="$( nand_find_volume $ubidev rootfs )" - local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" - - # remove ubiblock device of rootfs - local root_ubiblk="ubiblock${root_ubivol:3}" - if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then - echo "removing $root_ubiblk" - if ! ubiblock -r /dev/$root_ubivol; then - echo "cannot remove $root_ubiblk" - return 1; - fi - fi - - # kill volumes - [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N kernel || true - [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs || true - [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true - - # update kernel - if [ "$has_kernel" = "1" ]; then - if ! ubimkvol /dev/$ubidev -N kernel -s $kernel_length; then - echo "cannot create kernel volume" - return 1; - fi - fi - - # update rootfs - local root_size_param - if [ "$rootfs_type" = "ubifs" ]; then - root_size_param="-m" - else - root_size_param="-s $rootfs_length" - fi - if ! ubimkvol /dev/$ubidev -N rootfs $root_size_param; then - echo "cannot create rootfs volume" - return 1; - fi - - # create rootfs_data for non-ubifs rootfs - if [ "$rootfs_type" != "ubifs" ]; then - if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then - echo "cannot initialize rootfs_data volume" - return 1 - fi - fi - sync - return 0 -} - -nand_do_upgrade_success() { - local conf_tar="/tmp/sysupgrade.tgz" - - sync - [ -f "$conf_tar" ] && nand_restore_config "$conf_tar" - echo "sysupgrade successful" - umount -a - reboot -f -} - -# Flash the UBI image to MTD partition -nand_upgrade_ubinized() { - local ubi_file="$1" - local mtdnum="$(find_mtd_index "$CI_UBIPART")" - - [ ! "$mtdnum" ] && { - CI_UBIPART="rootfs" - mtdnum="$(find_mtd_index "$CI_UBIPART")" - } - - if [ ! "$mtdnum" ]; then - echo "cannot find mtd device $CI_UBIPART" - umount -a - reboot -f - fi - - local mtddev="/dev/mtd${mtdnum}" - ubidetach -p "${mtddev}" || true - sync - ubiformat "${mtddev}" -y -f "${ubi_file}" - ubiattach -p "${mtddev}" - nand_do_upgrade_success -} - -# Write the UBIFS image to UBI volume -nand_upgrade_ubifs() { - local rootfs_length=`(cat $1 | wc -c) 2> /dev/null` - - nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - local root_ubivol="$(nand_find_volume $ubidev rootfs)" - ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1 - - nand_do_upgrade_success -} - -nand_board_name() { - if type 'platform_nand_board_name' >/dev/null 2>/dev/null; then - platform_nand_board_name - return - fi - - cat /tmp/sysinfo/board_name -} - -nand_upgrade_tar() { - local tar_file="$1" - local board_name="$(nand_board_name)" - local kernel_mtd="$(find_mtd_index $CI_KERNPART)" - - local kernel_length=`(tar xf $tar_file sysupgrade-$board_name/kernel -O | wc -c) 2> /dev/null` - local rootfs_length=`(tar xf $tar_file sysupgrade-$board_name/root -O | wc -c) 2> /dev/null` - - local rootfs_type="$(identify_tar "$tar_file" sysupgrade-$board_name/root)" - - local has_kernel=1 - local has_env=0 - - [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { - tar xf $tar_file sysupgrade-$board_name/kernel -O | mtd write - $CI_KERNPART - } - [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 - - nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$has_kernel" "$has_env" - - local ubidev="$( nand_find_ubi "$CI_UBIPART" )" - [ "$has_kernel" = "1" ] && { - local kern_ubivol="$(nand_find_volume $ubidev kernel)" - tar xf $tar_file sysupgrade-$board_name/kernel -O | \ - ubiupdatevol /dev/$kern_ubivol -s $kernel_length - - } - - local root_ubivol="$(nand_find_volume $ubidev rootfs)" - tar xf $tar_file sysupgrade-$board_name/root -O | \ - ubiupdatevol /dev/$root_ubivol -s $rootfs_length - - - nand_do_upgrade_success -} - -# Recognize type of passed file and start the upgrade process -nand_do_upgrade_stage2() { - local file_type=$(identify $1) - - if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then - platform_nand_pre_upgrade "$1" - fi - - [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" - - case "$file_type" in - "ubi") nand_upgrade_ubinized $1;; - "ubifs") nand_upgrade_ubifs $1;; - *) nand_upgrade_tar $1;; - esac -} - -nand_upgrade_stage2() { - [ $1 = "nand" ] && { - [ -f "$2" ] && { - touch /tmp/sysupgrade - - killall -9 telnetd - killall -9 dropbear - killall -9 ash - - kill_remaining TERM - sleep 3 - kill_remaining KILL - - sleep 1 - - if [ -n "$(rootfs_type)" ]; then - v "Switching to ramdisk..." - run_ramfs ". /lib/functions.sh; include /lib/upgrade; nand_do_upgrade_stage2 $2" - else - nand_do_upgrade_stage2 $2 - fi - return 0 - } - echo "Nand upgrade failed" - exit 1 - } -} - -nand_upgrade_stage1() { - [ -f /tmp/sysupgrade-nand-path ] && { - path="$(cat /tmp/sysupgrade-nand-path)" - [ "$SAVE_CONFIG" != 1 -a -f "$CONF_TAR" ] && - rm $CONF_TAR - - ubus call system nandupgrade "{\"path\": \"$path\" }" - exit 0 - } -} - -# Check if passed file is a valid one for NAND sysupgrade. Currently it accepts -# 3 types of files: -# 1) UBI - should contain an ubinized image, header is checked for the proper -# MAGIC -# 2) UBIFS - should contain UBIFS partition that will replace "rootfs" volume, -# header is checked for the proper MAGIC -# 3) TAR - archive has to include "sysupgrade-BOARD" directory with a non-empty -# "CONTROL" file (at this point its content isn't verified) -# -# You usually want to call this function in platform_check_image. -# -# $(1): board name, used in case of passing TAR file -# $(2): file to be checked -nand_do_platform_check() { - local board_name="$1" - local tar_file="$2" - local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` - local file_type="$(identify $2)" - - [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && { - echo "Invalid sysupgrade file." - return 1 - } - - return 0 -} - -# Start NAND upgrade process -# -# $(1): file to be used for upgrade -nand_do_upgrade() { - echo -n $1 > /tmp/sysupgrade-nand-path - cp /sbin/upgraded /tmp/ - nand_upgrade_stage1 -} diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index e6ca8a6bc..b4b6faa66 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -38,6 +38,20 @@ PROCD_RELOAD_DELAY=1000 _PROCD_SERVICE= +procd_lock() { + local basescript=$(readlink "$initscript") + local service_name="$(basename ${basescript:-$initscript})" + + flock -n 1000 &> /dev/null + if [ "$?" != "0" ]; then + exec 1000>/var/lock/procd_${service_name}.lock + flock 1000 + if [ "$?" != "0" ]; then + logger "warning: procd flock for $service_name failed" + fi + fi +} + _procd_call() { local old_cb @@ -47,6 +61,7 @@ _procd_call() { } _procd_wrapper() { + procd_lock while [ -n "$1" ]; do eval "$1() { _procd_call _$1 \"\$@\"; }" shift @@ -79,6 +94,9 @@ _procd_close_service() { _procd_open_trigger service_triggers _procd_close_trigger + _procd_open_data + service_data + _procd_close_data _procd_ubus_call ${1:-set} } @@ -134,6 +152,18 @@ _procd_close_trigger() { json_close_array } +_procd_open_data() { + let '_procd_data_open = _procd_data_open + 1' + [ "$_procd_data_open" -gt 1 ] && return + json_add_object "data" +} + +_procd_close_data() { + let '_procd_data_open = _procd_data_open - 1' + [ "$_procd_data_open" -lt 1 ] || return + json_close_object +} + _procd_open_validate() { json_select .. json_add_array "validate" @@ -213,7 +243,7 @@ _procd_set_param() { json_add_string "" "$@" json_close_array ;; - nice) + nice|term_timeout) json_add_int "$type" "$1" ;; reload_signal) @@ -383,6 +413,10 @@ _procd_send_signal() { local instance="$2" local signal="$3" + case "$signal" in + [A-Z]*) signal="$(kill -l "$signal" 2>/dev/null)" || return 1;; + esac + json_init json_add_string name "$service" [ -n "$instance" -a "$instance" != "*" ] && json_add_string instance "$instance" From 06cfc885847701a1abfad57d833ca8566628af89 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 15:04:50 +0800 Subject: [PATCH 81/95] add nlbwmon zh-cn --- package/lean/default-settings/Makefile | 2 +- .../default-settings/i18n/nlbwmon.zh-cn.po | 366 ++++++++++++++++++ 2 files changed, 367 insertions(+), 1 deletion(-) create mode 100644 package/lean/default-settings/i18n/nlbwmon.zh-cn.po diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 60ec005ac..4b05ecd9f 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=30 +PKG_RELEASE:=31 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/i18n/nlbwmon.zh-cn.po b/package/lean/default-settings/i18n/nlbwmon.zh-cn.po new file mode 100644 index 000000000..54fb3f649 --- /dev/null +++ b/package/lean/default-settings/i18n/nlbwmon.zh-cn.po @@ -0,0 +1,366 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "%d IPv4-only hosts" +msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv4" + +msgid "%d IPv6-only hosts" +msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv6" + +msgid "%d dual-stack hosts" +msgstr "%d 个åŒå议栈主机" + +msgid "%s and %s" +msgstr "%s å’Œ %s" + +msgid "%s, %s and %s" +msgstr "%s, %s å’Œ %s" + +msgid "-1 - Restart every last day of month" +msgstr "-1 - æ¯æœˆçš„最åŽä¸€å¤©é‡æ–°å¼€å§‹" + +msgid "-7 - Restart a week before end of month" +msgstr "-7 - æ¯æœˆåº•å‰ä¸€å‘¨é‡æ–°å¼€å§‹" + +msgid "1 - Restart every 1st of month" +msgstr "1 - æ¯æœˆçš„第一天é‡æ–°å¼€å§‹" + +msgid "10m - frequent commits at the expense of flash wear" +msgstr "10m - 频ç¹æ交,闪存æŸè€—的开销也增大" + +msgid "12h - compromise between risk of data loss and flash wear" +msgstr "12h - 平衡统计数æ®ä¸¢å¤±çš„风险以åŠé—ªå­˜ä½¿ç”¨å¯¿å‘½" + +msgid "24h - least flash wear at the expense of data loss risk" +msgstr "24h - 以数æ®ä¸¢å¤±é£Žé™©çš„代价æ¢å–最å°çš„闪存æŸè€—" + +msgid "30s - refresh twice per minute for reasonably current stats" +msgstr "30s - æ¯åˆ†é’Ÿåˆ·æ–°äºŒæ¬¡ä»¥èŽ·å¾—较准确的当å‰ç»Ÿè®¡å€¼" + +msgid "5m - rarely refresh to avoid frequently clearing conntrack counters" +msgstr "5m - 较少刷新以é¿å…频ç¹æ¸…除连接跟踪计数器" + +msgid "60s - commit minutely, useful for non-flash storage" +msgstr "60s - æ¯åˆ†é’Ÿæ交,适用于éžé—ªå­˜ç±»åž‹å­˜å‚¨" + +msgid "0 connections" +msgstr "连接:0" + +msgid "0 hosts" +msgstr "主机:0" + +msgid "0% IPv6 support rate among hosts" +msgstr "æ”¯æŒ IPv6 的主机比例:0%" + +msgid "0B total IPv6 download" +msgstr "IPv6 总下载é‡ï¼š0B" + +msgid "0% of the total traffic is IPv6" +msgstr "IPv6 æµé‡æ¯”例:0%" + +msgid "0B total IPv6 upload" +msgstr "IPv6 总上传é‡ï¼š0B" + +msgid "0 cause the most connections" +msgstr "0 是连接数最多的åè®®" + +msgid "0 cause the most download" +msgstr "0 是下载é‡æœ€å¤§çš„åè®®" + +msgid "0 cause the most upload" +msgstr "0 是上传é‡æœ€å¤§çš„åè®®" + +msgid "0 different application protocols" +msgstr "0 ç§ä¸åŒçš„应用层åè®®" + +msgid "0 download" +msgstr "下载:0" + +msgid "0 upload" +msgstr "上传:0" + +msgid "Accounting period" +msgstr "统计周期" + +msgid "Advanced Settings" +msgstr "高级设置" + +msgid "Application" +msgstr "应用层åè®®" + +msgid "Application Protocols" +msgstr "应用层åè®®" + +msgid "Backup" +msgstr "备份" + +msgid "Bandwidth Monitor" +msgstr "带宽监控" + +msgid "CSV, grouped by IP" +msgstr "CSV,按 IP 分组" + +msgid "CSV, grouped by MAC" +msgstr "CSV,按 MAC 分组" + +msgid "CSV, grouped by protocol" +msgstr "CSV,按å议分组" + +msgid "" +"Changing the accounting interval type will invalidate existing databases!" +"
Download backup." +msgstr "" +"更改统计周期类型会使现有数æ®åº“无效ï¼
下载备份." + +msgid "" +"Choose \"Day of month\" to restart the accounting period monthly on a " +"specific date, e.g. every 3rd. Choose \"Fixed interval\" to restart the " +"accounting period exactly every N days, beginning at a given date." +msgstr "" +"选择“æ¯æœˆçš„æŸä¸€å¤©â€æ¥è®¾ç½®ç»Ÿè®¡å‘¨æœŸçš„é‡å¯æ—¶é—´ï¼Œä¾‹å¦‚:æ¯ä¸ªæœˆçš„第 3 天。选择“固定周" +"期â€æ¥è®¾ç½®ä»Žç»™å®šæ—¥æœŸå¼€å§‹æ¯ N 天é‡å¯ç»Ÿè®¡å‘¨æœŸã€‚" + +msgid "Commit interval" +msgstr "æ交间隔" + +msgid "Compress database" +msgstr "压缩数æ®åº“" + +msgid "Configuration" +msgstr "é…ç½®" + +msgid "Conn." +msgstr "连接" + +msgid "Connections" +msgstr "连接" + +msgid "Connections / Host" +msgstr "连接 / 主机" + +msgid "Database directory" +msgstr "æ•°æ®åº“目录" + +msgid "" +"Database storage directory. One file per accounting period will be placed " +"into this directory." +msgstr "æ•°æ®åº“存储目录。æ¯ä¸ªâ€œç»Ÿè®¡å‘¨æœŸâ€çš„文件将被放到这个目录中。" + +msgid "Day of month" +msgstr "æ¯æœˆçš„æŸä¸€å¤©" + +msgid "" +"Day of month to restart the accounting period. Use negative values to count " +"towards the end of month, e.g. \"-5\" to specify the 27th of July or the " +"24th of Februrary." +msgstr "" +"æ¯ä¸ªæœˆé‡å¯ç»Ÿè®¡å‘¨æœŸçš„日期。使用负数表示从月底开始计算,例如:\"-5\" å¯ä»¥è¡¨" +"示 7 月份的 27 å·æˆ–者 2 月份的 24 å·ã€‚" + +msgid "Display" +msgstr "显示" + +msgid "Down. (Bytes / Pkts.)" +msgstr "下载(字节 / æ•°æ®åŒ…)" + +msgid "Download (Bytes / Packets)" +msgstr "下载(字节 / æ•°æ®åŒ…)" + +msgid "Download / Application" +msgstr "下载 / 应用层åè®®" + +msgid "Download Database Backup" +msgstr "下载数æ®åº“备份" + +msgid "Dualstack enabled hosts" +msgstr "åŒå议栈主机" + +msgid "Due date" +msgstr "é‡ç½®æ—¥æœŸ" + +msgid "Export" +msgstr "导出" + +msgid "Family" +msgstr "å议类型" + +msgid "Fixed interval" +msgstr "固定周期" + +msgid "Force reload…" +msgstr "强制é‡æ–°åŠ è½½..." + +msgid "General Settings" +msgstr "基本设置" + +msgid "Generate Backup" +msgstr "生æˆå¤‡ä»½" + +msgid "Host" +msgstr "主机" + +msgid "Hostname: example.org" +msgstr "主机å:example.org" + +msgid "IPv4 vs. IPv6" +msgstr "IPv4 与 IPv6" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Interval" +msgstr "周期" + +msgid "" +"Interval at which the temporary in-memory database is committed to the " +"persistent database directory." +msgstr "将内存中的临时数æ®åº“æ交到æŒä¹…性数æ®åº“目录的间隔时间。" + +msgid "" +"Interval at which traffic counters of still established connections are " +"refreshed from netlink information." +msgstr "从 netlink ä¿¡æ¯ä¸­åˆ·æ–°â€œå·²å»ºç«‹è¿žæŽ¥â€çš„æµé‡è®¡æ•°å™¨çš„间隔时间。" + +msgid "Invalid or empty backup archive" +msgstr "备份存档无效或为空" + +msgid "JSON dump" +msgstr "JSON 输出" + +msgid "Length of accounting interval in days." +msgstr "统计周期(天)。" + +msgid "Local interfaces" +msgstr "本地接å£" + +msgid "Local subnets" +msgstr "本地å­ç½‘" + +msgid "MAC" +msgstr "MAC" + +msgid "Maximum entries" +msgstr "最大æ¡ç›®" + +msgid "" +"Maximum number of accounting periods to keep, use zero to keep databases " +"forever." +msgstr "ä¿ç•™çš„统计周期数æ®åº“的最大数é‡ï¼Œè®¾ç½® 0 表示ä¸é™åˆ¶ã€‚" + +msgid "Netlink Bandwidth Monitor" +msgstr "网络带宽监视器" + +msgid "Netlink Bandwidth Monitor - Backup / Restore" +msgstr "网络带宽监视器 - 备份 / æ¢å¤" + +msgid "Netlink Bandwidth Monitor - Configuration" +msgstr "网络带宽监视器 - é…ç½®" + +msgid "No data recorded yet." +msgstr "æš‚æ— æ•°æ®è®°å½•ã€‚" + +msgid "Only conntrack streams from or to any of these networks are counted." +msgstr "仅统计æ¥è‡ªæˆ–目标为这些网络接å£çš„连接æµé‡ã€‚" + +msgid "Only conntrack streams from or to any of these subnets are counted." +msgstr "仅统计æ¥è‡ªæˆ–目标为这些å­ç½‘的连接æµé‡ã€‚" + +msgid "Preallocate database" +msgstr "预分é…æ•°æ®åº“" + +msgid "Protocol" +msgstr "åè®®" + +msgid "Protocol Mapping" +msgstr "å议映射" + +msgid "" +"Protocol mappings to distinguish traffic types per host, one mapping per " +"line. The first value specifies the IP protocol, the second value the port " +"number and the third column is the name of the mapped protocol." +msgstr "" +"å议映射用于区分æµé‡ç±»åž‹ï¼Œæ¯è¡Œä¸€æ¡ã€‚第一个值指定 IP å议类型,第二个值是" +"端å£å·ï¼Œç¬¬ä¸‰ä¸ªå€¼æ˜¯æ˜ å°„çš„åè®®å称。" + +msgid "Refresh interval" +msgstr "刷新间隔" + +msgid "Restore" +msgstr "æ¢å¤" + +msgid "Restore Database Backup" +msgstr "æ¢å¤æ•°æ®åº“备份" + +msgid "Select accounting period:" +msgstr "选择统计周期:" + +msgid "Source IP" +msgstr "æº IP" + +msgid "Start date" +msgstr "起始日期" + +msgid "Start date of the first accounting period, e.g. begin of ISP contract." +msgstr "第一个统计周期的起始日期,例如:ISP åˆçº¦çš„起始日期。" + +msgid "Stored periods" +msgstr "储存周期" + +msgid "" +"The Netlink Bandwidth Monitor (nlbwmon) is a lightweight, efficient traffic " +"accounting program keeping track of bandwidth usage per host and protocol." +msgstr "" +"网络带宽监视器(nlbwmon)是一个轻é‡ã€é«˜æ•ˆçš„æµé‡ç»Ÿè®¡ç¨‹åºï¼Œå¯ä»¥ç»Ÿè®¡æ¯ä¸ªä¸»æœºå’Œ" +"å议的带宽使用情况。" + +msgid "The following database files have been restored: %s" +msgstr "以下数æ®åº“文件已æ¢å¤ï¼š%s" + +msgid "" +"The maximum amount of entries that should be put into the database, setting " +"the limit to 0 will allow databases to grow indefinitely." +msgstr "æ•°æ®åº“中的最大æ¡ç›®æ•°é‡, 设置为 0 å°†å…许数æ®åº“æ— é™å¢žé•¿ã€‚" + +msgid "Traffic / Host" +msgstr "æµé‡ / 主机" + +msgid "Traffic Distribution" +msgstr "æµé‡åˆ†å¸ƒ" + +msgid "Up. (Bytes / Pkts.)" +msgstr "上传(字节 / æ•°æ®åŒ…)" + +msgid "Upload (Bytes / Packets)" +msgstr "上传(字节 / æ•°æ®åŒ…)" + +msgid "Upload / Application" +msgstr "上传 / 应用层åè®®" + +msgid "Vendor: Example Corp." +msgstr "供应商: Example Corp." + +msgid "Warning" +msgstr "警告" + +msgid "" +"Whether to gzip compress archive databases. Compressing the database files " +"makes accessing old data slightly slower but helps to reduce storage " +"requirements." +msgstr "" +"是å¦ä½¿ç”¨ gzip 压缩数æ®åº“存档。压缩数æ®åº“文件会使访问旧数æ®ç¨å¾®æ…¢ä¸€äº›, 但有助" +"于å‡å°‘存储å ç”¨ç©ºé—´ã€‚" + +msgid "" +"Whether to preallocate the maximum possible database size in memory. This is " +"mainly useful for memory constrained systems which might not be able to " +"satisfy memory allocation after longer uptime periods." +msgstr "" +"是å¦é¢„先分é…æ•°æ®åº“最大å¯èƒ½å ç”¨çš„内存大å°ã€‚这主è¦é€‚用于内存较å°ç³»ç»Ÿï¼Œè¿™äº›ç³»ç»Ÿ" +"在长时间è¿è¡Œä¹‹åŽå¯èƒ½æ— æ³•æ»¡è¶³æ•°æ®åº“的内存需求。" + +msgid "no traffic" +msgstr "æ— æµé‡æ•°æ®" + +msgid "other" +msgstr "其他" From 6f413dab2836f0cff7b7ca9c2ee3dd442b0cda11 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 15:29:07 +0800 Subject: [PATCH 82/95] extend wndr4300/3700v4 rom to 128MB --- target/linux/ar71xx/image/legacy.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index d83db22a4..a4b97a86a 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -271,7 +271,7 @@ wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmw wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter) tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro -wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,512k(pot),2048k(language),512k(config),3072k(traffic_meter),2048k(kernel),23552k(ubi),25600k@0x6c0000(firmware),256k(caldata_backup),-(reserved) +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),121856k(ubi),123904k@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_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi) From b1266c659b9fc64d439aa3edc8cb3bbcc9e4f42c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 16:14:03 +0800 Subject: [PATCH 83/95] fix some target VLAN switch untagged settings --- package/base-files/Makefile | 32 +- package/base-files/files/bin/config_generate | 10 +- package/base-files/files/etc/group | 1 + package/base-files/files/etc/init.d/led | 1 + package/base-files/files/etc/init.d/system | 2 +- package/base-files/files/etc/openwrt_release | 3 +- package/base-files/files/etc/rc.common | 21 +- package/base-files/files/etc/sysctl.conf | 1 + package/base-files/files/lib/functions.sh | 25 +- .../base-files/files/lib/functions/leds.sh | 12 + .../files/lib/functions/uci-defaults.sh | 318 ++++++++--------- .../lib/preinit/{10_sysinfo => 02_sysinfo} | 0 .../files/lib/preinit/10_indicate_preinit | 2 +- .../files/lib/preinit/40_run_failsafe_hook | 6 +- .../files/lib/preinit/99_10_failsafe_login | 11 +- .../base-files/files/lib/upgrade/common.sh | 192 +++------- package/base-files/files/lib/upgrade/nand.sh | 329 ++++++++++++++++++ package/base-files/files/lib/upgrade/stage2 | 150 ++++++++ package/base-files/files/sbin/sysupgrade | 100 +++--- package/base-files/files/usr/lib/os-release | 6 +- package/base-files/image-config.in | 19 +- 21 files changed, 817 insertions(+), 424 deletions(-) rename package/base-files/files/lib/preinit/{10_sysinfo => 02_sysinfo} (100%) create mode 100644 package/base-files/files/lib/upgrade/nand.sh create mode 100755 package/base-files/files/lib/upgrade/stage2 diff --git a/package/base-files/Makefile b/package/base-files/Makefile index 3fcf20a84..a7cc4ca48 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -9,9 +9,10 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=173.3 +PKG_RELEASE:=181 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ @@ -19,7 +20,14 @@ PKG_BUILD_DEPENDS:=usign/host PKG_LICENSE:=GPL-2.0 # Extend depends from version.mk -PKG_CONFIG_DEPENDS += CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE +PKG_CONFIG_DEPENDS += \ + CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE \ + CONFIG_NAND_SUPPORT \ + CONFIG_CLEAN_IPKG \ + CONFIG_PER_FEED_REPO \ + CONFIG_PER_FEED_REPO_ADD_DISABLED \ + CONFIG_PER_FEED_REPO_ADD_COMMENTED \ + $(foreach feed,$(FEEDS_INSTALLED),CONFIG_FEED_$(feed)) include $(INCLUDE_DIR)/package.mk @@ -31,8 +39,8 @@ endif define Package/base-files SECTION:=base CATEGORY:=Base system - DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +fstools +fwtool - TITLE:=Base filesystem for Lede + DEPENDS:=+netifd +libc +procd +jsonfilter +SIGNED_PACKAGES:usign +SIGNED_PACKAGES:lede-keyring +NAND_SUPPORT:ubi-utils +fstools +fwtool + TITLE:=Base filesystem for OpenWrt URL:=http://openwrt.org/ VERSION:=$(PKG_RELEASE)-$(REVISION) endef @@ -107,9 +115,16 @@ ifdef CONFIG_SIGNED_PACKAGES endef endif +ifeq ($(CONFIG_NAND_SUPPORT),) + define Package/base-files/nand-support + rm -f $(1)/lib/upgrade/nand.sh + endef +endif + define Package/base-files/install $(CP) ./files/* $(1)/ $(Package/base-files/install-key) + $(Package/base-files/nand-support) if [ -d $(GENERIC_PLATFORM_DIR)/base-files/. ]; then \ $(CP) $(GENERIC_PLATFORM_DIR)/base-files/* $(1)/; \ fi @@ -171,6 +186,15 @@ define Package/base-files/install echo "$$$${conffile##$(1)}" >> $(1)/CONTROL/conffiles; \ fi \ done + + $(if $(CONFIG_INCLUDE_CONFIG), \ + echo -e "# Build configuration for board $(BOARD)/$(SUBTARGET)/$(PROFILE)\n" >$(1)/etc/build.config; \ + cat $(BIN_DIR)/config.seed >>$(1)/etc/build.config) + + $(if $(CONFIG_CLEAN_IPKG),, \ + mkdir -p $(1)/etc/opkg; \ + $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf); \ + $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf) endef ifneq ($(DUMP),1) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index a8311fc59..bbed567de 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -223,7 +223,7 @@ generate_static_system() { uci -q batch <<-EOF delete system.@system[0] add system system - set system.@system[-1].hostname='LEDE' + set system.@system[-1].hostname='OpenWrt' set system.@system[-1].timezone='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='64' @@ -233,10 +233,10 @@ generate_static_system() { set system.ntp='timeserver' set system.ntp.enabled='1' set system.ntp.enable_server='0' - add_list system.ntp.server='0.lede.pool.ntp.org' - add_list system.ntp.server='1.lede.pool.ntp.org' - add_list system.ntp.server='2.lede.pool.ntp.org' - add_list system.ntp.server='3.lede.pool.ntp.org' + add_list system.ntp.server='0.openwrt.pool.ntp.org' + add_list system.ntp.server='1.openwrt.pool.ntp.org' + add_list system.ntp.server='2.openwrt.pool.ntp.org' + add_list system.ntp.server='3.openwrt.pool.ntp.org' EOF if json_is_a system object; then diff --git a/package/base-files/files/etc/group b/package/base-files/files/etc/group index d36685139..e8e2adf4a 100644 --- a/package/base-files/files/etc/group +++ b/package/base-files/files/etc/group @@ -1,6 +1,7 @@ root:x:0: daemon:x:1: adm:x:4: +tty:x:5: mail:x:8: audio:x:29: www-data:x:33: diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 7c2a18501..c790e3e18 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -72,6 +72,7 @@ load_led() { [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name echo $mode > /sys/class/leds/${sysfs}/mode + echo $interval > /sys/class/leds/${sysfs}/interval } ;; diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index 8c5f67729..531aa8cbc 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -7,7 +7,7 @@ USE_PROCD=1 validate_system_section() { uci_validate_section system system "${1}" \ - 'hostname:string:lede' \ + 'hostname:string:OpenWrt' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ 'timezone:string:UTC' \ diff --git a/package/base-files/files/etc/openwrt_release b/package/base-files/files/etc/openwrt_release index da86208f7..d03400ca0 100644 --- a/package/base-files/files/etc/openwrt_release +++ b/package/base-files/files/etc/openwrt_release @@ -1,8 +1,7 @@ DISTRIB_ID='%D' DISTRIB_RELEASE='%V' DISTRIB_REVISION='%R' -DISTRIB_CODENAME='%n' DISTRIB_TARGET='%S' DISTRIB_ARCH='%A' -DISTRIB_DESCRIPTION='%D %N %V %C' +DISTRIB_DESCRIPTION='%D %V %C' DISTRIB_TAINTS='%t' diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index e80af891e..3e237170b 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -41,14 +41,15 @@ disable() { } enable() { + err=1 name="$(basename "${initscript}")" - disable - [ -n "$START" -o -n "$STOP" ] || { - echo "/etc/init.d/$name does not have a START or STOP value" - return 1 - } - [ "$START" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" - [ "$STOP" ] && ln -s "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" + [ "$START" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" && \ + err=0 + [ "$STOP" ] && \ + ln -sf "../init.d/$name" "$IPKG_INSTROOT/etc/rc.d/K${STOP}${name##K[0-9][0-9]}" && \ + err=0 + return $err } enabled() { @@ -88,6 +89,10 @@ service_triggers() { return 0 } +service_data() { + return 0 +} + service_running() { return 0 } @@ -122,12 +127,14 @@ ${INIT_TRACE:+set -x} } stop() { + procd_lock stop_service "$@" procd_kill "$(basename ${basescript:-$initscript})" "$1" } reload() { if eval "type reload_service" 2>/dev/null >/dev/null; then + procd_lock reload_service "$@" else start diff --git a/package/base-files/files/etc/sysctl.conf b/package/base-files/files/etc/sysctl.conf index 91a3ac9a0..ddc7a9bf6 100644 --- a/package/base-files/files/etc/sysctl.conf +++ b/package/base-files/files/etc/sysctl.conf @@ -1,5 +1,6 @@ kernel.panic=3 kernel.core_pattern=/tmp/%e.%t.%p.%s.core +fs.suid_dumpable=2 net.ipv4.conf.default.arp_ignore=1 net.ipv4.conf.all.arp_ignore=1 diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index bea5f0f96..dfadfdb2d 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -202,7 +202,7 @@ add_group_and_user() { if [ -n "$gname" ] && [ -n "$gid" ]; then group_exists "$gname" || group_add "$gname" "$gid" elif [ -n "$gname" ]; then - group_add_next "$gname"; gid=$? + gid="$(group_add_next "$gname")" fi if [ -n "$uname" ]; then @@ -235,6 +235,10 @@ default_postinst() { rm -fR $root/rootfs-overlay/ fi + if [ -z "$root" ] && grep -q -s "^/etc/modules.d/" "/usr/lib/opkg/info/${pkgname}.list"; then + kmodloader + fi + if [ -z "$root" ] && grep -q -s "^/etc/uci-defaults/" "/usr/lib/opkg/info/${pkgname}.list"; then . /lib/functions/system.sh [ -d /tmp/.uci ] || mkdir -p /tmp/.uci @@ -292,9 +296,7 @@ group_add() { [ -f "${IPKG_INSTROOT}/etc/group" ] || return 1 [ -n "$IPKG_INSTROOT" ] || lock /var/lock/group echo "${name}:x:${gid}:" >> ${IPKG_INSTROOT}/etc/group - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/group - return $rc } group_exists() { @@ -304,14 +306,17 @@ group_exists() { group_add_next() { local gid gids gid=$(grep -s "^${1}:" ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - [ -n "$gid" ] && return $gid + if [ -n "$gid" ]; then + echo $gid + return + fi gids=$(cat ${IPKG_INSTROOT}/etc/group | cut -d: -f3) - gid=100 - while [ -n "$(echo $gids | grep $gid)" ] ; do + gid=65536 + while [ -n "$(echo "$gids" | grep "^$gid$")" ] ; do gid=$((gid + 1)) done group_add $1 $gid - return $gid + echo $gid } group_add_user() { @@ -334,8 +339,8 @@ user_add() { local rc [ -z "$uid" ] && { uids=$(cat ${IPKG_INSTROOT}/etc/passwd | cut -d: -f3) - uid=100 - while [ -n "$(echo $uids | grep $uid)" ] ; do + uid=65536 + while [ -n "$(echo "$uids" | grep "^$uid$")" ] ; do uid=$((uid + 1)) done } @@ -344,9 +349,7 @@ user_add() { [ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd echo "${name}:x:0:0:99999:7:::" >> ${IPKG_INSTROOT}/etc/shadow - rc=$? [ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd - return $rc } user_exists() { diff --git a/package/base-files/files/lib/functions/leds.sh b/package/base-files/files/lib/functions/leds.sh index 857e7e539..83e775fad 100644 --- a/package/base-files/files/lib/functions/leds.sh +++ b/package/base-files/files/lib/functions/leds.sh @@ -1,6 +1,18 @@ #!/bin/sh # Copyright (C) 2013 OpenWrt.org +get_dt_led() { + local label + local ledpath + local basepath="/proc/device-tree" + local nodepath="$basepath/aliases/led-$1" + + [ -f "$nodepath" ] && ledpath=$(cat "$nodepath") + [ -n "$ledpath" ] && label=$(cat "$basepath$ledpath/label") + + echo "$label" +} + led_set_attr() { [ -f "/sys/class/leds/$1/$2" ] && echo "$3" > "/sys/class/leds/$1/$2" } diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 7cc63ffc8..82ac1d2a4 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -160,7 +160,7 @@ _ucidef_finish_switch_roles() { json_select .. json_select .. - if [ $n_vlan -gt $n_cpu -o ${need_tag:-0} -eq 1 ]; then + if [ ${need_tag:-0} -eq 1 -o ${want_untag:-0} -ne 1 ]; then num="${num}t" device="${device}.${index}" fi @@ -358,19 +358,59 @@ ucidef_add_vdsl_modem() { json_select .. } -ucidef_set_led_netdev() { +ucidef_set_led_ataport() { + _ucidef_set_led_trigger "$1" "$2" "$3" ata"$4" +} + +_ucidef_set_led_common() { local cfg="led_$1" local name="$2" local sysfs="$3" - local dev="$4" - local mode="${5:-link tx rx}" json_select_object led json_select_object "$1" json_add_string name "$name" - json_add_string type netdev json_add_string sysfs "$sysfs" +} + +ucidef_set_led_default() { + local default="$4" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string default "$default" + json_select .. + + json_select .. +} + +ucidef_set_led_gpio() { + local gpio="$4" + local inverted="$5" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger "$trigger" + json_add_string type gpio + json_add_int gpio "$gpio" + json_add_boolean inverted "$inverted" + json_select .. + + json_select .. +} + +ucidef_set_led_ide() { + _ucidef_set_led_trigger "$1" "$2" "$3" ide-disk +} + +ucidef_set_led_netdev() { + local dev="$4" + local mode="${5:-link tx rx}" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string type netdev json_add_string device "$dev" json_add_string mode "$mode" json_select .. @@ -378,24 +418,106 @@ ucidef_set_led_netdev() { json_select .. } +ucidef_set_led_oneshot() { + _ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5 +} + +ucidef_set_led_portstate() { + local port_state="$4" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger port_state + json_add_string type portstate + json_add_string port_state "$port_state" + json_select .. + + json_select .. +} + +ucidef_set_led_rssi() { + local iface="$4" + local minq="$5" + local maxq="$6" + local offset="${7:-0}" + local factor="${8:-1}" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string type rssi + json_add_string name "$name" + json_add_string iface "$iface" + json_add_string minq "$minq" + json_add_string maxq "$maxq" + json_add_string offset "$offset" + json_add_string factor "$factor" + json_select .. + + json_select .. +} + +ucidef_set_led_switch() { + local trigger_name="$4" + local port_mask="$5" + local speed_mask="$6" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger "$trigger_name" + json_add_string type switch + json_add_string port_mask "$port_mask" + json_add_string speed_mask "$speed_mask" + json_select .. + + json_select .. +} + +_ucidef_set_led_timer() { + local trigger_name="$4" + local delayon="$5" + local delayoff="$6" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger "$trigger_name" + json_add_int delayon "$delayon" + json_add_int delayoff "$delayoff" + json_select .. + + json_select .. +} + +ucidef_set_led_timer() { + _ucidef_set_led_timer $1 $2 $3 "timer" $4 $5 +} + +_ucidef_set_led_trigger() { + local trigger_name="$4" + + _ucidef_set_led_common "$1" "$2" "$3" + + json_add_string trigger "$trigger_name" + json_select .. + + json_select .. +} + ucidef_set_led_usbdev() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" local dev="$4" - json_select_object led + _ucidef_set_led_common "$1" "$2" "$3" - json_select_object "$1" - json_add_string name "$name" json_add_string type usb - json_add_string sysfs "$sysfs" json_add_string device "$dev" json_select .. json_select .. } +ucidef_set_led_usbhost() { + _ucidef_set_led_trigger "$1" "$2" "$3" usb-host +} + ucidef_set_led_usbport() { local obj="$1" local name="$2" @@ -404,12 +526,9 @@ ucidef_set_led_usbport() { shift shift - json_select_object led + _ucidef_set_led_common "$obj" "$name" "$sysfs" - json_select_object "$obj" - json_add_string name "$name" json_add_string type usbport - json_add_string sysfs "$sysfs" json_select_array ports for port in "$@"; do json_add_string port "$port" @@ -421,171 +540,7 @@ ucidef_set_led_usbport() { } ucidef_set_led_wlan() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local trigger="$4" - - json_select_object led - - json_select_object "$1" - json_add_string name "$name" - json_add_string type trigger - json_add_string sysfs "$sysfs" - json_add_string trigger "$trigger" - json_select .. - - json_select .. -} - -ucidef_set_led_switch() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local trigger="$4" - local port_mask="$5" - local speed_mask="$6" - - json_select_object led - - json_select_object "$1" - json_add_string name "$name" - json_add_string type switch - json_add_string sysfs "$sysfs" - json_add_string trigger "$trigger" - json_add_string port_mask "$port_mask" - json_add_string speed_mask "$speed_mask" - json_select .. - - json_select .. -} - -ucidef_set_led_portstate() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local port_state="$4" - - json_select_object led - - json_select_object "$1" - json_add_string name "$name" - json_add_string type portstate - json_add_string sysfs "$sysfs" - json_add_string trigger port_state - json_add_string port_state "$port_state" - json_select .. - - json_select .. -} - -ucidef_set_led_default() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local default="$4" - - json_select_object led - - json_select_object "$1" - json_add_string name "$name" - json_add_string sysfs "$sysfs" - json_add_string default "$default" - json_select .. - - json_select .. -} - -ucidef_set_led_gpio() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local gpio="$4" - local inverted="$5" - - json_select_object led - - json_select_object "$1" - json_add_string type gpio - json_add_string name "$name" - json_add_string sysfs "$sysfs" - json_add_string trigger "$trigger" - json_add_int gpio "$gpio" - json_add_boolean inverted "$inverted" - json_select .. - - json_select .. -} - -ucidef_set_led_ide() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - - json_select_object led - - json_select_object "$1" - json_add_string name "$name" - json_add_string sysfs "$sysfs" - json_add_string trigger ide-disk - json_select .. - - json_select .. -} - -__ucidef_set_led_timer() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local trigger="$4" - local delayon="$5" - local delayoff="$6" - - json_select_object led - - json_select_object "$1" - json_add_string type "$trigger" - json_add_string name "$name" - json_add_string sysfs "$sysfs" - json_add_int delayon "$delayon" - json_add_int delayoff "$delayoff" - json_select .. - - json_select .. -} - -ucidef_set_led_oneshot() { - __ucidef_set_led_timer $1 $2 $3 "oneshot" $4 $5 -} - -ucidef_set_led_timer() { - __ucidef_set_led_timer $1 $2 $3 "timer" $4 $5 -} - -ucidef_set_led_rssi() { - local cfg="led_$1" - local name="$2" - local sysfs="$3" - local iface="$4" - local minq="$5" - local maxq="$6" - local offset="$7" - local factor="$8" - - json_select_object led - - json_select_object "$1" - json_add_string type rssi - json_add_string name "$name" - json_add_string iface "$iface" - json_add_string sysfs "$sysfs" - json_add_string minq "$minq" - json_add_string maxq "$maxq" - json_add_string offset "$offset" - json_add_string factor "$factor" - json_select .. - - json_select .. + _ucidef_set_led_trigger "$1" "$2" "$3" "$4" } ucidef_set_rssimon() { @@ -601,7 +556,6 @@ ucidef_set_rssimon() { json_select .. json_select .. - } ucidef_add_gpio_switch() { diff --git a/package/base-files/files/lib/preinit/10_sysinfo b/package/base-files/files/lib/preinit/02_sysinfo similarity index 100% rename from package/base-files/files/lib/preinit/10_sysinfo rename to package/base-files/files/lib/preinit/02_sysinfo diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit index 5442a749b..c3ec7bfdf 100644 --- a/package/base-files/files/lib/preinit/10_indicate_preinit +++ b/package/base-files/files/lib/preinit/10_indicate_preinit @@ -113,7 +113,7 @@ preinit_ip() { preinit_config_board fi - preinit_net_echo "Doing Lede Preinit\n" + preinit_net_echo "Doing OpenWrt Preinit\n" } preinit_ip_deconfig() { diff --git a/package/base-files/files/lib/preinit/40_run_failsafe_hook b/package/base-files/files/lib/preinit/40_run_failsafe_hook index 7301f7734..533b0a977 100644 --- a/package/base-files/files/lib/preinit/40_run_failsafe_hook +++ b/package/base-files/files/lib/preinit/40_run_failsafe_hook @@ -5,8 +5,12 @@ run_failsafe_hook() { [ "$pi_preinit_no_failsafe" = "y" ] && return if [ "$FAILSAFE" = "true" ]; then + lock /tmp/.failsafe boot_run_hook failsafe - lock -w /tmp/.failsafe + while [ ! -e /tmp/sysupgrade ]; do + lock -w /tmp/.failsafe + done + exit fi } diff --git a/package/base-files/files/lib/preinit/99_10_failsafe_login b/package/base-files/files/lib/preinit/99_10_failsafe_login index 3147cdc5a..728c63b2e 100644 --- a/package/base-files/files/lib/preinit/99_10_failsafe_login +++ b/package/base-files/files/lib/preinit/99_10_failsafe_login @@ -8,10 +8,13 @@ failsafe_netlogin () { } failsafe_shell() { - lock /tmp/.failsafe - ash --login - echo "Please reboot system when done with failsafe network logins" - while true; do sleep 1; done + local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')" + [ -n "$console" ] || console=console + [ -c "/dev/$console" ] || return 0 + while true; do + ash --login <"/dev/$console" >"/dev/$console" 2>"/dev/$console" + sleep 1 + done & } boot_hook_add failsafe failsafe_netlogin diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 3ddd1e746..71cffc858 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -6,143 +6,33 @@ RAM_ROOT=/tmp/root libs() { ldd $* 2>/dev/null | sed -r 's/(.* => )?(.*) .*/\2/'; } install_file() { # [ ... ] + local target dest dir for file in "$@"; do + if [ -L "$file" ]; then + target="$(readlink -f "$file")" + dest="$RAM_ROOT/$file" + [ ! -f "$dest" ] && { + dir="$(dirname "$dest")" + mkdir -p "$dir" + ln -s "$target" "$dest" + } + file="$target" + fi dest="$RAM_ROOT/$file" - [ -f $file -a ! -f $dest ] && { - dir="$(dirname $dest)" + [ -f "$file" -a ! -f "$dest" ] && { + dir="$(dirname "$dest")" mkdir -p "$dir" - cp $file $dest + cp "$file" "$dest" } done } -install_bin() { # [ ... ] +install_bin() { + local src files src=$1 files=$1 [ -x "$src" ] && files="$src $(libs $src)" install_file $files - shift - for link in "$@"; do { - dest="$RAM_ROOT/$link" - dir="$(dirname $dest)" - mkdir -p "$dir" - [ -f "$dest" ] || ln -s $src $dest - }; done -} - -supivot() { # - /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1 - mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \ - /bin/mount -o noatime,move /proc $1/proc && \ - pivot_root $1 $1$2 || { - /bin/umount -l $1 $1 - return 1 - } - - /bin/mount -o noatime,move $2/sys /sys - /bin/mount -o noatime,move $2/dev /dev - /bin/mount -o noatime,move $2/tmp /tmp - /bin/mount -o noatime,move $2/overlay /overlay 2>&- - return 0 -} - -run_ramfs() { # [...] - install_bin /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \ - /sbin/pivot_root /sbin/reboot /bin/sync /bin/dd /bin/grep \ - /bin/cp /bin/mv /bin/tar /usr/bin/md5sum "/usr/bin/[" /bin/dd \ - /bin/vi /bin/ls /bin/cat /usr/bin/awk /usr/bin/hexdump \ - /bin/sleep /bin/zcat /usr/bin/bzcat /usr/bin/printf /usr/bin/wc \ - /bin/cut /usr/bin/printf /bin/sync /bin/mkdir /bin/rmdir \ - /bin/rm /usr/bin/basename /bin/kill /bin/chmod /usr/bin/find \ - /bin/mknod - - install_bin /bin/uclient-fetch /bin/wget - install_bin /sbin/mtd - install_bin /sbin/mount_root - install_bin /sbin/snapshot - install_bin /sbin/snapshot_tool - install_bin /usr/sbin/ubiupdatevol - install_bin /usr/sbin/ubiattach - install_bin /usr/sbin/ubiblock - install_bin /usr/sbin/ubiformat - install_bin /usr/sbin/ubidetach - install_bin /usr/sbin/ubirsvol - install_bin /usr/sbin/ubirmvol - install_bin /usr/sbin/ubimkvol - install_bin /usr/sbin/partx - install_bin /usr/sbin/losetup - install_bin /usr/sbin/mkfs.ext4 - for file in $RAMFS_COPY_BIN; do - install_bin ${file//:/ } - done - install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA - - [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 - - supivot $RAM_ROOT /mnt || { - echo "Failed to switch over to ramfs. Please reboot." - exit 1 - } - - /bin/mount -o remount,ro /mnt - /bin/umount -l /mnt - - grep /overlay /proc/mounts > /dev/null && { - /bin/mount -o noatime,remount,ro /overlay - /bin/umount -l /overlay - } - - # spawn a new shell from ramdisk to reduce the probability of cache issues - exec /bin/busybox ash -c "$*" -} - -kill_remaining() { # [ ] - local sig="${1:-TERM}" - echo -n "Sending $sig to remaining processes ... " - - local my_pid=$$ - local my_ppid=$(cut -d' ' -f4 /proc/$my_pid/stat) - local my_ppisupgraded= - grep -q upgraded /proc/$my_ppid/cmdline >/dev/null && { - local my_ppisupgraded=1 - } - - local stat - for stat in /proc/[0-9]*/stat; do - [ -f "$stat" ] || continue - - local pid name state ppid rest - read pid name state ppid rest < $stat - name="${name#(}"; name="${name%)}" - - local cmdline - read cmdline < /proc/$pid/cmdline - - # Skip kernel threads - [ -n "$cmdline" ] || continue - - if [ $$ -eq 1 ] || [ $my_ppid -eq 1 ] && [ -n "$my_ppisupgraded" ]; then - # Running as init process, kill everything except me - if [ $pid -ne $$ ] && [ $pid -ne $my_ppid ]; then - echo -n "$name " - kill -$sig $pid 2>/dev/null - fi - else - case "$name" in - # Skip essential services - *procd*|*ash*|*init*|*watchdog*|*ssh*|*dropbear*|*telnet*|*login*|*hostapd*|*wpa_supplicant*|*nas*|*relayd*) : ;; - - # Killable process - *) - if [ $pid -ne $$ ] && [ $ppid -ne $$ ]; then - echo -n "$name " - kill -$sig $pid 2>/dev/null - fi - ;; - esac - fi - done - echo "" } run_hooks() { @@ -175,28 +65,31 @@ v() { [ "$VERBOSE" -ge 1 ] && echo "$@" } +json_string() { + local v="$1" + v="${v//\\/\\\\}" + v="${v//\"/\\\"}" + echo "\"$v\"" +} + rootfs_type() { /bin/mount | awk '($3 ~ /^\/$/) && ($5 !~ /rootfs/) { print $5 }' } get_image() { # [ ] local from="$1" - local conc="$2" - local cmd + local cat="$2" - case "$from" in - http://*|ftp://*) cmd="wget -O- -q";; - *) cmd="cat";; - esac - if [ -z "$conc" ]; then - local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" + if [ -z "$cat" ]; then + local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')" case "$magic" in - 1f8b) conc="zcat";; - 425a) conc="bzcat";; + 1f8b) cat="zcat";; + 425a) cat="bzcat";; + *) cat="cat";; esac fi - eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}" + $cat "$from" 2>/dev/null } get_magic_word() { @@ -328,12 +221,14 @@ default_do_upgrade() { fi } -do_upgrade() { +do_upgrade_stage2() { v "Performing system upgrade..." - if type 'platform_do_upgrade' >/dev/null 2>/dev/null; then - platform_do_upgrade "$ARGV" + if [ -n "$do_upgrade" ]; then + eval "$do_upgrade" + elif type 'platform_do_upgrade' >/dev/null 2>/dev/null; then + platform_do_upgrade "$IMAGE" else - default_do_upgrade "$ARGV" + default_do_upgrade "$IMAGE" fi if [ "$SAVE_CONFIG" -eq 1 ] && type 'platform_copy_config' >/dev/null 2>/dev/null; then @@ -341,12 +236,11 @@ do_upgrade() { fi v "Upgrade completed" - [ -n "$DELAY" ] && sleep "$DELAY" - ask_bool 1 "Reboot" && { - v "Rebooting system..." - umount -a - reboot -f - sleep 5 - echo b 2>/dev/null >/proc/sysrq-trigger - } + sleep 1 + + v "Rebooting system..." + umount -a + reboot -f + sleep 5 + echo b 2>/dev/null >/proc/sysrq-trigger } diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh new file mode 100644 index 000000000..42f488c11 --- /dev/null +++ b/package/base-files/files/lib/upgrade/nand.sh @@ -0,0 +1,329 @@ +#!/bin/sh +# Copyright (C) 2014 OpenWrt.org +# + +. /lib/functions.sh + +# 'kernel' partition on NAND contains the kernel +CI_KERNPART="${CI_KERNPART:-kernel}" + +# 'ubi' partition on NAND contains UBI +CI_UBIPART="${CI_UBIPART:-ubi}" + +ubi_mknod() { + local dir="$1" + local dev="/dev/$(basename $dir)" + + [ -e "$dev" ] && return 0 + + local devid="$(cat $dir/dev)" + local major="${devid%%:*}" + local minor="${devid##*:}" + mknod "$dev" c $major $minor +} + +nand_find_volume() { + local ubidevdir ubivoldir + ubidevdir="/sys/devices/virtual/ubi/$1" + [ ! -d "$ubidevdir" ] && return 1 + for ubivoldir in $ubidevdir/${1}_*; do + [ ! -d "$ubivoldir" ] && continue + if [ "$( cat $ubivoldir/name )" = "$2" ]; then + basename $ubivoldir + ubi_mknod "$ubivoldir" + return 0 + fi + done +} + +nand_find_ubi() { + local ubidevdir ubidev mtdnum + mtdnum="$( find_mtd_index $1 )" + [ ! "$mtdnum" ] && return 1 + for ubidevdir in /sys/devices/virtual/ubi/ubi*; do + [ ! -d "$ubidevdir" ] && continue + cmtdnum="$( cat $ubidevdir/mtd_num )" + [ ! "$mtdnum" ] && continue + if [ "$mtdnum" = "$cmtdnum" ]; then + ubidev=$( basename $ubidevdir ) + ubi_mknod "$ubidevdir" + echo $ubidev + return 0 + fi + done +} + +nand_get_magic_long() { + dd if="$1" skip=$2 bs=4 count=1 2>/dev/null | hexdump -v -n 4 -e '1/1 "%02x"' +} + +get_magic_long_tar() { + ( tar xf $1 $2 -O | dd bs=4 count=1 | hexdump -v -n 4 -e '1/1 "%02x"') 2> /dev/null +} + +identify_magic() { + local magic=$1 + case "$magic" in + "55424923") + echo "ubi" + ;; + "31181006") + echo "ubifs" + ;; + "68737173") + echo "squashfs" + ;; + "d00dfeed") + echo "fit" + ;; + "4349"*) + echo "combined" + ;; + *) + echo "unknown $magic" + ;; + esac +} + + +identify() { + identify_magic $(nand_get_magic_long "$1" "${2:-0}") +} + +identify_tar() { + identify_magic $(get_magic_long_tar "$1" "$2") +} + +nand_restore_config() { + sync + local ubidev=$( nand_find_ubi $CI_UBIPART ) + local ubivol="$( nand_find_volume $ubidev rootfs_data )" + [ ! "$ubivol" ] && + ubivol="$( nand_find_volume $ubidev rootfs )" + mkdir /tmp/new_root + if ! mount -t ubifs /dev/$ubivol /tmp/new_root; then + echo "mounting ubifs $ubivol failed" + rmdir /tmp/new_root + return 1 + fi + mv "$1" "/tmp/new_root/sysupgrade.tgz" + umount /tmp/new_root + sync + rmdir /tmp/new_root +} + +nand_upgrade_prepare_ubi() { + local rootfs_length="$1" + local rootfs_type="$2" + local has_kernel="${3:-0}" + local has_env="${4:-0}" + + local mtdnum="$( find_mtd_index "$CI_UBIPART" )" + if [ ! "$mtdnum" ]; then + echo "cannot find ubi mtd partition $CI_UBIPART" + return 1 + fi + + local ubidev="$( nand_find_ubi "$CI_UBIPART" )" + if [ ! "$ubidev" ]; then + ubiattach -m "$mtdnum" + sync + ubidev="$( nand_find_ubi "$CI_UBIPART" )" + fi + + if [ ! "$ubidev" ]; then + ubiformat /dev/mtd$mtdnum -y + ubiattach -m "$mtdnum" + sync + ubidev="$( nand_find_ubi "$CI_UBIPART" )" + [ "$has_env" -gt 0 ] && { + ubimkvol /dev/$ubidev -n 0 -N ubootenv -s 1MiB + ubimkvol /dev/$ubidev -n 1 -N ubootenv2 -s 1MiB + } + fi + + local kern_ubivol="$( nand_find_volume $ubidev $CI_KERNPART )" + local root_ubivol="$( nand_find_volume $ubidev rootfs )" + local data_ubivol="$( nand_find_volume $ubidev rootfs_data )" + + # remove ubiblock device of rootfs + local root_ubiblk="ubiblock${root_ubivol:3}" + if [ "$root_ubivol" -a -e "/dev/$root_ubiblk" ]; then + echo "removing $root_ubiblk" + if ! ubiblock -r /dev/$root_ubivol; then + echo "cannot remove $root_ubiblk" + return 1; + fi + fi + + # kill volumes + [ "$kern_ubivol" ] && ubirmvol /dev/$ubidev -N $CI_KERNPART || true + [ "$root_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs || true + [ "$data_ubivol" ] && ubirmvol /dev/$ubidev -N rootfs_data || true + + # update kernel + if [ "$has_kernel" = "1" ]; then + if ! ubimkvol /dev/$ubidev -N $CI_KERNPART -s $kernel_length; then + echo "cannot create kernel volume" + return 1; + fi + fi + + # update rootfs + local root_size_param + if [ "$rootfs_type" = "ubifs" ]; then + root_size_param="-m" + else + root_size_param="-s $rootfs_length" + fi + if ! ubimkvol /dev/$ubidev -N rootfs $root_size_param; then + echo "cannot create rootfs volume" + return 1; + fi + + # create rootfs_data for non-ubifs rootfs + if [ "$rootfs_type" != "ubifs" ]; then + if ! ubimkvol /dev/$ubidev -N rootfs_data -m; then + echo "cannot initialize rootfs_data volume" + return 1 + fi + fi + sync + return 0 +} + +nand_do_upgrade_success() { + local conf_tar="/tmp/sysupgrade.tgz" + + sync + [ -f "$conf_tar" ] && nand_restore_config "$conf_tar" + echo "sysupgrade successful" + umount -a + reboot -f +} + +# Flash the UBI image to MTD partition +nand_upgrade_ubinized() { + local ubi_file="$1" + local mtdnum="$(find_mtd_index "$CI_UBIPART")" + + [ ! "$mtdnum" ] && { + CI_UBIPART="rootfs" + mtdnum="$(find_mtd_index "$CI_UBIPART")" + } + + if [ ! "$mtdnum" ]; then + echo "cannot find mtd device $CI_UBIPART" + umount -a + reboot -f + fi + + local mtddev="/dev/mtd${mtdnum}" + ubidetach -p "${mtddev}" || true + sync + ubiformat "${mtddev}" -y -f "${ubi_file}" + ubiattach -p "${mtddev}" + nand_do_upgrade_success +} + +# Write the UBIFS image to UBI volume +nand_upgrade_ubifs() { + local rootfs_length=`(cat $1 | wc -c) 2> /dev/null` + + nand_upgrade_prepare_ubi "$rootfs_length" "ubifs" "0" "0" + + local ubidev="$( nand_find_ubi "$CI_UBIPART" )" + local root_ubivol="$(nand_find_volume $ubidev rootfs)" + ubiupdatevol /dev/$root_ubivol -s $rootfs_length $1 + + nand_do_upgrade_success +} + +nand_upgrade_tar() { + local tar_file="$1" + local kernel_mtd="$(find_mtd_index $CI_KERNPART)" + + local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$') + board_dir=${board_dir%/} + + local kernel_length=`(tar xf $tar_file ${board_dir}/kernel -O | wc -c) 2> /dev/null` + local rootfs_length=`(tar xf $tar_file ${board_dir}/root -O | wc -c) 2> /dev/null` + + local rootfs_type="$(identify_tar "$tar_file" ${board_dir}/root)" + + local has_kernel=1 + local has_env=0 + + [ "$kernel_length" != 0 -a -n "$kernel_mtd" ] && { + tar xf $tar_file ${board_dir}/kernel -O | mtd write - $CI_KERNPART + } + [ "$kernel_length" = 0 -o ! -z "$kernel_mtd" ] && has_kernel=0 + + nand_upgrade_prepare_ubi "$rootfs_length" "$rootfs_type" "$has_kernel" "$has_env" + + local ubidev="$( nand_find_ubi "$CI_UBIPART" )" + [ "$has_kernel" = "1" ] && { + local kern_ubivol="$(nand_find_volume $ubidev $CI_KERNPART)" + tar xf $tar_file ${board_dir}/kernel -O | \ + ubiupdatevol /dev/$kern_ubivol -s $kernel_length - + } + + local root_ubivol="$(nand_find_volume $ubidev rootfs)" + tar xf $tar_file ${board_dir}/root -O | \ + ubiupdatevol /dev/$root_ubivol -s $rootfs_length - + + nand_do_upgrade_success +} + +# Recognize type of passed file and start the upgrade process +nand_do_upgrade() { + if [ -n "$IS_PRE_UPGRADE" ]; then + # Previously, nand_do_upgrade was called from the platform_pre_upgrade + # hook; this piece of code handles scripts that haven't been + # updated. All scripts should gradually move to call nand_do_upgrade + # from platform_do_upgrade instead. + export do_upgrade="nand_do_upgrade '$1'" + return + fi + + local file_type=$(identify $1) + + if type 'platform_nand_pre_upgrade' >/dev/null 2>/dev/null; then + platform_nand_pre_upgrade "$1" + fi + + [ ! "$(find_mtd_index "$CI_UBIPART")" ] && CI_UBIPART="rootfs" + + case "$file_type" in + "ubi") nand_upgrade_ubinized $1;; + "ubifs") nand_upgrade_ubifs $1;; + *) nand_upgrade_tar $1;; + esac +} + +# Check if passed file is a valid one for NAND sysupgrade. Currently it accepts +# 3 types of files: +# 1) UBI - should contain an ubinized image, header is checked for the proper +# MAGIC +# 2) UBIFS - should contain UBIFS partition that will replace "rootfs" volume, +# header is checked for the proper MAGIC +# 3) TAR - archive has to include "sysupgrade-BOARD" directory with a non-empty +# "CONTROL" file (at this point its content isn't verified) +# +# You usually want to call this function in platform_check_image. +# +# $(1): board name, used in case of passing TAR file +# $(2): file to be checked +nand_do_platform_check() { + local board_name="$1" + local tar_file="$2" + local control_length=`(tar xf $tar_file sysupgrade-$board_name/CONTROL -O | wc -c) 2> /dev/null` + local file_type="$(identify $2)" + + [ "$control_length" = 0 -a "$file_type" != "ubi" -a "$file_type" != "ubifs" ] && { + echo "Invalid sysupgrade file." + return 1 + } + + return 0 +} diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2 new file mode 100755 index 000000000..3985d8fd7 --- /dev/null +++ b/package/base-files/files/lib/upgrade/stage2 @@ -0,0 +1,150 @@ +#!/bin/sh + +. /lib/functions.sh +. /lib/functions/system.sh + +export IMAGE="$1" +COMMAND="$2" + +export ARGV="$IMAGE" +export ARGC=1 + +export SAVE_CONFIG=1 +export SAVE_PARTITIONS=1 + +export INTERACTIVE=0 +export VERBOSE=1 +export CONFFILES=/tmp/sysupgrade.conffiles +export CONF_TAR=/tmp/sysupgrade.tgz + +RAMFS_COPY_BIN= # extra programs for temporary ramfs root +RAMFS_COPY_DATA= # extra data files + + +[ -f "$CONF_TAR" ] || export SAVE_CONFIG=0 +[ -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap ] && export SAVE_PARTITIONS=0 + +include /lib/upgrade + + +supivot() { # + /bin/mount | grep "on $1 type" 2>&- 1>&- || /bin/mount -o bind $1 $1 + mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \ + /bin/mount -o noatime,move /proc $1/proc && \ + pivot_root $1 $1$2 || { + /bin/umount -l $1 $1 + return 1 + } + + /bin/mount -o noatime,move $2/sys /sys + /bin/mount -o noatime,move $2/dev /dev + /bin/mount -o noatime,move $2/tmp /tmp + /bin/mount -o noatime,move $2/overlay /overlay 2>&- + return 0 +} + +switch_to_ramfs() { + for binary in \ + /bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount \ + pivot_root mount_root reboot sync kill sleep \ + md5sum hexdump cat zcat bzcat dd tar \ + ls basename find cp mv rm mkdir rmdir mknod touch chmod \ + '[' printf wc grep awk sed cut \ + mtd partx losetup mkfs.ext4 \ + ubiupdatevol ubiattach ubiblock ubiformat \ + ubidetach ubirsvol ubirmvol ubimkvol \ + snapshot snapshot_tool \ + $RAMFS_COPY_BIN + do + local file="$(which "$binary" 2>/dev/null)" + [ -n "$file" ] && install_bin "$file" + done + install_file /etc/resolv.conf /lib/*.sh /lib/functions/*.sh /lib/upgrade/*.sh $RAMFS_COPY_DATA + + [ -L "/lib64" ] && ln -s /lib $RAM_ROOT/lib64 + + supivot $RAM_ROOT /mnt || { + echo "Failed to switch over to ramfs. Please reboot." + exit 1 + } + + /bin/mount -o remount,ro /mnt + /bin/umount -l /mnt + + grep /overlay /proc/mounts > /dev/null && { + /bin/mount -o noatime,remount,ro /overlay + /bin/umount -l /overlay + } +} + +kill_remaining() { # [ [ ] ] + local loop_limit=10 + + local sig="${1:-TERM}" + local loop="${2:-0}" + local run=true + local stat + local proc_ppid=$(cut -d' ' -f4 /proc/$$/stat) + + echo -n "Sending $sig to remaining processes ... " + + while $run; do + run=false + for stat in /proc/[0-9]*/stat; do + [ -f "$stat" ] || continue + + local pid name state ppid rest + read pid name state ppid rest < $stat + name="${name#(}"; name="${name%)}" + + # Skip PID1, our parent, ourself and our children + [ $pid -ne 1 -a $pid -ne $proc_ppid -a $pid -ne $$ -a $ppid -ne $$ ] || continue + + local cmdline + read cmdline < /proc/$pid/cmdline + + # Skip kernel threads + [ -n "$cmdline" ] || continue + + echo -n "$name " + kill -$sig $pid 2>/dev/null + + [ $loop -eq 1 ] && run=true + done + + let loop_limit-- + [ $loop_limit -eq 0 ] && { + echo + echo "Failed to kill all processes." + exit 1 + } + done + echo +} + + +killall -9 telnetd +killall -9 dropbear +killall -9 ash + +kill_remaining TERM +sleep 3 +kill_remaining KILL 1 + +sleep 1 + + +if [ -n "$IMAGE" ] && type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then + IS_PRE_UPGRADE=1 platform_pre_upgrade "$IMAGE" + + # Needs to be unset again because of busybox weirdness ... + IS_PRE_UPGRADE= +fi + +if [ -n "$(rootfs_type)" ]; then + echo "Switching to ramdisk..." + switch_to_ramfs +fi + +# Exec new shell from ramfs +exec /bin/busybox ash -c "$COMMAND" diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index c095ca81c..3fd612c37 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -1,17 +1,15 @@ #!/bin/sh + . /lib/functions.sh . /lib/functions/system.sh # initialize defaults -RAMFS_COPY_BIN="" # extra programs for temporary ramfs root -RAMFS_COPY_DATA="" # extra data files export MTD_CONFIG_ARGS="" export INTERACTIVE=0 export VERBOSE=1 export SAVE_CONFIG=1 export SAVE_OVERLAY=0 export SAVE_PARTITIONS=1 -export DELAY= export CONF_IMAGE= export CONF_BACKUP_LIST=0 export CONF_BACKUP= @@ -25,7 +23,6 @@ export TEST=0 while [ -n "$1" ]; do case "$1" in -i) export INTERACTIVE=1;; - -d) export DELAY="$2"; shift;; -v) export VERBOSE="$(($VERBOSE + 1))";; -q) export VERBOSE="$(($VERBOSE - 1))";; -n) export SAVE_CONFIG=0;; @@ -50,10 +47,9 @@ done export CONFFILES=/tmp/sysupgrade.conffiles export CONF_TAR=/tmp/sysupgrade.tgz -export ARGV="$*" -export ARGC="$#" +IMAGE="$1" -[ -z "$ARGV" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && { +[ -z "$IMAGE" -a -z "$NEED_IMAGE" -o $HELP -gt 0 ] && { cat <...] $0 [-q] [-i] @@ -90,7 +86,7 @@ EOF exit 1 } -[ -n "$ARGV" -a -n "$NEED_IMAGE" ] && { +[ -n "$IMAGE" -a -n "$NEED_IMAGE" ] && { cat <<-EOF -b|--create-backup and -r|--restore-backup do not perform a firmware upgrade. Do not specify both -b|-r and a firmware image. @@ -112,14 +108,8 @@ add_uci_conffiles() { add_overlayfiles() { local file="$1" - if [ -d /overlay/upper ]; then - local overlaydir="/overlay/upper" - else - local overlaydir="/overlay" - fi - find $overlaydir/etc/ -type f -o -type l | sed \ + find /overlay/upper/etc/ -type f -o -type l | sed \ -e 's,^/overlay\/upper/,/,' \ - -e 's,^/overlay/,/,' \ -e '\,/META_[a-zA-Z0-9]*$,d' \ -e '\,/functions.sh$,d' \ -e '\,/[^/]*-opkg$,d' \ @@ -130,20 +120,26 @@ add_overlayfiles() { # hooks sysupgrade_image_check="fwtool_check_image platform_check_image" sysupgrade_pre_upgrade="fwtool_pre_upgrade" -[ $SAVE_OVERLAY = 0 -o ! -d /overlay/etc ] && \ - sysupgrade_init_conffiles="add_uci_conffiles" || \ + +if [ $SAVE_OVERLAY = 1 ]; then + [ ! -d /overlay/upper/etc ] && { + echo "Cannot find '/overlay/upper/etc', required for '-c'" + exit 1 + } sysupgrade_init_conffiles="add_overlayfiles" +else + sysupgrade_init_conffiles="add_uci_conffiles" +fi include /lib/upgrade -[ "$1" = "nand" ] && nand_upgrade_stage2 $@ - do_save_conffiles() { local conf_tar="${1:-$CONF_TAR}" [ -z "$(rootfs_type)" ] && { echo "Cannot save config while running from ramdisk." ask_bool 0 "Abort" && exit + rm -f "$conf_tar" return 0 } run_hooks "$CONFFILES" $sysupgrade_init_conffiles @@ -157,7 +153,7 @@ do_save_conffiles() { } if [ $CONF_BACKUP_LIST -eq 1 ]; then - add_uci_conffiles "$CONFFILES" + run_hooks "$CONFFILES" $sysupgrade_init_conffiles cat "$CONFFILES" rm -f "$CONFFILES" exit 0 @@ -184,8 +180,33 @@ type platform_check_image >/dev/null 2>/dev/null || { exit 1 } +case "$IMAGE" in + http://*) + wget -O/tmp/sysupgrade.img "$IMAGE" + IMAGE=/tmp/sysupgrade.img + ;; +esac + +IMAGE="$(readlink -f "$IMAGE")" + +case "$IMAGE" in + '') + echo "Image file not found." + exit 1 + ;; + /tmp/*) ;; + *) + v "Image not in /tmp, copying..." + cp -f "$IMAGE" /tmp/sysupgrade.img + IMAGE=/tmp/sysupgrade.img + ;; +esac + +export ARGV="$IMAGE" +export ARGC=1 + for check in $sysupgrade_image_check; do - ( eval "$check \"\$ARGV\"" ) || { + ( $check "$IMAGE" ) || { if [ $FORCE -eq 1 ]; then echo "Image check '$check' failed but --force given - will update anyway!" break @@ -211,6 +232,7 @@ elif ask_bool $SAVE_CONFIG "Keep config files over reflash"; then [ $TEST -eq 1 ] || do_save_conffiles export SAVE_CONFIG=1 else + [ $TEST -eq 1 ] || rm -f "$CONF_TAR" export SAVE_CONFIG=0 fi @@ -218,28 +240,26 @@ if [ $TEST -eq 1 ]; then exit 0 fi +if [ $SAVE_PARTITIONS -eq 0 ]; then + touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap +else + rm -f /tmp/sysupgrade.always.overwrite.bootdisk.partmap +fi + run_hooks "" $sysupgrade_pre_upgrade -# Some platforms/devices may want different sysupgrade process, e.g. without -# killing processes yet or calling ubus system upgrade method. -# This is needed e.g. on NAND devices where we just want to trigger stage1 at -# this point. -if type 'platform_pre_upgrade' >/dev/null 2>/dev/null; then - platform_pre_upgrade "$ARGV" -fi +install_bin /sbin/upgraded +v "Commencing upgrade. All shell sessions will be closed now." -ubus call system upgrade -touch /tmp/sysupgrade +COMMAND='. /lib/functions.sh; include /lib/upgrade; do_upgrade_stage2' -if [ ! -f /tmp/failsafe ] ; then - kill_remaining TERM - sleep 3 - kill_remaining KILL -fi - -if [ -n "$(rootfs_type)" ]; then - v "Switching to ramdisk..." - run_ramfs '. /lib/functions.sh; include /lib/upgrade; do_upgrade' +if [ -n "$FAILSAFE" ]; then + printf '%s\x00%s\x00%s' "$RAM_ROOT" "$IMAGE" "$COMMAND" >/tmp/sysupgrade + lock -u /tmp/.failsafe else - do_upgrade + ubus call system sysupgrade "{ + \"prefix\": $(json_string "$RAM_ROOT"), + \"path\": $(json_string "$IMAGE"), + \"command\": $(json_string "$COMMAND") + }" fi diff --git a/package/base-files/files/usr/lib/os-release b/package/base-files/files/usr/lib/os-release index 21abf969e..82ade5940 100644 --- a/package/base-files/files/usr/lib/os-release +++ b/package/base-files/files/usr/lib/os-release @@ -1,8 +1,8 @@ NAME="%D" -VERSION="%V, %N" +VERSION="%V" ID="%d" ID_LIKE="lede openwrt" -PRETTY_NAME="%D %N %V" +PRETTY_NAME="%D %V" VERSION_ID="%v" HOME_URL="%m" BUG_URL="%b" @@ -15,4 +15,4 @@ LEDE_DEVICE_MANUFACTURER="%M" LEDE_DEVICE_MANUFACTURER_URL="%m" LEDE_DEVICE_PRODUCT="%P" LEDE_DEVICE_REVISION="%h" -LEDE_RELEASE="%D %N %V %C" +LEDE_RELEASE="%D %V %C" diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index b60053046..dbbd60b15 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -158,18 +158,11 @@ if VERSIONOPT config VERSION_DIST string prompt "Release distribution" - default "LEDE" + default "OpenWrt" help This is the name of the release distribution. If unspecified, it defaults to OpenWrt. - config VERSION_NICK - string - prompt "Release version nickname" - help - This is the release codename embedded in the image. - If unspecified, it defaults to the name of source branch. - config VERSION_NUMBER string prompt "Release version number" @@ -190,7 +183,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "http://downloads.lede-project.org/releases/17.01-SNAPSHOT" + default "http://downloads.lede-project.org/snapshots" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -199,15 +192,13 @@ if VERSIONOPT %v .. Configured release version number or "snapshot", lowercase %C .. Configured release revision code or value of %R, uppercase %c .. Configured release revision code or value of %R, lowercase - %N .. Release name, uppercase - %n .. Release name, lowercase - %D .. Distribution name or "Lede", uppercase - %d .. Distribution name or "lede", lowercase + %D .. Distribution name or "OpenWrt", uppercase + %d .. Distribution name or "openwrt", lowercase %T .. Target name %S .. Target/Subtarget name %A .. Package architecture %t .. Build taint flags, e.g. "no-all busybox" - %M .. Manufacturer name or "Lede" + %M .. Manufacturer name or "OpenWrt" %P .. Product name or "Generic" %h .. Hardware revision or "v0" From 13538fa341ccfdd04b62739ae72c1b1fbdf1a30e Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 16:31:13 +0800 Subject: [PATCH 84/95] update opkg distfeed --- package/system/opkg/Makefile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile index 876a72d01..f00e574de 100644 --- a/package/system/opkg/Makefile +++ b/package/system/opkg/Makefile @@ -1,32 +1,32 @@ # # Copyright (C) 2006-2015 OpenWrt.org -# Copyright (C) 2016 LEDE Project +# Copyright (C) 2016-2017 LEDE Project # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -include $(INCLUDE_DIR)/version.mk -include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=opkg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_FLAGS:=essential PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://git.lede-project.org/project/opkg-lede.git -PKG_SOURCE_DATE:=2017-12-08 -PKG_SOURCE_VERSION:=9f61f7acf3845d2e09675b49fec5d783d57eb780 -PKG_MIRROR_HASH:=3e70d78e92f73e0848a75cfd74762656a4172b6d71369b9e2717dc57acf39cbf +PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git +PKG_SOURCE_DATE:=2017-12-07 +PKG_SOURCE_VERSION:=3b417b9f41b4ceb5912d82f867dd5534e5675b5c +PKG_MIRROR_HASH:=1c9c21e56186345d0034d15051c1d9c5ebb5aa6658d6ae8886d8403207a914a3 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING PKG_MAINTAINER:=Jo-Philipp Wich -PKG_FLAGS := nonshared -PKG_CONFIG_DEPENDS := CONFIG_SIGNED_PACKAGES CONFIG_TARGET_INIT_PATH +# Extend depends from version.mk +PKG_CONFIG_DEPENDS += \ + CONFIG_SIGNED_PACKAGES \ + CONFIG_TARGET_INIT_PATH PKG_BUILD_PARALLEL:=1 HOST_BUILD_PARALLEL:=1 @@ -43,7 +43,7 @@ define Package/opkg CATEGORY:=Base system TITLE:=opkg package manager DEPENDS:=+uclient-fetch +libpthread +libubox - URL:=https://git.lede-project.org/?p=project/opkg-lede.git + URL:=$(PKG_SOURCE_URL) MENU:=1 endef @@ -86,8 +86,6 @@ define Package/opkg/install $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/customfeeds.conf $(1)/etc/opkg/customfeeds.conf $(INSTALL_DATA) ./files/opkg$(2).conf $(1)/etc/opkg.conf - $(call FeedSourcesAppend,$(1)/etc/opkg/distfeeds.conf) - $(VERSION_SED) $(1)/etc/opkg/distfeeds.conf $(INSTALL_BIN) ./files/20_migrate-feeds $(1)/etc/uci-defaults/ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/opkg-cl $(1)/bin/opkg ifneq ($(CONFIG_SIGNED_PACKAGES),) From 6190cbe91b40a722629ecc01afcfdd549bf9062d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 19:30:57 +0800 Subject: [PATCH 85/95] allow feeds trunk --- package/lean/default-settings/Makefile | 2 +- .../lean/default-settings/i18n/more.zh-cn.po | 365 +++++++++++++++++ .../default-settings/i18n/nlbwmon.zh-cn.po | 366 ------------------ 3 files changed, 366 insertions(+), 367 deletions(-) delete mode 100644 package/lean/default-settings/i18n/nlbwmon.zh-cn.po diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 4b05ecd9f..7d7a5b34c 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=31 +PKG_RELEASE:=32 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/i18n/more.zh-cn.po b/package/lean/default-settings/i18n/more.zh-cn.po index 1e0f34f08..6cfb4c420 100644 --- a/package/lean/default-settings/i18n/more.zh-cn.po +++ b/package/lean/default-settings/i18n/more.zh-cn.po @@ -561,3 +561,368 @@ msgstr "" msgid "unreachable (reject)" msgstr "ä¸å¯è¾¾ï¼ˆæ‹’ç»ï¼‰" + +msgid "%d IPv4-only hosts" +msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv4" + +msgid "%d IPv6-only hosts" +msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv6" + +msgid "%d dual-stack hosts" +msgstr "%d 个åŒå议栈主机" + +msgid "%s and %s" +msgstr "%s å’Œ %s" + +msgid "%s, %s and %s" +msgstr "%s, %s å’Œ %s" + +msgid "-1 - Restart every last day of month" +msgstr "-1 - æ¯æœˆçš„最åŽä¸€å¤©é‡æ–°å¼€å§‹" + +msgid "-7 - Restart a week before end of month" +msgstr "-7 - æ¯æœˆåº•å‰ä¸€å‘¨é‡æ–°å¼€å§‹" + +msgid "1 - Restart every 1st of month" +msgstr "1 - æ¯æœˆçš„第一天é‡æ–°å¼€å§‹" + +msgid "10m - frequent commits at the expense of flash wear" +msgstr "10m - 频ç¹æ交,闪存æŸè€—的开销也增大" + +msgid "12h - compromise between risk of data loss and flash wear" +msgstr "12h - 平衡统计数æ®ä¸¢å¤±çš„风险以åŠé—ªå­˜ä½¿ç”¨å¯¿å‘½" + +msgid "24h - least flash wear at the expense of data loss risk" +msgstr "24h - 以数æ®ä¸¢å¤±é£Žé™©çš„代价æ¢å–最å°çš„闪存æŸè€—" + +msgid "30s - refresh twice per minute for reasonably current stats" +msgstr "30s - æ¯åˆ†é’Ÿåˆ·æ–°äºŒæ¬¡ä»¥èŽ·å¾—较准确的当å‰ç»Ÿè®¡å€¼" + +msgid "5m - rarely refresh to avoid frequently clearing conntrack counters" +msgstr "5m - 较少刷新以é¿å…频ç¹æ¸…除连接跟踪计数器" + +msgid "60s - commit minutely, useful for non-flash storage" +msgstr "60s - æ¯åˆ†é’Ÿæ交,适用于éžé—ªå­˜ç±»åž‹å­˜å‚¨" + +msgid "0 connections" +msgstr "连接:0" + +msgid "0 hosts" +msgstr "主机:0" + +msgid "0% IPv6 support rate among hosts" +msgstr "æ”¯æŒ IPv6 的主机比例:0%" + +msgid "0B total IPv6 download" +msgstr "IPv6 总下载é‡ï¼š0B" + +msgid "0% of the total traffic is IPv6" +msgstr "IPv6 æµé‡æ¯”例:0%" + +msgid "0B total IPv6 upload" +msgstr "IPv6 总上传é‡ï¼š0B" + +msgid "0 cause the most connections" +msgstr "0 是连接数最多的åè®®" + +msgid "0 cause the most download" +msgstr "0 是下载é‡æœ€å¤§çš„åè®®" + +msgid "0 cause the most upload" +msgstr "0 是上传é‡æœ€å¤§çš„åè®®" + +msgid "0 different application protocols" +msgstr "0 ç§ä¸åŒçš„应用层åè®®" + +msgid "0 download" +msgstr "下载:0" + +msgid "0 upload" +msgstr "上传:0" + +msgid "Accounting period" +msgstr "统计周期" + +msgid "Advanced Settings" +msgstr "高级设置" + +msgid "Application" +msgstr "应用层åè®®" + +msgid "Application Protocols" +msgstr "应用层åè®®" + +msgid "Backup" +msgstr "备份" + +msgid "Bandwidth Monitor" +msgstr "带宽监控" + +msgid "CSV, grouped by IP" +msgstr "CSV,按 IP 分组" + +msgid "CSV, grouped by MAC" +msgstr "CSV,按 MAC 分组" + +msgid "CSV, grouped by protocol" +msgstr "CSV,按å议分组" + +msgid "" +"Changing the accounting interval type will invalidate existing databases!" +"
Download backup." +msgstr "" +"更改统计周期类型会使现有数æ®åº“无效ï¼
下载备份." + +msgid "" +"Choose \"Day of month\" to restart the accounting period monthly on a " +"specific date, e.g. every 3rd. Choose \"Fixed interval\" to restart the " +"accounting period exactly every N days, beginning at a given date." +msgstr "" +"选择“æ¯æœˆçš„æŸä¸€å¤©â€æ¥è®¾ç½®ç»Ÿè®¡å‘¨æœŸçš„é‡å¯æ—¶é—´ï¼Œä¾‹å¦‚:æ¯ä¸ªæœˆçš„第 3 天。选择“固定周" +"期â€æ¥è®¾ç½®ä»Žç»™å®šæ—¥æœŸå¼€å§‹æ¯ N 天é‡å¯ç»Ÿè®¡å‘¨æœŸã€‚" + +msgid "Commit interval" +msgstr "æ交间隔" + +msgid "Compress database" +msgstr "压缩数æ®åº“" + +msgid "Configuration" +msgstr "é…ç½®" + +msgid "Conn." +msgstr "连接" + +msgid "Connections" +msgstr "连接" + +msgid "Connections / Host" +msgstr "连接 / 主机" + +msgid "Database directory" +msgstr "æ•°æ®åº“目录" + +msgid "" +"Database storage directory. One file per accounting period will be placed " +"into this directory." +msgstr "æ•°æ®åº“存储目录。æ¯ä¸ªâ€œç»Ÿè®¡å‘¨æœŸâ€çš„文件将被放到这个目录中。" + +msgid "Day of month" +msgstr "æ¯æœˆçš„æŸä¸€å¤©" + +msgid "" +"Day of month to restart the accounting period. Use negative values to count " +"towards the end of month, e.g. \"-5\" to specify the 27th of July or the " +"24th of Februrary." +msgstr "" +"æ¯ä¸ªæœˆé‡å¯ç»Ÿè®¡å‘¨æœŸçš„日期。使用负数表示从月底开始计算,例如:\"-5\" å¯ä»¥è¡¨" +"示 7 月份的 27 å·æˆ–者 2 月份的 24 å·ã€‚" + +msgid "Display" +msgstr "显示" + +msgid "Down. (Bytes / Pkts.)" +msgstr "下载(字节 / æ•°æ®åŒ…)" + +msgid "Download (Bytes / Packets)" +msgstr "下载(字节 / æ•°æ®åŒ…)" + +msgid "Download / Application" +msgstr "下载 / 应用层åè®®" + +msgid "Download Database Backup" +msgstr "下载数æ®åº“备份" + +msgid "Dualstack enabled hosts" +msgstr "åŒå议栈主机" + +msgid "Due date" +msgstr "é‡ç½®æ—¥æœŸ" + +msgid "Export" +msgstr "导出" + +msgid "Family" +msgstr "å议类型" + +msgid "Fixed interval" +msgstr "固定周期" + +msgid "Force reload…" +msgstr "强制é‡æ–°åŠ è½½..." + +msgid "General Settings" +msgstr "基本设置" + +msgid "Generate Backup" +msgstr "生æˆå¤‡ä»½" + +msgid "Host" +msgstr "主机" + +msgid "Hostname: example.org" +msgstr "主机å:example.org" + +msgid "IPv4 vs. IPv6" +msgstr "IPv4 与 IPv6" + +msgid "IPv6" +msgstr "IPv6" + +msgid "Interval" +msgstr "周期" + +msgid "" +"Interval at which the temporary in-memory database is committed to the " +"persistent database directory." +msgstr "将内存中的临时数æ®åº“æ交到æŒä¹…性数æ®åº“目录的间隔时间。" + +msgid "" +"Interval at which traffic counters of still established connections are " +"refreshed from netlink information." +msgstr "从 netlink ä¿¡æ¯ä¸­åˆ·æ–°â€œå·²å»ºç«‹è¿žæŽ¥â€çš„æµé‡è®¡æ•°å™¨çš„间隔时间。" + +msgid "Invalid or empty backup archive" +msgstr "备份存档无效或为空" + +msgid "JSON dump" +msgstr "JSON 输出" + +msgid "Length of accounting interval in days." +msgstr "统计周期(天)。" + +msgid "Local interfaces" +msgstr "本地接å£" + +msgid "Local subnets" +msgstr "本地å­ç½‘" + +msgid "MAC" +msgstr "MAC" + +msgid "Maximum entries" +msgstr "最大æ¡ç›®" + +msgid "" +"Maximum number of accounting periods to keep, use zero to keep databases " +"forever." +msgstr "ä¿ç•™çš„统计周期数æ®åº“的最大数é‡ï¼Œè®¾ç½® 0 表示ä¸é™åˆ¶ã€‚" + +msgid "Netlink Bandwidth Monitor" +msgstr "网络带宽监视器" + +msgid "Netlink Bandwidth Monitor - Backup / Restore" +msgstr "网络带宽监视器 - 备份 / æ¢å¤" + +msgid "Netlink Bandwidth Monitor - Configuration" +msgstr "网络带宽监视器 - é…ç½®" + +msgid "No data recorded yet." +msgstr "æš‚æ— æ•°æ®è®°å½•ã€‚" + +msgid "Only conntrack streams from or to any of these networks are counted." +msgstr "仅统计æ¥è‡ªæˆ–目标为这些网络接å£çš„连接æµé‡ã€‚" + +msgid "Only conntrack streams from or to any of these subnets are counted." +msgstr "仅统计æ¥è‡ªæˆ–目标为这些å­ç½‘的连接æµé‡ã€‚" + +msgid "Preallocate database" +msgstr "预分é…æ•°æ®åº“" + +msgid "Protocol" +msgstr "åè®®" + +msgid "Protocol Mapping" +msgstr "å议映射" + +msgid "" +"Protocol mappings to distinguish traffic types per host, one mapping per " +"line. The first value specifies the IP protocol, the second value the port " +"number and the third column is the name of the mapped protocol." +msgstr "" +"å议映射用于区分æµé‡ç±»åž‹ï¼Œæ¯è¡Œä¸€æ¡ã€‚第一个值指定 IP å议类型,第二个值是" +"端å£å·ï¼Œç¬¬ä¸‰ä¸ªå€¼æ˜¯æ˜ å°„çš„åè®®å称。" + +msgid "Refresh interval" +msgstr "刷新间隔" + +msgid "Restore" +msgstr "æ¢å¤" + +msgid "Restore Database Backup" +msgstr "æ¢å¤æ•°æ®åº“备份" + +msgid "Select accounting period:" +msgstr "选择统计周期:" + +msgid "Source IP" +msgstr "æº IP" + +msgid "Start date" +msgstr "起始日期" + +msgid "Start date of the first accounting period, e.g. begin of ISP contract." +msgstr "第一个统计周期的起始日期,例如:ISP åˆçº¦çš„起始日期。" + +msgid "Stored periods" +msgstr "储存周期" + +msgid "" +"The Netlink Bandwidth Monitor (nlbwmon) is a lightweight, efficient traffic " +"accounting program keeping track of bandwidth usage per host and protocol." +msgstr "" +"网络带宽监视器(nlbwmon)是一个轻é‡ã€é«˜æ•ˆçš„æµé‡ç»Ÿè®¡ç¨‹åºï¼Œå¯ä»¥ç»Ÿè®¡æ¯ä¸ªä¸»æœºå’Œ" +"å议的带宽使用情况。" + +msgid "The following database files have been restored: %s" +msgstr "以下数æ®åº“文件已æ¢å¤ï¼š%s" + +msgid "" +"The maximum amount of entries that should be put into the database, setting " +"the limit to 0 will allow databases to grow indefinitely." +msgstr "æ•°æ®åº“中的最大æ¡ç›®æ•°é‡, 设置为 0 å°†å…许数æ®åº“æ— é™å¢žé•¿ã€‚" + +msgid "Traffic / Host" +msgstr "æµé‡ / 主机" + +msgid "Traffic Distribution" +msgstr "æµé‡åˆ†å¸ƒ" + +msgid "Up. (Bytes / Pkts.)" +msgstr "上传(字节 / æ•°æ®åŒ…)" + +msgid "Upload (Bytes / Packets)" +msgstr "上传(字节 / æ•°æ®åŒ…)" + +msgid "Upload / Application" +msgstr "上传 / 应用层åè®®" + +msgid "Vendor: Example Corp." +msgstr "供应商: Example Corp." + +msgid "Warning" +msgstr "警告" + +msgid "" +"Whether to gzip compress archive databases. Compressing the database files " +"makes accessing old data slightly slower but helps to reduce storage " +"requirements." +msgstr "" +"是å¦ä½¿ç”¨ gzip 压缩数æ®åº“存档。压缩数æ®åº“文件会使访问旧数æ®ç¨å¾®æ…¢ä¸€äº›, 但有助" +"于å‡å°‘存储å ç”¨ç©ºé—´ã€‚" + +msgid "" +"Whether to preallocate the maximum possible database size in memory. This is " +"mainly useful for memory constrained systems which might not be able to " +"satisfy memory allocation after longer uptime periods." +msgstr "" +"是å¦é¢„先分é…æ•°æ®åº“最大å¯èƒ½å ç”¨çš„内存大å°ã€‚这主è¦é€‚用于内存较å°ç³»ç»Ÿï¼Œè¿™äº›ç³»ç»Ÿ" +"在长时间è¿è¡Œä¹‹åŽå¯èƒ½æ— æ³•æ»¡è¶³æ•°æ®åº“的内存需求。" + +msgid "no traffic" +msgstr "æ— æµé‡æ•°æ®" + +msgid "other" +msgstr "其他" + diff --git a/package/lean/default-settings/i18n/nlbwmon.zh-cn.po b/package/lean/default-settings/i18n/nlbwmon.zh-cn.po deleted file mode 100644 index 54fb3f649..000000000 --- a/package/lean/default-settings/i18n/nlbwmon.zh-cn.po +++ /dev/null @@ -1,366 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - -msgid "%d IPv4-only hosts" -msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv4" - -msgid "%d IPv6-only hosts" -msgstr "%d ä¸ªä¸»æœºä»…æ”¯æŒ IPv6" - -msgid "%d dual-stack hosts" -msgstr "%d 个åŒå议栈主机" - -msgid "%s and %s" -msgstr "%s å’Œ %s" - -msgid "%s, %s and %s" -msgstr "%s, %s å’Œ %s" - -msgid "-1 - Restart every last day of month" -msgstr "-1 - æ¯æœˆçš„最åŽä¸€å¤©é‡æ–°å¼€å§‹" - -msgid "-7 - Restart a week before end of month" -msgstr "-7 - æ¯æœˆåº•å‰ä¸€å‘¨é‡æ–°å¼€å§‹" - -msgid "1 - Restart every 1st of month" -msgstr "1 - æ¯æœˆçš„第一天é‡æ–°å¼€å§‹" - -msgid "10m - frequent commits at the expense of flash wear" -msgstr "10m - 频ç¹æ交,闪存æŸè€—的开销也增大" - -msgid "12h - compromise between risk of data loss and flash wear" -msgstr "12h - 平衡统计数æ®ä¸¢å¤±çš„风险以åŠé—ªå­˜ä½¿ç”¨å¯¿å‘½" - -msgid "24h - least flash wear at the expense of data loss risk" -msgstr "24h - 以数æ®ä¸¢å¤±é£Žé™©çš„代价æ¢å–最å°çš„闪存æŸè€—" - -msgid "30s - refresh twice per minute for reasonably current stats" -msgstr "30s - æ¯åˆ†é’Ÿåˆ·æ–°äºŒæ¬¡ä»¥èŽ·å¾—较准确的当å‰ç»Ÿè®¡å€¼" - -msgid "5m - rarely refresh to avoid frequently clearing conntrack counters" -msgstr "5m - 较少刷新以é¿å…频ç¹æ¸…除连接跟踪计数器" - -msgid "60s - commit minutely, useful for non-flash storage" -msgstr "60s - æ¯åˆ†é’Ÿæ交,适用于éžé—ªå­˜ç±»åž‹å­˜å‚¨" - -msgid "0 connections" -msgstr "连接:0" - -msgid "0 hosts" -msgstr "主机:0" - -msgid "0% IPv6 support rate among hosts" -msgstr "æ”¯æŒ IPv6 的主机比例:0%" - -msgid "0B total IPv6 download" -msgstr "IPv6 总下载é‡ï¼š0B" - -msgid "0% of the total traffic is IPv6" -msgstr "IPv6 æµé‡æ¯”例:0%" - -msgid "0B total IPv6 upload" -msgstr "IPv6 总上传é‡ï¼š0B" - -msgid "0 cause the most connections" -msgstr "0 是连接数最多的åè®®" - -msgid "0 cause the most download" -msgstr "0 是下载é‡æœ€å¤§çš„åè®®" - -msgid "0 cause the most upload" -msgstr "0 是上传é‡æœ€å¤§çš„åè®®" - -msgid "0 different application protocols" -msgstr "0 ç§ä¸åŒçš„应用层åè®®" - -msgid "0 download" -msgstr "下载:0" - -msgid "0 upload" -msgstr "上传:0" - -msgid "Accounting period" -msgstr "统计周期" - -msgid "Advanced Settings" -msgstr "高级设置" - -msgid "Application" -msgstr "应用层åè®®" - -msgid "Application Protocols" -msgstr "应用层åè®®" - -msgid "Backup" -msgstr "备份" - -msgid "Bandwidth Monitor" -msgstr "带宽监控" - -msgid "CSV, grouped by IP" -msgstr "CSV,按 IP 分组" - -msgid "CSV, grouped by MAC" -msgstr "CSV,按 MAC 分组" - -msgid "CSV, grouped by protocol" -msgstr "CSV,按å议分组" - -msgid "" -"Changing the accounting interval type will invalidate existing databases!" -"
Download backup." -msgstr "" -"更改统计周期类型会使现有数æ®åº“无效ï¼
下载备份." - -msgid "" -"Choose \"Day of month\" to restart the accounting period monthly on a " -"specific date, e.g. every 3rd. Choose \"Fixed interval\" to restart the " -"accounting period exactly every N days, beginning at a given date." -msgstr "" -"选择“æ¯æœˆçš„æŸä¸€å¤©â€æ¥è®¾ç½®ç»Ÿè®¡å‘¨æœŸçš„é‡å¯æ—¶é—´ï¼Œä¾‹å¦‚:æ¯ä¸ªæœˆçš„第 3 天。选择“固定周" -"期â€æ¥è®¾ç½®ä»Žç»™å®šæ—¥æœŸå¼€å§‹æ¯ N 天é‡å¯ç»Ÿè®¡å‘¨æœŸã€‚" - -msgid "Commit interval" -msgstr "æ交间隔" - -msgid "Compress database" -msgstr "压缩数æ®åº“" - -msgid "Configuration" -msgstr "é…ç½®" - -msgid "Conn." -msgstr "连接" - -msgid "Connections" -msgstr "连接" - -msgid "Connections / Host" -msgstr "连接 / 主机" - -msgid "Database directory" -msgstr "æ•°æ®åº“目录" - -msgid "" -"Database storage directory. One file per accounting period will be placed " -"into this directory." -msgstr "æ•°æ®åº“存储目录。æ¯ä¸ªâ€œç»Ÿè®¡å‘¨æœŸâ€çš„文件将被放到这个目录中。" - -msgid "Day of month" -msgstr "æ¯æœˆçš„æŸä¸€å¤©" - -msgid "" -"Day of month to restart the accounting period. Use negative values to count " -"towards the end of month, e.g. \"-5\" to specify the 27th of July or the " -"24th of Februrary." -msgstr "" -"æ¯ä¸ªæœˆé‡å¯ç»Ÿè®¡å‘¨æœŸçš„日期。使用负数表示从月底开始计算,例如:\"-5\" å¯ä»¥è¡¨" -"示 7 月份的 27 å·æˆ–者 2 月份的 24 å·ã€‚" - -msgid "Display" -msgstr "显示" - -msgid "Down. (Bytes / Pkts.)" -msgstr "下载(字节 / æ•°æ®åŒ…)" - -msgid "Download (Bytes / Packets)" -msgstr "下载(字节 / æ•°æ®åŒ…)" - -msgid "Download / Application" -msgstr "下载 / 应用层åè®®" - -msgid "Download Database Backup" -msgstr "下载数æ®åº“备份" - -msgid "Dualstack enabled hosts" -msgstr "åŒå议栈主机" - -msgid "Due date" -msgstr "é‡ç½®æ—¥æœŸ" - -msgid "Export" -msgstr "导出" - -msgid "Family" -msgstr "å议类型" - -msgid "Fixed interval" -msgstr "固定周期" - -msgid "Force reload…" -msgstr "强制é‡æ–°åŠ è½½..." - -msgid "General Settings" -msgstr "基本设置" - -msgid "Generate Backup" -msgstr "生æˆå¤‡ä»½" - -msgid "Host" -msgstr "主机" - -msgid "Hostname: example.org" -msgstr "主机å:example.org" - -msgid "IPv4 vs. IPv6" -msgstr "IPv4 与 IPv6" - -msgid "IPv6" -msgstr "IPv6" - -msgid "Interval" -msgstr "周期" - -msgid "" -"Interval at which the temporary in-memory database is committed to the " -"persistent database directory." -msgstr "将内存中的临时数æ®åº“æ交到æŒä¹…性数æ®åº“目录的间隔时间。" - -msgid "" -"Interval at which traffic counters of still established connections are " -"refreshed from netlink information." -msgstr "从 netlink ä¿¡æ¯ä¸­åˆ·æ–°â€œå·²å»ºç«‹è¿žæŽ¥â€çš„æµé‡è®¡æ•°å™¨çš„间隔时间。" - -msgid "Invalid or empty backup archive" -msgstr "备份存档无效或为空" - -msgid "JSON dump" -msgstr "JSON 输出" - -msgid "Length of accounting interval in days." -msgstr "统计周期(天)。" - -msgid "Local interfaces" -msgstr "本地接å£" - -msgid "Local subnets" -msgstr "本地å­ç½‘" - -msgid "MAC" -msgstr "MAC" - -msgid "Maximum entries" -msgstr "最大æ¡ç›®" - -msgid "" -"Maximum number of accounting periods to keep, use zero to keep databases " -"forever." -msgstr "ä¿ç•™çš„统计周期数æ®åº“的最大数é‡ï¼Œè®¾ç½® 0 表示ä¸é™åˆ¶ã€‚" - -msgid "Netlink Bandwidth Monitor" -msgstr "网络带宽监视器" - -msgid "Netlink Bandwidth Monitor - Backup / Restore" -msgstr "网络带宽监视器 - 备份 / æ¢å¤" - -msgid "Netlink Bandwidth Monitor - Configuration" -msgstr "网络带宽监视器 - é…ç½®" - -msgid "No data recorded yet." -msgstr "æš‚æ— æ•°æ®è®°å½•ã€‚" - -msgid "Only conntrack streams from or to any of these networks are counted." -msgstr "仅统计æ¥è‡ªæˆ–目标为这些网络接å£çš„连接æµé‡ã€‚" - -msgid "Only conntrack streams from or to any of these subnets are counted." -msgstr "仅统计æ¥è‡ªæˆ–目标为这些å­ç½‘的连接æµé‡ã€‚" - -msgid "Preallocate database" -msgstr "预分é…æ•°æ®åº“" - -msgid "Protocol" -msgstr "åè®®" - -msgid "Protocol Mapping" -msgstr "å议映射" - -msgid "" -"Protocol mappings to distinguish traffic types per host, one mapping per " -"line. The first value specifies the IP protocol, the second value the port " -"number and the third column is the name of the mapped protocol." -msgstr "" -"å议映射用于区分æµé‡ç±»åž‹ï¼Œæ¯è¡Œä¸€æ¡ã€‚第一个值指定 IP å议类型,第二个值是" -"端å£å·ï¼Œç¬¬ä¸‰ä¸ªå€¼æ˜¯æ˜ å°„çš„åè®®å称。" - -msgid "Refresh interval" -msgstr "刷新间隔" - -msgid "Restore" -msgstr "æ¢å¤" - -msgid "Restore Database Backup" -msgstr "æ¢å¤æ•°æ®åº“备份" - -msgid "Select accounting period:" -msgstr "选择统计周期:" - -msgid "Source IP" -msgstr "æº IP" - -msgid "Start date" -msgstr "起始日期" - -msgid "Start date of the first accounting period, e.g. begin of ISP contract." -msgstr "第一个统计周期的起始日期,例如:ISP åˆçº¦çš„起始日期。" - -msgid "Stored periods" -msgstr "储存周期" - -msgid "" -"The Netlink Bandwidth Monitor (nlbwmon) is a lightweight, efficient traffic " -"accounting program keeping track of bandwidth usage per host and protocol." -msgstr "" -"网络带宽监视器(nlbwmon)是一个轻é‡ã€é«˜æ•ˆçš„æµé‡ç»Ÿè®¡ç¨‹åºï¼Œå¯ä»¥ç»Ÿè®¡æ¯ä¸ªä¸»æœºå’Œ" -"å议的带宽使用情况。" - -msgid "The following database files have been restored: %s" -msgstr "以下数æ®åº“文件已æ¢å¤ï¼š%s" - -msgid "" -"The maximum amount of entries that should be put into the database, setting " -"the limit to 0 will allow databases to grow indefinitely." -msgstr "æ•°æ®åº“中的最大æ¡ç›®æ•°é‡, 设置为 0 å°†å…许数æ®åº“æ— é™å¢žé•¿ã€‚" - -msgid "Traffic / Host" -msgstr "æµé‡ / 主机" - -msgid "Traffic Distribution" -msgstr "æµé‡åˆ†å¸ƒ" - -msgid "Up. (Bytes / Pkts.)" -msgstr "上传(字节 / æ•°æ®åŒ…)" - -msgid "Upload (Bytes / Packets)" -msgstr "上传(字节 / æ•°æ®åŒ…)" - -msgid "Upload / Application" -msgstr "上传 / 应用层åè®®" - -msgid "Vendor: Example Corp." -msgstr "供应商: Example Corp." - -msgid "Warning" -msgstr "警告" - -msgid "" -"Whether to gzip compress archive databases. Compressing the database files " -"makes accessing old data slightly slower but helps to reduce storage " -"requirements." -msgstr "" -"是å¦ä½¿ç”¨ gzip 压缩数æ®åº“存档。压缩数æ®åº“文件会使访问旧数æ®ç¨å¾®æ…¢ä¸€äº›, 但有助" -"于å‡å°‘存储å ç”¨ç©ºé—´ã€‚" - -msgid "" -"Whether to preallocate the maximum possible database size in memory. This is " -"mainly useful for memory constrained systems which might not be able to " -"satisfy memory allocation after longer uptime periods." -msgstr "" -"是å¦é¢„先分é…æ•°æ®åº“最大å¯èƒ½å ç”¨çš„内存大å°ã€‚这主è¦é€‚用于内存较å°ç³»ç»Ÿï¼Œè¿™äº›ç³»ç»Ÿ" -"在长时间è¿è¡Œä¹‹åŽå¯èƒ½æ— æ³•æ»¡è¶³æ•°æ®åº“的内存需求。" - -msgid "no traffic" -msgstr "æ— æµé‡æ•°æ®" - -msgid "other" -msgstr "其他" From a75d5c7bfbe04c50d9bcc1c5742824dcfa34fa70 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sat, 13 Jan 2018 22:51:36 +0800 Subject: [PATCH 86/95] add 2.4G wireless support for ASUS RT-ACRH17 --- .../ipq806x/base-files/etc/board.d/01_leds | 11 +- .../ipq806x/base-files/etc/board.d/02_network | 10 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 6 +- .../base-files/lib/preinit/06_set_iface_mac | 19 ++ .../base-files/lib/upgrade/platform.sh | 10 + .../arm/boot/dts/qcom-ipq4019-rt-acrh17.dts | 296 ++++++++++-------- target/linux/ipq806x/image/Makefile | 2 +- 7 files changed, 212 insertions(+), 142 deletions(-) create mode 100644 target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac diff --git a/target/linux/ipq806x/base-files/etc/board.d/01_leds b/target/linux/ipq806x/base-files/etc/board.d/01_leds index a5b6bfc03..9d5f7fde0 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/01_leds +++ b/target/linux/ipq806x/base-files/etc/board.d/01_leds @@ -35,7 +35,16 @@ nbg6817) ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:amber:wifi5g" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:white:internet" "eth1" ;; -rt-acrh17 |\ +rt-acrh17) + ucidef_set_led_default "status" "STATUS" "${board}:blue:status" "1" + ucidef_set_led_wlan "wlan2g" "WLAN2G" "${board}:blue:wlan2g" "phy0tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "${board}:blue:wlan5g" "phy1tpt" + ucidef_set_led_switch "wan" "WAN(blue)" "${board}:blue:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "${board}:blue:lan1" "switch0" "0x02" + ucidef_set_led_switch "lan2" "LAN2" "${board}:blue:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "LAN3" "${board}:blue:lan3" "switch0" "0x08" + ucidef_set_led_switch "lan4" "LAN4" "${board}:blue:lan4" "switch0" "0x10" + ;; rt-ac58u) ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:blue:wlan2G" "phy0tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:blue:wlan5G" "phy1tpt" diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network index 9d5ba2d68..f69638f03 100755 --- a/target/linux/ipq806x/base-files/etc/board.d/02_network +++ b/target/linux/ipq806x/base-files/etc/board.d/02_network @@ -53,7 +53,15 @@ nbg6817) ucidef_set_interface_macaddr "lan" "$hw_mac_addr" ucidef_set_interface_macaddr "wan" "$(macaddr_add $hw_mac_addr 1)" ;; -rt-acrh17 |\ +rt-acrh17) + CI_UBIPART=UBI_DEV + lan_mac_addr=$(mtd_get_mac_binary_ubi Factory 4102) + wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 36870) + ucidef_add_switch "switch0" \ + "0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + ucidef_set_interface_macaddr "lan" "$lan_mac_addr" + ucidef_set_interface_macaddr "wan" "$wan_mac_addr" + ;; rt-ac58u) CI_UBIPART=UBI_DEV wan_mac_addr=$(mtd_get_mac_binary_ubi Factory 20486) diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 9557b539a..22de2de82 100644 --- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -76,7 +76,6 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-ahb-a800000.wifi.bin") case "$board" in - rt-acrh17 |\ rt-ac58u) . /lib/upgrade/nand.sh @@ -91,6 +90,11 @@ case "$FIRMWARE" in "ath10k/pre-cal-pci-0000:01:00.0.bin") case $board in + rt-acrh17) + CI_UBIPART=UBI_DEV + . /lib/upgrade/nand.sh + ath10kcal_ubi_extract "Factory" 36864 12064 + ;; c2600) ath10kcal_extract "radio" 4096 12064 # ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_binary default-mac 8) -1) diff --git a/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac new file mode 100644 index 000000000..d08f26558 --- /dev/null +++ b/target/linux/ipq806x/base-files/lib/preinit/06_set_iface_mac @@ -0,0 +1,19 @@ +# +# Copyright (C) 2014-2015 OpenWrt.org +# Copyright (C) 2016 LEDE-Project.org +# + +preinit_set_mac_address() { + local mac + + . /lib/functions.sh + + case $(board_name) in + rt-acrh17) + CI_UBIPART=UBI_DEV + mac=$(mtd_get_mac_binary_ubi Factory 4102) + ifconfig eth0 hw ether $mac 2>/dev/null + esac +} + +boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh index cf046800d..797caf061 100644 --- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh +++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh @@ -34,6 +34,16 @@ EOF platform_do_upgrade() { case "$(board_name)" in + rt-acrh17) + CI_UBIPART="UBI_DEV" + CI_KERNPART="linux" + local ubidev=$(nand_find_ubi $CI_UBIPART) + local jffs2=$(nand_find_volume $ubidev jffs2) + local linux2=$(nand_find_volume $ubidev linux2) + [ -n "$jffs2" ] && ubirmvol /dev/$ubidev --name=jffs2 + [ -n "$linux2" ] && ubirmvol /dev/$ubidev --name=linux2 + nand_do_upgrade "$1" + ;; ap148 |\ ap-dk04.1-c1 |\ d7800 |\ diff --git a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts index c68cc0e9e..beace8ecf 100644 --- a/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts +++ b/target/linux/ipq806x/files-4.9/arch/arm/boot/dts/qcom-ipq4019-rt-acrh17.dts @@ -14,7 +14,7 @@ * */ -#include "qcom-ipq4019-ap.dk01.1.dtsi" +#include "qcom-ipq4019-ap.dk04.1.dtsi" #include "qcom-ipq4019-bus.dtsi" #include #include @@ -48,6 +48,91 @@ }; soc { + spi_0: spi@78b5000 { + status = "disabled"; + }; + + pcie0: qcom,pcie@80000 { + compatible = "qcom,msm_pcie"; + cell-index = <0>; + qcom,ctrl-amt = <1>; + + reg = <0x80000 0x2000>, + <0x99000 0x800>, + <0x40000000 0xf1d>, + <0x40000f20 0xa8>, + <0x40100000 0x1000>, + <0x40200000 0x100000>, + <0x40300000 0xd00000>; + reg-names = "parf", "phy", "dm_core", "elbi", + "conf", "io", "bars"; + + #address-cells = <0>; + interrupt-parent = <&pcie0>; + interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12>; + #interrupt-cells = <1>; + interrupt-map-mask = <0xffffffff>; + interrupt-map = <0 &intc 0 141 0 + 1 &intc 0 142 0 + 2 &intc 0 143 0 + 3 &intc 0 144 0 + 4 &intc 0 145 0 + 5 &intc 0 146 0 + 6 &intc 0 147 0 + 7 &intc 0 148 0 + 8 &intc 0 149 0 + 9 &intc 0 150 0 + 10 &intc 0 151 0 + 11 &intc 0 152 0 >; + + interrupt-names = "int_msi", "int_a", "int_b", "int_c", "int_d", + "int_pls_pme", "int_pme_legacy", "int_pls_err", + "int_aer_legacy", "int_pls_link_up", + "int_pls_link_down", "int_bridge_flush_n","int_wake"; + + qcom,ep-latency = <10>; + + clocks = <&gcc GCC_PCIE_AHB_CLK>, + <&gcc GCC_PCIE_AXI_M_CLK>, + <&gcc GCC_PCIE_AXI_S_CLK>; + + clock-names = "pcie_0_cfg_ahb_clk", + "pcie_0_mstr_axi_clk", + "pcie_0_slv_axi_clk"; + + max-clock-frequency-hz = <0>, <0>, <0>; + + resets = <&gcc PCIE_AXI_M_ARES>, + <&gcc PCIE_AXI_S_ARES>, + <&gcc PCIE_PIPE_ARES>, + <&gcc PCIE_AXI_M_VMIDMT_ARES>, + <&gcc PCIE_AXI_S_XPU_ARES>, + <&gcc PCIE_PARF_XPU_ARES>, + <&gcc PCIE_PHY_ARES>, + <&gcc PCIE_AXI_M_STICKY_ARES>, + <&gcc PCIE_PIPE_STICKY_ARES>, + <&gcc PCIE_PWR_ARES>, + <&gcc PCIE_AHB_ARES>, + <&gcc PCIE_PHY_AHB_ARES>; + + reset-names = "pcie_rst_axi_m_ares", + "pcie_rst_axi_s_ares", + "pcie_rst_pipe_ares", + "pcie_rst_axi_m_vmidmt_ares", + "pcie_rst_axi_s_xpu_ares", + "pcie_rst_parf_xpu_ares", + "pcie_rst_phy_ares", + "pcie_rst_axi_m_sticky_ares", + "pcie_rst_pipe_sticky_ares", + "pcie_rst_pwr_ares", + "pcie_rst_ahb_res", + "pcie_rst_phy_ahb_ares"; + + status = "ok"; + perst-gpio = <&tlmm 38 0>; + wake-gpio = <&tlmm 50 0>; + clkreq-gpio = <&tlmm 39 0>; + }; tcsr@194b000 { /* select hostmode */ @@ -63,7 +148,6 @@ qcom,ess-interface-select = ; }; - tcsr@1949000 { compatible = "qcom,tcsr"; reg = <0x1949000 0x100>; @@ -76,11 +160,6 @@ qcom,wifi_noc_memtype_m0_m2 = ; }; - counter@4a1000 { - compatible = "qcom,qca-gcnt"; - reg = <0x4a1000 0x4>; - }; - mdio@90000 { status = "okay"; }; @@ -97,20 +176,20 @@ status = "okay"; }; - wifi@a000000 { - status = "okay"; + wifi0: wifi@a000000 { + status = "ok"; + core-id = <0x0>; + qca,msi_addr = <0x0b006040>; + qca,msi_base = <0x40>; + wifi_led_num = <2>; /* Wifi 2G */ + wifi_led_source = <0>; /* source id 0 */ + qcom,mtd-name = "0:ART"; + qcom,cal-offset = <0x1000>; + qcom,cal-len = <12064>; }; - wifi@a800000 { - status = "okay"; - }; - - cryptobam: dma@8e04000 { - status = "okay"; - }; - - crypto@8e3a000 { - status = "okay"; + wifi1: wifi@a800000 { + status = "disabled"; }; }; @@ -119,13 +198,13 @@ reset { label = "reset"; - gpios = <&tlmm 4 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 18 GPIO_ACTIVE_LOW>; linux,code = ; }; wps { label = "wps"; - gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + gpios = <&tlmm 11 GPIO_ACTIVE_LOW>; linux,code = ; }; }; @@ -135,137 +214,78 @@ power: status { label = "rt-acrh17:blue:status"; - gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; }; - wan { + lan1 { + label = "rt-acrh17:blue:lan1"; + gpios = <&tlmm 45 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "rt-acrh17:blue:lan2"; + gpios = <&tlmm 43 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "rt-acrh17:blue:lan3"; + gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + }; + + lan4 { + label = "rt-acrh17:blue:lan4"; + gpios = <&tlmm 49 GPIO_ACTIVE_LOW>; + }; + + wan_blue { label = "rt-acrh17:blue:wan"; - gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + gpios = <&tlmm 61 GPIO_ACTIVE_HIGH>; }; - wlan2G { - label = "rt-acrh17:blue:wlan2G"; - gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + wan_red { + label = "rt-acrh17:red:wan"; + gpios = <&tlmm 68 GPIO_ACTIVE_HIGH>; }; - wan5G { - label = "rt-acrh17:blue:wlan5G"; - gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + wlan2g { + label = "rt-acrh17:blue:wlan2g"; + gpios = <&tlmm 52 GPIO_ACTIVE_LOW>; }; - usb { - label = "rt-acrh17:blue:usb"; - gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; - }; - - lan { - label = "rt-acrh17:blue:lan"; - gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + wlan5g { + label = "rt-acrh17:blue:wlan5g"; + gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; }; }; }; -&spi_0_pins { - pinmux_cs { - function = "gpio"; - pins = "gpio54", "gpio59"; +&nand_pins { + pullups { + pins = "gpio53", "gpio58", + "gpio59"; + function = "qpic"; + bias-pull-up; }; - pinconf_cs { - pins = "gpio54", "gpio59"; - drive-strength = <2>; + + pulldowns { + pins = "gpio55", "gpio56", + "gpio57", "gpio60", + "gpio62", "gpio63", "gpio64", + "gpio65", "gpio66", "gpio67", + "gpio69"; + function = "qpic"; + bias-pull-down; + }; +}; + +&i2c_0_pins { + pinmux { + function = "blsp_i2c0"; + pins = "gpio10"; + }; + pinconf { + pins = "gpio10"; + drive-strength = <16>; bias-disable; - output-high; - }; -}; - - -&spi_0 { /* BLSP1 QUP1 */ - status = "ok"; - cs-gpios = <&tlmm 54 0>, - <&tlmm 59 0>; - - mx25l25635e@0 { - status = "disabled"; - }; - - m25p80@0 { - #address-cells = <1>; - #size-cells = <0>; - /* - * U-boot looks for "n25q128a11" node, - * if we don't have it, it will spit out the following warning: - * "ipq: fdt fixup unable to find compatible node". - */ - compatible = "mx25l1606e", "n25q128a11", "jedec,spi-nor"; - reg = <0>; - linux,modalias = "m25p80", "mx25l1606e", "n25q128a11"; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "SBL1"; - reg = <0x00000000 0x00040000>; - read-only; - }; - partition1@40000 { - label = "MIBIB"; - reg = <0x00040000 0x00020000>; - read-only; - }; - partition2@60000 { - label = "QSEE"; - reg = <0x00060000 0x00060000>; - read-only; - }; - partition3@c0000 { - label = "CDT"; - reg = <0x000c0000 0x00010000>; - read-only; - }; - partition4@d0000 { - label = "DDRPARAMS"; - reg = <0x000d0000 0x00010000>; - read-only; - }; - partition5@e0000 { - label = "APPSBLENV"; /* uboot env*/ - reg = <0x000e0000 0x00010000>; - read-only; - }; - partition5@f0000 { - label = "APPSBL"; /* uboot */ - reg = <0x000f0000 0x00080000>; - read-only; - }; - partition5@170000 { - label = "ART"; - reg = <0x00170000 0x00010000>; - read-only; - }; - /* 0x00180000 - 0x00200000 unused */ - }; - }; - - mt29f@1 { - #address-cells = <1>; - #size-cells = <0>; - compatible = "spinand,mt29f", "w25n01gv"; - reg = <1>; - spi-max-frequency = <24000000>; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition0@0 { - label = "ubi"; - reg = <0x00000000 0x08000000>; - }; - }; }; }; diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile index c79afb9d7..a9353ec77 100644 --- a/target/linux/ipq806x/image/Makefile +++ b/target/linux/ipq806x/image/Makefile @@ -267,7 +267,7 @@ define Device/RT-ACRH17 IMAGES = sysupgrade.tar flash-factory.trx IMAGE/flash-factory.trx := copy-file $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE) | uImage none IMAGE/sysupgrade.tar := sysupgrade-tar | append-metadata - DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ipq-wifi-rt-ac58u ath10k-firmware-qca9984 + DEVICE_PACKAGES := kmod-usb-phy-qcom-ipq4019 ath10k-firmware-qca4019 ath10k-firmware-qca9984 endef define Device/NBG6817 From 8e41d2030cbf75b7556ae0075ac5cca3fff9f12d Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 14 Jan 2018 21:34:57 +0800 Subject: [PATCH 87/95] add busybox flock support --- package/utils/busybox/Config-defaults.in | 2 +- package/utils/busybox/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 1977e7ff4..06833c396 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS default n config BUSYBOX_DEFAULT_FLOCK bool - default n + default y config BUSYBOX_DEFAULT_FREERAMDISK bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 0d3708636..0be413ad1 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.25.1 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 From 66dbc4d0d7692dd7d5c7e71345353e116c99914c Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 14 Jan 2018 22:22:06 +0800 Subject: [PATCH 88/95] add support for tiny kernel for ar71xx (Tplink 4M or DW33D etc) --- config/Config-kernel.in | 2 +- target/linux/ar71xx/Makefile | 4 +- .../ar71xx/base-files/etc/board.d/01_leds | 82 +- .../ar71xx/base-files/etc/board.d/02_network | 38 +- target/linux/ar71xx/base-files/etc/diag.sh | 78 +- .../etc/hotplug.d/firmware/11-ath10k-caldata | 15 +- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 7 +- .../uci-defaults/03_network-switchX-migration | 22 +- .../etc/uci-defaults/04_led_migration | 4 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 65 +- .../lib/preinit/05_set_preinit_iface_ar71xx | 2 +- .../ar71xx/base-files/lib/upgrade/platform.sh | 116 +- target/linux/ar71xx/config-4.4 | 471 ++++--- target/linux/ar71xx/config-4.9 | 491 ++++--- .../files/arch/mips/ath79/Kconfig.openwrt | 115 +- .../ar71xx/files/arch/mips/ath79/Makefile | 12 +- .../ar71xx/files/arch/mips/ath79/dev-dsa.c | 5 - .../ar71xx/files/arch/mips/ath79/dev-eth.c | 5 + .../arch/mips/ath79/mach-archer-c59-v1.c | 2 +- .../files/arch/mips/ath79/mach-archer-c7-v4.c | 2 +- .../ar71xx/files/arch/mips/ath79/mach-c60.c | 4 + .../files/arch/mips/ath79/mach-dir-869-a1.c | 11 +- .../ar71xx/files/arch/mips/ath79/mach-dr344.c | 135 +- .../files/arch/mips/ath79/mach-gl-ar150.c | 6 +- .../files/arch/mips/ath79/mach-gl-ar300m.c | 2 +- .../arch/mips/ath79/mach-maselink-ap2600i.c | 137 -- .../arch/mips/ath79/mach-maselink-ap2600ifm.c | 147 --- .../files/arch/mips/ath79/mach-mw316r-v1.c | 143 -- .../ar71xx/files/arch/mips/ath79/mach-rb4xx.c | 5 - .../ar71xx/files/arch/mips/ath79/mach-rb922.c | 21 +- .../ar71xx/files/arch/mips/ath79/mach-rb95x.c | 4 + .../ar71xx/files/arch/mips/ath79/mach-rbspi.c | 37 +- .../mips/ath79/mach-sgr-w500-ebi-fit-v3.c | 116 -- .../arch/mips/ath79/mach-sgr-w500-n85b-v2.c | 134 -- .../arch/mips/ath79/mach-tl-wa901nd-v4.c | 5 +- .../arch/mips/ath79/mach-tl-wdr6500-v6.c | 140 -- .../arch/mips/ath79/mach-tl-wr1043nd-v4.c | 82 ++ .../files/arch/mips/ath79/mach-tl-wr802n-v2.c | 97 -- .../files/arch/mips/ath79/mach-tl-wr802n.c | 85 +- .../files/arch/mips/ath79/mach-tl-wr810n.c | 40 +- .../files/arch/mips/ath79/mach-tl-wr841n-v9.c | 104 +- .../files/arch/mips/ath79/mach-tl-wr882n-v1.c | 126 -- .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 ---- .../arch/mips/ath79/mach-wzr-hp-ag300h.c | 3 - .../ar71xx/files/arch/mips/ath79/machtypes.h | 13 +- .../include/asm/mach-ath79/ag71xx_platform.h | 2 +- .../files/drivers/gpio/gpio-nxp-74hc153.c | 12 - .../net/ethernet/atheros/ag71xx/ag71xx.h | 7 +- .../net/ethernet/atheros/ag71xx/ag71xx_main.c | 23 +- .../ar71xx/files/drivers/spi/spi-rb4xx.c | 4 +- target/linux/ar71xx/generic/config-default | 201 +++ target/linux/ar71xx/image/Makefile | 12 +- target/linux/ar71xx/image/common-tp-link.mk | 95 ++ ...y-devices.mk => generic-legacy-devices.mk} | 179 --- .../image/{senao.mk => generic-senao.mk} | 0 target/linux/ar71xx/image/generic-tp-link.mk | 470 +++++++ .../ar71xx/image/{ubnt.mk => generic-ubnt.mk} | 25 +- target/linux/ar71xx/image/generic.mk | 65 +- target/linux/ar71xx/image/legacy.mk | 88 +- .../ar71xx/image/lzma-loader/src/Makefile | 2 +- target/linux/ar71xx/image/mikrotik.mk | 19 +- .../linux/ar71xx/image/tiny-legacy-devices.mk | 154 +++ target/linux/ar71xx/image/tiny-tp-link.mk | 684 ++++++++++ target/linux/ar71xx/image/tp-link.mk | 1175 ----------------- target/linux/ar71xx/mikrotik/config-default | 238 +--- target/linux/ar71xx/nand/config-default | 228 +--- .../423-dsa-add-88e6063-driver.patch | 3 +- ...MIPS-ath79-add-routerboard-detection.patch | 4 +- ...h79-fixup-routerboot-board-parameter.patch | 43 + .../900-mdio_bitbang_ignore_ta_value.patch | 9 + ...-prevent-rescheduling-during-command.patch | 6 +- .../423-dsa-add-88e6063-driver.patch | 3 +- ...x164-improve-platform-device-support.patch | 22 +- .../461-spi-ath79-add-fast-flash-read.patch | 16 +- .../patches-4.9/500-MIPS-fw-myloader.patch | 2 +- .../patches-4.9/604-MIPS-ath79-no-of.patch | 70 + ...PS-ath79-add-support-for-QCA953x-SoC.patch | 4 +- ...PS-ath79-add-support-for-QCA956x-SoC.patch | 4 +- ...MIPS-ath79-add-routerboard-detection.patch | 4 +- ...h79-fixup-routerboot-board-parameter.patch | 43 + target/linux/ar71xx/tiny/config-default | 72 + .../linux/ar71xx/tiny/profiles/00-default.mk | 11 + target/linux/ar71xx/tiny/target.mk | 8 + 83 files changed, 3105 insertions(+), 4316 deletions(-) delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c delete mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c delete mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c delete mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c create mode 100644 target/linux/ar71xx/image/common-tp-link.mk rename target/linux/ar71xx/image/{legacy-devices.mk => generic-legacy-devices.mk} (73%) rename target/linux/ar71xx/image/{senao.mk => generic-senao.mk} (100%) create mode 100644 target/linux/ar71xx/image/generic-tp-link.mk rename target/linux/ar71xx/image/{ubnt.mk => generic-ubnt.mk} (91%) create mode 100644 target/linux/ar71xx/image/tiny-legacy-devices.mk create mode 100644 target/linux/ar71xx/image/tiny-tp-link.mk delete mode 100644 target/linux/ar71xx/image/tp-link.mk create mode 100644 target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch create mode 100644 target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch create mode 100644 target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch create mode 100644 target/linux/ar71xx/tiny/config-default create mode 100644 target/linux/ar71xx/tiny/profiles/00-default.mk create mode 100644 target/linux/ar71xx/tiny/target.mk diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 678323efa..078755df6 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -62,7 +62,7 @@ config KERNEL_PROFILING config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" - default y if !SMALL_FLASH + default n help This will give you more information in stack traces from kernel oopses. diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 6d5b4c52b..1c66d7e76 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -11,9 +11,9 @@ BOARD:=ar71xx BOARDNAME:=Atheros AR7xxx/AR9xxx FEATURES:=usbgadget CPU_TYPE:=24kc -SUBTARGETS:=generic nand mikrotik +SUBTARGETS:=generic tiny nand mikrotik -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.4 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index a811d8faf..e5baa90db 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -137,11 +137,11 @@ bsb) ucidef_set_led_default "sys" "SYS" "$board:red:sys" "1" ;; bullet-m|\ +loco-m-xw|\ nanostation-m|\ -rocket-m|\ -rocket-m-xw|\ nanostation-m-xw|\ -loco-m-xw) +rocket-m|\ +rocket-m-xw) ucidef_set_led_rssi "rssilow" "RSSILOW" "ubnt:red:link1" "wlan0" "1" "100" "0" "13" ucidef_set_led_rssi "rssimediumlow" "RSSIMEDIUMLOW" "ubnt:orange:link2" "wlan0" "26" "100" "-25" "13" ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "ubnt:green:link3" "wlan0" "51" "100" "-50" "13" @@ -302,8 +302,8 @@ rb-962uigs-5hact2hnt) rb-2011il|\ rb-2011l|\ rb-2011uas|\ -rb-2011uias|\ rb-2011uas-2hnd|\ +rb-2011uias|\ rb-2011uias-2hnd) ucidef_set_led_switch "eth6" "ETH6" "rb:green:eth6" "switch1" "0x20" ucidef_set_led_switch "eth7" "ETH7" "rb:green:eth7" "switch1" "0x10" @@ -320,11 +320,21 @@ rb-lhg-5nd) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "rb:green:rssi3" "wlan0" "60" "100" "-59" "13" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "rb:green:rssi4" "wlan0" "80" "100" "-79" "13" ;; +rb-map-2nd) + ucidef_set_led_switch "eth1" "WAN" "rb:green:eth1" "switch0" "0x02" + ucidef_set_led_switch "eth2" "LAN" "rb:green:eth2" "switch0" "0x04" + ucidef_set_led_gpio "poe" "POE" "rb:red:poe_out" "14" "0" + ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" + ;; rb-mapl-2nd) ucidef_set_led_default "power" "POWER" "rb:green:power" "1" ucidef_set_led_netdev "lan" "LAN" "rb:green:eth" "eth0" ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" ;; +rb-wap-2nd) + ucidef_set_led_timer "user" "USER" "rb:green:user" "1000" "1000" + ucidef_set_led_wlan "wlan" "WLAN" "rb:green:wlan" "phy0tpt" + ;; dap-2695-a1) ucidef_set_led_default "power" "POWER" "d-link:green:power" "1" ucidef_set_led_default "diag" "DIAG" "d-link:red:power" "0" @@ -387,7 +397,11 @@ gl-mifi) ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1" ucidef_set_led_netdev "3gnet" "3GNET" "$board:green:net" "3g-wan" ;; -gl-ar150|\ +gl-ar150) + ucidef_set_led_wlan "wlan" "WLAN" "$board:orange:wlan" "phy0tpt" + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0" + ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth1" + ;; gl-ar300) ucidef_set_led_wlan "wlan" "WLAN" "$board:wlan" "phy0tpt" ;; @@ -420,14 +434,6 @@ hornet-ub-x2) ucidef_set_led_wlan "wlan" "WLAN" "alfa:blue:wlan" "phy0tpt" ucidef_set_led_usbdev "usb" "USB" "alfa:blue:usb" "1-1" ;; -maselink-ap2600i) - ucidef_set_led_netdev "wan" "WAN" "ap2600i:green:run" "eth0" - ucidef_set_led_wlan "wlan" "WLAN" "ap2600i:green:wlan" "phy0tpt" - ;; -maselink-ap2600ifm) - ucidef_set_led_wlan "wlan1" "WLAN1" "ap2600ifm:green:rf1" "phy0tpt" - ucidef_set_led_wlan "wlan2" "WLAN2" "ap2600ifm:green:rf2" "phy1tpt" - ;; mc-mac1200r) ucidef_set_led_wlan "wlan2g" "WLAN2G" "mercury:green:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN5G" "mercury:green:wlan5g" "phy0tpt" @@ -471,13 +477,6 @@ mr900v2) ucidef_set_led_default "status-red" "Status (red)" "mr900:red:wifi" "0" ucidef_set_led_default "status-green" "Status (green)" "mr900:green:wifi" "0" ;; -mw316r-v1) - ucidef_set_led_netdev "wan" "WAN" "mercury:green:wan" "eth0" - ucidef_set_led_switch "lan1" "LAN1" "mercury:green:lan1" "switch0" "0x02" - ucidef_set_led_switch "lan2" "LAN2" "mercury:green:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "LAN3" "mercury:green:lan3" "switch0" "0x08" - ucidef_set_led_switch "lan4" "LAN4" "mercury:green:lan4" "switch0" "0x10" - ;; mynet-n600) ucidef_set_led_netdev "wan" "WAN" "wd:blue:internet" "eth1" ucidef_set_led_switch "lan1" "LAN1" "wd:green:lan1" "switch0" "0x02" @@ -516,13 +515,13 @@ nbg6716) ucidef_set_led_usbdev "usb2" "USB2" "$board:white:usb2" "2-1" ;; om2p|\ -om2pv2|\ -om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ -om2p-lc) +om2p-lc|\ +om2pv2|\ +om2pv4) ucidef_set_led_netdev "port1" "port1" "om2p:blue:wan" "eth0" ucidef_set_led_netdev "port2" "port2" "om2p:blue:lan" "eth1" ucidef_set_led_default "wlan-red" "WLAN (red)" "om2p:red:wifi" "0" @@ -580,13 +579,6 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; -sgr-w500-ebi-fit-v3) - ucidef_set_led_netdev "wan" "WAN" "grentech:green:wan" "eth0" - ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan" "phy0tpt" - ;; -sgr-w500-n85b-v2) - ucidef_set_led_wlan "wlan" "WLAN" "grentech:green:wlan2g" "phy0tpt" - ;; smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" @@ -662,8 +654,8 @@ tl-wr941nd-v5) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" case "$board" in - tl-wr842n-v2|\ - tl-mr3420-v2) + tl-mr3420-v2|\ + tl-wr842n-v2) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" ;; esac @@ -708,11 +700,12 @@ tl-wa850re-v2) ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "tp-link:blue:signal5" "wlan0" "80" "100" "-79" "13" ;; tl-wa701nd-v2|\ -tl-wa860re|\ -tl-wa830re-v2|\ tl-wa801nd-v2|\ +tl-wa830re-v2|\ +tl-wa860re|\ tl-wa901nd-v3|\ -tl-wa901nd-v4) +tl-wa901nd-v4|\ +tl-wa901nd-v5) ucidef_set_led_netdev "lan" "LAN" "tp-link:green:lan" "eth0" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; @@ -721,7 +714,6 @@ tl-wa901nd) ;; tl-wa901nd-v2|\ tl-wr941nd|\ -tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; @@ -744,7 +736,6 @@ tl-wdr4900-v2) ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy1tpt" ;; tl-wdr6500-v2|\ -tl-wdr6500-v6|\ tl-wr741nd) ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02" @@ -767,7 +758,6 @@ tl-wpa8630) tl-wr740n-v6|\ tl-wr841n-v9|\ tl-wr841n-v11|\ -tl-wr842n-v9|\ tl-wr842n-v3) ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" @@ -777,7 +767,6 @@ tl-wr842n-v3) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" case "$board" in - tl-wr842n-v9|\ tl-wr842n-v3) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1" ;; @@ -824,26 +813,25 @@ tl-wr1043nd-v2) ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; +tl-wr1043n-v5|\ tl-wr1043nd-v4) - ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ucidef_set_led_switch "wan" "WAN" "tp-link:green:wan" "switch0" "0x20" ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" + + case "$board" in + tl-wr1043nd-v4) + ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" + ;; + esac ;; tl-wr2543n) ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:green:wlan2g" "phy0tpt" ucidef_set_led_usbdev "usb" "USB" "tp-link:green:usb" "1-1" ;; -tl-wr882n-v1) - ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1" - ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x10" - ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x08" - ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x04" - ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x02" - ;; tube2h) ucidef_set_led_netdev "lan" "LAN" "alfa:blue:lan" "eth0" ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 7d47173ff..fb61792bf 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -49,8 +49,6 @@ ar71xx_setup_interfaces() tl-wr841n-v11|\ tl-wr841n-v9|\ tl-wr842n-v3|\ - tl-wr842n-v9|\ - tl-wr882n-v1|\ whr-g301n|\ whr-hp-g300n|\ whr-hp-gn|\ @@ -72,6 +70,7 @@ ar71xx_setup_interfaces() cap4200ag|\ cf-e380ac-v1|\ cf-e380ac-v2|\ + dr342|\ eap120|\ eap300v2|\ eap7660d|\ @@ -98,10 +97,12 @@ ar71xx_setup_interfaces() rb-911g-5hpnd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-lhg-5nd|\ rb-mapl-2nd|\ rb-sxt2n|\ rb-sxt5n|\ + rb-wap-2nd|\ re450|\ rocket-m-xw|\ sc300m |\ @@ -124,18 +125,16 @@ ar71xx_setup_interfaces() tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ + tl-wa901nd-v5|\ tl-wr703n|\ tl-wr802n-v1|\ tl-wr802n-v2|\ tl-wr902ac-v1|\ tube2h|\ + unifi|\ unifiac-lite|\ wi2a-ac200i|\ wndap360|\ - sgr-w500-n85b-v2|\ - sgr-w500-ebi-fit-v3|\ - maselink-ap2600i|\ - maselink-ap2600ifm|\ wp543) ucidef_set_interface_lan "eth0" ;; @@ -151,29 +150,25 @@ ar71xx_setup_interfaces() gl-inet|\ gl-mifi|\ jwap003|\ - om2pv4|\ om2p-hsv4|\ + om2pv4|\ pb42|\ pb44|\ rb-951ui-2hnd|\ - rb-951ui-2nd|\ rb-952ui-5ac2nd|\ routerstation|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr810n|\ + tl-wr810n-v2|\ wpe72|\ wrtnode2q) ucidef_set_interfaces_lan_wan "eth1" "eth0" ;; - mw316r-v1) - ucidef_set_interfaces_lan_wan "eth1" "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" - ;; rb-750-r2|\ rb-750p-pbr2|\ - rb-750up-r2) + rb-750up-r2|\ + rb-951ui-2nd) ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_add_switch "switch0" \ "0@eth1" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" @@ -182,6 +177,7 @@ ar71xx_setup_interfaces() all0315n|\ dlan-hotspot|\ dlan-pro-500-wp|\ + ens202ext|\ ja76pf2|\ rocket-m-ti|\ ubnt-unifi-outdoor) @@ -283,7 +279,8 @@ ar71xx_setup_interfaces() dir-835-a1|\ esr900|\ mynet-n750|\ - sr3200) + sr3200|\ + tl-wr1043n-v5) ucidef_add_switch "switch0" \ "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" ;; @@ -322,7 +319,6 @@ ar71xx_setup_interfaces() r6100|\ smart-300|\ tl-wdr6500-v2|\ - tl-wdr6500-v6|\ tl-wr940n-v4|\ tl-wr941nd-v6|\ wnr1000-v2|\ @@ -423,9 +419,13 @@ ar71xx_setup_interfaces() rb-493g) ucidef_set_interfaces_lan_wan "eth0.1 eth1.1" "eth1.2" ucidef_add_switch "switch0" \ - "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan" + "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ucidef_add_switch "switch1" \ - "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" + "0@eth1" "1:lan:4" "2:lan:1" "3:lan:3" "4:lan:2" "5:wan" + ;; + rb-map-2nd) + ucidef_add_switch "switch0" \ + "0@eth0" "1:wan" "2:lan" ;; tellstick-znet-lite) ucidef_set_interface_wan "eth0" @@ -442,7 +442,6 @@ ar71xx_setup_interfaces() ;; archer-c7-v4|\ tl-wdr4300|\ - tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" @@ -546,6 +545,7 @@ ar71xx_setup_macs() fritz300e) lan_mac=$(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)")) ;; + tl-wr1043n-v5|\ tl-wr1043nd-v4) lan_mac=$(mtd_get_mac_binary product-info 8) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index d64493c5a..6cbb3576d 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -23,6 +23,7 @@ get_status_led() { antminer-s1|\ antminer-s3|\ antminer-r1|\ + eap120|\ minibox-v1|\ som9331|\ sr3200|\ @@ -37,6 +38,7 @@ get_status_led() { ap531b0|\ cpe505n|\ db120|\ + dr342|\ dr344|\ tew-632brp|\ tl-wr942n-v1|\ @@ -73,9 +75,9 @@ get_status_led() { ap90q|\ cpe830|\ cpe870|\ + gl-ar300m|\ gl-inet|\ - gl-mifi|\ - gl-ar300m) + gl-mifi) status_led="$board:green:lan" ;; ap96) @@ -93,12 +95,12 @@ get_status_led() { status_led="$board:red:sys" ;; bullet-m|\ - rocket-m|\ - rocket-m-xw|\ + loco-m-xw|\ nano-m|\ nanostation-m|\ nanostation-m-xw|\ - loco-m-xw) + rocket-m|\ + rocket-m-xw) status_led="ubnt:green:link4" ;; rocket-m-ti) @@ -132,9 +134,7 @@ get_status_led() { cpe510) status_led="tp-link:green:link4" ;; - cr3000) - status_led="pcs:amber:power" - ;; + cr3000|\ cr5000) status_led="pcs:amber:power" ;; @@ -179,20 +179,18 @@ get_status_led() { dw33d) status_led="$board:blue:status" ;; - eap120) - status_led="$board:green:system" - ;; eap300v2) status_led="engenius:blue:power" ;; - ens202ext) + ens202ext|\ + esr900) status_led="engenius:amber:power" ;; eap7660d) status_led="$board:green:ds4" ;; - el-mini|\ - el-m150) + el-m150|\ + el-mini) status_led="easylink:green:system" ;; ew-dorin|\ @@ -206,9 +204,6 @@ get_status_led() { esr1750) status_led="$board:amber:power" ;; - esr900) - status_led="engenius:amber:power" - ;; hiveap-121|\ nbg6716) status_led="$board:white:power" @@ -230,13 +225,6 @@ get_status_led() { ls-sr71) status_led="ubnt:green:d22" ;; - maselink-ap2600i) - status_led="ap2600i:green:power" - ;; - maselink-ap2600ifm) - status_led="ap2600ifm:green:power" - ;; - mw316r-v1|\ mc-mac1200r) status_led="mercury:green:system" ;; @@ -259,9 +247,7 @@ get_status_led() { status_led="mr900:blue:power" ;; mynet-n600|\ - mynet-n750) - status_led="wd:blue:power" - ;; + mynet-n750|\ mynet-rext) status_led="wd:blue:power" ;; @@ -273,13 +259,13 @@ get_status_led() { status_led="nbg460n:green:power" ;; om2p|\ - om2pv2|\ - om2pv4|\ om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-lc) + om2p-lc|\ + om2pv2|\ + om2pv4) status_led="om2p:blue:power" ;; om5p|\ @@ -334,6 +320,7 @@ get_status_led() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ + rb-map-2nd|\ rb-mapl-2nd) status_led="rb:green:user" ;; @@ -357,12 +344,6 @@ get_status_led() { rw2458n) status_led="$board:green:d3" ;; - sgr-w500-n85b-v2) - status_led="grentech:green:status" - ;; - sgr-w500-ebi-fit-v3) - status_led="grentech:green:status" - ;; smart-300) status_led="nc-link:green:system" ;; @@ -380,7 +361,8 @@ get_status_led() { tew-823dru) status_led="trendnet:green:power" ;; - tl-mr3020) + tl-mr3020|\ + tl-wr2543n) status_led="tp-link:green:wps" ;; tl-wa750re) @@ -403,47 +385,48 @@ get_status_led() { tl-mr3420-v2|\ tl-wa701nd-v2|\ tl-wa801nd-v2|\ + tl-wa801nd-v3|\ + tl-wa830re-v2|\ tl-wa901nd|\ tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ + tl-wa901nd-v5|\ tl-wdr3320-v2|\ tl-wdr3500|\ tl-wr1041n-v2|\ + tl-wr1043n-v5|\ tl-wr1043nd|\ tl-wr1043nd-v2|\ tl-wr1043nd-v4|\ tl-wr740n-v6|\ tl-wr741nd|\ tl-wr741nd-v4|\ - tl-wa801nd-v3|\ tl-wr840n-v2|\ tl-wr840n-v3|\ tl-wr841n-v1|\ tl-wr841n-v7|\ tl-wr841n-v8|\ tl-wr841n-v11|\ - tl-wa830re-v2|\ tl-wr842n-v2|\ tl-wr842n-v3|\ - tl-wr842n-v9|\ tl-wr941nd|\ - tl-wr941n-v7|\ tl-wr941nd-v5) status_led="tp-link:green:system" ;; archer-c5|\ archer-c7|\ - tl-wdr4900-v2|\ tl-mr10u|\ tl-mr12u|\ tl-mr13u|\ tl-wdr4300|\ + tl-wdr4900-v2|\ tl-wr703n|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr802n-v1|\ tl-wr810n|\ + tl-wr810n-v2|\ tl-wr940n-v4|\ tl-wr941nd-v6) status_led="tp-link:blue:system" @@ -451,13 +434,6 @@ get_status_led() { tl-wr841n-v9) status_led="tp-link:green:qss" ;; - tl-wr882n-v1) - status_led="tp-link:white:status" - ;; - tl-wr2543n) - status_led="tp-link:green:wps" - ;; - tl-wdr6500-v6|\ tl-wdr6500-v2) status_led="tp-link:white:system" ;; @@ -515,8 +491,8 @@ get_status_led() { wpj563) status_led="$board:green:sig1" ;; - wrt400n|\ - wrt160nl) + wrt160nl|\ + wrt400n) status_led="$board:blue:wps" ;; zcn-1523h-2|\ diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 757c231f0..bc8972c2c 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -54,14 +54,15 @@ case "$FIRMWARE" in ath10kcal_extract "ART" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; - archer-c7-v4|\ archer-c25-v1|\ - archer-c59-v1|\ - archer-c60-v1|\ tl-wdr6500-v2) ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -2) ;; + archer-c7-v4) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1) + ;; cf-e355ac|\ cf-e380ac-v1|\ cf-e380ac-v2|\ @@ -134,6 +135,7 @@ case "$FIRMWARE" in ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16) ;; rb-911g-5hpacd|\ + rb-921gs-5hpacd-r2|\ rb-962uigs-5hact2hnt) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; @@ -141,11 +143,10 @@ case "$FIRMWARE" in ;; "ath10k/pre-cal-pci-0000:00:00.0.bin") case $board in - archer-c58-v1) + archer-c58-v1|\ + archer-c59-v1|\ + archer-c60-v1) ath10kcal_extract "art" 20480 12064 - ;; - tl-wdr6500-v6) - ath10kcal_extract "art" 8192 12064 ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 1db791d0c..0530d595a 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -12,12 +12,11 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case "$board" in - archer-c58-v1) + archer-c58-v1|\ + archer-c59-v1|\ + archer-c60-v1) echo $(macaddr_add $(mtd_get_mac_binary mac 8) $(($PHYNBR - 1)) ) > /sys${DEVPATH}/macaddress ;; - tl-wdr6500-v6) - echo $(macaddr_add $(mtd_get_mac_binary art 2061) $(($PHYNBR - 2)) ) > /sys${DEVPATH}/macaddress - ;; *) ;; esac diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration index 338a22297..29fdde40a 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/03_network-switchX-migration @@ -43,20 +43,18 @@ migrate_switch_name() { board=$(board_name) case "$board" in -dir-825-c1|\ -wzr-hp-g300nh2|\ -tl-wdr4300|\ -tl-wr1041n-v2|\ -wrt160nl|\ +airrouter|\ ap121|\ ap121-mini|\ ap96|\ -airrouter|\ dir-600-a1|\ dir-615-c1|\ dir-615-e1|\ dir-615-e4|\ +dir-825-c1|\ ebr-2310-c1|\ +ew-dorin|\ +ew-dorin-router|\ ja76pf|\ rb-750|\ rb-751|\ @@ -65,17 +63,19 @@ tew-712br|\ tl-mr3220|\ tl-mr3220-v2 |\ tl-mr3420|\ +tl-wdr4300|\ tl-wr741nd|\ tl-wr741nd-v4|\ tl-wr841n-v7|\ +tl-wr1041n-v2|\ whr-g301n|\ whr-hp-g300n|\ whr-hp-gn|\ +wrt160nl|\ wzr-hp-ag300h|\ +wzr-hp-g300nh2|\ wzr-hp-g450h|\ -z1|\ -ew-dorin|\ -ew-dorin-router) +z1) migrate_switch_name "eth0" "switch0" ;; @@ -93,8 +93,8 @@ rb-2011uas-2hnd) ;; dir-825-b1|\ -tew-673gru|\ -nbg460n_550n_550nh) +nbg460n_550n_550nh|\ +tew-673gru) migrate_switch_name "rtl8366s" "switch0" ;; diff --git a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration index d6f707709..05d806051 100644 --- a/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration +++ b/target/linux/ar71xx/base-files/etc/uci-defaults/04_led_migration @@ -54,6 +54,10 @@ dr344) migrate_leds ":red:=:green:" ":yellow:=:green:" ;; +gl-ar150) + migrate_leds "gl-ar150:wlan=gl-ar150:orange:wlan" "gl-ar150:lan=gl-ar150:green:lan" "gl-ar150:wan=gl-ar150:green:wan" + ;; + wndap360) migrate_leds "wndap360:=netgear:" ;; diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index 1c252ac27..b5440230a 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,12 +263,6 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; - "031600"*) - model="Mercury MW316R" - ;; - "204100"*) - model="TP-Link TL-WR2041N" - ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -324,9 +318,6 @@ tplink_board_detect() { "65000002") model="TP-Link TL-WDR6500" ;; - "65000006") - model="TP-Link TL-WDR6500" - ;; "721000"*) model="TP-Link TL-WA7210N" ;; @@ -612,6 +603,9 @@ ar71xx_board_detect() { *"Domino Pi") name="gl-domino" ;; + *"DR342") + name="dr342" + ;; *"DR344") name="dr344" ;; @@ -726,15 +720,6 @@ ar71xx_board_detect() { *"MAC1200R") name="mc-mac1200r" ;; - *"MW316R v1") - name="mw316r-v1" - ;; - *"MASELink AP2600-I") - name="maselink-ap2600i" - ;; - *"MASELink AP2600-IFM") - name="maselink-ap2600ifm" - ;; *"MiniBox V1.0") name="minibox-v1" ;; @@ -959,6 +944,9 @@ ar71xx_board_detect() { *"RouterBOARD 912UAG-5HPnD") name="rb-912uag-5hpnd" ;; + *"RouterBOARD 921GS-5HPacD r2") + name="rb-921gs-5hpacd-r2" + ;; *"RouterBOARD 941-2nD") name="rb-941-2nd" ;; @@ -980,6 +968,9 @@ ar71xx_board_detect() { *"RouterBOARD LHG 5nD") name="rb-lhg-5nd" ;; + *"RouterBOARD mAP 2nD") + name="rb-map-2nd" + ;; *"RouterBOARD mAP L-2nD") name="rb-mapl-2nd" ;; @@ -989,6 +980,9 @@ ar71xx_board_detect() { *"RouterBOARD SXT Lite5") name="rb-sxt5n" ;; + *"RouterBOARD wAP 2nD r2") + name="rb-wap-2nd" + ;; *"RouterStation") name="routerstation" ;; @@ -1007,12 +1001,6 @@ ar71xx_board_detect() { *"SC450") name="sc450" ;; - "GRENTECH SGR-W500-N85b v2.0") - name="sgr-w500-n85b-v2" - ;; - "GRENTECH SGR-W500-EBI(FIT) v3.0") - name="sgr-w500-ebi-fit-v3" - ;; *"SMART-300") name="smart-300" ;; @@ -1073,7 +1061,7 @@ ar71xx_board_detect() { *"TL-MR3420 v2") name="tl-mr3420-v2" ;; - *TL-MR6400) + *"TL-MR6400") name="tl-mr6400" ;; *"TL-WA701ND v2") @@ -1121,6 +1109,9 @@ ar71xx_board_detect() { *"TL-WA901ND v4") name="tl-wa901nd-v4" ;; + *"TL-WA901ND v5") + name="tl-wa901nd-v5" + ;; *"TL-WDR3320 v2") name="tl-wdr3320-v2" ;; @@ -1136,15 +1127,15 @@ ar71xx_board_detect() { *"TL-WDR6500 v2") name="tl-wdr6500-v2" ;; - *"TL-WDR6500 v6") - name="tl-wdr6500-v6" - ;; *"TL-WPA8630") name="tl-wpa8630" ;; *"TL-WR1041N v2") name="tl-wr1041n-v2" ;; + *"TL-WR1043N v5") + name="tl-wr1043n-v5" + ;; *"TL-WR1043ND") name="tl-wr1043nd" ;; @@ -1154,12 +1145,6 @@ ar71xx_board_detect() { *"TL-WR1043ND v4") name="tl-wr1043nd-v4" ;; - *"TL-WR2041N v1") - name="tl-wr2041n-v1" - ;; - *"TL-WR2041N v2") - name="tl-wr2041n-v2" - ;; *"TL-WR2543N"*) name="tl-wr2543n" ;; @@ -1190,6 +1175,9 @@ ar71xx_board_detect() { *"TL-WR810N") name="tl-wr810n" ;; + *"TL-WR810N v2") + name="tl-wr810n-v2" + ;; *"TL-WR840N v2") name="tl-wr840n-v2" ;; @@ -1217,12 +1205,6 @@ ar71xx_board_detect() { *"TL-WR842N/ND v3") name="tl-wr842n-v3" ;; - *"TL-WR842N/ND v9") - name="tl-wr842n-v9" - ;; - *"TL-WR882N v1") - name="tl-wr882n-v1" - ;; *"TL-WR902AC v1") name="tl-wr902ac-v1" ;; @@ -1235,9 +1217,6 @@ ar71xx_board_detect() { *"TL-WR941N/ND v6") name="tl-wr941nd-v6" ;; - *"TL-WR941N v7") - name="tl-wr941n-v7" - ;; *"TL-WR941ND") name="tl-wr941nd" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx index 3a98cdccf..4b2fb6c41 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx @@ -36,8 +36,8 @@ set_preinit_iface() { tl-wr720n-v3 |\ tl-wr841n-v8 |\ tl-wr842n-v2 |\ - tl-wr941nd-v6 |\ tl-wr940n-v4 |\ + tl-wr941nd-v6 |\ wnr2000-v3 |\ wnr2200 |\ wnr612-v2 |\ diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index cb428a264..ecf6820a2 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -183,15 +183,6 @@ alfa_check_image() { return 0 } -platform_nand_board_name() { - local board=$(board_name) - - case "$board" in - rb*) echo "routerboard";; - *) echo "$board";; - esac -} - platform_check_image() { local board=$(board_name) local magic="$(get_magic_word "$1")" @@ -200,8 +191,8 @@ platform_check_image() { [ "$#" -gt 1 ] && return 1 case "$board" in - airgatewaypro|\ airgateway|\ + airgatewaypro|\ airrouter|\ ap121f|\ ap132|\ @@ -238,6 +229,7 @@ platform_check_image() { dlan-hotspot|\ dlan-pro-1200-ac|\ dlan-pro-500-wp|\ + dr342|\ dr531|\ dragino2|\ ebr-2310-c1|\ @@ -245,8 +237,8 @@ platform_check_image() { epg5000|\ esr1750|\ esr900|\ - ew-dorin-router|\ ew-dorin|\ + ew-dorin-router|\ gl-ar150|\ gl-ar300m|\ gl-ar300|\ @@ -260,14 +252,14 @@ platform_check_image() { loco-m-xw|\ mzk-w04nu|\ mzk-w300nh|\ - nanostation-m-xw|\ nanostation-m|\ + nanostation-m-xw|\ nbg460n_550n_550nh|\ pqi-air-pen|\ r602n|\ + rocket-m|\ rocket-m-ti|\ rocket-m-xw|\ - rocket-m|\ rw2458n|\ sc1750|\ sc300m|\ @@ -277,11 +269,12 @@ platform_check_image() { tew-712br|\ tew-732br|\ tew-823dru|\ + tl-wr1043n-v5|\ tl-wr942n-v1|\ + unifi|\ unifi-outdoor|\ unifiac-lite|\ unifiac-pro|\ - unifi|\ weio|\ whr-g301n|\ whr-hp-g300n|\ @@ -297,8 +290,8 @@ platform_check_image() { wrtnode2q|\ wzr-450hp2|\ wzr-hp-ag300h|\ - wzr-hp-g300nh2|\ wzr-hp-g300nh|\ + wzr-hp-g300nh2|\ wzr-hp-g450h|\ xd3200) [ "$magic" != "2705" ] && { @@ -310,8 +303,8 @@ platform_check_image() { ;; alfa-ap96|\ alfa-nx|\ - ap121-mini|\ ap121|\ + ap121-mini|\ ap135-020|\ ap136-010|\ ap136-020|\ @@ -326,12 +319,8 @@ platform_check_image() { dw33d|\ f9k1115v2|\ hornet-ub|\ - maselink-ap2600i|\ - maselink-ap2600ifm|\ mr12|\ mr16|\ - sgr-w500-n85b-v2|\ - sgr-w500-ebi-fit-v3|\ zbt-we1526|\ zcn-1523h-2|\ zcn-1523h-5) @@ -354,14 +343,14 @@ platform_check_image() { all0305|\ eap300v2|\ eap7660d|\ - ja76pf2|\ ja76pf|\ + ja76pf2|\ jwap003|\ ls-sr71|\ pb42|\ pb44|\ - routerstation-pro|\ routerstation|\ + routerstation-pro|\ wp543|\ wpe72) [ "$magic" != "4349" ] && { @@ -390,7 +379,6 @@ platform_check_image() { el-mini|\ gl-inet|\ mc-mac1200r|\ - mw316r-v1|\ minibox-v1|\ omy-g1|\ omy-x1|\ @@ -405,12 +393,12 @@ platform_check_image() { tl-mr12u|\ tl-mr13u|\ tl-mr3020|\ - tl-mr3040-v2|\ tl-mr3040|\ - tl-mr3220-v2|\ + tl-mr3040-v2|\ tl-mr3220|\ - tl-mr3420-v2|\ + tl-mr3220-v2|\ tl-mr3420|\ + tl-mr3420-v2|\ tl-mr6400|\ tl-wa701nd-v2|\ tl-wa7210n-v2|\ @@ -423,53 +411,49 @@ platform_check_image() { tl-wa850re-v2|\ tl-wa855re-v1|\ tl-wa860re|\ + tl-wa901nd|\ tl-wa901nd-v2|\ tl-wa901nd-v3|\ tl-wa901nd-v4|\ - tl-wa901nd|\ + tl-wa901nd-v5|\ tl-wdr3320-v2|\ tl-wdr3500|\ tl-wdr4300|\ tl-wdr4900-v2|\ tl-wdr6500-v2|\ - tl-wdr6500-v6|\ tl-wpa8630|\ tl-wr1041n-v2|\ + tl-wr1043nd|\ tl-wr1043nd-v2|\ tl-wr1043nd-v4|\ - tl-wr1043nd|\ tl-wr2543n|\ tl-wr703n|\ tl-wr710n|\ tl-wr720n-v3|\ tl-wr740n-v6|\ - tl-wr741nd-v4|\ tl-wr741nd|\ + tl-wr741nd-v4|\ tl-wr802n-v1|\ tl-wr802n-v2|\ tl-wr810n|\ + tl-wr810n-v2|\ tl-wr840n-v2|\ tl-wr840n-v3|\ - tl-wr841n-v11|\ tl-wr841n-v1|\ tl-wr841n-v7|\ tl-wr841n-v8|\ tl-wr841n-v9|\ + tl-wr841n-v11|\ tl-wr842n-v2|\ tl-wr842n-v3|\ - tl-wr842n-v9|\ - tl-wr882n-v1|\ tl-wr902ac-v1|\ - tl-wr941nd-v5|\ - tl-wr941nd-v6|\ - tl-wr941n-v7|\ tl-wr940n-v4|\ - tl-wr941nd) + tl-wr941nd|\ + tl-wr941nd-v5|\ + tl-wr941nd-v6) local magic_ver="0100" case "$board" in - tl-wdr6500-v6|\ - tl-wdr3320-v2|\ tl-wdr6500-v2) magic_ver="0200" ;; @@ -528,13 +512,14 @@ platform_check_image() { rb-911g-5hpacd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-951g-2hnd|\ rb-951ui-2hnd|\ rb-2011l|\ rb-2011il|\ rb-2011uas|\ - rb-2011uias|\ rb-2011uas-2hnd|\ + rb-2011uias|\ rb-2011uias-2hnd|\ rb-sxt2n|\ rb-sxt5n) @@ -562,24 +547,24 @@ platform_check_image() { ;; a40|\ a60|\ - mr1750v2|\ mr1750|\ - mr600v2|\ + mr1750v2|\ mr600|\ - mr900v2|\ + mr600v2|\ mr900|\ + mr900v2|\ + om2p|\ + om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-hs|\ om2p-lc|\ om2pv2|\ om2pv4|\ - om2p|\ - om5p-acv2|\ + om5p|\ om5p-ac|\ - om5p-an|\ - om5p) + om5p-acv2|\ + om5p-an) platform_check_image_openmesh "$magic_long" "$1" && return 0 return 1 ;; @@ -675,7 +660,9 @@ platform_check_image() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ - rb-mapl-2nd) + rb-map-2nd|\ + rb-mapl-2nd|\ + rb-wap-2nd) return 0 ;; esac @@ -707,17 +694,18 @@ platform_pre_upgrade() { rb-751|\ rb-751g|\ rb-911g-2hpnd|\ - rb-911g-5hpnd|\ rb-911g-5hpacd|\ + rb-911g-5hpnd|\ rb-912uag-2hpnd|\ rb-912uag-5hpnd|\ + rb-921gs-5hpacd-r2|\ rb-951g-2hnd|\ rb-951ui-2hnd|\ rb-2011il|\ rb-2011l|\ rb-2011uas|\ - rb-2011uias|\ rb-2011uas-2hnd|\ + rb-2011uias|\ rb-2011uias-2hnd|\ rb-sxt2n|\ rb-sxt5n|\ @@ -734,7 +722,9 @@ platform_pre_upgrade() { rb-952ui-5ac2nd|\ rb-962uigs-5hact2hnt|\ rb-lhg-5nd|\ - rb-mapl-2nd) + rb-map-2nd|\ + rb-mapl-2nd|\ + rb-wap-2nd) # erase firmware if booted from initramfs [ -z "$(rootfs_type)" ] && mtd erase firmware ;; @@ -786,14 +776,14 @@ platform_do_upgrade() { ;; all0305|\ eap7660d|\ - ja76pf2|\ ja76pf|\ + ja76pf2|\ jwap003|\ ls-sr71|\ pb42|\ pb44|\ - routerstation-pro|\ - routerstation) + routerstation|\ + routerstation-pro) platform_do_upgrade_combined "$ARGV" ;; all0315n) @@ -810,24 +800,24 @@ platform_do_upgrade() { ;; a40|\ a60|\ - mr1750v2|\ mr1750|\ - mr600v2|\ + mr1750v2|\ mr600|\ - mr900v2|\ + mr600v2|\ mr900|\ + mr900v2|\ + om2p|\ + om2p-hs|\ om2p-hsv2|\ om2p-hsv3|\ om2p-hsv4|\ - om2p-hs|\ om2p-lc|\ om2pv2|\ om2pv4|\ - om2p|\ - om5p-acv2|\ + om5p|\ om5p-ac|\ - om5p-an|\ - om5p) + om5p-acv2|\ + om5p-an) platform_do_upgrade_openmesh "$ARGV" ;; uap-pro|\ diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 824e84720..847836806 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -22,140 +22,136 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_AT803X_PHY=y CONFIG_ATH79=y -CONFIG_ATH79_DEV_AP9X_PCI=y -CONFIG_ATH79_DEV_DSA=y -CONFIG_ATH79_DEV_ETH=y -CONFIG_ATH79_DEV_GPIO_BUTTONS=y -CONFIG_ATH79_DEV_LEDS_GPIO=y -CONFIG_ATH79_DEV_M25P80=y -CONFIG_ATH79_DEV_NFC=y -CONFIG_ATH79_DEV_SPI=y -CONFIG_ATH79_DEV_USB=y -CONFIG_ATH79_DEV_WMAC=y -CONFIG_ATH79_MACH_A60=y -CONFIG_ATH79_MACH_ALFA_AP120C=y -CONFIG_ATH79_MACH_ALFA_AP96=y -CONFIG_ATH79_MACH_ALFA_NX=y -CONFIG_ATH79_MACH_ALL0258N=y -CONFIG_ATH79_MACH_ALL0315N=y -CONFIG_ATH79_MACH_ANTMINER_S1=y -CONFIG_ATH79_MACH_ANTMINER_S3=y -CONFIG_ATH79_MACH_ANTROUTER_R1=y -CONFIG_ATH79_MACH_AP121=y -CONFIG_ATH79_MACH_AP121F=y -CONFIG_ATH79_MACH_AP132=y -CONFIG_ATH79_MACH_AP136=y -CONFIG_ATH79_MACH_AP143=y -CONFIG_ATH79_MACH_AP147=y -CONFIG_ATH79_MACH_AP152=y -CONFIG_ATH79_MACH_AP531B0=y +# CONFIG_ATH79_DEV_AP9X_PCI is not set +# CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_DEV_ETH is not set +# CONFIG_ATH79_DEV_GPIO_BUTTONS is not set +# CONFIG_ATH79_DEV_LEDS_GPIO is not set +# CONFIG_ATH79_DEV_M25P80 is not set +# CONFIG_ATH79_DEV_SPI is not set +# CONFIG_ATH79_DEV_USB is not set +# CONFIG_ATH79_MACH_A60 is not set +# CONFIG_ATH79_MACH_ALFA_AP120C is not set +# CONFIG_ATH79_MACH_ALFA_AP96 is not set +# CONFIG_ATH79_MACH_ALFA_NX is not set +# CONFIG_ATH79_MACH_ALL0258N is not set +# CONFIG_ATH79_MACH_ALL0315N is not set +# CONFIG_ATH79_MACH_ANTMINER_S1 is not set +# CONFIG_ATH79_MACH_ANTMINER_S3 is not set +# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set +# CONFIG_ATH79_MACH_AP121 is not set +# CONFIG_ATH79_MACH_AP121F is not set +# CONFIG_ATH79_MACH_AP132 is not set +# CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP143 is not set +# CONFIG_ATH79_MACH_AP147 is not set +# CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set -CONFIG_ATH79_MACH_AP90Q=y -CONFIG_ATH79_MACH_AP96=y -CONFIG_ATH79_MACH_ARCHER_C25_V1=y -CONFIG_ATH79_MACH_ARCHER_C58_V1=y -CONFIG_ATH79_MACH_ARCHER_C59_V1=y -CONFIG_ATH79_MACH_ARCHER_C60_V1=y -CONFIG_ATH79_MACH_ARCHER_C7=y -CONFIG_ATH79_MACH_ARDUINO_YUN=y -CONFIG_ATH79_MACH_AW_NR580=y -CONFIG_ATH79_MACH_BHR_4GRV2=y -CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y -CONFIG_ATH79_MACH_BSB=y -CONFIG_ATH79_MACH_C55=y +# CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP96 is not set +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_ARDUINO_YUN is not set +# CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_BHR_4GRV2 is not set +# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set +# CONFIG_ATH79_MACH_BSB is not set +# CONFIG_ATH79_MACH_C55 is not set # CONFIG_ATH79_MACH_C60 is not set -CONFIG_ATH79_MACH_CAP324=y -CONFIG_ATH79_MACH_CAP4200AG=y -CONFIG_ATH79_MACH_CARAMBOLA2=y -CONFIG_ATH79_MACH_CF_E316N_V2=y -CONFIG_ATH79_MACH_CF_E320N_V2=y -CONFIG_ATH79_MACH_CF_E355AC=y -CONFIG_ATH79_MACH_CF_E380AC_V1=y -CONFIG_ATH79_MACH_CF_E380AC_V2=y -CONFIG_ATH79_MACH_CF_E520N=y -CONFIG_ATH79_MACH_CF_E530N=y -CONFIG_ATH79_MACH_CPE505N=y -CONFIG_ATH79_MACH_CPE510=y -CONFIG_ATH79_MACH_CPE830=y -CONFIG_ATH79_MACH_CPE870=y -CONFIG_ATH79_MACH_CR3000=y -CONFIG_ATH79_MACH_CR5000=y -CONFIG_ATH79_MACH_DAP_2695_A1=y -CONFIG_ATH79_MACH_DB120=y -CONFIG_ATH79_MACH_DGL_5500_A1=y -CONFIG_ATH79_MACH_DHP_1565_A1=y -CONFIG_ATH79_MACH_DIR_505_A1=y -CONFIG_ATH79_MACH_DIR_600_A1=y -CONFIG_ATH79_MACH_DIR_615_C1=y -CONFIG_ATH79_MACH_DIR_615_I1=y -CONFIG_ATH79_MACH_DIR_825_B1=y -CONFIG_ATH79_MACH_DIR_825_C1=y -CONFIG_ATH79_MACH_DIR_869_A1=y -CONFIG_ATH79_MACH_DLAN_HOTSPOT=y -CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y -CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +# CONFIG_ATH79_MACH_CAP324 is not set +# CONFIG_ATH79_MACH_CAP4200AG is not set +# CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_CF_E316N_V2 is not set +# CONFIG_ATH79_MACH_CF_E320N_V2 is not set +# CONFIG_ATH79_MACH_CF_E355AC is not set +# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set +# CONFIG_ATH79_MACH_CF_E520N is not set +# CONFIG_ATH79_MACH_CF_E530N is not set +# CONFIG_ATH79_MACH_CPE505N is not set +# CONFIG_ATH79_MACH_CPE510 is not set +# CONFIG_ATH79_MACH_CPE830 is not set +# CONFIG_ATH79_MACH_CPE870 is not set +# CONFIG_ATH79_MACH_CR3000 is not set +# CONFIG_ATH79_MACH_CR5000 is not set +# CONFIG_ATH79_MACH_DAP_2695_A1 is not set +# CONFIG_ATH79_MACH_DB120 is not set +# CONFIG_ATH79_MACH_DGL_5500_A1 is not set +# CONFIG_ATH79_MACH_DHP_1565_A1 is not set +# CONFIG_ATH79_MACH_DIR_505_A1 is not set +# CONFIG_ATH79_MACH_DIR_600_A1 is not set +# CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_615_I1 is not set +# CONFIG_ATH79_MACH_DIR_825_B1 is not set +# CONFIG_ATH79_MACH_DIR_825_C1 is not set +# CONFIG_ATH79_MACH_DIR_869_A1 is not set +# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set +# 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_DR344=y -CONFIG_ATH79_MACH_DR531=y -CONFIG_ATH79_MACH_DRAGINO2=y -CONFIG_ATH79_MACH_E2100L=y -CONFIG_ATH79_MACH_EAP120=y -CONFIG_ATH79_MACH_EAP300V2=y -CONFIG_ATH79_MACH_EAP7660D=y -CONFIG_ATH79_MACH_EL_M150=y -CONFIG_ATH79_MACH_EL_MINI=y -CONFIG_ATH79_MACH_ENS202EXT=y -CONFIG_ATH79_MACH_EPG5000=y -CONFIG_ATH79_MACH_ESR1750=y -CONFIG_ATH79_MACH_ESR900=y -CONFIG_ATH79_MACH_EW_DORIN=y -CONFIG_ATH79_MACH_F9K1115V2=y -CONFIG_ATH79_MACH_FRITZ300E=y -CONFIG_ATH79_MACH_GL_AR150=y -CONFIG_ATH79_MACH_GL_AR300=y -CONFIG_ATH79_MACH_GL_AR300M=y -CONFIG_ATH79_MACH_GL_DOMINO=y -CONFIG_ATH79_MACH_GL_INET=y -CONFIG_ATH79_MACH_GL_MIFI=y -CONFIG_ATH79_MACH_GL_USB150=y -CONFIG_ATH79_MACH_GS_MINIBOX_V1=y -CONFIG_ATH79_MACH_GS_OOLITE=y +# CONFIG_ATH79_MACH_DR342 is not set +# CONFIG_ATH79_MACH_DR344 is not set +# CONFIG_ATH79_MACH_DR531 is not set +# CONFIG_ATH79_MACH_DRAGINO2 is not set +# CONFIG_ATH79_MACH_E2100L is not set +# CONFIG_ATH79_MACH_EAP120 is not set +# CONFIG_ATH79_MACH_EAP300V2 is not set +# CONFIG_ATH79_MACH_EAP7660D is not set +# CONFIG_ATH79_MACH_EL_M150 is not set +# CONFIG_ATH79_MACH_EL_MINI is not set +# CONFIG_ATH79_MACH_ENS202EXT is not set +# 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_DORIN is not set +# CONFIG_ATH79_MACH_F9K1115V2 is not set +# CONFIG_ATH79_MACH_FRITZ300E is not set +# CONFIG_ATH79_MACH_GL_AR150 is not set +# CONFIG_ATH79_MACH_GL_AR300 is not set +# CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_DOMINO is not set +# CONFIG_ATH79_MACH_GL_INET is not set +# CONFIG_ATH79_MACH_GL_MIFI is not set +# CONFIG_ATH79_MACH_GL_USB150 is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set +# CONFIG_ATH79_MACH_GS_OOLITE is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set -CONFIG_ATH79_MACH_HIWIFI_HC6361=y -CONFIG_ATH79_MACH_HORNET_UB=y -CONFIG_ATH79_MACH_JA76PF=y -CONFIG_ATH79_MACH_JWAP003=y -CONFIG_ATH79_MACH_JWAP230=y -CONFIG_ATH79_MACH_LIMA=y -CONFIG_ATH79_MACH_MC_MAC1200R=y -CONFIG_ATH79_MACH_MW316R_V1=y -CONFIG_ATH79_MACH_MASELINK_AP2600I=y -CONFIG_ATH79_MACH_MASELINK_AP2600IFM=y -CONFIG_ATH79_MACH_MR12=y -CONFIG_ATH79_MACH_MR16=y -CONFIG_ATH79_MACH_MR1750=y +# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set +# CONFIG_ATH79_MACH_HORNET_UB is not set +# CONFIG_ATH79_MACH_JA76PF is not set +# CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_JWAP230 is not set +# CONFIG_ATH79_MACH_LIMA is not set +# CONFIG_ATH79_MACH_MC_MAC1200R is not set +# CONFIG_ATH79_MACH_MR12 is not set +# CONFIG_ATH79_MACH_MR16 is not set +# CONFIG_ATH79_MACH_MR1750 is not set # CONFIG_ATH79_MACH_MR18 is not set -CONFIG_ATH79_MACH_MR600=y -CONFIG_ATH79_MACH_MR900=y -CONFIG_ATH79_MACH_MYNET_N600=y -CONFIG_ATH79_MACH_MYNET_N750=y -CONFIG_ATH79_MACH_MYNET_REXT=y -CONFIG_ATH79_MACH_MZK_W04NU=y -CONFIG_ATH79_MACH_MZK_W300NH=y -CONFIG_ATH79_MACH_NBG460N=y -CONFIG_ATH79_MACH_NBG6716=y -CONFIG_ATH79_MACH_OM2P=y -CONFIG_ATH79_MACH_OM5P=y -CONFIG_ATH79_MACH_OM5P_AC=y -CONFIG_ATH79_MACH_OM5P_ACv2=y -CONFIG_ATH79_MACH_OMY_G1=y -CONFIG_ATH79_MACH_OMY_X1=y -CONFIG_ATH79_MACH_ONION_OMEGA=y -CONFIG_ATH79_MACH_PB42=y -CONFIG_ATH79_MACH_PB44=y -CONFIG_ATH79_MACH_PQI_AIR_PEN=y -CONFIG_ATH79_MACH_QIHOO_C301=y -CONFIG_ATH79_MACH_R602N=y +# CONFIG_ATH79_MACH_MR600 is not set +# CONFIG_ATH79_MACH_MR900 is not set +# CONFIG_ATH79_MACH_MYNET_N600 is not set +# CONFIG_ATH79_MACH_MYNET_N750 is not set +# CONFIG_ATH79_MACH_MYNET_REXT is not set +# CONFIG_ATH79_MACH_MZK_W04NU is not set +# CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_NBG460N is not set +# CONFIG_ATH79_MACH_NBG6716 is not set +# CONFIG_ATH79_MACH_OM2P is not set +# CONFIG_ATH79_MACH_OM5P is not set +# CONFIG_ATH79_MACH_OM5P_AC is not set +# CONFIG_ATH79_MACH_OM5P_ACv2 is not set +# CONFIG_ATH79_MACH_OMY_G1 is not set +# CONFIG_ATH79_MACH_OMY_X1 is not set +# CONFIG_ATH79_MACH_ONION_OMEGA is not set +# CONFIG_ATH79_MACH_PB42 is not set +# CONFIG_ATH79_MACH_PB44 is not set +# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set +# CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set # CONFIG_ATH79_MACH_RB2011 is not set @@ -166,103 +162,100 @@ CONFIG_ATH79_MACH_R602N=y # CONFIG_ATH79_MACH_RB95X is not set # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set -CONFIG_ATH79_MACH_RE450=y -CONFIG_ATH79_MACH_RW2458N=y -CONFIG_ATH79_MACH_SC1750=y -CONFIG_ATH79_MACH_SC300M=y -CONFIG_ATH79_MACH_SC450=y -CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y -CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3=y -CONFIG_ATH79_MACH_SMART_300=y -CONFIG_ATH79_MACH_SOM9331=y -CONFIG_ATH79_MACH_SR3200=y -CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y -CONFIG_ATH79_MACH_TEW_632BRP=y -CONFIG_ATH79_MACH_TEW_673GRU=y -CONFIG_ATH79_MACH_TEW_712BR=y -CONFIG_ATH79_MACH_TEW_732BR=y -CONFIG_ATH79_MACH_TEW_823DRU=y -CONFIG_ATH79_MACH_TL_MR11U=y -CONFIG_ATH79_MACH_TL_MR13U=y -CONFIG_ATH79_MACH_TL_MR3020=y -CONFIG_ATH79_MACH_TL_MR3X20=y -CONFIG_ATH79_MACH_TL_MR6400=y -CONFIG_ATH79_MACH_TL_WA701ND_V2=y -CONFIG_ATH79_MACH_TL_WA7210N_V2=y -CONFIG_ATH79_MACH_TL_WA801ND_V3=y -CONFIG_ATH79_MACH_TL_WA830RE_V2=y -CONFIG_ATH79_MACH_TL_WA850RE_V2=y -CONFIG_ATH79_MACH_TL_WA855RE_V1=y -CONFIG_ATH79_MACH_TL_WA901ND=y -CONFIG_ATH79_MACH_TL_WA901ND_V2=y -CONFIG_ATH79_MACH_TL_WA901ND_V4=y -CONFIG_ATH79_MACH_TL_WAX50RE=y -CONFIG_ATH79_MACH_TL_WDR3320_V2=y -CONFIG_ATH79_MACH_TL_WDR3500=y -CONFIG_ATH79_MACH_TL_WDR4300=y -CONFIG_ATH79_MACH_TL_WDR6500_V2=y -CONFIG_ATH79_MACH_TL_WDR6500_V6=y -CONFIG_ATH79_MACH_TL_WPA8630=y -CONFIG_ATH79_MACH_TL_WR1041N_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND=y -CONFIG_ATH79_MACH_TL_WR1043ND_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND_V4=y -CONFIG_ATH79_MACH_TL_WR2543N=y -CONFIG_ATH79_MACH_TL_WR703N=y -CONFIG_ATH79_MACH_TL_WR720N_V3=y -CONFIG_ATH79_MACH_TL_WR741ND=y -CONFIG_ATH79_MACH_TL_WR741ND_V4=y -CONFIG_ATH79_MACH_TL_WR802N_V1=y -CONFIG_ATH79_MACH_TL_WR802N_V2=y -CONFIG_ATH79_MACH_TL_WR810N=y -CONFIG_ATH79_MACH_TL_WR840N_V2=y -CONFIG_ATH79_MACH_TL_WR841N_V1=y -CONFIG_ATH79_MACH_TL_WR841N_V8=y -CONFIG_ATH79_MACH_TL_WR841N_V9=y -CONFIG_ATH79_MACH_TL_WR882N_V1=y -CONFIG_ATH79_MACH_TL_WR902AC_V1=y -CONFIG_ATH79_MACH_TL_WR940N_V4=y -CONFIG_ATH79_MACH_TL_WR941ND=y -CONFIG_ATH79_MACH_TL_WR941ND_V6=y -CONFIG_ATH79_MACH_TL_WR941N_V7=y -CONFIG_ATH79_MACH_TL_WR942N_V1=y -CONFIG_ATH79_MACH_TUBE2H=y -CONFIG_ATH79_MACH_UBNT=y -CONFIG_ATH79_MACH_UBNT_UNIFIAC=y -CONFIG_ATH79_MACH_UBNT_XM=y -CONFIG_ATH79_MACH_WEIO=y +# CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RW2458N is not set +# CONFIG_ATH79_MACH_SC1750 is not set +# CONFIG_ATH79_MACH_SC300M is not set +# CONFIG_ATH79_MACH_SC450 is not set +# CONFIG_ATH79_MACH_SMART_300 is not set +# CONFIG_ATH79_MACH_SOM9331 is not set +# CONFIG_ATH79_MACH_SR3200 is not set +# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set +# CONFIG_ATH79_MACH_TEW_632BRP is not set +# CONFIG_ATH79_MACH_TEW_673GRU is not set +# CONFIG_ATH79_MACH_TEW_712BR is not set +# CONFIG_ATH79_MACH_TEW_732BR is not set +# CONFIG_ATH79_MACH_TEW_823DRU is not set +# CONFIG_ATH79_MACH_TL_MR11U is not set +# CONFIG_ATH79_MACH_TL_MR13U is not set +# CONFIG_ATH79_MACH_TL_MR3020 is not set +# CONFIG_ATH79_MACH_TL_MR3X20 is not set +# CONFIG_ATH79_MACH_TL_MR6400 is not set +# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set +# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set +# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set +# CONFIG_ATH79_MACH_TL_WA901ND is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WAX50RE is not set +# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set +# CONFIG_ATH79_MACH_TL_WDR3500 is not set +# CONFIG_ATH79_MACH_TL_WDR4300 is not set +# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set +# CONFIG_ATH79_MACH_TL_WPA8630 is not set +# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set +# CONFIG_ATH79_MACH_TL_WR2543N is not set +# CONFIG_ATH79_MACH_TL_WR703N is not set +# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set +# CONFIG_ATH79_MACH_TL_WR741ND is not set +# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR810N is not set +# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set +# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set +# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set +# CONFIG_ATH79_MACH_TL_WR941ND is not set +# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set +# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set +# CONFIG_ATH79_MACH_TUBE2H is not set +# CONFIG_ATH79_MACH_UBNT is not set +# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set +# CONFIG_ATH79_MACH_UBNT_XM is not set +# CONFIG_ATH79_MACH_WEIO is not set +# CONFIG_ATH79_MACH_WHR_HP_G300N is not set # CONFIG_ATH79_MACH_WI2A_AC200I is not set -CONFIG_ATH79_MACH_WHR_HP_G300N=y -CONFIG_ATH79_MACH_WLAE_AG300N=y -CONFIG_ATH79_MACH_WLR8100=y -CONFIG_ATH79_MACH_WNDAP360=y -CONFIG_ATH79_MACH_WNDR3700=y +# CONFIG_ATH79_MACH_WLAE_AG300N is not set +# CONFIG_ATH79_MACH_WLR8100 is not set +# CONFIG_ATH79_MACH_WNDAP360 is not set +# CONFIG_ATH79_MACH_WNDR3700 is not set # CONFIG_ATH79_MACH_WNDR4300 is not set -CONFIG_ATH79_MACH_WNR2000=y -CONFIG_ATH79_MACH_WNR2000_V3=y -CONFIG_ATH79_MACH_WNR2000_V4=y -CONFIG_ATH79_MACH_WNR2200=y -CONFIG_ATH79_MACH_WP543=y -CONFIG_ATH79_MACH_WPE72=y -CONFIG_ATH79_MACH_WPJ342=y -CONFIG_ATH79_MACH_WPJ344=y -CONFIG_ATH79_MACH_WPJ531=y -CONFIG_ATH79_MACH_WPJ558=y -CONFIG_ATH79_MACH_WPJ563=y -CONFIG_ATH79_MACH_WRT160NL=y -CONFIG_ATH79_MACH_WRT400N=y -CONFIG_ATH79_MACH_WRTNODE2Q=y -CONFIG_ATH79_MACH_WZR_450HP2=y -CONFIG_ATH79_MACH_WZR_HP_AG300H=y -CONFIG_ATH79_MACH_WZR_HP_G300NH=y -CONFIG_ATH79_MACH_WZR_HP_G300NH2=y -CONFIG_ATH79_MACH_WZR_HP_G450H=y -CONFIG_ATH79_MACH_XD3200=y +# CONFIG_ATH79_MACH_WNR2000 is not set +# CONFIG_ATH79_MACH_WNR2000_V3 is not set +# CONFIG_ATH79_MACH_WNR2000_V4 is not set +# CONFIG_ATH79_MACH_WNR2200 is not set +# CONFIG_ATH79_MACH_WP543 is not set +# CONFIG_ATH79_MACH_WPE72 is not set +# CONFIG_ATH79_MACH_WPJ342 is not set +# CONFIG_ATH79_MACH_WPJ344 is not set +# CONFIG_ATH79_MACH_WPJ531 is not set +# CONFIG_ATH79_MACH_WPJ558 is not set +# CONFIG_ATH79_MACH_WPJ563 is not set +# CONFIG_ATH79_MACH_WRT160NL is not set +# CONFIG_ATH79_MACH_WRT400N is not set +# CONFIG_ATH79_MACH_WRTNODE2Q is not set +# CONFIG_ATH79_MACH_WZR_450HP2 is not set +# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set +# CONFIG_ATH79_MACH_WZR_HP_G450H is not set +# CONFIG_ATH79_MACH_XD3200 is not set # CONFIG_ATH79_MACH_Z1 is not set -CONFIG_ATH79_MACH_ZBT_WE1526=y -CONFIG_ATH79_MACH_ZCN_1523H=y -CONFIG_ATH79_NVRAM=y -CONFIG_ATH79_PCI_ATH9K_FIXUP=y +# CONFIG_ATH79_MACH_ZBT_WE1526 is not set +# CONFIG_ATH79_MACH_ZCN_1523H is not set +# CONFIG_ATH79_NVRAM is not set +# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set # CONFIG_ATH79_ROUTERBOOT is not set CONFIG_ATH79_WDT=y CONFIG_CC_OPTIMIZE_FOR_SIZE=y @@ -351,7 +344,6 @@ CONFIG_HAVE_OPROFILE=y CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HW_HAS_PCI=y CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y @@ -369,7 +361,6 @@ CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y CONFIG_LANTIQ_PHY=y CONFIG_LEDS_GPIO=y -# CONFIG_LEDS_WNDR3700_USB is not set CONFIG_LIBFDT=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BITBANG=y @@ -412,7 +403,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_TPLINK_PARTS=y -CONFIG_MYLOADER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DSA=y @@ -420,11 +410,9 @@ CONFIG_NET_DSA_MV88E6060=y CONFIG_NET_DSA_MV88E6063=y CONFIG_NET_DSA_TAG_TRAILER=y CONFIG_NET_SWITCHDEV=y -CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set CONFIG_OF=y CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y CONFIG_OF_EARLY_FLATTREE=y CONFIG_OF_FLATTREE=y CONFIG_OF_GPIO=y @@ -432,12 +420,7 @@ CONFIG_OF_IRQ=y CONFIG_OF_MDIO=y CONFIG_OF_MTD=y CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y +# CONFIG_PCI_AR724X is not set CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 CONFIG_PHYLIB=y @@ -453,17 +436,14 @@ CONFIG_RTL8367_PHY=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_AR933X=y -CONFIG_SERIAL_AR933X_CONSOLE=y -CONFIG_SERIAL_AR933X_NR_UARTS=2 -CONFIG_SOC_AR71XX=y -CONFIG_SOC_AR724X=y -CONFIG_SOC_AR913X=y -CONFIG_SOC_AR933X=y -CONFIG_SOC_AR934X=y -CONFIG_SOC_QCA953X=y -CONFIG_SOC_QCA955X=y -CONFIG_SOC_QCA956X=y +# CONFIG_SOC_AR71XX is not set +# CONFIG_SOC_AR724X is not set +# CONFIG_SOC_AR913X is not set +# CONFIG_SOC_AR933X is not set +# CONFIG_SOC_AR934X is not set +# CONFIG_SOC_QCA953X is not set +# CONFIG_SOC_QCA955X is not set +# CONFIG_SOC_QCA956X is not set CONFIG_SPI=y CONFIG_SPI_ATH79=y CONFIG_SPI_BITBANG=y @@ -486,4 +466,3 @@ CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y CONFIG_USE_OF=y CONFIG_ZONE_DMA_FLAG=0 -CONFIG_MIPS_FPU_EMULATOR=y diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index ff0b63c3e..2c20b5839 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -20,140 +20,136 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y CONFIG_AT803X_PHY=y CONFIG_ATH79=y -CONFIG_ATH79_DEV_AP9X_PCI=y -CONFIG_ATH79_DEV_DSA=y -CONFIG_ATH79_DEV_ETH=y -CONFIG_ATH79_DEV_GPIO_BUTTONS=y -CONFIG_ATH79_DEV_LEDS_GPIO=y -CONFIG_ATH79_DEV_M25P80=y -CONFIG_ATH79_DEV_NFC=y -CONFIG_ATH79_DEV_SPI=y -CONFIG_ATH79_DEV_USB=y -CONFIG_ATH79_DEV_WMAC=y -CONFIG_ATH79_MACH_A60=y -CONFIG_ATH79_MACH_ALFA_AP120C=y -CONFIG_ATH79_MACH_ALFA_AP96=y -CONFIG_ATH79_MACH_ALFA_NX=y -CONFIG_ATH79_MACH_ALL0258N=y -CONFIG_ATH79_MACH_ALL0315N=y -CONFIG_ATH79_MACH_ANTMINER_S1=y -CONFIG_ATH79_MACH_ANTMINER_S3=y -CONFIG_ATH79_MACH_ANTROUTER_R1=y -CONFIG_ATH79_MACH_AP121=y -CONFIG_ATH79_MACH_AP121F=y -CONFIG_ATH79_MACH_AP132=y -CONFIG_ATH79_MACH_AP136=y -CONFIG_ATH79_MACH_AP143=y -CONFIG_ATH79_MACH_AP147=y -CONFIG_ATH79_MACH_AP152=y -CONFIG_ATH79_MACH_AP531B0=y +# CONFIG_ATH79_DEV_AP9X_PCI is not set +# CONFIG_ATH79_DEV_DSA is not set +# CONFIG_ATH79_DEV_ETH is not set +# CONFIG_ATH79_DEV_GPIO_BUTTONS is not set +# CONFIG_ATH79_DEV_LEDS_GPIO is not set +# CONFIG_ATH79_DEV_M25P80 is not set +# CONFIG_ATH79_DEV_SPI is not set +# CONFIG_ATH79_DEV_USB is not set +# CONFIG_ATH79_MACH_A60 is not set +# CONFIG_ATH79_MACH_ALFA_AP120C is not set +# CONFIG_ATH79_MACH_ALFA_AP96 is not set +# CONFIG_ATH79_MACH_ALFA_NX is not set +# CONFIG_ATH79_MACH_ALL0258N is not set +# CONFIG_ATH79_MACH_ALL0315N is not set +# CONFIG_ATH79_MACH_ANTMINER_S1 is not set +# CONFIG_ATH79_MACH_ANTMINER_S3 is not set +# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set +# CONFIG_ATH79_MACH_AP121 is not set +# CONFIG_ATH79_MACH_AP121F is not set +# CONFIG_ATH79_MACH_AP132 is not set +# CONFIG_ATH79_MACH_AP136 is not set +# CONFIG_ATH79_MACH_AP143 is not set +# CONFIG_ATH79_MACH_AP147 is not set +# CONFIG_ATH79_MACH_AP152 is not set +# CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set -CONFIG_ATH79_MACH_AP90Q=y -CONFIG_ATH79_MACH_AP96=y -CONFIG_ATH79_MACH_ARCHER_C25_V1=y -CONFIG_ATH79_MACH_ARCHER_C58_V1=y -CONFIG_ATH79_MACH_ARCHER_C59_V1=y -CONFIG_ATH79_MACH_ARCHER_C60_V1=y -CONFIG_ATH79_MACH_ARCHER_C7=y -CONFIG_ATH79_MACH_ARDUINO_YUN=y -CONFIG_ATH79_MACH_AW_NR580=y -CONFIG_ATH79_MACH_BHR_4GRV2=y -CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y -CONFIG_ATH79_MACH_BSB=y -CONFIG_ATH79_MACH_C55=y +# CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP96 is not set +# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set +# CONFIG_ATH79_MACH_ARCHER_C7 is not set +# CONFIG_ATH79_MACH_ARDUINO_YUN is not set +# CONFIG_ATH79_MACH_AW_NR580 is not set +# CONFIG_ATH79_MACH_BHR_4GRV2 is not set +# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set +# CONFIG_ATH79_MACH_BSB is not set +# CONFIG_ATH79_MACH_C55 is not set # CONFIG_ATH79_MACH_C60 is not set -CONFIG_ATH79_MACH_CAP324=y -CONFIG_ATH79_MACH_CAP4200AG=y -CONFIG_ATH79_MACH_CARAMBOLA2=y -CONFIG_ATH79_MACH_CF_E316N_V2=y -CONFIG_ATH79_MACH_CF_E320N_V2=y -CONFIG_ATH79_MACH_CF_E355AC=y -CONFIG_ATH79_MACH_CF_E380AC_V1=y -CONFIG_ATH79_MACH_CF_E380AC_V2=y -CONFIG_ATH79_MACH_CF_E520N=y -CONFIG_ATH79_MACH_CF_E530N=y -CONFIG_ATH79_MACH_CPE505N=y -CONFIG_ATH79_MACH_CPE510=y -CONFIG_ATH79_MACH_CPE830=y -CONFIG_ATH79_MACH_CPE870=y -CONFIG_ATH79_MACH_CR3000=y -CONFIG_ATH79_MACH_CR5000=y -CONFIG_ATH79_MACH_DAP_2695_A1=y -CONFIG_ATH79_MACH_DB120=y -CONFIG_ATH79_MACH_DGL_5500_A1=y -CONFIG_ATH79_MACH_DHP_1565_A1=y -CONFIG_ATH79_MACH_DIR_505_A1=y -CONFIG_ATH79_MACH_DIR_600_A1=y -CONFIG_ATH79_MACH_DIR_615_C1=y -CONFIG_ATH79_MACH_DIR_615_I1=y -CONFIG_ATH79_MACH_DIR_825_B1=y -CONFIG_ATH79_MACH_DIR_825_C1=y -CONFIG_ATH79_MACH_DIR_869_A1=y -CONFIG_ATH79_MACH_DLAN_HOTSPOT=y -CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y -CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +# CONFIG_ATH79_MACH_CAP324 is not set +# CONFIG_ATH79_MACH_CAP4200AG is not set +# CONFIG_ATH79_MACH_CARAMBOLA2 is not set +# CONFIG_ATH79_MACH_CF_E316N_V2 is not set +# CONFIG_ATH79_MACH_CF_E320N_V2 is not set +# CONFIG_ATH79_MACH_CF_E355AC is not set +# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set +# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set +# CONFIG_ATH79_MACH_CF_E520N is not set +# CONFIG_ATH79_MACH_CF_E530N is not set +# CONFIG_ATH79_MACH_CPE505N is not set +# CONFIG_ATH79_MACH_CPE510 is not set +# CONFIG_ATH79_MACH_CPE830 is not set +# CONFIG_ATH79_MACH_CPE870 is not set +# CONFIG_ATH79_MACH_CR3000 is not set +# CONFIG_ATH79_MACH_CR5000 is not set +# CONFIG_ATH79_MACH_DAP_2695_A1 is not set +# CONFIG_ATH79_MACH_DB120 is not set +# CONFIG_ATH79_MACH_DGL_5500_A1 is not set +# CONFIG_ATH79_MACH_DHP_1565_A1 is not set +# CONFIG_ATH79_MACH_DIR_505_A1 is not set +# CONFIG_ATH79_MACH_DIR_600_A1 is not set +# CONFIG_ATH79_MACH_DIR_615_C1 is not set +# CONFIG_ATH79_MACH_DIR_615_I1 is not set +# CONFIG_ATH79_MACH_DIR_825_B1 is not set +# CONFIG_ATH79_MACH_DIR_825_C1 is not set +# CONFIG_ATH79_MACH_DIR_869_A1 is not set +# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set +# 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_DR344=y -CONFIG_ATH79_MACH_DR531=y -CONFIG_ATH79_MACH_DRAGINO2=y -CONFIG_ATH79_MACH_E2100L=y -CONFIG_ATH79_MACH_EAP120=y -CONFIG_ATH79_MACH_EAP300V2=y -CONFIG_ATH79_MACH_EAP7660D=y -CONFIG_ATH79_MACH_EL_M150=y -CONFIG_ATH79_MACH_EL_MINI=y -CONFIG_ATH79_MACH_ENS202EXT=y -CONFIG_ATH79_MACH_EPG5000=y -CONFIG_ATH79_MACH_ESR1750=y -CONFIG_ATH79_MACH_ESR900=y -CONFIG_ATH79_MACH_EW_DORIN=y -CONFIG_ATH79_MACH_F9K1115V2=y -CONFIG_ATH79_MACH_FRITZ300E=y -CONFIG_ATH79_MACH_GL_AR150=y -CONFIG_ATH79_MACH_GL_AR300=y -CONFIG_ATH79_MACH_GL_AR300M=y -CONFIG_ATH79_MACH_GL_DOMINO=y -CONFIG_ATH79_MACH_GL_INET=y -CONFIG_ATH79_MACH_GL_MIFI=y -CONFIG_ATH79_MACH_GL_USB150=y -CONFIG_ATH79_MACH_GS_MINIBOX_V1=y -CONFIG_ATH79_MACH_GS_OOLITE=y +# CONFIG_ATH79_MACH_DR342 is not set +# CONFIG_ATH79_MACH_DR344 is not set +# CONFIG_ATH79_MACH_DR531 is not set +# CONFIG_ATH79_MACH_DRAGINO2 is not set +# CONFIG_ATH79_MACH_E2100L is not set +# CONFIG_ATH79_MACH_EAP120 is not set +# CONFIG_ATH79_MACH_EAP300V2 is not set +# CONFIG_ATH79_MACH_EAP7660D is not set +# CONFIG_ATH79_MACH_EL_M150 is not set +# CONFIG_ATH79_MACH_EL_MINI is not set +# CONFIG_ATH79_MACH_ENS202EXT is not set +# 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_DORIN is not set +# CONFIG_ATH79_MACH_F9K1115V2 is not set +# CONFIG_ATH79_MACH_FRITZ300E is not set +# CONFIG_ATH79_MACH_GL_AR150 is not set +# CONFIG_ATH79_MACH_GL_AR300 is not set +# CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_DOMINO is not set +# CONFIG_ATH79_MACH_GL_INET is not set +# CONFIG_ATH79_MACH_GL_MIFI is not set +# CONFIG_ATH79_MACH_GL_USB150 is not set +# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set +# CONFIG_ATH79_MACH_GS_OOLITE is not set # CONFIG_ATH79_MACH_HIVEAP_121 is not set -CONFIG_ATH79_MACH_HIWIFI_HC6361=y -CONFIG_ATH79_MACH_HORNET_UB=y -CONFIG_ATH79_MACH_JA76PF=y -CONFIG_ATH79_MACH_JWAP003=y -CONFIG_ATH79_MACH_JWAP230=y -CONFIG_ATH79_MACH_LIMA=y -CONFIG_ATH79_MACH_MC_MAC1200R=y -CONFIG_ATH79_MACH_MW316R_V1=y -CONFIG_ATH79_MACH_MASELINK_AP2600I=y -CONFIG_ATH79_MACH_MASELINK_AP2600IFM=y -CONFIG_ATH79_MACH_MR12=y -CONFIG_ATH79_MACH_MR16=y -CONFIG_ATH79_MACH_MR1750=y +# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set +# CONFIG_ATH79_MACH_HORNET_UB is not set +# CONFIG_ATH79_MACH_JA76PF is not set +# CONFIG_ATH79_MACH_JWAP003 is not set +# CONFIG_ATH79_MACH_JWAP230 is not set +# CONFIG_ATH79_MACH_LIMA is not set +# CONFIG_ATH79_MACH_MC_MAC1200R is not set +# CONFIG_ATH79_MACH_MR12 is not set +# CONFIG_ATH79_MACH_MR16 is not set +# CONFIG_ATH79_MACH_MR1750 is not set # CONFIG_ATH79_MACH_MR18 is not set -CONFIG_ATH79_MACH_MR600=y -CONFIG_ATH79_MACH_MR900=y -CONFIG_ATH79_MACH_MYNET_N600=y -CONFIG_ATH79_MACH_MYNET_N750=y -CONFIG_ATH79_MACH_MYNET_REXT=y -CONFIG_ATH79_MACH_MZK_W04NU=y -CONFIG_ATH79_MACH_MZK_W300NH=y -CONFIG_ATH79_MACH_NBG460N=y -CONFIG_ATH79_MACH_NBG6716=y -CONFIG_ATH79_MACH_OM2P=y -CONFIG_ATH79_MACH_OM5P=y -CONFIG_ATH79_MACH_OM5P_AC=y -CONFIG_ATH79_MACH_OM5P_ACv2=y -CONFIG_ATH79_MACH_OMY_G1=y -CONFIG_ATH79_MACH_OMY_X1=y -CONFIG_ATH79_MACH_ONION_OMEGA=y -CONFIG_ATH79_MACH_PB42=y -CONFIG_ATH79_MACH_PB44=y -CONFIG_ATH79_MACH_PQI_AIR_PEN=y -CONFIG_ATH79_MACH_QIHOO_C301=y -CONFIG_ATH79_MACH_R602N=y +# CONFIG_ATH79_MACH_MR600 is not set +# CONFIG_ATH79_MACH_MR900 is not set +# CONFIG_ATH79_MACH_MYNET_N600 is not set +# CONFIG_ATH79_MACH_MYNET_N750 is not set +# CONFIG_ATH79_MACH_MYNET_REXT is not set +# CONFIG_ATH79_MACH_MZK_W04NU is not set +# CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_NBG460N is not set +# CONFIG_ATH79_MACH_NBG6716 is not set +# CONFIG_ATH79_MACH_OM2P is not set +# CONFIG_ATH79_MACH_OM5P is not set +# CONFIG_ATH79_MACH_OM5P_AC is not set +# CONFIG_ATH79_MACH_OM5P_ACv2 is not set +# CONFIG_ATH79_MACH_OMY_G1 is not set +# CONFIG_ATH79_MACH_OMY_X1 is not set +# CONFIG_ATH79_MACH_ONION_OMEGA is not set +# CONFIG_ATH79_MACH_PB42 is not set +# CONFIG_ATH79_MACH_PB44 is not set +# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set +# CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set # CONFIG_ATH79_MACH_RB2011 is not set @@ -164,106 +160,102 @@ CONFIG_ATH79_MACH_R602N=y # CONFIG_ATH79_MACH_RB95X is not set # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set -CONFIG_ATH79_MACH_RE450=y -CONFIG_ATH79_MACH_RW2458N=y -CONFIG_ATH79_MACH_SC1750=y -CONFIG_ATH79_MACH_SC300M=y -CONFIG_ATH79_MACH_SC450=y -CONFIG_ATH79_MACH_SGR_W500_N85B_V2=y -CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3=y -CONFIG_ATH79_MACH_SMART_300=y -CONFIG_ATH79_MACH_SOM9331=y -CONFIG_ATH79_MACH_SR3200=y -CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y -CONFIG_ATH79_MACH_TEW_632BRP=y -CONFIG_ATH79_MACH_TEW_673GRU=y -CONFIG_ATH79_MACH_TEW_712BR=y -CONFIG_ATH79_MACH_TEW_732BR=y -CONFIG_ATH79_MACH_TEW_823DRU=y -CONFIG_ATH79_MACH_TL_MR11U=y -CONFIG_ATH79_MACH_TL_MR13U=y -CONFIG_ATH79_MACH_TL_MR3020=y -CONFIG_ATH79_MACH_TL_MR3X20=y -CONFIG_ATH79_MACH_TL_MR6400=y -CONFIG_ATH79_MACH_TL_WA701ND_V2=y -CONFIG_ATH79_MACH_TL_WA7210N_V2=y -CONFIG_ATH79_MACH_TL_WA801ND_V3=y -CONFIG_ATH79_MACH_TL_WA830RE_V2=y -CONFIG_ATH79_MACH_TL_WA850RE_V2=y -CONFIG_ATH79_MACH_TL_WA855RE_V1=y -CONFIG_ATH79_MACH_TL_WA901ND=y -CONFIG_ATH79_MACH_TL_WA901ND_V2=y -CONFIG_ATH79_MACH_TL_WA901ND_V4=y -CONFIG_ATH79_MACH_TL_WAX50RE=y -CONFIG_ATH79_MACH_TL_WDR3320_V2=y -CONFIG_ATH79_MACH_TL_WDR3500=y -CONFIG_ATH79_MACH_TL_WDR4300=y -CONFIG_ATH79_MACH_TL_WDR6500_V2=y -CONFIG_ATH79_MACH_TL_WDR6500_V6=y -CONFIG_ATH79_MACH_TL_WPA8630=y -CONFIG_ATH79_MACH_TL_WR1041N_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND=y -CONFIG_ATH79_MACH_TL_WR1043ND_V2=y -CONFIG_ATH79_MACH_TL_WR1043ND_V4=y -CONFIG_ATH79_MACH_TL_WR2543N=y -CONFIG_ATH79_MACH_TL_WR703N=y -CONFIG_ATH79_MACH_TL_WR720N_V3=y -CONFIG_ATH79_MACH_TL_WR741ND=y -CONFIG_ATH79_MACH_TL_WR741ND_V4=y -CONFIG_ATH79_MACH_TL_WR802N_V1=y -CONFIG_ATH79_MACH_TL_WR802N_V2=y -CONFIG_ATH79_MACH_TL_WR810N=y -CONFIG_ATH79_MACH_TL_WR840N_V2=y -CONFIG_ATH79_MACH_TL_WR841N_V1=y -CONFIG_ATH79_MACH_TL_WR841N_V8=y -CONFIG_ATH79_MACH_TL_WR841N_V9=y -CONFIG_ATH79_MACH_TL_WR882N_V1=y -CONFIG_ATH79_MACH_TL_WR902AC_V1=y -CONFIG_ATH79_MACH_TL_WR940N_V4=y -CONFIG_ATH79_MACH_TL_WR941ND=y -CONFIG_ATH79_MACH_TL_WR941ND_V6=y -CONFIG_ATH79_MACH_TL_WR941N_V7=y -CONFIG_ATH79_MACH_TL_WR942N_V1=y -CONFIG_ATH79_MACH_TUBE2H=y -CONFIG_ATH79_MACH_UBNT=y -CONFIG_ATH79_MACH_UBNT_UNIFIAC=y -CONFIG_ATH79_MACH_UBNT_XM=y -CONFIG_ATH79_MACH_WEIO=y -CONFIG_ATH79_MACH_WHR_HP_G300N=y +# CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RW2458N is not set +# CONFIG_ATH79_MACH_SC1750 is not set +# CONFIG_ATH79_MACH_SC300M is not set +# CONFIG_ATH79_MACH_SC450 is not set +# CONFIG_ATH79_MACH_SMART_300 is not set +# CONFIG_ATH79_MACH_SOM9331 is not set +# CONFIG_ATH79_MACH_SR3200 is not set +# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set +# CONFIG_ATH79_MACH_TEW_632BRP is not set +# CONFIG_ATH79_MACH_TEW_673GRU is not set +# CONFIG_ATH79_MACH_TEW_712BR is not set +# CONFIG_ATH79_MACH_TEW_732BR is not set +# CONFIG_ATH79_MACH_TEW_823DRU is not set +# CONFIG_ATH79_MACH_TL_MR11U is not set +# CONFIG_ATH79_MACH_TL_MR13U is not set +# CONFIG_ATH79_MACH_TL_MR3020 is not set +# CONFIG_ATH79_MACH_TL_MR3X20 is not set +# CONFIG_ATH79_MACH_TL_MR6400 is not set +# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set +# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set +# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set +# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set +# CONFIG_ATH79_MACH_TL_WA901ND is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WAX50RE is not set +# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set +# CONFIG_ATH79_MACH_TL_WDR3500 is not set +# CONFIG_ATH79_MACH_TL_WDR4300 is not set +# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set +# CONFIG_ATH79_MACH_TL_WPA8630 is not set +# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set +# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR1043N_V5 is not set +# CONFIG_ATH79_MACH_TL_WR2543N is not set +# CONFIG_ATH79_MACH_TL_WR703N is not set +# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set +# CONFIG_ATH79_MACH_TL_WR741ND is not set +# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR810N is not set +# CONFIG_ATH79_MACH_TL_WR810N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set +# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set +# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set +# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set +# CONFIG_ATH79_MACH_TL_WR941ND is not set +# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set +# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set +# CONFIG_ATH79_MACH_TUBE2H is not set +# CONFIG_ATH79_MACH_UBNT is not set +# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set +# CONFIG_ATH79_MACH_UBNT_XM is not set +# CONFIG_ATH79_MACH_WEIO is not set +# CONFIG_ATH79_MACH_WHR_HP_G300N is not set # CONFIG_ATH79_MACH_WI2A_AC200I is not set -CONFIG_ATH79_MACH_WLAE_AG300N=y -CONFIG_ATH79_MACH_WLR8100=y -CONFIG_ATH79_MACH_WNDAP360=y -CONFIG_ATH79_MACH_WNDR3700=y +# CONFIG_ATH79_MACH_WLAE_AG300N is not set +# CONFIG_ATH79_MACH_WLR8100 is not set +# CONFIG_ATH79_MACH_WNDAP360 is not set +# CONFIG_ATH79_MACH_WNDR3700 is not set # CONFIG_ATH79_MACH_WNDR4300 is not set -CONFIG_ATH79_MACH_WNR2000=y -CONFIG_ATH79_MACH_WNR2000_V3=y -CONFIG_ATH79_MACH_WNR2000_V4=y -CONFIG_ATH79_MACH_WNR2200=y -CONFIG_ATH79_MACH_WP543=y -CONFIG_ATH79_MACH_WPE72=y -CONFIG_ATH79_MACH_WPJ342=y -CONFIG_ATH79_MACH_WPJ344=y -CONFIG_ATH79_MACH_WPJ531=y -CONFIG_ATH79_MACH_WPJ558=y -CONFIG_ATH79_MACH_WPJ563=y -CONFIG_ATH79_MACH_WRT160NL=y -CONFIG_ATH79_MACH_WRT400N=y -CONFIG_ATH79_MACH_WRTNODE2Q=y -CONFIG_ATH79_MACH_WZR_450HP2=y -CONFIG_ATH79_MACH_WZR_HP_AG300H=y -CONFIG_ATH79_MACH_WZR_HP_G300NH=y -CONFIG_ATH79_MACH_WZR_HP_G300NH2=y -CONFIG_ATH79_MACH_WZR_HP_G450H=y -CONFIG_ATH79_MACH_XD3200=y +# CONFIG_ATH79_MACH_WNR2000 is not set +# CONFIG_ATH79_MACH_WNR2000_V3 is not set +# CONFIG_ATH79_MACH_WNR2000_V4 is not set +# CONFIG_ATH79_MACH_WNR2200 is not set +# CONFIG_ATH79_MACH_WP543 is not set +# CONFIG_ATH79_MACH_WPE72 is not set +# CONFIG_ATH79_MACH_WPJ342 is not set +# CONFIG_ATH79_MACH_WPJ344 is not set +# CONFIG_ATH79_MACH_WPJ531 is not set +# CONFIG_ATH79_MACH_WPJ558 is not set +# CONFIG_ATH79_MACH_WPJ563 is not set +# CONFIG_ATH79_MACH_WRT160NL is not set +# CONFIG_ATH79_MACH_WRT400N is not set +# CONFIG_ATH79_MACH_WRTNODE2Q is not set +# CONFIG_ATH79_MACH_WZR_450HP2 is not set +# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set +# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set +# CONFIG_ATH79_MACH_WZR_HP_G450H is not set +# CONFIG_ATH79_MACH_XD3200 is not set # CONFIG_ATH79_MACH_Z1 is not set -CONFIG_ATH79_MACH_ZBT_WE1526=y -CONFIG_ATH79_MACH_ZCN_1523H=y -CONFIG_ATH79_NVRAM=y -CONFIG_ATH79_PCI_ATH9K_FIXUP=y +# CONFIG_ATH79_MACH_ZBT_WE1526 is not set +# CONFIG_ATH79_MACH_ZCN_1523H is not set +# CONFIG_ATH79_NVRAM is not set +# CONFIG_ATH79_PCI_ATH9K_FIXUP is not set # CONFIG_ATH79_ROUTERBOOT is not set CONFIG_ATH79_WDT=y -CONFIG_BLK_MQ_PCI=y CONFIG_CEVT_R4K=y CONFIG_CLKDEV_LOOKUP=y CONFIG_CLONE_BACKWARDS=y @@ -289,7 +281,6 @@ CONFIG_CRYPTO_RNG2=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_CSRC_R4K=y CONFIG_DMA_NONCOHERENT=y -CONFIG_DTC=y CONFIG_EARLY_PRINTK=y CONFIG_ETHERNET_PACKET_MANGLE=y CONFIG_FIXED_PHY=y @@ -353,7 +344,6 @@ CONFIG_HAVE_PERF_EVENTS=y CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y -CONFIG_HW_HAS_PCI=y CONFIG_HZ_PERIODIC=y CONFIG_I2C=y CONFIG_I2C_ALGOBIT=y @@ -365,15 +355,11 @@ CONFIG_INITRAMFS_ROOT_UID=0 CONFIG_INITRAMFS_SOURCE="../../root" CONFIG_INTEL_XWAY_PHY=y CONFIG_IP17XX_PHY=y -CONFIG_IRQCHIP=y CONFIG_IRQ_DOMAIN=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y -# CONFIG_KERNEL_KALLSYMS is not set CONFIG_LEDS_GPIO=y -# CONFIG_LEDS_WNDR3700_USB is not set -CONFIG_LIBFDT=y CONFIG_MARVELL_PHY=y CONFIG_MDIO_BITBANG=y CONFIG_MDIO_BOARDINFO=y @@ -384,16 +370,10 @@ CONFIG_MIPS_ASID_BITS=8 CONFIG_MIPS_ASID_SHIFT=0 CONFIG_MIPS_CLOCK_VSYSCALL=y # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set -# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y -# CONFIG_MIPS_CMDLINE_FROM_DTB is not set -# CONFIG_MIPS_ELF_APPENDED_DTB is not set -CONFIG_MIPS_FPU_EMULATOR=y # CONFIG_MIPS_HUGE_TLB_SUPPORT is not set CONFIG_MIPS_L1_CACHE_SHIFT=5 CONFIG_MIPS_MACHINE=y -CONFIG_MIPS_NO_APPENDED_DTB=y -# CONFIG_MIPS_RAW_APPENDED_DTB is not set CONFIG_MIPS_SPRAM=y CONFIG_MODULES_USE_ELF_REL=y CONFIG_MTD_CFI_ADV_OPTIONS=y @@ -419,7 +399,6 @@ CONFIG_MTD_SPLIT_TPLINK_FW=y CONFIG_MTD_SPLIT_UIMAGE_FW=y CONFIG_MTD_SPLIT_WRGG_FW=y CONFIG_MTD_TPLINK_PARTS=y -CONFIG_MYLOADER=y CONFIG_NEED_DMA_MAP_STATE=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DSA=y @@ -429,21 +408,8 @@ CONFIG_NET_DSA_TAG_TRAILER=y CONFIG_NET_SWITCHDEV=y CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y # CONFIG_NO_IOPORT_MAP is not set -CONFIG_OF=y -CONFIG_OF_ADDRESS=y -CONFIG_OF_ADDRESS_PCI=y -CONFIG_OF_EARLY_FLATTREE=y -CONFIG_OF_FLATTREE=y -CONFIG_OF_GPIO=y -CONFIG_OF_IRQ=y -CONFIG_OF_MDIO=y -CONFIG_OF_NET=y -CONFIG_OF_PCI=y -CONFIG_OF_PCI_IRQ=y -CONFIG_PCI=y -CONFIG_PCI_AR724X=y -CONFIG_PCI_DISABLE_COMMON_QUIRKS=y -CONFIG_PCI_DOMAINS=y +# CONFIG_OF is not set +# CONFIG_PCI_AR724X is not set CONFIG_PCI_DRIVERS_LEGACY=y CONFIG_PERF_USE_VMALLOC=y CONFIG_PGTABLE_LEVELS=2 @@ -460,17 +426,14 @@ CONFIG_RTL8367_PHY=y # CONFIG_SERIAL_8250_FSL is not set CONFIG_SERIAL_8250_NR_UARTS=1 CONFIG_SERIAL_8250_RUNTIME_UARTS=1 -CONFIG_SERIAL_AR933X=y -CONFIG_SERIAL_AR933X_CONSOLE=y -CONFIG_SERIAL_AR933X_NR_UARTS=2 -CONFIG_SOC_AR71XX=y -CONFIG_SOC_AR724X=y -CONFIG_SOC_AR913X=y -CONFIG_SOC_AR933X=y -CONFIG_SOC_AR934X=y -CONFIG_SOC_QCA953X=y -CONFIG_SOC_QCA955X=y -CONFIG_SOC_QCA956X=y +# CONFIG_SOC_AR71XX is not set +# CONFIG_SOC_AR724X is not set +# CONFIG_SOC_AR913X is not set +# CONFIG_SOC_AR933X is not set +# CONFIG_SOC_AR934X is not set +# CONFIG_SOC_QCA953X is not set +# CONFIG_SOC_QCA955X is not set +# CONFIG_SOC_QCA956X is not set CONFIG_SPI=y CONFIG_SPI_ATH79=y CONFIG_SPI_BITBANG=y @@ -493,4 +456,4 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y -CONFIG_USE_OF=y +CONFIG_KERNEL_KALLSYMS=n \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 318d19dcf..1198fcb74 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -638,9 +638,21 @@ config ATH79_MACH_DOMYWIFI_DW33D select ATH79_DEV_WMAC select ATH79_DEV_USB +config ATH79_MACH_DR342 + bool "Wallys DR342 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_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_DR344 bool "Wallys DR344 board support" - select SOC_AS934X + select SOC_AR934X + select ATH79_DEV_AP9X_PCI if PCI select ATH79_DEV_ETH select ATH79_DEV_GPIO_BUTTONS select ATH79_DEV_LEDS_GPIO @@ -1012,6 +1024,7 @@ config ATH79_MACH_RBSPI select ATH79_ROUTERBOOT help Say 'Y' here if you want your kernel to support the + MikroTik RouterBOARD mAP MikroTik RouterBOARD mAP lite MikroTik RouterBOARD hAP lite MikroTik RouterBOARD hAP @@ -1022,8 +1035,7 @@ config ATH79_MACH_RBSPI MikroTik RouterBOARD Powerbox MikroTik RouterBOARD LHG 5 MikroTik RouterBOARD cAP (EXPERIMENTAL) - MikroTik RouterBOARD mAP (EXPERIMENTAL) - MikroTik RouterBOARD wAP (EXPERIMENTAL) + MikroTik RouterBOARD wAP config ATH79_MACH_RBSXTLITE bool "MikroTik RouterBOARD SXT Lite" @@ -1625,17 +1637,6 @@ config ATH79_MACH_TL_WDR6500_V2 select ATH79_DEV_USB select ATH79_DEV_WMAC -config ATH79_MACH_TL_WDR6500_V6 - bool "TP-LINK TL-WDR6500 v6 board support" - select SOC_QCA956X - 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_USB - select ATH79_DEV_WMAC - config ATH79_MACH_TL_WR703N bool "TP-LINK TL-WR703N/TL-WR710N/TL-MR10U support" select SOC_AR933X @@ -1701,6 +1702,15 @@ config ATH79_MACH_TL_WR810N select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR810N_V2 + bool "TP-LINK TL-WR810N v2 support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR840N_V2 bool "TP-LINK TL-WR840N v2/v3 support" select SOC_QCA953X @@ -1739,16 +1749,6 @@ config ATH79_MACH_TL_WR841N_V9 select ATH79_DEV_USB select ATH79_DEV_WMAC -config ATH79_MACH_TL_WR882N_V1 - bool "TP-LINK TL-WR882N v1 support" - select SOC_QCA956X - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_WMAC - select ATH79_DEV_USB - config ATH79_MACH_TL_WR902AC_V1 bool "TP-LINK TL-WR902AC v1 support" select SOC_QCA953X @@ -1779,16 +1779,6 @@ config ATH79_MACH_TL_WR941ND_V6 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC -config ATH79_MACH_TL_WR941N_V7 - bool "TP-LINK TL-WR941N v7 support" - select SOC_QCA955X - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - select ATH79_DEV_WMAC - config ATH79_MACH_TL_WR940N_V4 bool "TP-LINK TL-WR940N v4 support" select SOC_QCA956X @@ -1820,6 +1810,15 @@ config ATH79_MACH_TL_WR1041N_V2 select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_TL_WR1043N_V5 + bool "TP-LINK TL-WR1043N v5 support" + select SOC_QCA956X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_WMAC + config ATH79_MACH_TL_WR1043ND bool "TP-LINK TL-WR1043ND support" select SOC_AR913X @@ -2171,51 +2170,3 @@ config ATH79_MACH_FRITZ300E select ATH79_DEV_GPIO_BUTTONS select ATH79_DEV_LEDS_GPIO select ATH79_DEV_M25P80 - -config ATH79_MACH_SGR_W500_N85B_V2 - bool "GRENTECH SGR-W500-N85b v2.0 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_M25P80 - select ATH79_DEV_WMAC - select ATH79_DEV_USB - -config ATH79_MACH_MASELINK_AP2600I - bool "Comba MASELink AP2600-I support" - select SOC_AR934X - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_WMAC - select ATH79_DEV_USB - -config ATH79_MACH_MASELINK_AP2600IFM - bool "Comba MASELink AP2600-IFM support" - select SOC_AR71XX - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - -config ATH79_MACH_SGR_W500_EBI_FIT_V3 - bool "GRENTECH SGR-W500-EBI(FIT) v3.0 support" - select SOC_AR71XX - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_USB - -config ATH79_MACH_MW316R_V1 - bool "Mercury MW316R v1 support" - select SOC_QCA953X - select ATH79_DEV_ETH - select ATH79_DEV_GPIO_BUTTONS - select ATH79_DEV_LEDS_GPIO - select ATH79_DEV_M25P80 - select ATH79_DEV_WMAC diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index a273b235c..455af762e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -102,6 +102,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_DR342) += mach-dr344.o obj-$(CONFIG_ATH79_MACH_DR344) += mach-dr344.o obj-$(CONFIG_ATH79_MACH_DR531) += mach-dr531.o obj-$(CONFIG_ATH79_MACH_DRAGINO2) += mach-dragino2.o @@ -134,9 +135,6 @@ obj-$(CONFIG_ATH79_MACH_JWAP003) += mach-jwap003.o obj-$(CONFIG_ATH79_MACH_JWAP230) += mach-jwap230.o obj-$(CONFIG_ATH79_MACH_LIMA) += mach-lima.o obj-$(CONFIG_ATH79_MACH_MC_MAC1200R) += mach-mc-mac1200r.o -obj-$(CONFIG_ATH79_MACH_MW316R_V1) += mach-mw316r-v1.o -obj-$(CONFIG_ATH79_MACH_MASELINK_AP2600I) += mach-maselink-ap2600i.o -obj-$(CONFIG_ATH79_MACH_MASELINK_AP2600IFM) += mach-maselink-ap2600ifm.o obj-$(CONFIG_ATH79_MACH_MR12) += mach-mr12.o obj-$(CONFIG_ATH79_MACH_MR16) += mach-mr16.o obj-$(CONFIG_ATH79_MACH_MR1750) += mach-mr1750.o @@ -178,8 +176,6 @@ obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o obj-$(CONFIG_ATH79_MACH_SC450) += mach-sc450.o -obj-$(CONFIG_ATH79_MACH_SGR_W500_N85B_V2) += mach-sgr-w500-n85b-v2.o -obj-$(CONFIG_ATH79_MACH_SGR_W500_EBI_FIT_V3) += mach-sgr-w500-ebi-fit-v3.o obj-$(CONFIG_ATH79_MACH_SMART_300) += mach-smart-300.o obj-$(CONFIG_ATH79_MACH_SOM9331) += mach-som9331.o obj-$(CONFIG_ATH79_MACH_SR3200) += mach-sr3200.o @@ -208,7 +204,6 @@ obj-$(CONFIG_ATH79_MACH_TL_WDR3320_V2) += mach-tl-wdr3320-v2.o obj-$(CONFIG_ATH79_MACH_TL_WDR3500) += mach-tl-wdr3500.o obj-$(CONFIG_ATH79_MACH_TL_WDR4300) += mach-tl-wdr4300.o obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V2) += mach-tl-wdr6500-v2.o -obj-$(CONFIG_ATH79_MACH_TL_WDR6500_V6) += mach-tl-wdr6500-v6.o obj-$(CONFIG_ATH79_MACH_TL_WPA8630) += mach-tl-wpa8630.o obj-$(CONFIG_ATH79_MACH_TL_WR1041N_V2) += mach-tl-wr1041n-v2.o obj-$(CONFIG_ATH79_MACH_TL_WR1043ND) += mach-tl-wr1043nd.o @@ -220,17 +215,16 @@ obj-$(CONFIG_ATH79_MACH_TL_WR720N_V3) += mach-tl-wr720n-v3.o obj-$(CONFIG_ATH79_MACH_TL_WR741ND) += mach-tl-wr741nd.o obj-$(CONFIG_ATH79_MACH_TL_WR741ND_V4) += mach-tl-wr741nd-v4.o obj-$(CONFIG_ATH79_MACH_TL_WR802N_V1) += mach-tl-wr802n.o -obj-$(CONFIG_ATH79_MACH_TL_WR802N_V2) += mach-tl-wr802n-v2.o +obj-$(CONFIG_ATH79_MACH_TL_WR802N_V2) += mach-tl-wr802n.o obj-$(CONFIG_ATH79_MACH_TL_WR810N) += mach-tl-wr810n.o +obj-$(CONFIG_ATH79_MACH_TL_WR810N_V2) += mach-tl-wr810n.o obj-$(CONFIG_ATH79_MACH_TL_WR840N_V2) += mach-tl-wr841n-v9.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V1) += mach-tl-wr841n.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V8) += mach-tl-wr841n-v8.o obj-$(CONFIG_ATH79_MACH_TL_WR841N_V9) += mach-tl-wr841n-v9.o -obj-$(CONFIG_ATH79_MACH_TL_WR882N_V1) += mach-tl-wr882n-v1.o obj-$(CONFIG_ATH79_MACH_TL_WR902AC_V1) += mach-tl-wr902ac-v1.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND) += mach-tl-wr941nd.o obj-$(CONFIG_ATH79_MACH_TL_WR941ND_V6) += mach-tl-wr941nd-v6.o -obj-$(CONFIG_ATH79_MACH_TL_WR941N_V7) += mach-tl-wr941n-v7.o obj-$(CONFIG_ATH79_MACH_TL_WR940N_V4) += mach-tl-wr940n-v4.o obj-$(CONFIG_ATH79_MACH_TL_WR942N_V1) += mach-tl-wr942n-v1.o obj-$(CONFIG_ATH79_MACH_TUBE2H) += mach-tube2h.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c index a9bb334a2..4ade218f7 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-dsa.c @@ -10,7 +10,6 @@ */ #include -#include #include #include @@ -30,11 +29,7 @@ void __init ath79_register_dsa(struct device *netdev, d->netdev = netdev; for (i = 0; i < d->nr_chips; i++) -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) - d->chip[i].mii_bus = miidev; -#else d->chip[i].host_dev = miidev; -#endif ar71xx_dsa_switch_device.dev.platform_data = d; platform_device_register(&ar71xx_dsa_switch_device); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c index a8b19b68b..427de6a50 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c @@ -996,6 +996,9 @@ void __init ath79_register_eth(unsigned int id) pdata->reset_bit = AR934X_RESET_GE0_MAC | AR934X_RESET_GE0_MDIO; pdata->set_speed = ar934x_set_speed_ge0; + + if (ath79_soc == ATH79_SOC_QCA9533) + pdata->disable_inline_checksum_engine = 1; } else { pdata->reset_bit = AR934X_RESET_GE1_MAC | AR934X_RESET_GE1_MDIO; @@ -1097,6 +1100,8 @@ void __init ath79_register_eth(unsigned int id) pdata->set_speed = qca956x_set_speed_sgmii; else pdata->set_speed = ar934x_set_speed_ge0; + + pdata->disable_inline_checksum_engine = 1; } else { pdata->reset_bit = QCA955X_RESET_GE1_MAC | QCA955X_RESET_GE1_MDIO; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c index 3c85a2055..c500c91a1 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c59-v1.c @@ -249,7 +249,7 @@ static void __init archer_c5x_v1_setup(void) ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; ath79_eth1_data.speed = SPEED_1000; ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_switch_data.phy_poll_mask |= BIT(4); + ath79_switch_data.phy_poll_mask |= BIT(0); ath79_switch_data.phy4_mii_en = 1; ath79_register_eth(1); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c index 21b8e8cf8..bfd2b2e6b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c @@ -83,7 +83,7 @@ static struct spi_gpio_platform_data archer_c7_v4_spi_data = { .num_chipselect = 1, }; -static u8 archer_c7_v4_ssr_initdata __initdata = 0xff; +static u8 archer_c7_v4_ssr_initdata = 0xff; static struct gen_74x164_chip_platform_data archer_c7_v4_ssr_data = { .base = ARCHER_C7_74HC_GPIO_BASE, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c index 7b01af515..144f5db74 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-c60.c @@ -180,7 +180,11 @@ static const struct mtd_ooblayout_ops c60_nand_ecclayout_ops = { static int c60_nand_scan_fixup(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif chip->ecc.size = 512; chip->ecc.strength = 4; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c index 584742389..b0894e37c 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dir-869-a1.c @@ -42,8 +42,8 @@ #define DIR869A1_GPIO_ENABLE_SWITCH 11 -#define DIR869A1_GPIO_LED_POWER 15 -#define DIR869A1_GPIO_LED_ORANGE 16 +#define DIR869A1_GPIO_LED_ORANGE 15 +#define DIR869A1_GPIO_LED_WHITE 16 #define DIR869A1_KEYS_POLL_INTERVAL 20 /* msecs */ #define DIR869A1_KEYS_DEBOUNCE_INTERVAL (3 * DIR869A1_KEYS_POLL_INTERVAL) @@ -59,17 +59,14 @@ static struct gpio_led dir869a1_leds_gpio[] __initdata = { { - /* Actually, this GPIO controls the LED power, - * while d-link:orange:status switches it between - * orange and white */ .name = "d-link:white:status", - .gpio = DIR869A1_GPIO_LED_POWER, + .gpio = DIR869A1_GPIO_LED_WHITE, .active_low = 1, }, { .name = "d-link:orange:status", .gpio = DIR869A1_GPIO_LED_ORANGE, - .active_low = 0, + .active_low = 1, }, }; diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c index 42839271d..870adbe08 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-dr344.c @@ -1,9 +1,10 @@ /* - * Wallys DR344 board support + * Wallys DR342/DR344 boards support * * Copyright (c) 2011 Qualcomm Atheros * Copyright (c) 2011-2012 Gabor Juhos * Copyright (c) 2015 Philippe Duchein + * Copyright (c) 2017 Piotr Dymacz * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -39,24 +40,51 @@ #include "dev-wmac.h" #include "machtypes.h" -#define DR344_GPIO_LED_SIG1 12 -#define DR344_GPIO_LED_SIG2 13 -#define DR344_GPIO_LED_SIG3 14 -#define DR344_GPIO_LED_SIG4 15 -#define DR344_GPIO_LED_STATUS 11 +#define DR34X_GPIO_LED_SIG1 12 +#define DR34X_GPIO_LED_SIG2 13 +#define DR34X_GPIO_LED_SIG3 14 +#define DR34X_GPIO_LED_SIG4 15 +#define DR34X_GPIO_LED_STATUS 11 #define DR344_GPIO_LED_LAN 17 #define DR344_GPIO_EXTERNAL_LNA0 18 #define DR344_GPIO_EXTERNAL_LNA1 19 -#define DR344_GPIO_BTN_RESET 16 +#define DR34X_GPIO_BTN_RESET 16 #define DR344_KEYS_POLL_INTERVAL 20 /* msecs */ #define DR344_KEYS_DEBOUNCE_INTERVAL (3 * DR344_KEYS_POLL_INTERVAL) -#define DR344_MAC0_OFFSET 0 -#define DR344_MAC1_OFFSET 8 -#define DR344_WMAC_CALDATA_OFFSET 0x1000 -#define DR344_PCIE_CALDATA_OFFSET 0x5000 +#define DR34X_MAC0_OFFSET 0 +#define DR34X_MAC1_OFFSET 8 +#define DR34X_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led dr342_leds_gpio[] __initdata = { + { + .name = "dr342:green:status", + .gpio = DR34X_GPIO_LED_STATUS, + .active_low = 1, + }, + { + .name = "dr342:green:sig1", + .gpio = DR34X_GPIO_LED_SIG1, + .active_low = 1, + }, + { + .name = "dr342:green:sig2", + .gpio = DR34X_GPIO_LED_SIG2, + .active_low = 1, + }, + { + .name = "dr342:green:sig3", + .gpio = DR34X_GPIO_LED_SIG3, + .active_low = 1, + }, + { + .name = "dr342:green:sig4", + .gpio = DR34X_GPIO_LED_SIG4, + .active_low = 1, + } +}; static struct gpio_led dr344_leds_gpio[] __initdata = { { @@ -66,96 +94,82 @@ static struct gpio_led dr344_leds_gpio[] __initdata = { }, { .name = "dr344:green:status", - .gpio = DR344_GPIO_LED_STATUS, + .gpio = DR34X_GPIO_LED_STATUS, .active_low = 1, }, { .name = "dr344:green:sig1", - .gpio = DR344_GPIO_LED_SIG1, + .gpio = DR34X_GPIO_LED_SIG1, .active_low = 1, }, { .name = "dr344:green:sig2", - .gpio = DR344_GPIO_LED_SIG2, + .gpio = DR34X_GPIO_LED_SIG2, .active_low = 1, }, { .name = "dr344:green:sig3", - .gpio = DR344_GPIO_LED_SIG3, + .gpio = DR34X_GPIO_LED_SIG3, .active_low = 1, }, { .name = "dr344:green:sig4", - .gpio = DR344_GPIO_LED_SIG4, + .gpio = DR34X_GPIO_LED_SIG4, .active_low = 1, } }; -static struct gpio_keys_button dr344_gpio_keys[] __initdata = { +static struct gpio_keys_button dr34x_gpio_keys[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, .debounce_interval = DR344_KEYS_DEBOUNCE_INTERVAL, - .gpio = DR344_GPIO_BTN_RESET, + .gpio = DR34X_GPIO_BTN_RESET, .active_low = 1, }, }; -static struct at803x_platform_data dr344_at803x_data = { +static struct at803x_platform_data dr34x_at803x_data = { .disable_smarteee = 1, .enable_rgmii_rx_delay = 1, .enable_rgmii_tx_delay = 1, }; -static struct mdio_board_info dr344_mdio0_info[] = { +static struct mdio_board_info dr34x_mdio0_info[] = { { .bus_id = "ag71xx-mdio.0", .phy_addr = 0, - .platform_data = &dr344_at803x_data, + .platform_data = &dr34x_at803x_data, }, }; -static void __init dr344_setup(void) +static void __init dr34x_setup(void) { u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); u8 *mac = (u8 *) KSEG1ADDR(0x1f03f810); ath79_register_m25p80(NULL); - ath79_gpio_direction_select(DR344_GPIO_LED_STATUS, true); - gpio_set_value(DR344_GPIO_LED_STATUS, 1); - ath79_gpio_output_select(DR344_GPIO_LED_STATUS, 0); + ath79_gpio_direction_select(DR34X_GPIO_LED_STATUS, true); + gpio_set_value(DR34X_GPIO_LED_STATUS, 1); + ath79_gpio_output_select(DR34X_GPIO_LED_STATUS, 0); - ath79_gpio_direction_select(DR344_GPIO_LED_LAN, true); - gpio_set_value(DR344_GPIO_LED_LAN, 1); - ath79_gpio_output_select(DR344_GPIO_LED_LAN, 0); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(dr344_leds_gpio), - dr344_leds_gpio); ath79_register_gpio_keys_polled(-1, DR344_KEYS_POLL_INTERVAL, - ARRAY_SIZE(dr344_gpio_keys), - dr344_gpio_keys); + ARRAY_SIZE(dr34x_gpio_keys), + dr34x_gpio_keys); ath79_register_usb(); - ath79_wmac_set_ext_lna_gpio(0, DR344_GPIO_EXTERNAL_LNA0); - - ath79_wmac_set_ext_lna_gpio(1, DR344_GPIO_EXTERNAL_LNA1); - - ath79_register_wmac(art + DR344_WMAC_CALDATA_OFFSET, NULL); + ath79_register_wmac(art + DR34X_WMAC_CALDATA_OFFSET, NULL); ath79_register_pci(); - mdiobus_register_board_info(dr344_mdio0_info, - ARRAY_SIZE(dr344_mdio0_info)); + mdiobus_register_board_info(dr34x_mdio0_info, + ARRAY_SIZE(dr34x_mdio0_info)); - ath79_register_mdio(1, 0x0); ath79_register_mdio(0, 0x0); - ath79_init_mac(ath79_eth0_data.mac_addr, mac + DR344_MAC0_OFFSET, 0); - ath79_init_mac(ath79_eth1_data.mac_addr, mac + DR344_MAC1_OFFSET, 0); - ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | AR934X_ETH_CFG_SW_ONLY_MODE); @@ -167,13 +181,44 @@ static void __init dr344_setup(void) ath79_eth0_pll_data.pll_100 = 0x0101; ath79_eth0_pll_data.pll_10 = 0x1313; + ath79_init_mac(ath79_eth0_data.mac_addr, mac + DR34X_MAC0_OFFSET, 0); + ath79_register_eth(0); +} + +static void __init dr342_setup(void) +{ + dr34x_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(dr342_leds_gpio), + dr342_leds_gpio); +} + +static void __init dr344_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f03f810); + + dr34x_setup(); + + ath79_gpio_direction_select(DR344_GPIO_LED_LAN, true); + gpio_set_value(DR344_GPIO_LED_LAN, 1); + ath79_gpio_output_select(DR344_GPIO_LED_LAN, 0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(dr344_leds_gpio), + dr344_leds_gpio); + + ath79_wmac_set_ext_lna_gpio(0, DR344_GPIO_EXTERNAL_LNA0); + ath79_wmac_set_ext_lna_gpio(1, DR344_GPIO_EXTERNAL_LNA1); + + ath79_register_mdio(1, 0x0); + /* GMAC1 is connected to the internal switch */ 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(0); + ath79_init_mac(ath79_eth1_data.mac_addr, mac + DR34X_MAC1_OFFSET, 0); ath79_register_eth(1); } +MIPS_MACHINE(ATH79_MACH_DR342, "DR342", "Wallys DR342", dr342_setup); MIPS_MACHINE(ATH79_MACH_DR344, "DR344", "Wallys DR344", dr344_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c index e0d1ea438..df5278491 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar150.c @@ -42,17 +42,17 @@ static struct gpio_led gl_ar150_leds_gpio[] __initdata = { { - .name = "gl-ar150:wlan", + .name = "gl-ar150:orange:wlan", .gpio = GL_AR150_GPIO_LED_WLAN, .active_low = 0, }, { - .name = "gl-ar150:lan", + .name = "gl-ar150:green:lan", .gpio = GL_AR150_GPIO_LED_LAN, .active_low = 0, }, { - .name = "gl-ar150:wan", + .name = "gl-ar150:green:wan", .gpio = GL_AR150_GPIO_LED_WAN, .active_low = 0, .default_state = 1, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c index ca44b364c..c4e537f86 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar300m.c @@ -58,7 +58,7 @@ static struct gpio_led gl_ar300m_leds_gpio[] __initdata = { .active_low = 1, }, { - .name = "gl-ar300m::green:lan", + .name = "gl-ar300m:green:lan", .gpio = GL_AR300M_GPIO_LED_LAN, .active_low = 1, }, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c deleted file mode 100644 index ad16b3daa..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600i.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Comba MASELink AP2600-I board support - * - * Copyright (c) 2016 Weijie Gao - * - * 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 -#include -#include -#include -#include - -#include - -#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-nfc.h" -#include "dev-spi.h" -#include "dev-usb.h" -#include "dev-wmac.h" -#include "machtypes.h" - -#define AP2600I_GPIO_LED_POWER_RED 11 -#define AP2600I_GPIO_LED_POWER_GREEN 12 -#define AP2600I_GPIO_LED_RUN 13 -#define AP2600I_GPIO_LED_WLAN 14 - -#define AP2600I_GPIO_BUTTON_RESET 15 - -#define AP2600I_KEYS_POLL_INTERVAL 20 /* msecs */ -#define AP2600I_KEYS_DEBOUNCE_INTERVAL (3 * AP2600I_KEYS_POLL_INTERVAL) - -#define AP2600I_MAC0_OFFSET 0 -#define AP2600I_WMAC_CALDATA_OFFSET 0x1000 -#define AP2600I_PCIE_CALDATA_OFFSET 0x5000 - -static struct gpio_led ap2600i_leds_gpio[] __initdata = { - { - .name = "ap2600i:red:power", - .gpio = AP2600I_GPIO_LED_POWER_RED, - .active_low = 1, - }, - { - .name = "ap2600i:green:power", - .gpio = AP2600I_GPIO_LED_POWER_GREEN, - .active_low = 1, - }, - { - .name = "ap2600i:green:run", - .gpio = AP2600I_GPIO_LED_RUN, - .active_low = 1, - }, - { - .name = "ap2600i:green:wlan", - .gpio = AP2600I_GPIO_LED_WLAN, - .active_low = 1, - } -}; - -static struct gpio_keys_button ap2600i_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = AP2600I_KEYS_DEBOUNCE_INTERVAL, - .gpio = AP2600I_GPIO_BUTTON_RESET, - .active_low = 1, - }, -}; - -static struct at803x_platform_data ap2600i_ar8035_data = { - .enable_rgmii_rx_delay = 1, - .fixup_rgmii_tx_delay = 1, -}; - -static struct mdio_board_info ap2600i_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 4, - .platform_data = &ap2600i_ar8035_data, - }, -}; - -static void __init ap2600i_setup(void) -{ - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - - ath79_register_m25p80(NULL); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap2600i_leds_gpio), - ap2600i_leds_gpio); - ath79_register_gpio_keys_polled(-1, AP2600I_KEYS_POLL_INTERVAL, - ARRAY_SIZE(ap2600i_gpio_keys), - ap2600i_gpio_keys); - - ath79_register_wmac(art + AP2600I_WMAC_CALDATA_OFFSET, NULL); - ap91_pci_init(art + AP2600I_PCIE_CALDATA_OFFSET, NULL); - - ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0 | - AR934X_ETH_CFG_SW_ONLY_MODE); - - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, art + AP2600I_MAC0_OFFSET, 0); - - mdiobus_register_board_info(ap2600i_mdio0_info, - ARRAY_SIZE(ap2600i_mdio0_info)); - - /* GMAC0 is connected to an AR8035 Gigabit PHY */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; - ath79_eth0_data.phy_mask = BIT(4); - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_eth0_pll_data.pll_1000 = 0x0e000000; - ath79_eth0_pll_data.pll_100 = 0x0101; - ath79_eth0_pll_data.pll_10 = 0x1313; - ath79_register_eth(0); -} - -MIPS_MACHINE(ATH79_MACH_MASELINK_AP2600I, "AP2600I", "Comba MASELink AP2600-I", - ap2600i_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c deleted file mode 100644 index cffc64138..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-maselink-ap2600ifm.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Comba MASELink AP2600-IFM board support - * - * Copyright (c) 2017 Weijie Gao - * - * 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 -#include -#include - -#include -#include - -#include "pci.h" -#include "common.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 "machtypes.h" -#include "nvram.h" - -#define AP2600IFM_GPIO_LED_RF1 2 -#define AP2600IFM_GPIO_LED_RF1_TOP 7 -#define AP2600IFM_GPIO_LED_RF2 4 -#define AP2600IFM_GPIO_LED_RF2_TOP 5 -#define AP2600IFM_GPIO_LED_D24 0 -#define AP2600IFM_GPIO_LED_D24_TOP 3 - -#define AP2600IFM_GPIO_BUTTON_RESET 8 - -#define AP2600IFM_KEYS_POLL_INTERVAL 20 /* msecs */ -#define AP2600IFM_KEYS_DEBOUNCE_INTERVAL (3 * AP2600IFM_KEYS_POLL_INTERVAL) - -#define AP2600IFM_NVRAM_ADDR 0x1f040004 -#define AP2600IFM_NVRAM_SIZE 0x3fffc - -static struct gpio_led ap2600ifm_leds_gpio[] __initdata = { - { - .name = "ap2600ifm:green:rf1", - .gpio = AP2600IFM_GPIO_LED_RF1, - .active_low = 1, - }, - { - .name = "ap2600ifm:green:rf1top", - .gpio = AP2600IFM_GPIO_LED_RF1_TOP, - .active_low = 1, - }, - { - .name = "ap2600ifm:green:rf2", - .gpio = AP2600IFM_GPIO_LED_RF2, - .active_low = 1, - }, - { - .name = "ap2600ifm:green:rf2top", - .gpio = AP2600IFM_GPIO_LED_RF2_TOP, - .active_low = 1, - }, - { - .name = "ap2600ifm:green:d24", - .gpio = AP2600IFM_GPIO_LED_D24, - .active_low = 1, - }, - { - .name = "ap2600ifm:green:d24top", - .gpio = AP2600IFM_GPIO_LED_D24_TOP, - .active_low = 1, - } -}; - -static struct gpio_keys_button ap2600ifm_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = AP2600IFM_KEYS_DEBOUNCE_INTERVAL, - .gpio = AP2600IFM_GPIO_BUTTON_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info ap2600ifm_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 20, - }, -}; - -static void ap2600ifm_get_mac(const char *name, char *mac) -{ - u8 *nvram = (u8 *) KSEG1ADDR(AP2600IFM_NVRAM_ADDR); - int err; - - err = ath79_nvram_parse_mac_addr(nvram, AP2600IFM_NVRAM_SIZE, - name, mac); - if (err) - pr_err("%s not found in environment variables\n", name); -} - -static void __init ap2600ifm_setup(void) -{ - ath79_register_m25p80(NULL); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(ap2600ifm_leds_gpio), - ap2600ifm_leds_gpio); - ath79_register_gpio_keys_polled(-1, AP2600IFM_KEYS_POLL_INTERVAL, - ARRAY_SIZE(ap2600ifm_gpio_keys), - ap2600ifm_gpio_keys); - - ath79_register_pci(); - - ath79_register_mdio(0, 0); - - mdiobus_register_board_info(ap2600ifm_mdio0_info, - ARRAY_SIZE(ap2600ifm_mdio0_info)); - - ap2600ifm_get_mac("macaddr=", ath79_eth0_data.mac_addr); - - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; - ath79_eth0_data.phy_mask = BIT(20); - ath79_eth0_data.speed = SPEED_1000; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_pll_data.pll_1000 = 0x00110000; - ath79_eth0_pll_data.pll_100 = 0x0001099; - ath79_eth0_pll_data.pll_10 = 0x00991099; - - ath79_register_eth(0); -} - -MIPS_MACHINE(ATH79_MACH_MASELINK_AP2600IFM, "AP2600IFM", "Comba MASELink AP2600-IFM", - ap2600ifm_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c deleted file mode 100644 index 9b9e23faf..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-mw316r-v1.c +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Mercury MW316R v1 - * - * Copyright (C) 2014 Matthias Schiffer - * Copyright (C) 2017 Weijie Gao - * - * 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 -#include - -#include -#include - -#include "common.h" -#include "dev-eth.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-wmac.h" -#include "dev-usb.h" -#include "machtypes.h" - -#define MW316RV1_GPIO_LED_SYS 13 -#define MW316RV1_GPIO_LED_WAN 4 -#define MW316RV1_GPIO_LED_LAN1 11 -#define MW316RV1_GPIO_LED_LAN2 14 -#define MW316RV1_GPIO_LED_LAN3 15 -#define MW316RV1_GPIO_LED_LAN4 16 -#define MW316RV1_GPIO_LED_TURBO 17 - -#define MW316RV1_GPIO_BTN_RESET 12 -#define MW316RV1_GPIO_BTN_TURBO 1 - -#define MW316RV1_KEYS_POLL_INTERVAL 20 /* msecs */ -#define MW316RV1_KEYS_DEBOUNCE_INTERVAL (3 * MW316RV1_KEYS_POLL_INTERVAL) - -static const char *mw316r_v1_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data mw316r_v1_flash_data = { - .part_probes = mw316r_v1_part_probes, -}; - -static struct gpio_led mw316r_v1_leds_gpio[] __initdata = { - { - .name = "mercury:green:wan", - .gpio = MW316RV1_GPIO_LED_WAN, - .active_low = 1, - }, { - .name = "mercury:green:lan1", - .gpio = MW316RV1_GPIO_LED_LAN1, - .active_low = 1, - }, { - .name = "mercury:green:lan2", - .gpio = MW316RV1_GPIO_LED_LAN2, - .active_low = 1, - }, { - .name = "mercury:green:lan3", - .gpio = MW316RV1_GPIO_LED_LAN3, - .active_low = 1, - }, { - .name = "mercury:green:lan4", - .gpio = MW316RV1_GPIO_LED_LAN4, - .active_low = 1, - }, { - .name = "mercury:green:system", - .gpio = MW316RV1_GPIO_LED_SYS, - .active_low = 1, - }, { - .name = "mercury:green:turbo", - .gpio = MW316RV1_GPIO_LED_TURBO, - .active_low = 1, - }, -}; - -static struct gpio_keys_button mw316r_v1_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = MW316RV1_KEYS_DEBOUNCE_INTERVAL, - .gpio = MW316RV1_GPIO_BTN_RESET, - .active_low = 1, - }, { - .desc = "turbo", - .type = EV_KEY, - .code = BTN_0, - .debounce_interval = MW316RV1_KEYS_DEBOUNCE_INTERVAL, - .gpio = MW316RV1_GPIO_BTN_TURBO, - .active_low = 1, - } -}; - - -static void __init mw316r_v1_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; - - ath79_register_m25p80(&mw316r_v1_flash_data); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(mw316r_v1_leds_gpio), - mw316r_v1_leds_gpio); - - ath79_register_gpio_keys_polled(1, MW316RV1_KEYS_POLL_INTERVAL, - ARRAY_SIZE(mw316r_v1_gpio_keys), - mw316r_v1_gpio_keys); - - ath79_setup_ar933x_phy4_switch(false, false); - - ath79_register_mdio(0, 0x0); - - /* WAN */ - ath79_switch_data.phy_poll_mask |= BIT(4); - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - ath79_register_eth(0); - - /* LAN */ - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; - ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 1); - ath79_register_eth(1); - - ath79_init_mac(tmpmac, mac, 1); - ath79_register_wmac(ee, tmpmac); - - ath79_register_usb(); -} - -MIPS_MACHINE(ATH79_MACH_MW316R_V1, "MW316R-v1", "Mercury MW316R v1", - mw316r_v1_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c index ae0a772d5..722993ff9 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb4xx.c @@ -11,12 +11,7 @@ #include #include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) -#include -#else #include -#endif #include #include #include diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c index 577fb0eee..2f54d029f 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb922.c @@ -195,7 +195,9 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd) { #if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; -#endif +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif /* < 4.6.0 */ if (mtd->writesize == 512) { /* @@ -209,6 +211,8 @@ static int rb922gs_nand_scan_fixup(struct mtd_info *mtd) #endif } + chip->options = NAND_NO_SUBPAGE_WRITE; + return 0; } @@ -252,7 +256,7 @@ static void __init rb922gs_setup(void) if (!info) return; - scnprintf(buf, sizeof(buf), "Mikrotik RouterBOARD %s", + scnprintf(buf, sizeof(buf), "MikroTik RouterBOARD %s", (info->board_name) ? info->board_name : ""); mips_set_machine_name(buf); @@ -272,9 +276,16 @@ static void __init rb922gs_setup(void) ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; ath79_eth0_data.phy_mask = BIT(RB922_PHY_ADDR); - ath79_eth0_pll_data.pll_10 = 0x81001313; - ath79_eth0_pll_data.pll_100 = 0x81000101; - ath79_eth0_pll_data.pll_1000 = 0x8f000000; + if (strcmp(info->board_name, "921GS-5HPacD r2") == 0) { + ath79_eth0_pll_data.pll_10 = 0xa0001313; + ath79_eth0_pll_data.pll_100 = 0xa0000101; + ath79_eth0_pll_data.pll_1000 = 0x8f000000; + } + else { + ath79_eth0_pll_data.pll_10 = 0x81001313; + ath79_eth0_pll_data.pll_100 = 0x81000101; + ath79_eth0_pll_data.pll_1000 = 0x8f000000; + } ath79_register_eth(0); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c index 9eaeaa7f9..5e24694d5 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb95x.c @@ -207,7 +207,11 @@ static const struct mtd_ooblayout_ops rb95x_nand_ecclayout_ops = { static int rb95x_nand_scan_fixup(struct mtd_info *mtd) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0) struct nand_chip *chip = mtd->priv; +#else + struct nand_chip *chip = mtd_to_nand(mtd); +#endif /* < 4.6.0 */ if (mtd->writesize == 512) { /* diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index 4cdc171de..cfd737316 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -1,6 +1,7 @@ /* * MikroTik SPI-NOR RouterBOARDs support * + * - MikroTik RouterBOARD mAP 2nD * - MikroTik RouterBOARD mAP L-2nD * - MikroTik RouterBOARD 941L-2nD * - MikroTik RouterBOARD 951Ui-2nD @@ -10,11 +11,10 @@ * - MikroTik RouterBOARD 750P-PBr2 * - MikroTik RouterBOARD 750 r2 * - MikroTik RouterBOARD LHG 5nD + * - MikroTik RouterBOARD wAP2nD * * Preliminary support for the following hardware - * - MikroTik RouterBOARD wAP2nD * - MikroTik RouterBOARD cAP2nD - * - MikroTik RouterBOARD mAP2nD * Furthermore, the cAP lite (cAPL2nD) appears to feature the exact same * hardware as the mAP L-2nD. It is unknown if they share the same board * identifier. @@ -405,7 +405,7 @@ static struct gpio_led rbmap_leds[] __initdata = { .active_low = 1, }, { .name = "rb:green:eth2", - .gpio = RBMAP_GPIO_LED_WLAN, + .gpio = RBMAP_GPIO_LED_LAN2, .active_low = 1, }, { .name = "rb:red:poe_out", @@ -488,6 +488,7 @@ static struct gpio_keys_button rblhg_gpio_keys[] __initdata = { static struct gen_74x164_chip_platform_data rbspi_ssr_data = { .base = RBSPI_SSR_GPIO_BASE, + .num_registers = 1, }; /* the spi-ath79 driver can only natively handle CS0. Other CS are bit-banged */ @@ -872,7 +873,7 @@ static void __init rblhg_setup(void) } /* - * Init the wAP hardware (EXPERIMENTAL). + * Init the wAP hardware. * The wAP 2nD has a single ethernet port. */ static void __init rbwap_setup(void) @@ -888,6 +889,11 @@ static void __init rbwap_setup(void) rbspi_network_setup(flags, 0, 1, 0); ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwap_leds), rbwap_leds); + + /* wAP has a single reset button as GPIO 16 */ + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset16), + rbspi_gpio_keys_reset16); } /* @@ -914,13 +920,14 @@ static void __init rbcap_setup(void) } /* - * Init the mAP hardware (EXPERIMENTAL). - * The mAP 2nD has two ethernet ports, PoE output and an SSR for LED - * multiplexing. + * Init the mAP hardware. + * The mAP 2nD has two ethernet ports, PoE output, SSR for LED + * multiplexing and USB port. */ static void __init rbmap_setup(void) { - u32 flags = RBSPI_HAS_WLAN0 | RBSPI_HAS_SSR | RBSPI_HAS_POE; + u32 flags = RBSPI_HAS_USB | RBSPI_HAS_WLAN0 | + RBSPI_HAS_SSR | RBSPI_HAS_POE; if (rbspi_platform_setup()) return; @@ -933,10 +940,22 @@ static void __init rbmap_setup(void) if (flags & RBSPI_HAS_POE) gpio_request_one(RBMAP_GPIO_POE_POWER, - GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, "POE power"); + /* USB power GPIO is inverted, set GPIOF_ACTIVE_LOW for consistency */ + if (flags & RBSPI_HAS_USB) + gpio_request_one(RBMAP_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_ACTIVE_LOW | + GPIOF_EXPORT_DIR_FIXED, + "USB power"); + ath79_register_leds_gpio(-1, ARRAY_SIZE(rbmap_leds), rbmap_leds); + + /* mAP 2nD has a single reset button as gpio 16 */ + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset16), + rbspi_gpio_keys_reset16); } diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c deleted file mode 100644 index 742da3ba3..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-ebi-fit-v3.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * GRENTECH SGR-W500-EBI(FIT) v3.0 board support - * - * Copyright (c) 2017 Weijie Gao - * - * 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 -#include -#include - -#include -#include - -#include "pci.h" -#include "common.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 "machtypes.h" - -#define GRENTECH_GPIO_LED_STATUS 5 -#define GRENTECH_GPIO_LED_WAN 4 -#define GRENTECH_GPIO_LED_WLAN 3 - -#define GRENTECH_GPIO_BUTTON_RESET 8 - -#define GRENTECH_KEYS_POLL_INTERVAL 20 /* msecs */ -#define GRENTECH_KEYS_DEBOUNCE_INTERVAL (3 * GRENTECH_KEYS_POLL_INTERVAL) - -static struct gpio_led grentech_leds_gpio[] __initdata = { - { - .name = "grentech:green:status", - .gpio = GRENTECH_GPIO_LED_STATUS, - .active_low = 1, - }, - { - .name = "grentech:green:wan", - .gpio = GRENTECH_GPIO_LED_WAN, - .active_low = 0, - }, - { - .name = "grentech:green:wlan", - .gpio = GRENTECH_GPIO_LED_WLAN, - .active_low = 0, - } -}; - -static struct gpio_keys_button grentech_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = GRENTECH_KEYS_DEBOUNCE_INTERVAL, - .gpio = GRENTECH_GPIO_BUTTON_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info grentech_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 1, - }, -}; - -static void __init grentech_setup(void) -{ - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - - ath79_register_m25p80(NULL); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(grentech_leds_gpio), - grentech_leds_gpio); - ath79_register_gpio_keys_polled(-1, GRENTECH_KEYS_POLL_INTERVAL, - ARRAY_SIZE(grentech_gpio_keys), - grentech_gpio_keys); - - ath79_register_pci(); - - ath79_register_mdio(0, 0); - - mdiobus_register_board_info(grentech_mdio0_info, - ARRAY_SIZE(grentech_mdio0_info)); - - ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); - - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; - ath79_eth0_data.phy_mask = BIT(1); - ath79_eth0_data.speed = SPEED_1000; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_pll_data.pll_1000 = 0x00110000; - ath79_eth0_pll_data.pll_100 = 0x0001099; - ath79_eth0_pll_data.pll_10 = 0x00991099; - - ath79_register_eth(0); -} - -MIPS_MACHINE(ATH79_MACH_SGR_W500_EBI_FIT_V3, "SGRW500EBIFITV3", "GRENTECH SGR-W500-EBI(FIT) v3.0", - grentech_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c deleted file mode 100755 index d2749e483..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-sgr-w500-n85b-v2.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * GRENTECH SGR-W500-N85b v2.0 board support - * - * Copyright (c) 2017 Weijie Gao - * - * 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 -#include -#include -#include -#include - -#include - -#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-wmac.h" -#include "machtypes.h" - -#define GRENTECH_GPIO_LED_STATUS 21 -#define GRENTECH_GPIO_LED_WLAN2G 20 - -#define GRENTECH_GPIO_BUTTON_RESET 3 - -#define GRENTECH_GPIO_RTL8211E_RESET_L 11 - -#define GRENTECH_GPIO_EXTERNAL_LNA0 18 -#define GRENTECH_GPIO_EXTERNAL_LNA1 19 - -#define GRENTECH_KEYS_POLL_INTERVAL 20 /* msecs */ -#define GRENTECH_KEYS_DEBOUNCE_INTERVAL (3 * GRENTECH_KEYS_POLL_INTERVAL) - -#define GRENTECH_MAC_OFFSET 0 -#define GRENTECH_WMAC_CALDATA_OFFSET 0x1000 -#define GRENTECH_PCIE_CALDATA_OFFSET 0x5000 - -static struct gpio_led grentech_leds_gpio[] __initdata = { - { - .name = "grentech:green:status", - .gpio = GRENTECH_GPIO_LED_STATUS, - .active_low = 1, - }, - { - .name = "grentech:green:wlan2g", - .gpio = GRENTECH_GPIO_LED_WLAN2G, - .active_low = 1, - } -}; - -static struct gpio_keys_button grentech_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = GRENTECH_KEYS_DEBOUNCE_INTERVAL, - .gpio = GRENTECH_GPIO_BUTTON_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info grentech_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 1, - }, -}; - -static void __init grentech_setup(void) -{ - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - u8 tmpmac[ETH_ALEN]; - - ath79_register_m25p80(NULL); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(grentech_leds_gpio), - grentech_leds_gpio); - ath79_register_gpio_keys_polled(-1, GRENTECH_KEYS_POLL_INTERVAL, - ARRAY_SIZE(grentech_gpio_keys), - grentech_gpio_keys); - - gpio_request_one(GRENTECH_GPIO_RTL8211E_RESET_L, - GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, - "RTL8211E reset pin"); - - ath79_wmac_set_ext_lna_gpio(0, GRENTECH_GPIO_EXTERNAL_LNA0); - ath79_wmac_set_ext_lna_gpio(1, GRENTECH_GPIO_EXTERNAL_LNA1); - - ath79_init_mac(tmpmac, art + GRENTECH_MAC_OFFSET, 1); - ath79_register_wmac(art + GRENTECH_WMAC_CALDATA_OFFSET, tmpmac); - - /* AR9382 */ - ath79_init_mac(tmpmac, art + GRENTECH_MAC_OFFSET, 2); - ap9x_pci_setup_wmac_led_pin(0, 6); - ap91_pci_init(art + GRENTECH_PCIE_CALDATA_OFFSET, tmpmac); - - ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_RGMII_GMAC0); - - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, art + GRENTECH_MAC_OFFSET, 0); - - mdiobus_register_board_info(grentech_mdio0_info, - ARRAY_SIZE(grentech_mdio0_info)); - - /* GMAC0 is connected to a RTL8211E Gigabit PHY */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII; - ath79_eth0_data.phy_mask = BIT(1); - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_eth0_pll_data.pll_1000 = 0x46000000; - ath79_eth0_pll_data.pll_100 = 0x0101; - ath79_eth0_pll_data.pll_10 = 0x1313; - ath79_register_eth(0); -} - -MIPS_MACHINE(ATH79_MACH_SGR_W500_N85B_V2, "SGRW500N85BV2", "GRENTECH SGR-W500-N85b v2.0", - grentech_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c index 9c651bb1d..ffbcd6fe4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wa901nd-v4.c @@ -1,5 +1,5 @@ /* - * TP-LINK TL-WA901ND v4 board + * TP-LINK TL-WA901ND v4, v5 board * * Copyright (C) 2015 Matthias Schiffer * Copyright (C) 2016 Tiziano Bacocco @@ -110,3 +110,6 @@ static void __init TL_WA901ND_V4_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V4, "TL-WA901ND-v4", "TP-LINK TL-WA901ND v4", TL_WA901ND_V4_setup); + +MIPS_MACHINE(ATH79_MACH_TL_WA901ND_V5, "TL-WA901ND-v5", "TP-LINK TL-WA901ND v5", + TL_WA901ND_V4_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c deleted file mode 100644 index c4178d9dc..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr6500-v6.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * TP-LINK TL-WDR6500 v6 - * - * Copyright (C) 2015 Weijie Gao - * - * 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 -#include -#include - -#include -#include - -#include "common.h" -#include "dev-eth.h" -#include "dev-ap9x-pci.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-usb.h" -#include "dev-wmac.h" -#include "machtypes.h" -#include "pci.h" - -#define TL_WDR6500_V6_GPIO_LED_SYS 21 -#define TL_WDR6500_V6_GPIO_LED_WAN 18 -#define TL_WDR6500_V6_GPIO_LED_LAN1 17 -#define TL_WDR6500_V6_GPIO_LED_LAN2 16 -#define TL_WDR6500_V6_GPIO_LED_LAN3 15 -#define TL_WDR6500_V6_GPIO_LED_LAN4 14 - -#define TL_WDR6500_V6_GPIO_BTN_RESET 1 - -#define TL_WDR6500_V6_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL (3 * TL_WDR6500_V6_KEYS_POLL_INTERVAL) - -#define TL_WDR6500_V6_WMAC_CALDATA_OFFSET 0x1000 -#define TL_WDR6500_V6_PCIE_CALDATA_OFFSET 0x2000 - -static const char *tl_wdr6500_v6_part_probes[] = { - "tp-link-64k", - NULL, -}; - -static struct flash_platform_data tl_wdr6500_v6_flash_data = { - .part_probes = tl_wdr6500_v6_part_probes, -}; - -static struct gpio_led tl_wdr6500_v6_leds_gpio[] __initdata = { - { - .name = "tp-link:green:lan1", - .gpio = TL_WDR6500_V6_GPIO_LED_LAN1, - .active_low = 1, - }, { - .name = "tp-link:green:lan2", - .gpio = TL_WDR6500_V6_GPIO_LED_LAN2, - .active_low = 1, - }, { - .name = "tp-link:green:lan3", - .gpio = TL_WDR6500_V6_GPIO_LED_LAN3, - .active_low = 1, - }, { - .name = "tp-link:green:lan4", - .gpio = TL_WDR6500_V6_GPIO_LED_LAN4, - .active_low = 1, - }, { - .name = "tp-link:green:wan", - .gpio = TL_WDR6500_V6_GPIO_LED_WAN, - .active_low = 1, - }, { - .name = "tp-link:white:system", - .gpio = TL_WDR6500_V6_GPIO_LED_SYS, - .active_low = 0, - }, -}; - -static struct gpio_keys_button tl_wdr6500_v6_gpio_keys[] __initdata = { - { - .desc = "Reset button", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = TL_WDR6500_V6_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WDR6500_V6_GPIO_BTN_RESET, - .active_low = 1, - } -}; - - -static void __init tl_ap151_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1fff080d); - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - u8 tmpmac[ETH_ALEN]; - - ath79_register_m25p80(&tl_wdr6500_v6_flash_data); - - ath79_setup_ar933x_phy4_switch(false, false); - - ath79_register_mdio(1, 0x0); - - /* WAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_switch_data.phy_poll_mask = BIT(4); - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.phy_mask = BIT(4); - ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - - /* LAN */ - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; - ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_eth1_data.speed = SPEED_1000; - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); - ath79_register_eth(1); - - ath79_init_mac(tmpmac, mac, -1); - ath79_register_wmac(art + TL_WDR6500_V6_WMAC_CALDATA_OFFSET, tmpmac); - - ap91_pci_init(art + TL_WDR6500_V6_PCIE_CALDATA_OFFSET, NULL); -} - -static void __init tl_wdr6500_v6_setup(void) -{ - tl_ap151_setup(); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wdr6500_v6_leds_gpio), - tl_wdr6500_v6_leds_gpio); - - ath79_register_gpio_keys_polled(1, TL_WDR6500_V6_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wdr6500_v6_gpio_keys), - tl_wdr6500_v6_gpio_keys); -} - -MIPS_MACHINE(ATH79_MACH_TL_WDR6500_V6, "TL-WDR6500-v6", "TP-LINK TL-WDR6500 v6", - tl_wdr6500_v6_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c index b1539c5d7..450819a9e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v4.c @@ -5,6 +5,7 @@ * Copyright (C) 2016 Matthias Schiffer * Copyright (C) 2016 Andreas Ziegler * Copyright (C) 2016 Ludwig Thomeczek + * Copyright (C) 2017 Tim Thorpe * * Derived from: mach-dir-869-a1.c * @@ -62,6 +63,8 @@ #define TL_WR1043_V4_EEPROM_ADDR 0x1fff0000 #define TL_WR1043_V4_WMAC_CALDATA_OFFSET 0x1000 +#define TL_WR1043N_V5_MAC_LOCATION 0x1ff00008 + static struct gpio_led tl_wr1043nd_v4_leds_gpio[] __initdata = { { .name = "tp-link:green:wps", @@ -188,3 +191,82 @@ static void __init tl_wr1043nd_v4_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WR1043ND_V4, "TL-WR1043ND-v4", "TP-LINK TL-WR1043ND v4", tl_wr1043nd_v4_setup); + +static struct gpio_led tl_wr1043n_v5_leds_gpio[] __initdata = { + { + .name = "tp-link:green:wps", + .gpio = TL_WR1043_V4_GPIO_LED_WPS, + .active_low = 1, + }, + { + .name = "tp-link:green:system", + .gpio = TL_WR1043_V4_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "tp-link:green:wlan", + .gpio = TL_WR1043_V4_GPIO_LED_WLAN, + .active_low = 1, + }, + { + .name = "tp-link:green:wan", + .gpio = TL_WR1043_V4_GPIO_LED_WAN, + .active_low = 1, + }, + { + .name = "tp-link:green:lan1", + .gpio = TL_WR1043_V4_GPIO_LED_LAN1, + .active_low = 1, + }, + { + .name = "tp-link:green:lan2", + .gpio = TL_WR1043_V4_GPIO_LED_LAN2, + .active_low = 1, + }, + { + .name = "tp-link:green:lan3", + .gpio = TL_WR1043_V4_GPIO_LED_LAN3, + .active_low = 1, + }, + { + .name = "tp-link:green:lan4", + .gpio = TL_WR1043_V4_GPIO_LED_LAN4, + .active_low = 1, + }, +}; + +/* The 1043Nv5 is identical to the 1043NDv4, + * only missing the usb and small firmware layout changes */ +static void __init tl_wr1043nv5_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(TL_WR1043_V4_EEPROM_ADDR); + u8 *mac = (u8 *) KSEG1ADDR(TL_WR1043N_V5_MAC_LOCATION); + + ath79_register_m25p80(NULL); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr1043n_v5_leds_gpio), + tl_wr1043n_v5_leds_gpio); + ath79_register_gpio_keys_polled(-1, TL_WR1043_V4_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr1043nd_v4_gpio_keys), + tl_wr1043nd_v4_gpio_keys); + + platform_device_register(&ath79_mdio0_device); + + mdiobus_register_board_info(tl_wr1043nd_v4_mdio0_info, + ARRAY_SIZE(tl_wr1043nd_v4_mdio0_info)); + + ath79_register_wmac(art + TL_WR1043_V4_WMAC_CALDATA_OFFSET, mac); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + + /* GMAC0 is connected to an AR8337 switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth0_data.speed = SPEED_1000; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR1043N_V5, "TL-WR1043N-v5", "TP-LINK TL-WR1043N v5", + tl_wr1043nv5_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c deleted file mode 100644 index 10e0c595a..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n-v2.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * TP-LINK TL-WR802N v2 - * - * Copyright (C) 2016 Thomas Roberts > - * - * 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 -#include - -#include -#include - -#include "common.h" -#include "dev-eth.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-wmac.h" -#include "machtypes.h" - -#define TL_WR802N_V2_GPIO_LED_SYSTEM 13 -#define TL_WR802N_V2_GPIO_BTN_RESET 11 - -#define TL_WR802N_V2_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WR802N_V2_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_V2_KEYS_POLL_INTERVAL) - -static const char *tl_wr802n_v2_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data tl_wr802n_v2_flash_data = { - .part_probes = tl_wr802n_v2_part_probes, -}; - -static struct gpio_led tl_wr802n_v2_leds_gpio[] __initdata = { - { - .name = "tl-wr802n-v2:green:system", - .gpio = TL_WR802N_V2_GPIO_LED_SYSTEM, - .active_low = 1, - }, -}; - -static struct gpio_keys_button tl_wr802n_v2_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = TL_WR802N_V2_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR802N_V2_GPIO_BTN_RESET, - .active_low = 0, - } -}; - -static void __init tl_ap143_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; - - ath79_register_m25p80(&tl_wr802n_v2_flash_data); - - ath79_setup_ar933x_phy4_switch(false, false); - - ath79_register_mdio(0, 0x0); - - /* LAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - - ath79_init_mac(tmpmac, mac, 0); - ath79_register_wmac(ee, tmpmac); -}; - -static void __init tl_wr802n_v2_setup(void) -{ - tl_ap143_setup(); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v2_leds_gpio), - tl_wr802n_v2_leds_gpio); - - ath79_register_gpio_keys_polled(1, TL_WR802N_V2_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr802n_v2_gpio_keys), - tl_wr802n_v2_gpio_keys); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR802N_V2, "TL-WR802N-v2", "TP-LINK TL-WR802N v2", - tl_wr802n_v2_setup); \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c index 21c628e0a..ece38f900 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr802n.c @@ -1,7 +1,8 @@ /* - * TP-LINK TL-WR802N v1 + * TP-LINK TL-WR802N v1, v2 * * Copyright (C) 2015 Rick Pannen > + * Copyright (C) 2016 Thomas Roberts > * * 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 @@ -22,77 +23,95 @@ #include "dev-wmac.h" #include "machtypes.h" -#define TL_WR802N_V1_GPIO_LED_SYSTEM 13 -#define TL_WR802N_V1_GPIO_BTN_RESET 11 +#define TL_WR802N_GPIO_LED_SYSTEM 13 +#define TL_WR802N_GPIO_BTN_RESET 11 -#define TL_WR802N_V1_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WR802N_V1_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_V1_KEYS_POLL_INTERVAL) +#define TL_WR802N_KEYS_POLL_INTERVAL 20 /* msecs */ +#define TL_WR802N_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR802N_KEYS_POLL_INTERVAL) -static const char *tl_wr802n_v1_part_probes[] = { +static const char *tl_wr802n_part_probes[] = { "tp-link", NULL, }; -static struct flash_platform_data tl_wr802n_v1_flash_data = { - .part_probes = tl_wr802n_v1_part_probes, +static struct flash_platform_data tl_wr802n_flash_data = { + .part_probes = tl_wr802n_part_probes, }; static struct gpio_led tl_wr802n_v1_leds_gpio[] __initdata = { { .name = "tp-link:blue:system", - .gpio = TL_WR802N_V1_GPIO_LED_SYSTEM, + .gpio = TL_WR802N_GPIO_LED_SYSTEM, .active_low = 1, }, }; -static struct gpio_keys_button tl_wr802n_v1_gpio_keys[] __initdata = { +static struct gpio_led tl_wr802n_v2_leds_gpio[] __initdata = { + { + .name = "tl-wr802n-v2:green:system", + .gpio = TL_WR802N_GPIO_LED_SYSTEM, + .active_low = 1, + }, +}; + +static struct gpio_keys_button tl_wr802n_gpio_keys[] __initdata = { { .desc = "reset", .type = EV_KEY, .code = KEY_RESTART, - .debounce_interval = TL_WR802N_V1_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR802N_V1_GPIO_BTN_RESET, + .debounce_interval = TL_WR802N_KEYS_DEBOUNCE_INTERVAL, + .gpio = TL_WR802N_GPIO_BTN_RESET, .active_low = 0, } }; static void __init tl_ap143_setup(void) { - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); + u8 tmpmac[ETH_ALEN]; - ath79_register_m25p80(&tl_wr802n_v1_flash_data); + ath79_register_m25p80(&tl_wr802n_flash_data); - ath79_setup_ar933x_phy4_switch(false, false); + ath79_setup_ar933x_phy4_switch(false, false); - ath79_register_mdio(0, 0x0); + ath79_register_mdio(0, 0x0); - /* LAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); + /* LAN */ + ath79_switch_data.phy4_mii_en = 1; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.phy_mask = BIT(4); + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); - ath79_init_mac(tmpmac, mac, 0); - ath79_register_wmac(ee, tmpmac); -}; + ath79_init_mac(tmpmac, mac, 0); + ath79_register_wmac(ee, tmpmac); + + ath79_register_gpio_keys_polled(1, TL_WR802N_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr802n_gpio_keys), + tl_wr802n_gpio_keys); +} static void __init tl_wr802n_v1_setup(void) { tl_ap143_setup(); ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v1_leds_gpio), - tl_wr802n_v1_leds_gpio); + tl_wr802n_v1_leds_gpio); +} - ath79_register_gpio_keys_polled(1, TL_WR802N_V1_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr802n_v1_gpio_keys), - tl_wr802n_v1_gpio_keys); +static void __init tl_wr802n_v2_setup(void) +{ + tl_ap143_setup(); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr802n_v2_leds_gpio), + tl_wr802n_v2_leds_gpio); } MIPS_MACHINE(ATH79_MACH_TL_WR802N_V1, "TL-WR802N-v1", "TP-LINK TL-WR802N v1", tl_wr802n_v1_setup); +MIPS_MACHINE(ATH79_MACH_TL_WR802N_V2, "TL-WR802N-v2", "TP-LINK TL-WR802N v2", + tl_wr802n_v2_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c index 906c5f8d4..588bb9d86 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr810n.c @@ -88,27 +88,20 @@ static struct gpio_keys_button tl_wr810n_gpio_keys[] __initdata = { }, }; -static void __init tl_wr810n_setup(void) +static void __init tl_ap143_setup(int lan_mac_offset) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - ath79_setup_ar933x_phy4_switch(false, false); - ath79_register_m25p80(&tl_wr810n_flash_data); - ath79_register_leds_gpio(-1, - ARRAY_SIZE(tl_wr810n_leds_gpio), - tl_wr810n_leds_gpio); - ath79_register_gpio_keys_polled(-1, - TL_WR810N_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr810n_gpio_keys), - tl_wr810n_gpio_keys); + + ath79_setup_ar933x_phy4_switch(false, false); ath79_register_mdio(0, 0x0); /* WAN */ - ath79_eth0_data.duplex = DUPLEX_FULL; ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.duplex = DUPLEX_FULL; ath79_eth0_data.speed = SPEED_100; ath79_eth0_data.phy_mask = BIT(4); ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); @@ -116,20 +109,41 @@ static void __init tl_wr810n_setup(void) /* LAN */ ath79_switch_data.phy4_mii_en = 1; - ath79_eth1_data.duplex = DUPLEX_FULL; ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_eth1_data.duplex = DUPLEX_FULL; ath79_eth1_data.speed = SPEED_1000; ath79_switch_data.phy_poll_mask |= BIT(4); - ath79_init_mac(ath79_eth1_data.mac_addr, mac, -1); + ath79_init_mac(ath79_eth1_data.mac_addr, mac, lan_mac_offset); ath79_register_eth(1); ath79_register_wmac(art + TL_WR810N_WMAC_CALDATA_OFFSET, mac); + ath79_register_leds_gpio(-1, + ARRAY_SIZE(tl_wr810n_leds_gpio), + tl_wr810n_leds_gpio); + ath79_register_gpio_keys_polled(-1, + TL_WR810N_KEYS_POLL_INTERVAL, + ARRAY_SIZE(tl_wr810n_gpio_keys), + tl_wr810n_gpio_keys); +} + +static void __init tl_wr810n_setup(void) +{ + tl_ap143_setup(-1); + gpio_request_one(TL_WR810N_GPIO_USB_POWER, GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, "USB power"); ath79_register_usb(); } +static void __init tl_wr810n_v2_setup(void) +{ + tl_ap143_setup(0); +} + MIPS_MACHINE(ATH79_MACH_TL_WR810N, "TL-WR810N", "TP-LINK TL-WR810N", tl_wr810n_setup); + +MIPS_MACHINE(ATH79_MACH_TL_WR810N_V2, "TL-WR810N-v2", "TP-LINK TL-WR810N v2", + tl_wr810n_v2_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c index 318c0ce4c..304d8ff6e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr841n-v9.c @@ -73,17 +73,6 @@ #define TL_WR842NV3_GPIO_BTN_RESET 1 #define TL_WR842NV3_GPIO_BTN_WIFI 0 -#define TL_WR842NV9_GPIO_LED_WLAN 12 -#define TL_WR842NV9_GPIO_LED_QSS 3 -#define TL_WR842NV9_GPIO_LED_WAN 11 -#define TL_WR842NV9_GPIO_LED_LAN1 16 -#define TL_WR842NV9_GPIO_LED_LAN2 15 -#define TL_WR842NV9_GPIO_LED_LAN3 14 -#define TL_WR842NV9_GPIO_LED_LAN4 4 -#define TL_WR842NV9_GPIO_LED_SYSTEM 13 -#define TL_WR842NV9_GPIO_BTN_RESET 17 -#define TL_WR842NV9_GPIO_BTN_WIFI 0 - #define TL_WR740NV6_GPIO_LED_SYSTEM 1 #define TL_WR740NV6_GPIO_LED_QSS 3 #define TL_WR740NV6_GPIO_LED_WAN_ORANGE 2 @@ -354,59 +343,15 @@ static struct gpio_keys_button tl_wr740n_v6_gpio_keys[] __initdata = { } }; -static struct gpio_led tl_wr842n_v9_leds_gpio[] __initdata = { - { - .name = "tp-link:green:lan1", - .gpio = TL_WR842NV9_GPIO_LED_LAN1, - .active_low = 1, - }, { - .name = "tp-link:green:lan2", - .gpio = TL_WR842NV9_GPIO_LED_LAN2, - .active_low = 1, - }, { - .name = "tp-link:green:lan3", - .gpio = TL_WR842NV9_GPIO_LED_LAN3, - .active_low = 1, - }, { - .name = "tp-link:green:lan4", - .gpio = TL_WR842NV9_GPIO_LED_LAN4, - .active_low = 1, - }, { - .name = "tp-link:green:system", - .gpio = TL_WR842NV9_GPIO_LED_SYSTEM, - .active_low = 1, - }, { - .name = "tp-link:green:wan", - .gpio = TL_WR842NV9_GPIO_LED_WAN, - .active_low = 1, - }, { - .name = "tp-link:green:wlan", - .gpio = TL_WR842NV9_GPIO_LED_WLAN, - .active_low = 1, - }, -}; - -static struct gpio_keys_button tl_wr842n_v9_gpio_keys[] __initdata = { - { - .desc = "Reset button", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = TL_WR841NV9_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR842NV9_GPIO_BTN_RESET, - .active_low = 1, - } -}; - static void __init tl_ap143_setup(void) { u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); u8 tmpmac[ETH_ALEN]; - ath79_register_usb(); ath79_register_m25p80(&tl_wr841n_v9_flash_data); - /*ath79_setup_ar933x_phy4_switch(false, false);*/ + ath79_setup_ar933x_phy4_switch(false, false); ath79_register_mdio(0, 0x0); @@ -490,6 +435,7 @@ static void __init tl_wr842n_v3_setup(void) ARRAY_SIZE(tl_wr842n_v3_gpio_keys), tl_wr842n_v3_gpio_keys); + ath79_register_usb(); } MIPS_MACHINE(ATH79_MACH_TL_WR842N_V3, "TL-WR842N-v3", "TP-LINK TL-WR842N/ND v3", @@ -509,49 +455,3 @@ static void __init tl_wr740n_v6_setup(void) MIPS_MACHINE(ATH79_MACH_TL_WR740N_V6, "TL-WR740N-v6", "TP-LINK TL-WR740N/ND v6", tl_wr740n_v6_setup); - -static void __init tl_wr842n_v9_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - u8 tmpmac[ETH_ALEN]; - ath79_register_usb(); - ath79_register_m25p80(&tl_wr841n_v9_flash_data); - - /*ath79_setup_ar933x_phy4_switch(false, false);*/ - - ath79_register_mdio(0, 0x0); - ath79_register_mdio(1, 0x0); - /* add by zcc */ - ath79_setup_ar934x_eth_cfg(AR934X_ETH_CFG_SW_PHY_SWAP); - /* LAN */ - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; - ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_eth1_data.speed = SPEED_1000; - ath79_switch_data.phy_poll_mask |= BIT(0); - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); - ath79_register_eth(1); - - /* WAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.phy_mask = BIT(0); - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.speed = SPEED_100; - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - - ath79_init_mac(tmpmac, mac, 0); - ath79_register_wmac(ee, tmpmac); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr842n_v9_leds_gpio), - tl_wr842n_v9_leds_gpio); - - ath79_register_gpio_keys_polled(1, TL_WR841NV9_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr842n_v9_gpio_keys), - tl_wr842n_v9_gpio_keys); - -} - -MIPS_MACHINE(ATH79_MACH_TL_WR842N_V9, "TL-WR842N-v9", "TP-LINK TL-WR842N/ND v9", - tl_wr842n_v9_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c deleted file mode 100644 index abde05cbd..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr882n-v1.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * TP-LINK TL-WR882N v1 - * - * Copyright (C) Weijie Gao - * - * 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 -#include - -#include -#include - -#include "common.h" -#include "dev-eth.h" -#include "dev-gpio-buttons.h" -#include "dev-leds-gpio.h" -#include "dev-m25p80.h" -#include "dev-wmac.h" -#include "machtypes.h" - -#define TL_WR882NV1_GPIO_LED_WAN 2 -#define TL_WR882NV1_GPIO_LED_LAN1 4 -#define TL_WR882NV1_GPIO_LED_LAN2 5 -#define TL_WR882NV1_GPIO_LED_LAN3 6 -#define TL_WR882NV1_GPIO_LED_LAN4 7 -#define TL_WR882NV1_GPIO_LED_SYS 18 - -#define TL_WR882NV1_GPIO_BTN_RESET 1 - -#define TL_WR882NV1_KEYS_POLL_INTERVAL 20 /* msecs */ -#define TL_WR882NV1_KEYS_DEBOUNCE_INTERVAL (3 * TL_WR882NV1_KEYS_POLL_INTERVAL) - -static const char *tl_wr882n_v1_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data tl_wr882n_v1_flash_data = { - .part_probes = tl_wr882n_v1_part_probes, -}; - -static struct gpio_led tl_wr882n_v1_leds_gpio[] __initdata = { - { - .name = "tp-link:green:lan1", - .gpio = TL_WR882NV1_GPIO_LED_LAN1, - .active_low = 1, - }, { - .name = "tp-link:green:lan2", - .gpio = TL_WR882NV1_GPIO_LED_LAN2, - .active_low = 1, - }, { - .name = "tp-link:green:lan3", - .gpio = TL_WR882NV1_GPIO_LED_LAN3, - .active_low = 1, - }, { - .name = "tp-link:green:lan4", - .gpio = TL_WR882NV1_GPIO_LED_LAN4, - .active_low = 1, - }, { - .name = "tp-link:green:wan", - .gpio = TL_WR882NV1_GPIO_LED_WAN, - .active_low = 1, - }, { - .name = "tp-link:white:status", - .gpio = TL_WR882NV1_GPIO_LED_SYS, - .active_low = 1, - }, -}; - -static struct gpio_keys_button tl_wr882n_v1_gpio_keys[] __initdata = { - { - .desc = "Reset button", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = TL_WR882NV1_KEYS_DEBOUNCE_INTERVAL, - .gpio = TL_WR882NV1_GPIO_BTN_RESET, - .active_low = 1, - } -}; - - -static void __init tl_cus249_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000); - - ath79_register_m25p80(&tl_wr882n_v1_flash_data); - - ath79_register_mdio(0, 0x0); - - /* LAN */ - ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; - ath79_eth1_data.duplex = DUPLEX_FULL; - ath79_eth1_data.speed = SPEED_1000; - ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); - ath79_register_eth(1); - - /* WAN */ - ath79_switch_data.phy4_mii_en = 1; - ath79_switch_data.phy_poll_mask = BIT(4); - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.phy_mask = BIT(4); - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); - ath79_register_eth(0); - - ath79_register_wmac(ee, mac); -} - -static void __init tl_wr882n_v1_setup(void) -{ - tl_cus249_setup(); - - ath79_register_leds_gpio(-1, ARRAY_SIZE(tl_wr882n_v1_leds_gpio), - tl_wr882n_v1_leds_gpio); - - ath79_register_gpio_keys_polled(1, TL_WR882NV1_KEYS_POLL_INTERVAL, - ARRAY_SIZE(tl_wr882n_v1_gpio_keys), - tl_wr882n_v1_gpio_keys); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR882N_V1, "TL-WR882N-v1", "TP-LINK TL-WR882N v1", - tl_wr882n_v1_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c deleted file mode 100755 index 8afdb4723..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * TP-LINK TL-WR941N v7 board support - * - * Copyright (C) 2012 Gabor Juhos - * Copyright (C) 2014 Weijie Gao - * - * 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 -#include -#include -#include -#include -#include -#include - -#include - -#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" - -#define WR941NV7_GPIO_LED_WLAN 12 -#define WR941NV7_GPIO_LED_SYSTEM 19 -#define WR941NV7_GPIO_LED_QSS 15 - -#define WR941NV7_GPIO_BTN_RESET 16 - -#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ -#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) - -#define ATH_MII_MGMT_CMD 0x24 -#define ATH_MGMT_CMD_READ 0x1 - -#define ATH_MII_MGMT_ADDRESS 0x28 -#define ATH_ADDR_SHIFT 8 - -#define ATH_MII_MGMT_CTRL 0x2c -#define ATH_MII_MGMT_STATUS 0x30 - -#define ATH_MII_MGMT_IND 0x34 -#define ATH_MGMT_IND_BUSY (1 << 0) -#define ATH_MGMT_IND_INVALID (1 << 2) - -static const char *wr941nv7_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data wr941nv7_flash_data = { - .part_probes = wr941nv7_part_probes, -}; - -static struct gpio_led wr941nv7_leds_gpio[] __initdata = { - { - .name = "tp-link:green:qss", - .gpio = WR941NV7_GPIO_LED_QSS, - .active_low = 1, - }, - { - .name = "tp-link:green:system", - .gpio = WR941NV7_GPIO_LED_SYSTEM, - .active_low = 1, - }, - { - .name = "tp-link:green:wlan", - .gpio = WR941NV7_GPIO_LED_WLAN, - .active_low = 1, - }, -}; - -static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, - .gpio = WR941NV7_GPIO_BTN_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info wr941nv7_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 0, - .platform_data = NULL, - }, -}; - -static unsigned long __init ath_gmac_reg_rd(unsigned long reg) -{ - void __iomem *base; - unsigned long t; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - t = __raw_readl(base + reg); - - iounmap(base); - - return t; -} - -static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) -{ - void __iomem *base; - unsigned long t = value; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - __raw_writel(t, base + reg); - - iounmap(base); -} - -static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; - volatile int rddata; - unsigned short ii = 0xFFFF; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); -} - -static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; - volatile int rddata; - unsigned short ii = 0xffff; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - - return val; -} - -static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) -{ - unsigned int addr_temp; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = (s27_addr) >> 2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - - reg_address = (((addr_temp << 1) & 0x1e) | 0x1); - data = (s27_write_data >> 16) & 0xffff; - phy_reg_write(phy_address, reg_address, data); - - reg_address = ((addr_temp << 1) & 0x1e); - data = s27_write_data & 0xffff; - phy_reg_write(phy_address, reg_address, data); -} - -static unsigned int __init athrs27_reg_read(unsigned int s27_addr) -{ - unsigned int addr_temp; - unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = s27_addr >>2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - reg_address = ((addr_temp << 1) & 0x1e); - s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); - - reg_address = reg_address | 0x1; - s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); - s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; - - return (s27_rd_csr); -} - -static void __init ar8236_reset(void) -{ - unsigned short i = 60; - - athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); - while (i--) - { - mdelay(100); - if (!(athrs27_reg_read(0x0) & 0x80000000)) - break; - } -} - -static void __init wr941nv7_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); - - ath79_register_m25p80(&wr941nv7_flash_data); - ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), - wr941nv7_leds_gpio); - ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, - ARRAY_SIZE(wr941nv7_gpio_keys), - wr941nv7_gpio_keys); - - ath79_register_wmac(art, mac); - - ar8236_reset(); - - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | - QCA955X_ETH_CFG_MII_GE0_SLAVE); - - mdiobus_register_board_info(wr941nv7_mdio0_info, - ARRAY_SIZE(wr941nv7_mdio0_info)); - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - - /* GMAC0 is connected to an AR8236 switch */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.phy_mask = BIT(0); - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_register_eth(0); - - ath79_register_usb(); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", - "TP-LINK TL-WR941N v7", - wr941nv7_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c index ec3f1ff84..a9ed3fdd4 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wzr-hp-ag300h.c @@ -192,9 +192,6 @@ static void __init wzrhpag300h_setup(void) ap94_pci_init(eeprom1, mac1, eeprom2, mac2); - ap9x_pci_setup_wmac_led_pin(0, 1); - ap9x_pci_setup_wmac_led_pin(1, 5); - ap9x_pci_setup_wmac_leds(0, wzrhpag300h_wmac0_leds_gpio, ARRAY_SIZE(wzrhpag300h_wmac0_leds_gpio)); ap9x_pci_setup_wmac_leds(1, wzrhpag300h_wmac1_leds_gpio, diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index cc6227737..0f536f0ec 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -92,6 +92,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_DR342, /* Wallys DR342 */ ATH79_MACH_DR344, /* Wallys DR344 */ ATH79_MACH_DR531, /* Wallys DR531 */ ATH79_MACH_DRAGINO2, /* Dragino Version 2 */ @@ -127,9 +128,6 @@ enum ath79_mach_type { ATH79_MACH_JWAP230, /* jjPlus JWAP230 */ ATH79_MACH_LIMA, /* 8devices Lima */ ATH79_MACH_MC_MAC1200R, /* MERCURY MAC1200R */ - ATH79_MACH_MW316R_V1, /* Mercury MW316R v1 */ - ATH79_MACH_MASELINK_AP2600I, /* Comba MASELink AP2600-I */ - ATH79_MACH_MASELINK_AP2600IFM, /* Comba MASELink AP2600-IFM */ ATH79_MACH_MR12, /* Cisco Meraki MR12 */ ATH79_MACH_MR16, /* Cisco Meraki MR16 */ ATH79_MACH_MR1750, /* OpenMesh MR1750 */ @@ -206,8 +204,6 @@ enum ath79_mach_type { ATH79_MACH_SC1750, /* Abicom SC1750 */ ATH79_MACH_SC300M, /* Abicom SC300M */ ATH79_MACH_SC450, /* Abicom SC450 */ - ATH79_MACH_SGR_W500_N85B_V2, /* GRENTECH SGR-W500-N85B v2 */ - ATH79_MACH_SGR_W500_EBI_FIT_V3, /* GRENTECH SGR-W500-EBI(FIT) v3.0 */ ATH79_MACH_SMART_300, /* NC-LINK SMART-300 */ ATH79_MACH_SOM9331, /* OpenEmbed SOM9331 */ ATH79_MACH_SR3200, /* YunCore SR3200 */ @@ -243,14 +239,15 @@ enum ath79_mach_type { ATH79_MACH_TL_WA901ND_V2, /* TP-LINK TL-WA901ND v2 */ ATH79_MACH_TL_WA901ND_V3, /* TP-LINK TL-WA901ND v3 */ ATH79_MACH_TL_WA901ND_V4, /* TP-LINK TL-WA901ND v4 */ + ATH79_MACH_TL_WA901ND_V5, /* TP-LINK TL-WA901ND v5 */ ATH79_MACH_TL_WDR3320_V2, /* TP-LINK TL-WDR3320 v2 */ ATH79_MACH_TL_WDR3500, /* TP-LINK TL-WDR3500 */ ATH79_MACH_TL_WDR4300, /* TP-LINK TL-WDR4300 */ ATH79_MACH_TL_WDR4900_V2, /* TP-LINK TL-WDR4900 v2 */ ATH79_MACH_TL_WDR6500_V2, /* TP-LINK TL-WDR6500 v2 */ - ATH79_MACH_TL_WDR6500_V6, /* TP-LINK TL-WDR6500 v6 */ ATH79_MACH_TL_WPA8630, /* TP-Link TL-WPA8630 */ ATH79_MACH_TL_WR1041N_V2, /* TP-LINK TL-WR1041N v2 */ + ATH79_MACH_TL_WR1043N_V5, /* TP-LINK TL-WR1043N v5 */ ATH79_MACH_TL_WR1043ND, /* TP-LINK TL-WR1043ND */ ATH79_MACH_TL_WR1043ND_V2, /* TP-LINK TL-WR1043ND v2 */ ATH79_MACH_TL_WR1043ND_V4, /* TP-LINK TL-WR1043ND v4 */ @@ -264,6 +261,7 @@ enum ath79_mach_type { ATH79_MACH_TL_WR802N_V1, /* TP-LINK TL-WR802N v1 */ ATH79_MACH_TL_WR802N_V2, /* TP-LINK TL-WR802N v2 */ ATH79_MACH_TL_WR810N, /* TP-LINK TL-WR810N */ + ATH79_MACH_TL_WR810N_V2, /* TP-LINK TL-WR810N v2 */ ATH79_MACH_TL_WR840N_V2, /* TP-LINK TL-WR840N v2 */ ATH79_MACH_TL_WR840N_V3, /* TP-LINK TL-WR840N v3 */ ATH79_MACH_TL_WR841N_V1, /* TP-LINK TL-WR841N v1 */ @@ -273,13 +271,10 @@ enum ath79_mach_type { ATH79_MACH_TL_WR841N_V9, /* TP-LINK TL-WR841N/ND v9 */ ATH79_MACH_TL_WR842N_V2, /* TP-LINK TL-WR842N/ND v2 */ ATH79_MACH_TL_WR842N_V3, /* TP-LINK TL-WR842N/ND v3 */ - ATH79_MACH_TL_WR842N_V9, /* TP-LINK TL-WR842N/ND v9 */ - ATH79_MACH_TL_WR882N_V1, /* TP-LINK TL-WR882N v1 */ ATH79_MACH_TL_WR902AC_V1, /* TP-LINK TL-WR902AC v1 */ ATH79_MACH_TL_WR941ND, /* TP-LINK TL-WR941ND */ ATH79_MACH_TL_WR941ND_V5, /* TP-LINK TL-WR941ND v5 */ ATH79_MACH_TL_WR941ND_V6, /* TP-LINK TL-WR941ND v6 */ - ATH79_MACH_TL_WR941N_V7, /* TP-LINK TL-WR941N v7 */ ATH79_MACH_TL_WR940N_V4, /* TP-LINK TL-WR940N v4 */ ATH79_MACH_TL_WR942N_V1, /* TP-LINK TL-WR942N v1 */ ATH79_MACH_TUBE2H, /* Alfa Network Tube2H */ diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h index 078fa157f..5fdc59c7b 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h @@ -37,7 +37,7 @@ struct ag71xx_platform_data { u8 is_ar724x:1; u8 has_ar8216:1; u8 use_flow_control:1; - u8 is_qca956x:1; + u8 disable_inline_checksum_engine:1; struct ag71xx_switch_platform_data *switch_data; diff --git a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c index 1355e3ff6..82e6e943f 100644 --- a/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c +++ b/target/linux/ar71xx/files/drivers/gpio/gpio-nxp-74hc153.c @@ -203,19 +203,7 @@ static int nxp_74hc153_remove(struct platform_device *pdev) struct nxp_74hc153_platform_data *pdata = pdev->dev.platform_data; if (nxp) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0) - int err; - - err = gpiochip_remove(&nxp->gpio_chip); - if (err) { - dev_err(&pdev->dev, - "unable to remove gpio chip, err=%d\n", - err); - return err; - } -#else gpiochip_remove(&nxp->gpio_chip); -#endif gpio_free(pdata->gpio_pin_2y); gpio_free(pdata->gpio_pin_1y); gpio_free(pdata->gpio_pin_s1); diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h index 898bde1d2..a71281291 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx.h @@ -40,7 +40,12 @@ #define AG71XX_DRV_NAME "ag71xx" #define AG71XX_DRV_VERSION "0.5.35" -#define AG71XX_NAPI_WEIGHT 64 +/* + * For our NAPI weight bigger does *NOT* mean better - it means more + * D-cache misses and lots more wasted cycles than we'll ever + * possibly gain from saving instructions. + */ +#define AG71XX_NAPI_WEIGHT 32 #define AG71XX_OOM_REFILL (1 + HZ/10) #define AG71XX_INT_ERR (AG71XX_INT_RX_BE | AG71XX_INT_TX_BE) diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c index 566e9513d..93f8c5305 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c @@ -13,13 +13,6 @@ #include "ag71xx.h" -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) -static inline void skb_free_frag(void *data) -{ - put_page(virt_to_head_page(data)); -} -#endif - #define AG71XX_DEFAULT_MSG_ENABLE \ (NETIF_MSG_DRV \ | NETIF_MSG_PROBE \ @@ -629,6 +622,22 @@ __ag71xx_link_adjust(struct ag71xx *ag, bool update) ag71xx_wr(ag, AG71XX_REG_MAC_CFG2, cfg2); ag71xx_wr(ag, AG71XX_REG_FIFO_CFG5, fifo5); ag71xx_wr(ag, AG71XX_REG_MAC_IFCTL, ifctl); + + if (pdata->disable_inline_checksum_engine) { + /* + * The rx ring buffer can stall on small packets on QCA953x and + * QCA956x. Disabling the inline checksum engine fixes the stall. + * The wr, rr functions cannot be used since this hidden register + * is outside of the normal ag71xx register block. + */ + void __iomem *dam = ioremap_nocache(0xb90001bc, 0x4); + if (dam) { + __raw_writel(__raw_readl(dam) & ~BIT(27), dam); + (void)__raw_readl(dam); + iounmap(dam); + } + } + ag71xx_hw_start(ag); netif_carrier_on(ag->dev); diff --git a/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c b/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c index 9175fc7ae..2d95e8049 100644 --- a/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c +++ b/target/linux/ar71xx/files/drivers/spi/spi-rb4xx.c @@ -379,7 +379,7 @@ static int rb4xx_spi_probe(struct platform_device *pdev) err_iounmap: iounmap(rbspi->base); err_clk_disable: - clk_disable(rbspi->ahb_clk); + clk_disable_unprepare(rbspi->ahb_clk); err_clk_put: clk_put(rbspi->ahb_clk); err_put_master: @@ -394,7 +394,7 @@ static int rb4xx_spi_remove(struct platform_device *pdev) struct rb4xx_spi *rbspi = platform_get_drvdata(pdev); iounmap(rbspi->base); - clk_disable(rbspi->ahb_clk); + clk_disable_unprepare(rbspi->ahb_clk); clk_put(rbspi->ahb_clk); platform_set_drvdata(pdev, NULL); spi_master_put(rbspi->master); diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index e69de29bb..d5b59b594 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -0,0 +1,201 @@ +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y +CONFIG_ATH79_MACH_A60=y +CONFIG_ATH79_MACH_ALFA_AP120C=y +CONFIG_ATH79_MACH_ALFA_AP96=y +CONFIG_ATH79_MACH_ALFA_NX=y +CONFIG_ATH79_MACH_ALL0258N=y +CONFIG_ATH79_MACH_ALL0315N=y +CONFIG_ATH79_MACH_ANTMINER_S1=y +CONFIG_ATH79_MACH_ANTMINER_S3=y +CONFIG_ATH79_MACH_ANTROUTER_R1=y +CONFIG_ATH79_MACH_AP121=y +CONFIG_ATH79_MACH_AP121F=y +CONFIG_ATH79_MACH_AP132=y +CONFIG_ATH79_MACH_AP136=y +CONFIG_ATH79_MACH_AP143=y +CONFIG_ATH79_MACH_AP147=y +CONFIG_ATH79_MACH_AP152=y +CONFIG_ATH79_MACH_AP531B0=y +CONFIG_ATH79_MACH_AP90Q=y +CONFIG_ATH79_MACH_AP96=y +CONFIG_ATH79_MACH_ARCHER_C25_V1=y +CONFIG_ATH79_MACH_ARCHER_C58_V1=y +CONFIG_ATH79_MACH_ARCHER_C59_V1=y +CONFIG_ATH79_MACH_ARCHER_C60_V1=y +CONFIG_ATH79_MACH_ARCHER_C7=y +CONFIG_ATH79_MACH_ARDUINO_YUN=y +CONFIG_ATH79_MACH_AW_NR580=y +CONFIG_ATH79_MACH_BHR_4GRV2=y +CONFIG_ATH79_MACH_BHU_BXU2000N2_A=y +CONFIG_ATH79_MACH_BSB=y +CONFIG_ATH79_MACH_C55=y +CONFIG_ATH79_MACH_CAP324=y +CONFIG_ATH79_MACH_CAP4200AG=y +CONFIG_ATH79_MACH_CARAMBOLA2=y +CONFIG_ATH79_MACH_CF_E316N_V2=y +CONFIG_ATH79_MACH_CF_E320N_V2=y +CONFIG_ATH79_MACH_CF_E355AC=y +CONFIG_ATH79_MACH_CF_E380AC_V1=y +CONFIG_ATH79_MACH_CF_E380AC_V2=y +CONFIG_ATH79_MACH_CF_E520N=y +CONFIG_ATH79_MACH_CF_E530N=y +CONFIG_ATH79_MACH_CPE505N=y +CONFIG_ATH79_MACH_CPE510=y +CONFIG_ATH79_MACH_CPE830=y +CONFIG_ATH79_MACH_CPE870=y +CONFIG_ATH79_MACH_CR3000=y +CONFIG_ATH79_MACH_CR5000=y +CONFIG_ATH79_MACH_DAP_2695_A1=y +CONFIG_ATH79_MACH_DB120=y +CONFIG_ATH79_MACH_DGL_5500_A1=y +CONFIG_ATH79_MACH_DHP_1565_A1=y +CONFIG_ATH79_MACH_DIR_505_A1=y +CONFIG_ATH79_MACH_DIR_825_B1=y +CONFIG_ATH79_MACH_DIR_825_C1=y +CONFIG_ATH79_MACH_DIR_869_A1=y +CONFIG_ATH79_MACH_DLAN_HOTSPOT=y +CONFIG_ATH79_MACH_DLAN_PRO_1200_AC=y +CONFIG_ATH79_MACH_DLAN_PRO_500_WP=y +CONFIG_ATH79_MACH_DR342=y +CONFIG_ATH79_MACH_DR344=y +CONFIG_ATH79_MACH_DR531=y +CONFIG_ATH79_MACH_DRAGINO2=y +CONFIG_ATH79_MACH_E2100L=y +CONFIG_ATH79_MACH_EAP120=y +CONFIG_ATH79_MACH_EAP300V2=y +CONFIG_ATH79_MACH_EAP7660D=y +CONFIG_ATH79_MACH_EL_M150=y +CONFIG_ATH79_MACH_EL_MINI=y +CONFIG_ATH79_MACH_ENS202EXT=y +CONFIG_ATH79_MACH_EPG5000=y +CONFIG_ATH79_MACH_ESR1750=y +CONFIG_ATH79_MACH_ESR900=y +CONFIG_ATH79_MACH_EW_DORIN=y +CONFIG_ATH79_MACH_F9K1115V2=y +CONFIG_ATH79_MACH_FRITZ300E=y +CONFIG_ATH79_MACH_GL_AR150=y +CONFIG_ATH79_MACH_GL_AR300=y +CONFIG_ATH79_MACH_GL_AR300M=y +CONFIG_ATH79_MACH_GL_DOMINO=y +CONFIG_ATH79_MACH_GL_INET=y +CONFIG_ATH79_MACH_GL_MIFI=y +CONFIG_ATH79_MACH_GL_USB150=y +CONFIG_ATH79_MACH_GS_MINIBOX_V1=y +CONFIG_ATH79_MACH_GS_OOLITE=y +CONFIG_ATH79_MACH_HIWIFI_HC6361=y +CONFIG_ATH79_MACH_HORNET_UB=y +CONFIG_ATH79_MACH_JA76PF=y +CONFIG_ATH79_MACH_JWAP003=y +CONFIG_ATH79_MACH_JWAP230=y +CONFIG_ATH79_MACH_LIMA=y +CONFIG_ATH79_MACH_MC_MAC1200R=y +CONFIG_ATH79_MACH_MR12=y +CONFIG_ATH79_MACH_MR16=y +CONFIG_ATH79_MACH_MR1750=y +CONFIG_ATH79_MACH_MR600=y +CONFIG_ATH79_MACH_MR900=y +CONFIG_ATH79_MACH_MYNET_N600=y +CONFIG_ATH79_MACH_MYNET_N750=y +CONFIG_ATH79_MACH_MYNET_REXT=y +CONFIG_ATH79_MACH_MZK_W04NU=y +CONFIG_ATH79_MACH_MZK_W300NH=y +CONFIG_ATH79_MACH_OM2P=y +CONFIG_ATH79_MACH_OM5P=y +CONFIG_ATH79_MACH_OM5P_AC=y +CONFIG_ATH79_MACH_OM5P_ACv2=y +CONFIG_ATH79_MACH_OMY_G1=y +CONFIG_ATH79_MACH_OMY_X1=y +CONFIG_ATH79_MACH_ONION_OMEGA=y +CONFIG_ATH79_MACH_PB42=y +CONFIG_ATH79_MACH_PB44=y +CONFIG_ATH79_MACH_PQI_AIR_PEN=y +CONFIG_ATH79_MACH_QIHOO_C301=y +CONFIG_ATH79_MACH_R602N=y +CONFIG_ATH79_MACH_RE450=y +CONFIG_ATH79_MACH_RW2458N=y +CONFIG_ATH79_MACH_SC1750=y +CONFIG_ATH79_MACH_SC300M=y +CONFIG_ATH79_MACH_SC450=y +CONFIG_ATH79_MACH_SMART_300=y +CONFIG_ATH79_MACH_SOM9331=y +CONFIG_ATH79_MACH_SR3200=y +CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE=y +CONFIG_ATH79_MACH_TEW_673GRU=y +CONFIG_ATH79_MACH_TEW_732BR=y +CONFIG_ATH79_MACH_TEW_823DRU=y +CONFIG_ATH79_MACH_TL_MR3X20=y +CONFIG_ATH79_MACH_TL_MR6400=y +CONFIG_ATH79_MACH_TL_WDR3500=y +CONFIG_ATH79_MACH_TL_WDR4300=y +CONFIG_ATH79_MACH_TL_WDR6500_V2=y +CONFIG_ATH79_MACH_TL_WPA8630=y +CONFIG_ATH79_MACH_TL_WR1043ND=y +CONFIG_ATH79_MACH_TL_WR1043ND_V2=y +CONFIG_ATH79_MACH_TL_WR1043ND_V4=y +CONFIG_ATH79_MACH_TL_WR1043N_V5=y +CONFIG_ATH79_MACH_TL_WR2543N=y +CONFIG_ATH79_MACH_TL_WR703N=y +CONFIG_ATH79_MACH_TL_WR720N_V3=y +CONFIG_ATH79_MACH_TL_WR810N=y +CONFIG_ATH79_MACH_TL_WR810N_V2=y +CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR902AC_V1=y +CONFIG_ATH79_MACH_TL_WR942N_V1=y +CONFIG_ATH79_MACH_TUBE2H=y +CONFIG_ATH79_MACH_UBNT=y +CONFIG_ATH79_MACH_UBNT_UNIFIAC=y +CONFIG_ATH79_MACH_UBNT_XM=y +CONFIG_ATH79_MACH_WEIO=y +CONFIG_ATH79_MACH_WHR_HP_G300N=y +CONFIG_ATH79_MACH_WLAE_AG300N=y +CONFIG_ATH79_MACH_WLR8100=y +CONFIG_ATH79_MACH_WNDAP360=y +CONFIG_ATH79_MACH_WNDR3700=y +CONFIG_ATH79_MACH_WNR2200=y +CONFIG_ATH79_MACH_WP543=y +CONFIG_ATH79_MACH_WPE72=y +CONFIG_ATH79_MACH_WPJ342=y +CONFIG_ATH79_MACH_WPJ344=y +CONFIG_ATH79_MACH_WPJ531=y +CONFIG_ATH79_MACH_WPJ558=y +CONFIG_ATH79_MACH_WPJ563=y +CONFIG_ATH79_MACH_WRT160NL=y +CONFIG_ATH79_MACH_WRT400N=y +CONFIG_ATH79_MACH_WRTNODE2Q=y +CONFIG_ATH79_MACH_WZR_450HP2=y +CONFIG_ATH79_MACH_WZR_HP_AG300H=y +CONFIG_ATH79_MACH_WZR_HP_G300NH=y +CONFIG_ATH79_MACH_WZR_HP_G300NH2=y +CONFIG_ATH79_MACH_WZR_HP_G450H=y +CONFIG_ATH79_MACH_XD3200=y +CONFIG_ATH79_MACH_ZBT_WE1526=y +CONFIG_ATH79_MACH_ZCN_1523H=y +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_HW_HAS_PCI=y +# CONFIG_LEDS_WNDR3700_USB is not set +CONFIG_MYLOADER=y +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_SERIAL_AR933X=y +CONFIG_SERIAL_AR933X_CONSOLE=y +CONFIG_SERIAL_AR933X_NR_UARTS=2 +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR913X=y +CONFIG_SOC_AR933X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA955X=y +CONFIG_SOC_QCA956X=y diff --git a/target/linux/ar71xx/image/Makefile b/target/linux/ar71xx/image/Makefile index 6c70babc5..1eaf1e457 100644 --- a/target/linux/ar71xx/image/Makefile +++ b/target/linux/ar71xx/image/Makefile @@ -13,11 +13,15 @@ KERNEL_LOADADDR = 0x80060000 DEVICE_VARS += BOARDNAME CMDLINE CONSOLE IMAGE_SIZE LOADER_TYPE ifeq ($(SUBTARGET),generic) -include ./tp-link.mk -include ./ubnt.mk include ./generic.mk -include ./legacy-devices.mk -include ./senao.mk +include ./generic-legacy-devices.mk +include ./generic-senao.mk +include ./generic-tp-link.mk +include ./generic-ubnt.mk +endif +ifeq ($(SUBTARGET),tiny) +include ./tiny-tp-link.mk +include ./tiny-legacy-devices.mk endif ifeq ($(SUBTARGET),nand) include ./nand.mk diff --git a/target/linux/ar71xx/image/common-tp-link.mk b/target/linux/ar71xx/image/common-tp-link.mk new file mode 100644 index 000000000..c448c9720 --- /dev/null +++ b/target/linux/ar71xx/image/common-tp-link.mk @@ -0,0 +1,95 @@ +DEVICE_VARS += LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV + +define Build/copy-file + cat "$(1)" > "$@" +endef + +define Build/loader-okli + dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new" + cat "$@" >> "$@.new" + mv "$@.new" "$@" +endef + +define Build/loader-okli-compile + $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)") +endef + +# combine kernel and rootfs into one image +# mktplinkfw +# is "sysupgrade" or "factory" +# +# -a align the rootfs start on an bytes boundary +# -j add jffs2 end-of-filesystem markers +# -s strip padding from end of the image +# -X reserve bytes in the firmware image (hexval prefixed with 0x) +define Build/mktplinkfw + -$(STAGING_DIR_HOST)/bin/mktplinkfw \ + -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ + -m $(TPLINK_HEADER_VERSION) \ + -k $(IMAGE_KERNEL) \ + -r $@ \ + -o $@.new \ + -j -X 0x40000 \ + -a $(call rootfs_align,$(FILESYSTEM)) \ + $(wordlist 2,$(words $(1)),$(1)) \ + $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ +endef + +define Build/uImageArcher + mkimage -A $(LINUX_KARCH) \ + -O linux -T kernel \ + -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ + -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new + @mv $@.new $@ +endef + + +define Device/tplink + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + LOADER_TYPE := gz + KERNEL := kernel-bin | patch-cmdline | lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade + IMAGE/factory.bin := append-rootfs | mktplinkfw factory +endef + +define Device/tplink-nolzma + $(Device/tplink) + LOADER_FLASH_OFFS := 0x22000 + COMPILE := loader-$(1).gz + COMPILE/loader-$(1).gz := loader-okli-compile + KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) + KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | tplink-v1-header +endef + +define Device/tplink-4m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 4M + IMAGE_SIZE := 3904k +endef + +define Device/tplink-8m + $(Device/tplink-nolzma) + TPLINK_FLASHLAYOUT := 8M + IMAGE_SIZE := 7936k +endef + +define Device/tplink-4mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 4Mlzma + IMAGE_SIZE := 3904k +endef + +define Device/tplink-8mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 8Mlzma + IMAGE_SIZE := 7936k +endef + +define Device/tplink-16mlzma + $(Device/tplink) + TPLINK_FLASHLAYOUT := 16Mlzma + IMAGE_SIZE := 15872k +endef diff --git a/target/linux/ar71xx/image/legacy-devices.mk b/target/linux/ar71xx/image/generic-legacy-devices.mk similarity index 73% rename from target/linux/ar71xx/image/legacy-devices.mk rename to target/linux/ar71xx/image/generic-legacy-devices.mk index d6bc505eb..70e32748b 100644 --- a/target/linux/ar71xx/image/legacy-devices.mk +++ b/target/linux/ar71xx/image/generic-legacy-devices.mk @@ -156,81 +156,6 @@ define LegacyDevice/F9K1115V2 endef LEGACY_DEVICES += F9K1115V2 -define LegacyDevice/DIR600A1 - DEVICE_TITLE := D-Link DIR-600 rev. A1 -endef -LEGACY_DEVICES += DIR600A1 - -define LegacyDevice/DIR601A1 - DEVICE_TITLE := D-Link DIR-601 rev. A1 -endef -LEGACY_DEVICES += DIR601A1 - -define LegacyDevice/FR54RTR - DEVICE_TITLE := Frys FR-54RTR -endef -LEGACY_DEVICES += FR54RTR - -define LegacyDevice/EBR2310C1 - DEVICE_TITLE := D-Link EBR-2310 rev. C1 -endef -LEGACY_DEVICES += EBR2310C1 - -define LegacyDevice/DIR615E1 - DEVICE_TITLE := D-Link DIR-615 rev. E1 -endef -LEGACY_DEVICES += DIR615E1 - -define LegacyDevice/DIR615E4 - DEVICE_TITLE := D-Link DIR-615 rev. E4 -endef -LEGACY_DEVICES += DIR615E4 - -define LegacyDevice/DIR615I1 - DEVICE_TITLE := D-Link DIR-615 rev. I1 -endef -LEGACY_DEVICES += DIR615I1 - -define LegacyDevice/DIR615I3 - DEVICE_TITLE := D-Link DIR-615 rev. I3 -endef -LEGACY_DEVICES += DIR615I3 - -define LegacyDevice/A02RBW300N - DEVICE_TITLE := Atlantis-Land A02-RB-W300N -endef -LEGACY_DEVICES += A02RBW300N - -define LegacyDevice/DIR615C1 - DEVICE_TITLE := D-Link DIR-615 rev. C1 -endef -LEGACY_DEVICES += DIR615C1 - -define LegacyDevice/TEW632BRP - DEVICE_TITLE := TRENDNet TEW-632BRP -endef -LEGACY_DEVICES += TEW632BRP - -define LegacyDevice/TEW652BRP_FW - DEVICE_TITLE := TRENDNet TEW-652BRP -endef -LEGACY_DEVICES += TEW652BRP_FW - -define LegacyDevice/TEW652BRP_RECOVERY - DEVICE_TITLE := TRENDNet TEW-652BRP (recovery) -endef -LEGACY_DEVICES += TEW652BRP_RECOVERY - -define LegacyDevice/TEW712BR - DEVICE_TITLE := TRENDNet TEW-712BR -endef -LEGACY_DEVICES += TEW712BR - -define LegacyDevice/DIR601B1 - DEVICE_TITLE := D-Link DIR-601 rev. B1 -endef -LEGACY_DEVICES += DIR601B1 - define LegacyDevice/DIR505A1 DEVICE_TITLE := D-Link DIR-505 rev. A1 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport @@ -336,12 +261,6 @@ define LegacyDevice/EPG5000 endef LEGACY_DEVICES += EPG5000 -define LegacyDevice/WP543_4M - DEVICE_TITLE := Compex WP543/WPJ543 (4MB flash) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 -endef -LEGACY_DEVICES += WP543_4M - define LegacyDevice/WP543_8M DEVICE_TITLE := Compex WP543/WPJ543 (8MB flash) DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -354,12 +273,6 @@ define LegacyDevice/WP543_16M endef LEGACY_DEVICES += WP543_16M -define LegacyDevice/WPE72_4M - DEVICE_TITLE := Compex WPE72/WPE72NX (4MB flash) - DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 -endef -LEGACY_DEVICES += WPE72_4M - define LegacyDevice/WPE72_8M DEVICE_TITLE := Compex WPE72/WPE72NX (8MB flash) DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -372,53 +285,12 @@ define LegacyDevice/WPE72_16M endef LEGACY_DEVICES += WPE72_16M -define LegacyDevice/WNR2000 - DEVICE_TITLE := NETGEAR WNR2000V1 -endef -LEGACY_DEVICES += WNR2000 - -define LegacyDevice/WNR2000V3 - DEVICE_TITLE := NETGEAR WNR2000V3 -endef -LEGACY_DEVICES += WNR2000V3 - -define LegacyDevice/WNR2000V4 - DEVICE_TITLE := NETGEAR WNR2000V4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport -endef -LEGACY_DEVICES += WNR2000V4 - define LegacyDevice/WNR2200 DEVICE_TITLE := NETGEAR WNR2200 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport endef LEGACY_DEVICES += WNR2200 -define LegacyDevice/REALWNR612V2 - DEVICE_TITLE := NETGEAR WNR612V2 -endef -LEGACY_DEVICES += REALWNR612V2 - -define LegacyDevice/N150R - DEVICE_TITLE := On Networks N150 -endef -LEGACY_DEVICES += N150R - -define LegacyDevice/REALWNR1000V2 - DEVICE_TITLE := NETGEAR WNR1000V2 -endef -LEGACY_DEVICES += REALWNR1000V2 - -define LegacyDevice/WNR1000V2_VC - DEVICE_TITLE := NETGEAR WNR1000V2-VC -endef -LEGACY_DEVICES += WNR1000V2_VC - -define LegacyDevice/WPN824N - DEVICE_TITLE := NETGEAR WPN824N -endef -LEGACY_DEVICES += WPN824N - define LegacyDevice/OM2P DEVICE_TITLE := OpenMesh OM2P/OM2P-HS/OM2P-LC DEVICE_PACKAGES := om-watchdog @@ -512,27 +384,6 @@ define LegacyDevice/EAP300V2 endef LEGACY_DEVICES += EAP300V2 -define LegacyDevice/WHRG301N - DEVICE_TITLE := Buffalo WHR-G301N -endef -LEGACY_DEVICES += WHRG301N - -define LegacyDevice/WHRHPG300N - DEVICE_TITLE := Buffalo WHR-HP-G300N -endef -LEGACY_DEVICES += WHRHPG300N - -define LegacyDevice/WHRHPGN - DEVICE_TITLE := Buffalo WHR-HP-GN -endef -LEGACY_DEVICES += WHRHPGN - -define LegacyDevice/WLAEAG300N - DEVICE_TITLE := Buffalo WLAE-AG300N - DEVICE_PACKAGES := kmod-ledtrig-netdev -endef -LEGACY_DEVICES += WLAEAG300N - define LegacyDevice/WRT400N DEVICE_TITLE := Linksys WRT400N endef @@ -583,33 +434,3 @@ define LegacyDevice/ZCN1523H516 DEVICE_TITLE := Zcomax ZCN-1523H-5-16 endef LEGACY_DEVICES += ZCN1523H516 - -define LegacyDevice/NBG_460N_550N_550NH - DEVICE_TITLE := ZyXEL NBG 460N/550N/550NH - DEVICE_PACKAGES := kmod-rtc-pcf8563 -endef -LEGACY_DEVICES += NBG_460N_550N_550NH - -define LegacyDevice/SGRW500N85BV2 - DEVICE_TITLE := GRENTECH SGR-W500-N85b v2.0 board - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage -endef -LEGACY_DEVICES += SGRW500N85BV2 - -define LegacyDevice/SGRW500EBIFITV3 - DEVICE_TITLE := GRENTECH SGR-W500-EBI(FIT) v3.0 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage -endef -LEGACY_DEVICES += SGRW500EBIFITV3 - -define LegacyDevice/AP2600I - DEVICE_TITLE := Comba MASELink AP2600-I board - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage -endef -LEGACY_DEVICES += AP2600I - -define LegacyDevice/AP2600IFM - DEVICE_TITLE := Comba MASELink AP2600-IFM board - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-storage -endef -LEGACY_DEVICES += AP2600IFM diff --git a/target/linux/ar71xx/image/senao.mk b/target/linux/ar71xx/image/generic-senao.mk similarity index 100% rename from target/linux/ar71xx/image/senao.mk rename to target/linux/ar71xx/image/generic-senao.mk diff --git a/target/linux/ar71xx/image/generic-tp-link.mk b/target/linux/ar71xx/image/generic-tp-link.mk new file mode 100644 index 000000000..b0d99e259 --- /dev/null +++ b/target/linux/ar71xx/image/generic-tp-link.mk @@ -0,0 +1,470 @@ +include ./common-tp-link.mk + + +define Device/archer-cxx + KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef + +define Device/archer-c25-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C25 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 + BOARDNAME := ARCHER-C25-V1 + TPLINK_BOARD_ID := ARCHER-C25-V1 + DEVICE_PROFILE := ARCHERC25V1 + IMAGE_SIZE := 7808k + LOADER_TYPE := elf + MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware) + SUPPORTED_DEVICES := archer-c25-v1 +endef +TARGET_DEVICES += archer-c25-v1 + +define Device/archer-c58-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C58 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C58-V1 + TPLINK_BOARD_ID := ARCHER-C58-V1 + DEVICE_PROFILE := ARCHERC58V1 + IMAGE_SIZE := 7936k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,7936k(firmware),64k(tplink)ro,64k(art)ro + SUPPORTED_DEVICES := archer-c58-v1 +endef +TARGET_DEVICES += archer-c58-v1 + +define Device/archer-c59-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C59 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C59-V1 + TPLINK_BOARD_ID := ARCHER-C59-V1 + DEVICE_PROFILE := ARCHERC59V1 + IMAGE_SIZE := 14528k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1536k(kernel),12992k(rootfs),1664k(tplink)ro,64k(art)ro,14528k@0x20000(firmware) + SUPPORTED_DEVICES := archer-c59-v1 +endef +TARGET_DEVICES += archer-c59-v1 + +define Device/archer-c60-v1 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C60 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 + BOARDNAME := ARCHER-C60-V1 + TPLINK_BOARD_ID := ARCHER-C60-V1 + DEVICE_PROFILE := ARCHERC60V1 + IMAGE_SIZE := 7936k + MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,7936k(firmware),64k(tplink)ro,64k(art)ro + SUPPORTED_DEVICES := archer-c60-v1 +endef +TARGET_DEVICES += archer-c60-v1 + +define Device/archer-c5-v1 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C5 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C5 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc5000001 +endef +TARGET_DEVICES += archer-c5-v1 + +define Device/archer-c7-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0x75000001 +endef +TARGET_DEVICES += archer-c7-v1 + +define Device/archer-c7-v2 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V2 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc7000002 + IMAGES := sysupgrade.bin factory.bin factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += archer-c7-v2 + +define Device/archer-c7-v2-il + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v2 (IL) + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V2 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0xc7000002 + TPLINK_HWREV := 0x494c0001 +endef +TARGET_DEVICES += archer-c7-v2-il + +define Device/tl-wdr7500-v3 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK Archer C7 v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7 + DEVICE_PROFILE := ARCHERC7 + TPLINK_HWID := 0x75000003 +endef +TARGET_DEVICES += tl-wdr7500-v3 + +define Device/archer-c7-v4 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK Archer C7 v4 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := ARCHER-C7-V4 + TPLINK_BOARD_ID := ARCHER-C7-V4 + IMAGE_SIZE := 15104k + LOADER_TYPE := elf + MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,1536k(kernel),13568k(rootfs),960k(config)ro,64k(art)ro,15104k@0x40000(firmware) + SUPPORTED_DEVICES := archer-c7-v4 +endef +TARGET_DEVICES += archer-c7-v4 + +define Device/cpe510-520-v1 + DEVICE_TITLE := TP-LINK CPE510/520 v1 + DEVICE_PACKAGES := rssileds + MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware) + IMAGE_SIZE := 7680k + BOARDNAME := CPE510 + TPLINK_BOARD_ID := CPE510 + DEVICE_PROFILE := CPE510 + LOADER_TYPE := elf + KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += cpe510-520-v1 + +define Device/cpe210-220-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK CPE210/220 v1 + BOARDNAME := CPE210 + TPLINK_BOARD_ID := CPE210 +endef +TARGET_DEVICES += cpe210-220-v1 + +define Device/wbs210-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK WBS210 v1 + BOARDNAME := WBS210 + TPLINK_BOARD_ID := WBS210 +endef +TARGET_DEVICES += wbs210-v1 + +define Device/wbs510-v1 + $(Device/cpe510-520-v1) + DEVICE_TITLE := TP-LINK WBS510 v1 + BOARDNAME := WBS510 + TPLINK_BOARD_ID := WBS510 +endef +TARGET_DEVICES += wbs510-v1 + +define Device/eap120-v1 + DEVICE_TITLE := TP-LINK EAP120 v1 + MTDPARTS := spi0.0:128k(u-boot)ro,64k(partition-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware) + IMAGE_SIZE := 15872k + BOARDNAME := EAP120 + TPLINK_BOARD_ID := EAP120 + DEVICE_PROFILE := EAP120 + LOADER_TYPE := elf + KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += eap120-v1 + +define Device/re450-v1 + DEVICE_TITLE := TP-LINK RE450 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + MTDPARTS := spi0.0:128k(u-boot)ro,6016k(firmware),64k(partition-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro + IMAGE_SIZE := 7936k + BOARDNAME := RE450 + TPLINK_BOARD_ID := RE450 + DEVICE_PROFILE := RE450 + LOADER_TYPE := elf + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 + TPLINK_HEADER_VERSION := 1 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += re450-v1 + +define Device/tl-mr6400-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-MR6400 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem + BOARDNAME := TL-MR6400 + DEVICE_PROFILE := TLMR6400 + TPLINK_HWID := 0x64000001 +endef +TARGET_DEVICES += tl-mr6400-v1 + +define Device/tl-wdr3500-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR3500 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWDR4300 + TPLINK_HWID := 0x35000001 +endef +TARGET_DEVICES += tl-wdr3500-v1 + +define Device/tl-wdr3600-v1 + $(Device/tl-wdr3500-v1) + DEVICE_TITLE := TP-LINK TL-WDR3600 v1 + BOARDNAME := TL-WDR4300 + TPLINK_HWID := 0x36000001 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US +endef +TARGET_DEVICES += tl-wdr3600-v1 + +define Device/tl-wdr4300-v1 + $(Device/tl-wdr3600-v1) + DEVICE_TITLE := TP-LINK TL-WDR4300 v1 + TPLINK_HWID := 0x43000001 +endef +TARGET_DEVICES += tl-wdr4300-v1 + +define Device/tl-wdr4300-v1-il + $(Device/tl-wdr3500-v1) + DEVICE_TITLE := TP-LINK TL-WDR4300 v1 (IL) + BOARDNAME := TL-WDR4300 + TPLINK_HWID := 0x43008001 +endef +TARGET_DEVICES += tl-wdr4300-v1-il + +define Device/tl-wdr4310-v1 + $(Device/tl-wdr4300-v1-il) + DEVICE_TITLE := TP-LINK TL-WDR4310 v1 + TPLINK_HWID := 0x43100001 +endef +TARGET_DEVICES += tl-wdr4310-v1 + +define Device/tl-wdr4900-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR4900 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR4900-v2 + DEVICE_PROFILE := TLWDR4900V2 + TPLINK_HWID := 0x49000002 +endef +TARGET_DEVICES += tl-wdr4900-v2 + +define Device/tl-wdr6500-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WDR6500 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x + KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header + BOARDNAME := TL-WDR6500-v2 + DEVICE_PROFILE := TLWDR6500V2 + TPLINK_HWID := 0x65000002 + TPLINK_HEADER_VERSION := 2 +endef +TARGET_DEVICES += tl-wdr6500-v2 + +define Device/mw4530r-v1 + $(Device/tl-wdr4300-v1) + DEVICE_TITLE := Mercury MW4530R v1 + TPLINK_HWID := 0x45300001 +endef +TARGET_DEVICES += mw4530r-v1 + +define Device/tl-wpa8630-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WPA8630 v1 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := TL-WPA8630 + DEVICE_PROFILE := TL-WPA8630 + TPLINK_HWID := 0x86300001 +endef +TARGET_DEVICES += tl-wpa8630-v1 + +define Device/tl-wr1043n-v5 + $(Device/archer-cxx) + DEVICE_TITLE := TP-LINK TL-WR1043N v5 + BOARDNAME := TL-WR1043N-v5 + SUPPORTED_DEVICES := tl-wr1043n-v5 + DEVICE_PROFILE := TLWR1043 + MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,15104k(firmware),128k(product-info)ro,640k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(art)ro + IMAGE_SIZE := 15104k + TPLINK_BOARD_ID := TLWR1043NV5 +endef +TARGET_DEVICES += tl-wr1043n-v5 + +define Device/tl-wr1043nd-v1 + $(Device/tplink-8m) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430001 +endef +TARGET_DEVICES += tl-wr1043nd-v1 + +define Device/tl-wr1043nd-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND-v2 + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430002 +endef +TARGET_DEVICES += tl-wr1043nd-v2 + +define Device/tl-wr1043nd-v3 + $(Device/tl-wr1043nd-v2) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3 + TPLINK_HWID := 0x10430003 +endef +TARGET_DEVICES += tl-wr1043nd-v3 + +define Device/tl-wr1043nd-v4 + $(Device/tplink) + DEVICE_TITLE := TP-LINK TL-WR1043N/ND v4 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR1043ND-v4 + DEVICE_PROFILE := TLWR1043 + TPLINK_HWID := 0x10430004 + MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware) + IMAGE_SIZE := 15552k + TPLINK_BOARD_ID := TLWR1043NDV4 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory +endef +TARGET_DEVICES += tl-wr1043nd-v4 + +define Device/tl-wr2543-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR2543N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR2543N + DEVICE_PROFILE := TLWR2543 + TPLINK_HWID := 0x25430001 + IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99 +endef +TARGET_DEVICES += tl-wr2543-v1 + +define Device/tl-wr710n-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR710N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR710N + DEVICE_PROFILE := TLWR710 + TPLINK_HWID := 0x07100001 + CONSOLE := ttyATH0,115200 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US +endef +TARGET_DEVICES += tl-wr710n-v1 + +define Device/tl-wr710n-v2.1 + $(Device/tl-wr710n-v1) + DEVICE_TITLE := TP-LINK TL-WR710N v2.1 + TPLINK_HWID := 0x07100002 + TPLINK_HWREV := 0x00000002 +endef +TARGET_DEVICES += tl-wr710n-v2.1 + +define Device/tl-wr810n-v1 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR810N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR810N + DEVICE_PROFILE := TLWR810 + TPLINK_HWID := 0x08100001 +endef +TARGET_DEVICES += tl-wr810n-v1 + +define Device/tl-wr810n-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR810N v2 + BOARDNAME := TL-WR810N-v2 + DEVICE_PROFILE := TLWR810 + TPLINK_HWID := 0x08100002 +endef +TARGET_DEVICES += tl-wr810n-v2 + +define Device/tl-wr842n-v1 + $(Device/tplink-8m) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x08420001 +endef +TARGET_DEVICES += tl-wr842n-v1 + +define Device/tl-wr842n-v2 + $(Device/tplink-8mlzma) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR842N-v2 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x8420002 +endef +TARGET_DEVICES += tl-wr842n-v2 + +define Device/tl-wr842n-v3 + $(Device/tplink-16mlzma) + DEVICE_TITLE := TP-LINK TL-WR842N/ND v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR842N-v3 + DEVICE_PROFILE := TLWR842 + TPLINK_HWID := 0x08420003 +endef +TARGET_DEVICES += tl-wr842n-v3 + +define Device/tl-wr902ac-v1 + DEVICE_TITLE := TP-LINK TL-WR902AC v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport \ + kmod-ath10k ath10k-firmware-qca9887 -swconfig -uboot-envtools + BOARDNAME := TL-WR902AC-V1 + DEVICE_PROFILE := TLWR902 + TPLINK_BOARD_ID := TL-WR902AC-V1 + TPLINK_HWID := 0x0 + TPLINK_HWREV := 0 + TPLINK_HEADER_VERSION := 1 + SUPPORTED_DEVICES := tl-wr902ac-v1 + IMAGE_SIZE := 7360k + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGES += factory.bin + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro +endef +TARGET_DEVICES += tl-wr902ac-v1 + +define Device/tl-wr942n-v1 + DEVICE_TITLE := TP-LINK TL-WR942N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WR942N-V1 + TPLINK_BOARD_ID := TLWR942NV1 + DEVICE_PROFILE := TLWR942 + IMAGE_SIZE := 14464k + KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ + append-metadata | check-size $$$$(IMAGE_SIZE) + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + MTDPARTS := spi0.0:128k(u-boot)ro,14464k(firmware),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro + SUPPORTED_DEVICES := tl-wr942n-v1 +endef +TARGET_DEVICES += tl-wr942n-v1 diff --git a/target/linux/ar71xx/image/ubnt.mk b/target/linux/ar71xx/image/generic-ubnt.mk similarity index 91% rename from target/linux/ar71xx/image/ubnt.mk rename to target/linux/ar71xx/image/generic-ubnt.mk index dfc795bb2..2735c7491 100644 --- a/target/linux/ar71xx/image/ubnt.mk +++ b/target/linux/ar71xx/image/generic-ubnt.mk @@ -71,31 +71,35 @@ define Device/rw2458n DEVICE_TITLE := Ubiquiti RW2458N BOARDNAME := RW2458N endef +TARGET_DEVICES += rw2458n define Device/ubnt-airrouter $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti AirRouter BOARDNAME := UBNT-AR endef +TARGET_DEVICES += ubnt-airrouter define Device/ubnt-bullet-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Bullet-M BOARDNAME := UBNT-BM endef +TARGET_DEVICES += ubnt-bullet-m define Device/ubnt-rocket-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Rocket-M BOARDNAME := UBNT-RM endef +TARGET_DEVICES += ubnt-rocket-m define Device/ubnt-nano-m $(Device/ubnt-xm) DEVICE_TITLE := Ubiquiti Nano-M BOARDNAME := UBNT-NM endef -TARGET_DEVICES += rw2458n ubnt-airrouter ubnt-bullet-m ubnt-rocket-m ubnt-nano-m +TARGET_DEVICES += ubnt-nano-m define Device/ubnt-unifi $(Device/ubnt-bz) @@ -103,6 +107,7 @@ define Device/ubnt-unifi BOARDNAME := UBNT-UF DEVICE_PROFILE += UBNTUNIFI endef +TARGET_DEVICES += ubnt-unifi define Device/ubnt-unifiac DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -120,11 +125,13 @@ define Device/ubnt-unifiac-lite DEVICE_PROFILE += UBNTUNIFIACLITE BOARDNAME := UBNT-UF-AC-LITE endef +TARGET_DEVICES += ubnt-unifiac-lite define Device/ubnt-unifiac-mesh $(Device/ubnt-unifiac-lite) DEVICE_TITLE := Ubiquiti UniFi AC-Mesh endef +TARGET_DEVICES += ubnt-unifiac-mesh define Device/ubnt-unifiac-pro $(Device/ubnt-unifiac) @@ -133,6 +140,7 @@ define Device/ubnt-unifiac-pro DEVICE_PROFILE += UBNTUNIFIACPRO BOARDNAME := UBNT-UF-AC-PRO endef +TARGET_DEVICES += ubnt-unifiac-pro define Device/ubnt-unifi-outdoor $(Device/ubnt-bz) @@ -140,25 +148,28 @@ define Device/ubnt-unifi-outdoor BOARDNAME := UBNT-U20 DEVICE_PROFILE += UBNTUNIFIOUTDOOR endef -TARGET_DEVICES += ubnt-unifi ubnt-unifiac-lite ubnt-unifiac-mesh ubnt-unifiac-pro ubnt-unifi-outdoor +TARGET_DEVICES += ubnt-unifi-outdoor define Device/ubnt-nano-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Nano M XW BOARDNAME := UBNT-NM-XW endef +TARGET_DEVICES += ubnt-nano-m-xw define Device/ubnt-loco-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Loco XW BOARDNAME := UBNT-LOCO-XW endef +TARGET_DEVICES += ubnt-loco-m-xw define Device/ubnt-rocket-m-xw $(Device/ubnt-xw) DEVICE_TITLE := Ubiquiti Rocket M XW BOARDNAME := UBNT-RM-XW endef +TARGET_DEVICES += ubnt-rocket-m-xw define Device/ubnt-rocket-m-ti $(Device/ubnt-xw) @@ -166,7 +177,7 @@ define Device/ubnt-rocket-m-ti BOARDNAME := UBNT-RM-TI UBNT_TYPE := TI endef -TARGET_DEVICES += ubnt-nano-m-xw ubnt-loco-m-xw ubnt-rocket-m-xw ubnt-rocket-m-ti +TARGET_DEVICES += ubnt-rocket-m-ti define Device/ubnt-air-gateway $(Device/ubnt-xm) @@ -176,6 +187,7 @@ define Device/ubnt-air-gateway UBNT_CHIP := ar933x CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += ubnt-air-gateway define Device/ubnt-air-gateway-pro $(Device/ubnt-xm) @@ -184,6 +196,7 @@ define Device/ubnt-air-gateway-pro UBNT_TYPE := AirGWP UBNT_CHIP := ar934x endef +TARGET_DEVICES += ubnt-air-gateway-pro define Device/ubdev01 $(Device/ubnt-xm) @@ -192,7 +205,7 @@ define Device/ubdev01 BOARDNAME := UBNT-UF UBNT_BOARD := UBDEV01 endef -TARGET_DEVICES += ubnt-air-gateway ubnt-air-gateway-pro ubdev01 +TARGET_DEVICES += ubdev01 define Device/ubnt-routerstation DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 @@ -213,6 +226,7 @@ define Device/ubnt-rs UBNT_TYPE := RSx UBNT_CHIP := ar7100 endef +TARGET_DEVICES += ubnt-rs define Device/ubnt-rspro $(Device/ubnt-routerstation) @@ -223,6 +237,7 @@ define Device/ubnt-rspro UBNT_TYPE := RSPRO UBNT_CHIP := ar7100pro endef +TARGET_DEVICES += ubnt-rspro define Device/ubnt-ls-sr71 $(Device/ubnt-routerstation) @@ -232,7 +247,7 @@ define Device/ubnt-ls-sr71 UBNT_TYPE := LS-SR71 UBNT_CHIP := ar7100 endef -TARGET_DEVICES += ubnt-rs ubnt-rspro ubnt-ls-sr71 +TARGET_DEVICES += ubnt-ls-sr71 define Device/ubnt-uap-pro DEVICE_TITLE := Ubiquiti UAP Pro diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 3c0d99440..89ab1f029 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -231,7 +231,7 @@ TARGET_DEVICES += dragino2 define Device/ew-dorin DEVICE_TITLE := Embedded Wireless Dorin Platform - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea + DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea BOARDNAME = EW-DORIN CONSOLE := ttyATH0,115200 IMAGE_SIZE = 16000k @@ -241,7 +241,7 @@ TARGET_DEVICES += ew-dorin define Device/ew-dorin-router DEVICE_TITLE := Embedded Wireless Dorin Router Platform - DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea + DEVICE_PACKAGES := kmod-usb-core kmod-usb-chipidea BOARDNAME = EW-DORIN-ROUTER CONSOLE := ttyATH0,115200 IMAGE_SIZE = 16000k @@ -341,13 +341,23 @@ define Device/mr12 IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs | pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) IMAGES := kernel.bin rootfs.bin sysupgrade.bin endef +TARGET_DEVICES += mr12 define Device/mr16 $(Device/mr12) DEVICE_TITLE := Meraki MR16 BOARDNAME := MR16 endef -TARGET_DEVICES += mr12 mr16 +TARGET_DEVICES += mr16 + +define Device/dr342 + DEVICE_TITLE := Wallys DR342 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 -swconfig + BOARDNAME := DR342 + IMAGE_SIZE := 16000k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env),64k(partition-table)ro,16000k(firmware),64k(art)ro +endef +TARGET_DEVICES += dr342 define Device/dr344 DEVICE_TITLE := Wallys DR344 @@ -383,6 +393,7 @@ define Device/wndr3700 IMAGE/factory.img := $$(IMAGE/default) | netgear-dni | check-size $$$$(IMAGE_SIZE) IMAGE/factory-NA.img := $$(IMAGE/default) | netgear-dni NA | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wndr3700 define Device/wndr3700v2 $(Device/wndr3700) @@ -394,6 +405,7 @@ define Device/wndr3700v2 MTDPARTS := spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,15872k(firmware),64k(art)ro IMAGES := sysupgrade.bin factory.img endef +TARGET_DEVICES += wndr3700v2 define Device/wndr3800 $(Device/wndr3700v2) @@ -401,25 +413,28 @@ define Device/wndr3800 NETGEAR_BOARD_ID := WNDR3800 NETGEAR_HW_ID := 29763654+16+128 endef +TARGET_DEVICES += wndr3800 define Device/wndr3800ch $(Device/wndr3800) DEVICE_TITLE := NETGEAR WNDR3800 (Ch) NETGEAR_BOARD_ID := WNDR3800CH endef +TARGET_DEVICES += wndr3800ch define Device/wndrmac $(Device/wndr3700v2) DEVICE_TITLE := NETGEAR WNDRMAC NETGEAR_BOARD_ID := WNDRMAC endef +TARGET_DEVICES += wndrmac define Device/wndrmacv2 $(Device/wndr3800) DEVICE_TITLE := NETGEAR WNDRMAC v2 NETGEAR_BOARD_ID := WNDRMACv2 endef -TARGET_DEVICES += wndr3700 wndr3700v2 wndr3800 wndr3800ch wndrmac wndrmacv2 +TARGET_DEVICES += wndrmacv2 define Device/cap324 DEVICE_TITLE := PowerCloud CAP324 Cloud AP @@ -496,6 +511,7 @@ define Device/antminer-s1 TPLINK_HWID := 0x04440101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antminer-s1 define Device/antminer-s3 $(Device/tplink-8mlzma) @@ -506,6 +522,7 @@ define Device/antminer-s3 TPLINK_HWID := 0x04440301 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antminer-s3 define Device/antrouter-r1 $(Device/tplink-8mlzma) @@ -516,6 +533,7 @@ define Device/antrouter-r1 TPLINK_HWID := 0x44440101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += antrouter-r1 define Device/el-m150 $(Device/tplink-8mlzma) @@ -526,6 +544,7 @@ define Device/el-m150 TPLINK_HWID := 0x01500101 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += el-m150 define Device/el-mini $(Device/tplink-8mlzma) @@ -536,7 +555,7 @@ define Device/el-mini TPLINK_HWID := 0x01530001 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += antminer-s1 antminer-s3 antrouter-r1 el-m150 el-mini +TARGET_DEVICES += el-mini define Device/gl-inet-6408A-v1 $(Device/tplink-8mlzma) @@ -547,6 +566,7 @@ define Device/gl-inet-6408A-v1 TPLINK_HWID := 0x08000001 CONSOLE := ttyATH0,115200 endef +TARGET_DEVICES += gl-inet-6408A-v1 define Device/gl-inet-6416A-v1 $(Device/tplink-16mlzma) @@ -557,7 +577,7 @@ define Device/gl-inet-6416A-v1 TPLINK_HWID := 0x08000001 CONSOLE := ttyATH0,115200 endef -TARGET_DEVICES += gl-inet-6408A-v1 gl-inet-6416A-v1 +TARGET_DEVICES += gl-inet-6416A-v1 define Device/jwap230 DEVICE_TITLE := jjPlus JWAP230 @@ -577,16 +597,6 @@ define Device/r602n endef TARGET_DEVICES += r602n -define Device/rnx-n360rt - $(Device/tplink-4m) - DEVICE_TITLE := Rosewill RNX-N360RT - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := RNXN360RT - TPLINK_HWID := 0x09410002 - TPLINK_HWREV := 0x00420001 -endef -TARGET_DEVICES += rnx-n360rt - define Device/mc-mac1200r $(Device/tplink-8mlzma) DEVICE_TITLE := Mercury MAC1200R @@ -597,15 +607,6 @@ define Device/mc-mac1200r endef TARGET_DEVICES += mc-mac1200r -define Device/mw316r-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := Mercury MW316R v1 - BOARDNAME := MW316R-v1 - DEVICE_PROFILE := MW316R - TPLINK_HWID := 0x03160001 -endef -TARGET_DEVICES += mw316r-v1 - define Device/minibox-v1 $(Device/tplink-16mlzma) DEVICE_TITLE := Gainstrong MiniBox V1.0 @@ -625,6 +626,7 @@ define Device/omy-g1 DEVICE_PROFILE := OMYG1 TPLINK_HWID := 0x06660101 endef +TARGET_DEVICES += omy-g1 define Device/omy-x1 $(Device/tplink-8mlzma) @@ -633,7 +635,7 @@ define Device/omy-x1 DEVICE_PROFILE := OMYX1 TPLINK_HWID := 0x06660201 endef -TARGET_DEVICES += omy-g1 omy-x1 +TARGET_DEVICES += omy-x1 define Device/onion-omega $(Device/tplink-16mlzma) @@ -826,6 +828,7 @@ define Device/dir-869-a1 seama | seama-seal -m "signature=$$$$(SEAMA_SIGNATURE)" | \ check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += dir-869-a1 define Device/mynet-n600 $(Device/seama) @@ -836,6 +839,7 @@ define Device/mynet-n600 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro SEAMA_SIGNATURE := wrgnd16_wd_db600 endef +TARGET_DEVICES += mynet-n600 define Device/mynet-n750 $(Device/seama) @@ -846,6 +850,7 @@ define Device/mynet-n750 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,64k(devdata)ro,64k(devconf)ro,15872k(firmware),64k(radiocfg)ro SEAMA_SIGNATURE := wrgnd13_wd_av endef +TARGET_DEVICES += mynet-n750 define Device/qihoo-c301 $(Device/seama) @@ -856,7 +861,7 @@ define Device/qihoo-c301 MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(devdata),64k(devconf),15744k(firmware),64k(warm_start),64k(action_image_config),64k(radiocfg)ro;spi0.1:15360k(upgrade2),1024k(privatedata) SEAMA_SIGNATURE := wrgac26_qihoo360_360rg endef -TARGET_DEVICES += dir-869-a1 mynet-n600 mynet-n750 qihoo-c301 +TARGET_DEVICES += qihoo-c301 define Device/dap-2695-a1 DEVICE_TITLE := D-Link DAP-2695 rev. A1 @@ -897,6 +902,7 @@ define Device/wpj342 DEVICE_TITLE := Compex WPJ342 (16MB flash) BOARDNAME := WPJ342 endef +TARGET_DEVICES += wpj342 define Device/wpj344 $(Device/wpj-16m) @@ -906,12 +912,14 @@ define Device/wpj344 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wpj344 define Device/wpj531 $(Device/wpj-16m) DEVICE_TITLE := Compex WPJ531 (16MB flash) BOARDNAME := WPJ531 endef +TARGET_DEVICES += wpj531 define Device/wpj558 $(Device/wpj-16m) @@ -921,13 +929,14 @@ define Device/wpj558 IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += wpj558 define Device/wpj563 $(Device/wpj-16m) DEVICE_TITLE := Compex WPJ563 (16MB flash) BOARDNAME := WPJ563 endef -TARGET_DEVICES += wpj342 wpj344 wpj531 wpj558 wpj563 +TARGET_DEVICES += wpj563 define Device/wrtnode2q DEVICE_TITLE := WRTnode2Q diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index a4b97a86a..3c484713d 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -271,11 +271,10 @@ wnr2000v3_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmw wnr2000v4_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,3776k(firmware),64k(art)ro r6100_mtdlayout=mtdparts=ar934x-nfc:128k(u-boot)ro,256k(caldata)ro,256k(caldata-backup),512k(config),512k(pot),2048k(kernel),122240k(ubi),25600k@0x1a0000(firmware),2048k(language),3072k(traffic_meter) tew823dru_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(nvram)ro,15296k(firmware),192k(lang)ro,512k(my-dlink)ro,64k(mac)ro,64k(art)ro -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),121856k(ubi),123904k@0x6c0000(firmware),256k(caldata_backup),-(reserved) +wndr4300_mtdlayout=mtdparts=ar934x-nfc:256k(u-boot)ro,256k(u-boot-env)ro,256k(caldata)ro,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_rext_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,7808k(firmware),64k(nvram)ro,64k(ART)ro zyx_nbg6716_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(env)ro,64k(RFdata)ro,-(nbu);ar934x-nfc:2048k(zyxel_rfsd),2048k(romd),1024k(header),2048k(kernel),-(ubi) -ap2600ifm_256kblk_mtdlayout=mtdparts=spi0.0:256k(breed)ro,256k(breed-env)ro,1536k(kernel),14336k(rootfs),15872k@0x80000(firmware) define Image/BuildKernel cp $(KDIR)/vmlinux.elf $(VMLINUX).elf @@ -902,25 +901,6 @@ $(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$( $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC)) -$(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00")) -$(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02")) -$(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01")) - -$(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03")) -$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00")) -$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05")) - -$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00")) -$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00")) - -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05")) -$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02")) - -$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,"")) -$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA")) $(eval $(call SingleProfile,CameoAP121_8M,64kraw-nojffs,DIR505A1,dir-505-a1,DIR-505-A1,ttyATH0,115200,"HORNET-PACKET-DIR505A1-3",1.99.99,"")) $(eval $(call SingleProfile,CameoAP135,64kraw,DGL5500A1,dgl-5500-a1,DGL-5500-A1,ttyS0,115200,$$(dgl_5500_mtdlayout),"00AP135AR9558-RT-130508-00")) @@ -949,22 +929,12 @@ $(eval $(call SingleProfile,EnGenius,64k,ESR900,esr900,ESR900,ttyS0,115200,$$(es $(eval $(call SingleProfile,EnGenius,64k,ESR1750,esr1750,ESR1750,ttyS0,115200,$$(esr1750_mtdlayout),KRuImage,,0x61)) $(eval $(call SingleProfile,EnGenius,64k,EPG5000,epg5000,EPG5000,ttyS0,115200,$$(epg5000_mtdlayout),KRuImage,,0x71)) -$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M)) $(eval $(call SingleProfile,MyLoader,64k,WP543_8M,wp543,,ttyS0,115200,0x800000,8M)) $(eval $(call SingleProfile,MyLoader,64k,WP543_16M,wp543,,ttyS0,115200,0x1000000,16M)) -$(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M)) $(eval $(call SingleProfile,MyLoader,64k,WPE72_8M,wpe72,,ttyS0,115200,0x800000,8M)) $(eval $(call SingleProfile,MyLoader,64k,WPE72_16M,wpe72,,ttyS0,115200,0x1000000,16M)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32)) -$(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,)) $(eval $(call SingleProfile,Netgear,64kraw,WNR2200,wnr2200,WNR2200,ttyS0,115200,$$(wnr2200_mtdlayout),0x32323030,wnr2200,"" NA,)) -$(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",)) -$(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,A60,a60,,,,A60)) $(eval $(call SingleProfile,OpenMesh,squashfs-only,OM2P,om2p,,,,OM2P)) @@ -987,11 +957,6 @@ $(eval $(call SingleProfile,Planex,64kraw,MZKW300NH,mzk-w300nh,MZK-W300NH,ttyS0, $(eval $(call SingleProfile,Senao,squashfs-only,EAP300V2,eap300v2,EAP300V2,ttyS0,115200,$$(eap300v2_mtdlayout))) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN)) -$(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N)) - $(eval $(call SingleProfile,WRT400N,64k,WRT400N,wrt400n,WRT400N,ttyS0,115200)) $(eval $(call SingleProfile,WZRHP128K,128kraw,WZRHPG300NH,wzr-hp-g300nh,WZR-HP-G300NH,ttyS0,115200,WZR-HP-G300NH)) @@ -1004,14 +969,53 @@ $(eval $(call SingleProfile,WZRHP64K,64kraw,WZR450HP2,wzr-450hp2,WZR-450HP2,ttyS $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H28,zcn-1523h-2-8,ZCN-1523H-2,ttyS0,115200,$$(zcn1523h_mtdlayout))) $(eval $(call SingleProfile,Zcomax,64k,ZCN1523H516,zcn-1523h-5-16,ZCN-1523H-5,ttyS0,115200,$$(zcn1523h_mtdlayout))) -$(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N)) -$(eval $(call SingleProfile,AthLzma,64k,SGRW500N85BV2,sgr-w500-n85b-v2,SGRW500N85BV2,ttyS0,115200,$$(ap147_mtdlayout),RKuImage)) -$(eval $(call SingleProfile,AthLzma,64k,SGRW500EBIFITV3,sgr-w500-ebi-fit-v3,SGRW500EBIFITV3,ttyS0,115200,$$(ap96_mtdlayout),RKuImage)) -$(eval $(call SingleProfile,AthLzma,64k,AP2600I,maselink-ap2600i,AP2600I,ttyS0,115200,$$(ap147_mtdlayout),RKuImage)) -$(eval $(call SingleProfile,AthLzma,256k,AP2600IFM,maselink-ap2600ifm,AP2600IFM,ttyS0,115200,$$(ap2600ifm_256kblk_mtdlayout) ahbskip=1,KRuImage)) - endif # ifeq ($(SUBTARGET),generic) + +ifeq ($(SUBTARGET),tiny) + +$(eval $(call SingleProfile,CameoAP91,64kraw,DIR600A1,dir-600-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-00")) +$(eval $(call SingleProfile,CameoAP91,64kraw,DIR601A1,dir-601-a1,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-02")) +$(eval $(call SingleProfile,CameoAP91,64kraw,FR54RTR,fr-54rtr,DIR-600-A1,ttyS0,115200,"AP91-AR7240-RT-090223-01")) + +$(eval $(call SingleProfile,CameoAP99,64kraw,EBR2310C1,ebr-2310-c1,EBR-2310-C1,ttyS0,115200,"AP91-AR7240-RT-090223-03")) +$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E1,dir-615-e1,DIR-615-E1,ttyS0,115200,"AP93-AR7240-RT-081028-00")) +$(eval $(call SingleProfile,CameoAP99,64kraw,DIR615E4,dir-615-e4,DIR-615-E4,ttyS0,115200,"AP99-AR7240-RT-091105-05")) + +$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I1,dir-615-i1,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-1012I1-00")) +$(eval $(call SingleProfile,CameoAP123_4M,64kraw,DIR615I3,dir-615-i3,DIR-615-I1,ttyS0,115200,"00DB120AR9341-RT-101214-00")) + +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,A02RBW300N,a02-rb-w300n,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-03")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,DIR615C1,dir-615-c1,DIR-615-C1,ttyS0,115200,"AP81-AR9130-RT-070614-02")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW632BRP,tew-632brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-00")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_FW,tew-652brp,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-080609-05")) +$(eval $(call SingleProfile,CameoAP81,64kraw-nojffs,TEW652BRP_RECOVERY,tew-652brp-recovery,TEW-632BRP,ttyS0,115200,"AP81-AR9130-RT-070614-02")) + +$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,TEW712BR,tew-712br,TEW-712BR,ttyATH0,115200,"HORNET-RT-TEW712BR-3",1.99,"")) +$(eval $(call SingleProfile,CameoAP121,64kraw-nojffs,DIR601B1,dir-601-b1,TEW-712BR,ttyATH0,115200,"HORNET-RT-DIR601B1-3",2.99.99,"" "NA")) + +$(eval $(call SingleProfile,MyLoader,64k,WP543_4M,wp543,,ttyS0,115200,0x400000,4M)) +$(eval $(call SingleProfile,MyLoader,64k,WPE72_4M,wpe72,,ttyS0,115200,0x400000,4M)) + +$(eval $(call SingleProfile,Netgear,64kraw,WNR2000V3,wnr2000v3,WNR2000V3,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303033,WNR2000V3,"" NA,-H 29763551+04+32)) +$(eval $(call SingleProfile,NetgearLzma,64kraw,WNR2000V4,wnr2000v4,WNR2000V4,ttyS0,115200,$$(wnr2000v4_mtdlayout),0x32303034,WNR2000V4,"" NA,)) +$(eval $(call SingleProfile,Netgear,64kraw,WNR2000,wnr2000,WNR2000,ttyS0,115200,$$(wnr2000_mtdlayout),0x32303031,WNR2000,"" NA,)) +$(eval $(call SingleProfile,Netgear,64kraw,REALWNR612V2,wnr612v2,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,WNR612V2,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,N150R,n150r,WNR612V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x32303631,N150R,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,REALWNR1000V2,wnr1000v2,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303031,WNR1000V2,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,WNR1000V2_VC,wnr1000v2-vc,WNR1000V2,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31303030,WNR1000V2-VC,"",)) +$(eval $(call SingleProfile,Netgear,64kraw,WPN824N,wpn824n,WPN824N,ttyS0,115200,$$(wnr2000v3_mtdlayout),0x31313030,WPN824N,"" NA,)) + +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRG301N,whr-g301n,WHR-G301N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-G301N)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPG300N,whr-hp-g300n,WHR-HP-G300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-G300N)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WHRHPGN,whr-hp-gn,WHR-HP-GN,ttyS0,115200,$$(whrhpg300n_mtdlayout),WHR-HP-GN)) +$(eval $(call SingleProfile,WHRHPG300N,64kraw,WLAEAG300N,wlae-ag300n,WLAE-AG300N,ttyS0,115200,$$(whrhpg300n_mtdlayout),WLAE-AG300N)) + +$(eval $(call SingleProfile,ZyXEL,64k,NBG_460N_550N_550NH,nbg460n_550n_550nh,NBG460N,ttyS0,115200,NBG-460N)) + +endif # ifeq ($(SUBTARGET),tiny) + + ifeq ($(SUBTARGET),nand) $(eval $(call SingleProfile,NetgearNAND,64k,WNDR3700V4,wndr3700v4,WNDR3700_V4,ttyS0,115200,$$(wndr4300_mtdlayout),0x33373033,WNDR3700v4,"",-H 29763948+128+128,wndr4300)) diff --git a/target/linux/ar71xx/image/lzma-loader/src/Makefile b/target/linux/ar71xx/image/lzma-loader/src/Makefile index 682b31fe8..c54f64a55 100644 --- a/target/linux/ar71xx/image/lzma-loader/src/Makefile +++ b/target/linux/ar71xx/image/lzma-loader/src/Makefile @@ -33,7 +33,7 @@ BIN_FLAGS := -O binary -R .reginfo -R .note -R .comment -R .mdebug \ CFLAGS = -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -Os \ -fno-strict-aliasing -fno-common -fomit-frame-pointer -G 0 \ -mno-abicalls -fno-pic -ffunction-sections -pipe -mlong-calls \ - -fno-common -ffreestanding -fhonour-copts \ + -fno-common -ffreestanding -fhonour-copts -nostartfiles \ -mabi=32 -march=mips32r2 \ -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap CFLAGS += -D_LZMA_PROB32 diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk index 8f7d7cce9..fd6ca2793 100644 --- a/target/linux/ar71xx/image/mikrotik.mk +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -15,29 +15,40 @@ define Device/nand-64m DEVICE_TITLE := MikroTik RouterBoard (64 MB NAND) KERNEL := kernel-bin | kernel2minor -s 512 -e -c endef +TARGET_DEVICES += nand-64m define Device/nand-large $(Device/mikrotik) DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND) KERNEL := kernel-bin | kernel2minor -s 2048 -e -c endef -TARGET_DEVICES += nand-64m nand-large +TARGET_DEVICES += nand-large + +define Device/nand-large-ac + $(Device/mikrotik) + DEVICE_TITLE := MikroTik RouterBoard (>= 128 MB NAND, 802.11ac) + DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x + KERNEL := kernel-bin | kernel2minor -s 2048 -e -c + SUPPORTED_DEVICES := rb-921gs-5hpacd-r2 +endef +TARGET_DEVICES += nand-large-ac define Device/rb-nor-flash-16M DEVICE_TITLE := MikroTik RouterBoard (16 MB SPI NOR) - DEVICE_PACKAGES := rbcfg rssileds -nand-utils + DEVICE_PACKAGES := rbcfg rssileds -nand-utils kmod-ledtrig-gpio IMAGE_SIZE := 16000k LOADER_TYPE := elf KERNEL_INSTALL := 1 KERNEL := kernel-bin | lzma | loader-kernel - SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-mapl-2nd + SUPPORTED_DEVICES := rb-750-r2 rb-750up-r2 rb-750p-pbr2 rb-941-2nd rb-951ui-2nd rb-952ui-5ac2nd rb-962uigs-5hact2hnt rb-lhg-5nd rb-map-2nd rb-mapl-2nd rb-wap-2nd IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 -e | pad-to $$$$(BLOCKSIZE) | \ append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) endef +TARGET_DEVICES += rb-nor-flash-16M define Device/rb-nor-flash-16M-ac $(Device/rb-nor-flash-16M) DEVICE_TITLE := MikroTik RouterBoard (16 MB SPI NOR, 802.11ac) DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x ath10k-firmware-qca9887 endef -TARGET_DEVICES += rb-nor-flash-16M rb-nor-flash-16M-ac +TARGET_DEVICES += rb-nor-flash-16M-ac diff --git a/target/linux/ar71xx/image/tiny-legacy-devices.mk b/target/linux/ar71xx/image/tiny-legacy-devices.mk new file mode 100644 index 000000000..3445c4c8c --- /dev/null +++ b/target/linux/ar71xx/image/tiny-legacy-devices.mk @@ -0,0 +1,154 @@ +define LegacyDevice/DIR600A1 + DEVICE_TITLE := D-Link DIR-600 rev. A1 +endef +LEGACY_DEVICES += DIR600A1 + +define LegacyDevice/DIR601A1 + DEVICE_TITLE := D-Link DIR-601 rev. A1 +endef +LEGACY_DEVICES += DIR601A1 + +define LegacyDevice/FR54RTR + DEVICE_TITLE := Frys FR-54RTR +endef +LEGACY_DEVICES += FR54RTR + +define LegacyDevice/EBR2310C1 + DEVICE_TITLE := D-Link EBR-2310 rev. C1 +endef +LEGACY_DEVICES += EBR2310C1 + +define LegacyDevice/DIR615E1 + DEVICE_TITLE := D-Link DIR-615 rev. E1 +endef +LEGACY_DEVICES += DIR615E1 + +define LegacyDevice/DIR615E4 + DEVICE_TITLE := D-Link DIR-615 rev. E4 +endef +LEGACY_DEVICES += DIR615E4 + +define LegacyDevice/DIR615I1 + DEVICE_TITLE := D-Link DIR-615 rev. I1 +endef +LEGACY_DEVICES += DIR615I1 + +define LegacyDevice/DIR615I3 + DEVICE_TITLE := D-Link DIR-615 rev. I3 +endef +LEGACY_DEVICES += DIR615I3 + +define LegacyDevice/A02RBW300N + DEVICE_TITLE := Atlantis-Land A02-RB-W300N +endef +LEGACY_DEVICES += A02RBW300N + +define LegacyDevice/DIR615C1 + DEVICE_TITLE := D-Link DIR-615 rev. C1 +endef +LEGACY_DEVICES += DIR615C1 + +define LegacyDevice/TEW632BRP + DEVICE_TITLE := TRENDNet TEW-632BRP +endef +LEGACY_DEVICES += TEW632BRP + +define LegacyDevice/TEW652BRP_FW + DEVICE_TITLE := TRENDNet TEW-652BRP +endef +LEGACY_DEVICES += TEW652BRP_FW + +define LegacyDevice/TEW652BRP_RECOVERY + DEVICE_TITLE := TRENDNet TEW-652BRP (recovery) +endef +LEGACY_DEVICES += TEW652BRP_RECOVERY + +define LegacyDevice/TEW712BR + DEVICE_TITLE := TRENDNet TEW-712BR +endef +LEGACY_DEVICES += TEW712BR + +define LegacyDevice/DIR601B1 + DEVICE_TITLE := D-Link DIR-601 rev. B1 +endef +LEGACY_DEVICES += DIR601B1 + +define LegacyDevice/WP543_4M + DEVICE_TITLE := Compex WP543/WPJ543 (4MB flash) + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 +endef +LEGACY_DEVICES += WP543_4M + +define LegacyDevice/WPE72_4M + DEVICE_TITLE := Compex WPE72/WPE72NX (4MB flash) + DEVICE_PACKAGES := kmod-usb-core kmod-usb-ohci kmod-usb2 +endef +LEGACY_DEVICES += WPE72_4M + +define LegacyDevice/WNR2000 + DEVICE_TITLE := NETGEAR WNR2000V1 +endef +LEGACY_DEVICES += WNR2000 + +define LegacyDevice/WNR2000V3 + DEVICE_TITLE := NETGEAR WNR2000V3 +endef +LEGACY_DEVICES += WNR2000V3 + +define LegacyDevice/WNR2000V4 + DEVICE_TITLE := NETGEAR WNR2000V4 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport +endef +LEGACY_DEVICES += WNR2000V4 + +define LegacyDevice/REALWNR612V2 + DEVICE_TITLE := NETGEAR WNR612V2 +endef +LEGACY_DEVICES += REALWNR612V2 + +define LegacyDevice/N150R + DEVICE_TITLE := On Networks N150 +endef +LEGACY_DEVICES += N150R + +define LegacyDevice/REALWNR1000V2 + DEVICE_TITLE := NETGEAR WNR1000V2 +endef +LEGACY_DEVICES += REALWNR1000V2 + +define LegacyDevice/WNR1000V2_VC + DEVICE_TITLE := NETGEAR WNR1000V2-VC +endef +LEGACY_DEVICES += WNR1000V2_VC + +define LegacyDevice/WPN824N + DEVICE_TITLE := NETGEAR WPN824N +endef +LEGACY_DEVICES += WPN824N + +define LegacyDevice/WHRG301N + DEVICE_TITLE := Buffalo WHR-G301N +endef +LEGACY_DEVICES += WHRG301N + +define LegacyDevice/WHRHPG300N + DEVICE_TITLE := Buffalo WHR-HP-G300N +endef +LEGACY_DEVICES += WHRHPG300N + +define LegacyDevice/WHRHPGN + DEVICE_TITLE := Buffalo WHR-HP-GN +endef +LEGACY_DEVICES += WHRHPGN + +define LegacyDevice/WLAEAG300N + DEVICE_TITLE := Buffalo WLAE-AG300N + DEVICE_PACKAGES := kmod-ledtrig-netdev +endef +LEGACY_DEVICES += WLAEAG300N + +define LegacyDevice/NBG_460N_550N_550NH + DEVICE_TITLE := ZyXEL NBG 460N/550N/550NH + DEVICE_PACKAGES := kmod-rtc-pcf8563 +endef +LEGACY_DEVICES += NBG_460N_550N_550NH diff --git a/target/linux/ar71xx/image/tiny-tp-link.mk b/target/linux/ar71xx/image/tiny-tp-link.mk new file mode 100644 index 000000000..092d8aa11 --- /dev/null +++ b/target/linux/ar71xx/image/tiny-tp-link.mk @@ -0,0 +1,684 @@ +include ./common-tp-link.mk + + +define Device/tl-mr10u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR10U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-MR10U + DEVICE_PROFILE := TLMR10U + TPLINK_HWID := 0x00100101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr10u-v1 + +define Device/tl-mr11u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR11U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR11U + DEVICE_PROFILE := TLMR11U + TPLINK_HWID := 0x00110101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr11u-v1 + +define Device/tl-mr11u-v2 + $(Device/tl-mr11u-v1) + DEVICE_TITLE := TP-LINK TL-MR11U v2 + TPLINK_HWID := 0x00110102 +endef +TARGET_DEVICES += tl-mr11u-v2 + +define Device/tl-mr12u-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR12U v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR13U + DEVICE_PROFILE := TLMR12U + TPLINK_HWID := 0x00120101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr12u-v1 + +define Device/tl-mr13u-v1 + $(Device/tl-mr12u-v1) + DEVICE_TITLE := TP-LINK TL-MR13U v1 + DEVICE_PROFILE := TLMR13U + TPLINK_HWID := 0x00130101 +endef +TARGET_DEVICES += tl-mr13u-v1 + +define Device/tl-mr3020-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3020 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3020 + DEVICE_PROFILE := TLMR3020 + TPLINK_HWID := 0x30200001 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr3020-v1 + +define Device/tl-mr3040-v1 + $(Device/tl-mr3020-v1) + DEVICE_TITLE := TP-LINK TL-MR3040 v1 + BOARDNAME := TL-MR3040 + DEVICE_PROFILE := TLMR3040 + TPLINK_HWID := 0x30400001 +endef +TARGET_DEVICES += tl-mr3040-v1 + +define Device/tl-mr3040-v2 + $(Device/tl-mr3040-v1) + DEVICE_TITLE := TP-LINK TL-MR3040 v2 + BOARDNAME := TL-MR3040-v2 + TPLINK_HWID := 0x30400002 +endef +TARGET_DEVICES += tl-mr3040-v2 + +define Device/tl-mr3220-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-MR3220 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3220 + DEVICE_PROFILE := TLMR3220 + TPLINK_HWID := 0x32200001 +endef +TARGET_DEVICES += tl-mr3220-v1 + +define Device/tl-mr3220-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3220 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3220-v2 + DEVICE_PROFILE := TLMR3220 + TPLINK_HWID := 0x32200002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-mr3220-v2 + +define Device/tl-mr3420-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-MR3420 v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420 + DEVICE_PROFILE := TLMR3420 + TPLINK_HWID := 0x34200001 +endef +TARGET_DEVICES += tl-mr3420-v1 + +define Device/tl-mr3420-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-MR3420 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-MR3420-v2 + DEVICE_PROFILE := TLMR3420 + TPLINK_HWID := 0x34200002 +endef +TARGET_DEVICES += tl-mr3420-v2 + +define Device/tl-wa701nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA701N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA701 + TPLINK_HWID := 0x07010001 +endef +TARGET_DEVICES += tl-wa701nd-v1 + +define Device/tl-wa701nd-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA701N/ND v2 + BOARDNAME := TL-WA701ND-v2 + DEVICE_PROFILE := TLWA701 + TPLINK_HWID := 0x07010002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wa701nd-v2 + +define Device/tl-wa7210n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA7210N v2 + DEVICE_PACKAGES := rssileds kmod-ledtrig-netdev + BOARDNAME := TL-WA7210N-v2 + DEVICE_PROFILE := TLWA7210 + TPLINK_HWID := 0x72100002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wa7210n-v2 + +define Device/tl-wa730re-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA730RE v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA730RE + TPLINK_HWID := 0x07300001 +endef +TARGET_DEVICES += tl-wa730re-v1 + +define Device/tl-wa750re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA750RE v1 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA750RE + DEVICE_PROFILE := TLWA750 + TPLINK_HWID := 0x07500001 +endef +TARGET_DEVICES += tl-wa750re-v1 + +define Device/tl-wa7510n-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA7510N v1 + BOARDNAME := TL-WA7510N + DEVICE_PROFILE := TLWA7510 + TPLINK_HWID := 0x75100001 +endef +TARGET_DEVICES += tl-wa7510n-v1 + +define Device/tl-wa801nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010001 +endef +TARGET_DEVICES += tl-wa801nd-v1 + +define Device/tl-wa801nd-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v2 + BOARDNAME := TL-WA801ND-v2 + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010002 +endef +TARGET_DEVICES += tl-wa801nd-v2 + +define Device/tl-wa801nd-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA801N/ND v3 + BOARDNAME := TL-WA801ND-v3 + DEVICE_PROFILE := TLWA801 + TPLINK_HWID := 0x08010003 +endef +TARGET_DEVICES += tl-wa801nd-v3 + +define Device/tl-wa830re-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA830RE v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA830 + TPLINK_HWID := 0x08300010 +endef +TARGET_DEVICES += tl-wa830re-v1 + +define Device/tl-wa830re-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA830RE v2 + BOARDNAME := TL-WA830RE-v2 + DEVICE_PROFILE := TLWA830 + TPLINK_HWID := 0x08300002 +endef +TARGET_DEVICES += tl-wa830re-v2 + +define Device/tl-wa850re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA850RE v1 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA850RE + DEVICE_PROFILE := TLWA850 + TPLINK_HWID := 0x08500001 +endef +TARGET_DEVICES += tl-wa850re-v1 + +define Device/tl-wa85xre + $(Device/tplink) + TPLINK_HWREV := 0 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade + IMAGE/factory.bin := append-rootfs | tplink-safeloader factory + MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware) +endef + +define Device/tl-wa850re-v2 + $(Device/tl-wa85xre) + DEVICE_TITLE := TP-LINK TL-WA850RE v2 + DEVICE_PACKAGES := rssileds + BOARDNAME := TL-WA850RE-V2 + DEVICE_PROFILE := TLWA850 + TPLINK_BOARD_ID := TLWA850REV2 + TPLINK_HWID := 0x08500002 +endef +TARGET_DEVICES += tl-wa850re-v2 + +define Device/tl-wa855re-v1 + $(Device/tl-wa85xre) + DEVICE_TITLE := TP-LINK TL-WA855RE v1 + BOARDNAME := TL-WA855RE-v1 + DEVICE_PROFILE := TLWA855RE + TPLINK_HWID := 0x08550001 + TPLINK_BOARD_ID := TLWA855REV1 +endef +TARGET_DEVICES += tl-wa855re-v1 + + +define Device/tl-wa860re-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA860RE v1 + BOARDNAME := TL-WA860RE + DEVICE_PROFILE := TLWA860 + TPLINK_HWID := 0x08600001 +endef +TARGET_DEVICES += tl-wa860re-v1 + +define Device/tl-wa901nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v1 + BOARDNAME := TL-WA901ND + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010001 +endef +TARGET_DEVICES += tl-wa901nd-v1 + +define Device/tl-wa901nd-v2 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v2 + BOARDNAME := TL-WA901ND-v2 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010002 +endef +TARGET_DEVICES += tl-wa901nd-v2 + +define Device/tl-wa901nd-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v3 + BOARDNAME := TL-WA901ND-v3 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010003 +endef +TARGET_DEVICES += tl-wa901nd-v3 + +define Device/tl-wa901nd-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v4 + BOARDNAME := TL-WA901ND-v4 + DEVICE_PROFILE := TLWA901 + TPLINK_HWID := 0x09010004 + IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wa901nd-v4 + +define Device/tl-wa901nd-v5 + $(Device/tl-wa901nd-v4) + DEVICE_TITLE := TP-LINK TL-WA901N/ND v5 + BOARDNAME := TL-WA901ND-v5 + TPLINK_HWID := 0x09010005 +endef +TARGET_DEVICES += tl-wa901nd-v5 + +define Device/tl-wdr3320-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WDR3320 v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport + BOARDNAME := TL-WDR3320-v2 + DEVICE_PROFILE := TLWDR3320V2 + TPLINK_HWID := 0x33200002 + TPLINK_HEADER_VERSION := 2 +endef +TARGET_DEVICES += tl-wdr3320-v2 + +define Device/tl-wr1041n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR1041N v2 + BOARDNAME := TL-WR1041N-v2 + DEVICE_PROFILE := TLWR1041 + TPLINK_HWID := 0x10410002 +endef +TARGET_DEVICES += tl-wr1041n-v2 + +define Device/tl-wr703n-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR703N v1 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR703N + DEVICE_PROFILE := TLWR703 + TPLINK_HWID := 0x07030101 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr703n-v1 + +define Device/tl-wr710n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR710N v2 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR710N + DEVICE_PROFILE := TLWR710 + TPLINK_HWID := 0x07100002 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr710n-v2 + +define Device/tl-wr720n-v3 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR720N v3 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + BOARDNAME := TL-WR720N-v3 + DEVICE_PROFILE := TLWR720 + TPLINK_HWID := 0x07200103 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr720n-v3 + +define Device/tl-wr720n-v4 + $(Device/tl-wr720n-v3) + DEVICE_TITLE := TP-LINK TL-WR720N v4 + TPLINK_HWID := 0x07200104 +endef +TARGET_DEVICES += tl-wr720n-v4 + +define Device/tl-wr740n-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400001 +endef +TARGET_DEVICES += tl-wr740n-v1 + +define Device/tl-wr740n-v3 + $(Device/tl-wr740n-v1) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v3 + TPLINK_HWID := 0x07400003 +endef +TARGET_DEVICES += tl-wr740n-v3 + +define Device/tl-wr740n-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v4 + BOARDNAME := TL-WR741ND-v4 + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400004 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr740n-v4 + +define Device/tl-wr740n-v5 + $(Device/tl-wr740n-v4) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v5 + TPLINK_HWID := 0x07400005 +endef +TARGET_DEVICES += tl-wr740n-v5 + +define Device/tl-wr740n-v6 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR740N/ND v6 + BOARDNAME := TL-WR740N-v6 + DEVICE_PROFILE := TLWR740 + TPLINK_HWID := 0x07400006 +endef +TARGET_DEVICES += tl-wr740n-v6 + +define Device/tl-wr741nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR741 + TPLINK_HWID := 0x07410001 +endef +TARGET_DEVICES += tl-wr741nd-v1 + +define Device/tl-wr741nd-v2 + $(Device/tl-wr741nd-v1) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v2 +endef +TARGET_DEVICES += tl-wr741nd-v2 + +define Device/tl-wr741nd-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v4 + BOARDNAME := TL-WR741ND-v4 + DEVICE_PROFILE := TLWR741 + TPLINK_HWID := 0x07410004 + CONSOLE := ttyATH0,115200 +endef +TARGET_DEVICES += tl-wr741nd-v4 + +define Device/tl-wr741nd-v5 + $(Device/tl-wr741nd-v4) + DEVICE_TITLE := TP-LINK TL-WR741N/ND v5 + TPLINK_HWID := 0x07400005 +endef +TARGET_DEVICES += tl-wr741nd-v5 + +define Device/tl-wr743nd-v1 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR743N/ND v1 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR743 + TPLINK_HWID := 0x07430001 +endef +TARGET_DEVICES += tl-wr743nd-v1 + +define Device/tl-wr743nd-v2 + $(Device/tl-wr741nd-v4) + DEVICE_TITLE := TP-LINK TL-WR743N/ND v2 + DEVICE_PROFILE := TLWR743 + TPLINK_HWID := 0x07430002 +endef +TARGET_DEVICES += tl-wr743nd-v2 + +define Device/tl-wr802n-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR802N v1 + BOARDNAME := TL-WR802N-v1 + DEVICE_PROFILE := TLWR802 + TPLINK_HWID := 0x08020001 + TPLINK_HWREV := 1 +endef +TARGET_DEVICES += tl-wr802n-v1 + +define Device/tl-wr802n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR802N v2 + BOARDNAME := TL-WR802N-v2 + DEVICE_PROFILE := TLWR802 + TPLINK_HWID := 0x08020002 + TPLINK_HWREV := 2 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr802n-v2 + +define Device/tl-wr840n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR840N v2 + BOARDNAME := TL-WR840N-v2 + DEVICE_PROFILE := TLWR840 + TPLINK_HWID := 0x08400002 + IMAGES += factory-eu.bin + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr840n-v2 + +define Device/tl-wr840n-v3 + $(Device/tl-wr840n-v2) + DEVICE_TITLE := TP-LINK TL-WR840N v3 + BOARDNAME := TL-WR840N-v3 + TPLINK_HWID := 0x08400003 +endef +TARGET_DEVICES += tl-wr840n-v3 + +define Device/tl-wr841-v1.5 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v1.5 + BOARDNAME := TL-WR841N-v1.5 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410002 + TPLINK_HWREV := 2 +endef +TARGET_DEVICES += tl-wr841-v1.5 + +define Device/tl-wr841-v3 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v3 + BOARDNAME := TL-WR941ND + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410003 + TPLINK_HWREV := 3 +endef +TARGET_DEVICES += tl-wr841-v3 + +define Device/tl-wr841-v5 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v5 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410005 +endef +TARGET_DEVICES += tl-wr841-v5 + +define Device/tl-wr841-v7 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v7 + BOARDNAME := TL-WR841N-v7 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410007 +endef +TARGET_DEVICES += tl-wr841-v7 + +define Device/tl-wr841-v8 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v8 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410008 +endef +TARGET_DEVICES += tl-wr841-v8 + +define Device/tl-wr841-v9 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v9 + BOARDNAME := TL-WR841N-v9 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410009 +endef +TARGET_DEVICES += tl-wr841-v9 + +define Device/tl-wr841-v10 + $(Device/tl-wr841-v9) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v10 + TPLINK_HWID := 0x08410010 +endef +TARGET_DEVICES += tl-wr841-v10 + +define Device/tl-wr841-v11 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v11 + BOARDNAME := TL-WR841N-v11 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08410011 + IMAGES += factory-us.bin factory-eu.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU +endef +TARGET_DEVICES += tl-wr841-v11 + +define Device/tl-wr841-v12 + $(Device/tl-wr841-v11) + DEVICE_TITLE := TP-LINK TL-WR841N/ND v12 + TPLINK_HWID := 0x08410012 +endef +TARGET_DEVICES += tl-wr841-v12 + +define Device/tl-wr843nd-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR843N/ND v1 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR843 + TPLINK_HWID := 0x08430001 +endef +TARGET_DEVICES += tl-wr843nd-v1 + +define Device/tl-wr847n-v8 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR847N/ND v8 + BOARDNAME := TL-WR841N-v8 + DEVICE_PROFILE := TLWR841 + TPLINK_HWID := 0x08470008 +endef +TARGET_DEVICES += tl-wr847n-v8 + +define Device/tl-wr940n-v4 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR940N v4 + BOARDNAME := TL-WR940N-v4 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09400004 + IMAGES += factory-us.bin factory-eu.bin factory-br.bin + IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US + IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU + IMAGE/factory-br.bin := append-rootfs | mktplinkfw factory -C BR +endef +TARGET_DEVICES += tl-wr940n-v4 + +define Device/tl-wr941nd-v2 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v2 + BOARDNAME := TL-WR941ND + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410002 + TPLINK_HWREV := 2 +endef +TARGET_DEVICES += tl-wr941nd-v2 + +define Device/tl-wr941nd-v3 + $(Device/tl-wr941nd-v2) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v3 +endef +TARGET_DEVICES += tl-wr941nd-v3 + +define Device/rnx-n360rt + $(Device/tl-wr941nd-v2) + DEVICE_TITLE := Rosewill RNX-N360RT + DEVICE_PROFILE := RNXN360RT + TPLINK_HWREV := 0x00420001 +endef +TARGET_DEVICES += rnx-n360rt + +define Device/tl-wr941nd-v4 + $(Device/tplink-4m) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v4 + BOARDNAME := TL-WR741ND + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410004 +endef +TARGET_DEVICES += tl-wr941nd-v4 + +define Device/tl-wr941nd-v5 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v5 + BOARDNAME := TL-WR941ND-v5 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410005 +endef +TARGET_DEVICES += tl-wr941nd-v5 + +define Device/tl-wr941nd-v6 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 + BOARDNAME := TL-WR941ND-v6 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 +endef +TARGET_DEVICES += tl-wr941nd-v6 + +# Chinese version (unlike European) is similar to the TL-WDR3500 +define Device/tl-wr941nd-v6-cn + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 (CN) + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410006 +endef +TARGET_DEVICES += tl-wr941nd-v6-cn diff --git a/target/linux/ar71xx/image/tp-link.mk b/target/linux/ar71xx/image/tp-link.mk deleted file mode 100644 index bf4f31b76..000000000 --- a/target/linux/ar71xx/image/tp-link.mk +++ /dev/null @@ -1,1175 +0,0 @@ -DEVICE_VARS += LOADER_FLASH_OFFS TPLINK_BOARD_ID TPLINK_FLASHLAYOUT TPLINK_HEADER_VERSION TPLINK_HWID TPLINK_HWREV - -define Build/copy-file - cat "$(1)" > "$@" -endef - -define Build/loader-okli - dd if=$(KDIR)/loader-$(1).gz bs=7680 conv=sync of="$@.new" - cat "$@" >> "$@.new" - mv "$@.new" "$@" -endef - -define Build/loader-okli-compile - $(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0 KERNEL_CMDLINE="$(CMDLINE)") -endef - -# combine kernel and rootfs into one image -# mktplinkfw -# is "sysupgrade" or "factory" -# -# -a align the rootfs start on an bytes boundary -# -j add jffs2 end-of-filesystem markers -# -s strip padding from end of the image -# -X reserve bytes in the firmware image (hexval prefixed with 0x) -define Build/mktplinkfw - -$(STAGING_DIR_HOST)/bin/mktplinkfw \ - -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) \ - -m $(TPLINK_HEADER_VERSION) \ - -k $(IMAGE_KERNEL) \ - -r $@ \ - -o $@.new \ - -j -X 0x40000 \ - -a $(call rootfs_align,$(FILESYSTEM)) \ - $(wordlist 2,$(words $(1)),$(1)) \ - $(if $(findstring sysupgrade,$(word 1,$(1))),-s) && mv $@.new $@ || rm -f $@ -endef - -define Build/uImageArcher - mkimage -A $(LINUX_KARCH) \ - -O linux -T kernel \ - -C $(1) -a $(KERNEL_LOADADDR) -e $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \ - -n '$(call toupper,$(LINUX_KARCH)) OpenWrt Linux-$(LINUX_VERSION)' -d $@ $@.new - @mv $@.new $@ -endef - - -define Device/tplink - TPLINK_HWREV := 0x1 - TPLINK_HEADER_VERSION := 1 - LOADER_TYPE := gz - KERNEL := kernel-bin | patch-cmdline | lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -endef - -define Device/tplink-nolzma - $(Device/tplink) - LOADER_FLASH_OFFS := 0x22000 - COMPILE := loader-$(1).gz - COMPILE/loader-$(1).gz := loader-okli-compile - KERNEL := copy-file $(KDIR)/vmlinux.bin.lzma | uImage lzma -M 0x4f4b4c49 | loader-okli $(1) - KERNEL_INITRAMFS := copy-file $(KDIR)/vmlinux-initramfs.bin.lzma | loader-kernel-cmdline | tplink-v1-header -endef - -define Device/tplink-4m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 4M - IMAGE_SIZE := 3904k -endef - -define Device/tplink-8m - $(Device/tplink-nolzma) - TPLINK_FLASHLAYOUT := 8M - IMAGE_SIZE := 7936k -endef - -define Device/tplink-4mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 4Mlzma - IMAGE_SIZE := 3904k -endef - -define Device/tplink-8mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 8Mlzma - IMAGE_SIZE := 7936k -endef - -define Device/tplink-16mlzma - $(Device/tplink) - TPLINK_FLASHLAYOUT := 16Mlzma - IMAGE_SIZE := 15872k -endef - -define Device/archer-cxx - KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/archer-c25-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C25 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 - BOARDNAME := ARCHER-C25-V1 - TPLINK_BOARD_ID := ARCHER-C25-V1 - DEVICE_PROFILE := ARCHERC25V1 - IMAGE_SIZE := 7808k - LOADER_TYPE := elf - MTDPARTS := spi0.0:128k(factory-uboot)ro,64k(u-boot)ro,1536k(kernel),6272k(rootfs),128k(config)ro,64k(art)ro,7808k@0x30000(firmware) - SUPPORTED_DEVICES := archer-c25-v1 -endef - -define Device/archer-c58-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C58 v1 - DEVICE_PACKAGES := kmod-ath10k - BOARDNAME := ARCHER-C58-V1 - TPLINK_BOARD_ID := ARCHER-C58-V1 - DEVICE_PROFILE := ARCHERC58V1 - IMAGE_SIZE := 7936k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c58-v1 -endef - -define Device/archer-c59-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C59 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C59-V1 - TPLINK_BOARD_ID := ARCHER-C59-V1 - DEVICE_PROFILE := ARCHERC59V1 - IMAGE_SIZE := 14528k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1536k(kernel),12992k(rootfs),1664k(tplink)ro,64k(art)ro,14528k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c59-v1 -endef - -define Device/archer-c60-v1 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C60 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C60-V1 - TPLINK_BOARD_ID := ARCHER-C60-V1 - DEVICE_PROFILE := ARCHERC60V1 - IMAGE_SIZE := 7936k - MTDPARTS := spi0.0:64k(u-boot)ro,64k(mac)ro,1344k(kernel),6592k(rootfs),64k(tplink)ro,64k(art)ro,7936k@0x20000(firmware) - SUPPORTED_DEVICES := archer-c60-v1 -endef -TARGET_DEVICES += archer-c25-v1 archer-c59-v1 - -define Device/archer-c5-v1 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C5 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C5 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc5000001 -endef - -define Device/archer-c7-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0x75000001 -endef - -define Device/archer-c7-v2 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V2 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc7000002 - IMAGES := sysupgrade.bin factory.bin factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/archer-c7-v2-il - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v2 (IL) - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V2 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0xc7000002 - TPLINK_HWREV := 0x494c0001 -endef - -define Device/tl-wdr7500-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK Archer C7 v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7 - DEVICE_PROFILE := ARCHERC7 - TPLINK_HWID := 0x75000003 -endef - -define Device/archer-c7-v4 - $(Device/archer-cxx) - DEVICE_TITLE := TP-LINK Archer C7 v4 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := ARCHER-C7-V4 - TPLINK_BOARD_ID := ARCHER-C7-V4 - IMAGE_SIZE := 15104k - LOADER_TYPE := elf - MTDPARTS := spi0.0:128k(factory-uboot)ro,128k(u-boot)ro,1536k(kernel),13568k(rootfs),960k(config)ro,64k(art)ro,15104k@0x40000(firmware) - SUPPORTED_DEVICES := archer-c7-v4 -endef - -TARGET_DEVICES += archer-c5-v1 archer-c7-v1 archer-c7-v2 archer-c7-v2-il tl-wdr7500-v3 archer-c7-v4 - -define Device/cpe510-520-v1 - DEVICE_TITLE := TP-LINK CPE510/520 v1 - DEVICE_PACKAGES := rssileds - MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),6144k(rootfs),192k(config)ro,64k(ART)ro,7680k@0x40000(firmware) - IMAGE_SIZE := 7680k - BOARDNAME := CPE510 - TPLINK_BOARD_ID := CPE510 - DEVICE_PROFILE := CPE510 - LOADER_TYPE := elf - KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/cpe210-220-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK CPE210/220 v1 - BOARDNAME := CPE210 - TPLINK_BOARD_ID := CPE210 -endef - -define Device/wbs210-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK WBS210 v1 - BOARDNAME := WBS210 - TPLINK_BOARD_ID := WBS210 -endef - -define Device/wbs510-v1 - $(Device/cpe510-520-v1) - DEVICE_TITLE := TP-LINK WBS510 v1 - BOARDNAME := WBS510 - TPLINK_BOARD_ID := WBS510 -endef -TARGET_DEVICES += cpe210-220-v1 cpe510-520-v1 wbs210-v1 wbs510-v1 - -define Device/eap120-v1 - DEVICE_TITLE := TP-LINK EAP120 v1 - MTDPARTS := spi0.0:128k(u-boot)ro,64k(pation-table)ro,64k(product-info)ro,1536k(kernel),14336k(rootfs),192k(config)ro,64k(ART)ro,15872k@0x40000(firmware) - IMAGE_SIZE := 15872k - BOARDNAME := EAP120 - TPLINK_BOARD_ID := EAP120 - DEVICE_PROFILE := EAP120 - LOADER_TYPE := elf - KERNEL := kernel-bin | patch-cmdline | lzma | loader-kernel - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef -TARGET_DEVICES += eap120-v1 - -define Device/re450-v1 - DEVICE_TITLE := TP-LINK RE450 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),4672k(rootfs),64k(pation-table)ro,64k(product-info)ro,1856k(config)ro,64k(art)ro,6016k@0x20000(firmware) - IMAGE_SIZE := 7936k - BOARDNAME := RE450 - TPLINK_BOARD_ID := RE450 - DEVICE_PROFILE := RE450 - LOADER_TYPE := elf - TPLINK_HWID := 0x0 - TPLINK_HWREV := 0 - TPLINK_HEADER_VERSION := 1 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef -TARGET_DEVICES += re450-v1 - -define Device/tl-mr10u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR10U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-MR10U - DEVICE_PROFILE := TLMR10U - TPLINK_HWID := 0x00100101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr11u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR11U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR11U - DEVICE_PROFILE := TLMR11U - TPLINK_HWID := 0x00110101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr11u-v2 - $(Device/tl-mr11u-v1) - DEVICE_TITLE := TP-LINK TL-MR11U v2 - TPLINK_HWID := 0x00110102 -endef - -define Device/tl-mr12u-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR12U v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR13U - DEVICE_PROFILE := TLMR12U - TPLINK_HWID := 0x00120101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr13u-v1 - $(Device/tl-mr12u-v1) - DEVICE_TITLE := TP-LINK TL-MR13U v1 - DEVICE_PROFILE := TLMR13U - TPLINK_HWID := 0x00130101 -endef -TARGET_DEVICES += tl-mr10u-v1 tl-mr11u-v1 tl-mr11u-v2 tl-mr12u-v1 tl-mr13u-v1 - -define Device/tl-mr3020-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3020 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3020 - DEVICE_PROFILE := TLMR3020 - TPLINK_HWID := 0x30200001 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr3040-v1 - $(Device/tl-mr3020-v1) - DEVICE_TITLE := TP-LINK TL-MR3040 v1 - BOARDNAME := TL-MR3040 - DEVICE_PROFILE := TLMR3040 - TPLINK_HWID := 0x30400001 -endef - -define Device/tl-mr3040-v2 - $(Device/tl-mr3040-v1) - DEVICE_TITLE := TP-LINK TL-MR3040 v2 - BOARDNAME := TL-MR3040-v2 - TPLINK_HWID := 0x30400002 -endef - -define Device/tl-mr3220-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-MR3220 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3220 - DEVICE_PROFILE := TLMR3220 - TPLINK_HWID := 0x32200001 -endef - -define Device/tl-mr3220-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3220 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3220-v2 - DEVICE_PROFILE := TLMR3220 - TPLINK_HWID := 0x32200002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-mr3420-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-MR3420 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420 - DEVICE_PROFILE := TLMR3420 - TPLINK_HWID := 0x34200001 -endef - -define Device/tl-mr3420-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR3420 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420-v2 - DEVICE_PROFILE := TLMR3420 - TPLINK_HWID := 0x34200002 -endef -TARGET_DEVICES += tl-mr3020-v1 tl-mr3040-v1 tl-mr3040-v2 tl-mr3220-v1 tl-mr3220-v2 tl-mr3420-v1 tl-mr3420-v2 - -define Device/tl-mr6400-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-MR6400 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-net kmod-usb-net-rndis kmod-usb-serial kmod-usb-serial-option adb-enablemodem - BOARDNAME := TL-MR6400 - DEVICE_PROFILE := TLMR6400 - TPLINK_HWID := 0x64000001 -endef -TARGET_DEVICES += tl-mr6400-v1 - -define Device/tl-wa701nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA701N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA701 - TPLINK_HWID := 0x07010001 -endef - -define Device/tl-wa701nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA701N/ND v2 - BOARDNAME := TL-WA701ND-v2 - DEVICE_PROFILE := TLWA701 - TPLINK_HWID := 0x07010002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wa7210n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA7210N v2 - DEVICE_PACKAGES := rssileds kmod-ledtrig-netdev - BOARDNAME := TL-WA7210N-v2 - DEVICE_PROFILE := TLWA7210 - TPLINK_HWID := 0x72100002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wa730re-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA730RE v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA730RE - TPLINK_HWID := 0x07300001 -endef - -define Device/tl-wa750re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA750RE v1 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA750RE - DEVICE_PROFILE := TLWA750 - TPLINK_HWID := 0x07500001 -endef - -define Device/tl-wa7510n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA7510N v1 - BOARDNAME := TL-WA7510N - DEVICE_PROFILE := TLWA7510 - TPLINK_HWID := 0x75100001 -endef -TARGET_DEVICES += tl-wa701nd-v1 tl-wa701nd-v2 tl-wa7210n-v2 tl-wa730re-v1 tl-wa750re-v1 tl-wa7510n-v1 - -define Device/tl-wa801nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010001 -endef - -define Device/tl-wa801nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v2 - BOARDNAME := TL-WA801ND-v2 - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010002 -endef - -define Device/tl-wa801nd-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA801N/ND v3 - BOARDNAME := TL-WA801ND-v3 - DEVICE_PROFILE := TLWA801 - TPLINK_HWID := 0x08010003 -endef - -define Device/tl-wa830re-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA830RE v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA830 - TPLINK_HWID := 0x08300010 -endef - -define Device/tl-wa830re-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA830RE v2 - BOARDNAME := TL-WA830RE-v2 - DEVICE_PROFILE := TLWA830 - TPLINK_HWID := 0x08300002 -endef - -define Device/tl-wa850re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA850RE v1 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA850RE - DEVICE_PROFILE := TLWA850 - TPLINK_HWID := 0x08500001 -endef - -define Device/tl-wa85xre - $(Device/tplink) - TPLINK_HWREV := 0 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),2304k(rootfs),256k(config)ro,64k(art)ro,3648k@0x20000(firmware) -endef - -define Device/tl-wa850re-v2 - $(Device/tl-wa85xre) - DEVICE_TITLE := TP-LINK TL-WA850RE v2 - DEVICE_PACKAGES := rssileds - BOARDNAME := TL-WA850RE-V2 - DEVICE_PROFILE := TLWA850 - TPLINK_BOARD_ID := TLWA850REV2 - TPLINK_HWID := 0x08500002 -endef - -define Device/tl-wa855re-v1 - $(Device/tl-wa85xre) - DEVICE_TITLE := TP-LINK TL-WA855RE v1 - BOARDNAME := TL-WA855RE-v1 - DEVICE_PROFILE := TLWA855RE - TPLINK_HWID := 0x08550001 - TPLINK_BOARD_ID := TLWA855REV1 -endef - -define Device/tl-wa860re-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA860RE v1 - BOARDNAME := TL-WA860RE - DEVICE_PROFILE := TLWA860 - TPLINK_HWID := 0x08600001 -endef -TARGET_DEVICES += tl-wa801nd-v1 tl-wa801nd-v2 tl-wa801nd-v3 tl-wa830re-v1 tl-wa830re-v2 tl-wa850re-v1 tl-wa850re-v2 tl-wa855re-v1 tl-wa860re-v1 - -define Device/tl-wa901nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v1 - BOARDNAME := TL-WA901ND - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010001 -endef - -define Device/tl-wa901nd-v2 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v2 - BOARDNAME := TL-WA901ND-v2 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010002 -endef - -define Device/tl-wa901nd-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v3 - BOARDNAME := TL-WA901ND-v3 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010003 -endef - -define Device/tl-wa901nd-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WA901N/ND v4 - BOARDNAME := TL-WA901ND-v4 - DEVICE_PROFILE := TLWA901 - TPLINK_HWID := 0x09010004 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C EU -endef -TARGET_DEVICES += tl-wa901nd-v1 tl-wa901nd-v2 tl-wa901nd-v3 tl-wa901nd-v4 - -define Device/tl-wdr3320-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR3320 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR3320-v2 - DEVICE_PROFILE := TLWDR3320V2 - TPLINK_HWID := 0x33200002 - TPLINK_HEADER_VERSION := 2 -endef - -define Device/tl-wdr3500-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR3500 v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWDR4300 - TPLINK_HWID := 0x35000001 -endef - -define Device/tl-wdr3600-v1 - $(Device/tl-wdr3500-v1) - DEVICE_TITLE := TP-LINK TL-WDR3600 v1 - BOARDNAME := TL-WDR4300 - TPLINK_HWID := 0x36000001 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US -endef - -define Device/tl-wdr4300-v1 - $(Device/tl-wdr3600-v1) - DEVICE_TITLE := TP-LINK TL-WDR4300 v1 - TPLINK_HWID := 0x43000001 -endef - -define Device/tl-wdr4300-v1-il - $(Device/tl-wdr3500-v1) - DEVICE_TITLE := TP-LINK TL-WDR4300 v1 (IL) - BOARDNAME := TL-WDR4300 - TPLINK_HWID := 0x43008001 -endef - -define Device/tl-wdr4310-v1 - $(Device/tl-wdr4300-v1-il) - DEVICE_TITLE := TP-LINK TL-WDR4310 v1 - TPLINK_HWID := 0x43100001 -endef - -define Device/tl-wdr4900-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR4900 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WDR4900-v2 - DEVICE_PROFILE := TLWDR4900V2 - TPLINK_HWID := 0x49000002 -endef - -define Device/tl-wdr6500-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR6500 v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-ath10k ath10k-firmware-qca988x - KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header - BOARDNAME := TL-WDR6500-v2 - DEVICE_PROFILE := TLWDR6500V2 - TPLINK_HWID := 0x65000002 - TPLINK_HEADER_VERSION := 2 -endef - -define Device/tl-wdr6500-v6 -$(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WDR6500 v6 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9888 - KERNEL := kernel-bin | patch-cmdline | lzma | uImage lzma - KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma | tplink-v1-header - BOARDNAME = TL-WDR6500-v6 - DEVICE_PROFILE = TLWDR6500V6 - TPLINK_HWID := 0x65000006 - TPLINK_HEADER_VERSION := 2 -endef - -define Device/mw4530r-v1 - $(Device/tl-wdr4300-v1) - DEVICE_TITLE := Mercury MW4530R v1 - TPLINK_HWID := 0x45300001 -endef -TARGET_DEVICES += tl-wdr3320-v2 tl-wdr3500-v1 tl-wdr3600-v1 tl-wdr4300-v1 tl-wdr4300-v1-il tl-wdr4310-v1 tl-wdr4900-v2 tl-wdr6500-v2 tl-wdr6500-v6 mw4530r-v1 - -define Device/tl-wpa8630-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WPA8630 v1 - DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca988x - BOARDNAME := TL-WPA8630 - DEVICE_PROFILE := TL-WPA8630 - TPLINK_HWID := 0x86300001 -endef -TARGET_DEVICES += tl-wpa8630-v1 - -define Device/tl-wr1041n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR1041N v2 - BOARDNAME := TL-WR1041N-v2 - DEVICE_PROFILE := TLWR1041 - TPLINK_HWID := 0x10410002 -endef -TARGET_DEVICES += tl-wr1041n-v2 - -define Device/tl-wr1043nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430001 -endef - -define Device/tl-wr1043nd-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND-v2 - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430002 -endef - -define Device/tl-wr1043nd-v3 - $(Device/tl-wr1043nd-v2) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v3 - TPLINK_HWID := 0x10430003 -endef - -define Device/tl-wr1043nd-v4 - $(Device/tplink) - DEVICE_TITLE := TP-LINK TL-WR1043N/ND v4 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR1043ND-v4 - DEVICE_PROFILE := TLWR1043 - TPLINK_HWID := 0x10430004 - MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware) - IMAGE_SIZE := 15552k - TPLINK_BOARD_ID := TLWR1043NDV4 - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory -endef - -define Device/tl-wr2543-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2543N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR2543N - DEVICE_PROFILE := TLWR2543 - TPLINK_HWID := 0x25430001 - IMAGE/sysupgrade.bin := append-rootfs | mktplinkfw sysupgrade -v 3.13.99 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -v 3.13.99 -endef -TARGET_DEVICES += tl-wr1043nd-v1 tl-wr1043nd-v2 tl-wr1043nd-v3 tl-wr1043nd-v4 tl-wr2543-v1 - -define Device/tl-wr703n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR703N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR703N - DEVICE_PROFILE := TLWR703 - TPLINK_HWID := 0x07030101 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr710n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR710N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR710N - DEVICE_PROFILE := TLWR710 - TPLINK_HWID := 0x07100001 - CONSOLE := ttyATH0,115200 - IMAGE/factory.bin := append-rootfs | mktplinkfw factory -C US -endef - -define Device/tl-wr710n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR710N v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR710N - DEVICE_PROFILE := TLWR710 - TPLINK_HWID := 0x07100002 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr710n-v2.1 - $(Device/tl-wr710n-v1) - DEVICE_TITLE := TP-LINK TL-WR710N v2.1 - TPLINK_HWID := 0x07100002 - TPLINK_HWREV := 0x00000002 -endef - -define Device/tl-wr720n-v3 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR720N v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR720N-v3 - DEVICE_PROFILE := TLWR720 - TPLINK_HWID := 0x07200103 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr720n-v4 - $(Device/tl-wr720n-v3) - DEVICE_TITLE := TP-LINK TL-WR720N v4 - TPLINK_HWID := 0x07200104 -endef -TARGET_DEVICES += tl-wr703n-v1 tl-wr710n-v1 tl-wr710n-v2 tl-wr710n-v2.1 tl-wr720n-v3 tl-wr720n-v4 - -define Device/tl-wr740n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400001 -endef - -define Device/tl-wr740n-v3 - $(Device/tl-wr740n-v1) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v3 - TPLINK_HWID := 0x07400003 -endef - -define Device/tl-wr740n-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v4 - BOARDNAME := TL-WR741ND-v4 - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400004 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr740n-v5 - $(Device/tl-wr740n-v4) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v5 - TPLINK_HWID := 0x07400005 -endef - -define Device/tl-wr740n-v6 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR740N/ND v6 - BOARDNAME := TL-WR740N-v6 - DEVICE_PROFILE := TLWR740 - TPLINK_HWID := 0x07400006 -endef -TARGET_DEVICES += tl-wr740n-v1 tl-wr740n-v3 tl-wr740n-v4 tl-wr740n-v5 tl-wr740n-v6 - -define Device/tl-wr741nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR741 - TPLINK_HWID := 0x07410001 -endef - -define Device/tl-wr741nd-v2 - $(Device/tl-wr741nd-v1) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v2 -endef - -define Device/tl-wr741nd-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v4 - BOARDNAME := TL-WR741ND-v4 - DEVICE_PROFILE := TLWR741 - TPLINK_HWID := 0x07410004 - CONSOLE := ttyATH0,115200 -endef - -define Device/tl-wr741nd-v5 - $(Device/tl-wr741nd-v4) - DEVICE_TITLE := TP-LINK TL-WR741N/ND v5 - TPLINK_HWID := 0x07400005 -endef - -define Device/tl-wr743nd-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR743N/ND v1 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR743 - TPLINK_HWID := 0x07430001 -endef - -define Device/tl-wr743nd-v2 - $(Device/tl-wr741nd-v4) - DEVICE_TITLE := TP-LINK TL-WR743N/ND v2 - DEVICE_PROFILE := TLWR743 - TPLINK_HWID := 0x07430002 -endef -TARGET_DEVICES += tl-wr741nd-v1 tl-wr741nd-v2 tl-wr741nd-v4 tl-wr741nd-v5 tl-wr743nd-v1 tl-wr743nd-v2 - -define Device/tl-wr802n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR802N v1 - BOARDNAME := TL-WR802N-v1 - DEVICE_PROFILE := TLWR802 - TPLINK_HWID := 0x08020001 - TPLINK_HWREV := 1 -endef - -define Device/tl-wr802n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR802N v2 - BOARDNAME := TL-WR802N-v2 - DEVICE_PROFILE := TLWR802 - TPLINK_HWID := 0x08020002 - TPLINK_HWREV := 2 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr810n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR810N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 - BOARDNAME := TL-WR810N - DEVICE_PROFILE := TLWR810 - TPLINK_HWID := 0x08100001 -endef - -define Device/tl-wr840n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR840N v2 - BOARDNAME := TL-WR840N-v2 - DEVICE_PROFILE := TLWR840 - TPLINK_HWID := 0x08400002 - IMAGES += factory-eu.bin - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr840n-v3 - $(Device/tl-wr840n-v2) - DEVICE_TITLE := TP-LINK TL-WR840N v3 - BOARDNAME := TL-WR840N-v3 - TPLINK_HWID := 0x08400003 -endef -TARGET_DEVICES += tl-wr802n-v1 tl-wr802n-v2 tl-wr810n-v1 tl-wr840n-v2 tl-wr840n-v3 - -define Device/tl-wr841-v1.5 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v1.5 - BOARDNAME := TL-WR841N-v1.5 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410002 - TPLINK_HWREV := 2 -endef - -define Device/tl-wr841-v3 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v3 - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410003 - TPLINK_HWREV := 3 -endef - -define Device/tl-wr841-v5 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v5 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410005 -endef - -define Device/tl-wr841-v7 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v7 - BOARDNAME := TL-WR841N-v7 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410007 -endef - -define Device/tl-wr841-v8 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v8 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410008 -endef - -define Device/tl-wr841-v9 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v9 - BOARDNAME := TL-WR841N-v9 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410009 -endef - -define Device/tl-wr841-v10 - $(Device/tl-wr841-v9) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v10 - TPLINK_HWID := 0x08410010 -endef - -define Device/tl-wr841-v11 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v11 - BOARDNAME := TL-WR841N-v11 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08410011 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr841-v12 - $(Device/tl-wr841-v11) - DEVICE_TITLE := TP-LINK TL-WR841N/ND v12 - TPLINK_HWID := 0x08410012 -endef -TARGET_DEVICES += tl-wr841-v1.5 tl-wr841-v3 tl-wr841-v5 tl-wr841-v7 tl-wr841-v8 tl-wr841-v9 tl-wr841-v10 tl-wr841-v11 tl-wr841-v12 - -define Device/tl-wr842n-v1 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-MR3420 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x08420001 -endef - -define Device/tl-wr842n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v2 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR842N-v2 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x8420002 -endef - -define Device/tl-wr842n-v3 - $(Device/tplink-16mlzma) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v3 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR842N-v3 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x08420003 -endef - -define Device/tl-wr843nd-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR843N/ND v1 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR843 - TPLINK_HWID := 0x08430001 -endef - -define Device/tl-wr847n-v8 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR847N/ND v8 - BOARDNAME := TL-WR841N-v8 - DEVICE_PROFILE := TLWR841 - TPLINK_HWID := 0x08470008 -endef -TARGET_DEVICES += tl-wr842n-v1 tl-wr842n-v2 tl-wr842n-v3 tl-wr843nd-v1 tl-wr847n-v8 - -define Device/tl-wr902ac-v1 - DEVICE_TITLE := TP-LINK TL-WR902AC v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport \ - kmod-ath10k ath10k-firmware-qca9887 -swconfig -uboot-envtools - BOARDNAME := TL-WR902AC-V1 - DEVICE_PROFILE := TLWR902 - TPLINK_BOARD_ID := TL-WR902AC-V1 - TPLINK_HWID := 0x0 - TPLINK_HWREV := 0 - TPLINK_HEADER_VERSION := 1 - SUPPORTED_DEVICES := tl-wr902ac-v1 - IMAGE_SIZE := 7360k - KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header - IMAGES += factory.bin - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - MTDPARTS := spi0.0:128k(u-boot)ro,7360k(firmware),640k(tplink)ro,64k(art)ro -endef - -define Device/tl-wr940n-v4 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR940N v4 - BOARDNAME := TL-WR940N-v4 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09400004 - IMAGES += factory-us.bin factory-eu.bin - IMAGE/factory-us.bin := append-rootfs | mktplinkfw factory -C US - IMAGE/factory-eu.bin := append-rootfs | mktplinkfw factory -C EU -endef - -define Device/tl-wr941nd-v2 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v2 - BOARDNAME := TL-WR941ND - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410002 - TPLINK_HWREV := 2 -endef - -define Device/tl-wr941nd-v3 - $(Device/tl-wr941nd-v2) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v3 -endef - -define Device/tl-wr941nd-v4 - $(Device/tplink-8m) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v4 - BOARDNAME := TL-WR741ND - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410004 -endef - -define Device/tl-wr941nd-v5 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v5 - BOARDNAME := TL-WR941ND-v5 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410005 -endef - -define Device/tl-wr941nd-v6 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 - BOARDNAME := TL-WR941ND-v6 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 -endef - -# Chinese version (unlike European) is similar to the TL-WDR3500 -define Device/tl-wr941nd-v6-cn - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v6 (CN) - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410006 -endef - -define Device/tl-wr941n-v7 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v7 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410007 -endef - -define Device/tl-wr2041n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v1 - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410001 -endef - -define Device/tl-wr2041n-v2 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v2 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410002 -endef - -define Device/tl-wr942n-v1 - DEVICE_TITLE := TP-LINK TL-WR942N v1 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR942N-V1 - TPLINK_BOARD_ID := TLWR942NV1 - DEVICE_PROFILE := TLWR942 - IMAGE_SIZE := 14464k - KERNEL := kernel-bin | patch-cmdline | lzma | uImageArcher lzma - IMAGES := sysupgrade.bin factory.bin - IMAGE/sysupgrade.bin := append-rootfs | tplink-safeloader sysupgrade | \ - append-metadata | check-size $$$$(IMAGE_SIZE) - IMAGE/factory.bin := append-rootfs | tplink-safeloader factory - MTDPARTS := spi0.0:128k(u-boot)ro,1344k(kernel),13120k(rootfs),64k(product-info)ro,64k(partition-table)ro,256k(oem-config)ro,1344k(oem-vars)ro,64k(ART)ro,14464k@0x20000(firmware) - SUPPORTED_DEVICES := tl-wr942n-v1 -endef -TARGET_DEVICES += tl-wr940n-v4 tl-wr941nd-v2 tl-wr941nd-v3 tl-wr941nd-v4 tl-wr941nd-v5 tl-wr941nd-v6 tl-wr941nd-v6-cn tl-wr941n-v7 tl-wr942n-v1 tl-wr2041n-v1 tl-wr2041n-v2 - -define Device/tl-wr842n-v9 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR842N/ND v9 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport - BOARDNAME := TL-WR842N-v9 - DEVICE_PROFILE := TLWR842 - TPLINK_HWID := 0x08420009 -endef -TARGET_DEVICES += tl-wr842n-v9 - -define Device/tl-wr882n-v1 - $(Device/tplink-8mlzma) - DEVICE_TITLE := TP-LINK TL-WR882N v1 - BOARDNAME := TL-WR882N-v1 - DEVICE_PROFILE := TLWR882 - TPLINK_HWID := 0x08820001 -endef -TARGET_DEVICES += tl-wr882n-v1 diff --git a/target/linux/ar71xx/mikrotik/config-default b/target/linux/ar71xx/mikrotik/config-default index 42f9882bb..e324e4c25 100644 --- a/target/linux/ar71xx/mikrotik/config-default +++ b/target/linux/ar71xx/mikrotik/config-default @@ -1,120 +1,12 @@ -# CONFIG_ATH79_DEV_DSA is not set -# CONFIG_ATH79_MACH_A60 is not set -# CONFIG_ATH79_MACH_ALFA_AP120C is not set -# CONFIG_ATH79_MACH_ALFA_AP96 is not set -# CONFIG_ATH79_MACH_ALFA_NX is not set -# CONFIG_ATH79_MACH_ALL0258N is not set -# CONFIG_ATH79_MACH_ALL0315N is not set -# CONFIG_ATH79_MACH_ANTMINER_S1 is not set -# CONFIG_ATH79_MACH_ANTMINER_S3 is not set -# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set -# CONFIG_ATH79_MACH_AP121 is not set -# CONFIG_ATH79_MACH_AP121F is not set -# CONFIG_ATH79_MACH_AP132 is not set -# CONFIG_ATH79_MACH_AP136 is not set -# CONFIG_ATH79_MACH_AP143 is not set -# CONFIG_ATH79_MACH_AP147 is not set -# CONFIG_ATH79_MACH_AP152 is not set -# CONFIG_ATH79_MACH_AP531B0 is not set -# CONFIG_ATH79_MACH_AP90Q is not set -# CONFIG_ATH79_MACH_AP96 is not set -# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C7 is not set -# CONFIG_ATH79_MACH_ARDUINO_YUN is not set -# CONFIG_ATH79_MACH_AW_NR580 is not set -# CONFIG_ATH79_MACH_BHR_4GRV2 is not set -# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set -# CONFIG_ATH79_MACH_BSB is not set -# CONFIG_ATH79_MACH_C55 is not set -# CONFIG_ATH79_MACH_CAP324 is not set -# CONFIG_ATH79_MACH_CAP4200AG is not set -# CONFIG_ATH79_MACH_CARAMBOLA2 is not set -# CONFIG_ATH79_MACH_CF_E316N_V2 is not set -# CONFIG_ATH79_MACH_CF_E320N_V2 is not set -# CONFIG_ATH79_MACH_CF_E355AC is not set -# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set -# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set -# CONFIG_ATH79_MACH_CF_E520N is not set -# CONFIG_ATH79_MACH_CF_E530N is not set -# CONFIG_ATH79_MACH_CPE505N is not set -# CONFIG_ATH79_MACH_CPE510 is not set -# CONFIG_ATH79_MACH_CPE830 is not set -# CONFIG_ATH79_MACH_CPE870 is not set -# CONFIG_ATH79_MACH_CR3000 is not set -# CONFIG_ATH79_MACH_CR5000 is not set -# CONFIG_ATH79_MACH_DAP_2695_A1 is not set -# CONFIG_ATH79_MACH_DB120 is not set -# CONFIG_ATH79_MACH_DGL_5500_A1 is not set -# CONFIG_ATH79_MACH_DHP_1565_A1 is not set -# CONFIG_ATH79_MACH_DIR_505_A1 is not set -# CONFIG_ATH79_MACH_DIR_600_A1 is not set -# CONFIG_ATH79_MACH_DIR_615_C1 is not set -# CONFIG_ATH79_MACH_DIR_615_I1 is not set -# CONFIG_ATH79_MACH_DIR_825_B1 is not set -# CONFIG_ATH79_MACH_DIR_825_C1 is not set -# CONFIG_ATH79_MACH_DIR_869_A1 is not set -# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set -# CONFIG_ATH79_MACH_DLAN_PRO_1200_AC is not set -# CONFIG_ATH79_MACH_DLAN_PRO_500_WP is not set -# CONFIG_ATH79_MACH_DR344 is not set -# CONFIG_ATH79_MACH_DR531 is not set -# CONFIG_ATH79_MACH_DRAGINO2 is not set -# CONFIG_ATH79_MACH_E2100L is not set -# CONFIG_ATH79_MACH_EAP120 is not set -# CONFIG_ATH79_MACH_EAP300V2 is not set -# CONFIG_ATH79_MACH_EAP7660D is not set -# CONFIG_ATH79_MACH_EL_M150 is not set -# CONFIG_ATH79_MACH_EL_MINI is not set -# CONFIG_ATH79_MACH_ENS202EXT is not set -# 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_DORIN is not set -# CONFIG_ATH79_MACH_F9K1115V2 is not set -# CONFIG_ATH79_MACH_FRITZ300E is not set -# CONFIG_ATH79_MACH_GL_AR150 is not set -# CONFIG_ATH79_MACH_GL_AR300 is not set -# CONFIG_ATH79_MACH_GL_AR300M is not set -# CONFIG_ATH79_MACH_GL_DOMINO is not set -# CONFIG_ATH79_MACH_GL_INET is not set -# CONFIG_ATH79_MACH_GL_MIFI is not set -# CONFIG_ATH79_MACH_GL_USB150 is not set -# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set -# CONFIG_ATH79_MACH_GS_OOLITE is not set -# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set -# CONFIG_ATH79_MACH_HORNET_UB is not set -# CONFIG_ATH79_MACH_JA76PF is not set -# CONFIG_ATH79_MACH_JWAP003 is not set -# CONFIG_ATH79_MACH_JWAP230 is not set -# CONFIG_ATH79_MACH_LIMA is not set -# CONFIG_ATH79_MACH_MC_MAC1200R is not set -# CONFIG_ATH79_MACH_MR12 is not set -# CONFIG_ATH79_MACH_MR16 is not set -# CONFIG_ATH79_MACH_MR1750 is not set -# CONFIG_ATH79_MACH_MR600 is not set -# CONFIG_ATH79_MACH_MR900 is not set -# CONFIG_ATH79_MACH_MYNET_N600 is not set -# CONFIG_ATH79_MACH_MYNET_N750 is not set -# CONFIG_ATH79_MACH_MYNET_REXT is not set -# CONFIG_ATH79_MACH_MZK_W04NU is not set -# CONFIG_ATH79_MACH_MZK_W300NH is not set -# CONFIG_ATH79_MACH_NBG460N is not set -# CONFIG_ATH79_MACH_NBG6716 is not set -# CONFIG_ATH79_MACH_OM2P is not set -# CONFIG_ATH79_MACH_OM5P is not set -# CONFIG_ATH79_MACH_OM5P_AC is not set -# CONFIG_ATH79_MACH_OM5P_ACv2 is not set -# CONFIG_ATH79_MACH_OMY_G1 is not set -# CONFIG_ATH79_MACH_OMY_X1 is not set -# CONFIG_ATH79_MACH_ONION_OMEGA is not set -# CONFIG_ATH79_MACH_PB42 is not set -# CONFIG_ATH79_MACH_PB44 is not set -# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set -# CONFIG_ATH79_MACH_QIHOO_C301 is not set -# CONFIG_ATH79_MACH_R602N is not set +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y CONFIG_ATH79_MACH_RB2011=y CONFIG_ATH79_MACH_RB4XX=y CONFIG_ATH79_MACH_RB750=y @@ -123,103 +15,20 @@ CONFIG_ATH79_MACH_RB922=y CONFIG_ATH79_MACH_RB95X=y CONFIG_ATH79_MACH_RBSPI=y CONFIG_ATH79_MACH_RBSXTLITE=y -# CONFIG_ATH79_MACH_RE450 is not set -# CONFIG_ATH79_MACH_RW2458N is not set -# CONFIG_ATH79_MACH_SC1750 is not set -# CONFIG_ATH79_MACH_SC300M is not set -# CONFIG_ATH79_MACH_SC450 is not set -# CONFIG_ATH79_MACH_SMART_300 is not set -# CONFIG_ATH79_MACH_SOM9331 is not set -# CONFIG_ATH79_MACH_SR3200 is not set -# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set -# CONFIG_ATH79_MACH_TEW_632BRP is not set -# CONFIG_ATH79_MACH_TEW_673GRU is not set -# CONFIG_ATH79_MACH_TEW_712BR is not set -# CONFIG_ATH79_MACH_TEW_732BR is not set -# CONFIG_ATH79_MACH_TEW_823DRU is not set -# CONFIG_ATH79_MACH_TL_MR11U is not set -# CONFIG_ATH79_MACH_TL_MR13U is not set -# CONFIG_ATH79_MACH_TL_MR3020 is not set -# CONFIG_ATH79_MACH_TL_MR3X20 is not set -# CONFIG_ATH79_MACH_TL_MR6400 is not set -# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set -# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set -# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set -# CONFIG_ATH79_MACH_TL_WA901ND is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WAX50RE is not set -# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set -# CONFIG_ATH79_MACH_TL_WDR3500 is not set -# CONFIG_ATH79_MACH_TL_WDR4300 is not set -# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set -# CONFIG_ATH79_MACH_TL_WPA8630 is not set -# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR2543N is not set -# CONFIG_ATH79_MACH_TL_WR703N is not set -# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set -# CONFIG_ATH79_MACH_TL_WR741ND is not set -# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR810N is not set -# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set -# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set -# CONFIG_ATH79_MACH_TL_WR941ND is not set -# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set -# CONFIG_ATH79_MACH_TUBE2H is not set -# CONFIG_ATH79_MACH_UBNT is not set -# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set -# CONFIG_ATH79_MACH_UBNT_XM is not set -# CONFIG_ATH79_MACH_WEIO is not set -# CONFIG_ATH79_MACH_WHR_HP_G300N is not set -# CONFIG_ATH79_MACH_WLAE_AG300N is not set -# CONFIG_ATH79_MACH_WLR8100 is not set -# CONFIG_ATH79_MACH_WNDAP360 is not set -# CONFIG_ATH79_MACH_WNDR3700 is not set -# CONFIG_ATH79_MACH_WNR2000 is not set -# CONFIG_ATH79_MACH_WNR2000_V3 is not set -# CONFIG_ATH79_MACH_WNR2000_V4 is not set -# CONFIG_ATH79_MACH_WNR2200 is not set -# CONFIG_ATH79_MACH_WP543 is not set -# CONFIG_ATH79_MACH_WPE72 is not set -# CONFIG_ATH79_MACH_WPJ342 is not set -# CONFIG_ATH79_MACH_WPJ344 is not set -# CONFIG_ATH79_MACH_WPJ531 is not set -# CONFIG_ATH79_MACH_WPJ558 is not set -# CONFIG_ATH79_MACH_WPJ563 is not set -# CONFIG_ATH79_MACH_WRT160NL is not set -# CONFIG_ATH79_MACH_WRT400N is not set -# CONFIG_ATH79_MACH_WRTNODE2Q is not set -# CONFIG_ATH79_MACH_WZR_450HP2 is not set -# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set -# CONFIG_ATH79_MACH_WZR_HP_G450H is not set -# CONFIG_ATH79_MACH_XD3200 is not set -# CONFIG_ATH79_MACH_ZBT_WE1526 is not set -# CONFIG_ATH79_MACH_ZCN_1523H is not set -# CONFIG_ATH79_NVRAM is not set +CONFIG_ATH79_PCI_ATH9K_FIXUP=y CONFIG_ATH79_ROUTERBOOT=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_GPIO_LATCH=y +CONFIG_HW_HAS_PCI=y # CONFIG_INTEL_XWAY_PHY is not set CONFIG_LEDS_RB750=y CONFIG_LZO_DECOMPRESS=y +# CONFIG_MARVELL_PHY is not set # CONFIG_MTD_CFI is not set CONFIG_MTD_CFI_I2=y +# CONFIG_MTD_CMDLINE_PARTS is not set # CONFIG_MTD_CYBERTAN_PARTS is not set CONFIG_MTD_MAP_BANK_WIDTH_1=y CONFIG_MTD_MAP_BANK_WIDTH_4=y @@ -233,7 +42,11 @@ CONFIG_MTD_NAND_RB91X=y # CONFIG_MTD_REDBOOT_PARTS is not set CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y # CONFIG_MTD_SPLIT_EVA_FW is not set +# CONFIG_MTD_SPLIT_LZMA_FW is not set +# CONFIG_MTD_SPLIT_SEAMA_FW is not set # CONFIG_MTD_SPLIT_TPLINK_FW is not set +# CONFIG_MTD_SPLIT_UIMAGE_FW is not set +# CONFIG_MTD_SPLIT_WRGG_FW is not set # CONFIG_MTD_TPLINK_PARTS is not set CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 @@ -241,10 +54,19 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 +# CONFIG_NET_DSA is not set +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y CONFIG_RLE_DECOMPRESS=y -# CONFIG_SOC_AR913X is not set -# CONFIG_SOC_AR933X is not set -# CONFIG_SOC_QCA956X is not set +# CONFIG_RTL8306_PHY is not set +# CONFIG_RTL8366_SMI is not set +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA955X=y CONFIG_SPI_RB4XX=y CONFIG_SPI_RB4XX_CPLD=y CONFIG_UBIFS_FS=y diff --git a/target/linux/ar71xx/nand/config-default b/target/linux/ar71xx/nand/config-default index 340d64cab..39b1ca499 100644 --- a/target/linux/ar71xx/nand/config-default +++ b/target/linux/ar71xx/nand/config-default @@ -1,218 +1,30 @@ -# CONFIG_ATH79_DEV_DSA is not set -# CONFIG_ATH79_MACH_ALFA_AP120C is not set -# CONFIG_ATH79_MACH_ALFA_AP96 is not set -# CONFIG_ATH79_MACH_ALFA_NX is not set -# CONFIG_ATH79_MACH_ALL0258N is not set -# CONFIG_ATH79_MACH_ALL0315N is not set -# CONFIG_ATH79_MACH_ANTMINER_S1 is not set -# CONFIG_ATH79_MACH_ANTMINER_S3 is not set -# CONFIG_ATH79_MACH_ANTROUTER_R1 is not set -# CONFIG_ATH79_MACH_AP121 is not set -# CONFIG_ATH79_MACH_AP121F is not set -# CONFIG_ATH79_MACH_AP132 is not set -# CONFIG_ATH79_MACH_AP136 is not set -# CONFIG_ATH79_MACH_AP143 is not set -# CONFIG_ATH79_MACH_AP147 is not set -# CONFIG_ATH79_MACH_AP152 is not set -# CONFIG_ATH79_MACH_AP531B0 is not set -# CONFIG_ATH79_MACH_AP90Q is not set -# CONFIG_ATH79_MACH_AP96 is not set -# CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C59_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C60_V1 is not set -# CONFIG_ATH79_MACH_ARCHER_C7 is not set -# CONFIG_ATH79_MACH_ARDUINO_YUN is not set -# CONFIG_ATH79_MACH_AW_NR580 is not set -# CONFIG_ATH79_MACH_BHR_4GRV2 is not set -# CONFIG_ATH79_MACH_BHU_BXU2000N2_A is not set -# CONFIG_ATH79_MACH_BSB is not set -# CONFIG_ATH79_MACH_C55 is not set +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +CONFIG_ATH79_DEV_NFC=y +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y CONFIG_ATH79_MACH_C60=y -# CONFIG_ATH79_MACH_CAP324 is not set -# CONFIG_ATH79_MACH_CAP4200AG is not set -# CONFIG_ATH79_MACH_CARAMBOLA2 is not set -# CONFIG_ATH79_MACH_CF_E316N_V2 is not set -# CONFIG_ATH79_MACH_CF_E320N_V2 is not set -# CONFIG_ATH79_MACH_CF_E355AC is not set -# CONFIG_ATH79_MACH_CF_E380AC_V1 is not set -# CONFIG_ATH79_MACH_CF_E380AC_V2 is not set -# CONFIG_ATH79_MACH_CF_E520N is not set -# CONFIG_ATH79_MACH_CF_E530N is not set -# CONFIG_ATH79_MACH_CPE505N is not set -# CONFIG_ATH79_MACH_CPE510 is not set -# CONFIG_ATH79_MACH_CPE830 is not set -# CONFIG_ATH79_MACH_CPE870 is not set -# CONFIG_ATH79_MACH_CR3000 is not set -# CONFIG_ATH79_MACH_CR5000 is not set -# CONFIG_ATH79_MACH_DAP_2695_A1 is not set -# CONFIG_ATH79_MACH_DB120 is not set -# CONFIG_ATH79_MACH_DGL_5500_A1 is not set -# CONFIG_ATH79_MACH_DHP_1565_A1 is not set -# CONFIG_ATH79_MACH_DIR_505_A1 is not set -# CONFIG_ATH79_MACH_DIR_600_A1 is not set -# CONFIG_ATH79_MACH_DIR_615_C1 is not set -# CONFIG_ATH79_MACH_DIR_615_I1 is not set -# CONFIG_ATH79_MACH_DIR_825_B1 is not set -# CONFIG_ATH79_MACH_DIR_825_C1 is not set -# CONFIG_ATH79_MACH_DIR_869_A1 is not set -# CONFIG_ATH79_MACH_DLAN_HOTSPOT is not set -# 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=y -# CONFIG_ATH79_MACH_DR344 is not set -# CONFIG_ATH79_MACH_DR531 is not set -# CONFIG_ATH79_MACH_DRAGINO2 is not set -# CONFIG_ATH79_MACH_E2100L is not set -# CONFIG_ATH79_MACH_EAP120 is not set -# CONFIG_ATH79_MACH_EAP300V2 is not set -# CONFIG_ATH79_MACH_EAP7660D is not set -# CONFIG_ATH79_MACH_EL_M150 is not set -# CONFIG_ATH79_MACH_EL_MINI is not set -# CONFIG_ATH79_MACH_ENS202EXT is not set -# 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_DORIN is not set -# CONFIG_ATH79_MACH_F9K1115V2 is not set -# CONFIG_ATH79_MACH_FRITZ300E is not set -# CONFIG_ATH79_MACH_GL_AR150 is not set -# CONFIG_ATH79_MACH_GL_AR300 is not set -# CONFIG_ATH79_MACH_GL_AR300M is not set -# CONFIG_ATH79_MACH_GL_DOMINO is not set -# CONFIG_ATH79_MACH_GL_INET is not set -# CONFIG_ATH79_MACH_GL_MIFI is not set -# CONFIG_ATH79_MACH_GL_USB150 is not set -# CONFIG_ATH79_MACH_GS_MINIBOX_V1 is not set -# CONFIG_ATH79_MACH_GS_OOLITE is not set CONFIG_ATH79_MACH_HIVEAP_121=y -# CONFIG_ATH79_MACH_HIWIFI_HC6361 is not set -# CONFIG_ATH79_MACH_HORNET_UB is not set -# CONFIG_ATH79_MACH_JA76PF is not set -# CONFIG_ATH79_MACH_JWAP003 is not set -# CONFIG_ATH79_MACH_JWAP230 is not set -# CONFIG_ATH79_MACH_LIMA is not set -# CONFIG_ATH79_MACH_MC_MAC1200R is not set -# CONFIG_ATH79_MACH_MR12 is not set -# CONFIG_ATH79_MACH_MR16 is not set -# CONFIG_ATH79_MACH_MR1750 is not set CONFIG_ATH79_MACH_MR18=y -# CONFIG_ATH79_MACH_MR600 is not set -# CONFIG_ATH79_MACH_MR900 is not set -# CONFIG_ATH79_MACH_MYNET_N600 is not set -# CONFIG_ATH79_MACH_MYNET_N750 is not set -# CONFIG_ATH79_MACH_MYNET_REXT is not set -# CONFIG_ATH79_MACH_MZK_W04NU is not set -# CONFIG_ATH79_MACH_MZK_W300NH is not set -# CONFIG_ATH79_MACH_NBG460N is not set -# CONFIG_ATH79_MACH_OM2P is not set -# CONFIG_ATH79_MACH_OM5P is not set -# CONFIG_ATH79_MACH_OM5P_AC is not set -# CONFIG_ATH79_MACH_OM5P_ACv2 is not set -# CONFIG_ATH79_MACH_OMY_G1 is not set -# CONFIG_ATH79_MACH_OMY_X1 is not set -# CONFIG_ATH79_MACH_ONION_OMEGA is not set -# CONFIG_ATH79_MACH_PB42 is not set -# CONFIG_ATH79_MACH_PB44 is not set -# CONFIG_ATH79_MACH_PQI_AIR_PEN is not set -# CONFIG_ATH79_MACH_QIHOO_C301 is not set -# CONFIG_ATH79_MACH_R602N is not set +CONFIG_ATH79_MACH_NBG6716=y CONFIG_ATH79_MACH_R6100=y CONFIG_ATH79_MACH_RAMBUTAN=y -# CONFIG_ATH79_MACH_RE450 is not set -# CONFIG_ATH79_MACH_RW2458N is not set -# CONFIG_ATH79_MACH_SC1750 is not set -# CONFIG_ATH79_MACH_SC300M is not set -# CONFIG_ATH79_MACH_SC450 is not set -# CONFIG_ATH79_MACH_SMART_300 is not set -# CONFIG_ATH79_MACH_SOM9331 is not set -# CONFIG_ATH79_MACH_SR3200 is not set -# CONFIG_ATH79_MACH_TELLSTICK_ZNET_LITE is not set -# CONFIG_ATH79_MACH_TEW_632BRP is not set -# CONFIG_ATH79_MACH_TEW_673GRU is not set -# CONFIG_ATH79_MACH_TEW_712BR is not set -# CONFIG_ATH79_MACH_TEW_732BR is not set -# CONFIG_ATH79_MACH_TEW_823DRU is not set -# CONFIG_ATH79_MACH_TL_MR11U is not set -# CONFIG_ATH79_MACH_TL_MR13U is not set -# CONFIG_ATH79_MACH_TL_MR3020 is not set -# CONFIG_ATH79_MACH_TL_MR3X20 is not set -# CONFIG_ATH79_MACH_TL_MR6400 is not set -# CONFIG_ATH79_MACH_TL_WA701ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA7210N_V2 is not set -# CONFIG_ATH79_MACH_TL_WA801ND_V3 is not set -# CONFIG_ATH79_MACH_TL_WA830RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA850RE_V2 is not set -# CONFIG_ATH79_MACH_TL_WA855RE_V1 is not set -# CONFIG_ATH79_MACH_TL_WA901ND is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WA901ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WAX50RE is not set -# CONFIG_ATH79_MACH_TL_WDR3320_V2 is not set -# CONFIG_ATH79_MACH_TL_WDR3500 is not set -# CONFIG_ATH79_MACH_TL_WDR4300 is not set -# CONFIG_ATH79_MACH_TL_WDR6500_V2 is not set -# CONFIG_ATH79_MACH_TL_WPA8630 is not set -# CONFIG_ATH79_MACH_TL_WR1041N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V2 is not set -# CONFIG_ATH79_MACH_TL_WR1043ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR2543N is not set -# CONFIG_ATH79_MACH_TL_WR703N is not set -# CONFIG_ATH79_MACH_TL_WR720N_V3 is not set -# CONFIG_ATH79_MACH_TL_WR741ND is not set -# CONFIG_ATH79_MACH_TL_WR741ND_V4 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR802N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR810N is not set -# CONFIG_ATH79_MACH_TL_WR840N_V2 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V1 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V8 is not set -# CONFIG_ATH79_MACH_TL_WR841N_V9 is not set -# CONFIG_ATH79_MACH_TL_WR902AC_V1 is not set -# CONFIG_ATH79_MACH_TL_WR940N_V4 is not set -# CONFIG_ATH79_MACH_TL_WR941ND is not set -# CONFIG_ATH79_MACH_TL_WR941ND_V6 is not set -# CONFIG_ATH79_MACH_TL_WR942N_V1 is not set -# CONFIG_ATH79_MACH_TUBE2H is not set -# CONFIG_ATH79_MACH_UBNT is not set -# CONFIG_ATH79_MACH_UBNT_UNIFIAC is not set -# CONFIG_ATH79_MACH_UBNT_XM is not set -# CONFIG_ATH79_MACH_WEIO is not set -# CONFIG_ATH79_MACH_WHR_HP_G300N is not set CONFIG_ATH79_MACH_WI2A_AC200I=y -# CONFIG_ATH79_MACH_WLAE_AG300N is not set -# CONFIG_ATH79_MACH_WLR8100 is not set -# CONFIG_ATH79_MACH_WNDAP360 is not set -# CONFIG_ATH79_MACH_WNDR3700 is not set CONFIG_ATH79_MACH_WNDR4300=y -# CONFIG_ATH79_MACH_WNR2000 is not set -# CONFIG_ATH79_MACH_WNR2000_V3 is not set -# CONFIG_ATH79_MACH_WNR2000_V4 is not set -# CONFIG_ATH79_MACH_WNR2200 is not set -# CONFIG_ATH79_MACH_WP543 is not set -# CONFIG_ATH79_MACH_WPE72 is not set -# CONFIG_ATH79_MACH_WPJ342 is not set -# CONFIG_ATH79_MACH_WPJ344 is not set -# CONFIG_ATH79_MACH_WPJ531 is not set -# CONFIG_ATH79_MACH_WPJ558 is not set -# CONFIG_ATH79_MACH_WPJ563 is not set -# CONFIG_ATH79_MACH_WRT160NL is not set -# CONFIG_ATH79_MACH_WRT400N is not set -# CONFIG_ATH79_MACH_WRTNODE2Q is not set -# CONFIG_ATH79_MACH_WZR_450HP2 is not set -# CONFIG_ATH79_MACH_WZR_HP_AG300H is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH is not set -# CONFIG_ATH79_MACH_WZR_HP_G300NH2 is not set -# CONFIG_ATH79_MACH_WZR_HP_G450H is not set -# CONFIG_ATH79_MACH_XD3200 is not set CONFIG_ATH79_MACH_Z1=y -# CONFIG_ATH79_MACH_ZBT_WE1526 is not set -# CONFIG_ATH79_MACH_ZCN_1523H is not set +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y CONFIG_BCH=y +CONFIG_BLK_MQ_PCI=y CONFIG_CRC16=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_LZO=y +CONFIG_HW_HAS_PCI=y # CONFIG_INTEL_XWAY_PHY is not set # CONFIG_IP17XX_PHY is not set CONFIG_LEDS_NU801=y @@ -242,14 +54,14 @@ CONFIG_MTD_UBI_BLOCK=y # CONFIG_MTD_UBI_FASTMAP is not set # CONFIG_MTD_UBI_GLUEBI is not set CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y # CONFIG_RTL8306_PHY is not set # CONFIG_RTL8366_SMI is not set -# CONFIG_SOC_AR71XX is not set -# CONFIG_SOC_AR724X is not set -# CONFIG_SOC_AR913X is not set -# CONFIG_SOC_AR933X is not set -# CONFIG_SOC_QCA953X is not set -# CONFIG_SOC_QCA956X is not set +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA955X=y CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set CONFIG_UBIFS_FS_LZO=y diff --git a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch index 1348cd9b0..c6b9cafad 100644 --- a/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch +++ b/target/linux/ar71xx/patches-4.4/423-dsa-add-88e6063-driver.patch @@ -1,11 +1,12 @@ --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig -@@ -13,6 +13,13 @@ config NET_DSA_MV88E6060 +@@ -13,6 +13,14 @@ config NET_DSA_MV88E6060 This enables support for the Marvell 88E6060 ethernet switch chip. +config NET_DSA_MV88E6063 + bool "Marvell 88E6063 ethernet switch chip support" ++ depends on NET_DSA + select NET_DSA_TAG_TRAILER + ---help--- + This enables support for the Marvell 88E6063 ethernet switch diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch index cd91ac3c0..1ad5fa68a 100644 --- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,27 @@ void __init prom_init(void) +@@ -136,6 +136,29 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -20,6 +20,8 @@ + strstr(arcs_cmdline, "board=962") || + strstr(arcs_cmdline, "board=lhg") || + strstr(arcs_cmdline, "board=map-hb") || ++ strstr(arcs_cmdline, "board=map2-hb") || ++ strstr(arcs_cmdline, "board=wap-hb") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || diff --git a/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch new file mode 100644 index 000000000..b8715bba9 --- /dev/null +++ b/target/linux/ar71xx/patches-4.4/702-MIPS-ath79-fixup-routerboot-board-parameter.patch @@ -0,0 +1,43 @@ +From: Gabor Juhos +Date: Sat, 2 Dec 2017 19:15:29 +0100 +Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions + +Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) +use "Board=" kernel parameter instead of "board=" to pass the board +name to the kernel. Due to this change the board detection code is +not working on the devices shipped with the new RouterBOOT version. +Because the kernel is unable to identify these boards they become +unusable despite that they are supported by the current code. + +Update the prom_init code to convert the 'Board' kernel parameter to +'board'. After this change, the board detection works also with the +new RouterBOOT versions. + +Signed-off-by: Gabor Juhos +--- +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload + void __init prom_init(void) + { + const char *env; ++ char *c; + + if (ath79_prom_init_myloader()) + return; +@@ -137,6 +138,15 @@ void __init prom_init(void) + } + #endif + ++ /* ++ * RouterBOOT uses "Board" kernel parameter instead of "board" since ++ * version 3.41 (or so). Replace the first character of the parameter ++ * to keep board detection working. ++ */ ++ c = strstr(arcs_cmdline, "Board="); ++ if (c) ++ c[0] = 'b'; ++ + if (strstr(arcs_cmdline, "board=750Gr3") || + strstr(arcs_cmdline, "board=750i") || + strstr(arcs_cmdline, "board=750-hb") || diff --git a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch index 4536d519f..8f8f349a6 100644 --- a/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch +++ b/target/linux/ar71xx/patches-4.4/900-mdio_bitbang_ignore_ta_value.patch @@ -1,5 +1,14 @@ --- a/drivers/net/phy/mdio-bitbang.c +++ b/drivers/net/phy/mdio-bitbang.c +@@ -155,7 +155,7 @@ static int mdiobb_cmd_addr(struct mdiobb + static int mdiobb_read(struct mii_bus *bus, int phy, int reg) + { + struct mdiobb_ctrl *ctrl = bus->priv; +- int ret, i; ++ int ret; + + if (reg & MII_ADDR_C45) { + reg = mdiobb_cmd_addr(ctrl, phy, reg); @@ -165,19 +165,7 @@ static int mdiobb_read(struct mii_bus *b ctrl->ops->set_mdio_dir(ctrl, 0); diff --git a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch index 68f86e0e0..a830346a3 100644 --- a/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch +++ b/target/linux/ar71xx/patches-4.4/901-phy-mdio-bitbang-prevent-rescheduling-during-command.patch @@ -25,8 +25,8 @@ Signed-off-by: Jonas Gorski @@ -156,7 +157,9 @@ static int mdiobb_read(struct mii_bus *b { struct mdiobb_ctrl *ctrl = bus->priv; - int ret, i; -+ long flags; + int ret; ++ unsigned long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { @@ -44,7 +44,7 @@ Signed-off-by: Jonas Gorski static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) { struct mdiobb_ctrl *ctrl = bus->priv; -+ long flags; ++ unsigned long flags; + local_irq_save(flags); if (reg & MII_ADDR_C45) { diff --git a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch index 1df93e996..dbf892b43 100644 --- a/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch +++ b/target/linux/ar71xx/patches-4.9/423-dsa-add-88e6063-driver.patch @@ -1,11 +1,12 @@ --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig -@@ -9,6 +9,13 @@ config NET_DSA_MV88E6060 +@@ -9,6 +9,14 @@ config NET_DSA_MV88E6060 This enables support for the Marvell 88E6060 ethernet switch chip. +config NET_DSA_MV88E6063 + bool "Marvell 88E6063 ethernet switch chip support" ++ depends on NET_DSA + select NET_DSA_TAG_TRAILER + ---help--- + This enables support for the Marvell 88E6063 ethernet switch diff --git a/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch b/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch index d9cfa888f..a3d752e9a 100644 --- a/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch +++ b/target/linux/ar71xx/patches-4.9/451-gpio-74x164-improve-platform-device-support.patch @@ -25,7 +25,7 @@ /* * bits_per_word cannot be configured in platform data */ -@@ -115,17 +123,23 @@ static int gen_74x164_probe(struct spi_d +@@ -115,12 +123,15 @@ static int gen_74x164_probe(struct spi_d if (ret < 0) return ret; @@ -47,15 +47,7 @@ chip = devm_kzalloc(&spi->dev, sizeof(*chip) + nregs, GFP_KERNEL); if (!chip) - return -ENOMEM; - -+ if (pdata && pdata->init_data) -+ memcpy(chip->buffer, pdata->init_data, chip->registers); -+ - spi_set_drvdata(spi, chip); - - chip->gpio_chip.label = spi->modalias; -@@ -133,7 +147,11 @@ static int gen_74x164_probe(struct spi_d +@@ -133,7 +144,11 @@ static int gen_74x164_probe(struct spi_d chip->gpio_chip.get = gen_74x164_get_value; chip->gpio_chip.set = gen_74x164_set_value; chip->gpio_chip.set_multiple = gen_74x164_set_multiple; @@ -68,6 +60,16 @@ chip->registers = nregs; chip->gpio_chip.ngpio = GEN_74X164_NUMBER_GPIOS * chip->registers; +@@ -142,6 +157,9 @@ static int gen_74x164_probe(struct spi_d + chip->gpio_chip.parent = &spi->dev; + chip->gpio_chip.owner = THIS_MODULE; + ++ if (pdata && pdata->init_data) ++ memcpy(chip->buffer, pdata->init_data, chip->registers); ++ + mutex_init(&chip->lock); + + ret = __gen_74x164_write_config(chip); @@ -170,17 +188,19 @@ static int gen_74x164_remove(struct spi_ return 0; } diff --git a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch index 0dc73a8b5..5c3583f75 100644 --- a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch +++ b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch @@ -10,10 +10,18 @@ } static void ath79_spi_disable(struct ath79_spi *sp) -@@ -205,6 +202,33 @@ static u32 ath79_spi_txrx_mode0(struct s +@@ -205,6 +202,38 @@ static u32 ath79_spi_txrx_mode0(struct s return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS); } ++static bool ath79_spi_flash_read_supported(struct spi_device *spi) ++{ ++ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) ++ return false; ++ ++ return true; ++} ++ +static int ath79_spi_read_flash_data(struct spi_device *spi, + struct spi_flash_read_message *msg) +{ @@ -22,9 +30,6 @@ + if (msg->addr_width > 3) + return -EOPNOTSUPP; + -+ if (spi->chip_select || gpio_is_valid(spi->cs_gpio)) -+ return -EOPNOTSUPP; -+ + /* disable GPIO mode */ + ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0); + @@ -44,11 +49,12 @@ static int ath79_spi_probe(struct platform_device *pdev) { struct spi_master *master; -@@ -234,6 +258,7 @@ static int ath79_spi_probe(struct platfo +@@ -234,6 +263,8 @@ static int ath79_spi_probe(struct platfo master->num_chipselect = pdata->num_chipselect; master->cs_gpios = pdata->cs_gpios; } + master->spi_flash_read = ath79_spi_read_flash_data; ++ master->flash_read_supported = ath79_spi_flash_read_supported; sp->bitbang.master = master; sp->bitbang.chipselect = ath79_spi_chipselect; diff --git a/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch b/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch index bcb19372e..d6a9276c3 100644 --- a/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch +++ b/target/linux/ar71xx/patches-4.9/500-MIPS-fw-myloader.patch @@ -10,7 +10,7 @@ --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig -@@ -1144,6 +1144,9 @@ config MIPS_MSC +@@ -1149,6 +1149,9 @@ config MIPS_MSC config MIPS_NILE4 bool diff --git a/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch new file mode 100644 index 000000000..c0b5459e4 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/604-MIPS-ath79-no-of.patch @@ -0,0 +1,70 @@ +--- a/arch/mips/Kconfig ++++ b/arch/mips/Kconfig +@@ -195,7 +195,6 @@ config ATH79 + select SYS_SUPPORTS_BIG_ENDIAN + select SYS_SUPPORTS_MIPS16 + select SYS_SUPPORTS_ZBOOT_UART_PROM +- select USE_OF + help + Support for the Atheros AR71XX/AR724X/AR913X SoCs. + +--- a/arch/mips/ath79/setup.c ++++ b/arch/mips/ath79/setup.c +@@ -196,16 +196,20 @@ unsigned int get_c0_compare_int(void) + + void __init plat_mem_setup(void) + { ++#ifdef CONFIG_OF + unsigned long fdt_start; ++#endif + + set_io_port_base(KSEG1); + ++#ifdef CONFIG_OF + /* Get the position of the FDT passed by the bootloader */ + fdt_start = fw_getenvl("fdt_start"); + if (fdt_start) + __dt_setup_arch((void *)KSEG0ADDR(fdt_start)); + else if (fw_passed_dtb) + __dt_setup_arch((void *)KSEG0ADDR(fw_passed_dtb)); ++#endif + + if (mips_machtype != ATH79_MACH_GENERIC_OF) { + ath79_reset_base = ioremap_nocache(AR71XX_RESET_BASE, +@@ -301,17 +305,21 @@ static int __init ath79_setup(void) + + arch_initcall(ath79_setup); + ++#ifdef CONFIG_OF + void __init device_tree_init(void) + { + unflatten_and_copy_device_tree(); + } ++#endif + + MIPS_MACHINE(ATH79_MACH_GENERIC, + "Generic", + "Generic AR71XX/AR724X/AR913X based board", + NULL); + ++#ifdef CONFIG_OF + MIPS_MACHINE(ATH79_MACH_GENERIC_OF, + "DTB", + "Generic AR71XX/AR724X/AR913X based board (DT)", + NULL); ++#endif +--- a/arch/mips/ath79/clock.c ++++ b/arch/mips/ath79/clock.c +@@ -33,10 +33,12 @@ + #define AR724X_BASE_FREQ 40000000 + + static struct clk *clks[ATH79_CLK_END]; ++#ifdef CONFIG_OF + static struct clk_onecell_data clk_data = { + .clks = clks, + .clk_num = ARRAY_SIZE(clks), + }; ++#endif + + static struct clk *__init ath79_add_sys_clkdev( + const char *id, unsigned long rate) diff --git a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch index 869fdd6dd..03ff6c6aa 100644 --- a/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch +++ b/target/linux/ar71xx/patches-4.9/620-MIPS-ath79-add-support-for-QCA953x-SoC.patch @@ -44,7 +44,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. config ATH79_NVRAM --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c -@@ -356,6 +356,91 @@ static void __init ar934x_clocks_init(vo +@@ -358,6 +358,91 @@ static void __init ar934x_clocks_init(vo iounmap(dpll_base); } @@ -136,7 +136,7 @@ meaning of the bits CPUCLK_FROM_CPUPLL and DDRCLK_FROM_DDRPLL is reversed. static void __init qca955x_clocks_init(void) { unsigned long ref_rate; -@@ -451,6 +536,8 @@ void __init ath79_clocks_init(void) +@@ -453,6 +538,8 @@ void __init ath79_clocks_init(void) ar933x_clocks_init(); else if (soc_is_ar934x()) ar934x_clocks_init(); diff --git a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch index dafac9919..e6eaa7123 100644 --- a/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch +++ b/target/linux/ar71xx/patches-4.9/621-MIPS-ath79-add-support-for-QCA956x-SoC.patch @@ -24,7 +24,7 @@ config ATH79_NVRAM --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c -@@ -526,6 +526,100 @@ static void __init qca955x_clocks_init(v +@@ -528,6 +528,100 @@ static void __init qca955x_clocks_init(v clk_add_alias("uart", NULL, "ref", NULL); } @@ -125,7 +125,7 @@ void __init ath79_clocks_init(void) { if (soc_is_ar71xx()) -@@ -540,6 +634,8 @@ void __init ath79_clocks_init(void) +@@ -542,6 +636,8 @@ void __init ath79_clocks_init(void) qca953x_clocks_init(); else if (soc_is_qca955x()) qca955x_clocks_init(); diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch index cd91ac3c0..1ad5fa68a 100644 --- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,27 @@ void __init prom_init(void) +@@ -136,6 +136,29 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -20,6 +20,8 @@ + strstr(arcs_cmdline, "board=962") || + strstr(arcs_cmdline, "board=lhg") || + strstr(arcs_cmdline, "board=map-hb") || ++ strstr(arcs_cmdline, "board=map2-hb") || ++ strstr(arcs_cmdline, "board=wap-hb") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || diff --git a/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch new file mode 100644 index 000000000..b8715bba9 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/702-MIPS-ath79-fixup-routerboot-board-parameter.patch @@ -0,0 +1,43 @@ +From: Gabor Juhos +Date: Sat, 2 Dec 2017 19:15:29 +0100 +Subject: [PATCH] MIPS: ath79: fix board detection with newer RouterBOOT versions + +Recent RouterBOOT version (at least version 3.41 on RB911G-5HPacD) +use "Board=" kernel parameter instead of "board=" to pass the board +name to the kernel. Due to this change the board detection code is +not working on the devices shipped with the new RouterBOOT version. +Because the kernel is unable to identify these boards they become +unusable despite that they are supported by the current code. + +Update the prom_init code to convert the 'Board' kernel parameter to +'board'. After this change, the board detection works also with the +new RouterBOOT versions. + +Signed-off-by: Gabor Juhos +--- +--- a/arch/mips/ath79/prom.c ++++ b/arch/mips/ath79/prom.c +@@ -104,6 +104,7 @@ static int __init ath79_prom_init_myload + void __init prom_init(void) + { + const char *env; ++ char *c; + + if (ath79_prom_init_myloader()) + return; +@@ -137,6 +138,15 @@ void __init prom_init(void) + } + #endif + ++ /* ++ * RouterBOOT uses "Board" kernel parameter instead of "board" since ++ * version 3.41 (or so). Replace the first character of the parameter ++ * to keep board detection working. ++ */ ++ c = strstr(arcs_cmdline, "Board="); ++ if (c) ++ c[0] = 'b'; ++ + if (strstr(arcs_cmdline, "board=750Gr3") || + strstr(arcs_cmdline, "board=750i") || + strstr(arcs_cmdline, "board=750-hb") || diff --git a/target/linux/ar71xx/tiny/config-default b/target/linux/ar71xx/tiny/config-default new file mode 100644 index 000000000..2e9031a24 --- /dev/null +++ b/target/linux/ar71xx/tiny/config-default @@ -0,0 +1,72 @@ +CONFIG_ATH79_DEV_AP9X_PCI=y +CONFIG_ATH79_DEV_DSA=y +CONFIG_ATH79_DEV_ETH=y +CONFIG_ATH79_DEV_GPIO_BUTTONS=y +CONFIG_ATH79_DEV_LEDS_GPIO=y +CONFIG_ATH79_DEV_M25P80=y +# CONFIG_ATH79_DEV_NFC is not set +CONFIG_ATH79_DEV_SPI=y +CONFIG_ATH79_DEV_USB=y +CONFIG_ATH79_DEV_WMAC=y +CONFIG_ATH79_MACH_DIR_600_A1=y +CONFIG_ATH79_MACH_DIR_615_C1=y +CONFIG_ATH79_MACH_DIR_615_I1=y +CONFIG_ATH79_MACH_NBG460N=y +CONFIG_ATH79_MACH_TEW_632BRP=y +CONFIG_ATH79_MACH_TEW_712BR=y +CONFIG_ATH79_MACH_TL_MR11U=y +CONFIG_ATH79_MACH_TL_MR13U=y +CONFIG_ATH79_MACH_TL_MR3020=y +CONFIG_ATH79_MACH_TL_MR3X20=y +CONFIG_ATH79_MACH_TL_WA701ND_V2=y +CONFIG_ATH79_MACH_TL_WA7210N_V2=y +CONFIG_ATH79_MACH_TL_WA801ND_V3=y +CONFIG_ATH79_MACH_TL_WA830RE_V2=y +CONFIG_ATH79_MACH_TL_WA850RE_V2=y +CONFIG_ATH79_MACH_TL_WA855RE_V1=y +CONFIG_ATH79_MACH_TL_WA901ND=y +CONFIG_ATH79_MACH_TL_WA901ND_V2=y +CONFIG_ATH79_MACH_TL_WA901ND_V4=y +CONFIG_ATH79_MACH_TL_WAX50RE=y +CONFIG_ATH79_MACH_TL_WDR3320_V2=y +CONFIG_ATH79_MACH_TL_WDR3500=y +CONFIG_ATH79_MACH_TL_WR1041N_V2=y +CONFIG_ATH79_MACH_TL_WR703N=y +CONFIG_ATH79_MACH_TL_WR720N_V3=y +CONFIG_ATH79_MACH_TL_WR741ND=y +CONFIG_ATH79_MACH_TL_WR741ND_V4=y +CONFIG_ATH79_MACH_TL_WR802N_V1=y +CONFIG_ATH79_MACH_TL_WR802N_V2=y +CONFIG_ATH79_MACH_TL_WR840N_V2=y +CONFIG_ATH79_MACH_TL_WR841N_V1=y +CONFIG_ATH79_MACH_TL_WR841N_V8=y +CONFIG_ATH79_MACH_TL_WR841N_V9=y +CONFIG_ATH79_MACH_TL_WR940N_V4=y +CONFIG_ATH79_MACH_TL_WR941ND=y +CONFIG_ATH79_MACH_TL_WR941ND_V6=y +CONFIG_ATH79_MACH_WHR_HP_G300N=y +CONFIG_ATH79_MACH_WLAE_AG300N=y +CONFIG_ATH79_MACH_WNR2000=y +CONFIG_ATH79_MACH_WNR2000_V3=y +CONFIG_ATH79_MACH_WNR2000_V4=y +CONFIG_ATH79_MACH_WP543=y +CONFIG_ATH79_MACH_WPE72=y +CONFIG_ATH79_NVRAM=y +CONFIG_ATH79_PCI_ATH9K_FIXUP=y +CONFIG_BLK_MQ_PCI=y +CONFIG_HW_HAS_PCI=y +CONFIG_MYLOADER=y +CONFIG_PCI=y +CONFIG_PCI_AR724X=y +CONFIG_PCI_DISABLE_COMMON_QUIRKS=y +CONFIG_PCI_DOMAINS=y +CONFIG_SERIAL_AR933X=y +CONFIG_SERIAL_AR933X_CONSOLE=y +CONFIG_SERIAL_AR933X_NR_UARTS=2 +CONFIG_SOC_AR71XX=y +CONFIG_SOC_AR724X=y +CONFIG_SOC_AR913X=y +CONFIG_SOC_AR933X=y +CONFIG_SOC_AR934X=y +CONFIG_SOC_QCA953X=y +CONFIG_SOC_QCA956X=y diff --git a/target/linux/ar71xx/tiny/profiles/00-default.mk b/target/linux/ar71xx/tiny/profiles/00-default.mk new file mode 100644 index 000000000..d6d76086f --- /dev/null +++ b/target/linux/ar71xx/tiny/profiles/00-default.mk @@ -0,0 +1,11 @@ +define Profile/Default + NAME:=Default Profile (all drivers) + PACKAGES:= \ + kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport + PRIORITY := 1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/ar71xx/tiny/target.mk b/target/linux/ar71xx/tiny/target.mk new file mode 100644 index 000000000..1742eb508 --- /dev/null +++ b/target/linux/ar71xx/tiny/target.mk @@ -0,0 +1,8 @@ +BOARDNAME:=Devices with small flash +FEATURES += squashfs small_flash + +define Target/Description + Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small NOR flash. +endef + + From c00dc5beba46bccaf34629dcc6465a60ea3fb8cb Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 14 Jan 2018 22:30:32 +0800 Subject: [PATCH 89/95] switch feeds to trunk --- feeds.conf.default | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/feeds.conf.default b/feeds.conf.default index 2327d961e..b1df8e257 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,7 +1,7 @@ -src-git packages https://git.lede-project.org/feed/packages.git;lede-17.01 +src-git packages https://git.lede-project.org/feed/packages.git src-git luci https://git.lede-project.org/project/luci.git;lede-17.01 -src-git routing https://git.lede-project.org/feed/routing.git;lede-17.01 -src-git telephony https://git.lede-project.org/feed/telephony.git;lede-17.01 +src-git routing https://git.lede-project.org/feed/routing.git +src-git telephony https://git.lede-project.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git #src-git targets https://github.com/openwrt/targets.git #src-git management https://github.com/openwrt-management/packages.git From 5878dd27de63c7dc3642728dd0ec3bcbdcc701f4 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Sun, 14 Jan 2018 23:12:38 +0800 Subject: [PATCH 90/95] add TL-link 941N v7 4m to tiny target --- .../ar71xx/base-files/etc/board.d/01_leds | 1 + .../ar71xx/base-files/etc/board.d/02_network | 1 + target/linux/ar71xx/base-files/lib/ar71xx.sh | 12 + .../ar71xx/base-files/lib/upgrade/platform.sh | 3 +- .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 ++++++++++++++++++ target/linux/ar71xx/image/tiny-tp-link.mk | 29 ++ 6 files changed, 324 insertions(+), 1 deletion(-) create mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index e5baa90db..0fec36847 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -714,6 +714,7 @@ tl-wa901nd) ;; tl-wa901nd-v2|\ tl-wr941nd|\ +tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index fb61792bf..6dffb54e9 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -442,6 +442,7 @@ ar71xx_setup_interfaces() ;; archer-c7-v4|\ tl-wdr4300|\ + tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index b5440230a..c3059eab2 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,6 +263,9 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; + "204100"*) + model="TP-Link TL-WR2041N" + ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -1145,6 +1148,12 @@ ar71xx_board_detect() { *"TL-WR1043ND v4") name="tl-wr1043nd-v4" ;; + *"TL-WR2041N v1") + name="tl-wr2041n-v1" + ;; + *"TL-WR2041N v2") + name="tl-wr2041n-v2" + ;; *"TL-WR2543N"*) name="tl-wr2543n" ;; @@ -1217,6 +1226,9 @@ ar71xx_board_detect() { *"TL-WR941N/ND v6") name="tl-wr941nd-v6" ;; + *"TL-WR941N v7") + name="tl-wr941n-v7" + ;; *"TL-WR941ND") name="tl-wr941nd" ;; diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index ecf6820a2..1322fb8a9 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -450,7 +450,8 @@ platform_check_image() { tl-wr940n-v4|\ tl-wr941nd|\ tl-wr941nd-v5|\ - tl-wr941nd-v6) + tl-wr941nd-v6|\ + tl-wr941n-v7) local magic_ver="0100" case "$board" in diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c new file mode 100755 index 000000000..8afdb4723 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c @@ -0,0 +1,279 @@ +/* + * TP-LINK TL-WR941N v7 board support + * + * Copyright (C) 2012 Gabor Juhos + * Copyright (C) 2014 Weijie Gao + * + * 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 +#include +#include +#include +#include +#include +#include + +#include + +#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" + +#define WR941NV7_GPIO_LED_WLAN 12 +#define WR941NV7_GPIO_LED_SYSTEM 19 +#define WR941NV7_GPIO_LED_QSS 15 + +#define WR941NV7_GPIO_BTN_RESET 16 + +#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ +#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) + +#define ATH_MII_MGMT_CMD 0x24 +#define ATH_MGMT_CMD_READ 0x1 + +#define ATH_MII_MGMT_ADDRESS 0x28 +#define ATH_ADDR_SHIFT 8 + +#define ATH_MII_MGMT_CTRL 0x2c +#define ATH_MII_MGMT_STATUS 0x30 + +#define ATH_MII_MGMT_IND 0x34 +#define ATH_MGMT_IND_BUSY (1 << 0) +#define ATH_MGMT_IND_INVALID (1 << 2) + +static const char *wr941nv7_part_probes[] = { + "tp-link", + NULL, +}; + +static struct flash_platform_data wr941nv7_flash_data = { + .part_probes = wr941nv7_part_probes, +}; + +static struct gpio_led wr941nv7_leds_gpio[] __initdata = { + { + .name = "tp-link:green:qss", + .gpio = WR941NV7_GPIO_LED_QSS, + .active_low = 1, + }, + { + .name = "tp-link:green:system", + .gpio = WR941NV7_GPIO_LED_SYSTEM, + .active_low = 1, + }, + { + .name = "tp-link:green:wlan", + .gpio = WR941NV7_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, + .gpio = WR941NV7_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct mdio_board_info wr941nv7_mdio0_info[] = { + { + .bus_id = "ag71xx-mdio.0", + .phy_addr = 0, + .platform_data = NULL, + }, +}; + +static unsigned long __init ath_gmac_reg_rd(unsigned long reg) +{ + void __iomem *base; + unsigned long t; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + t = __raw_readl(base + reg); + + iounmap(base); + + return t; +} + +static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) +{ + void __iomem *base; + unsigned long t = value; + + base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); + + __raw_writel(t, base + reg); + + iounmap(base); +} + +static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; + volatile int rddata; + unsigned short ii = 0xFFFF; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); +} + +static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) +{ + unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; + volatile int rddata; + unsigned short ii = 0xffff; + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); + + do + { + udelay(5); + rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; + } while (rddata && --ii); + + val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); + ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); + + return val; +} + +static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) +{ + unsigned int addr_temp; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = (s27_addr) >> 2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + + reg_address = (((addr_temp << 1) & 0x1e) | 0x1); + data = (s27_write_data >> 16) & 0xffff; + phy_reg_write(phy_address, reg_address, data); + + reg_address = ((addr_temp << 1) & 0x1e); + data = s27_write_data & 0xffff; + phy_reg_write(phy_address, reg_address, data); +} + +static unsigned int __init athrs27_reg_read(unsigned int s27_addr) +{ + unsigned int addr_temp; + unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; + unsigned int data; + unsigned char phy_address, reg_address; + + addr_temp = s27_addr >>2; + data = addr_temp >> 7; + + phy_address = 0x1f; + reg_address = 0x10; + + phy_reg_write(phy_address, reg_address, data); + + phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); + reg_address = ((addr_temp << 1) & 0x1e); + s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); + + reg_address = reg_address | 0x1; + s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); + s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; + + return (s27_rd_csr); +} + +static void __init ar8236_reset(void) +{ + unsigned short i = 60; + + athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); + while (i--) + { + mdelay(100); + if (!(athrs27_reg_read(0x0) & 0x80000000)) + break; + } +} + +static void __init wr941nv7_setup(void) +{ + u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); + u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); + + ath79_register_m25p80(&wr941nv7_flash_data); + ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), + wr941nv7_leds_gpio); + ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, + ARRAY_SIZE(wr941nv7_gpio_keys), + wr941nv7_gpio_keys); + + ath79_register_wmac(art, mac); + + ar8236_reset(); + + ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | + QCA955X_ETH_CFG_MII_GE0_SLAVE); + + mdiobus_register_board_info(wr941nv7_mdio0_info, + ARRAY_SIZE(wr941nv7_mdio0_info)); + ath79_register_mdio(0, 0x0); + + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); + + /* GMAC0 is connected to an AR8236 switch */ + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.speed = SPEED_100; + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_mask = BIT(0); + ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; + ath79_register_eth(0); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", + "TP-LINK TL-WR941N v7", + wr941nv7_setup); diff --git a/target/linux/ar71xx/image/tiny-tp-link.mk b/target/linux/ar71xx/image/tiny-tp-link.mk index 092d8aa11..6700ade52 100644 --- a/target/linux/ar71xx/image/tiny-tp-link.mk +++ b/target/linux/ar71xx/image/tiny-tp-link.mk @@ -682,3 +682,32 @@ define Device/tl-wr941nd-v6-cn TPLINK_HWID := 0x09410006 endef TARGET_DEVICES += tl-wr941nd-v6-cn + +define Device/tl-wr941n-v7 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR941N/ND v7 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR941 + TPLINK_HWID := 0x09410007 +endef +TARGET_DEVICES += tl-wr941n-v7 + +define Device/tl-wr2041n-v1 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR2041N v1 + BOARDNAME := TL-WDR3500 + DEVICE_PROFILE := TLWR2041 + TPLINK_HWID := 0x20410001 +endef +TARGET_DEVICES += tl-wr2041n-v1 + +define Device/tl-wr2041n-v2 + $(Device/tplink-4mlzma) + DEVICE_TITLE := TP-LINK TL-WR2041N v2 + BOARDNAME := TL-WR941N-v7 + DEVICE_PROFILE := TLWR2041 + TPLINK_HWID := 0x20410002 +endef +TARGET_DEVICES += tl-wr2041n-v2 + + From 09e34de60ab11f92ff66d32baa220f7eb4f9f694 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Jan 2018 01:05:20 +0800 Subject: [PATCH 91/95] disable flock --- package/system/procd/files/procd.sh | 9 --------- package/utils/busybox/Config-defaults.in | 2 +- package/utils/busybox/Makefile | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index b4b6faa66..5093a911e 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -41,15 +41,6 @@ _PROCD_SERVICE= procd_lock() { local basescript=$(readlink "$initscript") local service_name="$(basename ${basescript:-$initscript})" - - flock -n 1000 &> /dev/null - if [ "$?" != "0" ]; then - exec 1000>/var/lock/procd_${service_name}.lock - flock 1000 - if [ "$?" != "0" ]; then - logger "warning: procd flock for $service_name failed" - fi - fi } _procd_call() { diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 06833c396..1977e7ff4 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -1497,7 +1497,7 @@ config BUSYBOX_DEFAULT_FINDFS default n config BUSYBOX_DEFAULT_FLOCK bool - default y + default n config BUSYBOX_DEFAULT_FREERAMDISK bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 0be413ad1..0d3708636 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.25.1 -PKG_RELEASE:=5 +PKG_RELEASE:=4 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 From 91217e113574dfc7746ac3e517a26183d875a924 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Jan 2018 11:50:55 +0800 Subject: [PATCH 92/95] add adbyby ram for 4M tiny rom --- 4m.config | 5378 +++++++++++++++++ config/Config-images.in | 2 +- include/target.mk | 6 +- package/lean/adbyby-ram/Makefile | 105 + package/lean/adbyby-ram/files/adbyby.config | 3 + package/lean/adbyby-ram/files/adbyby.init | 58 + .../lean/adbyby-ram/files/adbyby_ar71xx.sh | 49 + .../lean/adbyby-ram/files/adbyby_ramips.sh | 48 + .../files/luci/controller/adbyby.lua | 10 + .../files/luci/i18n/adbyby.zh-cn.po | 38 + .../files/luci/model/cbi/adbyby.lua | 72 + 11 files changed, 5763 insertions(+), 6 deletions(-) create mode 100644 4m.config create mode 100644 package/lean/adbyby-ram/Makefile create mode 100644 package/lean/adbyby-ram/files/adbyby.config create mode 100644 package/lean/adbyby-ram/files/adbyby.init create mode 100644 package/lean/adbyby-ram/files/adbyby_ar71xx.sh create mode 100644 package/lean/adbyby-ram/files/adbyby_ramips.sh create mode 100644 package/lean/adbyby-ram/files/luci/controller/adbyby.lua create mode 100644 package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po create mode 100644 package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua diff --git a/4m.config b/4m.config new file mode 100644 index 000000000..8ef31bc66 --- /dev/null +++ b/4m.config @@ -0,0 +1,5378 @@ +# +# Automatically generated file; DO NOT EDIT. +# OpenWrt Configuration +# +CONFIG_MODULES=y +CONFIG_HAVE_DOT_CONFIG=y +# CONFIG_TARGET_sunxi is not set +# CONFIG_TARGET_apm821xx is not set +# CONFIG_TARGET_ath25 is not set +CONFIG_TARGET_ar71xx=y +# CONFIG_TARGET_brcm2708 is not set +# CONFIG_TARGET_bcm53xx is not set +# CONFIG_TARGET_brcm47xx is not set +# CONFIG_TARGET_brcm63xx is not set +# CONFIG_TARGET_cns3xxx is not set +# CONFIG_TARGET_octeon is not set +# CONFIG_TARGET_gemini is not set +# CONFIG_TARGET_mpc85xx is not set +# CONFIG_TARGET_imx6 is not set +# CONFIG_TARGET_mxs is not set +# CONFIG_TARGET_adm8668 is not set +# CONFIG_TARGET_adm5120 is not set +# CONFIG_TARGET_xburst is not set +# CONFIG_TARGET_ixp4xx is not set +# CONFIG_TARGET_lantiq is not set +# CONFIG_TARGET_malta is not set +# CONFIG_TARGET_pistachio is not set +# CONFIG_TARGET_mvebu is not set +# CONFIG_TARGET_kirkwood is not set +# CONFIG_TARGET_mediatek is not set +# CONFIG_TARGET_ramips is not set +# CONFIG_TARGET_at91 is not set +# CONFIG_TARGET_rb532 is not set +# CONFIG_TARGET_mcs814x is not set +# CONFIG_TARGET_layerscape is not set +# CONFIG_TARGET_oxnas is not set +# CONFIG_TARGET_armvirt is not set +# CONFIG_TARGET_ipq806x is not set +# CONFIG_TARGET_au1000 is not set +# CONFIG_TARGET_arc770 is not set +# CONFIG_TARGET_archs38 is not set +# CONFIG_TARGET_ar7 is not set +# CONFIG_TARGET_omap is not set +# CONFIG_TARGET_uml is not set +# CONFIG_TARGET_zynq is not set +# CONFIG_TARGET_x86 is not set +# CONFIG_TARGET_ar71xx_generic is not set +CONFIG_TARGET_ar71xx_tiny=y +# CONFIG_TARGET_ar71xx_nand is not set +# CONFIG_TARGET_ar71xx_mikrotik is not set +# CONFIG_TARGET_MULTI_PROFILE is not set +# CONFIG_TARGET_ar71xx_tiny_Default is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_A02RBW300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRG301N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRHPG300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WHRHPGN is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WLAEAG300N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WP543_4M is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WPE72_4M is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR600A1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR601A1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR601B1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615C1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615E1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615E4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615I1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_DIR615I3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_EBR2310C1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_FR54RTR is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_REALWNR1000V2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR1000V2_VC is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000V3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WNR2000V4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_REALWNR612V2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_WPN824N is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_N150R is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_rnx-n360rt is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr10u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr11u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr11u-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr12u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr13u-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3020-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3040-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3040-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3220-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3220-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3420-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-mr3420-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa701nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa701nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa7210n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa730re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa750re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa7510n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa801nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa830re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa830re-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa850re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa850re-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa855re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa860re-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wa901nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wdr3320-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr1041n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr2041n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr2041n-v2 is not set +CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr703n-v1=y +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr710n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr720n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr720n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr740n-v6 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr741nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr743nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr743nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr802n-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr802n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr840n-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr840n-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v1.5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v10 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v11 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v12 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v7 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v8 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr841-v9 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr843nd-v1 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr847n-v8 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr940n-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v2 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v3 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v4 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v5 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v6 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941nd-v6-cn is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_tl-wr941n-v7 is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW632BRP is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW652BRP_FW is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW652BRP_RECOVERY is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_TEW712BR is not set +# CONFIG_TARGET_ar71xx_tiny_DEVICE_NBG_460N_550N_550NH is not set +CONFIG_HAS_SUBTARGETS=y +CONFIG_HAS_DEVICES=y +CONFIG_TARGET_BOARD="ar71xx" +CONFIG_TARGET_SUBTARGET="tiny" +CONFIG_TARGET_PROFILE="DEVICE_tl-wr703n-v1" +CONFIG_TARGET_ARCH_PACKAGES="mips_24kc" +CONFIG_DEFAULT_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc" +CONFIG_CPU_TYPE="24kc" +CONFIG_LINUX_4_4=y +CONFIG_DEFAULT_base-files=y +CONFIG_DEFAULT_busybox=y +CONFIG_DEFAULT_dnsmasq-full=y +CONFIG_DEFAULT_dropbear=y +CONFIG_DEFAULT_firewall=y +CONFIG_DEFAULT_fstools=y +CONFIG_DEFAULT_ip6tables=y +CONFIG_DEFAULT_iptables=y +CONFIG_DEFAULT_iwinfo=y +CONFIG_DEFAULT_kmod-ath9k=y +CONFIG_DEFAULT_kmod-gpio-button-hotplug=y +CONFIG_DEFAULT_kmod-usb-core=y +CONFIG_DEFAULT_kmod-usb2=y +CONFIG_DEFAULT_libc=y +CONFIG_DEFAULT_libgcc=y +CONFIG_DEFAULT_logd=y +CONFIG_DEFAULT_mtd=y +CONFIG_DEFAULT_netifd=y +CONFIG_DEFAULT_opkg=y +CONFIG_DEFAULT_ppp=y +CONFIG_DEFAULT_ppp-mod-pppoe=y +CONFIG_DEFAULT_swconfig=y +CONFIG_DEFAULT_uboot-envtools=y +CONFIG_DEFAULT_uci=y +CONFIG_DEFAULT_uclient-fetch=y +CONFIG_DEFAULT_wpad-mini=y +CONFIG_AUDIO_SUPPORT=y +CONFIG_GPIO_SUPPORT=y +CONFIG_PCI_SUPPORT=y +CONFIG_USB_SUPPORT=y +CONFIG_USB_GADGET_SUPPORT=y +CONFIG_BIG_ENDIAN=y +CONFIG_USES_DEVICETREE=y +CONFIG_USES_SQUASHFS=y +CONFIG_SMALL_FLASH=y +CONFIG_HAS_MIPS16=y +CONFIG_mips=y +CONFIG_ARCH="mips" + +# +# Target Images +# +# CONFIG_TARGET_ROOTFS_INITRAMFS is not set +CONFIG_EXTERNAL_CPIO="" + +# +# Root filesystem archives +# +# CONFIG_TARGET_ROOTFS_CPIOGZ is not set +# CONFIG_TARGET_ROOTFS_TARGZ is not set + +# +# Root filesystem images +# +# CONFIG_TARGET_ROOTFS_EXT4FS is not set +CONFIG_TARGET_ROOTFS_SQUASHFS=y +CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=256 +CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP=y +CONFIG_TARGET_UBIFS_JOURNAL_SIZE="" + +# +# Image Options +# + +# +# Global build settings +# +# CONFIG_ALL_NONSHARED is not set +# CONFIG_ALL_KMODS is not set +# CONFIG_ALL is not set +# CONFIG_BUILDBOT is not set +CONFIG_SIGNED_PACKAGES=y + +# +# General build options +# +# CONFIG_DISPLAY_SUPPORT is not set +CONFIG_BUILD_PATENTED=y +# CONFIG_BUILD_NLS is not set +CONFIG_SHADOW_PASSWORDS=y +# CONFIG_CLEAN_IPKG is not set +# CONFIG_INCLUDE_CONFIG is not set +# CONFIG_COLLECT_KERNEL_DEBUG is not set + +# +# Kernel build options +# +CONFIG_KERNEL_BUILD_USER="" +CONFIG_KERNEL_BUILD_DOMAIN="" +CONFIG_KERNEL_PRINTK=y +CONFIG_KERNEL_CRASHLOG=y +CONFIG_KERNEL_SWAP=y +CONFIG_KERNEL_DEBUG_FS=y +# CONFIG_KERNEL_PERF_EVENTS is not set +# CONFIG_KERNEL_PROFILING is not set +# CONFIG_KERNEL_KALLSYMS is not set +# CONFIG_KERNEL_FTRACE is not set +CONFIG_KERNEL_DEBUG_KERNEL=y +CONFIG_KERNEL_DEBUG_INFO=y +# CONFIG_KERNEL_DYNAMIC_DEBUG is not set +# CONFIG_KERNEL_KPROBES is not set +# CONFIG_KERNEL_AIO is not set +# CONFIG_KERNEL_FHANDLE is not set +# CONFIG_KERNEL_FANOTIFY is not set +# CONFIG_KERNEL_BLK_DEV_BSG is not set +CONFIG_KERNEL_MAGIC_SYSRQ=y +# CONFIG_KERNEL_DEBUG_PINCTRL is not set +# CONFIG_KERNEL_DEBUG_GPIO is not set +CONFIG_KERNEL_COREDUMP=y +CONFIG_KERNEL_ELF_CORE=y +# CONFIG_KERNEL_PROVE_LOCKING is not set +CONFIG_KERNEL_PRINTK_TIME=y +# CONFIG_KERNEL_SLABINFO is not set +# CONFIG_KERNEL_PROC_PAGE_MONITOR is not set +CONFIG_KERNEL_RELAY=y +# CONFIG_KERNEL_KEXEC is not set +# CONFIG_USE_RFKILL is not set +# CONFIG_USE_SPARSE is not set +# CONFIG_KERNEL_DEVTMPFS is not set +# CONFIG_KERNEL_KEYS is not set +# CONFIG_KERNEL_CGROUPS is not set +# CONFIG_KERNEL_NAMESPACES is not set +# CONFIG_KERNEL_LXC_MISC is not set +# CONFIG_KERNEL_SECCOMP_FILTER is not set +# CONFIG_KERNEL_SECCOMP is not set +CONFIG_KERNEL_IPV6=y +CONFIG_KERNEL_IPV6_MULTIPLE_TABLES=y +CONFIG_KERNEL_IPV6_SUBTREES=y +CONFIG_KERNEL_IPV6_MROUTE=y +# CONFIG_KERNEL_IPV6_PIMSM_V2 is not set +# CONFIG_KERNEL_IP_PNP is not set + +# +# Filesystem ACL and attr support options +# +# CONFIG_USE_FS_ACL_ATTR is not set +# CONFIG_KERNEL_FS_POSIX_ACL is not set +# CONFIG_KERNEL_BTRFS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_EXT4_FS_POSIX_ACL is not set +# CONFIG_KERNEL_F2FS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_JFFS2_FS_POSIX_ACL is not set +# CONFIG_KERNEL_TMPFS_POSIX_ACL is not set +# CONFIG_KERNEL_CIFS_ACL is not set +# CONFIG_KERNEL_HFS_FS_POSIX_ACL is not set +# CONFIG_KERNEL_HFSPLUG_FS_POSIX_ACL is not set +# CONFIG_KERNEL_NFS_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFS_V3_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFSD_V2_ACL_SUPPORT is not set +# CONFIG_KERNEL_NFSD_V3_ACL_SUPPORT is not set +# CONFIG_KERNEL_REISER_FS_POSIX_ACL is not set +# CONFIG_KERNEL_XFS_POSIX_ACL is not set +# CONFIG_KERNEL_JFS_POSIX_ACL is not set +# CONFIG_KERNEL_DEVMEM is not set +# CONFIG_KERNEL_DEVKMEM is not set + +# +# Package build options +# +# CONFIG_DEBUG is not set +CONFIG_IPV6=y + +# +# Stripping options +# +# CONFIG_NO_STRIP is not set +# CONFIG_USE_STRIP is not set +CONFIG_USE_SSTRIP=y +# CONFIG_STRIP_KERNEL_EXPORTS is not set +# CONFIG_USE_MKLIBS is not set +CONFIG_USE_UCLIBCXX=y +# CONFIG_USE_LIBSTDCXX is not set + +# +# Hardening build options +# +CONFIG_PKG_CHECK_FORMAT_SECURITY=y +# CONFIG_PKG_CC_STACKPROTECTOR_NONE is not set +CONFIG_PKG_CC_STACKPROTECTOR_REGULAR=y +# CONFIG_KERNEL_CC_STACKPROTECTOR_NONE is not set +CONFIG_KERNEL_CC_STACKPROTECTOR_REGULAR=y +# CONFIG_KERNEL_CC_STACKPROTECTOR_STRONG is not set +# CONFIG_PKG_FORTIFY_SOURCE_NONE is not set +CONFIG_PKG_FORTIFY_SOURCE_1=y +# CONFIG_PKG_FORTIFY_SOURCE_2 is not set +# CONFIG_PKG_RELRO_NONE is not set +# CONFIG_PKG_RELRO_PARTIAL is not set +CONFIG_PKG_RELRO_FULL=y +# CONFIG_DEVEL is not set +# CONFIG_BROKEN is not set +CONFIG_BINARY_FOLDER="" +CONFIG_DOWNLOAD_FOLDER="" +CONFIG_LOCALMIRROR="" +CONFIG_AUTOREBUILD=y +# CONFIG_AUTOREMOVE is not set +CONFIG_BUILD_SUFFIX="" +CONFIG_TARGET_ROOTFS_DIR="" +# CONFIG_CCACHE is not set +CONFIG_EXTERNAL_KERNEL_TREE="" +CONFIG_KERNEL_GIT_CLONE_URI="" +CONFIG_EXTRA_OPTIMIZATION="-fno-caller-saves -fno-plt" +CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc" +CONFIG_SOFT_FLOAT=y +CONFIG_USE_MIPS16=y +# CONFIG_EXTRA_TARGET_ARCH is not set +CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS="" +CONFIG_EXTRA_GCC_CONFIG_OPTIONS="" +# CONFIG_SJLJ_EXCEPTIONS is not set +# CONFIG_INSTALL_GFORTRAN is not set +CONFIG_GDB=y +CONFIG_USE_MUSL=y +CONFIG_BINUTILS_VERSION_2_28=y +CONFIG_BINUTILS_VERSION="2.28" +CONFIG_GCC_VERSION="5.5.0" +CONFIG_LIBC="musl" +CONFIG_TARGET_SUFFIX="musl" +# CONFIG_IB is not set +# CONFIG_SDK is not set +# CONFIG_MAKE_TOOLCHAIN is not set +# CONFIG_IMAGEOPT is not set +# CONFIG_PREINITOPT is not set +CONFIG_TARGET_PREINIT_SUPPRESS_STDERR=y +# CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE is not set +CONFIG_TARGET_PREINIT_TIMEOUT=2 +# CONFIG_TARGET_PREINIT_SHOW_NETMSG is not set +# CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG is not set +CONFIG_TARGET_PREINIT_IFNAME="" +CONFIG_TARGET_PREINIT_IP="192.168.1.1" +CONFIG_TARGET_PREINIT_NETMASK="255.255.255.0" +CONFIG_TARGET_PREINIT_BROADCAST="192.168.1.255" +# CONFIG_INITOPT is not set +CONFIG_TARGET_INIT_PATH="/usr/sbin:/usr/bin:/sbin:/bin" +CONFIG_TARGET_INIT_ENV="" +CONFIG_TARGET_INIT_CMD="/sbin/init" +CONFIG_TARGET_INIT_SUPPRESS_STDERR=y +# CONFIG_VERSIONOPT is not set +CONFIG_PER_FEED_REPO=y +CONFIG_PER_FEED_REPO_ADD_DISABLED=y +CONFIG_PER_FEED_REPO_ADD_COMMENTED=y +CONFIG_FEED_packages=y +CONFIG_FEED_luci=y +CONFIG_FEED_routing=y +CONFIG_FEED_telephony=y + +# +# Base system +# +# CONFIG_PACKAGE_attendedsysupgrade-common is not set +# CONFIG_PACKAGE_auc is not set +CONFIG_PACKAGE_base-files=y +# CONFIG_PACKAGE_block-mount is not set +# CONFIG_PACKAGE_bridge is not set +CONFIG_PACKAGE_busybox=y +CONFIG_BUSYBOX_CUSTOM=y +CONFIG_BUSYBOX_DEFAULT_HAVE_DOT_CONFIG=y +# CONFIG_BUSYBOX_DEFAULT_DESKTOP is not set +# CONFIG_BUSYBOX_DEFAULT_EXTRA_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_INCLUDE_SUSv2=y +# CONFIG_BUSYBOX_DEFAULT_USE_PORTABLE_CODE is not set +CONFIG_BUSYBOX_DEFAULT_PLATFORM_LINUX=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_BUSYBOX_DEFAULT_SHOW_USAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE_USAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_COMPRESS_USAGE=y +# CONFIG_BUSYBOX_DEFAULT_BUSYBOX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSTALLER is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_NO_USR is not set +# CONFIG_BUSYBOX_DEFAULT_LOCALE_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_USING_LOCALE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV is not set +CONFIG_BUSYBOX_DEFAULT_SUBST_WCHAR=0 +CONFIG_BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR=0 +# CONFIG_BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE is not set +# CONFIG_BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN is not set +# CONFIG_BUSYBOX_DEFAULT_PAM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE is not set +CONFIG_BUSYBOX_DEFAULT_LONG_OPTS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DEVPTS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CLEAN_UP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UTMP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WTMP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDFILE=y +CONFIG_BUSYBOX_DEFAULT_PID_FILE_PATH="/var/run" +CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID_CONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUID_CONFIG_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_SELINUX is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PREFER_APPLETS=y +CONFIG_BUSYBOX_DEFAULT_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOG=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HAVE_RPC is not set +# CONFIG_BUSYBOX_DEFAULT_STATIC is not set +# CONFIG_BUSYBOX_DEFAULT_PIE is not set +# CONFIG_BUSYBOX_DEFAULT_NOMMU is not set +# CONFIG_BUSYBOX_DEFAULT_BUILD_LIBBUSYBOX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INDIVIDUAL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SHARED_BUSYBOX is not set +CONFIG_BUSYBOX_DEFAULT_LFS=y +CONFIG_BUSYBOX_DEFAULT_CROSS_COMPILER_PREFIX="" +CONFIG_BUSYBOX_DEFAULT_SYSROOT="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_CFLAGS="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_LDFLAGS="" +CONFIG_BUSYBOX_DEFAULT_EXTRA_LDLIBS="" +# CONFIG_BUSYBOX_DEFAULT_DEBUG is not set +# CONFIG_BUSYBOX_DEFAULT_DEBUG_PESSIMIZE is not set +# CONFIG_BUSYBOX_DEFAULT_DEBUG_SANITIZE is not set +# CONFIG_BUSYBOX_DEFAULT_UNIT_TEST is not set +# CONFIG_BUSYBOX_DEFAULT_WERROR is not set +CONFIG_BUSYBOX_DEFAULT_NO_DEBUG_LIB=y +# CONFIG_BUSYBOX_DEFAULT_DMALLOC is not set +# CONFIG_BUSYBOX_DEFAULT_EFENCE is not set +CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS=y +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_APPLET_DONT is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SYMLINK is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_HARDLINK is not set +# CONFIG_BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set +CONFIG_BUSYBOX_DEFAULT_PREFIX="./_install" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RTMINMAX is not set +CONFIG_BUSYBOX_DEFAULT_PASSWORD_MINLEN=6 +CONFIG_BUSYBOX_DEFAULT_MD5_SMALL=1 +CONFIG_BUSYBOX_DEFAULT_SHA3_SMALL=1 +CONFIG_BUSYBOX_DEFAULT_FEATURE_FAST_TOP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_MAX_LEN=512 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_VI is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY=256 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAB_COMPLETION=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USERNAME_COMPLETION is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB=4 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SKIP_ROOTFS is not set +# CONFIG_BUSYBOX_DEFAULT_MONOTONIC_SYSCALL is not set +CONFIG_BUSYBOX_DEFAULT_IOCTL_HEX2STR_ERROR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWIB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_BZ2 is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_GZ=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z is not set +# CONFIG_BUSYBOX_DEFAULT_AR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AR_LONG_FILENAMES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AR_CREATE is not set +# CONFIG_BUSYBOX_DEFAULT_UNCOMPRESS is not set +CONFIG_BUSYBOX_DEFAULT_GUNZIP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_BUNZIP2=y +# CONFIG_BUSYBOX_DEFAULT_UNLZMA is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LZMA_FAST is not set +# CONFIG_BUSYBOX_DEFAULT_LZMA is not set +# CONFIG_BUSYBOX_DEFAULT_UNXZ is not set +# CONFIG_BUSYBOX_DEFAULT_XZ is not set +# CONFIG_BUSYBOX_DEFAULT_BZIP2 is not set +# CONFIG_BUSYBOX_DEFAULT_CPIO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CPIO_O is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CPIO_P is not set +# CONFIG_BUSYBOX_DEFAULT_DPKG is not set +# CONFIG_BUSYBOX_DEFAULT_DPKG_DEB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set +CONFIG_BUSYBOX_DEFAULT_GZIP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_GZIP_FAST=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS is not set +# CONFIG_BUSYBOX_DEFAULT_LZOP is not set +# CONFIG_BUSYBOX_DEFAULT_LZOP_COMPR_HIGH is not set +# CONFIG_BUSYBOX_DEFAULT_RPM is not set +# CONFIG_BUSYBOX_DEFAULT_RPM2CPIO is not set +CONFIG_BUSYBOX_DEFAULT_TAR=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_CREATE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_AUTODETECT is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_FROM=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_TO_COMMAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX is not set +# CONFIG_BUSYBOX_DEFAULT_UNZIP is not set +CONFIG_BUSYBOX_DEFAULT_BASENAME=y +CONFIG_BUSYBOX_DEFAULT_CAT=y +CONFIG_BUSYBOX_DEFAULT_DATE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_NANO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_DD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DD_STATUS is not set +# CONFIG_BUSYBOX_DEFAULT_HOSTID is not set +CONFIG_BUSYBOX_DEFAULT_ID=y +# CONFIG_BUSYBOX_DEFAULT_GROUPS is not set +# CONFIG_BUSYBOX_DEFAULT_SHUF is not set +# CONFIG_BUSYBOX_DEFAULT_STAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM is not set +CONFIG_BUSYBOX_DEFAULT_SYNC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_TEST=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TEST_64=y +CONFIG_BUSYBOX_DEFAULT_TOUCH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3=y +CONFIG_BUSYBOX_DEFAULT_TR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TR_CLASSES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TR_EQUIV is not set +# CONFIG_BUSYBOX_DEFAULT_TRUNCATE is not set +# CONFIG_BUSYBOX_DEFAULT_UNLINK is not set +# CONFIG_BUSYBOX_DEFAULT_BASE64 is not set +# CONFIG_BUSYBOX_DEFAULT_WHO is not set +# CONFIG_BUSYBOX_DEFAULT_USERS is not set +# CONFIG_BUSYBOX_DEFAULT_CAL is not set +# CONFIG_BUSYBOX_DEFAULT_CATV is not set +CONFIG_BUSYBOX_DEFAULT_CHGRP=y +CONFIG_BUSYBOX_DEFAULT_CHMOD=y +CONFIG_BUSYBOX_DEFAULT_CHOWN=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_CHROOT=y +# CONFIG_BUSYBOX_DEFAULT_CKSUM is not set +# CONFIG_BUSYBOX_DEFAULT_COMM is not set +CONFIG_BUSYBOX_DEFAULT_CP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_CUT=y +CONFIG_BUSYBOX_DEFAULT_DF=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DF_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_DIRNAME=y +# CONFIG_BUSYBOX_DEFAULT_DOS2UNIX is not set +# CONFIG_BUSYBOX_DEFAULT_UNIX2DOS is not set +CONFIG_BUSYBOX_DEFAULT_DU=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_BUSYBOX_DEFAULT_ECHO=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO=y +CONFIG_BUSYBOX_DEFAULT_ENV=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_EXPAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_EXPR=y +CONFIG_BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64=y +CONFIG_BUSYBOX_DEFAULT_FALSE=y +# CONFIG_BUSYBOX_DEFAULT_FOLD is not set +CONFIG_BUSYBOX_DEFAULT_FSYNC=y +CONFIG_BUSYBOX_DEFAULT_HEAD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD=y +# CONFIG_BUSYBOX_DEFAULT_INSTALL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_LN=y +# CONFIG_BUSYBOX_DEFAULT_LOGNAME is not set +CONFIG_BUSYBOX_DEFAULT_LS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_USERNAME=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_COLOR=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_BUSYBOX_DEFAULT_MD5SUM=y +CONFIG_BUSYBOX_DEFAULT_MKDIR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_MKFIFO=y +CONFIG_BUSYBOX_DEFAULT_MKNOD=y +CONFIG_BUSYBOX_DEFAULT_MV=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_NICE=y +# CONFIG_BUSYBOX_DEFAULT_NOHUP is not set +# CONFIG_BUSYBOX_DEFAULT_OD is not set +# CONFIG_BUSYBOX_DEFAULT_PRINTENV is not set +CONFIG_BUSYBOX_DEFAULT_PRINTF=y +CONFIG_BUSYBOX_DEFAULT_PWD=y +CONFIG_BUSYBOX_DEFAULT_READLINK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW=y +# CONFIG_BUSYBOX_DEFAULT_REALPATH is not set +CONFIG_BUSYBOX_DEFAULT_RM=y +CONFIG_BUSYBOX_DEFAULT_RMDIR=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_SEQ=y +# CONFIG_BUSYBOX_DEFAULT_SHA1SUM is not set +CONFIG_BUSYBOX_DEFAULT_SHA256SUM=y +# CONFIG_BUSYBOX_DEFAULT_SHA512SUM is not set +# CONFIG_BUSYBOX_DEFAULT_SHA3SUM is not set +CONFIG_BUSYBOX_DEFAULT_SLEEP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP is not set +CONFIG_BUSYBOX_DEFAULT_SORT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SORT_BIG is not set +# CONFIG_BUSYBOX_DEFAULT_SPLIT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_STTY is not set +# CONFIG_BUSYBOX_DEFAULT_SUM is not set +# CONFIG_BUSYBOX_DEFAULT_TAC is not set +CONFIG_BUSYBOX_DEFAULT_TAIL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL=y +CONFIG_BUSYBOX_DEFAULT_TEE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_BUSYBOX_DEFAULT_TRUE=y +# CONFIG_BUSYBOX_DEFAULT_TTY is not set +CONFIG_BUSYBOX_DEFAULT_UNAME=y +CONFIG_BUSYBOX_DEFAULT_UNAME_OSNAME="GNU/Linux" +# CONFIG_BUSYBOX_DEFAULT_UNEXPAND is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_UNIQ=y +# CONFIG_BUSYBOX_DEFAULT_USLEEP is not set +# CONFIG_BUSYBOX_DEFAULT_UUDECODE is not set +# CONFIG_BUSYBOX_DEFAULT_UUENCODE is not set +CONFIG_BUSYBOX_DEFAULT_WC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WC_LARGE is not set +# CONFIG_BUSYBOX_DEFAULT_WHOAMI is not set +CONFIG_BUSYBOX_DEFAULT_YES=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VERBOSE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK=y +# CONFIG_BUSYBOX_DEFAULT_CHVT is not set +# CONFIG_BUSYBOX_DEFAULT_FGCONSOLE is not set +CONFIG_BUSYBOX_DEFAULT_CLEAR=y +# CONFIG_BUSYBOX_DEFAULT_DEALLOCVT is not set +# CONFIG_BUSYBOX_DEFAULT_DUMPKMAP is not set +# CONFIG_BUSYBOX_DEFAULT_KBD_MODE is not set +# CONFIG_BUSYBOX_DEFAULT_LOADFONT is not set +# CONFIG_BUSYBOX_DEFAULT_LOADKMAP is not set +# CONFIG_BUSYBOX_DEFAULT_OPENVT is not set +CONFIG_BUSYBOX_DEFAULT_RESET=y +# CONFIG_BUSYBOX_DEFAULT_RESIZE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT is not set +# CONFIG_BUSYBOX_DEFAULT_SETCONSOLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_SETFONT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP is not set +CONFIG_BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR="" +# CONFIG_BUSYBOX_DEFAULT_SETKEYCODES is not set +# CONFIG_BUSYBOX_DEFAULT_SETLOGCONS is not set +# CONFIG_BUSYBOX_DEFAULT_SHOWKEY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW is not set +CONFIG_BUSYBOX_DEFAULT_MKTEMP=y +# CONFIG_BUSYBOX_DEFAULT_PIPE_PROGRESS is not set +# CONFIG_BUSYBOX_DEFAULT_RUN_PARTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_FANCY is not set +CONFIG_BUSYBOX_DEFAULT_START_STOP_DAEMON=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_WHICH=y +CONFIG_BUSYBOX_DEFAULT_AWK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AWK_LIBM=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_BUSYBOX_DEFAULT_CMP=y +# CONFIG_BUSYBOX_DEFAULT_DIFF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DIFF_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DIFF_DIR is not set +# CONFIG_BUSYBOX_DEFAULT_ED is not set +# CONFIG_BUSYBOX_DEFAULT_PATCH is not set +CONFIG_BUSYBOX_DEFAULT_SED=y +CONFIG_BUSYBOX_DEFAULT_VI=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_MAX_LEN=1024 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_8BIT is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_COLON=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_YANKMARK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SEARCH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_USE_SIGNALS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_DOT_CMD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_READONLY=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SETOPTS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_SET=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_WIN_RESIZE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_ASK_TERMINAL=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE_MAX=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_ALLOW_EXEC=y +CONFIG_BUSYBOX_DEFAULT_FIND=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PRINT0=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MTIME=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MMIN is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PERM=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_TYPE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_XDEV=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_NEWER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_INUM is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_EXEC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_EXEC_PLUS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_USER=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_GROUP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_NOT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_DEPTH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PAREN=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_SIZE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PRUNE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_DELETE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_PATH=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_REGEX=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_CONTEXT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FIND_LINKS is not set +CONFIG_BUSYBOX_DEFAULT_GREP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT=y +CONFIG_BUSYBOX_DEFAULT_XARGS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_XARGS_SUPPORT_REPL_STR is not set +# CONFIG_BUSYBOX_DEFAULT_BOOTCHARTD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_CONFIG_FILE is not set +CONFIG_BUSYBOX_DEFAULT_HALT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT is not set +CONFIG_BUSYBOX_DEFAULT_TELINIT_PATH="" +# CONFIG_BUSYBOX_DEFAULT_INIT is not set +# CONFIG_BUSYBOX_DEFAULT_LINUXRC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_USE_INITTAB is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KILL_REMOVED is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_KILL_DELAY=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS is not set +CONFIG_BUSYBOX_DEFAULT_INIT_TERMINAL_TYPE="" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE is not set +# CONFIG_BUSYBOX_DEFAULT_MESG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS=y +# CONFIG_BUSYBOX_DEFAULT_USE_BB_PWD_GRP is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_SHADOW is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_CRYPT is not set +# CONFIG_BUSYBOX_DEFAULT_USE_BB_CRYPT_SHA is not set +# CONFIG_BUSYBOX_DEFAULT_ADD_SHELL is not set +# CONFIG_BUSYBOX_DEFAULT_REMOVE_SHELL is not set +# CONFIG_BUSYBOX_DEFAULT_ADDGROUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP is not set +# CONFIG_BUSYBOX_DEFAULT_ADDUSER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ADDUSER_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_NAMES is not set +CONFIG_BUSYBOX_DEFAULT_LAST_ID=0 +CONFIG_BUSYBOX_DEFAULT_FIRST_SYSTEM_ID=0 +CONFIG_BUSYBOX_DEFAULT_LAST_SYSTEM_ID=0 +# CONFIG_BUSYBOX_DEFAULT_CHPASSWD is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO="md5" +# CONFIG_BUSYBOX_DEFAULT_CRYPTPW is not set +# CONFIG_BUSYBOX_DEFAULT_MKPASSWD is not set +# CONFIG_BUSYBOX_DEFAULT_DELUSER is not set +# CONFIG_BUSYBOX_DEFAULT_DELGROUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DEL_USER_FROM_GROUP is not set +# CONFIG_BUSYBOX_DEFAULT_GETTY is not set +CONFIG_BUSYBOX_DEFAULT_LOGIN=y +CONFIG_BUSYBOX_DEFAULT_LOGIN_SESSION_AS_CHILD=y +# CONFIG_BUSYBOX_DEFAULT_LOGIN_SCRIPTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NOLOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SECURETTY is not set +CONFIG_BUSYBOX_DEFAULT_PASSWD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_PASSWD_WEAK_CHECK=y +# CONFIG_BUSYBOX_DEFAULT_SU is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS is not set +# CONFIG_BUSYBOX_DEFAULT_SULOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_VLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_CHATTR is not set +# CONFIG_BUSYBOX_DEFAULT_FSCK is not set +# CONFIG_BUSYBOX_DEFAULT_LSATTR is not set +# CONFIG_BUSYBOX_DEFAULT_TUNE2FS is not set +# CONFIG_BUSYBOX_DEFAULT_MODINFO is not set +# CONFIG_BUSYBOX_DEFAULT_MODPROBE_SMALL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED is not set +# CONFIG_BUSYBOX_DEFAULT_INSMOD is not set +# CONFIG_BUSYBOX_DEFAULT_RMMOD is not set +# CONFIG_BUSYBOX_DEFAULT_LSMOD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set +# CONFIG_BUSYBOX_DEFAULT_MODPROBE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST is not set +# CONFIG_BUSYBOX_DEFAULT_DEPMOD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_2_4_MODULES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MODUTILS_SYMBOLS is not set +CONFIG_BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR="" +CONFIG_BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE="" +# CONFIG_BUSYBOX_DEFAULT_BLKDISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_BLOCKDEV is not set +# CONFIG_BUSYBOX_DEFAULT_FATATTR is not set +# CONFIG_BUSYBOX_DEFAULT_FSTRIM is not set +# CONFIG_BUSYBOX_DEFAULT_MDEV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_CONF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE is not set +CONFIG_BUSYBOX_DEFAULT_MOUNT=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_BUSYBOX_DEFAULT_NSENTER is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS is not set +# CONFIG_BUSYBOX_DEFAULT_REV is not set +# CONFIG_BUSYBOX_DEFAULT_SETARCH is not set +# CONFIG_BUSYBOX_DEFAULT_UEVENT is not set +# CONFIG_BUSYBOX_DEFAULT_UNSHARE is not set +# CONFIG_BUSYBOX_DEFAULT_ACPID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_BLKID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE is not set +CONFIG_BUSYBOX_DEFAULT_DMESG=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY=y +# CONFIG_BUSYBOX_DEFAULT_FBSET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE is not set +# CONFIG_BUSYBOX_DEFAULT_FDFLUSH is not set +# CONFIG_BUSYBOX_DEFAULT_FDFORMAT is not set +# CONFIG_BUSYBOX_DEFAULT_FDISK is not set +# CONFIG_BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_AIX_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SGI_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SUN_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_OSF_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GPT_LABEL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED is not set +# CONFIG_BUSYBOX_DEFAULT_FINDFS is not set +# CONFIG_BUSYBOX_DEFAULT_FLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FREERAMDISK is not set +# CONFIG_BUSYBOX_DEFAULT_FSCK_MINIX is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_EXT2 is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_MINIX is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MINIX2 is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_REISER is not set +# CONFIG_BUSYBOX_DEFAULT_MKFS_VFAT is not set +# CONFIG_BUSYBOX_DEFAULT_GETOPT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG is not set +CONFIG_BUSYBOX_DEFAULT_HEXDUMP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_BUSYBOX_DEFAULT_HD is not set +CONFIG_BUSYBOX_DEFAULT_HWCLOCK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_BUSYBOX_DEFAULT_IPCRM is not set +# CONFIG_BUSYBOX_DEFAULT_IPCS is not set +# CONFIG_BUSYBOX_DEFAULT_LOSETUP is not set +# CONFIG_BUSYBOX_DEFAULT_LSPCI is not set +# CONFIG_BUSYBOX_DEFAULT_LSUSB is not set +CONFIG_BUSYBOX_DEFAULT_MKSWAP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID is not set +# CONFIG_BUSYBOX_DEFAULT_MORE is not set +CONFIG_BUSYBOX_DEFAULT_PIVOT_ROOT=y +# CONFIG_BUSYBOX_DEFAULT_RDATE is not set +# CONFIG_BUSYBOX_DEFAULT_RDEV is not set +# CONFIG_BUSYBOX_DEFAULT_READPROFILE is not set +# CONFIG_BUSYBOX_DEFAULT_RTCWAKE is not set +# CONFIG_BUSYBOX_DEFAULT_SCRIPT is not set +# CONFIG_BUSYBOX_DEFAULT_SCRIPTREPLAY is not set +# CONFIG_BUSYBOX_DEFAULT_SWAPONOFF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI is not set +CONFIG_BUSYBOX_DEFAULT_SWITCH_ROOT=y +CONFIG_BUSYBOX_DEFAULT_UMOUNT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_UMOUNT_ALL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_VOLUMEID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_F2FS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_FAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_HFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ISO9660 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_JFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXRAID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXSWAP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LUKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NILFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NTFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_OCFS2 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_REISERFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ROMFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS is not set +# CONFIG_BUSYBOX_DEFAULT_CONSPY is not set +CONFIG_BUSYBOX_DEFAULT_CROND=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_D is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_CROND_DIR="/etc" +# CONFIG_BUSYBOX_DEFAULT_I2CGET is not set +# CONFIG_BUSYBOX_DEFAULT_I2CSET is not set +# CONFIG_BUSYBOX_DEFAULT_I2CDUMP is not set +# CONFIG_BUSYBOX_DEFAULT_I2CDETECT is not set +CONFIG_BUSYBOX_DEFAULT_LESS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES=9999999 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_MARKS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_WINCH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS is not set +# CONFIG_BUSYBOX_DEFAULT_NANDWRITE is not set +# CONFIG_BUSYBOX_DEFAULT_NANDDUMP is not set +# CONFIG_BUSYBOX_DEFAULT_RFKILL is not set +# CONFIG_BUSYBOX_DEFAULT_SETSERIAL is not set +# CONFIG_BUSYBOX_DEFAULT_TASKSET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_UBIATTACH is not set +# CONFIG_BUSYBOX_DEFAULT_UBIDETACH is not set +# CONFIG_BUSYBOX_DEFAULT_UBIMKVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRMVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRSVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIUPDATEVOL is not set +# CONFIG_BUSYBOX_DEFAULT_UBIRENAME is not set +# CONFIG_BUSYBOX_DEFAULT_WALL is not set +# CONFIG_BUSYBOX_DEFAULT_ADJTIMEX is not set +# CONFIG_BUSYBOX_DEFAULT_BBCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_COMPRESS_BBCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_BEEP is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_BEEP_LENGTH_MS=0 +# CONFIG_BUSYBOX_DEFAULT_CHAT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_NOFAIL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_TTY_HIFI is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_IMPLICIT_CR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_SWALLOW_OPTS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_SEND_ESCAPES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_VAR_ABORT_LEN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT is not set +# CONFIG_BUSYBOX_DEFAULT_CHRT is not set +CONFIG_BUSYBOX_DEFAULT_CRONTAB=y +# CONFIG_BUSYBOX_DEFAULT_DC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DC_LIBM is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_MODLOAD is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_FG_NP is not set +# CONFIG_BUSYBOX_DEFAULT_DEVFSD_VERBOSE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_DEVFS is not set +# CONFIG_BUSYBOX_DEFAULT_DEVMEM is not set +# CONFIG_BUSYBOX_DEFAULT_EJECT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI is not set +# CONFIG_BUSYBOX_DEFAULT_FBSPLASH is not set +# CONFIG_BUSYBOX_DEFAULT_FLASHCP is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_LOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_UNLOCK is not set +# CONFIG_BUSYBOX_DEFAULT_FLASH_ERASEALL is not set +# CONFIG_BUSYBOX_DEFAULT_IONICE is not set +# CONFIG_BUSYBOX_DEFAULT_INOTIFYD is not set +# CONFIG_BUSYBOX_DEFAULT_LAST is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LAST_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_HDPARM is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_GET_IDENTITY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_SCAN_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_DRIVE_RESET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA is not set +CONFIG_BUSYBOX_DEFAULT_LOCK=y +# CONFIG_BUSYBOX_DEFAULT_MAKEDEVS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MAKEDEVS_LEAF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_MAKEDEVS_TABLE is not set +# CONFIG_BUSYBOX_DEFAULT_MAN is not set +# CONFIG_BUSYBOX_DEFAULT_MICROCOM is not set +# CONFIG_BUSYBOX_DEFAULT_MOUNTPOINT is not set +# CONFIG_BUSYBOX_DEFAULT_MT is not set +# CONFIG_BUSYBOX_DEFAULT_RAIDAUTORUN is not set +# CONFIG_BUSYBOX_DEFAULT_READAHEAD is not set +# CONFIG_BUSYBOX_DEFAULT_RUNLEVEL is not set +# CONFIG_BUSYBOX_DEFAULT_RX is not set +# CONFIG_BUSYBOX_DEFAULT_SETSID is not set +CONFIG_BUSYBOX_DEFAULT_STRINGS=y +CONFIG_BUSYBOX_DEFAULT_TIME=y +# CONFIG_BUSYBOX_DEFAULT_TIMEOUT is not set +# CONFIG_BUSYBOX_DEFAULT_TTYSIZE is not set +# CONFIG_BUSYBOX_DEFAULT_VOLNAME is not set +# CONFIG_BUSYBOX_DEFAULT_WATCHDOG is not set +# CONFIG_BUSYBOX_DEFAULT_NAMEIF is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED is not set +# CONFIG_BUSYBOX_DEFAULT_NBDCLIENT is not set +CONFIG_BUSYBOX_DEFAULT_NC=y +# CONFIG_BUSYBOX_DEFAULT_NC_SERVER is not set +# CONFIG_BUSYBOX_DEFAULT_NC_EXTRA is not set +# CONFIG_BUSYBOX_DEFAULT_NC_110_COMPAT is not set +CONFIG_BUSYBOX_DEFAULT_PING=y +CONFIG_BUSYBOX_DEFAULT_PING6=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_FANCY_PING=y +# CONFIG_BUSYBOX_DEFAULT_WGET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER is not set +# CONFIG_BUSYBOX_DEFAULT_WHOIS is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IPV6=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS=y +CONFIG_BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS=y +# CONFIG_BUSYBOX_DEFAULT_ARP is not set +# CONFIG_BUSYBOX_DEFAULT_ARPING is not set +CONFIG_BUSYBOX_DEFAULT_BRCTL=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW=y +# CONFIG_BUSYBOX_DEFAULT_DNSD is not set +# CONFIG_BUSYBOX_DEFAULT_ETHER_WAKE is not set +# CONFIG_BUSYBOX_DEFAULT_FAKEIDENTD is not set +# CONFIG_BUSYBOX_DEFAULT_FTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTP_WRITE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION is not set +# CONFIG_BUSYBOX_DEFAULT_FTPGET is not set +# CONFIG_BUSYBOX_DEFAULT_FTPPUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_HOSTNAME is not set +# CONFIG_BUSYBOX_DEFAULT_HTTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP is not set +CONFIG_BUSYBOX_DEFAULT_IFCONFIG=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS=y +# CONFIG_BUSYBOX_DEFAULT_IFENSLAVE is not set +# CONFIG_BUSYBOX_DEFAULT_IFPLUGD is not set +# CONFIG_BUSYBOX_DEFAULT_IFUPDOWN is not set +CONFIG_BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH="" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set +# CONFIG_BUSYBOX_DEFAULT_INETD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_INETD_RPC is not set +CONFIG_BUSYBOX_DEFAULT_IP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_LINK=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ROUTE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_RULE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_NEIGH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_BUSYBOX_DEFAULT_IPADDR is not set +# CONFIG_BUSYBOX_DEFAULT_IPLINK is not set +# CONFIG_BUSYBOX_DEFAULT_IPROUTE is not set +# CONFIG_BUSYBOX_DEFAULT_IPTUNNEL is not set +# CONFIG_BUSYBOX_DEFAULT_IPRULE is not set +# CONFIG_BUSYBOX_DEFAULT_IPNEIGH is not set +# CONFIG_BUSYBOX_DEFAULT_IPCALC is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS is not set +CONFIG_BUSYBOX_DEFAULT_NETMSG=y +CONFIG_BUSYBOX_DEFAULT_NETSTAT=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NETSTAT_WIDE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG=y +# CONFIG_BUSYBOX_DEFAULT_NSLOOKUP is not set +CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE=y +CONFIG_BUSYBOX_DEFAULT_NTPD=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_NTPD_SERVER=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_NTPD_CONF is not set +# CONFIG_BUSYBOX_DEFAULT_PSCAN is not set +CONFIG_BUSYBOX_DEFAULT_ROUTE=y +# CONFIG_BUSYBOX_DEFAULT_SLATTACH is not set +# CONFIG_BUSYBOX_DEFAULT_TCPSVD is not set +# CONFIG_BUSYBOX_DEFAULT_TELNET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNET_TTYPE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNET_AUTOLOGIN is not set +# CONFIG_BUSYBOX_DEFAULT_TELNETD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TELNETD_INETD_WAIT is not set +# CONFIG_BUSYBOX_DEFAULT_TFTP is not set +# CONFIG_BUSYBOX_DEFAULT_TFTPD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_GET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_PUT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_BLOCKSIZE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR is not set +# CONFIG_BUSYBOX_DEFAULT_TFTP_DEBUG is not set +CONFIG_BUSYBOX_DEFAULT_TRACEROUTE=y +CONFIG_BUSYBOX_DEFAULT_TRACEROUTE6=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_BUSYBOX_DEFAULT_TUNCTL is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TUNCTL_UG is not set +# CONFIG_BUSYBOX_DEFAULT_UDHCPC6 is not set +# CONFIG_BUSYBOX_DEFAULT_UDHCPD is not set +# CONFIG_BUSYBOX_DEFAULT_DHCPRELAY is not set +# CONFIG_BUSYBOX_DEFAULT_DUMPLEASES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set +CONFIG_BUSYBOX_DEFAULT_DHCPD_LEASES_FILE="" +CONFIG_BUSYBOX_DEFAULT_UDHCPC=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPC_ARPING is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCPC_SANITIZEOPT is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_PORT is not set +CONFIG_BUSYBOX_DEFAULT_UDHCP_DEBUG=0 +CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_RFC3397=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UDHCP_8021Q is not set +CONFIG_BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +CONFIG_BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS="" +# CONFIG_BUSYBOX_DEFAULT_UDPSVD is not set +# CONFIG_BUSYBOX_DEFAULT_VCONFIG is not set +# CONFIG_BUSYBOX_DEFAULT_ZCIP is not set +# CONFIG_BUSYBOX_DEFAULT_LPD is not set +# CONFIG_BUSYBOX_DEFAULT_LPR is not set +# CONFIG_BUSYBOX_DEFAULT_LPQ is not set +# CONFIG_BUSYBOX_DEFAULT_MAKEMIME is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET="" +# CONFIG_BUSYBOX_DEFAULT_POPMAILDIR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_POPMAILDIR_DELIVERY is not set +# CONFIG_BUSYBOX_DEFAULT_REFORMIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_SENDMAIL is not set +# CONFIG_BUSYBOX_DEFAULT_IOSTAT is not set +# CONFIG_BUSYBOX_DEFAULT_LSOF is not set +# CONFIG_BUSYBOX_DEFAULT_MPSTAT is not set +# CONFIG_BUSYBOX_DEFAULT_NMETER is not set +# CONFIG_BUSYBOX_DEFAULT_PMAP is not set +# CONFIG_BUSYBOX_DEFAULT_POWERTOP is not set +# CONFIG_BUSYBOX_DEFAULT_PSTREE is not set +# CONFIG_BUSYBOX_DEFAULT_PWDX is not set +# CONFIG_BUSYBOX_DEFAULT_SMEMCAP is not set +CONFIG_BUSYBOX_DEFAULT_TOP=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_SMP_CPU is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_DECIMALS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_TOPMEM is not set +CONFIG_BUSYBOX_DEFAULT_UPTIME=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT is not set +CONFIG_BUSYBOX_DEFAULT_FREE=y +# CONFIG_BUSYBOX_DEFAULT_FUSER is not set +CONFIG_BUSYBOX_DEFAULT_KILL=y +CONFIG_BUSYBOX_DEFAULT_KILLALL=y +# CONFIG_BUSYBOX_DEFAULT_KILLALL5 is not set +CONFIG_BUSYBOX_DEFAULT_PGREP=y +CONFIG_BUSYBOX_DEFAULT_PIDOF=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT is not set +# CONFIG_BUSYBOX_DEFAULT_PKILL is not set +CONFIG_BUSYBOX_DEFAULT_PS=y +CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_WIDE=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_LONG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_TIME is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS is not set +# CONFIG_BUSYBOX_DEFAULT_RENICE is not set +CONFIG_BUSYBOX_DEFAULT_BB_SYSCTL=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS is not set +# CONFIG_BUSYBOX_DEFAULT_WATCH is not set +# CONFIG_BUSYBOX_DEFAULT_CHPST is not set +# CONFIG_BUSYBOX_DEFAULT_SETUIDGID is not set +# CONFIG_BUSYBOX_DEFAULT_ENVUIDGID is not set +# CONFIG_BUSYBOX_DEFAULT_ENVDIR is not set +# CONFIG_BUSYBOX_DEFAULT_SOFTLIMIT is not set +# CONFIG_BUSYBOX_DEFAULT_RUNSV is not set +# CONFIG_BUSYBOX_DEFAULT_RUNSVDIR is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUNSVDIR_LOG is not set +# CONFIG_BUSYBOX_DEFAULT_SV is not set +CONFIG_BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR="" +# CONFIG_BUSYBOX_DEFAULT_SVLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_CHCON is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_CHCON_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_GETENFORCE is not set +# CONFIG_BUSYBOX_DEFAULT_GETSEBOOL is not set +# CONFIG_BUSYBOX_DEFAULT_LOAD_POLICY is not set +# CONFIG_BUSYBOX_DEFAULT_MATCHPATHCON is not set +# CONFIG_BUSYBOX_DEFAULT_RESTORECON is not set +# CONFIG_BUSYBOX_DEFAULT_RUNCON is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_SELINUXENABLED is not set +# CONFIG_BUSYBOX_DEFAULT_SETENFORCE is not set +# CONFIG_BUSYBOX_DEFAULT_SETFILES is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SETFILES_CHECK_OPTION is not set +# CONFIG_BUSYBOX_DEFAULT_SETSEBOOL is not set +# CONFIG_BUSYBOX_DEFAULT_SESTATUS is not set +CONFIG_BUSYBOX_DEFAULT_ASH=y +CONFIG_BUSYBOX_DEFAULT_ASH_BASH_COMPAT=y +# CONFIG_BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT is not set +CONFIG_BUSYBOX_DEFAULT_ASH_JOB_CONTROL=y +CONFIG_BUSYBOX_DEFAULT_ASH_ALIAS=y +CONFIG_BUSYBOX_DEFAULT_ASH_GETOPTS=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF=y +CONFIG_BUSYBOX_DEFAULT_ASH_BUILTIN_TEST=y +# CONFIG_BUSYBOX_DEFAULT_ASH_HELP is not set +CONFIG_BUSYBOX_DEFAULT_ASH_CMDCMD=y +# CONFIG_BUSYBOX_DEFAULT_ASH_MAIL is not set +# CONFIG_BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT is not set +CONFIG_BUSYBOX_DEFAULT_ASH_EXPAND_PRMT=y +# CONFIG_BUSYBOX_DEFAULT_CTTYHACK is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_BASH_COMPAT is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_BRACE_EXPANSION is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_HELP is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_INTERACTIVE is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_SAVEHISTORY is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_JOB is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_TICK is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_IF is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_LOOPS is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_CASE is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_FUNCTIONS is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_LOCAL is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_EXPORT_N is not set +# CONFIG_BUSYBOX_DEFAULT_HUSH_MODE_X is not set +# CONFIG_BUSYBOX_DEFAULT_MSH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_ASH=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_HUSH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_IS_NONE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_ASH is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_HUSH is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_BASH_IS_NONE=y +CONFIG_BUSYBOX_DEFAULT_SH_MATH_SUPPORT=y +CONFIG_BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_NOFORK=y +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE is not set +# CONFIG_BUSYBOX_DEFAULT_KLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KLOGD_KLOGCTL is not set +CONFIG_BUSYBOX_DEFAULT_LOGGER=y +# CONFIG_BUSYBOX_DEFAULT_LOGREAD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING is not set +# CONFIG_BUSYBOX_DEFAULT_SYSLOGD is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_ROTATE_LOGFILE is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_REMOTE_LOG is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_DUP is not set +# CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_CFG is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG is not set +CONFIG_BUSYBOX_DEFAULT_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 +# CONFIG_BUSYBOX_DEFAULT_FEATURE_KMSG_SYSLOG is not set +CONFIG_BUSYBOX_CONFIG_HAVE_DOT_CONFIG=y + +# +# Busybox Settings +# + +# +# General Configuration +# +# CONFIG_BUSYBOX_CONFIG_DESKTOP is not set +# CONFIG_BUSYBOX_CONFIG_EXTRA_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_INCLUDE_SUSv2=y +# CONFIG_BUSYBOX_CONFIG_USE_PORTABLE_CODE is not set +CONFIG_BUSYBOX_CONFIG_PLATFORM_LINUX=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set +CONFIG_BUSYBOX_CONFIG_SHOW_USAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE_USAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_COMPRESS_USAGE=y +# CONFIG_BUSYBOX_CONFIG_BUSYBOX is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_NO_USR is not set +# CONFIG_BUSYBOX_CONFIG_LOCALE_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_UNICODE_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_PAM is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_SENDFILE is not set +CONFIG_BUSYBOX_CONFIG_LONG_OPTS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DEVPTS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CLEAN_UP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UTMP is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_PIDFILE=y +CONFIG_BUSYBOX_CONFIG_PID_FILE_PATH="/var/run" +CONFIG_BUSYBOX_CONFIG_FEATURE_SUID=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SUID_CONFIG is not set +# CONFIG_BUSYBOX_CONFIG_SELINUX is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS=y +CONFIG_BUSYBOX_CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" +CONFIG_BUSYBOX_CONFIG_FEATURE_SYSLOG=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HAVE_RPC is not set + +# +# Build Options +# +# CONFIG_BUSYBOX_CONFIG_STATIC is not set +# CONFIG_BUSYBOX_CONFIG_PIE is not set +# CONFIG_BUSYBOX_CONFIG_NOMMU is not set +CONFIG_BUSYBOX_CONFIG_LFS=y +CONFIG_BUSYBOX_CONFIG_CROSS_COMPILER_PREFIX="" +CONFIG_BUSYBOX_CONFIG_SYSROOT="" +CONFIG_BUSYBOX_CONFIG_EXTRA_CFLAGS="" +CONFIG_BUSYBOX_CONFIG_EXTRA_LDFLAGS="" +CONFIG_BUSYBOX_CONFIG_EXTRA_LDLIBS="" + +# +# Debugging Options +# +# CONFIG_BUSYBOX_CONFIG_DEBUG is not set +# CONFIG_BUSYBOX_CONFIG_DEBUG_SANITIZE is not set +# CONFIG_BUSYBOX_CONFIG_UNIT_TEST is not set +# CONFIG_BUSYBOX_CONFIG_WERROR is not set +CONFIG_BUSYBOX_CONFIG_NO_DEBUG_LIB=y +# CONFIG_BUSYBOX_CONFIG_DMALLOC is not set +# CONFIG_BUSYBOX_CONFIG_EFENCE is not set + +# +# Installation Options ("make install" behavior) +# +CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_SYMLINKS=y +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_HARDLINKS is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set +# CONFIG_BUSYBOX_CONFIG_INSTALL_APPLET_DONT is not set +CONFIG_BUSYBOX_CONFIG_PREFIX="./_install" + +# +# Busybox Library Tuning +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_BSS_TAIL is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_RTMINMAX is not set +CONFIG_BUSYBOX_CONFIG_PASSWORD_MINLEN=6 +CONFIG_BUSYBOX_CONFIG_MD5_SMALL=1 +CONFIG_BUSYBOX_CONFIG_SHA3_SMALL=1 +CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_USE_TERMIOS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING=y +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_MAX_LEN=512 +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_VI is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_HISTORY=256 +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_REVERSE_SEARCH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_USERNAME_COMPLETION is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_COPYBUF_KB=4 +# CONFIG_BUSYBOX_CONFIG_FEATURE_SKIP_ROOTFS is not set +# CONFIG_BUSYBOX_CONFIG_MONOTONIC_SYSCALL is not set +CONFIG_BUSYBOX_CONFIG_IOCTL_HEX2STR_ERROR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWIB is not set + +# +# Applets +# + +# +# Archival Utilities +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_LZMA is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_BZ2 is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z is not set +# CONFIG_BUSYBOX_CONFIG_AR is not set +# CONFIG_BUSYBOX_CONFIG_UNCOMPRESS is not set +CONFIG_BUSYBOX_CONFIG_GUNZIP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_BUNZIP2=y +# CONFIG_BUSYBOX_CONFIG_UNLZMA is not set +# CONFIG_BUSYBOX_CONFIG_UNXZ is not set +# CONFIG_BUSYBOX_CONFIG_BZIP2 is not set +# CONFIG_BUSYBOX_CONFIG_CPIO is not set +# CONFIG_BUSYBOX_CONFIG_DPKG is not set +# CONFIG_BUSYBOX_CONFIG_DPKG_DEB is not set +CONFIG_BUSYBOX_CONFIG_GZIP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_GZIP_FAST=0 +# CONFIG_BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS is not set +# CONFIG_BUSYBOX_CONFIG_LZOP is not set +# CONFIG_BUSYBOX_CONFIG_RPM is not set +# CONFIG_BUSYBOX_CONFIG_RPM2CPIO is not set +CONFIG_BUSYBOX_CONFIG_TAR=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_CREATE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_AUTODETECT is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_FROM=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME is not set +# CONFIG_BUSYBOX_CONFIG_UNZIP is not set + +# +# Coreutils +# +CONFIG_BUSYBOX_CONFIG_BASENAME=y +CONFIG_BUSYBOX_CONFIG_CAT=y +CONFIG_BUSYBOX_CONFIG_DATE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_ISOFMT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_NANO is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_DATE_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_DD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DD_SIGNAL_HANDLING=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DD_THIRD_STATUS_LINE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DD_STATUS is not set +# CONFIG_BUSYBOX_CONFIG_HOSTID is not set +CONFIG_BUSYBOX_CONFIG_ID=y +# CONFIG_BUSYBOX_CONFIG_GROUPS is not set +# CONFIG_BUSYBOX_CONFIG_SHUF is not set +# CONFIG_BUSYBOX_CONFIG_STAT is not set +CONFIG_BUSYBOX_CONFIG_SYNC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SYNC_FANCY is not set +CONFIG_BUSYBOX_CONFIG_TEST=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TEST_64=y +CONFIG_BUSYBOX_CONFIG_TOUCH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOUCH_NODEREF is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_TOUCH_SUSV3=y +CONFIG_BUSYBOX_CONFIG_TR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TR_CLASSES is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TR_EQUIV is not set +# CONFIG_BUSYBOX_CONFIG_TRUNCATE is not set +# CONFIG_BUSYBOX_CONFIG_UNLINK is not set +# CONFIG_BUSYBOX_CONFIG_BASE64 is not set +# CONFIG_BUSYBOX_CONFIG_CAL is not set +# CONFIG_BUSYBOX_CONFIG_CATV is not set +CONFIG_BUSYBOX_CONFIG_CHGRP=y +CONFIG_BUSYBOX_CONFIG_CHMOD=y +CONFIG_BUSYBOX_CONFIG_CHOWN=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_CHROOT=y +# CONFIG_BUSYBOX_CONFIG_CKSUM is not set +# CONFIG_BUSYBOX_CONFIG_COMM is not set +CONFIG_BUSYBOX_CONFIG_CP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_CUT=y +CONFIG_BUSYBOX_CONFIG_DF=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_DF_FANCY is not set +CONFIG_BUSYBOX_CONFIG_DIRNAME=y +# CONFIG_BUSYBOX_CONFIG_DOS2UNIX is not set +CONFIG_BUSYBOX_CONFIG_DU=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y +CONFIG_BUSYBOX_CONFIG_ECHO=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_ECHO=y +CONFIG_BUSYBOX_CONFIG_ENV=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_EXPAND is not set +CONFIG_BUSYBOX_CONFIG_EXPR=y +CONFIG_BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64=y +CONFIG_BUSYBOX_CONFIG_FALSE=y +# CONFIG_BUSYBOX_CONFIG_FOLD is not set +CONFIG_BUSYBOX_CONFIG_FSYNC=y +CONFIG_BUSYBOX_CONFIG_HEAD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_HEAD=y +# CONFIG_BUSYBOX_CONFIG_INSTALL is not set +CONFIG_BUSYBOX_CONFIG_LN=y +# CONFIG_BUSYBOX_CONFIG_LOGNAME is not set +CONFIG_BUSYBOX_CONFIG_LS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FILETYPES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_SORTFILES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_USERNAME=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT=y +CONFIG_BUSYBOX_CONFIG_MD5SUM=y +CONFIG_BUSYBOX_CONFIG_MKDIR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_MKFIFO=y +CONFIG_BUSYBOX_CONFIG_MKNOD=y +CONFIG_BUSYBOX_CONFIG_MV=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_NICE=y +# CONFIG_BUSYBOX_CONFIG_NOHUP is not set +# CONFIG_BUSYBOX_CONFIG_OD is not set +# CONFIG_BUSYBOX_CONFIG_PRINTENV is not set +CONFIG_BUSYBOX_CONFIG_PRINTF=y +CONFIG_BUSYBOX_CONFIG_PWD=y +CONFIG_BUSYBOX_CONFIG_READLINK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW=y +# CONFIG_BUSYBOX_CONFIG_REALPATH is not set +CONFIG_BUSYBOX_CONFIG_RM=y +CONFIG_BUSYBOX_CONFIG_RMDIR=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_SEQ=y +# CONFIG_BUSYBOX_CONFIG_SHA1SUM is not set +CONFIG_BUSYBOX_CONFIG_SHA256SUM=y +# CONFIG_BUSYBOX_CONFIG_SHA512SUM is not set +# CONFIG_BUSYBOX_CONFIG_SHA3SUM is not set +CONFIG_BUSYBOX_CONFIG_SLEEP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP is not set +CONFIG_BUSYBOX_CONFIG_SORT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SORT_BIG is not set +# CONFIG_BUSYBOX_CONFIG_SPLIT is not set +# CONFIG_BUSYBOX_CONFIG_STTY is not set +# CONFIG_BUSYBOX_CONFIG_SUM is not set +# CONFIG_BUSYBOX_CONFIG_TAC is not set +CONFIG_BUSYBOX_CONFIG_TAIL=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_TAIL=y +CONFIG_BUSYBOX_CONFIG_TEE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO=y +CONFIG_BUSYBOX_CONFIG_TRUE=y +# CONFIG_BUSYBOX_CONFIG_TTY is not set +CONFIG_BUSYBOX_CONFIG_UNAME=y +CONFIG_BUSYBOX_CONFIG_UNAME_OSNAME="GNU/Linux" +# CONFIG_BUSYBOX_CONFIG_UNEXPAND is not set +CONFIG_BUSYBOX_CONFIG_UNIQ=y +# CONFIG_BUSYBOX_CONFIG_USLEEP is not set +# CONFIG_BUSYBOX_CONFIG_UUDECODE is not set +# CONFIG_BUSYBOX_CONFIG_UUENCODE is not set +CONFIG_BUSYBOX_CONFIG_WC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_WC_LARGE is not set +# CONFIG_BUSYBOX_CONFIG_WHOAMI is not set +CONFIG_BUSYBOX_CONFIG_YES=y + +# +# Common options +# +# CONFIG_BUSYBOX_CONFIG_FEATURE_VERBOSE is not set + +# +# Common options for cp and mv +# +CONFIG_BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS=y + +# +# Common options for ls, more and telnet +# +CONFIG_BUSYBOX_CONFIG_FEATURE_AUTOWIDTH=y + +# +# Common options for df, du, ls +# +CONFIG_BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE=y + +# +# Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum +# +CONFIG_BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y + +# +# Console Utilities +# +# CONFIG_BUSYBOX_CONFIG_CHVT is not set +# CONFIG_BUSYBOX_CONFIG_FGCONSOLE is not set +CONFIG_BUSYBOX_CONFIG_CLEAR=y +# CONFIG_BUSYBOX_CONFIG_DEALLOCVT is not set +# CONFIG_BUSYBOX_CONFIG_DUMPKMAP is not set +# CONFIG_BUSYBOX_CONFIG_KBD_MODE is not set +# CONFIG_BUSYBOX_CONFIG_LOADFONT is not set +# CONFIG_BUSYBOX_CONFIG_LOADKMAP is not set +# CONFIG_BUSYBOX_CONFIG_OPENVT is not set +CONFIG_BUSYBOX_CONFIG_RESET=y +# CONFIG_BUSYBOX_CONFIG_RESIZE is not set +# CONFIG_BUSYBOX_CONFIG_SETCONSOLE is not set +# CONFIG_BUSYBOX_CONFIG_SETFONT is not set +# CONFIG_BUSYBOX_CONFIG_SETKEYCODES is not set +# CONFIG_BUSYBOX_CONFIG_SETLOGCONS is not set +# CONFIG_BUSYBOX_CONFIG_SHOWKEY is not set + +# +# Debian Utilities +# +CONFIG_BUSYBOX_CONFIG_MKTEMP=y +# CONFIG_BUSYBOX_CONFIG_PIPE_PROGRESS is not set +# CONFIG_BUSYBOX_CONFIG_RUN_PARTS is not set +CONFIG_BUSYBOX_CONFIG_START_STOP_DAEMON=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_WHICH=y + +# +# Editors +# +CONFIG_BUSYBOX_CONFIG_AWK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_AWK_LIBM=y +CONFIG_BUSYBOX_CONFIG_FEATURE_AWK_GNU_EXTENSIONS=y +CONFIG_BUSYBOX_CONFIG_CMP=y +# CONFIG_BUSYBOX_CONFIG_DIFF is not set +# CONFIG_BUSYBOX_CONFIG_ED is not set +# CONFIG_BUSYBOX_CONFIG_PATCH is not set +CONFIG_BUSYBOX_CONFIG_SED=y +CONFIG_BUSYBOX_CONFIG_VI=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN=1024 +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_8BIT is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_COLON=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_YANKMARK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SEARCH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_READONLY=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SETOPTS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_SET=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC=y + +# +# Finding Utilities +# +CONFIG_BUSYBOX_CONFIG_FIND=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRINT0=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MTIME=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MMIN is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PERM=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_TYPE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_XDEV=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NEWER is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_INUM is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_EXEC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_EXEC_PLUS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_USER=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_GROUP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_NOT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_DEPTH=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PAREN=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_SIZE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PRUNE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_DELETE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_PATH=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_REGEX=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_FIND_LINKS is not set +CONFIG_BUSYBOX_CONFIG_GREP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT=y +CONFIG_BUSYBOX_CONFIG_XARGS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR is not set + +# +# Init Utilities +# +# CONFIG_BUSYBOX_CONFIG_BOOTCHARTD is not set +CONFIG_BUSYBOX_CONFIG_HALT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CALL_TELINIT is not set +# CONFIG_BUSYBOX_CONFIG_INIT is not set +# CONFIG_BUSYBOX_CONFIG_LINUXRC is not set +# CONFIG_BUSYBOX_CONFIG_MESG is not set + +# +# Login/Password Management Utilities +# +CONFIG_BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS=y +# CONFIG_BUSYBOX_CONFIG_USE_BB_PWD_GRP is not set +# CONFIG_BUSYBOX_CONFIG_USE_BB_CRYPT is not set +# CONFIG_BUSYBOX_CONFIG_ADD_SHELL is not set +# CONFIG_BUSYBOX_CONFIG_REMOVE_SHELL is not set +# CONFIG_BUSYBOX_CONFIG_ADDGROUP is not set +# CONFIG_BUSYBOX_CONFIG_ADDUSER is not set +# CONFIG_BUSYBOX_CONFIG_CHPASSWD is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO="md5" +# CONFIG_BUSYBOX_CONFIG_CRYPTPW is not set +# CONFIG_BUSYBOX_CONFIG_MKPASSWD is not set +# CONFIG_BUSYBOX_CONFIG_DELUSER is not set +# CONFIG_BUSYBOX_CONFIG_DELGROUP is not set +# CONFIG_BUSYBOX_CONFIG_GETTY is not set +CONFIG_BUSYBOX_CONFIG_LOGIN=y +# CONFIG_BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD is not set +# CONFIG_BUSYBOX_CONFIG_LOGIN_SCRIPTS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_NOLOGIN is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SECURETTY is not set +CONFIG_BUSYBOX_CONFIG_PASSWD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_PASSWD_WEAK_CHECK=y +# CONFIG_BUSYBOX_CONFIG_SU is not set +# CONFIG_BUSYBOX_CONFIG_SULOGIN is not set +# CONFIG_BUSYBOX_CONFIG_VLOCK is not set + +# +# Linux Ext2 FS Progs +# +# CONFIG_BUSYBOX_CONFIG_CHATTR is not set +# CONFIG_BUSYBOX_CONFIG_FSCK is not set +# CONFIG_BUSYBOX_CONFIG_LSATTR is not set +# CONFIG_BUSYBOX_CONFIG_TUNE2FS is not set + +# +# Linux Module Utilities +# +# CONFIG_BUSYBOX_CONFIG_MODINFO is not set +# CONFIG_BUSYBOX_CONFIG_MODPROBE_SMALL is not set +# CONFIG_BUSYBOX_CONFIG_INSMOD is not set +# CONFIG_BUSYBOX_CONFIG_RMMOD is not set +# CONFIG_BUSYBOX_CONFIG_LSMOD is not set +# CONFIG_BUSYBOX_CONFIG_MODPROBE is not set +# CONFIG_BUSYBOX_CONFIG_DEPMOD is not set + +# +# Options common to multiple modutils +# + +# +# Linux System Utilities +# +# CONFIG_BUSYBOX_CONFIG_BLKDISCARD is not set +# CONFIG_BUSYBOX_CONFIG_BLOCKDEV is not set +# CONFIG_BUSYBOX_CONFIG_FATATTR is not set +# CONFIG_BUSYBOX_CONFIG_FSTRIM is not set +# CONFIG_BUSYBOX_CONFIG_MDEV is not set +CONFIG_BUSYBOX_CONFIG_MOUNT=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FAKE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_VERBOSE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_HELPERS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LABEL is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_NFS is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_FSTAB=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB is not set +# CONFIG_BUSYBOX_CONFIG_NSENTER is not set +# CONFIG_BUSYBOX_CONFIG_REV is not set +# CONFIG_BUSYBOX_CONFIG_SETARCH is not set +# CONFIG_BUSYBOX_CONFIG_UEVENT is not set +# CONFIG_BUSYBOX_CONFIG_UNSHARE is not set +# CONFIG_BUSYBOX_CONFIG_ACPID is not set +# CONFIG_BUSYBOX_CONFIG_BLKID is not set +CONFIG_BUSYBOX_CONFIG_DMESG=y +CONFIG_BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY=y +# CONFIG_BUSYBOX_CONFIG_FBSET is not set +# CONFIG_BUSYBOX_CONFIG_FDFLUSH is not set +# CONFIG_BUSYBOX_CONFIG_FDFORMAT is not set +# CONFIG_BUSYBOX_CONFIG_FDISK is not set +# CONFIG_BUSYBOX_CONFIG_FINDFS is not set +# CONFIG_BUSYBOX_CONFIG_FLOCK is not set +# CONFIG_BUSYBOX_CONFIG_FREERAMDISK is not set +# CONFIG_BUSYBOX_CONFIG_FSCK_MINIX is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_EXT2 is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_MINIX is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_REISER is not set +# CONFIG_BUSYBOX_CONFIG_MKFS_VFAT is not set +# CONFIG_BUSYBOX_CONFIG_GETOPT is not set +CONFIG_BUSYBOX_CONFIG_HEXDUMP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE is not set +# CONFIG_BUSYBOX_CONFIG_HD is not set +CONFIG_BUSYBOX_CONFIG_HWCLOCK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set +# CONFIG_BUSYBOX_CONFIG_IPCRM is not set +# CONFIG_BUSYBOX_CONFIG_IPCS is not set +# CONFIG_BUSYBOX_CONFIG_LOSETUP is not set +# CONFIG_BUSYBOX_CONFIG_LSPCI is not set +# CONFIG_BUSYBOX_CONFIG_LSUSB is not set +CONFIG_BUSYBOX_CONFIG_MKSWAP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID is not set +# CONFIG_BUSYBOX_CONFIG_MORE is not set +CONFIG_BUSYBOX_CONFIG_PIVOT_ROOT=y +# CONFIG_BUSYBOX_CONFIG_RDATE is not set +# CONFIG_BUSYBOX_CONFIG_RDEV is not set +# CONFIG_BUSYBOX_CONFIG_READPROFILE is not set +# CONFIG_BUSYBOX_CONFIG_RTCWAKE is not set +# CONFIG_BUSYBOX_CONFIG_SCRIPT is not set +# CONFIG_BUSYBOX_CONFIG_SCRIPTREPLAY is not set +# CONFIG_BUSYBOX_CONFIG_SWAPONOFF is not set +CONFIG_BUSYBOX_CONFIG_SWITCH_ROOT=y +CONFIG_BUSYBOX_CONFIG_UMOUNT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL=y + +# +# Common options for mount/umount +# +CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_MTAB_SUPPORT is not set +# CONFIG_BUSYBOX_CONFIG_VOLUMEID is not set + +# +# Miscellaneous Utilities +# +# CONFIG_BUSYBOX_CONFIG_CONSPY is not set +CONFIG_BUSYBOX_CONFIG_CROND=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_D is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_CROND_DIR="/etc" +# CONFIG_BUSYBOX_CONFIG_I2CGET is not set +# CONFIG_BUSYBOX_CONFIG_I2CSET is not set +# CONFIG_BUSYBOX_CONFIG_I2CDUMP is not set +# CONFIG_BUSYBOX_CONFIG_I2CDETECT is not set +CONFIG_BUSYBOX_CONFIG_LESS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES=9999999 +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_FLAGS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_MARKS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_REGEXP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_WINCH is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD is not set +# CONFIG_BUSYBOX_CONFIG_NANDWRITE is not set +# CONFIG_BUSYBOX_CONFIG_NANDDUMP is not set +# CONFIG_BUSYBOX_CONFIG_RFKILL is not set +# CONFIG_BUSYBOX_CONFIG_SETSERIAL is not set +# CONFIG_BUSYBOX_CONFIG_TASKSET is not set +# CONFIG_BUSYBOX_CONFIG_UBIATTACH is not set +# CONFIG_BUSYBOX_CONFIG_UBIDETACH is not set +# CONFIG_BUSYBOX_CONFIG_UBIMKVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRMVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRSVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIUPDATEVOL is not set +# CONFIG_BUSYBOX_CONFIG_UBIRENAME is not set +# CONFIG_BUSYBOX_CONFIG_ADJTIMEX is not set +# CONFIG_BUSYBOX_CONFIG_BBCONFIG is not set +# CONFIG_BUSYBOX_CONFIG_BEEP is not set +# CONFIG_BUSYBOX_CONFIG_CHAT is not set +# CONFIG_BUSYBOX_CONFIG_CHRT is not set +CONFIG_BUSYBOX_CONFIG_CRONTAB=y +# CONFIG_BUSYBOX_CONFIG_DC is not set +# CONFIG_BUSYBOX_CONFIG_DEVFSD is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_DEVFS is not set +# CONFIG_BUSYBOX_CONFIG_DEVMEM is not set +# CONFIG_BUSYBOX_CONFIG_EJECT is not set +# CONFIG_BUSYBOX_CONFIG_FBSPLASH is not set +# CONFIG_BUSYBOX_CONFIG_FLASHCP is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_LOCK is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_UNLOCK is not set +# CONFIG_BUSYBOX_CONFIG_FLASH_ERASEALL is not set +# CONFIG_BUSYBOX_CONFIG_IONICE is not set +# CONFIG_BUSYBOX_CONFIG_INOTIFYD is not set +# CONFIG_BUSYBOX_CONFIG_HDPARM is not set +CONFIG_BUSYBOX_CONFIG_LOCK=y +# CONFIG_BUSYBOX_CONFIG_MAKEDEVS is not set +# CONFIG_BUSYBOX_CONFIG_MAN is not set +# CONFIG_BUSYBOX_CONFIG_MICROCOM is not set +# CONFIG_BUSYBOX_CONFIG_MOUNTPOINT is not set +# CONFIG_BUSYBOX_CONFIG_MT is not set +# CONFIG_BUSYBOX_CONFIG_RAIDAUTORUN is not set +# CONFIG_BUSYBOX_CONFIG_READAHEAD is not set +# CONFIG_BUSYBOX_CONFIG_RX is not set +# CONFIG_BUSYBOX_CONFIG_SETSID is not set +CONFIG_BUSYBOX_CONFIG_STRINGS=y +CONFIG_BUSYBOX_CONFIG_TIME=y +# CONFIG_BUSYBOX_CONFIG_TIMEOUT is not set +# CONFIG_BUSYBOX_CONFIG_TTYSIZE is not set +# CONFIG_BUSYBOX_CONFIG_VOLNAME is not set +# CONFIG_BUSYBOX_CONFIG_WATCHDOG is not set + +# +# Networking Utilities +# +# CONFIG_BUSYBOX_CONFIG_NAMEIF is not set +# CONFIG_BUSYBOX_CONFIG_NBDCLIENT is not set +CONFIG_BUSYBOX_CONFIG_NC=y +# CONFIG_BUSYBOX_CONFIG_NC_SERVER is not set +# CONFIG_BUSYBOX_CONFIG_NC_EXTRA is not set +# CONFIG_BUSYBOX_CONFIG_NC_110_COMPAT is not set +CONFIG_BUSYBOX_CONFIG_PING=y +CONFIG_BUSYBOX_CONFIG_FEATURE_FANCY_PING=y +# CONFIG_BUSYBOX_CONFIG_WGET is not set +# CONFIG_BUSYBOX_CONFIG_WHOIS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IPV6 is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL is not set +CONFIG_BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS=y +# CONFIG_BUSYBOX_CONFIG_ARP is not set +# CONFIG_BUSYBOX_CONFIG_ARPING is not set +CONFIG_BUSYBOX_CONFIG_BRCTL=y +CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY=y +CONFIG_BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW=y +# CONFIG_BUSYBOX_CONFIG_DNSD is not set +# CONFIG_BUSYBOX_CONFIG_ETHER_WAKE is not set +# CONFIG_BUSYBOX_CONFIG_FAKEIDENTD is not set +# CONFIG_BUSYBOX_CONFIG_FTPD is not set +# CONFIG_BUSYBOX_CONFIG_FTPGET is not set +# CONFIG_BUSYBOX_CONFIG_FTPPUT is not set +# CONFIG_BUSYBOX_CONFIG_HOSTNAME is not set +# CONFIG_BUSYBOX_CONFIG_HTTPD is not set +CONFIG_BUSYBOX_CONFIG_IFCONFIG=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y +# CONFIG_BUSYBOX_CONFIG_IFENSLAVE is not set +# CONFIG_BUSYBOX_CONFIG_IFPLUGD is not set +# CONFIG_BUSYBOX_CONFIG_IFUPDOWN is not set +# CONFIG_BUSYBOX_CONFIG_INETD is not set +CONFIG_BUSYBOX_CONFIG_IP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ADDRESS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_LINK=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ROUTE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR="/etc/iproute2" +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_TUNNEL is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RULE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_NEIGH is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set +# CONFIG_BUSYBOX_CONFIG_IPCALC is not set +CONFIG_BUSYBOX_CONFIG_NETMSG=y +CONFIG_BUSYBOX_CONFIG_NETSTAT=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG=y +# CONFIG_BUSYBOX_CONFIG_NSLOOKUP is not set +CONFIG_BUSYBOX_CONFIG_NSLOOKUP_LEDE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS is not set +CONFIG_BUSYBOX_CONFIG_NTPD=y +CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_CONF is not set +# CONFIG_BUSYBOX_CONFIG_PSCAN is not set +CONFIG_BUSYBOX_CONFIG_ROUTE=y +# CONFIG_BUSYBOX_CONFIG_SLATTACH is not set +# CONFIG_BUSYBOX_CONFIG_TCPSVD is not set +# CONFIG_BUSYBOX_CONFIG_TELNET is not set +# CONFIG_BUSYBOX_CONFIG_TELNETD is not set +# CONFIG_BUSYBOX_CONFIG_TFTP is not set +# CONFIG_BUSYBOX_CONFIG_TFTPD is not set +CONFIG_BUSYBOX_CONFIG_TRACEROUTE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set +# CONFIG_BUSYBOX_CONFIG_TUNCTL is not set +# CONFIG_BUSYBOX_CONFIG_UDHCPD is not set +CONFIG_BUSYBOX_CONFIG_UDHCPC=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCPC_ARPING is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_PORT is not set +CONFIG_BUSYBOX_CONFIG_UDHCP_DEBUG=0 +CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q is not set +CONFIG_BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" +CONFIG_BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 +# CONFIG_BUSYBOX_CONFIG_UDPSVD is not set +# CONFIG_BUSYBOX_CONFIG_VCONFIG is not set +# CONFIG_BUSYBOX_CONFIG_ZCIP is not set + +# +# Print Utilities +# +# CONFIG_BUSYBOX_CONFIG_LPD is not set +# CONFIG_BUSYBOX_CONFIG_LPR is not set +# CONFIG_BUSYBOX_CONFIG_LPQ is not set + +# +# Mail Utilities +# +# CONFIG_BUSYBOX_CONFIG_MAKEMIME is not set +# CONFIG_BUSYBOX_CONFIG_POPMAILDIR is not set +# CONFIG_BUSYBOX_CONFIG_REFORMIME is not set +# CONFIG_BUSYBOX_CONFIG_SENDMAIL is not set + +# +# Process Utilities +# +# CONFIG_BUSYBOX_CONFIG_IOSTAT is not set +# CONFIG_BUSYBOX_CONFIG_LSOF is not set +# CONFIG_BUSYBOX_CONFIG_MPSTAT is not set +# CONFIG_BUSYBOX_CONFIG_NMETER is not set +# CONFIG_BUSYBOX_CONFIG_PMAP is not set +# CONFIG_BUSYBOX_CONFIG_POWERTOP is not set +# CONFIG_BUSYBOX_CONFIG_PSTREE is not set +# CONFIG_BUSYBOX_CONFIG_PWDX is not set +# CONFIG_BUSYBOX_CONFIG_SMEMCAP is not set +CONFIG_BUSYBOX_CONFIG_TOP=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y +CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_SMP_CPU is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_DECIMALS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOP_SMP_PROCESS is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_TOPMEM is not set +CONFIG_BUSYBOX_CONFIG_UPTIME=y +CONFIG_BUSYBOX_CONFIG_FREE=y +# CONFIG_BUSYBOX_CONFIG_FUSER is not set +CONFIG_BUSYBOX_CONFIG_KILL=y +CONFIG_BUSYBOX_CONFIG_KILLALL=y +# CONFIG_BUSYBOX_CONFIG_KILLALL5 is not set +CONFIG_BUSYBOX_CONFIG_PGREP=y +CONFIG_BUSYBOX_CONFIG_PIDOF=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT is not set +# CONFIG_BUSYBOX_CONFIG_PKILL is not set +CONFIG_BUSYBOX_CONFIG_PS=y +CONFIG_BUSYBOX_CONFIG_FEATURE_PS_WIDE=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_PS_LONG is not set +# CONFIG_BUSYBOX_CONFIG_RENICE is not set +CONFIG_BUSYBOX_CONFIG_BB_SYSCTL=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SHOW_THREADS is not set +# CONFIG_BUSYBOX_CONFIG_WATCH is not set + +# +# Runit Utilities +# +# CONFIG_BUSYBOX_CONFIG_CHPST is not set +# CONFIG_BUSYBOX_CONFIG_SETUIDGID is not set +# CONFIG_BUSYBOX_CONFIG_ENVUIDGID is not set +# CONFIG_BUSYBOX_CONFIG_ENVDIR is not set +# CONFIG_BUSYBOX_CONFIG_SOFTLIMIT is not set +# CONFIG_BUSYBOX_CONFIG_RUNSV is not set +# CONFIG_BUSYBOX_CONFIG_RUNSVDIR is not set +# CONFIG_BUSYBOX_CONFIG_SV is not set +# CONFIG_BUSYBOX_CONFIG_SVLOGD is not set + +# +# Shells +# +CONFIG_BUSYBOX_CONFIG_ASH=y +CONFIG_BUSYBOX_CONFIG_ASH_BASH_COMPAT=y +# CONFIG_BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT is not set +CONFIG_BUSYBOX_CONFIG_ASH_JOB_CONTROL=y +CONFIG_BUSYBOX_CONFIG_ASH_ALIAS=y +CONFIG_BUSYBOX_CONFIG_ASH_GETOPTS=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_ECHO=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF=y +CONFIG_BUSYBOX_CONFIG_ASH_BUILTIN_TEST=y +# CONFIG_BUSYBOX_CONFIG_ASH_HELP is not set +CONFIG_BUSYBOX_CONFIG_ASH_CMDCMD=y +# CONFIG_BUSYBOX_CONFIG_ASH_MAIL is not set +# CONFIG_BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set +# CONFIG_BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT is not set +CONFIG_BUSYBOX_CONFIG_ASH_EXPAND_PRMT=y +# CONFIG_BUSYBOX_CONFIG_CTTYHACK is not set +# CONFIG_BUSYBOX_CONFIG_HUSH is not set +# CONFIG_BUSYBOX_CONFIG_MSH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SH_IS_ASH=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_IS_NONE is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_BASH_IS_ASH is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE=y +CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT=y +CONFIG_BUSYBOX_CONFIG_SH_MATH_SUPPORT_64=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET is not set +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_STANDALONE is not set +CONFIG_BUSYBOX_CONFIG_FEATURE_SH_NOFORK=y +# CONFIG_BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE is not set + +# +# System Logging Utilities +# +# CONFIG_BUSYBOX_CONFIG_KLOGD is not set +CONFIG_BUSYBOX_CONFIG_LOGGER=y +# CONFIG_BUSYBOX_CONFIG_SYSLOGD is not set +# CONFIG_PACKAGE_ca-bundle is not set +# CONFIG_PACKAGE_ca-certificates is not set +# CONFIG_PACKAGE_dnsmasq is not set +# CONFIG_PACKAGE_dnsmasq-dhcpv6 is not set +CONFIG_PACKAGE_dnsmasq-full=y +# CONFIG_PACKAGE_dnsmasq_full_dhcpv6 is not set +# CONFIG_PACKAGE_dnsmasq_full_dnssec is not set +# CONFIG_PACKAGE_dnsmasq_full_auth is not set +CONFIG_PACKAGE_dnsmasq_full_ipset=y +# CONFIG_PACKAGE_dnsmasq_full_conntrack is not set +# CONFIG_PACKAGE_dnsmasq_full_noid is not set +# CONFIG_PACKAGE_dnsmasq_full_broken_rtc is not set +CONFIG_PACKAGE_dropbear=y + +# +# Configuration +# +CONFIG_DROPBEAR_CURVE25519=y +# CONFIG_DROPBEAR_ECC is not set +# CONFIG_DROPBEAR_ZLIB is not set +# CONFIG_PACKAGE_ead is not set +CONFIG_PACKAGE_firewall=y +CONFIG_PACKAGE_fstools=y +CONFIG_PACKAGE_fwtool=y +CONFIG_PACKAGE_jsonfilter=y +CONFIG_PACKAGE_lede-keyring=y +# CONFIG_PACKAGE_libatomic is not set +CONFIG_PACKAGE_libc=y +CONFIG_PACKAGE_libgcc=y +CONFIG_PACKAGE_libpthread=y +# CONFIG_PACKAGE_librt is not set +# CONFIG_PACKAGE_libstdcpp is not set +CONFIG_PACKAGE_logd=y +# CONFIG_PACKAGE_mksh is not set +CONFIG_PACKAGE_mtd=y +CONFIG_PACKAGE_netifd=y +# CONFIG_PACKAGE_nvram is not set +# CONFIG_PACKAGE_om-watchdog is not set +CONFIG_PACKAGE_opkg=y +CONFIG_PACKAGE_procd=y + +# +# Configuration +# +# CONFIG_PROCD_SHOW_BOOT is not set +# CONFIG_PROCD_ZRAM_TMPFS is not set +# CONFIG_PACKAGE_qos-scripts is not set +# CONFIG_PACKAGE_resolveip is not set +# CONFIG_PACKAGE_rpcd is not set +# CONFIG_PACKAGE_snapshot-tool is not set +# CONFIG_PACKAGE_sqm-scripts is not set +# CONFIG_PACKAGE_sqm-scripts-extra is not set +CONFIG_PACKAGE_swconfig=y +CONFIG_PACKAGE_ubox=y +CONFIG_PACKAGE_ubus=y +CONFIG_PACKAGE_ubusd=y +CONFIG_PACKAGE_uci=y +CONFIG_PACKAGE_usign=y +# CONFIG_PACKAGE_wireless-tools is not set +# CONFIG_PACKAGE_zram-swap is not set + +# +# Administration +# + +# +# openwisp +# +# CONFIG_PACKAGE_openwisp-config-cyassl is not set +# CONFIG_PACKAGE_openwisp-config-mbedtls is not set +# CONFIG_PACKAGE_openwisp-config-nossl is not set +# CONFIG_PACKAGE_openwisp-config-openssl is not set + +# +# zabbix +# +# CONFIG_PACKAGE_zabbix-agentd is not set +# CONFIG_PACKAGE_zabbix-extra-mac80211 is not set +# CONFIG_PACKAGE_zabbix-extra-network is not set +# CONFIG_PACKAGE_zabbix-extra-wifi is not set +# CONFIG_PACKAGE_zabbix-get is not set +# CONFIG_PACKAGE_zabbix-proxy is not set +# CONFIG_PACKAGE_zabbix-sender is not set +# CONFIG_PACKAGE_zabbix-server is not set +# CONFIG_PACKAGE_htop is not set +# CONFIG_PACKAGE_ipmitool is not set +# CONFIG_PACKAGE_monit is not set +# CONFIG_PACKAGE_monit-nossl is not set +# CONFIG_PACKAGE_muninlite is not set +# CONFIG_PACKAGE_netdata is not set +# CONFIG_PACKAGE_sudo is not set +# CONFIG_PACKAGE_syslog-ng is not set + +# +# Boot Loaders +# + +# +# Development +# + +# +# Libraries +# +# CONFIG_PACKAGE_ar is not set +# CONFIG_PACKAGE_autoconf is not set +# CONFIG_PACKAGE_automake is not set +# CONFIG_PACKAGE_binutils is not set +# CONFIG_PACKAGE_diffutils is not set +# CONFIG_PACKAGE_gcc is not set +# CONFIG_PACKAGE_gdb is not set +# CONFIG_PACKAGE_gdbserver is not set +# CONFIG_PACKAGE_libtool-bin is not set +# CONFIG_PACKAGE_lpc21isp is not set +# CONFIG_PACKAGE_lttng-tools is not set +# CONFIG_PACKAGE_m4 is not set +# CONFIG_PACKAGE_make is not set +# CONFIG_PACKAGE_objdump is not set +# CONFIG_PACKAGE_patch is not set +# CONFIG_PACKAGE_perf is not set +# CONFIG_PACKAGE_pkg-config is not set +# CONFIG_PACKAGE_trace-cmd is not set +# CONFIG_PACKAGE_trace-cmd-extra is not set +# CONFIG_PACKAGE_valgrind is not set + +# +# Extra packages +# +# CONFIG_PACKAGE_autosamba is not set +# CONFIG_PACKAGE_he-6in4 is not set +# CONFIG_PACKAGE_k3wifi is not set + +# +# Firmware +# + +# +# ath10k IPQ4019 Boarddata +# +# CONFIG_PACKAGE_aircard-pcmcia-firmware is not set +# CONFIG_PACKAGE_ar3k-firmware is not set +# CONFIG_PACKAGE_ath10k-firmware-qca4019 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca6174 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9887 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9887-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9888 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9888-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca988x is not set +# CONFIG_PACKAGE_ath10k-firmware-qca988x-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9984 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca9984-ct is not set +# CONFIG_PACKAGE_ath10k-firmware-qca99x0 is not set +# CONFIG_PACKAGE_ath10k-firmware-qca99x0-ct is not set +# CONFIG_PACKAGE_ath6k-firmware is not set +# CONFIG_PACKAGE_ath9k-htc-firmware is not set +# CONFIG_PACKAGE_b43legacy-firmware is not set +# CONFIG_PACKAGE_bnx2-firmware is not set +# CONFIG_PACKAGE_brcmfmac-firmware-4329-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43362-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43430-sdio is not set +# CONFIG_PACKAGE_brcmfmac-firmware-43602a1-pcie is not set +# CONFIG_PACKAGE_brcmfmac-firmware-4366b1-pcie is not set +# CONFIG_PACKAGE_brcmfmac-firmware-usb is not set +# CONFIG_PACKAGE_brcmsmac-firmware is not set +# CONFIG_PACKAGE_carl9170-firmware is not set +# CONFIG_PACKAGE_e100-firmware is not set +# CONFIG_PACKAGE_edgeport-firmware is not set +# CONFIG_PACKAGE_ibt-firmware is not set +# CONFIG_PACKAGE_iwl3945-firmware is not set +# CONFIG_PACKAGE_iwl4965-firmware is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl100 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl1000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl105 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl135 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl2000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl2030 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl3160 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl3168 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl5000 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl5150 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2a is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6000g2b is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl6050 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7260 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7265 is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl7265d is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl8260c is not set +# CONFIG_PACKAGE_iwlwifi-firmware-iwl8265 is not set +# CONFIG_PACKAGE_libertas-sdio-firmware is not set +# CONFIG_PACKAGE_libertas-spi-firmware is not set +# CONFIG_PACKAGE_libertas-usb-firmware is not set +# CONFIG_PACKAGE_mt7601u-firmware is not set +# CONFIG_PACKAGE_mwifiex-pcie-firmware is not set +# CONFIG_PACKAGE_mwifiex-sdio-firmware is not set +# CONFIG_PACKAGE_mwl8k-firmware is not set +# CONFIG_PACKAGE_p54-pci-firmware is not set +# CONFIG_PACKAGE_p54-spi-firmware is not set +# CONFIG_PACKAGE_p54-usb-firmware is not set +# CONFIG_PACKAGE_prism54-firmware is not set +# CONFIG_PACKAGE_r8169-firmware is not set +# CONFIG_PACKAGE_rt2800-pci-firmware is not set +# CONFIG_PACKAGE_rt2800-usb-firmware is not set +# CONFIG_PACKAGE_rt61-pci-firmware is not set +# CONFIG_PACKAGE_rt73-usb-firmware is not set +# CONFIG_PACKAGE_rtl8188eu-firmware is not set +# CONFIG_PACKAGE_rtl8192ce-firmware is not set +# CONFIG_PACKAGE_rtl8192cu-firmware is not set +# CONFIG_PACKAGE_rtl8192de-firmware is not set +# CONFIG_PACKAGE_rtl8192se-firmware is not set +# CONFIG_PACKAGE_rtl8192su-firmware is not set +# CONFIG_PACKAGE_rtl8821ae-firmware is not set +CONFIG_PACKAGE_wireless-regdb=y +# CONFIG_PACKAGE_wl12xx-firmware is not set +# CONFIG_PACKAGE_wl18xx-firmware is not set + +# +# Fonts +# + +# +# DejaVu +# +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuMathTeXGyre is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-ExtraLight is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSans-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansCondensed-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-BoldOblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSansMono-Oblique is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-BoldItalic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerif-Italic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-Bold is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-BoldItalic is not set +# CONFIG_PACKAGE_dejavu-fonts-ttf-DejaVuSerifCondensed-Italic is not set + +# +# Kernel modules +# + +# +# Block Devices +# +# CONFIG_PACKAGE_kmod-aoe is not set +# CONFIG_PACKAGE_kmod-ata-core is not set +# CONFIG_PACKAGE_kmod-block2mtd is not set +# CONFIG_PACKAGE_kmod-dm is not set +# CONFIG_PACKAGE_kmod-loop is not set +# CONFIG_PACKAGE_kmod-md-mod is not set +# CONFIG_PACKAGE_kmod-nbd is not set +# CONFIG_PACKAGE_kmod-scsi-cdrom is not set +# CONFIG_PACKAGE_kmod-scsi-core is not set +# CONFIG_PACKAGE_kmod-scsi-generic is not set +# CONFIG_PACKAGE_kmod-scsi-tape is not set + +# +# CAN Support +# +# CONFIG_PACKAGE_kmod-can is not set + +# +# Cryptographic API modules +# +# CONFIG_PACKAGE_kmod-crypto-aead is not set +# CONFIG_PACKAGE_kmod-crypto-authenc is not set +# CONFIG_PACKAGE_kmod-crypto-cbc is not set +# CONFIG_PACKAGE_kmod-crypto-ccm is not set +# CONFIG_PACKAGE_kmod-crypto-cmac is not set +# CONFIG_PACKAGE_kmod-crypto-crc32c is not set +# CONFIG_PACKAGE_kmod-crypto-ctr is not set +# CONFIG_PACKAGE_kmod-crypto-cts is not set +# CONFIG_PACKAGE_kmod-crypto-deflate is not set +# CONFIG_PACKAGE_kmod-crypto-des is not set +# CONFIG_PACKAGE_kmod-crypto-ecb is not set +# CONFIG_PACKAGE_kmod-crypto-echainiv is not set +# CONFIG_PACKAGE_kmod-crypto-fcrypt is not set +# CONFIG_PACKAGE_kmod-crypto-gcm is not set +# CONFIG_PACKAGE_kmod-crypto-gf128 is not set +# CONFIG_PACKAGE_kmod-crypto-ghash is not set +# CONFIG_PACKAGE_kmod-crypto-hash is not set +# CONFIG_PACKAGE_kmod-crypto-hmac is not set +# CONFIG_PACKAGE_kmod-crypto-hw-ccp is not set +# CONFIG_PACKAGE_kmod-crypto-hw-geode is not set +# CONFIG_PACKAGE_kmod-crypto-hw-hifn-795x is not set +# CONFIG_PACKAGE_kmod-crypto-hw-padlock is not set +# CONFIG_PACKAGE_kmod-crypto-hw-talitos is not set +# CONFIG_PACKAGE_kmod-crypto-manager is not set +# CONFIG_PACKAGE_kmod-crypto-md4 is not set +# CONFIG_PACKAGE_kmod-crypto-md5 is not set +# CONFIG_PACKAGE_kmod-crypto-michael-mic is not set +# CONFIG_PACKAGE_kmod-crypto-misc is not set +# CONFIG_PACKAGE_kmod-crypto-null is not set +# CONFIG_PACKAGE_kmod-crypto-pcbc is not set +# CONFIG_PACKAGE_kmod-crypto-pcompress is not set +# CONFIG_PACKAGE_kmod-crypto-rng is not set +# CONFIG_PACKAGE_kmod-crypto-seqiv is not set +# CONFIG_PACKAGE_kmod-crypto-sha1 is not set +# CONFIG_PACKAGE_kmod-crypto-sha256 is not set +# CONFIG_PACKAGE_kmod-crypto-sha512 is not set +# CONFIG_PACKAGE_kmod-crypto-test is not set +# CONFIG_PACKAGE_kmod-crypto-user is not set +# CONFIG_PACKAGE_kmod-crypto-wq is not set +# CONFIG_PACKAGE_kmod-crypto-xts is not set +# CONFIG_PACKAGE_kmod-cryptodev is not set + +# +# Filesystems +# +# CONFIG_PACKAGE_kmod-fs-afs is not set +# CONFIG_PACKAGE_kmod-fs-autofs4 is not set +# CONFIG_PACKAGE_kmod-fs-btrfs is not set +# CONFIG_PACKAGE_kmod-fs-cifs is not set +# CONFIG_PACKAGE_kmod-fs-configfs is not set +# CONFIG_PACKAGE_kmod-fs-cramfs is not set +# CONFIG_PACKAGE_kmod-fs-exfat is not set +# CONFIG_PACKAGE_kmod-fs-exportfs is not set +# CONFIG_PACKAGE_kmod-fs-ext4 is not set +# CONFIG_PACKAGE_kmod-fs-f2fs is not set +# CONFIG_PACKAGE_kmod-fs-fscache is not set +# CONFIG_PACKAGE_kmod-fs-hfs is not set +# CONFIG_PACKAGE_kmod-fs-hfsplus is not set +# CONFIG_PACKAGE_kmod-fs-isofs is not set +# CONFIG_PACKAGE_kmod-fs-jfs is not set +# CONFIG_PACKAGE_kmod-fs-minix is not set +# CONFIG_PACKAGE_kmod-fs-msdos is not set +# CONFIG_PACKAGE_kmod-fs-nfs is not set +# CONFIG_PACKAGE_kmod-fs-nfs-common is not set +# CONFIG_PACKAGE_kmod-fs-nfs-common-rpcsec is not set +# CONFIG_PACKAGE_kmod-fs-nfs-v3 is not set +# CONFIG_PACKAGE_kmod-fs-nfs-v4 is not set +# CONFIG_PACKAGE_kmod-fs-nfsd is not set +# CONFIG_PACKAGE_kmod-fs-ntfs is not set +# CONFIG_PACKAGE_kmod-fs-reiserfs is not set +# CONFIG_PACKAGE_kmod-fs-squashfs is not set +# CONFIG_PACKAGE_kmod-fs-udf is not set +# CONFIG_PACKAGE_kmod-fs-vfat is not set +# CONFIG_PACKAGE_kmod-fs-xfs is not set +# CONFIG_PACKAGE_kmod-fuse is not set + +# +# FireWire support +# +# CONFIG_PACKAGE_kmod-firewire is not set + +# +# Hardware Monitoring Support +# +# CONFIG_PACKAGE_kmod-hwmon-core is not set + +# +# I2C support +# +# CONFIG_PACKAGE_kmod-i2c-core is not set +# CONFIG_PACKAGE_kmod-i2c-gpio-custom is not set + +# +# Industrial I/O Modules +# +# CONFIG_PACKAGE_kmod-iio-ad799x is not set +# CONFIG_PACKAGE_kmod-iio-core is not set +# CONFIG_PACKAGE_kmod-iio-dht11 is not set + +# +# Input modules +# +# CONFIG_PACKAGE_kmod-hid is not set +# CONFIG_PACKAGE_kmod-hid-generic is not set +# CONFIG_PACKAGE_kmod-input-core is not set +# CONFIG_PACKAGE_kmod-input-evdev is not set +# CONFIG_PACKAGE_kmod-input-gpio-encoder is not set +# CONFIG_PACKAGE_kmod-input-gpio-keys is not set +# CONFIG_PACKAGE_kmod-input-gpio-keys-polled is not set +# CONFIG_PACKAGE_kmod-input-joydev is not set +# CONFIG_PACKAGE_kmod-input-matrixkmap is not set +# CONFIG_PACKAGE_kmod-input-polldev is not set +# CONFIG_PACKAGE_kmod-input-uinput is not set + +# +# LED modules +# +# CONFIG_PACKAGE_kmod-leds-gpio is not set +# CONFIG_PACKAGE_kmod-leds-nu801 is not set +# CONFIG_PACKAGE_kmod-leds-pca963x is not set +# CONFIG_PACKAGE_kmod-leds-rb750 is not set +# CONFIG_PACKAGE_kmod-leds-wndr3700-usb is not set +# CONFIG_PACKAGE_kmod-ledtrig-default-on is not set +# CONFIG_PACKAGE_kmod-ledtrig-gpio is not set +# CONFIG_PACKAGE_kmod-ledtrig-heartbeat is not set +# CONFIG_PACKAGE_kmod-ledtrig-netdev is not set +# CONFIG_PACKAGE_kmod-ledtrig-oneshot is not set +# CONFIG_PACKAGE_kmod-ledtrig-timer is not set +# CONFIG_PACKAGE_kmod-ledtrig-transient is not set + +# +# Libraries +# +# CONFIG_PACKAGE_kmod-lib-cordic is not set +CONFIG_PACKAGE_kmod-lib-crc-ccitt=y +# CONFIG_PACKAGE_kmod-lib-crc-itu-t is not set +# CONFIG_PACKAGE_kmod-lib-crc16 is not set +# CONFIG_PACKAGE_kmod-lib-crc32c is not set +# CONFIG_PACKAGE_kmod-lib-crc7 is not set +# CONFIG_PACKAGE_kmod-lib-crc8 is not set +# CONFIG_PACKAGE_kmod-lib-textsearch is not set + +# +# Native Language Support +# +CONFIG_PACKAGE_kmod-nls-base=y +# CONFIG_PACKAGE_kmod-nls-cp1250 is not set +# CONFIG_PACKAGE_kmod-nls-cp1251 is not set +# CONFIG_PACKAGE_kmod-nls-cp437 is not set +# CONFIG_PACKAGE_kmod-nls-cp775 is not set +# CONFIG_PACKAGE_kmod-nls-cp850 is not set +# CONFIG_PACKAGE_kmod-nls-cp852 is not set +# CONFIG_PACKAGE_kmod-nls-cp862 is not set +# CONFIG_PACKAGE_kmod-nls-cp864 is not set +# CONFIG_PACKAGE_kmod-nls-cp866 is not set +# CONFIG_PACKAGE_kmod-nls-cp932 is not set +# CONFIG_PACKAGE_kmod-nls-cp936 is not set +# CONFIG_PACKAGE_kmod-nls-cp950 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-1 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-13 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-15 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-2 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-6 is not set +# CONFIG_PACKAGE_kmod-nls-iso8859-8 is not set +# CONFIG_PACKAGE_kmod-nls-koi8r is not set +# CONFIG_PACKAGE_kmod-nls-utf8 is not set + +# +# Netfilter Extensions +# +# CONFIG_PACKAGE_kmod-arptables is not set +# CONFIG_PACKAGE_kmod-ebtables is not set +# CONFIG_PACKAGE_kmod-ip6tables is not set +# CONFIG_PACKAGE_kmod-ip6tables-extra is not set +# CONFIG_PACKAGE_kmod-ipt-account is not set +# CONFIG_PACKAGE_kmod-ipt-chaos is not set +# CONFIG_PACKAGE_kmod-ipt-checksum is not set +# CONFIG_PACKAGE_kmod-ipt-cluster is not set +# CONFIG_PACKAGE_kmod-ipt-clusterip is not set +# CONFIG_PACKAGE_kmod-ipt-compat-xtables is not set +# CONFIG_PACKAGE_kmod-ipt-condition is not set +CONFIG_PACKAGE_kmod-ipt-conntrack=y +# CONFIG_PACKAGE_kmod-ipt-conntrack-extra is not set +CONFIG_PACKAGE_kmod-ipt-core=y +# CONFIG_PACKAGE_kmod-ipt-debug is not set +# CONFIG_PACKAGE_kmod-ipt-delude is not set +# CONFIG_PACKAGE_kmod-ipt-dhcpmac is not set +# CONFIG_PACKAGE_kmod-ipt-dnetmap is not set +# CONFIG_PACKAGE_kmod-ipt-extra is not set +# CONFIG_PACKAGE_kmod-ipt-filter is not set +# CONFIG_PACKAGE_kmod-ipt-fuzzy is not set +# CONFIG_PACKAGE_kmod-ipt-geoip is not set +# CONFIG_PACKAGE_kmod-ipt-hashlimit is not set +# CONFIG_PACKAGE_kmod-ipt-iface is not set +# CONFIG_PACKAGE_kmod-ipt-ipmark is not set +# CONFIG_PACKAGE_kmod-ipt-ipopt is not set +# CONFIG_PACKAGE_kmod-ipt-ipp2p is not set +# CONFIG_PACKAGE_kmod-ipt-iprange is not set +# CONFIG_PACKAGE_kmod-ipt-ipsec is not set +CONFIG_PACKAGE_kmod-ipt-ipset=y +# CONFIG_PACKAGE_kmod-ipt-ipv4options is not set +# CONFIG_PACKAGE_kmod-ipt-led is not set +# CONFIG_PACKAGE_kmod-ipt-length2 is not set +# CONFIG_PACKAGE_kmod-ipt-logmark is not set +# CONFIG_PACKAGE_kmod-ipt-lscan is not set +# CONFIG_PACKAGE_kmod-ipt-lua is not set +CONFIG_PACKAGE_kmod-ipt-nat=y +# CONFIG_PACKAGE_kmod-ipt-nat-extra is not set +# CONFIG_PACKAGE_kmod-ipt-nat6 is not set +# CONFIG_PACKAGE_kmod-ipt-nathelper-rtsp is not set +# CONFIG_PACKAGE_kmod-ipt-nflog is not set +# CONFIG_PACKAGE_kmod-ipt-nfqueue is not set +# CONFIG_PACKAGE_kmod-ipt-psd is not set +# CONFIG_PACKAGE_kmod-ipt-quota2 is not set +# CONFIG_PACKAGE_kmod-ipt-raw is not set +# CONFIG_PACKAGE_kmod-ipt-raw6 is not set +# CONFIG_PACKAGE_kmod-ipt-rpfilter is not set +# CONFIG_PACKAGE_kmod-ipt-sysrq is not set +# CONFIG_PACKAGE_kmod-ipt-tarpit is not set +# CONFIG_PACKAGE_kmod-ipt-tee is not set +# CONFIG_PACKAGE_kmod-ipt-tproxy is not set +# CONFIG_PACKAGE_kmod-ipt-u32 is not set +# CONFIG_PACKAGE_kmod-ipt-ulog is not set +CONFIG_PACKAGE_kmod-nf-conntrack=y +# CONFIG_PACKAGE_kmod-nf-conntrack-netlink is not set +CONFIG_PACKAGE_kmod-nf-conntrack6=y +CONFIG_PACKAGE_kmod-nf-ipt=y +CONFIG_PACKAGE_kmod-nf-ipt6=y +CONFIG_PACKAGE_kmod-nf-nat=y +# CONFIG_PACKAGE_kmod-nf-nat6 is not set +# CONFIG_PACKAGE_kmod-nf-nathelper is not set +# CONFIG_PACKAGE_kmod-nf-nathelper-extra is not set +CONFIG_PACKAGE_kmod-nfnetlink=y +# CONFIG_PACKAGE_kmod-nfnetlink-log is not set +# CONFIG_PACKAGE_kmod-nfnetlink-queue is not set +# CONFIG_PACKAGE_kmod-nft-core is not set +# CONFIG_PACKAGE_kmod-nft-nat is not set +# CONFIG_PACKAGE_kmod-nft-nat6 is not set + +# +# Network Devices +# +# CONFIG_PACKAGE_kmod-3c59x is not set +# CONFIG_PACKAGE_kmod-8139cp is not set +# CONFIG_PACKAGE_kmod-8139too is not set +# CONFIG_PACKAGE_kmod-atl1 is not set +# CONFIG_PACKAGE_kmod-atl1c is not set +# CONFIG_PACKAGE_kmod-atl1e is not set +# CONFIG_PACKAGE_kmod-atl2 is not set +# CONFIG_PACKAGE_kmod-b44 is not set +# CONFIG_PACKAGE_kmod-bnx2 is not set +# CONFIG_PACKAGE_kmod-dm9000 is not set +# CONFIG_PACKAGE_kmod-dummy is not set +# CONFIG_PACKAGE_kmod-e100 is not set +# CONFIG_PACKAGE_kmod-e1000 is not set +# CONFIG_PACKAGE_kmod-et131x is not set +# CONFIG_PACKAGE_kmod-ethoc is not set +# CONFIG_PACKAGE_kmod-forcedeth is not set +# CONFIG_PACKAGE_kmod-gigaset is not set +# CONFIG_PACKAGE_kmod-hfcmulti is not set +# CONFIG_PACKAGE_kmod-hfcpci is not set +# CONFIG_PACKAGE_kmod-ifb is not set +# CONFIG_PACKAGE_kmod-igb is not set +# CONFIG_PACKAGE_kmod-ixgbe is not set +# CONFIG_PACKAGE_kmod-ixgbevf is not set +# CONFIG_PACKAGE_kmod-libphy is not set +# CONFIG_PACKAGE_kmod-macvlan is not set +# CONFIG_PACKAGE_kmod-mii is not set +# CONFIG_PACKAGE_kmod-natsemi is not set +# CONFIG_PACKAGE_kmod-ne2k-pci is not set +# CONFIG_PACKAGE_kmod-niu is not set +# CONFIG_PACKAGE_kmod-of-mdio is not set +# CONFIG_PACKAGE_kmod-pcnet32 is not set +# CONFIG_PACKAGE_kmod-phy-broadcom is not set +# CONFIG_PACKAGE_kmod-r6040 is not set +# CONFIG_PACKAGE_kmod-r8169 is not set +# CONFIG_PACKAGE_kmod-siit is not set +# CONFIG_PACKAGE_kmod-sis190 is not set +# CONFIG_PACKAGE_kmod-sis900 is not set +# CONFIG_PACKAGE_kmod-skge is not set +# CONFIG_PACKAGE_kmod-sky2 is not set +# CONFIG_PACKAGE_kmod-solos-pci is not set +# CONFIG_PACKAGE_kmod-spi-ks8995 is not set +# CONFIG_PACKAGE_kmod-swconfig is not set +# CONFIG_PACKAGE_kmod-switch-ip17xx is not set +# CONFIG_PACKAGE_kmod-switch-mvsw61xx is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366-smi is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366rb is not set +# CONFIG_PACKAGE_kmod-switch-rtl8366s is not set +# CONFIG_PACKAGE_kmod-switch-rtl8367b is not set +# CONFIG_PACKAGE_kmod-tg3 is not set +# CONFIG_PACKAGE_kmod-tulip is not set +# CONFIG_PACKAGE_kmod-via-rhine is not set +# CONFIG_PACKAGE_kmod-via-velocity is not set +# CONFIG_PACKAGE_kmod-vmxnet3 is not set + +# +# Network Support +# +# CONFIG_PACKAGE_kmod-appletalk is not set +# CONFIG_PACKAGE_kmod-atm is not set +# CONFIG_PACKAGE_kmod-ax25 is not set +# CONFIG_PACKAGE_kmod-batman-adv is not set +# CONFIG_PACKAGE_kmod-bonding is not set +# CONFIG_PACKAGE_kmod-capi is not set +# CONFIG_PACKAGE_kmod-dnsresolver is not set +# CONFIG_PACKAGE_kmod-fast-classifier is not set +# CONFIG_PACKAGE_kmod-gre is not set +# CONFIG_PACKAGE_kmod-gre6 is not set +# CONFIG_PACKAGE_kmod-ip6-tunnel is not set +# CONFIG_PACKAGE_kmod-ipip is not set +# CONFIG_PACKAGE_kmod-ipsec is not set +# CONFIG_PACKAGE_kmod-iptunnel6 is not set +# CONFIG_PACKAGE_kmod-isdn4linux is not set +# CONFIG_PACKAGE_kmod-jool is not set +# CONFIG_PACKAGE_kmod-l2tp is not set +# CONFIG_PACKAGE_kmod-l2tp-eth is not set +# CONFIG_PACKAGE_kmod-l2tp-ip is not set +# CONFIG_PACKAGE_kmod-misdn is not set +# CONFIG_PACKAGE_kmod-mpls is not set +CONFIG_PACKAGE_kmod-ppp=y +# CONFIG_PACKAGE_kmod-mppe is not set +# CONFIG_PACKAGE_kmod-nat46 is not set +# CONFIG_PACKAGE_kmod-netem is not set +# CONFIG_PACKAGE_kmod-nlmon is not set +# CONFIG_PACKAGE_kmod-openvswitch is not set +# CONFIG_PACKAGE_kmod-pktgen is not set +# CONFIG_PACKAGE_kmod-ppp-synctty is not set +# CONFIG_PACKAGE_kmod-pppoa is not set +CONFIG_PACKAGE_kmod-pppoe=y +# CONFIG_PACKAGE_kmod-pppol2tp is not set +CONFIG_PACKAGE_kmod-pppox=y +# CONFIG_PACKAGE_kmod-pptp is not set +# CONFIG_PACKAGE_kmod-sched is not set +# CONFIG_PACKAGE_kmod-sched-cake is not set +# CONFIG_PACKAGE_kmod-sched-connmark is not set +# CONFIG_PACKAGE_kmod-sched-core is not set +# CONFIG_PACKAGE_kmod-sctp is not set +# CONFIG_PACKAGE_kmod-shortcut-fe is not set +# CONFIG_PACKAGE_kmod-shortcut-fe-cm is not set +# CONFIG_PACKAGE_kmod-sit is not set +CONFIG_PACKAGE_kmod-slhc=y +# CONFIG_PACKAGE_kmod-slip is not set +# CONFIG_PACKAGE_kmod-trelay is not set +# CONFIG_PACKAGE_kmod-tun is not set +# CONFIG_PACKAGE_kmod-veth is not set +# CONFIG_PACKAGE_kmod-vxlan is not set +# CONFIG_PACKAGE_kmod-wireguard is not set + +# +# Other modules +# +# CONFIG_PACKAGE_kmod-6lowpan is not set +# CONFIG_PACKAGE_kmod-ath3k is not set +# CONFIG_PACKAGE_kmod-bcma is not set +# CONFIG_PACKAGE_kmod-bluetooth is not set +# CONFIG_PACKAGE_kmod-bluetooth_6lowpan is not set +# CONFIG_PACKAGE_kmod-bmp085 is not set +# CONFIG_PACKAGE_kmod-bmp085-i2c is not set +# CONFIG_PACKAGE_kmod-bmp085-spi is not set +# CONFIG_PACKAGE_kmod-btmrvl is not set +# CONFIG_PACKAGE_kmod-button-hotplug is not set +# CONFIG_PACKAGE_kmod-echo is not set +# CONFIG_PACKAGE_kmod-eeprom-93cx6 is not set +# CONFIG_PACKAGE_kmod-eeprom-at24 is not set +# CONFIG_PACKAGE_kmod-eeprom-at25 is not set +# CONFIG_PACKAGE_kmod-gpio-beeper is not set +CONFIG_PACKAGE_kmod-gpio-button-hotplug=y +# CONFIG_PACKAGE_kmod-gpio-dev is not set +# CONFIG_PACKAGE_kmod-gpio-mcp23s08 is not set +# CONFIG_PACKAGE_kmod-gpio-nxp-74hc164 is not set +# CONFIG_PACKAGE_kmod-gpio-pca953x is not set +# CONFIG_PACKAGE_kmod-gpio-pcf857x is not set +# CONFIG_PACKAGE_kmod-ikconfig is not set +# CONFIG_PACKAGE_kmod-it87-wdt is not set +# CONFIG_PACKAGE_kmod-itco-wdt is not set +# CONFIG_PACKAGE_kmod-lp is not set +# CONFIG_PACKAGE_kmod-mmc is not set +# CONFIG_PACKAGE_kmod-mtd-rw is not set +# CONFIG_PACKAGE_kmod-mtdoops is not set +# CONFIG_PACKAGE_kmod-mtdtests is not set +# CONFIG_PACKAGE_kmod-pps is not set +# CONFIG_PACKAGE_kmod-pps-gpio is not set +# CONFIG_PACKAGE_kmod-pps-ldisc is not set +# CONFIG_PACKAGE_kmod-ptp is not set +# CONFIG_PACKAGE_kmod-random-core is not set +# CONFIG_PACKAGE_kmod-regmap is not set +# CONFIG_PACKAGE_kmod-rotary-gpio-custom is not set +# CONFIG_PACKAGE_kmod-rtc-ds1307 is not set +# CONFIG_PACKAGE_kmod-rtc-ds1374 is not set +# CONFIG_PACKAGE_kmod-rtc-ds1672 is not set +# CONFIG_PACKAGE_kmod-rtc-isl1208 is not set +# CONFIG_PACKAGE_kmod-rtc-pcf2123 is not set +# CONFIG_PACKAGE_kmod-rtc-pcf8563 is not set +# CONFIG_PACKAGE_kmod-rtc-pt7c4338 is not set +# CONFIG_PACKAGE_kmod-rtc-rs5c372a is not set +# CONFIG_PACKAGE_kmod-sdhci is not set +# CONFIG_PACKAGE_kmod-serial-8250 is not set +# CONFIG_PACKAGE_kmod-softdog is not set +# CONFIG_PACKAGE_kmod-ssb is not set +# CONFIG_PACKAGE_kmod-tpm is not set +# CONFIG_PACKAGE_kmod-tpm-i2c-atmel is not set +# CONFIG_PACKAGE_kmod-tpm-i2c-infineon is not set +# CONFIG_PACKAGE_kmod-w83627hf-wdt is not set +# CONFIG_PACKAGE_kmod-zram is not set + +# +# PCMCIA support +# + +# +# SPI Support +# +# CONFIG_PACKAGE_kmod-mmc-spi is not set +# CONFIG_PACKAGE_kmod-spi-bitbang is not set +# CONFIG_PACKAGE_kmod-spi-dev is not set +# CONFIG_PACKAGE_kmod-spi-gpio is not set +# CONFIG_PACKAGE_kmod-spi-gpio-custom is not set +# CONFIG_PACKAGE_kmod-spi-gpio-old is not set +# CONFIG_PACKAGE_kmod-spi-vsc7385 is not set + +# +# Sound Support +# +# CONFIG_PACKAGE_kmod-sound-core is not set + +# +# USB Support +# +# CONFIG_PACKAGE_kmod-usb-acm is not set +# CONFIG_PACKAGE_kmod-usb-atm is not set +# CONFIG_PACKAGE_kmod-usb-chipidea is not set +# CONFIG_PACKAGE_kmod-usb-cm109 is not set +CONFIG_PACKAGE_kmod-usb-core=y +# CONFIG_PACKAGE_kmod-usb-dwc2 is not set +# CONFIG_PACKAGE_kmod-usb-dwc3 is not set +# CONFIG_PACKAGE_kmod-usb-dwc3-of-simple is not set +CONFIG_PACKAGE_kmod-usb-ehci=y +# CONFIG_PACKAGE_kmod-usb-gadget-ehci-debug is not set +# CONFIG_PACKAGE_kmod-usb-gadget-eth is not set +# CONFIG_PACKAGE_kmod-usb-gadget-mass-storage is not set +# CONFIG_PACKAGE_kmod-usb-gadget-serial is not set +# CONFIG_PACKAGE_kmod-usb-hid is not set +# CONFIG_PACKAGE_kmod-usb-ledtrig-usbport is not set +# CONFIG_PACKAGE_kmod-usb-net is not set +# CONFIG_PACKAGE_kmod-usb-net2280 is not set +# CONFIG_PACKAGE_kmod-usb-ohci is not set +# CONFIG_PACKAGE_kmod-usb-ohci-pci is not set +# CONFIG_PACKAGE_kmod-usb-phy-qcom-ipq4019 is not set +# CONFIG_PACKAGE_kmod-usb-printer is not set +# CONFIG_PACKAGE_kmod-usb-serial is not set +# CONFIG_PACKAGE_kmod-usb-storage is not set +# CONFIG_PACKAGE_kmod-usb-storage-extras is not set +# CONFIG_PACKAGE_kmod-usb-storage-uas is not set +# CONFIG_PACKAGE_kmod-usb-uhci is not set +# CONFIG_PACKAGE_kmod-usb-wdm is not set +# CONFIG_PACKAGE_kmod-usb-yealink is not set +CONFIG_PACKAGE_kmod-usb2=y +# CONFIG_PACKAGE_kmod-usb2-pci is not set +# CONFIG_PACKAGE_kmod-usb3 is not set +# CONFIG_PACKAGE_kmod-usbip is not set +# CONFIG_PACKAGE_kmod-usbip-client is not set +# CONFIG_PACKAGE_kmod-usbip-server is not set +# CONFIG_PACKAGE_kmod-usbmon is not set + +# +# Video Support +# +# CONFIG_PACKAGE_kmod-video-core is not set + +# +# Virtualization +# + +# +# Voice over IP +# +# CONFIG_PACKAGE_kmod-dahdi is not set + +# +# W1 support +# +# CONFIG_PACKAGE_kmod-w1 is not set + +# +# WPAN 802.15.4 Support +# +# CONFIG_PACKAGE_kmod-at86rf230 is not set +# CONFIG_PACKAGE_kmod-cc2520 is not set +# CONFIG_PACKAGE_kmod-fakelb is not set +# CONFIG_PACKAGE_kmod-ieee802154 is not set +# CONFIG_PACKAGE_kmod-ieee802154_6lowpan is not set +# CONFIG_PACKAGE_kmod-mac802154 is not set +# CONFIG_PACKAGE_kmod-mrf24j40 is not set + +# +# Wireless Drivers +# +# CONFIG_PACKAGE_kmod-adm8211 is not set +CONFIG_PACKAGE_kmod-ath=y +CONFIG_ATH_USER_REGD=y +# CONFIG_PACKAGE_ATH_DEBUG is not set +CONFIG_PACKAGE_ATH_DFS=y +# CONFIG_PACKAGE_kmod-ath10k is not set +# CONFIG_PACKAGE_kmod-ath10k-ct is not set +# CONFIG_PACKAGE_kmod-ath5k is not set +# CONFIG_PACKAGE_kmod-ath6kl-sdio is not set +# CONFIG_PACKAGE_kmod-ath6kl-usb is not set +CONFIG_PACKAGE_kmod-ath9k=y +# CONFIG_ATH9K_SUPPORT_PCOEM is not set +# CONFIG_ATH9K_TX99 is not set +CONFIG_PACKAGE_kmod-ath9k-common=y +# CONFIG_PACKAGE_kmod-ath9k-htc is not set +# CONFIG_PACKAGE_kmod-b43 is not set +# CONFIG_PACKAGE_kmod-b43legacy is not set +# CONFIG_PACKAGE_kmod-brcmfmac is not set +# CONFIG_PACKAGE_kmod-brcmsmac is not set +# CONFIG_PACKAGE_kmod-brcmutil is not set +# CONFIG_PACKAGE_kmod-carl9170 is not set +CONFIG_PACKAGE_kmod-cfg80211=y +# CONFIG_PACKAGE_kmod-hermes is not set +# CONFIG_PACKAGE_kmod-hermes-pci is not set +# CONFIG_PACKAGE_kmod-hermes-plx is not set +# CONFIG_PACKAGE_kmod-iwl-legacy is not set +# CONFIG_PACKAGE_kmod-iwl3945 is not set +# CONFIG_PACKAGE_kmod-iwl4965 is not set +# CONFIG_PACKAGE_kmod-iwlwifi is not set +# CONFIG_PACKAGE_kmod-lib80211 is not set +# CONFIG_PACKAGE_kmod-libertas-sdio is not set +# CONFIG_PACKAGE_kmod-libertas-spi is not set +# CONFIG_PACKAGE_kmod-libertas-usb is not set +CONFIG_PACKAGE_kmod-mac80211=y +CONFIG_PACKAGE_MAC80211_DEBUGFS=y +# CONFIG_PACKAGE_MAC80211_TRACING is not set +CONFIG_PACKAGE_MAC80211_MESH=y +# CONFIG_PACKAGE_kmod-mac80211-hwsim is not set +# CONFIG_PACKAGE_kmod-mt76 is not set +# CONFIG_PACKAGE_kmod-mt76-core is not set +# CONFIG_PACKAGE_kmod-mt7601u is not set +# CONFIG_PACKAGE_kmod-mt7603 is not set +# CONFIG_PACKAGE_kmod-mt76x2 is not set +# CONFIG_PACKAGE_kmod-mwifiex-pcie is not set +# CONFIG_PACKAGE_kmod-mwifiex-sdio is not set +# CONFIG_PACKAGE_kmod-mwl8k is not set +# CONFIG_PACKAGE_kmod-net-prism54 is not set +# CONFIG_PACKAGE_kmod-net-rtl8192su is not set +# CONFIG_PACKAGE_kmod-owl-loader is not set +# CONFIG_PACKAGE_kmod-p54-common is not set +# CONFIG_PACKAGE_kmod-p54-pci is not set +# CONFIG_PACKAGE_kmod-p54-usb is not set +# CONFIG_PACKAGE_kmod-rt2400-pci is not set +# CONFIG_PACKAGE_kmod-rt2500-pci is not set +# CONFIG_PACKAGE_kmod-rt2500-usb is not set +# CONFIG_PACKAGE_kmod-rt2800-pci is not set +# CONFIG_PACKAGE_kmod-rt2800-usb is not set +# CONFIG_PACKAGE_kmod-rt2x00-lib is not set +# CONFIG_PACKAGE_kmod-rt61-pci is not set +# CONFIG_PACKAGE_kmod-rt73-usb is not set +# CONFIG_PACKAGE_kmod-rtl8180 is not set +# CONFIG_PACKAGE_kmod-rtl8187 is not set +# CONFIG_PACKAGE_kmod-rtl8192ce is not set +# CONFIG_PACKAGE_kmod-rtl8192cu is not set +# CONFIG_PACKAGE_kmod-rtl8192de is not set +# CONFIG_PACKAGE_kmod-rtl8192se is not set +# CONFIG_PACKAGE_kmod-rtl8821ae is not set +# CONFIG_PACKAGE_kmod-rtl8xxxu is not set +# CONFIG_PACKAGE_kmod-wl12xx is not set +# CONFIG_PACKAGE_kmod-wl18xx is not set +# CONFIG_PACKAGE_kmod-wlcore is not set +# CONFIG_PACKAGE_kmod-zd1211rw is not set + +# +# Languages +# + +# +# Erlang +# +# CONFIG_PACKAGE_erlang is not set +# CONFIG_PACKAGE_erlang-asn1 is not set +# CONFIG_PACKAGE_erlang-compiler is not set +# CONFIG_PACKAGE_erlang-crypto is not set +# CONFIG_PACKAGE_erlang-hipe is not set +# CONFIG_PACKAGE_erlang-inets is not set +# CONFIG_PACKAGE_erlang-mnesia is not set +# CONFIG_PACKAGE_erlang-runtime-tools is not set +# CONFIG_PACKAGE_erlang-snmp is not set +# CONFIG_PACKAGE_erlang-ssh is not set +# CONFIG_PACKAGE_erlang-ssl is not set +# CONFIG_PACKAGE_erlang-syntax-tools is not set + +# +# Java +# +# CONFIG_PACKAGE_jamvm is not set + +# +# Lua +# +# CONFIG_PACKAGE_dkjson is not set +# CONFIG_PACKAGE_json4lua is not set +# CONFIG_PACKAGE_ldbus is not set +# CONFIG_PACKAGE_libiwinfo-lua is not set +# CONFIG_PACKAGE_lpeg is not set +# CONFIG_PACKAGE_lsqlite3 is not set +# CONFIG_PACKAGE_lua is not set +# CONFIG_PACKAGE_lua-bencode is not set +# CONFIG_PACKAGE_lua-cjson is not set +# CONFIG_PACKAGE_lua-copas is not set +# CONFIG_PACKAGE_lua-coxpcall is not set +# CONFIG_PACKAGE_lua-lzlib is not set +# CONFIG_PACKAGE_lua-md5 is not set +# CONFIG_PACKAGE_lua-mobdebug is not set +# CONFIG_PACKAGE_lua-mosquitto is not set +# CONFIG_PACKAGE_lua-openssl is not set +# CONFIG_PACKAGE_lua-penlight is not set +# CONFIG_PACKAGE_lua-rings is not set +# CONFIG_PACKAGE_lua-rs232 is not set +# CONFIG_PACKAGE_lua-sha2 is not set +# CONFIG_PACKAGE_lua-wsapi-base is not set +# CONFIG_PACKAGE_lua-wsapi-xavante is not set +# CONFIG_PACKAGE_lua-xavante is not set +# CONFIG_PACKAGE_luabitop is not set +# CONFIG_PACKAGE_luac is not set +# CONFIG_PACKAGE_luaexpat is not set +# CONFIG_PACKAGE_luafilesystem is not set +# CONFIG_PACKAGE_luai2c is not set +# CONFIG_PACKAGE_luajit is not set +# CONFIG_PACKAGE_lualanes is not set +# CONFIG_PACKAGE_luaposix is not set +# CONFIG_PACKAGE_luarocks is not set +# CONFIG_PACKAGE_luasec is not set +# CONFIG_PACKAGE_luasoap is not set +# CONFIG_PACKAGE_luasocket is not set +# CONFIG_PACKAGE_luasql-mysql is not set +# CONFIG_PACKAGE_luasql-pgsql is not set +# CONFIG_PACKAGE_luasql-sqlite3 is not set +# CONFIG_PACKAGE_luci-lib-fs is not set +# CONFIG_PACKAGE_luv is not set +# CONFIG_PACKAGE_lzmq is not set +# CONFIG_PACKAGE_uuid is not set + +# +# Node.js +# +# CONFIG_PACKAGE_node is not set + +# +# Module Selection +# +# CONFIG_NODEJS_ICU is not set +# CONFIG_PACKAGE_node-arduino-firmata is not set +# CONFIG_PACKAGE_node-cylon is not set +# CONFIG_PACKAGE_node-cylon-firmata is not set +# CONFIG_PACKAGE_node-cylon-gpio is not set +# CONFIG_PACKAGE_node-cylon-i2c is not set +# CONFIG_PACKAGE_node-hid is not set +# CONFIG_PACKAGE_node-npm is not set +# CONFIG_PACKAGE_node-serialport is not set + +# +# PHP +# +# CONFIG_PACKAGE_php7 is not set + +# +# Perl +# +# CONFIG_PACKAGE_perl is not set + +# +# Python +# +# CONFIG_PACKAGE_chardet is not set +# CONFIG_PACKAGE_django is not set +# CONFIG_PACKAGE_django-appconf is not set +# CONFIG_PACKAGE_django-compressor is not set +# CONFIG_PACKAGE_django-constance is not set +# CONFIG_PACKAGE_django-jsonfield is not set +# CONFIG_PACKAGE_django-picklefield is not set +# CONFIG_PACKAGE_django-postoffice is not set +# CONFIG_PACKAGE_django-restframework is not set +# CONFIG_PACKAGE_django-statici18n is not set +# CONFIG_PACKAGE_et_xmlfile is not set +# CONFIG_PACKAGE_flup is not set +# CONFIG_PACKAGE_gunicorn is not set +# CONFIG_PACKAGE_jdcal is not set +# CONFIG_PACKAGE_micropython is not set +# CONFIG_PACKAGE_micropython-lib is not set +# CONFIG_PACKAGE_openpyxl is not set +# CONFIG_PACKAGE_pillow is not set +# CONFIG_PACKAGE_python is not set +# CONFIG_PACKAGE_python-asn1crypto is not set +# CONFIG_PACKAGE_python-attrs is not set +# CONFIG_PACKAGE_python-base is not set +# CONFIG_PACKAGE_python-base-src is not set +# CONFIG_PACKAGE_python-cffi is not set +# CONFIG_PACKAGE_python-codecs is not set +# CONFIG_PACKAGE_python-codecs-src is not set +# CONFIG_PACKAGE_python-compiler is not set +# CONFIG_PACKAGE_python-compiler-src is not set +# CONFIG_PACKAGE_python-crcmod is not set +# CONFIG_PACKAGE_python-crypto is not set +# CONFIG_PACKAGE_python-cryptography is not set +# CONFIG_PACKAGE_python-ctypes is not set +# CONFIG_PACKAGE_python-ctypes-src is not set +# CONFIG_PACKAGE_python-curl is not set +# CONFIG_PACKAGE_python-dateutil is not set +# CONFIG_PACKAGE_python-db is not set +# CONFIG_PACKAGE_python-db-src is not set +# CONFIG_PACKAGE_python-decimal is not set +# CONFIG_PACKAGE_python-decimal-src is not set +# CONFIG_PACKAGE_python-dev is not set +# CONFIG_PACKAGE_python-dev-src is not set +# CONFIG_PACKAGE_python-distutils is not set +# CONFIG_PACKAGE_python-distutils-src is not set +# CONFIG_PACKAGE_python-dns is not set +# CONFIG_PACKAGE_python-dpkt is not set +# CONFIG_PACKAGE_python-egenix-mx-base is not set +# CONFIG_PACKAGE_python-email is not set +# CONFIG_PACKAGE_python-email-src is not set +# CONFIG_PACKAGE_python-enum34 is not set +# CONFIG_PACKAGE_python-evdev is not set +# CONFIG_PACKAGE_python-gdbm is not set +# CONFIG_PACKAGE_python-gdbm-src is not set +# CONFIG_PACKAGE_python-gmpy2 is not set +# CONFIG_PACKAGE_python-gnupg is not set +# CONFIG_PACKAGE_python-idna is not set +# CONFIG_PACKAGE_python-ipaddress is not set +# CONFIG_PACKAGE_python-ldap is not set +# CONFIG_PACKAGE_python-lib2to3 is not set +# CONFIG_PACKAGE_python-lib2to3-src is not set +# CONFIG_PACKAGE_python-light is not set + +# +# Configuration +# +# CONFIG_PYTHON_BLUETOOTH_SUPPORT is not set +# CONFIG_PACKAGE_python-light-src is not set +# CONFIG_PACKAGE_python-logging is not set +# CONFIG_PACKAGE_python-logging-src is not set +# CONFIG_PACKAGE_python-lxml is not set +# CONFIG_PACKAGE_python-multiprocessing is not set +# CONFIG_PACKAGE_python-multiprocessing-src is not set +# CONFIG_PACKAGE_python-mysql is not set +# CONFIG_PACKAGE_python-ncurses is not set +# CONFIG_PACKAGE_python-ncurses-src is not set +# CONFIG_PACKAGE_python-openssl is not set +# CONFIG_PACKAGE_python-openssl-src is not set +# CONFIG_PACKAGE_python-parsley is not set +# CONFIG_PACKAGE_python-pcapy is not set +# CONFIG_PACKAGE_python-pip is not set +# CONFIG_PACKAGE_python-pip-conf is not set +# CONFIG_PACKAGE_python-pip-src is not set +# CONFIG_PACKAGE_python-ply is not set +# CONFIG_PACKAGE_python-psycopg2 is not set +# CONFIG_PACKAGE_python-pyasn1 is not set +# CONFIG_PACKAGE_python-pyasn1-modules is not set +# CONFIG_PACKAGE_python-pycparser is not set +# CONFIG_PACKAGE_python-pydoc is not set +# CONFIG_PACKAGE_python-pydoc-src is not set +# CONFIG_PACKAGE_python-pyodbc is not set +# CONFIG_PACKAGE_python-pyopenssl is not set +# CONFIG_PACKAGE_python-pyptlib is not set +# CONFIG_PACKAGE_python-pyserial is not set +# CONFIG_PACKAGE_python-service-identity is not set +# CONFIG_PACKAGE_python-setuptools is not set +# CONFIG_PACKAGE_python-setuptools-src is not set +# CONFIG_PACKAGE_python-six is not set +# CONFIG_PACKAGE_python-smbus is not set +# CONFIG_PACKAGE_python-sqlite3 is not set +# CONFIG_PACKAGE_python-sqlite3-src is not set +# CONFIG_PACKAGE_python-src is not set +# CONFIG_PACKAGE_python-txsocksx is not set +# CONFIG_PACKAGE_python-unittest is not set +# CONFIG_PACKAGE_python-unittest-src is not set +# CONFIG_PACKAGE_python-urllib3 is not set +# CONFIG_PACKAGE_python-xml is not set +# CONFIG_PACKAGE_python-xml-src is not set +# CONFIG_PACKAGE_python-yaml is not set +# CONFIG_PACKAGE_python3 is not set +# CONFIG_PACKAGE_python3-asn1crypto is not set +# CONFIG_PACKAGE_python3-asyncio is not set +# CONFIG_PACKAGE_python3-asyncio-src is not set +# CONFIG_PACKAGE_python3-base is not set +# CONFIG_PACKAGE_python3-base-src is not set +# CONFIG_PACKAGE_python3-bottle is not set +# CONFIG_PACKAGE_python3-cffi is not set +# CONFIG_PACKAGE_python3-cgi is not set +# CONFIG_PACKAGE_python3-cgi-src is not set +# CONFIG_PACKAGE_python3-cgitb is not set +# CONFIG_PACKAGE_python3-cgitb-src is not set +# CONFIG_PACKAGE_python3-click is not set +# CONFIG_PACKAGE_python3-codecs is not set +# CONFIG_PACKAGE_python3-codecs-src is not set +# CONFIG_PACKAGE_python3-cryptography is not set +# CONFIG_PACKAGE_python3-ctypes is not set +# CONFIG_PACKAGE_python3-ctypes-src is not set +# CONFIG_PACKAGE_python3-dbm is not set +# CONFIG_PACKAGE_python3-dbm-src is not set +# CONFIG_PACKAGE_python3-decimal is not set +# CONFIG_PACKAGE_python3-decimal-src is not set +# CONFIG_PACKAGE_python3-dev is not set +# CONFIG_PACKAGE_python3-dev-src is not set +# CONFIG_PACKAGE_python3-distutils is not set +# CONFIG_PACKAGE_python3-distutils-src is not set +# CONFIG_PACKAGE_python3-email is not set +# CONFIG_PACKAGE_python3-email-src is not set +# CONFIG_PACKAGE_python3-evdev is not set +# CONFIG_PACKAGE_python3-flask is not set +# CONFIG_PACKAGE_python3-gdbm is not set +# CONFIG_PACKAGE_python3-gdbm-src is not set +# CONFIG_PACKAGE_python3-gnupg is not set +# CONFIG_PACKAGE_python3-idna is not set +# CONFIG_PACKAGE_python3-itsdangerous is not set +# CONFIG_PACKAGE_python3-jinja2 is not set +# CONFIG_PACKAGE_python3-lib2to3 is not set +# CONFIG_PACKAGE_python3-lib2to3-src is not set +# CONFIG_PACKAGE_python3-light is not set + +# +# Configuration +# +# CONFIG_PYTHON3_BLUETOOTH_SUPPORT is not set +# CONFIG_PACKAGE_python3-light-src is not set +# CONFIG_PACKAGE_python3-logging is not set +# CONFIG_PACKAGE_python3-logging-src is not set +# CONFIG_PACKAGE_python3-lxml is not set +# CONFIG_PACKAGE_python3-lzma is not set +# CONFIG_PACKAGE_python3-lzma-src is not set +# CONFIG_PACKAGE_python3-markupsafe is not set +# CONFIG_PACKAGE_python3-multiprocessing is not set +# CONFIG_PACKAGE_python3-multiprocessing-src is not set +# CONFIG_PACKAGE_python3-ncurses is not set +# CONFIG_PACKAGE_python3-ncurses-src is not set +# CONFIG_PACKAGE_python3-openssl is not set +# CONFIG_PACKAGE_python3-openssl-src is not set +# CONFIG_PACKAGE_python3-pip is not set +# CONFIG_PACKAGE_python3-pip-src is not set +# CONFIG_PACKAGE_python3-ply is not set +# CONFIG_PACKAGE_python3-pyasn1 is not set +# CONFIG_PACKAGE_python3-pyasn1-modules is not set +# CONFIG_PACKAGE_python3-pycparser is not set +# CONFIG_PACKAGE_python3-pydoc is not set +# CONFIG_PACKAGE_python3-pydoc-src is not set +# CONFIG_PACKAGE_python3-pyodbc is not set +# CONFIG_PACKAGE_python3-pyopenssl is not set +# CONFIG_PACKAGE_python3-setuptools is not set +# CONFIG_PACKAGE_python3-setuptools-src is not set +# CONFIG_PACKAGE_python3-six is not set +# CONFIG_PACKAGE_python3-smbus is not set +# CONFIG_PACKAGE_python3-sqlite3 is not set +# CONFIG_PACKAGE_python3-sqlite3-src is not set +# CONFIG_PACKAGE_python3-src is not set +# CONFIG_PACKAGE_python3-unittest is not set +# CONFIG_PACKAGE_python3-unittest-src is not set +# CONFIG_PACKAGE_python3-werkzeug is not set +# CONFIG_PACKAGE_python3-xml is not set +# CONFIG_PACKAGE_python3-xml-src is not set +# CONFIG_PACKAGE_python3-yaml is not set +# CONFIG_PACKAGE_pytz is not set +# CONFIG_PACKAGE_rcssmin is not set +# CONFIG_PACKAGE_simplejson is not set +# CONFIG_PACKAGE_twisted is not set +# CONFIG_PACKAGE_zope-interface is not set + +# +# Ruby +# +# CONFIG_PACKAGE_ruby is not set + +# +# Tcl +# +# CONFIG_PACKAGE_vala is not set + +# +# Libraries +# + +# +# Compression +# +# CONFIG_PACKAGE_libbz2 is not set +# CONFIG_PACKAGE_liblzma is not set +# CONFIG_PACKAGE_libunrar is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_libacl is not set +# CONFIG_PACKAGE_libattr is not set +# CONFIG_PACKAGE_libext2fs is not set +# CONFIG_PACKAGE_libfuse is not set +# CONFIG_PACKAGE_libow is not set +# CONFIG_PACKAGE_libow-capi is not set +# CONFIG_PACKAGE_libsysfs is not set + +# +# Firewall +# +# CONFIG_PACKAGE_libfko is not set +CONFIG_PACKAGE_libip4tc=y +CONFIG_PACKAGE_libip6tc=y +# CONFIG_PACKAGE_libiptc is not set +CONFIG_PACKAGE_libxtables=y + +# +# Instant Messaging +# +# CONFIG_PACKAGE_quasselc is not set + +# +# IoT +# +# CONFIG_PACKAGE_libupm is not set +# CONFIG_PACKAGE_libupm-a110x is not set +# CONFIG_PACKAGE_libupm-ad8232 is not set +# CONFIG_PACKAGE_libupm-adafruitss is not set +# CONFIG_PACKAGE_libupm-adc121c021 is not set +# CONFIG_PACKAGE_libupm-adis16448 is not set +# CONFIG_PACKAGE_libupm-adxl335 is not set +# CONFIG_PACKAGE_libupm-adxl345 is not set +# CONFIG_PACKAGE_libupm-am2315 is not set +# CONFIG_PACKAGE_libupm-apds9002 is not set +# CONFIG_PACKAGE_libupm-at42qt1070 is not set +# CONFIG_PACKAGE_libupm-biss0001 is not set +# CONFIG_PACKAGE_libupm-bmpx8x is not set +# CONFIG_PACKAGE_libupm-buzzer is not set +# CONFIG_PACKAGE_libupm-cjq4435 is not set +# CONFIG_PACKAGE_libupm-ds1307 is not set +# CONFIG_PACKAGE_libupm-ecs1030 is not set +# CONFIG_PACKAGE_libupm-enc03r is not set +# CONFIG_PACKAGE_libupm-flex is not set +# CONFIG_PACKAGE_libupm-gas is not set +# CONFIG_PACKAGE_libupm-gp2y0a is not set +# CONFIG_PACKAGE_libupm-grove is not set +# CONFIG_PACKAGE_libupm-grovecircularled is not set +# CONFIG_PACKAGE_libupm-grovecollision is not set +# CONFIG_PACKAGE_libupm-groveehr is not set +# CONFIG_PACKAGE_libupm-groveeldriver is not set +# CONFIG_PACKAGE_libupm-groveelectromagnet is not set +# CONFIG_PACKAGE_libupm-groveemg is not set +# CONFIG_PACKAGE_libupm-grovegprs is not set +# CONFIG_PACKAGE_libupm-grovegsr is not set +# CONFIG_PACKAGE_libupm-grovelinefinder is not set +# CONFIG_PACKAGE_libupm-grovemd is not set +# CONFIG_PACKAGE_libupm-grovemoisture is not set +# CONFIG_PACKAGE_libupm-groveo2 is not set +# CONFIG_PACKAGE_libupm-grovescam is not set +# CONFIG_PACKAGE_libupm-grovespeaker is not set +# CONFIG_PACKAGE_libupm-grovevdiv is not set +# CONFIG_PACKAGE_libupm-grovewater is not set +# CONFIG_PACKAGE_libupm-grovewfs is not set +# CONFIG_PACKAGE_libupm-guvas12d is not set +# CONFIG_PACKAGE_libupm-h3lis331dl is not set +# CONFIG_PACKAGE_libupm-hcsr04 is not set +# CONFIG_PACKAGE_libupm-hm11 is not set +# CONFIG_PACKAGE_libupm-hmc5883l is not set +# CONFIG_PACKAGE_libupm-hmtrp is not set +# CONFIG_PACKAGE_libupm-hp20x is not set +# CONFIG_PACKAGE_libupm-ht9170 is not set +# CONFIG_PACKAGE_libupm-htu21d is not set +# CONFIG_PACKAGE_libupm-hx711 is not set +# CONFIG_PACKAGE_libupm-i2clcd is not set +# CONFIG_PACKAGE_libupm-ina132 is not set +# CONFIG_PACKAGE_libupm-isd1820 is not set +# CONFIG_PACKAGE_libupm-itg3200 is not set +# CONFIG_PACKAGE_libupm-joystick12 is not set +# CONFIG_PACKAGE_libupm-l298 is not set +# CONFIG_PACKAGE_libupm-ldt0028 is not set +# CONFIG_PACKAGE_libupm-lm35 is not set +# CONFIG_PACKAGE_libupm-lol is not set +# CONFIG_PACKAGE_libupm-loudness is not set +# CONFIG_PACKAGE_libupm-lpd8806 is not set +# CONFIG_PACKAGE_libupm-lsm303 is not set +# CONFIG_PACKAGE_libupm-lsm9ds0 is not set +# CONFIG_PACKAGE_libupm-m24lr64e is not set +# CONFIG_PACKAGE_libupm-max31723 is not set +# CONFIG_PACKAGE_libupm-max31855 is not set +# CONFIG_PACKAGE_libupm-max44000 is not set +# CONFIG_PACKAGE_libupm-max5487 is not set +# CONFIG_PACKAGE_libupm-maxds3231m is not set +# CONFIG_PACKAGE_libupm-maxsonarez is not set +# CONFIG_PACKAGE_libupm-mg811 is not set +# CONFIG_PACKAGE_libupm-mhz16 is not set +# CONFIG_PACKAGE_libupm-mic is not set +# CONFIG_PACKAGE_libupm-mlx90614 is not set +# CONFIG_PACKAGE_libupm-mma7455 is not set +# CONFIG_PACKAGE_libupm-mma7660 is not set +# CONFIG_PACKAGE_libupm-mpl3115a2 is not set +# CONFIG_PACKAGE_libupm-mpr121 is not set +# CONFIG_PACKAGE_libupm-mpu9150 is not set +# CONFIG_PACKAGE_libupm-mq303a is not set +# CONFIG_PACKAGE_libupm-my9221 is not set +# CONFIG_PACKAGE_libupm-nrf24l01 is not set +# CONFIG_PACKAGE_libupm-nrf8001 is not set +# CONFIG_PACKAGE_libupm-nunchuck is not set +# CONFIG_PACKAGE_libupm-otp538u is not set +# CONFIG_PACKAGE_libupm-pn532 is not set +# CONFIG_PACKAGE_libupm-ppd42ns is not set +# CONFIG_PACKAGE_libupm-pulsensor is not set +# CONFIG_PACKAGE_libupm-rfr359f is not set +# CONFIG_PACKAGE_libupm-rgbringcoder is not set +# CONFIG_PACKAGE_libupm-rotaryencoder is not set +# CONFIG_PACKAGE_libupm-rpr220 is not set +# CONFIG_PACKAGE_libupm-servo is not set +# CONFIG_PACKAGE_libupm-si114x is not set +# CONFIG_PACKAGE_libupm-sm130 is not set +# CONFIG_PACKAGE_libupm-st7735 is not set +# CONFIG_PACKAGE_libupm-stepmotor is not set +# CONFIG_PACKAGE_libupm-sx6119 is not set +# CONFIG_PACKAGE_libupm-ta12200 is not set +# CONFIG_PACKAGE_libupm-tcs3414cs is not set +# CONFIG_PACKAGE_libupm-th02 is not set +# CONFIG_PACKAGE_libupm-tm1637 is not set +# CONFIG_PACKAGE_libupm-tsl2561 is not set +# CONFIG_PACKAGE_libupm-ttp223 is not set +# CONFIG_PACKAGE_libupm-ublox6 is not set +# CONFIG_PACKAGE_libupm-uln200xa is not set +# CONFIG_PACKAGE_libupm-waterlevel is not set +# CONFIG_PACKAGE_libupm-wheelencoder is not set +# CONFIG_PACKAGE_libupm-wt5001 is not set +# CONFIG_PACKAGE_libupm-yg1006 is not set +# CONFIG_PACKAGE_libupm-zfm20 is not set + +# +# Languages +# +# CONFIG_PACKAGE_libyaml is not set + +# +# Networking +# +# CONFIG_PACKAGE_libsctp is not set + +# +# SSL +# +# CONFIG_PACKAGE_libcyassl is not set +# CONFIG_PACKAGE_libgnutls is not set +# CONFIG_PACKAGE_libmbedtls is not set +# CONFIG_PACKAGE_libopenssl is not set + +# +# Sound +# +# CONFIG_PACKAGE_liblo is not set + +# +# Telephony +# +# CONFIG_PACKAGE_bcg729 is not set +# CONFIG_PACKAGE_dahdi-tools-libtonezone is not set +# CONFIG_PACKAGE_gsmlib is not set +# CONFIG_PACKAGE_libctb is not set +# CONFIG_PACKAGE_libiksemel is not set +# CONFIG_PACKAGE_libosip2 is not set +# CONFIG_PACKAGE_libpj is not set +# CONFIG_PACKAGE_libpjlib-util is not set +# CONFIG_PACKAGE_libpjmedia is not set +# CONFIG_PACKAGE_libpjnath is not set +# CONFIG_PACKAGE_libpjsip is not set +# CONFIG_PACKAGE_libpjsip-simple is not set +# CONFIG_PACKAGE_libpjsip-ua is not set +# CONFIG_PACKAGE_libpjsua is not set +# CONFIG_PACKAGE_libpjsua2 is not set +# CONFIG_PACKAGE_libre is not set +# CONFIG_PACKAGE_librem is not set +# CONFIG_PACKAGE_libspandsp is not set +# CONFIG_PACKAGE_libsrtp is not set +# CONFIG_PACKAGE_libsrtp2 is not set + +# +# database +# +# CONFIG_PACKAGE_libpq is not set +# CONFIG_PACKAGE_libsqlite3 is not set +# CONFIG_PACKAGE_pgsqlodbc is not set +# CONFIG_PACKAGE_psqlodbca is not set +# CONFIG_PACKAGE_psqlodbcw is not set +# CONFIG_PACKAGE_tdb is not set +# CONFIG_PACKAGE_unixodbc is not set + +# +# libelektra +# +# CONFIG_PACKAGE_libelektra-boost is not set +# CONFIG_PACKAGE_libelektra-core is not set +# CONFIG_PACKAGE_libelektra-cpp is not set +# CONFIG_PACKAGE_libelektra-crypto is not set +# CONFIG_PACKAGE_libelektra-curlget is not set +# CONFIG_PACKAGE_libelektra-dbus is not set +# CONFIG_PACKAGE_libelektra-extra is not set +# CONFIG_PACKAGE_libelektra-lua is not set +# CONFIG_PACKAGE_libelektra-plugins is not set +# CONFIG_PACKAGE_libelektra-python2 is not set +# CONFIG_PACKAGE_libelektra-python3 is not set +# CONFIG_PACKAGE_libelektra-resolvers is not set +# CONFIG_PACKAGE_libelektra-xerces is not set +# CONFIG_PACKAGE_libelektra-xml is not set +# CONFIG_PACKAGE_libelektra-yajl is not set +# CONFIG_PACKAGE_libelektra-yamlcpp is not set +# CONFIG_PACKAGE_alsa-lib is not set +# CONFIG_PACKAGE_argp-standalone is not set +# CONFIG_PACKAGE_avro-c is not set +# CONFIG_PACKAGE_bind-libs is not set +# CONFIG_PACKAGE_bluez-libs is not set +# CONFIG_PACKAGE_boost is not set +# CONFIG_PACKAGE_ccid is not set +# CONFIG_PACKAGE_check is not set +# CONFIG_PACKAGE_classpath is not set +# CONFIG_PACKAGE_classpath-tools is not set +# CONFIG_PACKAGE_confuse is not set +# CONFIG_PACKAGE_dtndht is not set +# CONFIG_PACKAGE_fcgi is not set +# CONFIG_PACKAGE_fftw3 is not set +# CONFIG_PACKAGE_fftw3f is not set +# CONFIG_PACKAGE_giflib is not set +# CONFIG_PACKAGE_glib2 is not set +# CONFIG_PACKAGE_glog is not set +# CONFIG_PACKAGE_hidapi is not set +# CONFIG_PACKAGE_ibrcommon is not set +# CONFIG_PACKAGE_ibrdtn is not set +# CONFIG_PACKAGE_icu is not set +# CONFIG_PACKAGE_jansson is not set +# CONFIG_PACKAGE_knot-libs is not set +# CONFIG_PACKAGE_knot-libzscanner is not set +# CONFIG_PACKAGE_libaio is not set +# CONFIG_PACKAGE_libantlr3c is not set +# CONFIG_PACKAGE_libao is not set +# CONFIG_PACKAGE_libapr is not set +# CONFIG_PACKAGE_libaprutil is not set +# CONFIG_PACKAGE_libarchive is not set +# CONFIG_PACKAGE_libarchive-noopenssl is not set +# CONFIG_PACKAGE_libartnet is not set +# CONFIG_PACKAGE_libaudiofile is not set +# CONFIG_PACKAGE_libavahi-client is not set +# CONFIG_PACKAGE_libavahi-compat-libdnssd is not set +# CONFIG_PACKAGE_libavahi-dbus-support is not set +# CONFIG_PACKAGE_libavahi-nodbus-support is not set +# CONFIG_PACKAGE_libavl is not set +# CONFIG_PACKAGE_libbfd is not set +# CONFIG_PACKAGE_libblkid is not set +CONFIG_PACKAGE_libblobmsg-json=y +# CONFIG_PACKAGE_libcanfestival is not set +# CONFIG_PACKAGE_libcap is not set +# CONFIG_PACKAGE_libcares is not set +# CONFIG_PACKAGE_libcharset is not set +# CONFIG_PACKAGE_libcoap is not set +# CONFIG_PACKAGE_libconfig is not set +# CONFIG_PACKAGE_libcryptopp is not set +# CONFIG_PACKAGE_libcurl is not set +# CONFIG_PACKAGE_libdaemon is not set +# CONFIG_PACKAGE_libdaq is not set +# CONFIG_PACKAGE_libdb47 is not set +# CONFIG_PACKAGE_libdb47xx is not set +# CONFIG_PACKAGE_libdbi is not set +# CONFIG_PACKAGE_libdbus is not set +# CONFIG_PACKAGE_libdevmapper is not set +# CONFIG_PACKAGE_libdmapsharing is not set +# CONFIG_PACKAGE_libdnet is not set +# CONFIG_PACKAGE_libdouble-conversion is not set +# CONFIG_PACKAGE_libdrm is not set +# CONFIG_PACKAGE_libedit is not set +# CONFIG_PACKAGE_libelf1 is not set +# CONFIG_PACKAGE_libecdsautil is not set +# CONFIG_PACKAGE_libesmtp is not set +# CONFIG_PACKAGE_libestr is not set +# CONFIG_PACKAGE_libev is not set +# CONFIG_PACKAGE_libevdev is not set +# CONFIG_PACKAGE_libevent2 is not set +# CONFIG_PACKAGE_libevent2-core is not set +# CONFIG_PACKAGE_libevent2-extra is not set +# CONFIG_PACKAGE_libevent2-openssl is not set +# CONFIG_PACKAGE_libevent2-pthreads is not set +# CONFIG_PACKAGE_libeventlog is not set +# CONFIG_PACKAGE_libevhtp is not set +# CONFIG_PACKAGE_libexif is not set +# CONFIG_PACKAGE_libexpat is not set +# CONFIG_PACKAGE_libexslt is not set +# CONFIG_PACKAGE_libextractor is not set +# CONFIG_PACKAGE_libf2fs is not set +# CONFIG_PACKAGE_libfaad2 is not set +# CONFIG_PACKAGE_libfastjson is not set +# CONFIG_PACKAGE_libfdisk is not set +# CONFIG_PACKAGE_libfdt is not set +# CONFIG_PACKAGE_libffi is not set +# CONFIG_PACKAGE_libffmpeg-audio-dec is not set +# CONFIG_PACKAGE_libffmpeg-custom is not set +# CONFIG_PACKAGE_libffmpeg-full is not set +# CONFIG_PACKAGE_libffmpeg-mini is not set +# CONFIG_PACKAGE_libflac is not set +# CONFIG_PACKAGE_libfreetype is not set +# CONFIG_PACKAGE_libftdi is not set +# CONFIG_PACKAGE_libftdi1 is not set +# CONFIG_PACKAGE_libgcrypt is not set +# CONFIG_PACKAGE_libgd is not set +# CONFIG_PACKAGE_libgdbm is not set +# CONFIG_PACKAGE_libgee is not set +# CONFIG_PACKAGE_libglpk is not set +# CONFIG_PACKAGE_libgmp is not set +# CONFIG_PACKAGE_libgnurl is not set +# CONFIG_PACKAGE_libgpg-error is not set +# CONFIG_PACKAGE_libgphoto2 is not set +# CONFIG_PACKAGE_libgps is not set +# CONFIG_PACKAGE_libhamlib is not set +# CONFIG_PACKAGE_libhavege is not set +# CONFIG_PACKAGE_libhiredis is not set +# CONFIG_PACKAGE_libhttp-parser is not set +# CONFIG_PACKAGE_libical is not set +# CONFIG_PACKAGE_libiconv is not set +# CONFIG_PACKAGE_libiconv-full is not set +# CONFIG_PACKAGE_libid3tag is not set +# CONFIG_PACKAGE_libidn is not set +# CONFIG_PACKAGE_libiio is not set +# CONFIG_PACKAGE_libimobiledevice is not set +# CONFIG_PACKAGE_libinput is not set +# CONFIG_PACKAGE_libintl is not set +# CONFIG_PACKAGE_libintl-full is not set +# CONFIG_PACKAGE_libiw is not set +CONFIG_PACKAGE_libiwinfo=y +# CONFIG_PACKAGE_libjpeg is not set +CONFIG_PACKAGE_libjson-c=y +# CONFIG_PACKAGE_libkmod is not set +# CONFIG_PACKAGE_libldns is not set +# CONFIG_PACKAGE_libltdl is not set +# CONFIG_PACKAGE_liblua is not set +# CONFIG_PACKAGE_liblz4 is not set +# CONFIG_PACKAGE_liblzo is not set +# CONFIG_PACKAGE_libmad is not set +# CONFIG_PACKAGE_libmagic is not set +# CONFIG_PACKAGE_libmcrypt is not set +# CONFIG_PACKAGE_libmicrohttpd is not set +# CONFIG_PACKAGE_libmicrohttpd-no-ssl is not set +# CONFIG_PACKAGE_libminiupnpc is not set +# CONFIG_PACKAGE_libmms is not set +# CONFIG_PACKAGE_libmnl is not set +# CONFIG_PACKAGE_libmodbus is not set +# CONFIG_PACKAGE_libmosquitto-nossl is not set +# CONFIG_PACKAGE_libmosquitto-ssl is not set +# CONFIG_PACKAGE_libmount is not set +# CONFIG_PACKAGE_libmpdclient is not set +# CONFIG_PACKAGE_libmpeg2 is not set +# CONFIG_PACKAGE_libmpg123 is not set +# CONFIG_PACKAGE_libmraa is not set +# CONFIG_PACKAGE_libmysqlclient is not set +# CONFIG_PACKAGE_libmysqlclient-r is not set +# CONFIG_PACKAGE_libnatpmp is not set +# CONFIG_PACKAGE_libncurses is not set +# CONFIG_PACKAGE_libndpi is not set +# CONFIG_PACKAGE_libneon is not set +# CONFIG_PACKAGE_libnet-1.2.x is not set +# CONFIG_PACKAGE_libnetconf2 is not set +# CONFIG_PACKAGE_libnetfilter-acct is not set +# CONFIG_PACKAGE_libnetfilter-conntrack is not set +# CONFIG_PACKAGE_libnetfilter-cthelper is not set +# CONFIG_PACKAGE_libnetfilter-cttimeout is not set +# CONFIG_PACKAGE_libnetfilter-log is not set +# CONFIG_PACKAGE_libnetfilter-queue is not set +# CONFIG_PACKAGE_libnetsnmp is not set +# CONFIG_PACKAGE_libnettle is not set +# CONFIG_PACKAGE_libnfnetlink is not set +# CONFIG_PACKAGE_libnftnl is not set +# CONFIG_PACKAGE_libnl is not set +# CONFIG_PACKAGE_libnl-core is not set +# CONFIG_PACKAGE_libnl-genl is not set +# CONFIG_PACKAGE_libnl-nf is not set +# CONFIG_PACKAGE_libnl-route is not set +CONFIG_PACKAGE_libnl-tiny=y +# CONFIG_PACKAGE_libnopoll is not set +# CONFIG_PACKAGE_libogg is not set +# CONFIG_PACKAGE_liboil is not set +# CONFIG_PACKAGE_libopcodes is not set +# CONFIG_PACKAGE_libopenldap is not set +# CONFIG_PACKAGE_libopenobex is not set +# CONFIG_PACKAGE_libopensc is not set +# CONFIG_PACKAGE_libopenzwave is not set +# CONFIG_PACKAGE_liboping is not set +# CONFIG_PACKAGE_libopus is not set +# CONFIG_PACKAGE_libout123 is not set +# CONFIG_PACKAGE_libowfat is not set +# CONFIG_PACKAGE_libp11 is not set +# CONFIG_PACKAGE_libpam is not set +# CONFIG_PACKAGE_libpcap is not set +# CONFIG_PACKAGE_libpcre is not set +# CONFIG_PACKAGE_libpcre16 is not set +# CONFIG_PACKAGE_libpcre2 is not set +# CONFIG_PACKAGE_libpcre2-16 is not set +# CONFIG_PACKAGE_libpcre2-32 is not set +# CONFIG_PACKAGE_libpcrecpp is not set +# CONFIG_PACKAGE_libpcsclite is not set +# CONFIG_PACKAGE_libpkcs11-spy is not set +# CONFIG_PACKAGE_libplist is not set +# CONFIG_PACKAGE_libplistcxx is not set +# CONFIG_PACKAGE_libpng is not set +# CONFIG_PACKAGE_libpopt is not set +# CONFIG_PACKAGE_libpri is not set +# CONFIG_PACKAGE_libprotobuf-c is not set +# CONFIG_PACKAGE_libqrencode is not set +# CONFIG_PACKAGE_libradcli is not set +# CONFIG_PACKAGE_libreadline is not set +# CONFIG_PACKAGE_libredblack is not set +# CONFIG_PACKAGE_libroxml is not set +# CONFIG_PACKAGE_librpc is not set +# CONFIG_PACKAGE_librrd1 is not set +# CONFIG_PACKAGE_librtlsdr is not set +# CONFIG_PACKAGE_libruby is not set +# CONFIG_PACKAGE_libsamplerate is not set +# CONFIG_PACKAGE_libsane is not set +# CONFIG_PACKAGE_libsasl2 is not set +# CONFIG_PACKAGE_libsearpc is not set +# CONFIG_PACKAGE_libseccomp is not set +# CONFIG_PACKAGE_libsensors is not set +# CONFIG_PACKAGE_libshout is not set +# CONFIG_PACKAGE_libshout-full is not set +# CONFIG_PACKAGE_libshout-nossl is not set +# CONFIG_PACKAGE_libsigcxx is not set +# CONFIG_PACKAGE_libsmartcols is not set +# CONFIG_PACKAGE_libsndfile is not set +# CONFIG_PACKAGE_libsoc is not set +# CONFIG_PACKAGE_libsocks is not set +# CONFIG_PACKAGE_libsodium is not set +# CONFIG_PACKAGE_libsoup is not set +# CONFIG_PACKAGE_libsoxr is not set +# CONFIG_PACKAGE_libspeex is not set +# CONFIG_PACKAGE_libspeexdsp is not set +# CONFIG_PACKAGE_libssh is not set +# CONFIG_PACKAGE_libssh2 is not set +# CONFIG_PACKAGE_libstoken is not set +# CONFIG_PACKAGE_libstrophe is not set +# CONFIG_PACKAGE_libtalloc is not set +# CONFIG_PACKAGE_libtasn1 is not set +# CONFIG_PACKAGE_libtheora is not set +# CONFIG_PACKAGE_libtiff is not set +# CONFIG_PACKAGE_libtiffxx is not set +# CONFIG_PACKAGE_libtins is not set +# CONFIG_PACKAGE_libtorrent is not set +CONFIG_PACKAGE_libubox=y +# CONFIG_PACKAGE_libubox-lua is not set +CONFIG_PACKAGE_libubus=y +# CONFIG_PACKAGE_libubus-lua is not set +CONFIG_PACKAGE_libuci=y +# CONFIG_PACKAGE_libuci-lua is not set +CONFIG_PACKAGE_libuclient=y +# CONFIG_PACKAGE_libudev-fbsd is not set +# CONFIG_PACKAGE_libudns is not set +# CONFIG_PACKAGE_libuecc is not set +# CONFIG_PACKAGE_libugpio is not set +# CONFIG_PACKAGE_libunbound is not set +# CONFIG_PACKAGE_libunistring is not set +# CONFIG_PACKAGE_libunwind is not set +# CONFIG_PACKAGE_libupnp is not set +# CONFIG_PACKAGE_libupnpp is not set +# CONFIG_PACKAGE_liburcu is not set +# CONFIG_PACKAGE_libusb-1.0 is not set +# CONFIG_PACKAGE_libusb-compat is not set +# CONFIG_PACKAGE_libusbmuxd is not set +# CONFIG_PACKAGE_libustream-cyassl is not set +# CONFIG_PACKAGE_libustream-mbedtls is not set +# CONFIG_PACKAGE_libustream-openssl is not set +# CONFIG_PACKAGE_libuuid is not set +# CONFIG_PACKAGE_libuv is not set +# CONFIG_PACKAGE_libuvc is not set +# CONFIG_PACKAGE_libv4l is not set +# CONFIG_PACKAGE_libvorbis is not set +# CONFIG_PACKAGE_libvorbisidec is not set +# CONFIG_PACKAGE_libvpx is not set +# CONFIG_PACKAGE_libwebcam is not set +# CONFIG_PACKAGE_libwebsockets-full is not set +# CONFIG_PACKAGE_libwebsockets-mbedtls is not set +# CONFIG_PACKAGE_libwebsockets-openssl is not set +# CONFIG_PACKAGE_libwrap is not set +# CONFIG_PACKAGE_libwxbase is not set +# CONFIG_PACKAGE_libx264 is not set +# CONFIG_PACKAGE_libxerces-c is not set +# CONFIG_PACKAGE_libxerces-c-samples is not set +# CONFIG_PACKAGE_libxml2 is not set +# CONFIG_PACKAGE_libxslt is not set +# CONFIG_PACKAGE_libyaml-cpp is not set +# CONFIG_PACKAGE_libyang is not set +# CONFIG_PACKAGE_libzdb is not set +# CONFIG_PACKAGE_libzmq-curve is not set +# CONFIG_PACKAGE_libzmq-nc is not set +# CONFIG_PACKAGE_linux-atm is not set +# CONFIG_PACKAGE_loudmouth is not set +# CONFIG_PACKAGE_lttng-ust is not set +# CONFIG_PACKAGE_mtdev is not set +# CONFIG_PACKAGE_musl-fts is not set +# CONFIG_PACKAGE_mxml is not set +# CONFIG_PACKAGE_nacl is not set +# CONFIG_PACKAGE_opencv is not set +# CONFIG_PACKAGE_p11-kit is not set +# CONFIG_PACKAGE_poco is not set +# CONFIG_PACKAGE_protobuf is not set +# CONFIG_PACKAGE_pthsem is not set +# CONFIG_PACKAGE_rpcd-mod-rrdns is not set +# CONFIG_PACKAGE_rxtx is not set +# CONFIG_PACKAGE_sbc is not set +# CONFIG_PACKAGE_terminfo is not set +# CONFIG_PACKAGE_tinycdb is not set +# CONFIG_PACKAGE_uclibcxx is not set +# CONFIG_PACKAGE_uw-imap is not set +# CONFIG_PACKAGE_xmlrpc-c is not set +# CONFIG_PACKAGE_xmlrpc-c-client is not set +# CONFIG_PACKAGE_xmlrpc-c-server is not set +# CONFIG_PACKAGE_yajl is not set +# CONFIG_PACKAGE_zlib is not set + +# +# LuCI +# + +# +# 1. Collections +# +# CONFIG_PACKAGE_luci is not set +# CONFIG_PACKAGE_luci-ssl is not set +# CONFIG_PACKAGE_luci-ssl-openssl is not set + +# +# 2. Modules +# +# CONFIG_PACKAGE_luci-base is not set +# CONFIG_LUCI_SRCDIET is not set + +# +# Translations +# +# CONFIG_LUCI_LANG_ca is not set +# CONFIG_LUCI_LANG_cs is not set +# CONFIG_LUCI_LANG_de is not set +# CONFIG_LUCI_LANG_el is not set +# CONFIG_LUCI_LANG_en is not set +# CONFIG_LUCI_LANG_es is not set +# CONFIG_LUCI_LANG_fr is not set +# CONFIG_LUCI_LANG_he is not set +# CONFIG_LUCI_LANG_hu is not set +# CONFIG_LUCI_LANG_it is not set +# CONFIG_LUCI_LANG_ja is not set +# CONFIG_LUCI_LANG_ko is not set +# CONFIG_LUCI_LANG_ms is not set +# CONFIG_LUCI_LANG_no is not set +# CONFIG_LUCI_LANG_pl is not set +# CONFIG_LUCI_LANG_pt is not set +# CONFIG_LUCI_LANG_pt-br is not set +# CONFIG_LUCI_LANG_ro is not set +# CONFIG_LUCI_LANG_ru is not set +# CONFIG_LUCI_LANG_sk is not set +# CONFIG_LUCI_LANG_sv is not set +# CONFIG_LUCI_LANG_tr is not set +# CONFIG_LUCI_LANG_uk is not set +# CONFIG_LUCI_LANG_vi is not set +# CONFIG_LUCI_LANG_zh-cn is not set +# CONFIG_LUCI_LANG_zh-tw is not set +# CONFIG_PACKAGE_luci-mod-admin-full is not set +# CONFIG_PACKAGE_luci-mod-failsafe is not set +# CONFIG_PACKAGE_luci-mod-freifunk is not set +# CONFIG_PACKAGE_luci-mod-freifunk-community is not set +# CONFIG_PACKAGE_luci-mod-rpc is not set + +# +# 3. Applications +# +# CONFIG_PACKAGE_luci-app-adblock is not set +# CONFIG_PACKAGE_luci-app-adbyby-plus is not set +# CONFIG_PACKAGE_luci-app-advanced-reboot is not set +# CONFIG_PACKAGE_luci-app-ahcp is not set +# CONFIG_PACKAGE_luci-app-amule is not set +# CONFIG_PACKAGE_luci-app-aria2 is not set +# CONFIG_PACKAGE_luci-app-arpbind is not set +# CONFIG_PACKAGE_luci-app-asterisk is not set +# CONFIG_PACKAGE_luci-app-autoreboot is not set +# CONFIG_PACKAGE_luci-app-bcp38 is not set +# CONFIG_PACKAGE_luci-app-bird4 is not set +# CONFIG_PACKAGE_luci-app-bird6 is not set +# CONFIG_PACKAGE_luci-app-bmx6 is not set +# CONFIG_PACKAGE_luci-app-bmx7 is not set +# CONFIG_PACKAGE_luci-app-cjdns is not set +# CONFIG_PACKAGE_luci-app-clamav is not set +# CONFIG_PACKAGE_luci-app-commands is not set +# CONFIG_PACKAGE_luci-app-cshark is not set +# CONFIG_PACKAGE_luci-app-ddns is not set +# CONFIG_PACKAGE_luci-app-diag-core is not set +# CONFIG_PACKAGE_luci-app-dnscrypt-proxy is not set +# CONFIG_PACKAGE_luci-app-dogcom is not set +# CONFIG_PACKAGE_luci-app-dump1090 is not set +# CONFIG_PACKAGE_luci-app-dynapoint is not set +# CONFIG_PACKAGE_luci-app-e2guardian is not set +# CONFIG_PACKAGE_luci-app-filetransfer is not set +# CONFIG_PACKAGE_luci-app-firewall is not set +# CONFIG_PACKAGE_luci-app-freifunk-diagnostics is not set +# CONFIG_PACKAGE_luci-app-freifunk-policyrouting is not set +# CONFIG_PACKAGE_luci-app-freifunk-widgets is not set +# CONFIG_PACKAGE_luci-app-frpc is not set +# CONFIG_PACKAGE_luci-app-fwknopd is not set +# CONFIG_PACKAGE_luci-app-hd-idle is not set +# CONFIG_PACKAGE_luci-app-hnet is not set +# CONFIG_PACKAGE_luci-app-ipsec-vpnd is not set +# CONFIG_PACKAGE_luci-app-kcptun is not set +# CONFIG_PACKAGE_luci-app-meshwizard is not set +# CONFIG_PACKAGE_luci-app-minidlna is not set +# CONFIG_PACKAGE_luci-app-mjpg-streamer is not set +# CONFIG_PACKAGE_luci-app-mmc-over-gpio is not set +# CONFIG_PACKAGE_luci-app-mproxy is not set +# CONFIG_PACKAGE_luci-app-mwan3 is not set +# CONFIG_PACKAGE_luci-app-n2n_v2 is not set +# CONFIG_PACKAGE_luci-app-ngrokc is not set +# CONFIG_PACKAGE_luci-app-nlbwmon is not set +# CONFIG_PACKAGE_luci-app-noddos is not set +# CONFIG_PACKAGE_luci-app-ntpc is not set +# CONFIG_PACKAGE_luci-app-ocserv is not set +# CONFIG_PACKAGE_luci-app-olsr is not set +# CONFIG_PACKAGE_luci-app-olsr-services is not set +# CONFIG_PACKAGE_luci-app-olsr-viz is not set +# CONFIG_PACKAGE_luci-app-openvpn is not set +# CONFIG_PACKAGE_luci-app-openvpn-server is not set +# CONFIG_PACKAGE_luci-app-oscam is not set +# CONFIG_PACKAGE_luci-app-p910nd is not set +# CONFIG_PACKAGE_luci-app-polipo is not set +# CONFIG_PACKAGE_luci-app-pptp-server is not set +# CONFIG_PACKAGE_luci-app-privoxy is not set +# CONFIG_PACKAGE_luci-app-qos is not set +# CONFIG_PACKAGE_luci-app-radicale is not set +# CONFIG_PACKAGE_luci-app-rp-pppoe-server is not set +# CONFIG_PACKAGE_luci-app-samba is not set +# CONFIG_PACKAGE_luci-app-sfe is not set +# CONFIG_PACKAGE_luci-app-shadowsocks-libev is not set +# CONFIG_PACKAGE_luci-app-shadowsocksr-pro is not set +# CONFIG_PACKAGE_luci-app-shairplay is not set +# CONFIG_PACKAGE_luci-app-shairport is not set +# CONFIG_PACKAGE_luci-app-siitwizard is not set +# CONFIG_PACKAGE_luci-app-simple-adblock is not set +# CONFIG_PACKAGE_luci-app-splash is not set +# CONFIG_PACKAGE_luci-app-squid is not set +# CONFIG_PACKAGE_luci-app-ssrserver-python is not set +# CONFIG_PACKAGE_luci-app-statistics is not set +# CONFIG_PACKAGE_luci-app-syncdial is not set +# CONFIG_PACKAGE_luci-app-tinyproxy is not set +# CONFIG_PACKAGE_luci-app-transmission is not set +# CONFIG_PACKAGE_luci-app-transparent-proxy is not set +# CONFIG_PACKAGE_luci-app-travelmate is not set +# CONFIG_PACKAGE_luci-app-udp2raw is not set +# CONFIG_PACKAGE_luci-app-udpxy is not set +# CONFIG_PACKAGE_luci-app-uhttpd is not set +# CONFIG_PACKAGE_luci-app-unbound is not set +# CONFIG_PACKAGE_luci-app-upnp is not set +# CONFIG_PACKAGE_luci-app-usb-printer is not set +# CONFIG_PACKAGE_luci-app-vlmcsd is not set +# CONFIG_PACKAGE_luci-app-vnstat is not set +# CONFIG_PACKAGE_luci-app-vpnbypass is not set +# CONFIG_PACKAGE_luci-app-vsftpd is not set +# CONFIG_PACKAGE_luci-app-watchcat is not set +# CONFIG_PACKAGE_luci-app-wifischedule is not set +# CONFIG_PACKAGE_luci-app-wireguard is not set +# CONFIG_PACKAGE_luci-app-wol is not set +# CONFIG_PACKAGE_luci-app-xlnetacc is not set +# CONFIG_PACKAGE_luci-app-zerotier is not set + +# +# 4. Themes +# +# CONFIG_PACKAGE_luci-theme-atmaterial is not set +# CONFIG_PACKAGE_luci-theme-bootstrap is not set +# CONFIG_PACKAGE_luci-theme-freifunk-generic is not set +# CONFIG_PACKAGE_luci-theme-material is not set +# CONFIG_PACKAGE_luci-theme-openwrt is not set + +# +# 5. Protocols +# +# CONFIG_PACKAGE_luci-proto-3g is not set +# CONFIG_PACKAGE_luci-proto-ipip is not set +# CONFIG_PACKAGE_luci-proto-ipv6 is not set +# CONFIG_PACKAGE_luci-proto-ncm is not set +# CONFIG_PACKAGE_luci-proto-openconnect is not set +# CONFIG_PACKAGE_luci-proto-ppp is not set +# CONFIG_PACKAGE_luci-proto-qmi is not set +# CONFIG_PACKAGE_luci-proto-relay is not set +# CONFIG_PACKAGE_luci-proto-vpnc is not set +# CONFIG_PACKAGE_luci-proto-wireguard is not set + +# +# 6. Libraries +# +# CONFIG_PACKAGE_luci-lib-dracula is not set +# CONFIG_PACKAGE_luci-lib-httpclient is not set +# CONFIG_PACKAGE_luci-lib-ip is not set +# CONFIG_PACKAGE_luci-lib-jquery-1-4 is not set +# CONFIG_PACKAGE_luci-lib-json is not set +# CONFIG_PACKAGE_luci-lib-jsonc is not set +# CONFIG_PACKAGE_luci-lib-luaneightbl is not set +# CONFIG_PACKAGE_luci-lib-nixio is not set +# CONFIG_PACKAGE_luci-lib-px5g is not set + +# +# 9. Freifunk +# +# CONFIG_PACKAGE_freifunk-common is not set +# CONFIG_PACKAGE_freifunk-firewall is not set +# CONFIG_PACKAGE_freifunk-policyrouting is not set +# CONFIG_PACKAGE_freifunk-watchdog is not set +# CONFIG_PACKAGE_meshwizard is not set +# CONFIG_PACKAGE_default-settings is not set + +# +# Mail +# +# CONFIG_PACKAGE_alpine is not set +# CONFIG_PACKAGE_alpine-nossl is not set +# CONFIG_PACKAGE_bogofilter is not set +# CONFIG_PACKAGE_clamsmtp is not set +# CONFIG_PACKAGE_dovecot is not set +# CONFIG_PACKAGE_dovecot-pigeonhole is not set +# CONFIG_PACKAGE_dovecot-utils is not set +# CONFIG_PACKAGE_emailrelay is not set +# CONFIG_PACKAGE_fdm is not set +# CONFIG_PACKAGE_greyfix is not set +# CONFIG_PACKAGE_mailman is not set +# CONFIG_PACKAGE_mailsend is not set +# CONFIG_PACKAGE_mailsend-nossl is not set +# CONFIG_PACKAGE_msmtp is not set +# CONFIG_PACKAGE_msmtp-nossl is not set +# CONFIG_PACKAGE_mutt is not set +# CONFIG_PACKAGE_nail is not set +# CONFIG_PACKAGE_postfix is not set + +# +# Select postfix build options +# +CONFIG_POSTFIX_TLS=y +CONFIG_POSTFIX_SASL=y +CONFIG_POSTFIX_LDAP=y +# CONFIG_POSTFIX_DB is not set +CONFIG_POSTFIX_CDB=y +CONFIG_POSTFIX_SQLITE=y +# CONFIG_POSTFIX_PGSQL is not set +CONFIG_POSTFIX_PCRE=y +# CONFIG_POSTFIX_EAI is not set +# CONFIG_PACKAGE_ssmtp is not set + +# +# Multimedia +# + +# +# Streaming +# +# CONFIG_PACKAGE_oggfwd is not set +# CONFIG_PACKAGE_crtmpserver is not set +# CONFIG_PACKAGE_ffmpeg is not set +# CONFIG_PACKAGE_ffprobe is not set +# CONFIG_PACKAGE_ffserver is not set +# CONFIG_PACKAGE_fswebcam is not set +# CONFIG_PACKAGE_gphoto2 is not set +# CONFIG_PACKAGE_grilo is not set +# CONFIG_PACKAGE_grilo-plugins is not set +# CONFIG_PACKAGE_gst1-libav is not set +# CONFIG_PACKAGE_gstreamer1-libs is not set +# CONFIG_PACKAGE_gstreamer1-plugins-bad is not set +# CONFIG_PACKAGE_gstreamer1-plugins-base is not set +# CONFIG_PACKAGE_gstreamer1-plugins-good is not set +# CONFIG_PACKAGE_gstreamer1-plugins-ugly is not set +# CONFIG_PACKAGE_gstreamer1-utils is not set +# CONFIG_PACKAGE_icecast is not set +# CONFIG_PACKAGE_lcdgrilo is not set +# CONFIG_PACKAGE_minidlna is not set +# CONFIG_PACKAGE_mjpg-streamer is not set +# CONFIG_PACKAGE_motion is not set +# CONFIG_PACKAGE_tvheadend is not set +# CONFIG_PACKAGE_v4l2rtspserver is not set +# CONFIG_PACKAGE_vips is not set +# CONFIG_PACKAGE_xupnpd is not set +# CONFIG_PACKAGE_youtube-dl is not set + +# +# Network +# + +# +# BitTorrent +# +# CONFIG_PACKAGE_mktorrent is not set +# CONFIG_PACKAGE_opentracker is not set +# CONFIG_PACKAGE_opentracker6 is not set +# CONFIG_PACKAGE_rtorrent is not set +# CONFIG_PACKAGE_rtorrent-rpc is not set +# CONFIG_PACKAGE_transmission-cli-mbedtls is not set +# CONFIG_PACKAGE_transmission-cli-openssl is not set +# CONFIG_PACKAGE_transmission-daemon-mbedtls is not set +# CONFIG_PACKAGE_transmission-daemon-openssl is not set +# CONFIG_PACKAGE_transmission-remote-mbedtls is not set +# CONFIG_PACKAGE_transmission-remote-openssl is not set + +# +# Captive Portals +# +# CONFIG_PACKAGE_coova-chilli is not set +# CONFIG_PACKAGE_nodogsplash is not set +# CONFIG_PACKAGE_nodogsplash2 is not set +# CONFIG_PACKAGE_wifidog is not set +# CONFIG_PACKAGE_wifidog-tls is not set + +# +# Download Manager +# +# CONFIG_PACKAGE_webui-aria2 is not set +# CONFIG_PACKAGE_yaaw is not set + +# +# File Transfer +# +# CONFIG_PACKAGE_aria2 is not set +# CONFIG_PACKAGE_atftp is not set +# CONFIG_PACKAGE_atftpd is not set +# CONFIG_PACKAGE_curl is not set +# CONFIG_PACKAGE_gnurl is not set +# CONFIG_PACKAGE_lftp is not set +# CONFIG_PACKAGE_rsync is not set +# CONFIG_PACKAGE_rsyncd is not set +# CONFIG_PACKAGE_vsftpd is not set +# CONFIG_PACKAGE_vsftpd-alt is not set +# CONFIG_PACKAGE_vsftpd-tls is not set +# CONFIG_PACKAGE_wget is not set +# CONFIG_PACKAGE_wget-nossl is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_davfs2 is not set +# CONFIG_PACKAGE_netatalk is not set +# CONFIG_PACKAGE_nfs-kernel-server is not set +# CONFIG_PACKAGE_owftpd is not set +# CONFIG_PACKAGE_owhttpd is not set +# CONFIG_PACKAGE_owserver is not set +# CONFIG_PACKAGE_sshfs is not set + +# +# Firewall +# +# CONFIG_PACKAGE_arptables is not set +# CONFIG_PACKAGE_conntrack is not set +# CONFIG_PACKAGE_conntrackd is not set +# CONFIG_PACKAGE_ebtables is not set +# CONFIG_PACKAGE_fwknop is not set +# CONFIG_PACKAGE_fwknopd is not set +# CONFIG_PACKAGE_ip6tables is not set +CONFIG_PACKAGE_iptables=y +# CONFIG_PACKAGE_iptables-mod-account is not set +# CONFIG_PACKAGE_iptables-mod-chaos is not set +# CONFIG_PACKAGE_iptables-mod-cluster is not set +# CONFIG_PACKAGE_iptables-mod-clusterip is not set +# CONFIG_PACKAGE_iptables-mod-condition is not set +# CONFIG_PACKAGE_iptables-mod-conntrack-extra is not set +# CONFIG_PACKAGE_iptables-mod-delude is not set +# CONFIG_PACKAGE_iptables-mod-dhcpmac is not set +# CONFIG_PACKAGE_iptables-mod-dnetmap is not set +# CONFIG_PACKAGE_iptables-mod-extra is not set +# CONFIG_PACKAGE_iptables-mod-filter is not set +# CONFIG_PACKAGE_iptables-mod-fuzzy is not set +# CONFIG_PACKAGE_iptables-mod-geoip is not set +# CONFIG_PACKAGE_iptables-mod-hashlimit is not set +# CONFIG_PACKAGE_iptables-mod-iface is not set +# CONFIG_PACKAGE_iptables-mod-ipmark is not set +# CONFIG_PACKAGE_iptables-mod-ipopt is not set +# CONFIG_PACKAGE_iptables-mod-ipp2p is not set +# CONFIG_PACKAGE_iptables-mod-iprange is not set +# CONFIG_PACKAGE_iptables-mod-ipsec is not set +# CONFIG_PACKAGE_iptables-mod-ipv4options is not set +# CONFIG_PACKAGE_iptables-mod-led is not set +# CONFIG_PACKAGE_iptables-mod-length2 is not set +# CONFIG_PACKAGE_iptables-mod-logmark is not set +# CONFIG_PACKAGE_iptables-mod-lscan is not set +# CONFIG_PACKAGE_iptables-mod-lua is not set +# CONFIG_PACKAGE_iptables-mod-nat-extra is not set +# CONFIG_PACKAGE_iptables-mod-nflog is not set +# CONFIG_PACKAGE_iptables-mod-nfqueue is not set +# CONFIG_PACKAGE_iptables-mod-psd is not set +# CONFIG_PACKAGE_iptables-mod-quota2 is not set +# CONFIG_PACKAGE_iptables-mod-rpfilter is not set +# CONFIG_PACKAGE_iptables-mod-sysrq is not set +# CONFIG_PACKAGE_iptables-mod-tarpit is not set +# CONFIG_PACKAGE_iptables-mod-tee is not set +# CONFIG_PACKAGE_iptables-mod-tproxy is not set +# CONFIG_PACKAGE_iptables-mod-u32 is not set +# CONFIG_PACKAGE_iptables-mod-ulog is not set +# CONFIG_PACKAGE_iptaccount is not set +# CONFIG_PACKAGE_miniupnpc is not set +# CONFIG_PACKAGE_miniupnpd is not set +# CONFIG_MINIUPNPD_IGDv2 is not set +# CONFIG_PACKAGE_natpmpc is not set +# CONFIG_PACKAGE_nftables is not set +# CONFIG_PACKAGE_shorewall is not set +# CONFIG_PACKAGE_shorewall-core is not set +# CONFIG_PACKAGE_shorewall-lite is not set +# CONFIG_PACKAGE_shorewall6 is not set +# CONFIG_PACKAGE_shorewall6-lite is not set +# CONFIG_PACKAGE_snort is not set + +# +# Firewall Tunnel +# +# CONFIG_PACKAGE_iodine is not set +# CONFIG_PACKAGE_iodined is not set + +# +# FreeRADIUS (version 3) +# +# CONFIG_PACKAGE_freeradius3 is not set +# CONFIG_PACKAGE_freeradius3-common is not set +# CONFIG_PACKAGE_freeradius3-utils is not set + +# +# IP Addresses and Names +# +# CONFIG_PACKAGE_aggregate is not set +# CONFIG_PACKAGE_announce is not set +# CONFIG_PACKAGE_avahi-autoipd is not set +# CONFIG_PACKAGE_avahi-daemon-service-http is not set +# CONFIG_PACKAGE_avahi-daemon-service-ssh is not set +# CONFIG_PACKAGE_avahi-dbus-daemon is not set +# CONFIG_PACKAGE_avahi-dnsconfd is not set +# CONFIG_PACKAGE_avahi-nodbus-daemon is not set +# CONFIG_PACKAGE_avahi-utils is not set +# CONFIG_PACKAGE_bind-check is not set +# CONFIG_PACKAGE_bind-client is not set +# CONFIG_PACKAGE_bind-dig is not set +# CONFIG_PACKAGE_bind-dnssec is not set +# CONFIG_PACKAGE_bind-host is not set +# CONFIG_PACKAGE_bind-rndc is not set +# CONFIG_PACKAGE_bind-server is not set +# CONFIG_PACKAGE_bind-tools is not set +# CONFIG_PACKAGE_danish is not set +# CONFIG_PACKAGE_ddns-scripts is not set +# CONFIG_PACKAGE_ddns-scripts_aliyun is not set +# CONFIG_PACKAGE_dhcp-forwarder is not set +# CONFIG_PACKAGE_dnscrypt-proxy is not set +# CONFIG_PACKAGE_dnscrypt-proxy-resolvers is not set +# CONFIG_PACKAGE_drill is not set +# CONFIG_PACKAGE_hostip is not set +# CONFIG_PACKAGE_idn is not set +# CONFIG_PACKAGE_inadyn is not set +# CONFIG_PACKAGE_isc-dhcp-client-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-client-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-omshell-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-omshell-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-relay-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-relay-ipv6 is not set +# CONFIG_PACKAGE_isc-dhcp-server-ipv4 is not set +# CONFIG_PACKAGE_isc-dhcp-server-ipv6 is not set +# CONFIG_PACKAGE_knot is not set +# CONFIG_PACKAGE_knot-dig is not set +# CONFIG_PACKAGE_knot-host is not set +# CONFIG_PACKAGE_knot-keymgr is not set +# CONFIG_PACKAGE_knot-nsupdate is not set +# CONFIG_PACKAGE_knot-tests is not set +# CONFIG_PACKAGE_knot-zonecheck is not set +# CONFIG_PACKAGE_mdns-utils is not set +# CONFIG_PACKAGE_mdnsd is not set +# CONFIG_PACKAGE_mdnsresponder is not set +# CONFIG_PACKAGE_nsd is not set +# CONFIG_PACKAGE_nsd-control is not set +# CONFIG_PACKAGE_nsd-control-setup is not set +# CONFIG_PACKAGE_nsd-nossl is not set +# CONFIG_PACKAGE_ohybridproxy is not set +# CONFIG_PACKAGE_unbound is not set +# CONFIG_PACKAGE_unbound-anchor is not set +# CONFIG_PACKAGE_unbound-control is not set +# CONFIG_PACKAGE_unbound-control-setup is not set +# CONFIG_PACKAGE_unbound-host is not set +# CONFIG_PACKAGE_zonestitcher is not set + +# +# Instant Messaging +# +# CONFIG_PACKAGE_bitlbee is not set +# CONFIG_PACKAGE_irssi is not set +# CONFIG_PACKAGE_ngircd is not set +# CONFIG_PACKAGE_ngircd-nossl is not set +# CONFIG_PACKAGE_prosody is not set +# CONFIG_PACKAGE_quassel-irssi is not set +# CONFIG_PACKAGE_umurmur-mbedtls is not set +# CONFIG_PACKAGE_umurmur-openssl is not set +# CONFIG_PACKAGE_znc is not set + +# +# Linux ATM tools +# +# CONFIG_PACKAGE_atm-aread is not set +# CONFIG_PACKAGE_atm-atmaddr is not set +# CONFIG_PACKAGE_atm-atmdiag is not set +# CONFIG_PACKAGE_atm-atmdump is not set +# CONFIG_PACKAGE_atm-atmloop is not set +# CONFIG_PACKAGE_atm-atmsigd is not set +# CONFIG_PACKAGE_atm-atmswitch is not set +# CONFIG_PACKAGE_atm-atmtcp is not set +# CONFIG_PACKAGE_atm-awrite is not set +# CONFIG_PACKAGE_atm-bus is not set +# CONFIG_PACKAGE_atm-debug-tools is not set +# CONFIG_PACKAGE_atm-diagnostics is not set +# CONFIG_PACKAGE_atm-esi is not set +# CONFIG_PACKAGE_atm-ilmid is not set +# CONFIG_PACKAGE_atm-ilmidiag is not set +# CONFIG_PACKAGE_atm-lecs is not set +# CONFIG_PACKAGE_atm-les is not set +# CONFIG_PACKAGE_atm-mpcd is not set +# CONFIG_PACKAGE_atm-saaldump is not set +# CONFIG_PACKAGE_atm-sonetdiag is not set +# CONFIG_PACKAGE_atm-svc_recv is not set +# CONFIG_PACKAGE_atm-svc_send is not set +# CONFIG_PACKAGE_atm-tools is not set +# CONFIG_PACKAGE_atm-ttcp_atm is not set +# CONFIG_PACKAGE_atm-zeppelin is not set +# CONFIG_PACKAGE_br2684ctl is not set + +# +# NMAP Suite +# +# CONFIG_PACKAGE_ncat is not set +# CONFIG_PACKAGE_ncat-ssl is not set +# CONFIG_PACKAGE_ndiff is not set +# CONFIG_PACKAGE_nmap is not set +# CONFIG_PACKAGE_nmap-ssl is not set +# CONFIG_PACKAGE_nping is not set + +# +# NTRIP +# +# CONFIG_PACKAGE_ntripcaster is not set +# CONFIG_PACKAGE_ntripclient is not set +# CONFIG_PACKAGE_ntripserver is not set + +# +# OLSR.org network framework +# +# CONFIG_PACKAGE_oonf-dlep-proxy is not set +# CONFIG_PACKAGE_oonf-dlep-radio is not set +# CONFIG_PACKAGE_oonf-init-scripts is not set +# CONFIG_PACKAGE_oonf-olsrd2 is not set + +# +# Open vSwitch +# +# CONFIG_PACKAGE_openvswitch is not set +# CONFIG_PACKAGE_openvswitch-base is not set +# CONFIG_PACKAGE_openvswitch-ovn is not set +# CONFIG_PACKAGE_openvswitch-ovn-base is not set +# CONFIG_PACKAGE_openvswitch-ovn-controller is not set +# CONFIG_PACKAGE_openvswitch-ovn-controller-vtep is not set +# CONFIG_PACKAGE_openvswitch-ovn-detrace is not set +# CONFIG_PACKAGE_openvswitch-ovn-docker-overlay-driver is not set +# CONFIG_PACKAGE_openvswitch-ovn-docker-underlay-driver is not set +# CONFIG_PACKAGE_openvswitch-ovn-nbctl is not set +# CONFIG_PACKAGE_openvswitch-ovn-sbctl is not set +# CONFIG_PACKAGE_openvswitch-ovn-trace is not set +# CONFIG_PACKAGE_openvswitch-ovs-dpctl-top is not set +# CONFIG_PACKAGE_openvswitch-ovs-l3ping is not set +# CONFIG_PACKAGE_openvswitch-ovs-parse-backtrace is not set +# CONFIG_PACKAGE_openvswitch-ovs-pcap is not set +# CONFIG_PACKAGE_openvswitch-ovs-tcpdump is not set +# CONFIG_PACKAGE_openvswitch-ovs-tcpundump is not set +# CONFIG_PACKAGE_openvswitch-ovsdb-client is not set +# CONFIG_PACKAGE_openvswitch-python is not set +# CONFIG_PACKAGE_openvswitch-vtep is not set + +# +# P2P +# +# CONFIG_PACKAGE_amule is not set +CONFIG_AMULE_CRYPTOPP_STATIC_LINKING=y + +# +# Printing +# +# CONFIG_PACKAGE_p910nd is not set + +# +# Routing and Redirection +# +# CONFIG_PACKAGE_babel-pinger is not set +# CONFIG_PACKAGE_babeld is not set +# CONFIG_PACKAGE_batmand is not set +# CONFIG_PACKAGE_bcp38 is not set +# CONFIG_PACKAGE_bird4 is not set +# CONFIG_PACKAGE_bird4-uci is not set +# CONFIG_PACKAGE_bird6 is not set +# CONFIG_PACKAGE_bird6-uci is not set +# CONFIG_PACKAGE_birdc4 is not set +# CONFIG_PACKAGE_birdc6 is not set +# CONFIG_PACKAGE_birdcl4 is not set +# CONFIG_PACKAGE_birdcl6 is not set +# CONFIG_PACKAGE_bmx6 is not set +# CONFIG_PACKAGE_bmx7 is not set +# CONFIG_PACKAGE_cjdns is not set +# CONFIG_PACKAGE_cjdns-tests is not set +# CONFIG_PACKAGE_genl is not set +# CONFIG_PACKAGE_igmpproxy is not set +# CONFIG_PACKAGE_ip-bridge is not set +# CONFIG_PACKAGE_ip-full is not set +# CONFIG_PACKAGE_ip-tiny is not set +# CONFIG_PACKAGE_lldpd is not set +# CONFIG_PACKAGE_mcproxy is not set +# CONFIG_PACKAGE_mwan3 is not set +# CONFIG_PACKAGE_nstat is not set +# CONFIG_PACKAGE_olsrd is not set +# CONFIG_PACKAGE_prince is not set +# CONFIG_PACKAGE_quagga is not set +# CONFIG_PACKAGE_relayd is not set +# CONFIG_PACKAGE_smcroute is not set +# CONFIG_PACKAGE_ss is not set +# CONFIG_PACKAGE_sslh is not set +# CONFIG_PACKAGE_tc is not set +# CONFIG_PACKAGE_tcpproxy is not set +# CONFIG_PACKAGE_vis is not set + +# +# SSH +# +# CONFIG_PACKAGE_autossh is not set +# CONFIG_PACKAGE_openssh-client is not set +# CONFIG_PACKAGE_openssh-client-utils is not set +# CONFIG_PACKAGE_openssh-keygen is not set +# CONFIG_PACKAGE_openssh-moduli is not set +# CONFIG_PACKAGE_openssh-server is not set +# CONFIG_PACKAGE_openssh-server-pam is not set +# CONFIG_PACKAGE_openssh-sftp-avahi-service is not set +# CONFIG_PACKAGE_openssh-sftp-client is not set +# CONFIG_PACKAGE_openssh-sftp-server is not set +# CONFIG_PACKAGE_sshtunnel is not set + +# +# THC-IPv6 attack and analyzing toolkit +# +# CONFIG_PACKAGE_thc-ipv6-address6 is not set +# CONFIG_PACKAGE_thc-ipv6-alive6 is not set +# CONFIG_PACKAGE_thc-ipv6-covert-send6 is not set +# CONFIG_PACKAGE_thc-ipv6-covert-send6d is not set +# CONFIG_PACKAGE_thc-ipv6-denial6 is not set +# CONFIG_PACKAGE_thc-ipv6-detect-new-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-detect-sniffer6 is not set +# CONFIG_PACKAGE_thc-ipv6-dnsdict6 is not set +# CONFIG_PACKAGE_thc-ipv6-dnsrevenum6 is not set +# CONFIG_PACKAGE_thc-ipv6-dos-new-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-dump-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-exploit6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-advertise6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dhcps6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dns6d is not set +# CONFIG_PACKAGE_thc-ipv6-fake-dnsupdate6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mipv6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mld26 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mld6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-mldrouter6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-router26 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-fake-solicitate6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-advertise6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-dhcpc6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mld26 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mld6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-mldrouter6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-router26 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-flood-solicitate6 is not set +# CONFIG_PACKAGE_thc-ipv6-fragmentation6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-dhcpc6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-dhcps6 is not set +# CONFIG_PACKAGE_thc-ipv6-fuzz-ip6 is not set +# CONFIG_PACKAGE_thc-ipv6-implementation6 is not set +# CONFIG_PACKAGE_thc-ipv6-implementation6d is not set +# CONFIG_PACKAGE_thc-ipv6-inverse-lookup6 is not set +# CONFIG_PACKAGE_thc-ipv6-kill-router6 is not set +# CONFIG_PACKAGE_thc-ipv6-ndpexhaust6 is not set +# CONFIG_PACKAGE_thc-ipv6-node-query6 is not set +# CONFIG_PACKAGE_thc-ipv6-parasite6 is not set +# CONFIG_PACKAGE_thc-ipv6-passive-discovery6 is not set +# CONFIG_PACKAGE_thc-ipv6-randicmp6 is not set +# CONFIG_PACKAGE_thc-ipv6-redir6 is not set +# CONFIG_PACKAGE_thc-ipv6-rsmurf6 is not set +# CONFIG_PACKAGE_thc-ipv6-sendpees6 is not set +# CONFIG_PACKAGE_thc-ipv6-sendpeesmp6 is not set +# CONFIG_PACKAGE_thc-ipv6-smurf6 is not set +# CONFIG_PACKAGE_thc-ipv6-thcping6 is not set +# CONFIG_PACKAGE_thc-ipv6-toobig6 is not set +# CONFIG_PACKAGE_thc-ipv6-trace6 is not set + +# +# Telephony +# +# CONFIG_PACKAGE_asterisk13 is not set +# CONFIG_PACKAGE_asterisk15 is not set +# CONFIG_PACKAGE_baresip is not set +# CONFIG_PACKAGE_freeswitch is not set +# CONFIG_PACKAGE_freeswitch-stable is not set +# CONFIG_PACKAGE_kamailio5 is not set +# CONFIG_PACKAGE_miax is not set +# CONFIG_PACKAGE_pcapsipdump is not set +# CONFIG_PACKAGE_restund is not set +# CONFIG_PACKAGE_rtpproxy is not set +# CONFIG_PACKAGE_sipp is not set +# CONFIG_PACKAGE_siproxd is not set +# CONFIG_PACKAGE_yate is not set + +# +# Time Synchronization +# +# CONFIG_PACKAGE_chrony is not set +# CONFIG_PACKAGE_htpdate is not set +# CONFIG_PACKAGE_linuxptp is not set +# CONFIG_PACKAGE_ntp-keygen is not set +# CONFIG_PACKAGE_ntp-utils is not set +# CONFIG_PACKAGE_ntpclient is not set +# CONFIG_PACKAGE_ntpd is not set +# CONFIG_PACKAGE_ntpdate is not set + +# +# VPN +# +# CONFIG_PACKAGE_chaosvpn is not set +# CONFIG_PACKAGE_fastd is not set +# CONFIG_PACKAGE_ipsec-tools is not set +# CONFIG_PACKAGE_n2n_v2 is not set +# CONFIG_PACKAGE_ocserv is not set +# CONFIG_PACKAGE_openconnect is not set +# CONFIG_PACKAGE_opennhrp is not set +# CONFIG_PACKAGE_openvpn-easy-rsa is not set +# CONFIG_PACKAGE_openvpn-mbedtls is not set +# CONFIG_PACKAGE_openvpn-nossl is not set +# CONFIG_PACKAGE_openvpn-openssl is not set +# CONFIG_PACKAGE_pptpd is not set +# CONFIG_PACKAGE_softethervpn is not set +# CONFIG_PACKAGE_sstp-client is not set +# CONFIG_PACKAGE_strongswan is not set +# CONFIG_PACKAGE_strongswan-charon is not set +# CONFIG_PACKAGE_strongswan-charon-cmd is not set +# CONFIG_PACKAGE_strongswan-default is not set +# CONFIG_PACKAGE_strongswan-ipsec is not set +# CONFIG_PACKAGE_strongswan-isakmp is not set +# CONFIG_PACKAGE_strongswan-libtls is not set +# CONFIG_PACKAGE_strongswan-minimal is not set +# CONFIG_PACKAGE_strongswan-mod-addrblock is not set +# CONFIG_PACKAGE_strongswan-mod-aes is not set +# CONFIG_PACKAGE_strongswan-mod-af-alg is not set +# CONFIG_PACKAGE_strongswan-mod-agent is not set +# CONFIG_PACKAGE_strongswan-mod-attr is not set +# CONFIG_PACKAGE_strongswan-mod-attr-sql is not set +# CONFIG_PACKAGE_strongswan-mod-blowfish is not set +# CONFIG_PACKAGE_strongswan-mod-ccm is not set +# CONFIG_PACKAGE_strongswan-mod-cmac is not set +# CONFIG_PACKAGE_strongswan-mod-connmark is not set +# CONFIG_PACKAGE_strongswan-mod-constraints is not set +# CONFIG_PACKAGE_strongswan-mod-coupling is not set +# CONFIG_PACKAGE_strongswan-mod-ctr is not set +# CONFIG_PACKAGE_strongswan-mod-curl is not set +# CONFIG_PACKAGE_strongswan-mod-curve25519 is not set +# CONFIG_PACKAGE_strongswan-mod-des is not set +# CONFIG_PACKAGE_strongswan-mod-dhcp is not set +# CONFIG_PACKAGE_strongswan-mod-dnskey is not set +# CONFIG_PACKAGE_strongswan-mod-duplicheck is not set +# CONFIG_PACKAGE_strongswan-mod-eap-identity is not set +# CONFIG_PACKAGE_strongswan-mod-eap-md5 is not set +# CONFIG_PACKAGE_strongswan-mod-eap-mschapv2 is not set +# CONFIG_PACKAGE_strongswan-mod-eap-radius is not set +# CONFIG_PACKAGE_strongswan-mod-eap-tls is not set +# CONFIG_PACKAGE_strongswan-mod-farp is not set +# CONFIG_PACKAGE_strongswan-mod-fips-prf is not set +# CONFIG_PACKAGE_strongswan-mod-forecast is not set +# CONFIG_PACKAGE_strongswan-mod-gcm is not set +# CONFIG_PACKAGE_strongswan-mod-gcrypt is not set +# CONFIG_PACKAGE_strongswan-mod-gmp is not set +# CONFIG_PACKAGE_strongswan-mod-gmpdh is not set +# CONFIG_PACKAGE_strongswan-mod-ha is not set +# CONFIG_PACKAGE_strongswan-mod-hmac is not set +# CONFIG_PACKAGE_strongswan-mod-kernel-libipsec is not set +# CONFIG_PACKAGE_strongswan-mod-kernel-netlink is not set +# CONFIG_PACKAGE_strongswan-mod-ldap is not set +# CONFIG_PACKAGE_strongswan-mod-led is not set +# CONFIG_PACKAGE_strongswan-mod-load-tester is not set +# CONFIG_PACKAGE_strongswan-mod-md4 is not set +# CONFIG_PACKAGE_strongswan-mod-md5 is not set +# CONFIG_PACKAGE_strongswan-mod-mysql is not set +# CONFIG_PACKAGE_strongswan-mod-nonce is not set +# CONFIG_PACKAGE_strongswan-mod-openssl is not set +# CONFIG_PACKAGE_strongswan-mod-pem is not set +# CONFIG_PACKAGE_strongswan-mod-pgp is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs1 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs11 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs12 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs7 is not set +# CONFIG_PACKAGE_strongswan-mod-pkcs8 is not set +# CONFIG_PACKAGE_strongswan-mod-pubkey is not set +# CONFIG_PACKAGE_strongswan-mod-random is not set +# CONFIG_PACKAGE_strongswan-mod-rc2 is not set +# CONFIG_PACKAGE_strongswan-mod-resolve is not set +# CONFIG_PACKAGE_strongswan-mod-revocation is not set +# CONFIG_PACKAGE_strongswan-mod-sha1 is not set +# CONFIG_PACKAGE_strongswan-mod-sha2 is not set +# CONFIG_PACKAGE_strongswan-mod-smp is not set +# CONFIG_PACKAGE_strongswan-mod-socket-default is not set +# CONFIG_PACKAGE_strongswan-mod-socket-dynamic is not set +# CONFIG_PACKAGE_strongswan-mod-sql is not set +# CONFIG_PACKAGE_strongswan-mod-sqlite is not set +# CONFIG_PACKAGE_strongswan-mod-sshkey is not set +# CONFIG_PACKAGE_strongswan-mod-stroke is not set +# CONFIG_PACKAGE_strongswan-mod-test-vectors is not set +# CONFIG_PACKAGE_strongswan-mod-uci is not set +# CONFIG_PACKAGE_strongswan-mod-unity is not set +# CONFIG_PACKAGE_strongswan-mod-updown is not set +# CONFIG_PACKAGE_strongswan-mod-vici is not set +# CONFIG_PACKAGE_strongswan-mod-whitelist is not set +# CONFIG_PACKAGE_strongswan-mod-x509 is not set +# CONFIG_PACKAGE_strongswan-mod-xauth-eap is not set +# CONFIG_PACKAGE_strongswan-mod-xauth-generic is not set +# CONFIG_PACKAGE_strongswan-mod-xcbc is not set +# CONFIG_PACKAGE_strongswan-pki is not set +# CONFIG_PACKAGE_strongswan-scepclient is not set +# CONFIG_PACKAGE_strongswan-swanctl is not set +# CONFIG_PACKAGE_tinc is not set +# CONFIG_PACKAGE_uanytun is not set +# CONFIG_PACKAGE_uanytun-nettle is not set +# CONFIG_PACKAGE_uanytun-nocrypt is not set +# CONFIG_PACKAGE_uanytun-sslcrypt is not set +# CONFIG_PACKAGE_vpnc is not set +# CONFIG_PACKAGE_vpnc-scripts is not set +# CONFIG_PACKAGE_wireguard is not set +# CONFIG_PACKAGE_wireguard-tools is not set +# CONFIG_PACKAGE_xl2tpd is not set +# CONFIG_PACKAGE_zerotier is not set + +# +# Version Control Systems +# +# CONFIG_PACKAGE_fossil is not set +# CONFIG_PACKAGE_git is not set +# CONFIG_PACKAGE_git-http is not set +# CONFIG_PACKAGE_subversion-client is not set +# CONFIG_PACKAGE_subversion-libs is not set +# CONFIG_PACKAGE_subversion-server is not set + +# +# WWAN +# +# CONFIG_PACKAGE_comgt is not set +# CONFIG_PACKAGE_comgt-directip is not set +# CONFIG_PACKAGE_comgt-ncm is not set +# CONFIG_PACKAGE_uqmi is not set + +# +# Web Servers/Proxies +# +# CONFIG_PACKAGE_apache is not set +# CONFIG_PACKAGE_cgi-io is not set +# CONFIG_PACKAGE_clamav is not set +# CONFIG_PACKAGE_e2guardian is not set +# CONFIG_PACKAGE_freshclam is not set +# CONFIG_PACKAGE_haproxy is not set +# CONFIG_PACKAGE_haproxy-nossl is not set +# CONFIG_PACKAGE_lighttpd is not set +# CONFIG_PACKAGE_nginx is not set +# CONFIG_PACKAGE_ngrokc is not set +# CONFIG_PACKAGE_pdnsd-alt is not set +# CONFIG_PACKAGE_polipo is not set +# CONFIG_PACKAGE_privoxy is not set +# CONFIG_PACKAGE_radicale-py2 is not set +# CONFIG_PACKAGE_radicale-py3 is not set +# CONFIG_PACKAGE_shadowsocks-client is not set +# CONFIG_PACKAGE_shadowsocks-libev-config is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-local is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-redir is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-rules is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-server is not set +# CONFIG_PACKAGE_shadowsocks-libev-ss-tunnel is not set +# CONFIG_PACKAGE_sockd is not set +# CONFIG_PACKAGE_socksify is not set +# CONFIG_PACKAGE_spawn-fcgi is not set +# CONFIG_PACKAGE_squid is not set +# CONFIG_PACKAGE_tinyproxy is not set +# CONFIG_PACKAGE_uhttpd is not set +# CONFIG_PACKAGE_uhttpd_debug is not set + +# +# dial-in/up +# +# CONFIG_PACKAGE_rp-pppoe-common is not set +# CONFIG_PACKAGE_rp-pppoe-relay is not set +# CONFIG_PACKAGE_rp-pppoe-server is not set + +# +# tcprelay +# +# CONFIG_PACKAGE_tcpbridge is not set +# CONFIG_PACKAGE_tcpcapinfo is not set +# CONFIG_PACKAGE_tcpliveplay is not set +# CONFIG_PACKAGE_tcpprep is not set +# CONFIG_PACKAGE_tcpreplay is not set +# CONFIG_PACKAGE_tcpreplay-all is not set +# CONFIG_PACKAGE_tcpreplay-edit is not set +# CONFIG_PACKAGE_tcprewrite is not set + +# +# wireless +# +# CONFIG_PACKAGE_aircrack-ng is not set +# CONFIG_PACKAGE_airmon-ng is not set +# CONFIG_PACKAGE_dynapoint is not set +# CONFIG_PACKAGE_horst is not set +# CONFIG_PACKAGE_kismet-client is not set +# CONFIG_PACKAGE_kismet-drone is not set +# CONFIG_PACKAGE_kismet-server is not set +# CONFIG_PACKAGE_pixiewps is not set +# CONFIG_PACKAGE_reaver is not set +# CONFIG_PACKAGE_wavemon is not set +# CONFIG_PACKAGE_wifischedule is not set +# CONFIG_PACKAGE_464xlat is not set +# CONFIG_PACKAGE_6in4 is not set +# CONFIG_PACKAGE_6rd is not set +# CONFIG_PACKAGE_6to4 is not set +# CONFIG_PACKAGE_acme is not set +# CONFIG_PACKAGE_adblock is not set +# CONFIG_PACKAGE_adbyby is not set +# CONFIG_PACKAGE_addrwatch is not set +# CONFIG_PACKAGE_ahcpd is not set +# CONFIG_PACKAGE_alfred is not set +# CONFIG_PACKAGE_apcupsd is not set +# CONFIG_PACKAGE_apcupsd-cgi is not set +# CONFIG_PACKAGE_apinger is not set +# CONFIG_PACKAGE_arp-scan is not set +# CONFIG_PACKAGE_authsae is not set +# CONFIG_PACKAGE_batctl is not set +# CONFIG_PACKAGE_beanstalkd is not set +# CONFIG_PACKAGE_bmon is not set +# CONFIG_PACKAGE_bwm-ng is not set +# CONFIG_PACKAGE_chat is not set +# CONFIG_PACKAGE_cifsmount is not set +# CONFIG_PACKAGE_coap-server is not set +# CONFIG_PACKAGE_conserver is not set +# CONFIG_PACKAGE_cshark is not set +# CONFIG_PACKAGE_daemonlogger is not set +# CONFIG_PACKAGE_darkstat is not set +# CONFIG_PACKAGE_dhcpcd is not set +# CONFIG_PACKAGE_dmapd is not set +# CONFIG_PACKAGE_dogcom is not set +# CONFIG_PACKAGE_ds-lite is not set +# CONFIG_PACKAGE_eapol-test is not set +# CONFIG_PACKAGE_esniper is not set +# CONFIG_PACKAGE_etherwake is not set +# CONFIG_PACKAGE_ethtool is not set +# CONFIG_PACKAGE_fakeidentd is not set +# CONFIG_PACKAGE_fping is not set +# CONFIG_PACKAGE_frpc is not set +# CONFIG_PACKAGE_gnunet is not set +# CONFIG_PACKAGE_gre is not set +# CONFIG_PACKAGE_hnet-full is not set +# CONFIG_PACKAGE_hnet-full-l2tp is not set +# CONFIG_PACKAGE_hnet-full-secure is not set +# CONFIG_PACKAGE_hnetd-nossl is not set +# CONFIG_PACKAGE_hnetd-openssl is not set +# CONFIG_PACKAGE_hostapd is not set +CONFIG_PACKAGE_hostapd-common=y +# CONFIG_PACKAGE_hostapd-mini is not set +# CONFIG_PACKAGE_hostapd-utils is not set +# CONFIG_PACKAGE_httping is not set +# CONFIG_PACKAGE_httping-nossl is not set +# CONFIG_PACKAGE_https_dns_proxy is not set +# CONFIG_PACKAGE_i2pd is not set +# CONFIG_PACKAGE_ibrdtn-tools is not set +# CONFIG_PACKAGE_ibrdtnd is not set +# CONFIG_PACKAGE_ifstat is not set +# CONFIG_PACKAGE_iftop is not set +# CONFIG_PACKAGE_iiod is not set +# CONFIG_PACKAGE_iotivity is not set +# CONFIG_PACKAGE_iotivity-cpp is not set +# CONFIG_PACKAGE_iotivity-example-garage is not set +# CONFIG_PACKAGE_iotivity-example-simple is not set +# CONFIG_PACKAGE_iotivity-oic-middle is not set +# CONFIG_PACKAGE_iotivity-resource-container-hue is not set +# CONFIG_PACKAGE_iotivity-resource-container-lib is not set +# CONFIG_PACKAGE_iotivity-resource-container-sample is not set +# CONFIG_PACKAGE_iotivity-resource-directory-lib is not set +# CONFIG_PACKAGE_iperf is not set +# CONFIG_PACKAGE_iperf3 is not set +# CONFIG_PACKAGE_ipip is not set +# CONFIG_PACKAGE_ipset is not set +# CONFIG_PACKAGE_ipset-dns is not set +# CONFIG_PACKAGE_ipset-lists is not set +# CONFIG_PACKAGE_iptraf-ng is not set +# CONFIG_PACKAGE_iputils-arping is not set +# CONFIG_PACKAGE_iputils-clockdiff is not set +# CONFIG_PACKAGE_iputils-ping is not set +# CONFIG_PACKAGE_iputils-ping6 is not set +# CONFIG_PACKAGE_iputils-tftpd is not set +# CONFIG_PACKAGE_iputils-tracepath is not set +# CONFIG_PACKAGE_iputils-tracepath6 is not set +# CONFIG_PACKAGE_iputils-traceroute6 is not set +CONFIG_PACKAGE_iw=y +# CONFIG_PACKAGE_jool is not set +# CONFIG_PACKAGE_jool-tools is not set +# CONFIG_PACKAGE_keepalived is not set +# CONFIG_PACKAGE_knxd is not set +# CONFIG_PACKAGE_kplex is not set +# CONFIG_PACKAGE_krb5-client is not set +# CONFIG_PACKAGE_krb5-libs is not set +# CONFIG_PACKAGE_krb5-server is not set +# CONFIG_PACKAGE_linknx is not set +# CONFIG_PACKAGE_lispd is not set +# CONFIG_PACKAGE_mac-telnet-client is not set +# CONFIG_PACKAGE_mac-telnet-discover is not set +# CONFIG_PACKAGE_mac-telnet-ping is not set +# CONFIG_PACKAGE_mac-telnet-server is not set +# CONFIG_PACKAGE_map is not set +# CONFIG_PACKAGE_map-t is not set +# CONFIG_PACKAGE_memcached is not set +# CONFIG_PACKAGE_mii-tool is not set +# CONFIG_PACKAGE_mikrotik-btest is not set +# CONFIG_PACKAGE_mini_snmpd is not set +# CONFIG_PACKAGE_minimalist-pcproxy is not set +# CONFIG_PACKAGE_mosquitto-client-nossl is not set +# CONFIG_PACKAGE_mosquitto-client-ssl is not set +# CONFIG_PACKAGE_mosquitto-nossl is not set +# CONFIG_PACKAGE_mosquitto-ssl is not set +# CONFIG_PACKAGE_mproxy is not set +# CONFIG_PACKAGE_mrd6 is not set +# CONFIG_PACKAGE_mtr is not set +# CONFIG_PACKAGE_nbd is not set +# CONFIG_PACKAGE_nbd-server is not set +# CONFIG_PACKAGE_ncp is not set +# CONFIG_PACKAGE_ndppd is not set +# CONFIG_PACKAGE_netcat is not set +# CONFIG_PACKAGE_netdiscover is not set +# CONFIG_PACKAGE_netperf is not set +# CONFIG_PACKAGE_nlbwmon is not set +# CONFIG_PACKAGE_noddos is not set +# CONFIG_PACKAGE_noping is not set +# CONFIG_PACKAGE_nut is not set +# CONFIG_PACKAGE_obfsproxy is not set +# CONFIG_PACKAGE_odhcp6c is not set +# CONFIG_PACKAGE_odhcpd is not set +# CONFIG_PACKAGE_ola is not set +# CONFIG_PACKAGE_omcproxy is not set +# CONFIG_PACKAGE_openldap-server is not set +# CONFIG_PACKAGE_oscam is not set +# CONFIG_PACKAGE_oping is not set +# CONFIG_PACKAGE_pen is not set +# CONFIG_PACKAGE_pimbd is not set +# CONFIG_PACKAGE_pingcheck is not set +# CONFIG_PACKAGE_port-mirroring is not set +# CONFIG_PACKAGE_portmap is not set +CONFIG_PACKAGE_ppp=y +# CONFIG_PACKAGE_ppp-mod-passwordfd is not set +# CONFIG_PACKAGE_ppp-mod-pppoa is not set +CONFIG_PACKAGE_ppp-mod-pppoe=y +# CONFIG_PACKAGE_ppp-mod-pppol2tp is not set +# CONFIG_PACKAGE_ppp-mod-pptp is not set +# CONFIG_PACKAGE_ppp-mod-radius is not set +# CONFIG_PACKAGE_ppp-multilink is not set +# CONFIG_PACKAGE_pppdump is not set +# CONFIG_PACKAGE_pppoe-discovery is not set +# CONFIG_PACKAGE_pppossh is not set +# CONFIG_PACKAGE_pppstats is not set +# CONFIG_PACKAGE_radsecproxy is not set +# CONFIG_PACKAGE_redsocks is not set +# CONFIG_PACKAGE_remserial is not set +# CONFIG_PACKAGE_rssileds is not set +# CONFIG_PACKAGE_rsyslog is not set +# CONFIG_PACKAGE_samba36-client is not set +# CONFIG_PACKAGE_samba36-server is not set +# CONFIG_PACKAGE_scapy is not set +# CONFIG_PACKAGE_sctp is not set +# CONFIG_PACKAGE_sctp-tools is not set +# CONFIG_PACKAGE_seafile-ccnet is not set +# CONFIG_PACKAGE_seafile-seahub is not set +# CONFIG_PACKAGE_seafile-server is not set +# CONFIG_PACKAGE_ser2net is not set +# CONFIG_PACKAGE_shadowsocksr-libev is not set +# CONFIG_PACKAGE_shadowsocksr-libev-alt is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist-4M is not set +# CONFIG_PACKAGE_shadowsocksr-libev-gfwlist-polarssl is not set +# CONFIG_PACKAGE_shadowsocksr-libev-mini is not set +# CONFIG_PACKAGE_shadowsocksr-libev-polarssl is not set +# CONFIG_PACKAGE_simple-adblock is not set +# CONFIG_PACKAGE_sipgrep is not set +# CONFIG_PACKAGE_smartsnmpd is not set +# CONFIG_PACKAGE_sngrep is not set +# CONFIG_PACKAGE_snmp-mibs is not set +# CONFIG_PACKAGE_snmp-utils is not set +# CONFIG_PACKAGE_snmpd is not set +# CONFIG_PACKAGE_snmpd-static is not set +# CONFIG_PACKAGE_snmptrapd is not set +# CONFIG_PACKAGE_socat is not set +# CONFIG_PACKAGE_softflowd is not set +# CONFIG_PACKAGE_soloscli is not set +# CONFIG_PACKAGE_stunnel is not set +# CONFIG_PACKAGE_tayga is not set +# CONFIG_PACKAGE_tcpdump is not set +# CONFIG_PACKAGE_tcpdump-mini is not set +# CONFIG_PACKAGE_tor is not set +# CONFIG_PACKAGE_tor-gencert is not set +# CONFIG_PACKAGE_tor-geoip is not set +# CONFIG_PACKAGE_tor-resolve is not set +# CONFIG_PACKAGE_travelmate is not set +# CONFIG_PACKAGE_u2pnpd is not set +CONFIG_PACKAGE_uclient-fetch=y +# CONFIG_PACKAGE_udp2raw-tunnel is not set +# CONFIG_PACKAGE_udpxy is not set +# CONFIG_PACKAGE_ulogd is not set +# CONFIG_PACKAGE_umbim is not set +# CONFIG_PACKAGE_umdns is not set +# CONFIG_PACKAGE_usbip is not set +# CONFIG_PACKAGE_vallumd is not set +# CONFIG_PACKAGE_vlmcsd is not set +# CONFIG_PACKAGE_vncrepeater is not set +# CONFIG_PACKAGE_vnstat is not set +# CONFIG_PACKAGE_vpnbypass is not set +# CONFIG_PACKAGE_vsc7385-ucode-pb44 is not set +# CONFIG_PACKAGE_vsc7395-ucode-pb44 is not set +# CONFIG_PACKAGE_vti is not set +# CONFIG_PACKAGE_wakeonlan is not set +# CONFIG_PACKAGE_wpa-cli is not set +# CONFIG_PACKAGE_wpa-supplicant is not set +# CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK is not set +# CONFIG_WPA_RFKILL_SUPPORT is not set +CONFIG_WPA_MSG_MIN_PRIORITY=3 +# CONFIG_DRIVER_WEXT_SUPPORT is not set +CONFIG_DRIVER_11N_SUPPORT=y +# CONFIG_DRIVER_11AC_SUPPORT is not set +CONFIG_DRIVER_11W_SUPPORT=y +# CONFIG_PACKAGE_wpa-supplicant-mesh is not set +# CONFIG_PACKAGE_wpa-supplicant-mini is not set +# CONFIG_PACKAGE_wpa-supplicant-p2p is not set +# CONFIG_PACKAGE_wpad is not set +# CONFIG_PACKAGE_wpad-mesh is not set +CONFIG_PACKAGE_wpad-mini=y +# CONFIG_PACKAGE_wpan-tools is not set +# CONFIG_PACKAGE_wwan is not set +# CONFIG_PACKAGE_xinetd is not set + +# +# Sound +# +# CONFIG_PACKAGE_alsa-utils is not set +# CONFIG_PACKAGE_alsa-utils-seq is not set +# CONFIG_PACKAGE_alsa-utils-tests is not set +# CONFIG_PACKAGE_espeak is not set +# CONFIG_PACKAGE_faad2 is not set +# CONFIG_PACKAGE_fdk-aac is not set +# CONFIG_PACKAGE_forked-daapd is not set +# CONFIG_PACKAGE_ices is not set +# CONFIG_PACKAGE_lame is not set +# CONFIG_PACKAGE_lame-lib is not set +# CONFIG_PACKAGE_liblo-utils is not set +# CONFIG_PACKAGE_madplay is not set +# CONFIG_PACKAGE_madplay-alsa is not set +# CONFIG_PACKAGE_moc is not set +# CONFIG_PACKAGE_mpc is not set +# CONFIG_PACKAGE_mpd-avahi-service is not set +# CONFIG_PACKAGE_mpd-full is not set +# CONFIG_PACKAGE_mpd-mini is not set +# CONFIG_PACKAGE_mpg123 is not set +# CONFIG_PACKAGE_opus-tools is not set +# CONFIG_PACKAGE_pianod is not set +# CONFIG_PACKAGE_pianod-client is not set +# CONFIG_PACKAGE_portaudio is not set +# CONFIG_PACKAGE_pulseaudio-daemon is not set +# CONFIG_PACKAGE_pulseaudio-profiles is not set +# CONFIG_PACKAGE_pulseaudio-tools is not set +# CONFIG_PACKAGE_shairplay is not set +# CONFIG_PACKAGE_shairport-sync-mbedtls is not set +# CONFIG_PACKAGE_shairport-sync-mini is not set +# CONFIG_PACKAGE_shairport-sync-openssl is not set +# CONFIG_PACKAGE_shine is not set +# CONFIG_PACKAGE_sox is not set +# CONFIG_PACKAGE_squeezelite-full is not set +# CONFIG_PACKAGE_squeezelite-mini is not set +# CONFIG_PACKAGE_svox is not set +# CONFIG_PACKAGE_upmpdcli is not set + +# +# Utilities +# + +# +# Boot Loaders +# +# CONFIG_PACKAGE_fconfig is not set +# CONFIG_PACKAGE_rbcfg is not set +CONFIG_PACKAGE_uboot-envtools=y +# CONFIG_UBOOT_ENVTOOLS_UBI is not set + +# +# Compression +# +# CONFIG_PACKAGE_bsdtar is not set +# CONFIG_PACKAGE_bzip2 is not set +# CONFIG_PACKAGE_gzip is not set +# CONFIG_PACKAGE_unrar is not set +# CONFIG_PACKAGE_unzip is not set +# CONFIG_PACKAGE_xz-utils is not set +# CONFIG_PACKAGE_zip is not set + +# +# Disc +# +# CONFIG_PACKAGE_blkdiscard is not set +# CONFIG_PACKAGE_blkid is not set +# CONFIG_PACKAGE_cfdisk is not set +# CONFIG_PACKAGE_fdisk is not set +# CONFIG_PACKAGE_findfs is not set +# CONFIG_PACKAGE_hd-idle is not set +# CONFIG_PACKAGE_hdparm is not set +# CONFIG_PACKAGE_lsblk is not set +# CONFIG_PACKAGE_lvm2 is not set +# CONFIG_PACKAGE_mdadm is not set +# CONFIG_PACKAGE_partx-utils is not set +# CONFIG_PACKAGE_sfdisk is not set +# CONFIG_PACKAGE_wipefs is not set + +# +# Editors +# +# CONFIG_PACKAGE_joe is not set +# CONFIG_PACKAGE_nano is not set +# CONFIG_PACKAGE_vim is not set +# CONFIG_PACKAGE_vim-full is not set +# CONFIG_PACKAGE_vim-fuller is not set +# CONFIG_PACKAGE_vim-help is not set +# CONFIG_PACKAGE_vim-runtime is not set +# CONFIG_PACKAGE_zile is not set + +# +# Encryption +# +# CONFIG_PACKAGE_ccrypt is not set +# CONFIG_PACKAGE_certtool is not set +# CONFIG_PACKAGE_cryptsetup is not set +# CONFIG_PACKAGE_cryptsetup-openssl is not set +# CONFIG_PACKAGE_gnupg is not set +# CONFIG_PACKAGE_gnutls-utils is not set +# CONFIG_PACKAGE_gpgv is not set +# CONFIG_PACKAGE_px5g-mbedtls is not set +# CONFIG_PACKAGE_px5g-standalone is not set +# CONFIG_PACKAGE_stoken is not set + +# +# Filesystem +# +# CONFIG_PACKAGE_acl is not set +# CONFIG_PACKAGE_attr is not set +# CONFIG_PACKAGE_badblocks is not set +# CONFIG_PACKAGE_btrfs-progs is not set +# CONFIG_PACKAGE_chattr is not set +# CONFIG_PACKAGE_debugfs is not set +# CONFIG_PACKAGE_dosfstools is not set +# CONFIG_PACKAGE_dumpe2fs is not set +# CONFIG_PACKAGE_e2freefrag is not set +# CONFIG_PACKAGE_e2fsprogs is not set +# CONFIG_PACKAGE_f2fs-tools is not set +# CONFIG_PACKAGE_f2fsck is not set +# CONFIG_PACKAGE_filefrag is not set +# CONFIG_PACKAGE_fuse-utils is not set +# CONFIG_PACKAGE_hfsfsck is not set +# CONFIG_PACKAGE_lsattr is not set +# CONFIG_PACKAGE_mkf2fs is not set +# CONFIG_PACKAGE_mkhfs is not set +# CONFIG_PACKAGE_ncdu is not set +# CONFIG_PACKAGE_nfs-utils is not set +# CONFIG_PACKAGE_ntfs-3g is not set +# CONFIG_PACKAGE_ntfs-3g-low is not set +# CONFIG_PACKAGE_ntfs-3g-utils is not set +# CONFIG_PACKAGE_owfs is not set +# CONFIG_PACKAGE_owshell is not set +# CONFIG_PACKAGE_resize2fs is not set +# CONFIG_PACKAGE_squashfs-tools-mksquashfs is not set +# CONFIG_PACKAGE_squashfs-tools-unsquashfs is not set +# CONFIG_PACKAGE_swap-utils is not set +# CONFIG_PACKAGE_sysfsutils is not set +# CONFIG_PACKAGE_tune2fs is not set +# CONFIG_PACKAGE_xfs-fsck is not set +# CONFIG_PACKAGE_xfs-growfs is not set +# CONFIG_PACKAGE_xfs-mkfs is not set + +# +# Image Manipulation +# +# CONFIG_PACKAGE_jpeg-tools is not set +# CONFIG_PACKAGE_tiff-utils is not set + +# +# Luci +# +# CONFIG_PACKAGE_luci-app-haproxy-tcp is not set + +# +# Microcontroller programming +# +# CONFIG_PACKAGE_avrdude is not set +# CONFIG_PACKAGE_dfu-programmer is not set +# CONFIG_PACKAGE_stm32flash is not set + +# +# RTKLIB Suite +# +# CONFIG_PACKAGE_convbin is not set +# CONFIG_PACKAGE_pos2kml is not set +# CONFIG_PACKAGE_rnx2rtkp is not set +# CONFIG_PACKAGE_rtkrcv is not set +# CONFIG_PACKAGE_str2str is not set + +# +# Shells +# +# CONFIG_PACKAGE_bash is not set +# CONFIG_PACKAGE_klish is not set +# CONFIG_PACKAGE_tcsh is not set +# CONFIG_PACKAGE_zsh is not set + +# +# Telephony +# +# CONFIG_PACKAGE_dahdi-cfg is not set +# CONFIG_PACKAGE_dahdi-monitor is not set +# CONFIG_PACKAGE_gsm-utils is not set + +# +# Terminal +# +# CONFIG_PACKAGE_agetty is not set +# CONFIG_PACKAGE_dvtm is not set +# CONFIG_PACKAGE_minicom is not set +# CONFIG_PACKAGE_picocom is not set +# CONFIG_PACKAGE_screen is not set +# CONFIG_PACKAGE_script-utils is not set +# CONFIG_PACKAGE_serialconsole is not set +# CONFIG_PACKAGE_setterm is not set +# CONFIG_PACKAGE_tio is not set +# CONFIG_PACKAGE_tmux is not set +# CONFIG_PACKAGE_ttyd is not set +# CONFIG_PACKAGE_wall is not set + +# +# Virtualization +# + +# +# Zoneinfo +# +# CONFIG_PACKAGE_zoneinfo-africa is not set +# CONFIG_PACKAGE_zoneinfo-asia is not set +# CONFIG_PACKAGE_zoneinfo-atlantic is not set +# CONFIG_PACKAGE_zoneinfo-australia-nz is not set +# CONFIG_PACKAGE_zoneinfo-core is not set +# CONFIG_PACKAGE_zoneinfo-europe is not set +# CONFIG_PACKAGE_zoneinfo-india is not set +# CONFIG_PACKAGE_zoneinfo-northamerica is not set +# CONFIG_PACKAGE_zoneinfo-pacific is not set +# CONFIG_PACKAGE_zoneinfo-poles is not set +# CONFIG_PACKAGE_zoneinfo-simple is not set +# CONFIG_PACKAGE_zoneinfo-southamerica is not set + +# +# database +# +# CONFIG_PACKAGE_mysql-server is not set +# CONFIG_PACKAGE_pgsql-cli is not set +# CONFIG_PACKAGE_pgsql-cli-extra is not set +# CONFIG_PACKAGE_pgsql-server is not set +# CONFIG_PACKAGE_rrdcgi1 is not set +# CONFIG_PACKAGE_rrdtool1 is not set +# CONFIG_PACKAGE_sqlite3-cli is not set +# CONFIG_PACKAGE_unixodbc-tools is not set +# CONFIG_PACKAGE_adb is not set +# CONFIG_PACKAGE_ap51-flash is not set +# CONFIG_PACKAGE_at is not set +# CONFIG_PACKAGE_bandwidthd is not set +# CONFIG_PACKAGE_bandwidthd-pgsql is not set +# CONFIG_PACKAGE_bandwidthd-php is not set +# CONFIG_PACKAGE_bandwidthd-sqlite is not set +# CONFIG_PACKAGE_banhostlist is not set +# CONFIG_PACKAGE_bc is not set +# CONFIG_PACKAGE_bluelog is not set +# CONFIG_PACKAGE_bluez-daemon is not set +# CONFIG_PACKAGE_bluez-examples is not set +# CONFIG_PACKAGE_bluez-utils is not set +# CONFIG_PACKAGE_bonniexx is not set +# CONFIG_PACKAGE_bsdiff is not set +# CONFIG_PACKAGE_bspatch is not set +# CONFIG_PACKAGE_cal is not set +# CONFIG_PACKAGE_canutils is not set +# CONFIG_PACKAGE_cmdpad is not set +# CONFIG_PACKAGE_coap-client is not set +# CONFIG_PACKAGE_collectd is not set +# CONFIG_PACKAGE_coreutils is not set +# CONFIG_PACKAGE_crconf is not set +# CONFIG_PACKAGE_crelay is not set +# CONFIG_PACKAGE_ct-bugcheck is not set +# CONFIG_PACKAGE_dbus is not set +# CONFIG_PACKAGE_dfu-util is not set +# CONFIG_PACKAGE_digitemp is not set +# CONFIG_PACKAGE_digitemp-usb is not set +# CONFIG_PACKAGE_dmesg is not set +# CONFIG_PACKAGE_dropbearconvert is not set +# CONFIG_PACKAGE_dtc is not set +# CONFIG_PACKAGE_dump1090 is not set +# CONFIG_PACKAGE_ecdsautils is not set +# CONFIG_PACKAGE_elektra-kdb is not set +# CONFIG_PACKAGE_evtest is not set +# CONFIG_PACKAGE_extract is not set +# CONFIG_PACKAGE_file is not set +# CONFIG_PACKAGE_findutils-find is not set +# CONFIG_PACKAGE_findutils-locate is not set +# CONFIG_PACKAGE_findutils-xargs is not set +# CONFIG_PACKAGE_flashrom is not set +# CONFIG_PACKAGE_flashrom-pci is not set +# CONFIG_PACKAGE_flashrom-spi is not set +# CONFIG_PACKAGE_flashrom-usb is not set +# CONFIG_PACKAGE_flent-tools is not set +# CONFIG_PACKAGE_flock is not set +# CONFIG_PACKAGE_ftdi_eeprom is not set +# CONFIG_PACKAGE_gammu is not set +# CONFIG_PACKAGE_gawk is not set +# CONFIG_PACKAGE_getopt is not set +# CONFIG_PACKAGE_gkermit is not set +# CONFIG_PACKAGE_gpioctl-sysfs is not set +# CONFIG_PACKAGE_gpsd is not set +# CONFIG_PACKAGE_gpsd-clients is not set +# CONFIG_PACKAGE_grep is not set +# CONFIG_PACKAGE_hamlib is not set +# CONFIG_PACKAGE_haserl is not set +# CONFIG_PACKAGE_haveged is not set +# CONFIG_PACKAGE_hub-ctrl is not set +# CONFIG_PACKAGE_hwclock is not set +# CONFIG_PACKAGE_i2c-tools is not set +# CONFIG_PACKAGE_iconv is not set +# CONFIG_PACKAGE_iio-utils is not set +# CONFIG_PACKAGE_io is not set +# CONFIG_PACKAGE_irqbalance is not set +# CONFIG_PACKAGE_iwcap is not set +CONFIG_PACKAGE_iwinfo=y +# CONFIG_PACKAGE_jq is not set +CONFIG_PACKAGE_jshn=y +# CONFIG_PACKAGE_kexec-tools is not set +# CONFIG_PACKAGE_kmod is not set +# CONFIG_PACKAGE_lcd4linux-custom is not set +# CONFIG_PACKAGE_lcdproc-clients is not set +# CONFIG_PACKAGE_lcdproc-drivers is not set +# CONFIG_PACKAGE_lcdproc-server is not set +# CONFIG_PACKAGE_less is not set +# CONFIG_PACKAGE_less-wide is not set +# CONFIG_PACKAGE_libimobiledevice-utils is not set +CONFIG_PACKAGE_libjson-script=y +# CONFIG_PACKAGE_libplist-utils is not set +# CONFIG_PACKAGE_libsysrepo is not set +# CONFIG_PACKAGE_libusbmuxd-utils is not set +# CONFIG_PACKAGE_lm-sensors is not set +# CONFIG_PACKAGE_lm-sensors-detect is not set +# CONFIG_PACKAGE_logger is not set +# CONFIG_PACKAGE_logrotate is not set +# CONFIG_PACKAGE_look is not set +# CONFIG_PACKAGE_losetup is not set +# CONFIG_PACKAGE_lrzsz is not set +# CONFIG_PACKAGE_lsof is not set +# CONFIG_PACKAGE_lxc is not set +# CONFIG_PACKAGE_lxc-unprivileged is not set +# CONFIG_PACKAGE_maccalc is not set +# CONFIG_PACKAGE_macchanger is not set +# CONFIG_PACKAGE_mbtools is not set +# CONFIG_PACKAGE_mc is not set +# CONFIG_PACKAGE_mcookie is not set +# CONFIG_PACKAGE_mmc-utils is not set +# CONFIG_PACKAGE_moreutils is not set +# CONFIG_PACKAGE_mount-utils is not set +# CONFIG_PACKAGE_mountd is not set +# CONFIG_PACKAGE_mpack is not set +# CONFIG_PACKAGE_mt-st is not set +# CONFIG_PACKAGE_namei is not set +# CONFIG_PACKAGE_netopeer2-cli is not set +# CONFIG_PACKAGE_netopeer2-keystored is not set +# CONFIG_PACKAGE_netopeer2-server is not set +# CONFIG_PACKAGE_netwhere is not set +# CONFIG_PACKAGE_oath-toolkit is not set +# CONFIG_PACKAGE_open-plc-utils is not set +# CONFIG_PACKAGE_open2300 is not set +# CONFIG_PACKAGE_openldap-utils is not set +# CONFIG_PACKAGE_openobex is not set +# CONFIG_PACKAGE_openobex-apps is not set +# CONFIG_PACKAGE_openocd is not set +# CONFIG_PACKAGE_opensc-utils is not set +# CONFIG_PACKAGE_openssl-util is not set +# CONFIG_PACKAGE_openzwave is not set +# CONFIG_PACKAGE_openzwave-config is not set +# CONFIG_PACKAGE_owipcalc is not set +# CONFIG_PACKAGE_pciutils is not set +# CONFIG_PACKAGE_pcsc-tools is not set +# CONFIG_PACKAGE_pcscd is not set +# CONFIG_PACKAGE_pps-tools is not set +# CONFIG_PACKAGE_prlimit is not set +# CONFIG_PACKAGE_procps-ng is not set +# CONFIG_PACKAGE_progress is not set +# CONFIG_PACKAGE_prometheus-node-exporter-lua is not set +# CONFIG_PACKAGE_pv is not set +# CONFIG_PACKAGE_qrencode is not set +# CONFIG_PACKAGE_relayctl is not set +# CONFIG_PACKAGE_rename is not set +# CONFIG_PACKAGE_rng-tools is not set +# CONFIG_PACKAGE_rtl-ais is not set +# CONFIG_PACKAGE_rtl-sdr is not set +# CONFIG_PACKAGE_rtl_433 is not set +# CONFIG_PACKAGE_sane-backends is not set +# CONFIG_PACKAGE_sane-daemon is not set +# CONFIG_PACKAGE_sane-frontends is not set +# CONFIG_PACKAGE_setserial is not set +# CONFIG_PACKAGE_shadow-utils is not set +CONFIG_PACKAGE_shellsync=y +# CONFIG_PACKAGE_sispmctl is not set +# CONFIG_PACKAGE_slide-switch is not set +# CONFIG_PACKAGE_smartd is not set +# CONFIG_PACKAGE_smartmontools is not set +# CONFIG_PACKAGE_smstools3 is not set +# CONFIG_PACKAGE_sockread is not set +# CONFIG_PACKAGE_spi-tools is not set +# CONFIG_PACKAGE_spidev-test is not set +# CONFIG_PACKAGE_strace is not set +# CONFIG_PACKAGE_strace_libunwind is not set +# CONFIG_PACKAGE_stress is not set +# CONFIG_PACKAGE_sumo is not set +# CONFIG_PACKAGE_sysrepo is not set +# CONFIG_PACKAGE_sysrepocfg is not set +# CONFIG_PACKAGE_sysrepoctl is not set +# CONFIG_PACKAGE_sysstat is not set +# CONFIG_PACKAGE_tar is not set +# CONFIG_PACKAGE_taskwarrior is not set +# CONFIG_PACKAGE_tracertools is not set +# CONFIG_PACKAGE_tree is not set +# CONFIG_PACKAGE_triggerhappy is not set +# CONFIG_PACKAGE_udns-dnsget is not set +# CONFIG_PACKAGE_udns-ex-rdns is not set +# CONFIG_PACKAGE_udns-rblcheck is not set +# CONFIG_PACKAGE_ugps is not set +# CONFIG_PACKAGE_uledd is not set +# CONFIG_PACKAGE_usb-modeswitch is not set +# CONFIG_PACKAGE_usbmuxd is not set +# CONFIG_PACKAGE_usbreset is not set +# CONFIG_PACKAGE_usbutils is not set +# CONFIG_PACKAGE_uuidd is not set +# CONFIG_PACKAGE_uuidgen is not set +# CONFIG_PACKAGE_uvcdynctrl is not set +# CONFIG_PACKAGE_v4l-utils is not set +# CONFIG_PACKAGE_view1090 is not set +# CONFIG_PACKAGE_watchcat is not set +# CONFIG_PACKAGE_whereis is not set +# CONFIG_PACKAGE_wifitoggle is not set +# CONFIG_PACKAGE_xsltproc is not set +# CONFIG_PACKAGE_xxd is not set +# CONFIG_PACKAGE_yanglint is not set +# CONFIG_PACKAGE_yara is not set +# CONFIG_PACKAGE_yunbridge is not set + +# +# Xorg +# + +# +# font-utils +# +# CONFIG_PACKAGE_fontconfig is not set diff --git a/config/Config-images.in b/config/Config-images.in index 03901ed94..b25761dce 100644 --- a/config/Config-images.in +++ b/config/Config-images.in @@ -142,7 +142,7 @@ menu "Target Images" int "Block size (in KiB)" depends on TARGET_ROOTFS_SQUASHFS default 64 if LOW_MEMORY_FOOTPRINT - default 256 + default 1024 menuconfig TARGET_ROOTFS_UBIFS bool "ubifs" diff --git a/include/target.mk b/include/target.mk index cefb19b24..cebc83064 100644 --- a/include/target.mk +++ b/include/target.mk @@ -13,11 +13,7 @@ __target_inc=1 DEVICE_TYPE?=router # Default packages - the really basic set -DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \ -iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ -default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ -luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \ -luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-nlbwmon +DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets diff --git a/package/lean/adbyby-ram/Makefile b/package/lean/adbyby-ram/Makefile new file mode 100644 index 000000000..6d6737615 --- /dev/null +++ b/package/lean/adbyby-ram/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (C) 2017 adbyby-ram +# Copyright (C) 2017 yushi studio +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=adbyby-ram +PKG_VERSION:=1.0 + + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=yushi studio + + + +include $(INCLUDE_DIR)/package.mk + +define Package/luci-app-adbyby-ram + SECTION:=luci + CATEGORY:=LuCI + SUBMENU:=3. Applications + TITLE:=adbyby-ram LuCI interface + URL:=https://github.com/ywb94/adbyby-ram + PKGARCH:=all +endef + +define Package/luci-app-adbyby-ram/description + LuCI Support for adbyby-ram. +endef + +define Build/Prepare + $(foreach po,$(wildcard ${CURDIR}/files/luci/i18n/*.po), \ + po2lmo $(po) $(PKG_BUILD_DIR)/$(patsubst %.po,%.lmo,$(notdir $(po)));) +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/luci-app-adbyby-ram/prerm +#!/bin/sh +# check if we are on real system +if [ -z "$${IPKG_INSTROOT}" ]; then + /etc/init.d/adbyby_ram disable + /etc/init.d/adbyby_ram stop +fi +exit 0 +endef + + + + + + +define Package/luci-app-adbyby-ram/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + chmod 755 /etc/init.d/adbyby_ram >/dev/null 2>&1 + /etc/init.d/adbyby_ram enable >/dev/null 2>&1 +fi +exit 0 +endef + +ifeq ($(ARCH),mips) +define Package/luci-app-adbyby-ram/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/adbyby_ar71xx.sh $(1)/usr/bin/adbyby.sh + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram +endef +endif + +ifeq ($(ARCH),mipsel) +define Package/luci-app-adbyby-ram/install + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DATA) ./files/luci/controller/adbyby.lua $(1)/usr/lib/lua/luci/controller/adbyby.lua + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DATA) $(PKG_BUILD_DIR)/adbyby.*.lmo $(1)/usr/lib/lua/luci/i18n + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi + $(INSTALL_DATA) ./files/luci/model/cbi/*.lua $(1)/usr/lib/lua/luci/model/cbi/ + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) ./files/adbyby_ramips.sh $(1)/usr/bin/adbyby.sh + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DATA) ./files/adbyby.config $(1)/etc/config/adbyby + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adbyby.init $(1)/etc/init.d/adbyby_ram +endef +endif + +$(eval $(call BuildPackage,luci-app-adbyby-ram)) diff --git a/package/lean/adbyby-ram/files/adbyby.config b/package/lean/adbyby-ram/files/adbyby.config new file mode 100644 index 000000000..a338dfa98 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby.config @@ -0,0 +1,3 @@ + +config adbyby 'adbyby' + option enable '0' \ No newline at end of file diff --git a/package/lean/adbyby-ram/files/adbyby.init b/package/lean/adbyby-ram/files/adbyby.init new file mode 100644 index 000000000..0de8f99b3 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby.init @@ -0,0 +1,58 @@ +#!/bin/sh /etc/rc.common + +###################################################################### +# +# Function : Run adbyby in RAM +# +# Creater : ywb94@qq.com, 2017-02-16 +# +# Copyright : yushi studio +# +###################################################################### + +START=80 + + +start() { +/etc/init.d/adbyby_ram enabled +if [ $? == 1 ]; then + return +fi +#²»Öظ´Æô¶¯ +icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` +icount2=`netstat -nautp|grep adbyby|grep -v grep|wc -l` + +if [ $icount = 0 -a $icount2 = 0 ] ;then +/usr/bin/adbyby.sh & +fi + +} + +stop() { +#È·±£Çå³ý·À»ðǽ¹æÔò +i=0 +icount=`iptables -t nat -L|grep "ports 8118"|wc -l` +while [ $i -le 10 -a $icount -gt 1 ] +do +let i=i+1 +iptables -t nat -D PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8118 +icount=`iptables -t nat -L|grep "ports 8118"|wc -l` +done + + +if [ -f /tmp/adbyby/bin/stopadbb ] ;then +cd /tmp/adbyby/bin +./stopadbb 2>/dev/null +fi + +icount=`ps -w|grep adbyby.sh|grep -v grep|wc -l` +if [ $icount -gt 0 ] ;then +mid=`ps -w|grep adbyby.sh|grep -v grep|awk '{print $1}'` +kill -9 $mid +fi +} + +restart() { + stop + start +} diff --git a/package/lean/adbyby-ram/files/adbyby_ar71xx.sh b/package/lean/adbyby-ram/files/adbyby_ar71xx.sh new file mode 100644 index 000000000..89a452d04 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby_ar71xx.sh @@ -0,0 +1,49 @@ +#!/bin/sh +cd /tmp +#µÈ´ýÍøÂçÁ¬½Ó³É¹¦ +wget_ok="0" +#rm -f 7620n.tar.gz +rm -f ar71xx.tar.gz + +while [ "$wget_ok" = "0" ] +do +#wget http://update.adbyby.com/download/7620n.tar.gz +wget http://update.adbyby.com/download/ar71xx.tar.gz +if [ "$?" == "0" ]; then +wget_ok="1" +else +sleep 30 +fi +done +#½âѹ¡¢Æô¶¯adbyby +mkdir -p adbyby +#tar -zvxf 7620n.tar.gz -C ./adbyby +tar -zvxf ar71xx.tar.gz -C ./adbyby + +#¸üÐÂÒ»´Î¹æÔò +murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` + +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + + +cd ./adbyby/bin +./startadbb + diff --git a/package/lean/adbyby-ram/files/adbyby_ramips.sh b/package/lean/adbyby-ram/files/adbyby_ramips.sh new file mode 100644 index 000000000..e1006dff7 --- /dev/null +++ b/package/lean/adbyby-ram/files/adbyby_ramips.sh @@ -0,0 +1,48 @@ +#!/bin/sh +cd /tmp +#µÈ´ýÍøÂçÁ¬½Ó³É¹¦ +wget_ok="0" +rm -f 7620n.tar.gz +#rm -f ar71xx.tar.gz + +while [ "$wget_ok" = "0" ] +do +wget http://update.adbyby.com/download/7620n.tar.gz +#wget http://update.adbyby.com/download/ar71xx.tar.gz +if [ "$?" == "0" ]; then +wget_ok="1" +else +sleep 30 +fi +done +#½âѹ¡¢Æô¶¯adbyby +mkdir -p adbyby +tar -zvxf 7620n.tar.gz -C ./adbyby +#tar -zvxf ar71xx.tar.gz -C ./adbyby + +#¸üÐÂÒ»´Î¹æÔò +murl=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $1}'` + +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep lazy.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep video.txt|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +murl=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $1}'` +if [ ${#murl} -gt 5 ] ;then +murl2=`cat /tmp/adbyby/bin/update.info|grep user.action|awk '{print $2}'` +mfile="/tmp/adbyby/bin"${murl2//\\//} +wget $murl -O $mfile +fi + +cd ./adbyby/bin +./startadbb + diff --git a/package/lean/adbyby-ram/files/luci/controller/adbyby.lua b/package/lean/adbyby-ram/files/luci/controller/adbyby.lua new file mode 100644 index 000000000..1347cfb33 --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/controller/adbyby.lua @@ -0,0 +1,10 @@ + +module("luci.controller.adbyby", package.seeall) + +function index() + if not nixio.fs.access("/etc/config/adbyby") then + return + end + + entry({"admin","services", "adbyby"}, cbi("adbyby"), _("Adbyby"), 20) +end diff --git a/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po b/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po new file mode 100644 index 000000000..6677ff646 --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/i18n/adbyby.zh-cn.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + +msgid "Not exist" +msgstr "ä¸å­˜åœ¨" + +msgid "AD Block" +msgstr "广告å±è”½" + +msgid "Disable" +msgstr "åœç”¨" + +msgid "Enable" +msgstr "å¯ç”¨" + +msgid "Running Status" +msgstr "è¿è¡ŒçŠ¶æ€" + +msgid "Lazy rules time" +msgstr "Lazy规则日期" + +msgid "Video rules time" +msgstr "Video规则日期" + +msgid "Running" +msgstr "è¿è¡Œä¸­" + +msgid "Not Running" +msgstr "未è¿è¡Œ" + +msgid "Wait Connect.." +msgstr "等待è”网" + +msgid "Enable Adbyby" +msgstr "是å¦å¯ç”¨Adbyby" + +msgid "Adbyby" +msgstr "广告å±è”½" diff --git a/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua b/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua new file mode 100644 index 000000000..cf7e19185 --- /dev/null +++ b/package/lean/adbyby-ram/files/luci/model/cbi/adbyby.lua @@ -0,0 +1,72 @@ + +local m, s, o,oo +local Run_flag=0 +local lazy_time=translate("Not exist") +local video_time=translate("Not exist") +local sys = require "luci.sys" +icount=tonumber(sys.exec("ps -w | grep adbyby |grep -v grep| wc -l")) +if tonumber(icount)>0 then +icount=tonumber(sys.exec("netstat -nautp | grep adbyby |grep -v grep| wc -l")) +if tonumber(icount)>0 then +Run_flag=1 +else +Run_flag=2 +end +end + +if nixio.fs.access("/tmp/adbyby/bin/data/lazy.txt") then +time_cmd="awk 'NR==1{print $3\" \"$4}' /tmp/adbyby/bin/data/lazy.txt" +lazy_time=sys.exec(time_cmd) +end + +if nixio.fs.access("/tmp/adbyby/bin/data/video.txt") then +time_cmd="awk 'NR==1{print $3\" \"$4}' /tmp/adbyby/bin/data/video.txt" +video_time=sys.exec(time_cmd) +end +m = Map("adbyby", translate("AD Block")) + + +s = m:section(NamedSection, "adbyby","adbyby", "") +s.addremove = false + +oo = s:option(ListValue, "enable",translate("Enable Adbyby")) +oo:value("0", translate("Disable")) +oo:value("1", translate("Enable")) +oo.widget = "radio" +oo.advance_second_title = true +oo.orientation = "horizontal" + +o=s:option(DummyValue, "runstatus",translate("Running Status")) +o.rawhtml = true +if Run_flag==1 then +o.value="" .. translate("Running") .. "" +elseif Run_flag==0 then +o.value="" .. translate("Not Running") .. "" +else +o.value="" .. translate("Wait Connect..") .. "" +end + +o=s:option(DummyValue, "version1",translate("Lazy rules time")) +o.rawhtml = true +o.value="" .. lazy_time .. "" + +o=s:option(DummyValue, "version2",translate("Video rules time")) +o.rawhtml = true +o.value="" .. video_time .. "" + +local apply = luci.http.formvalue("cbi.apply") +if apply then +local m_enable=luci.http.formvalue("cbid.adbyby.adbyby.enable") + if m_enable=="0" then + luci.sys.call("/etc/init.d/adbyby_ram disable") + luci.sys.call("/etc/init.d/adbyby_ram stop") + else + luci.sys.call("/etc/init.d/adbyby_ram enable") + luci.sys.call("/etc/init.d/adbyby_ram start") + end + + +--luci.http.redirect(luci.dispatcher.build_url("admin/services/adbyby")) +end + +return m From a242142c39d03fa5b238a0cd951d530f4bf7d715 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Jan 2018 11:57:01 +0800 Subject: [PATCH 93/95] add default target --- include/target.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/target.mk b/include/target.mk index cebc83064..cefb19b24 100644 --- a/include/target.mk +++ b/include/target.mk @@ -13,7 +13,11 @@ __target_inc=1 DEVICE_TYPE?=router # Default packages - the really basic set -DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd +DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fstools uclient-fetch logd ip-full \ +iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan block-mount automount \ +default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \ +luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \ +luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-nlbwmon # For nas targets DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm # For router targets From 20f7e757899ef65c1a723f199100c8d0a48b96e8 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Jan 2018 18:26:41 +0800 Subject: [PATCH 94/95] update to R7.5.4 --- config/Config-kernel.in | 19 +- feeds.conf.default | 2 +- include/autotools.mk | 4 +- include/download.mk | 6 +- include/image-commands.mk | 13 + include/image.mk | 4 +- include/kernel-defaults.mk | 3 + include/nls.mk | 2 +- include/package-dumpinfo.mk | 53 +- package/Makefile | 13 +- package/base-files/Makefile | 2 +- package/base-files/files/bin/config_generate | 5 +- .../base-files/files/etc/init.d/gpio_switch | 7 +- .../files/lib/functions/uci-defaults.sh | 2 + package/base-files/files/sbin/sysupgrade | 1 - package/boot/apex/Makefile | 3 +- .../boot/arm-trusted-firmware-sunxi/Makefile | 52 + package/boot/at91bootstrap/Makefile | 87 + package/boot/at91bootstrap/at91bootstrap.mk | 88 + package/boot/grub2/Makefile | 1 + package/boot/kexec-tools/Config.in | 9 +- package/boot/kexec-tools/Makefile | 80 +- package/boot/kexec-tools/files/kdump.config | 7 + package/boot/kexec-tools/files/kdump.defaults | 11 + package/boot/kexec-tools/files/kdump.init | 182 + .../boot/kobs-ng/patches/001-compile.patch | 3 +- package/boot/rbcfg/Makefile | 2 +- package/boot/rbcfg/src/main.c | 137 +- package/boot/rbcfg/src/rbcfg.h | 10 + package/boot/uboot-ar71xx/Makefile | 84 +- .../board/zyxel/nbg460n/Makefile | 0 .../board/zyxel/nbg460n/config.mk | 0 .../board/zyxel/nbg460n/lowlevel_init.S | 0 .../board/zyxel/nbg460n/nbg460n.c | 0 .../board/zyxel/nbg460n/u-boot.lds | 0 .../{files => src}/cpu/mips/ar71xx_serial.c | 0 .../{files => src}/drivers/net/ag71xx.c | 0 .../{files => src}/drivers/net/ag71xx.h | 0 .../{files => src}/drivers/net/phy/rtl8366.h | 0 .../drivers/net/phy/rtl8366_mii.c | 0 .../{files => src}/drivers/spi/ar71xx_spi.c | 0 .../{files => src}/include/asm-mips/ar71xx.h | 0 .../include/asm-mips/ar71xx_gpio.h | 0 .../{files => src}/include/configs/nbg460n.h | 0 package/boot/uboot-at91/Makefile | 139 +- package/boot/uboot-envtools/Makefile | 6 +- package/boot/uboot-envtools/files/ar71xx | 17 +- package/boot/uboot-envtools/files/cns3xxx | 3 +- package/boot/uboot-envtools/files/imx6 | 3 +- package/boot/uboot-envtools/files/ipq | 32 +- package/boot/uboot-envtools/files/kirkwood | 19 +- package/boot/uboot-envtools/files/lantiq | 10 +- package/boot/uboot-envtools/files/mvebu | 3 +- package/boot/uboot-envtools/files/mxs | 3 +- package/boot/uboot-envtools/files/oxnas | 3 +- package/boot/uboot-envtools/files/pistachio | 27 + package/boot/uboot-envtools/files/ramips | 11 +- package/boot/uboot-fritz4040/Makefile | 54 + .../uboot-fritz4040/files/upload-to-f4040.sh | 41 + .../patches/100-private-libgcc.patch | 274 + .../patches/110-portability.patch | 32 + package/boot/uboot-imx6/Makefile | 117 +- package/boot/uboot-kirkwood/Makefile | 139 +- ...-add-CONFIG_SYS_GENERIC_BOARD-define.patch | 27 - ...r-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 - ...ome-add-CONFIG_SYS_GENERIC_BOARD-def.patch | 23 - ...t-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 - ...2-add-CONFIG_SYS_GENERIC_BOARD-defin.patch | 23 - ...lug-add-CONFIG_SYS_GENERIC_BOARD-def.patch | 23 - .../patches/007-nsa310-uboot-generic.patch | 697 ++ .../patches/008-nsa325-uboot-generic.patch | 683 ++ .../patches/010-pogoplug_v4.patch | 1574 ++++ .../uboot-kirkwood/patches/110-dockstar.patch | 19 +- .../uboot-kirkwood/patches/120-iconnect.patch | 8 +- .../uboot-kirkwood/patches/130-ib62x0.patch | 2 +- .../patches/140-pogoplug_e02.patch | 2 +- .../patches/150-goflexhome.patch | 5 +- .../patches/200-openwrt-config.patch | 123 +- package/boot/uboot-lantiq/Makefile | 474 +- ...IPS-add-support-for-Lantiq-XWAY-SoCs.patch | 10 +- ...support-for-Lantiq-XWAY-ARX100-SoC-f.patch | 3 +- ...18-tools-lantiq-add-NAND-SPL-support.patch | 6 +- ...PS-lantiq-add-default-openwrt-config.patch | 3 +- .../patches/100-portability.patch | 18 + package/boot/uboot-layerscape-32b/Makefile | 98 - .../boot/uboot-layerscape-armv8_32b/Makefile | 53 + package/boot/uboot-layerscape/Makefile | 119 +- ...add-LEDE-boot-support-in-environment.patch | 51 + ...-add-LEDE-boot-support-in-environmen.patch | 57 + ...-add-LEDE-boot-support-in-environmen.patch | 51 + ...-add-LEDE-boot-support-in-environmen.patch | 58 + ...-add-LEDE-boot-support-in-environmen.patch | 54 + ...m-add-LEDE-boot-support-in-environme.patch | 49 + package/boot/uboot-mvebu/Makefile | 91 +- ...clearfog-generate-random-MAC-address.patch | 28 + ...learfog-reset-usom-onboard-1512-phy.patch} | 9 +- ...003-clearfog-enable-distro-boot-code.patch | 97 + ...og-enable-setexpr-command-by-default.patch | 24 + .../patches/001-use-dtc-in-kernel.patch | 11 - ...011-rsa-Fix-build-with-OpenSSL-1.1.x.patch | 153 + ...wbimage-fix-build-with-OpenSSL-1.1.x.patch | 96 + .../patches/002-enable_random_mac_addr.patch | 10 - .../uboot-mvebu/patches/003-boot_script.patch | 32 - package/boot/uboot-mxs/Makefile | 87 +- package/boot/uboot-omap/Makefile | 104 +- .../boot/uboot-omap/files/uEnv-default.txt | 8 + ...ream_image_c_fix_non_android_booting.patch | 33 - .../100-disable_thumb_unknown_errata.patch | 11 - .../patches/101-disable-thumb-omap3.patch | 14 + .../uboot-omap/patches/101-disable_ext.patch | 10 - .../uboot-omap/patches/102-minify-spl.patch | 44 + .../patches/103-disable-fat-write-spl.patch | 27 + .../104-omap3-overo-enable-thumb.patch | 18 + package/boot/uboot-oxnas/Makefile | 90 +- .../arch/arm/cpu/arm1136/nas782x/Makefile | 0 .../arch/arm/cpu/arm1136/nas782x/clock.c | 0 .../arch/arm/cpu/arm1136/nas782x/pinmux.c | 0 .../arch/arm/cpu/arm1136/nas782x/reset.c | 0 .../arch/arm/cpu/arm1136/nas782x/timer.c | 0 .../arch/arm/include/asm/arch-nas782x/clock.h | 0 .../arch/arm/include/asm/arch-nas782x/cpu.h | 0 .../arm/include/asm/arch-nas782x/hardware.h | 0 .../arm/include/asm/arch-nas782x/pinmux.h | 0 .../arch/arm/include/asm/arch-nas782x/spl.h | 0 .../arm/include/asm/arch-nas782x/sysctl.h | 0 .../arch/arm/include/asm/arch-nas782x/timer.h | 0 .../{files => src}/board/ox820/Kconfig | 0 .../{files => src}/board/ox820/MAINTAINERS | 0 .../{files => src}/board/ox820/Makefile | 0 .../{files => src}/board/ox820/ddr.c | 0 .../{files => src}/board/ox820/ddr.h | 0 .../board/ox820/lowlevel_init.S | 0 .../{files => src}/board/ox820/ox820.c | 0 .../{files => src}/board/ox820/spl_start.S | 0 .../{files => src}/board/ox820/u-boot-spl.lds | 0 .../{files => src}/common/env_ext4.c | 0 .../{files => src}/common/spl/spl_block.c | 0 .../{files => src}/configs/ox820_defconfig | 0 .../drivers/block/plxsata_ide.c | 0 .../drivers/usb/host/ehci-oxnas.c | 0 .../{files => src}/include/configs/ox820.h | 0 .../{files => src}/tools/mkox820crc.c | 0 package/boot/uboot-pxa/Makefile | 91 - .../001-squashfs_rootfstype_cmdline.patch | 13 - package/boot/uboot-sunxi/Makefile | 269 +- .../patches/001-use-dtc-in-kernel.patch | 11 - .../patches/002-add-olimex-a13-som.patch | 3 +- .../003-add-theobroma-a31-pangolin.patch | 22 +- .../010-dt-sync-files-with-kernel.patch | 1403 ---- .../011-dt-sync-dts-files-with-kernel.patch | 7211 ----------------- .../012-sun6i-fix-clock_twi_onoff.patch | 38 - .../patches/013-enable-realtek-phy.patch | 24 - .../patches/014-fix-gmac-init.patch | 127 - .../015-fix-2nd-usb-ctrler-on-sun47i.patch | 78 - .../patches/016-spl-print-mmc-slot.patch | 31 - ...17-usb-add-support-for-usb3-vbus-pin.patch | 39 - ...8-usb-specify-vbus-pins-on-orangepis.patch | 31 - ...19-sid-add-efuse-support-for-h3-a83t.patch | 33 - ...-boot-display-board-model-on-startup.patch | 23 - ...t-for-Olimex-A20-OLinuXino-LIME2-eMM.patch | 76 + ...ange-node-name-for-pwrseq-pin-on-Oli.patch | 31 + .../patches/062-A20-improve-gmac-upload.patch | 12 + ...1-sun6i-sync-PLL1-multdiv-with-Boot1.patch | 6 +- .../093-sun6i-fix-PLL-LDO-voltselect.patch | 15 +- .../100-sun6i-alternate-on-UART2.patch | 4 +- .../101-sun6i-support-console-on-UART2.patch | 8 +- ...2-sunxi-make_CONS_INDEX-configurable.patch | 6 +- ...-environment-for-dtc-binary-location.patch | 35 + ...ile-Build-python-libfdt-library-if-n.patch | 89 + ...akefile.lib-Always-have-.-u-boot.dts.patch | 26 + ...ert-Avoid-non-portable-sed-construct.patch | 21 + ...rt-sunxi-Use-binman-for-sunxi-boards.patch | 58 + ...d-device-tree-for-Orange-Pi-R1-board.patch | 182 + .../301-sunxi-add-orangepi-R1-defconfig.patch | 48 + ...nxi-Fix-CONFIG_SUNXI_GMAC-references.patch | 83 + package/boot/uboot-sunxi/uEnv-a64.txt | 5 + package/boot/uboot-zynq/Makefile | 115 +- package/devel/binutils/Makefile | 1 + package/devel/gdb-arc/Makefile | 6 +- package/devel/gdb/Makefile | 10 +- .../001-gdb-pr14523-mips-signal-number.patch | 2 +- package/devel/gdb/patches/100-musl_fix.patch | 2 +- .../devel/gdb/patches/110-shared_libgcc.patch | 76 + .../120-sigprocmask-invalid-call.patch | 38 + package/devel/perf/Makefile | 5 +- package/devel/strace/Makefile | 6 +- package/devel/valgrind/Makefile | 1 + package/firmware/ipq-wifi/Makefile | 5 +- package/firmware/ipq-wifi/board-nbg6617.bin | Bin 24276 -> 0 bytes .../firmware/ipq-wifi/board-openmesh_a42.bin | Bin 0 -> 85372 bytes package/firmware/ipq-wifi/board-rt-ac58u.bin | Bin 24276 -> 0 bytes package/kernel/ath10k-ct/Makefile | 9 +- ...tral-scan-support-under-a-separate-c.patch | 81 + .../lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c | 6 +- .../lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c | 2 +- package/kernel/linux/modules/w1.mk | 1 + package/kernel/mac80211/Makefile | 17 +- .../mac80211/files/lib/wifi/mac80211.sh | 2 +- ...ral-scan-support-under-a-separate-co.patch | 103 + ...tral-scan-support-under-a-separate-c.patch | 91 + .../937-ath10k-calibration-variant.patch | 106 + package/lean/default-settings/Makefile | 2 +- .../files/zzz-default-settings | 6 +- package/lean/polarssl/Makefile | 74 + .../polarssl/patches/100-disable_sslv3.patch | 12 + .../polarssl/patches/200-reduce_config.patch | 252 + .../patches/001-throw-in-funcdef.patch | 16 +- package/libs/elfutils/Makefile | 1 + package/libs/libevent2/Makefile | 1 + package/libs/libiconv-full/Makefile | 2 +- package/libs/libjson-c/Makefile | 3 +- package/libs/libnetfilter-conntrack/Makefile | 12 +- package/libs/libnetfilter-queue/Makefile | 8 +- .../patches/100-checksum_computation.patch | 18 +- package/libs/libnftnl/Makefile | 8 +- package/libs/libnl/Makefile | 16 +- ...-of-strerror_l-if-it-doesn-t-exist-i.patch | 105 - ...ivate-field-in-libnl-pkg-config-file.patch | 30 + ...workaround-to-the-libc-compat.h-copy.patch | 103 + ...ild-enable-building-cli-during-tests.patch | 115 + package/libs/libpcap/Makefile | 3 +- package/libs/librpc/Makefile | 2 +- package/libs/libtool/Makefile | 1 + package/libs/libubox/Makefile | 6 +- package/libs/libunwind/Makefile | 1 + package/libs/libusb-compat/Makefile | 6 +- package/libs/lzo/Makefile | 4 - package/libs/mbedtls/Makefile | 1 + package/libs/mbedtls/patches/200-config.patch | 9 - package/libs/ncurses/Makefile | 20 + package/libs/nghttp2/Makefile | 45 + package/libs/openssl/Config.in | 5 + package/libs/openssl/Makefile | 23 +- .../patches/110-optimize-for-size.patch | 3 +- .../patches/160-disable_doc_tests.patch | 4 +- .../openssl/patches/200-parallel_build.patch | 10 +- .../libs/{libreadline => readline}/Makefile | 3 + .../patches/001-install_perm.patch | 0 package/libs/toolchain/Makefile | 51 +- package/libs/uclient/Makefile | 2 +- package/libs/ustream-ssl/Makefile | 16 +- package/libs/{cyassl => wolfssl}/Config.in | 26 +- package/libs/{cyassl => wolfssl}/Makefile | 49 +- .../patches/001-CVE-2017-13099.patch | 0 .../patches/100-disable-hardening-check.patch | 11 + .../400-additional_compatibility.patch | 0 package/network/config/firewall/Makefile | 8 +- package/network/config/gre/Makefile | 2 +- package/network/config/gre/files/gre.sh | 11 +- package/network/config/ltq-adsl-app/Makefile | 10 +- .../config/ltq-adsl-app/files/10_atm.sh | 29 + .../config/ltq-adsl-app/files/10_ptm.sh | 29 + .../config/ltq-adsl-app/files/dsl_control | 19 +- .../100-add-more-script-notifications.patch | 42 + package/network/config/ltq-vdsl-app/Makefile | 11 +- .../config/ltq-vdsl-app/files/10_atm.sh | 14 + .../config/ltq-vdsl-app/files/10_ptm.sh | 14 + .../config/ltq-vdsl-app/files/dsl_control | 48 +- .../files/vdsl_cpe_control_wrapper | 11 - package/network/config/netifd/Makefile | 10 +- .../netifd/files/lib/netifd/dhcp.script | 18 +- .../netifd/files/lib/netifd/proto/dhcp.sh | 1 + package/network/config/qos-scripts/Makefile | 1 + package/network/config/vti/Makefile | 2 +- package/network/config/vti/files/vti.sh | 7 +- package/network/config/vxlan/Makefile | 32 + package/network/config/vxlan/files/vxlan.sh | 148 + package/network/ipv6/6rd/Makefile | 2 +- package/network/ipv6/6rd/files/6rd.sh | 8 +- package/network/ipv6/map/Makefile | 2 +- package/network/ipv6/map/files/map.sh | 17 +- package/network/ipv6/map/src/mapcalc.c | 2 +- package/network/ipv6/odhcp6c/Makefile | 13 +- .../network/ipv6/odhcp6c/files/dhcpv6.script | 17 + package/network/ipv6/odhcp6c/files/dhcpv6.sh | 7 +- package/network/services/dnsmasq/Makefile | 32 +- .../services/dnsmasq/files/dhcp-script.sh | 46 + .../network/services/dnsmasq/files/dhcp.conf | 2 +- .../services/dnsmasq/files/dnsmasq.init | 390 +- .../services/dnsmasq/files/dnsmasq_acl.json | 4 + .../services/dnsmasq/files/rfc6761.conf | 15 + .../services/dnsmasq/patches/240-ubus.patch | 128 + package/network/services/dropbear/Makefile | 3 +- .../patches/120-openwrt_options.patch | 6 +- package/network/services/hostapd/Makefile | 10 +- .../hostapd/files/hostapd-full.config | 266 +- .../hostapd/files/hostapd-mini.config | 256 +- .../network/services/hostapd/files/hostapd.sh | 66 +- .../hostapd/files/wpa_supplicant-full.config | 373 +- .../hostapd/files/wpa_supplicant-mini.config | 394 +- .../hostapd/files/wpa_supplicant-p2p.config | 369 +- ...-key-reinstallation-in-FT-handshake.patch} | 60 +- ...on-between-AssocResp-callback-and-4a.patch | 83 - ...ation-of-an-already-in-use-group-ke.patch} | 22 +- ...-of-GTK-IGTK-reinstallation-of-WNM-.patch} | 31 +- ...Reassociation-Request-frame-dropping.patch | 36 - ...vent-installation-of-an-all-zero-TK.patch} | 16 +- ...-clearing-on-Authentication-frame-RX.patch | 40 - ...K-rekeying-to-generate-a-new-ANonce.patch} | 4 +- ...ibility-to-send-debug-messages-to-sy.patch | 145 - ...-TDLS-Reject-TPK-TK-reconfiguration.patch} | 4 +- ...eep-Mode-Response-without-pending-r.patch} | 0 ...ultiple-Reassociation-Response-fram.patch} | 16 +- ...-against-PTK-reinstalls-in-4-way-ha.patch} | 0 ...and-check-for-this-when-deriving-PT.patch} | 0 ...workaround-for-key-reinstallation-a.patch} | 34 +- ...tentcy-checks-for-PTK-component-len.patch} | 22 +- ...mation-in-supplicant-state-machine-.patch} | 0 ...ons-wpa_group_update_count-and-wpa_p.patch | 305 - ...eep-Mode-Request-in-wnm_sleep_mode-.patch} | 0 .../hostapd/patches/100-daemonize_fix.patch | 2 +- .../hostapd/patches/110-no_eapol_fix.patch | 2 +- ...120-disable_bridge_packet_workaround.patch | 2 +- .../hostapd/patches/200-multicall.patch | 57 +- .../services/hostapd/patches/300-noscan.patch | 6 +- .../patches/310-rescan_immediately.patch | 2 +- .../patches/330-nl80211_fix_set_freq.patch | 2 +- .../patches/340-reload_freq_change.patch | 6 +- .../patches/350-nl80211_del_beacon_bss.patch | 46 +- .../patches/360-ctrl_iface_reload.patch | 8 +- .../hostapd/patches/370-ap_sta_support.patch | 20 +- .../patches/380-disable_ctrl_iface_mib.patch | 32 +- .../patches/390-wpa_ie_cap_workaround.patch | 4 +- .../patches/420-indicate-features.patch | 4 +- .../patches/430-hostapd_cli_ifdef.patch | 16 +- ...dd-new-config-params-to-be-used-with.patch | 16 +- ...-use-new-parameters-during-ibss-join.patch | 4 +- .../462-wpa_s-support-htmode-param.patch | 156 - .../patches/463-add-mcast_rate-to-11s.patch | 6 +- .../patches/464-fix-mesh-obss-check.patch | 19 + .../patches/470-survey_data_fallback.patch | 2 +- .../hostapd/patches/600-ubus_support.patch | 113 +- .../services/hostapd/src/src/ap/ubus.c | 220 + .../services/hostapd/src/src/ap/ubus.h | 5 + package/network/services/ipset-dns/Makefile | 6 +- .../patches/100-simultaneous-ipv4-ipv6.patch | 57 - package/network/services/lldpd/Makefile | 4 +- .../network/services/lldpd/files/lldpd.config | 2 +- .../network/services/lldpd/files/lldpd.init | 2 +- package/network/services/odhcpd/Makefile | 98 +- .../services/odhcpd/files/odhcpd.defaults | 1 + package/network/services/omcproxy/Makefile | 2 +- .../services/omcproxy/files/omcproxy.init | 4 +- .../services/openvpn-easy-rsa/Makefile | 41 +- .../openvpn-easy-rsa/files/easy-rsa.index | 0 .../openvpn-easy-rsa/files/easy-rsa.serial | 1 - .../files/openvpn-easy-rsa.upgrade | 1 + .../patches/100-run-ootb.patch | 152 - package/network/services/openvpn/Makefile | 1 + package/network/services/relayd/Makefile | 2 +- package/network/services/samba36/Makefile | 34 +- .../services/samba36/files/samba.config | 4 +- .../network/services/samba36/files/samba.init | 6 +- package/network/services/uhttpd/Makefile | 21 +- .../services/uhttpd/files/uhttpd.config | 6 +- .../network/services/uhttpd/files/uhttpd.init | 2 +- package/network/services/umdns/Makefile | 8 +- .../network/utils/adb-enablemodem/Makefile | 26 + .../adb-enablemodem/files/adb-enablemodem | 64 + package/network/utils/arptables/Makefile | 2 +- package/network/utils/comgt/Makefile | 2 +- package/network/utils/comgt/files/ncm.json | 11 + package/network/utils/comgt/files/ncm.sh | 27 +- .../network/utils/conntrack-tools/Makefile | 13 +- package/network/utils/curl/Config.in | 8 +- package/network/utils/curl/Makefile | 28 +- .../patches/001-curl-https-openssl-fix.patch | 34 - .../curl/patches/100-CVE-2017-2629.patch | 33 - .../curl/patches/101-CVE-2017-7407.patch | 165 - .../curl/patches/102-CVE-2017-7468.patch | 264 - .../curl/patches/103-CVE-2017-1000100.patch | 41 - .../curl/patches/104-CVE-2017-1000101.patch | 33 - .../curl/patches/105-CVE-2017-8816.patch | 67 - .../curl/patches/106-CVE-2017-8817.patch | 141 - .../curl/patches/200-no_docs_tests.patch | 28 +- ...bedtls-disable-runtime-version-check.patch | 4 +- package/network/utils/ebtables/Makefile | 8 +- package/network/utils/iperf/Makefile | 13 +- package/network/utils/iperf3/Makefile | 40 +- .../010-iperf-3.3-fix-build-warnings.patch | 300 + package/network/utils/iproute2/Makefile | 83 +- .../utils/iproute2/patches/001-config.patch | 4 +- .../iproute2/patches/004-darwin_fixes.patch | 2 +- .../utils/iproute2/patches/006-no_sctp.patch | 4 +- .../utils/iproute2/patches/007-no_arpd.patch | 6 +- .../utils/iproute2/patches/008-no_netem.patch | 8 +- .../patches/009-keep_libmnl_optional.patch | 11 + .../iproute2/patches/010-type_fixes.patch | 396 - .../patches/100-allow_pfifo_fast.patch | 2 +- .../iproute2/patches/110-extra-ccopts.patch | 2 +- .../iproute2/patches/120-libnetlink-pic.patch | 7 +- .../patches/130-missing_include.patch | 20 - ...bc-compat.h-do-not-rely-on-__GLIBC__.patch | 107 + ...prevent-redefinition-of-struct-ethhd.patch | 67 + .../utils/iproute2/patches/300-ip_tiny.patch | 45 +- .../patches/900-drop_FAILED_POLICY.patch | 33 +- .../910-sanitize_headers_for_musl.patch | 10 - .../patches/911-fix_in_h_include.patch | 30 - .../iproute2/patches/950-add-cake-to-tc.patch | 10 +- ...-monitor-can-t-work-when-NET_NS-is-n.patch | 35 - package/network/utils/ipset/Makefile | 23 +- ...t-reference-to-u_int8_t-with-uint8_t.patch | 25 + package/network/utils/iptables/Makefile | 66 +- .../020-iptables-disable-modprobe.patch | 4 +- .../patches/030-no-libnfnetlink.patch | 94 - .../iptables/patches/050-optional-xml.patch | 2 +- .../iptables/patches/100-bash-location.patch | 8 - .../patches/200-configurable_builtin.patch | 45 +- .../iptables/patches/300-musl_fixes.patch | 127 - .../iptables/patches/600-shared-libext.patch | 60 +- .../700-disable-legacy-revisions.patch | 51 +- package/network/utils/iputils/Makefile | 1 + package/network/utils/iw/Makefile | 3 +- .../utils/iw/patches/001-nl80211_h_sync.patch | 407 +- package/network/utils/iwinfo/Makefile | 8 +- .../network/utils/layerscape/restool/Makefile | 38 + ...ripts-move-shebang-on-the-first-line.patch | 35 + ...ull-path-option-to-dprc-list-command.patch | 151 + ...03-scripts-remove-unnecessary-arrays.patch | 62 + ...scripts-use-restool-full-path-option.patch | 111 + ...e-proper-arithmetic-operation-syntax.patch | 26 + ...cripts-use-strings-instead-of-arrays.patch | 79 + ...-use-Bourne-shell-s-pattern-matching.patch | 126 + ...pts-use-Bourne-shell-instead-of-bash.patch | 32 + ...nd-for-a-improper-sed-substitution-T.patch | 36 + ...pts-use-proper-arithmetic-operations.patch | 44 + ...ompare-strings-with-regexp-expressio.patch | 27 + ...nproc-with-cross-platform-implementa.patch | 27 + package/network/utils/linux-atm/Makefile | 1 + .../network/utils/linux-atm/files/br2684ctl | 7 +- .../patches/501-br2684ctl_itfname.patch | 74 + package/network/utils/nftables/Makefile | 8 +- ...atement-fix-print-of-ip-dnat-address.patch | 76 + package/network/utils/tcpdump/Makefile | 1 + .../tcpdump/patches/100-tcpdump_mini.patch | 37 +- package/network/utils/umbim/Makefile | 2 +- package/network/utils/uqmi/Makefile | 2 +- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 2 + package/network/utils/wpan-tools/Makefile | 1 + ...h-fix-compatibility-with-libnl-3.3.0.patch | 44 + package/network/utils/wwan/files/wwan.sh | 26 +- package/network/utils/xtables-addons/Makefile | 10 +- .../patches/201-fix-lua-packetscript.patch | 20 + package/system/fstools/Makefile | 23 +- package/system/fstools/files/blockd.init | 21 + package/system/fstools/files/snapshot | 16 +- package/system/lede-keyring/Makefile | 2 +- package/system/mountd/Makefile | 45 - package/system/mountd/files/mountd.config | 3 - package/system/mountd/files/mountd.init | 22 - package/system/procd/Makefile | 2 +- package/system/procd/files/procd.sh | 1 + package/system/rpcd/Makefile | 2 +- package/system/ubox/Makefile | 18 +- package/system/ubus/Makefile | 8 +- package/system/uci/Makefile | 6 +- package/system/uci/files/lib/config/uci.sh | 5 +- package/system/usign/Makefile | 2 +- package/utils/adb/Makefile | 2 +- package/utils/busybox/Config-defaults.in | 1470 ++-- package/utils/busybox/Makefile | 92 +- package/utils/busybox/config/Config.in | 410 +- .../utils/busybox/config/archival/Config.in | 185 +- .../busybox/config/console-tools/Config.in | 153 +- .../utils/busybox/config/coreutils/Config.in | 1297 ++- .../busybox/config/debianutils/Config.in | 20 +- .../utils/busybox/config/editors/Config.in | 37 +- .../utils/busybox/config/findutils/Config.in | 40 +- package/utils/busybox/config/init/Config.in | 58 +- package/utils/busybox/config/libbb/Config.in | 179 +- .../utils/busybox/config/loginutils/Config.in | 36 +- .../utils/busybox/config/mailutils/Config.in | 18 +- .../utils/busybox/config/miscutils/Config.in | 619 +- .../utils/busybox/config/modutils/Config.in | 239 +- .../utils/busybox/config/networking/Config.in | 1576 ++-- .../busybox/config/networking/udhcp/Config.in | 86 +- package/utils/busybox/config/procps/Config.in | 288 +- package/utils/busybox/config/runit/Config.in | 7 + .../utils/busybox/config/selinux/Config.in | 41 +- package/utils/busybox/config/shell/Config.in | 469 +- .../utils/busybox/config/sysklogd/Config.in | 3 +- .../utils/busybox/config/util-linux/Config.in | 1064 +-- .../config/util-linux/volume_id/Config.in | 137 +- ...om-do-not-require-that-to-should-hav.patch | 37 - .../patches/102-trylink_mktemp_fix.patch | 20 - .../patches/120-remove_uclibc_rpc_check.patch | 12 - .../patches/200-udhcpc_reduce_msgs.patch | 4 +- .../patches/201-udhcpc_changed_ifindex.patch | 2 +- .../203-udhcpc_renew_no_deconfig.patch | 2 +- .../busybox/patches/210-add_netmsg_util.patch | 54 +- .../busybox/patches/220-add_lock_util.patch | 54 +- .../patches/230-add_nslookup_lede.patch | 24 +- .../busybox/patches/240-telnetd_intr.patch | 2 +- .../busybox/patches/250-date-k-flag.patch | 12 +- .../301-ip-link-fix-netlink-msg-size.patch | 2 +- ...02-ip-rule-add-suppress-prefixlength.patch | 145 - .../patches/302-netlink-alignment.patch | 100 - .../303-ip-route-fix-high-table-ids.patch | 486 -- ...ch-file-with-x-when-modified_count-0.patch | 100 - ...g-a-new-file-with-ZZ-when-no-editing.patch | 53 - .../500-move-traceroute-applets-to-bin.patch | 13 + .../510-move-passwd-applet-to-bin.patch | 11 + .../busybox/patches/600-cve-2017-16544.patch | 35 + package/utils/bzip2/Makefile | 1 + package/utils/ct-bugcheck/src/bugcheck.sh | 2 +- package/utils/e2fsprogs/Makefile | 24 +- package/utils/f2fs-tools/Makefile | 9 +- ...fs-f2fs-segment.c-718-update_sit_ent.patch | 66 - package/utils/fritz-tools/Makefile | 45 + package/utils/fritz-tools/README.md | 50 + package/utils/fritz-tools/src/CMakeLists.txt | 15 + .../utils/fritz-tools/src/fritz_cal_extract.c | 259 + .../utils/fritz-tools/src/fritz_tffs_read.c | 379 + package/utils/fuse/Makefile | 1 + package/utils/jsonfilter/Makefile | 2 +- .../010-lua-5.1.3-lnum-full-260308.patch | 47 +- ...2-lnum-fix-ltle-relational-operators.patch | 4 +- .../utils/lua/patches/020-shared_liblua.patch | 2 +- .../utils/lua/patches/050-honor-cflags.patch | 2 +- .../lua/patches/300-opcode_performance.patch | 32 +- package/utils/otrx/src/otrx.c | 73 +- package/utils/ugps/Makefile | 8 +- package/utils/usbmode/Makefile | 8 +- package/utils/util-linux/Makefile | 14 +- .../001-uclibc_add_libm_to_scriptreplay.patch | 24 - .../patches/003-fix_pkgconfig_files.patch | 4 +- .../util-linux/patches/100-use_urandom.patch | 14 + package/utils/xfsprogs/Makefile | 27 +- .../patches/001-automake-compat.patch | 78 - .../xfsprogs/patches/100-no-selftest.patch | 14 + .../utils/xfsprogs/patches/100-no_aio.patch | 19 - .../utils/xfsprogs/patches/110-subdirs.patch | 12 + .../patches/110-uclibc_no_ustat.patch | 32 - .../xfsprogs/patches/120-disable_assert.patch | 12 + .../xfsprogs/patches/120-portability.patch | 45 - .../patches/130-uclibc_no_xattr.patch | 32 - .../utils/xfsprogs/patches/140-no_po.patch | 19 - .../xfsprogs/patches/150-include_fixes.patch | 72 - .../patches/160-format-security.patch | 29 - scripts/combined-ext-image.sh | 29 +- scripts/feeds | 178 +- scripts/metadata.pm | 103 +- scripts/om-fwupgradecfg-gen.sh | 22 +- scripts/package-metadata.pl | 307 +- target/linux/apm821xx/Makefile | 2 +- .../apm821xx/{config-4.9 => config-4.14} | 66 +- target/linux/apm821xx/dts/meraki-mr24.dts | 12 + .../linux/apm821xx/dts/netgear-wndr4700.dts | 6 +- target/linux/apm821xx/nand/config-default | 4 + ...-crypto-gcm-add-GCM-IV-size-constant.patch | 27 + ...crypto-crypto4xx-remove-bad-list_del.patch | 32 + ...-remove-unused-definitions-and-write.patch | 120 + ...-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch | 31 + ...-remove-extern-statement-before-func.patch | 76 + ...-remove-double-assignment-of-pd_uinf.patch | 24 + ...-fix-dynamic_sa_ctl-s-sa_contents-de.patch | 87 + ...-move-and-refactor-dynamic_contents-.patch | 234 + ...-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch | 248 + ...x-refactor-crypto4xx_copy_pkt_to_dst.patch | 171 + ...-replace-crypto4xx_dev-s-scatter_buf.patch | 59 + ...-fix-crypto4xx_build_pdr-crypto4xx_b.patch | 84 + ...rypto4xx-pointer-arithmetic-overhaul.patch | 373 + ...to4xx-wire-up-hmac_mc-to-hmac_muting.patch | 25 + ...pto-crypto4xx-fix-off-by-one-AES-OFB.patch | 49 + ...4xx-fix-type-mismatch-compiler-error.patch | 29 + ...-crypto4xx-add-backlog-queue-support.patch | 161 + ...-use-the-correct-LE32-format-for-IV-.patch | 236 + ...rypto4xx-overhaul-crypto4xx_build_pd.patch | 535 ++ ...rypto-crypto4xx-fix-various-warnings.patch | 62 + ...rypto4xx-fix-stalls-under-heavy-load.patch | 112 + ...-simplify-sa-and-state-context-acqui.patch | 209 + ...o-crypto4xx-prepare-for-AEAD-support.patch | 617 ++ ...crypto-crypto4xx-add-aes-ccm-support.patch | 256 + ...crypto-crypto4xx-add-aes-gcm-support.patch | 220 + ...lace-custom-rgmii_mode_name-with-phy.patch | 51 + ...emac-replace-custom-PHY_MODE_-macros.patch | 246 + ...-emac-support-RGMII-RX-TX-ID-phymode.patch | 59 + ...-shuffle-iomap-in-front-of-request_i.patch | 71 + ...o-crypto4xx-support-Revision-B-parts.patch | 150 + ...to-crypto4xx-fix-missing-irq-devname.patch | 37 + ...04-crypto-crypto4xx-kill-MODULE_NAME.patch | 47 + ...-perform-aead-icv-check-in-the-drive.patch | 146 + ...-crypto4xx-performance-optimizations.patch | 158 + .../200-add-meraki-mr24-ikarem-support.patch | 2 +- .../201-add-amcc-apollo3g-support.patch | 2 +- .../202-add-netgear-wndr4700-support.patch | 6 +- ...-add-meraki-mx60-buckminster-support.patch | 2 +- .../300-fix-atheros-nics-on-apm82181.patch | 8 +- .../301-fix-memory-map-wndr4700.patch | 6 +- .../701-powerpc_ibm_apm82181_phyclk_fix.patch | 6 +- ...mware-loader-for-uPD720201-and-uPD72.patch | 8 +- .../802-usb-xhci-force-msi-renesas-xhci.patch | 8 +- ...03-hwmon-tc654-add-detection-routine.patch | 65 + ...mon-tc654-add-thermal_cooling-device.patch | 174 + .../702-powerpc_ibm_phy_add_dt_parser.patch | 328 - ...ac-fix-reset-timeout-with-AR8035-phy.patch | 112 - .../804-usb-dwc2-add-amcc-usb-otg-405ex.patch | 48 - ...-for-Microchip-TC654-TC655-PWM-fan-c.patch | 1027 --- target/linux/ar71xx/Makefile | 2 +- .../ar71xx/base-files/etc/board.d/01_leds | 33 +- .../ar71xx/base-files/etc/board.d/02_network | 23 +- target/linux/ar71xx/base-files/etc/diag.sh | 12 +- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 4 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 16 +- target/linux/ar71xx/base-files/lib/ar71xx.sh | 30 +- .../lib/preinit/05_set_iface_mac_ar71xx | 70 +- .../lib/preinit/05_set_preinit_iface_ar71xx | 76 +- .../base-files/lib/preinit/82_patch_ath10k | 33 +- .../ar71xx/base-files/lib/upgrade/platform.sh | 14 +- target/linux/ar71xx/config-4.4 | 5 + target/linux/ar71xx/config-4.9 | 6 +- .../files/arch/mips/ath79/Kconfig.openwrt | 49 + .../ar71xx/files/arch/mips/ath79/Makefile | 5 + .../files/arch/mips/ath79/mach-ap91-5g.c | 118 + .../files/arch/mips/ath79/mach-gl-ar750.c | 146 + .../ar71xx/files/arch/mips/ath79/mach-n5q.c | 132 + .../ar71xx/files/arch/mips/ath79/mach-r36a.c | 140 + .../ar71xx/files/arch/mips/ath79/mach-rbspi.c | 97 +- .../files/arch/mips/ath79/mach-rut9xx.c | 191 + .../files/arch/mips/ath79/mach-tl-wr941n-v7.c | 279 - .../files/arch/mips/ath79/mach-wlr8100.c | 14 +- .../ar71xx/files/arch/mips/ath79/machtypes.h | 6 + target/linux/ar71xx/generic/config-default | 7 + .../ar71xx/image/generic-legacy-devices.mk | 6 - target/linux/ar71xx/image/generic.mk | 112 + target/linux/ar71xx/image/legacy.mk | 2 - target/linux/ar71xx/image/mikrotik.mk | 1 + target/linux/ar71xx/image/tiny-tp-link.mk | 29 - ...MIPS-ath79-add-routerboard-detection.patch | 5 +- ...1-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch | 12 + ...MIPS-ath79-add-routerboard-detection.patch | 5 +- ...1-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch | 12 + target/linux/armvirt/64/config-default | 13 + target/linux/armvirt/Makefile | 2 +- target/linux/armvirt/config-4.14 | 180 + target/linux/at91/image/sama5.mk | 8 +- target/linux/brcm2708/bcm2708/config-4.9 | 1 - target/linux/brcm2708/bcm2709/config-4.9 | 1 - target/linux/brcm2708/bcm2710/config-4.9 | 1 - ...s-add-of_match_table-parser-matching.patch | 121 + ...of_match_table-with-fixed-partitions.patch | 43 + ...s-add-of_match_table-parser-matching.patch | 121 + ...of_match_table-with-fixed-partitions.patch | 43 + target/linux/generic/config-3.18 | 2 +- target/linux/generic/config-4.14 | 53 +- target/linux/generic/config-4.4 | 12 +- target/linux/generic/config-4.9 | 18 +- ...-generic-parsing-of-linux-part-probe.patch | 16 +- .../400-mtd-add-rootfs-split-support.patch | 13 +- ...for-different-partition-parser-types.patch | 6 +- ...arsers-for-rootfs-and-firmware-split.patch | 6 +- .../404-mtd-add-more-helper-functions.patch | 6 +- .../411-mtd-partial_eraseblock_write.patch | 8 +- .../412-mtd-partial_eraseblock_unlock.patch | 2 +- ...or-fix-Spansion-regressions-aliased-.patch | 37 + ...-generic-parsing-of-linux-part-probe.patch | 16 +- .../400-mtd-add-rootfs-split-support.patch | 13 +- ...for-different-partition-parser-types.patch | 6 +- ...arsers-for-rootfs-and-firmware-split.patch | 6 +- .../404-mtd-add-more-helper-functions.patch | 6 +- .../411-mtd-partial_eraseblock_write.patch | 8 +- .../412-mtd-partial_eraseblock_unlock.patch | 2 +- ...or-fix-Spansion-regressions-aliased-.patch | 37 + .../kirkwood/base-files/etc/board.d/01_leds | 53 +- .../base-files/etc/board.d/02_network | 32 +- target/linux/kirkwood/base-files/etc/diag.sh | 25 +- .../base-files/etc/init.d/linksys_recovery | 2 +- .../base-files/etc/init.d/nsa310_fancontrol | 2 +- .../linux/kirkwood/base-files/lib/kirkwood.sh | 88 - .../base-files/lib/preinit/01_sysinfo | 9 - .../base-files/lib/upgrade/platform.sh | 26 +- target/linux/kirkwood/image/Makefile | 153 +- .../kirkwood/patches-4.9/100-ib62x0.patch | 9 + .../kirkwood/patches-4.9/107-02-nsa310b.patch | 2 +- .../kirkwood/patches-4.9/107-03-nsa310s.patch | 267 - .../kirkwood/patches-4.9/108-on100.patch | 4 +- .../patches-4.9/109-pogoplug_v4.patch | 59 + .../lantiq/base-files/etc/board.d/02_network | 2 +- .../etc/uci-defaults/02_migrate_xdsl_iface | 12 + target/linux/layerscape/armv8_32b/config-4.9 | 1 - target/linux/layerscape/armv8_64b/config-4.9 | 1 - target/linux/malta/Makefile | 2 +- target/linux/malta/README | 8 +- target/linux/malta/config-4.14 | 309 + target/linux/mpc85xx/config-4.9 | 1 - target/linux/octeon/config-4.14 | 1 - target/linux/octeon/config-4.9 | 1 - .../ramips/base-files/etc/board.d/01_leds | 7 +- .../ramips/base-files/etc/board.d/02_network | 6 +- target/linux/ramips/base-files/etc/diag.sh | 14 +- .../ramips/base-files/lib/upgrade/platform.sh | 1 + target/linux/ramips/dts/AC1200RM.dts | 171 + target/linux/ramips/dts/GB-PC1.dts | 5 + target/linux/ramips/dts/UBNT-ER-e50.dtsi | 2 +- target/linux/ramips/dts/UBNT-ERX-SFP.dts | 2 +- target/linux/ramips/image/mt7620.mk | 9 + target/linux/sunxi/config-4.9 | 3 +- target/linux/x86/config-4.9 | 1 + target/linux/x86/generic/config-default | 2 - target/linux/x86/legacy/config-default | 2 - target/linux/xburst/config-3.18 | 1 - target/linux/zynq/config-4.4 | 1 - target/sdk/Makefile | 3 +- 703 files changed, 27268 insertions(+), 23733 deletions(-) create mode 100644 package/boot/arm-trusted-firmware-sunxi/Makefile create mode 100644 package/boot/at91bootstrap/Makefile create mode 100644 package/boot/at91bootstrap/at91bootstrap.mk create mode 100644 package/boot/kexec-tools/files/kdump.config create mode 100644 package/boot/kexec-tools/files/kdump.defaults create mode 100755 package/boot/kexec-tools/files/kdump.init rename package/boot/uboot-ar71xx/{files => src}/board/zyxel/nbg460n/Makefile (100%) rename package/boot/uboot-ar71xx/{files => src}/board/zyxel/nbg460n/config.mk (100%) rename package/boot/uboot-ar71xx/{files => src}/board/zyxel/nbg460n/lowlevel_init.S (100%) rename package/boot/uboot-ar71xx/{files => src}/board/zyxel/nbg460n/nbg460n.c (100%) rename package/boot/uboot-ar71xx/{files => src}/board/zyxel/nbg460n/u-boot.lds (100%) rename package/boot/uboot-ar71xx/{files => src}/cpu/mips/ar71xx_serial.c (100%) rename package/boot/uboot-ar71xx/{files => src}/drivers/net/ag71xx.c (100%) rename package/boot/uboot-ar71xx/{files => src}/drivers/net/ag71xx.h (100%) rename package/boot/uboot-ar71xx/{files => src}/drivers/net/phy/rtl8366.h (100%) rename package/boot/uboot-ar71xx/{files => src}/drivers/net/phy/rtl8366_mii.c (100%) rename package/boot/uboot-ar71xx/{files => src}/drivers/spi/ar71xx_spi.c (100%) rename package/boot/uboot-ar71xx/{files => src}/include/asm-mips/ar71xx.h (100%) rename package/boot/uboot-ar71xx/{files => src}/include/asm-mips/ar71xx_gpio.h (100%) rename package/boot/uboot-ar71xx/{files => src}/include/configs/nbg460n.h (100%) create mode 100644 package/boot/uboot-envtools/files/pistachio create mode 100644 package/boot/uboot-fritz4040/Makefile create mode 100755 package/boot/uboot-fritz4040/files/upload-to-f4040.sh create mode 100644 package/boot/uboot-fritz4040/patches/100-private-libgcc.patch create mode 100644 package/boot/uboot-fritz4040/patches/110-portability.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch delete mode 100644 package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch create mode 100644 package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch create mode 100644 package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch create mode 100644 package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch create mode 100644 package/boot/uboot-lantiq/patches/100-portability.patch delete mode 100644 package/boot/uboot-layerscape-32b/Makefile create mode 100644 package/boot/uboot-layerscape-armv8_32b/Makefile create mode 100644 package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch create mode 100644 package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch create mode 100644 package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch create mode 100644 package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch rename package/boot/uboot-mvebu/patches/{200-clearfog-reset-usom-onboard-1512-phy.patch => 0002-clearfog-reset-usom-onboard-1512-phy.patch} (81%) create mode 100644 package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch create mode 100644 package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch delete mode 100644 package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch create mode 100644 package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch create mode 100644 package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch delete mode 100644 package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch delete mode 100644 package/boot/uboot-mvebu/patches/003-boot_script.patch create mode 100644 package/boot/uboot-omap/files/uEnv-default.txt delete mode 100644 package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch delete mode 100644 package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch create mode 100644 package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch delete mode 100644 package/boot/uboot-omap/patches/101-disable_ext.patch create mode 100644 package/boot/uboot-omap/patches/102-minify-spl.patch create mode 100644 package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch create mode 100644 package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch rename package/boot/uboot-oxnas/{files => src}/arch/arm/cpu/arm1136/nas782x/Makefile (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/cpu/arm1136/nas782x/clock.c (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/cpu/arm1136/nas782x/pinmux.c (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/cpu/arm1136/nas782x/reset.c (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/cpu/arm1136/nas782x/timer.c (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/clock.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/cpu.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/hardware.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/pinmux.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/spl.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/sysctl.h (100%) rename package/boot/uboot-oxnas/{files => src}/arch/arm/include/asm/arch-nas782x/timer.h (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/Kconfig (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/MAINTAINERS (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/Makefile (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/ddr.c (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/ddr.h (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/lowlevel_init.S (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/ox820.c (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/spl_start.S (100%) rename package/boot/uboot-oxnas/{files => src}/board/ox820/u-boot-spl.lds (100%) rename package/boot/uboot-oxnas/{files => src}/common/env_ext4.c (100%) rename package/boot/uboot-oxnas/{files => src}/common/spl/spl_block.c (100%) rename package/boot/uboot-oxnas/{files => src}/configs/ox820_defconfig (100%) rename package/boot/uboot-oxnas/{files => src}/drivers/block/plxsata_ide.c (100%) rename package/boot/uboot-oxnas/{files => src}/drivers/usb/host/ehci-oxnas.c (100%) rename package/boot/uboot-oxnas/{files => src}/include/configs/ox820.h (100%) rename package/boot/uboot-oxnas/{files => src}/tools/mkox820crc.c (100%) delete mode 100644 package/boot/uboot-pxa/Makefile delete mode 100644 package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch delete mode 100644 package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch delete mode 100644 package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch delete mode 100644 package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch delete mode 100644 package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch delete mode 100644 package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch delete mode 100644 package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch delete mode 100644 package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch delete mode 100644 package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch delete mode 100644 package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch delete mode 100644 package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch delete mode 100644 package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch delete mode 100644 package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch create mode 100644 package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch create mode 100644 package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch create mode 100644 package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch create mode 100644 package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch create mode 100644 package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch create mode 100644 package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch create mode 100644 package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch create mode 100644 package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch create mode 100644 package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch create mode 100644 package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch create mode 100644 package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch create mode 100644 package/boot/uboot-sunxi/uEnv-a64.txt create mode 100644 package/devel/gdb/patches/110-shared_libgcc.patch create mode 100644 package/devel/gdb/patches/120-sigprocmask-invalid-call.patch delete mode 100644 package/firmware/ipq-wifi/board-nbg6617.bin create mode 100644 package/firmware/ipq-wifi/board-openmesh_a42.bin delete mode 100644 package/firmware/ipq-wifi/board-rt-ac58u.bin create mode 100644 package/kernel/ath10k-ct/patches/200-ath10k-move-spectral-scan-support-under-a-separate-c.patch create mode 100644 package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch create mode 100644 package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch create mode 100644 package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch create mode 100644 package/lean/polarssl/Makefile create mode 100644 package/lean/polarssl/patches/100-disable_sslv3.patch create mode 100644 package/lean/polarssl/patches/200-reduce_config.patch delete mode 100644 package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch create mode 100644 package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch create mode 100644 package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch create mode 100644 package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch create mode 100644 package/libs/nghttp2/Makefile rename package/libs/{libreadline => readline}/Makefile (95%) rename package/libs/{libreadline => readline}/patches/001-install_perm.patch (100%) rename package/libs/{cyassl => wolfssl}/Config.in (63%) rename package/libs/{cyassl => wolfssl}/Makefile (69%) rename package/libs/{cyassl => wolfssl}/patches/001-CVE-2017-13099.patch (100%) create mode 100644 package/libs/wolfssl/patches/100-disable-hardening-check.patch rename package/libs/{cyassl => wolfssl}/patches/400-additional_compatibility.patch (100%) create mode 100755 package/network/config/ltq-adsl-app/files/10_atm.sh create mode 100755 package/network/config/ltq-adsl-app/files/10_ptm.sh create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch create mode 100755 package/network/config/ltq-vdsl-app/files/10_atm.sh create mode 100755 package/network/config/ltq-vdsl-app/files/10_ptm.sh delete mode 100644 package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper create mode 100644 package/network/config/vxlan/Makefile create mode 100755 package/network/config/vxlan/files/vxlan.sh create mode 100755 package/network/services/dnsmasq/files/dhcp-script.sh create mode 100644 package/network/services/dnsmasq/files/dnsmasq_acl.json create mode 100644 package/network/services/dnsmasq/files/rfc6761.conf create mode 100644 package/network/services/dnsmasq/patches/240-ubus.patch rename package/network/services/hostapd/patches/{005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch => 000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch} (84%) delete mode 100644 package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch rename package/network/services/hostapd/patches/{006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch => 001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch} (91%) rename package/network/services/hostapd/patches/{007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch => 002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch} (84%) delete mode 100644 package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch rename package/network/services/hostapd/patches/{008-Prevent-installation-of-an-all-zero-TK.patch => 003-Prevent-installation-of-an-all-zero-TK.patch} (76%) delete mode 100644 package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch rename package/network/services/hostapd/patches/{009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch => 004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch} (94%) delete mode 100644 package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch rename package/network/services/hostapd/patches/{010-TDLS-Reject-TPK-TK-reconfiguration.patch => 005-TDLS-Reject-TPK-TK-reconfiguration.patch} (97%) rename package/network/services/hostapd/patches/{011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch => 006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch} (100%) rename package/network/services/hostapd/patches/{012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch => 007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch} (84%) rename package/network/services/hostapd/patches/{014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch => 008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch} (100%) rename package/network/services/hostapd/patches/{015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch => 009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch} (100%) rename package/network/services/hostapd/patches/{016-Optional-AP-side-workaround-for-key-reinstallation-a.patch => 010-Optional-AP-side-workaround-for-key-reinstallation-a.patch} (90%) rename package/network/services/hostapd/patches/{017-Additional-consistentcy-checks-for-PTK-component-len.patch => 011-Additional-consistentcy-checks-for-PTK-component-len.patch} (81%) rename package/network/services/hostapd/patches/{018-Clear-BSSID-information-in-supplicant-state-machine-.patch => 012-Clear-BSSID-information-in-supplicant-state-machine-.patch} (100%) delete mode 100644 package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch rename package/network/services/hostapd/patches/{019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch => 013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch} (100%) delete mode 100644 package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch create mode 100644 package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch delete mode 100644 package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch delete mode 100644 package/network/services/openvpn-easy-rsa/files/easy-rsa.index delete mode 100644 package/network/services/openvpn-easy-rsa/files/easy-rsa.serial create mode 100644 package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade delete mode 100644 package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch create mode 100644 package/network/utils/adb-enablemodem/Makefile create mode 100644 package/network/utils/adb-enablemodem/files/adb-enablemodem delete mode 100644 package/network/utils/curl/patches/001-curl-https-openssl-fix.patch delete mode 100644 package/network/utils/curl/patches/100-CVE-2017-2629.patch delete mode 100644 package/network/utils/curl/patches/101-CVE-2017-7407.patch delete mode 100644 package/network/utils/curl/patches/102-CVE-2017-7468.patch delete mode 100644 package/network/utils/curl/patches/103-CVE-2017-1000100.patch delete mode 100644 package/network/utils/curl/patches/104-CVE-2017-1000101.patch delete mode 100644 package/network/utils/curl/patches/105-CVE-2017-8816.patch delete mode 100644 package/network/utils/curl/patches/106-CVE-2017-8817.patch create mode 100644 package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch create mode 100644 package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch delete mode 100644 package/network/utils/iproute2/patches/010-type_fixes.patch delete mode 100644 package/network/utils/iproute2/patches/130-missing_include.patch create mode 100644 package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch create mode 100644 package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch delete mode 100644 package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch delete mode 100644 package/network/utils/iproute2/patches/911-fix_in_h_include.patch delete mode 100644 package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch create mode 100644 package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch delete mode 100644 package/network/utils/iptables/patches/030-no-libnfnetlink.patch delete mode 100644 package/network/utils/iptables/patches/100-bash-location.patch delete mode 100644 package/network/utils/iptables/patches/300-musl_fixes.patch create mode 100644 package/network/utils/layerscape/restool/Makefile create mode 100644 package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch create mode 100644 package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch create mode 100644 package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch create mode 100644 package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch create mode 100644 package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch create mode 100644 package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch create mode 100644 package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch create mode 100644 package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch create mode 100644 package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch create mode 100644 package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch create mode 100644 package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch create mode 100644 package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch create mode 100644 package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch create mode 100644 package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch create mode 100644 package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch create mode 100755 package/system/fstools/files/blockd.init delete mode 100644 package/system/mountd/Makefile delete mode 100644 package/system/mountd/files/mountd.config delete mode 100755 package/system/mountd/files/mountd.init delete mode 100644 package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch delete mode 100644 package/utils/busybox/patches/102-trylink_mktemp_fix.patch delete mode 100644 package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch delete mode 100644 package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch delete mode 100644 package/utils/busybox/patches/302-netlink-alignment.patch delete mode 100644 package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch delete mode 100644 package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch delete mode 100644 package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch create mode 100644 package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch create mode 100644 package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch create mode 100644 package/utils/busybox/patches/600-cve-2017-16544.patch delete mode 100644 package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch create mode 100644 package/utils/fritz-tools/Makefile create mode 100644 package/utils/fritz-tools/README.md create mode 100644 package/utils/fritz-tools/src/CMakeLists.txt create mode 100644 package/utils/fritz-tools/src/fritz_cal_extract.c create mode 100644 package/utils/fritz-tools/src/fritz_tffs_read.c delete mode 100644 package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch create mode 100644 package/utils/util-linux/patches/100-use_urandom.patch delete mode 100644 package/utils/xfsprogs/patches/001-automake-compat.patch create mode 100644 package/utils/xfsprogs/patches/100-no-selftest.patch delete mode 100644 package/utils/xfsprogs/patches/100-no_aio.patch create mode 100644 package/utils/xfsprogs/patches/110-subdirs.patch delete mode 100644 package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch create mode 100644 package/utils/xfsprogs/patches/120-disable_assert.patch delete mode 100644 package/utils/xfsprogs/patches/120-portability.patch delete mode 100644 package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch delete mode 100644 package/utils/xfsprogs/patches/140-no_po.patch delete mode 100644 package/utils/xfsprogs/patches/150-include_fixes.patch delete mode 100644 package/utils/xfsprogs/patches/160-format-security.patch rename target/linux/apm821xx/{config-4.9 => config-4.14} (84%) create mode 100644 target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch create mode 100644 target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch create mode 100644 target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch create mode 100644 target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch create mode 100644 target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch create mode 100644 target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/200-add-meraki-mr24-ikarem-support.patch (95%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/201-add-amcc-apollo3g-support.patch (94%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/202-add-netgear-wndr4700-support.patch (88%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/203-add-meraki-mx60-buckminster-support.patch (95%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/300-fix-atheros-nics-on-apm82181.patch (88%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/301-fix-memory-map-wndr4700.patch (74%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/701-powerpc_ibm_apm82181_phyclk_fix.patch (91%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch (98%) rename target/linux/apm821xx/{patches-4.9 => patches-4.14}/802-usb-xhci-force-msi-renesas-xhci.patch (91%) create mode 100644 target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch create mode 100644 target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch delete mode 100644 target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch delete mode 100644 target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch delete mode 100644 target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch delete mode 100644 target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c create mode 100644 target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c delete mode 100755 target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c create mode 100644 target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch create mode 100644 target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch create mode 100644 target/linux/armvirt/config-4.14 create mode 100644 target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch create mode 100644 target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch create mode 100644 target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch create mode 100644 target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch create mode 100644 target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch create mode 100644 target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch delete mode 100755 target/linux/kirkwood/base-files/lib/kirkwood.sh delete mode 100644 target/linux/kirkwood/base-files/lib/preinit/01_sysinfo delete mode 100644 target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch create mode 100644 target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch create mode 100644 target/linux/malta/config-4.14 create mode 100644 target/linux/ramips/dts/AC1200RM.dts diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 078755df6..fa06b5044 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -62,7 +62,7 @@ config KERNEL_PROFILING config KERNEL_KALLSYMS bool "Compile the kernel with symbol table information" - default n + default y if !SMALL_FLASH help This will give you more information in stack traces from kernel oopses. @@ -607,6 +607,17 @@ config KERNEL_SECCOMP help Build kernel with support for seccomp. +# +# IPv4 configuration +# + +config KERNEL_IP_MROUTE + bool "Enable IPv4 multicast routing" + default y + help + Multicast routing requires a multicast routing daemon in + addition to kernel support. + # # IPv6 configuration # @@ -623,7 +634,11 @@ if KERNEL_IPV6 def_bool y config KERNEL_IPV6_MROUTE - def_bool y + bool "Enable IPv6 multicast routing" + default y + help + Multicast routing requires a multicast routing daemon in + addition to kernel support. config KERNEL_IPV6_PIMSM_V2 def_bool n diff --git a/feeds.conf.default b/feeds.conf.default index b1df8e257..040dbdc55 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,5 +1,5 @@ src-git packages https://git.lede-project.org/feed/packages.git -src-git luci https://git.lede-project.org/project/luci.git;lede-17.01 +src-git luci https://git.lede-project.org/project/luci.git src-git routing https://git.lede-project.org/feed/routing.git src-git telephony https://git.lede-project.org/feed/telephony.git #src-git video https://github.com/openwrt/video.git diff --git a/include/autotools.mk b/include/autotools.mk index 7bd400ab3..aa044aa0b 100644 --- a/include/autotools.mk +++ b/include/autotools.mk @@ -105,14 +105,14 @@ ifneq ($(filter patch-libtool,$(PKG_FIXUP)),) endif ifneq ($(filter libtool,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif endif ifneq ($(filter libtool-ucxx,$(PKG_FIXUP)),) - PKG_BUILD_DEPENDS += libtool libintl libiconv + PKG_BUILD_DEPENDS += libtool gettext libiconv ifeq ($(filter no-autoreconf,$(PKG_FIXUP)),) Hooks/Configure/Pre += autoreconf_target endif diff --git a/include/download.mk b/include/download.mk index 0a2564173..2ba8a7bdf 100644 --- a/include/download.mk +++ b/include/download.mk @@ -6,8 +6,10 @@ # See /LICENSE for more information. # -OPENWRT_GIT = http://git.openwrt.org -LEDE_GIT = https://git.lede-project.org +PROJECT_GIT = https://git.openwrt.org + +OPENWRT_GIT = $(PROJECT_GIT) +LEDE_GIT = $(PROJECT_GIT) ifdef PKG_SOURCE_VERSION PKG_VERSION ?= $(if $(PKG_SOURCE_DATE),$(PKG_SOURCE_DATE)-)$(call version_abbrev,$(PKG_SOURCE_VERSION)) diff --git a/include/image-commands.mk b/include/image-commands.mk index 5f0ac6164..bcc1256df 100644 --- a/include/image-commands.mk +++ b/include/image-commands.mk @@ -229,6 +229,19 @@ define Build/combined-image @mv $@.new $@ endef +define Build/openmesh-image + $(TOPDIR)/scripts/om-fwupgradecfg-gen.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \ + "$@-fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \ + "$(call param_get_default,rootfs,$(1),$@)" + $(TOPDIR)/scripts/combined-ext-image.sh \ + "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \ + "$@-fwupgrade.cfg" "fwupgrade.cfg" \ + "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \ + "$(call param_get_default,rootfs,$(1),$@)" "rootfs" +endef + define Build/sysupgrade-tar sh $(TOPDIR)/scripts/sysupgrade-tar.sh \ --board $(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)) \ diff --git a/include/image.mk b/include/image.mk index 605cb0667..af01951b4 100644 --- a/include/image.mk +++ b/include/image.mk @@ -303,9 +303,9 @@ target-dir-%: FORCE $(opkg_target) update && \ $(opkg_target) install \ $(call opkg_package_files,$(mkfs_packages_add))) + -$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/ + rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf $(call prepare_rootfs,$(mkfs_cur_target_dir)) - -mv $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir)/etc/opkg - rm -f $(mkfs_cur_target_dir).conf $(KDIR)/root.%: kernel_prepare $(call Image/mkfs/$(word 1,$(target_params)),$(target_params)) diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk index f0618633b..33f3a8210 100644 --- a/include/kernel-defaults.mk +++ b/include/kernel-defaults.mk @@ -63,6 +63,8 @@ ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y) $(call Kernel/SetInitramfs/PreConfigure) echo 'CONFIG_INITRAMFS_ROOT_UID=$(shell id -u)' >> $(LINUX_DIR)/.config echo 'CONFIG_INITRAMFS_ROOT_GID=$(shell id -g)' >> $(LINUX_DIR)/.config + echo 'CONFIG_INITRAMFS_FORCE=y' >> $(LINUX_DIR)/.config + echo "$(if $(CONFIG_TARGET_INITRAMFS_FORCE),CONFIG_INITRAMFS_FORCE=y,# CONFIG_INITRAMFS_FORCE is not set)" >> $(LINUX_DIR)/.config echo "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_NONE),CONFIG_INITRAMFS_COMPRESSION_NONE=y,# CONFIG_INITRAMFS_COMPRESSION_NONE is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP),CONFIG_INITRAMFS_COMPRESSION_GZIP=y\nCONFIG_RD_GZIP=y,# CONFIG_INITRAMFS_COMPRESSION_GZIP is not set\n# CONFIG_RD_GZIP is not set)" >> $(LINUX_DIR)/.config echo -e "$(if $(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2),CONFIG_INITRAMFS_COMPRESSION_BZIP2=y\nCONFIG_RD_BZIP2=y,# CONFIG_INITRAMFS_COMPRESSION_BZIP2 is not set\n# CONFIG_RD_BZIP2 is not set)" >> $(LINUX_DIR)/.config @@ -78,6 +80,7 @@ define Kernel/SetNoInitramfs mv $(LINUX_DIR)/.config.set $(LINUX_DIR)/.config.old grep -v INITRAMFS $(LINUX_DIR)/.config.old > $(LINUX_DIR)/.config.set echo 'CONFIG_INITRAMFS_SOURCE=""' >> $(LINUX_DIR)/.config.set + echo '# CONFIG_INITRAMFS_FORCE is not set' >> $(LINUX_DIR)/.config.set endef define Kernel/Configure/Default diff --git a/include/nls.mk b/include/nls.mk index 51463b9f1..04838821b 100644 --- a/include/nls.mk +++ b/include/nls.mk @@ -23,7 +23,7 @@ else endif PKG_CONFIG_DEPENDS += CONFIG_BUILD_NLS -PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:libintl +PKG_BUILD_DEPENDS += !BUILD_NLS:libiconv !BUILD_NLS:gettext ICONV_DEPENDS:=+BUILD_NLS:libiconv-full ICONV_CFLAGS:=-I$(ICONV_PREFIX)/include diff --git a/include/package-dumpinfo.mk b/include/package-dumpinfo.mk index 1be7d958d..8a42be5bd 100644 --- a/include/package-dumpinfo.mk +++ b/include/package-dumpinfo.mk @@ -7,23 +7,17 @@ ifneq ($(DUMP),) -dumpinfo: FORCE -define Config/template -Preconfig: $(1) -Preconfig-Type: $(2) -Preconfig-Default: $(3) -Preconfig-Label: $(4) +define SOURCE_INFO +$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) +)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) +)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) +) endef -define Config - Preconfig/$(1) = $$(call Config/template,$(1),$(2),$(3),$(4)) - preconfig_$$(1) += $(1) -endef - define Dumpinfo/Package -$(info Package: $(1) +$(info $(SOURCE_INFO)Package: $(1) $(if $(MENU),Menu: $(MENU) )$(if $(SUBMENU),Submenu: $(SUBMENU) )$(if $(SUBMENUDEP),Submenu-Depends: $(SUBMENUDEP) @@ -36,10 +30,7 @@ Menu-Depends: $(MDEPENDS) Provides: $(PROVIDES) $(if $(VARIANT),Build-Variant: $(VARIANT) $(if $(DEFAULT_VARIANT),Default-Variant: $(VARIANT) -))$(if $(PKG_BUILD_DEPENDS),Build-Depends: $(PKG_BUILD_DEPENDS) -)$(if $(HOST_BUILD_DEPENDS),Build-Depends/host: $(HOST_BUILD_DEPENDS) -)$(if $(BUILD_TYPES),Build-Types: $(BUILD_TYPES) -)Section: $(SECTION) +))Section: $(SECTION) Category: $(CATEGORY) $(if $(filter nonshared,$(PKGFLAGS)),,Repository: $(if $(FEED),$(FEED),base) )Title: $(TITLE) @@ -59,33 +50,11 @@ $(if $(URL),$(URL) $(if $(Package/$(1)/config),Config: $(Package/$(1)/config) @@ -)$(foreach pc,$(preconfig_$(1)), -$(Preconfig/$(pc)))) +)) +SOURCE_INFO := endef -define Feature/Default - TARGET_NAME:= - TARGET_TITLE:= - PRIORITY:= - NAME:= -endef - -define Feature - $(eval $(Feature/Default)) - $(eval $(Feature/$(1))) - $(if $(DUMP),$(call Dumpinfo/Feature,$(1))) -endef - -define Dumpinfo/Feature -$(info Feature: $(TARGET_NAME)_$(1) -Target-Name: $(TARGET_NAME) -Target-Title: $(TARGET_TITLE) -Feature-Name: $(NAME) -$(if $(PRIORITY),Feature-Priority: $(PRIORITY) -)Feature-Description: -$(Feature/$(1)/description) -@@ -) -endef +dumpinfo: FORCE + $(if $(SOURCE_INFO),$(info $(SOURCE_INFO))) endif diff --git a/package/Makefile b/package/Makefile index cc1e9d4b6..0aefbb802 100644 --- a/package/Makefile +++ b/package/Makefile @@ -10,8 +10,8 @@ curdir:=package include $(INCLUDE_DIR)/rootfs.mk -include $(TMP_DIR)/.packagedeps +$(curdir)/autoremove:=1 $(curdir)/builddirs:=$(sort $(package-) $(package-y) $(package-m)) -$(curdir)/builddirs-install:=. $(curdir)/builddirs-default:=. $(sort $(package-y) $(package-m)) $(curdir)/builddirs-prereq:=. $(sort $(prereq-y) $(prereq-m)) ifdef CHECK_ALL @@ -56,10 +56,14 @@ $(curdir)/merge: $(curdir)/merge-index: $(curdir)/merge (cd $(PACKAGE_DIR_ALL) && $(SCRIPT_DIR)/ipkg-make-index.sh . 2>&1 > Packages; ) -$(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) +ifndef SDK + $(curdir)/compile: $(curdir)/system/opkg/host/compile +endif + +$(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DEVICE_ROOTFS),$(curdir)/merge-index) - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG) - [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp + mkdir -p $(TARGET_DIR)/tmp $(call opkg,$(TARGET_DIR)) install \ $(call opkg_package_files,$(shell cat $(PACKAGE_INSTALL_FILES) 2>/dev/null)) @for file in $(PACKAGE_INSTALL_FILES); do \ @@ -68,7 +72,6 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/system/opkg/host/compile $(curdir $(call opkg,$(TARGET_DIR)) flag $$flag `cat $$file`; \ done; \ done || true - @-$(MAKE) package/preconfig $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG) @@ -92,8 +95,6 @@ ifdef CONFIG_SIGNED_PACKAGES ); done endif -$(curdir)/preconfig: - $(curdir)/flags-install:= -j1 $(eval $(call stampfile,$(curdir),package,prereq,.config)) diff --git a/package/base-files/Makefile b/package/base-files/Makefile index a7cc4ca48..005547416 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -12,7 +12,7 @@ include $(INCLUDE_DIR)/version.mk include $(INCLUDE_DIR)/feeds.mk PKG_NAME:=base-files -PKG_RELEASE:=181 +PKG_RELEASE:=183 PKG_FLAGS:=nonshared PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/ diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index bbed567de..fa148685c 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -24,8 +24,8 @@ generate_static_network() { json_select dsl if json_is_a atmbridge object; then json_select atmbridge - local vpi vci encaps payload - json_get_vars vpi vci encaps payload + local vpi vci encaps payload nameprefix + json_get_vars vpi vci encaps payload nameprefix uci -q batch <<-EOF delete network.atm set network.atm='atm-bridge' @@ -33,6 +33,7 @@ generate_static_network() { set network.atm.vci='$vci' set network.atm.encaps='$encaps' set network.atm.payload='$payload' + set network.atm.nameprefix='$nameprefix' EOF json_select .. fi diff --git a/package/base-files/files/etc/init.d/gpio_switch b/package/base-files/files/etc/init.d/gpio_switch index 1f1b44b21..b67950a99 100755 --- a/package/base-files/files/etc/init.d/gpio_switch +++ b/package/base-files/files/etc/init.d/gpio_switch @@ -1,7 +1,7 @@ #!/bin/sh /etc/rc.common # Copyright (C) 2015 OpenWrt.org -START=98 +START=94 STOP=10 USE_PROCD=1 @@ -22,10 +22,9 @@ load_gpio_switch() echo "$gpio_pin" >/sys/class/gpio/export # we need to wait a bit until the GPIO appears [ -d "$gpio_path" ] || sleep 1 - echo out >"$gpio_path/direction" } - # write 0 or 1 to the "value" field - { [ "$value" = "0" ] && echo "0" || echo "1"; } >"$gpio_path/value" + # set the pin to output with high or low pin value + { [ "$value" = "0" ] && echo "high" || echo "low"; } >"$gpio_path/direction" } service_triggers() diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 82ac1d2a4..3126fe651 100755 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -319,6 +319,7 @@ ucidef_add_atm_bridge() { local vci="$2" local encaps="$3" local payload="$4" + local nameprefix="$5" json_select_object dsl json_select_object atmbridge @@ -326,6 +327,7 @@ ucidef_add_atm_bridge() { json_add_int vci "$vci" json_add_string encaps "$encaps" json_add_string payload "$payload" + json_add_string nameprefix "$nameprefix" json_select .. json_select .. } diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade index 3fd612c37..c747c4eaa 100755 --- a/package/base-files/files/sbin/sysupgrade +++ b/package/base-files/files/sbin/sysupgrade @@ -55,7 +55,6 @@ Usage: $0 [...] $0 [-q] [-i] upgrade-option: - -d add a delay before rebooting -f restore configuration from .tar.gz (file or url) -i interactive mode -c attempt to preserve all changed files in /etc/ diff --git a/package/boot/apex/Makefile b/package/boot/apex/Makefile index fb3c77c37..d90df8e58 100644 --- a/package/boot/apex/Makefile +++ b/package/boot/apex/Makefile @@ -56,7 +56,8 @@ define Package/apex/install endef define Build/InstallDev - $(CP) $(PKG_BUILD_DIR)/out/*.bin $(KERNEL_BUILD_DIR) + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/out/*.bin $(STAGING_DIR_IMAGE)/ endef $(eval $(call BuildPackage,apex)) diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile new file mode 100644 index 000000000..88d4f6efa --- /dev/null +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2017 Hauke Mehrtens +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=arm-trusted-firmware-sunxi +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL=https://github.com/apritzel/arm-trusted-firmware +PKG_SOURCE_DATE:=2016-07-12 +PKG_SOURCE_VERSION:=87e8aedd80e6448a55b2328768d956fcb5f5d410 +PKG_MIRROR_HASH:=4e71a7d4bc0613533854c646b0fa574b18503c0ab28621aac67c70b9827562d8 + +PKG_LICENSE:=BSD-3-Clause +PKG_LICENSE_FILES:=license.md + +PKG_MAINTAINER:=Hauke Mehrtens + +include $(INCLUDE_DIR)/package.mk + + +define Package/arm-trusted-firmware-sunxi + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:=ARM Trusted Firmware for Allwinner + DEPENDS:=@TARGET_sunxi_cortexa53 +endef + +export GCC_HONOUR_COPTS=s + +MAKE_VARS = \ + CROSS_COMPILE="$(TARGET_CROSS)" + +MAKE_FLAGS += \ + PLAT=sun50iw1p1 \ + DEBUG=1 \ + bl31 + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/build/sun50iw1p1/debug/bl31.bin $(STAGING_DIR_IMAGE)/bl31.bin +endef + +define Package/arm-trusted-firmware-sunxi/install +endef + +$(eval $(call BuildPackage,arm-trusted-firmware-sunxi)) diff --git a/package/boot/at91bootstrap/Makefile b/package/boot/at91bootstrap/Makefile new file mode 100644 index 000000000..e704c357d --- /dev/null +++ b/package/boot/at91bootstrap/Makefile @@ -0,0 +1,87 @@ +# +# Copyright (C) 2016 Microchip Technology Inc. +# +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=at91bootstrap +PKG_VERSION:=v3.8.8 +PKG_RELEASE:= + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/linux4sam/at91bootstrap.git +PKG_SOURCE_VERSION:=3d33a4e0707c61007a5278f6620453502f7500db + +PKG_BUILD_DIR = \ + $(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +include at91bootstrap.mk +include $(INCLUDE_DIR)/package.mk + +define AT91Bootstrap/Default + BUILD_TARGET:=at91 + BUILD_SUBTARGET:=sama5 + HIDDEN:=1 + AT91BOOTSTRAP_IMAGE:=at91bootstrap.bin +endef + +define AT91Bootstrap/sama5d2_xplaineddf_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SPI Flash) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d2_xplaineddf_qspi_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (QSPI Flash) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d2_xplainedsd_uboot + TITLE:=AT91Bootstrap for SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define AT91Bootstrap/sama5d3_xplainednf_uboot + TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (Nand Flash) + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define AT91Bootstrap/sama5d3_xplainedsd_uboot + TITLE:=AT91Bootstrap for SAMA5D3 Xplained board (SDcard) + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define AT91Bootstrap/sama5d4_xplainednf_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (Nand Flash) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define AT91Bootstrap/sama5d4_xplaineddf_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SPI Flash) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define AT91Bootstrap/sama5d4_xplainedsd_uboot_secure + TITLE:=AT91Bootstrap for SAMA5D4 Xplained board (SDcard) + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +AT91BOOTSTRAP_TARGETS := \ + sama5d2_xplaineddf_uboot \ + sama5d2_xplaineddf_qspi_uboot \ + sama5d2_xplainedsd_uboot \ + sama5d3_xplainednf_uboot \ + sama5d3_xplainedsd_uboot \ + sama5d4_xplainednf_uboot_secure \ + sama5d4_xplaineddf_uboot_secure \ + sama5d4_xplainedsd_uboot_secure + +define Build/Compile + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) +endef + +$(eval $(call BuildPackage/AT91Bootstrap)) diff --git a/package/boot/at91bootstrap/at91bootstrap.mk b/package/boot/at91bootstrap/at91bootstrap.mk new file mode 100644 index 000000000..dda5fa4e9 --- /dev/null +++ b/package/boot/at91bootstrap/at91bootstrap.mk @@ -0,0 +1,88 @@ + +PKG_TARGETS := bin +PKG_FLAGS:=nonshared + +export GCC_HONOUR_COPTS=s + +define Package/at91bootstrap/install/default + $(CP) $(PKG_BUILD_DIR)/binaries/*uboot* $(1)/ +endef + +Package/at91bootstrap/install = $(Package/at91bootstrap/install/default) + +define AT91Bootstrap/Init + BUILD_TARGET:= + BUILD_SUBTARGET:= + BUILD_DEVICES:= + NAME:= + DEPENDS:= + HIDDEN:= + DEFAULT:= + VARIANT:=$(1) + AT91BOOTSTRAP_CONFIG:=$(1) +endef + +TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET)) + +AT91BOOTSTRAP_MAKE_FLAGS = \ + HOSTCC="$(HOSTCC)" \ + HOSTCFLAGS='$(HOST_CFLAGS) $$$$(HOSTCPPFLAGS)' \ + HOSTLDFLAGS="" + +define Build/AT91Bootstrap/Target + $(eval $(call AT91Bootstrap/Init,$(1))) + $(eval $(call AT91Bootstrap/Default,$(1))) + $(eval $(call AT91Bootstrap/$(1),$(1))) + + define Package/at91bootstrap-$(1) + SECTION:=boot + CATEGORY:=Boot Loaders + TITLE:= .$(NAME) + VARIANT:=$(VARIANT) + DEPENDS:=@!IN_SDK $(DEPENDS) + HIDDEN:=$(HIDDEN) + ifneq ($(BUILD_TARGET),) + DEPENDS += @$(TARGET_DEP) + ifneq ($(BUILD_DEVICES),) + DEFAULT := y if ($(TARGET_DEP)_Default \ + $(patsubst %,|| $(TARGET_DEP)_DEVICE_%,$(BUILD_DEVICES)) \ + $(patsubst %,|| $(patsubst TARGET_%,TARGET_DEVICE_%, \ + $(TARGET_DEP))_DEVICE_%,$(BUILD_DEVICES))) + endif + endif + $(if $(DEFAULT),DEFAULT:=$(DEFAULT)) + URL:=https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap + endef + + define Package/at91bootstrap-$(1)/install + $$(Package/at91bootstrap/install) + endef +endef + +define Build/Configure/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + $(AT91BOOTSTRAP_CONFIG)_defconfig +endef + + +define Build/Compile/AT91Bootstrap + +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ + CROSS_COMPILE=$(TARGET_CROSS) \ + $(AT91BOOTSTRAP_MAKE_FLAGS) +endef + +define BuildPackage/AT91Bootstrap/Defaults + Build/Configure/Default = $$$$(Build/Configure/AT91Bootstrap) + Build/Compile/Default = $$$$(Build/Compile/AT91Bootstrap) +endef + +define BuildPackage/AT91Bootstrap + $(eval $(call BuildPackage/AT91Bootstrap/Defaults)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(eval $(call Build/AT91Bootstrap/Target,$(type))) + ) + $(eval $(call Build/DefaultTargets)) + $(foreach type,$(if $(DUMP),$(AT91BOOTSTRAP_TARGETS),$(BUILD_VARIANT)), \ + $(call BuildPackage,at91bootstrap-$(type)) + ) +endef diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile index b9e79e102..8cfc0dcff 100644 --- a/package/boot/grub2/Makefile +++ b/package/boot/grub2/Makefile @@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=grub +PKG_CPE_ID:=cpe:/a:gnu:grub2 PKG_VERSION:=2.02 PKG_RELEASE:=1 diff --git a/package/boot/kexec-tools/Config.in b/package/boot/kexec-tools/Config.in index 03bc6ee80..068c27e41 100644 --- a/package/boot/kexec-tools/Config.in +++ b/package/boot/kexec-tools/Config.in @@ -1,12 +1,5 @@ menu "Configuration" - depends on PACKAGE_kexec-tools - -config KEXEC_TOOLS_kdump - bool - prompt "kdump support" - default n - help - Include the kdump utility. + depends on PACKAGE_kexec config KEXEC_ZLIB bool diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile index ecd2a6ea1..1c686a254 100644 --- a/package/boot/kexec-tools/Makefile +++ b/package/boot/kexec-tools/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=kexec-tools -PKG_VERSION:=2.0.14-rc1 +PKG_VERSION:=2.0.14 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/kernel/kexec -PKG_HASH:=3fc505ff8d8a2d24c68aac5e6b4783997d5a086966ff3de8b05a0ceb27e5e23b +PKG_HASH:=ffb2e7e99d9d08754c6bc1922aed3c000094f318665d82a72ecc76c4ff1c0dc6 PKG_FIXUP:=autoreconf @@ -21,22 +21,49 @@ PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA include $(INCLUDE_DIR)/package.mk -define Package/kexec-tools +define Package/kexec-tools/Default SECTION:=utils CATEGORY:=Utilities - DEPENDS:=@armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma - TITLE:=Kernel boots kernel URL:=http://kernel.org/pub/linux/kernel/people/horms/kexec-tools/ MAINTAINER:=Florian Fainelli - MENU:=1 +endef + +define Package/kexec-tools + $(call Package/kexec-tools/Default) + TITLE:=kexec-tools transition meta package + DEPENDS:=+kexec endef define Package/kexec-tools/description - kexec is a set of systems call that allows you to load + kexec is a set of system calls that allows you to load another kernel from the currently executing Linux kernel. + The kexec utility allows to load and boot another kernel. endef -define Package/kexec-tools/config +define Package/kexec + $(call Package/kexec-tools/Default) + TITLE:=Kernel boots kernel + DEPENDS:=\ + @armeb||@arm||@i386||@x86_64||@powerpc64||@mipsel||@mips \ + +KEXEC_ZLIB:zlib +KEXEC_LZMA:liblzma @KERNEL_KEXEC +endef + +define Package/kexec/description + The kexec utility allows to load and boot another kernel. +endef + +define Package/kdump + $(call Package/kexec-tools/Default) + TITLE:=Kernel crash analysis + DEPENDS:=+kexec @i386||@x86_64||@arm @KERNEL_CRASH_DUMP +endef + +define Package/kdump/description + The kdump package allows to automatically boot into a + special kernel for analyzing kernel crashes using kdump. +endef + +define Package/kexec/config source "$(SOURCE)/Config.in" endef @@ -65,24 +92,45 @@ CONFIGURE_VARS += \ BUILD_CC="$(HOSTCC)" \ TARGET_CC="$(TARGET_CC)" -kexec-extra-sbin-$(CONFIG_KEXEC_TOOLS_kdump) += kdump - define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" all install endef define Package/kexec-tools/install + : +endef + +define Package/kexec/install $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) \ - $(addprefix $(PKG_INSTALL_DIR)/usr/sbin/, \ - $(kexec-extra-sbin-y)) \ - $(kexec-extra-bin-y) \ - $(PKG_INSTALL_DIR)/usr/sbin/kexec \ - $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kexec $(1)/usr/sbin # make a link for compatability with other distros $(INSTALL_DIR) $(1)/sbin $(LN) ../usr/sbin/kexec $(1)/sbin/kexec endef +define Package/kdump/install + $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config $(1)/etc/uci-defaults + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/kdump $(PKG_INSTALL_DIR)/usr/sbin/vmcore-dmesg $(1)/usr/sbin + $(INSTALL_BIN) ./files/kdump.init $(1)/etc/init.d/kdump + $(INSTALL_BIN) ./files/kdump.defaults $(1)/etc/uci-defaults/kdump + $(INSTALL_CONF) ./files/kdump.config $(1)/etc/config/kdump +endef + +define Package/kdump/prerm +#!/bin/sh + +case $$(uname -m) in + i?86|x86_64) + if grep -q " crashkernel=" /boot/grub/grub.cfg; then + mount /boot -o remount,rw + sed -i 's/ crashkernel=[^ ]*//' /boot/grub/grub.cfg + mount /boot -o remount,ro + fi + ;; +esac +endef + $(eval $(call BuildPackage,kexec-tools)) +$(eval $(call BuildPackage,kexec)) +$(eval $(call BuildPackage,kdump)) diff --git a/package/boot/kexec-tools/files/kdump.config b/package/boot/kexec-tools/files/kdump.config new file mode 100644 index 000000000..dc6054ffd --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.config @@ -0,0 +1,7 @@ + +config kdump + option enabled '1' + option save_dmesg '1' + option save_vmcore '0' +# using an external partition to store vmcore is highly recommended! +# option path '/mnt/crashdump' diff --git a/package/boot/kexec-tools/files/kdump.defaults b/package/boot/kexec-tools/files/kdump.defaults new file mode 100644 index 000000000..2f15e757b --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.defaults @@ -0,0 +1,11 @@ +#!/bin/sh + +case $(uname -m) in + i?86|x86_64) + if ! grep -q crashkernel /boot/grub/grub.cfg; then + mount /boot -o remount,rw + sed -i 's/linux.*/& crashkernel=32M@32M/' /boot/grub/grub.cfg + mount /boot -o remount,ro + fi + ;; +esac diff --git a/package/boot/kexec-tools/files/kdump.init b/package/boot/kexec-tools/files/kdump.init new file mode 100755 index 000000000..057b8cc17 --- /dev/null +++ b/package/boot/kexec-tools/files/kdump.init @@ -0,0 +1,182 @@ +#!/bin/sh /etc/rc.common + +START=41 +STOP=98 + +EXTRA_COMMANDS="status" +EXTRA_HELP=" status Print crashkernel status" + +verify_kdump() { + local cfg="$1" + local enabled + local path + local save_vmcore + local save_dmesg + + config_get_bool enabled "$cfg" enabled 1 + config_get_bool save_dmesg "$cfg" save_dmesg 1 + config_get_bool save_vmcore "$cfg" save_vmcore 0 + + [ "$enabled" -gt 0 ] || return 2 + + [ "$save_dmesg" -gt 0 ] || [ "$save_vmcore" -gt 0 ] || return 2 + + config_get path "$cfg" path "/" + + [ -d "$path" ] || mkdir -p "$path" 2>/dev/null || return 1 +} + +run_kdump() { + local cfg="$1" + local enabled + local path + local save_vmcore + local save_dmesg + + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return + + config_get_bool save_dmesg "$cfg" save_dmesg 1 + config_get_bool save_vmcore "$cfg" save_vmcore 0 + config_get path "$cfg" path "/" + + timestamp=$(date "+%Y%m%dT%H%M%S") + + if [ "$save_vmcore" -eq 1 ]; then + # would like 'sparse' but busybox doesn't support it + dd if=/proc/vmcore of="$path/vmcore-$timestamp" conv=fsync bs=1M + fi + + if [ "$save_dmesg" -eq 1 ]; then + vmcore-dmesg /proc/vmcore > "$path/dmesg-$timestamp" + fi + + sync + reboot -f +} + +find_kernel() { + . /lib/functions.sh + local kernel + + kernel="$BOOT_IMAGE" + if [ -r "$kernel" ]; then + echo $kernel + return 0 + fi + + kernel="$(find_mtd_part kernel)" + if [ -r "$kernel" ]; then + echo $kernel + return 0 + fi + + for voldir in /sys/class/ubi/ubi*_*; do + [ ! -e "$voldir" ] && continue + if [ "$(cat "${voldir}/name")" = "kernel" ]; then + kernel="/dev/$(basename "$voldir")" + echo $kernel + return 0 + fi + done + + return 1 +} + +load_crashkernel() { + local append_cmdline + local kernel + + kernel="$(find_kernel)" + [ $? -gt 0 ] && return 1 + + case "$(uname -m)" in + i?86|x86_64) + grep -q "crashkernel=" /proc/cmdline || return 1 + append_cmdline="1 irqpoll reset_devices maxcpus=1" + ;; + arm*) + append_cmdline="1 maxcpus=1 reset_devices" + ;; + esac + kexec -p "$kernel" --reuse-cmdline --append="$append_cmdline" + return $? +} + +start() { + local retval + + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + return 1 + fi + + if [ -e /proc/vmcore ]; then + config_load kdump + config_foreach run_kdump kdump + else + config_load kdump + config_foreach verify_kdump kdump + retval=$? + [ $retval = 1 ] && return 1 + [ $retval = 0 ] && load_crashkernel + return $? + fi +} + +stop() { + [ "$(cat /sys/kernel/kexec_crash_loaded)" = "1" ] || return + + if [ -e "$BOOT_IMAGE" ]; then + kexec -p -u "$BOOT_IMAGE" + fi +} + +status() { + local retval kernel + + if [ ! -e /sys/kernel/kexec_crash_loaded ]; then + echo "crashdump not supported by kernel" + return + fi + + if [ $(cat /sys/kernel/kexec_crash_size) -eq 0 ]; then + echo "memory for crashdump kernel not reserved!" + echo "check crashkernel= kernel cmdline parameter" + echo "(a reboot is required after installing kdump)" + return + fi + + kernel="$(find_kernel)" + if [ $? -gt 0 ]; then + echo "cannot find kernel image" + return + else + echo "using kernel image $kernel" + fi + + echo -n "kdump configuration is " + config_load kdump + retval=$? + if [ $retval = 0 ]; then + if [ "$(config_foreach echo kdump)" ]; then + config_foreach verify_kdump kdump + retval=$? + else + retval=1 + fi + fi + + if [ $retval = 0 ]; then + echo "valid" + elif [ $retval = 2 ]; then + echo "disabled" + else + echo "BROKEN" + fi + + echo -n "kexec crash kernel " + if [ "$(cat /sys/kernel/kexec_crash_loaded)" = "0" ]; then + echo -n "not " + fi + echo "loaded" +} diff --git a/package/boot/kobs-ng/patches/001-compile.patch b/package/boot/kobs-ng/patches/001-compile.patch index 67da93a32..8648dc8b9 100644 --- a/package/boot/kobs-ng/patches/001-compile.patch +++ b/package/boot/kobs-ng/patches/001-compile.patch @@ -10,13 +10,14 @@ #include --- a/src/mtd.h +++ b/src/mtd.h -@@ -25,8 +25,10 @@ +@@ -25,8 +25,11 @@ #ifndef MTD_H #define MTD_H +#define _GNU_SOURCE #include #include ++#include +#include #include "BootControlBlocks.h" diff --git a/package/boot/rbcfg/Makefile b/package/boot/rbcfg/Makefile index 412f7ab11..9d9b97524 100644 --- a/package/boot/rbcfg/Makefile +++ b/package/boot/rbcfg/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rbcfg -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) diff --git a/package/boot/rbcfg/src/main.c b/package/boot/rbcfg/src/main.c index b7cf79ffa..2acbfbd8c 100644 --- a/package/boot/rbcfg/src/main.c +++ b/package/boot/rbcfg/src/main.c @@ -2,6 +2,7 @@ * RouterBOOT configuration utility * * Copyright (C) 2010 Gabor Juhos + * Copyright (C) 2017 Thibaut VARENE * * 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 @@ -29,6 +30,7 @@ #define RB_ERR_INVALID 2 #define RB_ERR_NOMEM 3 #define RB_ERR_IO 4 +#define RB_ERR_NOTWANTED 5 #define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) @@ -67,6 +69,11 @@ struct rbcfg_command { int (*exec)(int argc, const char *argv[]); }; +struct rbcfg_soc { + const char *needle; + const int type; +}; + static void usage(void); /* Globals */ @@ -101,6 +108,10 @@ static const struct rbcfg_value rbcfg_boot_device[] = { RB_BOOT_DEVICE_ETHONCE), CFG_U32("nand", "boot from NAND only", RB_BOOT_DEVICE_NANDONLY), + CFG_U32("flash", "boot in flash configuration mode", + RB_BOOT_DEVICE_FLASHCFG), + CFG_U32("flashnand", "boot in flash configuration mode once, then NAND", + RB_BOOT_DEVICE_FLSHONCE), }; static const struct rbcfg_value rbcfg_boot_key[] = { @@ -131,12 +142,32 @@ static const struct rbcfg_value rbcfg_cpu_mode[] = { RB_CPU_MODE_REGULAR), }; +static const struct rbcfg_value rbcfg_cpu_freq_dummy[] = { +}; + +static const struct rbcfg_value rbcfg_cpu_freq_qca953x[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), +}; + +static const struct rbcfg_value rbcfg_cpu_freq_ar9344[] = { + CFG_U32("-2", "-100MHz", RB_CPU_FREQ_L2), + CFG_U32("-1", "- 50MHz", RB_CPU_FREQ_L1), + CFG_U32("0", "Factory", RB_CPU_FREQ_N0), + CFG_U32("+1", "+ 50MHz", RB_CPU_FREQ_H1), + CFG_U32("+2", "+100MHz", RB_CPU_FREQ_H2), + CFG_U32("+3", "+150MHz", RB_CPU_FREQ_H3), +}; + static const struct rbcfg_value rbcfg_booter[] = { CFG_U32("regular", "load regular booter", RB_BOOTER_REGULAR), CFG_U32("backup", "force backup-booter loading", RB_BOOTER_BACKUP), }; -static const struct rbcfg_env rbcfg_envs[] = { +static struct rbcfg_env rbcfg_envs[] = { { .name = "boot_delay", .id = RB_ID_BOOT_DELAY, @@ -173,6 +204,12 @@ static const struct rbcfg_env rbcfg_envs[] = { .type = RBCFG_ENV_TYPE_U32, .values = rbcfg_cpu_mode, .num_values = ARRAY_SIZE(rbcfg_cpu_mode), + }, { + .name = "cpu_freq", + .id = RB_ID_CPU_FREQ, + .type = RBCFG_ENV_TYPE_U32, + .values = rbcfg_cpu_freq_dummy, + .num_values = ARRAY_SIZE(rbcfg_cpu_freq_dummy), }, { .name = "uart_speed", .id = RB_ID_UART_SPEED, @@ -236,8 +273,10 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buf += 2; buflen -= 2; - if (id == RB_ID_TERMINATOR) + if (id == RB_ID_TERMINATOR) { + ret = RB_ERR_NOTWANTED; break; + } if (buflen < len) break; @@ -253,7 +292,7 @@ rbcfg_find_tag(struct rbcfg_ctx *ctx, uint16_t tag_id, uint16_t *tag_len, buflen -= len; } - if (ret) + if (RB_ERR_NOTFOUND == ret) fprintf(stderr, "no tag found with id=%u\n", tag_id); return ret; @@ -744,6 +783,96 @@ usage(void) fprintf(stderr, "\n"); } +#define RBCFG_SOC_UNKNOWN 0 +#define RBCFG_SOC_QCA953X 1 +#define RBCFG_SOC_AR9344 2 + +static const struct rbcfg_soc rbcfg_socs[] = { + { + .needle = "QCA953", + .type = RBCFG_SOC_QCA953X, + }, { + .needle = "AR9344", + .type = RBCFG_SOC_AR9344, + }, +}; + +#define CPUINFO_BUFSIZE 128 /* lines of interest are < 80 chars */ + +static int cpuinfo_find_soc(void) +{ + FILE *fp; + char temp[CPUINFO_BUFSIZE]; + char *haystack, *needle; + int i, found = 0, soc_type = RBCFG_SOC_UNKNOWN; + + fp = fopen("/proc/cpuinfo", "r"); + if (!fp) + goto end; + + /* first, extract the system type line */ + needle = "system type"; + while(fgets(temp, CPUINFO_BUFSIZE, fp)) { + if (!strncmp(temp, needle, strlen(needle))) { + found = 1; + break; + } + } + + fclose(fp); + + /* failsafe in case cpuinfo format changes */ + if (!found) + goto end; + + /* skip the field header */ + haystack = strchr(temp, ':'); + + /* then, try to identify known SoC, stop at first match */ + for (i = 0; i < ARRAY_SIZE(rbcfg_socs); i++) { + if ((strstr(haystack, rbcfg_socs[i].needle))) { + soc_type = rbcfg_socs[i].type; + break; + } + } + +end: + return soc_type; +} + +static void fixup_rbcfg_envs(void) +{ + int i, num_val, soc_type; + const struct rbcfg_value * env_value; + + /* detect SoC */ + soc_type = cpuinfo_find_soc(); + + /* update rbcfg_envs */ + switch (soc_type) { + case RBCFG_SOC_QCA953X: + env_value = rbcfg_cpu_freq_qca953x; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_qca953x); + break; + case RBCFG_SOC_AR9344: + env_value = rbcfg_cpu_freq_ar9344; + num_val = ARRAY_SIZE(rbcfg_cpu_freq_ar9344); + break; + } + + for (i = 0; i < ARRAY_SIZE(rbcfg_envs); i++) { + if (RB_ID_CPU_FREQ == rbcfg_envs[i].id) { + if (RBCFG_SOC_UNKNOWN == soc_type) + rbcfg_envs[i].id = RB_ID_TERMINATOR; + else { + rbcfg_envs[i].values = env_value; + rbcfg_envs[i].num_values = num_val; + } + break; + } + } +} + int main(int argc, const char *argv[]) { const struct rbcfg_command *cmd = NULL; @@ -752,6 +881,8 @@ int main(int argc, const char *argv[]) rbcfg_name = (char *) argv[0]; + fixup_rbcfg_envs(); + if (argc < 2) { usage(); return EXIT_FAILURE; diff --git a/package/boot/rbcfg/src/rbcfg.h b/package/boot/rbcfg/src/rbcfg.h index 899161a10..88acc13dc 100644 --- a/package/boot/rbcfg/src/rbcfg.h +++ b/package/boot/rbcfg/src/rbcfg.h @@ -32,6 +32,7 @@ #define RB_ID_BOOT_PROTOCOL 9 #define RB_ID_SOFT_10 10 #define RB_ID_SOFT_11 11 +#define RB_ID_CPU_FREQ 12 #define RB_ID_BOOTER 13 #define RB_UART_SPEED_115200 0 @@ -59,6 +60,8 @@ #define RB_BOOT_DEVICE_CFCARD 2 #define RB_BOOT_DEVICE_ETHONCE 3 #define RB_BOOT_DEVICE_NANDONLY 5 +#define RB_BOOT_DEVICE_FLASHCFG 7 +#define RB_BOOT_DEVICE_FLSHONCE 8 #define RB_BOOT_KEY_ANY 0 #define RB_BOOT_KEY_DEL 1 @@ -69,6 +72,13 @@ #define RB_BOOT_PROTOCOL_BOOTP 0 #define RB_BOOT_PROTOCOL_DHCP 1 +#define RB_CPU_FREQ_L2 (0 << 3) +#define RB_CPU_FREQ_L1 (1 << 3) +#define RB_CPU_FREQ_N0 (2 << 3) +#define RB_CPU_FREQ_H1 (3 << 3) +#define RB_CPU_FREQ_H2 (4 << 3) +#define RB_CPU_FREQ_H3 (5 << 3) + #define RB_BOOTER_REGULAR 0 #define RB_BOOTER_BACKUP 1 diff --git a/package/boot/uboot-ar71xx/Makefile b/package/boot/uboot-ar71xx/Makefile index 70f96713e..e6e6cbbd4 100644 --- a/package/boot/uboot-ar71xx/Makefile +++ b/package/boot/uboot-ar71xx/Makefile @@ -6,90 +6,28 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2010.03 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_HASH:=902d1b2c15787df55186fae4033685fb0c5a5a12755a08383e97c4a3e255925b -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=ar71xx + BUILD_SUBTARGET:=generic endef -define uboot/nbg460n_550n_550nh - TITLE:=U-boot for the NBG460N/550N/550NH routers - DEFAULT:=y if (TARGET_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_DEVICE_ar71xx_generic_DEVICE_NBG_460N_550N_550NH || TARGET_ar71xx_generic_Default) +define U-Boot/nbg460n_550n_550nh + TITLE:=NBG460N/550N/550NH routers + BUILD_DEVICES:=NBG_460N_550N_550NH + HIDDEN:=y endef -UBOOTS:=nbg460n_550n_550nh +UBOOT_MAKE_FLAGS := -define Package/uboot/template -define Package/uboot-ar71xx-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - TITLE:=$(2) - DEPENDS:=@TARGET_ar71xx_generic - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) -endef -endef +UBOOT_TARGETS:=nbg460n_550n_550nh -define BuildUbootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Prepare - $(call Build/Prepare/Default) - $(CP) ./files/* $(PKG_BUILD_DIR) - find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf -endef - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/template -define Package/uboot-ar71xx-$(1)/install - $(INSTALL_DIR) $$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(BIN_DIR)/$(2) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),openwrt-$(BOARD)-$(SUBTARGET)-$(u)-u-boot.bin)) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUbootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-ar71xx-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/Makefile rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/Makefile diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/config.mk rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/config.mk diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/lowlevel_init.S rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/lowlevel_init.S diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/nbg460n.c rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/nbg460n.c diff --git a/package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds b/package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds similarity index 100% rename from package/boot/uboot-ar71xx/files/board/zyxel/nbg460n/u-boot.lds rename to package/boot/uboot-ar71xx/src/board/zyxel/nbg460n/u-boot.lds diff --git a/package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c b/package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c similarity index 100% rename from package/boot/uboot-ar71xx/files/cpu/mips/ar71xx_serial.c rename to package/boot/uboot-ar71xx/src/cpu/mips/ar71xx_serial.c diff --git a/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c b/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/ag71xx.c rename to package/boot/uboot-ar71xx/src/drivers/net/ag71xx.c diff --git a/package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h b/package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/ag71xx.h rename to package/boot/uboot-ar71xx/src/drivers/net/ag71xx.h diff --git a/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h b/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366.h rename to package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366.h diff --git a/package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c b/package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/net/phy/rtl8366_mii.c rename to package/boot/uboot-ar71xx/src/drivers/net/phy/rtl8366_mii.c diff --git a/package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c b/package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c similarity index 100% rename from package/boot/uboot-ar71xx/files/drivers/spi/ar71xx_spi.c rename to package/boot/uboot-ar71xx/src/drivers/spi/ar71xx_spi.c diff --git a/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h b/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx.h rename to package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx.h diff --git a/package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h b/package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/asm-mips/ar71xx_gpio.h rename to package/boot/uboot-ar71xx/src/include/asm-mips/ar71xx_gpio.h diff --git a/package/boot/uboot-ar71xx/files/include/configs/nbg460n.h b/package/boot/uboot-ar71xx/src/include/configs/nbg460n.h similarity index 100% rename from package/boot/uboot-ar71xx/files/include/configs/nbg460n.h rename to package/boot/uboot-ar71xx/src/include/configs/nbg460n.h diff --git a/package/boot/uboot-at91/Makefile b/package/boot/uboot-at91/Makefile index cbce85967..cad12ec2f 100644 --- a/package/boot/uboot-at91/Makefile +++ b/package/boot/uboot-at91/Makefile @@ -7,96 +7,89 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.05 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=87d02275615aaf0cd007b54cbe9fbadceef2bee7c79e6c323ea1ae8956dcb171 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +define U-Boot/Default + BUILD_TARGET:=at91 + HIDDEN:=1 + UBOOT_IMAGE:=u-boot.bin boot.bin endef -define uboot/at91sam9m10g45ek_nandflash - TITLE:=U-Boot for the AT91SAM9M10G45-EK board (NandFlash) +define U-Boot/at91sam9m10g45ek_nandflash + NAME:=AT91SAM9M10G45-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9m10g45ek endef -define uboot/at91sam9x5ek_nandflash - TITLE:=U-Boot for the AT91SAM9X5-EK board (NandFlash) +define U-Boot/at91sam9x5ek_nandflash + NAME:=AT91SAM9X5-EK board (NandFlash) + BUILD_SUBTARGET:=legacy + BUILD_DEVICES:=at91sam9g15ek at91sam9g25ek at91sam9g35ek at91sam9x25ek at91sam9x35ek endef -UBOOTS := \ +define U-Boot/sama5d3_xplained_nandflash + NAME:=SAMA5D3 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d3_xplained_mmc + NAME:=SAMA5D3 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d3_xplained +endef + +define U-Boot/sama5d2_xplained_spiflash + NAME:=SAMA5D2 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d2_xplained_mmc + NAME:=SAMA5D2 Xplained board (SDcard/EMMC) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d2_xplained +endef + +define U-Boot/sama5d4_xplained_spiflash + NAME:=SAMA5D4 Xplained board (SPI Flash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_mmc + NAME:=SAMA5D4 Xplained board (SDcard) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +define U-Boot/sama5d4_xplained_nandflash + NAME:=SAMA5D4 Xplained board (NandFlash) + BUILD_SUBTARGET:=sama5 + BUILD_DEVICES:=at91-sama5d4_xplained +endef + +UBOOT_TARGETS := \ at91sam9m10g45ek_nandflash \ - at91sam9x5ek_nandflash - -define Package/uboot/template -define Package/uboot-at91-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_at91 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Ben Whitten -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),lede-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef + at91sam9x5ek_nandflash \ + sama5d3_xplained_nandflash \ + sama5d3_xplained_mmc \ + sama5d2_xplained_mmc \ + sama5d2_xplained_spiflash \ + sama5d4_xplained_mmc \ + sama5d4_xplained_spiflash \ + sama5d4_xplained_nandflash define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ CROSS_COMPILE=$(TARGET_CROSS) \ - KCFLAGS="$(filter-out -fstack-protector, $(TARGET_CFLAGS))" + KCFLAGS="$(filter-out -fstack-protector -mfloat-abi=hard, $(TARGET_CFLAGS)) -mfloat-abi=soft" endef -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.bin - - $(CP) $(PKG_BUILD_DIR)/boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-at91-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-at91-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile index 784fc6423..57a2ec539 100644 --- a/package/boot/uboot-envtools/Makefile +++ b/package/boot/uboot-envtools/Makefile @@ -19,7 +19,7 @@ PKG_SOURCE_URL:=\ ftp://ftp.denx.de/pub/u-boot PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 -PKG_BUILD_DEPENDS:=+fstools +PKG_BUILD_DEPENDS:=fstools PKG_LICENSE:=GPL-2.0 GPL-2.0+ PKG_LICENSE_FILES:=Licenses/README @@ -112,6 +112,10 @@ ifneq ($(CONFIG_TARGET_oxnas),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_BIN) ./files/oxnas $(1)/etc/uci-defaults/30_uboot-envtools endif +ifneq ($(CONFIG_TARGET_pistachio),) + $(INSTALL_DIR) $(1)/etc/uci-defaults + $(INSTALL_DATA) ./files/pistachio $(1)/etc/uci-defaults/30_uboot-envtools +endif ifneq ($(CONFIG_TARGET_ramips),) $(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DATA) ./files/ramips $(1)/etc/uci-defaults/30_uboot-envtools diff --git a/package/boot/uboot-envtools/files/ar71xx b/package/boot/uboot-envtools/files/ar71xx index 25bec7eb3..66eaeb0df 100644 --- a/package/boot/uboot-envtools/files/ar71xx +++ b/package/boot/uboot-envtools/files/ar71xx @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/ar71xx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ar71xx_board_name) +board=$(board_name) case "$board" in a40|\ @@ -20,6 +19,8 @@ alfa-ap120c|\ all0258n|\ ap121f|\ ap90q|\ +ap91-5g|\ +arduino-yun|\ cap324|\ cap4200ag|\ carambola2|\ @@ -28,7 +29,9 @@ cpe870|\ cr3000|\ cr5000|\ eap300v2|\ +ens202ext|\ gl-ar300m|\ +gl-ar750|\ hornet-ub|\ hornet-ub-x2|\ jwap230|\ @@ -38,11 +41,13 @@ mr600|\ mr600v2|\ mr900|\ mr900v2|\ +n5q|\ nbg6716|\ om5p|\ om5p-ac|\ om5p-acv2|\ om5p-an|\ +r36a|\ sr3200|\ tube2h|\ wndr3700|\ @@ -65,12 +70,20 @@ dap-2695-a1|\ wzr-hp-ag300h) ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000" "0x10000" ;; +dr342|\ dr531) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0xf800" "0x10000" ;; +rambutan) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" + ubootenv_add_uci_config "/dev/mtd1" "0x100000" "0x20000" "0x20000" + ;; qihoo-c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +wi2a-ac200i) + ubootenv_add_uci_config "/dev/mtd4" "0x0" "0x8000" "0x10000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-envtools/files/cns3xxx b/package/boot/uboot-envtools/files/cns3xxx index a56be15c5..f998de463 100644 --- a/package/boot/uboot-envtools/files/cns3xxx +++ b/package/boot/uboot-envtools/files/cns3xxx @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/cns3xxx.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(cns3xxx_board_name) +board=$(board_name) case "$board" in laguna) diff --git a/package/boot/uboot-envtools/files/imx6 b/package/boot/uboot-envtools/files/imx6 index a78c4fbe5..fec8ce0aa 100644 --- a/package/boot/uboot-envtools/files/imx6 +++ b/package/boot/uboot-envtools/files/imx6 @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/imx6.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(imx6_board_name) +board=$(board_name) case "$board" in *gw5*) diff --git a/package/boot/uboot-envtools/files/ipq b/package/boot/uboot-envtools/files/ipq index 16c7ba6bb..441ba4837 100644 --- a/package/boot/uboot-envtools/files/ipq +++ b/package/boot/uboot-envtools/files/ipq @@ -7,17 +7,41 @@ touch /etc/config/ubootenv -. /lib/ipq806x.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ipq806x_board_name) +board=$(board_name) + +ubootenv_mtdinfo () { + UBOOTENV_PART=$(cat /proc/mtd | grep APPSBLENV) + mtd_dev=$(echo $UBOOTENV_PART | awk '{print $1}' | sed 's/:$//') + mtd_size=$(echo $UBOOTENV_PART | awk '{print "0x"$2}') + mtd_erase=$(echo $UBOOTENV_PART | awk '{print "0x"$3}') + nor_flash=$(find /sys/bus/spi/devices/*/mtd -name ${mtd_dev}) + + if [ -n "$nor_flash" ]; then + ubootenv_size=$mtd_size + else + # size is fixed to 0x40000 in u-boot + ubootenv_size=0x40000 + fi + + sectors=$(( $ubootenv_size / $mtd_erase )) + echo /dev/$mtd_dev 0x0 $ubootenv_size $mtd_erase $sectors +} case "$board" in -ea8500) +linksys,ea8500) ubootenv_add_uci_config "/dev/mtd10" "0x0" "0x20000" "0x20000" ;; -nbg6817) +openmesh,a42) + ubootenv_add_uci_config "/dev/mtd5" "0x0" "0x10000" "0x10000" + ;; +qcom,ipq8064-ap148 |\ +qcom,ipq8064-db149) + ubootenv_add_uci_config $(ubootenv_mtdinfo) + ;; +zyxel,nbg6817) ubootenv_add_uci_config "/dev/mtdblock9" "0x0" "0x10000" "0x10000" ;; esac diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood index 055e0eba4..16123846c 100644 --- a/package/boot/uboot-envtools/files/kirkwood +++ b/package/boot/uboot-envtools/files/kirkwood @@ -7,23 +7,22 @@ touch /etc/config/ubootenv -. /lib/kirkwood.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(kirkwood_board_name) +board=$(board_name) case "$board" in -dockstar|\ -guruplug-server-plus|\ -ib62x0|\ -linksys-viper|\ -pogo_e02|\ -sheevaplug|\ -sheevaplug-esata) +cloudengines,pogoe02|\ +cloudengines,pogoplugv4|\ +linksys,viper|\ +raidsonic,ib-nas62x0|\ +seagate,dockstar|\ +zyxel,nsa310b|\ +zyxel,nsa325) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; -linksys-audi) +linksys,audi) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x4000" "0x4000" ;; esac diff --git a/package/boot/uboot-envtools/files/lantiq b/package/boot/uboot-envtools/files/lantiq index d1a6668e8..f4541a559 100644 --- a/package/boot/uboot-envtools/files/lantiq +++ b/package/boot/uboot-envtools/files/lantiq @@ -13,19 +13,19 @@ touch /etc/config/ubootenv board=$(board_name) case "$board" in -BTHOMEHUBV2B) +bt,homehub-v2b) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -BTHOMEHUBV3A) +bt,homehub-v3a) ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x4000" "0x4000" "1" ;; -GIGASX76X) +siemens,gigaset-sx76x) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" "1" ;; -P2812HNUF1) +zyxel,p-2812hnu-f1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x2000" "0x20000" "1" ;; -WBMR300) +buffalo,wbmr-300hpd) idx="$(find_mtd_index ubootconfig)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x2000" "0x1000" "2" diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu index 2bbbc2366..e33830e0a 100644 --- a/package/boot/uboot-envtools/files/mvebu +++ b/package/boot/uboot-envtools/files/mvebu @@ -8,11 +8,10 @@ touch /etc/config/ubootenv -. /lib/mvebu.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(mvebu_board_name) +board=$(board_name) case "$board" in armada-385-linksys-caiman|\ diff --git a/package/boot/uboot-envtools/files/mxs b/package/boot/uboot-envtools/files/mxs index ab8b4ef93..37d3c96ed 100644 --- a/package/boot/uboot-envtools/files/mxs +++ b/package/boot/uboot-envtools/files/mxs @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/mxs.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(mxs_board_name) +board=$(board_name) case "$board" in duckbill) diff --git a/package/boot/uboot-envtools/files/oxnas b/package/boot/uboot-envtools/files/oxnas index ac4744e3e..70b0f1663 100644 --- a/package/boot/uboot-envtools/files/oxnas +++ b/package/boot/uboot-envtools/files/oxnas @@ -7,11 +7,10 @@ touch /etc/config/ubootenv -. /lib/oxnas.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(oxnas_board_name) +board=$(board_name) case "$board" in akitio|\ diff --git a/package/boot/uboot-envtools/files/pistachio b/package/boot/uboot-envtools/files/pistachio new file mode 100644 index 000000000..e4aa7b0cd --- /dev/null +++ b/package/boot/uboot-envtools/files/pistachio @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Copyright (C) 2017 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +[ -e /etc/config/ubootenv ] && exit 0 + +touch /etc/config/ubootenv + +. /lib/uboot-envtools.sh +. /lib/functions.sh + +board=$(board_name) + +case "$board" in +img,pistachio-marduk) + ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x2000" "0x1000" + ;; +esac + +config_load ubootenv +config_foreach ubootenv_add_app_config ubootenv + +exit 0 diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 3216b300c..ce200a1ff 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -7,21 +7,19 @@ touch /etc/config/ubootenv -. /lib/ramips.sh . /lib/uboot-envtools.sh . /lib/functions.sh -board=$(ramips_board_name) +board=$(board_name) case "$board" in all0239-3g|\ -all0256n|\ +all0256n-4M|\ +all0256n-8M|\ all5002) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000" ;; -br-6425|\ linkits7688|\ -linkits7688d|\ miwifi-nano|\ sk-wb8|\ wsr-1166|\ @@ -29,6 +27,9 @@ wsr-600|\ zbt-wg2626) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000" ;; +mir3g) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" + ;; esac config_load ubootenv diff --git a/package/boot/uboot-fritz4040/Makefile b/package/boot/uboot-fritz4040/Makefile new file mode 100644 index 000000000..9f9b4e05f --- /dev/null +++ b/package/boot/uboot-fritz4040/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2013-2014 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_SOURCE_URL:=https://github.com/chunkeey/FritzBox-4040-UBOOT +PKG_SOURCE_PROTO:=git +PKG_SOURCE_VERSION:=6946ebbaf7b12a4a092d763c8f0c87a25984f103 +PKG_SOURCE_DATE:=2017-01-29 +PKG_MIRROR_HASH:=5c2394f51a083dca2a2bf9cb36fa717f252112fc792c9eeae64f6383ad08987b + +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/u-boot.mk +include $(INCLUDE_DIR)/package.mk + +define U-Boot/Default + BUILD_TARGET:=ipq806x + UBOOT_IMAGE:=uboot-fritz4040.bin +endef + +define U-Boot/fritz4040 + NAME:=FritzBox 4040 +endef + +UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes +UBOOT_MAKE_FLAGS += USE_PRIVATE_LIBGCC=yes +export DTC + +define Build/Configure + $(Build/Configure/U-Boot) + $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/lzma2eva $(PKG_BUILD_DIR)/fritz/src/lzma2eva.c -lz + $(HOSTCC) -o $(PKG_BUILD_DIR)/fritz/tichksum $(PKG_BUILD_DIR)/fritz/src/tichksum.c + ln -sf $(STAGING_DIR_HOST)/bin/lzma $(PKG_BUILD_DIR)/fritz +endef + +define Build/Compile + $(Build/Compile/U-Boot) + (cd $(PKG_BUILD_DIR); ./fritz/fritzcreator.sh;) +endef + +define Package/u-boot/install + $(Package/u-boot/install/default) + $(INSTALL_BIN) ./files/upload-to-f4040.sh $(1)/ +endef + +UBOOT_TARGETS := fritz4040 + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-fritz4040/files/upload-to-f4040.sh b/package/boot/uboot-fritz4040/files/upload-to-f4040.sh new file mode 100755 index 000000000..64f493190 --- /dev/null +++ b/package/boot/uboot-fritz4040/files/upload-to-f4040.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +die() { + echo $1 + exit 1 +} + +FRITZBOX='192.168.178.1' +USER='adam2' +PASSWD='adam2' +FILE='uboot-fritz4040.bin' + +ping -q -4 -w 1 -c 1 "$FRITZBOX" &> /dev/null || die "Fritzbox at $FRITZBOX is not reachable. aborting" + +cat << EOS + +This will take ages (2 minutes)! If you want a +status bar: Attach a serial to the device and look there. + +Note: If this fails, you need to use AVM\' recover +utility to get your box back. However this step +should not damage your box.... + +Also it doesn't terminate.. :/ + +(Note: Make sure that you connected the router on +the yellow LAN ports and not the blue WAN). + +EOS + +ftp -n -4 "$FRITZBOX" << END_SCRIPT +quote USER $USER +quote PASS $PASSWD +quote MEDIA FLSH +binary +passive +put $FILE mtd1 +quote check mtd1 +bye +END_SCRIPT +exit 0 diff --git a/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch b/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch new file mode 100644 index 000000000..6fec563da --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/100-private-libgcc.patch @@ -0,0 +1,274 @@ +--- a/arch/arm/lib/Makefile ++++ b/arch/arm/lib/Makefile +@@ -26,7 +26,6 @@ include $(TOPDIR)/config.mk + LIB = $(obj)lib$(ARCH).o + LIBGCC = $(obj)libgcc.o + +-ifndef CONFIG_SPL_BUILD + GLSOBJS += _ashldi3.o + GLSOBJS += _ashrdi3.o + GLSOBJS += _divsi3.o +@@ -34,9 +33,11 @@ GLSOBJS += _lshrdi3.o + GLSOBJS += _modsi3.o + GLSOBJS += _udivsi3.o + GLSOBJS += _umodsi3.o ++GLSOBJS += uldivmod.o + + GLCOBJS += div0.o + ++ifndef CONFIG_SPL_BUILD + COBJS-y += board.o + COBJS-y += bootm.o + COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o +--- /dev/null ++++ b/arch/arm/lib/uldivmod.S +@@ -0,0 +1,249 @@ ++/* ++ * Copyright 2010, Google Inc. ++ * ++ * Brought in from coreboot uldivmod.S ++ * ++ * SPDX-License-Identifier: GPL-2.0 ++ */ ++ ++#include ++#include ++ ++/* ++ * A, Q = r0 + (r1 << 32) ++ * B, R = r2 + (r3 << 32) ++ * A / B = Q ... R ++ */ ++ ++#define ARM(x...) x ++#define THUMB(x...) ++ ++A_0 .req r0 ++A_1 .req r1 ++B_0 .req r2 ++B_1 .req r3 ++C_0 .req r4 ++C_1 .req r5 ++D_0 .req r6 ++D_1 .req r7 ++ ++Q_0 .req r0 ++Q_1 .req r1 ++R_0 .req r2 ++R_1 .req r3 ++ ++THUMB( ++TMP .req r8 ++) ++ ++.pushsection .text.__aeabi_uldivmod, "ax" ++ENTRY(__aeabi_uldivmod) ++ ++ stmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) lr} ++ @ Test if B == 0 ++ orrs ip, B_0, B_1 @ Z set -> B == 0 ++ beq L_div_by_0 ++ @ Test if B is power of 2: (B & (B - 1)) == 0 ++ subs C_0, B_0, #1 ++ sbc C_1, B_1, #0 ++ tst C_0, B_0 ++ tsteq B_1, C_1 ++ beq L_pow2 ++ @ Test if A_1 == B_1 == 0 ++ orrs ip, A_1, B_1 ++ beq L_div_32_32 ++ ++L_div_64_64: ++/* CLZ only exists in ARM architecture version 5 and above. */ ++#ifdef HAVE_CLZ ++ mov C_0, #1 ++ mov C_1, #0 ++ @ D_0 = clz A ++ teq A_1, #0 ++ clz D_0, A_1 ++ clzeq ip, A_0 ++ addeq D_0, D_0, ip ++ @ D_1 = clz B ++ teq B_1, #0 ++ clz D_1, B_1 ++ clzeq ip, B_0 ++ addeq D_1, D_1, ip ++ @ if clz B - clz A > 0 ++ subs D_0, D_1, D_0 ++ bls L_done_shift ++ @ B <<= (clz B - clz A) ++ subs D_1, D_0, #32 ++ rsb ip, D_0, #32 ++ movmi B_1, B_1, lsl D_0 ++ARM( orrmi B_1, B_1, B_0, lsr ip ) ++THUMB( lsrmi TMP, B_0, ip ) ++THUMB( orrmi B_1, B_1, TMP ) ++ movpl B_1, B_0, lsl D_1 ++ mov B_0, B_0, lsl D_0 ++ @ C = 1 << (clz B - clz A) ++ movmi C_1, C_1, lsl D_0 ++ARM( orrmi C_1, C_1, C_0, lsr ip ) ++THUMB( lsrmi TMP, C_0, ip ) ++THUMB( orrmi C_1, C_1, TMP ) ++ movpl C_1, C_0, lsl D_1 ++ mov C_0, C_0, lsl D_0 ++L_done_shift: ++ mov D_0, #0 ++ mov D_1, #0 ++ @ C: current bit; D: result ++#else ++ @ C: current bit; D: result ++ mov C_0, #1 ++ mov C_1, #0 ++ mov D_0, #0 ++ mov D_1, #0 ++L_lsl_4: ++ cmp B_1, #0x10000000 ++ cmpcc B_1, A_1 ++ cmpeq B_0, A_0 ++ bcs L_lsl_1 ++ @ B <<= 4 ++ mov B_1, B_1, lsl #4 ++ orr B_1, B_1, B_0, lsr #28 ++ mov B_0, B_0, lsl #4 ++ @ C <<= 4 ++ mov C_1, C_1, lsl #4 ++ orr C_1, C_1, C_0, lsr #28 ++ mov C_0, C_0, lsl #4 ++ b L_lsl_4 ++L_lsl_1: ++ cmp B_1, #0x80000000 ++ cmpcc B_1, A_1 ++ cmpeq B_0, A_0 ++ bcs L_subtract ++ @ B <<= 1 ++ mov B_1, B_1, lsl #1 ++ orr B_1, B_1, B_0, lsr #31 ++ mov B_0, B_0, lsl #1 ++ @ C <<= 1 ++ mov C_1, C_1, lsl #1 ++ orr C_1, C_1, C_0, lsr #31 ++ mov C_0, C_0, lsl #1 ++ b L_lsl_1 ++#endif ++L_subtract: ++ @ if A >= B ++ cmp A_1, B_1 ++ cmpeq A_0, B_0 ++ bcc L_update ++ @ A -= B ++ subs A_0, A_0, B_0 ++ sbc A_1, A_1, B_1 ++ @ D |= C ++ orr D_0, D_0, C_0 ++ orr D_1, D_1, C_1 ++L_update: ++ @ if A == 0: break ++ orrs ip, A_1, A_0 ++ beq L_exit ++ @ C >>= 1 ++ movs C_1, C_1, lsr #1 ++ movs C_0, C_0, rrx ++ @ if C == 0: break ++ orrs ip, C_1, C_0 ++ beq L_exit ++ @ B >>= 1 ++ movs B_1, B_1, lsr #1 ++ mov B_0, B_0, rrx ++ b L_subtract ++L_exit: ++ @ Note: A, B & Q, R are aliases ++ mov R_0, A_0 ++ mov R_1, A_1 ++ mov Q_0, D_0 ++ mov Q_1, D_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ ++L_div_32_32: ++ @ Note: A_0 & r0 are aliases ++ @ Q_1 r1 ++ mov r1, B_0 ++ bl __aeabi_uidivmod ++ mov R_0, r1 ++ mov R_1, #0 ++ mov Q_1, #0 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ ++L_pow2: ++#ifdef HAVE_CLZ ++ @ Note: A, B and Q, R are aliases ++ @ R = A & (B - 1) ++ and C_0, A_0, C_0 ++ and C_1, A_1, C_1 ++ @ Q = A >> log2(B) ++ @ Note: B must not be 0 here! ++ clz D_0, B_0 ++ add D_1, D_0, #1 ++ rsbs D_0, D_0, #31 ++ bpl L_1 ++ clz D_0, B_1 ++ rsb D_0, D_0, #31 ++ mov A_0, A_1, lsr D_0 ++ add D_0, D_0, #32 ++L_1: ++ movpl A_0, A_0, lsr D_0 ++ARM( orrpl A_0, A_0, A_1, lsl D_1 ) ++THUMB( lslpl TMP, A_1, D_1 ) ++THUMB( orrpl A_0, A_0, TMP ) ++ mov A_1, A_1, lsr D_0 ++ @ Mov back C to R ++ mov R_0, C_0 ++ mov R_1, C_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++#else ++ @ Note: A, B and Q, R are aliases ++ @ R = A & (B - 1) ++ and C_0, A_0, C_0 ++ and C_1, A_1, C_1 ++ @ Q = A >> log2(B) ++ @ Note: B must not be 0 here! ++ @ Count the leading zeroes in B. ++ mov D_0, #0 ++ orrs B_0, B_0, B_0 ++ @ If B is greater than 1 << 31, divide A and B by 1 << 32. ++ moveq A_0, A_1 ++ moveq A_1, #0 ++ moveq B_0, B_1 ++ @ Count the remaining leading zeroes in B. ++ movs B_1, B_0, lsl #16 ++ addeq D_0, #16 ++ moveq B_0, B_0, lsr #16 ++ tst B_0, #0xff ++ addeq D_0, #8 ++ moveq B_0, B_0, lsr #8 ++ tst B_0, #0xf ++ addeq D_0, #4 ++ moveq B_0, B_0, lsr #4 ++ tst B_0, #0x3 ++ addeq D_0, #2 ++ moveq B_0, B_0, lsr #2 ++ tst B_0, #0x1 ++ addeq D_0, #1 ++ @ Shift A to the right by the appropriate amount. ++ rsb D_1, D_0, #32 ++ mov Q_0, A_0, lsr D_0 ++ ARM( orr Q_0, Q_0, A_1, lsl D_1 ) ++ THUMB( lsl A_1, D_1 ) ++ THUMB( orr Q_0, A_1 ) ++ mov Q_1, A_1, lsr D_0 ++ @ Move C to R ++ mov R_0, C_0 ++ mov R_1, C_1 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++#endif ++ ++L_div_by_0: ++ bl __div0 ++ @ As wrong as it could be ++ mov Q_0, #0 ++ mov Q_1, #0 ++ mov R_0, #0 ++ mov R_1, #0 ++ ldmfd sp!, {r4, r5, r6, r7, THUMB(TMP,) pc} ++ENDPROC(__aeabi_uldivmod) ++.popsection diff --git a/package/boot/uboot-fritz4040/patches/110-portability.patch b/package/boot/uboot-fritz4040/patches/110-portability.patch new file mode 100644 index 000000000..08ab88912 --- /dev/null +++ b/package/boot/uboot-fritz4040/patches/110-portability.patch @@ -0,0 +1,32 @@ +Index: u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh +=================================================================== +--- u-boot-2017-01-29-6946ebba.orig/fritz/fritzcreator.sh ++++ u-boot-2017-01-29-6946ebba/fritz/fritzcreator.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh -xe ++#!/bin/bash -xe + + # A helpful + # +@@ -11,6 +11,7 @@ UBOOT_FRITZ4040="uboot-fritz4040.bin" + FRITZ_DTS="fritz/fritz4040.dts" + FRITZ_DTB="fritz4040.dtb" + UBOOT_LOADADDR=0x841FFFF8 ++DTC="${DTC:-dtc}" + + rm -f "$UBOOT_FRITZ4040" + +@@ -44,11 +45,11 @@ printf "\x00\x00\x00\xea\xf8\x01\x33\xc4 + cat "$UBOOT_BIN" >> "$UBOOT_FRITZ4040" + + # Pad file to 1M +-dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1M count=1 conv=sync ++dd if="$UBOOT_FRITZ4040" of="$UBOOT_FRITZ4040.new" bs=1024k count=1 conv=sync + mv "$UBOOT_FRITZ4040.new" "$UBOOT_FRITZ4040" + + # Compile DTS +-dtc "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 ++$DTC "$FRITZ_DTS" -o "$FRITZ_DTB" --space 49152 + + # Append the compiled DTBs + cat "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" "$FRITZ_DTB" >> $UBOOT_FRITZ4040 diff --git a/package/boot/uboot-imx6/Makefile b/package/boot/uboot-imx6/Makefile index 884d8c034..8d422758d 100644 --- a/package/boot/uboot-imx6/Makefile +++ b/package/boot/uboot-imx6/Makefile @@ -7,68 +7,63 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot PKG_VERSION:=2014.04 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=7b6444bd23eb61068c43bd1d44ec7e7bfdbce5cadeca20c833eee186b4d3fd31 -PKG_BUILD_PARALLEL:=1 - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=imx6 + UBOOT_IMAGE:=u-boot.imx endef -define uboot/mx6qsabresd - TITLE:=U-Boot for SABRE i.MX6Quad board +define U-Boot/mx6qsabresd + NAME:=SABRE i.MX6Quad board endef -define uboot/nitrogen6dl - TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 1GB board +define U-Boot/nitrogen6dl + NAME:=Nitrogen6x i.MX6Dual-Lite 1GB board endef -define uboot/nitrogen6dl2g - TITLE:=U-Boot for Nitrogen6x i.MX6Dual-Lite 2GB board +define U-Boot/nitrogen6dl2g + NAME:=Nitrogen6x i.MX6Dual-Lite 2GB board endef -define uboot/nitrogen6q - TITLE:=U-Boot for Nitrogen6x/SABRE Lite (MX6Q/1GB) +define U-Boot/nitrogen6q + NAME:=Nitrogen6x/SABRE Lite (MX6Q/1GB) endef -define uboot/nitrogen6q2g - TITLE:=U-Boot for Nitrogen6x i.MX6Quad 2GB board +define U-Boot/nitrogen6q2g + NAME:=Nitrogen6x i.MX6Quad 2GB board endef -define uboot/nitrogen6s - TITLE:=U-Boot for Nitrogen6x i.MX6Solo 512MB board +define U-Boot/nitrogen6s + NAME:=Nitrogen6x i.MX6Solo 512MB board endef -define uboot/nitrogen6s1g - TITLE:=U-Boot for Nitrogen6x i.MX6Solo 1GB board +define U-Boot/nitrogen6s1g + NAME:=Nitrogen6x i.MX6Solo 1GB board endef -define uboot/wandboard_dl - TITLE:=U-Boot for the Wandboard Dual Lite +define U-Boot/wandboard_dl + NAME:=Wandboard Dual Lite + BUILD_DEVICES:=wandboard endef -define uboot/wandboard_quad - TITLE:=U-Boot for the Wandboard Quad +define U-Boot/wandboard_quad + NAME:=Wandboard Quad + BUILD_DEVICES:=wandboard endef -define uboot/wandboard_solo - TITLE:=U-Boot for the Wandboard Solo +define U-Boot/wandboard_solo + NAME:=Wandboard Solo + BUILD_DEVICES:=wandboard endef -UBOOTS := \ +UBOOT_TARGETS := \ mx6qsabresd \ nitrogen6dl \ nitrogen6dl2g \ @@ -80,58 +75,4 @@ UBOOTS := \ wandboard_quad \ wandboard_solo -define Package/uboot/template -define Package/uboot-imx6-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_imx6 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Luka Perkov -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) \ - $(PKG_BUILD_DIR)/u-boot.imx \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.imx -endef - -define Package/uboot/install/template -define Package/uboot-imx6-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-imx6-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile index 74b9f0fde..f4bb87556 100644 --- a/package/boot/uboot-kirkwood/Makefile +++ b/package/boot/uboot-kirkwood/Makefile @@ -7,93 +7,87 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.09.01 +PKG_VERSION:=2017.09 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=\ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=95728e89dd476d17428f94080752ab48884be477b6a678941582aeef618b70bb -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 +PKG_HASH:=b2d15f2cf5f72e706025cde73d67247c6da8cd35f7e10891eefe7d9095089744 +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +define U-Boot/Default + BUILD_TARGET:=kirkwood endef -define uboot/dockstar - TITLE:=U-Boot for Seagate DockStar +define U-Boot/dockstar + NAME:=Seagate DockStar + BUILD_DEVICES:=seagate_dockstar endef -define uboot/dockstar_second_stage - TITLE:=second stage U-Boot for Seagate DockStar +define U-Boot/dockstar_second_stage + NAME:=Seagate DockStar (second stage) + BUILD_DEVICES:=seagate_dockstar endef -define uboot/goflexhome - TITLE:=U-Boot for the Seagate GoFlexHome/GoFlexNet +define U-Boot/goflexhome + NAME:=the Seagate GoFlexHome/GoFlexNet + BUILD_DEVICES:=seagate_goflexhome seagate_goflexnet endef -define uboot/ib62x0 - TITLE:=U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 +define U-Boot/ib62x0 + NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef -define uboot/ib62x0_second_stage - TITLE:=second stage U-Boot for RaidSonic ICY BOX NAS6210 and NAS6220 +define U-Boot/ib62x0_second_stage + NAME:=RaidSonic ICY BOX NAS6210 and NAS6220 (second stage) + BUILD_DEVICES:=raidsonic_ib-nas62x0 endef -define uboot/iconnect - TITLE:=U-Boot for Iomega iConnect Wireless +define U-Boot/iconnect + NAME:=Iomega iConnect Wireless + BUILD_DEVICES:=iom_iconnect-1.1 endef -define uboot/iconnect_second_stage - TITLE:=second stage U-Boot for Iomega iConnect Wireless +define U-Boot/iconnect_second_stage + NAME:=Iomega iConnect Wireless (second stage) + BUILD_DEVICES:=iom_iconnect-1.1 endef -define uboot/pogo_e02 - TITLE:=U-Boot for Cloud Engines Pogoplug E02 +define U-Boot/nsa310 + NAME:=Zyxel NSA310 + BUILD_DEVICES:=zyxel_nsa310b endef -define uboot/pogo_e02_second_stage - TITLE:=second stage U-Boot for Cloud Engines Pogoplug E02 +define U-Boot/nsa325 + NAME:=Zyxel NSA325v1 and v2 + BUILD_DEVICES:=zyxel_nsa325 endef -define uboot/sheevaplug - TITLE:=U-Boot for SheevaPlug +define U-Boot/pogo_e02 + NAME:=Cloud Engines Pogoplug E02 + BUILD_DEVICES:=cloudengines_pogoe02 endef -UBOOTS:= \ +define U-Boot/pogo_e02_second_stage + NAME:=Cloud Engines Pogoplug E02 (second stage) + BUILD_DEVICES:=cloudengines_pogoe02 +endef + +define U-Boot/pogoplugv4 + NAME:=Cloud Engines Pogoplug V4 + BUILD_DEVICES:=cloudengines_pogoplugv4 +endef + +UBOOT_TARGETS := \ dockstar dockstar_second_stage \ goflexhome \ ib62x0 ib62x0_second_stage \ iconnect iconnect_second_stage \ + nsa310 \ + nsa325 \ pogo_e02 pogo_e02_second_stage \ - sheevaplug - -define Package/uboot/template -define Package/uboot-kirkwood-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_kirkwood - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef + pogoplugv4 define Build/Configure $(if $(findstring _second_stage,$(BUILD_VARIANT)), @@ -112,34 +106,21 @@ define Build/Compile CROSS_COMPILE=$(TARGET_CROSS) mkimage -A $(ARCH) -O linux -T kernel -C none \ -a 0x600000 -e 0x600000 \ - -n 'OpenWrt Das U-Boot uImage' \ + -n 'U-Boot uImage' \ -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img endef -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin - $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb - $(CP) $(PKG_BUILD_DIR)/u-boot.img \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img - $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ - $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ - $(BIN_DIR)/u-boot-kwboot/ +define Package/u-boot/install + $(CP) \ + $(PKG_BUILD_DIR)/u-boot.bin \ + $(PKG_BUILD_DIR)/u-boot.kwb \ + $(PKG_BUILD_DIR)/u-boot.img \ + $(1)/ endef -define Package/uboot/install/template -define Package/uboot-kirkwood-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/kwboot $(STAGING_DIR_HOST)/bin/ endef -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch b/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch deleted file mode 100644 index 65ae63f34..000000000 --- a/package/boot/uboot-kirkwood/patches/0001-kirkwood-ib62x0-add-CONFIG_SYS_GENERIC_BOARD-define.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 280b03ba28b4287de677d4c4b097918364395b5e Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Wed, 2 Jul 2014 01:47:23 +0200 -Subject: [PATCH 4/9] kirkwood: ib62x0: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- -This is patch was sent already in July: - -http://lists.denx.de/pipermail/u-boot/2014-July/182900.html ---- - include/configs/ib62x0.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/ib62x0.h -+++ b/include/configs/ib62x0.h -@@ -9,6 +9,8 @@ - #ifndef _CONFIG_IB62x0_H - #define _CONFIG_IB62x0_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index 6ec605229..000000000 --- a/package/boot/uboot-kirkwood/patches/0002-kirkwood-dockstar-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 5f9e6f640098e6963ff9b470cd5d2ab9f6a3579e Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:40:37 +0100 -Subject: [PATCH 5/9] kirkwood: dockstar: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/dockstar.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/dockstar.h -+++ b/include/configs/dockstar.h -@@ -12,6 +12,8 @@ - #ifndef _CONFIG_DOCKSTAR_H - #define _CONFIG_DOCKSTAR_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch deleted file mode 100644 index ac0bc0d2a..000000000 --- a/package/boot/uboot-kirkwood/patches/0003-kirkwood-goflexhome-add-CONFIG_SYS_GENERIC_BOARD-def.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 0d0a6606396f0cc1a4f2966d167ef9e85d533650 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:40:51 +0100 -Subject: [PATCH 6/9] kirkwood: goflexhome: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/goflexhome.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/goflexhome.h -+++ b/include/configs/goflexhome.h -@@ -15,6 +15,8 @@ - #ifndef _CONFIG_GOFLEXHOME_H - #define _CONFIG_GOFLEXHOME_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index ab23481f7..000000000 --- a/package/boot/uboot-kirkwood/patches/0004-kirkwood-iconnect-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 45ba20427135e526cfa528773de0cfe215f4dc40 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:04 +0100 -Subject: [PATCH 7/9] kirkwood: iconnect: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/iconnect.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/iconnect.h -+++ b/include/configs/iconnect.h -@@ -9,6 +9,8 @@ - #ifndef _CONFIG_ICONNECT_H - #define _CONFIG_ICONNECT_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch b/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch deleted file mode 100644 index 40918d473..000000000 --- a/package/boot/uboot-kirkwood/patches/0005-kirkwood-pogo_e02-add-CONFIG_SYS_GENERIC_BOARD-defin.patch +++ /dev/null @@ -1,23 +0,0 @@ -From bd862f4e7a559e38763a5280e35bf7ff14b535f1 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:19 +0100 -Subject: [PATCH 8/9] kirkwood: pogo_e02: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/pogo_e02.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/pogo_e02.h -+++ b/include/configs/pogo_e02.h -@@ -13,6 +13,8 @@ - #ifndef _CONFIG_POGO_E02_H - #define _CONFIG_POGO_E02_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Machine type definition and ID - */ diff --git a/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch b/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch deleted file mode 100644 index d976bbc02..000000000 --- a/package/boot/uboot-kirkwood/patches/0006-kirkwood-sheevaplug-add-CONFIG_SYS_GENERIC_BOARD-def.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 787e23179708ddad7ecd9dcd6c841546689864b0 Mon Sep 17 00:00:00 2001 -From: Luka Perkov -Date: Sun, 30 Nov 2014 02:41:49 +0100 -Subject: [PATCH 9/9] kirkwood: sheevaplug: add CONFIG_SYS_GENERIC_BOARD define - -Signed-off-by: Luka Perkov -CC: Prafulla Wadaskar -CC: Stefan Roese ---- - include/configs/sheevaplug.h | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/include/configs/sheevaplug.h -+++ b/include/configs/sheevaplug.h -@@ -10,6 +10,8 @@ - #ifndef _CONFIG_SHEEVAPLUG_H - #define _CONFIG_SHEEVAPLUG_H - -+#define CONFIG_SYS_GENERIC_BOARD -+ - /* - * Version number information - */ diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch new file mode 100644 index 000000000..10d8d4405 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch @@ -0,0 +1,697 @@ + +arm: kirkwood: add ZyXEL NSA310 device + +This patch add ZyXEL NSA310 1-Bay Media Server + +The ZyXEL NSA310 device is a Kirkwood based NAS: + +- SoC: Marvell 88F6702 1200Mhz +- SDRAM memory: 256MB DDR2 400Mhz +- Gigabit ethernet: PHY Realtek +- Flash memory: 128MB +- 1 Power button +- 1 Power LED (blue) +- 5 Status LED (green/red) +- 1 Copy/Sync button +- 1 Reset button +- 2 SATA II port (1 internal and 1 external eSata) +- 2 USB 2.0 ports (1 front and 1 back) +- Smart fan + +Signed-off-by: Alberto Bursi + +NOTE: this patch is ready for upstream, LEDE-specific parts are in + another patch + +diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig +index 9205b1e..819bd3b 100644 +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -56,6 +56,9 @@ config TARGET_GOFLEXHOME + config TARGET_NAS220 + bool "BlackArmor NAS220" + ++config TARGET_NSA310 ++ bool "Zyxel NSA310 Board" ++ + config TARGET_NSA310S + bool "Zyxel NSA310S" + +@@ -80,6 +83,7 @@ source "board/raidsonic/ib62x0/Kconfig" + source "board/Seagate/dockstar/Kconfig" + source "board/Seagate/goflexhome/Kconfig" + source "board/Seagate/nas220/Kconfig" ++source "board/zyxel/nsa310/Kconfig" + source "board/zyxel/nsa310s/Kconfig" + + endif +diff --git a/board/zyxel/nsa310/Kconfig b/board/zyxel/nsa310/Kconfig +new file mode 100644 +index 0000000..145ade6 +--- /dev/null ++++ b/board/zyxel/nsa310/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_NSA310 ++ ++config SYS_BOARD ++ default "nsa310" ++ ++config SYS_VENDOR ++ default "zyxel" ++ ++config SYS_CONFIG_NAME ++ default "nsa310" ++ ++endif +diff --git a/board/zyxel/nsa310/MAINTAINERS b/board/zyxel/nsa310/MAINTAINERS +new file mode 100644 +index 0000000..d09f1ab +--- /dev/null ++++ b/board/zyxel/nsa310/MAINTAINERS +@@ -0,0 +1,6 @@ ++NSA310 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/zyxel/nsa310/ ++F: include/configs/nsa310.h ++F: configs/nsa310_defconfig +diff --git a/board/zyxel/nsa310/Makefile b/board/zyxel/nsa310/Makefile +new file mode 100644 +index 0000000..dfe93cc +--- /dev/null ++++ b/board/zyxel/nsa310/Makefile +@@ -0,0 +1,12 @@ ++# ++# (C) Copyright 2015 bodhi ++# ++# Based on ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := nsa310.o +diff --git a/board/zyxel/nsa310/kwbimage.cfg b/board/zyxel/nsa310/kwbimage.cfg +new file mode 100644 +index 0000000..f60e1d2 +--- /dev/null ++++ b/board/zyxel/nsa310/kwbimage.cfg +@@ -0,0 +1,166 @@ ++# ++# Copyright (C) 2013 Rafal Kazmierowski ++# ++# Based on guruplug.c originally written by ++# Siddarth Gore ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++# MA 02110-1301 USA ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations ++BOOT_FROM nand ++#BOOT_FROM uart ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++# SOC registers configuration using bootrom header extension ++# Maximum KWBIMAGE_MAX_CONFIG configurations allowed ++ ++# Configure RGMII-0 interface pad voltage to 1.8V ++DATA 0xFFD100e0 0x1b1b1b9b ++ ++#Dram initalization for SINGLE x16 CL=5 @ 400MHz ++DATA 0xFFD01400 0x43010c30 # DDR Configuration register ++# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) ++# bit23-14: zero ++# bit24: 1= enable exit self refresh mode on DDR access ++# bit25: 1 required ++# bit29-26: zero ++# bit31-30: 01 ++ ++DATA 0xFFD01404 0x37543000 # DDR Controller Control Low ++# bit 4: 0=addr/cmd in smame cycle ++# bit 5: 0=clk is driven during self refresh, we don't care for APX ++# bit 6: 0=use recommended falling edge of clk for addr/cmd ++# bit14: 0=input buffer always powered up ++# bit18: 1=cpu lock transaction enabled ++# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 ++# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM ++# bit30-28: 3 required ++# bit31: 0=no additional STARTBURST delay ++ ++DATA 0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) ++# bit3-0: TRAS lsbs ++# bit7-4: TRCD ++# bit11- 8: TRP ++# bit15-12: TWR ++# bit19-16: TWTR ++# bit20: TRAS msb ++# bit23-21: 0x0 ++# bit27-24: TRRD ++# bit31-28: TRTP ++ ++DATA 0xFFD0140C 0x00000a33 # DDR Timing (High) ++# bit6-0: TRFC ++# bit8-7: TR2R ++# bit10-9: TR2W ++# bit12-11: TW2W ++# bit31-13: zero required ++ ++DATA 0xFFD01410 0x0000000c # DDR Address Control ++# bit1-0: 01, Cs0width=x8 ++# bit3-2: 10, Cs0size=1Gb ++# bit5-4: 01, Cs1width=x8 ++# bit7-6: 10, Cs1size=1Gb ++# bit9-8: 00, Cs2width=nonexistent ++# bit11-10: 00, Cs2size =nonexistent ++# bit13-12: 00, Cs3width=nonexistent ++# bit15-14: 00, Cs3size =nonexistent ++# bit16: 0, Cs0AddrSel ++# bit17: 0, Cs1AddrSel ++# bit18: 0, Cs2AddrSel ++# bit19: 0, Cs3AddrSel ++# bit31-20: 0 required ++ ++DATA 0xFFD01414 0x00000000 # DDR Open Pages Control ++# bit0: 0, OpenPage enabled ++# bit31-1: 0 required ++ ++DATA 0xFFD01418 0x00000000 # DDR Operation ++# bit3-0: 0x0, DDR cmd ++# bit31-4: 0 required ++ ++DATA 0xFFD0141C 0x00000652 # DDR Mode ++# bit2-0: 2, BurstLen=2 required ++# bit3: 0, BurstType=0 required ++# bit6-4: 4, CL=5 ++# bit7: 0, TestMode=0 normal ++# bit8: 0, DLL reset=0 normal ++# bit11-9: 6, auto-precharge write recovery ???????????? ++# bit12: 0, PD must be zero ++# bit31-13: 0 required ++ ++DATA 0xFFD01420 0x00000004 # DDR Extended Mode ++# bit0: 0, DDR DLL enabled ++# bit1: 0, DDR drive strenght normal ++# bit2: 0, DDR ODT control lsd (disabled) ++# bit5-3: 000, required ++# bit6: 1, DDR ODT control msb, (disabled) ++# bit9-7: 000, required ++# bit10: 0, differential DQS enabled ++# bit11: 0, required ++# bit12: 0, DDR output buffer enabled ++# bit31-13: 0 required ++ ++DATA 0xFFD01424 0x0000F17F # DDR Controller Control High ++# bit2-0: 111, required ++# bit3 : 1 , MBUS Burst Chop disabled ++# bit6-4: 111, required ++# bit7 : 0 ++# bit8 : 1 , add writepath sample stage, must be 1 for DDR freq >= 300MHz ++# bit9 : 0 , no half clock cycle addition to dataout ++# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals ++# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh ++# bit15-12: 1111 required ++# bit31-16: 0 required ++ ++DATA 0xFFD01428 0x00085520 # DDR2 ODT Read Timing (default values) ++DATA 0xFFD0147C 0x00008552 # DDR2 ODT Write Timing (default values) ++ ++ ++DATA 0xFFD01504 0x0FFFFFF1 # CS[0]n Size ++#DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 ++# bit0: 1, Window enabled ++# bit1: 0, Write Protect disabled ++# bit3-2: 00, CS0 hit selected ++# bit23-4: ones, required ++# bit31-24: 0x0F, Size (i.e. 256MB) ++ ++DATA 0xFFD01508 0x10000000 # CS[1]n Base address to 256Mb ++DATA 0xFFD0150C 0x00000000 # CS[2]n Size, window disabled KAZ z 400db ++DATA 0xFFD01514 0x00000000 # CS[3]n Size, window disabled ++ ++DATA 0xFFD0151C 0x00000000 # DDR ODT Control (Low) ++DATA 0xFFD01494 0x00120012 # DDR ODT Control (High) KAZ z nowy STATIC_SDRAM_ODT_CTRL_LOW ++# bit1-0: 00, ODT0 controlled by ODT Control (low) register above ++# bit3-2: 01, ODT1 active NEVER! ++# bit31-4: zero, required ++ ++DATA 0xFFD01498 0x00000000 # CPU ODT Control KAZ STATIC_SDRAM_ODT_CTRL_HI ++DATA 0xFFD0149C 0x0000E403 # DDR Initialization Control KAZ STATIC_SDRAM_DUNIT_ODT_CTRL ++DATA 0xFFD01480 0x00000001 # DDR Initialization Control ++#bit0=1, enable DDR init upon this register write ++ ++# End of Header extension ++DATA 0x0 0x0 +diff --git a/board/zyxel/nsa310/nsa310.c b/board/zyxel/nsa310/nsa310.c +new file mode 100644 +index 0000000..eee3f1a +--- /dev/null ++++ b/board/zyxel/nsa310/nsa310.c +@@ -0,0 +1,190 @@ ++/* ++ * Copyright (C) 2013 Rafal Kazmierowski ++ * ++ * Based on NSA320.c Peter Schildmann ++ * originally written by ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "nsa310.h" ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* ++ * default gpio configuration ++ * There are maximum 64 gpios controlled through 2 sets of registers ++ * the below configuration configures mainly initial LED status ++ */ ++ mvebu_config_gpio(NSA310_VAL_LOW, NSA310_VAL_HIGH, ++ NSA310_OE_LOW, NSA310_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ /* (all LEDs & power off active high) */ ++ static const u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW_SDA, /* PCF8563 RTC chip */ ++ MPP9_TW_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* SATA2 LED (green) */ ++ MPP13_GPIO, /* SATA2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB LED (red)-Power*/ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (red) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* Reset button */ ++ MPP37_GPIO, /* Copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* SATA1 LED (green) */ ++ MPP42_GPIO, /* SATA1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* Buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* Power button */ ++ MPP47_GPIO, /* Power resume data */ ++ MPP48_GPIO, /* Power off */ ++ MPP49_GPIO, /* Power resume clock */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config,NULL); ++ return 0; ++} ++ ++int board_init(void) ++{ ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and enable MV88E1318 PHY */ ++void reset_phy(void) ++{ ++ u16 reg; ++ u16 devadr; ++ char *name = "egiga0"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { ++ printf("Err..%s could not read PHY dev address\n", ++ __FUNCTION__); ++ return; ++ } ++ ++ /* Set RGMII delay */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 2); ++ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); ++ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ printf("MV88E1318 PHY initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_SHOW_BOOT_PROGRESS ++void show_boot_progress(int val) ++{ ++ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ u32 dout0 = readl(&gpio0->dout); ++ u32 blen0 = readl(&gpio0->blink_en); ++ ++ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; ++ u32 dout1 = readl(&gpio1->dout); ++ u32 blen1 = readl(&gpio1->blink_en); ++ ++ switch (val) { ++ case BOOTSTAGE_ID_DECOMP_IMAGE: ++ writel(blen0 & ~(SYS_GREEN_LED | SYS_RED_LED), &gpio0->blink_en); ++ writel((dout0 & ~SYS_GREEN_LED) | SYS_RED_LED, &gpio0->dout); ++ break; ++ case BOOTSTAGE_ID_RUN_OS: ++ writel(dout0 & ~SYS_RED_LED, &gpio0->dout); ++ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_START: ++ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_LOADED: ++ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); ++ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); ++ break; ++ case -BOOTSTAGE_ID_NET_NETLOOP_OK: ++ case -BOOTSTAGE_ID_NET_LOADED: ++ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); ++ break; ++ default: ++ if (val < 0) { ++ /* error */ ++ printf("Error occured, error code = %d\n", -val); ++ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); ++ writel(blen0 | SYS_RED_LED, &gpio0->blink_en); ++ } ++ break; ++ } ++} ++#endif +diff --git a/board/zyxel/nsa310/nsa310.h b/board/zyxel/nsa310/nsa310.h +new file mode 100644 +index 0000000..6634a4f +--- /dev/null ++++ b/board/zyxel/nsa310/nsa310.h +@@ -0,0 +1,56 @@ ++/* ++ * Copyright (C) 2013 Rafal Kazmierowski ++ * ++ * Based on Peter Schildmann ++ * and guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef __NSA310_H ++#define __NSA310_H ++ ++/* GPIO's */ ++#define SYS_GREEN_LED (1 << 28) ++#define SYS_RED_LED (1 << 29) ++#define SATA1_GREEN_LED (1 << 41) ++#define SATA1_RED_LED (1 << 42) ++#define SATA2_GREEN_LED (1 << 12) ++#define SATA2_RED_LED (1 << 13) ++#define USB_GREEN_LED (1 << 15) ++#define USB_RED_LED (1 << 21) ++#define COPY_GREEN_LED (1 << 39) ++#define COPY_RED_LED (1 << 40) ++ ++#define NSA310_OE_LOW (0) ++#define NSA310_VAL_LOW (SYS_GREEN_LED) ++#define NSA310_OE_HIGH ((COPY_GREEN_LED | COPY_RED_LED | \ ++ SATA1_GREEN_LED | SATA1_RED_LED)) ++#define NSA310_VAL_HIGH (0) ++ ++/* PHY related */ ++#define MV88E1318_MAC_CTRL_REG 21 ++#define MV88E1318_PGADR_REG 22 ++#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) ++ ++#endif /* __NSA310_H */ +diff --git a/configs/nsa310_defconfig b/configs/nsa310_defconfig +new file mode 100644 +index 0000000..d26ef35 +--- /dev/null ++++ b/configs/nsa310_defconfig +@@ -0,0 +1,34 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_NSA310=y ++CONFIG_IDENT_STRING="\nZyXEL NSA310 1-Bay Power Media Server" ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_PROMPT="NSA310> " ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_SYS_NS16550=y ++CONFIG_CMD_FDT=y ++CONFIG_OF_LIBFDT=y ++CONFIG_CMD_SETEXPR=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y ++CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_CMD_UBI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +diff --git a/include/configs/nsa310.h b/include/configs/nsa310.h +new file mode 100644 +index 0000000..86ef825 +--- /dev/null ++++ b/include/configs/nsa310.h +@@ -0,0 +1,126 @@ ++/* Copyright (C) 2015-2016 bodhi ++ * ++ * Based on ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef _CONFIG_NSA310_H ++#define _CONFIG_NSA310_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 /* SOC Name */ ++ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Misc Configuration Options ++ */ ++#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ ++ ++/* ++ * Commands configuration ++ */ ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_PREBOOT ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* ++ * Environment variables configurations ++ */ ++#ifdef CONFIG_CMD_NAND ++#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ ++#endif ++ ++/* max 4k env size is enough, but in case of nand ++ * it has to be rounded to sector size ++ */ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0xc0000 ++#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x0c0000(uboot)," \ ++ "0x80000(uboot_env)," \ ++ "0x7ec0000(ubi)\0" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS \ ++ "bootargs_root=\0" ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_NETCONSOLE ++#define CONFIG_NET_MULTI ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0x1 ++#define CONFIG_RESET_PHY_R ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * SATA Driver configuration ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET ++#endif /* CONFIG_MVSATA_IDE */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++#endif /* _CONFIG_NSA310_H */ diff --git a/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch new file mode 100644 index 000000000..4b4356e5d --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/008-nsa325-uboot-generic.patch @@ -0,0 +1,683 @@ +diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig +index 819bd3b..6a2d578 100644 +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -62,6 +62,9 @@ config TARGET_NSA310 + config TARGET_NSA310S + bool "Zyxel NSA310S" + ++config TARGET_NSA325 ++ bool "Zyxel NSA325 board" ++ + endchoice + + config SYS_SOC +@@ -85,5 +88,6 @@ source "board/Seagate/goflexhome/Kconfig + source "board/Seagate/nas220/Kconfig" + source "board/zyxel/nsa310/Kconfig" + source "board/zyxel/nsa310s/Kconfig" ++source "board/zyxel/nsa325/Kconfig" + + endif +diff --git a/board/zyxel/nsa325/Kconfig b/board/zyxel/nsa325/Kconfig +new file mode 100644 +index 0000000..1fe5ead +--- /dev/null ++++ b/board/zyxel/nsa325/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_NSA325 ++ ++config SYS_BOARD ++ default "nsa325" ++ ++config SYS_VENDOR ++ default "zyxel" ++ ++config SYS_CONFIG_NAME ++ default "nsa325" ++ ++endif +diff --git a/board/zyxel/nsa325/MAINTAINERS b/board/zyxel/nsa325/MAINTAINERS +new file mode 100644 +index 0000000..130b4d9 +--- /dev/null ++++ b/board/zyxel/nsa325/MAINTAINERS +@@ -0,0 +1,6 @@ ++NSA325 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/zyxel/nsa325/ ++F: include/configs/nsa325.h ++F: configs/nsa325_defconfig +diff --git a/board/zyxel/nsa325/Makefile b/board/zyxel/nsa325/Makefile +new file mode 100644 +index 0000000..4ee953b +--- /dev/null ++++ b/board/zyxel/nsa325/Makefile +@@ -0,0 +1,13 @@ ++# ++# (C) Copyright 2015 bodhi ++# ++# Based on ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := nsa325.o ++ +diff --git a/board/zyxel/nsa325/kwbimage.cfg b/board/zyxel/nsa325/kwbimage.cfg +new file mode 100644 +index 0000000..5a27d38 +--- /dev/null ++++ b/board/zyxel/nsa325/kwbimage.cfg +@@ -0,0 +1,78 @@ ++# Copyright (C) 2015 bodhi ++# ++# Extracted from Zyxel GPL source for u-boot-1.1.4_NSA325v2 ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++# MA 02110-1301 USA ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations ++#BOOT_FROM uart ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++# SOC registers configuration using bootrom header extension ++# Maximum KWBIMAGE_MAX_CONFIG configurations allowed ++ ++# Configure RGMII-0 interface pad voltage to 1.8V ++DATA 0xFFD100e0 0x1b1b1b9b ++ ++#Dram initalization ++DATA 0xFFD01400 0x4301503E # DDR Configuration register ++DATA 0xFFD01404 0xB9843000 # DDR Controller Control Low ++DATA 0xFFD01408 0x33137777 # DDR Timing (Low) ++DATA 0xFFD0140C 0x16000C55 # DDR Timing (High) ++DATA 0xFFD01410 0x04000000 # DDR Address Control ++DATA 0xFFD01414 0x00000000 # DDR Open Pages Control ++DATA 0xFFD01418 0x00000000 # DDR Operation ++DATA 0xFFD0141C 0x00000672 # DDR Mode ++DATA 0xFFD01420 0x00000004 # DDR Extended Mode ++DATA 0xFFD01424 0x0000F14F # DDR Controller Control High ++DATA 0xFFD01428 0x000D6720 # DDR3 ODT Read Timing ++DATA 0xFFD0147C 0x0000B571 # DDR2 ODT Write Timing ++DATA 0xFFD01504 0x1FFFFFF1 # CS[0]n Size ++DATA 0xFFD01508 0x20000000 # CS[1]n Base address to 512Mb ++DATA 0xFFD0150C 0x1FFFFFF4 # CS[1]n Size 512Mb Window enabled for CS1 ++DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled ++DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled ++DATA 0xFFD01494 0x00120000 # DDR ODT Control (Low) ++DATA 0xFFD01498 0x00000000 # DDR ODT Control (High) ++DATA 0xFFD0149C 0x0000E803 # CPU ODT Control ++ ++DATA 0xFFD015D0 0x00000630 ++DATA 0xFFD015D4 0x00000046 ++DATA 0xFFD015D8 0x00000008 ++DATA 0xFFD015DC 0x00000000 ++DATA 0xFFD015E0 0x00000023 ++DATA 0xFFD015E4 0x00203C18 ++DATA 0xFFD01620 0x00384800 ++DATA 0xFFD01480 0x00000001 ++DATA 0xFFD20134 0x66666666 ++DATA 0xFFD20138 0x00066666 ++ ++#Disable nsa325 hardware watchdog to allow successful kwbooting ++DATA 0xFFD10100 0x00004000 # set GPIO 14 to high to disable the watchdog ++DATA 0xFFD10104 0xFFFFBFFF # set GPIO 14 to output (to block any other input to it) ++ ++# End of Header extension ++DATA 0x0 0x0 ++ +diff --git a/board/zyxel/nsa325/nsa325.c b/board/zyxel/nsa325/nsa325.c +new file mode 100644 +index 0000000..4cd1c0f +--- /dev/null ++++ b/board/zyxel/nsa325/nsa325.c +@@ -0,0 +1,265 @@ ++/* ++ * Copyright (C) 2015 bodhi ++ * ++ * Based on ++ * Copyright (C) 2014 Jason Plum ++ * ++ * Based on nsa320.c originall written by ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.c originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include "nsa325.h" ++#include ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* ++ * default gpio configuration ++ * There are maximum 64 gpios controlled through 2 sets of registers ++ * the below configuration configures mainly initial LED status ++ */ ++ mvebu_config_gpio(NSA325_VAL_LOW, NSA325_VAL_HIGH, ++ NSA325_OE_LOW, NSA325_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ /* (all LEDs & power off active high) */ ++ u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW_SDA, /* PCF8563 RTC chip */ ++ MPP9_TW_SCK, /* connected to TWSI */ ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_GPO, /* HDD2 LED (green) */ ++ MPP13_GPIO, /* HDD2 LED (red) */ ++ MPP14_GPIO, /* MCU DATA pin (in) */ ++ MPP15_GPIO, /* USB LED (green) */ ++ MPP16_GPIO, /* MCU CLK pin (out) */ ++ MPP17_GPIO, /* MCU ACT pin (out) */ ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_GPIO, ++ MPP21_GPIO, /* USB power */ ++ MPP22_GPIO, ++ MPP23_GPIO, ++ MPP24_GPIO, ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, /* SYS LED (green) */ ++ MPP29_GPIO, /* SYS LED (orange) */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, ++ MPP36_GPIO, /* reset button */ ++ MPP37_GPIO, /* copy button */ ++ MPP38_GPIO, /* VID B0 */ ++ MPP39_GPIO, /* COPY LED (green) */ ++ MPP40_GPIO, /* COPY LED (red) */ ++ MPP41_GPIO, /* HDD1 LED (green) */ ++ MPP42_GPIO, /* HDD1 LED (red) */ ++ MPP43_GPIO, /* HTP pin */ ++ MPP44_GPIO, /* buzzer */ ++ MPP45_GPIO, /* VID B1 */ ++ MPP46_GPIO, /* power button */ ++ MPP47_GPIO, /* HDD2 power */ ++ MPP48_GPIO, /* power off */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ return 0; ++} ++ ++int board_init(void) ++{ ++ ++ /* address of boot parameters */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ /* This disables the hardware watchdog in the mcu on this board. */ ++ kw_gpio_set_valid(14, 1); ++ kw_gpio_direction_output(14, 0); ++ kw_gpio_set_value(14, 1); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and enable MV88E1318 PHY */ ++void reset_phy(void) ++{ ++ u16 reg; ++ u16 devadr; ++ char *name = "egiga0"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { ++ printf("Err..%s could not read PHY dev address\n", ++ __FUNCTION__); ++ return; ++ } ++ ++ /* Set RGMII delay */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_MAC_CTRL_PG); ++ miiphy_read(name, devadr, MV88E1318_MAC_CTRL_REG, ®); ++ reg |= (MV88E1318_RGMII_RXTM_CTRL | MV88E1318_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1318_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ /* The ZyXEL NSA325 uses the 88E1310S Alaska (interface identical to 88E1318) */ ++ /* and has an MCU attached to the LED[2] via tristate interrupt */ ++ reg = 0; ++ ++ /* switch to LED register page */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, MV88E1318_LED_PG); ++ /* read out LED polarity register */ ++ miiphy_read(name, devadr, MV88E1318_LED_POL_REG, ®); ++ /* clear 4, set 5 - LED2 low, tri-state */ ++ reg &= ~(MV88E1318_LED2_4); ++ reg |= (MV88E1318_LED2_5); ++ /* write back LED polarity register */ ++ miiphy_write(name, devadr, MV88E1318_LED_POL_REG, reg); ++ /* jump back to page 0, per the PHY chip documenation. */ ++ miiphy_write(name, devadr, MV88E1318_PGADR_REG, 0); ++ ++ /* Set the phy back to auto-negotiation mode. Onboard mcu sets it as 10Mbits/s on poweroff for WoL function */ ++ miiphy_write(name, devadr, 0x4, 0x1e1); ++ miiphy_write(name, devadr, 0x9, 0x300); ++ /* Downshift */ ++ miiphy_write(name, devadr, 0x10, 0x3860); ++ miiphy_write(name, devadr, 0x0, 0x9140); ++ ++ printf("MV88E1318 PHY initialized on %s\n", name); ++ ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_SHOW_BOOT_PROGRESS ++void show_boot_progress(int val) ++{ ++ struct kwgpio_registers *gpio0 = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ u32 dout0 = readl(&gpio0->dout); ++ u32 blen0 = readl(&gpio0->blink_en); ++ ++ struct kwgpio_registers *gpio1 = (struct kwgpio_registers *)MVEBU_GPIO1_BASE; ++ u32 dout1 = readl(&gpio1->dout); ++ u32 blen1 = readl(&gpio1->blink_en); ++ ++ switch (val) { ++ case BOOTSTAGE_ID_DECOMP_IMAGE: ++ writel(blen0 & ~(SYS_GREEN_LED | SYS_ORANGE_LED), &gpio0->blink_en); ++ writel((dout0 & ~SYS_GREEN_LED) | SYS_ORANGE_LED, &gpio0->dout); ++ break; ++ case BOOTSTAGE_ID_RUN_OS: ++ writel(dout0 & ~SYS_ORANGE_LED, &gpio0->dout); ++ writel(blen0 | SYS_GREEN_LED, &gpio0->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_START: ++ writel(dout1 & ~COPY_RED_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->blink_en); ++ break; ++ case BOOTSTAGE_ID_NET_LOADED: ++ writel(blen1 & ~(COPY_RED_LED | COPY_GREEN_LED), &gpio1->blink_en); ++ writel((dout1 & ~COPY_RED_LED) | COPY_GREEN_LED, &gpio1->dout); ++ break; ++ case -BOOTSTAGE_ID_NET_NETLOOP_OK: ++ case -BOOTSTAGE_ID_NET_LOADED: ++ writel(dout1 & ~COPY_GREEN_LED, &gpio1->dout); ++ writel((blen1 & ~COPY_GREEN_LED) | COPY_RED_LED, &gpio1->blink_en); ++ break; ++ default: ++ if (val < 0) { ++ /* error */ ++ printf("Error occured, error code = %d\n", -val); ++ writel(dout0 & ~SYS_GREEN_LED, &gpio0->dout); ++ writel(blen0 | SYS_ORANGE_LED, &gpio0->blink_en); ++ } ++ break; ++ } ++} ++#endif ++ ++#if defined(CONFIG_KIRKWOOD_GPIO) ++/* Return GPIO button status */ ++/* ++un-pressed: ++ gpio-36 (Reset Button ) in hi (act lo) - IRQ edge (clear ) ++ gpio-37 (Copy Button ) in hi (act lo) - IRQ edge (clear ) ++ gpio-46 (Power Button ) in lo (act hi) - IRQ edge (clear ) ++pressed ++ gpio-36 (Reset Button ) in lo (act hi) - IRQ edge (clear ) ++ gpio-37 (Copy Button ) in lo (act hi) - IRQ edge (clear ) ++ gpio-46 (Power Button ) in hi (act lo) - IRQ edge (clear ) ++*/ ++ ++static int ++do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ++{ ++ if (strcmp(argv[1], "power") == 0) { ++ kw_gpio_set_valid(BTN_POWER, GPIO_INPUT_OK); ++ kw_gpio_direction_input(BTN_POWER); ++ return !kw_gpio_get_value(BTN_POWER); ++ } ++ else if (strcmp(argv[1], "reset") == 0) ++ return kw_gpio_get_value(BTN_RESET); ++ else if (strcmp(argv[1], "copy") == 0) ++ return kw_gpio_get_value(BTN_COPY); ++ else ++ return -1; ++} ++ ++ ++U_BOOT_CMD(button, 2, 0, do_read_button, ++ "Return GPIO button status 0=off 1=on", ++ "- button power|reset|copy: test buttons states\n" ++); ++ ++#endif ++ +diff --git a/board/zyxel/nsa325/nsa325.h b/board/zyxel/nsa325/nsa325.h +new file mode 100644 +index 0000000..996653e +--- /dev/null ++++ b/board/zyxel/nsa325/nsa325.h +@@ -0,0 +1,77 @@ ++/* ++ * Copyright (C) 2014 Jason Plum ++ * ++ * Based on nsa320.h originall written by ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef __NSA325_H ++#define __NSA325_H ++ ++/* low GPIO's */ ++#define HDD2_GREEN_LED (1 << 12) ++#define HDD2_RED_LED (1 << 13) ++#define USB_GREEN_LED (1 << 15) ++#define USB_POWER (1 << 21) ++#define SYS_GREEN_LED (1 << 28) ++#define SYS_ORANGE_LED (1 << 29) ++ ++#define PIN_USB_GREEN_LED 15 ++#define PIN_USB_POWER 21 ++ ++#define NSA325_OE_LOW (~(HDD2_GREEN_LED | HDD2_RED_LED | \ ++ USB_GREEN_LED | USB_POWER | \ ++ SYS_GREEN_LED | SYS_ORANGE_LED)) ++#define NSA325_VAL_LOW (SYS_GREEN_LED | USB_POWER) ++ ++/* high GPIO's */ ++#define COPY_GREEN_LED (1 << 7) ++#define COPY_RED_LED (1 << 8) ++#define HDD1_GREEN_LED (1 << 9) ++#define HDD1_RED_LED (1 << 10) ++#define HDD2_POWER (1 << 15) ++#define WATCHDOG_SIGNAL (1 << 14) ++ ++#define NSA325_OE_HIGH (~(COPY_GREEN_LED | COPY_RED_LED | \ ++ HDD1_GREEN_LED | HDD1_RED_LED | HDD2_POWER | WATCHDOG_SIGNAL )) ++#define NSA325_VAL_HIGH (WATCHDOG_SIGNAL | HDD2_POWER) ++ ++/* PHY related */ ++#define MV88E1318_PGADR_REG 22 ++#define MV88E1318_MAC_CTRL_PG 2 ++#define MV88E1318_MAC_CTRL_REG 21 ++#define MV88E1318_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1318_RGMII_RXTM_CTRL (1 << 5) ++#define MV88E1318_LED_PG 3 ++#define MV88E1318_LED_POL_REG 17 ++#define MV88E1318_LED2_4 (1 << 4) ++#define MV88E1318_LED2_5 (1 << 5) ++ ++#define BTN_POWER 46 ++#define BTN_RESET 36 ++#define BTN_COPY 37 ++ ++#endif /* __NSA325_H */ +diff --git a/configs/nsa325_defconfig b/configs/nsa325_defconfig +new file mode 100644 +index 0000000..48e09cc +--- /dev/null ++++ b/configs/nsa325_defconfig +@@ -0,0 +1,34 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_NSA325=y ++CONFIG_IDENT_STRING="\nZyXEL NSA325 2-Bay Power Media Server" ++CONFIG_BOOTDELAY=3 ++CONFIG_SYS_PROMPT="NSA325> " ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_SYS_NS16550=y ++CONFIG_CMD_FDT=y ++CONFIG_OF_LIBFDT=y ++CONFIG_CMD_SETEXPR=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_USB=y ++CONFIG_USB=y ++CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y ++CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_CMD_UBI=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +diff --git a/include/configs/nsa325.h b/include/configs/nsa325.h +new file mode 100644 +index 0000000..e5a8e2a +--- /dev/null ++++ b/include/configs/nsa325.h +@@ -0,0 +1,129 @@ ++/* ++ * (C) Copyright 2016 bodhi ++ * ++ * Based on ++ * Copyright (C) 2014 Jason Plum ++ * Based on ++ * Copyright (C) 2012 Peter Schildmann ++ * ++ * Based on guruplug.h originally written by ++ * Siddarth Gore ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301 USA ++ */ ++ ++#ifndef _CONFIG_NSA325_H ++#define _CONFIG_NSA325_H ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 1 /* CPU Core subversion */ ++#define CONFIG_KW88F6281 1 /* SOC Name */ ++ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Misc Configuration Options ++ */ ++#define CONFIG_SHOW_BOOT_PROGRESS 1 /* boot progess display (LED's) */ ++ ++/* ++ * Commands configuration ++ */ ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_PREBOOT ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* ++ * Environment variables configurations ++ */ ++#ifdef CONFIG_CMD_NAND ++#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ ++#endif ++/* ++ * max 4k env size is enough, but in case of nand ++ * it has to be rounded to sector size ++ */ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0xc0000 ++#define CONFIG_ENV_OFFSET 0xc0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x0c0000(uboot)," \ ++ "0x80000(uboot_env)," \ ++ "0x7ec0000(ubi)\0" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS \ ++ "bootargs_root=\0" ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0x1 ++#define CONFIG_NETCONSOLE ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * SATA Driver configuration ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET ++#endif /* CONFIG_MVSATA_IDE */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++#define CONFIG_KIRKWOOD_GPIO /* Enable GPIO Support */ ++ ++#endif /* _CONFIG_NSA325_H */ diff --git a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch new file mode 100644 index 000000000..d2daf0b66 --- /dev/null +++ b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch @@ -0,0 +1,1574 @@ +--- a/arch/arm/mach-kirkwood/Kconfig ++++ b/arch/arm/mach-kirkwood/Kconfig +@@ -25,6 +25,9 @@ config TARGET_LSXL + config TARGET_POGO_E02 + bool "pogo_e02 Board" + ++config TARGET_POGOPLUGV4 ++ bool "Pogoplug V4 Board" ++ + config TARGET_DNS325 + bool "dns325 Board" + +@@ -77,6 +80,7 @@ source "board/Marvell/guruplug/Kconfig" + source "board/Marvell/sheevaplug/Kconfig" + source "board/buffalo/lsxl/Kconfig" + source "board/cloudengines/pogo_e02/Kconfig" ++source "board/cloudengines/pogoplugv4/Kconfig" + source "board/d-link/dns325/Kconfig" + source "board/iomega/iconnect/Kconfig" + source "board/keymile/km_arm/Kconfig" +--- a/arch/arm/mach-kirkwood/include/mach/config.h ++++ b/arch/arm/mach-kirkwood/include/mach/config.h +@@ -77,6 +77,7 @@ + * Ethernet Driver configuration + */ + #ifdef CONFIG_CMD_NET ++#define CONFIG_FEATURE_COMMAND_EDITING + #define CONFIG_NETCONSOLE /* include NetConsole support */ + #define CONFIG_MII /* expose smi ove miiphy interface */ + #define CONFIG_MVGBE /* Enable Marvell Gbe Controller Driver */ +@@ -110,6 +111,7 @@ + #define CONFIG_SYS_ATA_STRIDE 4 + /* Controller supports 48-bits LBA addressing */ + #define CONFIG_LBA48 ++#define CONFIG_SYS_64BIT_LBA + /* CONFIG_IDE requires some #defines for ATA registers */ + #define CONFIG_SYS_IDE_MAXBUS 2 + #define CONFIG_SYS_IDE_MAXDEVICE 2 +@@ -134,4 +136,15 @@ + #define CONFIG_SYS_TIMER_COUNTER (MVEBU_TIMER_BASE + 0x14) + #define CONFIG_SYS_TIMER_RATE CONFIG_SYS_TCLK + ++/* ++ * Boot option ++ */ ++#define CONFIG_CMD_BOOTZ ++ ++/* ++ * GPIO ++ */ ++#define CONFIG_CMD_GPIO ++#define CONFIG_KIRKWOOD_GPIO ++ + #endif /* _KW_CONFIG_H */ +--- a/arch/arm/mach-kirkwood/include/mach/kw88f6192.h ++++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h +@@ -16,6 +16,6 @@ + #define KW_REGS_PHY_BASE KW88F6192_REGS_PHYS_BASE + + /* TCLK Core Clock defination */ +-#define CONFIG_SYS_TCLK 166000000 /* 166MHz */ ++#define CONFIG_SYS_TCLK 166666667 /* 166MHz */ + + #endif /* _CONFIG_KW88F6192_H */ +--- a/arch/arm/mach-kirkwood/include/mach/mpp.h ++++ b/arch/arm/mach-kirkwood/include/mach/mpp.h +@@ -217,10 +217,12 @@ + #define MPP33_GPIO MPP( 33, 0x0, 1, 1, 0, 1, 1, 1 ) + #define MPP33_TDM_DTX MPP( 33, 0x2, 0, 1, 0, 0, 1, 1 ) + #define MPP33_GE1_13 MPP( 33, 0x3, 0, 0, 0, 1, 1, 1 ) ++#define MPP33_SATA1_ACTn MPP( 33, 0x5, 0, 1, 0, 1, 1, 1 ) + + #define MPP34_GPIO MPP( 34, 0x0, 1, 1, 0, 1, 1, 1 ) + #define MPP34_TDM_SPI_CS1 MPP( 34, 0x2, 0, 1, 0, 0, 1, 1 ) + #define MPP34_GE1_14 MPP( 34, 0x3, 0, 0, 0, 1, 1, 1 ) ++#define MPP34_SATA1_ACTn MPP( 34, 0x5, 0, 1, 0, 1, 1, 1 ) + + #define MPP35_GPIO MPP( 35, 0x0, 1, 1, 1, 1, 1, 1 ) + #define MPP35_TDM_CH0_TX_QL MPP( 35, 0x2, 0, 1, 0, 0, 1, 1 ) +--- a/arch/arm/mach-mvebu/include/mach/soc.h ++++ b/arch/arm/mach-mvebu/include/mach/soc.h +@@ -18,6 +18,8 @@ + #define SOC_88F6810_ID 0x6810 + #define SOC_88F6820_ID 0x6820 + #define SOC_88F6828_ID 0x6828 ++#define SOC_88F6192_ID 0x6192 ++#define SOC_88F6702_ID 0x6702 + + /* A375 revisions */ + #define MV_88F67XX_A0_ID 0x3 +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/Kconfig +@@ -0,0 +1,12 @@ ++if TARGET_POGOPLUGV4 ++ ++config SYS_BOARD ++ default "pogoplugv4" ++ ++config SYS_VENDOR ++ default "cloudengines" ++ ++config SYS_CONFIG_NAME ++ default "pogoplugv4" ++ ++endif +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/MAINTAINERS +@@ -0,0 +1,6 @@ ++POGOPLUGV4 BOARD ++M: Alberto Bursi ++S: Maintained ++F: board/cloudengines/pogoplugv4/ ++F: include/configs/pogoplugv4.h ++F: configs/pogoplugv4_defconfig +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/Makefile +@@ -0,0 +1,11 @@ ++# ++# (C) Copyright 2009 bodhi ++# ++# Based on ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar ++# ++# SPDX-License-Identifier: GPL-2.0+ ++# ++ ++obj-y := pogoplugv4.o +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/kwbimage.cfg +@@ -0,0 +1,167 @@ ++# ++# Copyright (C) 2012 ++# David Purdy ++# ++# Based on Kirkwood support: ++# (C) Copyright 2009 ++# Marvell Semiconductor ++# Written-by: Prafulla Wadaskar marvell.com> ++# ++# See file CREDITS for list of people who contributed to this ++# project. ++# ++# This program is free software; you can redistribute it and/or ++# modify it under the terms of the GNU General Public License as ++# published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; If not, see . ++# ++# Refer docs/README.kwimage for more details about how-to configure ++# and create kirkwood boot image ++# ++ ++# Boot Media configurations (DONE) ++BOOT_FROM nand ++NAND_ECC_MODE default ++NAND_PAGE_SIZE 0x0800 ++ ++# SOC registers configuration using bootrom header extension ++# Maximum KWBIMAGE_MAX_CONFIG configurations allowed ++ ++# Configure RGMII-0 interface pad voltage to 1.8V (SHOULD BE SAME) ++DATA 0xffd100e0 0x1b1b1b9b ++ ++#Dram initalization for SINGLE x16 CL=3 @ 200MHz (need CL=3 @ 200MHz?) ++DATA 0xffd01400 0x43000618 # DDR Configuration register ++# bit13-0: 0x200 (200 DDR2 clks refresh rate) ++# bit23-14: zero ++# bit24: 1= enable exit self refresh mode on DDR access ++# bit25: 1 required ++# bit29-26: zero ++# bit31-30: 01 ++ ++DATA 0xffd01404 0x34143000 # DDR Controller Control Low ++# bit 4: 0=addr/cmd in smame cycle ++# bit 5: 0=clk is driven during self refresh, we don't care for APX ++# bit 6: 0=use recommended falling edge of clk for addr/cmd ++# bit14: 0=input buffer always powered up ++# bit18: 1=cpu lock transaction enabled ++# bit23-20: 3=recommended value for CL=3 and STARTBURST_DEL disabled bit31=0 ++# bit27-24: 6= CL+3, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM ++# bit30-28: 3 required ++# bit31: 0=no additional STARTBURST delay ++ ++DATA 0xffd01408 0x11012227 # DDR Timing (Low) (active cycles value +1) ++# bit3-0: TRAS lsbs ++# bit7-4: TRCD ++# bit11- 8: TRP ++# bit15-12: TWR ++# bit19-16: TWTR ++# bit20: TRAS msb ++# bit23-21: 0x0 ++# bit27-24: TRRD ++# bit31-28: TRTP ++ ++DATA 0xffd0140c 0x00000819 # DDR Timing (High) ++# bit6-0: TRFC ++# bit8-7: TR2R ++# bit10-9: TR2W ++# bit12-11: TW2W ++# bit31-13: zero required ++ ++DATA 0xffd01410 0x00000001 # DDR Address Control (changed to Dockstar vals) ++# bit1-0: 00, Cs0width=x16 ++# bit3-2: 10, Cs0size=512Mb ++# bit5-4: 00, Cs2width=nonexistent ++# bit7-6: 00, Cs1size =nonexistent ++# bit9-8: 00, Cs2width=nonexistent ++# bit11-10: 00, Cs2size =nonexistent ++# bit13-12: 00, Cs3width=nonexistent ++# bit15-14: 00, Cs3size =nonexistent ++# bit16: 0, Cs0AddrSel ++# bit17: 0, Cs1AddrSel ++# bit18: 0, Cs2AddrSel ++# bit19: 0, Cs3AddrSel ++# bit31-20: 0 required ++ ++DATA 0xffd01414 0x00000000 # DDR Open Pages Control ++# bit0: 0, OpenPage enabled ++# bit31-1: 0 required ++ ++DATA 0xffd01418 0x00000000 # DDR Operation ++# bit3-0: 0x0, DDR cmd ++# bit31-4: 0 required ++ ++DATA 0xffd0141c 0x00000632 # DDR Mode ++# bit2-0: 2, BurstLen=2 required ++# bit3: 0, BurstType=0 required ++# bit6-4: 4, CL=5 (<===== change to CL=3 ?) ++# bit7: 0, TestMode=0 normal ++# bit8: 0, DLL reset=0 normal ++# bit11-9: 6, auto-precharge write recovery ???????????? ++# bit12: 0, PD must be zero ++# bit31-13: 0 required ++ ++DATA 0xffd01420 0x00000040 # DDR Extended Mode ++# bit0: 0, DDR DLL enabled ++# bit1: 0, DDR drive strenght normal ++# bit2: 0, DDR ODT control lsd (disabled) ++# bit5-3: 000, required ++# bit6: 1, DDR ODT control msb, (disabled) ++# bit9-7: 000, required ++# bit10: 0, differential DQS enabled ++# bit11: 0, required ++# bit12: 0, DDR output buffer enabled ++# bit31-13: 0 required ++ ++DATA 0xffd01424 0x0000F07F # DDR Controller Control High ++# bit2-0: 111, required ++# bit3 : 1 , MBUS Burst Chop disabled ++# bit6-4: 111, required ++# bit7 : 0 ++# bit8 : 0 , no sample stage ++# bit9 : 0 , no half clock cycle addition to dataout ++# bit10 : 0 , 1/4 clock cycle skew enabled for addr/ctl signals ++# bit11 : 0 , 1/4 clock cycle skew disabled for write mesh ++# bit15-12: 1111 required ++# bit31-16: 0 required ++ ++DATA 0xffd01428 0x00085520 # DDR2 ODT Read Timing (default values) ++DATA 0xffd0147c 0x00008552 # DDR2 ODT Write Timing (default values) ++ ++DATA 0xFFD01500 0x00000000 # CS[0]n Base address to 0x0 ++DATA 0xFFD01504 0x07FFFFF1 # CS[0]n Size ++# bit0: 1, Window enabled ++# bit1: 0, Write Protect disabled ++# bit3-2: 00, CS0 hit selected ++# bit23-4: ones, required ++# bit31-24: 0x07, Size (i.e. 128MB) ++ ++DATA 0xFFD0150C 0x00000000 # CS[1]n Size, window disabled ++DATA 0xFFD01514 0x00000000 # CS[2]n Size, window disabled ++DATA 0xFFD0151C 0x00000000 # CS[3]n Size, window disabled ++ ++DATA 0xffd01494 0x00030000 # DDR ODT Control (Low) (DONE) ++# bit3-0: 2, ODT0Rd, MODT[0] asserted during read from DRAM CS1 ++# bit7-4: 1, ODT0Rd, MODT[0] asserted during read from DRAM CS0 ++# bit19-16:2, ODT0Wr, MODT[0] asserted during write to DRAM CS1 ++# bit23-20:1, ODT0Wr, MODT[0] asserted during write to DRAM CS0 ++ ++DATA 0xffd01498 0x00000000 # DDR ODT Control (High) (DONE) ++# bit1-0: 00, ODT0 controlled by ODT Control (low) register above ++# bit3-2: 01, ODT1 active NEVER! ++# bit31-4: zero, required ++ ++DATA 0xffd0149c 0x0000e803 # CPU ODT Control (DONE) ++DATA 0xffd01480 0x00000001 # DDR Initialization Control (DONE) ++#bit0=1, enable DDR init upon this register write ++ ++# End of Header extension ++DATA 0x0 0x0 +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/pogoplugv4.c +@@ -0,0 +1,223 @@ ++/* ++ * Copyright (C) 2016 bodhi ++ * Copyright (C) 2014 bodhi ++ * ++ * Based on ++ * ++ * Copyright (C) 2014 ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; If not, see . ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include "pogoplugv4.h" ++#include ++ ++#ifdef CONFIG_KIRKWOOD_MMC ++#include ++#endif /* CONFIG_KIRKWOOD_MMC */ ++ ++ ++DECLARE_GLOBAL_DATA_PTR; ++ ++int board_early_init_f(void) ++{ ++ /* ++ * default gpio configuration ++ * There are maximum 64 gpios controlled through 2 sets of registers ++ * the below configuration configures mainly initial LED status ++ */ ++ mvebu_config_gpio(POGOPLUGV4_OE_VAL_LOW, ++ POGOPLUGV4_OE_VAL_HIGH, ++ POGOPLUGV4_OE_LOW, POGOPLUGV4_OE_HIGH); ++ ++ /* Multi-Purpose Pins Functionality configuration */ ++ u32 kwmpp_config[] = { ++ MPP0_NF_IO2, ++ MPP1_NF_IO3, ++ MPP2_NF_IO4, ++ MPP3_NF_IO5, ++ MPP4_NF_IO6, ++ MPP5_NF_IO7, ++ MPP6_SYSRST_OUTn, ++ MPP7_GPO, ++ MPP8_TW_SDA, ++ MPP9_TW_SCK, ++ MPP10_UART0_TXD, ++ MPP11_UART0_RXD, ++ MPP12_SD_CLK, ++ MPP13_SD_CMD, ++ MPP14_SD_D0, ++ MPP15_SD_D1, ++ MPP16_SD_D2, ++ MPP17_SD_D3, ++ MPP18_NF_IO0, ++ MPP19_NF_IO1, ++ MPP20_SATA1_ACTn, ++ MPP21_SATA0_ACTn, ++ MPP22_GPIO, /* Green LED */ ++ MPP23_GPIO, ++ MPP24_GPIO, /* Red LED */ ++ MPP25_GPIO, ++ MPP26_GPIO, ++ MPP27_GPIO, ++ MPP28_GPIO, ++ MPP29_GPIO, /* Eject button */ ++ MPP30_GPIO, ++ MPP31_GPIO, ++ MPP32_GPIO, ++ MPP33_GPIO, ++ MPP34_GPIO, ++ MPP35_GPIO, /* FR6192 has only 36 GPIOs */ ++ 0 ++ }; ++ kirkwood_mpp_conf(kwmpp_config, NULL); ++ ++ return 0; ++} ++ ++int board_init(void) ++{ ++ /* Boot parameters address */ ++ gd->bd->bi_boot_params = mvebu_sdram_bar(0) + 0x100; ++ ++ kw_gpio_set_valid(20, 1); ++ kw_gpio_set_valid(21, 1); ++ kw_gpio_set_valid(22, 1); ++ kw_gpio_set_valid(24, 1); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_RESET_PHY_R ++/* Configure and initialize PHY */ ++void reset_phy(void) ++{ ++ u16 reg; ++ u16 devadr; ++ char *name = "egiga0"; ++ ++ if (miiphy_set_current_dev(name)) ++ return; ++ ++ /* command to read PHY dev address */ ++ if (miiphy_read(name, 0xEE, 0xEE, (u16 *) &devadr)) { ++ printf("Err..(%s) could not read PHY dev address\n", __func__); ++ return; ++ } ++ ++ /* ++ * Enable RGMII delay on Tx and Rx for CPU port ++ * Ref: sec 4.7.2 of chip datasheet ++ */ ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2); ++ miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, ®); ++ reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL); ++ miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg); ++ miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0); ++ ++ /* reset the phy */ ++ miiphy_reset(name, devadr); ++ ++ debug("88E1116 Initialized on %s\n", name); ++} ++#endif /* CONFIG_RESET_PHY_R */ ++ ++#ifdef CONFIG_KIRKWOOD_MMC ++int board_mmc_init(bd_t *bis) ++{ ++ kw_mmc_initialize(bis); ++ return 0; ++} ++#endif /* CONFIG_KIRKWOOD_MMC */ ++ ++ ++#define GREEN_LED (1 << 22) ++#define RED_LED (1 << 24) ++#define BOTH_LEDS (GREEN_LED | RED_LED) ++#define NEITHER_LED 0 ++ ++static void set_leds(u32 leds, u32 blinking) ++{ ++ struct kwgpio_registers *r; ++ u32 oe; ++ u32 bl; ++ ++ r = (struct kwgpio_registers *)MVEBU_GPIO0_BASE; ++ oe = readl(&r->oe) | BOTH_LEDS; ++ writel(oe & ~leds, &r->oe); /* active low */ ++ bl = readl(&r->blink_en) & ~BOTH_LEDS; ++ writel(bl | blinking, &r->blink_en); ++} ++ ++void show_boot_progress(int val) ++{ ++ switch (val) { ++ case BOOTSTAGE_ID_RUN_OS: /* booting Linux */ ++ set_leds(BOTH_LEDS, NEITHER_LED); ++ break; ++ case BOOTSTAGE_ID_NET_ETH_START: /* Ethernet initialization */ ++ set_leds(GREEN_LED, GREEN_LED); ++ break; ++ default: ++ if (val < 0) /* error */ ++ set_leds(RED_LED, RED_LED); ++ break; ++ } ++} ++ ++#if defined(CONFIG_KIRKWOOD_GPIO) ++/* Return GPIO button status */ ++/* ++un-pressed: ++ gpio-29 (Eject Button ) in hi (act lo) - IRQ edge (clear ) ++pressed ++ gpio-29 (Eject Button ) in lo (act hi) - IRQ edge (clear ) ++*/ ++ ++static int ++do_read_button(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) ++{ ++ if (strcmp(argv[1], "eject") == 0) { ++ kw_gpio_set_valid(BTN_EJECT, GPIO_INPUT_OK); ++ kw_gpio_direction_input(BTN_EJECT); ++ return kw_gpio_get_value(BTN_EJECT); ++ } ++ else ++ return -1; ++} ++ ++ ++U_BOOT_CMD(button, 2, 0, do_read_button, ++ "Return GPIO button status 0=off 1=on", ++ "- button eject: test buttons states\n" ++); ++ ++#endif +--- /dev/null ++++ b/board/cloudengines/pogoplugv4/pogoplugv4.h +@@ -0,0 +1,50 @@ ++/* ++ * Copyright (C) 2016 ++ * bodhi ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; If not, see . ++ */ ++ ++#ifndef __POGOPLUGV4_H ++#define __POGOPLUGV4_H ++ ++/* GPIO configuration */ ++#define POGOPLUGV4_OE_LOW (~(0)) ++#define POGOPLUGV4_OE_HIGH (~(0)) ++#define POGOPLUGV4_OE_VAL_LOW (1 << 29) ++#define POGOPLUGV4_OE_VAL_HIGH 0 ++ ++/* PHY related */ ++#define MV88E1116_LED_FCTRL_REG 10 ++#define MV88E1116_CPRSP_CR3_REG 21 ++#define MV88E1116_MAC_CTRL_REG 21 ++#define MV88E1116_PGADR_REG 22 ++#define MV88E1116_RGMII_TXTM_CTRL (1 << 4) ++#define MV88E1116_RGMII_RXTM_CTRL (1 << 5) ++ ++/* button */ ++#define BTN_EJECT 29 ++ ++#endif /* __POGOPLUGV4_H */ +--- /dev/null ++++ b/configs/pogoplugv4_defconfig +@@ -0,0 +1,35 @@ ++CONFIG_ARM=y ++CONFIG_KIRKWOOD=y ++CONFIG_TARGET_POGOPLUGV4=y ++CONFIG_SYS_PROMPT="pogoplugv4> " ++CONFIG_IDENT_STRING="\nPogoplug V4" ++CONFIG_BOOTDELAY=3 ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_SYS_NS16550=y ++CONFIG_CMD_FDT=y ++CONFIG_OF_LIBFDT=y ++CONFIG_CMD_SETEXPR=y ++CONFIG_CMD_DHCP=y ++CONFIG_CMD_MII=y ++CONFIG_CMD_PING=y ++CONFIG_CMD_DNS=y ++CONFIG_CMD_SNTP=y ++CONFIG_CMD_USB=y ++CONFIG_CMD_DATE=y ++CONFIG_CMD_EXT2=y ++CONFIG_CMD_EXT4=y ++CONFIG_CMD_FAT=y ++CONFIG_CMD_JFFS2=y ++CONFIG_CMD_MTDPARTS=y ++CONFIG_CMD_ENV=y ++CONFIG_CMD_NAND=y ++CONFIG_CMD_MMC=y ++CONFIG_EFI_PARTITION=y ++CONFIG_ENV_IS_IN_NAND=y ++CONFIG_CMD_UBI=y ++CONFIG_USB=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_STORAGE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/drivers/gpio/kw_gpio.c ++++ b/drivers/gpio/kw_gpio.c +@@ -148,3 +148,36 @@ void kw_gpio_set_blink(unsigned pin, int + /* Set blinking. */ + __set_blinking(pin, blink); + } ++ ++ ++/* ++ * Hooks to GENERIC_GPIO primitives ++ */ ++ ++int gpio_direction_input(unsigned pin) ++{ ++ return kw_gpio_direction_input(pin); ++} ++ ++int gpio_direction_output(unsigned pin, int value) ++{ ++ return kw_gpio_direction_output(pin, value); ++} ++ ++void gpio_set_value(unsigned pin, int value) { ++ kw_gpio_set_value(pin, value); ++} ++ ++int gpio_get_value(unsigned pin) { ++ return kw_gpio_get_value(pin); ++} ++ ++int gpio_request(unsigned gpio, const char *label) ++{ ++ return 0; ++} ++ ++int gpio_free(unsigned gpio) ++{ ++ return 0; ++} +--- a/drivers/mmc/Makefile ++++ b/drivers/mmc/Makefile +@@ -61,6 +61,7 @@ obj-$(CONFIG_MMC_SDHCI_TANGIER) += tang + obj-$(CONFIG_MMC_SDHCI_TEGRA) += tegra_mmc.o + obj-$(CONFIG_MMC_SDHCI_XENON) += xenon_sdhci.o + obj-$(CONFIG_MMC_SDHCI_ZYNQ) += zynq_sdhci.o ++obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o + + obj-$(CONFIG_MMC_SUNXI) += sunxi_mmc.o + obj-$(CONFIG_MMC_UNIPHIER) += uniphier-sd.o +--- /dev/null ++++ b/drivers/mmc/kirkwood_mmc.c +@@ -0,0 +1,482 @@ ++/* ++ * (C) Copyright 2014 bodhi ++ * ++ * Based on ++ * ++ * (C) Copyright 2014 ++ * ++ * Based on ++ * ++ * Driver for Marvell SDIO/MMC controller ++ * ++ * (C) Copyright 2012 ++ * Marvell Semiconductor ++ * Written-by: Gérald Kerma ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++ * MA 02111-1307 USA ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#define DRIVER_NAME "kwsdio" ++ ++static int kw_mmc_setup_data(struct mmc_data *data) ++{ ++ u32 ctrl_reg; ++ ++#ifdef DEBUG ++ printf("%s, data %s : blocks=%d blksz=%d\n", DRIVER_NAME, ++ (data->flags & MMC_DATA_READ) ? "read" : "write", ++ data->blocks, data->blocksize); ++#endif ++ ++ /* default to maximum timeout */ ++ ctrl_reg = kwsd_read(SDIO_HOST_CTRL); ++ ctrl_reg |= SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX); ++ kwsd_write(SDIO_HOST_CTRL, ctrl_reg); ++ ++ if (data->flags & MMC_DATA_READ) { ++ kwsd_write(SDIO_SYS_ADDR_LOW,(u32)data->dest & 0xffff); ++ kwsd_write(SDIO_SYS_ADDR_HI,(u32)data->dest >> 16); ++ } else { ++ kwsd_write(SDIO_SYS_ADDR_LOW,(u32)data->src & 0xffff); ++ kwsd_write(SDIO_SYS_ADDR_HI,(u32)data->src >> 16); ++ } ++ ++ kwsd_write(SDIO_BLK_COUNT, data->blocks); ++ kwsd_write(SDIO_BLK_SIZE, data->blocksize); ++ ++ return 0; ++} ++ ++static int kw_mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) ++{ ++ int timeout = 10; ++ int err; ++ ushort waittype = 0; ++ ushort resptype = 0; ++ ushort xfertype = 0; ++ ushort resp_indx = 0; ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("cmdidx [0x%x] resp_type[0x%x] cmdarg[0x%x]\n", cmd->cmdidx, cmd->resp_type, cmd->cmdarg); ++#endif ++ ++ udelay(10000); ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("%s: cmd %d (hw state 0x%04x)\n", DRIVER_NAME, cmd->cmdidx, kwsd_read(SDIO_HW_STATE)); ++#endif ++ ++ /* Checking if card is busy */ ++ while ((kwsd_read(SDIO_HW_STATE) & CARD_BUSY)) { ++ if (timeout == 0) { ++ printf("%s: card busy!\n", DRIVER_NAME); ++ return -1; ++ } ++ timeout--; ++ udelay(1000); ++ } ++ ++ /* Set up for a data transfer if we have one */ ++ if (data) { ++ if ((err = kw_mmc_setup_data(data))) ++ return err; ++ } ++ ++ resptype = SDIO_CMD_INDEX(cmd->cmdidx); ++ ++ /* Analyzing resptype/xfertype/waittype for the command */ ++ if (cmd->resp_type & MMC_RSP_BUSY) ++ resptype |= SDIO_CMD_RSP_48BUSY; ++ else if (cmd->resp_type & MMC_RSP_136) ++ resptype |= SDIO_CMD_RSP_136; ++ else if (cmd->resp_type & MMC_RSP_PRESENT) ++ resptype |= SDIO_CMD_RSP_48; ++ else ++ resptype |= SDIO_CMD_RSP_NONE; ++ ++ if (cmd->resp_type & MMC_RSP_CRC) ++ resptype |= SDIO_CMD_CHECK_CMDCRC; ++ ++ if (cmd->resp_type & MMC_RSP_OPCODE) ++ resptype |= SDIO_CMD_INDX_CHECK; ++ ++ if (cmd->resp_type & MMC_RSP_PRESENT) { ++ resptype |= SDIO_UNEXPECTED_RESP; ++ waittype |= SDIO_NOR_UNEXP_RSP; ++ } ++ ++ if (data) { ++ resptype |= SDIO_CMD_DATA_PRESENT | SDIO_CMD_CHECK_DATACRC16; ++ xfertype |= SDIO_XFER_MODE_HW_WR_DATA_EN; ++ if (data->flags & MMC_DATA_READ) { ++ xfertype |= SDIO_XFER_MODE_TO_HOST; ++ waittype = SDIO_NOR_DMA_INI; ++ } else ++ waittype |= SDIO_NOR_XFER_DONE; ++ } else ++ waittype |= SDIO_NOR_CMD_DONE; ++ ++ /* Setting cmd arguments */ ++ kwsd_write(SDIO_ARG_LOW, cmd->cmdarg & 0xffff); ++ kwsd_write(SDIO_ARG_HI, cmd->cmdarg >> 16); ++ ++ /* Setting Xfer mode */ ++ kwsd_write(SDIO_XFER_MODE, xfertype); ++ ++ kwsd_write(SDIO_NOR_INTR_STATUS, ~SDIO_NOR_CARD_INT); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++ ++ /* Sending command */ ++ kwsd_write(SDIO_CMD, resptype); ++/* ++ kwsd_write(SDIO_CMD, KW_MMC_MAKE_CMD(cmd->cmdidx, resptype)); ++*/ ++ ++ kwsd_write(SDIO_NOR_INTR_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_EN, SDIO_POLL_MASK); ++ ++ /* Waiting for completion */ ++ timeout = 1000000; ++ ++ while (!((kwsd_read(SDIO_NOR_INTR_STATUS)) & waittype)) { ++ if (kwsd_read(SDIO_NOR_INTR_STATUS) & SDIO_NOR_ERROR) { ++#ifdef DEBUG ++ printf("%s: kw_mmc_send_cmd: error! cmdidx : %d, err reg: %04x\n", DRIVER_NAME, cmd->cmdidx, ++wsd_read(SDIO_ERR_INTR_STATUS)); ++#endif ++ if (kwsd_read(SDIO_ERR_INTR_STATUS) & (SDIO_ERR_CMD_TIMEOUT | SDIO_ERR_DATA_TIMEOUT)) { ++ return -ETIMEDOUT; ++ } ++ return -ECOMM; ++ } ++ ++ timeout--; ++ udelay(1); ++ if (timeout <= 0) { ++ printf("%s: command timed out\n", DRIVER_NAME); ++ return -ETIMEDOUT; ++ } ++ } ++ ++ /* Handling response */ ++ if (cmd->resp_type & MMC_RSP_136) { ++ uint response[8]; ++ for (resp_indx = 0; resp_indx < 8; resp_indx++) ++ response[resp_indx] = kwsd_read(SDIO_RSP(resp_indx)); ++ ++ cmd->response[0] = ((response[0] & 0x03ff) << 22) | ++ ((response[1] & 0xffff) << 6) | ++ ((response[2] & 0xfc00) >> 10); ++ cmd->response[1] = ((response[2] & 0x03ff) << 22) | ++ ((response[3] & 0xffff) << 6) | ++ ((response[4] & 0xfc00) >> 10); ++ cmd->response[2] = ((response[4] & 0x03ff) << 22) | ++ ((response[5] & 0xffff) << 6) | ++ ((response[6] & 0xfc00) >> 10); ++ cmd->response[3] = ((response[6] & 0x03ff) << 22) | ++ ((response[7] & 0x3fff) << 8); ++ } else if (cmd->resp_type & MMC_RSP_PRESENT) { ++ uint response[3]; ++ for (resp_indx = 0; resp_indx < 3; resp_indx++) ++ response[resp_indx] = kwsd_read(SDIO_RSP(resp_indx)); ++ ++ cmd->response[0] = ((response[2] & 0x003f) << (8 - 8)) | ++ ((response[1] & 0xffff) << (14 - 8)) | ++ ((response[0] & 0x03ff) << (30 - 8)); ++ cmd->response[1] = ((response[0] & 0xfc00) >> 10); ++ cmd->response[2] = 0; ++ cmd->response[3] = 0; ++ } ++ ++#ifdef CONFIG_MMC_DEBUG ++ printf("%s: resp[0x%x] ", DRIVER_NAME, cmd->resp_type); ++ printf("[0x%x] ", cmd->response[0]); ++ printf("[0x%x] ", cmd->response[1]); ++ printf("[0x%x] ", cmd->response[2]); ++ printf("[0x%x] ", cmd->response[3]); ++ printf("\n"); ++#endif ++ ++ return 0; ++} ++ ++#if 0 ++/* Disable these three functions as they are not used anyway */ ++ ++static void kwsd_power_up(void) ++{ ++#ifdef DEBUG ++ printf("%s: power up\n", DRIVER_NAME); ++#endif ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ kwsd_write(SDIO_XFER_MODE, 0); ++ ++ /* enable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_STATUS_EN, SDIO_POLL_MASK); ++ ++ /* enable interrupts status */ ++ kwsd_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++} ++ ++static void kwsd_power_down(void) ++{ ++#ifdef DEBUG ++ printf("%s: power down\n", DRIVER_NAME); ++#endif ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ kwsd_write(SDIO_XFER_MODE, SDIO_XFER_MODE_STOP_CLK); ++ ++ /* disable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, 0); ++ kwsd_write(SDIO_ERR_STATUS_EN, 0); ++ ++ /* enable interrupts status */ ++ kwsd_write(SDIO_NOR_INTR_STATUS, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_INTR_STATUS, SDIO_POLL_MASK); ++} ++ ++static u32 kw_mmc_get_base_clock(void) ++{ ++ /* Original version did a check for board device id and revision id ++ * and assigned one of these clocks: ++ * KW_MMC_BASE_FAST_CLK_100 (revid == 0 && devid != MV88F6282_DEV_ID) ++ * KW_MMC_BASE_FAST_CLK_200 (revid != 0 || devid == MV88F6282_DEV_ID) ++ * However, this check was disabled and ++ * KW_MMC_BASE_FAST_CLOCK ++ * was returned in every case. ++ * Therefore, all of the dead logic was removed. */ ++ return KW_MMC_BASE_FAST_CLOCK; ++} ++#endif /* #if 0 */ ++ ++static inline u32 kw_mmc_get_base_clock(void) ++{ ++ /* get MMC base clock. If any logic other than just returning ++ * a fixed value is ever used, remove inline modifier. */ ++ ++ /* Possible values: ++ * - KW_MMC_BASE_FAST_CLOCK (166 MHz) ++ * - KW_MMC_BASE_FAST_CLK_100 (100 MHz) ++ * - KW_MMC_BASE_FAST_CLK_200 (200 MHz) ++ * ++ * Tests have shown that 200 MHz is more reliable than ++ * 166 MHz, so this value is used. */ ++ return KW_MMC_BASE_FAST_CLK_200; ++} ++ ++static void kw_mmc_set_clk(unsigned int clock) ++{ ++ unsigned int m; ++ ++ if (clock == 0) { ++#ifdef DEBUG ++ printf("%s: clock off\n", DRIVER_NAME); ++#endif ++ kwsd_write(SDIO_XFER_MODE, SDIO_XFER_MODE_STOP_CLK); ++ kwsd_write(SDIO_CLK_DIV, KW_MMC_BASE_DIV_MAX); ++ } else { ++ m = kw_mmc_get_base_clock() / (2 * clock) - 1; ++ if (m > KW_MMC_BASE_DIV_MAX) ++ m = KW_MMC_BASE_DIV_MAX; ++#ifdef DEBUG ++ printf("%s: kw_mmc_set_clk: base = %d dividor = 0x%x clock=%d\n", DRIVER_NAME, ++w_mmc_get_base_clock(), m, clock); ++#endif ++ kwsd_write(SDIO_CLK_DIV, m & KW_MMC_BASE_DIV_MAX); ++ } ++ udelay(10000); ++} ++ ++static void kw_mmc_set_bus(unsigned int bus) ++{ ++ u32 ctrl_reg = 0; ++ ++ ctrl_reg = kwsd_read(SDIO_HOST_CTRL); ++ ctrl_reg &= ~SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; ++ ++ switch (bus) { ++ case 4: ++ ctrl_reg |= SDIO_HOST_CTRL_DATA_WIDTH_4_BITS; ++ break; ++ case 1: ++ default: ++ ctrl_reg |= SDIO_HOST_CTRL_DATA_WIDTH_1_BIT; ++ } ++ /* default transfer mode */ ++ ctrl_reg |= SDIO_HOST_CTRL_BIG_ENDIAN; ++ ctrl_reg &= ~SDIO_HOST_CTRL_LSB_FIRST; ++ ++ /* default to maximum timeout */ ++ ctrl_reg |= SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX); ++ ++ ctrl_reg |= SDIO_HOST_CTRL_PUSH_PULL_EN; ++ ++ ctrl_reg |= SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY; ++ ++ /* ++ * The HI_SPEED_EN bit is causing trouble with many (but not all) ++ * high speed SD, SDHC and SDIO cards. Not enabling that bit ++ * makes all cards work. So let's just ignore that bit for now ++ * and revisit this issue if problems for not enabling this bit ++ * are ever reported. ++ */ ++#if 0 ++ if (ios->timing == MMC_TIMING_MMC_HS || ++ ios->timing == MMC_TIMING_SD_HS) ++ ctrl_reg |= SDIO_HOST_CTRL_HI_SPEED_EN; ++#endif ++ ++#ifdef DEBUG ++ printf("%s: ctrl 0x%04x: %s %s %s\n", DRIVER_NAME, ctrl_reg, ++ (ctrl_reg & SDIO_HOST_CTRL_PUSH_PULL_EN) ? ++ "push-pull" : "open-drain", ++ (ctrl_reg & SDIO_HOST_CTRL_DATA_WIDTH_4_BITS) ? ++ "4bit-width" : "1bit-width", ++ (ctrl_reg & SDIO_HOST_CTRL_HI_SPEED_EN) ? ++ "high-speed" : ""); ++#endif ++ ++ kwsd_write(SDIO_HOST_CTRL, ctrl_reg); ++ udelay(10000); ++} ++ ++static void kw_mmc_set_ios(struct mmc *mmc) ++{ ++#ifdef DEBUG ++ printf("%s: bus[%d] clock[%d]\n", DRIVER_NAME, mmc->bus_width, mmc->clock); ++#endif ++ kw_mmc_set_bus(mmc->bus_width); ++ kw_mmc_set_clk(mmc->clock); ++} ++ ++static int kw_mmc_init(struct mmc *mmc) ++{ ++#ifdef DEBUG ++ printf("%s: kw_mmc_init\n", DRIVER_NAME); ++#endif ++ ++ /* ++ * Setting host parameters ++ * Initial Host Ctrl : Timeout : max , Normal Speed mode, 4-bit data mode ++ * Big Endian, SD memory Card, Push_pull CMD Line ++ */ ++ kwsd_write(SDIO_HOST_CTRL, ++ SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX) | ++ SDIO_HOST_CTRL_DATA_WIDTH_4_BITS | ++ SDIO_HOST_CTRL_BIG_ENDIAN | ++ SDIO_HOST_CTRL_PUSH_PULL_EN | ++ SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY); ++ ++ kwsd_write(SDIO_CLK_CTRL, 0); ++ ++ /* enable status */ ++ kwsd_write(SDIO_NOR_STATUS_EN, SDIO_POLL_MASK); ++ kwsd_write(SDIO_ERR_STATUS_EN, SDIO_POLL_MASK); ++ ++ /* disable interrupts */ ++ kwsd_write(SDIO_NOR_INTR_EN, 0); ++ kwsd_write(SDIO_ERR_INTR_EN, 0); ++ ++ /* SW reset */ ++ kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW); ++ ++ udelay(10000); ++ return 0; ++} ++ ++int kw_mmc_initialize(bd_t *bis) ++{ ++ struct mmc *mmc = NULL; ++ struct mmc_config *cfg = NULL; ++ struct mmc_ops *ops = NULL; ++ char *name = NULL; ++ ++#ifdef DEBUG ++ printf("%s: %s base_clock = %d\n", DRIVER_NAME, kirkwood_id(), kw_mmc_get_base_clock()); ++#endif ++ mmc = malloc(sizeof(struct mmc)); ++ if (!mmc) ++ return -1; ++ memset(mmc, 0, sizeof(*mmc)); ++ ++ cfg = malloc(sizeof(*cfg)); ++ if (cfg == NULL) ++ return -1; ++ memset(cfg, 0, sizeof(*cfg)); ++ mmc->cfg = cfg; /* provided configuration */ ++ ++ ops = malloc(sizeof(*ops)); ++ if (ops == NULL) ++ return -1; ++ memset(ops, 0, sizeof(*ops)); ++ cfg->ops = ops; ++ ++ name = malloc(sizeof(DRIVER_NAME)+1); ++ if (name == NULL) ++ return -1; ++ cfg->name = name; ++ ++ sprintf(cfg->name, DRIVER_NAME); ++ ++ ops->send_cmd = kw_mmc_send_cmd; ++ ops->set_ios = kw_mmc_set_ios; ++ ops->init = kw_mmc_init; ++ ++ cfg->voltages = MMC_VDD_32_33 | MMC_VDD_33_34; ++ cfg->host_caps = MMC_MODE_4BIT | MMC_MODE_HS; ++ ++ cfg->f_min = kw_mmc_get_base_clock()/KW_MMC_BASE_DIV_MAX; ++ cfg->f_max = KW_MMC_CLOCKRATE_MAX; ++ cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT; ++ ++ mmc = mmc_create (cfg, NULL); ++ ++ if (mmc == NULL) { ++ free(name); ++ free(ops); ++ free(cfg); ++ printf("\nFailed to Initialize MMC\n"); ++ return -1; ++ } ++ ++ return 0; ++} +--- a/include/configs/mv-common.h ++++ b/include/configs/mv-common.h +@@ -130,4 +130,16 @@ + #define CONFIG_MTD_PARTITIONS + #endif + ++/* ++ * Kirkwood MMC ++ */ ++#if defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC) ++#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE ++#endif /* defined(CONFIG_KIRKWOOD) && defined(CONFIG_CMD_MMC) */ ++ ++/* ++ * GPIO command for all Kirkwood boxes ++ */ ++#define CONFIG_CMD_GPIO ++ + #endif /* _MV_COMMON_H */ +--- /dev/null ++++ b/include/configs/pogoplugv4.h +@@ -0,0 +1,132 @@ ++/* ++ * Copyright (C) 2014-2016 bodhi ++ * Based on ++ * ++ * Copyright (C) 2012 ++ * David Purdy ++ * ++ * Based on Kirkwood support: ++ * (C) Copyright 2009 ++ * Marvell Semiconductor ++ * Written-by: Prafulla Wadaskar ++ * ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; If not, see . ++ */ ++ ++#ifndef _CONFIG_POGOPLUGV4_H ++#define _CONFIG_POGOPLUGV4_H ++ ++/* ++ * Machine type definition and ID ++ */ ++#define MACH_TYPE_POGOPLUGV4 3960 ++#define CONFIG_MACH_TYPE MACH_TYPE_POGOPLUGV4 ++ ++/* ++ * High Level Configuration Options (easy to change) ++ */ ++#define CONFIG_FEROCEON_88FR131 /* #define CPU Core subversion */ ++#define CONFIG_KW88F6192 /* SOC Name */ ++#define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ ++ ++/* ++ * Commands configuration ++ */ ++ ++#define CONFIG_SYS_LONGHELP ++#define CONFIG_PREBOOT ++ ++/* ++ * mv-common.h should be defined after CMD configs since it used them ++ * to enable certain macros ++ */ ++#include "mv-common.h" ++ ++/* ++ * Environment variables configurations ++ */ ++#ifdef CONFIG_CMD_NAND ++ ++#define CONFIG_ENV_SECT_SIZE 0x20000 /* 128K */ ++ ++ ++#endif ++ ++#define CONFIG_ENV_SIZE 0x20000 /* 128k */ ++#define CONFIG_ENV_ADDR 0x1c0000 ++#define CONFIG_ENV_OFFSET 0x1c0000 /* env starts here */ ++ ++/* ++ * Default environment variables ++ */ ++#define CONFIG_BOOTCOMMAND \ ++ "usb reset ; " \ ++ "fatload usb 0:1 0x2000000 initramfs.bin ; "\ ++ "bootm 0x2000000 ; " \ ++ "ubi part ubi; " \ ++ "ubi read 0x800000 kernel; " \ ++ "bootm 0x800000" ++ ++#define CONFIG_MTDPARTS \ ++ "mtdparts=orion_nand:" \ ++ "0x1c0000(uboot)," \ ++ "0x40000(uboot_env)," \ ++ "0x7e00000(ubi)\0" ++ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "console=console=ttyS0,115200\0" \ ++ "mtdids=nand0=orion_nand\0" \ ++ "mtdparts="CONFIG_MTDPARTS \ ++ "bootargs_root=\0" ++ ++/* ++ * Ethernet Driver configuration ++ */ ++#ifdef CONFIG_CMD_NET ++#define CONFIG_NETCONSOLE ++#define CONFIG_MVGBE_PORTS {1, 0} /* enable port 0 only */ ++#define CONFIG_PHY_BASE_ADR 0 ++#endif /* CONFIG_CMD_NET */ ++ ++/* ++ * File system ++ */ ++#define CONFIG_JFFS2_NAND ++#define CONFIG_JFFS2_LZO ++#define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ ++#define CONFIG_MTD_PARTITIONS ++ ++/* ++ * SATA ++ */ ++#ifdef CONFIG_MVSATA_IDE ++#define CONFIG_SYS_ATA_IDE0_OFFSET MV_SATA_PORT0_OFFSET ++#endif ++ ++/* ++ * Date Time ++ */ ++#ifdef CONFIG_CMD_DATE ++#define CONFIG_RTC_MV ++#endif /* CONFIG_CMD_DATE */ ++ ++/* ++ * Kirkwood GPIO ++ */ ++#define CONFIG_KIRKWOOD_GPIO ++ ++#endif /* _CONFIG_POGOPLUGV4_H */ +--- /dev/null ++++ b/include/kirkwood_mmc.h +@@ -0,0 +1,268 @@ ++/* ++ * (C) Copyright 2014 ++ * ++ * Based on ++ * ++ * (C) Copyright 2012 ++ * Marvell Semiconductor ++ * Written-by: Gérald Kerma ++ * See file CREDITS for list of people who contributed to this ++ * project. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of ++ * the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, ++ * MA 02111-1307 USA ++ */ ++ ++#ifndef __KIRKWOOD_MMC_H__ ++#define __KIRKWOOD_MMC_H__ ++ ++/* ++ * Clock rates ++ */ ++ ++#define KW_MMC_CLOCKRATE_MAX 50000000 ++#define KW_MMC_BASE_DIV_MAX 0x7ff ++#define KW_MMC_BASE_FAST_CLOCK CONFIG_SYS_TCLK ++#define KW_MMC_BASE_FAST_CLK_100 100000000 ++#define KW_MMC_BASE_FAST_CLK_200 200000000 ++ ++/* ++ * Macros ++ */ ++#define kwsd_write(offs, val) writel(val, CONFIG_SYS_MMC_BASE + (offs)) ++#define kwsd_read(offs) readl(CONFIG_SYS_MMC_BASE + (offs)) ++ ++#define KW_MMC_MAKE_CMD(c, f) (((c & 0xff) << 8) | (f & 0xff)) ++ ++/* SDIO register */ ++#define SDIO_SYS_ADDR_LOW 0x000 ++#define SDIO_SYS_ADDR_HI 0x004 ++#define SDIO_BLK_SIZE 0x008 ++#define SDIO_BLK_COUNT 0x00c ++#define SDIO_ARG_LOW 0x010 ++#define SDIO_ARG_HI 0x014 ++#define SDIO_XFER_MODE 0x018 ++#define SDIO_CMD 0x01c ++#define SDIO_RSP(i) (0x020 + ((i)<<2)) ++#define SDIO_RSP0 0x020 ++#define SDIO_RSP1 0x024 ++#define SDIO_RSP2 0x028 ++#define SDIO_RSP3 0x02c ++#define SDIO_RSP4 0x030 ++#define SDIO_RSP5 0x034 ++#define SDIO_RSP6 0x038 ++#define SDIO_RSP7 0x03c ++#define SDIO_BUF_DATA_PORT 0x040 ++#define SDIO_RSVED 0x044 ++#define SDIO_HW_STATE 0x048 ++#define SDIO_PRESENT_STATE0 0x048 ++#define SDIO_PRESENT_STATE1 0x04c ++#define SDIO_HOST_CTRL 0x050 ++#define SDIO_BLK_GAP_CTRL 0x054 ++#define SDIO_CLK_CTRL 0x058 ++#define SDIO_SW_RESET 0x05c ++#define SDIO_NOR_INTR_STATUS 0x060 ++#define SDIO_ERR_INTR_STATUS 0x064 ++#define SDIO_NOR_STATUS_EN 0x068 ++#define SDIO_ERR_STATUS_EN 0x06c ++#define SDIO_NOR_INTR_EN 0x070 ++#define SDIO_ERR_INTR_EN 0x074 ++#define SDIO_AUTOCMD12_ERR_STATUS 0x078 ++#define SDIO_CURR_BYTE_LEFT 0x07c ++#define SDIO_CURR_BLK_LEFT 0x080 ++#define SDIO_AUTOCMD12_ARG_LOW 0x084 ++#define SDIO_AUTOCMD12_ARG_HI 0x088 ++#define SDIO_AUTOCMD12_INDEX 0x08c ++#define SDIO_AUTO_RSP(i) (0x090 + ((i)<<2)) ++#define SDIO_AUTO_RSP0 0x090 ++#define SDIO_AUTO_RSP1 0x094 ++#define SDIO_AUTO_RSP2 0x098 ++#define SDIO_CLK_DIV 0x128 ++ ++#define WINDOW_CTRL(i) (0x108 + ((i) << 3)) ++#define WINDOW_BASE(i) (0x10c + ((i) << 3)) ++ ++/* SDIO_PRESENT_STATE */ ++#define CARD_BUSY (1 << 1) ++#define CMD_INHIBIT (1 << 0) ++#define CMD_TXACTIVE (1 << 8) ++#define CMD_RXACTIVE (1 << 9) ++#define CMD_AUTOCMD12ACTIVE (1 << 14) ++#define CMD_BUS_BUSY (CMD_AUTOCMD12ACTIVE | \ ++ CMD_RXACTIVE | \ ++ CMD_TXACTIVE | \ ++ CMD_INHIBIT | \ ++ CARD_BUSY) ++ ++/* ++ * SDIO_CMD ++ */ ++ ++#define SDIO_CMD_RSP_NONE (0 << 0) ++#define SDIO_CMD_RSP_136 (1 << 0) ++#define SDIO_CMD_RSP_48 (2 << 0) ++#define SDIO_CMD_RSP_48BUSY (3 << 0) ++ ++#define SDIO_CMD_CHECK_DATACRC16 (1 << 2) ++#define SDIO_CMD_CHECK_CMDCRC (1 << 3) ++#define SDIO_CMD_INDX_CHECK (1 << 4) ++#define SDIO_CMD_DATA_PRESENT (1 << 5) ++#define SDIO_UNEXPECTED_RESP (1 << 7) ++ ++#define SDIO_CMD_INDEX(x) ((x) << 8) ++ ++/* ++ * SDIO_XFER_MODE ++ */ ++ ++#define SDIO_XFER_MODE_STOP_CLK (1 << 5) ++#define SDIO_XFER_MODE_HW_WR_DATA_EN (1 << 1) ++#define SDIO_XFER_MODE_AUTO_CMD12 (1 << 2) ++#define SDIO_XFER_MODE_INT_CHK_EN (1 << 3) ++#define SDIO_XFER_MODE_TO_HOST (1 << 4) ++#define SDIO_XFER_MODE_DMA (0 << 6) ++ ++/* ++ * SDIO_HOST_CTRL ++ */ ++ ++#define SDIO_HOST_CTRL_PUSH_PULL_EN (1 << 0) ++ ++#define SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY (0 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_ONLY (1 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MEM_COMBO (2 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MMC (3 << 1) ++#define SDIO_HOST_CTRL_CARD_TYPE_MASK (3 << 1) ++ ++#define SDIO_HOST_CTRL_BIG_ENDIAN (1 << 3) ++#define SDIO_HOST_CTRL_LSB_FIRST (1 << 4) ++#define SDIO_HOST_CTRL_DATA_WIDTH_1_BIT (0 << 9) ++#define SDIO_HOST_CTRL_DATA_WIDTH_4_BITS (1 << 9) ++#define SDIO_HOST_CTRL_HI_SPEED_EN (1 << 10) ++ ++#define SDIO_HOST_CTRL_TMOUT_MAX 0xf ++#define SDIO_HOST_CTRL_TMOUT_MASK (0xf << 11) ++#define SDIO_HOST_CTRL_TMOUT(x) ((x) << 11) ++#define SDIO_HOST_CTRL_TMOUT_EN (1 << 15) ++ ++/* ++ * SDIO_SW_RESET ++ */ ++ ++#define SDIO_SW_RESET_NOW (1 << 8) ++ ++/* ++ * Normal interrupt status bits ++ */ ++ ++#define SDIO_NOR_ERROR (1 << 15) ++#define SDIO_NOR_UNEXP_RSP (1 << 14) ++#define SDIO_NOR_AUTOCMD12_DONE (1 << 13) ++#define SDIO_NOR_SUSPEND_ON (1 << 12) ++#define SDIO_NOR_LMB_FF_8W_AVAIL (1 << 11) ++#define SDIO_NOR_LMB_FF_8W_FILLED (1 << 10) ++#define SDIO_NOR_READ_WAIT_ON (1 << 9) ++#define SDIO_NOR_CARD_INT (1 << 8) ++#define SDIO_NOR_READ_READY (1 << 5) ++#define SDIO_NOR_WRITE_READY (1 << 4) ++#define SDIO_NOR_DMA_INI (1 << 3) ++#define SDIO_NOR_BLK_GAP_EVT (1 << 2) ++#define SDIO_NOR_XFER_DONE (1 << 1) ++#define SDIO_NOR_CMD_DONE (1 << 0) ++ ++/* ++ * Error status bits ++ */ ++ ++#define SDIO_ERR_CRC_STATUS (1 << 14) ++#define SDIO_ERR_CRC_STARTBIT (1 << 13) ++#define SDIO_ERR_CRC_ENDBIT (1 << 12) ++#define SDIO_ERR_RESP_TBIT (1 << 11) ++#define SDIO_ERR_XFER_SIZE (1 << 10) ++#define SDIO_ERR_CMD_STARTBIT (1 << 9) ++#define SDIO_ERR_AUTOCMD12 (1 << 8) ++#define SDIO_ERR_DATA_ENDBIT (1 << 6) ++#define SDIO_ERR_DATA_CRC (1 << 5) ++#define SDIO_ERR_DATA_TIMEOUT (1 << 4) ++#define SDIO_ERR_CMD_INDEX (1 << 3) ++#define SDIO_ERR_CMD_ENDBIT (1 << 2) ++#define SDIO_ERR_CMD_CRC (1 << 1) ++#define SDIO_ERR_CMD_TIMEOUT (1 << 0) ++#define SDIO_POLL_MASK 0xffff /* enable all for polling */ ++ ++#define MMC_BLOCK_SIZE 512 ++ ++/* ++ * CMD12 error status bits ++ */ ++ ++#define SDIO_AUTOCMD12_ERR_NOTEXE (1 << 0) ++#define SDIO_AUTOCMD12_ERR_TIMEOUT (1 << 1) ++#define SDIO_AUTOCMD12_ERR_CRC (1 << 2) ++#define SDIO_AUTOCMD12_ERR_ENDBIT (1 << 3) ++#define SDIO_AUTOCMD12_ERR_INDEX (1 << 4) ++#define SDIO_AUTOCMD12_ERR_RESP_T_BIT (1 << 5) ++#define SDIO_AUTOCMD12_ERR_RESP_STARTBIT (1 << 6) ++ ++#define MMC_RSP_PRESENT (1 << 0) ++#define MMC_RSP_136 (1 << 1) /* 136 bit response */ ++#define MMC_RSP_CRC (1 << 2) /* expect valid crc */ ++#define MMC_RSP_BUSY (1 << 3) /* card may send busy */ ++#define MMC_RSP_OPCODE (1 << 4) /* response contains opcode */ ++ ++#define MMC_BUSMODE_OPENDRAIN 1 ++#define MMC_BUSMODE_PUSHPULL 2 ++ ++#define MMC_BUS_WIDTH_1 0 ++#define MMC_BUS_WIDTH_4 2 ++#define MMC_BUS_WIDTH_8 3 ++ ++#define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ ++#define MMC_CAP_MMC_HIGHSPEED (1 << 1) /* Can do MMC high-speed timing */ ++#define MMC_CAP_SD_HIGHSPEED (1 << 2) /* Can do SD high-speed timing */ ++#define MMC_CAP_SDIO_IRQ (1 << 3) /* Can signal pending SDIO IRQs */ ++#define MMC_CAP_SPI (1 << 4) /* Talks only SPI protocols */ ++#define MMC_CAP_NEEDS_POLL (1 << 5) /* Needs polling for card-detection */ ++#define MMC_CAP_8_BIT_DATA (1 << 6) /* Can the host do 8 bit transfers */ ++ ++#define MMC_CAP_NONREMOVABLE (1 << 8) /* Nonremovable e.g. eMMC */ ++#define MMC_CAP_WAIT_WHILE_BUSY (1 << 9) /* Waits while card is busy */ ++#define MMC_CAP_ERASE (1 << 10) /* Allow erase/trim commands */ ++#define MMC_CAP_1_8V_DDR (1 << 11) /* can support */ ++ /* DDR mode at 1.8V */ ++#define MMC_CAP_1_2V_DDR (1 << 12) /* can support */ ++ /* DDR mode at 1.2V */ ++#define MMC_CAP_POWER_OFF_CARD (1 << 13) /* Can power off after boot */ ++#define MMC_CAP_BUS_WIDTH_TEST (1 << 14) /* CMD14/CMD19 bus width ok */ ++#define MMC_CAP_UHS_SDR12 (1 << 15) /* Host supports UHS SDR12 mode */ ++#define MMC_CAP_UHS_SDR25 (1 << 16) /* Host supports UHS SDR25 mode */ ++#define MMC_CAP_UHS_SDR50 (1 << 17) /* Host supports UHS SDR50 mode */ ++#define MMC_CAP_UHS_SDR104 (1 << 18) /* Host supports UHS SDR104 mode */ ++#define MMC_CAP_UHS_DDR50 (1 << 19) /* Host supports UHS DDR50 mode */ ++#define MMC_CAP_DRIVER_TYPE_A (1 << 23) /* Host supports Driver Type A */ ++#define MMC_CAP_DRIVER_TYPE_C (1 << 24) /* Host supports Driver Type C */ ++#define MMC_CAP_DRIVER_TYPE_D (1 << 25) /* Host supports Driver Type D */ ++#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ ++#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */ ++ ++/* ++ * Functions prototypes ++ * ++ * Original patch had static function declarations in this header file. ++ * Those should rather not be declared in the header as they only cause compiler warnings. ++ */ ++int kw_mmc_initialize(bd_t *bis); ++ ++#endif /* __KIRKWOOD_MMC_H__ */ diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch index 07d65de17..94d62cee8 100644 --- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch +++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch @@ -1,14 +1,14 @@ --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -31,6 +31,7 @@ - * Commands configuration - */ - #define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */ +@@ -19,6 +19,7 @@ + #define CONFIG_KW88F6281 1 /* SOC Name */ + #define CONFIG_MACH_DOCKSTAR /* Machine type */ + #define CONFIG_SKIP_LOWLEVEL_INIT /* disable board lowlevel_init */ +#define CONFIG_SYS_MVFS - #define CONFIG_CMD_ENV - #define CONFIG_CMD_NAND + /* -@@ -53,29 +54,29 @@ + * mv-common.h should be defined after CMD configs since it used them +@@ -37,29 +38,29 @@ * it has to be rounded to sector size */ #define CONFIG_ENV_SIZE 0x20000 /* 128k */ @@ -26,11 +26,12 @@ - "ubifsload 0x800000 ${kernel}; " \ - "ubifsload 0x1100000 ${initrd}; " \ - "bootm 0x800000 0x1100000" +- +-#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ + "bootm 0x800000" - --#define CONFIG_MTDPARTS "mtdparts=orion_nand:1m(uboot),-(root)\0" ++ +#define CONFIG_MTDPARTS \ + "mtdparts=orion_nand:" \ + "0xe0000@0x0(uboot)," \ diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch index 102a147c2..bd1dab818 100644 --- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch +++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch @@ -1,7 +1,7 @@ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -59,30 +59,29 @@ - #define CONFIG_ENV_IS_NOWHERE +@@ -44,30 +44,29 @@ + #define CONFIG_ENV_SECT_SIZE 0x20000 #endif #define CONFIG_ENV_SIZE 0x20000 -#define CONFIG_ENV_OFFSET 0x80000 @@ -42,8 +42,8 @@ * Ethernet driver configuration --- a/configs/iconnect_defconfig +++ b/configs/iconnect_defconfig -@@ -7,6 +7,7 @@ CONFIG_SYS_PROMPT="iconnect => " - # CONFIG_CMD_FLASH is not set +@@ -10,6 +10,7 @@ CONFIG_SYS_PROMPT="iconnect => " + CONFIG_CMD_NAND=y CONFIG_CMD_USB=y # CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_DHCP=y diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch index f2ba8137a..58db8c8c8 100644 --- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch +++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch @@ -1,6 +1,6 @@ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -62,27 +62,22 @@ +@@ -49,27 +49,22 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch index f80346773..5c8ff35be 100644 --- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch +++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch @@ -1,6 +1,6 @@ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -54,23 +54,30 @@ +@@ -44,23 +44,30 @@ #endif #define CONFIG_ENV_SIZE 0x20000 /* 128k */ diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch index 46a6ab561..88b833072 100644 --- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch +++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch @@ -1,16 +1,15 @@ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -87,20 +87,18 @@ +@@ -70,20 +70,18 @@ */ #define CONFIG_BOOTCOMMAND \ "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; " \ - "ubi part root; " \ - "ubifsmount ubi:root; " \ - "ubifsload 0x800000 ${kernel}; " \ -- "bootm 0x800000" + "ubi part ubi; " \ + "ubi read 0x800000 kernel; " \ -+ "bootm 0x800000" + "bootm 0x800000" #define CONFIG_MTDPARTS \ - "mtdparts=orion_nand:1m(uboot),6M(uImage),-(root)\0" diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch index 37f30d0a5..04614f77c 100644 --- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch +++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch @@ -1,8 +1,8 @@ --- a/arch/arm/mach-kirkwood/Kconfig +++ b/arch/arm/mach-kirkwood/Kconfig -@@ -74,4 +74,7 @@ source "board/Seagate/goflexhome/Kconfig - source "board/Seagate/nas220/Kconfig" +@@ -90,4 +90,7 @@ source "board/zyxel/nsa310/Kconfig" source "board/zyxel/nsa310s/Kconfig" + source "board/zyxel/nsa325/Kconfig" +config SECOND_STAGE + bool "OpenWrt second stage hack" @@ -10,16 +10,16 @@ endif --- a/include/configs/dockstar.h +++ b/include/configs/dockstar.h -@@ -98,4 +98,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO +@@ -76,4 +76,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_DOCKSTAR_H */ --- a/include/configs/ib62x0.h +++ b/include/configs/ib62x0.h -@@ -108,4 +108,6 @@ +@@ -94,4 +94,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ @@ -28,16 +28,16 @@ #endif /* _CONFIG_IB62x0_H */ --- a/include/configs/iconnect.h +++ b/include/configs/iconnect.h -@@ -103,4 +103,6 @@ +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE #define CONFIG_MTD_PARTITIONS - #define CONFIG_CMD_MTDPARTS +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_ICONNECT_H */ --- /dev/null +++ b/include/configs/openwrt-kirkwood-common.h -@@ -0,0 +1,40 @@ +@@ -0,0 +1,31 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -47,9 +47,6 @@ +#ifndef __OPENWRT_KIRKWOOD_COMMON_H +#define __OPENWRT_KIRKWOOD_COMMON_H + -+/* Commands */ -+#define CONFIG_CMD_BOOTZ -+ +/* Ethernet */ +#if defined(CONFIG_CMD_NET) +#define CONFIG_SERVERIP 192.168.1.2 @@ -63,14 +60,8 @@ +#define CONFIG_ENV_IS_NOWHERE +#endif + -+/* Flattened uImage Tree */ -+#define CONFIG_FIT 1 -+#define CONFIG_FIT_VERBOSE 1 -+ +/* Various */ +#define CONFIG_BZIP2 -+#define CONFIG_LZMA -+#define CONFIG_LZO + +/* Unnecessary */ +#undef CONFIG_BOOTM_NETBSD @@ -80,28 +71,98 @@ +#endif /* __OPENWRT_KIRKWOOD_COMMON_H */ --- a/include/configs/pogo_e02.h +++ b/include/configs/pogo_e02.h -@@ -99,4 +99,6 @@ - #define CONFIG_CMD_MTDPARTS - #define CONFIG_LZO +@@ -83,4 +83,6 @@ + #define CONFIG_MTD_DEVICE /* needed for mtdparts commands */ + #define CONFIG_MTD_PARTITIONS +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_POGO_E02_H */ ---- a/include/configs/sheevaplug.h -+++ b/include/configs/sheevaplug.h -@@ -109,4 +109,6 @@ - #define CONFIG_SYS_ATA_IDE1_OFFSET MV_SATA_PORT1_OFFSET - #endif /* CONFIG_CMD_IDE */ - -+#include "openwrt-kirkwood-common.h" -+ - #endif /* _CONFIG_SHEEVAPLUG_H */ --- a/include/configs/goflexhome.h +++ b/include/configs/goflexhome.h -@@ -122,4 +122,6 @@ +@@ -105,4 +105,6 @@ #define CONFIG_RTC_MV #endif /* CONFIG_CMD_DATE */ +#include "openwrt-kirkwood-common.h" + #endif /* _CONFIG_GOFLEXHOME_H */ +--- a/include/configs/nsa310.h ++++ b/include/configs/nsa310.h +@@ -123,4 +123,6 @@ + #define CONFIG_RTC_MV + #endif /* CONFIG_CMD_DATE */ + ++#include "openwrt-kirkwood-common.h" ++ + #endif /* _CONFIG_NSA310_H */ +--- a/configs/dockstar_defconfig ++++ b/configs/dockstar_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/goflexhome_defconfig ++++ b/configs/goflexhome_defconfig +@@ -29,3 +29,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/ib62x0_defconfig ++++ b/configs/ib62x0_defconfig +@@ -27,5 +27,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/iconnect_defconfig ++++ b/configs/iconnect_defconfig +@@ -24,5 +24,9 @@ CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y +-CONFIG_LZMA=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y +--- a/configs/nsa310_defconfig ++++ b/configs/nsa310_defconfig +@@ -30,5 +30,8 @@ CONFIG_CMD_UBI=y + CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y + CONFIG_LZMA=y + CONFIG_LZO=y +--- a/configs/pogo_e02_defconfig ++++ b/configs/pogo_e02_defconfig +@@ -25,3 +25,8 @@ CONFIG_USB=y + CONFIG_USB_EHCI_HCD=y + CONFIG_USB_STORAGE=y + CONFIG_OF_LIBFDT=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_FIT=y ++CONFIG_FIT_VERBOSE=y ++CONFIG_LZMA=y ++CONFIG_LZO=y diff --git a/package/boot/uboot-lantiq/Makefile b/package/boot/uboot-lantiq/Makefile index cbebe91c2..5493737d3 100644 --- a/package/boot/uboot-lantiq/Makefile +++ b/package/boot/uboot-lantiq/Makefile @@ -11,336 +11,328 @@ PKG_NAME:=u-boot PKG_VERSION:=2013.10 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=0d71e62beb952b41ebafb20a7ee4df2f960db64c31b054721ceb79ff14014c55 -PKG_TARGETS:=bin - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 FIRMWARE_LANTIQ_SOURCE:=$(TOPDIR)/target/linux/lantiq/files/firmware/lantiq +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - SOC:= +define U-Boot/Default + BUILD_TARGET:=lantiq DDR_SETTINGS:= - IMAGE:= - DEPS:= endef -define uboot/arv4519pw_ram - TITLE:=U-Boot for Arcadyan arv4519pw (RAM) - SOC:=danube +define U-Boot/arv4519pw_ram + NAME:=Arcadyan arv4519pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw DDR_SETTINGS:=board/arcadyan/arv4519pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv4519pw_nor - TITLE:=U-Boot for Arcadyan arv4519pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv4519pw_nor + NAME:=Arcadyan arv4519pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw endef -define uboot/arv4519pw_brn - TITLE:=U-Boot for Arcadyan arv4519pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv4519pw_brn + NAME:=Arcadyan arv4519pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4519pw endef -define uboot/arv7506pw11_ram - TITLE:=U-Boot for Arcadyan ARV7506PW11 (RAM) - SOC:=danube +define U-Boot/arv7506pw11_ram + NAME:=Arcadyan ARV7506PW11 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 DDR_SETTINGS:=board/arcadyan/arv7506pw11/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7506pw11_nor - TITLE:=U-Boot for Arcadyan ARV7506PW11 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7506pw11_nor + NAME:=Arcadyan ARV7506PW11 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 endef -define uboot/arv7506pw11_brn - TITLE:=U-Boot for Arcadyan ARV7506PW11 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7506pw11_brn + NAME:=Arcadyan ARV7506PW11 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7506pw11 endef -define uboot/arv7510pw_ram - TITLE:=U-Boot for Arcadyan arv7510pw (RAM) - SOC:=danube +define U-Boot/arv7510pw_ram + NAME:=Arcadyan arv7510pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw DDR_SETTINGS:=board/arcadyan/arv7510pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7510pw_nor - TITLE:=U-Boot for Arcadyan arv7510pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw_nor + NAME:=Arcadyan arv7510pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw endef -define uboot/arv7510pw_brn - TITLE:=U-Boot for Arcadyan arv7510pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw_brn + NAME:=Arcadyan arv7510pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv4510pw endef -define uboot/arv7510pw22_ram - TITLE:=U-Boot for Arcadyan arv7510pw22 (RAM) - SOC:=danube +define U-Boot/arv7510pw22_ram + NAME:=Arcadyan arv7510pw22 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 DDR_SETTINGS:=board/arcadyan/arv7510pw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7510pw22_nor - TITLE:=U-Boot for Arcadyan arv7510pw22 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw22_nor + NAME:=Arcadyan arv7510pw22 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 endef -define uboot/arv7510pw22_brn - TITLE:=U-Boot for Arcadyan arv7510pw22 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7510pw22_brn + NAME:=Arcadyan arv7510pw22 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7510pw22 endef -define uboot/arv7518pw_ram - TITLE:=U-Boot for Arcadyan arv7518pw (RAM) - SOC:=danube +define U-Boot/arv7518pw_ram + NAME:=Arcadyan arv7518pw (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw DDR_SETTINGS:=board/arcadyan/arv7518pw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv7518pw_nor - TITLE:=U-Boot for Arcadyan arv7518pw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7518pw_nor + NAME:=Arcadyan arv7518pw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw endef -define uboot/arv7518pw_brn - TITLE:=U-Boot for Arcadyan arv7518pw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv7518pw_brn + NAME:=Arcadyan arv7518pw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv7518pw endef -define uboot/arv752dpw_ram - TITLE:=U-Boot for Arcadyan arv752dpw (RAM) - SOC:=danube +define U-Boot/arv752dpw_ram + NAME:=Arcadyan arv752dpw (RAM) + BUILD_SUBTARGET:=xway DDR_SETTINGS:=board/arcadyan/arv752dpw/ddr_settings.h - DEPS:=@TARGET_lantiq_xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw_nor - TITLE:=U-Boot for Arcadyan arv752dpw (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw_nor + NAME:=Arcadyan arv752dpw (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw_brn - TITLE:=U-Boot for Arcadyan arv752dpw (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw_brn + NAME:=Arcadyan arv752dpw (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw endef -define uboot/arv752dpw22_ram - TITLE:=U-Boot for Arcadyan arv752dpw22 (RAM) - SOC:=danube +define U-Boot/arv752dpw22_ram + NAME:=Arcadyan arv752dpw22 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 DDR_SETTINGS:=board/arcadyan/arv752dpw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv752dpw22_nor - TITLE:=U-Boot for Arcadyan arv752dpw22 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw22_nor + NAME:=Arcadyan arv752dpw22 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 endef -define uboot/arv752dpw22_brn - TITLE:=U-Boot for Arcadyan arv752dpw22 (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv752dpw22_brn + NAME:=Arcadyan arv752dpw22 (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv752dpw22 endef -define uboot/arv8539pw22_ram - TITLE:=U-Boot for Speedport W 504V Typ A (RAM) - SOC:=danube +define U-Boot/arv8539pw22_ram + NAME:=Speedport W 504V Typ A (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 DDR_SETTINGS:=board/arcadyan/arv8539pw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/arv8539pw22_nor - TITLE:=U-Boot for Speedport W 504V Typ A (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv8539pw22_nor + NAME:=Speedport W 504V Typ A (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 endef -define uboot/arv8539pw22_brn - TITLE:=U-Boot for Speedport W 504V Typ A (BRN) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/arv8539pw22_brn + NAME:=Speedport W 504V Typ A (BRN) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=arcadyan_arv8539pw22 endef -define uboot/gigasx76x_ram - TITLE:=U-Boot for Siemens Gigaset sx76x (RAM) - SOC:=danube +define U-Boot/gigasx76x_ram + NAME:=Siemens Gigaset sx76x (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=siemens_gigaset-sx76x DDR_SETTINGS:=board/gigaset/sx76x/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/gigasx76x_nor - TITLE:=U-Boot for Siemens Gigaset sx76x (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/gigasx76x_nor + NAME:=Siemens Gigaset sx76x (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=siemens_gigaset-sx76x endef -define uboot/acmp252_ram - TITLE:=U-Boot for AudioCodes MP-252 (RAM) - SOC:=danube +define U-Boot/acmp252_ram + NAME:=AudioCodes MP-252 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=audiocodes_mp-252 DDR_SETTINGS:=board/audiocodes/acmp252/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/acmp252_nor - TITLE:=U-Boot for AudioCodes MP-252 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/acmp252_nor + NAME:=AudioCodes MP-252 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=audiocodes_mp-252 endef -define uboot/bthomehubv5a_ram - TITLE:=U-Boot for BT Home Hub 5A (RAM) - SOC:=vr9 +define U-Boot/bthomehubv5a_ram + NAME:=BT Home Hub 5A (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=bt_homehub-v5a DDR_SETTINGS:=board/bt/bthomehubv5a/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/easy50712_ram - TITLE:=U-Boot for Lantiq EASY50712 (RAM) - SOC:=danube +define U-Boot/easy50712_ram + NAME:=Lantiq EASY50712 (RAM) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 DDR_SETTINGS:=board/lantiq/easy50712/ddr_settings.h - DEPS:=@TARGET_lantiq_xway endef -define uboot/easy50712_nor - TITLE:=U-Boot for Lantiq EASY50712 (NOR) - SOC:=danube - DEPS:=@TARGET_lantiq_xway +define U-Boot/easy50712_nor + NAME:=Lantiq EASY50712 (NOR) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 endef -define uboot/easy50712_norspl - TITLE:=U-Boot for Lantiq EASY50712 (NOR SPL) - SOC:=danube - IMAGE:=u-boot.ltq.lzo.norspl - DEPS:=@TARGET_lantiq_xway +define U-Boot/easy50712_norspl + NAME:=Lantiq EASY50712 (NOR SPL) + BUILD_SUBTARGET:=xway + BUILD_DEVICES:=lantiq_easy50712 + UBOOT_IMAGE:=u-boot.ltq.lzo.norspl + DEPENDS+=@BROKEN endef -define uboot/easy80920_ram - TITLE:=U-Boot for Lantiq EASY80920 (RAM) - SOC:=vr9 +define U-Boot/easy80920_ram + NAME:=Lantiq EASY80920 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand DDR_SETTINGS:=board/lantiq/easy80920/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/easy80920_nor - TITLE:=U-Boot for Lantiq EASY80920 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_nor + NAME:=Lantiq EASY80920 (NOR) + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + BUILD_SUBTARGET:=xrx200 endef -define uboot/easy80920_norspl - TITLE:=U-Boot for Lantiq EASY80920 (NOR SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.norspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_norspl + NAME:=Lantiq EASY80920 (NOR SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + UBOOT_IMAGE:=u-boot.ltq.lzo.norspl + DEPENDS+=@BROKEN endef -define uboot/easy80920_sfspl - TITLE:=U-Boot for Lantiq EASY80920 (SPI SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.sfspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/easy80920_sfspl + NAME:=Lantiq EASY80920 (SPI SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=lantiq_easy80920-nor lantiq_easy80920-nand + UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl + DEPENDS+=@BROKEN endef -define uboot/fb3370_eva - TITLE:=U-Boot for AVM FRITZ3370 (EVA) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/fb3370_eva + NAME:=AVM FRITZ3370 (EVA) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 endef -define uboot/fb3370_ram - TITLE:=U-Boot for AVM FRITZ3370 (RAM) - SOC:=vr9 +define U-Boot/fb3370_ram + NAME:=AVM FRITZ3370 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 DDR_SETTINGS:=board/avm/fb3370/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/fb3370_sfspl - TITLE:=U-Boot for AVM FRITZ3370 (SPI SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.sfspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/fb3370_sfspl + NAME:=AVM FRITZ3370 (SPI SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=avm_fritz3370 + UBOOT_IMAGE:=u-boot.ltq.lzo.sfspl + DEPENDS+=@BROKEN endef -define uboot/p2812hnufx_ram - TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (RAM) - SOC:=vr9 +define U-Boot/p2812hnufx_ram + NAME:=ZyXEL P-2812HNU-Fx (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 DDR_SETTINGS:=board/zyxel/p2812hnufx/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/p2812hnufx_nandspl - TITLE:=U-Boot for ZyXEL P-2812HNU-Fx (NAND SPL) - SOC:=vr9 - IMAGE:=u-boot.ltq.lzo.nandspl - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/p2812hnufx_nandspl + NAME:=ZyXEL P-2812HNU-Fx (NAND SPL) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=zyxel_p-2812hnu-f1 + UBOOT_IMAGE:=u-boot.ltq.lzo.nandspl + DEPENDS+=@BROKEN endef -define uboot/vgv7510kw22_brn - TITLE:=U-Boot for Arcadyan VGV7510KW22 (BRN) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7510kw22_brn + NAME:=Arcadyan VGV7510KW22 (BRN) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef -define uboot/vgv7510kw22_nor - TITLE:=U-Boot for Arcadyan VGV7510KW22 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7510kw22_nor + NAME:=Arcadyan VGV7510KW22 (NOR) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor endef -define uboot/vgv7510kw22_ram - TITLE:=U-Boot for Arcadyan VGV7510KW22 (RAM) - SOC:=vr9 +define U-Boot/vgv7510kw22_ram + NAME:=Arcadyan VGV7510KW22 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7510kw22-nor DDR_SETTINGS:=board/arcadyan/vgv7510kw22/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -define uboot/vgv7519_brn - TITLE:=U-Boot for Arcadyan VGV7519 (BRN) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7519_brn + NAME:=Arcadyan VGV7519 (BRN) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef -define uboot/vgv7519_nor - TITLE:=U-Boot for Arcadyan VGV7519 (NOR) - SOC:=vr9 - DEPS:=@TARGET_lantiq_xrx200 +define U-Boot/vgv7519_nor + NAME:=Arcadyan VGV7519 (NOR) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn endef -define uboot/vgv7519_ram - TITLE:=U-Boot for Arcadyan VGV7519 (RAM) - SOC:=vr9 +define U-Boot/vgv7519_ram + NAME:=Arcadyan VGV7519 (RAM) + BUILD_SUBTARGET:=xrx200 + BUILD_DEVICES:=arcadyan_vgv7519-nor arcadyan_vgv7519-brn DDR_SETTINGS:=board/arcadyan/vgv7519/ddr_settings.h - DEPS:=@TARGET_lantiq_xrx200 endef -UBOOTS:= \ +UBOOT_TARGETS:= \ arv4519pw_ram arv4519pw_nor arv4519pw_brn \ arv7506pw11_ram arv7506pw11_nor arv7506pw11_brn \ arv7510pw_ram arv7510pw_nor arv7510pw_brn \ @@ -359,25 +351,6 @@ UBOOTS:= \ vgv7510kw22_brn vgv7510kw22_nor vgv7510kw22_ram \ vgv7519_brn vgv7519_nor vgv7519_ram -define Package/uboot/template -define Package/uboot-lantiq-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=$(3) @!IN_SDK - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Luka Perkov -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - DEPS:=$(uboot/$(1)/DEPS) - $(call Package/uboot/template,$(1),$(TITLE),$(DEPS)) -endef - define CompressVR9Firmware $(STAGING_DIR_HOST)/bin/lzma e \ $(FIRMWARE_LANTIQ_SOURCE)/vr9_phy$(1)_a$(2)x.bin \ @@ -393,40 +366,25 @@ define Build/Prepare $(call CompressVR9Firmware,22f,2) endef -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) $(BUILD_VARIANT)_config -endef +UBOOT_MAKE_FLAGS := -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) CROSS_COMPILE=$(TARGET_CROSS) -endef +ifeq ($(SUBTARGET),xway) + SOC:=danube +else + SOC:=vr9 +endif -define Package/uboot/install/default - $(CP) \ - $(PKG_BUILD_DIR)/$(2) \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img -endef - -define Package/uboot/install/uart +define Package/u-boot/install/uart awk -f $(PKG_BUILD_DIR)/tools/lantiq_ram_init_uart.awk \ - -v soc=$(2) $(PKG_BUILD_DIR)/$(3) \ + -v soc=$(SOC) $(PKG_BUILD_DIR)/$(DDR_SETTINGS) \ > $(PKG_BUILD_DIR)/ddr_settings perl $(PKG_BUILD_DIR)/tools/gct.pl \ $(PKG_BUILD_DIR)/ddr_settings $(PKG_BUILD_DIR)/u-boot.srec \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.asc - endef - -define Package/uboot/install/template -define Package/uboot-lantiq-$(1)/install - $(call Package/uboot/install/default,$(1),$(if $(IMAGE),$(IMAGE),u-boot.bin)) - $(if $(DDR_SETTINGS), \ - $(call Package/uboot/install/uart,$(1),$(SOC),$(DDR_SETTINGS)) \ - ) -endef + $(1)/u-boot.asc endef -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call Package/uboot/install/template,$(u))) \ - $(eval $(call BuildPackage,uboot-lantiq-$(u))) \ -) +define Package/u-boot/install + $(Package/u-boot/install/$(if $(DDR_SETTINGS),uart,default)) +endef + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch index 08133bb08..cb695ffe3 100644 --- a/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch +++ b/package/boot/uboot-lantiq/patches/0014-MIPS-add-support-for-Lantiq-XWAY-SoCs.patch @@ -1419,7 +1419,7 @@ Signed-off-by: Daniel Schwierzeck + +static int spl_uncompress_lzo(struct spl_image *spl, unsigned long loadaddr) +{ -+ size_t len; ++ size_t len = CONFIG_SYS_LOAD_SIZE; + int ret; + + spl_puts("SPL: decompressing U-Boot with LZO\n"); @@ -3237,7 +3237,7 @@ Signed-off-by: Daniel Schwierzeck +} --- /dev/null +++ b/arch/mips/include/asm/arch-danube/config.h -@@ -0,0 +1,163 @@ +@@ -0,0 +1,164 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3296,6 +3296,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET 0x4000 + +/* SRAM */ @@ -3475,7 +3476,7 @@ Signed-off-by: Daniel Schwierzeck +#endif /* __DANUBE_SOC_H__ */ --- /dev/null +++ b/arch/mips/include/asm/arch-vrx200/config.h -@@ -0,0 +1,187 @@ +@@ -0,0 +1,188 @@ +/* + * Copyright (C) 2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -3546,6 +3547,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ @@ -7257,7 +7259,7 @@ Signed-off-by: Daniel Schwierzeck +static struct phy_driver pef7071_driver = { + .name = "Lantiq XWAY PEF7071", + .uid = 0xd565a400, -+ .mask = 0xFFFFFFFF, ++ .mask = 0xFFFFFFF8, + .features = PHY_GBIT_FEATURES, + .config = ltq_phy_config, + .startup = ltq_phy_startup, diff --git a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch index acda83c27..a12d2ebff 100644 --- a/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch +++ b/package/boot/uboot-lantiq/patches/0015-MIPS-lantiq-add-support-for-Lantiq-XWAY-ARX100-SoC-f.patch @@ -903,7 +903,7 @@ Signed-off-by: Daniel Schwierzeck #define STATUS_LANTIQ (STATUS_MIPS34K | STATUS_MIPS32_64) --- /dev/null +++ b/arch/mips/include/asm/arch-arx100/config.h -@@ -0,0 +1,175 @@ +@@ -0,0 +1,176 @@ +/* + * Copyright (C) 2007-2010 Lantiq Deutschland GmbH + * Copyright (C) 2011-2013 Daniel Schwierzeck, daniel.schwierzeck@gmail.com @@ -967,6 +967,7 @@ Signed-off-by: Daniel Schwierzeck +#define CONFIG_SYS_MEMTEST_START 0x81000000 +#define CONFIG_SYS_MEMTEST_END 0x82000000 +#define CONFIG_SYS_LOAD_ADDR 0x81000000 ++#define CONFIG_SYS_LOAD_SIZE (2 * 1024 * 1024) +#define CONFIG_SYS_INIT_SP_OFFSET (32 * 1024) + +/* SRAM */ diff --git a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch index 471c902aa..6d1b8dc69 100644 --- a/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch +++ b/package/boot/uboot-lantiq/patches/0018-tools-lantiq-add-NAND-SPL-support.patch @@ -21,7 +21,7 @@ Signed-off-by: Daniel Schwierzeck struct args { enum image_types type; __u32 entry_addr; -+ loff_t uboot_offset; ++ off_t uboot_offset; + unsigned int page_size; const char *uboot_bin; const char *spl_bin; @@ -121,10 +121,10 @@ Signed-off-by: Daniel Schwierzeck } -static int create_sfspl(const struct args *arg) -+static int pad_to_offset(int fd, loff_t offset) ++static int pad_to_offset(int fd, off_t offset) { - int out_fd, uboot_fd, spl_fd, ret; -+ loff_t pos; ++ off_t pos; + size_t size; + ssize_t n; + __u8 *buf; diff --git a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch index 3b50c981c..20bff445d 100644 --- a/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch +++ b/package/boot/uboot-lantiq/patches/0022-MIPS-lantiq-add-default-openwrt-config.patch @@ -8,7 +8,7 @@ Signed-off-by: Daniel Schwierzeck --- /dev/null +++ b/include/configs/openwrt-lantiq-common.h -@@ -0,0 +1,39 @@ +@@ -0,0 +1,40 @@ +/* + * Copyright (C) 2013 Luka Perkov + * @@ -21,6 +21,7 @@ Signed-off-by: Daniel Schwierzeck +/* Commands */ +#if defined(CONFIG_LTQ_SUPPORT_ETHERNET) +#define CONFIG_CMD_PING ++#define CONFIG_CMD_TFTPPUT +#endif + +/* Compression */ diff --git a/package/boot/uboot-lantiq/patches/100-portability.patch b/package/boot/uboot-lantiq/patches/100-portability.patch new file mode 100644 index 000000000..4539e3e88 --- /dev/null +++ b/package/boot/uboot-lantiq/patches/100-portability.patch @@ -0,0 +1,18 @@ +--- a/include/image.h ++++ b/include/image.h +@@ -17,7 +17,6 @@ + #define __IMAGE_H__ + + #include "compiler.h" +-#include + + /* Define this to avoid #ifdefs later on */ + struct lmb; +@@ -36,6 +35,7 @@ struct lmb; + + #include + #include ++#include + #include + + /* Take notice of the 'ignore' property for hashes */ diff --git a/package/boot/uboot-layerscape-32b/Makefile b/package/boot/uboot-layerscape-32b/Makefile deleted file mode 100644 index 8a338cdce..000000000 --- a/package/boot/uboot-layerscape-32b/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# -# Copyright (C) 2016 Jiang Yutang -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk - -PKG_NAME:=uboot-layerscape-32bit -PKG_VERSION:=v1.0 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=b62f4a55882ffb6b57da24ad9eaa98237141941d273e06a2244220a3e6b82ce7 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/uboot-ls-32b.git -PKG_SOURCE_VERSION:=763de09cc7265e3147e2df2e15f91c73231907f4 - -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -include $(INCLUDE_DIR)/package.mk - -define uboot/Default - TITLE:= - CONFIG:= -endef - -define uboot/ls1043ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 32b Dev Board - CONFIG=ls1043ardb-uboot.bin -endef - -define uboot/ls1046ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 32b Dev Board - CONFIG=ls1046ardb-uboot.bin -endef - -define uboot/ls1012ardb - TITLE:=U-Boot binary $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 32b Dev Board - CONFIG=ls1012ardb-uboot.bin.swap -endef - -UBOOTS := \ - ls1043ardb \ - ls1046ardb \ - ls1012ardb - -define Package/uboot/template -define Package/uboot-layerscape-32b-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:= @TARGET_layerscape_32b - TITLE:=$(2) - URL:=https://github.com/fsl-jyt/uboot-ls-32b.git - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -endif - -define Build/Configure -endef - -define Build/Compile -endef - -define Package/uboot/install/default - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_CONFIG) $(KDIR)/$(1)-32b-uboot.bin -endef - -define Package/uboot/install/template -define Package/uboot-layerscape-32b-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-layerscape-32b-$(u))) \ -) diff --git a/package/boot/uboot-layerscape-armv8_32b/Makefile b/package/boot/uboot-layerscape-armv8_32b/Makefile new file mode 100644 index 000000000..d1ca82917 --- /dev/null +++ b/package/boot/uboot-layerscape-armv8_32b/Makefile @@ -0,0 +1,53 @@ +# +# Copyright (C) 2016 Jiang Yutang +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=uboot-layerscape-armv8_32b +PKG_SOURCE_DATE:=2017-10-24 +PKG_RELEASE:=1 + +# Layerscape ARMv8 platforms use 64-bit u-boot to support both 32-bit and 64-bit +# kernel/rootfs. Since OpenWrt could only provide 32-bit toolchain for 32-bit targets, +# 64-bit u-boot images git tree is provided here whose source code actually is +# uboot-layerscape's source code. +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/yangbolu1991/u-boot-lede.git +PKG_SOURCE_VERSION:=43cb4c0fcab237f8daa39c393cc1441b76b99fcf +PKG_MIRROR_HASH:=ff7d1fcb85dda2be6a9e3785821b5791c7189d2d412b160a9621bb2dcad24dea + +PKG_MAINTAINER:=Yangbo Lu + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/kernel.mk + +define Package/uboot-layerscape-armv8_32b + SECTION:=boot + CATEGORY:=Boot Loaders + DEPENDS:=@TARGET_layerscape_armv8_32b + TITLE:=U-Boot for ARMv8 32-bit based Layerscape boards + DEFAULT:=y + HIDDEN:=1 +endef + +define Build/Configure + +endef + +define Build/Compile + +endef + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/ls1043ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1043ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1046ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1046ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012ardb-uboot.bin $(STAGING_DIR_IMAGE)/ls1012ardb-armv8_32b-uboot.bin + $(CP) $(PKG_BUILD_DIR)/ls1012afrdm-uboot.bin $(STAGING_DIR_IMAGE)/ls1012afrdm-armv8_32b-uboot.bin +endef + +$(eval $(call BuildPackage,uboot-layerscape-armv8_32b)) diff --git a/package/boot/uboot-layerscape/Makefile b/package/boot/uboot-layerscape/Makefile index 6cd35b8e8..c37b335b4 100644 --- a/package/boot/uboot-layerscape/Makefile +++ b/package/boot/uboot-layerscape/Makefile @@ -6,100 +6,71 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk +include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=uboot-layerscape -PKG_VERSION:=v1.0 +PKG_SOURCE_DATE:=2017-08-24 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_MIRROR_HASH:=6aba7cb32d655dacb49bd188706bf1284159ae9b1fa69056df634b90070c3768 -PKG_SOURCE_URL:=https://github.com/fsl-jyt/u-boot.git -PKG_SOURCE_VERSION:=aefcbf4c2bb36e1f0ead61181e5fe1119b5683ad - -PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/u-boot.git +PKG_SOURCE_VERSION:=fbedf04c1bad675eadbac86febdcf759441a02af +PKG_MIRROR_HASH:=29922f83ce3e8dde163eafcfd07f3595e2779b7a3e8eb43640f058f58248718d +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=layerscape + BUILD_SUBTARGET:=armv8_64b + BUILD_DEVICES:=$(1) + UBOOT_IMAGE:=u-boot-dtb.bin + HIDDEN:=y endef -define uboot/ls1043ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1043ardb 64b Dev Board - CONFIG=ls1043ardb +define U-Boot/ls1043ardb + NAME:=NXP ls1043ardb 64b Dev Board endef -define uboot/ls1046ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1046ardb 64b Dev Board - CONFIG=ls1046ardb_qspi +define U-Boot/ls1046ardb + NAME:=NXP ls1046ardb 64b Dev Board + UBOOT_CONFIG:=ls1046ardb_qspi endef -define uboot/ls1012ardb - TITLE:=U-Boot $(PKG_NAME)-$(PKG_VERSION) for NXP ls1012ardb 64b Dev Board - CONFIG=ls1012ardb_qspi - IMAGE=u-boot-swap.bin +define U-Boot/ls1012ardb + NAME:=NXP ls1012ardb 64b Dev Board + UBOOT_CONFIG:=ls1012ardb_qspi endef -UBOOTS := \ +define U-Boot/ls1088ardb + NAME:=NXP ls1088ardb 64b Dev Board + UBOOT_CONFIG:=ls1088ardb_qspi +endef + +define U-Boot/ls2088ardb + NAME:=NXP ls2088ardb 64b Dev Board + UBOOT_CONFIG:=ls2080ardb +endef + +define U-Boot/ls1012afrdm + NAME:=NXP ls1012afrdm 64b Dev Board + UBOOT_CONFIG:=ls1012afrdm_qspi +endef + +UBOOT_TARGETS := \ ls1043ardb \ ls1046ardb \ - ls1012ardb + ls1012ardb \ + ls1088ardb \ + ls2088ardb \ + ls1012afrdm -define Package/uboot/template -define Package/uboot-layerscape-64b-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:= @TARGET_layerscape_64b - TITLE:=$(2) - URL:=http://git.freescale.com/git/cgit.cgi/ppc/sdk/u-boot.git/snapshot - VARIANT:=$(1) - MAINTAINER:=Jiang Yutang -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(BUILD_SUBTARGET)-uboot.bin endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) +define Package/u-boot/install/default endef -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot-dtb.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc -endef - -define Package/uboot/install/default - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(KDIR)/$(1)-64b-uboot.bin -endef - -define Package/uboot/install/template -define Package/uboot-layerscape-64b-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-layerscape-64b-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch new file mode 100644 index 000000000..597383166 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0001-armv8-ls1043a-add-LEDE-boot-support-in-environment.patch @@ -0,0 +1,51 @@ +From 74be1b50f96b3ada0a4fc18f0283659739edbadf Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:00:12 +0800 +Subject: [PATCH 1/3] armv8: ls1043a: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1043a_common.h | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1043a_common.h b/include/configs/ls1043a_common.h +index 0b3fb4e..5c01111 100644 +--- a/include/configs/ls1043a_common.h ++++ b/include/configs/ls1043a_common.h +@@ -336,7 +336,19 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=60000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 60f00000 $fdtaddr 100000 && " \ ++ "cp.b 61000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #undef CONFIG_BOOTCOMMAND +@@ -351,6 +363,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0500 " \ + MTDPARTS_DEFAULT +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..418f6287f --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0002-armv8-ls1046ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,57 @@ +From dc0e8734ea1c679738377d13bdd9bf3fa644e6b3 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Fri, 22 Sep 2017 11:36:43 +0800 +Subject: [PATCH 2/3] armv8: ls1046ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1046a_common.h | 15 ++++++++++++++- + include/configs/ls1046ardb.h | 6 ++++++ + 2 files changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1046a_common.h b/include/configs/ls1046a_common.h +index 4fc2f94..53bd41b 100644 +--- a/include/configs/ls1046a_common.h ++++ b/include/configs/ls1046a_common.h +@@ -276,7 +276,20 @@ + "sd_bootcmd=echo Trying load from SD ..;" \ + "mmcinfo; mmc read $load_addr " \ + "$kernel_addr_sd $kernel_size_sd ;" \ +- " bootm $load_addr#$board\0" ++ " bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + + #define CONFIG_BOOTARGS "console=ttyS0,115200 root=/dev/ram0 " \ +diff --git a/include/configs/ls1046ardb.h b/include/configs/ls1046ardb.h +index f8c15a6..c3b50b1 100644 +--- a/include/configs/ls1046ardb.h ++++ b/include/configs/ls1046ardb.h +@@ -251,6 +251,12 @@ + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #define MTDPARTS_DEFAULT "mtdparts=1550000.quadspi:1m(rcw)," \ + "15m(u-boot),48m(kernel.itb);" \ + "7e800000.flash:16m(nand_uboot)," \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..e8bbe7faa --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0003-armv8-ls1012ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,51 @@ +From 8d6efca7eb2de012b98493206c87f31ee9b9e967 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Thu, 28 Sep 2017 11:25:58 +0800 +Subject: [PATCH 3/3] armv8: ls1012ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012ardb.h | 21 ++++++++++++++++++++- + 1 file changed, 20 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h +index 5fe3218..242cdf0 100644 +--- a/include/configs/ls1012ardb.h ++++ b/include/configs/ls1012ardb.h +@@ -127,13 +127,32 @@ + "$kernel_addr $kernel_size; env exists secureboot " \ + "&& sf read $kernelheader_addr_r $kernelheader_addr " \ + "$kernelheader_size && esbc_validate ${kernelheader_addr_r}; " \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd; run qspi_bootcmd; " \ + "env exists secureboot && esbc_halt;" + #endif ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + + #include + +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..eaf0da283 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0004-armv8-ls1088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,58 @@ +From 479bf0c0bec2e99442214facf0f414c2c737ac7b Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 11:57:36 +0800 +Subject: [PATCH] armv8: ls1088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1088ardb.h | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls1088ardb.h b/include/configs/ls1088ardb.h +index 7bd152d..4cefa40 100644 +--- a/include/configs/ls1088ardb.h ++++ b/include/configs/ls1088ardb.h +@@ -404,7 +404,20 @@ + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$BOARD\0" ++ "bootm $load_addr#$BOARD\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock10 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=20c0000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) +@@ -429,6 +442,18 @@ + "run distro_bootcmd;run sd_bootcmd;" \ + "env exists secureboot && esbc_halt;" + #endif ++ ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "sf probe 0:0;sf read 0x80000000 0xA00000 0x300000;" \ ++ "sf read 0x80300000 0xE00000 0x100000;" \ ++ "fsl_mc start mc 0x80000000 0x80300000;" \ ++ "sf read 0x80400000 0xd00000 0x100000;" \ ++ "fsl_mc apply dpl 0x80400000;" \ ++ "run lede_boot;" ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* MAC/PHY configuration */ + #ifdef CONFIG_FSL_MC_ENET + #define CONFIG_PHYLIB_10G +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch new file mode 100644 index 000000000..6da256ab0 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0005-armv8-ls2088ardb-add-LEDE-boot-support-in-environmen.patch @@ -0,0 +1,54 @@ +From 20f270670d1d5e14f3fd128f359535300a955ac8 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Mon, 16 Oct 2017 12:37:05 +0800 +Subject: [PATCH] armv8: ls2088ardb: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls2080ardb.h | 23 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h +index 8a34990..8ae3944 100644 +--- a/include/configs/ls2080ardb.h ++++ b/include/configs/ls2080ardb.h +@@ -432,7 +432,19 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && mmc read $kernelheader_addr_r " \ + "$kernelhdr_addr_sd $kernelhdr_size_sd " \ + " && esbc_validate ${kernelheader_addr_r};" \ +- "bootm $load_addr#$board\0" ++ "bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock9 " \ ++ "rootfstype=squashfs,jffs2 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS1,115200 " \ ++ "mtdparts=580000000.nor:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "6M(reserved-1),3M(mc),1M(dpl),1M(dpc),1M(dtb)," \ ++ "16M(kernel),32M(rootfs),64M(otherbank)\0" \ ++ "lede_run=cp.b 580f00000 $fdtaddr 100000 && " \ ++ "cp.b 581000000 $loadaddr 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #ifdef CONFIG_QSPI_BOOT +@@ -463,6 +475,15 @@ unsigned long get_board_sys_clk(void); + "env exists secureboot && esbc_halt;" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND \ ++ "fsl_mc start mc 0x580a00000 0x580e00000;" \ ++ "fsl_mc apply dpl 0x580d00000;" \ ++ "run lede_boot;" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + #undef CONFIG_BOOTARGS + #define CONFIG_BOOTARGS "console=ttyS1,115200 root=/dev/ram0 " \ + "earlycon=uart8250,mmio,0x21c0600 " \ +-- +2.7.4 + diff --git a/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch new file mode 100644 index 000000000..45010a210 --- /dev/null +++ b/package/boot/uboot-layerscape/patches/0006-armv8-ls1012afrdm-add-LEDE-boot-support-in-environme.patch @@ -0,0 +1,49 @@ +From a5e454a3bb33a456655f08592606e4df34e40110 Mon Sep 17 00:00:00 2001 +From: Yangbo Lu +Date: Tue, 24 Oct 2017 17:48:08 +0800 +Subject: [PATCH] armv8: ls1012afrdm: add LEDE boot support in environment + +Signed-off-by: Yangbo Lu +--- + include/configs/ls1012afrdm.h | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h +index a3f8824d27..36dff19bdd 100644 +--- a/include/configs/ls1012afrdm.h ++++ b/include/configs/ls1012afrdm.h +@@ -73,12 +73,31 @@ + "qspi_bootcmd=echo Trying load from qspi..;" \ + "sf probe && sf read $load_addr " \ + "$kernel_addr $kernel_size && bootm $load_addr#$board\0" \ ++ "lede_setenv=setenv loadaddr 82000000 && " \ ++ "setenv fdtaddr 8f000000 && " \ ++ "setenv bootargs root=/dev/mtdblock8 " \ ++ "rootfstype=ext4 noinitrd " \ ++ "earlycon=uart8250,mmio,0x21c0500 console=ttyS0,115200 " \ ++ "mtdparts=1550000.quadspi:1M(rcw),2M(u-boot),1M(u-boot-env)," \ ++ "5M(reserved-1),256k(fman),5888k(reserved-2),1M(dtb)," \ ++ "16M(kernel),30M(ext4rfs),2M(user)\0" \ ++ "lede_run=pfe stop && sf probe 0:0 && " \ ++ "sf read $fdtaddr f00000 100000 && " \ ++ "sf read $loadaddr 1000000 1000000 && " \ ++ "bootm $loadaddr - $fdtaddr\0" \ ++ "lede_boot=run lede_setenv;run lede_run\0" + + #undef CONFIG_BOOTCOMMAND + #if defined(CONFIG_QSPI_BOOT) || defined(CONFIG_SD_BOOT_QSPI) + #define CONFIG_BOOTCOMMAND "run distro_bootcmd;run qspi_bootcmd" + #endif + ++#undef CONFIG_BOOTCOMMAND ++#define CONFIG_BOOTCOMMAND "run lede_boot" ++ ++#undef CONFIG_BOOTDELAY ++#define CONFIG_BOOTDELAY 3 ++ + /* + * USB + */ +-- +2.14.1 + diff --git a/package/boot/uboot-mvebu/Makefile b/package/boot/uboot-mvebu/Makefile index 024230946..b29039cd8 100644 --- a/package/boot/uboot-mvebu/Makefile +++ b/package/boot/uboot-mvebu/Makefile @@ -8,90 +8,33 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.03 +PKG_VERSION:=2017.03 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=\ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 +PKG_HASH:=f54baf3f9325bf444c7905f3a5b6f83680edb1e6e1a4d5f8a5ad80abe885113f +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= +UBOOT_MAKE_FLAGS:= + +define U-Boot/Default + BUILD_TARGET:=mvebu + HIDDEN:=1 endef -define uboot/clearfog - TITLE:=U-Boot for SolidRun ClearFog A1 - DEVICE:=armada-388-clearfog +define U-Boot/clearfog + NAME:=SolidRun ClearFog A1 + BUILD_DEVICES:=armada-388-clearfog-base armada-388-clearfog-pro + UBOOT_IMAGE:=u-boot-spl.kwb endef -UBOOTS:= \ +UBOOT_TARGETS:= \ clearfog -define Package/uboot/template -define Package/uboot-mvebu-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@(TARGET_DEVICE_mvebu_DEVICE_$(3)||TARGET_mvebu_DEVICE_$(3)||TARGET_mvebu_Default) - DEFAULT:=m - HIDDEN:=1 - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Felix Fietkau -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-u-boot-spl.kwb endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE),$(DEVICE)) -endef - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(BUILD_VARIANT)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - DTC_DIR=$(LINUX_DIR)/scripts/dtc/ -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb - $(INSTALL_DIR) $(KERNEL_BUILD_DIR)/ - $(CP) $(PKG_BUILD_DIR)/u-boot-spl.kwb \ - $(KERNEL_BUILD_DIR)/openwrt-$(BOARD)-$(1)-u-boot-spl.kwb - $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/ - $(CP) $(PKG_BUILD_DIR)/tools/kwboot \ - $(BIN_DIR)/u-boot-kwboot/ -endef - -define Package/uboot/install/template -define Package/uboot-mvebu-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-mvebu-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch b/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch new file mode 100644 index 000000000..c34616292 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0001-clearfog-generate-random-MAC-address.patch @@ -0,0 +1,28 @@ +From ee16ee20205ea374613c3ac7f50209451eb29068 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 23 Apr 2017 18:02:40 +0200 +Subject: [PATCH 1/4] clearfog: generate random MAC address + +The Clearfog does not come with predetermined MACs. +Falling back to random ones ensures ethernet can still operate anyway. + +Signed-off-by: Josua Mayer >josua.mayer97@gmail.com> +--- + configs/clearfog_defconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig +index 1264871e83..41e94e6daf 100644 +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -47,6 +47,7 @@ CONFIG_DEBUG_UART=y + CONFIG_DEBUG_UART_BASE=0xd0012000 + CONFIG_DEBUG_UART_CLOCK=250000000 + CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_NET_RANDOM_ETHADDR=y + CONFIG_SYS_NS16550=y + CONFIG_USB=y + CONFIG_DM_USB=y +-- +2.12.2 + diff --git a/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch b/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch similarity index 81% rename from package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch rename to package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch index 3c470409e..164c6f3f2 100644 --- a/package/boot/uboot-mvebu/patches/200-clearfog-reset-usom-onboard-1512-phy.patch +++ b/package/boot/uboot-mvebu/patches/0002-clearfog-reset-usom-onboard-1512-phy.patch @@ -1,7 +1,7 @@ -From 15d52c4067b8d8a1d7a002aec41c5e6c0a8678cd Mon Sep 17 00:00:00 2001 +From 98848106b9558244ae36a85229caabcdb57d0f7b Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Fri, 23 Sep 2016 13:58:14 +0200 -Subject: [PATCH] clearfog: reset usom onboard 1512 phy +Subject: [PATCH 2/4] clearfog: reset usom onboard 1512 phy Use GPIO19 which is wired to the uSOM phy reset signal in order to reset the uSOM's 88E81512 gigabit Ethernet phy. @@ -15,6 +15,8 @@ Signed-off-by: Jonas Gorski board/solidrun/clearfog/clearfog.c | 4 ++++ 1 file changed, 4 insertions(+) +diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c +index 2773f5957e..3a8257cac3 100644 --- a/board/solidrun/clearfog/clearfog.c +++ b/board/solidrun/clearfog/clearfog.c @@ -131,8 +131,12 @@ int board_init(void) @@ -30,3 +32,6 @@ Signed-off-by: Jonas Gorski mdelay(10); /* Init I2C IO expanders */ +-- +2.12.2 + diff --git a/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch b/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch new file mode 100644 index 000000000..97b2d1f25 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0003-clearfog-enable-distro-boot-code.patch @@ -0,0 +1,97 @@ +From 9653921eadd5d5268afbee6c928708158fc4e844 Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Tue, 22 Nov 2016 16:33:23 +0100 +Subject: [PATCH 3/4] clearfog: enable distro boot code + +load addresses start at 0x02000000, leaving enough space for fdt, +boot scripts and ramdisk at the end. +Only boot from mmc, the other options are not in working order. +Removed *_high variables in good faith. They can be re-added with sane +values when, and if required. + +Signed-off-by: Josua Mayer +--- + Kconfig | 1 + + include/configs/clearfog.h | 47 +++++++++++++++++++++++++++++++++++++++++----- + 2 files changed, 43 insertions(+), 5 deletions(-) + +diff --git a/Kconfig b/Kconfig +index 81b4226463..f7aec2255b 100644 +--- a/Kconfig ++++ b/Kconfig +@@ -59,6 +59,7 @@ config DISTRO_DEFAULTS + default y if ARCH_LS2080A + default y if ARCH_MESON + default y if ARCH_ROCKCHIP ++ default y if TARGET_CLEARFOG + default n + select CMD_BOOTZ if ARM && !ARM64 + select CMD_BOOTI if ARM64 +diff --git a/include/configs/clearfog.h b/include/configs/clearfog.h +index 0c51d2a288..890dd84b5d 100644 +--- a/include/configs/clearfog.h ++++ b/include/configs/clearfog.h +@@ -79,11 +79,6 @@ + + #define CONFIG_SYS_ALT_MEMTEST + +-/* Keep device tree and initrd in lower memory so the kernel can access them */ +-#define CONFIG_EXTRA_ENV_SETTINGS \ +- "fdt_high=0x10000000\0" \ +- "initrd_high=0x10000000\0" +- + /* SPL */ + /* + * Select the boot device here +@@ -128,6 +123,48 @@ + #endif + #endif + ++#ifndef CONFIG_SPL_BUILD ++/* ++ * Add standard bootenv from distro boot code: ++ * Keep device tree and initrd in lower memory so the kernel can access them ++ * Set default load addresses: ++ * - 63MiB space for kernel ++ * - 1MiB space for fdt ++ * - 1MiB space for extlinux file, or boot script ++ * - remainder for ramdisk ++ * Keep device tree and initrd in lower memory so the kernel can access them ++ * Set name of fdt file (default to Clearfog Pro) ++ * specify console device ++ */ ++#define CONFIG_EXTRA_ENV_SETTINGS \ ++ "kernel_addr_r=0x02000000\0" \ ++ "fdt_addr_r=0x05f00000\0" \ ++ "pxefile_addr_r=0x06000000\0" \ ++ "scriptaddr=0x06000000\0" \ ++ "ramdisk_addr_r=0x06100000\0" \ ++ "fdt_high=0x10000000\0" \ ++ "initrd_high=0x10000000\0" \ ++ "fdtfile=armada-388-clearfog-pro.dtb\0" \ ++ "console=ttyS0," __stringify(CONFIG_BAUDRATE) "\0" \ ++ BOOTENV ++ ++/* include distro boot code defaults */ ++#include ++ ++/* ++ * specify boot order ++ * sdcard or emmc -> usb -> network ++ */ ++#define BOOT_TARGET_DEVICES(func) \ ++ func(MMC, mmc, 0) \ ++ func(USB, usb, 0) \ ++ func(PXE, pxe, na) \ ++ func(DHCP, dhcp, na) ++ ++/* include the actual distro boot code */ ++#include ++#endif ++ + /* + * mv-common.h should be defined after CMD configs since it used them + * to enable certain macros +-- +2.12.2 + diff --git a/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch new file mode 100644 index 000000000..ca734660e --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0004-clearfog-enable-setexpr-command-by-default.patch @@ -0,0 +1,24 @@ +From 7b53a0f5ddf0b1201a09c368b06cd5750d5fbe3a Mon Sep 17 00:00:00 2001 +From: Josua Mayer +Date: Sun, 23 Apr 2017 17:45:11 +0200 +Subject: [PATCH 4/4] clearfog: enable setexpr command by default + +Turns out this command is pretty useful in advanced boot-scripts. +-> enable + +Signed-off-by: Josua Mayer +--- + configs/clearfog_defconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/configs/clearfog_defconfig ++++ b/configs/clearfog_defconfig +@@ -23,7 +23,7 @@ CONFIG_CMD_SF=y + CONFIG_CMD_SPI=y + CONFIG_CMD_I2C=y + CONFIG_CMD_USB=y +-# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_SETEXPR=y + CONFIG_CMD_TFTPPUT=y + CONFIG_CMD_DHCP=y + CONFIG_CMD_MII=y diff --git a/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch deleted file mode 100644 index 7e46084ad..000000000 --- a/package/boot/uboot-mvebu/patches/001-use-dtc-in-kernel.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump - AWK = awk - PERL = perl - PYTHON = python --DTC = dtc -+DTC = $(DTC_DIR)dtc - CHECK = sparse - - CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ diff --git a/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 000000000..fbbfe462b --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0011-rsa-Fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,153 @@ +From 59be82ef7e7ec4be6e1597d8aef65dd3d8c3a0d9 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:19 +0200 +Subject: [PATCH 1/2] rsa: Fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. +--- + lib/rsa/rsa-sign.c | 44 ++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 38 insertions(+), 6 deletions(-) + +--- a/lib/rsa/rsa-sign.c ++++ b/lib/rsa/rsa-sign.c +@@ -9,6 +9,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -20,6 +21,19 @@ + #define HAVE_ERR_REMOVE_THREAD_STATE + #endif + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++#endif ++ + static int rsa_err(const char *msg) + { + unsigned long sslErr = ERR_get_error(); +@@ -286,16 +300,22 @@ static int rsa_init(void) + { + int ret; + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ret = SSL_library_init(); ++#else ++ ret = OPENSSL_init_ssl(0, NULL); ++#endif + if (!ret) { + fprintf(stderr, "Failure to init SSL library\n"); + return -1; + } ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_load_error_strings(); + + OpenSSL_add_all_algorithms(); + OpenSSL_add_all_digests(); + OpenSSL_add_all_ciphers(); ++#endif + + return 0; + } +@@ -335,12 +355,15 @@ err_set_rsa: + err_engine_init: + ENGINE_free(e); + err_engine_by_id: ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + ENGINE_cleanup(); ++#endif + return ret; + } + + static void rsa_remove(void) + { ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + CRYPTO_cleanup_all_ex_data(); + ERR_free_strings(); + #ifdef HAVE_ERR_REMOVE_THREAD_STATE +@@ -349,6 +372,7 @@ static void rsa_remove(void) + ERR_remove_state(0); + #endif + EVP_cleanup(); ++#endif + } + + static void rsa_engine_remove(ENGINE *e) +@@ -409,7 +433,11 @@ static int rsa_sign_with_key(RSA *rsa, s + ret = rsa_err("Could not obtain signature"); + goto err_sign; + } +- EVP_MD_CTX_cleanup(context); ++ #if OPENSSL_VERSION_NUMBER < 0x10100000L ++ EVP_MD_CTX_cleanup(context); ++ #else ++ EVP_MD_CTX_reset(context); ++ #endif + EVP_MD_CTX_destroy(context); + EVP_PKEY_free(key); + +@@ -479,6 +507,7 @@ static int rsa_get_exponent(RSA *key, ui + { + int ret; + BIGNUM *bn_te; ++ const BIGNUM *key_e; + uint64_t te; + + ret = -EINVAL; +@@ -487,17 +516,18 @@ static int rsa_get_exponent(RSA *key, ui + if (!e) + goto cleanup; + +- if (BN_num_bits(key->e) > 64) ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ if (BN_num_bits(key_e) > 64) + goto cleanup; + +- *e = BN_get_word(key->e); ++ *e = BN_get_word(key_e); + +- if (BN_num_bits(key->e) < 33) { ++ if (BN_num_bits(key_e) < 33) { + ret = 0; + goto cleanup; + } + +- bn_te = BN_dup(key->e); ++ bn_te = BN_dup(key_e); + if (!bn_te) + goto cleanup; + +@@ -527,6 +557,7 @@ int rsa_get_params(RSA *key, uint64_t *e + { + BIGNUM *big1, *big2, *big32, *big2_32; + BIGNUM *n, *r, *r_squared, *tmp; ++ const BIGNUM *key_n; + BN_CTX *bn_ctx = BN_CTX_new(); + int ret = 0; + +@@ -548,7 +579,8 @@ int rsa_get_params(RSA *key, uint64_t *e + if (0 != rsa_get_exponent(key, exponent)) + ret = -1; + +- if (!BN_copy(n, key->n) || !BN_set_word(big1, 1L) || ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ if (!BN_copy(n, key_n) || !BN_set_word(big1, 1L) || + !BN_set_word(big2, 2L) || !BN_set_word(big32, 32L)) + ret = -1; + diff --git a/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch new file mode 100644 index 000000000..882969905 --- /dev/null +++ b/package/boot/uboot-mvebu/patches/0012-tools-kwbimage-fix-build-with-OpenSSL-1.1.x.patch @@ -0,0 +1,96 @@ +From 65030804dc57f3488e4ffe21e72fc65cd245cb98 Mon Sep 17 00:00:00 2001 +From: Jelle van der Waa +Date: Mon, 8 May 2017 21:31:20 +0200 +Subject: [PATCH 2/2] tools: kwbimage fix build with OpenSSL 1.1.x + +The rsa_st struct has been made opaque in 1.1.x, add forward compatible +code to access the n, e, d members of rsa_struct. + +EVP_MD_CTX_cleanup has been removed in 1.1.x and EVP_MD_CTX_reset should be +called to reinitialise an already created structure. + +Signed-off-by: Jelle van der Waa +--- + tools/kwbimage.c | 36 ++++++++++++++++++++++++++++++------ + 1 file changed, 30 insertions(+), 6 deletions(-) + +--- a/tools/kwbimage.c ++++ b/tools/kwbimage.c +@@ -18,10 +18,30 @@ + #include "kwbimage.h" + + #ifdef CONFIG_KWB_SECURE ++#include + #include + #include + #include + #include ++ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L ++static void RSA_get0_key(const RSA *r, ++ const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) ++{ ++ if (n != NULL) ++ *n = r->n; ++ if (e != NULL) ++ *e = r->e; ++ if (d != NULL) ++ *d = r->d; ++} ++ ++#else ++void EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx) ++{ ++ EVP_MD_CTX_reset(ctx); ++} ++#endif + #endif + + static struct image_cfg_element *image_cfg; +@@ -470,12 +490,16 @@ static int kwb_export_pubkey(RSA *key, s + char *keyname) + { + int size_exp, size_mod, size_seq; ++ const BIGNUM *key_e, *key_n; + uint8_t *cur; + char *errmsg = "Failed to encode %s\n"; + +- if (!key || !key->e || !key->n || !dst) { ++ RSA_get0_key(key, NULL, &key_e, NULL); ++ RSA_get0_key(key, &key_n, NULL, NULL); ++ ++ if (!key || !key_e || !key_n || !dst) { + fprintf(stderr, "export pk failed: (%p, %p, %p, %p)", +- key, key->e, key->n, dst); ++ key, key_e, key_n, dst); + fprintf(stderr, errmsg, keyname); + return -EINVAL; + } +@@ -490,8 +514,8 @@ static int kwb_export_pubkey(RSA *key, s + * do the encoding manually. + */ + +- size_exp = BN_num_bytes(key->e); +- size_mod = BN_num_bytes(key->n); ++ size_exp = BN_num_bytes(key_e); ++ size_mod = BN_num_bytes(key_n); + size_seq = 4 + size_mod + 4 + size_exp; + + if (size_mod > 256) { +@@ -520,14 +544,14 @@ static int kwb_export_pubkey(RSA *key, s + *cur++ = 0x82; + *cur++ = (size_mod >> 8) & 0xFF; + *cur++ = size_mod & 0xFF; +- BN_bn2bin(key->n, cur); ++ BN_bn2bin(key_n, cur); + cur += size_mod; + /* Exponent */ + *cur++ = 0x02; /* INTEGER */ + *cur++ = 0x82; + *cur++ = (size_exp >> 8) & 0xFF; + *cur++ = size_exp & 0xFF; +- BN_bn2bin(key->e, cur); ++ BN_bn2bin(key_e, cur); + + if (hashf) { + struct hash_v1 pk_hash; diff --git a/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch b/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch deleted file mode 100644 index 2dd9f2828..000000000 --- a/package/boot/uboot-mvebu/patches/002-enable_random_mac_addr.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -14,6 +14,7 @@ CONFIG_DEBUG_UART=y - CONFIG_DEBUG_UART_BASE=0xd0012000 - CONFIG_DEBUG_UART_CLOCK=250000000 - CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_NET_RANDOM_ETHADDR=y - CONFIG_SYS_NS16550=y - CONFIG_USB=y - CONFIG_DM_USB=y diff --git a/package/boot/uboot-mvebu/patches/003-boot_script.patch b/package/boot/uboot-mvebu/patches/003-boot_script.patch deleted file mode 100644 index 2e156b7c8..000000000 --- a/package/boot/uboot-mvebu/patches/003-boot_script.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/include/configs/clearfog.h -+++ b/include/configs/clearfog.h -@@ -107,7 +107,18 @@ - /* Keep device tree and initrd in lower memory so the kernel can access them */ - #define CONFIG_EXTRA_ENV_SETTINGS \ - "fdt_high=0x10000000\0" \ -- "initrd_high=0x10000000\0" -+ "initrd_high=0x10000000\0" \ -+ "script=boot.scr\0" \ -+ "loadaddr=0x01000000\0" \ -+ "mmcdev=0\0" \ -+ "mmcpart=1\0" \ -+ "loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \ -+ "bootscript=echo Running bootscript from mmc ...; source ${loadaddr}\0" -+ -+#define CONFIG_BOOTCOMMAND \ -+ "if run loadbootscript; then " \ -+ "run bootscript; " \ -+ "fi" - - /* SPL */ - /* ---- a/configs/clearfog_defconfig -+++ b/configs/clearfog_defconfig -@@ -3,6 +3,7 @@ CONFIG_ARCH_MVEBU=y - CONFIG_SYS_MALLOC_F_LEN=0x2000 - CONFIG_TARGET_CLEARFOG=y - CONFIG_DEFAULT_DEVICE_TREE="armada-388-clearfog" -+CONFIG_HUSH_PARSER=y - CONFIG_SPL=y - # CONFIG_CMD_IMLS is not set - # CONFIG_CMD_FLASH is not set diff --git a/package/boot/uboot-mxs/Makefile b/package/boot/uboot-mxs/Makefile index d00940c54..92cf9e6b2 100644 --- a/package/boot/uboot-mxs/Makefile +++ b/package/boot/uboot-mxs/Makefile @@ -6,91 +6,40 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.01 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e5792fba9399d9804aa2ef667f14ff771e2cdece72367d340250265bf095a5d5 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=mxs + UBOOT_IMAGE:=u-boot.sb + DEFAULT:=y + HIDDEN:=1 endef -define uboot/mx23_olinuxino - TITLE:=U-Boot 2016.01 for the Olinuxino i.MX233 +define U-Boot/mx23_olinuxino + NAME:=Olinuxino i.MX233 endef -define uboot/duckbill - TITLE:=U-Boot 2016.01 for the I2SE Duckbill +define U-Boot/duckbill + NAME:=I2SE Duckbill endef -UBOOTS := \ +UBOOT_TARGETS := \ mx23_olinuxino \ duckbill -define Package/uboot/template -define Package/uboot-mxs-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_mxs - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Zoltan HERPAI -endef +UBOOT_MAKE_FLAGS += $(UBOOT_IMAGE) + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),u-boot.sb) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) $(UBOOT_IMAGE) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(BIN_DIR)/uboot-$(BOARD)-$(1)/uboot-$(BOARD)-$(1).sb -endef - -define Package/uboot/install/template -define Package/uboot-mxs-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-mxs-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-omap/Makefile b/package/boot/uboot-omap/Makefile index 547c6534c..9084f3740 100644 --- a/package/boot/uboot-omap/Makefile +++ b/package/boot/uboot-omap/Makefile @@ -6,98 +6,52 @@ # include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2015.10 +PKG_VERSION:=2017.01 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=bdc68d5f9455ad933b059c735d983f2c8b6b552dafb062e5ff1444f623021955 - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README +PKG_HASH:=6c425175f93a4bcf2ec9faf5658ef279633dbd7856a293d95bd1ff516528ecf2 +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=omap + UBOOT_IMAGE:=u-boot.img MLO + UENV:=default endef -define uboot/omap4_panda - TITLE:=U-Boot for the Pandaboard +define U-Boot/omap4_panda + NAME:=Pandaboard + BUILD_DEVICES:=omap4-panda endef -define uboot/am335x_evm - TITLE:=U-Boot for the AM335x EVM +define U-Boot/am335x_boneblack + NAME:=TI AM335x BeagleBone Black + BUILD_DEVICES:=am335x-boneblack endef -define uboot/omap3_overo - TITLE:=U-Boot for the Gumstix Overo +define U-Boot/am335x_evm + NAME:=AM335x EVM + BUILD_DEVICES:=am335x-evm endef -define uboot/omap3_beagle - TITLE:=U-Boot for the BeagleBoard +define U-Boot/omap3_overo + NAME:=Gumstix Overo endef -UBOOTS:=omap4_panda am335x_evm omap3_overo omap3_beagle - -define Package/uboot/template -define Package/uboot-omap-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_omap - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - HIDDEN:=1 -endef +define U-Boot/omap3_beagle + NAME:=BeagleBoard + BUILD_DEVICES:=omap3-beagle endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) +UBOOT_TARGETS:=omap4_panda am335x_evm omap3_overo omap3_beagle am335x_boneblack + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES) + $(CP) $(patsubst %,$(PKG_BUILD_DIR)/%,$(UBOOT_IMAGE)) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/ + $(CP) ./files/uEnv-$(UENV).txt $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)/uEnv.txt endef -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.img) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - USE_PRIVATE_LIBGCC=yes $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - $(CP) $(PKG_BUILD_DIR)/u-boot.img $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.img - $(CP) $(PKG_BUILD_DIR)/MLO $(BIN_DIR)/uboot-$(BOARD)-$(1)/MLO -endef - -define Package/uboot/install/template -define Package/uboot-omap-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-omap-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-omap/files/uEnv-default.txt b/package/boot/uboot-omap/files/uEnv-default.txt new file mode 100644 index 000000000..3584e4379 --- /dev/null +++ b/package/boot/uboot-omap/files/uEnv-default.txt @@ -0,0 +1,8 @@ +bootpart=0:1 +bootdir=/ +bootfile=zImage +fdtdir=/dtbs +uenvcmd=run loadfdt; run loadimage; run uenvbootargs ; bootz ${loadaddr} - ${fdtaddr} +loadfdt=load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile} +devtype=mmc +uenvbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 diff --git a/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch b/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch deleted file mode 100644 index b8e65b500..000000000 --- a/package/boot/uboot-omap/patches/001-backport_upstream_image_c_fix_non_android_booting.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c139b5ff0999ec3d44a02ebdb623a92e5782e53e Mon Sep 17 00:00:00 2001 -From: Tom Rini -Date: Tue, 27 Oct 2015 19:04:40 -0400 -Subject: [PATCH] image.c: Fix non-Android booting with ramdisk and/or device - tree - -In 1fec3c5 I added a check that if we had an Android image we default to -trying the kernel address for a ramdisk. However when we don't have an -Android image buf is NULL and we oops here. Ensure that we have 'buf' -to check first. - -Reported-by: elipe Balbi -Signed-off-by: Tom Rini ---- - common/image.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/common/image.c b/common/image.c -index e607109..85c4f39 100644 ---- a/common/image.c -+++ b/common/image.c -@@ -913,7 +913,7 @@ int boot_get_ramdisk(int argc, char * const argv[], bootm_headers_t *images, - * Look for an Android boot image. - */ - buf = map_sysmem(images->os.start, 0); -- if (genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) -+ if (buf && genimg_get_format(buf) == IMAGE_FORMAT_ANDROID) - select = argv[0]; - #endif - --- -1.7.10.4 - diff --git a/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch b/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch deleted file mode 100644 index 7b7bfa8fb..000000000 --- a/package/boot/uboot-omap/patches/100-disable_thumb_unknown_errata.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/include/configs/ti_armv7_common.h -+++ b/include/configs/ti_armv7_common.h -@@ -233,8 +233,6 @@ - #define CONFIG_SPL_EXT_SUPPORT - #endif - --#define CONFIG_SYS_THUMB_BUILD -- - /* General parts of the framework, required. */ - #define CONFIG_SPL_I2C_SUPPORT - #define CONFIG_SPL_LIBCOMMON_SUPPORT diff --git a/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch new file mode 100644 index 000000000..8a3b024fe --- /dev/null +++ b/package/boot/uboot-omap/patches/101-disable-thumb-omap3.patch @@ -0,0 +1,14 @@ +Index: u-boot-2017.01/include/configs/ti_omap3_common.h +=================================================================== +--- u-boot-2017.01.orig/include/configs/ti_omap3_common.h ++++ u-boot-2017.01/include/configs/ti_omap3_common.h +@@ -80,4 +80,9 @@ + /* Now bring in the rest of the common code. */ + #include + ++/* beagleboard doesnt boot with thumb */ ++#ifdef CONFIG_SYS_THUMB_BUILD ++#undef CONFIG_SYS_THUMB_BUILD ++#endif ++ + #endif /* __CONFIG_TI_OMAP3_COMMON_H__ */ diff --git a/package/boot/uboot-omap/patches/101-disable_ext.patch b/package/boot/uboot-omap/patches/101-disable_ext.patch deleted file mode 100644 index 9e0e47caf..000000000 --- a/package/boot/uboot-omap/patches/101-disable_ext.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/configs/ti_armv7_common.h -+++ b/include/configs/ti_armv7_common.h -@@ -230,7 +230,6 @@ - #define CONFIG_SPL_LIBDISK_SUPPORT - #define CONFIG_SPL_MMC_SUPPORT - #define CONFIG_SPL_FAT_SUPPORT --#define CONFIG_SPL_EXT_SUPPORT - #endif - - /* General parts of the framework, required. */ diff --git a/package/boot/uboot-omap/patches/102-minify-spl.patch b/package/boot/uboot-omap/patches/102-minify-spl.patch new file mode 100644 index 000000000..66f6b6b59 --- /dev/null +++ b/package/boot/uboot-omap/patches/102-minify-spl.patch @@ -0,0 +1,44 @@ +Index: u-boot-2017.01/configs/omap3_beagle_defconfig +=================================================================== +--- u-boot-2017.01.orig/configs/omap3_beagle_defconfig ++++ u-boot-2017.01/configs/omap3_beagle_defconfig +@@ -7,7 +7,7 @@ CONFIG_SYS_CONSOLE_INFO_QUIET=y + CONFIG_VERSION_VARIABLE=y + CONFIG_SPL=y + CONFIG_SPL_MTD_SUPPORT=y +-CONFIG_SPL_OS_BOOT=y ++# CONFIG_SPL_EXT_SUPPORT is not set + # CONFIG_CMD_IMLS is not set + CONFIG_CMD_ASKENV=y + # CONFIG_CMD_FLASH is not set +Index: u-boot-2017.01/common/Makefile +=================================================================== +--- u-boot-2017.01.orig/common/Makefile ++++ u-boot-2017.01/common/Makefile +@@ -174,8 +174,11 @@ obj-$(CONFIG_CMDLINE) += cli_simple.o + obj-y += cli.o + obj-$(CONFIG_CMDLINE) += cli_readline.o + obj-$(CONFIG_CMD_DFU) += dfu.o ++ ++ifndef CONFIG_SPL_BUILD + obj-y += command.o + obj-y += s_record.o + obj-y += xyzModem.o ++endif + + CFLAGS_env_embedded.o := -Wa,--no-warn -DENV_CRC=$(shell tools/envcrc 2>/dev/null) +Index: u-boot-2017.01/cmd/Makefile +=================================================================== +--- u-boot-2017.01.orig/cmd/Makefile ++++ u-boot-2017.01/cmd/Makefile +@@ -161,7 +161,10 @@ endif # !CONFIG_SPL_BUILD + + obj-$(CONFIG_CMD_BLOB) += blob.o + ++ ++# ifndef CONFIG_SPL_BUILD + # core command + obj-y += nvedit.o ++# endif # !CONFIG_SPL_BUILD + + obj-$(CONFIG_ARCH_MVEBU) += mvebu/ diff --git a/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch new file mode 100644 index 000000000..89b02044d --- /dev/null +++ b/package/boot/uboot-omap/patches/103-disable-fat-write-spl.patch @@ -0,0 +1,27 @@ +Index: u-boot-2017.01/fs/fat/Makefile +=================================================================== +--- u-boot-2017.01.orig/fs/fat/Makefile ++++ u-boot-2017.01/fs/fat/Makefile +@@ -4,8 +4,8 @@ + # + + obj-$(CONFIG_FS_FAT) := fat.o +-obj-$(CONFIG_FAT_WRITE):= fat_write.o + + ifndef CONFIG_SPL_BUILD ++obj-$(CONFIG_FAT_WRITE):= fat_write.o + obj-$(CONFIG_FS_FAT) += file.o + endif +Index: u-boot-2017.01/fs/fat/fat.c +=================================================================== +--- u-boot-2017.01.orig/fs/fat/fat.c ++++ u-boot-2017.01/fs/fat/fat.c +@@ -163,7 +163,7 @@ static void get_name(dir_entry *dirent, + } + + static int flush_dirty_fat_buffer(fsdata *mydata); +-#if !defined(CONFIG_FAT_WRITE) ++#if !defined(CONFIG_FAT_WRITE) || defined(CONFIG_SPL_BUILD) + /* Stub for read only operation */ + int flush_dirty_fat_buffer(fsdata *mydata) + { diff --git a/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch new file mode 100644 index 000000000..ca928c996 --- /dev/null +++ b/package/boot/uboot-omap/patches/104-omap3-overo-enable-thumb.patch @@ -0,0 +1,18 @@ +Index: u-boot-2017.01/include/configs/omap3_overo.h +=================================================================== +--- u-boot-2017.01.orig/include/configs/omap3_overo.h ++++ u-boot-2017.01/include/configs/omap3_overo.h +@@ -11,6 +11,13 @@ + #define CONFIG_NAND + + #include ++ ++/* try to enable thumb - unknown if it's working ++ * but otherwise it's too big for spl */ ++#ifndef CONFIG_SYS_THUMB_BUILD ++#define CONFIG_SYS_THUMB_BUILD ++#endif ++ + /* + * We are only ever GP parts and will utilize all of the "downloaded image" + * area in SRAM which starts at 0x40200000 and ends at 0x4020FFFF (64KB). diff --git a/package/boot/uboot-oxnas/Makefile b/package/boot/uboot-oxnas/Makefile index d76af0ac1..daa266ea8 100644 --- a/package/boot/uboot-oxnas/Makefile +++ b/package/boot/uboot-oxnas/Makefile @@ -8,95 +8,29 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot PKG_VERSION:=2014.10 PKG_RELEASE:=1 -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot - PKG_HASH:=d3b132a7a9b3f3182b7aad71c2dfbd4fc15bea83e12c76134eb3ffefc07d1c71 -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=oxnas + BUILD_DEVICES:=Default + HIDDEN:=y endef -define uboot/ox820 - TITLE:=U-Boot for the Oxford/PLX NAS7820 +define U-Boot/ox820 + NAME:=Oxford/PLX NAS7820 endef -UBOOTS:=ox820 +UBOOT_TARGETS:=ox820 -define Package/uboot/template -define Package/uboot-oxnas-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_oxnas - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Daniel Golle -endef +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) + $(CP) $(PKG_BUILD_DIR)/u-boot.bin $(STAGING_DIR_IMAGE)/u-boot.bin endef -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Prepare - $(call Build/Prepare/Default) - $(CP) ./files/* $(PKG_BUILD_DIR) - find $(PKG_BUILD_DIR) -name .svn | $(XARGS) rm -rf -endef - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - u-boot.bin \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(KERNEL_BUILD_DIR)/u-boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-oxnas-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-oxnas-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/Makefile rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/Makefile diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/clock.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/clock.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/pinmux.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/pinmux.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/reset.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/reset.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c b/package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/cpu/arm1136/nas782x/timer.c rename to package/boot/uboot-oxnas/src/arch/arm/cpu/arm1136/nas782x/timer.c diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/clock.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/clock.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/cpu.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/cpu.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/hardware.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/hardware.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/pinmux.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/pinmux.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/spl.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/spl.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/sysctl.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/sysctl.h diff --git a/package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h b/package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h similarity index 100% rename from package/boot/uboot-oxnas/files/arch/arm/include/asm/arch-nas782x/timer.h rename to package/boot/uboot-oxnas/src/arch/arm/include/asm/arch-nas782x/timer.h diff --git a/package/boot/uboot-oxnas/files/board/ox820/Kconfig b/package/boot/uboot-oxnas/src/board/ox820/Kconfig similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/Kconfig rename to package/boot/uboot-oxnas/src/board/ox820/Kconfig diff --git a/package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS b/package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/MAINTAINERS rename to package/boot/uboot-oxnas/src/board/ox820/MAINTAINERS diff --git a/package/boot/uboot-oxnas/files/board/ox820/Makefile b/package/boot/uboot-oxnas/src/board/ox820/Makefile similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/Makefile rename to package/boot/uboot-oxnas/src/board/ox820/Makefile diff --git a/package/boot/uboot-oxnas/files/board/ox820/ddr.c b/package/boot/uboot-oxnas/src/board/ox820/ddr.c similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ddr.c rename to package/boot/uboot-oxnas/src/board/ox820/ddr.c diff --git a/package/boot/uboot-oxnas/files/board/ox820/ddr.h b/package/boot/uboot-oxnas/src/board/ox820/ddr.h similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ddr.h rename to package/boot/uboot-oxnas/src/board/ox820/ddr.h diff --git a/package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S b/package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/lowlevel_init.S rename to package/boot/uboot-oxnas/src/board/ox820/lowlevel_init.S diff --git a/package/boot/uboot-oxnas/files/board/ox820/ox820.c b/package/boot/uboot-oxnas/src/board/ox820/ox820.c similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/ox820.c rename to package/boot/uboot-oxnas/src/board/ox820/ox820.c diff --git a/package/boot/uboot-oxnas/files/board/ox820/spl_start.S b/package/boot/uboot-oxnas/src/board/ox820/spl_start.S similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/spl_start.S rename to package/boot/uboot-oxnas/src/board/ox820/spl_start.S diff --git a/package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds b/package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds similarity index 100% rename from package/boot/uboot-oxnas/files/board/ox820/u-boot-spl.lds rename to package/boot/uboot-oxnas/src/board/ox820/u-boot-spl.lds diff --git a/package/boot/uboot-oxnas/files/common/env_ext4.c b/package/boot/uboot-oxnas/src/common/env_ext4.c similarity index 100% rename from package/boot/uboot-oxnas/files/common/env_ext4.c rename to package/boot/uboot-oxnas/src/common/env_ext4.c diff --git a/package/boot/uboot-oxnas/files/common/spl/spl_block.c b/package/boot/uboot-oxnas/src/common/spl/spl_block.c similarity index 100% rename from package/boot/uboot-oxnas/files/common/spl/spl_block.c rename to package/boot/uboot-oxnas/src/common/spl/spl_block.c diff --git a/package/boot/uboot-oxnas/files/configs/ox820_defconfig b/package/boot/uboot-oxnas/src/configs/ox820_defconfig similarity index 100% rename from package/boot/uboot-oxnas/files/configs/ox820_defconfig rename to package/boot/uboot-oxnas/src/configs/ox820_defconfig diff --git a/package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c b/package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c similarity index 100% rename from package/boot/uboot-oxnas/files/drivers/block/plxsata_ide.c rename to package/boot/uboot-oxnas/src/drivers/block/plxsata_ide.c diff --git a/package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c b/package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c similarity index 100% rename from package/boot/uboot-oxnas/files/drivers/usb/host/ehci-oxnas.c rename to package/boot/uboot-oxnas/src/drivers/usb/host/ehci-oxnas.c diff --git a/package/boot/uboot-oxnas/files/include/configs/ox820.h b/package/boot/uboot-oxnas/src/include/configs/ox820.h similarity index 100% rename from package/boot/uboot-oxnas/files/include/configs/ox820.h rename to package/boot/uboot-oxnas/src/include/configs/ox820.h diff --git a/package/boot/uboot-oxnas/files/tools/mkox820crc.c b/package/boot/uboot-oxnas/src/tools/mkox820crc.c similarity index 100% rename from package/boot/uboot-oxnas/files/tools/mkox820crc.c rename to package/boot/uboot-oxnas/src/tools/mkox820crc.c diff --git a/package/boot/uboot-pxa/Makefile b/package/boot/uboot-pxa/Makefile deleted file mode 100644 index 9c12ad7ed..000000000 --- a/package/boot/uboot-pxa/Makefile +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright (C) 2012 OpenWrt.org -# -# This is free software, licensed under the GNU General Public License v2. -# See /LICENSE for more information. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=u-boot -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/ashcharles/verdex-uboot.git -PKG_SOURCE_DATE:=2011-08-25 -PKG_SOURCE_VERSION:=ca6bf3ef6ac5f5132a359b43dfa31e07076b74b7 -PKG_MIRROR_HASH:=7c92525b6c7bc0b6f065a9bfdf64d58a61583709cb44acb62a157ad3efc7c491 - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -include $(INCLUDE_DIR)/package.mk - -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= -endef - -define uboot/gumstix - TITLE:=U-Boot for the Gumstix Verdex -endef - -UBOOTS:=gumstix - -define Package/uboot/template -define Package/uboot-pxa-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_pxa - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Florian Fainelli -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - $(MAKE) -C $(PKG_BUILD_DIR) \ - $(UBOOT_CONFIG)_config -endef - -define Build/Compile - $(MAKE) -C $(PKG_BUILD_DIR) \ - u-boot.bin \ - CROSS_COMPILE=$(TARGET_CROSS) -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR) - $(CP) $(PKG_BUILD_DIR)/u-boot.bin \ - $(BIN_DIR)/openwrt-$(BOARD)-$(1)-u-boot.bin -endef - -define Package/uboot/install/template -define Package/uboot-pxa-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-pxa-$(u))) \ -) diff --git a/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch b/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch deleted file mode 100644 index cfef66b8f..000000000 --- a/package/boot/uboot-pxa/patches/001-squashfs_rootfstype_cmdline.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/configs/gumstix.h b/include/configs/gumstix.h -index 319da63..5483993 100644 ---- a/include/configs/gumstix.h -+++ b/include/configs/gumstix.h -@@ -136,7 +136,7 @@ - #define CONFIG_MISC_INIT_R /* misc_init_r function in gumstix sets board serial number */ - - #define CONFIG_BOOTFILE boot/uImage --#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard" -+#define CONFIG_BOOTARGS "console=ttyS0,115200n8 root=1f01 rootfstype=squashfs,jffs2 reboot=cold,hard" - #define CONFIG_BOOTCOMMAND "icache on; setenv stderr nulldev; setenv stdout nulldev; if pinit on && fatload ide 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on CF...; autoscr; else if mmcinit && fatload mmc 0 a2000000 gumstix-factory.script; then setenv stdout serial; setenv stderr serial; echo Found gumstix-factory.script on MMC...; autoscr; else setenv stdout serial; setenv stderr serial; katload 100000 && bootm; fi; fi" - #define CONFIG_BOOTDELAY 2 /* in seconds */ - #define CONFIG_EXTRA_ENV_SETTINGS "verify=no" diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index bc80dcfad..056300e18 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,90 +9,217 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_NAME:=u-boot -PKG_VERSION:=2016.03 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot -PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb +PKG_VERSION:=2017.07 + +PKG_HASH:=5374bfdc8acb9a38c025371b1ff20f45e7533668e84e685d0df5d9e7c0e4feff + PKG_MAINTAINER:=Zoltan HERPAI -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - -PKG_BUILD_PARALLEL:=1 - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define Package/uboot/template -define Package/uboot-sunxi-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_sunxi - TITLE:=U-Boot for $(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) +define U-Boot/Default + BUILD_TARGET:=sunxi + UBOOT_IMAGE:=u-boot-sunxi-with-spl.bin + UENV:=default + HIDDEN:=1 endef -define Package/uboot-sunxi-$(1)/install - $(CP) $(PKG_BUILD_DIR)/u-boot-sunxi-with-spl.bin \ - $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-u-boot-with-spl.bin - mkimage -C none -A arm -T script -d uEnv-$(if $(3),$(3),default).txt \ - $(KERNEL_BUILD_DIR)/uboot-$(BOARD)-$(1)-boot.scr +define U-Boot/A10-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa8 + NAME:=A10 OLinuXino LIME + BUILD_DEVICES:=sun4i-a10-olinuxino-lime endef -UBOOT_SUNXI_PACKAGES += uboot-sunxi-$(1) - +define U-Boot/A13-OLinuXino + BUILD_SUBTARGET:=cortexa8 + NAME:=A13 OlinuXino + BUILD_DEVICES:=sun5i-a13-olinuxino endef -$(eval $(call Package/uboot/template,A10-OLinuXino-Lime,the A10 OLinuXino LIME)) -$(eval $(call Package/uboot/template,A13-OLinuXino,the A13 OlinuXino)) -$(eval $(call Package/uboot/template,A20-OLinuXino-Lime,the A20 OLinuXino LIME)) -$(eval $(call Package/uboot/template,A20-OLinuXino_MICRO,A20 OLinuXino MICRO)) -$(eval $(call Package/uboot/template,Bananapi,Bananapi)) -$(eval $(call Package/uboot/template,Bananapro,Bananapro)) -$(eval $(call Package/uboot/template,Cubieboard,Cubieboard)) -$(eval $(call Package/uboot/template,Cubieboard2,Cubieboard2)) -$(eval $(call Package/uboot/template,Cubietruck,Cubietruck)) -$(eval $(call Package/uboot/template,Hummingbird_A31,the Hummingbird A31 board)) -$(eval $(call Package/uboot/template,Mele_M9,the Mele M9 (A31))) -$(eval $(call Package/uboot/template,OLIMEX_A13_SOM,the Olimex A13 SOM)) -$(eval $(call Package/uboot/template,Linksprite_pcDuino,Linksprite pcDuino)) -$(eval $(call Package/uboot/template,Linksprite_pcDuino3,Linksprite pcDuino3)) -$(eval $(call Package/uboot/template,Lamobo_R1,Lamobo R1)) -$(eval $(call Package/uboot/template,orangepi_plus,Orange Pi Plus (H3))) -$(eval $(call Package/uboot/template,pangolin,Theobroma A31-yQ7 devboard,pangolin)) - -define Package/uboot-sunxi-all - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_sunxi - TITLE:=Meta package for selecting all variants of uboot-sunxi - URL:=http://www.denx.de/wiki/U-Boot - DEPENDS:=$(patsubst %,+%,$(UBOOT_SUNXI_PACKAGES)) +define U-Boot/A20-OLinuXino-Lime + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME + BUILD_DEVICES:=sun7i-a20-olinuxino-lime endef -ifdef BUILD_VARIANT -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - USE_PRIVATE_LIBGCC=yes $(BUILD_VARIANT)_defconfig +define U-Boot/A20-OLinuXino-Lime2 + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2 endef -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) \ - DTCDIR=$(LINUX_DIR)/scripts/dtc/ +define U-Boot/A20-OLinuXino-Lime2-eMMC + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino LIME2 eMMC + BUILD_DEVICES:=sun7i-a20-olinuxino-lime2-emmc endef -else # BUILD_VARIANT -define Build/Prepare -endef -define Build/Configure -endef -define Build/Compile -endef -endif # BUILD_VARIANT -$(foreach pkg,$(UBOOT_SUNXI_PACKAGES), \ - $(eval $(call BuildPackage,$(pkg))) \ -) -$(eval $(call BuildPackage,uboot-sunxi-all)) +define U-Boot/A20-OLinuXino_MICRO + BUILD_SUBTARGET:=cortexa7 + NAME:=A20 OLinuXino MICRO + BUILD_DEVICES:=sun7i-a20-olinuxino-micro +endef + +define U-Boot/Bananapi + BUILD_SUBTARGET:=cortexa7 + NAME:=Bananapi + BUILD_DEVICES:=sun7i-a20-bananapi +endef + +define U-Boot/Bananapro + BUILD_SUBTARGET:=cortexa7 + NAME:=Bananapro + BUILD_DEVICES:=sun7i-a20-bananapro +endef + +define U-Boot/Cubieboard + BUILD_SUBTARGET:=cortexa8 + NAME:=Cubieboard + BUILD_DEVICES:=sun4i-a10-cubieboard +endef + +define U-Boot/Cubieboard2 + BUILD_SUBTARGET:=cortexa7 + NAME:=Cubieboard2 + BUILD_DEVICES:=sun7i-a20-cubieboard2 +endef + +define U-Boot/Cubietruck + BUILD_SUBTARGET:=cortexa7 + NAME:=Cubietruck + BUILD_DEVICES:=sun7i-a20-cubietruck +endef + +define U-Boot/Hummingbird_A31 + BUILD_SUBTARGET:=cortexa7 + NAME:=Hummingbird A31 board +endef + +define U-Boot/Marsboard_A10 + BUILD_SUBTARGET:=cortexa8 + NAME:=Marsboard + BUILD_DEVICES:=sun4i-a10-marsboard +endef + +define U-Boot/Mele_M9 + BUILD_SUBTARGET:=cortexa7 + NAME:=Mele M9 (A31) + BUILD_DEVICES:=sun6i-a31-m9 +endef + +define U-Boot/OLIMEX_A13_SOM + BUILD_SUBTARGET:=cortexa8 + NAME:=Olimex A13 SOM + BUILD_DEVICES:=sun5i-a13-olimex-som +endef + +define U-Boot/Linksprite_pcDuino + BUILD_SUBTARGET:=cortexa8 + NAME:=Linksprite pcDuino + BUILD_DEVICES:=sun4i-a10-pcduino +endef + +define U-Boot/Linksprite_pcDuino3 + BUILD_SUBTARGET:=cortexa7 + NAME:=Linksprite pcDuino3 + BUILD_DEVICES:=sun7i-a20-pcduino3 +endef + +define U-Boot/Lamobo_R1 + BUILD_SUBTARGET:=cortexa7 + NAME:=Lamobo R1 + BUILD_DEVICES:=sun7i-a20-lamobo-r1 +endef + +define U-Boot/nanopi_m1_plus + BUILD_SUBTARGET:=cortexa7 + NAME:=NanoPi M1 Plus (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-m1-plus +endef + +define U-Boot/nanopi_neo + BUILD_SUBTARGET:=cortexa7 + NAME:=U-Boot for NanoPi NEO (H3) + BUILD_DEVICES:=sun8i-h3-nanopi-neo +endef + +define U-Boot/orangepi_r1 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi R1 (H2+) + BUILD_DEVICES:=sun8i-h2-plus-orangepi-r1 +endef + +define U-Boot/orangepi_plus + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi Plus (H3) + BUILD_DEVICES:=sun8i-h3-orangepi-plus +endef + +define U-Boot/orangepi_2 + BUILD_SUBTARGET:=cortexa7 + NAME:=Orange Pi 2 (H3) + BUILD_DEVICES:=sun8i-h3-orangepi-2 +endef + +define U-Boot/pangolin + BUILD_SUBTARGET:=cortexa7 + NAME:=Theobroma A31-yQ7 devboard + UENV:=pangolin +endef + +define U-Boot/pine64_plus + BUILD_SUBTARGET:=cortexa53 + NAME:=Pine64 Plus A64 + BUILD_DEVICES:=sun50i-a64-pine64-plus + DEPENDS:=+PACKAGE_u-boot-pine64_plus:arm-trusted-firmware-sunxi + UENV:=a64 +endef + +UBOOT_TARGETS := \ + A10-OLinuXino-Lime \ + A13-OLinuXino \ + A20-OLinuXino-Lime \ + A20-OLinuXino-Lime2 \ + A20-OLinuXino-Lime2-eMMC \ + A20-OLinuXino_MICRO \ + Bananapi \ + Bananapro \ + Cubieboard \ + Cubieboard2 \ + Cubietruck \ + Hummingbird_A31 \ + Marsboard_A10 \ + Mele_M9 \ + OLIMEX_A13_SOM \ + Linksprite_pcDuino \ + Linksprite_pcDuino3 \ + Lamobo_R1 \ + nanopi_m1_plus \ + nanopi_neo \ + orangepi_r1 \ + orangepi_plus \ + orangepi_2 \ + pangolin \ + pine64_plus + +UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes + +UBOOT_MAKE_FLAGS += \ + BL31=$(STAGING_DIR_IMAGE)/bl31.bin + +define Build/InstallDev + $(INSTALL_DIR) $(STAGING_DIR_IMAGE) +ifeq ($(SUBTARGET),cortexa53) + cat $(PKG_BUILD_DIR)/spl/sunxi-spl.bin $(PKG_BUILD_DIR)/u-boot.itb > $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +else + $(CP) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-u-boot-with-spl.bin +endif + mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ + $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr +endef + +define Package/u-boot/install/default +endef + +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch b/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch deleted file mode 100644 index 6471e7865..000000000 --- a/package/boot/uboot-sunxi/patches/001-use-dtc-in-kernel.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -348,7 +348,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump - AWK = awk - PERL = perl - PYTHON = python --DTC = dtc -+DTC = $(DTCDIR)dtc - CHECK = sparse - - CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ \ diff --git a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch index f29ad12b7..c19f3781d 100644 --- a/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch +++ b/package/boot/uboot-sunxi/patches/002-add-olimex-a13-som.patch @@ -1,8 +1,7 @@ --- /dev/null +++ b/configs/OLIMEX_A13_SOM_defconfig -@@ -0,0 +1,18 @@ +@@ -0,0 +1,17 @@ +CONFIG_SPL=y -+CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2" +CONFIG_DEFAULT_DEVICE_TREE="sun5i-a13-olinuxino" +CONFIG_ARM=y +CONFIG_ARCH_SUNXI=y diff --git a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch index e5a66d7eb..2fce04828 100644 --- a/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch +++ b/package/boot/uboot-sunxi/patches/003-add-theobroma-a31-pangolin.patch @@ -1,16 +1,16 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -152,6 +152,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ +@@ -254,6 +254,7 @@ dtb-$(CONFIG_MACH_SUN6I) += \ sun6i-a31-m9.dtb \ sun6i-a31-mele-a1000g-quad.dtb \ sun6i-a31-mixtile-loftq.dtb \ + sun6i-a31-pangolin.dtb \ + sun6i-a31s-colorfly-e708-q1.dtb \ sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ - sun6i-a31s-sinovoip-bpi-m2.dtb + sun6i-a31s-inet-q972.dtb \ --- a/arch/arm/dts/sun6i-a31.dtsi +++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -643,6 +643,13 @@ +@@ -679,6 +679,13 @@ allwinner,pull = ; }; @@ -358,17 +358,9 @@ +CONFIG_DM_SPI=y +CONFIG_DM_SPI_FLASH=y +CONFIG_SUNXI_SPI=y ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -15,7 +15,6 @@ config SUNXI_GEN_SUN6I - separate ahb reset control registers, custom pmic bus, new style - watchdog, etc. - -- - choice - prompt "Sunxi SoC Variant" - optional -@@ -533,6 +532,14 @@ config VIDEO_LCD_PANEL_I2C_SCL +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -746,6 +746,14 @@ config VIDEO_LCD_PANEL_I2C_SCL Set the SCL pin for the LCD i2c interface. This takes a string in the format understood by sunxi_name_to_gpio, e.g. PH1 for pin 1 of port H. diff --git a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch deleted file mode 100644 index d8fa52c7e..000000000 --- a/package/boot/uboot-sunxi/patches/010-dt-sync-files-with-kernel.patch +++ /dev/null @@ -1,1403 +0,0 @@ -From 4bb656e9dde2019cb42ac4c27b3a114a801ad127 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:41:23 +0100 -Subject: [PATCH] include/dt-bindings: Sync some files with the kernel - -This commit syncs the dt-bindings/input/* headers with the kernel (v4.5) -and adds dt-bindings/clock/sun4i-a10-pll2.h, both are necessary for newer -sunxi dts files to build. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini -Acked-by: Ian Campbell ---- - include/dt-bindings/clock/sun4i-a10-pll2.h | 53 ++ - include/dt-bindings/input/input.h | 510 +--------------- - include/dt-bindings/input/linux-event-codes.h | 805 ++++++++++++++++++++++++++ - 3 files changed, 859 insertions(+), 509 deletions(-) - create mode 100644 include/dt-bindings/clock/sun4i-a10-pll2.h - create mode 100644 include/dt-bindings/input/linux-event-codes.h - ---- /dev/null -+++ b/include/dt-bindings/clock/sun4i-a10-pll2.h -@@ -0,0 +1,53 @@ -+/* -+ * Copyright 2015 Maxime Ripard -+ * -+ * Maxime Ripard -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#ifndef __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+#define __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ -+ -+#define SUN4I_A10_PLL2_1X 0 -+#define SUN4I_A10_PLL2_2X 1 -+#define SUN4I_A10_PLL2_4X 2 -+#define SUN4I_A10_PLL2_8X 3 -+ -+#endif /* __DT_BINDINGS_CLOCK_SUN4I_A10_PLL2_H_ */ ---- a/include/dt-bindings/input/input.h -+++ b/include/dt-bindings/input/input.h -@@ -9,515 +9,7 @@ - #ifndef _DT_BINDINGS_INPUT_INPUT_H - #define _DT_BINDINGS_INPUT_INPUT_H - --#define KEY_RESERVED 0 --#define KEY_ESC 1 --#define KEY_1 2 --#define KEY_2 3 --#define KEY_3 4 --#define KEY_4 5 --#define KEY_5 6 --#define KEY_6 7 --#define KEY_7 8 --#define KEY_8 9 --#define KEY_9 10 --#define KEY_0 11 --#define KEY_MINUS 12 --#define KEY_EQUAL 13 --#define KEY_BACKSPACE 14 --#define KEY_TAB 15 --#define KEY_Q 16 --#define KEY_W 17 --#define KEY_E 18 --#define KEY_R 19 --#define KEY_T 20 --#define KEY_Y 21 --#define KEY_U 22 --#define KEY_I 23 --#define KEY_O 24 --#define KEY_P 25 --#define KEY_LEFTBRACE 26 --#define KEY_RIGHTBRACE 27 --#define KEY_ENTER 28 --#define KEY_LEFTCTRL 29 --#define KEY_A 30 --#define KEY_S 31 --#define KEY_D 32 --#define KEY_F 33 --#define KEY_G 34 --#define KEY_H 35 --#define KEY_J 36 --#define KEY_K 37 --#define KEY_L 38 --#define KEY_SEMICOLON 39 --#define KEY_APOSTROPHE 40 --#define KEY_GRAVE 41 --#define KEY_LEFTSHIFT 42 --#define KEY_BACKSLASH 43 --#define KEY_Z 44 --#define KEY_X 45 --#define KEY_C 46 --#define KEY_V 47 --#define KEY_B 48 --#define KEY_N 49 --#define KEY_M 50 --#define KEY_COMMA 51 --#define KEY_DOT 52 --#define KEY_SLASH 53 --#define KEY_RIGHTSHIFT 54 --#define KEY_KPASTERISK 55 --#define KEY_LEFTALT 56 --#define KEY_SPACE 57 --#define KEY_CAPSLOCK 58 --#define KEY_F1 59 --#define KEY_F2 60 --#define KEY_F3 61 --#define KEY_F4 62 --#define KEY_F5 63 --#define KEY_F6 64 --#define KEY_F7 65 --#define KEY_F8 66 --#define KEY_F9 67 --#define KEY_F10 68 --#define KEY_NUMLOCK 69 --#define KEY_SCROLLLOCK 70 --#define KEY_KP7 71 --#define KEY_KP8 72 --#define KEY_KP9 73 --#define KEY_KPMINUS 74 --#define KEY_KP4 75 --#define KEY_KP5 76 --#define KEY_KP6 77 --#define KEY_KPPLUS 78 --#define KEY_KP1 79 --#define KEY_KP2 80 --#define KEY_KP3 81 --#define KEY_KP0 82 --#define KEY_KPDOT 83 -- --#define KEY_ZENKAKUHANKAKU 85 --#define KEY_102ND 86 --#define KEY_F11 87 --#define KEY_F12 88 --#define KEY_RO 89 --#define KEY_KATAKANA 90 --#define KEY_HIRAGANA 91 --#define KEY_HENKAN 92 --#define KEY_KATAKANAHIRAGANA 93 --#define KEY_MUHENKAN 94 --#define KEY_KPJPCOMMA 95 --#define KEY_KPENTER 96 --#define KEY_RIGHTCTRL 97 --#define KEY_KPSLASH 98 --#define KEY_SYSRQ 99 --#define KEY_RIGHTALT 100 --#define KEY_LINEFEED 101 --#define KEY_HOME 102 --#define KEY_UP 103 --#define KEY_PAGEUP 104 --#define KEY_LEFT 105 --#define KEY_RIGHT 106 --#define KEY_END 107 --#define KEY_DOWN 108 --#define KEY_PAGEDOWN 109 --#define KEY_INSERT 110 --#define KEY_DELETE 111 --#define KEY_MACRO 112 --#define KEY_MUTE 113 --#define KEY_VOLUMEDOWN 114 --#define KEY_VOLUMEUP 115 --#define KEY_POWER 116 /* SC System Power Down */ --#define KEY_KPEQUAL 117 --#define KEY_KPPLUSMINUS 118 --#define KEY_PAUSE 119 --#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -- --#define KEY_KPCOMMA 121 --#define KEY_HANGEUL 122 --#define KEY_HANGUEL KEY_HANGEUL --#define KEY_HANJA 123 --#define KEY_YEN 124 --#define KEY_LEFTMETA 125 --#define KEY_RIGHTMETA 126 --#define KEY_COMPOSE 127 -- --#define KEY_STOP 128 /* AC Stop */ --#define KEY_AGAIN 129 --#define KEY_PROPS 130 /* AC Properties */ --#define KEY_UNDO 131 /* AC Undo */ --#define KEY_FRONT 132 --#define KEY_COPY 133 /* AC Copy */ --#define KEY_OPEN 134 /* AC Open */ --#define KEY_PASTE 135 /* AC Paste */ --#define KEY_FIND 136 /* AC Search */ --#define KEY_CUT 137 /* AC Cut */ --#define KEY_HELP 138 /* AL Integrated Help Center */ --#define KEY_MENU 139 /* Menu (show menu) */ --#define KEY_CALC 140 /* AL Calculator */ --#define KEY_SETUP 141 --#define KEY_SLEEP 142 /* SC System Sleep */ --#define KEY_WAKEUP 143 /* System Wake Up */ --#define KEY_FILE 144 /* AL Local Machine Browser */ --#define KEY_SENDFILE 145 --#define KEY_DELETEFILE 146 --#define KEY_XFER 147 --#define KEY_PROG1 148 --#define KEY_PROG2 149 --#define KEY_WWW 150 /* AL Internet Browser */ --#define KEY_MSDOS 151 --#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ --#define KEY_SCREENLOCK KEY_COFFEE --#define KEY_DIRECTION 153 --#define KEY_CYCLEWINDOWS 154 --#define KEY_MAIL 155 --#define KEY_BOOKMARKS 156 /* AC Bookmarks */ --#define KEY_COMPUTER 157 --#define KEY_BACK 158 /* AC Back */ --#define KEY_FORWARD 159 /* AC Forward */ --#define KEY_CLOSECD 160 --#define KEY_EJECTCD 161 --#define KEY_EJECTCLOSECD 162 --#define KEY_NEXTSONG 163 --#define KEY_PLAYPAUSE 164 --#define KEY_PREVIOUSSONG 165 --#define KEY_STOPCD 166 --#define KEY_RECORD 167 --#define KEY_REWIND 168 --#define KEY_PHONE 169 /* Media Select Telephone */ --#define KEY_ISO 170 --#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ --#define KEY_HOMEPAGE 172 /* AC Home */ --#define KEY_REFRESH 173 /* AC Refresh */ --#define KEY_EXIT 174 /* AC Exit */ --#define KEY_MOVE 175 --#define KEY_EDIT 176 --#define KEY_SCROLLUP 177 --#define KEY_SCROLLDOWN 178 --#define KEY_KPLEFTPAREN 179 --#define KEY_KPRIGHTPAREN 180 --#define KEY_NEW 181 /* AC New */ --#define KEY_REDO 182 /* AC Redo/Repeat */ -- --#define KEY_F13 183 --#define KEY_F14 184 --#define KEY_F15 185 --#define KEY_F16 186 --#define KEY_F17 187 --#define KEY_F18 188 --#define KEY_F19 189 --#define KEY_F20 190 --#define KEY_F21 191 --#define KEY_F22 192 --#define KEY_F23 193 --#define KEY_F24 194 -- --#define KEY_PLAYCD 200 --#define KEY_PAUSECD 201 --#define KEY_PROG3 202 --#define KEY_PROG4 203 --#define KEY_DASHBOARD 204 /* AL Dashboard */ --#define KEY_SUSPEND 205 --#define KEY_CLOSE 206 /* AC Close */ --#define KEY_PLAY 207 --#define KEY_FASTFORWARD 208 --#define KEY_BASSBOOST 209 --#define KEY_PRINT 210 /* AC Print */ --#define KEY_HP 211 --#define KEY_CAMERA 212 --#define KEY_SOUND 213 --#define KEY_QUESTION 214 --#define KEY_EMAIL 215 --#define KEY_CHAT 216 --#define KEY_SEARCH 217 --#define KEY_CONNECT 218 --#define KEY_FINANCE 219 /* AL Checkbook/Finance */ --#define KEY_SPORT 220 --#define KEY_SHOP 221 --#define KEY_ALTERASE 222 --#define KEY_CANCEL 223 /* AC Cancel */ --#define KEY_BRIGHTNESSDOWN 224 --#define KEY_BRIGHTNESSUP 225 --#define KEY_MEDIA 226 -- --#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -- outputs (Monitor/LCD/TV-out/etc) */ --#define KEY_KBDILLUMTOGGLE 228 --#define KEY_KBDILLUMDOWN 229 --#define KEY_KBDILLUMUP 230 -- --#define KEY_SEND 231 /* AC Send */ --#define KEY_REPLY 232 /* AC Reply */ --#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ --#define KEY_SAVE 234 /* AC Save */ --#define KEY_DOCUMENTS 235 -- --#define KEY_BATTERY 236 -- --#define KEY_BLUETOOTH 237 --#define KEY_WLAN 238 --#define KEY_UWB 239 -- --#define KEY_UNKNOWN 240 -- --#define KEY_VIDEO_NEXT 241 /* drive next video source */ --#define KEY_VIDEO_PREV 242 /* drive previous video source */ --#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ --#define KEY_BRIGHTNESS_ZERO 244 /* brightness off, use ambient */ --#define KEY_DISPLAY_OFF 245 /* display device to off state */ -- --#define KEY_WIMAX 246 --#define KEY_RFKILL 247 /* Key that controls all radios */ -- --#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -- --/* Code 255 is reserved for special needs of AT keyboard driver */ -- --#define BTN_MISC 0x100 --#define BTN_0 0x100 --#define BTN_1 0x101 --#define BTN_2 0x102 --#define BTN_3 0x103 --#define BTN_4 0x104 --#define BTN_5 0x105 --#define BTN_6 0x106 --#define BTN_7 0x107 --#define BTN_8 0x108 --#define BTN_9 0x109 -- --#define BTN_MOUSE 0x110 --#define BTN_LEFT 0x110 --#define BTN_RIGHT 0x111 --#define BTN_MIDDLE 0x112 --#define BTN_SIDE 0x113 --#define BTN_EXTRA 0x114 --#define BTN_FORWARD 0x115 --#define BTN_BACK 0x116 --#define BTN_TASK 0x117 -- --#define BTN_JOYSTICK 0x120 --#define BTN_TRIGGER 0x120 --#define BTN_THUMB 0x121 --#define BTN_THUMB2 0x122 --#define BTN_TOP 0x123 --#define BTN_TOP2 0x124 --#define BTN_PINKIE 0x125 --#define BTN_BASE 0x126 --#define BTN_BASE2 0x127 --#define BTN_BASE3 0x128 --#define BTN_BASE4 0x129 --#define BTN_BASE5 0x12a --#define BTN_BASE6 0x12b --#define BTN_DEAD 0x12f -- --#define BTN_GAMEPAD 0x130 --#define BTN_SOUTH 0x130 --#define BTN_A BTN_SOUTH --#define BTN_EAST 0x131 --#define BTN_B BTN_EAST --#define BTN_C 0x132 --#define BTN_NORTH 0x133 --#define BTN_X BTN_NORTH --#define BTN_WEST 0x134 --#define BTN_Y BTN_WEST --#define BTN_Z 0x135 --#define BTN_TL 0x136 --#define BTN_TR 0x137 --#define BTN_TL2 0x138 --#define BTN_TR2 0x139 --#define BTN_SELECT 0x13a --#define BTN_START 0x13b --#define BTN_MODE 0x13c --#define BTN_THUMBL 0x13d --#define BTN_THUMBR 0x13e -- --#define BTN_DIGI 0x140 --#define BTN_TOOL_PEN 0x140 --#define BTN_TOOL_RUBBER 0x141 --#define BTN_TOOL_BRUSH 0x142 --#define BTN_TOOL_PENCIL 0x143 --#define BTN_TOOL_AIRBRUSH 0x144 --#define BTN_TOOL_FINGER 0x145 --#define BTN_TOOL_MOUSE 0x146 --#define BTN_TOOL_LENS 0x147 --#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ --#define BTN_TOUCH 0x14a --#define BTN_STYLUS 0x14b --#define BTN_STYLUS2 0x14c --#define BTN_TOOL_DOUBLETAP 0x14d --#define BTN_TOOL_TRIPLETAP 0x14e --#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -- --#define BTN_WHEEL 0x150 --#define BTN_GEAR_DOWN 0x150 --#define BTN_GEAR_UP 0x151 -- --#define KEY_OK 0x160 --#define KEY_SELECT 0x161 --#define KEY_GOTO 0x162 --#define KEY_CLEAR 0x163 --#define KEY_POWER2 0x164 --#define KEY_OPTION 0x165 --#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ --#define KEY_TIME 0x167 --#define KEY_VENDOR 0x168 --#define KEY_ARCHIVE 0x169 --#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ --#define KEY_CHANNEL 0x16b --#define KEY_FAVORITES 0x16c --#define KEY_EPG 0x16d --#define KEY_PVR 0x16e /* Media Select Home */ --#define KEY_MHP 0x16f --#define KEY_LANGUAGE 0x170 --#define KEY_TITLE 0x171 --#define KEY_SUBTITLE 0x172 --#define KEY_ANGLE 0x173 --#define KEY_ZOOM 0x174 --#define KEY_MODE 0x175 --#define KEY_KEYBOARD 0x176 --#define KEY_SCREEN 0x177 --#define KEY_PC 0x178 /* Media Select Computer */ --#define KEY_TV 0x179 /* Media Select TV */ --#define KEY_TV2 0x17a /* Media Select Cable */ --#define KEY_VCR 0x17b /* Media Select VCR */ --#define KEY_VCR2 0x17c /* VCR Plus */ --#define KEY_SAT 0x17d /* Media Select Satellite */ --#define KEY_SAT2 0x17e --#define KEY_CD 0x17f /* Media Select CD */ --#define KEY_TAPE 0x180 /* Media Select Tape */ --#define KEY_RADIO 0x181 --#define KEY_TUNER 0x182 /* Media Select Tuner */ --#define KEY_PLAYER 0x183 --#define KEY_TEXT 0x184 --#define KEY_DVD 0x185 /* Media Select DVD */ --#define KEY_AUX 0x186 --#define KEY_MP3 0x187 --#define KEY_AUDIO 0x188 /* AL Audio Browser */ --#define KEY_VIDEO 0x189 /* AL Movie Browser */ --#define KEY_DIRECTORY 0x18a --#define KEY_LIST 0x18b --#define KEY_MEMO 0x18c /* Media Select Messages */ --#define KEY_CALENDAR 0x18d --#define KEY_RED 0x18e --#define KEY_GREEN 0x18f --#define KEY_YELLOW 0x190 --#define KEY_BLUE 0x191 --#define KEY_CHANNELUP 0x192 /* Channel Increment */ --#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ --#define KEY_FIRST 0x194 --#define KEY_LAST 0x195 /* Recall Last */ --#define KEY_AB 0x196 --#define KEY_NEXT 0x197 --#define KEY_RESTART 0x198 --#define KEY_SLOW 0x199 --#define KEY_SHUFFLE 0x19a --#define KEY_BREAK 0x19b --#define KEY_PREVIOUS 0x19c --#define KEY_DIGITS 0x19d --#define KEY_TEEN 0x19e --#define KEY_TWEN 0x19f --#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ --#define KEY_GAMES 0x1a1 /* Media Select Games */ --#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ --#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ --#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ --#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ --#define KEY_EDITOR 0x1a6 /* AL Text Editor */ --#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ --#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ --#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ --#define KEY_DATABASE 0x1aa /* AL Database App */ --#define KEY_NEWS 0x1ab /* AL Newsreader */ --#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ --#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ --#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ --#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ --#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ --#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -- --#define KEY_DOLLAR 0x1b2 --#define KEY_EURO 0x1b3 -- --#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ --#define KEY_FRAMEFORWARD 0x1b5 --#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ --#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ --#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ --#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ --#define KEY_IMAGES 0x1ba /* AL Image Browser */ -- --#define KEY_DEL_EOL 0x1c0 --#define KEY_DEL_EOS 0x1c1 --#define KEY_INS_LINE 0x1c2 --#define KEY_DEL_LINE 0x1c3 -- --#define KEY_FN 0x1d0 --#define KEY_FN_ESC 0x1d1 --#define KEY_FN_F1 0x1d2 --#define KEY_FN_F2 0x1d3 --#define KEY_FN_F3 0x1d4 --#define KEY_FN_F4 0x1d5 --#define KEY_FN_F5 0x1d6 --#define KEY_FN_F6 0x1d7 --#define KEY_FN_F7 0x1d8 --#define KEY_FN_F8 0x1d9 --#define KEY_FN_F9 0x1da --#define KEY_FN_F10 0x1db --#define KEY_FN_F11 0x1dc --#define KEY_FN_F12 0x1dd --#define KEY_FN_1 0x1de --#define KEY_FN_2 0x1df --#define KEY_FN_D 0x1e0 --#define KEY_FN_E 0x1e1 --#define KEY_FN_F 0x1e2 --#define KEY_FN_S 0x1e3 --#define KEY_FN_B 0x1e4 -- --#define KEY_BRL_DOT1 0x1f1 --#define KEY_BRL_DOT2 0x1f2 --#define KEY_BRL_DOT3 0x1f3 --#define KEY_BRL_DOT4 0x1f4 --#define KEY_BRL_DOT5 0x1f5 --#define KEY_BRL_DOT6 0x1f6 --#define KEY_BRL_DOT7 0x1f7 --#define KEY_BRL_DOT8 0x1f8 --#define KEY_BRL_DOT9 0x1f9 --#define KEY_BRL_DOT10 0x1fa -- --#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ --#define KEY_NUMERIC_1 0x201 /* and other keypads */ --#define KEY_NUMERIC_2 0x202 --#define KEY_NUMERIC_3 0x203 --#define KEY_NUMERIC_4 0x204 --#define KEY_NUMERIC_5 0x205 --#define KEY_NUMERIC_6 0x206 --#define KEY_NUMERIC_7 0x207 --#define KEY_NUMERIC_8 0x208 --#define KEY_NUMERIC_9 0x209 --#define KEY_NUMERIC_STAR 0x20a --#define KEY_NUMERIC_POUND 0x20b -- --#define KEY_CAMERA_FOCUS 0x210 --#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -- --#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ --#define KEY_TOUCHPAD_ON 0x213 --#define KEY_TOUCHPAD_OFF 0x214 -- --#define KEY_CAMERA_ZOOMIN 0x215 --#define KEY_CAMERA_ZOOMOUT 0x216 --#define KEY_CAMERA_UP 0x217 --#define KEY_CAMERA_DOWN 0x218 --#define KEY_CAMERA_LEFT 0x219 --#define KEY_CAMERA_RIGHT 0x21a -- --#define KEY_ATTENDANT_ON 0x21b --#define KEY_ATTENDANT_OFF 0x21c --#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ --#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -- --#define BTN_DPAD_UP 0x220 --#define BTN_DPAD_DOWN 0x221 --#define BTN_DPAD_LEFT 0x222 --#define BTN_DPAD_RIGHT 0x223 -+#include "linux-event-codes.h" - - #define MATRIX_KEY(row, col, code) \ - ((((row) & 0xFF) << 24) | (((col) & 0xFF) << 16) | ((code) & 0xFFFF)) ---- /dev/null -+++ b/include/dt-bindings/input/linux-event-codes.h -@@ -0,0 +1,805 @@ -+/* -+ * Input event codes -+ * -+ * *** IMPORTANT *** -+ * This file is not only included from C-code but also from devicetree source -+ * files. As such this file MUST only contain comments and defines. -+ * -+ * Copyright (c) 1999-2002 Vojtech Pavlik -+ * Copyright (c) 2015 Hans de Goede -+ * -+ * 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. -+ */ -+#ifndef _UAPI_INPUT_EVENT_CODES_H -+#define _UAPI_INPUT_EVENT_CODES_H -+ -+/* -+ * Device properties and quirks -+ */ -+ -+#define INPUT_PROP_POINTER 0x00 /* needs a pointer */ -+#define INPUT_PROP_DIRECT 0x01 /* direct input devices */ -+#define INPUT_PROP_BUTTONPAD 0x02 /* has button(s) under pad */ -+#define INPUT_PROP_SEMI_MT 0x03 /* touch rectangle only */ -+#define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ -+#define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ -+#define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ -+ -+#define INPUT_PROP_MAX 0x1f -+#define INPUT_PROP_CNT (INPUT_PROP_MAX + 1) -+ -+/* -+ * Event types -+ */ -+ -+#define EV_SYN 0x00 -+#define EV_KEY 0x01 -+#define EV_REL 0x02 -+#define EV_ABS 0x03 -+#define EV_MSC 0x04 -+#define EV_SW 0x05 -+#define EV_LED 0x11 -+#define EV_SND 0x12 -+#define EV_REP 0x14 -+#define EV_FF 0x15 -+#define EV_PWR 0x16 -+#define EV_FF_STATUS 0x17 -+#define EV_MAX 0x1f -+#define EV_CNT (EV_MAX+1) -+ -+/* -+ * Synchronization events. -+ */ -+ -+#define SYN_REPORT 0 -+#define SYN_CONFIG 1 -+#define SYN_MT_REPORT 2 -+#define SYN_DROPPED 3 -+#define SYN_MAX 0xf -+#define SYN_CNT (SYN_MAX+1) -+ -+/* -+ * Keys and buttons -+ * -+ * Most of the keys/buttons are modeled after USB HUT 1.12 -+ * (see http://www.usb.org/developers/hidpage). -+ * Abbreviations in the comments: -+ * AC - Application Control -+ * AL - Application Launch Button -+ * SC - System Control -+ */ -+ -+#define KEY_RESERVED 0 -+#define KEY_ESC 1 -+#define KEY_1 2 -+#define KEY_2 3 -+#define KEY_3 4 -+#define KEY_4 5 -+#define KEY_5 6 -+#define KEY_6 7 -+#define KEY_7 8 -+#define KEY_8 9 -+#define KEY_9 10 -+#define KEY_0 11 -+#define KEY_MINUS 12 -+#define KEY_EQUAL 13 -+#define KEY_BACKSPACE 14 -+#define KEY_TAB 15 -+#define KEY_Q 16 -+#define KEY_W 17 -+#define KEY_E 18 -+#define KEY_R 19 -+#define KEY_T 20 -+#define KEY_Y 21 -+#define KEY_U 22 -+#define KEY_I 23 -+#define KEY_O 24 -+#define KEY_P 25 -+#define KEY_LEFTBRACE 26 -+#define KEY_RIGHTBRACE 27 -+#define KEY_ENTER 28 -+#define KEY_LEFTCTRL 29 -+#define KEY_A 30 -+#define KEY_S 31 -+#define KEY_D 32 -+#define KEY_F 33 -+#define KEY_G 34 -+#define KEY_H 35 -+#define KEY_J 36 -+#define KEY_K 37 -+#define KEY_L 38 -+#define KEY_SEMICOLON 39 -+#define KEY_APOSTROPHE 40 -+#define KEY_GRAVE 41 -+#define KEY_LEFTSHIFT 42 -+#define KEY_BACKSLASH 43 -+#define KEY_Z 44 -+#define KEY_X 45 -+#define KEY_C 46 -+#define KEY_V 47 -+#define KEY_B 48 -+#define KEY_N 49 -+#define KEY_M 50 -+#define KEY_COMMA 51 -+#define KEY_DOT 52 -+#define KEY_SLASH 53 -+#define KEY_RIGHTSHIFT 54 -+#define KEY_KPASTERISK 55 -+#define KEY_LEFTALT 56 -+#define KEY_SPACE 57 -+#define KEY_CAPSLOCK 58 -+#define KEY_F1 59 -+#define KEY_F2 60 -+#define KEY_F3 61 -+#define KEY_F4 62 -+#define KEY_F5 63 -+#define KEY_F6 64 -+#define KEY_F7 65 -+#define KEY_F8 66 -+#define KEY_F9 67 -+#define KEY_F10 68 -+#define KEY_NUMLOCK 69 -+#define KEY_SCROLLLOCK 70 -+#define KEY_KP7 71 -+#define KEY_KP8 72 -+#define KEY_KP9 73 -+#define KEY_KPMINUS 74 -+#define KEY_KP4 75 -+#define KEY_KP5 76 -+#define KEY_KP6 77 -+#define KEY_KPPLUS 78 -+#define KEY_KP1 79 -+#define KEY_KP2 80 -+#define KEY_KP3 81 -+#define KEY_KP0 82 -+#define KEY_KPDOT 83 -+ -+#define KEY_ZENKAKUHANKAKU 85 -+#define KEY_102ND 86 -+#define KEY_F11 87 -+#define KEY_F12 88 -+#define KEY_RO 89 -+#define KEY_KATAKANA 90 -+#define KEY_HIRAGANA 91 -+#define KEY_HENKAN 92 -+#define KEY_KATAKANAHIRAGANA 93 -+#define KEY_MUHENKAN 94 -+#define KEY_KPJPCOMMA 95 -+#define KEY_KPENTER 96 -+#define KEY_RIGHTCTRL 97 -+#define KEY_KPSLASH 98 -+#define KEY_SYSRQ 99 -+#define KEY_RIGHTALT 100 -+#define KEY_LINEFEED 101 -+#define KEY_HOME 102 -+#define KEY_UP 103 -+#define KEY_PAGEUP 104 -+#define KEY_LEFT 105 -+#define KEY_RIGHT 106 -+#define KEY_END 107 -+#define KEY_DOWN 108 -+#define KEY_PAGEDOWN 109 -+#define KEY_INSERT 110 -+#define KEY_DELETE 111 -+#define KEY_MACRO 112 -+#define KEY_MUTE 113 -+#define KEY_VOLUMEDOWN 114 -+#define KEY_VOLUMEUP 115 -+#define KEY_POWER 116 /* SC System Power Down */ -+#define KEY_KPEQUAL 117 -+#define KEY_KPPLUSMINUS 118 -+#define KEY_PAUSE 119 -+#define KEY_SCALE 120 /* AL Compiz Scale (Expose) */ -+ -+#define KEY_KPCOMMA 121 -+#define KEY_HANGEUL 122 -+#define KEY_HANGUEL KEY_HANGEUL -+#define KEY_HANJA 123 -+#define KEY_YEN 124 -+#define KEY_LEFTMETA 125 -+#define KEY_RIGHTMETA 126 -+#define KEY_COMPOSE 127 -+ -+#define KEY_STOP 128 /* AC Stop */ -+#define KEY_AGAIN 129 -+#define KEY_PROPS 130 /* AC Properties */ -+#define KEY_UNDO 131 /* AC Undo */ -+#define KEY_FRONT 132 -+#define KEY_COPY 133 /* AC Copy */ -+#define KEY_OPEN 134 /* AC Open */ -+#define KEY_PASTE 135 /* AC Paste */ -+#define KEY_FIND 136 /* AC Search */ -+#define KEY_CUT 137 /* AC Cut */ -+#define KEY_HELP 138 /* AL Integrated Help Center */ -+#define KEY_MENU 139 /* Menu (show menu) */ -+#define KEY_CALC 140 /* AL Calculator */ -+#define KEY_SETUP 141 -+#define KEY_SLEEP 142 /* SC System Sleep */ -+#define KEY_WAKEUP 143 /* System Wake Up */ -+#define KEY_FILE 144 /* AL Local Machine Browser */ -+#define KEY_SENDFILE 145 -+#define KEY_DELETEFILE 146 -+#define KEY_XFER 147 -+#define KEY_PROG1 148 -+#define KEY_PROG2 149 -+#define KEY_WWW 150 /* AL Internet Browser */ -+#define KEY_MSDOS 151 -+#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */ -+#define KEY_SCREENLOCK KEY_COFFEE -+#define KEY_ROTATE_DISPLAY 153 /* Display orientation for e.g. tablets */ -+#define KEY_DIRECTION KEY_ROTATE_DISPLAY -+#define KEY_CYCLEWINDOWS 154 -+#define KEY_MAIL 155 -+#define KEY_BOOKMARKS 156 /* AC Bookmarks */ -+#define KEY_COMPUTER 157 -+#define KEY_BACK 158 /* AC Back */ -+#define KEY_FORWARD 159 /* AC Forward */ -+#define KEY_CLOSECD 160 -+#define KEY_EJECTCD 161 -+#define KEY_EJECTCLOSECD 162 -+#define KEY_NEXTSONG 163 -+#define KEY_PLAYPAUSE 164 -+#define KEY_PREVIOUSSONG 165 -+#define KEY_STOPCD 166 -+#define KEY_RECORD 167 -+#define KEY_REWIND 168 -+#define KEY_PHONE 169 /* Media Select Telephone */ -+#define KEY_ISO 170 -+#define KEY_CONFIG 171 /* AL Consumer Control Configuration */ -+#define KEY_HOMEPAGE 172 /* AC Home */ -+#define KEY_REFRESH 173 /* AC Refresh */ -+#define KEY_EXIT 174 /* AC Exit */ -+#define KEY_MOVE 175 -+#define KEY_EDIT 176 -+#define KEY_SCROLLUP 177 -+#define KEY_SCROLLDOWN 178 -+#define KEY_KPLEFTPAREN 179 -+#define KEY_KPRIGHTPAREN 180 -+#define KEY_NEW 181 /* AC New */ -+#define KEY_REDO 182 /* AC Redo/Repeat */ -+ -+#define KEY_F13 183 -+#define KEY_F14 184 -+#define KEY_F15 185 -+#define KEY_F16 186 -+#define KEY_F17 187 -+#define KEY_F18 188 -+#define KEY_F19 189 -+#define KEY_F20 190 -+#define KEY_F21 191 -+#define KEY_F22 192 -+#define KEY_F23 193 -+#define KEY_F24 194 -+ -+#define KEY_PLAYCD 200 -+#define KEY_PAUSECD 201 -+#define KEY_PROG3 202 -+#define KEY_PROG4 203 -+#define KEY_DASHBOARD 204 /* AL Dashboard */ -+#define KEY_SUSPEND 205 -+#define KEY_CLOSE 206 /* AC Close */ -+#define KEY_PLAY 207 -+#define KEY_FASTFORWARD 208 -+#define KEY_BASSBOOST 209 -+#define KEY_PRINT 210 /* AC Print */ -+#define KEY_HP 211 -+#define KEY_CAMERA 212 -+#define KEY_SOUND 213 -+#define KEY_QUESTION 214 -+#define KEY_EMAIL 215 -+#define KEY_CHAT 216 -+#define KEY_SEARCH 217 -+#define KEY_CONNECT 218 -+#define KEY_FINANCE 219 /* AL Checkbook/Finance */ -+#define KEY_SPORT 220 -+#define KEY_SHOP 221 -+#define KEY_ALTERASE 222 -+#define KEY_CANCEL 223 /* AC Cancel */ -+#define KEY_BRIGHTNESSDOWN 224 -+#define KEY_BRIGHTNESSUP 225 -+#define KEY_MEDIA 226 -+ -+#define KEY_SWITCHVIDEOMODE 227 /* Cycle between available video -+ outputs (Monitor/LCD/TV-out/etc) */ -+#define KEY_KBDILLUMTOGGLE 228 -+#define KEY_KBDILLUMDOWN 229 -+#define KEY_KBDILLUMUP 230 -+ -+#define KEY_SEND 231 /* AC Send */ -+#define KEY_REPLY 232 /* AC Reply */ -+#define KEY_FORWARDMAIL 233 /* AC Forward Msg */ -+#define KEY_SAVE 234 /* AC Save */ -+#define KEY_DOCUMENTS 235 -+ -+#define KEY_BATTERY 236 -+ -+#define KEY_BLUETOOTH 237 -+#define KEY_WLAN 238 -+#define KEY_UWB 239 -+ -+#define KEY_UNKNOWN 240 -+ -+#define KEY_VIDEO_NEXT 241 /* drive next video source */ -+#define KEY_VIDEO_PREV 242 /* drive previous video source */ -+#define KEY_BRIGHTNESS_CYCLE 243 /* brightness up, after max is min */ -+#define KEY_BRIGHTNESS_AUTO 244 /* Set Auto Brightness: manual -+ brightness control is off, -+ rely on ambient */ -+#define KEY_BRIGHTNESS_ZERO KEY_BRIGHTNESS_AUTO -+#define KEY_DISPLAY_OFF 245 /* display device to off state */ -+ -+#define KEY_WWAN 246 /* Wireless WAN (LTE, UMTS, GSM, etc.) */ -+#define KEY_WIMAX KEY_WWAN -+#define KEY_RFKILL 247 /* Key that controls all radios */ -+ -+#define KEY_MICMUTE 248 /* Mute / unmute the microphone */ -+ -+/* Code 255 is reserved for special needs of AT keyboard driver */ -+ -+#define BTN_MISC 0x100 -+#define BTN_0 0x100 -+#define BTN_1 0x101 -+#define BTN_2 0x102 -+#define BTN_3 0x103 -+#define BTN_4 0x104 -+#define BTN_5 0x105 -+#define BTN_6 0x106 -+#define BTN_7 0x107 -+#define BTN_8 0x108 -+#define BTN_9 0x109 -+ -+#define BTN_MOUSE 0x110 -+#define BTN_LEFT 0x110 -+#define BTN_RIGHT 0x111 -+#define BTN_MIDDLE 0x112 -+#define BTN_SIDE 0x113 -+#define BTN_EXTRA 0x114 -+#define BTN_FORWARD 0x115 -+#define BTN_BACK 0x116 -+#define BTN_TASK 0x117 -+ -+#define BTN_JOYSTICK 0x120 -+#define BTN_TRIGGER 0x120 -+#define BTN_THUMB 0x121 -+#define BTN_THUMB2 0x122 -+#define BTN_TOP 0x123 -+#define BTN_TOP2 0x124 -+#define BTN_PINKIE 0x125 -+#define BTN_BASE 0x126 -+#define BTN_BASE2 0x127 -+#define BTN_BASE3 0x128 -+#define BTN_BASE4 0x129 -+#define BTN_BASE5 0x12a -+#define BTN_BASE6 0x12b -+#define BTN_DEAD 0x12f -+ -+#define BTN_GAMEPAD 0x130 -+#define BTN_SOUTH 0x130 -+#define BTN_A BTN_SOUTH -+#define BTN_EAST 0x131 -+#define BTN_B BTN_EAST -+#define BTN_C 0x132 -+#define BTN_NORTH 0x133 -+#define BTN_X BTN_NORTH -+#define BTN_WEST 0x134 -+#define BTN_Y BTN_WEST -+#define BTN_Z 0x135 -+#define BTN_TL 0x136 -+#define BTN_TR 0x137 -+#define BTN_TL2 0x138 -+#define BTN_TR2 0x139 -+#define BTN_SELECT 0x13a -+#define BTN_START 0x13b -+#define BTN_MODE 0x13c -+#define BTN_THUMBL 0x13d -+#define BTN_THUMBR 0x13e -+ -+#define BTN_DIGI 0x140 -+#define BTN_TOOL_PEN 0x140 -+#define BTN_TOOL_RUBBER 0x141 -+#define BTN_TOOL_BRUSH 0x142 -+#define BTN_TOOL_PENCIL 0x143 -+#define BTN_TOOL_AIRBRUSH 0x144 -+#define BTN_TOOL_FINGER 0x145 -+#define BTN_TOOL_MOUSE 0x146 -+#define BTN_TOOL_LENS 0x147 -+#define BTN_TOOL_QUINTTAP 0x148 /* Five fingers on trackpad */ -+#define BTN_TOUCH 0x14a -+#define BTN_STYLUS 0x14b -+#define BTN_STYLUS2 0x14c -+#define BTN_TOOL_DOUBLETAP 0x14d -+#define BTN_TOOL_TRIPLETAP 0x14e -+#define BTN_TOOL_QUADTAP 0x14f /* Four fingers on trackpad */ -+ -+#define BTN_WHEEL 0x150 -+#define BTN_GEAR_DOWN 0x150 -+#define BTN_GEAR_UP 0x151 -+ -+#define KEY_OK 0x160 -+#define KEY_SELECT 0x161 -+#define KEY_GOTO 0x162 -+#define KEY_CLEAR 0x163 -+#define KEY_POWER2 0x164 -+#define KEY_OPTION 0x165 -+#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */ -+#define KEY_TIME 0x167 -+#define KEY_VENDOR 0x168 -+#define KEY_ARCHIVE 0x169 -+#define KEY_PROGRAM 0x16a /* Media Select Program Guide */ -+#define KEY_CHANNEL 0x16b -+#define KEY_FAVORITES 0x16c -+#define KEY_EPG 0x16d -+#define KEY_PVR 0x16e /* Media Select Home */ -+#define KEY_MHP 0x16f -+#define KEY_LANGUAGE 0x170 -+#define KEY_TITLE 0x171 -+#define KEY_SUBTITLE 0x172 -+#define KEY_ANGLE 0x173 -+#define KEY_ZOOM 0x174 -+#define KEY_MODE 0x175 -+#define KEY_KEYBOARD 0x176 -+#define KEY_SCREEN 0x177 -+#define KEY_PC 0x178 /* Media Select Computer */ -+#define KEY_TV 0x179 /* Media Select TV */ -+#define KEY_TV2 0x17a /* Media Select Cable */ -+#define KEY_VCR 0x17b /* Media Select VCR */ -+#define KEY_VCR2 0x17c /* VCR Plus */ -+#define KEY_SAT 0x17d /* Media Select Satellite */ -+#define KEY_SAT2 0x17e -+#define KEY_CD 0x17f /* Media Select CD */ -+#define KEY_TAPE 0x180 /* Media Select Tape */ -+#define KEY_RADIO 0x181 -+#define KEY_TUNER 0x182 /* Media Select Tuner */ -+#define KEY_PLAYER 0x183 -+#define KEY_TEXT 0x184 -+#define KEY_DVD 0x185 /* Media Select DVD */ -+#define KEY_AUX 0x186 -+#define KEY_MP3 0x187 -+#define KEY_AUDIO 0x188 /* AL Audio Browser */ -+#define KEY_VIDEO 0x189 /* AL Movie Browser */ -+#define KEY_DIRECTORY 0x18a -+#define KEY_LIST 0x18b -+#define KEY_MEMO 0x18c /* Media Select Messages */ -+#define KEY_CALENDAR 0x18d -+#define KEY_RED 0x18e -+#define KEY_GREEN 0x18f -+#define KEY_YELLOW 0x190 -+#define KEY_BLUE 0x191 -+#define KEY_CHANNELUP 0x192 /* Channel Increment */ -+#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */ -+#define KEY_FIRST 0x194 -+#define KEY_LAST 0x195 /* Recall Last */ -+#define KEY_AB 0x196 -+#define KEY_NEXT 0x197 -+#define KEY_RESTART 0x198 -+#define KEY_SLOW 0x199 -+#define KEY_SHUFFLE 0x19a -+#define KEY_BREAK 0x19b -+#define KEY_PREVIOUS 0x19c -+#define KEY_DIGITS 0x19d -+#define KEY_TEEN 0x19e -+#define KEY_TWEN 0x19f -+#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */ -+#define KEY_GAMES 0x1a1 /* Media Select Games */ -+#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */ -+#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */ -+#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */ -+#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */ -+#define KEY_EDITOR 0x1a6 /* AL Text Editor */ -+#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */ -+#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */ -+#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */ -+#define KEY_DATABASE 0x1aa /* AL Database App */ -+#define KEY_NEWS 0x1ab /* AL Newsreader */ -+#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */ -+#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */ -+#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */ -+#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ -+#define KEY_BRIGHTNESS_TOGGLE KEY_DISPLAYTOGGLE -+#define KEY_SPELLCHECK 0x1b0 /* AL Spell Check */ -+#define KEY_LOGOFF 0x1b1 /* AL Logoff */ -+ -+#define KEY_DOLLAR 0x1b2 -+#define KEY_EURO 0x1b3 -+ -+#define KEY_FRAMEBACK 0x1b4 /* Consumer - transport controls */ -+#define KEY_FRAMEFORWARD 0x1b5 -+#define KEY_CONTEXT_MENU 0x1b6 /* GenDesc - system context menu */ -+#define KEY_MEDIA_REPEAT 0x1b7 /* Consumer - transport control */ -+#define KEY_10CHANNELSUP 0x1b8 /* 10 channels up (10+) */ -+#define KEY_10CHANNELSDOWN 0x1b9 /* 10 channels down (10-) */ -+#define KEY_IMAGES 0x1ba /* AL Image Browser */ -+ -+#define KEY_DEL_EOL 0x1c0 -+#define KEY_DEL_EOS 0x1c1 -+#define KEY_INS_LINE 0x1c2 -+#define KEY_DEL_LINE 0x1c3 -+ -+#define KEY_FN 0x1d0 -+#define KEY_FN_ESC 0x1d1 -+#define KEY_FN_F1 0x1d2 -+#define KEY_FN_F2 0x1d3 -+#define KEY_FN_F3 0x1d4 -+#define KEY_FN_F4 0x1d5 -+#define KEY_FN_F5 0x1d6 -+#define KEY_FN_F6 0x1d7 -+#define KEY_FN_F7 0x1d8 -+#define KEY_FN_F8 0x1d9 -+#define KEY_FN_F9 0x1da -+#define KEY_FN_F10 0x1db -+#define KEY_FN_F11 0x1dc -+#define KEY_FN_F12 0x1dd -+#define KEY_FN_1 0x1de -+#define KEY_FN_2 0x1df -+#define KEY_FN_D 0x1e0 -+#define KEY_FN_E 0x1e1 -+#define KEY_FN_F 0x1e2 -+#define KEY_FN_S 0x1e3 -+#define KEY_FN_B 0x1e4 -+ -+#define KEY_BRL_DOT1 0x1f1 -+#define KEY_BRL_DOT2 0x1f2 -+#define KEY_BRL_DOT3 0x1f3 -+#define KEY_BRL_DOT4 0x1f4 -+#define KEY_BRL_DOT5 0x1f5 -+#define KEY_BRL_DOT6 0x1f6 -+#define KEY_BRL_DOT7 0x1f7 -+#define KEY_BRL_DOT8 0x1f8 -+#define KEY_BRL_DOT9 0x1f9 -+#define KEY_BRL_DOT10 0x1fa -+ -+#define KEY_NUMERIC_0 0x200 /* used by phones, remote controls, */ -+#define KEY_NUMERIC_1 0x201 /* and other keypads */ -+#define KEY_NUMERIC_2 0x202 -+#define KEY_NUMERIC_3 0x203 -+#define KEY_NUMERIC_4 0x204 -+#define KEY_NUMERIC_5 0x205 -+#define KEY_NUMERIC_6 0x206 -+#define KEY_NUMERIC_7 0x207 -+#define KEY_NUMERIC_8 0x208 -+#define KEY_NUMERIC_9 0x209 -+#define KEY_NUMERIC_STAR 0x20a -+#define KEY_NUMERIC_POUND 0x20b -+#define KEY_NUMERIC_A 0x20c /* Phone key A - HUT Telephony 0xb9 */ -+#define KEY_NUMERIC_B 0x20d -+#define KEY_NUMERIC_C 0x20e -+#define KEY_NUMERIC_D 0x20f -+ -+#define KEY_CAMERA_FOCUS 0x210 -+#define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ -+ -+#define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ -+#define KEY_TOUCHPAD_ON 0x213 -+#define KEY_TOUCHPAD_OFF 0x214 -+ -+#define KEY_CAMERA_ZOOMIN 0x215 -+#define KEY_CAMERA_ZOOMOUT 0x216 -+#define KEY_CAMERA_UP 0x217 -+#define KEY_CAMERA_DOWN 0x218 -+#define KEY_CAMERA_LEFT 0x219 -+#define KEY_CAMERA_RIGHT 0x21a -+ -+#define KEY_ATTENDANT_ON 0x21b -+#define KEY_ATTENDANT_OFF 0x21c -+#define KEY_ATTENDANT_TOGGLE 0x21d /* Attendant call on or off */ -+#define KEY_LIGHTS_TOGGLE 0x21e /* Reading light on or off */ -+ -+#define BTN_DPAD_UP 0x220 -+#define BTN_DPAD_DOWN 0x221 -+#define BTN_DPAD_LEFT 0x222 -+#define BTN_DPAD_RIGHT 0x223 -+ -+#define KEY_ALS_TOGGLE 0x230 /* Ambient light sensor */ -+ -+#define KEY_BUTTONCONFIG 0x240 /* AL Button Configuration */ -+#define KEY_TASKMANAGER 0x241 /* AL Task/Project Manager */ -+#define KEY_JOURNAL 0x242 /* AL Log/Journal/Timecard */ -+#define KEY_CONTROLPANEL 0x243 /* AL Control Panel */ -+#define KEY_APPSELECT 0x244 /* AL Select Task/Application */ -+#define KEY_SCREENSAVER 0x245 /* AL Screen Saver */ -+#define KEY_VOICECOMMAND 0x246 /* Listening Voice Command */ -+ -+#define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ -+#define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ -+ -+#define KEY_KBDINPUTASSIST_PREV 0x260 -+#define KEY_KBDINPUTASSIST_NEXT 0x261 -+#define KEY_KBDINPUTASSIST_PREVGROUP 0x262 -+#define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 -+#define KEY_KBDINPUTASSIST_ACCEPT 0x264 -+#define KEY_KBDINPUTASSIST_CANCEL 0x265 -+ -+#define BTN_TRIGGER_HAPPY 0x2c0 -+#define BTN_TRIGGER_HAPPY1 0x2c0 -+#define BTN_TRIGGER_HAPPY2 0x2c1 -+#define BTN_TRIGGER_HAPPY3 0x2c2 -+#define BTN_TRIGGER_HAPPY4 0x2c3 -+#define BTN_TRIGGER_HAPPY5 0x2c4 -+#define BTN_TRIGGER_HAPPY6 0x2c5 -+#define BTN_TRIGGER_HAPPY7 0x2c6 -+#define BTN_TRIGGER_HAPPY8 0x2c7 -+#define BTN_TRIGGER_HAPPY9 0x2c8 -+#define BTN_TRIGGER_HAPPY10 0x2c9 -+#define BTN_TRIGGER_HAPPY11 0x2ca -+#define BTN_TRIGGER_HAPPY12 0x2cb -+#define BTN_TRIGGER_HAPPY13 0x2cc -+#define BTN_TRIGGER_HAPPY14 0x2cd -+#define BTN_TRIGGER_HAPPY15 0x2ce -+#define BTN_TRIGGER_HAPPY16 0x2cf -+#define BTN_TRIGGER_HAPPY17 0x2d0 -+#define BTN_TRIGGER_HAPPY18 0x2d1 -+#define BTN_TRIGGER_HAPPY19 0x2d2 -+#define BTN_TRIGGER_HAPPY20 0x2d3 -+#define BTN_TRIGGER_HAPPY21 0x2d4 -+#define BTN_TRIGGER_HAPPY22 0x2d5 -+#define BTN_TRIGGER_HAPPY23 0x2d6 -+#define BTN_TRIGGER_HAPPY24 0x2d7 -+#define BTN_TRIGGER_HAPPY25 0x2d8 -+#define BTN_TRIGGER_HAPPY26 0x2d9 -+#define BTN_TRIGGER_HAPPY27 0x2da -+#define BTN_TRIGGER_HAPPY28 0x2db -+#define BTN_TRIGGER_HAPPY29 0x2dc -+#define BTN_TRIGGER_HAPPY30 0x2dd -+#define BTN_TRIGGER_HAPPY31 0x2de -+#define BTN_TRIGGER_HAPPY32 0x2df -+#define BTN_TRIGGER_HAPPY33 0x2e0 -+#define BTN_TRIGGER_HAPPY34 0x2e1 -+#define BTN_TRIGGER_HAPPY35 0x2e2 -+#define BTN_TRIGGER_HAPPY36 0x2e3 -+#define BTN_TRIGGER_HAPPY37 0x2e4 -+#define BTN_TRIGGER_HAPPY38 0x2e5 -+#define BTN_TRIGGER_HAPPY39 0x2e6 -+#define BTN_TRIGGER_HAPPY40 0x2e7 -+ -+/* We avoid low common keys in module aliases so they don't get huge. */ -+#define KEY_MIN_INTERESTING KEY_MUTE -+#define KEY_MAX 0x2ff -+#define KEY_CNT (KEY_MAX+1) -+ -+/* -+ * Relative axes -+ */ -+ -+#define REL_X 0x00 -+#define REL_Y 0x01 -+#define REL_Z 0x02 -+#define REL_RX 0x03 -+#define REL_RY 0x04 -+#define REL_RZ 0x05 -+#define REL_HWHEEL 0x06 -+#define REL_DIAL 0x07 -+#define REL_WHEEL 0x08 -+#define REL_MISC 0x09 -+#define REL_MAX 0x0f -+#define REL_CNT (REL_MAX+1) -+ -+/* -+ * Absolute axes -+ */ -+ -+#define ABS_X 0x00 -+#define ABS_Y 0x01 -+#define ABS_Z 0x02 -+#define ABS_RX 0x03 -+#define ABS_RY 0x04 -+#define ABS_RZ 0x05 -+#define ABS_THROTTLE 0x06 -+#define ABS_RUDDER 0x07 -+#define ABS_WHEEL 0x08 -+#define ABS_GAS 0x09 -+#define ABS_BRAKE 0x0a -+#define ABS_HAT0X 0x10 -+#define ABS_HAT0Y 0x11 -+#define ABS_HAT1X 0x12 -+#define ABS_HAT1Y 0x13 -+#define ABS_HAT2X 0x14 -+#define ABS_HAT2Y 0x15 -+#define ABS_HAT3X 0x16 -+#define ABS_HAT3Y 0x17 -+#define ABS_PRESSURE 0x18 -+#define ABS_DISTANCE 0x19 -+#define ABS_TILT_X 0x1a -+#define ABS_TILT_Y 0x1b -+#define ABS_TOOL_WIDTH 0x1c -+ -+#define ABS_VOLUME 0x20 -+ -+#define ABS_MISC 0x28 -+ -+#define ABS_MT_SLOT 0x2f /* MT slot being modified */ -+#define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse */ -+#define ABS_MT_TOUCH_MINOR 0x31 /* Minor axis (omit if circular) */ -+#define ABS_MT_WIDTH_MAJOR 0x32 /* Major axis of approaching ellipse */ -+#define ABS_MT_WIDTH_MINOR 0x33 /* Minor axis (omit if circular) */ -+#define ABS_MT_ORIENTATION 0x34 /* Ellipse orientation */ -+#define ABS_MT_POSITION_X 0x35 /* Center X touch position */ -+#define ABS_MT_POSITION_Y 0x36 /* Center Y touch position */ -+#define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ -+#define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ -+#define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ -+#define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ -+#define ABS_MT_DISTANCE 0x3b /* Contact hover distance */ -+#define ABS_MT_TOOL_X 0x3c /* Center X tool position */ -+#define ABS_MT_TOOL_Y 0x3d /* Center Y tool position */ -+ -+ -+#define ABS_MAX 0x3f -+#define ABS_CNT (ABS_MAX+1) -+ -+/* -+ * Switch events -+ */ -+ -+#define SW_LID 0x00 /* set = lid shut */ -+#define SW_TABLET_MODE 0x01 /* set = tablet mode */ -+#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ -+#define SW_RFKILL_ALL 0x03 /* rfkill master switch, type "any" -+ set = radio enabled */ -+#define SW_RADIO SW_RFKILL_ALL /* deprecated */ -+#define SW_MICROPHONE_INSERT 0x04 /* set = inserted */ -+#define SW_DOCK 0x05 /* set = plugged into dock */ -+#define SW_LINEOUT_INSERT 0x06 /* set = inserted */ -+#define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ -+#define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ -+#define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ -+#define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ -+#define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ -+#define SW_ROTATE_LOCK 0x0c /* set = rotate locked/disabled */ -+#define SW_LINEIN_INSERT 0x0d /* set = inserted */ -+#define SW_MUTE_DEVICE 0x0e /* set = device disabled */ -+#define SW_MAX 0x0f -+#define SW_CNT (SW_MAX+1) -+ -+/* -+ * Misc events -+ */ -+ -+#define MSC_SERIAL 0x00 -+#define MSC_PULSELED 0x01 -+#define MSC_GESTURE 0x02 -+#define MSC_RAW 0x03 -+#define MSC_SCAN 0x04 -+#define MSC_TIMESTAMP 0x05 -+#define MSC_MAX 0x07 -+#define MSC_CNT (MSC_MAX+1) -+ -+/* -+ * LEDs -+ */ -+ -+#define LED_NUML 0x00 -+#define LED_CAPSL 0x01 -+#define LED_SCROLLL 0x02 -+#define LED_COMPOSE 0x03 -+#define LED_KANA 0x04 -+#define LED_SLEEP 0x05 -+#define LED_SUSPEND 0x06 -+#define LED_MUTE 0x07 -+#define LED_MISC 0x08 -+#define LED_MAIL 0x09 -+#define LED_CHARGING 0x0a -+#define LED_MAX 0x0f -+#define LED_CNT (LED_MAX+1) -+ -+/* -+ * Autorepeat values -+ */ -+ -+#define REP_DELAY 0x00 -+#define REP_PERIOD 0x01 -+#define REP_MAX 0x01 -+#define REP_CNT (REP_MAX+1) -+ -+/* -+ * Sounds -+ */ -+ -+#define SND_CLICK 0x00 -+#define SND_BELL 0x01 -+#define SND_TONE 0x02 -+#define SND_MAX 0x07 -+#define SND_CNT (SND_MAX+1) -+ -+#endif diff --git a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch b/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch deleted file mode 100644 index e36f9e3c5..000000000 --- a/package/boot/uboot-sunxi/patches/011-dt-sync-dts-files-with-kernel.patch +++ /dev/null @@ -1,7211 +0,0 @@ -From 80e5f83c0fc4bf42110cc55ce671ad7ddc7b08a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 14 Mar 2016 17:37:09 +0100 -Subject: [PATCH] sunxi: Sync dts files with the upstream kernel - -Sync dts files with the upstream kernel including -changes queued for 4.6: - -https://git.kernel.org/cgit/linux/kernel/git/mripard/linux.git/commit/?h=sunxi/dt-for-4.6 - -Note this adds a number of new unused board dts files. I've asked the -authors of the kernel commits adding these to submit a matching defconfig -to u-boot. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/dts/Makefile | 8 +- - arch/arm/dts/axp22x.dtsi | 145 ++++++++++++ - arch/arm/dts/sun4i-a10-a1000.dts | 4 + - arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts | 22 ++ - arch/arm/dts/sun4i-a10-cubieboard.dts | 4 + - arch/arm/dts/sun4i-a10-gemei-g9.dts | 63 +++++- - arch/arm/dts/sun4i-a10-inet1.dts | 48 ++++ - arch/arm/dts/sun4i-a10-inet97fv2.dts | 127 ++++++++++- - arch/arm/dts/sun4i-a10-inet9f-rev03.dts | 181 +++++++++++++++ - arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts | 86 +------ - arch/arm/dts/sun4i-a10-jesurun-q5.dts | 15 ++ - arch/arm/dts/sun4i-a10-marsboard.dts | 23 ++ - arch/arm/dts/sun4i-a10-mk802.dts | 37 +++ - arch/arm/dts/sun4i-a10-olinuxino-lime.dts | 12 + - arch/arm/dts/sun4i-a10-pcduino.dts | 58 ++++- - arch/arm/dts/sun4i-a10-pcduino2.dts | 78 +++++++ - arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts | 69 ++++++ - arch/arm/dts/sun4i-a10.dtsi | 153 +++++++++++-- - arch/arm/dts/sun5i-a10s-auxtek-t004.dts | 14 ++ - arch/arm/dts/sun5i-a10s-olinuxino-micro.dts | 2 +- - arch/arm/dts/sun5i-a13-empire-electronix-d709.dts | 19 +- - arch/arm/dts/sun5i-a13-inet-98v-rev2.dts | 26 +-- - arch/arm/dts/sun5i-a13-utoo-p66.dts | 30 +++ - arch/arm/dts/sun5i-q8-common.dtsi | 10 + - arch/arm/dts/sun5i-r8-chip.dts | 47 +++- - arch/arm/dts/sun5i.dtsi | 31 +++ - arch/arm/dts/sun6i-a31-colombus.dts | 24 ++ - arch/arm/dts/sun6i-a31-hummingbird.dts | 132 ++++++----- - arch/arm/dts/sun6i-a31.dtsi | 65 +++++- - arch/arm/dts/sun6i-a31s-primo81.dts | 247 ++++++++++++++++++++- - arch/arm/dts/sun6i-a31s-sina31s-core.dtsi | 142 ++++++++++++ - arch/arm/dts/sun6i-a31s-sina31s.dts | 153 +++++++++++++ - .../arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts | 205 +++++++++++++++++ - arch/arm/dts/sun7i-a20-bananapi.dts | 78 ++++++- - arch/arm/dts/sun7i-a20-cubieboard2.dts | 23 ++ - arch/arm/dts/sun7i-a20-cubietruck.dts | 4 + - arch/arm/dts/sun7i-a20-icnova-swac.dts | 169 ++++++++++++++ - arch/arm/dts/sun7i-a20-itead-ibox.dts | 125 +++++++++++ - arch/arm/dts/sun7i-a20-lamobo-r1.dts | 10 - - arch/arm/dts/sun7i-a20-mk808c.dts | 39 ++++ - arch/arm/dts/sun7i-a20-olimex-som-evb.dts | 95 ++++++-- - arch/arm/dts/sun7i-a20-olinuxino-lime.dts | 12 + - arch/arm/dts/sun7i-a20-olinuxino-lime2.dts | 47 ++++ - arch/arm/dts/sun7i-a20-olinuxino-micro.dts | 6 + - arch/arm/dts/sun7i-a20-orangepi-mini.dts | 33 +++ - arch/arm/dts/sun7i-a20-orangepi.dts | 29 +++ - arch/arm/dts/sun7i-a20-pcduino3-nano.dts | 69 +++++- - arch/arm/dts/sun7i-a20-pcduino3.dts | 58 ++++- - arch/arm/dts/sun7i-a20-wexler-tab7200.dts | 90 +++++++- - arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts | 187 +++++++++++++++- - arch/arm/dts/sun7i-a20.dtsi | 113 +++++++++- - arch/arm/dts/sun8i-a23-a33.dtsi | 71 ++++-- - arch/arm/dts/sun8i-a23-gt90h-v4.dts | 120 +++++++++- - arch/arm/dts/sun8i-a23.dtsi | 25 +++ - arch/arm/dts/sun8i-a33-sinlinx-sina33.dts | 83 ++++++- - arch/arm/dts/sun8i-a33.dtsi | 45 ++++ - arch/arm/dts/sun8i-a83t-cubietruck-plus.dts | 65 ++++++ - arch/arm/dts/sun8i-a83t.dtsi | 125 +++++------ - arch/arm/dts/sun8i-h3-orangepi-pc.dts | 69 ++++++ - arch/arm/dts/sun8i-h3-orangepi-plus.dts | 63 ++++++ - arch/arm/dts/sun8i-h3.dtsi | 189 +++++++++++----- - arch/arm/dts/sun8i-q8-common.dtsi | 96 +++++++- - arch/arm/dts/sun9i-a80-cubieboard4.dts | 36 +++ - arch/arm/dts/sun9i-a80-optimus.dts | 48 ++-- - arch/arm/dts/sun9i-a80.dtsi | 204 +++++++++++++++-- - arch/arm/dts/sunxi-itead-core-common.dtsi | 136 ++++++++++++ - arch/arm/dts/sunxi-q8-common.dtsi | 6 + - 67 files changed, 4351 insertions(+), 497 deletions(-) - create mode 100644 arch/arm/dts/axp22x.dtsi - create mode 100644 arch/arm/dts/sun4i-a10-pcduino2.dts - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s-core.dtsi - create mode 100644 arch/arm/dts/sun6i-a31s-sina31s.dts - create mode 100644 arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts - create mode 100644 arch/arm/dts/sun7i-a20-icnova-swac.dts - create mode 100644 arch/arm/dts/sun7i-a20-itead-ibox.dts - create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus.dts - create mode 100644 arch/arm/dts/sunxi-itead-core-common.dtsi - ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -126,6 +126,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \ - sun4i-a10-mk802ii.dtb \ - sun4i-a10-olinuxino-lime.dtb \ - sun4i-a10-pcduino.dtb \ -+ sun4i-a10-pcduino2.dtb \ - sun4i-a10-pov-protab2-ips9.dtb - dtb-$(CONFIG_MACH_SUN5I) += \ - sun5i-a10s-auxtek-t003.dtb \ -@@ -155,7 +156,9 @@ dtb-$(CONFIG_MACH_SUN6I) += \ - sun6i-a31-pangolin.dtb \ - sun6i-a31s-cs908.dtb \ - sun6i-a31s-primo81.dtb \ -- sun6i-a31s-sinovoip-bpi-m2.dtb -+ sun6i-a31s-sina31s.dtb \ -+ sun6i-a31s-sinovoip-bpi-m2.dtb \ -+ sun6i-a31s-yones-toptech-bs1078-v2.dtb - dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-ainol-aw1.dtb \ - sun7i-a20-bananapi.dtb \ -@@ -164,6 +167,8 @@ dtb-$(CONFIG_MACH_SUN7I) += \ - sun7i-a20-cubietruck.dtb \ - sun7i-a20-hummingbird.dtb \ - sun7i-a20-i12-tvbox.dtb \ -+ sun7i-a20-icnova-swac.dtb \ -+ sun7i-a20-itead-ibox.dtb \ - sun7i-a20-lamobo-r1.dtb \ - sun7i-a20-m3.dtb \ - sun7i-a20-m5.dtb \ -@@ -190,6 +195,7 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ - sun8i-a33-sinlinx-sina33.dtb - dtb-$(CONFIG_MACH_SUN8I_A83T) += \ - sun8i-a83t-allwinner-h8homlet-v2.dtb \ -+ sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-sinovoip-bpi-m3.dtb - dtb-$(CONFIG_MACH_SUN8I_H3) += \ - sun8i-h3-orangepi-pc.dtb \ ---- /dev/null -+++ b/arch/arm/dts/axp22x.dtsi -@@ -0,0 +1,145 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * AXP221/221s/223 Integrated Power Management Chip -+ * http://www.x-powers.com/product/AXP22X.php -+ * http://dl.linux-sunxi.org/AXP/AXP221%20Datasheet%20V1.2%2020130326%20.pdf -+ */ -+ -+&axp22x { -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ -+ regulators { -+ /* Default work frequency for buck regulators */ -+ x-powers,dcdc-freq = <3000>; -+ -+ reg_dcdc1: dcdc1 { -+ regulator-name = "dcdc1"; -+ }; -+ -+ reg_dcdc2: dcdc2 { -+ regulator-name = "dcdc2"; -+ }; -+ -+ reg_dcdc3: dcdc3 { -+ regulator-name = "dcdc3"; -+ }; -+ -+ reg_dcdc4: dcdc4 { -+ regulator-name = "dcdc4"; -+ }; -+ -+ reg_dcdc5: dcdc5 { -+ regulator-name = "dcdc5"; -+ }; -+ -+ reg_dc1sw: dc1sw { -+ regulator-name = "dc1sw"; -+ }; -+ -+ reg_dc5ldo: dc5ldo { -+ regulator-name = "dc5ldo"; -+ }; -+ -+ reg_aldo1: aldo1 { -+ regulator-name = "aldo1"; -+ }; -+ -+ reg_aldo2: aldo2 { -+ regulator-name = "aldo2"; -+ }; -+ -+ reg_aldo3: aldo3 { -+ regulator-name = "aldo3"; -+ }; -+ -+ reg_dldo1: dldo1 { -+ regulator-name = "dldo1"; -+ }; -+ -+ reg_dldo2: dldo2 { -+ regulator-name = "dldo2"; -+ }; -+ -+ reg_dldo3: dldo3 { -+ regulator-name = "dldo3"; -+ }; -+ -+ reg_dldo4: dldo4 { -+ regulator-name = "dldo4"; -+ }; -+ -+ reg_eldo1: eldo1 { -+ regulator-name = "eldo1"; -+ }; -+ -+ reg_eldo2: eldo2 { -+ regulator-name = "eldo2"; -+ }; -+ -+ reg_eldo3: eldo3 { -+ regulator-name = "eldo3"; -+ }; -+ -+ reg_ldo_io0: ldo_io0 { -+ regulator-name = "ldo_io0"; -+ status = "disabled"; -+ }; -+ -+ reg_ldo_io1: ldo_io1 { -+ regulator-name = "ldo_io1"; -+ status = "disabled"; -+ }; -+ -+ reg_rtc_ldo: rtc_ldo { -+ /* RTC_LDO is a fixed, always-on regulator */ -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "rtc_ldo"; -+ }; -+ }; -+}; ---- a/arch/arm/dts/sun4i-a10-a1000.dts -+++ b/arch/arm/dts/sun4i-a10-a1000.dts -@@ -93,6 +93,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -+++ b/arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Chuwi V7 CW0825"; -@@ -78,6 +79,27 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5306de4: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ }; -+}; -+ - &lradc { - vref-supply = <®_vcc3v0>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-cubieboard.dts -+++ b/arch/arm/dts/sun4i-a10-cubieboard.dts -@@ -83,6 +83,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- a/arch/arm/dts/sun4i-a10-gemei-g9.dts -+++ b/arch/arm/dts/sun4i-a10-gemei-g9.dts -@@ -47,6 +47,7 @@ - #include "sunxi-common-regulators.dtsi" - #include - #include -+#include - - / { - model = "Gemei G9 Tablet"; -@@ -64,12 +65,22 @@ - /* - * TODO: - * 2x cameras via CSI -- * bma250 IRQs - * AXP battery management - * NAND - * OTG - * Touchscreen - gt801_2plus1 @ i2c adapter 2 @ 0x48 - */ -+&codec { -+ /* PH15 controls power to external amplifier (ft2012q) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; - - &ehci0 { - status = "okay"; -@@ -85,15 +96,13 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -103,17 +112,13 @@ - bma250@18 { - compatible = "bosch,bma250"; - reg = <0x18>; -- -- /* -- * TODO: interrupt pins: -- * int1 - PH00 -- * int2 - PI10 -- */ -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH00 / EINT0 */ - }; - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_ldo2>; - - status = "okay"; - -@@ -149,6 +154,40 @@ - status = "okay"; - }; - -+&pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet1.dts -+++ b/arch/arm/dts/sun4i-a10-inet1.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "iNet-1"; -@@ -56,11 +57,25 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_inet>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -104,6 +119,19 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5x: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_wake_pin>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* PB13 */ -+ touchscreen-size-x = <600>; -+ touchscreen-size-y = <1024>; -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -151,6 +179,20 @@ - }; - - &pio { -+ bl_en_pin_inet: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_wake_pin: touchscreen_wake_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -166,6 +208,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10-inet97fv2.dts -+++ b/arch/arm/dts/sun4i-a10-inet97fv2.dts -@@ -47,6 +47,8 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include -+#include - - / { - model = "INet-97F Rev 02"; -@@ -61,8 +63,8 @@ - }; - }; - --&ehci0 { -- status = "okay"; -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci1 { -@@ -75,12 +77,71 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -+ }; -+}; -+ -+#include "axp209.dtsi" -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_ldo2>; -+ status = "okay"; -+ -+ button@200 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <200000>; -+ }; -+ -+ button@600 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; - -- interrupt-controller; -- #interrupt-cells = <1>; -+ button@800 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@1000 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1000000>; -+ }; -+ -+ button@1200 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1200000>; - }; - }; - -@@ -94,15 +155,52 @@ - status = "okay"; - }; - --&ohci0 { -+&otg_sram { - status = "okay"; - }; - --&ohci1 { -- status = "okay"; -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb1_vbus { -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1250000>; -+ regulator-max-microvolt = <1250000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { - status = "okay"; - }; - -@@ -116,8 +214,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -+++ b/arch/arm/dts/sun4i-a10-inet9f-rev03.dts -@@ -59,6 +59,159 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ gpio_keys { -+ compatible = "gpio-keys-polled"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&key_pins_inet9f>; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ poll-interval = <20>; -+ -+ button@0 { -+ label = "Left Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */ -+ }; -+ -+ button@1 { -+ label = "Left Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */ -+ }; -+ -+ button@2 { -+ label = "Left Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */ -+ }; -+ -+ button@3 { -+ label = "Left Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */ -+ }; -+ -+ button@4 { -+ label = "Right Joystick Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */ -+ }; -+ -+ button@5 { -+ label = "Right Joystick Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */ -+ }; -+ -+ button@6 { -+ label = "Right Joystick Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */ -+ }; -+ -+ button@7 { -+ label = "Right Joystick Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */ -+ }; -+ -+ button@8 { -+ label = "DPad Left"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */ -+ }; -+ -+ button@9 { -+ label = "DPad Right"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */ -+ }; -+ -+ button@10 { -+ label = "DPad Up"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <0xffffffff>; /* -1 */ -+ gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */ -+ }; -+ -+ button@11 { -+ label = "DPad Down"; -+ linux,code = ; -+ linux,input-type = ; -+ linux,input-value = <1>; -+ gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */ -+ }; -+ -+ button@12 { -+ label = "Button X"; -+ linux,code = ; -+ gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */ -+ }; -+ -+ button@13 { -+ label = "Button Y"; -+ linux,code = ; -+ gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */ -+ }; -+ -+ button@14 { -+ label = "Button A"; -+ linux,code = ; -+ gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */ -+ }; -+ -+ button@15 { -+ label = "Button B"; -+ linux,code = ; -+ gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */ -+ }; -+ -+ button@16 { -+ label = "Select Button"; -+ linux,code = ; -+ gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */ -+ }; -+ -+ button@17 { -+ label = "Start Button"; -+ linux,code = ; -+ gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */ -+ }; -+ -+ button@18 { -+ label = "Top Left Button"; -+ linux,code = ; -+ gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */ -+ }; -+ -+ button@19 { -+ label = "Top Right Button"; -+ linux,code = ; -+ gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */ -+ }; -+ }; - }; - - &cpu0 { -@@ -86,12 +239,29 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ ft5406ee8: touchscreen@38 { -+ compatible = "edt,edt-ft5406"; -+ reg = <0x38>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; -+ touchscreen-size-x = <800>; -+ touchscreen-size-y = <480>; -+ }; - }; - - &lradc { -@@ -149,6 +319,17 @@ - }; - - &pio { -+ key_pins_inet9f: key_pins@0 { -+ allwinner,pins = "PA0", "PA1", "PA3", "PA4", -+ "PA5", "PA6", "PA8", "PA9", -+ "PA11", "PA12", "PA13", -+ "PA14", "PA15", "PA16", "PA17", -+ "PH22", "PH23", "PH24", "PH25", "PH26"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; ---- a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -+++ b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 Josef Gajdusek -+ * Copyright 2015 - Marcus Cooper - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -42,22 +43,11 @@ - - /dts-v1/; - #include "sun4i-a10.dtsi" --#include "sunxi-common-regulators.dtsi" -- --#include --#include -+#include "sunxi-itead-core-common.dtsi" - - / { - model = "Iteaduino Plus A10"; - compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10"; -- -- aliases { -- serial0 = &uart0; -- }; -- -- chosen { -- stdout-path = "serial0:115200n8"; -- }; - }; - - &ahci { -@@ -65,18 +55,6 @@ - status = "okay"; - }; - --&cpu0 { -- cpu-supply = <®_dcdc2>; --}; -- --&ehci0 { -- status = "okay"; --}; -- --&ehci1 { -- status = "okay"; --}; -- - &emac { - pinctrl-names = "default"; - pinctrl-0 = <&emac_pins_a>; -@@ -89,12 +67,7 @@ - }; - - &i2c0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c0_pins_a>; -- status = "okay"; -- - axp209: pmic@34 { -- reg = <0x34>; - interrupts = <0>; - }; - }; -@@ -135,68 +108,13 @@ - status = "okay"; - }; - --&ohci0 { -- status = "okay"; --}; -- --&ohci1 { -- status = "okay"; --}; -- - ®_ahci_5v { - status = "okay"; - }; - --#include "axp209.dtsi" -- --®_dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1450000>; -- regulator-name = "vdd-cpu"; --}; -- --®_dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1400000>; -- regulator-name = "vdd-int-dll"; --}; -- --®_ldo1 { -- regulator-name = "vdd-rtc"; --}; -- --®_ldo2 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; --}; -- --®_usb1_vbus { -- status = "okay"; --}; -- --®_usb2_vbus { -- status = "okay"; --}; -- - &spi0 { - pinctrl-names = "default"; - pinctrl-0 = <&spi0_pins_a>, - <&spi0_cs0_pins_a>; - status = "okay"; - }; -- --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -- status = "okay"; --}; -- --&usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -- status = "okay"; --}; ---- a/arch/arm/dts/sun4i-a10-jesurun-q5.dts -+++ b/arch/arm/dts/sun4i-a10-jesurun-q5.dts -@@ -156,6 +156,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - emac_power_pin_q5: emac_power_pin@0 { - allwinner,pins = "PH19"; -@@ -172,6 +176,11 @@ - }; - }; - -+®_usb0_vbus { -+ regulator-boot-on; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -186,7 +195,13 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ - &usbphy { -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-marsboard.dts -+++ b/arch/arm/dts/sun4i-a10-marsboard.dts -@@ -91,6 +91,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -154,6 +158,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_marsboard: led_pins@0 { - allwinner,pins = "PB5", "PB6", "PB7", "PB8"; -@@ -161,6 +169,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb1_vbus { -@@ -184,7 +199,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-mk802.dts -+++ b/arch/arm/dts/sun4i-a10-mk802.dts -@@ -44,6 +44,7 @@ - #include "sun4i-a10.dtsi" - #include "sunxi-common-regulators.dtsi" - #include -+#include - - / { - model = "MK802"; -@@ -58,6 +59,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -80,7 +85,25 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb2_vbus_pin_mk802: usb2_vbus_pin@0 { - allwinner,pins = "PH12"; - allwinner,function = "gpio_out"; -@@ -89,6 +112,10 @@ - }; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -105,7 +132,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -+++ b/arch/arm/dts/sun4i-a10-olinuxino-lime.dts -@@ -124,6 +124,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mdio { - status = "okay"; - ---- a/arch/arm/dts/sun4i-a10-pcduino.dts -+++ b/arch/arm/dts/sun4i-a10-pcduino.dts -@@ -104,6 +104,10 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -129,12 +133,8 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupts = <0>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -164,6 +164,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -178,14 +182,40 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - --®_usb1_vbus { -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; - }; - --®_usb2_vbus { -- status = "okay"; -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - - &uart0 { -@@ -194,8 +224,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -- usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb1_vbus-supply = <®_vcc5v0>; /* USB1 VBUS is always on */ -+ usb2_vbus-supply = <®_vcc5v0>; /* USB2 VBUS is always on */ - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun4i-a10-pcduino2.dts -@@ -0,0 +1,78 @@ -+/* -+ * Copyright 2015 Siarhei Siamashka -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* -+ * The LinkSprite pcDuino2 board is almost identical to the older -+ * LinkSprite pcDuino1 board. The only software visible difference -+ * is that the pcDuino2 board got a USB VBUS voltage regulator, which -+ * is controlled by the PD2 pin (pulled-up by default). Also one of -+ * the USB host ports has been replaced with a USB WIFI chip. -+ */ -+ -+#include "sun4i-a10-pcduino.dts" -+ -+/ { -+ model = "LinkSprite pcDuino2"; -+ compatible = "linksprite,a10-pcduino2", "allwinner,sun4i-a10"; -+}; -+ -+&pio { -+ usb2_vbus_pin_pcduino2: usb2_vbus_pin@0 { -+ allwinner,pins = "PD2"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb2_vbus { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb2_vbus_pin_pcduino2>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_vcc3v3>; /* USB WIFI is always on */ -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -+++ b/arch/arm/dts/sun4i-a10-pov-protab2-ips9.dts -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - - / { - model = "Point of View Protab2-IPS9"; -@@ -56,11 +57,28 @@ - serial0 = &uart0; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_protab>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,12 +104,36 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ /* Accelerometer */ -+ bma250@18 { -+ compatible = "bosch,bma250"; -+ reg = <0x18>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */ -+ }; - }; - - &i2c2 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ pixcir_ts@5c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&touchscreen_pins>; -+ compatible = "pixcir,pixcir_tangoc"; -+ reg = <0x5c>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ attb-gpio = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* PH21 */ -+ enable-gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; -+ wake-gpios = <&pio 1 13 GPIO_ACTIVE_LOW>; -+ touchscreen-size-x = <1024>; -+ touchscreen-size-y = <768>; -+ touchscreen-inverted-x; -+ touchscreen-inverted-y; -+ }; - }; - - &lradc { -@@ -128,6 +170,27 @@ - }; - - &pio { -+ bl_en_pin_protab: bl_en_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ touchscreen_pins: touchscreen_pins@0 { -+ allwinner,pins = "PA5", "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { - allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; -@@ -143,6 +206,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun4i-a10.dtsi -+++ b/arch/arm/dts/sun4i-a10.dtsi -@@ -45,6 +45,7 @@ - - #include - -+#include - #include - #include - -@@ -65,7 +66,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -74,7 +75,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -83,7 +85,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -- <&ahb_gates 46>; -+ <&ahb_gates 46>, <&dram_gates 25>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -92,7 +95,8 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_fe0-de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>, <&ahb_gates 46>; -+ <&ahb_gates 44>, <&ahb_gates 46>, -+ <&dram_gates 25>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -195,6 +199,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -241,6 +254,7 @@ - compatible = "allwinner,sun4i-a10-axi-gates-clk"; - reg = <0x01c2005c 0x4>; - clocks = <&axi>; -+ clock-indices = <0>; - clock-output-names = "axi_dram"; - }; - -@@ -257,17 +271,36 @@ - compatible = "allwinner,sun4i-a10-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, <6>, -+ <7>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, -+ <21>, <22>, <23>, -+ <24>, <25>, <26>, -+ <32>, <33>, <34>, -+ <35>, <36>, <37>, -+ <40>, <41>, <43>, -+ <44>, <45>, -+ <46>, <47>, -+ <50>, <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", -- "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", "ahb_ss", -- "ahb_dma", "ahb_bist", "ahb_mmc0", "ahb_mmc1", -- "ahb_mmc2", "ahb_mmc3", "ahb_ms", "ahb_nand", -- "ahb_sdram", "ahb_ace", "ahb_emac", "ahb_ts", -- "ahb_spi0", "ahb_spi1", "ahb_spi2", "ahb_spi3", -- "ahb_pata", "ahb_sata", "ahb_gps", "ahb_ve", -- "ahb_tvd", "ahb_tve0", "ahb_tve1", "ahb_lcd0", -- "ahb_lcd1", "ahb_csi0", "ahb_csi1", "ahb_hdmi", -- "ahb_de_be0", "ahb_de_be1", "ahb_de_fe0", -- "ahb_de_fe1", "ahb_mp", "ahb_mali400"; -+ "ahb_ohci0", "ahb_ehci1", -+ "ahb_ohci1", "ahb_ss", "ahb_dma", -+ "ahb_bist", "ahb_mmc0", "ahb_mmc1", -+ "ahb_mmc2", "ahb_mmc3", "ahb_ms", -+ "ahb_nand", "ahb_sdram", "ahb_ace", -+ "ahb_emac", "ahb_ts", "ahb_spi0", -+ "ahb_spi1", "ahb_spi2", "ahb_spi3", -+ "ahb_pata", "ahb_sata", "ahb_gps", -+ "ahb_ve", "ahb_tvd", "ahb_tve0", -+ "ahb_tve1", "ahb_lcd0", "ahb_lcd1", -+ "ahb_csi0", "ahb_csi1", "ahb_hdmi", -+ "ahb_de_be0", "ahb_de_be1", -+ "ahb_de_fe0", "ahb_de_fe1", -+ "ahb_mp", "ahb_mali400"; - }; - - apb0: apb0@01c20054 { -@@ -283,9 +316,14 @@ - compatible = "allwinner,sun4i-a10-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <5>, <6>, -+ <7>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", -- "apb0_ac97", "apb0_iis", "apb0_pio", "apb0_ir0", -- "apb0_ir1", "apb0_keypad"; -+ "apb0_ac97", "apb0_iis", -+ "apb0_pio", "apb0_ir0", -+ "apb0_ir1", "apb0_keypad"; - }; - - apb1: clk@01c20058 { -@@ -301,12 +339,22 @@ - compatible = "allwinner,sun4i-a10-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, -+ <5>, <6>, -+ <7>, <16>, -+ <17>, <18>, -+ <19>, <20>, -+ <21>, <22>, -+ <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", -- "apb1_i2c2", "apb1_can", "apb1_scr", -- "apb1_ps20", "apb1_ps21", "apb1_uart0", -- "apb1_uart1", "apb1_uart2", "apb1_uart3", -- "apb1_uart4", "apb1_uart5", "apb1_uart6", -- "apb1_uart7"; -+ "apb1_i2c2", "apb1_can", -+ "apb1_scr", "apb1_ps20", -+ "apb1_ps21", "apb1_uart0", -+ "apb1_uart1", "apb1_uart2", -+ "apb1_uart3", "apb1_uart4", -+ "apb1_uart5", "apb1_uart6", -+ "apb1_uart7"; - }; - - nand_clk: clk@01c20080 { -@@ -446,6 +494,48 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5 1>; - clock-output-names = "spi3"; - }; -+ -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; - }; - - soc@01c00000 { -@@ -656,6 +746,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = <86>; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -961,6 +1059,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -+++ b/arch/arm/dts/sun5i-a10s-auxtek-t004.dts -@@ -86,6 +86,20 @@ - status = "okay"; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp152: pmic@30 { -+ compatible = "x-powers,axp152"; -+ reg = <0x30>; -+ interrupts = <0>; -+ interrupt-controller; -+ #interrupt-cells = <1>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t004>; ---- a/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -+++ b/arch/arm/dts/sun5i-a10s-olinuxino-micro.dts -@@ -111,7 +111,7 @@ - status = "okay"; - - at24@50 { -- compatible = "at,24c16"; -+ compatible = "atmel,24c16"; - pagesize = <16>; - reg = <0x50>; - read-only; ---- a/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -+++ b/arch/arm/dts/sun5i-a13-empire-electronix-d709.dts -@@ -123,7 +123,7 @@ - - &mmc0 { - pinctrl-names = "default"; -- pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_inet98fv2>; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_d709>; - vmmc-supply = <®_vcc3v3>; - bus-width = <4>; - cd-gpios = <&pio 6 0 GPIO_ACTIVE_HIGH>; /* PG0 */ -@@ -131,27 +131,12 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; - - &pio { -- mmc0_cd_pin_inet98fv2: mmc0_cd_pin@0 { -+ mmc0_cd_pin_d709: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; - allwinner,drive = ; ---- a/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -+++ b/arch/arm/dts/sun5i-a13-inet-98v-rev2.dts -@@ -123,21 +123,6 @@ - status = "okay"; - }; - --&mmc2 { -- pinctrl-names = "default"; -- pinctrl-0 = <&mmc2_pins_a>; -- vmmc-supply = <®_vcc3v3>; -- bus-width = <8>; -- non-removable; -- status = "okay"; -- -- mmccard: mmccard@0 { -- reg = <0>; -- compatible = "mmc-card"; -- broken-hpi; -- }; --}; -- - &otg_sram { - status = "okay"; - }; -@@ -201,11 +186,6 @@ - status = "okay"; - }; - --®_usb1_vbus { -- gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ -- status = "okay"; --}; -- - &uart1 { - pinctrl-names = "default"; - pinctrl-0 = <&uart1_pins_b>; -@@ -221,16 +201,12 @@ - allwinner,pins = "PG12"; - }; - --&usb1_vbus_pin_a { -- allwinner,pins = "PG11"; --}; -- - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; - usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */ - usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */ - usb0_vbus-supply = <®_usb0_vbus>; -- usb1_vbus-supply = <®_usb1_vbus>; -+ usb1_vbus-supply = <®_ldo3>; - status = "okay"; - }; ---- a/arch/arm/dts/sun5i-a13-utoo-p66.dts -+++ b/arch/arm/dts/sun5i-a13-utoo-p66.dts -@@ -47,11 +47,21 @@ - #include - #include - #include -+#include - - / { - model = "Utoo P66"; - compatible = "utoo,p66", "allwinner,sun5i-a13"; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ /* Note levels of 10 / 20% result in backlight off */ -+ brightness-levels = <0 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <6>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - i2c_lcd: i2c@0 { - /* The lcd panel i2c interface is hooked up via gpios */ - compatible = "i2c-gpio"; -@@ -63,6 +73,13 @@ - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 6 3 GPIO_ACTIVE_HIGH>; /* PG3 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -158,6 +175,13 @@ - }; - - &pio { -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PG3"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_p66: mmc0_cd_pin@0 { - allwinner,pins = "PG0"; - allwinner,function = "gpio_in"; -@@ -201,6 +225,12 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; ---- a/arch/arm/dts/sun5i-q8-common.dtsi -+++ b/arch/arm/dts/sun5i-q8-common.dtsi -@@ -41,11 +41,21 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &uart1; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ /* TODO: backlight uses axp gpio1 as enable pin */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; ---- a/arch/arm/dts/sun5i-r8-chip.dts -+++ b/arch/arm/dts/sun5i-r8-chip.dts -@@ -64,6 +64,26 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ wifi_reg_on: wifi_reg_on { -+ compatible = "regulator-fixed"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&chip_wifi_reg_on_pin>; -+ -+ regulator-name = "wifi-reg-on"; -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; /* PC19 */ -+ enable-active-high; -+ }; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -109,10 +129,14 @@ - }; - }; - -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>; -- vmmc-supply = <®_vcc3v3>; -+ vmmc-supply = <&wifi_reg_on>; - bus-width = <4>; - non-removable; - status = "okay"; -@@ -134,6 +158,13 @@ - allwinner,pull = ; - }; - -+ chip_wifi_reg_on_pin: chip_wifi_reg_on_pin@0 { -+ allwinner,pins = "PC19"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - chip_id_det_pin: chip_id_det_pin@0 { - allwinner,pins = "PG2"; - allwinner,function = "gpio_in"; -@@ -167,6 +198,20 @@ - regulator-always-on; - }; - -+®_ldo3 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi1"; -+ regulator-always-on; -+}; -+ -+®_ldo4 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vdd-wifi2"; -+ regulator-always-on; -+}; -+ - ®_ldo5 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; ---- a/arch/arm/dts/sun5i.dtsi -+++ b/arch/arm/dts/sun5i.dtsi -@@ -44,6 +44,7 @@ - - #include "skeleton.dtsi" - -+#include - #include - #include - -@@ -102,6 +103,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun5i-a13-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-pll1-clk"; -@@ -285,6 +295,14 @@ - clock-output-names = "usb_ohci0", "usb_phy"; - }; - -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -571,6 +589,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = <30>; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun4i-a10-sid"; - reg = <0x01c23800 0x10>; ---- a/arch/arm/dts/sun6i-a31-colombus.dts -+++ b/arch/arm/dts/sun6i-a31-colombus.dts -@@ -60,6 +60,16 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ i2c_lcd: i2c@0 { -+ /* The lcd panel i2c interface is hooked up via gpios */ -+ compatible = "i2c-gpio"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c_lcd_pins>; -+ gpios = <&pio 0 23 GPIO_ACTIVE_HIGH>, /* PA23, sda */ -+ <&pio 0 24 GPIO_ACTIVE_HIGH>; /* PA24, scl */ -+ i2c-gpio,delay-us = <5>; -+ }; - }; - - &ehci1 { -@@ -94,6 +104,13 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ mma8452: mma8452@1d { -+ compatible = "fsl,mma8452"; -+ reg = <0x1d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_LOW>; /* PA9 */ -+ }; - }; - - &mmc0 { -@@ -124,6 +141,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ i2c_lcd_pins: i2c_lcd_pin@0 { -+ allwinner,pins = "PA23", "PA24"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_usb2_vbus { ---- a/arch/arm/dts/sun6i-a31-hummingbird.dts -+++ b/arch/arm/dts/sun6i-a31-hummingbird.dts -@@ -54,6 +54,8 @@ - compatible = "merrii,a31-hummingbird", "allwinner,sun6i-a31"; - - aliases { -+ rtc0 = &pcf8563; -+ rtc1 = &rtc; - serial0 = &uart0; - }; - -@@ -67,13 +69,17 @@ - }; - }; - -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ - &ehci0 { - status = "okay"; - }; - - &gmac { - pinctrl-names = "default"; -- pinctrl-0 = <&gmac_pins_rgmii_a>; -+ pinctrl-0 = <&gmac_pins_rgmii_a>, <&gmac_phy_reset_pin_hummingbird>; - phy = <&phy1>; - phy-mode = "rgmii"; - snps,reset-gpio = <&pio 0 21 GPIO_ACTIVE_HIGH>; -@@ -119,7 +125,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_hummingbird>; -- vmmc-supply = <&vcc_3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ - cd-inverted; -@@ -134,7 +140,7 @@ - &mmc1 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc1_pins_a>, <&wifi_reset_pin_hummingbird>; -- vmmc-supply = <&vcc_wifi>; -+ vmmc-supply = <®_aldo1>; - mmc-pwrseq = <&wifi_pwrseq>; - bus-width = <4>; - non-removable; -@@ -146,6 +152,13 @@ - }; - - &pio { -+ gmac_phy_reset_pin_hummingbird: gmac_phy_reset_pin@0 { -+ allwinner,pins = "PA21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_hummingbird: mmc0_cd_pin@0 { - allwinner,pins = "PA8"; - allwinner,function = "gpio_in"; -@@ -164,70 +177,69 @@ - &p2wi { - status = "okay"; - -- axp221: pmic@68 { -+ axp22x: pmic@68 { - compatible = "x-powers,axp221"; - reg = <0x68>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- interrupt-controller; -- #interrupt-cells = <1>; -- dcdc1-supply = <&vcc_3v0>; -- dcdc5-supply = <&vcc_dram>; -- -- regulators { -- x-powers,dcdc-freq = <3000>; -- -- vcc_3v0: dcdc1 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "vcc-3v0"; -- }; -- -- vdd_cpu: dcdc2 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-cpu"; -- }; -- -- vdd_gpu: dcdc3 { -- regulator-always-on; -- regulator-min-microvolt = <700000>; -- regulator-max-microvolt = <1320000>; -- regulator-name = "vdd-gpu"; -- }; -- -- vdd_sys_dll: dcdc4 { -- regulator-always-on; -- regulator-min-microvolt = <1100000>; -- regulator-max-microvolt = <1100000>; -- regulator-name = "vdd-sys-dll"; -- }; -- -- vcc_dram: dcdc5 { -- regulator-always-on; -- regulator-min-microvolt = <1500000>; -- regulator-max-microvolt = <1500000>; -- regulator-name = "vcc-dram"; -- }; -- -- vcc_wifi: aldo1 { -- regulator-min-microvolt = <3300000>; -- regulator-max-microvolt = <3300000>; -- regulator-name = "vcc_wifi"; -- }; -- -- avcc: aldo3 { -- regulator-always-on; -- regulator-min-microvolt = <3000000>; -- regulator-max-microvolt = <3000000>; -- regulator-name = "avcc"; -- }; -- }; - }; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ - ®_usb1_vbus { - gpio = <&pio 7 24 GPIO_ACTIVE_HIGH>; /* PH24 */ - status = "okay"; ---- a/arch/arm/dts/sun6i-a31.dtsi -+++ b/arch/arm/dts/sun6i-a31.dtsi -@@ -61,7 +61,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_hdmi: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; -@@ -69,7 +69,7 @@ - status = "disabled"; - }; - -- framebuffer@1 { -+ simplefb_lcd: framebuffer@1 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -252,6 +252,20 @@ - compatible = "allwinner,sun6i-a31-ahb1-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <11>, <12>, -+ <13>, <14>, -+ <17>, <18>, <19>, -+ <20>, <21>, <22>, -+ <23>, <24>, <26>, -+ <27>, <29>, -+ <30>, <31>, <32>, -+ <36>, <37>, <40>, -+ <43>, <44>, <45>, -+ <46>, <47>, <50>, -+ <52>, <55>, <56>, -+ <57>, <58>; - clock-output-names = "ahb1_mipidsi", "ahb1_ss", - "ahb1_dma", "ahb1_mmc0", "ahb1_mmc1", - "ahb1_mmc2", "ahb1_mmc3", "ahb1_nand1", -@@ -281,6 +295,9 @@ - compatible = "allwinner,sun6i-a31-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <4>, -+ <5>, <12>, -+ <13>; - clock-output-names = "apb1_codec", "apb1_digital_mic", - "apb1_pio", "apb1_daudio0", - "apb1_daudio1"; -@@ -299,6 +316,10 @@ - compatible = "allwinner,sun6i-a31-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <16>, -+ <17>, <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_i2c3", - "apb2_uart0", "apb2_uart1", -@@ -346,6 +367,14 @@ - "mmc3_sample"; - }; - -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - spi0_clk: clk@01c200a0 { - #clock-cells = <0>; - compatible = "allwinner,sun4i-a10-mod0-clk"; -@@ -384,6 +413,9 @@ - compatible = "allwinner,sun6i-a31-usb-clk"; - reg = <0x01c200cc 0x4>; - clocks = <&osc24M>; -+ clock-indices = <8>, <9>, <10>, -+ <16>, <17>, -+ <18>; - clock-output-names = "usb_phy0", "usb_phy1", "usb_phy2", - "usb_ohci0", "usb_ohci1", - "usb_ohci2"; -@@ -684,6 +716,16 @@ - allwinner,pull = ; - }; - -+ mmc3_8bit_emmc_pins: mmc3@1 { -+ allwinner,pins = "PC6", "PC7", "PC8", "PC9", -+ "PC10", "PC11", "PC12", -+ "PC13", "PC14", "PC15", -+ "PC24"; -+ allwinner,function = "mmc3"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - gmac_pins_mii_a: gmac_mii@0 { - allwinner,pins = "PA0", "PA1", "PA2", "PA3", - "PA8", "PA9", "PA11", -@@ -761,6 +803,13 @@ - reg = <0x01c20ca0 0x20>; - }; - -+ lradc: lradc@01c22800 { -+ compatible = "allwinner,sun4i-a10-lradc-keys"; -+ reg = <0x01c22800 0x100>; -+ interrupts = ; -+ status = "disabled"; -+ }; -+ - rtp: rtp@01c25000 { - compatible = "allwinner,sun6i-a31-ts"; - reg = <0x01c25000 0x100>; -@@ -907,6 +956,16 @@ - #size-cells = <0>; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - timer@01c60000 { - compatible = "allwinner,sun6i-a31-hstimer", - "allwinner,sun7i-a20-hstimer"; -@@ -1068,7 +1127,7 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - ---- a/arch/arm/dts/sun6i-a31s-primo81.dts -+++ b/arch/arm/dts/sun6i-a31s-primo81.dts -@@ -1,16 +1,57 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2014 Siarhei Siamashka -+ * Copyright 2015 Karsten Merker -+ * Copyright 2015 Chen-Yu Tsai - * -- * Minimal dts file for the MSI Primo81 for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { -- model = "MSI Primo81"; -+ model = "MSI Primo81 tablet"; - compatible = "msi,primo81", "allwinner,sun6i-a31s"; - - aliases { -@@ -22,8 +63,202 @@ - }; - }; - --&uart0 { -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+&ehci0 { -+ /* rtl8188etv wifi is connected here */ -+ status = "okay"; -+}; -+ -+&i2c0 { -+ /* pull-ups and device VDDIO use AXP221 DLDO3 */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "failed"; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ ctp@5d { -+ pinctrl-names = "default"; -+ pinctrl-0 = <>911_int_primo81>; -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 3 IRQ_TYPE_LEVEL_HIGH>; /* PA3 */ -+ touchscreen-swapped-x-y; -+ }; -+}; -+ -+&i2c2 { - pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+ -+ accelerometer@1c { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mma8452_int_primo81>; -+ compatible = "fsl,mma8452"; -+ reg = <0x1c>; -+ interrupt-parent = <&pio>; -+ interrupts = <0 9 IRQ_TYPE_LEVEL_HIGH>; /* PA9 */ -+ #io-channel-cells = <1>; -+ }; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_primo81>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ gt911_int_primo81: gt911_int_pin@0 { -+ allwinner,pins = "PA3"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mma8452_int_primo81: mma8452_int_pin@0 { -+ allwinner,pins = "PA9"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_primo81: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; /* This is an educated guess */ -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+®_eldo3 { -+ regulator-min-microvolt = <1080000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-mipi-bridge"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+ vdd-mipi-bridge-supply = <®_eldo3>; -+}; -+ -+&usb_otg { -+ /* otg support requires support for AXP221 usb-power-supply and GPIO */ -+ dr_mode = "host"; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s-core.dtsi -@@ -0,0 +1,142 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Core Board"; -+ compatible = "sinlinx,sina31s", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc3>; -+}; -+ -+/* eMMC on core board */ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_8bit_emmc_pins>; -+ vmmc-supply = <®_dcdc1>; -+ vqmmc-supply = <®_dcdc1>; -+ bus-width = <8>; -+ non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+/* AXP221s PMIC on core board */ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+/* UART0 pads available on core board */ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-sina31s.dts -@@ -0,0 +1,153 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/* The SinA31s development board has the SinA31s core board soldered on */ -+#include "sun6i-a31s-sina31s-core.dtsi" -+ -+#include -+ -+/ { -+ model = "Sinlinx SinA31s Development Board"; -+ compatible = "sinlinx,sina31s-sdk", "allwinner,sun6i-a31s"; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pin_sina31s>; -+ -+ status { -+ label = "sina31s:status:usr"; -+ gpios = <&pio 7 13 GPIO_ACTIVE_HIGH>; /* PH13 */ -+ }; -+ }; -+}; -+ -+&ehci0 { -+ /* USB 2.0 4 port hub IC */ -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ phy-supply = <®_dldo1>; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ -+&lradc { -+ vref-supply = <®_aldo3>; -+ status = "okay"; -+ -+ button@158 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <158730>; -+ }; -+ -+ button@349 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <349206>; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina31s>; -+ vmmc-supply = <®_dcdc1>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 4 GPIO_ACTIVE_HIGH>; /* PA4 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ led_pin_sina31s: led_pin@0 { -+ allwinner,pins = "PH13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ mmc0_cd_pin_sina31s: mmc0_cd_pin@0 { -+ allwinner,pins = "PA4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-gmac-phy"; -+}; -+ -+&usbphy { -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun6i-a31s-yones-toptech-bs1078-v2.dts -@@ -0,0 +1,205 @@ -+/* -+ * Copyright 2015 Lawrence Yu -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun6i-a31s.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+ -+/ { -+ model = "Yones TopTech BS1078 v2 Tablet"; -+ compatible = "yones-toptech,bs1078-v2", "allwinner,sun6i-a31s"; -+ -+ aliases { -+ serial0 = &uart0; -+ i2c1 = &i2c1; -+ i2c2 = &i2c2; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+&pio { -+ mmc0_cd_pin_bs1078v2: mmc0_cd_pin@0 { -+ allwinner,pins = "PA8"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_bs1078v2>; -+ vmmc-supply = <®_vcc3v0>; -+ bus-width = <4>; -+ cd-gpios = <&pio 0 8 GPIO_ACTIVE_HIGH>; /* PA8 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc0_pins_a { -+ allwinner,pull = ; -+}; -+ -+&p2wi { -+ status = "okay"; -+ -+ axp22x: pmic@68 { -+ compatible = "x-powers,axp221"; -+ reg = <0x68>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd-usb2"; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+}; -+ -+®_dc5ldo { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-gpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc4 { -+ regulator-always-on; -+ regulator-min-microvolt = <700000>; -+ regulator-max-microvolt = <1320000>; -+ regulator-name = "vdd-sys-dll"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+/* Voltage source for I2C pullup resistors for I2C Bus 0 */ -+®_dldo3 { -+ regulator-min-microvolt = <2800000>; -+ regulator-max-microvolt = <2800000>; -+ regulator-name = "vddio-csi"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_dldo1>; -+ usb2_vbus-supply = <®_dc1sw>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-bananapi.dts -+++ b/arch/arm/dts/sun7i-a20-bananapi.dts -@@ -92,6 +92,24 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+ operating-points = < -+ /* kHz uV */ -+ 960000 1400000 -+ 912000 1400000 -+ 864000 1350000 -+ 720000 1250000 -+ 528000 1150000 -+ 312000 1100000 -+ 144000 1050000 -+ >; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -119,13 +137,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -159,7 +173,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_bananapi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -182,6 +207,37 @@ - }; - }; - -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -216,7 +272,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubieboard2.dts -+++ b/arch/arm/dts/sun7i-a20-cubieboard2.dts -@@ -84,6 +84,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -150,6 +154,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_cubieboard2: led_pins@0 { - allwinner,pins = "PH20", "PH21"; -@@ -157,12 +165,24 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - #include "axp209.dtsi" - - ®_dcdc2 { -@@ -205,6 +225,9 @@ - }; - - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-cubietruck.dts -+++ b/arch/arm/dts/sun7i-a20-cubietruck.dts -@@ -101,6 +101,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-icnova-swac.dts -@@ -0,0 +1,169 @@ -+/* -+ * Copyright 2015 Stefan Roese -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include -+ -+/ { -+ model = "ICnova-A20 SWAC"; -+ compatible = "swac,icnova-a20-swac", "incircuit,icnova-a20", "allwinner,sun7i-a20"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; /* PI5 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- /dev/null -+++ b/arch/arm/dts/sun7i-a20-itead-ibox.dts -@@ -0,0 +1,125 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun7i-a20.dtsi" -+#include "sunxi-itead-core-common.dtsi" -+ -+/ { -+ model = "Itead Ibox A20"; -+ compatible = "itead,itead-ibox-a20", "allwinner,sun7i-a20"; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_itead_core>; -+ -+ green { -+ label = "itead_core:green:usr"; -+ gpios = <&pio 7 20 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ -+ blue { -+ label = "itead_core:blue:usr"; -+ gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+}; -+ -+&ahci { -+ target-supply = <®_ahci_5v>; -+ status = "okay"; -+}; -+ -+&codec { -+ status = "okay"; -+}; -+ -+&gmac { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&gmac_pins_mii_a>; -+ phy = <&phy1>; -+ phy-mode = "mii"; -+ status = "okay"; -+ -+ phy1: ethernet-phy@1 { -+ reg = <1>; -+ }; -+}; -+ -+&i2c0 { -+ axp209: pmic@34 { -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&ir0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir0_rx_pins_a>; -+ status = "okay"; -+}; -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&pio { -+ led_pins_itead_core: led_pins@0 { -+ allwinner,pins = "PH20","PH21"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_ahci_5v { -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20-lamobo-r1.dts -+++ b/arch/arm/dts/sun7i-a20-lamobo-r1.dts -@@ -97,16 +97,6 @@ - - &cpu0 { - cpu-supply = <®_dcdc2>; -- operating-points = < -- /* kHz uV */ -- 960000 1400000 -- 912000 1400000 -- 864000 1350000 -- 720000 1250000 -- 528000 1150000 -- 312000 1100000 -- 144000 1050000 -- >; - }; - - &ehci0 { ---- a/arch/arm/dts/sun7i-a20-mk808c.dts -+++ b/arch/arm/dts/sun7i-a20-mk808c.dts -@@ -53,6 +53,7 @@ - - #include - #include -+#include - - / { - model = "mk808c"; -@@ -68,6 +69,10 @@ - }; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -121,6 +126,30 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -141,7 +170,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -+++ b/arch/arm/dts/sun7i-a20-olimex-som-evb.dts -@@ -1,5 +1,6 @@ - /* - * Copyright 2015 - Marcus Cooper -+ * Copyright 2015 - Karsten Merker - * - * This file is dual-licensed: you can use it either under the terms - * of the GPL or the X11 license, at your option. Note that this dual -@@ -45,6 +46,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - #include - -@@ -71,14 +73,6 @@ - default-state = "on"; - }; - }; -- -- reg_axp_ipsout: axp_ipsout { -- compatible = "regulator-fixed"; -- regulator-name = "axp-ipsout"; -- regulator-min-microvolt = <5000000>; -- regulator-max-microvolt = <5000000>; -- regulator-always-on; -- }; - }; - - &ahci { -@@ -94,6 +88,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &gmac { - pinctrl-names = "default"; - pinctrl-0 = <&gmac_pins_rgmii_a>; -@@ -118,10 +116,58 @@ - }; - }; - --&i2c1 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c1_pins_a>; -+&lradc { -+ vref-supply = <®_vcc3v0>; - status = "okay"; -+ -+ button@190 { -+ label = "Volume Up"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <190000>; -+ }; -+ -+ button@390 { -+ label = "Volume Down"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <390000>; -+ }; -+ -+ button@600 { -+ label = "Menu"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <600000>; -+ }; -+ -+ button@800 { -+ label = "Search"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <800000>; -+ }; -+ -+ button@980 { -+ label = "Home"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <980000>; -+ }; -+ -+ button@1180 { -+ label = "Esc"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1180000>; -+ }; -+ -+ button@1400 { -+ label = "Enter"; -+ linux,code = ; -+ channel = <0>; -+ voltage = <1400000>; -+ }; - }; - - &mmc0 { -@@ -134,6 +180,16 @@ - status = "okay"; - }; - -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>, <&mmc3_cd_pin_olimex_som_evb>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 0 GPIO_ACTIVE_HIGH>; /* PH0 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -161,15 +217,22 @@ - allwinner,pull = ; - }; - -+ mmc3_cd_pin_olimex_som_evb: mmc3_cd_pin@0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb0_id_detect_pin: usb0_id_detect_pin@0 { -- allwinner,pins = "PH04"; -+ allwinner,pins = "PH4"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; - }; - - usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -- allwinner,pins = "PH05"; -+ allwinner,pins = "PH5"; - allwinner,function = "gpio_in"; - allwinner,drive = ; - allwinner,pull = ; -@@ -187,7 +250,7 @@ - ®_dcdc2 { - regulator-always-on; - regulator-min-microvolt = <1000000>; -- regulator-max-microvolt = <1425000>; -+ regulator-max-microvolt = <1400000>; - regulator-name = "vdd-cpu"; - }; - -@@ -235,8 +298,8 @@ - &usbphy { - pinctrl-names = "default"; - pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -- usb0_id_det-gpios = <&pio 7 04 GPIO_ACTIVE_HIGH>; /* PH04 */ -- usb0_vbus_det-gpios = <&pio 7 05 GPIO_ACTIVE_HIGH>; /* PH05 */ -+ usb0_id_det-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH04 */ -+ usb0_vbus_det-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH05 */ - usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime.dts -@@ -117,6 +117,18 @@ - }; - }; - -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; ---- a/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2.dts -@@ -170,6 +170,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &mmc0 { -@@ -190,6 +196,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 { - allwinner,pins = "PC3"; -@@ -204,6 +214,27 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 { -+ allwinner,pins = "PH5"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_vbus_pin_lime2: usb0_vbus_pin@0 { -+ allwinner,pins = "PC17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -212,6 +243,12 @@ - status = "okay"; - }; - -+®_usb0_vbus { -+ pinctrl-0 = <&usb0_vbus_pin_lime2>; -+ gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>; -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -226,7 +263,17 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */ -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -+++ b/arch/arm/dts/sun7i-a20-olinuxino-micro.dts -@@ -125,6 +125,12 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; - status = "okay"; -+ -+ eeprom: eeprom@50 { -+ compatible = "atmel,24c16"; -+ reg = <0x50>; -+ pagesize = <16>; -+ }; - }; - - &i2c2 { ---- a/arch/arm/dts/sun7i-a20-orangepi-mini.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi-mini.dts -@@ -95,6 +95,10 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -156,7 +160,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -225,6 +240,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -243,7 +262,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-orangepi.dts -+++ b/arch/arm/dts/sun7i-a20-orangepi.dts -@@ -141,7 +141,18 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_orangepi: mmc0_cd_pin@0 { - allwinner,pins = "PH10"; - allwinner,function = "gpio_in"; -@@ -203,6 +214,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_bananapro>; - gpio = <&pio 7 26 GPIO_ACTIVE_HIGH>; /* PH26 */ -@@ -221,7 +236,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3-nano.dts -@@ -82,6 +82,14 @@ - status = "okay"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -108,13 +116,9 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -@@ -142,6 +146,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - ahci_pwr_pin_pcduino3_nano: ahci_pwr_pin@0 { - allwinner,pins = "PH2"; -@@ -157,8 +165,15 @@ - allwinner,pull = ; - }; - -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - usb1_vbus_pin_pcduino3_nano: usb1_vbus_pin@0 { -- allwinner,pins = "PH11"; -+ allwinner,pins = "PD2"; - allwinner,function = "gpio_out"; - allwinner,drive = ; - allwinner,pull = ; -@@ -171,13 +186,37 @@ - status = "okay"; - }; - --®_usb1_vbus { -- pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -- gpio = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */ -- status = "okay"; -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; - }; - --®_usb2_vbus { -+/* A single regulator (U24) powers both USB host ports. */ -+®_usb1_vbus { -+ pinctrl-0 = <&usb1_vbus_pin_pcduino3_nano>; -+ gpio = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */ - status = "okay"; - }; - -@@ -187,8 +226,16 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; -- usb2_vbus-supply = <®_usb2_vbus>; -+ usb2_vbus-supply = <®_usb1_vbus>; - status = "okay"; - }; ---- a/arch/arm/dts/sun7i-a20-pcduino3.dts -+++ b/arch/arm/dts/sun7i-a20-pcduino3.dts -@@ -111,6 +111,14 @@ - allwinner,pins = "PH2"; - }; - -+&codec { -+ status = "okay"; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ - &ehci0 { - status = "okay"; - }; -@@ -137,16 +145,14 @@ - status = "okay"; - - axp209: pmic@34 { -- compatible = "x-powers,axp209"; - reg = <0x34>; - interrupt-parent = <&nmi_intc>; - interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -- -- interrupt-controller; -- #interrupt-cells = <1>; - }; - }; - -+#include "axp209.dtsi" -+ - &ir0 { - pinctrl-names = "default"; - pinctrl-0 = <&ir0_rx_pins_a>; -@@ -171,6 +177,10 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ - &pio { - led_pins_pcduino3: led_pins@0 { - allwinner,pins = "PH15", "PH16"; -@@ -185,6 +195,13 @@ - allwinner,drive = ; - allwinner,pull = ; - }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - ®_ahci_5v { -@@ -192,6 +209,31 @@ - status = "okay"; - }; - -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-pll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -206,7 +248,15 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -+++ b/arch/arm/dts/sun7i-a20-wexler-tab7200.dts -@@ -48,6 +48,7 @@ - #include - #include - #include -+#include - - / { - model = "Wexler TAB7200"; -@@ -57,11 +58,28 @@ - serial0 = &uart0; - }; - -+ backlight { -+ compatible = "pwm-backlight"; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_enable_pin>; -+ enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; - }; - -+&codec { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&codec_pa_pin>; -+ allwinner,pa-gpios = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ -+ status = "okay"; -+}; -+ - &cpu0 { - cpu-supply = <®_dcdc2>; - }; -@@ -86,6 +104,8 @@ - }; - }; - -+#include "axp209.dtsi" -+ - &i2c1 { - pinctrl-names = "default"; - pinctrl-0 = <&i2c1_pins_a>; -@@ -96,6 +116,18 @@ - pinctrl-names = "default"; - pinctrl-0 = <&i2c2_pins_a>; - status = "okay"; -+ -+ gt911: touchscreen@5d { -+ compatible = "goodix,gt911"; -+ reg = <0x5d>; -+ interrupt-parent = <&pio>; -+ interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>; /* EINT21 (PH21) */ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ts_reset_pin>; -+ irq-gpios = <&pio 7 21 GPIO_ACTIVE_HIGH>; /* INT (PH21) */ -+ reset-gpios = <&pio 1 13 GPIO_ACTIVE_HIGH>; /* RST (PB13) */ -+ touchscreen-swapped-x-y; -+ }; - }; - - &lradc { -@@ -135,7 +167,45 @@ - status = "okay"; - }; - --#include "axp209.dtsi" -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ bl_enable_pin: bl_enable_pin@0 { -+ allwinner,pins = "PH7"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ codec_pa_pin: codec_pa_pin@0 { -+ allwinner,pins = "PH15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ ts_reset_pin: ts_reset_pin@0 { -+ allwinner,pins = "PB13"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins_a>; -+ status = "okay"; -+}; - - ®_dcdc2 { - regulator-always-on; -@@ -162,6 +232,10 @@ - regulator-name = "avcc"; - }; - -+®_usb0_vbus { -+ status = "okay"; -+}; -+ - ®_usb1_vbus { - status = "okay"; - }; -@@ -176,7 +250,21 @@ - status = "okay"; - }; - -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ - &usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; - usb1_vbus-supply = <®_usb1_vbus>; - usb2_vbus-supply = <®_usb2_vbus>; - status = "okay"; ---- a/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -+++ b/arch/arm/dts/sun7i-a20-wits-pro-a20-dkt.dts -@@ -1,13 +1,52 @@ - /* -- * Copyright 2015 Hans de Goede -+ * Copyright 2015 Jelle de Jong - * -- * Minimal dts file for the Wits Pro A20 DKT for u-boot only -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. - * -- * SPDX-License-Identifier: GPL-2.0+ or X11 -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. - */ - - /dts-v1/; - #include "sun7i-a20.dtsi" -+#include "sunxi-common-regulators.dtsi" -+ -+#include -+#include -+#include - - / { - model = "Wits Pro A20 DKT"; -@@ -20,6 +59,17 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ mmc3_pwrseq: mmc3_pwrseq { -+ compatible = "mmc-pwrseq-simple"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&vmmc3_pin_ap6xxx_wl_regon>; -+ reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */ -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; - }; - - &ehci0 { -@@ -42,6 +92,60 @@ - }; - }; - -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&i2c2 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c2_pins_a>; -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+&mmc0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>; -+ vmmc-supply = <®_vcc3v3>; -+ bus-width = <4>; -+ cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */ -+ cd-inverted; -+ status = "okay"; -+}; -+ -+&mmc3 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&mmc3_pins_a>; -+ vmmc-supply = <®_vcc3v3>; -+ mmc-pwrseq = <&mmc3_pwrseq>; -+ bus-width = <4>; -+ non-removable; -+ status = "okay"; -+ -+ brcmf: bcrmf@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ interrupt-parent = <&pio>; -+ interrupts = <7 10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */ -+ interrupt-names = "host-wake"; -+ }; -+}; -+ - &ohci0 { - status = "okay"; - }; -@@ -50,8 +154,85 @@ - status = "okay"; - }; - -+&otg_sram { -+ status = "okay"; -+}; -+ -+&pio { -+ vmmc3_pin_ap6xxx_wl_regon: vmmc3_pin@0 { -+ allwinner,pins = "PH9"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ usb0_id_detect_pin: usb0_id_detect_pin@0 { -+ allwinner,pins = "PH4"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1450000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb0_vbus { -+ status = "okay"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; - status = "okay"; - }; -+ -+&usb_otg { -+ dr_mode = "otg"; -+ status = "okay"; -+}; -+ -+&usb_power_supply { -+ status = "okay"; -+}; -+ -+&usbphy { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&usb0_id_detect_pin>; -+ usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ -+ usb0_vbus_power-supply = <&usb_power_supply>; -+ usb0_vbus-supply = <®_usb0_vbus>; -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun7i-a20.dtsi -+++ b/arch/arm/dts/sun7i-a20.dtsi -@@ -47,6 +47,7 @@ - #include - #include - -+#include - #include - #include - -@@ -67,7 +68,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-hdmi"; - clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 43>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - -@@ -75,7 +76,8 @@ - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -- clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>; -+ clocks = <&pll5 1>, <&ahb_gates 36>, <&ahb_gates 44>, -+ <&dram_gates 26>; - status = "disabled"; - }; - -@@ -84,7 +86,7 @@ - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0-tve0"; - clocks = <&pll5 1>, <&ahb_gates 34>, <&ahb_gates 36>, -- <&ahb_gates 44>; -+ <&ahb_gates 44>, <&dram_gates 26>; - status = "disabled"; - }; - }; -@@ -107,7 +109,7 @@ - 720000 1200000 - 528000 1100000 - 312000 1000000 -- 144000 900000 -+ 144000 1000000 - >; - #cooling-cells = <2>; - cooling-min-level = <0>; -@@ -199,6 +201,15 @@ - clock-output-names = "pll1"; - }; - -+ pll2: clk@01c20008 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-pll2-clk"; -+ reg = <0x01c20008 0x8>; -+ clocks = <&osc24M>; -+ clock-output-names = "pll2-1x", "pll2-2x", -+ "pll2-4x", "pll2-8x"; -+ }; -+ - pll4: clk@01c20018 { - #clock-cells = <0>; - compatible = "allwinner,sun7i-a20-pll4-clk"; -@@ -267,6 +278,19 @@ - compatible = "allwinner,sun7i-a20-ahb-gates-clk"; - reg = <0x01c20060 0x8>; - clocks = <&ahb>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, <8>, -+ <9>, <10>, <11>, <12>, -+ <13>, <14>, <16>, -+ <17>, <18>, <20>, <21>, -+ <22>, <23>, <25>, -+ <28>, <32>, <33>, <34>, -+ <35>, <36>, <37>, <40>, -+ <41>, <42>, <43>, -+ <44>, <45>, <46>, -+ <47>, <49>, <50>, -+ <52>; - clock-output-names = "ahb_usb0", "ahb_ehci0", - "ahb_ohci0", "ahb_ehci1", "ahb_ohci1", - "ahb_ss", "ahb_dma", "ahb_bist", "ahb_mmc0", -@@ -295,6 +319,10 @@ - compatible = "allwinner,sun7i-a20-apb0-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb0>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <8>, <10>; - clock-output-names = "apb0_codec", "apb0_spdif", - "apb0_ac97", "apb0_iis0", "apb0_iis1", - "apb0_pio", "apb0_ir0", "apb0_ir1", -@@ -314,6 +342,12 @@ - compatible = "allwinner,sun7i-a20-apb1-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <5>, <6>, <7>, -+ <15>, <16>, <17>, -+ <18>, <19>, <20>, -+ <21>, <22>, <23>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_can", - "apb1_scr", "apb1_ps20", "apb1_ps21", -@@ -442,6 +476,14 @@ - clock-output-names = "ir1"; - }; - -+ keypad_clk: clk@01c200c4 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c200c4 0x4>; -+ clocks = <&osc24M>; -+ clock-output-names = "keypad"; -+ }; -+ - usb_clk: clk@01c200cc { - #clock-cells = <1>; - #reset-cells = <1>; -@@ -460,6 +502,48 @@ - clock-output-names = "spi3"; - }; - -+ dram_gates: clk@01c20100 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun4i-a10-dram-gates-clk"; -+ reg = <0x01c20100 0x4>; -+ clocks = <&pll5 0>; -+ clock-indices = <0>, -+ <1>, <2>, -+ <3>, -+ <4>, -+ <5>, <6>, -+ <15>, -+ <24>, <25>, -+ <26>, <27>, -+ <28>, <29>; -+ clock-output-names = "dram_ve", -+ "dram_csi0", "dram_csi1", -+ "dram_ts", -+ "dram_tvd", -+ "dram_tve0", "dram_tve1", -+ "dram_output", -+ "dram_de_fe1", "dram_de_fe0", -+ "dram_de_be0", "dram_de_be1", -+ "dram_de_mp", "dram_ace"; -+ }; -+ -+ ve_clk: clk@01c2013c { -+ #clock-cells = <0>; -+ #reset-cells = <0>; -+ compatible = "allwinner,sun4i-a10-ve-clk"; -+ reg = <0x01c2013c 0x4>; -+ clocks = <&pll4>; -+ clock-output-names = "ve"; -+ }; -+ -+ codec_clk: clk@01c20140 { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-codec-clk"; -+ reg = <0x01c20140 0x4>; -+ clocks = <&pll2 SUN4I_A10_PLL2_1X>; -+ clock-output-names = "codec"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun5i-a13-mbus-clk"; -@@ -744,6 +828,14 @@ - status = "disabled"; - }; - -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ }; -+ - spi2: spi@01c17000 { - compatible = "allwinner,sun4i-a10-spi"; - reg = <0x01c17000 0x1000>; -@@ -1159,6 +1251,19 @@ - status = "disabled"; - }; - -+ codec: codec@01c22c00 { -+ #sound-dai-cells = <0>; -+ compatible = "allwinner,sun7i-a20-codec"; -+ reg = <0x01c22c00 0x40>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>, <&codec_clk>; -+ clock-names = "apb", "codec"; -+ dmas = <&dma SUN4I_DMA_NORMAL 19>, -+ <&dma SUN4I_DMA_NORMAL 19>; -+ dma-names = "rx", "tx"; -+ status = "disabled"; -+ }; -+ - sid: eeprom@01c23800 { - compatible = "allwinner,sun7i-a20-sid"; - reg = <0x01c23800 0x200>; ---- a/arch/arm/dts/sun8i-a23-a33.dtsi -+++ b/arch/arm/dts/sun8i-a23-a33.dtsi -@@ -56,7 +56,7 @@ - #size-cells = <1>; - ranges; - -- framebuffer@0 { -+ simplefb_lcd: framebuffer@0 { - compatible = "allwinner,simple-framebuffer", - "simple-framebuffer"; - allwinner,pipeline = "de_be0-lcd0"; -@@ -175,27 +175,13 @@ - clock-output-names = "apb1"; - }; - -- ahb1_gates: clk@01c20060 { -- #clock-cells = <1>; -- compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -- reg = <0x01c20060 0x8>; -- clocks = <&ahb1>; -- clock-output-names = "ahb1_mipidsi", "ahb1_dma", -- "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -- "ahb1_nand", "ahb1_sdram", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -- "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -- "ahb1_csi", "ahb1_be", "ahb1_fe", -- "ahb1_gpu", "ahb1_spinlock", -- "ahb1_drc"; -- }; -- - apb1_gates: clk@01c20068 { - #clock-cells = <1>; - compatible = "allwinner,sun8i-a23-apb1-gates-clk"; - reg = <0x01c20068 0x4>; - clocks = <&apb1>; -+ clock-indices = <0>, <5>, -+ <12>, <13>; - clock-output-names = "apb1_codec", "apb1_pio", - "apb1_daudio0", "apb1_daudio1"; - }; -@@ -213,6 +199,10 @@ - compatible = "allwinner,sun8i-a23-apb2-gates-clk"; - reg = <0x01c2006c 0x4>; - clocks = <&apb2>; -+ clock-indices = <0>, <1>, -+ <2>, <16>, -+ <17>, <18>, -+ <19>, <20>; - clock-output-names = "apb2_i2c0", "apb2_i2c1", - "apb2_i2c2", "apb2_uart0", - "apb2_uart1", "apb2_uart2", -@@ -391,12 +381,19 @@ - allwinner,pins = "PC5", "PC6", "PC8", - "PC9", "PC10", "PC11", - "PC12", "PC13", "PC14", -- "PC15"; -+ "PC15", "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; - }; - -+ pwm0_pins: pwm0 { -+ allwinner,pins = "PH0"; -+ allwinner,function = "pwm0"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - i2c0_pins_a: i2c0@0 { - allwinner,pins = "PH2", "PH3"; - allwinner,function = "i2c0"; -@@ -451,6 +448,14 @@ - interrupts = ; - }; - -+ pwm: pwm@01c21400 { -+ compatible = "allwinner,sun7i-a20-pwm"; -+ reg = <0x01c21400 0xc>; -+ clocks = <&osc24M>; -+ #pwm-cells = <3>; -+ status = "disabled"; -+ }; -+ - lradc: lradc@01c22800 { - compatible = "allwinner,sun4i-a10-lradc-keys"; - reg = <0x01c22800 0x100>; -@@ -574,6 +579,14 @@ - ; - }; - -+ nmi_intc: interrupt-controller@01f00c0c { -+ compatible = "allwinner,sun6i-a31-sc-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x01f00c0c 0x38>; -+ interrupts = ; -+ }; -+ - prcm@01f01400 { - compatible = "allwinner,sun8i-a23-prcm"; - reg = <0x01f01400 0x200>; -@@ -642,10 +655,18 @@ - resets = <&apb0_rst 0>; - gpio-controller; - interrupt-controller; -+ #interrupt-cells = <3>; - #address-cells = <1>; - #size-cells = <0>; - #gpio-cells = <3>; - -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PL0", "PL1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - r_uart_pins_a: r_uart@0 { - allwinner,pins = "PL2", "PL3"; - allwinner,function = "s_uart"; -@@ -653,5 +674,19 @@ - allwinner,pull = ; - }; - }; -+ -+ r_rsb: rsb@01f03400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x01f03400 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apb0_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-a23-gt90h-v4.dts -+++ b/arch/arm/dts/sun8i-a23-gt90h-v4.dts -@@ -47,15 +47,26 @@ - #include - #include - #include -+#include - - / { -- model = "Allwinner GT90H Quad Core Tablet (v4)"; -- compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a33"; -+ model = "Allwinner GT90H Dual Core Tablet (v4)"; -+ compatible = "allwinner,gt90h-v4", "allwinner,sun8i-a23"; - - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_gt90h>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -106,8 +117,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_gt90h>; -- /* FIXME this really is aldo1, correct once we've pmic support */ -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_aldo1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -115,6 +125,13 @@ - }; - - &pio { -+ bl_en_pin_gt90h: bl_en_pin@0 { -+ allwinner,pins = "PH6"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_gt90h: mmc0_cd_pin@0 { - allwinner,pins = "PB4"; - allwinner,function = "gpio_in"; -@@ -123,12 +140,106 @@ - }; - }; - -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; -+ -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; - -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_dldo1 { -+ regulator-min-microvolt = <3300000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-wifi"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; -+ - /* - * FIXME for now we only support host mode and rely on u-boot to have - * turned on Vbus which is controlled by the axp223 pmic on the board. -@@ -141,5 +252,6 @@ - }; - - &usbphy { -+ usb1_vbus-supply = <®_dldo1>; - status = "okay"; - }; ---- a/arch/arm/dts/sun8i-a23.dtsi -+++ b/arch/arm/dts/sun8i-a23.dtsi -@@ -50,6 +50,31 @@ - }; - - clocks { -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a23-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <6>, -+ <8>, <9>, <10>, -+ <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_dma", -+ "ahb1_mmc0", "ahb1_mmc1", "ahb1_mmc2", -+ "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; ---- a/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -+++ b/arch/arm/dts/sun8i-a33-sinlinx-sina33.dts -@@ -68,7 +68,7 @@ - }; - - &lradc { -- vref-supply = <®_vcc3v0>; -+ vref-supply = <®_dcdc1>; - status = "okay"; - - button@200 { -@@ -96,7 +96,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_sina33>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -106,13 +106,16 @@ - &mmc2 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc2_8bit_pins>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - - &mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; - /* eMMC is missing pull-ups */ - allwinner,pull = ; - }; -@@ -130,6 +133,80 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_b>; ---- a/arch/arm/dts/sun8i-a33.dtsi -+++ b/arch/arm/dts/sun8i-a33.dtsi -@@ -72,6 +72,41 @@ - clock-output-names = "pll11"; - }; - -+ ahb1_gates: clk@01c20060 { -+ #clock-cells = <1>; -+ compatible = "allwinner,sun8i-a33-ahb1-gates-clk"; -+ reg = <0x01c20060 0x8>; -+ clocks = <&ahb1>; -+ clock-indices = <1>, <5>, -+ <6>, <8>, <9>, -+ <10>, <13>, <14>, -+ <19>, <20>, -+ <21>, <24>, <26>, -+ <29>, <32>, <36>, -+ <40>, <44>, <46>, -+ <52>, <53>, -+ <54>, <57>, -+ <58>; -+ clock-output-names = "ahb1_mipidsi", "ahb1_ss", -+ "ahb1_dma","ahb1_mmc0", "ahb1_mmc1", -+ "ahb1_mmc2", "ahb1_nand", "ahb1_sdram", -+ "ahb1_hstimer", "ahb1_spi0", -+ "ahb1_spi1", "ahb1_otg", "ahb1_ehci", -+ "ahb1_ohci", "ahb1_ve", "ahb1_lcd", -+ "ahb1_csi", "ahb1_be", "ahb1_fe", -+ "ahb1_gpu", "ahb1_msgbox", -+ "ahb1_spinlock", "ahb1_drc", -+ "ahb1_sat"; -+ }; -+ -+ ss_clk: clk@01c2009c { -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01c2009c 0x4>; -+ clocks = <&osc24M>, <&pll6 0>; -+ clock-output-names = "ss"; -+ }; -+ - mbus_clk: clk@01c2015c { - #clock-cells = <0>; - compatible = "allwinner,sun8i-a23-mbus-clk"; -@@ -82,6 +117,16 @@ - }; - - soc@01c00000 { -+ crypto: crypto-engine@01c15000 { -+ compatible = "allwinner,sun4i-a10-crypto"; -+ reg = <0x01c15000 0x1000>; -+ interrupts = ; -+ clocks = <&ahb1_gates 5>, <&ss_clk>; -+ clock-names = "ahb", "mod"; -+ resets = <&ahb1_rst 5>; -+ reset-names = "ahb"; -+ }; -+ - usb_otg: usb@01c19000 { - compatible = "allwinner,sun8i-a33-musb"; - reg = <0x01c19000 0x0400>; ---- /dev/null -+++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus.dts -@@ -0,0 +1,65 @@ -+/* -+ * Copyright 2015 Chen-Yu Tsai -+ * -+ * Chen-Yu Tsai -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+/dts-v1/; -+#include "sun8i-a83t.dtsi" -+ -+/ { -+ model = "Cubietech Cubietruck Plus"; -+ compatible = "cubietech,cubietruck-plus", "allwinner,sun8i-a83t"; -+ -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_b>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sun8i-a83t.dtsi -+++ b/arch/arm/dts/sun8i-a83t.dtsi -@@ -52,12 +52,6 @@ - / { - interrupt-parent = <&gic>; - -- chosen { -- #address-cells = <1>; -- #size-cells = <1>; -- ranges; -- }; -- - cpus { - #address-cells = <1>; - #size-cells = <0>; -@@ -85,6 +79,7 @@ - device_type = "cpu"; - reg = <3>; - }; -+ - cpu@100 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -96,6 +91,7 @@ - device_type = "cpu"; - reg = <0x101>; - }; -+ - cpu@102 { - compatible = "arm,cortex-a7"; - device_type = "cpu"; -@@ -109,18 +105,12 @@ - }; - }; - -- memory { -- reg = <0x40000000 0x80000000>; -- }; -- - timer { - compatible = "arm,armv7-timer"; -- interrupts = , -- , -- , -- ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -+ interrupts = , -+ , -+ , -+ ; - }; - - clocks { -@@ -128,6 +118,7 @@ - #size-cells = <1>; - ranges; - -+ /* TODO: PRCM block has a mux for this. */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,36 +126,39 @@ - clock-output-names = "osc24M"; - }; - -- osc32k: osc32k_clk { -+ /* -+ * This is called "internal OSC" in some places. -+ * It is an internal RC-based oscillator. -+ * TODO: Its controls are in the PRCM block. -+ */ -+ osc16M: osc16M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -- clock-frequency = <32768>; -- clock-output-names = "osc32k"; -+ clock-frequency = <16000000>; -+ clock-output-names = "osc16M"; -+ }; -+ -+ osc16Md512: osc16Md512_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <512>; -+ clock-mult = <1>; -+ clocks = <&osc16M>; -+ clock-output-names = "osc16M-d512"; - }; - }; - -- soc@01c00000 { -+ soc { - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges; - -- gic: interrupt-controller@01c81000 { -- compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -- reg = <0x01c81000 0x1000>, -- <0x01c82000 0x1000>, -- <0x01c84000 0x2000>, -- <0x01c86000 0x2000>; -- interrupt-controller; -- #interrupt-cells = <3>; -- interrupts = ; -- }; -- - pio: pinctrl@01c20800 { - compatible = "allwinner,sun8i-a83t-pinctrl"; - interrupts = , -- , -- ; -+ , -+ ; - reg = <0x01c20800 0x400>; - clocks = <&osc24M>; - gpio-controller; -@@ -172,27 +166,6 @@ - #interrupt-cells = <3>; - #gpio-cells = <3>; - -- i2c0_pins_a: i2c0@0 { -- allwinner,pins = "PH0", "PH1"; -- allwinner,function = "i2c0"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c1_pins_a: i2c1@0 { -- allwinner,pins = "PH2", "PH3"; -- allwinner,function = "i2c1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- i2c2_pins_a: i2c2@0 { -- allwinner,pins = "PH4", "PH5"; -- allwinner,function = "i2c2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - mmc0_pins_a: mmc0@0 { - allwinner,pins = "PF0", "PF1", "PF2", - "PF3", "PF4", "PF5"; -@@ -201,24 +174,6 @@ - allwinner,pull = ; - }; - -- mmc1_pins_a: mmc1@0 { -- allwinner,pins = "PG0", "PG1", "PG2", -- "PG3", "PG4", "PG5"; -- allwinner,function = "mmc1"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- -- mmc2_8bit_pins: mmc2_8bit { -- allwinner,pins = "PC5", "PC6", "PC8", -- "PC9", "PC10", "PC11", -- "PC12", "PC13", "PC14", -- "PC15"; -- allwinner,function = "mmc2"; -- allwinner,drive = ; -- allwinner,pull = ; -- }; -- - uart0_pins_a: uart0@0 { - allwinner,pins = "PF2", "PF4"; - allwinner,function = "uart0"; -@@ -234,6 +189,21 @@ - }; - }; - -+ timer@01c20c00 { -+ compatible = "allwinner,sun4i-a10-timer"; -+ reg = <0x01c20c00 0xa0>; -+ interrupts = , -+ ; -+ clocks = <&osc24M>; -+ }; -+ -+ watchdog@01c20ca0 { -+ compatible = "allwinner,sun6i-a31-wdt"; -+ reg = <0x01c20ca0 0x20>; -+ interrupts = ; -+ clocks = <&osc24M>; -+ }; -+ - uart0: serial@01c28000 { - compatible = "snps,dw-apb-uart"; - reg = <0x01c28000 0x400>; -@@ -243,5 +213,16 @@ - clocks = <&osc24M>; - status = "disabled"; - }; -+ -+ gic: interrupt-controller@01c81000 { -+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; -+ reg = <0x01c81000 0x1000>, -+ <0x01c82000 0x1000>, -+ <0x01c84000 0x2000>, -+ <0x01c86000 0x2000>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ interrupts = ; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-h3-orangepi-pc.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-pc.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -58,6 +59,43 @@ - chosen { - stdout-path = "serial0:115200n8"; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; - }; - - &ehci1 { -@@ -72,6 +110,12 @@ - status = "okay"; - }; - -+&ir { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&ir_pins_a>; -+ status = "okay"; -+}; -+ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>; -@@ -94,6 +138,31 @@ - status = "okay"; - }; - -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ - &uart0 { - pinctrl-names = "default"; - pinctrl-0 = <&uart0_pins_a>; ---- a/arch/arm/dts/sun8i-h3-orangepi-plus.dts -+++ b/arch/arm/dts/sun8i-h3-orangepi-plus.dts -@@ -45,6 +45,7 @@ - #include "sunxi-common-regulators.dtsi" - - #include -+#include - #include - - / { -@@ -70,6 +71,68 @@ - enable-active-high; - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; - }; -+ -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_opc>; -+ -+ status_led { -+ label = "status:red:user"; -+ gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ r_leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&leds_r_opc>; -+ -+ tx { -+ label = "pwr:green:user"; -+ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; -+ default-state = "on"; -+ }; -+ }; -+ -+ r_gpio_keys { -+ compatible = "gpio-keys"; -+ input-name = "sw4"; -+ -+ pinctrl-names = "default"; -+ pinctrl-0 = <&sw_r_opc>; -+ -+ sw4@0 { -+ label = "sw4"; -+ linux,code = ; -+ gpios = <&r_pio 0 3 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+}; -+ -+&pio { -+ leds_opc: led_pins@0 { -+ allwinner,pins = "PA15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_pio { -+ leds_r_opc: led_pins@0 { -+ allwinner,pins = "PL10"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ sw_r_opc: key_pins@0 { -+ allwinner,pins = "PL03"; -+ allwinner,function = "gpio_in"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; - }; - - &ehci1 { ---- a/arch/arm/dts/sun8i-h3.dtsi -+++ b/arch/arm/dts/sun8i-h3.dtsi -@@ -83,12 +83,6 @@ - , - , - ; -- clock-frequency = <24000000>; -- arm,cpu-registers-not-fw-configured; -- }; -- -- memory { -- reg = <0x40000000 0x80000000>; - }; - - clocks { -@@ -131,15 +125,24 @@ - compatible = "allwinner,sun6i-a31-pll6-clk"; - reg = <0x01c20028 0x4>; - clocks = <&osc24M>; -- clock-output-names = "pll6", "pll6x2", "pll6d2"; -+ clock-output-names = "pll6", "pll6x2"; - }; - -- pll8: clk@01c20044 { -- #clock-cells = <1>; -- compatible = "allwinner,sun6i-a31-pll6-clk"; -- reg = <0x01c20044 0x4>; -- clocks = <&osc24M>; -- clock-output-names = "pll8", "pll8x2"; -+ pll6d2: pll6d2_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-factor-clock"; -+ clock-div = <2>; -+ clock-mult = <1>; -+ clocks = <&pll6 0>; -+ clock-output-names = "pll6d2"; -+ }; -+ -+ /* dummy clock until pll6 can be reused */ -+ pll8: pll8_clk { -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-frequency = <1>; -+ clock-output-names = "pll8"; - }; - - cpu: cpu_clk@01c20050 { -@@ -170,7 +173,7 @@ - #clock-cells = <0>; - compatible = "allwinner,sun8i-h3-ahb2-clk"; - reg = <0x01c2005c 0x4>; -- clocks = <&ahb1>, <&pll6 2>; -+ clocks = <&ahb1>, <&pll6d2>; - clock-output-names = "ahb2"; - }; - -@@ -213,34 +216,34 @@ - <76>, <77>, <78>, - <96>, <97>, <98>, - <112>, <113>, -- <114>, <115>, <116>, -- <128>, <135>; -- clock-output-names = "ahb1_ce", "ahb1_dma", "ahb1_mmc0", -- "ahb1_mmc1", "ahb1_mmc2", "ahb1_nand", -- "ahb1_sdram", "ahb2_gmac", "ahb1_ts", -- "ahb1_hstimer", "ahb1_spi0", -- "ahb1_spi1", "ahb1_otg", -- "ahb1_otg_ehci0", "ahb1_ehic1", -- "ahb1_ehic2", "ahb1_ehic3", -- "ahb1_otg_ohci0", "ahb2_ohic1", -- "ahb2_ohic2", "ahb2_ohic3", "ahb1_ve", -- "ahb1_lcd0", "ahb1_lcd1", "ahb1_deint", -- "ahb1_csi", "ahb1_tve", "ahb1_hdmi", -- "ahb1_de", "ahb1_gpu", "ahb1_msgbox", -- "ahb1_spinlock", "apb1_codec", -- "apb1_spdif", "apb1_pio", "apb1_ths", -- "apb1_i2s0", "apb1_i2s1", "apb1_i2s2", -- "apb2_i2c0", "apb2_i2c1", "apb2_i2c2", -- "apb2_uart0", "apb2_uart1", -- "apb2_uart2", "apb2_uart3", "apb2_scr", -- "ahb1_ephy", "ahb1_dbg"; -+ <114>, <115>, -+ <116>, <128>, <135>; -+ clock-output-names = "bus_ce", "bus_dma", "bus_mmc0", -+ "bus_mmc1", "bus_mmc2", "bus_nand", -+ "bus_sdram", "bus_gmac", "bus_ts", -+ "bus_hstimer", "bus_spi0", -+ "bus_spi1", "bus_otg", -+ "bus_otg_ehci0", "bus_ehci1", -+ "bus_ehci2", "bus_ehci3", -+ "bus_otg_ohci0", "bus_ohci1", -+ "bus_ohci2", "bus_ohci3", "bus_ve", -+ "bus_lcd0", "bus_lcd1", "bus_deint", -+ "bus_csi", "bus_tve", "bus_hdmi", -+ "bus_de", "bus_gpu", "bus_msgbox", -+ "bus_spinlock", "bus_codec", -+ "bus_spdif", "bus_pio", "bus_ths", -+ "bus_i2s0", "bus_i2s1", "bus_i2s2", -+ "bus_i2c0", "bus_i2c1", "bus_i2c2", -+ "bus_uart0", "bus_uart1", -+ "bus_uart2", "bus_uart3", -+ "bus_scr", "bus_ephy", "bus_dbg"; - }; - - mmc0_clk: clk@01c20088 { - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20088 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc0", - "mmc0_output", - "mmc0_sample"; -@@ -250,7 +253,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c2008c 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc1", - "mmc1_output", - "mmc1_sample"; -@@ -260,7 +263,7 @@ - #clock-cells = <1>; - compatible = "allwinner,sun4i-a10-mmc-clk"; - reg = <0x01c20090 0x4>; -- clocks = <&osc24M>, <&pll6 0>, <&pll8 0>; -+ clocks = <&osc24M>, <&pll6 0>, <&pll8>; - clock-output-names = "mmc2", - "mmc2_output", - "mmc2_sample"; -@@ -285,6 +288,33 @@ - clocks = <&osc24M>, <&pll6 1>, <&pll5>; - clock-output-names = "mbus"; - }; -+ -+ apb0: apb0_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&osc24M>; -+ clock-output-names = "apb0"; -+ }; -+ -+ apb0_gates: clk@01f01428 { -+ compatible = "allwinner,sun8i-h3-apb0-gates-clk", -+ "allwinner,sun4i-a10-gates-clk"; -+ reg = <0x01f01428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apb0>; -+ clock-indices = <0>, <1>; -+ clock-output-names = "apb0_pio", "apb0_ir"; -+ }; -+ -+ ir_clk: ir_clk@01f01454 { -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ reg = <0x01f01454 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "ir"; -+ }; - }; - - soc { -@@ -298,7 +328,7 @@ - reg = <0x01c02000 0x1000>; - interrupts = ; - clocks = <&bus_gates 6>; -- resets = <&bus_rst 6>; -+ resets = <&ahb_rst 6>; - #dma-cells = <1>; - }; - -@@ -313,7 +343,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 8>; -+ resets = <&ahb_rst 8>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -332,7 +362,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 9>; -+ resets = <&ahb_rst 9>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -351,7 +381,7 @@ - "mmc", - "output", - "sample"; -- resets = <&bus_rst 10>; -+ resets = <&ahb_rst 10>; - reset-names = "ahb"; - interrupts = ; - status = "disabled"; -@@ -396,7 +426,7 @@ - reg = <0x01c1b000 0x100>; - interrupts = ; - clocks = <&bus_gates 25>, <&bus_gates 29>; -- resets = <&bus_rst 25>, <&bus_rst 29>; -+ resets = <&ahb_rst 25>, <&ahb_rst 29>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -408,7 +438,7 @@ - interrupts = ; - clocks = <&bus_gates 29>, <&bus_gates 25>, - <&usb_clk 17>; -- resets = <&bus_rst 29>, <&bus_rst 25>; -+ resets = <&ahb_rst 29>, <&ahb_rst 25>; - phys = <&usbphy 1>; - phy-names = "usb"; - status = "disabled"; -@@ -419,7 +449,7 @@ - reg = <0x01c1c000 0x100>; - interrupts = ; - clocks = <&bus_gates 26>, <&bus_gates 30>; -- resets = <&bus_rst 26>, <&bus_rst 30>; -+ resets = <&ahb_rst 26>, <&ahb_rst 30>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -431,7 +461,7 @@ - interrupts = ; - clocks = <&bus_gates 30>, <&bus_gates 26>, - <&usb_clk 18>; -- resets = <&bus_rst 30>, <&bus_rst 26>; -+ resets = <&ahb_rst 30>, <&ahb_rst 26>; - phys = <&usbphy 2>; - phy-names = "usb"; - status = "disabled"; -@@ -442,7 +472,7 @@ - reg = <0x01c1d000 0x100>; - interrupts = ; - clocks = <&bus_gates 27>, <&bus_gates 31>; -- resets = <&bus_rst 27>, <&bus_rst 31>; -+ resets = <&ahb_rst 27>, <&ahb_rst 31>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -454,7 +484,7 @@ - interrupts = ; - clocks = <&bus_gates 31>, <&bus_gates 27>, - <&usb_clk 19>; -- resets = <&bus_rst 31>, <&bus_rst 27>; -+ resets = <&ahb_rst 31>, <&ahb_rst 27>; - phys = <&usbphy 3>; - phy-names = "usb"; - status = "disabled"; -@@ -469,7 +499,7 @@ - gpio-controller; - #gpio-cells = <3>; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - - uart0_pins_a: uart0@0 { - allwinner,pins = "PA4", "PA5"; -@@ -502,10 +532,22 @@ - }; - }; - -- bus_rst: reset@01c202c0 { -+ ahb_rst: reset@01c202c0 { - #reset-cells = <1>; -- compatible = "allwinner,sun8i-h3-bus-reset"; -- reg = <0x01c202c0 0x1c>; -+ compatible = "allwinner,sun6i-a31-ahb1-reset"; -+ reg = <0x01c202c0 0xc>; -+ }; -+ -+ apb1_rst: reset@01c202d0 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d0 0x4>; -+ }; -+ -+ apb2_rst: reset@01c202d8 { -+ #reset-cells = <1>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ reg = <0x01c202d8 0x4>; - }; - - timer@01c20c00 { -@@ -529,7 +571,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 112>; -- resets = <&bus_rst 144>; -+ resets = <&apb2_rst 16>; - dmas = <&dma 6>, <&dma 6>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -542,7 +584,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 113>; -- resets = <&bus_rst 145>; -+ resets = <&apb2_rst 17>; - dmas = <&dma 7>, <&dma 7>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -555,7 +597,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 114>; -- resets = <&bus_rst 146>; -+ resets = <&apb2_rst 18>; - dmas = <&dma 8>, <&dma 8>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -568,7 +610,7 @@ - reg-shift = <2>; - reg-io-width = <4>; - clocks = <&bus_gates 115>; -- resets = <&bus_rst 147>; -+ resets = <&apb2_rst 19>; - dmas = <&dma 9>, <&dma 9>; - dma-names = "rx", "tx"; - status = "disabled"; -@@ -591,5 +633,40 @@ - interrupts = , - ; - }; -+ -+ apb0_reset: reset@01f014b0 { -+ reg = <0x01f014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ ir: ir@01f02000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ clocks = <&apb0_gates 1>, <&ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apb0_reset 1>; -+ interrupts = ; -+ reg = <0x01f02000 0x40>; -+ status = "disabled"; -+ }; -+ -+ r_pio: pinctrl@01f02c00 { -+ compatible = "allwinner,sun8i-h3-r-pinctrl"; -+ reg = <0x01f02c00 0x400>; -+ interrupts = ; -+ clocks = <&apb0_gates 0>; -+ resets = <&apb0_reset 0>; -+ gpio-controller; -+ #gpio-cells = <3>; -+ interrupt-controller; -+ #interrupt-cells = <3>; -+ -+ ir_pins_a: ir@0 { -+ allwinner,pins = "PL11"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; - }; - }; ---- a/arch/arm/dts/sun8i-q8-common.dtsi -+++ b/arch/arm/dts/sun8i-q8-common.dtsi -@@ -41,11 +41,23 @@ - */ - #include "sunxi-q8-common.dtsi" - -+#include -+ - / { - aliases { - serial0 = &r_uart; - }; - -+ backlight: backlight { -+ compatible = "pwm-backlight"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&bl_en_pin_q8>; -+ pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; -+ brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; -+ default-brightness-level = <8>; -+ enable-gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ - chosen { - stdout-path = "serial0:115200n8"; - }; -@@ -54,7 +66,7 @@ - &mmc0 { - pinctrl-names = "default"; - pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8>; -- vmmc-supply = <®_vcc3v0>; -+ vmmc-supply = <®_dcdc1>; - bus-width = <4>; - cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */ - cd-inverted; -@@ -77,8 +89,90 @@ - }; - }; - -+&r_rsb { -+ status = "okay"; -+ -+ axp22x: pmic@3a3 { -+ compatible = "x-powers,axp223"; -+ reg = <0x3a3>; -+ interrupt-parent = <&nmi_intc>; -+ interrupts = <0 IRQ_TYPE_LEVEL_LOW>; -+ eldoin-supply = <®_dcdc1>; -+ }; -+}; -+ -+#include "axp22x.dtsi" -+ -+®_aldo1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-io"; -+}; -+ -+®_aldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <2350000>; -+ regulator-max-microvolt = <2650000>; -+ regulator-name = "vdd-dll"; -+}; -+ -+®_aldo3 { -+ regulator-always-on; -+ regulator-min-microvolt = <2700000>; -+ regulator-max-microvolt = <3300000>; -+ regulator-name = "vcc-pll-avcc"; -+}; -+ -+®_dc1sw { -+ regulator-name = "vcc-lcd"; -+}; -+ -+®_dc5ldo { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpus"; -+}; -+ -+®_dcdc1 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "vcc-3v0"; -+}; -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-sys"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <900000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc5 { -+ regulator-always-on; -+ regulator-min-microvolt = <1500000>; -+ regulator-max-microvolt = <1500000>; -+ regulator-name = "vcc-dram"; -+}; -+ -+®_rtc_ldo { -+ regulator-name = "vcc-rtc"; -+}; -+ - &r_uart { - pinctrl-names = "default"; - pinctrl-0 = <&r_uart_pins_a>; - status = "okay"; - }; -+ -+&simplefb_lcd { -+ vcc-lcd-supply = <®_dc1sw>; -+}; ---- a/arch/arm/dts/sun9i-a80-cubieboard4.dts -+++ b/arch/arm/dts/sun9i-a80-cubieboard4.dts -@@ -62,9 +62,31 @@ - stdout-path = "serial0:115200n8"; - }; - -+ leds { -+ compatible = "gpio-leds"; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&led_pins_cubieboard4>; -+ -+ green { -+ label = "cubieboard4:green:usr"; -+ gpios = <&pio 7 17 GPIO_ACTIVE_HIGH>; /* PH17 */ -+ }; -+ -+ red { -+ label = "cubieboard4:red:usr"; -+ gpios = <&pio 7 6 GPIO_ACTIVE_HIGH>; /* PH6 */ -+ }; -+ }; - }; - - &pio { -+ led_pins_cubieboard4: led-pins@0 { -+ allwinner,pins = "PH6", "PH17"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ - mmc0_cd_pin_cubieboard4: mmc0_cd_pin@0 { - allwinner,pins = "PH18"; - allwinner,function = "gpio_in"; -@@ -89,6 +111,20 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; -+ status = "okay"; -+}; -+ -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ -+&r_ir { -+ status = "okay"; -+}; -+ -+&r_rsb { - status = "okay"; - }; - ---- a/arch/arm/dts/sun9i-a80-optimus.dts -+++ b/arch/arm/dts/sun9i-a80-optimus.dts -@@ -65,7 +65,7 @@ - leds { - compatible = "gpio-leds"; - pinctrl-names = "default"; -- pinctrl-0 = <&led_pins_optimus>; -+ pinctrl-0 = <&led_pins_optimus>, <&led_r_pins_optimus>; - - /* The LED names match those found on the board */ - -@@ -74,7 +74,10 @@ - gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; - }; - -- /* led3 is on PM15, in R_PIO */ -+ led3 { -+ label = "optimus:led3:usr"; -+ gpios = <&r_pio 1 15 GPIO_ACTIVE_HIGH>; /* PM15 */ -+ }; - - led4 { - label = "optimus:led4:usr"; -@@ -106,17 +109,6 @@ - status = "okay"; - }; - --&i2c3 { -- pinctrl-names = "default"; -- pinctrl-0 = <&i2c3_pins_a>; -- status = "okay"; --}; -- --&i2c3_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; --}; -- - &ohci0 { - status = "okay"; - }; -@@ -171,30 +163,42 @@ - vmmc-supply = <®_vcc3v0>; - bus-width = <8>; - non-removable; -+ cap-mmc-hw-reset; - status = "okay"; - }; - -+&mmc2_8bit_pins { -+ /* Increase drive strength for DDR modes */ -+ allwinner,drive = ; -+}; -+ - ®_usb1_vbus { - pinctrl-0 = <&usb1_vbus_pin_optimus>; - gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ - status = "okay"; - }; - --&uart0 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart0_pins_a>; -+&r_ir { - status = "okay"; - }; - --&uart4 { -- pinctrl-names = "default"; -- pinctrl-0 = <&uart4_pins_a>; -+&r_pio { -+ led_r_pins_optimus: led-pins@1 { -+ allwinner,pins = "PM15"; -+ allwinner,function = "gpio_out"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+}; -+ -+&r_rsb { - status = "okay"; - }; - --&uart4_pins_a { -- /* Enable internal pull-up */ -- allwinner,pull = ; -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; - }; - - &usbphy1 { ---- a/arch/arm/dts/sun9i-a80.dtsi -+++ b/arch/arm/dts/sun9i-a80.dtsi -@@ -128,6 +128,17 @@ - */ - ranges = <0 0 0 0x20000000>; - -+ /* -+ * This clock is actually configurable from the PRCM address -+ * space. The external 24M oscillator can be turned off, and -+ * the clock switched to an internal 16M RC oscillator. Under -+ * normal operation there's no reason to do this, and the -+ * default is to use the external good one, so just model this -+ * as a fixed clock. Also it is not entirely clear if the -+ * osc24M mux in the PRCM affects the entire clock tree, which -+ * would also throw all the PLL clock rates off, or just the -+ * downstream clocks in the PRCM. -+ */ - osc24M: osc24M_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -135,6 +146,13 @@ - clock-output-names = "osc24M"; - }; - -+ /* -+ * The 32k clock is from an external source, normally the -+ * AC100 codec/RTC chip. This clock is by default enabled -+ * and clocked at 32768 Hz, from the oscillator connected -+ * to the AC100. It is configurable, but no such driver or -+ * bindings exist yet. -+ */ - osc32k: osc32k_clk { - #clock-cells = <0>; - compatible = "fixed-clock"; -@@ -164,6 +182,14 @@ - "usb_phy2", "usb_hsic_12M"; - }; - -+ pll3: clk@06000008 { -+ /* placeholder until implemented */ -+ #clock-cells = <0>; -+ compatible = "fixed-clock"; -+ clock-rate = <0>; -+ clock-output-names = "pll3"; -+ }; -+ - pll4: clk@0600000c { - #clock-cells = <0>; - compatible = "allwinner,sun9i-a80-pll4-clk"; -@@ -277,9 +303,12 @@ - compatible = "allwinner,sun9i-a80-ahb0-gates-clk"; - reg = <0x06000580 0x4>; - clocks = <&ahb0>; -- clock-indices = <0>, <1>, <3>, <5>, <8>, <12>, <13>, -- <14>, <15>, <16>, <18>, <20>, <21>, -- <22>, <23>; -+ clock-indices = <0>, <1>, <3>, -+ <5>, <8>, <12>, -+ <13>, <14>, -+ <15>, <16>, <18>, -+ <20>, <21>, <22>, -+ <23>; - clock-output-names = "ahb0_fd", "ahb0_ve", "ahb0_gpu", - "ahb0_ss", "ahb0_sd", "ahb0_nand1", - "ahb0_nand0", "ahb0_sdram", -@@ -293,7 +322,10 @@ - compatible = "allwinner,sun9i-a80-ahb1-gates-clk"; - reg = <0x06000584 0x4>; - clocks = <&ahb1>; -- clock-indices = <0>, <1>, <17>, <21>, <22>, <23>, <24>; -+ clock-indices = <0>, <1>, -+ <17>, <21>, -+ <22>, <23>, -+ <24>; - clock-output-names = "ahb1_usbotg", "ahb1_usbhci", - "ahb1_gmac", "ahb1_msgbox", - "ahb1_spinlock", "ahb1_hstimer", -@@ -305,8 +337,9 @@ - compatible = "allwinner,sun9i-a80-ahb2-gates-clk"; - reg = <0x06000588 0x4>; - clocks = <&ahb2>; -- clock-indices = <0>, <1>, <2>, <4>, <5>, <7>, <8>, -- <11>; -+ clock-indices = <0>, <1>, -+ <2>, <4>, <5>, -+ <7>, <8>, <11>; - clock-output-names = "ahb2_lcd0", "ahb2_lcd1", - "ahb2_edp", "ahb2_csi", "ahb2_hdmi", - "ahb2_de", "ahb2_mp", "ahb2_mipi_dsi"; -@@ -317,8 +350,10 @@ - compatible = "allwinner,sun9i-a80-apb0-gates-clk"; - reg = <0x06000590 0x4>; - clocks = <&apb0>; -- clock-indices = <1>, <5>, <11>, <12>, <13>, <15>, -- <17>, <18>, <19>; -+ clock-indices = <1>, <5>, -+ <11>, <12>, <13>, -+ <15>, <17>, <18>, -+ <19>; - clock-output-names = "apb0_spdif", "apb0_pio", - "apb0_ac97", "apb0_i2s0", "apb0_i2s1", - "apb0_lradc", "apb0_gpadc", "apb0_twd", -@@ -330,14 +365,79 @@ - compatible = "allwinner,sun9i-a80-apb1-gates-clk"; - reg = <0x06000594 0x4>; - clocks = <&apb1>; -- clock-indices = <0>, <1>, <2>, <3>, <4>, -- <16>, <17>, <18>, <19>, <20>, <21>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, <4>, -+ <16>, <17>, -+ <18>, <19>, -+ <20>, <21>; - clock-output-names = "apb1_i2c0", "apb1_i2c1", - "apb1_i2c2", "apb1_i2c3", "apb1_i2c4", - "apb1_uart0", "apb1_uart1", - "apb1_uart2", "apb1_uart3", - "apb1_uart4", "apb1_uart5"; - }; -+ -+ cpus_clk: clk@08001410 { -+ compatible = "allwinner,sun9i-a80-cpus-clk"; -+ reg = <0x08001410 0x4>; -+ #clock-cells = <0>; -+ clocks = <&osc32k>, <&osc24M>, <&pll4>, <&pll3>; -+ clock-output-names = "cpus"; -+ }; -+ -+ ahbs: ahbs_clk { -+ compatible = "fixed-factor-clock"; -+ #clock-cells = <0>; -+ clock-div = <1>; -+ clock-mult = <1>; -+ clocks = <&cpus_clk>; -+ clock-output-names = "ahbs"; -+ }; -+ -+ apbs: clk@0800141c { -+ compatible = "allwinner,sun8i-a23-apb0-clk"; -+ reg = <0x0800141c 0x4>; -+ #clock-cells = <0>; -+ clocks = <&ahbs>; -+ clock-output-names = "apbs"; -+ }; -+ -+ apbs_gates: clk@08001428 { -+ compatible = "allwinner,sun9i-a80-apbs-gates-clk"; -+ reg = <0x08001428 0x4>; -+ #clock-cells = <1>; -+ clocks = <&apbs>; -+ clock-indices = <0>, <1>, -+ <2>, <3>, -+ <4>, <5>, -+ <6>, <7>, -+ <12>, <13>, -+ <16>, <17>, -+ <18>, <20>; -+ clock-output-names = "apbs_pio", "apbs_ir", -+ "apbs_timer", "apbs_rsb", -+ "apbs_uart", "apbs_1wire", -+ "apbs_i2c0", "apbs_i2c1", -+ "apbs_ps2_0", "apbs_ps2_1", -+ "apbs_dma", "apbs_i2s0", -+ "apbs_i2s1", "apbs_twd"; -+ }; -+ -+ r_1wire_clk: clk@08001450 { -+ reg = <0x08001450 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_1wire"; -+ }; -+ -+ r_ir_clk: clk@08001454 { -+ reg = <0x08001454 0x4>; -+ #clock-cells = <0>; -+ compatible = "allwinner,sun4i-a10-mod0-clk"; -+ clocks = <&osc32k>, <&osc24M>; -+ clock-output-names = "r_ir"; -+ }; - }; - - soc { -@@ -443,7 +543,7 @@ - }; - - mmc0: mmc@01c0f000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c0f000 0x1000>; - clocks = <&mmc_config_clk 0>, <&mmc0_clk 0>, - <&mmc0_clk 1>, <&mmc0_clk 2>; -@@ -457,7 +557,7 @@ - }; - - mmc1: mmc@01c10000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c10000 0x1000>; - clocks = <&mmc_config_clk 1>, <&mmc1_clk 0>, - <&mmc1_clk 1>, <&mmc1_clk 2>; -@@ -471,7 +571,7 @@ - }; - - mmc2: mmc@01c11000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c11000 0x1000>; - clocks = <&mmc_config_clk 2>, <&mmc2_clk 0>, - <&mmc2_clk 1>, <&mmc2_clk 2>; -@@ -485,7 +585,7 @@ - }; - - mmc3: mmc@01c12000 { -- compatible = "allwinner,sun5i-a13-mmc"; -+ compatible = "allwinner,sun9i-a80-mmc"; - reg = <0x01c12000 0x1000>; - clocks = <&mmc_config_clk 3>, <&mmc3_clk 0>, - <&mmc3_clk 1>, <&mmc3_clk 2>; -@@ -582,7 +682,7 @@ - clocks = <&apb0_gates 5>; - gpio-controller; - interrupt-controller; -- #interrupt-cells = <2>; -+ #interrupt-cells = <3>; - #size-cells = <0>; - #gpio-cells = <3>; - -@@ -604,7 +704,8 @@ - mmc2_8bit_pins: mmc2_8bit { - allwinner,pins = "PC6", "PC7", "PC8", "PC9", - "PC10", "PC11", "PC12", -- "PC13", "PC14", "PC15"; -+ "PC13", "PC14", "PC15", -+ "PC16"; - allwinner,function = "mmc2"; - allwinner,drive = ; - allwinner,pull = ; -@@ -752,14 +853,83 @@ - interrupts = ; - }; - -+ apbs_rst: reset@080014b0 { -+ reg = <0x080014b0 0x4>; -+ compatible = "allwinner,sun6i-a31-clock-reset"; -+ #reset-cells = <1>; -+ }; -+ -+ nmi_intc: interrupt-controller@080015a0 { -+ compatible = "allwinner,sun9i-a80-nmi"; -+ interrupt-controller; -+ #interrupt-cells = <2>; -+ reg = <0x080015a0 0xc>; -+ interrupts = ; -+ }; -+ -+ r_ir: ir@08002000 { -+ compatible = "allwinner,sun5i-a13-ir"; -+ interrupts = ; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_ir_pins>; -+ clocks = <&apbs_gates 1>, <&r_ir_clk>; -+ clock-names = "apb", "ir"; -+ resets = <&apbs_rst 1>; -+ reg = <0x08002000 0x40>; -+ status = "disabled"; -+ }; -+ - r_uart: serial@08002800 { - compatible = "snps,dw-apb-uart"; - reg = <0x08002800 0x400>; - interrupts = ; - reg-shift = <2>; - reg-io-width = <4>; -- clocks = <&osc24M>; -+ clocks = <&apbs_gates 4>; -+ resets = <&apbs_rst 4>; - status = "disabled"; - }; -+ -+ r_pio: pinctrl@08002c00 { -+ compatible = "allwinner,sun9i-a80-r-pinctrl"; -+ reg = <0x08002c00 0x400>; -+ interrupts = , -+ ; -+ clocks = <&apbs_gates 0>; -+ resets = <&apbs_rst 0>; -+ gpio-controller; -+ interrupt-controller; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ #gpio-cells = <3>; -+ -+ r_ir_pins: r_ir { -+ allwinner,pins = "PL6"; -+ allwinner,function = "s_cir_rx"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ -+ r_rsb_pins: r_rsb { -+ allwinner,pins = "PN0", "PN1"; -+ allwinner,function = "s_rsb"; -+ allwinner,drive = ; -+ allwinner,pull = ; -+ }; -+ }; -+ -+ r_rsb: i2c@08003400 { -+ compatible = "allwinner,sun8i-a23-rsb"; -+ reg = <0x08003400 0x400>; -+ interrupts = ; -+ clocks = <&apbs_gates 3>; -+ clock-frequency = <3000000>; -+ resets = <&apbs_rst 3>; -+ pinctrl-names = "default"; -+ pinctrl-0 = <&r_rsb_pins>; -+ status = "disabled"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ }; - }; - }; ---- /dev/null -+++ b/arch/arm/dts/sunxi-itead-core-common.dtsi -@@ -0,0 +1,136 @@ -+/* -+ * Copyright 2015 - Marcus Cooper -+ * -+ * This file is dual-licensed: you can use it either under the terms -+ * of the GPL or the X11 license, at your option. Note that this dual -+ * licensing only applies to this file, and not this project as a -+ * whole. -+ * -+ * a) This file is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License as -+ * published by the Free Software Foundation; either version 2 of the -+ * License, or (at your option) any later version. -+ * -+ * This file is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * Or, alternatively, -+ * -+ * b) Permission is hereby granted, free of charge, to any person -+ * obtaining a copy of this software and associated documentation -+ * files (the "Software"), to deal in the Software without -+ * restriction, including without limitation the rights to use, -+ * copy, modify, merge, publish, distribute, sublicense, and/or -+ * sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following -+ * conditions: -+ * -+ * The above copyright notice and this permission notice shall be -+ * included in all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ * OTHER DEALINGS IN THE SOFTWARE. -+ */ -+ -+#include "sunxi-common-regulators.dtsi" -+ -+/ { -+ aliases { -+ serial0 = &uart0; -+ }; -+ -+ chosen { -+ stdout-path = "serial0:115200n8"; -+ }; -+}; -+ -+&cpu0 { -+ cpu-supply = <®_dcdc2>; -+}; -+ -+&ehci0 { -+ status = "okay"; -+}; -+ -+&ehci1 { -+ status = "okay"; -+}; -+ -+&i2c0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c0_pins_a>; -+ status = "okay"; -+ -+ axp209: pmic@34 { -+ reg = <0x34>; -+ }; -+}; -+ -+&i2c1 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&i2c1_pins_a>; -+ status = "okay"; -+}; -+ -+&ohci0 { -+ status = "okay"; -+}; -+ -+&ohci1 { -+ status = "okay"; -+}; -+ -+#include "axp209.dtsi" -+ -+®_dcdc2 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-cpu"; -+}; -+ -+®_dcdc3 { -+ regulator-always-on; -+ regulator-min-microvolt = <1000000>; -+ regulator-max-microvolt = <1400000>; -+ regulator-name = "vdd-int-dll"; -+}; -+ -+®_ldo1 { -+ regulator-name = "vdd-rtc"; -+}; -+ -+®_ldo2 { -+ regulator-always-on; -+ regulator-min-microvolt = <3000000>; -+ regulator-max-microvolt = <3000000>; -+ regulator-name = "avcc"; -+}; -+ -+®_usb1_vbus { -+ status = "okay"; -+}; -+ -+®_usb2_vbus { -+ status = "okay"; -+}; -+ -+&uart0 { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&uart0_pins_a>; -+ status = "okay"; -+}; -+ -+&usbphy { -+ usb1_vbus-supply = <®_usb1_vbus>; -+ usb2_vbus-supply = <®_usb2_vbus>; -+ status = "okay"; -+}; ---- a/arch/arm/dts/sunxi-q8-common.dtsi -+++ b/arch/arm/dts/sunxi-q8-common.dtsi -@@ -75,3 +75,9 @@ - voltage = <400000>; - }; - }; -+ -+&pwm { -+ pinctrl-names = "default"; -+ pinctrl-0 = <&pwm0_pins>; -+ status = "okay"; -+}; diff --git a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch b/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch deleted file mode 100644 index 45416703a..000000000 --- a/package/boot/uboot-sunxi/patches/012-sun6i-fix-clock_twi_onoff.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 730d2f3a41c5ccae71b5008fffdf697d143be68c Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 20:44:51 +0100 -Subject: [PATCH] sunxi: Fix clock_twi_onoff for sun6i - -The clock_sun6i.c implementation was not deasserting the reset for -the regular i2c controllers, this commit fixes this. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -100,13 +100,18 @@ int clock_twi_onoff(int port, int state) - return 0; - } - -- /* set the apb clock gate for twi */ -- if (state) -+ /* set the apb clock gate and reset for twi */ -+ if (state) { - setbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -- else -+ setbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); -+ } else { -+ clrbits_le32(&ccm->apb2_reset_cfg, -+ 1 << (APB2_RESET_TWI_SHIFT + port)); - clrbits_le32(&ccm->apb2_gate, - CLK_GATE_OPEN << (APB2_GATE_TWI_SHIFT+port)); -+ } - - return 0; - } diff --git a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch b/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch deleted file mode 100644 index 47f825c57..000000000 --- a/package/boot/uboot-sunxi/patches/013-enable-realtek-phy.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 1eae8f66ff749409eb96e2f3f3387c56232d0b8a Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Wed, 16 Mar 2016 13:46:22 +0100 -Subject: [PATCH] sunxi: Enable realtek phy support - -Enable building of drivers/net/phy/realtek.c so that realtek phys -get properly initialized. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -314,6 +314,7 @@ extern int soft_i2c_gpio_scl; - #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ - #define CONFIG_PHY_ADDR 1 - #define CONFIG_MII /* MII PHY management */ -+#define CONFIG_PHY_REALTEK - #endif - - #ifdef CONFIG_USB_EHCI_HCD diff --git a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch b/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch deleted file mode 100644 index cf511ce77..000000000 --- a/package/boot/uboot-sunxi/patches/014-fix-gmac-init.patch +++ /dev/null @@ -1,127 +0,0 @@ -From fc8991c61c393ce6a9d3dfc97cb56dbbd9e8cbba Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Thu, 17 Mar 2016 13:53:03 +0100 -Subject: [PATCH] sunxi: Fix gmac not working due to cpu_eth_init no longer - being called - -cpu_eth_init is no longer called for dm enabled eth drivers, this -was causing the sunxi gmac eth controller to no longer work in u-boot. - -This commit fixes this by calling the clock, reset and pinmux setup -function from s_init() and enabling the phy power pin (if any) from -board_init(). - -The enabling of phy power cannot be done from s_init because it uses dm -and dm is not ready yet at this point. - -Note that the mdelay is dropped as the phy gets enabled much earlier -now, so it is no longer needed. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell -Tested-by: Karsten Merker -Tested-by: Michael Haas ---- - arch/arm/cpu/armv7/sunxi/board.c | 28 +--------------------------- - arch/arm/include/asm/arch-sunxi/sys_proto.h | 6 +++++- - board/sunxi/board.c | 5 +++++ - board/sunxi/gmac.c | 14 +------------- - 4 files changed, 12 insertions(+), 41 deletions(-) - ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -136,6 +136,7 @@ void s_init(void) - timer_init(); - gpio_init(); - i2c_init_board(); -+ eth_init_board(); - } - - #ifdef CONFIG_SPL_BUILD -@@ -243,30 +244,3 @@ void enable_caches(void) - dcache_enable(); - } - #endif -- --#ifdef CONFIG_CMD_NET --/* -- * Initializes on-chip ethernet controllers. -- * to override, implement board_eth_init() -- */ --int cpu_eth_init(bd_t *bis) --{ -- __maybe_unused int rc; -- --#ifdef CONFIG_MACPWR -- gpio_request(CONFIG_MACPWR, "macpwr"); -- gpio_direction_output(CONFIG_MACPWR, 1); -- mdelay(200); --#endif -- --#ifdef CONFIG_SUNXI_GMAC -- rc = sunxi_gmac_initialize(bis); -- if (rc < 0) { -- printf("sunxi: failed to initialize gmac\n"); -- return rc; -- } --#endif -- -- return 0; --} --#endif ---- a/arch/arm/include/asm/arch-sunxi/sys_proto.h -+++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h -@@ -24,6 +24,10 @@ void sdelay(unsigned long); - void return_to_fel(uint32_t lr, uint32_t sp); - - /* Board / SoC level designware gmac init */ --int sunxi_gmac_initialize(bd_t *bis); -+#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC -+void eth_init_board(void); -+#else -+static inline void eth_init_board(void) {} -+#endif - - #endif ---- a/board/sunxi/board.c -+++ b/board/sunxi/board.c -@@ -90,6 +90,11 @@ int board_init(void) - if (ret) - return ret; - -+#ifdef CONFIG_MACPWR -+ gpio_request(CONFIG_MACPWR, "macpwr"); -+ gpio_direction_output(CONFIG_MACPWR, 1); -+#endif -+ - /* Uses dm gpio code so do this here and not in i2c_init_board() */ - return soft_i2c_board_init(); - } ---- a/board/sunxi/gmac.c -+++ b/board/sunxi/gmac.c -@@ -6,7 +6,7 @@ - #include - #include - --int sunxi_gmac_initialize(bd_t *bis) -+void eth_init_board(void) - { - int pin; - struct sunxi_ccm_reg *const ccm = -@@ -79,16 +79,4 @@ int sunxi_gmac_initialize(bd_t *bis) - for (pin = SUNXI_GPA(26); pin <= SUNXI_GPA(27); pin++) - sunxi_gpio_set_cfgpin(pin, SUN6I_GPA_GMAC); - #endif -- --#ifdef CONFIG_DM_ETH -- return 0; --#else --# ifdef CONFIG_RGMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); --# elif defined CONFIG_GMII -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII); --# else -- return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII); --# endif --#endif - } diff --git a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch b/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch deleted file mode 100644 index 95a77c68d..000000000 --- a/package/boot/uboot-sunxi/patches/015-fix-2nd-usb-ctrler-on-sun47i.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 948603d4d637a0e04a3214253b911cfc4ed11220 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Mon, 21 Mar 2016 14:44:35 +0100 -Subject: [PATCH] sunxi: Fix 2nd usb controller on sun4i/sun7i no longer - working - -The 2nd usb controller on sun4i/sun7i has its base address 0x8000 -bytes from the 1st one, rather then 0x1000. Also the ahb clk gates -are interleaved with the ohci clk-gates introducing a hole between -the clks for usb1 and usb2. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - drivers/usb/host/ehci-sunxi.c | 13 +++++++++++-- - drivers/usb/host/ohci-sunxi.c | 15 ++++++++++++--- - 2 files changed, 23 insertions(+), 5 deletions(-) - ---- a/drivers/usb/host/ehci-sunxi.c -+++ b/drivers/usb/host/ehci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ehci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ehci_sunxi_priv { - struct ehci_ctrl ehci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -39,8 +47,9 @@ static int ehci_usb_probe(struct udevice - #ifdef CONFIG_MACH_SUN8I_H3 - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_OHCI0; - #endif -- priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)hccr - SUNXI_USB1_BASE) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - #ifdef CONFIG_SUNXI_GEN_SUN6I ---- a/drivers/usb/host/ohci-sunxi.c -+++ b/drivers/usb/host/ohci-sunxi.c -@@ -17,6 +17,14 @@ - #include - #include "ohci.h" - -+#ifdef CONFIG_SUNXI_GEN_SUN4I -+#define BASE_DIST 0x8000 -+#define AHB_CLK_DIST 2 -+#else -+#define BASE_DIST 0x1000 -+#define AHB_CLK_DIST 1 -+#endif -+ - struct ohci_sunxi_priv { - ohci_t ohci; - int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */ -@@ -42,9 +50,10 @@ static int ohci_usb_probe(struct udevice - priv->ahb_gate_mask |= 1 << AHB_GATE_OFFSET_USB_EHCI0; - #endif - priv->usb_gate_mask = CCM_USB_CTRL_OHCI0_CLK; -- priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / 0x1000 + 1; -- priv->ahb_gate_mask <<= priv->phy_index - 1; -- priv->usb_gate_mask <<= priv->phy_index - 1; -+ priv->phy_index = ((u32)regs - (SUNXI_USB1_BASE + 0x400)) / BASE_DIST; -+ priv->ahb_gate_mask <<= priv->phy_index * AHB_CLK_DIST; -+ priv->usb_gate_mask <<= priv->phy_index; -+ priv->phy_index++; /* Non otg phys start at 1 */ - - setbits_le32(&ccm->ahb_gate0, priv->ahb_gate_mask); - setbits_le32(&ccm->usb_clk_cfg, priv->usb_gate_mask); diff --git a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch b/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch deleted file mode 100644 index 04a2af72e..000000000 --- a/package/boot/uboot-sunxi/patches/016-spl-print-mmc-slot.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8f10b5c65611e6c15a113bf63289b6696452f90d Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Sun, 20 Mar 2016 14:17:10 +0100 -Subject: [PATCH] spl: Print from which mmc slot spl is trying to boot - -On some sunxi boards (and presumably also non sunxi boards) u-boot can -be either loaded from a sdcard in a micro-sd slot, or from eMMC. - -Print which MMC spl tries to boot from, to help debugging. - -Signed-off-by: Hans de Goede -Reviewed-by: Tom Rini ---- - common/spl/spl.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - ---- a/common/spl/spl.c -+++ b/common/spl/spl.c -@@ -210,9 +210,9 @@ struct boot_device_name boot_name_table[ - { BOOT_DEVICE_RAM, "RAM" }, - #endif - #ifdef CONFIG_SPL_MMC_SUPPORT -- { BOOT_DEVICE_MMC1, "MMC" }, -- { BOOT_DEVICE_MMC2, "MMC" }, -- { BOOT_DEVICE_MMC2_2, "MMC" }, -+ { BOOT_DEVICE_MMC1, "MMC1" }, -+ { BOOT_DEVICE_MMC2, "MMC2" }, -+ { BOOT_DEVICE_MMC2_2, "MMC2_2" }, - #endif - #ifdef CONFIG_SPL_NAND_SUPPORT - { BOOT_DEVICE_NAND, "NAND" }, diff --git a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch b/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch deleted file mode 100644 index 098fe7203..000000000 --- a/package/boot/uboot-sunxi/patches/017-usb-add-support-for-usb3-vbus-pin.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 60fa63012fcdc3c4ec1497bf5e358f0a90b40949 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:42:01 +0100 -Subject: [PATCH] sunxi: Add support for USB vbus pin for USB3 - -The H3 has USB0 - USB3, add support for having a USB vbus pin for USB3. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - arch/arm/cpu/armv7/sunxi/usb_phy.c | 1 + - board/sunxi/Kconfig | 6 ++++++ - 2 files changed, 7 insertions(+) - ---- a/arch/arm/cpu/armv7/sunxi/usb_phy.c -+++ b/arch/arm/cpu/armv7/sunxi/usb_phy.c -@@ -76,6 +76,7 @@ static int get_vbus_gpio(int index) - case 0: return sunxi_name_to_gpio(CONFIG_USB0_VBUS_PIN); - case 1: return sunxi_name_to_gpio(CONFIG_USB1_VBUS_PIN); - case 2: return sunxi_name_to_gpio(CONFIG_USB2_VBUS_PIN); -+ case 3: return sunxi_name_to_gpio(CONFIG_USB3_VBUS_PIN); - } - return -EINVAL; - } ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -341,6 +341,12 @@ config USB2_VBUS_PIN - ---help--- - See USB1_VBUS_PIN help text. - -+config USB3_VBUS_PIN -+ string "Vbus enable pin for usb3 (ehci2)" -+ default "" -+ ---help--- -+ See USB1_VBUS_PIN help text. -+ - config I2C0_ENABLE - bool "Enable I2C/TWI controller 0" - default y if MACH_SUN4I || MACH_SUN5I || MACH_SUN7I diff --git a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch b/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch deleted file mode 100644 index a216bc9f1..000000000 --- a/package/boot/uboot-sunxi/patches/018-usb-specify-vbus-pins-on-orangepis.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ce0d0926758f631fdd655d438acd32d5935d43a4 Mon Sep 17 00:00:00 2001 -From: Hans de Goede -Date: Fri, 18 Mar 2016 08:45:21 +0100 -Subject: [PATCH] sunxi: Specify USB vbus pins for orangepi boards - -This fixes the USB ports not working on the orangepi_plus and stops us -from messing with gpio-s which we should not touch on the orangepi_pc. - -Signed-off-by: Hans de Goede -Acked-by: Ian Campbell ---- - configs/orangepi_pc_defconfig | 3 +++ - configs/orangepi_plus_defconfig | 1 + - 2 files changed, 4 insertions(+) - ---- a/configs/orangepi_pc_defconfig -+++ b/configs/orangepi_pc_defconfig -@@ -14,3 +14,6 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="" -+CONFIG_USB2_VBUS_PIN="" -+CONFIG_USB3_VBUS_PIN="" ---- a/configs/orangepi_plus_defconfig -+++ b/configs/orangepi_plus_defconfig -@@ -14,3 +14,4 @@ CONFIG_SPL=y - CONFIG_CMD_GPIO=y - CONFIG_SY8106A_POWER=y - CONFIG_USB_EHCI_HCD=y -+CONFIG_USB1_VBUS_PIN="PG13" diff --git a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch b/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch deleted file mode 100644 index e7b8cd73d..000000000 --- a/package/boot/uboot-sunxi/patches/019-sid-add-efuse-support-for-h3-a83t.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 70fe24ed93fa90eb407d18a5fc9d9ad85ac9184c Mon Sep 17 00:00:00 2001 -From: Chen-Yu Tsai -Date: Wed, 27 Jan 2016 16:34:43 +0800 -Subject: [PATCH] sunxi: Support SID e-fuses on A83T and H3 - -On the A83T and H3, the SID block is at a different address. -Furthurmore, the e-fuses are at an offset of 0x200 within the -hardware's address space. - -Signed-off-by: Chen-Yu Tsai -Acked-by: Hans de Goede -Signed-off-by: Hans de Goede ---- - arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -+++ b/arch/arm/include/asm/arch-sunxi/cpu_sun4i.h -@@ -82,7 +82,14 @@ - #define SUNXI_AD_DA_BASE 0x01c22c00 - #define SUNXI_KEYPAD_BASE 0x01c23000 - #define SUNXI_TZPC_BASE 0x01c23400 -+ -+#if defined(CONFIG_MACH_SUN8I_A83T) || defined(CONFIG_MACH_SUN8I_H3) -+/* SID address space starts at 0x01c1400, but e-fuse is at offset 0x200 */ -+#define SUNXI_SID_BASE 0x01c14200 -+#else - #define SUNXI_SID_BASE 0x01c23800 -+#endif -+ - #define SUNXI_SJTAG_BASE 0x01c23c00 - - #define SUNXI_TP_BASE 0x01c25000 diff --git a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch b/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch deleted file mode 100644 index d49fc9737..000000000 --- a/package/boot/uboot-sunxi/patches/020-boot-display-board-model-on-startup.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 2af25b747340c6c8f6a6b9e27632db577bf4da52 Mon Sep 17 00:00:00 2001 -From: Simon Glass -Date: Mon, 22 Feb 2016 22:55:46 -0700 -Subject: [PATCH] sunxi: Display the board model on start-up - -It is useful to know which sunxi board you are booting. Display this on -start-up to avoid confusion. - -Signed-off-by: Simon Glass ---- - include/configs/sunxi-common.h | 1 + - 1 file changed, 1 insertion(+) - ---- a/include/configs/sunxi-common.h -+++ b/include/configs/sunxi-common.h -@@ -174,6 +174,7 @@ - - #define CONFIG_SYS_MONITOR_LEN (768 << 10) /* 768 KiB */ - #define CONFIG_IDENT_STRING " Allwinner Technology" -+#define CONFIG_DISPLAY_BOARDINFO - - #define CONFIG_ENV_OFFSET (544 << 10) /* (8 + 24 + 512) KiB */ - #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */ diff --git a/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch new file mode 100644 index 000000000..a7bfdd62d --- /dev/null +++ b/package/boot/uboot-sunxi/patches/060-sun7i-Add-support-for-Olimex-A20-OLinuXino-LIME2-eMM.patch @@ -0,0 +1,76 @@ +From 335d30050b0d02444c9297f7a9b0cbf75dce847f Mon Sep 17 00:00:00 2001 +From: Olliver Schinagl +Date: Fri, 12 May 2017 11:38:54 +0200 +Subject: sun7i: Add support for Olimex A20-OLinuXino-LIME2-eMMC + +This patch adds support for the Olimex OLinuXino Lime2 with eMMC flash +storage. +https://www.olimex.com/Products/OLinuXino/A20/A20-OLinuXino-LIME2-eMMC/ + +It is a assembly variant of the regular Lime2 but featuring eMMC for +storage. + +Signed-off-by: Olliver Schinagl +Signed-off-by: Jagan Teki +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/A20-OLinuXino-Lime2-eMMC_defconfig | 36 ++++++++++++++++++++++++++++++ + 2 files changed, 41 insertions(+) + create mode 100644 configs/A20-OLinuXino-Lime2-eMMC_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -88,6 +88,11 @@ M: Iain Paton + S: Maintained + F: configs/A20-OLinuXino-Lime2_defconfig + ++A20-OLINUXINO-LIME2-EMMC BOARD ++M: Olliver Schinagl ++S: Maintained ++F: configs/A20-OLinuXino-Lime2-eMMC_defconfig ++ + A33-OLINUXINO BOARD + M: Stefan Mavrodiev + S: Maintained +--- /dev/null ++++ b/configs/A20-OLinuXino-Lime2-eMMC_defconfig +@@ -0,0 +1,37 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_MACH_SUN7I=y ++CONFIG_DRAM_CLK=384 ++CONFIG_MMC0_CD_PIN="PH1" ++CONFIG_MMC_SUNXI_SLOT_EXTRA=2 ++CONFIG_USB0_VBUS_PIN="PC17" ++CONFIG_USB0_VBUS_DET="PH5" ++CONFIG_I2C1_ENABLE=y ++CONFIG_SATAPWR="PC3" ++CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-olinuxino-lime2-emmc" ++CONFIG_AHCI=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SPL=y ++CONFIG_SPL_I2C_SUPPORT=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++CONFIG_CMD_DFU=y ++CONFIG_CMD_USB_MASS_STORAGE=y ++# CONFIG_CMD_FPGA is not set ++# CONFIG_SPL_DOS_PARTITION is not set ++# CONFIG_SPL_ISO_PARTITION is not set ++# CONFIG_SPL_PARTITION_UUIDS is not set ++CONFIG_DFU_RAM=y ++CONFIG_ETH_DESIGNWARE=y ++CONFIG_RGMII=y ++CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 ++CONFIG_AXP_ALDO3_VOLT=2800 ++CONFIG_AXP_ALDO4_VOLT=2800 ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_MUSB_GADGET=y ++CONFIG_USB_GADGET=y ++CONFIG_USB_GADGET_DOWNLOAD=y ++CONFIG_G_DNL_MANUFACTURER="Allwinner Technology" ++CONFIG_G_DNL_VENDOR_NUM=0x1f3a ++CONFIG_G_DNL_PRODUCT_NUM=0x1010 diff --git a/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch new file mode 100644 index 000000000..8db3e67e5 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/061-ARM-dts-sunxi-Change-node-name-for-pwrseq-pin-on-Oli.patch @@ -0,0 +1,31 @@ +From fb7fe04da2187b9853d713cb643d01bd56813e3d Mon Sep 17 00:00:00 2001 +From: Emmanuel Vadot +Date: Fri, 12 May 2017 11:38:53 +0200 +Subject: ARM: dts: sunxi: Change node name for pwrseq pin on + Olinuxino-lime2-emmc + +The node name for the power seq pin is mmc2@0 like the mmc2_pins_a one. +This makes the original node (mmc2_pins_a) scrapped out of the dtb and +result in a unusable eMMC if U-Boot didn't configured the pins to the +correct functions. + +Signed-off-by: Emmanuel Vadot +Signed-off-by: Maxime Ripard +Signed-off-by: Olliver Schinagl +Acked-by: Maxime Ripard +Reviewed-by: Jagan Teki +--- + arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts ++++ b/arch/arm/dts/sun7i-a20-olinuxino-lime2-emmc.dts +@@ -56,7 +56,7 @@ + }; + + &pio { +- mmc2_pins_nrst: mmc2@0 { ++ mmc2_pins_nrst: mmc2-rst-pin { + allwinner,pins = "PC16"; + allwinner,function = "gpio_out"; + allwinner,drive = ; diff --git a/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch new file mode 100644 index 000000000..df2300194 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/062-A20-improve-gmac-upload.patch @@ -0,0 +1,12 @@ + GNU nano 2.7.4 File: 062-A20-improve-gmac-upload.patch + +--- a/configs/A20-OLinuXino-Lime2_defconfig ++++ b/configs/A20-OLinuXino-Lime2_defconfig +@@ -24,6 +24,7 @@ CONFIG_DFU_RAM=y + CONFIG_ETH_DESIGNWARE=y + CONFIG_RGMII=y + CONFIG_SUN7I_GMAC=y ++CONFIG_GMAC_TX_DELAY=1 + CONFIG_AXP_ALDO3_VOLT=2800 + CONFIG_AXP_ALDO4_VOLT=2800 + CONFIG_USB_EHCI_HCD=y diff --git a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch index a402feb3c..40d79878a 100644 --- a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch +++ b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch @@ -12,9 +12,9 @@ More specifically, the following settings are now used: * up to 1152MHz: mul=3, div=2 (unchanged) * above 1152MHz: mul=4, div=2 (was: mul=2, div=1) ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -122,11 +122,12 @@ void clock_set_pll1(unsigned int clk) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -107,11 +107,12 @@ void clock_set_pll1(unsigned int clk) struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; const int p = 0; diff --git a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch index d200633bc..a8e03e2fb 100644 --- a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch +++ b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch @@ -16,9 +16,9 @@ order of magnitude as Boot1. Furthermore, a bit of documentation is added to clarify that the required setting for the PLL LDO is 1.37v as per the A31 manual. ---- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -+++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c -@@ -24,14 +24,27 @@ void clock_init_safe(void) +--- a/arch/arm/mach-sunxi/clock_sun6i.c ++++ b/arch/arm/mach-sunxi/clock_sun6i.c +@@ -26,13 +26,26 @@ void clock_init_safe(void) struct sunxi_prcm_reg * const prcm = (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE; @@ -34,9 +34,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. clrsetbits_le32(&prcm->pll_ctrl1, ~PRCM_PLL_CTRL_LDO_KEY_MASK, PRCM_PLL_CTRL_LDO_DIGITAL_EN | PRCM_PLL_CTRL_LDO_ANALOG_EN | - PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1140)); -+ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370) ); ++ PRCM_PLL_CTRL_EXT_OSC_EN | PRCM_PLL_CTRL_LDO_OUT_L(1370)); clrbits_le32(&prcm->pll_ctrl1, PRCM_PLL_CTRL_LDO_KEY_MASK); - ++ + /* Give the PLL LDO voltage setting some time to take hold. + * Notes: + * 1) We need to use sdelay() as the timers aren't set up yet. @@ -44,10 +44,9 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. + * iterations through a loop. + */ + sdelay(100000); -+ - clock_set_pll1(408000000); + #endif - writel(PLL6_CFG_DEFAULT, &ccm->pll6_cfg); + #if defined(CONFIG_MACH_SUN8I_R40) || defined(CONFIG_MACH_SUN50I) --- a/arch/arm/include/asm/arch-sunxi/prcm.h +++ b/arch/arm/include/asm/arch-sunxi/prcm.h @@ -111,13 +111,13 @@ diff --git a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch index bf5dc66e1..8bab22051 100644 --- a/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/100-sun6i-alternate-on-UART2.patch @@ -6,11 +6,11 @@ Subject: sun6i: define alternate-function for UART2 on GPG --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h -@@ -180,6 +180,7 @@ enum sunxi_gpio_number { +@@ -186,6 +186,7 @@ enum sunxi_gpio_number { #define SUN6I_GPG_SDC1 2 #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 +#define SUN6I_GPG_UART2 2 #define SUN5I_GPG_UART1 4 - #define SUN4I_GPH_SDC1 5 + #define SUN6I_GPH_PWM 2 diff --git a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch index 087074d0c..d140f2d53 100644 --- a/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch +++ b/package/boot/uboot-sunxi/patches/101-sun6i-support-console-on-UART2.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:53:11 +0200 Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) ---- a/arch/arm/cpu/armv7/sunxi/board.c -+++ b/arch/arm/cpu/armv7/sunxi/board.c -@@ -88,6 +88,10 @@ static int gpio_init(void) +--- a/arch/arm/mach-sunxi/board.c ++++ b/arch/arm/mach-sunxi/board.c +@@ -126,6 +126,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); @@ -19,7 +19,7 @@ Subject: ARM: sun6i: Support console on UART2 (GPG6/GPG7) sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h -@@ -260,6 +260,8 @@ extern int soft_i2c_gpio_scl; +@@ -259,6 +259,8 @@ extern int soft_i2c_gpio_scl; #endif #elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" diff --git a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch index ee1e3c9bf..41039796a 100644 --- a/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch +++ b/package/boot/uboot-sunxi/patches/102-sunxi-make_CONS_INDEX-configurable.patch @@ -4,9 +4,9 @@ Date: Tue, 16 Jun 2015 10:59:38 +0200 Subject: ARM: sunxi: Make CONS_INDEX configurable ---- a/board/sunxi/Kconfig -+++ b/board/sunxi/Kconfig -@@ -229,6 +229,14 @@ config SYS_BOARD +--- a/arch/arm/mach-sunxi/Kconfig ++++ b/arch/arm/mach-sunxi/Kconfig +@@ -412,6 +412,14 @@ config SYS_BOARD config SYS_SOC default "sunxi" diff --git a/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch new file mode 100644 index 000000000..d61895a3f --- /dev/null +++ b/package/boot/uboot-sunxi/patches/200-mkimage-check-environment-for-dtc-binary-location.patch @@ -0,0 +1,35 @@ +From 5b707cdadb35d896daafff52983416e1c617745b Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 22:23:15 +0200 +Subject: [PATCH] mkimage: check environment for dtc binary location + +Currently mkimage assumes the dtc binary is in the path and fails +otherwise. This patch makes it check the DTC environment variable first +for the dtc binary and then fall back to the default path. This makes +it possible to call the u-boot build with make DTC=... and build a fit +image with the dtc binary not being the the default path. + +Signed-off-by: Hauke Mehrtens +Cc: Simon Glass +--- + tools/fit_image.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/tools/fit_image.c ++++ b/tools/fit_image.c +@@ -647,9 +647,14 @@ static int fit_handle_file(struct image_ + } + *cmd = '\0'; + } else if (params->datafile) { ++ const char* dtc = getenv("DTC"); ++ ++ if (!dtc) ++ dtc = MKIMAGE_DTC; ++ + /* dtc -I dts -O dtb -p 500 datafile > tmpfile */ + snprintf(cmd, sizeof(cmd), "%s %s %s > %s", +- MKIMAGE_DTC, params->dtc, params->datafile, tmpfile); ++ dtc, params->dtc, params->datafile, tmpfile); + debug("Trying to execute \"%s\"\n", cmd); + } else { + snprintf(cmd, sizeof(cmd), "cp %s %s", diff --git a/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch new file mode 100644 index 000000000..25edf5104 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/210-Revert-fdt-Makefile-Build-python-libfdt-library-if-n.patch @@ -0,0 +1,89 @@ +From eed65e5c25cbc4b6e893f140e9d7898f4624c114 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Wed, 19 Jul 2017 23:12:38 +0200 +Subject: [PATCH 210/213] Revert "fdt: Makefile: Build python libfdt library if + needed" + +This reverts commit e38ffc42674fedc750ca895046be0bd983b56dd5. +--- + Makefile | 17 ++--------------- + scripts/Makefile.spl | 17 ++++------------- + 2 files changed, 6 insertions(+), 28 deletions(-) + +--- a/Makefile ++++ b/Makefile +@@ -1116,7 +1116,7 @@ cmd_ldr = $(LD) $(LDFLAGS_$(@F)) \ + + u-boot.rom: u-boot-x86-16bit.bin u-boot.bin \ + $(if $(CONFIG_SPL_X86_16BIT_INIT),spl/u-boot-spl.bin) \ +- $(if $(CONFIG_HAVE_REFCODE),refcode.bin) checkbinman FORCE ++ $(if $(CONFIG_HAVE_REFCODE),refcode.bin) FORCE + $(call if_changed,binman) + + OBJCOPYFLAGS_u-boot-x86-16bit.bin := -O binary -j .start16 -j .resetvec +@@ -1125,8 +1125,7 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb \ +- checkbinman FORCE ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE + $(call if_changed,binman) + endif + +@@ -1355,18 +1354,6 @@ $(version_h): include/config/uboot.relea + $(timestamp_h): $(srctree)/Makefile FORCE + $(call filechk,timestamp.h) + +-checkbinman: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo >&2; \ +- echo >&2 '*** binman needs the Python libfdt library.'; \ +- echo >&2 '*** Either install it on your system, or try:'; \ +- echo >&2 '***'; \ +- echo >&2 '*** sudo apt-get install swig libpython-dev'; \ +- echo >&2 '***'; \ +- echo >&2 '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + # --------------------------------------------------------------------------- + quiet_cmd_cpp_lds = LDS $@ + cmd_cpp_lds = $(CPP) -Wp,-MD,$(depfile) $(cpp_flags) $(LDPPFLAGS) \ +--- a/scripts/Makefile.spl ++++ b/scripts/Makefile.spl +@@ -257,12 +257,14 @@ PHONY += dts_dir + dts_dir: + $(shell [ -d $(obj)/dts ] || mkdir -p $(obj)/dts) + +-include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++include/generated/dt-structs.h: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtoch) + +-$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir checkdtoc ++$(obj)/dts/dt-platdata.c: $(obj)/$(SPL_BIN).dtb dts_dir dtoc + $(call if_changed,dtocc) + ++dtoc: #$(objtree)/tools/_libfdt.so ++ + ifdef CONFIG_SAMSUNG + ifdef CONFIG_VAR_SIZE_SPL + VAR_SIZE_PARAM = --vs +@@ -355,17 +357,6 @@ ifneq ($(cmd_files),) + include $(cmd_files) + endif + +-checkdtoc: tools +- @if ! ( echo 'import libfdt' | ( PYTHONPATH=tools python )); then \ +- echo '*** dtoc needs the Python libfdt library. Either '; \ +- echo '*** install it on your system, or try:'; \ +- echo '***'; \ +- echo '*** sudo apt-get install swig libpython-dev'; \ +- echo '***'; \ +- echo '*** to have U-Boot build its own version.'; \ +- false; \ +- fi +- + PHONY += FORCE + FORCE: + diff --git a/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch new file mode 100644 index 000000000..d40238d3a --- /dev/null +++ b/package/boot/uboot-sunxi/patches/211-Revert-scripts-Makefile.lib-Always-have-.-u-boot.dts.patch @@ -0,0 +1,26 @@ +From cdee74ad13e933631caf7f544c319d8e981c6063 Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:49:25 +0200 +Subject: [PATCH 211/213] Revert "scripts/Makefile.lib: Always have + ...-u-boot.dtsi be able to override" + +This reverts commit 7452946e7f3742b3ff1cb4a50603e7492aceea88. +--- + scripts/Makefile.lib | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -306,10 +306,10 @@ $(obj)/%.dtb.S: $(obj)/%.dtb + + quiet_cmd_dtc = DTC $@ + # Modified for U-Boot +-# Bring in any U-Boot-specific include at the end of the file ++# Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed "$$ a\#include \"$(u_boot_dtsi)\"") | \ ++ | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch new file mode 100644 index 000000000..1a5603417 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/212-Revert-Avoid-non-portable-sed-construct.patch @@ -0,0 +1,21 @@ +From 53d123333fa0ddc64b2c55d48366f4582ac6922d Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:50:52 +0200 +Subject: [PATCH 212/213] Revert "Avoid non-portable sed construct" + +This reverts commit 208db781cad4c24f538658a9cb17e24fa43ca3c9. +--- + scripts/Makefile.lib | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -309,7 +309,7 @@ quiet_cmd_dtc = DTC $@ + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ + cat $< $(if $(u_boot_dtsi),\ +- | sed '/^\/ {$$/{x;s%$$%\#include \"$(u_boot_dtsi)\"%;G;}') | \ ++ | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch new file mode 100644 index 000000000..6f75259a7 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/213-Revert-sunxi-Use-binman-for-sunxi-boards.patch @@ -0,0 +1,58 @@ +From cf1defd80b7594f6f2721ab2dacffe48522abfca Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Thu, 20 Jul 2017 19:51:01 +0200 +Subject: [PATCH 213/213] Revert "sunxi: Use binman for sunxi boards" + +This reverts commit 61b994a386eb6f631dc1c2194d4cce9b1a43542c. +--- + Makefile | 6 ++++-- + arch/arm/dts/sunxi-u-boot.dtsi | 14 -------------- + scripts/Makefile.lib | 4 ++-- + 3 files changed, 6 insertions(+), 18 deletions(-) + delete mode 100644 arch/arm/dts/sunxi-u-boot.dtsi + +--- a/Makefile ++++ b/Makefile +@@ -1125,8 +1125,10 @@ u-boot-x86-16bit.bin: u-boot FORCE + endif + + ifneq ($(CONFIG_ARCH_SUNXI),) +-u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img u-boot.dtb FORCE +- $(call if_changed,binman) ++OBJCOPYFLAGS_u-boot-sunxi-with-spl.bin = -I binary -O binary \ ++ --pad-to=$(CONFIG_SPL_PAD_TO) --gap-fill=0xff ++u-boot-sunxi-with-spl.bin: spl/sunxi-spl.bin u-boot.img FORCE ++ $(call if_changed,pad_cat) + endif + + ifneq ($(CONFIG_TEGRA),) +--- a/arch/arm/dts/sunxi-u-boot.dtsi ++++ /dev/null +@@ -1,14 +0,0 @@ +-#include +- +-/ { +- binman { +- filename = "u-boot-sunxi-with-spl.bin"; +- pad-byte = <0xff>; +- blob { +- filename = "spl/sunxi-spl.bin"; +- }; +- u-boot-img { +- pos = ; +- }; +- }; +-}; +--- a/scripts/Makefile.lib ++++ b/scripts/Makefile.lib +@@ -308,8 +308,8 @@ quiet_cmd_dtc = DTC $@ + # Modified for U-Boot + # Bring in any U-Boot-specific include after the '/dts-v1/;' header + cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ +- cat $< $(if $(u_boot_dtsi),\ +- | sed 's%^/ {$$%\#include \"$(u_boot_dtsi)\"\n&%') | \ ++ cat $< $(if $(u-boot-dtsi),\ ++ | sed 's%^/ {$$%\#include \"$(u-boot-dtsi)\"\n&%') | \ + $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) - ; \ + $(DTC) -O dtb -o $@ -b 0 \ + -i $(dir $<) $(DTC_FLAGS) \ diff --git a/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch new file mode 100644 index 000000000..65ae63c64 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/300-sunxi-add-device-tree-for-Orange-Pi-R1-board.patch @@ -0,0 +1,182 @@ +From 1f92596cc520f760589289059a5aa739366dd19c Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:16:59 +0200 +Subject: sunxi: add device tree for Orange Pi R1 board + +Signed-off-by: Hauke Mehrtens +--- + arch/arm/dts/Makefile | 1 + + arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts | 157 +++++++++++++++++++++++++++++ + 2 files changed, 158 insertions(+) + create mode 100644 arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts + +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -310,6 +310,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \ + sun8i-a83t-cubietruck-plus.dtb \ + sun8i-a83t-sinovoip-bpi-m3.dtb + dtb-$(CONFIG_MACH_SUN8I_H3) += \ ++ sun8i-h2-plus-orangepi-r1.dtb \ + sun8i-h2-plus-orangepi-zero.dtb \ + sun8i-h3-bananapi-m2-plus.dtb \ + sun8i-h3-orangepi-2.dtb \ +--- /dev/null ++++ b/arch/arm/dts/sun8i-h2-plus-orangepi-r1.dts +@@ -0,0 +1,157 @@ ++/* ++ * Copyright (C) 2017 Hauke Mehrtens ++ * ++ * Based on sun8i-h2-plus-orangepi-zero.dts, which is: ++ * Copyright (C) 2016 Icenowy Zheng ++ * ++ * Based on sun8i-h3-orangepi-one.dts, which is: ++ * Copyright (C) 2016 Hans de Goede ++ * ++ * This file is dual-licensed: you can use it either under the terms ++ * of the GPL or the X11 license, at your option. Note that this dual ++ * licensing only applies to this file, and not this project as a ++ * whole. ++ * ++ * a) This file is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This file is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * Or, alternatively, ++ * ++ * b) Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, ++ * copy, modify, merge, publish, distribute, sublicense, and/or ++ * sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following ++ * conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ++ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ++ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ */ ++ ++/dts-v1/; ++#include "sun8i-h3.dtsi" ++#include "sunxi-common-regulators.dtsi" ++ ++#include ++#include ++#include ++ ++/ { ++ model = "Xunlong Orange Pi R1"; ++ compatible = "xunlong,orangepi-r1", "allwinner,sun8i-h2-plus"; ++ ++ aliases { ++ serial0 = &uart0; ++ /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */ ++ ethernet1 = &xr819; ++ }; ++ ++ chosen { ++ stdout-path = "serial0:115200n8"; ++ }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ pwr_led { ++ label = "orangepi:green:pwr"; ++ gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; ++ default-state = "on"; ++ }; ++ ++ status_led { ++ label = "orangepi:red:status"; ++ gpios = <&pio 0 17 GPIO_ACTIVE_HIGH>; ++ }; ++ }; ++ ++ reg_vcc_wifi: reg_vcc_wifi { ++ compatible = "regulator-fixed"; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc-wifi"; ++ enable-active-high; ++ gpio = <&pio 0 20 GPIO_ACTIVE_HIGH>; ++ }; ++ ++ wifi_pwrseq: wifi_pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; ++ }; ++}; ++ ++&ehci1 { ++ status = "okay"; ++}; ++ ++&emac { ++ phy = <&phy1>; ++ phy-mode = "mii"; ++ allwinner,use-internal-phy; ++ allwinner,leds-active-low; ++ status = "okay"; ++ phy1: ethernet-phy@1 { ++ reg = <1>; ++ }; ++}; ++ ++&mmc0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc0_pins_a>; ++ vmmc-supply = <®_vcc3v3>; ++ bus-width = <4>; ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ cd-inverted; ++ status = "okay"; ++}; ++ ++&mmc1 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&mmc1_pins_a>; ++ vmmc-supply = <®_vcc_wifi>; ++ mmc-pwrseq = <&wifi_pwrseq>; ++ bus-width = <4>; ++ non-removable; ++ status = "okay"; ++ ++ /* ++ * Explicitly define the sdio device, so that we can add an ethernet ++ * alias for it (which e.g. makes u-boot set a mac-address). ++ */ ++ xr819: sdio_wifi@1 { ++ reg = <1>; ++ }; ++}; ++ ++&ohci1 { ++ status = "okay"; ++}; ++ ++&uart0 { ++ pinctrl-names = "default"; ++ pinctrl-0 = <&uart0_pins_a>; ++ status = "okay"; ++}; ++ ++&usbphy { ++ /* USB VBUS is always on */ ++ status = "okay"; ++}; diff --git a/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch new file mode 100644 index 000000000..6240fe3f5 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/301-sunxi-add-orangepi-R1-defconfig.patch @@ -0,0 +1,48 @@ +From 231201c71b902b5999ed9b143f2a54674cfae88a Mon Sep 17 00:00:00 2001 +From: Hauke Mehrtens +Date: Tue, 26 Sep 2017 22:17:33 +0200 +Subject: sunxi: add orangepi R1 defconfig + +Signed-off-by: Hauke Mehrtens +--- + board/sunxi/MAINTAINERS | 5 +++++ + configs/orangepi_r1_defconfig | 19 +++++++++++++++++++ + 2 files changed, 24 insertions(+) + create mode 100644 configs/orangepi_r1_defconfig + +--- a/board/sunxi/MAINTAINERS ++++ b/board/sunxi/MAINTAINERS +@@ -302,6 +302,11 @@ M: Jagan Teki ++S: Maintained ++F: configs/orangepi_r1_defconfig ++ + PINE64 BOARDS + M: Andre Przywara + S: Maintained +--- /dev/null ++++ b/configs/orangepi_r1_defconfig +@@ -0,0 +1,19 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_MACH_SUN8I_H3=y ++CONFIG_DRAM_CLK=624 ++CONFIG_DRAM_ZQ=3881979 ++CONFIG_DRAM_ODT_EN=y ++# CONFIG_VIDEO_DE2 is not set ++CONFIG_DEFAULT_DEVICE_TREE="sun8i-h2-plus-orangepi-r1" ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_CONSOLE_MUX=y ++CONFIG_SPL=y ++# CONFIG_CMD_IMLS is not set ++# CONFIG_CMD_FLASH is not set ++# CONFIG_CMD_FPGA is not set ++CONFIG_SPL_SPI_SUNXI=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y diff --git a/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch new file mode 100644 index 000000000..d884173c4 --- /dev/null +++ b/package/boot/uboot-sunxi/patches/302-sunxi-Fix-CONFIG_SUNXI_GMAC-references.patch @@ -0,0 +1,83 @@ +From 6ff005cf19363382fc867d7876a75fd8a386e894 Mon Sep 17 00:00:00 2001 +From: Dave Prue +Date: Thu, 31 Aug 2017 19:21:01 +0200 +Subject: [PATCH] sunxi: Fix CONFIG_SUNXI_GMAC references + +SUNXI_GMAC was still used to configure the code where as the +same has been renamed and moved to Kconfig in below commit +"sunxi: Move SUNXI_GMAC to Kconfig" +(sha1: 4d43d065db3262f9a9918ba72457bf36dfb8e0bb) + +Signed-off-by: Dave Prue +Reviewed-by: Simon Glass +Reviewed-by: Jagan Teki +Reviewed-by: Mark Kettenis +Tested-by: Mark Kettenis +[Tweek commit message, config_whitelist.txt, build-whitelist.sh] +Signed-off-by: Jagan Teki +--- + arch/arm/include/asm/arch-sunxi/sys_proto.h | 2 +- + board/sunxi/Makefile | 2 +- + include/configs/sunxi-common.h | 2 +- + scripts/build-whitelist.sh | 4 ++-- + scripts/config_whitelist.txt | 1 - + 5 files changed, 5 insertions(+), 6 deletions(-) + +--- a/arch/arm/include/asm/arch-sunxi/sys_proto.h ++++ b/arch/arm/include/asm/arch-sunxi/sys_proto.h +@@ -24,7 +24,7 @@ void sdelay(unsigned long); + void return_to_fel(uint32_t lr, uint32_t sp); + + /* Board / SoC level designware gmac init */ +-#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUNXI_GMAC ++#if !defined CONFIG_SPL_BUILD && defined CONFIG_SUN7I_GMAC + void eth_init_board(void); + #else + static inline void eth_init_board(void) {} +--- a/board/sunxi/Makefile ++++ b/board/sunxi/Makefile +@@ -9,7 +9,7 @@ + # SPDX-License-Identifier: GPL-2.0+ + # + obj-y += board.o +-obj-$(CONFIG_SUNXI_GMAC) += gmac.o ++obj-$(CONFIG_SUN7I_GMAC) += gmac.o + obj-$(CONFIG_SUNXI_AHCI) += ahci.o + obj-$(CONFIG_MACH_SUN4I) += dram_sun4i_auto.o + obj-$(CONFIG_MACH_SUN5I) += dram_sun5i_auto.o +--- a/include/configs/sunxi-common.h ++++ b/include/configs/sunxi-common.h +@@ -302,7 +302,7 @@ extern int soft_i2c_gpio_scl; + #define CONFIG_PHYLIB + #endif + +-#ifdef CONFIG_SUNXI_GMAC ++#ifdef CONFIG_SUN7I_GMAC + #define CONFIG_PHY_GIGE /* GMAC can use gigabit PHY */ + #define CONFIG_PHY_ADDR 1 + #define CONFIG_MII /* MII PHY management */ +--- a/scripts/build-whitelist.sh ++++ b/scripts/build-whitelist.sh +@@ -13,10 +13,10 @@ export LC_ALL=C LC_COLLATE=C + # There are two independent greps. The first pulls out the component parts + # of CONFIG_SYS_EXTRA_OPTIONS. An example is: + # +-# SUNXI_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) ++# SUN7I_GMAC,AHCI,SATAPWR=SUNXI_GPB(8) + # + # We want this to produce: +-# CONFIG_SUNXI_GMAC ++# CONFIG_SUN7I_GMAC + # CONFIG_AHCI + # CONFIG_SATAPWR + # +--- a/scripts/config_whitelist.txt ++++ b/scripts/config_whitelist.txt +@@ -2371,7 +2371,6 @@ CONFIG_STV0991_HZ_CLOCK + CONFIG_ST_SMI + CONFIG_SUNXI_AHCI + CONFIG_SUNXI_EMAC +-CONFIG_SUNXI_GMAC + CONFIG_SUNXI_GPIO + CONFIG_SUNXI_MAX_FB_SIZE + CONFIG_SUNXI_USB_PHYS diff --git a/package/boot/uboot-sunxi/uEnv-a64.txt b/package/boot/uboot-sunxi/uEnv-a64.txt new file mode 100644 index 000000000..7a717fdc0 --- /dev/null +++ b/package/boot/uboot-sunxi/uEnv-a64.txt @@ -0,0 +1,5 @@ +setenv loadkernel fatload mmc 0 \$kernel_addr_r uImage +setenv loaddtb fatload mmc 0 \$fdt_addr_r dtb +setenv bootargs console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootwait earlycon=uart,mmio32,0x01c28000 +setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r +run uenvcmd diff --git a/package/boot/uboot-zynq/Makefile b/package/boot/uboot-zynq/Makefile index 61bb99dda..d25ecfb4b 100644 --- a/package/boot/uboot-zynq/Makefile +++ b/package/boot/uboot-zynq/Makefile @@ -6,121 +6,40 @@ # include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/image.mk -PKG_NAME:=u-boot PKG_VERSION:=2016.03 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://mirror2.openwrt.org/sources \ - ftp://ftp.denx.de/pub/u-boot PKG_HASH:=e49337262ecac44dbdeac140f2c6ebd1eba345e0162b0464172e7f05583ed7bb -PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) - -PKG_LICENSE:=GPL-2.0 GPL-2.0+ -PKG_LICENSE_FILES:=Licenses/README - +include $(INCLUDE_DIR)/kernel.mk +include $(INCLUDE_DIR)/u-boot.mk include $(INCLUDE_DIR)/package.mk -define uboot/Default - TITLE:= - CONFIG:= - IMAGE:= +define U-Boot/Default + BUILD_TARGET:=zynq + UBOOT_IMAGE:=u-boot u-boot-dtb.bin u-boot.dtb u-boot-dtb.img spl/boot.bin spl/u-boot-spl spl/u-boot-spl-dtb.bin + UBOOT_CONFIG:=zynq_$(1) endef -define uboot/zc702 - TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC702 Dev Board +define U-Boot/zc702 + NAME:=Xilinx ZC702 Dev Board endef -define uboot/zc706 - TITLE:=U-Boot $(PKG_VERSION) for Xilinx ZC706 Dev Board +define U-Boot/zc706 + NAME:=Xilinx ZC706 Dev Board endef -define uboot/zed - TITLE:=U-Boot $(PKG_VERSION) for Avnet Digilent ZedBoard Dev Board +define U-Boot/zed + NAME:=Avnet Digilent ZedBoard Dev Board endef -define uboot/zybo - TITLE:=U-Boot $(PKG_VERSION) for Digilent Zybo Dev Board +define U-Boot/zybo + NAME:=Digilent Zybo Dev Board endef -UBOOTS := \ +UBOOT_TARGETS := \ zc702 \ zed \ - zybo \ + zybo -define Package/uboot/template -define Package/uboot-zynq-$(1) - SECTION:=boot - CATEGORY:=Boot Loaders - DEPENDS:=@TARGET_zynq - TITLE:=$(2) - URL:=http://www.denx.de/wiki/U-Boot - VARIANT:=$(1) - MAINTAINER:=Jason Wu -endef -endef - -define BuildUBootPackage - $(eval $(uboot/Default)) - $(eval $(uboot/$(1))) - $(call Package/uboot/template,$(1),$(TITLE)) -endef - -ifdef BUILD_VARIANT -$(eval $(call uboot/$(BUILD_VARIANT))) -UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT)) -UBOOT_IMAGE:=$(if $(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin) -endif - -define Build/Configure - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - $(BOARD)_$(UBOOT_CONFIG)_config -endef - -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CROSS_COMPILE=$(TARGET_CROSS) DTC=$(LINUX_DIR)/scripts/dtc/dtc -endef - -define Package/uboot/install/default - $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1) - - $(CP) $(PKG_BUILD_DIR)/u-boot \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.elf - - $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.bin - - $(CP) $(PKG_BUILD_DIR)/u-boot.dtb \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot.dtb - - $(CP) $(PKG_BUILD_DIR)/u-boot-dtb.img \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-dtb.img - - $(CP) $(PKG_BUILD_DIR)/spl/boot.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/boot.bin - - $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl - - $(CP) $(PKG_BUILD_DIR)/spl/u-boot-spl-dtb.bin \ - $(BIN_DIR)/uboot-$(BOARD)-$(1)/u-boot-spl-dtb.bin -endef - -define Package/uboot/install/template -define Package/uboot-zynq-$(1)/install - $(call Package/uboot/install/default,$(2)) -endef -endef - -$(foreach u,$(UBOOTS), \ - $(eval $(call Package/uboot/install/template,$(u),$(u))) \ -) - -$(foreach u,$(UBOOTS), \ - $(eval $(call BuildUBootPackage,$(u))) \ - $(eval $(call BuildPackage,uboot-zynq-$(u))) \ -) +$(eval $(call BuildPackage/U-Boot)) diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile index 222922df2..291f45205 100644 --- a/package/devel/binutils/Makefile +++ b/package/devel/binutils/Makefile @@ -23,6 +23,7 @@ PKG_INSTALL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:binutils PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/devel/gdb-arc/Makefile b/package/devel/gdb-arc/Makefile index b19443753..6cdf6bdf5 100644 --- a/package/devel/gdb-arc/Makefile +++ b/package/devel/gdb-arc/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb-arc -PKG_VERSION:=arc-2016.03-gdb +PKG_VERSION:=arc-2017.03-gdb PKG_RELEASE:=1 -PKG_SOURCE:=gdb-arc-2016.03-gdb.tar.gz +PKG_SOURCE:=gdb-arc-2017.03-gdb.tar.gz PKG_SOURCE_URL:=https://github.com/foss-for-synopsys-dwc-arc-processors/binutils-gdb/archive/$(PKG_VERSION) PKG_HASH:=6a91f86cc487c1548d3f5d4f29f7226d2019c0db8a63633aeabd5914a340f3f9 -PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2016.03-gdb +PKG_BUILD_DIR:=$(BUILD_DIR)/binutils-gdb-arc-2017.03-gdb PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 5d2583aad..4cf2aaa87 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,16 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=7.11.1 +PKG_VERSION:=8.0.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=e9216da4e3755e9f414c1aa0026b626251dfc57ffe572a266e98da4f6988fc70 +PKG_HASH:=3dbd5f93e36ba2815ad0efab030dcd0c7b211d7b353a40a53f4c02d7d56295e3 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_LICENSE:=GPL-3.0+ +PKG_CPE_ID:=cpe:/a:gnu:gdb include $(INCLUDE_DIR)/package.mk @@ -55,11 +56,16 @@ CONFIGURE_ARGS+= \ --with-system-readline \ --without-expat \ --without-lzma \ + --disable-sim \ --disable-werror CONFIGURE_VARS+= \ ac_cv_search_tgetent="$(TARGET_LDFLAGS) -lncurses -lreadline" +TARGET_LDFLAGS+= \ + -static-libstdc++ \ + -Wl,--gc-sections + define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ DESTDIR="$(PKG_INSTALL_DIR)" \ diff --git a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch index 417142419..25ac86fd9 100644 --- a/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch +++ b/package/devel/gdb/patches/001-gdb-pr14523-mips-signal-number.patch @@ -2,7 +2,7 @@ See http://sourceware.org/bugzilla/show_bug.cgi?id=14523 --- --- a/gdb/common/signals.c +++ b/gdb/common/signals.c -@@ -344,6 +344,11 @@ gdb_signal_from_host (int hostsig) +@@ -348,6 +348,11 @@ gdb_signal_from_host (int hostsig) else if (64 <= hostsig && hostsig <= 127) return (enum gdb_signal) (hostsig - 64 + (int) GDB_SIGNAL_REALTIME_64); diff --git a/package/devel/gdb/patches/100-musl_fix.patch b/package/devel/gdb/patches/100-musl_fix.patch index 09146c563..b167fe6ec 100644 --- a/package/devel/gdb/patches/100-musl_fix.patch +++ b/package/devel/gdb/patches/100-musl_fix.patch @@ -50,4 +50,4 @@ +#undef pt_regs #include "nat/ppc-linux.h" - + #include "linux-ppc-tdesc.h" diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch new file mode 100644 index 000000000..929a5ae97 --- /dev/null +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -0,0 +1,76 @@ +--- a/configure.ac ++++ b/configure.ac +@@ -1300,13 +1300,13 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. ++# Check whether -static-libstdc++ is supported. + have_static_libs=no + if test "$GCC" = yes; then + saved_LDFLAGS="$LDFLAGS" + +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- AC_MSG_CHECKING([whether g++ accepts -static-libstdc++ -static-libgcc]) ++ LDFLAGS="$LDFLAGS -static-libstdc++" ++ AC_MSG_CHECKING([whether g++ accepts -static-libstdc++]) + AC_LANG_PUSH(C++) + AC_LINK_IFELSE([ + #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) +@@ -1632,7 +1632,7 @@ AC_ARG_WITH(stage1-ldflags, + # if supported. But if the user explicitly specified the libraries to use, + # trust that they are doing what they want. + if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then +- stage1_ldflags="-static-libstdc++ -static-libgcc" ++ stage1_ldflags="-static-libstdc++" + fi]) + AC_SUBST(stage1_ldflags) + +@@ -1661,7 +1661,7 @@ AC_ARG_WITH(boot-ldflags, + # statically. But if the user explicitly specified the libraries to + # use, trust that they are doing what they want. + if test "$poststage1_libs" = ""; then +- poststage1_ldflags="-static-libstdc++ -static-libgcc" ++ poststage1_ldflags="-static-libstdc++" + fi]) + AC_SUBST(poststage1_ldflags) + +--- a/configure ++++ b/configure +@@ -5005,14 +5005,14 @@ if test -z "$LD"; then + fi + fi + +-# Check whether -static-libstdc++ -static-libgcc is supported. ++# Check whether -static-libstdc++ is supported. + have_static_libs=no + if test "$GCC" = yes; then + saved_LDFLAGS="$LDFLAGS" + +- LDFLAGS="$LDFLAGS -static-libstdc++ -static-libgcc" +- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++ -static-libgcc" >&5 +-$as_echo_n "checking whether g++ accepts -static-libstdc++ -static-libgcc... " >&6; } ++ LDFLAGS="$LDFLAGS -static-libstdc++" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether g++ accepts -static-libstdc++" >&5 ++$as_echo_n "checking whether g++ accepts -static-libstdc++... " >&6; } + ac_ext=cpp + ac_cpp='$CXXCPP $CPPFLAGS' + ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +@@ -5795,7 +5795,7 @@ else + # if supported. But if the user explicitly specified the libraries to use, + # trust that they are doing what they want. + if test "$stage1_libs" = "" -a "$have_static_libs" = yes; then +- stage1_ldflags="-static-libstdc++ -static-libgcc" ++ stage1_ldflags="-static-libstdc++" + fi + fi + +@@ -5831,7 +5831,7 @@ else + # statically. But if the user explicitly specified the libraries to + # use, trust that they are doing what they want. + if test "$poststage1_libs" = ""; then +- poststage1_ldflags="-static-libstdc++ -static-libgcc" ++ poststage1_ldflags="-static-libstdc++" + fi + fi + diff --git a/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch new file mode 100644 index 000000000..8afa8ccf8 --- /dev/null +++ b/package/devel/gdb/patches/120-sigprocmask-invalid-call.patch @@ -0,0 +1,38 @@ +From 56893a61aa4f0270fa8d1197b9848247f90fce0d Mon Sep 17 00:00:00 2001 +From: Yousong Zhou +Date: Fri, 24 Mar 2017 10:36:03 +0800 +Subject: [PATCH] Fix invalid sigprocmask call + +The POSIX document says + + The pthread_sigmask() and sigprocmask() functions shall fail if: + + [EINVAL] + The value of the how argument is not equal to one of the defined values. + +and this is how musl-libc is currently doing. Fix the call to be safe +and correct + + [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_sigmask.html + +gdb/ChangeLog: +2017-03-24 Yousong Zhou + + * common/signals-state-save-restore.c (save_original_signals_state): + Fix invalid sigprocmask call. +--- + gdb/ChangeLog | 5 +++++ + gdb/common/signals-state-save-restore.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +--- a/gdb/common/signals-state-save-restore.c ++++ b/gdb/common/signals-state-save-restore.c +@@ -41,7 +41,7 @@ save_original_signals_state (void) + int i; + int res; + +- res = sigprocmask (0, NULL, &original_signal_mask); ++ res = sigprocmask (SIG_BLOCK, NULL, &original_signal_mask); + if (res == -1) + perror_with_name (("sigprocmask")); + diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile index 8ff9bfa5e..5bfcaa699 100644 --- a/package/devel/perf/Makefile +++ b/package/devel/perf/Makefile @@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk define Package/perf SECTION:=devel CATEGORY:=Development - DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK + DEPENDS:= +libelf1 +libdw +libpthread +librt +objdump @!LINUX_3_18 @!IN_SDK @!TARGET_arc770 @KERNEL_PERF_EVENTS TITLE:=Linux performance monitoring tool VERSION:=$(LINUX_VERSION)-$(PKG_RELEASE) URL:=http://www.kernel.org @@ -51,6 +51,7 @@ MAKE_FLAGS = \ NO_GTK2=1 \ NO_LIBAUDIT=1 \ NO_LIBCRYPTO=1 \ + NO_LIBUNWIND=1 \ CROSS_COMPILE="$(TARGET_CROSS)" \ CC="$(TARGET_CC)" \ LD="$(TARGET_CROSS)ld" \ @@ -60,9 +61,11 @@ MAKE_FLAGS = \ WERROR=0 \ prefix=/usr +ifdef CONFIG_LINUX_4_4 ifdef CONFIG_USE_MUSL MAKE_FLAGS += EXTRA_CFLAGS="-I$(CURDIR)/musl-include -include $(CURDIR)/musl-compat.h -D__UCLIBC__" endif +endif define Build/Compile +$(MAKE_FLAGS) $(MAKE) $(PKG_JOBS) \ diff --git a/package/devel/strace/Makefile b/package/devel/strace/Makefile index dae6aff15..6209dc5a6 100644 --- a/package/devel/strace/Makefile +++ b/package/devel/strace/Makefile @@ -9,16 +9,16 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=strace - -PKG_VERSION:=4.16 +PKG_VERSION:=4.20 PKG_RELEASE:=1 -PKG_HASH:=98487cb5178ec1259986cc9f6e2a844f50e5d1208c112cc22431a1e4d9adf0ef PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/$(PKG_NAME) +PKG_HASH:=5bf3148dd17306a42566f7da17368fdd781afa147db05ea63a4ca2b50f58c523 PKG_LICENSE:=BSD-3c PKG_LICENSE_FILES:=COPYRIGHT +PKG_CPE_ID:=cpe:/a:paul_kranenburg:strace PKG_MAINTAINER:=Felix Fietkau diff --git a/package/devel/valgrind/Makefile b/package/devel/valgrind/Makefile index 57ab75f96..6be2f9ec1 100644 --- a/package/devel/valgrind/Makefile +++ b/package/devel/valgrind/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=d76680ef03f00cd5e970bbdcd4e57fb1f6df7d2e2c071635ef2be74790190c3b PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:valgrind:valgrind PKG_FIXUP = autoreconf PKG_INSTALL := 1 diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index aec8bf27c..4af364825 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -13,7 +13,7 @@ endef define Build/Compile endef -ALLWIFIBOARDS:=rt-ac58u fritz4040 nbg6617 +ALLWIFIBOARDS:=fritz4040 openmesh_a42 ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD)) define Package/ipq-wifi-default @@ -47,8 +47,7 @@ Don't install it for any other device! PREV_BOARD+=ipq-wifi-$(1) endef -$(eval $(call generate-ipq-wifi-package,rt-ac58u,board-rt-ac58u.bin,ASUS RT-AC58U/RT-ACRH13)) $(eval $(call generate-ipq-wifi-package,fritz4040,board-fritz4040.bin,AVM FRITZBox 4040)) -$(eval $(call generate-ipq-wifi-package,nbg6617,board-nbg6617.bin,ZyXEL NBG6617)) +$(eval $(call generate-ipq-wifi-package,openmesh_a42,board-openmesh_a42.bin,OpenMesh A42)) $(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE)))) diff --git a/package/firmware/ipq-wifi/board-nbg6617.bin b/package/firmware/ipq-wifi/board-nbg6617.bin deleted file mode 100644 index ab4d43e8cbc949c06f74e332807b8d92239a7de0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24276 zcmeHPdr(tX8b3f3b+K|ohzNKIAwYrF7CNWZXS>;2@eZ$zi`g^ z&f`1hJHLB!bMHMr?mLO`A@RFK;bEyE3F+|}LLisR0hFvzEC#?IhC)Tzj)J1X;6k}H z$kafo#Pjxb%W@MuBlek>cl71}w#whU;;2(38j-~gOzsF9giA3;4Z$_HSbvnx~p zfbkmV)5WavuD}pVn)D-q7f`0x5$896 z6O4EeFQmY^=s$Q{%tu@|rLlAO*whKs))~iT0R6|J8fIuz^O9Jav$ON6RjZuL1b{ns z%+wurXCCM}fBc%drBa@~J2_!| zKz*jZRQgWx*6~58l}R&_-~0v2gKs#2VEi+6ePv;GGOQd{H&sfrcO}P+_hZdq86O%n z)K_GSlcRM84+De1_*L~;IKtb>QRAOO1DVdC4|YwuE=nJur<-iCsTr~`qS-l_LmN^6qj+*j^V8!Rrw?NO4W$5EiiUA`QZW62=V1%TiRwSfQ?B|P|$!;5g6pQQSmfLhf$%TR4(-q74bwpxt?NI z)D`hS6VL>1!lMKv1x?|mh~v;WM1=BC9+&rshipf;bGM7b&@hCL8lBKwvaSLaD@-r! zEAv-%vx5^13h1-0;?ooej5A(D)!QhYM$MZ*r5UBwsL{+->phsYbwk~rx*=Yu7uQRi zh$cQwL{iaIZmKu}jd&V?M5EE%XmM3dRSmv0^aq5=4Cq6)g}N%@FHc z)6c*VV{5ngBh8R`@Smrc{j^wBt$knSTJ}0zlah0=<>-?rkth)$KrRgeU@VGPBuW+t zkQovI5&;qc5&;qc5`h(rz((Fi#E1G8?=2*qx{bFDiKVW=1!NR9UmCe@9_#M4?T%)S zu@;vF8)F3@LUQVMBJg~M*xA8iHMez#z}9w)<>w;xE6y!ajXnkdrpHx1qmQSj@KG%G z>^p$PT;dw`)L8H7($tnHev7oM7OdMifB?52IJE$Tg8<0S34m-M79>G2VZhQRYB*pr zy}g;!q!pIWEM+otTUbC4>;Qf`3P7tf;t&@J0DBDr1VBK^UyT4qcgJ!X;{dg)Mu=X_MD;IXqo1w>b9l>$h3( z>yPjp93Z*=c$1Fp?cM_^NBNMa?W{)unT=mBvEbK(1?1OX!;b@=&Xr$}+24QU0)!6w z58fZnuSek|O`_+yJFj+HMKLnn0l5CcUfR74{Cd-%P+I_AKRmqwEZ_pav;YgZ*qL7s z1vi~*$|N+5qxH~!PrK{RpzosB(uYl65?WYR3>w6;lqhFOeIaT!d-;mowk0P$`@#TV z38G|++hiLO0TKZcf#r&Ti63u`U;m$f{Pj=YfBy$KIX&kds{{63o=iHP0dhEUp-U1HbcVV}Uijh`tR7ifk5gj|Z_|_@$)=Le~Mqtuv zU7gj;mS-ieAHQClg+0{1^VsqZ!<3uty!ze9M60G;nJEeV?#6^#Q?1OC@F%WoE+|VR zNqql_5pAzZDUoR6b|&y0$}ADoYo!FoQ4e zaUe?9CfYS+sywA|atv0MDRX5h(9Mew%Q!v?YdbX+vP97)oxuY*2YX}*Uh0!B*>V6$ zlt`2a5O^Jy2Eo+G;uVWP+sKj2v8^F>Uga0Hzf}v*1y*l5a_mCVNluApp-a-;-UDZM zDE$s?lw2G+b~&LXw9ZR0GJH^za(>J2ypEph$!rX-V#qe6ecgY!Ij+`Uz9~;Nyr-Lg z-lv)>tLx9}WxJzb=s-$WA1y`@4V4p*u1@l@xFV`S2vUc>FU4}bh-Ab;!<=yvz)rGzCHbPWVwgL zMRaX&-^ct9edO+WeOhU^@Ek*dR>rNep@=1RE9KTv7UVSfoyClm6hBp9+gM9mSy_{NI z_{x;(IP#7Z14kY>2q8Z|D2i3$N(l$fwd)v`fx?)hQ>57|Kmg;vQy~96tL@5z#o)g$ z_7sSC^?3QO$*sr6Ci(SdEPFy8v|;m&lgc1^X2{jAHkef%K!iX diff --git a/package/firmware/ipq-wifi/board-openmesh_a42.bin b/package/firmware/ipq-wifi/board-openmesh_a42.bin new file mode 100644 index 0000000000000000000000000000000000000000..9ac5921200469fe966305d0795e6da0194b441e1 GIT binary patch literal 85372 zcmeHQeN+=y-o79fb!{c#qgHW*7(QYl0#X}ls(?sAQnXajpi6D-PQNbOeQl)X2=8* z2+94y-1*J@zR%pi%-m<5ytX4HHf3){d|Xy+>h6@BG*D7f0-zpV?lOW+AK>oo4; zRp6bl6p)hU2ggGGPt=ppEf45?D6EV{#@;mysS*wKnm^i9$s#WFf$=o(MfMT% z_Rr2yEi^k>ER#_IOFY<*JOL&4ku9#+-gAXDNk^h`L$e;VRMe%HNZ$xfy*F5{OFtc5 zvARGvbWoRcI;=9V@LEG*RZ>yp>+3QnnvR{?sfsxmyzP^L+Dp4nODosCd1t6b_v*RW zn$V-;=ZjBlJ0i&yB;AGi($vy}f!q47soFCdp08P3e0!w2Yg66&vcQ7Hg%av5g}_q( z<-d4(l^`(q+2_`-qyFGC_W0k}nGDtgFNpBK*Voqv50@-~|CXOJnSX!%fwrC}&wu{-!{f*J6_894v4M>H z&kw)Kcdf4R0@!HnAuS z!$L!0gd2Kn*a$FzAO%Yi#AES-vZ|AH@1AWm^q8EMc9YXL42F%Q4VfLe$tKKBi^-bJ zjt~<{g|^&^ba`mtD8Lk1`#*+ie=4(b&cAQp1$X%_DZ9d(i>AV75lHcY*2J ztt$`<{60{y7F#P_tJs0<_Nq9xDTliwai-PUK zWt4%OqUN5lhs=<;*LFCtZDToQPHV%9Pazt*g9!X&V-8l}s_cAM2>9l6RX<%+ui{X# zcKk~K;QoZRd;Cl5y%e{YjnR=}PH_PKaqS-eoNFHy z86jTCja<1S*XqdCImMp62M!e+F4i`+wqNei@MX*hn*Ma}o7N-8sQTxSmi}QbwCyyK7cL!daO)59UUHVOOc*kmWh~c`B^`$=m;HFJTuMfRwm&fda6^>%bQ|SC2p|Ly z0*e&^nzPTw`TzG{|MZ7%zWE9cj(iUQ=lnnU+h6|p-FJV6aa^2#xjZqBd}rYCsd=p(kz3p4KPv8h%=wI)}&>Fe85dc!GA zzEU=I)6k|VSEkD%rpAoDT8&yM3&r14o46kp4Pb#5LzQNqQaU|q{6Jf(&QZ#Y6^w5ZH0Pwh8QpK(E|xY>Bf}KP^rz=q)p#~iIti|>Rqs#S0I+jG7P3(Hq@whWIRU{ zcm&7bh`HgVKI#&m6NpekC~+X*2~&e(Xeioi5ojMf*0;Si_RQMqE5={y(=J4vdhXcq zw)A%;SqcEM{BMoH%6a&wpgprelPxb@cyTF-X17weyJ|(SHTBAzO5PDt&e&q zq{Mi=s%LA1s9N|&gKqcxiPfu>D>H5ky>U_YoAo8Z`PYo9uCxnbRf2+np-O}NJyCgp za=fdeamT5cl8~IwKHPOKruMm`0s99=-|9|p7M~0{+CF%!b9+PNiJ-zho$AcCs*P_2 zW?kzq?b!P6hKiv4j)6j5%DM1LVSej1Rfqij4V8h1&NuG=b)s5yP?$V6Sa~`7e00s~ zBVIdk(7+J_9)Q4H6+oa47i}zfjGifw1rQ1#5fNhe3)MfuHiUaNzvBtk z)y(0zL#NZR7I!>hK{@}uBO|ux_CuSGgwDRcUTYA0aC1Dtx|+p$+@aTV%&U1wxY*X# z$_kw034GR!xp@A}_$vcchXx0^eEn4_Pj4@mPvw~FUVoXcfy-~ZMCal1XUF+B;1ypb z!#3PEFhepPkG5xeA_Ex`HOQGE8SnX=|1uNjKNuQF=Q&2adkmWQzEj|y zvy#~>#Jgvr;Y~i`-Mdzc-?hAZ`2EZ_Ok{$0&zaEL+S)>_J~0BK1moCc?jqyeLlAA$ zvvJye|9m9C6J^8mCV2ObC%Ei<&U3|xcWJ!z|1VmyTy{_G_@ru?m`H%;G&NYaFJfC#^7@9M+$!J(8D| zDVw~ZZ>cTG+nbp>IjBF~P@#G)bIarq^eR<3nJ?gyh>t#%M1jc>eM43u z^7dqIn;gKi!8jQ#aIT>yPm#HmDDYX-Mlg9@e;&5*YG%^php>Q}C~yr{Qk<71i-y%T z*Oukw$l^=|q8!56;Z<2wfDgW&fD)f^x_h49bA>fYN1}2=vmUfm)TNh5-v~~z~Qc>jV>oO;rj-A@6ia8j(?URApOS?}?E7!ewXQ)Q^ z>bcmO(4*t$i%)DjBFPmb-G%wm)Y5~2+xo7l+A|uSuUT7sd!)K+Q{DQqzyf#21@(^| zfw``*!CHy0ne_4T_4W0^!zD|WE?xSR$^85455%n|l&!?#4e&QY6dn%Mtwf?+Keth~ zVn@a^V`t{u|L2F_e@p7r(>nL-R{Hz;`TZBd!KHKWYNXh7?%^|d%EY2D3=0i~hi>Sx zVZ*|=H}sHnYFg*MZx{?4NgFad)Lq|%*=aFZv)OU2&VA~6PdfJS2% zyGspoepK}@I$#&f)@b%FFkQQK@#5Q`tUF76^Fi6kx<*4!TU&Q`cPBG!YJv~(+L}@K4%}Hgizu@08I@JU@W4&5+w@+ z&;ddKA%GA-2p|Ly0$z*&;@f-i$@kKs+vVFY6fRz_n{SVAKfl^BsI^G({9>?BA3MJ7 zCPSV2z;7k>0P5ODLViwU5Y)McBq$Nw@O_go9*9Jtp&~15h4HqrBGI81F_6djfS*eN zX!RHPBqst8y-Wb)K<-CqN50)e`4%ApIG^7a>gbo9g-gu7e#=mSMPhIigd!%nqp@H=6DJ1B1E|Z{N}msN1y(haA`P?WwNJ4+GwlTjTTW z1nJvbe}29mn`$*wYjTyFzP>%BH=NSsD`itR4Q-loWx6b4YRuTH)u@%SQ2broiThE} z02XL5RB84prPHIv545G~9Hq=SZs=C4mD#eGsoxr!H6_YaSr}g6-h-$pKx9*Eay7Zr zcZ`>{RY>0+>DwcHd+X03`>`9|)S)i1pDN2(uSCfb0(68BK>GGb-yVGm5CYzcz+BZg z{F%lA;^>(ISpcEF5fLGVzfgH2Y(sdsC_ERqjrs=S+q0ZF6y?zf*yYnW*(4#}`b0dKC?H9AYecPo=ZS?9I=@Dx6jwe`GGlyfx zW$ZaiEGXZ;t&OR=Z9*5f2v7P-k**kjtlM zaBnY{Pt`KlJyXY?%cuJwmvi~Ezgn;W?6f);|#ui58WS27u!OA^KkR;6&3En?N(26ag{VCvmb<7ag%{uc=6aNcz0!!O6%=-XTH?Vm11`u5CAKcsI@p@H=6DJ1B<>(@+C3pCo?9zuy5 z8O)Lp;DW#Nt?a}6Du``)Vro{8?V6c3P_eA zeS4&DZ~ZxBKSuYN?6_FQB9tugU_Wv_O6={TSnovu>DwcHd+(k7Xyo3Gz+BZgnDX}i zEMOvid-CCiEvJ7uWgw@hxo7MlGo&AgIO4IukD?F)tO(fU+w|G49R#tgF^cD{|_)~1lj-q literal 0 HcmV?d00001 diff --git a/package/firmware/ipq-wifi/board-rt-ac58u.bin b/package/firmware/ipq-wifi/board-rt-ac58u.bin deleted file mode 100644 index 379bdc8ce20b5760dbbdbf9790ca9f5b20c4df3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24276 zcmeHPTT~NC8ZMBVib^Np7D5w}00~P11QsJi2_Z58qA;u?MAt<`B>@%$ zIyy20j35UUx%9fqVRdGd+0}8KJ(}b0%e?urZ}T8~JbU)|uku!Snfhp`x;>{ldUufO<_%qsy7N~JVdeM7>-*zdBWjo>9~Vk=v=jo~ zzH8TS*n}_xgG0l@BdAaOxf1`3ofE2;O$l#^;2n~Or>Ca}p08Qs?d|O|Bfj@~YSi4P zC-Q|Xfq)NxqIi*!d|o7vSLo$O+*a8PMORiDfeRPv>v!$aWXZt#^*%nNH<>7k&*MeF z3d{FDZ{EHQgc@nXjp6>jo?c%6Bbs^ud;Q5#RxYm@gZCqF_?p(PF+Aa(;%p=~Rv1kh zma4_hNObh_X!cM+Pz1?9Gmu0y5ve)e+}eJo>(bzS1;}S4+9`#BG9-*=41|rcC2UOq z8i0hLN>nLPK2st&XpSUDqd*mi8kM3_iS(HiNkvm7shR{d0g<6p5IyGEcx+X`rC^EW zE?wo#UPP{ab?GjwMzHU~%4*ei>8jPZ_Ejdze8oh<&@f4uCKJtkm5Jn{xsqH>5}NcX z2}wiKBx#!FR=6~JtaEfoAP{hWnH*ocHD}CY)+uUy*PO1k#$ZznsKh2?_(_`%jRPhUqX87?t;J!hvB``akSlg2Xd_jntkQQiRS>o zve7s&@%-JA51-p}QIr$P;`6y&l*0}Qf|~2tcux9*NojNCbQY@}(fbh6i~&RFXrx(p&UG=_~p> zOn6D8051giws~`h;rW*@egZ%K_!Cj$I-Y1*eF*$~+n?p>RR(t;0Pyhi^7{(PH7FDk z_n<7rrYV9St^*T4EL6rsM+rV;B6se{y*hGtPLsc@XkSTLx$(l6Jy!;XhR1GC+cK?4Wi*iTzKFw1e6Kbsoe8d$>QkAJIZ^ zr%)Z)Gu~Oa|8Q6L)f?F4)L$3U-3b%xxv<`{5Dvo>y*;&UVU z^`o~vJRrHg@dCm24jh0dN&pD-g(VbtOG)tS0r2u7Ew(xTH}m=RkY|uirN#2=p_lJ$ zJpr&3e*L3o{y^nH9@MyajJS?c2BNgjb6*UlLg4)(h6Z0`r5~f^G*fBS0hIMhKLYXbVYxJ%bUjft;9={Q45I|Aq~ougU(04^v~Z+3=of z*~K2eUN|GskZvpx@VMbY(E|KgKK_V&DKZni zl;&IN%a=pS%JS=}P~`I2U}%*B#VJS}c~(NM1?!w}MfzFs9ACTE+Dt>xGSK@At*pHhsoYiD}GJ7b3%QtcU11%ER77`=y$9;t6g-IUFx6p-O!~mbLGB#Rh$6vni#CF-LB>d1KFLXyi>{bA;tdcyQ9CmEIScV6}W$* z=h(sQZE<|2&xpCcE?Xm&1%^%Z*LG#L#8m|qJpDt?*|?_A!vTA4cQ@v?+_iaR59S9YEgHiR5nwF`%yIE{cCAh6W8ZTMP?9XyD)Z8U1-Qejk-0RF%?ZE*RK zk-W%4Zo&dK$FG-2 zBw}$Ke7Q`tD{I2p_*_tf=t05pb3x737xFM6{ivpO^!K)M!ZF lMMS +In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:23 +0100 +Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate + config symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH10K_DEBUGFS. Spectral scan support is currently the only user of +RELAY in ath10k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath10k is often useful even on very small +embedded routers, where we'd rather like to avoid the code size and RAM +usage of the relay support. While ath10k-based devices usually have more +resources than ath9k-based ones, it makes sense to keep the configuration +symmetric to ath9k, so the same base kernel without RELAY can be used for +both ath9k and ath10k hardware. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + ath10k-4.13/Kconfig | 9 ++++++++- + ath10k-4.13/Makefile | 2 +- + ath10k-4.13/spectral.h | 4 ++-- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/ath10k-4.13/Kconfig ++++ b/ath10k-4.13/Kconfig +@@ -40,12 +40,19 @@ config ATH10K_DEBUG + config ATH10K_DEBUGFS + bool "Atheros ath10k debugfs support" + depends on ATH10K && DEBUG_FS +- select RELAY + ---help--- + Enabled debugfs support + + If unsure, say Y to make it easier to debug problems. + ++config ATH10K_SPECTRAL ++ bool "Atheros ath10k spectral scan support" ++ depends on ATH10K_DEBUGFS ++ select RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. ++ + config ATH10K_TRACING + bool "Atheros ath10k tracing support" + depends on ATH10K +--- a/ath10k-4.13/Makefile ++++ b/ath10k-4.13/Makefile +@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \ + p2p.o \ + swap.o + +-ath10k_core-$(CONFIG_ATH10K_DEBUGFS) += spectral.o ++ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o + ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o + ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o + ath10k_core-$(CONFIG_THERMAL) += thermal.o +--- a/ath10k-4.13/spectral.h ++++ b/ath10k-4.13/spectral.h +@@ -44,7 +44,7 @@ enum ath10k_spectral_mode { + SPECTRAL_MANUAL, + }; + +-#ifdef CONFIG_ATH10K_DEBUGFS ++#ifdef CONFIG_ATH10K_SPECTRAL + + int ath10k_spectral_process_fft(struct ath10k *ar, + struct wmi_phyerr_ev_arg *phyerr, +@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr + { + } + +-#endif /* CONFIG_ATH10K_DEBUGFS */ ++#endif /* CONFIG_ATH10K_SPECTRAL */ + + #endif /* SPECTRAL_H */ diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index b3803f90e..f764eba1f 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -254,7 +254,7 @@ static struct net_device_ops g_ptm_netdev_ops = { #endif static struct net_device *g_net_dev[2] = {0}; -static char *g_net_dev_name[2] = {"ptm0", "ptmfast0"}; +static char *g_net_dev_name[2] = {"dsl0", "dslfast0"}; #ifdef CONFIG_IFX_PTM_RX_TASKLET static struct tasklet_struct g_ptm_tasklet[] = { @@ -927,8 +927,8 @@ static int proc_read_wanmib(char *page, char **start, off_t off, int count, int int len = 0; int i; char *title[] = { - "ptm0\n", - "ptmfast0\n" + "dsl0\n", + "dslfast0\n" }; for ( i = 0; i < ARRAY_SIZE(title); i++ ) { diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 22f1e23c4..4e10d72fe 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -121,7 +121,7 @@ static struct net_device_ops g_ptm_netdev_ops = { }; static struct net_device *g_net_dev[1] = {0}; -static char *g_net_dev_name[1] = {"ptm0"}; +static char *g_net_dev_name[1] = {"dsl0"}; static int g_ptm_prio_queue_map[8]; diff --git a/package/kernel/linux/modules/w1.mk b/package/kernel/linux/modules/w1.mk index 15b39207e..e936a2814 100644 --- a/package/kernel/linux/modules/w1.mk +++ b/package/kernel/linux/modules/w1.mk @@ -14,6 +14,7 @@ define KernelPackage/w1 TITLE:=Dallas's 1-wire support KCONFIG:=CONFIG_W1 FILES:=$(LINUX_DIR)/drivers/w1/wire.ko + DEPENDS:=+LINUX_4_14:kmod-hwmon-core endef define KernelPackage/w1/description diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 385bea4d2..cf17c9f4f 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=2017-11-01 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources PKG_HASH:=8437ab7886b988c8152e7a4db30b7f41009e49a3b2cb863edd05da1ecd7eb05a @@ -55,6 +55,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_PACKAGE_MAC80211_TRACING \ CONFIG_PACKAGE_ATH_DEBUG \ CONFIG_PACKAGE_ATH_DFS \ + CONFIG_PACKAGE_ATH_SPECTRAL \ CONFIG_PACKAGE_B43_DEBUG \ CONFIG_PACKAGE_B43_PIO \ CONFIG_PACKAGE_B43_PHY_G \ @@ -188,6 +189,13 @@ define KernelPackage/ath/config Select this option if you want to use such channels. + config PACKAGE_ATH_SPECTRAL + bool "Atheros spectral scan support" + depends on PACKAGE_ATH_DEBUG + select KERNEL_RELAY + help + Say Y to enable access to the FFT/spectral data via debugfs. + endif endef @@ -222,7 +230,7 @@ define KernelPackage/ath6kl TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl HIDDEN:=1 - DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT +@KERNEL_RELAY + DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko endef @@ -259,7 +267,7 @@ define KernelPackage/ath9k-common TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc) URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k HIDDEN:=1 - DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY + DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko @@ -316,7 +324,7 @@ define KernelPackage/ath10k $(call KernelPackage/mac80211/Default) TITLE:=Atheros 802.11ac wireless cards support URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k - DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT +@KERNEL_RELAY + DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT FILES:= \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \ $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko @@ -1571,6 +1579,7 @@ config-$(call config_package,airo) += AIRO config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED +config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL config-$(call config_package,ath9k) += ATH9K config-$(call config_package,ath9k-common) += ATH9K_COMMON diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh index 22a00a592..354077733 100644 --- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh +++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh @@ -116,7 +116,7 @@ detect_mac80211() { set wireless.radio${devidx}.hwmode=11${mode_band} ${dev_id} ${ht_capab} - set wireless.radio${devidx}.disabled=0 + set wireless.radio${devidx}.disabled=1 set wireless.default_radio${devidx}=wifi-iface set wireless.default_radio${devidx}.device=radio${devidx} diff --git a/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch b/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch new file mode 100644 index 000000000..703051fe1 --- /dev/null +++ b/package/kernel/mac80211/patches/321-0001-ath9k-move-spectral-scan-support-under-a-separate-co.patch @@ -0,0 +1,103 @@ +From 9df7ddc3ed25b7d3473f117a0680b9418adb5753 Mon Sep 17 00:00:00 2001 +Message-Id: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:22 +0100 +Subject: [PATCH 1/2] ath9k: move spectral scan support under a separate config + symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH9K[_HTC]_DEBUGFS. Spectral scan support is currently the only user +of RELAY in ath9k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath9k is often useful even on very small embedded +routers, where we'd rather like to avoid the code size and RAM usage of the +relay support. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath9k/Kconfig | 14 ++++++++++---- + drivers/net/wireless/ath/ath9k/Makefile | 4 ++-- + drivers/net/wireless/ath/ath9k/common-spectral.h | 4 ++-- + 3 files changed, 14 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath9k/Kconfig ++++ b/drivers/net/wireless/ath/ath9k/Kconfig +@@ -64,13 +64,12 @@ config ATH9K_DEBUGFS + depends on ATH9K && DEBUG_FS + select MAC80211_DEBUGFS + select ATH9K_COMMON_DEBUG +- depends on RELAY + ---help--- + Say Y, if you need access to ath9k's statistics for + interrupts, rate control, etc. + +- Also required for changing debug message flags at run time. +- As well as access to the FFT/spectral data and TX99. ++ Also required for changing debug message flags at run time and for ++ TX99. + + config ATH9K_STATION_STATISTICS + bool "Detailed station statistics" +@@ -181,7 +180,6 @@ config ATH9K_HTC_DEBUGFS + bool "Atheros ath9k_htc debugging" + depends on ATH9K_HTC && DEBUG_FS + select ATH9K_COMMON_DEBUG +- depends on RELAY + ---help--- + Say Y, if you need access to ath9k_htc's statistics. + As well as access to the FFT/spectral data. +@@ -197,3 +195,11 @@ config ATH9K_HWRNG + + Say Y, feeds the entropy directly from the WiFi driver to the input + pool. ++ ++config ATH9K_COMMON_SPECTRAL ++ bool "Atheros ath9k/ath9k_htc spectral scan support" ++ depends on ATH9K_DEBUGFS || ATH9K_HTC_DEBUGFS ++ depends on RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. +--- a/drivers/net/wireless/ath/ath9k/Makefile ++++ b/drivers/net/wireless/ath/ath9k/Makefile +@@ -61,8 +61,8 @@ ath9k_common-y:= common.o \ + common-init.o \ + common-beacon.o \ + +-ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o \ +- common-spectral.o ++ath9k_common-$(CPTCFG_ATH9K_COMMON_DEBUG) += common-debug.o ++ath9k_common-$(CPTCFG_ATH9K_COMMON_SPECTRAL) += common-spectral.o + + ath9k_htc-y += htc_hst.o \ + hif_usb.o \ +--- a/drivers/net/wireless/ath/ath9k/common-spectral.h ++++ b/drivers/net/wireless/ath/ath9k/common-spectral.h +@@ -151,7 +151,7 @@ static inline u8 spectral_bitmap_weight( + return bins[0] & 0x3f; + } + +-#ifdef CPTCFG_ATH9K_COMMON_DEBUG ++#ifdef CPTCFG_ATH9K_COMMON_SPECTRAL + void ath9k_cmn_spectral_init_debug(struct ath_spec_scan_priv *spec_priv, struct dentry *debugfs_phy); + void ath9k_cmn_spectral_deinit_debug(struct ath_spec_scan_priv *spec_priv); + +@@ -183,6 +183,6 @@ static inline int ath_cmn_process_fft(st + { + return 0; + } +-#endif /* CPTCFG_ATH9K_COMMON_DEBUG */ ++#endif /* CPTCFG_ATH9K_COMMON_SPECTRAL */ + + #endif /* SPECTRAL_H */ +--- a/local-symbols ++++ b/local-symbols +@@ -116,6 +116,7 @@ ATH9K_PCOEM= + ATH9K_HTC= + ATH9K_HTC_DEBUGFS= + ATH9K_HWRNG= ++ATH9K_COMMON_SPECTRAL= + CARL9170= + CARL9170_LEDS= + CARL9170_DEBUGFS= diff --git a/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch b/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch new file mode 100644 index 000000000..604a6f158 --- /dev/null +++ b/package/kernel/mac80211/patches/321-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch @@ -0,0 +1,91 @@ +From 42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61 Mon Sep 17 00:00:00 2001 +Message-Id: <42e01cb9cb109fb0bb4743f6c54d6aa67ac39b61.1515610034.git.mschiffer@universe-factory.net> +In-Reply-To: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +References: <9df7ddc3ed25b7d3473f117a0680b9418adb5753.1515610034.git.mschiffer@universe-factory.net> +From: Matthias Schiffer +Date: Mon, 27 Nov 2017 18:56:23 +0100 +Subject: [PATCH 2/2] ath10k: move spectral scan support under a separate + config symbol + +At the moment, spectral scan support, and with it RELAY, is always enabled +with ATH10K_DEBUGFS. Spectral scan support is currently the only user of +RELAY in ath10k, and it unconditionally reserves a relay channel. + +Having debugfs support in ath10k is often useful even on very small +embedded routers, where we'd rather like to avoid the code size and RAM +usage of the relay support. While ath10k-based devices usually have more +resources than ath9k-based ones, it makes sense to keep the configuration +symmetric to ath9k, so the same base kernel without RELAY can be used for +both ath9k and ath10k hardware. + +Signed-off-by: Matthias Schiffer +Signed-off-by: Kalle Valo +--- + drivers/net/wireless/ath/ath10k/Kconfig | 9 ++++++++- + drivers/net/wireless/ath/ath10k/Makefile | 2 +- + drivers/net/wireless/ath/ath10k/spectral.h | 4 ++-- + 3 files changed, 11 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/Kconfig ++++ b/drivers/net/wireless/ath/ath10k/Kconfig +@@ -51,12 +51,19 @@ config ATH10K_DEBUG + config ATH10K_DEBUGFS + bool "Atheros ath10k debugfs support" + depends on ATH10K && DEBUG_FS +- depends on RELAY + ---help--- + Enabled debugfs support + + If unsure, say Y to make it easier to debug problems. + ++config ATH10K_SPECTRAL ++ bool "Atheros ath10k spectral scan support" ++ depends on ATH10K_DEBUGFS ++ depends on RELAY ++ default n ++ ---help--- ++ Say Y to enable access to the FFT/spectral data via debugfs. ++ + config ATH10K_TRACING + depends on !KERNEL_3_4 + bool "Atheros ath10k tracing support" +--- a/drivers/net/wireless/ath/ath10k/Makefile ++++ b/drivers/net/wireless/ath/ath10k/Makefile +@@ -14,7 +14,7 @@ ath10k_core-y += mac.o \ + p2p.o \ + swap.o + +-ath10k_core-$(CPTCFG_ATH10K_DEBUGFS) += spectral.o ++ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += spectral.o + ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o + ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o + ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o +--- a/drivers/net/wireless/ath/ath10k/spectral.h ++++ b/drivers/net/wireless/ath/ath10k/spectral.h +@@ -44,7 +44,7 @@ enum ath10k_spectral_mode { + SPECTRAL_MANUAL, + }; + +-#ifdef CPTCFG_ATH10K_DEBUGFS ++#ifdef CPTCFG_ATH10K_SPECTRAL + + int ath10k_spectral_process_fft(struct ath10k *ar, + struct wmi_phyerr_ev_arg *phyerr, +@@ -85,6 +85,6 @@ static inline void ath10k_spectral_destr + { + } + +-#endif /* CPTCFG_ATH10K_DEBUGFS */ ++#endif /* CPTCFG_ATH10K_SPECTRAL */ + + #endif /* SPECTRAL_H */ +--- a/local-symbols ++++ b/local-symbols +@@ -140,6 +140,7 @@ ATH10K_SDIO= + ATH10K_USB= + ATH10K_DEBUG= + ATH10K_DEBUGFS= ++ATH10K_SPECTRAL= + ATH10K_TRACING= + ATH10K_DFS_CERTIFIED= + WCN36XX= diff --git a/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch new file mode 100644 index 000000000..f9a830c7a --- /dev/null +++ b/package/kernel/mac80211/patches/937-ath10k-calibration-variant.patch @@ -0,0 +1,106 @@ +From: Sven Eckelmann +Date: Fri, 10 Mar 2017 09:06:15 +0100 +Subject: ath10k: search DT for qcom,ath10k-calibration-variant + +Board Data File (BDF) is loaded upon driver boot-up procedure. The right +board data file is identified on QCA4019 using bus, bmi-chip-id and +bmi-board-id. + +The problem, however, can occur when the (default) board data file cannot +fulfill the vendor requirements and it is necessary to use a different +board data file. + +This problem was solved for SMBIOS by adding a special SMBIOS type 0xF8. +Something similar has to be provided for systems without SMBIOS but with +device trees. No solution was specified by QCA and therefore a new one has +to be found for ath10k. + +The device tree requires addition strings to define the variant name + + wifi@a000000 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; + }; + + wifi@a800000 { + status = "okay"; + qcom,ath10k-calibration-variant = "RT-AC58U"; + }; + +This would create the boarddata identifiers for the board-2.bin search + + * bus=ahb,bmi-chip-id=0,bmi-board-id=16,variant=RT-AC58U + * bus=ahb,bmi-chip-id=0,bmi-board-id=17,variant=RT-AC58U + +Signed-off-by: Sven Eckelmann + +Origin: other, https://patchwork.kernel.org/patch/9615185/ +--- + +--- a/drivers/net/wireless/ath/ath10k/core.c ++++ b/drivers/net/wireless/ath/ath10k/core.c +@@ -860,6 +860,25 @@ static int ath10k_core_check_smbios(stru + return 0; + } + ++static int ath10k_core_check_dt(struct ath10k *ar) ++{ ++ struct device_node *node; ++ const char *variant = NULL; ++ ++ node = ar->dev->of_node; ++ if (!node) ++ return -ENOENT; ++ ++ of_property_read_string(node, "qcom,ath10k-calibration-variant", ++ &variant); ++ if (!variant) ++ return -ENODATA; ++ ++ strscpy(ar->id.bdf_ext, variant, sizeof(ar->id.bdf_ext)); ++ ++ return 0; ++} ++ + static int ath10k_download_and_run_otp(struct ath10k *ar) + { + u32 result, address = ar->hw_params.patch_load_addr; +@@ -1231,19 +1250,19 @@ static int ath10k_core_create_board_name + /* strlen(',variant=') + strlen(ar->id.bdf_ext) */ + char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 }; + ++ if (ar->id.bdf_ext[0] != '\0') ++ scnprintf(variant, sizeof(variant), ",variant=%s", ++ ar->id.bdf_ext); ++ + if (ar->id.bmi_ids_valid) { + scnprintf(name, name_len, +- "bus=%s,bmi-chip-id=%d,bmi-board-id=%d", ++ "bus=%s,bmi-chip-id=%d,bmi-board-id=%d%s", + ath10k_bus_str(ar->hif.bus), + ar->id.bmi_chip_id, +- ar->id.bmi_board_id); ++ ar->id.bmi_board_id, variant); + goto out; + } + +- if (ar->id.bdf_ext[0] != '\0') +- scnprintf(variant, sizeof(variant), ",variant=%s", +- ar->id.bdf_ext); +- + scnprintf(name, name_len, + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s", + ath10k_bus_str(ar->hif.bus), +@@ -2343,7 +2362,11 @@ static int ath10k_core_probe_fw(struct a + + ret = ath10k_core_check_smbios(ar); + if (ret) +- ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n"); ++ ath10k_dbg(ar, ATH10K_DBG_BOOT, "SMBIOS bdf variant name not set.\n"); ++ ++ ret = ath10k_core_check_dt(ar); ++ if (ret) ++ ath10k_dbg(ar, ATH10K_DBG_BOOT, "DT bdf variant name not set.\n"); + + ret = ath10k_core_fetch_board_file(ar); + if (ret) { diff --git a/package/lean/default-settings/Makefile b/package/lean/default-settings/Makefile index 7d7a5b34c..d8170a254 100644 --- a/package/lean/default-settings/Makefile +++ b/package/lean/default-settings/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=default-settings PKG_VERSION:=1.0 -PKG_RELEASE:=32 +PKG_RELEASE:=33 PKG_LICENSE:=GPLv3 PKG_LICENSE_FILES:=LICENSE diff --git a/package/lean/default-settings/files/zzz-default-settings b/package/lean/default-settings/files/zzz-default-settings index 1829c279b..4b11abb7e 100755 --- a/package/lean/default-settings/files/zzz-default-settings +++ b/package/lean/default-settings/files/zzz-default-settings @@ -27,7 +27,7 @@ sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/p910nd.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/usb_printer.lua sed -i 's/\"services\"/\"nas\"/g' /usr/lib/lua/luci/controller/xunlei.lua -ln -sf /usr/sbin/ip /usr/bin/ip +ln -sf /sbin/ip /usr/bin/ip rm -rf /tmp/luci-modulecache/ rm -f /tmp/luci-indexcache @@ -46,9 +46,9 @@ sed -i '/set wireless.radio${devidx}.disabled/d' /lib/wifi/mac80211.sh wifi up sed -i '/DISTRIB_REVISION/d' /etc/openwrt_release -echo "DISTRIB_REVISION='R7.5.3 By Lean'" >> /etc/openwrt_release +echo "DISTRIB_REVISION='R7.5.4 By Lean'" >> /etc/openwrt_release sed -i '/DISTRIB_DESCRIPTION/d' /etc/openwrt_release -echo "DISTRIB_DESCRIPTION='OpenWrt 17.01.4'" >> /etc/openwrt_release +echo "DISTRIB_DESCRIPTION='OpenWrt '" >> /etc/openwrt_release exit 0 diff --git a/package/lean/polarssl/Makefile b/package/lean/polarssl/Makefile new file mode 100644 index 000000000..57fa81e91 --- /dev/null +++ b/package/lean/polarssl/Makefile @@ -0,0 +1,74 @@ +# +# Copyright (C) 2011-2015 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=polarssl +SRC_PKG_NAME:=mbedtls +PKG_VERSION:=1.3.16 +PKG_RELEASE:=1 +PKG_USE_MIPS16:=0 + +PKG_SOURCE:=$(SRC_PKG_NAME)-$(PKG_VERSION)-gpl.tgz +PKG_SOURCE_URL:=https://polarssl.org/download/ +PKG_MD5SUM:=66ebbbf67e8a9463041846822b0a1692 + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(SRC_PKG_NAME)-$(PKG_VERSION) + +PKG_BUILD_PARALLEL:=1 +PKG_LICENSE:=GPL-2.0+ + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/polarssl/Default + SUBMENU:=SSL + TITLE:=Embedded SSL + URL:=http://polarssl.org/ +endef + +define Package/polarssl/Default/description +The aim of the PolarSSL project is to provide a quality, open-source +cryptographic library written in C and targeted at embedded systems. +endef + +define Package/libpolarssl +$(call Package/polarssl/Default) + SECTION:=libs + CATEGORY:=Libraries + TITLE+= (library) + ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) +endef + +define Package/libpolarssl/description +$(call Package/polarssl/Default/description) +This package contains the PolarSSL library. +endef + +PKG_INSTALL:=1 + +CMAKE_OPTIONS += \ + -DCMAKE_BUILD_TYPE:String="Release" \ + -DUSE_SHARED_MBEDTLS_LIBRARY:Bool=ON \ + -DENABLE_TESTING:Bool=OFF \ + -DENABLE_PROGRAMS:Bool=OFF \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/polarssl $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ + $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so +endef + +define Package/libpolarssl/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmbedtls.so.* $(1)/usr/lib/ + $(LN) libmbedtls.so.$(PKG_VERSION) $(1)/usr/lib/libpolarssl.so +endef + +$(eval $(call BuildPackage,libpolarssl)) diff --git a/package/lean/polarssl/patches/100-disable_sslv3.patch b/package/lean/polarssl/patches/100-disable_sslv3.patch new file mode 100644 index 000000000..56c6c4d23 --- /dev/null +++ b/package/lean/polarssl/patches/100-disable_sslv3.patch @@ -0,0 +1,12 @@ +--- a/include/polarssl/config.h ++++ b/include/polarssl/config.h +@@ -1011,8 +1011,8 @@ + * POLARSSL_SHA1_C + * + * Comment this macro to disable support for SSL 3.0 +- */ + #define POLARSSL_SSL_PROTO_SSL3 ++ */ + + /** + * \def POLARSSL_SSL_PROTO_TLS1 diff --git a/package/lean/polarssl/patches/200-reduce_config.patch b/package/lean/polarssl/patches/200-reduce_config.patch new file mode 100644 index 000000000..6fef1a6f5 --- /dev/null +++ b/package/lean/polarssl/patches/200-reduce_config.patch @@ -0,0 +1,252 @@ +--- a/include/polarssl/config.h ++++ b/include/polarssl/config.h +@@ -432,8 +432,8 @@ + * Requires: POLARSSL_HMAC_DRBG_C + * + * Comment this macro to disable deterministic ECDSA. +- */ + #define POLARSSL_ECDSA_DETERMINISTIC ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_PSK_ENABLED +@@ -454,8 +454,8 @@ + * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED +@@ -478,8 +478,8 @@ + * TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_DHE_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_DHE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED +@@ -498,8 +498,8 @@ + * TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED +@@ -523,8 +523,8 @@ + * TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA + * TLS_RSA_PSK_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_RSA_PSK_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_RSA_ENABLED +@@ -602,8 +602,8 @@ + * TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_RSA_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_RSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED +@@ -626,8 +626,8 @@ + * TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 + * TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA + * TLS_ECDHE_ECDSA_WITH_RC4_128_SHA +- */ + #define POLARSSL_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED +@@ -650,8 +650,8 @@ + * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 +- */ + #define POLARSSL_KEY_EXCHANGE_ECDH_ECDSA_ENABLED ++ */ + + /** + * \def POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED +@@ -674,8 +674,8 @@ + * TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 +- */ + #define POLARSSL_KEY_EXCHANGE_ECDH_RSA_ENABLED ++ */ + + /** + * \def POLARSSL_PK_PARSE_EC_EXTENDED +@@ -835,8 +835,8 @@ + * \def POLARSSL_SELF_TEST + * + * Enable the checkup functions (*_self_test). +- */ + #define POLARSSL_SELF_TEST ++ */ + + /** + * \def POLARSSL_SSL_AEAD_RANDOM_IV +@@ -1151,8 +1151,8 @@ + * Requires: POLARSSL_VERSION_C + * + * Comment this to disable run-time checking and save ROM space +- */ + #define POLARSSL_VERSION_FEATURES ++ */ + + /** + * \def POLARSSL_X509_ALLOW_EXTENSIONS_NON_V3 +@@ -1470,8 +1470,8 @@ + * TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 + * TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 + * TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 +- */ + #define POLARSSL_CAMELLIA_C ++ */ + + /** + * \def POLARSSL_CCM_C +@@ -1498,8 +1498,8 @@ + * Requires: POLARSSL_PEM_PARSE_C + * + * This module is used for testing (ssl_client/server). +- */ + #define POLARSSL_CERTS_C ++ */ + + /** + * \def POLARSSL_CIPHER_C +@@ -1538,8 +1538,8 @@ + * library/ssl_tls.c + * + * This module provides debugging functions. +- */ + #define POLARSSL_DEBUG_C ++ */ + + /** + * \def POLARSSL_DES_C +@@ -1594,8 +1594,8 @@ + * ECDHE-ECDSA, ECDHE-RSA, DHE-PSK + * + * Requires: POLARSSL_ECP_C +- */ + #define POLARSSL_ECDH_C ++ */ + + /** + * \def POLARSSL_ECDSA_C +@@ -1609,8 +1609,8 @@ + * ECDHE-ECDSA + * + * Requires: POLARSSL_ECP_C, POLARSSL_ASN1_WRITE_C, POLARSSL_ASN1_PARSE_C +- */ + #define POLARSSL_ECDSA_C ++ */ + + /** + * \def POLARSSL_ECP_C +@@ -1622,8 +1622,8 @@ + * library/ecdsa.c + * + * Requires: POLARSSL_BIGNUM_C and at least one POLARSSL_ECP_DP_XXX_ENABLED +- */ + #define POLARSSL_ECP_C ++ */ + + /** + * \def POLARSSL_ENTROPY_C +@@ -1662,8 +1662,8 @@ + * + * This module enables the AES-GCM and CAMELLIA-GCM ciphersuites, if other + * requisites are enabled as well. +- */ + #define POLARSSL_GCM_C ++ */ + + /** + * \def POLARSSL_HAVEGE_C +@@ -1699,8 +1699,8 @@ + * Requires: POLARSSL_MD_C + * + * Uncomment to enable the HMAC_DRBG random number geerator. +- */ + #define POLARSSL_HMAC_DRBG_C ++ */ + + /** + * \def POLARSSL_MD_C +@@ -1826,8 +1826,8 @@ + * Requires: POLARSSL_HAVE_ASM + * + * This modules adds support for the VIA PadLock on x86. +- */ + #define POLARSSL_PADLOCK_C ++ */ + + /** + * \def POLARSSL_PBKDF2_C +@@ -1992,8 +1992,8 @@ + * Module: library/ripemd160.c + * Caller: library/md.c + * +- */ + #define POLARSSL_RIPEMD160_C ++ */ + + /** + * \def POLARSSL_RSA_C +@@ -2072,8 +2072,8 @@ + * Caller: + * + * Requires: POLARSSL_SSL_CACHE_C +- */ + #define POLARSSL_SSL_CACHE_C ++ */ + + /** + * \def POLARSSL_SSL_CLI_C +@@ -2149,8 +2149,8 @@ + * Caller: library/havege.c + * + * This module is used by the HAVEGE random number generator. +- */ + #define POLARSSL_TIMING_C ++ */ + + /** + * \def POLARSSL_VERSION_C +@@ -2160,8 +2160,8 @@ + * Module: library/version.c + * + * This module provides run-time version information. +- */ + #define POLARSSL_VERSION_C ++ */ + + /** + * \def POLARSSL_X509_USE_C +@@ -2270,8 +2270,8 @@ + * + * Module: library/xtea.c + * Caller: +- */ + #define POLARSSL_XTEA_C ++ */ + + /* \} name SECTION: mbed TLS modules */ + diff --git a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch index 4a90751e1..2dcfe9c21 100644 --- a/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch +++ b/package/libs/argp-standalone/patches/001-throw-in-funcdef.patch @@ -18,9 +18,9 @@ No __THROW in function implementation. --jsaw ---- argp-standalone-1.4-test2/argp.h.orig 2006-01-06 02:29:59.000000000 +0100 -+++ argp-standalone-1.4-test2/argp.h 2006-01-06 02:41:10.000000000 +0100 -@@ -560,17 +560,17 @@ +--- a/argp.h ++++ b/argp.h +@@ -560,17 +560,17 @@ __argp_short_program_name(const struct a # endif # ifndef ARGP_EI @@ -41,7 +41,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -582,7 +582,7 @@ +@@ -582,7 +582,7 @@ __option_is_short (__const struct argp_o } ARGP_EI int @@ -50,9 +50,9 @@ No __THROW in function implementation. { return !__opt->key && !__opt->name && !__opt->doc && !__opt->group; } ---- argp-standalone-1.4-test2/argp-parse.c.orig 2006-01-06 02:47:48.000000000 +0100 -+++ argp-standalone-1.4-test2/argp-parse.c 2006-01-06 02:48:16.000000000 +0100 -@@ -1290,13 +1290,13 @@ +--- a/argp-parse.c ++++ b/argp-parse.c +@@ -1277,13 +1277,13 @@ weak_alias (__argp_input, _argp_input) /* Defined here, in case a user is not inlining the definitions in * argp.h */ void @@ -68,7 +68,7 @@ No __THROW in function implementation. { if (__opt->flags & OPTION_DOC) return 0; -@@ -1310,7 +1310,7 @@ +@@ -1297,7 +1297,7 @@ __option_is_short (__const struct argp_o } int diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index a726691d3..07e1eb815 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=9412fac7b30872b738bc1ed1ebcaed54493c26ef9a67887913498c17b10f3bc2 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0+ PKG_LICENSE_FILES:=COPYING COPYING-GPLV2 COPYING-LGPLV3 +PKG_CPE_ID:=cpe:/a:elfutils_project:elfutils PKG_INSTALL:=1 PKG_USE_MIPS16:=0 diff --git a/package/libs/libevent2/Makefile b/package/libs/libevent2/Makefile index 99034bb22..5d56f37c5 100644 --- a/package/libs/libevent2/Makefile +++ b/package/libs/libevent2/Makefile @@ -17,6 +17,7 @@ PKG_SOURCE_URL:=@SF/levent PKG_HASH:=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:libevent_project:libevent PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/libs/libiconv-full/Makefile b/package/libs/libiconv-full/Makefile index 9776711a7..ac7bfddf5 100644 --- a/package/libs/libiconv-full/Makefile +++ b/package/libs/libiconv-full/Makefile @@ -51,7 +51,7 @@ define Package/iconv TITLE+= utility endef -TARGET_CFLAGS += $(FPIC) -DUSE_DOS +TARGET_CFLAGS += $(FPIC) -DUSE_DOS -std=gnu89 CONFIGURE_ARGS += \ --enable-shared \ diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 87dbc4708..eeb7870f0 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -19,6 +19,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR) PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:json-c_project:json-c PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -27,7 +28,7 @@ PKG_MAINTAINER:=Felix Fietkau include $(INCLUDE_DIR)/package.mk -TARGET_CFLAGS += $(FPIC) +TARGET_CFLAGS += $(FPIC) -Wno-implicit-fallthrough define Package/libjson-c SECTION:=libs diff --git a/package/libs/libnetfilter-conntrack/Makefile b/package/libs/libnetfilter-conntrack/Makefile index 399aa6ce1..be8228531 100644 --- a/package/libs/libnetfilter-conntrack/Makefile +++ b/package/libs/libnetfilter-conntrack/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnetfilter_conntrack -PKG_VERSION:=1.0.6 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/libnetfilter_conntrack/files/ \ - ftp://ftp.netfilter.org/pub/libnetfilter_conntrack/ -PKG_HASH:=efcc08021284e75f4d96d3581c5155a11f08fd63316b1938cbcb269c87f37feb +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/libnetfilter_conntrack +PKG_SOURCE_DATE:=2017-07-25 +PKG_SOURCE_VERSION:=e870432649955d377a73ee5a72cb23f0f6b5e4c5 +PKG_MIRROR_HASH:=6891e6bea956d5d3514524918f439dfe8b5806397d8d40d1afc69b9bfebc1d57 + PKG_MAINTAINER:=Jo-Philipp Wich PKG_FIXUP:=autoreconf diff --git a/package/libs/libnetfilter-queue/Makefile b/package/libs/libnetfilter-queue/Makefile index dd8fd9f09..8a11d0798 100644 --- a/package/libs/libnetfilter-queue/Makefile +++ b/package/libs/libnetfilter-queue/Makefile @@ -11,10 +11,10 @@ PKG_NAME:=libnetfilter_queue PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=http://git.netfilter.org/libnetfilter_queue -PKG_SOURCE_DATE:=2016-07-03 -PKG_SOURCE_VERSION:=981025e103d887fb6a9c9bb49c74ec323108d098 -PKG_MIRROR_HASH:=85c124be0e19162e1ebd1aba6e7e86bb4106e9dab4267baaf66d3ccb48d56e3f +PKG_SOURCE_URL=https://git.netfilter.org/libnetfilter_queue +PKG_SOURCE_DATE:=2017-06-27 +PKG_SOURCE_VERSION:=601abd1c71ccdf90753cf294c120ad43fb25dc54 +PKG_MIRROR_HASH:=283b99cfe5856dc87fd6bab8f78c0c59b72462d6b4f2b13111f928cf33020eb3 PKG_FIXUP:=autoreconf PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch index 81faffe82..92e750d51 100644 --- a/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch +++ b/package/libs/libnetfilter-queue/patches/100-checksum_computation.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -26,8 +27,13 @@ uint16_t nfq_checksum(uint32_t sum, uint sum += *buf++; size -= sizeof(uint16_t); } @@ -24,7 +24,7 @@ sum = (sum >> 16) + (sum & 0xffff); sum += (sum >>16); -@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint16_t *buf, int size) +@@ -35,7 +41,7 @@ uint16_t nfq_checksum(uint32_t sum, uint return (uint16_t)(~sum); } @@ -33,7 +33,7 @@ { uint32_t sum = 0; uint32_t iph_len = iph->ihl*4; -@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct iphdr *iph) +@@ -46,13 +52,13 @@ uint16_t nfq_checksum_tcpudp_ipv4(struct sum += (iph->saddr) & 0xFFFF; sum += (iph->daddr >> 16) & 0xFFFF; sum += (iph->daddr) & 0xFFFF; @@ -49,7 +49,7 @@ { uint32_t sum = 0; uint32_t hdr_len = (uint32_t *)transport_hdr - (uint32_t *)ip6h; -@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct ip6_hdr *ip6h, void *transport_hdr) +@@ -68,7 +74,7 @@ uint16_t nfq_checksum_tcpudp_ipv6(struct sum += (ip6h->ip6_dst.s6_addr16[i] >> 16) & 0xFFFF; sum += (ip6h->ip6_dst.s6_addr16[i]) & 0xFFFF; } @@ -58,11 +58,9 @@ sum += htons(ip6h->ip6_plen); return nfq_checksum(sum, (uint16_t *)payload, len); -diff --git a/src/extra/tcp.c b/src/extra/tcp.c -index d1cd79d..a66f392 100644 --- a/src/extra/tcp.c +++ b/src/extra/tcp.c -@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcphdr *tcph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_tcp_compute_checksum_ipv4(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -71,7 +69,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_tcp_compute_checksum_ipv4); -@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcphdr *tcph, struct ip6_hdr *ip6h) +@@ -110,7 +110,7 @@ nfq_tcp_compute_checksum_ipv6(struct tcp { /* checksum field in header needs to be zero for calculation. */ tcph->check = 0; @@ -82,7 +80,7 @@ index d1cd79d..a66f392 100644 --- a/src/extra/udp.c +++ b/src/extra/udp.c -@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udphdr *udph, struct iphdr *iph) +@@ -96,7 +96,7 @@ nfq_udp_compute_checksum_ipv4(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; @@ -91,7 +89,7 @@ index d1cd79d..a66f392 100644 } EXPORT_SYMBOL(nfq_udp_compute_checksum_ipv4); -@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udphdr *udph, struct ip6_hdr *ip6h) +@@ -115,7 +115,7 @@ nfq_udp_compute_checksum_ipv6(struct udp { /* checksum field in header needs to be zero for calculation. */ udph->check = 0; diff --git a/package/libs/libnftnl/Makefile b/package/libs/libnftnl/Makefile index 5b541f451..f4a1bb132 100644 --- a/package/libs/libnftnl/Makefile +++ b/package/libs/libnftnl/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnftnl -PKG_VERSION:=1.0.6 +PKG_VERSION:=1.0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/libnftnl +PKG_SOURCE_URL:=https://git.netfilter.org/libnftnl PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=libnftnl-1.0.6 -PKG_MIRROR_HASH:=c9e066e3fd29951cbe96d2898b4d6cdcfe802b3a4f09f8273a508e7a0a20a357 +PKG_SOURCE_VERSION:=libnftnl-1.0.7 +PKG_MIRROR_HASH:=d38a409d52074a5b20f5b7477b385506692a9a05ec6f4ac3d14a8a80aa4f81d9 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0+ diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 7916556c0..67201cc7c 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -8,14 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.2.29 +PKG_VERSION:=3.3.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_2_29 -PKG_HASH:=0beb593dc6abfffa18a5c787b27884979c1b7e7f1fd468c801e3cc938a685922 +PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl3_3_0 +PKG_HASH:=705468b5ae4cd1eb099d2d1c476d6a3abe519bc2810becf12fb1e32de1e074e4 PKG_LICENSE:=LGPL-2.1 +PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk define Package/libnl/default @@ -77,13 +80,6 @@ endef TARGET_CFLAGS += -ffunction-sections $(FPIC) -define Build/Compile - $(call Build/Compile/Default) - make -C $(PKG_BUILD_DIR) \ - DESTDIR="$(PKG_INSTALL_DIR)" \ - install -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/libnl3 $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libnl3/* $(1)/usr/include/libnl3/ diff --git a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch b/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch deleted file mode 100644 index a31ef4772..000000000 --- a/package/libs/libnl/patches/0001-lib-Escape-usage-of-strerror_l-if-it-doesn-t-exist-i.patch +++ /dev/null @@ -1,105 +0,0 @@ -From 098a4cc35b0da4438b8b67a914edecebef5bb6a9 Mon Sep 17 00:00:00 2001 -From: Alexey Brodkin -Date: Fri, 10 Mar 2017 13:22:14 +0300 -Subject: [PATCH] lib: Escape usage of strerror_l() if it doesn't exist in libc - -uClibc doesn't implement strerror_l() and thus libnl starting from -3.2.29 couldn't be compiled with it any longer. - -To work-around that problem we'll just do a check on strerror_l() -availability during configuration and if it's not there just fall back -to locale-less strerror(). - -Signed-off-by: Alexey Brodkin -Cc: Andre Draszik -Cc: Thomas Haller ---- - -This patch is now accepted upstream and will be a part of the next libnl -release, see -https://github.com/thom311/libnl/commit/e15966ac7f3b43df2acf869f98089762807d0568 - - configure.ac | 2 ++ - lib/utils.c | 8 +++++++- - src/lib/utils.c | 6 ++++++ - 3 files changed, 15 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 68b285e5b15c..2739b997ee3a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -121,6 +121,8 @@ fi - - AC_CONFIG_SUBDIRS([doc]) - -+AC_CHECK_FUNCS([strerror_l]) -+ - AC_CONFIG_FILES([ - Makefile - libnl-3.0.pc -diff --git a/lib/utils.c b/lib/utils.c -index fb350d13fd2f..06273c5b291e 100644 ---- a/lib/utils.c -+++ b/lib/utils.c -@@ -30,7 +30,9 @@ - #include - #include - #include /* exit() */ -+#ifdef HAVE_STRERROR_L - #include -+#endif - - /** - * Global variable indicating the desired level of debugging output. -@@ -123,9 +125,10 @@ int __nl_read_num_str_file(const char *path, int (*cb)(long, const char *)) - - const char *nl_strerror_l(int err) - { -+ const char *buf; -+#ifdef HAVE_STRERROR_L - int errno_save = errno; - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); -- const char *buf; - - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -140,6 +143,9 @@ const char *nl_strerror_l(int err) - } - - errno = errno_save; -+#else -+ buf = strerror(err); -+#endif - return buf; - } - /** @endcond */ -diff --git a/src/lib/utils.c b/src/lib/utils.c -index 5878f279c364..feb1d4ef4056 100644 ---- a/src/lib/utils.c -+++ b/src/lib/utils.c -@@ -81,6 +81,7 @@ void nl_cli_fatal(int err, const char *fmt, ...) - fprintf(stderr, "\n"); - } else { - char *buf; -+#ifdef HAVE_STRERROR_L - locale_t loc = newlocale(LC_MESSAGES_MASK, "", (locale_t)0); - if (loc == (locale_t)0) { - if (errno == ENOENT) -@@ -91,9 +92,14 @@ void nl_cli_fatal(int err, const char *fmt, ...) - } - if (loc != (locale_t)0) - buf = strerror_l(err, loc); -+#else -+ buf = strerror(err); -+#endif - fprintf(stderr, "%s\n", buf); -+#ifdef HAVE_STRERROR_L - if (loc != (locale_t)0) - freelocale(loc); -+#endif - } - - exit(abs(err)); --- -2.7.4 - diff --git a/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch new file mode 100644 index 000000000..845a59376 --- /dev/null +++ b/package/libs/libnl/patches/100-build-add-Libs.private-field-in-libnl-pkg-config-file.patch @@ -0,0 +1,30 @@ +From db0d59cd06f3ffd350379847c0885e1bfb85af0f Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 7 Mar 2015 11:34:42 +0100 +Subject: [PATCH 2/2] build: add Libs.private field in libnl pkg-config file + +In order to support static linking, the libnl pkg-config file should +indicate in its Libs.private field the libraries that libnl-3.0.a +requires. The LIBS variable contains the appropriate list of +libraries: -lm in all cases, and -lpthread when pthread support is +enabled. This allows to statically link applications against libnl +properly. + +Signed-off-by: Thomas Petazzoni +--- + libnl-3.0.pc.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libnl-3.0.pc.in b/libnl-3.0.pc.in +index b87e3dc..ddbc999 100644 +--- a/libnl-3.0.pc.in ++++ b/libnl-3.0.pc.in +@@ -7,4 +7,5 @@ Name: libnl + Description: Convenience library for netlink sockets + Version: @PACKAGE_VERSION@ + Libs: -L${libdir} -lnl-@MAJ_VERSION@ ++Libs.private: @LIBS@ + Cflags: -I${includedir}/libnl@MAJ_VERSION@ +-- +2.1.0 + diff --git a/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch new file mode 100644 index 000000000..11dc75b89 --- /dev/null +++ b/package/libs/libnl/patches/101-add-musl-workaround-to-the-libc-compat.h-copy.patch @@ -0,0 +1,103 @@ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/if_ether.h libnl-3.3.0_rc1/include/linux-private/linux/if_ether.h +--- /include/linux-private/linux/if_ether.h 2017-03-08 19:56:31.824516933 -0800 ++++ /include/linux-private/linux/if_ether.h 2017-03-08 20:07:01.938237767 -0800 +@@ -22,6 +22,7 @@ + #define _LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -117,10 +118,12 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + #endif /* _LINUX_IF_ETHER_H */ +diff -Naur libnl-3.3.0_rc1.orig/include/linux-private/linux/libc-compat.h libnl-3.3.0_rc1/include/linux-private/linux/libc-compat.h +--- /include/linux-private/linux/libc-compat.h 2017-03-08 19:56:31.823516923 -0800 ++++ /include/linux-private/linux/libc-compat.h 2017-03-08 20:12:30.376843489 -0800 +@@ -48,10 +48,18 @@ + #ifndef _LIBC_COMPAT_H + #define _LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We're used from userspace... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/if_ether.h */ ++#ifdef _NETINET_IF_ETHER_H /* musl */ ++#define __UAPI_DEF_ETHHDR 0 ++#else ++/* glibc uses __NETINET_IF_ETHER_H, and uses the uapi header. */ ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + + /* GLIBC headers included first so don't define anything +@@ -64,15 +72,7 @@ + #define __UAPI_DEF_IN_CLASS 0 + + #define __UAPI_DEF_IN6_ADDR 0 +-/* The exception is the in6_addr macros which must be defined +- * if the glibc code didn't define them. This guard matches +- * the guard in glibc/inet/netinet/in.h which defines the +- * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 +-#else +-#define __UAPI_DEF_IN6_ADDR_ALT 1 +-#endif + #define __UAPI_DEF_SOCKADDR_IN6 0 + #define __UAPI_DEF_IPV6_MREQ 0 + #define __UAPI_DEF_IPPROTO_V6 0 +@@ -83,7 +83,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -93,7 +93,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -115,7 +115,10 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ ++ ++/* Definitions for if/ether.h */ ++#define __UAPI_DEF_ETHHDR 1 + + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 +@@ -138,6 +141,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* defined(__KERNEL__) */ + + #endif /* _LIBC_COMPAT_H */ diff --git a/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch new file mode 100644 index 000000000..f715bb83f --- /dev/null +++ b/package/libs/libnl/patches/102-revert-build-enable-building-cli-during-tests.patch @@ -0,0 +1,115 @@ +From 68f8393bd356a3d0598cf77e1044b7e8b98aa4d8 Mon Sep 17 00:00:00 2001 +Message-Id: <68f8393bd356a3d0598cf77e1044b7e8b98aa4d8.1493920165.git.baruch@tkos.co.il> +From: Baruch Siach +Date: Thu, 4 May 2017 15:56:14 +0300 +Subject: [PATCH] Revert "build: enable building cli during tests" + +This reverts commit 3cb28534d34392ceec4adead0cfa97039796ccb7. + +Contrary to what 3cb28534d commit log claims, the cli programs depend on +dynamic libraries support of the toolchain. Enabling cli programs +unconditionally breaks static build as follows: + +In file included from lib/cli/cls/basic.c:12:0: +./include/netlink/cli/utils.h:25:19: fatal error: dlfcn.h: No such file or directory +compilation terminated. +Makefile:3666: recipe for target 'lib/cli/cls/lib_cli_cls_basic_la-basic.lo' failed +make[1]: *** [lib/cli/cls/lib_cli_cls_basic_la-basic.lo] Error 1 + +Revert that commit to restore the ability of static only build of libnl, and +its dependencies. + +Signed-off-by: Baruch Siach +--- +Upstream status: https://github.com/thom311/libnl/pull/141 + + Makefile.am | 21 ++++++--------------- + 1 file changed, 6 insertions(+), 15 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 1b95a559304f..279548394650 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3,8 +3,6 @@ + ACLOCAL_AMFLAGS = -I m4 + + lib_LTLIBRARIES = +-noinst_LTLIBRARIES = +-check_LTLIBRARIES = + + check_PROGRAMS = + check_programs = +@@ -500,6 +498,8 @@ EXTRA_lib_libnl_xfrm_3_la_DEPENDENCIES = \ + lib_libnl_xfrm_3_la_LIBADD = \ + lib/libnl-3.la + ++if ENABLE_CLI ++ + lib_cli_ltlibraries_cls = \ + lib/cli/cls/basic.la \ + lib/cli/cls/cgroup.la +@@ -513,15 +513,11 @@ lib_cli_ltlibraries_qdisc = \ + lib/cli/qdisc/pfifo.la \ + lib/cli/qdisc/plug.la + +-if ENABLE_CLI + pkglib_clsdir = $(pkglibdir)/cli/cls + pkglib_qdiscdir = $(pkglibdir)/cli/qdisc + pkglib_cls_LTLIBRARIES = $(lib_cli_ltlibraries_cls) + pkglib_qdisc_LTLIBRARIES = $(lib_cli_ltlibraries_qdisc) +-else +-noinst_LTLIBRARIES += \ +- $(lib_cli_ltlibraries_cls) \ +- $(lib_cli_ltlibraries_qdisc) ++ + endif + + lib_cli_ldflags = \ +@@ -550,13 +546,8 @@ lib_cli_qdisc_plug_la_LDFLAGS = $(lib_cli_ldflags) + + ############################################################################### + +-src_lib_ldflags = +- + if ENABLE_CLI + lib_LTLIBRARIES += src/lib/libnl-cli-3.la +-src_lib_ldflags += -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) +-else +-check_LTLIBRARIES += src/lib/libnl-cli-3.la + endif + + src_lib_libnl_cli_3_la_SOURCES = \ +@@ -583,7 +574,7 @@ src_lib_libnl_cli_3_la_CPPFLAGS = \ + -I$(srcdir)/include \ + -I$(builddir)/include + src_lib_libnl_cli_3_la_LDFLAGS = \ +- $(src_lib_ldflags) \ ++ -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \ + -Wl,--version-script=$(srcdir)/libnl-cli-3.sym + src_lib_libnl_cli_3_la_LIBADD = \ + lib/libnl-3.la \ +@@ -668,8 +659,6 @@ else + noinst_PROGRAMS += $(cli_programs) + endif + endif +-else +-check_PROGRAMS += $(cli_programs) + endif + + src_genl_ctrl_list_CPPFLAGS = $(src_cppflags) +@@ -847,10 +836,12 @@ tests_test_complex_HTB_with_hash_filters_LDADD = $(tests_ldadd) + tests_test_u32_filter_with_actions_CPPFLAGS = $(tests_cppflags) + tests_test_u32_filter_with_actions_LDADD = $(tests_ldadd) + ++if ENABLE_CLI + check_PROGRAMS += \ + tests/test-cache-mngr \ + tests/test-genl \ + tests/test-nf-cache-mngr ++endif + + tests_cli_ldadd = \ + $(tests_ldadd) \ +-- +2.11.0 + diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 4d0ce4099..e702d5c05 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -12,7 +12,8 @@ PKG_VERSION:=1.8.1 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.tcpdump.org/release/ +PKG_SOURCE_URL:=http://www.us.tcpdump.org/release/ \ + http://www.tcpdump.org/release/ PKG_HASH:=673dbc69fdc3f5a86fb5759ab19899039a8e5e6c631749e48dcd9c6f0c83541e PKG_FIXUP:=patch-libtool diff --git a/package/libs/librpc/Makefile b/package/libs/librpc/Makefile index 0330614c3..e8f51a23f 100644 --- a/package/libs/librpc/Makefile +++ b/package/libs/librpc/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=librpc PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/librpc-uclibc.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/librpc-uclibc.git PKG_SOURCE_DATE:=2015-11-04 PKG_SOURCE_VERSION:=a921e3ded051746f9f7cd5e5a312fb6771716aac PKG_MIRROR_HASH:=22c8dc55e1c4e8e31635a37708a3ce622a6ca33ebd918a4321b0be6ffce89b21 diff --git a/package/libs/libtool/Makefile b/package/libs/libtool/Makefile index 5eb521a72..8cef09f78 100644 --- a/package/libs/libtool/Makefile +++ b/package/libs/libtool/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=afcce660d3dc54c63a0a5ba3cf05272239dc3c54bbeba20f6bad250f9dc007ae PKG_LICENSE:=GPL-2.0+ PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:libtool PKG_BUILD_PARALLEL:=0 diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 01b3a32b1..9b7d867f6 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=libubox PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/libubox.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git PKG_SOURCE_DATE:=2018-01-07 -PKG_SOURCE_VERSION:=1dafcd7813f147811a6bbdb00eec603fe732aac1 -PKG_MIRROR_HASH:=0bd0f0980cdb01950da4f10bffbb8089ffd76d442fc443b5f8e1aa860b429063 +PKG_SOURCE_VERSION:=1c08e80313fd487112c48346889cc57badeef751 +PKG_MIRROR_HASH:=58cad98de55d44d7791e5d49b809ac5c32d3e6c481dc385b10e02386853f2263 CMAKE_INSTALL:=1 PKG_LICENSE:=ISC diff --git a/package/libs/libunwind/Makefile b/package/libs/libunwind/Makefile index 44f1ef256..2e655ed6f 100644 --- a/package/libs/libunwind/Makefile +++ b/package/libs/libunwind/Makefile @@ -20,6 +20,7 @@ PKG_INSTALL:=1 PKG_LICENSE:=X11 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:libunwind_project:libunwind PKG_MAINTAINER:=Yousong Zhou diff --git a/package/libs/libusb-compat/Makefile b/package/libs/libusb-compat/Makefile index 59c5a80bd..0dc93941a 100644 --- a/package/libs/libusb-compat/Makefile +++ b/package/libs/libusb-compat/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libusb-compat -PKG_VERSION:=0.1.4 -PKG_RELEASE:=2 +PKG_VERSION:=0.1.5 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@SF/libusb -PKG_HASH:=ed5bdd160c7b01ef767fb931a81b454f46226d1e2cf58502ced758d3e5a9fdc4 +PKG_HASH:=404ef4b6b324be79ac1bfb3d839eac860fbc929e6acb1ef88793a6ea328bc55a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 diff --git a/package/libs/lzo/Makefile b/package/libs/lzo/Makefile index 8d85e4652..ef33619d8 100644 --- a/package/libs/lzo/Makefile +++ b/package/libs/lzo/Makefile @@ -42,10 +42,6 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += $(FPIC) MAKE_FLAGS += CFLAGS_O="$(TARGET_CFLAGS)" -ifeq ($(CONFIG_i386)$(CONFIG_x86_64),) - TARGET_CFLAGS += -DLZO_CFG_NO_UNALIGNED=1 -endif - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/include/lzo $(1)/usr/include/ diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 0e3383150..3a2b29228 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=a99959d7360def22f9108d2d487c9de384fe76c349697176b1f22370080d5810 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:arm:mbed_tls include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/libs/mbedtls/patches/200-config.patch b/package/libs/mbedtls/patches/200-config.patch index ce32be76a..5fbd6b145 100644 --- a/package/libs/mbedtls/patches/200-config.patch +++ b/package/libs/mbedtls/patches/200-config.patch @@ -269,12 +269,3 @@ /* \} name SECTION: mbed TLS modules */ -@@ -2681,7 +2681,7 @@ - * recommended because of it is possible to generte SHA-1 collisions, however - * this may be safe for legacy infrastructure where additional controls apply. - */ --// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES -+#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES - - /** - * Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile index 60a8a176d..26fabeef7 100644 --- a/package/libs/ncurses/Makefile +++ b/package/libs/ncurses/Makefile @@ -44,6 +44,14 @@ define Package/libncurses ABI_VERSION:=$(PKG_VERSION) endef +define Package/libncurses-dev + SECTION:=devel + CATEGORY:=Development + SUBMENU:=Libraries + DEPENDS:=zlib + TITLE:=Development files for the ncurses library +endef + TARGET_CFLAGS += $(FPIC) CONFIGURE_ARGS += \ @@ -124,6 +132,17 @@ define Package/libncurses/install done endef +define Package/libncurses-dev/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.a $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ +endef + define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/* $(1) for lib in ncurses panel menu form; do \ @@ -150,3 +169,4 @@ endef $(eval $(call HostBuild)) $(eval $(call BuildPackage,terminfo)) $(eval $(call BuildPackage,libncurses)) +$(eval $(call BuildPackage,libncurses-dev)) diff --git a/package/libs/nghttp2/Makefile b/package/libs/nghttp2/Makefile new file mode 100644 index 000000000..3cc2a5543 --- /dev/null +++ b/package/libs/nghttp2/Makefile @@ -0,0 +1,45 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=nghttp2 +PKG_VERSION:=1.29.0 +PKG_RELEASE:=1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz + +PKG_SOURCE_URL:=https://github.com/nghttp2/nghttp2/releases/download/v$(PKG_VERSION) +PKG_HASH:=a7a1b18be57be6a53a7739988ea27d6ec9209e7b0e8372b8483cd911d7838739 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/libnghttp2 + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Library implementing the framing layer of HTTP/2 + MAINTAINER:=Hans Dedecker +endef + +define Package/libnghttp2/description + C library implementing the framing layer of the HTTP/2 protocol. It can be used to build a HTTP/2-capable HTTP client or server +endef + +CMAKE_OPTIONS += \ + -DENABLE_LIB_ONLY=ON + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/nghttp2 + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/nghttp2/*.h $(1)/usr/include/nghttp2/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib/ +endef + +define Package/libnghttp2/install + $(INSTALL_DIR) $(1)/usr/lib + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libnghttp2.so* $(1)/usr/lib +endef + +$(eval $(call BuildPackage,libnghttp2)) diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in index b949d3beb..96d3ba3e9 100644 --- a/package/libs/openssl/Config.in +++ b/package/libs/openssl/Config.in @@ -55,6 +55,11 @@ config OPENSSL_HARDWARE_SUPPORT default n prompt "Enable hardware support" +config OPENSSL_OPTIMIZE_SPEED + bool + default n + prompt "Enable optimization for speed instead of size" + endif config OPENSSL_ENGINE_CRYPTO diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile index 4b70bc724..b75aa45e8 100644 --- a/package/libs/openssl/Makefile +++ b/package/libs/openssl/Makefile @@ -18,15 +18,17 @@ PKG_BUILD_PARALLEL:=0 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=http://www.openssl.org/source/ \ - ftp://ftp.openssl.org/source/ \ - http://www.openssl.org/source/old/$(PKG_BASE)/ \ - ftp://ftp.funet.fi/pub/crypt/mirrors/ftp.openssl.org/source \ - ftp://ftp.sunet.se/pub/security/tools/net/openssl/source/ +PKG_SOURCE_URL:= \ + http://ftp.fi.muni.cz/pub/openssl/source/ \ + http://ftp.linux.hr/pub/openssl/source/ \ + http://gd.tuwien.ac.at/infosys/security/openssl/source/ \ + http://www.openssl.org/source/ \ + http://www.openssl.org/source/old/$(PKG_BASE)/ PKG_HASH:=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe PKG_LICENSE:=OpenSSL PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:openssl:openssl PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_ENGINE_CRYPTO \ CONFIG_OPENSSL_ENGINE_DIGEST \ @@ -39,7 +41,8 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_OPENSSL_WITH_COMPRESSION \ CONFIG_OPENSSL_WITH_NPN \ CONFIG_OPENSSL_WITH_PSK \ - CONFIG_OPENSSL_WITH_SRP + CONFIG_OPENSSL_WITH_SRP \ + CONFIG_OPENSSL_OPTIMIZE_SPEED include $(INCLUDE_DIR)/package.mk @@ -153,6 +156,10 @@ ifndef CONFIG_OPENSSL_WITH_SRP OPENSSL_OPTIONS += no-srp endif +ifeq ($(CONFIG_OPENSSL_OPTIMIZE_SPEED),y) + TARGET_CFLAGS := $(filter-out -Os,$(TARGET_CFLAGS)) -O3 +endif + ifeq ($(CONFIG_x86_64),y) OPENSSL_TARGET:=linux-x86_64-openwrt OPENSSL_MAKEFLAGS += LIBDIR=lib @@ -160,6 +167,8 @@ else OPENSSL_OPTIONS+=no-sse2 ifeq ($(CONFIG_mips)$(CONFIG_mipsel),y) OPENSSL_TARGET:=linux-mips-openwrt + else ifeq ($(CONFIG_aarch64),y) + OPENSSL_TARGET:=linux-aarch64-openwrt else ifeq ($(CONFIG_arm)$(CONFIG_armeb),y) OPENSSL_TARGET:=linux-armv4-openwrt else @@ -181,7 +190,7 @@ define Build/Configure --openssldir=/etc/ssl \ $(TARGET_CPPFLAGS) \ $(TARGET_LDFLAGS) -ldl \ - -DOPENSSL_SMALL_FOOTPRINT \ + $(if $(CONFIG_OPENSSL_OPTIMIZE_SPEED),,-DOPENSSL_SMALL_FOOTPRINT) \ $(OPENSSL_NO_CIPHERS) \ $(OPENSSL_OPTIONS) \ ) diff --git a/package/libs/openssl/patches/110-optimize-for-size.patch b/package/libs/openssl/patches/110-optimize-for-size.patch index 0f174a346..d6d4a2111 100644 --- a/package/libs/openssl/patches/110-optimize-for-size.patch +++ b/package/libs/openssl/patches/110-optimize-for-size.patch @@ -1,11 +1,12 @@ --- a/Configure +++ b/Configure -@@ -470,6 +470,12 @@ my %table=( +@@ -470,6 +470,13 @@ my %table=( "linux-alpha-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", "linux-alpha+bwx-ccc","ccc:-fast -readonly_strings -DL_ENDIAN::-D_REENTRANT:::SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL:${alpha_asm}", +# OpenWrt targets +"linux-armv4-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${armv4_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"linux-aarch64-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${aarch64_asm}:linux64:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-x86_64-openwrt", "gcc:-m64 -DL_ENDIAN -DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:elf:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):::64", +"linux-mips-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${mips32_asm}:o32:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +"linux-generic-openwrt","gcc:-DTERMIOS \$(OPENWRT_OPTIMIZATION_FLAGS) -fomit-frame-pointer -Wall::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL BF_PTR:${no_asm}:dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", diff --git a/package/libs/openssl/patches/160-disable_doc_tests.patch b/package/libs/openssl/patches/160-disable_doc_tests.patch index 73459ff90..e38d44a76 100644 --- a/package/libs/openssl/patches/160-disable_doc_tests.patch +++ b/package/libs/openssl/patches/160-disable_doc_tests.patch @@ -36,7 +36,7 @@ build_libs: build_libcrypto build_libssl openssl.pc -@@ -534,7 +534,7 @@ dist: +@@ -542,7 +542,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -47,7 +47,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ --- a/Makefile.org +++ b/Makefile.org -@@ -532,7 +532,7 @@ dist: +@@ -540,7 +540,7 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar diff --git a/package/libs/openssl/patches/200-parallel_build.patch b/package/libs/openssl/patches/200-parallel_build.patch index f1d9f0705..f2acc4a27 100644 --- a/package/libs/openssl/patches/200-parallel_build.patch +++ b/package/libs/openssl/patches/200-parallel_build.patch @@ -24,7 +24,7 @@ all_testapps: build_libs build_testapps build_testapps: -@@ -465,7 +465,7 @@ update: errors stacks util/libeay.num ut +@@ -473,7 +473,7 @@ update: errors stacks util/libeay.num ut @set -e; target=update; $(RECURSIVE_BUILD_CMD) depend: @@ -33,7 +33,7 @@ lint: @set -e; target=lint; $(RECURSIVE_BUILD_CMD) -@@ -527,9 +527,9 @@ dist: +@@ -535,9 +535,9 @@ dist: @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -45,7 +45,7 @@ @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \ $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR)/engines \ -@@ -538,12 +538,19 @@ install_sw: +@@ -546,12 +546,19 @@ install_sw: $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ $(INSTALL_PREFIX)$(OPENSSLDIR)/private @@ -66,7 +66,7 @@ @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ do \ if [ -f "$$i" ]; then \ -@@ -627,12 +634,7 @@ install_html_docs: +@@ -635,12 +642,7 @@ install_html_docs: done; \ done @@ -173,7 +173,7 @@ apps: @(cd ..; $(MAKE) DIRS=apps all) -@@ -577,7 +577,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl +@@ -578,7 +578,7 @@ $(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssl # fi dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO) diff --git a/package/libs/libreadline/Makefile b/package/libs/readline/Makefile similarity index 95% rename from package/libs/libreadline/Makefile rename to package/libs/readline/Makefile index 3c1b048fe..ca3a46863 100644 --- a/package/libs/libreadline/Makefile +++ b/package/libs/readline/Makefile @@ -17,12 +17,14 @@ PKG_HASH:=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d32334 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:gnu:readline PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk define Package/libreadline SECTION:=libs @@ -69,4 +71,5 @@ define Package/libreadline/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{history,readline}.{so,so.7,so.7.0} $(1)/usr/lib/ endef +$(eval $(call HostBuild)) $(eval $(call BuildPackage,libreadline)) diff --git a/package/libs/libreadline/patches/001-install_perm.patch b/package/libs/readline/patches/001-install_perm.patch similarity index 100% rename from package/libs/libreadline/patches/001-install_perm.patch rename to package/libs/readline/patches/001-install_perm.patch diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile index 58bd06cb5..ce0acd19b 100644 --- a/package/libs/toolchain/Makefile +++ b/package/libs/toolchain/Makefile @@ -275,6 +275,32 @@ define Package/libgfortran/config endmenu endef +define Package/libgomp +$(call Package/gcc/Default) + TITLE:=OpenMP support library +endef + +define Package/libgomp/config + menu "Configuration" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + + config LIBGOMP_ROOT_DIR + string + prompt "libgomp shared library base directory" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN + default "/" if NATIVE_TOOLCHAIN + + config LIBGOMP_FILE_SPEC + string + prompt "libgomp shared library files (use wildcards)" + depends on EXTERNAL_TOOLCHAIN && PACKAGE_libgomp + default "./lib/libgomp.so*" + + endmenu +endef + + define Package/ldd $(call Package/libc/Default) DEPENDS:=@!USE_MUSL @@ -343,9 +369,6 @@ LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) define Build/Compile/uClibc $(CP) \ $(TOOLCHAIN_DIR)/lib/libuClibc-*.so \ - $(TOOLCHAIN_DIR)/lib/libcrypt-*.so \ - $(TOOLCHAIN_DIR)/lib/libm-*.so \ - $(TOOLCHAIN_DIR)/lib/libpthread-*.so \ $(PKG_BUILD_DIR)/ endef ifneq ($(LIBGCC_SO),) @@ -415,17 +438,8 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) $(TOOLCHAIN_DIR)/lib/libc.so.* \ $(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ $(1)/lib/ - for file in libcrypt libdl libm libutil; do \ - $(CP) \ - $(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ - $(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ - $(1)/lib/; \ - done - $(CP) \ $(PKG_BUILD_DIR)/libuClibc-* \ - $(PKG_BUILD_DIR)/libm-* \ - $(PKG_BUILD_DIR)/libcrypt-* \ $(1)/lib/ endef @@ -457,7 +471,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/libpthread/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) + ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/libpthread.so.* \ $(TOOLCHAIN_DIR)/lib/libpthread-$(LIBC_SO_VERSION).so \ @@ -482,7 +496,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) define Package/librt/install $(INSTALL_DIR) $(1)/lib - ifneq ($(CONFIG_USE_MUSL),y) + ifneq ($(CONFIG_USE_MUSL)$(CONFIG_USE_UCLIBC),y) $(CP) \ $(TOOLCHAIN_DIR)/lib/librt.so.* \ $(TOOLCHAIN_DIR)/lib/librt-$(LIBC_SO_VERSION).so \ @@ -573,6 +587,14 @@ else exit 0 endef + define Package/libgomp/install + for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \ + $(INSTALL_DIR) $(1)/lib ; \ + $(CP) $(call qstrip,$(CONFIG_LIBGOMP_ROOT_DIR))/$$$$file $(1)/lib/ ; \ + done ; \ + exit 0 + endef + define Package/ldd/install for file in $(call qstrip,$(CONFIG_LDD_FILE_SPEC)); do \ dir=`dirname $$$$file` ; \ @@ -602,5 +624,6 @@ $(eval $(call BuildPackage,libpthread)) $(eval $(call BuildPackage,libthread-db)) $(eval $(call BuildPackage,librt)) $(eval $(call BuildPackage,libgfortran)) +$(eval $(call BuildPackage,libgomp)) $(eval $(call BuildPackage,ldd)) $(eval $(call BuildPackage,ldconfig)) diff --git a/package/libs/uclient/Makefile b/package/libs/uclient/Makefile index 3eefa2e01..f0c08a323 100644 --- a/package/libs/uclient/Makefile +++ b/package/libs/uclient/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=uclient PKG_RELEASE=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uclient.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uclient.git PKG_SOURCE_DATE:=2017-11-02 PKG_SOURCE_VERSION:=4b87d83160fec70d50b7fcd736a8c538c28a016c PKG_MIRROR_HASH:=4bbb4d5f295ebdcd67fec87a6794168bea2176a42cb2907c47d8566fb33dafb3 diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile index ff6c4b7d0..b5e773ba7 100644 --- a/package/libs/ustream-ssl/Makefile +++ b/package/libs/ustream-ssl/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=ustream-ssl PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ustream-ssl.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git PKG_SOURCE_DATE:=2016-07-02 PKG_SOURCE_VERSION:=ec80adaa1b47f28d426fa19c692011ce60b992d6 PKG_MIRROR_HASH:=bfbad6b4e8c1e933f0bfaab43cbdd44a536c08128c3a779e6f2395a6a886aab7 @@ -35,11 +35,11 @@ define Package/libustream-openssl VARIANT:=openssl endef -define Package/libustream-cyassl +define Package/libustream-wolfssl $(Package/libustream/default) - TITLE += (cyassl) - DEPENDS += +PACKAGE_libustream-cyassl:libcyassl - VARIANT:=cyassl + TITLE += (wolfssl) + DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl + VARIANT:=wolfssl endef define Package/libustream-mbedtls @@ -50,7 +50,7 @@ define Package/libustream-mbedtls DEFAULT_VARIANT:=1 endef -ifeq ($(BUILD_VARIANT),cyassl) +ifeq ($(BUILD_VARIANT),wolfssl) TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/cyassl -DHAVE_SNI CMAKE_OPTIONS += -DCYASSL=on endif @@ -64,9 +64,9 @@ define Package/libustream/default/install endef Package/libustream-openssl/install = $(Package/libustream/default/install) -Package/libustream-cyassl/install = $(Package/libustream/default/install) +Package/libustream-wolfssl/install = $(Package/libustream/default/install) Package/libustream-mbedtls/install = $(Package/libustream/default/install) $(eval $(call BuildPackage,libustream-mbedtls)) -$(eval $(call BuildPackage,libustream-cyassl)) +$(eval $(call BuildPackage,libustream-wolfssl)) $(eval $(call BuildPackage,libustream-openssl)) diff --git a/package/libs/cyassl/Config.in b/package/libs/wolfssl/Config.in similarity index 63% rename from package/libs/cyassl/Config.in rename to package/libs/wolfssl/Config.in index 371bb564f..7e8a4b6ce 100644 --- a/package/libs/cyassl/Config.in +++ b/package/libs/wolfssl/Config.in @@ -1,47 +1,47 @@ -if PACKAGE_libcyassl +if PACKAGE_libwolfssl -config CYASSL_HAS_AES_CCM +config WOLFSSL_HAS_AES_CCM bool "Include AES-CCM support" default n -config CYASSL_HAS_AES_GCM +config WOLFSSL_HAS_AES_GCM bool "Include AES-GCM support" default n -config CYASSL_HAS_CHACHA +config WOLFSSL_HAS_CHACHA bool "Include ChaCha cipher suite support" default n -config CYASSL_HAS_ECC +config WOLFSSL_HAS_ECC bool "Include ECC (Elliptic Curve Cryptography) support" default y -config CYASSL_HAS_DH +config WOLFSSL_HAS_DH bool "Include DH (Diffie-Hellman) support" default n -config CYASSL_HAS_ARC4 +config WOLFSSL_HAS_ARC4 bool "Include ARC4 support" default n -config CYASSL_HAS_DES3 +config WOLFSSL_HAS_DES3 bool "Include DES3 (Tripple-DES) support" default n -config CYASSL_HAS_PSK +config WOLFSSL_HAS_PSK bool "Include PKS (Pre Share Key) support" default n -config CYASSL_HAS_DTLS +config WOLFSSL_HAS_DTLS bool "Include DTLS support" default n -config CYASSL_HAS_ECC25519 +config WOLFSSL_HAS_ECC25519 bool "Include ECC Curve 22519 support" - depends on CYASSL_HAS_ECC + depends on WOLFSSL_HAS_ECC default n -config CYASSL_HAS_POLY_1305 +config WOLFSSL_HAS_POLY_1305 bool "Include Poly-1305 support" default n diff --git a/package/libs/cyassl/Makefile b/package/libs/wolfssl/Makefile similarity index 69% rename from package/libs/cyassl/Makefile rename to package/libs/wolfssl/Makefile index 0212ff73d..1d4b7f557 100644 --- a/package/libs/cyassl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2016 OpenWrt.org +# Copyright (C) 2006-2017 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -20,24 +20,27 @@ PKG_INSTALL:=1 PKG_USE_MIPS16:=0 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:yassl:cyassl include $(INCLUDE_DIR)/package.mk -define Package/libcyassl +define Package/libwolfssl SECTION:=libs SUBMENU:=SSL CATEGORY:=Libraries - TITLE:=CyaSSL library + TITLE:=wolfSSL library URL:=http://www.wolfssl.com/ + MAINTAINER:=Alexandru Ardelean MENU:=1 + PROVIDES:=libcyassl endef -define Package/libcyassl/description -CyaSSL is an SSL library optimized for small footprint, both on disk and for -memory use. +define Package/libwolfssl/description +wolfSSL (formerly CyaSSL) is an SSL library optimized for small +footprint, both on disk and for memory use. endef -define Package/libcyassl/config +define Package/libwolfssl/config source "$(SOURCE)/Config.in" endef @@ -55,58 +58,58 @@ CONFIGURE_ARGS += \ --enable-ipv6 endif -ifeq ($(CONFIG_CYASSL_HAS_AES_CCM),y) +ifeq ($(CONFIG_WOLFSSL_HAS_AES_CCM),y) CONFIGURE_ARGS += \ --enable-aesccm endif -ifeq ($(CONFIG_CYASSL_HAS_AES_GCM),y) +ifneq ($(CONFIG_WOLFSSL_HAS_AES_GCM),y) CONFIGURE_ARGS += \ - --enable-aesgcm + --disable-aesgcm endif -ifeq ($(CONFIG_CYASSL_HAS_CHACHA),y) +ifneq ($(CONFIG_WOLFSSL_HAS_CHACHA),y) CONFIGURE_ARGS += \ - --enable-chacha + --disable-chacha endif -ifeq ($(CONFIG_CYASSL_HAS_ECC),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC),y) CONFIGURE_ARGS += \ --enable-ecc \ --enable-supportedcurves endif -ifeq ($(CONFIG_CYASSL_HAS_DH),y) +ifneq ($(CONFIG_WOLFSSL_HAS_DH),y) CONFIGURE_ARGS += \ --enable-dh endif -ifeq ($(CONFIG_CYASSL_HAS_ARC4),n) +ifeq ($(CONFIG_WOLFSSL_HAS_ARC4),n) CONFIGURE_ARGS += \ --disable-arc4 endif -ifeq ($(CONFIG_CYASSL_HAS_DES3),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DES3),y) CONFIGURE_ARGS += \ --disable-des3 endif -ifeq ($(CONFIG_CYASSL_HAS_PSK),y) +ifeq ($(CONFIG_WOLFSSL_HAS_PSK),y) CONFIGURE_ARGS += \ --enable-psk endif -ifeq ($(CONFIG_CYASSL_HAS_DTLS),y) +ifeq ($(CONFIG_WOLFSSL_HAS_DTLS),y) CONFIGURE_ARGS += \ --enable-dtls endif -ifeq ($(CONFIG_CYASSL_HAS_ECC25519),y) +ifeq ($(CONFIG_WOLFSSL_HAS_ECC25519),y) CONFIGURE_ARGS += \ - --enable-ecc25519 + --enable-curve25519 endif -ifeq ($(CONFIG_CYASSL_HAS_POLY1305),y) +ifneq ($(CONFIG_WOLFSSL_HAS_POLY1305),y) CONFIGURE_ARGS += \ --enable-poly1305 endif @@ -130,10 +133,10 @@ define Build/InstallDev $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig endef -define Package/libcyassl/install +define Package/libwolfssl/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libwolfssl.so* $(1)/usr/lib/ ln -s libwolfssl.so $(1)/usr/lib/libcyassl.so endef -$(eval $(call BuildPackage,libcyassl)) +$(eval $(call BuildPackage,libwolfssl)) diff --git a/package/libs/cyassl/patches/001-CVE-2017-13099.patch b/package/libs/wolfssl/patches/001-CVE-2017-13099.patch similarity index 100% rename from package/libs/cyassl/patches/001-CVE-2017-13099.patch rename to package/libs/wolfssl/patches/001-CVE-2017-13099.patch diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch new file mode 100644 index 000000000..83d51b1d5 --- /dev/null +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -0,0 +1,11 @@ +--- a/wolfssl/wolfcrypt/settings.h ++++ b/wolfssl/wolfcrypt/settings.h +@@ -1553,7 +1553,7 @@ extern void uITRON4_free(void *p) ; + #endif + + /* warning for not using harden build options (default with ./configure) */ +-#ifndef WC_NO_HARDEN ++#if 0 + #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \ + (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \ + (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS)) diff --git a/package/libs/cyassl/patches/400-additional_compatibility.patch b/package/libs/wolfssl/patches/400-additional_compatibility.patch similarity index 100% rename from package/libs/cyassl/patches/400-additional_compatibility.patch rename to package/libs/wolfssl/patches/400-additional_compatibility.patch diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index e5fcb8c91..1bc2c4d1f 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -12,10 +12,10 @@ PKG_NAME:=firewall PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/firewall3.git -PKG_SOURCE_DATE:=2017-05-27 -PKG_SOURCE_VERSION:=a4d98aea373e04f3fdc3c492c1688ba52ce490a9 -PKG_MIRROR_HASH:=55402b1e6bb471f6aed599c61c1c63b58212f5789f094d78247646fc0a7cf435 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git +PKG_SOURCE_DATE:=2017-11-07 +PKG_SOURCE_VERSION:=c4309372acc7e1bef8aa230269f7da1dec790e68 +PKG_MIRROR_HASH:=1699884d8499d01e433959185f79ff9eb69704de47885b996123374b8015b422 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC diff --git a/package/network/config/gre/Makefile b/package/network/config/gre/Makefile index 9193f5c9f..b191327f8 100644 --- a/package/network/config/gre/Makefile +++ b/package/network/config/gre/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gre PKG_VERSION:=1 -PKG_RELEASE:=7 +PKG_RELEASE:=8 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/gre/files/gre.sh b/package/network/config/gre/files/gre.sh index 3301cee00..e604bfb25 100755 --- a/package/network/config/gre/files/gre.sh +++ b/package/network/config/gre/files/gre.sh @@ -31,7 +31,16 @@ gre_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - json_add_string info "${ikey:-0},${okey:-0},${icsum:-0},${ocsum:-0},${iseqno:-0},${oseqno:-0}" + + json_add_object 'data' + [ -n "$ikey" ] && json_add_int ikey "$ikey" + [ -n "$okey" ] && json_add_int okey "$okey" + [ -n "$icsum" ] && json_add_boolean icsum "$icsum" + [ -n "$ocsum" ] && json_add_boolean ocsum "$ocsum" + [ -n "$iseqno" ] && json_add_boolean iseqno "$iseqno" + [ -n "$oseqno" ] && json_add_boolean oseqno "$oseqno" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile index 6e0b47f87..3fa9f67d3 100644 --- a/package/network/config/ltq-adsl-app/Makefile +++ b/package/network/config/ltq-adsl-app/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=dsl_cpe_control_danube PKG_VERSION:=3.24.4.4 -PKG_RELEASE:=2 +PKG_RELEASE:=6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION) PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ @@ -24,7 +24,7 @@ PKG_CONFIG_DEPENDS:=\ CONFIG_LTQ_DSL_ENABLE_SOAP \ CONFIG_LTQ_DSL_ENABLE_DSL_EVENT_POLLING -PKG_BUILD_DEPENDS:=TARGET_lantiq_xway:kmod-ltq-adsl-danube TARGET_lantiq_xway_legacy:kmod-ltq-adsl-danube TARGET_lantiq_ase:kmod-ltq-adsl-ase +PKG_BUILD_DEPENDS:=ltq-adsl PKG_FLAGS:=nonshared @@ -76,10 +76,10 @@ CONFIGURE_ARGS += \ TARGET_CFLAGS += -I$(LINUX_DIR)/include define Package/ltq-adsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - - $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin endef diff --git a/package/network/config/ltq-adsl-app/files/10_atm.sh b/package/network/config/ltq-adsl-app/files/10_atm.sh new file mode 100755 index 000000000..7bc72a63f --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_atm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_atm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/10_ptm.sh b/package/network/config/ltq-adsl-app/files/10_ptm.sh new file mode 100755 index 000000000..8a76b926f --- /dev/null +++ b/package/network/config/ltq-adsl-app/files/10_ptm.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_ar9\|ltq_ptm_ase\|ltq_ptm_danube" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_ar9\|ltq_atm_ase\|ltq_atm_danube" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." + exit +fi + +case "$(strings /proc/device-tree/compatible)" in +*lantiq,ar9*) + soc="ar9" + ;; +*lantiq,ase*) + soc="ase" + ;; +*lantiq,danube*) + soc="danube" + ;; +*) + logger -p daemon.notice -t "dsl-notify" "Unsupported SoC" + exit +esac + +modprobe ltq_ptm_${soc} diff --git a/package/network/config/ltq-adsl-app/files/dsl_control b/package/network/config/ltq-adsl-app/files/dsl_control index dcde6b233..d93d47808 100644 --- a/package/network/config/ltq-adsl-app/files/dsl_control +++ b/package/network/config/ltq-adsl-app/files/dsl_control @@ -2,14 +2,12 @@ # Copyright (C) 2012 OpenWrt.org START=49 +USE_PROCD=1 EXTRA_COMMANDS="status lucistat" EXTRA_HELP=" status Get DSL status information lucistat Get status information if lua friendly format" -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 - [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh annex_b=10_00_10_00_00_04_00_00 @@ -28,7 +26,11 @@ annex_m2=00_00_00_00_40_00_00_00 annex_m2p=00_00_00_00_00_00_04_00 annex_j=10_00_10_40_00_04_01_00 -start() { +service_triggers() { + procd_add_reload_trigger network +} + +start_service() { local annex local firmware local xtu @@ -45,14 +47,15 @@ start() { return 1 } - esi $(printf '%012X' $((1+0x$(tr -d :
+Date: Mon, 16 Oct 2017 21:08:26 +0200 +Subject: ltq-adsl-app: add more script notifications + +Backport HANDSHAKE and TRAINING notification from ltq-vdsl-app. It +unifies the dsl led blinking pattern accross all subtargets and allows +to get the current line status from the dsl led. + +Signed-off-by: Mathias Kresin +--- + .../100-add-more-script-notifications.patch | 27 ++++++++++++++++++++++ + 1 file changed, 27 insertions(+) + create mode 100644 package/network/config/ltq-adsl-app/patches/100-add-more-script-notifications.patch + +--- a/src/dsl_cpe_control.c ++++ b/src/dsl_cpe_control.c +@@ -3273,7 +3273,23 @@ DSL_CPE_STATIC DSL_int_t DSL_CPE_Event_S + #ifdef INCLUDE_SCRIPT_NOTIFICATION + if (g_sRcScript != DSL_NULL) + { +- if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && ++ if ( (nLineState == DSL_LINESTATE_HANDSHAKE) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_HANDSHAKE) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "HANDSHAKE") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_FULL_INIT) && ++ (g_nPrevLineState[nDevice] != DSL_LINESTATE_FULL_INIT) ) ++ { ++ if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "TRAINING") == DSL_SUCCESS) ++ { ++ bExec = DSL_TRUE; ++ } ++ } ++ else if ( (nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC) && + (g_nPrevLineState[nDevice] != DSL_LINESTATE_SHOWTIME_TC_SYNC) ) + { + if (DSL_CPE_SetEnv("DSL_INTERFACE_STATUS", "UP") == DSL_SUCCESS) diff --git a/package/network/config/ltq-vdsl-app/Makefile b/package/network/config/ltq-vdsl-app/Makefile index 1ddb83a0a..fd5014957 100644 --- a/package/network/config/ltq-vdsl-app/Makefile +++ b/package/network/config/ltq-vdsl-app/Makefile @@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ltq-vdsl-app PKG_VERSION:=4.17.18.6 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_BASE_NAME:=dsl_cpe_control PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources @@ -17,7 +17,7 @@ PKG_HASH:=da8bb929526a61aea0e153ef524331fcd472a1ebbc6d88ca017735a4f82ece02 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_BASE_NAME)-$(PKG_VERSION) PKG_LICENSE:=BSD-2-Clause -PKG_BUILD_DEPENDS:=kmod-ltq-vdsl-vr9 +PKG_BUILD_DEPENDS:=ltq-vdsl PKG_FLAGS:=nonshared @@ -28,7 +28,7 @@ define Package/ltq-vdsl-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +atm-esi + DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt endef define Package/ltq-vdsl-app/description @@ -58,9 +58,10 @@ CONFIGURE_ARGS += \ #CONFIGURE_ARGS += --enable-model=debug define Package/ltq-vdsl-app/install - $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin + $(INSTALL_DIR) $(1)/etc/init.d $(1)/sbin $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) ./files/dsl_control $(1)/etc/init.d/ - $(INSTALL_BIN) ./files/vdsl_cpe_control_wrapper $(1)/sbin/ + $(INSTALL_BIN) ./files/10_atm.sh $(1)/etc/hotplug.d/dsl + $(INSTALL_BIN) ./files/10_ptm.sh $(1)/etc/hotplug.d/dsl $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/dsl_cpe_control $(1)/sbin/vdsl_cpe_control $(INSTALL_BIN) ./files/dsl_cpe_pipe.sh $(1)/sbin/ diff --git a/package/network/config/ltq-vdsl-app/files/10_atm.sh b/package/network/config/ltq-vdsl-app/files/10_atm.sh new file mode 100755 index 000000000..e104a14b2 --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/10_atm.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "ATM" ] && \ +! grep -q "ltq_atm_vr9" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer ATM" + +if grep -q "ltq_ptm_vr9" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading ATM driver while EFM/PTM driver is loaded is not possible. Reboot is needed." + exit +fi + +modprobe ltq_atm_vr9 diff --git a/package/network/config/ltq-vdsl-app/files/10_ptm.sh b/package/network/config/ltq-vdsl-app/files/10_ptm.sh new file mode 100755 index 000000000..1c62617bb --- /dev/null +++ b/package/network/config/ltq-vdsl-app/files/10_ptm.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +[ "$DSL_NOTIFICATION_TYPE" = "DSL_STATUS" ] && \ +[ "$DSL_TC_LAYER_STATUS" = "EFM" ] && \ +! grep -q "ltq_ptm_vr9" /proc/modules || exit 0 + +logger -p daemon.notice -t "dsl-notify" "Switching to TC-Layer EFM/PTM" + +if grep -q "ltq_atm_vr9" /proc/modules ; then + logger -p daemon.notice -t "dsl-notify" "Loading EFM/PTM driver while ATM driver is loaded is not possible. Reboot is needed." + exit +fi + +modprobe ltq_ptm_vr9 diff --git a/package/network/config/ltq-vdsl-app/files/dsl_control b/package/network/config/ltq-vdsl-app/files/dsl_control index d7980b411..818990e57 100644 --- a/package/network/config/ltq-vdsl-app/files/dsl_control +++ b/package/network/config/ltq-vdsl-app/files/dsl_control @@ -180,6 +180,7 @@ start_service() { local xtse local xfer_mode local line_mode + local tc_layer local mode local lowlevel local snr @@ -194,37 +195,44 @@ start_service() { eval "xtse=\"\${xtse_xdsl_$annex}\"" - [ -z "${xfer_mode}" ] && xfer_mode=ptm - case "${xfer_mode}" in atm) - LOAD=ltq_atm_vr9 - UNLOAD=ltq_ptm_vr9 - - # in most cases atm is used on top of adsl - [ -z "${line_mode}" ] && line_mode=adsl + tc_layer="-T1:0x1:0x1_1:0x1:0x1" ;; - *) - LOAD=ltq_ptm_vr9 - UNLOAD=ltq_atm_vr9 - - # in most cases ptm is used on top of vdsl - [ -z "${line_mode}" ] && line_mode=vdsl + ptm) + tc_layer="-T2:0x1:0x1_2:0x1:0x1" ;; esac case "${line_mode}" in adsl) - mode=1 + mode="-M1" - # mask out VDSL bits when ATM is requested + # mask out VDSL bits when ADSL is requested xtse="${xtse%_*}_00" ;; - *) - mode=2 + vdsl) + mode="-M2" + + # mask out ADSL bits when VDSL is requested + xtse="00_00_00_00_00_00_00_${xtse##*_}" ;; esac + local annexgpio="/sys/class/gpio/annex" + if [ -d "${annexgpio}a" ] && [ -d "${annexgpio}b" ]; then + case "${annex}" in + a*|l*|m*) + echo 1 > "${annexgpio}a/value" + echo 0 > "${annexgpio}b/value" + ;; + b*|j*) + echo 0 > "${annexgpio}a/value" + echo 1 > "${annexgpio}b/value" + ;; + esac + fi + if [ -z "${firmware}" ]; then # search for the firmware provided by dsl-vrx200-firmware-xdsl-* if grep -qE "system type.*: (VR9|xRX200)" /proc/cpuinfo; then @@ -287,14 +295,14 @@ start_service() { } procd_open_instance - procd_set_param command /sbin/vdsl_cpe_control_wrapper \ + procd_set_param command /sbin/vdsl_cpe_control \ -i$xtse \ -n /sbin/dsl_notify.sh \ -f ${firmware} \ $lowlevel \ - -M ${mode} \ + ${mode} \ + ${tc_layer} \ $autoboot - procd_append_param env "LOAD=$LOAD" "UNLOAD=$UNLOAD" procd_close_instance } diff --git a/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper b/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper deleted file mode 100644 index cc127f777..000000000 --- a/package/network/config/ltq-vdsl-app/files/vdsl_cpe_control_wrapper +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -for mod in $UNLOAD; do - grep -q "$mod " /proc/modules && rmmod "$mod" -done -for mod in $LOAD; do - grep -q "$mod " /proc/modules || insmod "$mod" -done - -esi $(printf '%012X' $((1+0x$(tr -d :
PKG_LICENSE:=GPL-2.0 diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script index e841f9185..00604f40e 100755 --- a/package/network/config/netifd/files/lib/netifd/dhcp.script +++ b/package/network/config/netifd/files/lib/netifd/dhcp.script @@ -18,10 +18,18 @@ setup_interface () { proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}" # TODO: apply $broadcast + local ip_net + eval "$(ipcalc.sh "$ip/$mask")";ip_net="$NETWORK" + + local i for i in $router; do - proto_add_ipv4_route "$i" 32 "" "$ip" + local gw_net + eval "$(ipcalc.sh "$i/$mask")";gw_net="$NETWORK" + + [ "$ip_net" != "$gw_net" ] && proto_add_ipv4_route "$i" 32 "" "$ip" proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip" + local r for r in $CUSTOMROUTES; do proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip" done @@ -31,11 +39,11 @@ setup_interface () { [ -n "$staticroutes" ] && set_classless_routes $staticroutes [ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes - for dns in $dns; do - proto_add_dns_server "$dns" + for i in $dns; do + proto_add_dns_server "$i" done - for domain in $domain; do - proto_add_dns_search "$domain" + for i in $domain; do + proto_add_dns_search "$i" done proto_add_data diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea02d68bb..143e4451b 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -40,6 +40,7 @@ proto_dhcp_setup() { append dhcpopts "-x $opt" done + [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)" [ "$broadcast" = 1 ] && broadcast="-B" || broadcast= [ "$release" = 1 ] && release="-R" || release= [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C" diff --git a/package/network/config/qos-scripts/Makefile b/package/network/config/qos-scripts/Makefile index 1b43ba1d3..07e68835c 100644 --- a/package/network/config/qos-scripts/Makefile +++ b/package/network/config/qos-scripts/Makefile @@ -10,6 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=qos-scripts PKG_VERSION:=1.3.0 PKG_RELEASE:=1 +PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/network/config/vti/Makefile b/package/network/config/vti/Makefile index bda2a9ab1..0a4657c94 100644 --- a/package/network/config/vti/Makefile +++ b/package/network/config/vti/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=vti PKG_VERSION:=1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/config/vti/files/vti.sh b/package/network/config/vti/files/vti.sh index 763fd4ee3..0443800a0 100755 --- a/package/network/config/vti/files/vti.sh +++ b/package/network/config/vti/files/vti.sh @@ -26,7 +26,12 @@ vti_generic_setup() { json_add_string local "$local" json_add_string remote "$remote" [ -n "$tunlink" ] && json_add_string link "$tunlink" - json_add_string info "${ikey:-0},${okey:-0}" + + json_add_object 'data' + [ -n "$ikey" ] && json_add_int ikey "$ikey" + [ -n "$okey" ] && json_add_int okey "$okey" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/config/vxlan/Makefile b/package/network/config/vxlan/Makefile new file mode 100644 index 000000000..a471d4e90 --- /dev/null +++ b/package/network/config/vxlan/Makefile @@ -0,0 +1,32 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=vxlan +PKG_VERSION:=1 +PKG_LICENSE:=GPL-2.0 + +include $(INCLUDE_DIR)/package.mk + +define Package/vxlan + SECTION:=net + CATEGORY:=Network + MAINTAINER:=Matthias Schiffer + TITLE:=Virtual eXtensible LAN config support + DEPENDS:=+kmod-vxlan +endef + +define Package/vxlan/description + Virtual eXtensible LAN config support in /etc/config/network. +endef + +define Build/Compile +endef + +define Build/Configure +endef + +define Package/vxlan/install + $(INSTALL_DIR) $(1)/lib/netifd/proto + $(INSTALL_BIN) ./files/vxlan.sh $(1)/lib/netifd/proto/vxlan.sh +endef + +$(eval $(call BuildPackage,vxlan)) diff --git a/package/network/config/vxlan/files/vxlan.sh b/package/network/config/vxlan/files/vxlan.sh new file mode 100755 index 000000000..27ccd8f12 --- /dev/null +++ b/package/network/config/vxlan/files/vxlan.sh @@ -0,0 +1,148 @@ +#!/bin/sh + +[ -n "$INCLUDE_ONLY" ] || { + . /lib/functions.sh + . /lib/functions/network.sh + . ../netifd-proto.sh + init_proto "$@" +} + +vxlan_generic_setup() { + local cfg="$1" + local mode="$2" + local local="$3" + local remote="$4" + + local link="$cfg" + + local port vid ttl tos mtu macaddr zone + json_get_vars port vid ttl tos mtu macaddr zone + + + proto_init_update "$link" 1 + + proto_add_tunnel + json_add_string mode "$mode" + + [ -n "$tunlink" ] && json_add_string link "$tunlink" + [ -n "$local" ] && json_add_string local "$local" + [ -n "$remote" ] && json_add_string remote "$remote" + + [ -n "$ttl" ] && json_add_int ttl "$ttl" + [ -n "$tos" ] && json_add_string tos "$tos" + [ -n "$mtu" ] && json_add_int mtu "$mtu" + + json_add_object 'data' + [ -n "$port" ] && json_add_int port "$port" + [ -n "$vid" ] && json_add_int id "$vid" + [ -n "$macaddr" ] && json_add_string macaddr "$macaddr" + json_close_object + + proto_close_tunnel + + proto_add_data + [ -n "$zone" ] && json_add_string zone "$zone" + proto_close_data + + proto_send_update "$cfg" +} + +proto_vxlan_setup() { + local cfg="$1" + + local ipaddr peeraddr + json_get_vars ipaddr peeraddr tunlink + + [ -z "$peeraddr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" + proto_block_restart "$cfg" + exit + } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + [ -z "$ipaddr" ] && { + local wanif="$tunlink" + if [ -z "$wanif" ] && ! network_find_wan wanif; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + + if ! network_get_ipaddr ipaddr "$wanif"; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + } + + vxlan_generic_setup "$cfg" 'vxlan' "$ipaddr" "$peeraddr" +} + +proto_vxlan6_setup() { + local cfg="$1" + + local ip6addr peer6addr + json_get_vars ip6addr peer6addr tunlink + + [ -z "$peer6addr" ] && { + proto_notify_error "$cfg" "MISSING_ADDRESS" + proto_block_restart "$cfg" + exit + } + + ( proto_add_host_dependency "$cfg" '' "$tunlink" ) + + [ -z "$ip6addr" ] && { + local wanif="$tunlink" + if [ -z "$wanif" ] && ! network_find_wan6 wanif; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + + if ! network_get_ipaddr6 ip6addr "$wanif"; then + proto_notify_error "$cfg" "NO_WAN_LINK" + exit + fi + } + + vxlan_generic_setup "$cfg" 'vxlan6' "$ip6addr" "$peer6addr" +} + +proto_vxlan_teardown() { + local cfg="$1" +} + +proto_vxlan6_teardown() { + local cfg="$1" +} + +vxlan_generic_init_config() { + no_device=1 + available=1 + + proto_config_add_string "tunlink" + proto_config_add_string "zone" + + proto_config_add_int "vid" + proto_config_add_int "port" + proto_config_add_int "ttl" + proto_config_add_int "tos" + proto_config_add_int "mtu" + proto_config_add_string "macaddr" +} + +proto_vxlan_init_config() { + vxlan_generic_init_config + proto_config_add_string "ipaddr" + proto_config_add_string "peeraddr" +} + +proto_vxlan6_init_config() { + vxlan_generic_init_config + proto_config_add_string "ip6addr" + proto_config_add_string "peer6addr" +} + +[ -n "$INCLUDE_ONLY" ] || { + add_protocol vxlan + add_protocol vxlan6 +} diff --git a/package/network/ipv6/6rd/Makefile b/package/network/ipv6/6rd/Makefile index 899c0f13f..5086fae69 100644 --- a/package/network/ipv6/6rd/Makefile +++ b/package/network/ipv6/6rd/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=6rd PKG_VERSION:=9 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/6rd/files/6rd.sh b/package/network/ipv6/6rd/files/6rd.sh index 62d35b699..8b3441428 100644 --- a/package/network/ipv6/6rd/files/6rd.sh +++ b/package/network/ipv6/6rd/files/6rd.sh @@ -64,9 +64,13 @@ proto_6rd_setup() { json_add_int ttl "${ttl:-64}" [ -n "$tos" ] && json_add_string tos "$tos" json_add_string local "$ipaddr" - json_add_string 6rd-prefix "$ip6prefix/$ip6prefixlen" - json_add_string 6rd-relay-prefix "$ip4prefix/$ip4prefixlen" [ -n "$tunlink" ] && json_add_string link "$tunlink" + + json_add_object 'data' + json_add_string prefix "$ip6prefix/$ip6prefixlen" + json_add_string relay-prefix "$ip4prefix/$ip4prefixlen" + json_close_object + proto_close_tunnel proto_add_data diff --git a/package/network/ipv6/map/Makefile b/package/network/ipv6/map/Makefile index fd8291d68..ce04235f2 100644 --- a/package/network/ipv6/map/Makefile +++ b/package/network/ipv6/map/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=map PKG_VERSION:=4 -PKG_RELEASE:=6 +PKG_RELEASE:=9 PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk diff --git a/package/network/ipv6/map/files/map.sh b/package/network/ipv6/map/files/map.sh index fe872828c..42050183c 100755 --- a/package/network/ipv6/map/files/map.sh +++ b/package/network/ipv6/map/files/map.sh @@ -86,15 +86,19 @@ proto_map_setup() { json_add_string link $(eval "echo \$RULE_${k}_PD6IFACE") if [ "$type" = "map-e" ]; then - json_add_array "fmrs" + json_add_object "data" + json_add_array "fmrs" for i in $(seq $RULE_COUNT); do [ "$(eval "echo \$RULE_${i}_FMR")" != 1 ] && continue - fmr="$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" - fmr="$fmr,$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" - fmr="$fmr,$(eval "echo \$RULE_${i}_EALEN"),$(eval "echo \$RULE_${i}_OFFSET")" - json_add_string "" "$fmr" + json_add_object "" + json_add_string prefix6 "$(eval "echo \$RULE_${i}_IPV6PREFIX")/$(eval "echo \$RULE_${i}_PREFIX6LEN")" + json_add_string prefix4 "$(eval "echo \$RULE_${i}_IPV4PREFIX")/$(eval "echo \$RULE_${i}_PREFIX4LEN")" + json_add_int ealen $(eval "echo \$RULE_${i}_EALEN") + json_add_int offset $(eval "echo \$RULE_${i}_OFFSET") + json_close_object done - json_close_array + json_close_array + json_close_object fi proto_close_tunnel @@ -216,6 +220,7 @@ proto_map_init_config() { proto_config_add_string "ip6prefix" proto_config_add_int "ip6prefixlen" proto_config_add_string "peeraddr" + proto_config_add_int "ealen" proto_config_add_int "psidlen" proto_config_add_int "psid" proto_config_add_int "offset" diff --git a/package/network/ipv6/map/src/mapcalc.c b/package/network/ipv6/map/src/mapcalc.c index 648840d9b..6233bce73 100644 --- a/package/network/ipv6/map/src/mapcalc.c +++ b/package/network/ipv6/map/src/mapcalc.c @@ -118,7 +118,7 @@ static void match_prefix(int *pdlen, struct in6_addr *pd, struct blob_attr *cur, struct blob_attr *d; unsigned drem; - if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, NULL)) + if (!cur || blobmsg_type(cur) != BLOBMSG_TYPE_ARRAY || !blobmsg_check_attr(cur, false)) return; blobmsg_for_each_attr(d, cur, drem) { diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index 8b97e1fb2..24cbe0b2c 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -8,19 +8,22 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcp6c -PKG_RELEASE:=2 +PKG_RELEASE:=4 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=$(LEDE_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2017-01-30 -PKG_SOURCE_VERSION:=c13b6a05dbd9174356cc4b7fd1edf39445efd982 -PKG_MIRROR_HASH:=001e58f1ab6eb8903d9e47060ae037a2e4f021f1fef5032347b767f56f4664f6 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git +PKG_SOURCE_DATE:=2017-09-05 +PKG_SOURCE_VERSION:=51733a6d3bfe0fb9e8c53aea22231e5b8a1f64c3 +PKG_MIRROR_HASH:=fdccfb9a6cb00d6dbf1a3160bd36622ee8e188a9d58bcd282c71a9368972e184 PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk +CMAKE_OPTIONS += \ + -DUSE_LIBUBOX=on + ifneq ($(CONFIG_PACKAGE_odhcp6c_ext_cer_id),0) CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcp6c_ext_cer_id) endif diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.script b/package/network/ipv6/odhcp6c/files/dhcpv6.script index ab0b55675..03efaf721 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.script +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.script @@ -81,6 +81,23 @@ setup_interface () { # RFC 7278 if [ "$mask" -eq 64 -a -z "$PREFIXES" -a -n "$EXTENDPREFIX" ]; then proto_add_ipv6_prefix "$addr/$mask,$preferred,$valid" + + local raroutes="" + for route in $RA_ROUTES; do + local prefix="${route%%/*}" + local entry="${route#*/}" + local pmask="${entry%%,*}" + entry="${entry#*,}" + local gw="${entry%%,*}" + + [ -z "$gw" -a "$mask" = "$pmask" ] && { + case "$addr" in + "${prefix%*::}"*) continue;; + esac + } + raroutes="$raroutes $route" + done + RA_ROUTES="$raroutes" fi done diff --git a/package/network/ipv6/odhcp6c/files/dhcpv6.sh b/package/network/ipv6/odhcp6c/files/dhcpv6.sh index 9e3f66973..56f75521e 100755 --- a/package/network/ipv6/odhcp6c/files/dhcpv6.sh +++ b/package/network/ipv6/odhcp6c/files/dhcpv6.sh @@ -31,14 +31,15 @@ proto_dhcpv6_init_config() { proto_config_add_boolean fakeroutes proto_config_add_boolean sourcefilter proto_config_add_boolean keep_ra_dnslifetime + proto_config_add_int "ra_holdoff" } proto_dhcpv6_setup() { local config="$1" local iface="$2" - local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime - json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime + local reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff + json_get_vars reqaddress reqprefix clientid reqopts noslaaconly forceprefix extendprefix norelease ip6prefix iface_dslite iface_map iface_464xlat ifaceid userclass vendorclass delegate zone_dslite zone_map zone_464xlat zone soltimeout fakeroutes sourcefilter keep_ra_dnslifetime ra_holdoff # Configure @@ -64,6 +65,8 @@ proto_dhcpv6_setup() { [ "$keep_ra_dnslifetime" = "1" ] && append opts "-L" + [ -n "$ra_holdoff" ] && append opts "-m$ra_holdoff" + for opt in $reqopts; do append opts "-r$opt" done diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 1a887beba..79c228aff 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_VERSION:=2.78 -PKG_RELEASE:=4 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/ @@ -17,12 +17,14 @@ PKG_HASH:=89949f438c74b0c7543f06689c319484bd126cc4b1f8c745c742ab397681252b PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:thekelleys:dnsmasq PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ +PKG_CONFIG_DEPENDS:= CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp \ + CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6 \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth \ CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset \ @@ -37,6 +39,7 @@ define Package/dnsmasq/Default CATEGORY:=Base system TITLE:=DNS and DHCP server URL:=http://www.thekelleys.org.uk/dnsmasq/ + DEPENDS:=+libubus USERID:=dnsmasq=453:dnsmasq=453 endef @@ -48,14 +51,14 @@ endef define Package/dnsmasq-dhcpv6 $(call Package/dnsmasq/Default) TITLE += (with DHCPv6 support) - DEPENDS:=@IPV6 + DEPENDS+=@IPV6 VARIANT:=dhcpv6 endef define Package/dnsmasq-full $(call Package/dnsmasq/Default) TITLE += (with DNSSEC, DHCPv6, Auth DNS, IPset, Conntrack, NO_ID enabled by default) - DEPENDS:=+PACKAGE_dnsmasq_full_dnssec:libnettle \ + DEPENDS+=+PACKAGE_dnsmasq_full_dnssec:libnettle \ +PACKAGE_dnsmasq_full_ipset:kmod-ipt-ipset \ +PACKAGE_dnsmasq_full_conntrack:libnetfilter-conntrack VARIANT:=full @@ -74,8 +77,8 @@ endef define Package/dnsmasq-full/description $(call Package/dnsmasq/description) -This is a fully configurable variant with DHCPv6, DNSSEC, Authoritative DNS and -IPset, Conntrack support & NO_ID enabled by default. +This is a fully configurable variant with DHCPv4, DHCPv6, DNSSEC, Authoritative DNS +and IPset, Conntrack support & NO_ID enabled by default. endef define Package/dnsmasq/conffiles @@ -85,9 +88,12 @@ endef define Package/dnsmasq-full/config if PACKAGE_dnsmasq-full + config PACKAGE_dnsmasq_full_dhcp + bool "Build with DHCP support." + default y config PACKAGE_dnsmasq_full_dhcpv6 bool "Build with DHCPv6 support." - depends on IPV6 + depends on IPV6 && PACKAGE_dnsmasq_full_dhcp default n config PACKAGE_dnsmasq_full_dnssec bool "Build with DNSSEC support." @@ -123,7 +129,8 @@ ifeq ($(BUILD_VARIANT),nodhcpv6) endif ifeq ($(BUILD_VARIANT),full) - COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ + COPTS += $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcp),,-DNO_DHCP) \ + $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dhcpv6),,-DNO_DHCP6) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_dnssec),-DHAVE_DNSSEC) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_auth),,-DNO_AUTH) \ $(if $(CONFIG_PACKAGE_dnsmasq_$(BUILD_VARIANT)_ipset),,-DNO_IPSET) \ @@ -150,8 +157,17 @@ define Package/dnsmasq/install $(INSTALL_DATA) ./files/dnsmasq.conf $(1)/etc/dnsmasq.conf $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/dnsmasq.init $(1)/etc/init.d/dnsmasq + $(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp + $(INSTALL_DIR) $(1)/etc/hotplug.d/neigh $(INSTALL_DIR) $(1)/etc/hotplug.d/ntp + $(INSTALL_DIR) $(1)/etc/hotplug.d/tftp $(INSTALL_DATA) ./files/dnsmasqsec.hotplug $(1)/etc/hotplug.d/ntp/25-dnsmasqsec + $(INSTALL_DIR) $(1)/usr/share/dnsmasq + $(INSTALL_DATA) ./files/rfc6761.conf $(1)/usr/share/dnsmasq/ + $(INSTALL_DIR) $(1)/usr/lib/dnsmasq + $(INSTALL_BIN) ./files/dhcp-script.sh $(1)/usr/lib/dnsmasq/dhcp-script.sh + $(INSTALL_DIR) $(1)/usr/share/acl.d + $(INSTALL_DATA) ./files/dnsmasq_acl.json $(1)/usr/share/acl.d/ endef Package/dnsmasq-dhcpv6/install = $(Package/dnsmasq/install) diff --git a/package/network/services/dnsmasq/files/dhcp-script.sh b/package/network/services/dnsmasq/files/dhcp-script.sh new file mode 100755 index 000000000..86032694c --- /dev/null +++ b/package/network/services/dnsmasq/files/dhcp-script.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +[ -f "$USER_DHCPSCRIPT" ] && . "$USER_DHCPSCRIPT" "$@" + +case "$1" in + add) + export ACTION="add" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + del) + export ACTION="remove" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + old) + export ACTION="update" + export MACADDR="$2" + export IPADDR="$3" + export HOSTNAME="$4" + exec /sbin/hotplug-call dhcp + ;; + arp-add) + export ACTION="add" + export MACADDR="$2" + export IPADDR="$3" + exec /sbin/hotplug-call neigh + ;; + arp-del) + export ACTION="remove" + export MACADDR="$2" + export IPADDR="$3" + exec /sbin/hotplug-call neigh + ;; + tftp) + export ACTION="add" + export TFTP_SIZE="$2" + export TFTP_ADDR="$3" + export TFTP_PATH="$4" + exec /sbin/hotplug-call tftp + ;; +esac diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index 362b90a29..360c7d79e 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -15,7 +15,7 @@ config dnsmasq option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' - #option nonwildcard 1 + option nonwildcard 1 # bind to & keep track of interfaces #list interface br-lan #list notinterface lo #list bogusnxdomain '64.94.110.11' diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 34c35c2dc..dcc18e34d 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -8,13 +8,18 @@ PROG=/usr/sbin/dnsmasq ADD_LOCAL_DOMAIN=1 ADD_LOCAL_HOSTNAME=1 +ADD_WAN_FQDN=0 +ADD_LOCAL_FQDN="" BASECONFIGFILE="/var/etc/dnsmasq.conf" BASEHOSTFILE="/tmp/hosts/dhcp" -BASETIMESTAMPFILE="/etc/dnsmasq.time" TRUSTANCHORSFILE="/usr/share/dnsmasq/trust-anchors.conf" TIMEVALIDFILE="/var/state/dnsmasqsec" BASEDHCPSTAMPFILE="/var/run/dnsmasq" +RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" +DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" + +DNSMASQ_DHCP_VER=4 xappend() { local value="$1" @@ -83,12 +88,24 @@ log_once() { logger -t dnsmasq "$@" } +has_handler() { + local file + + for file in /etc/hotplug.d/dhcp/* /etc/hotplug.d/tftp/* /etc/hotplug.d/neigh/*; do + [ -f "$file" ] && return 0 + done + + return 1 +} + append_bool() { local section="$1" local option="$2" local value="$3" + local default="$4" local _loctmp - config_get_bool _loctmp "$section" "$option" 0 + [ -z "$default" ] && default="0" + config_get_bool _loctmp "$section" "$option" "$default" [ $_loctmp -gt 0 ] && xappend "$value" } @@ -107,6 +124,10 @@ append_server() { xappend "--server=$1" } +append_rev_server() { + xappend "--rev-server=$1" +} + append_address() { xappend "--address=$1" } @@ -120,6 +141,10 @@ append_interface() { xappend "--interface=$ifname" } +append_listenaddress() { + xappend "--listen-address=$1" +} + append_notinterface() { network_get_device ifname "$1" || ifname="$1" xappend "--except-interface=$ifname" @@ -137,6 +162,10 @@ append_pxe_service() { xappend "--pxe-service=$1" } +append_interface_name() { + xappend "--interface-name=$1,$2" +} + filter_dnsmasq() { local cfg="$1" func="$2" match_cfg="$3" found_cfg @@ -180,6 +209,7 @@ dhcp_remoteid_add() { } dhcp_circuitid_add() { + # TODO: DHCPV6 does not have circuitid; catch "option6:" local cfg="$1" config_get networkid "$cfg" networkid @@ -212,6 +242,7 @@ dhcp_userclass_add() { } dhcp_vendorclass_add() { + # TODO: DHCPV6 vendor class has stricter definitions; catch? fixup? local cfg="$1" config_get networkid "$cfg" networkid @@ -245,6 +276,7 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" + local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -256,44 +288,113 @@ dhcp_host_add() { config_get name "$cfg" name config_get ip "$cfg" ip - [ -n "$ip" -o -n "$name" ] || return 0 + config_get hostid "$cfg" hostid + + [ -n "$ip" -o -n "$name" -o -n "$hostid" ] || return 0 config_get_bool dns "$cfg" dns 0 [ "$dns" = "1" -a -n "$ip" -a -n "$name" ] && { - echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE + echo "$ip $name${DOMAIN:+.$DOMAIN}" >> $HOSTFILE_TMP } config_get mac "$cfg" mac + config_get duid "$cfg" duid + config_get tag "$cfg" tag + if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap - macs="" + # many MAC are possible to track a laptop ON/OFF dock for m in $mac; do append macs "$m" ","; done - else - # --dhcp-host=lap,192.168.0.199 + fi + + if [ $DNSMASQ_DHCP_VER -eq 6 -a -n "$duid" ]; then + # --dhcp-host=id:00:03:00:01:12:00:00:01:02:03,[::beef],lap + # one (virtual) machine gets one DUID per RFC3315 + duids="id:${duid// */}" + fi + + if [ -z "$macs" -a -z "$duids" ]; then + # --dhcp-host=lap,192.168.0.199,[::beef] [ -n "$name" ] || return 0 macs="$name" name="" fi - config_get tag "$cfg" tag + if [ -n "$hostid" ]; then + hex_to_hostid hostid "$hostid" + fi - if [ "$DHCPv6CAPABLE" -eq 1 ]; then - config_get duid "$cfg" duid - config_get hostid "$cfg" hostid - if [ -n "$hostid" ]; then - hex_to_hostid hostid "$hostid" - fi + if [ -n "$tag" ]; then + for t in $tag; do append tags "$t" ",set:"; done fi config_get_bool broadcast "$cfg" broadcast 0 - [ "$broadcast" = "0" ] && broadcast= - config_get leasetime "$cfg" leasetime - xappend "--dhcp-host=$macs${duid:+,id:$duid}${networkid:+,net:$networkid}${broadcast:+,set:needs-broadcast}${tag:+,set:$tag}${ip:+,$ip${hostid:+,[::$hostid]}}${name:+,$name}${leasetime:+,$leasetime}" + [ "$broadcast" = "0" ] && broadcast= || broadcast=",set:needs-broadcast" + + hosttag="${networkid:+,set:${networkid}}${tags:+,set:${tags}}$broadcast" + nametime="${name:+,$name}${leasetime:+,$leasetime}" + + if [ $DNSMASQ_DHCP_VER -eq 6 ]; then + addrs="${ip:+,$ip}${hostid:+,[::$hostid]}" + xappend "--dhcp-host=$macs${duids:+,$duids}$hosttag$addrs$nametime" + else + xappend "--dhcp-host=$macs$hosttag${ip:+,$ip}$nametime" + fi +} + +dhcp_this_host_add() { + local net="$1" + local ifname="$2" + local mode="$3" + local routerstub routername ifdashname + local lanaddr lanaddr6 lanaddrs6 ulaprefix + + if [ "$mode" -gt 0 ] ; then + ifdashname="${ifname//./-}" + routerstub="$( md5sum /etc/os-release )" + routerstub="router-${routerstub// */}" + routername="$( uci_get system @system[0] hostname $routerstub )" + + if [ "$mode" -gt 1 ] ; then + if [ "$mode" -gt 2 ] ; then + if [ "$mode" -gt 3 ] ; then + append_interface_name "$ifdashname.$routername.$DOMAIN" "$ifname" + fi + + append_interface_name "$routername.$DOMAIN" "$ifname" + fi + + # All IP addresses discovered by dnsmasq will be labeled (except fe80::) + append_interface_name "$routername" "$ifname" + + else + # This uses a static host file entry for only limited addresses. + # Use dnsmasq option "--expandhosts" to enable FQDN on host files. + ulaprefix="$(uci_get network @globals[0] ula_prefix)" + network_get_ipaddr lanaddr "$net" + network_get_ipaddrs6 lanaddrs6 "$net" + + if [ -n "$lanaddr" ] ; then + dhcp_domain_add "" "$routername" "$lanaddr" + fi + + if [ -n "$ulaprefix" -a -n "$lanaddrs6" ] ; then + for lanaddr6 in $lanaddrs6 ; do + case "$lanaddr6" in + "${ulaprefix%%:/*}"*) + dhcp_domain_add "" "$routername" "$lanaddr6" + ;; + esac + done + fi + fi + fi } dhcp_tag_add() { + # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" tag="$cfg" @@ -324,6 +425,7 @@ dhcp_mac_add() { } dhcp_boot_add() { + # TODO: BOOTURL is different between DHCPv4 and DHCPv6 local cfg="$1" config_get networkid "$cfg" networkid @@ -346,24 +448,30 @@ dhcp_boot_add() { dhcp_add() { local cfg="$1" + local dhcp6range="::" + local nettag + local tags + config_get net "$cfg" interface [ -n "$net" ] || return 0 - config_get dhcpv4 "$cfg" dhcpv4 - [ "$dhcpv4" != "disabled" ] || return 0 - config_get networkid "$cfg" networkid [ -n "$networkid" ] || networkid="$net" - network_get_subnet subnet "$net" || return 0 network_get_device ifname "$net" || return 0 - network_get_protocol proto "$net" || return 0 [ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && { DNS_SERVERS="$DNS_SERVERS $dnsserver" } - append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && return 0 + append_bool "$cfg" ignore "--no-dhcp-interface=$ifname" && { + # Many ISP do not have useful names for DHCP customers (your WAN). + dhcp_this_host_add "$net" "$ifname" "$ADD_WAN_FQDN" + return 0 + } + + network_get_subnet subnet "$net" || return 0 + network_get_protocol proto "$net" || return 0 # Do not support non-static interfaces for now [ static = "$proto" ] || return 0 @@ -375,21 +483,107 @@ dhcp_add() { config_get_bool force "$cfg" force 0 [ $force -gt 0 ] || dhcp_check "$ifname" || return 0 - config_get start "$cfg" start - config_get limit "$cfg" limit - config_get leasetime "$cfg" leasetime + config_get start "$cfg" start 100 + config_get limit "$cfg" limit 150 + config_get leasetime "$cfg" leasetime 12h config_get options "$cfg" options config_get_bool dynamicdhcp "$cfg" dynamicdhcp 1 - leasetime="${leasetime:-12h}" - start="$(dhcp_calc "${start:-100}")" - limit="${limit:-150}" - [ "$limit" -gt 0 ] && limit=$((limit-1)) - eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" - if [ "$dynamicdhcp" = "0" ]; then END="static"; fi - xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}" + config_get dhcpv4 "$cfg" dhcpv4 + config_get dhcpv6 "$cfg" dhcpv6 - dhcp_option_add "$cfg" "$networkid" + config_get ra "$cfg" ra + config_get ra_management "$cfg" ra_management + config_get ra_preference "$cfg" ra_preference + config_get dns "$cfg" dns + + config_list_foreach "$cfg" "interface_name" append_interface_name "$ifname" + + # Put the router host name on this DHCP served interface address(es) + dhcp_this_host_add "$net" "$ifname" "$ADD_LOCAL_FQDN" + + start="$( dhcp_calc "$start" )" + + add_tag() { + tags="${tags}tag:$1," + } + config_list_foreach "$cfg" tag add_tag + + nettag="${networkid:+set:${networkid},}" + + if [ "$limit" -gt 0 ] ; then + limit=$((limit-1)) + fi + + eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)" + + if [ "$dynamicdhcp" = "0" ] ; then + END="static" + dhcp6range="::,static" + else + dhcp6range="::1000,::ffff" + fi + + + if [ "$dhcpv4" != "disabled" ] ; then + xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}" + fi + + + if [ $DNSMASQ_DHCP_VER -eq 6 -a "$ra" = "server" ] ; then + # Note: dnsmasq cannot just be a DHCPv6 server (all-in-1) + # and let some other machine(s) send RA pointing to it. + + case $ra_preference in + *high*) + xappend "--ra-param=$ifname,high,0,7200" + ;; + *low*) + xappend "--ra-param=$ifname,low,0,7200" + ;; + *) + # Send UNSOLICITED RA at default interval and live for 2 hours. + # TODO: convert flexible lease time into route life time (only seconds). + xappend "--ra-param=$ifname,0,7200" + ;; + esac + + if [ "$dhcpv6" = "disabled" ] ; then + ra_management="3" + fi + + + case $ra_management in + 0) + # SLACC with DCHP for extended options + xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-stateless,ra-names" + ;; + 2) + # DHCP address and RA only for management redirection + xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,$leasetime" + ;; + 3) + # SLAAC only but dnsmasq attempts to link HOSTNAME, DHCPv4 MAC, and SLAAC + xappend "--dhcp-range=$nettag::,constructor:$ifname,ra-only,ra-names" + ;; + *) + # SLAAC and full DHCP + xappend "--dhcp-range=$nettag$dhcp6range,constructor:$ifname,slaac,ra-names,$leasetime" + ;; + esac + + if [ -n "$dns" ]; then + dnss="" + for d in $dns; do append dnss "[$d]" ","; done + else + dnss="[::]" + fi + + dhcp_option_append "option6:dns-server,$dnss" "$networkid" + fi + + dhcp_option_add "$cfg" "$networkid" 0 + dhcp_option_add "$cfg" "$networkid" 2 } dhcp_option_append() { @@ -401,21 +595,24 @@ dhcp_option_append() { } dhcp_option_add() { + # NOTE: dnsmasq has explicit "option6:" prefix for DHCPv6 so no collisions local cfg="$1" local networkid="$2" local force="$3" + local opt="dhcp_option" [ "$force" = "0" ] && force= + [ "$force" = "2" ] && opt="dhcp_option_force" local list_len - config_get list_len "$cfg" dhcp_option_LENGTH + config_get list_len "$cfg" "${opt}_LENGTH" if [ -n "$list_len" ]; then - config_list_foreach "$cfg" dhcp_option dhcp_option_append "$networkid" "$force" + config_list_foreach "$cfg" "$opt" dhcp_option_append "$networkid" "$force" else - config_get dhcp_option "$cfg" dhcp_option + config_get dhcp_option "$cfg" "$opt" - [ -n "$dhcp_option" ] && echo "Warning: the 'option dhcp_option' syntax is deprecated, use 'list dhcp_option'" >&2 + [ -n "$dhcp_option" ] && echo "Warning: the 'option $opt' syntax is deprecated, use 'list $opt'" >&2 local option for option in $dhcp_option; do @@ -438,7 +635,7 @@ dhcp_domain_add() { record="${record:+$record }$name" done - echo "$ip $record" >> $HOSTFILE + echo "$ip $record" >> $HOSTFILE_TMP } dhcp_srv_add() { @@ -533,7 +730,7 @@ dhcp_relay_add() { dnsmasq_start() { - local cfg="$1" disabled + local cfg="$1" disabled resolvfile user_dhcpscript config_get_bool disabled "$cfg" disabled 0 [ "$disabled" -gt 0 ] && return 0 @@ -544,7 +741,7 @@ dnsmasq_start() CONFIGFILE="${BASECONFIGFILE}.${cfg}" CONFIGFILE_TMP="${CONFIGFILE}.$$" HOSTFILE="${BASEHOSTFILE}.${cfg}" - TIMESTAMPFILE="${BASETIMESTAMPFILE}.${cfg}" + HOSTFILE_TMP="${HOSTFILE}.$$" BASEDHCPSTAMPFILE_CFG="${BASEDHCPSTAMPFILE}.${cfg}" # before we can call xappend @@ -554,10 +751,8 @@ dnsmasq_start() mkdir -p /var/lib/misc chown dnsmasq:dnsmasq /var/run/dnsmasq - [ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE" - echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE_TMP - echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE + echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE_TMP local dnsmasqconffile="/etc/dnsmasq.${cfg}.conf" if [ ! -r "$dnsmasqconffile" ]; then @@ -571,6 +766,41 @@ dnsmasq_start() $PROG --version | grep -osqE "^Compile time options:.* DHCPv6( |$)" && DHCPv6CAPABLE=1 || DHCPv6CAPABLE=0 + + if [ -x /usr/sbin/odhcpd -a -x /etc/init.d/odhcpd ] ; then + local odhcpd_is_main odhcpd_is_enabled + config_get odhcpd_is_main odhcpd maindhcp 0 + /etc/init.d/odhcpd enabled && odhcpd_is_enabled=1 || odhcpd_is_enabled=0 + + + if [ "$odhcpd_is_enabled" -eq 0 -a "$DHCPv6CAPABLE" -eq 1 ] ; then + # DHCP V4 and V6 in DNSMASQ + DNSMASQ_DHCP_VER=6 + elif [ "$odhcpd_is_main" -gt 0 ] ; then + # ODHCPD is doing it all + DNSMASQ_DHCP_VER=0 + else + # You have ODHCPD but use DNSMASQ for DHCPV4 + DNSMASQ_DHCP_VER=4 + fi + + elif [ "$DHCPv6CAPABLE" -eq 1 ] ; then + # DHCP V4 and V6 in DNSMASQ + DNSMASQ_DHCP_VER=6 + else + DNSMASQ_DHCP_VER=4 + fi + + # Allow DHCP/DHCPv6 to be handled by ISC DHCPD + if [ -x /usr/sbin/dhcpd ] ; then + if [ -x /etc/init.d/dhcpd ] ; then + /etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0 + fi + if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then + /etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4 + fi + fi + append_bool "$cfg" authoritative "--dhcp-authoritative" append_bool "$cfg" nodaemon "--no-daemon" append_bool "$cfg" domainneeded "--domain-needed" @@ -583,12 +813,11 @@ dnsmasq_start() append_bool "$cfg" localise_queries "--localise-queries" append_bool "$cfg" readethers "--read-ethers" append_bool "$cfg" dbus "--enable-dbus" - append_bool "$cfg" boguspriv "--bogus-priv" append_bool "$cfg" expandhosts "--expand-hosts" config_get tftp_root "$cfg" "tftp_root" [ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp" append_bool "$cfg" tftp_no_fail "--tftp-no-fail" - append_bool "$cfg" nonwildcard "--bind-dynamic" + append_bool "$cfg" nonwildcard "--bind-dynamic" 1 append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" append_bool "$cfg" localservice "--local-service" @@ -599,7 +828,7 @@ dnsmasq_start() append_bool "$cfg" noping "--no-ping" append_parm "$cfg" logfacility "--log-facility" - append_parm "$cfg" dhcpscript "--dhcp-script" + append_parm "$cfg" cachesize "--cache-size" append_parm "$cfg" dnsforwardmax "--dns-forward-max" append_parm "$cfg" port "--port" @@ -610,7 +839,9 @@ dnsmasq_start() append_parm "$cfg" "maxport" "--max-port" append_parm "$cfg" "domain" "--domain" append_parm "$cfg" "local" "--server" + config_list_foreach "$cfg" "listen_address" append_listenaddress config_list_foreach "$cfg" "server" append_server + config_list_foreach "$cfg" "rev_server" append_rev_server config_list_foreach "$cfg" "address" append_address config_list_foreach "$cfg" "ipset" append_ipset config_list_foreach "$cfg" "interface" append_interface @@ -618,7 +849,6 @@ dnsmasq_start() config_list_foreach "$cfg" "addnhosts" append_addnhosts config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases" - append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto" append_parm "$cfg" "serversfile" "--servers-file" append_parm "$cfg" "tftp_root" "--tftp-root" append_parm "$cfg" "dhcp_boot" "--dhcp-boot" @@ -629,12 +859,21 @@ dnsmasq_start() config_get_bool ADD_LOCAL_DOMAIN "$cfg" add_local_domain 1 config_get_bool ADD_LOCAL_HOSTNAME "$cfg" add_local_hostname 1 + config_get ADD_LOCAL_FQDN "$cfg" add_local_fqdn "" + config_get ADD_WAN_FQDN "$cfg" add_wan_fqdn 0 + + if [ -z "$ADD_LOCAL_FQDN" ] ; then + # maintain support for previous UCI + ADD_LOCAL_FQDN="$ADD_LOCAL_HOSTNAME" + fi config_get_bool readethers "$cfg" readethers [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers - config_get resolvfile $cfg resolvfile - config_get dhcpscript $cfg dhcpscript + config_get user_dhcpscript $cfg dhcpscript + if has_handler || [ -n "$user_dhcpscript" ]; then + xappend "--dhcp-script=$DHCPSCRIPT" + fi config_get leasefile $cfg leasefile "/tmp/dhcp.leases" [ -n "$leasefile" -a \! -e "$leasefile" ] && touch "$leasefile" @@ -647,6 +886,8 @@ dnsmasq_start() [ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile" fi + [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile" + config_get hostsfile "$cfg" dhcphostsfile [ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile" @@ -693,6 +934,7 @@ dnsmasq_start() } dhcp_option_add "$cfg" "" 0 + dhcp_option_add "$cfg" "" 2 xappend "--dhcp-broadcast=tag:needs-broadcast" @@ -726,43 +968,38 @@ dnsmasq_start() config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg" config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg" - # add own hostname - [ $ADD_LOCAL_HOSTNAME -eq 1 ] && { - local lanaddr lanaddr6 - local ulaprefix="$(uci_get network @globals[0] ula_prefix)" - local hostname="$(uci_get system @system[0] hostname Lede)" - - network_get_ipaddr lanaddr "lan" && { - dhcp_domain_add "" "$hostname" "$lanaddr" - } - - [ -n "$ulaprefix" ] && network_get_ipaddrs6 lanaddr6 "lan" && { - for lanaddr6 in $lanaddr6; do - case "$lanaddr6" in - "${ulaprefix%%:/*}"*) - dhcp_domain_add "" "$hostname" "$lanaddr6" - ;; - esac - done - } - } - echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg" config_foreach filter_dnsmasq mxhost dhcp_mx_add "$cfg" echo >> $CONFIGFILE_TMP - config_get odhcpd_is_active odhcpd maindhcp - if [ "$odhcpd_is_active" != "1" ]; then + config_get_bool boguspriv "$cfg" boguspriv 1 + [ "$boguspriv" -gt 0 ] && { + xappend "--bogus-priv" + [ -r "$RFC6761FILE" ] && xappend "--conf-file=$RFC6761FILE" + } + + if [ "$DNSMASQ_DHCP_VER" -gt 4 ] ; then + # Enable RA feature for when/if it is constructed, + # and RA is selected per interface pool (RA, DHCP, or both), + # but no one (should) want RA broadcast in syslog + config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" + xappend "--enable-ra" + xappend "--quiet-ra" + append_bool "$cfg" quietdhcp "--quiet-dhcp6" + + elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then config_foreach filter_dnsmasq dhcp dhcp_add "$cfg" fi + echo >> $CONFIGFILE_TMP config_foreach filter_dnsmasq cname dhcp_cname_add "$cfg" echo >> $CONFIGFILE_TMP echo >> $CONFIGFILE_TMP mv -f $CONFIGFILE_TMP $CONFIGFILE + mv -f $HOSTFILE_TMP $HOSTFILE [ "$resolvfile" = "/tmp/resolv.conf.auto" ] && { rm -f /tmp/resolv.conf @@ -778,10 +1015,11 @@ dnsmasq_start() procd_open_instance $cfg procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq."${cfg}".pid procd_set_param file $CONFIGFILE + [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn procd_add_jail dnsmasq ubus log - procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $dhcpscript /etc/hosts /etc/ethers $EXTRA_MOUNT + procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE $RFC6761FILE /etc/passwd /etc/group /etc/TZ /dev/null /dev/urandom $dnsmasqconffile $dnsmasqconfdir $resolvfile $user_dhcpscript /etc/hosts /etc/ethers /sbin/hotplug-call $EXTRA_MOUNT $DHCPSCRIPT procd_add_jail_mount_rw /var/run/dnsmasq/ $leasefile procd_close_instance @@ -806,7 +1044,7 @@ dnsmasq_stop() service_triggers() { - procd_add_reload_trigger "dhcp" + procd_add_reload_trigger "dhcp" "system" procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload } @@ -846,7 +1084,7 @@ start_service() { reload_service() { rc_procd start_service "$@" - return 0 + procd_send_signal dnsmasq "$@" } stop_service() { diff --git a/package/network/services/dnsmasq/files/dnsmasq_acl.json b/package/network/services/dnsmasq/files/dnsmasq_acl.json new file mode 100644 index 000000000..00ec7d0f0 --- /dev/null +++ b/package/network/services/dnsmasq/files/dnsmasq_acl.json @@ -0,0 +1,4 @@ +{ + "user": "dnsmasq", + "publish": [ "dnsmasq" ] +} diff --git a/package/network/services/dnsmasq/files/rfc6761.conf b/package/network/services/dnsmasq/files/rfc6761.conf new file mode 100644 index 000000000..ebc1a1211 --- /dev/null +++ b/package/network/services/dnsmasq/files/rfc6761.conf @@ -0,0 +1,15 @@ +# RFC6761 included configuration file for dnsmasq +# +# includes a list of domains that should not be forwarded to Internet name servers +# to reduce burden on them, asking questions that they won't know the answer to. + +server=/bind/ +server=/example/ +server=/example.com/ +server=/example.org/ +server=/example.net/ +server=/invalid/ +server=/local/ +server=/localhost/ +server=/onion/ +server=/test/ diff --git a/package/network/services/dnsmasq/patches/240-ubus.patch b/package/network/services/dnsmasq/patches/240-ubus.patch new file mode 100644 index 000000000..d21ca0dba --- /dev/null +++ b/package/network/services/dnsmasq/patches/240-ubus.patch @@ -0,0 +1,128 @@ +--- a/src/dnsmasq.c ++++ b/src/dnsmasq.c +@@ -19,6 +19,8 @@ + + #include "dnsmasq.h" + ++#include ++ + struct daemon *daemon; + + static volatile pid_t pid = 0; +@@ -32,6 +34,64 @@ static void fatal_event(struct event_des + static int read_event(int fd, struct event_desc *evp, char **msg); + static void poll_resolv(int force, int do_reload, time_t now); + ++static struct ubus_context *ubus; ++static struct blob_buf b; ++ ++static struct ubus_object_type ubus_object_type = { ++ .name = "dnsmasq", ++}; ++ ++static struct ubus_object ubus_object = { ++ .name = "dnsmasq", ++ .type = &ubus_object_type, ++}; ++ ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface) ++{ ++ if (!ubus || !ubus_object.has_subscribers) ++ return; ++ ++ blob_buf_init(&b, 0); ++ if (mac) ++ blobmsg_add_string(&b, "mac", mac); ++ if (ip) ++ blobmsg_add_string(&b, "ip", ip); ++ if (name) ++ blobmsg_add_string(&b, "name", name); ++ if (interface) ++ blobmsg_add_string(&b, "interface", interface); ++ ubus_notify(ubus, &ubus_object, type, b.head, -1); ++} ++ ++static void set_ubus_listeners(void) ++{ ++ if (!ubus) ++ return; ++ ++ poll_listen(ubus->sock.fd, POLLIN); ++ poll_listen(ubus->sock.fd, POLLERR); ++ poll_listen(ubus->sock.fd, POLLHUP); ++} ++ ++static void check_ubus_listeners() ++{ ++ if (!ubus) { ++ ubus = ubus_connect(NULL); ++ if (ubus) ++ ubus_add_object(ubus, &ubus_object); ++ else ++ return; ++ } ++ ++ if (poll_check(ubus->sock.fd, POLLIN)) ++ ubus_handle_event(ubus); ++ ++ if (poll_check(ubus->sock.fd, POLLHUP)) { ++ ubus_free(ubus); ++ ubus = NULL; ++ } ++} ++ + int main (int argc, char **argv) + { + int bind_fallback = 0; +@@ -911,6 +971,7 @@ int main (int argc, char **argv) + set_dbus_listeners(); + #endif + ++ set_ubus_listeners(); + #ifdef HAVE_DHCP + if (daemon->dhcp || daemon->relay4) + { +@@ -1041,6 +1102,8 @@ int main (int argc, char **argv) + check_dbus_listeners(); + #endif + ++ check_ubus_listeners(); ++ + check_dns_listeners(now); + + #ifdef HAVE_TFTP +--- a/Makefile ++++ b/Makefile +@@ -85,7 +85,7 @@ all : $(BUILDDIR) + @cd $(BUILDDIR) && $(MAKE) \ + top="$(top)" \ + build_cflags="$(version) $(dbus_cflags) $(idn2_cflags) $(idn_cflags) $(ct_cflags) $(lua_cflags) $(nettle_cflags)" \ +- build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs)" \ ++ build_libs="$(dbus_libs) $(idn2_libs) $(idn_libs) $(ct_libs) $(lua_libs) $(sunos_libs) $(nettle_libs) $(gmp_libs) -lubox -lubus" \ + -f $(top)/Makefile dnsmasq + + mostly_clean : +--- a/src/dnsmasq.h ++++ b/src/dnsmasq.h +@@ -1397,6 +1397,8 @@ void emit_dbus_signal(int action, struct + # endif + #endif + ++void ubus_event_bcast(const char *type, const char *mac, const char *ip, const char *name, const char *interface); ++ + /* ipset.c */ + #ifdef HAVE_IPSET + void ipset_init(void); +--- a/src/rfc2131.c ++++ b/src/rfc2131.c +@@ -1621,6 +1621,10 @@ static void log_packet(char *type, void + daemon->namebuff, + string ? string : "", + err ? err : ""); ++ if (!strcmp(type, "DHCPACK")) ++ ubus_event_bcast("dhcp.ack", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); ++ else if (!strcmp(type, "DHCPRELEASE")) ++ ubus_event_bcast("dhcp.release", daemon->namebuff, addr ? inet_ntoa(a) : NULL, string ? string : NULL, interface); + } + + static void log_options(unsigned char *start, u32 xid) diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile index 2db2f81a4..21ac09f72 100644 --- a/package/network/services/dropbear/Makefile +++ b/package/network/services/dropbear/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dropbear PKG_VERSION:=2017.75 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:= \ @@ -19,6 +19,7 @@ PKG_HASH:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE libtomcrypt/LICENSE libtommath/LICENSE +PKG_CPE_ID:=cpe:/a:matt_johnston:dropbear_ssh_server PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 diff --git a/package/network/services/dropbear/patches/120-openwrt_options.patch b/package/network/services/dropbear/patches/120-openwrt_options.patch index b49a95ce9..7f47a7430 100644 --- a/package/network/services/dropbear/patches/120-openwrt_options.patch +++ b/package/network/services/dropbear/patches/120-openwrt_options.patch @@ -39,7 +39,7 @@ /* Enable "Counter Mode" for ciphers. This is more secure than normal * CBC mode against certain attacks. It is recommended for security -@@ -131,9 +131,9 @@ If you test it please contact the Dropbe +@@ -131,10 +131,10 @@ If you test it please contact the Dropbe * If you disable MD5, Dropbear will fall back to SHA1 fingerprints, * which are not the standard form. */ #define DROPBEAR_SHA1_HMAC @@ -47,10 +47,12 @@ +/*#define DROPBEAR_SHA1_96_HMAC*/ #define DROPBEAR_SHA2_256_HMAC -#define DROPBEAR_SHA2_512_HMAC +-#define DROPBEAR_MD5_HMAC +/*#define DROPBEAR_SHA2_512_HMAC*/ - #define DROPBEAR_MD5_HMAC ++/*#define DROPBEAR_MD5_HMAC*/ /* You can also disable integrity. Don't bother disabling this if you're + * still using a cipher, it's relatively cheap. If you disable this it's dead @@ -146,7 +146,7 @@ If you test it please contact the Dropbe * Removing either of these won't save very much space. * SSH2 RFC Draft requires dss, recommends rsa */ diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index c9de3c05b..51f169293 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,16 +7,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=7 +PKG_RELEASE:=6 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2016-12-19 -PKG_SOURCE_VERSION:=ad02e79d12fd70ed6bd5fbaf64001a2851e5bb7b -PKG_MIRROR_HASH:=7a0983f004b156d46911765c113754a4c00f56fb889430620bbd061b3b1fcf33 +PKG_SOURCE_DATE:=2017-08-24 +PKG_SOURCE_VERSION:=c2d4f2eb5dba0b5c5a8c5805823084da958a9b52 +PKG_MIRROR_HASH:=c6ad9a73fc1ae0ba8bc48f71cf14394b274bc9c2c1d1b53c2775f08312597e74 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:w1.fi:hostapd PKG_BUILD_PARALLEL:=1 @@ -299,6 +300,7 @@ define Build/Compile/wpad $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \ sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \ ` > $(PKG_BUILD_DIR)/.cflags + sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags +$(call Build/RunMake,hostapd, \ CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \ MULTICALL=1 \ diff --git a/package/network/services/hostapd/files/hostapd-full.config b/package/network/services/hostapd/files/hostapd-full.config index 4a2e87c2e..fe627676d 100644 --- a/package/network/services/hostapd/files/hostapd-full.config +++ b/package/network/services/hostapd/files/hostapd-full.config @@ -15,22 +15,31 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y -# Driver interface for Prism54 driver -#CONFIG_DRIVER_PRISM54=y - # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be -# shipped with your distribution yet. If that is the case, you need to build -# newer libnl version and point the hostapd build to use it. -#LIBNL=/usr/src/libnl -#CFLAGS += -I$(LIBNL)/include -#LIBS += -L$(LIBNL)/lib + +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib +#LIBS_p += -L/usr/local/lib +#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y @@ -45,16 +54,14 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server CONFIG_EAP=y -# EAP-FAST for the integrated EAP server -CONFIG_EAP_FAST=y +# EAP Re-authentication Protocol (ERP) in integrated EAP server +#CONFIG_ERP=y # EAP-MD5 for the integrated EAP server CONFIG_EAP_MD5=y @@ -90,6 +97,9 @@ CONFIG_EAP_TTLS=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd for the integrated EAP server (secure authentication with a password) +#CONFIG_EAP_PWD=y + # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -99,17 +109,17 @@ CONFIG_EAP_TTLS=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y -CONFIG_WPS2=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -117,6 +127,9 @@ CONFIG_WPS2=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y +# EAP-EKE for the integrated EAP server +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -132,23 +145,43 @@ CONFIG_IPV6=y CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y +# IEEE 802.11ax HE support +# Note: This is experimental and work in progress. The definitions are still +# subject to change and this should not be expected to interoperate with the +# final IEEE 802.11ax version. +#CONFIG_IEEE80211AX=y + # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Add support for writing debug log to a file: -f /tmp/hostapd.log +# Disabled by default. +#CONFIG_DEBUG_FILE=y + # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + # Remove support for RADIUS accounting #CONFIG_NO_ACCOUNTING=y @@ -158,15 +191,190 @@ CONFIG_DEBUG_SYSLOG=y # Remove support for VLANs #CONFIG_NO_VLAN=y -CONFIG_TLS=internal -CONFIG_INTERNAL_LIBTOMMATH=y -CONFIG_INTERNAL_AES=y -NEED_AES_DEC=y - -CONFIG_NO_RANDOM_POOL=y -CONFIG_NO_DUMP_STATE=y - -CONFIG_WPS=y +# Enable support for fully dynamic VLANs. This enables hostapd to +# automatically create bridge and VLAN interfaces if necessary. CONFIG_FULL_DYNAMIC_VLAN=y +# Use netlink-based kernel API for VLAN operations instead of ioctl() +# Note: This requires libnl 3.1 or newer. +#CONFIG_VLAN_NETLINK=y + +# Remove support for dumping internal state through control interface commands +# This can be used to reduce binary size at the cost of disabling a debugging +# option. +CONFIG_NO_DUMP_STATE=y + +# Enable tracing code for developer debugging +# This tracks use of memory allocations and other registrations and reports +# incorrect use with a backtrace of call (or allocation) location. +#CONFIG_WPA_TRACE=y +# For BSD, comment out these. +#LIBS += -lexecinfo +#LIBS_p += -lexecinfo +#LIBS_c += -lexecinfo + +# Use libbfd to get more details for developer debugging +# This enables use of libbfd to get more detailed symbols for the backtraces +# generated by CONFIG_WPA_TRACE=y. +#CONFIG_WPA_TRACE_BFD=y +# For BSD, comment out these. +#LIBS += -lbfd -liberty -lz +#LIBS_p += -lbfd -liberty -lz +#LIBS_c += -lbfd -liberty -lz + +# hostapd depends on strong random number generation being available from the +# operating system. os_get_random() function is used to fetch random data when +# needed, e.g., for key generation. On Linux and BSD systems, this works by +# reading /dev/urandom. It should be noted that the OS entropy pool needs to be +# properly initialized before hostapd is started. This is important especially +# on embedded devices that do not have a hardware random number generator and +# may by default start up with minimal entropy available for random number +# generation. +# +# As a safety net, hostapd is by default trying to internally collect +# additional entropy for generating random data to mix in with the data +# fetched from the OS. This by itself is not considered to be very strong, but +# it may help in cases where the system pool is not initialized properly. +# However, it is very strongly recommended that the system pool is initialized +# with enough entropy either by using hardware assisted random number +# generator or by storing state over device reboots. +# +# hostapd can be configured to maintain its own entropy store over restarts to +# enhance random number generation. This is not perfect, but it is much more +# secure than using the same sequence of random numbers after every reboot. +# This can be enabled with -e command line option. The specified +# file needs to be readable and writable by hostapd. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal hostapd random pool can be disabled. +# This will save some in binary size and CPU use. However, this should only be +# considered for builds that are known to be used on devices that meet the +# requirements described above. +CONFIG_NO_RANDOM_POOL=y + +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS +# internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) +# none = Empty template +CONFIG_TLS=internal + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +#CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks. +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file +#CONFIG_SQLITE=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# Testing options +# This can be used to enable some testing options (see also the example +# configuration file) that are really useful only for testing clients that +# connect to this hostapd. These options allow, for example, to drop a +# certain percentage of probe requests or auth/(re)assoc frames. +# +#CONFIG_TESTING_OPTIONS=y + +# Automatic Channel Selection +# This will allow hostapd to pick the channel automatically when channel is set +# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# You can customize the ACS survey algorithm with the hostapd.conf variable +# acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +# +#CONFIG_ACS=y + +# Multiband Operation support +# These extentions facilitate efficient use of multiple frequency bands +# available to the AP and the devices that may associate with it. +#CONFIG_MBO=y + +# Client Taxonomy +# Has the AP retain the Probe Request and (Re)Association Request frames from +# a client, from which a signature can be produced which can identify the model +# of client device like "Nexus 6P" or "iPhone 5s". +#CONFIG_TAXONOMY=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Include internal line edit mode in hostapd_cli. This can be used to provide +# limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y + +# uBus IPC/RPC System +# Services can connect to the bus and provide methods +# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd-mini.config b/package/network/services/hostapd/files/hostapd-mini.config index 2bd7d239c..661983a94 100644 --- a/package/network/services/hostapd/files/hostapd-mini.config +++ b/package/network/services/hostapd/files/hostapd-mini.config @@ -15,28 +15,37 @@ # Driver interface for wired authenticator CONFIG_DRIVER_WIRED=y -# Driver interface for Prism54 driver -#CONFIG_DRIVER_PRISM54=y - # Driver interface for drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y -# driver_nl80211.c requires a rather new libnl (version 1.1) which may not be -# shipped with your distribution yet. If that is the case, you need to build -# newer libnl version and point the hostapd build to use it. -#LIBNL=/usr/src/libnl -#CFLAGS += -I$(LIBNL)/include -#LIBS += -L$(LIBNL)/lib + +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include #LIBS += -L/usr/local/lib +#LIBS_p += -L/usr/local/lib +#LIBS_c += -L/usr/local/lib # Driver interface for no driver (e.g., RADIUS server only) #CONFIG_DRIVER_NONE=y # IEEE 802.11F/IAPP -# CONFIG_IAPP=y +#CONFIG_IAPP=y # WPA2/IEEE 802.11i RSN pre-authentication CONFIG_RSN_PREAUTH=y @@ -45,14 +54,15 @@ CONFIG_RSN_PREAUTH=y CONFIG_PEERKEY=y # IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Integrated EAP server #CONFIG_EAP=y +# EAP Re-authentication Protocol (ERP) in integrated EAP server +#CONFIG_ERP=y + # EAP-MD5 for the integrated EAP server #CONFIG_EAP_MD5=y @@ -87,6 +97,9 @@ CONFIG_PEERKEY=y # EAP-PSK for the integrated EAP server (this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd for the integrated EAP server (secure authentication with a password) +#CONFIG_EAP_PWD=y + # EAP-SAKE for the integrated EAP server #CONFIG_EAP_SAKE=y @@ -96,16 +109,17 @@ CONFIG_PEERKEY=y #CONFIG_EAP_GPSK_SHA256=y # EAP-FAST for the integrated EAP server -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.9-session-ticket.patch) -# to add the needed functions. +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. #CONFIG_EAP_FAST=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y # Enable UPnP support for external WPS Registrars #CONFIG_WPS_UPNP=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y @@ -113,6 +127,9 @@ CONFIG_PEERKEY=y # Trusted Network Connect (EAP-TNC) #CONFIG_EAP_TNC=y +# EAP-EKE for the integrated EAP server +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) #CONFIG_PKCS12=y @@ -128,23 +145,43 @@ CONFIG_PEERKEY=y #CONFIG_IEEE80211R=y # Use the hostapd's IEEE 802.11 authentication (ACL), but without -# the IEEE 802.11 Management capability (e.g. FreeBSD/net80211) +# the IEEE 802.11 Management capability (e.g., FreeBSD/net80211) #CONFIG_DRIVER_RADIUS_ACL=y # IEEE 802.11n (High Throughput) support CONFIG_IEEE80211N=y +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + # IEEE 802.11ac (Very High Throughput) support CONFIG_IEEE80211AC=y +# IEEE 802.11ax HE support +# Note: This is experimental and work in progress. The definitions are still +# subject to change and this should not be expected to interoperate with the +# final IEEE 802.11ax version. +#CONFIG_IEEE80211AX=y + # Remove debugging code that is printing out debug messages to stdout. # This can be used to reduce the size of the hostapd considerably if debugging # code is not needed. #CONFIG_NO_STDOUT_DEBUG=y +# Add support for writing debug log to a file: -f /tmp/hostapd.log +# Disabled by default. +#CONFIG_DEBUG_FILE=y + # Send debug messages to syslog instead of stdout CONFIG_DEBUG_SYSLOG=y +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + # Remove support for RADIUS accounting CONFIG_NO_ACCOUNTING=y @@ -154,9 +191,190 @@ CONFIG_NO_RADIUS=y # Remove support for VLANs #CONFIG_NO_VLAN=y -CONFIG_TLS=internal +# Enable support for fully dynamic VLANs. This enables hostapd to +# automatically create bridge and VLAN interfaces if necessary. +#CONFIG_FULL_DYNAMIC_VLAN=y -CONFIG_NO_RANDOM_POOL=y +# Use netlink-based kernel API for VLAN operations instead of ioctl() +# Note: This requires libnl 3.1 or newer. +#CONFIG_VLAN_NETLINK=y + +# Remove support for dumping internal state through control interface commands +# This can be used to reduce binary size at the cost of disabling a debugging +# option. CONFIG_NO_DUMP_STATE=y +# Enable tracing code for developer debugging +# This tracks use of memory allocations and other registrations and reports +# incorrect use with a backtrace of call (or allocation) location. +#CONFIG_WPA_TRACE=y +# For BSD, comment out these. +#LIBS += -lexecinfo +#LIBS_p += -lexecinfo +#LIBS_c += -lexecinfo + +# Use libbfd to get more details for developer debugging +# This enables use of libbfd to get more detailed symbols for the backtraces +# generated by CONFIG_WPA_TRACE=y. +#CONFIG_WPA_TRACE_BFD=y +# For BSD, comment out these. +#LIBS += -lbfd -liberty -lz +#LIBS_p += -lbfd -liberty -lz +#LIBS_c += -lbfd -liberty -lz + +# hostapd depends on strong random number generation being available from the +# operating system. os_get_random() function is used to fetch random data when +# needed, e.g., for key generation. On Linux and BSD systems, this works by +# reading /dev/urandom. It should be noted that the OS entropy pool needs to be +# properly initialized before hostapd is started. This is important especially +# on embedded devices that do not have a hardware random number generator and +# may by default start up with minimal entropy available for random number +# generation. +# +# As a safety net, hostapd is by default trying to internally collect +# additional entropy for generating random data to mix in with the data +# fetched from the OS. This by itself is not considered to be very strong, but +# it may help in cases where the system pool is not initialized properly. +# However, it is very strongly recommended that the system pool is initialized +# with enough entropy either by using hardware assisted random number +# generator or by storing state over device reboots. +# +# hostapd can be configured to maintain its own entropy store over restarts to +# enhance random number generation. This is not perfect, but it is much more +# secure than using the same sequence of random numbers after every reboot. +# This can be enabled with -e command line option. The specified +# file needs to be readable and writable by hostapd. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal hostapd random pool can be disabled. +# This will save some in binary size and CPU use. However, this should only be +# considered for builds that are known to be used on devices that meet the +# requirements described above. +CONFIG_NO_RANDOM_POOL=y + +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + +# Select TLS implementation +# openssl = OpenSSL (default) +# gnutls = GnuTLS +# internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) +# none = Empty template +CONFIG_TLS=internal + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" + +# If CONFIG_TLS=internal is used, additional library and include paths are +# needed for LibTomMath. Alternatively, an integrated, minimal version of +# LibTomMath can be used. See beginning of libtommath.c for details on benefits +# and drawbacks of this option. +#CONFIG_INTERNAL_LIBTOMMATH=y +#ifndef CONFIG_INTERNAL_LIBTOMMATH +#LTM_PATH=/usr/src/libtommath-0.39 +#CFLAGS += -I$(LTM_PATH) +#LIBS += -L$(LTM_PATH) +#LIBS_p += -L$(LTM_PATH) +#endif +# At the cost of about 4 kB of additional binary size, the internal LibTomMath +# can be configured to include faster routines for exptmod, sqr, and div to +# speed up DH and RSA calculation considerably +#CONFIG_INTERNAL_LIBTOMMATH_FAST=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks. +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable SQLite database support in hlr_auc_gw, EAP-SIM DB, and eap_user_file +#CONFIG_SQLITE=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# Testing options +# This can be used to enable some testing options (see also the example +# configuration file) that are really useful only for testing clients that +# connect to this hostapd. These options allow, for example, to drop a +# certain percentage of probe requests or auth/(re)assoc frames. +# +#CONFIG_TESTING_OPTIONS=y + +# Automatic Channel Selection +# This will allow hostapd to pick the channel automatically when channel is set +# to "acs_survey" or "0". Eventually, other ACS algorithms can be added in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# You can customize the ACS survey algorithm with the hostapd.conf variable +# acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +# +#CONFIG_ACS=y + +# Multiband Operation support +# These extentions facilitate efficient use of multiple frequency bands +# available to the AP and the devices that may associate with it. +#CONFIG_MBO=y + +# Client Taxonomy +# Has the AP retain the Probe Request and (Re)Association Request frames from +# a client, from which a signature can be produced which can identify the model +# of client device like "Nexus 6P" or "iPhone 5s". +#CONFIG_TAXONOMY=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Include internal line edit mode in hostapd_cli. This can be used to provide +# limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y + +# uBus IPC/RPC System +# Services can connect to the bus and provide methods +# that can be called by other services or clients. CONFIG_UBUS=y diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 1f2866111..36aee85f1 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -66,6 +66,9 @@ hostapd_common_add_device_config() { config_add_string require_mode config_add_boolean legacy_rates + config_add_string acs_chan_bias + config_add_array hostapd_options + hostapd_add_log_config } @@ -76,7 +79,7 @@ hostapd_prepare_device_config() { local base="${config%%.conf}" local base_cfg= - json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates + json_get_vars country country_ie beacon_int:100 doth require_mode legacy_rates acs_chan_bias hostapd_set_log_options base_cfg @@ -93,6 +96,8 @@ hostapd_prepare_device_config() { [ "$hwmode" = "a" -a "$doth" -gt 0 ] && append base_cfg "ieee80211h=1" "$N" } + [ -n "$acs_chan_bias" ] && append base_cfg "acs_chan_bias=$acs_chan_bias" "$N" + local brlist= br json_get_values basic_rate_list basic_rate local rlist= r @@ -123,6 +128,11 @@ hostapd_prepare_device_config() { [ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N" append base_cfg "beacon_int=$beacon_int" "$N" + json_get_values opts hostapd_options + for val in $opts; do + append base_cfg "$val" "$N" + done + cat > "$config" < allow management frame protection case "$ieee80211w" in [012]) - json_get_vars ieee80211w_max_timeout ieee80211w_retry_timeout + json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout append bss_conf "ieee80211w=$ieee80211w" "$N" [ "$ieee80211w" -gt "0" ] && { + append bss_conf "group_mgmt_cipher=${ieee80211w_mgmt_cipher:-AES-128-CMAC}" "$N" [ -n "$ieee80211w_max_timeout" ] && \ append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N" [ -n "$ieee80211w_retry_timeout" ] && \ @@ -586,8 +601,31 @@ EOF return 0 } +wpa_supplicant_set_fixed_freq() { + local freq="$1" + local htmode="$2" + + append network_data "fixed_freq=1" "$N$T" + append network_data "frequency=$freq" "$N$T" + case "$htmode" in + NOHT) append network_data "disable_ht=1" "$N$T";; + HT20|VHT20) append network_data "disable_ht40=1" "$N$T";; + HT40*|VHT40*|VHT80*|VHT160*) append network_data "ht40=1" "$N$T";; + esac + case "$htmode" in + VHT*) append network_data "vht=1" "$N$T";; + esac + case "$htmode" in + VHT80) append network_data "max_oper_chwidth=1" "$N$T";; + VHT160) append network_data "max_oper_chwidth=2" "$N$T";; + *) append network_data "max_oper_chwidth=0" "$N$T";; + esac +} + wpa_supplicant_add_network() { local ifname="$1" + local freq="$2" + local htmode="$3" _wpa_supplicant_common "$1" wireless_vif_parse_encryption @@ -609,11 +647,7 @@ wpa_supplicant_add_network() { [[ "$_w_mode" = "adhoc" ]] && { append network_data "mode=1" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "fixed_freq=1" "$N$T" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" scan_ssid="scan_ssid=0" @@ -625,10 +659,7 @@ wpa_supplicant_add_network() { ssid="${mesh_id}" append network_data "mode=5" "$N$T" - [ -n "$channel" ] && { - freq="$(get_freq "$phy" "$channel")" - append network_data "frequency=$freq" "$N$T" - } + [ -n "$channel" ] && wpa_supplicant_set_fixed_freq "$freq" "$htmode" append wpa_key_mgmt "SAE" scan_ssid="" } @@ -721,7 +752,6 @@ wpa_supplicant_add_network() { ;; esac } - local beacon_int brates mrate [ -n "$bssid" ] && append network_data "bssid=$bssid" "$N$T" [ -n "$beacon_int" ] && append network_data "beacon_int=$beacon_int" "$N$T" diff --git a/package/network/services/hostapd/files/wpa_supplicant-full.config b/package/network/services/hostapd/files/wpa_supplicant-full.config index 18c3f9a5c..81fa8f539 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-full.config +++ b/package/network/services/hostapd/files/wpa_supplicant-full.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,13 +79,14 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y -# EAP-FAST -CONFIG_EAP_FAST=y - # EAP-MD5 CONFIG_EAP_MD5=y @@ -140,11 +103,10 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -158,6 +120,9 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y @@ -187,10 +152,20 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -203,13 +178,22 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -221,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -231,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -270,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -279,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -291,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y + # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. -CONFIG_IEEE80211W=y +#CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -369,12 +375,31 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -386,7 +411,7 @@ CONFIG_IEEE80211R=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -395,12 +420,174 @@ CONFIG_IEEE80211R=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +#CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +#CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y + +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-mini.config b/package/network/services/hostapd/files/wpa_supplicant-mini.config index c272153b3..3e088715c 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-mini.config +++ b/package/network/services/hostapd/files/wpa_supplicant-mini.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,37 +79,40 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) -# CONFIG_IEEE8021X_EAPOL=y +#CONFIG_IEEE8021X_EAPOL=y # EAP-MD5 -# CONFIG_EAP_MD5=y +#CONFIG_EAP_MD5=y # EAP-MSCHAPv2 -# CONFIG_EAP_MSCHAPV2=y +#CONFIG_EAP_MSCHAPV2=y # EAP-TLS -# CONFIG_EAP_TLS=y +#CONFIG_EAP_TLS=y # EAL-PEAP -# CONFIG_EAP_PEAP=y +#CONFIG_EAP_PEAP=y # EAP-TTLS -# CONFIG_EAP_TTLS=y +#CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. #CONFIG_EAP_FAST=y # EAP-GTC -# CONFIG_EAP_GTC=y +#CONFIG_EAP_GTC=y # EAP-OTP -# CONFIG_EAP_OTP=y +#CONFIG_EAP_OTP=y # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used) #CONFIG_EAP_SIM=y @@ -155,11 +120,14 @@ CONFIG_DRIVER_WIRED=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y # LEAP -# CONFIG_EAP_LEAP=y +#CONFIG_EAP_LEAP=y # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used) #CONFIG_EAP_AKA=y @@ -184,29 +152,48 @@ CONFIG_DRIVER_WIRED=y # Wi-Fi Protected Setup (WPS) #CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) -# CONFIG_PKCS12=y +#CONFIG_PKCS12=y # Smartcard support (i.e., private key on a smartcard), e.g., with openssl # engine. -# CONFIG_SMARTCARD=y +#CONFIG_SMARTCARD=y # PC/SC interface for smartcards (USIM, GSM SIM) # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -218,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -228,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -267,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -276,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -288,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux -# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) -# CONFIG_PEERKEY=y +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) +#CONFIG_PEERKEY=y + +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. #CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -366,12 +375,31 @@ CONFIG_TLS=internal # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode #CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -383,7 +411,7 @@ CONFIG_TLS=internal # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -392,10 +420,174 @@ CONFIG_TLS=internal # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y + +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +#CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +#CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). +#CONFIG_IBSS_RSN=y + +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/files/wpa_supplicant-p2p.config b/package/network/services/hostapd/files/wpa_supplicant-p2p.config index 563dace35..420aebcf9 100644 --- a/package/network/services/hostapd/files/wpa_supplicant-p2p.config +++ b/package/network/services/hostapd/files/wpa_supplicant-p2p.config @@ -1,9 +1,9 @@ # Example wpa_supplicant build time configuration # # This file lists the configuration options that are used when building the -# hostapd binary. All lines starting with # are ignored. Configuration option -# lines must be commented out complete, if they are not to be included, i.e., -# just setting VARIABLE=n is not disabling that variable. +# wpa_supplicant binary. All lines starting with # are ignored. Configuration +# option lines must be commented out complete, if they are not to be included, +# i.e., just setting VARIABLE=n is not disabling that variable. # # This file is included in Makefile, so variables like CFLAGS and LIBS can also # be modified from here. In most cases, these lines should use += in order not @@ -20,63 +20,33 @@ # used to fix build issues on such systems (krb5.h not found). #CFLAGS += -I/usr/include/kerberos -# Example configuration for various cross-compilation platforms - -#### sveasoft (e.g., for Linksys WRT54G) ###################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS += -I../src/include -I../../src/router/openssl/include -#LIBS += -L/opt/brcm/hndtools-mipsel-uclibc-0.9.19/lib -lssl -############################################################################### - -#### openwrt (e.g., for Linksys WRT54G) ####################################### -#CC=mipsel-uclibc-gcc -#CC=/opt/brcm/hndtools-mipsel-uclibc/bin/mipsel-uclibc-gcc -#CFLAGS += -Os -#CPPFLAGS=-I../src/include -I../openssl-0.9.7d/include \ -# -I../WRT54GS/release/src/include -#LIBS = -lssl -############################################################################### - - -# Driver interface for Host AP driver -#CONFIG_DRIVER_HOSTAP=y - -# Driver interface for Agere driver -#CONFIG_DRIVER_HERMES=y -# Change include directories to match with the local setup -#CFLAGS += -I../../hcf -I../../include -I../../include/hcf -#CFLAGS += -I../../include/wireless - -# Driver interface for ndiswrapper -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_NDISWRAPPER=y - -# Driver interface for Atmel driver -# CONFIG_DRIVER_ATMEL=y - -# Driver interface for old Broadcom driver -# Please note that the newer Broadcom driver ("hybrid Linux driver") supports -# Linux wireless extensions and does not need (or even work) with the old -# driver wrapper. Use CONFIG_DRIVER_WEXT=y with that driver. -#CONFIG_DRIVER_BROADCOM=y -# Example path for wlioctl.h; change to match your configuration -#CFLAGS += -I/opt/WRT54GS/release/src/include - -# Driver interface for Intel ipw2100/2200 driver -# Deprecated; use CONFIG_DRIVER_WEXT=y instead. -#CONFIG_DRIVER_IPW=y - -# Driver interface for Ralink driver -#CONFIG_DRIVER_RALINK=y - # Driver interface for generic Linux wireless extensions +# Note: WEXT is deprecated in the current Linux kernel version and no new +# functionality is added to it. nl80211-based interface is the new +# replacement for WEXT and its use allows wpa_supplicant to properly control +# the driver to improve existing functionality like roaming and to support new +# functionality. CONFIG_DRIVER_WEXT=y # Driver interface for Linux drivers using the nl80211 kernel interface CONFIG_DRIVER_NL80211=y +# QCA vendor extensions to nl80211 +#CONFIG_DRIVER_NL80211_QCA=y + +# driver_nl80211.c requires libnl. If you are compiling it yourself +# you may need to point hostapd to your version of libnl. +# +#CFLAGS += -I$ +#LIBS += -L$ + +# Use libnl v2.0 (or 3.0) libraries. +#CONFIG_LIBNL20=y + +# Use libnl 3.2 libraries (if this is selected, CONFIG_LIBNL20 is ignored) +#CONFIG_LIBNL32=y + + # Driver interface for FreeBSD net80211 layer (e.g., Atheros driver) #CONFIG_DRIVER_BSD=y #CFLAGS += -I/usr/local/include @@ -100,14 +70,6 @@ CONFIG_DRIVER_NL80211=y # wpa_supplicant. # CONFIG_USE_NDISUIO=y -# Driver interface for development testing -#CONFIG_DRIVER_TEST=y - -# Include client MLME (management frame processing) for test driver -# This can be used to test MLME operations in hostapd with the test interface. -# space. -#CONFIG_CLIENT_MLME=y - # Driver interface for wired Ethernet drivers CONFIG_DRIVER_WIRED=y @@ -117,6 +79,10 @@ CONFIG_DRIVER_WIRED=y # Driver interface for no driver (e.g., WPS ER only) #CONFIG_DRIVER_NONE=y +# Solaris libraries +#LIBS += -lsocket -ldlpi -lnsl +#LIBS_c += -lsocket + # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is # included) CONFIG_IEEE8021X_EAPOL=y @@ -137,11 +103,10 @@ CONFIG_EAP_PEAP=y CONFIG_EAP_TTLS=y # EAP-FAST -# Note: Default OpenSSL package does not include support for all the -# functionality needed for EAP-FAST. If EAP-FAST is enabled with OpenSSL, -# the OpenSSL library must be patched (openssl-0.9.8d-tls-extensions.patch) -# to add the needed functions. -#CONFIG_EAP_FAST=y +# Note: If OpenSSL is used as the TLS library, OpenSSL 1.0 or newer is needed +# for EAP-FAST support. Older OpenSSL releases would need to be patched, e.g., +# with openssl-0.9.8x-tls-extensions.patch, to add the needed functions. +CONFIG_EAP_FAST=y # EAP-GTC CONFIG_EAP_GTC=y @@ -155,6 +120,9 @@ CONFIG_EAP_OTP=y # EAP-PSK (experimental; this is _not_ needed for WPA-PSK) #CONFIG_EAP_PSK=y +# EAP-pwd (secure authentication using only a password) +#CONFIG_EAP_PWD=y + # EAP-PAX #CONFIG_EAP_PAX=y @@ -184,10 +152,20 @@ CONFIG_EAP_LEAP=y # Wi-Fi Protected Setup (WPS) CONFIG_WPS=y +# Enable WPS external registrar functionality +#CONFIG_WPS_ER=y +# Disable credentials for an open network by default when acting as a WPS +# registrar. +#CONFIG_WPS_REG_DISABLE_OPEN=y +# Enable WPS support with NFC config method +#CONFIG_WPS_NFC=y # EAP-IKEv2 #CONFIG_EAP_IKEV2=y +# EAP-EKE +#CONFIG_EAP_EKE=y + # PKCS#12 (PFX) support (used to read private key and certificate file from # a file that usually has extension .p12 or .pfx) CONFIG_PKCS12=y @@ -200,13 +178,22 @@ CONFIG_SMARTCARD=y # Enable this if EAP-SIM or EAP-AKA is included #CONFIG_PCSC=y +# Support HT overrides (disable HT/HT40, mask MCS rates, etc.) +CONFIG_HT_OVERRIDES=y + +# Support VHT overrides (disable VHT, mask MCS rates, etc.) +CONFIG_VHT_OVERRIDES=y + # Development testing #CONFIG_EAPOL_TEST=y # Select control interface backend for external programs, e.g, wpa_cli: # unix = UNIX domain sockets (default for Linux/*BSD) # udp = UDP sockets using localhost (127.0.0.1) +# udp6 = UDP IPv6 sockets using localhost (::1) # named_pipe = Windows Named Pipe (default for Windows) +# udp-remote = UDP sockets with remote access (only for tests systems/purpose) +# udp6-remote = UDP IPv6 sockets with remote access (only for tests purpose) # y = use default (backwards compatibility) # If this option is commented out, control interface is not included in the # build. @@ -218,6 +205,10 @@ CONFIG_CTRL_IFACE=y # the resulting binary. #CONFIG_READLINE=y +# Include internal line edit mode in wpa_cli. This can be used as a replacement +# for GNU Readline to provide limited command line editing and history support. +#CONFIG_WPA_CLI_EDIT=y + # Remove debugging code that is printing out debug message to stdout. # This can be used to reduce the size of the wpa_supplicant considerably # if debugging code is not needed. The size reduction can be around 35% @@ -228,11 +219,6 @@ CONFIG_CTRL_IFACE=y # 35-50 kB in code size. #CONFIG_NO_WPA=y -# Remove WPA2 support. This allows WPA to be used, but removes WPA2 code to -# save about 1 kB in code size when building only WPA-Personal (no EAP support) -# or 6 kB if building for WPA-Enterprise. -#CONFIG_NO_WPA2=y - # Remove IEEE 802.11i/WPA-Personal ASCII passphrase support # This option can be used to reduce code size by removing support for # converting ASCII passphrases into PSK. If this functionality is removed, the @@ -267,7 +253,7 @@ CONFIG_BACKEND=file # main_none = Very basic example (development use only) #CONFIG_MAIN=main -# Select wrapper for operatins system and C library specific functions +# Select wrapper for operating system and C library specific functions # unix = UNIX/POSIX like systems (default) # win32 = Windows systems # none = Empty template @@ -276,9 +262,17 @@ CONFIG_BACKEND=file # Select event loop implementation # eloop = select() loop (default) # eloop_win = Windows events and WaitForMultipleObject() loop -# eloop_none = Empty template #CONFIG_ELOOP=eloop +# Should we use poll instead of select? Select is used by default. +#CONFIG_ELOOP_POLL=y + +# Should we use epoll instead of select? Select is used by default. +#CONFIG_ELOOP_EPOLL=y + +# Should we use kqueue instead of select? Select is used by default. +#CONFIG_ELOOP_KQUEUE=y + # Select layer 2 packet implementation # linux = Linux packet socket (default) # pcap = libpcap/libdnet/WinPcap @@ -288,29 +282,44 @@ CONFIG_BACKEND=file # none = Empty template #CONFIG_L2_PACKET=linux +# Disable Linux packet socket workaround applicable for station interface +# in a bridge for EAPOL frames. This should be uncommented only if the kernel +# is known to not have the regression issue in packet socket behavior with +# bridge interfaces (commit 'bridge: respect RFC2863 operational state')'). +#CONFIG_NO_LINUX_PACKET_SOCKET_WAR=y + # PeerKey handshake for Station to Station Link (IEEE 802.11e DLS) CONFIG_PEERKEY=y -# IEEE 802.11w (management frame protection) -# This version is an experimental implementation based on IEEE 802.11w/D1.0 -# draft and is subject to change since the standard has not yet been finalized. +# IEEE 802.11w (management frame protection), also known as PMF # Driver support is also needed for IEEE 802.11w. CONFIG_IEEE80211W=y # Select TLS implementation # openssl = OpenSSL (default) -# gnutls = GnuTLS (needed for TLS/IA, see also CONFIG_GNUTLS_EXTRA) +# gnutls = GnuTLS # internal = Internal TLSv1 implementation (experimental) +# linux = Linux kernel AF_ALG and internal TLSv1 implementation (experimental) # none = Empty template CONFIG_TLS=internal -# Whether to enable TLS/IA support, which is required for EAP-TTLSv1. -# You need CONFIG_TLS=gnutls for this to have any effect. Please note that -# even though the core GnuTLS library is released under LGPL, this extra -# library uses GPL and as such, the terms of GPL apply to the combination -# of wpa_supplicant and GnuTLS if this option is enabled. BSD license may not -# apply for distribution of the resulting binary. -#CONFIG_GNUTLS_EXTRA=y +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.1) +# can be enabled to get a stronger construction of messages when block ciphers +# are used. It should be noted that some existing TLS v1.0 -based +# implementation may not be compatible with TLS v1.1 message (ClientHello is +# sent prior to negotiating which version will be used) +#CONFIG_TLSV11=y + +# TLS-based EAP methods require at least TLS v1.0. Newer version of TLS (v1.2) +# can be enabled to enable use of stronger crypto algorithms. It should be +# noted that some existing TLS v1.0 -based implementation may not be compatible +# with TLS v1.2 message (ClientHello is sent prior to negotiating which version +# will be used) +#CONFIG_TLSV12=y + +# Select which ciphers to use by default with OpenSSL if the user does not +# specify them. +#CONFIG_TLS_DEFAULT_CIPHERS="DEFAULT:!EXP:!LOW" # If CONFIG_TLS=internal is used, additional library and include paths are # needed for LibTomMath. Alternatively, an integrated, minimal version of @@ -366,12 +375,31 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # amount of memory/flash. #CONFIG_DYNAMIC_EAP_METHODS=y -# IEEE Std 802.11r-2008 (Fast BSS Transition) +# IEEE Std 802.11r-2008 (Fast BSS Transition) for station mode #CONFIG_IEEE80211R=y +# IEEE Std 802.11r-2008 (Fast BSS Transition) for AP mode (implies +# CONFIG_IEEE80211R). +#CONFIG_IEEE80211R_AP=y + # Add support for writing debug log to a file (/tmp/wpa_supplicant-log-#.txt) #CONFIG_DEBUG_FILE=y +# Send debug messages to syslog instead of stdout +#CONFIG_DEBUG_SYSLOG=y +# Set syslog facility for debug messages +#CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON + +# Add support for sending all debug messages (regardless of debug verbosity) +# to the Linux kernel tracing facility. This helps debug the entire stack by +# making it easy to record everything happening from the driver up into the +# same file, e.g., using trace-cmd. +#CONFIG_DEBUG_LINUX_TRACING=y + +# Add support for writing debug log to Android logcat instead of standard +# output +#CONFIG_ANDROID_LOG=y + # Enable privilege separation (see README 'Privilege separation' for details) #CONFIG_PRIVSEP=y @@ -383,7 +411,7 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This tracks use of memory allocations and other registrations and reports # incorrect use with a backtrace of call (or allocation) location. #CONFIG_WPA_TRACE=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lexecinfo #LIBS_p += -lexecinfo #LIBS_c += -lexecinfo @@ -392,15 +420,174 @@ CONFIG_INTERNAL_LIBTOMMATH_FAST=y # This enables use of libbfd to get more detailed symbols for the backtraces # generated by CONFIG_WPA_TRACE=y. #CONFIG_WPA_TRACE_BFD=y -# For BSD, comment out these. +# For BSD, uncomment these. #LIBS += -lbfd -liberty -lz #LIBS_p += -lbfd -liberty -lz #LIBS_c += -lbfd -liberty -lz +# wpa_supplicant depends on strong random number generation being available +# from the operating system. os_get_random() function is used to fetch random +# data when needed, e.g., for key generation. On Linux and BSD systems, this +# works by reading /dev/urandom. It should be noted that the OS entropy pool +# needs to be properly initialized before wpa_supplicant is started. This is +# important especially on embedded devices that do not have a hardware random +# number generator and may by default start up with minimal entropy available +# for random number generation. +# +# As a safety net, wpa_supplicant is by default trying to internally collect +# additional entropy for generating random data to mix in with the data fetched +# from the OS. This by itself is not considered to be very strong, but it may +# help in cases where the system pool is not initialized properly. However, it +# is very strongly recommended that the system pool is initialized with enough +# entropy either by using hardware assisted random number generator or by +# storing state over device reboots. +# +# wpa_supplicant can be configured to maintain its own entropy store over +# restarts to enhance random number generation. This is not perfect, but it is +# much more secure than using the same sequence of random numbers after every +# reboot. This can be enabled with -e command line option. The +# specified file needs to be readable and writable by wpa_supplicant. +# +# If the os_get_random() is known to provide strong random data (e.g., on +# Linux/BSD, the board in question is known to have reliable source of random +# data from /dev/urandom), the internal wpa_supplicant random pool can be +# disabled. This will save some in binary size and CPU use. However, this +# should only be considered for builds that are known to be used on devices +# that meet the requirements described above. CONFIG_NO_RANDOM_POOL=y -NEED_80211_COMMON=y +# IEEE 802.11n (High Throughput) support (mainly for AP mode) +#CONFIG_IEEE80211N=y + +# IEEE 802.11ac (Very High Throughput) support (mainly for AP mode) +# (depends on CONFIG_IEEE80211N) +#CONFIG_IEEE80211AC=y + +# Wireless Network Management (IEEE Std 802.11v-2011) +# Note: This is experimental and not complete implementation. +#CONFIG_WNM=y + +# Interworking (IEEE 802.11u) +# This can be used to enable functionality to improve interworking with +# external networks (GAS/ANQP to learn more about the networks and network +# selection based on available credentials). +#CONFIG_INTERWORKING=y + +# Hotspot 2.0 +#CONFIG_HS20=y + +# Enable interface matching in wpa_supplicant +#CONFIG_MATCH_IFACE=y + +# Disable roaming in wpa_supplicant +#CONFIG_NO_ROAMING=y + +# AP mode operations with wpa_supplicant +# This can be used for controlling AP mode operations with wpa_supplicant. It +# should be noted that this is mainly aimed at simple cases like +# WPA2-Personal while more complex configurations like WPA2-Enterprise with an +# external RADIUS server can be supported with hostapd. +CONFIG_AP=y + +# P2P (Wi-Fi Direct) +# This can be used to enable P2P support in wpa_supplicant. See README-P2P for +# more information on P2P operations. +CONFIG_P2P=y + +# Enable TDLS support +#CONFIG_TDLS=y + +# Wi-Fi Direct +# This can be used to enable Wi-Fi Direct extensions for P2P using an external +# program to control the additional information exchanges in the messages. +#CONFIG_WIFI_DISPLAY=y + +# Autoscan +# This can be used to enable automatic scan support in wpa_supplicant. +# See wpa_supplicant.conf for more information on autoscan usage. +# +# Enabling directly a module will enable autoscan support. +# For exponential module: +#CONFIG_AUTOSCAN_EXPONENTIAL=y +# For periodic module: +#CONFIG_AUTOSCAN_PERIODIC=y + +# Password (and passphrase, etc.) backend for external storage +# These optional mechanisms can be used to add support for storing passwords +# and other secrets in external (to wpa_supplicant) location. This allows, for +# example, operating system specific key storage to be used +# +# External password backend for testing purposes (developer use) +#CONFIG_EXT_PASSWORD_TEST=y + +# Enable Fast Session Transfer (FST) +#CONFIG_FST=y + +# Enable CLI commands for FST testing +#CONFIG_FST_TEST=y + +# OS X builds. This is only for building eapol_test. +#CONFIG_OSX=y + +# Automatic Channel Selection +# This will allow wpa_supplicant to pick the channel automatically when channel +# is set to "0". +# +# TODO: Extend parser to be able to parse "channel=acs_survey" as an alternative +# to "channel=0". This would enable us to eventually add other ACS algorithms in +# similar way. +# +# Automatic selection is currently only done through initialization, later on +# we hope to do background checks to keep us moving to more ideal channels as +# time goes by. ACS is currently only supported through the nl80211 driver and +# your driver must have survey dump capability that is filled by the driver +# during scanning. +# +# TODO: In analogy to hostapd be able to customize the ACS survey algorithm with +# a newly to create wpa_supplicant.conf variable acs_num_scans. +# +# Supported ACS drivers: +# * ath9k +# * ath5k +# * ath10k +# +# For more details refer to: +# http://wireless.kernel.org/en/users/Documentation/acs +#CONFIG_ACS=y + +# Support Multi Band Operation +#CONFIG_MBO=y + +# Fast Initial Link Setup (FILS) (IEEE 802.11ai) +# Note: This is an experimental and not yet complete implementation. This +# should not be enabled for production use. +#CONFIG_FILS=y +# FILS shared key authentication with PFS +#CONFIG_FILS_SK_PFS=y + +# Support RSN on IBSS networks +# This is needed to be able to use mode=1 network profile with proto=RSN and +# key_mgmt=WPA-PSK (i.e., full key management instead of WPA-None). CONFIG_IBSS_RSN=y -CONFIG_P2P=y -CONFIG_AP=y +# External PMKSA cache control +# This can be used to enable control interface commands that allow the current +# PMKSA cache entries to be fetched and new entries to be added. +#CONFIG_PMKSA_CACHE_EXTERNAL=y + +# Mesh Networking (IEEE 802.11s) +#CONFIG_MESH=y + +# Background scanning modules +# These can be used to request wpa_supplicant to perform background scanning +# operations for roaming within an ESS (same SSID). See the bgscan parameter in +# the wpa_supplicant.conf file for more details. +# Periodic background scans based on signal strength +#CONFIG_BGSCAN_SIMPLE=y +# Learn channels used by the network and try to avoid bgscans on other +# channels (experimental) +#CONFIG_BGSCAN_LEARN=y + +# Opportunistic Wireless Encryption (OWE) +# Experimental implementation of draft-harkins-owe-07.txt +#CONFIG_OWE=y diff --git a/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch similarity index 84% rename from package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch rename to package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch index 2136bb9d4..14b2d7c71 100644 --- a/package/network/services/hostapd/patches/005-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch +++ b/package/network/services/hostapd/patches/000-hostapd-Avoid-key-reinstallation-in-FT-handshake.patch @@ -21,7 +21,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -2154,6 +2154,7 @@ static int add_associated_sta(struct hos +@@ -2522,6 +2522,7 @@ static int add_associated_sta(struct hos { struct ieee80211_ht_capabilities ht_cap; struct ieee80211_vht_capabilities vht_cap; @@ -29,7 +29,7 @@ Signed-off-by: Mathy Vanhoef /* * Remove the STA entry to ensure the STA PS state gets cleared and -@@ -2161,9 +2162,18 @@ static int add_associated_sta(struct hos +@@ -2529,9 +2530,18 @@ static int add_associated_sta(struct hos * FT-over-the-DS, where a station re-associates back to the same AP but * skips the authentication flow, or if working with a driver that * does not support full AP client state. @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211N if (sta->flags & WLAN_STA_HT) -@@ -2186,11 +2196,11 @@ static int add_associated_sta(struct hos +@@ -2554,11 +2564,11 @@ static int add_associated_sta(struct hos sta->flags & WLAN_STA_VHT ? &vht_cap : NULL, sta->flags | WLAN_STA_ASSOC, sta->qosinfo, sta->vht_opmode, sta->p2p_ie ? 1 : 0, @@ -65,17 +65,17 @@ Signed-off-by: Mathy Vanhoef hostapd_drv_sta_remove(hapd, sta->addr); --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1751,6 +1751,9 @@ int wpa_auth_sm_event(struct wpa_state_m - #else /* CONFIG_IEEE80211R_AP */ +@@ -1783,6 +1783,9 @@ int wpa_auth_sm_event(struct wpa_state_m + #else /* CONFIG_FILS */ break; - #endif /* CONFIG_IEEE80211R_AP */ + #endif /* CONFIG_FILS */ + case WPA_DRV_STA_REMOVED: + sm->tk_already_set = FALSE; + return 0; } #ifdef CONFIG_IEEE80211R_AP -@@ -3725,6 +3728,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ +@@ -3922,6 +3925,14 @@ int wpa_auth_sta_wpa_version(struct wpa_ } @@ -90,9 +90,28 @@ Signed-off-by: Mathy Vanhoef int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, struct rsn_pmksa_cache_entry *entry) { +--- a/src/ap/wpa_auth.h ++++ b/src/ap/wpa_auth.h +@@ -300,7 +300,7 @@ void wpa_receive(struct wpa_authenticato + u8 *data, size_t data_len); + enum wpa_event { + WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, +- WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS ++ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED + }; + void wpa_remove_ptk(struct wpa_state_machine *sm); + int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); +@@ -313,6 +313,7 @@ int wpa_auth_pairwise_set(struct wpa_sta + int wpa_auth_get_pairwise(struct wpa_state_machine *sm); + int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); + int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); ++int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); + int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, + struct rsn_pmksa_cache_entry *entry); + struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_ft.c +++ b/src/ap/wpa_auth_ft.c -@@ -794,6 +794,14 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -1937,6 +1937,14 @@ void wpa_ft_install_ptk(struct wpa_state return; } @@ -107,7 +126,7 @@ Signed-off-by: Mathy Vanhoef /* FIX: add STA entry to kernel/driver here? The set_key will fail * most likely without this.. At the moment, STA entry is added only * after association has been completed. This function will be called -@@ -806,6 +814,7 @@ void wpa_ft_install_ptk(struct wpa_state +@@ -1949,6 +1957,7 @@ void wpa_ft_install_ptk(struct wpa_state /* FIX: MLME-SetProtection.Request(TA, Tx_Rx) */ sm->pairwise_set = TRUE; @@ -115,7 +134,7 @@ Signed-off-by: Mathy Vanhoef } -@@ -1002,6 +1011,7 @@ static int wpa_ft_process_auth_req(struc +@@ -2152,6 +2161,7 @@ static int wpa_ft_process_auth_req(struc sm->pairwise = pairwise; sm->PTK_valid = TRUE; @@ -123,28 +142,9 @@ Signed-off-by: Mathy Vanhoef wpa_ft_install_ptk(sm); buflen = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + ---- a/src/ap/wpa_auth.h -+++ b/src/ap/wpa_auth.h -@@ -268,7 +268,7 @@ void wpa_receive(struct wpa_authenticato - u8 *data, size_t data_len); - enum wpa_event { - WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, -- WPA_REAUTH_EAPOL, WPA_ASSOC_FT -+ WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_DRV_STA_REMOVED - }; - void wpa_remove_ptk(struct wpa_state_machine *sm); - int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); -@@ -281,6 +281,7 @@ int wpa_auth_pairwise_set(struct wpa_sta - int wpa_auth_get_pairwise(struct wpa_state_machine *sm); - int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); - int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); -+int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); - int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, - struct rsn_pmksa_cache_entry *entry); - struct rsn_pmksa_cache_entry * --- a/src/ap/wpa_auth_i.h +++ b/src/ap/wpa_auth_i.h -@@ -65,6 +65,7 @@ struct wpa_state_machine { +@@ -61,6 +61,7 @@ struct wpa_state_machine { struct wpa_ptk PTK; Boolean PTK_valid; Boolean pairwise_set; diff --git a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch b/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch deleted file mode 100644 index bf54e9df3..000000000 --- a/package/network/services/hostapd/patches/001-Fix-race-condition-between-AssocResp-callback-and-4a.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Jouni Malinen -Date: Tue, 20 Dec 2016 01:30:09 +0200 -Subject: [PATCH] Fix race condition between AssocResp callback and 4addr event - -It is apparently possible for the NL80211_CMD_UNEXPECTED_4ADDR_FRAME -event to be delivered to hostapd before the NL80211_CMD_FRAME_TX_STATUS -event for (Re)Association Response frame. This resulted in the 4-address -WDS mode not getting enabled for a STA. This could occur in particular -when operating under heavy load and the STA is reconnecting to the same -AP in a sequence where Deauthentication frame is followed immediately by -Authentication frame and the driver event processing gets delayed due to -removal of the previous netdev taking time in the middle of this -sequence. - -Fix this by recording a pending item for 4-address WDS enabling if the -NL80211_CMD_UNEXPECTED_4ADDR_FRAME event would have been dropped due to -incompleted association and then process this pending item if the TX -status for the (Re)Association Response frame is received and it shows -that the frame was acknowledged. - -Signed-off-by: Jouni Malinen ---- - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -2634,6 +2634,8 @@ static void handle_assoc(struct hostapd_ - taxonomy_sta_info_assoc_req(hapd, sta, pos, left); - #endif /* CONFIG_TAXONOMY */ - -+ sta->pending_wds_enable = 0; -+ - fail: - /* - * In case of a successful response, add the station to the driver. -@@ -3248,6 +3250,14 @@ static void handle_assoc_cb(struct hosta - - hostapd_set_sta_flags(hapd, sta); - -+ if (!(sta->flags & WLAN_STA_WDS) && sta->pending_wds_enable) { -+ wpa_printf(MSG_DEBUG, "Enable 4-address WDS mode for STA " -+ MACSTR " based on pending request", -+ MAC2STR(sta->addr)); -+ sta->pending_wds_enable = 0; -+ sta->flags |= WLAN_STA_WDS; -+ } -+ - if (sta->flags & WLAN_STA_WDS) { - int ret; - char ifname_wds[IFNAMSIZ + 1]; -@@ -3512,10 +3522,22 @@ void ieee802_11_rx_from_unknown(struct h - struct sta_info *sta; - - sta = ap_get_sta(hapd, src); -- if (sta && (sta->flags & WLAN_STA_ASSOC)) { -+ if (sta && -+ ((sta->flags & WLAN_STA_ASSOC) || -+ ((sta->flags & WLAN_STA_ASSOC_REQ_OK) && wds))) { - if (!hapd->conf->wds_sta) - return; - -+ if ((sta->flags & (WLAN_STA_ASSOC | WLAN_STA_ASSOC_REQ_OK)) == -+ WLAN_STA_ASSOC_REQ_OK) { -+ wpa_printf(MSG_DEBUG, -+ "Postpone 4-address WDS mode enabling for STA " -+ MACSTR " since TX status for AssocResp is not yet known", -+ MAC2STR(sta->addr)); -+ sta->pending_wds_enable = 1; -+ return; -+ } -+ - if (wds && !(sta->flags & WLAN_STA_WDS)) { - int ret; - char ifname_wds[IFNAMSIZ + 1]; ---- a/src/ap/sta_info.h -+++ b/src/ap/sta_info.h -@@ -115,6 +115,7 @@ struct sta_info { - unsigned int radius_das_match:1; - unsigned int ecsa_supported:1; - unsigned int added_unassoc:1; -+ unsigned int pending_wds_enable:1; - - u16 auth_alg; - diff --git a/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch similarity index 91% rename from package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch rename to package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch index 71c681e29..b283bf887 100644 --- a/package/network/services/hostapd/patches/006-Prevent-reinstallation-of-an-already-in-use-group-ke.patch +++ b/package/network/services/hostapd/patches/001-Prevent-reinstallation-of-an-already-in-use-group-ke.patch @@ -13,7 +13,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -207,6 +207,17 @@ struct wpa_ptk { +@@ -218,6 +218,17 @@ struct wpa_ptk { size_t tk_len; }; @@ -33,7 +33,7 @@ Signed-off-by: Mathy Vanhoef * 00-50-f2:1 (OUI:OUI type) --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -785,6 +785,15 @@ static int wpa_supplicant_install_gtk(st +@@ -800,6 +800,15 @@ static int wpa_supplicant_install_gtk(st const u8 *_gtk = gd->gtk; u8 gtk_buf[32]; @@ -49,7 +49,7 @@ Signed-off-by: Mathy Vanhoef wpa_hexdump_key(MSG_DEBUG, "WPA: Group Key", gd->gtk, gd->gtk_len); wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Installing GTK to the driver (keyidx=%d tx=%d len=%d)", -@@ -819,6 +828,9 @@ static int wpa_supplicant_install_gtk(st +@@ -834,6 +843,9 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -59,7 +59,7 @@ Signed-off-by: Mathy Vanhoef return 0; } -@@ -925,6 +937,48 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -940,6 +952,48 @@ static int wpa_supplicant_pairwise_gtk(s } @@ -108,7 +108,7 @@ Signed-off-by: Mathy Vanhoef static int ieee80211w_set_keys(struct wpa_sm *sm, struct wpa_eapol_ie_parse *ie) { -@@ -935,30 +989,14 @@ static int ieee80211w_set_keys(struct wp +@@ -950,30 +1004,14 @@ static int ieee80211w_set_keys(struct wp if (ie->igtk) { size_t len; const struct wpa_igtk_kde *igtk; @@ -142,7 +142,7 @@ Signed-off-by: Mathy Vanhoef } return 0; -@@ -2451,7 +2489,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) +@@ -2491,7 +2529,7 @@ void wpa_sm_deinit(struct wpa_sm *sm) */ void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) { @@ -151,7 +151,7 @@ Signed-off-by: Mathy Vanhoef if (sm == NULL) return; -@@ -2477,7 +2515,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2517,7 +2555,7 @@ void wpa_sm_notify_assoc(struct wpa_sm * /* Prepare for the next transition */ wpa_ft_prepare_auth_request(sm, NULL); @@ -160,7 +160,7 @@ Signed-off-by: Mathy Vanhoef } #endif /* CONFIG_IEEE80211R */ #ifdef CONFIG_FILS -@@ -2487,11 +2525,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2527,11 +2565,11 @@ void wpa_sm_notify_assoc(struct wpa_sm * * AUTHENTICATED state to get the EAPOL port Authorized. */ wpa_supplicant_key_neg_complete(sm, sm->bssid, 1); @@ -174,7 +174,7 @@ Signed-off-by: Mathy Vanhoef /* * IEEE 802.11, 8.4.10: Delete PTK SA on (re)association if * this is not part of a Fast BSS Transition. -@@ -2501,6 +2539,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2541,6 +2579,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * os_memset(&sm->ptk, 0, sizeof(sm->ptk)); sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -185,7 +185,7 @@ Signed-off-by: Mathy Vanhoef } #ifdef CONFIG_TDLS -@@ -3052,6 +3094,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3117,6 +3159,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(sm->pmk, 0, sizeof(sm->pmk)); os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); @@ -196,7 +196,7 @@ Signed-off-by: Mathy Vanhoef #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); os_memset(sm->pmk_r0, 0, sizeof(sm->pmk_r0)); -@@ -3124,29 +3170,11 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3189,29 +3235,11 @@ int wpa_wnmsleep_install_key(struct wpa_ os_memset(&gd, 0, sizeof(gd)); #ifdef CONFIG_IEEE80211W } else if (subelem_id == WNM_SLEEP_SUBELEM_IGTK) { diff --git a/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch similarity index 84% rename from package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch rename to package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch index 650bf43e9..2093d25e9 100644 --- a/package/network/services/hostapd/patches/007-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch +++ b/package/network/services/hostapd/patches/002-Extend-protection-of-GTK-IGTK-reinstallation-of-WNM-.patch @@ -14,7 +14,7 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -780,14 +780,17 @@ struct wpa_gtk_data { +@@ -795,14 +795,17 @@ struct wpa_gtk_data { static int wpa_supplicant_install_gtk(struct wpa_sm *sm, const struct wpa_gtk_data *gd, @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use GTK to the driver (keyidx=%d tx=%d len=%d)", gd->keyidx, gd->tx, gd->gtk_len); -@@ -828,8 +831,14 @@ static int wpa_supplicant_install_gtk(st +@@ -843,8 +846,14 @@ static int wpa_supplicant_install_gtk(st } os_memset(gtk_buf, 0, sizeof(gtk_buf)); @@ -52,7 +52,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -923,7 +932,7 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -938,7 +947,7 @@ static int wpa_supplicant_pairwise_gtk(s (wpa_supplicant_check_group_cipher(sm, sm->group_cipher, gtk_len, gtk_len, &gd.key_rsc_len, &gd.alg) || @@ -61,7 +61,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: Failed to install GTK"); os_memset(&gd, 0, sizeof(gd)); -@@ -939,14 +948,18 @@ static int wpa_supplicant_pairwise_gtk(s +@@ -954,14 +963,18 @@ static int wpa_supplicant_pairwise_gtk(s #ifdef CONFIG_IEEE80211W static int wpa_supplicant_install_igtk(struct wpa_sm *sm, @@ -83,7 +83,7 @@ Signed-off-by: Jouni Malinen wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Not reinstalling already in-use IGTK to the driver (keyidx=%d)", keyidx); -@@ -971,8 +984,14 @@ static int wpa_supplicant_install_igtk(s +@@ -986,8 +999,14 @@ static int wpa_supplicant_install_igtk(s return -1; } @@ -100,7 +100,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -995,7 +1014,7 @@ static int ieee80211w_set_keys(struct wp +@@ -1010,7 +1029,7 @@ static int ieee80211w_set_keys(struct wp return -1; igtk = (const struct wpa_igtk_kde *) ie->igtk; @@ -109,7 +109,7 @@ Signed-off-by: Jouni Malinen return -1; } -@@ -1641,7 +1660,7 @@ static void wpa_supplicant_process_1_of_ +@@ -1659,7 +1678,7 @@ static void wpa_supplicant_process_1_of_ if (wpa_supplicant_rsc_relaxation(sm, key->key_rsc)) key_rsc = null_rsc; @@ -118,7 +118,7 @@ Signed-off-by: Jouni Malinen wpa_supplicant_send_2_of_2(sm, key, ver, key_info) < 0) goto failed; os_memset(&gd, 0, sizeof(gd)); -@@ -2540,8 +2559,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * +@@ -2580,8 +2599,10 @@ void wpa_sm_notify_assoc(struct wpa_sm * sm->tptk_set = 0; os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -129,7 +129,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ } -@@ -3095,8 +3116,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) +@@ -3160,8 +3181,10 @@ void wpa_sm_drop_sa(struct wpa_sm *sm) os_memset(&sm->ptk, 0, sizeof(sm->ptk)); os_memset(&sm->tptk, 0, sizeof(sm->tptk)); os_memset(&sm->gtk, 0, sizeof(sm->gtk)); @@ -140,7 +140,7 @@ Signed-off-by: Jouni Malinen #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211R os_memset(sm->xxkey, 0, sizeof(sm->xxkey)); -@@ -3161,7 +3184,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3226,7 +3249,7 @@ int wpa_wnmsleep_install_key(struct wpa_ wpa_hexdump_key(MSG_DEBUG, "Install GTK (WNM SLEEP)", gd.gtk, gd.gtk_len); @@ -149,7 +149,7 @@ Signed-off-by: Jouni Malinen os_memset(&gd, 0, sizeof(gd)); wpa_printf(MSG_DEBUG, "Failed to install the GTK in " "WNM mode"); -@@ -3173,7 +3196,7 @@ int wpa_wnmsleep_install_key(struct wpa_ +@@ -3238,7 +3261,7 @@ int wpa_wnmsleep_install_key(struct wpa_ const struct wpa_igtk_kde *igtk; igtk = (const struct wpa_igtk_kde *) (buf + 2); @@ -158,6 +158,15 @@ Signed-off-by: Jouni Malinen return -1; #endif /* CONFIG_IEEE80211W */ } else { +@@ -4121,7 +4144,7 @@ int fils_process_assoc_resp(struct wpa_s + os_memcpy(gd.gtk, kde.gtk + 2, kde.gtk_len - 2); + + wpa_printf(MSG_DEBUG, "FILS: Set GTK to driver"); +- if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery) < 0) { ++ if (wpa_supplicant_install_gtk(sm, &gd, elems.key_delivery, 0) < 0) { + wpa_printf(MSG_DEBUG, "FILS: Failed to set GTK"); + goto fail; + } --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -32,8 +32,10 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch b/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch deleted file mode 100644 index 6db1e9b34..000000000 --- a/package/network/services/hostapd/patches/002-Fix-duplicate-Reassociation-Request-frame-dropping.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Jouni Malinen -Date: Sat, 14 Jan 2017 01:04:31 +0200 -Subject: [PATCH] Fix duplicate Reassociation Request frame dropping - -Relational operators (==) have higher precedence than the ternary -conditional in C. The last_subtype check for association/reassociation -was broken due to incorrect assumption about the precedence. Fix this by -adding parenthesis around the ternary conditional. - -The previous implementation worked for Association Request frames by -accident since WLAN_FC_STYPE_ASSOC_REQ happens to have value 0 and when -the last receive frame was an Association Request frame, the -sta->last_subtype == reassoc check was true and non-zero -WLAN_FC_STYPE_REASSOC_REQ was interpreted as true. However, this was -broken for Reassociation Request frame. reassoc == 1 in that case could -have matched received Association Response frame (subtype == 1), but -those are not received in AP mode and as such, this did not break other -behavior apart from not being able to drop duplicated Reassociation -Request frames. - -Signed-off-by: Jouni Malinen ---- - ---- a/src/ap/ieee802_11.c -+++ b/src/ap/ieee802_11.c -@@ -2485,8 +2485,8 @@ static void handle_assoc(struct hostapd_ - if ((fc & WLAN_FC_RETRY) && - sta->last_seq_ctrl != WLAN_INVALID_MGMT_SEQ && - sta->last_seq_ctrl == seq_ctrl && -- sta->last_subtype == reassoc ? WLAN_FC_STYPE_REASSOC_REQ : -- WLAN_FC_STYPE_ASSOC_REQ) { -+ sta->last_subtype == (reassoc ? WLAN_FC_STYPE_REASSOC_REQ : -+ WLAN_FC_STYPE_ASSOC_REQ)) { - hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, - HOSTAPD_LEVEL_DEBUG, - "Drop repeated association frame seq_ctrl=0x%x", diff --git a/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch similarity index 76% rename from package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch rename to package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch index e0f1773f2..30679e25c 100644 --- a/package/network/services/hostapd/patches/008-Prevent-installation-of-an-all-zero-TK.patch +++ b/package/network/services/hostapd/patches/003-Prevent-installation-of-an-all-zero-TK.patch @@ -17,7 +17,7 @@ Signed-off-by: Mathy Vanhoef --- a/src/common/wpa_common.h +++ b/src/common/wpa_common.h -@@ -205,6 +205,7 @@ struct wpa_ptk { +@@ -216,6 +216,7 @@ struct wpa_ptk { size_t kck_len; size_t kek_len; size_t tk_len; @@ -27,7 +27,7 @@ Signed-off-by: Mathy Vanhoef struct wpa_gtk { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -581,7 +581,6 @@ static void wpa_supplicant_process_1_of_ +@@ -594,7 +594,6 @@ static void wpa_supplicant_process_1_of_ os_memset(buf, 0, sizeof(buf)); } sm->tptk_set = 1; @@ -35,7 +35,7 @@ Signed-off-by: Mathy Vanhoef kde = sm->assoc_wpa_ie; kde_len = sm->assoc_wpa_ie_len; -@@ -686,7 +685,7 @@ static int wpa_supplicant_install_ptk(st +@@ -701,7 +700,7 @@ static int wpa_supplicant_install_ptk(st enum wpa_alg alg; const u8 *key_rsc; @@ -44,7 +44,7 @@ Signed-off-by: Mathy Vanhoef wpa_dbg(sm->ctx->msg_ctx, MSG_DEBUG, "WPA: Do not re-install same PTK to the driver"); return 0; -@@ -730,7 +729,7 @@ static int wpa_supplicant_install_ptk(st +@@ -745,7 +744,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -53,6 +53,14 @@ Signed-off-by: Mathy Vanhoef if (sm->wpa_ptk_rekey) { eloop_cancel_timeout(wpa_sm_rekey_ptk, sm, NULL); +@@ -4172,6 +4171,7 @@ int fils_process_assoc_resp(struct wpa_s + * takes care of association frame encryption/decryption. */ + /* TK is not needed anymore in supplicant */ + os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); ++ sm->ptk.installed = 1; + + /* FILS HLP Container */ + fils_process_hlp_container(sm, ie_start, end - ie_start); --- a/src/rsn_supp/wpa_i.h +++ b/src/rsn_supp/wpa_i.h @@ -24,7 +24,6 @@ struct wpa_sm { diff --git a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch b/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch deleted file mode 100644 index 0a3c27f89..000000000 --- a/package/network/services/hostapd/patches/003-RSN-IBSS-Fix-TK-clearing-on-Authentication-frame-RX.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: Jouni Malinen -Date: Sat, 14 Jan 2017 13:56:18 +0200 -Subject: [PATCH] RSN IBSS: Fix TK clearing on Authentication frame RX - -When wpa_supplicant was processing a received Authentication frame (seq -1) from a peer STA for which there was already a TK configured to the -driver, debug log claimed that the PTK gets cleared, but the actual -call to clear the key was actually dropped due to AUTH vs. SUPP set_key -selection. Fix this by explicitly clearing the TK in case it was set -and an Authentication frame (seq 1) is received. - -This fixes some cases where EAPOL-Key frames were sent encrypted using -the old key when a peer STA restarted itself and lost the key and had to -re-join the IBSS. Previously, that state required timing out the 4-way -handshake and Deauthentication frame exchange to recover. - -Signed-off-by: Jouni Malinen ---- - ---- a/wpa_supplicant/ibss_rsn.c -+++ b/wpa_supplicant/ibss_rsn.c -@@ -838,6 +838,18 @@ static void ibss_rsn_handle_auth_1_of_2( - MAC2STR(addr)); - - if (peer && -+ peer->authentication_status & (IBSS_RSN_SET_PTK_SUPP | -+ IBSS_RSN_SET_PTK_AUTH)) { -+ /* Clear the TK for this pair to allow recovery from the case -+ * where the peer STA has restarted and lost its key while we -+ * still have a pairwise key configured. */ -+ wpa_printf(MSG_DEBUG, "RSN: Clear pairwise key for peer " -+ MACSTR, MAC2STR(addr)); -+ wpa_drv_set_key(ibss_rsn->wpa_s, WPA_ALG_NONE, addr, 0, 0, -+ NULL, 0, NULL, 0); -+ } -+ -+ if (peer && - peer->authentication_status & IBSS_RSN_AUTH_EAPOL_BY_PEER) { - if (peer->own_auth_tx.sec) { - struct os_reltime now, diff; diff --git a/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch similarity index 94% rename from package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch rename to package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch index 8d9bd42ac..6f28e7431 100644 --- a/package/network/services/hostapd/patches/009-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch +++ b/package/network/services/hostapd/patches/004-Fix-PTK-rekeying-to-generate-a-new-ANonce.patch @@ -16,7 +16,7 @@ Signed-off-by: Jouni Malinen --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -1912,6 +1912,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) +@@ -1951,6 +1951,21 @@ SM_STATE(WPA_PTK, AUTHENTICATION2) } @@ -38,7 +38,7 @@ Signed-off-by: Jouni Malinen SM_STATE(WPA_PTK, INITPMK) { u8 msk[2 * PMK_LEN]; -@@ -2932,9 +2947,12 @@ SM_STEP(WPA_PTK) +@@ -3116,9 +3131,12 @@ SM_STEP(WPA_PTK) SM_ENTER(WPA_PTK, AUTHENTICATION); else if (sm->ReAuthenticationRequest) SM_ENTER(WPA_PTK, AUTHENTICATION2); diff --git a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch b/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch deleted file mode 100644 index 3417b5ac3..000000000 --- a/package/network/services/hostapd/patches/004-hostapd-Add-possibility-to-send-debug-messages-to-sy.patch +++ /dev/null @@ -1,145 +0,0 @@ -From cc3dae85bd694506cdea66ae532d452fb8716297 Mon Sep 17 00:00:00 2001 -From: Wojciech Dubowik -Date: Mon, 23 Jan 2017 13:55:04 +0100 -Subject: [PATCH] hostapd: Add possibility to send debug messages to syslog - -We can only send module specific messages to syslog and not debug -messages printed with wpa_printf. Add an extra command line parameter -'-s' to allow it. The feature is enabled with compile flag -CONFIG_DEBUG_SYSLOG as for wpa_supplicant and behaves in the same manner -as the wpa_supplicant -s command line argument. - -Signed-off-by: Wojciech Dubowik ---- - hostapd/Android.mk | 4 ++++ - hostapd/Makefile | 4 ++++ - hostapd/defconfig | 3 +++ - hostapd/main.c | 19 ++++++++++++++++++- - src/utils/wpa_debug.c | 2 +- - src/utils/wpa_debug.h | 3 +++ - 6 files changed, 33 insertions(+), 2 deletions(-) - ---- a/hostapd/Android.mk -+++ b/hostapd/Android.mk -@@ -952,6 +952,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG - L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG - endif - -+ifdef CONFIG_DEBUG_SYSLOG -+L_CFLAGS += -DCONFIG_DEBUG_SYSLOG -+endif -+ - ifdef CONFIG_DEBUG_LINUX_TRACING - L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING - endif ---- a/hostapd/Makefile -+++ b/hostapd/Makefile -@@ -997,6 +997,10 @@ ifdef CONFIG_NO_STDOUT_DEBUG - CFLAGS += -DCONFIG_NO_STDOUT_DEBUG - endif - -+ifdef CONFIG_DEBUG_SYSLOG -+CFLAGS += -DCONFIG_DEBUG_SYSLOG -+endif -+ - ifdef CONFIG_DEBUG_LINUX_TRACING - CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING - endif ---- a/hostapd/defconfig -+++ b/hostapd/defconfig -@@ -166,6 +166,9 @@ CONFIG_IPV6=y - # Disabled by default. - #CONFIG_DEBUG_FILE=y - -+# Send debug messages to syslog instead of stdout -+#CONFIG_DEBUG_SYSLOG=y -+ - # Add support for sending all debug messages (regardless of debug verbosity) - # to the Linux kernel tracing facility. This helps debug the entire stack by - # making it easy to record everything happening from the driver up into the ---- a/hostapd/main.c -+++ b/hostapd/main.c -@@ -108,6 +108,10 @@ static void hostapd_logger_cb(void *ctx, - module_str ? module_str : "", - module_str ? ": " : "", txt); - -+#ifdef CONFIG_DEBUG_SYSLOG -+ if (wpa_debug_syslog) -+ conf_stdout = 0; -+#endif /* CONFIG_DEBUG_SYSLOG */ - if ((conf_stdout & module) && level >= conf_stdout_level) { - wpa_debug_print_timestamp(); - wpa_printf(MSG_INFO, "%s", format); -@@ -484,6 +488,9 @@ static void usage(void) - " (records all messages regardless of debug verbosity)\n" - #endif /* CONFIG_DEBUG_LINUX_TRACING */ - " -i list of interface names to use\n" -+#ifdef CONFIG_DEBUG_SYSLOG -+ " -s log output to syslog instead of stdout\n" -+#endif /* CONFIG_DEBUG_SYSLOG */ - " -S start all the interfaces synchronously\n" - " -t include timestamps in some debug messages\n" - " -v show hostapd version\n"); -@@ -661,7 +668,7 @@ int main(int argc, char *argv[]) - dl_list_init(&interfaces.global_ctrl_dst); - - for (;;) { -- c = getopt(argc, argv, "b:Bde:f:hi:KP:STtu:vg:G:"); -+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); - if (c < 0) - break; - switch (c) { -@@ -718,6 +725,11 @@ int main(int argc, char *argv[]) - bss_config = tmp_bss; - bss_config[num_bss_configs++] = optarg; - break; -+#ifdef CONFIG_DEBUG_SYSLOG -+ case 's': -+ wpa_debug_syslog = 1; -+ break; -+#endif /* CONFIG_DEBUG_SYSLOG */ - case 'S': - start_ifaces_in_sync = 1; - break; -@@ -746,6 +758,10 @@ int main(int argc, char *argv[]) - wpa_debug_open_file(log_file); - else - wpa_debug_setup_stdout(); -+#ifdef CONFIG_DEBUG_SYSLOG -+ if (wpa_debug_syslog) -+ wpa_debug_open_syslog(); -+#endif /* CONFIG_DEBUG_SYSLOG */ - #ifdef CONFIG_DEBUG_LINUX_TRACING - if (enable_trace_dbg) { - int tret = wpa_debug_open_linux_tracing(); -@@ -882,6 +898,7 @@ int main(int argc, char *argv[]) - hostapd_global_deinit(pid_file, interfaces.eloop_initialized); - os_free(pid_file); - -+ wpa_debug_close_syslog(); - if (log_file) - wpa_debug_close_file(); - wpa_debug_close_linux_tracing(); ---- a/src/utils/wpa_debug.c -+++ b/src/utils/wpa_debug.c -@@ -13,7 +13,7 @@ - #ifdef CONFIG_DEBUG_SYSLOG - #include - --static int wpa_debug_syslog = 0; -+int wpa_debug_syslog = 0; - #endif /* CONFIG_DEBUG_SYSLOG */ - - #ifdef CONFIG_DEBUG_LINUX_TRACING ---- a/src/utils/wpa_debug.h -+++ b/src/utils/wpa_debug.h -@@ -14,6 +14,9 @@ - extern int wpa_debug_level; - extern int wpa_debug_show_keys; - extern int wpa_debug_timestamp; -+#ifdef CONFIG_DEBUG_SYSLOG -+extern int wpa_debug_syslog; -+#endif /* CONFIG_DEBUG_SYSLOG */ - - /* Debugging function - conditional printf and hex dump. Driver wrappers can - * use these for debugging purposes. */ diff --git a/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch similarity index 97% rename from package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch rename to package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch index d6e500b11..2ca05dd64 100644 --- a/package/network/services/hostapd/patches/010-TDLS-Reject-TPK-TK-reconfiguration.patch +++ b/package/network/services/hostapd/patches/005-TDLS-Reject-TPK-TK-reconfiguration.patch @@ -67,7 +67,7 @@ Signed-off-by: Jouni Malinen return 0; } -@@ -696,7 +714,7 @@ static void wpa_tdls_peer_clear(struct w +@@ -695,7 +713,7 @@ static void wpa_tdls_peer_clear(struct w peer->cipher = 0; peer->qos_info = 0; peer->wmm_capable = 0; @@ -76,7 +76,7 @@ Signed-off-by: Jouni Malinen peer->chan_switch_enabled = 0; os_memset(&peer->tpk, 0, sizeof(peer->tpk)); os_memset(peer->inonce, 0, WPA_NONCE_LEN); -@@ -1159,6 +1177,7 @@ skip_rsnie: +@@ -1158,6 +1176,7 @@ skip_rsnie: wpa_tdls_peer_free(sm, peer); return -1; } diff --git a/package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch b/package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch similarity index 100% rename from package/network/services/hostapd/patches/011-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch rename to package/network/services/hostapd/patches/006-WNM-Ignore-WNM-Sleep-Mode-Response-without-pending-r.patch diff --git a/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch similarity index 84% rename from package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch rename to package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch index 12904faf1..7712ce519 100644 --- a/package/network/services/hostapd/patches/012-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch +++ b/package/network/services/hostapd/patches/007-FT-Do-not-allow-multiple-Reassociation-Response-fram.patch @@ -15,16 +15,16 @@ Signed-off-by: Jouni Malinen --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2568,6 +2568,9 @@ void wpa_sm_notify_assoc(struct wpa_sm * - #ifdef CONFIG_TDLS - wpa_tdls_assoc(sm); - #endif /* CONFIG_TDLS */ +@@ -2637,6 +2637,9 @@ void wpa_sm_notify_disassoc(struct wpa_s + #ifdef CONFIG_FILS + sm->fils_completed = 0; + #endif /* CONFIG_FILS */ +#ifdef CONFIG_IEEE80211R + sm->ft_reassoc_completed = 0; +#endif /* CONFIG_IEEE80211R */ - #ifdef CONFIG_P2P - os_memset(sm->p2p_ip_addr, 0, sizeof(sm->p2p_ip_addr)); + /* Keys are not needed in the WPA state machine anymore */ + wpa_sm_drop_sa(sm); --- a/src/rsn_supp/wpa_ft.c +++ b/src/rsn_supp/wpa_ft.c @@ -153,6 +153,7 @@ static u8 * wpa_ft_gen_req_ies(struct wp @@ -35,7 +35,7 @@ Signed-off-by: Jouni Malinen buf_len = 2 + sizeof(struct rsn_mdie) + 2 + sizeof(struct rsn_ftie) + 2 + sm->r0kh_id_len + ric_ies_len + 100; -@@ -681,6 +682,11 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -687,6 +688,11 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } @@ -47,7 +47,7 @@ Signed-off-by: Jouni Malinen if (wpa_ft_parse_ies(ies, ies_len, &parse) < 0) { wpa_printf(MSG_DEBUG, "FT: Failed to parse IEs"); return -1; -@@ -781,6 +787,8 @@ int wpa_ft_validate_reassoc_resp(struct +@@ -787,6 +793,8 @@ int wpa_ft_validate_reassoc_resp(struct return -1; } diff --git a/package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch b/package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch similarity index 100% rename from package/network/services/hostapd/patches/014-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch rename to package/network/services/hostapd/patches/008-WPA-Extra-defense-against-PTK-reinstalls-in-4-way-ha.patch diff --git a/package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch b/package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch similarity index 100% rename from package/network/services/hostapd/patches/015-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch rename to package/network/services/hostapd/patches/009-Clear-PMK-length-and-check-for-this-when-deriving-PT.patch diff --git a/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch similarity index 90% rename from package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch rename to package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch index e413521cd..19165cce2 100644 --- a/package/network/services/hostapd/patches/016-Optional-AP-side-workaround-for-key-reinstallation-a.patch +++ b/package/network/services/hostapd/patches/010-Optional-AP-side-workaround-for-key-reinstallation-a.patch @@ -48,7 +48,7 @@ Signed-off-by: Jouni Malinen --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2515,6 +2515,8 @@ static int hostapd_config_fill(struct ho +@@ -2542,6 +2542,8 @@ static int hostapd_config_fill(struct ho return 1; } bss->wpa_pairwise_update_count = (u32) val; @@ -59,17 +59,17 @@ Signed-off-by: Jouni Malinen if (len < 8 || len > 63) { --- a/hostapd/defconfig +++ b/hostapd/defconfig -@@ -355,3 +355,7 @@ CONFIG_IPV6=y - # Include internal line edit mode in hostapd_cli. This can be used to provide - # limited command line editing and history support. - #CONFIG_WPA_CLI_EDIT=y +@@ -372,3 +372,7 @@ CONFIG_IPV6=y + # Opportunistic Wireless Encryption (OWE) + # Experimental implementation of draft-harkins-owe-07.txt + #CONFIG_OWE=y + +# Override default value for the wpa_disable_eapol_key_retries configuration +# parameter. See that parameter in hostapd.conf for more details. +#CFLAGS += -DDEFAULT_WPA_DISABLE_EAPOL_KEY_RETRIES=1 --- a/hostapd/hostapd.conf +++ b/hostapd/hostapd.conf -@@ -1240,6 +1240,30 @@ own_ip_addr=127.0.0.1 +@@ -1315,6 +1315,30 @@ own_ip_addr=127.0.0.1 # Range 1..4294967295; default: 4 #wpa_pairwise_update_count=4 @@ -102,7 +102,7 @@ Signed-off-by: Jouni Malinen # authentication and key handshake before actually associating with a new AP. --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c -@@ -36,6 +36,10 @@ static void hostapd_config_free_vlan(str +@@ -37,6 +37,10 @@ static void hostapd_config_free_vlan(str } @@ -113,7 +113,7 @@ Signed-off-by: Jouni Malinen void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) { dl_list_init(&bss->anqp_elem); -@@ -57,6 +61,8 @@ void hostapd_config_defaults_bss(struct +@@ -58,6 +62,8 @@ void hostapd_config_defaults_bss(struct bss->wpa_gmk_rekey = 86400; bss->wpa_group_update_count = 4; bss->wpa_pairwise_update_count = 4; @@ -124,7 +124,7 @@ Signed-off-by: Jouni Malinen bss->wpa_group = WPA_CIPHER_TKIP; --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -332,6 +332,7 @@ struct hostapd_bss_config { +@@ -333,6 +333,7 @@ struct hostapd_bss_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -134,7 +134,7 @@ Signed-off-by: Jouni Malinen char *rsn_preauth_interfaces; --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -63,6 +63,7 @@ static u8 * ieee80211w_kde_add(struct wp +@@ -65,6 +65,7 @@ static u8 * ieee80211w_kde_add(struct wp static const u32 eapol_key_timeout_first = 100; /* ms */ static const u32 eapol_key_timeout_subseq = 1000; /* ms */ static const u32 eapol_key_timeout_first_group = 500; /* ms */ @@ -142,7 +142,7 @@ Signed-off-by: Jouni Malinen /* TODO: make these configurable */ static const int dot11RSNAConfigPMKLifetime = 43200; -@@ -1629,6 +1630,9 @@ static void wpa_send_eapol(struct wpa_au +@@ -1653,6 +1654,9 @@ static void wpa_send_eapol(struct wpa_au eapol_key_timeout_first_group; else timeout_ms = eapol_key_timeout_subseq; @@ -152,7 +152,7 @@ Signed-off-by: Jouni Malinen if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) sm->pending_1_of_4_timeout = 1; wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " -@@ -2700,6 +2704,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) +@@ -2882,6 +2886,11 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) sm->TimeoutEvt = FALSE; sm->TimeoutCtr++; @@ -164,7 +164,7 @@ Signed-off-by: Jouni Malinen if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3027,7 +3036,9 @@ SM_STEP(WPA_PTK) +@@ -3220,7 +3229,9 @@ SM_STEP(WPA_PTK) sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK, PTKINITDONE); else if (sm->TimeoutCtr > @@ -175,7 +175,7 @@ Signed-off-by: Jouni Malinen wpa_auth->dot11RSNA4WayHandshakeFailures++; wpa_auth_vlogger( sm->wpa_auth, sm->addr, LOGGER_DEBUG, -@@ -3067,6 +3078,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING +@@ -3260,6 +3271,11 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); sm->GTimeoutCtr++; @@ -187,7 +187,7 @@ Signed-off-by: Jouni Malinen if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { /* No point in sending the EAPOL-Key - we will disconnect * immediately following this. */ -@@ -3165,7 +3181,9 @@ SM_STEP(WPA_PTK_GROUP) +@@ -3363,7 +3379,9 @@ SM_STEP(WPA_PTK_GROUP) !sm->EAPOLKeyPairwise && sm->MICVerified) SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); else if (sm->GTimeoutCtr > @@ -200,7 +200,7 @@ Signed-off-by: Jouni Malinen SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); --- a/src/ap/wpa_auth.h +++ b/src/ap/wpa_auth.h -@@ -146,6 +146,7 @@ struct wpa_auth_config { +@@ -165,6 +165,7 @@ struct wpa_auth_config { int wpa_ptk_rekey; u32 wpa_group_update_count; u32 wpa_pairwise_update_count; @@ -210,7 +210,7 @@ Signed-off-by: Jouni Malinen int eapol_version; --- a/src/ap/wpa_auth_glue.c +++ b/src/ap/wpa_auth_glue.c -@@ -42,6 +42,8 @@ static void hostapd_wpa_auth_conf(struct +@@ -45,6 +45,8 @@ static void hostapd_wpa_auth_conf(struct wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; wconf->wpa_group_update_count = conf->wpa_group_update_count; diff --git a/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch similarity index 81% rename from package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch rename to package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch index 9655b5cb1..5cc2f7b17 100644 --- a/package/network/services/hostapd/patches/017-Additional-consistentcy-checks-for-PTK-component-len.patch +++ b/package/network/services/hostapd/patches/011-Additional-consistentcy-checks-for-PTK-component-len.patch @@ -15,9 +15,9 @@ Signed-off-by: Jouni Malinen --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -93,6 +93,12 @@ int wpa_eapol_key_mic(const u8 *key, siz +@@ -100,6 +100,12 @@ int wpa_eapol_key_mic(const u8 *key, siz { - u8 hash[SHA384_MAC_LEN]; + u8 hash[SHA512_MAC_LEN]; + if (key_len == 0) { + wpa_printf(MSG_DEBUG, @@ -30,7 +30,7 @@ Signed-off-by: Jouni Malinen case WPA_KEY_INFO_TYPE_HMAC_MD5_RC4: --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -710,6 +710,11 @@ static int wpa_supplicant_install_ptk(st +@@ -725,6 +725,11 @@ static int wpa_supplicant_install_ptk(st alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -42,7 +42,7 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); if (sm->proto == WPA_PROTO_RSN || sm->proto == WPA_PROTO_OSEN) { -@@ -730,6 +735,7 @@ static int wpa_supplicant_install_ptk(st +@@ -745,6 +750,7 @@ static int wpa_supplicant_install_ptk(st /* TK is not needed anymore in supplicant */ os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); @@ -50,7 +50,7 @@ Signed-off-by: Jouni Malinen sm->ptk.installed = 1; if (sm->wpa_ptk_rekey) { -@@ -1699,9 +1705,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1717,9 +1723,10 @@ static int wpa_supplicant_verify_eapol_k os_memcpy(mic, key + 1, mic_len); if (sm->tptk_set) { os_memset(key + 1, 0, mic_len); @@ -64,7 +64,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC " "when using TPTK - ignoring TPTK"); -@@ -1724,9 +1731,10 @@ static int wpa_supplicant_verify_eapol_k +@@ -1742,9 +1749,10 @@ static int wpa_supplicant_verify_eapol_k if (!ok && sm->ptk_set) { os_memset(key + 1, 0, mic_len); @@ -78,7 +78,7 @@ Signed-off-by: Jouni Malinen wpa_msg(sm->ctx->msg_ctx, MSG_WARNING, "WPA: Invalid EAPOL-Key MIC - " "dropping packet"); -@@ -3689,6 +3697,11 @@ int fils_process_assoc_resp(struct wpa_s +@@ -4167,6 +4175,11 @@ int fils_process_assoc_resp(struct wpa_s alg = wpa_cipher_to_alg(sm->pairwise_cipher); keylen = wpa_cipher_key_len(sm->pairwise_cipher); @@ -90,3 +90,11 @@ Signed-off-by: Jouni Malinen rsclen = wpa_cipher_rsc_len(sm->pairwise_cipher); wpa_hexdump_key(MSG_DEBUG, "FILS: Set TK to driver", sm->ptk.tk, keylen); +@@ -4183,6 +4196,7 @@ int fils_process_assoc_resp(struct wpa_s + * takes care of association frame encryption/decryption. */ + /* TK is not needed anymore in supplicant */ + os_memset(sm->ptk.tk, 0, WPA_TK_MAX_LEN); ++ sm->ptk.tk_len = 0; + sm->ptk.installed = 1; + + /* FILS HLP Container */ diff --git a/package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch b/package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch similarity index 100% rename from package/network/services/hostapd/patches/018-Clear-BSSID-information-in-supplicant-state-machine-.patch rename to package/network/services/hostapd/patches/012-Clear-BSSID-information-in-supplicant-state-machine-.patch diff --git a/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch b/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch deleted file mode 100644 index 623c2be34..000000000 --- a/package/network/services/hostapd/patches/013-Add-hostapd-options-wpa_group_update_count-and-wpa_p.patch +++ /dev/null @@ -1,305 +0,0 @@ -From 41f140d38617e1fd3fa88c1667c1bce0cad79224 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?G=C3=BCnther=20Kelleter?= -Date: Thu, 5 Jan 2017 17:00:33 +0100 -Subject: [PATCH] Add hostapd options wpa_group_update_count and - wpa_pairwise_update_count -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -wpa_group_update_count and wpa_pairwise_update_count can now be used to -set the GTK and PTK rekey retry limits (dot11RSNAConfigGroupUpdateCount -and dot11RSNAConfigPairwiseUpdateCount). Defaults set to current -hardcoded value (4). - -Some stations may suffer from frequent deauthentications due to GTK -rekey failures: EAPOL 1/2 frame is not answered during the total timeout -period of currently ~3.5 seconds. For example, a Galaxy S6 with Android -6.0.1 appears to go into power save mode for up to 5 seconds. Increasing -wpa_group_update_count to 6 fixed this issue. - -Signed-off-by: Günther Kelleter ---- - hostapd/config_file.c | 22 ++++++++++++++++++++++ - hostapd/hostapd.conf | 11 +++++++++++ - src/ap/ap_config.c | 2 ++ - src/ap/ap_config.h | 2 ++ - src/ap/wpa_auth.c | 37 ++++++++++++++++++------------------- - src/ap/wpa_auth.h | 2 ++ - src/ap/wpa_auth_glue.c | 2 ++ - src/ap/wpa_auth_i.h | 4 ++-- - wpa_supplicant/ibss_rsn.c | 2 ++ - wpa_supplicant/mesh_rsn.c | 2 ++ - 10 files changed, 65 insertions(+), 21 deletions(-) - -diff --git a/hostapd/config_file.c b/hostapd/config_file.c -index 8cfa198c3..02693a5b1 100644 ---- a/hostapd/config_file.c -+++ b/hostapd/config_file.c -@@ -2489,6 +2489,28 @@ static int hostapd_config_fill(struct hostapd_config *conf, - bss->wpa_gmk_rekey = atoi(pos); - } else if (os_strcmp(buf, "wpa_ptk_rekey") == 0) { - bss->wpa_ptk_rekey = atoi(pos); -+ } else if (os_strcmp(buf, "wpa_group_update_count") == 0) { -+ char *endp; -+ unsigned long val = strtoul(pos, &endp, 0); -+ -+ if (*endp || val < 1 || val > (u32) -1) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid wpa_group_update_count=%lu; allowed range 1..4294967295", -+ line, val); -+ return 1; -+ } -+ bss->wpa_group_update_count = (u32) val; -+ } else if (os_strcmp(buf, "wpa_pairwise_update_count") == 0) { -+ char *endp; -+ unsigned long val = strtoul(pos, &endp, 0); -+ -+ if (*endp || val < 1 || val > (u32) -1) { -+ wpa_printf(MSG_ERROR, -+ "Line %d: Invalid wpa_pairwise_update_count=%lu; allowed range 1..4294967295", -+ line, val); -+ return 1; -+ } -+ bss->wpa_pairwise_update_count = (u32) val; - } else if (os_strcmp(buf, "wpa_passphrase") == 0) { - int len = os_strlen(pos); - if (len < 8 || len > 63) { -diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf -index 314f3842b..1fb1bd987 100644 ---- a/hostapd/hostapd.conf -+++ b/hostapd/hostapd.conf -@@ -1221,6 +1221,11 @@ own_ip_addr=127.0.0.1 - # (dot11RSNAConfigGroupRekeyStrict) - #wpa_strict_rekey=1 - -+# The number of times EAPOL-Key Message 1/2 in the RSN Group Key Handshake is -+#retried per GTK Handshake attempt. (dot11RSNAConfigGroupUpdateCount) -+# Range 1..4294967295; default: 4 -+#wpa_group_update_count=4 -+ - # Time interval for rekeying GMK (master key used internally to generate GTKs - # (in seconds). - #wpa_gmk_rekey=86400 -@@ -1229,6 +1234,12 @@ own_ip_addr=127.0.0.1 - # PTK to mitigate some attacks against TKIP deficiencies. - #wpa_ptk_rekey=600 - -+# The number of times EAPOL-Key Message 1/4 and Message 3/4 in the RSN 4-Way -+# Handshake are retried per 4-Way Handshake attempt. -+# (dot11RSNAConfigPairwiseUpdateCount) -+# Range 1..4294967295; default: 4 -+#wpa_pairwise_update_count=4 -+ - # Enable IEEE 802.11i/RSN/WPA2 pre-authentication. This is used to speed up - # roaming be pre-authenticating IEEE 802.1X/EAP part of the full RSN - # authentication and key handshake before actually associating with a new AP. -diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c -index c2b80ad97..9abcab7fb 100644 ---- a/src/ap/ap_config.c -+++ b/src/ap/ap_config.c -@@ -56,6 +56,8 @@ void hostapd_config_defaults_bss(struct hostapd_bss_config *bss) - - bss->wpa_group_rekey = 600; - bss->wpa_gmk_rekey = 86400; -+ bss->wpa_group_update_count = 4; -+ bss->wpa_pairwise_update_count = 4; - bss->wpa_key_mgmt = WPA_KEY_MGMT_PSK; - bss->wpa_pairwise = WPA_CIPHER_TKIP; - bss->wpa_group = WPA_CIPHER_TKIP; -diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h -index 31b1e7762..7495dc96f 100644 ---- a/src/ap/ap_config.h -+++ b/src/ap/ap_config.h -@@ -330,6 +330,8 @@ struct hostapd_bss_config { - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; -+ u32 wpa_group_update_count; -+ u32 wpa_pairwise_update_count; - int rsn_pairwise; - int rsn_preauth; - char *rsn_preauth_interfaces; -diff --git a/src/ap/wpa_auth.c b/src/ap/wpa_auth.c -index 0bd901fbf..8c082f426 100644 ---- a/src/ap/wpa_auth.c -+++ b/src/ap/wpa_auth.c -@@ -60,8 +60,6 @@ static void wpa_group_put(struct wpa_authenticator *wpa_auth, - struct wpa_group *group); - static u8 * ieee80211w_kde_add(struct wpa_state_machine *sm, u8 *pos); - --static const u32 dot11RSNAConfigGroupUpdateCount = 4; --static const u32 dot11RSNAConfigPairwiseUpdateCount = 4; - static const u32 eapol_key_timeout_first = 100; /* ms */ - static const u32 eapol_key_timeout_subseq = 1000; /* ms */ - static const u32 eapol_key_timeout_first_group = 500; /* ms */ -@@ -1623,7 +1621,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, - { - int timeout_ms; - int pairwise = key_info & WPA_KEY_INFO_KEY_TYPE; -- int ctr; -+ u32 ctr; - - if (sm == NULL) - return; -@@ -1640,7 +1638,7 @@ static void wpa_send_eapol(struct wpa_authenticator *wpa_auth, - if (pairwise && ctr == 1 && !(key_info & WPA_KEY_INFO_MIC)) - sm->pending_1_of_4_timeout = 1; - wpa_printf(MSG_DEBUG, "WPA: Use EAPOL-Key timeout of %u ms (retry " -- "counter %d)", timeout_ms, ctr); -+ "counter %u)", timeout_ms, ctr); - eloop_register_timeout(timeout_ms / 1000, (timeout_ms % 1000) * 1000, - wpa_send_eapol_timeout, wpa_auth, sm); - } -@@ -2002,7 +2000,7 @@ SM_STATE(WPA_PTK, PTKSTART) - sm->alt_snonce_valid = FALSE; - - sm->TimeoutCtr++; -- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { -+ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -2693,7 +2691,7 @@ SM_STATE(WPA_PTK, PTKINITNEGOTIATING) - sm->TimeoutEvt = FALSE; - - sm->TimeoutCtr++; -- if (sm->TimeoutCtr > (int) dot11RSNAConfigPairwiseUpdateCount) { -+ if (sm->TimeoutCtr > sm->wpa_auth->conf.wpa_pairwise_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -2988,11 +2986,12 @@ SM_STEP(WPA_PTK) - sm->EAPOLKeyPairwise) - SM_ENTER(WPA_PTK, PTKCALCNEGOTIATING); - else if (sm->TimeoutCtr > -- (int) dot11RSNAConfigPairwiseUpdateCount) { -+ sm->wpa_auth->conf.wpa_pairwise_update_count) { - wpa_auth->dot11RSNA4WayHandshakeFailures++; -- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, -- "PTKSTART: Retry limit %d reached", -- dot11RSNAConfigPairwiseUpdateCount); -+ wpa_auth_vlogger( -+ sm->wpa_auth, sm->addr, LOGGER_DEBUG, -+ "PTKSTART: Retry limit %u reached", -+ sm->wpa_auth->conf.wpa_pairwise_update_count); - SM_ENTER(WPA_PTK, DISCONNECT); - } else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK, PTKSTART); -@@ -3016,12 +3015,12 @@ SM_STEP(WPA_PTK) - sm->EAPOLKeyPairwise && sm->MICVerified) - SM_ENTER(WPA_PTK, PTKINITDONE); - else if (sm->TimeoutCtr > -- (int) dot11RSNAConfigPairwiseUpdateCount) { -+ sm->wpa_auth->conf.wpa_pairwise_update_count) { - wpa_auth->dot11RSNA4WayHandshakeFailures++; -- wpa_auth_vlogger(sm->wpa_auth, sm->addr, LOGGER_DEBUG, -- "PTKINITNEGOTIATING: Retry limit %d " -- "reached", -- dot11RSNAConfigPairwiseUpdateCount); -+ wpa_auth_vlogger( -+ sm->wpa_auth, sm->addr, LOGGER_DEBUG, -+ "PTKINITNEGOTIATING: Retry limit %u reached", -+ sm->wpa_auth->conf.wpa_pairwise_update_count); - SM_ENTER(WPA_PTK, DISCONNECT); - } else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK, PTKINITNEGOTIATING); -@@ -3056,7 +3055,7 @@ SM_STATE(WPA_PTK_GROUP, REKEYNEGOTIATING) - SM_ENTRY_MA(WPA_PTK_GROUP, REKEYNEGOTIATING, wpa_ptk_group); - - sm->GTimeoutCtr++; -- if (sm->GTimeoutCtr > (int) dot11RSNAConfigGroupUpdateCount) { -+ if (sm->GTimeoutCtr > sm->wpa_auth->conf.wpa_group_update_count) { - /* No point in sending the EAPOL-Key - we will disconnect - * immediately following this. */ - return; -@@ -3154,7 +3153,7 @@ SM_STEP(WPA_PTK_GROUP) - !sm->EAPOLKeyPairwise && sm->MICVerified) - SM_ENTER(WPA_PTK_GROUP, REKEYESTABLISHED); - else if (sm->GTimeoutCtr > -- (int) dot11RSNAConfigGroupUpdateCount) -+ sm->wpa_auth->conf.wpa_group_update_count) - SM_ENTER(WPA_PTK_GROUP, KEYERROR); - else if (sm->TimeoutEvt) - SM_ENTER(WPA_PTK_GROUP, REKEYNEGOTIATING); -@@ -3614,8 +3613,8 @@ int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen) - "dot11RSNAConfigNumberOfGTKSAReplayCounters=0\n", - RSN_VERSION, - !!wpa_auth->conf.wpa_strict_rekey, -- dot11RSNAConfigGroupUpdateCount, -- dot11RSNAConfigPairwiseUpdateCount, -+ wpa_auth->conf.wpa_group_update_count, -+ wpa_auth->conf.wpa_pairwise_update_count, - wpa_cipher_key_len(wpa_auth->conf.wpa_group) * 8, - dot11RSNAConfigPMKLifetime, - dot11RSNAConfigPMKReauthThreshold, -diff --git a/src/ap/wpa_auth.h b/src/ap/wpa_auth.h -index 9cbe3889b..0920a169d 100644 ---- a/src/ap/wpa_auth.h -+++ b/src/ap/wpa_auth.h -@@ -144,6 +144,8 @@ struct wpa_auth_config { - int wpa_strict_rekey; - int wpa_gmk_rekey; - int wpa_ptk_rekey; -+ u32 wpa_group_update_count; -+ u32 wpa_pairwise_update_count; - int rsn_pairwise; - int rsn_preauth; - int eapol_version; -diff --git a/src/ap/wpa_auth_glue.c b/src/ap/wpa_auth_glue.c -index 22518a1f1..394f77a66 100644 ---- a/src/ap/wpa_auth_glue.c -+++ b/src/ap/wpa_auth_glue.c -@@ -41,6 +41,8 @@ static void hostapd_wpa_auth_conf(struct hostapd_bss_config *conf, - wconf->wpa_strict_rekey = conf->wpa_strict_rekey; - wconf->wpa_gmk_rekey = conf->wpa_gmk_rekey; - wconf->wpa_ptk_rekey = conf->wpa_ptk_rekey; -+ wconf->wpa_group_update_count = conf->wpa_group_update_count; -+ wconf->wpa_pairwise_update_count = conf->wpa_pairwise_update_count; - wconf->rsn_pairwise = conf->rsn_pairwise; - wconf->rsn_preauth = conf->rsn_preauth; - wconf->eapol_version = conf->eapol_version; -diff --git a/src/ap/wpa_auth_i.h b/src/ap/wpa_auth_i.h -index 065a624ad..cda2c5065 100644 ---- a/src/ap/wpa_auth_i.h -+++ b/src/ap/wpa_auth_i.h -@@ -48,8 +48,8 @@ struct wpa_state_machine { - Boolean AuthenticationRequest; - Boolean ReAuthenticationRequest; - Boolean Disconnect; -- int TimeoutCtr; -- int GTimeoutCtr; -+ u32 TimeoutCtr; -+ u32 GTimeoutCtr; - Boolean TimeoutEvt; - Boolean EAPOLKeyReceived; - Boolean EAPOLKeyPairwise; -diff --git a/wpa_supplicant/ibss_rsn.c b/wpa_supplicant/ibss_rsn.c -index 521a692ba..954061ae4 100644 ---- a/wpa_supplicant/ibss_rsn.c -+++ b/wpa_supplicant/ibss_rsn.c -@@ -428,6 +428,8 @@ static int ibss_rsn_auth_init_group(struct ibss_rsn *ibss_rsn, - conf.wpa_group = WPA_CIPHER_CCMP; - conf.eapol_version = 2; - conf.wpa_group_rekey = ssid->group_rekey ? ssid->group_rekey : 600; -+ conf.wpa_group_update_count = 4; -+ conf.wpa_pairwise_update_count = 4; - - ibss_rsn->auth_group = wpa_init(own_addr, &conf, &cb, ibss_rsn); - if (ibss_rsn->auth_group == NULL) { -diff --git a/wpa_supplicant/mesh_rsn.c b/wpa_supplicant/mesh_rsn.c -index 33040f30b..628382cbf 100644 ---- a/wpa_supplicant/mesh_rsn.c -+++ b/wpa_supplicant/mesh_rsn.c -@@ -158,6 +158,8 @@ static int __mesh_rsn_auth_init(struct mesh_rsn *rsn, const u8 *addr, - conf.wpa_group = rsn->group_cipher; - conf.eapol_version = 0; - conf.wpa_group_rekey = -1; -+ conf.wpa_group_update_count = 4; -+ conf.wpa_pairwise_update_count = 4; - #ifdef CONFIG_IEEE80211W - conf.ieee80211w = ieee80211w; - if (ieee80211w != NO_MGMT_FRAME_PROTECTION) --- -2.13.6 - diff --git a/package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch b/package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch similarity index 100% rename from package/network/services/hostapd/patches/019-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch rename to package/network/services/hostapd/patches/013-WNM-Ignore-WNM-Sleep-Mode-Request-in-wnm_sleep_mode-.patch diff --git a/package/network/services/hostapd/patches/100-daemonize_fix.patch b/package/network/services/hostapd/patches/100-daemonize_fix.patch index fad84669a..43057ef9f 100644 --- a/package/network/services/hostapd/patches/100-daemonize_fix.patch +++ b/package/network/services/hostapd/patches/100-daemonize_fix.patch @@ -8,7 +8,7 @@ #ifdef ANDROID #include -@@ -179,59 +180,46 @@ int os_gmtime(os_time_t t, struct os_tm +@@ -182,59 +183,46 @@ int os_gmtime(os_time_t t, struct os_tm return 0; } diff --git a/package/network/services/hostapd/patches/110-no_eapol_fix.patch b/package/network/services/hostapd/patches/110-no_eapol_fix.patch index 5181721e3..3a48a7a95 100644 --- a/package/network/services/hostapd/patches/110-no_eapol_fix.patch +++ b/package/network/services/hostapd/patches/110-no_eapol_fix.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -259,9 +259,10 @@ void wpa_supplicant_cancel_auth_timeout( +@@ -265,9 +265,10 @@ void wpa_supplicant_cancel_auth_timeout( */ void wpa_supplicant_initiate_eapol(struct wpa_supplicant *wpa_s) { diff --git a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch index fdd5da9bf..4a5b63716 100644 --- a/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch +++ b/package/network/services/hostapd/patches/120-disable_bridge_packet_workaround.patch @@ -1,6 +1,6 @@ --- a/src/l2_packet/l2_packet_linux.c +++ b/src/l2_packet/l2_packet_linux.c -@@ -337,8 +337,7 @@ struct l2_packet_data * l2_packet_init_b +@@ -340,8 +340,7 @@ struct l2_packet_data * l2_packet_init_b l2 = l2_packet_init(br_ifname, own_addr, protocol, rx_callback, rx_callback_ctx, l2_hdr); diff --git a/package/network/services/hostapd/patches/200-multicall.patch b/package/network/services/hostapd/patches/200-multicall.patch index f0348201f..0d289d53a 100644 --- a/package/network/services/hostapd/patches/200-multicall.patch +++ b/package/network/services/hostapd/patches/200-multicall.patch @@ -18,7 +18,7 @@ OBJS += ../src/ap/vlan_init.o OBJS += ../src/ap/vlan_ifconfig.o OBJS += ../src/ap/vlan.o -@@ -330,10 +332,14 @@ CFLAGS += -DCONFIG_MBO +@@ -354,10 +356,14 @@ CFLAGS += -DCONFIG_MBO OBJS += ../src/ap/mbo_ap.o endif @@ -36,7 +36,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -1077,6 +1083,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) +@@ -1204,6 +1210,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) BCHECK=../src/drivers/build.hostapd @@ -49,8 +49,8 @@ hostapd: $(BCHECK) $(OBJS) $(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) @$(E) " LD " $@ -@@ -1118,6 +1130,12 @@ HOBJS += ../src/crypto/aes-internal.o - HOBJS += ../src/crypto/aes-internal-enc.o +@@ -1248,6 +1260,12 @@ ifeq ($(CONFIG_TLS), linux) + HOBJS += ../src/crypto/crypto_linux.o endif +dump_cflags: @@ -72,7 +72,7 @@ ifndef CONFIG_NO_GITVER # Add VERSION_STR postfix for builds from a git repository -@@ -329,7 +330,9 @@ endif +@@ -357,7 +358,9 @@ endif ifdef CONFIG_IBSS_RSN NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_IBSS_RSN @@ -82,7 +82,7 @@ OBJS += ibss_rsn.o endif -@@ -820,6 +823,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS +@@ -861,6 +864,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS LIBS += -ldl -rdynamic endif @@ -92,8 +92,8 @@ + endif endif - ifdef CONFIG_MACSEC -@@ -840,9 +847,11 @@ NEED_EAP_COMMON=y + ifdef CONFIG_AP +@@ -868,9 +875,11 @@ NEED_EAP_COMMON=y NEED_RSN_AUTHENTICATOR=y CFLAGS += -DCONFIG_AP OBJS += ap.o @@ -105,7 +105,7 @@ OBJS += ../src/ap/hostapd.o OBJS += ../src/ap/wpa_auth_glue.o OBJS += ../src/ap/utils.o -@@ -910,6 +919,12 @@ endif +@@ -952,6 +961,12 @@ endif ifdef CONFIG_HS20 OBJS += ../src/ap/hs20.o endif @@ -118,7 +118,7 @@ endif ifdef CONFIG_MBO -@@ -918,7 +933,9 @@ CFLAGS += -DCONFIG_MBO +@@ -960,7 +975,9 @@ CFLAGS += -DCONFIG_MBO endif ifdef NEED_RSN_AUTHENTICATOR @@ -128,7 +128,7 @@ NEED_AES_WRAP=y OBJS += ../src/ap/wpa_auth.o OBJS += ../src/ap/wpa_auth_ie.o -@@ -1706,6 +1723,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) +@@ -1835,6 +1852,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config @@ -141,7 +141,7 @@ wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) $(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) @$(E) " LD " $@ -@@ -1808,6 +1831,12 @@ endif +@@ -1937,6 +1960,12 @@ endif -e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@ @$(E) " sed" $< @@ -156,7 +156,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -4968,8 +4968,8 @@ union wpa_event_data { +@@ -5317,8 +5317,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -167,7 +167,7 @@ /** * wpa_supplicant_event_global - Report a driver event for wpa_supplicant -@@ -4981,7 +4981,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -5330,7 +5330,7 @@ void wpa_supplicant_event(void *ctx, enu * Same as wpa_supplicant_event(), but we search for the interface in * wpa_global. */ @@ -178,7 +178,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -1163,8 +1163,8 @@ static void hostapd_event_dfs_cac_starte +@@ -1375,8 +1375,8 @@ static void hostapd_event_dfs_cac_starte #endif /* NEED_AP_MLME */ @@ -189,7 +189,7 @@ { struct hostapd_data *hapd = ctx; #ifndef CONFIG_NO_STDOUT_DEBUG -@@ -1373,7 +1373,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -1590,7 +1590,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -231,7 +231,7 @@ os_memset(&global, 0, sizeof(global)); --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -3610,8 +3610,8 @@ static void wpa_supplicant_event_assoc_a +@@ -3709,8 +3709,8 @@ static void wpa_supplicant_event_assoc_a } @@ -242,16 +242,7 @@ { struct wpa_supplicant *wpa_s = ctx; int resched; -@@ -4315,7 +4315,7 @@ void wpa_supplicant_event(void *ctx, enu - #endif /* CONFIG_AP */ - break; - case EVENT_ACS_CHANNEL_SELECTED: --#ifdef CONFIG_ACS -+#if defined(CONFIG_ACS) && defined(CONFIG_AP) - if (!wpa_s->ap_iface) - break; - hostapd_acs_channel_selected(wpa_s->ap_iface->bss[0], -@@ -4337,7 +4337,7 @@ void wpa_supplicant_event(void *ctx, enu +@@ -4466,7 +4466,7 @@ void wpa_supplicant_event(void *ctx, enu } @@ -262,7 +253,7 @@ struct wpa_supplicant *wpa_s; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -5136,7 +5136,6 @@ struct wpa_interface * wpa_supplicant_ma +@@ -5457,7 +5457,6 @@ struct wpa_interface * wpa_supplicant_ma return NULL; } @@ -270,7 +261,7 @@ /** * wpa_supplicant_match_existing - Match existing interfaces * @global: Pointer to global data from wpa_supplicant_init() -@@ -5173,6 +5172,11 @@ static int wpa_supplicant_match_existing +@@ -5494,6 +5493,11 @@ static int wpa_supplicant_match_existing #endif /* CONFIG_MATCH_IFACE */ @@ -282,7 +273,7 @@ /** * wpa_supplicant_add_iface - Add a new network interface -@@ -5428,6 +5432,8 @@ struct wpa_global * wpa_supplicant_init( +@@ -5750,6 +5754,8 @@ struct wpa_global * wpa_supplicant_init( #ifndef CONFIG_NO_WPA_MSG wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); #endif /* CONFIG_NO_WPA_MSG */ @@ -305,9 +296,9 @@ #ifdef CONFIG_WPS static int gen_uuid(const char *txt_addr) -@@ -667,6 +672,8 @@ int main(int argc, char *argv[]) - interfaces.global_ctrl_sock = -1; - dl_list_init(&interfaces.global_ctrl_dst); +@@ -670,6 +675,8 @@ int main(int argc, char *argv[]) + dl_list_init(&interfaces.eth_p_oui); + #endif /* CONFIG_ETH_P_OUI */ + wpa_supplicant_event = hostapd_wpa_event; + wpa_supplicant_event_global = hostapd_wpa_event_global; diff --git a/package/network/services/hostapd/patches/300-noscan.patch b/package/network/services/hostapd/patches/300-noscan.patch index 9dc0f2c39..c8ca3694c 100644 --- a/package/network/services/hostapd/patches/300-noscan.patch +++ b/package/network/services/hostapd/patches/300-noscan.patch @@ -1,6 +1,6 @@ --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -2953,6 +2953,10 @@ static int hostapd_config_fill(struct ho +@@ -3016,6 +3016,10 @@ static int hostapd_config_fill(struct ho } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -13,7 +13,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -681,6 +681,8 @@ struct hostapd_config { +@@ -735,6 +735,8 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; @@ -24,7 +24,7 @@ int no_pri_sec_switch; --- a/src/ap/hw_features.c +++ b/src/ap/hw_features.c -@@ -474,7 +474,8 @@ static int ieee80211n_check_40mhz(struct +@@ -480,7 +480,8 @@ static int ieee80211n_check_40mhz(struct int ret; /* Check that HT40 is used and PRI / SEC switch is allowed */ diff --git a/package/network/services/hostapd/patches/310-rescan_immediately.patch b/package/network/services/hostapd/patches/310-rescan_immediately.patch index ccc9781fa..6846db275 100644 --- a/package/network/services/hostapd/patches/310-rescan_immediately.patch +++ b/package/network/services/hostapd/patches/310-rescan_immediately.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -3696,7 +3696,7 @@ wpa_supplicant_alloc(struct wpa_supplica +@@ -3927,7 +3927,7 @@ wpa_supplicant_alloc(struct wpa_supplica if (wpa_s == NULL) return NULL; wpa_s->scan_req = INITIAL_SCAN_REQ; diff --git a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch index ebb12f69f..3bc916b6b 100644 --- a/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch +++ b/package/network/services/hostapd/patches/330-nl80211_fix_set_freq.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4104,7 +4104,7 @@ static int nl80211_set_channel(struct i8 +@@ -4152,7 +4152,7 @@ static int nl80211_set_channel(struct i8 freq->freq, freq->ht_enabled, freq->vht_enabled, freq->bandwidth, freq->center_freq1, freq->center_freq2); diff --git a/package/network/services/hostapd/patches/340-reload_freq_change.patch b/package/network/services/hostapd/patches/340-reload_freq_change.patch index 0dcd7c913..f05b9147b 100644 --- a/package/network/services/hostapd/patches/340-reload_freq_change.patch +++ b/package/network/services/hostapd/patches/340-reload_freq_change.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -80,6 +80,25 @@ static void hostapd_reload_bss(struct ho +@@ -87,6 +87,25 @@ static void hostapd_reload_bss(struct ho #endif /* CONFIG_NO_RADIUS */ ssid = &hapd->conf->ssid; @@ -26,7 +26,7 @@ if (!ssid->wpa_psk_set && ssid->wpa_psk && !ssid->wpa_psk->next && ssid->wpa_passphrase_set && ssid->wpa_passphrase) { /* -@@ -158,6 +177,7 @@ int hostapd_reload_config(struct hostapd +@@ -165,6 +184,7 @@ int hostapd_reload_config(struct hostapd struct hostapd_data *hapd = iface->bss[0]; struct hostapd_config *newconf, *oldconf; size_t j; @@ -34,7 +34,7 @@ if (iface->config_fname == NULL) { /* Only in-memory config in use - assume it has been updated */ -@@ -179,21 +199,20 @@ int hostapd_reload_config(struct hostapd +@@ -186,21 +206,20 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; diff --git a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch index be10a413e..92e6ae9ae 100644 --- a/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch +++ b/package/network/services/hostapd/patches/350-nl80211_del_beacon_bss.patch @@ -1,72 +1,54 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -2490,13 +2490,18 @@ wpa_driver_nl80211_finish_drv_init(struc - } - - --static int wpa_driver_nl80211_del_beacon(struct wpa_driver_nl80211_data *drv) -+static int wpa_driver_nl80211_del_beacon(struct i802_bss *bss) - { -+ struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -2536,10 +2536,15 @@ static int wpa_driver_nl80211_del_beacon struct nl_msg *msg; + struct wpa_driver_nl80211_data *drv = bss->drv; + if (!bss->beacon_set) + return 0; + + bss->beacon_set = 0; ++ wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", - drv->ifindex); -- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); + bss->ifindex); + nl80211_put_wiphy_data_ap(bss); +- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); + msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); return send_and_recv_msgs(drv, msg, NULL, NULL); } -@@ -2548,7 +2553,7 @@ static void wpa_driver_nl80211_deinit(st - nl80211_remove_monitor_interface(drv); - - if (is_ap_interface(drv->nlmode)) -- wpa_driver_nl80211_del_beacon(drv); -+ wpa_driver_nl80211_del_beacon(bss); - - if (drv->eapol_sock >= 0) { - eloop_unregister_read_sock(drv->eapol_sock); -@@ -4703,8 +4708,7 @@ static void nl80211_teardown_ap(struct i - nl80211_remove_monitor_interface(drv); - else +@@ -4753,7 +4758,7 @@ static void nl80211_teardown_ap(struct i nl80211_mgmt_unsubscribe(bss, "AP teardown"); -- + + nl80211_put_wiphy_data_ap(bss); - bss->beacon_set = 0; + wpa_driver_nl80211_del_beacon(bss); } -@@ -6728,8 +6732,6 @@ static int wpa_driver_nl80211_if_remove( +@@ -6853,8 +6858,6 @@ static int wpa_driver_nl80211_if_remove( } else { wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); nl80211_teardown_ap(bss); - if (!bss->added_if && !drv->first_bss->next) -- wpa_driver_nl80211_del_beacon(drv); +- wpa_driver_nl80211_del_beacon(bss); nl80211_destroy_bss(bss); if (!bss->added_if) i802_set_iface_flags(bss, 0); -@@ -7091,8 +7093,7 @@ static int wpa_driver_nl80211_deinit_ap( - struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -7225,7 +7228,6 @@ static int wpa_driver_nl80211_deinit_ap( if (!is_ap_interface(drv->nlmode)) return -1; -- wpa_driver_nl80211_del_beacon(drv); + wpa_driver_nl80211_del_beacon(bss); - bss->beacon_set = 0; -+ wpa_driver_nl80211_del_beacon(bss); /* * If the P2P GO interface was dynamically added, then it is -@@ -7111,8 +7112,7 @@ static int wpa_driver_nl80211_stop_ap(vo - struct wpa_driver_nl80211_data *drv = bss->drv; +@@ -7245,7 +7247,6 @@ static int wpa_driver_nl80211_stop_ap(vo if (!is_ap_interface(drv->nlmode)) return -1; -- wpa_driver_nl80211_del_beacon(drv); + wpa_driver_nl80211_del_beacon(bss); - bss->beacon_set = 0; -+ wpa_driver_nl80211_del_beacon(bss); return 0; } diff --git a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch index 83bec2a25..043ddbf88 100644 --- a/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch +++ b/package/network/services/hostapd/patches/360-ctrl_iface_reload.patch @@ -1,6 +1,6 @@ --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -55,6 +55,7 @@ +@@ -56,6 +56,7 @@ #include "fst/fst_ctrl_iface.h" #include "config_file.h" #include "ctrl_iface.h" @@ -8,7 +8,7 @@ #define HOSTAPD_CLI_DUP_VALUE_MAX_LEN 256 -@@ -73,6 +74,7 @@ static void hostapd_ctrl_iface_send(stru +@@ -74,6 +75,7 @@ static void hostapd_ctrl_iface_send(stru enum wpa_msg_type type, const char *buf, size_t len); @@ -16,7 +16,7 @@ static int hostapd_ctrl_iface_attach(struct hostapd_data *hapd, struct sockaddr_storage *from, -@@ -124,6 +126,61 @@ static int hostapd_ctrl_iface_new_sta(st +@@ -125,6 +127,61 @@ static int hostapd_ctrl_iface_new_sta(st return 0; } @@ -78,7 +78,7 @@ #ifdef CONFIG_IEEE80211W #ifdef NEED_AP_MLME -@@ -2620,6 +2677,8 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2607,6 +2664,8 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "VENDOR ", 7) == 0) { reply_len = hostapd_ctrl_iface_vendor(hapd, buf + 7, reply, reply_size); diff --git a/package/network/services/hostapd/patches/370-ap_sta_support.patch b/package/network/services/hostapd/patches/370-ap_sta_support.patch index 03819b337..a37b193b6 100644 --- a/package/network/services/hostapd/patches/370-ap_sta_support.patch +++ b/package/network/services/hostapd/patches/370-ap_sta_support.patch @@ -1,6 +1,6 @@ --- a/wpa_supplicant/wpa_supplicant_i.h +++ b/wpa_supplicant/wpa_supplicant_i.h -@@ -100,6 +100,11 @@ struct wpa_interface { +@@ -101,6 +101,11 @@ struct wpa_interface { const char *ifname; /** @@ -12,7 +12,7 @@ * bridge_ifname - Optional bridge interface name * * If the driver interface (ifname) is included in a Linux bridge -@@ -484,6 +489,8 @@ struct wpa_supplicant { +@@ -512,6 +517,8 @@ struct wpa_supplicant { #endif /* CONFIG_CTRL_IFACE_BINDER */ char bridge_ifname[16]; @@ -34,7 +34,7 @@ -include .config -include $(if $(MULTICALL),../hostapd/.config) -@@ -115,6 +119,8 @@ OBJS_c += ../src/utils/common.o +@@ -117,6 +121,8 @@ OBJS_c += ../src/utils/common.o OBJS_c += ../src/common/cli.o OBJS += wmm_ac.o @@ -45,9 +45,9 @@ CONFIG_OS=win32 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -112,6 +112,55 @@ const char *const wpa_supplicant_full_li - "\n"; - #endif /* CONFIG_NO_STDOUT_DEBUG */ +@@ -118,6 +118,55 @@ const char *const wpa_supplicant_full_li + static void wpa_bss_tmp_disallow_timeout(void *eloop_ctx, void *timeout_ctx); + +static int hostapd_stop(struct wpa_supplicant *wpa_s) +{ @@ -101,7 +101,7 @@ /* Configure default/group WEP keys for static WEP */ int wpa_set_wep_keys(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { -@@ -819,8 +868,12 @@ void wpa_supplicant_set_state(struct wpa +@@ -883,8 +932,12 @@ void wpa_supplicant_set_state(struct wpa wpas_p2p_completed(wpa_s); sme_sched_obss_scan(wpa_s, 1); @@ -114,7 +114,7 @@ wpa_s->new_connection = 1; wpa_drv_set_operstate(wpa_s, 0); #ifndef IEEE8021X_EAPOL -@@ -4790,6 +4843,20 @@ static int wpa_supplicant_init_iface(str +@@ -5080,6 +5133,20 @@ static int wpa_supplicant_init_iface(str sizeof(wpa_s->bridge_ifname)); } @@ -135,7 +135,7 @@ /* RSNA Supplicant Key Management - INITIALIZE */ eapol_sm_notify_portEnabled(wpa_s->eapol, FALSE); eapol_sm_notify_portValid(wpa_s->eapol, FALSE); -@@ -5083,6 +5150,11 @@ static void wpa_supplicant_deinit_iface( +@@ -5404,6 +5471,11 @@ static void wpa_supplicant_deinit_iface( if (terminate) wpa_msg(wpa_s, MSG_INFO, WPA_EVENT_TERMINATING); @@ -157,7 +157,7 @@ #include "drivers/driver.h" #include "eap_peer/eap.h" #include "wpa_supplicant_i.h" -@@ -290,6 +291,10 @@ static void calculate_update_time(const +@@ -290,6 +291,10 @@ void calculate_update_time(const struct static void wpa_bss_copy_res(struct wpa_bss *dst, struct wpa_scan_res *src, struct os_reltime *fetch_time) { diff --git a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch index b4729581c..e977f00a2 100644 --- a/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch +++ b/package/network/services/hostapd/patches/380-disable_ctrl_iface_mib.patch @@ -12,7 +12,7 @@ else --- a/hostapd/ctrl_iface.c +++ b/hostapd/ctrl_iface.c -@@ -2471,6 +2471,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2458,6 +2458,7 @@ static int hostapd_ctrl_iface_receive_pr reply_size); } else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { reply_len = hostapd_drv_status(hapd, reply, reply_size); @@ -20,7 +20,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = ieee802_11_get_mib(hapd, reply, reply_size); if (reply_len >= 0) { -@@ -2512,6 +2513,7 @@ static int hostapd_ctrl_iface_receive_pr +@@ -2499,6 +2500,7 @@ static int hostapd_ctrl_iface_receive_pr } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, reply_size); @@ -30,8 +30,8 @@ reply_len = -1; --- a/wpa_supplicant/Makefile +++ b/wpa_supplicant/Makefile -@@ -891,6 +891,9 @@ ifdef CONFIG_MBO - OBJS += ../src/ap/mbo_ap.o +@@ -926,6 +926,9 @@ ifdef CONFIG_FILS + OBJS += ../src/ap/fils_hlp.o endif ifdef CONFIG_CTRL_IFACE +ifdef CONFIG_CTRL_IFACE_MIB @@ -42,7 +42,7 @@ --- a/wpa_supplicant/ctrl_iface.c +++ b/wpa_supplicant/ctrl_iface.c -@@ -1907,7 +1907,7 @@ static int wpa_supplicant_ctrl_iface_sta +@@ -2070,7 +2070,7 @@ static int wpa_supplicant_ctrl_iface_sta pos += ret; } @@ -51,7 +51,7 @@ if (wpa_s->ap_iface) { pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, end - pos, -@@ -9032,6 +9032,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9631,6 +9631,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = -1; } else if (os_strncmp(buf, "NOTE ", 5) == 0) { wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); @@ -59,7 +59,7 @@ } else if (os_strcmp(buf, "MIB") == 0) { reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); if (reply_len >= 0) { -@@ -9039,6 +9040,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -9638,6 +9639,7 @@ char * wpa_supplicant_ctrl_iface_process reply + reply_len, reply_size - reply_len); } @@ -67,7 +67,7 @@ } else if (os_strncmp(buf, "STATUS", 6) == 0) { reply_len = wpa_supplicant_ctrl_iface_status( wpa_s, buf + 6, reply, reply_size); -@@ -9517,6 +9519,7 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10124,6 +10126,7 @@ char * wpa_supplicant_ctrl_iface_process reply_len = wpa_supplicant_ctrl_iface_bss( wpa_s, buf + 4, reply, reply_size); #ifdef CONFIG_AP @@ -75,7 +75,7 @@ } else if (os_strcmp(buf, "STA-FIRST") == 0) { reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); } else if (os_strncmp(buf, "STA ", 4) == 0) { -@@ -9525,12 +9528,15 @@ char * wpa_supplicant_ctrl_iface_process +@@ -10132,12 +10135,15 @@ char * wpa_supplicant_ctrl_iface_process } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, reply_size); @@ -111,7 +111,7 @@ static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c -@@ -2490,6 +2490,7 @@ static const char * bool_txt(Boolean val +@@ -2492,6 +2492,7 @@ static const char * bool_txt(Boolean val return val ? "TRUE" : "FALSE"; } @@ -119,7 +119,7 @@ int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) { -@@ -2665,6 +2666,7 @@ int ieee802_1x_get_mib_sta(struct hostap +@@ -2667,6 +2668,7 @@ int ieee802_1x_get_mib_sta(struct hostap return len; } @@ -129,7 +129,7 @@ static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) --- a/src/ap/wpa_auth.c +++ b/src/ap/wpa_auth.c -@@ -3565,6 +3565,7 @@ static const char * wpa_bool_txt(int val +@@ -3780,6 +3780,7 @@ static const char * wpa_bool_txt(int val return val ? "TRUE" : "FALSE"; } @@ -137,7 +137,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ -@@ -3709,7 +3710,7 @@ int wpa_get_mib_sta(struct wpa_state_mac +@@ -3924,7 +3925,7 @@ int wpa_get_mib_sta(struct wpa_state_mac return len; } @@ -148,7 +148,7 @@ { --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c -@@ -2308,6 +2308,8 @@ static u32 wpa_key_mgmt_suite(struct wpa +@@ -2356,6 +2356,8 @@ static u32 wpa_key_mgmt_suite(struct wpa } @@ -157,7 +157,7 @@ #define RSN_SUITE "%02x-%02x-%02x-%d" #define RSN_SUITE_ARG(s) \ ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff -@@ -2391,6 +2393,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch +@@ -2439,6 +2441,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch return (int) len; } @@ -167,7 +167,7 @@ --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c -@@ -1119,7 +1119,7 @@ int wpas_ap_wps_nfc_report_handover(stru +@@ -1139,7 +1139,7 @@ int wpas_ap_wps_nfc_report_handover(stru #endif /* CONFIG_WPS */ diff --git a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch index 7f147aec1..8f7a6879c 100644 --- a/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch +++ b/package/network/services/hostapd/patches/390-wpa_ie_cap_workaround.patch @@ -1,6 +1,6 @@ --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c -@@ -1445,6 +1445,31 @@ u32 wpa_akm_to_suite(int akm) +@@ -1675,6 +1675,31 @@ u32 wpa_akm_to_suite(int akm) } @@ -32,7 +32,7 @@ int wpa_compare_rsn_ie(int ft_initial_assoc, const u8 *ie1, size_t ie1len, const u8 *ie2, size_t ie2len) -@@ -1452,8 +1477,19 @@ int wpa_compare_rsn_ie(int ft_initial_as +@@ -1682,8 +1707,19 @@ int wpa_compare_rsn_ie(int ft_initial_as if (ie1 == NULL || ie2 == NULL) return -1; diff --git a/package/network/services/hostapd/patches/420-indicate-features.patch b/package/network/services/hostapd/patches/420-indicate-features.patch index ac699f4e4..2b529ca3e 100644 --- a/package/network/services/hostapd/patches/420-indicate-features.patch +++ b/package/network/services/hostapd/patches/420-indicate-features.patch @@ -8,7 +8,7 @@ #include "crypto/random.h" #include "crypto/tls.h" #include "common/version.h" -@@ -675,7 +676,7 @@ int main(int argc, char *argv[]) +@@ -678,7 +679,7 @@ int main(int argc, char *argv[]) wpa_supplicant_event = hostapd_wpa_event; wpa_supplicant_event_global = hostapd_wpa_event_global; for (;;) { @@ -17,7 +17,7 @@ if (c < 0) break; switch (c) { -@@ -712,6 +713,8 @@ int main(int argc, char *argv[]) +@@ -715,6 +716,8 @@ int main(int argc, char *argv[]) break; #endif /* CONFIG_DEBUG_LINUX_TRACING */ case 'v': diff --git a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch index eba79d28c..32cab7ff6 100644 --- a/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch +++ b/package/network/services/hostapd/patches/430-hostapd_cli_ifdef.patch @@ -1,6 +1,6 @@ --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c -@@ -447,7 +447,6 @@ static int hostapd_cli_cmd_sa_query(stru +@@ -417,7 +417,6 @@ static int hostapd_cli_cmd_sa_query(stru #endif /* CONFIG_IEEE80211W */ @@ -8,7 +8,7 @@ static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, char *argv[]) { -@@ -673,7 +672,6 @@ static int hostapd_cli_cmd_wps_config(st +@@ -643,7 +642,6 @@ static int hostapd_cli_cmd_wps_config(st ssid_hex, argv[1]); return wpa_ctrl_command(ctrl, buf); } @@ -16,19 +16,19 @@ static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, -@@ -1367,7 +1365,6 @@ static const struct hostapd_cli_cmd host - { "sa_query", hostapd_cli_cmd_sa_query, NULL, +@@ -1476,7 +1474,6 @@ static const struct hostapd_cli_cmd host + { "sa_query", hostapd_cli_cmd_sa_query, hostapd_complete_stations, " = send SA Query to a station" }, #endif /* CONFIG_IEEE80211W */ -#ifdef CONFIG_WPS { "wps_pin", hostapd_cli_cmd_wps_pin, NULL, " [timeout] [addr] = add WPS Enrollee PIN" }, { "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, -@@ -1392,7 +1389,6 @@ static const struct hostapd_cli_cmd host +@@ -1501,7 +1498,6 @@ static const struct hostapd_cli_cmd host " = configure AP" }, { "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, "= show current WPS status" }, -#endif /* CONFIG_WPS */ - { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, NULL }, - { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, NULL }, - { "bss_tm_req", hostapd_cli_cmd_bss_tm_req, NULL, NULL }, + { "disassoc_imminent", hostapd_cli_cmd_disassoc_imminent, NULL, + "= send Disassociation Imminent notification" }, + { "ess_disassoc", hostapd_cli_cmd_ess_disassoc, NULL, diff --git a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch index 1aeec5d05..213ee6d72 100644 --- a/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/network/services/hostapd/patches/460-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -21,8 +21,8 @@ Signed-hostap: Antonio Quartulli +#include "ap/sta_info.h" #include "common/defs.h" #include "common/ieee802_11_defs.h" - #ifdef CONFIG_MACSEC -@@ -605,6 +606,9 @@ struct wpa_driver_associate_params { + #include "common/wpa_common.h" +@@ -762,6 +763,9 @@ struct wpa_driver_associate_params { * responsible for selecting with which BSS to associate. */ const u8 *bssid; @@ -34,7 +34,7 @@ Signed-hostap: Antonio Quartulli * --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -16,6 +16,7 @@ +@@ -17,6 +17,7 @@ #include "eap_peer/eap.h" #include "p2p/p2p.h" #include "fst/fst.h" @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli #include "config.h" -@@ -1891,6 +1892,97 @@ static char * wpa_config_write_mka_ckn(c +@@ -1985,6 +1986,97 @@ static char * wpa_config_write_mka_ckn(c #endif /* CONFIG_MACSEC */ @@ -140,11 +140,10 @@ Signed-hostap: Antonio Quartulli /* Helper macros for network block parser */ #ifdef OFFSET -@@ -2123,6 +2215,9 @@ static const struct parse_data ssid_fiel +@@ -2224,6 +2316,8 @@ static const struct parse_data ssid_fiel { INT(ap_max_inactivity) }, { INT(dtim_period) }, { INT(beacon_int) }, -+ { INT_RANGE(fixed_freq, 0, 1) }, + { FUNC(rates) }, + { FUNC(mcast_rate) }, #ifdef CONFIG_MACSEC @@ -163,7 +162,7 @@ Signed-hostap: Antonio Quartulli #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) -@@ -719,6 +721,9 @@ struct wpa_ssid { +@@ -735,6 +737,9 @@ struct wpa_ssid { */ void *parent_cred; @@ -175,11 +174,10 @@ Signed-hostap: Antonio Quartulli * macsec_policy - Determines the policy for MACsec secure session --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2561,6 +2561,13 @@ static void wpas_start_assoc_cb(struct w +@@ -2781,6 +2781,12 @@ static void wpas_start_assoc_cb(struct w params.beacon_int = ssid->beacon_int; else params.beacon_int = wpa_s->conf->beacon_int; -+ params.fixed_freq = ssid->fixed_freq; + i = 0; + while (i < WLAN_SUPP_RATES_MAX) { + params.rates[i] = ssid->rates[i]; diff --git a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch index 6db61333e..11822366d 100644 --- a/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/network/services/hostapd/patches/461-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -10,7 +10,7 @@ Signed-hostap: Antonio Quartulli --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4962,7 +4962,7 @@ static int wpa_driver_nl80211_ibss(struc +@@ -5012,7 +5012,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -19,7 +19,7 @@ Signed-hostap: Antonio Quartulli int count = 0; wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); -@@ -4989,6 +4989,37 @@ retry: +@@ -5039,6 +5039,37 @@ retry: nl80211_put_beacon_int(msg, params->beacon_int)) goto fail; diff --git a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch b/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch deleted file mode 100644 index c4b48a938..000000000 --- a/package/network/services/hostapd/patches/462-wpa_s-support-htmode-param.patch +++ /dev/null @@ -1,156 +0,0 @@ -From b9329c5dfeed7d5c55d2117d8dfe326fc40c8fb1 Mon Sep 17 00:00:00 2001 -From: Antonio Quartulli -Date: Tue, 3 Jul 2012 00:36:24 +0200 -Subject: [PATCH] wpa_s: support htmode param - -possible values are HT20, HT40-, HT40+ and NOHT - -Signed-off-by: Antonio Quartulli ---- - src/drivers/driver.h | 2 ++ - src/drivers/driver_nl80211.c | 16 ++++++++++ - wpa_supplicant/config.c | 66 +++++++++++++++++++++++++++++++++++++++ - wpa_supplicant/config_ssid.h | 2 ++ - wpa_supplicant/wpa_supplicant.c | 2 ++ - 5 files changed, 88 insertions(+) - ---- a/src/drivers/driver.h -+++ b/src/drivers/driver.h -@@ -608,6 +608,8 @@ struct wpa_driver_associate_params { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - int mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - /** - * bssid_hint - BSSID of a proposed AP ---- a/src/drivers/driver_nl80211.c -+++ b/src/drivers/driver_nl80211.c -@@ -5020,6 +5020,22 @@ retry: - nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); - } - -+ if (params->ht_set) { -+ switch(params->htmode) { -+ case NL80211_CHAN_HT20: -+ wpa_printf(MSG_DEBUG, " * ht=HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ wpa_printf(MSG_DEBUG, " * ht=HT40-"); -+ break; -+ } -+ nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, -+ params->htmode); -+ } -+ - ret = nl80211_set_conn_keys(params, msg); - if (ret) - goto fail; ---- a/wpa_supplicant/config.c -+++ b/wpa_supplicant/config.c -@@ -1923,6 +1923,71 @@ static char * wpa_config_write_mcast_rat - } - #endif /* NO_CONFIG_WRITE */ - -+static int wpa_config_parse_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid, int line, -+ const char *value) -+{ -+ int i; -+ static const struct { -+ const char *name; -+ unsigned int val; -+ } htmap[] = { -+ { .name = "HT20", .val = NL80211_CHAN_HT20, }, -+ { .name = "HT40+", .val = NL80211_CHAN_HT40PLUS, }, -+ { .name = "HT40-", .val = NL80211_CHAN_HT40MINUS, }, -+ { .name = "NOHT", .val = NL80211_CHAN_NO_HT, }, -+ }; -+ ssid->ht_set = 0;; -+ for (i = 0; i < 4; i++) { -+ if (strcasecmp(htmap[i].name, value) == 0) { -+ ssid->htmode = htmap[i].val; -+ ssid->ht_set = 1; -+ break; -+ } -+ } -+ -+ return 0; -+} -+ -+#ifndef NO_CONFIG_WRITE -+static char * wpa_config_write_htmode(const struct parse_data *data, -+ struct wpa_ssid *ssid) -+{ -+ char *value; -+ int res; -+ -+ value = os_malloc(6); /* longest: HT40+ */ -+ if (value == NULL) -+ return NULL; -+ -+ switch(ssid->htmode) { -+ case NL80211_CHAN_HT20: -+ res = os_snprintf(value, 4, "HT20"); -+ break; -+ case NL80211_CHAN_HT40PLUS: -+ res = os_snprintf(value, 5, "HT40+"); -+ break; -+ case NL80211_CHAN_HT40MINUS: -+ res = os_snprintf(value, 5, "HT40-"); -+ break; -+ case NL80211_CHAN_NO_HT: -+ res = os_snprintf(value, 4, "NOHT"); -+ break; -+ default: -+ os_free(value); -+ return NULL; -+ } -+ -+ if (res < 0) { -+ os_free(value); -+ return NULL; -+ } -+ -+ return value; -+} -+#endif /* NO_CONFIG_WRITE */ -+ -+ - static int wpa_config_parse_rates(const struct parse_data *data, - struct wpa_ssid *ssid, int line, - const char *value) -@@ -2218,6 +2283,7 @@ static const struct parse_data ssid_fiel - { INT_RANGE(fixed_freq, 0, 1) }, - { FUNC(rates) }, - { FUNC(mcast_rate) }, -+ { FUNC(htmode) }, - #ifdef CONFIG_MACSEC - { INT_RANGE(macsec_policy, 0, 1) }, - { INT_RANGE(macsec_integ_only, 0, 1) }, ---- a/wpa_supplicant/config_ssid.h -+++ b/wpa_supplicant/config_ssid.h -@@ -723,6 +723,8 @@ struct wpa_ssid { - - unsigned char rates[WLAN_SUPP_RATES_MAX]; - double mcast_rate; -+ int ht_set; -+ unsigned int htmode; - - #ifdef CONFIG_MACSEC - /** ---- a/wpa_supplicant/wpa_supplicant.c -+++ b/wpa_supplicant/wpa_supplicant.c -@@ -2568,6 +2568,8 @@ static void wpas_start_assoc_cb(struct w - i++; - } - params.mcast_rate = ssid->mcast_rate; -+ params.ht_set = ssid->ht_set; -+ params.htmode = ssid->htmode; - } - - params.wpa_ie = wpa_ie; diff --git a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch index da146ba55..9b5ee4bbb 100644 --- a/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch +++ b/package/network/services/hostapd/patches/463-add-mcast_rate-to-11s.patch @@ -19,7 +19,7 @@ Tested-by: Simon Wunderlich --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1426,6 +1426,7 @@ struct wpa_driver_mesh_join_params { +@@ -1424,6 +1424,7 @@ struct wpa_driver_mesh_join_params { #define WPA_DRIVER_MESH_FLAG_SAE_AUTH 0x00000004 #define WPA_DRIVER_MESH_FLAG_AMPE 0x00000008 unsigned int flags; @@ -29,7 +29,7 @@ Tested-by: Simon Wunderlich /** --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -8997,6 +8997,18 @@ static int nl80211_put_mesh_id(struct nl +@@ -8981,6 +8981,18 @@ static int nl80211_put_mesh_id(struct nl } @@ -48,7 +48,7 @@ Tested-by: Simon Wunderlich static int nl80211_put_mesh_config(struct nl_msg *msg, struct wpa_driver_mesh_bss_params *params) { -@@ -9055,6 +9067,7 @@ static int nl80211_join_mesh(struct i802 +@@ -9039,6 +9051,7 @@ static int nl80211_join_mesh(struct i802 nl80211_put_basic_rates(msg, params->basic_rates) || nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || nl80211_put_beacon_int(msg, params->beacon_int) || diff --git a/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch new file mode 100644 index 000000000..383353948 --- /dev/null +++ b/package/network/services/hostapd/patches/464-fix-mesh-obss-check.patch @@ -0,0 +1,19 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -2010,11 +2010,13 @@ void ibss_mesh_setup_freq(struct wpa_sup + for (j = 0; j < wpa_s->last_scan_res_used; j++) { + struct wpa_bss *bss = wpa_s->last_scan_res[j]; + +- if (ssid->mode != WPAS_MODE_IBSS) ++ /* Don't adjust control freq in case of fixed_freq */ ++ if (ssid->fixed_freq) { ++ obss_scan = 0; + break; ++ } + +- /* Don't adjust control freq in case of fixed_freq */ +- if (ssid->fixed_freq) ++ if (ssid->mode != WPAS_MODE_IBSS) + break; + + if (!bss_is_ibss(bss)) diff --git a/package/network/services/hostapd/patches/470-survey_data_fallback.patch b/package/network/services/hostapd/patches/470-survey_data_fallback.patch index 4e40a8755..1c094bed2 100644 --- a/package/network/services/hostapd/patches/470-survey_data_fallback.patch +++ b/package/network/services/hostapd/patches/470-survey_data_fallback.patch @@ -20,7 +20,7 @@ total = survey->channel_time; -@@ -395,20 +389,19 @@ static int acs_usable_vht80_chan(struct +@@ -392,20 +386,19 @@ static int acs_usable_vht80_chan(struct static int acs_survey_is_sufficient(struct freq_survey *survey) { if (!(survey->filled & SURVEY_HAS_NF)) { diff --git a/package/network/services/hostapd/patches/600-ubus_support.patch b/package/network/services/hostapd/patches/600-ubus_support.patch index dd962b47a..8f14f125d 100644 --- a/package/network/services/hostapd/patches/600-ubus_support.patch +++ b/package/network/services/hostapd/patches/600-ubus_support.patch @@ -22,7 +22,7 @@ struct wpa_ctrl_dst; struct radius_server_data; -@@ -119,6 +120,7 @@ struct hostapd_data { +@@ -122,6 +123,7 @@ struct hostapd_data { struct hostapd_iface *iface; struct hostapd_config *iconf; struct hostapd_bss_config *conf; @@ -30,7 +30,7 @@ int interface_added; /* virtual interface added for this BSS */ unsigned int started:1; unsigned int disabled:1; -@@ -328,6 +330,8 @@ struct hostapd_iface { +@@ -370,6 +372,8 @@ struct hostapd_iface { struct hostapd_config *conf; char phy[16]; /* Name of the PHY (radio) */ @@ -41,7 +41,7 @@ HAPD_IFACE_DISABLED, --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -302,6 +302,7 @@ static void hostapd_free_hapd_data(struc +@@ -309,6 +309,7 @@ static void hostapd_free_hapd_data(struc hapd->started = 0; wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); @@ -49,7 +49,7 @@ iapp_deinit(hapd->iapp); hapd->iapp = NULL; accounting_deinit(hapd); -@@ -1160,6 +1161,8 @@ static int hostapd_setup_bss(struct host +@@ -1186,6 +1187,8 @@ static int hostapd_setup_bss(struct host if (hapd->driver && hapd->driver->set_operstate) hapd->driver->set_operstate(hapd->drv_priv, 1); @@ -58,7 +58,7 @@ return 0; } -@@ -1683,6 +1686,7 @@ static int hostapd_setup_interface_compl +@@ -1711,6 +1714,7 @@ static int hostapd_setup_interface_compl if (err) goto fail; @@ -66,7 +66,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (iface->conf->channel) { #ifdef NEED_AP_MLME -@@ -1862,6 +1866,7 @@ dfs_offload: +@@ -1890,6 +1894,7 @@ dfs_offload: fail: wpa_printf(MSG_ERROR, "Interface initialization failed"); @@ -74,7 +74,7 @@ hostapd_set_state(iface, HAPD_IFACE_DISABLED); wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); #ifdef CONFIG_FST -@@ -2310,6 +2315,7 @@ void hostapd_interface_deinit_free(struc +@@ -2344,6 +2349,7 @@ void hostapd_interface_deinit_free(struc (unsigned int) iface->conf->num_bss); driver = iface->bss[0]->driver; drv_priv = iface->bss[0]->drv_priv; @@ -84,7 +84,7 @@ __func__, driver, drv_priv); --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1293,7 +1293,8 @@ void ieee802_11_finish_fils_auth(struct +@@ -1587,7 +1587,8 @@ ieee802_11_set_radius_info(struct hostap static void handle_auth(struct hostapd_data *hapd, @@ -94,7 +94,7 @@ { u16 auth_alg, auth_transaction, status_code; u16 resp = WLAN_STATUS_SUCCESS; -@@ -1309,6 +1310,11 @@ static void handle_auth(struct hostapd_d +@@ -1603,6 +1604,11 @@ static void handle_auth(struct hostapd_d char *identity = NULL; char *radius_cui = NULL; u16 seq_ctrl; @@ -104,24 +104,22 @@ + .frame_info = fi, + }; - os_memset(&vlan_id, 0, sizeof(vlan_id)); - -@@ -1466,6 +1472,14 @@ static void handle_auth(struct hostapd_d + if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { + wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", +@@ -1757,6 +1763,12 @@ static void handle_auth(struct hostapd_d resp = WLAN_STATUS_UNSPECIFIED_FAILURE; goto fail; } -+ + if (hostapd_ubus_handle_event(hapd, &req)) { + wpa_printf(MSG_DEBUG, "Station " MACSTR " rejected by ubus handler.\n", -+ MAC2STR(mgmt->sa)); ++ MAC2STR(mgmt->sa)); + resp = WLAN_STATUS_UNSPECIFIED_FAILURE; + goto fail; + } -+ - if (res == HOSTAPD_ACL_PENDING) { - wpa_printf(MSG_DEBUG, "Authentication frame from " MACSTR - " waiting for an external authentication", -@@ -2401,7 +2415,7 @@ static u16 send_assoc_resp(struct hostap + if (res == HOSTAPD_ACL_PENDING) + return; + +@@ -2870,7 +2882,7 @@ void fils_hlp_timeout(void *eloop_ctx, v static void handle_assoc(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -130,10 +128,10 @@ { u16 capab_info, listen_interval, seq_ctrl, fc; u16 resp = WLAN_STATUS_SUCCESS, reply_res; -@@ -2409,6 +2423,11 @@ static void handle_assoc(struct hostapd_ - int left, i; - struct sta_info *sta; - u8 *tmp = NULL; +@@ -2884,6 +2896,11 @@ static void handle_assoc(struct hostapd_ + #ifdef CONFIG_FILS + int delay_assoc = 0; + #endif /* CONFIG_FILS */ + struct hostapd_ubus_request req = { + .type = HOSTAPD_UBUS_ASSOC_REQ, + .mgmt_frame = mgmt, @@ -142,7 +140,7 @@ if (len < IEEE80211_HDRLEN + (reassoc ? sizeof(mgmt->u.reassoc_req) : sizeof(mgmt->u.assoc_req))) { -@@ -2528,6 +2547,13 @@ static void handle_assoc(struct hostapd_ +@@ -3051,6 +3068,13 @@ static void handle_assoc(struct hostapd_ } #endif /* CONFIG_MBO */ @@ -156,7 +154,24 @@ /* * sta->capability is used in check_assoc_ies() for RRM enabled * capability element. -@@ -3035,7 +3061,7 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3258,6 +3282,7 @@ static void handle_disassoc(struct hosta + wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", + MAC2STR(mgmt->sa), + le_to_host16(mgmt->u.disassoc.reason_code)); ++ hostapd_ubus_notify(hapd, "disassoc", mgmt->sa); + + sta = ap_get_sta(hapd, mgmt->sa); + if (sta == NULL) { +@@ -3323,6 +3348,8 @@ static void handle_deauth(struct hostapd + " reason_code=%d", + MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); + ++ hostapd_ubus_notify(hapd, "deauth", mgmt->sa); ++ + sta = ap_get_sta(hapd, mgmt->sa); + if (sta == NULL) { + wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " +@@ -3637,7 +3664,7 @@ int ieee802_11_mgmt(struct hostapd_data if (stype == WLAN_FC_STYPE_PROBE_REQ) { @@ -165,7 +180,7 @@ return 1; } -@@ -3053,17 +3079,17 @@ int ieee802_11_mgmt(struct hostapd_data +@@ -3657,17 +3684,17 @@ int ieee802_11_mgmt(struct hostapd_data switch (stype) { case WLAN_FC_STYPE_AUTH: wpa_printf(MSG_DEBUG, "mgmt::auth"); @@ -188,7 +203,7 @@ case WLAN_FC_STYPE_DISASSOC: --- a/src/ap/beacon.c +++ b/src/ap/beacon.c -@@ -702,7 +702,7 @@ void sta_track_claim_taxonomy_info(struc +@@ -716,7 +716,7 @@ void sta_track_claim_taxonomy_info(struc void handle_probe_req(struct hostapd_data *hapd, const struct ieee80211_mgmt *mgmt, size_t len, @@ -197,7 +212,7 @@ { u8 *resp; struct ieee802_11_elems elems; -@@ -711,9 +711,15 @@ void handle_probe_req(struct hostapd_dat +@@ -725,9 +725,15 @@ void handle_probe_req(struct hostapd_dat size_t i, resp_len; int noack; enum ssid_match_result res; @@ -213,7 +228,7 @@ if (len < IEEE80211_HDRLEN) return; -@@ -880,6 +886,12 @@ void handle_probe_req(struct hostapd_dat +@@ -894,6 +900,12 @@ void handle_probe_req(struct hostapd_dat } #endif /* CONFIG_P2P */ @@ -239,7 +254,7 @@ int ieee802_11_update_beacons(struct hostapd_iface *iface); --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -52,6 +52,10 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -116,6 +116,10 @@ int hostapd_notif_assoc(struct hostapd_d u16 reason = WLAN_REASON_UNSPECIFIED; u16 status = WLAN_STATUS_SUCCESS; const u8 *p2p_dev_addr = NULL; @@ -250,7 +265,7 @@ if (addr == NULL) { /* -@@ -131,6 +135,12 @@ int hostapd_notif_assoc(struct hostapd_d +@@ -195,6 +199,12 @@ int hostapd_notif_assoc(struct hostapd_d goto fail; } @@ -263,3 +278,39 @@ #ifdef CONFIG_P2P if (elems.p2p) { wpabuf_free(sta->p2p_ie); +--- a/src/ap/sta_info.c ++++ b/src/ap/sta_info.c +@@ -404,6 +404,7 @@ void ap_handle_timer(void *eloop_ctx, vo + HOSTAPD_LEVEL_INFO, "deauthenticated due to " + "local deauth request"); + ap_free_sta(hapd, sta); ++ hostapd_ubus_notify(hapd, "local-deauth", sta->addr); + return; + } + +@@ -551,6 +552,7 @@ skip_poll: + hapd, sta, + WLAN_REASON_PREV_AUTH_NOT_VALID); + ap_free_sta(hapd, sta); ++ hostapd_ubus_notify(hapd, "inactive-deauth", sta->addr); + break; + } + } +@@ -1212,6 +1214,7 @@ void ap_sta_set_authorized(struct hostap + buf, ip_addr); + } else { + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); ++ hostapd_ubus_notify(hapd, "disassoc", sta->addr); + + if (hapd->msg_ctx_parent && + hapd->msg_ctx_parent != hapd->msg_ctx) +--- a/src/ap/wpa_auth_glue.c ++++ b/src/ap/wpa_auth_glue.c +@@ -175,6 +175,7 @@ static void hostapd_wpa_auth_psk_failure + struct hostapd_data *hapd = ctx; + wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, + MAC2STR(addr)); ++ hostapd_ubus_notify(hapd, "key-mismatch", addr); + } + + diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index c24f63fd8..beb4388f7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -9,8 +9,10 @@ #include "utils/includes.h" #include "utils/common.h" #include "utils/eloop.h" +#include "utils/wpabuf.h" #include "common/ieee802_11_defs.h" #include "hostapd.h" +#include "neighbor_db.h" #include "wps_hostapd.h" #include "sta_info.h" #include "ubus.h" @@ -182,6 +184,37 @@ hostapd_bss_get_clients(struct ubus_context *ctx, struct ubus_object *obj, return 0; } +enum { + NOTIFY_RESPONSE, + __NOTIFY_MAX +}; + +static const struct blobmsg_policy notify_policy[__NOTIFY_MAX] = { + [NOTIFY_RESPONSE] = { "notify_response", BLOBMSG_TYPE_INT32 }, +}; + +static int +hostapd_notify_response(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct blob_attr *tb[__NOTIFY_MAX]; + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct wpabuf *elems; + const char *pos; + size_t len; + + blobmsg_parse(notify_policy, __NOTIFY_MAX, tb, + blob_data(msg), blob_len(msg)); + + if (!tb[NOTIFY_RESPONSE]) + return UBUS_STATUS_INVALID_ARGUMENT; + + hapd->ubus.notify_response = blobmsg_get_u32(tb[NOTIFY_RESPONSE]); + + return UBUS_STATUS_OK; +} + enum { DEL_CLIENT_ADDR, DEL_CLIENT_REASON, @@ -416,6 +449,170 @@ hostapd_vendor_elements(struct ubus_context *ctx, struct ubus_object *obj, return UBUS_STATUS_OK; } +static void +hostapd_rrm_print_nr(struct hostapd_neighbor_entry *nr) +{ + const u8 *data; + char *str; + int len; + + blobmsg_printf(&b, "", MACSTR, MAC2STR(nr->bssid)); + + str = blobmsg_alloc_string_buffer(&b, "", nr->ssid.ssid_len + 1); + memcpy(str, nr->ssid.ssid, nr->ssid.ssid_len); + str[nr->ssid.ssid_len] = 0; + blobmsg_add_string_buffer(&b); + + len = wpabuf_len(nr->nr); + str = blobmsg_alloc_string_buffer(&b, "", 2 * len + 1); + wpa_snprintf_hex(str, 2 * len + 1, wpabuf_head_u8(nr->nr), len); + blobmsg_add_string_buffer(&b); +} + +static int +hostapd_rrm_nr_get_own(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct hostapd_neighbor_entry *nr; + void *c; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + nr = hostapd_neighbor_get(hapd, hapd->own_addr, NULL); + if (!nr) + return UBUS_STATUS_NOT_FOUND; + + blob_buf_init(&b, 0); + + c = blobmsg_open_array(&b, "value"); + hostapd_rrm_print_nr(nr); + blobmsg_close_array(&b, c); + + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +static int +hostapd_rrm_nr_list(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct hostapd_neighbor_entry *nr; + void *c; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + blob_buf_init(&b, 0); + + c = blobmsg_open_array(&b, "list"); + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { + void *cur; + + if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) + continue; + + cur = blobmsg_open_array(&b, NULL); + hostapd_rrm_print_nr(nr); + blobmsg_close_array(&b, cur); + } + blobmsg_close_array(&b, c); + + ubus_send_reply(ctx, req, b.head); + + return 0; +} + +enum { + NR_SET_LIST, + __NR_SET_LIST_MAX +}; + +static const struct blobmsg_policy nr_set_policy[__NR_SET_LIST_MAX] = { + [NR_SET_LIST] = { "list", BLOBMSG_TYPE_ARRAY }, +}; + + +static void +hostapd_rrm_nr_clear(struct hostapd_data *hapd) +{ + struct hostapd_neighbor_entry *nr; + +restart: + dl_list_for_each(nr, &hapd->nr_db, struct hostapd_neighbor_entry, list) { + if (!memcmp(nr->bssid, hapd->own_addr, ETH_ALEN)) + continue; + + hostapd_neighbor_remove(hapd, nr->bssid, &nr->ssid); + goto restart; + } +} + +static int +hostapd_rrm_nr_set(struct ubus_context *ctx, struct ubus_object *obj, + struct ubus_request_data *req, const char *method, + struct blob_attr *msg) +{ + static const struct blobmsg_policy nr_e_policy[] = { + { .type = BLOBMSG_TYPE_STRING }, + { .type = BLOBMSG_TYPE_STRING }, + { .type = BLOBMSG_TYPE_STRING }, + }; + struct hostapd_data *hapd = get_hapd_from_object(obj); + struct blob_attr *tb_l[__NR_SET_LIST_MAX]; + struct blob_attr *tb[ARRAY_SIZE(nr_e_policy)]; + struct blob_attr *cur; + int ret = 0; + int rem; + + if (!(hapd->conf->radio_measurements[0] & WLAN_RRM_CAPS_NEIGHBOR_REPORT)) + return UBUS_STATUS_NOT_SUPPORTED; + + blobmsg_parse(nr_set_policy, __NR_SET_LIST_MAX, tb_l, blob_data(msg), blob_len(msg)); + if (!tb_l[NR_SET_LIST]) + return UBUS_STATUS_INVALID_ARGUMENT; + + hostapd_rrm_nr_clear(hapd); + blobmsg_for_each_attr(cur, tb_l[NR_SET_LIST], rem) { + struct wpa_ssid_value ssid; + struct wpabuf *data; + u8 bssid[ETH_ALEN]; + char *s; + + blobmsg_parse_array(nr_e_policy, ARRAY_SIZE(nr_e_policy), tb, blobmsg_data(cur), blobmsg_data_len(cur)); + if (!tb[0] || !tb[1] || !tb[2]) + goto invalid; + + s = blobmsg_get_string(tb[0]); + if (hwaddr_aton(s, bssid)) + goto invalid; + + s = blobmsg_get_string(tb[1]); + ssid.ssid_len = strlen(s); + if (ssid.ssid_len > sizeof(ssid.ssid)) + goto invalid; + + memcpy(&ssid, s, ssid.ssid_len); + data = wpabuf_parse_bin(blobmsg_get_string(tb[2])); + if (!data) + goto invalid; + + hostapd_neighbor_set(hapd, bssid, &ssid, data, NULL, NULL, 0); + wpabuf_free(data); + continue; + +invalid: + ret = UBUS_STATUS_INVALID_ARGUMENT; + } + + return 0; +} + static const struct ubus_method bss_methods[] = { UBUS_METHOD_NOARG("get_clients", hostapd_bss_get_clients), UBUS_METHOD("del_client", hostapd_bss_del_client, del_policy), @@ -427,6 +624,10 @@ static const struct ubus_method bss_methods[] = { UBUS_METHOD("switch_chan", hostapd_switch_chan, csa_policy), #endif UBUS_METHOD("set_vendor_elements", hostapd_vendor_elements, ve_policy), + UBUS_METHOD("notify_response", hostapd_notify_response, notify_policy), + UBUS_METHOD_NOARG("rrm_nr_get_own", hostapd_rrm_nr_get_own), + UBUS_METHOD_NOARG("rrm_nr_list", hostapd_rrm_nr_list), + UBUS_METHOD("rrm_nr_set", hostapd_rrm_nr_set, nr_set_policy), }; static struct ubus_object_type bss_object_type = @@ -523,6 +724,11 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req blobmsg_add_u32(&b, "signal", req->frame_info->ssi_signal); blobmsg_add_u32(&b, "freq", hapd->iface->freq); + if (!hapd->ubus.notify_response) { + ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); + return 0; + } + if (ubus_notify_async(ctx, &hapd->ubus.obj, type, b.head, &ureq.nreq)) return 0; @@ -534,3 +740,17 @@ int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_req return 0; } + +void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *addr) +{ + if (!hapd->ubus.obj.has_subscribers) + return; + + if (!addr) + return; + + blob_buf_init(&b, 0); + blobmsg_add_macaddr(&b, "address", addr); + + ubus_notify(ctx, &hapd->ubus.obj, type, b.head, -1); +} diff --git a/package/network/services/hostapd/src/src/ap/ubus.h b/package/network/services/hostapd/src/src/ap/ubus.h index 479ddfca7..e3ff981c7 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.h +++ b/package/network/services/hostapd/src/src/ap/ubus.h @@ -37,6 +37,7 @@ struct hostapd_ubus_iface { struct hostapd_ubus_bss { struct ubus_object obj; struct avl_tree banned; + int notify_response; }; void hostapd_ubus_add_iface(struct hostapd_iface *iface); @@ -45,6 +46,7 @@ void hostapd_ubus_add_bss(struct hostapd_data *hapd); void hostapd_ubus_free_bss(struct hostapd_data *hapd); int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct hostapd_ubus_request *req); +void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac); #else @@ -73,6 +75,9 @@ static inline int hostapd_ubus_handle_event(struct hostapd_data *hapd, struct ho return 0; } +static inline void hostapd_ubus_notify(struct hostapd_data *hapd, const char *type, const u8 *mac) +{ +} #endif #endif diff --git a/package/network/services/ipset-dns/Makefile b/package/network/services/ipset-dns/Makefile index 2adc9fe03..3f21d04c4 100644 --- a/package/network/services/ipset-dns/Makefile +++ b/package/network/services/ipset-dns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=http://git.zx2c4.com/ipset-dns -PKG_SOURCE_DATE:=2013-05-03 -PKG_SOURCE_VERSION:=6be3afd819a86136b51c5ae722ab48266187155b -PKG_MIRROR_HASH:=4e34943b547babe705c2fad295ee24a5ee0c93ca03e2a9cdeaf323150f97e60b +PKG_SOURCE_DATE:=2017-10-08 +PKG_SOURCE_VERSION:=ade2cf88e933f4f90451e0a6171f0aa4a523f989 +PKG_MIRROR_HASH:=34ad1f5c7d2eab90b795f2a512102891428216e3d439d918a8992846550e9697 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch b/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch deleted file mode 100644 index 19669a05b..000000000 --- a/package/network/services/ipset-dns/patches/100-simultaneous-ipv4-ipv6.patch +++ /dev/null @@ -1,57 +0,0 @@ ---- a/ipset-dns.c -+++ b/ipset-dns.c -@@ -307,19 +307,20 @@ int main(int argc, char *argv[]) - struct timeval tv; - char msg[512]; - char ip[INET6_ADDRSTRLEN]; -- char *ipset; -+ char *ipset, *ipset6; - int listen_sock, upstream_sock; - int pos, i, size, af; - socklen_t len; - size_t received; - pid_t child; - -- if (argc != 4) { -- fprintf(stderr, "Usage: %s ipset port upstream\n", argv[0]); -+ if (argc != 5) { -+ fprintf(stderr, "Usage: %s ipv4-ipset ipv6-ipset port upstream\n", argv[0]); - return 1; - } - - ipset = argv[1]; -+ ipset6 = argv[2]; - - listen_sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP); - if (listen_sock < 0) { -@@ -329,7 +330,7 @@ int main(int argc, char *argv[]) - - memset(&listen_addr, 0, sizeof(listen_addr)); - listen_addr.sin_family = AF_INET; -- listen_addr.sin_port = htons(atoi(argv[2])); -+ listen_addr.sin_port = htons(atoi(argv[3])); - listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - i = 1; - setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i)); -@@ -341,7 +342,7 @@ int main(int argc, char *argv[]) - memset(&upstream_addr, 0, sizeof(upstream_addr)); - upstream_addr.sin_family = AF_INET; - upstream_addr.sin_port = htons(53); -- inet_aton(argv[3], &upstream_addr.sin_addr); -+ inet_aton(argv[4], &upstream_addr.sin_addr); - - /* TODO: Put all of the below code in several forks all listening on the same sock. */ - -@@ -434,8 +435,11 @@ int main(int argc, char *argv[]) - continue; - } - -+ if ((af == AF_INET && !*ipset) || (af == AF_INET6 && !*ipset6)) -+ continue; -+ - printf("%s: %s\n", answer.dotted, ip); -- if (add_to_ipset(ipset, answer.rdata, af) < 0) -+ if (add_to_ipset((af == AF_INET) ? ipset : ipset6, answer.rdata, af) < 0) - perror("add_to_ipset"); - } - diff --git a/package/network/services/lldpd/Makefile b/package/network/services/lldpd/Makefile index 344d682ad..cdd8f99d5 100644 --- a/package/network/services/lldpd/Makefile +++ b/package/network/services/lldpd/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=lldpd -PKG_VERSION:=0.9.7 +PKG_VERSION:=0.9.9 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://media.luffy.cx/files/lldpd -PKG_HASH:=b9360355c30a3c06fd5c0a6e658f2ad8bf77037d5a17c6fcabf20e62882e0db8 +PKG_HASH:=5e9e08f500d21376631cbc9f8e19a4b167cd38eb2d8fd9e660b8e80507f802db PKG_MAINTAINER:=Stijn Tintel PKG_LICENSE:=ISC diff --git a/package/network/services/lldpd/files/lldpd.config b/package/network/services/lldpd/files/lldpd.config index d2b3d1545..36b43c89d 100644 --- a/package/network/services/lldpd/files/lldpd.config +++ b/package/network/services/lldpd/files/lldpd.config @@ -10,7 +10,7 @@ config lldpd config option lldp_location "2:FR:6:Commercial Rd:3:Roseville:19:4" # if empty, the distribution description is sent - #option lldp_description "Lede System" + #option lldp_description "OpenWrt System" # interfaces to listen on list interface "loopback" diff --git a/package/network/services/lldpd/files/lldpd.init b/package/network/services/lldpd/files/lldpd.init index 39bce989b..c3d9ba050 100644 --- a/package/network/services/lldpd/files/lldpd.init +++ b/package/network/services/lldpd/files/lldpd.init @@ -16,7 +16,7 @@ find_release_info() [ -z "$PRETTY_NAME" ] && [ -s /etc/openwrt_version ] && \ PRETTY_NAME="$(cat /etc/openwrt_version)" - echo "${PRETTY_NAME:-Unknown Lede release} @ $(cat /proc/sys/kernel/hostname)" + echo "${PRETTY_NAME:-Unknown OpenWrt release} @ $(cat /proc/sys/kernel/hostname)" } write_lldpd_conf() diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile index 5ba9e7c7e..16c903db3 100644 --- a/package/network/services/odhcpd/Makefile +++ b/package/network/services/odhcpd/Makefile @@ -8,54 +8,95 @@ include $(TOPDIR)/rules.mk PKG_NAME:=odhcpd -PKG_RELEASE:=2 +PKG_RELEASE:=1 +PKG_VERSION:=1.3 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/odhcpd.git -PKG_SOURCE_DATE:=2017-10-02 -PKG_SOURCE_VERSION:=c6f3d5d4ea5154e5971fa0b1b1e9a9c07119429f -PKG_MIRROR_HASH:=5ce8f52b5c6acea27d9733918e9c3bc8a154d516a02eef9b172c5e3d459f494c +PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git +PKG_SOURCE_DATE:=2017-12-22 +PKG_SOURCE_VERSION:=7aa2594c5a127d92fa8f04328ac7b43e595bcaa7 +PKG_MIRROR_HASH:=67ce9303ce2f7a47ca9c54e1ebd984f108066ab0fa4e0d81f39a9cfc2431f90b PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) + +PKG_INSTALL:=1 +PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk -CMAKE_OPTIONS += -DUBUS=1 - -ifneq ($(CONFIG_PACKAGE_odhcpd_ext_cer_id),0) - CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_ext_cer_id) -endif - - -define Package/odhcpd +define Package/odhcpd/default SECTION:=net CATEGORY:=Network - TITLE:=OpenWrt DHCP/DHCPv6(-PD)/RA Server & Relay + TITLE:=OpenWrt DHCPv6(-PD)/RA Server & Relay DEPENDS:=+libubox +libuci +libubus +libnl-tiny endef -define Package/odhcpd/config - config PACKAGE_odhcpd_ext_cer_id - int "CER-ID Extension ID (0 = disabled)" - depends on PACKAGE_odhcpd - default 0 -endef - -define Package/odhcpd/description +define Package/odhcpd/default/description odhcpd is a daemon for serving and relaying IP management protocols to configure clients and downstream routers. It tries to follow the RFC 6204 requirements for IPv6 home routers. - - odhcpd provides server services for DHCP, RA, stateless and stateful DHCPv6, - prefix delegation and can be used to relay RA, DHCPv6 and NDP between routed - (non-bridged) interfaces in case no delegated prefixes are available. endef +define Package/odhcpd/default/config +menu "Configuration" + depends on PACKAGE_$(1) + +config PACKAGE_odhcpd_$(2)_ext_cer_id + int + default 0 + prompt "CER-ID Extension ID (0 = disabled)" +endmenu +endef + +define Package/odhcpd + $(call Package/odhcpd/default) + TITLE += and DHCPv4 server + VARIANT:=full +endef + +Package/odhcpd/config=$(call Package/odhcpd/default/config,odhcpd,full) + +define Package/odhcpd/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for DHCPv4, RA, stateless and + stateful DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and + NDP between routed (non-bridged) interfaces in case no delegated prefixes + are available. +endef + +define Package/odhcpd-ipv6only + $(call Package/odhcpd/default) + VARIANT:=ipv6only +endef + +Package/odhcpd-ipv6only/config=$(call Package/odhcpd/default/config,odhcpd-ipv6only,ipv6only) + +define Package/odhcpd-ipv6only/description + $(call Package/odhcpd/default/description) + + This is a variant providing server services for RA, stateless and stateful + DHCPv6, prefix delegation and can be used to relay RA, DHCPv6 and NDP between + routed (non-bridged) interfaces in case no delegated prefixes are available. +endef + +CMAKE_OPTIONS += -DUBUS=1 + +ifeq ($(BUILD_VARIANT),full) + CMAKE_OPTIONS += -DDHCPV4_SUPPORT=1 +endif + +ifneq ($(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id),0) + CMAKE_OPTIONS += -DEXT_CER_ID=$(CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id) +endif + define Package/odhcpd/install $(INSTALL_DIR) $(1)/usr/sbin/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/odhcpd $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/odhcpd $(1)/usr/sbin/ $(INSTALL_BIN) ./files/odhcpd-update $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_BIN) ./files/odhcpd.init $(1)/etc/init.d/odhcpd @@ -63,4 +104,7 @@ define Package/odhcpd/install $(INSTALL_BIN) ./files/odhcpd.defaults $(1)/etc/uci-defaults endef +Package/odhcpd-ipv6only/install = $(Package/odhcpd/install) + $(eval $(call BuildPackage,odhcpd)) +$(eval $(call BuildPackage,odhcpd-ipv6only)) diff --git a/package/network/services/odhcpd/files/odhcpd.defaults b/package/network/services/odhcpd/files/odhcpd.defaults index 175e56e9b..cecbdd4a8 100644 --- a/package/network/services/odhcpd/files/odhcpd.defaults +++ b/package/network/services/odhcpd/files/odhcpd.defaults @@ -22,6 +22,7 @@ set dhcp.odhcpd=odhcpd set dhcp.odhcpd.maindhcp=0 set dhcp.odhcpd.leasefile=/tmp/hosts/odhcpd set dhcp.odhcpd.leasetrigger=/usr/sbin/odhcpd-update +set dhcp.odhcpd.loglevel=4 set dhcp.lan.dhcpv6=$MODE set dhcp.lan.ra=$MODE commit dhcp diff --git a/package/network/services/omcproxy/Makefile b/package/network/services/omcproxy/Makefile index 473e96884..28de833a1 100644 --- a/package/network/services/omcproxy/Makefile +++ b/package/network/services/omcproxy/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omcproxy -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://github.com/sbyx/omcproxy.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/omcproxy/files/omcproxy.init b/package/network/services/omcproxy/files/omcproxy.init index a12979208..970b3a128 100644 --- a/package/network/services/omcproxy/files/omcproxy.init +++ b/package/network/services/omcproxy/files/omcproxy.init @@ -51,7 +51,7 @@ omcproxy_add_firewall() { config_get uplink $1 uplink config_get downlink $1 downlink - upzone=$(fw3 network $uplink) + upzone=$(fw3 -q network $uplink 2>/dev/null) [ -n "$upzone" ] || return 0 json_add_object "" @@ -77,7 +77,7 @@ omcproxy_add_firewall() { json_close_object for network in $downlink; do - downzone=$(fw3 network $network) + downzone=$(fw3 -q network $network 2>/dev/null) [ -n "$downzone" ] || continue json_add_object "" diff --git a/package/network/services/openvpn-easy-rsa/Makefile b/package/network/services/openvpn-easy-rsa/Makefile index 5b7d9be21..f4b479986 100644 --- a/package/network/services/openvpn-easy-rsa/Makefile +++ b/package/network/services/openvpn-easy-rsa/Makefile @@ -9,19 +9,18 @@ include $(TOPDIR)/rules.mk PKG_NAME:=openvpn-easy-rsa -PKG_RELEASE=2 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa.git -PKG_SOURCE_DATE:=2013-01-30 -PKG_SOURCE_VERSION:=ff5bfd1dd8e548cb24d302742af3894f893ef92f -PKG_MIRROR_HASH:=c87704b3906a0c14f51c6677151a9389f698523c7ec07f7c75489ca31786f128 +PKG_VERSION:=3.0.1 +PKG_RELEASE:=1 +PKG_SOURCE_URL:=https://github.com/OpenVPN/easy-rsa/releases/download/$(PKG_VERSION)/ +PKG_SOURCE:=EasyRSA-$(PKG_VERSION).tgz +PKG_HASH:=dbdaf5b9444b99e0c5221fd4bcf15384c62380c1b63cea23d42239414d7b2d4e PKG_LICENSE:=GPL-2.0 +PKG_BUILD_DIR:=$(BUILD_DIR)/EasyRSA-$(PKG_VERSION) include $(INCLUDE_DIR)/package.mk define Package/openvpn-easy-rsa - TITLE:=Simple shell scripts to manage a Certificate Authority + TITLE:=CLI utility to build and manage a PKI CA. SECTION:=net CATEGORY:=Network URL:=http://openvpn.net @@ -30,9 +29,8 @@ define Package/openvpn-easy-rsa endef define Package/openvpn-easy-rsa/conffiles -/etc/easy-rsa/keys/serial -/etc/easy-rsa/keys/index.txt /etc/easy-rsa/vars +/etc/easy-rsa/openssl-1.0.cnf endef define Build/Configure @@ -45,13 +43,24 @@ endef define Package/openvpn-easy-rsa/install $(INSTALL_DIR) $(1)/usr/sbin - $(CP) $(PKG_BUILD_DIR)/easy-rsa/2.0/{build-*,clean-all,inherit-inter,list-crl,pkitool,revoke-full,sign-req,whichopensslcnf} $(1)/usr/sbin/ + + $(INSTALL_BIN) $(PKG_BUILD_DIR)/easyrsa $(1)/usr/sbin/ $(INSTALL_DIR) $(1)/etc/easy-rsa - $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/openssl-1.0.0.cnf $(1)/etc/easy-rsa/openssl-1.0.0.cnf - $(INSTALL_DATA) $(PKG_BUILD_DIR)/easy-rsa/2.0/vars $(1)/etc/easy-rsa/vars - $(INSTALL_DIR) $(1)/etc/easy-rsa/keys - $(INSTALL_DATA) files/easy-rsa.index $(1)/etc/easy-rsa/keys/index.txt - $(INSTALL_DATA) files/easy-rsa.serial $(1)/etc/easy-rsa/keys/serial + $(INSTALL_DATA) $(PKG_BUILD_DIR)/openssl-1.0.cnf $(1)/etc/easy-rsa/openssl-1.0.cnf + $(INSTALL_DATA) $(PKG_BUILD_DIR)/vars.example $(1)/etc/easy-rsa/vars + + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki + chmod 700 $(1)/etc/easy-rsa/pki + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/private + chmod 700 $(1)/etc/easy-rsa/pki/private + $(INSTALL_DIR) $(1)/etc/easy-rsa/pki/reqs + chmod 700 $(1)/etc/easy-rsa/pki/reqs + + $(INSTALL_DIR) $(1)/etc/easy-rsa/x509-types + $(INSTALL_DATA) $(PKG_BUILD_DIR)/x509-types/* $(1)/etc/easy-rsa/x509-types/ + + $(INSTALL_DIR) $(1)/lib/upgrade/keep.d + $(INSTALL_DATA) files/openvpn-easy-rsa.upgrade $(1)/lib/upgrade/keep.d/$(PKG_NAME) endef $(eval $(call BuildPackage,openvpn-easy-rsa)) diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.index b/package/network/services/openvpn-easy-rsa/files/easy-rsa.index deleted file mode 100644 index e69de29bb..000000000 diff --git a/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial b/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial deleted file mode 100644 index 8a0f05e16..000000000 --- a/package/network/services/openvpn-easy-rsa/files/easy-rsa.serial +++ /dev/null @@ -1 +0,0 @@ -01 diff --git a/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade new file mode 100644 index 000000000..8110b81a4 --- /dev/null +++ b/package/network/services/openvpn-easy-rsa/files/openvpn-easy-rsa.upgrade @@ -0,0 +1 @@ +/etc/easy-rsa/pki/ diff --git a/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch b/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch deleted file mode 100644 index 4c1b889e3..000000000 --- a/package/network/services/openvpn-easy-rsa/patches/100-run-ootb.patch +++ /dev/null @@ -1,152 +0,0 @@ ---- a/easy-rsa/2.0/build-ca -+++ b/easy-rsa/2.0/build-ca -@@ -5,4 +5,4 @@ - # - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --initca $* -+"/usr/sbin/pkitool" --interact --initca $* ---- a/easy-rsa/2.0/build-dh -+++ b/easy-rsa/2.0/build-dh -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Build Diffie-Hellman parameters for the server side - # of an SSL/TLS connection. - ---- a/easy-rsa/2.0/build-inter -+++ b/easy-rsa/2.0/build-inter -@@ -4,4 +4,4 @@ - # root certificate. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --inter $* -+"/usr/sbin/pkitool" --interact --inter $* ---- a/easy-rsa/2.0/build-key -+++ b/easy-rsa/2.0/build-key -@@ -4,4 +4,4 @@ - # root certificate. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact $* -+"/usr/sbin/pkitool" --interact $* ---- a/easy-rsa/2.0/build-key-pass -+++ b/easy-rsa/2.0/build-key-pass -@@ -4,4 +4,4 @@ - # with a password. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --pass $* -+"/usr/sbin/pkitool" --interact --pass $* ---- a/easy-rsa/2.0/build-key-pkcs12 -+++ b/easy-rsa/2.0/build-key-pkcs12 -@@ -5,4 +5,4 @@ - # the CA certificate as well. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --pkcs12 $* -+"/usr/sbin/pkitool" --interact --pkcs12 $* ---- a/easy-rsa/2.0/build-key-server -+++ b/easy-rsa/2.0/build-key-server -@@ -7,4 +7,4 @@ - # extension in the openssl.cnf file. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --server $* -+"/usr/sbin/pkitool" --interact --server $* ---- a/easy-rsa/2.0/build-req -+++ b/easy-rsa/2.0/build-req -@@ -4,4 +4,4 @@ - # when your root certificate and key is not available locally. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --csr $* -+"/usr/sbin/pkitool" --interact --csr $* ---- a/easy-rsa/2.0/build-req-pass -+++ b/easy-rsa/2.0/build-req-pass -@@ -4,4 +4,4 @@ - # with a password. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --csr --pass $* -+"/usr/sbin/pkitool" --interact --csr --pass $* ---- a/easy-rsa/2.0/clean-all -+++ b/easy-rsa/2.0/clean-all -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Initialize the $KEY_DIR directory. - # Note that this script does a - # rm -rf on $KEY_DIR so be careful! ---- a/easy-rsa/2.0/inherit-inter -+++ b/easy-rsa/2.0/inherit-inter -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # Build a new PKI which is rooted on an intermediate certificate generated - # by ./build-inter or ./pkitool --inter from a parent PKI. The new PKI should - # have independent vars settings, and must use a different KEY_DIR directory ---- a/easy-rsa/2.0/list-crl -+++ b/easy-rsa/2.0/list-crl -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # list revoked certificates - - CRL="${1:-crl.pem}" ---- a/easy-rsa/2.0/pkitool -+++ b/easy-rsa/2.0/pkitool -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # OpenVPN -- An application to securely tunnel IP networks - # over a single TCP/UDP port, with support for SSL/TLS-based - # session authentication and key exchange, ---- a/easy-rsa/2.0/revoke-full -+++ b/easy-rsa/2.0/revoke-full -@@ -1,5 +1,7 @@ - #!/bin/sh - -+. /etc/easy-rsa/vars -+ - # revoke a certificate, regenerate CRL, - # and verify revocation - ---- a/easy-rsa/2.0/sign-req -+++ b/easy-rsa/2.0/sign-req -@@ -4,4 +4,4 @@ - # with a local root certificate and key. - - export EASY_RSA="${EASY_RSA:-.}" --"$EASY_RSA/pkitool" --interact --sign $* -+"/usr/sbin/pkitool" --interact --sign $* ---- a/easy-rsa/2.0/vars -+++ b/easy-rsa/2.0/vars -@@ -12,7 +12,7 @@ - # This variable should point to - # the top level of the easy-rsa - # tree. --export EASY_RSA="`pwd`" -+export EASY_RSA="/etc/easy-rsa" - - # - # This variable should point to -@@ -26,7 +26,7 @@ - # This variable should point to - # the openssl.cnf file included - # with easy-rsa. --export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA` -+export KEY_CONFIG=`/usr/sbin/whichopensslcnf $EASY_RSA` - - # Edit this variable to point to - # your soon-to-be-created key diff --git a/package/network/services/openvpn/Makefile b/package/network/services/openvpn/Makefile index fee0296ed..ec48e734f 100644 --- a/package/network/services/openvpn/Makefile +++ b/package/network/services/openvpn/Makefile @@ -25,6 +25,7 @@ PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:openvpn:openvpn include $(INCLUDE_DIR)/package.mk diff --git a/package/network/services/relayd/Makefile b/package/network/services/relayd/Makefile index dcb69a11b..7f1c1f941 100644 --- a/package/network/services/relayd/Makefile +++ b/package/network/services/relayd/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=relayd PKG_RELEASE:=2 -PKG_SOURCE_URL=$(LEDE_GIT)/project/relayd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/relayd.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2016-02-07 PKG_SOURCE_VERSION:=ad0b25ad74345d367c62311e14b279f5ccb8ef13 diff --git a/package/network/services/samba36/Makefile b/package/network/services/samba36/Makefile index beb5f309c..42c23b4e8 100644 --- a/package/network/services/samba36/Makefile +++ b/package/network/services/samba36/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=samba PKG_VERSION:=3.6.25 -PKG_RELEASE:=8 +PKG_RELEASE:=9 PKG_SOURCE_URL:=https://download.samba.org/pub/samba \ https://download.samba.org/pub/samba/stable @@ -18,8 +18,7 @@ PKG_HASH:=8f2c8a7f2bd89b0dfd228ed917815852f7c625b2bc0936304ac3ed63aaf83751 PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=COPYING - -PKG_MAINTAINER:=Felix Fietkau +PKG_CPE_ID:=cpe:/a:samba:samba PKG_BUILD_PARALLEL:=1 @@ -30,19 +29,29 @@ CONFIGURE_PATH:=source3 PKG_BUILD_BIN:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/bin -define Package/samba36-server +define Package/samba/Default SECTION:=net CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS server + TITLE:=Samba 3.6 SMB/CIFS URL:=https://www.samba.org/ + MAINTAINER:=Felix Fietkau +endef + +define Package/samba36-server + $(call Package/samba/Default) + TITLE+= server DEPENDS:=+USE_GLIBC:librt $(ICONV_DEPENDS) endef define Package/samba36-client - SECTION:=net - CATEGORY:=Network - TITLE:=Samba 3.6 SMB/CIFS client - URL:=https://www.samba.org/ + $(call Package/samba/Default) + TITLE+= client + DEPENDS:=+libreadline +libncurses +endef + +define Package/samba36-net + $(call Package/samba/Default) + TITLE+= net commands DEPENDS:=+libreadline +libncurses endef @@ -51,7 +60,6 @@ define Package/samba36-server/config int "Maximum level of compiled-in debug messages" depends on PACKAGE_samba36-server || PACKAGE_samba36-client default -1 - endef define Package/samba36-server/description @@ -156,6 +164,12 @@ define Package/samba36-client/install $(INSTALL_BIN) $(PKG_BUILD_BIN)/nmblookup $(1)/usr/sbin endef +define Package/samba36-net/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_BIN)/net $(1)/usr/sbin +endef + $(eval $(call BuildPackage,samba36-client)) $(eval $(call BuildPackage,samba36-server)) +$(eval $(call BuildPackage,samba36-net)) diff --git a/package/network/services/samba36/files/samba.config b/package/network/services/samba36/files/samba.config index b34a8dcaa..c79db0d32 100644 --- a/package/network/services/samba36/files/samba.config +++ b/package/network/services/samba36/files/samba.config @@ -1,6 +1,6 @@ config samba - option 'name' 'Lede' + option 'name' 'OpenWrt' option 'workgroup' 'WORKGROUP' - option 'description' 'Lede' + option 'description' 'OpenWrt' option 'homes' '1' diff --git a/package/network/services/samba36/files/samba.init b/package/network/services/samba36/files/samba.init index 28b0064df..ae0e0e230 100755 --- a/package/network/services/samba36/files/samba.init +++ b/package/network/services/samba36/files/samba.init @@ -23,9 +23,9 @@ smb_header() { local name workgroup description charset local hostname="$(uci_get system.@system[0].hostname)" - config_get name $1 name "${hostname:-Lede}" - config_get workgroup $1 workgroup "${hostname:-Lede}" - config_get description $1 description "Samba on ${hostname:-Lede}" + config_get name $1 name "${hostname:-OpenWrt}" + config_get workgroup $1 workgroup "${hostname:-OpenWrt}" + config_get description $1 description "Samba on ${hostname:-OpenWrt}" config_get charset $1 charset "UTF-8" mkdir -p /var/etc diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile index 465e54349..648916385 100644 --- a/package/network/services/uhttpd/Makefile +++ b/package/network/services/uhttpd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=uhttpd PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uhttpd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git PKG_SOURCE_DATE:=2017-11-04 PKG_SOURCE_VERSION:=a235636a2687fafb9c474e4b134a59ff66425c92 PKG_MIRROR_HASH:=626392a485e8ab8085bb55d9424b176be9143529db59a820a7de71061a93a007 @@ -19,6 +19,7 @@ PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=ISC PKG_BUILD_DEPENDS = ustream-ssl +PKG_CONFIG_DEPENDS:= CONFIG_uhttpd_lua include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -43,12 +44,12 @@ define Package/uhttpd/description endef define Package/uhttpd/config - config PACKAGE_uhttpd_debug - bool "Build with debug messages" - default n + config uhttpd_lua + depends on PACKAGE_uhttpd-mod-lua + bool "Enable Integrated Lua interpreter" + default y endef - define Package/uhttpd-mod-lua $(Package/uhttpd/default) TITLE+= (Lua plugin) @@ -106,6 +107,16 @@ define Package/uhttpd-mod-ubus/install $(INSTALL_DATA) ./files/ubus.default $(1)/etc/uci-defaults/00_uhttpd_ubus endef +define Package/uhttpd-mod-lua/postinst + $(if $(CONFIG_uhttpd_lua), + #!/bin/sh + if [ -f $${IPKG_INSTROOT}/www/index.html ] + then + sed -e 's:/cgi-bin::g' -i $${IPKG_INSTROOT}/www/index.html + fi + ,) +endef + $(eval $(call BuildPackage,uhttpd)) $(eval $(call BuildPackage,uhttpd-mod-lua)) diff --git a/package/network/services/uhttpd/files/uhttpd.config b/package/network/services/uhttpd/files/uhttpd.config index 89f99aaee..a7d769e18 100644 --- a/package/network/services/uhttpd/files/uhttpd.config +++ b/package/network/services/uhttpd/files/uhttpd.config @@ -51,8 +51,8 @@ config uhttpd main # Lua url prefix and handler script. # Lua support is disabled if no prefix given. -# option lua_prefix /luci -# option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua + option lua_prefix /luci + option lua_handler /usr/lib/lua/luci/sgi/uhttpd.lua # Specify the ubus-rpc prefix and socket path. # option ubus_prefix /ubus @@ -83,7 +83,7 @@ config uhttpd main option tcp_keepalive 1 # Basic auth realm, defaults to local hostname -# option realm Lede +# option realm OpenWrt # Configuration file in busybox httpd format # option config /etc/httpd.conf diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init index 6b8be1c7e..47270bcc1 100755 --- a/package/network/services/uhttpd/files/uhttpd.init +++ b/package/network/services/uhttpd/files/uhttpd.init @@ -52,7 +52,7 @@ generate_keys() { [ -n "$GENKEY_CMD" ] && { $GENKEY_CMD \ -days ${days:-730} -newkey rsa:${bits:-2048} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \ - -subj /C="${country:-DE}"/ST="${state:-Saxony}"/L="${location:-Leipzig}"/O="${commonname:-Lede}$UNIQUEID"/CN="${commonname:-Lede}" + -subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}" sync mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}" mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}" diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index cdafa5be1..ffbc3fed3 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=umdns PKG_RELEASE:=1 -PKG_SOURCE_URL=$(LEDE_GIT)/project/mdnsd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2017-05-22 -PKG_SOURCE_VERSION:=0e8b948ff8dd1cb1763180c99b522390529c7841 -PKG_MIRROR_HASH:=1cdd25464e1be69bef56092bc8547ba254ffc2d7c32f13cf02a80c8742876f1b +PKG_SOURCE_DATE:=2018-01-02 +PKG_SOURCE_VERSION:=78974417e182a3de8f78b7d73366ec0c98396b6c +PKG_MIRROR_HASH:=a60f9eb9428ac3256cd7c3c6d4207c116cedf4d212b82e2f86c1bf7c7898fcbb PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 diff --git a/package/network/utils/adb-enablemodem/Makefile b/package/network/utils/adb-enablemodem/Makefile new file mode 100644 index 000000000..3ffc64af0 --- /dev/null +++ b/package/network/utils/adb-enablemodem/Makefile @@ -0,0 +1,26 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=adb-enablemodem +PKG_VERSION:=2017-03-05 +PKG_RELEASE:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/adb-enablemodem + SECTION:=net + CATEGORY:=Network + SUBMENU:=WWAN + TITLE:=Enable modem via adb + DEPENDS:=+adb +endef + +define Build/Compile + true +endef + +define Package/adb-enablemodem/install + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/adb-enablemodem $(1)/etc/init.d/adb-enablemodem +endef + +$(eval $(call BuildPackage,adb-enablemodem)) diff --git a/package/network/utils/adb-enablemodem/files/adb-enablemodem b/package/network/utils/adb-enablemodem/files/adb-enablemodem new file mode 100644 index 000000000..ddfc681a0 --- /dev/null +++ b/package/network/utils/adb-enablemodem/files/adb-enablemodem @@ -0,0 +1,64 @@ +#!/bin/sh /etc/rc.common + +START=99 + +adb_exec() { + adb -s "$serial" shell "( $1 ) >/dev/null 2>&1"'; printf "\nEXIT_CODE: %i\n" $?' | head -c 64 | grep -qx 'EXIT_CODE: 0\r\?' +} + +enablemodem_do() { + logger -t adb-enablemodem 'INFO: waiting for device' + adb wait-for-device + serial="$(adb get-serialno)" + + vendor_id="$(adb -s "$serial" shell 'uci get product.usb.vid' | head -c 16 | tr -d '\r\n')" + product_id="$(adb -s "$serial" shell 'uci get product.usb.pid' | head -c 16 | tr -d '\r\n')" + + case "$vendor_id:$product_id" in + "0x2357:0x000D") # TP-LINK LTE MODULE + case "$1" in + start) + if adb_exec ' + chmod +x /WEBSERVER/www/cgi-bin/* + fds="$(ls /proc/$$/fd | grep -v "^[012]$")" + for fd in $fds; do + eval "exec $fd>&-" + done + start-stop-daemon -x httpd -S -- -h /WEBSERVER/www/ + '; then + logger -t adb-enablemodem 'INFO: httpd on modem started' + else + logger -t adb-enablemodem 'ERROR: failed to start httpd on modem' + fi + option_newid='/sys/bus/usb-serial/drivers/option1/new_id' + if [ -e "$option_newid" ]; then + printf '%s %s' "$vendor_id" "$product_id" > "$option_newid" + fi + ;; + stop) + if adb_exec 'start-stop-daemon -x httpd -K'; then + logger -t adb-enablemodem 'INFO: httpd on modem stopped' + else + logger -t adb-enablemodem 'ERROR: failed to stop httpd on modem' + fi + ;; + esac + ;; + *) + logger -t adb-enablemodem "ERROR: unknown device $vendor_id:$product_id" + ;; + esac +} + +start() { + ( enablemodem_do start ) & +} + +stop() { + ( enablemodem_do stop ) & +} + +restart() { + ( enablemodem_do stop; enablemodem_do start ) & +} + diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile index d2fd2593a..d1168ae68 100644 --- a/package/network/utils/arptables/Makefile +++ b/package/network/utils/arptables/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=arptables PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/arptables +PKG_SOURCE_URL:=https://git.netfilter.org/arptables PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2015-05-20 PKG_SOURCE_VERSION:=f4ab8f63f11a72f14687a6646d04ae1bae3fa45f diff --git a/package/network/utils/comgt/Makefile b/package/network/utils/comgt/Makefile index ce99a2a68..3b7f4b902 100644 --- a/package/network/utils/comgt/Makefile +++ b/package/network/utils/comgt/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=comgt PKG_VERSION:=0.32 -PKG_RELEASE:=29 +PKG_RELEASE:=30 PKG_SOURCE:=$(PKG_NAME).$(PKG_VERSION).tgz PKG_SOURCE_URL:=@SF/comgt diff --git a/package/network/utils/comgt/files/ncm.json b/package/network/utils/comgt/files/ncm.json index 8f74e173d..bbdb30c5e 100644 --- a/package/network/utils/comgt/files/ncm.json +++ b/package/network/utils/comgt/files/ncm.json @@ -63,5 +63,16 @@ }, "connect": "AT*ENAP=1,${profile}", "disconnect": "AT*ENAP=0" + }, + "mtk1": { + "initialize": [ + "AT+CFUN=1" + ], + "configure": [ + "AT+CGDCONT=${profile},\\\"${pdptype}\\\",\\\"${apn}\\\",0,0" + ], + "connect": "AT+CGACT=1,${profile}", + "finalize": "AT+CGDATA=\\\"M-MBIM\\\",${profile},1", + "disconnect": "AT+CGACT=0,${profile}" } } diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 73d1e05e3..60b39655e 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -25,7 +25,7 @@ proto_ncm_init_config() { proto_ncm_setup() { local interface="$1" - local manufacturer initialize setmode connect ifname devname devpath + local manufacturer initialize setmode connect finalize ifname devname devpath local device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS json_get_vars device apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS @@ -105,9 +105,21 @@ proto_ncm_setup() { return 1 } } + + json_get_values configure configure + echo "Configuring modem" + for i in $configure; do + eval COMMAND="$i" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { + echo "Failed to configure modem" + proto_notify_error "$interface" CONFIGURE_FAILED + return 1 + } + done + [ -n "$mode" ] && { json_select modes json_get_var setmode "$mode" + echo "Setting mode" eval COMMAND="$setmode" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to set operating mode" proto_notify_error "$interface" SETMODE_FAILED @@ -118,14 +130,16 @@ proto_ncm_setup() { echo "Starting network $interface" json_get_vars connect + echo "Connecting modem" eval COMMAND="$connect" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { echo "Failed to connect" proto_notify_error "$interface" CONNECT_FAILED return 1 } + json_get_vars finalize + echo "Setting up $ifname" - proto_init_update "$ifname" 1 proto_add_data json_add_string "manufacturer" "$manufacturer" @@ -150,6 +164,15 @@ proto_ncm_setup() { proto_add_dynamic_defaults ubus call network add_dynamic "$(json_dump)" } + + [ -n "$finalize" ] && { + eval COMMAND="$finalize" gcom -d "$device" -s /etc/gcom/runcommand.gcom || { + echo "Failed to configure modem" + proto_notify_error "$interface" FINALIZE_FAILED + return 1 + } + } + } proto_ncm_teardown() { diff --git a/package/network/utils/conntrack-tools/Makefile b/package/network/utils/conntrack-tools/Makefile index 128fa9e6f..f04ac69d2 100644 --- a/package/network/utils/conntrack-tools/Makefile +++ b/package/network/utils/conntrack-tools/Makefile @@ -8,18 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=conntrack-tools -PKG_VERSION:=1.4.4 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:= \ - http://www.netfilter.org/projects/conntrack-tools/files \ - ftp://ftp.netfilter.org/pub/conntrack-tools \ - http://mirrors.evolva.ro/netfilter.org/conntrack-tools -PKG_HASH:=b7caf4fcc4c03575df57d25e5216584d597fd916c891f191dac616ce68bdba6c +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/conntrack-tools +PKG_SOURCE_DATE:=2017-09-27 +PKG_SOURCE_VERSION:=eefe649ca51ed0cbb995454cdc366f5072f6443c +PKG_MIRROR_HASH:=1c207c3e423d741fbb31e3c29486a811e6dad493f26ec47a2df75b6262a1b4bd PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:conntrack-tools_project:conntrack-tools PKG_FIXUP:=autoreconf PKG_INSTALL:=1 diff --git a/package/network/utils/curl/Config.in b/package/network/utils/curl/Config.in index 6fa10b678..973da3d96 100644 --- a/package/network/utils/curl/Config.in +++ b/package/network/utils/curl/Config.in @@ -9,8 +9,8 @@ choice config LIBCURL_MBEDTLS bool "mbed TLS" - config LIBCURL_CYASSL - bool "CyaSSL" + config LIBCURL_WOLFSSL + bool "wolfSSL" config LIBCURL_OPENSSL bool "OpenSSL" @@ -101,6 +101,10 @@ config LIBCURL_TFTP bool "TFTP protocol" default n +config LIBCURL_NGHTTP2 + bool "HTTP2 protocol" + default n + comment "Miscellaneous" config LIBCURL_PROXY diff --git a/package/network/utils/curl/Makefile b/package/network/utils/curl/Makefile index 5d829547a..17fcf704d 100644 --- a/package/network/utils/curl/Makefile +++ b/package/network/utils/curl/Makefile @@ -8,20 +8,19 @@ include $(TOPDIR)/rules.mk PKG_NAME:=curl -PKG_VERSION:=7.52.1 -PKG_RELEASE:=6 +PKG_VERSION:=7.57.0 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://curl.haxx.se/download/ \ - http://www.mirrorspace.org/curl/ \ - ftp://ftp.sunet.se/pub/www/utilities/curl/ \ - ftp://ftp.planetmirror.com/pub/curl/ \ - http://www.mirrormonster.com/curl/download/ \ - http://curl.mirrors.cyberservers.net/download/ -PKG_HASH:=d16185a767cb2c1ba3d5b9096ec54e5ec198b213f45864a38b3bda4bbf87389b +PKG_SOURCE_URL:=https://dl.uxnr.de/mirror/curl/ \ + http://curl.mirror.anstey.ca/ \ + http://curl.askapache.com/download/ \ + https://curl.haxx.se/download/ +PKG_HASH:=c92fe31a348eae079121b73884065e600c533493eb50f1f6cee9c48a3f454826 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_CPE_ID:=cpe:/a:haxx:libcurl PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -29,7 +28,7 @@ PKG_BUILD_PARALLEL:=1 PKG_CONFIG_DEPENDS:= \ CONFIG_IPV6 \ \ - CONFIG_LIBCURL_CYASSL \ + CONFIG_LIBCURL_WOLFSSL \ CONFIG_LIBCURL_GNUTLS \ CONFIG_LIBCURL_OPENSSL \ CONFIG_LIBCURL_MBEDTLS \ @@ -55,6 +54,7 @@ PKG_CONFIG_DEPENDS:= \ CONFIG_LIBCURL_SMTP \ CONFIG_LIBCURL_TELNET \ CONFIG_LIBCURL_TFTP \ + CONFIG_LIBCURL_NGHTTP2 \ \ CONFIG_LIBCURL_COOKIES \ CONFIG_LIBCURL_CRYPTO_AUTH \ @@ -86,8 +86,9 @@ define Package/libcurl $(call Package/curl/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:= +LIBCURL_CYASSL:libcyassl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls - DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn +LIBCURL_SSH2:libssh2 + DEPENDS:= +LIBCURL_WOLFSSL:libwolfssl +LIBCURL_OPENSSL:libopenssl +LIBCURL_GNUTLS:libgnutls +LIBCURL_MBEDTLS:libmbedtls + DEPENDS += +LIBCURL_ZLIB:zlib +LIBCURL_THREADED_RESOLVER:libpthread +LIBCURL_LDAP:libopenldap +LIBCURL_LIBIDN:libidn + DEPENDS += +LIBCURL_SSH2:libssh2 +LIBCURL_NGHTTP2:libnghttp2 TITLE:=A client-side URL transfer library MENU:=1 endef @@ -113,7 +114,7 @@ CONFIGURE_ARGS += \ \ $(call autoconf_bool,CONFIG_IPV6,ipv6) \ \ - $(if $(CONFIG_LIBCURL_CYASSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ + $(if $(CONFIG_LIBCURL_WOLFSSL),--with-cyassl="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-cyassl) \ $(if $(CONFIG_LIBCURL_GNUTLS),--with-gnutls="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-gnutls) \ $(if $(CONFIG_LIBCURL_OPENSSL),--with-ssl="$(STAGING_DIR)/usr" --without-ca-bundle --with-ca-path=/etc/ssl/certs,--without-ssl) \ $(if $(CONFIG_LIBCURL_MBEDTLS),--with-mbedtls="$(STAGING_DIR)/usr" --without-ca-path --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt,--without-mbedtls) \ @@ -121,6 +122,7 @@ CONFIGURE_ARGS += \ $(if $(CONFIG_LIBCURL_LIBIDN),--with-libidn="$(STAGING_DIR)/usr",--without-libidn) \ $(if $(CONFIG_LIBCURL_SSH2),--with-libssh2="$(STAGING_DIR)/usr",--without-libssh2) \ $(if $(CONFIG_LIBCURL_ZLIB),--with-zlib="$(STAGING_DIR)/usr",--without-zlib) \ + $(if $(CONFIG_LIBCURL_NGHTTP2),--with-nghttp2="$(STAGING_DIR)/usr",--without-nghttp2) \ \ $(call autoconf_bool,CONFIG_LIBCURL_DICT,dict) \ $(call autoconf_bool,CONFIG_LIBCURL_FILE,file) \ diff --git a/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch b/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch deleted file mode 100644 index 9658ef554..000000000 --- a/package/network/utils/curl/patches/001-curl-https-openssl-fix.patch +++ /dev/null @@ -1,34 +0,0 @@ -From a7b38c9dc98481e4a5fc37e51a8690337c674dfb Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Mon, 26 Dec 2016 00:06:33 +0100 -Subject: [PATCH] vtls: s/SSLEAY/OPENSSL - -Fixed an old leftover use of the USE_SSLEAY define which would make a -socket get removed from the applications sockets to monitor when the -multi_socket API was used, leading to timeouts. - -Bug: #1174 ---- - lib/vtls/vtls.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/lib/vtls/vtls.c -+++ b/lib/vtls/vtls.c -@@ -484,7 +484,7 @@ void Curl_ssl_close_all(struct Curl_easy - curlssl_close_all(data); - } - --#if defined(USE_SSLEAY) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ -+#if defined(USE_OPENSSL) || defined(USE_GNUTLS) || defined(USE_SCHANNEL) || \ - defined(USE_DARWINSSL) || defined(USE_NSS) - /* This function is for OpenSSL, GnuTLS, darwinssl, and schannel only. */ - int Curl_ssl_getsock(struct connectdata *conn, curl_socket_t *socks, -@@ -518,7 +518,7 @@ int Curl_ssl_getsock(struct connectdata - (void)numsocks; - return GETSOCK_BLANK; - } --/* USE_SSLEAY || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ -+/* USE_OPENSSL || USE_GNUTLS || USE_SCHANNEL || USE_DARWINSSL || USE_NSS */ - #endif - - void Curl_ssl_close(struct connectdata *conn, int sockindex) diff --git a/package/network/utils/curl/patches/100-CVE-2017-2629.patch b/package/network/utils/curl/patches/100-CVE-2017-2629.patch deleted file mode 100644 index f2cd869c5..000000000 --- a/package/network/utils/curl/patches/100-CVE-2017-2629.patch +++ /dev/null @@ -1,33 +0,0 @@ -From a00a42b4abe8363a46071bb3b43b1b7138f5259b Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Sun, 22 Jan 2017 18:11:55 +0100 -Subject: [PATCH] TLS: make SSL_VERIFYSTATUS work again - -The CURLOPT_SSL_VERIFYSTATUS option was not properly handled by libcurl -and thus even if the status couldn't be verified, the connection would -be allowed and the user would not be told about the failed verification. - -Regression since cb4e2be7c6d42ca - -CVE-2017-2629 -Bug: https://curl.haxx.se/docs/adv_20170222.html - -Reported-by: Marcus Hoffmann ---- - lib/url.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/lib/url.c -+++ b/lib/url.c -@@ -4141,8 +4141,11 @@ static struct connectdata *allocate_conn - conn->bits.ftp_use_epsv = data->set.ftp_use_epsv; - conn->bits.ftp_use_eprt = data->set.ftp_use_eprt; - -+ conn->ssl_config.verifystatus = data->set.ssl.primary.verifystatus; - conn->ssl_config.verifypeer = data->set.ssl.primary.verifypeer; - conn->ssl_config.verifyhost = data->set.ssl.primary.verifyhost; -+ conn->proxy_ssl_config.verifystatus = -+ data->set.proxy_ssl.primary.verifystatus; - conn->proxy_ssl_config.verifypeer = data->set.proxy_ssl.primary.verifypeer; - conn->proxy_ssl_config.verifyhost = data->set.proxy_ssl.primary.verifyhost; - diff --git a/package/network/utils/curl/patches/101-CVE-2017-7407.patch b/package/network/utils/curl/patches/101-CVE-2017-7407.patch deleted file mode 100644 index ba8097b0e..000000000 --- a/package/network/utils/curl/patches/101-CVE-2017-7407.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 6019f1795b4e3b72507b84b0e02dc8c32024f562 Mon Sep 17 00:00:00 2001 -From: Dan Fandrich -Date: Sat, 11 Mar 2017 10:59:34 +0100 -Subject: [PATCH] CVE-2017-7407: fixed - -Bug: https://curl.haxx.se/docs/adv_20170403.html - -Reported-by: Brian Carpenter ---- - src/tool_writeout.c | 6 +++--- - tests/data/Makefile.inc | 2 +- - tests/data/test1440 | 31 +++++++++++++++++++++++++++++++ - tests/data/test1441 | 31 +++++++++++++++++++++++++++++++ - tests/data/test1442 | 35 +++++++++++++++++++++++++++++++++++ - 5 files changed, 101 insertions(+), 4 deletions(-) - create mode 100644 tests/data/test1440 - create mode 100644 tests/data/test1441 - create mode 100644 tests/data/test1442 - ---- a/src/tool_writeout.c -+++ b/src/tool_writeout.c -@@ -5,7 +5,7 @@ - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * -- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. -+ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms -@@ -113,7 +113,7 @@ void ourWriteOut(CURL *curl, struct OutS - double doubleinfo; - - while(ptr && *ptr) { -- if('%' == *ptr) { -+ if('%' == *ptr && ptr[1]) { - if('%' == ptr[1]) { - /* an escaped %-letter */ - fputc('%', stream); -@@ -341,7 +341,7 @@ void ourWriteOut(CURL *curl, struct OutS - } - } - } -- else if('\\' == *ptr) { -+ else if('\\' == *ptr && ptr[1]) { - switch(ptr[1]) { - case 'r': - fputc('\r', stream); ---- a/tests/data/Makefile.inc -+++ b/tests/data/Makefile.inc -@@ -150,7 +150,7 @@ test1408 test1409 test1410 test1411 test - test1416 test1417 test1418 test1419 test1420 test1421 test1422 test1423 \ - test1424 \ - test1428 test1429 test1430 test1431 test1432 test1433 test1434 test1435 \ --test1436 test1437 test1438 test1439 \ -+test1436 test1437 test1438 test1439 test1440 test1441 test1442 \ - \ - test1500 test1501 test1502 test1503 test1504 test1505 test1506 test1507 \ - test1508 test1509 test1510 test1511 test1512 test1513 test1514 test1515 \ ---- /dev/null -+++ b/tests/data/test1440 -@@ -0,0 +1,31 @@ -+ -+ -+ -+--write-out -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing %{ -+ -+ -+file://localhost/%PWD/log/ --write-out '%{' -+ -+ -+ -+# Verify data -+ -+ -+%{ -+ -+ -+ ---- /dev/null -+++ b/tests/data/test1441 -@@ -0,0 +1,31 @@ -+ -+ -+ -+--write-out -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing % -+ -+ -+file://localhost/%PWD/log/ --write-out '%' -+ -+ -+ -+# Verify data -+ -+ -+% -+ -+ -+ ---- /dev/null -+++ b/tests/data/test1442 -@@ -0,0 +1,35 @@ -+ -+ -+ -+--write-out -+FILE -+ -+ -+# Server-side -+ -+ -+ -+# Client-side -+ -+ -+file -+ -+ -+ -+Check --write-out with trailing \ -+ -+ -+file://localhost/%PWD/log/non-existent-file.txt --write-out '\' -+ -+ -+ -+# Verify data -+ -+ -+37 -+ -+ -+\ -+ -+ -+ diff --git a/package/network/utils/curl/patches/102-CVE-2017-7468.patch b/package/network/utils/curl/patches/102-CVE-2017-7468.patch deleted file mode 100644 index 72f51455d..000000000 --- a/package/network/utils/curl/patches/102-CVE-2017-7468.patch +++ /dev/null @@ -1,264 +0,0 @@ -From 8166b637bce299f4ac64d371c20cd5afea72c364 Mon Sep 17 00:00:00 2001 -From: Jay Satiro -Date: Wed, 22 Mar 2017 01:59:49 -0400 -Subject: [PATCH] TLS: Fix switching off SSL session id when client cert is - used - -- Move the sessionid flag to ssl_primary_config so that ssl and - proxy_ssl will each have their own sessionid flag. - -Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that -this issue had been fixed in 247d890, CVE-2016-5419. - -Bug: https://github.com/curl/curl/issues/1341 -Reported-by: lijian996@users.noreply.github.com ---- - lib/url.c | 5 +++-- - lib/urldata.h | 2 +- - lib/vtls/axtls.c | 4 ++-- - lib/vtls/cyassl.c | 4 ++-- - lib/vtls/darwinssl.c | 2 +- - lib/vtls/gtls.c | 4 ++-- - lib/vtls/mbedtls.c | 4 ++-- - lib/vtls/nss.c | 2 +- - lib/vtls/openssl.c | 4 ++-- - lib/vtls/polarssl.c | 4 ++-- - lib/vtls/schannel.c | 4 ++-- - lib/vtls/vtls.c | 9 ++++++--- - 12 files changed, 26 insertions(+), 22 deletions(-) - ---- a/lib/url.c -+++ b/lib/url.c -@@ -548,7 +548,7 @@ CURLcode Curl_init_userdefined(struct Us - #endif - set->ssh_auth_types = CURLSSH_AUTH_DEFAULT; /* defaults to any auth - type */ -- set->general_ssl.sessionid = TRUE; /* session ID caching enabled by -+ set->ssl.primary.sessionid = TRUE; /* session ID caching enabled by - default */ - set->proxy_ssl = set->ssl; - -@@ -2470,8 +2470,9 @@ CURLcode Curl_setopt(struct Curl_easy *d - break; - - case CURLOPT_SSL_SESSIONID_CACHE: -- data->set.general_ssl.sessionid = (0 != va_arg(param, long)) ? -+ data->set.ssl.primary.sessionid = (0 != va_arg(param, long)) ? - TRUE : FALSE; -+ data->set.proxy_ssl.primary.sessionid = data->set.ssl.primary.sessionid; - break; - - #ifdef USE_LIBSSH2 ---- a/lib/urldata.h -+++ b/lib/urldata.h -@@ -354,6 +354,7 @@ struct ssl_primary_config { - char *random_file; /* path to file containing "random" data */ - char *egdsocket; /* path to file containing the EGD daemon socket */ - char *cipher_list; /* list of ciphers to use */ -+ bool sessionid; /* cache session IDs or not */ - }; - - struct ssl_config_data { -@@ -383,7 +384,6 @@ struct ssl_config_data { - }; - - struct ssl_general_config { -- bool sessionid; /* cache session IDs or not */ - size_t max_ssl_sessions; /* SSL session id cache size */ - }; - ---- a/lib/vtls/axtls.c -+++ b/lib/vtls/axtls.c -@@ -256,7 +256,7 @@ static CURLcode connect_prep(struct conn - * 2) setting up callbacks. these seem gnutls specific - */ - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - const uint8_t *ssl_sessionid; - size_t ssl_idsize; - -@@ -386,7 +386,7 @@ static CURLcode connect_finish(struct co - conn->send[sockindex] = axtls_send; - - /* Put our freshly minted SSL session in cache */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - const uint8_t *ssl_sessionid = ssl_get_session_id_size(ssl); - size_t ssl_idsize = ssl_get_session_id(ssl); - Curl_ssl_sessionid_lock(conn); ---- a/lib/vtls/cyassl.c -+++ b/lib/vtls/cyassl.c -@@ -383,7 +383,7 @@ cyassl_connect_step1(struct connectdata - #endif /* HAVE_ALPN */ - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -597,7 +597,7 @@ cyassl_connect_step3(struct connectdata - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - SSL_SESSION *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/darwinssl.c -+++ b/lib/vtls/darwinssl.c -@@ -1541,7 +1541,7 @@ static CURLcode darwinssl_connect_step1( - #endif /* CURL_BUILD_MAC_10_9 || CURL_BUILD_IOS_7 */ - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - char *ssl_sessionid; - size_t ssl_sessionid_len; - ---- a/lib/vtls/gtls.c -+++ b/lib/vtls/gtls.c -@@ -782,7 +782,7 @@ gtls_connect_step1(struct connectdata *c - - /* This might be a reconnect, so we check for a session ID in the cache - to speed up things */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid; - size_t ssl_idsize; - -@@ -1311,7 +1311,7 @@ gtls_connect_step3(struct connectdata *c - conn->recv[sockindex] = gtls_recv; - conn->send[sockindex] = gtls_send; - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - /* we always unconditionally get the session id here, as even if we - already got it from the cache and asked to use it in the connection, it - might've been rejected and then a new one is in use now and we need to ---- a/lib/vtls/mbedtls.c -+++ b/lib/vtls/mbedtls.c -@@ -374,7 +374,7 @@ mbed_connect_step1(struct connectdata *c - mbedtls_ssl_list_ciphersuites()); - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *old_session = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -618,7 +618,7 @@ mbed_connect_step3(struct connectdata *c - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - int ret; - mbedtls_ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/nss.c -+++ b/lib/vtls/nss.c -@@ -1696,7 +1696,7 @@ static CURLcode nss_setup_connect(struct - goto error; - - /* do not use SSL cache if disabled or we are not going to verify peer */ -- ssl_no_cache = (data->set.general_ssl.sessionid -+ ssl_no_cache = (SSL_SET_OPTION(primary.sessionid) - && SSL_CONN_CONFIG(verifypeer)) ? PR_FALSE : PR_TRUE; - if(SSL_OptionSet(model, SSL_NO_CACHE, ssl_no_cache) != SECSuccess) - goto error; ---- a/lib/vtls/openssl.c -+++ b/lib/vtls/openssl.c -@@ -2161,7 +2161,7 @@ static CURLcode ossl_connect_step1(struc - #endif - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *ssl_sessionid = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -2915,7 +2915,7 @@ static CURLcode ossl_connect_step3(struc - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - SSL_SESSION *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/polarssl.c -+++ b/lib/vtls/polarssl.c -@@ -327,7 +327,7 @@ polarssl_connect_step1(struct connectdat - ssl_set_ciphersuites(&connssl->ssl, ssl_list_ciphersuites()); - - /* Check if there's a cached ID we can/should use here! */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - void *old_session = NULL; - - Curl_ssl_sessionid_lock(conn); -@@ -555,7 +555,7 @@ polarssl_connect_step3(struct connectdat - - DEBUGASSERT(ssl_connect_3 == connssl->connecting_state); - -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - int ret; - ssl_session *our_ssl_sessionid; - void *old_ssl_sessionid = NULL; ---- a/lib/vtls/schannel.c -+++ b/lib/vtls/schannel.c -@@ -145,7 +145,7 @@ schannel_connect_step1(struct connectdat - connssl->cred = NULL; - - /* check for an existing re-usable credential handle */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - Curl_ssl_sessionid_lock(conn); - if(!Curl_ssl_getsessionid(conn, (void **)&old_cred, NULL, sockindex)) { - connssl->cred = old_cred; -@@ -714,7 +714,7 @@ schannel_connect_step3(struct connectdat - #endif - - /* save the current session data for possible re-use */ -- if(data->set.general_ssl.sessionid) { -+ if(SSL_SET_OPTION(primary.sessionid)) { - bool incache; - struct curl_schannel_cred *old_cred = NULL; - ---- a/lib/vtls/vtls.c -+++ b/lib/vtls/vtls.c -@@ -120,6 +120,9 @@ Curl_clone_primary_ssl_config(struct ssl - CLONE_STRING(egdsocket); - CLONE_STRING(random_file); - CLONE_STRING(clientcert); -+ -+ /* Disable dest sessionid cache if a client cert is used, CVE-2016-5419. */ -+ dest->sessionid = (dest->clientcert ? false : source->sessionid); - return TRUE; - } - -@@ -293,9 +296,9 @@ bool Curl_ssl_getsessionid(struct connec - int port = isProxy ? (int)conn->port : conn->remote_port; - *ssl_sessionid = NULL; - -- DEBUGASSERT(data->set.general_ssl.sessionid); -+ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - -- if(!data->set.general_ssl.sessionid) -+ if(!SSL_SET_OPTION(primary.sessionid)) - /* session ID re-use is disabled */ - return TRUE; - -@@ -397,7 +400,7 @@ CURLcode Curl_ssl_addsessionid(struct co - &conn->proxy_ssl_config : - &conn->ssl_config; - -- DEBUGASSERT(data->set.general_ssl.sessionid); -+ DEBUGASSERT(SSL_SET_OPTION(primary.sessionid)); - - clone_host = strdup(isProxy ? conn->http_proxy.host.name : conn->host.name); - if(!clone_host) diff --git a/package/network/utils/curl/patches/103-CVE-2017-1000100.patch b/package/network/utils/curl/patches/103-CVE-2017-1000100.patch deleted file mode 100644 index 93ab97bd1..000000000 --- a/package/network/utils/curl/patches/103-CVE-2017-1000100.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 358b2b131ad6c095696f20dcfa62b8305263f898 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Tue, 1 Aug 2017 17:16:46 +0200 -Subject: [PATCH] tftp: reject file name lengths that don't fit - -... and thereby avoid telling send() to send off more bytes than the -size of the buffer! - -CVE-2017-1000100 - -Bug: https://curl.haxx.se/docs/adv_20170809B.html -Reported-by: Even Rouault - -Credit to OSS-Fuzz for the discovery ---- - lib/tftp.c | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - ---- a/lib/tftp.c -+++ b/lib/tftp.c -@@ -5,7 +5,7 @@ - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * -- * Copyright (C) 1998 - 2016, Daniel Stenberg, , et al. -+ * Copyright (C) 1998 - 2017, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms -@@ -490,6 +490,11 @@ static CURLcode tftp_send_first(tftp_sta - if(result) - return result; - -+ if(strlen(filename) > (state->blksize - strlen(mode) - 4)) { -+ failf(data, "TFTP file name too long\n"); -+ return CURLE_TFTP_ILLEGAL; /* too long file name field */ -+ } -+ - snprintf((char *)state->spacket.data+2, - state->blksize, - "%s%c%s%c", filename, '\0', mode, '\0'); diff --git a/package/network/utils/curl/patches/104-CVE-2017-1000101.patch b/package/network/utils/curl/patches/104-CVE-2017-1000101.patch deleted file mode 100644 index 835b73eef..000000000 --- a/package/network/utils/curl/patches/104-CVE-2017-1000101.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 453e7a7a03a2cec749abd3878a48e728c515cca7 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Tue, 1 Aug 2017 17:16:07 +0200 -Subject: [PATCH] glob: do not continue parsing after a strtoul() overflow - range - -Added test 1289 to verify. - -CVE-2017-1000101 - -Bug: https://curl.haxx.se/docs/adv_20170809A.html -Reported-by: Brian Carpenter ---- - src/tool_urlglob.c | 5 ++++- - tests/data/Makefile.inc | 2 +- - tests/data/test1289 | 35 +++++++++++++++++++++++++++++++++++ - 3 files changed, 40 insertions(+), 2 deletions(-) - create mode 100644 tests/data/test1289 - ---- a/src/tool_urlglob.c -+++ b/src/tool_urlglob.c -@@ -272,7 +272,10 @@ static CURLcode glob_range(URLGlob *glob - } - errno = 0; - max_n = strtoul(pattern, &endp, 10); -- if(errno || (*endp == ':')) { -+ if(errno) -+ /* overflow */ -+ endp = NULL; -+ else if(*endp == ':') { - pattern = endp+1; - errno = 0; - step_n = strtoul(pattern, &endp, 10); diff --git a/package/network/utils/curl/patches/105-CVE-2017-8816.patch b/package/network/utils/curl/patches/105-CVE-2017-8816.patch deleted file mode 100644 index 4d2b3162a..000000000 --- a/package/network/utils/curl/patches/105-CVE-2017-8816.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 7947c50bcd09cf471c95511739bc66d2cb506ee2 Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Mon, 6 Nov 2017 23:51:52 +0100 -Subject: [PATCH] ntlm: avoid integer overflow for malloc size - -Reported-by: Alex Nichols -Assisted-by: Kamil Dudka and Max Dymond - -CVE-2017-8816 - -Bug: https://curl.haxx.se/docs/adv_2017-11e7.html ---- - lib/curl_ntlm_core.c | 23 +++++++++++++++++++++-- - 1 file changed, 21 insertions(+), 2 deletions(-) - -diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index 1309bf0d9..e8962769c 100644 ---- a/lib/curl_ntlm_core.c -+++ b/lib/curl_ntlm_core.c -@@ -616,23 +616,42 @@ CURLcode Curl_hmac_md5(const unsigned char *key, unsigned int keylen, - Curl_HMAC_final(ctxt, output); - - return CURLE_OK; - } - -+#ifndef SIZE_T_MAX -+/* some limits.h headers have this defined, some don't */ -+#if defined(_LP64) || defined(_I32LPx) -+#define SIZE_T_MAX 18446744073709551615U -+#else -+#define SIZE_T_MAX 4294967295U -+#endif -+#endif -+ - /* This creates the NTLMv2 hash by using NTLM hash as the key and Unicode - * (uppercase UserName + Domain) as the data - */ - CURLcode Curl_ntlm_core_mk_ntlmv2_hash(const char *user, size_t userlen, - const char *domain, size_t domlen, - unsigned char *ntlmhash, - unsigned char *ntlmv2hash) - { - /* Unicode representation */ -- size_t identity_len = (userlen + domlen) * 2; -- unsigned char *identity = malloc(identity_len); -+ size_t identity_len; -+ unsigned char *identity; - CURLcode result = CURLE_OK; - -+ /* we do the length checks below separately to avoid integer overflow risk -+ on extreme data lengths */ -+ if((userlen > SIZE_T_MAX/2) || -+ (domlen > SIZE_T_MAX/2) || -+ ((userlen + domlen) > SIZE_T_MAX/2)) -+ return CURLE_OUT_OF_MEMORY; -+ -+ identity_len = (userlen + domlen) * 2; -+ identity = malloc(identity_len); -+ - if(!identity) - return CURLE_OUT_OF_MEMORY; - - ascii_uppercase_to_unicode_le(identity, user, userlen); - ascii_to_unicode_le(identity + (userlen << 1), domain, domlen); --- -2.15.0 - diff --git a/package/network/utils/curl/patches/106-CVE-2017-8817.patch b/package/network/utils/curl/patches/106-CVE-2017-8817.patch deleted file mode 100644 index 9e904f0b4..000000000 --- a/package/network/utils/curl/patches/106-CVE-2017-8817.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 0acc0c7c120afa6d60bfc7932c04361720b6e74d Mon Sep 17 00:00:00 2001 -From: Daniel Stenberg -Date: Fri, 10 Nov 2017 08:52:45 +0100 -Subject: [PATCH] wildcardmatch: fix heap buffer overflow in setcharset - -The code would previous read beyond the end of the pattern string if the -match pattern ends with an open bracket when the default pattern -matching function is used. - -Detected by OSS-Fuzz: -https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4161 - -CVE-2017-8817 - -Bug: https://curl.haxx.se/docs/adv_2017-ae72.html ---- - lib/curl_fnmatch.c | 9 +++------ - tests/data/Makefile.inc | 2 +- - tests/data/test1163 | 52 +++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 56 insertions(+), 7 deletions(-) - create mode 100644 tests/data/test1163 - -diff --git a/lib/curl_fnmatch.c b/lib/curl_fnmatch.c -index da83393b4..8a1e106c4 100644 ---- a/lib/curl_fnmatch.c -+++ b/lib/curl_fnmatch.c -@@ -131,10 +131,13 @@ static int setcharset(unsigned char **p, unsigned char *charset) - unsigned char lastchar = 0; - bool something_found = FALSE; - unsigned char c; - for(;;) { - c = **p; -+ if(!c) -+ return SETCHARSET_FAIL; -+ - switch(state) { - case CURLFNM_SCHS_DEFAULT: - if(ISALNUM(c)) { /* ASCII value */ - rangestart = c; - charset[c] = 1; -@@ -195,13 +198,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) - (*p)++; - } - else - return SETCHARSET_FAIL; - } -- else if(c == '\0') { -- return SETCHARSET_FAIL; -- } - else { - charset[c] = 1; - (*p)++; - something_found = TRUE; - } -@@ -276,13 +276,10 @@ static int setcharset(unsigned char **p, unsigned char *charset) - (*p)++; - } - else if(c == ']') { - return SETCHARSET_OK; - } -- else if(c == '\0') { -- return SETCHARSET_FAIL; -- } - else if(ISPRINT(c)) { - charset[c] = 1; - (*p)++; - state = CURLFNM_SCHS_DEFAULT; - } -diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc -index dc1cc03bc..6eb37d81d 100644 ---- a/tests/data/Makefile.inc.1 2017-11-29 20:00:26.126452486 +0000 -+++ b/tests/data/Makefile.inc 2017-11-29 20:01:13.057783732 +0000 -@@ -121,6 +121,7 @@ - test1128 test1129 test1130 test1131 test1132 test1133 test1134 test1135 \ - test1136 test1137 test1138 test1139 test1140 test1141 test1142 test1143 \ - test1144 \ -+test1163 \ - test1200 test1201 test1202 test1203 test1204 test1205 test1206 test1207 \ - test1208 test1209 test1210 test1211 test1212 test1213 test1214 test1215 \ - test1216 test1217 test1218 test1219 \ -diff --git a/tests/data/test1163 b/tests/data/test1163 -new file mode 100644 -index 000000000..a109b511b ---- /dev/null -+++ b/tests/data/test1163 -@@ -0,0 +1,52 @@ -+ -+ -+ -+FTP -+RETR -+LIST -+wildcardmatch -+ftplistparser -+flaky -+ -+ -+ -+# -+# Server-side -+ -+ -+ -+ -+ -+# Client-side -+ -+ -+ftp -+ -+ -+lib576 -+ -+ -+FTP wildcard with pattern ending with an open-bracket -+ -+ -+"ftp://%HOSTIP:%FTPPORT/fully_simulated/DOS/*[][" -+ -+ -+ -+ -+USER anonymous -+PASS ftp@example.com -+PWD -+CWD fully_simulated -+CWD DOS -+EPSV -+TYPE A -+LIST -+QUIT -+ -+# 78 == CURLE_REMOTE_FILE_NOT_FOUND -+ -+78 -+ -+ -+ --- -2.15.0 - diff --git a/package/network/utils/curl/patches/200-no_docs_tests.patch b/package/network/utils/curl/patches/200-no_docs_tests.patch index 139c05e64..a2a685125 100644 --- a/package/network/utils/curl/patches/200-no_docs_tests.patch +++ b/package/network/utils/curl/patches/200-no_docs_tests.patch @@ -1,22 +1,22 @@ --- a/Makefile.am +++ b/Makefile.am -@@ -153,7 +153,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) +@@ -156,7 +156,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) bin_SCRIPTS = curl-config - SUBDIRS = lib src include --DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts -+DIST_SUBDIRS = $(SUBDIRS) packages + SUBDIRS = lib src +-DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs ++DIST_SUBDIRS = $(SUBDIRS) packages include pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcurl.pc ---- a/Makefile.in -+++ b/Makefile.in -@@ -613,7 +613,7 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) +@@ -267,8 +267,8 @@ cygwinbin: + # We extend the standard install with a custom hook: + install-data-hook: + cd include && $(MAKE) install +- cd docs && $(MAKE) install +- cd docs/libcurl && $(MAKE) install ++ #cd docs && $(MAKE) install ++ #cd docs/libcurl && $(MAKE) install - bin_SCRIPTS = curl-config - SUBDIRS = lib src include --DIST_SUBDIRS = $(SUBDIRS) tests packages docs scripts -+DIST_SUBDIRS = $(SUBDIRS) packages - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libcurl.pc - LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c \ + # We extend the standard uninstall with a custom hook: + uninstall-hook: diff --git a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch index 22b838daa..aabf274ac 100644 --- a/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch +++ b/package/network/utils/curl/patches/310-mbedtls-disable-runtime-version-check.patch @@ -1,8 +1,8 @@ --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c -@@ -724,7 +724,7 @@ void Curl_mbedtls_session_free(void *ptr +@@ -814,7 +814,7 @@ static void Curl_mbedtls_session_free(vo - size_t Curl_mbedtls_version(char *buffer, size_t size) + static size_t Curl_mbedtls_version(char *buffer, size_t size) { - unsigned int version = mbedtls_version_get_number(); + unsigned int version = MBEDTLS_VERSION_NUMBER; diff --git a/package/network/utils/ebtables/Makefile b/package/network/utils/ebtables/Makefile index da7b7416a..693b4d8f0 100644 --- a/package/network/utils/ebtables/Makefile +++ b/package/network/utils/ebtables/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ebtables -PKG_SOURCE_DATE:=2015-10-28 +PKG_SOURCE_DATE:=2017-10-24 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/ebtables +PKG_SOURCE_URL:=https://git.netfilter.org/ebtables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=4c3e5cd3dbae3ea773e9dcca7cf019b2713af70d -PKG_MIRROR_HASH:=997a877da02d6e2141e6d31c5d4dd005737facecfdbea07308c0e1286db8591c +PKG_SOURCE_VERSION:=6a826591878db3fa9e2a94b87a3d5edd8e0fc442 +PKG_MIRROR_HASH:=7100f34f8d9373c88a788e8161f8158b364b4d6c87f766fc353382b6111196bd PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iperf/Makefile b/package/network/utils/iperf/Makefile index ea8f02631..2f420a2e2 100644 --- a/package/network/utils/iperf/Makefile +++ b/package/network/utils/iperf/Makefile @@ -8,17 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=2.0.9 -PKG_VERSION_SUFFIX:=a +PKG_VERSION:=2.0.10 PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)$(PKG_VERSION_SUFFIX).tar.gz -# Temporary URL change - iperf upstream altered the already released target -# without bumping the version number. The new tarball is renamed to avoid -# conflicts with existing mirrored files. -# PKG_SOURCE_URL:=@SF/iperf2 -PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources -PKG_HASH:=db02911f35686e808ed247160dfa766e08ae3f59d1e7dcedef0ffb2a6643f0bf +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_HASH:=7fe4348dcca313b74e0aa9c34a8ccd713b84a5615b8578f4aa94cedce9891ef2 +PKG_SOURCE_URL:=@SF/iperf2 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause diff --git a/package/network/utils/iperf3/Makefile b/package/network/utils/iperf3/Makefile index 56782ea52..a64d7396a 100644 --- a/package/network/utils/iperf3/Makefile +++ b/package/network/utils/iperf3/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iperf -PKG_VERSION:=3.1.4 +PKG_VERSION:=3.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=http://downloads.es.net/pub/iperf -PKG_HASH:=db61d70ac62003ebe0bf15496bd8c4b3c4b728578a44d0a1a88fcf8afc0e8f76 +PKG_HASH:=6f596271251056bffc11bbb8f17d4244ad9a7d4a317c2459fdbb853ae51284d8 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause @@ -21,18 +21,40 @@ PKG_LICENSE:=BSD-3-Clause PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_FIXUP:=autoreconf + include $(INCLUDE_DIR)/package.mk -define Package/iperf3 +DISABLE_NLS:= + +define Package/iperf3/default SECTION:=net CATEGORY:=Network TITLE:=Internet Protocol bandwidth measuring tool URL:=https://github.com/esnet/iperf endef +define Package/iperf3 +$(call Package/iperf3/default) + VARIANT:=nossl +endef + +define Package/iperf3-ssl +$(call Package/iperf3/default) + TITLE+= with iperf_auth support + VARIANT:=ssl + DEPENDS:= +libopenssl +endef + TARGET_CFLAGS += -D_GNU_SOURCE CONFIGURE_ARGS += --disable-shared +ifeq ($(BUILD_VARIANT),ssl) + CONFIGURE_ARGS += --with-openssl="$(STAGING_DIR)/usr" +else + CONFIGURE_ARGS += --without-openssl +endif + MAKE_FLAGS += noinst_PROGRAMS= define Package/iperf3/description @@ -41,9 +63,21 @@ define Package/iperf3/description characteristics. endef +# autoreconf fails if the README file isn't present +define Build/Prepare + $(call Build/Prepare/Default) + touch $(PKG_BUILD_DIR)/README +endef + define Package/iperf3/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ endef +define Package/iperf3-ssl/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/iperf3 $(1)/usr/bin/ +endef + $(eval $(call BuildPackage,iperf3)) +$(eval $(call BuildPackage,iperf3-ssl)) diff --git a/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch new file mode 100644 index 000000000..d617ba9f4 --- /dev/null +++ b/package/network/utils/iperf3/patches/010-iperf-3.3-fix-build-warnings.patch @@ -0,0 +1,300 @@ +The following patches are taken directly from: + +https://github.com/esnet/iperf/pull/664 + +as an upstream submission. + +commit b63d41b25f49a76d0be66edfb61bd4cb68921d55 +Author: Philip Prindeville +Date: Tue Oct 31 13:41:08 2017 -0600 + + Fix warnings about _GNU_SOURCE being redefined. + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf.h b/src/iperf.h +index bb951dc..b656784 100755 +--- a/src/iperf.h ++++ b/src/iperf.h +@@ -36,7 +36,9 @@ + #endif + #include + #include +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #include + + #if defined(HAVE_CPUSET_SETAFFINITY) +diff --git a/src/iperf_api.c b/src/iperf_api.c +index ab30b93..9e41238 100755 +--- a/src/iperf_api.c ++++ b/src/iperf_api.c +@@ -24,7 +24,9 @@ + * This code is distributed under a BSD style license, see the LICENSE file + * for complete information. + */ +-#define _GNU_SOURCE ++#ifndef _GNU_SOURCE ++# define _GNU_SOURCE ++#endif + #define __USE_GNU + + #include "iperf_config.h" + +commit 315254cfc5f5682627f4a46ade3100bc3c64cfcc +Author: Philip Prindeville +Date: Tue Oct 31 13:42:58 2017 -0600 + + Fix warnings of format-specified mismatching type + + Signed-off-by: Philip Prindeville + +diff --git a/src/iperf_tcp.c b/src/iperf_tcp.c +index 91cf032..6f86d5d 100644 +--- a/src/iperf_tcp.c ++++ b/src/iperf_tcp.c +@@ -24,8 +24,6 @@ + * This code is distributed under a BSD style license, see the LICENSE + * file for complete information. + */ +-#include "iperf_config.h" +- + #include + #include + #include +@@ -44,6 +42,12 @@ + #include "net.h" + #include "cjson.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + #if defined(HAVE_FLOWLABEL) + #include "flowlabel.h" + #endif /* HAVE_FLOWLABEL */ +@@ -90,7 +94,7 @@ iperf_tcp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } +diff --git a/src/iperf_udp.c b/src/iperf_udp.c +index a2ea6d0..d04ae44 100644 +--- a/src/iperf_udp.c ++++ b/src/iperf_udp.c +@@ -48,6 +48,12 @@ + #include "cjson.h" + #include "portable_endian.h" + ++#if defined(HAVE_INTTYPES_H) ++# include ++#else ++# define PRIu64 "llu" ++#endif ++ + /* iperf_udp_recv + * + * receives the data for UDP +@@ -98,7 +104,7 @@ iperf_udp_recv(struct iperf_stream *sp) + } + + if (sp->test->debug) +- fprintf(stderr, "pcount %llu packet_count %d\n", pcount, sp->packet_count); ++ fprintf(stderr, "pcount %" PRIu64 " packet_count %d\n", pcount, sp->packet_count); + + /* + * Try to handle out of order packets. The way we do this +@@ -141,7 +147,7 @@ iperf_udp_recv(struct iperf_stream *sp) + + /* Log the out-of-order packet */ + if (sp->test->debug) +- fprintf(stderr, "OUT OF ORDER - incoming packet sequence %llu but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); ++ fprintf(stderr, "OUT OF ORDER - incoming packet sequence %" PRIu64 " but expected sequence %d on stream %d", pcount, sp->packet_count, sp->socket); + } + + /* +@@ -220,7 +226,7 @@ iperf_udp_send(struct iperf_stream *sp) + sp->result->bytes_sent_this_interval += r; + + if (sp->test->debug) +- printf("sent %d bytes of %d, total %llu\n", r, sp->settings->blksize, sp->result->bytes_sent); ++ printf("sent %d bytes of %d, total %" PRIu64 "\n", r, sp->settings->blksize, sp->result->bytes_sent); + + return r; + } + +commit 9a66b3b0349e0a158bb4940b668a5cbc7c245762 +Author: Philip Prindeville +Date: Tue Oct 31 13:44:34 2017 -0600 + + Simplify endianness checks + + Linux can be built with too many types of C run-time library and it's + not reasonable to have to enumerate all of them, especially since at + least one of them (MUSL) goes out of its way to not be easily + detectable. + + Instead, leverage autoconf better for Linux/BSD to detect either + or directly. + + Signed-off-by: Philip Prindeville + +diff --git a/configure.ac b/configure.ac +index f57e83f..cfb42ac 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -101,6 +101,14 @@ AC_CHECK_HEADERS([netinet/sctp.h], + #endif + ]) + ++AC_CHECK_HEADER([endian.h], ++ AC_DEFINE([HAVE_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_CHECK_HEADER([sys/endian.h], ++ AC_DEFINE([HAVE_SYS_ENDIAN_H], [1], [Define to 1 if you have the header file.]), ++ AC_MSG_WARN([Couldn't find endian.h or sys/endian.h files: doing compile-time tests.]) ++ ) ++ ) ++ + if test "x$with_openssl" = "xno"; then + AC_MSG_WARN( [Building without OpenSSL; disabling iperf_auth functionality.] ) + else +diff --git a/src/iperf_config.h.in b/src/iperf_config.h.in +index bd03935..a9e51ec 100644 +--- a/src/iperf_config.h.in ++++ b/src/iperf_config.h.in +@@ -9,6 +9,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_DLFCN_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ENDIAN_H ++ + /* Have IPv6 flowlabel support. */ + #undef HAVE_FLOWLABEL + +@@ -54,6 +57,9 @@ + /* Define to 1 if the system has the type `struct sctp_assoc_value'. */ + #undef HAVE_STRUCT_SCTP_ASSOC_VALUE + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_ENDIAN_H ++ + /* Define to 1 if you have the header file. */ + #undef HAVE_SYS_SOCKET_H + +diff --git a/src/portable_endian.h b/src/portable_endian.h +index b86d37a..5dbc6e5 100644 +--- a/src/portable_endian.h ++++ b/src/portable_endian.h +@@ -10,14 +10,33 @@ + + #endif + +-// GLIBC / Linux with endian(3) support, which was added in glibc 2.9. +-// Intended to support CentOS 6 and newer. +-#if defined(__linux__) && \ +- ((__GLIBC__ > 3) || \ +- (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9)) +- ++#if defined(HAVE_ENDIAN_H) + # include + ++#elif defined(HAVE_SYS_ENDIAN_H) ++# include ++ ++# if defined(__OpenBSD__) ++ ++# define be16toh(x) betoh16(x) ++# define le16toh(x) letoh16(x) ++ ++# define be32toh(x) betoh32(x) ++# define le32toh(x) letoh32(x) ++ ++# define be64toh(x) betoh64(x) ++# define le64toh(x) letoh64(x) ++ ++# elif defined(__sgi) ++ ++# include ++# include ++ ++# define be64toh(x) (x) ++# define htobe64(x) (x) ++ ++# endif ++ + #elif defined(__CYGWIN__) + + # include +@@ -46,32 +65,6 @@ + # define __LITTLE_ENDIAN LITTLE_ENDIAN + # define __PDP_ENDIAN PDP_ENDIAN + +-#elif defined(__OpenBSD__) +- +-# include +- +-# define be16toh(x) betoh16(x) +-# define le16toh(x) letoh16(x) +- +-# define be32toh(x) betoh32(x) +-# define le32toh(x) letoh32(x) +- +-# define be64toh(x) betoh64(x) +-# define le64toh(x) letoh64(x) +- +-#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +- +-# include +- +-#elif defined(__sgi) +- +-# include +-# include +-# include +- +-# define be64toh(x) (x) +-# define htobe64(x) (x) +- + #elif defined(__sun) && defined(__SVR4) + + # include + +commit 7e7285d0daf92ef7beda8f78a6f63cc647a77f38 +Author: Philip Prindeville +Date: Tue Oct 31 13:48:06 2017 -0600 + + Sys headers should not be included directly + + There's usually a top-level header which then includes the sys/ + descendent. + + Signed-off-by: Philip Prindeville + +diff --git a/src/net.c b/src/net.c +index af456cb..afd0022 100644 +--- a/src/net.c ++++ b/src/net.c +@@ -31,13 +31,12 @@ + #include + #include + #include +-#include + #include + #include + #include + #include + #include +-#include ++#include + + #ifdef HAVE_SENDFILE + #ifdef linux diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 1f566f0c4..5f718748d 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,87 +8,122 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=4.4.0 -PKG_RELEASE:=10 +PKG_VERSION:=4.14.1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=bc91c367288a19f78ef800cd6840363be1f22da8436fbae88e1a7250490d6514 +PKG_HASH:=d43ac068afcc350a448f4581b6e292331ef7e4e7aa746e34981582d5fdb10067 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION) +include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/package.mk define Package/iproute2/Default - TITLE:=Routing control utility ($(2)) SECTION:=net CATEGORY:=Network URL:=http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2 SUBMENU:=Routing and Redirection MAINTAINER:=Russell Senior - DEPENDS:= +libnl-tiny - VARIANT:=$(1) - PROVIDES:=$(3) endef define Package/ip-tiny -$(call Package/iproute2/Default,tiny,Minimal,ip) - CONFLICTS:=ip-full +$(call Package/iproute2/Default) + TITLE:=Routing control utility (Minimal) + VARIANT:=tiny + PROVIDES:=ip + ALTERNATIVES:=200:/sbin/ip:/sbin/ip-tiny + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef -Package/ip-full:=$(call Package/iproute2/Default,full,Full,ip) +define Package/ip-full +$(call Package/iproute2/Default) + TITLE:=Routing control utility (Full) + VARIANT:=full + PROVIDES:=ip + ALTERNATIVES:=300:/sbin/ip:/sbin/ip-full + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +endef define Package/tc $(call Package/iproute2/Default) TITLE:=Traffic control utility - DEPENDS:=+kmod-sched-core + DEPENDS:=+kmod-sched-core +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/genl $(call Package/iproute2/Default) TITLE:=General netlink utility frontend + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ip-bridge $(call Package/iproute2/Default) TITLE:=Bridge configuration utility from iproute2 + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/ss $(call Package/iproute2/Default) TITLE:=Socket statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl endef define Package/nstat $(call Package/iproute2/Default) TITLE:=Network statistics utility + DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +endef + +define Package/devlink +$(call Package/iproute2/Default) + TITLE:=Network devlink utility + DEPENDS:=+libmnl +endef + +define Package/rdma +$(call Package/iproute2/Default) + TITLE:=Network rdma utility + DEPENDS:=+libmnl endef ifeq ($(BUILD_VARIANT),tiny) IP_CONFIG_TINY:=y endif +ifdef CONFIG_PACKAGE_devlink + HAVE_MNL:=y +endif + +ifdef CONFIG_PACKAGE_rdma + HAVE_MNL:=y +endif + define Build/Configure $(SED) "s,-I/usr/include/db3,," $(PKG_BUILD_DIR)/Makefile $(SED) "s,^KERNEL_INCLUDE.*,KERNEL_INCLUDE=$(LINUX_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile $(SED) "s,^LIBC_INCLUDE.*,LIBC_INCLUDE=$(STAGING_DIR)/include," \ $(PKG_BUILD_DIR)/Makefile - echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-lede\";" \ + echo "static const char SNAPSHOT[] = \"$(PKG_VERSION)-$(PKG_RELEASE)-openwrt\";" \ > $(PKG_BUILD_DIR)/include/SNAPSHOT.h endef -TARGET_CFLAGS += -DHAVE_SETNS TARGET_CFLAGS += -ffunction-sections -fdata-sections MAKE_FLAGS += \ - EXTRA_CCOPTS="$(TARGET_CFLAGS) -I../include -I$(STAGING_DIR)/usr/include/libnl-tiny" \ + EXTRA_CCOPTS="-I$(STAGING_DIR)/usr/include/libnl-tiny" \ KERNEL_INCLUDE="$(LINUX_DIR)/include" \ SHARED_LIBS="" \ LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections" \ IP_CONFIG_TINY=$(IP_CONFIG_TINY) \ + HAVE_MNL=$(HAVE_MNL) \ + IPT_LIB_DIR=/usr/lib/iptables \ FPIC="$(FPIC)" define Build/Compile @@ -103,13 +138,13 @@ define Build/InstallDev endef define Package/ip-tiny/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/bin/ + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-tiny endef define Package/ip-full/install - $(INSTALL_DIR) $(1)/usr/sbin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/usr/sbin/ + $(INSTALL_DIR) $(1)/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/ip/ip $(1)/sbin/ip-full endef define Package/tc/install @@ -139,6 +174,16 @@ define Package/nstat/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/misc/nstat $(1)/usr/sbin/ endef +define Package/devlink/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/devlink/devlink $(1)/usr/sbin/ +endef + +define Package/rdma/install + $(INSTALL_DIR) $(1)/usr/sbin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/rdma/rdma $(1)/usr/sbin/ +endef + $(eval $(call BuildPackage,ip-tiny)) $(eval $(call BuildPackage,ip-full)) $(eval $(call BuildPackage,tc)) @@ -146,3 +191,5 @@ $(eval $(call BuildPackage,genl)) $(eval $(call BuildPackage,ip-bridge)) $(eval $(call BuildPackage,ss)) $(eval $(call BuildPackage,nstat)) +$(eval $(call BuildPackage,devlink)) +$(eval $(call BuildPackage,rdma)) diff --git a/package/network/utils/iproute2/patches/001-config.patch b/package/network/utils/iproute2/patches/001-config.patch index ece865299..7f23cfc35 100644 --- a/package/network/utils/iproute2/patches/001-config.patch +++ b/package/network/utils/iproute2/patches/001-config.patch @@ -2,6 +2,6 @@ +++ b/Config @@ -0,0 +1,4 @@ +# Fixed config to disable ATM support even if present on host system ++IP_CONFIG_SETNS:=y +TC_CONFIG_ATM:=n -+TC_CONFIG_ACTION_GACT=y -+TC_CONFIG_ACTION_PROB=y ++TC_CONFIG_XT:=y diff --git a/package/network/utils/iproute2/patches/004-darwin_fixes.patch b/package/network/utils/iproute2/patches/004-darwin_fixes.patch index e1a5e9756..1f3eb101e 100644 --- a/package/network/utils/iproute2/patches/004-darwin_fixes.patch +++ b/package/network/utils/iproute2/patches/004-darwin_fixes.patch @@ -42,7 +42,7 @@ #define TABLESIZE 16384 --- a/netem/paretonormal.c +++ b/netem/paretonormal.c -@@ -15,10 +15,13 @@ +@@ -14,10 +14,13 @@ #include #include #include diff --git a/package/network/utils/iproute2/patches/006-no_sctp.patch b/package/network/utils/iproute2/patches/006-no_sctp.patch index 6805468d8..e23fbcd77 100644 --- a/package/network/utils/iproute2/patches/006-no_sctp.patch +++ b/package/network/utils/iproute2/patches/006-no_sctp.patch @@ -1,6 +1,6 @@ --- a/ip/ipxfrm.c +++ b/ip/ipxfrm.c -@@ -470,7 +470,6 @@ void xfrm_selector_print(struct xfrm_sel +@@ -454,7 +454,6 @@ void xfrm_selector_print(struct xfrm_sel switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: @@ -8,7 +8,7 @@ case IPPROTO_DCCP: default: /* XXX */ if (sel->sport_mask) -@@ -1341,7 +1340,6 @@ static int xfrm_selector_upspec_parse(st +@@ -1329,7 +1328,6 @@ static int xfrm_selector_upspec_parse(st switch (sel->proto) { case IPPROTO_TCP: case IPPROTO_UDP: diff --git a/package/network/utils/iproute2/patches/007-no_arpd.patch b/package/network/utils/iproute2/patches/007-no_arpd.patch index 94fb197a4..ac216ba82 100644 --- a/package/network/utils/iproute2/patches/007-no_arpd.patch +++ b/package/network/utils/iproute2/patches/007-no_arpd.patch @@ -2,7 +2,7 @@ +++ b/misc/Makefile @@ -5,9 +5,9 @@ TARGETS=ss nstat ifstat rtacct lnstat - include ../Config + include ../config.mk -ifeq ($(HAVE_BERKELEY_DB),y) - TARGETS += arpd @@ -11,5 +11,5 @@ +# TARGETS += arpd +#endif - ifeq ($(HAVE_SELINUX),y) - LDLIBS += $(shell $(PKG_CONFIG) --libs libselinux) + all: $(TARGETS) + diff --git a/package/network/utils/iproute2/patches/008-no_netem.patch b/package/network/utils/iproute2/patches/008-no_netem.patch index fce16e02d..2e088f199 100644 --- a/package/network/utils/iproute2/patches/008-no_netem.patch +++ b/package/network/utils/iproute2/patches/008-no_netem.patch @@ -1,11 +1,11 @@ --- a/Makefile +++ b/Makefile -@@ -41,7 +41,7 @@ WFLAGS += -Wmissing-declarations -Wold-s - CFLAGS := $(WFLAGS) $(CCOPTS) -I../include $(DEFINES) $(CFLAGS) +@@ -49,7 +49,7 @@ WFLAGS += -Wmissing-declarations -Wold-s + CFLAGS := $(WFLAGS) $(CCOPTS) -I../include -I../include/uapi $(DEFINES) $(CFLAGS) YACCFLAGS = -d -t -v --SUBDIRS=lib ip tc bridge misc netem genl tipc man -+SUBDIRS=lib ip tc bridge misc genl tipc man +-SUBDIRS=lib ip tc bridge misc netem genl tipc devlink rdma man ++SUBDIRS=lib ip tc bridge misc genl tipc devlink rdma man LIBNETLINK=../lib/libnetlink.a ../lib/libutil.a LDLIBS += $(LIBNETLINK) diff --git a/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch new file mode 100644 index 000000000..7a5a70223 --- /dev/null +++ b/package/network/utils/iproute2/patches/009-keep_libmnl_optional.patch @@ -0,0 +1,11 @@ +--- a/configure ++++ b/configure +@@ -292,7 +292,7 @@ check_selinux() + + check_mnl() + { +- if ${PKG_CONFIG} libmnl --exists ++ if [ "${HAVE_MNL}" = "y" ] && ${PKG_CONFIG} libmnl --exists + then + echo "HAVE_MNL:=y" >>$CONFIG + echo "yes" diff --git a/package/network/utils/iproute2/patches/010-type_fixes.patch b/package/network/utils/iproute2/patches/010-type_fixes.patch deleted file mode 100644 index e0055fce7..000000000 --- a/package/network/utils/iproute2/patches/010-type_fixes.patch +++ /dev/null @@ -1,396 +0,0 @@ ---- a/include/iptables_common.h -+++ b/include/iptables_common.h -@@ -2,6 +2,8 @@ - #define _IPTABLES_COMMON_H - /* Shared definitions between ipv4 and ipv6. */ - -+#include -+ - enum exittype { - OTHER_PROBLEM = 1, - PARAMETER_PROBLEM, -@@ -43,9 +45,9 @@ extern char *lib_dir; - extern void init_extensions(void); - #endif - --#define __be32 u_int32_t --#define __le32 u_int32_t --#define __be16 u_int16_t --#define __le16 u_int16_t -+#define __be32 uint32_t -+#define __le32 uint32_t -+#define __be16 uint16_t -+#define __le16 uint16_t - - #endif /*_IPTABLES_COMMON_H*/ ---- a/include/netinet/tcp.h -+++ /dev/null -@@ -1,231 +0,0 @@ --/* -- * Copyright (c) 1982, 1986, 1993 -- * The Regents of the University of California. All rights reserved. -- * -- * Redistribution and use in source and binary forms, with or without -- * modification, are permitted provided that the following conditions -- * are met: -- * 1. Redistributions of source code must retain the above copyright -- * notice, this list of conditions and the following disclaimer. -- * 2. Redistributions in binary form must reproduce the above copyright -- * notice, this list of conditions and the following disclaimer in the -- * documentation and/or other materials provided with the distribution. -- * 4. Neither the name of the University nor the names of its contributors -- * may be used to endorse or promote products derived from this software -- * without specific prior written permission. -- * -- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -- * SUCH DAMAGE. -- * -- * @(#)tcp.h 8.1 (Berkeley) 6/10/93 -- */ -- --#ifndef _NETINET_TCP_H --#define _NETINET_TCP_H 1 -- --#include -- --/* -- * User-settable options (used with setsockopt). -- */ --#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */ --#define TCP_MAXSEG 2 /* Set maximum segment size */ --#define TCP_CORK 3 /* Control sending of partial frames */ --#define TCP_KEEPIDLE 4 /* Start keeplives after this period */ --#define TCP_KEEPINTVL 5 /* Interval between keepalives */ --#define TCP_KEEPCNT 6 /* Number of keepalives before death */ --#define TCP_SYNCNT 7 /* Number of SYN retransmits */ --#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */ --#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */ --#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */ --#define TCP_INFO 11 /* Information about this connection. */ --#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */ --#define TCP_CONGESTION 13 /* Congestion control algorithm. */ -- --#ifdef __USE_MISC --# include -- --# ifdef __FAVOR_BSD --typedef u_int32_t tcp_seq; --/* -- * TCP header. -- * Per RFC 793, September, 1981. -- */ --struct tcphdr -- { -- u_int16_t th_sport; /* source port */ -- u_int16_t th_dport; /* destination port */ -- tcp_seq th_seq; /* sequence number */ -- tcp_seq th_ack; /* acknowledgement number */ --# if __BYTE_ORDER == __LITTLE_ENDIAN -- u_int8_t th_x2:4; /* (unused) */ -- u_int8_t th_off:4; /* data offset */ --# endif --# if __BYTE_ORDER == __BIG_ENDIAN -- u_int8_t th_off:4; /* data offset */ -- u_int8_t th_x2:4; /* (unused) */ --# endif -- u_int8_t th_flags; --# define TH_FIN 0x01 --# define TH_SYN 0x02 --# define TH_RST 0x04 --# define TH_PUSH 0x08 --# define TH_ACK 0x10 --# define TH_URG 0x20 -- u_int16_t th_win; /* window */ -- u_int16_t th_sum; /* checksum */ -- u_int16_t th_urp; /* urgent pointer */ --}; -- --# else /* !__FAVOR_BSD */ --struct tcphdr -- { -- u_int16_t source; -- u_int16_t dest; -- u_int32_t seq; -- u_int32_t ack_seq; --# if __BYTE_ORDER == __LITTLE_ENDIAN -- u_int16_t res1:4; -- u_int16_t doff:4; -- u_int16_t fin:1; -- u_int16_t syn:1; -- u_int16_t rst:1; -- u_int16_t psh:1; -- u_int16_t ack:1; -- u_int16_t urg:1; -- u_int16_t res2:2; --# elif __BYTE_ORDER == __BIG_ENDIAN -- u_int16_t doff:4; -- u_int16_t res1:4; -- u_int16_t res2:2; -- u_int16_t urg:1; -- u_int16_t ack:1; -- u_int16_t psh:1; -- u_int16_t rst:1; -- u_int16_t syn:1; -- u_int16_t fin:1; --# else --# error "Adjust your defines" --# endif -- u_int16_t window; -- u_int16_t check; -- u_int16_t urg_ptr; --}; --# endif /* __FAVOR_BSD */ -- --enum --{ -- TCP_ESTABLISHED = 1, -- TCP_SYN_SENT, -- TCP_SYN_RECV, -- TCP_FIN_WAIT1, -- TCP_FIN_WAIT2, -- TCP_TIME_WAIT, -- TCP_CLOSE, -- TCP_CLOSE_WAIT, -- TCP_LAST_ACK, -- TCP_LISTEN, -- TCP_CLOSING /* now a valid state */ --}; -- --# define TCPOPT_EOL 0 --# define TCPOPT_NOP 1 --# define TCPOPT_MAXSEG 2 --# define TCPOLEN_MAXSEG 4 --# define TCPOPT_WINDOW 3 --# define TCPOLEN_WINDOW 3 --# define TCPOPT_SACK_PERMITTED 4 /* Experimental */ --# define TCPOLEN_SACK_PERMITTED 2 --# define TCPOPT_SACK 5 /* Experimental */ --# define TCPOPT_TIMESTAMP 8 --# define TCPOLEN_TIMESTAMP 10 --# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */ -- --# define TCPOPT_TSTAMP_HDR \ -- (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP) -- --/* -- * Default maximum segment size for TCP. -- * With an IP MSS of 576, this is 536, -- * but 512 is probably more convenient. -- * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)). -- */ --# define TCP_MSS 512 -- --# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */ -- --# define TCP_MAX_WINSHIFT 14 /* maximum window shift */ -- --# define SOL_TCP 6 /* TCP level */ -- -- --# define TCPI_OPT_TIMESTAMPS 1 --# define TCPI_OPT_SACK 2 --# define TCPI_OPT_WSCALE 4 --# define TCPI_OPT_ECN 8 --# define TCPI_OPT_ECN_SEEN 16 -- --/* Values for tcpi_state. */ --enum tcp_ca_state --{ -- TCP_CA_Open = 0, -- TCP_CA_Disorder = 1, -- TCP_CA_CWR = 2, -- TCP_CA_Recovery = 3, -- TCP_CA_Loss = 4 --}; -- --struct tcp_info --{ -- u_int8_t tcpi_state; -- u_int8_t tcpi_ca_state; -- u_int8_t tcpi_retransmits; -- u_int8_t tcpi_probes; -- u_int8_t tcpi_backoff; -- u_int8_t tcpi_options; -- u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4; -- -- u_int32_t tcpi_rto; -- u_int32_t tcpi_ato; -- u_int32_t tcpi_snd_mss; -- u_int32_t tcpi_rcv_mss; -- -- u_int32_t tcpi_unacked; -- u_int32_t tcpi_sacked; -- u_int32_t tcpi_lost; -- u_int32_t tcpi_retrans; -- u_int32_t tcpi_fackets; -- -- /* Times. */ -- u_int32_t tcpi_last_data_sent; -- u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */ -- u_int32_t tcpi_last_data_recv; -- u_int32_t tcpi_last_ack_recv; -- -- /* Metrics. */ -- u_int32_t tcpi_pmtu; -- u_int32_t tcpi_rcv_ssthresh; -- u_int32_t tcpi_rtt; -- u_int32_t tcpi_rttvar; -- u_int32_t tcpi_snd_ssthresh; -- u_int32_t tcpi_snd_cwnd; -- u_int32_t tcpi_advmss; -- u_int32_t tcpi_reordering; -- u_int32_t tcpi_rcv_rtt; -- u_int32_t tcpi_rcv_space; -- u_int32_t tcpi_total_retrans; -- --}; -- --#endif /* Misc. */ -- --#endif /* netinet/tcp.h */ ---- a/include/iptables.h -+++ b/include/iptables.h -@@ -20,7 +20,7 @@ struct ipt_get_revision - { - char name[IPT_FUNCTION_MAXNAMELEN-1]; - -- u_int8_t revision; -+ uint8_t revision; - }; - #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */ - -@@ -39,7 +39,7 @@ struct iptables_match - ipt_chainlabel name; - - /* Revision of match (0 by default). */ -- u_int8_t revision; -+ uint8_t revision; - - const char *version; - -@@ -92,7 +92,7 @@ struct iptables_target - ipt_chainlabel name; - - /* Revision of target (0 by default). */ -- u_int8_t revision; -+ uint8_t revision; - - const char *version; - -@@ -153,7 +153,7 @@ extern char *mask_to_dotted(const struct - - extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp, - struct in_addr *maskp, unsigned int *naddrs); --extern u_int16_t parse_protocol(const char *s); -+extern uint16_t parse_protocol(const char *s); - - extern int do_command(int argc, char *argv[], char **table, - iptc_handle_t *handle); ---- a/lib/dnet_ntop.c -+++ b/lib/dnet_ntop.c -@@ -1,24 +1,25 @@ - #include - #include -+#include - #include - #include - - #include "utils.h" - --static __inline__ u_int16_t dn_ntohs(u_int16_t addr) -+static __inline__ uint16_t dn_ntohs(uint16_t addr) - { - union { -- u_int8_t byte[2]; -- u_int16_t word; -+ uint8_t byte[2]; -+ uint16_t word; - } u; - - u.word = addr; -- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); -+ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); - } - --static __inline__ int do_digit(char *str, u_int16_t *addr, u_int16_t scale, size_t *pos, size_t len, int *started) -+static __inline__ int do_digit(char *str, uint16_t *addr, uint16_t scale, size_t *pos, size_t len, int *started) - { -- u_int16_t tmp = *addr / scale; -+ uint16_t tmp = *addr / scale; - - if (*pos == len) - return 1; -@@ -36,7 +37,7 @@ static __inline__ int do_digit(char *str - - static const char *dnet_ntop1(const struct dn_naddr *dna, char *str, size_t len) - { -- u_int16_t addr, area; -+ uint16_t addr, area; - size_t pos = 0; - int started = 0; - ---- a/lib/dnet_pton.c -+++ b/lib/dnet_pton.c -@@ -1,23 +1,24 @@ - #include - #include -+#include - #include - #include - - #include "utils.h" - --static __inline__ u_int16_t dn_htons(u_int16_t addr) -+static __inline__ uint16_t dn_htons(uint16_t addr) - { - union { -- u_int8_t byte[2]; -- u_int16_t word; -+ uint8_t byte[2]; -+ uint16_t word; - } u; - - u.word = addr; -- return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8); -+ return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8); - } - - --static int dnet_num(const char *src, u_int16_t * dst) -+static int dnet_num(const char *src, uint16_t * dst) - { - int rv = 0; - int tmp; -@@ -38,9 +39,9 @@ static int dnet_num(const char *src, u_i - - static int dnet_pton1(const char *src, struct dn_naddr *dna) - { -- u_int16_t addr; -- u_int16_t area = 0; -- u_int16_t node = 0; -+ uint16_t addr; -+ uint16_t area = 0; -+ uint16_t node = 0; - int pos; - - pos = dnet_num(src, &area); ---- a/include/libiptc/ipt_kernel_headers.h -+++ b/include/libiptc/ipt_kernel_headers.h -@@ -5,7 +5,7 @@ - - #include - --#if defined(__GLIBC__) && __GLIBC__ == 2 -+#if 1 - #include - #include - #include diff --git a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch index ce958a934..caf889e12 100644 --- a/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch +++ b/package/network/utils/iproute2/patches/100-allow_pfifo_fast.patch @@ -1,6 +1,6 @@ --- a/tc/q_fifo.c +++ b/tc/q_fifo.c -@@ -98,5 +98,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ +@@ -97,5 +97,6 @@ struct qdisc_util pfifo_head_drop_qdisc_ extern int prio_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt); struct qdisc_util pfifo_fast_qdisc_util = { .id = "pfifo_fast", diff --git a/package/network/utils/iproute2/patches/110-extra-ccopts.patch b/package/network/utils/iproute2/patches/110-extra-ccopts.patch index 3cb5a7940..e779934d7 100644 --- a/package/network/utils/iproute2/patches/110-extra-ccopts.patch +++ b/package/network/utils/iproute2/patches/110-extra-ccopts.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -34,7 +34,7 @@ HOSTCC = gcc +@@ -42,7 +42,7 @@ HOSTCC ?= $(CC) DEFINES += -D_GNU_SOURCE # Turn on transparent support for LFS DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE diff --git a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch index 1f397f71b..83ce66d97 100644 --- a/package/network/utils/iproute2/patches/120-libnetlink-pic.patch +++ b/package/network/utils/iproute2/patches/120-libnetlink-pic.patch @@ -1,11 +1,10 @@ --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,7 +4,7 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -1,6 +1,6 @@ + include ../config.mk -CFLAGS += -fPIC +CFLAGS += $(FPIC) UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ - inet_proto.o namespace.o json_writer.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ diff --git a/package/network/utils/iproute2/patches/130-missing_include.patch b/package/network/utils/iproute2/patches/130-missing_include.patch deleted file mode 100644 index 8759a6259..000000000 --- a/package/network/utils/iproute2/patches/130-missing_include.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/lib/namespace.c -+++ b/lib/namespace.c -@@ -10,6 +10,7 @@ - #include - #include - #include -+#include - - #include "utils.h" - #include "namespace.h" ---- a/lib/rt_names.c -+++ b/lib/rt_names.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - - #include - #include diff --git a/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch new file mode 100644 index 000000000..e3364ad05 --- /dev/null +++ b/package/network/utils/iproute2/patches/271-uapi-libc-compat.h-do-not-rely-on-__GLIBC__.patch @@ -0,0 +1,107 @@ +From f972afc2509eebcb00d370256c55b112a3b5ffca Mon Sep 17 00:00:00 2001 +From: David Heidelberger +Date: Mon, 29 Jun 2015 16:50:40 +0200 +Subject: [PATCH 2/3] uapi/libc-compat.h: do not rely on __GLIBC__ + +Musl provides the same structs as glibc, but does not provide a define to +allow its detection. Since the absence of __GLIBC__ also can mean that it +is included from the kernel, change the __GLIBC__ detection to +!__KERNEL__, which should always be true when included from userspace. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/libc-compat.h | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -49,13 +49,13 @@ + #ifndef _LIBC_COMPAT_H + #define _LIBC_COMPAT_H + +-/* We have included glibc headers... */ +-#if defined(__GLIBC__) ++/* We have included libc headers... */ ++#if !defined(__KERNEL__) + +-/* Coordinate with glibc net/if.h header. */ +-#if defined(_NET_IF_H) && defined(__USE_MISC) ++/* Coordinate with libc net/if.h header. */ ++#if defined(_NET_IF_H) && (!defined(__GLIBC__) || defined(__USE_MISC)) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + + #define __UAPI_DEF_IF_IFCONF 0 +@@ -66,7 +66,11 @@ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS 0 + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #ifndef __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO ++#ifdef __GLIBC__ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 ++#else ++#define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 0 ++#endif + #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ + + #else /* _NET_IF_H */ +@@ -86,10 +90,10 @@ + + #endif /* _NET_IF_H */ + +-/* Coordinate with glibc netinet/in.h header. */ ++/* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +-/* GLIBC headers included first so don't define anything ++/* LIBC headers included first so don't define anything + * that would already be defined. */ + #define __UAPI_DEF_IN_ADDR 0 + #define __UAPI_DEF_IN_IPPROTO 0 +@@ -103,7 +107,7 @@ + * if the glibc code didn't define them. This guard matches + * the guard in glibc/inet/netinet/in.h which defines the + * additional in6_addr macros e.g. s6_addr16, and s6_addr32. */ +-#if defined(__USE_MISC) || defined (__USE_GNU) ++#if !defined(__GLIBC__) || defined(__USE_MISC) || defined (__USE_GNU) + #define __UAPI_DEF_IN6_ADDR_ALT 0 + #else + #define __UAPI_DEF_IN6_ADDR_ALT 1 +@@ -118,7 +122,7 @@ + #else + + /* Linux headers included first, and we must define everything +- * we need. The expectation is that glibc will check the ++ * we need. The expectation is that the libc will check the + * __UAPI_DEF_* defines and adjust appropriately. */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 +@@ -128,7 +132,7 @@ + #define __UAPI_DEF_IN_CLASS 1 + + #define __UAPI_DEF_IN6_ADDR 1 +-/* We unconditionally define the in6_addr macros and glibc must ++/* We unconditionally define the in6_addr macros and the libc must + * coordinate. */ + #define __UAPI_DEF_IN6_ADDR_ALT 1 + #define __UAPI_DEF_SOCKADDR_IN6 1 +@@ -169,7 +173,7 @@ + /* If we did not see any headers from any supported C libraries, + * or we are being included in the kernel, then define everything + * that we need. */ +-#else /* !defined(__GLIBC__) */ ++#else /* defined(__KERNEL__) */ + + /* Definitions for if.h */ + #define __UAPI_DEF_IF_IFCONF 1 +@@ -209,6 +213,6 @@ + /* Definitions for xattr.h */ + #define __UAPI_DEF_XATTR 1 + +-#endif /* __GLIBC__ */ ++#endif /* __KERNEL__ */ + + #endif /* _LIBC_COMPAT_H */ diff --git a/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch new file mode 100644 index 000000000..abd1f7eac --- /dev/null +++ b/package/network/utils/iproute2/patches/272-uapi-if_ether.h-prevent-redefinition-of-struct-ethhd.patch @@ -0,0 +1,67 @@ +From fcbb6fed85ea9ff4feb4f1ebd4f0f235fdaf06b6 Mon Sep 17 00:00:00 2001 +From: David Heidelberger +Date: Mon, 29 Jun 2015 16:53:03 +0200 +Subject: [PATCH 3/3] uapi/if_ether.h: prevent redefinition of struct ethhdr + +Musl provides its own ethhdr struct definition. Add a guard to prevent +its definition of the appropriate musl header has already been included. + +Signed-off-by: John Spencer +Tested-by: David Heidelberger +Signed-off-by: Jonas Gorski +--- + include/uapi/linux/if_ether.h | 3 +++ + include/uapi/linux/libc-compat.h | 11 +++++++++++ + 2 files changed, 14 insertions(+) + +--- a/include/uapi/linux/if_ether.h ++++ b/include/uapi/linux/if_ether.h +@@ -23,6 +23,7 @@ + #define _LINUX_IF_ETHER_H + + #include ++#include + + /* + * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble +@@ -149,11 +150,13 @@ + * This is an Ethernet frame header. + */ + ++#if __UAPI_DEF_ETHHDR + struct ethhdr { + unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ + unsigned char h_source[ETH_ALEN]; /* source ether addr */ + __be16 h_proto; /* packet type ID field */ + } __attribute__((packed)); ++#endif + + + #endif /* _LINUX_IF_ETHER_H */ +--- a/include/uapi/linux/libc-compat.h ++++ b/include/uapi/linux/libc-compat.h +@@ -90,6 +90,14 @@ + + #endif /* _NET_IF_H */ + ++/* musl defines the ethhdr struct itself in its netinet/if_ether.h. ++ * Glibc just includes the kernel header and uses a different guard. */ ++#if defined(_NETINET_IF_ETHER_H) ++#define __UAPI_DEF_ETHHDR 0 ++#else ++#define __UAPI_DEF_ETHHDR 1 ++#endif ++ + /* Coordinate with libc netinet/in.h header. */ + #if defined(_NETINET_IN_H) + +@@ -185,6 +193,9 @@ + /* For the future if glibc adds IFF_LOWER_UP, IFF_DORMANT and IFF_ECHO */ + #define __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO 1 + ++/* Definitions for if_ether.h */ ++#define __UAPI_DEF_ETHHDR 1 ++ + /* Definitions for in.h */ + #define __UAPI_DEF_IN_ADDR 1 + #define __UAPI_DEF_IN_IPPROTO 1 diff --git a/package/network/utils/iproute2/patches/300-ip_tiny.patch b/package/network/utils/iproute2/patches/300-ip_tiny.patch index 290adbe5f..35b588f7e 100644 --- a/package/network/utils/iproute2/patches/300-ip_tiny.patch +++ b/package/network/utils/iproute2/patches/300-ip_tiny.patch @@ -1,8 +1,8 @@ --- a/ip/Makefile +++ b/ip/Makefile -@@ -17,6 +17,13 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -15,6 +15,13 @@ RTMONOBJ=rtmon.o + + include ../config.mk +STATIC_SYM_FILTER:= +ifeq ($(IP_CONFIG_TINY),y) @@ -25,7 +25,24 @@ sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \ --- a/ip/ip.c +++ b/ip/ip.c -@@ -73,30 +73,42 @@ static const struct cmd { +@@ -49,10 +49,16 @@ static void usage(void) + fprintf(stderr, + "Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n" + " ip [ -force ] -batch filename\n" ++#ifndef IPROUTE2_TINY + "where OBJECT := { link | address | addrlabel | route | rule | neigh | ntable |\n" + " tunnel | tuntap | maddress | mroute | mrule | monitor | xfrm |\n" + " netns | l2tp | fou | macsec | tcp_metrics | token | netconf | ila |\n" + " vrf | sr }\n" ++#else ++"where OBJECT := { link | address | route | rule | neigh | tunnel | maddress |\n" ++" mroute | mrule | monitor | netns | macsec | token | ila |\n" ++" vrf | sr }\n" ++#endif + " OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n" + " -h[uman-readable] | -iec |\n" + " -f[amily] { inet | inet6 | ipx | dnet | mpls | bridge | link } |\n" +@@ -74,32 +80,44 @@ static const struct cmd { int (*func)(int argc, char **argv); } cmds[] = { { "address", do_ipaddr }, @@ -46,6 +63,8 @@ { "l2tp", do_ipl2tp }, { "fou", do_ipfou }, +#endif + { "ila", do_ipila }, + { "macsec", do_ipmacsec }, { "tunnel", do_iptunnel }, { "tunl", do_iptunnel }, +#ifndef IPROUTE2_TINY @@ -65,12 +84,12 @@ +#ifndef IPROUTE2_TINY { "netconf", do_ipnetconf }, +#endif + { "vrf", do_ipvrf}, + { "sr", do_seg6 }, { "help", do_help }, - { 0 } - }; --- a/lib/utils.c +++ b/lib/utils.c -@@ -710,6 +710,7 @@ const char *rt_addr_n2a(int af, int len, +@@ -817,6 +817,7 @@ const char *rt_addr_n2a_r(int af, int le return inet_ntop(af, addr, buf, buflen); case AF_MPLS: return mpls_ntop(af, addr, buf, buflen); @@ -78,7 +97,7 @@ case AF_IPX: return ipx_ntop(af, addr, buf, buflen); case AF_DECnet: -@@ -718,6 +719,7 @@ const char *rt_addr_n2a(int af, int len, +@@ -826,6 +827,7 @@ const char *rt_addr_n2a_r(int af, int le memcpy(dna.a_addr, addr, 2); return dnet_ntop(af, &dna, buf, buflen); } @@ -88,14 +107,14 @@ default: --- a/lib/Makefile +++ b/lib/Makefile -@@ -4,6 +4,10 @@ ifeq ($(IP_CONFIG_SETNS),y) - CFLAGS += -DHAVE_SETNS - endif +@@ -2,6 +2,10 @@ include ../config.mk + + CFLAGS += $(FPIC) +ifeq ($(IP_CONFIG_TINY),y) + CFLAGS += -DIPROUTE2_TINY +endif + - CFLAGS += $(FPIC) - UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \ + inet_proto.o namespace.o json_writer.o json_print.o \ + names.o color.o bpf.o exec.o fs.o diff --git a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch index ff2e0aa1e..1980f8710 100644 --- a/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch +++ b/package/network/utils/iproute2/patches/900-drop_FAILED_POLICY.patch @@ -9,29 +9,6 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY ip/rtm_map.c | 4 ++++ 3 files changed, 9 insertions(+) ---- a/include/linux/fib_rules.h -+++ b/include/linux/fib_rules.h -@@ -64,6 +64,10 @@ enum { - FR_ACT_BLACKHOLE, /* Drop without notification */ - FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */ - FR_ACT_PROHIBIT, /* Drop with EACCES */ -+ FR_ACT_RES8, -+ FR_ACT_RES9, -+ FR_ACT_RES10, -+ FR_ACT_FAILED_POLICY, /* Drop with EPERM */ - __FR_ACT_MAX, - }; - ---- a/include/linux/rtnetlink.h -+++ b/include/linux/rtnetlink.h -@@ -210,6 +210,7 @@ enum { - RTN_THROW, /* Not in this table */ - RTN_NAT, /* Translate this address */ - RTN_XRESOLVE, /* Use external resolver */ -+ RTN_FAILED_POLICY, /* Source address failed policy */ - __RTN_MAX - }; - --- a/ip/rtm_map.c +++ b/ip/rtm_map.c @@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf @@ -52,3 +29,13 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY else { res = strtoul(arg, &end, 0); if (!end || end == arg || *end || res > 255) +--- a/include/uapi/linux/rtnetlink.h ++++ b/include/uapi/linux/rtnetlink.h +@@ -221,6 +221,7 @@ enum { + RTN_THROW, /* Not in this table */ + RTN_NAT, /* Translate this address */ + RTN_XRESOLVE, /* Use external resolver */ ++ RTN_FAILED_POLICY, /* Source address failed policy */ + __RTN_MAX + }; + diff --git a/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch b/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch deleted file mode 100644 index ca1125d1d..000000000 --- a/package/network/utils/iproute2/patches/910-sanitize_headers_for_musl.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/include/linux/if_bridge.h -+++ b/include/linux/if_bridge.h -@@ -15,7 +15,6 @@ - - #include - #include --#include - - #define SYSFS_BRIDGE_ATTR "bridge" - #define SYSFS_BRIDGE_FDB "brforward" diff --git a/package/network/utils/iproute2/patches/911-fix_in_h_include.patch b/package/network/utils/iproute2/patches/911-fix_in_h_include.patch deleted file mode 100644 index 42a7b24bb..000000000 --- a/package/network/utils/iproute2/patches/911-fix_in_h_include.patch +++ /dev/null @@ -1,30 +0,0 @@ ---- a/include/linux/in.h -+++ b/include/linux/in.h -@@ -15,6 +15,7 @@ - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - */ -+#ifndef _NETINET_IN_H - #ifndef _LINUX_IN_H - #define _LINUX_IN_H - -@@ -297,3 +298,4 @@ struct sockaddr_in { - - - #endif /* _LINUX_IN_H */ -+#endif /* _NETINET_IN_H */ ---- a/include/linux/in6.h -+++ b/include/linux/in6.h -@@ -18,6 +18,7 @@ - * 2 of the License, or (at your option) any later version. - */ - -+#ifndef _NETINET_IN_H - #ifndef _LINUX_IN6_H - #define _LINUX_IN6_H - -@@ -291,3 +292,4 @@ struct in6_flowlabel_req { - * MRT6_MAX - */ - #endif /* _LINUX_IN6_H */ -+#endif /* _NETINET_IN_H */ diff --git a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch index 882db8af1..5e91cd7ed 100644 --- a/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch +++ b/package/network/utils/iproute2/patches/950-add-cake-to-tc.patch @@ -1,6 +1,6 @@ ---- a/include/linux/pkt_sched.h -+++ b/include/linux/pkt_sched.h -@@ -850,4 +850,63 @@ struct tc_pie_xstats { +--- a/include/uapi/linux/pkt_sched.h ++++ b/include/uapi/linux/pkt_sched.h +@@ -872,4 +872,63 @@ struct tc_pie_xstats { __u32 maxq; /* maximum queue size */ __u32 ecn_mark; /* packets marked with ecn*/ }; @@ -66,14 +66,14 @@ #endif --- a/tc/Makefile +++ b/tc/Makefile -@@ -63,6 +63,7 @@ TCMODULES += q_codel.o +@@ -65,6 +65,7 @@ TCMODULES += q_codel.o TCMODULES += q_fq_codel.o TCMODULES += q_fq.o TCMODULES += q_pie.o +TCMODULES += q_cake.o TCMODULES += q_hhf.o + TCMODULES += q_clsact.o TCMODULES += e_bpf.o - --- /dev/null +++ b/tc/q_cake.c @@ -0,0 +1,771 @@ diff --git a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch b/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch deleted file mode 100644 index 610fb525a..000000000 --- a/package/network/utils/iproute2/patches/960-ipmonitor-fix-ip-monitor-can-t-work-when-NET_NS-is-n.patch +++ /dev/null @@ -1,35 +0,0 @@ -From c44003f7e7254ac972eaa1b22a686471ea4ce2d7 Mon Sep 17 00:00:00 2001 -From: Liping Zhang -Date: Tue, 20 Sep 2016 02:09:02 -0700 -Subject: [PATCH] ipmonitor: fix ip monitor can't work when NET_NS is not - enabled - -In ip monitor, netns_map_init will check getnsid is supported or not. -But when /proc/self/ns/net does not exist, we just print out error -messages and exit. So user cannot use ip monitor anymore when -CONFIG_NET_NS is disabled: - # ip monitor - open("/proc/self/ns/net"): No such file or directory - -If open "/proc/self/ns/net" failed, set have_rtnl_getnsid to false. - -Fixes: d652ccbf8195 ("netns: allow to dump and monitor nsid") -Signed-off-by: Liping Zhang -Acked-by: Nicolas Dichtel ---- - ip/ipnetns.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - ---- a/ip/ipnetns.c -+++ b/ip/ipnetns.c -@@ -73,8 +73,8 @@ static int ipnetns_have_nsid(void) - - fd = open("/proc/self/ns/net", O_RDONLY); - if (fd < 0) { -- perror("open(\"/proc/self/ns/net\")"); -- exit(1); -+ have_rtnl_getnsid = 0; -+ return 0; - } - - addattr32(&req.n, 1024, NETNSA_FD, fd); diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index f44c1de23..55b7c493d 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -9,12 +9,12 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset -PKG_VERSION:=6.32 +PKG_VERSION:=6.34 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org -PKG_HASH:=d9cbb49a4ae9e32d7808a604f1a37f359f9fc9064c210c4c5f35d629d49fb9fe +PKG_HASH:=d70e831b670b7aa25dde81fd994d3a7ce0c0e801559a557105576df66cd8d680 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 @@ -24,7 +24,7 @@ PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk -define Package/ipset +define Package/ipset/Default SECTION:=net CATEGORY:=Network DEPENDS+= +kmod-ipt-ipset +libmnl @@ -32,6 +32,15 @@ define Package/ipset URL:=http://ipset.netfilter.org/ endef +define Package/ipset +$(call Package/ipset/Default) + DEPENDS+= +libipset +endef + +define Package/libipset +$(call Package/ipset/Default) +endef + CONFIGURE_ARGS += \ --with-kbuild="$(LINUX_DIR)" @@ -39,10 +48,6 @@ MAKE_FLAGS += \ ARCH="$(LINUX_KARCH)" \ SHELL="$(BASH)" -define Build/Compile - $(call Build/Compile/Default) -endef - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/include/libipset $(1)/usr/include/ @@ -53,8 +58,12 @@ endef define Package/ipset/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ipset $(1)/usr/sbin/ +endef + +define Package/libipset/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/libipset*.so* $(1)/usr/lib/ endef $(eval $(call BuildPackage,ipset)) +$(eval $(call BuildPackage,libipset)) diff --git a/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch new file mode 100644 index 000000000..745e9fa3b --- /dev/null +++ b/package/network/utils/ipset/patches/001-Replace-the-last-reference-to-u_int8_t-with-uint8_t.patch @@ -0,0 +1,25 @@ +From a4212bf911026740afc7fce98d9100e2ef5dcea0 Mon Sep 17 00:00:00 2001 +From: Jozsef Kadlecsik +Date: Tue, 26 Sep 2017 07:00:13 +0200 +Subject: [PATCH] Replace the last reference to u_int8_t with uint8_t. + +--- + src/ipset.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ipset.c b/src/ipset.c +index 79f56b8..df0778a 100644 +--- a/src/ipset.c ++++ b/src/ipset.c +@@ -282,7 +282,7 @@ call_parser(int *argc, char *argv[], const struct ipset_type *type, + const struct ipset_arg *arg; + const char *optstr; + const struct ipset_type *t = type; +- u_int8_t revision = type->revision; ++ uint8_t revision = type->revision; + int ret = 0, i = 1; + + /* Currently CREATE and ADT may have got additional arguments */ +-- +2.13.5 + diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index bf1a792c0..e09c35c69 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -9,20 +9,20 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables -PKG_VERSION:=1.4.21 -PKG_RELEASE:=2 +PKG_VERSION:=1.6.1 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \ - ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \ - ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \ - ftp://ftp.no.netfilter.org/pub/netfilter/iptables/ -PKG_HASH:=52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://git.netfilter.org/iptables +PKG_SOURCE_VERSION:=7df66f1c13563cfbab75246b009ce36f69ee4487 +PKG_MIRROR_HASH:=22f15ef41fd8e3724bedcee666b7b6a3491d2d038d580ef1fb032718dcb73f14 PKG_FIXUP:=autoreconf + PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables include $(INCLUDE_DIR)/package.mk ifeq ($(DUMP),) @@ -51,6 +51,20 @@ $(call Package/iptables/Default) DEPENDS+= +kmod-ipt-core +libip4tc +IPV6:libip6tc +libxtables endef +define Package/iptables/config + config IPTABLES_CONNLABEL + bool "Enable Connlabel support" + default n + help + This enable connlabel support in iptables. + + config IPTABLES_NFTABLES + bool "Enable Nftables support" + default n + help + This enable nftables support in iptables. +endef + define Package/iptables/description IP firewall administration tool. @@ -203,6 +217,20 @@ define Package/iptables-mod-nflog/description endef +define Package/iptables-mod-trace +$(call Package/iptables/Module, +kmod-ipt-debug +kmod-ipt-raw) + TITLE:=Netfilter TRACE target +endef + +define Package/iptables-mod-trace/description + iptables extension for TRACE target + + Includes: + - libxt_TRACE + +endef + + define Package/iptables-mod-nfqueue $(call Package/iptables/Module, +kmod-nfnetlink-queue +kmod-ipt-nfqueue) TITLE:=Netfilter NFQUEUE target @@ -368,6 +396,15 @@ U32 iptables extensions. endef +define Package/iptables-mod-checksum +$(call Package/iptables/Module, +kmod-ipt-checksum) + TITLE:=IP CHECKSUM target extension +endef + +define Package/iptables-mod-checksum/description +iptables extension for the CHECKSUM calculation target +endef + define Package/ip6tables $(call Package/iptables/Default) DEPENDS:=@IPV6 +kmod-ip6tables +iptables @@ -402,6 +439,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries DEPENDS:=+libip4tc +libip6tc +libxtables + ABI_VERSION:=$(PKG_VERSION) TITLE:=IPv4/IPv6 firewall - shared libiptc library (compatibility stub) endef @@ -410,6 +448,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4 firewall - shared libiptc library + ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -418,6 +457,7 @@ $(call Package/iptables/Default) SECTION:=libs CATEGORY:=Libraries TITLE:=IPv6 firewall - shared libiptc library + ABI_VERSION:=$(PKG_VERSION) DEPENDS:=+libxtables endef @@ -426,6 +466,10 @@ define Package/libxtables SECTION:=libs CATEGORY:=Libraries TITLE:=IPv4/IPv6 firewall - shared xtables library + ABI_VERSION:=$(PKG_VERSION) + DEPENDS:= \ + +IPTABLES_CONNLABEL:libnetfilter-conntrack \ + +IPTABLES_NFTABLES:libnftnl endef TARGET_CPPFLAGS := \ @@ -444,10 +488,12 @@ TARGET_LDFLAGS += \ CONFIGURE_ARGS += \ --enable-shared \ + --enable-static \ --enable-devel \ --with-kernel="$(LINUX_DIR)/user_headers" \ --with-xtlibdir=/usr/lib/iptables \ - --enable-static \ + $(if $(CONFIG_IPTABLES_CONNLABEL),,--disable-connlabel) \ + $(if $(CONFIG_IPTABLES_NFTABLES),,--disable-nftables) \ $(if $(CONFIG_IPV6),,--disable-ipv6) MAKE_FLAGS := \ @@ -562,7 +608,9 @@ $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m))) $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m))) $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m))) $(eval $(call BuildPlugin,iptables-mod-nflog,$(IPT_NFLOG-m))) +$(eval $(call BuildPlugin,iptables-mod-trace,$(IPT_DEBUG-m))) $(eval $(call BuildPlugin,iptables-mod-nfqueue,$(IPT_NFQUEUE-m))) +$(eval $(call BuildPlugin,iptables-mod-checksum,$(IPT_CHECKSUM-m))) $(eval $(call BuildPackage,ip6tables)) $(eval $(call BuildPlugin,ip6tables-extra,$(IPT_IPV6_EXTRA-m))) $(eval $(call BuildPlugin,ip6tables-mod-nat,$(IPT_NAT6-m))) diff --git a/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch index 2b6c57ec9..4add4ea5f 100644 --- a/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch +++ b/package/network/utils/iptables/patches/020-iptables-disable-modprobe.patch @@ -1,6 +1,6 @@ --- a/libxtables/xtables.c +++ b/libxtables/xtables.c -@@ -336,6 +336,7 @@ static char *get_modprobe(void) +@@ -355,6 +355,7 @@ static char *get_modprobe(void) int xtables_insmod(const char *modname, const char *modprobe, bool quiet) { @@ -8,7 +8,7 @@ char *buf = NULL; char *argv[4]; int status; -@@ -380,6 +381,7 @@ int xtables_insmod(const char *modname, +@@ -395,6 +396,7 @@ int xtables_insmod(const char *modname, free(buf); if (WIFEXITED(status) && WEXITSTATUS(status) == 0) return 0; diff --git a/package/network/utils/iptables/patches/030-no-libnfnetlink.patch b/package/network/utils/iptables/patches/030-no-libnfnetlink.patch deleted file mode 100644 index 50542ac0b..000000000 --- a/package/network/utils/iptables/patches/030-no-libnfnetlink.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- a/configure -+++ b/configure -@@ -12367,77 +12367,7 @@ fi - fi - - --pkg_failed=no --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libnfnetlink" >&5 --$as_echo_n "checking for libnfnetlink... " >&6; } -- --if test -n "$libnfnetlink_CFLAGS"; then -- pkg_cv_libnfnetlink_CFLAGS="$libnfnetlink_CFLAGS" -- elif test -n "$PKG_CONFIG"; then -- if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 -- ac_status=$? -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; }; then -- pkg_cv_libnfnetlink_CFLAGS=`$PKG_CONFIG --cflags "libnfnetlink >= 1.0" 2>/dev/null` -- test "x$?" != "x0" && pkg_failed=yes --else -- pkg_failed=yes --fi -- else -- pkg_failed=untried --fi --if test -n "$libnfnetlink_LIBS"; then -- pkg_cv_libnfnetlink_LIBS="$libnfnetlink_LIBS" -- elif test -n "$PKG_CONFIG"; then -- if test -n "$PKG_CONFIG" && \ -- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnfnetlink >= 1.0\""; } >&5 -- ($PKG_CONFIG --exists --print-errors "libnfnetlink >= 1.0") 2>&5 -- ac_status=$? -- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -- test $ac_status = 0; }; then -- pkg_cv_libnfnetlink_LIBS=`$PKG_CONFIG --libs "libnfnetlink >= 1.0" 2>/dev/null` -- test "x$?" != "x0" && pkg_failed=yes --else -- pkg_failed=yes --fi -- else -- pkg_failed=untried --fi -- -- -- --if test $pkg_failed = yes; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- --if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then -- _pkg_short_errors_supported=yes --else -- _pkg_short_errors_supported=no --fi -- if test $_pkg_short_errors_supported = yes; then -- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` -- else -- libnfnetlink_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnfnetlink >= 1.0" 2>&1` -- fi -- # Put the nasty error message in config.log where it belongs -- echo "$libnfnetlink_PKG_ERRORS" >&5 -- -- nfnetlink=0 --elif test $pkg_failed = untried; then -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 --$as_echo "no" >&6; } -- nfnetlink=0 --else -- libnfnetlink_CFLAGS=$pkg_cv_libnfnetlink_CFLAGS -- libnfnetlink_LIBS=$pkg_cv_libnfnetlink_LIBS -- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 --$as_echo "yes" >&6; } -- nfnetlink=1 --fi -- if test "$nfnetlink" = 1; then -+if false; then - HAVE_LIBNFNETLINK_TRUE= - HAVE_LIBNFNETLINK_FALSE='#' - else ---- a/configure.ac -+++ b/configure.ac -@@ -111,9 +111,7 @@ if test "x$enable_bpfc" = "xyes" || test - AC_CHECK_LIB(pcap, pcap_compile,, AC_MSG_ERROR(missing libpcap library required by bpf compiler or nfsynproxy tool)) - fi - --PKG_CHECK_MODULES([libnfnetlink], [libnfnetlink >= 1.0], -- [nfnetlink=1], [nfnetlink=0]) --AM_CONDITIONAL([HAVE_LIBNFNETLINK], [test "$nfnetlink" = 1]) -+AM_CONDITIONAL([HAVE_LIBNFNETLINK], [false]) - - regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ - -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \ diff --git a/package/network/utils/iptables/patches/050-optional-xml.patch b/package/network/utils/iptables/patches/050-optional-xml.patch index 11311ddb4..b782bbf13 100644 --- a/package/network/utils/iptables/patches/050-optional-xml.patch +++ b/package/network/utils/iptables/patches/050-optional-xml.patch @@ -1,6 +1,6 @@ --- a/iptables/xtables-multi.c +++ b/iptables/xtables-multi.c -@@ -22,8 +22,10 @@ static const struct subcommand multi_sub +@@ -26,8 +26,10 @@ static const struct subcommand multi_sub {"iptables-restore", iptables_restore_main}, {"restore4", iptables_restore_main}, #endif diff --git a/package/network/utils/iptables/patches/100-bash-location.patch b/package/network/utils/iptables/patches/100-bash-location.patch deleted file mode 100644 index 02ee45ba1..000000000 --- a/package/network/utils/iptables/patches/100-bash-location.patch +++ /dev/null @@ -1,8 +0,0 @@ ---- a/iptables/iptables-apply -+++ b/iptables/iptables-apply -@@ -1,4 +1,4 @@ --#!/bin/bash -+#!/usr/bin/env bash - # - # iptables-apply -- a safer way to update iptables remotely - # diff --git a/package/network/utils/iptables/patches/200-configurable_builtin.patch b/package/network/utils/iptables/patches/200-configurable_builtin.patch index d35bc5a85..9c53c2bfe 100644 --- a/package/network/utils/iptables/patches/200-configurable_builtin.patch +++ b/package/network/utils/iptables/patches/200-configurable_builtin.patch @@ -1,58 +1,75 @@ --- a/extensions/GNUmakefile.in +++ b/extensions/GNUmakefile.in -@@ -45,9 +45,24 @@ pfx_symlinks := NOTRACK state - pfx_build_mod := $(filter-out @blacklist_modules@,${pfx_build_mod}) - pf4_build_mod := $(filter-out @blacklist_modules@,${pf4_build_mod}) - pf6_build_mod := $(filter-out @blacklist_modules@,${pf6_build_mod}) +@@ -50,11 +50,31 @@ pfb_build_mod := $(filter-out @blacklist + pfa_build_mod := $(filter-out @blacklist_modules@ @blacklist_a_modules@,${pfa_build_mod}) + pf4_build_mod := $(filter-out @blacklist_modules@ @blacklist_4_modules@,${pf4_build_mod}) + pf6_build_mod := $(filter-out @blacklist_modules@ @blacklist_6_modules@,${pf6_build_mod}) -pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_mod}) +-pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_mod}) +-pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_mod}) -pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_mod}) -pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_mod}) -+ +ifdef BUILTIN_MODULES +pfx_build_static := $(filter $(BUILTIN_MODULES),${pfx_build_mod}) ++pfb_build_static := $(filter $(BUILTIN_MODULES),${pfb_build_mod}) ++pfa_build_static := $(filter $(BUILTIN_MODULES),${pfa_build_mod}) +pf4_build_static := $(filter $(BUILTIN_MODULES),${pf4_build_mod}) +pf6_build_static := $(filter $(BUILTIN_MODULES),${pf6_build_mod}) +else +@ENABLE_STATIC_TRUE@ pfx_build_static := $(pfx_build_mod) ++@ENABLE_STATIC_TRUE@ pfb_build_static := $(pfb_build_mod) ++@ENABLE_STATIC_TRUE@ pfa_build_static := $(pfa_build_mod) +@ENABLE_STATIC_TRUE@ pf4_build_static := $(pf4_build_mod) +@ENABLE_STATIC_TRUE@ pf6_build_static := $(pf6_build_mod) +endif + +pfx_build_mod := $(filter-out $(pfx_build_static),$(pfx_build_mod)) ++pfb_build_mod := $(filter-out $(pfb_build_static),$(pfb_build_mod)) ++pfa_build_mod := $(filter-out $(pfa_build_static),$(pfa_build_mod)) +pf4_build_mod := $(filter-out $(pf4_build_static),$(pf4_build_mod)) +pf6_build_mod := $(filter-out $(pf6_build_static),$(pf6_build_mod)) + +pfx_objs := $(patsubst %,libxt_%.o,${pfx_build_static}) ++pfb_objs := $(patsubst %,libebt_%.o,${pfb_build_static}) ++pfa_objs := $(patsubst %,libarpt_%.o,${pfa_build_static}) +pf4_objs := $(patsubst %,libipt_%.o,${pf4_build_static}) +pf6_objs := $(patsubst %,libip6t_%.o,${pf6_build_static}) pfx_solibs := $(patsubst %,libxt_%.so,${pfx_build_mod} ${pfx_symlinks}) - pf4_solibs := $(patsubst %,libipt_%.so,${pf4_build_mod}) - pf6_solibs := $(patsubst %,libip6t_%.so,${pf6_build_mod}) -@@ -58,11 +73,11 @@ pf6_solibs := $(patsubst %,libip6t_%. + pfb_solibs := $(patsubst %,libebt_%.so,${pfb_build_mod}) + pfa_solibs := $(patsubst %,libarpt_%.so,${pfa_build_mod}) +@@ -67,13 +87,13 @@ pf6_solibs := $(patsubst %,libip6t_%. # - targets := libext.a libext4.a libext6.a matches.man targets.man + targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man targets_install := -@ENABLE_STATIC_TRUE@ libext_objs := ${pfx_objs} +-@ENABLE_STATIC_TRUE@ libext_ebt_objs := ${pfb_objs} +-@ENABLE_STATIC_TRUE@ libext_arpt_objs := ${pfa_objs} -@ENABLE_STATIC_TRUE@ libext4_objs := ${pf4_objs} -@ENABLE_STATIC_TRUE@ libext6_objs := ${pf6_objs} --@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} --@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} +-@ENABLE_STATIC_FALSE@ targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +-@ENABLE_STATIC_FALSE@ targets_install += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} +libext_objs := ${pfx_objs} ++libext_ebt_objs := ${pfb_objs} ++libext_arpt_objs := ${pfa_objs} +libext4_objs := ${pf4_objs} +libext6_objs := ${pf6_objs} -+targets += ${pfx_solibs} ${pf4_solibs} ${pf6_solibs} -+targets_install := $(strip ${targets_install} ${pfx_solibs} ${pf4_solibs} ${pf6_solibs}) ++targets += ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs} ++targets_install := $(strip ${pfx_solibs} ${pfb_solibs} ${pf4_solibs} ${pf6_solibs} ${pfa_solibs}) .SECONDARY: -@@ -126,9 +141,9 @@ libext4.a: initext4.o ${libext4_objs} +@@ -141,11 +161,11 @@ libext4.a: initext4.o ${libext4_objs} libext6.a: initext6.o ${libext6_objs} ${AM_VERBOSE_AR} ${AR} crs $@ $^; -initext_func := $(addprefix xt_,${pfx_build_mod}) +-initextb_func := $(addprefix ebt_,${pfb_build_mod}) +-initexta_func := $(addprefix arpt_,${pfa_build_mod}) -initext4_func := $(addprefix ipt_,${pf4_build_mod}) -initext6_func := $(addprefix ip6t_,${pf6_build_mod}) +initext_func := $(addprefix xt_,${pfx_build_static}) ++initextb_func := $(addprefix ebt_,${pfb_build_static}) ++initexta_func := $(addprefix arpt_,${pfa_build_static}) +initext4_func := $(addprefix ipt_,${pf4_build_static}) +initext6_func := $(addprefix ip6t_,${pf6_build_static}) diff --git a/package/network/utils/iptables/patches/300-musl_fixes.patch b/package/network/utils/iptables/patches/300-musl_fixes.patch deleted file mode 100644 index a78eda775..000000000 --- a/package/network/utils/iptables/patches/300-musl_fixes.patch +++ /dev/null @@ -1,127 +0,0 @@ ---- a/extensions/libip6t_ipv6header.c -+++ b/extensions/libip6t_ipv6header.c -@@ -10,6 +10,9 @@ on whether they contain certain headers - #include - #include - #include -+#ifndef IPPROTO_HOPOPTS -+# define IPPROTO_HOPOPTS 0 -+#endif - - enum { - O_HEADER = 0, ---- a/extensions/libxt_TCPOPTSTRIP.c -+++ b/extensions/libxt_TCPOPTSTRIP.c -@@ -12,6 +12,21 @@ - #ifndef TCPOPT_MD5SIG - # define TCPOPT_MD5SIG 19 - #endif -+#ifndef TCPOPT_MAXSEG -+# define TCPOPT_MAXSEG 2 -+#endif -+#ifndef TCPOPT_WINDOW -+# define TCPOPT_WINDOW 3 -+#endif -+#ifndef TCPOPT_SACK_PERMITTED -+# define TCPOPT_SACK_PERMITTED 4 -+#endif -+#ifndef TCPOPT_SACK -+# define TCPOPT_SACK 5 -+#endif -+#ifndef TCPOPT_TIMESTAMP -+# define TCPOPT_TIMESTAMP 8 -+#endif - - enum { - O_STRIP_OPTION = 0, ---- a/include/libiptc/ipt_kernel_headers.h -+++ b/include/libiptc/ipt_kernel_headers.h -@@ -5,7 +5,6 @@ - - #include - --#if defined(__GLIBC__) && __GLIBC__ == 2 - #include - #include - #include -@@ -13,15 +12,4 @@ - #include - #include - #include --#else /* libc5 */ --#include --#include --#include --#include --#include --#include --#include --#include --#include --#endif - #endif ---- a/include/linux/netfilter_ipv4/ip_tables.h -+++ b/include/linux/netfilter_ipv4/ip_tables.h -@@ -16,6 +16,7 @@ - #define _IPTABLES_H - - #include -+#include - - #include - ---- a/iptables/ip6tables-restore.c -+++ b/iptables/ip6tables-restore.c -@@ -9,7 +9,7 @@ - */ - - #include --#include -+#include - #include - #include - #include ---- a/iptables/ip6tables-save.c -+++ b/iptables/ip6tables-save.c -@@ -6,7 +6,7 @@ - * This code is distributed under the terms of GNU GPL v2 - */ - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-restore.c -+++ b/iptables/iptables-restore.c -@@ -6,7 +6,7 @@ - */ - - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-save.c -+++ b/iptables/iptables-save.c -@@ -6,7 +6,7 @@ - * - */ - #include --#include -+#include - #include - #include - #include ---- a/iptables/iptables-xml.c -+++ b/iptables/iptables-xml.c -@@ -7,7 +7,7 @@ - */ - - #include --#include -+#include - #include - #include - #include diff --git a/package/network/utils/iptables/patches/600-shared-libext.patch b/package/network/utils/iptables/patches/600-shared-libext.patch index 92f548539..a906d4060 100644 --- a/package/network/utils/iptables/patches/600-shared-libext.patch +++ b/package/network/utils/iptables/patches/600-shared-libext.patch @@ -1,17 +1,15 @@ -Index: iptables-1.4.21/extensions/GNUmakefile.in -=================================================================== ---- iptables-1.4.21.orig/extensions/GNUmakefile.in -+++ iptables-1.4.21/extensions/GNUmakefile.in -@@ -71,7 +71,7 @@ pf6_solibs := $(patsubst %,libip6t_%. +--- a/extensions/GNUmakefile.in ++++ b/extensions/GNUmakefile.in +@@ -85,7 +85,7 @@ pf6_solibs := $(patsubst %,libip6t_%. # # Building blocks # --targets := libext.a libext4.a libext6.a matches.man targets.man -+targets := libiptext.so libiptext4.so libiptext6.so matches.man targets.man +-targets := libext.a libext4.a libext6.a libext_ebt.a libext_arpt.a matches.man targets.man ++targets := libiptext.so libiptext4.so libiptext6.so libiptext_ebt.so libiptext_arpt.so matches.man targets.man targets_install := libext_objs := ${pfx_objs} - libext4_objs := ${pf4_objs} -@@ -96,7 +96,7 @@ clean: + libext_ebt_objs := ${pfb_objs} +@@ -112,7 +112,7 @@ clean: distclean: clean init%.o: init%.c @@ -20,7 +18,7 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in -include .*.d -@@ -130,16 +130,16 @@ xt_statistic_LIBADD = -lm +@@ -144,22 +144,22 @@ xt_connlabel_LIBADD = @libnetfilter_conn # handling code in the Makefiles. # lib%.o: ${srcdir}/lib%.c @@ -32,6 +30,16 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in +libiptext.so: initext.o ${libext_objs} + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; +-libext_ebt.a: initextb.o ${libext_ebt_objs} +- ${AM_VERBOSE_AR} ${AR} crs $@ $^; ++libiptext_ebt.so: initextb.o ${libext_ebt_objs} ++ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; + +-libext_arpt.a: initexta.o ${libext_arpt_objs} +- ${AM_VERBOSE_AR} ${AR} crs $@ $^; ++libiptext_arpt.so: initexta.o ${libext_arpt_objs} ++ ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; + -libext4.a: initext4.o ${libext4_objs} - ${AM_VERBOSE_AR} ${AR} crs $@ $^; +libiptext4.so: initext4.o ${libext4_objs} @@ -43,12 +51,10 @@ Index: iptables-1.4.21/extensions/GNUmakefile.in + ${AM_VERBOSE_CCLD} ${CCLD} ${AM_LDFLAGS} -shared ${LDFLAGS} -o $@ $^ -L../libxtables/.libs -lxtables ${$*_LIBADD}; initext_func := $(addprefix xt_,${pfx_build_static}) - initext4_func := $(addprefix ipt_,${pf4_build_static}) -Index: iptables-1.4.21/iptables/Makefile.am -=================================================================== ---- iptables-1.4.21.orig/iptables/Makefile.am -+++ iptables-1.4.21/iptables/Makefile.am -@@ -5,7 +5,8 @@ AM_CPPFLAGS = ${regular_CPPFLAGS} - + initextb_func := $(addprefix ebt_,${pfb_build_static}) +--- a/iptables/Makefile.am ++++ b/iptables/Makefile.am +@@ -8,7 +8,8 @@ BUILT_SOURCES = xtables_multi_SOURCES = xtables-multi.c iptables-xml.c xtables_multi_CFLAGS = ${AM_CFLAGS} @@ -58,7 +64,7 @@ Index: iptables-1.4.21/iptables/Makefile.am if ENABLE_STATIC xtables_multi_CFLAGS += -DALL_INCLUSIVE endif -@@ -13,13 +14,15 @@ if ENABLE_IPV4 +@@ -16,13 +17,15 @@ if ENABLE_IPV4 xtables_multi_SOURCES += iptables-save.c iptables-restore.c \ iptables-standalone.c iptables.c xtables_multi_CFLAGS += -DENABLE_IPV4 @@ -76,3 +82,23 @@ Index: iptables-1.4.21/iptables/Makefile.am endif xtables_multi_SOURCES += xshared.c xtables_multi_LDADD += ../libxtables/libxtables.la -lm +@@ -32,7 +35,8 @@ if ENABLE_NFTABLES + BUILT_SOURCES += xtables-config-parser.h + xtables_compat_multi_SOURCES = xtables-compat-multi.c iptables-xml.c + xtables_compat_multi_CFLAGS = ${AM_CFLAGS} +-xtables_compat_multi_LDADD = ../extensions/libext.a ../extensions/libext_ebt.a ++xtables_compat_multi_LDADD = ++xtables_compat_multi_LDFLAGS = -L../extensions/ -liptext -liptext_ebt + if ENABLE_STATIC + xtables_compat_multi_CFLAGS += -DALL_INCLUSIVE + endif +@@ -45,7 +49,8 @@ xtables_compat_multi_SOURCES += xtables- + getethertype.c nft-bridge.c \ + xtables-eb-standalone.c xtables-eb.c \ + xtables-translate.c +-xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ../extensions/libext4.a ../extensions/libext6.a ../extensions/libext_ebt.a ../extensions/libext_arpt.a ++xtables_compat_multi_LDADD += ${libmnl_LIBS} ${libnftnl_LIBS} ${libnetfilter_conntrack_LIBS} ++xtables_compat_multi_LDFLAGS += -liptext4 -liptext6 -liptext_arpt + # yacc and lex generate dirty code + xtables_compat_multi-xtables-config-parser.o xtables_compat_multi-xtables-config-syntax.o: AM_CFLAGS += -Wno-missing-prototypes -Wno-missing-declarations -Wno-implicit-function-declaration -Wno-nested-externs -Wno-undef -Wno-redundant-decls + xtables_compat_multi_SOURCES += xshared.c diff --git a/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch index 342c3b013..6800ca5ec 100644 --- a/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch +++ b/package/network/utils/iptables/patches/700-disable-legacy-revisions.patch @@ -1,8 +1,6 @@ -Index: iptables-1.4.21/extensions/libxt_conntrack.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_conntrack.c -+++ iptables-1.4.21/extensions/libxt_conntrack.c -@@ -1157,6 +1157,7 @@ static void state_save(const void *ip, c +--- a/extensions/libxt_conntrack.c ++++ b/extensions/libxt_conntrack.c +@@ -1397,6 +1397,7 @@ static int conntrack3_mt6_xlate(struct x } static struct xtables_match conntrack_mt_reg[] = { @@ -10,7 +8,7 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1232,6 +1233,7 @@ static struct xtables_match conntrack_mt +@@ -1472,6 +1473,7 @@ static struct xtables_match conntrack_mt .alias = conntrack_print_name_alias, .x6_options = conntrack2_mt_opts, }, @@ -18,31 +16,24 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c { .version = XTABLES_VERSION, .name = "conntrack", -@@ -1262,6 +1264,7 @@ static struct xtables_match conntrack_mt - .alias = conntrack_print_name_alias, +@@ -1504,6 +1506,7 @@ static struct xtables_match conntrack_mt .x6_options = conntrack3_mt_opts, + .xlate = conntrack3_mt6_xlate, }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1292,6 +1295,7 @@ static struct xtables_match conntrack_mt +@@ -1534,6 +1537,8 @@ static struct xtables_match conntrack_mt .x6_parse = state_ct23_parse, .x6_options = state_opts, }, +#endif - { - .family = NFPROTO_UNSPEC, - .name = "state", -@@ -1307,6 +1311,7 @@ static struct xtables_match conntrack_mt - .x6_parse = state_ct23_parse, - .x6_options = state_opts, - }, +#ifndef NO_LEGACY { .family = NFPROTO_UNSPEC, .name = "state", -@@ -1320,6 +1325,7 @@ static struct xtables_match conntrack_mt +@@ -1563,6 +1568,7 @@ static struct xtables_match conntrack_mt .x6_parse = state_parse, .x6_options = state_opts, }, @@ -50,11 +41,9 @@ Index: iptables-1.4.21/extensions/libxt_conntrack.c }; void _init(void) -Index: iptables-1.4.21/extensions/libxt_CT.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_CT.c -+++ iptables-1.4.21/extensions/libxt_CT.c -@@ -290,6 +290,7 @@ static void notrack_ct2_tg_init(struct x +--- a/extensions/libxt_CT.c ++++ b/extensions/libxt_CT.c +@@ -349,6 +349,7 @@ static void notrack_ct2_tg_init(struct x } static struct xtables_target ct_target_reg[] = { @@ -62,7 +51,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -315,6 +316,7 @@ static struct xtables_target ct_target_r +@@ -374,6 +375,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -70,7 +59,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "CT", -@@ -329,6 +331,7 @@ static struct xtables_target ct_target_r +@@ -388,6 +390,7 @@ static struct xtables_target ct_target_r .x6_parse = ct_parse_v1, .x6_options = ct_opts_v1, }, @@ -78,7 +67,7 @@ Index: iptables-1.4.21/extensions/libxt_CT.c { .family = NFPROTO_UNSPEC, .name = "NOTRACK", -@@ -366,6 +369,7 @@ static struct xtables_target ct_target_r +@@ -425,6 +428,7 @@ static struct xtables_target ct_target_r .revision = 0, .version = XTABLES_VERSION, }, @@ -86,11 +75,9 @@ Index: iptables-1.4.21/extensions/libxt_CT.c }; void _init(void) -Index: iptables-1.4.21/extensions/libxt_multiport.c -=================================================================== ---- iptables-1.4.21.orig/extensions/libxt_multiport.c -+++ iptables-1.4.21/extensions/libxt_multiport.c -@@ -469,6 +469,7 @@ static void multiport_save6_v1(const voi +--- a/extensions/libxt_multiport.c ++++ b/extensions/libxt_multiport.c +@@ -571,6 +571,7 @@ static int multiport_xlate6_v1(struct xt } static struct xtables_match multiport_mt_reg[] = { @@ -98,9 +85,9 @@ Index: iptables-1.4.21/extensions/libxt_multiport.c { .family = NFPROTO_IPV4, .name = "multiport", -@@ -497,6 +498,7 @@ static struct xtables_match multiport_mt - .save = multiport_save6, +@@ -601,6 +602,7 @@ static struct xtables_match multiport_mt .x6_options = multiport_opts, + .xlate = multiport_xlate6, }, +#endif { diff --git a/package/network/utils/iputils/Makefile b/package/network/utils/iputils/Makefile index b6799e68b..344af07af 100644 --- a/package/network/utils/iputils/Makefile +++ b/package/network/utils/iputils/Makefile @@ -17,6 +17,7 @@ PKG_HASH:=fd3af46c80ebb99607c2ca1f2a3608b6fe828e25bbec6e54f2afd25f6ddb6ee7 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:skbuff:iputils PKG_BUILD_DEPENDS:=sysfsutils PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-s$(PKG_VERSION) diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile index a578ddc98..9b3c12bec 100644 --- a/package/network/utils/iw/Makefile +++ b/package/network/utils/iw/Makefile @@ -30,8 +30,7 @@ endef define Build/Configure echo "const char iw_version[] = \"$(PKG_VERSION)\";" > $(PKG_BUILD_DIR)/version.c - rm -f $(PKG_BUILD_DIR)/version.sh - touch $(PKG_BUILD_DIR)/version.sh + echo "#!/bin/sh" > $(PKG_BUILD_DIR)/version.sh chmod +x $(PKG_BUILD_DIR)/version.sh endef diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch index 88e47cce8..25ec1263a 100644 --- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch +++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch @@ -1,6 +1,81 @@ --- a/nl80211.h +++ b/nl80211.h -@@ -323,7 +323,7 @@ +@@ -10,7 +10,7 @@ + * Copyright 2008, 2009 Luis R. Rodriguez + * Copyright 2008 Jouni Malinen + * Copyright 2008 Colin McCabe +- * Copyright 2015 Intel Deutschland GmbH ++ * Copyright 2015-2017 Intel Deutschland GmbH + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above +@@ -173,6 +173,65 @@ + */ + + /** ++ * DOC: WPA/WPA2 EAPOL handshake offload ++ * ++ * By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers ++ * can indicate they support offloading EAPOL handshakes for WPA/WPA2 ++ * preshared key authentication. In %NL80211_CMD_CONNECT the preshared ++ * key should be specified using %NL80211_ATTR_PMK. Drivers supporting ++ * this offload may reject the %NL80211_CMD_CONNECT when no preshared ++ * key material is provided, for example when that driver does not ++ * support setting the temporal keys through %CMD_NEW_KEY. ++ * ++ * Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be ++ * set by drivers indicating offload support of the PTK/GTK EAPOL ++ * handshakes during 802.1X authentication. In order to use the offload ++ * the %NL80211_CMD_CONNECT should have %NL80211_ATTR_WANT_1X_4WAY_HS ++ * attribute flag. Drivers supporting this offload may reject the ++ * %NL80211_CMD_CONNECT when the attribute flag is not present. ++ * ++ * For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK ++ * using %NL80211_CMD_SET_PMK. For offloaded FT support also ++ * %NL80211_ATTR_PMKR0_NAME must be provided. ++ */ ++ ++/** ++ * DOC: FILS shared key authentication offload ++ * ++ * FILS shared key authentication offload can be advertized by drivers by ++ * setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support ++ * FILS shared key authentication offload should be able to construct the ++ * authentication and association frames for FILS shared key authentication and ++ * eventually do a key derivation as per IEEE 802.11ai. The below additional ++ * parameters should be given to driver in %NL80211_CMD_CONNECT. ++ * %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai ++ * %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai ++ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message ++ * %NL80211_ATTR_FILS_ERP_RRK - used to generate the rIK and rMSK ++ * rIK should be used to generate an authentication tag on the ERP message and ++ * rMSK should be used to derive a PMKSA. ++ * rIK, rMSK should be generated and keyname_nai, sequence number should be used ++ * as specified in IETF RFC 6696. ++ * ++ * When FILS shared key authentication is completed, driver needs to provide the ++ * below additional parameters to userspace. ++ * %NL80211_ATTR_FILS_KEK - used for key renewal ++ * %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges ++ * %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated ++ * %Nl80211_ATTR_PMK - used to update PMKSA cache in userspace ++ * The PMKSA can be maintained in userspace persistently so that it can be used ++ * later after reboots or wifi turn off/on also. ++ * ++ * %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertized by a FILS ++ * capable AP supporting PMK caching. It specifies the scope within which the ++ * PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and ++ * %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based ++ * on FILS cache identifier. Additionally %NL80211_ATTR_PMK is used with ++ * %NL80211_SET_PMKSA to specify the PMK corresponding to a PMKSA for driver to ++ * use in a FILS shared key connection with PMKSA caching. ++ */ ++ ++/** + * enum nl80211_commands - supported nl80211 commands + * + * @NL80211_CMD_UNSPEC: unspecified command to catch errors +@@ -323,7 +382,7 @@ * @NL80211_CMD_GET_SCAN: get scan results * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the @@ -9,7 +84,56 @@ * specify a BSSID to scan for; if not included, the wildcard BSSID will * be used. * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to -@@ -600,6 +600,20 @@ +@@ -351,7 +410,9 @@ + * are used. Extra IEs can also be passed from the userspace by + * using the %NL80211_ATTR_IE attribute. The first cycle of the + * scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY +- * is supplied. ++ * is supplied. If the device supports multiple concurrent scheduled ++ * scans, it will allow such when the caller provides the flag attribute ++ * %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it. + * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if + * scheduled scan is not running. The caller may assume that as soon + * as the call returns, it is safe to start a new scheduled scan again. +@@ -370,10 +431,18 @@ + * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to + * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) + * +- * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry, using %NL80211_ATTR_MAC +- * (for the BSSID) and %NL80211_ATTR_PMKID. ++ * @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry using %NL80211_ATTR_MAC ++ * (for the BSSID), %NL80211_ATTR_PMKID, and optionally %NL80211_ATTR_PMK ++ * (PMK is used for PTKSA derivation in case of FILS shared key offload) or ++ * using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID, ++ * %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS ++ * authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier ++ * advertized by a FILS capable AP identifying the scope of PMKSA in an ++ * ESS. + * @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC +- * (for the BSSID) and %NL80211_ATTR_PMKID. ++ * (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID, ++ * %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS ++ * authentication. + * @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries. + * + * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain +@@ -500,8 +569,13 @@ + * authentication/association or not receiving a response from the AP. + * Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as + * well to remain backwards compatible. +- * @NL80211_CMD_ROAM: request that the card roam (currently not implemented), +- * sent as an event when the card/driver roamed by itself. ++ * @NL80211_CMD_ROAM: notifcation indicating the card/driver roamed by itself. ++ * When the driver roamed in a network that requires 802.1X authentication, ++ * %NL80211_ATTR_PORT_AUTHORIZED should be set if the 802.1X authentication ++ * was done by the driver or if roaming was done using Fast Transition ++ * protocol (in which case 802.1X authentication is not needed). If ++ * %NL80211_ATTR_PORT_AUTHORIZED is not set, user space is responsible for ++ * the 802.1X authentication. + * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify + * userspace that a connection was dropped by the AP or due to other + * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and +@@ -600,6 +674,20 @@ * * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. * @@ -30,7 +154,45 @@ * @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial * mesh config parameters may be given. * @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the -@@ -874,6 +888,12 @@ +@@ -840,12 +928,15 @@ + * cfg80211_scan_done(). + * + * @NL80211_CMD_START_NAN: Start NAN operation, identified by its +- * %NL80211_ATTR_WDEV interface. This interface must have been previously +- * created with %NL80211_CMD_NEW_INTERFACE. After it has been started, the +- * NAN interface will create or join a cluster. This command must have a +- * valid %NL80211_ATTR_NAN_MASTER_PREF attribute and optional +- * %NL80211_ATTR_NAN_DUAL attributes. +- * After this command NAN functions can be added. ++ * %NL80211_ATTR_WDEV interface. This interface must have been ++ * previously created with %NL80211_CMD_NEW_INTERFACE. After it ++ * has been started, the NAN interface will create or join a ++ * cluster. This command must have a valid ++ * %NL80211_ATTR_NAN_MASTER_PREF attribute and optional ++ * %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is ++ * omitted or set to 0, it means don't-care and the device will ++ * decide what to use. After this command NAN functions can be ++ * added. + * @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by + * its %NL80211_ATTR_WDEV interface. + * @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined +@@ -866,14 +957,32 @@ + * This command is also used as a notification sent when a NAN function is + * terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID + * and %NL80211_ATTR_COOKIE attributes. +- * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN configuration. NAN +- * must be operational (%NL80211_CMD_START_NAN was executed). +- * It must contain at least one of the following attributes: +- * %NL80211_ATTR_NAN_MASTER_PREF, %NL80211_ATTR_NAN_DUAL. ++ * @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN ++ * configuration. NAN must be operational (%NL80211_CMD_START_NAN ++ * was executed). It must contain at least one of the following ++ * attributes: %NL80211_ATTR_NAN_MASTER_PREF, ++ * %NL80211_ATTR_BANDS. If %NL80211_ATTR_BANDS is omitted, the ++ * current configuration is not changed. If it is present but ++ * set to zero, the configuration is changed to don't-care ++ * (i.e. the device can decide what to do). + * @NL80211_CMD_NAN_FUNC_MATCH: Notification sent when a match is reported. * This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and * %NL80211_ATTR_COOKIE. * @@ -39,22 +201,33 @@ + * BSS selection. This command can be issued only while connected and it + * does not result in a change for the current association. Currently, + * only the %NL80211_ATTR_IE data is used and updated with this command. ++ * ++ * @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0 ++ * for the given authenticator address (specified with &NL80211_ATTR_MAC). ++ * When &NL80211_ATTR_PMKR0_NAME is set, &NL80211_ATTR_PMK specifies the ++ * PMK-R0, otherwise it specifies the PMK. ++ * @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously ++ * configured PMK for the authenticator address identified by ++ * &NL80211_ATTR_MAC. + * * @NL80211_CMD_MAX: highest used command number * @__NL80211_CMD_AFTER_LAST: internal use */ -@@ -1069,6 +1089,10 @@ enum nl80211_commands { +@@ -1069,6 +1178,13 @@ enum nl80211_commands { NL80211_CMD_CHANGE_NAN_CONFIG, NL80211_CMD_NAN_MATCH, + NL80211_CMD_SET_MULTICAST_TO_UNICAST, + + NL80211_CMD_UPDATE_CONNECT_PARAMS, ++ ++ NL80211_CMD_SET_PMK, ++ NL80211_CMD_DEL_PMK, + /* add new commands above here */ /* used to define NL80211_CMD_MAX below */ -@@ -1638,8 +1662,16 @@ enum nl80211_commands { +@@ -1638,8 +1754,16 @@ enum nl80211_commands { * the connection request from a station. nl80211_connect_failed_reason * enum has different reasons of connection failure. * @@ -73,7 +246,7 @@ * * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from * association request when used with NL80211_CMD_NEW_STATION) -@@ -1740,7 +1772,9 @@ enum nl80211_commands { +@@ -1740,7 +1864,9 @@ enum nl80211_commands { * * @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode * Notification Element based on association request when used with @@ -84,16 +257,41 @@ * * @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if * %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet) -@@ -1788,6 +1822,8 @@ enum nl80211_commands { - * and remove functions. NAN notifications will be sent in unicast to that - * socket. Without this attribute, any socket can add functions and the - * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. +@@ -1783,11 +1909,12 @@ enum nl80211_commands { + * that configured the indoor setting, and the indoor operation would be + * cleared when the socket is closed. + * If set during NAN interface creation, the interface will be destroyed +- * if the socket is closed just like any other interface. Moreover, only +- * the netlink socket that created the interface will be allowed to add +- * and remove functions. NAN notifications will be sent in unicast to that +- * socket. Without this attribute, any socket can add functions and the +- * notifications will be sent to the %NL80211_MCGRP_NAN multicast group. ++ * if the socket is closed just like any other interface. Moreover, NAN ++ * notifications will be sent in unicast to that socket. Without this ++ * attribute, the notifications will be sent to the %NL80211_MCGRP_NAN ++ * multicast group. + * If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the + * station will deauthenticate when the socket is closed. * * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is * the TDLS link initiator. -@@ -1936,6 +1972,38 @@ enum nl80211_commands { +@@ -1927,15 +2054,93 @@ enum nl80211_commands { + * %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0. + * Also, values 1 and 255 are reserved for certification purposes and + * should not be used during a normal device operation. +- * @NL80211_ATTR_NAN_DUAL: NAN dual band operation config (see +- * &enum nl80211_nan_dual_band_conf). This attribute is used with +- * %NL80211_CMD_START_NAN and optionally with +- * %NL80211_CMD_CHANGE_NAN_CONFIG. ++ * @NL80211_ATTR_BANDS: operating bands configuration. This is a u32 ++ * bitmask of BIT(NL80211_BAND_*) as described in %enum ++ * nl80211_band. For instance, for NL80211_BAND_2GHZ, bit 0 ++ * would be set. This attribute is used with ++ * %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG, and ++ * it is optional. If no bands are set, it means don't-care and ++ * the device will decide what to use. + * @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See + * &enum nl80211_nan_func_attributes for description of this nested * attribute. * @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute. * See &enum nl80211_nan_match_attributes. @@ -127,12 +325,55 @@ + * u32 attribute with an &enum nl80211_timeout_reason value. This is used, + * e.g., with %NL80211_CMD_CONNECT event. + * ++ * @NL80211_ATTR_FILS_ERP_USERNAME: EAP Re-authentication Protocol (ERP) ++ * username part of NAI used to refer keys rRK and rIK. This is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_REALM: EAP Re-authentication Protocol (ERP) realm part ++ * of NAI specifying the domain name of the ER server. This is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM: Unsigned 16-bit ERP next sequence number ++ * to use in ERP messages. This is used in generating the FILS wrapped data ++ * for FILS authentication and is used with %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_ERP_RRK: ERP re-authentication Root Key (rRK) for the ++ * NAI specified by %NL80211_ATTR_FILS_ERP_USERNAME and ++ * %NL80211_ATTR_FILS_ERP_REALM. This is used for generating rIK and rMSK ++ * from successful FILS authentication and is used with ++ * %NL80211_CMD_CONNECT. ++ * ++ * @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertized by a FILS AP ++ * identifying the scope of PMKSAs. This is used with ++ * @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA. ++ * ++ * @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with ++ * %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID. ++ * For %NL80211_CMD_CONNECT it is used to provide PSK for offloading 4-way ++ * handshake for WPA/WPA2-PSK networks. For 802.1X authentication it is ++ * used with %NL80211_CMD_SET_PMK. For offloaded FT support this attribute ++ * specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME is included as well. ++ * ++ * @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to ++ * indicate that it supports multiple active scheduled scan requests. ++ * @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled ++ * scan request that may be active for the device (u32). ++ * ++ * @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include ++ * in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it ++ * wants to use the supported offload of the 4-way handshake. ++ * @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT. ++ * @NL80211_ATTR_PORT_AUTHORIZED: flag attribute used in %NL80211_CMD_ROAMED ++ * notification indicating that that 802.1X authentication was done by ++ * the driver or is not needed (because roaming used the Fast Transition ++ * protocol). ++ * + * @NL80211_ATTR_WIPHY_ANTENNA_GAIN: Configured antenna gain. Used to reduce + * transmit power to stay within regulatory limits. u32, dBi. * * @NUM_NL80211_ATTR: total number of nl80211_attrs available * @NL80211_ATTR_MAX: highest attribute number currently defined -@@ -2195,7 +2263,7 @@ enum nl80211_attrs { +@@ -2195,7 +2400,7 @@ enum nl80211_attrs { NL80211_ATTR_CONN_FAILED_REASON, @@ -141,7 +382,12 @@ NL80211_ATTR_VHT_CAPABILITY, -@@ -2336,6 +2404,20 @@ enum nl80211_attrs { +@@ -2332,10 +2537,39 @@ enum nl80211_attrs { + NL80211_ATTR_MESH_PEER_AID, + + NL80211_ATTR_NAN_MASTER_PREF, +- NL80211_ATTR_NAN_DUAL, ++ NL80211_ATTR_BANDS, NL80211_ATTR_NAN_FUNC, NL80211_ATTR_NAN_MATCH, @@ -157,12 +403,27 @@ + + NL80211_ATTR_TIMEOUT_REASON, + ++ NL80211_ATTR_FILS_ERP_USERNAME, ++ NL80211_ATTR_FILS_ERP_REALM, ++ NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM, ++ NL80211_ATTR_FILS_ERP_RRK, ++ NL80211_ATTR_FILS_CACHE_ID, ++ ++ NL80211_ATTR_PMK, ++ ++ NL80211_ATTR_SCHED_SCAN_MULTI, ++ NL80211_ATTR_SCHED_SCAN_MAX_REQS, ++ ++ NL80211_ATTR_WANT_1X_4WAY_HS, ++ NL80211_ATTR_PMKR0_NAME, ++ NL80211_ATTR_PORT_AUTHORIZED, ++ + NL80211_ATTR_WIPHY_ANTENNA_GAIN, + /* add attributes here, update the policy in nl80211.c */ __NL80211_ATTR_AFTER_LAST, -@@ -2347,6 +2429,7 @@ enum nl80211_attrs { +@@ -2347,6 +2581,7 @@ enum nl80211_attrs { #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION #define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG #define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER @@ -170,7 +431,15 @@ /* * Allow user space programs to use #ifdef on new attributes by defining them -@@ -3027,6 +3110,13 @@ enum nl80211_reg_rule_attr { +@@ -3019,6 +3254,7 @@ enum nl80211_reg_rule_attr { + * @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved + * @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching, + * only report BSS with matching SSID. ++ * (This cannot be used together with BSSID.) + * @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a + * BSS in scan results. Filtering is turned off if not specified. Note that + * if this attribute is in a match set of its own, then it is treated as +@@ -3027,6 +3263,15 @@ enum nl80211_reg_rule_attr { * how this API was implemented in the past. Also, due to the same problem, * the only way to create a matchset with only an RSSI filter (with this * attribute) is if there's only a single matchset with the RSSI attribute. @@ -181,19 +450,22 @@ + * BSS-es in the specified band is to be adjusted before doing + * RSSI-based BSS selection. The attribute value is a packed structure + * value as specified by &struct nl80211_bss_select_rssi_adjust. ++ * @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching ++ * (this cannot be used together with SSID). * @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter * attribute number currently defined * @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use -@@ -3036,6 +3126,8 @@ enum nl80211_sched_scan_match_attr { +@@ -3036,6 +3281,9 @@ enum nl80211_sched_scan_match_attr { NL80211_SCHED_SCAN_MATCH_ATTR_SSID, NL80211_SCHED_SCAN_MATCH_ATTR_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI, + NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST, ++ NL80211_SCHED_SCAN_MATCH_ATTR_BSSID, /* keep last */ __NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST, -@@ -3660,6 +3752,9 @@ enum nl80211_bss_status { +@@ -3660,6 +3908,9 @@ enum nl80211_bss_status { * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals @@ -203,7 +475,7 @@ * @__NL80211_AUTHTYPE_NUM: internal * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by -@@ -3672,6 +3767,9 @@ enum nl80211_auth_type { +@@ -3672,6 +3923,9 @@ enum nl80211_auth_type { NL80211_AUTHTYPE_FT, NL80211_AUTHTYPE_NETWORK_EAP, NL80211_AUTHTYPE_SAE, @@ -213,7 +485,36 @@ /* keep last */ __NL80211_AUTHTYPE_NUM, -@@ -4280,6 +4378,9 @@ enum nl80211_iface_limit_attrs { +@@ -3839,7 +4093,10 @@ enum nl80211_ps_state { + * @__NL80211_ATTR_CQM_INVALID: invalid + * @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies + * the threshold for the RSSI level at which an event will be sent. Zero +- * to disable. ++ * to disable. Alternatively, if %NL80211_EXT_FEATURE_CQM_RSSI_LIST is ++ * set, multiple values can be supplied as a low-to-high sorted array of ++ * threshold values in dBm. Events will be sent when the RSSI value ++ * crosses any of the thresholds. + * @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies + * the minimum amount the RSSI level must change after an event before a + * new event may be issued (to reduce effects of RSSI oscillation). +@@ -3859,6 +4116,8 @@ enum nl80211_ps_state { + * %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting. + * @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon + * loss event ++ * @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the ++ * RSSI threshold event. + * @__NL80211_ATTR_CQM_AFTER_LAST: internal + * @NL80211_ATTR_CQM_MAX: highest key attribute + */ +@@ -3872,6 +4131,7 @@ enum nl80211_attr_cqm { + NL80211_ATTR_CQM_TXE_PKTS, + NL80211_ATTR_CQM_TXE_INTVL, + NL80211_ATTR_CQM_BEACON_LOSS_EVENT, ++ NL80211_ATTR_CQM_RSSI_LEVEL, + + /* keep last */ + __NL80211_ATTR_CQM_AFTER_LAST, +@@ -4280,6 +4540,9 @@ enum nl80211_iface_limit_attrs { * of supported channel widths for radar detection. * @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap * of supported regulatory regions for radar detection. @@ -223,7 +524,7 @@ * @NUM_NL80211_IFACE_COMB: number of attributes * @MAX_NL80211_IFACE_COMB: highest attribute number * -@@ -4287,8 +4388,8 @@ enum nl80211_iface_limit_attrs { +@@ -4287,8 +4550,8 @@ enum nl80211_iface_limit_attrs { * limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2 * => allows an AP and a STA that must match BIs * @@ -234,7 +535,7 @@ * * numbers = [ #{STA} <= 2 ], channels = 2, max = 2 * => allows two STAs on different channels -@@ -4314,6 +4415,7 @@ enum nl80211_if_combination_attrs { +@@ -4314,6 +4577,7 @@ enum nl80211_if_combination_attrs { NL80211_IFACE_COMB_NUM_CHANNELS, NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS, NL80211_IFACE_COMB_RADAR_DETECT_REGIONS, @@ -242,7 +543,7 @@ /* keep last */ NUM_NL80211_IFACE_COMB, -@@ -4634,6 +4736,15 @@ enum nl80211_feature_flags { +@@ -4634,6 +4898,27 @@ enum nl80211_feature_flags { * configuration (AP/mesh) with HT rates. * @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate * configuration (AP/mesh) with VHT rates. @@ -255,10 +556,22 @@ + * @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan + * for reporting BSSs with better RSSI than the current connected BSS + * (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI). ++ * @NL80211_EXT_FEATURE_CQM_RSSI_LIST: With this driver the ++ * %NL80211_ATTR_CQM_RSSI_THOLD attribute accepts a list of zero or more ++ * RSSI threshold values to monitor rather than exactly one threshold. ++ * @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key ++ * authentication with %NL80211_CMD_CONNECT. ++ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way ++ * handshake with PSK in station mode (PSK is passed as part of the connect ++ * and associate commands), doing it in the host might not be supported. ++ * @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way ++ * handshake with 802.1X in station mode (will pass EAP frames to the host ++ * and accept the set_pmk/del_pmk commands), doing it in the host might not ++ * be supported. * * @NUM_NL80211_EXT_FEATURES: number of extended features. * @MAX_NL80211_EXT_FEATURES: highest extended feature index. -@@ -4648,6 +4759,10 @@ enum nl80211_ext_feature_index { +@@ -4648,6 +4933,14 @@ enum nl80211_ext_feature_index { NL80211_EXT_FEATURE_BEACON_RATE_LEGACY, NL80211_EXT_FEATURE_BEACON_RATE_HT, NL80211_EXT_FEATURE_BEACON_RATE_VHT, @@ -266,10 +579,14 @@ + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA, + NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED, + NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI, ++ NL80211_EXT_FEATURE_CQM_RSSI_LIST, ++ NL80211_EXT_FEATURE_FILS_SK_OFFLOAD, ++ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK, ++ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X, /* add new features before the definition below */ NUM_NL80211_EXT_FEATURES, -@@ -4687,6 +4802,21 @@ enum nl80211_connect_failed_reason { +@@ -4687,6 +4980,21 @@ enum nl80211_connect_failed_reason { }; /** @@ -291,7 +608,25 @@ * enum nl80211_scan_flags - scan request control flags * * Scan request control flags are used to control the handling -@@ -4900,8 +5030,9 @@ enum nl80211_sched_scan_plan { +@@ -4768,12 +5076,17 @@ enum nl80211_smps_mode { + * change to the channel status. + * @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is + * over, channel becomes usable. ++ * @NL80211_RADAR_PRE_CAC_EXPIRED: Channel Availability Check done on this ++ * non-operating channel is expired and no longer valid. New CAC must ++ * be done on this channel before starting the operation. This is not ++ * applicable for ETSI dfs domain where pre-CAC is valid for ever. + */ + enum nl80211_radar_event { + NL80211_RADAR_DETECTED, + NL80211_RADAR_CAC_FINISHED, + NL80211_RADAR_CAC_ABORTED, + NL80211_RADAR_NOP_FINISHED, ++ NL80211_RADAR_PRE_CAC_EXPIRED, + }; + + /** +@@ -4900,8 +5213,9 @@ enum nl80211_sched_scan_plan { /** * struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters. * @@ -303,3 +638,25 @@ */ struct nl80211_bss_select_rssi_adjust { __u8 band; +@@ -4942,21 +5256,6 @@ enum nl80211_bss_select_attr { + }; + + /** +- * enum nl80211_nan_dual_band_conf - NAN dual band configuration +- * +- * Defines the NAN dual band mode of operation +- * +- * @NL80211_NAN_BAND_DEFAULT: device default mode +- * @NL80211_NAN_BAND_2GHZ: 2.4GHz mode +- * @NL80211_NAN_BAND_5GHZ: 5GHz mode +- */ +-enum nl80211_nan_dual_band_conf { +- NL80211_NAN_BAND_DEFAULT = 1 << 0, +- NL80211_NAN_BAND_2GHZ = 1 << 1, +- NL80211_NAN_BAND_5GHZ = 1 << 2, +-}; +- +-/** + * enum nl80211_nan_function_type - NAN function type + * + * Defines the function type of a NAN function diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index 00332b035..453978eb9 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -10,10 +10,10 @@ PKG_NAME:=libiwinfo PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/iwinfo.git -PKG_SOURCE_DATE:=2016-09-21 -PKG_SOURCE_VERSION:=fd9e17be0c43bd6b8df5371f0b353747bc563874 -PKG_MIRROR_HASH:=c58490d9b5c2179f6a3edc67aae2f00ae6007daee0d52fa7e5b4c0ea923f1e37 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git +PKG_SOURCE_DATE:=2017-08-23 +PKG_SOURCE_VERSION:=c1a03e8231a5d8b348b70a182d256725c98a3b0b +PKG_MIRROR_HASH:=7bd294f50f8ec8c0497c5fbe5527f3ae098814cdfeecf4ccf78a2a8937611664 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/layerscape/restool/Makefile b/package/network/utils/layerscape/restool/Makefile new file mode 100644 index 000000000..988bc8075 --- /dev/null +++ b/package/network/utils/layerscape/restool/Makefile @@ -0,0 +1,38 @@ +# +# Copyright 2017 NXP +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk +include $(INCLUDE_DIR)/kernel.mk + +PKG_NAME:=restool +PKG_SOURCE_DATE:=2017-10-23 +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/qoriq-open-source/restool.git +PKG_SOURCE_VERSION:=8f08b9d499e84f9057784c2036f0ddf75ae3fc70 +PKG_MIRROR_HASH:=29f70ad27c7ab20bc018f0d0b11c680fcf8b829d10e5af5c30af4a3f9228a2fc + +include $(INCLUDE_DIR)/package.mk + +define Package/restool + SECTION:=net + CATEGORY:=Network + DEPENDS:=@TARGET_layerscape + TITLE:=Layerscape DPAA2 dynamical management tool +endef + +MAKE_FLAGS += \ + DESTDIR="$(PKG_BUILD_DIR)"/output/ \ + install + +define Package/restool/install + $(INSTALL_DIR) $(1)/usr/bin/ + $(CP) $(PKG_BUILD_DIR)/output/usr/local/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,restool)) diff --git a/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch new file mode 100644 index 000000000..691e3bba5 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0001-scripts-move-shebang-on-the-first-line.patch @@ -0,0 +1,35 @@ +From 978f00c0a9f17de9cf17b205a741222084261d3a Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:17 +0000 +Subject: [PATCH 01/12] scripts: move shebang on the first line + +If the shebang is not placed on the first line of the shell script +it will be accounted only as a comment. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 588c736..09bef5a 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,3 +1,5 @@ ++#!/bin/bash ++ + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP + +@@ -30,8 +32,6 @@ + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + # POSSIBILITY OF SUCH DAMAGE. + +-#!/bin/bash +- + ## Restool wrapper script + # + # Prerequisites: +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch new file mode 100644 index 000000000..0e39ef724 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0002-dprc-add-full-path-option-to-dprc-list-command.patch @@ -0,0 +1,151 @@ +From 6039bd1b7e5e71a0a171406cf980d2d61a6e79d4 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:37 +0000 +Subject: [PATCH 02/12] dprc: add --full-path option to dprc list command + +Instead of printing an indented dprc list, activating +the --full-path option restool will print the entire path +of the dprc. +Example: + +root@rodos:~# restool dprc list --full-path +dprc.1 +dprc.1/dprc.3 +dprc.1/dprc.2 +dprc.1/dprc.2/dprc.4 + +Signed-off-by: Ioana Ciornei +--- + dprc_commands.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++----------- + 1 file changed, 50 insertions(+), 11 deletions(-) + +diff --git a/dprc_commands.c b/dprc_commands.c +index e1a8f16..8de2f0e 100644 +--- a/dprc_commands.c ++++ b/dprc_commands.c +@@ -76,13 +76,16 @@ C_ASSERT(ARRAY_SIZE(dprc_sync_options) <= MAX_NUM_CMD_LINE_OPTIONS + 1); + */ + enum dprc_list_options { + LIST_OPT_HELP = 0, ++ LIST_OPT_FULL_PATH, + }; + + static struct option dprc_list_options[] = { + [LIST_OPT_HELP] = { + .name = "help", + }, +- ++ [LIST_OPT_FULL_PATH] = { ++ .name = "full-path", ++ }, + { 0 }, + }; + +@@ -421,17 +424,33 @@ static int cmd_dprc_sync(void) + * Lists nested DPRCs inside a given DPRC, recursively + */ + static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, +- int nesting_level, bool show_non_dprc_objects) ++ int nesting_level, bool show_non_dprc_objects, ++ char *full_path) + { ++ char *updated_full_path = NULL; + int num_child_devices; + int error = 0; ++ int full_path_len; + + assert(nesting_level <= MAX_DPRC_NESTING); + +- for (int i = 0; i < nesting_level; i++) +- printf(" "); +- +- printf("dprc.%u\n", dprc_id); ++ if (full_path) { ++ full_path_len = strlen(full_path); ++ updated_full_path = malloc(full_path_len + 10); ++ if (!updated_full_path) { ++ ERROR_PRINTF("Could not alloc memory for full-path!\n"); ++ return -ENOMEM; ++ } ++ if (full_path_len != 0) ++ sprintf(updated_full_path, "%s/dprc.%d", full_path, dprc_id); ++ else ++ sprintf(updated_full_path, "dprc.%d", dprc_id); ++ printf("%s\n", updated_full_path); ++ } else { ++ for (int i = 0; i < nesting_level; i++) ++ printf(" "); ++ printf("dprc.%u\n", dprc_id); ++ } + + error = dprc_get_obj_count(&restool.mc_io, 0, + dprc_handle, +@@ -475,8 +494,11 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + if (error < 0) + goto out; + +- error = list_dprc(obj_desc.id, child_dprc_handle, +- nesting_level + 1, show_non_dprc_objects); ++ error = list_dprc(obj_desc.id, ++ child_dprc_handle, ++ nesting_level + 1, ++ show_non_dprc_objects, ++ updated_full_path); + + error2 = dprc_close(&restool.mc_io, 0, child_dprc_handle); + if (error2 < 0) { +@@ -491,6 +513,9 @@ static int list_dprc(uint32_t dprc_id, uint16_t dprc_handle, + } + + out: ++ if (full_path) ++ free(updated_full_path); ++ + return error; + } + +@@ -498,8 +523,14 @@ static int cmd_dprc_list(void) + { + static const char usage_msg[] = + "\n" +- "Usage: restool dprc list\n" ++ "Usage: restool dprc list [OPTIONS]\n" ++ "\n" ++ "OPTIONS:\n" ++ "--full-path\n" ++ " prints the dprc list in a full-path\n" ++ " format like: dprc.1/dprc.2\n" + "\n"; ++ bool full_path = false; + + if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_HELP)) { + puts(usage_msg); +@@ -507,6 +538,12 @@ static int cmd_dprc_list(void) + return 0; + } + ++ ++ if (restool.cmd_option_mask & ONE_BIT_MASK(LIST_OPT_FULL_PATH)) { ++ restool.cmd_option_mask &= ~ONE_BIT_MASK(LIST_OPT_FULL_PATH); ++ full_path = true; ++ } ++ + if (restool.obj_name != NULL) { + ERROR_PRINTF( + "Unexpected argument: \'%s\'\n\n", restool.obj_name); +@@ -514,8 +551,10 @@ static int cmd_dprc_list(void) + return -EINVAL; + } + +- return list_dprc( +- restool.root_dprc_id, restool.root_dprc_handle, 0, false); ++ return list_dprc(restool.root_dprc_id, ++ restool.root_dprc_handle, ++ 0, false, ++ full_path ? "" : NULL); + } + + static int show_one_resource_type(uint16_t dprc_handle, +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch new file mode 100644 index 000000000..c846fbab5 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0003-scripts-remove-unnecessary-arrays.patch @@ -0,0 +1,62 @@ +From e316b4c7d421afa6ca5f6b6ae86d0a8219a9bd56 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:42 +0000 +Subject: [PATCH 03/12] scripts: remove unnecessary arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 22 ++-------------------- + 1 file changed, 2 insertions(+), 20 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 09bef5a..ea0df92 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -87,8 +87,6 @@ root_c= + # Type of endpoint object + toe= + +-dpnis=() +-dpmacs=() + containers=() + # Full path containers + fpc=() +@@ -944,16 +942,8 @@ process_listni() { + fi + fi + +- dpnis+=("$dpni $details") ++ echo "${i}/${dpni} ${details}" + done +- +- if [ -n "$dpnis" ]; then +- for j in "${dpnis[@]}"; do +- echo "$i/$j" +- done +- +- dpnis=() +- fi + done + } + +@@ -984,16 +974,8 @@ process_listmac() { + fi + fi + +- dpmacs+=("$dpmac $details") ++ echo "${i}/${dpmac} ${details}" + done +- +- if [ -n "$dpmacs" ]; then +- for j in "${dpmacs[@]}"; do +- echo "$i/$j" +- done +- +- dpmacs=() +- fi + done + } + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch new file mode 100644 index 000000000..e1cc38f48 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0004-scripts-use-restool-full-path-option.patch @@ -0,0 +1,111 @@ +From 09f840049d155fa4b681ece749feeff9a269ecde Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:45 +0000 +Subject: [PATCH 04/12] scripts: use restool --full-path option + +Instead of constructing the the full path container list by +hand use the restool option newly added. + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 54 +++++++----------------------------------------------- + 1 file changed, 7 insertions(+), 47 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index ea0df92..72f6c77 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -73,7 +73,6 @@ + ## + + shopt -s extglob +-shopt -s lastpipe + + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT +@@ -87,11 +86,6 @@ root_c= + # Type of endpoint object + toe= + +-containers=() +-# Full path containers +-fpc=() +-idx=0 +- + SYS_DPRC="/sys/bus/fsl-mc/drivers/fsl_mc_dprc" + + set -e +@@ -220,42 +214,6 @@ get_container() { + echo $(echo "$i" | sed "s/\(dprc.[0-9]*\/\)*//g") + } + +-build_fpc_list() { +- $restool dprc list | +- while IFS= read -r line +- do +- containers+=("$line") +- done +- +- for i in "${containers[@]}" +- do +- cnt=$(count_spaces "$i") +- +- if [ "$cnt" -gt 0 ]; then +- # Get index of the upper level container +- idx2=$((idx-1)) +- crt_ct="$i" +- +- while [ "$idx2" -ge 0 ] +- do +- cntp=$(count_spaces "${containers[idx2]}") +- +- if [ "$cntp" -lt "$cnt" ]; then +- upc=$(echo "${containers[idx2]}" | sed "s/ *$//") +- crt_ct=$upc"/""$(echo $crt_ct | sed 's/ *$//')" +- fi +- idx2=$((idx2-1)) +- done +- +- fpc+=($crt_ct) +- else +- fpc+=("$i") +- fi +- +- idx=$((idx+1)) +- done +-} +- + get_label() { + # Retrieve the type of the object + too=$(echo "$1" | sed "s/\(\.[0-9]*\)\(\.[0-9]*\)*$//g") +@@ -897,9 +855,9 @@ process_addni() { + } + + process_listni() { +- build_fpc_list +- +- for i in "${fpc[@]}" ++ dprc_list="$($restool dprc list --full-path)" ++ echo "${dprc_list}" | ++ while read -r i + do + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpni | +@@ -948,10 +906,12 @@ process_listni() { + } + + process_listmac() { +- build_fpc_list ++ dprc_list="$($restool dprc list --full-path)" + +- for i in "${fpc[@]}" ++ echo "${dprc_list}" | ++ while read -r i + do ++ + crt_c=$(get_container "$i") + $restool dprc show "$crt_c" | grep dpmac | + while IFS= read -r line +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch new file mode 100644 index 000000000..b34c6a31a --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0005-scripts-use-proper-arithmetic-operation-syntax.patch @@ -0,0 +1,26 @@ +From 899d6c74286cbc672e1bad1abd7eff15b1b7298d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:49 +0000 +Subject: [PATCH 05/12] scripts: use proper arithmetic operation syntax + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 72f6c77..a39df2c 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -966,7 +966,7 @@ fi + + # Check compatibility with MC version + mc_major=$($restool --mc-version | cut -f2 -d':' | cut -f1 -d'.' | tr -d ' ') +-if (( $mc_major != 10 )); then ++if [ $mc_major != 10 ]; then + echo "Restool wrapper scripts only support the latest major MC version\n" + echo "that currently is MC10.x. Use with caution." + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch new file mode 100644 index 000000000..a1217668f --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0006-scripts-use-strings-instead-of-arrays.patch @@ -0,0 +1,79 @@ +From 2127850302de2bd8dccff0e31415ce0218750773 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:53 +0000 +Subject: [PATCH 06/12] scripts: use strings instead of arrays + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a39df2c..b0c742e 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -485,7 +485,9 @@ create_dpsw() { + + # Make a link in case there is an end point specified + index=0 +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + connect $root_c "$dpsw.$index" "$i" + index=$((index + 1)) + done +@@ -519,8 +521,8 @@ process_addsw() { + max_fdb_mc_groups=32 + # dpsw object label + label= +- #Endpoint objects provided as argument +- endpoint=() ++ # Endpoint objects provided as argument ++ endpoint= + ifcnt=0 + container=$root_c + +@@ -559,7 +561,7 @@ process_addsw() { + container="${i#*=}" + ;; + @(dpni|dpmac).+([0-9])) +- endpoint[$ifcnt]="$(echo ${i#*=} | tr -d ,)" ++ endpoint="${endpoint}"$'\n'"${i}" + ifcnt=$((ifcnt + 1)) + ;; + *) +@@ -571,14 +573,19 @@ process_addsw() { + done + + # Check if there are more endpoints provided than the number of the interfaces +- if [ $num_ifs -lt ${#endpoint[@]} ]; then ++ if [ $num_ifs -lt $ifcnt ]; then + echo "Error: there are more endpoints provided than the number of the interfaces" + usage_addsw + exit 1 + fi + ++ # Delete first empty line from the endpoint string ++ endpoint="$(echo "${endpoint}" | tail -n +2)" ++ + # Check if the endpoints are valid +- for i in "${endpoint[@]}"; do ++ echo "${endpoint}" | ++ while read -r i ++ do + type_of_endpoint "$i" + check_endpoint "$i" + has_endpoint "$i" +@@ -592,7 +599,7 @@ process_addsw() { + if (( $object_exists_status == 1 )); then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + +- if [ $num_ifs -gt ${#endpoint[@]} ]; then ++ if [ $num_ifs -gt $ifcnt ]; then + echo "Do not forget to connect devices to interface(s)." + fi + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch new file mode 100644 index 000000000..ed9d76d45 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0007-scripts-use-Bourne-shell-s-pattern-matching.patch @@ -0,0 +1,126 @@ +From e1036011baf9204d5fe6dd74e5a65f95b9681ebd Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:29:56 +0000 +Subject: [PATCH 07/12] scripts: use Bourne shell's pattern matching + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 71 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 35 insertions(+), 36 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index b0c742e..a8b9573 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -72,8 +72,6 @@ + # + ## + +-shopt -s extglob +- + # Intercept the Ctrl+C command but do not interrupt execution + trap ' ' INT + +@@ -370,15 +368,16 @@ process_addmux() { + -c=* | --container=*) + container="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- endpoint="${i#*=}" +- ;; + *) +- usage_addmux +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ usage_addmux ++ exit 1 ++ fi + ;; + esac + done +@@ -560,14 +559,17 @@ process_addsw() { + -c=* | --container=*) + container="${i#*=}" + ;; +- @(dpni|dpmac).+([0-9])) +- endpoint="${endpoint}"$'\n'"${i}" +- ifcnt=$((ifcnt + 1)) +- ;; + *) +- echo "Error: $i argument is invalid" +- usage_addsw +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "dpni.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ]; then ++ endpoint="$i" ++ else ++ echo "Error: $i argument is invalid" ++ usage_addsw ++ exit 1 ++ fi + ;; + esac + done +@@ -704,7 +706,8 @@ process_addni() { + ;; + --mac-addr=*) + mac_addr="${i#*=}" +- if [[ ! "$mac_addr" =~ ^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$ ]]; then ++ mac_addr_valid="$(echo $mac_addr | grep -x -E "^([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2}$" || true )" ++ if [ "$mac_addr" != "$mac_addr_valid" ]; then + echo "Invalid MAC address: $mac_addr" + exit 1 + fi +@@ -776,25 +779,21 @@ process_addni() { + -o=* | --options=*) + options="${i#*=}" + ;; +- *(dprc.+([0-9])/)dpmac.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpni.+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpdmux.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; +- *(dprc.+([0-9])/)dpsw.+([0-9]).+([0-9])) +- no_link=0 +- endpoint="${i#*=}" +- ;; + *) +- usage_addni +- exit 1 ++ arg_dpmac="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpmac.[0-9]+" || true )" ++ arg_dpni="$(echo $i | grep -x -E "(dprc.+[0-9]+/)*dpni.[0-9]+" || true )" ++ arg_dpdmux="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpdmux.[0-9]+.[0-9]+" || true )" ++ arg_dpsw="$(echo $i | grep -x -E "(dprc.[0-9]+/)*dpsw.[0-9]+.[0-9]+" || true )" ++ if [ "$i" = "$arg_dpmac" ] || ++ [ "$i" = "$arg_dpni" ] || ++ [ "$i" = "$arg_dpdmux" ] || ++ [ "$i" = "$arg_dpsw" ]; then ++ no_link=0 ++ endpoint="$i" ++ else ++ usage_addni ++ exit 1 ++ fi + ;; + esac + done +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch new file mode 100644 index 000000000..4921f63c9 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0008-scripts-use-Bourne-shell-instead-of-bash.patch @@ -0,0 +1,32 @@ +From 4a1df345edc59a7407b955529955d6799d974b70 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Tue, 24 Oct 2017 16:30:00 +0000 +Subject: [PATCH 08/12] scripts: use Bourne shell instead of bash + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index a8b9573..bd79295 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + + # Copyright 2013-2016 Freescale Semiconductor Inc. + # Copyright 2017 NXP +@@ -37,7 +37,7 @@ + # Prerequisites: + # - Management Complex version 10.x + # - restool version 1.4 or newer +-# - bash shell ++# - Bourne Shell (sh) + # + # + # The purpose of this script is to offer a user friendly way to create +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch new file mode 100644 index 000000000..c642afcaf --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0009-scripts-workaround-for-a-improper-sed-substitution-T.patch @@ -0,0 +1,36 @@ +From ac387de9688099bca1fbdb587d078b369aaf2dab Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:23:42 +0000 +Subject: [PATCH 09/12] scripts: workaround for a improper sed substitution + (TODO) + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index bd79295..7ce73f0 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -197,7 +197,7 @@ has_endpoint() { + ep=$($restool "$toe" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$ep" != *"No object associated"* && "$ep" != *"none"* ]]; then ++ if [[ "$ep" != "endpoint: No object associated" && "$ep" != *"none"* ]]; then + echo "$1 is already linked to $ep" + exit 1 + fi +@@ -230,7 +230,7 @@ get_endpoint() { + end_point=$($restool "$too" info "$1" | grep "endpoint:" | sed "s/endpoint: \([^ ]*\)\,.*/\1/") + fi + +- if [[ "$end_point" != *"No object associated"* && "$end_point" != *"none"* ]]; then ++ if [[ "$end_point" != "endpoint: No object associated" && "$end_point" != *"none"* ]]; then + echo "$end_point" + fi + } +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch new file mode 100644 index 000000000..9945cd438 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0010-scripts-use-proper-arithmetic-operations.patch @@ -0,0 +1,44 @@ +From 66ae6e5313da8be5742a502c0d7027689e84a17d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:08 +0000 +Subject: [PATCH 10/12] scripts: use proper arithmetic operations + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 7ce73f0..0dcd2fa 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -409,7 +409,7 @@ process_addmux() { + + # check the status + object_exists $container $dpdmux +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + + if [ "$root_c" == "$container" ]; then + evb=$(ls $SYS_DPRC/"$root_c"/"$dpdmux"/net/ | grep -v "p") +@@ -598,7 +598,7 @@ process_addsw() { + + # check the status + object_exists $container $dpsw +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + echo "Created ETHSW object $dpsw with ${num_ifs} ports" + + if [ $num_ifs -gt $ifcnt ]; then +@@ -850,7 +850,7 @@ process_addni() { + + # check the status + object_exists $container $dpni +- if (( $object_exists_status == 1 )); then ++ if [ $object_exists_status == 1 ]; then + if [ "$root_c" == "$container" ]; then + ni=$(ls $SYS_DPRC/"$root_c"/"$dpni"/net/) + fi +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch new file mode 100644 index 000000000..1b6cc46a3 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0011-scripts-do-not-compare-strings-with-regexp-expressio.patch @@ -0,0 +1,27 @@ +From 6af86a65f2dcfd42f572e04207eef45da3573b92 Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 11:30:33 +0000 +Subject: [PATCH 11/12] scripts: do not compare strings with regexp expressions + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 0dcd2fa..526c052 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -805,7 +805,8 @@ process_addni() { + fi + + # if no --num-queues is specified then set it to number of cores +- if [[ $dpni_args != *"--num-queues"* ]]; then ++ num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) ++ if [[ -z "$num_queues_present" ]]; then + dpni_args=$dpni_args" --num-queues="$(nproc) + fi + +-- +2.14.1 + diff --git a/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch new file mode 100644 index 000000000..3acb3b5d8 --- /dev/null +++ b/package/network/utils/layerscape/restool/patches/0012-scripts-replace-nproc-with-cross-platform-implementa.patch @@ -0,0 +1,27 @@ +From 0e5f9f0a7f0ef1947984cd82ade9dbc14ba2c80d Mon Sep 17 00:00:00 2001 +From: Ioana Ciornei +Date: Wed, 25 Oct 2017 12:48:04 +0000 +Subject: [PATCH 12/12] scripts: replace 'nproc' with cross-platform + implementation + +Signed-off-by: Ioana Ciornei +--- + scripts/ls-main | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/scripts/ls-main b/scripts/ls-main +index 526c052..7d127f6 100755 +--- a/scripts/ls-main ++++ b/scripts/ls-main +@@ -807,7 +807,7 @@ process_addni() { + # if no --num-queues is specified then set it to number of cores + num_queues_present=$(echo "$dpni_args" | grep -o "\-\-num-queues" || true) + if [[ -z "$num_queues_present" ]]; then +- dpni_args=$dpni_args" --num-queues="$(nproc) ++ dpni_args=$dpni_args" --num-queues="$(grep -c ^processor /proc/cpuinfo) + fi + + # Check if --no-link the endpoint have been provided otherwise display the usage +-- +2.14.1 + diff --git a/package/network/utils/linux-atm/Makefile b/package/network/utils/linux-atm/Makefile index 3d3662264..532a02821 100644 --- a/package/network/utils/linux-atm/Makefile +++ b/package/network/utils/linux-atm/Makefile @@ -19,6 +19,7 @@ PKG_HASH:=9645481a2b16476b59220aa2d6bc5bc41043f291326c9b37581018fbd16dd53a PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPL-2.0+ +PKG_CPE_ID:=cpe:/a:linux-atm:linux-atm PKG_FIXUP:=autoreconf include $(INCLUDE_DIR)/package.mk diff --git a/package/network/utils/linux-atm/files/br2684ctl b/package/network/utils/linux-atm/files/br2684ctl index 0fa86bdef..6513dd38a 100755 --- a/package/network/utils/linux-atm/files/br2684ctl +++ b/package/network/utils/linux-atm/files/br2684ctl @@ -13,6 +13,9 @@ start_daemon() { config_get atmdev "$cfg" atmdev 0 + local nameprefix + config_get nameprefix "$cfg" nameprefix "nas" + local unit config_get unit "$cfg" unit 0 @@ -58,8 +61,8 @@ start_daemon() { procd_open_instance procd_set_param command \ - /usr/sbin/br2684ctl_wrap "nas$unit" \ - -c "$unit" -e "$encaps" -p "$payload" \ + /usr/sbin/br2684ctl_wrap "${nameprefix}${unit}" \ + -n "$nameprefix" -c "$unit" -e "$encaps" -p "$payload" \ -a "$circuit" ${qos:+-q "$qos"} ${sendsize:+-s "$sendsize"} \ -S /lib/netifd/br2684-up procd_close_instance diff --git a/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch b/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch new file mode 100644 index 000000000..839b395fe --- /dev/null +++ b/package/network/utils/linux-atm/patches/501-br2684ctl_itfname.patch @@ -0,0 +1,74 @@ +--- a/src/br2684/br2684ctl.c ++++ b/src/br2684/br2684ctl.c +@@ -45,6 +45,7 @@ struct br2684_params { + + int lastsock, lastitf; + static char *up_script; ++const char *itfname = "nas"; + + + void fatal(const char *str, int err) +@@ -73,7 +74,7 @@ int create_pidfile(int num) + + if (num < 0) return -1; + +- snprintf(name, 32, "/var/run/br2684ctl-nas%d.pid", num); ++ snprintf(name, 32, "/var/run/br2684ctl-%s%d.pid", itfname, num); + pidfile = fopen(name, "w"); + if (pidfile == NULL) return -1; + fprintf(pidfile, "%d", getpid()); +@@ -102,7 +103,7 @@ int create_br(int itfnum, int payload) + ni.media |= BR2684_FLAG_ROUTED; + #endif + ni.mtu = 1500; +- sprintf(ni.ifname, "nas%d", itfnum); ++ sprintf(ni.ifname, "%s%d", itfname, itfnum); + err=ioctl (lastsock, ATM_NEWBACKENDIF, &ni); + + if (err == 0) +@@ -167,7 +168,7 @@ int assign_vcc(char *astr, int encap, in + + be.backend_num = ATM_BACKEND_BR2684; + be.ifspec.method = BR2684_FIND_BYIFNAME; +- sprintf(be.ifspec.spec.ifname, "nas%d", lastitf); ++ sprintf(be.ifspec.spec.ifname, "%s%d", itfname, lastitf); + be.fcs_in = BR2684_FCSIN_NO; + be.fcs_out = BR2684_FCSOUT_NO; + be.fcs_auto = 0; +@@ -198,7 +199,7 @@ void start_interface(struct br2684_param + assign_vcc(params->astr, params->encap, params->payload, params->sndbuf, + params->reqqos); + if (up_script) { +- asprintf(&cmd, "%s nas%d", up_script, lastitf); ++ asprintf(&cmd, "%s %s%d", up_script, itfname, lastitf); + system(cmd); + free(cmd); + } +@@ -207,7 +208,7 @@ void start_interface(struct br2684_param + + void usage(char *s) + { +- printf("usage: %s [-b] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] " ++ printf("usage: %s [-b] [-n name] [[-c number] [-e 0|1] [-s sndbuf] [-q qos] [-p 0|1] " + "[-a [itf.]vpi.vci]*]* [-S script]\n", s); + printf(" encapsulations: 0=llc, 1=vcmux\n payloads: 0=routed, 1=bridged\n"); + exit(1); +@@ -234,7 +235,7 @@ int main (int argc, char **argv) + + openlog (LOG_NAME,LOG_OPTION,LOG_FACILITY); + if (argc>1) +- while ((c = getopt(argc, argv,"q:a:bc:e:s:S:p:?h")) !=EOF) ++ while ((c = getopt(argc, argv,"q:a:bn:c:e:s:S:p:?h")) !=EOF) + switch (c) { + case 'q': + printf ("optarg : %s",optarg); +@@ -247,6 +248,9 @@ int main (int argc, char **argv) + case 'b': + background=1; + break; ++ case 'n': ++ itfname = optarg; ++ break; + case 'c': + /* temporary, to make it work with multiple interfaces: */ + if (params.itfnum>=0) start_interface(¶ms); diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 4fdd58265..5aaa1cbf4 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,13 +7,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables -PKG_VERSION:=0.4+2015-04-09 +PKG_VERSION:=0.7 PKG_RELEASE:=1 -PKG_SOURCE_URL:=git://git.netfilter.org/nftables +PKG_SOURCE_URL:=https://git.netfilter.org/nftables PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=3ed296118a065caff5600e60d4f7ef18e137f9a0 -PKG_MIRROR_HASH:=7f6f6162592c848b8047e75374f01a93d2d269dabe013a0150767027049b1e41 +PKG_SOURCE_VERSION:=79cbd19e7437680561b26109bbf4f48cb2e8e0a7 +PKG_MIRROR_HASH:=2c0af691948519556952097673ad1b57f888c8314b8eb15e83066951de01fc82 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch b/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch new file mode 100644 index 000000000..99f968435 --- /dev/null +++ b/package/network/utils/nftables/patches/101-nftables-statement-fix-print-of-ip-dnat-address.patch @@ -0,0 +1,76 @@ +From patchwork Fri Feb 3 14:25:45 2017 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +Subject: [nftables] statement: fix print of ip dnat address +From: Florian Westphal +X-Patchwork-Id: 723692 +X-Patchwork-Delegate: pablo@netfilter.org +Message-Id: <20170203142545.13724-1-fw@strlen.de> +To: +Cc: Florian Westphal +Date: Fri, 3 Feb 2017 15:25:45 +0100 + +the change causes non-ipv6 addresses to not be printed at all in case +a nfproto was given. + +Also add a test case to catch this. + +Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1117 +Fixes: 5ab0e10fc6e2c22363a ("src: support for RFC2732 IPv6 address format with brackets") +Signed-off-by: Florian Westphal +Acked-by: Pablo Neira Ayuso +--- + src/statement.c | 2 ++ + tests/py/ip/dnat.t | 1 + + tests/py/ip/dnat.t.payload.ip | 12 ++++++++++++ + 3 files changed, 15 insertions(+) + +diff --git a/src/statement.c b/src/statement.c +index 9cdabbb979e8..3beb86ab4263 100644 +--- a/src/statement.c ++++ b/src/statement.c +@@ -508,6 +508,8 @@ static void nat_stmt_print(const struct stmt *stmt) + printf("]-["); + expr_print(stmt->nat.addr->right); + printf("]"); ++ } else { ++ expr_print(stmt->nat.addr); + } + } else { + expr_print(stmt->nat.addr); +diff --git a/tests/py/ip/dnat.t b/tests/py/ip/dnat.t +index da00106edbb4..089017c84704 100644 +--- a/tests/py/ip/dnat.t ++++ b/tests/py/ip/dnat.t +@@ -7,6 +7,7 @@ iifname "eth0" tcp dport != 80-90 dnat to 192.168.3.2;ok + iifname "eth0" tcp dport {80, 90, 23} dnat to 192.168.3.2;ok + iifname "eth0" tcp dport != {80, 90, 23} dnat to 192.168.3.2;ok + iifname "eth0" tcp dport != 23-34 dnat to 192.168.3.2;ok ++iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080;ok + + dnat to ct mark map { 0x00000014 : 1.2.3.4};ok + dnat to ct mark . ip daddr map { 0x00000014 . 1.1.1.1 : 1.2.3.4};ok +diff --git a/tests/py/ip/dnat.t.payload.ip b/tests/py/ip/dnat.t.payload.ip +index 66926990d880..7a7f5a82dd5a 100644 +--- a/tests/py/ip/dnat.t.payload.ip ++++ b/tests/py/ip/dnat.t.payload.ip +@@ -60,6 +60,18 @@ ip test-ip4 prerouting + [ immediate reg 1 0x0203a8c0 ] + [ nat dnat ip addr_min reg 1 addr_max reg 0 ] + ++# iifname "eth0" tcp dport 81 dnat to 192.168.3.2:8080 ++ip test-ip4 prerouting ++ [ meta load iifname => reg 1 ] ++ [ cmp eq reg 1 0x30687465 0x00000000 0x00000000 0x00000000 ] ++ [ payload load 1b @ network header + 9 => reg 1 ] ++ [ cmp eq reg 1 0x00000006 ] ++ [ payload load 2b @ transport header + 2 => reg 1 ] ++ [ cmp eq reg 1 0x00005100 ] ++ [ immediate reg 1 0x0203a8c0 ] ++ [ immediate reg 2 0x0000901f ] ++ [ nat dnat ip addr_min reg 1 addr_max reg 0 proto_min reg 2 proto_max reg 0 ] ++ + # dnat to ct mark map { 0x00000014 : 1.2.3.4} + __map%d test-ip4 b + __map%d test-ip4 0 diff --git a/package/network/utils/tcpdump/Makefile b/package/network/utils/tcpdump/Makefile index bb04369b5..50919819b 100644 --- a/package/network/utils/tcpdump/Makefile +++ b/package/network/utils/tcpdump/Makefile @@ -21,6 +21,7 @@ PKG_BUILD_PARALLEL:=1 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause +PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump PKG_INSTALL:=1 diff --git a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch index 593d42894..48cc470bf 100644 --- a/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch +++ b/package/network/utils/tcpdump/patches/100-tcpdump_mini.patch @@ -1,15 +1,13 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -70,6 +70,82 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ - @rm -f $@ - $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c +@@ -72,6 +72,80 @@ DEPENDENCY_CFLAG = @DEPENDENCY_CFLAG@ + + CSRC = setsignal.c tcpdump.c +ifdef TCPDUMP_MINI + -+CSRC=\ -+ tcpdump.c \ ++LIBNETDISSECT_SRC=\ + netdissect.c \ -+ setsignal.c \ + addrtoname.c \ + addrtostr.c \ + af.c \ @@ -80,10 +78,10 @@ + +else + - CSRC = setsignal.c tcpdump.c - LIBNETDISSECT_SRC=\ -@@ -237,12 +313,16 @@ LIBNETDISSECT_SRC=\ + addrtoname.c \ + addrtostr.c \ +@@ -237,6 +311,8 @@ LIBNETDISSECT_SRC=\ strtoaddr.c \ util-print.c @@ -92,27 +90,6 @@ LOCALSRC = @LOCALSRC@ GENSRC = version.c LIBOBJS = @LIBOBJS@ - -+ifndef TCPDUMP_MINI - LIBNETDISSECT_OBJ=$(LIBNETDISSECT_SRC:.c=.o) ${LOCALSRC:.c=.o} ${LIBOBJS} - LIBNETDISSECT=libnetdissect.a -+endif - - - SRC = $(CSRC) $(GENSRC) $(LOCALSRC) $(LIBNETDISSECT_SRC) -@@ -373,10 +453,12 @@ $(PROG): $(OBJ) @V_PCAPDEP@ - @rm -f $@ - $(CC) $(FULL_CFLAGS) $(LDFLAGS) -o $@ $(OBJ) $(LIBS) - -+ifndef TCPDUMP_MINI - $(LIBNETDISSECT): $(LIBNETDISSECT_OBJ) - @rm -f $@ - $(AR) cr $@ $(LIBNETDISSECT_OBJ) - $(RANLIB) $@ -+endif - - datalinks.o: $(srcdir)/missing/datalinks.c - $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/datalinks.c --- a/addrtoname.c +++ b/addrtoname.c @@ -578,8 +578,10 @@ linkaddr_string(netdissect_options *ndo, diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile index 616a02367..4faa5acf9 100644 --- a/package/network/utils/umbim/Makefile +++ b/package/network/utils/umbim/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=umbim PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/umbim.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git PKG_SOURCE_DATE:=2015-07-04 PKG_SOURCE_VERSION:=29aaf43b097ee57f7aa1bb24341db6cc4148cbf3 PKG_MIRROR_HASH:=56e612d9da1ac26de96c4929fbabd047862d725a13ceb904807a9d3d7db43a30 diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile index 2102490f6..9c8dadabe 100644 --- a/package/network/utils/uqmi/Makefile +++ b/package/network/utils/uqmi/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=uqmi PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/uqmi.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uqmi.git PKG_SOURCE_DATE:=2016-12-19 PKG_SOURCE_VERSION:=8ceeab690d8c6f1e3afbd4bcaee7bc2ba3fbe165 PKG_MIRROR_HASH:=b3637ff04e51769137af1c5e173e73311e11c3c2dcc49eeaca6aa3520f61d247 diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 6f11933a9..9c953ea69 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -65,6 +65,7 @@ proto_qmi_setup() { [ -n "$delay" ] && sleep "$delay" while uqmi -s -d "$device" --get-pin-status | grep '"UIM uninitialized"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 1; done @@ -102,6 +103,7 @@ proto_qmi_setup() { echo "Waiting for network registration" while uqmi -s -d "$device" --get-serving-system | grep '"searching"' > /dev/null; do + [ -e "$device" ] || return 1 sleep 5; done diff --git a/package/network/utils/wpan-tools/Makefile b/package/network/utils/wpan-tools/Makefile index ff6537572..e57223dee 100644 --- a/package/network/utils/wpan-tools/Makefile +++ b/package/network/utils/wpan-tools/Makefile @@ -31,6 +31,7 @@ endef define Package/wpan-tools/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/iwpan $(1)/usr/sbin/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpan-ping/wpan-ping $(1)/usr/sbin/ endef $(eval $(call BuildPackage,wpan-tools)) diff --git a/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch new file mode 100644 index 000000000..1370854b6 --- /dev/null +++ b/package/network/utils/wpan-tools/patches/001-src-nl_extras.h-fix-compatibility-with-libnl-3.3.0.patch @@ -0,0 +1,44 @@ +From bb522bd584f05e6658d5dba97f48ca018f46394c Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sat, 6 May 2017 14:36:08 +0200 +Subject: [PATCH] src/nl_extras.h: fix compatibility with libnl 3.3.0 + +nl_extras.h defines a set of nla_set_s*() functions if not provided by +libnl. They are provided by libnl since version 3.2.26. The test +(LIBNL_VER_MIC <= 26) was working fine while libnl was in the 3.2.x +series, but now that they have incremented the minor version, the +micro version was reset to 0, with the latest libnl version being +3.3.0. + +Due to this, the condition (LIBNL_VER_MIC <= 26) is true, and we get +redefinition errors because nl_extras.h redefines functions already +provided by libnl. + +This commit improves the condition so that nl_extras.h provides the +missing functions only if the minor version is < 2, or if minor is 2 +and micro is < 26. + +Signed-off-by: Thomas Petazzoni +--- + src/nl_extras.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/src/nl_extras.h ++++ b/src/nl_extras.h +@@ -1,7 +1,7 @@ + #ifndef __NL_EXTRAS_H + #define __NL_EXTRAS_H + +-#if LIBNL_VER_MIC <= 26 ++#if (LIBNL_VER_MIN < 2) || (LIBNL_VER_MIN == 2) && (LIBNL_VER_MIC <= 26) + + #ifndef NLA_S8 + +@@ -45,6 +45,6 @@ static inline int32_t nla_get_s32(struct + + #endif /* NLA_S64 */ + +-#endif /* LIBNL_VER_MIC */ ++#endif /* LIBNL_VER_* */ + + #endif /* __NL_EXTRAS_H */ diff --git a/package/network/utils/wwan/files/wwan.sh b/package/network/utils/wwan/files/wwan.sh index 6b33600b3..2e9d73f1e 100755 --- a/package/network/utils/wwan/files/wwan.sh +++ b/package/network/utils/wwan/files/wwan.sh @@ -66,15 +66,15 @@ proto_wwan_setup() { } } - [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep wwan); do + [ -z "$ctl_device" ] && for net in $(ls /sys/class/net/ | grep -e wwan -e usb); do [ -z "$ctl_device" ] || continue driver=$(grep DRIVER /sys/class/net/$net/device/uevent | cut -d= -f2) case "$driver" in qmi_wwan|cdc_mbim) ctl_device=/dev/$(ls /sys/class/net/$net/device/usbmisc) ;; - sierra_net|*cdc_ncm) - ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs basename | head -n1) + sierra_net|cdc_ether|*cdc_ncm) + ctl_device=/dev/$(cd /sys/class/net/$net/; find ../../../ -name ttyUSB* |xargs -n1 basename | head -n1) ;; *) continue;; esac @@ -93,11 +93,11 @@ proto_wwan_setup() { uci_set_state network $interface dat_device "$dat_device" case $driver in - qmi_wwan) proto_qmi_setup $@ ;; - cdc_mbim) proto_mbim_setup $@ ;; - sierra_net) proto_directip_setup $@ ;; - comgt) proto_3g_setup $@ ;; - *cdc_ncm) proto_ncm_setup $@ ;; + qmi_wwan) proto_qmi_setup $@ ;; + cdc_mbim) proto_mbim_setup $@ ;; + sierra_net) proto_directip_setup $@ ;; + comgt) proto_3g_setup $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_setup $@ ;; esac } @@ -108,11 +108,11 @@ proto_wwan_teardown() { dat_device=$(uci_get_state network $interface dat_device) case $driver in - qmi_wwan) proto_qmi_teardown $@ ;; - cdc_mbim) proto_mbim_teardown $@ ;; - sierra_net) proto_mbim_teardown $@ ;; - comgt) proto_3g_teardown $@ ;; - *cdc_ncm) proto_ncm_teardown $@ ;; + qmi_wwan) proto_qmi_teardown $@ ;; + cdc_mbim) proto_mbim_teardown $@ ;; + sierra_net) proto_mbim_teardown $@ ;; + comgt) proto_3g_teardown $@ ;; + cdc_ether|*cdc_ncm) proto_ncm_teardown $@ ;; esac } diff --git a/package/network/utils/xtables-addons/Makefile b/package/network/utils/xtables-addons/Makefile index 50d1287ba..0c12d7464 100644 --- a/package/network/utils/xtables-addons/Makefile +++ b/package/network/utils/xtables-addons/Makefile @@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=xtables-addons -PKG_VERSION:=2.11 +PKG_VERSION:=2.14 PKG_RELEASE:=1 -PKG_HASH:=f14f8953a9d3a70157a82883886ff6ec866c61dbea1585edb421478107279921 +PKG_HASH:=d215a9a8b8e66aae04b982fa2e1228e8a71e7dfe42320df99e34e5000cbdf152 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@SF/xtables-addons @@ -43,8 +43,7 @@ CONFIGURE_ARGS+= \ define Build/Compile +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ all @@ -52,8 +51,7 @@ endef define Build/Install $(MAKE) -C $(PKG_BUILD_DIR) \ - ARCH="$(LINUX_KARCH)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ + $(KERNEL_MAKE_FLAGS) \ DESTDIR="$(PKG_INSTALL_DIR)" \ DEPMOD="/bin/true" \ install diff --git a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch index 02250ec20..a9fb796d0 100644 --- a/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch +++ b/package/network/utils/xtables-addons/patches/201-fix-lua-packetscript.patch @@ -1,5 +1,14 @@ --- a/extensions/LUA/xt_LUA_target.c +++ b/extensions/LUA/xt_LUA_target.c +@@ -19,7 +19,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include "xt_LUA.h" @@ -64,10 +64,10 @@ uint32_t lua_state_refs[LUA_STATE_ARRAY * XT_CONTINUE inside the *register_lua_packet_lib* function. */ @@ -105,3 +114,14 @@ #endif #if defined(__cplusplus) +--- a/extensions/LUA/lua/llex.h ++++ b/extensions/LUA/lua/llex.h +@@ -10,6 +10,8 @@ + #include "lobject.h" + #include "lzio.h" + ++/* prevent conflict with definition from asm/current.h */ ++#undef current + + #define FIRST_RESERVED 257 + diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile index 16f2f7e77..e26e39b54 100644 --- a/package/system/fstools/Makefile +++ b/package/system/fstools/Makefile @@ -11,11 +11,10 @@ PKG_NAME:=fstools PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/fstools.git -PKG_SOURCE_DATE:=2018-01-04 -PKG_SOURCE_VERSION:=37762ff488752c1686b359816aec75831b49c55f -PKG_MIRROR_HASH:=fe619019e0fd680ea32786cad80305250b776d51969de57a8f0feb729f7639e5 -PKG_RELEASE:=1 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git +PKG_SOURCE_DATE:=2018-01-13 +PKG_SOURCE_VERSION:=18090d97b61cc091ed3f49c3ec8ba42c761f1d15 +PKG_MIRROR_HASH:=165c1b19778138910905528ead080413fb741c5dfc191da72979c00d49df6e0d CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -67,6 +66,13 @@ define Package/block-mount DEPENDS:=+ubox +libubox +libuci endef +define Package/blockd + SECTION:=base + CATEGORY:=Base system + TITLE:=Block device automounting + DEPENDS:=+block-mount +fstools +libubus +kmod-fs-autofs4 +endef + define Package/fstools/install $(INSTALL_DIR) $(1)/sbin $(1)/lib @@ -96,6 +102,12 @@ define Package/block-mount/install endef +define Package/blockd/install + $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/blockd $(1)/sbin/ + $(INSTALL_BIN) ./files/blockd.init $(1)/etc/init.d/blockd +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ @@ -106,3 +118,4 @@ endef $(eval $(call BuildPackage,fstools)) $(eval $(call BuildPackage,snapshot-tool)) $(eval $(call BuildPackage,block-mount)) +$(eval $(call BuildPackage,blockd)) diff --git a/package/system/fstools/files/blockd.init b/package/system/fstools/files/blockd.init new file mode 100755 index 000000000..a4ce57d40 --- /dev/null +++ b/package/system/fstools/files/blockd.init @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common + +START=80 + +USE_PROCD=1 +PROG=/sbin/blockd + +service_triggers() { + procd_add_reload_trigger "fstab" +} + +reload_service() { + block autofs start +} + +start_service() { + procd_open_instance + procd_set_param command "$PROG" + procd_set_param respawn + procd_close_instance +} diff --git a/package/system/fstools/files/snapshot b/package/system/fstools/files/snapshot index c1a5b733f..a495e3434 100644 --- a/package/system/fstools/files/snapshot +++ b/package/system/fstools/files/snapshot @@ -42,7 +42,7 @@ do_snapshot_upgrade() { opkg list-upgradable [ $? -eq 0 ] || exit 2 - + UPDATES=`opkg list-upgradable | cut -d" " -f1` [ -z "${UPDATES}" ] && exit 0 @@ -64,14 +64,16 @@ do_convert_jffs2() { do_convert() { . /lib/functions.sh . /lib/upgrade/common.sh - ubus call system upgrade - touch /tmp/sysupgrade + cd /overlay/upper tar czf /tmp/snapshot.tar.gz * - kill_remaining TERM - sleep 3 - kill_remaining KILL - run_ramfs '. /sbin/snapshot; do_convert_jffs2' + + install_bin /sbin/upgraded + ubus call system sysupgrade "{ + \"prefix\": \"$RAM_ROOT\", + \"path\": \"\", + \"command\": \". /sbin/snapshot; do_convert_jffs2\" + }" } [ -n "$(cat /proc/mounts|grep /overlay|grep jffs2)" ] && { diff --git a/package/system/lede-keyring/Makefile b/package/system/lede-keyring/Makefile index fb5752a54..d0961b162 100644 --- a/package/system/lede-keyring/Makefile +++ b/package/system/lede-keyring/Makefile @@ -6,7 +6,7 @@ PKG_NAME:=lede-keyring PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/keyring.git +PKG_SOURCE_URL=$(PROJECT_GIT)/keyring.git PKG_SOURCE_DATE:=2017-01-20 PKG_SOURCE_VERSION:=a50b7529880988ca96e72dede0279ff139a8ab1a PKG_MIRROR_HASH:=811ba79ba71925e949d2c690db7d7b031ac1dd965aa831ca9b6d9d70f5657254 diff --git a/package/system/mountd/Makefile b/package/system/mountd/Makefile deleted file mode 100644 index 37367abd0..000000000 --- a/package/system/mountd/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright (C) 2009-2012 OpenWrt.org -# All rights reserved. - -include $(TOPDIR)/rules.mk - -PKG_NAME:=mountd -PKG_RELEASE:=3 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/mountd.git -PKG_SOURCE_DATE:=2017-11-09 -PKG_SOURCE_VERSION:=7826ca5d6aca691dcb6f98ab203a090d42e79337 -PKG_MIRROR_HASH:=6fda7666a99974ac9179b102f6e8027f6c4091be9b49e1eed49dee7442d83206 -CMAKE_INSTALL:=1 - -PKG_MAINTAINER:=John Crispin -PKG_LICENSE:=GPL-2.0 - -include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/cmake.mk - -define Package/mountd - SECTION:=utils - CATEGORY:=Utilities - TITLE:=OpenWrt automount daemon - DEPENDS:=+uci +kmod-fs-autofs4 - URL:=http://www.openwrt.org -endef - -define Package/mountd/description - openwrt automount daemon -endef - -define Package/mountd/conffiles -/etc/config/mountd -endef - -define Package/mountd/install - $(INSTALL_DIR) $(1)/sbin/ $(1)/etc/config/ $(1)/etc/init.d/ - $(INSTALL_BIN) $(PKG_BUILD_DIR)/mountd $(1)/sbin/ - $(INSTALL_DATA) ./files/mountd.config $(1)/etc/config/mountd - $(INSTALL_BIN) ./files/mountd.init $(1)/etc/init.d/mountd -endef - -$(eval $(call BuildPackage,mountd)) diff --git a/package/system/mountd/files/mountd.config b/package/system/mountd/files/mountd.config deleted file mode 100644 index 561012950..000000000 --- a/package/system/mountd/files/mountd.config +++ /dev/null @@ -1,3 +0,0 @@ -config mountd mountd - option timeout 60 - option path /tmp/mounts/ diff --git a/package/system/mountd/files/mountd.init b/package/system/mountd/files/mountd.init deleted file mode 100755 index 772bd6ed5..000000000 --- a/package/system/mountd/files/mountd.init +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=80 - -SERVICE_DAEMONIZE=1 -SERVICE_WRITE_PID=1 -SERVICE_PID_FILE=/var/run/mountd.pid - -MOUNTD_BIN=/sbin/mountd - -start() -{ - P="$(uci get mountd.mountd.path)" - [ -n "$P" -a ! -f "$P" ] && mkdir -p $P - - service_start $MOUNTD_BIN -f -} - -stop() -{ - service_stop $MOUNTD_BIN -} diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7c8a1669b..d615dd01d 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=procd PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/procd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git PKG_SOURCE_DATE:=2018-12-02 PKG_SOURCE_VERSION:=a5954cf302fe46d8e29770c818336763112b9a6e PKG_MIRROR_HASH:=1afa1f0160dd8ffac310e75519601c1f9a6107d818f405bb3fe9ef3e7143c2e3 diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 5093a911e..3c81928bb 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -41,6 +41,7 @@ _PROCD_SERVICE= procd_lock() { local basescript=$(readlink "$initscript") local service_name="$(basename ${basescript:-$initscript})" + } _procd_call() { diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile index dc4bbb982..2dc960e48 100644 --- a/package/system/rpcd/Makefile +++ b/package/system/rpcd/Makefile @@ -11,7 +11,7 @@ PKG_NAME:=rpcd PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/rpcd.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git PKG_SOURCE_DATE:=2017-12-07 PKG_SOURCE_VERSION:=cfe1e75c91bc1bac82e6caab3e652b0ebee59524 PKG_MAINTAINER:=Jo-Philipp Wich diff --git a/package/system/ubox/Makefile b/package/system/ubox/Makefile index 3c9b4aa51..299872ed4 100644 --- a/package/system/ubox/Makefile +++ b/package/system/ubox/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=ubox PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ubox.git -PKG_SOURCE_DATE:=2017-03-10 -PKG_SOURCE_VERSION:=16f7e16181e2f3e9cf3e2ce56a7e291844900d09 -PKG_MIRROR_HASH:=5f10f3df134eb8a69d281a73d39f5d2e2fc96af531a2f3960b0c6116ff11a707 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubox.git +PKG_SOURCE_DATE:=2017-11-06 +PKG_SOURCE_VERSION:=2c0d9cfe05e9712d44622c6bb4558e97359bfb76 +PKG_MIRROR_HASH:=e545a29959a310fd7243ee2e799bf9f759894ea4e872010a781c3a65290377b6 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 @@ -41,11 +41,11 @@ define Package/ubox/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/getrandom $(1)/usr/bin/ $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libvalidate.so $(1)/lib - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/rmmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/insmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/lsmod - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modinfo - $(LN) ../../sbin/kmodloader $(1)/usr/sbin/modprobe + $(LN) kmodloader $(1)/sbin/rmmod + $(LN) kmodloader $(1)/sbin/insmod + $(LN) kmodloader $(1)/sbin/lsmod + $(LN) kmodloader $(1)/sbin/modinfo + $(LN) kmodloader $(1)/sbin/modprobe endef define Package/logd/install diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 4f3d4e830..39854f48f 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=ubus PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/ubus.git -PKG_SOURCE_DATE:=2017-02-18 -PKG_SOURCE_VERSION:=34c6e818e431cc53478a0f7c7c1eca07d194d692 -PKG_MIRROR_HASH:=fc4f1121faa4f5b8fa52ee25460b98b2e60e7d245aefa70e7f76c56ce5628fd5 +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git +PKG_SOURCE_DATE:=2017-11-13 +PKG_SOURCE_VERSION:=5f87f5480ebf004d735dbf44259d08cf8affd305 +PKG_MIRROR_HASH:=a490348da86c6cdf0cbc8cc01b77fa6f708d86b94674fd312e0c822ca3d7eba0 CMAKE_INSTALL:=1 PKG_LICENSE:=LGPL-2.1 diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index 04dfd8335..d5b4eac4a 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -11,11 +11,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=uci PKG_RELEASE:=1 -PKG_SOURCE_URL=$(LEDE_GIT)/project/uci.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE=2018-01-01 -PKG_SOURCE_VERSION:=141b64ef84f43c954e665865b1bbf216fbf7c05f -PKG_MIRROR_HASH:=fbd837a16cfa6b0d80f5a4b332b86a105a2b9d37480bcc777931fdea7ce601c9 +PKG_SOURCE_VERSION:=5beb95da3dbec6db11a6bdfaab7807ee2daf41e6 +PKG_MIRROR_HASH:=123c5d3ed8f86db76ab52584e952c8e870891bca4dab682b753ca384d7d067bf PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh index 50891a64e..78ec27766 100644 --- a/package/system/uci/files/lib/config/uci.sh +++ b/package/system/uci/files/lib/config/uci.sh @@ -118,9 +118,10 @@ uci_add() { uci_rename() { local PACKAGE="$1" local CONFIG="$2" - local VALUE="$3" + local OPTION="$3" + local VALUE="$4" - /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG=$VALUE" + /sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} rename "$PACKAGE.$CONFIG${VALUE:+.$OPTION}=${VALUE:-$OPTION}" } uci_remove() { diff --git a/package/system/usign/Makefile b/package/system/usign/Makefile index 84adccb4a..63f9f0995 100644 --- a/package/system/usign/Makefile +++ b/package/system/usign/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=usign PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/usign.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/usign.git PKG_SOURCE_DATE:=2015-07-04 PKG_SOURCE_VERSION:=ef6419142a3b0fbcddcccf536e3c1880302c6f89 PKG_MIRROR_HASH:=9499ed7e40889b364e446a428e185c40986b75087888bd7e1496542457a6dbaa diff --git a/package/utils/adb/Makefile b/package/utils/adb/Makefile index 086169652..c42c94d3a 100644 --- a/package/utils/adb/Makefile +++ b/package/utils/adb/Makefile @@ -28,7 +28,7 @@ define Package/adb DEPENDS:=+zlib +libopenssl +libpthread endef -define Package/bridge/description +define Package/adb/description Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. endef diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 1977e7ff4..afb7d48f8 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -7,6 +7,9 @@ config BUSYBOX_DEFAULT_DESKTOP config BUSYBOX_DEFAULT_EXTRA_COMPAT bool default n +config BUSYBOX_DEFAULT_FEDORA_COMPAT + bool + default n config BUSYBOX_DEFAULT_INCLUDE_SUSv2 bool default y @@ -16,15 +19,6 @@ config BUSYBOX_DEFAULT_USE_PORTABLE_CODE config BUSYBOX_DEFAULT_PLATFORM_LINUX bool default y -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK - bool - default y -config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS - bool - default n config BUSYBOX_DEFAULT_SHOW_USAGE bool default y @@ -43,45 +37,9 @@ config BUSYBOX_DEFAULT_FEATURE_INSTALLER config BUSYBOX_DEFAULT_INSTALL_NO_USR bool default n -config BUSYBOX_DEFAULT_LOCALE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - bool - default n -config BUSYBOX_DEFAULT_SUBST_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - int - default 0 -config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - bool - default n -config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - bool - default n -config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - bool - default n config BUSYBOX_DEFAULT_PAM bool default n -config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - bool - default n config BUSYBOX_DEFAULT_LONG_OPTS bool default y @@ -163,30 +121,6 @@ config BUSYBOX_DEFAULT_EXTRA_LDFLAGS config BUSYBOX_DEFAULT_EXTRA_LDLIBS string default "" -config BUSYBOX_DEFAULT_DEBUG - bool - default n -config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE - bool - default n -config BUSYBOX_DEFAULT_DEBUG_SANITIZE - bool - default n -config BUSYBOX_DEFAULT_UNIT_TEST - bool - default n -config BUSYBOX_DEFAULT_WERROR - bool - default n -config BUSYBOX_DEFAULT_NO_DEBUG_LIB - bool - default y -config BUSYBOX_DEFAULT_DMALLOC - bool - default n -config BUSYBOX_DEFAULT_EFENCE - bool - default n config BUSYBOX_DEFAULT_INSTALL_APPLET_SYMLINKS bool default y @@ -211,12 +145,45 @@ config BUSYBOX_DEFAULT_INSTALL_SH_APPLET_SCRIPT_WRAPPER config BUSYBOX_DEFAULT_PREFIX string default "./_install" +config BUSYBOX_DEFAULT_DEBUG + bool + default n +config BUSYBOX_DEFAULT_DEBUG_PESSIMIZE + bool + default n +config BUSYBOX_DEFAULT_DEBUG_SANITIZE + bool + default n +config BUSYBOX_DEFAULT_UNIT_TEST + bool + default n +config BUSYBOX_DEFAULT_WERROR + bool + default n +config BUSYBOX_DEFAULT_NO_DEBUG_LIB + bool + default y +config BUSYBOX_DEFAULT_DMALLOC + bool + default n +config BUSYBOX_DEFAULT_EFENCE + bool + default n config BUSYBOX_DEFAULT_FEATURE_USE_BSS_TAIL bool default n config BUSYBOX_DEFAULT_FEATURE_RTMINMAX bool default n +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_USE_MALLOC + bool + default n +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_ON_STACK + bool + default y +config BUSYBOX_DEFAULT_FEATURE_BUFFERS_GO_IN_BSS + bool + default n config BUSYBOX_DEFAULT_PASSWORD_MINLEN int default 6 @@ -232,9 +199,6 @@ config BUSYBOX_DEFAULT_FEATURE_FAST_TOP config BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS bool default n -config BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS - bool - default n config BUSYBOX_DEFAULT_FEATURE_EDITING bool default y @@ -268,12 +232,48 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_FANCY_PROMPT config BUSYBOX_DEFAULT_FEATURE_EDITING_ASK_TERMINAL bool default n +config BUSYBOX_DEFAULT_LOCALE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + bool + default n +config BUSYBOX_DEFAULT_SUBST_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + int + default 0 +config BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + bool + default n +config BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + bool + default n +config BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + bool + default n config BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP bool default y config BUSYBOX_DEFAULT_FEATURE_VERBOSE_CP_MESSAGE bool default n +config BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + bool + default y config BUSYBOX_DEFAULT_FEATURE_COPYBUF_KB int default 4 @@ -319,30 +319,45 @@ config BUSYBOX_DEFAULT_UNCOMPRESS config BUSYBOX_DEFAULT_GUNZIP bool default y +config BUSYBOX_DEFAULT_ZCAT + bool + default y config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS bool default n config BUSYBOX_DEFAULT_BUNZIP2 bool default y +config BUSYBOX_DEFAULT_BZCAT + bool + default y config BUSYBOX_DEFAULT_UNLZMA bool default n -config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST +config BUSYBOX_DEFAULT_LZCAT bool default n config BUSYBOX_DEFAULT_LZMA bool default n +config BUSYBOX_DEFAULT_FEATURE_LZMA_FAST + bool + default n config BUSYBOX_DEFAULT_UNXZ bool default n +config BUSYBOX_DEFAULT_XZCAT + bool + default n config BUSYBOX_DEFAULT_XZ bool default n config BUSYBOX_DEFAULT_BZIP2 bool default n +config BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS + bool + default y config BUSYBOX_DEFAULT_CPIO bool default n @@ -358,9 +373,6 @@ config BUSYBOX_DEFAULT_DPKG config BUSYBOX_DEFAULT_DPKG_DEB bool default n -config BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY - bool - default n config BUSYBOX_DEFAULT_GZIP bool default y @@ -373,9 +385,18 @@ config BUSYBOX_DEFAULT_GZIP_FAST config BUSYBOX_DEFAULT_FEATURE_GZIP_LEVELS bool default n +config BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS + bool + default y config BUSYBOX_DEFAULT_LZOP bool default n +config BUSYBOX_DEFAULT_UNLZOP + bool + default n +config BUSYBOX_DEFAULT_LZOPCAT + bool + default n config BUSYBOX_DEFAULT_LZOP_COMPR_HIGH bool default n @@ -424,109 +445,25 @@ config BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX config BUSYBOX_DEFAULT_UNZIP bool default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ + bool + default n config BUSYBOX_DEFAULT_BASENAME bool default y config BUSYBOX_DEFAULT_CAT bool default y -config BUSYBOX_DEFAULT_DATE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DATE_NANO - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT - bool - default n -config BUSYBOX_DEFAULT_DD - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_DD_STATUS - bool - default n -config BUSYBOX_DEFAULT_HOSTID - bool - default n -config BUSYBOX_DEFAULT_ID - bool - default y -config BUSYBOX_DEFAULT_GROUPS - bool - default n -config BUSYBOX_DEFAULT_SHUF - bool - default n -config BUSYBOX_DEFAULT_STAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM - bool - default n -config BUSYBOX_DEFAULT_SYNC - bool - default y -config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY - bool - default n -config BUSYBOX_DEFAULT_TEST - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TEST_64 - bool - default y -config BUSYBOX_DEFAULT_TOUCH - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 - bool - default y -config BUSYBOX_DEFAULT_TR - bool - default y -config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV - bool - default n -config BUSYBOX_DEFAULT_TRUNCATE - bool - default n -config BUSYBOX_DEFAULT_UNLINK - bool - default n -config BUSYBOX_DEFAULT_BASE64 - bool - default n -config BUSYBOX_DEFAULT_WHO - bool - default n -config BUSYBOX_DEFAULT_USERS - bool - default n -config BUSYBOX_DEFAULT_CAL - bool - default n -config BUSYBOX_DEFAULT_CATV +config BUSYBOX_DEFAULT_FEATURE_CATV bool default n config BUSYBOX_DEFAULT_CHGRP @@ -559,6 +496,33 @@ config BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS config BUSYBOX_DEFAULT_CUT bool default y +config BUSYBOX_DEFAULT_DATE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_ISOFMT + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DATE_NANO + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DATE_COMPAT + bool + default n +config BUSYBOX_DEFAULT_DD + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_SIGNAL_HANDLING + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_THIRD_STATUS_LINE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_DD_STATUS + bool + default n config BUSYBOX_DEFAULT_DF bool default y @@ -598,12 +562,21 @@ config BUSYBOX_DEFAULT_EXPAND config BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_UNEXPAND + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + bool + default n config BUSYBOX_DEFAULT_EXPR bool default y config BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 bool default y +config BUSYBOX_DEFAULT_FACTOR + bool + default n config BUSYBOX_DEFAULT_FALSE bool default y @@ -619,12 +592,24 @@ config BUSYBOX_DEFAULT_HEAD config BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD bool default y +config BUSYBOX_DEFAULT_HOSTID + bool + default n +config BUSYBOX_DEFAULT_ID + bool + default y +config BUSYBOX_DEFAULT_GROUPS + bool + default n config BUSYBOX_DEFAULT_INSTALL bool default n config BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_LINK + bool + default n config BUSYBOX_DEFAULT_LN bool default y @@ -643,6 +628,9 @@ config BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS config BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE bool default y +config BUSYBOX_DEFAULT_FEATURE_LS_WIDTH + bool + default y config BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES bool default y @@ -661,6 +649,21 @@ config BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT config BUSYBOX_DEFAULT_MD5SUM bool default y +config BUSYBOX_DEFAULT_SHA1SUM + bool + default n +config BUSYBOX_DEFAULT_SHA256SUM + bool + default y +config BUSYBOX_DEFAULT_SHA512SUM + bool + default n +config BUSYBOX_DEFAULT_SHA3SUM + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + bool + default y config BUSYBOX_DEFAULT_MKDIR bool default y @@ -682,12 +685,21 @@ config BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS config BUSYBOX_DEFAULT_NICE bool default y +config BUSYBOX_DEFAULT_NL + bool + default n config BUSYBOX_DEFAULT_NOHUP bool default n +config BUSYBOX_DEFAULT_NPROC + bool + default n config BUSYBOX_DEFAULT_OD bool default n +config BUSYBOX_DEFAULT_PASTE + bool + default n config BUSYBOX_DEFAULT_PRINTENV bool default n @@ -718,16 +730,10 @@ config BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS config BUSYBOX_DEFAULT_SEQ bool default y -config BUSYBOX_DEFAULT_SHA1SUM +config BUSYBOX_DEFAULT_SHRED bool default n -config BUSYBOX_DEFAULT_SHA256SUM - bool - default y -config BUSYBOX_DEFAULT_SHA512SUM - bool - default n -config BUSYBOX_DEFAULT_SHA3SUM +config BUSYBOX_DEFAULT_SHUF bool default n config BUSYBOX_DEFAULT_SLEEP @@ -751,12 +757,27 @@ config BUSYBOX_DEFAULT_SPLIT config BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY bool default n +config BUSYBOX_DEFAULT_STAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FORMAT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_STAT_FILESYSTEM + bool + default n config BUSYBOX_DEFAULT_STTY bool default n config BUSYBOX_DEFAULT_SUM bool default n +config BUSYBOX_DEFAULT_SYNC + bool + default y +config BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY + bool + default n config BUSYBOX_DEFAULT_TAC bool default n @@ -772,9 +793,42 @@ config BUSYBOX_DEFAULT_TEE config BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO bool default y +config BUSYBOX_DEFAULT_TEST + bool + default y +config BUSYBOX_DEFAULT_TEST1 + bool + default y +config BUSYBOX_DEFAULT_TEST2 + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TEST_64 + bool + default y +config BUSYBOX_DEFAULT_TOUCH + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TOUCH_NODEREF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TOUCH_SUSV3 + bool + default y +config BUSYBOX_DEFAULT_TR + bool + default y +config BUSYBOX_DEFAULT_FEATURE_TR_CLASSES + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TR_EQUIV + bool + default n config BUSYBOX_DEFAULT_TRUE bool default y +config BUSYBOX_DEFAULT_TRUNCATE + bool + default n config BUSYBOX_DEFAULT_TTY bool default n @@ -784,21 +838,21 @@ config BUSYBOX_DEFAULT_UNAME config BUSYBOX_DEFAULT_UNAME_OSNAME string default "GNU/Linux" -config BUSYBOX_DEFAULT_UNEXPAND - bool - default n -config BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - bool - default n config BUSYBOX_DEFAULT_UNIQ bool default y +config BUSYBOX_DEFAULT_UNLINK + bool + default n config BUSYBOX_DEFAULT_USLEEP bool default n config BUSYBOX_DEFAULT_UUDECODE bool default n +config BUSYBOX_DEFAULT_BASE64 + bool + default n config BUSYBOX_DEFAULT_UUENCODE bool default n @@ -808,6 +862,15 @@ config BUSYBOX_DEFAULT_WC config BUSYBOX_DEFAULT_FEATURE_WC_LARGE bool default n +config BUSYBOX_DEFAULT_WHO + bool + default n +config BUSYBOX_DEFAULT_W + bool + default n +config BUSYBOX_DEFAULT_USERS + bool + default n config BUSYBOX_DEFAULT_WHOAMI bool default n @@ -820,21 +883,12 @@ config BUSYBOX_DEFAULT_FEATURE_VERBOSE config BUSYBOX_DEFAULT_FEATURE_PRESERVE_HARDLINKS bool default y -config BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH - bool - default y config BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE bool default y -config BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - bool - default y config BUSYBOX_DEFAULT_CHVT bool default n -config BUSYBOX_DEFAULT_FGCONSOLE - bool - default n config BUSYBOX_DEFAULT_CLEAR bool default y @@ -844,12 +898,30 @@ config BUSYBOX_DEFAULT_DEALLOCVT config BUSYBOX_DEFAULT_DUMPKMAP bool default n +config BUSYBOX_DEFAULT_FGCONSOLE + bool + default n config BUSYBOX_DEFAULT_KBD_MODE bool default n config BUSYBOX_DEFAULT_LOADFONT bool default n +config BUSYBOX_DEFAULT_SETFONT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP + bool + default n +config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR + string + default "" +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + bool + default n config BUSYBOX_DEFAULT_LOADKMAP bool default n @@ -871,15 +943,6 @@ config BUSYBOX_DEFAULT_SETCONSOLE config BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS bool default n -config BUSYBOX_DEFAULT_SETFONT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SETFONT_TEXTUAL_MAP - bool - default n -config BUSYBOX_DEFAULT_DEFAULT_SETFONT_DIR - string - default "" config BUSYBOX_DEFAULT_SETKEYCODES bool default n @@ -889,12 +952,6 @@ config BUSYBOX_DEFAULT_SETLOGCONS config BUSYBOX_DEFAULT_SHOWKEY bool default n -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - bool - default n config BUSYBOX_DEFAULT_MKTEMP bool default y @@ -1032,7 +1089,7 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH default y config BUSYBOX_DEFAULT_FEATURE_FIND_NEWER bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_FIND_INUM bool default n @@ -1081,10 +1138,10 @@ config BUSYBOX_DEFAULT_FEATURE_FIND_LINKS config BUSYBOX_DEFAULT_GREP bool default y -config BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS +config BUSYBOX_DEFAULT_EGREP bool default y -config BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS +config BUSYBOX_DEFAULT_FGREP bool default y config BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT @@ -1120,6 +1177,12 @@ config BUSYBOX_DEFAULT_FEATURE_BOOTCHARTD_CONFIG_FILE config BUSYBOX_DEFAULT_HALT bool default y +config BUSYBOX_DEFAULT_POWEROFF + bool + default y +config BUSYBOX_DEFAULT_REBOOT + bool + default y config BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT bool default n @@ -1147,7 +1210,7 @@ config BUSYBOX_DEFAULT_FEATURE_INIT_SCTTY config BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG bool default n -config BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET +config BUSYBOX_DEFAULT_FEATURE_INIT_QUIET bool default n config BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS @@ -1267,6 +1330,9 @@ config BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG config BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS bool default n +config BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + bool + default n config BUSYBOX_DEFAULT_SULOGIN bool default n @@ -1285,45 +1351,42 @@ config BUSYBOX_DEFAULT_LSATTR config BUSYBOX_DEFAULT_TUNE2FS bool default n -config BUSYBOX_DEFAULT_MODINFO - bool - default n config BUSYBOX_DEFAULT_MODPROBE_SMALL bool default n -config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED +config BUSYBOX_DEFAULT_DEPMOD bool default n config BUSYBOX_DEFAULT_INSMOD bool default n -config BUSYBOX_DEFAULT_RMMOD - bool - default n config BUSYBOX_DEFAULT_LSMOD bool default n config BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool default n +config BUSYBOX_DEFAULT_MODINFO + bool + default n config BUSYBOX_DEFAULT_MODPROBE bool default n config BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST bool default n -config BUSYBOX_DEFAULT_DEPMOD +config BUSYBOX_DEFAULT_RMMOD + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED bool default n config BUSYBOX_DEFAULT_FEATURE_2_4_MODULES bool default n -config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - bool - default n config BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING bool default n @@ -1342,6 +1405,9 @@ config BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL config BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE bool default n +config BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP + bool + default n config BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS bool default n @@ -1354,102 +1420,39 @@ config BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR config BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE string default "" -config BUSYBOX_DEFAULT_BLKDISCARD - bool - default n -config BUSYBOX_DEFAULT_BLOCKDEV - bool - default n -config BUSYBOX_DEFAULT_FATATTR - bool - default n -config BUSYBOX_DEFAULT_FSTRIM - bool - default n -config BUSYBOX_DEFAULT_MDEV - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_CONF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE - bool - default n -config BUSYBOX_DEFAULT_MOUNT - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB - bool - default y -config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB - bool - default n -config BUSYBOX_DEFAULT_NSENTER - bool - default n -config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS - bool - default n -config BUSYBOX_DEFAULT_REV - bool - default n -config BUSYBOX_DEFAULT_SETARCH - bool - default n -config BUSYBOX_DEFAULT_UEVENT - bool - default n -config BUSYBOX_DEFAULT_UNSHARE - bool - default n config BUSYBOX_DEFAULT_ACPID bool default n config BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT bool default n +config BUSYBOX_DEFAULT_BLKDISCARD + bool + default n config BUSYBOX_DEFAULT_BLKID bool default n config BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE bool default n +config BUSYBOX_DEFAULT_BLOCKDEV + bool + default n +config BUSYBOX_DEFAULT_CAL + bool + default n config BUSYBOX_DEFAULT_DMESG bool default y config BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY bool default y +config BUSYBOX_DEFAULT_FALLOCATE + bool + default n +config BUSYBOX_DEFAULT_FATATTR + bool + default n config BUSYBOX_DEFAULT_FBSET bool default n @@ -1459,9 +1462,6 @@ config BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY config BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE bool default n -config BUSYBOX_DEFAULT_FDFLUSH - bool - default n config BUSYBOX_DEFAULT_FDFORMAT bool default n @@ -1498,25 +1498,19 @@ config BUSYBOX_DEFAULT_FINDFS config BUSYBOX_DEFAULT_FLOCK bool default n +config BUSYBOX_DEFAULT_FDFLUSH + bool + default n config BUSYBOX_DEFAULT_FREERAMDISK bool default n config BUSYBOX_DEFAULT_FSCK_MINIX bool default n -config BUSYBOX_DEFAULT_MKFS_EXT2 +config BUSYBOX_DEFAULT_FSFREEZE bool default n -config BUSYBOX_DEFAULT_MKFS_MINIX - bool - default n -config BUSYBOX_DEFAULT_FEATURE_MINIX2 - bool - default n -config BUSYBOX_DEFAULT_MKFS_REISER - bool - default n -config BUSYBOX_DEFAULT_MKFS_VFAT +config BUSYBOX_DEFAULT_FSTRIM bool default n config BUSYBOX_DEFAULT_GETOPT @@ -1534,6 +1528,9 @@ config BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE config BUSYBOX_DEFAULT_HD bool default n +config BUSYBOX_DEFAULT_XXD + bool + default n config BUSYBOX_DEFAULT_HWCLOCK bool default y @@ -1558,6 +1555,45 @@ config BUSYBOX_DEFAULT_LSPCI config BUSYBOX_DEFAULT_LSUSB bool default n +config BUSYBOX_DEFAULT_MDEV + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_CONF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_RENAME_REGEXP + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_EXEC + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MDEV_LOAD_FIRMWARE + bool + default n +config BUSYBOX_DEFAULT_MKE2FS + bool + default n +config BUSYBOX_DEFAULT_MKFS_EXT2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_MINIX + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MINIX2 + bool + default n +config BUSYBOX_DEFAULT_MKFS_REISER + bool + default n +config BUSYBOX_DEFAULT_MKDOSFS + bool + default n +config BUSYBOX_DEFAULT_MKFS_VFAT + bool + default n config BUSYBOX_DEFAULT_MKSWAP bool default y @@ -1567,6 +1603,42 @@ config BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID config BUSYBOX_DEFAULT_MORE bool default n +config BUSYBOX_DEFAULT_MOUNT + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FAKE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_VERBOSE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_HELPERS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_LABEL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_NFS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_MOUNT_CIFS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_FSTAB + bool + default y +config BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB + bool + default n +config BUSYBOX_DEFAULT_NSENTER + bool + default n +config BUSYBOX_DEFAULT_FEATURE_NSENTER_LONG_OPTS + bool + default n config BUSYBOX_DEFAULT_PIVOT_ROOT bool default y @@ -1579,6 +1651,9 @@ config BUSYBOX_DEFAULT_RDEV config BUSYBOX_DEFAULT_READPROFILE bool default n +config BUSYBOX_DEFAULT_REV + bool + default n config BUSYBOX_DEFAULT_RTCWAKE bool default n @@ -1588,7 +1663,19 @@ config BUSYBOX_DEFAULT_SCRIPT config BUSYBOX_DEFAULT_SCRIPTREPLAY bool default n -config BUSYBOX_DEFAULT_SWAPONOFF +config BUSYBOX_DEFAULT_SETARCH + bool + default n +config BUSYBOX_DEFAULT_LINUX32 + bool + default n +config BUSYBOX_DEFAULT_LINUX64 + bool + default n +config BUSYBOX_DEFAULT_SETPRIV + bool + default n +config BUSYBOX_DEFAULT_SWAPON bool default n config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD @@ -1597,15 +1684,24 @@ config BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD config BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI bool default n +config BUSYBOX_DEFAULT_SWAPOFF + bool + default n config BUSYBOX_DEFAULT_SWITCH_ROOT bool default y +config BUSYBOX_DEFAULT_UEVENT + bool + default n config BUSYBOX_DEFAULT_UMOUNT bool default y config BUSYBOX_DEFAULT_FEATURE_UMOUNT_ALL bool default y +config BUSYBOX_DEFAULT_UNSHARE + bool + default n config BUSYBOX_DEFAULT_FEATURE_MOUNT_LOOP bool default y @@ -1678,114 +1774,15 @@ config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV bool default n +config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS + bool + default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF bool default n config BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS bool default n -config BUSYBOX_DEFAULT_CONSPY - bool - default n -config BUSYBOX_DEFAULT_CROND - bool - default y -config BUSYBOX_DEFAULT_FEATURE_CROND_D - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_CROND_DIR - string - default "/etc" -config BUSYBOX_DEFAULT_I2CGET - bool - default n -config BUSYBOX_DEFAULT_I2CSET - bool - default n -config BUSYBOX_DEFAULT_I2CDUMP - bool - default n -config BUSYBOX_DEFAULT_I2CDETECT - bool - default n -config BUSYBOX_DEFAULT_LESS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES - int - default 9999999 -config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS - bool - default n -config BUSYBOX_DEFAULT_NANDWRITE - bool - default n -config BUSYBOX_DEFAULT_NANDDUMP - bool - default n -config BUSYBOX_DEFAULT_RFKILL - bool - default n -config BUSYBOX_DEFAULT_SETSERIAL - bool - default n -config BUSYBOX_DEFAULT_TASKSET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - bool - default n -config BUSYBOX_DEFAULT_UBIATTACH - bool - default n -config BUSYBOX_DEFAULT_UBIDETACH - bool - default n -config BUSYBOX_DEFAULT_UBIMKVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRMVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRSVOL - bool - default n -config BUSYBOX_DEFAULT_UBIUPDATEVOL - bool - default n -config BUSYBOX_DEFAULT_UBIRENAME - bool - default n -config BUSYBOX_DEFAULT_WALL - bool - default n config BUSYBOX_DEFAULT_ADJTIMEX bool default n @@ -1831,6 +1828,21 @@ config BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT config BUSYBOX_DEFAULT_CHRT bool default n +config BUSYBOX_DEFAULT_CONSPY + bool + default n +config BUSYBOX_DEFAULT_CROND + bool + default y +config BUSYBOX_DEFAULT_FEATURE_CROND_D + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_CROND_DIR + string + default "/etc" config BUSYBOX_DEFAULT_CRONTAB bool default y @@ -1867,7 +1879,7 @@ config BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI config BUSYBOX_DEFAULT_FBSPLASH bool default n -config BUSYBOX_DEFAULT_FLASHCP +config BUSYBOX_DEFAULT_FLASH_ERASEALL bool default n config BUSYBOX_DEFAULT_FLASH_LOCK @@ -1876,19 +1888,7 @@ config BUSYBOX_DEFAULT_FLASH_LOCK config BUSYBOX_DEFAULT_FLASH_UNLOCK bool default n -config BUSYBOX_DEFAULT_FLASH_ERASEALL - bool - default n -config BUSYBOX_DEFAULT_IONICE - bool - default n -config BUSYBOX_DEFAULT_INOTIFYD - bool - default n -config BUSYBOX_DEFAULT_LAST - bool - default n -config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY +config BUSYBOX_DEFAULT_FLASHCP bool default n config BUSYBOX_DEFAULT_HDPARM @@ -1912,9 +1912,69 @@ config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF config BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA bool default n +config BUSYBOX_DEFAULT_I2CGET + bool + default n +config BUSYBOX_DEFAULT_I2CSET + bool + default n +config BUSYBOX_DEFAULT_I2CDUMP + bool + default n +config BUSYBOX_DEFAULT_I2CDETECT + bool + default n +config BUSYBOX_DEFAULT_INOTIFYD + bool + default n +config BUSYBOX_DEFAULT_IONICE + bool + default n +config BUSYBOX_DEFAULT_LAST + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LAST_FANCY + bool + default n +config BUSYBOX_DEFAULT_LESS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES + int + default 9999999 +config BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_MARKS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_WINCH + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD + bool + default n +config BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS + bool + default n config BUSYBOX_DEFAULT_LOCK bool default y +config BUSYBOX_DEFAULT_LSSCSI + bool + default n config BUSYBOX_DEFAULT_MAKEDEVS bool default n @@ -1936,24 +1996,45 @@ config BUSYBOX_DEFAULT_MOUNTPOINT config BUSYBOX_DEFAULT_MT bool default n +config BUSYBOX_DEFAULT_NANDWRITE + bool + default n +config BUSYBOX_DEFAULT_NANDDUMP + bool + default n +config BUSYBOX_DEFAULT_PARTPROBE + bool + default n config BUSYBOX_DEFAULT_RAIDAUTORUN bool default n config BUSYBOX_DEFAULT_READAHEAD bool default n +config BUSYBOX_DEFAULT_RFKILL + bool + default n config BUSYBOX_DEFAULT_RUNLEVEL bool default n config BUSYBOX_DEFAULT_RX bool default n +config BUSYBOX_DEFAULT_SETSERIAL + bool + default n config BUSYBOX_DEFAULT_SETSID bool default n config BUSYBOX_DEFAULT_STRINGS bool default y +config BUSYBOX_DEFAULT_TASKSET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + bool + default n config BUSYBOX_DEFAULT_TIME bool default y @@ -1963,66 +2044,36 @@ config BUSYBOX_DEFAULT_TIMEOUT config BUSYBOX_DEFAULT_TTYSIZE bool default n +config BUSYBOX_DEFAULT_UBIATTACH + bool + default n +config BUSYBOX_DEFAULT_UBIDETACH + bool + default n +config BUSYBOX_DEFAULT_UBIMKVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRMVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRSVOL + bool + default n +config BUSYBOX_DEFAULT_UBIUPDATEVOL + bool + default n +config BUSYBOX_DEFAULT_UBIRENAME + bool + default n config BUSYBOX_DEFAULT_VOLNAME bool default n +config BUSYBOX_DEFAULT_WALL + bool + default n config BUSYBOX_DEFAULT_WATCHDOG bool default n -config BUSYBOX_DEFAULT_NAMEIF - bool - default n -config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED - bool - default n -config BUSYBOX_DEFAULT_NBDCLIENT - bool - default n -config BUSYBOX_DEFAULT_NC - bool - default y -config BUSYBOX_DEFAULT_NC_SERVER - bool - default n -config BUSYBOX_DEFAULT_NC_EXTRA - bool - default n -config BUSYBOX_DEFAULT_NC_110_COMPAT - bool - default n -config BUSYBOX_DEFAULT_PING - bool - default y -config BUSYBOX_DEFAULT_PING6 - bool - default y -config BUSYBOX_DEFAULT_FEATURE_FANCY_PING - bool - default y -config BUSYBOX_DEFAULT_WGET - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - bool - default n -config BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER - bool - default n -config BUSYBOX_DEFAULT_WHOIS - bool - default n config BUSYBOX_DEFAULT_FEATURE_IPV6 bool default y @@ -2056,19 +2107,16 @@ config BUSYBOX_DEFAULT_DNSD config BUSYBOX_DEFAULT_ETHER_WAKE bool default n -config BUSYBOX_DEFAULT_FAKEIDENTD - bool - default n config BUSYBOX_DEFAULT_FTPD bool default n -config BUSYBOX_DEFAULT_FEATURE_FTP_WRITE +config BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE bool default n config BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST bool default n -config BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION +config BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION bool default n config BUSYBOX_DEFAULT_FTPGET @@ -2083,6 +2131,9 @@ config BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS config BUSYBOX_DEFAULT_HOSTNAME bool default n +config BUSYBOX_DEFAULT_DNSDOMAINNAME + bool + default n config BUSYBOX_DEFAULT_HTTPD bool default n @@ -2143,7 +2194,10 @@ config BUSYBOX_DEFAULT_IFENSLAVE config BUSYBOX_DEFAULT_IFPLUGD bool default n -config BUSYBOX_DEFAULT_IFUPDOWN +config BUSYBOX_DEFAULT_IFUP + bool + default n +config BUSYBOX_DEFAULT_IFDOWN bool default n config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH @@ -2152,12 +2206,6 @@ config BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP bool default n -config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN - bool - default n -config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - bool - default n config BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 bool default n @@ -2194,6 +2242,24 @@ config BUSYBOX_DEFAULT_FEATURE_INETD_RPC config BUSYBOX_DEFAULT_IP bool default y +config BUSYBOX_DEFAULT_IPADDR + bool + default n +config BUSYBOX_DEFAULT_IPLINK + bool + default n +config BUSYBOX_DEFAULT_IPROUTE + bool + default n +config BUSYBOX_DEFAULT_IPTUNNEL + bool + default n +config BUSYBOX_DEFAULT_IPRULE + bool + default n +config BUSYBOX_DEFAULT_IPNEIGH + bool + default n config BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS bool default y @@ -2214,31 +2280,10 @@ config BUSYBOX_DEFAULT_FEATURE_IP_RULE default y config BUSYBOX_DEFAULT_FEATURE_IP_NEIGH bool - default n -config BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS - bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS bool default n -config BUSYBOX_DEFAULT_IPADDR - bool - default n -config BUSYBOX_DEFAULT_IPLINK - bool - default n -config BUSYBOX_DEFAULT_IPROUTE - bool - default n -config BUSYBOX_DEFAULT_IPTUNNEL - bool - default n -config BUSYBOX_DEFAULT_IPRULE - bool - default n -config BUSYBOX_DEFAULT_IPNEIGH - bool - default n config BUSYBOX_DEFAULT_IPCALC bool default n @@ -2248,6 +2293,30 @@ config BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY config BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS bool default n +config BUSYBOX_DEFAULT_FAKEIDENTD + bool + default n +config BUSYBOX_DEFAULT_NAMEIF + bool + default n +config BUSYBOX_DEFAULT_FEATURE_NAMEIF_EXTENDED + bool + default n +config BUSYBOX_DEFAULT_NBDCLIENT + bool + default n +config BUSYBOX_DEFAULT_NC + bool + default y +config BUSYBOX_DEFAULT_NC_SERVER + bool + default n +config BUSYBOX_DEFAULT_NC_EXTRA + bool + default n +config BUSYBOX_DEFAULT_NC_110_COMPAT + bool + default n config BUSYBOX_DEFAULT_NETMSG bool default y @@ -2263,9 +2332,12 @@ config BUSYBOX_DEFAULT_FEATURE_NETSTAT_PRG config BUSYBOX_DEFAULT_NSLOOKUP bool default n -config BUSYBOX_DEFAULT_NSLOOKUP_LEDE +config BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT bool default y +config BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + bool + default n config BUSYBOX_DEFAULT_NTPD bool default y @@ -2275,6 +2347,15 @@ config BUSYBOX_DEFAULT_FEATURE_NTPD_SERVER config BUSYBOX_DEFAULT_FEATURE_NTPD_CONF bool default n +config BUSYBOX_DEFAULT_PING + bool + default y +config BUSYBOX_DEFAULT_PING6 + bool + default y +config BUSYBOX_DEFAULT_FEATURE_FANCY_PING + bool + default y config BUSYBOX_DEFAULT_PSCAN bool default n @@ -2284,9 +2365,15 @@ config BUSYBOX_DEFAULT_ROUTE config BUSYBOX_DEFAULT_SLATTACH bool default n +config BUSYBOX_DEFAULT_SSL_CLIENT + bool + default n config BUSYBOX_DEFAULT_TCPSVD bool default n +config BUSYBOX_DEFAULT_UDPSVD + bool + default n config BUSYBOX_DEFAULT_TELNET bool default n @@ -2296,6 +2383,9 @@ config BUSYBOX_DEFAULT_FEATURE_TELNET_TTYPE config BUSYBOX_DEFAULT_FEATURE_TELNET_AUTOLOGIN bool default n +config BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH + bool + default n config BUSYBOX_DEFAULT_TELNETD bool default n @@ -2326,6 +2416,9 @@ config BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR config BUSYBOX_DEFAULT_TFTP_DEBUG bool default n +config BUSYBOX_DEFAULT_TLS + bool + default n config BUSYBOX_DEFAULT_TRACEROUTE bool default y @@ -2335,9 +2428,6 @@ config BUSYBOX_DEFAULT_TRACEROUTE6 config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE bool default y -config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE - bool - default n config BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP bool default n @@ -2347,18 +2437,51 @@ config BUSYBOX_DEFAULT_TUNCTL config BUSYBOX_DEFAULT_FEATURE_TUNCTL_UG bool default n +config BUSYBOX_DEFAULT_VCONFIG + bool + default n +config BUSYBOX_DEFAULT_WGET + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + bool + default n +config BUSYBOX_DEFAULT_WHOIS + bool + default n +config BUSYBOX_DEFAULT_ZCIP + bool + default n config BUSYBOX_DEFAULT_UDHCPC6 bool default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 + bool + default n +config BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 + bool + default n config BUSYBOX_DEFAULT_UDHCPD bool default n -config BUSYBOX_DEFAULT_DHCPRELAY - bool - default n -config BUSYBOX_DEFAULT_DUMPLEASES - bool - default n config BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool default n @@ -2368,6 +2491,12 @@ config BUSYBOX_DEFAULT_FEATURE_UDHCPD_BASE_IP_ON_MAC config BUSYBOX_DEFAULT_DHCPD_LEASES_FILE string default "" +config BUSYBOX_DEFAULT_DUMPLEASES + bool + default n +config BUSYBOX_DEFAULT_DHCPRELAY + bool + default n config BUSYBOX_DEFAULT_UDHCPC bool default y @@ -2398,15 +2527,6 @@ config BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS config BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS string default "" -config BUSYBOX_DEFAULT_UDPSVD - bool - default n -config BUSYBOX_DEFAULT_VCONFIG - bool - default n -config BUSYBOX_DEFAULT_ZCIP - bool - default n config BUSYBOX_DEFAULT_LPD bool default n @@ -2419,9 +2539,6 @@ config BUSYBOX_DEFAULT_LPQ config BUSYBOX_DEFAULT_MAKEMIME bool default n -config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - string - default "" config BUSYBOX_DEFAULT_POPMAILDIR bool default n @@ -2437,9 +2554,27 @@ config BUSYBOX_DEFAULT_FEATURE_REFORMIME_COMPAT config BUSYBOX_DEFAULT_SENDMAIL bool default n +config BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + string + default "" +config BUSYBOX_DEFAULT_FREE + bool + default y +config BUSYBOX_DEFAULT_FUSER + bool + default n config BUSYBOX_DEFAULT_IOSTAT bool default n +config BUSYBOX_DEFAULT_KILL + bool + default y +config BUSYBOX_DEFAULT_KILLALL + bool + default y +config BUSYBOX_DEFAULT_KILLALL5 + bool + default n config BUSYBOX_DEFAULT_LSOF bool default n @@ -2449,24 +2584,69 @@ config BUSYBOX_DEFAULT_MPSTAT config BUSYBOX_DEFAULT_NMETER bool default n +config BUSYBOX_DEFAULT_PGREP + bool + default y +config BUSYBOX_DEFAULT_PKILL + bool + default n +config BUSYBOX_DEFAULT_PIDOF + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + bool + default n config BUSYBOX_DEFAULT_PMAP bool default n config BUSYBOX_DEFAULT_POWERTOP bool default n +config BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE + bool + default n +config BUSYBOX_DEFAULT_PS + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_WIDE + bool + default y +config BUSYBOX_DEFAULT_FEATURE_PS_LONG + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_TIME + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + bool + default n +config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + bool + default n config BUSYBOX_DEFAULT_PSTREE bool default n config BUSYBOX_DEFAULT_PWDX bool default n +config BUSYBOX_DEFAULT_RENICE + bool + default n config BUSYBOX_DEFAULT_SMEMCAP bool default n +config BUSYBOX_DEFAULT_BB_SYSCTL + bool + default y config BUSYBOX_DEFAULT_TOP bool default y +config BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE + bool + default n config BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool default y @@ -2491,66 +2671,12 @@ config BUSYBOX_DEFAULT_UPTIME config BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT bool default n -config BUSYBOX_DEFAULT_FREE - bool - default y -config BUSYBOX_DEFAULT_FUSER - bool - default n -config BUSYBOX_DEFAULT_KILL - bool - default y -config BUSYBOX_DEFAULT_KILLALL - bool - default y -config BUSYBOX_DEFAULT_KILLALL5 - bool - default n -config BUSYBOX_DEFAULT_PGREP - bool - default y -config BUSYBOX_DEFAULT_PIDOF - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - bool - default n -config BUSYBOX_DEFAULT_PKILL - bool - default n -config BUSYBOX_DEFAULT_PS - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_WIDE - bool - default y -config BUSYBOX_DEFAULT_FEATURE_PS_LONG - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_TIME - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - bool - default n -config BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - bool - default n -config BUSYBOX_DEFAULT_RENICE - bool - default n -config BUSYBOX_DEFAULT_BB_SYSCTL - bool - default y -config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS - bool - default n config BUSYBOX_DEFAULT_WATCH bool default n +config BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS + bool + default n config BUSYBOX_DEFAULT_CHPST bool default n @@ -2581,6 +2707,9 @@ config BUSYBOX_DEFAULT_SV config BUSYBOX_DEFAULT_SV_DEFAULT_SERVICE_DIR string default "" +config BUSYBOX_DEFAULT_SVC + bool + default n config BUSYBOX_DEFAULT_SVLOGD bool default n @@ -2602,9 +2731,6 @@ config BUSYBOX_DEFAULT_LOAD_POLICY config BUSYBOX_DEFAULT_MATCHPATHCON bool default n -config BUSYBOX_DEFAULT_RESTORECON - bool - default n config BUSYBOX_DEFAULT_RUNCON bool default n @@ -2614,6 +2740,9 @@ config BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS config BUSYBOX_DEFAULT_SELINUXENABLED bool default n +config BUSYBOX_DEFAULT_SESTATUS + bool + default n config BUSYBOX_DEFAULT_SETENFORCE bool default n @@ -2623,55 +2752,76 @@ config BUSYBOX_DEFAULT_SETFILES config BUSYBOX_DEFAULT_FEATURE_SETFILES_CHECK_OPTION bool default n +config BUSYBOX_DEFAULT_RESTORECON + bool + default n config BUSYBOX_DEFAULT_SETSEBOOL bool default n -config BUSYBOX_DEFAULT_SESTATUS +config BUSYBOX_DEFAULT_SH_IS_ASH + bool + default y +config BUSYBOX_DEFAULT_SH_IS_HUSH bool default n +config BUSYBOX_DEFAULT_SH_IS_NONE + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_ASH + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_HUSH + bool + default n +config BUSYBOX_DEFAULT_BASH_IS_NONE + bool + default y config BUSYBOX_DEFAULT_ASH bool default y +config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE + bool + default n +config BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB + bool + default y config BUSYBOX_DEFAULT_ASH_BASH_COMPAT bool default y -config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - bool - default n config BUSYBOX_DEFAULT_ASH_JOB_CONTROL bool default y config BUSYBOX_DEFAULT_ASH_ALIAS bool default y -config BUSYBOX_DEFAULT_ASH_GETOPTS +config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT + bool + default n +config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO +config BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + bool + default n +config BUSYBOX_DEFAULT_ASH_MAIL + bool + default n +config BUSYBOX_DEFAULT_ASH_ECHO bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF +config BUSYBOX_DEFAULT_ASH_PRINTF bool default y -config BUSYBOX_DEFAULT_ASH_BUILTIN_TEST +config BUSYBOX_DEFAULT_ASH_TEST bool default y config BUSYBOX_DEFAULT_ASH_HELP bool default n -config BUSYBOX_DEFAULT_ASH_CMDCMD +config BUSYBOX_DEFAULT_ASH_GETOPTS bool default y -config BUSYBOX_DEFAULT_ASH_MAIL - bool - default n -config BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - bool - default n -config BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - bool - default n -config BUSYBOX_DEFAULT_ASH_EXPAND_PRMT +config BUSYBOX_DEFAULT_ASH_CMDCMD bool default y config BUSYBOX_DEFAULT_CTTYHACK @@ -2719,37 +2869,61 @@ config BUSYBOX_DEFAULT_HUSH_LOCAL config BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT bool default n +config BUSYBOX_DEFAULT_HUSH_MODE_X + bool + default n +config BUSYBOX_DEFAULT_HUSH_ECHO + bool + default n +config BUSYBOX_DEFAULT_HUSH_PRINTF + bool + default n +config BUSYBOX_DEFAULT_HUSH_TEST + bool + default n +config BUSYBOX_DEFAULT_HUSH_EXPORT + bool + default n config BUSYBOX_DEFAULT_HUSH_EXPORT_N bool default n -config BUSYBOX_DEFAULT_HUSH_MODE_X +config BUSYBOX_DEFAULT_HUSH_KILL + bool + default n +config BUSYBOX_DEFAULT_HUSH_WAIT + bool + default n +config BUSYBOX_DEFAULT_HUSH_TRAP + bool + default n +config BUSYBOX_DEFAULT_HUSH_TYPE + bool + default n +config BUSYBOX_DEFAULT_HUSH_READ + bool + default n +config BUSYBOX_DEFAULT_HUSH_SET + bool + default n +config BUSYBOX_DEFAULT_HUSH_UNSET + bool + default n +config BUSYBOX_DEFAULT_HUSH_ULIMIT + bool + default n +config BUSYBOX_DEFAULT_HUSH_UMASK + bool + default n +config BUSYBOX_DEFAULT_HUSH_MEMLEAK bool default n config BUSYBOX_DEFAULT_MSH bool default n -config BUSYBOX_DEFAULT_FEATURE_SH_IS_ASH +config BUSYBOX_DEFAULT_FEATURE_SH_MATH bool default y -config BUSYBOX_DEFAULT_FEATURE_SH_IS_HUSH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_SH_IS_NONE - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_ASH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_HUSH - bool - default n -config BUSYBOX_DEFAULT_FEATURE_BASH_IS_NONE - bool - default y -config BUSYBOX_DEFAULT_SH_MATH_SUPPORT - bool - default y -config BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 +config BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 bool default y config BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 0d3708636..8866756ae 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -8,21 +8,23 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox -PKG_VERSION:=1.25.1 -PKG_RELEASE:=4 +PKG_VERSION:=1.27.2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://www.busybox.net/downloads \ http://sources.buildroot.net -PKG_HASH:=27667e0f2328fdbd79cfd622e4453e5c57e58f781c5da97c9be337d93aa2a02e +PKG_HASH:=9d4be516b61e6480f156b11eb42577a13529f75d3383850bb75c50c285de63df PKG_BUILD_DEPENDS:=BUSYBOX_USE_LIBRPC:librpc BUSYBOX_CONFIG_PAM:libpam PKG_BUILD_PARALLEL:=1 PKG_CHECK_FORMAT_SECURITY:=0 +PKG_INSTALL:=1 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE archival/libarchive/bz/LICENSE +PKG_CPE_ID:=cpe:/a:busybox:busybox include $(INCLUDE_DIR)/package.mk @@ -30,11 +32,8 @@ ifeq ($(DUMP),) STAMP_CONFIGURED:=$(strip $(STAMP_CONFIGURED))_$(shell grep '^CONFIG_BUSYBOX_' $(TOPDIR)/.config | mkhash md5) endif -ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) - BB_MAKE_VERBOSE := V=1 -else - BB_MAKE_VERBOSE := -endif +BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) +BUSYBOX_IF_ENABLED=$(if $(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_$(1)),$(2)) define Package/busybox SECTION:=base @@ -44,6 +43,20 @@ define Package/busybox URL:=http://busybox.net/ DEPENDS:=+BUSYBOX_USE_LIBRPC:librpc +BUSYBOX_CONFIG_PAM:libpam +BUSYBOX_CONFIG_NTPD:jsonfilter MENU:=1 + PROVIDES:=ip + ALTERNATIVES:=\ + $(call BUSYBOX_IF_ENABLED,KILL, 100:/bin/kill:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PS, 100:/bin/ps:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,WATCH, 100:/bin/watch:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,IP, 100:/sbin/ip:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,FREE, 100:/usr/bin/free:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PGREP, 100:/usr/bin/pgrep:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PKILL, 100:/usr/bin/pkill:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PMAP, 100:/usr/bin/pmap:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,PWDX, 100:/usr/bin/pwdx:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,TOP, 100:/usr/bin/top:/bin/busybox) \ + $(call BUSYBOX_IF_ENABLED,UPTIME, 100:/usr/bin/uptime:/bin/busybox) \ + endef define Package/busybox/description @@ -55,64 +68,35 @@ define Package/busybox/config source "$(SOURCE)/Config.in" endef -BUSYBOX_SYM=$(if $(CONFIG_BUSYBOX_CUSTOM),CONFIG,DEFAULT) - # don't create a version string containing the actual timestamp export KCONFIG_NOTIMESTAMP=1 -define Build/Configure - rm -f $(PKG_BUILD_DIR)/.configured* - grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config - yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - ARCH="$(ARCH)" \ - $(BB_MAKE_VERBOSE) \ - oldconfig -endef LDLIBS:=m crypt +LDLIBS += $(call BUSYBOX_IF_ENABLED,PAM,pam pam_misc pthread) ifdef CONFIG_BUSYBOX_USE_LIBRPC - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) LDLIBS += rpc endif - -ifdef CONFIG_BUSYBOX_CONFIG_PAM - TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - export LDFLAGS=$(TARGET_LDFLAGS) - LDLIBS += pam pam_misc pthread +ifeq ($(CONFIG_USE_GLIBC),y) + LDLIBS += $(call BUSYBOX_IF_ENABLED,NSLOOKUP_OPENWRT,resolv) endif -ifdef CONFIG_BUSYBOX_DEFAULT_NSLOOKUP_LEDE - ifeq ($(CONFIG_USE_GLIBC),y) - LDLIBS += resolv - endif +MAKE_VARS := +MAKE_FLAGS += \ + EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)" \ + EXTRA_LDFLAGS="$(TARGET_LDFLAGS)" \ + LDLIBS="$(LDLIBS)" \ + SKIP_STRIP=y +ifneq ($(findstring c,$(OPENWRT_VERBOSE)),) + MAKE_FLAGS += V=1 endif -define Build/Compile - +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - KBUILD_HAVE_NLS=no \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - SKIP_STRIP=y \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - all - rm -rf $(PKG_INSTALL_DIR) - $(FIND) $(PKG_BUILD_DIR) -lname "*busybox" -exec rm \{\} \; - $(MAKE) -C $(PKG_BUILD_DIR) \ - CC="$(TARGET_CC)" \ - CROSS_COMPILE="$(TARGET_CROSS)" \ - EXTRA_CFLAGS="$(TARGET_CFLAGS)" \ - ARCH="$(ARCH)" \ - CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \ - LDLIBS="$(LDLIBS)" \ - $(BB_MAKE_VERBOSE) \ - install +MAKE_INSTALL_FLAGS += CONFIG_PREFIX="$(PKG_INSTALL_DIR)" + + +define Build/Configure + grep 'CONFIG_BUSYBOX_$(BUSYBOX_SYM)' $(TOPDIR)/.config | sed -e "s,\\(# \)\\?CONFIG_BUSYBOX_$(BUSYBOX_SYM)_\\(.*\\),\\1CONFIG_\\2,g" > $(PKG_BUILD_DIR)/.config + yes 'n' | $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) oldconfig endef define Package/busybox/install diff --git a/package/utils/busybox/config/Config.in b/package/utils/busybox/config/Config.in index 3bf67c5cf..c66aa08e7 100644 --- a/package/utils/busybox/config/Config.in +++ b/package/utils/busybox/config/Config.in @@ -10,15 +10,18 @@ config BUSYBOX_CONFIG_HAVE_DOT_CONFIG menu "Busybox Settings" -menu "General Configuration" - config BUSYBOX_CONFIG_DESKTOP bool "Enable options for full-blown desktop systems" default BUSYBOX_DEFAULT_DESKTOP help Enable options and features which are not essential. - Select this only if you plan to use busybox on full-blown - desktop machine with common Linux distro, not on an embedded box. + Select this if you plan to use busybox on full-blown desktop machine + with common Linux distro, which needs higher level of command-line + compatibility. + + If you are preparing your build to be used on an embedded box + where you have tighter control over the entire set of userspace + tools, you can unselect this option for smaller code size. config BUSYBOX_CONFIG_EXTRA_COMPAT bool "Provide compatible behavior for rare corner cases (bigger code)" @@ -29,6 +32,19 @@ config BUSYBOX_CONFIG_EXTRA_COMPAT some GNU extensions in libc. You probably only need this option if you plan to run busybox on desktop. +config BUSYBOX_CONFIG_FEDORA_COMPAT + bool "Building for Fedora distribution" + default BUSYBOX_DEFAULT_FEDORA_COMPAT + help + This option makes some tools behave like they do on Fedora. + + At the time of this writing (2017-08) this only affects uname: + normally, uname -p (processor) and uname -i (platform) + are shown as "unknown", but with this option uname -p + shows the same string as uname -m (machine type), + and so does uname -i unless machine type is i486/i586/i686 - + then uname -i shows "i386". + config BUSYBOX_CONFIG_INCLUDE_SUSv2 bool "Enable obsolete features removed before SUSv3" default BUSYBOX_DEFAULT_INCLUDE_SUSv2 @@ -46,41 +62,6 @@ config BUSYBOX_CONFIG_USE_PORTABLE_CODE compiler other than gcc. If you do use gcc, this option may needlessly increase code size. -config BUSYBOX_CONFIG_PLATFORM_LINUX - bool "Enable Linux-specific applets and features" - default BUSYBOX_DEFAULT_PLATFORM_LINUX - help - For the most part, busybox requires only POSIX compatibility - from the target system, but some applets and features use - Linux-specific interfaces. - - Answering 'N' here will disable such applets and hide the - corresponding configuration options. - -choice - prompt "Buffer allocation policy" - default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - help - There are 3 ways BusyBox can handle buffer allocations: - - Use malloc. This costs code size for the call to xmalloc. - - Put them on stack. For some very small machines with limited stack - space, this can be deadly. For most folks, this works just fine. - - Put them in BSS. This works beautifully for computers with a real - MMU (and OS support), but wastes runtime RAM for uCLinux. This - behavior was the only one available for BusyBox versions 0.48 and - earlier. - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC - bool "Allocate with Malloc" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK - bool "Allocate on the Stack" - -config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS - bool "Allocate in the .bss section" - -endchoice - config BUSYBOX_CONFIG_SHOW_USAGE bool "Show applet usage messages" default BUSYBOX_DEFAULT_SHOW_USAGE @@ -143,153 +124,15 @@ config BUSYBOX_CONFIG_INSTALL_NO_USR will install applets only to /bin and /sbin, never to /usr/bin or /usr/sbin. -config BUSYBOX_CONFIG_LOCALE_SUPPORT - bool "Enable locale support (system needs locale for this to work)" - default BUSYBOX_DEFAULT_LOCALE_SUPPORT - help - Enable this if your system has locale support and you would like - busybox to support locale settings. - -config BUSYBOX_CONFIG_UNICODE_SUPPORT - bool "Support Unicode" - default BUSYBOX_DEFAULT_UNICODE_SUPPORT - help - This makes various applets aware that one byte is not - one character on screen. - - Busybox aims to eventually work correctly with Unicode displays. - Any older encodings are not guaranteed to work. - Probably by the time when busybox will be fully Unicode-clean, - other encodings will be mainly of historic interest. - -config BUSYBOX_CONFIG_UNICODE_USING_LOCALE - bool "Use libc routines for Unicode (else uses internal ones)" - default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT - help - With this option on, Unicode support is implemented using libc - routines. Otherwise, internal implementation is used. - Internal implementation is smaller. - -config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV - bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" - default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, Unicode support is activated - only if locale-related variables have the value of the form - "xxxx.utf8" - - Otherwise, Unicode support will be always enabled and active. - -config BUSYBOX_CONFIG_SUBST_WCHAR - int "Character code to substitute unprintable characters with" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_SUBST_WCHAR - help - Typical values are 63 for '?' (works with any output device), - 30 for ASCII substitute control code, - 65533 (0xfffd) for Unicode replacement character. - -config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR - int "Range of supported Unicode characters" - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR - help - Any character with Unicode value bigger than this is assumed - to be non-printable on output device. Many applets replace - such chars with substitution character. - - The idea is that many valid printable Unicode chars are - nevertheless are not displayed correctly. Think about - combining charachers, double-wide hieroglyphs, obscure - characters in dozens of ancient scripts... - Many terminals, terminal emulators, xterms etc will fail - to handle them correctly. Choose the smallest value - which suits your needs. - - Typical values are: - 126 - ASCII only - 767 (0x2ff) - there are no combining chars in [0..767] range - (the range includes Latin 1, Latin Ext. A and B), - code is ~700 bytes smaller for this case. - 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, - code is ~300 bytes smaller for this case. - 12799 (0x31ff) - nearly all non-ideographic characters are - available in [0..12799] range, including - East Asian scripts like katakana, hiragana, hangul, - bopomofo... - 0 - off, any valid printable Unicode character will be printed. - -config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS - bool "Allow zero-width Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width of 0 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS - bool "Allow wide Unicode characters on output" - default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option off, any Unicode char with width > 1 - is substituted on output. - -config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - bool "Bidirectional character-aware line input" - default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE - help - With this option on, right-to-left Unicode characters - are treated differently on input (e.g. cursor movement). - -config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE - bool "In bidi input, support non-ASCII neutral chars too" - default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE - depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT - help - In most cases it's enough to treat only ASCII non-letters - (i.e. punctuation, numbers and space) as characters - with neutral directionality. - With this option on, more extensive (and bigger) table - of neutral chars will be used. - -config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN - bool "Make it possible to enter sequences of chars which are not Unicode" - default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN - depends on BUSYBOX_CONFIG_UNICODE_SUPPORT - help - With this option on, on line-editing input (such as used by shells) - invalid UTF-8 bytes are not substituted with the selected - substitution character. - For example, this means that entering 'l', 's', ' ', 0xff, [Enter] - at shell prompt will list file named 0xff (single char name - with char value 255), not file named '?'. - config BUSYBOX_CONFIG_PAM - bool "Support for PAM (Pluggable Authentication Modules)" + bool "Support PAM (Pluggable Authentication Modules)" default BUSYBOX_DEFAULT_PAM help Use PAM in some busybox applets (currently login and httpd) instead of direct access to password database. -config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE - bool "Use sendfile system call" - default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - When enabled, busybox will use the kernel sendfile() function - instead of read/write loops to copy data between file descriptors - (for example, cp command does this a lot). - If sendfile() doesn't work, copying code falls back to read/write - loop. sendfile() was originally implemented for faster I/O - from files to sockets, but since Linux 2.6.33 it was extended - to work for many more file types. - config BUSYBOX_CONFIG_LONG_OPTS - bool "Support for --long-options" + bool "Support --long-options" default BUSYBOX_DEFAULT_LONG_OPTS help Enable this if you want busybox applets to use the gnu --long-option @@ -356,7 +199,7 @@ config BUSYBOX_CONFIG_PID_FILE_PATH specify a pidfile path. config BUSYBOX_CONFIG_FEATURE_SUID - bool "Support for SUID/SGID handling" + bool "Support SUID/SGID handling" default BUSYBOX_DEFAULT_FEATURE_SUID help With this option you can install the busybox binary belonging @@ -496,9 +339,18 @@ config BUSYBOX_CONFIG_FEATURE_HAVE_RPC # This is automatically selected if any of enabled applets need it. # You do not need to select it manually. -endmenu +config BUSYBOX_CONFIG_PLATFORM_LINUX + bool #No description makes it a hidden option + default BUSYBOX_DEFAULT_PLATFORM_LINUX + #help + # For the most part, busybox requires only POSIX compatibility + # from the target system, but some applets and features use + # Linux-specific interfaces. + # + # This is automatically selected if any applet or feature requires + # Linux-specific interfaces. You do not need to select it manually. -menu 'Build Options' +comment 'Build Options' config BUSYBOX_CONFIG_STATIC bool "Build BusyBox as a static binary (no shared libs)" @@ -673,103 +525,7 @@ config BUSYBOX_CONFIG_EXTRA_LDLIBS help Additional LDLIBS to pass to the linker with -l. -endmenu - -menu 'Debugging Options' - -config BUSYBOX_CONFIG_DEBUG - bool "Build BusyBox with extra Debugging symbols" - default BUSYBOX_DEFAULT_DEBUG - help - Say Y here if you wish to examine BusyBox internals while applets are - running. This increases the size of the binary considerably, and - should only be used when doing development. If you are doing - development and want to debug BusyBox, answer Y. - - Most people should answer N. - -config BUSYBOX_CONFIG_DEBUG_PESSIMIZE - bool "Disable compiler optimizations" - default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE - depends on BUSYBOX_CONFIG_DEBUG - help - The compiler's optimization of source code can eliminate and reorder - code, resulting in an executable that's hard to understand when - stepping through it with a debugger. This switches it off, resulting - in a much bigger executable that more closely matches the source - code. - -config BUSYBOX_CONFIG_DEBUG_SANITIZE - bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" - default BUSYBOX_DEFAULT_DEBUG_SANITIZE - help - Say Y here if you want to enable runtime sanitizers. These help - catch bad memory accesses (e.g. buffer overflows), but will make - the executable larger and slow down runtime a bit. - - If you aren't developing/testing busybox, say N here. - -config BUSYBOX_CONFIG_UNIT_TEST - bool "Build unit tests" - default BUSYBOX_DEFAULT_UNIT_TEST - help - Say Y here if you want to build unit tests (both the framework and - test cases) as a Busybox applet. This results in bigger code, so you - probably don't want this option in production builds. - -config BUSYBOX_CONFIG_WERROR - bool "Abort compilation on any warning" - default BUSYBOX_DEFAULT_WERROR - help - Selecting this will add -Werror to gcc command line. - - Most people should answer N. - -choice - prompt "Additional debugging library" - default BUSYBOX_CONFIG_NO_DEBUG_LIB - help - Using an additional debugging library will make BusyBox become - considerable larger and will cause it to run more slowly. You - should always leave this option disabled for production use. - - dmalloc support: - ---------------- - This enables compiling with dmalloc ( http://dmalloc.com/ ) - which is an excellent public domain mem leak and malloc problem - detector. To enable dmalloc, before running busybox you will - want to properly set your environment, for example: - export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile - The 'debug=' value is generated using the following command - dmalloc -p log-stats -p log-non-free -p log-bad-space \ - -p log-elapsed-time -p check-fence -p check-heap \ - -p check-lists -p check-blank -p check-funcs -p realloc-copy \ - -p allow-free-null - - Electric-fence support: - ----------------------- - This enables compiling with Electric-fence support. Electric - fence is another very useful malloc debugging library which uses - your computer's virtual memory hardware to detect illegal memory - accesses. This support will make BusyBox be considerable larger - and run slower, so you should leave this option disabled unless - you are hunting a hard to find memory problem. - - -config BUSYBOX_CONFIG_NO_DEBUG_LIB - bool "None" - -config BUSYBOX_CONFIG_DMALLOC - bool "Dmalloc" - -config BUSYBOX_CONFIG_EFENCE - bool "Electric-fence" - -endchoice - -endmenu - -menu 'Installation Options ("make install" behavior)' +comment 'Installation Options ("make install" behavior)' choice prompt "What kind of applet links to install" @@ -835,12 +591,104 @@ config BUSYBOX_CONFIG_PREFIX help Define your directory to install BusyBox files/subdirs in. +comment 'Debugging Options' + +config BUSYBOX_CONFIG_DEBUG + bool "Build BusyBox with extra Debugging symbols" + default BUSYBOX_DEFAULT_DEBUG + help + Say Y here if you wish to examine BusyBox internals while applets are + running. This increases the size of the binary considerably, and + should only be used when doing development. If you are doing + development and want to debug BusyBox, answer Y. + + Most people should answer N. + +config BUSYBOX_CONFIG_DEBUG_PESSIMIZE + bool "Disable compiler optimizations" + default BUSYBOX_DEFAULT_DEBUG_PESSIMIZE + depends on BUSYBOX_CONFIG_DEBUG + help + The compiler's optimization of source code can eliminate and reorder + code, resulting in an executable that's hard to understand when + stepping through it with a debugger. This switches it off, resulting + in a much bigger executable that more closely matches the source + code. + +config BUSYBOX_CONFIG_DEBUG_SANITIZE + bool "Enable runtime sanitizers (ASAN/LSAN/USAN/etc...)" + default BUSYBOX_DEFAULT_DEBUG_SANITIZE + help + Say Y here if you want to enable runtime sanitizers. These help + catch bad memory accesses (e.g. buffer overflows), but will make + the executable larger and slow down runtime a bit. + + This adds -fsanitize=foo options to gcc command line. + + If you aren't developing/testing busybox, say N here. + +config BUSYBOX_CONFIG_UNIT_TEST + bool "Build unit tests" + default BUSYBOX_DEFAULT_UNIT_TEST + help + Say Y here if you want to build unit tests (both the framework and + test cases) as a Busybox applet. This results in bigger code, so you + probably don't want this option in production builds. + +config BUSYBOX_CONFIG_WERROR + bool "Abort compilation on any warning" + default BUSYBOX_DEFAULT_WERROR + help + This adds -Werror to gcc command line. + + Most people should answer N. + +choice + prompt "Additional debugging library" + default BUSYBOX_CONFIG_NO_DEBUG_LIB + help + Using an additional debugging library will make BusyBox become + considerable larger and will cause it to run more slowly. You + should always leave this option disabled for production use. + + dmalloc support: + ---------------- + This enables compiling with dmalloc ( http://dmalloc.com/ ) + which is an excellent public domain mem leak and malloc problem + detector. To enable dmalloc, before running busybox you will + want to properly set your environment, for example: + export DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile + The 'debug=' value is generated using the following command + dmalloc -p log-stats -p log-non-free -p log-bad-space \ + -p log-elapsed-time -p check-fence -p check-heap \ + -p check-lists -p check-blank -p check-funcs -p realloc-copy \ + -p allow-free-null + + Electric-fence support: + ----------------------- + This enables compiling with Electric-fence support. Electric + fence is another very useful malloc debugging library which uses + your computer's virtual memory hardware to detect illegal memory + accesses. This support will make BusyBox be considerable larger + and run slower, so you should leave this option disabled unless + you are hunting a hard to find memory problem. + + +config BUSYBOX_CONFIG_NO_DEBUG_LIB + bool "None" + +config BUSYBOX_CONFIG_DMALLOC + bool "Dmalloc" + +config BUSYBOX_CONFIG_EFENCE + bool "Electric-fence" + +endchoice + endmenu source libbb/Config.in -endmenu - comment "Applets" source archival/Config.in diff --git a/package/utils/busybox/config/archival/Config.in b/package/utils/busybox/config/archival/Config.in index ff4c2cf6b..ccfb828a8 100644 --- a/package/utils/busybox/config/archival/Config.in +++ b/package/utils/busybox/config/archival/Config.in @@ -9,32 +9,22 @@ menu "Archival Utilities" config BUSYBOX_CONFIG_FEATURE_SEAMLESS_XZ bool "Make tar, rpm, modprobe etc understand .xz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_XZ - help - Make tar, rpm, modprobe etc understand .xz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_LZMA bool "Make tar, rpm, modprobe etc understand .lzma data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_LZMA - help - Make tar, rpm, modprobe etc understand .lzma data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_BZ2 bool "Make tar, rpm, modprobe etc understand .bz2 data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_BZ2 - help - Make tar, rpm, modprobe etc understand .bz2 data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_GZ bool "Make tar, rpm, modprobe etc understand .gz data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_GZ - help - Make tar, rpm, modprobe etc understand .gz data. config BUSYBOX_CONFIG_FEATURE_SEAMLESS_Z - bool "tar, rpm, modprobe etc understand .Z data" + bool "Make tar, rpm, modprobe etc understand .Z data" default BUSYBOX_DEFAULT_FEATURE_SEAMLESS_Z # it is ancient - help - Make tar, rpm, modprobe etc understand .Z data. config BUSYBOX_CONFIG_AR bool "ar" @@ -50,7 +40,7 @@ config BUSYBOX_CONFIG_AR probably say N here: most compilers come with their own ar utility. config BUSYBOX_CONFIG_FEATURE_AR_LONG_FILENAMES - bool "Support for long filenames (not needed for debs)" + bool "Support long filenames (not needed for debs)" default BUSYBOX_DEFAULT_FEATURE_AR_LONG_FILENAMES depends on BUSYBOX_CONFIG_AR help @@ -74,20 +64,27 @@ config BUSYBOX_CONFIG_UNCOMPRESS config BUSYBOX_CONFIG_GUNZIP bool "gunzip" default BUSYBOX_DEFAULT_GUNZIP + select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS help gunzip is used to decompress archives created by gzip. You can use the `-t' option to test the integrity of an archive, without decompressing it. +config BUSYBOX_CONFIG_ZCAT + bool "zcat" + default BUSYBOX_DEFAULT_ZCAT + select BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS + help + Alias to "gunzip -c". + config BUSYBOX_CONFIG_FEATURE_GUNZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS - depends on BUSYBOX_CONFIG_GUNZIP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options. + depends on (BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT) && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_BUNZIP2 bool "bunzip2" default BUSYBOX_DEFAULT_BUNZIP2 + select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS help bunzip2 is a compression utility using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression @@ -97,6 +94,13 @@ config BUSYBOX_CONFIG_BUNZIP2 Unless you have a specific application which requires bunzip2, you should probably say N here. + +config BUSYBOX_CONFIG_BZCAT + bool "bzcat" + default BUSYBOX_DEFAULT_BZCAT + select BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS + help + Alias to "bunzip2 -c". config BUSYBOX_CONFIG_UNLZMA bool "unlzma" default BUSYBOX_DEFAULT_UNLZMA @@ -109,31 +113,47 @@ config BUSYBOX_CONFIG_UNLZMA The BusyBox unlzma applet is limited to decompression only. On an x86 system, this applet adds about 4K. -config BUSYBOX_CONFIG_FEATURE_LZMA_FAST - bool "Optimize unlzma for speed" - default BUSYBOX_DEFAULT_FEATURE_LZMA_FAST - depends on BUSYBOX_CONFIG_UNLZMA +config BUSYBOX_CONFIG_LZCAT + bool "lzcat" + default BUSYBOX_DEFAULT_LZCAT help - This option reduces decompression time by about 25% at the cost of - a 1K bigger binary. + unlzma is a compression utility using the Lempel-Ziv-Markov chain + compression algorithm, and range coding. Compression + is generally considerably better than that achieved by the bzip2 + compressors. + + The BusyBox unlzma applet is limited to decompression only. + On an x86 system, this applet adds about 4K. config BUSYBOX_CONFIG_LZMA - bool "Provide lzma alias which supports only unpacking" + bool "lzma -d" default BUSYBOX_DEFAULT_LZMA - depends on BUSYBOX_CONFIG_UNLZMA help Enable this option if you want commands like "lzma -d" to work. IOW: you'll get lzma applet, but it will always require -d option. + +config BUSYBOX_CONFIG_FEATURE_LZMA_FAST + bool "Optimize for speed" + default BUSYBOX_DEFAULT_FEATURE_LZMA_FAST + depends on BUSYBOX_CONFIG_UNLZMA || BUSYBOX_CONFIG_LZCAT || BUSYBOX_CONFIG_LZMA + help + This option reduces decompression time by about 25% at the cost of + a 1K bigger binary. config BUSYBOX_CONFIG_UNXZ bool "unxz" default BUSYBOX_DEFAULT_UNXZ help unxz is a unlzma successor. +config BUSYBOX_CONFIG_XZCAT + bool "xzcat" + default BUSYBOX_DEFAULT_XZCAT + help + Alias to "unxz -c". + config BUSYBOX_CONFIG_XZ - bool "Provide xz alias which supports only unpacking" + bool "xz -d" default BUSYBOX_DEFAULT_XZ - depends on BUSYBOX_CONFIG_UNXZ help Enable this option if you want commands like "xz -d" to work. IOW: you'll get xz applet, but it will always require -d option. @@ -149,6 +169,15 @@ config BUSYBOX_CONFIG_BZIP2 Unless you have a specific application which requires bzip2, you should probably say N here. + +config BUSYBOX_CONFIG_FEATURE_BZIP2_DECOMPRESS + bool "Enable decompression" + default BUSYBOX_DEFAULT_FEATURE_BZIP2_DECOMPRESS + depends on BUSYBOX_CONFIG_BZIP2 || BUSYBOX_CONFIG_BUNZIP2 || BUSYBOX_CONFIG_BZCAT + help + Enable -d (--decompress) and -t (--test) options for bzip2. + This will be automatically selected if bunzip2 or bzcat is + enabled. config BUSYBOX_CONFIG_CPIO bool "cpio" default BUSYBOX_DEFAULT_CPIO @@ -158,13 +187,13 @@ config BUSYBOX_CONFIG_CPIO cpio has 110 bytes of overheads for every stored file. This implementation of cpio can extract cpio archives created in the - "newc" or "crc" format, it cannot create or modify them. + "newc" or "crc" format. Unless you have a specific application which requires cpio, you should probably say N here. config BUSYBOX_CONFIG_FEATURE_CPIO_O - bool "Support for archive creation" + bool "Support archive creation" default BUSYBOX_DEFAULT_FEATURE_CPIO_O depends on BUSYBOX_CONFIG_CPIO help @@ -172,7 +201,7 @@ config BUSYBOX_CONFIG_FEATURE_CPIO_O format only. config BUSYBOX_CONFIG_FEATURE_CPIO_P - bool "Support for passthrough mode" + bool "Support passthrough mode" default BUSYBOX_DEFAULT_FEATURE_CPIO_P depends on BUSYBOX_CONFIG_FEATURE_CPIO_O help @@ -198,16 +227,6 @@ config BUSYBOX_CONFIG_DPKG_DEB Unless you have a specific application which requires dpkg-deb, say N here. - -config BUSYBOX_CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY - bool "Extract only (-x)" - default BUSYBOX_DEFAULT_FEATURE_DPKG_DEB_EXTRACT_ONLY - depends on BUSYBOX_CONFIG_DPKG_DEB - help - This reduces dpkg-deb to the equivalent of - "ar -p data.tar.gz | tar -zx". However it saves space as none - of the extra dpkg-deb, ar or tar options are needed, they are linked - to internally. config BUSYBOX_CONFIG_GZIP bool "gzip" default BUSYBOX_DEFAULT_GZIP @@ -219,11 +238,9 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_GZIP_LONG_OPTIONS depends on BUSYBOX_CONFIG_GZIP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options, increases size by about 106 Bytes config BUSYBOX_CONFIG_GZIP_FAST - int "Trade memory for gzip speed (0:small,slow - 2:fast,big)" + int "Trade memory for speed (0:small,slow - 2:fast,big)" default BUSYBOX_DEFAULT_GZIP_FAST range 0 2 depends on BUSYBOX_CONFIG_GZIP @@ -243,16 +260,37 @@ config BUSYBOX_CONFIG_FEATURE_GZIP_LEVELS is 6. If levels 1-3 are specified, 4 is used. If this option is not selected, -N options are ignored and -9 is used. + +config BUSYBOX_CONFIG_FEATURE_GZIP_DECOMPRESS + bool "Enable decompression" + default BUSYBOX_DEFAULT_FEATURE_GZIP_DECOMPRESS + depends on BUSYBOX_CONFIG_GZIP || BUSYBOX_CONFIG_GUNZIP || BUSYBOX_CONFIG_ZCAT + help + Enable -d (--decompress) and -t (--test) options for gzip. + This will be automatically selected if gunzip or zcat is + enabled. config BUSYBOX_CONFIG_LZOP bool "lzop" default BUSYBOX_DEFAULT_LZOP help Lzop compression/decompresion. +config BUSYBOX_CONFIG_UNLZOP + bool "unlzop" + default BUSYBOX_DEFAULT_UNLZOP # INCOMPAT: upstream lzop does not provide such tool + help + Lzop decompresion. + +config BUSYBOX_CONFIG_LZOPCAT + bool "lzopcat" + default BUSYBOX_DEFAULT_LZOPCAT # INCOMPAT: upstream lzop does not provide such tool + help + Alias to "unlzop -c". + config BUSYBOX_CONFIG_LZOP_COMPR_HIGH bool "lzop compression levels 7,8,9 (not very useful)" default BUSYBOX_DEFAULT_LZOP_COMPR_HIGH - depends on BUSYBOX_CONFIG_LZOP + depends on BUSYBOX_CONFIG_LZOP || BUSYBOX_CONFIG_UNLZOP || BUSYBOX_CONFIG_LZOPCAT help High levels (7,8,9) of lzop compression. These levels are actually slower than gzip at equivalent compression ratios @@ -275,13 +313,15 @@ config BUSYBOX_CONFIG_TAR create compressed archives. It's probably the most widely used UNIX archive program. +config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS + config BUSYBOX_CONFIG_FEATURE_TAR_CREATE - bool "Enable archive creation" + bool "Enable -c (archive creation)" default BUSYBOX_DEFAULT_FEATURE_TAR_CREATE depends on BUSYBOX_CONFIG_TAR - help - If you enable this option you'll be able to create - tar archives using the `-c' option. config BUSYBOX_CONFIG_FEATURE_TAR_AUTODETECT bool "Autodetect compressed tarballs" @@ -300,7 +340,7 @@ config BUSYBOX_CONFIG_FEATURE_TAR_FROM a list of files to include or exclude from an archive. config BUSYBOX_CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY - bool "Support for old tar header format" + bool "Support old tar header format" default BUSYBOX_DEFAULT_FEATURE_TAR_OLDGNU_COMPATIBILITY depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG help @@ -319,22 +359,12 @@ config BUSYBOX_CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY tarballs still exist. config BUSYBOX_CONFIG_FEATURE_TAR_GNU_EXTENSIONS - bool "Support for GNU tar extensions (long filenames)" + bool "Support GNU tar extensions (long filenames)" default BUSYBOX_DEFAULT_FEATURE_TAR_GNU_EXTENSIONS depends on BUSYBOX_CONFIG_TAR || BUSYBOX_CONFIG_DPKG - help - With this option busybox supports GNU long filenames and - linknames. - -config BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_TAR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options, increases size by about 400 Bytes config BUSYBOX_CONFIG_FEATURE_TAR_TO_COMMAND - bool "Support for writing to an external program" + bool "Support writing to an external program (--to-command)" default BUSYBOX_DEFAULT_FEATURE_TAR_TO_COMMAND depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_FEATURE_TAR_LONG_OPTIONS help @@ -347,20 +377,17 @@ config BUSYBOX_CONFIG_FEATURE_TAR_UNAME_GNAME default BUSYBOX_DEFAULT_FEATURE_TAR_UNAME_GNAME depends on BUSYBOX_CONFIG_TAR help - Enables use of user and group names in tar. This affects contents + Enable use of user and group names in tar. This affects contents listings (-t) and preserving permissions when unpacking (-p). +200 bytes. config BUSYBOX_CONFIG_FEATURE_TAR_NOPRESERVE_TIME - bool "Enable -m (do not preserve time) option" + bool "Enable -m (do not preserve time) GNU option" default BUSYBOX_DEFAULT_FEATURE_TAR_NOPRESERVE_TIME depends on BUSYBOX_CONFIG_TAR - help - With this option busybox supports GNU tar -m - (do not preserve time) option. config BUSYBOX_CONFIG_FEATURE_TAR_SELINUX - bool "Support for extracting SELinux labels" + bool "Support extracting SELinux labels" default BUSYBOX_DEFAULT_FEATURE_TAR_SELINUX depends on BUSYBOX_CONFIG_TAR && BUSYBOX_CONFIG_SELINUX help @@ -373,7 +400,31 @@ config BUSYBOX_CONFIG_UNZIP unzip will list or extract files from a ZIP archive, commonly found on DOS/WIN systems. The default behavior (with no options) is to extract the archive into the - current directory. Use the `-d' option to extract to a - directory of your choice. + current directory. + +config BUSYBOX_CONFIG_FEATURE_UNZIP_CDF + bool "Read and use Central Directory data" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_CDF + depends on BUSYBOX_CONFIG_UNZIP + help + If you know that you only need to deal with simple + ZIP files without deleted/updated files, SFX archives etc, + you can reduce code size by unselecting this option. + To support less trivial ZIPs, say Y. + +config BUSYBOX_CONFIG_FEATURE_UNZIP_BZIP2 + bool "Support compression method 12 (bzip2)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_BZIP2 + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP + +config BUSYBOX_CONFIG_FEATURE_UNZIP_LZMA + bool "Support compression method 14 (lzma)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_LZMA + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP + +config BUSYBOX_CONFIG_FEATURE_UNZIP_XZ + bool "Support compression method 95 (xz)" + default BUSYBOX_DEFAULT_FEATURE_UNZIP_XZ + depends on BUSYBOX_CONFIG_FEATURE_UNZIP_CDF && BUSYBOX_CONFIG_DESKTOP endmenu diff --git a/package/utils/busybox/config/console-tools/Config.in b/package/utils/busybox/config/console-tools/Config.in index 53937d2b5..dcc19a567 100644 --- a/package/utils/busybox/config/console-tools/Config.in +++ b/package/utils/busybox/config/console-tools/Config.in @@ -6,7 +6,6 @@ menu "Console Utilities" - config BUSYBOX_CONFIG_CHVT bool "chvt" default BUSYBOX_DEFAULT_CHVT @@ -14,27 +13,17 @@ config BUSYBOX_CONFIG_CHVT help This program is used to change to another terminal. Example: chvt 4 (change to terminal /dev/tty4) - -config BUSYBOX_CONFIG_FGCONSOLE - bool "fgconsole" - default BUSYBOX_DEFAULT_FGCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program prints active (foreground) console number. - config BUSYBOX_CONFIG_CLEAR bool "clear" default BUSYBOX_DEFAULT_CLEAR help This program clears the terminal screen. - config BUSYBOX_CONFIG_DEALLOCVT bool "deallocvt" default BUSYBOX_DEFAULT_DEALLOCVT select BUSYBOX_CONFIG_PLATFORM_LINUX help This program deallocates unused virtual consoles. - config BUSYBOX_CONFIG_DUMPKMAP bool "dumpkmap" default BUSYBOX_DEFAULT_DUMPKMAP @@ -42,14 +31,18 @@ config BUSYBOX_CONFIG_DUMPKMAP help This program dumps the kernel's keyboard translation table to stdout, in binary format. You can then use loadkmap to load it. - +config BUSYBOX_CONFIG_FGCONSOLE + bool "fgconsole" + default BUSYBOX_DEFAULT_FGCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program prints active (foreground) console number. config BUSYBOX_CONFIG_KBD_MODE bool "kbd_mode" default BUSYBOX_DEFAULT_KBD_MODE select BUSYBOX_CONFIG_PLATFORM_LINUX help This program reports and sets keyboard mode. - config BUSYBOX_CONFIG_LOADFONT bool "loadfont" default BUSYBOX_DEFAULT_LOADFONT @@ -57,61 +50,6 @@ config BUSYBOX_CONFIG_LOADFONT help This program loads a console font from standard input. -config BUSYBOX_CONFIG_LOADKMAP - bool "loadkmap" - default BUSYBOX_DEFAULT_LOADKMAP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program loads a keyboard translation table from - standard input. - -config BUSYBOX_CONFIG_OPENVT - bool "openvt" - default BUSYBOX_DEFAULT_OPENVT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program is used to start a command on an unused - virtual terminal. - -config BUSYBOX_CONFIG_RESET - bool "reset" - default BUSYBOX_DEFAULT_RESET - help - This program is used to reset the terminal screen, if it - gets messed up. - -config BUSYBOX_CONFIG_RESIZE - bool "resize" - default BUSYBOX_DEFAULT_RESIZE - help - This program is used to (re)set the width and height of your current - terminal. - -config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT - bool "Print environment variables" - default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT - depends on BUSYBOX_CONFIG_RESIZE - help - Prints the newly set size (number of columns and rows) of - the terminal. - E.g.: - COLUMNS=80;LINES=44;export COLUMNS LINES; - -config BUSYBOX_CONFIG_SETCONSOLE - bool "setconsole" - default BUSYBOX_DEFAULT_SETCONSOLE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This program redirects the system console to another device, - like the current tty while logged in via telnet. - -config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the setconsole applet. - config BUSYBOX_CONFIG_SETFONT bool "setfont" default BUSYBOX_DEFAULT_SETFONT @@ -134,6 +72,66 @@ config BUSYBOX_CONFIG_DEFAULT_SETFONT_DIR Directory to use if setfont's params are simple filenames (not /path/to/file or ./file). Default is "" (no default directory). +comment "Common options for loadfont and setfont" + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 + bool "Support PSF2 console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT + +config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW + bool "Support old (raw) console fonts" + default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW + depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT +config BUSYBOX_CONFIG_LOADKMAP + bool "loadkmap" + default BUSYBOX_DEFAULT_LOADKMAP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program loads a keyboard translation table from + standard input. +config BUSYBOX_CONFIG_OPENVT + bool "openvt" + default BUSYBOX_DEFAULT_OPENVT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program is used to start a command on an unused + virtual terminal. +config BUSYBOX_CONFIG_RESET + bool "reset" + default BUSYBOX_DEFAULT_RESET + help + This program is used to reset the terminal screen, if it + gets messed up. +config BUSYBOX_CONFIG_RESIZE + bool "resize" + default BUSYBOX_DEFAULT_RESIZE + help + This program is used to (re)set the width and height of your current + terminal. + +config BUSYBOX_CONFIG_FEATURE_RESIZE_PRINT + bool "Print environment variables" + default BUSYBOX_DEFAULT_FEATURE_RESIZE_PRINT + depends on BUSYBOX_CONFIG_RESIZE + help + Prints the newly set size (number of columns and rows) of + the terminal. + E.g.: + COLUMNS=80;LINES=44;export COLUMNS LINES; +config BUSYBOX_CONFIG_SETCONSOLE + bool "setconsole" + default BUSYBOX_DEFAULT_SETCONSOLE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This program redirects the system console to another device, + like the current tty while logged in via telnet. + +config BUSYBOX_CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_SETCONSOLE_LONG_OPTIONS + depends on BUSYBOX_CONFIG_SETCONSOLE && BUSYBOX_CONFIG_LONG_OPTS config BUSYBOX_CONFIG_SETKEYCODES bool "setkeycodes" default BUSYBOX_DEFAULT_SETKEYCODES @@ -141,14 +139,12 @@ config BUSYBOX_CONFIG_SETKEYCODES help This program loads entries into the kernel's scancode-to-keycode map, allowing unusual keyboards to generate usable keycodes. - config BUSYBOX_CONFIG_SETLOGCONS bool "setlogcons" default BUSYBOX_DEFAULT_SETLOGCONS select BUSYBOX_CONFIG_PLATFORM_LINUX help This program redirects the output console of kernel messages. - config BUSYBOX_CONFIG_SHOWKEY bool "showkey" default BUSYBOX_DEFAULT_SHOWKEY @@ -156,21 +152,4 @@ config BUSYBOX_CONFIG_SHOWKEY help Shows keys pressed. -comment "Common options for loadfont and setfont" - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_PSF2 - bool "Support for PSF2 console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_PSF2 - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - help - Support PSF2 console fonts. - -config BUSYBOX_CONFIG_FEATURE_LOADFONT_RAW - bool "Support for old (raw) console fonts" - default BUSYBOX_DEFAULT_FEATURE_LOADFONT_RAW - depends on BUSYBOX_CONFIG_LOADFONT || BUSYBOX_CONFIG_SETFONT - help - Support old (raw) console fonts. - endmenu diff --git a/package/utils/busybox/config/coreutils/Config.in b/package/utils/busybox/config/coreutils/Config.in index ec5611bdf..c4ef1f4fb 100644 --- a/package/utils/busybox/config/coreutils/Config.in +++ b/package/utils/busybox/config/coreutils/Config.in @@ -19,6 +19,70 @@ config BUSYBOX_CONFIG_CAT help cat is used to concatenate files and print them to the standard output. Enable this option if you wish to enable the 'cat' utility. + +config BUSYBOX_CONFIG_FEATURE_CATV + bool "cat -v[etA]" + default BUSYBOX_DEFAULT_FEATURE_CATV + depends on BUSYBOX_CONFIG_CAT + help + Display nonprinting characters as escape sequences +config BUSYBOX_CONFIG_CHGRP + bool "chgrp" + default BUSYBOX_DEFAULT_CHGRP + help + chgrp is used to change the group ownership of files. +config BUSYBOX_CONFIG_CHMOD + bool "chmod" + default BUSYBOX_DEFAULT_CHMOD + help + chmod is used to change the access permission of files. +config BUSYBOX_CONFIG_CHOWN + bool "chown" + default BUSYBOX_DEFAULT_CHOWN + help + chown is used to change the user and/or group ownership + of files. + +config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_CHROOT + bool "chroot" + default BUSYBOX_DEFAULT_CHROOT + help + chroot is used to change the root directory and run a command. + The default command is `/bin/sh'. +config BUSYBOX_CONFIG_CKSUM + bool "cksum" + default BUSYBOX_DEFAULT_CKSUM + help + cksum is used to calculate the CRC32 checksum of a file. +config BUSYBOX_CONFIG_COMM + bool "comm" + default BUSYBOX_DEFAULT_COMM + help + comm is used to compare two files line by line and return + a three-column output. +config BUSYBOX_CONFIG_CP + bool "cp" + default BUSYBOX_DEFAULT_CP + help + cp is used to copy files and directories. + +config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS + depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS + help + Enable long options. + Also add support for --parents option. +config BUSYBOX_CONFIG_CUT + bool "cut" + default BUSYBOX_DEFAULT_CUT + help + cut is used to print selected parts of lines from + each file to stdout. config BUSYBOX_CONFIG_DATE bool "date" default BUSYBOX_DEFAULT_DATE @@ -93,7 +157,7 @@ config BUSYBOX_CONFIG_FEATURE_DD_IBS_OBS default BUSYBOX_DEFAULT_FEATURE_DD_IBS_OBS depends on BUSYBOX_CONFIG_DD help - Enables support for writing a certain number of bytes in and out, + Enable support for writing a certain number of bytes in and out, at a time, and performing conversions on the data stream. config BUSYBOX_CONFIG_FEATURE_DD_STATUS @@ -101,7 +165,144 @@ config BUSYBOX_CONFIG_FEATURE_DD_STATUS default BUSYBOX_DEFAULT_FEATURE_DD_STATUS depends on BUSYBOX_CONFIG_DD help - Enables support for status=noxfer/none option. + Enable support for status=noxfer/none option. +config BUSYBOX_CONFIG_DF + bool "df" + default BUSYBOX_DEFAULT_DF + help + df reports the amount of disk space used and available + on filesystems. + +config BUSYBOX_CONFIG_FEATURE_DF_FANCY + bool "Enable -a, -i, -B" + default BUSYBOX_DEFAULT_FEATURE_DF_FANCY + depends on BUSYBOX_CONFIG_DF + help + -a Show all filesystems + -i Inodes + -B Blocksize +config BUSYBOX_CONFIG_DIRNAME + bool "dirname" + default BUSYBOX_DEFAULT_DIRNAME + help + dirname is used to strip a non-directory suffix from + a file name. +config BUSYBOX_CONFIG_DOS2UNIX + bool "dos2unix" + default BUSYBOX_DEFAULT_DOS2UNIX + help + dos2unix is used to convert a text file from DOS format to + UNIX format, and vice versa. + +config BUSYBOX_CONFIG_UNIX2DOS + bool "unix2dos" + default BUSYBOX_DEFAULT_UNIX2DOS + help + unix2dos is used to convert a text file from UNIX format to + DOS format, and vice versa. +config BUSYBOX_CONFIG_DU + bool "du (default blocksize of 512 bytes)" + default BUSYBOX_DEFAULT_DU + help + du is used to report the amount of disk space used + for specified files. + +config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + bool "Use a default blocksize of 1024 bytes (1K)" + default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K + depends on BUSYBOX_CONFIG_DU + help + Use a blocksize of (1K) instead of the default 512b. +config BUSYBOX_CONFIG_ECHO + bool "echo (basic SuSv3 version taking no options)" + default BUSYBOX_DEFAULT_ECHO + help + echo is used to print a specified string to stdout. + +# this entry also appears in shell/Config.in, next to the echo builtin +config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO + bool "Enable -n and -e options" + default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO + depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_ECHO || BUSYBOX_CONFIG_HUSH_ECHO +config BUSYBOX_CONFIG_ENV + bool "env" + default BUSYBOX_DEFAULT_ENV + help + env is used to set an environment variable and run + a command; without options it displays the current + environment. + +config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_EXPAND + bool "expand" + default BUSYBOX_DEFAULT_EXPAND + help + By default, convert all tabs to spaces. + +config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_UNEXPAND + bool "unexpand" + default BUSYBOX_DEFAULT_UNEXPAND + help + By default, convert only leading sequences of blanks to tabs. + +config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS + depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_EXPR + bool "expr" + default BUSYBOX_DEFAULT_EXPR + help + expr is used to calculate numbers and print the result + to standard output. + +config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 + bool "Extend Posix numbers support to 64 bit" + default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 + depends on BUSYBOX_CONFIG_EXPR + help + Enable 64-bit math support in the expr applet. This will make + the applet slightly larger, but will allow computation with very + large numbers. +config BUSYBOX_CONFIG_FACTOR + bool "factor" + default BUSYBOX_DEFAULT_FACTOR + help + factor factorizes integers +config BUSYBOX_CONFIG_FALSE + bool "false" + default BUSYBOX_DEFAULT_FALSE + help + false returns an exit code of FALSE (1). +config BUSYBOX_CONFIG_FOLD + bool "fold" + default BUSYBOX_DEFAULT_FOLD + help + Wrap text to fit a specific width. +config BUSYBOX_CONFIG_FSYNC + bool "fsync" + default BUSYBOX_DEFAULT_FSYNC + help + fsync is used to flush file-related cached blocks to disk. +config BUSYBOX_CONFIG_HEAD + bool "head" + default BUSYBOX_DEFAULT_HEAD + help + head is used to print the first specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD + bool "Enable -c, -q, and -v" + default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD + depends on BUSYBOX_CONFIG_HEAD config BUSYBOX_CONFIG_HOSTID bool "hostid" default BUSYBOX_DEFAULT_HOSTID @@ -113,16 +314,336 @@ config BUSYBOX_CONFIG_ID default BUSYBOX_DEFAULT_ID help id displays the current user and group ID names. + config BUSYBOX_CONFIG_GROUPS bool "groups" default BUSYBOX_DEFAULT_GROUPS help Print the group names associated with current user id. +config BUSYBOX_CONFIG_INSTALL + bool "install" + default BUSYBOX_DEFAULT_INSTALL + help + Copy files and set attributes. + +config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS + depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_LINK + bool "link" + default BUSYBOX_DEFAULT_LINK + help + link creates hard links between files. +config BUSYBOX_CONFIG_LN + bool "ln" + default BUSYBOX_DEFAULT_LN + help + ln is used to create hard or soft links between files. +config BUSYBOX_CONFIG_LOGNAME + bool "logname" + default BUSYBOX_DEFAULT_LOGNAME + help + logname is used to print the current user's login name. +config BUSYBOX_CONFIG_LS + bool "ls" + default BUSYBOX_DEFAULT_LS + help + ls is used to list the contents of directories. + +config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES + bool "Enable filetyping options (-p and -F)" + default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS + bool "Enable symlinks dereferencing (-L)" + default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE + bool "Enable recursion (-R)" + default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_WIDTH + bool "Enable -w WIDTH and window size autodetection" + default BUSYBOX_DEFAULT_FEATURE_LS_WIDTH + depends on BUSYBOX_CONFIG_LS + +config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES + bool "Sort the file names" + default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES + depends on BUSYBOX_CONFIG_LS + help + Allow ls to sort file names alphabetically. + +config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS + bool "Show file timestamps" + default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display timestamps for files. + +config BUSYBOX_CONFIG_FEATURE_LS_USERNAME + bool "Show username/groupnames" + default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME + depends on BUSYBOX_CONFIG_LS + help + Allow ls to display username/groupname for files. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR + bool "Allow use of color to identify file types" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR + depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS + help + This enables the --color option to ls. + +config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT + bool "Produce colored ls output by default" + default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT + depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR + help + Saying yes here will turn coloring on by default, + even if no "--color" option is given to the ls command. + This is not recommended, since the colors are not + configurable, and the output may not be legible on + many output screens. +config BUSYBOX_CONFIG_MD5SUM + bool "md5sum" + default BUSYBOX_DEFAULT_MD5SUM + help + md5sum is used to print or check MD5 checksums. + +config BUSYBOX_CONFIG_SHA1SUM + bool "sha1sum" + default BUSYBOX_DEFAULT_SHA1SUM + help + Compute and check SHA1 message digest + +config BUSYBOX_CONFIG_SHA256SUM + bool "sha256sum" + default BUSYBOX_DEFAULT_SHA256SUM + help + Compute and check SHA256 message digest + +config BUSYBOX_CONFIG_SHA512SUM + bool "sha512sum" + default BUSYBOX_DEFAULT_SHA512SUM + help + Compute and check SHA512 message digest + +config BUSYBOX_CONFIG_SHA3SUM + bool "sha3sum" + default BUSYBOX_DEFAULT_SHA3SUM + help + Compute and check SHA3 message digest + +comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + +config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK + bool "Enable -c, -s and -w options" + default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK + depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM + help + Enabling the -c options allows files to be checked + against pre-calculated hash values. + -s and -w are useful options when verifying checksums. +config BUSYBOX_CONFIG_MKDIR + bool "mkdir" + default BUSYBOX_DEFAULT_MKDIR + help + mkdir is used to create directories with the specified names. + +config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_MKFIFO + bool "mkfifo" + default BUSYBOX_DEFAULT_MKFIFO + help + mkfifo is used to create FIFOs (named pipes). + The 'mknod' program can also create FIFOs. +config BUSYBOX_CONFIG_MKNOD + bool "mknod" + default BUSYBOX_DEFAULT_MKNOD + help + mknod is used to create FIFOs or block/character special + files with the specified names. +config BUSYBOX_CONFIG_MKTEMP + bool "mktemp" + default BUSYBOX_DEFAULT_MKTEMP + help + mktemp is used to create unique temporary files +config BUSYBOX_CONFIG_MV + bool "mv" + default BUSYBOX_DEFAULT_MV + help + mv is used to move or rename files or directories. + +config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS + depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS +config BUSYBOX_CONFIG_NICE + bool "nice" + default BUSYBOX_DEFAULT_NICE + help + nice runs a program with modified scheduling priority. +config BUSYBOX_CONFIG_NL + bool "nl" + default BUSYBOX_DEFAULT_NL + help + nl is used to number lines of files. +config BUSYBOX_CONFIG_NOHUP + bool "nohup" + default BUSYBOX_DEFAULT_NOHUP + help + run a command immune to hangups, with output to a non-tty. +config BUSYBOX_CONFIG_NPROC + bool "nproc" + default BUSYBOX_DEFAULT_NPROC + help + Print number of CPUs +config BUSYBOX_CONFIG_OD + bool "od" + default BUSYBOX_DEFAULT_OD + help + od is used to dump binary files in octal and other formats. +config BUSYBOX_CONFIG_PASTE + bool "paste" + default BUSYBOX_DEFAULT_PASTE + help + paste is used to paste lines of different files together + and write the result to stdout +config BUSYBOX_CONFIG_PRINTENV + bool "printenv" + default BUSYBOX_DEFAULT_PRINTENV + help + printenv is used to print all or part of environment. +config BUSYBOX_CONFIG_PRINTF + bool "printf" + default BUSYBOX_DEFAULT_PRINTF + help + printf is used to format and print specified strings. + It's similar to `echo' except it has more options. +config BUSYBOX_CONFIG_PWD + bool "pwd" + default BUSYBOX_DEFAULT_PWD + help + pwd is used to print the current directory. +config BUSYBOX_CONFIG_READLINK + bool "readlink" + default BUSYBOX_DEFAULT_READLINK + help + This program reads a symbolic link and returns the name + of the file it points to + +config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW + bool "Enable canonicalization by following all symlinks (-f)" + default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW + depends on BUSYBOX_CONFIG_READLINK + help + Enable the readlink option (-f). +config BUSYBOX_CONFIG_REALPATH + bool "realpath" + default BUSYBOX_DEFAULT_REALPATH + help + Return the canonicalized absolute pathname. + This isn't provided by GNU shellutils, but where else does it belong. +config BUSYBOX_CONFIG_RM + bool "rm" + default BUSYBOX_DEFAULT_RM + help + rm is used to remove files or directories. +config BUSYBOX_CONFIG_RMDIR + bool "rmdir" + default BUSYBOX_DEFAULT_RMDIR + help + rmdir is used to remove empty directories. + +config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS + depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS + help + Support long options for the rmdir applet, including + --ignore-fail-on-non-empty for compatibility with GNU rmdir. +config BUSYBOX_CONFIG_SEQ + bool "seq" + default BUSYBOX_DEFAULT_SEQ + help + print a sequence of numbers +config BUSYBOX_CONFIG_SHRED + bool "shred" + default BUSYBOX_DEFAULT_SHRED + help + Overwrite a file to hide its contents, and optionally delete it config BUSYBOX_CONFIG_SHUF bool "shuf" default BUSYBOX_DEFAULT_SHUF help Generate random permutations +config BUSYBOX_CONFIG_SLEEP + bool "sleep" + default BUSYBOX_DEFAULT_SLEEP + help + sleep is used to pause for a specified number of seconds. + It comes in 3 versions: + - small: takes one integer parameter + - fancy: takes multiple integer arguments with suffixes: + sleep 1d 2h 3m 15s + - fancy with fractional numbers: + sleep 2.3s 4.5h sleeps for 16202.3 seconds + Last one is "the most compatible" with coreutils sleep, + but it adds around 1k of code. + +config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + bool "Enable multiple arguments and s/m/h/d suffixes" + default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP + depends on BUSYBOX_CONFIG_SLEEP + help + Allow sleep to pause for specified minutes, hours, and days. + +config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP + bool "Enable fractional arguments" + default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP + depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP + help + Allow for fractional numeric parameters. +config BUSYBOX_CONFIG_SORT + bool "sort" + default BUSYBOX_DEFAULT_SORT + help + sort is used to sort lines of text in specified files. + +config BUSYBOX_CONFIG_FEATURE_SORT_BIG + bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" + default BUSYBOX_DEFAULT_FEATURE_SORT_BIG + depends on BUSYBOX_CONFIG_SORT + help + Without this, sort only supports -r, -u, and an integer version + of -n. Selecting this adds sort keys, floating point support, and + more. This adds a little over 3k to a nonstatic build on x86. + + The SuSv3 sort standard is available at: + http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html +config BUSYBOX_CONFIG_SPLIT + bool "split" + default BUSYBOX_DEFAULT_SPLIT + help + Split a file into pieces. + +config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY + bool "Fancy extensions" + default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY + depends on BUSYBOX_CONFIG_SPLIT + help + Add support for features not required by SUSv3. + Supports additional suffixes 'b' for 512 bytes, + 'g' for 1GiB for the -b option. config BUSYBOX_CONFIG_STAT bool "stat" default BUSYBOX_DEFAULT_STAT @@ -146,18 +667,64 @@ config BUSYBOX_CONFIG_FEATURE_STAT_FILESYSTEM help Without this, stat will not support the '-f' option to display information about filesystem status. +config BUSYBOX_CONFIG_STTY + bool "stty" + default BUSYBOX_DEFAULT_STTY + help + stty is used to change and print terminal line settings. +config BUSYBOX_CONFIG_SUM + bool "sum" + default BUSYBOX_DEFAULT_SUM + help + checksum and count the blocks in a file config BUSYBOX_CONFIG_SYNC bool "sync" default BUSYBOX_DEFAULT_SYNC help sync is used to flush filesystem buffers. config BUSYBOX_CONFIG_FEATURE_SYNC_FANCY - bool "Enable -d and -f flags (requres syncfs(2) in libc)" + bool "Enable -d and -f flags (requires syncfs(2) in libc)" default BUSYBOX_DEFAULT_FEATURE_SYNC_FANCY depends on BUSYBOX_CONFIG_SYNC help sync -d FILE... executes fdatasync() on each FILE. sync -f FILE... executes syncfs() on each FILE. +config BUSYBOX_CONFIG_TAC + bool "tac" + default BUSYBOX_DEFAULT_TAC + help + tac is used to concatenate and print files in reverse. +config BUSYBOX_CONFIG_TAIL + bool "tail" + default BUSYBOX_DEFAULT_TAIL + help + tail is used to print the last specified number of lines + from files. + +config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL + bool "Enable -q, -s, -v, and -F options" + default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL + depends on BUSYBOX_CONFIG_TAIL + help + These options are provided by GNU tail, but + are not specific in the SUSv3 standard: + -q Never output headers giving file names + -s SEC Wait SEC seconds between reads with -f + -v Always output headers giving file names + -F Same as -f, but keep retrying +config BUSYBOX_CONFIG_TEE + bool "tee" + default BUSYBOX_DEFAULT_TEE + help + tee is used to read from standard input and write + to standard output and files. + +config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO + bool "Enable block I/O (larger/faster) instead of byte I/O" + default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO + depends on BUSYBOX_CONFIG_TEE + help + Enable this option for a faster tee, at expense of size. config BUSYBOX_CONFIG_TEST bool "test" default BUSYBOX_DEFAULT_TEST @@ -166,12 +733,30 @@ config BUSYBOX_CONFIG_TEST returning an appropriate exit code. The bash shell has test built in, ash can build it in optionally. +config BUSYBOX_CONFIG_TEST1 + bool "test as [" + default BUSYBOX_DEFAULT_TEST1 + help + Provide test command in the "[ EXPR ]" form + +config BUSYBOX_CONFIG_TEST2 + bool "test as [[" + default BUSYBOX_DEFAULT_TEST2 + help + Provide test command in the "[[ EXPR ]]" form + config BUSYBOX_CONFIG_FEATURE_TEST_64 bool "Extend test to 64 bit" default BUSYBOX_DEFAULT_FEATURE_TEST_64 - depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_ASH_BUILTIN_TEST || BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_TEST || BUSYBOX_CONFIG_TEST1 || BUSYBOX_CONFIG_TEST2 || BUSYBOX_CONFIG_ASH_TEST || BUSYBOX_CONFIG_HUSH_TEST help Enable 64-bit support in test. +config BUSYBOX_CONFIG_TIMEOUT + bool "timeout" + default BUSYBOX_DEFAULT_TIMEOUT + help + Runs a program and watches it. If it does not terminate in + specified number of seconds, it is sent a signal. config BUSYBOX_CONFIG_TOUCH bool "touch" default BUSYBOX_DEFAULT_TOUCH @@ -218,636 +803,23 @@ config BUSYBOX_CONFIG_FEATURE_TR_EQUIV replace all instances of 'a' with 'xyz'. This option is mainly useful for cases when no other way of expressing a character is possible. +config BUSYBOX_CONFIG_TRUE + bool "true" + default BUSYBOX_DEFAULT_TRUE + help + true returns an exit code of TRUE (0). config BUSYBOX_CONFIG_TRUNCATE bool "truncate" default BUSYBOX_DEFAULT_TRUNCATE help truncate truncates files to a given size. If a file does not exist, it is created unless told otherwise. -config BUSYBOX_CONFIG_UNLINK - bool "unlink" - default BUSYBOX_DEFAULT_UNLINK - help - unlink deletes a file by calling unlink() -config BUSYBOX_CONFIG_BASE64 - bool "base64" - default BUSYBOX_DEFAULT_BASE64 - help - Base64 encode and decode -config BUSYBOX_CONFIG_WHO - bool "who" - default BUSYBOX_DEFAULT_WHO - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - who is used to show who is logged on. -config BUSYBOX_CONFIG_USERS - bool "users" - default BUSYBOX_DEFAULT_USERS - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Print users currently logged on. - -config BUSYBOX_CONFIG_CAL - bool "cal" - default BUSYBOX_DEFAULT_CAL - help - cal is used to display a monthly calendar. - -config BUSYBOX_CONFIG_CATV - bool "catv" - default BUSYBOX_DEFAULT_CATV - help - Display nonprinting characters as escape sequences (like some - implementations' cat -v option). - -config BUSYBOX_CONFIG_CHGRP - bool "chgrp" - default BUSYBOX_DEFAULT_CHGRP - help - chgrp is used to change the group ownership of files. - -config BUSYBOX_CONFIG_CHMOD - bool "chmod" - default BUSYBOX_DEFAULT_CHMOD - help - chmod is used to change the access permission of files. - -config BUSYBOX_CONFIG_CHOWN - bool "chown" - default BUSYBOX_DEFAULT_CHOWN - help - chown is used to change the user and/or group ownership - of files. - -config BUSYBOX_CONFIG_FEATURE_CHOWN_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_CHOWN_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CHOWN && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options - -config BUSYBOX_CONFIG_CHROOT - bool "chroot" - default BUSYBOX_DEFAULT_CHROOT - help - chroot is used to change the root directory and run a command. - The default command is `/bin/sh'. - -config BUSYBOX_CONFIG_CKSUM - bool "cksum" - default BUSYBOX_DEFAULT_CKSUM - help - cksum is used to calculate the CRC32 checksum of a file. - -config BUSYBOX_CONFIG_COMM - bool "comm" - default BUSYBOX_DEFAULT_COMM - help - comm is used to compare two files line by line and return - a three-column output. - -config BUSYBOX_CONFIG_CP - bool "cp" - default BUSYBOX_DEFAULT_CP - help - cp is used to copy files and directories. - -config BUSYBOX_CONFIG_FEATURE_CP_LONG_OPTIONS - bool "Enable long options for cp" - default BUSYBOX_DEFAULT_FEATURE_CP_LONG_OPTIONS - depends on BUSYBOX_CONFIG_CP && BUSYBOX_CONFIG_LONG_OPTS - help - Enable long options for cp. - Also add support for --parents option. - -config BUSYBOX_CONFIG_CUT - bool "cut" - default BUSYBOX_DEFAULT_CUT - help - cut is used to print selected parts of lines from - each file to stdout. - -config BUSYBOX_CONFIG_DF - bool "df" - default BUSYBOX_DEFAULT_DF - help - df reports the amount of disk space used and available - on filesystems. - -config BUSYBOX_CONFIG_FEATURE_DF_FANCY - bool "Enable -a, -i, -B" - default BUSYBOX_DEFAULT_FEATURE_DF_FANCY - depends on BUSYBOX_CONFIG_DF - help - This option enables -a, -i and -B. - - -a Show all filesystems - -i Inodes - -B Blocksize - -config BUSYBOX_CONFIG_DIRNAME - bool "dirname" - default BUSYBOX_DEFAULT_DIRNAME - help - dirname is used to strip a non-directory suffix from - a file name. - -config BUSYBOX_CONFIG_DOS2UNIX - bool "dos2unix/unix2dos" - default BUSYBOX_DEFAULT_DOS2UNIX - help - dos2unix is used to convert a text file from DOS format to - UNIX format, and vice versa. - -config BUSYBOX_CONFIG_UNIX2DOS - bool - default BUSYBOX_DEFAULT_UNIX2DOS - depends on BUSYBOX_CONFIG_DOS2UNIX - help - unix2dos is used to convert a text file from UNIX format to - DOS format, and vice versa. - -config BUSYBOX_CONFIG_DU - bool "du (default blocksize of 512 bytes)" - default BUSYBOX_DEFAULT_DU - help - du is used to report the amount of disk space used - for specified files. - -config BUSYBOX_CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - bool "Use a default blocksize of 1024 bytes (1K)" - default BUSYBOX_DEFAULT_FEATURE_DU_DEFAULT_BLOCKSIZE_1K - depends on BUSYBOX_CONFIG_DU - help - Use a blocksize of (1K) instead of the default 512b. - -config BUSYBOX_CONFIG_ECHO - bool "echo (basic SuSv3 version taking no options)" - default BUSYBOX_DEFAULT_ECHO - help - echo is used to print a specified string to stdout. - -# this entry also appears in shell/Config.in, next to the echo builtin -config BUSYBOX_CONFIG_FEATURE_FANCY_ECHO - bool "Enable echo options (-n and -e)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_ECHO - depends on BUSYBOX_CONFIG_ECHO || BUSYBOX_CONFIG_ASH_BUILTIN_ECHO || BUSYBOX_CONFIG_HUSH - help - This adds options (-n and -e) to echo. - -config BUSYBOX_CONFIG_ENV - bool "env" - default BUSYBOX_DEFAULT_ENV - help - env is used to set an environment variable and run - a command; without options it displays the current - environment. - -config BUSYBOX_CONFIG_FEATURE_ENV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_ENV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_ENV && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the env applet. - -config BUSYBOX_CONFIG_EXPAND - bool "expand" - default BUSYBOX_DEFAULT_EXPAND - help - By default, convert all tabs to spaces. - -config BUSYBOX_CONFIG_FEATURE_EXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_EXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_EXPAND && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the expand applet. - -config BUSYBOX_CONFIG_EXPR - bool "expr" - default BUSYBOX_DEFAULT_EXPR - help - expr is used to calculate numbers and print the result - to standard output. - -config BUSYBOX_CONFIG_EXPR_MATH_SUPPORT_64 - bool "Extend Posix numbers support to 64 bit" - default BUSYBOX_DEFAULT_EXPR_MATH_SUPPORT_64 - depends on BUSYBOX_CONFIG_EXPR - help - Enable 64-bit math support in the expr applet. This will make - the applet slightly larger, but will allow computation with very - large numbers. - -config BUSYBOX_CONFIG_FALSE - bool "false" - default BUSYBOX_DEFAULT_FALSE - help - false returns an exit code of FALSE (1). - -config BUSYBOX_CONFIG_FOLD - bool "fold" - default BUSYBOX_DEFAULT_FOLD - help - Wrap text to fit a specific width. - -config BUSYBOX_CONFIG_FSYNC - bool "fsync" - default BUSYBOX_DEFAULT_FSYNC - help - fsync is used to flush file-related cached blocks to disk. - -config BUSYBOX_CONFIG_HEAD - bool "head" - default BUSYBOX_DEFAULT_HEAD - help - head is used to print the first specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_HEAD - bool "Enable head options (-c, -q, and -v)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_HEAD - depends on BUSYBOX_CONFIG_HEAD - help - This enables the head options (-c, -q, and -v). - -config BUSYBOX_CONFIG_INSTALL - bool "install" - default BUSYBOX_DEFAULT_INSTALL - help - Copy files and set attributes. - -config BUSYBOX_CONFIG_FEATURE_INSTALL_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_INSTALL_LONG_OPTIONS - depends on BUSYBOX_CONFIG_INSTALL && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the install applet. - -####config LENGTH -#### bool "length" -#### default y -#### help -#### length is used to print out the length of a specified string. - -config BUSYBOX_CONFIG_LN - bool "ln" - default BUSYBOX_DEFAULT_LN - help - ln is used to create hard or soft links between files. - -config BUSYBOX_CONFIG_LOGNAME - bool "logname" - default BUSYBOX_DEFAULT_LOGNAME - help - logname is used to print the current user's login name. - -config BUSYBOX_CONFIG_LS - bool "ls" - default BUSYBOX_DEFAULT_LS - help - ls is used to list the contents of directories. - -config BUSYBOX_CONFIG_FEATURE_LS_FILETYPES - bool "Enable filetyping options (-p and -F)" - default BUSYBOX_DEFAULT_FEATURE_LS_FILETYPES - depends on BUSYBOX_CONFIG_LS - help - Enable the ls options (-p and -F). - -config BUSYBOX_CONFIG_FEATURE_LS_FOLLOWLINKS - bool "Enable symlinks dereferencing (-L)" - default BUSYBOX_DEFAULT_FEATURE_LS_FOLLOWLINKS - depends on BUSYBOX_CONFIG_LS - help - Enable the ls option (-L). - -config BUSYBOX_CONFIG_FEATURE_LS_RECURSIVE - bool "Enable recursion (-R)" - default BUSYBOX_DEFAULT_FEATURE_LS_RECURSIVE - depends on BUSYBOX_CONFIG_LS - help - Enable the ls option (-R). - -config BUSYBOX_CONFIG_FEATURE_LS_SORTFILES - bool "Sort the file names" - default BUSYBOX_DEFAULT_FEATURE_LS_SORTFILES - depends on BUSYBOX_CONFIG_LS - help - Allow ls to sort file names alphabetically. - -config BUSYBOX_CONFIG_FEATURE_LS_TIMESTAMPS - bool "Show file timestamps" - default BUSYBOX_DEFAULT_FEATURE_LS_TIMESTAMPS - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display timestamps for files. - -config BUSYBOX_CONFIG_FEATURE_LS_USERNAME - bool "Show username/groupnames" - default BUSYBOX_DEFAULT_FEATURE_LS_USERNAME - depends on BUSYBOX_CONFIG_LS - help - Allow ls to display username/groupname for files. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR - bool "Allow use of color to identify file types" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR - depends on BUSYBOX_CONFIG_LS && BUSYBOX_CONFIG_LONG_OPTS - help - This enables the --color option to ls. - -config BUSYBOX_CONFIG_FEATURE_LS_COLOR_IS_DEFAULT - bool "Produce colored ls output by default" - default BUSYBOX_DEFAULT_FEATURE_LS_COLOR_IS_DEFAULT - depends on BUSYBOX_CONFIG_FEATURE_LS_COLOR - help - Saying yes here will turn coloring on by default, - even if no "--color" option is given to the ls command. - This is not recommended, since the colors are not - configurable, and the output may not be legible on - many output screens. - -config BUSYBOX_CONFIG_MD5SUM - bool "md5sum" - default BUSYBOX_DEFAULT_MD5SUM - help - md5sum is used to print or check MD5 checksums. - -config BUSYBOX_CONFIG_MKDIR - bool "mkdir" - default BUSYBOX_DEFAULT_MKDIR - help - mkdir is used to create directories with the specified names. - -config BUSYBOX_CONFIG_FEATURE_MKDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MKDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MKDIR && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the mkdir applet. - -config BUSYBOX_CONFIG_MKFIFO - bool "mkfifo" - default BUSYBOX_DEFAULT_MKFIFO - help - mkfifo is used to create FIFOs (named pipes). - The `mknod' program can also create FIFOs. - -config BUSYBOX_CONFIG_MKNOD - bool "mknod" - default BUSYBOX_DEFAULT_MKNOD - help - mknod is used to create FIFOs or block/character special - files with the specified names. - -config BUSYBOX_CONFIG_MV - bool "mv" - default BUSYBOX_DEFAULT_MV - help - mv is used to move or rename files or directories. - -config BUSYBOX_CONFIG_FEATURE_MV_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_MV_LONG_OPTIONS - depends on BUSYBOX_CONFIG_MV && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the mv applet. - -config BUSYBOX_CONFIG_NICE - bool "nice" - default BUSYBOX_DEFAULT_NICE - help - nice runs a program with modified scheduling priority. - -config BUSYBOX_CONFIG_NOHUP - bool "nohup" - default BUSYBOX_DEFAULT_NOHUP - help - run a command immune to hangups, with output to a non-tty. - -config BUSYBOX_CONFIG_OD - bool "od" - default BUSYBOX_DEFAULT_OD - help - od is used to dump binary files in octal and other formats. - -config BUSYBOX_CONFIG_PRINTENV - bool "printenv" - default BUSYBOX_DEFAULT_PRINTENV - help - printenv is used to print all or part of environment. - -config BUSYBOX_CONFIG_PRINTF - bool "printf" - default BUSYBOX_DEFAULT_PRINTF - help - printf is used to format and print specified strings. - It's similar to `echo' except it has more options. - -config BUSYBOX_CONFIG_PWD - bool "pwd" - default BUSYBOX_DEFAULT_PWD - help - pwd is used to print the current directory. - -config BUSYBOX_CONFIG_READLINK - bool "readlink" - default BUSYBOX_DEFAULT_READLINK - help - This program reads a symbolic link and returns the name - of the file it points to - -config BUSYBOX_CONFIG_FEATURE_READLINK_FOLLOW - bool "Enable canonicalization by following all symlinks (-f)" - default BUSYBOX_DEFAULT_FEATURE_READLINK_FOLLOW - depends on BUSYBOX_CONFIG_READLINK - help - Enable the readlink option (-f). - -config BUSYBOX_CONFIG_REALPATH - bool "realpath" - default BUSYBOX_DEFAULT_REALPATH - help - Return the canonicalized absolute pathname. - This isn't provided by GNU shellutils, but where else does it belong. - -config BUSYBOX_CONFIG_RM - bool "rm" - default BUSYBOX_DEFAULT_RM - help - rm is used to remove files or directories. - -config BUSYBOX_CONFIG_RMDIR - bool "rmdir" - default BUSYBOX_DEFAULT_RMDIR - help - rmdir is used to remove empty directories. - -config BUSYBOX_CONFIG_FEATURE_RMDIR_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_RMDIR_LONG_OPTIONS - depends on BUSYBOX_CONFIG_RMDIR && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the rmdir applet, including - --ignore-fail-on-non-empty for compatibility with GNU rmdir. - -config BUSYBOX_CONFIG_SEQ - bool "seq" - default BUSYBOX_DEFAULT_SEQ - help - print a sequence of numbers - -config BUSYBOX_CONFIG_SHA1SUM - bool "sha1sum" - default BUSYBOX_DEFAULT_SHA1SUM - help - Compute and check SHA1 message digest - -config BUSYBOX_CONFIG_SHA256SUM - bool "sha256sum" - default BUSYBOX_DEFAULT_SHA256SUM - help - Compute and check SHA256 message digest - -config BUSYBOX_CONFIG_SHA512SUM - bool "sha512sum" - default BUSYBOX_DEFAULT_SHA512SUM - help - Compute and check SHA512 message digest - -config BUSYBOX_CONFIG_SHA3SUM - bool "sha3sum" - default BUSYBOX_DEFAULT_SHA3SUM - help - Compute and check SHA3 (512-bit) message digest - -config BUSYBOX_CONFIG_SLEEP - bool "sleep" - default BUSYBOX_DEFAULT_SLEEP - help - sleep is used to pause for a specified number of seconds. - It comes in 3 versions: - - small: takes one integer parameter - - fancy: takes multiple integer arguments with suffixes: - sleep 1d 2h 3m 15s - - fancy with fractional numbers: - sleep 2.3s 4.5h sleeps for 16202.3 seconds - Last one is "the most compatible" with coreutils sleep, - but it adds around 1k of code. - -config BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - bool "Enable multiple arguments and s/m/h/d suffixes" - default BUSYBOX_DEFAULT_FEATURE_FANCY_SLEEP - depends on BUSYBOX_CONFIG_SLEEP - help - Allow sleep to pause for specified minutes, hours, and days. - -config BUSYBOX_CONFIG_FEATURE_FLOAT_SLEEP - bool "Enable fractional arguments" - default BUSYBOX_DEFAULT_FEATURE_FLOAT_SLEEP - depends on BUSYBOX_CONFIG_FEATURE_FANCY_SLEEP - help - Allow for fractional numeric parameters. - -config BUSYBOX_CONFIG_SORT - bool "sort" - default BUSYBOX_DEFAULT_SORT - help - sort is used to sort lines of text in specified files. - -config BUSYBOX_CONFIG_FEATURE_SORT_BIG - bool "Full SuSv3 compliant sort (support -ktcsbdfiozgM)" - default BUSYBOX_DEFAULT_FEATURE_SORT_BIG - depends on BUSYBOX_CONFIG_SORT - help - Without this, sort only supports -r, -u, and an integer version - of -n. Selecting this adds sort keys, floating point support, and - more. This adds a little over 3k to a nonstatic build on x86. - - The SuSv3 sort standard is available at: - http://www.opengroup.org/onlinepubs/007904975/utilities/sort.html - -config BUSYBOX_CONFIG_SPLIT - bool "split" - default BUSYBOX_DEFAULT_SPLIT - help - split a file into pieces. - -config BUSYBOX_CONFIG_FEATURE_SPLIT_FANCY - bool "Fancy extensions" - default BUSYBOX_DEFAULT_FEATURE_SPLIT_FANCY - depends on BUSYBOX_CONFIG_SPLIT - help - Add support for features not required by SUSv3. - Supports additional suffixes 'b' for 512 bytes, - 'g' for 1GiB for the -b option. - -config BUSYBOX_CONFIG_STTY - bool "stty" - default BUSYBOX_DEFAULT_STTY - help - stty is used to change and print terminal line settings. - -config BUSYBOX_CONFIG_SUM - bool "sum" - default BUSYBOX_DEFAULT_SUM - help - checksum and count the blocks in a file - -config BUSYBOX_CONFIG_TAC - bool "tac" - default BUSYBOX_DEFAULT_TAC - help - tac is used to concatenate and print files in reverse. - -config BUSYBOX_CONFIG_TAIL - bool "tail" - default BUSYBOX_DEFAULT_TAIL - help - tail is used to print the last specified number of lines - from files. - -config BUSYBOX_CONFIG_FEATURE_FANCY_TAIL - bool "Enable extra tail options (-q, -s, -v, and -F)" - default BUSYBOX_DEFAULT_FEATURE_FANCY_TAIL - depends on BUSYBOX_CONFIG_TAIL - help - The options (-q, -s, -v and -F) are provided by GNU tail, but - are not specific in the SUSv3 standard. - - -q Never output headers giving file names - -s SEC Wait SEC seconds between reads with -f - -v Always output headers giving file names - -F Same as -f, but keep retrying - -config BUSYBOX_CONFIG_TEE - bool "tee" - default BUSYBOX_DEFAULT_TEE - help - tee is used to read from standard input and write - to standard output and files. - -config BUSYBOX_CONFIG_FEATURE_TEE_USE_BLOCK_IO - bool "Enable block I/O (larger/faster) instead of byte I/O" - default BUSYBOX_DEFAULT_FEATURE_TEE_USE_BLOCK_IO - depends on BUSYBOX_CONFIG_TEE - help - Enable this option for a faster tee, at expense of size. - -config BUSYBOX_CONFIG_TRUE - bool "true" - default BUSYBOX_DEFAULT_TRUE - help - true returns an exit code of TRUE (0). - config BUSYBOX_CONFIG_TTY bool "tty" default BUSYBOX_DEFAULT_TTY help tty is used to print the name of the current terminal to standard output. - config BUSYBOX_CONFIG_UNAME bool "uname" default BUSYBOX_DEFAULT_UNAME @@ -861,44 +833,36 @@ config BUSYBOX_CONFIG_UNAME_OSNAME help Sets the operating system name reported by uname -o. The default BUSYBOX_DEFAULT_UNAME_OSNAME "GNU/Linux". - -config BUSYBOX_CONFIG_UNEXPAND - bool "unexpand" - default BUSYBOX_DEFAULT_UNEXPAND - help - By default, convert only leading sequences of blanks to tabs. - -config BUSYBOX_CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_UNEXPAND_LONG_OPTIONS - depends on BUSYBOX_CONFIG_UNEXPAND && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the unexpand applet. - config BUSYBOX_CONFIG_UNIQ bool "uniq" default BUSYBOX_DEFAULT_UNIQ help uniq is used to remove duplicate lines from a sorted file. - +config BUSYBOX_CONFIG_UNLINK + bool "unlink" + default BUSYBOX_DEFAULT_UNLINK + help + unlink deletes a file by calling unlink() config BUSYBOX_CONFIG_USLEEP bool "usleep" default BUSYBOX_DEFAULT_USLEEP help usleep is used to pause for a specified number of microseconds. - config BUSYBOX_CONFIG_UUDECODE bool "uudecode" default BUSYBOX_DEFAULT_UUDECODE help uudecode is used to decode a uuencoded file. - +config BUSYBOX_CONFIG_BASE64 + bool "base64" + default BUSYBOX_DEFAULT_BASE64 + help + Base64 encode and decode config BUSYBOX_CONFIG_UUENCODE bool "uuencode" default BUSYBOX_DEFAULT_UUENCODE help uuencode is used to uuencode a file. - config BUSYBOX_CONFIG_WC bool "wc" default BUSYBOX_DEFAULT_WC @@ -907,19 +871,37 @@ config BUSYBOX_CONFIG_WC in specified files. config BUSYBOX_CONFIG_FEATURE_WC_LARGE - bool "Support very large files in wc" + bool "Support very large counts" default BUSYBOX_DEFAULT_FEATURE_WC_LARGE depends on BUSYBOX_CONFIG_WC help - Use "unsigned long long" in wc for counter variables. + Use "unsigned long long" for counter variables. +config BUSYBOX_CONFIG_WHO + bool "who" + default BUSYBOX_DEFAULT_WHO + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + who is used to show who is logged on. +config BUSYBOX_CONFIG_W + bool "w" + default BUSYBOX_DEFAULT_W + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + w is used to show who is logged on. + +config BUSYBOX_CONFIG_USERS + bool "users" + default BUSYBOX_DEFAULT_USERS + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Print users currently logged on. config BUSYBOX_CONFIG_WHOAMI bool "whoami" default BUSYBOX_DEFAULT_WHOAMI help whoami is used to print the username of the current user id (same as id -un). - config BUSYBOX_CONFIG_YES bool "yes" default BUSYBOX_DEFAULT_YES @@ -947,41 +929,14 @@ config BUSYBOX_CONFIG_FEATURE_PRESERVE_HARDLINKS help Allow cp and mv to preserve hard links. -comment "Common options for ls, more and telnet" - depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET - -config BUSYBOX_CONFIG_FEATURE_AUTOWIDTH - bool "Calculate terminal & column widths" - default BUSYBOX_DEFAULT_FEATURE_AUTOWIDTH - depends on BUSYBOX_CONFIG_LS || BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TELNET - help - This option allows utilities such as 'ls', 'more' and 'telnet' - to determine the width of the screen, which can allow them to - display additional text or avoid wrapping text onto the next line. - If you leave this disabled, your utilities will be especially - primitive and will be unable to determine the current screen width. - comment "Common options for df, du, ls" depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS config BUSYBOX_CONFIG_FEATURE_HUMAN_READABLE - bool "Support for human readable output (example 13k, 23M, 235G)" + bool "Support human readable output (example 13k, 23M, 235G)" default BUSYBOX_DEFAULT_FEATURE_HUMAN_READABLE depends on BUSYBOX_CONFIG_DF || BUSYBOX_CONFIG_DU || BUSYBOX_CONFIG_LS help Allow df, du, and ls to have human readable output. -comment "Common options for md5sum, sha1sum, sha256sum, sha512sum, sha3sum" - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - -config BUSYBOX_CONFIG_FEATURE_MD5_SHA1_SUM_CHECK - bool "Enable -c, -s and -w options" - default BUSYBOX_DEFAULT_FEATURE_MD5_SHA1_SUM_CHECK - depends on BUSYBOX_CONFIG_MD5SUM || BUSYBOX_CONFIG_SHA1SUM || BUSYBOX_CONFIG_SHA256SUM || BUSYBOX_CONFIG_SHA512SUM || BUSYBOX_CONFIG_SHA3SUM - help - Enabling the -c options allows files to be checked - against pre-calculated hash values. - - -s and -w are useful options when verifying checksums. - endmenu diff --git a/package/utils/busybox/config/debianutils/Config.in b/package/utils/busybox/config/debianutils/Config.in index d39c60f43..6b9de0de5 100644 --- a/package/utils/busybox/config/debianutils/Config.in +++ b/package/utils/busybox/config/debianutils/Config.in @@ -6,11 +6,6 @@ menu "Debian Utilities" -config BUSYBOX_CONFIG_MKTEMP - bool "mktemp" - default BUSYBOX_DEFAULT_MKTEMP - help - mktemp is used to create unique temporary files config BUSYBOX_CONFIG_PIPE_PROGRESS bool "pipe_progress" default BUSYBOX_DEFAULT_PIPE_PROGRESS @@ -35,8 +30,6 @@ config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUN_PARTS_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUN_PARTS && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the run-parts applet. config BUSYBOX_CONFIG_FEATURE_RUN_PARTS_FANCY bool "Support additional arguments" @@ -54,22 +47,19 @@ config BUSYBOX_CONFIG_START_STOP_DAEMON termination of system-level processes, usually the ones started during the startup of the system. +config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS + depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS + config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_FANCY bool "Support additional arguments" default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_FANCY depends on BUSYBOX_CONFIG_START_STOP_DAEMON help - Support additional arguments. -o|--oknodo ignored since we exit with 0 anyway -v|--verbose -N|--nicelevel N - -config BUSYBOX_CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_START_STOP_DAEMON_LONG_OPTIONS - depends on BUSYBOX_CONFIG_START_STOP_DAEMON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the start-stop-daemon applet. config BUSYBOX_CONFIG_WHICH bool "which" default BUSYBOX_DEFAULT_WHICH diff --git a/package/utils/busybox/config/editors/Config.in b/package/utils/busybox/config/editors/Config.in index 6ae361f7f..da4eaedd7 100644 --- a/package/utils/busybox/config/editors/Config.in +++ b/package/utils/busybox/config/editors/Config.in @@ -49,8 +49,6 @@ config BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_DIFF_LONG_OPTIONS depends on BUSYBOX_CONFIG_DIFF && BUSYBOX_CONFIG_LONG_OPTS - help - Enable use of long options. config BUSYBOX_CONFIG_FEATURE_DIFF_DIR bool "Enable directory support" @@ -87,7 +85,7 @@ config BUSYBOX_CONFIG_VI you may wish to use something else. config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN - int "Maximum screen width in vi" + int "Maximum screen width" range 256 16384 default BUSYBOX_DEFAULT_FEATURE_VI_MAX_LEN depends on BUSYBOX_CONFIG_VI @@ -96,7 +94,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_MAX_LEN Make it smaller than 4k only if you are very limited on memory. config BUSYBOX_CONFIG_FEATURE_VI_8BIT - bool "Allow vi to display 8-bit chars (otherwise shows dots)" + bool "Allow to display 8-bit chars (otherwise shows dots)" default BUSYBOX_DEFAULT_FEATURE_VI_8BIT depends on BUSYBOX_CONFIG_VI help @@ -110,7 +108,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_COLON default BUSYBOX_DEFAULT_FEATURE_VI_COLON depends on BUSYBOX_CONFIG_VI help - Enable a limited set of colon commands for vi. This does not + Enable a limited set of colon commands. This does not provide an "ex" mode. config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK @@ -118,16 +116,14 @@ config BUSYBOX_CONFIG_FEATURE_VI_YANKMARK default BUSYBOX_DEFAULT_FEATURE_VI_YANKMARK depends on BUSYBOX_CONFIG_VI help - This will enable you to use yank and put, as well as mark in - busybox vi. + This will enable you to use yank and put, as well as mark. config BUSYBOX_CONFIG_FEATURE_VI_SEARCH bool "Enable search and replace cmds" default BUSYBOX_DEFAULT_FEATURE_VI_SEARCH depends on BUSYBOX_CONFIG_VI help - Select this if you wish to be able to do search and replace in - busybox vi. + Select this if you wish to be able to do search and replace. config BUSYBOX_CONFIG_FEATURE_VI_REGEX_SEARCH bool "Enable regex in search and replace" @@ -141,16 +137,15 @@ config BUSYBOX_CONFIG_FEATURE_VI_USE_SIGNALS default BUSYBOX_DEFAULT_FEATURE_VI_USE_SIGNALS depends on BUSYBOX_CONFIG_VI help - Selecting this option will make busybox vi signal aware. This will - make busybox vi support SIGWINCH to deal with Window Changes, catch - Ctrl-Z and Ctrl-C and alarms. + Selecting this option will make vi signal aware. This will support + SIGWINCH to deal with Window Changes, catch ^Z and ^C and alarms. config BUSYBOX_CONFIG_FEATURE_VI_DOT_CMD bool "Remember previous cmd and \".\" cmd" default BUSYBOX_DEFAULT_FEATURE_VI_DOT_CMD depends on BUSYBOX_CONFIG_VI help - Make busybox vi remember the last command and be able to repeat it. + Make vi remember the last command and be able to repeat it. config BUSYBOX_CONFIG_FEATURE_VI_READONLY bool "Enable -R option and \"view\" mode" @@ -161,25 +156,23 @@ config BUSYBOX_CONFIG_FEATURE_VI_READONLY open a file in read-only mode. config BUSYBOX_CONFIG_FEATURE_VI_SETOPTS - bool "Enable set-able options, ai ic showmatch" + bool "Enable settable options, ai ic showmatch" default BUSYBOX_DEFAULT_FEATURE_VI_SETOPTS depends on BUSYBOX_CONFIG_VI help Enable the editor to set some (ai, ic, showmatch) options. config BUSYBOX_CONFIG_FEATURE_VI_SET - bool "Support for :set" + bool "Support :set" default BUSYBOX_DEFAULT_FEATURE_VI_SET depends on BUSYBOX_CONFIG_VI - help - Support for ":set". config BUSYBOX_CONFIG_FEATURE_VI_WIN_RESIZE bool "Handle window resize" default BUSYBOX_DEFAULT_FEATURE_VI_WIN_RESIZE depends on BUSYBOX_CONFIG_VI help - Make busybox vi behave nicely with terminals that get resized. + Behave nicely with terminals that get resized. config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL bool "Use 'tell me cursor position' ESC sequence to measure window" @@ -190,15 +183,16 @@ config BUSYBOX_CONFIG_FEATURE_VI_ASK_TERMINAL this option makes vi perform a last-ditch effort to find it: position cursor to 999,999 and ask terminal to report real cursor position using "ESC [ 6 n" escape sequence, then read stdin. - This is not clean but helps a lot on serial lines and such. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO - bool "Support undo command 'u'" + bool "Support undo command \"u\"" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO depends on BUSYBOX_CONFIG_VI help Support the 'u' command to undo insertion, deletion, and replacement of text. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE bool "Enable undo operation queuing" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE @@ -209,6 +203,7 @@ config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE reached, the contents of the queue are committed to the undo stack. This increases the size of the undo code and allows some undo operations (especially un-typing/backspacing) to be far more useful. + config BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE_MAX int "Maximum undo character queue size" default BUSYBOX_DEFAULT_FEATURE_VI_UNDO_QUEUE_MAX @@ -228,7 +223,7 @@ config BUSYBOX_CONFIG_FEATURE_ALLOW_EXEC default BUSYBOX_DEFAULT_FEATURE_ALLOW_EXEC depends on BUSYBOX_CONFIG_VI || BUSYBOX_CONFIG_AWK help - Enables vi and awk features which allows user to execute + Enables vi and awk features which allow user to execute shell commands (using system() C call). endmenu diff --git a/package/utils/busybox/config/findutils/Config.in b/package/utils/busybox/config/findutils/Config.in index 85ee1db2c..3393adbe3 100644 --- a/package/utils/busybox/config/findutils/Config.in +++ b/package/utils/busybox/config/findutils/Config.in @@ -42,8 +42,6 @@ config BUSYBOX_CONFIG_FEATURE_FIND_PERM bool "Enable -perm: permissions matching" default BUSYBOX_DEFAULT_FEATURE_FIND_PERM depends on BUSYBOX_CONFIG_FIND - help - Enable searching based on file permissions. config BUSYBOX_CONFIG_FEATURE_FIND_TYPE bool "Enable -type: file type matching (file/dir/link/...)" @@ -57,15 +55,11 @@ config BUSYBOX_CONFIG_FEATURE_FIND_XDEV bool "Enable -xdev: 'stay in filesystem'" default BUSYBOX_DEFAULT_FEATURE_FIND_XDEV depends on BUSYBOX_CONFIG_FIND - help - This option allows find to restrict searches to a single filesystem. config BUSYBOX_CONFIG_FEATURE_FIND_MAXDEPTH bool "Enable -mindepth N and -maxdepth N" default BUSYBOX_DEFAULT_FEATURE_FIND_MAXDEPTH depends on BUSYBOX_CONFIG_FIND - help - This option enables -mindepth N and -maxdepth N option. config BUSYBOX_CONFIG_FEATURE_FIND_NEWER bool "Enable -newer: compare file modification times" @@ -79,8 +73,6 @@ config BUSYBOX_CONFIG_FEATURE_FIND_INUM bool "Enable -inum: inode number matching" default BUSYBOX_DEFAULT_FEATURE_FIND_INUM depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -inum' option for searching by inode number. config BUSYBOX_CONFIG_FEATURE_FIND_EXEC bool "Enable -exec: execute commands" @@ -104,15 +96,11 @@ config BUSYBOX_CONFIG_FEATURE_FIND_USER bool "Enable -user: username/uid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_USER depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -user' option for searching by username or uid. config BUSYBOX_CONFIG_FEATURE_FIND_GROUP bool "Enable -group: group/gid matching" default BUSYBOX_DEFAULT_FEATURE_FIND_GROUP depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -group' option for searching by group name or gid. config BUSYBOX_CONFIG_FEATURE_FIND_NOT bool "Enable the 'not' (!) operator" @@ -141,15 +129,13 @@ config BUSYBOX_CONFIG_FEATURE_FIND_SIZE bool "Enable -size: file size matching" default BUSYBOX_DEFAULT_FEATURE_FIND_SIZE depends on BUSYBOX_CONFIG_FIND - help - Support the 'find -size' option for searching by file size. config BUSYBOX_CONFIG_FEATURE_FIND_PRUNE bool "Enable -prune: exclude subdirectories" default BUSYBOX_DEFAULT_FEATURE_FIND_PRUNE depends on BUSYBOX_CONFIG_FIND help - If the file is a directory, dont descend into it. Useful for + If the file is a directory, don't descend into it. Useful for exclusion .svn and CVS directories. config BUSYBOX_CONFIG_FEATURE_FIND_DELETE @@ -194,28 +180,22 @@ config BUSYBOX_CONFIG_GREP help grep is used to search files for a specified pattern. -config BUSYBOX_CONFIG_FEATURE_GREP_EGREP_ALIAS - bool "Enable extended regular expressions (egrep & grep -E)" - default BUSYBOX_DEFAULT_FEATURE_GREP_EGREP_ALIAS - depends on BUSYBOX_CONFIG_GREP +config BUSYBOX_CONFIG_EGREP + bool "egrep" + default BUSYBOX_DEFAULT_EGREP help - Enabled support for extended regular expressions. Extended - regular expressions allow for alternation (foo|bar), grouping, - and various repetition operators. + Alias to "grep -E" -config BUSYBOX_CONFIG_FEATURE_GREP_FGREP_ALIAS - bool "Alias fgrep to grep -F" - default BUSYBOX_DEFAULT_FEATURE_GREP_FGREP_ALIAS - depends on BUSYBOX_CONFIG_GREP +config BUSYBOX_CONFIG_FGREP + bool "fgrep" + default BUSYBOX_DEFAULT_FGREP help - fgrep sees the search pattern as a normal string rather than - regular expressions. - grep -F always works, this just creates the fgrep alias. + Alias to "grep -F" config BUSYBOX_CONFIG_FEATURE_GREP_CONTEXT bool "Enable before and after context flags (-A, -B and -C)" default BUSYBOX_DEFAULT_FEATURE_GREP_CONTEXT - depends on BUSYBOX_CONFIG_GREP + depends on BUSYBOX_CONFIG_GREP || BUSYBOX_CONFIG_EGREP || BUSYBOX_CONFIG_FGREP help Print the specified number of leading (-B) and/or trailing (-A) context surrounding our matching lines. diff --git a/package/utils/busybox/config/init/Config.in b/package/utils/busybox/config/init/Config.in index 021656d3f..072df3389 100644 --- a/package/utils/busybox/config/init/Config.in +++ b/package/utils/busybox/config/init/Config.in @@ -45,15 +45,27 @@ config BUSYBOX_CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE Enable reading and parsing of $PWD/bootchartd.conf and /etc/bootchartd.conf files. config BUSYBOX_CONFIG_HALT - bool "poweroff, halt, and reboot" + bool "halt" default BUSYBOX_DEFAULT_HALT help - Stop all processes and either halt, reboot, or power off the system. + Stop all processes and halt the system. + +config BUSYBOX_CONFIG_POWEROFF + bool "poweroff" + default BUSYBOX_DEFAULT_POWEROFF + help + Stop all processes and power off the system. + +config BUSYBOX_CONFIG_REBOOT + bool "reboot" + default BUSYBOX_DEFAULT_REBOOT + help + Stop all processes and reboot the system. config BUSYBOX_CONFIG_FEATURE_CALL_TELINIT bool "Call telinit on shutdown and reboot" default BUSYBOX_DEFAULT_FEATURE_CALL_TELINIT - depends on BUSYBOX_CONFIG_HALT && !BUSYBOX_CONFIG_INIT + depends on (BUSYBOX_CONFIG_HALT || BUSYBOX_CONFIG_POWEROFF || BUSYBOX_CONFIG_REBOOT) && !BUSYBOX_CONFIG_INIT help Call an external program (normally telinit) to facilitate a switch to a proper runlevel. @@ -77,7 +89,7 @@ config BUSYBOX_CONFIG_INIT init is the first program run when the system boots. config BUSYBOX_CONFIG_LINUXRC - bool "Support running init from within an initrd (not initramfs)" + bool "linuxrc: support running init from initrd (not initramfs)" default BUSYBOX_DEFAULT_LINUXRC select BUSYBOX_CONFIG_FEATURE_SYSLOG help @@ -133,17 +145,19 @@ config BUSYBOX_CONFIG_FEATURE_INIT_SYSLOG bool "Enable init to write to syslog" default BUSYBOX_DEFAULT_FEATURE_INIT_SYSLOG depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC - -config BUSYBOX_CONFIG_FEATURE_EXTRA_QUIET - bool "Be _extra_ quiet on boot" - default BUSYBOX_DEFAULT_FEATURE_EXTRA_QUIET - depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help - Prevent init from logging some messages to the console during boot. + If selected, some init messages are sent to syslog. + Otherwise, they are sent to VT #5 if linux virtual tty is detected + (if not, no separate logging is done). + +config BUSYBOX_CONFIG_FEATURE_INIT_QUIET + bool "Be quiet on boot (no 'init started:' message)" + default BUSYBOX_DEFAULT_FEATURE_INIT_QUIET + depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC config BUSYBOX_CONFIG_FEATURE_INIT_COREDUMPS bool "Support dumping core for child processes (debugging only)" - default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS + default BUSYBOX_DEFAULT_FEATURE_INIT_COREDUMPS # not Y because this is a debug option depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help If this option is enabled and the file /.init_enable_core @@ -164,36 +178,18 @@ config BUSYBOX_CONFIG_INIT_TERMINAL_TYPE sets TERM to "vt102" if one is found. config BUSYBOX_CONFIG_FEATURE_INIT_MODIFY_CMDLINE - bool "Modify the command-line to \"init\"" + bool "Clear init's command line" default BUSYBOX_DEFAULT_FEATURE_INIT_MODIFY_CMDLINE depends on BUSYBOX_CONFIG_INIT || BUSYBOX_CONFIG_LINUXRC help When launched as PID 1 and after parsing its arguments, init wipes all the arguments but argv[0] and rewrites argv[0] to - contain only "init", so that its command-line appears solely as + contain only "init", so that its command line appears solely as "init" in tools such as ps. If this option is set to Y, init will keep its original behavior, otherwise, all the arguments including argv[0] will be preserved, be they parsed or ignored by init. The original command-line used to launch init can then be retrieved in /proc/1/cmdline on Linux, for example. -config BUSYBOX_CONFIG_MESG - bool "mesg" - default BUSYBOX_DEFAULT_MESG - help - Mesg controls access to your terminal by others. It is typically - used to allow or disallow other users to write to your terminal - -config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP - bool "Enable writing to tty only by group, not by everybody" - default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP - depends on BUSYBOX_CONFIG_MESG - help - Usually, ttys are owned by group "tty", and "write" tool is - setgid to this group. This way, "mesg y" only needs to enable - "write by owning group" bit in tty mode. - - If you set this option to N, "mesg y" will enable writing - by anybody at all. This is not recommended. endmenu diff --git a/package/utils/busybox/config/libbb/Config.in b/package/utils/busybox/config/libbb/Config.in index 0695f9ba3..1687ed5c7 100644 --- a/package/utils/busybox/config/libbb/Config.in +++ b/package/utils/busybox/config/libbb/Config.in @@ -45,6 +45,30 @@ config BUSYBOX_CONFIG_FEATURE_RTMINMAX Support RTMIN[+n] and RTMAX[-n] signal names in kill, killall etc. This costs ~250 bytes. +choice + prompt "Buffer allocation policy" + default BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + help + There are 3 ways BusyBox can handle buffer allocations: + - Use malloc. This costs code size for the call to xmalloc. + - Put them on stack. For some very small machines with limited stack + space, this can be deadly. For most folks, this works just fine. + - Put them in BSS. This works beautifully for computers with a real + MMU (and OS support), but wastes runtime RAM for uCLinux. This + behavior was the only one available for BusyBox versions 0.48 and + earlier. + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_USE_MALLOC + bool "Allocate with Malloc" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_ON_STACK + bool "Allocate on the Stack" + +config BUSYBOX_CONFIG_FEATURE_BUFFERS_GO_IN_BSS + bool "Allocate in the .bss section" + +endchoice + config BUSYBOX_CONFIG_PASSWORD_MINLEN int "Minimum password length" default BUSYBOX_DEFAULT_PASSWORD_MINLEN @@ -84,24 +108,13 @@ config BUSYBOX_CONFIG_FEATURE_FAST_TOP but code size is slightly bigger. config BUSYBOX_CONFIG_FEATURE_ETC_NETWORKS - bool "Support for /etc/networks" + bool "Support /etc/networks" default BUSYBOX_DEFAULT_FEATURE_ETC_NETWORKS help Enable support for network names in /etc/networks. This is a rarely used feature which allows you to use names instead of IP/mask pairs in route command. -config BUSYBOX_CONFIG_FEATURE_USE_TERMIOS - bool "Use termios to manipulate the screen" - default BUSYBOX_DEFAULT_FEATURE_USE_TERMIOS - depends on BUSYBOX_CONFIG_MORE || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_POWERTOP - help - This option allows utilities such as 'more' and 'top' to determine - the size of the screen. If you leave this disabled, your utilities - that display things on the screen will be especially primitive and - will be unable to determine the current screen size, and will be - unable to move the cursor. - config BUSYBOX_CONFIG_FEATURE_EDITING bool "Command line editing" default BUSYBOX_DEFAULT_FEATURE_EDITING @@ -161,15 +174,11 @@ config BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION bool "Tab completion" default BUSYBOX_DEFAULT_FEATURE_TAB_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_EDITING - help - Enable tab completion. config BUSYBOX_CONFIG_FEATURE_USERNAME_COMPLETION bool "Username completion" default BUSYBOX_DEFAULT_FEATURE_USERNAME_COMPLETION depends on BUSYBOX_CONFIG_FEATURE_TAB_COMPLETION - help - Enable username completion. config BUSYBOX_CONFIG_FEATURE_EDITING_FANCY_PROMPT bool "Fancy shell prompts" @@ -191,6 +200,131 @@ config BUSYBOX_CONFIG_FEATURE_EDITING_ASK_TERMINAL correctly, or want to save on code size (about 400 bytes), then do not turn this option on. +config BUSYBOX_CONFIG_LOCALE_SUPPORT + bool "Enable locale support (system needs locale for this to work)" + default BUSYBOX_DEFAULT_LOCALE_SUPPORT + help + Enable this if your system has locale support and you would like + busybox to support locale settings. + +config BUSYBOX_CONFIG_UNICODE_SUPPORT + bool "Support Unicode" + default BUSYBOX_DEFAULT_UNICODE_SUPPORT + help + This makes various applets aware that one byte is not + one character on screen. + + Busybox aims to eventually work correctly with Unicode displays. + Any older encodings are not guaranteed to work. + Probably by the time when busybox will be fully Unicode-clean, + other encodings will be mainly of historic interest. + +config BUSYBOX_CONFIG_UNICODE_USING_LOCALE + bool "Use libc routines for Unicode (else uses internal ones)" + default BUSYBOX_DEFAULT_UNICODE_USING_LOCALE + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && BUSYBOX_CONFIG_LOCALE_SUPPORT + help + With this option on, Unicode support is implemented using libc + routines. Otherwise, internal implementation is used. + Internal implementation is smaller. + +config BUSYBOX_CONFIG_FEATURE_CHECK_UNICODE_IN_ENV + bool "Check $LC_ALL, $LC_CTYPE and $LANG environment variables" + default BUSYBOX_DEFAULT_FEATURE_CHECK_UNICODE_IN_ENV + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, Unicode support is activated + only if locale-related variables have the value of the form + "xxxx.utf8" + + Otherwise, Unicode support will be always enabled and active. + +config BUSYBOX_CONFIG_SUBST_WCHAR + int "Character code to substitute unprintable characters with" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_SUBST_WCHAR + help + Typical values are 63 for '?' (works with any output device), + 30 for ASCII substitute control code, + 65533 (0xfffd) for Unicode replacement character. + +config BUSYBOX_CONFIG_LAST_SUPPORTED_WCHAR + int "Range of supported Unicode characters" + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + default BUSYBOX_DEFAULT_LAST_SUPPORTED_WCHAR + help + Any character with Unicode value bigger than this is assumed + to be non-printable on output device. Many applets replace + such characters with substitution character. + + The idea is that many valid printable Unicode chars + nevertheless are not displayed correctly. Think about + combining charachers, double-wide hieroglyphs, obscure + characters in dozens of ancient scripts... + Many terminals, terminal emulators, xterms etc will fail + to handle them correctly. Choose the smallest value + which suits your needs. + + Typical values are: + 126 - ASCII only + 767 (0x2ff) - there are no combining chars in [0..767] range + (the range includes Latin 1, Latin Ext. A and B), + code is ~700 bytes smaller for this case. + 4351 (0x10ff) - there are no double-wide chars in [0..4351] range, + code is ~300 bytes smaller for this case. + 12799 (0x31ff) - nearly all non-ideographic characters are + available in [0..12799] range, including + East Asian scripts like katakana, hiragana, hangul, + bopomofo... + 0 - off, any valid printable Unicode character will be printed. + +config BUSYBOX_CONFIG_UNICODE_COMBINING_WCHARS + bool "Allow zero-width Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_COMBINING_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width of 0 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_WIDE_WCHARS + bool "Allow wide Unicode characters on output" + default BUSYBOX_DEFAULT_UNICODE_WIDE_WCHARS + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option off, any Unicode char with width > 1 + is substituted on output. + +config BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + bool "Bidirectional character-aware line input" + default BUSYBOX_DEFAULT_UNICODE_BIDI_SUPPORT + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT && !BUSYBOX_CONFIG_UNICODE_USING_LOCALE + help + With this option on, right-to-left Unicode characters + are treated differently on input (e.g. cursor movement). + +config BUSYBOX_CONFIG_UNICODE_NEUTRAL_TABLE + bool "In bidi input, support non-ASCII neutral chars too" + default BUSYBOX_DEFAULT_UNICODE_NEUTRAL_TABLE + depends on BUSYBOX_CONFIG_UNICODE_BIDI_SUPPORT + help + In most cases it's enough to treat only ASCII non-letters + (i.e. punctuation, numbers and space) as characters + with neutral directionality. + With this option on, more extensive (and bigger) table + of neutral chars will be used. + +config BUSYBOX_CONFIG_UNICODE_PRESERVE_BROKEN + bool "Make it possible to enter sequences of chars which are not Unicode" + default BUSYBOX_DEFAULT_UNICODE_PRESERVE_BROKEN + depends on BUSYBOX_CONFIG_UNICODE_SUPPORT + help + With this option on, on line-editing input (such as used by shells) + invalid UTF-8 bytes are not substituted with the selected + substitution character. + For example, this means that entering 'l', 's', ' ', 0xff, [Enter] + at shell prompt will list file named 0xff (single char name + with char value 255), not file named '?'. + config BUSYBOX_CONFIG_FEATURE_NON_POSIX_CP bool "Non-POSIX, but safer, copying to special nodes" default BUSYBOX_DEFAULT_FEATURE_NON_POSIX_CP @@ -215,6 +349,19 @@ config BUSYBOX_CONFIG_FEATURE_VERBOSE_CP_MESSAGE cp: cannot stat '/vmlinuz/file': Not a directory This will cost you ~60 bytes. +config BUSYBOX_CONFIG_FEATURE_USE_SENDFILE + bool "Use sendfile system call" + default BUSYBOX_DEFAULT_FEATURE_USE_SENDFILE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + When enabled, busybox will use the kernel sendfile() function + instead of read/write loops to copy data between file descriptors + (for example, cp command does this a lot). + If sendfile() doesn't work, copying code falls back to read/write + loop. sendfile() was originally implemented for faster I/O + from files to sockets, but since Linux 2.6.33 it was extended + to work for many more file types. + config BUSYBOX_CONFIG_FEATURE_COPYBUF_KB int "Copy buffer size, in kilobytes" range 1 1024 diff --git a/package/utils/busybox/config/loginutils/Config.in b/package/utils/busybox/config/loginutils/Config.in index 956115c7f..fa0059587 100644 --- a/package/utils/busybox/config/loginutils/Config.in +++ b/package/utils/busybox/config/loginutils/Config.in @@ -7,7 +7,7 @@ menu "Login/Password Management Utilities" config BUSYBOX_CONFIG_FEATURE_SHADOWPASSWDS - bool "Support for shadow passwords" + bool "Support shadow passwords" default BUSYBOX_DEFAULT_FEATURE_SHADOWPASSWDS help Build support for shadow password in /etc/shadow. This file is only @@ -113,15 +113,13 @@ config BUSYBOX_CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDGROUP_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDGROUP && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the addgroup applet. config BUSYBOX_CONFIG_FEATURE_ADDUSER_TO_GROUP - bool "Support for adding users to groups" + bool "Support adding users to groups" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_TO_GROUP depends on BUSYBOX_CONFIG_ADDGROUP help - If called with two non-option arguments, + If called with two non-option arguments, addgroup will add an existing user to an existing group. config BUSYBOX_CONFIG_ADDUSER @@ -134,8 +132,6 @@ config BUSYBOX_CONFIG_FEATURE_ADDUSER_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_ADDUSER_LONG_OPTIONS depends on BUSYBOX_CONFIG_ADDUSER && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the adduser applet. config BUSYBOX_CONFIG_FEATURE_CHECK_NAMES bool "Enable sanity check on user/group names in adduser and addgroup" @@ -179,9 +175,9 @@ config BUSYBOX_CONFIG_CHPASSWD and uses this information to update a group of existing users. config BUSYBOX_CONFIG_FEATURE_DEFAULT_PASSWD_ALGO - string "Default password encryption method (passwd -a, cryptpw -m parameter)" + string "Default encryption method (passwd -a, cryptpw -m, chpasswd -c ALG)" default BUSYBOX_DEFAULT_FEATURE_DEFAULT_PASSWD_ALGO - depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW + depends on BUSYBOX_CONFIG_PASSWD || BUSYBOX_CONFIG_CRYPTPW || BUSYBOX_CONFIG_CHPASSWD help Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512". config BUSYBOX_CONFIG_CRYPTPW @@ -211,7 +207,7 @@ config BUSYBOX_CONFIG_DELGROUP Utility for deleting a group account. config BUSYBOX_CONFIG_FEATURE_DEL_USER_FROM_GROUP - bool "Support for removing users from groups" + bool "Support removing users from groups" default BUSYBOX_DEFAULT_FEATURE_DEL_USER_FROM_GROUP depends on BUSYBOX_CONFIG_DELGROUP help @@ -257,7 +253,7 @@ config BUSYBOX_CONFIG_LOGIN_SESSION_AS_CHILD will not be cleaned up. config BUSYBOX_CONFIG_LOGIN_SCRIPTS - bool "Support for login scripts" + bool "Support login scripts" depends on BUSYBOX_CONFIG_LOGIN default BUSYBOX_DEFAULT_LOGIN_SCRIPTS help @@ -265,7 +261,7 @@ config BUSYBOX_CONFIG_LOGIN_SCRIPTS just prior to switching from root to logged-in user. config BUSYBOX_CONFIG_FEATURE_NOLOGIN - bool "Support for /etc/nologin" + bool "Support /etc/nologin" default BUSYBOX_DEFAULT_FEATURE_NOLOGIN depends on BUSYBOX_CONFIG_LOGIN help @@ -273,7 +269,7 @@ config BUSYBOX_CONFIG_FEATURE_NOLOGIN If it exists, non-root logins are prohibited. config BUSYBOX_CONFIG_FEATURE_SECURETTY - bool "Support for /etc/securetty" + bool "Support /etc/securetty" default BUSYBOX_DEFAULT_FEATURE_SECURETTY depends on BUSYBOX_CONFIG_LOGIN help @@ -306,19 +302,23 @@ config BUSYBOX_CONFIG_SU help su is used to become another user during a login session. Invoked without a username, su defaults to becoming the super user. - - Note that Busybox binary must be setuid root for this applet to + Note that busybox binary must be setuid root for this applet to work properly. config BUSYBOX_CONFIG_FEATURE_SU_SYSLOG - bool "Enable su to write to syslog" + bool "Log to syslog all attempts to use su" default BUSYBOX_DEFAULT_FEATURE_SU_SYSLOG depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_FEATURE_SU_CHECKS_SHELLS - bool "Enable su to check user's shell to be listed in /etc/shells" - depends on BUSYBOX_CONFIG_SU + bool "If user's shell is not in /etc/shells, disallow -s PROG" default BUSYBOX_DEFAULT_FEATURE_SU_CHECKS_SHELLS + depends on BUSYBOX_CONFIG_SU + +config BUSYBOX_CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + bool "Allow blank passwords only on TTYs in /etc/securetty" + default BUSYBOX_DEFAULT_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY + depends on BUSYBOX_CONFIG_SU config BUSYBOX_CONFIG_SULOGIN bool "sulogin" default BUSYBOX_DEFAULT_SULOGIN diff --git a/package/utils/busybox/config/mailutils/Config.in b/package/utils/busybox/config/mailutils/Config.in index 64b9a2baa..7e7740786 100644 --- a/package/utils/busybox/config/mailutils/Config.in +++ b/package/utils/busybox/config/mailutils/Config.in @@ -1,20 +1,11 @@ # DO NOT EDIT. This file is generated from Config.src menu "Mail Utilities" - config BUSYBOX_CONFIG_MAKEMIME bool "makemime" default BUSYBOX_DEFAULT_MAKEMIME help Create MIME-formatted messages. - -config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET - string "Default charset" - default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET - depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL - help - Default charset of the message. - config BUSYBOX_CONFIG_POPMAILDIR bool "popmaildir" default BUSYBOX_DEFAULT_POPMAILDIR @@ -31,7 +22,6 @@ config BUSYBOX_CONFIG_FEATURE_POPMAILDIR_DELIVERY of the message before actual delivery (-F "prog [args...]"). Allow to use a custom program for message actual delivery (-M "prog [args...]"). - config BUSYBOX_CONFIG_REFORMIME bool "reformime" default BUSYBOX_DEFAULT_REFORMIME @@ -45,11 +35,17 @@ config BUSYBOX_CONFIG_FEATURE_REFORMIME_COMPAT help Accept (for compatibility only) and ignore options other than -x and -X. - config BUSYBOX_CONFIG_SENDMAIL bool "sendmail" default BUSYBOX_DEFAULT_SENDMAIL help Barebones sendmail. +config BUSYBOX_CONFIG_FEATURE_MIME_CHARSET + string "Default charset" + default BUSYBOX_DEFAULT_FEATURE_MIME_CHARSET + depends on BUSYBOX_CONFIG_MAKEMIME || BUSYBOX_CONFIG_REFORMIME || BUSYBOX_CONFIG_SENDMAIL + help + Default charset of the message. + endmenu diff --git a/package/utils/busybox/config/miscutils/Config.in b/package/utils/busybox/config/miscutils/Config.in index 3465df40a..61c5458b6 100644 --- a/package/utils/busybox/config/miscutils/Config.in +++ b/package/utils/busybox/config/miscutils/Config.in @@ -6,259 +6,6 @@ menu "Miscellaneous Utilities" -config BUSYBOX_CONFIG_CONSPY - bool "conspy" - default BUSYBOX_DEFAULT_CONSPY - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - A text-mode VNC like program for Linux virtual terminals. - example: conspy NUM shared access to console num - or conspy -nd NUM screenshot of console num - or conspy -cs NUM poor man's GNU screen like -config BUSYBOX_CONFIG_CROND - bool "crond" - default BUSYBOX_DEFAULT_CROND - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - Crond is a background daemon that parses individual crontab - files and executes commands on behalf of the users in question. - This is a port of dcron from slackware. It uses files of the - format /var/spool/cron/crontabs/ files, for example: - $ cat /var/spool/cron/crontabs/root - # Run daily cron jobs at 4:40 every day: - 40 4 * * * /etc/cron/daily > /dev/null 2>&1 - -config BUSYBOX_CONFIG_FEATURE_CROND_D - bool "Support option -d to redirect output to stderr" - depends on BUSYBOX_CONFIG_CROND - default BUSYBOX_DEFAULT_FEATURE_CROND_D - help - -d N sets loglevel (0:most verbose) and directs all output to stderr. - -config BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL - bool "Report command output via email (using sendmail)" - default BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL - depends on BUSYBOX_CONFIG_CROND - help - Command output will be sent to corresponding user via email. - -config BUSYBOX_CONFIG_FEATURE_CROND_DIR - string "crond spool directory" - default BUSYBOX_DEFAULT_FEATURE_CROND_DIR - depends on BUSYBOX_CONFIG_CROND || BUSYBOX_CONFIG_CRONTAB - help - Location of crond spool. -config BUSYBOX_CONFIG_I2CGET - bool "i2cget" - default BUSYBOX_DEFAULT_I2CGET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Read from I2C/SMBus chip registers. - -config BUSYBOX_CONFIG_I2CSET - bool "i2cset" - default BUSYBOX_DEFAULT_I2CSET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Set I2C registers. - -config BUSYBOX_CONFIG_I2CDUMP - bool "i2cdump" - default BUSYBOX_DEFAULT_I2CDUMP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Examine I2C registers. - -config BUSYBOX_CONFIG_I2CDETECT - bool "i2cdetect" - default BUSYBOX_DEFAULT_I2CDETECT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Detect I2C chips. - -config BUSYBOX_CONFIG_LESS - bool "less" - default BUSYBOX_DEFAULT_LESS - help - 'less' is a pager, meaning that it displays text files. It possesses - a wide array of features, and is an improvement over 'more'. - -config BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES - int "Max number of input lines less will try to eat" - default BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES - depends on BUSYBOX_CONFIG_LESS - -config BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS - bool "Enable bracket searching" - default BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS - depends on BUSYBOX_CONFIG_LESS - help - This option adds the capability to search for matching left and right - brackets, facilitating programming. - -config BUSYBOX_CONFIG_FEATURE_LESS_FLAGS - bool "Enable -m/-M" - default BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS - depends on BUSYBOX_CONFIG_LESS - help - The -M/-m flag enables a more sophisticated status line. - -config BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE - bool "Enable -S" - default BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE - depends on BUSYBOX_CONFIG_LESS - help - The -S flag causes long lines to be truncated rather than - wrapped. - -config BUSYBOX_CONFIG_FEATURE_LESS_MARKS - bool "Enable marks" - default BUSYBOX_DEFAULT_FEATURE_LESS_MARKS - depends on BUSYBOX_CONFIG_LESS - help - Marks enable positions in a file to be stored for easy reference. - -config BUSYBOX_CONFIG_FEATURE_LESS_REGEXP - bool "Enable regular expressions" - default BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP - depends on BUSYBOX_CONFIG_LESS - help - Enable regular expressions, allowing complex file searches. - -config BUSYBOX_CONFIG_FEATURE_LESS_WINCH - bool "Enable automatic resizing on window size changes" - default BUSYBOX_DEFAULT_FEATURE_LESS_WINCH - depends on BUSYBOX_CONFIG_LESS - help - Makes less track window size changes. - -config BUSYBOX_CONFIG_FEATURE_LESS_ASK_TERMINAL - bool "Use 'tell me cursor position' ESC sequence to measure window" - default BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL - depends on BUSYBOX_CONFIG_FEATURE_LESS_WINCH - help - Makes less track window size changes. - If terminal size can't be retrieved and $LINES/$COLUMNS are not set, - this option makes less perform a last-ditch effort to find it: - position cursor to 999,999 and ask terminal to report real - cursor position using "ESC [ 6 n" escape sequence, then read stdin. - - This is not clean but helps a lot on serial lines and such. - -config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD - bool "Enable flag changes ('-' command)" - default BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD - depends on BUSYBOX_CONFIG_LESS - help - This enables the ability to change command-line flags within - less itself ('-' keyboard command). - -config BUSYBOX_CONFIG_FEATURE_LESS_LINENUMS - bool "Enable dynamic switching of line numbers" - default BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS - depends on BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD - help - Enables "-N" command. -config BUSYBOX_CONFIG_NANDWRITE - bool "nandwrite" - default BUSYBOX_DEFAULT_NANDWRITE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Write to the specified MTD device, with bad blocks awareness - -config BUSYBOX_CONFIG_NANDDUMP - bool "nanddump" - default BUSYBOX_DEFAULT_NANDDUMP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Dump the content of raw NAND chip -config BUSYBOX_CONFIG_RFKILL - bool "rfkill" - default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Enable/disable wireless devices. - - rfkill list : list all wireless devices - rfkill list bluetooth : list all bluetooth devices - rfkill list 1 : list device corresponding to the given index - rfkill block|unblock wlan : block/unblock all wlan(wifi) devices - -config BUSYBOX_CONFIG_SETSERIAL - bool "setserial" - default BUSYBOX_DEFAULT_SETSERIAL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Retrieve or set Linux serial port. -config BUSYBOX_CONFIG_TASKSET - bool "taskset" - default BUSYBOX_DEFAULT_TASKSET # doesn't build on some non-x86 targets (m68k) - help - Retrieve or set a processes's CPU affinity. - This requires sched_{g,s}etaffinity support in your libc. - -config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY - bool "Fancy output" - default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY - depends on BUSYBOX_CONFIG_TASKSET - help - Add code for fancy output. This merely silences a compiler-warning - and adds about 135 Bytes. May be needed for machines with alot - of CPUs. -config BUSYBOX_CONFIG_UBIATTACH - bool "ubiattach" - default BUSYBOX_DEFAULT_UBIATTACH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Attach MTD device to an UBI device. - -config BUSYBOX_CONFIG_UBIDETACH - bool "ubidetach" - default BUSYBOX_DEFAULT_UBIDETACH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Detach MTD device from an UBI device. - -config BUSYBOX_CONFIG_UBIMKVOL - bool "ubimkvol" - default BUSYBOX_DEFAULT_UBIMKVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Create a UBI volume. - -config BUSYBOX_CONFIG_UBIRMVOL - bool "ubirmvol" - default BUSYBOX_DEFAULT_UBIRMVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Delete a UBI volume. - -config BUSYBOX_CONFIG_UBIRSVOL - bool "ubirsvol" - default BUSYBOX_DEFAULT_UBIRSVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Resize a UBI volume. - -config BUSYBOX_CONFIG_UBIUPDATEVOL - bool "ubiupdatevol" - default BUSYBOX_DEFAULT_UBIUPDATEVOL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Update a UBI volume. -config BUSYBOX_CONFIG_UBIRENAME - bool "ubirename" - default BUSYBOX_DEFAULT_UBIRENAME - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to rename UBI volumes -config BUSYBOX_CONFIG_WALL - bool "wall" - default BUSYBOX_DEFAULT_WALL - depends on BUSYBOX_CONFIG_FEATURE_UTMP - help - Write a message to all users that are logged in. - config BUSYBOX_CONFIG_ADJTIMEX bool "adjtimex" default BUSYBOX_DEFAULT_ADJTIMEX @@ -266,7 +13,6 @@ config BUSYBOX_CONFIG_ADJTIMEX help Adjtimex reads and optionally sets adjustment parameters for the Linux clock adjustment algorithm. - config BUSYBOX_CONFIG_BBCONFIG bool "bbconfig" default BUSYBOX_DEFAULT_BBCONFIG @@ -287,7 +33,6 @@ config BUSYBOX_CONFIG_FEATURE_COMPRESS_BBCONFIG be noticeable. Also, if you run executables directly from ROM and have very little memory, this might not be a win. Otherwise, you probably want this. - config BUSYBOX_CONFIG_BEEP bool "beep" default BUSYBOX_DEFAULT_BEEP @@ -297,7 +42,7 @@ config BUSYBOX_CONFIG_BEEP config BUSYBOX_CONFIG_FEATURE_BEEP_FREQ int "default frequency" - range 0 2147483647 + range 20 50000 # allowing 0 here breaks the build default BUSYBOX_DEFAULT_FEATURE_BEEP_FREQ depends on BUSYBOX_CONFIG_BEEP help @@ -310,7 +55,6 @@ config BUSYBOX_CONFIG_FEATURE_BEEP_LENGTH_MS depends on BUSYBOX_CONFIG_BEEP help Length in ms for default beep. - config BUSYBOX_CONFIG_CHAT bool "chat" default BUSYBOX_DEFAULT_CHAT @@ -377,14 +121,48 @@ config BUSYBOX_CONFIG_FEATURE_CHAT_CLR_ABORT default BUSYBOX_DEFAULT_FEATURE_CHAT_CLR_ABORT help Support CLR_ABORT directive. - -config BUSYBOX_CONFIG_CHRT - bool "chrt" - default BUSYBOX_DEFAULT_CHRT +config BUSYBOX_CONFIG_CONSPY + bool "conspy" + default BUSYBOX_DEFAULT_CONSPY + select BUSYBOX_CONFIG_PLATFORM_LINUX help - manipulate real-time attributes of a process. - This requires sched_{g,s}etparam support in your libc. + A text-mode VNC like program for Linux virtual terminals. + example: conspy NUM shared access to console num + or conspy -nd NUM screenshot of console num + or conspy -cs NUM poor man's GNU screen like +config BUSYBOX_CONFIG_CROND + bool "crond" + default BUSYBOX_DEFAULT_CROND + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + Crond is a background daemon that parses individual crontab + files and executes commands on behalf of the users in question. + This is a port of dcron from slackware. It uses files of the + format /var/spool/cron/crontabs/ files, for example: + $ cat /var/spool/cron/crontabs/root + # Run daily cron jobs at 4:40 every day: + 40 4 * * * /etc/cron/daily > /dev/null 2>&1 +config BUSYBOX_CONFIG_FEATURE_CROND_D + bool "Support option -d to redirect output to stderr" + depends on BUSYBOX_CONFIG_CROND + default BUSYBOX_DEFAULT_FEATURE_CROND_D + help + -d N sets loglevel (0:most verbose) and directs all output to stderr. + +config BUSYBOX_CONFIG_FEATURE_CROND_CALL_SENDMAIL + bool "Report command output via email (using sendmail)" + default BUSYBOX_DEFAULT_FEATURE_CROND_CALL_SENDMAIL + depends on BUSYBOX_CONFIG_CROND + help + Command output will be sent to corresponding user via email. + +config BUSYBOX_CONFIG_FEATURE_CROND_DIR + string "crond spool directory" + default BUSYBOX_DEFAULT_FEATURE_CROND_DIR + depends on BUSYBOX_CONFIG_CROND || BUSYBOX_CONFIG_CRONTAB + help + Location of crond spool. config BUSYBOX_CONFIG_CRONTAB bool "crontab" default BUSYBOX_DEFAULT_CRONTAB @@ -393,7 +171,6 @@ config BUSYBOX_CONFIG_CRONTAB the superuser may specify a different user and/or crontab directory. Note that Busybox binary must be setuid root for this applet to work properly. - config BUSYBOX_CONFIG_DC bool "dc" default BUSYBOX_DEFAULT_DC @@ -408,7 +185,6 @@ config BUSYBOX_CONFIG_FEATURE_DC_LIBM help Enable power and exp functions. NOTE: This will require libm to be present for linking. - config BUSYBOX_CONFIG_DEVFSD bool "devfsd (obsolete)" default BUSYBOX_DEFAULT_DEVFSD @@ -438,7 +214,7 @@ config BUSYBOX_CONFIG_DEVFSD_MODLOAD the external modutils. config BUSYBOX_CONFIG_DEVFSD_FG_NP - bool "Enables the -fg and -np options" + bool "Enable the -fg and -np options" default BUSYBOX_DEFAULT_DEVFSD_FG_NP depends on BUSYBOX_CONFIG_DEVFSD help @@ -465,29 +241,12 @@ config BUSYBOX_CONFIG_FEATURE_DEVFS tells busybox to look for names like /dev/loop/0 instead of /dev/loop0. If your /dev directory has normal names instead of devfs names, you don't want this. - config BUSYBOX_CONFIG_DEVMEM bool "devmem" default BUSYBOX_DEFAULT_DEVMEM help devmem is a small program that reads and writes from physical memory using /dev/mem. - -config BUSYBOX_CONFIG_EJECT - bool "eject" - default BUSYBOX_DEFAULT_EJECT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Used to eject cdroms. (defaults to /dev/cdrom) - -config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI - bool "SCSI support" - default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI - depends on BUSYBOX_CONFIG_EJECT - help - Add the -s option to eject, this allows to eject SCSI-Devices and - usb-storage devices. - config BUSYBOX_CONFIG_FBSPLASH bool "fbsplash" default BUSYBOX_DEFAULT_FBSPLASH @@ -509,14 +268,12 @@ config BUSYBOX_CONFIG_FBSPLASH - commands for fifo: "NN" (ASCII decimal number) - percentage to show on progress bar "exit" - well you guessed it - -config BUSYBOX_CONFIG_FLASHCP - bool "flashcp" - default BUSYBOX_DEFAULT_FLASHCP # doesn't build on Ubuntu 8.04 +config BUSYBOX_CONFIG_FLASH_ERASEALL + bool "flash_eraseall" + default BUSYBOX_DEFAULT_FLASH_ERASEALL # doesn't build on Ubuntu 8.04 help - The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. - This utility is used to copy images into a MTD device. - + The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. + This utility is used to erase the whole MTD device. config BUSYBOX_CONFIG_FLASH_LOCK bool "flash_lock" default BUSYBOX_DEFAULT_FLASH_LOCK # doesn't build on Ubuntu 8.04 @@ -530,44 +287,12 @@ config BUSYBOX_CONFIG_FLASH_UNLOCK help The flash_unlock binary from mtd-utils as of git head 5ec0c10d0. This utility unlocks part or all of the flash device. - -config BUSYBOX_CONFIG_FLASH_ERASEALL - bool "flash_eraseall" - default BUSYBOX_DEFAULT_FLASH_ERASEALL # doesn't build on Ubuntu 8.04 +config BUSYBOX_CONFIG_FLASHCP + bool "flashcp" + default BUSYBOX_DEFAULT_FLASHCP # doesn't build on Ubuntu 8.04 help - The flash_eraseall binary from mtd-utils as of git head c4c6a59eb. - This utility is used to erase the whole MTD device. - -config BUSYBOX_CONFIG_IONICE - bool "ionice" - default BUSYBOX_DEFAULT_IONICE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Set/set program io scheduling class and priority - Requires kernel >= 2.6.13 - -config BUSYBOX_CONFIG_INOTIFYD - bool "inotifyd" - default BUSYBOX_DEFAULT_INOTIFYD # doesn't build on Knoppix 5 - help - Simple inotify daemon. Reports filesystem changes. Requires - kernel >= 2.6.13 - -config BUSYBOX_CONFIG_LAST - bool "last" - default BUSYBOX_DEFAULT_LAST - depends on BUSYBOX_CONFIG_FEATURE_WTMP - help - 'last' displays a list of the last users that logged into the system. - -config BUSYBOX_CONFIG_FEATURE_LAST_FANCY - bool "Turn on output of extra information" - default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY - depends on BUSYBOX_CONFIG_LAST - help - 'last' displays detailed information about the last users that - logged into the system (mimics sysvinit last). +900 bytes. - + The flashcp binary, inspired by mtd-utils as of git head 5eceb74f7. + This utility is used to copy images into a MTD device. config BUSYBOX_CONFIG_HDPARM bool "hdparm" default BUSYBOX_DEFAULT_HDPARM @@ -582,7 +307,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_GET_IDENTITY default BUSYBOX_DEFAULT_FEATURE_HDPARM_GET_IDENTITY depends on BUSYBOX_CONFIG_HDPARM help - Enables the -I and -i options to obtain detailed information + Enable the -I and -i options to obtain detailed information directly from drives about their capabilities and supported ATA feature set. If no device name is specified, hdparm will read identify data from stdin. Enabling this option will add about 16k... @@ -592,7 +317,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_SCAN_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -R' option to register an IDE interface. + Enable the 'hdparm -R' option to register an IDE interface. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF @@ -600,7 +325,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -U' option to un-register an IDE interface. + Enable the 'hdparm -U' option to un-register an IDE interface. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET @@ -608,7 +333,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_DRIVE_RESET depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -w' option to perform a device reset. + Enable the 'hdparm -w' option to perform a device reset. This is dangerous stuff, so you should probably say N. config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF @@ -616,7 +341,7 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_TRISTATE_HWIF depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -x' option to tristate device for hotswap, + Enable the 'hdparm -x' option to tristate device for hotswap, and the '-b' option to get/set bus state. This is dangerous stuff, so you should probably say N. @@ -625,14 +350,135 @@ config BUSYBOX_CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA default BUSYBOX_DEFAULT_FEATURE_HDPARM_HDIO_GETSET_DMA depends on BUSYBOX_CONFIG_HDPARM help - Enables the 'hdparm -d' option to get/set using_dma flag. + Enable the 'hdparm -d' option to get/set using_dma flag. +config BUSYBOX_CONFIG_I2CGET + bool "i2cget" + default BUSYBOX_DEFAULT_I2CGET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Read from I2C/SMBus chip registers. +config BUSYBOX_CONFIG_I2CSET + bool "i2cset" + default BUSYBOX_DEFAULT_I2CSET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Set I2C registers. + +config BUSYBOX_CONFIG_I2CDUMP + bool "i2cdump" + default BUSYBOX_DEFAULT_I2CDUMP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Examine I2C registers. + +config BUSYBOX_CONFIG_I2CDETECT + bool "i2cdetect" + default BUSYBOX_DEFAULT_I2CDETECT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Detect I2C chips. + +config BUSYBOX_CONFIG_INOTIFYD + bool "inotifyd" + default BUSYBOX_DEFAULT_INOTIFYD # doesn't build on Knoppix 5 + help + Simple inotify daemon. Reports filesystem changes. Requires + kernel >= 2.6.13 +config BUSYBOX_CONFIG_LESS + bool "less" + default BUSYBOX_DEFAULT_LESS + help + 'less' is a pager, meaning that it displays text files. It possesses + a wide array of features, and is an improvement over 'more'. + +config BUSYBOX_CONFIG_FEATURE_LESS_MAXLINES + int "Max number of input lines less will try to eat" + default BUSYBOX_DEFAULT_FEATURE_LESS_MAXLINES + depends on BUSYBOX_CONFIG_LESS + +config BUSYBOX_CONFIG_FEATURE_LESS_BRACKETS + bool "Enable bracket searching" + default BUSYBOX_DEFAULT_FEATURE_LESS_BRACKETS + depends on BUSYBOX_CONFIG_LESS + help + This option adds the capability to search for matching left and right + brackets, facilitating programming. + +config BUSYBOX_CONFIG_FEATURE_LESS_FLAGS + bool "Enable -m/-M" + default BUSYBOX_DEFAULT_FEATURE_LESS_FLAGS + depends on BUSYBOX_CONFIG_LESS + help + The -M/-m flag enables a more sophisticated status line. + +config BUSYBOX_CONFIG_FEATURE_LESS_TRUNCATE + bool "Enable -S" + default BUSYBOX_DEFAULT_FEATURE_LESS_TRUNCATE + depends on BUSYBOX_CONFIG_LESS + help + The -S flag causes long lines to be truncated rather than + wrapped. + +config BUSYBOX_CONFIG_FEATURE_LESS_MARKS + bool "Enable marks" + default BUSYBOX_DEFAULT_FEATURE_LESS_MARKS + depends on BUSYBOX_CONFIG_LESS + help + Marks enable positions in a file to be stored for easy reference. + +config BUSYBOX_CONFIG_FEATURE_LESS_REGEXP + bool "Enable regular expressions" + default BUSYBOX_DEFAULT_FEATURE_LESS_REGEXP + depends on BUSYBOX_CONFIG_LESS + help + Enable regular expressions, allowing complex file searches. + +config BUSYBOX_CONFIG_FEATURE_LESS_WINCH + bool "Enable automatic resizing on window size changes" + default BUSYBOX_DEFAULT_FEATURE_LESS_WINCH + depends on BUSYBOX_CONFIG_LESS + help + Makes less track window size changes. + +config BUSYBOX_CONFIG_FEATURE_LESS_ASK_TERMINAL + bool "Use 'tell me cursor position' ESC sequence to measure window" + default BUSYBOX_DEFAULT_FEATURE_LESS_ASK_TERMINAL + depends on BUSYBOX_CONFIG_FEATURE_LESS_WINCH + help + Makes less track window size changes. + If terminal size can't be retrieved and $LINES/$COLUMNS are not set, + this option makes less perform a last-ditch effort to find it: + position cursor to 999,999 and ask terminal to report real + cursor position using "ESC [ 6 n" escape sequence, then read stdin. + This is not clean but helps a lot on serial lines and such. + +config BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD + bool "Enable flag changes ('-' command)" + default BUSYBOX_DEFAULT_FEATURE_LESS_DASHCMD + depends on BUSYBOX_CONFIG_LESS + help + This enables the ability to change command-line flags within + less itself ('-' keyboard command). + +config BUSYBOX_CONFIG_FEATURE_LESS_LINENUMS + bool "Enable -N (dynamic switching of line numbers)" + default BUSYBOX_DEFAULT_FEATURE_LESS_LINENUMS + depends on BUSYBOX_CONFIG_FEATURE_LESS_DASHCMD config BUSYBOX_CONFIG_LOCK bool "lock" default BUSYBOX_DEFAULT_LOCK help Small utility for using locks in scripts +config BUSYBOX_CONFIG_LSSCSI + bool "lsscsi" + default BUSYBOX_DEFAULT_LSSCSI + #select PLATFORM_LINUX + help + lsscsi is a utility for displaying information about SCSI buses in the + system and devices connected to them. + This version uses sysfs (/sys/bus/scsi/devices) only. config BUSYBOX_CONFIG_MAKEDEVS bool "makedevs" default BUSYBOX_DEFAULT_MAKEDEVS @@ -664,25 +510,16 @@ config BUSYBOX_CONFIG_FEATURE_MAKEDEVS_TABLE bool "table" endchoice - config BUSYBOX_CONFIG_MAN bool "man" default BUSYBOX_DEFAULT_MAN help Format and display manual pages. - config BUSYBOX_CONFIG_MICROCOM bool "microcom" default BUSYBOX_DEFAULT_MICROCOM help The poor man's minicom utility for chatting with serial port devices. - -config BUSYBOX_CONFIG_MOUNTPOINT - bool "mountpoint" - default BUSYBOX_DEFAULT_MOUNTPOINT - help - mountpoint checks if the directory is a mountpoint. - config BUSYBOX_CONFIG_MT bool "mt" default BUSYBOX_DEFAULT_MT @@ -690,7 +527,25 @@ config BUSYBOX_CONFIG_MT mt is used to control tape devices. You can use the mt utility to advance or rewind a tape past a specified number of archive files on the tape. +config BUSYBOX_CONFIG_NANDWRITE + bool "nandwrite" + default BUSYBOX_DEFAULT_NANDWRITE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Write to the specified MTD device, with bad blocks awareness +config BUSYBOX_CONFIG_NANDDUMP + bool "nanddump" + default BUSYBOX_DEFAULT_NANDDUMP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Dump the content of raw NAND chip +config BUSYBOX_CONFIG_PARTPROBE + bool "partprobe" + default BUSYBOX_DEFAULT_PARTPROBE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ask kernel to rescan partition table. config BUSYBOX_CONFIG_RAIDAUTORUN bool "raidautorun" default BUSYBOX_DEFAULT_RAIDAUTORUN @@ -698,7 +553,6 @@ config BUSYBOX_CONFIG_RAIDAUTORUN help raidautorun tells the kernel md driver to search and start RAID arrays. - config BUSYBOX_CONFIG_READAHEAD bool "readahead" default BUSYBOX_DEFAULT_READAHEAD @@ -716,6 +570,17 @@ config BUSYBOX_CONFIG_READAHEAD As readahead(2) blocks until each file has been read, it is best to run this applet as a background job. +config BUSYBOX_CONFIG_RFKILL + bool "rfkill" + default BUSYBOX_DEFAULT_RFKILL # doesn't build on Ubuntu 9.04 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Enable/disable wireless devices. + + rfkill list : list all wireless devices + rfkill list bluetooth : list all bluetooth devices + rfkill list 1 : list device corresponding to the given index + rfkill block|unblock wlan : block/unblock all wlan(wifi) devices config BUSYBOX_CONFIG_RUNLEVEL bool "runlevel" @@ -726,27 +591,24 @@ config BUSYBOX_CONFIG_RUNLEVEL This applet uses utmp but does not rely on busybox supporing utmp on purpose. It is used by e.g. emdebian via /etc/init.d/rc. - config BUSYBOX_CONFIG_RX bool "rx" default BUSYBOX_DEFAULT_RX select BUSYBOX_CONFIG_PLATFORM_LINUX help Receive files using the Xmodem protocol. - -config BUSYBOX_CONFIG_SETSID - bool "setsid" - default BUSYBOX_DEFAULT_SETSID +config BUSYBOX_CONFIG_SETSERIAL + bool "setserial" + default BUSYBOX_DEFAULT_SETSERIAL + select BUSYBOX_CONFIG_PLATFORM_LINUX help - setsid runs a program in a new session - + Retrieve or set Linux serial port. config BUSYBOX_CONFIG_STRINGS bool "strings" default BUSYBOX_DEFAULT_STRINGS help strings prints the printable character sequences for each file specified. - config BUSYBOX_CONFIG_TIME bool "time" default BUSYBOX_DEFAULT_TIME @@ -754,14 +616,6 @@ config BUSYBOX_CONFIG_TIME The time command runs the specified program with the given arguments. When the command finishes, time writes a message to standard output giving timing statistics about this program run. - -config BUSYBOX_CONFIG_TIMEOUT - bool "timeout" - default BUSYBOX_DEFAULT_TIMEOUT - help - Runs a program and watches it. If it does not terminate in - specified number of seconds, it is sent a signal. - config BUSYBOX_CONFIG_TTYSIZE bool "ttysize" default BUSYBOX_DEFAULT_TTYSIZE @@ -770,13 +624,58 @@ config BUSYBOX_CONFIG_TTYSIZE only height, or both, in any order. It also does not complain on error, but returns default 80x24. Usage in shell scripts: width=`ttysize w`. +config BUSYBOX_CONFIG_UBIATTACH + bool "ubiattach" + default BUSYBOX_DEFAULT_UBIATTACH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Attach MTD device to an UBI device. +config BUSYBOX_CONFIG_UBIDETACH + bool "ubidetach" + default BUSYBOX_DEFAULT_UBIDETACH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Detach MTD device from an UBI device. + +config BUSYBOX_CONFIG_UBIMKVOL + bool "ubimkvol" + default BUSYBOX_DEFAULT_UBIMKVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Create a UBI volume. + +config BUSYBOX_CONFIG_UBIRMVOL + bool "ubirmvol" + default BUSYBOX_DEFAULT_UBIRMVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Delete a UBI volume. + +config BUSYBOX_CONFIG_UBIRSVOL + bool "ubirsvol" + default BUSYBOX_DEFAULT_UBIRSVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Resize a UBI volume. + +config BUSYBOX_CONFIG_UBIUPDATEVOL + bool "ubiupdatevol" + default BUSYBOX_DEFAULT_UBIUPDATEVOL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Update a UBI volume. +config BUSYBOX_CONFIG_UBIRENAME + bool "ubirename" + default BUSYBOX_DEFAULT_UBIRENAME + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to rename UBI volumes config BUSYBOX_CONFIG_VOLNAME bool "volname" default BUSYBOX_DEFAULT_VOLNAME help Prints a CD-ROM volume name. - config BUSYBOX_CONFIG_WATCHDOG bool "watchdog" default BUSYBOX_DEFAULT_WATCHDOG diff --git a/package/utils/busybox/config/modutils/Config.in b/package/utils/busybox/config/modutils/Config.in index 8e0e2af9e..9791af65a 100644 --- a/package/utils/busybox/config/modutils/Config.in +++ b/package/utils/busybox/config/modutils/Config.in @@ -6,19 +6,14 @@ menu "Linux Module Utilities" -config BUSYBOX_CONFIG_MODINFO - bool "modinfo" - default BUSYBOX_DEFAULT_MODINFO - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Show information about a Linux Kernel module - config BUSYBOX_CONFIG_MODPROBE_SMALL bool "Simplified modutils" default BUSYBOX_DEFAULT_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX help - Simplified modutils. + Build smaller (~1.5 kbytes), simplified module tools. + + This option by itself does not enable any applets - + you need to select applets individually below. With this option modprobe does not require modules.dep file and does not use /etc/modules.conf file. @@ -39,46 +34,23 @@ config BUSYBOX_CONFIG_MODPROBE_SMALL Additional module parameters can be stored in /etc/modules/$module_name files. - Apart from modprobe, other utilities are also provided: - - insmod is an alias to modprobe - - rmmod is an alias to modprobe -r - - depmod generates modules.dep.bb - -config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - bool "Accept module options on modprobe command line" - default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE - depends on BUSYBOX_CONFIG_MODPROBE_SMALL +config BUSYBOX_CONFIG_DEPMOD + bool "depmod" + default BUSYBOX_DEFAULT_DEPMOD select BUSYBOX_CONFIG_PLATFORM_LINUX help - Allow insmod and modprobe take module options from command line. - -config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - bool "Skip loading of already loaded modules" - default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED - depends on BUSYBOX_CONFIG_MODPROBE_SMALL - help - Check if the module is already loaded. - + depmod generates modules.dep (and potentially modules.alias + and modules.symbols) that contain dependency information + for modprobe. config BUSYBOX_CONFIG_INSMOD bool "insmod" default BUSYBOX_DEFAULT_INSMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help insmod is used to load specified modules in the running kernel. - -config BUSYBOX_CONFIG_RMMOD - bool "rmmod" - default BUSYBOX_DEFAULT_RMMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - rmmod is used to unload specified modules from the kernel. - config BUSYBOX_CONFIG_LSMOD bool "lsmod" default BUSYBOX_DEFAULT_LSMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help lsmod is used to display a list of loaded modules. @@ -86,17 +58,20 @@ config BUSYBOX_CONFIG_LSMOD config BUSYBOX_CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT bool "Pretty output" default BUSYBOX_DEFAULT_FEATURE_LSMOD_PRETTY_2_6_OUTPUT - depends on BUSYBOX_CONFIG_LSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on BUSYBOX_CONFIG_LSMOD && !BUSYBOX_CONFIG_MODPROBE_SMALL help This option makes output format of lsmod adjusted to the format of module-init-tools for Linux kernel 2.6. Increases size somewhat. - +config BUSYBOX_CONFIG_MODINFO + bool "modinfo" + default BUSYBOX_DEFAULT_MODINFO + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Show information about a Linux Kernel module config BUSYBOX_CONFIG_MODPROBE bool "modprobe" default BUSYBOX_DEFAULT_MODPROBE - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL select BUSYBOX_CONFIG_PLATFORM_LINUX help Handle the loading of modules, and their dependencies on a high @@ -105,42 +80,109 @@ config BUSYBOX_CONFIG_MODPROBE config BUSYBOX_CONFIG_FEATURE_MODPROBE_BLACKLIST bool "Blacklist support" default BUSYBOX_DEFAULT_FEATURE_MODPROBE_BLACKLIST - depends on BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on BUSYBOX_CONFIG_MODPROBE && !BUSYBOX_CONFIG_MODPROBE_SMALL help Say 'y' here to enable support for the 'blacklist' command in modprobe.conf. This prevents the alias resolver to resolve blacklisted modules. This is useful if you want to prevent your hardware autodetection scripts to load modules like evdev, frame buffer drivers etc. - -config BUSYBOX_CONFIG_DEPMOD - bool "depmod" - default BUSYBOX_DEFAULT_DEPMOD - depends on !BUSYBOX_CONFIG_MODPROBE_SMALL +config BUSYBOX_CONFIG_RMMOD + bool "rmmod" + default BUSYBOX_DEFAULT_RMMOD select BUSYBOX_CONFIG_PLATFORM_LINUX help - depmod generates modules.dep (and potentially modules.alias - and modules.symbols) that contain dependency information - for modprobe. + rmmod is used to unload specified modules from the kernel. comment "Options common to multiple modutils" +config BUSYBOX_CONFIG_FEATURE_CMDLINE_MODULE_OPTIONS + bool "Accept module options on modprobe command line" + default BUSYBOX_DEFAULT_FEATURE_CMDLINE_MODULE_OPTIONS + depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE + help + Allow insmod and modprobe take module options from the applets' + command line. + +config BUSYBOX_CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + bool "Skip loading of already loaded modules" + default BUSYBOX_DEFAULT_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED + depends on BUSYBOX_CONFIG_MODPROBE_SMALL && (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + Check if the module is already loaded. + config BUSYBOX_CONFIG_FEATURE_2_4_MODULES bool "Support version 2.2/2.4 Linux kernels" default BUSYBOX_DEFAULT_FEATURE_2_4_MODULES - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_RMMOD || BUSYBOX_CONFIG_LSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_RMMOD) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Support module loading for 2.2.x and 2.4.x Linux kernels. This increases size considerably. Say N unless you plan to run ancient kernels. +config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING + bool "Enable module version checking" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + Support checking of versions for modules. This is used to + ensure that the kernel and module are made for each other. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + bool "Add module symbols to kernel symbol table" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + By adding module symbols to the kernel symbol table, Oops messages + occurring within kernel modules can be properly debugged. By enabling + this feature, module symbols will always be added to the kernel symbol + table for proper debugging support. If you are not interested in + Oops messages from kernel modules, say N. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM + bool "In kernel memory optimization (uClinux only)" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) + help + This is a special uClinux only memory optimization that lets insmod + load the specified kernel module directly into kernel space, reducing + memory usage by preventing the need for two copies of the module + being loaded into memory. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP + bool "Enable insmod load map (-m) option" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP + depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD + help + Enabling this, one would be able to get a load map + output on stdout. This makes kernel module debugging + easier. + If you don't plan to debug kernel modules, you + don't need this option. + +config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL + bool "Symbols in load map" + default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL + depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP + help + Without this option, -m will only output section + load map. With this option, -m will also output + symbols load map. + +config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE + bool "Support tainted module checking with new kernels" + default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE + depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL + help + Support checking for tainted modules. These are usually binary + only modules that will make the linux-kernel list ignore your + support request. + This option is required to support GPLONLY modules. + config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP bool "Try to load module from a mmap'ed area" default BUSYBOX_DEFAULT_FEATURE_INSMOD_TRY_MMAP - depends on BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help This option causes module loading code to try to mmap module first. If it does not work (for example, @@ -153,76 +195,10 @@ config BUSYBOX_CONFIG_FEATURE_INSMOD_TRY_MMAP Choosing N saves about 250 bytes of code (on 32-bit x86). -config BUSYBOX_CONFIG_FEATURE_INSMOD_VERSION_CHECKING - bool "Enable module version checking" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_VERSION_CHECKING - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support checking of versions for modules. This is used to - ensure that the kernel and module are made for each other. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - bool "Add module symbols to kernel symbol table" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_KSYMOOPS_SYMBOLS - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - By adding module symbols to the kernel symbol table, Oops messages - occuring within kernel modules can be properly debugged. By enabling - this feature, module symbols will always be added to the kernel symbol - table for proper debugging support. If you are not interested in - Oops messages from kernel modules, say N. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOADINKMEM - bool "In kernel memory optimization (uClinux only)" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOADINKMEM - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && (BUSYBOX_CONFIG_INSMOD || BUSYBOX_CONFIG_MODPROBE) - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - This is a special uClinux only memory optimization that lets insmod - load the specified kernel module directly into kernel space, reducing - memory usage by preventing the need for two copies of the module - being loaded into memory. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP - bool "Enable insmod load map (-m) option" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP - depends on BUSYBOX_CONFIG_FEATURE_2_4_MODULES && BUSYBOX_CONFIG_INSMOD - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Enabling this, one would be able to get a load map - output on stdout. This makes kernel module debugging - easier. - If you don't plan to debug kernel modules, you - don't need this option. - -config BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL - bool "Symbols in load map" - default BUSYBOX_DEFAULT_FEATURE_INSMOD_LOAD_MAP_FULL - depends on BUSYBOX_CONFIG_FEATURE_INSMOD_LOAD_MAP && !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Without this option, -m will only output section - load map. With this option, -m will also output - symbols load map. - -config BUSYBOX_CONFIG_FEATURE_CHECK_TAINTED_MODULE - bool "Support tainted module checking with new kernels" - default BUSYBOX_DEFAULT_FEATURE_CHECK_TAINTED_MODULE - depends on (BUSYBOX_CONFIG_LSMOD || BUSYBOX_CONFIG_FEATURE_2_4_MODULES) && !BUSYBOX_CONFIG_MODPROBE_SMALL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support checking for tainted modules. These are usually binary - only modules that will make the linux-kernel list ignore your - support request. - This option is required to support GPLONLY modules. - config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS - bool "Support for module.aliases file" + bool "Support module.aliases file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_ALIAS - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Generate and parse modules.alias containing aliases for bus identifiers: @@ -236,10 +212,9 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_ALIAS Say Y if unsure. config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS - bool "Support for module.symbols file" + bool "Support module.symbols file" default BUSYBOX_DEFAULT_FEATURE_MODUTILS_SYMBOLS - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE - select BUSYBOX_CONFIG_PLATFORM_LINUX + depends on (BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE) && !BUSYBOX_CONFIG_MODPROBE_SMALL help Generate and parse modules.symbols containing aliases for symbol_request() kernel calls, such as: @@ -250,7 +225,7 @@ config BUSYBOX_CONFIG_FEATURE_MODUTILS_SYMBOLS config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR string "Default directory containing modules" default BUSYBOX_DEFAULT_DEFAULT_MODULES_DIR - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO help Directory that contains kernel modules. Defaults to "/lib/modules" @@ -258,9 +233,13 @@ config BUSYBOX_CONFIG_DEFAULT_MODULES_DIR config BUSYBOX_CONFIG_DEFAULT_DEPMOD_FILE string "Default name of modules.dep" default BUSYBOX_DEFAULT_DEFAULT_DEPMOD_FILE - depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODPROBE_SMALL || BUSYBOX_CONFIG_MODINFO + depends on BUSYBOX_CONFIG_DEPMOD || BUSYBOX_CONFIG_MODPROBE || BUSYBOX_CONFIG_MODINFO help Filename that contains kernel modules dependencies. - Defaults to "modules.dep" + Defaults to "modules.dep". + If you configured the "simplified modutils" (MODPROBE_SMALL), a + ".bb" suffix will be added after this name. Do not specify ".bb" + here unless you intend your depmod or modprobe to work on + "modules.dep.bb.bb" or such. endmenu diff --git a/package/utils/busybox/config/networking/Config.in b/package/utils/busybox/config/networking/Config.in index e58746bdd..2d2a1c4a9 100644 --- a/package/utils/busybox/config/networking/Config.in +++ b/package/utils/busybox/config/networking/Config.in @@ -6,6 +6,602 @@ menu "Networking Utilities" +config BUSYBOX_CONFIG_FEATURE_IPV6 + bool "Enable IPv6 support" + default BUSYBOX_DEFAULT_FEATURE_IPV6 + help + Enable IPv6 support in busybox. + This adds IPv6 support in the networking applets. + +config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL + bool "Enable Unix domain socket support (usually not needed)" + default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL + help + Enable Unix domain socket support in all busybox networking + applets. Address of the form local:/path/to/unix/socket + will be recognized. + + This extension is almost never used in real world usage. + You most likely want to say N. + +config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS + bool "Prefer IPv4 addresses from DNS queries" + default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS + depends on BUSYBOX_CONFIG_FEATURE_IPV6 + help + Use IPv4 address of network host if it has one. + + If this option is off, the first returned address will be used. + This may cause problems when your DNS server is IPv6-capable and + is returning IPv6 host addresses too. If IPv6 address + precedes IPv4 one in DNS reply, busybox network applets + (e.g. wget) will use IPv6 address. On an IPv6-incapable host + or network applets will fail to connect to the host + using IPv6 address. + +config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS + bool "Verbose resolution errors" + default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS + help + Enable if you are not satisfied with simplistic + "can't resolve 'hostname.com'" and want to know more. + This may increase size of your executable a bit. + +config BUSYBOX_CONFIG_ARP + bool "arp" + default BUSYBOX_DEFAULT_ARP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manipulate the system ARP cache. +config BUSYBOX_CONFIG_ARPING + bool "arping" + default BUSYBOX_DEFAULT_ARPING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ping hosts by ARP packets. + +config BUSYBOX_CONFIG_BRCTL + bool "brctl" + default BUSYBOX_DEFAULT_BRCTL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Manage ethernet bridges. + Supports addbr/delbr and addif/delif. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + bool "Fancy options" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY + depends on BUSYBOX_CONFIG_BRCTL + help + Add support for extended option like: + setageing, setfd, sethello, setmaxage, + setpathcost, setportprio, setbridgeprio, + stp + This adds about 600 bytes. + +config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW + bool "Support show" + default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW + depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY + help + Add support for option which prints the current config: + show +config BUSYBOX_CONFIG_DNSD + bool "dnsd" + default BUSYBOX_DEFAULT_DNSD + help + Small and static DNS server daemon. +config BUSYBOX_CONFIG_ETHER_WAKE + bool "ether-wake" + default BUSYBOX_DEFAULT_ETHER_WAKE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Send a magic packet to wake up sleeping machines. +config BUSYBOX_CONFIG_FTPD + bool "ftpd" + default BUSYBOX_DEFAULT_FTPD + help + Simple FTP daemon. You have to run it via inetd. + +config BUSYBOX_CONFIG_FEATURE_FTPD_WRITE + bool "Enable upload commands" + default BUSYBOX_DEFAULT_FEATURE_FTPD_WRITE + depends on BUSYBOX_CONFIG_FTPD + help + Enable all kinds of FTP upload commands (-w option) + +config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST + bool "Enable workaround for RFC-violating clients" + default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST + depends on BUSYBOX_CONFIG_FTPD + help + Some ftp clients (among them KDE's Konqueror) issue illegal + "LIST -l" requests. This option works around such problems. + It might prevent you from listing files starting with "-" and + it increases the code size by ~40 bytes. + Most other ftp servers seem to behave similar to this. + +config BUSYBOX_CONFIG_FEATURE_FTPD_AUTHENTICATION + bool "Enable authentication" + default BUSYBOX_DEFAULT_FEATURE_FTPD_AUTHENTICATION + depends on BUSYBOX_CONFIG_FTPD + help + Enable basic system login as seen in telnet etc. +config BUSYBOX_CONFIG_FTPGET + bool "ftpget" + default BUSYBOX_DEFAULT_FTPGET + help + Retrieve a remote file via FTP. + +config BUSYBOX_CONFIG_FTPPUT + bool "ftpput" + default BUSYBOX_DEFAULT_FTPPUT + help + Store a remote file via FTP. + +config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS + bool "Enable long options in ftpget/ftpput" + default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) +config BUSYBOX_CONFIG_HOSTNAME + bool "hostname" + default BUSYBOX_DEFAULT_HOSTNAME + help + Show or set the system's host name. + +config BUSYBOX_CONFIG_DNSDOMAINNAME + bool "dnsdomainname" + default BUSYBOX_DEFAULT_DNSDOMAINNAME + help + Alias to "hostname -d". +config BUSYBOX_CONFIG_HTTPD + bool "httpd" + default BUSYBOX_DEFAULT_HTTPD + help + HTTP server. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES + bool "Support 'Ranges:' header" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd emit "Accept-Ranges: bytes" header and understand + "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted + downloads, seeking in multimedia players etc. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID + bool "Enable -u option" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows the server to run as a specific user + rather than defaulting to the user that starts the server. + Use of this option requires special privileges to change to a + different user. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + bool "Enable Basic http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH + depends on BUSYBOX_CONFIG_HTTPD + help + Utilizes password settings from /etc/httpd.conf for basic + authentication on a per url basis. + Example for httpd.conf file: + /adm:toor:PaSsWd + +config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 + bool "Support MD5 crypted passwords for http Authentication" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH + help + Enables encrypted passwords, and wildcard user/passwords + in httpd.conf file. + User '*' means 'any system user name is ok', + password of '*' means 'use system password for this user' + Examples: + /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 + /adm:root:* + /wiki:*:* + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + bool "Support Common Gateway Interface (CGI)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows scripts and executables to be invoked + when specific URLs are requested. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + bool "Support running scripts through an interpreter" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + This option enables support for running scripts through an + interpreter. Turn this on if you want PHP scripts to work + properly. You need to supply an additional line in your + httpd.conf file: + *.php:/path/to/your/php + +config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + bool "Set REMOTE_PORT environment variable for CGI" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV + depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI + help + Use of this option can assist scripts in generating + references that contain a unique port number. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR + bool "Enable -e option (useful for CGIs written as shell scripts)" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows html encoding of arbitrary strings for display + by the browser. Output goes to stdout. + For example, httpd -e "" produces + "<Hello World>". + +config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES + bool "Support custom error pages" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define custom error pages in + the configuration file instead of the default HTTP status + error pages. For instance, if you add the line: + E404:/path/e404.html + in the config file, the server will respond the specified + '/path/e404.html' file instead of the terse '404 NOT FOUND' + message. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY + bool "Support reverse proxy" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY + depends on BUSYBOX_CONFIG_HTTPD + help + This option allows you to define URLs that will be forwarded + to another HTTP server. To setup add the following line to the + configuration file + P:/url/:http://hostname[:port]/new/path/ + Then a request to /url/myfile will be forwarded to + http://hostname[:port]/new/path/myfile. + +config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP + bool "Support GZIP content encoding" + default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP + depends on BUSYBOX_CONFIG_HTTPD + help + Makes httpd send files using GZIP content encoding if the + client supports it and a pre-compressed .gz exists. +config BUSYBOX_CONFIG_IFCONFIG + bool "ifconfig" + default BUSYBOX_DEFAULT_IFCONFIG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Ifconfig is used to configure the kernel-resident network interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS + bool "Enable status reporting output (+7k)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + If ifconfig is called with no arguments it will display the status + of the currently active interfaces. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP + bool "Enable slip-specific options \"keepalive\" and \"outfill\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow "keepalive" and "outfill" support for SLIP. If you're not + planning on using serial lines, leave this unchecked. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ + depends on BUSYBOX_CONFIG_IFCONFIG + help + Allow the start address for shared memory, start address for I/O, + and/or the interrupt line used by the specified device. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW + bool "Enable option \"hw\" (ether only)" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW + depends on BUSYBOX_CONFIG_IFCONFIG + help + Set the hardware address of this interface, if the device driver + supports this operation. Currently, we only support the 'ether' + class. + +config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS + bool "Set the broadcast automatically" + default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS + depends on BUSYBOX_CONFIG_IFCONFIG + help + Setting this will make ifconfig attempt to find the broadcast + automatically if the value '+' is used. +config BUSYBOX_CONFIG_IFENSLAVE + bool "ifenslave" + default BUSYBOX_DEFAULT_IFENSLAVE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Userspace application to bind several interfaces + to a logical interface (use with kernel bonding driver). +config BUSYBOX_CONFIG_IFPLUGD + bool "ifplugd" + default BUSYBOX_DEFAULT_IFPLUGD + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Network interface plug detection daemon. +config BUSYBOX_CONFIG_IFUP + bool "ifup" + default BUSYBOX_DEFAULT_IFUP + help + Activate the specified interfaces. This applet makes use + of either "ifconfig" and "route" or the "ip" command to actually + configure network interfaces. Therefore, you will probably also want + to enable either IFCONFIG and ROUTE, or enable + FEATURE_IFUPDOWN_IP and the various IP options. Of + course you could use non-busybox versions of these programs, so + against my better judgement (since this will surely result in plenty + of support questions on the mailing list), I do not force you to + enable these additional options. It is up to you to supply either + "ifconfig", "route" and "run-parts" or the "ip" command, either + via busybox or via standalone utilities. + +config BUSYBOX_CONFIG_IFDOWN + bool "ifdown" + default BUSYBOX_DEFAULT_IFDOWN + help + Deactivate the specified interfaces. + +config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH + string "Absolute path to ifstate file" + default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + ifupdown keeps state information in a file called ifstate. + Typically it is located in /var/run/ifstate, however + some distributions tend to put it in other places + (debian, for example, uses /etc/network/run/ifstate). + This config option defines location of ifstate. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP + bool "Use ip tool (else ifconfig/route is used)" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + Use the iproute "ip" command to implement "ifup" and "ifdown", rather + than the default of using the older "ifconfig" and "route" utilities. + + If Y: you must install either the full-blown iproute2 package + or enable "ip" applet in Busybox, or the "ifup" and "ifdown" applets + will not work. + + If N: you must install either the full-blown ifconfig and route + utilities, or enable these applets in Busybox. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 + bool "Support IPv4" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + If you want ifup/ifdown to talk IPv4, leave this on. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 + bool "Support IPv6" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 + depends on (BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN) && BUSYBOX_CONFIG_FEATURE_IPV6 + help + If you need support for IPv6, turn this option on. + + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING + bool "Enable mapping support" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + This enables support for the "mapping" stanza, unless you have + a weird network setup you don't need it. + +config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP + bool "Support external DHCP clients" + default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + This enables support for the external dhcp clients. Clients are + tried in the following order: dhcpcd, dhclient, pump and udhcpc. + Otherwise, if udhcpc applet is enabled, it is used. + Otherwise, ifup/ifdown will have no support for DHCP. +config BUSYBOX_CONFIG_INETD + bool "inetd" + default BUSYBOX_DEFAULT_INETD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + Internet superserver daemon + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + bool "Support echo service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO + depends on BUSYBOX_CONFIG_INETD + help + Echo received data internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + bool "Support discard service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD + depends on BUSYBOX_CONFIG_INETD + help + Internet /dev/null internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME + bool "Support time service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME + depends on BUSYBOX_CONFIG_INETD + help + Return 32 bit time since 1900 internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + bool "Support daytime service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME + depends on BUSYBOX_CONFIG_INETD + help + Return human-readable time internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + bool "Support chargen service" + default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN + depends on BUSYBOX_CONFIG_INETD + help + Familiar character generator internal inetd service + +config BUSYBOX_CONFIG_FEATURE_INETD_RPC + bool "Support RPC services" + default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc + depends on BUSYBOX_CONFIG_INETD + select BUSYBOX_CONFIG_FEATURE_HAVE_RPC + help + Support Sun-RPC based services +config BUSYBOX_CONFIG_IP + bool "ip" + default BUSYBOX_DEFAULT_IP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The "ip" applet is a TCP/IP interface configuration and routing + utility. You generally don't need "ip" to use busybox with + TCP/IP. + +config BUSYBOX_CONFIG_IPADDR + bool "ipaddr" + default BUSYBOX_DEFAULT_IPADDR + select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip addr: ipaddr + +config BUSYBOX_CONFIG_IPLINK + bool "iplink" + default BUSYBOX_DEFAULT_IPLINK + select BUSYBOX_CONFIG_FEATURE_IP_LINK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip link: iplink + +config BUSYBOX_CONFIG_IPROUTE + bool "iproute" + default BUSYBOX_DEFAULT_IPROUTE + select BUSYBOX_CONFIG_FEATURE_IP_ROUTE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip route: iproute + +config BUSYBOX_CONFIG_IPTUNNEL + bool "iptunnel" + default BUSYBOX_DEFAULT_IPTUNNEL + select BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip tunnel: iptunnel + +config BUSYBOX_CONFIG_IPRULE + bool "iprule" + default BUSYBOX_DEFAULT_IPRULE + select BUSYBOX_CONFIG_FEATURE_IP_RULE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip rule: iprule + +config BUSYBOX_CONFIG_IPNEIGH + bool "ipneigh" + default BUSYBOX_DEFAULT_IPNEIGH + select BUSYBOX_CONFIG_FEATURE_IP_NEIGH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Support short form of ip neigh: ipneigh + +config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS + bool "ip address" + default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR + help + Address manipulation support for the "ip" applet. + +config BUSYBOX_CONFIG_FEATURE_IP_LINK + bool "ip link" + default BUSYBOX_DEFAULT_FEATURE_IP_LINK + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPLINK + help + Configure network devices with "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE + bool "ip route" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPROUTE + help + Add support for routing table management to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR + string "ip route configuration directory" + default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR + depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE + help + Location of the "ip" applet routing configuration. + +config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL + bool "ip tunnel" + default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPTUNNEL + help + Add support for tunneling commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_RULE + bool "ip rule" + default BUSYBOX_DEFAULT_FEATURE_IP_RULE + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPRULE + help + Add support for rule commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_NEIGH + bool "ip neighbor" + default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPNEIGH + help + Add support for neighbor commands to "ip". + +config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS + bool "Support displaying rarely used link types" + default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS + depends on BUSYBOX_CONFIG_IP || BUSYBOX_CONFIG_IPADDR || BUSYBOX_CONFIG_IPLINK || BUSYBOX_CONFIG_IPROUTE || BUSYBOX_CONFIG_IPTUNNEL || BUSYBOX_CONFIG_IPRULE || BUSYBOX_CONFIG_IPNEIGH + help + If you are not going to use links of type "frad", "econet", + "bif" etc, you probably don't need to enable this. + Ethernet, wireless, infrared, ppp/slip, ip tunnelling + link types are supported without this option selected. +config BUSYBOX_CONFIG_IPCALC + bool "ipcalc" + default BUSYBOX_DEFAULT_IPCALC + help + ipcalc takes an IP address and netmask and calculates the + resulting broadcast, network, and host range. + +config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS + depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY + bool "Fancy IPCALC, more options, adds 1 kbyte" + default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY + depends on BUSYBOX_CONFIG_IPCALC + help + Adds the options hostname, prefix and silent to the output of + "ipcalc". +config BUSYBOX_CONFIG_FAKEIDENTD + bool "fakeidentd" + default BUSYBOX_DEFAULT_FAKEIDENTD + select BUSYBOX_CONFIG_FEATURE_SYSLOG + help + fakeidentd listens on the ident port and returns a predefined + fake value on any query. config BUSYBOX_CONFIG_NAMEIF bool "nameif" default BUSYBOX_DEFAULT_NAMEIF @@ -72,755 +668,11 @@ config BUSYBOX_CONFIG_NC_110_COMPAT The code is about 2.5k bigger. It enables -s ADDR, -n, -u, -v, -o FILE, -z options, but loses busybox-specific extensions: -f FILE. -config BUSYBOX_CONFIG_PING - bool "ping" - default BUSYBOX_DEFAULT_PING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to - elicit an ICMP ECHO_RESPONSE from a host or gateway. - -config BUSYBOX_CONFIG_PING6 - bool "ping6" - default BUSYBOX_DEFAULT_PING6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_PING - help - This will give you a ping that can talk IPv6. - -config BUSYBOX_CONFIG_FEATURE_FANCY_PING - bool "Enable fancy ping output" - default BUSYBOX_DEFAULT_FEATURE_FANCY_PING - depends on BUSYBOX_CONFIG_PING - help - Make the output from the ping applet include statistics, and at the - same time provide full support for ICMP packets. -config BUSYBOX_CONFIG_WGET - bool "wget" - default BUSYBOX_DEFAULT_WGET - help - wget is a utility for non-interactive download of files from HTTP - and FTP servers. - -config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR - bool "Enable a nifty process meter (+2k)" - default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR - depends on BUSYBOX_CONFIG_WGET - help - Enable the transfer progress bar for wget transfers. - -config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION - bool "Enable HTTP authentication" - default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION - depends on BUSYBOX_CONFIG_WGET - help - Support authenticated HTTP transfers. - -config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS - depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the wget applet. - -config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT - bool "Enable timeout option -T SEC" - default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT - depends on BUSYBOX_CONFIG_WGET - help - Supports network read and connect timeouts for wget, - so that wget will give up and timeout, through the -T - command line option. - - Currently only connect and network data read timeout are - supported (i.e., timeout is not applied to the DNS query). When - FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option - will work in addition to -T. - -config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL - bool "Try to connect to HTTPS using openssl" - default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL - depends on BUSYBOX_CONFIG_WGET - help - Choose how wget establishes SSL connection for https:// URLs. - - Busybox itself contains no SSL code. wget will spawn - a helper program to talk over HTTPS. - - OpenSSL has a simple SSL client for debug purposes. - If you select "openssl" helper, wget will effectively call - "openssl s_client -quiet -connect IP:443 2>/dev/null" - and pipe its data through it. - Note inconvenient API: host resolution is done twice, - and there is no guarantee openssl's idea of IPv6 address - format is the same as ours. - Another problem is that s_client prints debug information - to stderr, and it needs to be suppressed. This means - all error messages get suppressed too. - openssl is also a big binary, often dynamically linked - against ~15 libraries. - -config BUSYBOX_CONFIG_FEATURE_WGET_SSL_HELPER - bool "Try to connect to HTTPS using ssl_helper" - default BUSYBOX_DEFAULT_FEATURE_WGET_SSL_HELPER - depends on BUSYBOX_CONFIG_WGET - help - Choose how wget establishes SSL connection for https:// URLs. - - Busybox itself contains no SSL code. wget will spawn - a helper program to talk over HTTPS. - - ssl_helper is a tool which can be built statically - from busybox sources against a small embedded SSL library. - Please see networking/ssl_helper/README. - It does not require double host resolution and emits - error messages to stderr. - - Precompiled static binary may be available at - http://busybox.net/downloads/binaries/ -config BUSYBOX_CONFIG_WHOIS - bool "whois" - default BUSYBOX_DEFAULT_WHOIS - help - whois is a client for the whois directory service - -config BUSYBOX_CONFIG_FEATURE_IPV6 - bool "Enable IPv6 support" - default BUSYBOX_DEFAULT_FEATURE_IPV6 - help - Enable IPv6 support in busybox. - This adds IPv6 support in the networking applets. - -config BUSYBOX_CONFIG_FEATURE_UNIX_LOCAL - bool "Enable Unix domain socket support (usually not needed)" - default BUSYBOX_DEFAULT_FEATURE_UNIX_LOCAL - help - Enable Unix domain socket support in all busybox networking - applets. Address of the form local:/path/to/unix/socket - will be recognized. - - This extension is almost never used in real world usage. - You most likely want to say N. - -config BUSYBOX_CONFIG_FEATURE_PREFER_IPV4_ADDRESS - bool "Prefer IPv4 addresses from DNS queries" - default BUSYBOX_DEFAULT_FEATURE_PREFER_IPV4_ADDRESS - depends on BUSYBOX_CONFIG_FEATURE_IPV6 - help - Use IPv4 address of network host if it has one. - - If this option is off, the first returned address will be used. - This may cause problems when your DNS server is IPv6-capable and - is returning IPv6 host addresses too. If IPv6 address - precedes IPv4 one in DNS reply, busybox network applets - (e.g. wget) will use IPv6 address. On an IPv6-incapable host - or network applets will fail to connect to the host - using IPv6 address. - -config BUSYBOX_CONFIG_VERBOSE_RESOLUTION_ERRORS - bool "Verbose resolution errors" - default BUSYBOX_DEFAULT_VERBOSE_RESOLUTION_ERRORS - help - Enable if you are not satisfied with simplistic - "can't resolve 'hostname.com'" and want to know more. - This may increase size of your executable a bit. - -config BUSYBOX_CONFIG_ARP - bool "arp" - default BUSYBOX_DEFAULT_ARP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manipulate the system ARP cache. - -config BUSYBOX_CONFIG_ARPING - bool "arping" - default BUSYBOX_DEFAULT_ARPING - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ping hosts by ARP packets. - -config BUSYBOX_CONFIG_BRCTL - bool "brctl" - default BUSYBOX_DEFAULT_BRCTL - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Manage ethernet bridges. - Supports addbr/delbr and addif/delif. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - bool "Fancy options" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_FANCY - depends on BUSYBOX_CONFIG_BRCTL - help - Add support for extended option like: - setageing, setfd, sethello, setmaxage, - setpathcost, setportprio, setbridgeprio, - stp - This adds about 600 bytes. - -config BUSYBOX_CONFIG_FEATURE_BRCTL_SHOW - bool "Support show" - default BUSYBOX_DEFAULT_FEATURE_BRCTL_SHOW - depends on BUSYBOX_CONFIG_BRCTL && BUSYBOX_CONFIG_FEATURE_BRCTL_FANCY - help - Add support for option which prints the current config: - show - -config BUSYBOX_CONFIG_DNSD - bool "dnsd" - default BUSYBOX_DEFAULT_DNSD - help - Small and static DNS server daemon. - -config BUSYBOX_CONFIG_ETHER_WAKE - bool "ether-wake" - default BUSYBOX_DEFAULT_ETHER_WAKE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Send a magic packet to wake up sleeping machines. - -config BUSYBOX_CONFIG_FAKEIDENTD - bool "fakeidentd" - default BUSYBOX_DEFAULT_FAKEIDENTD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - fakeidentd listens on the ident port and returns a predefined - fake value on any query. - -config BUSYBOX_CONFIG_FTPD - bool "ftpd" - default BUSYBOX_DEFAULT_FTPD - help - simple FTP daemon. You have to run it via inetd. - -config BUSYBOX_CONFIG_FEATURE_FTP_WRITE - bool "Enable upload commands" - default BUSYBOX_DEFAULT_FEATURE_FTP_WRITE - depends on BUSYBOX_CONFIG_FTPD - help - Enable all kinds of FTP upload commands (-w option) - -config BUSYBOX_CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST - bool "Enable workaround for RFC-violating clients" - default BUSYBOX_DEFAULT_FEATURE_FTPD_ACCEPT_BROKEN_LIST - depends on BUSYBOX_CONFIG_FTPD - help - Some ftp clients (among them KDE's Konqueror) issue illegal - "LIST -l" requests. This option works around such problems. - It might prevent you from listing files starting with "-" and - it increases the code size by ~40 bytes. - Most other ftp servers seem to behave similar to this. - -config BUSYBOX_CONFIG_FEATURE_FTP_AUTHENTICATION - bool "Enable authentication" - default BUSYBOX_DEFAULT_FEATURE_FTP_AUTHENTICATION - depends on BUSYBOX_CONFIG_FTPD - help - Enable basic system login as seen in telnet etc. - -config BUSYBOX_CONFIG_FTPGET - bool "ftpget" - default BUSYBOX_DEFAULT_FTPGET - help - Retrieve a remote file via FTP. - -config BUSYBOX_CONFIG_FTPPUT - bool "ftpput" - default BUSYBOX_DEFAULT_FTPPUT - help - Store a remote file via FTP. - -config BUSYBOX_CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS - bool "Enable long options in ftpget/ftpput" - default BUSYBOX_DEFAULT_FEATURE_FTPGETPUT_LONG_OPTIONS - depends on BUSYBOX_CONFIG_LONG_OPTS && (BUSYBOX_CONFIG_FTPGET || BUSYBOX_CONFIG_FTPPUT) - help - Support long options for the ftpget/ftpput applet. - -config BUSYBOX_CONFIG_HOSTNAME - bool "hostname" - default BUSYBOX_DEFAULT_HOSTNAME - help - Show or set the system's host name. - -config BUSYBOX_CONFIG_HTTPD - bool "httpd" - default BUSYBOX_DEFAULT_HTTPD - help - Serve web pages via an HTTP server. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_RANGES - bool "Support 'Ranges:' header" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_RANGES - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd emit "Accept-Ranges: bytes" header and understand - "Range: bytes=NNN-[MMM]" header. Allows for resuming interrupted - downloads, seeking in multimedia players etc. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SETUID - bool "Enable -u option" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SETUID - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows the server to run as a specific user - rather than defaulting to the user that starts the server. - Use of this option requires special privileges to change to a - different user. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - bool "Enable Basic http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_BASIC_AUTH - depends on BUSYBOX_CONFIG_HTTPD - help - Utilizes password settings from /etc/httpd.conf for basic - authentication on a per url basis. - Example for httpd.conf file: - /adm:toor:PaSsWd - -config BUSYBOX_CONFIG_FEATURE_HTTPD_AUTH_MD5 - bool "Support MD5 crypted passwords for http Authentication" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_AUTH_MD5 - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_BASIC_AUTH - help - Enables encrypted passwords, and wildcard user/passwords - in httpd.conf file. - User '*' means 'any system user name is ok', - password of '*' means 'use system password for this user' - Examples: - /adm:toor:$1$P/eKnWXS$aI1aPGxT.dJD5SzqAKWrF0 - /adm:root:* - /wiki:*:* - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - bool "Support Common Gateway Interface (CGI)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CGI - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows scripts and executables to be invoked - when specific URLs are requested. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - bool "Support for running scripts through an interpreter" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - This option enables support for running scripts through an - interpreter. Turn this on if you want PHP scripts to work - properly. You need to supply an additional line in your - httpd.conf file: - *.php:/path/to/your/php - -config BUSYBOX_CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - bool "Set REMOTE_PORT environment variable for CGI" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV - depends on BUSYBOX_CONFIG_FEATURE_HTTPD_CGI - help - Use of this option can assist scripts in generating - references that contain a unique port number. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ENCODE_URL_STR - bool "Enable -e option (useful for CGIs written as shell scripts)" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ENCODE_URL_STR - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows html encoding of arbitrary strings for display - by the browser. Output goes to stdout. - For example, httpd -e "" produces - "<Hello World>". - -config BUSYBOX_CONFIG_FEATURE_HTTPD_ERROR_PAGES - bool "Support for custom error pages" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_ERROR_PAGES - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define custom error pages in - the configuration file instead of the default HTTP status - error pages. For instance, if you add the line: - E404:/path/e404.html - in the config file, the server will respond the specified - '/path/e404.html' file instead of the terse '404 NOT FOUND' - message. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_PROXY - bool "Support for reverse proxy" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_PROXY - depends on BUSYBOX_CONFIG_HTTPD - help - This option allows you to define URLs that will be forwarded - to another HTTP server. To setup add the following line to the - configuration file - P:/url/:http://hostname[:port]/new/path/ - Then a request to /url/myfile will be forwarded to - http://hostname[:port]/new/path/myfile. - -config BUSYBOX_CONFIG_FEATURE_HTTPD_GZIP - bool "Support for GZIP content encoding" - default BUSYBOX_DEFAULT_FEATURE_HTTPD_GZIP - depends on BUSYBOX_CONFIG_HTTPD - help - Makes httpd send files using GZIP content encoding if the - client supports it and a pre-compressed .gz exists. - -config BUSYBOX_CONFIG_IFCONFIG - bool "ifconfig" - default BUSYBOX_DEFAULT_IFCONFIG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Ifconfig is used to configure the kernel-resident network interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_STATUS - bool "Enable status reporting output (+7k)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_STATUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - If ifconfig is called with no arguments it will display the status - of the currently active interfaces. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_SLIP - bool "Enable slip-specific options \"keepalive\" and \"outfill\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_SLIP - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow "keepalive" and "outfill" support for SLIP. If you're not - planning on using serial lines, leave this unchecked. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - bool "Enable options \"mem_start\", \"io_addr\", and \"irq\"" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ - depends on BUSYBOX_CONFIG_IFCONFIG - help - Allow the start address for shared memory, start address for I/O, - and/or the interrupt line used by the specified device. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_HW - bool "Enable option \"hw\" (ether only)" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_HW - depends on BUSYBOX_CONFIG_IFCONFIG - help - Set the hardware address of this interface, if the device driver - supports this operation. Currently, we only support the 'ether' - class. - -config BUSYBOX_CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS - bool "Set the broadcast automatically" - default BUSYBOX_DEFAULT_FEATURE_IFCONFIG_BROADCAST_PLUS - depends on BUSYBOX_CONFIG_IFCONFIG - help - Setting this will make ifconfig attempt to find the broadcast - automatically if the value '+' is used. - -config BUSYBOX_CONFIG_IFENSLAVE - bool "ifenslave" - default BUSYBOX_DEFAULT_IFENSLAVE - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Userspace application to bind several interfaces - to a logical interface (use with kernel bonding driver). - -config BUSYBOX_CONFIG_IFPLUGD - bool "ifplugd" - default BUSYBOX_DEFAULT_IFPLUGD - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Network interface plug detection daemon. - -config BUSYBOX_CONFIG_IFUPDOWN - bool "ifupdown" - default BUSYBOX_DEFAULT_IFUPDOWN - help - Activate or deactivate the specified interfaces. This applet makes - use of either "ifconfig" and "route" or the "ip" command to actually - configure network interfaces. Therefore, you will probably also want - to enable either IFCONFIG and ROUTE, or enable - FEATURE_IFUPDOWN_IP and the various IP options. Of - course you could use non-busybox versions of these programs, so - against my better judgement (since this will surely result in plenty - of support questions on the mailing list), I do not force you to - enable these additional options. It is up to you to supply either - "ifconfig", "route" and "run-parts" or the "ip" command, either - via busybox or via standalone utilities. - -config BUSYBOX_CONFIG_IFUPDOWN_IFSTATE_PATH - string "Absolute path to ifstate file" - default BUSYBOX_DEFAULT_IFUPDOWN_IFSTATE_PATH - depends on BUSYBOX_CONFIG_IFUPDOWN - help - ifupdown keeps state information in a file called ifstate. - Typically it is located in /var/run/ifstate, however - some distributions tend to put it in other places - (debian, for example, uses /etc/network/run/ifstate). - This config option defines location of ifstate. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - bool "Use ip applet" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP - depends on BUSYBOX_CONFIG_IFUPDOWN - help - Use the iproute "ip" command to implement "ifup" and "ifdown", rather - than the default of using the older 'ifconfig' and 'route' utilities. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN - bool "Use busybox ip applet" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IP_BUILTIN - depends on BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_IP - select BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - select BUSYBOX_CONFIG_FEATURE_IP_LINK - select BUSYBOX_CONFIG_FEATURE_IP_ROUTE - help - Use the busybox iproute "ip" applet to implement "ifupdown". - - If left disabled, you must install the full-blown iproute2 - utility or the "ifup" and "ifdown" applets will not work. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - bool "Use busybox ifconfig and route applets" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN - depends on BUSYBOX_CONFIG_IFUPDOWN && !BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IP - select BUSYBOX_CONFIG_IFCONFIG - select BUSYBOX_CONFIG_ROUTE - help - Use the busybox iproute "ifconfig" and "route" applets to - implement the "ifup" and "ifdown" utilities. - - If left disabled, you must install the full-blown ifconfig - and route utilities, or the "ifup" and "ifdown" applets will not - work. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV4 - bool "Support for IPv4" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV4 - depends on BUSYBOX_CONFIG_IFUPDOWN - help - If you want ifup/ifdown to talk IPv4, leave this on. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_IPV6 - bool "Support for IPv6" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_IPV6 - depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_FEATURE_IPV6 - help - If you need support for IPv6, turn this option on. - -### UNUSED -###config FEATURE_IFUPDOWN_IPX -### bool "Support for IPX" -### default y -### depends on IFUPDOWN -### help -### If this option is selected you can use busybox to work with IPX -### networks. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_MAPPING - bool "Enable mapping support" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_MAPPING - depends on BUSYBOX_CONFIG_IFUPDOWN - help - This enables support for the "mapping" stanza, unless you have - a weird network setup you don't need it. - -config BUSYBOX_CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP - bool "Support for external dhcp clients" - default BUSYBOX_DEFAULT_FEATURE_IFUPDOWN_EXTERNAL_DHCP - depends on BUSYBOX_CONFIG_IFUPDOWN - help - This enables support for the external dhcp clients. Clients are - tried in the following order: dhcpcd, dhclient, pump and udhcpc. - Otherwise, if udhcpc applet is enabled, it is used. - Otherwise, ifup/ifdown will have no support for DHCP. - -config BUSYBOX_CONFIG_INETD - bool "inetd" - default BUSYBOX_DEFAULT_INETD - select BUSYBOX_CONFIG_FEATURE_SYSLOG - help - Internet superserver daemon - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - bool "Support echo service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_ECHO - depends on BUSYBOX_CONFIG_INETD - help - Echo received data internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - bool "Support discard service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD - depends on BUSYBOX_CONFIG_INETD - help - Internet /dev/null internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME - bool "Support time service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_TIME - depends on BUSYBOX_CONFIG_INETD - help - Return 32 bit time since 1900 internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - bool "Support daytime service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME - depends on BUSYBOX_CONFIG_INETD - help - Return human-readable time internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - bool "Support chargen service" - default BUSYBOX_DEFAULT_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN - depends on BUSYBOX_CONFIG_INETD - help - Familiar character generator internal inetd service - -config BUSYBOX_CONFIG_FEATURE_INETD_RPC - bool "Support RPC services" - default BUSYBOX_DEFAULT_FEATURE_INETD_RPC # very rarely used, and needs Sun RPC support in libc - depends on BUSYBOX_CONFIG_INETD - select BUSYBOX_CONFIG_FEATURE_HAVE_RPC - help - Support Sun-RPC based services - -config BUSYBOX_CONFIG_IP - bool "ip" - default BUSYBOX_DEFAULT_IP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The "ip" applet is a TCP/IP interface configuration and routing - utility. You generally don't need "ip" to use busybox with - TCP/IP. - -config BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - bool "ip address" - default BUSYBOX_DEFAULT_FEATURE_IP_ADDRESS - depends on BUSYBOX_CONFIG_IP - help - Address manipulation support for the "ip" applet. - -config BUSYBOX_CONFIG_FEATURE_IP_LINK - bool "ip link" - default BUSYBOX_DEFAULT_FEATURE_IP_LINK - depends on BUSYBOX_CONFIG_IP - help - Configure network devices with "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE - bool "ip route" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE - depends on BUSYBOX_CONFIG_IP - help - Add support for routing table management to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_ROUTE_DIR - string "ip route configuration directory" - default BUSYBOX_DEFAULT_FEATURE_IP_ROUTE_DIR - depends on BUSYBOX_CONFIG_FEATURE_IP_ROUTE - help - Location of the "ip" applet routing configuration. - -config BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - bool "ip tunnel" - default BUSYBOX_DEFAULT_FEATURE_IP_TUNNEL - depends on BUSYBOX_CONFIG_IP - help - Add support for tunneling commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_RULE - bool "ip rule" - default BUSYBOX_DEFAULT_FEATURE_IP_RULE - depends on BUSYBOX_CONFIG_IP - help - Add support for rule commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_NEIGH - bool "ip neighbor" - default BUSYBOX_DEFAULT_FEATURE_IP_NEIGH - depends on BUSYBOX_CONFIG_IP - help - Add support for neighbor commands to "ip". - -config BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS - bool "Support short forms of ip commands" - default BUSYBOX_DEFAULT_FEATURE_IP_SHORT_FORMS - depends on BUSYBOX_CONFIG_IP - help - Also support short-form of ip commands: - ip addr -> ipaddr - ip link -> iplink - ip route -> iproute - ip tunnel -> iptunnel - ip rule -> iprule - ip neigh -> ipneigh - - Say N unless you desparately need the short form of the ip - object commands. - -config BUSYBOX_CONFIG_FEATURE_IP_RARE_PROTOCOLS - bool "Support displaying rarely used link types" - default BUSYBOX_DEFAULT_FEATURE_IP_RARE_PROTOCOLS - depends on BUSYBOX_CONFIG_IP - help - If you are not going to use links of type "frad", "econet", - "bif" etc, you probably don't need to enable this. - Ethernet, wireless, infrared, ppp/slip, ip tunnelling - link types are supported without this option selected. - -config BUSYBOX_CONFIG_IPADDR - bool - default BUSYBOX_DEFAULT_IPADDR - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ADDRESS - -config BUSYBOX_CONFIG_IPLINK - bool - default BUSYBOX_DEFAULT_IPLINK - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_LINK - -config BUSYBOX_CONFIG_IPROUTE - bool - default BUSYBOX_DEFAULT_IPROUTE - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_ROUTE - -config BUSYBOX_CONFIG_IPTUNNEL - bool - default BUSYBOX_DEFAULT_IPTUNNEL - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_TUNNEL - -config BUSYBOX_CONFIG_IPRULE - bool - default BUSYBOX_DEFAULT_IPRULE - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_RULE - -config BUSYBOX_CONFIG_IPNEIGH - bool - default BUSYBOX_DEFAULT_IPNEIGH - depends on BUSYBOX_CONFIG_FEATURE_IP_SHORT_FORMS && BUSYBOX_CONFIG_FEATURE_IP_NEIGH - -config BUSYBOX_CONFIG_IPCALC - bool "ipcalc" - default BUSYBOX_DEFAULT_IPCALC - help - ipcalc takes an IP address and netmask and calculates the - resulting broadcast, network, and host range. - -config BUSYBOX_CONFIG_FEATURE_IPCALC_FANCY - bool "Fancy IPCALC, more options, adds 1 kbyte" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_FANCY - depends on BUSYBOX_CONFIG_IPCALC - help - Adds the options hostname, prefix and silent to the output of - "ipcalc". - -config BUSYBOX_CONFIG_FEATURE_IPCALC_LONG_OPTIONS - bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_IPCALC_LONG_OPTIONS - depends on BUSYBOX_CONFIG_IPCALC && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the ipcalc applet. - config BUSYBOX_CONFIG_NETMSG bool "netmsg" default BUSYBOX_DEFAULT_NETMSG help simple program for sending udp broadcast messages - config BUSYBOX_CONFIG_NETSTAT bool "netstat" default BUSYBOX_DEFAULT_NETSTAT @@ -829,7 +681,7 @@ config BUSYBOX_CONFIG_NETSTAT netstat prints information about the Linux networking subsystem. config BUSYBOX_CONFIG_FEATURE_NETSTAT_WIDE - bool "Enable wide netstat output" + bool "Enable wide output" default BUSYBOX_DEFAULT_FEATURE_NETSTAT_WIDE depends on BUSYBOX_CONFIG_NETSTAT help @@ -843,27 +695,24 @@ config BUSYBOX_CONFIG_FEATURE_NETSTAT_PRG help Add support for -p flag to print out PID and program name. +700 bytes of code. - config BUSYBOX_CONFIG_NSLOOKUP bool "nslookup" default BUSYBOX_DEFAULT_NSLOOKUP help nslookup is a tool to query Internet name servers. - -config BUSYBOX_CONFIG_NSLOOKUP_LEDE +config BUSYBOX_CONFIG_NSLOOKUP_OPENWRT bool "nslookup_lede" depends on !BUSYBOX_CONFIG_NSLOOKUP - default BUSYBOX_DEFAULT_NSLOOKUP_LEDE + default BUSYBOX_DEFAULT_NSLOOKUP_OPENWRT help - nslookup is a tool to query Internet name servers (LEDE flavor). + nslookup is a tool to query Internet name servers (OpenWrt flavor). -config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS +config BUSYBOX_CONFIG_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS bool "Enable long options" - default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS - depends on BUSYBOX_CONFIG_NSLOOKUP_LEDE && BUSYBOX_CONFIG_LONG_OPTS + default BUSYBOX_DEFAULT_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + depends on BUSYBOX_CONFIG_NSLOOKUP_OPENWRT && BUSYBOX_CONFIG_LONG_OPTS help Support long options for the nslookup applet. - config BUSYBOX_CONFIG_NTPD bool "ntpd" default BUSYBOX_DEFAULT_NTPD @@ -886,20 +735,39 @@ config BUSYBOX_CONFIG_FEATURE_NTPD_CONF help Make ntpd look in /etc/ntp.conf for peers. Only "server address" is supported. +config BUSYBOX_CONFIG_PING + bool "ping" + default BUSYBOX_DEFAULT_PING + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to + elicit an ICMP ECHO_RESPONSE from a host or gateway. +config BUSYBOX_CONFIG_PING6 + bool "ping6" + default BUSYBOX_DEFAULT_PING6 + depends on BUSYBOX_CONFIG_FEATURE_IPV6 + help + This will give you a ping that can talk IPv6. + +config BUSYBOX_CONFIG_FEATURE_FANCY_PING + bool "Enable fancy ping output" + default BUSYBOX_DEFAULT_FEATURE_FANCY_PING + depends on BUSYBOX_CONFIG_PING || BUSYBOX_CONFIG_PING6 + help + Make the output from the ping applet include statistics, and at the + same time provide full support for ICMP packets. config BUSYBOX_CONFIG_PSCAN bool "pscan" default BUSYBOX_DEFAULT_PSCAN help Simple network port scanner. - config BUSYBOX_CONFIG_ROUTE bool "route" default BUSYBOX_DEFAULT_ROUTE select BUSYBOX_CONFIG_PLATFORM_LINUX help Route displays or manipulates the kernel's IP routing tables. - config BUSYBOX_CONFIG_SLATTACH bool "slattach" default BUSYBOX_DEFAULT_SLATTACH @@ -907,17 +775,12 @@ config BUSYBOX_CONFIG_SLATTACH help slattach is a small utility to attach network interfaces to serial lines. - -#config TC -# bool "tc" -# default y -# help -# show / manipulate traffic control settings -# -#config FEATURE_TC_INGRESS -# def_bool n -# depends on TC - +config BUSYBOX_CONFIG_SSL_CLIENT + bool "ssl_client" + default BUSYBOX_DEFAULT_SSL_CLIENT + select BUSYBOX_CONFIG_TLS + help + This tool pipes data to/from a socket, TLS-encrypting it. config BUSYBOX_CONFIG_TCPSVD bool "tcpsvd" default BUSYBOX_DEFAULT_TCPSVD @@ -925,6 +788,12 @@ config BUSYBOX_CONFIG_TCPSVD tcpsvd listens on a TCP port and runs a program for each new connection. +config BUSYBOX_CONFIG_UDPSVD + bool "udpsvd" + default BUSYBOX_DEFAULT_UDPSVD + help + udpsvd listens on an UDP port and runs a program for each new + connection. config BUSYBOX_CONFIG_TELNET bool "telnet" default BUSYBOX_DEFAULT_TELNET @@ -951,6 +820,10 @@ config BUSYBOX_CONFIG_FEATURE_TELNET_AUTOLOGIN log into a machine without telling the username (autologin). This option enables `-a' and `-l USER' arguments. +config BUSYBOX_CONFIG_FEATURE_TELNET_WIDTH + bool "Enable window size autodetection" + default BUSYBOX_DEFAULT_FEATURE_TELNET_WIDTH + depends on BUSYBOX_CONFIG_TELNET config BUSYBOX_CONFIG_TELNETD bool "telnetd" default BUSYBOX_DEFAULT_TELNETD @@ -992,7 +865,6 @@ config BUSYBOX_CONFIG_TELNETD with all that done, telnetd _should_ work.... - config BUSYBOX_CONFIG_FEATURE_TELNETD_STANDALONE bool "Support standalone telnetd (not inetd only)" default BUSYBOX_DEFAULT_FEATURE_TELNETD_STANDALONE @@ -1020,7 +892,6 @@ config BUSYBOX_CONFIG_FEATURE_TELNETD_INETD_WAIT This option is rarely used. "tcp nowait" is much more usual way of running tcp services, including telnetd. You most probably want to say N here. - config BUSYBOX_CONFIG_TFTP bool "tftp" default BUSYBOX_DEFAULT_TFTP @@ -1072,11 +943,9 @@ config BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE "blksize" and "tsize" options. config BUSYBOX_CONFIG_FEATURE_TFTP_PROGRESS_BAR - bool "Enable tftp progress meter" + bool "Enable progress bar" default BUSYBOX_DEFAULT_FEATURE_TFTP_PROGRESS_BAR depends on BUSYBOX_CONFIG_TFTP && BUSYBOX_CONFIG_FEATURE_TFTP_BLOCKSIZE - help - Show progress bar. config BUSYBOX_CONFIG_TFTP_DEBUG bool "Enable debug" @@ -1085,7 +954,9 @@ config BUSYBOX_CONFIG_TFTP_DEBUG help Make tftp[d] print debugging messages on stderr. This is useful if you are diagnosing a bug in tftp[d]. - +config BUSYBOX_CONFIG_TLS + bool #No description makes it a hidden option + default BUSYBOX_DEFAULT_TLS config BUSYBOX_CONFIG_TRACEROUTE bool "traceroute" default BUSYBOX_DEFAULT_TRACEROUTE @@ -1096,33 +967,22 @@ config BUSYBOX_CONFIG_TRACEROUTE config BUSYBOX_CONFIG_TRACEROUTE6 bool "traceroute6" default BUSYBOX_DEFAULT_TRACEROUTE6 - depends on BUSYBOX_CONFIG_FEATURE_IPV6 && BUSYBOX_CONFIG_TRACEROUTE + depends on BUSYBOX_CONFIG_FEATURE_IPV6 help Utility to trace the route of IPv6 packets. config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_VERBOSE bool "Enable verbose output" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_VERBOSE - depends on BUSYBOX_CONFIG_TRACEROUTE + depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 help Add some verbosity to traceroute. This includes among other things hostnames and ICMP response types. -config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE - bool "Enable loose source route" - default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_SOURCE_ROUTE - depends on BUSYBOX_CONFIG_TRACEROUTE - help - Add option to specify a loose source route gateway - (8 maximum). - config BUSYBOX_CONFIG_FEATURE_TRACEROUTE_USE_ICMP - bool "Use ICMP instead of UDP" + bool "Enable -I option (use ICMP instead of UDP)" default BUSYBOX_DEFAULT_FEATURE_TRACEROUTE_USE_ICMP - depends on BUSYBOX_CONFIG_TRACEROUTE - help - Add option -I to use ICMP ECHO instead of UDP datagrams. - + depends on BUSYBOX_CONFIG_TRACEROUTE || BUSYBOX_CONFIG_TRACEROUTE6 config BUSYBOX_CONFIG_TUNCTL bool "tunctl" default BUSYBOX_DEFAULT_TUNCTL @@ -1137,32 +997,123 @@ config BUSYBOX_CONFIG_FEATURE_TUNCTL_UG help Allow to specify owner and group of newly created interface. 340 bytes of pure bloat. Say no here. - -source udhcp/Config.in - -config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS - string "ifup udhcpc command line options" - default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS - depends on BUSYBOX_CONFIG_IFUPDOWN && BUSYBOX_CONFIG_UDHCPC - help - Command line options to pass to udhcpc from ifup. - Intended to alter options not available in /etc/network/interfaces. - (IE: --syslog --background etc...) - -config BUSYBOX_CONFIG_UDPSVD - bool "udpsvd" - default BUSYBOX_DEFAULT_UDPSVD - help - udpsvd listens on an UDP port and runs a program for each new - connection. - config BUSYBOX_CONFIG_VCONFIG bool "vconfig" default BUSYBOX_DEFAULT_VCONFIG select BUSYBOX_CONFIG_PLATFORM_LINUX help Creates, removes, and configures VLAN interfaces +config BUSYBOX_CONFIG_WGET + bool "wget" + default BUSYBOX_DEFAULT_WGET + help + wget is a utility for non-interactive download of files from HTTP + and FTP servers. +config BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS + bool "Enable long options" + default BUSYBOX_DEFAULT_FEATURE_WGET_LONG_OPTIONS + depends on BUSYBOX_CONFIG_WGET && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR + bool "Enable progress bar (+2k)" + default BUSYBOX_DEFAULT_FEATURE_WGET_STATUSBAR + depends on BUSYBOX_CONFIG_WGET + +config BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION + bool "Enable HTTP authentication" + default BUSYBOX_DEFAULT_FEATURE_WGET_AUTHENTICATION + depends on BUSYBOX_CONFIG_WGET + help + Support authenticated HTTP transfers. + +config BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT + bool "Enable timeout option -T SEC" + default BUSYBOX_DEFAULT_FEATURE_WGET_TIMEOUT + depends on BUSYBOX_CONFIG_WGET + help + Supports network read and connect timeouts for wget, + so that wget will give up and timeout, through the -T + command line option. + + Currently only connect and network data read timeout are + supported (i.e., timeout is not applied to the DNS query). When + FEATURE_WGET_LONG_OPTIONS is also enabled, the --timeout option + will work in addition to -T. + +config BUSYBOX_CONFIG_FEATURE_WGET_HTTPS + bool "Support HTTPS using internal TLS code" + default BUSYBOX_DEFAULT_FEATURE_WGET_HTTPS + depends on BUSYBOX_CONFIG_WGET + select BUSYBOX_CONFIG_TLS + help + wget will use internal TLS code to connect to https:// URLs. + Note: + On NOMMU machines, ssl_helper applet should be available + in the $PATH for this to work. Make sure to select that applet. + + Note: currently, TLS code only makes TLS I/O work, it + does *not* check that the peer is who it claims to be, etc. + IOW: it uses peer-supplied public keys to establish encryption + and signing keys, then encrypts and signs outgoing data and + decrypts incoming data. + It does not check signature hashes on the incoming data: + this means that attackers manipulating TCP packets can + send altered data and we unknowingly receive garbage. + (This check might be relatively easy to add). + It does not check public key's certificate: + this means that the peer may be an attacker impersonating + the server we think we are talking to. + + If you think this is unacceptable, consider this. As more and more + servers switch to HTTPS-only operation, without such "crippled" + TLS code it is *impossible* to simply download a kernel source + from kernel.org. Which can in real world translate into + "my small automatic tooling to build cross-compilers from sources + no longer works, I need to additionally keep a local copy + of ~4 megabyte source tarball of a SSL library and ~2 megabyte + source of wget, need to compile and built both before I can + download anything. All this despite the fact that the build + is done in a QEMU sandbox on a machine with absolutely nothing + worth stealing, so I don't care if someone would go to a lot + of trouble to intercept my HTTPS download to send me an altered + kernel tarball". + + If you still think this is unacceptable, send patches. + + If you still think this is unacceptable, do not want to send + patches, but do want to waste bandwidth expaining how wrong + it is, you will be ignored. + +config BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL + bool "Try to connect to HTTPS using openssl" + default BUSYBOX_DEFAULT_FEATURE_WGET_OPENSSL + depends on BUSYBOX_CONFIG_WGET + help + Try to use openssl to handle HTTPS. + + OpenSSL has a simple SSL client for debug purposes. + If you select this option, wget will effectively run: + "openssl s_client -quiet -connect hostname:443 + -servername hostname 2>/dev/null" and pipe its data + through it. -servername is not used if hostname is numeric. + Note inconvenient API: host resolution is done twice, + and there is no guarantee openssl's idea of IPv6 address + format is the same as ours. + Another problem is that s_client prints debug information + to stderr, and it needs to be suppressed. This means + all error messages get suppressed too. + openssl is also a big binary, often dynamically linked + against ~15 libraries. + + If openssl can't be executed, internal TLS code will be used + (if you enabled it); if openssl can be executed but fails later, + wget can't detect this, and download will fail. +config BUSYBOX_CONFIG_WHOIS + bool "whois" + default BUSYBOX_DEFAULT_WHOIS + help + whois is a client for the whois directory service config BUSYBOX_CONFIG_ZCIP bool "zcip" default BUSYBOX_DEFAULT_ZCIP @@ -1176,4 +1127,15 @@ config BUSYBOX_CONFIG_ZCIP See http://www.zeroconf.org for further details, and "zcip.script" in the busybox examples. +source udhcp/Config.in + +config BUSYBOX_CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS + string "ifup udhcpc command line options" + default BUSYBOX_DEFAULT_IFUPDOWN_UDHCPC_CMD_OPTIONS + depends on BUSYBOX_CONFIG_IFUP || BUSYBOX_CONFIG_IFDOWN + help + Command line options to pass to udhcpc from ifup. + Intended to alter options not available in /etc/network/interfaces. + (IE: --syslog --background etc...) + endmenu diff --git a/package/utils/busybox/config/networking/udhcp/Config.in b/package/utils/busybox/config/networking/udhcp/Config.in index 4f4840022..e7a98750d 100644 --- a/package/utils/busybox/config/networking/udhcp/Config.in +++ b/package/utils/busybox/config/networking/udhcp/Config.in @@ -5,38 +5,44 @@ # config BUSYBOX_CONFIG_UDHCPC6 - bool "udhcp client for DHCPv6 (udhcpc6)" + bool "udhcpc6 (DHCPv6 client, EXPERIMENTAL)" default BUSYBOX_DEFAULT_UDHCPC6 # not yet ready depends on BUSYBOX_CONFIG_FEATURE_IPV6 help udhcpc6 is a DHCPv6 client +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC3646 + bool "Support RFC 3646 (DNS server and search list)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC3646 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + List of DNS servers and domain search list can be requested with + "-O dns" and "-O search". If server gives these values, + they will be set in environment variables "dns" and "search". + +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4704 + bool "Support RFC 4704 (Client FQDN)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4704 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + You can request FQDN to be given by server using "-O fqdn". + +config BUSYBOX_CONFIG_FEATURE_UDHCPC6_RFC4833 + bool "Support RFC 4833 (Timezones)" + default BUSYBOX_DEFAULT_FEATURE_UDHCPC6_RFC4833 + depends on BUSYBOX_CONFIG_UDHCPC6 + help + You can request POSIX timezone with "-O tz" and timezone name + with "-O timezone". + config BUSYBOX_CONFIG_UDHCPD - bool "udhcp server (udhcpd)" + bool "udhcpd (DHCP server)" default BUSYBOX_DEFAULT_UDHCPD select BUSYBOX_CONFIG_PLATFORM_LINUX help udhcpd is a DHCP server geared primarily toward embedded systems, while striving to be fully functional and RFC compliant. -config BUSYBOX_CONFIG_DHCPRELAY - bool "dhcprelay" - default BUSYBOX_DEFAULT_DHCPRELAY - depends on BUSYBOX_CONFIG_UDHCPD - help - dhcprelay listens for dhcp requests on one or more interfaces - and forwards these requests to a different interface or dhcp - server. - -config BUSYBOX_CONFIG_DUMPLEASES - bool "Lease display utility (dumpleases)" - default BUSYBOX_DEFAULT_DUMPLEASES - depends on BUSYBOX_CONFIG_UDHCPD - help - dumpleases displays the leases written out by the udhcpd server. - Lease times are stored in the file by time remaining in lease, or - by the absolute time that it expires in seconds from epoch. - config BUSYBOX_CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY bool "Rewrite the lease file at every new acknowledge" default BUSYBOX_DEFAULT_FEATURE_UDHCPD_WRITE_LEASES_EARLY @@ -69,8 +75,24 @@ config BUSYBOX_CONFIG_DHCPD_LEASES_FILE udhcpd stores addresses in a lease file. This is the absolute path of the file. Normally it is safe to leave it untouched. +config BUSYBOX_CONFIG_DUMPLEASES + bool "dumpleases" + default BUSYBOX_DEFAULT_DUMPLEASES + help + dumpleases displays the leases written out by the udhcpd. + Lease times are stored in the file by time remaining in lease, or + by the absolute time that it expires in seconds from epoch. + +config BUSYBOX_CONFIG_DHCPRELAY + bool "dhcprelay" + default BUSYBOX_DEFAULT_DHCPRELAY + help + dhcprelay listens for dhcp requests on one or more interfaces + and forwards these requests to a different interface or dhcp + server. + config BUSYBOX_CONFIG_UDHCPC - bool "udhcp client (udhcpc)" + bool "udhcpc (DHCP client)" default BUSYBOX_DEFAULT_UDHCPC select BUSYBOX_CONFIG_PLATFORM_LINUX help @@ -101,6 +123,15 @@ config BUSYBOX_CONFIG_FEATURE_UDHCPC_SANITIZEOPT they will be replaced with string "bad" when exporting to the environment. +config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT + string "Absolute path to config script" + default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT + depends on BUSYBOX_CONFIG_UDHCPC + help + This script is called after udhcpc receives an answer. See + examples/udhcp for a working example. Normally it is safe + to leave this untouched. + config BUSYBOX_CONFIG_FEATURE_UDHCP_PORT bool "Enable '-P port' option for udhcpd and udhcpc" default BUSYBOX_DEFAULT_FEATURE_UDHCP_PORT @@ -122,7 +153,7 @@ config BUSYBOX_CONFIG_UDHCP_DEBUG are very verbose and useful for debugging only. config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 - bool "Support for RFC3397 domain search (experimental)" + bool "Support RFC3397 domain search (experimental)" default BUSYBOX_DEFAULT_FEATURE_UDHCP_RFC3397 depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help @@ -131,22 +162,13 @@ config BUSYBOX_CONFIG_FEATURE_UDHCP_RFC3397 and SIP servers option 120, specified in RFC 3361. config BUSYBOX_CONFIG_FEATURE_UDHCP_8021Q - bool "Support for 802.1Q VLAN parameters" + bool "Support 802.1Q VLAN parameters" default BUSYBOX_DEFAULT_FEATURE_UDHCP_8021Q depends on BUSYBOX_CONFIG_UDHCPD || BUSYBOX_CONFIG_UDHCPC help If selected, both client and server will support passing of VLAN ID and priority via options 132 and 133 as per 802.1Q. -config BUSYBOX_CONFIG_UDHCPC_DEFAULT_SCRIPT - string "Absolute path to config script" - default BUSYBOX_DEFAULT_UDHCPC_DEFAULT_SCRIPT - depends on BUSYBOX_CONFIG_UDHCPC - help - This script is called after udhcpc receives an answer. See - examples/udhcp for a working example. Normally it is safe - to leave this untouched. - config BUSYBOX_CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS int "DHCP options slack buffer size" default BUSYBOX_DEFAULT_UDHCPC_SLACK_FOR_BUGGY_SERVERS diff --git a/package/utils/busybox/config/procps/Config.in b/package/utils/busybox/config/procps/Config.in index 6eafbda0f..acd4ed882 100644 --- a/package/utils/busybox/config/procps/Config.in +++ b/package/utils/busybox/config/procps/Config.in @@ -6,11 +6,50 @@ menu "Process Utilities" +config BUSYBOX_CONFIG_FREE + bool "free" + default BUSYBOX_DEFAULT_FREE + select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() + help + free displays the total amount of free and used physical and swap + memory in the system, as well as the buffers used by the kernel. + The shared memory column should be ignored; it is obsolete. +config BUSYBOX_CONFIG_FUSER + bool "fuser" + default BUSYBOX_DEFAULT_FUSER + help + fuser lists all PIDs (Process IDs) that currently have a given + file open. fuser can also list all PIDs that have a given network + (TCP or UDP) port open. config BUSYBOX_CONFIG_IOSTAT bool "iostat" default BUSYBOX_DEFAULT_IOSTAT help Report CPU and I/O statistics +config BUSYBOX_CONFIG_KILL + bool "kill" + default BUSYBOX_DEFAULT_KILL + help + The command kill sends the specified signal to the specified + process or process group. If no signal is specified, the TERM + signal is sent. + +config BUSYBOX_CONFIG_KILLALL + bool "killall" + default BUSYBOX_DEFAULT_KILLALL + help + killall sends a signal to all processes running any of the + specified commands. If no signal name is specified, SIGTERM is + sent. + +config BUSYBOX_CONFIG_KILLALL5 + bool "killall5" + default BUSYBOX_DEFAULT_KILLALL5 + help + The SystemV killall command. killall5 sends a signal + to all processes except kernel threads and the processes + in its own session, so it won't kill the shell that is running + the script it was called from. config BUSYBOX_CONFIG_LSOF bool "lsof" default BUSYBOX_DEFAULT_LSOF @@ -27,6 +66,39 @@ config BUSYBOX_CONFIG_NMETER default BUSYBOX_DEFAULT_NMETER help Prints selected system stats continuously, one line per update. +config BUSYBOX_CONFIG_PGREP + bool "pgrep" + default BUSYBOX_DEFAULT_PGREP + help + Look for processes by name. + +config BUSYBOX_CONFIG_PKILL + bool "pkill" + default BUSYBOX_DEFAULT_PKILL + help + Send signals to processes by name. +config BUSYBOX_CONFIG_PIDOF + bool "pidof" + default BUSYBOX_DEFAULT_PIDOF + help + Pidof finds the process id's (pids) of the named programs. It prints + those id's on the standard output. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE + bool "Enable single shot (-s)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE + depends on BUSYBOX_CONFIG_PIDOF + help + Support '-s' for returning only the first pid found. + +config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT + bool "Enable omitting pids (-o PID)" + default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT + depends on BUSYBOX_CONFIG_PIDOF + help + Support '-o PID' for omitting the given pid(s) in output. + The special pid %PPID can be used to name the parent process + of the pidof, in other words the calling shell or shell script. config BUSYBOX_CONFIG_PMAP bool "pmap" default BUSYBOX_DEFAULT_PMAP @@ -37,6 +109,55 @@ config BUSYBOX_CONFIG_POWERTOP default BUSYBOX_DEFAULT_POWERTOP help Analyze power consumption on Intel-based laptops + +config BUSYBOX_CONFIG_FEATURE_POWERTOP_INTERACTIVE + bool "Accept keyboard commands" + default BUSYBOX_DEFAULT_FEATURE_POWERTOP_INTERACTIVE + depends on BUSYBOX_CONFIG_POWERTOP + help + Without this, powertop will only refresh display every 10 seconds. + No keyboard commands will work, only ^C to terminate. +config BUSYBOX_CONFIG_PS + bool "ps" + default BUSYBOX_DEFAULT_PS + help + ps gives a snapshot of the current processes. + +config BUSYBOX_CONFIG_FEATURE_PS_WIDE + bool "Enable wide output option (-w)" + default BUSYBOX_DEFAULT_FEATURE_PS_WIDE + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'w' for wide output. + If given once, 132 chars are printed, and if given more + than once, the length is unlimited. + +config BUSYBOX_CONFIG_FEATURE_PS_LONG + bool "Enable long output option (-l)" + default BUSYBOX_DEFAULT_FEATURE_PS_LONG + depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP + help + Support argument 'l' for long output. + Adds fields PPID, RSS, START, TIME & TTY + +config BUSYBOX_CONFIG_FEATURE_PS_TIME + bool "Support -o time and -o etime output specifiers" + default BUSYBOX_DEFAULT_FEATURE_PS_TIME + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP + select BUSYBOX_CONFIG_PLATFORM_LINUX + +config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS + bool "Support Linux prior to 2.4.0 and non-ELF systems" + default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS + depends on BUSYBOX_CONFIG_FEATURE_PS_TIME + help + Include support for measuring HZ on old kernels and non-ELF systems + (if you are on Linux 2.4.0+ and use ELF, you don't need this) + +config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS + bool "Support -o rgroup, -o ruser, -o nice specifiers" + default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS + depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP config BUSYBOX_CONFIG_PSTREE bool "pstree" default BUSYBOX_DEFAULT_PSTREE @@ -53,6 +174,11 @@ config BUSYBOX_CONFIG_SMEMCAP help smemcap is a tool for capturing process data for smem, a memory usage statistic tool. +config BUSYBOX_CONFIG_BB_SYSCTL + bool "sysctl" + default BUSYBOX_DEFAULT_BB_SYSCTL + help + Configure kernel parameters at runtime. config BUSYBOX_CONFIG_TOP bool "top" default BUSYBOX_DEFAULT_TOP @@ -60,6 +186,14 @@ config BUSYBOX_CONFIG_TOP The top program provides a dynamic real-time view of a running system. +config BUSYBOX_CONFIG_FEATURE_TOP_INTERACTIVE + bool "Accept keyboard commands" + default BUSYBOX_DEFAULT_FEATURE_TOP_INTERACTIVE + depends on BUSYBOX_CONFIG_TOP + help + Without this, top will only refresh display every 5 seconds. + No keyboard commands will work, only ^C to terminate. + config BUSYBOX_CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE bool "Show CPU per-process usage percentage" default BUSYBOX_DEFAULT_FEATURE_TOP_CPU_USAGE_PERCENTAGE @@ -116,153 +250,11 @@ config BUSYBOX_CONFIG_UPTIME on, and the system load averages for the past 1, 5, and 15 minutes. config BUSYBOX_CONFIG_FEATURE_UPTIME_UTMP_SUPPORT - bool "Support for showing the number of users" + bool "Show the number of users" default BUSYBOX_DEFAULT_FEATURE_UPTIME_UTMP_SUPPORT depends on BUSYBOX_CONFIG_UPTIME && BUSYBOX_CONFIG_FEATURE_UTMP help - Makes uptime display the number of users currently logged on. - -config BUSYBOX_CONFIG_FREE - bool "free" - default BUSYBOX_DEFAULT_FREE - select BUSYBOX_CONFIG_PLATFORM_LINUX #sysinfo() - help - free displays the total amount of free and used physical and swap - memory in the system, as well as the buffers used by the kernel. - The shared memory column should be ignored; it is obsolete. - -config BUSYBOX_CONFIG_FUSER - bool "fuser" - default BUSYBOX_DEFAULT_FUSER - help - fuser lists all PIDs (Process IDs) that currently have a given - file open. fuser can also list all PIDs that have a given network - (TCP or UDP) port open. - -config BUSYBOX_CONFIG_KILL - bool "kill" - default BUSYBOX_DEFAULT_KILL - help - The command kill sends the specified signal to the specified - process or process group. If no signal is specified, the TERM - signal is sent. - -config BUSYBOX_CONFIG_KILLALL - bool "killall" - default BUSYBOX_DEFAULT_KILLALL - depends on BUSYBOX_CONFIG_KILL - help - killall sends a signal to all processes running any of the - specified commands. If no signal name is specified, SIGTERM is - sent. - -config BUSYBOX_CONFIG_KILLALL5 - bool "killall5" - default BUSYBOX_DEFAULT_KILLALL5 - depends on BUSYBOX_CONFIG_KILL - -config BUSYBOX_CONFIG_PGREP - bool "pgrep" - default BUSYBOX_DEFAULT_PGREP - help - Look for processes by name. - -config BUSYBOX_CONFIG_PIDOF - bool "pidof" - default BUSYBOX_DEFAULT_PIDOF - help - Pidof finds the process id's (pids) of the named programs. It prints - those id's on the standard output. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_SINGLE - bool "Enable argument for single shot (-s)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_SINGLE - depends on BUSYBOX_CONFIG_PIDOF - help - Support argument '-s' for returning only the first pid found. - -config BUSYBOX_CONFIG_FEATURE_PIDOF_OMIT - bool "Enable argument for omitting pids (-o)" - default BUSYBOX_DEFAULT_FEATURE_PIDOF_OMIT - depends on BUSYBOX_CONFIG_PIDOF - help - Support argument '-o' for omitting the given pids in output. - The special pid %PPID can be used to name the parent process - of the pidof, in other words the calling shell or shell script. - -config BUSYBOX_CONFIG_PKILL - bool "pkill" - default BUSYBOX_DEFAULT_PKILL - help - Send signals to processes by name. - -config BUSYBOX_CONFIG_PS - bool "ps" - default BUSYBOX_DEFAULT_PS - help - ps gives a snapshot of the current processes. - -config BUSYBOX_CONFIG_FEATURE_PS_WIDE - bool "Enable wide output option (-w)" - default BUSYBOX_DEFAULT_FEATURE_PS_WIDE - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'w' for wide output. - If given once, 132 chars are printed, and if given more - than once, the length is unlimited. - -config BUSYBOX_CONFIG_FEATURE_PS_LONG - bool "Enable long output option (-l)" - default BUSYBOX_DEFAULT_FEATURE_PS_LONG - depends on BUSYBOX_CONFIG_PS && !BUSYBOX_CONFIG_DESKTOP - help - Support argument 'l' for long output. - Adds fields PPID, RSS, START, TIME & TTY - -config BUSYBOX_CONFIG_FEATURE_PS_TIME - bool "Enable time and elapsed time output" - default BUSYBOX_DEFAULT_FEATURE_PS_TIME - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Support -o time and -o etime output specifiers. - -config BUSYBOX_CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS - bool "Enable additional ps columns" - default BUSYBOX_DEFAULT_FEATURE_PS_ADDITIONAL_COLUMNS - depends on BUSYBOX_CONFIG_PS && BUSYBOX_CONFIG_DESKTOP - help - Support -o rgroup, -o ruser, -o nice output specifiers. - -config BUSYBOX_CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS - bool "Support Linux prior to 2.4.0 and non-ELF systems" - default BUSYBOX_DEFAULT_FEATURE_PS_UNUSUAL_SYSTEMS - depends on BUSYBOX_CONFIG_FEATURE_PS_TIME - help - Include support for measuring HZ on old kernels and non-ELF systems - (if you are on Linux 2.4.0+ and use ELF, you don't need this) - -config BUSYBOX_CONFIG_RENICE - bool "renice" - default BUSYBOX_DEFAULT_RENICE - help - Renice alters the scheduling priority of one or more running - processes. - -config BUSYBOX_CONFIG_BB_SYSCTL - bool "sysctl" - default BUSYBOX_DEFAULT_BB_SYSCTL - help - Configure kernel parameters at runtime. - -config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS - bool "Support for showing threads in ps/pstree/top" - default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS - depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE - help - Enables the ps -T option, showing of threads in pstree, - and 'h' command in top. - + Display the number of users currently logged on. config BUSYBOX_CONFIG_WATCH bool "watch" default BUSYBOX_DEFAULT_WATCH @@ -270,4 +262,12 @@ config BUSYBOX_CONFIG_WATCH watch is used to execute a program periodically, showing output to the screen. +config BUSYBOX_CONFIG_FEATURE_SHOW_THREADS + bool "Support thread display in ps/pstree/top" + default BUSYBOX_DEFAULT_FEATURE_SHOW_THREADS + depends on BUSYBOX_CONFIG_PS || BUSYBOX_CONFIG_TOP || BUSYBOX_CONFIG_PSTREE + help + Enables the ps -T option, showing of threads in pstree, + and 'h' command in top. + endmenu diff --git a/package/utils/busybox/config/runit/Config.in b/package/utils/busybox/config/runit/Config.in index a322a2cd8..8750b597e 100644 --- a/package/utils/busybox/config/runit/Config.in +++ b/package/utils/busybox/config/runit/Config.in @@ -73,6 +73,13 @@ config BUSYBOX_CONFIG_SV_DEFAULT_SERVICE_DIR help Default directory for services. Defaults to "/var/service" + +config BUSYBOX_CONFIG_SVC + bool "svc" + default BUSYBOX_DEFAULT_SVC + help + svc controls the state of services monitored by the runsv supervisor. + It is comaptible with daemontools command with the same name. config BUSYBOX_CONFIG_SVLOGD bool "svlogd" default BUSYBOX_DEFAULT_SVLOGD diff --git a/package/utils/busybox/config/selinux/Config.in b/package/utils/busybox/config/selinux/Config.in index 1d23f7de4..71eb0dcd7 100644 --- a/package/utils/busybox/config/selinux/Config.in +++ b/package/utils/busybox/config/selinux/Config.in @@ -7,7 +7,6 @@ menu "SELinux Utilities" depends on BUSYBOX_CONFIG_SELINUX - config BUSYBOX_CONFIG_CHCON bool "chcon" default BUSYBOX_DEFAULT_CHCON @@ -19,30 +18,24 @@ config BUSYBOX_CONFIG_FEATURE_CHCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_CHCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_CHCON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the chcon applet. - config BUSYBOX_CONFIG_GETENFORCE bool "getenforce" default BUSYBOX_DEFAULT_GETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to get the current mode of SELinux. - config BUSYBOX_CONFIG_GETSEBOOL bool "getsebool" default BUSYBOX_DEFAULT_GETSEBOOL depends on BUSYBOX_CONFIG_SELINUX help Enable support to get SELinux boolean values. - config BUSYBOX_CONFIG_LOAD_POLICY bool "load_policy" default BUSYBOX_DEFAULT_LOAD_POLICY depends on BUSYBOX_CONFIG_SELINUX help Enable support to load SELinux policy. - config BUSYBOX_CONFIG_MATCHPATHCON bool "matchpathcon" default BUSYBOX_DEFAULT_MATCHPATHCON @@ -50,15 +43,6 @@ config BUSYBOX_CONFIG_MATCHPATHCON help Enable support to get default security context of the specified path from the file contexts configuration. - -config BUSYBOX_CONFIG_RESTORECON - bool "restorecon" - default BUSYBOX_DEFAULT_RESTORECON - depends on BUSYBOX_CONFIG_SELINUX - help - Enable support to relabel files. The feature is almost - the same as setfiles, but usage is a little different. - config BUSYBOX_CONFIG_RUNCON bool "runcon" default BUSYBOX_DEFAULT_RUNCON @@ -70,9 +54,6 @@ config BUSYBOX_CONFIG_FEATURE_RUNCON_LONG_OPTIONS bool "Enable long options" default BUSYBOX_DEFAULT_FEATURE_RUNCON_LONG_OPTIONS depends on BUSYBOX_CONFIG_RUNCON && BUSYBOX_CONFIG_LONG_OPTS - help - Support long options for the runcon applet. - config BUSYBOX_CONFIG_SELINUXENABLED bool "selinuxenabled" default BUSYBOX_DEFAULT_SELINUXENABLED @@ -80,14 +61,18 @@ config BUSYBOX_CONFIG_SELINUXENABLED help Enable support for this command to be used within shell scripts to determine if selinux is enabled. - +config BUSYBOX_CONFIG_SESTATUS + bool "sestatus" + default BUSYBOX_DEFAULT_SESTATUS + depends on BUSYBOX_CONFIG_SELINUX + help + Displays the status of SELinux. config BUSYBOX_CONFIG_SETENFORCE bool "setenforce" default BUSYBOX_DEFAULT_SETENFORCE depends on BUSYBOX_CONFIG_SELINUX help Enable support to modify the mode SELinux is running in. - config BUSYBOX_CONFIG_SETFILES bool "setfiles" default BUSYBOX_DEFAULT_SETFILES @@ -106,6 +91,13 @@ config BUSYBOX_CONFIG_FEATURE_SETFILES_CHECK_OPTION Support "-c" option (check the validity of the contexts against the specified binary policy) for setfiles. Requires libsepol. +config BUSYBOX_CONFIG_RESTORECON + bool "restorecon" + default BUSYBOX_DEFAULT_RESTORECON + depends on BUSYBOX_CONFIG_SELINUX + help + Enable support to relabel files. The feature is almost + the same as setfiles, but usage is a little different. config BUSYBOX_CONFIG_SETSEBOOL bool "setsebool" default BUSYBOX_DEFAULT_SETSEBOOL @@ -114,11 +106,4 @@ config BUSYBOX_CONFIG_SETSEBOOL Enable support for change boolean. semanage and -P option is not supported yet. -config BUSYBOX_CONFIG_SESTATUS - bool "sestatus" - default BUSYBOX_DEFAULT_SESTATUS - depends on BUSYBOX_CONFIG_SELINUX - help - Displays the status of SELinux. - endmenu diff --git a/package/utils/busybox/config/shell/Config.in b/package/utils/busybox/config/shell/Config.in index 69ecf145e..e455d3832 100644 --- a/package/utils/busybox/config/shell/Config.in +++ b/package/utils/busybox/config/shell/Config.in @@ -6,6 +6,78 @@ menu "Shells" + +choice + prompt "Choose which shell is aliased to 'sh' name" + default BUSYBOX_CONFIG_SH_IS_ASH + help + Choose which shell you want to be executed by 'sh' alias. + The ash shell is the most bash compatible and full featured one. + +# note: cannot use "select ASH" here, it breaks "make allnoconfig" +config BUSYBOX_CONFIG_SH_IS_ASH + depends on !BUSYBOX_CONFIG_NOMMU + bool "ash" + help + Choose ash to be the shell executed by 'sh' name. + The ash code will be built into busybox. If you don't select + "ash" choice (CONFIG_ASH), this shell may only be invoked by + the name 'sh' (and not 'ash'). + +config BUSYBOX_CONFIG_SH_IS_HUSH + bool "hush" + help + Choose hush to be the shell executed by 'sh' name. + The hush code will be built into busybox. If you don't select + "hush" choice (CONFIG_HUSH), this shell may only be invoked by + the name 'sh' (and not 'hush'). + +config BUSYBOX_CONFIG_SH_IS_NONE + bool "none" + +endchoice + +choice + prompt "Choose which shell is aliased to 'bash' name" + default BUSYBOX_CONFIG_BASH_IS_NONE + help + Choose which shell you want to be executed by 'bash' alias. + The ash shell is the most bash compatible and full featured one, + although compatibility is far from being complete. + + Note that selecting this option does not switch on any bash + compatibility code. It merely makes it possible to install + /bin/bash (sym)link and run scripts which start with + #!/bin/bash line. + + Many systems use it in scripts which use bash-specific features, + even simple ones like $RANDOM. Without this option, busybox + can't be used for running them because it won't recongnize + "bash" as a supported applet name. + +config BUSYBOX_CONFIG_BASH_IS_ASH + depends on !BUSYBOX_CONFIG_NOMMU + bool "ash" + help + Choose ash to be the shell executed by 'bash' name. + The ash code will be built into busybox. If you don't select + "ash" choice (CONFIG_ASH), this shell may only be invoked by + the name 'bash' (and not 'ash'). + +config BUSYBOX_CONFIG_BASH_IS_HUSH + bool "hush" + help + Choose hush to be the shell executed by 'bash' name. + The hush code will be built into busybox. If you don't select + "hush" choice (CONFIG_HUSH), this shell may only be invoked by + the name 'bash' (and not 'hush'). + +config BUSYBOX_CONFIG_BASH_IS_NONE + bool "none" + +endchoice + + config BUSYBOX_CONFIG_ASH bool "ash" default BUSYBOX_DEFAULT_ASH @@ -17,96 +89,46 @@ config BUSYBOX_CONFIG_ASH shell (by Herbert Xu), which was created by porting the 'ash' shell (written by Kenneth Almquist) from NetBSD. -config BUSYBOX_CONFIG_ASH_BASH_COMPAT - bool "bash-compatible extensions" - default BUSYBOX_DEFAULT_ASH_BASH_COMPAT - depends on BUSYBOX_CONFIG_ASH - help - Enable bash-compatible extensions. - -config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT - bool "Idle timeout variable" - default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT - depends on BUSYBOX_CONFIG_ASH - help - Enables bash-like auto-logout after $TMOUT seconds of idle time. - -config BUSYBOX_CONFIG_ASH_JOB_CONTROL - bool "Job control" - default BUSYBOX_DEFAULT_ASH_JOB_CONTROL - depends on BUSYBOX_CONFIG_ASH - help - Enable job control in the ash shell. - -config BUSYBOX_CONFIG_ASH_ALIAS - bool "Alias support" - default BUSYBOX_DEFAULT_ASH_ALIAS - depends on BUSYBOX_CONFIG_ASH - help - Enable alias support in the ash shell. - -config BUSYBOX_CONFIG_ASH_GETOPTS - bool "Builtin getopt to parse positional parameters" - default BUSYBOX_DEFAULT_ASH_GETOPTS - depends on BUSYBOX_CONFIG_ASH - help - Enable support for getopts builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_ECHO - bool "Builtin version of 'echo'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_ECHO - depends on BUSYBOX_CONFIG_ASH - help - Enable support for echo builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_PRINTF - bool "Builtin version of 'printf'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_PRINTF - depends on BUSYBOX_CONFIG_ASH - help - Enable support for printf builtin in ash. - -config BUSYBOX_CONFIG_ASH_BUILTIN_TEST - bool "Builtin version of 'test'" - default BUSYBOX_DEFAULT_ASH_BUILTIN_TEST - depends on BUSYBOX_CONFIG_ASH - help - Enable support for test builtin in ash. - -config BUSYBOX_CONFIG_ASH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_ASH_HELP - depends on BUSYBOX_CONFIG_ASH - help - Enable help builtin in ash. - -config BUSYBOX_CONFIG_ASH_CMDCMD - bool "'command' command to override shell builtins" - default BUSYBOX_DEFAULT_ASH_CMDCMD - depends on BUSYBOX_CONFIG_ASH - help - Enable support for the ash 'command' builtin, which allows - you to run the specified command with the specified arguments, - even when there is an ash builtin command with the same name. - -config BUSYBOX_CONFIG_ASH_MAIL - bool "Check for new mail on interactive shells" - default BUSYBOX_DEFAULT_ASH_MAIL - depends on BUSYBOX_CONFIG_ASH - help - Enable "check for new mail" function in the ash shell. +# ash options +# note: Don't remove !NOMMU part in the next line; it would break +# menuconfig's indenting. +if !NOMMU && (BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH) config BUSYBOX_CONFIG_ASH_OPTIMIZE_FOR_SIZE bool "Optimize for size instead of speed" default BUSYBOX_DEFAULT_ASH_OPTIMIZE_FOR_SIZE - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_INTERNAL_GLOB + bool "Use internal glob() implementation" + default BUSYBOX_DEFAULT_ASH_INTERNAL_GLOB # Y is bigger, but because of uclibc glob() bug, let Y be default for now + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help - Compile ash for reduced size at the price of speed. + Do not use glob() function from libc, use internal implementation. + Use this if you are getting "glob.h: No such file or directory" + or similar build errors. + Note that as of now (2017-01), uclibc and musl glob() both have bugs + which would break ash if you select N here. + +config BUSYBOX_CONFIG_ASH_BASH_COMPAT + bool "bash-compatible extensions" + default BUSYBOX_DEFAULT_ASH_BASH_COMPAT + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_JOB_CONTROL + bool "Job control" + default BUSYBOX_DEFAULT_ASH_JOB_CONTROL + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_ALIAS + bool "Alias support" + default BUSYBOX_DEFAULT_ASH_ALIAS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_ASH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. @@ -117,12 +139,64 @@ config BUSYBOX_CONFIG_ASH_RANDOM_SUPPORT config BUSYBOX_CONFIG_ASH_EXPAND_PRMT bool "Expand prompt string" default BUSYBOX_DEFAULT_ASH_EXPAND_PRMT - depends on BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH help - "PS#" may contain volatile content, such as backquote commands. + $PS# may contain volatile content, such as backquote commands. This option recreates the prompt string from the environment variable each time it is displayed. +config BUSYBOX_CONFIG_ASH_IDLE_TIMEOUT + bool "Idle timeout variable $TMOUT" + default BUSYBOX_DEFAULT_ASH_IDLE_TIMEOUT + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable bash-like auto-logout after $TMOUT seconds of idle time. + +config BUSYBOX_CONFIG_ASH_MAIL + bool "Check for new mail in interactive shell" + default BUSYBOX_DEFAULT_ASH_MAIL + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable "check for new mail" function: + if set, $MAIL file and $MAILPATH list of files + are checked for mtime changes, and "you have mail" + message is printed if change is detected. + +config BUSYBOX_CONFIG_ASH_ECHO + bool "echo builtin" + default BUSYBOX_DEFAULT_ASH_ECHO + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_PRINTF + bool "printf builtin" + default BUSYBOX_DEFAULT_ASH_PRINTF + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_TEST + bool "test builtin" + default BUSYBOX_DEFAULT_ASH_TEST + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_ASH_HELP + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_GETOPTS + bool "getopts builtin" + default BUSYBOX_DEFAULT_ASH_GETOPTS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + +config BUSYBOX_CONFIG_ASH_CMDCMD + bool "command builtin" + default BUSYBOX_DEFAULT_ASH_CMDCMD + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH + help + Enable support for the 'command' builtin, which allows + you to run the specified command or builtin, + even when there is a function with the same name. + +endif # ash options config BUSYBOX_CONFIG_CTTYHACK bool "cttyhack" default BUSYBOX_DEFAULT_CTTYHACK @@ -183,9 +257,7 @@ config BUSYBOX_CONFIG_HUSH config BUSYBOX_CONFIG_HUSH_BASH_COMPAT bool "bash-compatible extensions" default BUSYBOX_DEFAULT_HUSH_BASH_COMPAT - depends on BUSYBOX_CONFIG_HUSH - help - Enable bash-compatible extensions. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION bool "Brace expansion" @@ -194,17 +266,10 @@ config BUSYBOX_CONFIG_HUSH_BRACE_EXPANSION help Enable {abc,def} extension. -config BUSYBOX_CONFIG_HUSH_HELP - bool "help builtin" - default BUSYBOX_DEFAULT_HUSH_HELP - depends on BUSYBOX_CONFIG_HUSH - help - Enable help builtin in hush. Code size + ~1 kbyte. - config BUSYBOX_CONFIG_HUSH_INTERACTIVE bool "Interactive mode" default BUSYBOX_DEFAULT_HUSH_INTERACTIVE - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable interactive mode (prompt and command editing). Without this, hush simply reads and executes commands @@ -215,8 +280,6 @@ config BUSYBOX_CONFIG_HUSH_SAVEHISTORY bool "Save command history to .hush_history" default BUSYBOX_DEFAULT_HUSH_SAVEHISTORY depends on BUSYBOX_CONFIG_HUSH_INTERACTIVE && BUSYBOX_CONFIG_FEATURE_EDITING_SAVEHISTORY - help - Enable history saving in hush. config BUSYBOX_CONFIG_HUSH_JOB bool "Job control" @@ -230,42 +293,38 @@ config BUSYBOX_CONFIG_HUSH_JOB but no separate process group is formed. config BUSYBOX_CONFIG_HUSH_TICK - bool "Process substitution" + bool "Support process substitution" default BUSYBOX_DEFAULT_HUSH_TICK - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable process substitution `command` and $(command) in hush. + Enable `command` and $(command). config BUSYBOX_CONFIG_HUSH_IF bool "Support if/then/elif/else/fi" default BUSYBOX_DEFAULT_HUSH_IF - depends on BUSYBOX_CONFIG_HUSH - help - Enable if/then/elif/else/fi in hush. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_LOOPS bool "Support for, while and until loops" default BUSYBOX_DEFAULT_HUSH_LOOPS - depends on BUSYBOX_CONFIG_HUSH - help - Enable for, while and until loops in hush. + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH config BUSYBOX_CONFIG_HUSH_CASE bool "Support case ... esac statement" default BUSYBOX_DEFAULT_HUSH_CASE - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable case ... esac statement in hush. +400 bytes. + Enable case ... esac statement. +400 bytes. config BUSYBOX_CONFIG_HUSH_FUNCTIONS bool "Support funcname() { commands; } syntax" default BUSYBOX_DEFAULT_HUSH_FUNCTIONS - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help - Enable support for shell functions in hush. +800 bytes. + Enable support for shell functions. +800 bytes. config BUSYBOX_CONFIG_HUSH_LOCAL - bool "Support local builtin" + bool "local builtin" default BUSYBOX_DEFAULT_HUSH_LOCAL depends on BUSYBOX_CONFIG_HUSH_FUNCTIONS help @@ -274,26 +333,101 @@ config BUSYBOX_CONFIG_HUSH_LOCAL config BUSYBOX_CONFIG_HUSH_RANDOM_SUPPORT bool "Pseudorandom generator and $RANDOM variable" default BUSYBOX_DEFAULT_HUSH_RANDOM_SUPPORT - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable pseudorandom generator and dynamic variable "$RANDOM". Each read of "$RANDOM" will generate a new pseudorandom value. -config BUSYBOX_CONFIG_HUSH_EXPORT_N - bool "Support 'export -n' option" - default BUSYBOX_DEFAULT_HUSH_EXPORT_N - depends on BUSYBOX_CONFIG_HUSH - help - export -n unexports variables. It is a bash extension. - config BUSYBOX_CONFIG_HUSH_MODE_X bool "Support 'hush -x' option and 'set -x' command" default BUSYBOX_DEFAULT_HUSH_MODE_X - depends on BUSYBOX_CONFIG_HUSH + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This instructs hush to print commands before execution. Adds ~300 bytes. +config BUSYBOX_CONFIG_HUSH_ECHO + bool "echo builtin" + default BUSYBOX_DEFAULT_HUSH_ECHO + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_PRINTF + bool "printf builtin" + default BUSYBOX_DEFAULT_HUSH_PRINTF + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TEST + bool "test builtin" + default BUSYBOX_DEFAULT_HUSH_TEST + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_HELP + bool "help builtin" + default BUSYBOX_DEFAULT_HUSH_HELP + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_EXPORT + bool "export builtin" + default BUSYBOX_DEFAULT_HUSH_EXPORT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_EXPORT_N + bool "Support 'export -n' option" + default BUSYBOX_DEFAULT_HUSH_EXPORT_N + depends on BUSYBOX_CONFIG_HUSH_EXPORT + help + export -n unexports variables. It is a bash extension. + +config BUSYBOX_CONFIG_HUSH_KILL + bool "kill builtin (supports kill %jobspec)" + default BUSYBOX_DEFAULT_HUSH_KILL + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_WAIT + bool "wait builtin" + default BUSYBOX_DEFAULT_HUSH_WAIT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TRAP + bool "trap builtin" + default BUSYBOX_DEFAULT_HUSH_TRAP + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_TYPE + bool "type builtin" + default BUSYBOX_DEFAULT_HUSH_TYPE + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_READ + bool "read builtin" + default BUSYBOX_DEFAULT_HUSH_READ + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_SET + bool "set builtin" + default BUSYBOX_DEFAULT_HUSH_SET + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_UNSET + bool "unset builtin" + default BUSYBOX_DEFAULT_HUSH_UNSET + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_ULIMIT + bool "ulimit builtin" + default BUSYBOX_DEFAULT_HUSH_ULIMIT + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_UMASK + bool "umask builtin" + default BUSYBOX_DEFAULT_HUSH_UMASK + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + +config BUSYBOX_CONFIG_HUSH_MEMLEAK + bool "memleak builtin (debugging)" + default BUSYBOX_DEFAULT_HUSH_MEMLEAK + depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH + config BUSYBOX_CONFIG_MSH bool "msh (deprecated: aliased to hush)" default BUSYBOX_DEFAULT_MSH @@ -302,72 +436,20 @@ config BUSYBOX_CONFIG_MSH msh is deprecated and will be removed, please migrate to hush. +comment "Options common to all shells" +if ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH -choice - prompt "Choose which shell is aliased to 'sh' name" - default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH - help - Choose which shell you want to be executed by 'sh' alias. - The ash shell is the most bash compatible and full featured one. - -# note: cannot use "select ASH" here, it breaks "make allnoconfig" -config BUSYBOX_CONFIG_FEATURE_SH_IS_ASH - depends on BUSYBOX_CONFIG_ASH - bool "ash" - depends on !BUSYBOX_CONFIG_NOMMU - -config BUSYBOX_CONFIG_FEATURE_SH_IS_HUSH - depends on BUSYBOX_CONFIG_HUSH - bool "hush" - -config BUSYBOX_CONFIG_FEATURE_SH_IS_NONE - bool "none" - -endchoice - -choice - prompt "Choose which shell is aliased to 'bash' name" - default BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE - help - Choose which shell you want to be executed by 'bash' alias. - The ash shell is the most bash compatible and full featured one. - - Note that selecting this option does not switch on any bash - compatibility code. It merely makes it possible to install - /bin/bash (sym)link and run scripts which start with - #!/bin/bash line. - - Many systems use it in scripts which use bash-specific features, - even simple ones like $RANDOM. Without this option, busybox - can't be used for running them because it won't recongnize - "bash" as a supported applet name. - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_ASH - depends on BUSYBOX_CONFIG_ASH - bool "ash" - depends on !BUSYBOX_CONFIG_NOMMU - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_HUSH - depends on BUSYBOX_CONFIG_HUSH - bool "hush" - -config BUSYBOX_CONFIG_FEATURE_BASH_IS_NONE - bool "none" - -endchoice - - -config BUSYBOX_CONFIG_SH_MATH_SUPPORT +config BUSYBOX_CONFIG_FEATURE_SH_MATH bool "POSIX math support" - default BUSYBOX_DEFAULT_SH_MATH_SUPPORT - depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH + default BUSYBOX_DEFAULT_FEATURE_SH_MATH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Enable math support in the shell via $((...)) syntax. -config BUSYBOX_CONFIG_SH_MATH_SUPPORT_64 +config BUSYBOX_CONFIG_FEATURE_SH_MATH_64 bool "Extend POSIX math support to 64 bit" - default BUSYBOX_DEFAULT_SH_MATH_SUPPORT_64 - depends on BUSYBOX_CONFIG_SH_MATH_SUPPORT + default BUSYBOX_DEFAULT_FEATURE_SH_MATH_64 + depends on BUSYBOX_CONFIG_FEATURE_SH_MATH help Enable 64-bit math support in the shell. This will make the shell slightly larger, but will allow computation with very large numbers. @@ -376,14 +458,14 @@ config BUSYBOX_CONFIG_SH_MATH_SUPPORT_64 config BUSYBOX_CONFIG_FEATURE_SH_EXTRA_QUIET bool "Hide message on interactive shell startup" default BUSYBOX_DEFAULT_FEATURE_SH_EXTRA_QUIET - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help Remove the busybox introduction when starting a shell. config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE bool "Standalone shell" default BUSYBOX_DEFAULT_FEATURE_SH_STANDALONE - depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option causes busybox shells to use busybox applets in preference to executables in the PATH whenever possible. For @@ -395,28 +477,16 @@ config BUSYBOX_CONFIG_FEATURE_SH_STANDALONE for use as a rescue shell, in the event that you screw up your system. This is implemented by re-execing /proc/self/exe (typically) - with right parameters. Some selected applets ("NOFORK" applets) - can even be executed without creating new process. - Instead, busybox will call _main() internally. + with right parameters. - However, this causes problems in chroot jails without mounted /proc - and with ps/top (command name can be shown as 'exe' for applets - started this way). -# untrue? -# Note that this will *also* cause applets to take precedence -# over shell builtins of the same name. So turning this on will -# eliminate any performance gained by turning on the builtin "echo" -# and "test" commands in ash. -# untrue? -# Note that when using this option, the shell will attempt to directly -# run '/bin/busybox'. If you do not have the busybox binary sitting in -# that exact location with that exact name, this option will not work at -# all. + However, there are drawbacks: it is problematic in chroot jails + without mounted /proc, and ps/top may show command name as 'exe' + for applets started this way. config BUSYBOX_CONFIG_FEATURE_SH_NOFORK bool "Run 'nofork' applets directly" default BUSYBOX_DEFAULT_FEATURE_SH_NOFORK - depends on (BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH) && BUSYBOX_CONFIG_FEATURE_PREFER_APPLETS + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option causes busybox shells to not execute typical fork/exec/wait sequence, but call _main directly, @@ -434,11 +504,12 @@ config BUSYBOX_CONFIG_FEATURE_SH_NOFORK config BUSYBOX_CONFIG_FEATURE_SH_HISTFILESIZE bool "Use $HISTFILESIZE" default BUSYBOX_DEFAULT_FEATURE_SH_HISTFILESIZE - depends on BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_ASH + depends on BUSYBOX_CONFIG_ASH || BUSYBOX_CONFIG_HUSH || BUSYBOX_CONFIG_SH_IS_ASH || BUSYBOX_CONFIG_BASH_IS_ASH || BUSYBOX_CONFIG_SH_IS_HUSH || BUSYBOX_CONFIG_BASH_IS_HUSH help This option makes busybox shells to use $HISTFILESIZE variable to set shell history size. Note that its max value is capped by "History size" setting in library tuning section. +endif # Options common to all shells endmenu diff --git a/package/utils/busybox/config/sysklogd/Config.in b/package/utils/busybox/config/sysklogd/Config.in index 5fcee2c7f..2045a7ae3 100644 --- a/package/utils/busybox/config/sysklogd/Config.in +++ b/package/utils/busybox/config/sysklogd/Config.in @@ -47,7 +47,6 @@ config BUSYBOX_CONFIG_LOGGER config BUSYBOX_CONFIG_LOGREAD bool "logread" default BUSYBOX_DEFAULT_LOGREAD - depends on BUSYBOX_CONFIG_FEATURE_IPC_SYSLOG help If you enabled Circular Buffer support, you almost certainly want to enable this feature as well. This @@ -59,7 +58,7 @@ config BUSYBOX_CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING default BUSYBOX_DEFAULT_FEATURE_LOGREAD_REDUCED_LOCKING depends on BUSYBOX_CONFIG_LOGREAD help - 'logread' ouput to slow serial terminals can have + 'logread' output to slow serial terminals can have side effects on syslog because of the semaphore. This option make logread to double buffer copy from circular buffer, minimizing semaphore diff --git a/package/utils/busybox/config/util-linux/Config.in b/package/utils/busybox/config/util-linux/Config.in index 08bddf819..74a49d00c 100644 --- a/package/utils/busybox/config/util-linux/Config.in +++ b/package/utils/busybox/config/util-linux/Config.in @@ -6,28 +6,424 @@ menu "Linux System Utilities" +config BUSYBOX_CONFIG_ACPID + bool "acpid" + default BUSYBOX_DEFAULT_ACPID + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + acpid listens to ACPI events coming either in textual form from + /proc/acpi/event (though it is marked deprecated it is still widely + used and _is_ a standard) or in binary form from specified evdevs + (just use /dev/input/event*). + + It parses the event to retrieve ACTION and a possible PARAMETER. + It then spawns /etc/acpi/[/] either via run-parts + (if the resulting path is a directory) or directly as an executable. + + N.B. acpid relies on run-parts so have the latter installed. + +config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT + bool "Accept and ignore redundant options" + default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT + depends on BUSYBOX_CONFIG_ACPID + help + Accept and ignore compatibility options -g -m -s -S -v. config BUSYBOX_CONFIG_BLKDISCARD bool "blkdiscard" default BUSYBOX_DEFAULT_BLKDISCARD help blkdiscard discards sectors on a given device. +config BUSYBOX_CONFIG_BLKID + bool "blkid" + default BUSYBOX_DEFAULT_BLKID + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Lists labels and UUIDs of all filesystems. + WARNING: + With all submodules selected, it will add ~8k to busybox. + +config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE + bool "Print filesystem type" + default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE + depends on BUSYBOX_CONFIG_BLKID + help + Show TYPE="filesystem type" config BUSYBOX_CONFIG_BLOCKDEV bool "blockdev" default BUSYBOX_DEFAULT_BLOCKDEV help Performs some ioctls with block devices. +config BUSYBOX_CONFIG_CAL + bool "cal" + default BUSYBOX_DEFAULT_CAL + help + cal is used to display a monthly calendar. +config BUSYBOX_CONFIG_CHRT + bool "chrt" + default BUSYBOX_DEFAULT_CHRT + help + manipulate real-time attributes of a process. + This requires sched_{g,s}etparam support in your libc. +config BUSYBOX_CONFIG_DMESG + bool "dmesg" + default BUSYBOX_DEFAULT_DMESG + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + dmesg is used to examine or control the kernel ring buffer. When the + Linux kernel prints messages to the system log, they are stored in + the kernel ring buffer. You can use dmesg to print the kernel's ring + buffer, clear the kernel ring buffer, change the size of the kernel + ring buffer, and change the priority level at which kernel messages + are also logged to the system console. Enable this option if you + wish to enable the 'dmesg' utility. + +config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY + bool "Pretty output" + default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY + depends on BUSYBOX_CONFIG_DMESG + help + If you wish to scrub the syslog level from the output, say 'Y' here. + The syslog level is a string prefixed to every line with the form + "<#>". + + With this option you will see: + # dmesg + Linux version 2.6.17.4 ..... + BIOS-provided physical RAM map: + BIOS-e820: 0000000000000000 - 000000000009f000 (usable) + + Without this option you will see: + # dmesg + <5>Linux version 2.6.17.4 ..... + <6>BIOS-provided physical RAM map: + <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) +config BUSYBOX_CONFIG_EJECT + bool "eject" + default BUSYBOX_DEFAULT_EJECT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Used to eject cdroms. (defaults to /dev/cdrom) + +config BUSYBOX_CONFIG_FEATURE_EJECT_SCSI + bool "SCSI support" + default BUSYBOX_DEFAULT_FEATURE_EJECT_SCSI + depends on BUSYBOX_CONFIG_EJECT + help + Add the -s option to eject, this allows to eject SCSI-Devices and + usb-storage devices. +config BUSYBOX_CONFIG_FALLOCATE + bool "fallocate" + default BUSYBOX_DEFAULT_FALLOCATE + help + Preallocate space for files. config BUSYBOX_CONFIG_FATATTR bool "fatattr" default BUSYBOX_DEFAULT_FATATTR select BUSYBOX_CONFIG_PLATFORM_LINUX help fatattr lists or changes the file attributes on a fat file system. +config BUSYBOX_CONFIG_FBSET + bool "fbset" + default BUSYBOX_DEFAULT_FBSET + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fbset is used to show or change the settings of a Linux frame buffer + device. The frame buffer device provides a simple and unique + interface to access a graphics display. Enable this option + if you wish to enable the 'fbset' utility. + +config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY + bool "Enable extra options" + default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY + depends on BUSYBOX_CONFIG_FBSET + help + This option enables extended fbset options, allowing one to set the + framebuffer size, color depth, etc. interface to access a graphics + display. Enable this option if you wish to enable extended fbset + options. + +config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE + bool "Enable readmode support" + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE + depends on BUSYBOX_CONFIG_FBSET + help + This option allows fbset to read the video mode database stored by + default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer + device to pre-defined video modes. +config BUSYBOX_CONFIG_FDFORMAT + bool "fdformat" + default BUSYBOX_DEFAULT_FDFORMAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdformat is used to low-level format a floppy disk. +config BUSYBOX_CONFIG_FDISK + bool "fdisk" + default BUSYBOX_DEFAULT_FDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The fdisk utility is used to divide hard disks into one or more + logical disks, which are generally called partitions. This utility + can be used to list and edit the set of partitions or BSD style + 'disk slices' that are defined on a hard drive. + +config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS + bool "Support over 4GB disks" + default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS + depends on BUSYBOX_CONFIG_FDISK + depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed + +config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + bool "Write support" + default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE + depends on BUSYBOX_CONFIG_FDISK + help + Enabling this option allows you to create or change a partition table + and write those changes out to disk. If you leave this option + disabled, you will only be able to view the partition table. + +config BUSYBOX_CONFIG_FEATURE_AIX_LABEL + bool "Support AIX disklabels" + default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change AIX disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SGI_LABEL + bool "Support SGI disklabels" + default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SGI disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_SUN_LABEL + bool "Support SUN disklabels" + default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change SUN disklabels. + Most people can safely leave this option disabled. + +config BUSYBOX_CONFIG_FEATURE_OSF_LABEL + bool "Support BSD disklabels" + default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to create or change BSD disklabels + and define and edit BSD disk slices. + +config BUSYBOX_CONFIG_FEATURE_GPT_LABEL + bool "Support GPT disklabels" + default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to view GUID Partition Table + disklabels. + +config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED + bool "Support expert mode" + default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED + depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE + help + Enabling this option allows you to do terribly unsafe things like + define arbitrary drive geometry, move the beginning of data in a + partition, and similarly evil things. Unless you have a very good + reason you would be wise to leave this disabled. +config BUSYBOX_CONFIG_FINDFS + bool "findfs" + default BUSYBOX_DEFAULT_FINDFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_VOLUMEID + help + Prints the name of a filesystem with given label or UUID. + WARNING: + With all submodules selected, it will add ~8k to busybox. +config BUSYBOX_CONFIG_FLOCK + bool "flock" + default BUSYBOX_DEFAULT_FLOCK + help + Manage locks from shell scripts +config BUSYBOX_CONFIG_FDFLUSH + bool "fdflush" + default BUSYBOX_DEFAULT_FDFLUSH + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + fdflush is only needed when changing media on slightly-broken + removable media drives. It is used to make Linux believe that a + hardware disk-change switch has been actuated, which causes Linux to + forget anything it has cached from the previous media. If you have + such a slightly-broken drive, you will need to run fdflush every time + you change a disk. Most people have working hardware and can safely + leave this disabled. + +config BUSYBOX_CONFIG_FREERAMDISK + bool "freeramdisk" + default BUSYBOX_DEFAULT_FREERAMDISK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Linux allows you to create ramdisks. This utility allows you to + delete them and completely free all memory that was used for the + ramdisk. For example, if you boot Linux into a ramdisk and later + pivot_root, you may want to free the memory that is allocated to the + ramdisk. If you have no use for freeing memory from a ramdisk, leave + this disabled. +config BUSYBOX_CONFIG_FSCK_MINIX + bool "fsck_minix" + default BUSYBOX_DEFAULT_FSCK_MINIX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. It is not a journaling filesystem however and + can experience corruption if it is not properly unmounted or if the + power goes off in the middle of a write. This utility allows you to + check for and attempt to repair any corruption that occurs to a minix + filesystem. +config BUSYBOX_CONFIG_FSFREEZE + bool "fsfreeze" + default BUSYBOX_DEFAULT_FSFREEZE + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Halt new accesses and flush writes on a mounted filesystem. config BUSYBOX_CONFIG_FSTRIM bool "fstrim" default BUSYBOX_DEFAULT_FSTRIM select BUSYBOX_CONFIG_PLATFORM_LINUX help Discard unused blocks on a mounted filesystem. +config BUSYBOX_CONFIG_GETOPT + bool "getopt" + default BUSYBOX_DEFAULT_GETOPT + help + The getopt utility is used to break up (parse) options in command + lines to make it easy to write complex shell scripts that also check + for legal (and illegal) options. If you want to write horribly + complex shell scripts, or use some horribly complex shell script + written by others, this utility may be for you. Most people will + wisely leave this disabled. + +config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG + bool "Support option -l" + default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS + depends on BUSYBOX_CONFIG_GETOPT + help + Enable support for long options (option -l). +config BUSYBOX_CONFIG_HEXDUMP + bool "hexdump" + default BUSYBOX_DEFAULT_HEXDUMP + help + The hexdump utility is used to display binary data in a readable + way that is comparable to the output from most hex editors. + +config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE + bool "Support -R, reverse of 'hexdump -Cv'" + default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE + depends on BUSYBOX_CONFIG_HEXDUMP + help + The hexdump utility is used to display binary data in an ascii + readable way. This option creates binary data from an ascii input. + NB: this option is non-standard. It's unwise to use it in scripts + aimed to be portable. + +config BUSYBOX_CONFIG_HD + bool "hd" + default BUSYBOX_DEFAULT_HD + help + hd is an alias to hexdump -C. +config BUSYBOX_CONFIG_XXD + bool "xxd" + default BUSYBOX_DEFAULT_XXD + help + The xxd utility is used to display binary data in a readable + way that is comparable to the output from most hex editors. +config BUSYBOX_CONFIG_HWCLOCK + bool "hwclock" + default BUSYBOX_DEFAULT_HWCLOCK + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The hwclock utility is used to read and set the hardware clock + on a system. This is primarily used to set the current time on + shutdown in the hardware clock, so the hardware will keep the + correct time when Linux is _not_ running. + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS + bool "Support long options (--hctosys,...)" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS + depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS + +config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS + bool "Use FHS /var/lib/hwclock/adjtime" + default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime + depends on BUSYBOX_CONFIG_HWCLOCK + help + Starting with FHS 2.3, the adjtime state file is supposed to exist + at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish + to use the FHS behavior, answer Y here, otherwise answer N for the + classic /etc/adjtime path. + + pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO +config BUSYBOX_CONFIG_IONICE + bool "ionice" + default BUSYBOX_DEFAULT_IONICE + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Set/set program io scheduling class and priority + Requires kernel >= 2.6.13 +config BUSYBOX_CONFIG_IPCRM + bool "ipcrm" + default BUSYBOX_DEFAULT_IPCRM + help + The ipcrm utility allows the removal of System V interprocess + communication (IPC) objects and the associated data structures + from the system. +config BUSYBOX_CONFIG_IPCS + bool "ipcs" + default BUSYBOX_DEFAULT_IPCS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The ipcs utility is used to provide information on the currently + allocated System V interprocess (IPC) objects in the system. +config BUSYBOX_CONFIG_LAST + bool "last" + default BUSYBOX_DEFAULT_LAST + depends on BUSYBOX_CONFIG_FEATURE_WTMP + help + 'last' displays a list of the last users that logged into the system. + +config BUSYBOX_CONFIG_FEATURE_LAST_FANCY + bool "Output extra information" + default BUSYBOX_DEFAULT_FEATURE_LAST_FANCY + depends on BUSYBOX_CONFIG_LAST + help + 'last' displays detailed information about the last users that + logged into the system (mimics sysvinit last). +900 bytes. +config BUSYBOX_CONFIG_LOSETUP + bool "losetup" + default BUSYBOX_DEFAULT_LOSETUP + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + losetup is used to associate or detach a loop device with a regular + file or block device, and to query the status of a loop device. This + version does not currently support enabling data encryption. +config BUSYBOX_CONFIG_LSPCI + bool "lspci" + default BUSYBOX_DEFAULT_LSPCI + #select PLATFORM_LINUX + help + lspci is a utility for displaying information about PCI buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/pci/devices) only. +config BUSYBOX_CONFIG_LSUSB + bool "lsusb" + default BUSYBOX_DEFAULT_LSUSB + #select PLATFORM_LINUX + help + lsusb is a utility for displaying information about USB buses in the + system and devices connected to them. + + This version uses sysfs (/sys/bus/usb/devices) only. config BUSYBOX_CONFIG_MDEV bool "mdev" default BUSYBOX_DEFAULT_MDEV @@ -85,6 +481,102 @@ config BUSYBOX_CONFIG_FEATURE_MDEV_LOAD_FIRMWARE These devices will request userspace look up the files in /lib/firmware/ and if it exists, send it to the kernel for loading into the hardware. +config BUSYBOX_CONFIG_MESG + bool "mesg" + default BUSYBOX_DEFAULT_MESG + help + Mesg controls access to your terminal by others. It is typically + used to allow or disallow other users to write to your terminal + +config BUSYBOX_CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP + bool "Enable writing to tty only by group, not by everybody" + default BUSYBOX_DEFAULT_FEATURE_MESG_ENABLE_ONLY_GROUP + depends on BUSYBOX_CONFIG_MESG + help + Usually, ttys are owned by group "tty", and "write" tool is + setgid to this group. This way, "mesg y" only needs to enable + "write by owning group" bit in tty mode. + + If you set this option to N, "mesg y" will enable writing + by anybody at all. This is not recommended. +config BUSYBOX_CONFIG_MKE2FS + bool "mke2fs" + default BUSYBOX_DEFAULT_MKE2FS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create EXT2 filesystems. + +config BUSYBOX_CONFIG_MKFS_EXT2 + bool "mkfs.ext2" + default BUSYBOX_DEFAULT_MKFS_EXT2 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "mke2fs". +config BUSYBOX_CONFIG_MKFS_MINIX + bool "mkfs_minix" + default BUSYBOX_DEFAULT_MKFS_MINIX + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + The minix filesystem is a nice, small, compact, read-write filesystem + with little overhead. If you wish to be able to create minix + filesystems this utility will do the job for you. + +config BUSYBOX_CONFIG_FEATURE_MINIX2 + bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" + default BUSYBOX_DEFAULT_FEATURE_MINIX2 + depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX + help + If you wish to be able to create version 2 minix filesystems, enable + this. If you enabled 'mkfs_minix' then you almost certainly want to + be using the version 2 filesystem support. +config BUSYBOX_CONFIG_MKFS_REISER + bool "mkfs_reiser" + default BUSYBOX_DEFAULT_MKFS_REISER + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create ReiserFS filesystems. + Note: this applet needs a lot of testing and polishing. +config BUSYBOX_CONFIG_MKDOSFS + bool "mkdosfs" + default BUSYBOX_DEFAULT_MKDOSFS + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Utility to create FAT32 filesystems. + +config BUSYBOX_CONFIG_MKFS_VFAT + bool "mkfs.vfat" + default BUSYBOX_DEFAULT_MKFS_VFAT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "mkdosfs". +config BUSYBOX_CONFIG_MKSWAP + bool "mkswap" + default BUSYBOX_DEFAULT_MKSWAP + help + The mkswap utility is used to configure a file or disk partition as + Linux swap space. This allows Linux to use the entire file or + partition as if it were additional RAM, which can greatly increase + the capability of low-memory machines. This additional memory is + much slower than real RAM, but can be very helpful at preventing your + applications being killed by the Linux out of memory (OOM) killer. + Once you have created swap space using 'mkswap' you need to enable + the swap space using the 'swapon' utility. + +config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID + bool "UUID support" + default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID + depends on BUSYBOX_CONFIG_MKSWAP + help + Generate swap spaces with universally unique identifiers. +config BUSYBOX_CONFIG_MORE + bool "more" + default BUSYBOX_DEFAULT_MORE + help + more is a simple utility which allows you to read text one screen + sized page at a time. If you want to read text that is larger than + the screen, and you are using anything faster than a 300 baud modem, + you will probably find this utility very helpful. If you don't have + any need to reading text files, you can leave this disabled. config BUSYBOX_CONFIG_MOUNT bool "mount" default BUSYBOX_DEFAULT_MOUNT @@ -158,7 +650,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_CIFS config BUSYBOX_CONFIG_FEATURE_MOUNT_FLAGS depends on BUSYBOX_CONFIG_MOUNT - bool "Support lots of -o flags in mount" + bool "Support lots of -o flags" default BUSYBOX_DEFAULT_FEATURE_MOUNT_FLAGS help Without this, mount only supports ro/rw/remount. With this, it @@ -179,6 +671,11 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_OTHERTAB default BUSYBOX_DEFAULT_FEATURE_MOUNT_OTHERTAB help Support mount -T (specifying an alternate fstab) +config BUSYBOX_CONFIG_MOUNTPOINT + bool "mountpoint" + default BUSYBOX_DEFAULT_MOUNTPOINT + help + mountpoint checks if the directory is a mountpoint. config BUSYBOX_CONFIG_NSENTER bool "nsenter" default BUSYBOX_DEFAULT_NSENTER @@ -193,462 +690,6 @@ config BUSYBOX_CONFIG_FEATURE_NSENTER_LONG_OPTS help Support long options for the nsenter applet. This makes the busybox implementation more compatible with upstream. -config BUSYBOX_CONFIG_REV - bool "rev" - default BUSYBOX_DEFAULT_REV - help - Reverse lines of a file or files. -config BUSYBOX_CONFIG_SETARCH - bool "setarch" - default BUSYBOX_DEFAULT_SETARCH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The linux32 utility is used to create a 32bit environment for the - specified program (usually a shell). It only makes sense to have - this util on a system that supports both 64bit and 32bit userland - (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). -config BUSYBOX_CONFIG_UEVENT - bool "uevent" - default BUSYBOX_DEFAULT_UEVENT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - uevent is a netlink listener for kernel uevent notifications - sent via netlink. It is usually used for dynamic device creation. -config BUSYBOX_CONFIG_UNSHARE - bool "unshare" - default BUSYBOX_DEFAULT_UNSHARE - depends on BUSYBOX_CONFIG_LONG_OPTS && !BUSYBOX_CONFIG_NOMMU - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Run program with some namespaces unshared from parent. - -config BUSYBOX_CONFIG_ACPID - bool "acpid" - default BUSYBOX_DEFAULT_ACPID - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - acpid listens to ACPI events coming either in textual form from - /proc/acpi/event (though it is marked deprecated it is still widely - used and _is_ a standard) or in binary form from specified evdevs - (just use /dev/input/event*). - - It parses the event to retrieve ACTION and a possible PARAMETER. - It then spawns /etc/acpi/[/] either via run-parts - (if the resulting path is a directory) or directly as an executable. - - N.B. acpid relies on run-parts so have the latter installed. - -config BUSYBOX_CONFIG_FEATURE_ACPID_COMPAT - bool "Accept and ignore redundant options" - default BUSYBOX_DEFAULT_FEATURE_ACPID_COMPAT - depends on BUSYBOX_CONFIG_ACPID - help - Accept and ignore compatibility options -g -m -s -S -v. - -config BUSYBOX_CONFIG_BLKID - bool "blkid" - default BUSYBOX_DEFAULT_BLKID - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Lists labels and UUIDs of all filesystems. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config BUSYBOX_CONFIG_FEATURE_BLKID_TYPE - bool "Print filesystem type" - default BUSYBOX_DEFAULT_FEATURE_BLKID_TYPE - depends on BUSYBOX_CONFIG_BLKID - help - Show TYPE="filesystem type" - -config BUSYBOX_CONFIG_DMESG - bool "dmesg" - default BUSYBOX_DEFAULT_DMESG - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - dmesg is used to examine or control the kernel ring buffer. When the - Linux kernel prints messages to the system log, they are stored in - the kernel ring buffer. You can use dmesg to print the kernel's ring - buffer, clear the kernel ring buffer, change the size of the kernel - ring buffer, and change the priority level at which kernel messages - are also logged to the system console. Enable this option if you - wish to enable the 'dmesg' utility. - -config BUSYBOX_CONFIG_FEATURE_DMESG_PRETTY - bool "Pretty dmesg output" - default BUSYBOX_DEFAULT_FEATURE_DMESG_PRETTY - depends on BUSYBOX_CONFIG_DMESG - help - If you wish to scrub the syslog level from the output, say 'Y' here. - The syslog level is a string prefixed to every line with the form - "<#>". - - With this option you will see: - # dmesg - Linux version 2.6.17.4 ..... - BIOS-provided physical RAM map: - BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - - Without this option you will see: - # dmesg - <5>Linux version 2.6.17.4 ..... - <6>BIOS-provided physical RAM map: - <6> BIOS-e820: 0000000000000000 - 000000000009f000 (usable) - -config BUSYBOX_CONFIG_FBSET - bool "fbset" - default BUSYBOX_DEFAULT_FBSET - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fbset is used to show or change the settings of a Linux frame buffer - device. The frame buffer device provides a simple and unique - interface to access a graphics display. Enable this option - if you wish to enable the 'fbset' utility. - -config BUSYBOX_CONFIG_FEATURE_FBSET_FANCY - bool "Turn on extra fbset options" - default BUSYBOX_DEFAULT_FEATURE_FBSET_FANCY - depends on BUSYBOX_CONFIG_FBSET - help - This option enables extended fbset options, allowing one to set the - framebuffer size, color depth, etc. interface to access a graphics - display. Enable this option if you wish to enable extended fbset - options. - -config BUSYBOX_CONFIG_FEATURE_FBSET_READMODE - bool "Turn on fbset readmode support" - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE - depends on BUSYBOX_CONFIG_FBSET - help - This option allows fbset to read the video mode database stored by - default BUSYBOX_DEFAULT_FEATURE_FBSET_READMODE /etc/fb.modes, which can be used to set frame buffer - device to pre-defined video modes. - -config BUSYBOX_CONFIG_FDFLUSH - bool "fdflush" - default BUSYBOX_DEFAULT_FDFLUSH - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdflush is only needed when changing media on slightly-broken - removable media drives. It is used to make Linux believe that a - hardware disk-change switch has been actuated, which causes Linux to - forget anything it has cached from the previous media. If you have - such a slightly-broken drive, you will need to run fdflush every time - you change a disk. Most people have working hardware and can safely - leave this disabled. - -config BUSYBOX_CONFIG_FDFORMAT - bool "fdformat" - default BUSYBOX_DEFAULT_FDFORMAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - fdformat is used to low-level format a floppy disk. - -config BUSYBOX_CONFIG_FDISK - bool "fdisk" - default BUSYBOX_DEFAULT_FDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The fdisk utility is used to divide hard disks into one or more - logical disks, which are generally called partitions. This utility - can be used to list and edit the set of partitions or BSD style - 'disk slices' that are defined on a hard drive. - -config BUSYBOX_CONFIG_FDISK_SUPPORT_LARGE_DISKS - bool "Support over 4GB disks" - default BUSYBOX_DEFAULT_FDISK_SUPPORT_LARGE_DISKS - depends on BUSYBOX_CONFIG_FDISK - depends on !BUSYBOX_CONFIG_LFS # with LFS no special code is needed - help - Enable this option to support large disks > 4GB. - -config BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - bool "Write support" - default BUSYBOX_DEFAULT_FEATURE_FDISK_WRITABLE - depends on BUSYBOX_CONFIG_FDISK - help - Enabling this option allows you to create or change a partition table - and write those changes out to disk. If you leave this option - disabled, you will only be able to view the partition table. - -config BUSYBOX_CONFIG_FEATURE_AIX_LABEL - bool "Support AIX disklabels" - default BUSYBOX_DEFAULT_FEATURE_AIX_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change AIX disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SGI_LABEL - bool "Support SGI disklabels" - default BUSYBOX_DEFAULT_FEATURE_SGI_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SGI disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_SUN_LABEL - bool "Support SUN disklabels" - default BUSYBOX_DEFAULT_FEATURE_SUN_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change SUN disklabels. - Most people can safely leave this option disabled. - -config BUSYBOX_CONFIG_FEATURE_OSF_LABEL - bool "Support BSD disklabels" - default BUSYBOX_DEFAULT_FEATURE_OSF_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to create or change BSD disklabels - and define and edit BSD disk slices. - -config BUSYBOX_CONFIG_FEATURE_GPT_LABEL - bool "Support GPT disklabels" - default BUSYBOX_DEFAULT_FEATURE_GPT_LABEL - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to view GUID Partition Table - disklabels. - -config BUSYBOX_CONFIG_FEATURE_FDISK_ADVANCED - bool "Support expert mode" - default BUSYBOX_DEFAULT_FEATURE_FDISK_ADVANCED - depends on BUSYBOX_CONFIG_FDISK && BUSYBOX_CONFIG_FEATURE_FDISK_WRITABLE - help - Enabling this option allows you to do terribly unsafe things like - define arbitrary drive geometry, move the beginning of data in a - partition, and similarly evil things. Unless you have a very good - reason you would be wise to leave this disabled. - -config BUSYBOX_CONFIG_FINDFS - bool "findfs" - default BUSYBOX_DEFAULT_FINDFS - select BUSYBOX_CONFIG_PLATFORM_LINUX - select BUSYBOX_CONFIG_VOLUMEID - help - Prints the name of a filesystem with given label or UUID. - WARNING: - With all submodules selected, it will add ~8k to busybox. - -config BUSYBOX_CONFIG_FLOCK - bool "flock" - default BUSYBOX_DEFAULT_FLOCK - help - Manage locks from shell scripts - -config BUSYBOX_CONFIG_FREERAMDISK - bool "freeramdisk" - default BUSYBOX_DEFAULT_FREERAMDISK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Linux allows you to create ramdisks. This utility allows you to - delete them and completely free all memory that was used for the - ramdisk. For example, if you boot Linux into a ramdisk and later - pivot_root, you may want to free the memory that is allocated to the - ramdisk. If you have no use for freeing memory from a ramdisk, leave - this disabled. - -config BUSYBOX_CONFIG_FSCK_MINIX - bool "fsck_minix" - default BUSYBOX_DEFAULT_FSCK_MINIX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. It is not a journaling filesystem however and - can experience corruption if it is not properly unmounted or if the - power goes off in the middle of a write. This utility allows you to - check for and attempt to repair any corruption that occurs to a minix - filesystem. - -config BUSYBOX_CONFIG_MKFS_EXT2 - bool "mkfs_ext2" - default BUSYBOX_DEFAULT_MKFS_EXT2 - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create EXT2 filesystems. - -config BUSYBOX_CONFIG_MKFS_MINIX - bool "mkfs_minix" - default BUSYBOX_DEFAULT_MKFS_MINIX - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The minix filesystem is a nice, small, compact, read-write filesystem - with little overhead. If you wish to be able to create minix - filesystems this utility will do the job for you. - -config BUSYBOX_CONFIG_FEATURE_MINIX2 - bool "Support Minix fs v2 (fsck_minix/mkfs_minix)" - default BUSYBOX_DEFAULT_FEATURE_MINIX2 - depends on BUSYBOX_CONFIG_FSCK_MINIX || BUSYBOX_CONFIG_MKFS_MINIX - help - If you wish to be able to create version 2 minix filesystems, enable - this. If you enabled 'mkfs_minix' then you almost certainly want to - be using the version 2 filesystem support. - -config BUSYBOX_CONFIG_MKFS_REISER - bool "mkfs_reiser" - default BUSYBOX_DEFAULT_MKFS_REISER - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create ReiserFS filesystems. - Note: this applet needs a lot of testing and polishing. - -config BUSYBOX_CONFIG_MKFS_VFAT - bool "mkfs_vfat" - default BUSYBOX_DEFAULT_MKFS_VFAT - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - Utility to create FAT32 filesystems. - -config BUSYBOX_CONFIG_GETOPT - bool "getopt" - default BUSYBOX_DEFAULT_GETOPT - help - The getopt utility is used to break up (parse) options in command - lines to make it easy to write complex shell scripts that also check - for legal (and illegal) options. If you want to write horribly - complex shell scripts, or use some horribly complex shell script - written by others, this utility may be for you. Most people will - wisely leave this disabled. - -config BUSYBOX_CONFIG_FEATURE_GETOPT_LONG - bool "Support option -l" - default BUSYBOX_DEFAULT_FEATURE_GETOPT_LONG if BUSYBOX_CONFIG_LONG_OPTS - depends on BUSYBOX_CONFIG_GETOPT - help - Enable support for long options (option -l). - -config BUSYBOX_CONFIG_HEXDUMP - bool "hexdump" - default BUSYBOX_DEFAULT_HEXDUMP - help - The hexdump utility is used to display binary data in a readable - way that is comparable to the output from most hex editors. - -config BUSYBOX_CONFIG_FEATURE_HEXDUMP_REVERSE - bool "Support -R, reverse of 'hexdump -Cv'" - default BUSYBOX_DEFAULT_FEATURE_HEXDUMP_REVERSE - depends on BUSYBOX_CONFIG_HEXDUMP - help - The hexdump utility is used to display binary data in an ascii - readable way. This option creates binary data from an ascii input. - NB: this option is non-standard. It's unwise to use it in scripts - aimed to be portable. - -config BUSYBOX_CONFIG_HD - bool "hd" - default BUSYBOX_DEFAULT_HD - depends on BUSYBOX_CONFIG_HEXDUMP - help - hd is an alias to hexdump -C. - -config BUSYBOX_CONFIG_HWCLOCK - bool "hwclock" - default BUSYBOX_DEFAULT_HWCLOCK - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The hwclock utility is used to read and set the hardware clock - on a system. This is primarily used to set the current time on - shutdown in the hardware clock, so the hardware will keep the - correct time when Linux is _not_ running. - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS - bool "Support long options (--hctosys,...)" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_LONG_OPTIONS - depends on BUSYBOX_CONFIG_HWCLOCK && BUSYBOX_CONFIG_LONG_OPTS - help - By default, the hwclock utility only uses short options. If you - are overly fond of its long options, such as --hctosys, --utc, etc) - then enable this option. - -config BUSYBOX_CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS - bool "Use FHS /var/lib/hwclock/adjtime" - default BUSYBOX_DEFAULT_FEATURE_HWCLOCK_ADJTIME_FHS # util-linux-ng in Fedora 13 still uses /etc/adjtime - depends on BUSYBOX_CONFIG_HWCLOCK - help - Starting with FHS 2.3, the adjtime state file is supposed to exist - at /var/lib/hwclock/adjtime instead of /etc/adjtime. If you wish - to use the FHS behavior, answer Y here, otherwise answer N for the - classic /etc/adjtime path. - - pathname.com/fhs/pub/fhs-2.3.html#VARLIBHWCLOCKSTATEDIRECTORYFORHWCLO - -config BUSYBOX_CONFIG_IPCRM - bool "ipcrm" - default BUSYBOX_DEFAULT_IPCRM - help - The ipcrm utility allows the removal of System V interprocess - communication (IPC) objects and the associated data structures - from the system. - -config BUSYBOX_CONFIG_IPCS - bool "ipcs" - default BUSYBOX_DEFAULT_IPCS - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - The ipcs utility is used to provide information on the currently - allocated System V interprocess (IPC) objects in the system. - -config BUSYBOX_CONFIG_LOSETUP - bool "losetup" - default BUSYBOX_DEFAULT_LOSETUP - select BUSYBOX_CONFIG_PLATFORM_LINUX - help - losetup is used to associate or detach a loop device with a regular - file or block device, and to query the status of a loop device. This - version does not currently support enabling data encryption. - -config BUSYBOX_CONFIG_LSPCI - bool "lspci" - default BUSYBOX_DEFAULT_LSPCI - #select PLATFORM_LINUX - help - lspci is a utility for displaying information about PCI buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/pci/devices) only. - -config BUSYBOX_CONFIG_LSUSB - bool "lsusb" - default BUSYBOX_DEFAULT_LSUSB - #select PLATFORM_LINUX - help - lsusb is a utility for displaying information about USB buses in the - system and devices connected to them. - - This version uses sysfs (/sys/bus/usb/devices) only. - -config BUSYBOX_CONFIG_MKSWAP - bool "mkswap" - default BUSYBOX_DEFAULT_MKSWAP - help - The mkswap utility is used to configure a file or disk partition as - Linux swap space. This allows Linux to use the entire file or - partition as if it were additional RAM, which can greatly increase - the capability of low-memory machines. This additional memory is - much slower than real RAM, but can be very helpful at preventing your - applications being killed by the Linux out of memory (OOM) killer. - Once you have created swap space using 'mkswap' you need to enable - the swap space using the 'swapon' utility. - -config BUSYBOX_CONFIG_FEATURE_MKSWAP_UUID - bool "UUID support" - default BUSYBOX_DEFAULT_FEATURE_MKSWAP_UUID - depends on BUSYBOX_CONFIG_MKSWAP - help - Generate swap spaces with universally unique identifiers. - -config BUSYBOX_CONFIG_MORE - bool "more" - default BUSYBOX_DEFAULT_MORE - help - more is a simple utility which allows you to read text one screen - sized page at a time. If you want to read text that is larger than - the screen, and you are using anything faster than a 300 baud modem, - you will probably find this utility very helpful. If you don't have - any need to reading text files, you can leave this disabled. - config BUSYBOX_CONFIG_PIVOT_ROOT bool "pivot_root" default BUSYBOX_DEFAULT_PIVOT_ROOT @@ -661,7 +702,6 @@ config BUSYBOX_CONFIG_PIVOT_ROOT Note: This is for initrd in linux 2.4. Under initramfs (introduced in linux 2.6) use switch_root instead. - config BUSYBOX_CONFIG_RDATE bool "rdate" default BUSYBOX_DEFAULT_RDATE @@ -670,46 +710,87 @@ config BUSYBOX_CONFIG_RDATE system clock with the date and time of a remote networked system using the RFC868 protocol, which is built into the inetd daemon on most systems. - config BUSYBOX_CONFIG_RDEV bool "rdev" default BUSYBOX_DEFAULT_RDEV help Print the device node associated with the filesystem mounted at '/'. - config BUSYBOX_CONFIG_READPROFILE bool "readprofile" default BUSYBOX_DEFAULT_READPROFILE #select PLATFORM_LINUX help This allows you to parse /proc/profile for basic profiling. - +config BUSYBOX_CONFIG_RENICE + bool "renice" + default BUSYBOX_DEFAULT_RENICE + help + Renice alters the scheduling priority of one or more running + processes. +config BUSYBOX_CONFIG_REV + bool "rev" + default BUSYBOX_DEFAULT_REV + help + Reverse lines of a file or files. config BUSYBOX_CONFIG_RTCWAKE bool "rtcwake" default BUSYBOX_DEFAULT_RTCWAKE select BUSYBOX_CONFIG_PLATFORM_LINUX help Enter a system sleep state until specified wakeup time. - config BUSYBOX_CONFIG_SCRIPT bool "script" default BUSYBOX_DEFAULT_SCRIPT help The script makes typescript of terminal session. - config BUSYBOX_CONFIG_SCRIPTREPLAY bool "scriptreplay" default BUSYBOX_DEFAULT_SCRIPTREPLAY help This program replays a typescript, using timing information given by script -t. - -config BUSYBOX_CONFIG_SWAPONOFF - bool "swaponoff" - default BUSYBOX_DEFAULT_SWAPONOFF +config BUSYBOX_CONFIG_SETARCH + bool "setarch" + default BUSYBOX_DEFAULT_SETARCH select BUSYBOX_CONFIG_PLATFORM_LINUX help - This option enables both the 'swapon' and the 'swapoff' utilities. + The linux32 utility is used to create a 32bit environment for the + specified program (usually a shell). It only makes sense to have + this util on a system that supports both 64bit and 32bit userland + (like amd64/x86, ppc64/ppc, sparc64/sparc, etc...). + +config BUSYBOX_CONFIG_LINUX32 + bool "linux32" + default BUSYBOX_DEFAULT_LINUX32 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "setarch linux32". + +config BUSYBOX_CONFIG_LINUX64 + bool "linux64" + default BUSYBOX_DEFAULT_LINUX64 + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + Alias to "setarch linux64". +config BUSYBOX_CONFIG_SETPRIV + bool "setpriv" + default BUSYBOX_DEFAULT_SETPRIV + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Run a program with different Linux privilege settings. + Requires kernel >= 3.5 +config BUSYBOX_CONFIG_SETSID + bool "setsid" + default BUSYBOX_DEFAULT_SETSID + help + setsid runs a program in a new session +config BUSYBOX_CONFIG_SWAPON + bool "swapon" + default BUSYBOX_DEFAULT_SWAPON + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This option enables the 'swapon' utility. Once you have created some swap space using 'mkswap', you also need to enable your swap space with the 'swapon' utility. The 'swapoff' utility is used, typically at system shutdown, to disable any swap @@ -719,7 +800,7 @@ config BUSYBOX_CONFIG_SWAPONOFF config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD bool "Support discard option -d" default BUSYBOX_DEFAULT_FEATURE_SWAPON_DISCARD - depends on BUSYBOX_CONFIG_SWAPONOFF + depends on BUSYBOX_CONFIG_SWAPON help Enable support for discarding swap area blocks at swapon and/or as the kernel frees them. This option enables both the -d option on @@ -728,10 +809,16 @@ config BUSYBOX_CONFIG_FEATURE_SWAPON_DISCARD config BUSYBOX_CONFIG_FEATURE_SWAPON_PRI bool "Support priority option -p" default BUSYBOX_DEFAULT_FEATURE_SWAPON_PRI - depends on BUSYBOX_CONFIG_SWAPONOFF + depends on BUSYBOX_CONFIG_SWAPON help Enable support for setting swap device priority in swapon. +config BUSYBOX_CONFIG_SWAPOFF + bool "swapoff" + default BUSYBOX_DEFAULT_SWAPOFF + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + This option enables the 'swapoff' utility. config BUSYBOX_CONFIG_SWITCH_ROOT bool "switch_root" default BUSYBOX_DEFAULT_SWITCH_ROOT @@ -751,7 +838,28 @@ config BUSYBOX_CONFIG_SWITCH_ROOT * Because the Linux kernel uses rootfs internally as the starting and ending point for searching through the kernel's doubly linked list of active mount points. That's why. +config BUSYBOX_CONFIG_TASKSET + bool "taskset" + default BUSYBOX_DEFAULT_TASKSET + help + Retrieve or set a processes's CPU affinity. + This requires sched_{g,s}etaffinity support in your libc. +config BUSYBOX_CONFIG_FEATURE_TASKSET_FANCY + bool "Fancy output" + default BUSYBOX_DEFAULT_FEATURE_TASKSET_FANCY + depends on BUSYBOX_CONFIG_TASKSET + help + Needed for machines with more than 32-64 CPUs: + affinity parameter 0xHHHHHHHHHHHHHHHHHHHH can be arbitrarily long + in this case. Otherwise, it is limited to sizeof(long). +config BUSYBOX_CONFIG_UEVENT + bool "uevent" + default BUSYBOX_DEFAULT_UEVENT + select BUSYBOX_CONFIG_PLATFORM_LINUX + help + uevent is a netlink listener for kernel uevent notifications + sent via netlink. It is usually used for dynamic device creation. config BUSYBOX_CONFIG_UMOUNT bool "umount" default BUSYBOX_DEFAULT_UMOUNT @@ -768,6 +876,20 @@ config BUSYBOX_CONFIG_FEATURE_UMOUNT_ALL depends on BUSYBOX_CONFIG_UMOUNT help Support -a option to unmount all currently mounted filesystems. +config BUSYBOX_CONFIG_UNSHARE + bool "unshare" + default BUSYBOX_DEFAULT_UNSHARE + depends on !BUSYBOX_CONFIG_NOMMU + select BUSYBOX_CONFIG_PLATFORM_LINUX + select BUSYBOX_CONFIG_LONG_OPTS + help + Run program with some namespaces unshared from parent. +config BUSYBOX_CONFIG_WALL + bool "wall" + default BUSYBOX_DEFAULT_WALL + depends on BUSYBOX_CONFIG_FEATURE_UTMP + help + Write a message to all users that are logged in. comment "Common options for mount/umount" depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT @@ -802,7 +924,7 @@ config BUSYBOX_CONFIG_FEATURE_MOUNT_LOOP_CREATE if it does not find a free one. config BUSYBOX_CONFIG_FEATURE_MTAB_SUPPORT - bool "Support for the old /etc/mtab file" + bool "Support old /etc/mtab file" default BUSYBOX_DEFAULT_FEATURE_MTAB_SUPPORT depends on BUSYBOX_CONFIG_MOUNT || BUSYBOX_CONFIG_UMOUNT select BUSYBOX_CONFIG_FEATURE_MOUNT_FAKE diff --git a/package/utils/busybox/config/util-linux/volume_id/Config.in b/package/utils/busybox/config/util-linux/volume_id/Config.in index 6153314d6..afbfa4ae5 100644 --- a/package/utils/busybox/config/util-linux/volume_id/Config.in +++ b/package/utils/busybox/config/util-linux/volume_id/Config.in @@ -11,31 +11,18 @@ config BUSYBOX_CONFIG_VOLUMEID menu "Filesystem/Volume identification" depends on BUSYBOX_CONFIG_VOLUMEID - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BCACHE bool "bcache filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BCACHE depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_BTRFS bool "btrfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_BTRFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_CRAMFS bool "cramfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_CRAMFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT bool "exFAT filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXFAT @@ -44,16 +31,10 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXFAT exFAT (extended FAT) is a proprietary file system designed especially for flash drives. It has many features from NTFS, but with less overhead. exFAT is used on most SDXC cards for consumer electronics. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_EXT bool "Ext filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_EXT depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS bool "f2fs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_F2FS @@ -63,64 +44,34 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_F2FS which is adapted to newer forms of storage. F2FS also remedies some known issues of the older log structured file systems, such as high cleaning overhead. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_FAT bool "fat filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_FAT depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_HFS bool "hfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_HFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ISO9660 bool "iso9660 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ISO9660 depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_JFS bool "jfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_JFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXRAID bool "linuxraid" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXRAID depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LINUXSWAP bool "linux swap filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LINUXSWAP depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_LUKS bool "luks filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_LUKS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS bool "nilfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NILFS @@ -136,40 +87,22 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NILFS SOX compliance logging, and so forth. It can serve as an alternative filesystem for Linux desktop environment, or as a basis of advanced storage appliances. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_NTFS bool "ntfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_NTFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_OCFS2 bool "ocfs2 filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_OCFS2 depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_REISERFS bool "Reiser filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_REISERFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_ROMFS bool "romfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_ROMFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS bool "SquashFS filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SQUASHFS @@ -179,134 +112,76 @@ config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SQUASHFS intended for general read-only filesystem use and in constrained block device/memory systems (e.g. embedded systems) where low overhead is needed. - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_SYSV bool "sysv filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_SYSV depends on BUSYBOX_CONFIG_VOLUMEID +config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UBIFS + bool "UBIFS filesystem" + default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UBIFS + depends on BUSYBOX_CONFIG_VOLUMEID help - TODO - - + UBIFS (Unsorted Block Image File System) is a file + system for use with raw flash memory media. config BUSYBOX_CONFIG_FEATURE_VOLUMEID_UDF bool "udf filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_UDF depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - - ### config FEATURE_VOLUMEID_HIGHPOINTRAID ### bool "highpoint raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_HPFS ### bool "hpfs filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_ISWRAID ### bool "intel raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_LSIRAID ### bool "lsi raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_LVM ### bool "lvm" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MAC ### bool "mac filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MINIX ### bool "minix filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_MSDOS ### bool "msdos filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_NVIDIARAID ### bool "nvidia raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_PROMISERAID ### bool "promise raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_SILICONRAID ### bool "silicon raid" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_UFS ### bool "ufs filesystem" ### default y ### depends on VOLUMEID -### help -### TODO - - ### config FEATURE_VOLUMEID_VIARAID ### bool "via raid" ### default y ### depends on VOLUMEID -### help -### TODO - - config BUSYBOX_CONFIG_FEATURE_VOLUMEID_XFS bool "xfs filesystem" default BUSYBOX_DEFAULT_FEATURE_VOLUMEID_XFS depends on BUSYBOX_CONFIG_VOLUMEID - help - TODO - endmenu diff --git a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch b/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch deleted file mode 100644 index f33c3b22e..000000000 --- a/package/utils/busybox/patches/002-libbb-send_to_from-do-not-require-that-to-should-hav.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7cef4817d6d6d61a1166ed7dfc13537b95c65970 Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Thu, 15 Sep 2016 13:20:51 +0200 -Subject: [PATCH] libbb:/send_to_from: do not require that "to" should have the - same AF. Closes 9146 - -Signed-off-by: Denys Vlasenko ---- - libbb/udp_io.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - ---- a/libbb/udp_io.c -+++ b/libbb/udp_io.c -@@ -70,7 +70,13 @@ send_to_from(int fd, void *buf, size_t l - msg.msg_flags = flags; - - cmsgptr = CMSG_FIRSTHDR(&msg); -- if (to->sa_family == AF_INET && from->sa_family == AF_INET) { -+ /* -+ * Users report that to->sa_family can be AF_INET6 too, -+ * if "to" was acquired by recv_from_to(). IOW: recv_from_to() -+ * was seen showing IPv6 "from" even when the destination -+ * of received packet (our local address) was IPv4. -+ */ -+ if (/* to->sa_family == AF_INET && */ from->sa_family == AF_INET) { - struct in_pktinfo *pktptr; - cmsgptr->cmsg_level = IPPROTO_IP; - cmsgptr->cmsg_type = IP_PKTINFO; -@@ -86,7 +92,7 @@ send_to_from(int fd, void *buf, size_t l - pktptr->ipi_spec_dst = ((struct sockaddr_in*)from)->sin_addr; - } - # if ENABLE_FEATURE_IPV6 && defined(IPV6_PKTINFO) -- else if (to->sa_family == AF_INET6 && from->sa_family == AF_INET6) { -+ else if (/* to->sa_family == AF_INET6 && */ from->sa_family == AF_INET6) { - struct in6_pktinfo *pktptr; - cmsgptr->cmsg_level = IPPROTO_IPV6; - cmsgptr->cmsg_type = IPV6_PKTINFO; diff --git a/package/utils/busybox/patches/102-trylink_mktemp_fix.patch b/package/utils/busybox/patches/102-trylink_mktemp_fix.patch deleted file mode 100644 index ed1dcbb66..000000000 --- a/package/utils/busybox/patches/102-trylink_mktemp_fix.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- a/scripts/trylink -+++ b/scripts/trylink -@@ -46,7 +46,7 @@ try() { - } - - check_cc() { -- local tempname="$(mktemp)" -+ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" - local r - echo "int main(int argc,char**argv){return argv?argc:0;}" >"$tempname".c - # Can use "-o /dev/null", but older gcc tend to *unlink it* on failure! :( -@@ -61,7 +61,7 @@ check_cc() { - } - - check_libc_is_glibc() { -- local tempname="$(mktemp)" -+ local tempname="$(mktemp /tmp/tmp.XXXXXXXXXX)" - local r - echo "\ - #include diff --git a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch b/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch deleted file mode 100644 index 4825bc8a6..000000000 --- a/package/utils/busybox/patches/120-remove_uclibc_rpc_check.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/util-linux/mount.c -+++ b/util-linux/mount.c -@@ -237,9 +237,6 @@ - #if ENABLE_FEATURE_MOUNT_NFS - /* This is just a warning of a common mistake. Possibly this should be a - * uclibc faq entry rather than in busybox... */ --# if defined(__UCLIBC__) && ! defined(__UCLIBC_HAS_RPC__) --# error "You need to build uClibc with UCLIBC_HAS_RPC for NFS support" --# endif - # include - # include - # include diff --git a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch index 0fdaed502..5f64c19d0 100644 --- a/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch +++ b/package/utils/busybox/patches/200-udhcpc_reduce_msgs.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -697,6 +697,7 @@ static int bcast_or_ucast(struct dhcp_pa +@@ -706,6 +706,7 @@ static int bcast_or_ucast(struct dhcp_pa static NOINLINE int send_discover(uint32_t xid, uint32_t requested) { struct dhcp_packet packet; @@ -8,7 +8,7 @@ /* Fill in: op, htype, hlen, cookie, chaddr fields, * random xid field (we override it below), -@@ -714,6 +715,7 @@ static NOINLINE int send_discover(uint32 +@@ -723,6 +724,7 @@ static NOINLINE int send_discover(uint32 */ add_client_options(&packet); diff --git a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch index 4a9ae9813..727f69409 100644 --- a/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch +++ b/package/utils/busybox/patches/201-udhcpc_changed_ifindex.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1422,6 +1422,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c +@@ -1442,6 +1442,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c /* silence "uninitialized!" warning */ unsigned timestamp_before_wait = timestamp_before_wait; diff --git a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch index 1e44552c1..7b77d2970 100644 --- a/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch +++ b/package/utils/busybox/patches/203-udhcpc_renew_no_deconfig.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -1103,7 +1103,6 @@ static void perform_renew(void) +@@ -1112,7 +1112,6 @@ static void perform_renew(void) state = RENEW_REQUESTED; break; case RENEW_REQUESTED: /* impatient are we? fine, square 1 */ diff --git a/package/utils/busybox/patches/210-add_netmsg_util.patch b/package/utils/busybox/patches/210-add_netmsg_util.patch index 2382698d0..d7b2ae7c4 100644 --- a/package/utils/busybox/patches/210-add_netmsg_util.patch +++ b/package/utils/busybox/patches/210-add_netmsg_util.patch @@ -1,46 +1,25 @@ ---- a/include/applets.src.h -+++ b/include/applets.src.h -@@ -229,6 +229,7 @@ IF_MT(APPLET(mt, BB_DIR_BIN, BB_SUID_DRO - IF_MV(APPLET(mv, BB_DIR_BIN, BB_SUID_DROP)) - IF_NAMEIF(APPLET(nameif, BB_DIR_SBIN, BB_SUID_DROP)) - IF_NC(APPLET(nc, BB_DIR_USR_BIN, BB_SUID_DROP)) -+IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) - IF_NETSTAT(APPLET(netstat, BB_DIR_BIN, BB_SUID_DROP)) - IF_NICE(APPLET(nice, BB_DIR_BIN, BB_SUID_DROP)) - IF_NOHUP(APPLET(nohup, BB_DIR_USR_BIN, BB_SUID_DROP)) ---- a/networking/Config.src -+++ b/networking/Config.src -@@ -639,6 +639,12 @@ config FEATURE_IPCALC_LONG_OPTIONS - help - Support long options for the ipcalc applet. - -+config NETMSG -+ bool "netmsg" -+ default n -+ help -+ simple program for sending udp broadcast messages -+ - config NETSTAT - bool "netstat" - default y ---- a/networking/Kbuild.src -+++ b/networking/Kbuild.src -@@ -27,6 +27,7 @@ lib-$(CONFIG_IP) += ip.o - lib-$(CONFIG_IPCALC) += ipcalc.o - lib-$(CONFIG_NAMEIF) += nameif.o - lib-$(CONFIG_NC) += nc.o -+lib-$(CONFIG_NETMSG) += netmsg.o - lib-$(CONFIG_NETSTAT) += netstat.o - lib-$(CONFIG_NSLOOKUP) += nslookup.o - lib-$(CONFIG_NTPD) += ntpd.o --- /dev/null +++ b/networking/netmsg.c -@@ -0,0 +1,65 @@ +@@ -0,0 +1,76 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ ++ ++//config:config NETMSG ++//config: bool "netmsg" ++//config: default n ++//config: help ++//config: simple program for sending udp broadcast messages ++ ++//applet:IF_NETMSG(APPLET(netmsg, BB_DIR_BIN, BB_SUID_REQUIRE)) ++ ++//kbuild:lib-$(CONFIG_NETMSG) += netmsg.o ++ ++//usage:#define netmsg_trivial_usage NOUSAGE_STR ++//usage:#define netmsg_full_usage "" ++ +#include +#include +#include @@ -50,9 +29,6 @@ +#include +#include "busybox.h" + -+//usage:#define netmsg_trivial_usage NOUSAGE_STR -+//usage:#define netmsg_full_usage "" -+ +#ifndef CONFIG_NETMSG +int main(int argc, char **argv) +#else diff --git a/package/utils/busybox/patches/220-add_lock_util.patch b/package/utils/busybox/patches/220-add_lock_util.patch index c60f5db39..4e46b74f0 100644 --- a/package/utils/busybox/patches/220-add_lock_util.patch +++ b/package/utils/busybox/patches/220-add_lock_util.patch @@ -1,46 +1,25 @@ ---- a/include/applets.src.h -+++ b/include/applets.src.h -@@ -196,6 +196,7 @@ IF_LN(APPLET_NOEXEC(ln, ln, BB_DIR_BIN, - IF_LOAD_POLICY(APPLET(load_policy, BB_DIR_USR_SBIN, BB_SUID_DROP)) - IF_LOADFONT(APPLET(loadfont, BB_DIR_USR_SBIN, BB_SUID_DROP)) - IF_LOADKMAP(APPLET(loadkmap, BB_DIR_SBIN, BB_SUID_DROP)) -+IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) - IF_LOGNAME(APPLET_NOFORK(logname, logname, BB_DIR_USR_BIN, BB_SUID_DROP, logname)) - IF_LOSETUP(APPLET(losetup, BB_DIR_SBIN, BB_SUID_DROP)) - IF_LS(APPLET_NOEXEC(ls, ls, BB_DIR_BIN, BB_SUID_DROP, ls)) ---- a/miscutils/Config.src -+++ b/miscutils/Config.src -@@ -375,6 +375,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA - help - Enables the 'hdparm -d' option to get/set using_dma flag. - -+config LOCK -+ bool "lock" -+ default n -+ help -+ Small utility for using locks in scripts -+ - config MAKEDEVS - bool "makedevs" - default y ---- a/miscutils/Kbuild.src -+++ b/miscutils/Kbuild.src -@@ -33,6 +33,7 @@ lib-$(CONFIG_LAST) += last.o - endif - - lib-$(CONFIG_LESS) += less.o -+lib-$(CONFIG_LOCK) += lock.o - lib-$(CONFIG_MAKEDEVS) += makedevs.o - lib-$(CONFIG_MAN) += man.o - lib-$(CONFIG_MICROCOM) += microcom.o --- /dev/null +++ b/miscutils/lock.c -@@ -0,0 +1,144 @@ +@@ -0,0 +1,155 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * + * This is free software, licensed under the GNU General Public License v2. + */ ++ ++//config:config LOCK ++//config: bool "lock" ++//config: default n ++//config: help ++//config: Small utility for using locks in scripts ++ ++//applet:IF_LOCK(APPLET(lock, BB_DIR_BIN, BB_SUID_DROP)) ++ ++//kbuild:lib-$(CONFIG_LOCK) += lock.o ++ ++//usage:#define lock_trivial_usage NOUSAGE_STR ++//usage:#define lock_full_usage "" ++ +#include +#include +#include @@ -50,9 +29,6 @@ +#include +#include "busybox.h" + -+//usage:#define lock_trivial_usage NOUSAGE_STR -+//usage:#define lock_full_usage "" -+ +static int unlock = 0; +static int shared = 0; +static int waitonly = 0; diff --git a/package/utils/busybox/patches/230-add_nslookup_lede.patch b/package/utils/busybox/patches/230-add_nslookup_lede.patch index 976960cf1..14c0e87b3 100644 --- a/package/utils/busybox/patches/230-add_nslookup_lede.patch +++ b/package/utils/busybox/patches/230-add_nslookup_lede.patch @@ -17,8 +17,6 @@ Signed-off-by: Jo-Philipp Wich 2 files changed, 921 insertions(+) create mode 100644 networking/nslookup_lede.c -diff --git a/Makefile.flags b/Makefile.flags -index 65021de25..096ab7756 100644 --- a/Makefile.flags +++ b/Makefile.flags @@ -134,6 +134,12 @@ else @@ -34,9 +32,6 @@ index 65021de25..096ab7756 100644 # libpam may use libpthread, libdl and/or libaudit. # On some platforms that requires an explicit -lpthread, -ldl, -laudit. # However, on *other platforms* it fails when some of those flags -diff --git a/networking/nslookup_lede.c b/networking/nslookup_lede.c -new file mode 100644 -index 000000000..c6c90ddf3 --- /dev/null +++ b/networking/nslookup_lede.c @@ -0,0 +1,915 @@ @@ -58,23 +53,23 @@ index 000000000..c6c90ddf3 + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + -+//config:config NSLOOKUP_LEDE -+//config: bool "nslookup_lede" ++//config:config NSLOOKUP_OPENWRT ++//config: bool "nslookup_openwrt" +//config: depends on !NSLOOKUP +//config: default y +//config: help +//config: nslookup is a tool to query Internet name servers (LEDE flavor). +//config: -+//config:config FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++//config:config FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +//config: bool "Enable long options" +//config: default y -+//config: depends on NSLOOKUP_LEDE && LONG_OPTS ++//config: depends on NSLOOKUP_OPENWRT && LONG_OPTS +//config: help +//config: Support long options for the nslookup applet. + -+//applet:IF_NSLOOKUP_LEDE(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) ++//applet:IF_NSLOOKUP_OPENWRT(APPLET(nslookup, BB_DIR_USR_BIN, BB_SUID_DROP)) + -+//kbuild:lib-$(CONFIG_NSLOOKUP_LEDE) += nslookup_lede.o ++//kbuild:lib-$(CONFIG_NSLOOKUP_OPENWRT) += nslookup_lede.o + +//usage:#define nslookup_lede_trivial_usage +//usage: "[HOST] [SERVER]" @@ -758,7 +753,7 @@ index 000000000..c6c90ddf3 +} + + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS +static const char nslookup_longopts[] ALIGN1 = + "type\0" Required_argument "q" + "querytype\0" Required_argument "q" @@ -783,7 +778,7 @@ index 000000000..c6c90ddf3 + unsigned int types = 0; + HEADER *header; + -+#if ENABLE_FEATURE_NSLOOKUP_LEDE_LONG_OPTIONS ++#if ENABLE_FEATURE_NSLOOKUP_OPENWRT_LONG_OPTIONS + applet_long_options = nslookup_longopts; +#endif + @@ -955,6 +950,3 @@ index 000000000..c6c90ddf3 + + return rc; +} --- -2.11.0 - diff --git a/package/utils/busybox/patches/240-telnetd_intr.patch b/package/utils/busybox/patches/240-telnetd_intr.patch index d52ea3fcc..fec2a3a5d 100644 --- a/package/utils/busybox/patches/240-telnetd_intr.patch +++ b/package/utils/busybox/patches/240-telnetd_intr.patch @@ -1,6 +1,6 @@ --- a/networking/telnetd.c +++ b/networking/telnetd.c -@@ -333,6 +333,7 @@ make_new_session( +@@ -497,6 +497,7 @@ make_new_session( /* Restore default signal handling ASAP */ bb_signals((1 << SIGCHLD) + (1 << SIGPIPE), SIG_DFL); diff --git a/package/utils/busybox/patches/250-date-k-flag.patch b/package/utils/busybox/patches/250-date-k-flag.patch index b2681a17f..476440f62 100644 --- a/package/utils/busybox/patches/250-date-k-flag.patch +++ b/package/utils/busybox/patches/250-date-k-flag.patch @@ -1,6 +1,6 @@ --- a/coreutils/date.c +++ b/coreutils/date.c -@@ -123,6 +123,7 @@ +@@ -122,6 +122,7 @@ //usage: IF_FEATURE_DATE_ISOFMT( //usage: "\n -D FMT Use FMT for -d TIME conversion" //usage: ) @@ -8,7 +8,7 @@ //usage: "\n" //usage: "\nRecognized TIME formats:" //usage: "\n hh:mm[:ss]" -@@ -139,9 +140,8 @@ +@@ -138,9 +139,8 @@ #include "libbb.h" #include "common_bufsiz.h" @@ -20,7 +20,7 @@ enum { OPT_RFC2822 = (1 << 0), /* R */ -@@ -149,8 +149,9 @@ enum { +@@ -148,8 +148,9 @@ enum { OPT_UTC = (1 << 2), /* u */ OPT_DATE = (1 << 3), /* d */ OPT_REFERENCE = (1 << 4), /* r */ @@ -32,7 +32,7 @@ }; static void maybe_set_utc(int opt) -@@ -168,12 +169,15 @@ static const char date_longopts[] ALIGN1 +@@ -167,12 +168,15 @@ static const char date_longopts[] ALIGN1 /* "universal\0" No_argument "u" */ "date\0" Required_argument "d" "reference\0" Required_argument "r" @@ -48,7 +48,7 @@ struct timespec ts; struct tm tm_time; char buf_fmt_dt2str[64]; -@@ -188,7 +192,7 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -187,7 +191,7 @@ int date_main(int argc UNUSED_PARAM, cha opt_complementary = "d--s:s--d" IF_FEATURE_DATE_ISOFMT(":R--I:I--R"); IF_LONG_OPTS(applet_long_options = date_longopts;) @@ -57,7 +57,7 @@ IF_FEATURE_DATE_ISOFMT("I::D:"), &date_str, &date_str, &filename IF_FEATURE_DATE_ISOFMT(, &isofmt_arg, &fmt_str2dt)); -@@ -245,6 +249,31 @@ int date_main(int argc UNUSED_PARAM, cha +@@ -244,6 +248,31 @@ int date_main(int argc UNUSED_PARAM, cha if (*argv) bb_show_usage(); diff --git a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch index 360324bf7..ca76c44cc 100644 --- a/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch +++ b/package/utils/busybox/patches/301-ip-link-fix-netlink-msg-size.patch @@ -1,6 +1,6 @@ --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c -@@ -470,7 +470,7 @@ static int do_add_or_delete(char **argv, +@@ -598,7 +598,7 @@ static int do_add_or_delete(char **argv, } xrtnl_open(&rth); ll_init_map(&rth); diff --git a/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch b/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch deleted file mode 100644 index 7b4797505..000000000 --- a/package/utils/busybox/patches/302-ip-rule-add-suppress-prefixlength.patch +++ /dev/null @@ -1,145 +0,0 @@ -From dbac30c3784c267bbe44a2a3ebed4e827c8fe82a Mon Sep 17 00:00:00 2001 -From: Stefan Tomanek -Date: Tue, 13 Jun 2017 19:06:09 +0200 -Subject: [PATCH] ip rule: add suppress_{prefixlength,ifgroup} options - -(cherry-picked from 192dce4b84fb32346ebc5194de7daa5da3b8d1b4) - -function old new delta -iprule_modify 816 887 +71 -print_rule 610 680 +70 ------------------------------------------------------------------------------- -(add/remove: 0/0 grow/shrink: 2/0 up/down: 141/0) Total: 141 bytes - -Signed-off-by: Stefan Tomanek -Signed-off-by: Denys Vlasenko ---- - networking/libiproute/iprule.c | 73 ++++++++++++++++++++++++++---------------- - 1 file changed, 46 insertions(+), 27 deletions(-) - ---- a/networking/libiproute/iprule.c -+++ b/networking/libiproute/iprule.c -@@ -17,25 +17,32 @@ - #include - #include - -+/* from : */ -+#define FRA_SUPPRESS_IFGROUP 13 -+#define FRA_SUPPRESS_PREFIXLEN 14 -+ - #include "ip_common.h" /* #include "libbb.h" is inside */ - #include "rt_names.h" - #include "utils.h" - --/* --static void usage(void) __attribute__((noreturn)); -- --static void usage(void) --{ -- fprintf(stderr, "Usage: ip rule [ list | add | del ] SELECTOR ACTION\n"); -- fprintf(stderr, "SELECTOR := [ from PREFIX ] [ to PREFIX ] [ tos TOS ] [ fwmark FWMARK ]\n"); -- fprintf(stderr, " [ dev STRING ] [ pref NUMBER ]\n"); -- fprintf(stderr, "ACTION := [ table TABLE_ID ] [ nat ADDRESS ]\n"); -- fprintf(stderr, " [ prohibit | reject | unreachable ]\n"); -- fprintf(stderr, " [ realms [SRCREALM/]DSTREALM ]\n"); -- fprintf(stderr, "TABLE_ID := [ local | main | default | NUMBER ]\n"); -- exit(-1); --} --*/ -+/* If you add stuff here, update iprule_full_usage */ -+static const char keywords[] ALIGN1 = -+ "from\0""to\0""preference\0""order\0""priority\0" -+ "tos\0""fwmark\0""realms\0""table\0""lookup\0" -+ "suppress_prefixlength\0""suppress_ifgroup\0" -+ "dev\0""iif\0""nat\0""map-to\0""type\0""help\0" -+ ; -+#define keyword_preference (keywords + sizeof("from") + sizeof("to")) -+#define keyword_fwmark (keyword_preference + sizeof("preference") + sizeof("order") + sizeof("priority") + sizeof("tos")) -+#define keyword_realms (keyword_fwmark + sizeof("fwmark")) -+#define keyword_suppress_prefixlength (keyword_realms + sizeof("realms") + sizeof("table") + sizeof("lookup")) -+#define keyword_suppress_ifgroup (keyword_suppress_prefixlength + sizeof("suppress_prefixlength")) -+enum { -+ ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, -+ ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, -+ ARG_suppress_prefixlength, ARG_suppress_ifgroup, -+ ARG_dev, ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help, -+}; - - static int FAST_FUNC print_rule(const struct sockaddr_nl *who UNUSED_PARAM, - struct nlmsghdr *n, void *arg UNUSED_PARAM) -@@ -119,6 +126,17 @@ static int FAST_FUNC print_rule(const st - else if (r->rtm_table) - printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); - -+ if (tb[FRA_SUPPRESS_PREFIXLEN]) { -+ int pl = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_PREFIXLEN]); -+ if (pl != -1) -+ printf("%s %d ", keyword_suppress_prefixlength, pl); -+ } -+ if (tb[FRA_SUPPRESS_IFGROUP]) { -+ int grp = *(uint32_t*)RTA_DATA(tb[FRA_SUPPRESS_IFGROUP]); -+ if (grp != -1) -+ printf("%s %d ", keyword_suppress_ifgroup, grp); -+ } -+ - if (tb[RTA_FLOW]) { - uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]); - uint32_t from = to>>16; -@@ -174,15 +192,6 @@ static int iprule_list(char **argv) - /* Return value becomes exitcode. It's okay to not return at all */ - static int iprule_modify(int cmd, char **argv) - { -- static const char keywords[] ALIGN1 = -- "from\0""to\0""preference\0""order\0""priority\0" -- "tos\0""fwmark\0""realms\0""table\0""lookup\0""dev\0" -- "iif\0""nat\0""map-to\0""type\0""help\0"; -- enum { -- ARG_from = 1, ARG_to, ARG_preference, ARG_order, ARG_priority, -- ARG_tos, ARG_fwmark, ARG_realms, ARG_table, ARG_lookup, ARG_dev, -- ARG_iif, ARG_nat, ARG_map_to, ARG_type, ARG_help -- }; - bool table_ok = 0; - struct rtnl_handle rth; - struct { -@@ -232,7 +241,7 @@ static int iprule_modify(int cmd, char * - ) { - uint32_t pref; - NEXT_ARG(); -- pref = get_u32(*argv, "preference"); -+ pref = get_u32(*argv, keyword_preference); - addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref); - } else if (key == ARG_tos) { - uint32_t tos; -@@ -243,13 +252,13 @@ static int iprule_modify(int cmd, char * - } else if (key == ARG_fwmark) { - uint32_t fwmark; - NEXT_ARG(); -- fwmark = get_u32(*argv, "fwmark"); -+ fwmark = get_u32(*argv, keyword_fwmark); - addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark); - } else if (key == ARG_realms) { - uint32_t realm; - NEXT_ARG(); - if (get_rt_realms(&realm, *argv)) -- invarg_1_to_2(*argv, "realms"); -+ invarg_1_to_2(*argv, keyword_realms); - addattr32(&req.n, sizeof(req), RTA_FLOW, realm); - } else if (key == ARG_table || - key == ARG_lookup -@@ -265,6 +274,16 @@ static int iprule_modify(int cmd, char * - addattr32(&req.n, sizeof(req), RTA_TABLE, tid); - } - table_ok = 1; -+ } else if (key == ARG_suppress_prefixlength) { -+ int prefix_length; -+ NEXT_ARG(); -+ prefix_length = get_u32(*argv, keyword_suppress_prefixlength); -+ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_PREFIXLEN, prefix_length); -+ } else if (key == ARG_suppress_ifgroup) { -+ int grp; -+ NEXT_ARG(); -+ grp = get_u32(*argv, keyword_suppress_ifgroup); -+ addattr32(&req.n, sizeof(req), FRA_SUPPRESS_IFGROUP, grp); - } else if (key == ARG_dev || - key == ARG_iif - ) { diff --git a/package/utils/busybox/patches/302-netlink-alignment.patch b/package/utils/busybox/patches/302-netlink-alignment.patch deleted file mode 100644 index 4cd25b187..000000000 --- a/package/utils/busybox/patches/302-netlink-alignment.patch +++ /dev/null @@ -1,100 +0,0 @@ -From a843f09a4d4428cf11ca02307e60058251b05743 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Fri, 16 Sep 2016 21:52:03 +0200 -Subject: [PATCH] libnetlink: fix alignment of netlink messages - -An padding to align a message should not only be added between -different attributes of a netlink message, but also at the end of the -message to pad it to the correct size. - -Without this patch the following command does not work and returns an -error code: -ip link add type nlmon - -Without this ip from busybox sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=45, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1474057401, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon"}, iov_len=45}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 45 -return value: 2 - -The normal ip utile from iproute2 sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716938, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 -return value: 0 - -With this patch ip from busybox sends this: -sendmsg(3, {msg_name={sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}, msg_namelen=12, msg_iov=[{iov_base={{len=48, type=0x10 /* NLMSG_??? */, flags=NLM_F_REQUEST|NLM_F_ACK|0x600, seq=1473716908, pid=0}, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\20\0\22\0\t\0\1nlmon\0\0\0"}, iov_len=48}], msg_iovlen=1, msg_controllen=0, msg_flags=0}, 0) = 48 -return value: 0 - -Signed-off-by: Hauke Mehrtens ---- - networking/libiproute/libnetlink.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/networking/libiproute/libnetlink.c -+++ b/networking/libiproute/libnetlink.c -@@ -338,14 +338,14 @@ int FAST_FUNC addattr32(struct nlmsghdr - int len = RTA_LENGTH(4); - struct rtattr *rta; - -- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { -+ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { - return -1; - } - rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); - rta->rta_type = type; - rta->rta_len = len; - move_to_unaligned32(RTA_DATA(rta), data); -- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; -+ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); - return 0; - } - -@@ -354,14 +354,14 @@ int FAST_FUNC addattr_l(struct nlmsghdr - int len = RTA_LENGTH(alen); - struct rtattr *rta; - -- if ((int)(NLMSG_ALIGN(n->nlmsg_len) + len) > maxlen) { -+ if ((int)(NLMSG_ALIGN(n->nlmsg_len + len)) > maxlen) { - return -1; - } - rta = (struct rtattr*)(((char*)n) + NLMSG_ALIGN(n->nlmsg_len)); - rta->rta_type = type; - rta->rta_len = len; - memcpy(RTA_DATA(rta), data, alen); -- n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + len; -+ n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len + len); - return 0; - } - -@@ -370,14 +370,14 @@ int FAST_FUNC rta_addattr32(struct rtatt - int len = RTA_LENGTH(4); - struct rtattr *subrta; - -- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { -+ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { - return -1; - } - subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); - subrta->rta_type = type; - subrta->rta_len = len; - move_to_unaligned32(RTA_DATA(subrta), data); -- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; -+ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); - return 0; - } - -@@ -386,14 +386,14 @@ int FAST_FUNC rta_addattr_l(struct rtatt - struct rtattr *subrta; - int len = RTA_LENGTH(alen); - -- if (RTA_ALIGN(rta->rta_len) + len > maxlen) { -+ if (RTA_ALIGN(rta->rta_len + len) > maxlen) { - return -1; - } - subrta = (struct rtattr*)(((char*)rta) + RTA_ALIGN(rta->rta_len)); - subrta->rta_type = type; - subrta->rta_len = len; - memcpy(RTA_DATA(subrta), data, alen); -- rta->rta_len = NLMSG_ALIGN(rta->rta_len) + len; -+ rta->rta_len = NLMSG_ALIGN(rta->rta_len + len); - return 0; - } - diff --git a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch b/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch deleted file mode 100644 index d7a38f632..000000000 --- a/package/utils/busybox/patches/303-ip-route-fix-high-table-ids.patch +++ /dev/null @@ -1,486 +0,0 @@ -From 485fcc89b99eae9cc7501eaff344b104e52ab7bf Mon Sep 17 00:00:00 2001 -From: Jo-Philipp Wich -Date: Mon, 26 Sep 2016 17:48:22 +0200 -Subject: [PATCH] iproute: properly support high routing table IDs - -The Linux kernel uses two distinct fields to denote the routing table ID in -use by network routes; the 8 bit `rtm_table` member of `struct rtmsg` and the -32 bit `RTA_TABLE` netlink attribute. - -If a routing table ID is larger than 255, the `RT_TABLE` attribute must be used -and the `rtm_table` field has to be set to the special `RT_TABLE_UNSPEC` value. - -This commit ... - - switches the *_n2a() and *_a2n() functions of rt_names.c to use dynamically - sized, name-sorted arrays instead of fixed arrays limited to 1024 slots in - order to support IDs up to 65535 - - adds proper handling of high table IDs to iprule.c and iproute.c when - adding, removing and dumping ip rules and network routes - -After this change, the Busybox ip applet fully supports IP rules with high ID -numbers, using the same logic as the full iproute2. - -Signed-off-by: Jo-Philipp Wich ---- - networking/libiproute/iproute.c | 75 ++++++++------ - networking/libiproute/iprule.c | 4 +- - networking/libiproute/rt_names.c | 204 +++++++++++++++++++++++---------------- - 3 files changed, 169 insertions(+), 114 deletions(-) - ---- a/networking/libiproute/iproute.c -+++ b/networking/libiproute/iproute.c -@@ -66,6 +66,7 @@ static int FAST_FUNC print_route(const s - inet_prefix dst; - inet_prefix src; - int host_len = -1; -+ uint32_t rtable; - - if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { - fprintf(stderr, "Not a route: %08x %08x %08x\n", -@@ -83,34 +84,6 @@ static int FAST_FUNC print_route(const s - else if (r->rtm_family == AF_INET) - host_len = 32; - -- if (r->rtm_family == AF_INET6) { -- if (G_filter.tb) { -- if (G_filter.tb < 0) { -- if (!(r->rtm_flags & RTM_F_CLONED)) { -- return 0; -- } -- } else { -- if (r->rtm_flags & RTM_F_CLONED) { -- return 0; -- } -- if (G_filter.tb == RT_TABLE_LOCAL) { -- if (r->rtm_type != RTN_LOCAL) { -- return 0; -- } -- } else if (G_filter.tb == RT_TABLE_MAIN) { -- if (r->rtm_type == RTN_LOCAL) { -- return 0; -- } -- } else { -- return 0; -- } -- } -- } -- } else { -- if (G_filter.tb > 0 && G_filter.tb != r->rtm_table) { -- return 0; -- } -- } - if (G_filter.rdst.family - && (r->rtm_family != G_filter.rdst.family || G_filter.rdst.bitlen > r->rtm_dst_len) - ) { -@@ -141,6 +114,37 @@ static int FAST_FUNC print_route(const s - memset(&dst, 0, sizeof(dst)); - parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len); - -+ rtable = tb[RTA_TABLE] ? *(uint32_t*)RTA_DATA(tb[RTA_TABLE]) : r->rtm_table; -+ -+ if (G_filter.tb) { -+ if (r->rtm_family == AF_INET6) { -+ if (G_filter.tb < 0) { -+ if (!(r->rtm_flags & RTM_F_CLONED)) { -+ return 0; -+ } -+ } else { -+ if (r->rtm_flags & RTM_F_CLONED) { -+ return 0; -+ } -+ if (G_filter.tb == RT_TABLE_LOCAL) { -+ if (r->rtm_type != RTN_LOCAL) { -+ return 0; -+ } -+ } else if (G_filter.tb == RT_TABLE_MAIN) { -+ if (r->rtm_type == RTN_LOCAL) { -+ return 0; -+ } -+ } else if (G_filter.tb != rtable) { -+ return 0; -+ } -+ } -+ } else { -+ if (G_filter.tb != rtable) { -+ return 0; -+ } -+ } -+ } -+ - if (tb[RTA_SRC]) { - src.bitlen = r->rtm_src_len; - src.bytelen = (r->rtm_family == AF_INET6 ? 16 : 4); -@@ -349,7 +353,9 @@ IF_FEATURE_IP_RULE(ARG_table,) - smalluint ok = 0; - smalluint scope_ok = 0; - int arg; -- -+#if ENABLE_FEATURE_IP_RULE -+ uint32_t rtable = 0; -+#endif - memset(&req, 0, sizeof(req)); - - req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg)); -@@ -419,7 +425,7 @@ IF_FEATURE_IP_RULE(ARG_table,) - NEXT_ARG(); - if (rtnl_rttable_a2n(&tid, *argv)) - invarg_1_to_2(*argv, "table"); -- req.r.rtm_table = tid; -+ rtable = tid; - #endif - } else if (arg == ARG_dev || arg == ARG_oif) { - NEXT_ARG(); -@@ -475,6 +481,15 @@ IF_FEATURE_IP_RULE(ARG_table,) - } - } - -+#if ENABLE_FEATURE_IP_RULE -+ if (rtable >= 256) { -+ addattr32(&req.n, sizeof(req), RTA_TABLE, rtable); -+ req.r.rtm_table = RT_TABLE_UNSPEC; -+ } else if (rtable > 0) { -+ req.r.rtm_table = rtable; -+ } -+#endif -+ - if (mxrta->rta_len > RTA_LENGTH(0)) { - if (mxlock) { - rta_addattr32(mxrta, sizeof(mxbuf), RTAX_LOCK, mxlock); ---- a/networking/libiproute/iprule.c -+++ b/networking/libiproute/iprule.c -@@ -114,7 +114,9 @@ static int FAST_FUNC print_rule(const st - printf("iif %s ", (char*)RTA_DATA(tb[RTA_IIF])); - } - -- if (r->rtm_table) -+ if (tb[RTA_TABLE]) -+ printf("lookup %s ", rtnl_rttable_n2a(*(uint32_t*)RTA_DATA(tb[RTA_TABLE]))); -+ else if (r->rtm_table) - printf("lookup %s ", rtnl_rttable_n2a(r->rtm_table)); - - if (tb[RTA_FLOW]) { ---- a/networking/libiproute/rt_names.c -+++ b/networking/libiproute/rt_names.c -@@ -11,21 +11,26 @@ - #include "rt_names.h" - - #define CONFDIR CONFIG_FEATURE_IP_ROUTE_DIR -+#define RT_TABLE_MAX 65535 -+ -+struct rtnl_tab_entry { -+ unsigned int id; -+ const char *name; -+}; - - typedef struct rtnl_tab_t { -- const char *cached_str; -- unsigned cached_result; -- /* upstream version switched to a hash table and removed -- * id < 256 limit. For now bbox bumps this array size from 256 -- * to 1024. If you plan to change this to a hash table, -- * consider merging several hash tables we have (for example, -- * awk has resizable one! -- */ --#define RT_TABLE_MAX 1023 -- const char *tab[RT_TABLE_MAX+1]; -+ struct rtnl_tab_entry *tab; -+ size_t length; - } rtnl_tab_t; - --static void rtnl_tab_initialize(const char *file, const char **tab) -+static int tabcmp(const void *p1, const void *p2) -+{ -+ const struct rtnl_tab_entry *e1 = p1; -+ const struct rtnl_tab_entry *e2 = p2; -+ return strcmp(e1->name, e2->name); -+} -+ -+static void rtnl_tab_initialize(const char *file, rtnl_tab_t *tab) - { - char *token[2]; - char fullname[sizeof(CONFDIR"/rt_dsfield") + 8]; -@@ -40,34 +45,42 @@ static void rtnl_tab_initialize(const ch - file, parser->lineno); - break; - } -- tab[id] = xstrdup(token[1]); -+ -+ tab->tab = xrealloc(tab->tab, (tab->length + 1) * sizeof(*tab->tab)); -+ tab->tab[tab->length].id = id; -+ tab->tab[tab->length].name = xstrdup(token[1]); -+ tab->length++; - } - config_close(parser); -+ qsort(tab->tab, tab->length, sizeof(*tab->tab), tabcmp); - } - - static int rtnl_a2n(rtnl_tab_t *tab, uint32_t *id, const char *arg, int base) - { -- unsigned i; -- -- if (tab->cached_str && strcmp(tab->cached_str, arg) == 0) { -- *id = tab->cached_result; -- return 0; -- } -+ int delta; -+ ssize_t l = 0; -+ ssize_t r = tab->length - 1; -+ ssize_t m; -+ uint32_t i; -+ -+ while (l <= r) { -+ m = l + (r - l) / 2; -+ delta = strcmp(tab->tab[m].name, arg); - -- for (i = 0; i <= RT_TABLE_MAX; i++) { -- if (tab->tab[i] -- && strcmp(tab->tab[i], arg) == 0 -- ) { -- tab->cached_str = tab->tab[i]; -- tab->cached_result = i; -- *id = i; -+ if (delta == 0) { -+ *id = tab->tab[m].id; - return 0; -+ } else if (delta < 0) { -+ l = m + 1; -+ } else { -+ r = m - 1; - } - } - - i = bb_strtou(arg, NULL, base); - if (i > RT_TABLE_MAX) - return -1; -+ - *id = i; - return 0; - } -@@ -77,40 +90,39 @@ static rtnl_tab_t *rtnl_rtprot_tab; - - static void rtnl_rtprot_initialize(void) - { -- static const char *const init_tab[] = { -- "none", -- "redirect", -- "kernel", -- "boot", -- "static", -- NULL, -- NULL, -- NULL, -- "gated", -- "ra", -- "mrt", -- "zebra", -- "bird", -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "none" }, -+ { 1, "redirect" }, -+ { 2, "kernel" }, -+ { 3, "boot" }, -+ { 4, "static" }, -+ { 8, "gated" }, -+ { 9, "ra" }, -+ { 10, "mrt" }, -+ { 11, "zebra" }, -+ { 12, "bird" } - }; - - if (rtnl_rtprot_tab) - return; - rtnl_rtprot_tab = xzalloc(sizeof(*rtnl_rtprot_tab)); -+ rtnl_rtprot_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtprot_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); - memcpy(rtnl_rtprot_tab->tab, init_tab, sizeof(init_tab)); -- rtnl_tab_initialize("protos", rtnl_rtprot_tab->tab); -+ rtnl_tab_initialize("protos", rtnl_rtprot_tab); - } - - #if 0 /* UNUSED */ - const char* FAST_FUNC rtnl_rtprot_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtprot_initialize(); - -- if (rtnl_rtprot_tab->tab[id]) -- return rtnl_rtprot_tab->tab[id]; -+ for (i = 0; i < rtnl_rtprot_tab->length; i++) -+ if (rtnl_rtprot_tab->tab[i].id == id) -+ return rtnl_rtprot_tab->tab[i].name; -+ - return itoa(id); - } - #endif -@@ -126,27 +138,33 @@ static rtnl_tab_t *rtnl_rtscope_tab; - - static void rtnl_rtscope_initialize(void) - { -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "global" }, -+ { 200, "site" }, -+ { 253, "link" }, -+ { 254, "host" }, -+ { 255, "nowhere" } -+ }; -+ - if (rtnl_rtscope_tab) - return; - rtnl_rtscope_tab = xzalloc(sizeof(*rtnl_rtscope_tab)); -- rtnl_rtscope_tab->tab[0] = "global"; -- rtnl_rtscope_tab->tab[255] = "nowhere"; -- rtnl_rtscope_tab->tab[254] = "host"; -- rtnl_rtscope_tab->tab[253] = "link"; -- rtnl_rtscope_tab->tab[200] = "site"; -- rtnl_tab_initialize("scopes", rtnl_rtscope_tab->tab); -+ rtnl_rtscope_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtscope_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtscope_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("scopes", rtnl_rtscope_tab); - } - - const char* FAST_FUNC rtnl_rtscope_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtscope_initialize(); - -- if (rtnl_rtscope_tab->tab[id]) -- return rtnl_rtscope_tab->tab[id]; -+ for (i = 0; i < rtnl_rtscope_tab->length; i++) -+ if (rtnl_rtscope_tab->tab[i].id == id) -+ return rtnl_rtscope_tab->tab[i].name; -+ - return itoa(id); - } - -@@ -161,10 +179,17 @@ static rtnl_tab_t *rtnl_rtrealm_tab; - - static void rtnl_rtrealm_initialize(void) - { -- if (rtnl_rtrealm_tab) return; -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "unknown" } -+ }; -+ -+ if (rtnl_rtrealm_tab) -+ return; - rtnl_rtrealm_tab = xzalloc(sizeof(*rtnl_rtrealm_tab)); -- rtnl_rtrealm_tab->tab[0] = "unknown"; -- rtnl_tab_initialize("realms", rtnl_rtrealm_tab->tab); -+ rtnl_rtrealm_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtrealm_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtrealm_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("realms", rtnl_rtrealm_tab); - } - - int FAST_FUNC rtnl_rtrealm_a2n(uint32_t *id, char *arg) -@@ -176,14 +201,14 @@ int FAST_FUNC rtnl_rtrealm_a2n(uint32_t - #if ENABLE_FEATURE_IP_RULE - const char* FAST_FUNC rtnl_rtrealm_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtrealm_initialize(); - -- if (rtnl_rtrealm_tab->tab[id]) -- return rtnl_rtrealm_tab->tab[id]; -+ for (i = 0; i < rtnl_rtrealm_tab->length; i++) -+ if (rtnl_rtrealm_tab->tab[i].id == id) -+ return rtnl_rtrealm_tab->tab[i].name; -+ - return itoa(id); - } - #endif -@@ -193,22 +218,29 @@ static rtnl_tab_t *rtnl_rtdsfield_tab; - - static void rtnl_rtdsfield_initialize(void) - { -- if (rtnl_rtdsfield_tab) return; -+ static const struct rtnl_tab_entry init_tab[] = { -+ { 0, "0" } -+ }; -+ -+ if (rtnl_rtdsfield_tab) -+ return; - rtnl_rtdsfield_tab = xzalloc(sizeof(*rtnl_rtdsfield_tab)); -- rtnl_rtdsfield_tab->tab[0] = "0"; -- rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab->tab); -+ rtnl_rtdsfield_tab->tab = xzalloc(sizeof(init_tab)); -+ rtnl_rtdsfield_tab->length = sizeof(init_tab) / sizeof(init_tab[0]); -+ memcpy(rtnl_rtdsfield_tab->tab, init_tab, sizeof(init_tab)); -+ rtnl_tab_initialize("dsfield", rtnl_rtdsfield_tab); - } - - const char* FAST_FUNC rtnl_dsfield_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rtdsfield_initialize(); - -- if (rtnl_rtdsfield_tab->tab[id]) -- return rtnl_rtdsfield_tab->tab[id]; -+ for (i = 0; i < rtnl_rtdsfield_tab->length; i++) -+ if (rtnl_rtdsfield_tab->tab[i].id == id) -+ return rtnl_rtdsfield_tab->tab[i].name; -+ - return itoa(id); - } - -@@ -224,27 +256,33 @@ static rtnl_tab_t *rtnl_rttable_tab; - - static void rtnl_rttable_initialize(void) - { -+ static const struct rtnl_tab_entry tab_init[] = { -+ { 0, "unspec" }, -+ { 253, "default" }, -+ { 254, "main" }, -+ { 255, "local" } -+ }; -+ - if (rtnl_rttable_tab) - return; - - rtnl_rttable_tab = xzalloc(sizeof(*rtnl_rttable_tab)); -- rtnl_rttable_tab->tab[0] = "unspec"; -- rtnl_rttable_tab->tab[255] = "local"; -- rtnl_rttable_tab->tab[254] = "main"; -- rtnl_rttable_tab->tab[253] = "default"; -- rtnl_tab_initialize("tables", rtnl_rttable_tab->tab); -+ rtnl_rttable_tab->tab = xzalloc(sizeof(tab_init)); -+ rtnl_rttable_tab->length = sizeof(tab_init) / sizeof(tab_init[0]); -+ memcpy(rtnl_rttable_tab->tab, tab_init, sizeof(tab_init)); -+ rtnl_tab_initialize("tables", rtnl_rttable_tab); - } - - const char* FAST_FUNC rtnl_rttable_n2a(int id) - { -- if (id < 0 || id > RT_TABLE_MAX) { -- return itoa(id); -- } -+ size_t i; - - rtnl_rttable_initialize(); - -- if (rtnl_rttable_tab->tab[id]) -- return rtnl_rttable_tab->tab[id]; -+ for (i = 0; i < rtnl_rttable_tab->length; i++) -+ if (rtnl_rttable_tab->tab[i].id == id) -+ return rtnl_rttable_tab->tab[i].name; -+ - return itoa(id); - } - diff --git a/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch b/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch deleted file mode 100644 index e83999d30..000000000 --- a/package/utils/busybox/patches/401-vi-don-t-touch-file-with-x-when-modified_count-0.patch +++ /dev/null @@ -1,100 +0,0 @@ -From e88608eae24ae5934034e1ecb6c494fefbf1b9ae Mon Sep 17 00:00:00 2001 -From: Denys Vlasenko -Date: Mon, 13 Mar 2017 20:50:42 +0100 -Subject: [PATCH 1/2] vi: don't touch file with :x when modified_count == 0 - -Along with it, there are other changes - - - Check for uppercase X is removed as the expression will be always false and - :X itself is another totally different command in standard vim - - The status line will show number of written lines instead of lines requested - by the colon command. This is also how the standard vim is doing, though - the difference is that '!' has to be explicitly specified in vim to allow - partial writes - -Signed-off-by: Yousong Zhou -Signed-off-by: Denys Vlasenko ---- - editors/vi.c | 43 ++++++++++++++++++++++++++----------------- - 1 file changed, 26 insertions(+), 17 deletions(-) - ---- a/editors/vi.c -+++ b/editors/vi.c -@@ -1038,7 +1038,9 @@ static void colon(char *buf) - || strncmp(p, "wn", cnt) == 0 - || (p[0] == 'x' && !p[1]) - ) { -- cnt = file_write(current_filename, text, end - 1); -+ if (modified_count != 0 || p[0] != 'x') { -+ cnt = file_write(current_filename, text, end - 1); -+ } - if (cnt < 0) { - if (cnt == -1) - status_line_bold("Write error: %s", strerror(errno)); -@@ -1049,8 +1051,9 @@ static void colon(char *buf) - current_filename, - count_lines(text, end - 1), cnt - ); -- if (p[0] == 'x' || p[1] == 'q' || p[1] == 'n' -- || p[0] == 'X' || p[1] == 'Q' || p[1] == 'N' -+ if (p[0] == 'x' -+ || p[1] == 'q' || p[1] == 'n' -+ || p[1] == 'Q' || p[1] == 'N' - ) { - editing = 0; - } -@@ -1480,16 +1483,19 @@ static void colon(char *buf) - goto ret; - } - #endif -- // how many lines in text[]? -- li = count_lines(q, r); -- size = r - q + 1; - //if (useforce) { - // if "fn" is not write-able, chmod u+w - // sprintf(syscmd, "chmod u+w %s", fn); - // system(syscmd); - // forced = TRUE; - //} -- l = file_write(fn, q, r); -+ if (modified_count != 0 || cmd[0] != 'x') { -+ size = r - q + 1; -+ l = file_write(fn, q, r); -+ } else { -+ size = 0; -+ l = 0; -+ } - //if (useforce && forced) { - // chmod u-w - // sprintf(syscmd, "chmod u-w %s", fn); -@@ -1500,17 +1506,20 @@ static void colon(char *buf) - if (l == -1) - status_line_bold_errno(fn); - } else { -+ // how many lines written -+ li = count_lines(q, q + l - 1); - status_line("'%s' %dL, %dC", fn, li, l); -- if (q == text && r == end - 1 && l == size) { -- modified_count = 0; -- last_modified_count = -1; -- } -- if ((cmd[0] == 'x' || cmd[1] == 'q' || cmd[1] == 'n' -- || cmd[0] == 'X' || cmd[1] == 'Q' || cmd[1] == 'N' -- ) -- && l == size -- ) { -- editing = 0; -+ if (l == size) { -+ if (q == text && q + l == end) { -+ modified_count = 0; -+ last_modified_count = -1; -+ } -+ if (cmd[0] == 'x' -+ || cmd[1] == 'q' || cmd[1] == 'n' -+ || cmd[1] == 'Q' || cmd[1] == 'N' -+ ) { -+ editing = 0; -+ } - } - } - #if ENABLE_FEATURE_VI_YANKMARK diff --git a/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch b/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch deleted file mode 100644 index b56cf735c..000000000 --- a/package/utils/busybox/patches/402-vi-avoid-touching-a-new-file-with-ZZ-when-no-editing.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 8f3bf4f0d3605b50a8e4c48c89aeabc455f04884 Mon Sep 17 00:00:00 2001 -From: Yousong Zhou -Date: Fri, 24 Mar 2017 21:13:10 +0100 -Subject: [PATCH 2/2] vi: avoid touching a new file with ZZ when no editing has - been done - -This is the behaviour observed with standard vim and busybox vi of at -least 1.22.1. It was changed with commit "32afd3a vi: some -simplifications" which happened before 1.23.0. - -Mistyping filename on command line happens fairly often and it's better -we restore the old behaviour to avoid a few unnecessary flash writes and -sometimes efforts of debugging bugs caused by those unneeded stray -files. - -Signed-off-by: Yousong Zhou -Signed-off-by: Denys Vlasenko ---- - editors/vi.c | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - ---- a/editors/vi.c -+++ b/editors/vi.c -@@ -719,14 +719,6 @@ static int init_text_buffer(char *fn) - { - int rc; - -- flush_undo_data(); -- modified_count = 0; -- last_modified_count = -1; --#if ENABLE_FEATURE_VI_YANKMARK -- /* init the marks */ -- memset(mark, 0, sizeof(mark)); --#endif -- - /* allocate/reallocate text buffer */ - free(text); - text_size = 10240; -@@ -741,6 +733,14 @@ static int init_text_buffer(char *fn) - // file doesnt exist. Start empty buf with dummy line - char_insert(text, '\n', NO_UNDO); - } -+ -+ flush_undo_data(); -+ modified_count = 0; -+ last_modified_count = -1; -+#if ENABLE_FEATURE_VI_YANKMARK -+ /* init the marks */ -+ memset(mark, 0, sizeof(mark)); -+#endif - return rc; - } - diff --git a/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch new file mode 100644 index 000000000..3741e25c3 --- /dev/null +++ b/package/utils/busybox/patches/500-move-traceroute-applets-to-bin.patch @@ -0,0 +1,13 @@ +--- a/networking/traceroute.c ++++ b/networking/traceroute.c +@@ -237,8 +237,8 @@ + //config: depends on TRACEROUTE || TRACEROUTE6 + + /* Needs socket(AF_INET, SOCK_RAW, IPPROTO_ICMP), therefore BB_SUID_MAYBE: */ +-//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_USR_BIN, BB_SUID_MAYBE)) +-//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_USR_BIN, BB_SUID_MAYBE)) ++//applet:IF_TRACEROUTE(APPLET(traceroute, BB_DIR_BIN, BB_SUID_MAYBE)) ++//applet:IF_TRACEROUTE6(APPLET(traceroute6, BB_DIR_BIN, BB_SUID_MAYBE)) + + //kbuild:lib-$(CONFIG_TRACEROUTE) += traceroute.o + //kbuild:lib-$(CONFIG_TRACEROUTE6) += traceroute.o diff --git a/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch b/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch new file mode 100644 index 000000000..b19d1c9a3 --- /dev/null +++ b/package/utils/busybox/patches/510-move-passwd-applet-to-bin.patch @@ -0,0 +1,11 @@ +--- a/loginutils/passwd.c ++++ b/loginutils/passwd.c +@@ -23,7 +23,7 @@ + //config: With this option passwd will refuse new passwords which are "weak". + + //applet:/* Needs to be run by root or be suid root - needs to change /etc/{passwd,shadow}: */ +-//applet:IF_PASSWD(APPLET(passwd, BB_DIR_USR_BIN, BB_SUID_REQUIRE)) ++//applet:IF_PASSWD(APPLET(passwd, BB_DIR_BIN, BB_SUID_REQUIRE)) + + //kbuild:lib-$(CONFIG_PASSWD) += passwd.o + diff --git a/package/utils/busybox/patches/600-cve-2017-16544.patch b/package/utils/busybox/patches/600-cve-2017-16544.patch new file mode 100644 index 000000000..3b142bdd6 --- /dev/null +++ b/package/utils/busybox/patches/600-cve-2017-16544.patch @@ -0,0 +1,35 @@ +From c3797d40a1c57352192c6106cc0f435e7d9c11e8 Mon Sep 17 00:00:00 2001 +From: Denys Vlasenko +Date: Tue, 7 Nov 2017 18:09:29 +0100 +Subject: lineedit: do not tab-complete any strings which have control + characters + +function old new delta +add_match 41 68 +27 + +Signed-off-by: Denys Vlasenko +--- + libbb/lineedit.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- a/libbb/lineedit.c ++++ b/libbb/lineedit.c +@@ -633,6 +633,18 @@ static void free_tab_completion_data(voi + + static void add_match(char *matched) + { ++ unsigned char *p = (unsigned char*)matched; ++ while (*p) { ++ /* ESC attack fix: drop any string with control chars */ ++ if (*p < ' ' ++ || (!ENABLE_UNICODE_SUPPORT && *p >= 0x7f) ++ || (ENABLE_UNICODE_SUPPORT && *p == 0x7f) ++ ) { ++ free(matched); ++ return; ++ } ++ p++; ++ } + matches = xrealloc_vector(matches, 4, num_matches); + matches[num_matches] = matched; + num_matches++; diff --git a/package/utils/bzip2/Makefile b/package/utils/bzip2/Makefile index 62c255a90..4c8b360de 100644 --- a/package/utils/bzip2/Makefile +++ b/package/utils/bzip2/Makefile @@ -18,6 +18,7 @@ PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=BZIP2 PKG_LICENSE_FILES:=LICENSE +PKG_CPE_ID:=cpe:/a:bzip:bzip2 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk diff --git a/package/utils/ct-bugcheck/src/bugcheck.sh b/package/utils/ct-bugcheck/src/bugcheck.sh index 85f70c5e7..389e10ccf 100755 --- a/package/utils/ct-bugcheck/src/bugcheck.sh +++ b/package/utils/ct-bugcheck/src/bugcheck.sh @@ -11,7 +11,7 @@ FOUND_BUG=0 bugcheck_generic() { - echo "LEDE crashlog report" > $CRASHDIR/info.txt + echo "OpenWrt crashlog report" > $CRASHDIR/info.txt date >> $CRASHDIR/info.txt echo >> $CRASHDIR/info.txt echo "uname" >> $CRASHDIR/info.txt diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile index 8c003639a..068ce3ede 100644 --- a/package/utils/e2fsprogs/Makefile +++ b/package/utils/e2fsprogs/Makefile @@ -8,12 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=e2fsprogs -PKG_VERSION:=1.43.3 -PKG_HASH:=ce8ef1bbb0d4730f170167284fda156ac9d6bf18db2750eb94af619a81b19927 -PKG_RELEASE:=2 +PKG_VERSION:=1.43.7 +PKG_HASH:=2a6367289047d68d9ba6a46cf89ab9a1efd0556cde02a51ebaf414ff51edded9 +PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=@SF/e2fsprogs +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/ +PKG_LICENSE:=GPL-2.0 +PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs PKG_BUILD_DEPENDS:=util-linux PKG_INSTALL:=1 @@ -44,7 +46,7 @@ define Package/libext2fs $(call Package/e2fsprogs/Default) SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libuuid + DEPENDS:=+libuuid +libblkid TITLE:=ext2/3/4 filesystem library endef @@ -108,18 +110,17 @@ endef TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -CONFIGURE_VARS += \ - ac_cv_lib_pthread_sem_init=no - CONFIGURE_ARGS += \ --disable-testio-debug \ --enable-elf-shlibs \ --disable-libuuid \ - --enable-libblkid \ + --disable-libblkid \ --disable-uuidd \ --disable-tls \ --disable-nls \ - --disable-rpath + --disable-rpath \ + --disable-threads \ + --disable-fuse2fs define Build/Prepare $(call Build/Prepare/Default) @@ -138,7 +139,6 @@ define Build/Compile LDFLAGS=-Wl,--gc-sections \ BUILDCC="$(HOSTCC)" \ DESTDIR="$(PKG_INSTALL_DIR)" \ - LIBBLKID="$(PKG_BUILD_DIR)/lib/libblkid.a -luuid" \ ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \ SYSLIBS="$(TARGET_LDFLAGS) -ldl -L$(PKG_BUILD_DIR)/lib/ -l:libcom_err.so.0.0" \ V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \ diff --git a/package/utils/f2fs-tools/Makefile b/package/utils/f2fs-tools/Makefile index 8a27c47ad..3e8bf63f0 100644 --- a/package/utils/f2fs-tools/Makefile +++ b/package/utils/f2fs-tools/Makefile @@ -8,14 +8,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=f2fs-tools -PKG_VERSION:=1.8.0 -PKG_RELEASE:=3 +PKG_VERSION:=1.9.0 +PKG_RELEASE:=1 PKG_LICENSE:=GPLv2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/ -PKG_HASH:=d4dbecf55560c548bf0758c9f641d1beec1e960b38cbbc19951195d5144d39ae +PKG_HASH:=77217562ae7011a6d81b7b3c43c42623db1796a57596408d6c8037def70d6cc7 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 @@ -57,7 +57,8 @@ define Package/libf2fs endef CONFIGURE_ARGS += \ - --without-selinux + --without-selinux \ + --without-blkid CONFIGURE_VARS += \ ac_cv_file__git=no diff --git a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch b/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch deleted file mode 100644 index d4e25397a..000000000 --- a/package/utils/f2fs-tools/patches/100-f2fs-WARNING-at-fs-f2fs-segment.c-718-update_sit_ent.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 31873d5cdf8a97d5f7921451c54f6d293293c6cc Mon Sep 17 00:00:00 2001 -From: Jaegeuk Kim -Date: Wed, 23 Aug 2017 13:33:00 -0700 -Subject: [PATCH] mkfs.f2fs: fix missing cpu_to_le64 for checkpoint version - -The error on mips was reported by Stijn as follow. - -Commit 8399a29df92d6867d226df362edbf2e0efa527c1 in f2fs-tools -("mkfs.f2fs: give random checkpoint version") causes a bug when mounting -a filesystem created with it on a MIPS64 device running a 4.4(.83) -kernel. The following kernel warning appears several times per second, -for 30 seconds: - -[ 23.837262] ------------[ cut here ]------------ -[ 23.842039] WARNING: CPU: 0 PID: 935 at fs/f2fs/segment.c:718 -update_sit_entry+0x1c0/0x2b0() -[ 23.850507] Modules linked in: pppoe ppp_async l2tp_ppp iptable_nat -[ 24.174064] Call Trace: -[ 24.176527] [] show_stack+0x68/0xb4 -[ 24.181595] [] dump_stack+0x8c/0xc4 -[ 24.186660] [] warn_slowpath_common+0xa0/0xd0 -[ 24.192597] [] update_sit_entry+0x1c0/0x2b0 -[ 24.198353] [] refresh_sit_entry+0x70/0xf8 -[ 24.204022] [] allocate_data_block+0x1f0/0x310 -[ 24.210038] [] do_write_page+0x29c/0x2bc -[ 24.215532] [] write_data_page+0xa0/0xd8 -[ 24.221028] [] do_write_data_page+0xe4/0x384 -[ 24.226870] [] f2fs_write_data_page+0x208/0x464 -[ 24.232972] [] __f2fs_writepage+0x1c/0x74 -[ 24.238553] [] -f2fs_write_cache_pages.constprop.7+0x250/0x394 -[ 24.245869] [] f2fs_write_data_pages+0x130/0x1b0 -[ 24.252066] [] __filemap_fdatawrite_range+0xa0/0xd4 -[ 24.258515] [] sync_dirty_dir_inodes+0x94/0xd8 -[ 24.264530] [] write_checkpoint+0x108/0xb9c -[ 24.270283] [] f2fs_sync_fs+0x68/0xb0 -[ 24.275526] [] f2fs_sync_file+0x2e8/0x518 -[ 24.281107] [] do_fsync+0x38/0x70 -[ 24.285992] [] SyS_fsync+0x14/0x20 -[ 24.290972] [] syscall_common+0x34/0x58 -[ 24.296372] -[ 24.298096] ---[ end trace fd3ac44449b218ab ]--- - -Fix: 8399a29df92d68 ("mkfs.f2fs: give random checkpoint version") -Reported-And-Tested-by: Stijn Tintel -Signed-off-by: Jaegeuk Kim ---- - mkfs/f2fs_format.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c -index 92876b8..b379e80 100644 ---- a/mkfs/f2fs_format.c -+++ b/mkfs/f2fs_format.c -@@ -546,7 +546,7 @@ static int f2fs_write_check_point_pack(void) - } - - /* 1. cp page 1 of checkpoint pack 1 */ -- cp->checkpoint_ver = rand() | 0x1; -+ cp->checkpoint_ver = cpu_to_le64(rand() | 0x1); - set_cp(cur_node_segno[0], c.cur_seg[CURSEG_HOT_NODE]); - set_cp(cur_node_segno[1], c.cur_seg[CURSEG_WARM_NODE]); - set_cp(cur_node_segno[2], c.cur_seg[CURSEG_COLD_NODE]); --- -2.13.5 - diff --git a/package/utils/fritz-tools/Makefile b/package/utils/fritz-tools/Makefile new file mode 100644 index 000000000..7c547e6f9 --- /dev/null +++ b/package/utils/fritz-tools/Makefile @@ -0,0 +1,45 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=fritz-tools +PKG_RELEASE:=1 +CMAKE_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/cmake.mk + +define Package/fritz-tools/Default + SECTION:=utils + CATEGORY:=Utilities +endef + +define Package/fritz-tffs + $(call Package/fritz-tools/Default) + TITLE:=Utility to partially read the TFFS filesystems +endef + +define Package/fritz-tffs/description + Utility to partially read the TFFS filesystems. +endef + +define Package/fritz-caldata + $(call Package/fritz-tools/Default) + DEPENDS:=+zlib + TITLE:=Utility to extract WLAN calibration data +endef + +define Package/fritz-caldata/description + Utility to extract the zlib compress calibration data from flash. +endef + +define Package/fritz-tffs/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_tffs_read $(1)/usr/bin/fritz_tffs +endef + +define Package/fritz-caldata/install + $(INSTALL_DIR) $(1)/usr/bin + $(INSTALL_BIN) $(PKG_BUILD_DIR)/fritz_cal_extract $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,fritz-tffs)) +$(eval $(call BuildPackage,fritz-caldata)) diff --git a/package/utils/fritz-tools/README.md b/package/utils/fritz-tools/README.md new file mode 100644 index 000000000..def237b17 --- /dev/null +++ b/package/utils/fritz-tools/README.md @@ -0,0 +1,50 @@ +Userspace utilties for accessing TFFS (a name-value storage usually found in AVM Fritz!Box based devices) + +## Building + +``` +mkdir build +cd build +cmake /path/to/fritz_tffs_tools +make +``` + +## Usage + +All command line parameters are documented: +``` +fritz_tffs_read -h +``` + +Show all entries from a TFFS partition dump (in the format: name=value): +``` +fritz_tffs_read -i /path/to/tffs.dump -a +``` + +Read a TFFS partition and show all entries (in the format: name=value): +``` +fritz_tffs_read -i /dev/mtdX -a +``` + +Output only the value of a specific key (this will only show the value): +``` +fritz_tffs_read -i /dev/mtdX -n my_ipaddress +``` + +## LICENSE + +See `LICENSE`: + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/package/utils/fritz-tools/src/CMakeLists.txt b/package/utils/fritz-tools/src/CMakeLists.txt new file mode 100644 index 000000000..021dc7733 --- /dev/null +++ b/package/utils/fritz-tools/src/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 2.6) + +PROJECT(fritz-tools C) +ADD_DEFINITIONS(-Wall -Werror --std=gnu99 -Wmissing-declarations) + +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +FIND_PATH(zlib_include_dir zlib.h) +INCLUDE_DIRECTORIES(${zlib_include_dir}) + +ADD_EXECUTABLE(fritz_tffs_read fritz_tffs_read.c) +ADD_EXECUTABLE(fritz_cal_extract fritz_cal_extract.c) +TARGET_LINK_LIBRARIES(fritz_cal_extract z) + +INSTALL(TARGETS fritz_tffs_read fritz_cal_extract RUNTIME DESTINATION bin) diff --git a/package/utils/fritz-tools/src/fritz_cal_extract.c b/package/utils/fritz-tools/src/fritz_cal_extract.c new file mode 100644 index 000000000..8156dfd1a --- /dev/null +++ b/package/utils/fritz-tools/src/fritz_cal_extract.c @@ -0,0 +1,259 @@ +/* + * A tool for reading the zlib compressed calibration data + * found in AVM Fritz!Box based devices). + * + * Copyright (c) 2017 Christian Lamparter + * + * Based on zpipe, which is an example of proper use of zlib's inflate(). + * that is Not copyrighted -- provided to the public domain + * Version 1.4 11 December 2005 Mark Adler + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "zlib.h" + +#define CHUNK 1024 + +static inline size_t special_min(size_t a, size_t b) +{ + return a == 0 ? b : (a < b ? a : b); +} + +/* Decompress from file source to file dest until stream ends or EOF. + inf() returns Z_OK on success, Z_MEM_ERROR if memory could not be + allocated for processing, Z_DATA_ERROR if the deflate data is + invalid or incomplete, Z_VERSION_ERROR if the version of zlib.h and + the version of the library linked do not match, or Z_ERRNO if there + is an error reading or writing the files. */ +static int inf(FILE *source, FILE *dest, size_t limit, size_t skip) +{ + int ret; + size_t have; + z_stream strm; + unsigned char in[CHUNK]; + unsigned char out[CHUNK]; + + /* allocate inflate state */ + strm.zalloc = Z_NULL; + strm.zfree = Z_NULL; + strm.opaque = Z_NULL; + strm.avail_in = 0; + strm.next_in = Z_NULL; + ret = inflateInit(&strm); + if (ret != Z_OK) + return ret; + + /* decompress until deflate stream ends or end of file */ + do { + strm.avail_in = fread(in, 1, CHUNK, source); + if (ferror(source)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + if (strm.avail_in == 0) + break; + strm.next_in = in; + + /* run inflate() on input until output buffer not full */ + do { + strm.avail_out = CHUNK; + strm.next_out = out; + ret = inflate(&strm, Z_NO_FLUSH); + assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + switch (ret) { + case Z_NEED_DICT: + ret = Z_DATA_ERROR; /* and fall through */ + case Z_DATA_ERROR: + case Z_MEM_ERROR: + (void)inflateEnd(&strm); + return ret; + } + have = special_min(limit, CHUNK - strm.avail_out) - skip; + if (fwrite(&out[skip], have, 1, dest) != 1 || ferror(dest)) { + (void)inflateEnd(&strm); + return Z_ERRNO; + } + skip = 0; + limit -= have; + } while (strm.avail_out == 0 && limit > 0); + + /* done when inflate() says it's done */ + } while (ret != Z_STREAM_END && limit > 0); + + /* clean up and return */ + (void)inflateEnd(&strm); + return (limit == 0 ? Z_OK : (ret == Z_STREAM_END ? Z_OK : Z_DATA_ERROR)); +} + +/* report a zlib or i/o error */ +static void zerr(int ret) +{ + switch (ret) { + case Z_ERRNO: + if (ferror(stdin)) + fputs("error reading stdin\n", stderr); + if (ferror(stdout)) + fputs("error writing stdout\n", stderr); + break; + case Z_STREAM_ERROR: + fputs("invalid compression level\n", stderr); + break; + case Z_DATA_ERROR: + fputs("invalid or incomplete deflate data\n", stderr); + break; + case Z_MEM_ERROR: + fputs("out of memory\n", stderr); + break; + case Z_VERSION_ERROR: + fputs("zlib version mismatch!\n", stderr); + } +} + +static unsigned int get_num(char *str) +{ + if (!strncmp("0x", str, 2)) + return strtoul(str+2, NULL, 16); + else + return strtoul(str, NULL, 10); +} + +static void usage(void) +{ + fprintf(stderr, "Usage: fritz_cal_extract [-s seek offset] [-i skip] [-o output file] [-l limit] [infile] -e entry_id\n" + "Finds and extracts zlib compressed calibration data in the EVA loader\n"); + exit(EXIT_FAILURE); +} + +struct cal_entry { + uint16_t id; + uint16_t len; +} __attribute__((packed)); + +/* compress or decompress from stdin to stdout */ +int main(int argc, char **argv) +{ + struct cal_entry cal = { .len = 0 }; + FILE *in = stdin; + FILE *out = stdout; + size_t limit = 0, skip = 0; + int initial_offset = 0; + int entry = -1; + int ret; + int opt; + + while ((opt = getopt(argc, argv, "s:e:o:l:i:")) != -1) { + switch (opt) { + case 's': + initial_offset = (int)get_num(optarg); + if (errno) { + perror("Failed to parse seek offset"); + goto out_bad; + } + break; + case 'e': + entry = (int) htobe16(get_num(optarg)); + if (errno) { + perror("Failed to entry id"); + goto out_bad; + } + break; + case 'o': + out = fopen(optarg, "w"); + if (!out) { + perror("Failed to create output file"); + goto out_bad; + } + break; + case 'l': + limit = (size_t)get_num(optarg); + if (errno) { + perror("Failed to parse limit"); + goto out_bad; + } + break; + case 'i': + skip = (size_t)get_num(optarg); + if (errno) { + perror("Failed to parse skip"); + goto out_bad; + } + break; + default: /* '?' */ + usage(); + } + } + + if (entry == -1) + usage(); + + if (argc > 1 && optind <= argc) { + in = fopen(argv[optind], "r"); + if (!in) { + perror("Failed to create output file"); + goto out_bad; + } + } + + if (initial_offset) { + ret = fseek(in, initial_offset, SEEK_CUR); + if (ret) { + perror("Failed to seek to calibration table"); + goto out_bad; + } + } + + do { + ret = fseek(in, be16toh(cal.len), SEEK_CUR); + if (feof(in)) { + fprintf(stderr, "Reached end of file, but didn't find the matching entry\n"); + goto out_bad; + } else if (ferror(in)) { + perror("Failure during seek"); + goto out_bad; + } + + ret = fread(&cal, 1, sizeof cal, in); + if (ret != sizeof cal) + goto out_bad; + } while (entry != cal.id || cal.id == 0xffff); + + if (cal.id == 0xffff) { + fprintf(stderr, "Reached end of filesystem, but didn't find the matching entry\n"); + goto out_bad; + } + + ret = inf(in, out, limit, skip); + if (ret == Z_OK) + goto out; + + zerr(ret); + +out_bad: + ret = EXIT_FAILURE; + +out: + fclose(in); + fclose(out); + return ret; +} diff --git a/package/utils/fritz-tools/src/fritz_tffs_read.c b/package/utils/fritz-tools/src/fritz_tffs_read.c new file mode 100644 index 000000000..d1b3038e6 --- /dev/null +++ b/package/utils/fritz-tools/src/fritz_tffs_read.c @@ -0,0 +1,379 @@ +/* + * A tool for reading the TFFS partitions (a name-value storage usually + * found in AVM Fritz!Box based devices). + * + * Copyright (c) 2015-2016 Martin Blumenstingl + * + * Based on the TFFS 2.0 kernel driver from AVM: + * Copyright (c) 2004-2007 AVM GmbH + * and the OpenWrt TFFS kernel driver: + * Copyright (c) 2013 John Crispin + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TFFS_ID_END 0xffff +#define TFFS_ID_TABLE_NAME 0x01ff + +static char *progname; +static char *input_file; +static unsigned long tffs_size; +static char *name_filter = NULL; +static bool show_all = false; +static bool print_all_key_names = false; +static bool swap_bytes = false; + +struct tffs_entry_header { + uint16_t id; + uint16_t len; +}; + +struct tffs_entry { + const struct tffs_entry_header *header; + char *name; + uint8_t *val; +}; + +struct tffs_name_table_entry { + const uint32_t *id; + const char *val; +}; + +struct tffs_key_name_table { + uint32_t size; + struct tffs_name_table_entry *entries; +}; + +static inline uint16_t get_header_len(const struct tffs_entry_header *header) +{ + if (swap_bytes) + return ntohs(header->len); + + return header->len; +} + +static inline uint16_t get_header_id(const struct tffs_entry_header *header) +{ + if (swap_bytes) + return ntohs(header->id); + + return header->id; +} + +static inline uint16_t to_entry_header_id(uint32_t name_id) +{ + if (swap_bytes) + return ntohl(name_id) & 0xffff; + + return name_id & 0xffff; +} + +static inline uint32_t get_walk_size(uint32_t entry_len) +{ + return (entry_len + 3) & ~0x03; +} + +static void print_entry_value(const struct tffs_entry *entry) +{ + int i; + + /* These are NOT NULL terminated. */ + for (i = 0; i < get_header_len(entry->header); i++) + fprintf(stdout, "%c", entry->val[i]); +} + +static void parse_entry(uint8_t *buffer, uint32_t pos, + struct tffs_entry *entry) +{ + entry->header = (struct tffs_entry_header *) &buffer[pos]; + entry->val = &buffer[pos + sizeof(struct tffs_entry_header)]; +} + +static int find_entry(uint8_t *buffer, uint16_t id, struct tffs_entry *entry) +{ + uint32_t pos = 0; + + do { + parse_entry(buffer, pos, entry); + + if (get_header_id(entry->header) == id) + return 1; + + pos += sizeof(struct tffs_entry_header); + pos += get_walk_size(get_header_len(entry->header)); + } while (pos < tffs_size && entry->header->id != TFFS_ID_END); + + return 0; +} + +static void parse_key_names(struct tffs_entry *names_entry, + struct tffs_key_name_table *key_names) +{ + uint32_t pos = 0, i = 0; + struct tffs_name_table_entry *name_item; + + key_names->entries = calloc(sizeof(*name_item), 1); + + do { + name_item = &key_names->entries[i]; + + name_item->id = (uint32_t *) &names_entry->val[pos]; + pos += sizeof(*name_item->id); + name_item->val = (const char *) &names_entry->val[pos]; + + /* + * There is no "length" field because the string values are + * simply NULL-terminated -> strlen() gives us the size. + */ + pos += get_walk_size(strlen(name_item->val) + 1); + + ++i; + key_names->entries = realloc(key_names->entries, + sizeof(*name_item) * (i + 1)); + } while (pos < get_header_len(names_entry->header)); + + key_names->size = i; +} + +static void show_all_key_names(struct tffs_key_name_table *key_names) +{ + int i; + + for (i = 0; i < key_names->size; i++) + printf("%s\n", key_names->entries[i].val); +} + +static int show_all_key_value_pairs(uint8_t *buffer, + struct tffs_key_name_table *key_names) +{ + int i, has_value = 0; + uint16_t id; + struct tffs_entry tmp; + + for (i = 0; i < key_names->size; i++) { + id = to_entry_header_id(*key_names->entries[i].id); + + if (find_entry(buffer, id, &tmp)) { + printf("%s=", key_names->entries[i].val); + print_entry_value(&tmp); + printf("\n"); + has_value++; + } + } + + if (!has_value) { + fprintf(stderr, "ERROR: no values found!\n"); + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} + +static int show_matching_key_value(uint8_t *buffer, + struct tffs_key_name_table *key_names) +{ + int i; + uint16_t id; + struct tffs_entry tmp; + const char *name; + + for (i = 0; i < key_names->size; i++) { + name = key_names->entries[i].val; + + if (strncmp(name, name_filter, strlen(name)) == 0) { + id = to_entry_header_id(*key_names->entries[i].id); + + if (find_entry(buffer, id, &tmp)) { + print_entry_value(&tmp); + printf("\n"); + return EXIT_SUCCESS; + } else { + fprintf(stderr, + "ERROR: no value found for name %s!\n", + name); + return EXIT_FAILURE; + } + } + } + + fprintf(stderr, "ERROR: Unknown key name %s!\n", name_filter); + return EXIT_FAILURE; +} + +static void usage(int status) +{ + FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout; + + fprintf(stream, "Usage: %s [OPTIONS...]\n", progname); + fprintf(stream, + "\n" + "Options:\n" + " -a list all key value pairs found in the TFFS file/device\n" + " -b swap bytes while parsing the TFFS file/device\n" + " -h show this screen\n" + " -i inspect the given TFFS file/device \n" + " -l list all supported keys\n" + " -n display the value of the given key\n" + " -s the (max) size of the TFFS file/device \n" + ); + + exit(status); +} + +static int file_exist(char *filename) +{ + struct stat buffer; + + return stat(filename, &buffer) == 0; +} + +static void parse_options(int argc, char *argv[]) +{ + while (1) + { + int c; + + c = getopt(argc, argv, "abhi:ln:s:"); + if (c == -1) + break; + + switch (c) { + case 'a': + show_all = true; + name_filter = NULL; + print_all_key_names = false; + break; + case 'b': + swap_bytes = 1; + break; + case 'h': + usage(EXIT_SUCCESS); + break; + case 'i': + input_file = optarg; + break; + case 'l': + print_all_key_names = true; + show_all = false; + name_filter = NULL; + break; + case 'n': + name_filter = optarg; + show_all = false; + print_all_key_names = false; + break; + case 's': + tffs_size = strtoul(optarg, NULL, 0); + break; + default: + usage(EXIT_FAILURE); + break; + } + } + + if (!input_file) { + fprintf(stderr, "ERROR: No input file (-i ) given!\n"); + exit(EXIT_FAILURE); + } + + if (!file_exist(input_file)) { + fprintf(stderr, "ERROR: %s does not exist\n", input_file); + exit(EXIT_FAILURE); + } + + if (!show_all && !name_filter && !print_all_key_names) { + fprintf(stderr, + "ERROR: either -l, -a or -n is required!\n"); + exit(EXIT_FAILURE); + } +} + +int main(int argc, char *argv[]) +{ + int ret = EXIT_FAILURE; + uint8_t *buffer; + FILE *fp; + struct tffs_entry name_table; + struct tffs_key_name_table key_names; + + progname = basename(argv[0]); + + parse_options(argc, argv); + + fp = fopen(input_file, "r"); + + if (!fp) { + fprintf(stderr, "ERROR: Failed to open tffs input file %s\n", + input_file); + goto out; + } + + if (tffs_size == 0) { + fseek(fp, 0L, SEEK_END); + tffs_size = ftell(fp); + fseek(fp, 0L, SEEK_SET); + } + + buffer = malloc(tffs_size); + + if (fread(buffer, 1, tffs_size, fp) != tffs_size) { + fprintf(stderr, "ERROR: Failed read tffs file %s\n", + input_file); + goto out_free; + } + + if (!find_entry(buffer, TFFS_ID_TABLE_NAME, &name_table)) { + fprintf(stderr,"ERROR: No name table found in tffs file %s\n", + input_file); + fprintf(stderr," Is byte-swapping (-b) required?\n"); + goto out_free; + } + + parse_key_names(&name_table, &key_names); + if (key_names.size < 1) { + fprintf(stderr, "ERROR: No name table found in tffs file %s\n", + input_file); + goto out_free_names; + } + + if (print_all_key_names) { + show_all_key_names(&key_names); + ret = EXIT_SUCCESS; + } else if (show_all) { + ret = show_all_key_value_pairs(buffer, &key_names); + } else { + ret = show_matching_key_value(buffer, &key_names); + } + +out_free_names: + free(key_names.entries); +out_free: + fclose(fp); + free(buffer); +out: + return ret; +} diff --git a/package/utils/fuse/Makefile b/package/utils/fuse/Makefile index d0cefff1a..e853a8e04 100644 --- a/package/utils/fuse/Makefile +++ b/package/utils/fuse/Makefile @@ -18,6 +18,7 @@ PKG_HASH:=832432d1ad4f833c20e13b57cf40ce5277a9d33e483205fc63c78111b3358874 PKG_LICENSE:=LGPLv2.1 GPLv2 PKG_LICENSE_FILES:=COPYING.LIB COPYING +PKG_CPE_ID:=cpe:/a:fuse_project:fuse PKG_INSTALL:=1 diff --git a/package/utils/jsonfilter/Makefile b/package/utils/jsonfilter/Makefile index b70928ba5..32be1adb9 100644 --- a/package/utils/jsonfilter/Makefile +++ b/package/utils/jsonfilter/Makefile @@ -4,7 +4,7 @@ PKG_NAME:=jsonfilter PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/jsonpath.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/jsonpath.git PKG_SOURCE_DATE:=2016-07-02 PKG_SOURCE_VERSION:=dea067ad67d977c247c300c06676a06adf21e0c7 PKG_MIRROR_HASH:=6c0e30da3f0c82527f9b5285d7c6ae61406732f2b0543b93131fe115ffc2987a diff --git a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch index 74b8c6f8f..ac0722c70 100644 --- a/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch +++ b/package/utils/lua/patches/010-lua-5.1.3-lnum-full-260308.patch @@ -62,7 +62,7 @@ return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; } -@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, +@@ -264,6 +265,14 @@ LUA_API int lua_isnumber (lua_State *L, } @@ -77,7 +77,7 @@ LUA_API int lua_isstring (lua_State *L, int idx) { int t = lua_type(L, idx); return (t == LUA_TSTRING || t == LUA_TNUMBER); -@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, +@@ -309,31 +318,66 @@ LUA_API int lua_lessthan (lua_State *L, } @@ -162,7 +162,7 @@ case LUA_TNUMBER: { size_t l; lua_lock(L); /* `luaV_tostring' may create a new string */ -@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) +@@ -426,6 +471,8 @@ LUA_API void lua_pushnil (lua_State *L) } @@ -196,7 +196,7 @@ LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { -@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, +@@ -569,7 +626,7 @@ LUA_API void lua_rawgeti (lua_State *L, lua_lock(L); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -205,7 +205,7 @@ api_incr_top(L); lua_unlock(L); } -@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State +@@ -597,6 +654,9 @@ LUA_API int lua_getmetatable (lua_State case LUA_TUSERDATA: mt = uvalue(obj)->metatable; break; @@ -215,7 +215,7 @@ default: mt = G(L)->mt[ttype(obj)]; break; -@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, +@@ -687,7 +747,7 @@ LUA_API void lua_rawseti (lua_State *L, api_checknelems(L, 1); o = index2adr(L, idx); api_check(L, ttistable(o)); @@ -224,7 +224,7 @@ luaC_barriert(L, hvalue(o), L->top-1); L->top--; lua_unlock(L); -@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State +@@ -721,7 +781,7 @@ LUA_API int lua_setmetatable (lua_State break; } default: { @@ -286,7 +286,7 @@ #define FREELIST_REF 0 /* free list of references */ -@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State +@@ -66,7 +66,7 @@ LUALIB_API int luaL_typerror (lua_State static void tag_error (lua_State *L, int narg, int tag) { @@ -351,7 +351,7 @@ -@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) +@@ -54,20 +56,25 @@ static int luaB_tonumber (lua_State *L) int base = luaL_optint(L, 2, 10); if (base == 10) { /* standard conversion */ luaL_checkany(L, 1); @@ -503,7 +503,7 @@ case VKNUM: case VTRUE: case VFALSE: -@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc +@@ -451,6 +489,10 @@ int luaK_exp2RK (FuncState *fs, expdesc if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ e->u.s.info = (e->k == VNIL) ? nilK(fs) : (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : @@ -896,7 +896,7 @@ lua_assert(isdigit(ls->current)); do { save_and_next(ls); -@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, +@@ -202,8 +215,9 @@ static void read_numeral (LexState *ls, save_and_next(ls); save(ls, '\0'); buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ @@ -1009,6 +1009,7 @@ -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - +- +#ifdef LNUM_FLOAT +# define PI (3.14159265358979323846F) +#elif defined(M_PI) @@ -1017,7 +1018,7 @@ +# define PI (3.14159265358979323846264338327950288) +#endif +#define RADIANS_PER_DEGREE (PI/180) - ++ +#undef HUGE +#ifdef LNUM_FLOAT +# define HUGE HUGE_VALF @@ -2103,7 +2104,7 @@ case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ case LUA_TLIGHTUSERDATA: -@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, +@@ -86,21 +106,6 @@ int luaO_rawequalObj (const TValue *t1, } } @@ -2606,7 +2607,7 @@ nums[ceillog2(k)]++; /* count as such */ return 1; } -@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table +@@ -308,7 +322,7 @@ static void resize (lua_State *L, Table /* re-insert elements from vanishing slice */ for (i=nasize; iarray[i])) @@ -2650,7 +2651,7 @@ } while (n); return luaO_nilobject; } -@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const +@@ -470,14 +487,12 @@ const TValue *luaH_get (Table *t, const switch (ttype(key)) { case LUA_TNIL: return luaO_nilobject; case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); @@ -3061,7 +3062,7 @@ /* @@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. ** CHANGE it if your system requires alignments larger than double. (For -@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; +@@ -728,28 +652,6 @@ union luai_Cast { double l_d; long l_l; #define luai_userstateyield(L,n) ((void)L) @@ -3092,7 +3093,7 @@ /* --- a/src/lundump.c +++ b/src/lundump.c -@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* +@@ -73,6 +73,13 @@ static lua_Number LoadNumber(LoadState* return x; } @@ -3106,7 +3107,7 @@ static TString* LoadString(LoadState* S) { size_t size; -@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, +@@ -119,6 +126,9 @@ static void LoadConstants(LoadState* S, case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; @@ -3198,7 +3199,7 @@ setsvalue2s(L, obj, luaS_new(L, s)); return 1; } -@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, +@@ -222,59 +234,127 @@ static int l_strcmp (const TString *ls, } @@ -3421,10 +3422,10 @@ + case TM_POW: if (try_powint( ri, ib, ic)) return; break; + case TM_UNM: if (try_unmint( ri, ib)) return; break; + default: lua_assert(0); -+ } + } + } + /* Fallback to floating point, when leaving range. */ -+ + +#ifdef LNUM_COMPLEX + if ((nvalue_img(b)!=0) || (nvalue_img(c)!=0)) { + lua_Complex r; @@ -3444,7 +3445,7 @@ + default: lua_assert(0); r=0; + } + setnvalue_complex( ra, r ); - } ++ } + return; + } +#endif @@ -3465,7 +3466,7 @@ + if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} - ++ +/* Helper macro to sort arithmetic operations into four categories: + * TK_INT: integer - integer operands + * TK_NUMBER: number - number (non complex, either may be integer) diff --git a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch index 937fc137e..3d3d6850e 100644 --- a/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch +++ b/package/utils/lua/patches/012-lnum-fix-ltle-relational-operators.patch @@ -1,6 +1,6 @@ --- a/src/lvm.c +++ b/src/lvm.c -@@ -284,7 +284,8 @@ int luaV_lessthan (lua_State *L, const T +@@ -281,7 +281,8 @@ int luaV_lessthan (lua_State *L, const T else return luai_numlt( nvalue_fast(l), cast_num(ivalue(r)) ); @@ -10,7 +10,7 @@ return res; return luaG_ordererror(L, l, r); -@@ -322,7 +323,8 @@ static int lessequal (lua_State *L, cons +@@ -319,7 +320,8 @@ static int lessequal (lua_State *L, cons else return luai_numle( nvalue_fast(l), cast_num(ivalue(r)) ); diff --git a/package/utils/lua/patches/020-shared_liblua.patch b/package/utils/lua/patches/020-shared_liblua.patch index bcd410f69..64f683ddb 100644 --- a/package/utils/lua/patches/020-shared_liblua.patch +++ b/package/utils/lua/patches/020-shared_liblua.patch @@ -21,7 +21,7 @@ ranlib: --- a/src/ldo.h +++ b/src/ldo.h -@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, +@@ -46,7 +46,7 @@ LUAI_FUNC int luaD_pcall (lua_State *L, LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); diff --git a/package/utils/lua/patches/050-honor-cflags.patch b/package/utils/lua/patches/050-honor-cflags.patch index dd6579148..d221c4ee9 100644 --- a/package/utils/lua/patches/050-honor-cflags.patch +++ b/package/utils/lua/patches/050-honor-cflags.patch @@ -8,4 +8,4 @@ + $(CC) -o $@.$(PKG_VERSION) -Wl,-Bsymbolic-functions $(MYLDFLAGS) -shared -Wl,-soname="$@.$(PKG_VERSION)" $? ln -fs $@.$(PKG_VERSION) $@ - + $(LUA_T): $(LUA_O) $(LUA_SO) diff --git a/package/utils/lua/patches/300-opcode_performance.patch b/package/utils/lua/patches/300-opcode_performance.patch index 5fbb87388..b971e0975 100644 --- a/package/utils/lua/patches/300-opcode_performance.patch +++ b/package/utils/lua/patches/300-opcode_performance.patch @@ -10,7 +10,7 @@ /* * If 'obj' is a string, it is tried to be interpreted as a number. -@@ -566,12 +569,63 @@ static inline int arith_mode( const TVal +@@ -568,12 +571,63 @@ static inline int arith_mode( const TVal ARITH_OP1_END #endif @@ -74,7 +74,7 @@ reentry: /* entry point */ lua_assert(isLua(L->ci)); pc = L->savedpc; -@@ -596,33 +650,33 @@ void luaV_execute (lua_State *L, int nex +@@ -598,33 +652,33 @@ void luaV_execute (lua_State *L, int nex lua_assert(base == L->base && L->base == L->ci->base); lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); @@ -115,7 +115,7 @@ TValue g; TValue *rb = KBx(i); sethvalue(L, &g, cl->env); -@@ -630,88 +684,88 @@ void luaV_execute (lua_State *L, int nex +@@ -632,88 +686,88 @@ void luaV_execute (lua_State *L, int nex Protect(luaV_gettable(L, &g, rb, ra)); continue; } @@ -219,7 +219,7 @@ const TValue *rb = RB(i); switch (ttype(rb)) { case LUA_TTABLE: { -@@ -731,18 +785,18 @@ void luaV_execute (lua_State *L, int nex +@@ -733,18 +787,18 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -241,7 +241,7 @@ TValue *rb = RKB(i); TValue *rc = RKC(i); Protect( -@@ -752,7 +806,7 @@ void luaV_execute (lua_State *L, int nex +@@ -754,7 +808,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -250,7 +250,7 @@ Protect( if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -760,7 +814,7 @@ void luaV_execute (lua_State *L, int nex +@@ -762,7 +816,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -259,7 +259,7 @@ Protect( if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) dojump(L, pc, GETARG_sBx(*pc)); -@@ -768,13 +822,13 @@ void luaV_execute (lua_State *L, int nex +@@ -770,13 +824,13 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -275,7 +275,7 @@ TValue *rb = RB(i); if (l_isfalse(rb) != GETARG_C(i)) { setobjs2s(L, ra, rb); -@@ -783,7 +837,7 @@ void luaV_execute (lua_State *L, int nex +@@ -785,7 +839,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -284,7 +284,7 @@ int b = GETARG_B(i); int nresults = GETARG_C(i) - 1; if (b != 0) L->top = ra+b; /* else previous instruction set top */ -@@ -804,7 +858,7 @@ void luaV_execute (lua_State *L, int nex +@@ -806,7 +860,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -293,7 +293,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b; /* else previous instruction set top */ L->savedpc = pc; -@@ -836,7 +890,7 @@ void luaV_execute (lua_State *L, int nex +@@ -838,7 +892,7 @@ void luaV_execute (lua_State *L, int nex } } } @@ -302,7 +302,7 @@ int b = GETARG_B(i); if (b != 0) L->top = ra+b-1; if (L->openupval) luaF_close(L, base); -@@ -851,7 +905,7 @@ void luaV_execute (lua_State *L, int nex +@@ -853,7 +907,7 @@ void luaV_execute (lua_State *L, int nex goto reentry; } } @@ -311,7 +311,7 @@ /* If start,step and limit are all integers, we don't need to check * against overflow in the looping. */ -@@ -879,7 +933,7 @@ void luaV_execute (lua_State *L, int nex +@@ -881,7 +935,7 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -320,7 +320,7 @@ const TValue *init = ra; const TValue *plimit = ra+1; const TValue *pstep = ra+2; -@@ -902,7 +956,7 @@ void luaV_execute (lua_State *L, int nex +@@ -904,7 +958,7 @@ void luaV_execute (lua_State *L, int nex dojump(L, pc, GETARG_sBx(i)); continue; } @@ -329,7 +329,7 @@ StkId cb = ra + 3; /* call base */ setobjs2s(L, cb+2, ra+2); setobjs2s(L, cb+1, ra+1); -@@ -918,7 +972,7 @@ void luaV_execute (lua_State *L, int nex +@@ -920,7 +974,7 @@ void luaV_execute (lua_State *L, int nex pc++; continue; } @@ -338,7 +338,7 @@ int n = GETARG_B(i); int c = GETARG_C(i); int last; -@@ -940,11 +994,11 @@ void luaV_execute (lua_State *L, int nex +@@ -942,11 +996,11 @@ void luaV_execute (lua_State *L, int nex } continue; } @@ -352,7 +352,7 @@ Proto *p; Closure *ncl; int nup, j; -@@ -964,7 +1018,7 @@ void luaV_execute (lua_State *L, int nex +@@ -966,7 +1020,7 @@ void luaV_execute (lua_State *L, int nex Protect(luaC_checkGC(L)); continue; } diff --git a/package/utils/otrx/src/otrx.c b/package/utils/otrx/src/otrx.c index 101a31004..223e032f2 100644 --- a/package/utils/otrx/src/otrx.c +++ b/package/utils/otrx/src/otrx.c @@ -1,7 +1,7 @@ /* * otrx * - * Copyright (C) 2015 RafaÅ‚ MiÅ‚ecki + * Copyright (C) 2015-2017 RafaÅ‚ MiÅ‚ecki * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -124,9 +124,7 @@ static const uint32_t crc32_tbl[] = { 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, }; -uint32_t otrx_crc32(uint8_t *buf, size_t len) { - uint32_t crc = 0xffffffff; - +uint32_t otrx_crc32(uint32_t crc, uint8_t *buf, size_t len) { while (len) { crc = crc32_tbl[(crc ^ *buf) & 0xff] ^ (crc >> 8); buf++; @@ -158,7 +156,6 @@ static int otrx_check(int argc, char **argv) { size_t bytes, length; uint8_t buf[1024]; uint32_t crc32; - int i; int err = 0; if (argc < 3) { @@ -203,8 +200,7 @@ static int otrx_check(int argc, char **argv) { fseek(trx, trx_offset + TRX_FLAGS_OFFSET, SEEK_SET); length -= TRX_FLAGS_OFFSET; while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { - for (i = 0; i < bytes; i++) - crc32 = crc32_tbl[(crc32 ^ buf[i]) & 0xff] ^ (crc32 >> 8); + crc32 = otrx_crc32(crc32, buf, bytes); length -= bytes; } @@ -232,14 +228,11 @@ out: * Create **************************************************/ -static void otrx_create_parse_options(int argc, char **argv) { -} - static ssize_t otrx_create_append_file(FILE *trx, const char *in_path) { FILE *in; size_t bytes; ssize_t length = 0; - uint8_t buf[128]; + uint8_t buf[1024]; in = fopen(in_path, "r"); if (!in) { @@ -271,9 +264,12 @@ static ssize_t otrx_create_append_zeros(FILE *trx, size_t length) { if (fwrite(buf, 1, length, trx) != length) { fprintf(stderr, "Couldn't write %zu B to %s\n", length, trx_path); + free(buf); return -EIO; } + free(buf); + return length; } @@ -288,7 +284,7 @@ static ssize_t otrx_create_align(FILE *trx, size_t curr_offset, size_t alignment static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { size_t bytes, length; - uint8_t *buf; + uint8_t buf[1024]; uint32_t crc32; hdr->magic = cpu_to_le32(TRX_MAGIC); @@ -303,20 +299,13 @@ static int otrx_create_write_hdr(FILE *trx, struct trx_header *hdr) { length = le32_to_cpu(hdr->length); - buf = malloc(length); - if (!buf) { - fprintf(stderr, "Couldn't alloc %zu B buffer\n", length); - return -ENOMEM; + crc32 = 0xffffffff; + fseek(trx, TRX_FLAGS_OFFSET, SEEK_SET); + length -= TRX_FLAGS_OFFSET; + while ((bytes = fread(buf, 1, otrx_min(sizeof(buf), length), trx)) > 0) { + crc32 = otrx_crc32(crc32, buf, bytes); + length -= bytes; } - - fseek(trx, 0, SEEK_SET); - bytes = fread(buf, 1, length, trx); - if (bytes != length) { - fprintf(stderr, "Couldn't read %zu B of data from %s\n", length, trx_path); - return -ENOMEM; - } - - crc32 = otrx_crc32(buf + TRX_FLAGS_OFFSET, length - TRX_FLAGS_OFFSET); hdr->crc32 = cpu_to_le32(crc32); fseek(trx, 0, SEEK_SET); @@ -345,9 +334,6 @@ static int otrx_create(int argc, char **argv) { } trx_path = argv[2]; - optind = 3; - otrx_create_parse_options(argc, argv); - trx = fopen(trx_path, "w+"); if (!trx) { fprintf(stderr, "Couldn't open %s\n", trx_path); @@ -357,7 +343,7 @@ static int otrx_create(int argc, char **argv) { fseek(trx, curr_offset, SEEK_SET); optind = 3; - while ((c = getopt(argc, argv, "f:b:")) != -1) { + while ((c = getopt(argc, argv, "f:A:a:b:")) != -1) { switch (c) { case 'f': if (curr_idx >= TRX_MAX_PARTS) { @@ -381,6 +367,27 @@ static int otrx_create(int argc, char **argv) { curr_offset += sbytes; break; + case 'A': + sbytes = otrx_create_append_file(trx, optarg); + if (sbytes < 0) { + fprintf(stderr, "Failed to append file %s\n", optarg); + } else { + curr_offset += sbytes; + } + + sbytes = otrx_create_align(trx, curr_offset, 4); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; + case 'a': + sbytes = otrx_create_align(trx, curr_offset, strtol(optarg, NULL, 0)); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + break; case 'b': sbytes = strtol(optarg, NULL, 0) - curr_offset; if (sbytes < 0) { @@ -398,6 +405,12 @@ static int otrx_create(int argc, char **argv) { break; } + sbytes = otrx_create_align(trx, curr_offset, 0x1000); + if (sbytes < 0) + fprintf(stderr, "Failed to append zeros\n"); + else + curr_offset += sbytes; + hdr.length = curr_offset; otrx_create_write_hdr(trx, &hdr); err_close: @@ -552,6 +565,8 @@ static void usage() { printf("Creating new TRX file:\n"); printf("\totrx create [options] [partitions]\n"); printf("\t-f file\t\t\t\t[partition] start new partition with content copied from file\n"); + printf("\t-A file\t\t\t\t[partition] append current partition with content copied from file\n"); + printf("\t-a alignment\t\t\t[partition] align current partition\n"); printf("\t-b offset\t\t\t[partition] append zeros to partition till reaching absolute offset\n"); printf("\n"); printf("Extracting from TRX file:\n"); diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile index 0243b773e..3a972f54d 100644 --- a/package/utils/ugps/Makefile +++ b/package/utils/ugps/Makefile @@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ugps PKG_RELEASE:=3 -PKG_SOURCE_URL=$(LEDE_GIT)/project/ugps.git +PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2016-10-24 -PKG_SOURCE_VERSION:=32a6b2b702c3b9f8c425f3d9dc9f4273e276029c -PKG_MIRROR_HASH:=41d24ef335e9b2847895b04cee4d1c7efa56fc207798f5858e7a1f229a33c5eb +PKG_SOURCE_DATE:=2017-02-11 +PKG_SOURCE_VERSION:=c30055a685bca1e81ccc8f4bd3bb08d780a7d762 +PKG_MIRROR_HASH:=a618f9a15d3a585453550190eed2bb0a308ddba0ab37f2f6b76dd3c87fd80e8b PKG_MAINTAINER:=John Crispin PKG_LICENSE:=GPL-2.0+ diff --git a/package/utils/usbmode/Makefile b/package/utils/usbmode/Makefile index 1b1ef147b..e229c791c 100644 --- a/package/utils/usbmode/Makefile +++ b/package/utils/usbmode/Makefile @@ -4,10 +4,10 @@ PKG_NAME:=usbmode PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL=$(LEDE_GIT)/project/usbmode.git -PKG_SOURCE_DATE:=2017-05-24 -PKG_SOURCE_VERSION:=453da8e540b1c53d357b897d6c70372cd4633390 -PKG_MIRROR_HASH:=b4a7132b940192f2e9a74bd890bd7008ede701e1d52284c3ade0cdc7d663929f +PKG_SOURCE_URL=$(PROJECT_GIT)/project/usbmode.git +PKG_SOURCE_DATE:=2017-12-19 +PKG_SOURCE_VERSION:=f40f84c27534159066c94dadc0c08e0b255c3e26 +PKG_MIRROR_HASH:=840c7ee2843102b09d8943a20820025251cc259385e2b0bde6b7c8cce8190f83 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 diff --git a/package/utils/util-linux/Makefile b/package/utils/util-linux/Makefile index aea13ac8d..88cb31477 100644 --- a/package/utils/util-linux/Makefile +++ b/package/utils/util-linux/Makefile @@ -8,12 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=util-linux -PKG_VERSION:=2.29.2 +PKG_VERSION:=2.30.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz -PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.29 -PKG_HASH:=accea4d678209f97f634f40a93b7e9fcad5915d1f4749f6c47bee6bf110fe8e3 +PKG_SOURCE_URL:=@KERNEL/linux/utils/$(PKG_NAME)/v2.30 +PKG_HASH:=7b5be5489e9b5b7177832836467aba1c87bf0e9bcbcb5a6f35d76cd4782589dc +PKG_CPE_ID:=cpe:/a:kernel:util-linux PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:= COPYING \ @@ -30,6 +31,8 @@ PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +DISABLE_NLS:=--disable-nls + include $(INCLUDE_DIR)/package.mk define Package/util-linux/Default @@ -163,6 +166,7 @@ endef define Package/dmesg $(call Package/util-linux/Default) TITLE:=print or control the kernel ring buffer + DEPENDS:= +libncursesw endef define Package/dmesg/description @@ -172,7 +176,7 @@ endef define Package/fdisk $(call Package/util-linux/Default) TITLE:=manipulate disk partition table - DEPENDS:= +libblkid +libsmartcols +libfdisk + DEPENDS:= +libblkid +libsmartcols +libfdisk +libncursesw SUBMENU=Disc endef @@ -349,7 +353,7 @@ define Package/sfdisk $(call Package/util-linux/Default) TITLE:=partition table manipulator for Linux SUBMENU=Disc - DEPENDS:= +libblkid +libfdisk +libsmartcols + DEPENDS:= +libblkid +libfdisk +libsmartcols +libncursesw endef define Package/sfdisk/description diff --git a/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch b/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch deleted file mode 100644 index a291f6ac8..000000000 --- a/package/utils/util-linux/patches/001-uclibc_add_libm_to_scriptreplay.patch +++ /dev/null @@ -1,24 +0,0 @@ -From feda4342df1ced25df3d200ed23469e740196c86 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Wed, 18 Jan 2017 13:17:21 +0100 -Subject: build-sys: use -lm for scriptreplay if necessary - -Reported-by: Bert van Hall -Addresses: https://github.com/karelzak/util-linux/pull/397 -Signed-off-by: Karel Zak ---- - configure.ac | 7 +++++++ - term-utils/Makemodule.am | 2 +- - 2 files changed, 8 insertions(+), 1 deletion(-) - ---- a/term-utils/Makemodule.am -+++ b/term-utils/Makemodule.am -@@ -21,7 +21,7 @@ if BUILD_SCRIPTREPLAY - usrbin_exec_PROGRAMS += scriptreplay - dist_man_MANS += term-utils/scriptreplay.1 - scriptreplay_SOURCES = term-utils/scriptreplay.c --scriptreplay_LDADD = $(LDADD) libcommon.la -+scriptreplay_LDADD = $(LDADD) libcommon.la $(MATH_LIBS) - endif # BUILD_SCRIPTREPLAY - - diff --git a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch index 16ba14ae3..c79813b1b 100644 --- a/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch +++ b/package/utils/util-linux/patches/003-fix_pkgconfig_files.patch @@ -10,7 +10,7 @@ endif # BUILD_LIBUUID --- a/configure.ac +++ b/configure.ac -@@ -2165,18 +2165,23 @@ AC_CONFIG_HEADERS([config.h]) +@@ -2255,18 +2255,23 @@ AC_CONFIG_HEADERS([config.h]) # AC_CONFIG_FILES([ Makefile @@ -66,7 +66,7 @@ endif # BUILD_LIBSMARTCOLS --- a/libfdisk/Makemodule.am +++ b/libfdisk/Makemodule.am -@@ -8,7 +8,6 @@ SUBDIRS += libfdisk/docs +@@ -9,7 +9,6 @@ SUBDIRS += libfdisk/docs endif pkgconfig_DATA += libfdisk/fdisk.pc diff --git a/package/utils/util-linux/patches/100-use_urandom.patch b/package/utils/util-linux/patches/100-use_urandom.patch new file mode 100644 index 000000000..848f2f40c --- /dev/null +++ b/package/utils/util-linux/patches/100-use_urandom.patch @@ -0,0 +1,14 @@ +--- a/lib/randutils.c ++++ b/lib/randutils.c +@@ -25,6 +25,11 @@ + #define THREAD_LOCAL static + #endif + ++/* force /dev/urandom to avoid hanging on early boot */ ++#undef HAVE_GETRANDOM ++#undef SYS_getrandom ++#undef __NR_getrandom ++ + #ifdef HAVE_GETRANDOM + # include + #elif defined (__linux__) diff --git a/package/utils/xfsprogs/Makefile b/package/utils/xfsprogs/Makefile index fb350993f..5cf1da240 100644 --- a/package/utils/xfsprogs/Makefile +++ b/package/utils/xfsprogs/Makefile @@ -8,17 +8,17 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xfsprogs +PKG_CPE_ID:=cpe:/a:sgi:xfsprogs PKG_RELEASE:=1 -PKG_VERSION:=3.1.7 -PKG_SOURCE_URL:=ftp://oss.sgi.com/projects/xfs/previous/ -PKG_HASH:=e150914210ac5fd29c098ef0fd94bdec51d2fb231cf9faa765c16ec6d75c8eaa +PKG_VERSION:=4.11.0 +PKG_SOURCE_URL:=@KERNEL/linux/utils/fs/xfs/xfsprogs +PKG_HASH:=c3a6d87b564d7738243c507df82276bed982265e345363a95f2c764e8a5f5bb2 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_INSTALL:=1 -PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk -include $(INCLUDE_DIR)/nls.mk define Package/xfsprogs/default SECTION:=utils @@ -58,15 +58,12 @@ MAKE_FLAGS += \ DEBUG= Q= \ PCFLAGS="-Wall" \ PKG_PLATFORM=linux \ - ENABLE_GETTEXT=no \ - prefix=$(PKG_INSTALL_DIR)/usr \ - exec_prefix=$(PKG_INSTALL_DIR)/usr \ - PKG_SBIN_DIR=$(PKG_INSTALL_DIR)/usr/sbin \ - PKG_ROOT_SBIN_DIR=$(PKG_INSTALL_DIR)/sbin \ - PKG_MAN_DIR=$(PKG_INSTALL_DIR)/usr/man \ - PKG_LOCALE_DIR=$(PKG_INSTALL_DIR)/usr/share/locale \ - PKG_ROOT_LIB_DIR=$(PKG_INSTALL_DIR)/lib \ - PKG_DOC_DIR=$(PKG_INSTALL_DIR)/usr/share/doc/xfsprogs + ENABLE_GETTEXT=no + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR)/libxfs crc32table.h CFLAGS="$(HOST_CFLAGS) -I$(PKG_BUILD_DIR)/include" + $(call Build/Compile/Default) +endef define Package/xfs-mkfs/install mkdir -p $(1)/usr/sbin diff --git a/package/utils/xfsprogs/patches/001-automake-compat.patch b/package/utils/xfsprogs/patches/001-automake-compat.patch deleted file mode 100644 index ce9289a4a..000000000 --- a/package/utils/xfsprogs/patches/001-automake-compat.patch +++ /dev/null @@ -1,78 +0,0 @@ -commit 2222aa77e11b959e0e5a0ded3482e56799593bc2 -Author: Jens Muecke -Date: Thu Jan 26 00:34:15 2012 +0100 - - 001-automake-compat - ---- a/configure.in -+++ b/configure.in -@@ -2,7 +2,8 @@ AC_INIT(include/libxfs.h) - AC_PREREQ(2.50) - AC_CONFIG_AUX_DIR([.]) - AC_CONFIG_MACRO_DIR([m4]) --AC_CONFIG_HEADER(include/platform_defs.h) -+# Put a dummy here (http://www.mail-archive.com/automake@gnu.org/msg09241.html) -+AC_CONFIG_HEADERS([doesnotexist.h include/platform_defs.h]) - AC_PREFIX_DEFAULT(/usr) - - AC_PROG_LIBTOOL ---- a/include/builddefs.in -+++ b/include/builddefs.in -@@ -20,6 +20,8 @@ - ifndef _BUILDDEFS_INCLUDED_ - _BUILDDEFS_INCLUDED_ = 1 - -+SHELL = @SHELL@ -+ - DEBUG = @debug_build@ - OPTIMIZER = @opt_build@ - MALLOCLIB = @malloc_lib@ ---- a/m4/package_types.m4 -+++ b/m4/package_types.m4 -@@ -9,7 +9,7 @@ AC_DEFUN([AC_TYPE_PSINT], - #include - ], [ - __psint_t psint; -- ], AC_DEFINE(HAVE___PSINT_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___PSINT_T], [1], [Define if __psint_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -23,7 +23,7 @@ AC_DEFUN([AC_TYPE_PSUNSIGNED], - #include - ], [ - __psunsigned_t psuint; -- ], AC_DEFINE(HAVE___PSUNSIGNED_T) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___PSUNSIGNED_T], [1], [Define if __psunsigned_t exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -37,7 +37,7 @@ AC_DEFUN([AC_TYPE_U32], - #include - ], [ - __u32 u32; -- ], AC_DEFINE(HAVE___U32) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) -+ ], AC_DEFINE([HAVE___U32], [1], [Define if __u32 exists]) AC_MSG_RESULT(yes) , AC_MSG_RESULT(no)) - ]) - - # -@@ -50,15 +50,15 @@ AC_DEFUN([AC_SIZEOF_POINTERS_AND_LONG], - AC_CHECK_SIZEOF(long, 4) - AC_CHECK_SIZEOF(char *, 4) - if test $ac_cv_sizeof_long -eq 4 -o $ac_cv_sizeof_long -eq 0; then -- AC_DEFINE(HAVE_32BIT_LONG) -+ AC_DEFINE([HAVE_32BIT_LONG], [1], [Define if long is 32bit]) - fi - if test $ac_cv_sizeof_long -eq 8; then -- AC_DEFINE(HAVE_64BIT_LONG) -+ AC_DEFINE([HAVE_64BIT_LONG], [1], [Define if long is 64bit]) - fi - if test $ac_cv_sizeof_char_p -eq 4 -o $ac_cv_sizeof_char_p -eq 0; then -- AC_DEFINE(HAVE_32BIT_PTR) -+ AC_DEFINE([HAVE_32BIT_PTR], [1], [Define if char* is 32bit]) - fi - if test $ac_cv_sizeof_char_p -eq 8; then -- AC_DEFINE(HAVE_64BIT_PTR) -+ AC_DEFINE([HAVE_64BIT_PTR], [1], [Define if char* is 64bit]) - fi - ]) diff --git a/package/utils/xfsprogs/patches/100-no-selftest.patch b/package/utils/xfsprogs/patches/100-no-selftest.patch new file mode 100644 index 000000000..227016675 --- /dev/null +++ b/package/utils/xfsprogs/patches/100-no-selftest.patch @@ -0,0 +1,14 @@ +--- a/libxfs/Makefile ++++ b/libxfs/Makefile +@@ -118,9 +118,9 @@ LTLIBS = $(LIBPTHREAD) $(LIBRT) + # don't try linking xfs_repair with a debug libxfs. + DEBUG = -DNDEBUG + +-LDIRT = gen_crc32table crc32table.h crc32selftest ++LDIRT = gen_crc32table crc32table.h + +-default: crc32selftest ltdepend $(LTLIBRARY) ++default: ltdepend $(LTLIBRARY) + + crc32table.h: gen_crc32table.c + @echo " [CC] gen_crc32table" diff --git a/package/utils/xfsprogs/patches/100-no_aio.patch b/package/utils/xfsprogs/patches/100-no_aio.patch deleted file mode 100644 index 4cc85d7de..000000000 --- a/package/utils/xfsprogs/patches/100-no_aio.patch +++ /dev/null @@ -1,19 +0,0 @@ -commit e72b7bd12fdef06c3494b919376bfe886aa8bb4d -Author: Jens Muecke -Date: Thu Jan 26 00:35:43 2012 +0100 - - 100-no_aio - ---- a/configure.in -+++ b/configure.in -@@ -92,8 +92,8 @@ AC_PACKAGE_GLOBALS(xfsprogs) - AC_PACKAGE_UTILITIES(xfsprogs) - AC_MULTILIB($enable_lib64) - --AC_PACKAGE_NEED_AIO_H --AC_PACKAGE_NEED_LIO_LISTIO -+librt="-lrt" -+AC_SUBST(librt) - - AC_PACKAGE_NEED_UUID_H - AC_PACKAGE_NEED_UUIDCOMPARE diff --git a/package/utils/xfsprogs/patches/110-subdirs.patch b/package/utils/xfsprogs/patches/110-subdirs.patch new file mode 100644 index 000000000..53a6b09ce --- /dev/null +++ b/package/utils/xfsprogs/patches/110-subdirs.patch @@ -0,0 +1,12 @@ +--- a/Makefile ++++ b/Makefile +@@ -46,8 +46,7 @@ HDR_SUBDIRS = include libxfs + + DLIB_SUBDIRS = libxlog libxcmd libhandle + LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) +-TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \ +- mdrestore repair rtcp m4 man doc debian ++TOOL_SUBDIRS = db fsck growfs io mkfs repair + + ifneq ("$(PKG_PLATFORM)","darwin") + TOOL_SUBDIRS += fsr diff --git a/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch b/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch deleted file mode 100644 index 5d5d08c8d..000000000 --- a/package/utils/xfsprogs/patches/110-uclibc_no_ustat.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 7b1d0a98e779170232c0a81b4749ab934ec67a7e -Author: Jens Muecke -Date: Thu Jan 26 00:36:42 2012 +0100 - - 110-uclibc_no_ustat - ---- a/libxfs/linux.c -+++ b/libxfs/linux.c -@@ -21,7 +21,6 @@ - #include - #include - #undef ustat --#include - #include - #include - #include -@@ -49,6 +48,7 @@ static int max_block_alignment; - int - platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose) - { -+#if 0 - /* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */ - struct ustat ust[2]; - struct stat64 st; -@@ -68,6 +68,7 @@ platform_check_ismounted(char *name, cha - progname, name); - return 1; - } -+#endif - return 0; - } - diff --git a/package/utils/xfsprogs/patches/120-disable_assert.patch b/package/utils/xfsprogs/patches/120-disable_assert.patch new file mode 100644 index 000000000..9a970d27a --- /dev/null +++ b/package/utils/xfsprogs/patches/120-disable_assert.patch @@ -0,0 +1,12 @@ +--- a/libxfs/libxfs_priv.h ++++ b/libxfs/libxfs_priv.h +@@ -84,9 +84,6 @@ extern uint32_t crc32c_le(uint32_t crc, + /* for all the support code that uses progname in error messages */ + extern char *progname; + +-#undef ASSERT +-#define ASSERT(ex) assert(ex) +- + #ifndef EWRONGFS + #define EWRONGFS EINVAL + #endif diff --git a/package/utils/xfsprogs/patches/120-portability.patch b/package/utils/xfsprogs/patches/120-portability.patch deleted file mode 100644 index 1d5905a67..000000000 --- a/package/utils/xfsprogs/patches/120-portability.patch +++ /dev/null @@ -1,45 +0,0 @@ -commit d2aef8b3967e53fe58178f5af50fef488ee0faed -Author: Jens Muecke -Date: Thu Jan 26 00:37:52 2012 +0100 - - 120-portability - ---- a/copy/xfs_copy.c -+++ b/copy/xfs_copy.c -@@ -463,6 +463,15 @@ read_ag_header(int fd, xfs_agnumber_t ag - } - - -+static void sig_mask(int type) -+{ -+ sigset_t mask; -+ sigemptyset(&mask); -+ sigaddset(&mask, SIGCHLD); -+ sigprocmask(type, &mask, NULL); -+} -+ -+ - void - write_wbuf(void) - { -@@ -478,9 +487,9 @@ write_wbuf(void) - if (target[i].state != INACTIVE) - pthread_mutex_unlock(&targ[i].wait); /* wake up */ - -- sigrelse(SIGCHLD); -+ sig_mask(SIG_UNBLOCK); - pthread_mutex_lock(&mainwait); -- sighold(SIGCHLD); -+ sig_mask(SIG_BLOCK); - } - - -@@ -847,7 +856,7 @@ main(int argc, char **argv) - /* set up sigchild signal handler */ - - signal(SIGCHLD, handler); -- sighold(SIGCHLD); -+ sig_mask(SIG_BLOCK); - - /* make children */ - diff --git a/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch b/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch deleted file mode 100644 index c5c4a2a2a..000000000 --- a/package/utils/xfsprogs/patches/130-uclibc_no_xattr.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 10d6058b24f18cb31889154f830b191849f45106 -Author: Jens Muecke -Date: Thu Jan 26 00:38:27 2012 +0100 - - 130-uclibc_no_xattr - ---- a/fsr/xfs_fsr.c -+++ b/fsr/xfs_fsr.c -@@ -35,7 +35,6 @@ - #include - #include - #include --#include - - - #ifndef XFS_XFLAG_NODEFRAG -@@ -990,6 +989,7 @@ fsr_setup_attr_fork( - int tfd, - xfs_bstat_t *bstatp) - { -+#if 0 - struct stat64 tstatbuf; - int i; - int last_forkoff = 0; -@@ -1108,6 +1108,7 @@ fsr_setup_attr_fork( - out: - if (dflag) - fsrprintf(_("set temp attr\n")); -+#endif - return 0; - } - diff --git a/package/utils/xfsprogs/patches/140-no_po.patch b/package/utils/xfsprogs/patches/140-no_po.patch deleted file mode 100644 index 640774453..000000000 --- a/package/utils/xfsprogs/patches/140-no_po.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/Makefile -+++ b/Makefile -@@ -41,7 +41,7 @@ endif - - LIB_SUBDIRS = libxfs libxlog libxcmd libhandle libdisk - TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ -- mdrestore repair rtcp m4 man doc po debian -+ mdrestore repair rtcp m4 man doc debian - - SUBDIRS = include $(LIB_SUBDIRS) $(TOOL_SUBDIRS) - -@@ -135,7 +135,6 @@ ifeq ($(HAVE_BUILDDEFS), no) - $(Q)$(MAKE) $(MAKEOPTS) -C . $@ - else - $(Q)$(MAKE) $(MAKEOPTS) $(SRCDIR) -- $(Q)$(MAKE) $(MAKEOPTS) -C po - $(Q)$(MAKE) $(MAKEOPTS) source-link - $(Q)cd $(SRCDIR) && dpkg-buildpackage - endif diff --git a/package/utils/xfsprogs/patches/150-include_fixes.patch b/package/utils/xfsprogs/patches/150-include_fixes.patch deleted file mode 100644 index 793622a16..000000000 --- a/package/utils/xfsprogs/patches/150-include_fixes.patch +++ /dev/null @@ -1,72 +0,0 @@ ---- a/libhandle/handle.c -+++ b/libhandle/handle.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - /* just pick a value we know is more than big enough */ - #define MAXHANSIZ 64 ---- a/libhandle/jdm.c -+++ b/libhandle/jdm.c -@@ -20,6 +20,7 @@ - #include - #include - #include -+#include - - /* internal fshandle - typecast to a void for external use */ - #define FSHANDLE_SZ 8 ---- a/libdisk/evms.c -+++ b/libdisk/evms.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include "evms.h" - ---- a/libdisk/evms.h -+++ b/libdisk/evms.h -@@ -16,6 +16,8 @@ - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -+#include -+ - #define EVMS_MAJOR 117 - #define EVMS_GET_VOL_STRIPE_INFO \ - _IOR(EVMS_MAJOR, 0xF0, struct evms_vol_stripe_info_s) ---- a/libdisk/fstype.h -+++ b/libdisk/fstype.h -@@ -192,7 +192,7 @@ struct adfs_super_block { - char s_dummy2[62]; - char s_checksum[1]; - }; --#define adfsblksize(s) ((uint) s.s_blksize[0]) -+#define adfsblksize(s) ((unsigned int) s.s_blksize[0]) - - /* found in first 4 bytes of block 1 */ - struct vxfs_super_block { ---- a/fsr/xfs_fsr.c -+++ b/fsr/xfs_fsr.c -@@ -25,6 +25,7 @@ - #include - #include - -+#include - #include - #include - #include ---- a/libdisk/xvm.c -+++ b/libdisk/xvm.c -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include "xvm.h" - diff --git a/package/utils/xfsprogs/patches/160-format-security.patch b/package/utils/xfsprogs/patches/160-format-security.patch deleted file mode 100644 index 5ae627d4a..000000000 --- a/package/utils/xfsprogs/patches/160-format-security.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Ben Myers -Date: Fri, 1 Feb 2013 21:50:22 +0000 (-0600) -Subject: xfsprogs: fix warning in libxcmd/input.c -X-Git-Tag: v3.1.11~25 -X-Git-Url: http://oss.sgi.com/cgi-bin/gitweb.cgi?p=xfs%2Fcmds%2Fxfsprogs.git;a=commitdiff_plain;h=50a3aa8977821ad072f3aa5b63645827f9b8ca1d - -xfsprogs: fix warning in libxcmd/input.c - -Fix an error when building with -Werror=format-security. - -input.c: In function 'fetchline': -input.c:91:2: error: format not a string literal and no format arguments [-Werror=format-security] - -Signed-off-by: Ben Myers -Reported by: Arkadiusz MiÅ›kiewicz -Reviewed-by: Mark Tinguely ---- - ---- a/libxcmd/input.c -+++ b/libxcmd/input.c -@@ -88,7 +88,7 @@ fetchline(void) - - if (!line) - return NULL; -- printf(get_prompt()); -+ printf("%s", get_prompt()); - fflush(stdout); - if (!fgets(line, MAXREADLINESZ, stdin)) { - free(line); diff --git a/scripts/combined-ext-image.sh b/scripts/combined-ext-image.sh index 0c7b1d993..7ff287bde 100755 --- a/scripts/combined-ext-image.sh +++ b/scripts/combined-ext-image.sh @@ -22,6 +22,8 @@ ## version history # * version 1: initial file format with num files / name / length / md5 checksum +set -e + ME="${0##*/}" usage() { @@ -38,7 +40,21 @@ IMG_OUT=$1; shift FILE_NUM=$(($# / 2)) FILES="" -printf "CE%02x%-32s%02x" $CE_VERSION "$IMG_TYPE" $FILE_NUM > $IMG_OUT +tmpdir="$( mktemp -d 2> /dev/null )" +if [ -z "$tmpdir" ]; then + # try OSX signature + tmpdir="$( mktemp -t 'ubitmp' -d )" +fi + +if [ -z "$tmpdir" ]; then + exit 1 +fi + +trap "rm -rf $tmpdir" EXIT + +IMG_TMP_OUT="${tmpdir}/out" + +printf "CE%02x%-32s%02x" $CE_VERSION "$IMG_TYPE" $FILE_NUM > "${IMG_TMP_OUT}" while [ "$#" -gt 1 ] do @@ -48,14 +64,15 @@ while [ "$#" -gt 1 ] [ ! -f "$file" ] && echo "$ME: Not a valid file: $file" && usage FILES="$FILES $file" md5=$(mkhash md5 "$file") - printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> $IMG_OUT + printf "%-32s%08x%32s" "$filename" $(stat -c "%s" "$file") "${md5%% *}" >> "${IMG_TMP_OUT}" shift 2 done [ "$#" -eq 1 ] && echo "$ME: Filename not specified: $1" && usage -mv $IMG_OUT $IMG_OUT.tmp -dd if="$IMG_OUT.tmp" of="$IMG_OUT" bs=65536 conv=sync 2>/dev/null -rm $IMG_OUT.tmp +mv "${IMG_TMP_OUT}" "${IMG_TMP_OUT}".tmp +dd if="${IMG_TMP_OUT}.tmp" of="${IMG_TMP_OUT}" bs=65536 conv=sync 2>/dev/null +rm "${IMG_TMP_OUT}".tmp -cat $FILES >> $IMG_OUT +cat $FILES >> "${IMG_TMP_OUT}" +cp "${IMG_TMP_OUT}" "${IMG_OUT}" diff --git a/scripts/feeds b/scripts/feeds index 55c294ad0..f49cdb3e4 100755 --- a/scripts/feeds +++ b/scripts/feeds @@ -32,12 +32,14 @@ $valid_mk or die "Unsupported version of make found: $mk\n"; my @feeds; my %build_packages; my %installed; +my %installed_pkg; my %installed_targets; my %feed_cache; my $feed_package = {}; my $feed_src = {}; my $feed_target = {}; +my $feed_vpackage = {}; sub parse_config() { my $line = 0; @@ -223,20 +225,21 @@ sub get_feed($) { parse_package_metadata($file) or return; my %target = get_targets("./feeds/$feed.targetindex"); - $feed_cache{$feed} = [ { %package }, { %srcpackage }, { %target } ]; + $feed_cache{$feed} = [ { %package }, { %srcpackage }, { %target }, { %vpackage } ]; } $feed_package = $feed_cache{$feed}->[0]; $feed_src = $feed_cache{$feed}->[1]; $feed_target = $feed_cache{$feed}->[2]; - return $feed_cache{$feed}->[0]; + $feed_vpackage = $feed_cache{$feed}->[3]; } sub get_installed() { system("$mk -s prepare-tmpinfo OPENWRT_BUILD="); clear_packages(); parse_package_metadata("./tmp/.packageinfo"); - %installed = %package; + %installed_pkg = %vpackage; + %installed = %srcpackage; %installed_targets = get_targets("./tmp/.targetinfo"); } @@ -252,7 +255,6 @@ sub search_feed { my $substr; my $pkgmatch = 1; - next if $pkg->{vdepends}; foreach my $substr (@substr) { my $match; foreach my $key (qw(name title description src)) { @@ -306,7 +308,6 @@ sub list_feed { get_feed($feed); foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { my $pkg = $feed_package->{$name}; - next if $pkg->{vdepends}; if($pkg->{name}) { printf "\%-32s\t\%s\n", $pkg->{name}, $pkg->{title}; } @@ -373,12 +374,12 @@ sub list { return 0; } -sub do_install_package($$) { +sub do_install_src($$) { my $feed = shift; - my $pkg = shift; - my $path = $pkg->{makefile}; + my $src = shift; - if($path) { + my $path = $src->{makefile}; + if ($path) { $path =~ s/\/Makefile$//; -d "./package/feeds" or mkdir "./package/feeds"; @@ -416,6 +417,18 @@ sub do_install_target($) { return 0; } +sub lookup_src($$) { + my $feed = shift; + my $src = shift; + + foreach my $feed ($feed, @feeds) { + next unless $feed->[1]; + next unless $feed_cache{$feed->[1]}; + $feed_cache{$feed->[1]}->[1]->{$src} and return $feed; + } + return; +} + sub lookup_package($$) { my $feed = shift; my $package = shift; @@ -423,7 +436,7 @@ sub lookup_package($$) { foreach my $feed ($feed, @feeds) { next unless $feed->[1]; next unless $feed_cache{$feed->[1]}; - $feed_cache{$feed->[1]}->[0]->{$package} and return $feed; + $feed_cache{$feed->[1]}->[3]->{$package} and return $feed; } return; } @@ -440,9 +453,9 @@ sub lookup_target($$) { return; } -sub is_core_package($) { - my $package = shift; - foreach my $file ("tmp/info/.packageinfo-$package", glob("tmp/info/.packageinfo-*_$package")) { +sub is_core_src($) { + my $src = shift; + foreach my $file ("tmp/info/.packageinfo-$src", glob("tmp/info/.packageinfo-*_$src")) { next unless index($file, "tmp/info/.packageinfo-feeds_"); return 1 if -s $file; } @@ -453,6 +466,8 @@ sub install_target { my $feed = shift; my $name = shift; + $installed_targets{$name} and return 0; + $feed = $feed_cache{$feed->[1]}->[2]; $feed or return 0; @@ -463,74 +478,71 @@ sub install_target { return do_install_target($target); } -sub install_package { +sub install_src { my $feed = shift; my $name = shift; my $force = shift; my $ret = 0; - my $this_feed_target = lookup_target($feed, $name); - $this_feed_target and do { - $installed_targets{$name} and return 0; - install_target($this_feed_target, $name); - return 0; - }; - - $feed = lookup_package($feed, $name); - $feed or do { + $feed = lookup_src($feed, $name); + unless ($feed) { $installed{$name} and return 0; - # TODO: check if it's already installed within ./package directory - $feed_src->{$name} or is_core_package($name) or warn "WARNING: No feed for package '$name' found, maybe it's already part of the standard packages?\n"; + $feed_src->{$name} or warn "WARNING: No feed for source package '$name' found\n"; return 0; - }; + } # switch to the metadata for the selected feed - my $cur = get_feed($feed->[1]); - - my $pkg = $cur->{$name} or return 1; - $pkg->{name} or do { - $installed{$name} and return 0; - # TODO: check if this is an alias package, maybe it's known by another name - warn "WARNING: Package '$name' is not available in feed $feed->[1].\n"; - return 0; - }; - my $src = $pkg->{src}; - my $type = $feed->[0]; - $src or $src = $name; + get_feed($feed->[1]); + my $src = $feed_src->{$name} or return 1; # If it's a core package and we don't want to override, just return - !$force and is_core_package($src) and return 0; + my $override = 0; + if (is_core_src($name)) { + return 0 unless $force; + $override = 1; + } - # previously installed packages set the runtime package - # newly installed packages set the source package to 1 - $installed{$src} and $installed{$src} == 1 and return 0; + if ($installed{$name}) { + # newly installed packages set the source package to 1 + return 0 if ($installed{$name} == 1); + return 0 unless ($override); + } - # we'll trigger the override only with the 3 conditions below: - # - override is allowed by command line (-f) - # - a package with the same src exists in the core packages list - # - the package previously installed is not from a feed - my $override = 1 if ($force and is_core_package($src) and !$installed{$name}->{feed}); + $installed{$name} = 1; + foreach my $pkg (@{$src->{packages}}) { + foreach my $vpkg (@{$pkg->{provides}}) { + $installed_pkg{$vpkg} = 1; + } + } - # check previously installed packages - $installed{$name} and !$override and return 0; - $installed{$src} = 1; + if ($override) { + warn "Overriding core package '$name' with version from $feed->[1]\n"; + } else { + warn "Installing package '$name' from $feed->[1]\n"; + } - defined($override) and $override == 1 - and warn "Overriding core package '$src' with version from $feed->[1]\n" - or warn "Installing package '$src' from $feed->[1]\n"; - - do_install_package($feed, $pkg) == 0 or do { + do_install_src($feed, $src) == 0 or do { warn "failed.\n"; return 1; }; # install all dependencies referenced from the source package - foreach my $vpkg (@{$feed_src->{$src}}) { - foreach my $dep (@{$vpkg->{depends}}, @{$vpkg->{builddepends}}, @{$vpkg->{"builddepends/host"}}) { + foreach my $dep ( + @{$src->{builddepends}}, + @{$src->{'builddepends/host'}}, + ) { + next if $dep =~ /@/; + $dep =~ s/^.+://; + $dep =~ s/\/.+$//; + next unless $dep; + install_src($feed, $dep, 0) == 0 or $ret = 1; + } + + foreach my $pkg (@{$src->{packages}}) { + foreach my $dep (@{$pkg->{depends}}) { next if $dep =~ /@/; $dep =~ s/^\+//; $dep =~ s/^.+://; - $dep =~ s/\/.+$//; next unless $dep; install_package($feed, $dep, 0) == 0 or $ret = 1; } @@ -539,6 +551,42 @@ sub install_package { return $ret; } +sub install_package { + my $feed = shift; + my $name = shift; + my $force = shift; + + $feed = lookup_package($feed, $name); + unless ($feed) { + $installed_pkg{$name} and return 0; + $feed_vpackage->{$name} or warn "WARNING: No feed for package '$name' found\n"; + return 0; + } + + # switch to the metadata for the selected feed + get_feed($feed->[1]); + my $pkg = $feed_vpackage->{$name} or return 1; + return install_src($feed, $pkg->[0]{src}{name}, $force); +} + +sub install_target_or_package { + my $feed = shift; + my $name = shift; + my $force = shift; + + my $this_feed_target = lookup_target($feed, $name); + $this_feed_target and do { + return install_target($this_feed_target, $name); + }; + + my $this_feed_src = lookup_src($feed, $name); + $this_feed_src and do { + return install_src($this_feed_src, $name, $force); + }; + + return install_package($feed, $name, $force); +} + sub refresh_config { my $default = shift; @@ -586,19 +634,15 @@ sub install { if (!defined($opts{p}) or $opts{p} eq $f->[1]) { printf "Installing all packages from feed %s.\n", $f->[1]; get_feed($f->[1]); - foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_package) { - my $p = $feed_package->{$name}; - next if $p->{vdepends}; - if( $p->{name} ) { - install_package($feed, $p->{name}, exists($opts{f})) == 0 or $ret = 1; - get_feed($f->[1]); - } + foreach my $name (sort { lc($a) cmp lc($b) } keys %$feed_src) { + install_src($feed, $name, exists($opts{f})) == 0 or $ret = 1; + get_feed($f->[1]); } } } } else { while ($name = shift @ARGV) { - install_package($feed, $name, exists($opts{f})) == 0 or $ret = 1; + install_target_or_package($feed, $name, exists($opts{f})) == 0 or $ret = 1; } } @@ -661,7 +705,7 @@ sub uninstall { warn "WARNING: $name not installed\n"; next; }; - $pkg->{src} and $name = $pkg->{src}; + $pkg->{src} and $name = $pkg->{src}{name}; warn "Uninstalling package '$name'\n"; system("rm -f ./package/feeds/*/$name"); $uninstall = 1; diff --git a/scripts/metadata.pm b/scripts/metadata.pm index d446892e2..ea3873538 100644 --- a/scripts/metadata.pm +++ b/scripts/metadata.pm @@ -2,14 +2,12 @@ package metadata; use base 'Exporter'; use strict; use warnings; -our @EXPORT = qw(%package %srcpackage %category %subdir %preconfig %features %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); +our @EXPORT = qw(%package %vpackage %srcpackage %category %overrides clear_packages parse_package_metadata parse_target_metadata get_multiline @ignore %usernames %groupnames); our %package; -our %preconfig; +our %vpackage; our %srcpackage; our %category; -our %subdir; -our %features; our %overrides; our @ignore; @@ -178,12 +176,10 @@ sub parse_target_metadata($) { } sub clear_packages() { - %subdir = (); - %preconfig = (); %package = (); + %vpackage = (); %srcpackage = (); %category = (); - %features = (); %overrides = (); %usernames = (); %groupnames = (); @@ -192,10 +188,6 @@ sub clear_packages() { sub parse_package_metadata($) { my $file = shift; my $pkg; - my $feature; - my $makefile; - my $preconfig; - my $subdir; my $src; my $override; my %ignore = map { $_ => 1 } @ignore; @@ -206,56 +198,44 @@ sub parse_package_metadata($) { }; while () { chomp; - /^Source-Makefile: \s*((.+\/)([^\/]+)\/Makefile)\s*$/ and do { - $makefile = $1; - $subdir = $2; - $src = $3; - $subdir =~ s/^package\///; - $subdir{$src} = $subdir; - $srcpackage{$src} = []; + /^Source-Makefile: \s*((?:package\/)?((?:.+\/)?([^\/]+))\/Makefile)\s*$/ and do { + $src = { + makefile => $1, + path => $2, + name => $3, + ignore => $ignore{$3}, + packages => [], + buildtypes => [], + builddepends => [], + }; + $srcpackage{$3} = $src; $override = ""; undef $pkg; }; /^Override: \s*(.+?)\s*$/ and do { $override = $1; - $overrides{$src} = 1; + $overrides{$src->{name}} = 1; }; next unless $src; /^Package:\s*(.+?)\s*$/ and do { - undef $feature; $pkg = {}; - $pkg->{ignore} = $ignore{$src}; $pkg->{src} = $src; - $pkg->{makefile} = $makefile; $pkg->{name} = $1; $pkg->{title} = ""; $pkg->{depends} = []; $pkg->{mdepends} = []; - $pkg->{builddepends} = []; - $pkg->{buildtypes} = []; - $pkg->{subdir} = $subdir; + $pkg->{provides} = [$1]; $pkg->{tristate} = 1; $pkg->{override} = $override; $package{$1} = $pkg; - push @{$srcpackage{$src}}, $pkg; - }; - /^Feature:\s*(.+?)\s*$/ and do { - undef $pkg; - $feature = {}; - $feature->{name} = $1; - $feature->{priority} = 0; - }; - $feature and do { - /^Target-Name:\s*(.+?)\s*$/ and do { - $features{$1} or $features{$1} = []; - push @{$features{$1}}, $feature unless $ignore{$src}; - }; - /^Target-Title:\s*(.+?)\s*$/ and $feature->{target_title} = $1; - /^Feature-Priority:\s*(\d+)\s*$/ and $feature->{priority} = $1; - /^Feature-Name:\s*(.+?)\s*$/ and $feature->{title} = $1; - /^Feature-Description:/ and $feature->{description} = get_multiline(\*FILE, "\t\t\t"); - next; + push @{$src->{packages}}, $pkg; + + $vpackage{$1} or $vpackage{$1} = []; + unshift @{$vpackage{$1}}, $pkg; }; + /^Build-Depends: \s*(.+)\s*$/ and $src->{builddepends} = [ split /\s+/, $1 ]; + /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $src->{"builddepends/$1"} = [ split /\s+/, $2 ]; + /^Build-Types:\s*(.+)\s*$/ and $src->{buildtypes} = [ split /\s+/, $1 ]; next unless $pkg; /^Version: \s*(.+)\s*$/ and $pkg->{version} = $1; /^Title: \s*(.+)\s*$/ and $pkg->{title} = $1; @@ -268,15 +248,10 @@ sub parse_package_metadata($) { /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1; /^Provides: \s*(.+)\s*$/ and do { my @vpkg = split /\s+/, $1; + @{$pkg->{provides}} = ($pkg->{name}, @vpkg); foreach my $vpkg (@vpkg) { - $package{$vpkg} or $package{$vpkg} = { - name => $vpkg, - vdepends => [], - src => $src, - subdir => $subdir, - makefile => $makefile - }; - push @{$package{$vpkg}->{vdepends}}, $pkg->{name}; + $vpackage{$vpkg} or $vpackage{$vpkg} = []; + push @{$vpackage{$vpkg}}, $pkg; } }; /^Menu-Depends: \s*(.+)\s*$/ and $pkg->{mdepends} = [ split /\s+/, $1 ]; @@ -286,15 +261,12 @@ sub parse_package_metadata($) { /^Build-Variant: \s*([\w\-]+)\s*/ and $pkg->{variant} = $1; /^Default-Variant: .*/ and $pkg->{variant_default} = 1; /^Build-Only: \s*(.+)\s*$/ and $pkg->{buildonly} = 1; - /^Build-Depends: \s*(.+)\s*$/ and $pkg->{builddepends} = [ split /\s+/, $1 ]; - /^Build-Depends\/(\w+): \s*(.+)\s*$/ and $pkg->{"builddepends/$1"} = [ split /\s+/, $2 ]; - /^Build-Types:\s*(.+)\s*$/ and $pkg->{buildtypes} = [ split /\s+/, $1 ]; /^Repository:\s*(.+?)\s*$/ and $pkg->{repository} = $1; /^Category: \s*(.+)\s*$/ and do { $pkg->{category} = $1; defined $category{$1} or $category{$1} = {}; - defined $category{$1}->{$src} or $category{$1}->{$src} = []; - push @{$category{$1}->{$src}}, $pkg; + defined $category{$1}{$src->{name}} or $category{$1}{$src->{name}} = []; + push @{$category{$1}{$src->{name}}}, $pkg; }; /^Description: \s*(.*)\s*$/ and $pkg->{description} = "\t\t $1\n". get_multiline(*FILE, "\t\t "); /^Type: \s*(.+)\s*$/ and do { @@ -306,29 +278,14 @@ sub parse_package_metadata($) { }; /^Config:\s*(.*)\s*$/ and $pkg->{config} = "$1\n".get_multiline(*FILE, "\t"); /^Prereq-Check:/ and $pkg->{prereq} = 1; - /^Preconfig:\s*(.+)\s*$/ and do { - my $pkgname = $pkg->{name}; - $preconfig{$pkgname} or $preconfig{$pkgname} = {}; - if (exists $preconfig{$pkgname}->{$1}) { - $preconfig = $preconfig{$pkgname}->{$1}; - } else { - $preconfig = { - id => $1 - }; - $preconfig{$pkgname}->{$1} = $preconfig unless $ignore{$src}; - } - }; - /^Preconfig-Type:\s*(.*?)\s*$/ and $preconfig->{type} = $1; - /^Preconfig-Label:\s*(.*?)\s*$/ and $preconfig->{label} = $1; - /^Preconfig-Default:\s*(.*?)\s*$/ and $preconfig->{default} = $1; /^Require-User:\s*(.*?)\s*$/ and do { my @ugspecs = split /\s+/, $1; for my $ugspec (@ugspecs) { my @ugspec = split /:/, $ugspec, 2; - parse_package_metadata_usergroup($makefile, "user", \%usernames, \%userids, $ugspec[0]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "user", \%usernames, \%userids, $ugspec[0]) or return 0; if (@ugspec > 1) { - parse_package_metadata_usergroup($makefile, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; + parse_package_metadata_usergroup($src->{makefile}, "group", \%groupnames, \%groupids, $ugspec[1]) or return 0; } } }; diff --git a/scripts/om-fwupgradecfg-gen.sh b/scripts/om-fwupgradecfg-gen.sh index 4960149f1..38e8e3ff3 100755 --- a/scripts/om-fwupgradecfg-gen.sh +++ b/scripts/om-fwupgradecfg-gen.sh @@ -7,7 +7,7 @@ # usage() { - echo "Usage: $0 " + echo "Usage: $0 " rm -f $CFG_OUT exit 1 } @@ -25,12 +25,24 @@ case $CE_TYPE in KERNEL_FLASH_ADDR=0x1c0000 FLASH_BS=262144 MD5_SKIP_BLOCKS=1 + SIZE_FACTOR=1 + SIZE_FORMAT="%d" ;; OM5P|OM5PAC|MR600|MR900|MR1750|A60) MAX_PART_SIZE=7808 KERNEL_FLASH_ADDR=0xb0000 FLASH_BS=65536 MD5_SKIP_BLOCKS=4 + SIZE_FACTOR=1 + SIZE_FORMAT="%d" + ;; + A42) + MAX_PART_SIZE=15616 + KERNEL_FLASH_ADDR=0x180000 + FLASH_BS=65536 + MD5_SKIP_BLOCKS=4 + SIZE_FACTOR=1024 + SIZE_FORMAT="0x%08x" ;; *) echo "Error - unsupported ce type: $CE_TYPE" @@ -43,16 +55,18 @@ CHECK_BS=65536 KERNEL_SIZE=$(stat -c%s "$KERNEL_PATH") KERNEL_MD5=$(mkhash md5 $KERNEL_PATH) KERNEL_SHA256=$(mkhash sha256 $KERNEL_PATH) -KERNEL_PART_SIZE=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE_KB=$(size=$(($KERNEL_SIZE / $FLASH_BS)); [ $(($size * $FLASH_BS)) -lt $KERNEL_SIZE ] && size=$(($size + 1)); echo $(($size * $FLASH_BS / 1024))) +KERNEL_PART_SIZE=$(printf $SIZE_FORMAT $(($KERNEL_PART_SIZE_KB * $SIZE_FACTOR))) -ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE * 1024))); printf "0x%x" $addr) +ROOTFS_FLASH_ADDR=$(addr=$(($KERNEL_FLASH_ADDR + ($KERNEL_PART_SIZE_KB * 1024))); printf "0x%x" $addr) ROOTFS_SIZE=$(stat -c%s "$ROOTFS_PATH") ROOTFS_CHECK_BLOCKS=$((($ROOTFS_SIZE / $CHECK_BS) - $MD5_SKIP_BLOCKS)) ROOTFS_MD5=$(dd if=$ROOTFS_PATH bs=$CHECK_BS count=$ROOTFS_CHECK_BLOCKS 2>&- | mkhash md5) ROOTFS_MD5_FULL=$(mkhash md5 $ROOTFS_PATH) ROOTFS_SHA256_FULL=$(mkhash sha256 $ROOTFS_PATH) ROOTFS_CHECK_SIZE=$(printf '0x%x' $(($ROOTFS_CHECK_BLOCKS * $CHECK_BS))) -ROOTFS_PART_SIZE=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE)) +ROOTFS_PART_SIZE_KB=$(($MAX_PART_SIZE - $KERNEL_PART_SIZE_KB)) +ROOTFS_PART_SIZE=$(printf $SIZE_FORMAT $(($ROOTFS_PART_SIZE_KB * $SIZE_FACTOR))) cat << EOF > $CFG_OUT [vmlinux] diff --git a/scripts/package-metadata.pl b/scripts/package-metadata.pl index fbd458bf2..53bb45a62 100755 --- a/scripts/package-metadata.pl +++ b/scripts/package-metadata.pl @@ -101,14 +101,16 @@ my %dep_check; sub __find_package_dep($$) { my $pkg = shift; my $name = shift; - my $deps = ($pkg->{vdepends} or $pkg->{depends}); + my $deps = $pkg->{depends}; return 0 unless defined $deps; - foreach my $dep (@{$deps}) { - next if $dep_check{$dep}; - $dep_check{$dep} = 1; - return 1 if $dep eq $name; - return 1 if ($package{$dep} and (__find_package_dep($package{$dep},$name) == 1)); + foreach my $vpkg (@{$deps}) { + foreach my $dep (@{$vpackage{$vpkg}}) { + next if $dep_check{$dep->{name}}; + $dep_check{$dep->{name}} = 1; + return 1 if $dep->{name} eq $name; + return 1 if (__find_package_dep($dep, $name) == 1); + } } return 0; } @@ -156,7 +158,6 @@ sub mconf_depends { my $m = "depends on"; my $flags = ""; $depend =~ s/^([@\+]+)// and $flags = $1; - my $vdep; my $condition = $parent_condition; next if $condition eq $depend; @@ -173,23 +174,21 @@ sub mconf_depends { } $depend = $2; } - next if $package{$depend} and $package{$depend}->{buildonly}; if ($flags =~ /\+/) { - if ($vdep = $package{$depend}->{vdepends}) { + my $vdep = $vpackage{$depend}; + if ($vdep) { my @vdeps; - $depend = undef; foreach my $v (@$vdep) { - if ($package{$v} && $package{$v}->{variant_default}) { - $depend = $v; + next if $v->{buildonly}; + if ($v->{variant_default}) { + unshift @vdeps, $v->{name}; } else { - push @vdeps, $v; + push @vdeps, $v->{name}; } } - if (!$depend) { - $depend = shift @vdeps; - } + $depend = shift @vdeps; if (@vdeps > 1) { $condition = ($condition ? "$condition && " : '') . '!('.join("||", map { "PACKAGE_".$_ } @vdeps).')'; @@ -209,8 +208,9 @@ sub mconf_depends { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } else { - if ($vdep = $package{$depend}->{vdepends}) { - $depend = join("||", map { "PACKAGE_".$_ } @$vdep); + my $vdep = $vpackage{$depend}; + if ($vdep && @$vdep > 0) { + $depend = join("||", map { "PACKAGE_".$_->{name} } @$vdep); } else { $flags =~ /@/ or $depend = "PACKAGE_$depend"; } @@ -290,7 +290,7 @@ sub print_package_config_category($) { print "menu \"$menu\"\n"; } foreach my $pkg (@pkgs) { - next if $pkg->{ignore}; + next if $pkg->{src}{ignore}; my $title = $pkg->{name}; my $c = (72 - length($pkg->{name}) - length($pkg->{title})); if ($c > 0) { @@ -337,31 +337,6 @@ sub print_package_config_category($) { undef $category{$cat}; } -sub print_package_features() { - keys %features > 0 or return; - print "menu \"Package features\"\n"; - foreach my $n (keys %features) { - my @features = sort { $b->{priority} <=> $a->{priority} or $a->{title} cmp $b->{title} } @{$features{$n}}; - print <{target_title}" - default FEATURE_$features[0]->{name} -EOF - - foreach my $feature (@features) { - print <{name} - bool "$feature->{title}" -EOF - $feature->{description} =~ /\w/ and do { - print "\t\thelp\n".$feature->{description}."\n"; - }; - } - print "endchoice\n" - } - print "endmenu\n\n"; -} - sub print_package_overrides() { keys %overrides > 0 or return; print "\tconfig OVERRIDE_PKGS\n"; @@ -372,24 +347,10 @@ sub print_package_overrides() { sub gen_package_config() { parse_package_metadata($ARGV[0]) or exit 1; print "menuconfig IMAGEOPT\n\tbool \"Image configuration\"\n\tdefault n\n"; - foreach my $preconfig (keys %preconfig) { - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - print <{$cfg}->{label}" if IMAGEOPT - depends on PACKAGE_$preconfig - default "$preconfig{$preconfig}->{$cfg}->{default}" - -EOF - } - } print "source \"package/*/image-config.in\"\n"; if (scalar glob "package/feeds/*/*/image-config.in") { print "source \"package/feeds/*/*/image-config.in\"\n"; } - print_package_features(); print_package_config_category 'Base system'; foreach my $cat (sort {uc($a) cmp uc($b)} keys %category) { print_package_config_category $cat; @@ -412,54 +373,88 @@ sub get_conditional_dep($$) { } sub gen_package_mk() { - my %conf; - my %dep; - my %done; my $line; parse_package_metadata($ARGV[0]) or exit 1; - foreach my $name (sort {uc($a) cmp uc($b)} keys %package) { - my $config; - my $pkg = $package{$name}; - my @srcdeps; + foreach my $srcname (sort {uc($a) cmp uc($b)} keys %srcpackage) { + my $src = $srcpackage{$srcname}; + my $variant_default; + my %deplines = ('' => {}); - next if defined $pkg->{vdepends}; + foreach my $pkg (@{$src->{packages}}) { + foreach my $dep (@{$pkg->{depends}}) { + next if ($dep =~ /@/); - $config = "\$(CONFIG_PACKAGE_$name)"; - if ($config) { - $pkg->{buildonly} and $config = ""; - print "package-$config += $pkg->{subdir}$pkg->{src}\n"; - if ($pkg->{variant}) { - if (!defined($done{$pkg->{src}}) or $pkg->{variant_default}) { - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/default-variant := $pkg->{variant}\n"; + my $condition; + + $dep =~ s/\+//g; + if ($dep =~ /^(.+):(.+)/) { + $condition = $1; + $dep = $2; + } + + my $vpkg_dep = $vpackage{$dep}; + unless (defined $vpkg_dep) { + warn sprintf "WARNING: Makefile '%s' has a dependency on '%s', which does not exist\n", + $src->{makefile}, $dep; + next; + } + + # Filter out self-depends + my @vdeps = grep { $srcname ne $_->{src}{name} } @{$vpkg_dep}; + + foreach my $vdep (@vdeps) { + my $depstr = sprintf '$(curdir)/%s/compile', $vdep->{src}{path}; + if (@vdeps > 1) { + $depstr = sprintf '$(if $(CONFIG_PACKAGE_%s),%s)', $vdep->{name}, $depstr; + } + my $depline = get_conditional_dep($condition, $depstr); + if ($depline) { + $deplines{''}{$depline}++; + } } - print "\$(curdir)/$pkg->{subdir}$pkg->{src}/variants += \$(if $config,$pkg->{variant})\n" } - $pkg->{prereq} and print "prereq-$config += $pkg->{subdir}$pkg->{src}\n"; - } - next if $done{$pkg->{src}}; - $done{$pkg->{src}} = 1; + my $config = ''; + $config = sprintf '$(CONFIG_PACKAGE_%s)', $pkg->{name} unless $pkg->{buildonly}; - if (@{$pkg->{buildtypes}} > 0) { - print "buildtypes-$pkg->{subdir}$pkg->{src} = ".join(' ', @{$pkg->{buildtypes}})."\n"; - } + $pkg->{prereq} and printf "prereq-%s += %s\n", $config, $src->{path}; - foreach my $spkg (@{$srcpackage{$pkg->{src}}}) { - foreach my $dep (@{$spkg->{depends}}, @{$spkg->{builddepends}}) { - $dep =~ /@/ or do { - $dep =~ s/\+//g; - push @srcdeps, $dep; - }; + next if $pkg->{buildonly}; + + printf "package-%s += %s\n", $config, $src->{path}; + + if ($pkg->{variant}) { + if (!defined($variant_default) or $pkg->{variant_default}) { + $variant_default = $pkg->{variant}; + } + printf "\$(curdir)/%s/variants += \$(if %s,%s)\n", $src->{path}, $config, $pkg->{variant}; } } - foreach my $type (@{$pkg->{buildtypes}}) { - my @extra_deps; - my %deplines; - next unless $pkg->{"builddepends/$type"}; - foreach my $dep (@{$pkg->{"builddepends/$type"}}) { - my $suffix = ""; + if (defined($variant_default)) { + printf "\$(curdir)/%s/default-variant := %s\n", $src->{path}, $variant_default; + } + + unless (grep {!$_->{buildonly}} @{$src->{packages}}) { + printf "package- += %s\n", $src->{path}; + } + + if (@{$src->{buildtypes}} > 0) { + printf "buildtypes-%s = %s\n", $src->{path}, join(' ', @{$src->{buildtypes}}); + } + + foreach my $type ('', @{$src->{buildtypes}}) { + my $suffix = ''; + + $suffix = "/$type" if $type; + + next unless $src->{"builddepends$suffix"}; + + defined $deplines{$suffix} or $deplines{$suffix} = {}; + + foreach my $dep (@{$src->{"builddepends$suffix"}}) { + my $depsuffix = ""; my $deptype = ""; my $condition; @@ -470,131 +465,37 @@ sub gen_package_mk() { if ($dep =~ /^(.+)\/(.+)/) { $dep = $1; $deptype = $2; - $suffix = "/$2"; + $depsuffix = "/$2"; } - my $idx = ""; - my $pkg_dep = $package{$dep}; - if (defined($pkg_dep) && defined($pkg_dep->{src})) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a %s build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $type, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; - next; - } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; - } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; - } else { + next if $srcname.$suffix eq $dep.$depsuffix; + + my $src_dep = $srcpackage{$dep}; + unless (defined($src_dep) && (!$deptype || grep { $_ eq $deptype } @{$src_dep->{buildtypes}})) { + warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s', which does not exist\n", + $src->{makefile}, $dep.$depsuffix; next; } - my $depstr = "\$(curdir)/$idx$suffix/compile"; + + my $depstr = sprintf '$(curdir)/%s/compile', $src_dep->{path}.$depsuffix; my $depline = get_conditional_dep($condition, $depstr); if ($depline) { - $deplines{$depline}++; + $deplines{$suffix}{$depline}++; } } - my $depline = join(" ", sort keys %deplines); + } + + foreach my $suffix (sort keys %deplines) { + my $depline = join(" ", sort keys %{$deplines{$suffix}}); if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/$type/compile += $depline\n"; + $line .= sprintf "\$(curdir)/%s/compile += %s\n", $src->{path}.$suffix, $depline; } } - - my $hasdeps = 0; - my %deplines; - foreach my $deps (@srcdeps) { - my $idx; - my $condition; - my $prefix = ""; - my $suffix = ""; - my $deptype = ""; - - if ($deps =~ /^(.+):(.+)/) { - $condition = $1; - $deps = $2; - } - if ($deps =~ /^(.+)\/(.+)/) { - $deps = $1; - $deptype = $2; - $suffix = "/$2"; - } - - my $pkg_dep = $package{$deps}; - my @deps; - - if ($pkg_dep->{vdepends}) { - @deps = @{$pkg_dep->{vdepends}}; - } else { - @deps = ($deps); - } - - foreach my $dep (@deps) { - $pkg_dep = $package{$deps}; - if (defined $pkg_dep->{src}) { - unless (!$deptype || grep { $_ eq $deptype } @{$pkg_dep->{buildtypes}}) { - warn sprintf "WARNING: Makefile '%s' has a build dependency on '%s/%s' but '%s' does not implement a '%s' build type\n", - $pkg->{makefile}, $pkg_dep->{src}, $deptype, $pkg_dep->{makefile}, $deptype; - next; - } - $idx = $pkg_dep->{subdir}.$pkg_dep->{src}; - } elsif (defined($srcpackage{$dep})) { - $idx = $subdir{$dep}.$dep; - } - undef $idx if $idx eq 'base-files'; - if ($idx) { - $idx .= $suffix; - - my $depline; - next if $pkg->{src} eq $pkg_dep->{src}.$suffix; - next if $dep{$condition.":".$pkg->{src}."->".$idx}; - next if $dep{$pkg->{src}."->($dep)".$idx} and $pkg_dep->{vdepends}; - my $depstr; - - if ($pkg_dep->{vdepends}) { - $depstr = "\$(if \$(CONFIG_PACKAGE_$dep),\$(curdir)/$idx/compile)"; - $dep{$pkg->{src}."->($dep)".$idx} = 1; - } else { - $depstr = "\$(curdir)/$idx/compile"; - $dep{$pkg->{src}."->".$idx} = 1; - } - $depline = get_conditional_dep($condition, $depstr); - if ($depline) { - $deplines{$depline}++; - } - } - } - } - my $depline = join(" ", sort keys %deplines); - if ($depline) { - $line .= "\$(curdir)/".$pkg->{subdir}."$pkg->{src}/compile += $depline\n"; - } } if ($line ne "") { print "\n$line"; } - foreach my $preconfig (keys %preconfig) { - my $cmds; - foreach my $cfg (keys %{$preconfig{$preconfig}}) { - my $conf = $preconfig{$preconfig}->{$cfg}->{id}; - $conf =~ tr/\.-/__/; - $cmds .= "\techo \"uci set '$preconfig{$preconfig}->{$cfg}->{id}=\$(subst \",,\$(CONFIG_UCI_PRECONFIG_$conf))'\"; \\\n"; - } - next unless $cmds; - print < \$@ - -ifneq (\$(IMAGEOPT)\$(CONFIG_IMAGEOPT),) - package/preconfig: \$(TARGET_DIR)/etc/uci-defaults/$preconfig -endif -endif - -EOF - } } sub gen_package_source() { @@ -633,7 +534,7 @@ sub gen_package_license($) { } else { if ($level == 1) { print "$pkg->{name}: Missing license! "; - print "Please fix $pkg->{makefile}\n"; + print "Please fix $pkg->{src}{makefile}\n"; } } } diff --git a/target/linux/apm821xx/Makefile b/target/linux/apm821xx/Makefile index 6d711543c..c3253322f 100644 --- a/target/linux/apm821xx/Makefile +++ b/target/linux/apm821xx/Makefile @@ -13,7 +13,7 @@ MAINTAINER:=Chris Blake , \ Christian Lamparter SUBTARGETS:=nand sata -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 define Target/Description Build images for AppliedMicro APM821xx based boards. diff --git a/target/linux/apm821xx/config-4.9 b/target/linux/apm821xx/config-4.14 similarity index 84% rename from target/linux/apm821xx/config-4.9 rename to target/linux/apm821xx/config-4.14 index c1c47a7bd..feaba21eb 100644 --- a/target/linux/apm821xx/config-4.9 +++ b/target/linux/apm821xx/config-4.14 @@ -12,15 +12,24 @@ CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y CONFIG_ARCH_HAS_DMA_SET_COHERENT_MASK=y CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_FORTIFY_SOURCE=y CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y -CONFIG_ARCH_HAS_ILOG2_U32=y CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y +# CONFIG_ARCH_HAS_STRICT_MODULE_RWX is not set CONFIG_ARCH_HAS_WALK_MEMORY=y CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG=y CONFIG_ARCH_HIBERNATION_POSSIBLE=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_MMAP_RND_BITS=11 +CONFIG_ARCH_MMAP_RND_BITS_MAX=17 +CONFIG_ARCH_MMAP_RND_BITS_MIN=11 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11 +CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y +# CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT is not set CONFIG_ARCH_PHYS_ADDR_T_64BIT=y # CONFIG_ARCH_RANDOM is not set CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y @@ -29,7 +38,9 @@ CONFIG_ARCH_SUPPORTS_DEFERRED_STRUCT_PAGE_INIT=y CONFIG_ARCH_SUPPORTS_UPROBES=y CONFIG_ARCH_SUSPEND_POSSIBLE=y CONFIG_ARCH_USE_BUILTIN_BSWAP=y +# CONFIG_ARCH_WANTS_THP_SWAP is not set CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y CONFIG_AUDIT_ARCH=y # CONFIG_BAMBOO is not set CONFIG_BCH=y @@ -44,20 +55,45 @@ CONFIG_CLONE_BACKWARDS=y CONFIG_CMDLINE="rootfstype=squashfs noinitrd" CONFIG_CMDLINE_BOOL=y CONFIG_CONSISTENT_SIZE=0x00200000 +CONFIG_CONSOLE_LOGLEVEL_DEFAULT=7 CONFIG_CPU_BIG_ENDIAN=y CONFIG_CRC16=y +CONFIG_CRYPTO_ACOMP2=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CCM=y +CONFIG_CRYPTO_CTR=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_DEV_PPC4XX=y +CONFIG_CRYPTO_DRBG=y +CONFIG_CRYPTO_DRBG_HMAC=y +CONFIG_CRYPTO_DRBG_MENU=y +CONFIG_CRYPTO_GCM=y +CONFIG_CRYPTO_GF128MUL=y +CONFIG_CRYPTO_GHASH=y CONFIG_CRYPTO_HASH=y CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_HMAC=y CONFIG_CRYPTO_HW=y +CONFIG_CRYPTO_JITTERENTROPY=y CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y CONFIG_CRYPTO_MD5_PPC=y +CONFIG_CRYPTO_NULL=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG=y CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_RNG_DEFAULT=y +CONFIG_CRYPTO_SEQIV=y CONFIG_CRYPTO_SHA1_PPC=y +CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_WORKQUEUE=y CONFIG_DECOMPRESS_GZIP=y # CONFIG_DEFAULT_UIMAGE is not set +# CONFIG_DMA_NOOP_OPS is not set +# CONFIG_DMA_VIRT_OPS is not set +# CONFIG_DRM_LIB_RANDOM is not set CONFIG_DTC=y # CONFIG_E200 is not set CONFIG_EARLY_PRINTK=y @@ -66,11 +102,14 @@ CONFIG_EDAC_ATOMIC_SCRUB=y CONFIG_EDAC_SUPPORT=y # CONFIG_EIGER is not set # CONFIG_EPAPR_BOOT is not set +CONFIG_EXPORTFS=y CONFIG_EXTRA_TARGETS="uImage" CONFIG_FIXED_PHY=y +# CONFIG_FORCE_SMP is not set CONFIG_FREEZER=y # CONFIG_FSL_LBC is not set # CONFIG_FSL_ULI1575 is not set +CONFIG_FUTEX_PI=y CONFIG_GENERIC_ATOMIC64=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_CLOCKEVENTS=y @@ -88,7 +127,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y CONFIG_GENERIC_STRNCPY_FROM_USER=y CONFIG_GENERIC_STRNLEN_USER=y # CONFIG_GENERIC_TBSYNC is not set -CONFIG_GENERIC_TIME_VSYSCALL_OLD=y +CONFIG_GENERIC_TIME_VSYSCALL=y # CONFIG_GEN_RTC is not set # CONFIG_GE_FPGA is not set # CONFIG_GLACIER is not set @@ -96,6 +135,7 @@ CONFIG_GPIOLIB=y CONFIG_GPIO_GENERIC=y CONFIG_GPIO_GENERIC_PLATFORM=y CONFIG_GPIO_SYSFS=y +# CONFIG_GRO_CELLS is not set CONFIG_HAS_DMA=y CONFIG_HAS_IOMEM=y CONFIG_HAS_IOPORT_MAP=y @@ -118,10 +158,12 @@ CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACER=y # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set -CONFIG_HAVE_GENERIC_RCU_GUP=y +CONFIG_HAVE_GENERIC_GUP=y CONFIG_HAVE_IDE=y CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KPROBES_ON_FTRACE=y CONFIG_HAVE_MEMBLOCK=y CONFIG_HAVE_MEMBLOCK_NODE_MAP=y CONFIG_HAVE_MOD_ARCH_SPECIFIC=y @@ -155,6 +197,7 @@ CONFIG_IBM_EMAC_TAH=y CONFIG_IBM_EMAC_TXB=128 # CONFIG_ICON is not set CONFIG_IKAREM=y +CONFIG_ILLEGAL_POINTER_VALUE=0 CONFIG_INITRAMFS_SOURCE="" # CONFIG_IOMMU_HELPER is not set # CONFIG_IPIC is not set @@ -173,10 +216,8 @@ CONFIG_LOWMEM_SIZE=0x30000000 CONFIG_LZO_COMPRESS=y CONFIG_LZO_DECOMPRESS=y # CONFIG_MATH_EMULATION is not set -CONFIG_MDIO_BOARDINFO=y -# CONFIG_MDIO_HISI_FEMAC is not set -# CONFIG_MFD_ACT8945A is not set -# CONFIG_MFD_MAX77620 is not set +CONFIG_MDIO_BUS=y +CONFIG_MDIO_DEVICE=y # CONFIG_MMIO_NVRAM is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MPIC is not set @@ -278,23 +319,25 @@ CONFIG_PPC_MMU_NOHASH=y CONFIG_PPC_MSI_BITMAP=y # CONFIG_PPC_P7_NAP is not set CONFIG_PPC_PCI_CHOICE=y +# CONFIG_PPC_PTDUMP is not set # CONFIG_PPC_RTAS is not set CONFIG_PPC_UDBG_16550=y CONFIG_PPC_WERROR=y # CONFIG_PPC_XICS is not set +# CONFIG_PPC_XIVE is not set +# CONFIG_PPC_XIVE_SPAPR is not set # CONFIG_PQ2ADS is not set +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 CONFIG_PTE_64BIT=y -# CONFIG_QORIQ_THERMAL is not set # CONFIG_RAINIER is not set CONFIG_RAS=y +# CONFIG_RCU_NEED_SEGCBLIST is not set # CONFIG_RCU_STALL_COMMON is not set CONFIG_RD_GZIP=y -# CONFIG_RELOCATABLE is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y # CONFIG_SAM440EP is not set # CONFIG_SCHED_INFO is not set # CONFIG_SCSI_DMA is not set -# CONFIG_SENSORS_TC654 is not set # CONFIG_SEQUOIA is not set CONFIG_SERIAL_8250_EXTENDED=y CONFIG_SERIAL_8250_FSL=y @@ -310,7 +353,10 @@ CONFIG_SWPHY=y CONFIG_SYSCTL_EXCEPTION_TRACE=y # CONFIG_TAISHAN is not set CONFIG_TASK_SIZE=0xc0000000 +CONFIG_THIN_ARCHIVES=y +CONFIG_THREAD_SHIFT=13 CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TINY_SRCU=y CONFIG_USB_SUPPORT=y CONFIG_VDSO32=y # CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set diff --git a/target/linux/apm821xx/dts/meraki-mr24.dts b/target/linux/apm821xx/dts/meraki-mr24.dts index 2c2f8d281..e06d37cbb 100644 --- a/target/linux/apm821xx/dts/meraki-mr24.dts +++ b/target/linux/apm821xx/dts/meraki-mr24.dts @@ -89,6 +89,18 @@ &EMAC0 { status = "okay"; + + phy-mode = "rgmii-id"; + phy-map = <0x2>; + phy-address = <0x1>; + phy-handle = <&phy>; + + mdio { + phy: phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; + }; }; &POB0 { diff --git a/target/linux/apm821xx/dts/netgear-wndr4700.dts b/target/linux/apm821xx/dts/netgear-wndr4700.dts index 2e0addf74..96cf97c45 100644 --- a/target/linux/apm821xx/dts/netgear-wndr4700.dts +++ b/target/linux/apm821xx/dts/netgear-wndr4700.dts @@ -99,17 +99,17 @@ map1 { trip = <&cpu_alert1>; - cooling-device = <&fan0 1 87>; + cooling-device = <&fan0 1 76>; }; map2 { trip = <&cpu_alert2>; - cooling-device = <&fan0 88 100>; + cooling-device = <&fan0 77 101>; }; map3 { trip = <&cpu_alert3>; - cooling-device = <&fan0 101 147>; + cooling-device = <&fan0 102 147>; }; map4 { diff --git a/target/linux/apm821xx/nand/config-default b/target/linux/apm821xx/nand/config-default index d6bdbd74e..ca6af461c 100644 --- a/target/linux/apm821xx/nand/config-default +++ b/target/linux/apm821xx/nand/config-default @@ -1,3 +1,4 @@ +CONFIG_AT803X_PHY=y CONFIG_AR8216_PHY=y CONFIG_DMADEVICES=y CONFIG_DMA_ENGINE=y @@ -9,6 +10,7 @@ CONFIG_IKAREM=y CONFIG_ATA=y CONFIG_ATA_SFF=y CONFIG_ATA_BMDMA=y +# CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set CONFIG_SATA_PMP=y CONFIG_GENERIC_PHY=y CONFIG_SATA_DWC=y @@ -22,6 +24,7 @@ CONFIG_LEDS_TRIGGER_DISK=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_M48T86=y CONFIG_THERMAL=y +CONFIG_THERMAL_EMERGENCY_POWEROFF_DELAY_MS=0 CONFIG_THERMAL_OF=y CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y CONFIG_THERMAL_HWMON=y @@ -36,6 +39,7 @@ CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 CONFIG_UBIFS_FS=y # CONFIG_UBIFS_FS_ADVANCED_COMPR is not set +CONFIG_USB_PCI=y CONFIG_SENSORS_LM90=y CONFIG_SENSORS_TC654=y CONFIG_SWCONFIG=y diff --git a/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch new file mode 100644 index 000000000..6f0cc6015 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/010-crypto-gcm-add-GCM-IV-size-constant.patch @@ -0,0 +1,27 @@ +From ef780324592dd639e4bfbc5b9bf8934b234b7c99 Mon Sep 17 00:00:00 2001 +From: Corentin LABBE +Date: Tue, 22 Aug 2017 10:08:08 +0200 +Subject: [PATCH] crypto: gcm - add GCM IV size constant + +Many GCM users use directly GCM IV size instead of using some constant. + +This patch add all IV size constant used by GCM. + +Signed-off-by: Corentin Labbe +Signed-off-by: Herbert Xu +--- + include/crypto/gcm.h | 8 ++++++++ + 1 file changed, 8 insertions(+) + create mode 100644 include/crypto/gcm.h + +--- /dev/null ++++ b/include/crypto/gcm.h +@@ -0,0 +1,8 @@ ++#ifndef _CRYPTO_GCM_H ++#define _CRYPTO_GCM_H ++ ++#define GCM_AES_IV_SIZE 12 ++#define GCM_RFC4106_IV_SIZE 8 ++#define GCM_RFC4543_IV_SIZE 8 ++ ++#endif diff --git a/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch new file mode 100644 index 000000000..8df0937e4 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0001-crypto-crypto4xx-remove-bad-list_del.patch @@ -0,0 +1,32 @@ +From a728a196d253530f17da5c86dc7dfbe58c5f7094 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:14 +0200 +Subject: [PATCH 01/25] crypto: crypto4xx - remove bad list_del + +alg entries are only added to the list, after the registration +was successful. If the registration failed, it was never added +to the list in the first place. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto + break; + } + +- if (rc) { +- list_del(&alg->entry); ++ if (rc) + kfree(alg); +- } else { ++ else + list_add_tail(&alg->entry, &sec_dev->alg_list); +- } + } + + return 0; diff --git a/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch new file mode 100644 index 000000000..598324634 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0002-crypto-crypto4xx-remove-unused-definitions-and-write.patch @@ -0,0 +1,120 @@ +From 81065f66dd99b3af58626a914b8c0fcff6b8b0ba Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:15 +0200 +Subject: [PATCH 02/25] crypto: crypto4xx - remove unused definitions and + write-only variables + +This patch removes several unused code and definitons +(structs, variables, ...). + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 6 ------ + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 16 ---------------- + 3 files changed, 1 insertion(+), 23 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -75,7 +75,6 @@ int crypto4xx_encrypt(struct ablkcipher_ + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->direction = DIR_OUTBOUND; +- ctx->hash_final = 0; + ctx->is_hash = 0; + ctx->pd_ctl = 0x1; + +@@ -89,7 +88,6 @@ int crypto4xx_decrypt(struct ablkcipher_ + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->direction = DIR_INBOUND; +- ctx->hash_final = 0; + ctx->is_hash = 0; + ctx->pd_ctl = 1; + +@@ -136,7 +134,6 @@ static int crypto4xx_setkey_aes(struct c + } + /* Setup SA */ + sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- ctx->hash_final = 0; + + set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, +@@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struc + + ctx->dev = my_alg->dev; + ctx->is_hash = 1; +- ctx->hash_final = 0; + + /* Create SA */ + if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) +@@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_r + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + + ctx->is_hash = 1; +- ctx->hash_final = 0; + ctx->pd_ctl = 0x11; + ctx->direction = DIR_INBOUND; + +@@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_r + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + +- ctx->hash_final = 1; + ctx->pd_ctl = 0x11; + ctx->direction = DIR_INBOUND; + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -962,7 +962,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + + sa->sa_command_1.bf.hash_crypto_offset = 0; + pd->pd_ctl.w = ctx->pd_ctl; +- pd->pd_ctl_len.w = 0x00400000 | (ctx->bypass << 24) | datalen; ++ pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE; + wmb(); + /* write any value to push engine to read a pd */ +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -72,7 +72,6 @@ struct pd_uinfo { + struct crypto4xx_device { + struct crypto4xx_core_device *core_dev; + char *name; +- u64 ce_phy_address; + void __iomem *ce_base; + void __iomem *trng_base; + +@@ -127,21 +126,9 @@ struct crypto4xx_ctx { + u32 sa_len; + u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ + u32 direction; +- u32 next_hdr; + u32 save_iv; +- u32 pd_ctl_len; + u32 pd_ctl; +- u32 bypass; + u32 is_hash; +- u32 hash_final; +-}; +- +-struct crypto4xx_req_ctx { +- struct crypto4xx_device *dev; /* Device in which +- operation to send to */ +- void *sa; +- u32 sa_dma_addr; +- u16 sa_len; + }; + + struct crypto4xx_alg_common { +@@ -172,9 +159,6 @@ static inline struct crypto4xx_alg *cryp + + extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); +-extern u32 crypto4xx_alloc_sa_rctx(struct crypto4xx_ctx *ctx, +- struct crypto4xx_ctx *rctx); +-extern void crypto4xx_free_sa_rctx(struct crypto4xx_ctx *rctx); + extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); + extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); diff --git a/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch new file mode 100644 index 000000000..e50a41828 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0003-crypto-crypto4xx-set-CRYPTO_ALG_KERN_DRIVER_ONLY-fla.patch @@ -0,0 +1,31 @@ +From 1ef52a95ea53c3c54b061e3f1af85976356c7132 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:16 +0200 +Subject: [PATCH 03/25] crypto: crypto4xx - set CRYPTO_ALG_KERN_DRIVER_ONLY + flag + +The security offload function is performed by a cryptographic +engine core attached to the 128-bit PLB (processor local bus) +with builtin DMA and interrupt controllers. This, I think, +satisfies the requirement for the CRYPTO_ALG_KERN_DRIVER_ONLY +flag. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1114,7 +1114,9 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_name = "cbc(aes)", + .cra_driver_name = "cbc-aes-ppc4xx", + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, +- .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | CRYPTO_ALG_ASYNC, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, diff --git a/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch new file mode 100644 index 000000000..cd61ac719 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0004-crypto-crypto4xx-remove-extern-statement-before-func.patch @@ -0,0 +1,76 @@ +From 886c251fd4ca40a27697afec7bc44c115e803d78 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:17 +0200 +Subject: [PATCH 04/25] crypto: crypto4xx - remove extern statement before + function declaration + +All function declarations are "extern" by default, there is no need to +specify it explicitly. + +For C99 states in 6.2.2.5: +"If the declaration of an identifier for a function has no +storage-class specifier, its linkage is determined exactly +as if it were declared with the storage-class specifier +extern." + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.h | 48 ++++++++++++++++++------------------ + 1 file changed, 24 insertions(+), 24 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -157,28 +157,28 @@ static inline struct crypto4xx_alg *cryp + return container_of(x, struct crypto4xx_alg, alg.u.cipher); + } + +-extern int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); +-extern void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); +-extern void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +-extern u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); +-extern u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); +-extern void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, int len); +-extern u32 crypto4xx_build_pd(struct crypto_async_request *req, +- struct crypto4xx_ctx *ctx, +- struct scatterlist *src, +- struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len); +-extern int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, +- const u8 *key, unsigned int keylen); +-extern int crypto4xx_encrypt(struct ablkcipher_request *req); +-extern int crypto4xx_decrypt(struct ablkcipher_request *req); +-extern int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); +-extern int crypto4xx_hash_digest(struct ahash_request *req); +-extern int crypto4xx_hash_final(struct ahash_request *req); +-extern int crypto4xx_hash_update(struct ahash_request *req); +-extern int crypto4xx_hash_init(struct ahash_request *req); ++int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); ++void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); ++void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); ++u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); ++u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); ++void crypto4xx_memcpy_le(unsigned int *dst, ++ const unsigned char *buf, int len); ++u32 crypto4xx_build_pd(struct crypto_async_request *req, ++ struct crypto4xx_ctx *ctx, ++ struct scatterlist *src, ++ struct scatterlist *dst, ++ unsigned int datalen, ++ void *iv, u32 iv_len); ++int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt(struct ablkcipher_request *req); ++int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); ++int crypto4xx_hash_digest(struct ahash_request *req); ++int crypto4xx_hash_final(struct ahash_request *req); ++int crypto4xx_hash_update(struct ahash_request *req); ++int crypto4xx_hash_init(struct ahash_request *req); + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch new file mode 100644 index 000000000..4fc361757 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0005-crypto-crypto4xx-remove-double-assignment-of-pd_uinf.patch @@ -0,0 +1,24 @@ +From c587e65deacf8c86de2d7c51f1e81d0a4a9147a8 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:18 +0200 +Subject: [PATCH 05/25] crypto: crypto4xx - remove double assignment of + pd_uinfo->state + +crypto4xx_put_pd_to_pdr() already clears the flag. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1079,7 +1079,6 @@ static void crypto4xx_bh_tasklet_cb(unsi + pd->pd_ctl.bf.pe_done = 0; + crypto4xx_pd_done(core_dev->dev, tail); + crypto4xx_put_pd_to_pdr(core_dev->dev, tail); +- pd_uinfo->state = PD_ENTRY_FREE; + } else { + /* if tail not done, break */ + break; diff --git a/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch new file mode 100644 index 000000000..84063d303 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0006-crypto-crypto4xx-fix-dynamic_sa_ctl-s-sa_contents-de.patch @@ -0,0 +1,87 @@ +From 453e3090b9c3f5da70b21648c2244e9821f0916d Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:19 +0200 +Subject: [PATCH 06/25] crypto: crypto4xx - fix dynamic_sa_ctl's sa_contents + declaration + +The driver had a union dynamic_sa_contents in place that +described the meaning of the bits in the sa_contents +variable. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 4 ++-- + drivers/crypto/amcc/crypto4xx_sa.c | 12 ++++++------ + drivers/crypto/amcc/crypto4xx_sa.h | 2 +- + 3 files changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -149,7 +149,7 @@ static int crypto4xx_setkey_aes(struct c + SA_NOT_COPY_HDR); + crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), + key, keylen); +- sa->sa_contents = SA_AES_CONTENTS | (keylen << 2); ++ sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; + ctx->direction = DIR_INBOUND; +@@ -219,7 +219,7 @@ static int crypto4xx_hash_alg_init(struc + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); + ctx->direction = DIR_INBOUND; +- sa->sa_contents = SA_HASH160_CONTENTS; ++ sa->sa_contents.w = SA_HASH160_CONTENTS; + sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; + /* Need to zero hash digest in SA */ + memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); +--- a/drivers/crypto/amcc/crypto4xx_sa.c ++++ b/drivers/crypto/amcc/crypto4xx_sa.c +@@ -40,9 +40,9 @@ u32 get_dynamic_sa_offset_state_ptr_fiel + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + offset = cts.bf.key_size + + cts.bf.inner_size + + cts.bf.outer_size +@@ -66,9 +66,9 @@ u32 get_dynamic_sa_iv_size(struct crypto + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4; + } + +@@ -77,9 +77,9 @@ u32 get_dynamic_sa_offset_key_field(stru + union dynamic_sa_contents cts; + + if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; + else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents; ++ cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; + + return sizeof(struct dynamic_sa_ctl); + } +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -169,7 +169,7 @@ union sa_command_1 { + } __attribute__((packed)); + + struct dynamic_sa_ctl { +- u32 sa_contents; ++ union dynamic_sa_contents sa_contents; + union sa_command_0 sa_command_0; + union sa_command_1 sa_command_1; + } __attribute__((packed)); diff --git a/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch new file mode 100644 index 000000000..c7c32e5d3 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0007-crypto-crypto4xx-move-and-refactor-dynamic_contents-.patch @@ -0,0 +1,234 @@ +From 249c8d98ea339325dca481d5dae93686cd494059 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:20 +0200 +Subject: [PATCH 07/25] crypto: crypto4xx - move and refactor dynamic_contents + helpers + +This patch refactors and moves the dynamic_contents helper +functions into the crypto4xx_sa.h header file. + + * get_dynamic_sa_iv_size is no longer needed, as the cryptoapi + provides the required IV size information as well. + + * refactor the function declarations to use the a pointer to the + dynamic_sa_contents union, instead of the crypto4xx_ctx. + + * rename get_dynamic_sa_offset_key_field to get_dynamic_sa_key_field. + It returns the pointer to the key directly. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/Makefile | 2 +- + drivers/crypto/amcc/crypto4xx_alg.c | 20 ++++----- + drivers/crypto/amcc/crypto4xx_core.h | 3 -- + drivers/crypto/amcc/crypto4xx_sa.c | 85 ------------------------------------ + drivers/crypto/amcc/crypto4xx_sa.h | 28 ++++++++++++ + 5 files changed, 39 insertions(+), 99 deletions(-) + delete mode 100644 drivers/crypto/amcc/crypto4xx_sa.c + +--- a/drivers/crypto/amcc/Makefile ++++ b/drivers/crypto/amcc/Makefile +@@ -1,3 +1,3 @@ + obj-$(CONFIG_CRYPTO_DEV_PPC4XX) += crypto4xx.o +-crypto4xx-y := crypto4xx_core.o crypto4xx_alg.o crypto4xx_sa.o ++crypto4xx-y := crypto4xx_core.o crypto4xx_alg.o + crypto4xx-$(CONFIG_HW_RANDOM_PPC4XX) += crypto4xx_trng.o +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -29,8 +29,8 @@ + #include + #include + #include "crypto4xx_reg_def.h" +-#include "crypto4xx_sa.h" + #include "crypto4xx_core.h" ++#include "crypto4xx_sa.h" + + static void set_dynamic_sa_command_0(struct dynamic_sa_ctl *sa, u32 save_h, + u32 save_iv, u32 ld_h, u32 ld_iv, +@@ -79,8 +79,8 @@ int crypto4xx_encrypt(struct ablkcipher_ + ctx->pd_ctl = 0x1; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- get_dynamic_sa_iv_size(ctx)); ++ req->nbytes, req->info, ++ crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) +@@ -92,8 +92,8 @@ int crypto4xx_decrypt(struct ablkcipher_ + ctx->pd_ctl = 1; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- get_dynamic_sa_iv_size(ctx)); ++ req->nbytes, req->info, ++ crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); + } + + /** +@@ -147,15 +147,15 @@ static int crypto4xx_setkey_aes(struct c + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), ++ crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa), + key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; + ctx->direction = DIR_INBOUND; +- memcpy(ctx->sa_in + get_dynamic_sa_offset_state_ptr_field(ctx), +- (void *)&ctx->state_record_dma_addr, 4); +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); ++ memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa), ++ (void *)&ctx->state_record_dma_addr, 4); ++ ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); + sa = (struct dynamic_sa_ctl *) ctx->sa_out; +@@ -225,7 +225,7 @@ static int crypto4xx_hash_alg_init(struc + memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); + memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest)); + sa_in->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); ++ ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + return 0; + } +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -161,9 +161,6 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx); +-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx); + void crypto4xx_memcpy_le(unsigned int *dst, + const unsigned char *buf, int len); + u32 crypto4xx_build_pd(struct crypto_async_request *req, +--- a/drivers/crypto/amcc/crypto4xx_sa.c ++++ /dev/null +@@ -1,85 +0,0 @@ +-/** +- * AMCC SoC PPC4xx Crypto Driver +- * +- * Copyright (c) 2008 Applied Micro Circuits Corporation. +- * All rights reserved. James Hsiao +- * +- * This program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * This program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * @file crypto4xx_sa.c +- * +- * This file implements the security context +- * associate format. +- */ +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include "crypto4xx_reg_def.h" +-#include "crypto4xx_sa.h" +-#include "crypto4xx_core.h" +- +-u32 get_dynamic_sa_offset_state_ptr_field(struct crypto4xx_ctx *ctx) +-{ +- u32 offset; +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- offset = cts.bf.key_size +- + cts.bf.inner_size +- + cts.bf.outer_size +- + cts.bf.spi +- + cts.bf.seq_num0 +- + cts.bf.seq_num1 +- + cts.bf.seq_num_mask0 +- + cts.bf.seq_num_mask1 +- + cts.bf.seq_num_mask2 +- + cts.bf.seq_num_mask3 +- + cts.bf.iv0 +- + cts.bf.iv1 +- + cts.bf.iv2 +- + cts.bf.iv3; +- +- return sizeof(struct dynamic_sa_ctl) + offset * 4; +-} +- +-u32 get_dynamic_sa_iv_size(struct crypto4xx_ctx *ctx) +-{ +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- return (cts.bf.iv0 + cts.bf.iv1 + cts.bf.iv2 + cts.bf.iv3) * 4; +-} +- +-u32 get_dynamic_sa_offset_key_field(struct crypto4xx_ctx *ctx) +-{ +- union dynamic_sa_contents cts; +- +- if (ctx->direction == DIR_INBOUND) +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_in)->sa_contents.w; +- else +- cts.w = ((struct dynamic_sa_ctl *) ctx->sa_out)->sa_contents.w; +- +- return sizeof(struct dynamic_sa_ctl); +-} +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -240,4 +240,32 @@ struct dynamic_sa_hash160 { + #define SA_HASH160_LEN (sizeof(struct dynamic_sa_hash160)/4) + #define SA_HASH160_CONTENTS 0x2000a502 + ++static inline u32 ++get_dynamic_sa_offset_state_ptr_field(struct dynamic_sa_ctl *cts) ++{ ++ u32 offset; ++ ++ offset = cts->sa_contents.bf.key_size ++ + cts->sa_contents.bf.inner_size ++ + cts->sa_contents.bf.outer_size ++ + cts->sa_contents.bf.spi ++ + cts->sa_contents.bf.seq_num0 ++ + cts->sa_contents.bf.seq_num1 ++ + cts->sa_contents.bf.seq_num_mask0 ++ + cts->sa_contents.bf.seq_num_mask1 ++ + cts->sa_contents.bf.seq_num_mask2 ++ + cts->sa_contents.bf.seq_num_mask3 ++ + cts->sa_contents.bf.iv0 ++ + cts->sa_contents.bf.iv1 ++ + cts->sa_contents.bf.iv2 ++ + cts->sa_contents.bf.iv3; ++ ++ return sizeof(struct dynamic_sa_ctl) + offset * 4; ++} ++ ++static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++{ ++ return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++} ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch new file mode 100644 index 000000000..9977c60d2 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0008-crypto-crypto4xx-enable-AES-RFC3686-ECB-CFB-and-OFB-.patch @@ -0,0 +1,248 @@ +From f2a13e7cba9e2b16f4888fbd9cf2bc25b95945be Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:21 +0200 +Subject: [PATCH 08/25] crypto: crypto4xx - enable AES RFC3686, ECB, CFB and + OFB offloads + +The crypto engine supports more than just aes-cbc. This patch +enables the remaining AES block cipher modes that pass the +testmanager's test vectors. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 66 ++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 98 ++++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.h | 10 ++++ + drivers/crypto/amcc/crypto4xx_sa.h | 3 ++ + 4 files changed, 177 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -171,6 +172,71 @@ int crypto4xx_setkey_aes_cbc(struct cryp + CRYPTO_FEEDBACK_MODE_NO_FB); + } + ++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CFB, ++ CRYPTO_FEEDBACK_MODE_128BIT_CFB); ++} ++ ++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_ECB, ++ CRYPTO_FEEDBACK_MODE_NO_FB); ++} ++ ++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_OFB, ++ CRYPTO_FEEDBACK_MODE_64BIT_OFB); ++} ++ ++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_ablkcipher_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ int rc; ++ ++ rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE, ++ CRYPTO_MODE_CTR, CRYPTO_FEEDBACK_MODE_NO_FB); ++ if (rc) ++ return rc; ++ ++ memcpy(ctx->state_record, ++ key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); ++ ++ return 0; ++} ++ ++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, ++ *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; ++ ++ ctx->direction = DIR_OUTBOUND; ++ ctx->pd_ctl = 1; ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ req->nbytes, iv, AES_IV_SIZE); ++} ++ ++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, ++ *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; ++ ++ ctx->direction = DIR_INBOUND; ++ ctx->pd_ctl = 1; ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ req->nbytes, iv, AES_IV_SIZE); ++} ++ + /** + * HASH SHA1 Functions + */ +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -36,6 +36,7 @@ + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -1133,6 +1134,103 @@ struct crypto4xx_alg_common crypto4xx_al + } + } + }}, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "cfb(aes)", ++ .cra_driver_name = "cfb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .ivsize = AES_IV_SIZE, ++ .setkey = crypto4xx_setkey_aes_cfb, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "rfc3686(ctr(aes))", ++ .cra_driver_name = "rfc3686-ctr-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE + ++ CTR_RFC3686_NONCE_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE + ++ CTR_RFC3686_NONCE_SIZE, ++ .ivsize = CTR_RFC3686_IV_SIZE, ++ .setkey = crypto4xx_setkey_rfc3686, ++ .encrypt = crypto4xx_rfc3686_encrypt, ++ .decrypt = crypto4xx_rfc3686_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "ecb(aes)", ++ .cra_driver_name = "ecb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .setkey = crypto4xx_setkey_aes_ecb, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, ++ { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { ++ .cra_name = "ofb(aes)", ++ .cra_driver_name = "ofb-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER | ++ CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = AES_BLOCK_SIZE, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_type = &crypto_ablkcipher_type, ++ .cra_init = crypto4xx_alg_init, ++ .cra_exit = crypto4xx_alg_exit, ++ .cra_module = THIS_MODULE, ++ .cra_u = { ++ .ablkcipher = { ++ .min_keysize = AES_MIN_KEY_SIZE, ++ .max_keysize = AES_MAX_KEY_SIZE, ++ .ivsize = AES_IV_SIZE, ++ .setkey = crypto4xx_setkey_aes_cbc, ++ .encrypt = crypto4xx_encrypt, ++ .decrypt = crypto4xx_decrypt, ++ } ++ } ++ } }, + }; + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -171,8 +171,18 @@ u32 crypto4xx_build_pd(struct crypto_asy + void *iv, u32 iv_len); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_ecb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_aes_ofb(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, ++ const u8 *key, unsigned int keylen); + int crypto4xx_encrypt(struct ablkcipher_request *req); + int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req); ++int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req); + int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); + int crypto4xx_hash_digest(struct ahash_request *req); + int crypto4xx_hash_final(struct ahash_request *req); +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -112,6 +112,9 @@ union sa_command_0 { + + #define CRYPTO_MODE_ECB 0 + #define CRYPTO_MODE_CBC 1 ++#define CRYPTO_MODE_OFB 2 ++#define CRYPTO_MODE_CFB 3 ++#define CRYPTO_MODE_CTR 4 + + #define CRYPTO_FEEDBACK_MODE_NO_FB 0 + #define CRYPTO_FEEDBACK_MODE_64BIT_OFB 0 diff --git a/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch new file mode 100644 index 000000000..c6ccade8c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0009-crypto-crypto4xx-refactor-crypto4xx_copy_pkt_to_dst.patch @@ -0,0 +1,171 @@ +From 5c727f92ea5e019fd216f73009eee2b6e0867726 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:22 +0200 +Subject: [PATCH 09/25] crypto: crypto4xx - refactor + crypto4xx_copy_pkt_to_dst() + +This patch refactors the crypto4xx_copy_pkt_to_dst() to use +scatterwalk_map_and_copy() to copy the processed data between +the crypto engine's scatter ring buffer and the destination +specified by the ablkcipher_request. + +This also makes the crypto4xx_fill_one_page() function redundant. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 126 +++++++++-------------------------- + 1 file changed, 30 insertions(+), 96 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -481,111 +482,44 @@ static inline struct ce_sd *crypto4xx_ge + return (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx); + } + +-static u32 crypto4xx_fill_one_page(struct crypto4xx_device *dev, +- dma_addr_t *addr, u32 *length, +- u32 *idx, u32 *offset, u32 *nbytes) +-{ +- u32 len; +- +- if (*length > dev->scatter_buffer_size) { +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, +- dev->scatter_buffer_size); +- *offset = 0; +- *length -= dev->scatter_buffer_size; +- *nbytes -= dev->scatter_buffer_size; +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- *addr = *addr + dev->scatter_buffer_size; +- return 1; +- } else if (*length < dev->scatter_buffer_size) { +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, *length); +- if ((*offset + *length) == dev->scatter_buffer_size) { +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- *nbytes -= *length; +- *offset = 0; +- } else { +- *nbytes -= *length; +- *offset += *length; +- } +- +- return 0; +- } else { +- len = (*nbytes <= dev->scatter_buffer_size) ? +- (*nbytes) : dev->scatter_buffer_size; +- memcpy(phys_to_virt(*addr), +- dev->scatter_buffer_va + +- *idx * dev->scatter_buffer_size + *offset, +- len); +- *offset = 0; +- *nbytes -= len; +- +- if (*idx == PPC4XX_LAST_SD) +- *idx = 0; +- else +- (*idx)++; +- +- return 0; +- } +-} +- + static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev, + struct ce_pd *pd, + struct pd_uinfo *pd_uinfo, + u32 nbytes, + struct scatterlist *dst) + { +- dma_addr_t addr; +- u32 this_sd; +- u32 offset; +- u32 len; +- u32 i; +- u32 sg_len; +- struct scatterlist *sg; +- +- this_sd = pd_uinfo->first_sd; +- offset = 0; +- i = 0; ++ unsigned int first_sd = pd_uinfo->first_sd; ++ unsigned int last_sd; ++ unsigned int overflow = 0; ++ unsigned int to_copy; ++ unsigned int dst_start = 0; ++ ++ /* ++ * Because the scatter buffers are all neatly organized in one ++ * big continuous ringbuffer; scatterwalk_map_and_copy() can ++ * be instructed to copy a range of buffers in one go. ++ */ ++ ++ last_sd = (first_sd + pd_uinfo->num_sd); ++ if (last_sd > PPC4XX_LAST_SD) { ++ last_sd = PPC4XX_LAST_SD; ++ overflow = last_sd % PPC4XX_NUM_SD; ++ } + + while (nbytes) { +- sg = &dst[i]; +- sg_len = sg->length; +- addr = dma_map_page(dev->core_dev->device, sg_page(sg), +- sg->offset, sg->length, DMA_TO_DEVICE); +- +- if (offset == 0) { +- len = (nbytes <= sg->length) ? nbytes : sg->length; +- while (crypto4xx_fill_one_page(dev, &addr, &len, +- &this_sd, &offset, &nbytes)) +- ; +- if (!nbytes) +- return; +- i++; +- } else { +- len = (nbytes <= (dev->scatter_buffer_size - offset)) ? +- nbytes : (dev->scatter_buffer_size - offset); +- len = (sg->length < len) ? sg->length : len; +- while (crypto4xx_fill_one_page(dev, &addr, &len, +- &this_sd, &offset, &nbytes)) +- ; +- if (!nbytes) +- return; +- sg_len -= len; +- if (sg_len) { +- addr += len; +- while (crypto4xx_fill_one_page(dev, &addr, +- &sg_len, &this_sd, &offset, &nbytes)) +- ; +- } +- i++; ++ void *buf = dev->scatter_buffer_va + ++ first_sd * PPC4XX_SD_BUFFER_SIZE; ++ ++ to_copy = min(nbytes, PPC4XX_SD_BUFFER_SIZE * ++ (1 + last_sd - first_sd)); ++ scatterwalk_map_and_copy(buf, dst, dst_start, to_copy, 1); ++ nbytes -= to_copy; ++ ++ if (overflow) { ++ first_sd = 0; ++ last_sd = overflow; ++ dst_start += to_copy; ++ overflow = 0; + } + } + } diff --git a/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch new file mode 100644 index 000000000..90a6dab2d --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0010-crypto-crypto4xx-replace-crypto4xx_dev-s-scatter_buf.patch @@ -0,0 +1,59 @@ +From 40e3b847bff70edc28c5290d209e531da6f9e534 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:23 +0200 +Subject: [PATCH 10/25] crypto: crypto4xx - replace crypto4xx_dev's + scatter_buffer_size with constant + +scatter_buffer_size is always set to PPC4XX_SD_BUFFER_SIZE. +I don't think there's any point in keeping the variable +around. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 7 +++---- + drivers/crypto/amcc/crypto4xx_core.h | 1 - + 2 files changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -394,10 +394,9 @@ static u32 crypto4xx_build_sdr(struct cr + if (!dev->sdr) + return -ENOMEM; + +- dev->scatter_buffer_size = PPC4XX_SD_BUFFER_SIZE; + dev->scatter_buffer_va = + dma_alloc_coherent(dev->core_dev->device, +- dev->scatter_buffer_size * PPC4XX_NUM_SD, ++ PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + &dev->scatter_buffer_pa, GFP_ATOMIC); + if (!dev->scatter_buffer_va) { + dma_free_coherent(dev->core_dev->device, +@@ -410,7 +409,7 @@ static u32 crypto4xx_build_sdr(struct cr + + for (i = 0; i < PPC4XX_NUM_SD; i++) { + sd_array[i].ptr = dev->scatter_buffer_pa + +- dev->scatter_buffer_size * i; ++ PPC4XX_SD_BUFFER_SIZE * i; + } + + return 0; +@@ -425,7 +424,7 @@ static void crypto4xx_destroy_sdr(struct + + if (dev->scatter_buffer_va != NULL) + dma_free_coherent(dev->core_dev->device, +- dev->scatter_buffer_size * PPC4XX_NUM_SD, ++ PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + dev->scatter_buffer_va, + dev->scatter_buffer_pa); + } +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -87,7 +87,6 @@ struct crypto4xx_device { + program ce sdr_base_register */ + void *scatter_buffer_va; + dma_addr_t scatter_buffer_pa; +- u32 scatter_buffer_size; + + void *shadow_sa_pool; /* pool of memory for sa in pd_uinfo */ + dma_addr_t shadow_sa_pool_pa; diff --git a/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch new file mode 100644 index 000000000..837fbdc54 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0011-crypto-crypto4xx-fix-crypto4xx_build_pdr-crypto4xx_b.patch @@ -0,0 +1,84 @@ +From 5d59ad6eea82ef8df92b4109615a0dde9d8093e9 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:24 +0200 +Subject: [PATCH 11/25] crypto: crypto4xx - fix crypto4xx_build_pdr, + crypto4xx_build_sdr leak + +If one of the later memory allocations in rypto4xx_build_pdr() +fails: dev->pdr (and/or) dev->pdr_uinfo wouldn't be freed. + +crypto4xx_build_sdr() has the same issue with dev->sdr. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -209,7 +209,7 @@ static u32 crypto4xx_build_pdr(struct cr + dev->pdr_pa); + return -ENOMEM; + } +- memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); ++ memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); + dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, + 256 * PPC4XX_NUM_PD, + &dev->shadow_sa_pool_pa, +@@ -242,13 +242,15 @@ static u32 crypto4xx_build_pdr(struct cr + + static void crypto4xx_destroy_pdr(struct crypto4xx_device *dev) + { +- if (dev->pdr != NULL) ++ if (dev->pdr) + dma_free_coherent(dev->core_dev->device, + sizeof(struct ce_pd) * PPC4XX_NUM_PD, + dev->pdr, dev->pdr_pa); ++ + if (dev->shadow_sa_pool) + dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, + dev->shadow_sa_pool, dev->shadow_sa_pool_pa); ++ + if (dev->shadow_sr_pool) + dma_free_coherent(dev->core_dev->device, + sizeof(struct sa_state_record) * PPC4XX_NUM_PD, +@@ -417,12 +419,12 @@ static u32 crypto4xx_build_sdr(struct cr + + static void crypto4xx_destroy_sdr(struct crypto4xx_device *dev) + { +- if (dev->sdr != NULL) ++ if (dev->sdr) + dma_free_coherent(dev->core_dev->device, + sizeof(struct ce_sd) * PPC4XX_NUM_SD, + dev->sdr, dev->sdr_pa); + +- if (dev->scatter_buffer_va != NULL) ++ if (dev->scatter_buffer_va) + dma_free_coherent(dev->core_dev->device, + PPC4XX_SD_BUFFER_SIZE * PPC4XX_NUM_SD, + dev->scatter_buffer_va, +@@ -1223,7 +1225,7 @@ static int crypto4xx_probe(struct platfo + + rc = crypto4xx_build_gdr(core_dev->dev); + if (rc) +- goto err_build_gdr; ++ goto err_build_pdr; + + rc = crypto4xx_build_sdr(core_dev->dev); + if (rc) +@@ -1266,12 +1268,11 @@ err_iomap: + err_request_irq: + irq_dispose_mapping(core_dev->irq); + tasklet_kill(&core_dev->tasklet); +- crypto4xx_destroy_sdr(core_dev->dev); + err_build_sdr: ++ crypto4xx_destroy_sdr(core_dev->dev); + crypto4xx_destroy_gdr(core_dev->dev); +-err_build_gdr: +- crypto4xx_destroy_pdr(core_dev->dev); + err_build_pdr: ++ crypto4xx_destroy_pdr(core_dev->dev); + kfree(core_dev->dev); + err_alloc_dev: + kfree(core_dev); diff --git a/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch new file mode 100644 index 000000000..ee7ee1191 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0012-crypto-crypto4xx-pointer-arithmetic-overhaul.patch @@ -0,0 +1,373 @@ +From 9e0a0b3a192af20193f074ed2ad9dd85a2e48d00 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 25 Aug 2017 15:47:25 +0200 +Subject: [PATCH 12/25] crypto: crypto4xx - pointer arithmetic overhaul + +This patch improves the readability of various functions, +by replacing various void* pointers declarations with +their respective structs *. This makes it possible to go +for the eye-friendly array-indexing methods. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 26 ++++++++-------- + drivers/crypto/amcc/crypto4xx_core.c | 60 +++++++++++++++--------------------- + drivers/crypto/amcc/crypto4xx_core.h | 41 +++++++++++++----------- + 3 files changed, 59 insertions(+), 68 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -134,7 +134,7 @@ static int crypto4xx_setkey_aes(struct c + } + } + /* Setup SA */ +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + + set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, +@@ -159,7 +159,7 @@ static int crypto4xx_setkey_aes(struct c + ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); +- sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa = ctx->sa_out; + sa->sa_command_0.bf.dir = DIR_OUTBOUND; + + return 0; +@@ -248,8 +248,7 @@ static int crypto4xx_hash_alg_init(struc + struct crypto_alg *alg = tfm->__crt_alg; + struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- struct dynamic_sa_ctl *sa; +- struct dynamic_sa_hash160 *sa_in; ++ struct dynamic_sa_hash160 *sa; + int rc; + + ctx->dev = my_alg->dev; +@@ -273,25 +272,24 @@ static int crypto4xx_hash_alg_init(struc + + crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), + sizeof(struct crypto4xx_ctx)); +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ sa = (struct dynamic_sa_hash160 *)ctx->sa_in; ++ set_dynamic_sa_command_0(&sa->ctrl, SA_SAVE_HASH, SA_NOT_SAVE_IV, + SA_NOT_LOAD_HASH, SA_LOAD_IV_FROM_SA, + SA_NO_HEADER_PROC, ha, SA_CIPHER_ALG_NULL, + SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, + SA_OPCODE_HASH, DIR_INBOUND); +- set_dynamic_sa_command_1(sa, 0, SA_HASH_MODE_HASH, ++ set_dynamic_sa_command_1(&sa->ctrl, 0, SA_HASH_MODE_HASH, + CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); + ctx->direction = DIR_INBOUND; +- sa->sa_contents.w = SA_HASH160_CONTENTS; +- sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; + /* Need to zero hash digest in SA */ +- memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); +- memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest)); +- sa_in->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); ++ memset(sa->inner_digest, 0, sizeof(sa->inner_digest)); ++ memset(sa->outer_digest, 0, sizeof(sa->outer_digest)); ++ sa->state_ptr = ctx->state_record_dma_addr; ++ ctx->offset_to_sr_ptr = ++ get_dynamic_sa_offset_state_ptr_field(&sa->ctrl); + + return 0; + } +@@ -302,7 +300,7 @@ int crypto4xx_hash_init(struct ahash_req + int ds; + struct dynamic_sa_ctl *sa; + +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + ds = crypto_ahash_digestsize( + __crypto_ahash_cast(req->base.tfm)); + sa->sa_command_0.bf.digest_len = ds >> 2; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -211,7 +211,7 @@ static u32 crypto4xx_build_pdr(struct cr + } + memset(dev->pdr, 0, sizeof(struct ce_pd) * PPC4XX_NUM_PD); + dev->shadow_sa_pool = dma_alloc_coherent(dev->core_dev->device, +- 256 * PPC4XX_NUM_PD, ++ sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD, + &dev->shadow_sa_pool_pa, + GFP_ATOMIC); + if (!dev->shadow_sa_pool) +@@ -223,16 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr + if (!dev->shadow_sr_pool) + return -ENOMEM; + for (i = 0; i < PPC4XX_NUM_PD; i++) { +- pd_uinfo = (struct pd_uinfo *) (dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * i); ++ pd_uinfo = &dev->pdr_uinfo[i]; + + /* alloc 256 bytes which is enough for any kind of dynamic sa */ +- pd_uinfo->sa_va = dev->shadow_sa_pool + 256 * i; ++ pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa; + pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i; + + /* alloc state record */ +- pd_uinfo->sr_va = dev->shadow_sr_pool + +- sizeof(struct sa_state_record) * i; ++ pd_uinfo->sr_va = &dev->shadow_sr_pool[i]; + pd_uinfo->sr_pa = dev->shadow_sr_pool_pa + + sizeof(struct sa_state_record) * i; + } +@@ -248,8 +246,9 @@ static void crypto4xx_destroy_pdr(struct + dev->pdr, dev->pdr_pa); + + if (dev->shadow_sa_pool) +- dma_free_coherent(dev->core_dev->device, 256 * PPC4XX_NUM_PD, +- dev->shadow_sa_pool, dev->shadow_sa_pool_pa); ++ dma_free_coherent(dev->core_dev->device, ++ sizeof(union shadow_sa_buf) * PPC4XX_NUM_PD, ++ dev->shadow_sa_pool, dev->shadow_sa_pool_pa); + + if (dev->shadow_sr_pool) + dma_free_coherent(dev->core_dev->device, +@@ -277,11 +276,9 @@ static u32 crypto4xx_get_pd_from_pdr_nol + + static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx) + { +- struct pd_uinfo *pd_uinfo; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + unsigned long flags; + +- pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * idx); + spin_lock_irqsave(&dev->core_dev->lock, flags); + if (dev->pdr_tail != PPC4XX_LAST_PD) + dev->pdr_tail++; +@@ -298,7 +295,7 @@ static struct ce_pd *crypto4xx_get_pdp(s + { + *pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx; + +- return dev->pdr + sizeof(struct ce_pd) * idx; ++ return &dev->pdr[idx]; + } + + /** +@@ -376,7 +373,7 @@ static inline struct ce_gd *crypto4xx_ge + { + *gd_dma = dev->gdr_pa + sizeof(struct ce_gd) * idx; + +- return (struct ce_gd *) (dev->gdr + sizeof(struct ce_gd) * idx); ++ return &dev->gdr[idx]; + } + + /** +@@ -387,7 +384,6 @@ static inline struct ce_gd *crypto4xx_ge + static u32 crypto4xx_build_sdr(struct crypto4xx_device *dev) + { + int i; +- struct ce_sd *sd_array; + + /* alloc memory for scatter descriptor ring */ + dev->sdr = dma_alloc_coherent(dev->core_dev->device, +@@ -407,10 +403,8 @@ static u32 crypto4xx_build_sdr(struct cr + return -ENOMEM; + } + +- sd_array = dev->sdr; +- + for (i = 0; i < PPC4XX_NUM_SD; i++) { +- sd_array[i].ptr = dev->scatter_buffer_pa + ++ dev->sdr[i].ptr = dev->scatter_buffer_pa + + PPC4XX_SD_BUFFER_SIZE * i; + } + +@@ -480,7 +474,7 @@ static inline struct ce_sd *crypto4xx_ge + { + *sd_dma = dev->sdr_pa + sizeof(struct ce_sd) * idx; + +- return (struct ce_sd *)(dev->sdr + sizeof(struct ce_sd) * idx); ++ return &dev->sdr[idx]; + } + + static void crypto4xx_copy_pkt_to_dst(struct crypto4xx_device *dev, +@@ -529,11 +523,10 @@ static u32 crypto4xx_copy_digest_to_dst( + struct crypto4xx_ctx *ctx) + { + struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in; +- struct sa_state_record *state_record = +- (struct sa_state_record *) pd_uinfo->sr_va; + + if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) { +- memcpy((void *) pd_uinfo->dest_va, state_record->save_digest, ++ memcpy((void *) pd_uinfo->dest_va, ++ pd_uinfo->sr_va->save_digest, + SA_HASH_ALG_SHA1_DIGEST_SIZE); + } + +@@ -607,11 +600,9 @@ static u32 crypto4xx_ahash_done(struct c + + static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) + { +- struct ce_pd *pd; +- struct pd_uinfo *pd_uinfo; ++ struct ce_pd *pd = &dev->pdr[idx]; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + +- pd = dev->pdr + sizeof(struct ce_pd)*idx; +- pd_uinfo = dev->pdr_uinfo + sizeof(struct pd_uinfo)*idx; + if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) == + CRYPTO_ALG_TYPE_ABLKCIPHER) + return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); +@@ -712,7 +703,6 @@ u32 crypto4xx_build_pd(struct crypto_asy + unsigned long flags; + struct pd_uinfo *pd_uinfo = NULL; + unsigned int nbytes = datalen, idx; +- unsigned int ivlen = 0; + u32 gd_idx = 0; + + /* figure how many gd is needed */ +@@ -771,17 +761,15 @@ u32 crypto4xx_build_pd(struct crypto_asy + } + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + +- pd_uinfo = (struct pd_uinfo *)(dev->pdr_uinfo + +- sizeof(struct pd_uinfo) * pd_entry); ++ pd_uinfo = &dev->pdr_uinfo[pd_entry]; + pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry); + pd_uinfo->async_req = req; + pd_uinfo->num_gd = num_gd; + pd_uinfo->num_sd = num_sd; + + if (iv_len || ctx->is_hash) { +- ivlen = iv_len; + pd->sa = pd_uinfo->sa_pa; +- sa = (struct dynamic_sa_ctl *) pd_uinfo->sa_va; ++ sa = pd_uinfo->sa_va; + if (ctx->direction == DIR_INBOUND) + memcpy(sa, ctx->sa_in, ctx->sa_len * 4); + else +@@ -791,14 +779,15 @@ u32 crypto4xx_build_pd(struct crypto_asy + &pd_uinfo->sr_pa, 4); + + if (iv_len) +- crypto4xx_memcpy_le(pd_uinfo->sr_va, iv, iv_len); ++ crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv, ++ iv, iv_len); + } else { + if (ctx->direction == DIR_INBOUND) { + pd->sa = ctx->sa_in_dma_addr; +- sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa = ctx->sa_in; + } else { + pd->sa = ctx->sa_out_dma_addr; +- sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa = ctx->sa_out; + } + } + pd->sa_len = ctx->sa_len; +@@ -1006,9 +995,8 @@ static void crypto4xx_bh_tasklet_cb(unsi + + while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { + tail = core_dev->dev->pdr_tail; +- pd_uinfo = core_dev->dev->pdr_uinfo + +- sizeof(struct pd_uinfo)*tail; +- pd = core_dev->dev->pdr + sizeof(struct ce_pd) * tail; ++ pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; ++ pd = &core_dev->dev->pdr[tail]; + if ((pd_uinfo->state == PD_ENTRY_INUSE) && + pd->pd_ctl.bf.pe_done && + !pd->pd_ctl.bf.host_ready) { +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -23,6 +23,8 @@ + #define __CRYPTO4XX_CORE_H__ + + #include ++#include "crypto4xx_reg_def.h" ++#include "crypto4xx_sa.h" + + #define MODULE_NAME "crypto4xx" + +@@ -48,6 +50,13 @@ + + struct crypto4xx_device; + ++union shadow_sa_buf { ++ struct dynamic_sa_ctl sa; ++ ++ /* alloc 256 bytes which is enough for any kind of dynamic sa */ ++ u8 buf[256]; ++} __packed; ++ + struct pd_uinfo { + struct crypto4xx_device *dev; + u32 state; +@@ -60,9 +69,9 @@ struct pd_uinfo { + used by this packet */ + u32 num_sd; /* number of scatter discriptors + used by this packet */ +- void *sa_va; /* shadow sa, when using cp from ctx->sa */ ++ struct dynamic_sa_ctl *sa_va; /* shadow sa */ + u32 sa_pa; +- void *sr_va; /* state record for shadow sa */ ++ struct sa_state_record *sr_va; /* state record for shadow sa */ + u32 sr_pa; + struct scatterlist *dest_va; + struct crypto_async_request *async_req; /* base crypto request +@@ -75,22 +84,18 @@ struct crypto4xx_device { + void __iomem *ce_base; + void __iomem *trng_base; + +- void *pdr; /* base address of packet +- descriptor ring */ +- dma_addr_t pdr_pa; /* physical address used to +- program ce pdr_base_register */ +- void *gdr; /* gather descriptor ring */ +- dma_addr_t gdr_pa; /* physical address used to +- program ce gdr_base_register */ +- void *sdr; /* scatter descriptor ring */ +- dma_addr_t sdr_pa; /* physical address used to +- program ce sdr_base_register */ ++ struct ce_pd *pdr; /* base address of packet descriptor ring */ ++ dma_addr_t pdr_pa; /* physical address of pdr_base_register */ ++ struct ce_gd *gdr; /* gather descriptor ring */ ++ dma_addr_t gdr_pa; /* physical address of gdr_base_register */ ++ struct ce_sd *sdr; /* scatter descriptor ring */ ++ dma_addr_t sdr_pa; /* physical address of sdr_base_register */ + void *scatter_buffer_va; + dma_addr_t scatter_buffer_pa; + +- void *shadow_sa_pool; /* pool of memory for sa in pd_uinfo */ ++ union shadow_sa_buf *shadow_sa_pool; + dma_addr_t shadow_sa_pool_pa; +- void *shadow_sr_pool; /* pool of memory for sr in pd_uinfo */ ++ struct sa_state_record *shadow_sr_pool; + dma_addr_t shadow_sr_pool_pa; + u32 pdr_tail; + u32 pdr_head; +@@ -98,7 +103,7 @@ struct crypto4xx_device { + u32 gdr_head; + u32 sdr_tail; + u32 sdr_head; +- void *pdr_uinfo; ++ struct pd_uinfo *pdr_uinfo; + struct list_head alg_list; /* List of algorithm supported + by this device */ + }; +@@ -116,11 +121,11 @@ struct crypto4xx_core_device { + + struct crypto4xx_ctx { + struct crypto4xx_device *dev; +- void *sa_in; ++ struct dynamic_sa_ctl *sa_in; + dma_addr_t sa_in_dma_addr; +- void *sa_out; ++ struct dynamic_sa_ctl *sa_out; + dma_addr_t sa_out_dma_addr; +- void *state_record; ++ struct sa_state_record *state_record; + dma_addr_t state_record_dma_addr; + u32 sa_len; + u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ diff --git a/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch new file mode 100644 index 000000000..9ddfcb95f --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0013-crypto-crypto4xx-wire-up-hmac_mc-to-hmac_muting.patch @@ -0,0 +1,25 @@ +From 5a4326d3a03f03c2518a2c255be33a7114af3230 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:05 +0200 +Subject: [PATCH 13/25] crypto: crypto4xx - wire up hmac_mc to hmac_muting + +The hmac_mc parameter of set_dynamic_sa_command_1() +was defined but not used. On closer inspection it +turns out, it was never wired up. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -63,6 +63,7 @@ static void set_dynamic_sa_command_1(str + sa->sa_command_1.bf.crypto_mode9_8 = cm & 3; + sa->sa_command_1.bf.feedback_mode = cfb, + sa->sa_command_1.bf.sa_rev = 1; ++ sa->sa_command_1.bf.hmac_muting = hmac_mc; + sa->sa_command_1.bf.extended_seq_num = esn; + sa->sa_command_1.bf.seq_num_mask = sn_mask; + sa->sa_command_1.bf.mutable_bit_proc = mute; diff --git a/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch new file mode 100644 index 000000000..acded24bb --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0014-crypto-crypto4xx-fix-off-by-one-AES-OFB.patch @@ -0,0 +1,49 @@ +From e9b8e4e1129d0886094cfe013cdbaafc4ce0de76 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:06 +0200 +Subject: [PATCH 14/25] crypto: crypto4xx - fix off-by-one AES-OFB + +I used aes-cbc as a template for ofb. But sadly I forgot +to update set_key method to crypto4xx_setkey_aes_ofb(). + +this was caught by the testmgr: +alg: skcipher: Test 1 failed (invalid result) on encr. for ofb-aes-ppc4xx +00000000: 76 49 ab ac 81 19 b2 46 ce e9 8e 9b 12 e9 19 7d +00000010: 50 86 cb 9b 50 72 19 ee 95 db 11 3a 91 76 78 b2 +00000020: 73 be d6 b8 e3 c1 74 3b 71 16 e6 9e 22 22 95 16 +00000030: 3f f1 ca a1 68 1f ac 09 12 0e ca 30 75 86 e1 a7 + +With the correct set_key method, the aes-ofb cipher passes the test. + +name : ofb(aes) +driver : ofb-aes-ppc4xx +module : crypto4xx +priority : 300 +refcnt : 1 +selftest : passed +internal : no +type : ablkcipher +async : yes +blocksize : 16 +min keysize : 16 +max keysize : 32 +ivsize : 16 +geniv : + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1148,7 +1148,7 @@ struct crypto4xx_alg_common crypto4xx_al + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, +- .setkey = crypto4xx_setkey_aes_cbc, ++ .setkey = crypto4xx_setkey_aes_ofb, + .encrypt = crypto4xx_encrypt, + .decrypt = crypto4xx_decrypt, + } diff --git a/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch new file mode 100644 index 000000000..f0f1d0ea5 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0015-crypto-crypto4xx-fix-type-mismatch-compiler-error.patch @@ -0,0 +1,29 @@ +From 333eb3edda3842f3e5dbd723cb18bbe47eb0508b Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:07 +0200 +Subject: [PATCH 15/25] crypto: crypto4xx - fix type mismatch compiler error + +This patch fixes a type mismatch error that I accidentally +introduced when I moved and refactored the dynamic_contents +helpers. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_sa.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -266,9 +266,9 @@ get_dynamic_sa_offset_state_ptr_field(st + return sizeof(struct dynamic_sa_ctl) + offset * 4; + } + +-static inline u8 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) + { +- return (u8 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++ return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch new file mode 100644 index 000000000..046dd9c25 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0017-crypto-crypto4xx-add-backlog-queue-support.patch @@ -0,0 +1,161 @@ +From 8ef8d195430ca3542d0434cf25e5115484b9fa32 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:09 +0200 +Subject: [PATCH 17/25] crypto: crypto4xx - add backlog queue support + +Previously, If the crypto4xx driver used all available +security contexts, it would simply refuse new requests +with -EAGAIN. CRYPTO_TFM_REQ_MAY_BACKLOG was ignored. + +in case of dm-crypt.c's crypt_convert() function this was +causing the following errors to manifest, if the system was +pushed hard enough: + +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| EXT4-fs warning (dm-1): ext4_end_bio:314: I/O error -5 writing to ino .. +| JBD2: Detected IO errors while flushing file data on dm-1-8 +| Aborting journal on device dm-1-8. +| EXT4-fs error : ext4_journal_check_start:56: Detected aborted journal +| EXT4-fs (dm-1): Remounting filesystem read-only +| EXT4-fs : ext4_writepages: jbd2_start: 2048 pages, inode 498...; err -30 + +(This did cause corruptions due to failed writes) + +To fix this mess, the crypto4xx driver needs to notifiy the +user to slow down. This can be achieved by returning -EBUSY +on requests, once the crypto hardware was falling behind. + +Note: -EBUSY has two different meanings. Setting the flag +CRYPTO_TFM_REQ_MAY_BACKLOG implies that the request was +successfully queued, by the crypto driver. To achieve this +requirement, the implementation introduces a threshold check and +adds logic to the completion routines in much the same way as +AMD's Cryptographic Coprocessor (CCP) driver do. + +Note2: Tests showed that dm-crypt starved ipsec traffic. +Under load, ipsec links dropped to 0 Kbits/s. This is because +dm-crypt's callback would instantly queue the next request. +In order to not starve ipsec, the driver reserves a small +portion of the available crypto contexts for this purpose. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 47 ++++++++++++++++++++++++++++++------ + drivers/crypto/amcc/crypto4xx_core.h | 3 ++- + 2 files changed, 41 insertions(+), 9 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -39,6 +39,7 @@ + #include + #include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" + #include "crypto4xx_sa.h" +@@ -573,8 +574,10 @@ static u32 crypto4xx_ablkcipher_done(str + dst->offset, dst->length, DMA_FROM_DEVICE); + } + crypto4xx_ret_sg_desc(dev, pd_uinfo); +- if (ablk_req->base.complete != NULL) +- ablk_req->base.complete(&ablk_req->base, 0); ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ ablkcipher_request_complete(ablk_req, -EINPROGRESS); ++ ablkcipher_request_complete(ablk_req, 0); + + return 0; + } +@@ -591,9 +594,10 @@ static u32 crypto4xx_ahash_done(struct c + crypto4xx_copy_digest_to_dst(pd_uinfo, + crypto_tfm_ctx(ahash_req->base.tfm)); + crypto4xx_ret_sg_desc(dev, pd_uinfo); +- /* call user provided callback function x */ +- if (ahash_req->base.complete != NULL) +- ahash_req->base.complete(&ahash_req->base, 0); ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ ahash_request_complete(ahash_req, -EINPROGRESS); ++ ahash_request_complete(ahash_req, 0); + + return 0; + } +@@ -704,6 +708,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + struct pd_uinfo *pd_uinfo = NULL; + unsigned int nbytes = datalen, idx; + u32 gd_idx = 0; ++ bool is_busy; + + /* figure how many gd is needed */ + num_gd = sg_nents_for_len(src, datalen); +@@ -734,6 +739,31 @@ u32 crypto4xx_build_pd(struct crypto_asy + * already got must be return the original place. + */ + spin_lock_irqsave(&dev->core_dev->lock, flags); ++ /* ++ * Let the caller know to slow down, once more than 13/16ths = 81% ++ * of the available data contexts are being used simultaneously. ++ * ++ * With PPC4XX_NUM_PD = 256, this will leave a "backlog queue" for ++ * 31 more contexts. Before new requests have to be rejected. ++ */ ++ if (req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) { ++ is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >= ++ ((PPC4XX_NUM_PD * 13) / 16); ++ } else { ++ /* ++ * To fix contention issues between ipsec (no blacklog) and ++ * dm-crypto (backlog) reserve 32 entries for "no backlog" ++ * data contexts. ++ */ ++ is_busy = ((dev->pdr_head - dev->pdr_tail) % PPC4XX_NUM_PD) >= ++ ((PPC4XX_NUM_PD * 15) / 16); ++ ++ if (is_busy) { ++ spin_unlock_irqrestore(&dev->core_dev->lock, flags); ++ return -EBUSY; ++ } ++ } ++ + if (num_gd) { + fst_gd = crypto4xx_get_n_gd(dev, num_gd); + if (fst_gd == ERING_WAS_FULL) { +@@ -888,11 +918,12 @@ u32 crypto4xx_build_pd(struct crypto_asy + sa->sa_command_1.bf.hash_crypto_offset = 0; + pd->pd_ctl.w = ctx->pd_ctl; + pd->pd_ctl_len.w = 0x00400000 | datalen; +- pd_uinfo->state = PD_ENTRY_INUSE; ++ pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); ++ + wmb(); + /* write any value to push engine to read a pd */ + writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); +- return -EINPROGRESS; ++ return is_busy ? -EBUSY : -EINPROGRESS; + } + + /** +@@ -997,7 +1028,7 @@ static void crypto4xx_bh_tasklet_cb(unsi + tail = core_dev->dev->pdr_tail; + pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; + pd = &core_dev->dev->pdr[tail]; +- if ((pd_uinfo->state == PD_ENTRY_INUSE) && ++ if ((pd_uinfo->state & PD_ENTRY_INUSE) && + pd->pd_ctl.bf.pe_done && + !pd->pd_ctl.bf.host_ready) { + pd->pd_ctl.bf.pe_done = 0; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -44,7 +44,8 @@ + #define PPC4XX_LAST_SD (PPC4XX_NUM_SD - 1) + #define PPC4XX_SD_BUFFER_SIZE 2048 + +-#define PD_ENTRY_INUSE 1 ++#define PD_ENTRY_BUSY BIT(1) ++#define PD_ENTRY_INUSE BIT(0) + #define PD_ENTRY_FREE 0 + #define ERING_WAS_FULL 0xffffffff + diff --git a/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch new file mode 100644 index 000000000..22d2a317f --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0018-crypto-crypto4xx-use-the-correct-LE32-format-for-IV-.patch @@ -0,0 +1,236 @@ +From 4865b122d4aff5151c88d2f7442d5a87f7e795ae Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:10 +0200 +Subject: [PATCH 18/25] crypto: crypto4xx - use the correct LE32 format for IV + and key defs + +The hardware expects that the keys, IVs (and inner/outer hashes) +are in the le32 format. + +This patch changes all hardware interface declarations to use +the correct LE32 data format for each field. + +In order to pass __CHECK_ENDIAN__ checks, crypto4xx_memcpy_le +has to be honest about the endianness of its parameters. +The function was split and moved to the common crypto4xx_core.h +header. This allows the compiler to generate better code if the +sizes/len is a constant (various *_IV_LEN). + +Please note that the hardware isn't consistent with the endiannes +of the save_digest field in the state record struct though. +The hashes produced by GHASH and CBC (for CCM) will be in LE32. +Whereas md5 and sha{1/,256,...} do not need any conversion. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 4 +-- + drivers/crypto/amcc/crypto4xx_core.c | 40 ++---------------------------- + drivers/crypto/amcc/crypto4xx_core.h | 47 +++++++++++++++++++++++++++++++++--- + drivers/crypto/amcc/crypto4xx_sa.h | 29 ++++++++++++---------- + 4 files changed, 64 insertions(+), 56 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -149,8 +149,8 @@ static int crypto4xx_setkey_aes(struct c + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- crypto4xx_memcpy_le(get_dynamic_sa_key_field(sa), +- key, keylen); ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), ++ key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; + ctx->is_hash = 0; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -614,42 +614,6 @@ static u32 crypto4xx_pd_done(struct cryp + return crypto4xx_ahash_done(dev, pd_uinfo); + } + +-/** +- * Note: Only use this function to copy items that is word aligned. +- */ +-void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, +- int len) +-{ +- u8 *tmp; +- for (; len >= 4; buf += 4, len -= 4) +- *dst++ = cpu_to_le32(*(unsigned int *) buf); +- +- tmp = (u8 *)dst; +- switch (len) { +- case 3: +- *tmp++ = 0; +- *tmp++ = *(buf+2); +- *tmp++ = *(buf+1); +- *tmp++ = *buf; +- break; +- case 2: +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = *(buf+1); +- *tmp++ = *buf; +- break; +- case 1: +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = 0; +- *tmp++ = *buf; +- break; +- default: +- break; +- } +-} +- + static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) + { + crypto4xx_destroy_pdr(core_dev->dev); +@@ -809,8 +773,8 @@ u32 crypto4xx_build_pd(struct crypto_asy + &pd_uinfo->sr_pa, 4); + + if (iv_len) +- crypto4xx_memcpy_le(pd_uinfo->sr_va->save_iv, +- iv, iv_len); ++ crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv, ++ iv, iv_len); + } else { + if (ctx->direction == DIR_INBOUND) { + pd->sa = ctx->sa_in_dma_addr; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -166,9 +166,7 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); + u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); +-void crypto4xx_memcpy_le(unsigned int *dst, +- const unsigned char *buf, int len); +-u32 crypto4xx_build_pd(struct crypto_async_request *req, ++int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +@@ -193,4 +191,47 @@ int crypto4xx_hash_digest(struct ahash_r + int crypto4xx_hash_final(struct ahash_request *req); + int crypto4xx_hash_update(struct ahash_request *req); + int crypto4xx_hash_init(struct ahash_request *req); ++ ++/** ++ * Note: Only use this function to copy items that is word aligned. ++ */ ++static inline void crypto4xx_memcpy_swab32(u32 *dst, const void *buf, ++ size_t len) ++{ ++ for (; len >= 4; buf += 4, len -= 4) ++ *dst++ = __swab32p((u32 *) buf); ++ ++ if (len) { ++ const u8 *tmp = (u8 *)buf; ++ ++ switch (len) { ++ case 3: ++ *dst = (tmp[2] << 16) | ++ (tmp[1] << 8) | ++ tmp[0]; ++ break; ++ case 2: ++ *dst = (tmp[1] << 8) | ++ tmp[0]; ++ break; ++ case 1: ++ *dst = tmp[0]; ++ break; ++ default: ++ break; ++ } ++ } ++} ++ ++static inline void crypto4xx_memcpy_from_le32(u32 *dst, const void *buf, ++ size_t len) ++{ ++ crypto4xx_memcpy_swab32(dst, buf, len); ++} ++ ++static inline void crypto4xx_memcpy_to_le32(__le32 *dst, const void *buf, ++ size_t len) ++{ ++ crypto4xx_memcpy_swab32((u32 *)dst, buf, len); ++} + #endif +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -181,9 +181,12 @@ struct dynamic_sa_ctl { + * State Record for Security Association (SA) + */ + struct sa_state_record { +- u32 save_iv[4]; +- u32 save_hash_byte_cnt[2]; +- u32 save_digest[16]; ++ __le32 save_iv[4]; ++ __le32 save_hash_byte_cnt[2]; ++ union { ++ u32 save_digest[16]; /* for MD5/SHA */ ++ __le32 save_digest_le32[16]; /* GHASH / CBC */ ++ }; + } __attribute__((packed)); + + /** +@@ -192,8 +195,8 @@ struct sa_state_record { + */ + struct dynamic_sa_aes128 { + struct dynamic_sa_ctl ctrl; +- u32 key[4]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[4]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -206,8 +209,8 @@ struct dynamic_sa_aes128 { + */ + struct dynamic_sa_aes192 { + struct dynamic_sa_ctl ctrl; +- u32 key[6]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[6]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -220,8 +223,8 @@ struct dynamic_sa_aes192 { + */ + struct dynamic_sa_aes256 { + struct dynamic_sa_ctl ctrl; +- u32 key[8]; +- u32 iv[4]; /* for CBC, OFC, and CFB mode */ ++ __le32 key[8]; ++ __le32 iv[4]; /* for CBC, OFC, and CFB mode */ + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -235,8 +238,8 @@ struct dynamic_sa_aes256 { + */ + struct dynamic_sa_hash160 { + struct dynamic_sa_ctl ctrl; +- u32 inner_digest[5]; +- u32 outer_digest[5]; ++ __le32 inner_digest[5]; ++ __le32 outer_digest[5]; + u32 state_ptr; + u32 reserved; + } __attribute__((packed)); +@@ -266,9 +269,9 @@ get_dynamic_sa_offset_state_ptr_field(st + return sizeof(struct dynamic_sa_ctl) + offset * 4; + } + +-static inline u32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) ++static inline __le32 *get_dynamic_sa_key_field(struct dynamic_sa_ctl *cts) + { +- return (u32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); ++ return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch new file mode 100644 index 000000000..7b739c68c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0019-crypto-crypto4xx-overhaul-crypto4xx_build_pd.patch @@ -0,0 +1,535 @@ +From cd4dcd6da7a2610e0562a6e130bb68cc544a8fb1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:11 +0200 +Subject: [PATCH 19/25] crypto: crypto4xx - overhaul crypto4xx_build_pd() + +This patch overhauls and fixes code related to crypto4xx_build_pd() + + * crypto4xx_build_pd() did not handle chained source scatterlist. + This is fixed by replacing the buggy indexed-access of &src[idx] + with sg_next() in the gather array setup loop. + + * The redundant is_hash, direction, save_iv and pd_ctl members + in the crypto4xx_ctx struct have been removed. + - is_hash can be derived from the crypto_async_request parameter. + - direction is already part of the security association's + bf.dir bitfield. + - save_iv is unused. + - pd_ctl always had the host_ready bit enabled anyway. + (the hash_final case is rather pointless, since the ahash + code has been deactivated). + + * make crypto4xx_build_pd()'s caller responsible for converting + the IV to the LE32 format. + + * change crypto4xx_ahash_update() and crypto4xx_ahash_digest() to + initialize a temporary destination scatterlist. This allows the + removal of an ugly cast of req->result (which is a pointer to an + u8-array) to a scatterlist pointer. + + * change crypto4xx_build_pd() return type to int. After all + it returns -EINPROGRESS/-EBUSY. + + * fix crypto4xx_build_pd() thread-unsafe sa handling. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 87 +++++++++++------------- + drivers/crypto/amcc/crypto4xx_core.c | 128 ++++++++++++++++------------------- + drivers/crypto/amcc/crypto4xx_core.h | 12 ++-- + 3 files changed, 103 insertions(+), 124 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -75,27 +75,29 @@ static void set_dynamic_sa_command_1(str + int crypto4xx_encrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int ivlen = crypto_ablkcipher_ivsize( ++ crypto_ablkcipher_reqtfm(req)); ++ __le32 iv[ivlen]; + +- ctx->direction = DIR_OUTBOUND; +- ctx->is_hash = 0; +- ctx->pd_ctl = 0x1; ++ if (ivlen) ++ crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); ++ req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int ivlen = crypto_ablkcipher_ivsize( ++ crypto_ablkcipher_reqtfm(req)); ++ __le32 iv[ivlen]; + +- ctx->direction = DIR_INBOUND; +- ctx->is_hash = 0; +- ctx->pd_ctl = 1; ++ if (ivlen) ++ crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, req->info, +- crypto_ablkcipher_ivsize(crypto_ablkcipher_reqtfm(req))); ++ req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len); + } + + /** +@@ -153,11 +155,6 @@ static int crypto4xx_setkey_aes(struct c + key, keylen); + sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); + sa->sa_command_1.bf.key_len = keylen >> 3; +- ctx->is_hash = 0; +- ctx->direction = DIR_INBOUND; +- memcpy(sa + get_dynamic_sa_offset_state_ptr_field(sa), +- (void *)&ctx->state_record_dma_addr, 4); +- ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + + memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); + sa = ctx->sa_out; +@@ -206,7 +203,7 @@ int crypto4xx_setkey_rfc3686(struct cryp + if (rc) + return rc; + +- memcpy(ctx->state_record, ++ crypto4xx_memcpy_to_le32(ctx->state_record->save_iv, + key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); + + return 0; +@@ -215,27 +212,29 @@ int crypto4xx_setkey_rfc3686(struct cryp + int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, +- *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; +- +- ctx->direction = DIR_OUTBOUND; +- ctx->pd_ctl = 1; ++ __le32 iv[AES_IV_SIZE / 4] = { ++ ctx->state_record->save_iv[0], ++ cpu_to_le32p((u32 *) req->info), ++ cpu_to_le32p((u32 *) (req->info + 4)), ++ cpu_to_le32(1) }; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, AES_IV_SIZE); ++ req->nbytes, iv, AES_IV_SIZE, ++ ctx->sa_out, ctx->sa_len); + } + + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- __be32 iv[AES_IV_SIZE / 4] = { *(u32 *)ctx->state_record, +- *(u32 *) req->info, *(u32 *) (req->info + 4), cpu_to_be32(1) }; +- +- ctx->direction = DIR_INBOUND; +- ctx->pd_ctl = 1; ++ __le32 iv[AES_IV_SIZE / 4] = { ++ ctx->state_record->save_iv[0], ++ cpu_to_le32p((u32 *) req->info), ++ cpu_to_le32p((u32 *) (req->info + 4)), ++ cpu_to_le32(1) }; + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, AES_IV_SIZE); ++ req->nbytes, iv, AES_IV_SIZE, ++ ctx->sa_out, ctx->sa_len); + } + + /** +@@ -253,7 +252,6 @@ static int crypto4xx_hash_alg_init(struc + int rc; + + ctx->dev = my_alg->dev; +- ctx->is_hash = 1; + + /* Create SA */ + if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) +@@ -284,13 +282,9 @@ static int crypto4xx_hash_alg_init(struc + SA_SEQ_MASK_OFF, SA_MC_ENABLE, + SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, + SA_NOT_COPY_HDR); +- ctx->direction = DIR_INBOUND; + /* Need to zero hash digest in SA */ + memset(sa->inner_digest, 0, sizeof(sa->inner_digest)); + memset(sa->outer_digest, 0, sizeof(sa->outer_digest)); +- sa->state_ptr = ctx->state_record_dma_addr; +- ctx->offset_to_sr_ptr = +- get_dynamic_sa_offset_state_ptr_field(&sa->ctrl); + + return 0; + } +@@ -306,23 +300,22 @@ int crypto4xx_hash_init(struct ahash_req + __crypto_ahash_cast(req->base.tfm)); + sa->sa_command_0.bf.digest_len = ds >> 2; + sa->sa_command_0.bf.load_hash_state = SA_LOAD_HASH_FROM_SA; +- ctx->is_hash = 1; +- ctx->direction = DIR_INBOUND; + + return 0; + } + + int crypto4xx_hash_update(struct ahash_request *req) + { ++ struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct scatterlist dst; ++ unsigned int ds = crypto_ahash_digestsize(ahash); ++ ++ sg_init_one(&dst, req->result, ds); + +- ctx->is_hash = 1; +- ctx->pd_ctl = 0x11; +- ctx->direction = DIR_INBOUND; +- +- return crypto4xx_build_pd(&req->base, ctx, req->src, +- (struct scatterlist *) req->result, +- req->nbytes, NULL, 0); ++ return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, ++ req->nbytes, NULL, 0, ctx->sa_in, ++ ctx->sa_len); + } + + int crypto4xx_hash_final(struct ahash_request *req) +@@ -332,14 +325,16 @@ int crypto4xx_hash_final(struct ahash_re + + int crypto4xx_hash_digest(struct ahash_request *req) + { ++ struct crypto_ahash *ahash = crypto_ahash_reqtfm(req); + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct scatterlist dst; ++ unsigned int ds = crypto_ahash_digestsize(ahash); + +- ctx->pd_ctl = 0x11; +- ctx->direction = DIR_INBOUND; ++ sg_init_one(&dst, req->result, ds); + +- return crypto4xx_build_pd(&req->base, ctx, req->src, +- (struct scatterlist *) req->result, +- req->nbytes, NULL, 0); ++ return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, ++ req->nbytes, NULL, 0, ctx->sa_in, ++ ctx->sa_len); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -194,7 +194,6 @@ void crypto4xx_free_state_record(struct + static u32 crypto4xx_build_pdr(struct crypto4xx_device *dev) + { + int i; +- struct pd_uinfo *pd_uinfo; + dev->pdr = dma_alloc_coherent(dev->core_dev->device, + sizeof(struct ce_pd) * PPC4XX_NUM_PD, + &dev->pdr_pa, GFP_ATOMIC); +@@ -224,11 +223,14 @@ static u32 crypto4xx_build_pdr(struct cr + if (!dev->shadow_sr_pool) + return -ENOMEM; + for (i = 0; i < PPC4XX_NUM_PD; i++) { +- pd_uinfo = &dev->pdr_uinfo[i]; ++ struct ce_pd *pd = &dev->pdr[i]; ++ struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[i]; ++ ++ pd->sa = dev->shadow_sa_pool_pa + ++ sizeof(union shadow_sa_buf) * i; + + /* alloc 256 bytes which is enough for any kind of dynamic sa */ + pd_uinfo->sa_va = &dev->shadow_sa_pool[i].sa; +- pd_uinfo->sa_pa = dev->shadow_sa_pool_pa + 256 * i; + + /* alloc state record */ + pd_uinfo->sr_va = &dev->shadow_sr_pool[i]; +@@ -291,14 +293,6 @@ static u32 crypto4xx_put_pd_to_pdr(struc + return 0; + } + +-static struct ce_pd *crypto4xx_get_pdp(struct crypto4xx_device *dev, +- dma_addr_t *pd_dma, u32 idx) +-{ +- *pd_dma = dev->pdr_pa + sizeof(struct ce_pd) * idx; +- +- return &dev->pdr[idx]; +-} +- + /** + * alloc memory for the gather ring + * no need to alloc buf for the ring +@@ -520,18 +514,16 @@ static void crypto4xx_copy_pkt_to_dst(st + } + } + +-static u32 crypto4xx_copy_digest_to_dst(struct pd_uinfo *pd_uinfo, ++static void crypto4xx_copy_digest_to_dst(void *dst, ++ struct pd_uinfo *pd_uinfo, + struct crypto4xx_ctx *ctx) + { + struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *) ctx->sa_in; + + if (sa->sa_command_0.bf.hash_alg == SA_HASH_ALG_SHA1) { +- memcpy((void *) pd_uinfo->dest_va, +- pd_uinfo->sr_va->save_digest, ++ memcpy(dst, pd_uinfo->sr_va->save_digest, + SA_HASH_ALG_SHA1_DIGEST_SIZE); + } +- +- return 0; + } + + static void crypto4xx_ret_sg_desc(struct crypto4xx_device *dev, +@@ -591,7 +583,7 @@ static u32 crypto4xx_ahash_done(struct c + ahash_req = ahash_request_cast(pd_uinfo->async_req); + ctx = crypto_tfm_ctx(ahash_req->base.tfm); + +- crypto4xx_copy_digest_to_dst(pd_uinfo, ++ crypto4xx_copy_digest_to_dst(ahash_req->result, pd_uinfo, + crypto_tfm_ctx(ahash_req->base.tfm)); + crypto4xx_ret_sg_desc(dev, pd_uinfo); + +@@ -651,17 +643,17 @@ static u32 get_next_sd(u32 current) + return 0; + } + +-u32 crypto4xx_build_pd(struct crypto_async_request *req, ++int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len) ++ const unsigned int datalen, ++ const __le32 *iv, const u32 iv_len, ++ const struct dynamic_sa_ctl *req_sa, ++ const unsigned int sa_len) + { + struct crypto4xx_device *dev = ctx->dev; +- dma_addr_t addr, pd_dma, sd_dma, gd_dma; + struct dynamic_sa_ctl *sa; +- struct scatterlist *sg; + struct ce_gd *gd; + struct ce_pd *pd; + u32 num_gd, num_sd; +@@ -669,8 +661,9 @@ u32 crypto4xx_build_pd(struct crypto_asy + u32 fst_sd = 0xffffffff; + u32 pd_entry; + unsigned long flags; +- struct pd_uinfo *pd_uinfo = NULL; +- unsigned int nbytes = datalen, idx; ++ struct pd_uinfo *pd_uinfo; ++ unsigned int nbytes = datalen; ++ size_t offset_to_sr_ptr; + u32 gd_idx = 0; + bool is_busy; + +@@ -684,7 +677,7 @@ u32 crypto4xx_build_pd(struct crypto_asy + num_gd = 0; + + /* figure how many sd is needed */ +- if (sg_is_last(dst) || ctx->is_hash) { ++ if (sg_is_last(dst)) { + num_sd = 0; + } else { + if (datalen > PPC4XX_SD_BUFFER_SIZE) { +@@ -755,37 +748,27 @@ u32 crypto4xx_build_pd(struct crypto_asy + } + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + ++ pd = &dev->pdr[pd_entry]; ++ pd->sa_len = sa_len; ++ + pd_uinfo = &dev->pdr_uinfo[pd_entry]; +- pd = crypto4xx_get_pdp(dev, &pd_dma, pd_entry); + pd_uinfo->async_req = req; + pd_uinfo->num_gd = num_gd; + pd_uinfo->num_sd = num_sd; + +- if (iv_len || ctx->is_hash) { +- pd->sa = pd_uinfo->sa_pa; +- sa = pd_uinfo->sa_va; +- if (ctx->direction == DIR_INBOUND) +- memcpy(sa, ctx->sa_in, ctx->sa_len * 4); +- else +- memcpy(sa, ctx->sa_out, ctx->sa_len * 4); ++ if (iv_len) ++ memcpy(pd_uinfo->sr_va->save_iv, iv, iv_len); + +- memcpy((void *) sa + ctx->offset_to_sr_ptr, +- &pd_uinfo->sr_pa, 4); ++ sa = pd_uinfo->sa_va; ++ memcpy(sa, req_sa, sa_len * 4); ++ ++ offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); ++ *(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa; + +- if (iv_len) +- crypto4xx_memcpy_to_le32(pd_uinfo->sr_va->save_iv, +- iv, iv_len); +- } else { +- if (ctx->direction == DIR_INBOUND) { +- pd->sa = ctx->sa_in_dma_addr; +- sa = ctx->sa_in; +- } else { +- pd->sa = ctx->sa_out_dma_addr; +- sa = ctx->sa_out; +- } +- } +- pd->sa_len = ctx->sa_len; + if (num_gd) { ++ dma_addr_t gd_dma; ++ struct scatterlist *sg; ++ + /* get first gd we are going to use */ + gd_idx = fst_gd; + pd_uinfo->first_gd = fst_gd; +@@ -794,27 +777,30 @@ u32 crypto4xx_build_pd(struct crypto_asy + pd->src = gd_dma; + /* enable gather */ + sa->sa_command_0.bf.gather = 1; +- idx = 0; +- src = &src[0]; + /* walk the sg, and setup gather array */ ++ ++ sg = src; + while (nbytes) { +- sg = &src[idx]; +- addr = dma_map_page(dev->core_dev->device, sg_page(sg), +- sg->offset, sg->length, DMA_TO_DEVICE); +- gd->ptr = addr; +- gd->ctl_len.len = sg->length; ++ size_t len; ++ ++ len = min(sg->length, nbytes); ++ gd->ptr = dma_map_page(dev->core_dev->device, ++ sg_page(sg), sg->offset, len, DMA_TO_DEVICE); ++ gd->ctl_len.len = len; + gd->ctl_len.done = 0; + gd->ctl_len.ready = 1; +- if (sg->length >= nbytes) ++ if (len >= nbytes) + break; ++ + nbytes -= sg->length; + gd_idx = get_next_gd(gd_idx); + gd = crypto4xx_get_gdp(dev, &gd_dma, gd_idx); +- idx++; ++ sg = sg_next(sg); + } + } else { + pd->src = (u32)dma_map_page(dev->core_dev->device, sg_page(src), +- src->offset, src->length, DMA_TO_DEVICE); ++ src->offset, min(nbytes, src->length), ++ DMA_TO_DEVICE); + /* + * Disable gather in sa command + */ +@@ -825,25 +811,24 @@ u32 crypto4xx_build_pd(struct crypto_asy + pd_uinfo->first_gd = 0xffffffff; + pd_uinfo->num_gd = 0; + } +- if (ctx->is_hash || sg_is_last(dst)) { ++ if (sg_is_last(dst)) { + /* + * we know application give us dst a whole piece of memory + * no need to use scatter ring. +- * In case of is_hash, the icv is always at end of src data. + */ + pd_uinfo->using_sd = 0; + pd_uinfo->first_sd = 0xffffffff; + pd_uinfo->num_sd = 0; + pd_uinfo->dest_va = dst; + sa->sa_command_0.bf.scatter = 0; +- if (ctx->is_hash) +- pd->dest = virt_to_phys((void *)dst); +- else +- pd->dest = (u32)dma_map_page(dev->core_dev->device, +- sg_page(dst), dst->offset, +- dst->length, DMA_TO_DEVICE); ++ pd->dest = (u32)dma_map_page(dev->core_dev->device, ++ sg_page(dst), dst->offset, ++ min(datalen, dst->length), ++ DMA_TO_DEVICE); + } else { ++ dma_addr_t sd_dma; + struct ce_sd *sd = NULL; ++ + u32 sd_idx = fst_sd; + nbytes = datalen; + sa->sa_command_0.bf.scatter = 1; +@@ -857,7 +842,6 @@ u32 crypto4xx_build_pd(struct crypto_asy + sd->ctl.done = 0; + sd->ctl.rdy = 1; + /* sd->ptr should be setup by sd_init routine*/ +- idx = 0; + if (nbytes >= PPC4XX_SD_BUFFER_SIZE) + nbytes -= PPC4XX_SD_BUFFER_SIZE; + else +@@ -868,19 +852,23 @@ u32 crypto4xx_build_pd(struct crypto_asy + /* setup scatter descriptor */ + sd->ctl.done = 0; + sd->ctl.rdy = 1; +- if (nbytes >= PPC4XX_SD_BUFFER_SIZE) ++ if (nbytes >= PPC4XX_SD_BUFFER_SIZE) { + nbytes -= PPC4XX_SD_BUFFER_SIZE; +- else ++ } else { + /* + * SD entry can hold PPC4XX_SD_BUFFER_SIZE, + * which is more than nbytes, so done. + */ + nbytes = 0; ++ } + } + } + + sa->sa_command_1.bf.hash_crypto_offset = 0; +- pd->pd_ctl.w = ctx->pd_ctl; ++ pd->pd_ctl.w = 0; ++ pd->pd_ctl.bf.hash_final = ++ (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH); ++ pd->pd_ctl.bf.host_ready = 1; + pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -71,7 +71,6 @@ struct pd_uinfo { + u32 num_sd; /* number of scatter discriptors + used by this packet */ + struct dynamic_sa_ctl *sa_va; /* shadow sa */ +- u32 sa_pa; + struct sa_state_record *sr_va; /* state record for shadow sa */ + u32 sr_pa; + struct scatterlist *dest_va; +@@ -129,11 +128,6 @@ struct crypto4xx_ctx { + struct sa_state_record *state_record; + dma_addr_t state_record_dma_addr; + u32 sa_len; +- u32 offset_to_sr_ptr; /* offset to state ptr, in dynamic sa */ +- u32 direction; +- u32 save_iv; +- u32 pd_ctl; +- u32 is_hash; + }; + + struct crypto4xx_alg_common { +@@ -170,8 +164,10 @@ int crypto4xx_build_pd(struct crypto_asy + struct crypto4xx_ctx *ctx, + struct scatterlist *src, + struct scatterlist *dst, +- unsigned int datalen, +- void *iv, u32 iv_len); ++ const unsigned int datalen, ++ const __le32 *iv, const u32 iv_len, ++ const struct dynamic_sa_ctl *sa, ++ const unsigned int sa_len); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, diff --git a/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch new file mode 100644 index 000000000..8847d1fcc --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0020-crypto-crypto4xx-fix-various-warnings.patch @@ -0,0 +1,62 @@ +From 64e1062b2371cb8d6126d4e970832365a1a84562 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:12 +0200 +Subject: [PATCH 20/25] crypto: crypto4xx - fix various warnings + +crypto4xx_core.c:179:6: warning: symbol 'crypto4xx_free_state_record' + was not declared. Should it be static? +crypto4xx_core.c:331:5: warning: symbol 'crypto4xx_get_n_gd' + was not declared. Should it be static? +crypto4xx_core.c:652:6: warning: symbol 'crypto4xx_return_pd' + was not declared. Should it be static? + +crypto4xx_return_pd() is not used by anything. Therefore it is removed. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -176,7 +176,7 @@ u32 crypto4xx_alloc_state_record(struct + return 0; + } + +-void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) ++static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) + { + if (ctx->state_record != NULL) + dma_free_coherent(ctx->dev->core_dev->device, +@@ -322,10 +322,11 @@ static inline void crypto4xx_destroy_gdr + * when this function is called. + * preemption or interrupt must be disabled + */ +-u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n) ++static u32 crypto4xx_get_n_gd(struct crypto4xx_device *dev, int n) + { + u32 retval; + u32 tmp; ++ + if (n >= PPC4XX_NUM_GD) + return ERING_WAS_FULL; + +@@ -616,17 +617,6 @@ static void crypto4xx_stop_all(struct cr + kfree(core_dev); + } + +-void crypto4xx_return_pd(struct crypto4xx_device *dev, +- u32 pd_entry, struct ce_pd *pd, +- struct pd_uinfo *pd_uinfo) +-{ +- /* irq should be already disabled */ +- dev->pdr_head = pd_entry; +- pd->pd_ctl.w = 0; +- pd->pd_ctl_len.w = 0; +- pd_uinfo->state = PD_ENTRY_FREE; +-} +- + static u32 get_next_gd(u32 current) + { + if (current != PPC4XX_LAST_GD) diff --git a/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch new file mode 100644 index 000000000..aa621c52c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0021-crypto-crypto4xx-fix-stalls-under-heavy-load.patch @@ -0,0 +1,112 @@ +From 4b5b79998af61db8b0506fba6c0f33b57ea457bd Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:13 +0200 +Subject: [PATCH 21/25] crypto: crypto4xx - fix stalls under heavy load + +If the crypto4xx device is continuously loaded by dm-crypt +and ipsec work, it will start to work intermittent after a +few (between 20-30) seconds, hurting throughput and latency. + +This patch contains various stability improvements in order +to fix this issue. So far, the hardware has survived more +than a day without suffering any stalls under the continuous +load. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_core.c | 33 ++++++++++++++++++--------------- + drivers/crypto/amcc/crypto4xx_reg_def.h | 3 +++ + 2 files changed, 21 insertions(+), 15 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -280,17 +280,20 @@ static u32 crypto4xx_get_pd_from_pdr_nol + static u32 crypto4xx_put_pd_to_pdr(struct crypto4xx_device *dev, u32 idx) + { + struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; ++ u32 tail; + unsigned long flags; + + spin_lock_irqsave(&dev->core_dev->lock, flags); ++ pd_uinfo->state = PD_ENTRY_FREE; ++ + if (dev->pdr_tail != PPC4XX_LAST_PD) + dev->pdr_tail++; + else + dev->pdr_tail = 0; +- pd_uinfo->state = PD_ENTRY_FREE; ++ tail = dev->pdr_tail; + spin_unlock_irqrestore(&dev->core_dev->lock, flags); + +- return 0; ++ return tail; + } + + /** +@@ -854,16 +857,16 @@ int crypto4xx_build_pd(struct crypto_asy + } + } + +- sa->sa_command_1.bf.hash_crypto_offset = 0; +- pd->pd_ctl.w = 0; +- pd->pd_ctl.bf.hash_final = +- (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH); +- pd->pd_ctl.bf.host_ready = 1; ++ pd->pd_ctl.w = PD_CTL_HOST_READY | ++ ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | ++ (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? ++ PD_CTL_HASH_FINAL : 0); + pd->pd_ctl_len.w = 0x00400000 | datalen; + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + + wmb(); + /* write any value to push engine to read a pd */ ++ writel(0, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); + writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); + return is_busy ? -EBUSY : -EINPROGRESS; + } +@@ -964,23 +967,23 @@ static void crypto4xx_bh_tasklet_cb(unsi + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + struct pd_uinfo *pd_uinfo; + struct ce_pd *pd; +- u32 tail; ++ u32 tail = core_dev->dev->pdr_tail; ++ u32 head = core_dev->dev->pdr_head; + +- while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { +- tail = core_dev->dev->pdr_tail; ++ do { + pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; + pd = &core_dev->dev->pdr[tail]; + if ((pd_uinfo->state & PD_ENTRY_INUSE) && +- pd->pd_ctl.bf.pe_done && +- !pd->pd_ctl.bf.host_ready) { +- pd->pd_ctl.bf.pe_done = 0; ++ ((READ_ONCE(pd->pd_ctl.w) & ++ (PD_CTL_PE_DONE | PD_CTL_HOST_READY)) == ++ PD_CTL_PE_DONE)) { + crypto4xx_pd_done(core_dev->dev, tail); +- crypto4xx_put_pd_to_pdr(core_dev->dev, tail); ++ tail = crypto4xx_put_pd_to_pdr(core_dev->dev, tail); + } else { + /* if tail not done, break */ + break; + } +- } ++ } while (head != tail); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -261,6 +261,9 @@ union ce_pd_ctl { + } bf; + u32 w; + } __attribute__((packed)); ++#define PD_CTL_HASH_FINAL BIT(4) ++#define PD_CTL_PE_DONE BIT(1) ++#define PD_CTL_HOST_READY BIT(0) + + union ce_pd_ctl_len { + struct { diff --git a/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch new file mode 100644 index 000000000..06ab798f5 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0022-crypto-crypto4xx-simplify-sa-and-state-context-acqui.patch @@ -0,0 +1,209 @@ +From 2f77690dcb96e525bc6b57bce4a0eaecaa2878d1 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:14 +0200 +Subject: [PATCH 22/25] crypto: crypto4xx - simplify sa and state context + acquisition + +Thanks to the big overhaul of crypto4xx_build_pd(), the request-local +sa_in, sa_out and state_record allocation can be simplified. + +There's no need to setup any dma coherent memory anymore and +much of the support code can be removed. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 27 +++++-------------- + drivers/crypto/amcc/crypto4xx_core.c | 50 ++++++------------------------------ + drivers/crypto/amcc/crypto4xx_core.h | 6 +---- + 3 files changed, 15 insertions(+), 68 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -122,20 +122,13 @@ static int crypto4xx_setkey_aes(struct c + } + + /* Create SA */ +- if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) ++ if (ctx->sa_in || ctx->sa_out) + crypto4xx_free_sa(ctx); + + rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4); + if (rc) + return rc; + +- if (ctx->state_record_dma_addr == 0) { +- rc = crypto4xx_alloc_state_record(ctx); +- if (rc) { +- crypto4xx_free_sa(ctx); +- return rc; +- } +- } + /* Setup SA */ + sa = ctx->sa_in; + +@@ -203,8 +196,8 @@ int crypto4xx_setkey_rfc3686(struct cryp + if (rc) + return rc; + +- crypto4xx_memcpy_to_le32(ctx->state_record->save_iv, +- key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); ++ ctx->iv_nonce = cpu_to_le32p((u32 *)&key[keylen - ++ CTR_RFC3686_NONCE_SIZE]); + + return 0; + } +@@ -213,7 +206,7 @@ int crypto4xx_rfc3686_encrypt(struct abl + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + __le32 iv[AES_IV_SIZE / 4] = { +- ctx->state_record->save_iv[0], ++ ctx->iv_nonce, + cpu_to_le32p((u32 *) req->info), + cpu_to_le32p((u32 *) (req->info + 4)), + cpu_to_le32(1) }; +@@ -227,7 +220,7 @@ int crypto4xx_rfc3686_decrypt(struct abl + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); + __le32 iv[AES_IV_SIZE / 4] = { +- ctx->state_record->save_iv[0], ++ ctx->iv_nonce, + cpu_to_le32p((u32 *) req->info), + cpu_to_le32p((u32 *) (req->info + 4)), + cpu_to_le32(1) }; +@@ -254,21 +247,13 @@ static int crypto4xx_hash_alg_init(struc + ctx->dev = my_alg->dev; + + /* Create SA */ +- if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) ++ if (ctx->sa_in || ctx->sa_out) + crypto4xx_free_sa(ctx); + + rc = crypto4xx_alloc_sa(ctx, sa_len); + if (rc) + return rc; + +- if (ctx->state_record_dma_addr == 0) { +- crypto4xx_alloc_state_record(ctx); +- if (!ctx->state_record_dma_addr) { +- crypto4xx_free_sa(ctx); +- return -ENOMEM; +- } +- } +- + crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), + sizeof(struct crypto4xx_ctx)); + sa = (struct dynamic_sa_hash160 *)ctx->sa_in; +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -130,21 +130,17 @@ static void crypto4xx_hw_init(struct cry + + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) + { +- ctx->sa_in = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4, +- &ctx->sa_in_dma_addr, GFP_ATOMIC); ++ ctx->sa_in = kzalloc(size * 4, GFP_ATOMIC); + if (ctx->sa_in == NULL) + return -ENOMEM; + +- ctx->sa_out = dma_alloc_coherent(ctx->dev->core_dev->device, size * 4, +- &ctx->sa_out_dma_addr, GFP_ATOMIC); ++ ctx->sa_out = kzalloc(size * 4, GFP_ATOMIC); + if (ctx->sa_out == NULL) { +- dma_free_coherent(ctx->dev->core_dev->device, size * 4, +- ctx->sa_in, ctx->sa_in_dma_addr); ++ kfree(ctx->sa_in); ++ ctx->sa_in = NULL; + return -ENOMEM; + } + +- memset(ctx->sa_in, 0, size * 4); +- memset(ctx->sa_out, 0, size * 4); + ctx->sa_len = size; + + return 0; +@@ -152,40 +148,13 @@ int crypto4xx_alloc_sa(struct crypto4xx_ + + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx) + { +- if (ctx->sa_in != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, +- ctx->sa_in, ctx->sa_in_dma_addr); +- if (ctx->sa_out != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, ctx->sa_len * 4, +- ctx->sa_out, ctx->sa_out_dma_addr); +- +- ctx->sa_in_dma_addr = 0; +- ctx->sa_out_dma_addr = 0; ++ kfree(ctx->sa_in); ++ ctx->sa_in = NULL; ++ kfree(ctx->sa_out); ++ ctx->sa_out = NULL; + ctx->sa_len = 0; + } + +-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx) +-{ +- ctx->state_record = dma_alloc_coherent(ctx->dev->core_dev->device, +- sizeof(struct sa_state_record), +- &ctx->state_record_dma_addr, GFP_ATOMIC); +- if (!ctx->state_record_dma_addr) +- return -ENOMEM; +- memset(ctx->state_record, 0, sizeof(struct sa_state_record)); +- +- return 0; +-} +- +-static void crypto4xx_free_state_record(struct crypto4xx_ctx *ctx) +-{ +- if (ctx->state_record != NULL) +- dma_free_coherent(ctx->dev->core_dev->device, +- sizeof(struct sa_state_record), +- ctx->state_record, +- ctx->state_record_dma_addr); +- ctx->state_record_dma_addr = 0; +-} +- + /** + * alloc memory for the gather ring + * no need to alloc buf for the ring +@@ -883,8 +852,6 @@ static int crypto4xx_alg_init(struct cry + ctx->dev = amcc_alg->dev; + ctx->sa_in = NULL; + ctx->sa_out = NULL; +- ctx->sa_in_dma_addr = 0; +- ctx->sa_out_dma_addr = 0; + ctx->sa_len = 0; + + switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { +@@ -905,7 +872,6 @@ static void crypto4xx_alg_exit(struct cr + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + + crypto4xx_free_sa(ctx); +- crypto4xx_free_state_record(ctx); + } + + int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -122,11 +122,8 @@ struct crypto4xx_core_device { + struct crypto4xx_ctx { + struct crypto4xx_device *dev; + struct dynamic_sa_ctl *sa_in; +- dma_addr_t sa_in_dma_addr; + struct dynamic_sa_ctl *sa_out; +- dma_addr_t sa_out_dma_addr; +- struct sa_state_record *state_record; +- dma_addr_t state_record_dma_addr; ++ __le32 iv_nonce; + u32 sa_len; + }; + +@@ -159,7 +156,6 @@ static inline struct crypto4xx_alg *cryp + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +-u32 crypto4xx_alloc_state_record(struct crypto4xx_ctx *ctx); + int crypto4xx_build_pd(struct crypto_async_request *req, + struct crypto4xx_ctx *ctx, + struct scatterlist *src, diff --git a/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch new file mode 100644 index 000000000..ff19c4f54 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0023-crypto-crypto4xx-prepare-for-AEAD-support.patch @@ -0,0 +1,617 @@ +From a0aae821ba3d35a49d4d0143dfb0c07eee22130e Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:15 +0200 +Subject: [PATCH 23/25] crypto: crypto4xx - prepare for AEAD support + +This patch enhances existing interfaces and +functions to support AEAD ciphers in the next +patches. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 19 +-- + drivers/crypto/amcc/crypto4xx_core.c | 217 +++++++++++++++++++++++++++-------- + drivers/crypto/amcc/crypto4xx_core.h | 22 ++-- + drivers/crypto/amcc/crypto4xx_sa.h | 41 +++++++ + 4 files changed, 226 insertions(+), 73 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -83,7 +84,7 @@ int crypto4xx_encrypt(struct ablkcipher_ + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len); ++ req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0); + } + + int crypto4xx_decrypt(struct ablkcipher_request *req) +@@ -97,7 +98,7 @@ int crypto4xx_decrypt(struct ablkcipher_ + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len); ++ req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0); + } + + /** +@@ -213,7 +214,7 @@ int crypto4xx_rfc3686_encrypt(struct abl + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, + req->nbytes, iv, AES_IV_SIZE, +- ctx->sa_out, ctx->sa_len); ++ ctx->sa_out, ctx->sa_len, 0); + } + + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) +@@ -227,7 +228,7 @@ int crypto4xx_rfc3686_decrypt(struct abl + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, + req->nbytes, iv, AES_IV_SIZE, +- ctx->sa_out, ctx->sa_len); ++ ctx->sa_out, ctx->sa_len, 0); + } + + /** +@@ -239,11 +240,13 @@ static int crypto4xx_hash_alg_init(struc + unsigned char hm) + { + struct crypto_alg *alg = tfm->__crt_alg; +- struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); ++ struct crypto4xx_alg *my_alg; + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + struct dynamic_sa_hash160 *sa; + int rc; + ++ my_alg = container_of(__crypto_ahash_alg(alg), struct crypto4xx_alg, ++ alg.u.hash); + ctx->dev = my_alg->dev; + + /* Create SA */ +@@ -300,7 +303,7 @@ int crypto4xx_hash_update(struct ahash_r + + return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, + req->nbytes, NULL, 0, ctx->sa_in, +- ctx->sa_len); ++ ctx->sa_len, 0); + } + + int crypto4xx_hash_final(struct ahash_request *req) +@@ -319,7 +322,7 @@ int crypto4xx_hash_digest(struct ahash_r + + return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, + req->nbytes, NULL, 0, ctx->sa_in, +- ctx->sa_len); ++ ctx->sa_len, 0); + } + + /** +@@ -330,5 +333,3 @@ int crypto4xx_sha1_alg_init(struct crypt + return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1, + SA_HASH_MODE_HASH); + } +- +- +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -35,10 +35,12 @@ + #include + #include + #include ++#include + #include + #include + #include + #include ++#include + #include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_core.h" +@@ -518,7 +520,7 @@ static void crypto4xx_ret_sg_desc(struct + } + } + +-static u32 crypto4xx_ablkcipher_done(struct crypto4xx_device *dev, ++static void crypto4xx_ablkcipher_done(struct crypto4xx_device *dev, + struct pd_uinfo *pd_uinfo, + struct ce_pd *pd) + { +@@ -543,11 +545,9 @@ static u32 crypto4xx_ablkcipher_done(str + if (pd_uinfo->state & PD_ENTRY_BUSY) + ablkcipher_request_complete(ablk_req, -EINPROGRESS); + ablkcipher_request_complete(ablk_req, 0); +- +- return 0; + } + +-static u32 crypto4xx_ahash_done(struct crypto4xx_device *dev, ++static void crypto4xx_ahash_done(struct crypto4xx_device *dev, + struct pd_uinfo *pd_uinfo) + { + struct crypto4xx_ctx *ctx; +@@ -563,20 +563,88 @@ static u32 crypto4xx_ahash_done(struct c + if (pd_uinfo->state & PD_ENTRY_BUSY) + ahash_request_complete(ahash_req, -EINPROGRESS); + ahash_request_complete(ahash_req, 0); ++} + +- return 0; ++static void crypto4xx_aead_done(struct crypto4xx_device *dev, ++ struct pd_uinfo *pd_uinfo, ++ struct ce_pd *pd) ++{ ++ struct aead_request *aead_req; ++ struct crypto4xx_ctx *ctx; ++ struct scatterlist *dst = pd_uinfo->dest_va; ++ int err = 0; ++ ++ aead_req = container_of(pd_uinfo->async_req, struct aead_request, ++ base); ++ ctx = crypto_tfm_ctx(aead_req->base.tfm); ++ ++ if (pd_uinfo->using_sd) { ++ crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, ++ pd->pd_ctl_len.bf.pkt_len, ++ dst); ++ } else { ++ __dma_sync_page(sg_page(dst), dst->offset, dst->length, ++ DMA_FROM_DEVICE); ++ } ++ ++ if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { ++ /* append icv at the end */ ++ size_t cp_len = crypto_aead_authsize( ++ crypto_aead_reqtfm(aead_req)); ++ u32 icv[cp_len]; ++ ++ crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, ++ cp_len); ++ ++ scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, ++ cp_len, 1); ++ } ++ ++ crypto4xx_ret_sg_desc(dev, pd_uinfo); ++ ++ if (pd->pd_ctl.bf.status & 0xff) { ++ if (pd->pd_ctl.bf.status & 0x1) { ++ /* authentication error */ ++ err = -EBADMSG; ++ } else { ++ if (!__ratelimit(&dev->aead_ratelimit)) { ++ if (pd->pd_ctl.bf.status & 2) ++ pr_err("pad fail error\n"); ++ if (pd->pd_ctl.bf.status & 4) ++ pr_err("seqnum fail\n"); ++ if (pd->pd_ctl.bf.status & 8) ++ pr_err("error _notify\n"); ++ pr_err("aead return err status = 0x%02x\n", ++ pd->pd_ctl.bf.status & 0xff); ++ pr_err("pd pad_ctl = 0x%08x\n", ++ pd->pd_ctl.bf.pd_pad_ctl); ++ } ++ err = -EINVAL; ++ } ++ } ++ ++ if (pd_uinfo->state & PD_ENTRY_BUSY) ++ aead_request_complete(aead_req, -EINPROGRESS); ++ ++ aead_request_complete(aead_req, err); + } + +-static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) ++static void crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) + { + struct ce_pd *pd = &dev->pdr[idx]; + struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; + +- if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) == +- CRYPTO_ALG_TYPE_ABLKCIPHER) +- return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); +- else +- return crypto4xx_ahash_done(dev, pd_uinfo); ++ switch (crypto_tfm_alg_type(pd_uinfo->async_req->tfm)) { ++ case CRYPTO_ALG_TYPE_ABLKCIPHER: ++ crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); ++ break; ++ case CRYPTO_ALG_TYPE_AEAD: ++ crypto4xx_aead_done(dev, pd_uinfo, pd); ++ break; ++ case CRYPTO_ALG_TYPE_AHASH: ++ crypto4xx_ahash_done(dev, pd_uinfo); ++ break; ++ } + } + + static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) +@@ -612,8 +680,10 @@ int crypto4xx_build_pd(struct crypto_asy + const unsigned int datalen, + const __le32 *iv, const u32 iv_len, + const struct dynamic_sa_ctl *req_sa, +- const unsigned int sa_len) ++ const unsigned int sa_len, ++ const unsigned int assoclen) + { ++ struct scatterlist _dst[2]; + struct crypto4xx_device *dev = ctx->dev; + struct dynamic_sa_ctl *sa; + struct ce_gd *gd; +@@ -627,18 +697,25 @@ int crypto4xx_build_pd(struct crypto_asy + unsigned int nbytes = datalen; + size_t offset_to_sr_ptr; + u32 gd_idx = 0; ++ int tmp; + bool is_busy; + +- /* figure how many gd is needed */ +- num_gd = sg_nents_for_len(src, datalen); +- if ((int)num_gd < 0) { ++ /* figure how many gd are needed */ ++ tmp = sg_nents_for_len(src, assoclen + datalen); ++ if (tmp < 0) { + dev_err(dev->core_dev->device, "Invalid number of src SG.\n"); +- return -EINVAL; ++ return tmp; + } +- if (num_gd == 1) +- num_gd = 0; ++ if (tmp == 1) ++ tmp = 0; ++ num_gd = tmp; + +- /* figure how many sd is needed */ ++ if (assoclen) { ++ nbytes += assoclen; ++ dst = scatterwalk_ffwd(_dst, dst, assoclen); ++ } ++ ++ /* figure how many sd are needed */ + if (sg_is_last(dst)) { + num_sd = 0; + } else { +@@ -724,6 +801,7 @@ int crypto4xx_build_pd(struct crypto_asy + sa = pd_uinfo->sa_va; + memcpy(sa, req_sa, sa_len * 4); + ++ sa->sa_command_1.bf.hash_crypto_offset = (assoclen >> 2); + offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); + *(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa; + +@@ -830,7 +908,7 @@ int crypto4xx_build_pd(struct crypto_asy + ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | + (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? + PD_CTL_HASH_FINAL : 0); +- pd->pd_ctl_len.w = 0x00400000 | datalen; ++ pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen); + pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); + + wmb(); +@@ -843,40 +921,68 @@ int crypto4xx_build_pd(struct crypto_asy + /** + * Algorithm Registration Functions + */ +-static int crypto4xx_alg_init(struct crypto_tfm *tfm) ++static void crypto4xx_ctx_init(struct crypto4xx_alg *amcc_alg, ++ struct crypto4xx_ctx *ctx) + { +- struct crypto_alg *alg = tfm->__crt_alg; +- struct crypto4xx_alg *amcc_alg = crypto_alg_to_crypto4xx_alg(alg); +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- + ctx->dev = amcc_alg->dev; + ctx->sa_in = NULL; + ctx->sa_out = NULL; + ctx->sa_len = 0; ++} + +- switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { +- default: +- tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx); +- break; +- case CRYPTO_ALG_TYPE_AHASH: +- crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), +- sizeof(struct crypto4xx_ctx)); +- break; +- } ++static int crypto4xx_ablk_init(struct crypto_tfm *tfm) ++{ ++ struct crypto_alg *alg = tfm->__crt_alg; ++ struct crypto4xx_alg *amcc_alg; ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); + ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher); ++ crypto4xx_ctx_init(amcc_alg, ctx); ++ tfm->crt_ablkcipher.reqsize = sizeof(struct crypto4xx_ctx); + return 0; + } + +-static void crypto4xx_alg_exit(struct crypto_tfm *tfm) ++static void crypto4xx_common_exit(struct crypto4xx_ctx *ctx) + { +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); +- + crypto4xx_free_sa(ctx); + } + +-int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, +- struct crypto4xx_alg_common *crypto_alg, +- int array_size) ++static void crypto4xx_ablk_exit(struct crypto_tfm *tfm) ++{ ++ crypto4xx_common_exit(crypto_tfm_ctx(tfm)); ++} ++ ++static int crypto4xx_aead_init(struct crypto_aead *tfm) ++{ ++ struct aead_alg *alg = crypto_aead_alg(tfm); ++ struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm); ++ struct crypto4xx_alg *amcc_alg; ++ ++ ctx->sw_cipher.aead = crypto_alloc_aead(alg->base.cra_name, 0, ++ CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_ASYNC); ++ if (IS_ERR(ctx->sw_cipher.aead)) ++ return PTR_ERR(ctx->sw_cipher.aead); ++ ++ amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.aead); ++ crypto4xx_ctx_init(amcc_alg, ctx); ++ crypto_aead_set_reqsize(tfm, sizeof(struct aead_request) + ++ max(sizeof(struct crypto4xx_ctx), 32 + ++ crypto_aead_reqsize(ctx->sw_cipher.aead))); ++ return 0; ++} ++ ++static void crypto4xx_aead_exit(struct crypto_aead *tfm) ++{ ++ struct crypto4xx_ctx *ctx = crypto_aead_ctx(tfm); ++ ++ crypto4xx_common_exit(ctx); ++ crypto_free_aead(ctx->sw_cipher.aead); ++} ++ ++static int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, ++ struct crypto4xx_alg_common *crypto_alg, ++ int array_size) + { + struct crypto4xx_alg *alg; + int i; +@@ -891,6 +997,10 @@ int crypto4xx_register_alg(struct crypto + alg->dev = sec_dev; + + switch (alg->alg.type) { ++ case CRYPTO_ALG_TYPE_AEAD: ++ rc = crypto_register_aead(&alg->alg.u.aead); ++ break; ++ + case CRYPTO_ALG_TYPE_AHASH: + rc = crypto_register_ahash(&alg->alg.u.hash); + break; +@@ -920,6 +1030,10 @@ static void crypto4xx_unregister_alg(str + crypto_unregister_ahash(&alg->alg.u.hash); + break; + ++ case CRYPTO_ALG_TYPE_AEAD: ++ crypto_unregister_aead(&alg->alg.u.aead); ++ break; ++ + default: + crypto_unregister_alg(&alg->alg.u.cipher); + } +@@ -973,7 +1087,7 @@ static irqreturn_t crypto4xx_ce_interrup + /** + * Supported Crypto Algorithms + */ +-struct crypto4xx_alg_common crypto4xx_alg[] = { ++static struct crypto4xx_alg_common crypto4xx_alg[] = { + /* Crypto AES modes */ + { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { + .cra_name = "cbc(aes)", +@@ -985,8 +1099,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1009,8 +1123,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1033,8 +1147,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1059,8 +1173,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1082,8 +1196,8 @@ struct crypto4xx_alg_common crypto4xx_al + .cra_blocksize = AES_BLOCK_SIZE, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), + .cra_type = &crypto_ablkcipher_type, +- .cra_init = crypto4xx_alg_init, +- .cra_exit = crypto4xx_alg_exit, ++ .cra_init = crypto4xx_ablk_init, ++ .cra_exit = crypto4xx_ablk_exit, + .cra_module = THIS_MODULE, + .cra_u = { + .ablkcipher = { +@@ -1149,6 +1263,7 @@ static int crypto4xx_probe(struct platfo + core_dev->device = dev; + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); ++ ratelimit_default_init(&core_dev->dev->aead_ratelimit); + rc = crypto4xx_build_pdr(core_dev->dev); + if (rc) + goto err_build_pdr; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -22,7 +22,9 @@ + #ifndef __CRYPTO4XX_CORE_H__ + #define __CRYPTO4XX_CORE_H__ + ++#include + #include ++#include + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" + +@@ -106,6 +108,7 @@ struct crypto4xx_device { + struct pd_uinfo *pdr_uinfo; + struct list_head alg_list; /* List of algorithm supported + by this device */ ++ struct ratelimit_state aead_ratelimit; + }; + + struct crypto4xx_core_device { +@@ -125,6 +128,9 @@ struct crypto4xx_ctx { + struct dynamic_sa_ctl *sa_out; + __le32 iv_nonce; + u32 sa_len; ++ union { ++ struct crypto_aead *aead; ++ } sw_cipher; + }; + + struct crypto4xx_alg_common { +@@ -132,6 +138,7 @@ struct crypto4xx_alg_common { + union { + struct crypto_alg cipher; + struct ahash_alg hash; ++ struct aead_alg aead; + } u; + }; + +@@ -141,18 +148,6 @@ struct crypto4xx_alg { + struct crypto4xx_device *dev; + }; + +-static inline struct crypto4xx_alg *crypto_alg_to_crypto4xx_alg( +- struct crypto_alg *x) +-{ +- switch (x->cra_flags & CRYPTO_ALG_TYPE_MASK) { +- case CRYPTO_ALG_TYPE_AHASH: +- return container_of(__crypto_ahash_alg(x), +- struct crypto4xx_alg, alg.u.hash); +- } +- +- return container_of(x, struct crypto4xx_alg, alg.u.cipher); +-} +- + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size); + void crypto4xx_free_sa(struct crypto4xx_ctx *ctx); + void crypto4xx_free_ctx(struct crypto4xx_ctx *ctx); +@@ -163,7 +158,8 @@ int crypto4xx_build_pd(struct crypto_asy + const unsigned int datalen, + const __le32 *iv, const u32 iv_len, + const struct dynamic_sa_ctl *sa, +- const unsigned int sa_len); ++ const unsigned int sa_len, ++ const unsigned int assoclen); + int crypto4xx_setkey_aes_cbc(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_aes_cfb(struct crypto_ablkcipher *cipher, +--- a/drivers/crypto/amcc/crypto4xx_sa.h ++++ b/drivers/crypto/amcc/crypto4xx_sa.h +@@ -55,6 +55,8 @@ union dynamic_sa_contents { + #define SA_OP_GROUP_BASIC 0 + #define SA_OPCODE_ENCRYPT 0 + #define SA_OPCODE_DECRYPT 0 ++#define SA_OPCODE_ENCRYPT_HASH 1 ++#define SA_OPCODE_HASH_DECRYPT 1 + #define SA_OPCODE_HASH 3 + #define SA_CIPHER_ALG_DES 0 + #define SA_CIPHER_ALG_3DES 1 +@@ -65,6 +67,8 @@ union dynamic_sa_contents { + + #define SA_HASH_ALG_MD5 0 + #define SA_HASH_ALG_SHA1 1 ++#define SA_HASH_ALG_GHASH 12 ++#define SA_HASH_ALG_CBC_MAC 14 + #define SA_HASH_ALG_NULL 15 + #define SA_HASH_ALG_SHA1_DIGEST_SIZE 20 + +@@ -234,6 +238,36 @@ struct dynamic_sa_aes256 { + #define SA_AES_CONTENTS 0x3e000002 + + /** ++ * Security Association (SA) for AES128 CCM ++ */ ++struct dynamic_sa_aes128_ccm { ++ struct dynamic_sa_ctl ctrl; ++ __le32 key[4]; ++ __le32 iv[4]; ++ u32 state_ptr; ++ u32 reserved; ++} __packed; ++#define SA_AES128_CCM_LEN (sizeof(struct dynamic_sa_aes128_ccm)/4) ++#define SA_AES128_CCM_CONTENTS 0x3e000042 ++#define SA_AES_CCM_CONTENTS 0x3e000002 ++ ++/** ++ * Security Association (SA) for AES128_GCM ++ */ ++struct dynamic_sa_aes128_gcm { ++ struct dynamic_sa_ctl ctrl; ++ __le32 key[4]; ++ __le32 inner_digest[4]; ++ __le32 iv[4]; ++ u32 state_ptr; ++ u32 reserved; ++} __packed; ++ ++#define SA_AES128_GCM_LEN (sizeof(struct dynamic_sa_aes128_gcm)/4) ++#define SA_AES128_GCM_CONTENTS 0x3e000442 ++#define SA_AES_GCM_CONTENTS 0x3e000402 ++ ++/** + * Security Association (SA) for HASH160: HMAC-SHA1 + */ + struct dynamic_sa_hash160 { +@@ -274,4 +308,11 @@ static inline __le32 *get_dynamic_sa_key + return (__le32 *) ((unsigned long)cts + sizeof(struct dynamic_sa_ctl)); + } + ++static inline __le32 *get_dynamic_sa_inner_digest(struct dynamic_sa_ctl *cts) ++{ ++ return (__le32 *) ((unsigned long)cts + ++ sizeof(struct dynamic_sa_ctl) + ++ cts->sa_contents.bf.key_size * 4); ++} ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch new file mode 100644 index 000000000..73283f650 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0024-crypto-crypto4xx-add-aes-ccm-support.patch @@ -0,0 +1,256 @@ +From 65ea8b678fcf385ac18864743bae66c0643e6842 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:16 +0200 +Subject: [PATCH 24/25] crypto: crypto4xx - add aes-ccm support + +This patch adds aes-ccm support. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 185 +++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 23 +++++ + drivers/crypto/amcc/crypto4xx_core.h | 8 ++ + 3 files changed, 216 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -231,6 +231,191 @@ int crypto4xx_rfc3686_decrypt(struct abl + ctx->sa_out, ctx->sa_len, 0); + } + ++static inline bool crypto4xx_aead_need_fallback(struct aead_request *req, ++ bool is_ccm, bool decrypt) ++{ ++ struct crypto_aead *aead = crypto_aead_reqtfm(req); ++ ++ /* authsize has to be a multiple of 4 */ ++ if (aead->authsize & 3) ++ return true; ++ ++ /* ++ * hardware does not handle cases where cryptlen ++ * is less than a block ++ */ ++ if (req->cryptlen < AES_BLOCK_SIZE) ++ return true; ++ ++ /* assoc len needs to be a multiple of 4 */ ++ if (req->assoclen & 0x3) ++ return true; ++ ++ /* CCM supports only counter field length of 2 and 4 bytes */ ++ if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3)) ++ return true; ++ ++ /* CCM - fix CBC MAC mismatch in special case */ ++ if (is_ccm && decrypt && !req->assoclen) ++ return true; ++ ++ return false; ++} ++ ++static int crypto4xx_aead_fallback(struct aead_request *req, ++ struct crypto4xx_ctx *ctx, bool do_decrypt) ++{ ++ char aead_req_data[sizeof(struct aead_request) + ++ crypto_aead_reqsize(ctx->sw_cipher.aead)] ++ __aligned(__alignof__(struct aead_request)); ++ ++ struct aead_request *subreq = (void *) aead_req_data; ++ ++ memset(subreq, 0, sizeof(aead_req_data)); ++ ++ aead_request_set_tfm(subreq, ctx->sw_cipher.aead); ++ aead_request_set_callback(subreq, req->base.flags, ++ req->base.complete, req->base.data); ++ aead_request_set_crypt(subreq, req->src, req->dst, req->cryptlen, ++ req->iv); ++ aead_request_set_ad(subreq, req->assoclen); ++ return do_decrypt ? crypto_aead_decrypt(subreq) : ++ crypto_aead_encrypt(subreq); ++} ++ ++static int crypto4xx_setup_fallback(struct crypto4xx_ctx *ctx, ++ struct crypto_aead *cipher, ++ const u8 *key, ++ unsigned int keylen) ++{ ++ int rc; ++ ++ crypto_aead_clear_flags(ctx->sw_cipher.aead, CRYPTO_TFM_REQ_MASK); ++ crypto_aead_set_flags(ctx->sw_cipher.aead, ++ crypto_aead_get_flags(cipher) & CRYPTO_TFM_REQ_MASK); ++ rc = crypto_aead_setkey(ctx->sw_cipher.aead, key, keylen); ++ crypto_aead_clear_flags(cipher, CRYPTO_TFM_RES_MASK); ++ crypto_aead_set_flags(cipher, ++ crypto_aead_get_flags(ctx->sw_cipher.aead) & ++ CRYPTO_TFM_RES_MASK); ++ ++ return rc; ++} ++ ++/** ++ * AES-CCM Functions ++ */ ++ ++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, const u8 *key, ++ unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ struct dynamic_sa_ctl *sa; ++ int rc = 0; ++ ++ rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen); ++ if (rc) ++ return rc; ++ ++ if (ctx->sa_in || ctx->sa_out) ++ crypto4xx_free_sa(ctx); ++ ++ rc = crypto4xx_alloc_sa(ctx, SA_AES128_CCM_LEN + (keylen - 16) / 4); ++ if (rc) ++ return rc; ++ ++ /* Setup SA */ ++ sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); ++ ++ set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, ++ SA_CIPHER_ALG_AES, ++ SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, ++ SA_OPCODE_HASH_DECRYPT, DIR_INBOUND); ++ ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_OFF, SA_MC_ENABLE, ++ SA_NOT_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), key, keylen); ++ ++ memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); ++ sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, ++ SA_CIPHER_ALG_AES, ++ SA_PAD_TYPE_ZERO, SA_OP_GROUP_BASIC, ++ SA_OPCODE_ENCRYPT_HASH, DIR_OUTBOUND); ++ ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_OFF, SA_MC_ENABLE, ++ SA_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ return 0; ++} ++ ++static int crypto4xx_crypt_aes_ccm(struct aead_request *req, bool decrypt) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ struct crypto_aead *aead = crypto_aead_reqtfm(req); ++ unsigned int len = req->cryptlen; ++ __le32 iv[16]; ++ u32 tmp_sa[ctx->sa_len * 4]; ++ struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *)tmp_sa; ++ ++ if (crypto4xx_aead_need_fallback(req, true, decrypt)) ++ return crypto4xx_aead_fallback(req, ctx, decrypt); ++ ++ if (decrypt) ++ len -= crypto_aead_authsize(aead); ++ ++ memcpy(tmp_sa, decrypt ? ctx->sa_in : ctx->sa_out, sizeof(tmp_sa)); ++ sa->sa_command_0.bf.digest_len = crypto_aead_authsize(aead) >> 2; ++ ++ if (req->iv[0] == 1) { ++ /* CRYPTO_MODE_AES_ICM */ ++ sa->sa_command_1.bf.crypto_mode9_8 = 1; ++ } ++ ++ iv[3] = cpu_to_le32(0); ++ crypto4xx_memcpy_to_le32(iv, req->iv, 16 - (req->iv[0] + 1)); ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ len, iv, sizeof(iv), ++ sa, ctx->sa_len, req->assoclen); ++} ++ ++int crypto4xx_encrypt_aes_ccm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_ccm(req, false); ++} ++ ++int crypto4xx_decrypt_aes_ccm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_ccm(req, true); ++} ++ ++int crypto4xx_setauthsize_aead(struct crypto_aead *cipher, ++ unsigned int authsize) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ ++ return crypto_aead_setauthsize(ctx->sw_cipher.aead, authsize); ++} ++ + /** + * HASH SHA1 Functions + */ +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1210,6 +1210,29 @@ static struct crypto4xx_alg_common crypt + } + } + } }, ++ ++ /* AEAD */ ++ { .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = { ++ .setkey = crypto4xx_setkey_aes_ccm, ++ .setauthsize = crypto4xx_setauthsize_aead, ++ .encrypt = crypto4xx_encrypt_aes_ccm, ++ .decrypt = crypto4xx_decrypt_aes_ccm, ++ .init = crypto4xx_aead_init, ++ .exit = crypto4xx_aead_exit, ++ .ivsize = AES_BLOCK_SIZE, ++ .maxauthsize = 16, ++ .base = { ++ .cra_name = "ccm(aes)", ++ .cra_driver_name = "ccm-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = 1, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_module = THIS_MODULE, ++ }, ++ } }, + }; + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -222,4 +222,12 @@ static inline void crypto4xx_memcpy_to_l + { + crypto4xx_memcpy_swab32((u32 *)dst, buf, len); + } ++ ++int crypto4xx_setauthsize_aead(struct crypto_aead *ciper, ++ unsigned int authsize); ++int crypto4xx_setkey_aes_ccm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt_aes_ccm(struct aead_request *req); ++int crypto4xx_decrypt_aes_ccm(struct aead_request *req); ++ + #endif diff --git a/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch new file mode 100644 index 000000000..3a2ed310b --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/020-0025-crypto-crypto4xx-add-aes-gcm-support.patch @@ -0,0 +1,220 @@ +From 59231368d3a959fc30c5142c406a045f49130daa Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 4 Oct 2017 01:00:17 +0200 +Subject: [PATCH 25/25] crypto: crypto4xx - add aes-gcm support + +This patch adds aes-gcm support to crypto4xx. + +Signed-off-by: Christian Lamparter +Signed-off-by: Herbert Xu +--- + drivers/crypto/amcc/crypto4xx_alg.c | 139 +++++++++++++++++++++++++++++++++++ + drivers/crypto/amcc/crypto4xx_core.c | 22 ++++++ + drivers/crypto/amcc/crypto4xx_core.h | 4 + + 3 files changed, 165 insertions(+) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -28,6 +28,7 @@ + #include + #include + #include ++#include + #include + #include + #include "crypto4xx_reg_def.h" +@@ -417,6 +418,144 @@ int crypto4xx_setauthsize_aead(struct cr + } + + /** ++ * AES-GCM Functions ++ */ ++ ++static int crypto4xx_aes_gcm_validate_keylen(unsigned int keylen) ++{ ++ switch (keylen) { ++ case 16: ++ case 24: ++ case 32: ++ return 0; ++ default: ++ return -EINVAL; ++ } ++} ++ ++static int crypto4xx_compute_gcm_hash_key_sw(__le32 *hash_start, const u8 *key, ++ unsigned int keylen) ++{ ++ struct crypto_cipher *aes_tfm = NULL; ++ uint8_t src[16] = { 0 }; ++ int rc = 0; ++ ++ aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK); ++ if (IS_ERR(aes_tfm)) { ++ rc = PTR_ERR(aes_tfm); ++ pr_warn("could not load aes cipher driver: %d\n", rc); ++ return rc; ++ } ++ ++ rc = crypto_cipher_setkey(aes_tfm, key, keylen); ++ if (rc) { ++ pr_err("setkey() failed: %d\n", rc); ++ goto out; ++ } ++ ++ crypto_cipher_encrypt_one(aes_tfm, src, src); ++ crypto4xx_memcpy_to_le32(hash_start, src, 16); ++out: ++ crypto_free_cipher(aes_tfm); ++ return rc; ++} ++ ++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen) ++{ ++ struct crypto_tfm *tfm = crypto_aead_tfm(cipher); ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); ++ struct dynamic_sa_ctl *sa; ++ int rc = 0; ++ ++ if (crypto4xx_aes_gcm_validate_keylen(keylen) != 0) { ++ crypto_aead_set_flags(cipher, CRYPTO_TFM_RES_BAD_KEY_LEN); ++ return -EINVAL; ++ } ++ ++ rc = crypto4xx_setup_fallback(ctx, cipher, key, keylen); ++ if (rc) ++ return rc; ++ ++ if (ctx->sa_in || ctx->sa_out) ++ crypto4xx_free_sa(ctx); ++ ++ rc = crypto4xx_alloc_sa(ctx, SA_AES128_GCM_LEN + (keylen - 16) / 4); ++ if (rc) ++ return rc; ++ ++ sa = (struct dynamic_sa_ctl *) ctx->sa_in; ++ ++ sa->sa_contents.w = SA_AES_GCM_CONTENTS | (keylen << 2); ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, ++ SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, ++ SA_NO_HEADER_PROC, SA_HASH_ALG_GHASH, ++ SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO, ++ SA_OP_GROUP_BASIC, SA_OPCODE_HASH_DECRYPT, ++ DIR_INBOUND); ++ set_dynamic_sa_command_1(sa, CRYPTO_MODE_CTR, SA_HASH_MODE_HASH, ++ CRYPTO_FEEDBACK_MODE_NO_FB, SA_EXTENDED_SN_OFF, ++ SA_SEQ_MASK_ON, SA_MC_DISABLE, ++ SA_NOT_COPY_PAD, SA_COPY_PAYLOAD, ++ SA_NOT_COPY_HDR); ++ ++ sa->sa_command_1.bf.key_len = keylen >> 3; ++ ++ crypto4xx_memcpy_to_le32(get_dynamic_sa_key_field(sa), ++ key, keylen); ++ ++ rc = crypto4xx_compute_gcm_hash_key_sw(get_dynamic_sa_inner_digest(sa), ++ key, keylen); ++ if (rc) { ++ pr_err("GCM hash key setting failed = %d\n", rc); ++ goto err; ++ } ++ ++ memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); ++ sa = (struct dynamic_sa_ctl *) ctx->sa_out; ++ sa->sa_command_0.bf.dir = DIR_OUTBOUND; ++ sa->sa_command_0.bf.opcode = SA_OPCODE_ENCRYPT_HASH; ++ ++ return 0; ++err: ++ crypto4xx_free_sa(ctx); ++ return rc; ++} ++ ++static inline int crypto4xx_crypt_aes_gcm(struct aead_request *req, ++ bool decrypt) ++{ ++ struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); ++ unsigned int len = req->cryptlen; ++ __le32 iv[4]; ++ ++ if (crypto4xx_aead_need_fallback(req, false, decrypt)) ++ return crypto4xx_aead_fallback(req, ctx, decrypt); ++ ++ crypto4xx_memcpy_to_le32(iv, req->iv, GCM_AES_IV_SIZE); ++ iv[3] = cpu_to_le32(1); ++ ++ if (decrypt) ++ len -= crypto_aead_authsize(crypto_aead_reqtfm(req)); ++ ++ return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, ++ len, iv, sizeof(iv), ++ decrypt ? ctx->sa_in : ctx->sa_out, ++ ctx->sa_len, req->assoclen); ++} ++ ++int crypto4xx_encrypt_aes_gcm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_gcm(req, false); ++} ++ ++int crypto4xx_decrypt_aes_gcm(struct aead_request *req) ++{ ++ return crypto4xx_crypt_aes_gcm(req, true); ++} ++ ++/** + * HASH SHA1 Functions + */ + static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm, +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -1227,6 +1228,27 @@ static struct crypto4xx_alg_common crypt + .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, + .cra_flags = CRYPTO_ALG_ASYNC | + CRYPTO_ALG_NEED_FALLBACK | ++ CRYPTO_ALG_KERN_DRIVER_ONLY, ++ .cra_blocksize = 1, ++ .cra_ctxsize = sizeof(struct crypto4xx_ctx), ++ .cra_module = THIS_MODULE, ++ }, ++ } }, ++ { .type = CRYPTO_ALG_TYPE_AEAD, .u.aead = { ++ .setkey = crypto4xx_setkey_aes_gcm, ++ .setauthsize = crypto4xx_setauthsize_aead, ++ .encrypt = crypto4xx_encrypt_aes_gcm, ++ .decrypt = crypto4xx_decrypt_aes_gcm, ++ .init = crypto4xx_aead_init, ++ .exit = crypto4xx_aead_exit, ++ .ivsize = GCM_AES_IV_SIZE, ++ .maxauthsize = 16, ++ .base = { ++ .cra_name = "gcm(aes)", ++ .cra_driver_name = "gcm-aes-ppc4xx", ++ .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, ++ .cra_flags = CRYPTO_ALG_ASYNC | ++ CRYPTO_ALG_NEED_FALLBACK | + CRYPTO_ALG_KERN_DRIVER_ONLY, + .cra_blocksize = 1, + .cra_ctxsize = sizeof(struct crypto4xx_ctx), +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -229,5 +229,9 @@ int crypto4xx_setkey_aes_ccm(struct cryp + const u8 *key, unsigned int keylen); + int crypto4xx_encrypt_aes_ccm(struct aead_request *req); + int crypto4xx_decrypt_aes_ccm(struct aead_request *req); ++int crypto4xx_setkey_aes_gcm(struct crypto_aead *cipher, ++ const u8 *key, unsigned int keylen); ++int crypto4xx_encrypt_aes_gcm(struct aead_request *req); ++int crypto4xx_decrypt_aes_gcm(struct aead_request *req); + + #endif diff --git a/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch new file mode 100644 index 000000000..28969a7b4 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0001-net-ibm-emac-replace-custom-rgmii_mode_name-with-phy.patch @@ -0,0 +1,51 @@ +From 54e1b3004eb85f9317f6c4ceff2e097231c7f52a Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 20 Dec 2017 22:11:22 +0100 +Subject: [PATCH 1/3] net: ibm: emac: replace custom rgmii_mode_name with + phy_modes + +The common phylib defines the same names (in lower-case). +Since rgmii_mode_name() is used only in one place and +for a "notice-level" printk, I think it can be replaced. + +Signed-off-by: Christian Lamparter +--- + drivers/net/ethernet/ibm/emac/rgmii.c | 20 +------------------- + 1 file changed, 1 insertion(+), 19 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -59,24 +59,6 @@ static inline int rgmii_valid_mode(int p + phy_mode == PHY_MODE_RTBI; + } + +-static inline const char *rgmii_mode_name(int mode) +-{ +- switch (mode) { +- case PHY_MODE_RGMII: +- return "RGMII"; +- case PHY_MODE_TBI: +- return "TBI"; +- case PHY_MODE_GMII: +- return "GMII"; +- case PHY_MODE_MII: +- return "MII"; +- case PHY_MODE_RTBI: +- return "RTBI"; +- default: +- BUG(); +- } +-} +- + static inline u32 rgmii_mode_mask(int mode, int input) + { + switch (mode) { +@@ -115,7 +97,7 @@ int rgmii_attach(struct platform_device + out_be32(&p->fer, in_be32(&p->fer) | rgmii_mode_mask(mode, input)); + + printk(KERN_NOTICE "%pOF: input %d in %s mode\n", +- ofdev->dev.of_node, input, rgmii_mode_name(mode)); ++ ofdev->dev.of_node, input, phy_modes(mode)); + + ++dev->users; + diff --git a/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch new file mode 100644 index 000000000..e4a722646 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0002-net-ibm-emac-replace-custom-PHY_MODE_-macros.patch @@ -0,0 +1,246 @@ +From 1477bea9e6931f6be96f45b9d277690a26d0cd97 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Wed, 20 Dec 2017 22:19:24 +0100 +Subject: [PATCH 2/3] net: ibm: emac: replace custom PHY_MODE_* macros + +The ibm_emac driver predates the shared PHY_INTERFACE_MODE_ +enums provided by include/linux/phy.h by a few years. + +And while the driver has been retrofitted to use the PHYLIB, +the old definitions have stuck around to this day. + +Signed-off-by: Christian Lamparter +--- + drivers/net/ethernet/ibm/emac/core.c | 20 ++++++++++---------- + drivers/net/ethernet/ibm/emac/emac.h | 13 ------------- + drivers/net/ethernet/ibm/emac/phy.c | 10 +++++----- + drivers/net/ethernet/ibm/emac/rgmii.c | 20 ++++++++++---------- + drivers/net/ethernet/ibm/emac/zmii.c | 34 +++++++++++++++++----------------- + 5 files changed, 42 insertions(+), 55 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/core.c ++++ b/drivers/net/ethernet/ibm/emac/core.c +@@ -199,18 +199,18 @@ static void __emac_set_multicast_list(st + + static inline int emac_phy_supports_gige(int phy_mode) + { +- return phy_mode == PHY_MODE_GMII || +- phy_mode == PHY_MODE_RGMII || +- phy_mode == PHY_MODE_SGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_GMII || ++ phy_mode == PHY_INTERFACE_MODE_RGMII || ++ phy_mode == PHY_INTERFACE_MODE_SGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline int emac_phy_gpcs(int phy_mode) + { +- return phy_mode == PHY_MODE_SGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_SGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline void emac_tx_enable(struct emac_instance *dev) +@@ -2865,7 +2865,7 @@ static int emac_init_config(struct emac_ + /* PHY mode needs some decoding */ + dev->phy_mode = of_get_phy_mode(np); + if (dev->phy_mode < 0) +- dev->phy_mode = PHY_MODE_NA; ++ dev->phy_mode = PHY_INTERFACE_MODE_NA; + + /* Check EMAC version */ + if (of_device_is_compatible(np, "ibm,emac4sync")) { +@@ -3168,7 +3168,7 @@ static int emac_probe(struct platform_de + printk(KERN_INFO "%s: EMAC-%d %pOF, MAC %pM\n", + ndev->name, dev->cell_index, np, ndev->dev_addr); + +- if (dev->phy_mode == PHY_MODE_SGMII) ++ if (dev->phy_mode == PHY_INTERFACE_MODE_SGMII) + printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name); + + if (dev->phy.address >= 0) +--- a/drivers/net/ethernet/ibm/emac/emac.h ++++ b/drivers/net/ethernet/ibm/emac/emac.h +@@ -104,19 +104,6 @@ struct emac_regs { + } u1; + }; + +-/* +- * PHY mode settings (EMAC <-> ZMII/RGMII bridge <-> PHY) +- */ +-#define PHY_MODE_NA PHY_INTERFACE_MODE_NA +-#define PHY_MODE_MII PHY_INTERFACE_MODE_MII +-#define PHY_MODE_RMII PHY_INTERFACE_MODE_RMII +-#define PHY_MODE_SMII PHY_INTERFACE_MODE_SMII +-#define PHY_MODE_RGMII PHY_INTERFACE_MODE_RGMII +-#define PHY_MODE_TBI PHY_INTERFACE_MODE_TBI +-#define PHY_MODE_GMII PHY_INTERFACE_MODE_GMII +-#define PHY_MODE_RTBI PHY_INTERFACE_MODE_RTBI +-#define PHY_MODE_SGMII PHY_INTERFACE_MODE_SGMII +- + /* EMACx_MR0 */ + #define EMAC_MR0_RXI 0x80000000 + #define EMAC_MR0_TXI 0x40000000 +--- a/drivers/net/ethernet/ibm/emac/phy.c ++++ b/drivers/net/ethernet/ibm/emac/phy.c +@@ -96,7 +96,7 @@ int emac_mii_reset_gpcs(struct mii_phy * + if ((val & BMCR_ISOLATE) && limit > 0) + gpcs_phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE); + +- if (limit > 0 && phy->mode == PHY_MODE_SGMII) { ++ if (limit > 0 && phy->mode == PHY_INTERFACE_MODE_SGMII) { + /* Configure GPCS interface to recommended setting for SGMII */ + gpcs_phy_write(phy, 0x04, 0x8120); /* AsymPause, FDX */ + gpcs_phy_write(phy, 0x07, 0x2801); /* msg_pg, toggle */ +@@ -313,16 +313,16 @@ static int cis8201_init(struct mii_phy * + epcr &= ~EPCR_MODE_MASK; + + switch (phy->mode) { +- case PHY_MODE_TBI: ++ case PHY_INTERFACE_MODE_TBI: + epcr |= EPCR_TBI_MODE; + break; +- case PHY_MODE_RTBI: ++ case PHY_INTERFACE_MODE_RTBI: + epcr |= EPCR_RTBI_MODE; + break; +- case PHY_MODE_GMII: ++ case PHY_INTERFACE_MODE_GMII: + epcr |= EPCR_GMII_MODE; + break; +- case PHY_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII: + default: + epcr |= EPCR_RGMII_MODE; + } +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -52,25 +52,25 @@ + /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */ + static inline int rgmii_valid_mode(int phy_mode) + { +- return phy_mode == PHY_MODE_GMII || +- phy_mode == PHY_MODE_MII || +- phy_mode == PHY_MODE_RGMII || +- phy_mode == PHY_MODE_TBI || +- phy_mode == PHY_MODE_RTBI; ++ return phy_mode == PHY_INTERFACE_MODE_GMII || ++ phy_mode == PHY_INTERFACE_MODE_MII || ++ phy_mode == PHY_INTERFACE_MODE_RGMII || ++ phy_mode == PHY_INTERFACE_MODE_TBI || ++ phy_mode == PHY_INTERFACE_MODE_RTBI; + } + + static inline u32 rgmii_mode_mask(int mode, int input) + { + switch (mode) { +- case PHY_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII: + return RGMII_FER_RGMII(input); +- case PHY_MODE_TBI: ++ case PHY_INTERFACE_MODE_TBI: + return RGMII_FER_TBI(input); +- case PHY_MODE_GMII: ++ case PHY_INTERFACE_MODE_GMII: + return RGMII_FER_GMII(input); +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return RGMII_FER_MII(input); +- case PHY_MODE_RTBI: ++ case PHY_INTERFACE_MODE_RTBI: + return RGMII_FER_RTBI(input); + default: + BUG(); +--- a/drivers/net/ethernet/ibm/emac/zmii.c ++++ b/drivers/net/ethernet/ibm/emac/zmii.c +@@ -49,20 +49,20 @@ + */ + static inline int zmii_valid_mode(int mode) + { +- return mode == PHY_MODE_MII || +- mode == PHY_MODE_RMII || +- mode == PHY_MODE_SMII || +- mode == PHY_MODE_NA; ++ return mode == PHY_INTERFACE_MODE_MII || ++ mode == PHY_INTERFACE_MODE_RMII || ++ mode == PHY_INTERFACE_MODE_SMII || ++ mode == PHY_INTERFACE_MODE_NA; + } + + static inline const char *zmii_mode_name(int mode) + { + switch (mode) { +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return "MII"; +- case PHY_MODE_RMII: ++ case PHY_INTERFACE_MODE_RMII: + return "RMII"; +- case PHY_MODE_SMII: ++ case PHY_INTERFACE_MODE_SMII: + return "SMII"; + default: + BUG(); +@@ -72,11 +72,11 @@ static inline const char *zmii_mode_name + static inline u32 zmii_mode_mask(int mode, int input) + { + switch (mode) { +- case PHY_MODE_MII: ++ case PHY_INTERFACE_MODE_MII: + return ZMII_FER_MII(input); +- case PHY_MODE_RMII: ++ case PHY_INTERFACE_MODE_RMII: + return ZMII_FER_RMII(input); +- case PHY_MODE_SMII: ++ case PHY_INTERFACE_MODE_SMII: + return ZMII_FER_SMII(input); + default: + return 0; +@@ -106,18 +106,18 @@ int zmii_attach(struct platform_device * + * Please, always specify PHY mode in your board port to avoid + * any surprises. + */ +- if (dev->mode == PHY_MODE_NA) { +- if (*mode == PHY_MODE_NA) { ++ if (dev->mode == PHY_INTERFACE_MODE_NA) { ++ if (*mode == PHY_INTERFACE_MODE_NA) { + u32 r = dev->fer_save; + + ZMII_DBG(dev, "autodetecting mode, FER = 0x%08x" NL, r); + + if (r & (ZMII_FER_MII(0) | ZMII_FER_MII(1))) +- dev->mode = PHY_MODE_MII; ++ dev->mode = PHY_INTERFACE_MODE_MII; + else if (r & (ZMII_FER_RMII(0) | ZMII_FER_RMII(1))) +- dev->mode = PHY_MODE_RMII; ++ dev->mode = PHY_INTERFACE_MODE_RMII; + else +- dev->mode = PHY_MODE_SMII; ++ dev->mode = PHY_INTERFACE_MODE_SMII; + } else + dev->mode = *mode; + +@@ -126,7 +126,7 @@ int zmii_attach(struct platform_device * + zmii_mode_name(dev->mode)); + } else { + /* All inputs must use the same mode */ +- if (*mode != PHY_MODE_NA && *mode != dev->mode) { ++ if (*mode != PHY_INTERFACE_MODE_NA && *mode != dev->mode) { + printk(KERN_ERR + "%pOF: invalid mode %d specified for input %d\n", + ofdev->dev.of_node, *mode, input); +@@ -246,7 +246,7 @@ static int zmii_probe(struct platform_de + + mutex_init(&dev->lock); + dev->ofdev = ofdev; +- dev->mode = PHY_MODE_NA; ++ dev->mode = PHY_INTERFACE_MODE_NA; + + rc = -ENXIO; + if (of_address_to_resource(np, 0, ®s)) { diff --git a/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch new file mode 100644 index 000000000..16074c7ee --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/030-0003-net-ibm-emac-support-RGMII-RX-TX-ID-phymode.patch @@ -0,0 +1,59 @@ +From 0a49f0d1958440f7928047433c983eece05a3723 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 14 Dec 2017 19:51:50 +0100 +Subject: [PATCH 3/3] net: ibm: emac: support RGMII-[RX|TX]ID phymode + +The RGMII spec allows compliance for devices that implement an internal +delay on TXC and/or RXC inside the transmitter. This patch adds the +necessary RGMII_[RX|TX]ID mode code to handle such PHYs with the +emac driver. + +Signed-off-by: Christian Lamparter + +--- +v3: - replace PHY_MODE_* with PHY_INTERFACE_MODE_* + - replace rgmii_mode_name() with phy_modes[] + +v2: - utilize phy_interface_mode_is_rgmii() +--- + drivers/net/ethernet/ibm/emac/core.c | 4 ++-- + drivers/net/ethernet/ibm/emac/rgmii.c | 7 +++++-- + 2 files changed, 7 insertions(+), 4 deletions(-) + +--- a/drivers/net/ethernet/ibm/emac/core.c ++++ b/drivers/net/ethernet/ibm/emac/core.c +@@ -199,8 +199,8 @@ static void __emac_set_multicast_list(st + + static inline int emac_phy_supports_gige(int phy_mode) + { +- return phy_mode == PHY_INTERFACE_MODE_GMII || +- phy_mode == PHY_INTERFACE_MODE_RGMII || ++ return phy_interface_mode_is_rgmii(phy_mode) || ++ phy_mode == PHY_INTERFACE_MODE_GMII || + phy_mode == PHY_INTERFACE_MODE_SGMII || + phy_mode == PHY_INTERFACE_MODE_TBI || + phy_mode == PHY_INTERFACE_MODE_RTBI; +--- a/drivers/net/ethernet/ibm/emac/rgmii.c ++++ b/drivers/net/ethernet/ibm/emac/rgmii.c +@@ -52,9 +52,9 @@ + /* RGMII bridge supports only GMII/TBI and RGMII/RTBI PHYs */ + static inline int rgmii_valid_mode(int phy_mode) + { +- return phy_mode == PHY_INTERFACE_MODE_GMII || ++ return phy_interface_mode_is_rgmii(phy_mode) || ++ phy_mode == PHY_INTERFACE_MODE_GMII || + phy_mode == PHY_INTERFACE_MODE_MII || +- phy_mode == PHY_INTERFACE_MODE_RGMII || + phy_mode == PHY_INTERFACE_MODE_TBI || + phy_mode == PHY_INTERFACE_MODE_RTBI; + } +@@ -63,6 +63,9 @@ static inline u32 rgmii_mode_mask(int mo + { + switch (mode) { + case PHY_INTERFACE_MODE_RGMII: ++ case PHY_INTERFACE_MODE_RGMII_ID: ++ case PHY_INTERFACE_MODE_RGMII_RXID: ++ case PHY_INTERFACE_MODE_RGMII_TXID: + return RGMII_FER_RGMII(input); + case PHY_INTERFACE_MODE_TBI: + return RGMII_FER_TBI(input); diff --git a/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch new file mode 100644 index 000000000..fc8df3886 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0001-crypto-crypto4xx-shuffle-iomap-in-front-of-request_i.patch @@ -0,0 +1,71 @@ +From 4baa099377d73ea99c7802a9685815b32e8bf119 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:08:18 +0100 +Subject: [PATCH 1/6] crypto: crypto4xx - shuffle iomap in front of request_irq + +It is possible to avoid the ce_base null pointer check in the +drivers' interrupt handler routine "crypto4xx_ce_interrupt_handler()" +by simply doing the iomap in front of the IRQ registration. + +This way, the ce_base will always be valid in the handler and +a branch in an critical path can be avoided. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1075,9 +1075,6 @@ static irqreturn_t crypto4xx_ce_interrup + struct device *dev = (struct device *)data; + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + +- if (!core_dev->dev->ce_base) +- return 0; +- + writel(PPC4XX_INTERRUPT_CLR, + core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); + tasklet_schedule(&core_dev->tasklet); +@@ -1325,13 +1322,6 @@ static int crypto4xx_probe(struct platfo + tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb, + (unsigned long) dev); + +- /* Register for Crypto isr, Crypto Engine IRQ */ +- core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); +- rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, +- core_dev->dev->name, dev); +- if (rc) +- goto err_request_irq; +- + core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0); + if (!core_dev->dev->ce_base) { + dev_err(dev, "failed to of_iomap\n"); +@@ -1339,6 +1329,13 @@ static int crypto4xx_probe(struct platfo + goto err_iomap; + } + ++ /* Register for Crypto isr, Crypto Engine IRQ */ ++ core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); ++ rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, ++ core_dev->dev->name, dev); ++ if (rc) ++ goto err_request_irq; ++ + /* need to setup pdr, rdr, gdr and sdr before this */ + crypto4xx_hw_init(core_dev->dev); + +@@ -1352,11 +1349,11 @@ static int crypto4xx_probe(struct platfo + return 0; + + err_start_dev: +- iounmap(core_dev->dev->ce_base); +-err_iomap: + free_irq(core_dev->irq, dev); + err_request_irq: + irq_dispose_mapping(core_dev->irq); ++ iounmap(core_dev->dev->ce_base); ++err_iomap: + tasklet_kill(&core_dev->tasklet); + err_build_sdr: + crypto4xx_destroy_sdr(core_dev->dev); diff --git a/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch new file mode 100644 index 000000000..1adad96fe --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0002-crypto-crypto4xx-support-Revision-B-parts.patch @@ -0,0 +1,150 @@ +From 1e932b627e79aa2c70e2c7278e4ac930303faa3f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:09:18 +0100 +Subject: [PATCH 2/6] crypto: crypto4xx - support Revision B parts + +This patch adds support for the crypto4xx RevB cores +found in the 460EX, 460SX and later cores (like the APM821xx). + +Without this patch, the crypto4xx driver will not be +able to process any offloaded requests and simply hang +indefinitely. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 48 +++++++++++++++++++++++++++++---- + drivers/crypto/amcc/crypto4xx_core.h | 1 + + drivers/crypto/amcc/crypto4xx_reg_def.h | 4 ++- + 3 files changed, 47 insertions(+), 6 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -128,7 +128,14 @@ static void crypto4xx_hw_init(struct cry + writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT); + writel(PPC4XX_INT_DESCR_CNT, dev->ce_base + CRYPTO4XX_INT_DESCR_CNT); + writel(PPC4XX_INT_CFG, dev->ce_base + CRYPTO4XX_INT_CFG); +- writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN); ++ if (dev->is_revb) { ++ writel(PPC4XX_INT_TIMEOUT_CNT_REVB << 10, ++ dev->ce_base + CRYPTO4XX_INT_TIMEOUT_CNT); ++ writel(PPC4XX_PD_DONE_INT | PPC4XX_TMO_ERR_INT, ++ dev->ce_base + CRYPTO4XX_INT_EN); ++ } else { ++ writel(PPC4XX_PD_DONE_INT, dev->ce_base + CRYPTO4XX_INT_EN); ++ } + } + + int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) +@@ -1070,18 +1077,29 @@ static void crypto4xx_bh_tasklet_cb(unsi + /** + * Top Half of isr. + */ +-static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data) ++static inline irqreturn_t crypto4xx_interrupt_handler(int irq, void *data, ++ u32 clr_val) + { + struct device *dev = (struct device *)data; + struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); + +- writel(PPC4XX_INTERRUPT_CLR, +- core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); ++ writel(clr_val, core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); + tasklet_schedule(&core_dev->tasklet); + + return IRQ_HANDLED; + } + ++static irqreturn_t crypto4xx_ce_interrupt_handler(int irq, void *data) ++{ ++ return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR); ++} ++ ++static irqreturn_t crypto4xx_ce_interrupt_handler_revb(int irq, void *data) ++{ ++ return crypto4xx_interrupt_handler(irq, data, PPC4XX_INTERRUPT_CLR | ++ PPC4XX_TMO_ERR_INT); ++} ++ + /** + * Supported Crypto Algorithms + */ +@@ -1263,6 +1281,8 @@ static int crypto4xx_probe(struct platfo + struct resource res; + struct device *dev = &ofdev->dev; + struct crypto4xx_core_device *core_dev; ++ u32 pvr; ++ bool is_revb = true; + + rc = of_address_to_resource(ofdev->dev.of_node, 0, &res); + if (rc) +@@ -1279,6 +1299,7 @@ static int crypto4xx_probe(struct platfo + mfdcri(SDR0, PPC405EX_SDR0_SRST) | PPC405EX_CE_RESET); + mtdcri(SDR0, PPC405EX_SDR0_SRST, + mfdcri(SDR0, PPC405EX_SDR0_SRST) & ~PPC405EX_CE_RESET); ++ is_revb = false; + } else if (of_find_compatible_node(NULL, NULL, + "amcc,ppc460sx-crypto")) { + mtdcri(SDR0, PPC460SX_SDR0_SRST, +@@ -1301,7 +1322,22 @@ static int crypto4xx_probe(struct platfo + if (!core_dev->dev) + goto err_alloc_dev; + ++ /* ++ * Older version of 460EX/GT have a hardware bug. ++ * Hence they do not support H/W based security intr coalescing ++ */ ++ pvr = mfspr(SPRN_PVR); ++ if (is_revb && ((pvr >> 4) == 0x130218A)) { ++ u32 min = PVR_MIN(pvr); ++ ++ if (min < 4) { ++ dev_info(dev, "RevA detected - disable interrupt coalescing\n"); ++ is_revb = false; ++ } ++ } ++ + core_dev->dev->core_dev = core_dev; ++ core_dev->dev->is_revb = is_revb; + core_dev->device = dev; + spin_lock_init(&core_dev->lock); + INIT_LIST_HEAD(&core_dev->dev->alg_list); +@@ -1331,7 +1367,9 @@ static int crypto4xx_probe(struct platfo + + /* Register for Crypto isr, Crypto Engine IRQ */ + core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); +- rc = request_irq(core_dev->irq, crypto4xx_ce_interrupt_handler, 0, ++ rc = request_irq(core_dev->irq, is_revb ? ++ crypto4xx_ce_interrupt_handler_revb : ++ crypto4xx_ce_interrupt_handler, 0, + core_dev->dev->name, dev); + if (rc) + goto err_request_irq; +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -109,6 +109,7 @@ struct crypto4xx_device { + struct list_head alg_list; /* List of algorithm supported + by this device */ + struct ratelimit_state aead_ratelimit; ++ bool is_revb; + }; + + struct crypto4xx_core_device { +--- a/drivers/crypto/amcc/crypto4xx_reg_def.h ++++ b/drivers/crypto/amcc/crypto4xx_reg_def.h +@@ -121,13 +121,15 @@ + #define PPC4XX_PD_SIZE 6 + #define PPC4XX_CTX_DONE_INT 0x2000 + #define PPC4XX_PD_DONE_INT 0x8000 ++#define PPC4XX_TMO_ERR_INT 0x40000 + #define PPC4XX_BYTE_ORDER 0x22222 + #define PPC4XX_INTERRUPT_CLR 0x3ffff + #define PPC4XX_PRNG_CTRL_AUTO_EN 0x3 + #define PPC4XX_DC_3DES_EN 1 + #define PPC4XX_TRNG_EN 0x00020000 +-#define PPC4XX_INT_DESCR_CNT 4 ++#define PPC4XX_INT_DESCR_CNT 7 + #define PPC4XX_INT_TIMEOUT_CNT 0 ++#define PPC4XX_INT_TIMEOUT_CNT_REVB 0x3FF + #define PPC4XX_INT_CFG 1 + /** + * all follow define are ad hoc diff --git a/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch new file mode 100644 index 000000000..a295fa461 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0003-crypto-crypto4xx-fix-missing-irq-devname.patch @@ -0,0 +1,37 @@ +From 00179ef6e3c4e5db6258cd6e273e4063b8437d18 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:10:18 +0100 +Subject: [PATCH 3/6] crypto: crypto4xx - fix missing irq devname + +crypto4xx_device's name variable is not set to anything. +The common devname for request_irq seems to be the module +name. This will fix the seemingly anonymous interrupt +entry in /proc/interrupts for crypto4xx. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1370,7 +1370,7 @@ static int crypto4xx_probe(struct platfo + rc = request_irq(core_dev->irq, is_revb ? + crypto4xx_ce_interrupt_handler_revb : + crypto4xx_ce_interrupt_handler, 0, +- core_dev->dev->name, dev); ++ KBUILD_MODNAME, dev); + if (rc) + goto err_request_irq; + +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -82,7 +82,6 @@ struct pd_uinfo { + + struct crypto4xx_device { + struct crypto4xx_core_device *core_dev; +- char *name; + void __iomem *ce_base; + void __iomem *trng_base; + diff --git a/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch new file mode 100644 index 000000000..4ee99f44c --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0004-crypto-crypto4xx-kill-MODULE_NAME.patch @@ -0,0 +1,47 @@ +From c3621f23fed7d6fff33083ae538004ea59c01d8f Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 15:11:18 +0100 +Subject: [PATCH 4/6] crypto: crypto4xx - kill MODULE_NAME + +KBUILD_MODNAME provides the same value. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_core.c | 2 +- + drivers/crypto/amcc/crypto4xx_core.h | 2 -- + drivers/crypto/amcc/crypto4xx_trng.c | 2 +- + 3 files changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -1432,7 +1432,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match) + + static struct platform_driver crypto4xx_driver = { + .driver = { +- .name = MODULE_NAME, ++ .name = KBUILD_MODNAME, + .of_match_table = crypto4xx_match, + }, + .probe = crypto4xx_probe, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -28,8 +28,6 @@ + #include "crypto4xx_reg_def.h" + #include "crypto4xx_sa.h" + +-#define MODULE_NAME "crypto4xx" +- + #define PPC460SX_SDR0_SRST 0x201 + #define PPC405EX_SDR0_SRST 0x200 + #define PPC460EX_SDR0_SRST 0x201 +--- a/drivers/crypto/amcc/crypto4xx_trng.c ++++ b/drivers/crypto/amcc/crypto4xx_trng.c +@@ -92,7 +92,7 @@ void ppc4xx_trng_probe(struct crypto4xx_ + if (!rng) + goto err_out; + +- rng->name = MODULE_NAME; ++ rng->name = KBUILD_MODNAME; + rng->data_present = ppc4xx_trng_data_present; + rng->data_read = ppc4xx_trng_data_read; + rng->priv = (unsigned long) dev; diff --git a/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch new file mode 100644 index 000000000..0dbd924e3 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0005-crypto-crypto4xx-perform-aead-icv-check-in-the-drive.patch @@ -0,0 +1,146 @@ +From 5b3856d1d98e6f6a58b70c1c0d7da3fb5f042e9c Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 16:00:01 +0100 +Subject: [PATCH 5/6] crypto: crypto4xx - perform aead icv check in the driver + +The ccm-aes-ppc4xx now fails one of testmgr's expected +failure test cases as such: + +alg: aead: decryption failed on test 10 for ccm-aes-ppc4xx: ret was 0, expected -EBADMSG + +Upon closer inspection, it turned out that the hardware's +crypto flags that would indicate an authentification failure +are not set by the hardware. The original vendor source from +which this was ported does not have any special code or notes +about why this would happen or if there are any WAs. + +Hence, this patch converts the aead_done callback handler to +perform the icv check in the driver. And this fixes the false +negative and the ccm-aes-ppc4xx passes the selftests once again. + +|name : ccm(aes) +|driver : ccm-aes-ppc4xx +|module : crypto4xx +|priority : 300 +|refcnt : 1 +|selftest : passed +|internal : no +|type : aead +|async : yes +|blocksize : 1 +|ivsize : 16 +|maxauthsize : 16 +|geniv : + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_alg.c | 6 +--- + drivers/crypto/amcc/crypto4xx_core.c | 54 ++++++++++++++++++------------------ + 2 files changed, 28 insertions(+), 32 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -256,10 +256,6 @@ static inline bool crypto4xx_aead_need_f + if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3)) + return true; + +- /* CCM - fix CBC MAC mismatch in special case */ +- if (is_ccm && decrypt && !req->assoclen) +- return true; +- + return false; + } + +@@ -330,7 +326,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp + sa = (struct dynamic_sa_ctl *) ctx->sa_in; + sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); + +- set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, ++ set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV, + SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, + SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC, + SA_CIPHER_ALG_AES, +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -577,15 +577,14 @@ static void crypto4xx_aead_done(struct c + struct pd_uinfo *pd_uinfo, + struct ce_pd *pd) + { +- struct aead_request *aead_req; +- struct crypto4xx_ctx *ctx; ++ struct aead_request *aead_req = container_of(pd_uinfo->async_req, ++ struct aead_request, base); + struct scatterlist *dst = pd_uinfo->dest_va; ++ size_t cp_len = crypto_aead_authsize( ++ crypto_aead_reqtfm(aead_req)); ++ u32 icv[cp_len]; + int err = 0; + +- aead_req = container_of(pd_uinfo->async_req, struct aead_request, +- base); +- ctx = crypto_tfm_ctx(aead_req->base.tfm); +- + if (pd_uinfo->using_sd) { + crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, + pd->pd_ctl_len.bf.pkt_len, +@@ -597,38 +596,39 @@ static void crypto4xx_aead_done(struct c + + if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { + /* append icv at the end */ +- size_t cp_len = crypto_aead_authsize( +- crypto_aead_reqtfm(aead_req)); +- u32 icv[cp_len]; +- + crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, + cp_len); + + scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, + cp_len, 1); ++ } else { ++ /* check icv at the end */ ++ scatterwalk_map_and_copy(icv, aead_req->src, ++ aead_req->assoclen + aead_req->cryptlen - ++ cp_len, cp_len, 0); ++ ++ crypto4xx_memcpy_from_le32(icv, icv, cp_len); ++ ++ if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len)) ++ err = -EBADMSG; + } + + crypto4xx_ret_sg_desc(dev, pd_uinfo); + + if (pd->pd_ctl.bf.status & 0xff) { +- if (pd->pd_ctl.bf.status & 0x1) { +- /* authentication error */ +- err = -EBADMSG; +- } else { +- if (!__ratelimit(&dev->aead_ratelimit)) { +- if (pd->pd_ctl.bf.status & 2) +- pr_err("pad fail error\n"); +- if (pd->pd_ctl.bf.status & 4) +- pr_err("seqnum fail\n"); +- if (pd->pd_ctl.bf.status & 8) +- pr_err("error _notify\n"); +- pr_err("aead return err status = 0x%02x\n", +- pd->pd_ctl.bf.status & 0xff); +- pr_err("pd pad_ctl = 0x%08x\n", +- pd->pd_ctl.bf.pd_pad_ctl); +- } +- err = -EINVAL; ++ if (!__ratelimit(&dev->aead_ratelimit)) { ++ if (pd->pd_ctl.bf.status & 2) ++ pr_err("pad fail error\n"); ++ if (pd->pd_ctl.bf.status & 4) ++ pr_err("seqnum fail\n"); ++ if (pd->pd_ctl.bf.status & 8) ++ pr_err("error _notify\n"); ++ pr_err("aead return err status = 0x%02x\n", ++ pd->pd_ctl.bf.status & 0xff); ++ pr_err("pd pad_ctl = 0x%08x\n", ++ pd->pd_ctl.bf.pd_pad_ctl); + } ++ err = -EINVAL; + } + + if (pd_uinfo->state & PD_ENTRY_BUSY) diff --git a/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch new file mode 100644 index 000000000..0475fdaf8 --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/120-0006-crypto-crypto4xx-performance-optimizations.patch @@ -0,0 +1,158 @@ +From 30afcbb01a750a1ef0cee8a0861a347912c2e4fb Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Thu, 21 Dec 2017 16:00:01 +0100 +Subject: [PATCH 6/6] crypto: crypto4xx - performance optimizations + +This patch provides a cheap 2MiB/s+ (~ 6%) performance +improvement over the current code. This is because the +compiler can now optimize several endian swap memcpy. + +Signed-off-by: Christian Lamparter +--- + drivers/crypto/amcc/crypto4xx_alg.c | 32 +++++++++++++++++++------------- + drivers/crypto/amcc/crypto4xx_core.c | 22 +++++++++++----------- + drivers/crypto/amcc/crypto4xx_core.h | 6 ++++-- + 3 files changed, 34 insertions(+), 26 deletions(-) + +--- a/drivers/crypto/amcc/crypto4xx_alg.c ++++ b/drivers/crypto/amcc/crypto4xx_alg.c +@@ -74,32 +74,38 @@ static void set_dynamic_sa_command_1(str + sa->sa_command_1.bf.copy_hdr = cp_hdr; + } + +-int crypto4xx_encrypt(struct ablkcipher_request *req) ++static inline int crypto4xx_crypt(struct ablkcipher_request *req, ++ const unsigned int ivlen, bool decrypt) + { + struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- unsigned int ivlen = crypto_ablkcipher_ivsize( +- crypto_ablkcipher_reqtfm(req)); + __le32 iv[ivlen]; + + if (ivlen) + crypto4xx_memcpy_to_le32(iv, req->info, ivlen); + + return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_out, ctx->sa_len, 0); ++ req->nbytes, iv, ivlen, decrypt ? ctx->sa_in : ctx->sa_out, ++ ctx->sa_len, 0); + } + +-int crypto4xx_decrypt(struct ablkcipher_request *req) ++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req) + { +- struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); +- unsigned int ivlen = crypto_ablkcipher_ivsize( +- crypto_ablkcipher_reqtfm(req)); +- __le32 iv[ivlen]; ++ return crypto4xx_crypt(req, 0, false); ++} + +- if (ivlen) +- crypto4xx_memcpy_to_le32(iv, req->info, ivlen); ++int crypto4xx_encrypt_iv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, AES_IV_SIZE, false); ++} + +- return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, +- req->nbytes, iv, ivlen, ctx->sa_in, ctx->sa_len, 0); ++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, 0, true); ++} ++ ++int crypto4xx_decrypt_iv(struct ablkcipher_request *req) ++{ ++ return crypto4xx_crypt(req, AES_IV_SIZE, true); + } + + /** +--- a/drivers/crypto/amcc/crypto4xx_core.c ++++ b/drivers/crypto/amcc/crypto4xx_core.c +@@ -582,7 +582,7 @@ static void crypto4xx_aead_done(struct c + struct scatterlist *dst = pd_uinfo->dest_va; + size_t cp_len = crypto_aead_authsize( + crypto_aead_reqtfm(aead_req)); +- u32 icv[cp_len]; ++ u32 icv[AES_BLOCK_SIZE]; + int err = 0; + + if (pd_uinfo->using_sd) { +@@ -597,7 +597,7 @@ static void crypto4xx_aead_done(struct c + if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { + /* append icv at the end */ + crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, +- cp_len); ++ sizeof(icv)); + + scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, + cp_len, 1); +@@ -607,7 +607,7 @@ static void crypto4xx_aead_done(struct c + aead_req->assoclen + aead_req->cryptlen - + cp_len, cp_len, 0); + +- crypto4xx_memcpy_from_le32(icv, icv, cp_len); ++ crypto4xx_memcpy_from_le32(icv, icv, sizeof(icv)); + + if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len)) + err = -EBADMSG; +@@ -1124,8 +1124,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cbc, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + }}, +@@ -1148,8 +1148,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_cfb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + } }, +@@ -1197,8 +1197,8 @@ static struct crypto4xx_alg_common crypt + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, + .setkey = crypto4xx_setkey_aes_ecb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_noiv, ++ .decrypt = crypto4xx_decrypt_noiv, + } + } + } }, +@@ -1221,8 +1221,8 @@ static struct crypto4xx_alg_common crypt + .max_keysize = AES_MAX_KEY_SIZE, + .ivsize = AES_IV_SIZE, + .setkey = crypto4xx_setkey_aes_ofb, +- .encrypt = crypto4xx_encrypt, +- .decrypt = crypto4xx_decrypt, ++ .encrypt = crypto4xx_encrypt_iv, ++ .decrypt = crypto4xx_decrypt_iv, + } + } + } }, +--- a/drivers/crypto/amcc/crypto4xx_core.h ++++ b/drivers/crypto/amcc/crypto4xx_core.h +@@ -168,8 +168,10 @@ int crypto4xx_setkey_aes_ofb(struct cryp + const u8 *key, unsigned int keylen); + int crypto4xx_setkey_rfc3686(struct crypto_ablkcipher *cipher, + const u8 *key, unsigned int keylen); +-int crypto4xx_encrypt(struct ablkcipher_request *req); +-int crypto4xx_decrypt(struct ablkcipher_request *req); ++int crypto4xx_encrypt_iv(struct ablkcipher_request *req); ++int crypto4xx_decrypt_iv(struct ablkcipher_request *req); ++int crypto4xx_encrypt_noiv(struct ablkcipher_request *req); ++int crypto4xx_decrypt_noiv(struct ablkcipher_request *req); + int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req); + int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req); + int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm); diff --git a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch similarity index 95% rename from target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch rename to target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch index 018bcf21a..e9f6c5cfc 100644 --- a/target/linux/apm821xx/patches-4.9/200-add-meraki-mr24-ikarem-support.patch +++ b/target/linux/apm821xx/patches-4.14/200-add-meraki-mr24-ikarem-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -40,6 +40,19 @@ config EBONY +@@ -41,6 +41,19 @@ config EBONY help This option enables support for the IBM PPC440GP evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch similarity index 94% rename from target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch rename to target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch index 0581a43e3..18982392d 100644 --- a/target/linux/apm821xx/patches-4.9/201-add-amcc-apollo3g-support.patch +++ b/target/linux/apm821xx/patches-4.14/201-add-amcc-apollo3g-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -143,6 +143,17 @@ config CANYONLANDS +@@ -144,6 +144,17 @@ config CANYONLANDS help This option enables support for the AMCC PPC460EX evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch similarity index 88% rename from target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch rename to target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch index 6b6db1ddd..77294a8cb 100644 --- a/target/linux/apm821xx/patches-4.9/202-add-netgear-wndr4700-support.patch +++ b/target/linux/apm821xx/patches-4.14/202-add-netgear-wndr4700-support.patch @@ -1,7 +1,7 @@ --- a/arch/powerpc/platforms/44x/Makefile +++ b/arch/powerpc/platforms/44x/Makefile -@@ -3,6 +3,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) - obj-$(CONFIG_44x) += idle.o +@@ -4,6 +4,7 @@ ifneq ($(CONFIG_PPC4xx_CPM),y) + obj-y += idle.o endif obj-$(CONFIG_PPC44x_SIMPLE) += ppc44x_simple.o +obj-$(CONFIG_WNDR4700) += wndr4700.o @@ -10,7 +10,7 @@ obj-$(CONFIG_WARP) += warp.o --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -260,6 +260,19 @@ config ICON +@@ -273,6 +273,19 @@ config ICON help This option enables support for the AMCC PPC440SPe evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch similarity index 95% rename from target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch rename to target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch index 8c072387d..c3931c980 100644 --- a/target/linux/apm821xx/patches-4.9/203-add-meraki-mx60-buckminster-support.patch +++ b/target/linux/apm821xx/patches-4.14/203-add-meraki-mx60-buckminster-support.patch @@ -1,6 +1,6 @@ --- a/arch/powerpc/platforms/44x/Kconfig +++ b/arch/powerpc/platforms/44x/Kconfig -@@ -30,6 +30,19 @@ config BLUESTONE +@@ -31,6 +31,19 @@ config BLUESTONE help This option enables support for the APM APM821xx Evaluation board. diff --git a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch similarity index 88% rename from target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch rename to target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch index 0b1affcfe..110726d25 100644 --- a/target/linux/apm821xx/patches-4.9/300-fix-atheros-nics-on-apm82181.patch +++ b/target/linux/apm821xx/patches-4.14/300-fix-atheros-nics-on-apm82181.patch @@ -1,6 +1,6 @@ ---- a/arch/powerpc/sysdev/ppc4xx_pci.c -+++ b/arch/powerpc/sysdev/ppc4xx_pci.c -@@ -1066,15 +1066,24 @@ static int __init apm821xx_pciex_init_po +--- a/arch/powerpc/platforms/4xx/pci.c ++++ b/arch/powerpc/platforms/4xx/pci.c +@@ -1060,15 +1060,24 @@ static int __init apm821xx_pciex_init_po u32 val; /* @@ -33,7 +33,7 @@ if (port->endpoint) val = PTYPE_LEGACY_ENDPOINT << 20; -@@ -1091,9 +1100,12 @@ static int __init apm821xx_pciex_init_po +@@ -1085,9 +1094,12 @@ static int __init apm821xx_pciex_init_po mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130); mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006); diff --git a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch similarity index 74% rename from target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch rename to target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch index d6a100617..6eb04b2c2 100644 --- a/target/linux/apm821xx/patches-4.9/301-fix-memory-map-wndr4700.patch +++ b/target/linux/apm821xx/patches-4.14/301-fix-memory-map-wndr4700.patch @@ -1,6 +1,6 @@ ---- a/arch/powerpc/sysdev/ppc4xx_pci.c -+++ b/arch/powerpc/sysdev/ppc4xx_pci.c -@@ -1913,9 +1913,9 @@ static void __init ppc4xx_configure_pcie +--- a/arch/powerpc/platforms/4xx/pci.c ++++ b/arch/powerpc/platforms/4xx/pci.c +@@ -1905,9 +1905,9 @@ static void __init ppc4xx_configure_pcie * if it works */ out_le32(mbase + PECFG_PIM0LAL, 0x00000000); diff --git a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch similarity index 91% rename from target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch rename to target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch index 457c5e378..7f630a3c2 100644 --- a/target/linux/apm821xx/patches-4.9/701-powerpc_ibm_apm82181_phyclk_fix.patch +++ b/target/linux/apm821xx/patches-4.14/701-powerpc_ibm_apm82181_phyclk_fix.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/ibm/emac/core.c +++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -129,6 +129,7 @@ static inline void emac_report_timeout_e +@@ -130,6 +130,7 @@ static inline void emac_report_timeout_e { if (emac_has_feature(dev, EMAC_FTR_440GX_PHY_CLK_FIX | EMAC_FTR_460EX_PHY_CLK_FIX | @@ -30,7 +30,7 @@ #endif } -@@ -2617,6 +2626,7 @@ static int emac_init_config(struct emac_ +@@ -2879,6 +2888,7 @@ static int emac_init_config(struct emac_ if (of_device_is_compatible(np, "ibm,emac-apm821xx")) { dev->features |= (EMAC_APM821XX_REQ_JUMBO_FRAME_SIZE | EMAC_FTR_APM821XX_NO_HALF_DUPLEX | @@ -40,7 +40,7 @@ } else if (of_device_is_compatible(np, "ibm,emac4")) { --- a/drivers/net/ethernet/ibm/emac/core.h +++ b/drivers/net/ethernet/ibm/emac/core.h -@@ -333,6 +333,8 @@ struct emac_instance { +@@ -335,6 +335,8 @@ struct emac_instance { */ #define EMAC_FTR_APM821XX_NO_HALF_DUPLEX 0x00001000 diff --git a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch similarity index 98% rename from target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch rename to target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch index b30511d75..144a06970 100644 --- a/target/linux/apm821xx/patches-4.9/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch +++ b/target/linux/apm821xx/patches-4.14/801-usb-xhci-add-firmware-loader-for-uPD720201-and-uPD72.patch @@ -44,7 +44,7 @@ Signed-off-by: Christian Lamparter #include "xhci.h" #include "xhci-trace.h" -@@ -239,6 +241,458 @@ static void xhci_pme_acpi_rtd3_enable(st +@@ -238,6 +240,458 @@ static void xhci_pme_acpi_rtd3_enable(st static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } #endif /* CONFIG_ACPI */ @@ -503,7 +503,7 @@ Signed-off-by: Christian Lamparter /* called during probe() after chip reset completes */ static int xhci_pci_setup(struct usb_hcd *hcd) { -@@ -278,6 +732,22 @@ static int xhci_pci_probe(struct pci_dev +@@ -273,6 +727,22 @@ static int xhci_pci_probe(struct pci_dev struct hc_driver *driver; struct usb_hcd *hcd; @@ -525,8 +525,8 @@ Signed-off-by: Christian Lamparter + driver = (struct hc_driver *)id->driver_data; - /* Prevent runtime suspending between USB-2 and USB-3 initialization */ -@@ -335,6 +805,16 @@ static void xhci_pci_remove(struct pci_d + /* For some HW implementation, a XHCI reset is just not enough... */ +@@ -337,6 +807,16 @@ static void xhci_pci_remove(struct pci_d { struct xhci_hcd *xhci; diff --git a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch similarity index 91% rename from target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch rename to target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch index 354857105..ec97f16e2 100644 --- a/target/linux/apm821xx/patches-4.9/802-usb-xhci-force-msi-renesas-xhci.patch +++ b/target/linux/apm821xx/patches-4.14/802-usb-xhci-force-msi-renesas-xhci.patch @@ -24,7 +24,7 @@ produce a noisy warning. --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c -@@ -390,10 +390,14 @@ static int xhci_try_enable_msi(struct us +@@ -357,10 +357,14 @@ static int xhci_try_enable_msi(struct us free_irq(hcd->irq, hcd); hcd->irq = 0; @@ -40,11 +40,11 @@ produce a noisy warning. + ret = xhci_setup_msi(xhci); + } - if (!ret) - /* hcd->irq is 0, we have MSI */ + if (!ret) { + hcd->msi_enabled = 1; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1680,6 +1680,7 @@ struct xhci_hcd { +@@ -1848,6 +1848,7 @@ struct xhci_hcd { /* support xHCI 0.96 spec USB2 software LPM */ unsigned sw_lpm_support:1; /* support xHCI 1.0 spec USB2 hardware LPM */ diff --git a/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch new file mode 100644 index 000000000..f8b30ae1b --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/803-hwmon-tc654-add-detection-routine.patch @@ -0,0 +1,65 @@ +From 694f9bfb8efaef8a33e8992015ff9d0866faf4a2 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 17 Dec 2017 17:27:15 +0100 +Subject: [PATCH 1/2] hwmon: tc654 add detection routine + +This patch adds a detection routine for the TC654/TC655 +chips. Both IDs are listed in the Datasheet. + +Signed-off-by: Christian Lamparter +--- + drivers/hwmon/tc654.c | 29 +++++++++++++++++++++++++++++ + 1 file changed, 29 insertions(+) + +--- a/drivers/hwmon/tc654.c ++++ b/drivers/hwmon/tc654.c +@@ -64,6 +64,11 @@ enum tc654_regs { + /* Register data is read (and cached) at most once per second. */ + #define TC654_UPDATE_INTERVAL HZ + ++/* Manufacturer and Version Identification Register Values */ ++#define TC654_MFR_ID_MICROCHIP 0x84 ++#define TC654_VER_ID 0x00 ++#define TC655_VER_ID 0x01 ++ + struct tc654_data { + struct i2c_client *client; + +@@ -497,6 +502,29 @@ static const struct i2c_device_id tc654_ + {} + }; + ++static int ++tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info) ++{ ++ struct i2c_adapter *adapter = new_client->adapter; ++ int manufacturer, product; ++ ++ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) ++ return -ENODEV; ++ ++ manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID); ++ if (manufacturer != TC654_MFR_ID_MICROCHIP) ++ return -ENODEV; ++ ++ product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID); ++ if (!((product == TC654_VER_ID) || (product == TC655_VER_ID))) ++ return -ENODEV; ++ ++ strlcpy(info->type, product == TC654_VER_ID ? "tc654" : "tc655", ++ I2C_NAME_SIZE); ++ return 0; ++} ++ ++ + MODULE_DEVICE_TABLE(i2c, tc654_id); + + static struct i2c_driver tc654_driver = { +@@ -505,6 +533,7 @@ static struct i2c_driver tc654_driver = + }, + .probe = tc654_probe, + .id_table = tc654_id, ++ .detect = tc654_detect, + }; + + module_i2c_driver(tc654_driver); diff --git a/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch new file mode 100644 index 000000000..18ed8aecc --- /dev/null +++ b/target/linux/apm821xx/patches-4.14/804-hwmon-tc654-add-thermal_cooling-device.patch @@ -0,0 +1,174 @@ +From 15ae701189744d321d3a1264ff46f8871e8765ee Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Sun, 17 Dec 2017 17:29:13 +0100 +Subject: [PATCH] hwmon: tc654: add thermal_cooling device + +This patch adds a thermaL_cooling device to the tc654 driver. +This allows the chip to be used for DT-based cooling. + +Signed-off-by: Christian Lamparter +--- + drivers/hwmon/tc654.c | 103 +++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 86 insertions(+), 17 deletions(-) + +--- a/drivers/hwmon/tc654.c ++++ b/drivers/hwmon/tc654.c +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + + enum tc654_regs { +@@ -141,6 +142,9 @@ struct tc654_data { + * writable register used to control the duty + * cycle of the V OUT output. + */ ++ ++ /* optional cooling device */ ++ struct thermal_cooling_device *cdev; + }; + + /* helper to grab and cache data, at most one time per second */ +@@ -376,36 +380,30 @@ static ssize_t set_pwm_mode(struct devic + static const int tc654_pwm_map[16] = { 77, 88, 102, 112, 124, 136, 148, 160, + 172, 184, 196, 207, 219, 231, 243, 255}; + ++static int get_pwm(struct tc654_data *data) ++{ ++ if (data->config & TC654_REG_CONFIG_SDM) ++ return 0; ++ else ++ return tc654_pwm_map[data->duty_cycle]; ++} ++ + static ssize_t show_pwm(struct device *dev, struct device_attribute *da, + char *buf) + { + struct tc654_data *data = tc654_update_client(dev); +- int pwm; + + if (IS_ERR(data)) + return PTR_ERR(data); + +- if (data->config & TC654_REG_CONFIG_SDM) +- pwm = 0; +- else +- pwm = tc654_pwm_map[data->duty_cycle]; +- +- return sprintf(buf, "%d\n", pwm); ++ return sprintf(buf, "%d\n", get_pwm(data)); + } + +-static ssize_t set_pwm(struct device *dev, struct device_attribute *da, +- const char *buf, size_t count) ++static int _set_pwm(struct tc654_data *data, unsigned long val) + { +- struct tc654_data *data = dev_get_drvdata(dev); + struct i2c_client *client = data->client; +- unsigned long val; + int ret; + +- if (kstrtoul(buf, 10, &val)) +- return -EINVAL; +- if (val > 255) +- return -EINVAL; +- + mutex_lock(&data->update_lock); + + if (val == 0) +@@ -425,6 +423,22 @@ static ssize_t set_pwm(struct device *de + + out: + mutex_unlock(&data->update_lock); ++ return ret; ++} ++ ++static ssize_t set_pwm(struct device *dev, struct device_attribute *da, ++ const char *buf, size_t count) ++{ ++ struct tc654_data *data = dev_get_drvdata(dev); ++ unsigned long val; ++ int ret; ++ ++ if (kstrtoul(buf, 10, &val)) ++ return -EINVAL; ++ if (val > 255) ++ return -EINVAL; ++ ++ ret = _set_pwm(data, val); + return ret < 0 ? ret : count; + } + +@@ -462,6 +476,47 @@ static struct attribute *tc654_attrs[] = + + ATTRIBUTE_GROUPS(tc654); + ++/* cooling device */ ++ ++static int tc654_get_max_state(struct thermal_cooling_device *cdev, ++ unsigned long *state) ++{ ++ *state = 255; ++ return 0; ++} ++ ++static int tc654_get_cur_state(struct thermal_cooling_device *cdev, ++ unsigned long *state) ++{ ++ struct tc654_data *data = tc654_update_client(cdev->devdata); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ *state = get_pwm(data); ++ return 0; ++} ++ ++static int tc654_set_cur_state(struct thermal_cooling_device *cdev, ++ unsigned long state) ++{ ++ struct tc654_data *data = tc654_update_client(cdev->devdata); ++ ++ if (IS_ERR(data)) ++ return PTR_ERR(data); ++ ++ if (state > 255) ++ return -EINVAL; ++ ++ return _set_pwm(data, state); ++} ++ ++static const struct thermal_cooling_device_ops tc654_fan_cool_ops = { ++ .get_max_state = tc654_get_max_state, ++ .get_cur_state = tc654_get_cur_state, ++ .set_cur_state = tc654_set_cur_state, ++}; ++ + /* + * device probe and removal + */ +@@ -493,7 +548,21 @@ static int tc654_probe(struct i2c_client + hwmon_dev = + devm_hwmon_device_register_with_groups(dev, client->name, data, + tc654_groups); +- return PTR_ERR_OR_ZERO(hwmon_dev); ++ if (IS_ERR(hwmon_dev)) ++ return PTR_ERR(hwmon_dev); ++ ++#if IS_ENABLED(CONFIG_OF) ++ /* Optional cooling device register for Device tree platforms */ ++ data->cdev = thermal_of_cooling_device_register(client->dev.of_node, ++ "tc654", hwmon_dev, ++ &tc654_fan_cool_ops); ++#else /* CONFIG_OF */ ++ /* Optional cooling device register for non Device tree platforms */ ++ data->cdev = thermal_cooling_device_register("tc654", hwmon_dev, ++ &tc654_fan_cool_ops); ++#endif /* CONFIG_OF */ ++ ++ return PTR_ERR_OR_ZERO(data->cdev); + } + + static const struct i2c_device_id tc654_id[] = { diff --git a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch b/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch deleted file mode 100644 index 4e53fdfa2..000000000 --- a/target/linux/apm821xx/patches-4.9/702-powerpc_ibm_phy_add_dt_parser.patch +++ /dev/null @@ -1,328 +0,0 @@ -From b1c54da602ae9215cfbde1c3ed3b6296b76f07fc Mon Sep 17 00:00:00 2001 -Message-Id: -In-Reply-To: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey@googlemail.com> -References: <246bd6614529d28dc48b11981ab5dae7a7364fc2.1486337989.git.chunkeey@googlemail.com> -From: Christian Lamparter -Date: Mon, 13 Jun 2016 15:42:21 +0200 -Subject: [RFC 2/2] net: emac: add support for device-tree based PHY discovery - and setup -To: netdev@vger.kernel.org, - devicetree@vger.kernel.org -Cc: David S. Miller , - Ivan Mikhaylov , - Mark Rutland , - Rob Herring - -This patch adds glue-code that allows the EMAC driver to interface -with the existing dt-supported PHYs in drivers/net/phy. - -Because currently, the emac driver maintains a small library of -supported phys for in a private phy.c file located in the drivers -directory. - -The support is limited to mostly single ethernet transceiver like the: -CIS8201, BCM5248, ET1011C, Marvell 88E1111 and 88E1112, AR8035. -However, routers like the Netgear WNDR4700 and Cisco Meraki MX60(W) -have a 5-port switch (QCA8327N) attached to the MDIO of the EMAC. -The switch chip has already a proper phy-driver (ar8216) that uses -the generic phy library. - -Signed-off-by: Christian Lamparter ---- ---- a/drivers/net/ethernet/ibm/emac/core.c -+++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -42,6 +42,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -2422,6 +2423,229 @@ static int emac_read_uint_prop(struct de - return 0; - } - -+static void emac_adjust_link(struct net_device *ndev) -+{ -+ struct emac_instance *dev = netdev_priv(ndev); -+ struct phy_device *phy = dev->phy_dev; -+ -+ dev->phy.autoneg = phy->autoneg; -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ dev->phy.advertising = phy->advertising; -+} -+ -+static int emac_mii_bus_read(struct mii_bus *bus, int addr, int regnum) -+{ -+ return emac_mdio_read(bus->priv, addr, regnum); -+} -+ -+static int emac_mii_bus_write(struct mii_bus *bus, int addr, int regnum, u16 val) -+{ -+ emac_mdio_write(bus->priv, addr, regnum, val); -+ return 0; -+} -+ -+static int emac_mii_bus_reset(struct mii_bus *bus) -+{ -+ struct emac_instance *dev = netdev_priv(bus->priv); -+ int err; -+ -+ err = emac_reset(dev); -+ if (err) -+ return err; -+ /* Meraki MX60(W)'s uboot will disable the switch and -+ * a bus reset won't do anything. */ -+ emac_mii_reset_phy(&dev->phy); -+ return 0; -+} -+ -+static int emac_mdio_setup_aneg(struct mii_phy *phy, u32 advertise) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ dev->phy.autoneg = AUTONEG_ENABLE; -+ dev->phy.speed = SPEED_1000; -+ dev->phy.duplex = DUPLEX_FULL; -+ dev->phy.advertising = advertise; -+ phy->autoneg = AUTONEG_ENABLE; -+ phy->speed = dev->phy.speed; -+ phy->duplex = dev->phy.duplex; -+ phy->advertising = advertise; -+ return phy_start_aneg(dev->phy_dev); -+} -+ -+static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ dev->phy.autoneg = AUTONEG_DISABLE; -+ dev->phy.speed = speed; -+ dev->phy.duplex = fd; -+ phy->autoneg = AUTONEG_DISABLE; -+ phy->speed = speed; -+ phy->duplex = fd; -+ return phy_start_aneg(dev->phy_dev); -+} -+ -+static int emac_mdio_poll_link(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ int res; -+ -+ res = phy_read_status(dev->phy_dev); -+ if (res) { -+ dev_err(&dev->ofdev->dev, "link update failed (%d).", res); -+ return ethtool_op_get_link(ndev); -+ } -+ -+ return dev->phy_dev->link; -+} -+ -+static int emac_mdio_read_link(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ int res; -+ -+ res = phy_read_status(dev->phy_dev); -+ if (res) -+ return res; -+ -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ return 0; -+} -+ -+static int emac_mdio_init_phy(struct mii_phy *phy) -+{ -+ struct net_device *ndev = phy->dev; -+ struct emac_instance *dev = netdev_priv(ndev); -+ -+ phy_start(dev->phy_dev); -+ dev->phy.autoneg = phy->autoneg; -+ dev->phy.speed = phy->speed; -+ dev->phy.duplex = phy->duplex; -+ dev->phy.advertising = phy->advertising; -+ dev->phy.pause = phy->pause; -+ dev->phy.asym_pause = phy->asym_pause; -+ -+ return phy_init_hw(dev->phy_dev); -+} -+ -+static const struct mii_phy_ops emac_dt_mdio_phy_ops = { -+ .init = emac_mdio_init_phy, -+ .setup_aneg = emac_mdio_setup_aneg, -+ .setup_forced = emac_mdio_setup_forced, -+ .poll_link = emac_mdio_poll_link, -+ .read_link = emac_mdio_read_link, -+}; -+ -+static int emac_dt_mdio_probe(struct emac_instance *dev) -+{ -+ struct device_node *mii_np; -+ int res; -+ -+ mii_np = of_get_child_by_name(dev->ofdev->dev.of_node, "mdio"); -+ if (!mii_np) { -+ dev_err(&dev->ofdev->dev, "no mdio definition found."); -+ return -ENODEV; -+ } -+ -+ if (!of_device_is_available(mii_np)) { -+ res = 1; -+ goto put_node; -+ } -+ -+ dev->mii_bus = devm_mdiobus_alloc(&dev->ofdev->dev); -+ if (!dev->mii_bus) { -+ res = -ENOMEM; -+ goto put_node; -+ } -+ -+ dev->mii_bus->priv = dev->ndev; -+ dev->mii_bus->parent = dev->ndev->dev.parent; -+ dev->mii_bus->name = "emac_mdio"; -+ dev->mii_bus->read = &emac_mii_bus_read; -+ dev->mii_bus->write = &emac_mii_bus_write; -+ dev->mii_bus->reset = &emac_mii_bus_reset; -+ snprintf(dev->mii_bus->id, MII_BUS_ID_SIZE, "%s", dev->ofdev->name); -+ res = of_mdiobus_register(dev->mii_bus, mii_np); -+ if (res) { -+ dev_err(&dev->ofdev->dev, "cannot register MDIO bus %s (%d)", -+ dev->mii_bus->name, res); -+ } -+ -+ put_node: -+ of_node_put(mii_np); -+ return res; -+} -+ -+static int emac_dt_phy_probe(struct emac_instance *dev, -+ struct device_node *phy_handle) -+{ -+ u32 phy_flags = 0; -+ int res; -+ -+ res = of_property_read_u32(phy_handle, "phy-flags", &phy_flags); -+ if (res < 0 && res != -EINVAL) -+ return res; -+ -+ dev->phy.def = devm_kzalloc(&dev->ofdev->dev, sizeof(*dev->phy.def), -+ GFP_KERNEL); -+ if (!dev->phy.def) -+ return -ENOMEM; -+ -+ dev->phy_dev = of_phy_connect(dev->ndev, phy_handle, -+ &emac_adjust_link, phy_flags, -+ PHY_INTERFACE_MODE_RGMII); -+ if (!dev->phy_dev) { -+ dev_err(&dev->ofdev->dev, "failed to connect to PHY.\n"); -+ return -ENODEV; -+ } -+ -+ dev->phy.def->phy_id = dev->phy_dev->drv->phy_id; -+ dev->phy.def->phy_id_mask = dev->phy_dev->drv->phy_id_mask; -+ dev->phy.def->name = dev->phy_dev->drv->name; -+ dev->phy.def->ops = &emac_dt_mdio_phy_ops; -+ dev->phy.features = dev->phy_dev->supported; -+ dev->phy.address = dev->phy_dev->mdio.addr; -+ dev->phy.mode = dev->phy_dev->interface; -+ return 0; -+} -+ -+static int emac_probe_dt_phy(struct emac_instance *dev) -+{ -+ struct device_node *np = dev->ofdev->dev.of_node; -+ struct device_node *phy_handle; -+ int res = 0; -+ -+ phy_handle = of_parse_phandle(np, "phy-handle", 0); -+ -+ if (phy_handle) { -+ res = emac_dt_mdio_probe(dev); -+ if (!res) { -+ res = emac_dt_phy_probe(dev, phy_handle); -+ if (!res) -+ res = 1; -+ else -+ mdiobus_unregister(dev->mii_bus); -+ } -+ } -+ -+ of_node_put(phy_handle); -+ /* if no phy device was specified in the device tree, then we fallback -+ * to the old emac_phy.c probe code for compatibility reasons. -+ */ -+ return res; -+} -+ - static int emac_init_phy(struct emac_instance *dev) - { - struct device_node *np = dev->ofdev->dev.of_node; -@@ -2492,6 +2716,22 @@ static int emac_init_phy(struct emac_ins - - emac_configure(dev); - -+ if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII)) { -+ int res = emac_probe_dt_phy(dev); -+ -+ if (res == 1) { -+ mutex_unlock(&emac_phy_map_lock); -+ goto init_phy; -+ } else if (res < 0) { -+ mutex_unlock(&emac_phy_map_lock); -+ dev_err(&dev->ofdev->dev, "failed to attach dt phy (%d).\n", -+ res); -+ return res; -+ } -+ -+ /* continue with old code */ -+ } -+ - if (dev->phy_address != 0xffffffff) - phy_map = ~(1 << dev->phy_address); - -@@ -2519,6 +2759,7 @@ static int emac_init_phy(struct emac_ins - return -ENXIO; - } - -+ init_phy: - /* Init PHY */ - if (dev->phy.def->ops->init) - dev->phy.def->ops->init(&dev->phy); -@@ -2988,6 +3229,12 @@ static int emac_remove(struct platform_d - if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII)) - zmii_detach(dev->zmii_dev, dev->zmii_port); - -+ if (dev->phy_dev) -+ phy_disconnect(dev->phy_dev); -+ -+ if (dev->mii_bus) -+ mdiobus_unregister(dev->mii_bus); -+ - busy_phy_map &= ~(1 << dev->phy.address); - DBG(dev, "busy_phy_map now %#x" NL, busy_phy_map); - ---- a/drivers/net/ethernet/ibm/emac/core.h -+++ b/drivers/net/ethernet/ibm/emac/core.h -@@ -199,6 +199,10 @@ struct emac_instance { - struct emac_instance *mdio_instance; - struct mutex mdio_lock; - -+ /* Device-tree based phy configuration */ -+ struct mii_bus *mii_bus; -+ struct phy_device *phy_dev; -+ - /* ZMII infos if any */ - u32 zmii_ph; - u32 zmii_port; diff --git a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch b/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch deleted file mode 100644 index 8acde84ec..000000000 --- a/target/linux/apm821xx/patches-4.9/703-net-emac-fix-reset-timeout-with-AR8035-phy.patch +++ /dev/null @@ -1,112 +0,0 @@ -From b2e79053e7456a961249c8865214a1e95b49c863 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Sat, 3 Jun 2017 18:16:19 +0200 -Subject: [PATCH] net: emac: fix reset timeout with AR8035 phy - -This patch fixes a problem where the AR8035 PHY can't be -detected on an Cisco Meraki MR24, if the ethernet cable is -not connected on boot. - -Russell Senior provided steps to reproduce the issue: -|Disconnect ethernet cable, apply power, wait until device has booted, -|plug in ethernet, check for interfaces, no eth0 is listed. -| -|This appears to be a problem during probing of the AR8035 Phy chip. -|When ethernet has no link, the phy detection fails, and eth0 is not -|created. Plugging ethernet later has no effect, because there is no -|interface as far as the kernel is concerned. The relevant part of -|the boot log looks like this: -|this is the failing case: -| -|[ 0.876611] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode -|[ 0.882532] /plb/opb/ethernet@ef600c00: reset timeout -|[ 0.888546] /plb/opb/ethernet@ef600c00: can't find PHY! -|and the succeeding case: -| -|[ 0.876672] /plb/opb/emac-rgmii@ef601500: input 0 in RGMII mode -|[ 0.883952] eth0: EMAC-0 /plb/opb/ethernet@ef600c00, MAC 00:01:.. -|[ 0.890822] eth0: found Atheros 8035 Gigabit Ethernet PHY (0x01) - -Based on the comment and the commit message of -commit 23fbb5a87c56 ("emac: Fix EMAC soft reset on 460EX/GT"). -This is because the AR8035 PHY doesn't provide the TX Clock, -if the ethernet cable is not attached. This causes the reset -to timeout and the PHY detection code in emac_init_phy() is -unable to detect the AR8035 PHY. As a result, the emac driver -bails out early and the user left with no ethernet. - -In order to stay compatible with existing configurations, the driver -tries the current reset approach at first. Only if the first attempt -timed out, it does perform one more retry with the clock input -temporarily switched to the internal clock source for just the -duration of the reset. - -LEDE-Bug: #687 - -Cc: Chris Blake -Reported-by: Russell Senior -Fixes: 23fbb5a87c56e98 ("emac: Fix EMAC soft reset on 460EX/GT") -Reviewed-by: Andrew Lunn -Signed-off-by: Christian Lamparter ---- - drivers/net/ethernet/ibm/emac/core.c | 26 ++++++++++++++++++++++---- - 1 file changed, 22 insertions(+), 4 deletions(-) - ---- a/drivers/net/ethernet/ibm/emac/core.c -+++ b/drivers/net/ethernet/ibm/emac/core.c -@@ -352,6 +352,7 @@ static int emac_reset(struct emac_instan - { - struct emac_regs __iomem *p = dev->emacp; - int n = 20; -+ bool __maybe_unused try_internal_clock = false; - - DBG(dev, "reset" NL); - -@@ -364,6 +365,7 @@ static int emac_reset(struct emac_instan - } - - #ifdef CONFIG_PPC_DCR_NATIVE -+do_retry: - /* - * PPC460EX/GT Embedded Processor Advanced User's Manual - * section 28.10.1 Mode Register 0 (EMACx_MR0) states: -@@ -371,10 +373,19 @@ static int emac_reset(struct emac_instan - * of the EMAC. If none is present, select the internal clock - * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1). - * After a soft reset, select the external clock. -+ * -+ * The AR8035-A PHY Meraki MR24 does not provide a TX Clk if the -+ * ethernet cable is not attached. This causes the reset to timeout -+ * and the PHY detection code in emac_init_phy() is unable to -+ * communicate and detect the AR8035-A PHY. As a result, the emac -+ * driver bails out early and the user has no ethernet. -+ * In order to stay compatible with existing configurations, the -+ * driver will temporarily switch to the internal clock, after -+ * the first reset fails. - */ - if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { -- if (dev->phy_address == 0xffffffff && -- dev->phy_map == 0xffffffff) { -+ if (try_internal_clock || (dev->phy_address == 0xffffffff && -+ dev->phy_map == 0xffffffff)) { - /* No PHY: select internal loop clock before reset */ - dcri_clrset(SDR0, SDR0_ETH_CFG, - 0, SDR0_ETH_CFG_ECS << dev->cell_index); -@@ -392,8 +403,15 @@ static int emac_reset(struct emac_instan - - #ifdef CONFIG_PPC_DCR_NATIVE - if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) { -- if (dev->phy_address == 0xffffffff && -- dev->phy_map == 0xffffffff) { -+ if (!n && !try_internal_clock) { -+ /* first attempt has timed out. */ -+ n = 20; -+ try_internal_clock = true; -+ goto do_retry; -+ } -+ -+ if (try_internal_clock || (dev->phy_address == 0xffffffff && -+ dev->phy_map == 0xffffffff)) { - /* No PHY: restore external clock source after reset */ - dcri_clrset(SDR0, SDR0_ETH_CFG, - SDR0_ETH_CFG_ECS << dev->cell_index, 0); diff --git a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch b/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch deleted file mode 100644 index 3dd2ed573..000000000 --- a/target/linux/apm821xx/patches-4.9/804-usb-dwc2-add-amcc-usb-otg-405ex.patch +++ /dev/null @@ -1,48 +0,0 @@ ---- a/drivers/usb/dwc2/platform.c -+++ b/drivers/usb/dwc2/platform.c -@@ -279,6 +279,37 @@ static int dwc2_get_dr_mode(struct dwc2_ - return 0; - } - -+static const struct dwc2_core_params params_amcc_dwc_otg = { -+ .otg_cap = DWC2_CAP_PARAM_HNP_SRP_CAPABLE, -+ .otg_ver = -1, -+ .dma_enable = -1, -+ .dma_desc_enable = -1, -+ .speed = -1, -+ .enable_dynamic_fifo = -1, -+ .en_multiple_tx_fifo = -1, -+ .host_rx_fifo_size = -1, -+ .host_nperio_tx_fifo_size = -1, -+ .host_perio_tx_fifo_size = -1, -+ .max_transfer_size = -1, -+ .max_packet_count = -1, -+ .host_channels = -1, -+ .phy_type = -1, -+ .phy_utmi_width = -1, -+ .phy_ulpi_ddr = -1, -+ .phy_ulpi_ext_vbus = -1, -+ .i2c_enable = -1, -+ .ulpi_fs_ls = -1, -+ .host_support_fs_ls_low_power = -1, -+ .host_ls_low_power_phy_clk = -1, -+ .ts_dline = -1, -+ .reload_ctl = -1, -+ .ahbcfg = GAHBCFG_HBSTLEN_INCR16 << -+ GAHBCFG_HBSTLEN_SHIFT, -+ .uframe_sched = -1, -+ .external_id_pin_ctl = -1, -+ .hibernation = -1, -+}; -+ - static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg) - { - struct platform_device *pdev = to_platform_device(hsotg->dev); -@@ -511,6 +542,7 @@ static void dwc2_driver_shutdown(struct - } - - static const struct of_device_id dwc2_of_match_table[] = { -+ { .compatible = "amcc,usb-otg-405ex", .data = ¶ms_amcc_dwc_otg }, - { .compatible = "brcm,bcm2835-usb", .data = ¶ms_bcm2835 }, - { .compatible = "hisilicon,hi6220-usb", .data = ¶ms_hi6220 }, - { .compatible = "rockchip,rk3066-usb", .data = ¶ms_rk3066 }, diff --git a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch b/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch deleted file mode 100644 index ceacde9dd..000000000 --- a/target/linux/apm821xx/patches-4.9/901-hwmon-add-driver-for-Microchip-TC654-TC655-PWM-fan-c.patch +++ /dev/null @@ -1,1027 +0,0 @@ -From 5ea2e152d846bf60901107fefd81a58f792f3bc2 Mon Sep 17 00:00:00 2001 -From: Christian Lamparter -Date: Fri, 10 Jun 2016 03:00:46 +0200 -Subject: [PATCH] hwmon: add driver for Microchip TC654/TC655 PWM fan - controllers - -This patch adds a hwmon driver for the Microchip TC654 and TC655 -Dual SMBus PWM Fan Speed Controllers with Fan Fault detection. - -The chip is described in the DS2001734C Spec Document from Microchip. -It supports: - - Shared PWM Fan Drive for two fans - - Provides RPM - - automatic PWM controller (needs additional - NTC/PTC Thermistors.) - - Overtemperature alarm (when using NTC/PTC - Thermistors) - -Signed-off-by: Christian Lamparter ---- - drivers/hwmon/Kconfig | 10 + - drivers/hwmon/Makefile | 1 + - drivers/hwmon/tc654.c | 969 +++++++++++++++++++++++++++++++++++++++++++++++++ - 3 files changed, 980 insertions(+) - create mode 100644 drivers/hwmon/tc654.c - ---- a/drivers/hwmon/Kconfig -+++ b/drivers/hwmon/Kconfig -@@ -1549,6 +1549,16 @@ config SENSORS_INA3221 - This driver can also be built as a module. If so, the module - will be called ina3221. - -+config SENSORS_TC654 -+ tristate "Microchip TC654 and TC655" -+ depends on I2C -+ help -+ If you say yes here you get support for Microchip TC655 and TC654 -+ Dual PWM Fan Speed Controllers and sensor chips. -+ -+ This driver can also be built as a module. If so, the module -+ will be called tc654. -+ - config SENSORS_TC74 - tristate "Microchip TC74" - depends on I2C ---- a/drivers/hwmon/Makefile -+++ b/drivers/hwmon/Makefile -@@ -148,6 +148,7 @@ obj-$(CONFIG_SENSORS_SMSC47B397)+= smsc4 - obj-$(CONFIG_SENSORS_SMSC47M1) += smsc47m1.o - obj-$(CONFIG_SENSORS_SMSC47M192)+= smsc47m192.o - obj-$(CONFIG_SENSORS_AMC6821) += amc6821.o -+obj-$(CONFIG_SENSORS_TC654) += tc654.o - obj-$(CONFIG_SENSORS_TC74) += tc74.o - obj-$(CONFIG_SENSORS_THMC50) += thmc50.o - obj-$(CONFIG_SENSORS_TMP102) += tmp102.o ---- /dev/null -+++ b/drivers/hwmon/tc654.c -@@ -0,0 +1,969 @@ -+/* -+ * tc654.c - Support for Microchip TC654/TC655 -+ * "A Dual SMBus PWM FAN Speed Controllers with Fan Fault Detection" -+ * -+ * Copyright (c) 2016 Christian Lamparter -+ * -+ * This program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation version 2 of the License. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * The chip is described in the DS2001734C Spec Document from Microchip. -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* Hardware definitions */ -+/* 5.1.4 Address Byte stats that TC654/TC655 are fixed at 0x1b */ -+static const unsigned short normal_i2c[] = { 0x1b, I2C_CLIENT_END }; -+ -+enum TC654_REGS { -+ TC654_REG_RPM1 = 0x00, -+ TC654_REG_RPM2, -+ TC654_REG_FAN1_FAULT_THRESH, -+ TC654_REG_FAN2_FAULT_THRESH, -+ TC654_REG_CONFIG, -+ TC654_REG_STATUS, -+ TC654_REG_DUTY_CYCLE, -+ TC654_REG_MFR_ID, -+ TC654_REG_VER_ID, -+ -+ /* keep last */ -+ __TC654_REG_NUM, -+}; -+ -+#define TC654_MFR_ID_MICROCHIP 0x84 -+#define TC654_VER_ID 0x00 -+#define TC655_VER_ID 0x01 -+ -+enum TC654_CONTROL_BITS { -+ TC654_CTRL_SDM = BIT(0), -+ TC654_CTRL_F1PPR_S = 1, -+ TC654_CTRL_F1PPR_M = (BIT(1) | BIT(2)), -+ TC654_CTRL_F2PPR_S = 3, -+ TC654_CTRL_F2PPR_M = (BIT(3) | BIT(4)), -+ TC654_CTRL_DUTYC = BIT(5), -+ TC654_CTRL_RES = BIT(6), -+ TC654_CTRL_FFCLR = BIT(7), -+}; -+ -+enum TC654_STATUS_BITS { -+ TC654_STATUS_F1F = BIT(0), -+ TC654_STATUS_F2F = BIT(1), -+ TC654_STATUS_VSTAT = BIT(2), -+ TC654_STATUS_R1CO = BIT(3), -+ TC654_STATUS_R2CO = BIT(4), -+ TC654_STATUS_OTF = BIT(5), -+}; -+ -+enum TC654_FAN { -+ TC654_FAN1 = 0, -+ TC654_FAN2, -+ -+ /* keep last */ -+ __NUM_TC654_FAN, -+}; -+ -+enum TC654_FAN_MODE { -+ TC654_PWM_OFF, /* Shutdown Mode - switch of both fans */ -+ TC654_PWM_VIN, /* Fans will be controlled via V_in analog input pin */ -+ TC654_PWM_3000, /* sets fans to 30% duty cycle */ -+ TC654_PWM_3467, -+ TC654_PWM_3933, /* default case - if V_in pin is open */ -+ TC654_PWM_4400, -+ TC654_PWM_4867, -+ TC654_PWM_5333, -+ TC654_PWM_5800, -+ TC654_PWM_6267, -+ TC654_PWM_6733, -+ TC654_PWM_7200, -+ TC654_PWM_7667, -+ TC654_PWM_8133, -+ TC654_PWM_8600, -+ TC654_PWM_9067, -+ TC654_PWM_9533, -+ TC654_PWM_10000, /* sets fans to 100% duty cycle */ -+}; -+ -+enum TC654_ALARMS { -+ TC654_ALARM_FAN1_FAULT, -+ TC654_ALARM_FAN2_FAULT, -+ TC654_ALARM_FAN1_COUNTER_OVERFLOW, -+ TC654_ALARM_FAN2_COUNTER_OVERFLOW, -+ TC654_ALARM_OVER_TEMPERATURE, -+ -+ /* KEEP LAST */ -+ __NUM_TC654_ALARMS, -+}; -+ -+static const struct pwm_table_entry { -+ u8 min; -+ enum TC654_FAN_MODE mode; -+} pwm_table[] = { -+ { 0, TC654_PWM_OFF }, -+ { 1, TC654_PWM_3000 }, -+ { 88, TC654_PWM_3467 }, -+ {101, TC654_PWM_3933 }, -+ {113, TC654_PWM_4400 }, -+ {125, TC654_PWM_4867 }, -+ {137, TC654_PWM_5333 }, -+ {148, TC654_PWM_5800 }, -+ {160, TC654_PWM_6267 }, -+ {172, TC654_PWM_6733 }, -+ {184, TC654_PWM_7200 }, -+ {196, TC654_PWM_7667 }, -+ {208, TC654_PWM_8133 }, -+ {220, TC654_PWM_8600 }, -+ {232, TC654_PWM_9067 }, -+ {244, TC654_PWM_9533 }, -+ {255, TC654_PWM_10000 }, -+}; -+ -+/* driver context */ -+struct tc654 { -+ struct i2c_client *client; -+ -+ struct mutex update_lock; -+ -+ unsigned long last_updated; /* in jiffies */ -+ u8 cached_regs[__TC654_REG_NUM]; -+ -+ bool valid; /* monitored registers are valid */ -+ u16 fan_input[__NUM_TC654_FAN]; -+ bool alarms[__NUM_TC654_ALARMS]; -+ bool vin_status; -+ bool pwm_manual; -+ -+ /* optional cooling device */ -+ struct thermal_cooling_device *cdev; -+}; -+ -+/* hardware accessors and functions */ -+static int read_tc(struct tc654 *tc, u8 reg) -+{ -+ s32 status; -+ -+ if (reg <= TC654_REG_VER_ID) { -+ /* Table 6.1 states that all registers are readable */ -+ status = i2c_smbus_read_byte_data(tc->client, reg); -+ } else -+ status = -EINVAL; -+ -+ if (status < 0) { -+ dev_warn(&tc->client->dev, "can't read register 0x%02x due to error (%d)", -+ reg, status); -+ } else { -+ tc->cached_regs[reg] = status; -+ } -+ -+ return status; -+} -+ -+static int write_tc(struct tc654 *tc, u8 i2c_reg, u8 val) -+{ -+ s32 status; -+ -+ /* -+ * Table 6.1 states that both fan threshold registers, -+ * the Config and Duty Cycle are writeable. -+ */ -+ switch (i2c_reg) { -+ case TC654_REG_FAN1_FAULT_THRESH: -+ case TC654_REG_FAN2_FAULT_THRESH: -+ case TC654_REG_DUTY_CYCLE: -+ case TC654_REG_CONFIG: -+ status = i2c_smbus_write_byte_data(tc->client, i2c_reg, val); -+ break; -+ -+ default: -+ return -EINVAL; -+ } -+ -+ if (status < 0) { -+ dev_warn(&tc->client->dev, "can't write register 0x%02x with value 0x%02x due to error (%d)", -+ i2c_reg, val, status); -+ } else { -+ tc->cached_regs[i2c_reg] = val; -+ } -+ -+ return status; -+} -+ -+static int mod_config(struct tc654 *tc, u8 set, u8 clear) -+{ -+ u8 val = 0; -+ -+ /* a bit can't be set and cleared on the same time. */ -+ if (set & clear) -+ return -EINVAL; -+ -+ /* invalidate data to force re-read from hardware */ -+ tc->valid = false; -+ val = (tc->cached_regs[TC654_REG_CONFIG] | set) & (~clear); -+ return write_tc(tc, TC654_REG_CONFIG, val); -+} -+ -+static int read_fan_rpm(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ int ret; -+ -+ /* 6.1 RPM-OUTPUT1 and RPM-OUTPUT2 registers */ -+ ret = read_tc(tc, fan == TC654_FAN1 ? TC654_REG_RPM1 : TC654_REG_RPM2); -+ if (ret < 0) -+ return ret; -+ -+ /* -+ * The Resolution Selection Bit in 6.3 CONFIGURATION REGISTER -+ * is needed to convert the raw value to the RPM. -+ * 0 = RPM1 and RPM2 use (8-Bit) resolution => * 50 RPM -+ * 1 = RPM1 and RPM2 use (9-Bit) resolution => * 25 RPM -+ */ -+ return ret * (25 << -+ !(tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES)); -+} -+ -+static int write_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan, -+ u16 rpm) -+{ -+ u8 converted_rpm; -+ -+ if (rpm > 12750) -+ return -EINVAL; -+ -+ /* -+ * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers -+ * -+ * Both registers operate in 50 RPM mode exclusively. -+ */ -+ converted_rpm = rpm / 50; -+ -+ /* invalidate data to force re-read from hardware */ -+ tc->valid = false; -+ return write_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH : -+ TC654_REG_FAN2_FAULT_THRESH, converted_rpm); -+} -+ -+ -+static int read_fan_fault_thresh(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ /* -+ * 6.2 FAN_FAULT1 and FAN_FAULT2 Threshold registers -+ * -+ * Both registers operate in 50 RPM mode exclusively. -+ */ -+ return read_tc(tc, fan == TC654_FAN1 ? TC654_REG_FAN1_FAULT_THRESH : -+ TC654_REG_FAN2_FAULT_THRESH) * 50; -+} -+ -+static enum TC654_FAN_MODE get_fan_mode(struct tc654 *tc) -+{ -+ if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) { -+ return TC654_PWM_OFF; -+ } else if (tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_DUTYC) { -+ return TC654_PWM_3000 + tc->cached_regs[TC654_REG_DUTY_CYCLE]; -+ } else if (tc->vin_status == 0) -+ return TC654_PWM_VIN; -+ -+ return -EINVAL; -+} -+ -+static int write_fan_mode(struct tc654 *tc, enum TC654_FAN_MODE mode) -+{ -+ int err; -+ u8 pwm_mode; -+ bool in_sdm; -+ -+ in_sdm = !!(tc->cached_regs[TC654_REG_CONFIG] & -+ TC654_CTRL_SDM); -+ -+ switch (mode) { -+ case TC654_PWM_OFF: -+ if (in_sdm) -+ return 0; -+ -+ /* Enter Shutdown Mode - Switches off all fans */ -+ err = mod_config(tc, TC654_CTRL_SDM, TC654_CTRL_DUTYC); -+ if (err) -+ return err; -+ -+ return 0; -+ -+ case TC654_PWM_VIN: -+ if (tc->vin_status) { -+ dev_err(&tc->client->dev, -+ "V_in pin is open, can't enable automatic mode."); -+ return -EINVAL; -+ } -+ -+ err = mod_config(tc, 0, TC654_CTRL_SDM | TC654_CTRL_DUTYC); -+ if (err) -+ return err; -+ -+ tc->pwm_manual = false; -+ return 0; -+ -+ case TC654_PWM_3000: -+ case TC654_PWM_3467: -+ case TC654_PWM_3933: -+ case TC654_PWM_4400: -+ case TC654_PWM_4867: -+ case TC654_PWM_5333: -+ case TC654_PWM_5800: -+ case TC654_PWM_6267: -+ case TC654_PWM_6733: -+ case TC654_PWM_7200: -+ case TC654_PWM_7667: -+ case TC654_PWM_8133: -+ case TC654_PWM_8600: -+ case TC654_PWM_9067: -+ case TC654_PWM_9533: -+ case TC654_PWM_10000: -+ pwm_mode = mode - TC654_PWM_3000; -+ if (!in_sdm) { -+ err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode); -+ if (err) -+ return err; -+ } -+ -+ err = mod_config(tc, TC654_CTRL_DUTYC, TC654_CTRL_SDM); -+ if (err) -+ return err; -+ -+ tc->pwm_manual = true; -+ -+ if (in_sdm) { -+ /* -+ * In case the TC654/TC655 was in SDM mode, the write -+ * above into the TC654_REG_DUTY_CYCLE register will -+ * have no effect because the chip was switched off. -+ * -+ * Note: The TC654/TC655 have a special "power-on" -+ * feature where the PWM will be forced to 100% for -+ * one full second in order to spin-up a resting fan. -+ */ -+ err = write_tc(tc, TC654_REG_DUTY_CYCLE, pwm_mode); -+ if (err) -+ return err; -+ } -+ -+ return 0; -+ -+ default: -+ return -EINVAL; -+ } -+} -+ -+static struct tc654 *tc654_update_device(struct device *dev) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ -+ mutex_lock(&tc->update_lock); -+ -+ /* -+ * In Chapter "1.0 Electrical Characteristics", -+ * the "Fault Output Response Time" is specified as 2.4 seconds. -+ */ -+ if (time_after(jiffies, tc->last_updated + 2 * HZ + (HZ * 2) / 5) -+ || !tc->valid) { -+ size_t i; -+ int ret; -+ bool alarm_triggered; -+ -+ tc->valid = false; -+ -+ for (i = 0; i < __NUM_TC654_FAN; i++) { -+ ret = read_fan_rpm(tc, i); -+ if (ret < 0) -+ goto out; -+ -+ tc->fan_input[i] = ret; -+ } -+ -+ ret = read_tc(tc, TC654_REG_STATUS); -+ if (ret < 0) -+ goto out; -+ -+ alarm_triggered = !!(ret & (TC654_STATUS_F1F | -+ TC654_STATUS_F2F | TC654_STATUS_R1CO | -+ TC654_STATUS_R2CO | TC654_STATUS_OTF)); -+ -+ tc->alarms[TC654_ALARM_FAN1_FAULT] = !!(ret & TC654_STATUS_F1F); -+ tc->alarms[TC654_ALARM_FAN2_FAULT] = !!(ret & TC654_STATUS_F2F); -+ tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] = -+ !!(ret & TC654_STATUS_R1CO); -+ tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW] = -+ !!(ret & TC654_STATUS_R2CO); -+ tc->alarms[TC654_ALARM_OVER_TEMPERATURE] = -+ !!(ret & TC654_STATUS_OTF); -+ tc->vin_status = !!(ret & TC654_STATUS_VSTAT); -+ -+ /* -+ * From 4.5 and 6.3 -+ * -+ * ... "If the V_in pin is open when TC654_CTRL_DUTYC is not -+ * selected, then V_out duty cycle will default to 39.33%.". -+ * -+ * and most importantly 6.5: -+ * ... "V_in pin is open, the duty cycle will go to the default -+ * setting of this register, which is 0010 (39.33%)." -+ */ -+ tc->pwm_manual |= tc->vin_status && -+ (tc->cached_regs[TC654_REG_CONFIG] & -+ TC654_CTRL_DUTYC); -+ -+ if (alarm_triggered) { -+ /* -+ * as the name implies, this FLAG needs to be -+ * set in order to clear the FAN Fault error. -+ */ -+ ret = mod_config(tc, TC654_CTRL_FFCLR, 0); -+ if (ret < 0) -+ goto out; -+ } -+ -+ tc->last_updated = jiffies; -+ tc->valid = true; -+ } -+ -+out: -+ mutex_unlock(&tc->update_lock); -+ return tc; -+} -+ -+static u8 get_fan_pulse(struct tc654 *tc, enum TC654_FAN fan) -+{ -+ u8 fan_pulse_mask = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M; -+ u8 fan_pulse_shift = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S; -+ -+ return 1 << ((tc->cached_regs[TC654_REG_CONFIG] & fan_pulse_mask) >> -+ fan_pulse_shift); -+} -+ -+static int -+set_fan_pulse(struct tc654 *tc, enum TC654_FAN fan, int pulses) -+{ -+ int old_pulses; -+ int err; -+ u8 new_pulse_per_rotation; -+ u8 fan_pulse_mask = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_M : TC654_CTRL_F2PPR_M; -+ u8 fan_pulse_shift = fan == TC654_FAN1 ? -+ TC654_CTRL_F1PPR_S : TC654_CTRL_F2PPR_S; -+ -+ switch (pulses) { -+ case 1: -+ new_pulse_per_rotation = 0; -+ break; -+ case 2: -+ new_pulse_per_rotation = 1; -+ break; -+ case 4: -+ new_pulse_per_rotation = 2; -+ break; -+ case 8: -+ new_pulse_per_rotation = 3; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ new_pulse_per_rotation <<= fan_pulse_shift; -+ new_pulse_per_rotation &= fan_pulse_mask; -+ -+ old_pulses = tc->cached_regs[TC654_REG_CONFIG]; -+ old_pulses &= fan_pulse_mask; -+ -+ if (new_pulse_per_rotation == old_pulses) -+ return 0; -+ -+ mutex_lock(&tc->update_lock); -+ err = mod_config(tc, new_pulse_per_rotation, -+ old_pulses & (~new_pulse_per_rotation)); -+ mutex_unlock(&tc->update_lock); -+ -+ /* invalidate RPM data to force re-read from hardware */ -+ tc->valid = false; -+ -+ return err; -+} -+ -+static int get_fan_speed(struct tc654 *tc) -+{ -+ enum TC654_FAN_MODE mode; -+ size_t i; -+ -+ mode = get_fan_mode(tc); -+ for (i = 0; i < ARRAY_SIZE(pwm_table); i++) { -+ if (mode == pwm_table[i].mode) -+ return pwm_table[i].min; -+ } -+ -+ return -EINVAL; -+} -+ -+static int set_fan_speed(struct tc654 *tc, int new_value) -+{ -+ int result; -+ size_t i; -+ -+ if (new_value > pwm_table[ARRAY_SIZE(pwm_table) - 1].min || -+ new_value < pwm_table[0].min) -+ return -EINVAL; -+ -+ for (i = 0; i < ARRAY_SIZE(pwm_table); i++) { -+ /* exact match */ -+ if (pwm_table[i].min == new_value) -+ break; -+ -+ /* a little bit too big - go with the previous entry */ -+ if (pwm_table[i].min > new_value) { -+ --i; -+ break; -+ } -+ } -+ -+ mutex_lock(&tc->update_lock); -+ result = write_fan_mode(tc, pwm_table[i].mode); -+ mutex_unlock(&tc->update_lock); -+ if (result < 0) -+ return result; -+ -+ return 0; -+} -+ -+/* sysfs */ -+ -+static ssize_t -+show_fan_input(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", tc->fan_input[nr]); -+} -+ -+static ssize_t -+show_fan_min(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", read_fan_fault_thresh(tc, nr)); -+} -+ -+static ssize_t -+show_fan_min_alarm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", nr == TC654_FAN1 ? -+ tc->alarms[TC654_ALARM_FAN1_FAULT] : -+ tc->alarms[TC654_ALARM_FAN2_FAULT]); -+} -+ -+static ssize_t -+show_fan_max_alarm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", nr == TC654_FAN1 ? -+ tc->alarms[TC654_ALARM_FAN1_COUNTER_OVERFLOW] : -+ tc->alarms[TC654_ALARM_FAN2_COUNTER_OVERFLOW]); -+} -+ -+static ssize_t -+set_fan_min(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_min; -+ int nr = to_sensor_dev_attr(da)->index; -+ int old_min = read_fan_fault_thresh(tc, nr); -+ int status = kstrtol(buf, 10, &new_min); -+ -+ if (status < 0) -+ return status; -+ -+ new_min = (new_min / 50) * 50; -+ if (new_min == old_min) /* No change */ -+ return count; -+ -+ if (new_min < 0 || new_min > 12750) -+ return -EINVAL; -+ -+ mutex_lock(&tc->update_lock); -+ status = write_fan_fault_thresh(tc, nr, new_min); -+ mutex_unlock(&tc->update_lock); -+ return count; -+} -+ -+static ssize_t -+show_fan_max(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int max_rpm = tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_RES ? -+ (((1 << 9) - 1) * 25) /* ((2**9) - 1) * 25 RPM */: -+ (((1 << 8) - 1) * 50) /* ((2**8) - 1) * 50 RPM */; -+ -+ return sprintf(buf, "%d\n", max_rpm); -+} -+ -+static ssize_t -+show_fan_fault(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ u8 fan_fault_mask = nr == TC654_FAN1 ? -+ TC654_STATUS_F1F : TC654_STATUS_F2F; -+ -+ return sprintf(buf, "%d\n", -+ !!(tc->cached_regs[TC654_REG_STATUS] & fan_fault_mask)); -+} -+ -+static ssize_t -+show_fan_pulses(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ int nr = to_sensor_dev_attr(da)->index; -+ -+ return sprintf(buf, "%d\n", get_fan_pulse(tc, nr)); -+} -+ -+static ssize_t -+set_fan_pulses(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_pulse; -+ int nr = to_sensor_dev_attr(da)->index; -+ int status = kstrtol(buf, 10, &new_pulse); -+ -+ if (status < 0) -+ return status; -+ -+ status = set_fan_pulse(tc, nr, new_pulse); -+ if (status < 0) -+ return status; -+ -+ return count; -+} -+ -+static ssize_t -+show_pwm_enable(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int pwm_enabled; -+ -+ if ((tc->cached_regs[TC654_REG_CONFIG] & TC654_CTRL_SDM) && -+ !tc->pwm_manual) { -+ pwm_enabled = 0; /* full off */ -+ } else { -+ if (tc->valid && tc->vin_status == 0) -+ pwm_enabled = 2; /* automatic fan speed control */ -+ -+ pwm_enabled = 1; /* PWM Mode */ -+ } -+ -+ return sprintf(buf, "%d\n", pwm_enabled); -+} -+ -+static ssize_t -+set_pwm_enable(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_value; -+ -+ int result = kstrtol(buf, 10, &new_value); -+ -+ if (result < 0) -+ return result; -+ -+ mutex_lock(&tc->update_lock); -+ switch (new_value) { -+ case 0: /* no fan control (i.e. is OFF) */ -+ result = write_fan_mode(tc, TC654_PWM_OFF); -+ tc->pwm_manual = false; -+ break; -+ -+ case 1: /* manual fan control enabled (using pwm) */ -+ result = write_fan_mode(tc, TC654_PWM_10000); -+ break; -+ -+ case 2: /* automatic fan speed control enabled */ -+ result = write_fan_mode(tc, TC654_PWM_VIN); -+ break; -+ -+ default: -+ result = -EINVAL; -+ } -+ -+ mutex_unlock(&tc->update_lock); -+ return result < 0 ? result : count; -+} -+ -+static ssize_t -+show_pwm(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ int ret; -+ -+ ret = get_fan_speed(tc); -+ if (ret < 0) -+ return ret; -+ -+ return sprintf(buf, "%d\n", ret); -+} -+ -+static ssize_t -+set_pwm(struct device *dev, struct device_attribute *da, -+ const char *buf, size_t count) -+{ -+ struct tc654 *tc = dev_get_drvdata(dev); -+ long new_value = -1; -+ int result = kstrtol(buf, 10, &new_value); -+ -+ if (result < 0) -+ return result; -+ -+ if (new_value < 0 || new_value > INT_MAX) -+ return -EINVAL; -+ -+ if (!tc->pwm_manual) -+ return -EINVAL; -+ -+ result = set_fan_speed(tc, new_value); -+ if (result < 0) -+ return result; -+ -+ return count; -+} -+ -+static ssize_t -+show_temp_alarm_otf(struct device *dev, struct device_attribute *da, char *buf) -+{ -+ struct tc654 *tc = tc654_update_device(dev); -+ -+ return sprintf(buf, "%d\n", tc->alarms[TC654_ALARM_OVER_TEMPERATURE]); -+} -+ -+static SENSOR_DEVICE_ATTR(fan1_input, S_IRUGO, show_fan_input, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_min, S_IRUGO | S_IWUSR, show_fan_min, -+ set_fan_min, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_min_alarm, S_IRUGO, show_fan_min_alarm, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_max_alarm, S_IRUGO, show_fan_max_alarm, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_max, S_IRUGO, show_fan_max, NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_fault, S_IRUGO, show_fan_fault, -+ NULL, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan1_pulses, S_IRUGO | S_IWUSR, show_fan_pulses, -+ set_fan_pulses, TC654_FAN1); -+static SENSOR_DEVICE_ATTR(fan2_input, S_IRUGO, show_fan_input, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_min, S_IRUGO | S_IWUSR, show_fan_min, -+ set_fan_min, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_max, S_IRUGO, show_fan_max, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_min_alarm, S_IRUGO, show_fan_min_alarm, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_max_alarm, S_IRUGO, show_fan_max_alarm, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_fault, S_IRUGO, show_fan_fault, -+ NULL, TC654_FAN2); -+static SENSOR_DEVICE_ATTR(fan2_pulses, S_IRUGO | S_IWUSR, show_fan_pulses, -+ set_fan_pulses, TC654_FAN2); -+ -+static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR, show_pwm_enable, -+ set_pwm_enable); -+static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm); -+ -+static DEVICE_ATTR(temp1_emergency_alarm, S_IRUGO, show_temp_alarm_otf, NULL); -+ -+/* sensors present on all models */ -+static struct attribute *tc654_attrs[] = { -+ &sensor_dev_attr_fan1_input.dev_attr.attr, -+ &sensor_dev_attr_fan1_min.dev_attr.attr, -+ &sensor_dev_attr_fan1_max.dev_attr.attr, -+ &sensor_dev_attr_fan1_min_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan1_max_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan1_fault.dev_attr.attr, -+ &sensor_dev_attr_fan1_pulses.dev_attr.attr, -+ &sensor_dev_attr_fan2_input.dev_attr.attr, -+ &sensor_dev_attr_fan2_min.dev_attr.attr, -+ &sensor_dev_attr_fan2_max.dev_attr.attr, -+ &sensor_dev_attr_fan2_min_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan2_max_alarm.dev_attr.attr, -+ &sensor_dev_attr_fan2_fault.dev_attr.attr, -+ &sensor_dev_attr_fan2_pulses.dev_attr.attr, -+ -+ &dev_attr_pwm1_enable.attr, -+ &dev_attr_pwm1.attr, -+ -+ &dev_attr_temp1_emergency_alarm.attr, -+ NULL -+}; -+ -+ATTRIBUTE_GROUPS(tc654); -+ -+/* cooling device */ -+ -+static int tc654_get_max_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ *state = 255; -+ return 0; -+} -+ -+static int tc654_get_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long *state) -+{ -+ struct tc654 *tc = cdev->devdata; -+ int ret; -+ -+ if (!tc) -+ return -EINVAL; -+ -+ ret = get_fan_speed(tc); -+ if (ret < 0) -+ return ret; -+ -+ *state = ret; -+ return 0; -+} -+ -+static int tc654_set_cur_state(struct thermal_cooling_device *cdev, -+ unsigned long state) -+{ -+ struct tc654 *tc = cdev->devdata; -+ -+ if (!tc) -+ return -EINVAL; -+ -+ if (state > INT_MAX) -+ return -EINVAL; -+ -+ return set_fan_speed(tc, state); -+} -+ -+static const struct thermal_cooling_device_ops tc654_fan_cool_ops = { -+ .get_max_state = tc654_get_max_state, -+ .get_cur_state = tc654_get_cur_state, -+ .set_cur_state = tc654_set_cur_state, -+}; -+ -+ -+/* hardware probe and detection */ -+ -+static int -+tc654_probe(struct i2c_client *client, const struct i2c_device_id *id) -+{ -+ struct tc654 *tc; -+ struct device *hwmon_dev; -+ int ret, i; -+ -+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) -+ return -EIO; -+ -+ tc = devm_kzalloc(&client->dev, sizeof(*tc), GFP_KERNEL); -+ if (!tc) -+ return -ENOMEM; -+ -+ i2c_set_clientdata(client, tc); -+ tc->client = client; -+ mutex_init(&tc->update_lock); -+ -+ /* cache all 8 registers */ -+ for (i = 0; i < __TC654_REG_NUM; i++) { -+ ret = read_tc(tc, i); -+ if (ret < 0) -+ return ret; -+ } -+ -+ /* sysfs hooks */ -+ hwmon_dev = devm_hwmon_device_register_with_groups(&client->dev, -+ client->name, tc, -+ tc654_groups); -+ if (IS_ERR(hwmon_dev)) -+ return PTR_ERR(hwmon_dev); -+ -+#if IS_ENABLED(CONFIG_OF) -+ /* Optional cooling device register for Device tree platforms */ -+ tc->cdev = thermal_of_cooling_device_register(client->dev.of_node, -+ "tc654", tc, -+ &tc654_fan_cool_ops); -+#else /* CONFIG_OF */ -+ /* Optional cooling device register for non Device tree platforms */ -+ tc->cdev = thermal_cooling_device_register("tc654", tc, -+ &tc654_fan_cool_ops); -+#endif /* CONFIG_OF */ -+ -+ dev_info(&client->dev, "%s: sensor '%s'\n", -+ dev_name(hwmon_dev), client->name); -+ -+ return 0; -+} -+ -+static const struct i2c_device_id tc654_ids[] = { -+ { "tc654", 0, }, -+ { } -+}; -+MODULE_DEVICE_TABLE(i2c, tc654_ids); -+ -+/* Return 0 if detection is successful, -ENODEV otherwise */ -+static int -+tc654_detect(struct i2c_client *new_client, struct i2c_board_info *info) -+{ -+ struct i2c_adapter *adapter = new_client->adapter; -+ int manufacturer, product; -+ -+ if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) -+ return -ENODEV; -+ -+ manufacturer = i2c_smbus_read_byte_data(new_client, TC654_REG_MFR_ID); -+ if (manufacturer != TC654_MFR_ID_MICROCHIP) -+ return -ENODEV; -+ -+ product = i2c_smbus_read_byte_data(new_client, TC654_REG_VER_ID); -+ if (!((product == TC654_VER_ID) || (product == TC655_VER_ID))) -+ return -ENODEV; -+ -+ strlcpy(info->type, "tc654", I2C_NAME_SIZE); -+ return 0; -+} -+ -+static struct i2c_driver tc654_driver = { -+ .class = I2C_CLASS_HWMON, -+ .driver = { -+ .name = "tc654", -+ }, -+ .probe = tc654_probe, -+ .id_table = tc654_ids, -+ .detect = tc654_detect, -+ .address_list = normal_i2c, -+}; -+ -+module_i2c_driver(tc654_driver); -+ -+MODULE_AUTHOR("Christian Lamparter "); -+MODULE_DESCRIPTION("Microchip TC654/TC655 hwmon driver"); -+MODULE_LICENSE("GPL"); diff --git a/target/linux/ar71xx/Makefile b/target/linux/ar71xx/Makefile index 1c66d7e76..104961929 100644 --- a/target/linux/ar71xx/Makefile +++ b/target/linux/ar71xx/Makefile @@ -13,7 +13,7 @@ FEATURES:=usbgadget CPU_TYPE:=24kc SUBTARGETS:=generic tiny nand mikrotik -KERNEL_PATCHVER:=4.4 +KERNEL_PATCHVER:=4.9 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds index 0fec36847..fac9dfa7a 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/01_leds +++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds @@ -129,6 +129,22 @@ dr531) ;; esac ;; +ap91-5g|\ +n5q) + ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "signal1" "SIGNAL1" "$board:red:signal1" "wlan0" "1" "100" + ucidef_set_led_rssi "signal2" "SIGNAL2" "$board:orange:signal2" "wlan0" "25" "100" + ucidef_set_led_rssi "signal3" "SIGNAL3" "$board:green:signal3" "wlan0" "50" "100" + ucidef_set_led_rssi "signal4" "SIGNAL4" "$board:green:signal4" "wlan0" "75" "100" + + case "$board" in + n5q) + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" + ;; + esac + ;; bhr-4grv2) ucidef_set_led_default "power" "POWER" "buffalo:green:power" "1" ucidef_set_led_default "diag" "DIAG" "buffalo:red:diag" "0" @@ -391,6 +407,10 @@ dlan-pro-1200-ac) gl-ar300m) ucidef_set_led_wlan "wlan" "WLAN" "$board:red:wlan" "phy0tpt" ;; +gl-ar750) + ucidef_set_led_wlan "wlan2g" "WLAN2G" "$board:white:wlan2g" "phy1tpt" + ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:white:wlan5g" "phy0tpt" + ;; gl-mifi) ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt" ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0" @@ -564,6 +584,12 @@ pqi-air-pen) qihoo-c301) ucidef_set_led_wlan "wlan2g" "WLAN2G" "qihoo:red:status" "phy1tpt" ;; +r36a) + ucidef_set_led_netdev "lan" "LAN" "$board:blue:lan" "eth0" + ucidef_set_led_usbdev "usb" "USB" "$board:blue:usb" "1-1" + ucidef_set_led_netdev "wan" "WAN" "$board:blue:wan" "eth1" + ucidef_set_led_wlan "wlan" "WLAN" "$board:blue:wlan" "phy0tpt" + ;; r602n|\ zbt-we1526) ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" @@ -579,6 +605,12 @@ re450) ucidef_set_led_wlan "wlan2g" "WLAN 2.4 GHz" "$board:blue:wlan2g" "phy1tpt" ucidef_set_led_wlan "wlan5g" "WLAN 5 GHz" "$board:blue:wlan5g" "phy0tpt" ;; +rut900) + ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x10" + ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08" + ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04" + ;; smart-300) ucidef_set_led_netdev "wan" "WAN" "nc-link:green:wan" "eth0" ucidef_set_led_switch "lan1" "LAN1" "nc-link:green:lan1" "switch0" "0x04" @@ -714,7 +746,6 @@ tl-wa901nd) ;; tl-wa901nd-v2|\ tl-wr941nd|\ -tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_set_led_wlan "wlan" "WLAN" "tp-link:green:wlan" "phy0tpt" ;; diff --git a/target/linux/ar71xx/base-files/etc/board.d/02_network b/target/linux/ar71xx/base-files/etc/board.d/02_network index 6dffb54e9..5a10a9f48 100755 --- a/target/linux/ar71xx/base-files/etc/board.d/02_network +++ b/target/linux/ar71xx/base-files/etc/board.d/02_network @@ -64,6 +64,7 @@ ar71xx_setup_interfaces() antminer-s3|\ antrouter-r1|\ ap121f|\ + ap91-5g|\ aw-nr580|\ bullet-m|\ c-55|\ @@ -103,6 +104,7 @@ ar71xx_setup_interfaces() rb-sxt2n|\ rb-sxt5n|\ rb-wap-2nd|\ + rb-wapg-5hact2hnd|\ re450|\ rocket-m-xw|\ sc300m |\ @@ -389,6 +391,12 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" ;; + gl-ar750|\ + rb-435g) + ucidef_set_interfaces_lan_wan "eth1.1" "eth0" + ucidef_add_switch "switch0" \ + "0@eth1" "1:lan" "2:lan" + ;; jwap230) ucidef_set_interfaces_lan_wan "eth0.1" "eth1.2" ucidef_add_switch "switch0" \ @@ -401,11 +409,6 @@ ar71xx_setup_interfaces() onion-omega) ucidef_set_interface_lan "wlan0" ;; - rb-435g) - ucidef_set_interfaces_lan_wan "eth1.1" "eth0" - ucidef_add_switch "switch0" \ - "0@eth1" "1:lan" "2:lan" - ;; rb-450) ucidef_set_interfaces_lan_wan "eth1.1" "eth0" ucidef_add_switch "switch0" \ @@ -427,6 +430,11 @@ ar71xx_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:wan" "2:lan" ;; + rut900) + ucidef_set_interfaces_lan_wan "eth0.1" "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" + ;; tellstick-znet-lite) ucidef_set_interface_wan "eth0" ucidef_set_interface_raw "wlan" "wlan0" "dhcp" @@ -442,7 +450,6 @@ ar71xx_setup_interfaces() ;; archer-c7-v4|\ tl-wdr4300|\ - tl-wr941n-v7|\ tl-wr1041n-v2) ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" @@ -558,6 +565,10 @@ ar71xx_setup_macs() mynet-n750) wan_mac=$(mtd_get_mac_ascii devdata "wanmac") ;; + wlr8100) + lan_mac=$(mtd_get_mac_ascii u-boot-env "ethaddr") + wan_mac=$(mtd_get_mac_ascii u-boot-env "wanaddr") + ;; wpj344|\ wpj558) wan_mac=$(mtd_get_mac_binary u-boot 0x2e018) diff --git a/target/linux/ar71xx/base-files/etc/diag.sh b/target/linux/ar71xx/base-files/etc/diag.sh index 6cbb3576d..2720288e3 100644 --- a/target/linux/ar71xx/base-files/etc/diag.sh +++ b/target/linux/ar71xx/base-files/etc/diag.sh @@ -40,6 +40,7 @@ get_status_led() { db120|\ dr342|\ dr344|\ + rut900|\ tew-632brp|\ tl-wr942n-v1|\ wpj344|\ @@ -80,6 +81,10 @@ get_status_led() { gl-mifi) status_led="$board:green:lan" ;; + ap91-5g|\ + n5q) + status_led="$board:green:signal4" + ;; ap96) status_led="$board:green:led2" ;; @@ -176,7 +181,8 @@ get_status_led() { oolite) status_led="$board:red:system" ;; - dw33d) + dw33d|\ + r36a) status_led="$board:blue:status" ;; eap300v2) @@ -204,6 +210,7 @@ get_status_led() { esr1750) status_led="$board:amber:power" ;; + gl-ar750|\ hiveap-121|\ nbg6716) status_led="$board:white:power" @@ -521,7 +528,8 @@ set_state() { done) status_led_on case $(board_name) in - gl-ar300m) + gl-ar300m|\ + gl-ar750) fw_printenv lc >/dev/null 2>&1 && fw_setenv "bootcount" 0 ;; qihoo-c301) diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index f9520b302..41ab43f7c 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -94,6 +94,10 @@ case "$FIRMWARE" in rambutan) ath9k_eeprom_extract "art" 4096 2048 ;; + wlr8100) + ath9k_eeprom_extract "art" 4096 2048 + ath9k_patch_firmware_mac $(mtd_get_mac_ascii u-boot-env "ethaddr") + ;; z1) . /lib/upgrade/nand.sh diff --git a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index bc8972c2c..ccb041028 100644 --- a/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ar71xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -89,6 +89,11 @@ case "$FIRMWARE" in ath10kcal_extract "caldata" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) ;; + gl-ar750|\ + tl-wpa8630) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) + ;; mc-mac1200r) ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) -1) @@ -97,7 +102,8 @@ case "$FIRMWARE" in ath10kcal_extract "caldata" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth1/address) +2) ;; - rb-952ui-5ac2nd) + rb-952ui-5ac2nd|\ + rb-wapg-5hact2hnd) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; re450|\ @@ -105,10 +111,6 @@ case "$FIRMWARE" in ath10kcal_extract "art" 20480 2116 ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2) ;; - tl-wpa8630) - ath10kcal_extract "art" 20480 2116 - ath10kcal_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1) - ;; unifiac-lite|\ unifiac-pro) ath10kcal_extract "EEPROM" 20480 2116 @@ -139,6 +141,10 @@ case "$FIRMWARE" in rb-962uigs-5hact2hnt) ath10kcal_from_file "/sys/firmware/routerboot/ext_wlan_data" 20480 2116 ;; + wlr8100) + ath10kcal_extract "art" 20480 2116 + ath10kcal_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1) + ;; esac ;; "ath10k/pre-cal-pci-0000:00:00.0.bin") diff --git a/target/linux/ar71xx/base-files/lib/ar71xx.sh b/target/linux/ar71xx/base-files/lib/ar71xx.sh index c3059eab2..b6642495d 100755 --- a/target/linux/ar71xx/base-files/lib/ar71xx.sh +++ b/target/linux/ar71xx/base-files/lib/ar71xx.sh @@ -263,9 +263,6 @@ tplink_board_detect() { "120000"*) model="MERCURY MAC1200R" ;; - "204100"*) - model="TP-Link TL-WR2041N" - ;; "254300"*) model="TP-Link TL-WR2543N/ND" ;; @@ -449,6 +446,9 @@ ar71xx_board_detect() { *"AP90Q") name="ap90q" ;; + *"AP91-5G") + name="ap91-5g" + ;; *"Archer C25 v1") name="archer-c25-v1" ;; @@ -673,6 +673,9 @@ ar71xx_board_detect() { *"GL-AR300M") name="gl-ar300m" ;; + *"GL-AR750") + name="gl-ar750" + ;; *"GL-CONNECT INET v1") name="gl-inet" @@ -768,6 +771,9 @@ ar71xx_board_detect() { *"MZK-W300NH") name="mzk-w300nh" ;; + *"N5Q") + name="n5q" + ;; *"Nanostation M") name="nanostation-m" ubnt_xm_board_detect @@ -844,6 +850,9 @@ ar71xx_board_detect() { *"Qihoo 360 C301") name="qihoo-c301" ;; + *"R36A") + name="r36a" + ;; *"R602N") name="r602n" ;; @@ -986,12 +995,18 @@ ar71xx_board_detect() { *"RouterBOARD wAP 2nD r2") name="rb-wap-2nd" ;; + *"RouterBOARD wAP G-5HacT2HnD") + name="rb-wapg-5hact2hnd" + ;; *"RouterStation") name="routerstation" ;; *"RouterStation Pro") name="routerstation-pro" ;; + *"RUT900") + name="rut900" + ;; *"RW2458N") name="rw2458n" ;; @@ -1148,12 +1163,6 @@ ar71xx_board_detect() { *"TL-WR1043ND v4") name="tl-wr1043nd-v4" ;; - *"TL-WR2041N v1") - name="tl-wr2041n-v1" - ;; - *"TL-WR2041N v2") - name="tl-wr2041n-v2" - ;; *"TL-WR2543N"*) name="tl-wr2543n" ;; @@ -1226,9 +1235,6 @@ ar71xx_board_detect() { *"TL-WR941N/ND v6") name="tl-wr941nd-v6" ;; - *"TL-WR941N v7") - name="tl-wr941n-v7" - ;; *"TL-WR941ND") name="tl-wr941nd" ;; diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx index df653f2e4..7d3e82813 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_iface_mac_ar71xx @@ -22,44 +22,38 @@ preinit_set_mac_address() { . /lib/functions.sh case $(board_name) in - c-55|\ - c-60) - mac_lan=$(mtd_get_mac_binary art 0) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; - dir-615-c1) - fetch_mac_from_mtd config lan_mac wan_mac - echo 1 > /sys/class/leds/dir-615-c1:green:wancpu/brightness - ;; - dir-615-i1) - fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac - ;; - mr18) - mac_lan=$(mtd_get_mac_binary_ubi board-config 102) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; - 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" - ;; - rambutan) - mac_lan=$(mtd_get_mac_binary art 0) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - mac_wan=$(mtd_get_mac_binary art 6) - [ -n "$mac_wan" ] && ifconfig eth1 hw ether "$mac_wan" - ;; - tew-632brp) - fetch_mac_from_mtd config lan_mac wan_mac - ;; - wrt160nl) - fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr - ;; - z1) - mac_lan=$(mtd_get_mac_binary_ubi board-config 102) - [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" - ;; + c-55|\ + c-60) + mac_lan=$(mtd_get_mac_binary art 0) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + ;; + dir-615-c1|\ + tew-632brp) + fetch_mac_from_mtd config lan_mac wan_mac + ;; + dir-615-i1) + fetch_mac_from_mtd nvram sys_lan_mac sys_wan_mac + ;; + mr18|\ + z1) + mac_lan=$(mtd_get_mac_binary_ubi board-config 102) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + ;; + 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" + ;; + rambutan) + mac_lan=$(mtd_get_mac_binary art 0) + [ -n "$mac_lan" ] && ifconfig eth0 hw ether "$mac_lan" + mac_wan=$(mtd_get_mac_binary art 6) + [ -n "$mac_wan" ] && ifconfig eth1 hw ether "$mac_wan" + ;; + wrt160nl) + fetch_mac_from_mtd nvram lan_hwaddr wan_hwaddr + ;; esac } diff --git a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx index 4b2fb6c41..909e61509 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx +++ b/target/linux/ar71xx/base-files/lib/preinit/05_set_preinit_iface_ar71xx @@ -8,42 +8,43 @@ set_preinit_iface() { . /lib/functions.sh case $(board_name) in - alfa-ap96 |\ - alfa-nx |\ - ap135-020 |\ - ap136-020 |\ - ap147-010 |\ - archer-c5 |\ - archer-c7 |\ - bhr-4grv2 |\ - dir-505-a1 |\ - gl-inet |\ - jwap003 |\ - pb42 |\ - pb44 |\ - rb-433 |\ - rb-433u |\ - rb-435g |\ - rb-450 |\ - rb-450g |\ - routerstation |\ - routerstation-pro |\ - smart-300 |\ - tl-mr3420-v2 |\ - tl-wdr4900-v2 |\ - tl-wr1043nd-v2 |\ - tl-wr710n |\ - tl-wr720n-v3 |\ - tl-wr841n-v8 |\ - tl-wr842n-v2 |\ - tl-wr940n-v4 |\ - tl-wr941nd-v6 |\ - wnr2000-v3 |\ - wnr2200 |\ - wnr612-v2 |\ - wnr1000-v2 |\ - wpn824n |\ - wpe72) + alfa-ap96|\ + alfa-nx|\ + ap135-020|\ + ap136-020|\ + ap147-010|\ + archer-c5|\ + archer-c7|\ + bhr-4grv2|\ + dir-505-a1|\ + gl-ar750|\ + gl-inet|\ + jwap003|\ + pb42|\ + pb44|\ + rb-433|\ + rb-433u|\ + rb-435g|\ + rb-450|\ + rb-450g|\ + routerstation|\ + routerstation-pro|\ + smart-300|\ + tl-mr3420-v2|\ + tl-wdr4900-v2|\ + tl-wr1043nd-v2|\ + tl-wr710n|\ + tl-wr720n-v3|\ + tl-wr841n-v8|\ + tl-wr842n-v2|\ + tl-wr940n-v4|\ + tl-wr941nd-v6|\ + wnr1000-v2|\ + wnr2000-v3|\ + wnr2200|\ + wnr612-v2|\ + wpe72|\ + wpn824n) ifname=eth1 ;; *) @@ -53,6 +54,3 @@ set_preinit_iface() { } boot_hook_add preinit_main set_preinit_iface - - - diff --git a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k index c9aa4b1eb..cc3dc42c9 100644 --- a/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k +++ b/target/linux/ar71xx/base-files/lib/preinit/82_patch_ath10k @@ -7,9 +7,7 @@ do_patch_ath10k_firmware() { local firmware_file="/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin" # bail out if firmware does not exist - [ -f "$firmware_file" ] || { - return - } + [ -f "$firmware_file" ] || return local mac_offset=276 local mac_length=6 @@ -17,35 +15,34 @@ do_patch_ath10k_firmware() { local current_mac="$(hexdump -v -n $mac_length -s $mac_offset -e '5/1 "%02x:" 1/1 "%02x"' $firmware_file 2>/dev/null)" # check if mac address was already patched - [ "$default_mac" = "$current_mac" ] || { - return - } + [ "$default_mac" = "$current_mac" ] || return # some boards have bogus mac in otp (= directly in the PCIe card's EEPROM). # we have to patch the default mac in the firmware because we cannot change # the otp. case $(board_name) in - dgl-5500-a1 | tew-823dru) - local mac - mac=$(mtd_get_mac_ascii nvram wlan1_mac) - - cp $firmware_file /tmp/ath10k-firmware.bin - macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \ - conv=notrunc bs=1 seek=$mac_offset count=$mac_length + dgl-5500-a1|\ + tew-823dru) + local mac + mac=$(mtd_get_mac_ascii nvram wlan1_mac) + cp $firmware_file /tmp/ath10k-firmware.bin + macaddr_2bin $mac | dd of=/tmp/ath10k-firmware.bin \ + conv=notrunc bs=1 seek=$mac_offset count=$mac_length ;; esac - [ -f /tmp/ath10k-firmware.bin ] || { - return - } + + [ -f /tmp/ath10k-firmware.bin ] || return + cp /tmp/ath10k-firmware.bin $firmware_file rm /tmp/ath10k-firmware.bin } check_patch_ath10k_firmware() { case $(board_name) in - dgl-5500-a1 | tew-823dru) - do_patch_ath10k_firmware + dgl-5500-a1|\ + tew-823dru) + do_patch_ath10k_firmware ;; esac } diff --git a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh index 1322fb8a9..3d7b1593e 100755 --- a/target/linux/ar71xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/ar71xx/base-files/lib/upgrade/platform.sh @@ -242,6 +242,7 @@ platform_check_image() { gl-ar150|\ gl-ar300m|\ gl-ar300|\ + gl-ar750|\ gl-domino|\ gl-mifi|\ gl-usb150|\ @@ -252,10 +253,12 @@ platform_check_image() { loco-m-xw|\ mzk-w04nu|\ mzk-w300nh|\ + n5q|\ nanostation-m|\ nanostation-m-xw|\ nbg460n_550n_550nh|\ pqi-air-pen|\ + r36a|\ r602n|\ rocket-m|\ rocket-m-ti|\ @@ -310,6 +313,7 @@ platform_check_image() { ap136-020|\ ap147-010|\ ap152|\ + ap91-5g|\ ap96|\ arduino-yun|\ bhr-4grv2|\ @@ -385,6 +389,7 @@ platform_check_image() { onion-omega|\ oolite|\ re450|\ + rut900|\ smart-300|\ som9331|\ tellstick-znet-lite|\ @@ -450,8 +455,7 @@ platform_check_image() { tl-wr940n-v4|\ tl-wr941nd|\ tl-wr941nd-v5|\ - tl-wr941nd-v6|\ - tl-wr941n-v7) + tl-wr941nd-v6) local magic_ver="0100" case "$board" in @@ -663,7 +667,8 @@ platform_check_image() { rb-lhg-5nd|\ rb-map-2nd|\ rb-mapl-2nd|\ - rb-wap-2nd) + rb-wap-2nd|\ + rb-wapg-5hact2hnd) return 0 ;; esac @@ -725,7 +730,8 @@ platform_pre_upgrade() { rb-lhg-5nd|\ rb-map-2nd|\ rb-mapl-2nd|\ - rb-wap-2nd) + rb-wap-2nd|\ + rb-wapg-5hact2hnd) # erase firmware if booted from initramfs [ -z "$(rootfs_type)" ] && mtd erase firmware ;; diff --git a/target/linux/ar71xx/config-4.4 b/target/linux/ar71xx/config-4.4 index 847836806..8ecf7e135 100644 --- a/target/linux/ar71xx/config-4.4 +++ b/target/linux/ar71xx/config-4.4 @@ -49,6 +49,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set # CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP91_5G is not set # CONFIG_ATH79_MACH_AP96 is not set # CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set # CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set @@ -113,6 +114,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_AR150 is not set # CONFIG_ATH79_MACH_GL_AR300 is not set # CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_AR750 is not set # CONFIG_ATH79_MACH_GL_DOMINO is not set # CONFIG_ATH79_MACH_GL_INET is not set # CONFIG_ATH79_MACH_GL_MIFI is not set @@ -138,6 +140,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_MYNET_REXT is not set # CONFIG_ATH79_MACH_MZK_W04NU is not set # CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_N5Q is not set # CONFIG_ATH79_MACH_NBG460N is not set # CONFIG_ATH79_MACH_NBG6716 is not set # CONFIG_ATH79_MACH_OM2P is not set @@ -151,6 +154,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_PB44 is not set # CONFIG_ATH79_MACH_PQI_AIR_PEN is not set # CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R36A is not set # CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set @@ -163,6 +167,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set # CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RUT9XX is not set # CONFIG_ATH79_MACH_RW2458N is not set # CONFIG_ATH79_MACH_SC1750 is not set # CONFIG_ATH79_MACH_SC300M is not set diff --git a/target/linux/ar71xx/config-4.9 b/target/linux/ar71xx/config-4.9 index 2c20b5839..0e224ae1c 100644 --- a/target/linux/ar71xx/config-4.9 +++ b/target/linux/ar71xx/config-4.9 @@ -47,6 +47,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_AP531B0 is not set # CONFIG_ATH79_MACH_AP81 is not set # CONFIG_ATH79_MACH_AP90Q is not set +# CONFIG_ATH79_MACH_AP91_5G is not set # CONFIG_ATH79_MACH_AP96 is not set # CONFIG_ATH79_MACH_ARCHER_C25_V1 is not set # CONFIG_ATH79_MACH_ARCHER_C58_V1 is not set @@ -111,6 +112,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_GL_AR150 is not set # CONFIG_ATH79_MACH_GL_AR300 is not set # CONFIG_ATH79_MACH_GL_AR300M is not set +# CONFIG_ATH79_MACH_GL_AR750 is not set # CONFIG_ATH79_MACH_GL_DOMINO is not set # CONFIG_ATH79_MACH_GL_INET is not set # CONFIG_ATH79_MACH_GL_MIFI is not set @@ -136,6 +138,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_MYNET_REXT is not set # CONFIG_ATH79_MACH_MZK_W04NU is not set # CONFIG_ATH79_MACH_MZK_W300NH is not set +# CONFIG_ATH79_MACH_N5Q is not set # CONFIG_ATH79_MACH_NBG460N is not set # CONFIG_ATH79_MACH_NBG6716 is not set # CONFIG_ATH79_MACH_OM2P is not set @@ -149,6 +152,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_PB44 is not set # CONFIG_ATH79_MACH_PQI_AIR_PEN is not set # CONFIG_ATH79_MACH_QIHOO_C301 is not set +# CONFIG_ATH79_MACH_R36A is not set # CONFIG_ATH79_MACH_R602N is not set # CONFIG_ATH79_MACH_R6100 is not set # CONFIG_ATH79_MACH_RAMBUTAN is not set @@ -161,6 +165,7 @@ CONFIG_ATH79=y # CONFIG_ATH79_MACH_RBSPI is not set # CONFIG_ATH79_MACH_RBSXTLITE is not set # CONFIG_ATH79_MACH_RE450 is not set +# CONFIG_ATH79_MACH_RUT9XX is not set # CONFIG_ATH79_MACH_RW2458N is not set # CONFIG_ATH79_MACH_SC1750 is not set # CONFIG_ATH79_MACH_SC300M is not set @@ -456,4 +461,3 @@ CONFIG_SYS_SUPPORTS_ZBOOT=y CONFIG_SYS_SUPPORTS_ZBOOT_UART_PROM=y CONFIG_TICK_CPU_ACCOUNTING=y CONFIG_USB_SUPPORT=y -CONFIG_KERNEL_KALLSYMS=n \ No newline at end of file diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt index 1198fcb74..3ca77550b 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt +++ b/target/linux/ar71xx/files/arch/mips/ath79/Kconfig.openwrt @@ -225,6 +225,15 @@ config ATH79_MACH_AP90Q select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_AP91_5G + bool "ALFA Network AP91-5G support" + select SOC_AR724X + 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 + config ATH79_MACH_AP96 bool "Atheros AP96 board support" select SOC_AR71XX @@ -761,6 +770,17 @@ config ATH79_MACH_GL_AR300M select ATH79_DEV_USB select ATH79_DEV_WMAC +config ATH79_MACH_GL_AR750 + bool "GL.iNet GL-AR750 support" + select SOC_QCA953X + 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_USB + select ATH79_DEV_WMAC + config ATH79_MACH_GL_DOMINO bool "DOMINO support" select SOC_AR933X @@ -925,6 +945,16 @@ config ATH79_MACH_WRTNODE2Q select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_R36A + bool "ALFA Network R36A support" + select SOC_QCA953X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + config ATH79_MACH_R602N bool "P&W R602N support" select SOC_QCA953X @@ -1272,6 +1302,17 @@ config ATH79_MACH_RE450 select ATH79_DEV_M25P80 select ATH79_DEV_WMAC +config ATH79_MACH_RUT9XX + bool "Teltonika RUT900 series support" + select SOC_AR934X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_M25P80 + select ATH79_DEV_USB + select ATH79_DEV_WMAC + select GPIO_PCA953X + config ATH79_MACH_RW2458N bool "Redwave RW2458N board support" select SOC_AR724X @@ -1999,6 +2040,14 @@ config ATH79_MACH_ZCN_1523H select ATH79_DEV_LEDS_GPIO select ATH79_DEV_M25P80 +config ATH79_MACH_N5Q + bool "ALFA Network N5Q support" + select SOC_AR934X + select ATH79_DEV_ETH + select ATH79_DEV_GPIO_BUTTONS + select ATH79_DEV_LEDS_GPIO + select ATH79_DEV_WMAC + config ATH79_MACH_NBG460N bool "Zyxel NBG460N/550N/550NH board support" select SOC_AR913X diff --git a/target/linux/ar71xx/files/arch/mips/ath79/Makefile b/target/linux/ar71xx/files/arch/mips/ath79/Makefile index 455af762e..e9f4d9852 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/Makefile +++ b/target/linux/ar71xx/files/arch/mips/ath79/Makefile @@ -57,6 +57,7 @@ obj-$(CONFIG_ATH79_MACH_AP147) += mach-ap147.o obj-$(CONFIG_ATH79_MACH_AP152) += mach-ap152.o obj-$(CONFIG_ATH79_MACH_AP531B0) += mach-ap531b0.o obj-$(CONFIG_ATH79_MACH_AP90Q) += mach-ap90q.o +obj-$(CONFIG_ATH79_MACH_AP91_5G) += mach-ap91-5g.o obj-$(CONFIG_ATH79_MACH_AP96) += mach-ap96.o obj-$(CONFIG_ATH79_MACH_ARCHER_C25_V1) += mach-archer-c25-v1.o obj-$(CONFIG_ATH79_MACH_ARCHER_C58_V1) += mach-archer-c59-v1.o @@ -121,6 +122,7 @@ obj-$(CONFIG_ATH79_MACH_FRITZ300E) += mach-fritz300e.o obj-$(CONFIG_ATH79_MACH_GL_AR150) += mach-gl-ar150.o obj-$(CONFIG_ATH79_MACH_GL_AR300) += mach-gl-ar300.o obj-$(CONFIG_ATH79_MACH_GL_AR300M) += mach-gl-ar300m.o +obj-$(CONFIG_ATH79_MACH_GL_AR750) += mach-gl-ar750.o obj-$(CONFIG_ATH79_MACH_GL_DOMINO) += mach-gl-domino.o obj-$(CONFIG_ATH79_MACH_GL_INET) += mach-gl-inet.o obj-$(CONFIG_ATH79_MACH_GL_MIFI) += mach-gl-mifi.o @@ -146,6 +148,7 @@ obj-$(CONFIG_ATH79_MACH_MYNET_N750) += mach-mynet-n750.o obj-$(CONFIG_ATH79_MACH_MYNET_REXT) += mach-mynet-rext.o obj-$(CONFIG_ATH79_MACH_MZK_W04NU) += mach-mzk-w04nu.o obj-$(CONFIG_ATH79_MACH_MZK_W300NH) += mach-mzk-w300nh.o +obj-$(CONFIG_ATH79_MACH_N5Q) += mach-n5q.o obj-$(CONFIG_ATH79_MACH_NBG460N) += mach-nbg460n.o obj-$(CONFIG_ATH79_MACH_NBG6716) += mach-nbg6716.o obj-$(CONFIG_ATH79_MACH_RAMBUTAN) += mach-rambutan.o @@ -160,6 +163,7 @@ obj-$(CONFIG_ATH79_MACH_PB42) += mach-pb42.o obj-$(CONFIG_ATH79_MACH_PB44) += mach-pb44.o obj-$(CONFIG_ATH79_MACH_PQI_AIR_PEN) += mach-pqi-air-pen.o obj-$(CONFIG_ATH79_MACH_QIHOO_C301) += mach-qihoo-c301.o +obj-$(CONFIG_ATH79_MACH_R36A) += mach-r36a.o obj-$(CONFIG_ATH79_MACH_R602N) += mach-r602n.o obj-$(CONFIG_ATH79_MACH_R6100) += mach-r6100.o obj-$(CONFIG_ATH79_MACH_RB2011) += mach-rb2011.o @@ -172,6 +176,7 @@ obj-$(CONFIG_ATH79_MACH_RB95X) += mach-rb95x.o obj-$(CONFIG_ATH79_MACH_RBSPI) += mach-rbspi.o obj-$(CONFIG_ATH79_MACH_RBSXTLITE) += mach-rbsxtlite.o obj-$(CONFIG_ATH79_MACH_RE450) += mach-re450.o +obj-$(CONFIG_ATH79_MACH_RUT9XX) += mach-rut9xx.o obj-$(CONFIG_ATH79_MACH_RW2458N) += mach-rw2458n.o obj-$(CONFIG_ATH79_MACH_SC1750) += mach-sc1750.o obj-$(CONFIG_ATH79_MACH_SC300M) += mach-sc300m.o diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c new file mode 100644 index 000000000..64b943038 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-ap91-5g.c @@ -0,0 +1,118 @@ +/* + * ALFA Network AP91-5G board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * 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 +#include + +#include +#include + +#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 "machtypes.h" + +#define AP91_5G_GPIO_LED_LAN 17 +#define AP91_5G_GPIO_LED_SIGNAL1 12 +#define AP91_5G_GPIO_LED_SIGNAL2 8 +#define AP91_5G_GPIO_LED_SIGNAL3 6 +#define AP91_5G_GPIO_LED_SIGNAL4 7 + +#define AP91_5G_GPIO_WDT_EN 1 +#define AP91_5G_GPIO_WDT_IN 0 + +#define AP91_5G_GPIO_BTN_RESET 11 + +#define AP91_5G_KEYS_POLL_INTERVAL 20 +#define AP91_5G_KEYS_DEBOUNCE_INTERVAL (3 * AP91_5G_KEYS_POLL_INTERVAL) + +#define AP91_5G_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led ap91_5g_leds_gpio[] __initdata = { + { + .name = "ap91-5g:green:lan", + .gpio = AP91_5G_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "ap91-5g:red:signal1", + .gpio = AP91_5G_GPIO_LED_SIGNAL1, + .active_low = 1, + }, { + .name = "ap91-5g:orange:signal2", + .gpio = AP91_5G_GPIO_LED_SIGNAL2, + .active_low = 1, + }, { + .name = "ap91-5g:green:signal3", + .gpio = AP91_5G_GPIO_LED_SIGNAL3, + .active_low = 1, + }, { + .name = "ap91-5g:green:signal4", + .gpio = AP91_5G_GPIO_LED_SIGNAL4, + .active_low = 1, + }, +}; + +static struct gpio_keys_button ap91_5g_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = AP91_5G_KEYS_DEBOUNCE_INTERVAL, + .gpio = AP91_5G_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static void __init ap91_5g_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); + + ath79_gpio_function_setup(AR724X_GPIO_FUNC_JTAG_DISABLE, + AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN); + + gpio_set_value(AP91_5G_GPIO_LED_LAN, 1); + gpio_set_value(AP91_5G_GPIO_LED_SIGNAL3, 1); + gpio_set_value(AP91_5G_GPIO_LED_SIGNAL4, 1); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(0, 0x0); + + /* LAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); + ath79_register_eth(0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(ap91_5g_leds_gpio), + ap91_5g_leds_gpio); + + ath79_register_gpio_keys_polled(-1, AP91_5G_KEYS_POLL_INTERVAL, + ARRAY_SIZE(ap91_5g_gpio_keys), + ap91_5g_gpio_keys); + + gpio_request_one(AP91_5G_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(AP91_5G_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + ap91_pci_init(art + AP91_5G_WMAC_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_AP91_5G, "AP91-5G", "ALFA Network AP91-5G", + ap91_5g_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c new file mode 100644 index 000000000..9ee6e29c0 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-gl-ar750.c @@ -0,0 +1,146 @@ +/* + * GL.iNet GL-AR750 board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * 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 +#include +#include +#include + +#include +#include + +#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-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define GL_AR750_GPIO_LED_POWER 12 +#define GL_AR750_GPIO_LED_WLAN2G 14 +#define GL_AR750_GPIO_LED_WLAN5G 13 + +#define GL_AR750_GPIO_BTN_RESET 3 +#define GL_AR750_GPIO_BTN_SW1 0 + +#define GL_AR750_GPIO_I2C_SCL 16 +#define GL_AR750_GPIO_I2C_SDA 17 + +#define GL_AR750_GPIO_USB_POWER 2 + +#define GL_AR750_KEYS_POLL_INTERVAL 20 +#define GL_AR750_KEYS_DEBOUNCE_INTERVAL (3 * GL_AR750_KEYS_POLL_INTERVAL) + +#define GL_AR750_MAC0_OFFSET 0 +#define GL_AR750_WMAC2G_CALDATA_OFFSET 0x1000 +#define GL_AR750_WMAC5G_CALDATA_OFFSET 0x5000 + +static struct gpio_led gl_ar750_leds_gpio[] __initdata = { + { + .name = "gl-ar750:white:power", + .gpio = GL_AR750_GPIO_LED_POWER, + .default_state = LEDS_GPIO_DEFSTATE_KEEP, + .active_low = 1, + }, { + .name = "gl-ar750:white:wlan2g", + .gpio = GL_AR750_GPIO_LED_WLAN2G, + .active_low = 1, + }, { + .name = "gl-ar750:white:wlan5g", + .gpio = GL_AR750_GPIO_LED_WLAN5G, + .active_low = 1, + }, +}; + +static struct gpio_keys_button gl_ar750_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL, + .gpio = GL_AR750_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "sw1", + .type = EV_KEY, + .code = BTN_0, + .debounce_interval = GL_AR750_KEYS_DEBOUNCE_INTERVAL, + .gpio = GL_AR750_GPIO_BTN_SW1, + .active_low = 1, + }, +}; + +static struct i2c_gpio_platform_data gl_ar750_i2c_gpio_data = { + .sda_pin = GL_AR750_GPIO_I2C_SDA, + .scl_pin = GL_AR750_GPIO_I2C_SCL, +}; + +static struct platform_device gl_ar750_i2c_gpio = { + .name = "i2c-gpio", + .id = 0, + .dev = { + .platform_data = &gl_ar750_i2c_gpio_data, + }, +}; + +static void __init gl_ar750_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f050000); + + ath79_register_m25p80(NULL); + + ath79_setup_ar933x_phy4_switch(false, false); + ath79_register_mdio(0, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xfc; + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 0); + ath79_register_eth(0); + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art + GL_AR750_MAC0_OFFSET, 1); + ath79_register_eth(1); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(gl_ar750_leds_gpio), + gl_ar750_leds_gpio); + + ath79_register_gpio_keys_polled(-1, GL_AR750_KEYS_POLL_INTERVAL, + ARRAY_SIZE(gl_ar750_gpio_keys), + gl_ar750_gpio_keys); + + gpio_request_one(GL_AR750_GPIO_USB_POWER, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + + platform_device_register(&gl_ar750_i2c_gpio); + + ath79_register_usb(); + + ath79_register_wmac(art + GL_AR750_WMAC2G_CALDATA_OFFSET, NULL); + + ap91_pci_init(art + GL_AR750_WMAC5G_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_GL_AR750, "GL-AR750", "GL.iNet GL-AR750", + gl_ar750_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c new file mode 100644 index 000000000..895fc3293 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-n5q.c @@ -0,0 +1,132 @@ +/* + * ALFA Network N5Q board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * 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 +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define N5Q_GPIO_LED_LAN 19 +#define N5Q_GPIO_LED_SIGNAL1 0 +#define N5Q_GPIO_LED_SIGNAL2 1 +#define N5Q_GPIO_LED_SIGNAL3 2 +#define N5Q_GPIO_LED_SIGNAL4 3 +#define N5Q_GPIO_LED_WAN 18 +#define N5Q_GPIO_LED_WLAN 12 + +#define N5Q_GPIO_WDT_EN 16 +#define N5Q_GPIO_WDT_IN 17 + +#define N5Q_GPIO_BTN_RESET 11 + +#define N5Q_MAC0_OFFSET 0 +#define N5Q_MAC1_OFFSET 6 +#define N5Q_WMAC_CALDATA_OFFSET 0x1000 + +#define N5Q_KEYS_POLL_INTERVAL 20 +#define N5Q_KEYS_DEBOUNCE_INTERVAL (3 * N5Q_KEYS_POLL_INTERVAL) + +static struct gpio_led n5q_leds_gpio[] __initdata = { + { + .name = "n5q:green:lan", + .gpio = N5Q_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "n5q:red:signal1", + .gpio = N5Q_GPIO_LED_SIGNAL1, + .active_low = 1, + }, { + .name = "n5q:orange:signal2", + .gpio = N5Q_GPIO_LED_SIGNAL2, + .active_low = 1, + }, { + .name = "n5q:green:signal3", + .gpio = N5Q_GPIO_LED_SIGNAL3, + .active_low = 1, + }, { + .name = "n5q:green:signal4", + .gpio = N5Q_GPIO_LED_SIGNAL4, + .active_low = 1, + }, { + .name = "n5q:green:wan", + .gpio = N5Q_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "n5q:green:wlan", + .gpio = N5Q_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button n5q_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = N5Q_KEYS_DEBOUNCE_INTERVAL, + .gpio = N5Q_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static void __init n5q_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f070000); + + ath79_register_m25p80(NULL); + + ath79_register_mdio(1, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf7; + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art + N5Q_MAC1_OFFSET, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art + N5Q_MAC0_OFFSET, 0); + ath79_register_eth(0); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(n5q_leds_gpio), + n5q_leds_gpio); + + ath79_register_gpio_keys_polled(-1, N5Q_KEYS_POLL_INTERVAL, + ARRAY_SIZE(n5q_gpio_keys), + n5q_gpio_keys); + + gpio_request_one(N5Q_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(N5Q_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + ath79_register_wmac(art + N5Q_WMAC_CALDATA_OFFSET, NULL); +} + +MIPS_MACHINE(ATH79_MACH_N5Q, "N5Q", "ALFA Network N5Q", n5q_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c new file mode 100644 index 000000000..b3493e2c4 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-r36a.c @@ -0,0 +1,140 @@ +/* + * ALFA Network R36A board support + * + * Copyright (C) 2018 Piotr Dymacz + * + * 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 +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define R36A_GPIO_LED_LAN 4 +#define R36A_GPIO_LED_STATUS 14 +#define R36A_GPIO_LED_USB 12 +#define R36A_GPIO_LED_WAN 16 +#define R36A_GPIO_LED_WLAN 15 + +#define R36A_GPIO_WDT_EN 1 +#define R36A_GPIO_WDT_IN 0 +#define R36A_GPIO_USB_PWR 3 + +#define R36A_GPIO_BTN_RESET 2 +#define R36A_GPIO_BTN_RFKILL 17 + +#define R36A_KEYS_POLL_INTERVAL 20 +#define R36A_KEYS_DEBOUNCE_INTERVAL (3 * R36A_KEYS_POLL_INTERVAL) + +#define R36A_WMAC_CALDATA_OFFSET 0x1000 + +static struct gpio_led r36a_leds_gpio[] __initdata = { + { + .name = "r36a:blue:lan", + .gpio = R36A_GPIO_LED_LAN, + .active_low = 1, + }, { + .name = "r36a:blue:status", + .gpio = R36A_GPIO_LED_STATUS, + .active_low = 1, + }, { + .name = "r36a:blue:usb", + .gpio = R36A_GPIO_LED_USB, + .active_low = 1, + }, { + .name = "r36a:blue:wan", + .gpio = R36A_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "r36a:blue:wlan", + .gpio = R36A_GPIO_LED_WLAN, + .active_low = 1, + }, +}; + +static struct gpio_keys_button r36a_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = R36A_KEYS_DEBOUNCE_INTERVAL, + .gpio = R36A_GPIO_BTN_RESET, + .active_low = 1, + }, { + .desc = "rfkill", + .type = EV_KEY, + .code = KEY_RFKILL, + .debounce_interval = R36A_KEYS_DEBOUNCE_INTERVAL, + .gpio = R36A_GPIO_BTN_RFKILL, + .active_low = 1, + }, +}; + +static void __init r36a_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f070000); + + ath79_register_m25p80(NULL); + + ath79_setup_ar933x_phy4_switch(false, false); + + ath79_register_mdio(0, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf7; + + /* LAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, art, 0); + ath79_register_eth(0); + + /* WAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, art, 1); + ath79_register_eth(1); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(r36a_leds_gpio), + r36a_leds_gpio); + + ath79_register_gpio_keys_polled(-1, R36A_KEYS_POLL_INTERVAL, + ARRAY_SIZE(r36a_gpio_keys), + r36a_gpio_keys); + + gpio_request_one(R36A_GPIO_WDT_IN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT input"); + + gpio_request_one(R36A_GPIO_WDT_EN, + GPIOF_OUT_INIT_LOW | GPIOF_EXPORT_DIR_FIXED, + "WDT enable"); + + gpio_request_one(R36A_GPIO_USB_PWR, + GPIOF_OUT_INIT_HIGH | GPIOF_EXPORT_DIR_FIXED, + "USB power"); + + ath79_register_wmac(art + R36A_WMAC_CALDATA_OFFSET, NULL); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_R36A, "R36A", "ALFA Network R36A", r36a_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c index cfd737316..8d8dd40e8 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rbspi.c @@ -12,6 +12,7 @@ * - MikroTik RouterBOARD 750 r2 * - MikroTik RouterBOARD LHG 5nD * - MikroTik RouterBOARD wAP2nD + * - MikroTik RouterBOARD wAP G-5HacT2HnDwAP (wAP AC) * * Preliminary support for the following hardware * - MikroTik RouterBOARD cAP2nD @@ -41,6 +42,8 @@ #include #include +#include +#include #include #include @@ -134,10 +137,22 @@ static struct flash_platform_data rbspi_spi_flash_data = { .nr_parts = ARRAY_SIZE(rbspi_spi_partitions), }; -/* Several boards only have a single reset button wired to GPIO 16 */ +/* Several boards only have a single reset button, wired to GPIO 1, 16 or 20 */ +#define RBSPI_GPIO_BTN_RESET01 1 #define RBSPI_GPIO_BTN_RESET16 16 #define RBSPI_GPIO_BTN_RESET20 20 +static struct gpio_keys_button rbspi_gpio_keys_reset01[] __initdata = { + { + .desc = "Reset button", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RBSPI_KEYS_DEBOUNCE_INTERVAL, + .gpio = RBSPI_GPIO_BTN_RESET01, + .active_low = 1, + }, +}; + static struct gpio_keys_button rbspi_gpio_keys_reset16[] __initdata = { { .desc = "Reset button", @@ -485,6 +500,40 @@ static struct gpio_keys_button rblhg_gpio_keys[] __initdata = { }, }; +/* RB w APG-5HacT2HnD (wAP AC) gpios*/ +#define RBWAPGSC_LED1 1 +#define RBWAPGSC_LED2 8 +#define RBWAPGSC_LED3 9 +#define RBWAPGSC_POWERLED 16 +#define RBWAPGSC_GPIO_MDIO_MDC 12 +#define RBWAPGSC_GPIO_MDIO_DATA 11 +#define RBWAPGSC_MDIO_PHYADDR 0 + +static struct gpio_led rbwapgsc_leds[] __initdata = { + { + .name = "rb:green:led1", + .gpio = RBWAPGSC_LED1, + .active_low = 1, + },{ + .name = "rb:blue:power", + .gpio = RBWAPGSC_POWERLED, + .active_low = 1, + }, +}; + +static struct mdio_gpio_platform_data rbwapgsc_mdio_data = { + .mdc = RBWAPGSC_GPIO_MDIO_MDC, + .mdio = RBWAPGSC_GPIO_MDIO_DATA, + .phy_mask = ~BIT(RBWAPGSC_MDIO_PHYADDR), +}; + +static struct platform_device rbwapgsc_phy_device = { + .name = "mdio-gpio", + .id = 1, + .dev = { + .platform_data = &rbwapgsc_mdio_data + }, +}; static struct gen_74x164_chip_platform_data rbspi_ssr_data = { .base = RBSPI_SSR_GPIO_BASE, @@ -538,7 +587,7 @@ void __init rbspi_wlan_init(u16 id, int wmac_offset) } #define RBSPI_MACH_BUFLEN 64 -/* +/* * Common platform init routine for all SPI NOR devices. */ static int __init rbspi_platform_setup(void) @@ -641,7 +690,7 @@ static void __init rbspi_network_setup(u32 flags, int gmac1_offset, rbspi_wlan_init(1, wmac1_offset); } -/* +/* * Init the mAP lite hardware (QCA953x). * The mAP L-2nD (mAP lite) has a single ethernet port, connected to PHY0. * Trying to use GMAC0 in direct mode was unsucessful, so we're @@ -958,6 +1007,47 @@ static void __init rbmap_setup(void) rbspi_gpio_keys_reset16); } +/* + * Init the wAPGSC (RB wAPG-5HacT2HnD // wAP AC) hardware. + * The wAPGSC has one Ethernet port via AR8033 with PoE input, dual radio (SoC + * 2.4 GHz and external QCA9880) and a ZT2046Q temperature and voltage sensor + * (currently not supported). + */ +static void __init rbwapgsc_setup(void) +{ + u32 flags = RBSPI_HAS_PCI; + + if (rbspi_platform_setup()) + return; + + rbspi_peripherals_setup(flags); + + platform_device_register(&rbwapgsc_phy_device); + + ath79_init_mac(ath79_eth1_data.mac_addr, ath79_mac_base, 0); + ath79_eth1_data.mii_bus_dev = &rbwapgsc_phy_device.dev; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_SGMII; + ath79_eth1_data.phy_mask = BIT(RBWAPGSC_MDIO_PHYADDR); + ath79_eth1_pll_data.pll_1000 = 0x03000101; + ath79_eth1_pll_data.pll_100 = 0x80000101; + ath79_eth1_pll_data.pll_10 = 0x80001313; + ath79_eth1_data.speed = SPEED_1000; + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_register_eth(1); + + rbspi_wlan_init(1, 2); + + ath79_register_gpio_keys_polled(-1, RBSPI_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rbspi_gpio_keys_reset01), + rbspi_gpio_keys_reset01); + + ath79_gpio_function_enable(QCA955X_GPIO_FUNC_JTAG_DISABLE| + QCA955X_GPIO_REG_OUT_FUNC4| + QCA955X_GPIO_REG_OUT_FUNC3); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rbwapgsc_leds), + rbwapgsc_leds); +} MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAPL, "map-hb", rbmapl_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_941, "H951L", rbhapl_setup); @@ -968,3 +1058,4 @@ MIPS_MACHINE_NONAME(ATH79_MACH_RB_LHG5, "lhg", rblhg_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAP, "wap-hb", rbwap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_CAP, "cap-hb", rbcap_setup); MIPS_MACHINE_NONAME(ATH79_MACH_RB_MAP, "map2-hb", rbmap_setup); +MIPS_MACHINE_NONAME(ATH79_MACH_RB_WAPAC, "wapg-sc", rbwapgsc_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c new file mode 100644 index 000000000..43a2a78c6 --- /dev/null +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rut9xx.c @@ -0,0 +1,191 @@ +/* + * Teltonika RUT900 series boards support + * + * Copyright (C) 2018 Piotr Dymacz + * + * 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 +#include +#include +#include +#include +#include + +#include +#include + +#include "common.h" +#include "dev-eth.h" +#include "dev-gpio-buttons.h" +#include "dev-leds-gpio.h" +#include "dev-m25p80.h" +#include "dev-usb.h" +#include "dev-wmac.h" +#include "machtypes.h" + +#define RUT9XX_GPIO_LED_LAN1 14 +#define RUT9XX_GPIO_LED_LAN2 13 +#define RUT9XX_GPIO_LED_LAN3 22 +#define RUT9XX_GPIO_LED_WAN 1 + +#define RUT9XX_PCA9539_GPIO_BASE 32 +#define RUT9XX_PCA9539_GPIO_SIGNAL1 (0 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL2 (1 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL3 (2 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL4 (3 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_SIGNAL5 (4 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_STATUS_R (5 + RUT9XX_PCA9539_GPIO_BASE) +#define RUT9XX_PCA9539_GPIO_STATUS_G (6 + RUT9XX_PCA9539_GPIO_BASE) + +#define RUT9XX_GPIO_BTN_RESET 15 + +#define RUT9XX_GPIO_I2C_SCK 16 +#define RUT9XX_GPIO_I2C_SDA 17 + +#define RUT9XX_GPIO_EXT_LNA0 2 + +#define RUT9XX_WMAC_CALDATA_OFFSET 0x1000 + +#define RUT9XX_KEYS_POLL_INTERVAL 20 +#define RUT9XX_KEYS_DEBOUNCE_INTERVAL (3 * RUT9XX_KEYS_POLL_INTERVAL) + +static struct gpio_led rut900_leds_gpio[] __initdata = { + { + .name = "rut900:green:lan1", + .gpio = RUT9XX_GPIO_LED_LAN1, + .active_low = 1, + }, { + .name = "rut900:green:lan2", + .gpio = RUT9XX_GPIO_LED_LAN2, + .active_low = 1, + }, { + .name = "rut900:green:lan3", + .gpio = RUT9XX_GPIO_LED_LAN3, + .active_low = 1, + }, { + .name = "rut900:green:signal1", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL1, + .active_low = 0, + }, { + .name = "rut900:green:signal2", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL2, + .active_low = 0, + }, { + .name = "rut900:green:signal3", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL3, + .active_low = 0, + }, { + .name = "rut900:green:signal4", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL4, + .active_low = 0, + }, { + .name = "rut900:green:signal5", + .gpio = RUT9XX_PCA9539_GPIO_SIGNAL5, + .active_low = 0, + }, { + .name = "rut900:green:status", + .gpio = RUT9XX_PCA9539_GPIO_STATUS_G, + .active_low = 0, + }, { + .name = "rut900:green:wan", + .gpio = RUT9XX_GPIO_LED_WAN, + .active_low = 1, + }, { + .name = "rut900:red:status", + .gpio = RUT9XX_PCA9539_GPIO_STATUS_R, + .active_low = 0, + }, +}; + +static struct gpio_keys_button rut900_gpio_keys[] __initdata = { + { + .desc = "reset", + .type = EV_KEY, + .code = KEY_RESTART, + .debounce_interval = RUT9XX_KEYS_DEBOUNCE_INTERVAL, + .gpio = RUT9XX_GPIO_BTN_RESET, + .active_low = 1, + }, +}; + +static struct i2c_gpio_platform_data rut900_i2c_gpio_data = { + .sda_pin = RUT9XX_GPIO_I2C_SDA, + .scl_pin = RUT9XX_GPIO_I2C_SCK, + .udelay = 10, +}; + +static struct platform_device rut900_i2c_device = { + .name = "i2c-gpio", + .id = 0, + .dev = { + .platform_data = &rut900_i2c_gpio_data, + }, +}; + +static struct pca953x_platform_data rut9xx_pca9539_data = { + .gpio_base = RUT9XX_PCA9539_GPIO_BASE, + .irq_base = -1, +}; + +static struct i2c_board_info rut900_i2c_devs[] __initdata = { + { + I2C_BOARD_INFO("pca9539", 0x74), + .platform_data = &rut9xx_pca9539_data, + }, +}; + +static void __init rut900_setup(void) +{ + u8 *art = (u8 *) KSEG1ADDR(0x1f030000); + u8 *mac = (u8 *) KSEG1ADDR(0x1f020000); + u8 wlan_mac[ETH_ALEN]; + + ath79_register_m25p80(NULL); + + ath79_register_mdio(1, 0x0); + + ath79_switch_data.phy4_mii_en = 1; + ath79_switch_data.phy_poll_mask = 0xf1; + + /* LAN */ + ath79_eth1_data.duplex = DUPLEX_FULL; + ath79_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_GMII; + ath79_init_mac(ath79_eth1_data.mac_addr, mac, 0); + ath79_register_eth(1); + + /* WAN */ + ath79_eth0_data.duplex = DUPLEX_FULL; + ath79_eth0_data.mii_bus_dev = &ath79_mdio1_device.dev; + ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; + ath79_eth0_data.phy_mask = BIT(4); + ath79_eth0_data.speed = SPEED_100; + ath79_init_mac(ath79_eth0_data.mac_addr, mac, 1); + ath79_register_eth(0); + + platform_device_register(&rut900_i2c_device); + i2c_register_board_info(0, rut900_i2c_devs, + ARRAY_SIZE(rut900_i2c_devs)); + + /* Disable JTAG (enables GPIO0-3) */ + ath79_gpio_function_enable(AR934X_GPIO_FUNC_JTAG_DISABLE); + + ath79_register_leds_gpio(-1, ARRAY_SIZE(rut900_leds_gpio), + rut900_leds_gpio); + + ath79_register_gpio_keys_polled(-1, RUT9XX_KEYS_POLL_INTERVAL, + ARRAY_SIZE(rut900_gpio_keys), + rut900_gpio_keys); + + ath79_wmac_set_ext_lna_gpio(0, RUT9XX_GPIO_EXT_LNA0); + + ath79_init_mac(wlan_mac, mac, 2); + ath79_register_wmac(art + RUT9XX_WMAC_CALDATA_OFFSET, wlan_mac); + + ath79_register_usb(); +} + +MIPS_MACHINE(ATH79_MACH_RUT9XX, "RUT900", "Teltonika RUT900", rut900_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c deleted file mode 100755 index 8afdb4723..000000000 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr941n-v7.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * TP-LINK TL-WR941N v7 board support - * - * Copyright (C) 2012 Gabor Juhos - * Copyright (C) 2014 Weijie Gao - * - * 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 -#include -#include -#include -#include -#include -#include - -#include - -#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" - -#define WR941NV7_GPIO_LED_WLAN 12 -#define WR941NV7_GPIO_LED_SYSTEM 19 -#define WR941NV7_GPIO_LED_QSS 15 - -#define WR941NV7_GPIO_BTN_RESET 16 - -#define WR941NV7_KEYS_POLL_INTERVAL 20 /* msecs */ -#define WR941NV7_KEYS_DEBOUNCE_INTERVAL (3 * WR941NV7_KEYS_POLL_INTERVAL) - -#define ATH_MII_MGMT_CMD 0x24 -#define ATH_MGMT_CMD_READ 0x1 - -#define ATH_MII_MGMT_ADDRESS 0x28 -#define ATH_ADDR_SHIFT 8 - -#define ATH_MII_MGMT_CTRL 0x2c -#define ATH_MII_MGMT_STATUS 0x30 - -#define ATH_MII_MGMT_IND 0x34 -#define ATH_MGMT_IND_BUSY (1 << 0) -#define ATH_MGMT_IND_INVALID (1 << 2) - -static const char *wr941nv7_part_probes[] = { - "tp-link", - NULL, -}; - -static struct flash_platform_data wr941nv7_flash_data = { - .part_probes = wr941nv7_part_probes, -}; - -static struct gpio_led wr941nv7_leds_gpio[] __initdata = { - { - .name = "tp-link:green:qss", - .gpio = WR941NV7_GPIO_LED_QSS, - .active_low = 1, - }, - { - .name = "tp-link:green:system", - .gpio = WR941NV7_GPIO_LED_SYSTEM, - .active_low = 1, - }, - { - .name = "tp-link:green:wlan", - .gpio = WR941NV7_GPIO_LED_WLAN, - .active_low = 1, - }, -}; - -static struct gpio_keys_button wr941nv7_gpio_keys[] __initdata = { - { - .desc = "reset", - .type = EV_KEY, - .code = KEY_RESTART, - .debounce_interval = WR941NV7_KEYS_DEBOUNCE_INTERVAL, - .gpio = WR941NV7_GPIO_BTN_RESET, - .active_low = 1, - }, -}; - -static struct mdio_board_info wr941nv7_mdio0_info[] = { - { - .bus_id = "ag71xx-mdio.0", - .phy_addr = 0, - .platform_data = NULL, - }, -}; - -static unsigned long __init ath_gmac_reg_rd(unsigned long reg) -{ - void __iomem *base; - unsigned long t; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - t = __raw_readl(base + reg); - - iounmap(base); - - return t; -} - -static void __init ath_gmac_reg_wr(unsigned long reg, unsigned long value) -{ - void __iomem *base; - unsigned long t = value; - - base = ioremap(AR71XX_GE0_BASE, AR71XX_GE0_SIZE); - - __raw_writel(t, base + reg); - - iounmap(base); -} - -static void __init phy_reg_write(unsigned char phy_addr, unsigned char reg, unsigned short data) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg; - volatile int rddata; - unsigned short ii = 0xFFFF; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CTRL, data); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); -} - -static unsigned short __init phy_reg_read(unsigned char phy_addr, unsigned char reg) -{ - unsigned short addr = (phy_addr << ATH_ADDR_SHIFT) | reg, val; - volatile int rddata; - unsigned short ii = 0xffff; - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - ath_gmac_reg_wr(ATH_MII_MGMT_ADDRESS, addr); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, ATH_MGMT_CMD_READ); - - do - { - udelay(5); - rddata = ath_gmac_reg_rd(ATH_MII_MGMT_IND) & 0x1; - } while (rddata && --ii); - - val = ath_gmac_reg_rd(ATH_MII_MGMT_STATUS); - ath_gmac_reg_wr(ATH_MII_MGMT_CMD, 0x0); - - return val; -} - -static void __init athrs27_reg_write(unsigned int s27_addr, unsigned int s27_write_data) -{ - unsigned int addr_temp; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = (s27_addr) >> 2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - - reg_address = (((addr_temp << 1) & 0x1e) | 0x1); - data = (s27_write_data >> 16) & 0xffff; - phy_reg_write(phy_address, reg_address, data); - - reg_address = ((addr_temp << 1) & 0x1e); - data = s27_write_data & 0xffff; - phy_reg_write(phy_address, reg_address, data); -} - -static unsigned int __init athrs27_reg_read(unsigned int s27_addr) -{ - unsigned int addr_temp; - unsigned int s27_rd_csr_low, s27_rd_csr_high, s27_rd_csr; - unsigned int data; - unsigned char phy_address, reg_address; - - addr_temp = s27_addr >>2; - data = addr_temp >> 7; - - phy_address = 0x1f; - reg_address = 0x10; - - phy_reg_write(phy_address, reg_address, data); - - phy_address = (0x17 & ((addr_temp >> 4) | 0x10)); - reg_address = ((addr_temp << 1) & 0x1e); - s27_rd_csr_low = (unsigned int) phy_reg_read(phy_address, reg_address); - - reg_address = reg_address | 0x1; - s27_rd_csr_high = (unsigned int) phy_reg_read(phy_address, reg_address); - s27_rd_csr = (s27_rd_csr_high << 16) | s27_rd_csr_low ; - - return (s27_rd_csr); -} - -static void __init ar8236_reset(void) -{ - unsigned short i = 60; - - athrs27_reg_write(0x0, athrs27_reg_read(0x0) | 0x80000000); - while (i--) - { - mdelay(100); - if (!(athrs27_reg_read(0x0) & 0x80000000)) - break; - } -} - -static void __init wr941nv7_setup(void) -{ - u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00); - u8 *art = (u8 *) KSEG1ADDR(0x1fff1000); - - ath79_register_m25p80(&wr941nv7_flash_data); - ath79_register_leds_gpio(-1, ARRAY_SIZE(wr941nv7_leds_gpio), - wr941nv7_leds_gpio); - ath79_register_gpio_keys_polled(-1, WR941NV7_KEYS_POLL_INTERVAL, - ARRAY_SIZE(wr941nv7_gpio_keys), - wr941nv7_gpio_keys); - - ath79_register_wmac(art, mac); - - ar8236_reset(); - - ath79_setup_qca955x_eth_cfg(QCA955X_ETH_CFG_MII_GE0 | - QCA955X_ETH_CFG_MII_GE0_SLAVE); - - mdiobus_register_board_info(wr941nv7_mdio0_info, - ARRAY_SIZE(wr941nv7_mdio0_info)); - ath79_register_mdio(0, 0x0); - - ath79_init_mac(ath79_eth0_data.mac_addr, mac, 0); - - /* GMAC0 is connected to an AR8236 switch */ - ath79_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII; - ath79_eth0_data.speed = SPEED_100; - ath79_eth0_data.duplex = DUPLEX_FULL; - ath79_eth0_data.phy_mask = BIT(0); - ath79_eth0_data.mii_bus_dev = &ath79_mdio0_device.dev; - ath79_register_eth(0); - - ath79_register_usb(); -} - -MIPS_MACHINE(ATH79_MACH_TL_WR941N_V7, "TL-WR941N-v7", - "TP-LINK TL-WR941N v7", - wr941nv7_setup); diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c index 88022e753..2374c4539 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wlr8100.c @@ -49,11 +49,6 @@ #define WLR8100_KEYS_POLL_INTERVAL 20 /* msecs */ #define WLR8100_KEYS_DEBOUNCE_INTERVAL (3 * WLR8100_KEYS_POLL_INTERVAL) -#define WLR8100_MAC0_OFFSET 0 -#define WLR8100_MAC1_OFFSET 6 -#define WLR8100_WMAC_CALDATA_OFFSET 0x1000 -#define WLR8100_PCIE_CALDATA_OFFSET 0x5000 - static struct gpio_led wlr8100_leds_gpio[] __initdata = { { .name = "wlr8100:amber:status", @@ -138,7 +133,6 @@ static struct mdio_board_info wlr8100_mdio0_info[] = { static void __init wlr8100_common_setup(void) { - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); ath79_register_m25p80(NULL); @@ -150,14 +144,12 @@ static void __init wlr8100_common_setup(void) ath79_register_usb(); - ath79_register_wmac(art + WLR8100_WMAC_CALDATA_OFFSET, NULL); + 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 + WLR8100_MAC0_OFFSET, 0); - mdiobus_register_board_info(wlr8100_mdio0_info, ARRAY_SIZE(wlr8100_mdio0_info)); @@ -178,8 +170,6 @@ static void __init wlr8100_common_setup(void) static void __init wlr8100_010_setup(void) { - u8 *art = (u8 *) KSEG1ADDR(0x1fff0000); - /* GMAC0 of the AR8337 switch is connected to GMAC0 via RGMII */ wlr8100_ar8327_pad0_cfg.mode = AR8327_PAD_MAC_RGMII; wlr8100_ar8327_pad0_cfg.txclk_delay_en = true; @@ -196,7 +186,7 @@ static void __init wlr8100_010_setup(void) ath79_eth1_pll_data.pll_1000 = 0x03000101; wlr8100_common_setup(); - ap91_pci_init(art + WLR8100_PCIE_CALDATA_OFFSET, NULL); + ap91_pci_init_simple(); } MIPS_MACHINE(ATH79_MACH_WLR8100, "WLR8100", diff --git a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h index 0f536f0ec..a621fe2c9 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/machtypes.h @@ -41,6 +41,7 @@ enum ath79_mach_type { ATH79_MACH_AP152, /* Atheros AP152 reference board */ ATH79_MACH_AP531B0, /* Rockeetech AP531B0 */ ATH79_MACH_AP90Q, /* YunCore AP90Q */ + ATH79_MACH_AP91_5G, /* ALFA Network AP91-5G */ ATH79_MACH_AP96, /* Atheros AP96 */ ATH79_MACH_ARCHER_C25_V1, /* TP-LINK Archer C25 V1 board */ ATH79_MACH_ARCHER_C5, /* TP-LINK Archer C5 board */ @@ -113,6 +114,7 @@ enum ath79_mach_type { ATH79_MACH_GL_AR150, /* GL-AR150 support */ ATH79_MACH_GL_AR300, /* GL-AR300 */ ATH79_MACH_GL_AR300M, /* GL-AR300M */ + ATH79_MACH_GL_AR750, /* GL.iNet GL-AR750 */ ATH79_MACH_GL_DOMINO, /* Domino */ ATH79_MACH_GL_INET, /* GL-CONNECT GL-INET */ ATH79_MACH_GL_MIFI, /* GL-MIFI support */ @@ -142,6 +144,7 @@ enum ath79_mach_type { ATH79_MACH_MYNET_REXT, /* WD My Net Wi-Fi Range Extender */ ATH79_MACH_MZK_W04NU, /* Planex MZK-W04NU */ ATH79_MACH_MZK_W300NH, /* Planex MZK-W300NH */ + ATH79_MACH_N5Q, /* ALFA Network N5Q */ ATH79_MACH_NBG460N, /* Zyxel NBG460N/550N/550NH */ ATH79_MACH_NBG6616, /* Zyxel NBG6616 */ ATH79_MACH_NBG6716, /* Zyxel NBG6716 */ @@ -164,6 +167,7 @@ enum ath79_mach_type { ATH79_MACH_PB44, /* Atheros PB44 reference board */ ATH79_MACH_PQI_AIR_PEN, /* PQI Air Pen */ ATH79_MACH_QIHOO_C301, /* Qihoo 360 C301 */ + ATH79_MACH_R36A, /* ALFA Network R36A */ ATH79_MACH_R602N, /* P&W R602N */ ATH79_MACH_R6100, /* NETGEAR R6100 */ ATH79_MACH_RAMBUTAN, /* 8devices Rambutan */ @@ -197,9 +201,11 @@ enum ath79_mach_type { ATH79_MACH_RB_MAP, /* Mikrotik RouterBOARD mAP2nD */ ATH79_MACH_RB_MAPL, /* Mikrotik RouterBOARD mAP L-2nD */ ATH79_MACH_RB_WAP, /* Mikrotik RouterBOARD wAP2nD */ + ATH79_MACH_RB_WAPAC, /* Mikrotik RouterBOARD wAPG-5HacT2HnD */ ATH79_MACH_RB_SXTLITE2ND, /* Mikrotik RouterBOARD SXT Lite 2nD */ ATH79_MACH_RB_SXTLITE5ND, /* Mikrotik RouterBOARD SXT Lite 5nD */ ATH79_MACH_RE450, /* TP-LINK RE450 */ + ATH79_MACH_RUT9XX, /* Teltonika RUT900 series */ ATH79_MACH_RW2458N, /* Redwave RW2458N */ ATH79_MACH_SC1750, /* Abicom SC1750 */ ATH79_MACH_SC300M, /* Abicom SC300M */ diff --git a/target/linux/ar71xx/generic/config-default b/target/linux/ar71xx/generic/config-default index d5b59b594..cac1a27c3 100644 --- a/target/linux/ar71xx/generic/config-default +++ b/target/linux/ar71xx/generic/config-default @@ -25,6 +25,7 @@ CONFIG_ATH79_MACH_AP147=y CONFIG_ATH79_MACH_AP152=y CONFIG_ATH79_MACH_AP531B0=y CONFIG_ATH79_MACH_AP90Q=y +CONFIG_ATH79_MACH_AP91_5G=y CONFIG_ATH79_MACH_AP96=y CONFIG_ATH79_MACH_ARCHER_C25_V1=y CONFIG_ATH79_MACH_ARCHER_C58_V1=y @@ -84,6 +85,7 @@ CONFIG_ATH79_MACH_FRITZ300E=y CONFIG_ATH79_MACH_GL_AR150=y CONFIG_ATH79_MACH_GL_AR300=y CONFIG_ATH79_MACH_GL_AR300M=y +CONFIG_ATH79_MACH_GL_AR750=y CONFIG_ATH79_MACH_GL_DOMINO=y CONFIG_ATH79_MACH_GL_INET=y CONFIG_ATH79_MACH_GL_MIFI=y @@ -107,6 +109,7 @@ CONFIG_ATH79_MACH_MYNET_N750=y CONFIG_ATH79_MACH_MYNET_REXT=y CONFIG_ATH79_MACH_MZK_W04NU=y CONFIG_ATH79_MACH_MZK_W300NH=y +CONFIG_ATH79_MACH_N5Q=y CONFIG_ATH79_MACH_OM2P=y CONFIG_ATH79_MACH_OM5P=y CONFIG_ATH79_MACH_OM5P_AC=y @@ -118,8 +121,10 @@ CONFIG_ATH79_MACH_PB42=y CONFIG_ATH79_MACH_PB44=y CONFIG_ATH79_MACH_PQI_AIR_PEN=y CONFIG_ATH79_MACH_QIHOO_C301=y +CONFIG_ATH79_MACH_R36A=y CONFIG_ATH79_MACH_R602N=y CONFIG_ATH79_MACH_RE450=y +CONFIG_ATH79_MACH_RUT9XX=y CONFIG_ATH79_MACH_RW2458N=y CONFIG_ATH79_MACH_SC1750=y CONFIG_ATH79_MACH_SC300M=y @@ -181,6 +186,8 @@ CONFIG_ATH79_MACH_ZCN_1523H=y CONFIG_ATH79_NVRAM=y CONFIG_ATH79_PCI_ATH9K_FIXUP=y CONFIG_BLK_MQ_PCI=y +CONFIG_GPIO_PCA953X=y +# CONFIG_GPIO_PCA953X_IRQ is not set CONFIG_HW_HAS_PCI=y # CONFIG_LEDS_WNDR3700_USB is not set CONFIG_MYLOADER=y diff --git a/target/linux/ar71xx/image/generic-legacy-devices.mk b/target/linux/ar71xx/image/generic-legacy-devices.mk index 70e32748b..7692e802d 100644 --- a/target/linux/ar71xx/image/generic-legacy-devices.mk +++ b/target/linux/ar71xx/image/generic-legacy-devices.mk @@ -143,12 +143,6 @@ define LegacyDevice/TUBE2H16M endef LEGACY_DEVICES += TUBE2H16M -define LegacyDevice/WLR8100 - DEVICE_TITLE := Sitecom WLR-8100 - DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb3 -endef -LEGACY_DEVICES += WLR8100 - define LegacyDevice/F9K1115V2 DEVICE_TITLE := Belkin AC1750DB (F9K1115V2) DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb3 kmod-usb-ledtrig-usbport \ diff --git a/target/linux/ar71xx/image/generic.mk b/target/linux/ar71xx/image/generic.mk index 89ab1f029..88b9f930b 100644 --- a/target/linux/ar71xx/image/generic.mk +++ b/target/linux/ar71xx/image/generic.mk @@ -1,5 +1,21 @@ DEVICE_VARS += DAP_SIGNATURE NETGEAR_BOARD_ID NETGEAR_HW_ID NETGEAR_KERNEL_MAGIC ROOTFS_SIZE SEAMA_SIGNATURE +define Build/alfa-network-rootfs-header + mkimage \ + -A mips -O linux -T filesystem -C lzma -a 0 -e 0 \ + -n 'RootfsImage' -d $@ $@.new + @mv $@.new $@ +endef + +define Build/append-md5sum-bin + $(STAGING_DIR_HOST)/bin/mkhash md5 $@ | sed 's/../\\\\x&/g' |\ + xargs echo -ne >> $@ +endef + +define Build/append-string + echo -n $(1) >> $@ +endef + define Build/mkbuffaloimg $(STAGING_DIR_HOST)/bin/mkbuffaloimg -B $(BOARDNAME) \ -R $$(($(subst k, * 1024,$(ROOTFS_SIZE)))) \ @@ -61,6 +77,17 @@ define Build/seama-seal $(call Build/seama,-s $@.seama $(1)) endef +define Build/teltonika-fw-fake-checksum + # Teltonika U-Boot web based firmware upgrade/recovery routine compares + # 16 bytes from md5sum1[16] field in TP-Link v1 header (offset: 76 bytes + # from begin of the firmware file) with 16 bytes stored just before + # 0xdeadc0de marker. Values are only compared, MD5 sum is not verified. + let \ + offs="$$(stat -c%s $@) - 20"; \ + dd if=$@ bs=1 count=16 skip=76 |\ + dd of=$@ bs=1 count=16 seek=$$offs conv=notrunc +endef + define Build/uImageHiWiFi # Field ih_name needs to start with "tw150v1" mkimage -A $(LINUX_KARCH) \ @@ -105,6 +132,22 @@ define Device/ap90q endef TARGET_DEVICES += ap90q +define Device/ap91-5g + DEVICE_TITLE := ALFA Network AP91-5G + DEVICE_PACKAGES := rssileds -swconfig + BOARDNAME := AP91-5G + IMAGE_SIZE := 7744k + KERNEL_SIZE := 1600k + ROOTFS_SIZE := 6144k + MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),6144k(rootfs),1600k(kernel),64k(config)ro,64k(art)ro,7744k@0x50000(firmware) + IMAGES := sysupgrade.bin factory.bin + IMAGE/factory.bin := append-rootfs | pad-rootfs |\ + alfa-network-rootfs-header | append-kernel | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := append-rootfs | pad-rootfs |\ + pad-to $$$$(ROOTFS_SIZE) | append-kernel | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += ap91-5g + define Device/arduino-yun DEVICE_TITLE := Arduino Yun DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -287,6 +330,19 @@ define Device/gl-ar300m endef TARGET_DEVICES += gl-ar300m +define Device/gl-ar750 + DEVICE_TITLE := GL.iNet GL-AR750 + DEVICE_PACKAGES := kmod-ath10k ath10k-firmware-qca9887 kmod-usb-core \ + kmod-usb2 kmod-usb-storage + BOARDNAME := GL-AR750 + SUPPORTED_DEVICES := gl-ar750 + IMAGE_SIZE := 16000k + MTDPARTS := spi0.0:256k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += gl-ar750 + define Device/gl-domino DEVICE_TITLE := GL.iNet Domino Pi DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -588,6 +644,18 @@ define Device/jwap230 endef TARGET_DEVICES += jwap230 +define Device/r36a + DEVICE_TITLE := ALFA Network R36A + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport -swconfig + BOARDNAME := R36A + SUPPORTED_DEVICES := r36a + IMAGE_SIZE := 15872k + MTDPARTS := spi0.0:384k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += r36a + define Device/r602n DEVICE_TITLE := P&W R602N DEVICE_PACKAGES := kmod-usb-core kmod-usb2 @@ -597,6 +665,28 @@ define Device/r602n endef TARGET_DEVICES += r602n +define Device/rut900 + DEVICE_TITLE := Teltonika RUT900 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 -uboot-envtools + BOARDNAME := RUT900 + SUPPORTED_DEVICES := rut900 + IMAGE_SIZE := 15552k + MTDPARTS := spi0.0:128k(u-boot)ro,64k(config)ro,64k(art)ro,15552k(firmware),576k(event-log)ro + TPLINK_HWID := 0x35000001 + TPLINK_HWREV := 0x1 + TPLINK_HEADER_VERSION := 1 + KERNEL := kernel-bin | patch-cmdline | lzma | tplink-v1-header + KERNEL_INITRAMFS := kernel-bin | patch-cmdline | lzma | uImage lzma + IMAGES := sysupgrade.bin factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\ + pad-rootfs | teltonika-fw-fake-checksum | append-string master |\ + append-md5sum-bin | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\ + append-rootfs | pad-rootfs | append-metadata |\ + check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += rut900 + define Device/mc-mac1200r $(Device/tplink-8mlzma) DEVICE_TITLE := Mercury MAC1200R @@ -734,6 +824,18 @@ define Device/oolite endef TARGET_DEVICES += oolite +define Device/n5q + DEVICE_TITLE := ALFA Network N5Q + DEVICE_PACKAGES := rssileds -swconfig + BOARDNAME := N5Q + SUPPORTED_DEVICES := n5q + IMAGE_SIZE := 15872k + MTDPARTS := spi0.0:384k(u-boot)ro,64k(u-boot-env),64k(art)ro,-(firmware) + IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \ + append-rootfs | pad-rootfs | append-metadata | check-size $$$$(IMAGE_SIZE) +endef +TARGET_DEVICES += n5q + define Device/NBG6616 DEVICE_TITLE := ZyXEL NBG6616 DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-rtc-pcf8563 kmod-ath10k ath10k-firmware-qca988x @@ -891,6 +993,16 @@ define Device/bhr-4grv2 endef TARGET_DEVICES += bhr-4grv2 +define Device/wlr8100 + DEVICE_TITLE := Sitecom WLR-8100 + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport kmod-usb3 \ + kmod-ath10k ath10k-firmware-qca988x + BOARDNAME := WLR8100 + IMAGE_SIZE := 15424k + MTDPARTS := spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,15424k(firmware),256k(manufacture)ro,64k(backup)ro,320k(storage)ro,64k(art)ro +endef +TARGET_DEVICES += wlr8100 + define Device/wpj-16m DEVICE_PACKAGES := kmod-usb-core kmod-usb2 kmod-usb-ledtrig-usbport MTDPARTS := spi0.0:192k(u-boot)ro,16128k(firmware),64k(art)ro diff --git a/target/linux/ar71xx/image/legacy.mk b/target/linux/ar71xx/image/legacy.mk index 3c484713d..bd8ca2cef 100644 --- a/target/linux/ar71xx/image/legacy.mk +++ b/target/linux/ar71xx/image/legacy.mk @@ -263,7 +263,6 @@ dlrtdev_mtdlayout=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,6208k(firmware),64 dlrtdev_mtdlayout_fat=mtdparts=spi0.0:256k(uboot)ro,64k(config)ro,7168k(firmware),640k(certs),64k(caldata)ro,64k@0x660000(caldata_orig),6208k@0x50000(firmware_orig) planex_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),128k(art)ro whrhpg300n_mtdlayout=mtdparts=spi0.0:248k(u-boot)ro,8k(u-boot-env)ro,3712k(firmware),64k(art)ro -wlr8100_mtdlayout=mtdparts=spi0.0:192k(u-boot)ro,64k(u-boot-env)ro,1408k(kernel),14080k(rootfs),192k(unknown)ro,64k(art)ro,384k(unknown2)ro,15488k@0x40000(firmware) wndap360_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7744k(firmware),64k(nvram)ro,64k(art)ro wnr2200_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7808k(firmware),64k(art)ro wnr2000_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,3712k(firmware),64k(art)ro @@ -897,7 +896,6 @@ $(eval $(call SingleProfile,AthLzma,64k,CAP4200AG,cap4200ag,CAP4200AG,ttyS0,1152 $(eval $(call SingleProfile,AthLzma,64k,DB120,db120,DB120,ttyS0,115200,$$(db120_mtdlayout),RKuImage)) $(eval $(call SingleProfile,AthLzma,64k,HORNETUBx2,hornet-ub-x2,HORNET-UB,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536)) $(eval $(call SingleProfile,AthLzma,64k,TUBE2H16M,tube2h-16M,TUBE2H,ttyATH0,115200,$$(alfa_mtdlayout_16M),KRuImage,65536)) -$(eval $(call SingleProfile,AthLzma,64k,WLR8100,wlr8100,WLR8100,ttyS0,115200,$$(wlr8100_mtdlayout),KRuImage)) $(eval $(call SingleProfile,Belkin,64k,F9K1115V2,f9k1115v2,F9K1115V2,ttyS0,115200,$$(f9k1115v2_mtdlayout),BR-6679BAC)) diff --git a/target/linux/ar71xx/image/mikrotik.mk b/target/linux/ar71xx/image/mikrotik.mk index fd6ca2793..403bcb08b 100644 --- a/target/linux/ar71xx/image/mikrotik.mk +++ b/target/linux/ar71xx/image/mikrotik.mk @@ -50,5 +50,6 @@ define Device/rb-nor-flash-16M-ac $(Device/rb-nor-flash-16M) DEVICE_TITLE := MikroTik RouterBoard (16 MB SPI NOR, 802.11ac) DEVICE_PACKAGES += kmod-ath10k ath10k-firmware-qca988x ath10k-firmware-qca9887 + SUPPORTED_DEVICES := rb-wapg-5hact2hnd endef TARGET_DEVICES += rb-nor-flash-16M-ac diff --git a/target/linux/ar71xx/image/tiny-tp-link.mk b/target/linux/ar71xx/image/tiny-tp-link.mk index 6700ade52..092d8aa11 100644 --- a/target/linux/ar71xx/image/tiny-tp-link.mk +++ b/target/linux/ar71xx/image/tiny-tp-link.mk @@ -682,32 +682,3 @@ define Device/tl-wr941nd-v6-cn TPLINK_HWID := 0x09410006 endef TARGET_DEVICES += tl-wr941nd-v6-cn - -define Device/tl-wr941n-v7 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR941N/ND v7 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR941 - TPLINK_HWID := 0x09410007 -endef -TARGET_DEVICES += tl-wr941n-v7 - -define Device/tl-wr2041n-v1 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v1 - BOARDNAME := TL-WDR3500 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410001 -endef -TARGET_DEVICES += tl-wr2041n-v1 - -define Device/tl-wr2041n-v2 - $(Device/tplink-4mlzma) - DEVICE_TITLE := TP-LINK TL-WR2041N v2 - BOARDNAME := TL-WR941N-v7 - DEVICE_PROFILE := TLWR2041 - TPLINK_HWID := 0x20410002 -endef -TARGET_DEVICES += tl-wr2041n-v2 - - diff --git a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch index 1ad5fa68a..1d9d761d7 100644 --- a/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.4/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,29 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -22,11 +22,12 @@ + strstr(arcs_cmdline, "board=map-hb") || + strstr(arcs_cmdline, "board=map2-hb") || + strstr(arcs_cmdline, "board=wap-hb") || ++ strstr(arcs_cmdline, "board=wapg-sc") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || + strstr(arcs_cmdline, "board=922gs")) + ath79_prom_append_cmdline("console", "ttyS0,115200"); } - + void __init prom_free_prom_memory(void) diff --git a/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch new file mode 100644 index 000000000..3a6438ee8 --- /dev/null +++ b/target/linux/ar71xx/patches-4.4/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch @@ -0,0 +1,12 @@ +--- a/arch/mips/ath79/pci.c ++++ b/arch/mips/ath79/pci.c +@@ -324,7 +324,8 @@ int __init ath79_register_pci(void) + QCA953X_PCI_MEM_SIZE, + 0, + ATH79_IP2_IRQ(0)); +- } else if (soc_is_qca9558()) { ++ } else if (soc_is_qca9558() || ++ soc_is_qca9556()) { + pdev = ath79_register_pci_ar724x(0, + QCA955X_PCI_CFG_BASE0, + QCA955X_PCI_CTRL_BASE0, diff --git a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch index 1ad5fa68a..1d9d761d7 100644 --- a/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch +++ b/target/linux/ar71xx/patches-4.9/701-MIPS-ath79-add-routerboard-detection.patch @@ -1,6 +1,6 @@ --- a/arch/mips/ath79/prom.c +++ b/arch/mips/ath79/prom.c -@@ -136,6 +136,29 @@ void __init prom_init(void) +@@ -136,6 +136,30 @@ void __init prom_init(void) initrd_end = initrd_start + fw_getenvl("initrd_size"); } #endif @@ -22,11 +22,12 @@ + strstr(arcs_cmdline, "board=map-hb") || + strstr(arcs_cmdline, "board=map2-hb") || + strstr(arcs_cmdline, "board=wap-hb") || ++ strstr(arcs_cmdline, "board=wapg-sc") || + strstr(arcs_cmdline, "board=2011L") || + strstr(arcs_cmdline, "board=2011r") || + strstr(arcs_cmdline, "board=711Gr100") || + strstr(arcs_cmdline, "board=922gs")) + ath79_prom_append_cmdline("console", "ttyS0,115200"); } - + void __init prom_free_prom_memory(void) diff --git a/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch new file mode 100644 index 000000000..3a6438ee8 --- /dev/null +++ b/target/linux/ar71xx/patches-4.9/741-MIPS-ath79-add-PCI-for-QCA9556-SoC.patch @@ -0,0 +1,12 @@ +--- a/arch/mips/ath79/pci.c ++++ b/arch/mips/ath79/pci.c +@@ -324,7 +324,8 @@ int __init ath79_register_pci(void) + QCA953X_PCI_MEM_SIZE, + 0, + ATH79_IP2_IRQ(0)); +- } else if (soc_is_qca9558()) { ++ } else if (soc_is_qca9558() || ++ soc_is_qca9556()) { + pdev = ath79_register_pci_ar724x(0, + QCA955X_PCI_CFG_BASE0, + QCA955X_PCI_CTRL_BASE0, diff --git a/target/linux/armvirt/64/config-default b/target/linux/armvirt/64/config-default index c58863dc8..4e63668f5 100644 --- a/target/linux/armvirt/64/config-default +++ b/target/linux/armvirt/64/config-default @@ -38,8 +38,11 @@ CONFIG_ARM64_HW_AFDBM=y CONFIG_ARM64_MODULE_CMODEL_LARGE=y CONFIG_ARM64_PAGE_SHIFT=12 CONFIG_ARM64_PAN=y +# CONFIG_ARM64_PMEM is not set # CONFIG_ARM64_PTDUMP is not set +# CONFIG_ARM64_PTDUMP_DEBUGFS is not set # CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET is not set +# CONFIG_ARM64_SW_TTBR0_PAN is not set CONFIG_ARM64_UAO=y CONFIG_ARM64_VA_BITS=39 CONFIG_ARM64_VA_BITS_39=y @@ -71,15 +74,20 @@ CONFIG_CPU_IDLE=y CONFIG_CPU_IDLE_GOV_MENU=y CONFIG_CPU_PM=y CONFIG_CRYPTO_ABLK_HELPER=y +CONFIG_CRYPTO_AES_ARM64_BS=y CONFIG_CRYPTO_AES_ARM64_CE=y CONFIG_CRYPTO_AES_ARM64_CE_BLK=y CONFIG_CRYPTO_AES_ARM64_CE_CCM=y CONFIG_CRYPTO_AES_ARM64_NEON_BLK=y +CONFIG_CRYPTO_CHACHA20_NEON=y CONFIG_CRYPTO_CRC32_ARM64=y +CONFIG_CRYPTO_CRC32_ARM64_CE=y CONFIG_CRYPTO_CRYPTD=y +# CONFIG_CRYPTO_DEV_CAVIUM_ZIP is not set CONFIG_CRYPTO_GHASH_ARM64_CE=y CONFIG_CRYPTO_SHA1_ARM64_CE=y CONFIG_CRYPTO_SHA2_ARM64_CE=y +CONFIG_CRYPTO_SHA512_ARM64=y # CONFIG_DEBUG_ALIGN_RODATA is not set CONFIG_DEBUG_BUGVERBOSE=y CONFIG_DEBUG_RODATA=y @@ -126,6 +134,7 @@ CONFIG_MFD_SYSCON=y CONFIG_MFD_VEXPRESS_SYSREG=y CONFIG_MMC=y CONFIG_MMC_ARMMMCI=y +# CONFIG_MMC_CAVIUM_THUNDERX is not set # CONFIG_MMC_TIFM_SD is not set CONFIG_MODULES_USE_ELF_RELA=y # CONFIG_MTD_PHYSMAP_OF is not set @@ -133,11 +142,14 @@ CONFIG_NEED_SG_DMA_LENGTH=y CONFIG_NO_HZ=y CONFIG_NO_HZ_COMMON=y CONFIG_NO_HZ_IDLE=y +CONFIG_NR_CPUS=64 # CONFIG_NUMA is not set +# CONFIG_PCIE_KIRIN is not set CONFIG_PCI_BUS_ADDR_T_64BIT=y # CONFIG_PCI_HISI is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set # CONFIG_PCI_HOST_THUNDER_PEM is not set +# CONFIG_PCI_XGENE is not set CONFIG_PGTABLE_LEVELS=3 CONFIG_PHYS_ADDR_T_64BIT=y # CONFIG_PHY_XGENE is not set @@ -168,3 +180,4 @@ CONFIG_SYS_SUPPORTS_HUGETLBFS=y CONFIG_VEXPRESS_CONFIG=y CONFIG_VEXPRESS_SYSCFG=y CONFIG_VIDEOMODE_HELPERS=y +CONFIG_VMAP_STACK=y diff --git a/target/linux/armvirt/Makefile b/target/linux/armvirt/Makefile index 2cf382063..107f8607c 100644 --- a/target/linux/armvirt/Makefile +++ b/target/linux/armvirt/Makefile @@ -13,7 +13,7 @@ FEATURES+=cpiogz ext4 ramdisk squashfs targz MAINTAINER:=Florian Fainelli , \ Yousong Zhou -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/armvirt/config-4.14 b/target/linux/armvirt/config-4.14 new file mode 100644 index 000000000..64444d72f --- /dev/null +++ b/target/linux/armvirt/config-4.14 @@ -0,0 +1,180 @@ +CONFIG_9P_FS=y +# CONFIG_9P_FS_POSIX_ACL is not set +# CONFIG_9P_FS_SECURITY is not set +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y +CONFIG_ARCH_HAS_SG_CHAIN=y +CONFIG_ARCH_HAS_TICK_BROADCAST=y +CONFIG_ARCH_HIBERNATION_POSSIBLE=y +CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y +CONFIG_ARCH_SUSPEND_POSSIBLE=y +CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y +CONFIG_ARM_AMBA=y +CONFIG_ARM_ARCH_TIMER=y +CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y +CONFIG_ARM_GIC=y +CONFIG_ARM_GIC_V2M=y +CONFIG_ARM_GIC_V3=y +CONFIG_ARM_PSCI_FW=y +# CONFIG_ARM_SP805_WATCHDOG is not set +CONFIG_BLK_MQ_PCI=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_DCACHE_WORD_ACCESS=y +CONFIG_DTC=y +CONFIG_EDAC_SUPPORT=y +CONFIG_EXT4_FS=y +CONFIG_FIX_EARLYCON_MEM=y +CONFIG_FRAME_POINTER=y +CONFIG_FS_MBCACHE=y +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_BUG=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y +CONFIG_GENERIC_EARLY_IOREMAP=y +CONFIG_GENERIC_IDLE_POLL_SETUP=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_MIGRATION=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_IRQ_SHOW_LEVEL=y +CONFIG_GENERIC_MSI_IRQ=y +CONFIG_GENERIC_MSI_IRQ_DOMAIN=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_STRNCPY_FROM_USER=y +CONFIG_GENERIC_STRNLEN_USER=y +CONFIG_GPIOLIB=y +CONFIG_GPIOLIB_IRQCHIP=y +CONFIG_GPIO_PL061=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDIRQS_SW_RESEND=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +CONFIG_HAVE_ARCH_AUDITSYSCALL=y +CONFIG_HAVE_ARCH_BITREVERSE=y +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_PFN_VALID=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +CONFIG_HAVE_ARM_SMCCC=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_PERF_REGS=y +CONFIG_HAVE_PERF_USER_STACK_DUMP=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_UID16=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HOTPLUG_CPU=y +CONFIG_HVC_DRIVER=y +CONFIG_INITRAMFS_SOURCE="" +CONFIG_IOMMU_HELPER=y +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_WORK=y +CONFIG_JBD2=y +CONFIG_LIBFDT=y +CONFIG_LOCK_SPIN_ON_OWNER=y +CONFIG_MEMORY_BALLOON=y +CONFIG_MUTEX_SPIN_ON_OWNER=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_9P=y +# CONFIG_NET_9P_DEBUG is not set +CONFIG_NET_9P_VIRTIO=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NO_BOOTMEM=y +CONFIG_NR_CPUS=4 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_GPIO=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_OF_RESERVED_MEM=y +CONFIG_OLD_SIGSUSPEND3=y +CONFIG_PADATA=y +CONFIG_PARTITION_PERCPU=y +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DOMAINS_GENERIC=y +CONFIG_PCI_ECAM=y +CONFIG_PCI_HOST_COMMON=y +CONFIG_PCI_HOST_GENERIC=y +CONFIG_PCI_MSI=y +CONFIG_PCI_MSI_IRQ_DOMAIN=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_DRV_PL031=y +CONFIG_RWSEM_SPIN_ON_OWNER=y +CONFIG_RWSEM_XCHGADD_ALGORITHM=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SCSI_VIRTIO=y +CONFIG_SERIAL_8250_FSL=y +# CONFIG_SERIAL_AMBA_PL010 is not set +CONFIG_SERIAL_AMBA_PL011=y +CONFIG_SERIAL_AMBA_PL011_CONSOLE=y +CONFIG_SMP=y +CONFIG_SPARSE_IRQ=y +CONFIG_SRCU=y +CONFIG_SWIOTLB=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +CONFIG_VIRTIO=y +CONFIG_VIRTIO_BALLOON=y +CONFIG_VIRTIO_BLK=y +CONFIG_VIRTIO_CONSOLE=y +CONFIG_VIRTIO_MMIO=y +# CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES is not set +CONFIG_VIRTIO_NET=y +CONFIG_VIRTIO_PCI=y +CONFIG_VIRTIO_PCI_LEGACY=y +CONFIG_XPS=y diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk index d33a39865..b251d714d 100644 --- a/target/linux/at91/image/sama5.mk +++ b/target/linux/at91/image/sama5.mk @@ -20,16 +20,16 @@ define Build/at91-sdcard mcopy -i $@.boot $(BIN_DIR)/BOOT.bin ::BOOT.bin;) ./gen_at91_sdcard_img.sh \ - $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ + $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ $@.boot \ $(KDIR)/root.ext4 \ $(AT91_SD_BOOT_PARTSIZE) \ $(CONFIG_TARGET_ROOTFS_PARTSIZE) - gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img \ - > $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz + gzip -nc9 $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img \ + > $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz - $(CP) $(dir $@)$(IMG_PREFIX)-$(PROFILE_SANITIZED)-sdcard.img.gz \ + $(CP) $(dir $@)$(IMG_PREFIX)-$(DEVICE_NAME)-sdcard.img.gz \ $(BIN_DIR)/ rm -f $(BIN_DIR)/BOOT.bin diff --git a/target/linux/brcm2708/bcm2708/config-4.9 b/target/linux/brcm2708/bcm2708/config-4.9 index 0ab238c91..dccf85fac 100644 --- a/target/linux/brcm2708/bcm2708/config-4.9 +++ b/target/linux/brcm2708/bcm2708/config-4.9 @@ -312,7 +312,6 @@ CONFIG_PM_GENERIC_DOMAINS_SLEEP=y CONFIG_PM_SLEEP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/brcm2708/bcm2709/config-4.9 b/target/linux/brcm2708/bcm2709/config-4.9 index 5c0ab7ea7..71884a5fa 100644 --- a/target/linux/brcm2708/bcm2709/config-4.9 +++ b/target/linux/brcm2708/bcm2709/config-4.9 @@ -337,7 +337,6 @@ CONFIG_PM_SLEEP=y CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/brcm2708/bcm2710/config-4.9 b/target/linux/brcm2708/bcm2710/config-4.9 index af69f080b..d402f4b57 100644 --- a/target/linux/brcm2708/bcm2710/config-4.9 +++ b/target/linux/brcm2708/bcm2710/config-4.9 @@ -353,7 +353,6 @@ CONFIG_PM_SLEEP_SMP=y CONFIG_POWER_RESET=y CONFIG_POWER_SUPPLY=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_BCM2835=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch b/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch new file mode 100644 index 000000000..d698821f3 --- /dev/null +++ b/target/linux/generic/backport-4.14/041-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch @@ -0,0 +1,121 @@ +From bb2192123ec70470d6ea33f138846b175403a968 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Thu, 4 Jan 2018 08:05:33 +0100 +Subject: [PATCH] mtd: partitions: add of_match_table parser matching +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partition parsers can now provide an of_match_table to enable +flash<-->parser matching via device tree as documented in the +mtd/partition.txt. + +It works by looking for a matching parser for every string in the +"compatibility" property (starting with the most specific one). + +This support is currently limited to built-in parsers as it uses +request_module() and friends. This should be sufficient for most cases +though as compiling parsers as modules isn't a common choice. + +Signed-off-by: Brian Norris +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Signed-off-by: Boris Brezillon +--- + drivers/mtd/mtdpart.c | 59 ++++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 1 + + 2 files changed, 60 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "mtdcore.h" + +@@ -894,6 +895,45 @@ static int mtd_part_do_parse(struct mtd_ + } + + /** ++ * mtd_part_get_compatible_parser - find MTD parser by a compatible string ++ * ++ * @compat: compatible string describing partitions in a device tree ++ * ++ * MTD parsers can specify supported partitions by providing a table of ++ * compatibility strings. This function finds a parser that advertises support ++ * for a passed value of "compatible". ++ */ ++static struct mtd_part_parser *mtd_part_get_compatible_parser(const char *compat) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ list_for_each_entry(p, &part_parsers, list) { ++ const struct of_device_id *matches; ++ ++ matches = p->of_match_table; ++ if (!matches) ++ continue; ++ ++ for (; matches->compatible[0]; matches++) { ++ if (!strcmp(matches->compatible, compat) && ++ try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ if (ret) ++ break; ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++/** + * parse_mtd_partitions - parse MTD partitions + * @master: the master partition (describes whole MTD device) + * @types: names of partition parsers to try or %NULL +@@ -919,8 +959,27 @@ int parse_mtd_partitions(struct mtd_info + struct mtd_part_parser_data *data) + { + struct mtd_part_parser *parser; ++ struct device_node *np; ++ struct property *prop; ++ const char *compat; + int ret, err = 0; + ++ np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); ++ of_property_for_each_string(np, "compatible", prop, compat) { ++ parser = mtd_part_get_compatible_parser(compat); ++ if (!parser) ++ continue; ++ ret = mtd_part_do_parse(parser, master, pparts, data); ++ if (ret > 0) { ++ of_node_put(np); ++ return 0; ++ } ++ mtd_part_parser_put(parser); ++ if (ret < 0 && !err) ++ err = ret; ++ } ++ of_node_put(np); ++ + if (!types) + types = default_mtd_part_types; + +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -77,6 +77,7 @@ struct mtd_part_parser { + struct list_head list; + struct module *owner; + const char *name; ++ const struct of_device_id *of_match_table; + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); diff --git a/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch new file mode 100644 index 000000000..2092cc28f --- /dev/null +++ b/target/linux/generic/backport-4.14/041-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch @@ -0,0 +1,43 @@ +From 4ac9222778478a00c7fc9d347b7ed1e0e595120d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 4 Jan 2018 08:05:34 +0100 +Subject: [PATCH] mtd: ofpart: add of_match_table with "fixed-partitions" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows using this parser with any flash driver that takes care of +setting of_node (using mtd_set_of_node helper) correctly. Up to now +support for "fixed-partitions" DT compatibility string was working only +with flash drivers that were specifying "ofpart" (manually or by letting +mtd use the default set of parsers). + +This matches existing bindings documentation. + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Reviewed-by: Brian Norris +Tested-by: Brian Norris +Signed-off-by: Boris Brezillon +--- + drivers/mtd/ofpart.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -140,9 +140,16 @@ ofpart_none: + return ret; + } + ++static const struct of_device_id parse_ofpart_match_table[] = { ++ { .compatible = "fixed-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, parse_ofpart_match_table); ++ + static struct mtd_part_parser ofpart_parser = { + .parse_fn = parse_ofpart_partitions, + .name = "ofpart", ++ .of_match_table = parse_ofpart_match_table, + }; + + static int parse_ofoldpart_partitions(struct mtd_info *master, diff --git a/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch b/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch new file mode 100644 index 000000000..06931ce2a --- /dev/null +++ b/target/linux/generic/backport-4.9/066-v4.16-0001-mtd-partitions-add-of_match_table-parser-matching.patch @@ -0,0 +1,121 @@ +From bb2192123ec70470d6ea33f138846b175403a968 Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Thu, 4 Jan 2018 08:05:33 +0100 +Subject: [PATCH] mtd: partitions: add of_match_table parser matching +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Partition parsers can now provide an of_match_table to enable +flash<-->parser matching via device tree as documented in the +mtd/partition.txt. + +It works by looking for a matching parser for every string in the +"compatibility" property (starting with the most specific one). + +This support is currently limited to built-in parsers as it uses +request_module() and friends. This should be sufficient for most cases +though as compiling parsers as modules isn't a common choice. + +Signed-off-by: Brian Norris +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Signed-off-by: Boris Brezillon +--- + drivers/mtd/mtdpart.c | 59 ++++++++++++++++++++++++++++++++++++++++++ + include/linux/mtd/partitions.h | 1 + + 2 files changed, 60 insertions(+) + +--- a/drivers/mtd/mtdpart.c ++++ b/drivers/mtd/mtdpart.c +@@ -30,6 +30,7 @@ + #include + #include + #include ++#include + + #include "mtdcore.h" + +@@ -886,6 +887,45 @@ static int mtd_part_do_parse(struct mtd_ + } + + /** ++ * mtd_part_get_compatible_parser - find MTD parser by a compatible string ++ * ++ * @compat: compatible string describing partitions in a device tree ++ * ++ * MTD parsers can specify supported partitions by providing a table of ++ * compatibility strings. This function finds a parser that advertises support ++ * for a passed value of "compatible". ++ */ ++static struct mtd_part_parser *mtd_part_get_compatible_parser(const char *compat) ++{ ++ struct mtd_part_parser *p, *ret = NULL; ++ ++ spin_lock(&part_parser_lock); ++ ++ list_for_each_entry(p, &part_parsers, list) { ++ const struct of_device_id *matches; ++ ++ matches = p->of_match_table; ++ if (!matches) ++ continue; ++ ++ for (; matches->compatible[0]; matches++) { ++ if (!strcmp(matches->compatible, compat) && ++ try_module_get(p->owner)) { ++ ret = p; ++ break; ++ } ++ } ++ ++ if (ret) ++ break; ++ } ++ ++ spin_unlock(&part_parser_lock); ++ ++ return ret; ++} ++ ++/** + * parse_mtd_partitions - parse MTD partitions + * @master: the master partition (describes whole MTD device) + * @types: names of partition parsers to try or %NULL +@@ -911,8 +951,27 @@ int parse_mtd_partitions(struct mtd_info + struct mtd_part_parser_data *data) + { + struct mtd_part_parser *parser; ++ struct device_node *np; ++ struct property *prop; ++ const char *compat; + int ret, err = 0; + ++ np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); ++ of_property_for_each_string(np, "compatible", prop, compat) { ++ parser = mtd_part_get_compatible_parser(compat); ++ if (!parser) ++ continue; ++ ret = mtd_part_do_parse(parser, master, pparts, data); ++ if (ret > 0) { ++ of_node_put(np); ++ return 0; ++ } ++ mtd_part_parser_put(parser); ++ if (ret < 0 && !err) ++ err = ret; ++ } ++ of_node_put(np); ++ + if (!types) + types = default_mtd_part_types; + +--- a/include/linux/mtd/partitions.h ++++ b/include/linux/mtd/partitions.h +@@ -77,6 +77,7 @@ struct mtd_part_parser { + struct list_head list; + struct module *owner; + const char *name; ++ const struct of_device_id *of_match_table; + int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, + struct mtd_part_parser_data *); + void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); diff --git a/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch b/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch new file mode 100644 index 000000000..2092cc28f --- /dev/null +++ b/target/linux/generic/backport-4.9/066-v4.16-0002-mtd-ofpart-add-of_match_table-with-fixed-partitions.patch @@ -0,0 +1,43 @@ +From 4ac9222778478a00c7fc9d347b7ed1e0e595120d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= +Date: Thu, 4 Jan 2018 08:05:34 +0100 +Subject: [PATCH] mtd: ofpart: add of_match_table with "fixed-partitions" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This allows using this parser with any flash driver that takes care of +setting of_node (using mtd_set_of_node helper) correctly. Up to now +support for "fixed-partitions" DT compatibility string was working only +with flash drivers that were specifying "ofpart" (manually or by letting +mtd use the default set of parsers). + +This matches existing bindings documentation. + +Signed-off-by: RafaÅ‚ MiÅ‚ecki +Reviewed-by: Brian Norris +Tested-by: Brian Norris +Signed-off-by: Boris Brezillon +--- + drivers/mtd/ofpart.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/mtd/ofpart.c ++++ b/drivers/mtd/ofpart.c +@@ -140,9 +140,16 @@ ofpart_none: + return ret; + } + ++static const struct of_device_id parse_ofpart_match_table[] = { ++ { .compatible = "fixed-partitions" }, ++ {}, ++}; ++MODULE_DEVICE_TABLE(of, parse_ofpart_match_table); ++ + static struct mtd_part_parser ofpart_parser = { + .parse_fn = parse_ofpart_partitions, + .name = "ofpart", ++ .of_match_table = parse_ofpart_match_table, + }; + + static int parse_ofoldpart_partitions(struct mtd_info *master, diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18 index 4909fa0cd..7df43be97 100644 --- a/target/linux/generic/config-3.18 +++ b/target/linux/generic/config-3.18 @@ -1630,7 +1630,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y diff --git a/target/linux/generic/config-4.14 b/target/linux/generic/config-4.14 index f156cda85..fa389bf8c 100644 --- a/target/linux/generic/config-4.14 +++ b/target/linux/generic/config-4.14 @@ -146,8 +146,8 @@ CONFIG_ANON_INODES=y # CONFIG_APPLE_GMUX is not set # CONFIG_APPLE_PROPERTIES is not set # CONFIG_APPLICOM is not set -# CONFIG_AQUANTIA_PHY is not set # CONFIG_AQTION is not set +# CONFIG_AQUANTIA_PHY is not set # CONFIG_AR5523 is not set # CONFIG_AR7 is not set # CONFIG_AR8216_PHY is not set @@ -231,8 +231,8 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_PRIMA2 is not set # CONFIG_ARCH_PXA is not set # CONFIG_ARCH_QCOM is not set -# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_REALTEK is not set +# CONFIG_ARCH_REALVIEW is not set # CONFIG_ARCH_RENESAS is not set # CONFIG_ARCH_ROCKCHIP is not set # CONFIG_ARCH_RPC is not set @@ -272,14 +272,14 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set # CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set # CONFIG_ARM64_ERRATUM_827319 is not set -# CONFIG_ARM64_ERRATUM_824069 is not set -# CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_832075 is not set # CONFIG_ARM64_ERRATUM_834220 is not set -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_858921 is not set # CONFIG_ARM64_RELOC_TEST is not set # CONFIG_ARM_APPENDED_DTB is not set @@ -324,6 +324,7 @@ CONFIG_ARM_GIC_MAX_NR=1 # CONFIG_ARM_MODULE_PLTS is not set # CONFIG_ARM_PATCH_PHYS_VIRT is not set # CONFIG_ARM_PSCI is not set +# CONFIG_ARM_PSCI_CHECKER is not set # CONFIG_ARM_PTDUMP is not set # CONFIG_ARM_SBSA_WATCHDOG is not set # CONFIG_ARM_SCPI_PROTOCOL is not set @@ -993,6 +994,7 @@ CONFIG_CRYPTO_PCRYPT=y # CONFIG_DAX is not set # CONFIG_DCB is not set # CONFIG_DDR is not set +# CONFIG_DEBUG_ALIGN_RODATA is not set # CONFIG_DEBUG_ATOMIC_SLEEP is not set # CONFIG_DEBUG_BLOCK_EXT_DEVT is not set # CONFIG_DEBUG_BUGVERBOSE is not set @@ -1137,23 +1139,29 @@ CONFIG_DQL=y # CONFIG_DRM_AST is not set # CONFIG_DRM_BOCHS is not set # CONFIG_DRM_CIRRUS_QEMU is not set +# CONFIG_DRM_DEBUG_MM is not set +# CONFIG_DRM_DEBUG_MM_SELFTEST is not set # CONFIG_DRM_DP_AUX_CHARDEV is not set # CONFIG_DRM_DUMB_VGA_DAC is not set +# CONFIG_DRM_DW_HDMI_CEC is not set # CONFIG_DRM_ETNAVIV is not set # CONFIG_DRM_EXYNOS is not set # CONFIG_DRM_FBDEV_EMULATION is not set # CONFIG_DRM_FSL_DCU is not set # CONFIG_DRM_HDLCD is not set -# CONFIG_DRM_HISI_KIRIN is not set # CONFIG_DRM_HISI_HIBMC is not set +# CONFIG_DRM_HISI_KIRIN is not set # CONFIG_DRM_I2C_ADV7511 is not set # CONFIG_DRM_I2C_CH7006 is not set # CONFIG_DRM_I2C_NXP_TDA998X is not set # CONFIG_DRM_I2C_SIL164 is not set # CONFIG_DRM_LEGACY is not set # CONFIG_DRM_LOAD_EDID_FIRMWARE is not set +# CONFIG_DRM_LVDS_ENCODER is not set # CONFIG_DRM_MALI_DISPLAY is not set +# CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW is not set # CONFIG_DRM_MGAG200 is not set +# CONFIG_DRM_MXSFB is not set # CONFIG_DRM_NOUVEAU is not set # CONFIG_DRM_NXP_PTN3460 is not set # CONFIG_DRM_OMAP is not set @@ -1166,12 +1174,16 @@ CONFIG_DQL=y # CONFIG_DRM_PANEL_SHARP_LQ101R1SX01 is not set # CONFIG_DRM_PANEL_SHARP_LS043T1LE01 is not set # CONFIG_DRM_PARADE_PS8622 is not set +# CONFIG_DRM_PL111 is not set # CONFIG_DRM_QXL is not set # CONFIG_DRM_RADEON is not set +# CONFIG_DRM_RCAR_DW_HDMI is not set # CONFIG_DRM_SII902X is not set +# CONFIG_DRM_SIL_SII8620 is not set # CONFIG_DRM_STI is not set # CONFIG_DRM_TILCDC is not set # CONFIG_DRM_TINYDRM is not set +# CONFIG_DRM_TI_TFP410 is not set # CONFIG_DRM_TOSHIBA_TC358767 is not set # CONFIG_DRM_UDL is not set # CONFIG_DRM_VBOXVIDEO is not set @@ -1259,11 +1271,11 @@ CONFIG_EXT4_USE_FOR_EXT2=y # CONFIG_EXTCON_ADC_JACK is not set # CONFIG_EXTCON_GPIO is not set # CONFIG_EXTCON_INTEL_INT3496 is not set +# CONFIG_EXTCON_MAX3355 is not set # CONFIG_EXTCON_QCOM_SPMI_MISC is not set # CONFIG_EXTCON_RT8973A is not set # CONFIG_EXTCON_SM5502 is not set # CONFIG_EXTCON_USB_GPIO is not set -# CONFIG_EXTCON_MAX3355 is not set CONFIG_EXTRA_FIRMWARE="" CONFIG_EXTRA_TARGETS="" # CONFIG_EXYNOS_ADC is not set @@ -1637,11 +1649,12 @@ CONFIG_HIGH_RES_TIMERS=y # CONFIG_HINIC is not set # CONFIG_HIP04_ETH is not set # CONFIG_HIPPI is not set -# CONFIG_HISI_FEMAC is not set # CONFIG_HISILICON_ERRATUM_161010101 is not set +# CONFIG_HISI_FEMAC is not set # CONFIG_HIX5HD2_GMAC is not set # CONFIG_HMC6352 is not set # CONFIG_HNS is not set +# CONFIG_HNS3 is not set # CONFIG_HNS_DSAF is not set # CONFIG_HNS_ENET is not set # CONFIG_HOSTAP is not set @@ -1662,8 +1675,8 @@ CONFIG_HPET_MMAP_DEFAULT=y # CONFIG_HTC_EGPIO is not set # CONFIG_HTC_I2CPLD is not set # CONFIG_HTC_PASIC3 is not set -# CONFIG_HTU21 is not set # CONFIG_HTS221 is not set +# CONFIG_HTU21 is not set # CONFIG_HUGETLB_PAGE is not set # CONFIG_HVC_DCC is not set # CONFIG_HVC_UDBG is not set @@ -2032,7 +2045,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y @@ -2161,6 +2174,7 @@ CONFIG_KERNEL_MODE_NEON=y CONFIG_KERNEL_XZ=y CONFIG_KERNFS=y # CONFIG_KEXEC is not set +# CONFIG_KEXEC_FILE is not set # CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set @@ -2237,7 +2251,6 @@ CONFIG_LBDAF=y # CONFIG_LCD_VGG2432A4 is not set # CONFIG_LDM_PARTITION is not set CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y -# CONFIG_LED_TRIGGER_PHY is not set # CONFIG_LEDS_BCM6328 is not set # CONFIG_LEDS_BCM6358 is not set # CONFIG_LEDS_BD2802 is not set @@ -2289,6 +2302,7 @@ CONFIG_LEDS_TRIGGER_NETDEV=y CONFIG_LEDS_TRIGGER_TIMER=y # CONFIG_LEDS_TRIGGER_TRANSIENT is not set # CONFIG_LEDS_USER is not set +# CONFIG_LED_TRIGGER_PHY is not set # CONFIG_LEGACY_PTYS is not set # CONFIG_LGUEST is not set # CONFIG_LIB80211 is not set @@ -2410,11 +2424,11 @@ CONFIG_MAY_USE_DEVLINK=y # CONFIG_MCP4922 is not set # CONFIG_MCPM is not set # CONFIG_MD is not set -# CONFIG_MDIO_DEVICE is not set # CONFIG_MDIO_BCM_UNIMAC is not set # CONFIG_MDIO_BITBANG is not set # CONFIG_MDIO_BUS_MUX_GPIO is not set # CONFIG_MDIO_BUS_MUX_MMIOREG is not set +# CONFIG_MDIO_DEVICE is not set # CONFIG_MDIO_HISI_FEMAC is not set # CONFIG_MDIO_OCTEON is not set # CONFIG_MDIO_THUNDER is not set @@ -3385,6 +3399,7 @@ CONFIG_PARTITION_ADVANCED=y # CONFIG_PCI_DISABLE_COMMON_QUIRKS is not set # CONFIG_PCI_ENDPOINT is not set # CONFIG_PCI_ENDPOINT_TEST is not set +# CONFIG_PCI_FTPCI100 is not set # CONFIG_PCI_HERMES is not set # CONFIG_PCI_HOST_GENERIC is not set # CONFIG_PCI_HOST_THUNDER_ECAM is not set @@ -3521,6 +3536,7 @@ CONFIG_PREEMPT_NONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_PRINTK=y CONFIG_PRINTK_NMI=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 # CONFIG_PRINTK_TIME is not set CONFIG_PRINT_STACK_DEPTH=64 # CONFIG_PRISM2_USB is not set @@ -3986,8 +4002,8 @@ CONFIG_SELECT_MEMORY_MODEL=y # CONFIG_SENSORS_APDS990X is not set # CONFIG_SENSORS_APPLESMC is not set # CONFIG_SENSORS_ASB100 is not set -# CONFIG_SENSORS_ASPEED is not set # CONFIG_SENSORS_ASC7621 is not set +# CONFIG_SENSORS_ASPEED is not set # CONFIG_SENSORS_ATK0110 is not set # CONFIG_SENSORS_ATXP1 is not set # CONFIG_SENSORS_BH1770 is not set @@ -4422,8 +4438,8 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_CS42L56 is not set # CONFIG_SND_SOC_CS42L73 is not set # CONFIG_SND_SOC_CS42XX8_I2C is not set -# CONFIG_SND_SOC_CS4349 is not set # CONFIG_SND_SOC_CS43130 is not set +# CONFIG_SND_SOC_CS4349 is not set # CONFIG_SND_SOC_CS53L30 is not set # CONFIG_SND_SOC_DIO2125 is not set # CONFIG_SND_SOC_ES7134 is not set @@ -4448,13 +4464,13 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_CHT_DA7213_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_CHT_ES8316_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_CHT_NOCODEC_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set @@ -4570,8 +4586,8 @@ CONFIG_SND_X86=y # CONFIG_SOC_HAS_OMAP2_SDRC is not set # CONFIG_SOC_OMAP5 is not set # CONFIG_SOC_TI is not set -# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOFTLOCKUP_DETECTOR is not set +# CONFIG_SOFT_WATCHDOG is not set # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_SONYPI is not set # CONFIG_SONY_LAPTOP is not set @@ -4768,6 +4784,7 @@ CONFIG_TCP_CONG_CUBIC=y # CONFIG_TCP_MD5SIG is not set # CONFIG_TCS3414 is not set # CONFIG_TCS3472 is not set +# CONFIG_TEE is not set # CONFIG_TEGRA_AHB is not set # CONFIG_TEGRA_HOST1X is not set # CONFIG_TEHUTI is not set @@ -4809,11 +4826,11 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDERBOLT is not set # CONFIG_THUNDER_NIC_BGX is not set # CONFIG_THUNDER_NIC_PF is not set # CONFIG_THUNDER_NIC_RGX is not set # CONFIG_THUNDER_NIC_VF is not set -# CONFIG_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y # CONFIG_TIFM_CORE is not set diff --git a/target/linux/generic/config-4.4 b/target/linux/generic/config-4.4 index a343fa23b..050756933 100644 --- a/target/linux/generic/config-4.4 +++ b/target/linux/generic/config-4.4 @@ -208,14 +208,14 @@ CONFIG_ARCH_FLATMEM_ENABLE=y # CONFIG_ARCH_ZYNQ is not set # CONFIG_ARCNET is not set # CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set # CONFIG_ARM64_ERRATUM_827319 is not set -# CONFIG_ARM64_ERRATUM_824069 is not set -# CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_832075 is not set # CONFIG_ARM64_ERRATUM_834220 is not set -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM_APPENDED_DTB is not set # CONFIG_ARM_ARCH_TIMER is not set # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set @@ -1710,7 +1710,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y @@ -3860,9 +3860,9 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_IMX_ES8328 is not set # CONFIG_SND_SOC_IMX_SPDIF is not set # CONFIG_SND_SOC_IMX_WM8962 is not set +# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set # CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set -# CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set @@ -4854,5 +4854,3 @@ CONFIG_ZONE_DMA_FLAG=1 # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/config-4.9 b/target/linux/generic/config-4.9 index 15b64d794..4ebcfb636 100644 --- a/target/linux/generic/config-4.9 +++ b/target/linux/generic/config-4.9 @@ -260,14 +260,14 @@ CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 # CONFIG_ARCH_ZYNQMP is not set # CONFIG_ARCNET is not set # CONFIG_ARC_EMAC is not set +# CONFIG_ARM64_ERRATUM_819472 is not set +# CONFIG_ARM64_ERRATUM_824069 is not set # CONFIG_ARM64_ERRATUM_826319 is not set # CONFIG_ARM64_ERRATUM_827319 is not set -# CONFIG_ARM64_ERRATUM_824069 is not set -# CONFIG_ARM64_ERRATUM_819472 is not set # CONFIG_ARM64_ERRATUM_832075 is not set # CONFIG_ARM64_ERRATUM_834220 is not set -# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM64_ERRATUM_843419 is not set +# CONFIG_ARM64_ERRATUM_845719 is not set # CONFIG_ARM_APPENDED_DTB is not set # CONFIG_ARM_ARCH_TIMER is not set # CONFIG_ARM_BIG_LITTLE_CPUFREQ is not set @@ -1194,11 +1194,11 @@ CONFIG_EXT4_USE_FOR_EXT2=y # CONFIG_EXTCON is not set # CONFIG_EXTCON_ADC_JACK is not set # CONFIG_EXTCON_GPIO is not set +# CONFIG_EXTCON_MAX3355 is not set # CONFIG_EXTCON_QCOM_SPMI_MISC is not set # CONFIG_EXTCON_RT8973A is not set # CONFIG_EXTCON_SM5502 is not set # CONFIG_EXTCON_USB_GPIO is not set -# CONFIG_EXTCON_MAX3355 is not set CONFIG_EXTRA_FIRMWARE="" CONFIG_EXTRA_TARGETS="" # CONFIG_EXYNOS_ADC is not set @@ -1931,7 +1931,7 @@ CONFIG_IPW2200_MONITOR=y CONFIG_IP_ADVANCED_ROUTER=y # CONFIG_IP_DCCP is not set # CONFIG_IP_FIB_TRIE_STATS is not set -CONFIG_IP_MROUTE=y +# CONFIG_IP_MROUTE is not set CONFIG_IP_MROUTE_MULTIPLE_TABLES=y CONFIG_IP_MULTICAST=y CONFIG_IP_MULTIPLE_TABLES=y @@ -4226,10 +4226,10 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_INTEL_BDW_RT5677_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_DA7219_MAX98357A_MACH is not set # CONFIG_SND_SOC_INTEL_BXT_RT298_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set -# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYTCR_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_BYTCR_RT5651_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_MAX98090_MACH is not set +# CONFIG_SND_SOC_INTEL_BYT_RT5640_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_MAX98090_TI_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5645_MACH is not set # CONFIG_SND_SOC_INTEL_CHT_BSW_RT5672_MACH is not set @@ -4559,11 +4559,11 @@ CONFIG_TEXTSEARCH=y # CONFIG_THERMAL_WRITABLE_TRIPS is not set # CONFIG_THINKPAD_ACPI is not set # CONFIG_THRUSTMASTER_FF is not set +# CONFIG_THUNDERBOLT is not set # CONFIG_THUNDER_NIC_BGX is not set # CONFIG_THUNDER_NIC_PF is not set # CONFIG_THUNDER_NIC_RGX is not set # CONFIG_THUNDER_NIC_VF is not set -# CONFIG_THUNDERBOLT is not set # CONFIG_TICK_CPU_ACCOUNTING is not set CONFIG_TICK_ONESHOT=y # CONFIG_TIFM_CORE is not set @@ -5315,5 +5315,3 @@ CONFIG_ZONE_DMA=y # CONFIG_ZPOOL is not set # CONFIG_ZRAM is not set # CONFIG_ZSMALLOC is not set -# CONFIG_NF_CONNTRACK_CHAIN_EVENTS is not set -# CONFIG_SHORTCUT_FE is not set \ No newline at end of file diff --git a/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch index 2706f13dc..e57214ba0 100644 --- a/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch +++ b/target/linux/generic/pending-4.14/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -102,9 +102,9 @@ Signed-off-by: Hauke Mehrtens #include +#include #include + #include - #include "mtdcore.h" -@@ -863,6 +864,32 @@ void deregister_mtd_parser(struct mtd_pa +@@ -864,6 +865,32 @@ void deregister_mtd_parser(struct mtd_pa EXPORT_SYMBOL_GPL(deregister_mtd_parser); /* @@ -137,9 +137,9 @@ Signed-off-by: Hauke Mehrtens * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you * are changing this array! */ -@@ -920,6 +947,13 @@ int parse_mtd_partitions(struct mtd_info - { - struct mtd_part_parser *parser; +@@ -963,6 +990,13 @@ int parse_mtd_partitions(struct mtd_info + struct property *prop; + const char *compat; int ret, err = 0; + const char *const *types_of = NULL; + @@ -149,9 +149,9 @@ Signed-off-by: Hauke Mehrtens + types = types_of; + } - if (!types) - types = default_mtd_part_types; -@@ -945,6 +979,7 @@ int parse_mtd_partitions(struct mtd_info + np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); + of_property_for_each_string(np, "compatible", prop, compat) { +@@ -1004,6 +1038,7 @@ int parse_mtd_partitions(struct mtd_info if (ret < 0 && !err) err = ret; } diff --git a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch index f0c852a69..e722d8ca9 100644 --- a/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch +++ b/target/linux/generic/pending-4.14/400-mtd-add-rootfs-split-support.patch @@ -37,20 +37,21 @@ Signed-off-by: Felix Fietkau depends on m --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -29,10 +29,12 @@ +@@ -29,11 +29,13 @@ #include #include #include +#include #include #include + #include #include "mtdcore.h" +#include "mtdsplit/mtdsplit.h" /* Our partition linked list */ static LIST_HEAD(mtd_partitions); -@@ -52,6 +54,8 @@ struct mtd_part { +@@ -53,6 +55,8 @@ struct mtd_part { struct list_head list; }; @@ -59,7 +60,7 @@ Signed-off-by: Felix Fietkau /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve * the pointer to that structure. -@@ -686,6 +690,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -687,6 +691,7 @@ int mtd_add_partition(struct mtd_info *p mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&new->mtd); @@ -67,7 +68,7 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(new); -@@ -764,6 +769,35 @@ int mtd_del_partition(struct mtd_info *m +@@ -765,6 +770,35 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -103,7 +104,7 @@ Signed-off-by: Felix Fietkau /* * This function, given a master MTD object and a partition table, creates * and registers slave MTD objects which are bound to the master according to -@@ -795,6 +829,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -796,6 +830,7 @@ int add_mtd_partitions(struct mtd_info * mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&slave->mtd); @@ -113,7 +114,7 @@ Signed-off-by: Felix Fietkau mtd_parse_part(slave, parts[i].types); --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -109,5 +109,7 @@ int mtd_add_partition(struct mtd_info *m +@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); uint64_t mtd_get_device_size(const struct mtd_info *mtd); diff --git a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch index 77ee85a8c..7481225be 100644 --- a/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch +++ b/target/linux/generic/pending-4.14/401-mtd-add-support-for-different-partition-parser-types.patch @@ -9,7 +9,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1034,6 +1034,62 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1093,6 +1093,62 @@ void mtd_part_parser_cleanup(struct mtd_ } } @@ -90,7 +90,7 @@ Signed-off-by: Gabor Juhos struct mtd_part_parser { struct list_head list; struct module *owner; -@@ -80,6 +83,7 @@ struct mtd_part_parser { +@@ -81,6 +84,7 @@ struct mtd_part_parser { int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, struct mtd_part_parser_data *); void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); @@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos }; /* Container for passing around a set of parsed partitions */ -@@ -112,4 +116,9 @@ uint64_t mtd_get_device_size(const struc +@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc extern void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, int offset, int size); diff --git a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch index dff9c3166..26a19b82f 100644 --- a/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch +++ b/target/linux/generic/pending-4.14/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -769,6 +769,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -770,6 +770,36 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -777,6 +807,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); +@@ -778,6 +808,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); static void split_firmware(struct mtd_info *master, struct mtd_part *part) { @@ -55,7 +55,7 @@ Signed-off-by: Gabor Juhos } void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -@@ -791,6 +822,12 @@ static void mtd_partition_split(struct m +@@ -792,6 +823,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; diff --git a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch index 97bd7730c..a4fb15586 100644 --- a/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.14/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -799,6 +799,17 @@ run_parsers_by_type(struct mtd_part *sla +@@ -800,6 +800,17 @@ run_parsers_by_type(struct mtd_part *sla return nr_parts; } @@ -29,7 +29,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -1144,6 +1155,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1203,6 +1214,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); @@ -83,7 +83,7 @@ Signed-off-by: Gabor Juhos if (mtd->writesize_shift) --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -114,6 +114,8 @@ int mtd_is_partition(const struct mtd_in +@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in int mtd_add_partition(struct mtd_info *master, const char *name, long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); diff --git a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch index 096d6a4e7..9de5fd263 100644 --- a/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-4.14/411-mtd-partial_eraseblock_write.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -36,6 +36,8 @@ +@@ -37,6 +37,8 @@ #include "mtdcore.h" #include "mtdsplit/mtdsplit.h" @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -241,13 +243,61 @@ static int part_erase(struct mtd_info *m +@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m struct mtd_part *part = mtd_to_part(mtd); int ret; @@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau return ret; } -@@ -255,6 +305,25 @@ void mtd_erase_callback(struct erase_inf +@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf { if (instr->mtd->_erase == part_erase) { struct mtd_part *part = mtd_to_part(instr->mtd); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; -@@ -598,19 +667,22 @@ static struct mtd_part *allocate_partiti +@@ -599,19 +668,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ diff --git a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch index fd6ffc6fa..2ffff4ecf 100644 --- a/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch +++ b/target/linux/generic/pending-4.14/412-mtd-partial_eraseblock_unlock.patch @@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -343,7 +343,16 @@ static int part_lock(struct mtd_info *mt +@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { struct mtd_part *part = mtd_to_part(mtd); diff --git a/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch new file mode 100644 index 000000000..b7877297a --- /dev/null +++ b/target/linux/generic/pending-4.14/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -0,0 +1,37 @@ +From: Matthias Schiffer +Date: Tue, 9 Jan 2018 20:41:48 +0100 +Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with + Winbond)" + +This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e. + +The underlying issue breaking Spansion flash has been fixed with "mtd: spi-nor: +wait until lock/unlock operations are ready" and "mtd: spi-nor: wait for SR_WIP +to clear on initial unlock", so we can support unlocking for Winbond flash +again. + +Signed-off-by: Matthias Schiffer +--- + drivers/mtd/spi-nor/spi-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -2717,6 +2717,7 @@ int spi_nor_scan(struct spi_nor *nor, co + JEDEC_MFR(info) == SNOR_MFR_INTEL || + JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); + write_sr(nor, 0); +@@ -2735,7 +2736,8 @@ int spi_nor_scan(struct spi_nor *nor, co + + /* NOR protection support for STmicro/Micron chips and similar */ + if (JEDEC_MFR(info) == SNOR_MFR_MICRON || +- info->flags & SPI_NOR_HAS_LOCK) { ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || ++ info->flags & SPI_NOR_HAS_LOCK) { + nor->flash_lock = stm_lock; + nor->flash_unlock = stm_unlock; + nor->flash_is_locked = stm_is_locked; diff --git a/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch b/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch index 5e9ad8cf0..6c2e2602e 100644 --- a/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch +++ b/target/linux/generic/pending-4.9/160-mtd-part-add-generic-parsing-of-linux-part-probe.patch @@ -112,9 +112,9 @@ Signed-off-by: Hauke Mehrtens #include +#include #include + #include - #include "mtdcore.h" -@@ -855,6 +856,42 @@ void deregister_mtd_parser(struct mtd_pa +@@ -856,6 +857,42 @@ void deregister_mtd_parser(struct mtd_pa EXPORT_SYMBOL_GPL(deregister_mtd_parser); /* @@ -157,9 +157,9 @@ Signed-off-by: Hauke Mehrtens * Do not forget to update 'parse_mtd_partitions()' kerneldoc comment if you * are changing this array! */ -@@ -912,6 +949,13 @@ int parse_mtd_partitions(struct mtd_info - { - struct mtd_part_parser *parser; +@@ -955,6 +992,13 @@ int parse_mtd_partitions(struct mtd_info + struct property *prop; + const char *compat; int ret, err = 0; + const char *const *types_of = NULL; + @@ -169,9 +169,9 @@ Signed-off-by: Hauke Mehrtens + types = types_of; + } - if (!types) - types = default_mtd_part_types; -@@ -937,6 +981,7 @@ int parse_mtd_partitions(struct mtd_info + np = of_get_child_by_name(mtd_get_of_node(master), "partitions"); + of_property_for_each_string(np, "compatible", prop, compat) { +@@ -996,6 +1040,7 @@ int parse_mtd_partitions(struct mtd_info if (ret < 0 && !err) err = ret; } diff --git a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch index cf8a54ff5..ef7a6df3e 100644 --- a/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch +++ b/target/linux/generic/pending-4.9/400-mtd-add-rootfs-split-support.patch @@ -37,20 +37,21 @@ Signed-off-by: Felix Fietkau depends on m --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -29,10 +29,12 @@ +@@ -29,11 +29,13 @@ #include #include #include +#include #include #include + #include #include "mtdcore.h" +#include "mtdsplit/mtdsplit.h" /* Our partition linked list */ static LIST_HEAD(mtd_partitions); -@@ -52,6 +54,8 @@ struct mtd_part { +@@ -53,6 +55,8 @@ struct mtd_part { struct list_head list; }; @@ -59,7 +60,7 @@ Signed-off-by: Felix Fietkau /* * Given a pointer to the MTD object in the mtd_part structure, we can retrieve * the pointer to that structure. -@@ -678,6 +682,7 @@ int mtd_add_partition(struct mtd_info *p +@@ -679,6 +683,7 @@ int mtd_add_partition(struct mtd_info *p mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&new->mtd); @@ -67,7 +68,7 @@ Signed-off-by: Felix Fietkau mtd_add_partition_attrs(new); -@@ -756,6 +761,35 @@ int mtd_del_partition(struct mtd_info *m +@@ -757,6 +762,35 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -103,7 +104,7 @@ Signed-off-by: Felix Fietkau /* * This function, given a master MTD object and a partition table, creates * and registers slave MTD objects which are bound to the master according to -@@ -787,6 +821,7 @@ int add_mtd_partitions(struct mtd_info * +@@ -788,6 +822,7 @@ int add_mtd_partitions(struct mtd_info * mutex_unlock(&mtd_partitions_mutex); add_mtd_device(&slave->mtd); @@ -113,7 +114,7 @@ Signed-off-by: Felix Fietkau mtd_parse_part(slave, parts[i].types); --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -109,5 +109,7 @@ int mtd_add_partition(struct mtd_info *m +@@ -110,5 +110,7 @@ int mtd_add_partition(struct mtd_info *m long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); uint64_t mtd_get_device_size(const struct mtd_info *mtd); diff --git a/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch b/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch index c11245349..66c499d3e 100644 --- a/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch +++ b/target/linux/generic/pending-4.9/401-mtd-add-support-for-different-partition-parser-types.patch @@ -9,7 +9,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -1036,6 +1036,62 @@ void mtd_part_parser_cleanup(struct mtd_ +@@ -1095,6 +1095,62 @@ void mtd_part_parser_cleanup(struct mtd_ } } @@ -90,7 +90,7 @@ Signed-off-by: Gabor Juhos struct mtd_part_parser { struct list_head list; struct module *owner; -@@ -80,6 +83,7 @@ struct mtd_part_parser { +@@ -81,6 +84,7 @@ struct mtd_part_parser { int (*parse_fn)(struct mtd_info *, const struct mtd_partition **, struct mtd_part_parser_data *); void (*cleanup)(const struct mtd_partition *pparts, int nr_parts); @@ -98,7 +98,7 @@ Signed-off-by: Gabor Juhos }; /* Container for passing around a set of parsed partitions */ -@@ -112,4 +116,9 @@ uint64_t mtd_get_device_size(const struc +@@ -113,4 +117,9 @@ uint64_t mtd_get_device_size(const struc extern void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, int offset, int size); diff --git a/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch b/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch index b78ff526f..9b406d468 100644 --- a/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch +++ b/target/linux/generic/pending-4.9/402-mtd-use-typed-mtd-parsers-for-rootfs-and-firmware-split.patch @@ -10,7 +10,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -761,6 +761,36 @@ int mtd_del_partition(struct mtd_info *m +@@ -762,6 +762,36 @@ int mtd_del_partition(struct mtd_info *m } EXPORT_SYMBOL_GPL(mtd_del_partition); @@ -47,7 +47,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -769,6 +799,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); +@@ -770,6 +800,7 @@ EXPORT_SYMBOL_GPL(mtd_del_partition); static void split_firmware(struct mtd_info *master, struct mtd_part *part) { @@ -55,7 +55,7 @@ Signed-off-by: Gabor Juhos } void __weak arch_split_mtd_part(struct mtd_info *master, const char *name, -@@ -783,6 +814,12 @@ static void mtd_partition_split(struct m +@@ -784,6 +815,12 @@ static void mtd_partition_split(struct m if (rootfs_found) return; diff --git a/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch b/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch index 8e9604fb7..0ec5540d0 100644 --- a/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch +++ b/target/linux/generic/pending-4.9/404-mtd-add-more-helper-functions.patch @@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -791,6 +791,17 @@ run_parsers_by_type(struct mtd_part *sla +@@ -792,6 +792,17 @@ run_parsers_by_type(struct mtd_part *sla return nr_parts; } @@ -29,7 +29,7 @@ Signed-off-by: Gabor Juhos #ifdef CONFIG_MTD_SPLIT_FIRMWARE_NAME #define SPLIT_FIRMWARE_NAME CONFIG_MTD_SPLIT_FIRMWARE_NAME #else -@@ -1146,6 +1157,24 @@ int mtd_is_partition(const struct mtd_in +@@ -1205,6 +1216,24 @@ int mtd_is_partition(const struct mtd_in } EXPORT_SYMBOL_GPL(mtd_is_partition); @@ -83,7 +83,7 @@ Signed-off-by: Gabor Juhos if (mtd->writesize_shift) --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h -@@ -114,6 +114,8 @@ int mtd_is_partition(const struct mtd_in +@@ -115,6 +115,8 @@ int mtd_is_partition(const struct mtd_in int mtd_add_partition(struct mtd_info *master, const char *name, long long offset, long long length); int mtd_del_partition(struct mtd_info *master, int partno); diff --git a/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch b/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch index 6c03a2984..9a585214e 100644 --- a/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch +++ b/target/linux/generic/pending-4.9/411-mtd-partial_eraseblock_write.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -36,6 +36,8 @@ +@@ -37,6 +37,8 @@ #include "mtdcore.h" #include "mtdsplit/mtdsplit.h" @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau /* Our partition linked list */ static LIST_HEAD(mtd_partitions); static DEFINE_MUTEX(mtd_partitions_mutex); -@@ -241,13 +243,61 @@ static int part_erase(struct mtd_info *m +@@ -242,13 +244,61 @@ static int part_erase(struct mtd_info *m struct mtd_part *part = mtd_to_part(mtd); int ret; @@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau return ret; } -@@ -255,6 +305,25 @@ void mtd_erase_callback(struct erase_inf +@@ -256,6 +306,25 @@ void mtd_erase_callback(struct erase_inf { if (instr->mtd->_erase == part_erase) { struct mtd_part *part = mtd_to_part(instr->mtd); @@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau if (instr->fail_addr != MTD_FAIL_ADDR_UNKNOWN) instr->fail_addr -= part->offset; -@@ -590,19 +659,22 @@ static struct mtd_part *allocate_partiti +@@ -591,19 +660,22 @@ static struct mtd_part *allocate_partiti remainder = do_div(tmp, wr_alignment); if ((slave->mtd.flags & MTD_WRITEABLE) && remainder) { /* Doesn't start on a boundary of major erase size */ diff --git a/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch b/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch index fd6ffc6fa..2ffff4ecf 100644 --- a/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch +++ b/target/linux/generic/pending-4.9/412-mtd-partial_eraseblock_unlock.patch @@ -20,7 +20,7 @@ Signed-off-by: Tim Harvey --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c -@@ -343,7 +343,16 @@ static int part_lock(struct mtd_info *mt +@@ -344,7 +344,16 @@ static int part_lock(struct mtd_info *mt static int part_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) { struct mtd_part *part = mtd_to_part(mtd); diff --git a/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch new file mode 100644 index 000000000..e032b08f4 --- /dev/null +++ b/target/linux/generic/pending-4.9/466-Revert-mtd-spi-nor-fix-Spansion-regressions-aliased-.patch @@ -0,0 +1,37 @@ +From: Matthias Schiffer +Date: Tue, 9 Jan 2018 20:41:48 +0100 +Subject: [PATCH] Revert "mtd: spi-nor: fix Spansion regressions (aliased with + Winbond)" + +This reverts commit 67b9bcd36906e12a15ffec19463afbbd6a41660e. + +The underlying issue breaking Spansion flash has been fixed with "mtd: spi-nor: +wait until lock/unlock operations are ready" and "mtd: spi-nor: wait for SR_WIP +to clear on initial unlock", so we can support unlocking for Winbond flash +again. + +Signed-off-by: Matthias Schiffer +--- + drivers/mtd/spi-nor/spi-nor.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/mtd/spi-nor/spi-nor.c ++++ b/drivers/mtd/spi-nor/spi-nor.c +@@ -1597,6 +1597,7 @@ int spi_nor_scan(struct spi_nor *nor, co + JEDEC_MFR(info) == SNOR_MFR_INTEL || + JEDEC_MFR(info) == SNOR_MFR_MACRONIX || + JEDEC_MFR(info) == SNOR_MFR_SST || ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || + info->flags & SPI_NOR_HAS_LOCK) { + write_enable(nor); + write_sr(nor, 0); +@@ -1615,7 +1616,8 @@ int spi_nor_scan(struct spi_nor *nor, co + + /* NOR protection support for STmicro/Micron chips and similar */ + if (JEDEC_MFR(info) == SNOR_MFR_MICRON || +- info->flags & SPI_NOR_HAS_LOCK) { ++ JEDEC_MFR(info) == SNOR_MFR_WINBOND || ++ info->flags & SPI_NOR_HAS_LOCK) { + nor->flash_lock = stm_lock; + nor->flash_unlock = stm_unlock; + nor->flash_is_locked = stm_is_locked; diff --git a/target/linux/kirkwood/base-files/etc/board.d/01_leds b/target/linux/kirkwood/base-files/etc/board.d/01_leds index 0d8975918..4e72e344a 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/01_leds +++ b/target/linux/kirkwood/base-files/etc/board.d/01_leds @@ -10,51 +10,42 @@ board_config_update board=$(board_name) case "$board" in -"dockstar") - ucidef_set_led_default "health" "health" "status:green:health" "1" - ucidef_set_led_default "fault" "fault" "status:orange:fault" "1" - ;; -"linksys-audi") - ucidef_set_led_default "power" "power" "audi:green:power" "1" - ;; -"linksys-viper") - ucidef_set_led_default "health" "health" "viper:white:health" "1" - ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" - ;; -"goflexhome" | \ -"goflexnet") - ucidef_set_led_default "health" "health" "status:green:health" "1" - ucidef_set_led_default "fault" "fault" "status:orange:fault" "0" - ;; -"ib62x0") - ucidef_set_led_default "health" "health" "ib62x0:green:os" "1" - ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1" - ;; -"pogo_e02") +"cloudengines,pogoe02") ucidef_set_led_default "health" "health" "pogo_e02:green:health" "1" ucidef_set_led_default "fault" "fault" "pogo_e02:orange:fault" "1" ;; -"guruplug-server-plus") - ucidef_set_led_timer "health" "health" "guruplug:red:health" "200" "800" +"linksys,audi") + ucidef_set_led_default "power" "power" "audi:green:power" "1" ;; -"nsa310b") +"linksys,viper") + ucidef_set_led_default "health" "health" "viper:white:health" "1" + ucidef_set_led_default "pulse" "pulse" "viper:white:pulse" "1" + ;; +"raidsonic,ib-nas62x0") + ucidef_set_led_default "health" "health" "ib62x0:green:os" "1" + ucidef_set_led_default "fault" "fault" "ib62x0:red:os" "1" + ;; +"seagate,dockstar") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "1" + ;; +"seagate,goflexhome"|\ +"seagate,goflexnet") + ucidef_set_led_default "health" "health" "status:green:health" "1" + ucidef_set_led_default "fault" "fault" "status:orange:fault" "0" + ;; +"zyxel,nsa310b") ucidef_set_led_default "health" "health" "nsa310:green:sys" "1" ucidef_set_led_usbhost "usb" "USB" "nsa310:green:usb" ucidef_set_led_ataport "hdd" "HDD" "nsa310:green:hdd" "1" ucidef_set_led_ataport "esata" "eSata" "nsa310:green:esata" "2" ;; -"nsa325") +"zyxel,nsa325") ucidef_set_led_default "health" "health" "nsa325:green:sys" "1" ucidef_set_led_usbhost "usb" "USB" "nsa325:green:usb" ucidef_set_led_ataport "hdd1" "HDD1" "nsa325:green:sata1" "1" ucidef_set_led_ataport "hdd2" "HDD2" "nsa325:green:sata2" "2" ;; -"sheevaplug" | \ -"sheevaplug-esata") - ucidef_set_led_timer "health" "health" "sheevaplug:blue:health" "200" "800" - ;; -*) - ;; esac board_config_flush diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network index 85049d296..5d66e0ffe 100755 --- a/target/linux/kirkwood/base-files/etc/board.d/02_network +++ b/target/linux/kirkwood/base-files/etc/board.d/02_network @@ -11,32 +11,28 @@ board_config_update board=$(board_name) case "$board" in -"dockstar"|\ -"goflexhome"|\ -"goflexnet"|\ -"ib62x0"|\ -"iconnect"|\ -"nsa310s"|\ -"pogo_e02"|\ -"sheevaplug"|\ -"sheevaplug-esata") +"cisco,on100") + ucidef_set_interface_lan "eth0 eth1" + ;; +"cloudengines,pogoe02"|\ +"cloudengines,pogoplugv4"|\ +"iom,iconnect-1.1"|\ +"raidsonic,ib-nas62x0"|\ +"seagate,dockstar"|\ +"seagate,goflexhome"|\ +"seagate,goflexnet") ucidef_set_interface_lan "eth0" "dhcp" ;; -"guruplug-server-plus") - ucidef_set_interface_lan "eth0 eth1" "dhcp" - ;; -"linksys-audi"|\ -"linksys-viper") +"linksys,audi"|\ +"linksys,viper") ucidef_add_switch "switch0" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1" ;; -"nsa310b"|"nsa325") +"zyxel,nsa310b"|\ +"zyxel,nsa325") ucidef_set_interface_lan "eth0" "dhcp" ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr ) ;; -"on100") - ucidef_set_interface_lan "eth0 eth1" - ;; *) ucidef_set_interface_lan "eth0" ;; diff --git a/target/linux/kirkwood/base-files/etc/diag.sh b/target/linux/kirkwood/base-files/etc/diag.sh index 71a1639c2..0667ad29f 100755 --- a/target/linux/kirkwood/base-files/etc/diag.sh +++ b/target/linux/kirkwood/base-files/etc/diag.sh @@ -6,25 +6,28 @@ get_status_led() { case $(board_name) in - dockstar|\ - goflexhome|\ - goflexnet) - status_led="status:orange:fault" + cisco,on100) + status_led="on100:green:health" ;; - pogo_e02) + cloudengines,pogoe02) status_led="pogo_e02:orange:fault" ;; - linksys-audi) + cloudengines,pogoplugv4) + status_led="pogoplugv4:green:health" + ;; + linksys,audi) status_led="audi:green:power" ;; - linksys-viper) + linksys,viper) status_led="viper:white:health" ;; - nsa310b) - status_led="nsa310:green:sys" + seagate,dockstar|\ + seagate,goflexhome|\ + seagate,goflexnet) + status_led="status:orange:fault" ;; - on100) - status_led="on100:green:health" + zyxel,nsa310b) + status_led="nsa310:green:sys" ;; esac } diff --git a/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery b/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery index ba7e4bb39..8fd2f387a 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery +++ b/target/linux/kirkwood/base-files/etc/init.d/linksys_recovery @@ -6,7 +6,7 @@ boot() { . /lib/functions.sh case $(board_name) in - linksys-audi|linksys-viper) + linksys,audi|linksys,viper) # make sure auto_recovery in uboot is always on AUTO_RECOVERY_ENA="`fw_printenv -n auto_recovery`" if [ "$AUTO_RECOVERY_ENA" != "yes" ] ; then diff --git a/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol b/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol index 4073c2d55..10eb5aa73 100755 --- a/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol +++ b/target/linux/kirkwood/base-files/etc/init.d/nsa310_fancontrol @@ -10,7 +10,7 @@ boot() { path_to_hwmon='/sys/devices/platform/ocp@f1000000/f1011000.i2c/i2c-0/0-002e/hwmon/hwmon0' case $(board_name) in - nsa310b) + zyxel,nsa310b) echo 2 > "$path_to_hwmon/pwm1_enable" # fan is on pwm1 echo 1 > "$path_to_hwmon/pwm1_auto_channels" # temp1 is the only one that changes echo 23000 > "$path_to_hwmon/temp1_auto_temp_min" diff --git a/target/linux/kirkwood/base-files/lib/kirkwood.sh b/target/linux/kirkwood/base-files/lib/kirkwood.sh deleted file mode 100755 index f1229fa97..000000000 --- a/target/linux/kirkwood/base-files/lib/kirkwood.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2014 OpenWrt.org -# - -KIRKWOOD_BOARD_NAME= -KIRKWOOD_MODEL= - -kirkwood_board_detect() { - local machine - local name - - machine=$(cat /proc/device-tree/model) - - case "$machine" in - "Seagate FreeAgent Dockstar") - name="dockstar" - ;; - - "Seagate GoFlex Home") - name="goflexhome" - ;; - - "Seagate GoFlex Net") - name="goflexnet" - ;; - - "Iomega Iconnect") - name="iconnect" - ;; - - "RaidSonic ICY BOX IB-NAS62x0 (Rev B)") - name="ib62x0" - ;; - - "Cisco Systems ON100") - name="on100" - ;; - - "Cloud Engines Pogoplug E02") - name="pogo_e02" - ;; - - "Linksys Audi (EA3500)") - name="linksys-audi" - ;; - - "Linksys Viper (E4200v2 / EA4500)") - name="linksys-viper" - ;; - - "Globalscale Technologies Guruplug Server Plus") - name="guruplug-server-plus" - ;; - - "Globalscale Technologies SheevaPlug") - name="sheevaplug" - ;; - - "Globalscale Technologies eSATA SheevaPlug") - name="sheevaplug-esata" - ;; - - "ZyXEL NSA310b") - name="nsa310b" - ;; - - "ZyXEL NSA310S") - name="nsa310s" - ;; - - "ZyXEL NSA325") - name="nsa325" - ;; - - *) - name="generic" - ;; - esac - - [ -z "$KIRKWOOD_BOARD_NAME" ] && KIRKWOOD_BOARD_NAME="$name" - [ -z "$KIRKWOOD_MODEL" ] && KIRKWOOD_MODEL="$machine" - - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/" - - echo "$KIRKWOOD_BOARD_NAME" > /tmp/sysinfo/board_name - echo "$KIRKWOOD_MODEL" > /tmp/sysinfo/model -} diff --git a/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo b/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo deleted file mode 100644 index d45fc92ec..000000000 --- a/target/linux/kirkwood/base-files/lib/preinit/01_sysinfo +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -do_sysinfo_kirkwood() { - . /lib/kirkwood.sh - - kirkwood_board_detect -} - -boot_hook_add preinit_main do_sysinfo_kirkwood diff --git a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh index b28ee873b..27012bd21 100644 --- a/target/linux/kirkwood/base-files/lib/upgrade/platform.sh +++ b/target/linux/kirkwood/base-files/lib/upgrade/platform.sh @@ -1,27 +1,9 @@ RAMFS_COPY_BIN='fw_printenv fw_setenv' RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock' +REQUIRE_IMAGE_METADATA=1 + platform_check_image() { - [ "$#" -gt 1 ] && return 1 - local board="$(board_name)" - local magic="$(get_magic_long "$1")" - - case "$board" in - "linksys-audi"|\ - "linksys-viper") - [ "$magic" != "27051956" -a "$magic" != "73797375" ] && { - echo "Invalid image type." - return 1 - } - return 0 - ;; - *) - nand_do_platform_check $board $1 - return $? - ;; - esac - - echo "Sysupgrade is not yet supported on $board." return 1 } @@ -29,8 +11,8 @@ platform_do_upgrade() { local board="$(board_name)" case "$board" in - "linksys-audi"|\ - "linksys-viper") + "linksys,audi"|\ + "linksys,viper") platform_do_upgrade_linksys "$ARGV" ;; *) diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index 77ef89679..39d93275f 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -5,126 +5,135 @@ # See /LICENSE for more information. # -NAND_BLOCKSIZE := 2048-128k - include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/image.mk KERNEL_LOADADDR:=0x8000 -UBI_OPTS := -m 2048 -p 128KiB -s 512 -UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 - define Device/Default PROFILES := Default KERNEL_DEPENDS = $$(wildcard $(DTS_DIR)/$$(DEVICE_DTS).dts) KERNEL := kernel-bin | append-dtb | uImage none KERNEL_NAME := zImage KERNEL_SUFFIX := -uImage - KERNEL_INSTALL := 1 + KERNEL_IN_UBI := 1 PAGESIZE := 2048 SUBPAGESIZE := 512 BLOCKSIZE := 128k - IMAGES := sysupgrade.tar - IMAGE/sysupgrade.tar := sysupgrade-tar -endef - -define Device/dockstar - DEVICE_DTS := kirkwood-dockstar - FILESYSTEMS := squashfs - DEVICE_TITLE := Seagate FreeAgent Dockstar - IMAGES += factory.bin + IMAGES := sysupgrade.bin factory.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata IMAGE/factory.bin := append-ubi - KERNEL_IN_UBI := 1 + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) endef -TARGET_DEVICES += dockstar -define Device/goflexnet -$(Device/dockstar) - DEVICE_TITLE := Seagate GoFlexNet - DEVICE_DTS := kirkwood-goflexnet +define Device/cisco_on100 + DEVICE_TITLE := Cisco Systems ON100 + DEVICE_DTS := kirkwood-on100 + DEVICE_PACKAGES := kmod-i2c-mv64xxx + KERNEL_SIZE := 5376k + KERNEL_IN_UBI := 0 + UBINIZE_OPTS := -E 5 + IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := on100 endef -TARGET_DEVICES += goflexnet +TARGET_DEVICES += cisco_on100 -define Device/goflexhome -$(Device/dockstar) - DEVICE_TITLE := Seagate GoFlexHome - DEVICE_DTS := kirkwood-goflexhome +define Device/cloudengines_pogoe02 + DEVICE_TITLE := Cloud Engines Pogoplug E02 + DEVICE_DTS := kirkwood-pogo_e02 + BOARD_NAME := pogo_e02 + SUPPORTED_DEVICES += pogo_e02 endef -TARGET_DEVICES += goflexhome +TARGET_DEVICES += cloudengines_pogoe02 -define Device/linksys-audi +define Device/cloudengines_pogoplugv4 + DEVICE_TITLE := Cloud Engines Pogoplug V4 + DEVICE_DTS := kirkwood-pogoplug-series-4 + DEVICE_PACKAGES := kmod-usb3 +endef +TARGET_DEVICES += cloudengines_pogoplugv4 + +define Device/iom_iconnect-1.1 + DEVICE_TITLE := Iomega Iconnect + DEVICE_DTS := kirkwood-iconnect + BOARD_NAME := iconnect + SUPPORTED_DEVICES += iconnect +endef +TARGET_DEVICES += iom_iconnect-1.1 + +define Device/linksys_audi DEVICE_TITLE := Linksys EA3500 (Audi) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-mini DEVICE_DTS := kirkwood-linksys-audi KERNEL_SIZE := 2624k - FILESYSTEMS := squashfs - IMAGES += factory.bin + KERNEL_IN_UBI := 0 UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := linksys-audi + SUPPORTED_DEVICES += linksys-audi endef -TARGET_DEVICES += linksys-audi +TARGET_DEVICES += linksys_audi -define Device/linksys-viper +define Device/linksys_viper DEVICE_TITLE := Linksys E4200v2 / EA4500 (Viper) DEVICE_PACKAGES := kmod-mwl8k swconfig wpad-mini DEVICE_DTS := kirkwood-linksys-viper KERNEL_SIZE := 2688k - FILESYSTEMS := squashfs - IMAGES += factory.bin + KERNEL_IN_UBI := 0 UBINIZE_OPTS := -E 5 IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi + BOARD_NAME := linksys-viper + SUPPORTED_DEVICES += linksys-viper endef -TARGET_DEVICES += linksys-viper +TARGET_DEVICES += linksys_viper -define Device/iconnect -$(Device/dockstar) - DEVICE_TITLE := Iomega Iconnect - DEVICE_DTS := kirkwood-iconnect +define Device/raidsonic_ib-nas62x0 + DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 + DEVICE_DTS := kirkwood-ib62x0 + BOARD_NAME := ib62x0 + SUPPORTED_DEVICES += ib62x0 endef -TARGET_DEVICES += iconnect +TARGET_DEVICES += raidsonic_ib-nas62x0 -define Device/nsa310b -$(Device/dockstar) +define Device/seagate_dockstar + DEVICE_DTS := kirkwood-dockstar + DEVICE_TITLE := Seagate FreeAgent Dockstar + BOARD_NAME := dockstar + SUPPORTED_DEVICES += dockstar +endef +TARGET_DEVICES += seagate_dockstar + +define Device/seagate_goflexnet + DEVICE_TITLE := Seagate GoFlexNet + DEVICE_DTS := kirkwood-goflexnet + BOARD_NAME := goflexnet + SUPPORTED_DEVICES += goflexnet +endef +TARGET_DEVICES += seagate_goflexnet + +define Device/seagate_goflexhome + DEVICE_TITLE := Seagate GoFlexHome + DEVICE_DTS := kirkwood-goflexhome + BOARD_NAME := goflexhome + SUPPORTED_DEVICES += goflexhome +endef +TARGET_DEVICES += seagate_goflexhome + +define Device/zyxel_nsa310b DEVICE_TITLE := ZyXEL NSA310b DEVICE_DTS := kirkwood-nsa310b DEVICE_PACKAGES := kmod-r8169 kmod-gpio-button-hotplug kmod-hwmon-lm85 + BOARD_NAME := nsa310b endef -TARGET_DEVICES += nsa310b +TARGET_DEVICES += zyxel_nsa310b -define Device/nsa325 -$(Device/dockstar) +define Device/zyxel_nsa325 DEVICE_TITLE := ZyXEL NSA325 (v1 and v2) DEVICE_DTS := kirkwood-nsa325 DEVICE_PACKAGES := kmod-gpio-button-hotplug kmod-rtc-pcf8563 kmod-usb3 + BOARD_NAME := nsa325 endef -TARGET_DEVICES += nsa325 - -define Device/on100 - DEVICE_TITLE := Cisco Systems ON100 - DEVICE_DTS := kirkwood-on100 -# DEVICE_PACKAGES := kmod-mvsdio kmod-usb-storage kmod-i2c-core kmod-i2c-mv64xxx kmod-ata-core kmod-btmrvl kmod-btmrvl-sdio kmod-libertas kmod-libertas-sdio - DEVICE_PACKAGES := kmod-i2c-mv64xxx - KERNEL_SIZE := 5376k - IMAGES += factory.bin - IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi - UBINIZE_OPTS := -E 5 -endef -TARGET_DEVICES += on100 - -define Device/pogo_e02 -$(Device/dockstar) - DEVICE_TITLE := Cloud Engines Pogoplug E02 - DEVICE_DTS := kirkwood-pogo_e02 -endef -TARGET_DEVICES += pogo_e02 - -define Device/ib62x0 -$(Device/dockstar) - DEVICE_TITLE := RaidSonic ICY BOX IB-NAS62x0 - DEVICE_DTS := kirkwood-ib62x0 -endef -TARGET_DEVICES += ib62x0 +TARGET_DEVICES += zyxel_nsa325 $(eval $(call BuildImage)) diff --git a/target/linux/kirkwood/patches-4.9/100-ib62x0.patch b/target/linux/kirkwood/patches-4.9/100-ib62x0.patch index d6d10d814..f4e694737 100644 --- a/target/linux/kirkwood/patches-4.9/100-ib62x0.patch +++ b/target/linux/kirkwood/patches-4.9/100-ib62x0.patch @@ -1,5 +1,14 @@ --- a/arch/arm/boot/dts/kirkwood-ib62x0.dts +++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts +@@ -5,7 +5,7 @@ + + / { + model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)"; +- compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "raidsonic,ib-nas62x0", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; @@ -117,13 +117,13 @@ }; diff --git a/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch b/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch index 711022293..faf8d891a 100644 --- a/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch +++ b/target/linux/kirkwood/patches-4.9/107-02-nsa310b.patch @@ -32,7 +32,7 @@ NOTE: this patch can be upstreamed as-is, LEDE-specific + +/ { + model = "ZyXEL NSA310b"; -+ compatible = "zyxel,nsa310a", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; ++ compatible = "zyxel,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood"; + + memory { + device_type = "memory"; diff --git a/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch b/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch deleted file mode 100644 index 0e69f0cfa..000000000 --- a/target/linux/kirkwood/patches-4.9/107-03-nsa310s.patch +++ /dev/null @@ -1,267 +0,0 @@ ---- a/arch/arm/boot/dts/Makefile -+++ b/arch/arm/boot/dts/Makefile -@@ -239,6 +239,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310.dtb \ - kirkwood-nsa310a.dtb \ - kirkwood-nsa310b.dtb \ -+ kirkwood-nsa310s.dtb \ - kirkwood-nsa320.dtb \ - kirkwood-nsa325.dtb \ - kirkwood-openblocks_a6.dtb \ ---- /dev/null -+++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts -@@ -0,0 +1,254 @@ -+/dts-v1/; -+ -+#include "kirkwood-nsa3x0-common.dtsi" -+ -+/ { -+ model = "ZyXEL NSA310S"; -+ compatible = "zyxel,nsa320s", "marvell,kirkwood-88f6702", "marvell,kirkwood"; -+ -+ memory { -+ device_type = "memory"; -+ reg = <0x00000000 0x10000000>; -+ }; -+ -+ chosen { -+ bootargs = "console=ttyS0,115200n8 earlyprintk"; -+ stdout-path = &uart0; -+ }; -+ -+ ocp@f1000000 { -+ pinctrl: pin-controller@10000 { -+ pinctrl-names = "default"; -+ -+ pmx_sata0: pmx-sata0 { -+ marvell,pins; -+ marvell,function = "sata0"; -+ }; -+ -+ pmx_sata1: pmx-sata1 { -+ marvell,pins; -+ marvell,function = "sata1"; -+ }; -+ -+ pmx_usb_power: pmx-usb-power { -+ marvell,pins = "mpp21"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_pwr_off: pmx-pwr-off { -+ marvell,pins = "mpp27"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_reset: pmx-btn-reset { -+ marvell,pins = "mpp24"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_copy: pmx-btn-copy { -+ marvell,pins = "mpp25"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_btn_power: pmx-btn-power { -+ marvell,pins = "mpp26"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd2_green: pmx-led-hdd2-green { -+ marvell,pins = "mpp34"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd2_red: pmx-led-hdd2-red { -+ marvell,pins = "mpp12"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_usb_green: pmx-led-usb-green { -+ marvell,pins = "mpp15"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_copy_green: pmx-led-copy-green { -+ marvell,pins = "mpp22"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_copy_red: pmx-led-copy-red { -+ marvell,pins = "mpp23"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_green: pmx-led-sys-green { -+ marvell,pins = "mpp28"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_sys_orange: pmx-led-sys-orange { -+ marvell,pins = "mpp29"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd1_green: pmx-led-hdd1-green { -+ marvell,pins = "mpp16"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_led_hdd1_red: pmx-led-hdd1-red { -+ marvell,pins = "mpp13"; -+ marvell,function = "gpio"; -+ }; -+ -+ pmx_pwr_sata1: pmx-pwr-sata1 { -+ marvell,pins = "mpp33"; -+ marvell,function = "gpio"; -+ }; -+ -+ }; -+ -+ i2c@11000 { -+ status = "okay"; -+ -+ ht1382: rtc@68 { -+ compatible = "htk,ht1382"; -+ reg = <0x68>; -+ }; -+ }; -+ }; -+ -+ regulators { -+ compatible = "simple-bus"; -+ #address-cells = <1>; -+ #size-cells = <0>; -+ pinctrl-0 = <&pmx_pwr_sata1>; -+ pinctrl-names = "default"; -+ -+ usb0_power: regulator@1 { -+ enable-active-high; -+ }; -+ -+ sata1_power: regulator@2 { -+ compatible = "regulator-fixed"; -+ reg = <2>; -+ regulator-name = "SATA1 Power"; -+ regulator-min-microvolt = <5000000>; -+ regulator-max-microvolt = <5000000>; -+ regulator-always-on; -+ regulator-boot-on; -+ enable-active-high; -+ gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ gpio_keys { -+ power { -+ gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>; -+ }; -+ copy { -+ gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; -+ }; -+ reset { -+ gpios = <&gpio0 24 GPIO_ACTIVE_LOW>; -+ }; -+ }; -+ -+ gpio-leds { -+ compatible = "gpio-leds"; -+ -+ green-sys { -+ label = "nsa310s:green:sys"; -+ gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>; -+ }; -+ orange-sys { -+ label = "nsa310s:orange:sys"; -+ gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd1 { -+ label = "nsa310s:green:hdd1"; -+ gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd1 { -+ label = "nsa310s:red:hdd1"; -+ gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>; -+ }; -+ green-hdd2 { -+ label = "nsa310s:green:hdd2"; -+ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; -+ }; -+ red-hdd2 { -+ label = "nsa310s:red:hdd2"; -+ gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; -+ }; -+ green-usb { -+ label = "nsa310s:green:usb"; -+ gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>; -+ }; -+ green-copy { -+ label = "nsa310s:green:copy"; -+ gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>; -+ }; -+ red-copy { -+ label = "nsa310s:red:copy"; -+ gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>; -+ }; -+ }; -+ -+ gpio_poweroff { -+ gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>; -+ }; -+}; -+ -+&nand { -+ status = "okay"; -+ chip-delay = <35>; -+ -+ partition@0 { -+ label = "uboot"; -+ reg = <0x0000000 0xe0000>; -+ read-only; -+ }; -+ -+ partition@e0000 { -+ label = "uboot_env"; -+ reg = <0xe0000 0x100000>; -+ }; -+ -+ partition@100000 { -+ label = "second stage u-boot"; -+ reg = <0x100000 0x200000>; -+ }; -+ -+ partition@200000 { -+ label = "ubi"; -+ reg = <0x200000 0x7e00000>; -+ }; -+}; -+ -+&sata { -+ status = "okay"; -+ nr-ports = <2>; -+}; -+ -+&mdio { -+ status = "okay"; -+ ethphy0: ethernet-phy@1 { -+ compatible = "marvell,88e1318s"; -+ reg = <1>; -+ marvell,reg-init = <0x1 0x16 0x0 0x3>, -+ <0x1 0x10 0x0 0x1017>, -+ <0x1 0x11 0x0 0x4408>, -+ <0x1 0x16 0x0 0x0>, -+ <0x1 0x4 0x0 0x1e1>, -+ <0x1 0x9 0x0 0x300>, -+ <0x1 0x10 0x0 0x3860>, -+ <0x1 0x0 0x0 0x9140>; -+ }; -+}; -+ -+ð0 { -+ status = "okay"; -+ ethernet0-port@0 { -+ phy-handle = <ðphy0>; -+ }; -+}; diff --git a/target/linux/kirkwood/patches-4.9/108-on100.patch b/target/linux/kirkwood/patches-4.9/108-on100.patch index 28c3e535d..3cab70aaa 100644 --- a/target/linux/kirkwood/patches-4.9/108-on100.patch +++ b/target/linux/kirkwood/patches-4.9/108-on100.patch @@ -163,8 +163,8 @@ +}; --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -242,6 +242,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ - kirkwood-nsa310s.dtb \ +@@ -241,6 +241,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \ + kirkwood-nsa310b.dtb \ kirkwood-nsa320.dtb \ kirkwood-nsa325.dtb \ + kirkwood-on100.dtb \ diff --git a/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch b/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch new file mode 100644 index 000000000..dff1966d5 --- /dev/null +++ b/target/linux/kirkwood/patches-4.9/109-pogoplug_v4.patch @@ -0,0 +1,59 @@ +--- a/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts ++++ b/arch/arm/boot/dts/kirkwood-pogoplug-series-4.dts +@@ -23,6 +23,7 @@ + }; + + chosen { ++ bootargs = "console=ttyS0,115200"; + stdout-path = "uart0:115200n8"; + }; + +@@ -36,8 +37,8 @@ + eject { + debounce_interval = <50>; + wakeup-source; +- linux,code = ; +- label = "Eject Button"; ++ linux,code = ; ++ label = "Reset"; + gpios = <&gpio0 29 GPIO_ACTIVE_LOW>; + }; + }; +@@ -136,29 +137,19 @@ + #size-cells = <1>; + + partition@0 { +- label = "u-boot"; +- reg = <0x00000000 0x200000>; ++ label = "uboot"; ++ reg = <0x00000000 0x1c0000>; + read-only; + }; + +- partition@200000 { +- label = "uImage"; +- reg = <0x00200000 0x300000>; +- }; +- +- partition@500000 { +- label = "uImage2"; +- reg = <0x00500000 0x300000>; ++ partition@1c0000 { ++ label = "uboot_env"; ++ reg = <0x001c0000 0x40000>; + }; + +- partition@800000 { +- label = "failsafe"; +- reg = <0x00800000 0x800000>; +- }; +- +- partition@1000000 { +- label = "root"; +- reg = <0x01000000 0x7000000>; ++ partition@200000 { ++ label = "ubi"; ++ reg = <0x00200000 0x7e00000>; + }; + }; + }; diff --git a/target/linux/lantiq/base-files/etc/board.d/02_network b/target/linux/lantiq/base-files/etc/board.d/02_network index efe631c99..ca974b071 100755 --- a/target/linux/lantiq/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/base-files/etc/board.d/02_network @@ -229,7 +229,7 @@ buffalo,wbmr-300hpd) esac ls /lib/modules/$(uname -r)/ltq_atm* 1> /dev/null 2>&1 && \ - ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" + ucidef_add_atm_bridge "$vpi" "$vci" "$encaps" "$payload" "dsl" if lantiq_is_vdsl_system; then ucidef_add_vdsl_modem "$annex" "$tone" "$xfer_mode" diff --git a/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface index 292d407c3..3b0313d1a 100644 --- a/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface +++ b/target/linux/lantiq/base-files/etc/uci-defaults/02_migrate_xdsl_iface @@ -29,6 +29,17 @@ rename_xdsl_ifname() IFNAME_CHANGED=1 } +add_atm_bridge_nameprefix() +{ + local cfg="$1" + + config_get nameprefix "$cfg" nameprefix + [ -z "$nameprefix" ] || return + + uci set network.${cfg}.nameprefix="dsl" + IFNAME_CHANGED=1 +} + migrate_network_xdsl_ifname() { rename_xdsl_ifname network "$1" ifname @@ -42,6 +53,7 @@ migrate_led_xdsl_ifname() config_load network config_foreach migrate_network_xdsl_ifname +config_foreach add_atm_bridge_nameprefix atm-bridge [ "$IFNAME_CHANGED" = "1" ] && uci commit network diff --git a/target/linux/layerscape/armv8_32b/config-4.9 b/target/linux/layerscape/armv8_32b/config-4.9 index 9e5b33b88..0d98e8a13 100644 --- a/target/linux/layerscape/armv8_32b/config-4.9 +++ b/target/linux/layerscape/armv8_32b/config-4.9 @@ -990,7 +990,6 @@ CONFIG_PREEMPT_NOTIFIERS=y CONFIG_PRINTK_TIME=y # CONFIG_PROBE_EVENTS is not set CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_CPUSET=y CONFIG_PSTORE=y CONFIG_PSTORE_CONSOLE=y diff --git a/target/linux/layerscape/armv8_64b/config-4.9 b/target/linux/layerscape/armv8_64b/config-4.9 index 546e589be..bb7443431 100644 --- a/target/linux/layerscape/armv8_64b/config-4.9 +++ b/target/linux/layerscape/armv8_64b/config-4.9 @@ -941,7 +941,6 @@ CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y CONFIG_PRINT_QUOTA_WARNING=y CONFIG_PROC_CHILDREN=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PROC_PID_CPUSET=y CONFIG_PROFILING=y CONFIG_PTP_1588_CLOCK=y diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile index c2b50f55b..1833f95ba 100644 --- a/target/linux/malta/Makefile +++ b/target/linux/malta/Makefile @@ -14,7 +14,7 @@ INITRAMFS_EXTRA_FILES:= MAINTAINER:=Florian Fainelli FEATURES:=ramdisk -KERNEL_PATCHVER:=4.9 +KERNEL_PATCHVER:=4.14 include $(INCLUDE_DIR)/target.mk diff --git a/target/linux/malta/README b/target/linux/malta/README index e48665909..0bb1a1e35 100644 --- a/target/linux/malta/README +++ b/target/linux/malta/README @@ -5,15 +5,15 @@ troubleshoot MIPS applications without access to real hardware. To use the images built by OpenWrt with qemu, use the following commands: For the 32 bit little-endian image: -qemu-system-mipsel -kernel bin/targets/malta/le/lede-malta-le-vmlinux-initramfs.elf -nographic -m 256 +qemu-system-mipsel -kernel bin/targets/malta/le/openwrt-malta-le-vmlinux-initramfs.elf -nographic -m 256 For the 32 bit big-endian image: -qemu-system-mips -kernel bin/targets/malta/be/lede-malta-be-vmlinux-initramfs.elf -nographic -m 256 +qemu-system-mips -kernel bin/targets/malta/be/openwrt-malta-be-vmlinux-initramfs.elf -nographic -m 256 For the 64 bit little-endian image: -qemu-system-mips64el -kernel bin/targets/malta/le64/lede-malta-le64-vmlinux-initramfs.elf -nographic -m 256 +qemu-system-mips64el -kernel bin/targets/malta/le64/openwrt-malta-le64-vmlinux-initramfs.elf -nographic -m 256 For the 64 bit big-endian image: -qemu-system-mips64 -kernel bin/targets/malta/be64/lede-malta-be64-vmlinux-initramfs.elf -nographic -m 256 +qemu-system-mips64 -kernel bin/targets/malta/be64/openwrt-malta-be64-vmlinux-initramfs.elf -nographic -m 256 and enjoy the system bootin. diff --git a/target/linux/malta/config-4.14 b/target/linux/malta/config-4.14 new file mode 100644 index 000000000..61684be9a --- /dev/null +++ b/target/linux/malta/config-4.14 @@ -0,0 +1,309 @@ +CONFIG_ARCH_BINFMT_ELF_STATE=y +CONFIG_ARCH_CLOCKSOURCE_DATA=y +CONFIG_ARCH_DISCARD_MEMBLOCK=y +CONFIG_ARCH_HAS_ELF_RANDOMIZE=y +# CONFIG_ARCH_HAS_GCOV_PROFILE_ALL is not set +# CONFIG_ARCH_HAS_SG_CHAIN is not set +CONFIG_ARCH_MAY_HAVE_PC_FDC=y +CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y +CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y +CONFIG_ARCH_SUPPORTS_UPROBES=y +CONFIG_ARCH_USE_BUILTIN_BSWAP=y +CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y +CONFIG_ATA=y +CONFIG_ATA_PIIX=y +CONFIG_BLK_DEV_BSG=y +CONFIG_BLK_DEV_BSGLIB=y +# CONFIG_BLK_DEV_DM is not set +# CONFIG_BLK_DEV_INITRD is not set +# CONFIG_BLK_DEV_MD is not set +CONFIG_BLK_DEV_RAM=y +CONFIG_BLK_DEV_RAM_COUNT=16 +CONFIG_BLK_DEV_RAM_SIZE=4096 +CONFIG_BLK_DEV_SD=y +CONFIG_BLK_MQ_PCI=y +CONFIG_BOARD_SCACHE=y +CONFIG_BOOT_ELF32=y +CONFIG_BOUNCE=y +CONFIG_BUILTIN_DTB=y +CONFIG_CEVT_R4K=y +CONFIG_CLKBLD_I8253=y +CONFIG_CLKDEV_LOOKUP=y +CONFIG_CLKEVT_I8253=y +CONFIG_CLKSRC_I8253=y +CONFIG_CLKSRC_MIPS_GIC=y +CONFIG_CLKSRC_OF=y +CONFIG_CLKSRC_PROBE=y +CONFIG_CLONE_BACKWARDS=y +CONFIG_COMMON_CLK=y +# CONFIG_COMMON_CLK_BOSTON is not set +CONFIG_CONSOLE_TRANSLATIONS=y +CONFIG_CPU_GENERIC_DUMP_TLB=y +CONFIG_CPU_HAS_PREFETCH=y +CONFIG_CPU_HAS_RIXI=y +# CONFIG_CPU_HAS_SMARTMIPS is not set +CONFIG_CPU_HAS_SYNC=y +# CONFIG_CPU_MICROMIPS is not set +CONFIG_CPU_MIPS32=y +# CONFIG_CPU_MIPS32_3_5_FEATURES is not set +# CONFIG_CPU_MIPS32_R1 is not set +# CONFIG_CPU_MIPS32_R2 is not set +# CONFIG_CPU_MIPS32_R5_FEATURES is not set +# CONFIG_CPU_MIPS32_R6 is not set +# CONFIG_CPU_MIPS64_R1 is not set +# CONFIG_CPU_MIPS64_R2 is not set +# CONFIG_CPU_MIPS64_R6 is not set +CONFIG_CPU_MIPSR2=y +CONFIG_CPU_MIPSR2_IRQ_EI=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y +# CONFIG_CPU_NEVADA is not set +CONFIG_CPU_R4K_CACHE_TLB=y +CONFIG_CPU_R4K_FPU=y +# CONFIG_CPU_RM7000 is not set +CONFIG_CPU_RMAP=y +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y +CONFIG_CPU_SUPPORTS_HIGHMEM=y +CONFIG_CPU_SUPPORTS_MSA=y +CONFIG_CRC16=y +CONFIG_CRYPTO_AEAD=y +CONFIG_CRYPTO_AEAD2=y +CONFIG_CRYPTO_CRC32C=y +CONFIG_CRYPTO_HASH=y +CONFIG_CRYPTO_HASH2=y +CONFIG_CRYPTO_MANAGER=y +CONFIG_CRYPTO_MANAGER2=y +CONFIG_CRYPTO_NULL2=y +CONFIG_CRYPTO_RNG2=y +CONFIG_CRYPTO_WORKQUEUE=y +CONFIG_CSRC_R4K=y +CONFIG_DMA_MAYBE_COHERENT=y +CONFIG_DMA_NONCOHERENT=y +CONFIG_DNOTIFY=y +CONFIG_DTC=y +CONFIG_DUMMY_CONSOLE=y +CONFIG_ENABLE_MUST_CHECK=y +CONFIG_EXT4_FS=y +CONFIG_FIRMWARE_IN_KERNEL=y +CONFIG_FS_MBCACHE=y +CONFIG_FS_POSIX_ACL=y +CONFIG_GENERIC_ATOMIC64=y +CONFIG_GENERIC_CLOCKEVENTS=y +CONFIG_GENERIC_CMOS_UPDATE=y +CONFIG_GENERIC_IO=y +CONFIG_GENERIC_IRQ_CHIP=y +CONFIG_GENERIC_IRQ_IPI=y +CONFIG_GENERIC_IRQ_SHOW=y +CONFIG_GENERIC_ISA_DMA=y +CONFIG_GENERIC_PCI_IOMAP=y +CONFIG_GENERIC_SCHED_CLOCK=y +CONFIG_GENERIC_SMP_IDLE_THREAD=y +CONFIG_GENERIC_TIME_VSYSCALL=y +CONFIG_GLOB=y +CONFIG_HANDLE_DOMAIN_IRQ=y +CONFIG_HARDWARE_WATCHPOINTS=y +CONFIG_HAS_DMA=y +CONFIG_HAS_IOMEM=y +CONFIG_HAS_IOPORT_MAP=y +# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set +# CONFIG_HAVE_ARCH_BITREVERSE is not set +CONFIG_HAVE_ARCH_JUMP_LABEL=y +CONFIG_HAVE_ARCH_KGDB=y +CONFIG_HAVE_ARCH_SECCOMP_FILTER=y +CONFIG_HAVE_ARCH_TRACEHOOK=y +# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set +CONFIG_HAVE_CBPF_JIT=y +CONFIG_HAVE_CC_STACKPROTECTOR=y +CONFIG_HAVE_CLK=y +CONFIG_HAVE_CLK_PREPARE=y +CONFIG_HAVE_CONTEXT_TRACKING=y +CONFIG_HAVE_C_RECORDMCOUNT=y +CONFIG_HAVE_DEBUG_KMEMLEAK=y +CONFIG_HAVE_DEBUG_STACKOVERFLOW=y +CONFIG_HAVE_DMA_API_DEBUG=y +CONFIG_HAVE_DMA_CONTIGUOUS=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y +CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y +CONFIG_HAVE_FUNCTION_TRACER=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y +CONFIG_HAVE_IDE=y +CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y +CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y +CONFIG_HAVE_KVM=y +CONFIG_HAVE_LATENCYTOP_SUPPORT=y +CONFIG_HAVE_MEMBLOCK=y +CONFIG_HAVE_MEMBLOCK_NODE_MAP=y +CONFIG_HAVE_MOD_ARCH_SPECIFIC=y +CONFIG_HAVE_NET_DSA=y +CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_PCSPKR_PLATFORM=y +CONFIG_HAVE_PERF_EVENTS=y +CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y +CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y +CONFIG_HW_CONSOLE=y +CONFIG_HW_HAS_PCI=y +CONFIG_I8253=y +CONFIG_I8253_LOCK=y +CONFIG_I8259=y +CONFIG_INPUT=y +# CONFIG_INPUT_MISC is not set +CONFIG_INPUT_MOUSEDEV=y +CONFIG_INPUT_MOUSEDEV_PSAUX=y +CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024 +CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768 +# CONFIG_IP_MROUTE is not set +CONFIG_IRQCHIP=y +CONFIG_IRQ_DOMAIN=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +CONFIG_IRQ_FORCED_THREADING=y +CONFIG_IRQ_MIPS_CPU=y +CONFIG_IRQ_WORK=y +CONFIG_ISA_DMA_API=y +CONFIG_JBD2=y +CONFIG_JFFS2_FS_POSIX_ACL=y +CONFIG_JFFS2_FS_SECURITY=y +CONFIG_KALLSYMS=y +CONFIG_KERNEL_GZIP=y +# CONFIG_KERNEL_XZ is not set +# CONFIG_LEDS_TRIGGER_TIMER is not set +CONFIG_LEGACY_PTYS=y +CONFIG_LEGACY_PTY_COUNT=256 +CONFIG_LIBFDT=y +CONFIG_MD=y +CONFIG_MIPS=y +CONFIG_MIPS_ASID_BITS=8 +CONFIG_MIPS_ASID_SHIFT=0 +CONFIG_MIPS_BONITO64=y +CONFIG_MIPS_CLOCK_VSYSCALL=y +CONFIG_MIPS_CM=y +# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set +CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y +# CONFIG_MIPS_CMDLINE_FROM_DTB is not set +# CONFIG_MIPS_CMP is not set +# CONFIG_MIPS_CPS is not set +CONFIG_MIPS_CPU_SCACHE=y +# CONFIG_MIPS_ELF_APPENDED_DTB is not set +CONFIG_MIPS_EXTERNAL_TIMER=y +CONFIG_MIPS_GIC=y +# CONFIG_MIPS_HUGE_TLB_SUPPORT is not set +CONFIG_MIPS_L1_CACHE_SHIFT=6 +CONFIG_MIPS_L1_CACHE_SHIFT_6=y +# CONFIG_MIPS_MACHINE is not set +CONFIG_MIPS_MALTA=y +CONFIG_MIPS_MALTA_PM=y +CONFIG_MIPS_MSC=y +CONFIG_MIPS_MT=y +CONFIG_MIPS_MT_FPAFF=y +CONFIG_MIPS_MT_SMP=y +CONFIG_MIPS_NO_APPENDED_DTB=y +CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +# CONFIG_MIPS_RAW_APPENDED_DTB is not set +CONFIG_MIPS_SPRAM=y +# CONFIG_MIPS_VPE_LOADER is not set +CONFIG_MODULES_TREE_LOOKUP=y +CONFIG_MODULES_USE_ELF_REL=y +CONFIG_MODULE_FORCE_UNLOAD=y +CONFIG_MTD_CFI_STAA=y +# CONFIG_MTD_COMPLEX_MAPPINGS is not set +CONFIG_MTD_PHYSMAP=y +CONFIG_NEED_DMA_MAP_STATE=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y +CONFIG_NO_HZ=y +CONFIG_NO_HZ_COMMON=y +CONFIG_NO_HZ_IDLE=y +# CONFIG_NO_IOPORT_MAP is not set +CONFIG_NR_CPUS=2 +CONFIG_OF=y +CONFIG_OF_ADDRESS=y +CONFIG_OF_ADDRESS_PCI=y +CONFIG_OF_EARLY_FLATTREE=y +CONFIG_OF_FLATTREE=y +CONFIG_OF_IRQ=y +CONFIG_OF_NET=y +CONFIG_OF_PCI=y +CONFIG_OF_PCI_IRQ=y +CONFIG_PADATA=y +# CONFIG_PARTITION_ADVANCED is not set +CONFIG_PCI=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_DRIVERS_LEGACY=y +CONFIG_PCI_GT64XXX_PCI0=y +CONFIG_PCSPKR_PLATFORM=y +CONFIG_PERF_EVENTS=y +CONFIG_PERF_USE_VMALLOC=y +CONFIG_PGTABLE_LEVELS=2 +CONFIG_PRINT_QUOTA_WARNING=y +CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 +CONFIG_PROC_PAGE_MONITOR=y +# CONFIG_QFMT_V1 is not set +CONFIG_QFMT_V2=y +CONFIG_QUOTA=y +CONFIG_QUOTACTL=y +# CONFIG_QUOTA_NETLINK_INTERFACE is not set +CONFIG_QUOTA_TREE=y +CONFIG_RATIONAL=y +CONFIG_RCU_STALL_COMMON=y +CONFIG_RELAY=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_RTC_CLASS=y +CONFIG_RTC_MC146818_LIB=y +# CONFIG_SCHED_INFO is not set +CONFIG_SCSI=y +CONFIG_SECCOMP=y +CONFIG_SECCOMP_FILTER=y +# CONFIG_SERIAL_8250_FSL is not set +CONFIG_SERIAL_8250_NR_UARTS=4 +CONFIG_SERIAL_8250_RUNTIME_UARTS=4 +CONFIG_SERIO=y +CONFIG_SERIO_SERPORT=y +CONFIG_SG_POOL=y +CONFIG_SMP=y +CONFIG_SMP_UP=y +CONFIG_SRCU=y +CONFIG_SWAP_IO_SPACE=y +CONFIG_SYNC_R4K=y +CONFIG_SYSCTL_EXCEPTION_TRACE=y +CONFIG_SYSFS_DEPRECATED=y +CONFIG_SYSFS_DEPRECATED_V2=y +CONFIG_SYS_HAS_CPU_MIPS32_R1=y +CONFIG_SYS_HAS_CPU_MIPS32_R2=y +CONFIG_SYS_HAS_CPU_MIPS32_R3_5=y +CONFIG_SYS_HAS_CPU_MIPS32_R5=y +CONFIG_SYS_HAS_CPU_MIPS32_R6=y +CONFIG_SYS_HAS_CPU_MIPS64_R1=y +CONFIG_SYS_HAS_CPU_MIPS64_R2=y +CONFIG_SYS_HAS_CPU_MIPS64_R6=y +CONFIG_SYS_HAS_CPU_NEVADA=y +CONFIG_SYS_HAS_CPU_RM7000=y +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_64BIT_KERNEL=y +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y +CONFIG_SYS_SUPPORTS_HIGHMEM=y +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y +CONFIG_SYS_SUPPORTS_MICROMIPS=y +CONFIG_SYS_SUPPORTS_MIPS16=y +CONFIG_SYS_SUPPORTS_MIPS_CMP=y +CONFIG_SYS_SUPPORTS_MIPS_CPS=y +CONFIG_SYS_SUPPORTS_MULTITHREADING=y +CONFIG_SYS_SUPPORTS_RELOCATABLE=y +CONFIG_SYS_SUPPORTS_SCHED_SMT=y +CONFIG_SYS_SUPPORTS_SMARTMIPS=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_SYS_SUPPORTS_ZBOOT=y +CONFIG_TICK_CPU_ACCOUNTING=y +CONFIG_TREE_RCU=y +CONFIG_USB_SUPPORT=y +# CONFIG_USERIO is not set +CONFIG_USE_OF=y +# CONFIG_VGA_CONSOLE is not set +CONFIG_VM_EVENT_COUNTERS=y +CONFIG_VT=y +CONFIG_VT_CONSOLE=y +CONFIG_VT_HW_CONSOLE_BINDING=y +CONFIG_VXFS_FS=y +CONFIG_XPS=y diff --git a/target/linux/mpc85xx/config-4.9 b/target/linux/mpc85xx/config-4.9 index f8114215f..68568c4a6 100644 --- a/target/linux/mpc85xx/config-4.9 +++ b/target/linux/mpc85xx/config-4.9 @@ -290,7 +290,6 @@ CONFIG_PPC_UDBG_16550=y CONFIG_PPC_WERROR=y # CONFIG_PPC_XICS is not set # CONFIG_PQ2ADS is not set -CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PTP_1588_CLOCK_GIANFAR is not set CONFIG_QE_GPIO=y CONFIG_QE_USB=y diff --git a/target/linux/octeon/config-4.14 b/target/linux/octeon/config-4.14 index 687b37f3c..24cba2b80 100644 --- a/target/linux/octeon/config-4.14 +++ b/target/linux/octeon/config-4.14 @@ -259,7 +259,6 @@ CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y CONFIG_PRINTK_SAFE_LOG_BUF_SHIFT=13 -CONFIG_PROC_PAGE_MONITOR=y CONFIG_QUEUED_RWLOCKS=y CONFIG_QUEUED_SPINLOCKS=y CONFIG_RCU_NEED_SEGCBLIST=y diff --git a/target/linux/octeon/config-4.9 b/target/linux/octeon/config-4.9 index 280244669..5599b2407 100644 --- a/target/linux/octeon/config-4.9 +++ b/target/linux/octeon/config-4.9 @@ -233,7 +233,6 @@ CONFIG_PHYLIB=y CONFIG_PHYS_ADDR_T_64BIT=y CONFIG_POSIX_MQUEUE=y CONFIG_POSIX_MQUEUE_SYSCTL=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_RCU_STALL_COMMON=y CONFIG_RELAY=y CONFIG_RFS_ACCEL=y diff --git a/target/linux/ramips/base-files/etc/board.d/01_leds b/target/linux/ramips/base-files/etc/board.d/01_leds index 03d084f17..3e26493e5 100755 --- a/target/linux/ramips/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/base-files/etc/board.d/01_leds @@ -56,6 +56,10 @@ air3gii) set_wifi_led "$boardname:green:wlan" set_usb_led "$boardname:green:mobile" ;; +alfa-network,ac1200rm) + set_wifi_led "$boardname:green:wlan2g" "wlan1" + ucidef_set_led_default "wps" "wps" "$boardname:green:wps" "0" + ;; all0256n-4M|\ all0256n-8M) ucidef_set_rssimon "wlan0" "200000" "1" @@ -453,8 +457,7 @@ y1) set_usb_led "$boardname:blue:usb" ucidef_set_led_netdev "wifi" "WIFI" "$boardname:blue:wifi" "wlan1" ucidef_set_led_netdev "wifi5g" "WIFI5G" "$boardname:blue:wifi5g" "wlan0" - ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0.1" "tx rx" - ucidef_set_led_netdev "wan" "WAN" "$boardname:blue:internet" "eth0.2" "tx rx" + ucidef_set_led_switch "lan" "LAN" "$boardname:blue:lan" "switch0" "0x03" ;; y1s) set_usb_led "$boardname:blue:usb" diff --git a/target/linux/ramips/base-files/etc/board.d/02_network b/target/linux/ramips/base-files/etc/board.d/02_network index b8116c773..105f5e9e3 100755 --- a/target/linux/ramips/base-files/etc/board.d/02_network +++ b/target/linux/ramips/base-files/etc/board.d/02_network @@ -71,6 +71,7 @@ ramips_setup_interfaces() ;; 3g-6200n|\ ai-br100|\ + alfa-network,ac1200rm|\ d240|\ db-wrt01|\ dir-300-b7|\ @@ -111,7 +112,6 @@ ramips_setup_interfaces() wndr3700v5|\ wt1520-4M|\ wt1520-8M|\ - y1|\ youku-yk1|\ zbt-ape522ii|\ zbt-we1326|\ @@ -348,6 +348,10 @@ ramips_setup_interfaces() ucidef_add_switch "switch0" \ "1:lan" "2:lan" "0:wan" "6@eth0" ;; + y1) + ucidef_add_switch "switch0" \ + "0:lan:2" "1:lan:1" "4:wan" "6@eth0" + ;; *) RT3X5X=`cat /proc/cpuinfo | egrep "(RT3.5|RT5350)"` if [ -n "${RT3X5X}" ]; then diff --git a/target/linux/ramips/base-files/etc/diag.sh b/target/linux/ramips/base-files/etc/diag.sh index d7cc4173a..e1d29152f 100644 --- a/target/linux/ramips/base-files/etc/diag.sh +++ b/target/linux/ramips/base-files/etc/diag.sh @@ -25,6 +25,7 @@ get_status_led() { ex2700|\ ex3700|\ fonera20n|\ + firewrt|\ hg255d|\ kn|\ kn_rc|\ @@ -68,6 +69,13 @@ get_status_led() { ht-tm02) status_led="$boardname:blue:wlan" ;; + alfa-network,ac1200rm|\ + awapn2403|\ + dir-645|\ + sk-wb8|\ + wrh-300cr) + status_led="$boardname:green:wps" + ;; all0239-3g|\ dcs-930|\ dir-300-b1|\ @@ -101,12 +109,6 @@ get_status_led() { ip2202) status_led="$boardname:green:run" ;; - awapn2403|\ - dir-645|\ - sk-wb8|\ - wrh-300cr) - status_led="$boardname:green:wps" - ;; c108) status_led="$boardname:green:lan" ;; diff --git a/target/linux/ramips/base-files/lib/upgrade/platform.sh b/target/linux/ramips/base-files/lib/upgrade/platform.sh index 8160f5d38..cd2100132 100755 --- a/target/linux/ramips/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/base-files/lib/upgrade/platform.sh @@ -16,6 +16,7 @@ platform_check_image() { a5-v11|\ ai-br100|\ air3gii|\ + alfa-network,ac1200rm|\ all0239-3g|\ all0256n-4M|\ all0256n-8M|\ diff --git a/target/linux/ramips/dts/AC1200RM.dts b/target/linux/ramips/dts/AC1200RM.dts new file mode 100644 index 000000000..9305cb00e --- /dev/null +++ b/target/linux/ramips/dts/AC1200RM.dts @@ -0,0 +1,171 @@ +/* + * BSD LICENSE + * + * Copyright (C) 2018 Piotr Dymacz + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the names of the copyright holders nor the names of any + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/dts-v1/; + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "alfa-network,ac1200rm", "ralink,mt7620a-soc"; + model = "ALFA Network AC1200RM"; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-keys-polled { + compatible = "gpio-keys-polled"; + #address-cells = <1>; + #size-cells = <0>; + poll-interval = <20>; + + reset { + label = "reset"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + wlan2g { + label = "ac1200rm:green:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "ac1200rm:green:wps"; + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&ehci { + status = "okay"; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; + pinctrl-names = "default"; + pinctrl-0 = <&ephy_pins>; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&gsw { + mediatek,port4 = "ephy"; +}; + +&ohci { + status = "okay"; +}; + +&pcie { + status = "okay"; + + pcie-bridge { + mt76@0,0 { + reg = <0x0000 0 0 0 0>; + device_type = "pci"; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + + led { + led-sources = <2>; + led-active-low; + }; + }; + }; +}; + +&pinctrl { + state_default: pinctrl0 { + gpio { + ralink,group = "nd_sd", "spi refclk", "wled"; + ralink,function = "gpio"; + }; + }; +}; + +&spi0 { + status = "okay"; + + m25p80@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0>; +}; diff --git a/target/linux/ramips/dts/GB-PC1.dts b/target/linux/ramips/dts/GB-PC1.dts index df7caa910..664dfa1ef 100644 --- a/target/linux/ramips/dts/GB-PC1.dts +++ b/target/linux/ramips/dts/GB-PC1.dts @@ -102,6 +102,11 @@ }; }; +&cpuclock { + compatible = "fixed-clock"; + clock-frequency = <90000000>; +}; + &pcie { status = "okay"; }; diff --git a/target/linux/ramips/dts/UBNT-ER-e50.dtsi b/target/linux/ramips/dts/UBNT-ER-e50.dtsi index b38c71949..0947dd610 100644 --- a/target/linux/ramips/dts/UBNT-ER-e50.dtsi +++ b/target/linux/ramips/dts/UBNT-ER-e50.dtsi @@ -4,7 +4,7 @@ #include / { - compatible = "ubiquiti,edgerouterx"; + compatible = "ubiquiti,edgerouterx", "mediatek,mt7621-soc"; memory@0 { device_type = "memory"; diff --git a/target/linux/ramips/dts/UBNT-ERX-SFP.dts b/target/linux/ramips/dts/UBNT-ERX-SFP.dts index ca26d8172..7de37804a 100644 --- a/target/linux/ramips/dts/UBNT-ERX-SFP.dts +++ b/target/linux/ramips/dts/UBNT-ERX-SFP.dts @@ -6,7 +6,7 @@ / { model = "UBNT-ERX-SFP"; - compatible = "ubiquiti,edgerouterx-sfp"; + compatible = "ubiquiti,edgerouterx-sfp", "mediatek,mt7621-soc"; i2c-gpio { compatible = "i2c-gpio"; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 902677f3a..6f9aa1aa6 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -27,6 +27,15 @@ define Device/ai-br100 endef TARGET_DEVICES += ai-br100 +define Device/alfa-network_ac1200rm + DTS := AC1200RM + IMAGE_SIZE := 16064k + DEVICE_TITLE := ALFA Network AC1200RM + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SUPPORTED_DEVICES := $(subst _,$(comma),$(1)) +endef +TARGET_DEVICES += alfa-network_ac1200rm + define Device/Archer TPLINK_HWREVADD := 0 TPLINK_HVERSION := 3 diff --git a/target/linux/sunxi/config-4.9 b/target/linux/sunxi/config-4.9 index e961c8ad8..bf2111dc0 100644 --- a/target/linux/sunxi/config-4.9 +++ b/target/linux/sunxi/config-4.9 @@ -1,4 +1,3 @@ -CONFIG_ADVISE_SYSCALLS=y # CONFIG_AHCI_SUNXI is not set CONFIG_ALIGNMENT_TRAP=y # CONFIG_ARCH_AXXIA is not set @@ -331,6 +330,7 @@ CONFIG_MDIO_SUN4I=y CONFIG_MEDIA_SUPPORT=y # CONFIG_MFD_AC100 is not set CONFIG_MFD_AXP20X=y +CONFIG_MFD_AXP20X_I2C=y CONFIG_MFD_AXP20X_RSB=y CONFIG_MFD_CORE=y CONFIG_MFD_SUN6I_PRCM=y @@ -427,7 +427,6 @@ CONFIG_PREEMPT_NOTIFIERS=y CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PTP_1588_CLOCK=y CONFIG_PWM=y CONFIG_PWM_SUN4I=y diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index b5003546c..76366a7d7 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -272,6 +272,7 @@ CONFIG_JBD2=y CONFIG_KALLSYMS=y CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y +# CONFIG_KEXEC_FILE is not set CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y diff --git a/target/linux/x86/generic/config-default b/target/linux/x86/generic/config-default index c7e7ed366..327e7c647 100644 --- a/target/linux/x86/generic/config-default +++ b/target/linux/x86/generic/config-default @@ -72,8 +72,6 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y -# CONFIG_DRM_DEBUG_MM is not set -# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set diff --git a/target/linux/x86/legacy/config-default b/target/linux/x86/legacy/config-default index a438eedd8..d1a4e8103 100644 --- a/target/linux/x86/legacy/config-default +++ b/target/linux/x86/legacy/config-default @@ -58,8 +58,6 @@ CONFIG_DRM_AMDGPU=y # CONFIG_DRM_AMD_ACP is not set CONFIG_DRM_BOCHS=y CONFIG_DRM_BRIDGE=y -# CONFIG_DRM_DEBUG_MM is not set -# CONFIG_DRM_DEBUG_MM_SELFTEST is not set CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100 # CONFIG_DRM_GMA500 is not set diff --git a/target/linux/xburst/config-3.18 b/target/linux/xburst/config-3.18 index e1b28d66b..099f5b0ed 100644 --- a/target/linux/xburst/config-3.18 +++ b/target/linux/xburst/config-3.18 @@ -251,7 +251,6 @@ CONFIG_PREEMPT_COUNT=y # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_RCU=y CONFIG_PRINTK_TIME=y -CONFIG_PROC_PAGE_MONITOR=y CONFIG_PWM=y CONFIG_PWM_JZ4740=y CONFIG_PWM_SYSFS=y diff --git a/target/linux/zynq/config-4.4 b/target/linux/zynq/config-4.4 index 2bab6f219..e22f2325a 100644 --- a/target/linux/zynq/config-4.4 +++ b/target/linux/zynq/config-4.4 @@ -544,7 +544,6 @@ CONFIG_PREEMPT_COUNT=y # CONFIG_PREEMPT_NONE is not set CONFIG_PREEMPT_RCU=y CONFIG_PROC_EVENTS=y -CONFIG_PROC_PAGE_MONITOR=y # CONFIG_PROC_STRIPPED is not set CONFIG_PTP_1588_CLOCK=y CONFIG_R8169=y diff --git a/target/sdk/Makefile b/target/sdk/Makefile index ba2867406..d3822a0df 100644 --- a/target/sdk/Makefile +++ b/target/sdk/Makefile @@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk include $(INCLUDE_DIR)/version.mk +include $(INCLUDE_DIR)/download.mk override MAKEFLAGS= @@ -45,7 +46,7 @@ GIT_TAGNAME:=$(shell git show-ref --tags --dereference 2>/dev/null | sed -ne '/^ BASE_FEED:=$(if $(GIT_URL),src-git base $(GIT_URL)$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn info 2>/dev/null | sed -ne 's/^URL: /src-gitsvn base /p')) BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p')) -BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base https://git.openwrt.org/source.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) +BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME)))) KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR)) From 9be7e982e7418bb6b07be0c0126be98b25c4ded6 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Mon, 15 Jan 2018 19:25:36 +0800 Subject: [PATCH 95/95] add ahci sata support --- target/linux/x86/config-4.14 | 1 + target/linux/x86/config-4.9 | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/linux/x86/config-4.14 b/target/linux/x86/config-4.14 index b88fa77e1..c742b75d1 100644 --- a/target/linux/x86/config-4.14 +++ b/target/linux/x86/config-4.14 @@ -522,3 +522,4 @@ CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_XZ_DEC_BCJ=y CONFIG_XZ_DEC_X86=y CONFIG_ZLIB_INFLATE=y +CONFIG_SATA_AHCI=y \ No newline at end of file diff --git a/target/linux/x86/config-4.9 b/target/linux/x86/config-4.9 index 76366a7d7..e70aec6b7 100644 --- a/target/linux/x86/config-4.9 +++ b/target/linux/x86/config-4.9 @@ -40,6 +40,7 @@ CONFIG_ARCH_USE_BUILTIN_BSWAP=y CONFIG_ARCH_USE_QUEUED_RWLOCKS=y CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT=y +CONFIG_ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH=y CONFIG_ARCH_WANT_FRAME_POINTERS=y CONFIG_ARCH_WANT_GENERAL_HUGETLB=y CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y @@ -272,7 +273,6 @@ CONFIG_JBD2=y CONFIG_KALLSYMS=y CONFIG_KEXEC=y CONFIG_KEXEC_CORE=y -# CONFIG_KEXEC_FILE is not set CONFIG_KEYBOARD_ATKBD=y # CONFIG_LEDS_CLEVO_MAIL is not set CONFIG_LIBNVDIMM=y @@ -369,6 +369,7 @@ CONFIG_RD_GZIP=y CONFIG_RTC_CLASS=y CONFIG_RTC_MC146818_LIB=y CONFIG_RWSEM_XCHGADD_ALGORITHM=y +CONFIG_SATA_AHCI=y # CONFIG_SBC7240_WDT is not set # CONFIG_SBC8360_WDT is not set # CONFIG_SBC_EPX_C3_WATCHDOG is not set @@ -388,6 +389,7 @@ CONFIG_SERIO_I8042=y CONFIG_SERIO_LIBPS2=y CONFIG_SERIO_SERPORT=y CONFIG_SG_POOL=y +# CONFIG_SHORTCUT_FE is not set # CONFIG_SMSC37B787_WDT is not set # CONFIG_SMSC_SCH311X_WDT is not set CONFIG_SPARSEMEM_STATIC=y